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