@anoki/fse-ui 1.0.564 → 1.0.566

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/dist/index.cjs219.js +1 -1
  2. package/dist/index.cjs226.js +1 -1
  3. package/dist/index.cjs237.js +1 -1
  4. package/dist/index.cjs244.js +1 -1
  5. package/dist/index.cjs245.js +1 -1
  6. package/dist/index.cjs249.js +1 -1
  7. package/dist/index.cjs254.js +1 -1
  8. package/dist/index.cjs256.js +1 -1
  9. package/dist/index.cjs264.js +1 -1
  10. package/dist/index.cjs303.js +1 -1
  11. package/dist/index.cjs338.js +1 -1
  12. package/dist/index.cjs339.js +1 -1
  13. package/dist/index.cjs342.js +1 -1
  14. package/dist/index.cjs342.js.map +1 -1
  15. package/dist/{index.cjs346.js → index.cjs343.js} +1 -1
  16. package/dist/{index.cjs346.js.map → index.cjs343.js.map} +1 -1
  17. package/dist/{index.cjs347.js → index.cjs344.js} +1 -1
  18. package/dist/{index.cjs347.js.map → index.cjs344.js.map} +1 -1
  19. package/dist/index.cjs345.js +1 -1
  20. package/dist/index.cjs345.js.map +1 -1
  21. package/dist/{index.cjs356.js → index.cjs348.js} +1 -1
  22. package/dist/{index.cjs356.js.map → index.cjs348.js.map} +1 -1
  23. package/dist/{index.cjs357.js → index.cjs349.js} +1 -1
  24. package/dist/{index.cjs357.js.map → index.cjs349.js.map} +1 -1
  25. package/dist/{index.cjs358.js → index.cjs350.js} +1 -1
  26. package/dist/{index.cjs358.js.map → index.cjs350.js.map} +1 -1
  27. package/dist/{index.cjs359.js → index.cjs351.js} +1 -1
  28. package/dist/{index.cjs359.js.map → index.cjs351.js.map} +1 -1
  29. package/dist/{index.cjs360.js → index.cjs352.js} +1 -1
  30. package/dist/{index.cjs360.js.map → index.cjs352.js.map} +1 -1
  31. package/dist/{index.cjs361.js → index.cjs353.js} +1 -1
  32. package/dist/{index.cjs361.js.map → index.cjs353.js.map} +1 -1
  33. package/dist/{index.cjs362.js → index.cjs354.js} +1 -1
  34. package/dist/{index.cjs362.js.map → index.cjs354.js.map} +1 -1
  35. package/dist/index.cjs375.js +1 -1
  36. package/dist/index.cjs377.js +1 -1
  37. package/dist/index.cjs394.js +1 -1
  38. package/dist/index.cjs396.js +1 -1
  39. package/dist/index.cjs398.js +1 -1
  40. package/dist/index.cjs411.js +38 -1
  41. package/dist/index.cjs411.js.map +1 -1
  42. package/dist/index.cjs412.js +1 -38
  43. package/dist/index.cjs412.js.map +1 -1
  44. package/dist/index.cjs413.js +1 -1
  45. package/dist/index.cjs413.js.map +1 -1
  46. package/dist/index.cjs414.js +1 -1
  47. package/dist/index.cjs414.js.map +1 -1
  48. package/dist/index.cjs415.js +1 -1
  49. package/dist/index.cjs415.js.map +1 -1
  50. package/dist/index.cjs58.js +1 -1
  51. package/dist/index.cjs58.js.map +1 -1
  52. package/dist/index.cjs65.js +1 -1
  53. package/dist/index.cjs65.js.map +1 -1
  54. package/dist/index.d.ts +12 -6
  55. package/dist/index.es219.js +1 -1
  56. package/dist/index.es226.js +3 -3
  57. package/dist/index.es237.js +8 -8
  58. package/dist/index.es244.js +1 -1
  59. package/dist/index.es245.js +1 -1
  60. package/dist/index.es249.js +1 -1
  61. package/dist/index.es254.js +1 -1
  62. package/dist/index.es256.js +1 -1
  63. package/dist/index.es264.js +2 -2
  64. package/dist/index.es303.js +1 -1
  65. package/dist/index.es338.js +1 -1
  66. package/dist/index.es339.js +8 -8
  67. package/dist/index.es342.js +6 -15
  68. package/dist/index.es342.js.map +1 -1
  69. package/dist/{index.es346.js → index.es343.js} +1 -1
  70. package/dist/{index.es346.js.map → index.es343.js.map} +1 -1
  71. package/dist/{index.es347.js → index.es344.js} +1 -1
  72. package/dist/{index.es347.js.map → index.es344.js.map} +1 -1
  73. package/dist/index.es345.js +15 -6
  74. package/dist/index.es345.js.map +1 -1
  75. package/dist/{index.es356.js → index.es348.js} +1 -1
  76. package/dist/{index.es356.js.map → index.es348.js.map} +1 -1
  77. package/dist/{index.es357.js → index.es349.js} +1 -1
  78. package/dist/{index.es357.js.map → index.es349.js.map} +1 -1
  79. package/dist/{index.es358.js → index.es350.js} +1 -1
  80. package/dist/{index.es358.js.map → index.es350.js.map} +1 -1
  81. package/dist/{index.es359.js → index.es351.js} +1 -1
  82. package/dist/{index.es359.js.map → index.es351.js.map} +1 -1
  83. package/dist/{index.es360.js → index.es352.js} +1 -1
  84. package/dist/{index.es360.js.map → index.es352.js.map} +1 -1
  85. package/dist/{index.es361.js → index.es353.js} +1 -1
  86. package/dist/{index.es361.js.map → index.es353.js.map} +1 -1
  87. package/dist/{index.es362.js → index.es354.js} +1 -1
  88. package/dist/{index.es362.js.map → index.es354.js.map} +1 -1
  89. package/dist/index.es375.js +1 -1
  90. package/dist/index.es377.js +1 -1
  91. package/dist/index.es394.js +1 -1
  92. package/dist/index.es396.js +1 -1
  93. package/dist/index.es398.js +4 -4
  94. package/dist/index.es411.js +69 -65
  95. package/dist/index.es411.js.map +1 -1
  96. package/dist/index.es412.js +8 -68
  97. package/dist/index.es412.js.map +1 -1
  98. package/dist/index.es413.js +14 -9
  99. package/dist/index.es413.js.map +1 -1
  100. package/dist/index.es414.js +62 -14
  101. package/dist/index.es414.js.map +1 -1
  102. package/dist/index.es415.js +64 -61
  103. package/dist/index.es415.js.map +1 -1
  104. package/dist/index.es58.js +3 -2
  105. package/dist/index.es58.js.map +1 -1
  106. package/dist/index.es65.js +220 -176
  107. package/dist/index.es65.js.map +1 -1
  108. package/package.json +1 -1
  109. /package/dist/components/ui/{DoctorConfirmModal/DoctorConfirmModalContent/DoctorConfirmModalContent.css → ConsentModal/ConsentModalContent/ConsentModalContent.css} +0 -0
  110. /package/dist/components/ui/{DoctorModal/DoctorModalFooter/DoctorModalFooter.css → ConsentModal/ConsentModalFooter/ConsentModalFooter.css} +0 -0
