@etsoo/materialui 1.2.89 → 1.2.90
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 +1 -1
- package/lib/ComboBoxMultiple.js +1 -1
- package/lib/Tiplist.js +1 -1
- package/lib/TiplistPro.d.ts +4 -0
- package/lib/TiplistPro.js +3 -3
- package/package.json +1 -1
- package/src/ComboBox.tsx +1 -1
- package/src/ComboBoxMultiple.tsx +1 -1
- package/src/Tiplist.tsx +1 -1
- package/src/TiplistPro.tsx +8 -1
package/lib/ComboBox.js
CHANGED
|
@@ -113,7 +113,7 @@ export function ComboBox(props) {
|
|
|
113
113
|
}, []);
|
|
114
114
|
// Layout
|
|
115
115
|
return (React.createElement("div", null,
|
|
116
|
-
React.createElement("input", { ref: inputRef, "data-reset":
|
|
116
|
+
React.createElement("input", { ref: inputRef, "data-reset": inputReset !== null && inputReset !== void 0 ? inputReset : true, type: "text", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange }),
|
|
117
117
|
React.createElement(Stack, { gap: 0.5, direction: "row", width: "100%" },
|
|
118
118
|
React.createElement(Autocomplete, { value: stateValue, disableCloseOnSelect: disableCloseOnSelect, getOptionLabel: getOptionLabel, isOptionEqualToValue: (option, value) => option[idField] === value[idField], onChange: (event, value, reason, details) => {
|
|
119
119
|
// Set value
|
package/lib/ComboBoxMultiple.js
CHANGED
|
@@ -115,7 +115,7 @@ export function ComboBoxMultiple(props) {
|
|
|
115
115
|
}, []);
|
|
116
116
|
// Layout
|
|
117
117
|
return (React.createElement("div", null,
|
|
118
|
-
React.createElement("input", { ref: inputRef, "data-reset":
|
|
118
|
+
React.createElement("input", { ref: inputRef, "data-reset": inputReset !== null && inputReset !== void 0 ? inputReset : true, type: "text", style: { display: "none" }, name: name, value: getValue(stateValue), readOnly: true, onChange: inputOnChange }),
|
|
119
119
|
React.createElement(Autocomplete, { value: stateValue == null
|
|
120
120
|
? []
|
|
121
121
|
: Array.isArray(stateValue)
|
package/lib/Tiplist.js
CHANGED
|
@@ -166,7 +166,7 @@ export function Tiplist(props) {
|
|
|
166
166
|
}, []);
|
|
167
167
|
// Layout
|
|
168
168
|
return (React.createElement("div", null,
|
|
169
|
-
React.createElement("input", { ref: inputRef, "data-reset":
|
|
169
|
+
React.createElement("input", { ref: inputRef, "data-reset": inputReset !== null && inputReset !== void 0 ? inputReset : true, type: "text", style: { display: "none" }, name: name, value: `${inputValue !== null && inputValue !== void 0 ? inputValue : (state.current.idSet ? "" : localIdValue !== null && localIdValue !== void 0 ? localIdValue : "")}`, readOnly: true, onChange: inputOnChange }),
|
|
170
170
|
React.createElement(Autocomplete, { filterOptions: (options, _state) => options, value: states.value, options: states.options, onChange: (event, value, reason, details) => {
|
|
171
171
|
// Set value
|
|
172
172
|
setInputValue(value);
|
package/lib/TiplistPro.d.ts
CHANGED
|
@@ -38,6 +38,10 @@ export type TiplistProProps<T extends ListType2 = ListType2> = Omit<Autocomplete
|
|
|
38
38
|
* Input props
|
|
39
39
|
*/
|
|
40
40
|
inputProps?: Omit<InputFieldProps, "onChange">;
|
|
41
|
+
/**
|
|
42
|
+
* Set 'data-reset'
|
|
43
|
+
*/
|
|
44
|
+
inputReset?: boolean;
|
|
41
45
|
/**
|
|
42
46
|
* Value change handler
|
|
43
47
|
* @param value New value
|
package/lib/TiplistPro.js
CHANGED
|
@@ -13,7 +13,7 @@ export function TiplistPro(props) {
|
|
|
13
13
|
// Labels
|
|
14
14
|
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 : {};
|
|
15
15
|
// Destruct
|
|
16
|
-
const { label, loadData, defaultValue, value, idValue, maxItems = 16, width, name, inputOnChange, inputProps, sx, openOnFocus = true, noOptionsText = noOptions, loadingText = loading, openText = openDefault, getOptionDisabled, getOptionLabel, onChange, onValueChange, ...rest } = props;
|
|
16
|
+
const { label, loadData, defaultValue, value, idValue, maxItems = 16, width, name, inputOnChange, inputProps, inputReset, sx, openOnFocus = true, noOptionsText = noOptions, loadingText = loading, openText = openDefault, getOptionDisabled, getOptionLabel, onChange, onValueChange, ...rest } = props;
|
|
17
17
|
if (width && sx)
|
|
18
18
|
Object.assign(sx, { width: `${width}px` });
|
|
19
19
|
// Value input ref
|
|
@@ -150,7 +150,7 @@ export function TiplistPro(props) {
|
|
|
150
150
|
}, []);
|
|
151
151
|
// Layout
|
|
152
152
|
return (React.createElement("div", null,
|
|
153
|
-
React.createElement("input", { ref: inputRef, "data-reset":
|
|
153
|
+
React.createElement("input", { ref: inputRef, "data-reset": inputReset !== null && inputReset !== void 0 ? inputReset : true, type: "text", style: { display: "none" }, name: name, value: inputValue !== null && inputValue !== void 0 ? inputValue : (state.current.idSet ? "" : localIdValue !== null && localIdValue !== void 0 ? localIdValue : ""), readOnly: true, onChange: inputOnChange }),
|
|
154
154
|
React.createElement(Autocomplete, { filterOptions: (options, _state) => options, value: states.value, options: states.options, freeSolo: true, clearOnBlur: false, onChange: (event, value, reason, details) => {
|
|
155
155
|
if (typeof value === "object") {
|
|
156
156
|
// Set value
|
|
@@ -185,7 +185,7 @@ export function TiplistPro(props) {
|
|
|
185
185
|
}, loading: states.loading, renderInput: (params) => (React.createElement(InputField, { ...inputProps, ...params, onChange: changeHandle, label: label, name: name + "Input", onBlur: (event) => {
|
|
186
186
|
if (states.value == null && onChange)
|
|
187
187
|
onChange(event, event.target.value, "blur", undefined);
|
|
188
|
-
} })), isOptionEqualToValue: (option, value) => option.id === value.id, sx: sx, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, getOptionDisabled: (item) => {
|
|
188
|
+
}, "data-reset": inputReset })), isOptionEqualToValue: (option, value) => option.id === value.id, sx: sx, noOptionsText: noOptionsText, loadingText: loadingText, openText: openText, getOptionDisabled: (item) => {
|
|
189
189
|
if (item.id === -1)
|
|
190
190
|
return true;
|
|
191
191
|
return getOptionDisabled ? getOptionDisabled(item) : false;
|
package/package.json
CHANGED
package/src/ComboBox.tsx
CHANGED
package/src/ComboBoxMultiple.tsx
CHANGED
package/src/Tiplist.tsx
CHANGED
package/src/TiplistPro.tsx
CHANGED
|
@@ -56,6 +56,11 @@ export type TiplistProProps<T extends ListType2 = ListType2> = Omit<
|
|
|
56
56
|
*/
|
|
57
57
|
inputProps?: Omit<InputFieldProps, "onChange">;
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Set 'data-reset'
|
|
61
|
+
*/
|
|
62
|
+
inputReset?: boolean;
|
|
63
|
+
|
|
59
64
|
/**
|
|
60
65
|
* Value change handler
|
|
61
66
|
* @param value New value
|
|
@@ -99,6 +104,7 @@ export function TiplistPro<T extends ListType2 = ListType2>(
|
|
|
99
104
|
name,
|
|
100
105
|
inputOnChange,
|
|
101
106
|
inputProps,
|
|
107
|
+
inputReset,
|
|
102
108
|
sx,
|
|
103
109
|
openOnFocus = true,
|
|
104
110
|
noOptionsText = noOptions,
|
|
@@ -278,7 +284,7 @@ export function TiplistPro<T extends ListType2 = ListType2>(
|
|
|
278
284
|
<div>
|
|
279
285
|
<input
|
|
280
286
|
ref={inputRef}
|
|
281
|
-
data-reset=
|
|
287
|
+
data-reset={inputReset ?? true}
|
|
282
288
|
type="text"
|
|
283
289
|
style={{ display: "none" }}
|
|
284
290
|
name={name}
|
|
@@ -348,6 +354,7 @@ export function TiplistPro<T extends ListType2 = ListType2>(
|
|
|
348
354
|
if (states.value == null && onChange)
|
|
349
355
|
onChange(event, event.target.value, "blur", undefined);
|
|
350
356
|
}}
|
|
357
|
+
data-reset={inputReset}
|
|
351
358
|
/>
|
|
352
359
|
)}
|
|
353
360
|
isOptionEqualToValue={(option, value) => option.id === value.id}
|