@etsoo/materialui 1.0.97 → 1.0.99

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/DataSteps.js CHANGED
@@ -5,9 +5,9 @@ import NavigateBeforeIcon from '@mui/icons-material/NavigateBefore';
5
5
  import CheckIcon from '@mui/icons-material/Check';
6
6
  import StartIcon from '@mui/icons-material/Start';
7
7
  import React from 'react';
8
+ import { HBox } from './FlexBox';
8
9
  import { globalApp } from './app/ReactApp';
9
10
  import { MUGlobal } from './MUGlobal';
10
- import { HBox } from './FlexBox';
11
11
  /**
12
12
  * Data collecting steps component
13
13
  * @param props Props
@@ -27,7 +27,8 @@ export function DataSteps(props) {
27
27
  const indexRef = React.useRef(-1);
28
28
  // Current Json data
29
29
  const jsonRef = React.useRef(jsonValue);
30
- if (jsonValue != jsonRef.current)
30
+ // Ignore empty value case
31
+ if (jsonValue !== jsonRef.current && valueFormatter(jsonValue))
31
32
  jsonRef.current = jsonValue;
32
33
  // Current value
33
34
  const [localValue, setLocalValue] = React.useState(value);
@@ -72,8 +73,8 @@ export function DataSteps(props) {
72
73
  };
73
74
  React.useEffect(() => {
74
75
  setLocalValue(valueFormatter(jsonRef.current));
75
- }, [jsonRef.current]);
76
- return (React.createElement(TextField, { InputLabelProps: InputLabelProps, inputProps: { style: { cursor: 'pointer' } }, InputProps: {
76
+ }, [valueFormatter]);
77
+ return (React.createElement(TextField, { autoComplete: "new-password", InputLabelProps: InputLabelProps, inputProps: { style: { cursor: 'pointer' } }, InputProps: {
77
78
  onKeyDown: (event) => {
78
79
  if (event.key === 'Tab')
79
80
  return;
package/lib/DnDList.d.ts CHANGED
@@ -39,6 +39,10 @@ export interface DnDListRef<D extends object> {
39
39
  * @param index Index
40
40
  */
41
41
  editItem(newItem: D, index: number): boolean;
42
+ /**
43
+ * Get all items
44
+ */
45
+ getItems(): D[];
42
46
  }
43
47
  /**
44
48
  * DnD sortable list properties
package/lib/DnDList.js CHANGED
@@ -139,6 +139,9 @@ export function DnDList(props) {
139
139
  newItems.splice(index, 1);
140
140
  // Update the state
141
141
  changeItems(newItems);
142
+ },
143
+ getItems() {
144
+ return items;
142
145
  }
143
146
  };
144
147
  }, [items]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.0.97",
3
+ "version": "1.0.99",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
package/src/DataSteps.tsx CHANGED
@@ -12,9 +12,9 @@ import CheckIcon from '@mui/icons-material/Check';
12
12
  import StartIcon from '@mui/icons-material/Start';
13
13
  import { InputDialogProps } from '@etsoo/react';
14
14
  import React from 'react';
15
+ import { HBox } from './FlexBox';
15
16
  import { globalApp } from './app/ReactApp';
16
17
  import { MUGlobal } from './MUGlobal';
17
- import { HBox } from './FlexBox';
18
18
 
19
19
  /**
20
20
  * Data step
@@ -85,7 +85,10 @@ export function DataSteps<T extends object>(props: DataStepsProps<T>) {
85
85
 
86
86
  // Current Json data
87
87
  const jsonRef = React.useRef<T>(jsonValue);
88
- if (jsonValue != jsonRef.current) jsonRef.current = jsonValue;
88
+
89
+ // Ignore empty value case
90
+ if (jsonValue !== jsonRef.current && valueFormatter(jsonValue))
91
+ jsonRef.current = jsonValue;
89
92
 
90
93
  // Current value
91
94
  const [localValue, setLocalValue] = React.useState(value);
@@ -174,10 +177,11 @@ export function DataSteps<T extends object>(props: DataStepsProps<T>) {
174
177
 
175
178
  React.useEffect(() => {
176
179
  setLocalValue(valueFormatter(jsonRef.current));
177
- }, [jsonRef.current]);
180
+ }, [valueFormatter]);
178
181
 
179
182
  return (
180
183
  <TextField
184
+ autoComplete="new-password"
181
185
  InputLabelProps={InputLabelProps}
182
186
  inputProps={{ style: { cursor: 'pointer' } }}
183
187
  InputProps={{
package/src/DnDList.tsx CHANGED
@@ -104,6 +104,11 @@ export interface DnDListRef<D extends object> {
104
104
  * @param index Index
105
105
  */
106
106
  editItem(newItem: D, index: number): boolean;
107
+
108
+ /**
109
+ * Get all items
110
+ */
111
+ getItems(): D[];
107
112
  }
108
113
 
109
114
  /**
@@ -304,6 +309,10 @@ export function DnDList<
304
309
 
305
310
  // Update the state
306
311
  changeItems(newItems);
312
+ },
313
+
314
+ getItems() {
315
+ return items;
307
316
  }
308
317
  };
309
318
  },