twico-ui 1.42.0 → 1.42.1

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,14 @@
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.1](https://github.com/EncryptionL/twico-ui/compare/v1.42.0...v1.42.1) (2026-09-24)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * **datatable:** limit the batch-picker escape hatch to server mode ([804d7cb](https://github.com/EncryptionL/twico-ui/commit/804d7cbd39b50190469a31b44477ee9755f07560)), closes [#428](https://github.com/EncryptionL/twico-ui/issues/428) [#433](https://github.com/EncryptionL/twico-ui/issues/433) [#432](https://github.com/EncryptionL/twico-ui/issues/432) [#244](https://github.com/EncryptionL/twico-ui/issues/244)
11
+ * **datatable:** offer per-row editable columns when the selection is on an unloaded page ([33c8cc4](https://github.com/EncryptionL/twico-ui/commit/33c8cc4174bcc07410740b923b7221b26a887d4c)), closes [#428](https://github.com/EncryptionL/twico-ui/issues/428) [#428](https://github.com/EncryptionL/twico-ui/issues/428)
12
+
5
13
  # [1.42.0](https://github.com/EncryptionL/twico-ui/compare/v1.41.1...v1.42.0) (2026-09-24)
6
14
 
7
15
 
package/dist/index.cjs CHANGED
@@ -8691,6 +8691,7 @@ var safeHref6 = (url) => {
8691
8691
  var dtNaturalAlign = (c) => c.type === "number" || c.type === "actions" ? "right" : "left";
8692
8692
  var DT_CELL_WIDGET_SEL = 'button:not(:disabled), a[href], [role="button"], [role="switch"], [role="checkbox"], [role="link"]';
8693
8693
  var dtCellWidgets = (td) => td ? Array.from(td.querySelectorAll(DT_CELL_WIDGET_SEL)).filter((el) => el.getAttribute("aria-hidden") !== "true" && el.getAttribute("aria-disabled") !== "true") : [];
8694
+ var EMPTY_BATCH_SEL = Object.freeze({ testable: Object.freeze([]), hasUntestable: false });
8694
8695
  var DT_CSS = `
8695
8696
  .twc-dt { display: flex; flex-direction: column; font-family: var(--font-sans); color: var(--color-text);
8696
8697
  border: var(--border-thin) solid var(--color-border); border-radius: var(--radius-lg);
@@ -11508,9 +11509,30 @@ function Datatable({
11508
11509
  [cols, editMode, batchEditKey]
11509
11510
  // eslint-disable-line react-hooks/exhaustive-deps
11510
11511
  );
11512
+ const batchSel = React53__namespace.default.useMemo(() => {
11513
+ if (!selected.size) return EMPTY_BATCH_SEL;
11514
+ const testable = [], resolved = /* @__PURE__ */ new Set();
11515
+ const take = (r2, i) => {
11516
+ const k = keyOf(r2, i);
11517
+ if (selected.has(k) && !resolved.has(k)) {
11518
+ resolved.add(k);
11519
+ testable.push(r2);
11520
+ }
11521
+ };
11522
+ for (let i = 0; i < rows.length && resolved.size < selected.size; i++) take(rows[i], i);
11523
+ for (let i = 0; i < leafRows.length && resolved.size < selected.size; i++) take(leafRows[i], i);
11524
+ let hasUntestable = false;
11525
+ if (serverMode) {
11526
+ for (const k of selected) if (!resolved.has(k)) {
11527
+ hasUntestable = true;
11528
+ break;
11529
+ }
11530
+ }
11531
+ return { testable, hasUntestable };
11532
+ }, [rows, leafRows, selected, serverMode]);
11511
11533
  const batchEditableColsSel = React53__namespace.default.useMemo(
11512
- () => batchEditableCols.filter((c) => typeof c.editable !== "function" || selectedRows.some((r2) => c.editable(r2, { field: c.field }))),
11513
- [batchEditableCols, selectedRows]
11534
+ () => batchEditableCols.filter((c) => typeof c.editable !== "function" || batchSel.hasUntestable || batchSel.testable.some((r2) => c.editable(r2, { field: c.field }))),
11535
+ [batchEditableCols, batchSel]
11514
11536
  );
11515
11537
  const hasBatchEditor = showBatchEdit && batchEditableCols.length > 0;
11516
11538
  const [batchEdit, setBatchEdit] = React53__namespace.default.useState(null);
@@ -11592,7 +11614,7 @@ function Datatable({
11592
11614
  const li = keyIndex.get(k);
11593
11615
  const sub = li == null ? null : leafRows[li];
11594
11616
  if (!sub) {
11595
- safeKeys.push(k);
11617
+ if (serverMode) safeKeys.push(k);
11596
11618
  continue;
11597
11619
  }
11598
11620
  let allEditable = true, anyEditable = false;