@@ -11,12 +11,13 @@ const n = ({
11
11
  description: o,
12
12
  onChange: l
13
13
  }) => /* @__PURE__ */ r.jsxs(
14
- "div",
14
+ "label",
15
15
  {
16
16
  className: d(
17
17
  "shadow bg-white br-x4 ui-radio-card",
18
18
  a && "ui-radio-card-checked"
19
19
  ),
20
+ htmlFor: s,
20
21
  children: [
21
22
  /* @__PURE__ */ r.jsx(
22
23
  "input",
@@ -30,7 +31,7 @@ const n = ({
30
31
  }
31
32
  ),
32
33
  /* @__PURE__ */ r.jsxs(m, { gap: "x4", children: [
33
- /* @__PURE__ */ r.jsx("label", { htmlFor: s, className: "fw-semibold text-slate-20 fs-4", children: i }),
34
+ /* @__PURE__ */ r.jsx("div", { className: "fw-semibold text-slate-20 fs-4", children: i }),
34
35
  /* @__PURE__ */ r.jsx("p", { className: "fs-6 fw-regular text-slate-20", children: o })
35
36
  ] })
36
37
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"index.es58.js","sources":["../src/components/ui/RadioCard/index.tsx"],"sourcesContent":["import clsx from \"clsx\";\r\nimport \"./RadioCard.scss\";\r\nimport { Col } from \"@/components\";\r\n\r\ntype RadioCardProps = {\r\n id: string;\r\n name: string;\r\n value: string;\r\n checked: boolean;\r\n label: string;\r\n description?: string;\r\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\r\n};\r\n\r\nexport const RadioCard = ({\r\n id,\r\n name,\r\n value,\r\n checked = false,\r\n label,\r\n description,\r\n onChange,\r\n}: RadioCardProps) => {\r\n return (\r\n <div\r\n className={clsx(\r\n \"shadow bg-white br-x4 ui-radio-card\",\r\n checked && \"ui-radio-card-checked\",\r\n )}\r\n >\r\n <input\r\n type=\"radio\"\r\n id={id}\r\n name={name}\r\n value={value}\r\n checked={checked}\r\n onChange={onChange}\r\n />\r\n <Col gap={\"x4\"}>\r\n <label htmlFor={id} className=\"fw-semibold text-slate-20 fs-4\">\r\n {label}\r\n </label>\r\n <p className=\"fs-6 fw-regular text-slate-20\">{description}</p>\r\n </Col>\r\n </div>\r\n );\r\n};\r\n"],"names":["RadioCard","id","name","value","checked","label","description","onChange","jsxs","clsx","jsx","Col"],"mappings":";;;;AAcO,MAAMA,IAAY,CAAC;AAAA,EACxB,IAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AACF,MAEIC,gBAAAA,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACAL,KAAW;AAAA,IACb;AAAA,IAEA,UAAA;AAAA,MAAAM,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,IAAAT;AAAA,UACA,MAAAC;AAAA,UACA,OAAAC;AAAA,UACA,SAAAC;AAAA,UACA,UAAAG;AAAA,QAAA;AAAA,MACF;AAAA,MACAC,gBAAAA,EAAAA,KAACG,GAAI,EAAA,KAAK,MACR,UAAA;AAAA,QAAAD,gBAAAA,MAAC,SAAM,EAAA,SAAST,GAAI,WAAU,kCAC3B,UACHI,GAAA;AAAA,QACCK,gBAAAA,EAAA,IAAA,KAAA,EAAE,WAAU,iCAAiC,UAAYJ,EAAA,CAAA;AAAA,MAAA,EAC5D,CAAA;AAAA,IAAA;AAAA,EAAA;AACF;"}
1
+ {"version":3,"file":"index.es58.js","sources":["../src/components/ui/RadioCard/index.tsx"],"sourcesContent":["import clsx from \"clsx\";\r\nimport \"./RadioCard.scss\";\r\nimport { Col } from \"@/components\";\r\n\r\ntype RadioCardProps = {\r\n id: string;\r\n name: string;\r\n value: string;\r\n checked: boolean;\r\n label: string;\r\n description?: string;\r\n onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;\r\n};\r\n\r\nexport const RadioCard = ({\r\n id,\r\n name,\r\n value,\r\n checked = false,\r\n label,\r\n description,\r\n onChange,\r\n}: RadioCardProps) => {\r\n return (\r\n <label\r\n className={clsx(\r\n \"shadow bg-white br-x4 ui-radio-card\",\r\n checked && \"ui-radio-card-checked\",\r\n )}\r\n htmlFor={id}\r\n >\r\n <input\r\n type=\"radio\"\r\n id={id}\r\n name={name}\r\n value={value}\r\n checked={checked}\r\n onChange={onChange}\r\n />\r\n <Col gap={\"x4\"}>\r\n <div className=\"fw-semibold text-slate-20 fs-4\">{label}</div>\r\n <p className=\"fs-6 fw-regular text-slate-20\">{description}</p>\r\n </Col>\r\n </label>\r\n );\r\n};\r\n"],"names":["RadioCard","id","name","value","checked","label","description","onChange","jsxs","clsx","jsx","Col"],"mappings":";;;;AAcO,MAAMA,IAAY,CAAC;AAAA,EACxB,IAAAC;AAAA,EACA,MAAAC;AAAA,EACA,OAAAC;AAAA,EACA,SAAAC,IAAU;AAAA,EACV,OAAAC;AAAA,EACA,aAAAC;AAAA,EACA,UAAAC;AACF,MAEIC,gBAAAA,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACAL,KAAW;AAAA,IACb;AAAA,IACA,SAASH;AAAA,IAET,UAAA;AAAA,MAAAS,gBAAAA,EAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,MAAK;AAAA,UACL,IAAAT;AAAA,UACA,MAAAC;AAAA,UACA,OAAAC;AAAA,UACA,SAAAC;AAAA,UACA,UAAAG;AAAA,QAAA;AAAA,MACF;AAAA,MACAC,gBAAAA,EAAAA,KAACG,GAAI,EAAA,KAAK,MACR,UAAA;AAAA,QAACD,gBAAAA,EAAA,IAAA,OAAA,EAAI,WAAU,kCAAkC,UAAML,GAAA;AAAA,QACtDK,gBAAAA,EAAA,IAAA,KAAA,EAAE,WAAU,iCAAiC,UAAYJ,EAAA,CAAA;AAAA,MAAA,EAC5D,CAAA;AAAA,IAAA;AAAA,EAAA;AACF;"}
@@ -1,210 +1,219 @@
1
- import { j as a } from "./index.es188.js";
2
- import * as u from "react";
3
- import { useEffect as G } from "react";
4
- import { clsx as m } from "./index.es190.js";
1
+ import { j as e } from "./index.es188.js";
2
+ import * as x from "react";
3
+ import { useEffect as P } from "react";
4
+ import { clsx as o } from "./index.es190.js";
5
5
  import './components/ui/Table/Table.css';/* empty css */
6
- import { ActionIconText as J } from "./index.es59.js";
7
- import { TriangleUp as Q } from "./index.es155.js";
8
- import { TriangleDown as W } from "./index.es156.js";
9
- import { Download as X } from "./index.es148.js";
10
- import { Info as Y } from "./index.es157.js";
11
- const Z = u.forwardRef(
6
+ import { ActionIconText as S } from "./index.es59.js";
7
+ import { TriangleUp as ee } from "./index.es155.js";
8
+ import { TriangleDown as ae } from "./index.es156.js";
9
+ import { Download as te } from "./index.es148.js";
10
+ import { Info as se } from "./index.es157.js";
11
+ const ie = x.forwardRef(
12
12
  ({
13
- className: e,
13
+ className: a,
14
14
  columns: t,
15
15
  data: s,
16
- pagination: l,
17
- initialCurrentPage: x = 1,
18
- resultsPerPage: N = 10,
19
- defaultSortDirection: r = "desc",
16
+ pagination: i,
17
+ initialCurrentPage: N = 1,
18
+ resultsPerPage: l = 10,
19
+ defaultSortDirection: b = "desc",
20
20
  setSelectedSort: p,
21
- initialSortConfig: _,
22
- ...o
23
- }, c) => {
24
- const [i, C] = u.useState(
25
- _ || {
21
+ initialSortConfig: h,
22
+ serverSidePagination: _ = !1,
23
+ totalItems: j,
24
+ hasNextPage: y,
25
+ hasPreviousPage: C,
26
+ onNextPage: v,
27
+ onPreviousPage: w,
28
+ ...T
29
+ }, g) => {
30
+ const [r, M] = x.useState(
31
+ h || {
26
32
  key: t[0].key || t[0].label,
27
- direction: r
33
+ direction: b
28
34
  }
29
- ), [k, $] = u.useState(x);
30
- G(() => {
31
- _ && C(_);
32
- }, [_]);
33
- const v = u.useMemo(() => [...s].sort((b, h) => {
34
- const d = b[i.key], n = h[i.key], f = t.find(
35
- (j) => (j.key || j.label) === i.key
35
+ ), [R, z] = x.useState(N);
36
+ P(() => {
37
+ h && M(h);
38
+ }, [h]);
39
+ const k = x.useMemo(() => [...s].sort((d, u) => {
40
+ const c = d[r.key], n = u[r.key], m = t.find(
41
+ (f) => (f.key || f.label) === r.key
36
42
  );
37
- if (typeof d == "string" && typeof n == "string") {
38
- if ((f == null ? void 0 : f.type) === "date") {
39
- const j = (H) => {
40
- const [P, U] = H.split(" - "), [V, z, E] = P.split("/").map(Number), [O, q] = U.split(":").map(Number);
41
- return new Date(E, z - 1, V, O, q);
42
- }, y = j(d), D = j(n);
43
- return i.direction === "asc" ? y.getTime() - D.getTime() : D.getTime() - y.getTime();
43
+ if (typeof c == "string" && typeof n == "string") {
44
+ if ((m == null ? void 0 : m.type) === "date") {
45
+ const f = (G) => {
46
+ const [J, Q] = G.split(" - "), [W, X, Y] = J.split("/").map(Number), [Z, K] = Q.split(":").map(Number);
47
+ return new Date(Y, X - 1, W, Z, K);
48
+ }, L = f(c), I = f(n);
49
+ return r.direction === "asc" ? L.getTime() - I.getTime() : I.getTime() - L.getTime();
44
50
  }
45
- if ((f == null ? void 0 : f.type) === "number") {
46
- const j = parseFloat(d), y = parseFloat(n);
47
- return i.direction === "asc" ? j - y : y - j;
51
+ if ((m == null ? void 0 : m.type) === "number") {
52
+ const f = parseFloat(c), L = parseFloat(n);
53
+ return r.direction === "asc" ? f - L : L - f;
48
54
  }
49
- return i.direction === "asc" ? d.localeCompare(n) : n.localeCompare(d);
55
+ return r.direction === "asc" ? c.localeCompare(n) : n.localeCompare(c);
50
56
  }
51
- return w(d) && w(n) ? i.direction === "asc" ? d.firstLine.localeCompare(n.firstLine) : n.firstLine.localeCompare(d.firstLine) : 0;
52
- }), [s, i, t]), B = (b) => {
53
- const h = {
54
- key: b,
55
- direction: i.key === b && i.direction === "asc" ? "desc" : "asc"
57
+ return D(c) && D(n) ? r.direction === "asc" ? c.firstLine.localeCompare(n.firstLine) : n.firstLine.localeCompare(c.firstLine) : 0;
58
+ }), [s, r, t]), E = (d) => {
59
+ const u = {
60
+ key: d,
61
+ direction: r.key === d && r.direction === "asc" ? "desc" : "asc"
56
62
  };
57
- C(h), p && p(h);
58
- }, L = l ? (k - 1) * N : 0, M = l ? Math.min(L + N, v.length) : v.length, F = v.slice(L, M);
59
- return /* @__PURE__ */ a.jsxs("div", { className: "position-relative w-full", children: [
60
- /* @__PURE__ */ a.jsxs(
63
+ M(u), p && p(u);
64
+ }, $ = i && !_ ? (R - 1) * l : 0, O = i && !_ ? Math.min($ + l, k.length) : k.length, q = _ ? k : k.slice($, O);
65
+ return /* @__PURE__ */ e.jsxs("div", { className: "position-relative w-full", children: [
66
+ /* @__PURE__ */ e.jsxs(
61
67
  "table",
62
68
  {
63
- ref: c,
64
- className: m("table", e),
69
+ ref: g,
70
+ className: o("table", a),
65
71
  role: "table",
66
- ...o,
72
+ ...T,
67
73
  children: [
68
- /* @__PURE__ */ a.jsx(S, { className: "table__header", children: /* @__PURE__ */ a.jsx(g, { children: t.map((b, h) => /* @__PURE__ */ a.jsx(
69
- A,
74
+ /* @__PURE__ */ e.jsx(F, { className: "table__header", children: /* @__PURE__ */ e.jsx(B, { children: t.map((d, u) => /* @__PURE__ */ e.jsx(
75
+ U,
70
76
  {
71
- config: b,
72
- sortConfig: i,
73
- onSort: () => b.sortable && B(b.key || b.label)
77
+ config: d,
78
+ sortConfig: r,
79
+ onSort: () => d.sortable && E(d.key || d.label)
74
80
  },
75
- `${b.label}-${h}`
81
+ `${d.label}-${u}`
76
82
  )) }) }),
77
- /* @__PURE__ */ a.jsx(R, { className: "table__body", children: F.map((b, h) => /* @__PURE__ */ a.jsx(g, { className: "table__row", children: Object.entries(b).map(([d, n], f) => n ? d === "actionData" && I(n) ? /* @__PURE__ */ a.jsx(
78
- T,
83
+ /* @__PURE__ */ e.jsx(H, { className: "table__body", children: q.map((d, u) => /* @__PURE__ */ e.jsx(B, { className: "table__row", children: Object.entries(d).map(([c, n], m) => n ? c === "actionData" && V(n) ? /* @__PURE__ */ e.jsx(
84
+ A,
79
85
  {
80
86
  content: n,
81
87
  type: "action"
82
88
  },
83
- `${d}-${f}`
84
- ) : w(n) ? /* @__PURE__ */ a.jsx(
85
- T,
89
+ `${c}-${m}`
90
+ ) : D(n) ? /* @__PURE__ */ e.jsx(
91
+ A,
86
92
  {
87
93
  content: n,
88
94
  type: "double-line"
89
95
  },
90
- `${d}-${f}`
91
- ) : typeof n == "string" ? /* @__PURE__ */ a.jsx(T, { content: n }, `${d}-${f}`) : null : null) }, h)) })
96
+ `${c}-${m}`
97
+ ) : typeof n == "string" ? /* @__PURE__ */ e.jsx(A, { content: n }, `${c}-${m}`) : null : null) }, u)) })
92
98
  ]
93
99
  }
94
100
  ),
95
- l && /* @__PURE__ */ a.jsx(
96
- te,
101
+ i && /* @__PURE__ */ e.jsx(
102
+ re,
97
103
  {
98
- currentPage: k,
99
- totalResults: o.isServerSide && o.totalServerItems !== void 0 ? o.totalServerItems : v.length,
100
- resultsPerPage: N,
101
- setCurrentPage: $,
102
- onPageChange: o.onPageChange,
103
- isServerSide: o.isServerSide,
104
- isLoading: o.isLoading
104
+ currentPage: R,
105
+ totalResults: _ ? j || 0 : k.length,
106
+ resultsPerPage: l,
107
+ setCurrentPage: z,
108
+ serverSide: _,
109
+ totalItems: j,
110
+ hasNextPage: y,
111
+ hasPreviousPage: C,
112
+ onNextPage: v,
113
+ onPreviousPage: w
105
114
  }
106
115
  )
107
116
  ] });
108
117
  }
109
118
  );
110
- Z.displayName = "Table";
111
- const S = u.forwardRef(
112
- ({ className: e, children: t, ...s }, l) => /* @__PURE__ */ a.jsx(
119
+ ie.displayName = "Table";
120
+ const F = x.forwardRef(
121
+ ({ className: a, children: t, ...s }, i) => /* @__PURE__ */ e.jsx(
113
122
  "thead",
114
123
  {
115
- ref: l,
116
- className: m("[&_tr]:border-b-0", e),
124
+ ref: i,
125
+ className: o("[&_tr]:border-b-0", a),
117
126
  ...s,
118
127
  children: t
119
128
  }
120
129
  )
121
130
  );
122
- S.displayName = "TableHeader";
123
- const R = u.forwardRef(
124
- ({ className: e, children: t, ...s }, l) => /* @__PURE__ */ a.jsx(
131
+ F.displayName = "TableHeader";
132
+ const H = x.forwardRef(
133
+ ({ className: a, children: t, ...s }, i) => /* @__PURE__ */ e.jsx(
125
134
  "tbody",
126
135
  {
127
- ref: l,
128
- className: m("[&_tr:last-child]:border-0", e),
136
+ ref: i,
137
+ className: o("[&_tr:last-child]:border-0", a),
129
138
  ...s,
130
139
  children: t
131
140
  }
132
141
  )
133
142
  );
134
- R.displayName = "TableBody";
135
- const g = u.forwardRef(
136
- ({ className: e, children: t, ...s }, l) => /* @__PURE__ */ a.jsx(
143
+ H.displayName = "TableBody";
144
+ const B = x.forwardRef(
145
+ ({ className: a, children: t, ...s }, i) => /* @__PURE__ */ e.jsx(
137
146
  "tr",
138
147
  {
139
- ref: l,
140
- className: m(
148
+ ref: i,
149
+ className: o(
141
150
  "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
142
- e
151
+ a
143
152
  ),
144
153
  ...s,
145
154
  children: t
146
155
  }
147
156
  )
148
157
  );
149
- g.displayName = "TableRow";
150
- const A = u.forwardRef(({ className: e, config: t, sortConfig: s, onSort: l, ...x }, N) => {
151
- var c;
152
- const r = s.key === (t.key || t.label), p = r ? s.direction : null, _ = () => p === "asc" ? "ascending" : "descending", o = (i) => {
153
- switch (i) {
158
+ B.displayName = "TableRow";
159
+ const U = x.forwardRef(({ className: a, config: t, sortConfig: s, onSort: i, ...N }, l) => {
160
+ var j;
161
+ const b = s.key === (t.key || t.label), p = b ? s.direction : null, h = () => p === "asc" ? "ascending" : "descending", _ = (y) => {
162
+ switch (y) {
154
163
  case "info":
155
- return /* @__PURE__ */ a.jsx(Y, {});
164
+ return /* @__PURE__ */ e.jsx(se, {});
156
165
  case "download":
157
- return /* @__PURE__ */ a.jsx(X, {});
166
+ return /* @__PURE__ */ e.jsx(te, {});
158
167
  default:
159
- return i;
168
+ return y;
160
169
  }
161
170
  };
162
- return /* @__PURE__ */ a.jsx(
171
+ return /* @__PURE__ */ e.jsx(
163
172
  "th",
164
173
  {
165
- ref: N,
166
- className: m(
174
+ ref: l,
175
+ className: o(
167
176
  "table__cell table__cell--header",
168
177
  {
169
178
  "table__cell--sortable": t.sortable,
170
179
  "table__cell--action": t.action
171
180
  },
172
- e
181
+ a
173
182
  ),
174
- onClick: t.sortable ? l : t.action,
183
+ onClick: t.sortable ? i : t.action,
175
184
  "aria-label": t.ariaLabel,
176
- "aria-sort": r ? _() : void 0,
177
- ...x,
178
- children: /* @__PURE__ */ a.jsxs("div", { className: "table__cell--header--content", children: [
179
- /* @__PURE__ */ a.jsx("div", { children: /* @__PURE__ */ a.jsx(
180
- J,
185
+ "aria-sort": b ? h() : void 0,
186
+ ...N,
187
+ children: /* @__PURE__ */ e.jsxs("div", { className: "table__cell--header--content", children: [
188
+ /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
189
+ S,
181
190
  {
182
- icon: o(t.icon),
191
+ icon: _(t.icon),
183
192
  textLabel: t.label,
184
193
  iconPosition: t.iconPosition,
185
194
  handleIconAction: () => {
186
195
  t.iconAction;
187
196
  },
188
197
  popupInfo: t.popupInfo,
189
- positionPopUp: (c = t.popupInfo) == null ? void 0 : c.positionPopUp
198
+ positionPopUp: (j = t.popupInfo) == null ? void 0 : j.positionPopUp
190
199
  }
191
200
  ) }),
192
- t.sortable && /* @__PURE__ */ a.jsxs("span", { className: "sort-indicator", children: [
193
- /* @__PURE__ */ a.jsx(
194
- Q,
201
+ t.sortable && /* @__PURE__ */ e.jsxs("span", { className: "sort-indicator", children: [
202
+ /* @__PURE__ */ e.jsx(
203
+ ee,
195
204
  {
196
- filled: r && p === "desc",
197
- className: m("sort-indicator__triangle", {
198
- active: r && p === "desc"
205
+ filled: b && p === "desc",
206
+ className: o("sort-indicator__triangle", {
207
+ active: b && p === "desc"
199
208
  })
200
209
  }
201
210
  ),
202
- /* @__PURE__ */ a.jsx(
203
- W,
211
+ /* @__PURE__ */ e.jsx(
212
+ ae,
204
213
  {
205
- filled: r && p === "asc",
206
- className: m("sort-indicator__triangle", {
207
- active: r && p === "asc"
214
+ filled: b && p === "asc",
215
+ className: o("sort-indicator__triangle", {
216
+ active: b && p === "asc"
208
217
  })
209
218
  }
210
219
  )
@@ -213,105 +222,140 @@ const A = u.forwardRef(({ className: e, config: t, sortConfig: s, onSort: l, ...
213
222
  }
214
223
  );
215
224
  });
216
- A.displayName = "TableHead";
217
- const K = ({ data: e }) => /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
218
- /* @__PURE__ */ a.jsx("div", { className: "table__cell--firstLine", children: e.firstLine }),
219
- /* @__PURE__ */ a.jsx("div", { className: "table__cell--secondLine", children: e.secondLine })
220
- ] }), ee = ({ data: e }) => e.type === "link" && e.link ? /* @__PURE__ */ a.jsx("a", { href: e.link, "aria-label": e.ariaLabel, children: e.label }) : /* @__PURE__ */ a.jsx("button", { onClick: e.action, "aria-label": e.ariaLabel, children: e.label }), w = (e) => typeof e == "object" && e !== null && "firstLine" in e && "secondLine" in e, I = (e) => typeof e == "object" && e !== null && "label" in e && "type" in e, ae = ({
221
- content: e
222
- }) => typeof e == "string" ? /* @__PURE__ */ a.jsx(a.Fragment, { children: e }) : w(e) ? /* @__PURE__ */ a.jsx(K, { data: e }) : I(e) ? /* @__PURE__ */ a.jsx(ee, { data: e }) : null, T = u.forwardRef(
223
- ({ className: e, content: t, type: s, ...l }, x) => /* @__PURE__ */ a.jsx(
225
+ U.displayName = "TableHead";
226
+ const ne = ({ data: a }) => /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
227
+ /* @__PURE__ */ e.jsx("div", { className: "table__cell--firstLine", children: a.firstLine }),
228
+ /* @__PURE__ */ e.jsx("div", { className: "table__cell--secondLine", children: a.secondLine })
229
+ ] }), le = ({ data: a }) => a.type === "link" && a.link ? /* @__PURE__ */ e.jsx("a", { href: a.link, "aria-label": a.ariaLabel, children: a.label }) : /* @__PURE__ */ e.jsx("button", { onClick: a.action, "aria-label": a.ariaLabel, children: a.label }), D = (a) => typeof a == "object" && a !== null && "firstLine" in a && "secondLine" in a, V = (a) => typeof a == "object" && a !== null && "label" in a && "type" in a, oe = ({
230
+ content: a
231
+ }) => typeof a == "string" ? /* @__PURE__ */ e.jsx(e.Fragment, { children: a }) : D(a) ? /* @__PURE__ */ e.jsx(ne, { data: a }) : V(a) ? /* @__PURE__ */ e.jsx(le, { data: a }) : null, A = x.forwardRef(
232
+ ({ className: a, content: t, type: s, ...i }, N) => /* @__PURE__ */ e.jsx(
224
233
  "td",
225
234
  {
226
- ref: x,
227
- className: m(
235
+ ref: N,
236
+ className: o(
228
237
  "table__cell",
229
238
  {
230
239
  "table__cell--double-line": s === "double-line",
231
240
  "table__cell--action": s === "action"
232
241
  },
233
- e
242
+ a
234
243
  ),
235
- ...l,
236
- children: /* @__PURE__ */ a.jsx(ae, { content: t })
244
+ ...i,
245
+ children: /* @__PURE__ */ e.jsx(oe, { content: t })
237
246
  }
238
247
  )
239
248
  );
240
- T.displayName = "TableCell";
241
- const te = ({
242
- currentPage: e = 1,
249
+ A.displayName = "TableCell";
250
+ const re = ({
251
+ currentPage: a = 1,
243
252
  totalResults: t,
244
253
  resultsPerPage: s,
245
- setCurrentPage: l,
246
- onPageChange: x,
247
- isServerSide: N = !1,
248
- isLoading: r = !1,
249
- className: p
254
+ setCurrentPage: i,
255
+ className: N,
256
+ serverSide: l = !1,
257
+ totalItems: b,
258
+ hasNextPage: p,
259
+ hasPreviousPage: h,
260
+ onNextPage: _,
261
+ onPreviousPage: j
250
262
  }) => {
251
- const _ = Math.ceil(t / s), o = (c) => {
252
- l(c), N && x && x(c);
253
- };
254
- return /* @__PURE__ */ a.jsxs("div", { className: m("pagination", p), children: [
255
- /* @__PURE__ */ a.jsxs("div", { className: "pagination__info", children: [
263
+ const y = Math.ceil(l ? (b || t) / s : t / s), C = () => {
264
+ l && _ ? _() : i(a + 1);
265
+ }, v = () => {
266
+ l && j ? j() : i(a - 1);
267
+ }, w = l ? !p : a === y, T = l ? !h : a === 1;
268
+ return /* @__PURE__ */ e.jsxs("div", { className: o("pagination", N), children: [
269
+ /* @__PURE__ */ e.jsxs("div", { className: "pagination__info", children: [
256
270
  "Stai visualizzando",
257
271
  " ",
258
- /* @__PURE__ */ a.jsx("span", { className: "pagination__info__resultsPerPage", children: s }),
272
+ /* @__PURE__ */ e.jsx("span", { className: "pagination__info__resultsPerPage", children: s }),
259
273
  " ",
260
274
  "di ",
261
- t,
275
+ l && b || t,
262
276
  " risultati"
263
277
  ] }),
264
- /* @__PURE__ */ a.jsxs("div", { className: "pagination__nav", children: [
265
- /* @__PURE__ */ a.jsx(
278
+ !l && /* @__PURE__ */ e.jsxs("div", { className: "pagination__nav", children: [
279
+ /* @__PURE__ */ e.jsx(
266
280
  "button",
267
281
  {
268
- className: m(
282
+ className: o(
269
283
  "pagination__button",
270
- (e === 1 || r) && "pagination__button--disabled"
284
+ T && "pagination__button--disabled"
271
285
  ),
272
- onClick: () => o(e - 1),
273
- disabled: e === 1 || r,
286
+ onClick: v,
287
+ disabled: T,
274
288
  "aria-label": "Previous page",
275
- children: /* @__PURE__ */ a.jsx("svg", { className: "pagination__button-arrow", viewBox: "0 0 24 24", children: /* @__PURE__ */ a.jsx("path", { d: "M15 18l-6-6 6-6" }) })
289
+ children: /* @__PURE__ */ e.jsx("svg", { className: "pagination__button-arrow", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { d: "M15 18l-6-6 6-6" }) })
276
290
  }
277
291
  ),
278
- Array.from({ length: _ }, (c, i) => i + 1).map((c) => /* @__PURE__ */ a.jsx(
292
+ Array.from({ length: y }, (g, r) => r + 1).map((g) => /* @__PURE__ */ e.jsx(
279
293
  "button",
280
294
  {
281
- className: m(
295
+ className: o(
282
296
  "pagination__button",
283
- e === c && "pagination__button--active",
284
- r && "pagination__button--disabled"
297
+ a === g && "pagination__button--active"
285
298
  ),
286
- onClick: () => o(c),
287
- disabled: r,
288
- children: c
299
+ onClick: () => i(g),
300
+ children: g
289
301
  },
290
- c
302
+ g
291
303
  )),
292
- /* @__PURE__ */ a.jsx(
304
+ /* @__PURE__ */ e.jsx(
305
+ "button",
306
+ {
307
+ className: o(
308
+ "pagination__button",
309
+ w && "pagination__button--disabled"
310
+ ),
311
+ onClick: C,
312
+ disabled: w,
313
+ "aria-label": "Next page",
314
+ children: /* @__PURE__ */ e.jsx("svg", { className: "pagination__button-arrow", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { d: "M9 6l6 6-6 6" }) })
315
+ }
316
+ )
317
+ ] }),
318
+ l && /* @__PURE__ */ e.jsxs("div", { className: "pagination__nav", children: [
319
+ /* @__PURE__ */ e.jsx(
320
+ "button",
321
+ {
322
+ className: o(
323
+ "pagination__button",
324
+ T && "pagination__button--disabled"
325
+ ),
326
+ onClick: v,
327
+ disabled: T,
328
+ "aria-label": "Previous page",
329
+ children: /* @__PURE__ */ e.jsx("svg", { className: "pagination__button-arrow", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { d: "M15 18l-6-6 6-6" }) })
330
+ }
331
+ ),
332
+ /* @__PURE__ */ e.jsxs("div", { className: "pagination__page-indicator", children: [
333
+ "Pagina ",
334
+ a
335
+ ] }),
336
+ /* @__PURE__ */ e.jsx(
293
337
  "button",
294
338
  {
295
- className: m(
339
+ className: o(
296
340
  "pagination__button",
297
- (e === _ || r) && "pagination__button--disabled"
341
+ w && "pagination__button--disabled"
298
342
  ),
299
- onClick: () => o(e + 1),
300
- disabled: e === _ || r,
343
+ onClick: C,
344
+ disabled: w,
301
345
  "aria-label": "Next page",
302
- children: /* @__PURE__ */ a.jsx("svg", { className: "pagination__button-arrow", viewBox: "0 0 24 24", children: /* @__PURE__ */ a.jsx("path", { d: "M9 6l6 6-6 6" }) })
346
+ children: /* @__PURE__ */ e.jsx("svg", { className: "pagination__button-arrow", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { d: "M9 6l6 6-6 6" }) })
303
347
  }
304
348
  )
305
349
  ] })
306
350
  ] });
307
351
  };
308
352
  export {
309
- te as Pagination,
310
- Z as Table,
311
- R as TableBody,
312
- T as TableCell,
313
- A as TableHead,
314
- S as TableHeader,
315
- g as TableRow
353
+ re as Pagination,
354
+ ie as Table,
355
+ H as TableBody,
356
+ A as TableCell,
357
+ U as TableHead,
358
+ F as TableHeader,
359
+ B as TableRow
316
360
  };
317
361
  //# sourceMappingURL=index.es65.js.map