@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.
@@ -9424,6 +9424,7 @@ var Table = class extends Component {
9424
9424
  /** @returns {void} */
9425
9425
  _renderHeader() {
9426
9426
  const row = h("tr", { class: "zx-table__header-row" });
9427
+ if (this._growStep) row.setAttribute("aria-rowindex", "1");
9427
9428
  if (this.options.selectable === "multi") {
9428
9429
  this._selectAll = h("input", {
9429
9430
  class: "zx-table__checkbox zx-table__select-all",
@@ -9437,9 +9438,9 @@ var Table = class extends Component {
9437
9438
  row.append(selectionHeader);
9438
9439
  this.listen(this._selectAll, "click", () => {
9439
9440
  if (this._selectAll.checked) {
9440
- for (const dataRow of this._data) this._selected.add(this._idFor(dataRow));
9441
+ for (const dataRow of this._visibleData()) this._selected.add(this._idFor(dataRow));
9441
9442
  } else {
9442
- this._selected.clear();
9443
+ for (const dataRow of this._visibleData()) this._selected.delete(this._idFor(dataRow));
9443
9444
  }
9444
9445
  this._selectionAnchorId = null;
9445
9446
  this._syncSelection();
@@ -9493,6 +9494,7 @@ var Table = class extends Component {
9493
9494
  this._visibleData().forEach((row, index) => fragment.append(this._createRow(row, index)));
9494
9495
  }
9495
9496
  this._tbody.replaceChildren(fragment);
9497
+ if (this._growStep) this._table.setAttribute("aria-rowcount", String(this._data.length + 1));
9496
9498
  this._syncSelectAll();
9497
9499
  this._syncGrowing();
9498
9500
  if (this._stacked) this._applyStackedRoles(true);
@@ -9518,6 +9520,7 @@ var Table = class extends Component {
9518
9520
  /** @type {HTMLTableRowElement} */
9519
9521
  h("tr", { dataset: { row: "" } })
9520
9522
  );
9523
+ if (this._growStep) tr.setAttribute("aria-rowindex", String(index + 2));
9521
9524
  const rowClass = typeof this.options.rowClass === "function" ? this.options.rowClass(row) : "";
9522
9525
  if (rowClass) tr.classList.add(...String(rowClass).split(/\s+/).filter(Boolean));
9523
9526
  if (this.options.selectable !== false) tr.setAttribute("aria-selected", String(this._selected.has(id)));
@@ -10025,10 +10028,14 @@ var Table = class extends Component {
10025
10028
  /** @returns {void} */
10026
10029
  _syncSelectAll() {
10027
10030
  if (!this._selectAll) return;
10028
- const selectedRows = this._data.reduce((count, row) => count + Number(this._selected.has(this._idFor(row))), 0);
10029
- this._selectAll.disabled = this._data.length === 0;
10030
- this._selectAll.checked = this._data.length > 0 && selectedRows === this._data.length;
10031
- this._selectAll.indeterminate = selectedRows > 0 && selectedRows < this._data.length;
10031
+ const visible = this._visibleData();
10032
+ const selectedRows = visible.reduce(
10033
+ (count, row) => count + Number(this._selected.has(this._idFor(row))),
10034
+ 0
10035
+ );
10036
+ this._selectAll.disabled = visible.length === 0;
10037
+ this._selectAll.checked = visible.length > 0 && selectedRows === visible.length;
10038
+ this._selectAll.indeterminate = selectedRows > 0 && selectedRows < visible.length;
10032
10039
  }
10033
10040
  /** @returns {void} */
10034
10041
  _syncSortHeader() {