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.
Files changed (52) hide show
  1. package/dist/components/Input/Input.formatting.cjs +1 -1
  2. package/dist/components/Input/Input.formatting.js +35 -17
  3. package/dist/components/Input/Input.interface.d.cts +5 -1
  4. package/dist/components/Input/Input.interface.d.ts +5 -1
  5. package/dist/components/OtpInput/OtpInput.cjs +1 -0
  6. package/dist/components/OtpInput/OtpInput.d.cts +10 -0
  7. package/dist/components/OtpInput/OtpInput.d.ts +10 -0
  8. package/dist/components/OtpInput/OtpInput.interface.d.cts +49 -0
  9. package/dist/components/OtpInput/OtpInput.interface.d.ts +49 -0
  10. package/dist/components/OtpInput/OtpInput.js +150 -0
  11. package/dist/components/OtpInput/OtpInput.variant.cjs +1 -0
  12. package/dist/components/OtpInput/OtpInput.variant.d.cts +6 -0
  13. package/dist/components/OtpInput/OtpInput.variant.d.ts +6 -0
  14. package/dist/components/OtpInput/OtpInput.variant.js +15 -0
  15. package/dist/components/Table/Table.cjs +1 -1
  16. package/dist/components/Table/Table.interface.d.cts +1 -1
  17. package/dist/components/Table/Table.interface.d.ts +1 -1
  18. package/dist/components/Table/Table.js +294 -270
  19. package/dist/components/Table/TableActiveFilters.d.cts +1 -1
  20. package/dist/components/Table/TableActiveFilters.d.ts +1 -1
  21. package/dist/components/Table/TableColumnFilter.cjs +1 -1
  22. package/dist/components/Table/TableColumnFilter.d.cts +3 -0
  23. package/dist/components/Table/TableColumnFilter.d.ts +3 -0
  24. package/dist/components/Table/TableColumnFilter.js +58 -28
  25. package/dist/components/Table/TableFilterRegistry.cjs +1 -0
  26. package/dist/components/Table/TableFilterRegistry.d.cts +13 -0
  27. package/dist/components/Table/TableFilterRegistry.d.ts +13 -0
  28. package/dist/components/Table/TableFilterRegistry.js +5 -0
  29. package/dist/components/VerticalTabs/VerticalTabs.cjs +1 -0
  30. package/dist/components/VerticalTabs/VerticalTabs.d.cts +4 -0
  31. package/dist/components/VerticalTabs/VerticalTabs.d.ts +4 -0
  32. package/dist/components/VerticalTabs/VerticalTabs.interface.d.cts +41 -0
  33. package/dist/components/VerticalTabs/VerticalTabs.interface.d.ts +41 -0
  34. package/dist/components/VerticalTabs/VerticalTabs.js +196 -0
  35. package/dist/components/VerticalTabs/VerticalTabs.variant.cjs +1 -0
  36. package/dist/components/VerticalTabs/VerticalTabs.variant.d.cts +19 -0
  37. package/dist/components/VerticalTabs/VerticalTabs.variant.d.ts +19 -0
  38. package/dist/components/VerticalTabs/VerticalTabs.variant.js +48 -0
  39. package/dist/components/shared/responsiveScale.cjs +1 -1
  40. package/dist/components/shared/responsiveScale.d.cts +3 -1
  41. package/dist/components/shared/responsiveScale.d.ts +3 -1
  42. package/dist/components/shared/responsiveScale.js +2 -2
  43. package/dist/config/messages.cjs +1 -1
  44. package/dist/config/messages.d.cts +4 -0
  45. package/dist/config/messages.d.ts +4 -0
  46. package/dist/config/messages.js +2 -0
  47. package/dist/index.cjs +1 -1
  48. package/dist/index.css +1 -1
  49. package/dist/index.d.cts +6 -1
  50. package/dist/index.d.ts +6 -1
  51. package/dist/index.js +19 -16
  52. 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 "../Button/Button.js";
