@etsoo/materialui 1.3.12 → 1.3.14

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/SelectEx.d.ts CHANGED
@@ -17,6 +17,10 @@ export type SelectExProps<T extends object, D extends DataTypes.Keys<T> = IdDefa
17
17
  * Id field
18
18
  */
19
19
  idField?: D;
20
+ /**
21
+ * Set 'data-reset'
22
+ */
23
+ inputReset?: boolean;
20
24
  /**
21
25
  * Item icon renderer
22
26
  */
package/lib/SelectEx.js CHANGED
@@ -12,7 +12,7 @@ import { ReactUtils } from "@etsoo/react";
12
12
  */
13
13
  export function SelectEx(props) {
14
14
  // Destruct
15
- const { defaultValue, idField = "id", error, helperText, itemIconRenderer, itemStyle, label, labelField = "label", loadData, onItemChange, onItemClick, onLoadData, multiple = false, name, options, refresh, search = false, autoAddBlankItem = search, value, onChange, fullWidth, required, variant = "outlined", ...rest } = props;
15
+ const { defaultValue, idField = "id", error, helperText, inputReset, itemIconRenderer, itemStyle, label, labelField = "label", loadData, onItemChange, onItemClick, onLoadData, multiple = false, name, options, refresh, search = false, autoAddBlankItem = search, value, onChange, fullWidth, required, variant = "outlined", ...rest } = props;
16
16
  // Options state
17
17
  const [localOptions, setOptions] = React.useState([]);
18
18
  const isMounted = React.useRef(false);
@@ -133,7 +133,7 @@ export function SelectEx(props) {
133
133
  ? valueState
134
134
  : localOptions.some((o) => o[idField] === valueState)
135
135
  ? valueState
136
- : "", input: React.createElement(OutlinedInput, { notched: true, label: label, required: required }), labelId: labelId, name: name, multiple: multiple, onChange: (event, child) => {
136
+ : "", input: React.createElement(OutlinedInput, { notched: true, label: label, required: required, inputProps: { "data-reset": inputReset } }), labelId: labelId, name: name, multiple: multiple, onChange: (event, child) => {
137
137
  if (onChange) {
138
138
  onChange(event, child);
139
139
  // event.preventDefault() will block executing
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.3.12",
3
+ "version": "1.3.14",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,12 +50,12 @@
50
50
  "@emotion/css": "^11.11.2",
51
51
  "@emotion/react": "^11.11.1",
52
52
  "@emotion/styled": "^11.11.0",
53
- "@etsoo/appscript": "^1.4.48",
53
+ "@etsoo/appscript": "^1.4.52",
54
54
  "@etsoo/notificationbase": "^1.1.28",
55
55
  "@etsoo/react": "^1.7.8",
56
56
  "@etsoo/shared": "^1.2.12",
57
- "@mui/icons-material": "^5.14.8",
58
- "@mui/material": "^5.14.8",
57
+ "@mui/icons-material": "^5.14.9",
58
+ "@mui/material": "^5.14.9",
59
59
  "@mui/x-data-grid": "^6.13.0",
60
60
  "@types/pica": "^9.0.1",
61
61
  "@types/pulltorefreshjs": "^0.1.5",
package/src/SelectEx.tsx CHANGED
@@ -48,6 +48,11 @@ export type SelectExProps<
48
48
  */
49
49
  idField?: D;
50
50
 
51
+ /**
52
+ * Set 'data-reset'
53
+ */
54
+ inputReset?: boolean;
55
+
51
56
  /**
52
57
  * Item icon renderer
53
58
  */
@@ -115,6 +120,7 @@ export function SelectEx<
115
120
  idField = "id" as D,
116
121
  error,
117
122
  helperText,
123
+ inputReset,
118
124
  itemIconRenderer,
119
125
  itemStyle,
120
126
  label,
@@ -291,7 +297,14 @@ export function SelectEx<
291
297
  ? valueState
292
298
  : ""
293
299
  }
294
- input={<OutlinedInput notched label={label} required={required} />}
300
+ input={
301
+ <OutlinedInput
302
+ notched
303
+ label={label}
304
+ required={required}
305
+ inputProps={{ "data-reset": inputReset }}
306
+ />
307
+ }
295
308
  labelId={labelId}
296
309
  name={name}
297
310
  multiple={multiple}