@sito/dashboard 0.0.42 → 0.0.44

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