@zeyos/zx 2.2.0 → 2.2.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
@@ -8,6 +8,18 @@ and friends remain the complete record.
8
8
 
9
9
  ## Unreleased
10
10
 
11
+ ## 2.2.1 — 2026-08-21
12
+
13
+ ### Fixed
14
+
15
+ - **Select-all covers the rendered rows when `growing` is on**, not the whole result set. Ticking a
16
+ box above the ten rows you can see and selecting a hundred is a trap, because the next click is
17
+ usually a bulk action; `showAll()` first to mean all of them. Tables without `growing` are
18
+ unaffected — everything is rendered, so the two are the same set.
19
+ - **A growing table reports its real size to assistive technology.** Only a prefix of the data is in
20
+ the DOM, so a screen reader was announcing "row 3 of 10" for a table of ten thousand. The table
21
+ now carries `aria-rowcount` and each row an `aria-rowindex`.
22
+
11
23
  ## 2.2.0 — 2026-08-21
12
24
 
13
25
  ### Added
@@ -10921,6 +10921,7 @@ var Table = class extends Component {
10921
10921
  /** @returns {void} */
10922
10922
  _renderHeader() {
10923
10923
  const row = h("tr", { class: "zx-table__header-row" });
10924
+ if (this._growStep) row.setAttribute("aria-rowindex", "1");
10924
10925
  if (this.options.selectable === "multi") {
10925
10926
  this._selectAll = h("input", {
10926
10927
  class: "zx-table__checkbox zx-table__select-all",
@@ -10934,9 +10935,9 @@ var Table = class extends Component {
10934
10935
  row.append(selectionHeader);
10935
10936
  this.listen(this._selectAll, "click", () => {
10936
10937
  if (this._selectAll.checked) {
10937
- for (const dataRow of this._data) this._selected.add(this._idFor(dataRow));
10938
+ for (const dataRow of this._visibleData()) this._selected.add(this._idFor(dataRow));
10938
10939
  } else {
10939
- this._selected.clear();
10940
+ for (const dataRow of this._visibleData()) this._selected.delete(this._idFor(dataRow));
10940
10941
  }
10941
10942
  this._selectionAnchorId = null;
10942
10943
  this._syncSelection();
@@ -10990,6 +10991,7 @@ var Table = class extends Component {
10990
10991
  this._visibleData().forEach((row, index) => fragment.append(this._createRow(row, index)));
10991
10992
  }
10992
10993
  this._tbody.replaceChildren(fragment);
10994
+ if (this._growStep) this._table.setAttribute("aria-rowcount", String(this._data.length + 1));
10993
10995
  this._syncSelectAll();
10994
10996
  this._syncGrowing();
10995
10997
  if (this._stacked) this._applyStackedRoles(true);
@@ -11015,6 +11017,7 @@ var Table = class extends Component {
11015
11017
  /** @type {HTMLTableRowElement} */
11016
11018
  h("tr", { dataset: { row: "" } })
11017
11019
  );
11020
+ if (this._growStep) tr.setAttribute("aria-rowindex", String(index + 2));
11018
11021
  const rowClass = typeof this.options.rowClass === "function" ? this.options.rowClass(row) : "";
11019
11022
  if (rowClass) tr.classList.add(...String(rowClass).split(/\s+/).filter(Boolean));
11020
11023
  if (this.options.selectable !== false) tr.setAttribute("aria-selected", String(this._selected.has(id)));
@@ -11522,10 +11525,14 @@ var Table = class extends Component {
11522
11525
  /** @returns {void} */
11523
11526
  _syncSelectAll() {
11524
11527
  if (!this._selectAll) return;
11525
- const selectedRows = this._data.reduce((count, row) => count + Number(this._selected.has(this._idFor(row))), 0);
11526
- this._selectAll.disabled = this._data.length === 0;
11527
- this._selectAll.checked = this._data.length > 0 && selectedRows === this._data.length;
11528
- this._selectAll.indeterminate = selectedRows > 0 && selectedRows < this._data.length;
11528
+ const visible = this._visibleData();
11529
+ const selectedRows = visible.reduce(
11530
+ (count, row) => count + Number(this._selected.has(this._idFor(row))),
11531
+ 0
11532
+ );
11533
+ this._selectAll.disabled = visible.length === 0;
11534
+ this._selectAll.checked = visible.length > 0 && selectedRows === visible.length;
11535
+ this._selectAll.indeterminate = selectedRows > 0 && selectedRows < visible.length;
11529
11536
  }
11530
11537
  /** @returns {void} */
11531
11538
  _syncSortHeader() {