@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.
@@ -11382,6 +11382,7 @@
11382
11382
  /** @returns {void} */
11383
11383
  _renderHeader() {
11384
11384
  const row2 = h("tr", { class: "zx-table__header-row" });
11385
+ if (this._growStep) row2.setAttribute("aria-rowindex", "1");
11385
11386
  if (this.options.selectable === "multi") {
11386
11387
  this._selectAll = h("input", {
11387
11388
  class: "zx-table__checkbox zx-table__select-all",
@@ -11395,9 +11396,9 @@
11395
11396
  row2.append(selectionHeader);
11396
11397
  this.listen(this._selectAll, "click", () => {
11397
11398
  if (this._selectAll.checked) {
11398
- for (const dataRow of this._data) this._selected.add(this._idFor(dataRow));
11399
+ for (const dataRow of this._visibleData()) this._selected.add(this._idFor(dataRow));
11399
11400
  } else {
11400
- this._selected.clear();
11401
+ for (const dataRow of this._visibleData()) this._selected.delete(this._idFor(dataRow));
11401
11402
  }
11402
11403
  this._selectionAnchorId = null;
11403
11404
  this._syncSelection();
@@ -11451,6 +11452,7 @@
11451
11452
  this._visibleData().forEach((row2, index) => fragment.append(this._createRow(row2, index)));
11452
11453
  }
11453
11454
  this._tbody.replaceChildren(fragment);
11455
+ if (this._growStep) this._table.setAttribute("aria-rowcount", String(this._data.length + 1));
11454
11456
  this._syncSelectAll();
11455
11457
  this._syncGrowing();
11456
11458
  if (this._stacked) this._applyStackedRoles(true);
@@ -11476,6 +11478,7 @@
11476
11478
  /** @type {HTMLTableRowElement} */
11477
11479
  h("tr", { dataset: { row: "" } })
11478
11480
  );
11481
+ if (this._growStep) tr.setAttribute("aria-rowindex", String(index + 2));
11479
11482
  const rowClass = typeof this.options.rowClass === "function" ? this.options.rowClass(row2) : "";
11480
11483
  if (rowClass) tr.classList.add(...String(rowClass).split(/\s+/).filter(Boolean));
11481
11484
  if (this.options.selectable !== false) tr.setAttribute("aria-selected", String(this._selected.has(id)));
@@ -11983,10 +11986,14 @@
11983
11986
  /** @returns {void} */
11984
11987
  _syncSelectAll() {
11985
11988
  if (!this._selectAll) return;
11986
- const selectedRows = this._data.reduce((count2, row2) => count2 + Number(this._selected.has(this._idFor(row2))), 0);
11987
- this._selectAll.disabled = this._data.length === 0;
11988
- this._selectAll.checked = this._data.length > 0 && selectedRows === this._data.length;
11989
- this._selectAll.indeterminate = selectedRows > 0 && selectedRows < this._data.length;
11989
+ const visible = this._visibleData();
11990
+ const selectedRows = visible.reduce(
11991
+ (count2, row2) => count2 + Number(this._selected.has(this._idFor(row2))),
11992
+ 0
11993
+ );
11994
+ this._selectAll.disabled = visible.length === 0;
11995
+ this._selectAll.checked = visible.length > 0 && selectedRows === visible.length;
11996
+ this._selectAll.indeterminate = selectedRows > 0 && selectedRows < visible.length;
11990
11997
  }
11991
11998
  /** @returns {void} */
11992
11999
  _syncSortHeader() {