@etsoo/materialui 1.2.87 → 1.2.88
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/AutocompleteExtendedProps.d.ts +4 -0
- package/lib/ComboBox.js +2 -2
- package/lib/ComboBoxMultiple.js +2 -2
- package/lib/Tiplist.js +2 -2
- package/package.json +1 -1
- package/src/AutocompleteExtendedProps.ts +5 -0
- package/src/ComboBox.tsx +3 -0
- package/src/ComboBoxMultiple.tsx +3 -0
- package/src/Tiplist.tsx +3 -0
package/lib/ComboBox.js
CHANGED
|
@@ -16,7 +16,7 @@ export function ComboBox(props) {
|
|
|
16
16
|
// Labels
|
|
17
17
|
const labels = globalApp === null || globalApp === void 0 ? void 0 : globalApp.getLabels("noOptions", "loading", "open", "add");
|
|
18
18
|
// Destruct
|
|
19
|
-
const { search = false, autoAddBlankItem = search, idField = "id", idValue, inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, 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 === null || labels === void 0 ? void 0 : labels.noOptions, loadingText = labels === null || labels === void 0 ? void 0 : labels.loading, openText = labels === null || labels === void 0 ? void 0 : labels.open, addLabel = labels === null || labels === void 0 ? void 0 : labels.add, onAdd, ...rest } = props;
|
|
19
|
+
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 === null || labels === void 0 ? void 0 : labels.noOptions, loadingText = labels === null || labels === void 0 ? void 0 : labels.loading, openText = labels === null || labels === void 0 ? void 0 : labels.open, addLabel = labels === null || labels === void 0 ? void 0 : labels.add, onAdd, ...rest } = props;
|
|
20
20
|
// Value input ref
|
|
21
21
|
const inputRef = React.createRef();
|
|
22
22
|
// Options state
|
|
@@ -125,7 +125,7 @@ export function ComboBox(props) {
|
|
|
125
125
|
onChange(event, value, reason, details);
|
|
126
126
|
if (onValueChange)
|
|
127
127
|
onValueChange(value);
|
|
128
|
-
}, openOnFocus: openOnFocus, sx: sx, renderInput: (params) => search ? (React.createElement(SearchField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })) : (React.createElement(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 }),
|
|
128
|
+
}, openOnFocus: openOnFocus, sx: sx, renderInput: (params) => search ? (React.createElement(SearchField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText, "data-reset": inputReset })) : (React.createElement(InputField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText, "data-reset": inputReset })), options: localOptions, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, ...rest }),
|
|
129
129
|
onAdd && (React.createElement(IconButton, { size: "small", onClick: () => {
|
|
130
130
|
onAdd(doLoadData);
|
|
131
131
|
}, title: addLabel },
|
package/lib/ComboBoxMultiple.js
CHANGED
|
@@ -19,7 +19,7 @@ export function ComboBoxMultiple(props) {
|
|
|
19
19
|
// Labels
|
|
20
20
|
const labels = globalApp === null || globalApp === void 0 ? void 0 : globalApp.getLabels("noOptions", "loading");
|
|
21
21
|
// Destruct
|
|
22
|
-
const { search = false, autoAddBlankItem = search, idField = "id", idValue, idValues, inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputVariant, defaultValue, label, labelField = "label", loadData, onLoadData, name, inputAutoComplete = "off", options, dataReadonly = true, readOnly, onChange, openOnFocus = true, value, disableCloseOnSelect = true, renderOption = (props, option, { selected }) => (React.createElement("li", { ...props },
|
|
22
|
+
const { search = false, autoAddBlankItem = search, idField = "id", idValue, idValues, inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputReset, inputVariant, defaultValue, label, labelField = "label", loadData, onLoadData, name, inputAutoComplete = "off", options, dataReadonly = true, readOnly, onChange, openOnFocus = true, value, disableCloseOnSelect = true, renderOption = (props, option, { selected }) => (React.createElement("li", { ...props },
|
|
23
23
|
React.createElement(React.Fragment, null,
|
|
24
24
|
React.createElement(Checkbox, { icon: icon, checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected }),
|
|
25
25
|
option[labelField]))), getOptionLabel = (option) => `${option[labelField]}`, sx = { minWidth: "150px" }, noOptionsText = labels === null || labels === void 0 ? void 0 : labels.noOptions, loadingText = labels === null || labels === void 0 ? void 0 : labels.loading, ...rest } = props;
|
|
@@ -128,5 +128,5 @@ export function ComboBoxMultiple(props) {
|
|
|
128
128
|
// Custom
|
|
129
129
|
if (onChange != null)
|
|
130
130
|
onChange(event, value, reason, details);
|
|
131
|
-
}, openOnFocus: openOnFocus, sx: sx, renderInput: (params) => search ? (React.createElement(SearchField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })) : (React.createElement(InputField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText })), options: localOptions, renderOption: renderOption, noOptionsText: noOptionsText, loadingText: loadingText, ...rest })));
|
|
131
|
+
}, openOnFocus: openOnFocus, sx: sx, renderInput: (params) => search ? (React.createElement(SearchField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText, "data-reset": inputReset })) : (React.createElement(InputField, { ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, error: inputError, helperText: inputHelperText, "data-reset": inputReset })), options: localOptions, renderOption: renderOption, noOptionsText: noOptionsText, loadingText: loadingText, ...rest })));
|
|
132
132
|
}
|
package/lib/Tiplist.js
CHANGED
|
@@ -15,7 +15,7 @@ export function Tiplist(props) {
|
|
|
15
15
|
// Labels
|
|
16
16
|
const { noOptions, loading, more, open: openDefault } = (_a = globalApp === null || globalApp === void 0 ? void 0 : globalApp.getLabels("noOptions", "loading", "more", "open")) !== null && _a !== void 0 ? _a : {};
|
|
17
17
|
// Destruct
|
|
18
|
-
const { search = false, idField = "id", idValue, inputAutoComplete = "off", inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputVariant, label, loadData, defaultValue, value, maxItems = 16, width = search ? 160 : undefined, name, readOnly, onChange, onValueChange, openOnFocus = true, noOptionsText = noOptions, loadingText = loading, openText = openDefault, getOptionLabel, getOptionDisabled, sx = {}, ...rest } = props;
|
|
18
|
+
const { search = false, idField = "id", idValue, inputAutoComplete = "off", inputError, inputHelperText, inputMargin, inputOnChange, inputRequired, inputReset, inputVariant, label, loadData, defaultValue, value, maxItems = 16, width = search ? 160 : undefined, name, readOnly, onChange, onValueChange, openOnFocus = true, noOptionsText = noOptions, loadingText = loading, openText = openDefault, getOptionLabel, getOptionDisabled, sx = {}, ...rest } = props;
|
|
19
19
|
if (width && sx)
|
|
20
20
|
Object.assign(sx, { width: `${width}px` });
|
|
21
21
|
// Value input ref
|
|
@@ -189,7 +189,7 @@ export function Tiplist(props) {
|
|
|
189
189
|
open: false,
|
|
190
190
|
...(!states.value && { options: [] })
|
|
191
191
|
});
|
|
192
|
-
}, loading: states.loading, renderInput: (params) => search ? (React.createElement(SearchField, { onChange: changeHandle, ...addReadOnly(params), readOnly: readOnly, label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, autoComplete: inputAutoComplete, error: inputError, helperText: inputHelperText })) : (React.createElement(InputField, { onChange: changeHandle, ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, autoComplete: inputAutoComplete, error: inputError, helperText: inputHelperText })), isOptionEqualToValue: (option, value) => option[idField] === value[idField], sx: sx, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, getOptionDisabled: (item) => {
|
|
192
|
+
}, loading: states.loading, renderInput: (params) => search ? (React.createElement(SearchField, { onChange: changeHandle, ...addReadOnly(params), readOnly: readOnly, label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, autoComplete: inputAutoComplete, error: inputError, helperText: inputHelperText, "data-reset": inputReset })) : (React.createElement(InputField, { onChange: changeHandle, ...addReadOnly(params), label: label, name: name + "Input", margin: inputMargin, variant: inputVariant, required: inputRequired, autoComplete: inputAutoComplete, error: inputError, helperText: inputHelperText, "data-reset": inputReset })), isOptionEqualToValue: (option, value) => option[idField] === value[idField], sx: sx, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, getOptionDisabled: (item) => {
|
|
193
193
|
if (item[idField] === "n/a")
|
|
194
194
|
return true;
|
|
195
195
|
return getOptionDisabled ? getOptionDisabled(item) : false;
|
package/package.json
CHANGED
package/src/ComboBox.tsx
CHANGED
|
@@ -93,6 +93,7 @@ export function ComboBox<
|
|
|
93
93
|
inputMargin,
|
|
94
94
|
inputOnChange,
|
|
95
95
|
inputRequired,
|
|
96
|
+
inputReset,
|
|
96
97
|
inputVariant,
|
|
97
98
|
defaultValue,
|
|
98
99
|
label,
|
|
@@ -274,6 +275,7 @@ export function ComboBox<
|
|
|
274
275
|
required={inputRequired}
|
|
275
276
|
error={inputError}
|
|
276
277
|
helperText={inputHelperText}
|
|
278
|
+
data-reset={inputReset}
|
|
277
279
|
/>
|
|
278
280
|
) : (
|
|
279
281
|
<InputField
|
|
@@ -285,6 +287,7 @@ export function ComboBox<
|
|
|
285
287
|
required={inputRequired}
|
|
286
288
|
error={inputError}
|
|
287
289
|
helperText={inputHelperText}
|
|
290
|
+
data-reset={inputReset}
|
|
288
291
|
/>
|
|
289
292
|
)
|
|
290
293
|
}
|
package/src/ComboBoxMultiple.tsx
CHANGED
|
@@ -93,6 +93,7 @@ export function ComboBoxMultiple<
|
|
|
93
93
|
inputMargin,
|
|
94
94
|
inputOnChange,
|
|
95
95
|
inputRequired,
|
|
96
|
+
inputReset,
|
|
96
97
|
inputVariant,
|
|
97
98
|
defaultValue,
|
|
98
99
|
label,
|
|
@@ -286,6 +287,7 @@ export function ComboBoxMultiple<
|
|
|
286
287
|
required={inputRequired}
|
|
287
288
|
error={inputError}
|
|
288
289
|
helperText={inputHelperText}
|
|
290
|
+
data-reset={inputReset}
|
|
289
291
|
/>
|
|
290
292
|
) : (
|
|
291
293
|
<InputField
|
|
@@ -297,6 +299,7 @@ export function ComboBoxMultiple<
|
|
|
297
299
|
required={inputRequired}
|
|
298
300
|
error={inputError}
|
|
299
301
|
helperText={inputHelperText}
|
|
302
|
+
data-reset={inputReset}
|
|
300
303
|
/>
|
|
301
304
|
)
|
|
302
305
|
}
|
package/src/Tiplist.tsx
CHANGED
|
@@ -70,6 +70,7 @@ export function Tiplist<
|
|
|
70
70
|
inputMargin,
|
|
71
71
|
inputOnChange,
|
|
72
72
|
inputRequired,
|
|
73
|
+
inputReset,
|
|
73
74
|
inputVariant,
|
|
74
75
|
label,
|
|
75
76
|
loadData,
|
|
@@ -337,6 +338,7 @@ export function Tiplist<
|
|
|
337
338
|
autoComplete={inputAutoComplete}
|
|
338
339
|
error={inputError}
|
|
339
340
|
helperText={inputHelperText}
|
|
341
|
+
data-reset={inputReset}
|
|
340
342
|
/>
|
|
341
343
|
) : (
|
|
342
344
|
<InputField
|
|
@@ -350,6 +352,7 @@ export function Tiplist<
|
|
|
350
352
|
autoComplete={inputAutoComplete}
|
|
351
353
|
error={inputError}
|
|
352
354
|
helperText={inputHelperText}
|
|
355
|
+
data-reset={inputReset}
|
|
353
356
|
/>
|
|
354
357
|
)
|
|
355
358
|
}
|