mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add eslint rule padding-line-between-statements (#1593)
Signed-off-by: Panu Horsmalahti <phorsmalahti@mirantis.com>
This commit is contained in:
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}/>;
|
||||
|
||||
Reference in new issue
Block a user