Add eslint rule padding-line-between-statements (#1593)

Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
Panu Horsmalahti authored and GitHub committed 2020-12-02 09:55:52 +02:00
1 parent 7b77f18376
commit dcf253e7d5
401 files changed
+2018 -40

No files matched your search

@@ -56,22 +56,27 @@ export class Select extends React.Component<SelectProps> {
@computed get selectedOption() {
const { value, isMulti } = this.props;
if (isMulti) {
return this.options.filter(opt => {
const values = value ? [].concat(value) : [];
return values.includes(opt) || values.includes(opt.value);
});
}
return this.options.find(opt => opt === value || opt.value === value);
}
@computed get options(): SelectOption[] {
const { autoConvertOptions, options } = this.props;
if (autoConvertOptions && Array.isArray(options)) {
return options.map(opt => {
return this.isValidOption(opt) ? opt : { value: opt, label: String(opt) };
});
}
return options as SelectOption[];
}
@@ -88,6 +93,7 @@ export class Select extends React.Component<SelectProps> {
this.props.onKeyDown(evt);
}
const escapeKey = evt.nativeEvent.code === "Escape";
if (escapeKey) evt.stopPropagation(); // don't close the <Dialog/>
}
@@ -117,6 +123,7 @@ export class Select extends React.Component<SelectProps> {
),
}
};
return isCreatable
? <Creatable {...selectProps}/>
: <ReactSelect {...selectProps}/>;