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 +50 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +22 -19
- package/dist/index.css.map +1 -1
- package/dist/index.js +50 -42
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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 = "
|
|
1016
|
-
var pagination = "
|
|
1017
|
-
var sortIndicator = "
|
|
1018
|
-
var table = "
|
|
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 = "
|
|
1021
|
-
var tdMono = "
|
|
1022
|
-
var th = "
|
|
1023
|
-
var thSortable = "
|
|
1024
|
-
var thead = "
|
|
1025
|
-
var toolbar = "
|
|
1026
|
-
var tr = "
|
|
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.
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
{
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
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,
|