@sito/dashboard 0.0.67 → 0.0.68

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 (46) hide show
  1. package/dist/{FileInput-DCR_Pyqe.js → FileInput-DNoJELoS.js} +18 -18
  2. package/dist/FileInput-YvKQ-wok.cjs +1 -0
  3. package/dist/FiltersProvider-BlHv12dU.cjs +1 -0
  4. package/dist/{FiltersProvider-CY2fsw_F.js → FiltersProvider-gfC9gS8u.js} +5 -5
  5. package/dist/FiltersProvider.cjs +1 -1
  6. package/dist/FiltersProvider.js +1 -1
  7. package/dist/Form.cjs +1 -1
  8. package/dist/Form.js +2 -2
  9. package/dist/{Table-BtZGG0d7.js → Table-B5vsXjAq.js} +399 -375
  10. package/dist/Table-DgFzKIJZ.cjs +1 -0
  11. package/dist/Table.cjs +1 -1
  12. package/dist/Table.css +1 -1
  13. package/dist/Table.js +1 -1
  14. package/dist/TableOptions.cjs +1 -1
  15. package/dist/TableOptions.js +1 -1
  16. package/dist/TableOptionsProvider-CDLZ4TXE.cjs +1 -0
  17. package/dist/TableOptionsProvider-HHCDcRbO.js +55 -0
  18. package/dist/TextInput-C27RFuya.cjs +1 -0
  19. package/dist/TextInput-DPYxzgm3.js +335 -0
  20. package/dist/TextInput.css +1 -1
  21. package/dist/Translation.cjs +1 -1
  22. package/dist/Translation.js +1 -1
  23. package/dist/{TranslationProvider-COebIyxr.js → TranslationProvider-BR4s--Vu.js} +2 -2
  24. package/dist/TranslationProvider-Czr0WIDH.cjs +1 -0
  25. package/dist/components/Form/CheckInput/CheckInput.stories.d.ts +2 -0
  26. package/dist/components/Form/CheckInput/CheckInput.test.d.ts +1 -0
  27. package/dist/components/Form/SelectInput/SelectInput.stories.d.ts +1 -0
  28. package/dist/components/Form/TextInput/TextInput.stories.d.ts +2 -0
  29. package/dist/components/Table/Table.stories.d.ts +2 -0
  30. package/dist/components/Table/components/Footer/Navigation.test.d.ts +1 -0
  31. package/dist/components/Table/components/TableHeader/TableHeader.test.d.ts +1 -0
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.css +1 -1
  34. package/dist/index.js +6 -6
  35. package/dist/providers/FiltersProvider/FiltersProvider.test.d.ts +1 -0
  36. package/dist/providers/Translation/TranslationProvider.d.ts +5 -4
  37. package/dist/providers/Translation/TranslationProvider.test.d.ts +1 -0
  38. package/package.json +1 -1
  39. package/dist/FileInput-Ch-GCxrS.cjs +0 -1
  40. package/dist/FiltersProvider-CYqLFEI9.cjs +0 -1
  41. package/dist/Table-DjIhOMXQ.cjs +0 -1
  42. package/dist/TableOptionsProvider-BchUDA3B.cjs +0 -1
  43. package/dist/TableOptionsProvider-BfQS8l1N.js +0 -50
  44. package/dist/TextInput-BqW5YX-3.js +0 -320
  45. package/dist/TextInput-CY1fh4mf.cjs +0 -1
  46. package/dist/TranslationProvider-51Pc9Xrr.cjs +0 -1
@@ -1,70 +1,70 @@
1
1
  import "./Table.css";
2
- import { jsxs as g, jsx as e, Fragment as G } from "react/jsx-runtime";
3
- import { useState as _, useRef as j, useEffect as P, useMemo as w, useCallback as v, Fragment as ae } from "react";
4
- import { u as H, a as V, F as re } from "./FiltersProvider-CY2fsw_F.js";
5
- import { B as ie } from "./Badge-CIeYthEy.js";
6
- import { E as oe, c as ce, C as de, a as ue, b as pe, F as me } from "./Filters-DL5jd8ps.js";
2
+ import { jsxs as g, jsx as e, Fragment as X } from "react/jsx-runtime";
3
+ import { useState as O, useRef as V, useEffect as I, useMemo as w, useCallback as x, Fragment as oe } from "react";
4
+ import { u as H, a as j, F as ce } from "./FiltersProvider-gfC9gS8u.js";
5
+ import { B as de } from "./Badge-CIeYthEy.js";
6
+ import { E as ue, c as se, C as ae, a as pe, b as me, F as he } from "./Filters-DL5jd8ps.js";
7
7
  import { FilterTypes as W } from "./lib.js";
8
- import { u as k } from "./TranslationProvider-COebIyxr.js";
9
- import { A as he, C as fe, S as Z, T as Y } from "./TextInput-BqW5YX-3.js";
10
- import { u as D } from "./TableOptionsProvider-BfQS8l1N.js";
11
- import { C as ee } from "./Chip-C5ogKbFn.js";
8
+ import { u as $ } from "./TranslationProvider-BR4s--Vu.js";
9
+ import { A as fe, C as be, S as ee, T as Y } from "./TextInput-DPYxzgm3.js";
10
+ import { u as z } from "./TableOptionsProvider-HHCDcRbO.js";
11
+ import { B as Z } from "./Button-D73-swfo.js";
12
+ import { C as te } from "./Chip-C5ogKbFn.js";
12
13
  import { I as q } from "./IconButton-BpsTEj0z.js";
13
- import { T as ne } from "./Tooltip-B4E-FRwY.js";
14
- import { S as be } from "./query-CwuehjY1.js";
15
- import { B as ge } from "./Button-D73-swfo.js";
14
+ import { T as le } from "./Tooltip-B4E-FRwY.js";
15
+ import { S as ge } from "./query-CwuehjY1.js";
16
16
  import { D as Ne } from "./Dropdown-CbaxuMbk.js";
17
17
  import { L as Ce } from "./Loading-B_c_4XLr.js";
