@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/dist/zx.global.js CHANGED
@@ -11394,6 +11394,7 @@ var zx = (() => {
11394
11394
  /** @returns {void} */
11395
11395
  _renderHeader() {
11396
11396
  const row2 = h("tr", { class: "zx-table__header-row" });
11397
+ if (this._growStep) row2.setAttribute("aria-rowindex", "1");
11397
11398
  if (this.options.selectable === "multi") {
11398
11399
  this._selectAll = h("input", {
11399
11400
  class: "zx-table__checkbox zx-table__select-all",
@@ -11407,9 +11408,9 @@ var zx = (() => {
11407
11408
  row2.append(selectionHeader);
11408
11409
  this.listen(this._selectAll, "click", () => {
11409
11410
  if (this._selectAll.checked) {
11410
- for (const dataRow of this._data) this._selected.add(this._idFor(dataRow));
11411
+ for (const dataRow of this._visibleData()) this._selected.add(this._idFor(dataRow));
11411
11412
  } else {
11412
- this._selected.clear();
11413
+ for (const dataRow of this._visibleData()) this._selected.delete(this._idFor(dataRow));
11413
11414
  }
11414
11415
  this._selectionAnchorId = null;
11415
11416
  this._syncSelection();
@@ -11463,6 +11464,7 @@ var zx = (() => {
11463
11464
  this._visibleData().forEach((row2, index) => fragment.append(this._createRow(row2, index)));
11464
11465
  }
11465
11466
  this._tbody.replaceChildren(fragment);
11467
+ if (this._growStep) this._table.setAttribute("aria-rowcount", String(this._data.length + 1));
11466
11468
  this._syncSelectAll();
11467
11469
  this._syncGrowing();
11468
11470
  if (this._stacked) this._applyStackedRoles(true);
@@ -11488,6 +11490,7 @@ var zx = (() => {
11488
11490
  /** @type {HTMLTableRowElement} */
11489
11491
  h("tr", { dataset: { row: "" } })
11490
11492
  );
11493
+ if (this._growStep) tr.setAttribute("aria-rowindex", String(index + 2));
11491
11494
  const rowClass = typeof this.options.rowClass === "function" ? this.options.rowClass(row2) : "";
11492
11495
  if (rowClass) tr.classList.add(...String(rowClass).split(/\s+/).filter(Boolean));
11493
11496
  if (this.options.selectable !== false) tr.setAttribute("aria-selected", String(this._selected.has(id)));
@@ -11995,10 +11998,14 @@ var zx = (() => {
11995
11998
  /** @returns {void} */
11996
11999
  _syncSelectAll() {
11997
12000
  if (!this._selectAll) return;
11998
- const selectedRows = this._data.reduce((count2, row2) => count2 + Number(this._selected.has(this._idFor(row2))), 0);
11999
- this._selectAll.disabled = this._data.length === 0;
12000
- this._selectAll.checked = this._data.length > 0 && selectedRows === this._data.length;
12001
- this._selectAll.indeterminate = selectedRows > 0 && selectedRows < this._data.length;
12001
+ const visible = this._visibleData();
12002
+ const selectedRows = visible.reduce(
12003
+ (count2, row2) => count2 + Number(this._selected.has(this._idFor(row2))),
12004
+ 0
12005
+ );
12006
+ this._selectAll.disabled = visible.length === 0;
12007
+ this._selectAll.checked = visible.length > 0 && selectedRows === visible.length;
12008
+ this._selectAll.indeterminate = selectedRows > 0 && selectedRows < visible.length;
12002
12009
  }
12003
12010
  /** @returns {void} */
12004
12011
  _syncSortHeader() {