twico-ui 1.41.1 → 1.42.0

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/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  All notable changes to Twico UI are documented here (newest first). This file is generated automatically on each release by [semantic-release](https://semantic-release.gitbook.io/) from [Conventional Commits](https://www.conventionalcommits.org/) — do not edit it by hand. The same notes appear on each [GitHub Release](https://github.com/EncryptionL/twico-ui/releases).
4
4
 
5
+ # [1.42.0](https://github.com/EncryptionL/twico-ui/compare/v1.41.1...v1.42.0) (2026-09-24)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **datatable:** gate row-tree sub-rows in the batch write + document the 4-arg onBatchUpdate ([1cfb163](https://github.com/EncryptionL/twico-ui/commit/1cfb1638aca476b3234800fb547cbcd78662807d)), closes [#432](https://github.com/EncryptionL/twico-ui/issues/432) [#359](https://github.com/EncryptionL/twico-ui/issues/359) [#428](https://github.com/EncryptionL/twico-ui/issues/428) [#428](https://github.com/EncryptionL/twico-ui/issues/428)
11
+
12
+
13
+ ### Features
14
+
15
+ * **datatable:** report rowPatches + skippedKeys from onBatchUpdate ([f15be7f](https://github.com/EncryptionL/twico-ui/commit/f15be7f6c9611d099f50df850acc47c3bb769bfa))
16
+
5
17
  ## [1.41.1](https://github.com/EncryptionL/twico-ui/compare/v1.41.0...v1.41.1) (2026-09-24)
6
18
 
7
19
 
package/dist/index.cjs CHANGED
@@ -11565,6 +11565,8 @@ function Datatable({
11565
11565
  const loadedSel = /* @__PURE__ */ new Set();
11566
11566
  const changedRows = [];
11567
11567
  const safeKeys = [];
11568
+ const rowPatches = [];
11569
+ const skippedKeys = [];
11568
11570
  const nextAll = rows.map((r2, i) => {
11569
11571
  const k = keyOf(r2, i);
11570
11572
  if (!selKeys2.has(k)) return r2;
@@ -11576,13 +11578,32 @@ function Datatable({
11576
11578
  else allEditable = false;
11577
11579
  }
11578
11580
  if (allEditable) safeKeys.push(k);
11579
- if (!Object.keys(rowPatch).length) return r2;
11581
+ if (!Object.keys(rowPatch).length) {
11582
+ skippedKeys.push(k);
11583
+ return r2;
11584
+ }
11580
11585
  const updated = { ...r2, ...rowPatch };
11581
11586
  changedRows.push(updated);
11587
+ rowPatches.push({ key: k, patch: rowPatch });
11582
11588
  return updated;
11583
11589
  });
11584
- for (const k of selKeys2) if (!loadedSel.has(k)) safeKeys.push(k);
11585
- onBatchUpdate?.(changedRows, patch, safeKeys);
11590
+ for (const k of selKeys2) {
11591
+ if (loadedSel.has(k)) continue;
11592
+ const li = keyIndex.get(k);
11593
+ const sub = li == null ? null : leafRows[li];
11594
+ if (!sub) {
11595
+ safeKeys.push(k);
11596
+ continue;
11597
+ }
11598
+ let allEditable = true, anyEditable = false;
11599
+ for (const c of active) {
11600
+ if (typeof c.editable !== "function" || c.editable(sub, { field: c.field })) anyEditable = true;
11601
+ else allEditable = false;
11602
+ }
11603
+ if (allEditable) safeKeys.push(k);
11604
+ if (!anyEditable) skippedKeys.push(k);
11605
+ }
11606
+ onBatchUpdate?.(changedRows, patch, safeKeys, { rowPatches, skippedKeys });
11586
11607
  onRowsChange?.(nextAll);
11587
11608
  setBatchEdit(null);
11588
11609
  closeBatchEdit();