@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.esm.js CHANGED
@@ -11223,6 +11223,7 @@ var Table = class extends Component {
11223
11223
  /** @returns {void} */
11224
11224
  _renderHeader() {
11225
11225
  const row2 = h("tr", { class: "zx-table__header-row" });
11226
+ if (this._growStep) row2.setAttribute("aria-rowindex", "1");
11226
11227
  if (this.options.selectable === "multi") {
11227
11228
  this._selectAll = h("input", {
11228
11229
  class: "zx-table__checkbox zx-table__select-all",
@@ -11236,9 +11237,9 @@ var Table = class extends Component {
11236
11237
  row2.append(selectionHeader);
11237
11238
  this.listen(this._selectAll, "click", () => {
11238
11239
  if (this._selectAll.checked) {
11239
- for (const dataRow of this._data) this._selected.add(this._idFor(dataRow));
11240
+ for (const dataRow of this._visibleData()) this._selected.add(this._idFor(dataRow));
11240
11241
  } else {
11241
- this._selected.clear();
11242
+ for (const dataRow of this._visibleData()) this._selected.delete(this._idFor(dataRow));
11242
11243
  }
11243
11244
  this._selectionAnchorId = null;
11244
11245
  this._syncSelection();
@@ -11292,6 +11293,7 @@ var Table = class extends Component {
11292
11293
  this._visibleData().forEach((row2, index) => fragment.append(this._createRow(row2, index)));
11293
11294
  }
11294
11295
  this._tbody.replaceChildren(fragment);
11296
+ if (this._growStep) this._table.setAttribute("aria-rowcount", String(this._data.length + 1));
11295
11297
  this._syncSelectAll();
11296
11298
  this._syncGrowing();
11297
11299
  if (this._stacked) this._applyStackedRoles(true);
@@ -11317,6 +11319,7 @@ var Table = class extends Component {
11317
11319
  /** @type {HTMLTableRowElement} */
11318
11320
  h("tr", { dataset: { row: "" } })
11319
11321
  );
11322
+ if (this._growStep) tr.setAttribute("aria-rowindex", String(index + 2));
11320
11323
  const rowClass = typeof this.options.rowClass === "function" ? this.options.rowClass(row2) : "";
11321
11324
  if (rowClass) tr.classList.add(...String(rowClass).split(/\s+/).filter(Boolean));
11322
11325
  if (this.options.selectable !== false) tr.setAttribute("aria-selected", String(this._selected.has(id)));
@@ -11824,10 +11827,14 @@ var Table = class extends Component {
11824
11827
  /** @returns {void} */
11825
11828
  _syncSelectAll() {
11826
11829
  if (!this._selectAll) return;
11827
- const selectedRows = this._data.reduce((count2, row2) => count2 + Number(this._selected.has(this._idFor(row2))), 0);
11828
- this._selectAll.disabled = this._data.length === 0;
11829
- this._selectAll.checked = this._data.length > 0 && selectedRows === this._data.length;
11830
- this._selectAll.indeterminate = selectedRows > 0 && selectedRows < this._data.length;
11830
+ const visible = this._visibleData();
11831
+ const selectedRows = visible.reduce(
11832
+ (count2, row2) => count2 + Number(this._selected.has(this._idFor(row2))),
11833
+ 0
11834
+ );
11835
+ this._selectAll.disabled = visible.length === 0;
11836
+ this._selectAll.checked = visible.length > 0 && selectedRows === visible.length;
11837
+ this._selectAll.indeterminate = selectedRows > 0 && selectedRows < visible.length;
11831
11838
  }
11832
11839
  /** @returns {void} */
11833
11840
  _syncSortHeader() {