alaska-field-select
Advanced tools
Comparing version 0.12.11 to 0.12.12
{ | ||
"name": "alaska-field-select", | ||
"version": "0.12.11", | ||
"version": "0.12.12", | ||
"description": "Alaska select field", | ||
@@ -15,5 +15,5 @@ "keywords": [ | ||
"dependencies": { | ||
"alaska-field-checkbox": "^0.12.10", | ||
"react-select": "^1.2.0" | ||
"alaska-field-checkbox": "^0.12.12", | ||
"react-select": "^1.2.1" | ||
} | ||
} |
@@ -14,3 +14,3 @@ // @flow | ||
type State = { | ||
options?: Alaska$SelectField$option[], | ||
options: Alaska$SelectField$option[], | ||
optionsMap: { | ||
@@ -32,3 +32,3 @@ [value: string]: Alaska$SelectField$option, | ||
this.state = { | ||
options: props.options, | ||
options: this.processOptions(props.options), | ||
optionsMap: {}, | ||
@@ -55,3 +55,3 @@ }; | ||
if (props.options !== this.props.options) { | ||
state.options = props.options; | ||
state.options = this.processOptions(props.options); | ||
state.optionsMap = {}; | ||
@@ -78,2 +78,11 @@ if (props.options) { | ||
processOptions(options?: Alaska$SelectField$option[]): Alaska$SelectField$option[] { | ||
return _.map(options || [], (opt) => { | ||
if (typeof opt.style === 'string') { | ||
opt = _.omit(opt, 'style'); | ||
} | ||
return opt; | ||
}); | ||
} | ||
processValue = (value: any) => { | ||
@@ -175,3 +184,3 @@ let optionsMap = this.state.optionsMap; | ||
// $Flow | ||
options={this.state.options || []} | ||
options={this.state.options} | ||
disabled={disabled} | ||
@@ -178,0 +187,0 @@ placeholder={t('Select...')} |
@@ -134,3 +134,3 @@ // @flow | ||
style={{ display: 'inline-block', marginRight: 16 }} | ||
onCheck={() => this.handleCheck(vid)} | ||
onChange={() => this.handleCheck(vid)} | ||
/>); | ||
@@ -137,0 +137,0 @@ }) |
@@ -9,3 +9,2 @@ // @flow | ||
import Switch from './Switch'; | ||
import { getOptionValue } from './utils'; | ||
@@ -12,0 +11,0 @@ type State = { |
@@ -117,20 +117,18 @@ // @flow | ||
if (field.horizontal === false) { | ||
let labelElement = label ? <label className="control-label">{label}</label> : null; | ||
if (field.horizontal) { | ||
return ( | ||
<div className={className}> | ||
{labelElement} | ||
{inputElement} | ||
{helpElement} | ||
<label className="col-sm-2 control-label">{label}</label> | ||
<div className="col-sm-10"> | ||
{inputElement} | ||
{helpElement} | ||
</div> | ||
</div> | ||
); | ||
} | ||
return ( | ||
<div className={className}> | ||
<label className="col-sm-2 control-label">{label}</label> | ||
<div className="col-sm-10"> | ||
{inputElement} | ||
{helpElement} | ||
</div> | ||
{label ? <label className="control-label">{label}</label> : null} | ||
{inputElement} | ||
{helpElement} | ||
</div> | ||
@@ -137,0 +135,0 @@ ); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23228
754
Updatedreact-select@^1.2.1