@gridkitjs/react 0.13.0 → 0.14.0

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/index.js CHANGED
@@ -1110,9 +1110,10 @@ function GridFooter({
1110
1110
  aggregates,
1111
1111
  results,
1112
1112
  rows,
1113
- locale
1113
+ locale,
1114
+ ariaRowIndex
1114
1115
  }) {
1115
- return /* @__PURE__ */ jsx8("tfoot", { role: "rowgroup", children: /* @__PURE__ */ jsx8("tr", { className: "grid-footer", role: "row", children: columns.map((entry) => {
1116
+ return /* @__PURE__ */ jsx8("tfoot", { role: "rowgroup", children: /* @__PURE__ */ jsx8("tr", { className: "grid-footer", role: "row", "aria-rowindex": ariaRowIndex, children: columns.map((entry) => {
1116
1117
  const specs = aggregates.filter(
1117
1118
  (candidate) => candidate.columnId === entry.id
1118
1119
  );
@@ -1157,8 +1158,10 @@ function PagerNavButton({
1157
1158
  className: `grid-pager-button grid-pager-nav ${className}`,
1158
1159
  "aria-label": label,
1159
1160
  title: label,
1160
- disabled,
1161
- onClick,
1161
+ ...ariaAttr(disabled, "aria-disabled", true),
1162
+ onClick: () => {
1163
+ if (!disabled) onClick();
1164
+ },
1162
1165
  children
1163
1166
  }
1164
1167
  );
@@ -4586,6 +4589,7 @@ function DataGrid(props) {
4586
4589
  selection.columnMode === false ? "" : "selectable-columns",
4587
4590
  selection.cellMode === false ? "" : "selectable-cells"
4588
4591
  );
4592
+ const hasFooter = aggregates.length > 0;
4589
4593
  return /* @__PURE__ */ jsxs19("div", { className: "gridkit-data-grid-viewport", ref: viewportRef, children: [
4590
4594
  /* @__PURE__ */ jsx26(
4591
4595
  GridToolbar,
@@ -4619,7 +4623,7 @@ function DataGrid(props) {
4619
4623
  id: gridId,
4620
4624
  className: "gridkit-data-grid-tables",
4621
4625
  role: state.groupBy.length > 0 ? "treegrid" : "grid",
4622
- "aria-rowcount": view.displayRows.length + 1,
4626
+ "aria-rowcount": view.displayRows.length + (hasFooter ? 2 : 1),
4623
4627
  "aria-colcount": view.columns.length,
4624
4628
  ...ariaAttr(multiselectable, "aria-multiselectable", true),
4625
4629
  ...ariaAttr(labelledBy !== void 0, "aria-labelledby", labelledBy),
@@ -4720,7 +4724,7 @@ function DataGrid(props) {
4720
4724
  )
4721
4725
  }
4722
4726
  ),
4723
- aggregates.length > 0 && /* @__PURE__ */ jsxs19(
4727
+ hasFooter && /* @__PURE__ */ jsxs19(
4724
4728
  "table",
4725
4729
  {
4726
4730
  role: "presentation",
@@ -4738,7 +4742,8 @@ function DataGrid(props) {
4738
4742
  aggregates,
4739
4743
  results: view.grandTotal,
4740
4744
  rows: view.rows.map((entry) => entry.row),
4741
- locale
4745
+ locale,
4746
+ ariaRowIndex: view.displayRows.length + 2
4742
4747
  }
4743
4748
  )
4744
4749
  ]