7
- import o from "../shared/ActionSheet.js";
8
- import { CLEAR_ICON_CLASS as s } from "../shared/FieldClearButton.js";
9
- import { IconActionButton as c, ListToolbar as ee, ToolbarIconButton as l } from "../shared/IconActionButton.js";
10
- import { useExclusiveAction as te } from "../shared/useExclusiveAction.js";
11
- import { useStickyToolbar as ne } from "../shared/useStickyToolbar.js";
12
- import { useIsMobileViewport as re } from "../shared/viewport.js";
13
- import ie from "../Select/Select.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, replaceRowByIdentifier as me, resolveAriaSort as he, resolveColumnWidthPercentages as ge, resolveFilterOptions as _e, resolveFilterText as ve, resolveLoadingRowsCount as ye, resolvePlaceholder as be, resolveSafeRowId as xe } from "./Table.utils.js";
16
- import { tableContainerVariants as Se, tableVariants as Ce } from "./Table.variant.js";
17
- import we from "./TableActiveFilters.js";
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
- var et = d.forwardRef(function({ className: et, containerClassName: tt, loading: h = !1, isMutating: g = !1, stickyHeaderOnScroll: nt = !0, maxVisibleRowsBeforeScroll: rt, allowInfiniteMode: it = !0, stickyToolbar: at = !0, schema: _, data: v, setData: ot, onAdd: y, onImportExcel: b, onEdit: x, onDelete: st, onPrint: ct, onPreviewPrint: lt, actions: ut, onCellSelectChange: dt, getRowId: S, showNumberRow: ft = !1, showColumnBorder: pt = !1, showRowBorder: mt = !1, toolbarExtra: ht, children: gt }, _t) {
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(gt) > 0, O = re(), vt = d.useRef(null), yt = d.useMemo(() => r(_t, vt), [_t]);
38
- Ie(vt, D);
39
- let k = d.useMemo(() => _.columns.filter((e) => e.view), [_.columns]), bt = d.useMemo(() => k.filter((e) => e.sortable), [k]), A = d.useMemo(() => k.filter((e) => e.filterable), [k]), xt = typeof y == "function", j = typeof b == "function", M = typeof x == "function", N = typeof st == "function", P = typeof ct == "function", F = typeof lt == "function", I = ut ?? [], St = I.length > 0, L = _.searchable ?? !1, R = ft && !D, Ct = ht != null && ht !== !1, wt = _.pagination, Tt = wt?.onSearchChange, Et = typeof Tt == "function", z = M || N || St, { rowNumberColumnStyle: Dt, columnStyleByKey: Ot, actionsColumnStyle: kt } = d.useMemo(() => ge(k, R, z), [
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
- ]), At = d.useMemo(() => {
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]), [jt, B] = te(), [Mt, Nt] = d.useState(!1), [Pt, Ft] = d.useState(!1), [It, Lt] = d.useState(!1), [Rt, zt] = d.useState(null), [Bt, Vt] = d.useState(!1), [Ht, Ut] = d.useState({
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 || jt, Wt = d.useCallback(async () => {
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
- ]), Gt = d.useCallback(async () => {
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 ?? xe(t, n, S)
90
+ rowId: r ?? be(t, n, S)
81
91
  }));
82
92
  }, [
83
93
  S,
84
94
  g,
85
95
  B
86
- ]), Kt = d.useCallback(async (e, t, n) => {
96
+ ]), Qt = d.useCallback(async (e, t, n) => {
87
97
  x && await H(x, e, t, n);
88
- }, [x, H]), qt = d.useCallback(async (e, t, n) => {
89
- st && await H(st, e, t, n);
90
- }, [st, H]), Jt = d.useCallback(async (e, t, n, r) => {
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]), Yt = d.useCallback(async (e, t, n, r, i) => {
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 ?? xe(e, t, S), c = {
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 (dt && await dt({
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
- ot((e) => me(e, t, s, S, c));
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
- dt,
128
+ ft,
119
129
  B,
120
- ot
121
- ]), Xt = d.useCallback((e, t, r) => {
130
+ st
131
+ ]), nn = d.useCallback((e, t, r) => {
122
132
  let i = (e) => /* @__PURE__ */ p("span", {
123
- className: n("zui:inline-flex", s, "zui:[&>svg]:size-full"),
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 Kt(e, t, r)
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 Jt(n, e, t, r)
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 qt(e, t, r)
144
- }), Ut({
153
+ onSelect: () => void $t(e, t, r)
154
+ }), Yt({
145
155
  open: !0,
146
156
  actions: a
147
157
  });
148
158
  }, [
149
- Jt,
150
- qt,
151
- Kt,
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: Zt, normalizedSearchTerm: Qt, filteredRows: $t, handleSearchInputChange: en } = Re({
167
+ ]), { searchTerm: rn, normalizedSearchTerm: an, filteredRows: on, handleSearchInputChange: sn } = Re({
158
168
  data: v,
159
169
  visibleColumns: k,
160
170
  showSearchInput: L,
161
- hasRemoteSearchHandler: Et,
162
- onSearchChange: Tt,
171
+ hasRemoteSearchHandler: jt,
172
+ onSearchChange: At,
163
173
  getRowId: S,
164
174
  cellFormatOptions: E
165
- }), { filteredRows: tn, filterValues: U, activeFilterCount: nn, filterKey: rn, handleFilterChange: an, handleFilterClear: on } = Le({
166
- rows: $t,
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, _e(e, v, E)])), [
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: sn, handleSortClear: cn } = ze({
174
- rows: tn,
183
+ ]), { sortedRows: G, activeSort: K, handleSortToggle: pn, handleSortClear: mn } = ze({
184
+ rows: cn,
175
185
  columns: _.columns,
176
186
  sortConfig: _.sort
177
- }), ln = d.useCallback(async () => {
178
- ct && await ct({
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
- ct,
193
+ lt,
184
194
  G,
185
195
  k
186
- ]), un = d.useCallback(async () => {
187
- lt && await lt({
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
- lt,
202
+ ut,
193
203
  G,
194
204
  k
195
- ]), { pagingMode: q, currentPage: dn, totalPages: fn, resolvedPageSize: pn, visibleRows: J, showPagingModeToggle: mn, shouldRenderPagination: hn, shouldRenderInfiniteMode: gn, canLoadMoreInInfiniteMode: _n, shouldUseRemotePaging: vn, shouldUseScrollableRows: yn, tableScrollViewportRef: bn, tableScrollViewportStyle: xn, handlePageChange: Sn, handlePagingModeToggle: Cn, handleTableScrollViewport: wn, isInfiniteRequestPending: Tn } = Fe({
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: wt,
208
+ paginationConfig: kt,
199
209
  loading: h,
200
210
  isRowActionBusy: V,
201
- searchKey: `${Qt}|${rn}`,
211
+ searchKey: `${an}|${un}`,
202
212
  sortKey: K ? `${K.sortKey}:${K.direction}` : "",
203
- maxVisibleRowsBeforeScroll: rt,
204
- allowInfiniteMode: it
205
- }), En = yn && nt, Dn = d.useMemo(() => ye(_.pagination?.pageSize, v.length), [v.length, _.pagination?.pageSize]), On = h && (J.length === 0 || vn && q === "pagination"), kn = gn && h && J.length > 0, An = gn && J.length > 0, jn = An && (h || Tn), Mn = An && _n && !h && !Tn, Nn = An && !_n && !h && !Tn, Pn = Math.min(Dn, Math.max(1, Math.min(pn, 3))), Y = h || V, Fn = +!!M + I.length + +!!N, In = q === "pagination" ? C.table.switchToInfinite : C.table.switchToPagination, Ln = xt || j || mn || P || F, X = O && !D && bt.length > 0, Z = O && !D && A.length > 0, Q = !D && (L || Ln || X || Z), Rn = d.useRef(null), zn = d.useRef(null);
206
- ne(Rn, zn, O && at && Q);
207
- let Bn = d.useMemo(() => {
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: s,
219
+ className: o,
210
220
  "aria-hidden": "true"
211
- }), n = bt.map((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: () => sn(n.key)
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: cn
235
+ onSelect: mn
226
236
  }), n;
227
237
  }, [
228
238
  K,
229
239
  w,
230
- cn,
231
- sn,
240
+ mn,
241
+ pn,
232
242
  C.table.sortAscending,
233
243
  C.table.sortDefault,
234
244
  C.table.sortDescending,
235
- bt
236
- ]), Vn = d.useCallback((e) => {
237
- zt(e), Vt(!0);
238
- }, []), Hn = d.useMemo(() => A.map((e) => {
239
- let n = U[e.key], r = n !== void 0 && !pe(n), i = t(e.label, w), a = r ? t(ve(n, W[e.key] ?? []), w) : "";
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: s,
254
+ className: o,
245
255
  fill: r ? "currentColor" : "none",
246
256
  "aria-hidden": "true"
247
257
  }),
248
258
  active: r,
249
- onSelect: () => Vn(e.key)
259
+ onSelect: () => qn(e.key)
250
260
  };
251
261
  }), [
252
262
  w,
253
263
  W,
254
264
  U,
255
265
  A,
256
- Vn
257
- ]), $ = A.find((e) => e.key === Rt), Un = d.useMemo(() => {
266
+ qn
267
+ ]), $ = A.find((e) => e.key === Wt), Yn = d.useMemo(() => {
258
268
  let e = (e) => /* @__PURE__ */ p(e, {
259
- className: s,
269
+ className: o,
260
270
  "aria-hidden": "true"
261
271
  });
262
272
  return [
263
- xt ? {
273
+ Et ? {
264
274
  key: "add",
265
275
  label: C.common.add,
266
276
  icon: e(Ye),
267
- onSelect: () => void Wt()
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 Gt()
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 ln()
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 un()
295
+ onSelect: () => void gn()
286
296
  } : null,
287
- mn ? {
297
+ bn ? {
288
298
  key: "paging-mode",
289
- label: In,
299
+ label: Hn,
290
300
  icon: e(q === "pagination" ? qe : Qe),
291
- onSelect: Cn
301
+ onSelect: kn
292
302
  } : null
293
303
  ].filter((e) => e !== null);
294
304
  }, [
295
- Wt,
296
- Gt,
297
- Cn,
298
- un,
299
- ln,
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
- In,
306
- xt,
315
+ Hn,
316
+ Et,
307
317
  j,
308
- mn,
318
+ bn,
309
319
  F,
310
320
  P
311
- ]), Wn = O && (Un.length > 0 || X || Z), Gn = O && Un.length > 1, Kn = Ct && Q && L, qn = Ct && Q && !L, Jn = Ct && !Q, Yn = /* @__PURE__ */ p("div", {
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: ht
324
+ children: gt
315
325
  });
316
326
  return /* @__PURE__ */ m("div", {
317
327
  "data-slot": "table-container",
318
328
  dir: T,
319
- className: n(Se(), tt),
329
+ className: n(xe(), nt),
320
330
  children: [
321
- Jn ? /* @__PURE__ */ p("div", {
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: Yn
346
+ children: tr
325
347
  }) : null,
326
348
  Q ? /* @__PURE__ */ m(f, { children: [
327
349
  /* @__PURE__ */ p("div", {
328
- ref: zn,
350
+ ref: Gn,
329
351
  "aria-hidden": "true",
330
352
  "data-slot": "table-sticky-sentinel"
331
353
  }),
332
354
  /* @__PURE__ */ m("div", {
333
- ref: Rn,
355
+ ref: Wn,
334
356
  "data-slot": "table-sticky-toolbar",
335
- "data-sticky-toolbar": O && at ? "true" : void 0,
357
+ "data-sticky-toolbar": O && ot ? "true" : void 0,
336
358
  className: "zui:mb-3",
337
- children: [Kn ? /* @__PURE__ */ p("div", {
359
+ children: [Qn ? /* @__PURE__ */ p("div", {
338
360
  "data-slot": "table-toolbar-extra-row",
339
361
  className: "zui:mb-2",
340
- children: Yn
341
- }) : null, /* @__PURE__ */ p(ee, {
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: Wn,
367
+ inlineActionsOnMobile: Xn,
346
368
  search: L ? {
347
- value: Zt,
348
- onChange: en,
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: qn ? Yn : void 0,
354
- actions: X || Z || Gn || Ln ? /* @__PURE__ */ m(f, { children: [
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: () => Ft(!0),
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: () => Lt(!0),
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: nn > 0 ? "currentColor" : "none",
392
+ fill: ln > 0 ? "currentColor" : "none",
371
393
  "aria-hidden": "true"
372
- }), nn > 0 ? /* @__PURE__ */ p("span", {
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
- Gn ? /* @__PURE__ */ p(l, {
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: () => Nt(!0),
405
+ onClick: () => zt(!0),
384
406
  icon: /* @__PURE__ */ p(Ue, { "aria-hidden": "true" })
385
- }) : Ln ? /* @__PURE__ */ m(f, { children: [
386
- mn ? /* @__PURE__ */ p(l, {
407
+ }) : Un ? /* @__PURE__ */ m(f, { children: [
408
+ bn ? /* @__PURE__ */ p(l, {
387
409
  "data-slot": "table-paging-mode-toggle-button",
388
- label: In,
410
+ label: Hn,
389
411
  disabled: Y,
390
- onClick: Cn,
412
+ onClick: kn,
391
413
  icon: p(q === "pagination" ? qe : Qe, {
392
- className: ce,
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 un(),
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 ln(),
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 Gt(),
436
+ onClick: () => void Zt(),
415
437
  icon: /* @__PURE__ */ p(Ge, {})
416
438
  }) : null,
417
- xt ? /* @__PURE__ */ p(l, {
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 Wt(),
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(o, {
429
- open: Pt,
430
- onOpenChange: Ft,
431
- actions: Bn,
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(o, {
435
- open: It,
436
- onOpenChange: Lt,
437
- actions: Hn,
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) => an($.key, e),
464
+ onChange: (e) => dn($.key, e),
443
465
  options: W[$.key] ?? [],
444
- open: Bt,
445
- onOpenChange: Vt
466
+ open: Kt,
467
+ onOpenChange: qt
446
468
  }, $.key) : null] }) : null,
447
- Gn ? /* @__PURE__ */ p(o, {
448
- open: Mt,
449
- onOpenChange: Nt,
450
- actions: Un.map((e) => ({
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: bn,
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)]", yn ? "zui:overflow-y-auto" : void 0),
468
- style: xn,
469
- onScroll: wn,
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: yt,
486
+ ref: wt,
472
487
  "data-slot": "table",
473
- className: n(Ce({
474
- showColumnBorder: pt,
475
- showRowBorder: mt
476
- }), et),
488
+ className: n(Se({
489
+ showColumnBorder: mt,
490
+ showRowBorder: ht
491
+ }), tt),
477
492
  dir: T,
478
- children: D ? gt : k.length === 0 ? /* @__PURE__ */ p(ke, { children: /* @__PURE__ */ p(Me, { children: /* @__PURE__ */ p(u, {
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: Dt }) : null,
484
- k.map((e) => /* @__PURE__ */ p("col", { style: Ot[e.key] }, `col-${e.key}`)),
485
- z ? /* @__PURE__ */ p("col", { style: kt }) : null
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(ue, En ? de : void 0),
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: () => sn(e.key)
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) => an(e.key, 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: En ? de : void 0,
507
- "aria-sort": e.sortable ? he(n) : void 0,
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(oe, se, En ? de : void 0),
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: On ? /* @__PURE__ */ p(Ne, {
524
- count: Dn,
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: Fn
546
+ actionsCount: Vn
529
547
  }) : J.length === 0 ? /* @__PURE__ */ p(De, {
530
548
  colSpan: k.length + +!!z + +!!R,
531
549
  showSearchInput: L,
532
- normalizedSearchTerm: Qt,
533
- hasActiveFilters: nn > 0,
534
- onClearFilters: on
535
- }) : /* @__PURE__ */ m(f, { children: [J.map(({ row: e, rowIndex: r, rowId: i }, o) => {
536
- let s = i === void 0 ? `row-${r}` : `row-id-${String(i)}`, ee = hn ? (dn - 1) * pn + o + 1 : o + 1;
537
- return /* @__PURE__ */ m(Me, { children: [
538
- R ? /* @__PURE__ */ p(u, {
539
- align: "center",
540
- className: ue,
541
- "data-label": C.table.rowNumber,
542
- children: t(String(ee), w)
543
- }) : null,
544
- k.map((n) => {
545
- let a = `cell-${n.key}-${s}`;
546
- if (n.viewType === "select") {
547
- let o = At[n.key] ?? [], s = e[n.key], c = typeof s == "string" || typeof s == "number" ? String(s) : "";
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: /* @__PURE__ */ p(ie, {
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
- return /* @__PURE__ */ p(u, {
565
- align: n.align,
566
- "data-label": t(n.label, w),
567
- children: fe(e[n.key], n, E)
568
- }, a);
569
- }),
570
- z ? /* @__PURE__ */ p(u, {
571
- align: "center",
572
- "data-cell": "actions",
573
- className: n(oe, se),
574
- children: O ? /* @__PURE__ */ p(a, {
575
- "data-slot": "table-row-actions-button",
576
- kind: "cancel",
577
- fullWidth: !0,
578
- label: C.table.actions,
579
- disabled: V,
580
- onClick: () => Xt(e, r, i)
581
- }) : /* @__PURE__ */ m("div", {
582
- "data-slot": "table-row-actions",
583
- className: "zui:flex zui:items-center zui:justify-center zui:gap-0.5",
584
- children: [
585
- M ? /* @__PURE__ */ p(c, {
586
- "data-slot": "table-action-edit-button",
587
- label: C.common.edit,
588
- icon: /* @__PURE__ */ p(Je, {
589
- className: ae,
590
- "aria-hidden": "true"
591
- }),
592
- disabled: V,
593
- className: n(le, "zui:text-[var(--zui-theme-text-primary)]"),
594
- onClick: () => void Kt(e, r, i)
595
- }) : null,
596
- I.map((t, a) => /* @__PURE__ */ p(c, {
597
- "data-slot": "table-action-custom-button",
598
- label: t.tooltip,
599
- icon: t.icon,
600
- disabled: V,
601
- className: n(le, "zui:text-[var(--zui-theme-text-primary)]"),
602
- onClick: () => void Jt(t, e, r, i)
603
- }, `${t.tooltip}-${a}`)),
604
- N ? /* @__PURE__ */ p(c, {
605
- "data-slot": "table-action-delete-button",
606
- label: C.common.delete,
607
- icon: /* @__PURE__ */ p($e, {
608
- className: ae,
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: Fn
648
+ actionsCount: Vn
625
649
  }) : null] }) })
626
650
  ] })
627
651
  })
628
652
  }),
629
- O && z ? /* @__PURE__ */ p(o, {
630
- open: Ht.open,
631
- onOpenChange: (e) => Ut((t) => ({
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: Ht.actions,
659
+ actions: Jt.actions,
636
660
  label: C.table.actions
637
661
  }) : null,
638
662
  /* @__PURE__ */ p(Oe, {
639
- shouldRenderInfiniteMode: gn,
640
- shouldShowInfiniteLoadingStatus: jn,
641
- shouldShowInfiniteReadyStatus: Mn,
642
- shouldShowInfiniteCompletedStatus: Nn,
643
- shouldRenderPagination: hn,
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: dn,
647
- totalPages: fn,
648
- onPageChange: Sn
670
+ currentPage: _n,
671
+ totalPages: vn,
672
+ onPageChange: On
649
673
  })
650
674
  ]
651
675
  });
652
676
  });
653
- et.displayName = "Table";
677
+ tt.displayName = "Table";
654
678
  //#endregion
655
- export { et as default };
679
+ export { tt as default };