hi-tm 0.19.1 → 0.19.2

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
- setIsProcessing(true);
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
- await new Promise((resolve) => setTimeout(resolve, 300));
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
- setIsProcessing(false);
356
+ if (isLargeDataset) {
357
+ setIsProcessing(false);
358
+ }
350
359
  }
351
360
  };
352
361
  // Extract title and subtitle from row data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hi-tm",
3
- "version": "0.19.1",
3
+ "version": "0.19.2",
4
4
  "styles": "dist/styles/globals.css",
5
5
  "main": "dist/index.js",
6
6
  "exports": {