@foi/design-system 0.0.16 → 0.0.17

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/index.d.ts CHANGED
@@ -14,9 +14,10 @@ export { default as Switch } from './components/atoms/Switch';
14
14
  export { default as DataGrid } from './components/organisms/DataGrid';
15
15
  export type { DataGridProps, DataGridColumn, DataGridColumnType, DataGridFilterType, DataGridFilterOption, DataGridFilter, DataGridFetchParams, DataGridFetchResult, DataGridPaginationType, } from './components/organisms/DataGrid';
16
16
  export { default as CheckboxGroup } from './components/molecules/CheckboxGroup';
17
+ export { default as CheckboxTree } from './components/molecules/CheckboxTree';
18
+ export { default as Modal } from './components/molecules/Modal';
17
19
  export { default as Pagination } from './components/atoms/Pagination';
18
20
  export type { PaginationProps } from './components/atoms/Pagination';
19
- export { default as CheckboxTree } from './components/molecules/CheckboxTree';
20
21
  export { default as RadioGroup } from './components/molecules/RadioGroup';
21
22
  export { default as ThemeProvider } from './hocs/ThemeProvider';
22
23
  export type { Theme } from './hocs/ThemeProvider/ThemeProvider.interface';
@@ -33,4 +34,5 @@ export type { SliderStyleProps } from './components/atoms/Slider/Slider.interfac
33
34
  export type { SwitchStyleProps } from './components/atoms/Switch/Switch.interface';
34
35
  export type { CheckboxGroupStyleProps } from './components/molecules/CheckboxGroup/CheckboxGroup.interface';
35
36
  export type { CheckboxTreeStyleProps } from './components/molecules/CheckboxTree/CheckboxTree.interface';
37
+ export type { ModalStyleProps } from './components/molecules/Modal/Modal.interface';
36
38
  export type { RadioGroupStyleProps } from './components/molecules/RadioGroup/RadioGroup.interface';
package/dist/index.mjs CHANGED
@@ -1,14 +1,14 @@
1
1
  import { i as e, n as t, r as n, t as r } from "./emotion-react-jsx-runtime.browser.esm-Ch-DwUYg.js";
2
2
  import { n as i, r as a } from "./theme-D01EcUA9.js";
3
- import { a as o, n as s, o as c } from "./RadioGroup.context-BBa8PDLt.js";
4
- import { a as l, c as u, i as d, l as f, n as p, o as m, r as h, s as g, t as _ } from "./Switch-BNFdKefE.js";
5
- import { n as v, r as y, t as b } from "./RadioGroup-BdWsLUz-.js";
6
- import { t as x } from "./ThemeProvider-C47pyWG6.js";
7
- import { useCallback as S, useEffect as C, useLayoutEffect as ee, useMemo as w, useRef as T, useState as E } from "react";
8
- import { css as D, keyframes as O } from "@emotion/react";
3
+ import { n as o, o as s, r as c, s as l } from "./RadioGroup.context-Bu218uUX.js";
4
+ import { a as u, c as d, i as f, n as p, o as m, r as h, s as g, t as _ } from "./Switch-oAVuMb0V.js";
5
+ import { i as v, n as y, r as b, t as x } from "./RadioGroup-DzEJw4WJ.js";
6
+ import { t as S } from "./ThemeProvider-C47pyWG6.js";
7
+ import { useCallback as C, useEffect as w, useLayoutEffect as ee, useMemo as T, useRef as E, useState as D } from "react";
8
+ import { css as O, keyframes as te } from "@emotion/react";
9
9
  import k from "react-dom";
10
10
  //#region src/components/atoms/Skeleton/Skeleton.emotion.ts
11
- var A = D`
11
+ var A = O`
12
12
  &.--SKELETON {
13
13
  display: block;
14
14
  background: linear-gradient(
@@ -18,7 +18,7 @@ var A = D`
18
18
  rgba(255, 255, 255, 0.05) 100%
19
19
  );
20
20
  background-size: 200% 100%;
21
- animation: ${O`
21
+ animation: ${te`
22
22
  0% { background-position: 200% center; }
23
23
  100% { background-position: -200% center; }
24
24
  `} 1.4s ease infinite;
@@ -43,7 +43,7 @@ var A = D`
43
43
  height: r
44
44
  },
45
45
  "aria-hidden": "true"
46
- }), te = (e) => D`
46
+ }), ne = (e) => O`
47
47
  &.--DATAGRID {
48
48
  width: 100%;
49
49
  box-sizing: border-box;
@@ -222,7 +222,7 @@ var A = D`
222
222
  ${a(e, "border-width", `--DATAGRIDMENU-${t}-BORDER-WIDTH`)}