18
- function we(n) {
18
+ function we(s) {
19
19
  const {
20
20
  id: t,
21
21
  icon: r,
22
- tooltip: s,
22
+ tooltip: n,
23
23
  onClick: l,
24
24
  children: a,
25
- hidden: u = !1,
25
+ hidden: d = !1,
26
26
  disabled: i = !1,
27
- showText: d = !1,
27
+ showText: c = !1,
28
28
  showTooltips: o = !0,
29
29
  className: m = ""
30
- } = n;
31
- return u ? null : /* @__PURE__ */ g(
30
+ } = s;
31
+ return d ? null : /* @__PURE__ */ g(
32
32
  "button",
33
33
  {
34
34
  id: t,
35
- className: `action ${d ? "text-action" : "icon-action"} ${m}`,
35
+ className: `action ${c ? "text-action" : "icon-action"} ${m}`,
36
36
  disabled: i,
37
37
  onClick: () => l?.(),
38
38
  "aria-disabled": i,
39
39
  "data-tooltip-id": "tooltip",
40
- "data-tooltip-content": o ? s : "",
40
+ "data-tooltip-content": o ? n : "",
41
41
  children: [
42
42
  r,
43
43
  " ",
44
- d && s,
44
+ c && n,
45
45
  a
46
46
  ]
47
47
  }
48
48
  );
49
49
  }
50
- function xe(n) {
50
+ function xe(s) {
51
51
  const {
52
52
  actions: t = [],
53
53
  className: r = "",
54
- itemClassName: s = "",
54
+ itemClassName: n = "",
55
55
  actionClassName: l = "",
56
56
  showTooltips: a = !0,
57
- showActionTexts: u = !1
58
- } = n;
57
+ showActionTexts: d = !1
58
+ } = s;
59
59
  return /* @__PURE__ */ e("ul", { className: `actions-container ${r}`, children: t.map((i) => /* @__PURE__ */ e(
60
60
  "li",
61
61
  {
62
- className: `actions-container-item ${s}`,
62
+ className: `actions-container-item ${n}`,
63
63
  children: /* @__PURE__ */ e(
64
64
  we,
65
65
  {
66
66
  showTooltips: a,
67
- showText: u,
67
+ showText: d,
68
68
  className: l,
69
69
  ...i
70
70
  }
@@ -73,19 +73,22 @@ function xe(n) {
73
73
  i.id
74
74
  )) });
75
75
  }
76
- const ve = (n) => {
77
- const { actions: t = [], className: r = "" } = n, { t: s } = k(), [l, a] = _(!1), [u, i] = _(null);
76
+ const ve = (s) => {
77
+ const { actions: t = [], className: r = "" } = s, { t: n } = $(), [l, a] = O(!1), [d, i] = O(null);
78
78
  return /* @__PURE__ */ g("div", { className: `actions-dropdown ${r}`, children: [
79
79
  /* @__PURE__ */ e(
80
80
  q,
81
81
  {
82
- icon: /* @__PURE__ */ e(oe, {}),
83
- onClick: (d) => {
84
- i(d.currentTarget), a((o) => !o);
82
+ icon: /* @__PURE__ */ e(ue, {}),
83
+ onClick: (c) => {
84
+ c.stopPropagation(), i(c.currentTarget), a((o) => !o);
85
85
  },
86
+ onMouseDown: (c) => c.stopPropagation(),
86
87
  className: "actions-dropdown-trigger",
88
+ "aria-label": n("_accessibility:buttons.openActions"),
89
+ name: n("_accessibility:buttons.openActions"),
87
90
  "data-tooltip-id": "tooltip",
88
- "data-tooltip-content": s("_accessibility:buttons.openActions")
91
+ "data-tooltip-content": n("_accessibility:buttons.openActions")
89
92
  }
90
93
  ),
91
94
  /* @__PURE__ */ e(
@@ -93,7 +96,7 @@ const ve = (n) => {
93
96
  {
94
97
  open: l,
95
98
  onClose: () => a(!1),
96
- anchorEl: u,
99
+ anchorEl: d,
97
100
  children: /* @__PURE__ */ e(
98
101
  xe,
99
102
  {
@@ -109,130 +112,130 @@ const ve = (n) => {
109
112
  )
110
113
  ] });
111
114
  };
112
- function se(n) {
113
- return [...n].sort((t, r) => (r.pos ?? 0) - (t.pos ?? 0)).filter((t) => t.display !== "none");
115
+ function re(s) {
116
+ return [...s].sort((t, r) => (r.pos ?? 0) - (t.pos ?? 0)).filter((t) => t.display !== "none");
114
117
  }
115
- function ye(n) {
116
- const { t } = k(), {
118
+ function ye(s) {
119
+ const { t } = $(), {
117
120
  entity: r = "",
118
- columns: s = [],
121
+ columns: n = [],
119
122
  hasAction: l = !0,
120
123
  onSortCallback: a,
121
- selectionState: u,
124
+ selectionState: d,
122
125
  onToggleAllRows: i
123
- } = n, d = j(null);
124
- P(() => {
125
- d.current && (d.current.indeterminate = !!(u?.hasSomeSelected && !u?.allSelected));
126
- }, [u]);
127
- const { onSort: o, sortingOrder: m, sortingBy: h } = D(), f = w(() => se(s).map((c) => ({
128
- id: c.key,
129
- label: c.label,
130
- className: c.className ?? "",
131
- sortable: c.sortable ?? !0,
132
- sortOptions: c.sortOptions
133
- })), [s, r, t]);
126
+ } = s, c = V(null);
127
+ I(() => {
128
+ c.current && (c.current.indeterminate = !!(d?.hasSomeSelected && !d?.allSelected));
129
+ }, [d]);
130
+ const { onSort: o, sortingOrder: m, sortingBy: h } = z(), f = w(() => re(n).map((u) => ({
131
+ id: u.key,
132
+ label: u.label,
133
+ className: u.className ?? "",
134
+ sortable: u.sortable ?? !0,
135
+ sortOptions: u.sortOptions
136
+ })), [n, r, t]);
134
137
  return /* @__PURE__ */ e("thead", { className: "table-headers-row", children: /* @__PURE__ */ g("tr", { children: [
135
138
  /* @__PURE__ */ e("th", { scope: "col", className: "table-headers-column table-headers-checkbox", children: i ? /* @__PURE__ */ e(
136
139
  "input",
137
140
  {
138
141
  type: "checkbox",
139
- ref: d,
140
- checked: u?.allSelected ?? !1,
142
+ ref: c,
143
+ checked: d?.allSelected ?? !1,
141
144
  onChange: i,
142
145
  "aria-label": t("_accessibility:components.table.selectAllRows")
143
146
  }
144
147
  ) : null }),
145
148
  l && /* @__PURE__ */ e("th", { scope: "col", className: "table-headers-action", children: /* @__PURE__ */ e("span", { children: t("_accessibility:labels.actions") }) }),
146
- f.map((c) => /* @__PURE__ */ e(
149
+ f.map((u) => /* @__PURE__ */ e(
147
150
  "th",
148
151
  {
149
152
  scope: "col",
150
- className: `table-headers-column ${c.className}`,
153
+ className: `table-headers-column ${u.className}`,
151
154
  children: /* @__PURE__ */ g(
152
- ge,
155
+ Z,
153
156
  {
154
- disabled: !c.sortable,
155
- onClick: () => o(c.id, a),
157
+ disabled: !u.sortable,
158
+ onClick: () => o(u.id, a),
156
159
  className: "table-headers-cell",
157
160
  children: [
158
- /* @__PURE__ */ e("span", { className: "table-headers-label", children: c.label }),
159
- c.sortable && h === c.id && /* @__PURE__ */ e("span", { children: m === be.ASC ? c.sortOptions?.icons?.asc ?? /* @__PURE__ */ e(
160
- ce,
161
+ /* @__PURE__ */ e("span", { className: "table-headers-label", children: u.label }),
162
+ u.sortable && h === u.id && /* @__PURE__ */ e("span", { children: m === ge.ASC ? u.sortOptions?.icons?.asc ?? /* @__PURE__ */ e(
163
+ se,
161
164
  {
162
- className: c.sortOptions?.icons?.className ?? "table-headers-sort-indicator"
165
+ className: u.sortOptions?.icons?.className ?? "table-headers-sort-indicator"
163
166
  }
164
- ) : c.sortOptions?.icons?.desc ?? /* @__PURE__ */ e(
165
- de,
167
+ ) : u.sortOptions?.icons?.desc ?? /* @__PURE__ */ e(
168
+ ae,
166
169
  {
167
- className: c.sortOptions?.icons?.className ?? "table-headers-sort-indicator"
170
+ className: u.sortOptions?.icons?.className ?? "table-headers-sort-indicator"
168
171
  }
169
172
  ) })
170
173
  ]
171
174
  }
172
175
  )
173
176
  },
174
- c.id
177
+ u.id
175
178
  ))
176
179
  ] }) });
177
180
  }
178
- const Se = (n) => {
179
- const { items: t, text: r, id: s, onClearFilter: l } = n;
181
+ const Se = (s) => {
182
+ const { items: t, text: r, id: n, onClearFilter: l } = s;
180
183
  return /* @__PURE__ */ e(
181
- ee,
184
+ te,
182
185
  {
183
186
  text: `${r}: ${t.map((a) => a.value ?? a.name).join(", ")}`,
184
- onDelete: () => l(s)
187
+ onDelete: () => l(n)
185
188
  }
186
189
  );
187
- }, Re = (n) => {
188
- const { end: t, start: r, text: s, id: l, onClearFilter: a } = n;
190
+ }, Re = (s) => {
191
+ const { end: t, start: r, text: n, id: l, onClearFilter: a } = s;
189
192
  return /* @__PURE__ */ e(
190
- ee,
193
+ te,
191
194
  {
192
- text: `${s}: ${r || "♾️"} - ${t || "♾️"}`,
195
+ text: `${n}: ${r || "♾️"} - ${t || "♾️"}`,
193
196
  onDelete: () => a(l)
194
197
  }
195
198
  );
196
- }, Te = (n) => {
197
- const { filtersDefinition: t } = n, r = w(() => {
199
+ }, Te = (s) => {
200
+ const { filtersDefinition: t } = s, r = w(() => {
198
201
  const i = {};
199
- return t.forEach((d) => {
200
- i[d.propertyName] = d.label ?? d.propertyName;
202
+ return t.forEach((c) => {
203
+ i[c.propertyName] = c.label ?? c.propertyName;
201
204
  }), i;
202
- }, [t]), { filters: s, clearFilters: l } = D(), a = w(() => Object.keys(s), [s]), u = v(
203
- (i) => s[i]?.end || s[i]?.start ? /* @__PURE__ */ e(
205
+ }, [t]), { filters: n, clearFilters: l } = z(), a = w(() => Object.keys(n), [n]), d = x(
206
+ (i) => n[i]?.end || n[i]?.start ? /* @__PURE__ */ e(
204
207
  Re,
205
208
  {
206
209
  id: i,
207
210
  text: r[i],
208
- start: s[i].start,
209
- end: s[i].end,
211
+ start: n[i].start,
212
+ end: n[i].end,
210
213
  onClearFilter: l
211
214
  }
212
- ) : Array.isArray(s[i]) ? /* @__PURE__ */ e(
215
+ ) : Array.isArray(n[i]) ? /* @__PURE__ */ e(
213
216
  Se,
214
217
  {
215
218
  id: i,
216
219
  text: r[i],
217
- items: s[i],
220
+ items: n[i],
218
221
  onClearFilter: l
219
222
  }
220
223
  ) : /* @__PURE__ */ e(
221
- ee,
224
+ te,
222
225
  {
223
- text: `${r[i]}: ${s[i]?.value ?? s[i]?.name ?? s[i]}`,
226
+ text: `${r[i]}: ${n[i]?.value ?? n[i]?.name ?? n[i]}`,
224
227
  onDelete: () => l(i)
225
228
  }
226
229
  ),
227
- [s, r]
230
+ [n, r]
228
231
  );
229
- return /* @__PURE__ */ e("ul", { className: "active-filters-main", children: a?.map((i) => /* @__PURE__ */ e("li", { children: u(i) }, i)) });
232
+ return /* @__PURE__ */ e("ul", { className: "active-filters-main", children: a?.map((i) => /* @__PURE__ */ e("li", { children: d(i) }, i)) });
230
233
  };
231
- function Ae(n) {
232
- const { propertyName: t, label: r, placeholder: s, options: l, multiple: a = !0 } = n, { currentFilters: u, setCurrentFilters: i } = H(), d = w(() => u[t] ?? l[0], [u]), o = v(
234
+ function Ae(s) {
235
+ const { propertyName: t, label: r, placeholder: n, options: l, multiple: a = !0 } = s, { currentFilters: d, setCurrentFilters: i } = H(), c = w(() => d[t] ?? l[0], [d]), o = x(
233
236
  (m) => {
234
237
  i({
235
- type: V.update,
238
+ type: j.update,
236
239
  toUpdate: {
237
240
  [t]: {
238
241
  value: m
@@ -243,79 +246,79 @@ function Ae(n) {
243
246
  [a]
244
247
  );
245
248
  return /* @__PURE__ */ e(
246
- he,
249
+ fe,
247
250
  {
248
- value: d?.value,
251
+ value: c?.value,
249
252
  label: r,
250
253
  options: l,
251
254
  multiple: a,
252
255
  helperTextClassName: "hidden",
253
256
  containerClassName: "options-widget-container",
254
257
  onChange: o,
255
- placeholder: s
258
+ placeholder: n
256
259
  }
257
260
  );
258
261
  }
259
- const Ee = (n) => {
260
- const { propertyName: t, label: r } = n, { currentFilters: s, setCurrentFilters: l } = H(), a = w(() => s[t]?.value ?? "", [s]), u = v((i) => {
262
+ const Ee = (s) => {
263
+ const { propertyName: t, label: r } = s, { currentFilters: n, setCurrentFilters: l } = H(), a = w(() => n[t]?.value ?? "", [n]), d = x((i) => {
261
264
  l({
262
- type: V.update,
265
+ type: j.update,
263
266
  toUpdate: { [t]: { value: i.target.checked } }
264
267
  });
265
268
  }, []);
266
- return /* @__PURE__ */ e(fe, { label: r, checked: a ?? !1, onChange: u });
269
+ return /* @__PURE__ */ e(be, { label: r, checked: a ?? !1, onChange: d });
267
270
  };
268
- function Fe(n) {
269
- const { propertyName: t, options: r, label: s, placeholder: l } = n, { currentFilters: a, setCurrentFilters: u } = H(), i = w(() => a[t]?.value ?? r[0], [a]), d = v((o) => {
270
- u({
271
- type: V.update,
271
+ function Fe(s) {
272
+ const { propertyName: t, options: r, label: n, placeholder: l } = s, { currentFilters: a, setCurrentFilters: d } = H(), i = w(() => a[t]?.value ?? r[0], [a]), c = x((o) => {
273
+ d({
274
+ type: j.update,
272
275
  toUpdate: { [t]: { value: o.target.value } }
273
276
  });
274
277
  }, []);
275
278
  return /* @__PURE__ */ e(
276
- Z,
279
+ ee,
277
280
  {
278
281
  value: i,
279
- label: s,
282
+ label: n,
280
283
  options: r,
281
284
  helperTextClassName: "hidden",
282
285
  containerClassName: "options-widget-container",
283
- onChange: d,
286
+ onChange: c,
284
287
  placeholder: l
285
288
  }
286
289
  );
287
290
  }
288
- const ke = (n) => {
289
- const { propertyName: t, label: r, placeholder: s } = n, { currentFilters: l, setCurrentFilters: a } = H(), u = w(() => l[t]?.value ?? "", [l]), i = v((d) => {
291
+ const ke = (s) => {
292
+ const { propertyName: t, label: r, placeholder: n } = s, { currentFilters: l, setCurrentFilters: a } = H(), d = w(() => l[t]?.value ?? "", [l]), i = x((c) => {
290
293
  a({
291
- type: V.update,
292
- toUpdate: { [t]: { value: d.target.value } }
294
+ type: j.update,
295
+ toUpdate: { [t]: { value: c.target.value } }
293
296
  });
294
297
  }, []);
295
298
  return /* @__PURE__ */ e(
296
299
  Y,
297
300
  {
298
- value: u ?? "",
301
+ value: d ?? "",
299
302
  label: r,
300
303
  onChange: i,
301
304
  containerClassName: "input-widget-container",
302
305
  helperTextClassName: "",
303
- placeholder: s
306
+ placeholder: n
304
307
  }
305
308
  );
306
- }, te = (n) => {
307
- const { propertyName: t, label: r, inputType: s } = n, { t: l } = k(), { currentFilters: a, setCurrentFilters: u } = H(), i = j(null), d = j(null), o = v((h) => {
308
- u({
309
- type: V.update,
309
+ }, ne = (s) => {
310
+ const { propertyName: t, label: r, inputType: n } = s, { t: l } = $(), { currentFilters: a, setCurrentFilters: d } = H(), i = V(null), c = V(null), o = x((h) => {
311
+ d({
312
+ type: j.update,
310
313
  toUpdate: {
311
314
  [t]: {
312
- value: { end: d?.current?.value ?? null, start: h.target.value }
315
+ value: { end: c?.current?.value ?? null, start: h.target.value }
313
316
  }
314
317
  }
315
318
  });
316
- }, []), m = v((h) => {
317
- u({
318
- type: V.update,
319
+ }, []), m = x((h) => {
320
+ d({
321
+ type: j.update,
319
322
  toUpdate: {
320
323
  [t]: {
321
324
  value: {
@@ -334,7 +337,7 @@ const ke = (n) => {
334
337
  {
335
338
  value: a[t]?.value?.start ?? "",
336
339
  placeholder: l("_accessibility:components.table.filters.range.start"),
337
- type: s,
340
+ type: n,
338
341
  ref: i,
339
342
  onChange: o,
340
343
  containerClassName: "input-widget-container",
@@ -346,8 +349,8 @@ const ke = (n) => {
346
349
  {
347
350
  value: a[t]?.value?.end ?? "",
348
351
  placeholder: l("_accessibility:components.table.filters.range.end"),
349
- type: s,
350
- ref: d,
352
+ type: n,
353
+ ref: c,
351
354
  onChange: m,
352
355
  containerClassName: "input-widget-container",
353
356
  helperTextClassName: ""
@@ -355,175 +358,182 @@ const ke = (n) => {
355
358
  )
356
359
  ] })
357
360
  ] });
358
- }, $e = (n) => {
359
- switch (n.type) {
361
+ }, $e = (s) => {
362
+ switch (s.type) {
360
363
  case W.text:
361
- return /* @__PURE__ */ e(ke, { ...n });
364
+ return /* @__PURE__ */ e(ke, { ...s });
362
365
  case W.number:
363
366
  return /* @__PURE__ */ e(
364
- te,
367
+ ne,
365
368
  {
366
- ...n,
369
+ ...s,
367
370
  inputType: "number"
368
371
  }
369
372
  );
370
373
  case W.date:
371
374
  return /* @__PURE__ */ e(
372
- te,
375
+ ne,
373
376
  {
374
- ...n,
377
+ ...s,
375
378
  inputType: "date"
376
379
  }
377
380
  );
378
381
  case W.select:
379
- return /* @__PURE__ */ e(Fe, { ...n });
382
+ return /* @__PURE__ */ e(Fe, { ...s });
380
383
  case W.autocomplete:
381
- return /* @__PURE__ */ e(Ae, { ...n });
384
+ return /* @__PURE__ */ e(Ae, { ...s });
382
385
  case W.check:
383
- return /* @__PURE__ */ e(Ee, { ...n });
386
+ return /* @__PURE__ */ e(Ee, { ...s });
384
387
  }
385
- return /* @__PURE__ */ e(G, {});
386
- }, Oe = (n) => {
387
- const { filters: t = [], show: r, handleShow: s } = n, { onFilterApply: l } = D(), { currentFilters: a, setCurrentFilters: u } = H(), { t: i } = k(), d = j(null);
388
- return P(() => {
388
+ return /* @__PURE__ */ e(X, {});
389
+ }, _e = (s) => {
390
+ const { filters: t = [], show: r, handleShow: n } = s, { onFilterApply: l } = z(), { currentFilters: a, setCurrentFilters: d } = H(), { t: i } = $(), c = V(null);
391
+ return I(() => {
389
392
  const o = ({ target: h }) => {
390
- d.current && (h?.closest(".filter-dropdown-trigger") || !r || d.current.contains(h) || s(!1));
393
+ c.current && (h?.closest(".filter-dropdown-trigger") || !r || c.current.contains(h) || n(!1));
391
394
  }, m = ({ code: h }) => {
392
- !r || h !== "Escape" || s(!1);
395
+ !r || h !== "Escape" || n(!1);
393
396
  };
394
397
  return document.addEventListener("click", o), document.addEventListener("keydown", m), () => {
395
398
  document.removeEventListener("click", o), document.removeEventListener("keydown", m);
396
399
  };
397
- }, [s, r]), /* @__PURE__ */ e("div", { className: `filter-dropdown-backdrop ${r ? "opened" : "closed"}`, children: /* @__PURE__ */ g("div", { className: "filter-popup", ref: d, children: [
400
+ }, [n, r]), /* @__PURE__ */ e("div", { className: `filter-dropdown-backdrop ${r ? "opened" : "closed"}`, children: /* @__PURE__ */ g("div", { className: "filter-popup", ref: c, children: [
398
401
  /* @__PURE__ */ e("div", { className: "filter-title", children: i("_accessibility:buttons.filters") }),
399
402
  /* @__PURE__ */ e("ul", { className: "filter-container", children: t.map((o) => /* @__PURE__ */ e("li", { className: "filter-container-item", children: $e(o) }, o.propertyName)) }),
400
403
  /* @__PURE__ */ e("div", { className: "filter-footer", children: /* @__PURE__ */ g("ul", { className: "filter-buttons-row", children: [
401
404
  /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
402
- "button",
405
+ Z,
403
406
  {
404
- onClick: () => u({
405
- type: V.reset,
407
+ type: "button",
408
+ variant: "submit",
409
+ onClick: () => d({
410
+ type: j.reset,
406
411
  filters: t
407
412
  }),
408
- className: "filter-dropdown-button small filter-dropdown-cancel",
413
+ className: "filter-dropdown-button filter-dropdown-cancel",
409
414
  children: i("_accessibility:buttons.clear")
410
415
  }
411
416
  ) }),
412
417
  /* @__PURE__ */ e("li", { children: /* @__PURE__ */ e(
413
- "button",
418
+ Z,
414
419
  {
415
- className: "filter-dropdown-button small filter-dropdown-submit",
420
+ type: "button",
421
+ variant: "submit",
422
+ color: "primary",
423
+ className: "filter-dropdown-button filter-dropdown-submit",
416
424
  onClick: () => {
417
- s(!1), l(a);
425
+ n(!1), l(a);
418
426
  },
419
427
  children: i("_accessibility:buttons.applyFilters")
420
428
  }
421
429
  ) })
422
430
  ] }) })
423
431
  ] }) });
424
- }, _e = () => {
425
- const { t: n } = k(), { total: t, pageSize: r, pageSizes: s, currentPage: l } = D(), a = (l + 1) * r > t ? t : (l + 1) * r;
432
+ }, Oe = () => {
433
+ const { t: s } = $(), { total: t, pageSize: r, pageSizes: n, currentPage: l } = z(), a = (l + 1) * r > t ? t : (l + 1) * r;
426
434
  return /* @__PURE__ */ g("div", { className: "table-navigation-sizes", children: [
427
- s[0] < t && /* @__PURE__ */ e(G, { children: /* @__PURE__ */ g("p", { children: [
435
+ n[0] < t && /* @__PURE__ */ e(X, { children: /* @__PURE__ */ g("p", { children: [
428
436
  l * r + 1,
429
437
  " - ",
430
438
  a,
431
439
  " ",
432
- n("_accessibility:components.table.of")
440
+ s("_accessibility:components.table.of")
433
441
  ] }) }),
434
442
  /* @__PURE__ */ e("p", { children: t })
435
443
  ] });
436
444
  };
437
- function Me() {
438
- const { t: n } = k(), { total: t, pageSize: r, currentPage: s, setCurrentPage: l } = D(), a = w(() => {
439
- const u = Math.ceil(t / r);
440
- return Array.from({ length: u }, (i, d) => ({
441
- id: d,
442
- value: d + 1
445
+ function Pe() {
446
+ const { t: s } = $(), { total: t, pageSize: r, currentPage: n, setCurrentPage: l } = z(), a = w(() => {
447
+ const d = Math.ceil(t / r);
448
+ return Array.from({ length: d }, (i, c) => ({
449
+ id: c,
450
+ value: c + 1
443
451
  }));
444
452
  }, [t, r]);
445
453
  return /* @__PURE__ */ g("div", { className: "jump-to-page", children: [
446
- /* @__PURE__ */ e("p", { children: n("_accessibility:components.table.jumpToPage") }),
454
+ /* @__PURE__ */ e("p", { children: s("_accessibility:components.table.jumpToPage") }),
447
455
  /* @__PURE__ */ e(
448
- Z,
456
+ ee,
449
457
  {
450
- value: s,
458
+ value: n,
451
459
  options: a,
452
460
  inputClassName: "jump-to-page-input",
453
461
  containerClassName: "jump-to-page-input-container",
454
462
  helperTextClassName: "hidden",
455
- onChange: (u) => l(Number(u.target.value))
463
+ onChange: (d) => l(Number(d.target.value))
456
464
  }
457
465
  )
458
466
  ] });
459
467
  }
460
- const Pe = () => {
461
- const { t: n } = k(), { total: t, pageSize: r, currentPage: s, setCurrentPage: l } = D();
468
+ const Me = () => {
469
+ const { t: s } = $(), { total: t, pageSize: r, currentPage: n, setCurrentPage: l } = z(), a = Math.ceil(t / r), d = n < a - 1;
462
470
  return /* @__PURE__ */ g("div", { className: "table-navigation-pages", children: [
463
471
  /* @__PURE__ */ e(
464
472
  q,
465
473
  {
466
- icon: /* @__PURE__ */ e(ue, { className: "table-navigation-icon" }),
474
+ icon: /* @__PURE__ */ e(pe, { className: "table-navigation-icon" }),
467
475
  className: "table-navigation-buttons",
468
- disabled: s === 0,
469
- "aria-label": n("_accessibility:buttons.previous"),
470
- name: n("_accessibility:buttons.previous"),
471
- onClick: () => l(s - 1)
476
+ disabled: n === 0,
477
+ "aria-label": s("_accessibility:buttons.previous"),
478
+ name: s("_accessibility:buttons.previous"),
479
+ onClick: () => l(n - 1)
472
480
  }
473
481
  ),
474
482
  /* @__PURE__ */ e(
475
483
  q,
476
484
  {
477
- icon: /* @__PURE__ */ e(pe, { className: "table-navigation-icon" }),
478
- disabled: Math.floor(t / ((s + 1) * r)) === 0,
485
+ icon: /* @__PURE__ */ e(me, { className: "table-navigation-icon" }),
486
+ disabled: !d,
479
487
  className: "table-navigation-buttons",
480
- name: n("_accessibility:buttons.next"),
481
- "aria-label": n("_accessibility:buttons.next"),
482
- onClick: () => l(s + 1)
488
+ name: s("_accessibility:buttons.next"),
489
+ "aria-label": s("_accessibility:buttons.next"),
490
+ onClick: () => {
491
+ d && l(n + 1);
492
+ }
483
493
  }
484
494
  )
485
495
  ] });
486
496
  };
487
497
  function Ie() {
488
- const { t: n } = k(), { pageSizes: t, pageSize: r, setPageSize: s } = D(), l = w(
498
+ const { t: s } = $(), { pageSizes: t, pageSize: r, setPageSize: n } = z(), l = w(
489
499
  () => t?.map((a) => ({ id: a, value: a })),
490
500
  [t]
491
501
  );
492
502
  return /* @__PURE__ */ g("div", { className: "page-size", children: [
493
- /* @__PURE__ */ e("p", { children: n("_accessibility:components.table.pageSizes") }),
503
+ /* @__PURE__ */ e("p", { children: s("_accessibility:components.table.pageSizes") }),
494
504
  /* @__PURE__ */ e(
495
- Z,
505
+ ee,
496
506
  {
497
507
  value: r,
498
508
  options: l,
499
509
  inputClassName: "page-size-input",
500
510
  containerClassName: "page-size-input-container",
501
511
  helperTextClassName: "hidden",
502
- onChange: (a) => s(Number(a.target.value))
512
+ onChange: (a) => n(Number(a.target.value))
503
513
  }
504
514
  )
505
515
  ] });
506
516
  }
507
- function ze() {
517
+ function De() {
508
518
  return /* @__PURE__ */ g("div", { className: "table-footer", children: [
509
- /* @__PURE__ */ e(Me, {}),
519
+ /* @__PURE__ */ e(Pe, {}),
510
520
  /* @__PURE__ */ e(Ie, {}),
511
- /* @__PURE__ */ e(_e, {}),
512
- /* @__PURE__ */ e(Pe, {})
521
+ /* @__PURE__ */ e(Oe, {}),
522
+ /* @__PURE__ */ e(Me, {})
513
523
  ] });
514
524
  }
515
- const De = (n) => n, Le = (n) => {
516
- const { t } = k(), {
525
+ const ze = (s) => s, Le = (s) => {
526
+ const { t } = $(), {
517
527
  columns: r,
518
- softDeleteProperty: s = "deletedAt",
528
+ softDeleteProperty: n = "deletedAt",
519
529
  data: l,
520
530
  actions: a,
521
- selectedRows: u,
531
+ selectedRows: d,
522
532
  expandedRows: i = [],
523
- onRowSelectionChange: d,
533
+ onRowSelectionChange: c,
524
534
  onRowExpand: o
525
- } = n, m = w(
526
- () => se(r),
535
+ } = s, m = w(
536
+ () => re(r),
527
537
  [r]
528
538
  ), h = w(
529
539
  () => new Map(
@@ -532,58 +542,72 @@ const De = (n) => n, Le = (n) => {
532
542
  [i]
533
543
  );
534
544
  return l?.map((f) => {
535
- const c = u.has(f.id), S = h.get(f.id), A = !!S, U = m.length + 1 + (a ? 1 : 0);
536
- return /* @__PURE__ */ g(ae, { children: [
545
+ const u = d.has(f.id), S = h.get(f.id), T = !!S, U = m.length + 1 + (a ? 1 : 0);
546
+ return /* @__PURE__ */ g(oe, { children: [
537
547
  /* @__PURE__ */ g(
538
548
  "tr",
539
549
  {
540
- className: `table-row ${o ? "expandable" : ""} ${f[s] ? "deleted-class" : ""} ${c ? "selected" : ""} ${A ? "expanded" : ""}`,
550
+ className: `table-row ${o ? "expandable" : ""} ${f[n] ? "deleted-class" : ""} ${u ? "selected" : ""} ${T ? "expanded" : ""}`,
541
551
  onClick: () => o?.(f),
542
552
  children: [
543
553
  /* @__PURE__ */ e("td", { className: "table-row-cell table-row-checkbox", children: /* @__PURE__ */ e(
544
554
  "input",
545
555
  {
546
556
  type: "checkbox",
547
- checked: c,
548
- onClick: (x) => x.stopPropagation(),
549
- onChange: () => d(f),
557
+ checked: u,
558
+ onClick: (v) => v.stopPropagation(),
559
+ onChange: () => c(f),
550
560
  "aria-label": t("_accessibility:components.table.selectRow")
551
561
  }
552
562
  ) }),
553
563
  a ? /* @__PURE__ */ e("td", { className: "w-px", children: /* @__PURE__ */ e("div", { className: "table-row-cell-action", children: (() => {
554
- const x = a(f).filter(
564
+ const v = a(f).filter(
555
565
  (N) => !N.hidden
556
- ), I = x.filter(
566
+ ), P = v.filter(
557
567
  (N) => N.sticky
558
- ), $ = x.filter(
568
+ ), A = v.filter(
559
569
  (N) => !N.sticky
560
570
  );
561
- return /* @__PURE__ */ g(G, { children: [
562
- I.map((N) => /* @__PURE__ */ e(ne, { content: N.tooltip, children: /* @__PURE__ */ e(
571
+ return /* @__PURE__ */ g(X, { children: [
572
+ P.map((N) => /* @__PURE__ */ e(le, { content: N.tooltip, children: /* @__PURE__ */ e(
563
573
  q,
564
574
  {
565
575
  icon: N.icon,
566
576
  className: "row-table-action",
567
- onClick: (O) => {
568
- O.stopPropagation(), N.onClick(f);
577
+ onClick: (_) => {
578
+ _.stopPropagation(), N.onClick(f);
569
579
  }
570
580
  }
571
581
  ) }, N.id)),
572
- $.length > 0 && /* @__PURE__ */ e(ve, { actions: $ })
582
+ A.length > 0 && /* @__PURE__ */ e(ve, { actions: A })
573
583
  ] });
574
584
  })() }) }) : null,
575
- m?.map((x, I) => /* @__PURE__ */ e(
576
- "td",
577
- {
578
- className: `table-row-cell ${I === 0 ? "basic" : ""} ${x.className ?? ""}`,
579
- children: x.renderBody ? x.renderBody(f[x.key], f) : De(f[x.key])
580
- },
581
- x.key
582
- ))
585
+ m?.map((v, P) => {
586
+ const A = f[v.key], N = v.renderBody ? v.renderBody(A, f) : ze(A);
587
+ return /* @__PURE__ */ e(
588
+ "td",
589
+ {
590
+ className: `table-row-cell ${P === 0 ? "basic" : ""} ${v.className ?? ""}`,
591
+ children: o && P === 0 ? /* @__PURE__ */ g("div", { className: "table-row-expand-content", children: [
592
+ /* @__PURE__ */ e(
593
+ "span",
594
+ {
595
+ className: "table-row-expand-indicator",
596
+ "aria-hidden": !0,
597
+ "data-state": T ? "expanded" : "collapsed",
598
+ children: T ? /* @__PURE__ */ e(se, { className: "table-row-expand-chevron" }) : /* @__PURE__ */ e(ae, { className: "table-row-expand-chevron" })
599
+ }
600
+ ),
601
+ /* @__PURE__ */ e("div", { className: "table-row-expand-value", children: N })
602
+ ] }) : N
603
+ },
604
+ v.key
605
+ );
606
+ })
583
607
  ]
584
608
  }
585
609
  ),
586
- A && S?.content !== null && typeof S?.content < "u" && /* @__PURE__ */ e("tr", { className: "table-row-expanded", children: /* @__PURE__ */ e("td", { className: "table-row-expanded-cell", colSpan: U, children: /* @__PURE__ */ e(
610
+ T && S?.content !== null && typeof S?.content < "u" && /* @__PURE__ */ e("tr", { className: "table-row-expanded", children: /* @__PURE__ */ e("td", { className: "table-row-expanded-cell", colSpan: U, children: /* @__PURE__ */ e(
587
611
  "div",
588
612
  {
589
613
  className: `table-row-expanded-content ${S.isVisible ? "open" : "closed"}`,
@@ -593,18 +617,18 @@ const De = (n) => n, Le = (n) => {
593
617
  ] }, f.id);
594
618
  });
595
619
  };
596
- function je() {
597
- const { t: n } = k();
598
- return /* @__PURE__ */ e("div", { className: "table-empty", children: /* @__PURE__ */ e("p", { children: n("_accessibility:components.table.empty") }) });
620
+ function Ve() {
621
+ const { t: s } = $();
622
+ return /* @__PURE__ */ e("div", { className: "table-empty", children: /* @__PURE__ */ e("p", { children: s("_accessibility:components.table.empty") }) });
599
623
  }
600
- const Ve = (n) => {
601
- const { columns: t, title: r, isLoading: s, toolbar: l, filterOptions: a } = n, { countOfFilters: u } = D(), { t: i } = k(), d = w(() => t ? t.sort((c, S) => (S.pos ?? 0) - (c.pos ?? 0)).filter((c) => !!c.filterOptions).map((c) => ({
602
- ...c.filterOptions,
603
- label: c.filterOptions?.label ?? c.label,
604
- propertyName: c.key
605
- })) : [], [t]), [o, m] = _(!1), h = v(
606
- (c) => {
607
- a?.dropdown?.setOpened ? a.dropdown.setOpened(c ?? !1) : m(c ?? !1);
624
+ const je = (s) => {
625
+ const { columns: t, title: r, isLoading: n, toolbar: l, filterOptions: a } = s, { countOfFilters: d } = z(), { t: i } = $(), c = w(() => t ? [...t].sort((u, S) => (S.pos ?? 0) - (u.pos ?? 0)).filter((u) => !!u.filterOptions).map((u) => ({
626
+ ...u.filterOptions,
627
+ label: u.filterOptions?.label ?? u.label,
628
+ propertyName: u.key
629
+ })) : [], [t]), [o, m] = O(!1), h = x(
630
+ (u) => {
631
+ a?.dropdown?.setOpened ? a.dropdown.setOpened(u ?? !1) : m(u ?? !1);
608
632
  },
609
633
  [a]
610
634
  ), f = w(
@@ -614,22 +638,22 @@ const Ve = (n) => {
614
638
  return /* @__PURE__ */ g("div", { className: `table-header ${f ? "showing-filters" : ""}`, children: [
615
639
  /* @__PURE__ */ g("div", { children: [
616
640
  r && /* @__PURE__ */ e("h1", { className: "table-header-title", children: r }),
617
- s ? null : /* @__PURE__ */ g("div", { className: "table-header-content", children: [
641
+ n ? null : /* @__PURE__ */ g("div", { className: "table-header-content", children: [
618
642
  l,
619
643
  a?.button?.hide !== !0 && /* @__PURE__ */ g(
620
644
  q,
621
645
  {
622
- icon: a?.button?.icon ?? /* @__PURE__ */ e(me, { className: "filter-dropdown-trigger-icon" }),
646
+ icon: a?.button?.icon ?? /* @__PURE__ */ e(he, { className: "filter-dropdown-trigger-icon" }),
623
647
  className: "filter-dropdown-button normal filter-dropdown-trigger",
624
648
  "aria-haspopup": "true",
625
649
  onClick: () => h(!f),
626
650
  "aria-expanded": f,
627
651
  children: [
628
652
  /* @__PURE__ */ e(
629
- ie,
653
+ de,
630
654
  {
631
- count: u,
632
- className: `${u > 0 ? "show" : "hide"} `
655
+ count: d,
656
+ className: `${d > 0 ? "show" : "hide"} `
633
657
  }
634
658
  ),
635
659
  /* @__PURE__ */ e("span", { className: "table-header-sr", children: i("_accessibility:buttons.filters") }),
@@ -639,27 +663,27 @@ const Ve = (n) => {
639
663
  )
640
664
  ] })
641
665
  ] }),
642
- !!d && !!d.length && /* @__PURE__ */ e(
643
- Oe,
666
+ !!c && !!c.length && /* @__PURE__ */ e(
667
+ _e,
644
668
  {
645
- filters: d,
669
+ filters: c,
646
670
  show: f,
647
671
  handleShow: h,
648
672
  options: a
649
673
  }
650
674
  ),
651
- /* @__PURE__ */ e(Te, { filtersDefinition: d })
675
+ /* @__PURE__ */ e(Te, { filtersDefinition: c })
652
676
  ] });
653
677
  };
654
678
  function Ue({
655
- count: n,
679
+ count: s,
656
680
  multiActions: t,
657
681
  onActionClick: r
658
682
  }) {
659
- const { t: s } = k();
683
+ const { t: n } = $();
660
684
  return /* @__PURE__ */ g("div", { className: "table-selection-bar", children: [
661
- /* @__PURE__ */ e("p", { className: "table-selection-bar-count", children: s("_accessibility:components.table.selectedCount", { count: n }) }),
662
- t.length > 0 && /* @__PURE__ */ e("div", { className: "table-selection-bar-actions", children: t.map((l) => /* @__PURE__ */ e(ne, { content: l.tooltip, children: /* @__PURE__ */ e(
685
+ /* @__PURE__ */ e("p", { className: "table-selection-bar-count", children: n("_accessibility:components.table.selectedCount", { count: s }) }),
686
+ t.length > 0 && /* @__PURE__ */ e("div", { className: "table-selection-bar-actions", children: t.map((l) => /* @__PURE__ */ e(le, { content: l.tooltip, children: /* @__PURE__ */ e(
663
687
  q,
664
688
  {
665
689
  icon: l.icon,
@@ -672,127 +696,127 @@ function Ue({
672
696
  }
673
697
  const Q = 220;
674
698
  function Be({
675
- data: n,
699
+ data: s,
676
700
  allowMultipleExpandedRows: t,
677
701
  controlledExpandedRowId: r,
678
- onExpandedRowChange: s,
702
+ onExpandedRowChange: n,
679
703
  onRowExpand: l,
680
704
  findRowById: a
681
705
  }) {
682
- const [u, i] = _(null), [d, o] = _(null), [m, h] = _(null), [f, c] = _(null), [S, A] = _(!1), [U, x] = _(/* @__PURE__ */ new Set()), [I, $] = _([]), N = j(null), O = j(null), z = j(/* @__PURE__ */ new Map()), E = typeof r < "u", F = t && !E, y = E ? r ?? null : u, B = v(() => {
683
- O.current && (clearTimeout(O.current), O.current = null);
684
- }, []), T = v(
706
+ const [d, i] = O(null), [c, o] = O(null), [m, h] = O(null), [f, u] = O(null), [S, T] = O(!1), [U, v] = O(/* @__PURE__ */ new Set()), [P, A] = O([]), N = V(null), _ = V(null), D = V(/* @__PURE__ */ new Map()), F = typeof r < "u", k = t && !F, y = F ? r ?? null : d, B = x(() => {
707
+ _.current && (clearTimeout(_.current), _.current = null);
708
+ }, []), E = x(
685
709
  (p) => {
686
710
  if (typeof p < "u") {
687
- const b = z.current.get(p);
711
+ const b = D.current.get(p);
688
712
  if (!b) return;
689
- clearTimeout(b), z.current.delete(p);
713
+ clearTimeout(b), D.current.delete(p);
690
714
  return;
691
715
  }
692
- z.current.forEach(
716
+ D.current.forEach(
693
717
  (b) => clearTimeout(b)
694
- ), z.current.clear();
718
+ ), D.current.clear();
695
719
  },
696
720
  []
697
- ), J = v(
721
+ ), G = x(
698
722
  (p) => {
699
- T(p), $((b) => b.some(
723
+ E(p), A((b) => b.some(
700
724
  (R) => R.rowId === p
701
725
  ) ? b.map(
702
726
  (R) => R.rowId === p ? { ...R, isVisible: !1 } : R
703
- ) : b), z.current.set(
727
+ ) : b), D.current.set(
704
728
  p,
705
729
  setTimeout(() => {
706
- $(
730
+ A(
707
731
  (b) => b.filter((C) => C.rowId !== p)
708
- ), z.current.delete(p);
732
+ ), D.current.delete(p);
709
733
  }, Q)
710
734
  );
711
735
  },
712
- [T]
713
- ), K = v(
736
+ [E]
737
+ ), K = x(
714
738
  (p, b) => {
715
- T(p), $((C) => C.some(
739
+ E(p), A((C) => C.some(
716
740
  (M) => M.rowId === p
717
741
  ) ? C.map(
718
742
  (M) => M.rowId === p ? { ...M, content: b, isVisible: !1 } : M
719
743
  ) : [...C, { rowId: p, content: b, isVisible: !1 }]), requestAnimationFrame(() => {
720
- $(
744
+ A(
721
745
  (C) => C.map(
722
746
  (R) => R.rowId === p ? { ...R, isVisible: !0 } : R
723
747
  )
724
748
  );
725
749
  });
726
750
  },
727
- [T]
751
+ [E]
728
752
  );
729
- P(() => {
730
- if (!F) return;
731
- const p = new Set(n.map((b) => b.id));
732
- x((b) => {
753
+ I(() => {
754
+ if (!k) return;
755
+ const p = new Set(s.map((b) => b.id));
756
+ v((b) => {
733
757
  const C = /* @__PURE__ */ new Set();
734
758
  return b.forEach((R) => {
735
759
  if (p.has(R)) {
736
760
  C.add(R);
737
761
  return;
738
762
  }
739
- T(R);
763
+ E(R);
740
764
  }), C;
741
- }), $((b) => (b.forEach((C) => {
742
- p.has(C.rowId) || T(C.rowId);
765
+ }), A((b) => (b.forEach((C) => {
766
+ p.has(C.rowId) || E(C.rowId);
743
767
  }), b.filter(
744
768
  (C) => p.has(C.rowId)
745
769
  )));
746
- }, [n, F, T]), P(() => {
747
- if (F) return;
770
+ }, [s, k, E]), I(() => {
771
+ if (k) return;
748
772
  if (y === null) {
749
- o(null), E && (N.current = null);
773
+ o(null), F && (N.current = null);
750
774
  return;
751
775
  }
752
- a(y) || (E || i(null), o(null), E && (N.current = null));
776
+ a(y) || (F || i(null), o(null), F && (N.current = null));
753
777
  }, [
754
- n,
778
+ s,
755
779
  y,
756
780
  a,
757
- E,
758
- F
759
- ]), P(() => {
760
- if (!F) {
761
- if (B(), y === null || d === null) {
781
+ F,
782
+ k
783
+ ]), I(() => {
784
+ if (!k) {
785
+ if (B(), y === null || c === null) {
762
786
  if (m === null) {
763
- A(!1), c(null);
787
+ T(!1), u(null);
764
788
  return;
765
789
  }
766
- A(!1), O.current = setTimeout(() => {
767
- h(null), c(null), O.current = null;
790
+ T(!1), _.current = setTimeout(() => {
791
+ h(null), u(null), _.current = null;
768
792
  }, Q);
769
793
  return;
770
794
  }
771
795
  if (m === null) {
772
- h(y), c(d), requestAnimationFrame(() => A(!0));
796
+ h(y), u(c), requestAnimationFrame(() => T(!0));
773
797
  return;
774
798
  }
775
799
  if (m === y) {
776
- c(d), requestAnimationFrame(() => A(!0));
800
+ u(c), requestAnimationFrame(() => T(!0));
777
801
  return;
778
802
  }
779
- A(!1), O.current = setTimeout(() => {
780
- h(y), c(d), requestAnimationFrame(() => A(!0)), O.current = null;
803
+ T(!1), _.current = setTimeout(() => {
804
+ h(y), u(c), requestAnimationFrame(() => T(!0)), _.current = null;
781
805
  }, Q);
782
806
  }
783
807
  }, [
784
808
  B,
785
- d,
809
+ c,
786
810
  y,
787
- F,
811
+ k,
788
812
  m
789
- ]), P(
813
+ ]), I(
790
814
  () => () => {
791
- B(), T();
815
+ B(), E();
792
816
  },
793
- [B, T]
794
- ), P(() => {
795
- if (!E) return;
817
+ [B, E]
818
+ ), I(() => {
819
+ if (!F) return;
796
820
  if (y === null) {
797
821
  o(null), N.current = null;
798
822
  return;
@@ -804,52 +828,52 @@ function Be({
804
828
  }
805
829
  const b = N.current;
806
830
  o(l?.(p, b) ?? null), N.current = p;
807
- }, [y, a, E, l]);
808
- const le = v(
831
+ }, [y, a, F, l]);
832
+ const ie = x(
809
833
  (p) => {
810
- if (F) {
834
+ if (k) {
811
835
  if (U.has(p.id)) {
812
- x((X) => {
813
- const L = new Set(X);
836
+ v((J) => {
837
+ const L = new Set(J);
814
838
  return L.delete(p.id), L;
815
- }), J(p.id), s?.(null, p);
839
+ }), G(p.id), n?.(null, p);
816
840
  return;
817
841
  }
818
- x((X) => {
819
- const L = new Set(X);
842
+ v((J) => {
843
+ const L = new Set(J);
820
844
  return L.add(p.id), L;
821
845
  });
822
846
  const M = l?.(p, null) ?? null;
823
- M !== null && typeof M < "u" ? K(p.id, M) : (T(p.id), $(
824
- (X) => X.filter((L) => L.rowId !== p.id)
825
- )), s?.(p, null);
847
+ M !== null && typeof M < "u" ? K(p.id, M) : (E(p.id), A(
848
+ (J) => J.filter((L) => L.rowId !== p.id)
849
+ )), n?.(p, null);
826
850
  return;
827
851
  }
828
852
  const b = y === p.id, C = b ? p : a(y);
829
- if (E) {
830
- s?.(b ? null : p, C);
853
+ if (F) {
854
+ n?.(b ? null : p, C);
831
855
  return;
832
856
  }
833
857
  if (b) {
834
- i(null), o(null), s?.(null, p);
858
+ i(null), o(null), n?.(null, p);
835
859
  return;
836
860
  }
837
- i(p.id), o(l?.(p, C) ?? null), s?.(p, C);
861
+ i(p.id), o(l?.(p, C) ?? null), n?.(p, C);
838
862
  },
839
863
  [
840
864
  y,
841
- J,
842
- T,
865
+ G,
866
+ E,
843
867
  K,
844
868
  a,
845
869
  U,
846
- E,
847
870
  F,
848
- s,
871
+ k,
872
+ n,
849
873
  l
850
874
  ]
851
875
  );
852
- return { expandedRowsToRender: w(() => F ? I : m === null || f === null || typeof f > "u" ? [] : [
876
+ return { expandedRowsToRender: w(() => k ? P : m === null || f === null || typeof f > "u" ? [] : [
853
877
  {
854
878
  rowId: m,
855
879
  content: f,
@@ -857,27 +881,27 @@ function Be({
857
881
  }
858
882
  ], [
859
883
  S,
860
- F,
884
+ k,
861
885
  f,
862
886
  m,
863
- I
864
- ]), onRowExpandChange: le };
887
+ P
888
+ ]), onRowExpandChange: ie };
865
889
  }
866
890
  function We({
867
- actions: n,
891
+ actions: s,
868
892
  selectedRowsData: t
869
893
  }) {
870
- const r = w(() => !n || !t.length ? [] : t.reduce(
871
- (l, a, u) => {
872
- const i = n(a).filter(
894
+ const r = w(() => !s || !t.length ? [] : t.reduce(
895
+ (l, a, d) => {
896
+ const i = s(a).filter(
873
897
  (o) => o.multiple && !o.hidden
874
898
  );
875
- if (u === 0) return i;
876
- const d = new Map(
899
+ if (d === 0) return i;
900
+ const c = new Map(
877
901
  l.map((o) => [o.id, o])
878
902
  );
879
903
  return i.reduce((o, m) => {
880
- const h = d.get(m.id);
904
+ const h = c.get(m.id);
881
905
  return h && o.push({
882
906
  ...h,
883
907
  ...m,
@@ -886,7 +910,7 @@ function We({
886
910
  }, []);
887
911
  },
888
912
  []
889
- ), [n, t]), s = v(
913
+ ), [s, t]), n = x(
890
914
  (l) => {
891
915
  if (t.length) {
892
916
  if (l.onMultipleClick) {
@@ -898,32 +922,32 @@ function We({
898
922
  },
899
923
  [t]
900
924
  );
901
- return { multiActions: r, handleMultipleActionClick: s };
925
+ return { multiActions: r, handleMultipleActionClick: n };
902
926
  }
903
927
  function qe({
904
- data: n,
928
+ data: s,
905
929
  onRowSelect: t,
906
930
  onSelectedRowsChange: r
907
931
  }) {
908
- const [s, l] = _(/* @__PURE__ */ new Set()), a = w(
909
- () => n?.filter((o) => s.has(o.id)) ?? [],
910
- [n, s]
932
+ const [n, l] = O(/* @__PURE__ */ new Set()), a = w(
933
+ () => s?.filter((o) => n.has(o.id)) ?? [],
934
+ [s, n]
911
935
  );
912
- P(() => {
913
- if (!n?.length) {
936
+ I(() => {
937
+ if (!s?.length) {
914
938
  l(/* @__PURE__ */ new Set());
915
939
  return;
916
940
  }
917
941
  l((o) => {
918
- const m = /* @__PURE__ */ new Set(), h = new Set(n.map((f) => f.id));
942
+ const m = /* @__PURE__ */ new Set(), h = new Set(s.map((f) => f.id));
919
943
  return o.forEach((f) => {
920
944
  h.has(f) && m.add(f);
921
945
  }), m;
922
946
  });
923
- }, [n]), P(() => {
947
+ }, [s]), I(() => {
924
948
  r && r(a);
925
949
  }, [a, r]);
926
- const u = v(
950
+ const d = x(
927
951
  (o) => {
928
952
  l((m) => {
929
953
  const h = new Set(m);
@@ -931,89 +955,89 @@ function qe({
931
955
  });
932
956
  },
933
957
  [t]
934
- ), i = v(() => {
958
+ ), i = x(() => {
935
959
  l((o) => {
936
- const m = new Set(o), h = n ?? [], f = h.every(
937
- (c) => m.has(c.id)
960
+ const m = new Set(o), h = s ?? [], f = h.every(
961
+ (u) => m.has(u.id)
938
962
  );
939
- return h.forEach((c) => {
940
- const S = m.has(c.id);
941
- f ? S && (m.delete(c.id), t?.(c, !1)) : S || (m.add(c.id), t?.(c, !0));
963
+ return h.forEach((u) => {
964
+ const S = m.has(u.id);
965
+ f ? S && (m.delete(u.id), t?.(u, !1)) : S || (m.add(u.id), t?.(u, !0));
942
966
  }), m;
943
967
  });
944
- }, [n, t]), d = w(() => {
945
- if (!n?.length)
968
+ }, [s, t]), c = w(() => {
969
+ if (!s?.length)
946
970
  return { allSelected: !1, hasSomeSelected: !1 };
947
- const o = n.every((h) => s.has(h.id)), m = n.some((h) => s.has(h.id));
971
+ const o = s.every((h) => n.has(h.id)), m = s.some((h) => n.has(h.id));
948
972
  return { allSelected: o, hasSomeSelected: m };
949
- }, [n, s]);
973
+ }, [s, n]);
950
974
  return {
951
- selectedRows: s,
975
+ selectedRows: n,
952
976
  selectedRowsData: a,
953
- selectionState: d,
954
- onRowSelectionChange: u,
977
+ selectionState: c,
978
+ onRowSelectionChange: d,
955
979
  onToggleAllRows: i
956
980
  };
957
981
  }
958
- function dt(n) {
982
+ function dt(s) {
959
983
  const {
960
984
  data: t,
961
985
  onSort: r,
962
- entity: s = "",
986
+ entity: n = "",
963
987
  isLoading: l = !1,
964
988
  actions: a,
965
- columns: u = [],
989
+ columns: d = [],
966
990
  contentClassName: i = "",
967
- className: d = "",
991
+ className: c = "",
968
992
  softDeleteProperty: o = "deletedAt",
969
993
  onRowSelect: m,
970
994
  onSelectedRowsChange: h,
971
995
  allowMultipleExpandedRows: f = !1,
972
- expandedRowId: c,
996
+ expandedRowId: u,
973
997
  onExpandedRowChange: S,
974
- onRowExpand: A,
998
+ onRowExpand: T,
975
999
  ...U
976
- } = n, x = w(() => !t?.length, [t]), I = v(
977
- (J) => J === null ? null : t.find((K) => K.id === J) ?? null,
1000
+ } = s, v = w(() => !t?.length, [t]), P = x(
1001
+ (G) => G === null ? null : t.find((K) => K.id === G) ?? null,
978
1002
  [t]
979
1003
  ), {
980
- selectedRows: $,
1004
+ selectedRows: A,
981
1005
  selectedRowsData: N,
982
- selectionState: O,
983
- onRowSelectionChange: z,
984
- onToggleAllRows: E
985
- } = qe({ data: t, onRowSelect: m, onSelectedRowsChange: h }), { expandedRowsToRender: F, onRowExpandChange: y } = Be({
1006
+ selectionState: _,
1007
+ onRowSelectionChange: D,
1008
+ onToggleAllRows: F
1009
+ } = qe({ data: t, onRowSelect: m, onSelectedRowsChange: h }), { expandedRowsToRender: k, onRowExpandChange: y } = Be({
986
1010
  data: t,
987
1011
  allowMultipleExpandedRows: f,
988
- controlledExpandedRowId: c,
1012
+ controlledExpandedRowId: u,
989
1013
  onExpandedRowChange: S,
990
- onRowExpand: A,
991
- findRowById: I
992
- }), { multiActions: B, handleMultipleActionClick: T } = We({
1014
+ onRowExpand: T,
1015
+ findRowById: P
1016
+ }), { multiActions: B, handleMultipleActionClick: E } = We({
993
1017
  actions: a,
994
1018
  selectedRowsData: N
995
1019
  });
996
- return /* @__PURE__ */ e(re, { children: /* @__PURE__ */ g("div", { className: `${d} table-main`, children: [
997
- /* @__PURE__ */ e(Ve, { columns: u, isLoading: l, ...U }),
998
- l ? /* @__PURE__ */ e(Ce, { className: "table-loading" }) : /* @__PURE__ */ e(G, { children: x ? /* @__PURE__ */ e(je, {}) : /* @__PURE__ */ g(G, { children: [
1020
+ return /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ g("div", { className: `${c} table-main`, children: [
1021
+ /* @__PURE__ */ e(je, { columns: d, isLoading: l, ...U }),
1022
+ l ? /* @__PURE__ */ e(Ce, { className: "table-loading" }) : /* @__PURE__ */ e(X, { children: v ? /* @__PURE__ */ e(Ve, {}) : /* @__PURE__ */ g(X, { children: [
999
1023
  !!N.length && /* @__PURE__ */ e(
1000
1024
  Ue,
1001
1025
  {
1002
1026
  count: N.length,
1003
1027
  multiActions: B,
1004
- onActionClick: T
1028
+ onActionClick: E
1005
1029
  }
1006
1030
  ),
1007
1031
  /* @__PURE__ */ e("div", { className: `${i} table-body`, children: /* @__PURE__ */ g("table", { className: "table-content", children: [
1008
1032
  /* @__PURE__ */ e(
1009
1033
  ye,
1010
1034
  {
1011
- entity: s,
1012
- columns: u,
1035
+ entity: n,
1036
+ columns: d,
1013
1037
  onSortCallback: r,
1014
1038
  hasAction: !!a,
1015
- selectionState: O,
1016
- onToggleAllRows: E
1039
+ selectionState: _,
1040
+ onToggleAllRows: F
1017
1041
  }
1018
1042
  ),
1019
1043
  /* @__PURE__ */ e("tbody", { children: /* @__PURE__ */ e(
@@ -1021,32 +1045,32 @@ function dt(n) {
1021
1045
  {
1022
1046
  data: t,
1023
1047
  actions: a,
1024
- columns: u,
1048
+ columns: d,
1025
1049
  softDeleteProperty: o,
1026
- selectedRows: $,
1027
- expandedRows: F,
1028
- onRowSelectionChange: z,
1029
- onRowExpand: A ? y : void 0
1050
+ selectedRows: A,
1051
+ expandedRows: k,
1052
+ onRowSelectionChange: D,
1053
+ onRowExpand: T ? y : void 0
1030
1054
  }
1031
1055
  ) })
1032
1056
  ] }) }),
1033
- /* @__PURE__ */ e(ze, {})
1057
+ /* @__PURE__ */ e(De, {})
1034
1058
  ] }) })
1035
1059
  ] }) });
1036
1060
  }
1037
1061
  export {
1038
1062
  Te as A,
1039
1063
  ye as C,
1040
- Oe as F,
1041
- Pe as N,
1064
+ _e as F,
1065
+ Me as N,
1042
1066
  Ie as P,
1043
1067
  Re as R,
1044
- je as T,
1068
+ Ve as T,
1045
1069
  Se as a,
1046
- _e as b,
1047
- ze as c,
1070
+ Oe as b,
1071
+ De as c,
1048
1072
  Le as d,
1049
- Ve as e,
1073
+ je as e,
1050
1074
  Ue as f,
1051
1075
  dt as g,
1052
1076
  we as h,