@sito/dashboard 0.0.44 → 0.0.45

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