zaravand-ui 7.0.2 → 7.1.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/components/Input/Input.formatting.cjs +1 -1
- package/dist/components/Input/Input.formatting.js +35 -17
- package/dist/components/Input/Input.interface.d.cts +5 -1
- package/dist/components/Input/Input.interface.d.ts +5 -1
- package/dist/components/OtpInput/OtpInput.cjs +1 -0
- package/dist/components/OtpInput/OtpInput.d.cts +10 -0
- package/dist/components/OtpInput/OtpInput.d.ts +10 -0
- package/dist/components/OtpInput/OtpInput.interface.d.cts +49 -0
- package/dist/components/OtpInput/OtpInput.interface.d.ts +49 -0
- package/dist/components/OtpInput/OtpInput.js +150 -0
- package/dist/components/OtpInput/OtpInput.variant.cjs +1 -0
- package/dist/components/OtpInput/OtpInput.variant.d.cts +6 -0
- package/dist/components/OtpInput/OtpInput.variant.d.ts +6 -0
- package/dist/components/OtpInput/OtpInput.variant.js +15 -0
- package/dist/components/Table/Table.cjs +1 -1
- package/dist/components/Table/Table.interface.d.cts +1 -1
- package/dist/components/Table/Table.interface.d.ts +1 -1
- package/dist/components/Table/Table.js +294 -270
- package/dist/components/Table/TableActiveFilters.d.cts +1 -1
- package/dist/components/Table/TableActiveFilters.d.ts +1 -1
- package/dist/components/Table/TableColumnFilter.cjs +1 -1
- package/dist/components/Table/TableColumnFilter.d.cts +3 -0
- package/dist/components/Table/TableColumnFilter.d.ts +3 -0
- package/dist/components/Table/TableColumnFilter.js +58 -28
- package/dist/components/Table/TableFilterRegistry.cjs +1 -0
- package/dist/components/Table/TableFilterRegistry.d.cts +13 -0
- package/dist/components/Table/TableFilterRegistry.d.ts +13 -0
- package/dist/components/Table/TableFilterRegistry.js +5 -0
- package/dist/components/VerticalTabs/VerticalTabs.cjs +1 -0
- package/dist/components/VerticalTabs/VerticalTabs.d.cts +4 -0
- package/dist/components/VerticalTabs/VerticalTabs.d.ts +4 -0
- package/dist/components/VerticalTabs/VerticalTabs.interface.d.cts +41 -0
- package/dist/components/VerticalTabs/VerticalTabs.interface.d.ts +41 -0
- package/dist/components/VerticalTabs/VerticalTabs.js +196 -0
- package/dist/components/VerticalTabs/VerticalTabs.variant.cjs +1 -0
- package/dist/components/VerticalTabs/VerticalTabs.variant.d.cts +19 -0
- package/dist/components/VerticalTabs/VerticalTabs.variant.d.ts +19 -0
- package/dist/components/VerticalTabs/VerticalTabs.variant.js +48 -0
- package/dist/components/shared/responsiveScale.cjs +1 -1
- package/dist/components/shared/responsiveScale.d.cts +3 -1
- package/dist/components/shared/responsiveScale.d.ts +3 -1
- package/dist/components/shared/responsiveScale.js +2 -2
- package/dist/config/messages.cjs +1 -1
- package/dist/config/messages.d.cts +4 -0
- package/dist/config/messages.d.ts +4 -0
- package/dist/config/messages.js +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +19 -16
- package/package.json +1 -1
|
@@ -3,18 +3,18 @@ import { useZuiConfig as e } from "../../config/useZuiConfig.js";
|
|
|
3
3
|
import { localizeDigits as t } from "../../services/localizeDigits/localizeDigits.js";
|
|
4
4
|
import { cn as n, mergeRefs as r } from "../../lib/utils.js";
|
|
5
5
|
import { CONTROL_HEIGHT_SM as i } from "../shared/responsiveScale.js";
|
|
6
|
-
import a from "../
|
|
7
|
-
import o from "../shared/
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import ie from "
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import we from "./
|
|
6
|
+
import a from "../shared/ActionSheet.js";
|
|
7
|
+
import { CLEAR_ICON_CLASS as o } from "../shared/FieldClearButton.js";
|
|
8
|
+
import { IconActionButton as s, ListToolbar as c, ToolbarIconButton as l } from "../shared/IconActionButton.js";
|
|
9
|
+
import { useExclusiveAction as ee } from "../shared/useExclusiveAction.js";
|
|
10
|
+
import { useStickyToolbar as te } from "../shared/useStickyToolbar.js";
|
|
11
|
+
import { useIsMobileViewport as ne } from "../shared/viewport.js";
|
|
12
|
+
import re from "../Select/Select.js";
|
|
13
|
+
import { actionIconClassName as ie, actionsColumnClassName as ae, actionsColumnStickyClassName as oe, pagingToggleIconClassName as se, rowActionButtonClassName as ce, rowNumberColumnClassName as le, stickyHeaderCellClassName as ue } from "./Table.constants.js";
|
|
14
|
+
import { formatCellValue as de, isEmptyFilterValue as fe, replaceRowByIdentifier as pe, resolveAriaSort as me, resolveColumnWidthPercentages as he, resolveFilterOptions as ge, resolveFilterText as _e, resolveLoadingRowsCount as ve, resolvePlaceholder as ye, resolveSafeRowId as be } from "./Table.utils.js";
|
|
15
|
+
import { tableContainerVariants as xe, tableVariants as Se } from "./Table.variant.js";
|
|
16
|
+
import Ce from "./TableActiveFilters.js";
|
|
17
|
+
import { TableFilterRegistryContext as we } from "./TableFilterRegistry.js";
|
|
18
18
|
import Te, { TableColumnFilterSheet as Ee } from "./TableColumnFilter.js";
|
|
19
19
|
import De from "./TableEmptyState.js";
|
|
20
20
|
import Oe from "./TablePaginationControls.js";
|
|
@@ -30,17 +30,27 @@ import * as d from "react";
|
|
|
30
30
|
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
31
31
|
import { ArrowDown as Be, ArrowUp as Ve, ArrowUpDown as He, EllipsisVertical as Ue, Eye as We, FileSpreadsheet as Ge, Funnel as Ke, Infinity as qe, Pencil as Je, Plus as Ye, Printer as Xe, RotateCcw as Ze, Rows3 as Qe, Trash2 as $e } from "lucide-react";
|
|
32
32
|
//#region src/components/Table/Table.tsx
|
|
33
|
-
|
|
33
|
+
function et(e) {
|
|
34
|
+
let t = e.target.closest("button, a, input, textarea, select, label, [role=\"button\"], [role=\"combobox\"], [role=\"checkbox\"]");
|
|
35
|
+
return t !== null && e.currentTarget.contains(t);
|
|
36
|
+
}
|
|
37
|
+
var tt = d.forwardRef(function({ className: tt, containerClassName: nt, loading: h = !1, isMutating: g = !1, stickyHeaderOnScroll: rt = !0, maxVisibleRowsBeforeScroll: it, allowInfiniteMode: at = !0, stickyToolbar: ot = !0, schema: _, data: v, setData: st, onAdd: y, onImportExcel: b, onEdit: x, onDelete: ct, onPrint: lt, onPreviewPrint: ut, actions: dt, onCellSelectChange: ft, getRowId: S, showNumberRow: pt = !1, showColumnBorder: mt = !1, showRowBorder: ht = !1, toolbarExtra: gt, children: _t }, vt) {
|
|
34
38
|
let { messages: C, digits: w, dir: T } = e(), E = d.useMemo(() => ({
|
|
35
39
|
digits: w,
|
|
36
40
|
messages: C
|
|
37
|
-
}), [w, C]), D = d.Children.count(
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
}), [w, C]), D = d.Children.count(_t) > 0, [yt, bt] = d.useState({}), xt = d.useMemo(() => ({
|
|
42
|
+
register: (e) => bt((t) => ({
|
|
43
|
+
...t,
|
|
44
|
+
[e.column.key]: e
|
|
45
|
+
})),
|
|
46
|
+
unregister: (e) => bt((t) => Object.fromEntries(Object.entries(t).filter(([t]) => t !== e)))
|
|
47
|
+
}), []), St = Object.values(yt), O = ne(), Ct = d.useRef(null), wt = d.useMemo(() => r(vt, Ct), [vt]);
|
|
48
|
+
Ie(Ct, D);
|
|
49
|
+
let k = d.useMemo(() => _.columns.filter((e) => e.view), [_.columns]), Tt = d.useMemo(() => k.filter((e) => e.sortable), [k]), A = d.useMemo(() => k.filter((e) => e.filterable), [k]), Et = typeof y == "function", j = typeof b == "function", M = typeof x == "function", N = typeof ct == "function", P = typeof lt == "function", F = typeof ut == "function", I = dt ?? [], Dt = I.length > 0, L = _.searchable ?? !1, R = pt && !D, Ot = gt != null && gt !== !1, kt = _.pagination, At = kt?.onSearchChange, jt = typeof At == "function", Mt = M || N || Dt, z = Mt && !O, { rowNumberColumnStyle: Nt, columnStyleByKey: Pt, actionsColumnStyle: Ft } = d.useMemo(() => he(k, R, z), [
|
|
40
50
|
z,
|
|
41
51
|
R,
|
|
42
52
|
k
|
|
43
|
-
]),
|
|
53
|
+
]), It = d.useMemo(() => {
|
|
44
54
|
let e = _.columns.map((e) => {
|
|
45
55
|
if (e.type !== "select" && e.type !== "radio") return [e.key, []];
|
|
46
56
|
if (Array.isArray(e.options) && e.options.length > 0) return [e.key, e.options];
|
|
@@ -58,16 +68,16 @@ var et = d.forwardRef(function({ className: et, containerClassName: tt, loading:
|
|
|
58
68
|
}))];
|
|
59
69
|
});
|
|
60
70
|
return Object.fromEntries(e);
|
|
61
|
-
}, [v, _.columns]), [
|
|
71
|
+
}, [v, _.columns]), [Lt, B] = ee(), [Rt, zt] = d.useState(!1), [Bt, Vt] = d.useState(!1), [Ht, Ut] = d.useState(!1), [Wt, Gt] = d.useState(null), [Kt, qt] = d.useState(!1), [Jt, Yt] = d.useState({
|
|
62
72
|
open: !1,
|
|
63
73
|
actions: []
|
|
64
|
-
}), V = g ||
|
|
74
|
+
}), V = g || Lt, Xt = d.useCallback(async () => {
|
|
65
75
|
g || !y || await B(y);
|
|
66
76
|
}, [
|
|
67
77
|
g,
|
|
68
78
|
y,
|
|
69
79
|
B
|
|
70
|
-
]),
|
|
80
|
+
]), Zt = d.useCallback(async () => {
|
|
71
81
|
g || !b || await B(b);
|
|
72
82
|
}, [
|
|
73
83
|
g,
|
|
@@ -77,29 +87,29 @@ var et = d.forwardRef(function({ className: et, containerClassName: tt, loading:
|
|
|
77
87
|
g || await B(() => e({
|
|
78
88
|
row: t,
|
|
79
89
|
rowIndex: n,
|
|
80
|
-
rowId: r ??
|
|
90
|
+
rowId: r ?? be(t, n, S)
|
|
81
91
|
}));
|
|
82
92
|
}, [
|
|
83
93
|
S,
|
|
84
94
|
g,
|
|
85
95
|
B
|
|
86
|
-
]),
|
|
96
|
+
]), Qt = d.useCallback(async (e, t, n) => {
|
|
87
97
|
x && await H(x, e, t, n);
|
|
88
|
-
}, [x, H]),
|
|
89
|
-
|
|
90
|
-
}, [
|
|
98
|
+
}, [x, H]), $t = d.useCallback(async (e, t, n) => {
|
|
99
|
+
ct && await H(ct, e, t, n);
|
|
100
|
+
}, [ct, H]), en = d.useCallback(async (e, t, n, r) => {
|
|
91
101
|
await H(e.onClick, t, n, r);
|
|
92
|
-
}, [H]),
|
|
102
|
+
}, [H]), tn = d.useCallback(async (e, t, n, r, i) => {
|
|
93
103
|
if (g) return;
|
|
94
104
|
let a = i.trim(), o = a.length > 0 ? a : null;
|
|
95
105
|
if (e[r] === o) return;
|
|
96
|
-
let s = n ??
|
|
106
|
+
let s = n ?? be(e, t, S), c = {
|
|
97
107
|
...e,
|
|
98
108
|
[r]: o
|
|
99
109
|
};
|
|
100
110
|
await B(async () => {
|
|
101
111
|
try {
|
|
102
|
-
if (
|
|
112
|
+
if (ft && await ft({
|
|
103
113
|
row: c,
|
|
104
114
|
previousRow: e,
|
|
105
115
|
rowIndex: t,
|
|
@@ -107,7 +117,7 @@ var et = d.forwardRef(function({ className: et, containerClassName: tt, loading:
|
|
|
107
117
|
columnKey: r,
|
|
108
118
|
value: a
|
|
109
119
|
}) === !1) return;
|
|
110
|
-
|
|
120
|
+
st((e) => pe(e, t, s, S, c));
|
|
111
121
|
} catch {
|
|
112
122
|
return;
|
|
113
123
|
}
|
|
@@ -115,281 +125,293 @@ var et = d.forwardRef(function({ className: et, containerClassName: tt, loading:
|
|
|
115
125
|
}, [
|
|
116
126
|
S,
|
|
117
127
|
g,
|
|
118
|
-
|
|
128
|
+
ft,
|
|
119
129
|
B,
|
|
120
|
-
|
|
121
|
-
]),
|
|
130
|
+
st
|
|
131
|
+
]), nn = d.useCallback((e, t, r) => {
|
|
122
132
|
let i = (e) => /* @__PURE__ */ p("span", {
|
|
123
|
-
className: n("zui:inline-flex",
|
|
133
|
+
className: n("zui:inline-flex", o, "zui:[&>svg]:size-full"),
|
|
124
134
|
children: e
|
|
125
135
|
}), a = [];
|
|
126
136
|
M && a.push({
|
|
127
137
|
key: "edit",
|
|
128
138
|
label: C.common.edit,
|
|
129
139
|
icon: i(/* @__PURE__ */ p(Je, { "aria-hidden": "true" })),
|
|
130
|
-
onSelect: () => void
|
|
140
|
+
onSelect: () => void Qt(e, t, r)
|
|
131
141
|
}), I.forEach((n, o) => {
|
|
132
142
|
a.push({
|
|
133
143
|
key: `custom-${o}`,
|
|
134
144
|
label: n.tooltip,
|
|
135
145
|
icon: i(n.icon),
|
|
136
|
-
onSelect: () => void
|
|
146
|
+
onSelect: () => void en(n, e, t, r)
|
|
137
147
|
});
|
|
138
148
|
}), N && a.push({
|
|
139
149
|
key: "delete",
|
|
140
150
|
label: C.common.delete,
|
|
141
151
|
icon: i(/* @__PURE__ */ p($e, { "aria-hidden": "true" })),
|
|
142
152
|
danger: !0,
|
|
143
|
-
onSelect: () => void
|
|
144
|
-
}),
|
|
153
|
+
onSelect: () => void $t(e, t, r)
|
|
154
|
+
}), Yt({
|
|
145
155
|
open: !0,
|
|
146
156
|
actions: a
|
|
147
157
|
});
|
|
148
158
|
}, [
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
159
|
+
en,
|
|
160
|
+
$t,
|
|
161
|
+
Qt,
|
|
152
162
|
C.common.delete,
|
|
153
163
|
C.common.edit,
|
|
154
164
|
I,
|
|
155
165
|
N,
|
|
156
166
|
M
|
|
157
|
-
]), { searchTerm:
|
|
167
|
+
]), { searchTerm: rn, normalizedSearchTerm: an, filteredRows: on, handleSearchInputChange: sn } = Re({
|
|
158
168
|
data: v,
|
|
159
169
|
visibleColumns: k,
|
|
160
170
|
showSearchInput: L,
|
|
161
|
-
hasRemoteSearchHandler:
|
|
162
|
-
onSearchChange:
|
|
171
|
+
hasRemoteSearchHandler: jt,
|
|
172
|
+
onSearchChange: At,
|
|
163
173
|
getRowId: S,
|
|
164
174
|
cellFormatOptions: E
|
|
165
|
-
}), { filteredRows:
|
|
166
|
-
rows:
|
|
175
|
+
}), { filteredRows: cn, filterValues: U, activeFilterCount: ln, filterKey: un, handleFilterChange: dn, handleFilterClear: fn } = Le({
|
|
176
|
+
rows: on,
|
|
167
177
|
columns: _.columns,
|
|
168
178
|
filterConfig: _.filter
|
|
169
|
-
}), W = d.useMemo(() => Object.fromEntries(A.map((e) => [e.key,
|
|
179
|
+
}), W = d.useMemo(() => Object.fromEntries(A.map((e) => [e.key, ge(e, v, E)])), [
|
|
170
180
|
E,
|
|
171
181
|
v,
|
|
172
182
|
A
|
|
173
|
-
]), { sortedRows: G, activeSort: K, handleSortToggle:
|
|
174
|
-
rows:
|
|
183
|
+
]), { sortedRows: G, activeSort: K, handleSortToggle: pn, handleSortClear: mn } = ze({
|
|
184
|
+
rows: cn,
|
|
175
185
|
columns: _.columns,
|
|
176
186
|
sortConfig: _.sort
|
|
177
|
-
}),
|
|
178
|
-
|
|
187
|
+
}), hn = d.useCallback(async () => {
|
|
188
|
+
lt && await lt({
|
|
179
189
|
rows: G.map(({ row: e }) => e),
|
|
180
190
|
columns: k
|
|
181
191
|
});
|
|
182
192
|
}, [
|
|
183
|
-
|
|
193
|
+
lt,
|
|
184
194
|
G,
|
|
185
195
|
k
|
|
186
|
-
]),
|
|
187
|
-
|
|
196
|
+
]), gn = d.useCallback(async () => {
|
|
197
|
+
ut && await ut({
|
|
188
198
|
rows: G.map(({ row: e }) => e),
|
|
189
199
|
columns: k
|
|
190
200
|
});
|
|
191
201
|
}, [
|
|
192
|
-
|
|
202
|
+
ut,
|
|
193
203
|
G,
|
|
194
204
|
k
|
|
195
|
-
]), { pagingMode: q, currentPage:
|
|
205
|
+
]), { pagingMode: q, currentPage: _n, totalPages: vn, resolvedPageSize: yn, visibleRows: J, showPagingModeToggle: bn, shouldRenderPagination: xn, shouldRenderInfiniteMode: Sn, canLoadMoreInInfiniteMode: Cn, shouldUseRemotePaging: wn, shouldUseScrollableRows: Tn, tableScrollViewportRef: En, tableScrollViewportStyle: Dn, handlePageChange: On, handlePagingModeToggle: kn, handleTableScrollViewport: An, isInfiniteRequestPending: jn } = Fe({
|
|
196
206
|
hasChildren: D,
|
|
197
207
|
filteredRows: G,
|
|
198
|
-
paginationConfig:
|
|
208
|
+
paginationConfig: kt,
|
|
199
209
|
loading: h,
|
|
200
210
|
isRowActionBusy: V,
|
|
201
|
-
searchKey: `${
|
|
211
|
+
searchKey: `${an}|${un}`,
|
|
202
212
|
sortKey: K ? `${K.sortKey}:${K.direction}` : "",
|
|
203
|
-
maxVisibleRowsBeforeScroll:
|
|
204
|
-
allowInfiniteMode:
|
|
205
|
-
}),
|
|
206
|
-
|
|
207
|
-
let
|
|
213
|
+
maxVisibleRowsBeforeScroll: it,
|
|
214
|
+
allowInfiniteMode: at
|
|
215
|
+
}), Mn = Tn && rt, Nn = d.useMemo(() => ve(_.pagination?.pageSize, v.length), [v.length, _.pagination?.pageSize]), Pn = h && (J.length === 0 || wn && q === "pagination"), Fn = Sn && h && J.length > 0, In = Sn && J.length > 0, Ln = In && (h || jn), Rn = In && Cn && !h && !jn, zn = In && !Cn && !h && !jn, Bn = Math.min(Nn, Math.max(1, Math.min(yn, 3))), Y = h || V, Vn = O ? 0 : +!!M + I.length + +!!N, Hn = q === "pagination" ? C.table.switchToInfinite : C.table.switchToPagination, Un = Et || j || bn || P || F, X = O && !D && Tt.length > 0, Z = O && !D && A.length > 0, Q = !D && (L || Un || X || Z), Wn = d.useRef(null), Gn = d.useRef(null);
|
|
216
|
+
te(Wn, Gn, O && ot && Q);
|
|
217
|
+
let Kn = d.useMemo(() => {
|
|
208
218
|
let e = (e) => /* @__PURE__ */ p(e, {
|
|
209
|
-
className:
|
|
219
|
+
className: o,
|
|
210
220
|
"aria-hidden": "true"
|
|
211
|
-
}), n =
|
|
221
|
+
}), n = Tt.map((n) => {
|
|
212
222
|
let r = K?.sortKey === n.key ? K.direction : void 0, i = t(n.label, w);
|
|
213
223
|
return {
|
|
214
224
|
key: n.key,
|
|
215
225
|
label: r === void 0 ? i : `${i} (${r === "asc" ? C.table.sortAscending : C.table.sortDescending})`,
|
|
216
226
|
icon: e(r === "asc" ? Ve : r === "desc" ? Be : He),
|
|
217
227
|
active: r !== void 0,
|
|
218
|
-
onSelect: () =>
|
|
228
|
+
onSelect: () => pn(n.key)
|
|
219
229
|
};
|
|
220
230
|
});
|
|
221
231
|
return K && n.push({
|
|
222
232
|
key: "clear-sort",
|
|
223
233
|
label: C.table.sortDefault,
|
|
224
234
|
icon: e(Ze),
|
|
225
|
-
onSelect:
|
|
235
|
+
onSelect: mn
|
|
226
236
|
}), n;
|
|
227
237
|
}, [
|
|
228
238
|
K,
|
|
229
239
|
w,
|
|
230
|
-
|
|
231
|
-
|
|
240
|
+
mn,
|
|
241
|
+
pn,
|
|
232
242
|
C.table.sortAscending,
|
|
233
243
|
C.table.sortDefault,
|
|
234
244
|
C.table.sortDescending,
|
|
235
|
-
|
|
236
|
-
]),
|
|
237
|
-
|
|
238
|
-
}, []),
|
|
239
|
-
let n = U[e.key], r = n !== void 0 && !
|
|
245
|
+
Tt
|
|
246
|
+
]), qn = d.useCallback((e) => {
|
|
247
|
+
Gt(e), qt(!0);
|
|
248
|
+
}, []), Jn = d.useMemo(() => A.map((e) => {
|
|
249
|
+
let n = U[e.key], r = n !== void 0 && !fe(n), i = t(e.label, w), a = r ? t(_e(n, W[e.key] ?? []), w) : "";
|
|
240
250
|
return {
|
|
241
251
|
key: e.key,
|
|
242
252
|
label: r ? `${i}: ${a}` : i,
|
|
243
253
|
icon: /* @__PURE__ */ p(Ke, {
|
|
244
|
-
className:
|
|
254
|
+
className: o,
|
|
245
255
|
fill: r ? "currentColor" : "none",
|
|
246
256
|
"aria-hidden": "true"
|
|
247
257
|
}),
|
|
248
258
|
active: r,
|
|
249
|
-
onSelect: () =>
|
|
259
|
+
onSelect: () => qn(e.key)
|
|
250
260
|
};
|
|
251
261
|
}), [
|
|
252
262
|
w,
|
|
253
263
|
W,
|
|
254
264
|
U,
|
|
255
265
|
A,
|
|
256
|
-
|
|
257
|
-
]), $ = A.find((e) => e.key ===
|
|
266
|
+
qn
|
|
267
|
+
]), $ = A.find((e) => e.key === Wt), Yn = d.useMemo(() => {
|
|
258
268
|
let e = (e) => /* @__PURE__ */ p(e, {
|
|
259
|
-
className:
|
|
269
|
+
className: o,
|
|
260
270
|
"aria-hidden": "true"
|
|
261
271
|
});
|
|
262
272
|
return [
|
|
263
|
-
|
|
273
|
+
Et ? {
|
|
264
274
|
key: "add",
|
|
265
275
|
label: C.common.add,
|
|
266
276
|
icon: e(Ye),
|
|
267
|
-
onSelect: () => void
|
|
277
|
+
onSelect: () => void Xt()
|
|
268
278
|
} : null,
|
|
269
279
|
j ? {
|
|
270
280
|
key: "import",
|
|
271
281
|
label: C.table.importExcel,
|
|
272
282
|
icon: e(Ge),
|
|
273
|
-
onSelect: () => void
|
|
283
|
+
onSelect: () => void Zt()
|
|
274
284
|
} : null,
|
|
275
285
|
P ? {
|
|
276
286
|
key: "print",
|
|
277
287
|
label: C.table.print,
|
|
278
288
|
icon: e(Xe),
|
|
279
|
-
onSelect: () => void
|
|
289
|
+
onSelect: () => void hn()
|
|
280
290
|
} : null,
|
|
281
291
|
F ? {
|
|
282
292
|
key: "preview-print",
|
|
283
293
|
label: C.table.printPreview,
|
|
284
294
|
icon: e(We),
|
|
285
|
-
onSelect: () => void
|
|
295
|
+
onSelect: () => void gn()
|
|
286
296
|
} : null,
|
|
287
|
-
|
|
297
|
+
bn ? {
|
|
288
298
|
key: "paging-mode",
|
|
289
|
-
label:
|
|
299
|
+
label: Hn,
|
|
290
300
|
icon: e(q === "pagination" ? qe : Qe),
|
|
291
|
-
onSelect:
|
|
301
|
+
onSelect: kn
|
|
292
302
|
} : null
|
|
293
303
|
].filter((e) => e !== null);
|
|
294
304
|
}, [
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
305
|
+
Xt,
|
|
306
|
+
Zt,
|
|
307
|
+
kn,
|
|
308
|
+
gn,
|
|
309
|
+
hn,
|
|
300
310
|
C.common.add,
|
|
301
311
|
C.table.importExcel,
|
|
302
312
|
C.table.print,
|
|
303
313
|
C.table.printPreview,
|
|
304
314
|
q,
|
|
305
|
-
|
|
306
|
-
|
|
315
|
+
Hn,
|
|
316
|
+
Et,
|
|
307
317
|
j,
|
|
308
|
-
|
|
318
|
+
bn,
|
|
309
319
|
F,
|
|
310
320
|
P
|
|
311
|
-
]),
|
|
321
|
+
]), Xn = O && (Yn.length > 0 || X || Z), Zn = O && Yn.length > 1, Qn = Ot && Q && L, $n = Ot && Q && !L, er = Ot && !Q, tr = /* @__PURE__ */ p("div", {
|
|
312
322
|
"data-slot": "table-toolbar-extra",
|
|
313
323
|
className: n("zui:flex zui:w-full zui:items-center", i),
|
|
314
|
-
children:
|
|
324
|
+
children: gt
|
|
315
325
|
});
|
|
316
326
|
return /* @__PURE__ */ m("div", {
|
|
317
327
|
"data-slot": "table-container",
|
|
318
328
|
dir: T,
|
|
319
|
-
className: n(
|
|
329
|
+
className: n(xe(), nt),
|
|
320
330
|
children: [
|
|
321
|
-
|
|
331
|
+
D ? /* @__PURE__ */ p(Ce, {
|
|
332
|
+
columns: St.map((e) => e.column),
|
|
333
|
+
values: Object.fromEntries(St.flatMap((e) => e.value ? [[e.column.key, e.value]] : [])),
|
|
334
|
+
optionsByColumn: Object.fromEntries(St.map((e) => [e.column.key, e.options])),
|
|
335
|
+
onRemove: (e) => yt[e]?.onChange(void 0)
|
|
336
|
+
}) : /* @__PURE__ */ p(Ce, {
|
|
337
|
+
columns: k,
|
|
338
|
+
values: U,
|
|
339
|
+
optionsByColumn: W,
|
|
340
|
+
onRemove: (e) => dn(e, void 0),
|
|
341
|
+
onSelect: O ? qn : void 0
|
|
342
|
+
}),
|
|
343
|
+
er ? /* @__PURE__ */ p("div", {
|
|
322
344
|
"data-slot": "table-toolbar-extra-row",
|
|
323
345
|
className: "zui:mb-3",
|
|
324
|
-
children:
|
|
346
|
+
children: tr
|
|
325
347
|
}) : null,
|
|
326
348
|
Q ? /* @__PURE__ */ m(f, { children: [
|
|
327
349
|
/* @__PURE__ */ p("div", {
|
|
328
|
-
ref:
|
|
350
|
+
ref: Gn,
|
|
329
351
|
"aria-hidden": "true",
|
|
330
352
|
"data-slot": "table-sticky-sentinel"
|
|
331
353
|
}),
|
|
332
354
|
/* @__PURE__ */ m("div", {
|
|
333
|
-
ref:
|
|
355
|
+
ref: Wn,
|
|
334
356
|
"data-slot": "table-sticky-toolbar",
|
|
335
|
-
"data-sticky-toolbar": O &&
|
|
357
|
+
"data-sticky-toolbar": O && ot ? "true" : void 0,
|
|
336
358
|
className: "zui:mb-3",
|
|
337
|
-
children: [
|
|
359
|
+
children: [Qn ? /* @__PURE__ */ p("div", {
|
|
338
360
|
"data-slot": "table-toolbar-extra-row",
|
|
339
361
|
className: "zui:mb-2",
|
|
340
|
-
children:
|
|
341
|
-
}) : null, /* @__PURE__ */ p(
|
|
362
|
+
children: tr
|
|
363
|
+
}) : null, /* @__PURE__ */ p(c, {
|
|
342
364
|
"data-slot": "table-controls",
|
|
343
365
|
searchSlot: "table-search-input",
|
|
344
366
|
actionsSlot: "table-add-action",
|
|
345
|
-
inlineActionsOnMobile:
|
|
367
|
+
inlineActionsOnMobile: Xn,
|
|
346
368
|
search: L ? {
|
|
347
|
-
value:
|
|
348
|
-
onChange:
|
|
369
|
+
value: rn,
|
|
370
|
+
onChange: sn,
|
|
349
371
|
placeholder: C.common.searchPlaceholder,
|
|
350
372
|
ariaLabel: C.table.searchAriaLabel,
|
|
351
373
|
disabled: V
|
|
352
374
|
} : void 0,
|
|
353
|
-
leading:
|
|
354
|
-
actions: X || Z ||
|
|
375
|
+
leading: $n ? tr : void 0,
|
|
376
|
+
actions: X || Z || Zn || Un ? /* @__PURE__ */ m(f, { children: [
|
|
355
377
|
X ? /* @__PURE__ */ p(l, {
|
|
356
378
|
"data-slot": "table-sort-button",
|
|
357
379
|
label: C.table.sortBy,
|
|
358
380
|
disabled: Y,
|
|
359
|
-
onClick: () =>
|
|
381
|
+
onClick: () => Vt(!0),
|
|
360
382
|
icon: /* @__PURE__ */ p(He, { "aria-hidden": "true" })
|
|
361
383
|
}) : null,
|
|
362
384
|
Z ? /* @__PURE__ */ p(l, {
|
|
363
385
|
"data-slot": "table-filter-button",
|
|
364
386
|
label: C.table.filterBy,
|
|
365
387
|
disabled: Y,
|
|
366
|
-
onClick: () =>
|
|
388
|
+
onClick: () => Ut(!0),
|
|
367
389
|
icon: /* @__PURE__ */ m("span", {
|
|
368
390
|
className: "zui:relative zui:inline-flex",
|
|
369
391
|
children: [/* @__PURE__ */ p(Ke, {
|
|
370
|
-
fill:
|
|
392
|
+
fill: ln > 0 ? "currentColor" : "none",
|
|
371
393
|
"aria-hidden": "true"
|
|
372
|
-
}),
|
|
394
|
+
}), ln > 0 ? /* @__PURE__ */ p("span", {
|
|
373
395
|
"aria-hidden": "true",
|
|
374
396
|
"data-slot": "table-filter-active-dot",
|
|
375
397
|
className: "zui:absolute zui:-end-1 zui:-top-1 zui:size-2 zui:rounded-full zui:bg-[var(--zui-theme-action-primary)] zui:ring-2 zui:ring-[var(--zui-color-surface)]"
|
|
376
398
|
}) : null]
|
|
377
399
|
})
|
|
378
400
|
}) : null,
|
|
379
|
-
|
|
401
|
+
Zn ? /* @__PURE__ */ p(l, {
|
|
380
402
|
"data-slot": "table-toolbar-menu-button",
|
|
381
403
|
label: C.table.actions,
|
|
382
404
|
disabled: Y,
|
|
383
|
-
onClick: () =>
|
|
405
|
+
onClick: () => zt(!0),
|
|
384
406
|
icon: /* @__PURE__ */ p(Ue, { "aria-hidden": "true" })
|
|
385
|
-
}) :
|
|
386
|
-
|
|
407
|
+
}) : Un ? /* @__PURE__ */ m(f, { children: [
|
|
408
|
+
bn ? /* @__PURE__ */ p(l, {
|
|
387
409
|
"data-slot": "table-paging-mode-toggle-button",
|
|
388
|
-
label:
|
|
410
|
+
label: Hn,
|
|
389
411
|
disabled: Y,
|
|
390
|
-
onClick:
|
|
412
|
+
onClick: kn,
|
|
391
413
|
icon: p(q === "pagination" ? qe : Qe, {
|
|
392
|
-
className:
|
|
414
|
+
className: se,
|
|
393
415
|
"aria-hidden": "true"
|
|
394
416
|
})
|
|
395
417
|
}) : null,
|
|
@@ -397,114 +419,110 @@ var et = d.forwardRef(function({ className: et, containerClassName: tt, loading:
|
|
|
397
419
|
"data-slot": "table-action-preview-print-button",
|
|
398
420
|
label: C.table.printPreview,
|
|
399
421
|
disabled: Y,
|
|
400
|
-
onClick: () => void
|
|
422
|
+
onClick: () => void gn(),
|
|
401
423
|
icon: /* @__PURE__ */ p(We, {})
|
|
402
424
|
}) : null,
|
|
403
425
|
P ? /* @__PURE__ */ p(l, {
|
|
404
426
|
"data-slot": "table-action-print-button",
|
|
405
427
|
label: C.table.print,
|
|
406
428
|
disabled: Y,
|
|
407
|
-
onClick: () => void
|
|
429
|
+
onClick: () => void hn(),
|
|
408
430
|
icon: /* @__PURE__ */ p(Xe, {})
|
|
409
431
|
}) : null,
|
|
410
432
|
j ? /* @__PURE__ */ p(l, {
|
|
411
433
|
"data-slot": "table-action-import-excel-button",
|
|
412
434
|
label: C.table.importExcel,
|
|
413
435
|
disabled: Y,
|
|
414
|
-
onClick: () => void
|
|
436
|
+
onClick: () => void Zt(),
|
|
415
437
|
icon: /* @__PURE__ */ p(Ge, {})
|
|
416
438
|
}) : null,
|
|
417
|
-
|
|
439
|
+
Et ? /* @__PURE__ */ p(l, {
|
|
418
440
|
"data-slot": "table-action-add-button",
|
|
419
441
|
label: C.common.add,
|
|
420
442
|
disabled: Y,
|
|
421
|
-
onClick: () => void
|
|
443
|
+
onClick: () => void Xt(),
|
|
422
444
|
icon: /* @__PURE__ */ p(Ye, {})
|
|
423
445
|
}) : null
|
|
424
446
|
] }) : null
|
|
425
447
|
] }) : void 0
|
|
426
448
|
})]
|
|
427
449
|
}),
|
|
428
|
-
X ? /* @__PURE__ */ p(
|
|
429
|
-
open:
|
|
430
|
-
onOpenChange:
|
|
431
|
-
actions:
|
|
450
|
+
X ? /* @__PURE__ */ p(a, {
|
|
451
|
+
open: Bt,
|
|
452
|
+
onOpenChange: Vt,
|
|
453
|
+
actions: Kn,
|
|
432
454
|
label: C.table.sortBy
|
|
433
455
|
}) : null,
|
|
434
|
-
Z ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(
|
|
435
|
-
open:
|
|
436
|
-
onOpenChange:
|
|
437
|
-
actions:
|
|
456
|
+
Z ? /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(a, {
|
|
457
|
+
open: Ht,
|
|
458
|
+
onOpenChange: Ut,
|
|
459
|
+
actions: Jn,
|
|
438
460
|
label: C.table.filterBy
|
|
439
461
|
}), $ ? /* @__PURE__ */ p(Ee, {
|
|
440
462
|
column: $,
|
|
441
463
|
value: U[$.key],
|
|
442
|
-
onChange: (e) =>
|
|
464
|
+
onChange: (e) => dn($.key, e),
|
|
443
465
|
options: W[$.key] ?? [],
|
|
444
|
-
open:
|
|
445
|
-
onOpenChange:
|
|
466
|
+
open: Kt,
|
|
467
|
+
onOpenChange: qt
|
|
446
468
|
}, $.key) : null] }) : null,
|
|
447
|
-
|
|
448
|
-
open:
|
|
449
|
-
onOpenChange:
|
|
450
|
-
actions:
|
|
469
|
+
Zn ? /* @__PURE__ */ p(a, {
|
|
470
|
+
open: Rt,
|
|
471
|
+
onOpenChange: zt,
|
|
472
|
+
actions: Yn.map((e) => ({
|
|
451
473
|
...e,
|
|
452
474
|
disabled: Y
|
|
453
475
|
})),
|
|
454
476
|
label: C.table.actions
|
|
455
477
|
}) : null
|
|
456
478
|
] }) : null,
|
|
457
|
-
D ? null : /* @__PURE__ */ p(we, {
|
|
458
|
-
columns: k,
|
|
459
|
-
values: U,
|
|
460
|
-
optionsByColumn: W,
|
|
461
|
-
onRemove: (e) => an(e, void 0),
|
|
462
|
-
onSelect: O ? Vn : void 0
|
|
463
|
-
}),
|
|
464
479
|
/* @__PURE__ */ p("div", {
|
|
465
|
-
ref:
|
|
480
|
+
ref: En,
|
|
466
481
|
"data-slot": "table-scroll-viewport",
|
|
467
|
-
className: n("zui:relative zui:w-full zui:min-w-0 zui:overflow-x-auto zui-radius-xs zui:bg-[var(--zui-color-surface)] zui:shadow-[0_4px_14px_-12px_var(--zui-effect-shadow-ink-35)]",
|
|
468
|
-
style:
|
|
469
|
-
onScroll:
|
|
482
|
+
className: n("zui:relative zui:w-full zui:min-w-0 zui:overflow-x-auto zui-radius-xs zui:bg-[var(--zui-color-surface)] zui:shadow-[0_4px_14px_-12px_var(--zui-effect-shadow-ink-35)]", Tn ? "zui:overflow-y-auto" : void 0),
|
|
483
|
+
style: Dn,
|
|
484
|
+
onScroll: An,
|
|
470
485
|
children: /* @__PURE__ */ p("table", {
|
|
471
|
-
ref:
|
|
486
|
+
ref: wt,
|
|
472
487
|
"data-slot": "table",
|
|
473
|
-
className: n(
|
|
474
|
-
showColumnBorder:
|
|
475
|
-
showRowBorder:
|
|
476
|
-
}),
|
|
488
|
+
className: n(Se({
|
|
489
|
+
showColumnBorder: mt,
|
|
490
|
+
showRowBorder: ht
|
|
491
|
+
}), tt),
|
|
477
492
|
dir: T,
|
|
478
|
-
children: D ?
|
|
493
|
+
children: D ? /* @__PURE__ */ p(we.Provider, {
|
|
494
|
+
value: xt,
|
|
495
|
+
children: _t
|
|
496
|
+
}) : k.length === 0 ? /* @__PURE__ */ p(ke, { children: /* @__PURE__ */ p(Me, { children: /* @__PURE__ */ p(u, {
|
|
479
497
|
className: "zui:py-7 zui:text-center zui:text-[var(--zui-color-text)]",
|
|
480
498
|
children: C.table.noColumns
|
|
481
499
|
}) }) }) : /* @__PURE__ */ m(f, { children: [
|
|
482
500
|
/* @__PURE__ */ m("colgroup", { children: [
|
|
483
|
-
R ? /* @__PURE__ */ p("col", { style:
|
|
484
|
-
k.map((e) => /* @__PURE__ */ p("col", { style:
|
|
485
|
-
z ? /* @__PURE__ */ p("col", { style:
|
|
501
|
+
R ? /* @__PURE__ */ p("col", { style: Nt }) : null,
|
|
502
|
+
k.map((e) => /* @__PURE__ */ p("col", { style: Pt[e.key] }, `col-${e.key}`)),
|
|
503
|
+
z ? /* @__PURE__ */ p("col", { style: Ft }) : null
|
|
486
504
|
] }),
|
|
487
505
|
/* @__PURE__ */ p(je, { children: /* @__PURE__ */ m(Me, { children: [
|
|
488
506
|
R ? /* @__PURE__ */ p(Ae, {
|
|
489
507
|
align: "center",
|
|
490
|
-
className: n(
|
|
508
|
+
className: n(le, Mn ? ue : void 0),
|
|
491
509
|
children: C.table.rowNumber
|
|
492
510
|
}) : null,
|
|
493
511
|
k.map((e) => {
|
|
494
512
|
let n = e.sortable && K?.sortKey === e.key ? K.direction : void 0, r = e.sortable ? /* @__PURE__ */ p(Pe, {
|
|
495
513
|
columnLabel: e.label,
|
|
496
514
|
direction: n,
|
|
497
|
-
onToggle: () =>
|
|
515
|
+
onToggle: () => pn(e.key)
|
|
498
516
|
}) : null, i = e.filterable ? /* @__PURE__ */ p(Te, {
|
|
499
517
|
column: e,
|
|
500
518
|
value: U[e.key],
|
|
501
|
-
onChange: (t) =>
|
|
519
|
+
onChange: (t) => dn(e.key, t),
|
|
502
520
|
options: W[e.key] ?? []
|
|
503
521
|
}) : null;
|
|
504
522
|
return /* @__PURE__ */ p(Ae, {
|
|
505
523
|
align: e.align,
|
|
506
|
-
className:
|
|
507
|
-
"aria-sort": e.sortable ?
|
|
524
|
+
className: Mn ? ue : void 0,
|
|
525
|
+
"aria-sort": e.sortable ? me(n) : void 0,
|
|
508
526
|
children: e.sortable || e.filterable ? /* @__PURE__ */ m("span", {
|
|
509
527
|
className: "zui:inline-flex zui:items-center zui:gap-2",
|
|
510
528
|
children: [t(e.label, w), /* @__PURE__ */ m("span", {
|
|
@@ -516,140 +534,146 @@ var et = d.forwardRef(function({ className: et, containerClassName: tt, loading:
|
|
|
516
534
|
}),
|
|
517
535
|
z ? /* @__PURE__ */ p(Ae, {
|
|
518
536
|
align: "center",
|
|
519
|
-
className: n(
|
|
537
|
+
className: n(ae, oe, Mn ? ue : void 0),
|
|
520
538
|
children: C.table.actions
|
|
521
539
|
}) : null
|
|
522
540
|
] }) }),
|
|
523
|
-
/* @__PURE__ */ p(ke, { children:
|
|
524
|
-
count:
|
|
541
|
+
/* @__PURE__ */ p(ke, { children: Pn ? /* @__PURE__ */ p(Ne, {
|
|
542
|
+
count: Nn,
|
|
525
543
|
keyPrefix: "loading",
|
|
526
544
|
showRowNumbers: R,
|
|
527
545
|
columns: k,
|
|
528
|
-
actionsCount:
|
|
546
|
+
actionsCount: Vn
|
|
529
547
|
}) : J.length === 0 ? /* @__PURE__ */ p(De, {
|
|
530
548
|
colSpan: k.length + +!!z + +!!R,
|
|
531
549
|
showSearchInput: L,
|
|
532
|
-
normalizedSearchTerm:
|
|
533
|
-
hasActiveFilters:
|
|
534
|
-
onClearFilters:
|
|
535
|
-
}) : /* @__PURE__ */ m(f, { children: [J.map(({ row: e, rowIndex: r, rowId: i },
|
|
536
|
-
let
|
|
537
|
-
return /* @__PURE__ */ m(Me, {
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
"data-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
550
|
+
normalizedSearchTerm: an,
|
|
551
|
+
hasActiveFilters: ln > 0,
|
|
552
|
+
onClearFilters: fn
|
|
553
|
+
}) : /* @__PURE__ */ m(f, { children: [J.map(({ row: e, rowIndex: r, rowId: i }, a) => {
|
|
554
|
+
let o = i === void 0 ? `row-${r}` : `row-id-${String(i)}`, c = xn ? (_n - 1) * yn + a + 1 : a + 1;
|
|
555
|
+
return /* @__PURE__ */ m(Me, {
|
|
556
|
+
...O && Mt ? {
|
|
557
|
+
tabIndex: 0,
|
|
558
|
+
"aria-haspopup": "dialog",
|
|
559
|
+
"data-actionable": "true",
|
|
560
|
+
onClick: (t) => {
|
|
561
|
+
et(t) || nn(e, r, i);
|
|
562
|
+
},
|
|
563
|
+
onKeyDown: (t) => {
|
|
564
|
+
t.target === t.currentTarget && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), nn(e, r, i));
|
|
565
|
+
}
|
|
566
|
+
} : {},
|
|
567
|
+
children: [
|
|
568
|
+
R ? /* @__PURE__ */ p(u, {
|
|
569
|
+
align: "center",
|
|
570
|
+
className: le,
|
|
571
|
+
"data-label": C.table.rowNumber,
|
|
572
|
+
children: t(String(c), w)
|
|
573
|
+
}) : null,
|
|
574
|
+
k.map((n) => {
|
|
575
|
+
let a = `cell-${n.key}-${o}`;
|
|
576
|
+
if (n.viewType === "select") {
|
|
577
|
+
let o = It[n.key] ?? [], s = e[n.key], c = typeof s == "string" || typeof s == "number" ? String(s) : "";
|
|
578
|
+
return /* @__PURE__ */ p(u, {
|
|
579
|
+
align: n.align,
|
|
580
|
+
"data-label": t(n.label, w),
|
|
581
|
+
children: /* @__PURE__ */ p(re, {
|
|
582
|
+
disabled: V || o.length === 0 && !n.optionsSource,
|
|
583
|
+
placeholder: ye(n),
|
|
584
|
+
options: o,
|
|
585
|
+
remoteOptions: n.optionsSource,
|
|
586
|
+
value: c,
|
|
587
|
+
onValueChange: (t) => {
|
|
588
|
+
let a = Array.isArray(t) ? t[0] ?? "" : t;
|
|
589
|
+
tn(e, r, i, n.key, a);
|
|
590
|
+
}
|
|
591
|
+
})
|
|
592
|
+
}, a);
|
|
593
|
+
}
|
|
548
594
|
return /* @__PURE__ */ p(u, {
|
|
549
595
|
align: n.align,
|
|
550
596
|
"data-label": t(n.label, w),
|
|
551
|
-
children:
|
|
552
|
-
disabled: V || o.length === 0 && !n.optionsSource,
|
|
553
|
-
placeholder: be(n),
|
|
554
|
-
options: o,
|
|
555
|
-
remoteOptions: n.optionsSource,
|
|
556
|
-
value: c,
|
|
557
|
-
onValueChange: (t) => {
|
|
558
|
-
let a = Array.isArray(t) ? t[0] ?? "" : t;
|
|
559
|
-
Yt(e, r, i, n.key, a);
|
|
560
|
-
}
|
|
561
|
-
})
|
|
597
|
+
children: de(e[n.key], n, E)
|
|
562
598
|
}, a);
|
|
563
|
-
}
|
|
564
|
-
|
|
565
|
-
align:
|
|
566
|
-
"data-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
"aria-hidden": "true"
|
|
610
|
-
}),
|
|
611
|
-
disabled: V,
|
|
612
|
-
className: n(le, "zui:text-[var(--zui-theme-status-danger)]"),
|
|
613
|
-
onClick: () => void qt(e, r, i)
|
|
614
|
-
}) : null
|
|
615
|
-
]
|
|
616
|
-
})
|
|
617
|
-
}) : null
|
|
618
|
-
] }, s);
|
|
619
|
-
}), kn ? /* @__PURE__ */ p(Ne, {
|
|
620
|
-
count: Pn,
|
|
599
|
+
}),
|
|
600
|
+
z ? /* @__PURE__ */ p(u, {
|
|
601
|
+
align: "center",
|
|
602
|
+
"data-cell": "actions",
|
|
603
|
+
className: n(ae, oe),
|
|
604
|
+
children: /* @__PURE__ */ m("div", {
|
|
605
|
+
"data-slot": "table-row-actions",
|
|
606
|
+
className: "zui:flex zui:items-center zui:justify-center zui:gap-0.5",
|
|
607
|
+
children: [
|
|
608
|
+
M ? /* @__PURE__ */ p(s, {
|
|
609
|
+
"data-slot": "table-action-edit-button",
|
|
610
|
+
label: C.common.edit,
|
|
611
|
+
icon: /* @__PURE__ */ p(Je, {
|
|
612
|
+
className: ie,
|
|
613
|
+
"aria-hidden": "true"
|
|
614
|
+
}),
|
|
615
|
+
disabled: V,
|
|
616
|
+
className: n(ce, "zui:text-[var(--zui-theme-text-primary)]"),
|
|
617
|
+
onClick: () => void Qt(e, r, i)
|
|
618
|
+
}) : null,
|
|
619
|
+
I.map((t, a) => /* @__PURE__ */ p(s, {
|
|
620
|
+
"data-slot": "table-action-custom-button",
|
|
621
|
+
label: t.tooltip,
|
|
622
|
+
icon: t.icon,
|
|
623
|
+
disabled: V,
|
|
624
|
+
className: n(ce, "zui:text-[var(--zui-theme-text-primary)]"),
|
|
625
|
+
onClick: () => void en(t, e, r, i)
|
|
626
|
+
}, `${t.tooltip}-${a}`)),
|
|
627
|
+
N ? /* @__PURE__ */ p(s, {
|
|
628
|
+
"data-slot": "table-action-delete-button",
|
|
629
|
+
label: C.common.delete,
|
|
630
|
+
icon: /* @__PURE__ */ p($e, {
|
|
631
|
+
className: ie,
|
|
632
|
+
"aria-hidden": "true"
|
|
633
|
+
}),
|
|
634
|
+
disabled: V,
|
|
635
|
+
className: n(ce, "zui:text-[var(--zui-theme-status-danger)]"),
|
|
636
|
+
onClick: () => void $t(e, r, i)
|
|
637
|
+
}) : null
|
|
638
|
+
]
|
|
639
|
+
})
|
|
640
|
+
}) : null
|
|
641
|
+
]
|
|
642
|
+
}, o);
|
|
643
|
+
}), Fn ? /* @__PURE__ */ p(Ne, {
|
|
644
|
+
count: Bn,
|
|
621
645
|
keyPrefix: "infinite-loading",
|
|
622
646
|
showRowNumbers: R,
|
|
623
647
|
columns: k,
|
|
624
|
-
actionsCount:
|
|
648
|
+
actionsCount: Vn
|
|
625
649
|
}) : null] }) })
|
|
626
650
|
] })
|
|
627
651
|
})
|
|
628
652
|
}),
|
|
629
|
-
O &&
|
|
630
|
-
open:
|
|
631
|
-
onOpenChange: (e) =>
|
|
653
|
+
O && Mt ? /* @__PURE__ */ p(a, {
|
|
654
|
+
open: Jt.open,
|
|
655
|
+
onOpenChange: (e) => Yt((t) => ({
|
|
632
656
|
...t,
|
|
633
657
|
open: e
|
|
634
658
|
})),
|
|
635
|
-
actions:
|
|
659
|
+
actions: Jt.actions,
|
|
636
660
|
label: C.table.actions
|
|
637
661
|
}) : null,
|
|
638
662
|
/* @__PURE__ */ p(Oe, {
|
|
639
|
-
shouldRenderInfiniteMode:
|
|
640
|
-
shouldShowInfiniteLoadingStatus:
|
|
641
|
-
shouldShowInfiniteReadyStatus:
|
|
642
|
-
shouldShowInfiniteCompletedStatus:
|
|
643
|
-
shouldRenderPagination:
|
|
663
|
+
shouldRenderInfiniteMode: Sn,
|
|
664
|
+
shouldShowInfiniteLoadingStatus: Ln,
|
|
665
|
+
shouldShowInfiniteReadyStatus: Rn,
|
|
666
|
+
shouldShowInfiniteCompletedStatus: zn,
|
|
667
|
+
shouldRenderPagination: xn,
|
|
644
668
|
loading: h,
|
|
645
669
|
isRowActionBusy: V,
|
|
646
|
-
currentPage:
|
|
647
|
-
totalPages:
|
|
648
|
-
onPageChange:
|
|
670
|
+
currentPage: _n,
|
|
671
|
+
totalPages: vn,
|
|
672
|
+
onPageChange: On
|
|
649
673
|
})
|
|
650
674
|
]
|
|
651
675
|
});
|
|
652
676
|
});
|
|
653
|
-
|
|
677
|
+
tt.displayName = "Table";
|
|
654
678
|
//#endregion
|
|
655
|
-
export {
|
|
679
|
+
export { tt as default };
|