achery-ui 0.5.6 → 0.5.7

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.cjs CHANGED
@@ -1012,18 +1012,19 @@ function AppBar({
1012
1012
  }
1013
1013
 
1014
1014
  // src/components/Table/Table.css.ts
1015
- var emptyState = "Table_emptyState__1a2tbysa";
1016
- var pagination = "Table_pagination__1a2tbysb";
1017
- var sortIndicator = "Table_sortIndicator__1a2tbys5";
1018
- var table = "Table_table__1a2tbys1";
1015
+ var emptyState = "Table_emptyState__1a2tbysb";
1016
+ var pagination = "Table_pagination__1a2tbysc";
1017
+ var sortIndicator = "Table_sortIndicator__1a2tbys6";
1018
+ var table = "Table_table__1a2tbys2";
1019
+ var tableScroll = "Table_tableScroll__1a2tbys1";
1019
1020
  var tableWrapper = "Table_tableWrapper__1a2tbys0";
1020
- var td = "Table_td__1a2tbys7";
1021
- var tdMono = "Table_tdMono__1a2tbys8 Table_td__1a2tbys7";
1022
- var th = "Table_th__1a2tbys3";
1023
- var thSortable = "Table_thSortable__1a2tbys4 Table_th__1a2tbys3";
1024
- var thead = "Table_thead__1a2tbys2";
1025
- var toolbar = "Table_toolbar__1a2tbys9";
1026
- var tr = "Table_tr__1a2tbys6";
1021
+ var td = "Table_td__1a2tbys8";
1022
+ var tdMono = "Table_tdMono__1a2tbys9 Table_td__1a2tbys8";
1023
+ var th = "Table_th__1a2tbys4";
1024
+ var thSortable = "Table_thSortable__1a2tbys5 Table_th__1a2tbys4";
1025
+ var thead = "Table_thead__1a2tbys3";
1026
+ var toolbar = "Table_toolbar__1a2tbysa";
1027
+ var tr = "Table_tr__1a2tbys7";
1027
1028
  function Table({
1028
1029
  columns,
1029
1030
  data,
@@ -1076,37 +1077,44 @@ function Table({
1076
1077
  const isLastPage = totalPages !== null ? pageIndex >= totalPages - 1 : true;
1077
1078
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: [tableWrapper, className].filter(Boolean).join(" "), children: [
1078
1079
  toolbar2 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: toolbar, children: toolbar2 }),
1079
- /* @__PURE__ */ jsxRuntime.jsxs("table", { className: table, children: [
1080
- /* @__PURE__ */ jsxRuntime.jsx("thead", { className: thead, children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsxs(
1081
- "th",
1082
- {
1083
- className: col.sortable ? thSortable : th,
1084
- style: col.width ? { width: col.width } : void 0,
1085
- onClick: col.sortable ? () => handleSort(col.key) : void 0,
1086
- "aria-sort": activeSortKey === col.key ? activeSortDir === "asc" ? "ascending" : "descending" : void 0,
1087
- children: [
1088
- col.label,
1089
- col.sortable && activeSortKey === col.key && activeSortDir && /* @__PURE__ */ jsxRuntime.jsx("span", { className: sortIndicator, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(Glyph, { name: activeSortDir === "asc" ? "arrow-up" : "arrow-right", size: 10 }) })
1090
- ]
1091
- },
1092
- col.key
1093
- )) }) }),
1094
- /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: columns.length, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: emptyState, children: emptyState2 ?? "No data." }) }) }) : sortedData.map((row) => {
1095
- const key = rowKey(row);
1096
- const isSelected = selectedKeys?.includes(key) ?? false;
1097
- return /* @__PURE__ */ jsxRuntime.jsx(
1098
- "tr",
1099
- {
1100
- className: tr,
1101
- "data-selected": isSelected,
1102
- onClick: onRowClick ? () => onRowClick(key, row) : void 0,
1103
- style: onRowClick ? { cursor: "pointer" } : void 0,
1104
- children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx("td", { className: col.mono ? tdMono : td, children: col.render ? col.render(row) : String(row[col.key] ?? "") }, col.key))
1105
- },
1106
- key
1107
- );
1108
- }) })
1109
- ] }),
1080
+ /* @__PURE__ */ jsxRuntime.jsx(
1081
+ "div",
1082
+ {
1083
+ className: tableScroll,
1084
+ style: pageSize ? { minHeight: 37 + pageSize * 38 } : void 0,
1085
+ children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: table, children: [
1086
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { className: thead, children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsxs(
1087
+ "th",
1088
+ {
1089
+ className: col.sortable ? thSortable : th,
1090
+ style: col.width ? { width: col.width } : void 0,
1091
+ onClick: col.sortable ? () => handleSort(col.key) : void 0,
1092
+ "aria-sort": activeSortKey === col.key ? activeSortDir === "asc" ? "ascending" : "descending" : void 0,
1093
+ children: [
1094
+ col.label,
1095
+ col.sortable && activeSortKey === col.key && activeSortDir && /* @__PURE__ */ jsxRuntime.jsx("span", { className: sortIndicator, "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(Glyph, { name: activeSortDir === "asc" ? "arrow-up" : "arrow-right", size: 10 }) })
1096
+ ]
1097
+ },
1098
+ col.key
1099
+ )) }) }),
1100
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: data.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("tr", { children: /* @__PURE__ */ jsxRuntime.jsx("td", { colSpan: columns.length, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: emptyState, children: emptyState2 ?? "No data." }) }) }) : sortedData.map((row) => {
1101
+ const key = rowKey(row);
1102
+ const isSelected = selectedKeys?.includes(key) ?? false;
1103
+ return /* @__PURE__ */ jsxRuntime.jsx(
1104
+ "tr",
1105
+ {
1106
+ className: tr,
1107
+ "data-selected": isSelected,
1108
+ onClick: onRowClick ? () => onRowClick(key, row) : void 0,
1109
+ style: onRowClick ? { cursor: "pointer" } : void 0,
1110
+ children: columns.map((col) => /* @__PURE__ */ jsxRuntime.jsx("td", { className: col.mono ? tdMono : td, children: col.render ? col.render(row) : String(row[col.key] ?? "") }, col.key))
1111
+ },
1112
+ key
1113
+ );
1114
+ }) })
1115
+ ] })
1116
+ }
1117
+ ),
1110
1118
  pageSize && totalPages !== null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: pagination, children: [
1111
1119
  /* @__PURE__ */ jsxRuntime.jsx(
1112
1120
  Button,