223
223
  ${a(e, "border-style", `--DATAGRIDMENU-${t}-BORDER-STYLE`)}
224
224
  ${a(e, "border-radius", `--DATAGRIDMENU-${t}-BORDER-RADIUS`)}
225
- `, N = (e) => D`
225
+ `, N = (e) => O`
226
226
  &.--DATAGRIDMENU {
227
227
  position: fixed;
228
228
  z-index: 200;
@@ -311,12 +311,12 @@ var A = D`
311
311
  width: "full",
312
312
  autoFocus: !0,
313
313
  "data-testid": `${P}-searchInput-${e}`,
314
- startAdornment: /* @__PURE__ */ t(o, {
314
+ startAdornment: /* @__PURE__ */ t(s, {
315
315
  name: "search",
316
316
  style: { color: "white" }
317
317
  })
318
318
  })
319
- }), I = "--DATAGRIDMENU", L = ({ filterType: e, columnKey: i, options: a, pendingMulti: o, onMultiChange: c, multiSearch: l, onMultiSearchChange: u }) => {
319
+ }), I = "--DATAGRIDMENU", L = ({ filterType: e, columnKey: i, options: a, pendingMulti: o, onMultiChange: s, multiSearch: l, onMultiSearchChange: u }) => {
320
320
  let d = e === "multiselect-search", f = a.filter((e) => !l || e.label.toLowerCase().includes(l.toLowerCase()));
321
321
  return /* @__PURE__ */ n(r, { children: [d && /* @__PURE__ */ t("div", {
322
322
  className: `${I}-searchInput`,
@@ -339,17 +339,17 @@ var A = D`
339
339
  className: `${I}-optionDot`,
340
340
  style: { backgroundColor: e.color },
341
341
  "aria-hidden": "true"
342
- }), /* @__PURE__ */ t(s, {
342
+ }), /* @__PURE__ */ t(c, {
343
343
  checked: o.includes(e.value),
344
- onChecked: (t) => c(t ? [...o, e.value] : o.filter((t) => t !== e.value)),
344
+ onChecked: (t) => s(t ? [...o, e.value] : o.filter((t) => t !== e.value)),
345
345
  label: e.label,
346
346
  showErrorText: !1,
347
347
  "data-testid": `${I}-option-${i}-${e.value}`
348
348
  })]
349
349
  }, e.value))
350
350
  })] });
