@evoke-platform/ui-components 1.0.0-dev.105 → 1.0.0-dev.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,7 @@ import { AutocompleteProps as MUIAutocompleteProps } from '@mui/material';
|
|
3
3
|
export declare type AutocompleteOption = {
|
4
4
|
label: string;
|
5
5
|
value: any;
|
6
|
-
|
6
|
+
[key: string]: any;
|
7
7
|
};
|
8
8
|
declare type AutocompleteProps = MUIAutocompleteProps<AutocompleteOption | any, any, any, any> & {
|
9
9
|
options: AutocompleteOption[] | string[] | number[];
|
@@ -9,14 +9,11 @@ const Autocomplete = (props) => {
|
|
9
9
|
const sortedOptions = props.sortBy !== 'NONE'
|
10
10
|
? props.options.map((option) => {
|
11
11
|
var _a, _b;
|
12
|
-
return {
|
13
|
-
label: typeof option === 'string'
|
12
|
+
return Object.assign(Object.assign({}, option), { label: typeof option === 'string'
|
14
13
|
? option
|
15
14
|
: typeof (option === null || option === void 0 ? void 0 : option.label) === 'boolean'
|
16
15
|
? new Boolean(option === null || option === void 0 ? void 0 : option.label).toString()
|
17
|
-
: (_a = option === null || option === void 0 ? void 0 : option.label) !== null && _a !== void 0 ? _a : '',
|
18
|
-
value: (_b = option === null || option === void 0 ? void 0 : option.value) !== null && _b !== void 0 ? _b : option,
|
19
|
-
};
|
16
|
+
: (_a = option === null || option === void 0 ? void 0 : option.label) !== null && _a !== void 0 ? _a : '', value: (_b = option === null || option === void 0 ? void 0 : option.value) !== null && _b !== void 0 ? _b : option });
|
20
17
|
})
|
21
18
|
: props.options;
|
22
19
|
switch (props.sortBy) {
|
@@ -132,7 +132,7 @@ const dynamicContentInputEditor = (props) => {
|
|
132
132
|
const DynamicContentInput = (_a = props.context) === null || _a === void 0 ? void 0 : _a.dynamicContentInput.component;
|
133
133
|
let valueEditor;
|
134
134
|
if (DynamicContentInput) {
|
135
|
-
valueEditor = (React.createElement(DynamicContentInput, { values: ['null', 'notNull'].includes(operator) ? '' : value, setValues: handleOnChange, disabled: ['null', 'notNull'].includes(operator), size: 'small', previousSteps: (_c = (_b = props.context) === null || _b === void 0 ? void 0 : _b.previousSteps) !== null && _c !== void 0 ? _c : [] }));
|
135
|
+
valueEditor = (React.createElement(DynamicContentInput, { values: ['null', 'notNull'].includes(operator) ? '' : value, setValues: handleOnChange, disabled: ['null', 'notNull'].includes(operator), size: 'small', previousSteps: (_c = (_b = props.context) === null || _b === void 0 ? void 0 : _b.previousSteps) !== null && _c !== void 0 ? _c : [], isSingleValue: true, width: '33%' }));
|
136
136
|
}
|
137
137
|
return determineValueEditor(valueEditor, props);
|
138
138
|
};
|