@etsoo/react 1.8.78 → 1.8.79
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/package.json
CHANGED
|
@@ -231,40 +231,36 @@ export const ScrollerList = <T extends object>(props: ScrollerListProps<T>) => {
|
|
|
231
231
|
if (stateRefs.current.isMounted !== false) setRows(items, true);
|
|
232
232
|
};
|
|
233
233
|
|
|
234
|
-
React.useImperativeHandle(
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
const item = rows.at(index);
|
|
243
|
-
if (item) {
|
|
244
|
-
const newRows = [...rows];
|
|
245
|
-
newRows.splice(index, 1);
|
|
246
|
-
setRows(newRows);
|
|
247
|
-
}
|
|
248
|
-
return item;
|
|
249
|
-
},
|
|
250
|
-
insert(item, start) {
|
|
234
|
+
React.useImperativeHandle(mRef, () => {
|
|
235
|
+
return {
|
|
236
|
+
get element() {
|
|
237
|
+
return localRef.current?.element;
|
|
238
|
+
},
|
|
239
|
+
delete(index) {
|
|
240
|
+
const item = rows.at(index);
|
|
241
|
+
if (item) {
|
|
251
242
|
const newRows = [...rows];
|
|
252
|
-
newRows.splice(
|
|
243
|
+
newRows.splice(index, 1);
|
|
253
244
|
setRows(newRows);
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
245
|
+
}
|
|
246
|
+
return item;
|
|
247
|
+
},
|
|
248
|
+
insert(item, start) {
|
|
249
|
+
const newRows = [...rows];
|
|
250
|
+
newRows.splice(start, 0, item);
|
|
251
|
+
setRows(newRows);
|
|
252
|
+
},
|
|
253
|
+
refresh(): void {
|
|
254
|
+
loadDataLocal(0);
|
|
255
|
+
},
|
|
258
256
|
|
|
259
|
-
|
|
257
|
+
reset,
|
|
260
258
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
[]
|
|
267
|
-
);
|
|
259
|
+
scrollToRow(param: ScrollToRowParam): void {
|
|
260
|
+
localRef.current?.scrollToRow(param);
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
}, [rows]);
|
|
268
264
|
|
|
269
265
|
// When layout ready
|
|
270
266
|
React.useEffect(() => {
|