351
- }, R = "--DATAGRIDMENU", z = ({ filterType: e, options: r, columnKey: i, filterTitle: a, searchLabel: s, cancelLabel: c = "Cancel", applyLabel: l = "Apply", pendingSearch: d, onSearchChange: p, pendingMulti: m, onMultiChange: h, multiSearch: g, onMultiSearchChange: _, onCancel: v, onApply: y, onClear: b, anchorEl: x, style: S }) => {
352
- let C = T(null);
351
+ }, R = "--DATAGRIDMENU", z = ({ filterType: e, options: r, columnKey: i, filterTitle: a, searchLabel: c, cancelLabel: l = "Cancel", applyLabel: u = "Apply", pendingSearch: f, onSearchChange: p, pendingMulti: m, onMultiChange: h, multiSearch: g, onMultiSearchChange: _, onCancel: v, onApply: y, onClear: b, anchorEl: x, style: S }) => {
352
+ let C = E(null);
353
353
  return ee(() => {
354
354
  if (!x) return;
355
355
  let e = () => {
@@ -372,8 +372,8 @@ var A = D`
372
372
  children: [/* @__PURE__ */ t("span", {
373
373
  className: `${R}-headerTitle`,
374
374
  children: a
375
- }), /* @__PURE__ */ t(u, {
376
- icon: /* @__PURE__ */ t(o, {
375
+ }), /* @__PURE__ */ t(o, {
376
+ icon: /* @__PURE__ */ t(s, {
377
377
  name: "delete_outline",
378
378
  size: "sm"
379
379
  }),
@@ -386,9 +386,9 @@ var A = D`
386
386
  className: `${R}-content`,
387
387
  children: [e === "search" && /* @__PURE__ */ t(F, {
388
388
  columnKey: i,
389
- pendingSearch: d,
389
+ pendingSearch: f,
390
390
  onSearchChange: p,
391
- searchLabel: s
391
+ searchLabel: c
392
392
  }), (e === "multiselect" || e === "multiselect-search") && /* @__PURE__ */ t(L, {
393
393
  filterType: e,
394
394
  columnKey: i,
@@ -401,27 +401,27 @@ var A = D`
401
401
  }),
402
402
  /* @__PURE__ */ n("div", {
403
403
  className: `${R}-actions`,
404
- children: [/* @__PURE__ */ t(f, {
404
+ children: [/* @__PURE__ */ t(d, {
405
405
  onClick: v,
406
406
  "data-testid": `${R}-cancelBtn-${i}`,
407
407
  variant: "ghost",
408
- children: c
409
- }), /* @__PURE__ */ t(f, {
408
+ children: l
409
+ }), /* @__PURE__ */ t(d, {
410
410
  onClick: y,
411
411
  "data-testid": `${R}-applyBtn-${i}`,
412
- children: l
412
+ children: u
413
413
  })]
414
414
  })
415
415
  ]
416
416
  }), document.body);
417
- }, ne = ({ theme: n, variant: r = "default", ...i }) => {
418
- let { componentStyles: a } = e([c.DATAGRIDMENU], n, r.toUpperCase());
417
+ }, re = ({ theme: n, variant: r = "default", ...i }) => {
418
+ let { componentStyles: a } = e([l.DATAGRIDMENU], n, r.toUpperCase());
419
419
  return /* @__PURE__ */ t(z, {
420
420
  ...i,
421
421
  style: a
422
422
  });
423
- }, B = "--DATAGRID", re = ({ columns: e, pageSize: n }) => {
424
- let i = w(() => Array.from({ length: n }, () => e.map((e) => e.type === "options" ? null : `${Math.floor(Math.random() * 51) + 40}%`)), [n, e.length]);
423
+ }, B = "--DATAGRID", ie = ({ columns: e, pageSize: n }) => {
424
+ let i = T(() => Array.from({ length: n }, () => e.map((e) => e.type === "options" ? null : `${Math.floor(Math.random() * 51) + 40}%`)), [n, e.length]);
425
425
  return /* @__PURE__ */ t(r, { children: Array.from({ length: n }).map((n, r) => /* @__PURE__ */ t("tr", {
426
426
  className: `${B}-row`,
427
427
  children: e.map((e, n) => /* @__PURE__ */ t("td", {
@@ -436,7 +436,7 @@ var A = D`
436
436
  })
437
437
  }, e.key))
438
438
  }, r)) });
439
- }, V = (e) => D`
439
+ }, V = (e) => O`
440
440
  &.--PAGINATION {
441
441
  display: flex;
442
442
  align-items: center;
@@ -495,7 +495,7 @@ var A = D`
495
495
  ${a(e, "border-width", `--PAGINATIONMENU-${t}-BORDER-WIDTH`)}
496
496
  ${a(e, "border-style", `--PAGINATIONMENU-${t}-BORDER-STYLE`)}
497
497
  ${a(e, "border-radius", `--PAGINATIONMENU-${t}-BORDER-RADIUS`)}
498
- `, G = (e) => D`
498
+ `, G = (e) => O`
499
499
  &.--PAGINATIONMENU {
500
500
  position: absolute;
501
501
  bottom: calc(100% + ${e["--PAGINATIONMENU-ROOT-BOTTOM"] || ""});
@@ -570,16 +570,16 @@ var A = D`
570
570
  }, e);
571
571
  })
