hi-tm 0.19.1 → 0.19.3
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.
|
@@ -295,7 +295,13 @@ largeDatasetThreshold = 200, }) => {
|
|
|
295
295
|
// };
|
|
296
296
|
const [isProcessing, setIsProcessing] = (0, react_2.useState)(false);
|
|
297
297
|
const handleCheckboxChange = async (id) => {
|
|
298
|
-
|
|
298
|
+
// Determine dataset size up-front to decide UX behavior
|
|
299
|
+
const totalRows = Array.isArray(rows) ? rows.length : 0;
|
|
300
|
+
const isLargeDataset = totalRows >= largeDatasetThreshold;
|
|
301
|
+
// Only show processing state for large datasets
|
|
302
|
+
if (isLargeDataset) {
|
|
303
|
+
setIsProcessing(true);
|
|
304
|
+
}
|
|
299
305
|
try {
|
|
300
306
|
const findRowById = (rows, targetId) => {
|
|
301
307
|
for (const row of rows) {
|
|
@@ -320,11 +326,14 @@ largeDatasetThreshold = 200, }) => {
|
|
|
320
326
|
return ids;
|
|
321
327
|
};
|
|
322
328
|
const updatedSelection = [...selectedRows];
|
|
323
|
-
const row = findRowById(rows, id);
|
|
329
|
+
const row = rows ? findRowById(rows, id) : null;
|
|
324
330
|
if (!row)
|
|
325
331
|
return;
|
|
326
332
|
const descendantIds = getAllDescendantIds(row);
|
|
327
|
-
|
|
333
|
+
// Apply artificial delay only for large datasets to avoid blocking small lists
|
|
334
|
+
if (isLargeDataset) {
|
|
335
|
+
await new Promise((resolve) => setTimeout(resolve, 300));
|
|
336
|
+
}
|
|
328
337
|
let nextSelected = [];
|
|
329
338
|
if (selectedRows.includes(id)) {
|
|
330
339
|
const idsToRemove = [id, ...descendantIds];
|
|
@@ -340,13 +349,13 @@ largeDatasetThreshold = 200, }) => {
|
|
|
340
349
|
setSelectedRows(nextSelected);
|
|
341
350
|
}
|
|
342
351
|
if (onSelectionChange) {
|
|
343
|
-
const totalRows = Array.isArray(rows) ? rows.length : 0;
|
|
344
|
-
const isLargeDataset = totalRows >= largeDatasetThreshold;
|
|
345
352
|
onSelectionChange(id, { totalRows, selectedIds: nextSelected, isLargeDataset });
|
|
346
353
|
}
|
|
347
354
|
}
|
|
348
355
|
finally {
|
|
349
|
-
|
|
356
|
+
if (isLargeDataset) {
|
|
357
|
+
setIsProcessing(false);
|
|
358
|
+
}
|
|
350
359
|
}
|
|
351
360
|
};
|
|
352
361
|
// Extract title and subtitle from row data
|
|
@@ -7,6 +7,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const GlobalWrapper = ({ children, isSidebarOpen, }) => {
|
|
9
9
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
10
|
-
react_1.default.createElement("div", { className: `h-fit absolute left-3 top-[130px] ${isSidebarOpen ? 'w-full xl:w-[calc(100%-330px)] ' : 'w-full xl:w-[calc(100%-240px)]'}` }, children)));
|
|
10
|
+
react_1.default.createElement("div", { className: `h-fit absolute left-0 xl:left-3 top-[130px] ${isSidebarOpen ? 'w-full xl:w-[calc(100%-330px)] ' : 'w-full xl:w-[calc(100%-240px)]'}` }, children)));
|
|
11
11
|
};
|
|
12
12
|
exports.default = GlobalWrapper;
|