@etsoo/materialui 1.4.50 → 1.4.52
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.
- package/lib/ComboBox.js +2 -2
- package/package.json +7 -7
- package/src/ComboBox.tsx +2 -0
package/lib/ComboBox.js
CHANGED
|
@@ -17,7 +17,7 @@ export function ComboBox(props) {
|
|
|
17
17
|
// Labels
|
|
18
18
|
const labels = globalApp?.getLabels("noOptions", "loading", "open", "add");
|
|
19
19
|
// Destruct
|
|
20
|
-
const { search = false, autoAddBlankItem = search, idField = "id", idValue, inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputReset, inputVariant, defaultValue, label, labelField = "label", loadData, onLoadData, name, inputAutoComplete = "off", options, dataReadonly = true, readOnly, onChange, onValueChange, openOnFocus = true, value, disableCloseOnSelect = false, getOptionLabel = (option) => `${option[labelField]}`, sx = { minWidth: "150px", flexGrow: 2 }, noOptionsText = labels?.noOptions, loadingText = labels?.loading, openText = labels?.open, addLabel = labels?.add, onAdd, ...rest } = props;
|
|
20
|
+
const { search = false, autoAddBlankItem = search, idField = "id", idValue, inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputReset, inputVariant, defaultValue, label, labelField = "label", loadData, onLoadData, name, inputAutoComplete = "off", options, dataReadonly = true, readOnly, onChange, onValueChange, openOnFocus = true, value, disableCloseOnSelect = false, getOptionLabel = (option) => `${option[labelField]}`, sx = { minWidth: "150px", flexGrow: 2 }, noOptionsText = labels?.noOptions, loadingText = labels?.loading, openText = labels?.open, addLabel = labels?.add, onAdd, getOptionKey = (option) => `${option[idField]}`, ...rest } = props;
|
|
21
21
|
// Value input ref
|
|
22
22
|
const inputRef = React.createRef();
|
|
23
23
|
// Options state
|
|
@@ -122,7 +122,7 @@ export function ComboBox(props) {
|
|
|
122
122
|
onChange(event, value, reason, details);
|
|
123
123
|
if (onValueChange)
|
|
124
124
|
onValueChange(value);
|
|
125
|
-
}, openOnFocus: openOnFocus, sx: sx, renderInput: (params) => search ? (_jsx(SearchField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })) : (_jsx(InputField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })), options: localOptions, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, ...rest }), onAdd && (_jsx(IconButton, { size: "small", onClick: () => {
|
|
125
|
+
}, openOnFocus: openOnFocus, sx: sx, renderInput: (params) => search ? (_jsx(SearchField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })) : (_jsx(InputField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })), options: localOptions, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, getOptionKey: getOptionKey, ...rest }), onAdd && (_jsx(IconButton, { size: "small", onClick: () => {
|
|
126
126
|
onAdd(doLoadData);
|
|
127
127
|
}, title: addLabel, children: _jsx(AddIcon, {}) }))] })] }));
|
|
128
128
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.52",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"@dnd-kit/core": "^6.3.1",
|
|
34
34
|
"@dnd-kit/sortable": "^10.0.0",
|
|
35
35
|
"@emotion/css": "^11.13.5",
|
|
36
|
-
"@emotion/react": "^11.
|
|
37
|
-
"@emotion/styled": "^11.
|
|
38
|
-
"@etsoo/appscript": "^1.5.
|
|
36
|
+
"@emotion/react": "^11.14.0",
|
|
37
|
+
"@emotion/styled": "^11.14.0",
|
|
38
|
+
"@etsoo/appscript": "^1.5.81",
|
|
39
39
|
"@etsoo/notificationbase": "^1.1.54",
|
|
40
40
|
"@etsoo/react": "^1.8.14",
|
|
41
41
|
"@etsoo/shared": "^1.2.55",
|
|
42
|
-
"@mui/icons-material": "^6.
|
|
43
|
-
"@mui/material": "^6.
|
|
44
|
-
"@mui/x-data-grid": "^7.23.
|
|
42
|
+
"@mui/icons-material": "^6.2.0",
|
|
43
|
+
"@mui/material": "^6.2.0",
|
|
44
|
+
"@mui/x-data-grid": "^7.23.2",
|
|
45
45
|
"chart.js": "^4.4.7",
|
|
46
46
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
47
47
|
"eventemitter3": "^5.0.1",
|
package/src/ComboBox.tsx
CHANGED
|
@@ -117,6 +117,7 @@ export function ComboBox<
|
|
|
117
117
|
openText = labels?.open,
|
|
118
118
|
addLabel = labels?.add,
|
|
119
119
|
onAdd,
|
|
120
|
+
getOptionKey = (option: T) => `${option[idField]}`,
|
|
120
121
|
...rest
|
|
121
122
|
} = props;
|
|
122
123
|
|
|
@@ -292,6 +293,7 @@ export function ComboBox<
|
|
|
292
293
|
noOptionsText={noOptionsText}
|
|
293
294
|
loadingText={loadingText}
|
|
294
295
|
openText={openText}
|
|
296
|
+
getOptionKey={getOptionKey}
|
|
295
297
|
{...rest}
|
|
296
298
|
/>
|
|
297
299
|
{onAdd && (
|