@etsoo/materialui 1.2.88 → 1.2.89

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 CHANGED
@@ -52,10 +52,8 @@ export function ComboBox(props) {
52
52
  const addReadOnly = (params) => {
53
53
  if (readOnly != null) {
54
54
  Object.assign(params, { readOnly });
55
- if (readOnly) {
56
- Object.assign(params.inputProps, { "data-reset": true });
57
- }
58
55
  }
56
+ Object.assign(params.inputProps, { "data-reset": inputReset });
59
57
  if (dataReadonly) {
60
58
  params.inputProps.onKeyDown = (event) => {
61
59
  if (Keyboard.isTypingContent(event.key)) {
@@ -125,7 +123,7 @@ export function ComboBox(props) {
125
123
  onChange(event, value, reason, details);
126
124
  if (onValueChange)
127
125
  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, "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 }),
126
+ }, 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 }),
129
127
  onAdd && (React.createElement(IconButton, { size: "small", onClick: () => {
130
128
  onAdd(doLoadData);
131
129
  }, title: addLabel },
@@ -61,10 +61,8 @@ export function ComboBoxMultiple(props) {
61
61
  const addReadOnly = (params) => {
62
62
  if (readOnly != null) {
63
63
  Object.assign(params, { readOnly });
64
- if (readOnly) {
65
- Object.assign(params.inputProps, { "data-reset": true });
66
- }
67
64
  }
65
+ Object.assign(params.inputProps, { "data-reset": inputReset });
68
66
  if (dataReadonly) {
69
67
  params.inputProps.onKeyDown = (event) => {
70
68
  if (Keyboard.isTypingContent(event.key)) {
@@ -128,5 +126,5 @@ export function ComboBoxMultiple(props) {
128
126
  // Custom
129
127
  if (onChange != null)
130
128
  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, "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 })));
129
+ }, 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 })));
132
130
  }
package/lib/Tiplist.js CHANGED
@@ -54,7 +54,10 @@ export function Tiplist(props) {
54
54
  }
55
55
  // https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
56
56
  // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html
57
- Object.assign(params.inputProps, { autoComplete: inputAutoComplete });
57
+ Object.assign(params.inputProps, {
58
+ autoComplete: inputAutoComplete,
59
+ "data-reset": inputReset
60
+ });
58
61
  return params;
59
62
  };
60
63
  // Change handler
@@ -189,7 +192,7 @@ export function Tiplist(props) {
189
192
  open: false,
190
193
  ...(!states.value && { options: [] })
191
194
  });
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) => {
195
+ }, 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) => {
193
196
  if (item[idField] === "n/a")
194
197
  return true;
195
198
  return getOptionDisabled ? getOptionDisabled(item) : false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.2.88",
3
+ "version": "1.2.89",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/ComboBox.tsx CHANGED
@@ -163,12 +163,10 @@ export function ComboBox<
163
163
  const addReadOnly = (params: AutocompleteRenderInputParams) => {
164
164
  if (readOnly != null) {
165
165
  Object.assign(params, { readOnly });
166
-
167
- if (readOnly) {
168
- Object.assign(params.inputProps, { "data-reset": true });
169
- }
170
166
  }
171
167
 
168
+ Object.assign(params.inputProps, { "data-reset": inputReset });
169
+
172
170
  if (dataReadonly) {
173
171
  params.inputProps.onKeyDown = (event) => {
174
172
  if (Keyboard.isTypingContent(event.key)) {
@@ -275,7 +273,6 @@ export function ComboBox<
275
273
  required={inputRequired}
276
274
  error={inputError}
277
275
  helperText={inputHelperText}
278
- data-reset={inputReset}
279
276
  />
280
277
  ) : (
281
278
  <InputField
@@ -287,7 +284,6 @@ export function ComboBox<
287
284
  required={inputRequired}
288
285
  error={inputError}
289
286
  helperText={inputHelperText}
290
- data-reset={inputReset}
291
287
  />
292
288
  )
293
289
  }
@@ -178,12 +178,10 @@ export function ComboBoxMultiple<
178
178
  const addReadOnly = (params: AutocompleteRenderInputParams) => {
179
179
  if (readOnly != null) {
180
180
  Object.assign(params, { readOnly });
181
-
182
- if (readOnly) {
183
- Object.assign(params.inputProps, { "data-reset": true });
184
- }
185
181
  }
186
182
 
183
+ Object.assign(params.inputProps, { "data-reset": inputReset });
184
+
187
185
  if (dataReadonly) {
188
186
  params.inputProps.onKeyDown = (event) => {
189
187
  if (Keyboard.isTypingContent(event.key)) {
@@ -287,7 +285,6 @@ export function ComboBoxMultiple<
287
285
  required={inputRequired}
288
286
  error={inputError}
289
287
  helperText={inputHelperText}
290
- data-reset={inputReset}
291
288
  />
292
289
  ) : (
293
290
  <InputField
@@ -299,7 +296,6 @@ export function ComboBoxMultiple<
299
296
  required={inputRequired}
300
297
  error={inputError}
301
298
  helperText={inputHelperText}
302
- data-reset={inputReset}
303
299
  />
304
300
  )
305
301
  }
package/src/Tiplist.tsx CHANGED
@@ -145,7 +145,10 @@ export function Tiplist<
145
145
 
146
146
  // https://stackoverflow.com/questions/15738259/disabling-chrome-autofill
147
147
  // https://html.spec.whatwg.org/multipage/form-control-infrastructure.html
148
- Object.assign(params.inputProps, { autoComplete: inputAutoComplete });
148
+ Object.assign(params.inputProps, {
149
+ autoComplete: inputAutoComplete,
150
+ "data-reset": inputReset
151
+ });
149
152
 
150
153
  return params;
151
154
  };
@@ -338,7 +341,6 @@ export function Tiplist<
338
341
  autoComplete={inputAutoComplete}
339
342
  error={inputError}
340
343
  helperText={inputHelperText}
341
- data-reset={inputReset}
342
344
  />
343
345
  ) : (
344
346
  <InputField
@@ -352,7 +354,6 @@ export function Tiplist<
352
354
  autoComplete={inputAutoComplete}
353
355
  error={inputError}
354
356
  helperText={inputHelperText}
355
- data-reset={inputReset}
356
357
  />
357
358
  )
358
359
  }