@etsoo/materialui 1.5.99 → 1.6.0
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/cjs/ComboBox.js +2 -2
- package/lib/cjs/ComboBoxMultiple.js +3 -3
- package/lib/cjs/Tiplist.js +2 -2
- package/lib/cjs/TiplistPro.js +2 -2
- package/lib/mjs/ComboBox.js +2 -2
- package/lib/mjs/ComboBoxMultiple.js +3 -3
- package/lib/mjs/Tiplist.js +2 -2
- package/lib/mjs/TiplistPro.js +2 -2
- package/package.json +4 -4
- package/src/ComboBox.tsx +3 -0
- package/src/ComboBoxMultiple.tsx +3 -0
- package/src/Tiplist.tsx +3 -0
- package/src/TiplistPro.tsx +3 -0
package/lib/cjs/ComboBox.js
CHANGED
|
@@ -27,7 +27,7 @@ function ComboBox(props) {
|
|
|
27
27
|
// Labels
|
|
28
28
|
const labels = app?.getLabels("noOptions", "loading", "open", "add");
|
|
29
29
|
// Destruct
|
|
30
|
-
const { search = false, autoAddBlankItem = search, idField = "id", idValue, idIsString = false, 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;
|
|
30
|
+
const { disabled, search = false, autoAddBlankItem = search, idField = "id", idValue, idIsString = false, 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;
|
|
31
31
|
// Value input ref
|
|
32
32
|
const inputRef = react_1.default.createRef();
|
|
33
33
|
// Options state
|
|
@@ -124,7 +124,7 @@ function ComboBox(props) {
|
|
|
124
124
|
};
|
|
125
125
|
}, []);
|
|
126
126
|
// Layout
|
|
127
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange }), (0, jsx_runtime_1.jsxs)(Stack_1.default, { gap: 0.5, direction: "row", width: "100%", children: [(0, jsx_runtime_1.jsx)(Autocomplete_1.default, { value: stateValue, disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
|
|
127
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange, disabled: disabled }), (0, jsx_runtime_1.jsxs)(Stack_1.default, { gap: 0.5, direction: "row", width: "100%", children: [(0, jsx_runtime_1.jsx)(Autocomplete_1.default, { value: stateValue, disabled: disabled, disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
|
|
128
128
|
// Set value
|
|
129
129
|
setInputValue(value);
|
|
130
130
|
// Custom
|
|
@@ -29,7 +29,7 @@ function ComboBoxMultiple(props) {
|
|
|
29
29
|
// Labels
|
|
30
30
|
const labels = app?.getLabels("noOptions", "loading");
|
|
31
31
|
// Destruct
|
|
32
|
-
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 }) => ((0, jsx_runtime_1.jsxs)("li", { ...props, children: [(0, jsx_runtime_1.jsx)(Checkbox_1.default, { icon: icon, checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected }), `${option[labelField]}`] })), getOptionLabel = (option) => `${option[labelField]}`, getOptionKey = (option) => `${option[idField]}`, sx = { minWidth: "150px" }, noOptionsText = labels?.noOptions, loadingText = labels?.loading, ...rest } = props;
|
|
32
|
+
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 }) => ((0, jsx_runtime_1.jsxs)("li", { ...props, children: [(0, jsx_runtime_1.jsx)(Checkbox_1.default, { icon: icon, checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected }), `${option[labelField]}`] })), getOptionLabel = (option) => `${option[labelField]}`, getOptionKey = (option) => `${option[idField]}`, sx = { minWidth: "150px" }, noOptionsText = labels?.noOptions, loadingText = labels?.loading, disabled, ...rest } = props;
|
|
33
33
|
// Value input ref
|
|
34
34
|
const inputRef = react_1.default.createRef();
|
|
35
35
|
// Options state
|
|
@@ -121,11 +121,11 @@ function ComboBoxMultiple(props) {
|
|
|
121
121
|
};
|
|
122
122
|
}, []);
|
|
123
123
|
// Layout
|
|
124
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, "data-reset": inputReset ?? true, type: "text", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange }), (0, jsx_runtime_1.jsx)(Autocomplete_1.default, { value: stateValue == null
|
|
124
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, "data-reset": inputReset ?? true, type: "text", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange, disabled: disabled }), (0, jsx_runtime_1.jsx)(Autocomplete_1.default, { value: stateValue == null
|
|
125
125
|
? []
|
|
126
126
|
: Array.isArray(stateValue)
|
|
127
127
|
? stateValue
|
|
128
|
-
: [stateValue], disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, getOptionKey: getOptionKey, multiple: true, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
|
|
128
|
+
: [stateValue], disabled: disabled, disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, getOptionKey: getOptionKey, multiple: true, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
|
|
129
129
|
// Set value
|
|
130
130
|
setInputValue(value.concat());
|
|
131
131
|
// Custom
|
package/lib/cjs/Tiplist.js
CHANGED
|
@@ -23,7 +23,7 @@ function Tiplist(props) {
|
|
|
23
23
|
// Labels
|
|
24
24
|
const { noOptions, loading, more1 = "More", open: openDefault } = app?.getLabels("noOptions", "loading", "more1", "open") ?? {};
|
|
25
25
|
// Destruct
|
|
26
|
-
const { search = false, idField = "id", idValue, idIsString = false, 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, getOptionKey = (option) => `${option[idField]}`, getOptionLabel, getOptionDisabled, sx = {}, minChars, ...rest } = props;
|
|
26
|
+
const { search = false, idField = "id", idValue, idIsString = false, 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, getOptionKey = (option) => `${option[idField]}`, getOptionLabel, getOptionDisabled, sx = {}, minChars, disabled, ...rest } = props;
|
|
27
27
|
if (width && sx)
|
|
28
28
|
Object.assign(sx, { width: `${width}px` });
|
|
29
29
|
// Value input ref
|
|
@@ -176,7 +176,7 @@ function Tiplist(props) {
|
|
|
176
176
|
};
|
|
177
177
|
}, []);
|
|
178
178
|
// Layout
|
|
179
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: `${inputValue ?? (state.current.idSet ? "" : localIdValue ?? "")}`, readOnly: true, onChange: inputOnChange }), (0, jsx_runtime_1.jsx)(Autocomplete_1.default, { filterOptions: (options, _state) => options, value: states.value, options: states.options, onChange: (event, value, reason, details) => {
|
|
179
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: `${inputValue ?? (state.current.idSet ? "" : localIdValue ?? "")}`, readOnly: true, onChange: inputOnChange, disabled: disabled }), (0, jsx_runtime_1.jsx)(Autocomplete_1.default, { filterOptions: (options, _state) => options, disabled: disabled, value: states.value, options: states.options, onChange: (event, value, reason, details) => {
|
|
180
180
|
// Set value
|
|
181
181
|
setInputValue(value);
|
|
182
182
|
// Custom
|
package/lib/cjs/TiplistPro.js
CHANGED
|
@@ -22,7 +22,7 @@ function TiplistPro(props) {
|
|
|
22
22
|
// Labels
|
|
23
23
|
const { noOptions, loading, more, open: openDefault } = app?.getLabels("noOptions", "loading", "more", "open") ?? {};
|
|
24
24
|
// Destruct
|
|
25
|
-
const { label, loadData, defaultValue, value, idValue, idIsString = false, maxItems = 16, width, name, inputOnChange, inputProps, inputReset, sx, openOnFocus = true, noOptionsText = noOptions, loadingText = loading, openText = openDefault, getOptionDisabled, getOptionLabel, getOptionKey = (option) => typeof option === "string" ? option : option.id, onChange, onValueChange, minChars, ...rest } = props;
|
|
25
|
+
const { label, loadData, defaultValue, value, idValue, idIsString = false, maxItems = 16, width, name, inputOnChange, inputProps, inputReset, sx, openOnFocus = true, noOptionsText = noOptions, loadingText = loading, openText = openDefault, getOptionDisabled, getOptionLabel, getOptionKey = (option) => typeof option === "string" ? option : option.id, onChange, onValueChange, minChars, disabled, ...rest } = props;
|
|
26
26
|
if (width && sx)
|
|
27
27
|
Object.assign(sx, { width: `${width}px` });
|
|
28
28
|
// Value input ref
|
|
@@ -162,7 +162,7 @@ function TiplistPro(props) {
|
|
|
162
162
|
};
|
|
163
163
|
}, []);
|
|
164
164
|
// Layout
|
|
165
|
-
return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: inputValue ?? (state.current.idSet ? "" : localIdValue ?? ""), readOnly: true, onChange: inputOnChange }), (0, jsx_runtime_1.jsx)(Autocomplete_1.default, { filterOptions: (options, _state) => options, value: states.value, options: states.options, freeSolo: true, clearOnBlur: false, onChange: (event, value, reason, details) => {
|
|
165
|
+
return ((0, jsx_runtime_1.jsxs)("div", { style: { flex: 2 }, children: [(0, jsx_runtime_1.jsx)("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: inputValue ?? (state.current.idSet ? "" : localIdValue ?? ""), readOnly: true, onChange: inputOnChange, disabled: disabled }), (0, jsx_runtime_1.jsx)(Autocomplete_1.default, { filterOptions: (options, _state) => options, value: states.value, options: states.options, disabled: disabled, freeSolo: true, clearOnBlur: false, onChange: (event, value, reason, details) => {
|
|
166
166
|
if (typeof value === "object") {
|
|
167
167
|
// Set value
|
|
168
168
|
setInputValue(value);
|
package/lib/mjs/ComboBox.js
CHANGED
|
@@ -21,7 +21,7 @@ export function ComboBox(props) {
|
|
|
21
21
|
// Labels
|
|
22
22
|
const labels = app?.getLabels("noOptions", "loading", "open", "add");
|
|
23
23
|
// Destruct
|
|
24
|
-
const { search = false, autoAddBlankItem = search, idField = "id", idValue, idIsString = false, 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;
|
|
24
|
+
const { disabled, search = false, autoAddBlankItem = search, idField = "id", idValue, idIsString = false, 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;
|
|
25
25
|
// Value input ref
|
|
26
26
|
const inputRef = React.createRef();
|
|
27
27
|
// Options state
|
|
@@ -118,7 +118,7 @@ export function ComboBox(props) {
|
|
|
118
118
|
};
|
|
119
119
|
}, []);
|
|
120
120
|
// Layout
|
|
121
|
-
return (_jsxs("div", { style: { flex: 2 }, children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange }), _jsxs(Stack, { gap: 0.5, direction: "row", width: "100%", children: [_jsx(Autocomplete, { value: stateValue, disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
|
|
121
|
+
return (_jsxs("div", { style: { flex: 2 }, children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange, disabled: disabled }), _jsxs(Stack, { gap: 0.5, direction: "row", width: "100%", children: [_jsx(Autocomplete, { value: stateValue, disabled: disabled, disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
|
|
122
122
|
// Set value
|
|
123
123
|
setInputValue(value);
|
|
124
124
|
// Custom
|
|
@@ -23,7 +23,7 @@ export function ComboBoxMultiple(props) {
|
|
|
23
23
|
// Labels
|
|
24
24
|
const labels = app?.getLabels("noOptions", "loading");
|
|
25
25
|
// Destruct
|
|
26
|
-
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 }) => (_jsxs("li", { ...props, children: [_jsx(Checkbox, { icon: icon, checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected }), `${option[labelField]}`] })), getOptionLabel = (option) => `${option[labelField]}`, getOptionKey = (option) => `${option[idField]}`, sx = { minWidth: "150px" }, noOptionsText = labels?.noOptions, loadingText = labels?.loading, ...rest } = props;
|
|
26
|
+
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 }) => (_jsxs("li", { ...props, children: [_jsx(Checkbox, { icon: icon, checkedIcon: checkedIcon, style: { marginRight: 8 }, checked: selected }), `${option[labelField]}`] })), getOptionLabel = (option) => `${option[labelField]}`, getOptionKey = (option) => `${option[idField]}`, sx = { minWidth: "150px" }, noOptionsText = labels?.noOptions, loadingText = labels?.loading, disabled, ...rest } = props;
|
|
27
27
|
// Value input ref
|
|
28
28
|
const inputRef = React.createRef();
|
|
29
29
|
// Options state
|
|
@@ -115,11 +115,11 @@ export function ComboBoxMultiple(props) {
|
|
|
115
115
|
};
|
|
116
116
|
}, []);
|
|
117
117
|
// Layout
|
|
118
|
-
return (_jsxs("div", { style: { flex: 2 }, children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: "text", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange }), _jsx(Autocomplete, { value: stateValue == null
|
|
118
|
+
return (_jsxs("div", { style: { flex: 2 }, children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: "text", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange, disabled: disabled }), _jsx(Autocomplete, { value: stateValue == null
|
|
119
119
|
? []
|
|
120
120
|
: Array.isArray(stateValue)
|
|
121
121
|
? stateValue
|
|
122
|
-
: [stateValue], disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, getOptionKey: getOptionKey, multiple: true, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
|
|
122
|
+
: [stateValue], disabled: disabled, disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, getOptionKey: getOptionKey, multiple: true, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
|
|
123
123
|
// Set value
|
|
124
124
|
setInputValue(value.concat());
|
|
125
125
|
// Custom
|
package/lib/mjs/Tiplist.js
CHANGED
|
@@ -17,7 +17,7 @@ export function Tiplist(props) {
|
|
|
17
17
|
// Labels
|
|
18
18
|
const { noOptions, loading, more1 = "More", open: openDefault } = app?.getLabels("noOptions", "loading", "more1", "open") ?? {};
|
|
19
19
|
// Destruct
|
|
20
|
-
const { search = false, idField = "id", idValue, idIsString = false, 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, getOptionKey = (option) => `${option[idField]}`, getOptionLabel, getOptionDisabled, sx = {}, minChars, ...rest } = props;
|
|
20
|
+
const { search = false, idField = "id", idValue, idIsString = false, 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, getOptionKey = (option) => `${option[idField]}`, getOptionLabel, getOptionDisabled, sx = {}, minChars, disabled, ...rest } = props;
|
|
21
21
|
if (width && sx)
|
|
22
22
|
Object.assign(sx, { width: `${width}px` });
|
|
23
23
|
// Value input ref
|
|
@@ -170,7 +170,7 @@ export function Tiplist(props) {
|
|
|
170
170
|
};
|
|
171
171
|
}, []);
|
|
172
172
|
// Layout
|
|
173
|
-
return (_jsxs("div", { style: { flex: 2 }, children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: `${inputValue ?? (state.current.idSet ? "" : localIdValue ?? "")}`, readOnly: true, onChange: inputOnChange }), _jsx(Autocomplete, { filterOptions: (options, _state) => options, value: states.value, options: states.options, onChange: (event, value, reason, details) => {
|
|
173
|
+
return (_jsxs("div", { style: { flex: 2 }, children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: `${inputValue ?? (state.current.idSet ? "" : localIdValue ?? "")}`, readOnly: true, onChange: inputOnChange, disabled: disabled }), _jsx(Autocomplete, { filterOptions: (options, _state) => options, disabled: disabled, value: states.value, options: states.options, onChange: (event, value, reason, details) => {
|
|
174
174
|
// Set value
|
|
175
175
|
setInputValue(value);
|
|
176
176
|
// Custom
|
package/lib/mjs/TiplistPro.js
CHANGED
|
@@ -16,7 +16,7 @@ export function TiplistPro(props) {
|
|
|
16
16
|
// Labels
|
|
17
17
|
const { noOptions, loading, more, open: openDefault } = app?.getLabels("noOptions", "loading", "more", "open") ?? {};
|
|
18
18
|
// Destruct
|
|
19
|
-
const { label, loadData, defaultValue, value, idValue, idIsString = false, maxItems = 16, width, name, inputOnChange, inputProps, inputReset, sx, openOnFocus = true, noOptionsText = noOptions, loadingText = loading, openText = openDefault, getOptionDisabled, getOptionLabel, getOptionKey = (option) => typeof option === "string" ? option : option.id, onChange, onValueChange, minChars, ...rest } = props;
|
|
19
|
+
const { label, loadData, defaultValue, value, idValue, idIsString = false, maxItems = 16, width, name, inputOnChange, inputProps, inputReset, sx, openOnFocus = true, noOptionsText = noOptions, loadingText = loading, openText = openDefault, getOptionDisabled, getOptionLabel, getOptionKey = (option) => typeof option === "string" ? option : option.id, onChange, onValueChange, minChars, disabled, ...rest } = props;
|
|
20
20
|
if (width && sx)
|
|
21
21
|
Object.assign(sx, { width: `${width}px` });
|
|
22
22
|
// Value input ref
|
|
@@ -156,7 +156,7 @@ export function TiplistPro(props) {
|
|
|
156
156
|
};
|
|
157
157
|
}, []);
|
|
158
158
|
// Layout
|
|
159
|
-
return (_jsxs("div", { style: { flex: 2 }, children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: inputValue ?? (state.current.idSet ? "" : localIdValue ?? ""), readOnly: true, onChange: inputOnChange }), _jsx(Autocomplete, { filterOptions: (options, _state) => options, value: states.value, options: states.options, freeSolo: true, clearOnBlur: false, onChange: (event, value, reason, details) => {
|
|
159
|
+
return (_jsxs("div", { style: { flex: 2 }, children: [_jsx("input", { ref: inputRef, "data-reset": inputReset ?? true, type: idIsString ? "text" : "number", style: { display: "none" }, name: name, value: inputValue ?? (state.current.idSet ? "" : localIdValue ?? ""), readOnly: true, onChange: inputOnChange, disabled: disabled }), _jsx(Autocomplete, { filterOptions: (options, _state) => options, value: states.value, options: states.options, disabled: disabled, freeSolo: true, clearOnBlur: false, onChange: (event, value, reason, details) => {
|
|
160
160
|
if (typeof value === "object") {
|
|
161
161
|
// Set value
|
|
162
162
|
setInputValue(value);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@etsoo/materialui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "TypeScript Material-UI Implementation",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/mjs/index.js",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"@etsoo/notificationbase": "^1.1.66",
|
|
45
45
|
"@etsoo/react": "^1.8.68",
|
|
46
46
|
"@etsoo/shared": "^1.2.80",
|
|
47
|
-
"@mui/icons-material": "^7.3.
|
|
48
|
-
"@mui/material": "^7.3.
|
|
49
|
-
"@mui/x-data-grid": "^8.
|
|
47
|
+
"@mui/icons-material": "^7.3.7",
|
|
48
|
+
"@mui/material": "^7.3.7",
|
|
49
|
+
"@mui/x-data-grid": "^8.24.0",
|
|
50
50
|
"chart.js": "^4.5.1",
|
|
51
51
|
"chartjs-plugin-datalabels": "^2.2.0",
|
|
52
52
|
"dompurify": "^3.3.1",
|
package/src/ComboBox.tsx
CHANGED
|
@@ -86,6 +86,7 @@ export function ComboBox<
|
|
|
86
86
|
|
|
87
87
|
// Destruct
|
|
88
88
|
const {
|
|
89
|
+
disabled,
|
|
89
90
|
search = false,
|
|
90
91
|
autoAddBlankItem = search,
|
|
91
92
|
idField = "id" as D,
|
|
@@ -246,11 +247,13 @@ export function ComboBox<
|
|
|
246
247
|
value={getValue(stateValue)}
|
|
247
248
|
readOnly
|
|
248
249
|
onChange={inputOnChange}
|
|
250
|
+
disabled={disabled}
|
|
249
251
|
/>
|
|
250
252
|
{/* Previous input will reset first with "disableClearable = false", next input trigger change works */}
|
|
251
253
|
<Stack gap={0.5} direction="row" width="100%">
|
|
252
254
|
<Autocomplete<T, false, false, false>
|
|
253
255
|
value={stateValue}
|
|
256
|
+
disabled={disabled}
|
|
254
257
|
disableCloseOnSelect={disableCloseOnSelect}
|
|
255
258
|
getOptionLabel={getOptionLabel}
|
|
256
259
|
isOptionEqualToValue={(option: T, value: T) =>
|
package/src/ComboBoxMultiple.tsx
CHANGED
|
@@ -126,6 +126,7 @@ export function ComboBoxMultiple<
|
|
|
126
126
|
sx = { minWidth: "150px" },
|
|
127
127
|
noOptionsText = labels?.noOptions,
|
|
128
128
|
loadingText = labels?.loading,
|
|
129
|
+
disabled,
|
|
129
130
|
...rest
|
|
130
131
|
} = props;
|
|
131
132
|
|
|
@@ -249,6 +250,7 @@ export function ComboBoxMultiple<
|
|
|
249
250
|
value={getValue(stateValue)}
|
|
250
251
|
readOnly
|
|
251
252
|
onChange={inputOnChange}
|
|
253
|
+
disabled={disabled}
|
|
252
254
|
/>
|
|
253
255
|
{/* Previous input will reset first with "disableClearable = false", next input trigger change works */}
|
|
254
256
|
<Autocomplete<T, true, false, false>
|
|
@@ -259,6 +261,7 @@ export function ComboBoxMultiple<
|
|
|
259
261
|
? stateValue
|
|
260
262
|
: [stateValue]
|
|
261
263
|
}
|
|
264
|
+
disabled={disabled}
|
|
262
265
|
disableCloseOnSelect={disableCloseOnSelect}
|
|
263
266
|
getOptionLabel={getOptionLabel}
|
|
264
267
|
getOptionKey={getOptionKey}
|
package/src/Tiplist.tsx
CHANGED
|
@@ -102,6 +102,7 @@ export function Tiplist<
|
|
|
102
102
|
getOptionDisabled,
|
|
103
103
|
sx = {},
|
|
104
104
|
minChars,
|
|
105
|
+
disabled,
|
|
105
106
|
...rest
|
|
106
107
|
} = props;
|
|
107
108
|
|
|
@@ -302,10 +303,12 @@ export function Tiplist<
|
|
|
302
303
|
}`}
|
|
303
304
|
readOnly
|
|
304
305
|
onChange={inputOnChange}
|
|
306
|
+
disabled={disabled}
|
|
305
307
|
/>
|
|
306
308
|
{/* Previous input will reset first with "disableClearable = false", next input trigger change works */}
|
|
307
309
|
<Autocomplete<T, undefined, false, false>
|
|
308
310
|
filterOptions={(options, _state) => options}
|
|
311
|
+
disabled={disabled}
|
|
309
312
|
value={states.value}
|
|
310
313
|
options={states.options}
|
|
311
314
|
onChange={(event, value, reason, details) => {
|
package/src/TiplistPro.tsx
CHANGED
|
@@ -132,6 +132,7 @@ export function TiplistPro<T extends ListType2 = ListType2>(
|
|
|
132
132
|
onChange,
|
|
133
133
|
onValueChange,
|
|
134
134
|
minChars,
|
|
135
|
+
disabled,
|
|
135
136
|
...rest
|
|
136
137
|
} = props;
|
|
137
138
|
|
|
@@ -314,12 +315,14 @@ export function TiplistPro<T extends ListType2 = ListType2>(
|
|
|
314
315
|
value={inputValue ?? (state.current.idSet ? "" : localIdValue ?? "")}
|
|
315
316
|
readOnly
|
|
316
317
|
onChange={inputOnChange}
|
|
318
|
+
disabled={disabled}
|
|
317
319
|
/>
|
|
318
320
|
{/* Previous input will reset first with "disableClearable = false", next input trigger change works */}
|
|
319
321
|
<Autocomplete<T, false, false, true>
|
|
320
322
|
filterOptions={(options, _state) => options}
|
|
321
323
|
value={states.value}
|
|
322
324
|
options={states.options}
|
|
325
|
+
disabled={disabled}
|
|
323
326
|
freeSolo
|
|
324
327
|
clearOnBlur={false}
|
|
325
328
|
onChange={(event, value, reason, details) => {
|