@etsoo/react 1.2.26 → 1.2.27

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.
@@ -12,6 +12,10 @@ export interface AutocompleteExtendedProps<T extends Record<string, any>> extend
12
12
  * Id value
13
13
  */
14
14
  idValue?: DataTypes.IdType;
15
+ /**
16
+ * Autocomplete for the input
17
+ */
18
+ inputAutoComplete?: string;
15
19
  /**
16
20
  * If `dense` or `normal`, will adjust vertical spacing of this and contained components.
17
21
  * @default 'none'
@@ -10,7 +10,7 @@ import { SearchField } from './SearchField';
10
10
  */
11
11
  export function ComboBox(props) {
12
12
  // Destruct
13
- const { search = false, idField = 'id', idValue, inputMargin, inputRequired, inputVariant, defaultValue, label, labelField, loadData, onLoadData, name, options = [], readOnly = true, onChange, value, getOptionLabel = labelField
13
+ const { search = false, idField = 'id', idValue, inputAutoComplete = 'new-region', inputMargin, inputRequired, inputVariant, defaultValue, label, labelField, loadData, onLoadData, name, options = [], readOnly = true, onChange, value, getOptionLabel = labelField
14
14
  ? (option) => option[labelField]
15
15
  : undefined, sx = { minWidth: '150px' }, ...rest } = props;
16
16
  // Value input ref
@@ -69,5 +69,5 @@ export function ComboBox(props) {
69
69
  // Custom
70
70
  if (onChange != null)
71
71
  onChange(event, value, reason, details);
72
- }, sx: sx, renderInput: (params) => search ? (React.createElement(SearchField, { ...addReadOnly(params), label: label, margin: inputMargin, variant: inputVariant, required: inputRequired, autoComplete: "off" })) : (React.createElement(InputField, { ...addReadOnly(params), label: label, margin: inputMargin, variant: inputVariant, required: inputRequired, autoComplete: "off" })), options: localOptions, ...rest })));
72
+ }, sx: sx, renderInput: (params) => search ? (React.createElement(SearchField, { ...addReadOnly(params), label: label, margin: inputMargin, variant: inputVariant, required: inputRequired, autoComplete: inputAutoComplete })) : (React.createElement(InputField, { ...addReadOnly(params), label: label, margin: inputMargin, variant: inputVariant, required: inputRequired, autoComplete: inputAutoComplete })), options: localOptions, ...rest })));
73
73
  }
package/lib/mu/Tiplist.js CHANGED
@@ -10,7 +10,7 @@ import { SearchField } from './SearchField';
10
10
  */
11
11
  export function Tiplist(props) {
12
12
  // Destruct
13
- const { search = false, idField = 'id', idValue, inputMargin, inputRequired, inputVariant, label, loadData, defaultValue, value, name, readOnly, onChange, sx = { minWidth: '180px' }, ...rest } = props;
13
+ const { search = false, idField = 'id', idValue, inputAutoComplete = 'off', inputMargin, inputRequired, inputVariant, label, loadData, defaultValue, value, name, readOnly, onChange, sx = { minWidth: '180px' }, ...rest } = props;
14
14
  // Value input ref
15
15
  const inputRef = React.createRef();
16
16
  // Local value
@@ -149,5 +149,5 @@ export function Tiplist(props) {
149
149
  open: false,
150
150
  ...(!states.value && { options: [] })
151
151
  });
152
- }, loading: states.loading, sx: sx, renderInput: (params) => search ? (React.createElement(SearchField, { onChange: changeHandle, ...params, readOnly: readOnly, label: label, margin: inputMargin, variant: inputVariant, required: inputRequired })) : (React.createElement(InputField, { onChange: changeHandle, ...addReadOnly(params), label: label, margin: inputMargin, variant: inputVariant, required: inputRequired })), isOptionEqualToValue: (option, value) => option[idField] === value[idField], ...rest })));
152
+ }, loading: states.loading, sx: sx, renderInput: (params) => search ? (React.createElement(SearchField, { onChange: changeHandle, ...params, readOnly: readOnly, label: label, margin: inputMargin, variant: inputVariant, required: inputRequired, autoComplete: inputAutoComplete })) : (React.createElement(InputField, { onChange: changeHandle, ...addReadOnly(params), label: label, margin: inputMargin, variant: inputVariant, required: inputRequired, autoComplete: inputAutoComplete })), isOptionEqualToValue: (option, value) => option[idField] === value[idField], ...rest })));
153
153
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/react",
3
- "version": "1.2.26",
3
+ "version": "1.2.27",
4
4
  "description": "TypeScript ReactJs framework",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -19,6 +19,11 @@ export interface AutocompleteExtendedProps<T extends Record<string, any>>
19
19
  */
20
20
  idValue?: DataTypes.IdType;
21
21
 
22
+ /**
23
+ * Autocomplete for the input
24
+ */
25
+ inputAutoComplete?: string;
26
+
22
27
  /**
23
28
  * If `dense` or `normal`, will adjust vertical spacing of this and contained components.
24
29
  * @default 'none'
@@ -45,6 +45,7 @@ export function ComboBox<T extends Record<string, any> = IdLabelDto>(
45
45
  search = false,
46
46
  idField = 'id',
47
47
  idValue,
48
+ inputAutoComplete = 'new-region',
48
49
  inputMargin,
49
50
  inputRequired,
50
51
  inputVariant,
@@ -156,7 +157,7 @@ export function ComboBox<T extends Record<string, any> = IdLabelDto>(
156
157
  margin={inputMargin}
157
158
  variant={inputVariant}
158
159
  required={inputRequired}
159
- autoComplete="off"
160
+ autoComplete={inputAutoComplete}
160
161
  />
161
162
  ) : (
162
163
  <InputField
@@ -165,7 +166,7 @@ export function ComboBox<T extends Record<string, any> = IdLabelDto>(
165
166
  margin={inputMargin}
166
167
  variant={inputVariant}
167
168
  required={inputRequired}
168
- autoComplete="off"
169
+ autoComplete={inputAutoComplete}
169
170
  />
170
171
  )
171
172
  }
@@ -42,6 +42,7 @@ export function Tiplist<T extends Record<string, any> = IdLabelDto>(
42
42
  search = false,
43
43
  idField = 'id',
44
44
  idValue,
45
+ inputAutoComplete = 'off',
45
46
  inputMargin,
46
47
  inputRequired,
47
48
  inputVariant,
@@ -263,6 +264,7 @@ export function Tiplist<T extends Record<string, any> = IdLabelDto>(
263
264
  margin={inputMargin}
264
265
  variant={inputVariant}
265
266
  required={inputRequired}
267
+ autoComplete={inputAutoComplete}
266
268
  />
267
269
  ) : (
268
270
  <InputField
@@ -272,6 +274,7 @@ export function Tiplist<T extends Record<string, any> = IdLabelDto>(
272
274
  margin={inputMargin}
273
275
  variant={inputVariant}
274
276
  required={inputRequired}
277
+ autoComplete={inputAutoComplete}
275
278
  />
276
279
  )
277
280
  }