572
572
  }), J = ({ theme: n, variant: r = "default", ...i }) => {
573
- let { componentStyles: a } = e([c.PAGINATIONMENU], n, r.toUpperCase());
573
+ let { componentStyles: a } = e([l.PAGINATIONMENU], n, r.toUpperCase());
574
574
  return /* @__PURE__ */ t(q, {
575
575
  ...i,
576
576
  style: a
577
577
  });
578
- }, Y = "--PAGINATION", X = ({ page: e, total: r, pageSize: i, onPageChange: a, pageSizeOptions: s, onPageSizeChange: c, loading: l, className: d, style: f }) => {
579
- let [p, m] = E(!1), [h, g] = E(-1), _ = Math.max(1, Math.ceil(r / i)), v = e * i + 1, y = Math.min((e + 1) * i, r), b = e === 0, x = e >= _ - 1, S = () => {
578
+ }, Y = "--PAGINATION", X = ({ page: e, total: r, pageSize: i, onPageChange: a, pageSizeOptions: c, onPageSizeChange: l, loading: u, className: d, style: f }) => {
579
+ let [p, m] = D(!1), [h, g] = D(-1), _ = Math.max(1, Math.ceil(r / i)), v = e * i + 1, y = Math.min((e + 1) * i, r), b = e === 0, x = e >= _ - 1, S = () => {
580
580
  m(!1), g(-1);
581
581
  };
582
- return C(() => {
582
+ return w(() => {
583
583
  if (!p) return;
584
584
  let e = (e) => {
585
585
  e.target.closest(`.${Y}-rowsControl`) || (m(!1), g(-1));
@@ -588,14 +588,14 @@ var A = D`
588
588
  }, [p]), /* @__PURE__ */ n("div", {
589
589
  className: [Y, d || ""].filter(Boolean).join(" "),
590
590
  css: V(f ?? {}),
591
- children: [s && s.length > 0 && /* @__PURE__ */ n("div", {
591
+ children: [c && c.length > 0 && /* @__PURE__ */ n("div", {
592
592
  className: `${Y}-rowsControl`,
593
593
  children: [
594
594
  p && /* @__PURE__ */ t(J, {
595
- options: s,
595
+ options: c,
596
596
  activeOption: i,
597
597
  onSelect: (e) => {
598
- c?.(e), S();
598
+ l?.(e), S();
599
599
  },
600
600
  focusedElement: h
601
601
  }),
@@ -603,19 +603,19 @@ var A = D`
603
603
  className: `${Y}-rowsSize`,
604
604
  children: i
605
605
  }),
606
- /* @__PURE__ */ t(u, {
607
- icon: /* @__PURE__ */ t(o, {
606
+ /* @__PURE__ */ t(o, {
607
+ icon: /* @__PURE__ */ t(s, {
608
608
  name: "arrow_drop_up",
609
609
  size: "sm"
610
610
  }),
611
611
  onClick: () => p ? S() : m(!0),
612
612
  onKeyDown: (e) => {
613
613
  if (e.key === "Tab" || e.key === "Escape") m(!1), g(-1);
614
- else if (["ArrowDown", "ArrowUp"].includes(e.key) && p) e.preventDefault(), e.key === "ArrowDown" ? g((e) => e + 1 >= (s?.length ?? 0) ? 0 : e + 1) : g((e) => e - 1 < 0 ? (s?.length ?? 1) - 1 : e - 1);
615
- else if (e.key === "Enter" && p && h >= 0 && s) {
614
+ else if (["ArrowDown", "ArrowUp"].includes(e.key) && p) e.preventDefault(), e.key === "ArrowDown" ? g((e) => e + 1 >= (c?.length ?? 0) ? 0 : e + 1) : g((e) => e - 1 < 0 ? (c?.length ?? 1) - 1 : e - 1);
615
+ else if (e.key === "Enter" && p && h >= 0 && c) {
616
616
  e.preventDefault();
617
- let t = s[h];
618
- t !== void 0 && (c?.(t), m(!1), g(-1));
617
+ let t = c[h];
618
+ t !== void 0 && (l?.(t), m(!1), g(-1));
619
619
  }
620
620
  },
621
621
  isFlipped: p,
@@ -636,177 +636,177 @@ var A = D`
636
636
  r
637
637
  ]
638
638
  }),
639
- /* @__PURE__ */ t(u, {
640
- icon: /* @__PURE__ */ t(o, {
639
+ /* @__PURE__ */ t(o, {
640
+ icon: /* @__PURE__ */ t(s, {
641
641
  name: "first_page",
642
642
  size: "sm"
643
643
  }),
644
644
  onClick: () => a(0),
645
- disabled: l || b,
645
+ disabled: u || b,
646
646
  "aria-label": "First page",
647
647
  "data-testid": `${Y}-first`
648
648
  }),
649
- /* @__PURE__ */ t(u, {
650
- icon: /* @__PURE__ */ t(o, {
649
+ /* @__PURE__ */ t(o, {
650
+ icon: /* @__PURE__ */ t(s, {
651
651
  name: "chevron_left",
652
652
  size: "sm"
653
653
  }),
654
654
  onClick: () => a(e - 1),
655
- disabled: l || b,
655
+ disabled: u || b,
656
656
  "aria-label": "Previous page",
657
657
  "data-testid": `${Y}-prev`
658
658
  }),
659
- /* @__PURE__ */ t(u, {
660
- icon: /* @__PURE__ */ t(o, {
659
+ /* @__PURE__ */ t(o, {
660
+ icon: /* @__PURE__ */ t(s, {
661
661
  name: "chevron_right",
662
662
  size: "sm"
663
663
  }),
664
664
  onClick: () => a(e + 1),
665
- disabled: l || x,
665
+ disabled: u || x,
666
666
  "aria-label": "Next page",
667
667
  "data-testid": `${Y}-next`
668
668
  }),
669
- /* @__PURE__ */ t(u, {
670
- icon: /* @__PURE__ */ t(o, {
669
+ /* @__PURE__ */ t(o, {
670
+ icon: /* @__PURE__ */ t(s, {
671
671
  name: "last_page",
672
672
  size: "sm"
673
673
  }),
674
674
  onClick: () => a(_ - 1),
675
- disabled: l || x,
675
+ disabled: u || x,
676
676
  "aria-label": "Last page",
677
677
  "data-testid": `${Y}-last`
678
678
  })
679
679
  ]
680
680
  })]
681
681
  });
682
- }, ie = ({ theme: n, variant: r = "default", ...i }) => {
683
- let { componentStyles: a } = e([c.PAGINATION], n, r.toUpperCase());
682
+ }, ae = ({ theme: n, variant: r = "default", ...i }) => {
683
+ let { componentStyles: a } = e([l.PAGINATION], n, r.toUpperCase());
684
684
  return /* @__PURE__ */ t(X, {
685
685
  ...i,
686
686
  style: a
687
687
  });
688
- }, Z = "--DATAGRID", ae = 10, Q = ({ columns: e, onFetch: i, paginationType: a = "pagination", pageSize: s = ae, pageSizeOptions: c, emptyContent: l = /* @__PURE__ */ t("span", { children: "No se han encontrado resultados" }), loadingMoreContent: d = /* @__PURE__ */ t("span", { children: "Cargando..." }), className: f, style: p }) => {
689
- let [m, h] = E([]), [g, _] = E(0), [v, y] = E(0), [b, x] = E(s), [w, D] = E(!0), [O, k] = E(null), [A, j] = E({}), [M, N] = E(null), [P, F] = E(null), [I, L] = E(""), [R, z] = E([]), [B, V] = E(""), [H, U] = E([]), [W, G] = E(0), K = T({}), q = T(null), J = T(null);
690
- C(() => {
688
+ }, Z = "--DATAGRID", oe = 10, se = ({ columns: e, onFetch: i, paginationType: a = "pagination", pageSize: c = oe, pageSizeOptions: l, emptyContent: u = /* @__PURE__ */ t("span", { children: "No se han encontrado resultados" }), loadingMoreContent: d = /* @__PURE__ */ t("span", { children: "Cargando..." }), className: f, style: p }) => {
689
+ let [m, h] = D([]), [g, _] = D(0), [v, y] = D(0), [b, x] = D(c), [S, T] = D(!0), [O, te] = D(null), [k, A] = D({}), [j, M] = D(null), [N, P] = D(null), [F, I] = D(""), [L, R] = D([]), [z, B] = D(""), [V, H] = D([]), [U, W] = D(0), G = E({}), K = E(null), q = E(null);
690
+ w(() => {
691
691
  let e = !1;
692
692
  return i({
693
693
  page: v,
694
694
  pageSize: b,
695
- filters: A,
695
+ filters: k,
696
696
  sort: O ?? void 0
697
697
  }).then((t) => {
698
- e || (h((e) => a === "scroll" && v > 0 ? [...e, ...t.data] : t.data), _(t.total), D(!1));
698
+ e || (h((e) => a === "scroll" && v > 0 ? [...e, ...t.data] : t.data), _(t.total), T(!1));
699
699
  }), () => {
700
700
  e = !0;
701
701
  };
702
702
  }, [
703
703
  v,
704
704
  b,
705
- A,
705
+ k,
706
706
  O,
707
707
  a,
708
708
  i
709
709
  ]), ee(() => {
710
- a !== "scroll" || !q.current || !J.current || (U(Array.from(q.current.querySelectorAll(`th:not(.${Z}-thScrollbarSpacer)`)).map((e) => e.offsetWidth)), G(J.current.offsetWidth - J.current.clientWidth));
710
+ a !== "scroll" || !K.current || !q.current || (H(Array.from(K.current.querySelectorAll(`th:not(.${Z}-thScrollbarSpacer)`)).map((e) => e.offsetWidth)), W(q.current.offsetWidth - q.current.clientWidth));
711
711
  }, [
712
712
  a,
713
713
  e.length,
714
- w
715
- ]), C(() => {
716
- if (!M) return;
714
+ S
715
+ ]), w(() => {
716
+ if (!j) return;
717
717
  let e = (e) => {
718
- e.target.closest(`[data-popover-key="${M}"]`) || N(null);
718
+ e.target.closest(`[data-popover-key="${j}"]`) || M(null);
719
719
  };
720
720
  return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
721
- }, [M]);
722
- let Y = (e) => {
721
+ }, [j]);
722
+ let J = (e) => {
723
723
  if (!e.filter) return;
724
- if (M === e.key) {
725
- N(null), F(null);
724
+ if (j === e.key) {
725
+ M(null), P(null);
726
726
  return;
727
727
  }
728
- let t = A[e.key];
729
- e.filter.type === "search" ? L(typeof t == "string" ? t : "") : (z(Array.isArray(t) ? t : []), V("")), F(K.current[e.key] ?? null), N(e.key);
730
- }, X = (e) => {
728
+ let t = k[e.key];
729
+ e.filter.type === "search" ? I(typeof t == "string" ? t : "") : (R(Array.isArray(t) ? t : []), B("")), P(G.current[e.key] ?? null), M(e.key);
730
+ }, Y = (e) => {
731
731
  if (!e.filter) return;
732
- let t = e.filter.type === "search" ? I : R;
733
- D(!0), j((n) => ({
732
+ let t = e.filter.type === "search" ? F : L;
733
+ T(!0), A((n) => ({
734
734
  ...n,
735
735
  [e.key]: t
736
- })), y(0), N(null);
737
- }, Q = (e) => {
738
- let t = A[e];
736
+ })), y(0), M(null);
737
+ }, X = (e) => {
738
+ let t = k[e];
739
739
  return t == null ? !1 : Array.isArray(t) ? t.length > 0 : t !== "";
740
- }, oe = (e) => {
741
- D(!0), k((t) => t?.key === e ? {
740
+ }, se = (e) => {
741
+ T(!0), te((t) => t?.key === e ? {
742
742
  key: e,
743
743
  direction: t.direction === "asc" ? "desc" : "asc"
744
744
  } : {
745
745
  key: e,
746
746
  direction: "asc"
747
747
  }), y(0);
748
- }, se = (e) => {
749
- D(!0), y(e);
748
+ }, Q = (e) => {
749
+ T(!0), y(e);
750
750
  }, ce = (e) => {
751
- D(!0), x(e), y(0);
752
- }, le = S((e) => {
753
- if (a !== "scroll" || w || m.length >= g) return;
751
+ T(!0), x(e), y(0);
752
+ }, le = C((e) => {
753
+ if (a !== "scroll" || S || m.length >= g) return;
754
754
  let { scrollTop: t, scrollHeight: n, clientHeight: r } = e.currentTarget;
755
- n - t - r < 48 && (D(!0), y((e) => e + 1));
755
+ n - t - r < 48 && (T(!0), y((e) => e + 1));
756
756
  }, [
757
757
  a,
758
- w,
758
+ S,
759
759
  m.length,
760
760
  g
761
- ]), ue = e.length, $ = M ? e.find((e) => e.key === M) : void 0, de = b * 48, fe = !w && m.length === 0, pe = e.map((e) => /* @__PURE__ */ t("th", {
761
+ ]), ue = e.length, $ = j ? e.find((e) => e.key === j) : void 0, de = b * 48, fe = !S && m.length === 0, pe = e.map((e) => /* @__PURE__ */ t("th", {
762
762
  className: [`${Z}-th`, e.type === "options" ? `${Z}-thOptions` : ""].join(" "),
763
763
  style: e.width ? { width: e.width } : void 0,
764
764
  children: /* @__PURE__ */ n("div", {
765
765
  className: `${Z}-thInner`,
766
766
  "data-testid": `${Z}-th-${e.key}`,
767
- children: [/* @__PURE__ */ t("span", {
767
+ children: [typeof e.label == "string" ? /* @__PURE__ */ t("span", {
768
768
  className: `${Z}-thLabel`,
769
769
  children: e.label
770
- }), e.type !== "options" && /* @__PURE__ */ n("div", {
770
+ }) : e.label, e.type !== "options" && /* @__PURE__ */ n("div", {
771
771
  className: `${Z}-thActions`,
772
772
  children: [e.filter && /* @__PURE__ */ t("div", {
773
773
  className: `${Z}-filterContainer`,
774
774
  "data-popover-key": e.key,
775
775
  children: /* @__PURE__ */ t("span", {
776
776
  ref: (t) => {
777
- K.current[e.key] = t;
777
+ G.current[e.key] = t;
778
778
  },
779
- children: /* @__PURE__ */ t(u, {
780
- icon: /* @__PURE__ */ t(o, {
781
- name: Q(e.key) ? "filter_alt" : "filter_list",
779
+ children: /* @__PURE__ */ t(o, {
780
+ icon: /* @__PURE__ */ t(s, {
781
+ name: X(e.key) ? "filter_alt" : "filter_list",
782
782
  size: "sm",
783
- style: { color: Q(e.key) ? "white" : "" }
783
+ style: { color: X(e.key) ? "white" : "" }
784
784
  }),
785
- onClick: () => Y(e),
785
+ onClick: () => J(e),
786
786
  "data-testid": `${Z}-filterBtn-${e.key}`,
787
787
  "aria-label": `Filter ${e.label}`
788
788
  })
789
789
  })
790
- }), e.sortable !== !1 && /* @__PURE__ */ t(u, {
791
- icon: /* @__PURE__ */ t(o, {
790
+ }), e.sortable !== !1 && /* @__PURE__ */ t(o, {
791
+ icon: /* @__PURE__ */ t(s, {
792
792
  name: O?.key === e.key ? O.direction === "asc" ? "arrow_upward" : "arrow_downward" : "unfold_more",
793
793
  size: "sm",
794
794
  style: { color: O?.key === e.key ? "white" : "" }
795
795
  }),
796
- onClick: () => oe(e.key),
796
+ onClick: () => se(e.key),
797
797
  "data-testid": `${Z}-sortBtn-${e.key}`,
798
798
  "aria-label": `Sort ${e.label}`
799
799
  })]
800
800
  })]
801
801
  })
802
- }, e.key)), me = w && (a !== "scroll" || m.length === 0) ? /* @__PURE__ */ t(re, {
802
+ }, e.key)), me = S && (a !== "scroll" || m.length === 0) ? /* @__PURE__ */ t(ie, {
803
803
  columns: e,
804
804
  pageSize: b
805
805
  }) : fe ? /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
806
806
  colSpan: ue,
807
807
  className: `${Z}-emptyCell`,
808
808
  style: { height: `${de}px` },
809
- children: l
809
+ children: u
810
810
  }) }) : /* @__PURE__ */ n(r, { children: [m.map((n, r) => /* @__PURE__ */ t("tr", {
811
811
  className: `${Z}-row`,
812
812
  "data-testid": `${Z}-row-${r}`,
@@ -818,22 +818,22 @@ var A = D`
818
818
  children: e.render ? e.render(i, n) : String(i ?? "")
819
819
  }, e.key);
820
820
  })
821
- }, r)), a === "scroll" && w && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
821
+ }, r)), a === "scroll" && S && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", {
822
822
  colSpan: ue,
823
823
  className: `${Z}-loadingMore`,
824
824
  children: d
825
825
  }) })] });
