@etsoo/materialui 1.3.29 → 1.3.31

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.
@@ -87,7 +87,7 @@ export const IntInputField = React.forwardRef((props, ref) => {
87
87
  if (localValue == null)
88
88
  return;
89
89
  const value = NumberUtils.parse(localValue);
90
- if (isNaN(value))
90
+ if (value == null)
91
91
  return;
92
92
  if (value <= min)
93
93
  setValue(undefined, "SUB");
@@ -102,7 +102,7 @@ export const IntInputField = React.forwardRef((props, ref) => {
102
102
  return;
103
103
  }
104
104
  const value = NumberUtils.parse(localValue);
105
- if (isNaN(value))
105
+ if (value == null)
106
106
  return;
107
107
  if (value >= max)
108
108
  return;
package/lib/TableEx.js CHANGED
@@ -69,6 +69,20 @@ export function TableEx(props) {
69
69
  Object.assign(state, resetState);
70
70
  };
71
71
  React.useImperativeHandle(mRef, () => ({
72
+ delete(index) {
73
+ const item = rows.at(index);
74
+ if (item) {
75
+ const newRows = [...rows];
76
+ newRows.splice(index, 1);
77
+ setRows(newRows);
78
+ }
79
+ return item;
80
+ },
81
+ insert(item, start) {
82
+ const newRows = [...rows];
83
+ newRows.splice(start, 0, item);
84
+ setRows(newRows);
85
+ },
72
86
  /**
73
87
  * Refresh data
74
88
  */
@@ -78,7 +92,13 @@ export function TableEx(props) {
78
92
  /**
79
93
  * Reset
80
94
  */
81
- reset
95
+ reset,
96
+ scrollToRef(scrollOffset) {
97
+ // Not implemented
98
+ },
99
+ scrollToItemRef(index) {
100
+ // Not implemented
101
+ }
82
102
  }), []);
83
103
  // Load data
84
104
  const loadDataLocal = () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/materialui",
3
- "version": "1.3.29",
3
+ "version": "1.3.31",
4
4
  "description": "TypeScript Material-UI Implementation",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -50,16 +50,16 @@
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.59",
54
- "@etsoo/notificationbase": "^1.1.29",
55
- "@etsoo/react": "^1.7.19",
56
- "@etsoo/shared": "^1.2.17",
57
- "@mui/icons-material": "^5.14.14",
58
- "@mui/material": "^5.14.14",
59
- "@mui/x-data-grid": "^6.16.2",
53
+ "@etsoo/appscript": "^1.4.62",
54
+ "@etsoo/notificationbase": "^1.1.30",
55
+ "@etsoo/react": "^1.7.21",
56
+ "@etsoo/shared": "^1.2.18",
57
+ "@mui/icons-material": "^5.14.16",
58
+ "@mui/material": "^5.14.16",
59
+ "@mui/x-data-grid": "^6.17.0",
60
60
  "@types/pica": "^9.0.3",
61
61
  "@types/pulltorefreshjs": "^0.1.6",
62
- "@types/react": "^18.2.29",
62
+ "@types/react": "^18.2.33",
63
63
  "@types/react-avatar-editor": "^13.0.1",
64
64
  "@types/react-dom": "^18.2.14",
65
65
  "@types/react-input-mask": "^3.0.4",
@@ -84,9 +84,9 @@
84
84
  "@babel/runtime-corejs3": "^7.23.2",
85
85
  "@testing-library/jest-dom": "^6.1.4",
86
86
  "@testing-library/react": "^14.0.0",
87
- "@types/jest": "^29.5.6",
88
- "@typescript-eslint/eslint-plugin": "^6.8.0",
89
- "@typescript-eslint/parser": "^6.8.0",
87
+ "@types/jest": "^29.5.7",
88
+ "@typescript-eslint/eslint-plugin": "^6.9.1",
89
+ "@typescript-eslint/parser": "^6.9.1",
90
90
  "jest": "^29.7.0",
91
91
  "jest-environment-jsdom": "^29.7.0",
92
92
  "typescript": "^5.2.2"
@@ -203,7 +203,7 @@ export const IntInputField = React.forwardRef<
203
203
  if (localValue == null) return;
204
204
 
205
205
  const value = NumberUtils.parse(localValue);
206
- if (isNaN(value)) return;
206
+ if (value == null) return;
207
207
 
208
208
  if (value <= min) setValue(undefined, "SUB");
209
209
  else setValue(value - step, "SUB");
@@ -221,7 +221,7 @@ export const IntInputField = React.forwardRef<
221
221
  }
222
222
 
223
223
  const value = NumberUtils.parse(localValue);
224
- if (isNaN(value)) return;
224
+ if (value == null) return;
225
225
 
226
226
  if (value >= max) return;
227
227
  else setValue(value + step, "ADD");
package/src/TableEx.tsx CHANGED
@@ -182,6 +182,20 @@ export function TableEx<
182
182
  React.useImperativeHandle(
183
183
  mRef,
184
184
  () => ({
185
+ delete(index) {
186
+ const item = rows.at(index);
187
+ if (item) {
188
+ const newRows = [...rows];
189
+ newRows.splice(index, 1);
190
+ setRows(newRows);
191
+ }
192
+ return item;
193
+ },
194
+ insert(item, start) {
195
+ const newRows = [...rows];
196
+ newRows.splice(start, 0, item);
197
+ setRows(newRows);
198
+ },
185
199
  /**
186
200
  * Refresh data
187
201
  */
@@ -192,7 +206,14 @@ export function TableEx<
192
206
  /**
193
207
  * Reset
194
208
  */
195
- reset
209
+ reset,
210
+ scrollToRef(scrollOffset: number): void {
211
+ // Not implemented
212
+ },
213
+
214
+ scrollToItemRef(index: number): void {
215
+ // Not implemented
216
+ }
196
217
  }),
197
218
  []
198
219
  );