@sito/dashboard 0.0.36 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dashboard.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import "./main.css";
2
- import { jsx as t, jsxs as b, Fragment as D } from "react/jsx-runtime";
3
- import { forwardRef as j, useEffect as M, useState as P, useRef as W, useCallback as k, createContext as H, useContext as q, useReducer as ne, useMemo as C } from "react";
2
+ import { jsx as t, jsxs as v, Fragment as D } from "react/jsx-runtime";
3
+ import { forwardRef as I, useState as P, useRef as M, useEffect as H, useCallback as S, createContext as W, useContext as V, useReducer as ae, useMemo as y } from "react";
4
4
  function se(e) {
5
- const { className: s = "" } = e;
5
+ const { className: a = "" } = e;
6
6
  return /* @__PURE__ */ t(
7
7
  "svg",
8
8
  {
9
- className: s,
9
+ className: a,
10
10
  xmlns: "http://www.w3.org/2000/svg",
11
11
  viewBox: "0 0 512 512",
12
12
  fill: "currentColor",
@@ -14,12 +14,12 @@ function se(e) {
14
14
  }
15
15
  );
16
16
  }
17
- function ae(e) {
18
- const { className: s = "" } = e;
17
+ function re(e) {
18
+ const { className: a = "" } = e;
19
19
  return /* @__PURE__ */ t(
20
20
  "svg",
21
21
  {
22
- className: s,
22
+ className: a,
23
23
  xmlns: "http://www.w3.org/2000/svg",
24
24
  viewBox: "0 0 512 512",
25
25
  fill: "currentColor",
@@ -27,12 +27,12 @@ function ae(e) {
27
27
  }
28
28
  );
29
29
  }
30
- function re(e) {
31
- const { className: s = "" } = e;
30
+ function le(e) {
31
+ const { className: a = "" } = e;
32
32
  return /* @__PURE__ */ t(
33
33
  "svg",
34
34
  {
35
- className: s,
35
+ className: a,
36
36
  xmlns: "http://www.w3.org/2000/svg",
37
37
  viewBox: "0 0 320 512",
38
38
  fill: "currentColor",
@@ -40,12 +40,12 @@ function re(e) {
40
40
  }
41
41
  );
42
42
  }
43
- function le(e) {
44
- const { className: s = "" } = e;
43
+ function oe(e) {
44
+ const { className: a = "" } = e;
45
45
  return /* @__PURE__ */ t(
46
46
  "svg",
47
47
  {
48
- className: s,
48
+ className: a,
49
49
  xmlns: "http://www.w3.org/2000/svg",
50
50
  viewBox: "0 0 320 512",
51
51
  fill: "currentColor",
@@ -53,16 +53,16 @@ function le(e) {
53
53
  }
54
54
  );
55
55
  }
56
- const oe = (e) => {
57
- const { className: s = "" } = e;
58
- return /* @__PURE__ */ t("svg", { className: s, viewBox: "0 0 16 16", children: /* @__PURE__ */ t("path", { d: "M9 15H7a1 1 0 010-2h2a1 1 0 010 2zM11 11H5a1 1 0 010-2h6a1 1 0 010 2zM13 7H3a1 1 0 010-2h10a1 1 0 010 2zM15 3H1a1 1 0 010-2h14a1 1 0 010 2z" }) });
56
+ const ce = (e) => {
57
+ const { className: a = "" } = e;
58
+ return /* @__PURE__ */ t("svg", { className: a, viewBox: "0 0 16 16", children: /* @__PURE__ */ t("path", { d: "M9 15H7a1 1 0 010-2h2a1 1 0 010 2zM11 11H5a1 1 0 010-2h6a1 1 0 010 2zM13 7H3a1 1 0 010-2h10a1 1 0 010 2zM15 3H1a1 1 0 010-2h14a1 1 0 010 2z" }) });
59
59
  };
60
60
  function K(e) {
61
- const { className: s = "" } = e;
61
+ const { className: a = "" } = e;
62
62
  return /* @__PURE__ */ t(
63
63
  "svg",
64
64
  {
65
- className: s,
65
+ className: a,
66
66
  xmlns: "http://www.w3.org/2000/svg",
67
67
  viewBox: "0 0 384 512",
68
68
  fill: "currentColor",
@@ -70,7 +70,7 @@ function K(e) {
70
70
  }
71
71
  );
72
72
  }
73
- var R = /* @__PURE__ */ ((e) => (e.error = "error", e.good = "good", e.default = "default", e))(R || {});
73
+ var U = /* @__PURE__ */ ((e) => (e.error = "error", e.good = "good", e.default = "default", e))(U || {});
74
74
  const Q = (e) => {
75
75
  switch (e) {
76
76
  case "error":
@@ -80,7 +80,7 @@ const Q = (e) => {
80
80
  default:
81
81
  return "input-normal";
82
82
  }
83
- }, V = (e) => {
83
+ }, X = (e) => {
84
84
  switch (e) {
85
85
  case "error":
86
86
  return "input-label-error";
@@ -89,7 +89,7 @@ const Q = (e) => {
89
89
  default:
90
90
  return "input-label-normal";
91
91
  }
92
- }, X = (e) => {
92
+ }, Y = (e) => {
93
93
  switch (e) {
94
94
  case "error":
95
95
  return "input-helper-text-error";
@@ -99,100 +99,99 @@ const Q = (e) => {
99
99
  return "input-helper-text-normal";
100
100
  }
101
101
  };
102
- const J = j(function(e, s) {
102
+ const q = I(function(e, a) {
103
103
  const {
104
104
  value: r,
105
105
  onChange: n,
106
- options: a,
106
+ options: s,
107
107
  containerClassName: l = "",
108
108
  inputClassName: o = "",
109
109
  labelClassName: c = "",
110
110
  helperText: i = "",
111
- helperTextClassName: m = "",
112
- placeholder: d = "",
113
- label: u = "",
114
- name: f = "",
115
- id: h = "",
116
- state: p = R.default,
117
- ...v
111
+ helperTextClassName: N = "",
112
+ placeholder: u = "",
113
+ label: h = "",
114
+ name: m = "",
115
+ id: d = "",
116
+ state: p = U.default,
117
+ children: g,
118
+ ...C
118
119
  } = e;
119
- return M(() => {
120
- var N;
121
- (!r || r === "") && (a != null && a.length) && n({ target: { value: (N = a[0]) == null ? void 0 : N.id } });
122
- }, [n, a, r]), /* @__PURE__ */ b("div", { className: `select-input-container ${l}`, children: [
120
+ return /* @__PURE__ */ v("div", { className: `select-input-container ${l}`, children: [
123
121
  /* @__PURE__ */ t(
124
122
  "select",
125
123
  {
126
- ...v,
127
- id: h,
128
- ref: s,
129
- name: f,
124
+ ...C,
125
+ id: d,
126
+ ref: a,
127
+ name: m,
130
128
  value: r,
131
129
  onChange: n,
132
130
  className: `select-input ${Q(p)} peer ${o}`,
133
- children: a == null ? void 0 : a.map((N) => /* @__PURE__ */ t("option", { value: N.id, children: N.value ?? N.name ?? N.id }, N.id))
131
+ children: s == null ? void 0 : s.map((f) => /* @__PURE__ */ t("option", { value: f.id, children: f.value ?? f.name ?? f.id }, f.id))
134
132
  }
135
133
  ),
136
134
  /* @__PURE__ */ t(
137
135
  "label",
138
136
  {
139
- htmlFor: f,
140
- className: `select-input-label ${V(p)} ${c}`,
141
- children: u
137
+ htmlFor: m,
138
+ className: `select-input-label ${X(p)} ${c}`,
139
+ children: h
142
140
  }
143
141
  ),
142
+ g,
144
143
  /* @__PURE__ */ t(
145
144
  "p",
146
145
  {
147
- className: `select-input-helper-text ${X(p)} ${m}`,
148
- children: p !== "error" && p !== "good" ? d : i
146
+ className: `select-input-helper-text ${Y(p)} ${N}`,
147
+ children: p !== "error" && p !== "good" ? u : i
149
148
  }
150
149
  )
151
150
  ] });
152
151
  });
153
- const U = j(function(e, s) {
152
+ const j = I(function(e, a) {
154
153
  const {
155
154
  children: r,
156
155
  value: n,
157
- onChange: a,
158
- state: l = R.default,
156
+ onChange: s,
157
+ state: l = U.default,
159
158
  name: o = "",
160
159
  id: c = "",
161
160
  type: i = "text",
162
- label: m = "",
163
- required: d = !1,
164
- placeholder: u = "",
165
- containerClassName: f = "",
166
- inputClassName: h = "",
161
+ label: N = "",
162
+ required: u = !1,
163
+ placeholder: h = "",
164
+ containerClassName: m = "",
165
+ inputClassName: d = "",
167
166
  labelClassName: p = "",
168
- helperText: v = "",
169
- helperTextClassName: N = "",
170
- ...y
167
+ helperText: g = "",
168
+ helperTextClassName: C = "",
169
+ ...f
171
170
  } = e;
172
- return /* @__PURE__ */ b("div", { className: `text-input-container ${f}`, children: [
171
+ return /* @__PURE__ */ v("div", { className: `text-input-container ${m}`, children: [
173
172
  /* @__PURE__ */ t(
174
173
  "input",
175
174
  {
176
- ref: s,
175
+ ref: a,
177
176
  type: i,
178
177
  name: o,
179
178
  id: c,
180
- className: `text-input ${Q(l)} peer ${h}`,
179
+ className: `text-input ${Q(l)} peer ${d}`,
181
180
  placeholder: "",
182
- required: d,
181
+ required: u,
183
182
  value: n,
184
- onChange: a,
185
- ...y
183
+ onChange: s,
184
+ ...f
186
185
  }
187
186
  ),
188
- /* @__PURE__ */ b(
187
+ /* @__PURE__ */ v(
189
188
  "label",
190
189
  {
191
190
  htmlFor: o,
192
- className: `text-input-label ${V(l)} ${p}`,
191
+ className: `text-input-label ${X(l)} ${p}`,
193
192
  children: [
194
- m,
195
- d ? " *" : ""
193
+ N,
194
+ u ? " *" : ""
196
195
  ]
197
196
  }
198
197
  ),
@@ -200,302 +199,306 @@ const U = j(function(e, s) {
200
199
  /* @__PURE__ */ t(
201
200
  "p",
202
201
  {
203
- className: `text-input-helper-text ${X(l)} ${N}`,
204
- children: l !== "error" && l !== "good" ? u : v
202
+ className: `text-input-helper-text ${Y(l)} ${C}`,
203
+ children: l !== "error" && l !== "good" ? h : g
205
204
  }
206
205
  )
207
206
  ] });
208
207
  });
209
- const ce = j(function(e, s) {
208
+ const ie = I(function(e, a) {
210
209
  const {
211
210
  checked: r,
212
211
  onChange: n,
213
- state: a = R.default,
212
+ state: s = U.default,
214
213
  name: l = "",
215
214
  id: o = "",
216
215
  type: c = "text",
217
216
  label: i = "",
218
- containerClassName: m = "",
219
- inputClassName: d = "",
220
- labelClassName: u = "",
221
- helperText: f = "",
222
- helperTextClassName: h = "",
217
+ containerClassName: N = "",
218
+ inputClassName: u = "",
219
+ labelClassName: h = "",
220
+ helperText: m = "",
221
+ helperTextClassName: d = "",
223
222
  ...p
224
223
  } = e;
225
- return /* @__PURE__ */ b("label", { className: `input-check-container ${m}`, children: [
224
+ return /* @__PURE__ */ v("label", { className: `input-check-container ${N}`, children: [
226
225
  /* @__PURE__ */ t(
227
226
  "input",
228
227
  {
229
228
  id: o,
230
- ref: s,
229
+ ref: a,
231
230
  name: l,
232
231
  type: "checkbox",
233
232
  checked: r,
234
233
  onChange: n,
235
- className: `input-check ${d}`,
234
+ className: `input-check ${u}`,
236
235
  ...p
237
236
  }
238
237
  ),
239
- /* @__PURE__ */ t("span", { className: `input-check-label ${u}`, children: i })
238
+ /* @__PURE__ */ t("span", { className: `input-check-label ${h}`, children: i })
240
239
  ] });
241
240
  });
242
- const ie = j(function(e, s) {
241
+ const de = I(function(e, a) {
243
242
  const {
244
243
  state: r,
245
244
  value: n,
246
- onChange: a,
245
+ onChange: s,
247
246
  options: l = [],
248
247
  name: o = "",
249
248
  id: c = "",
250
249
  label: i = "",
251
- containerClassName: m = "",
252
- inputContainerClassName: d = "",
253
- helperText: u = "",
254
- placeholder: f = "",
255
- multiple: h = !1,
250
+ containerClassName: N = "",
251
+ inputContainerClassName: u = "",
252
+ helperText: h = "",
253
+ placeholder: m = "",
254
+ multiple: d = !1,
256
255
  ...p
257
- } = e, [v, N] = P(""), [y, w] = P(!1), S = l.filter((g) => {
258
- const x = String(g.value).toLowerCase().includes(v == null ? void 0 : v.toLowerCase());
259
- return n && n.length ? n != null && n.some ? !(n != null && n.some((I) => I.id === g.id)) : (n == null ? void 0 : n.id) !== g.id : x;
260
- }), A = W(null);
261
- M(() => {
262
- const g = (O) => {
263
- A.current && !A.current.contains(O.target) && w(!1);
264
- }, x = (O) => {
265
- O.key === "Escape" && w(!1);
256
+ } = e, [g, C] = P(""), [f, w] = P(!1), $ = l.filter((b) => {
257
+ const x = String(b.value).toLowerCase().includes(g == null ? void 0 : g.toLowerCase());
258
+ return n && n.length ? n != null && n.some ? !(n != null && n.some((R) => R.id === b.id)) : (n == null ? void 0 : n.id) !== b.id : x;
259
+ }), A = M(null);
260
+ H(() => {
261
+ const b = (z) => {
262
+ A.current && !A.current.contains(z.target) && w(!1);
263
+ }, x = (z) => {
264
+ z.key === "Escape" && w(!1);
266
265
  };
267
- return document.addEventListener("mousedown", g), document.addEventListener("keydown", x), () => {
268
- document.removeEventListener("mousedown", g), document.removeEventListener("keydown", x);
266
+ return document.addEventListener("mousedown", b), document.addEventListener("keydown", x), () => {
267
+ document.removeEventListener("mousedown", b), document.removeEventListener("keydown", x);
269
268
  };
270
269
  }, []);
271
- const B = (g) => {
272
- N(g.target.value);
273
- }, G = k(
274
- (g) => {
275
- N(""), g ? h ? Array.isArray(n) && n.length ? a([...n, g]) : a([g]) : a(g) : a(null), w(!1);
270
+ const B = (b) => {
271
+ C(b.target.value);
272
+ }, J = S(
273
+ (b) => {
274
+ C(""), b ? d ? Array.isArray(n) && n.length ? s([...n, b]) : s([b]) : s(b) : s(null), w(!1);
276
275
  },
277
- [h, a, n]
278
- ), te = k(
279
- (g) => {
280
- const x = n.filter((O, I) => I !== g);
281
- x.length ? a(x) : a(null);
276
+ [d, s, n]
277
+ ), ne = S(
278
+ (b) => {
279
+ const x = n.filter((z, R) => R !== b);
280
+ x.length ? s(x) : s(null);
282
281
  },
283
- [a, n]
282
+ [s, n]
284
283
  );
285
- return /* @__PURE__ */ b(
284
+ return /* @__PURE__ */ v(
286
285
  "div",
287
286
  {
288
- className: `autocomplete-input-container ${m}`,
287
+ className: `autocomplete-input-container ${N}`,
289
288
  ref: A,
290
289
  children: [
291
290
  /* @__PURE__ */ t(
292
- U,
291
+ j,
293
292
  {
294
293
  state: r,
295
294
  name: o,
296
295
  id: c,
297
- value: !h && n ? n : v,
296
+ value: !d && n ? n : g,
298
297
  onChange: B,
299
- placeholder: f,
300
- helperText: u,
298
+ placeholder: m,
299
+ helperText: h,
301
300
  onFocus: () => w(!0),
302
301
  label: i,
303
- containerClassName: `autocomplete-text-input ${d}`,
304
- ref: s,
302
+ containerClassName: `autocomplete-text-input ${u}`,
303
+ ref: a,
305
304
  ...p,
306
- children: !h && n && /* @__PURE__ */ t(
305
+ children: !d && n && /* @__PURE__ */ t(
307
306
  "button",
308
307
  {
309
308
  type: "button",
310
309
  className: "autocomplete-delete-button",
311
- onClick: (g) => {
312
- G(), g.stopPropagation();
310
+ onClick: (b) => {
311
+ J(), b.stopPropagation();
313
312
  },
314
313
  children: /* @__PURE__ */ t(K, {})
315
314
  }
316
315
  )
317
316
  }
318
317
  ),
319
- y && /* @__PURE__ */ t("ul", { className: "autocomplete-suggestions-container", children: S.map((g) => /* @__PURE__ */ t(
318
+ f && /* @__PURE__ */ t("ul", { className: "autocomplete-suggestions-container", children: $.map((b) => /* @__PURE__ */ t(
320
319
  "li",
321
320
  {
322
321
  className: "autocomplete-suggestion-item hover:bg-primary/20",
323
322
  onClick: (x) => {
324
- G(g), x.stopPropagation();
323
+ J(b), x.stopPropagation();
325
324
  },
326
- children: g.value
325
+ children: b.value ?? b.name
327
326
  },
328
- g.id
327
+ b.id ?? b.value ?? b.name
329
328
  )) }),
330
- h && Array.isArray(n) && n.length ? /* @__PURE__ */ t("ul", { className: "autocomplete-value-container", children: n.map((g, x) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
329
+ d && Array.isArray(n) && n.length ? /* @__PURE__ */ t("ul", { className: "autocomplete-value-container", children: n.map((b, x) => /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
331
330
  Te,
332
331
  {
333
- label: String(g.value),
334
- onDelete: (O) => {
335
- te(x), O.stopPropagation();
332
+ label: String(b.value ?? b.name),
333
+ onDelete: (z) => {
334
+ ne(x), z.stopPropagation();
336
335
  }
337
336
  }
338
- ) }, g.value)) }) : null
337
+ ) }, b.id ?? b.value ?? b.name)) }) : null
339
338
  ]
340
339
  }
341
340
  );
342
341
  });
343
- function de(e) {
342
+ function ue(e) {
344
343
  const {
345
- color: s = "stroke-blue-800",
346
- loaderClass: r,
347
- strokeWidth: n = "4",
348
- ...a
344
+ color: a = "stroke-blue-800",
345
+ className: r = "",
346
+ loaderClass: n = "",
347
+ strokeWidth: s = "4",
348
+ ...l
349
349
  } = e;
350
- return /* @__PURE__ */ t("div", { ...a, className: `loading ${a.className}`, children: /* @__PURE__ */ t("div", { className: "loader-container", children: /* @__PURE__ */ t("div", { className: `loader ${r}`, children: /* @__PURE__ */ t("svg", { className: "circular", viewBox: "25 25 50 50", children: /* @__PURE__ */ t(
350
+ return /* @__PURE__ */ t("div", { ...l, className: `loading ${r}`, children: /* @__PURE__ */ t("div", { className: "loader-container", children: /* @__PURE__ */ t("div", { className: `loader ${n}`, children: /* @__PURE__ */ t("svg", { className: "circular", viewBox: "25 25 50 50", children: /* @__PURE__ */ t(
351
351
  "circle",
352
352
  {
353
- className: `path ${s}`,
353
+ className: `path ${a}`,
354
354
  cx: "50",
355
355
  cy: "50",
356
356
  r: "20",
357
357
  fill: "none",
358
- strokeWidth: n,
358
+ strokeWidth: s,
359
359
  strokeMiterlimit: "10"
360
360
  }
361
361
  ) }) }) }) });
362
362
  }
363
- const Y = H({});
364
- function De(e) {
365
- const { children: s, t: r } = e;
366
- return /* @__PURE__ */ t(Y.Provider, { value: { t: r }, children: s });
363
+ const Z = W({});
364
+ function Be(e) {
365
+ const { children: a, t: r } = e;
366
+ return /* @__PURE__ */ t(Z.Provider, { value: { t: r }, children: a });
367
367
  }
368
368
  const L = () => {
369
- const e = q(Y);
369
+ const e = V(Z);
370
370
  if (e === void 0)
371
371
  throw new Error("translationContext must be used within a Provider");
372
372
  return e;
373
373
  };
374
- var E = /* @__PURE__ */ ((e) => (e[e.text = 0] = "text", e[e.number = 1] = "number", e[e.select = 2] = "select", e[e.autocomplete = 3] = "autocomplete", e[e.date = 4] = "date", e[e.check = 5] = "check", e))(E || {}), _ = /* @__PURE__ */ ((e) => (e.ASC = "ASC", e.DESC = "DESC", e))(_ || {});
375
- const ue = [20, 50, 100], Z = H({}), Me = (e) => {
376
- const { children: s } = e, [r, n] = P(0), [a, l] = P(20), [o, c] = P(0), [i, m] = P("id"), [d, u] = P(_.DESC), [f, h] = P({}), p = k(
377
- (y, w) => {
378
- let S = d;
379
- if (i === y)
380
- switch (d) {
381
- case _.ASC:
382
- S = _.DESC;
374
+ var E = /* @__PURE__ */ ((e) => (e[e.text = 0] = "text", e[e.number = 1] = "number", e[e.select = 2] = "select", e[e.autocomplete = 3] = "autocomplete", e[e.date = 4] = "date", e[e.check = 5] = "check", e))(E || {}), F = /* @__PURE__ */ ((e) => (e.ASC = "ASC", e.DESC = "DESC", e))(F || {});
375
+ const pe = [20, 50, 100], ee = W({}), De = (e) => {
376
+ const { children: a } = e, [r, n] = P(0), [s, l] = P(20), [o, c] = P(0), [i, N] = P("id"), [u, h] = P(F.DESC), [m, d] = P({}), p = S(
377
+ (f, w) => {
378
+ let $ = u;
379
+ if (i === f)
380
+ switch (u) {
381
+ case F.ASC:
382
+ $ = F.DESC;
383
383
  break;
384
384
  default:
385
- S = _.ASC;
385
+ $ = F.ASC;
386
386
  break;
387
387
  }
388
- m(y), u(S), w && w(y, S);
388
+ N(f), h($), w && w(f, $);
389
389
  },
390
- [i, d]
391
- ), v = k((y) => {
392
- const w = Object.entries(y).reduce(
393
- (S, [A, B]) => (B && typeof B.value < "u" && (S[A] = B.value), S),
390
+ [i, u]
391
+ ), g = S((f) => {
392
+ const w = Object.entries(f).reduce(
393
+ ($, [A, B]) => (B && typeof B.value < "u" && ($[A] = B.value), $),
394
394
  {}
395
395
  );
396
- h(w);
397
- }, []), N = {
396
+ d(w);
397
+ }, []), C = {
398
398
  onSort: p,
399
399
  total: r,
400
400
  setTotal: n,
401
401
  sortingBy: i,
402
- setSortingBy: m,
403
- sortingOrder: d,
404
- setSortingOrder: u,
405
- pageSize: a,
406
- pageSizes: ue,
402
+ setSortingBy: N,
403
+ sortingOrder: u,
404
+ setSortingOrder: h,
405
+ pageSize: s,
406
+ pageSizes: pe,
407
407
  setPageSize: l,
408
408
  currentPage: o,
409
409
  setCurrentPage: c,
410
- filters: f,
411
- onFilterApply: v
410
+ filters: m,
411
+ onFilterApply: g
412
412
  };
413
- return /* @__PURE__ */ t(Z.Provider, { value: N, children: s });
414
- }, F = () => {
415
- const e = q(Z);
413
+ return /* @__PURE__ */ t(ee.Provider, { value: C, children: a });
414
+ }, T = () => {
415
+ const e = V(ee);
416
416
  if (e === void 0)
417
417
  throw new Error("tableOptionsContext must be used within a Provider");
418
418
  return e;
419
419
  };
420
- var $ = /* @__PURE__ */ ((e) => (e[e.update = 0] = "update", e[e.reset = 1] = "reset", e))($ || {});
421
- const pe = (e) => {
422
- const s = {}, r = Object.keys(e);
423
- return r == null || r.forEach((n) => {
424
- s[n] = { value: e[n] };
425
- }), s;
420
+ var k = /* @__PURE__ */ ((e) => (e[e.update = 0] = "update", e[e.reset = 1] = "reset", e))(k || {});
421
+ const he = (e) => {
422
+ if (e) {
423
+ const a = {}, r = Object.keys(e);
424
+ return r == null || r.forEach((n) => {
425
+ a[n] = { value: e[n] };
426
+ }), a;
427
+ }
428
+ return {};
426
429
  };
427
- function he(e, s) {
428
- const { type: r } = s;
430
+ function me(e, a) {
431
+ const { type: r } = a;
429
432
  switch (r) {
430
- case $.reset: {
431
- const { filters: n } = s, a = {};
433
+ case k.reset: {
434
+ const { filters: n } = a, s = {};
432
435
  return n == null || n.forEach(({ propertyName: l, defaultValue: o }) => {
433
- a[l] = { value: o };
434
- }), { ...e, ...a };
436
+ s[l] = { value: o };
437
+ }), { ...e, ...s };
435
438
  }
436
- case $.update: {
437
- const { toUpdate: n } = s;
439
+ case k.update: {
440
+ const { toUpdate: n } = a;
438
441
  return { ...e, ...n };
439
442
  }
440
443
  default:
441
444
  return e;
442
445
  }
443
446
  }
444
- const ee = H({}), me = (e) => {
445
- const { children: s } = e, { filters: r } = F(), [n, a] = ne(
446
- he,
447
- pe(r)
447
+ const te = W({}), be = (e) => {
448
+ const { children: a } = e, { filters: r } = T(), [n, s] = ae(
449
+ me,
450
+ he(r)
448
451
  ), l = {
449
452
  currentFilters: n,
450
- setCurrentFilters: a
453
+ setCurrentFilters: s
451
454
  };
452
- return /* @__PURE__ */ t(ee.Provider, { value: l, children: s });
453
- }, T = () => {
454
- const e = q(ee);
455
+ return /* @__PURE__ */ t(te.Provider, { value: l, children: a });
456
+ }, _ = () => {
457
+ const e = V(te);
455
458
  if (e === void 0)
456
459
  throw new Error("tableOptionsContext must be used within a Provider");
457
460
  return e;
458
461
  };
459
- function be(e) {
460
- const { t: s } = L(), { entity: r = "", columns: n = [], hasAction: a = !0, onSortCallback: l } = e, { onSort: o, sortingOrder: c, sortingBy: i } = F(), m = C(() => {
461
- var d;
462
- return (d = n.sort((u, f) => (f.pos ?? 0) - (u.pos ?? 0)).filter((u) => u.display !== "none")) == null ? void 0 : d.map((u) => ({
463
- id: u.key,
464
- label: u.label,
465
- className: u.className ?? "",
466
- sortable: u.sortable ?? !0,
467
- sortOptions: u.sortOptions
462
+ function ge(e) {
463
+ const { t: a } = L(), { entity: r = "", columns: n = [], hasAction: s = !0, onSortCallback: l } = e, { onSort: o, sortingOrder: c, sortingBy: i } = T(), N = y(() => {
464
+ var u;
465
+ return (u = n.sort((h, m) => (m.pos ?? 0) - (h.pos ?? 0)).filter((h) => h.display !== "none")) == null ? void 0 : u.map((h) => ({
466
+ id: h.key,
467
+ label: h.label,
468
+ className: h.className ?? "",
469
+ sortable: h.sortable ?? !0,
470
+ sortOptions: h.sortOptions
468
471
  }));
469
- }, [n, r, s]);
470
- return /* @__PURE__ */ t("thead", { className: "table-headers-row", children: /* @__PURE__ */ b("tr", { children: [
471
- m.map((d) => {
472
- var u, f, h, p, v, N, y, w;
472
+ }, [n, r, a]);
473
+ return /* @__PURE__ */ t("thead", { className: "table-headers-row", children: /* @__PURE__ */ v("tr", { children: [
474
+ N.map((u) => {
475
+ var h, m, d, p, g, C, f, w;
473
476
  return /* @__PURE__ */ t(
474
477
  "th",
475
478
  {
476
479
  scope: "col",
477
- className: `table-headers-column ${d.className}`,
478
- children: /* @__PURE__ */ b(
480
+ className: `table-headers-column ${u.className}`,
481
+ children: /* @__PURE__ */ v(
479
482
  "button",
480
483
  {
481
- disabled: !d.sortable,
482
- onClick: () => o(d.id, l),
484
+ disabled: !u.sortable,
485
+ onClick: () => o(u.id, l),
483
486
  className: "table-headers-cell",
484
487
  children: [
485
- /* @__PURE__ */ t("span", { className: "table-headers-label", children: d.label }),
486
- d.sortable && /* @__PURE__ */ t(
488
+ /* @__PURE__ */ t("span", { className: "table-headers-label", children: u.label }),
489
+ u.sortable && /* @__PURE__ */ t(
487
490
  "span",
488
491
  {
489
- className: `${i === d.id ? "table-headers-sort-on" : "table-headers-sort"}`,
490
- children: c === _.ASC ? ((f = (u = d.sortOptions) == null ? void 0 : u.icons) == null ? void 0 : f.asc) ?? /* @__PURE__ */ t(
491
- ae,
492
+ className: `${i === u.id ? "table-headers-sort-on" : "table-headers-sort"}`,
493
+ children: c === F.ASC ? ((m = (h = u.sortOptions) == null ? void 0 : h.icons) == null ? void 0 : m.asc) ?? /* @__PURE__ */ t(
494
+ re,
492
495
  {
493
- className: ((p = (h = d.sortOptions) == null ? void 0 : h.icons) == null ? void 0 : p.className) ?? "table-headers-sort-indicator"
496
+ className: ((p = (d = u.sortOptions) == null ? void 0 : d.icons) == null ? void 0 : p.className) ?? "table-headers-sort-indicator"
494
497
  }
495
- ) : ((N = (v = d.sortOptions) == null ? void 0 : v.icons) == null ? void 0 : N.desc) ?? /* @__PURE__ */ t(
498
+ ) : ((C = (g = u.sortOptions) == null ? void 0 : g.icons) == null ? void 0 : C.desc) ?? /* @__PURE__ */ t(
496
499
  se,
497
500
  {
498
- className: ((w = (y = d.sortOptions) == null ? void 0 : y.icons) == null ? void 0 : w.className) ?? "table-headers-sort-indicator"
501
+ className: ((w = (f = u.sortOptions) == null ? void 0 : f.icons) == null ? void 0 : w.className) ?? "table-headers-sort-indicator"
499
502
  }
500
503
  )
501
504
  }
@@ -504,19 +507,19 @@ function be(e) {
504
507
  }
505
508
  )
506
509
  },
507
- d.id
510
+ u.id
508
511
  );
509
512
  }),
510
- a && /* @__PURE__ */ t("th", { scope: "col", className: "table-headers-action", children: s("_accessibility:labels.actions") })
513
+ s && /* @__PURE__ */ t("th", { scope: "col", className: "table-headers-action", children: a("_accessibility:labels.actions") })
511
514
  ] }) });
512
515
  }
513
- function ge() {
516
+ function ve() {
514
517
  const { t: e } = L();
515
518
  return /* @__PURE__ */ t("div", { className: "table-empty", children: /* @__PURE__ */ t("p", { children: e("_accessibility:components.table.empty") }) });
516
519
  }
517
- const ve = () => {
518
- const { t: e } = L(), { total: s, pageSize: r, currentPage: n, setCurrentPage: a } = F();
519
- return /* @__PURE__ */ b("div", { className: "table-navigation-pages", children: [
520
+ const Ne = () => {
521
+ const { t: e } = L(), { total: a, pageSize: r, currentPage: n, setCurrentPage: s } = T();
522
+ return /* @__PURE__ */ v("div", { className: "table-navigation-pages", children: [
520
523
  /* @__PURE__ */ t(
521
524
  "button",
522
525
  {
@@ -524,98 +527,98 @@ const ve = () => {
524
527
  disabled: n === 0,
525
528
  "aria-label": e("_accessibility:buttons.previous"),
526
529
  name: e("_accessibility:buttons.previous"),
527
- onClick: () => a(n - 1),
528
- children: /* @__PURE__ */ t(le, { className: "w-2.5" })
530
+ onClick: () => s(n - 1),
531
+ children: /* @__PURE__ */ t(oe, { className: "w-2.5" })
529
532
  }
530
533
  ),
531
534
  /* @__PURE__ */ t(
532
535
  "button",
533
536
  {
534
- disabled: Math.floor(s / ((n + 1) * r)) === 0,
537
+ disabled: Math.floor(a / ((n + 1) * r)) === 0,
535
538
  className: "table-navigation-buttons",
536
539
  name: e("_accessibility:buttons.next"),
537
540
  "aria-label": e("_accessibility:buttons.next"),
538
- onClick: () => a(n + 1),
539
- children: /* @__PURE__ */ t(re, { className: "w-2.5" })
541
+ onClick: () => s(n + 1),
542
+ children: /* @__PURE__ */ t(le, { className: "w-2.5" })
540
543
  }
541
544
  )
542
545
  ] });
543
- }, Ne = () => {
544
- const { t: e } = L(), { total: s, pageSize: r, pageSizes: n, currentPage: a } = F(), l = (a + 1) * r > s ? s : (a + 1) * r;
545
- return /* @__PURE__ */ b("div", { className: "table-navigation-sizes", children: [
546
- n[0] < s && /* @__PURE__ */ t(D, { children: /* @__PURE__ */ b("p", { children: [
547
- a * r + 1,
546
+ }, fe = () => {
547
+ const { t: e } = L(), { total: a, pageSize: r, pageSizes: n, currentPage: s } = T(), l = (s + 1) * r > a ? a : (s + 1) * r;
548
+ return /* @__PURE__ */ v("div", { className: "table-navigation-sizes", children: [
549
+ n[0] < a && /* @__PURE__ */ t(D, { children: /* @__PURE__ */ v("p", { children: [
550
+ s * r + 1,
548
551
  " - ",
549
552
  l,
550
553
  " ",
551
554
  e("_accessibility:components.table.of")
552
555
  ] }) }),
553
- /* @__PURE__ */ t("p", { children: s })
556
+ /* @__PURE__ */ t("p", { children: a })
554
557
  ] });
555
558
  };
556
- function fe() {
557
- const { t: e } = L(), { pageSizes: s, pageSize: r, setPageSize: n } = F(), a = C(
558
- () => s == null ? void 0 : s.map((l) => ({ id: l, value: l })),
559
- [s]
559
+ function Ce() {
560
+ const { t: e } = L(), { pageSizes: a, pageSize: r, setPageSize: n } = T(), s = y(
561
+ () => a == null ? void 0 : a.map((l) => ({ id: l, value: l })),
562
+ [a]
560
563
  );
561
- return /* @__PURE__ */ b("div", { className: "page-size", children: [
564
+ return /* @__PURE__ */ v("div", { className: "page-size", children: [
562
565
  /* @__PURE__ */ t("p", { children: e("_accessibility:components.table.pageSizes") }),
563
566
  /* @__PURE__ */ t(
564
- J,
567
+ q,
565
568
  {
566
569
  value: r,
567
- options: a,
570
+ options: s,
568
571
  inputClassName: "page-size-input",
569
572
  containerClassName: "page-size-input-container",
570
573
  helperTextClassName: "hidden",
571
- onChange: (l) => n(l.target.value)
574
+ onChange: (l) => n(Number(l.target.value))
572
575
  }
573
576
  )
574
577
  ] });
575
578
  }
576
- function Ce() {
577
- const { t: e } = L(), { total: s, pageSize: r, currentPage: n, setCurrentPage: a } = F(), l = C(() => {
578
- const o = Math.ceil(s / r);
579
+ function ye() {
580
+ const { t: e } = L(), { total: a, pageSize: r, currentPage: n, setCurrentPage: s } = T(), l = y(() => {
581
+ const o = Math.ceil(a / r);
579
582
  return Array.from({ length: o }, (c, i) => ({
580
583
  id: i,
581
584
  value: i + 1
582
585
  }));
583
- }, [s, r]);
584
- return /* @__PURE__ */ b("div", { className: "jump-to-page", children: [
586
+ }, [a, r]);
587
+ return /* @__PURE__ */ v("div", { className: "jump-to-page", children: [
585
588
  /* @__PURE__ */ t("p", { children: e("_accessibility:components.table.jumpToPage") }),
586
589
  /* @__PURE__ */ t(
587
- J,
590
+ q,
588
591
  {
589
592
  value: n,
590
593
  options: l,
591
594
  inputClassName: "jump-to-page-input",
592
595
  containerClassName: "jump-to-page-input-container",
593
596
  helperTextClassName: "hidden",
594
- onChange: (o) => a(Number(o.target.value))
597
+ onChange: (o) => s(Number(o.target.value))
595
598
  }
596
599
  )
597
600
  ] });
598
601
  }
599
- function ye() {
600
- return /* @__PURE__ */ b("div", { className: "table-footer", children: [
602
+ function we() {
603
+ return /* @__PURE__ */ v("div", { className: "table-footer", children: [
604
+ /* @__PURE__ */ t(ye, {}),
601
605
  /* @__PURE__ */ t(Ce, {}),
602
606
  /* @__PURE__ */ t(fe, {}),
603
- /* @__PURE__ */ t(Ne, {}),
604
- /* @__PURE__ */ t(ve, {})
607
+ /* @__PURE__ */ t(Ne, {})
605
608
  ] });
606
609
  }
607
- function we(e) {
608
- const { propertyName: s, options: r, label: n } = e, { currentFilters: a, setCurrentFilters: l } = T(), o = C(() => {
610
+ function xe(e) {
611
+ const { propertyName: a, options: r, label: n } = e, { currentFilters: s, setCurrentFilters: l } = _(), o = y(() => {
609
612
  var i;
610
- return ((i = a[s]) == null ? void 0 : i.value) ?? r[0];
611
- }, [a]), c = k((i) => {
613
+ return ((i = s[a]) == null ? void 0 : i.value) ?? r[0];
614
+ }, [s]), c = S((i) => {
612
615
  l({
613
- type: $.update,
614
- toUpdate: { [s]: { value: i.target.value } }
616
+ type: k.update,
617
+ toUpdate: { [a]: { value: i.target.value } }
615
618
  });
616
619
  }, []);
617
620
  return /* @__PURE__ */ t(
618
- J,
621
+ q,
619
622
  {
620
623
  value: o,
621
624
  label: n,
@@ -626,18 +629,18 @@ function we(e) {
626
629
  }
627
630
  );
628
631
  }
629
- const xe = (e) => {
630
- const { propertyName: s, label: r } = e, { currentFilters: n, setCurrentFilters: a } = T(), l = C(() => {
632
+ const Se = (e) => {
633
+ const { propertyName: a, label: r } = e, { currentFilters: n, setCurrentFilters: s } = _(), l = y(() => {
631
634
  var c;
632
- return ((c = n[s]) == null ? void 0 : c.value) ?? "";
633
- }, [n]), o = k((c) => {
634
- a({
635
- type: $.update,
636
- toUpdate: { [s]: { value: c.target.value } }
635
+ return ((c = n[a]) == null ? void 0 : c.value) ?? "";
636
+ }, [n]), o = S((c) => {
637
+ s({
638
+ type: k.update,
639
+ toUpdate: { [a]: { value: c.target.value } }
637
640
  });
638
641
  }, []);
639
642
  return /* @__PURE__ */ t(
640
- U,
643
+ j,
641
644
  {
642
645
  value: l ?? "",
643
646
  label: r,
@@ -647,153 +650,163 @@ const xe = (e) => {
647
650
  }
648
651
  );
649
652
  }, ke = (e) => {
650
- const { propertyName: s, label: r, min: n, max: a } = e, { currentFilters: l, setCurrentFilters: o } = T(), c = C(() => {
651
- var m;
652
- return ((m = l[s]) == null ? void 0 : m.value) ?? "";
653
- }, [l]), i = k(
654
- (m) => {
655
- o({
656
- type: $.update,
657
- toUpdate: {
658
- [s]: { value: m.target.value }
659
- }
660
- });
661
- },
662
- [c]
663
- );
664
- return /* @__PURE__ */ t(
665
- U,
666
- {
667
- value: c ?? "",
668
- min: n,
669
- max: a,
670
- type: "number",
671
- label: r,
672
- containerClassName: "input-widget-container",
673
- onChange: i,
674
- helperTextClassName: ""
675
- }
676
- );
677
- }, $e = (e) => {
678
- const { propertyName: s, label: r } = e, { currentFilters: n, setCurrentFilters: a } = T(), l = C(() => {
653
+ const { propertyName: a, label: r } = e, { currentFilters: n, setCurrentFilters: s } = _(), l = y(() => {
679
654
  var c;
680
- return ((c = n[s]) == null ? void 0 : c.value) ?? "";
681
- }, [n]), o = k((c) => {
682
- a({
683
- type: $.update,
684
- toUpdate: { [s]: { value: c.target.checked } }
655
+ return ((c = n[a]) == null ? void 0 : c.value) ?? "";
656
+ }, [n]), o = S((c) => {
657
+ s({
658
+ type: k.update,
659
+ toUpdate: { [a]: { value: c.target.checked } }
685
660
  });
686
661
  }, []);
687
- return /* @__PURE__ */ t(ce, { label: r, checked: l ?? !1, onChange: o });
662
+ return /* @__PURE__ */ t(ie, { label: r, checked: l ?? !1, onChange: o });
688
663
  };
689
- function Se(e) {
690
- const { propertyName: s, label: r, options: n, multiple: a = !0 } = e, { currentFilters: l, setCurrentFilters: o } = T(), c = C(() => l[s] ?? n[0], [l]), i = k(
691
- (m) => {
664
+ function $e(e) {
665
+ const { propertyName: a, label: r, options: n, multiple: s = !0 } = e, { currentFilters: l, setCurrentFilters: o } = _(), c = y(() => l[a] ?? n[0], [l]), i = S(
666
+ (N) => {
692
667
  o({
693
- type: $.update,
668
+ type: k.update,
694
669
  toUpdate: {
695
- [s]: {
696
- value: m
670
+ [a]: {
671
+ value: N
697
672
  }
698
673
  }
699
674
  });
700
675
  },
701
- [a]
676
+ [s]
702
677
  );
703
678
  return /* @__PURE__ */ t(
704
- ie,
679
+ de,
705
680
  {
706
681
  value: c == null ? void 0 : c.value,
707
682
  label: r,
708
683
  options: n,
709
- multiple: a,
684
+ multiple: s,
710
685
  helperTextClassName: "hidden",
711
686
  containerClassName: "options-widget-container",
712
687
  onChange: i
713
688
  }
714
689
  );
715
690
  }
716
- const Pe = (e) => {
717
- const { propertyName: s, label: r } = e, { currentFilters: n, setCurrentFilters: a } = T(), l = C(() => {
718
- var c, i;
719
- return (c = n[s]) != null && c.value ? new Date(String((i = n[s]) == null ? void 0 : i.value)).toISOString().slice(0, 10) : "";
720
- }, [n]), o = k((c) => {
721
- a({
722
- type: $.update,
723
- toUpdate: { [s]: { value: c.target.value } }
691
+ const G = (e) => {
692
+ const { propertyName: a, label: r, inputType: n } = e, { currentFilters: s, setCurrentFilters: l } = _(), o = M(null), c = M(null), i = y(() => {
693
+ var d, p, g;
694
+ const m = (p = (d = s[a]) == null ? void 0 : d.value) == null ? void 0 : p.start;
695
+ return m ? n === "date" ? new Date(String(m)).toISOString().slice(0, 10) : (g = s[a]) == null ? void 0 : g.value : "";
696
+ }, [s]), N = y(() => {
697
+ var d, p, g;
698
+ const m = (p = (d = s[a]) == null ? void 0 : d.value) == null ? void 0 : p.end;
699
+ return m ? n === "date" ? new Date(String(m)).toISOString().slice(0, 10) : (g = s[a]) == null ? void 0 : g.value : "";
700
+ }, [s]), u = S((m) => {
701
+ var d;
702
+ l({
703
+ type: k.update,
704
+ toUpdate: {
705
+ [a]: {
706
+ value: { end: ((d = c == null ? void 0 : c.current) == null ? void 0 : d.value) ?? null, start: m.target.value }
707
+ }
708
+ }
709
+ });
710
+ }, []), h = S((m) => {
711
+ var d;
712
+ l({
713
+ type: k.update,
714
+ toUpdate: {
715
+ [a]: {
716
+ value: {
717
+ start: ((d = o == null ? void 0 : o.current) == null ? void 0 : d.value) ?? null,
718
+ end: m.target.value
719
+ }
720
+ }
721
+ }
724
722
  });
725
723
  }, []);
726
- return /* @__PURE__ */ t(
727
- U,
728
- {
729
- value: l ?? "",
730
- label: r,
731
- type: "date",
732
- onChange: o,
733
- containerClassName: "input-widget-container",
734
- helperTextClassName: ""
735
- }
736
- );
737
- }, ze = (e) => {
724
+ return /* @__PURE__ */ v("div", { className: "flex gap-2 items-center", children: [
725
+ /* @__PURE__ */ t(
726
+ j,
727
+ {
728
+ value: i ?? "",
729
+ label: r,
730
+ type: n,
731
+ ref: o,
732
+ onChange: u,
733
+ containerClassName: "input-widget-container",
734
+ helperTextClassName: ""
735
+ }
736
+ ),
737
+ /* @__PURE__ */ t(
738
+ j,
739
+ {
740
+ value: N ?? "",
741
+ label: r,
742
+ type: n,
743
+ ref: c,
744
+ onChange: h,
745
+ containerClassName: "input-widget-container",
746
+ helperTextClassName: ""
747
+ }
748
+ )
749
+ ] });
750
+ }, Pe = (e) => {
738
751
  switch (e.type) {
739
752
  case E.text:
740
- return /* @__PURE__ */ t(xe, { ...e });
753
+ return /* @__PURE__ */ t(Se, { ...e });
741
754
  case E.number:
742
- return /* @__PURE__ */ t(ke, { ...e });
755
+ return /* @__PURE__ */ t(G, { ...e });
756
+ case E.date:
757
+ return /* @__PURE__ */ t(G, { ...e });
743
758
  case E.select:
744
- return /* @__PURE__ */ t(we, { ...e });
759
+ return /* @__PURE__ */ t(xe, { ...e });
745
760
  case E.autocomplete:
746
- return /* @__PURE__ */ t(Se, { ...e });
747
- case E.date:
748
- return /* @__PURE__ */ t(Pe, { ...e });
749
- case E.check:
750
761
  return /* @__PURE__ */ t($e, { ...e });
762
+ case E.check:
763
+ return /* @__PURE__ */ t(ke, { ...e });
751
764
  }
752
765
  return /* @__PURE__ */ t(D, {});
753
766
  };
754
767
  const Oe = (e) => {
755
- const { align: s = "right", filters: r = [], icon: n } = e, [a, l] = P(!1), { onFilterApply: o, filters: c } = F(), { currentFilters: i, setCurrentFilters: m } = T(), { t: d } = L(), u = W(null), f = W(null);
756
- return M(() => {
757
- const h = ({ target: p }) => {
758
- var v, N;
759
- f.current && (!a || (v = f.current) != null && v.contains(p) || (N = u == null ? void 0 : u.current) != null && N.contains(p) || l(!1));
768
+ const { align: a = "right", filters: r = [], icon: n } = e, [s, l] = P(!1), { onFilterApply: o, filters: c } = T(), { currentFilters: i, setCurrentFilters: N } = _(), { t: u } = L(), h = M(null), m = M(null);
769
+ return H(() => {
770
+ const d = ({ target: p }) => {
771
+ var g, C;
772
+ m.current && (!s || (g = m.current) != null && g.contains(p) || (C = h == null ? void 0 : h.current) != null && C.contains(p) || l(!1));
760
773
  };
761
- return document.addEventListener("click", h), () => document.removeEventListener("click", h);
762
- }), M(() => {
763
- const h = (p) => {
764
- !a || p.code !== "Escape" || l(!1);
774
+ return document.addEventListener("click", d), () => document.removeEventListener("click", d);
775
+ }), H(() => {
776
+ const d = (p) => {
777
+ !s || p.code !== "Escape" || l(!1);
765
778
  };
766
- return document.addEventListener("keydown", h), () => document.removeEventListener("keydown", h);
767
- }), /* @__PURE__ */ b("div", { className: "filter-dropdown-main", children: [
768
- /* @__PURE__ */ b(
779
+ return document.addEventListener("keydown", d), () => document.removeEventListener("keydown", d);
780
+ }), /* @__PURE__ */ v("div", { className: "filter-dropdown-main", children: [
781
+ /* @__PURE__ */ v(
769
782
  "button",
770
783
  {
771
- ref: u,
784
+ ref: h,
772
785
  className: "filter-dropdown-button normal filter-dropdown-trigger",
773
786
  "aria-haspopup": "true",
774
- onClick: () => l(!a),
775
- "aria-expanded": a,
787
+ onClick: () => l(!s),
788
+ "aria-expanded": s,
776
789
  children: [
777
- /* @__PURE__ */ t("span", { className: "sr-only", children: d("_accessibility:buttons.filters") }),
790
+ /* @__PURE__ */ t("span", { className: "sr-only", children: u("_accessibility:buttons.filters") }),
778
791
  /* @__PURE__ */ t("wbr", {}),
779
- n ?? /* @__PURE__ */ t(oe, { className: "filter-dropdown-trigger-icon" })
792
+ n ?? /* @__PURE__ */ t(ce, { className: "filter-dropdown-trigger-icon" })
780
793
  ]
781
794
  }
782
795
  ),
783
796
  /* @__PURE__ */ t(
784
797
  "div",
785
798
  {
786
- className: `filter-dropdown-transition ${a ? "opened" : "closed"} ${s === "right" ? "right" : "left"}`,
787
- children: /* @__PURE__ */ b("div", { ref: f, children: [
788
- /* @__PURE__ */ t("div", { className: "filter-title", children: d("_accessibility:buttons.filters") }),
789
- /* @__PURE__ */ t("ul", { className: "filter-container", children: r.map((h) => /* @__PURE__ */ t("li", { className: "filter-container-item", children: ze(h) }, h.propertyName)) }),
790
- /* @__PURE__ */ t("div", { className: "filter-footer", children: /* @__PURE__ */ b("ul", { className: "filter-buttons-row", children: [
799
+ className: `filter-dropdown-transition ${s ? "opened" : "closed"} ${a === "right" ? "right" : "left"}`,
800
+ children: /* @__PURE__ */ v("div", { ref: m, children: [
801
+ /* @__PURE__ */ t("div", { className: "filter-title", children: u("_accessibility:buttons.filters") }),
802
+ /* @__PURE__ */ t("ul", { className: "filter-container", children: r.map((d) => /* @__PURE__ */ t("li", { className: "filter-container-item", children: Pe(d) }, d.propertyName)) }),
803
+ /* @__PURE__ */ t("div", { className: "filter-footer", children: /* @__PURE__ */ v("ul", { className: "filter-buttons-row", children: [
791
804
  /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
792
805
  "button",
793
806
  {
794
- onClick: () => m({ type: $.reset, filters: r }),
807
+ onClick: () => N({ type: k.reset, filters: r }),
795
808
  className: "filter-dropdown-button small filter-dropdown-cancel",
796
- children: d("_accessibility:buttons.clear")
809
+ children: u("_accessibility:buttons.clear")
797
810
  }
798
811
  ) }),
799
812
  /* @__PURE__ */ t("li", { children: /* @__PURE__ */ t(
@@ -804,7 +817,7 @@ const Oe = (e) => {
804
817
  l(!1), o(i);
805
818
  },
806
819
  onBlur: () => l(!1),
807
- children: d("_accessibility:buttons.applyFilters")
820
+ children: u("_accessibility:buttons.applyFilters")
808
821
  }
809
822
  ) })
810
823
  ] }) })
@@ -812,165 +825,165 @@ const Oe = (e) => {
812
825
  }
813
826
  )
814
827
  ] });
815
- }, Ee = (e) => e, Le = (e) => {
816
- const { columns: s, softDeleteProperty: r = "deleted", data: n, actions: a } = e, l = C(
817
- () => s.sort((o, c) => (c.pos ?? 0) - (o.pos ?? 0)).filter((o) => o.display !== "none"),
818
- [s]
828
+ }, ze = (e) => e, Ee = (e) => {
829
+ const { columns: a, softDeleteProperty: r = "deleted", data: n, actions: s } = e, l = y(
830
+ () => a.sort((o, c) => (c.pos ?? 0) - (o.pos ?? 0)).filter((o) => o.display !== "none"),
831
+ [a]
819
832
  );
820
833
  return n == null ? void 0 : n.map((o) => {
821
834
  var c;
822
- return /* @__PURE__ */ b(
835
+ return /* @__PURE__ */ v(
823
836
  "tr",
824
837
  {
825
838
  className: `table-row ${o[r] ? "deleted-class" : ""}`,
826
839
  children: [
827
- l == null ? void 0 : l.map((i, m) => /* @__PURE__ */ t(
840
+ l == null ? void 0 : l.map((i, N) => /* @__PURE__ */ t(
828
841
  "td",
829
842
  {
830
- className: `table-row-cell ${m === 0 ? "basic" : ""} ${i.className ?? ""}`,
831
- children: i.renderBody ? i.renderBody(o[i.key], o) : Ee(o[i.key])
843
+ className: `table-row-cell ${N === 0 ? "basic" : ""} ${i.className ?? ""}`,
844
+ children: i.renderBody ? i.renderBody(o[i.key], o) : ze(o[i.key])
832
845
  },
833
846
  i.key
834
847
  )),
835
- a ? /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", { className: "table-row-cell-action", children: (c = a(o).filter((i) => !i.hidden)) == null ? void 0 : c.map((i) => /* @__PURE__ */ t(Fe, { content: i.tooltip, children: /* @__PURE__ */ t("button", { onClick: () => i.onClick(o), children: i.icon }) }, i.id)) }) }) : null
848
+ s ? /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t("div", { className: "table-row-cell-action", children: (c = s(o).filter((i) => !i.hidden)) == null ? void 0 : c.map((i) => /* @__PURE__ */ t(Le, { content: i.tooltip, children: /* @__PURE__ */ t("button", { onClick: () => i.onClick(o), children: i.icon }) }, i.id)) }) }) : null
836
849
  ]
837
850
  },
838
851
  o.id
839
852
  );
840
853
  });
841
854
  };
842
- function je(e) {
855
+ function Me(e) {
843
856
  const {
844
- title: s = "",
857
+ title: a = "",
845
858
  data: r,
846
859
  onSort: n,
847
- entity: a = "",
860
+ entity: s = "",
848
861
  isLoading: l = !1,
849
862
  actions: o,
850
863
  columns: c = [],
851
864
  contentClassName: i = "",
852
- className: m = "",
853
- toolbar: d = /* @__PURE__ */ t(D, {}),
854
- softDeleteProperty: u = "deleted"
855
- } = e, f = C(() => c ? c.sort((p, v) => (v.pos ?? 0) - (p.pos ?? 0)).filter((p) => !!p.filterOptions).map((p) => {
856
- var v;
865
+ className: N = "",
866
+ toolbar: u = /* @__PURE__ */ t(D, {}),
867
+ softDeleteProperty: h = "deleted"
868
+ } = e, m = y(() => c ? c.sort((p, g) => (g.pos ?? 0) - (p.pos ?? 0)).filter((p) => !!p.filterOptions).map((p) => {
869
+ var g;
857
870
  return {
858
871
  ...p.filterOptions,
859
- label: ((v = p.filterOptions) == null ? void 0 : v.label) ?? p.label,
872
+ label: ((g = p.filterOptions) == null ? void 0 : g.label) ?? p.label,
860
873
  propertyName: p.key
861
874
  };
862
- }) : [], [c]), h = C(() => !(r != null && r.length), [r]);
863
- return /* @__PURE__ */ t(me, { children: /* @__PURE__ */ b("div", { className: `${m} table-main`, children: [
864
- /* @__PURE__ */ b("div", { className: "table-header", children: [
865
- /* @__PURE__ */ t("h1", { className: "table-header-title", children: s }),
866
- l ? null : /* @__PURE__ */ b("div", { className: "table-header-right", children: [
867
- d,
868
- /* @__PURE__ */ t(Oe, { filters: f })
875
+ }) : [], [c]), d = y(() => !(r != null && r.length), [r]);
876
+ return /* @__PURE__ */ t(be, { children: /* @__PURE__ */ v("div", { className: `${N} table-main`, children: [
877
+ /* @__PURE__ */ v("div", { className: "table-header", children: [
878
+ /* @__PURE__ */ t("h1", { className: "table-header-title", children: a }),
879
+ l ? null : /* @__PURE__ */ v("div", { className: "table-header-right", children: [
880
+ u,
881
+ !!m && !!m.length && /* @__PURE__ */ t(Oe, { filters: m })
869
882
  ] })
870
883
  ] }),
871
- l ? /* @__PURE__ */ t(de, { className: "table-loading" }) : /* @__PURE__ */ t(D, { children: h ? /* @__PURE__ */ t(ge, {}) : /* @__PURE__ */ b(D, { children: [
872
- /* @__PURE__ */ t("div", { className: `${i} table-body`, children: /* @__PURE__ */ b("table", { className: "table-content", children: [
884
+ l ? /* @__PURE__ */ t(ue, { className: "table-loading" }) : /* @__PURE__ */ t(D, { children: d ? /* @__PURE__ */ t(ve, {}) : /* @__PURE__ */ v(D, { children: [
885
+ /* @__PURE__ */ t("div", { className: `${i} table-body`, children: /* @__PURE__ */ v("table", { className: "table-content", children: [
873
886
  /* @__PURE__ */ t(
874
- be,
887
+ ge,
875
888
  {
876
- entity: a,
889
+ entity: s,
877
890
  columns: c,
878
891
  onSortCallback: n,
879
892
  hasAction: !!o
880
893
  }
881
894
  ),
882
895
  /* @__PURE__ */ t("tbody", { children: /* @__PURE__ */ t(
883
- Le,
896
+ Ee,
884
897
  {
885
898
  data: r,
886
899
  actions: o,
887
900
  columns: c,
888
- softDeleteProperty: u
901
+ softDeleteProperty: h
889
902
  }
890
903
  ) })
891
904
  ] }) }),
892
- /* @__PURE__ */ t(ye, {})
905
+ /* @__PURE__ */ t(we, {})
893
906
  ] }) })
894
907
  ] }) });
895
908
  }
896
- function Fe(e) {
897
- const { content: s, children: r } = e;
898
- return /* @__PURE__ */ b("div", { className: "tooltip-container", children: [
909
+ function Le(e) {
910
+ const { content: a, children: r } = e;
911
+ return /* @__PURE__ */ v("div", { className: "tooltip-container", children: [
899
912
  r,
900
- /* @__PURE__ */ t("div", { className: "tooltip-text", children: s })
913
+ /* @__PURE__ */ t("div", { className: "tooltip-text", children: a })
901
914
  ] });
902
915
  }
903
- var z = /* @__PURE__ */ ((e) => (e.empty = "empty", e.outlined = "outlined", e.default = "default", e))(z || {});
916
+ var O = /* @__PURE__ */ ((e) => (e.empty = "empty", e.outlined = "outlined", e.default = "default", e))(O || {});
904
917
  function Te(e) {
905
918
  const {
906
- label: s,
919
+ label: a,
907
920
  onDelete: r,
908
921
  className: n = "",
909
- spanClassName: a = "",
910
- variant: l = z.default
911
- } = e, o = C(() => {
922
+ spanClassName: s = "",
923
+ variant: l = O.default
924
+ } = e, o = y(() => {
912
925
  switch (l) {
913
- case z.empty:
926
+ case O.empty:
914
927
  return "text-primary bg-transparent";
915
- case z.outlined:
928
+ case O.outlined:
916
929
  return "border border-primary";
917
- case z.default:
930
+ case O.default:
918
931
  default:
919
932
  return "text-white bg-primary";
920
933
  }
921
- }, [l]), c = C(() => {
934
+ }, [l]), c = y(() => {
922
935
  switch (l) {
923
- case z.empty:
924
- case z.outlined:
936
+ case O.empty:
937
+ case O.outlined:
925
938
  return "chip-delete-button-svg";
926
- case z.default:
939
+ case O.default:
927
940
  default:
928
941
  return "filled-chip-delete-button-svg";
929
942
  }
930
943
  }, [l]);
931
- return /* @__PURE__ */ b("div", { className: `chip-main ${o} ${n}`, children: [
932
- /* @__PURE__ */ t("span", { className: a, children: s }),
944
+ return /* @__PURE__ */ v("div", { className: `chip-main ${o} ${n}`, children: [
945
+ /* @__PURE__ */ t("span", { className: s, children: a }),
933
946
  r ? /* @__PURE__ */ t("button", { type: "button", className: "chip-delete-button", onClick: r, children: /* @__PURE__ */ t(K, { className: c }) }) : null
934
947
  ] });
935
948
  }
936
949
  export {
937
- ie as AutocompleteInput,
938
- ce as CheckInput,
950
+ de as AutocompleteInput,
951
+ ie as CheckInput,
939
952
  se as ChevronDown,
940
- le as ChevronLeft,
941
- re as ChevronRight,
942
- ae as ChevronUp,
953
+ oe as ChevronLeft,
954
+ le as ChevronRight,
955
+ re as ChevronUp,
943
956
  Te as Chip,
944
- z as ChipVariant,
957
+ O as ChipVariant,
945
958
  K as Close,
946
- be as Columns,
947
- Ne as CountOfTotal,
948
- ge as Empty,
959
+ ge as Columns,
960
+ fe as CountOfTotal,
961
+ ve as Empty,
949
962
  Oe as FilterPopup,
950
963
  E as FilterTypes,
951
- oe as Filters,
952
- $ as FiltersActions,
953
- me as FiltersProvider,
954
- ye as Footer,
955
- de as Loading,
956
- ve as Navigation,
957
- fe as PageSize,
958
- Le as Rows,
959
- J as SelectInput,
960
- _ as SortOrder,
961
- R as State,
962
- je as Table,
963
- Me as TableOptionsProvider,
964
- U as TextInput,
965
- Fe as Tooltip,
966
- De as TranslationProvider,
967
- he as filtersReducer,
968
- X as helperTextStateClassName,
969
- pe as initializer,
964
+ ce as Filters,
965
+ k as FiltersActions,
966
+ be as FiltersProvider,
967
+ we as Footer,
968
+ ue as Loading,
969
+ Ne as Navigation,
970
+ Ce as PageSize,
971
+ Ee as Rows,
972
+ q as SelectInput,
973
+ F as SortOrder,
974
+ U as State,
975
+ Me as Table,
976
+ De as TableOptionsProvider,
977
+ j as TextInput,
978
+ Le as Tooltip,
979
+ Be as TranslationProvider,
980
+ me as filtersReducer,
981
+ Y as helperTextStateClassName,
982
+ he as initializer,
970
983
  Q as inputStateClassName,
971
- V as labelStateClassName,
972
- ze as renderFilterComponent,
973
- T as useFilters,
974
- F as useTableOptions,
984
+ X as labelStateClassName,
985
+ Pe as renderFilterComponent,
986
+ _ as useFilters,
987
+ T as useTableOptions,
975
988
  L as useTranslation
976
989
  };