826
826
  return /* @__PURE__ */ n("div", {
827
827
  className: [Z, f || ""].join(" "),
828
- css: te(p),
828
+ css: ne(p),
829
829
  "data-testid": Z,
830
830
  children: [
831
831
  /* @__PURE__ */ t("div", {
832
832
  className: `${Z}-tableContainer`,
833
833
  children: a === "scroll" ? /* @__PURE__ */ n(r, { children: [/* @__PURE__ */ n("table", {
834
834
  className: `${Z}-table`,
835
- children: [/* @__PURE__ */ n("colgroup", { children: [e.map((e) => /* @__PURE__ */ t("col", { style: e.width ? { width: e.width } : void 0 }, e.key)), /* @__PURE__ */ t("col", { style: { width: W || 0 } })] }), /* @__PURE__ */ t("thead", {
836
- ref: q,
835
+ children: [/* @__PURE__ */ n("colgroup", { children: [e.map((e) => /* @__PURE__ */ t("col", { style: e.width ? { width: e.width } : void 0 }, e.key)), /* @__PURE__ */ t("col", { style: { width: U || 0 } })] }), /* @__PURE__ */ t("thead", {
836
+ ref: K,
837
837
  className: `${Z}-thead`,
838
838
  children: /* @__PURE__ */ n("tr", {
839
839
  className: `${Z}-headerRow`,
@@ -845,7 +845,7 @@ var A = D`
845
845
  })
846
846
  })]
847
847
  }), /* @__PURE__ */ t("div", {
848
- ref: J,
848
+ ref: q,
849
849
  className: `${Z}-bodyContainer`,
850
850
  style: {
851
851
  overflowY: "auto",
@@ -858,7 +858,7 @@ var A = D`
858
858
  tableLayout: "fixed",
859
859
  width: "100%"
860
860
  },
861
- children: [/* @__PURE__ */ t("colgroup", { children: e.map((e, n) => /* @__PURE__ */ t("col", { style: { width: H[n] === void 0 ? e.width ?? "auto" : H[n] } }, e.key)) }), /* @__PURE__ */ t("tbody", {
861
+ children: [/* @__PURE__ */ t("colgroup", { children: e.map((e, n) => /* @__PURE__ */ t("col", { style: { width: V[n] === void 0 ? e.width ?? "auto" : V[n] } }, e.key)) }), /* @__PURE__ */ t("tbody", {
862
862
  className: `${Z}-tbody`,
863
863
  children: me
864
864
  })]
@@ -877,16 +877,16 @@ var A = D`
877
877
  })]
878
878
  })
879
879
  }),
880
- a === "pagination" && /* @__PURE__ */ t(ie, {
880
+ a === "pagination" && /* @__PURE__ */ t(ae, {
881
881
  page: v,
882
882
  total: g,
883
883
  pageSize: b,
884
- onPageChange: se,
885
- pageSizeOptions: c,
884
+ onPageChange: Q,
885
+ pageSizeOptions: l,
886
886
  onPageSizeChange: ce,
887
- loading: w
887
+ loading: S
888
888
  }),
889
- $?.filter && /* @__PURE__ */ t(ne, {
889
+ $?.filter && /* @__PURE__ */ t(re, {
890
890
  filterType: $.filter.type,
891
891
  options: $.filter.options,
892
892
  columnKey: $.key,
@@ -894,29 +894,29 @@ var A = D`
894
894
  searchLabel: $.filter.label,
895
895
  cancelLabel: $.filter.cancelLabel,
896
896
  applyLabel: $.filter.applyLabel,
897
- pendingSearch: I,
898
- onSearchChange: L,
899
- pendingMulti: R,
900
- onMultiChange: z,
901
- multiSearch: B,
902
- onMultiSearchChange: V,
903
- onCancel: () => N(null),
904
- onApply: () => X($),
897
+ pendingSearch: F,
898
+ onSearchChange: I,
899
+ pendingMulti: L,
900
+ onMultiChange: R,
901
+ multiSearch: z,
902
+ onMultiSearchChange: B,
903
+ onCancel: () => M(null),
904
+ onApply: () => Y($),
905
905
  onClear: () => {
906
- $.filter?.type === "search" ? L("") : (z([]), V(""));
906
+ $.filter?.type === "search" ? I("") : (R([]), B(""));
907
907
  },
908
- anchorEl: P
908
+ anchorEl: N
909
909
  })
910
910
  ]
911
911
  });
912
- }, oe = ({ theme: n, variant: r = "default", ...i }) => {
913
- let { componentStyles: a } = e([c.DATAGRID], n, r.toUpperCase());
914
- return /* @__PURE__ */ t(Q, {
912
+ }, Q = ({ theme: n, variant: r = "default", ...i }) => {
913
+ let { componentStyles: a } = e([l.DATAGRID], n, r.toUpperCase());
914
+ return /* @__PURE__ */ t(se, {
915
915
  ...i,
916
916
  style: a
917
917
  });
918
918
  };
919
919
  //#endregion
920
- export { f as Button, s as Checkbox, y as CheckboxGroup, v as CheckboxTree, oe as DataGrid, g as DatePicker, o as Icon, u as IconButton, l as NumberField, ie as Pagination, d as Radio, b as RadioGroup, h as Select, j as Skeleton, p as Slider, _ as Switch, m as TextField, x as ThemeProvider, i as darkTheme };
920
+ export { d as Button, c as Checkbox, v as CheckboxGroup, b as CheckboxTree, Q as DataGrid, g as DatePicker, s as Icon, o as IconButton, y as Modal, u as NumberField, ae as Pagination, f as Radio, x as RadioGroup, h as Select, j as Skeleton, p as Slider, _ as Switch, m as TextField, S as ThemeProvider, i as darkTheme };
921
921
 
922
922
  //# sourceMappingURL=index.mjs.map