@etsoo/materialui 1.3.30 → 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.
- package/lib/TableEx.js +21 -1
- package/package.json +4 -4
- package/src/TableEx.tsx +22 -1
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.
|
|
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",
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"@emotion/styled": "^11.11.0",
|
|
53
53
|
"@etsoo/appscript": "^1.4.62",
|
|
54
54
|
"@etsoo/notificationbase": "^1.1.30",
|
|
55
|
-
"@etsoo/react": "^1.7.
|
|
55
|
+
"@etsoo/react": "^1.7.21",
|
|
56
56
|
"@etsoo/shared": "^1.2.18",
|
|
57
|
-
"@mui/icons-material": "^5.14.
|
|
58
|
-
"@mui/material": "^5.14.
|
|
57
|
+
"@mui/icons-material": "^5.14.16",
|
|
58
|
+
"@mui/material": "^5.14.16",
|
|
59
59
|
"@mui/x-data-grid": "^6.17.0",
|
|
60
60
|
"@types/pica": "^9.0.3",
|
|
61
61
|
"@types/pulltorefreshjs": "^0.1.6",
|
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
|
);
|