laif-ds 0.1.30 → 0.1.31

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 (18) hide show
  1. package/dist/components/ui/app-multiple-select-dropdown.js +14 -14
  2. package/dist/components/ui/data-cross-table.js +112 -107
  3. package/dist/components/ui/dropdown-menu.js +131 -0
  4. package/dist/components/ui/table.js +3 -10
  5. package/dist/index.d.ts +18 -3
  6. package/dist/index.js +168 -161
  7. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +217 -0
  8. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-arrow/dist/index.js +25 -0
  9. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-collection/dist/index.js +49 -0
  10. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
  11. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-focus-scope/dist/index.js +138 -0
  12. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-menu/dist/index.js +625 -0
  13. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-popper/dist/index.js +221 -0
  14. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
  15. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-primitive/dist/index.js +37 -0
  16. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-roving-focus/dist/index.js +184 -0
  17. package/dist/node_modules/@radix-ui/react-dropdown-menu/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +55 -0
  18. package/package.json +1 -1
@@ -5,7 +5,7 @@ import { useEffect as A } from "react";
5
5
  import { cn as N } from "../../lib/utils.js";
6
6
  import { Label as B } from "./label.js";
7
7
  import { Badge as D } from "./badge.js";
8
- import { Button as h } from "./button.js";
8
+ import { Button as p } from "./button.js";
9
9
  import { Command as F, CommandList as P, CommandEmpty as G, CommandGroup as X, CommandItem as q } from "./command.js";
10
10
  import { Input as H } from "./input.js";
11
11
  import { Checkbox as I } from "./checkbox.js";
@@ -29,10 +29,10 @@ function ne({
29
29
  cancelButtonLabel: O = "Cancella",
30
30
  maxSelectedItems: s
31
31
  }) {
32
- const f = a.useId(), [c, b] = a.useState(!1), [m, v] = a.useState(""), p = a.useRef(null);
32
+ const f = a.useId(), [c, b] = a.useState(!1), [m, v] = a.useState(""), h = a.useRef(null);
33
33
  A(() => {
34
34
  const e = (n) => {
35
- p.current && !p.current.contains(n.target) && c && b(!1);
35
+ h.current && !h.current.contains(n.target) && c && b(!1);
36
36
  };
37
37
  return document.addEventListener("mousedown", e), () => {
38
38
  document.removeEventListener("mousedown", e);
@@ -46,11 +46,11 @@ function ne({
46
46
  return;
47
47
  i([...t, e]);
48
48
  }
49
- }, [t, i, s]), x = a.useCallback(() => {
49
+ }, [t, i, s]), w = a.useCallback(() => {
50
50
  i([]), v("");
51
51
  }, [i]), u = a.useMemo(() => o.filter((e) => t.includes(e.value)), [o, t]), j = a.useMemo(() => m ? o.filter(
52
52
  (e) => e.label.toLowerCase().includes(m.toLowerCase())
53
- ) : o, [o, m]), w = a.useMemo(() => s ? t.length >= s : !1, [t, s]);
53
+ ) : o, [o, m]), x = a.useMemo(() => s ? t.length >= s : !1, [t, s]);
54
54
  return /* @__PURE__ */ r(T.Provider, { value: { size: d, id: f }, children: /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
55
55
  g && /* @__PURE__ */ r(
56
56
  B,
@@ -60,9 +60,9 @@ function ne({
60
60
  children: g
61
61
  }
62
62
  ),
63
- /* @__PURE__ */ l("div", { ref: p, className: "relative w-full", "data-slot": "app-multiple-select-dropdown", children: [
63
+ /* @__PURE__ */ l("div", { ref: h, className: "relative w-full", "data-slot": "app-multiple-select-dropdown", children: [
64
64
  /* @__PURE__ */ l(
65
- h,
65
+ p,
66
66
  {
67
67
  id: f,
68
68
  type: "button",
@@ -94,13 +94,13 @@ function ne({
94
94
  }
95
95
  ),
96
96
  /* @__PURE__ */ l(
97
- h,
97
+ p,
98
98
  {
99
99
  variant: "ghost",
100
100
  size: "sm",
101
101
  className: "h-5 w-5 p-0 hover:bg-d-secondary/20 rounded-full",
102
102
  onClick: (e) => {
103
- e.stopPropagation(), x();
103
+ e.stopPropagation(), w();
104
104
  },
105
105
  children: [
106
106
  /* @__PURE__ */ r(J, { className: "h-3 w-3" }),
@@ -122,16 +122,16 @@ function ne({
122
122
  placeholder: z,
123
123
  value: m,
124
124
  onChange: (e) => v(e.target.value),
125
- className: "w-full !border-0 !border-none !outline-none focus-visible:ring-0"
125
+ className: "w-full !border-0 !border-none !outline-none focus-visible:ring-0 shadow-none"
126
126
  }
127
127
  ),
128
128
  u.length > 0 && /* @__PURE__ */ r(
129
- h,
129
+ p,
130
130
  {
131
131
  variant: "ghost",
132
132
  size: "sm",
133
133
  className: "h-6 px-2 text-xs",
134
- onClick: x,
134
+ onClick: w,
135
135
  children: O
136
136
  }
137
137
  )
@@ -144,11 +144,11 @@ function ne({
144
144
  q,
145
145
  {
146
146
  value: e.value,
147
- disabled: e.disabled || !n && w,
147
+ disabled: e.disabled || !n && x,
148
148
  onSelect: () => S(e.value),
149
149
  className: N(
150
150
  "flex items-center gap-2 px-2 py-1.5 aria-selected:bg-d-accent aria-selected:text-d-accent-foreground cursor-pointer",
151
- (e.disabled || !n && w) && "cursor-not-allowed opacity-50"
151
+ (e.disabled || !n && x) && "cursor-not-allowed opacity-50"
152
152
  ),
153
153
  children: [
154
154
  /* @__PURE__ */ r(
@@ -1,97 +1,95 @@
1
1
  "use client";
2
- import { jsxs as y, jsx as o } from "react/jsx-runtime";
3
- import { useState as T, useMemo as N } from "react";
4
- import { useReactTable as J, flexRender as D } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
5
- import { TableSkeleton as K } from "./table-skeleton.js";
6
- import { Button as M } from "./button.js";
7
- import { TooltipProvider as Q, Tooltip as X, TooltipTrigger as Y, TooltipContent as Z } from "./tooltip.js";
8
- import { TableRow as R, TableCell as L, Table as _, TableHeader as W, TableHead as H, TableBody as z } from "./table.js";
9
- import { getSortedRowModel as F, getCoreRowModel as ee } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
10
- function x({ text: u, maxLength: c, className: g = "" }) {
11
- return !u || u.length <= c ? /* @__PURE__ */ o("div", { className: g, children: u }) : /* @__PURE__ */ o(Q, { children: /* @__PURE__ */ y(X, { children: [
12
- /* @__PURE__ */ o(Y, { asChild: !0, children: /* @__PURE__ */ y("div", { className: `truncate ${g} cursor-pointer`, children: [
13
- u.substring(0, c),
2
+ import { jsxs as b, jsx as o } from "react/jsx-runtime";
3
+ import { useState as C, useMemo as S } from "react";
4
+ import { useReactTable as P, flexRender as V } from "../../node_modules/@tanstack/react-table/build/lib/index.js";
5
+ import { TableSkeleton as U } from "./table-skeleton.js";
6
+ import { Button as j } from "./button.js";
7
+ import { TooltipProvider as q, Tooltip as G, TooltipTrigger as J, TooltipContent as K } from "./tooltip.js";
8
+ import { TableRow as T, TableCell as A, Table as Q, TableHeader as X, TableHead as Y, TableBody as Z } from "./table.js";
9
+ import { getSortedRowModel as _, getCoreRowModel as W } from "../../node_modules/@tanstack/table-core/build/lib/index.js";
10
+ function v({ text: c, maxLength: a, className: h = "" }) {
11
+ return !c || c.length <= a ? /* @__PURE__ */ o("div", { className: h, children: c }) : /* @__PURE__ */ o(q, { children: /* @__PURE__ */ b(G, { children: [
12
+ /* @__PURE__ */ o(J, { asChild: !0, children: /* @__PURE__ */ b("div", { className: `truncate ${h} cursor-pointer`, children: [
13
+ c.substring(0, a),
14
14
  "..."
15
15
  ] }) }),
16
- /* @__PURE__ */ o(Z, { children: /* @__PURE__ */ o("p", { children: u }) })
16
+ /* @__PURE__ */ o(K, { children: /* @__PURE__ */ o("p", { children: c }) })
17
17
  ] }) });
18
18
  }
19
19
  function ie({
20
- crossTableData: u,
21
- filterable: c = !1,
22
- loading: g = !1,
23
- emptyComponent: $,
24
- className: k,
25
- notFoundMessage: I = "Nessun risultato trovato.",
26
- cornerHeaderFrom: w = "Da",
27
- cornerHeaderTo: S = "A",
28
- maxHeaderLength: v = 15,
29
- minWidthCell: V = 160,
30
- initialFreezeColumn: i = !0,
31
- initialFreezeRow: b = !1
20
+ crossTableData: c,
21
+ filterable: a = !1,
22
+ loading: h = !1,
23
+ emptyComponent: D,
24
+ className: N,
25
+ notFoundMessage: M = "Nessun risultato trovato.",
26
+ cornerHeaderFrom: x = "Da",
27
+ cornerHeaderTo: w = "A",
28
+ maxHeaderLength: g = 15,
29
+ minWidthCell: R = 160
32
30
  }) {
33
- const [B, E] = T([]), { headerTop: f, headerLeft: h, data: p } = u, [m, O] = T(null), [C, j] = T(!0), P = (n) => n && typeof n == "object" && "value" in n ? n.value : n, d = N(() => {
34
- if (!m) return f;
35
- const n = h.indexOf(m);
36
- if (n === -1) return f;
37
- const r = f.map((e, t) => {
38
- var a;
39
- const s = ((a = p[n]) == null ? void 0 : a[t]) ?? null, l = P(s);
31
+ const [L, $] = C([]), { headerTop: d, headerLeft: m, data: f } = c, [p, I] = C(null), [y, k] = C(!0), B = (n) => n && typeof n == "object" && "value" in n ? n.value : n, u = S(() => {
32
+ if (!p) return d;
33
+ const n = m.indexOf(p);
34
+ if (n === -1) return d;
35
+ const r = d.map((e, t) => {
36
+ var i;
37
+ const s = ((i = f[n]) == null ? void 0 : i[t]) ?? null, l = B(s);
40
38
  return { header: e, value: l };
41
39
  });
42
40
  return r.sort((e, t) => {
43
41
  if (typeof e.value == "number" && typeof t.value == "number")
44
- return C ? e.value - t.value : t.value - e.value;
42
+ return y ? e.value - t.value : t.value - e.value;
45
43
  const s = String(e.value ?? ""), l = String(t.value ?? "");
46
- return C ? s.localeCompare(l) : l.localeCompare(s);
44
+ return y ? s.localeCompare(l) : l.localeCompare(s);
47
45
  }), r.map((e) => e.header);
48
- }, [f, h, p, m, C]), U = N(() => {
46
+ }, [d, m, f, p, y]), F = S(() => {
49
47
  const n = [
50
48
  {
51
49
  id: "cross-header",
52
- header: () => /* @__PURE__ */ y("div", { className: "relative", children: [
53
- /* @__PURE__ */ o("div", { className: "absolute top-0 left-2 text-xs", children: w }),
54
- /* @__PURE__ */ o("div", { className: "absolute bottom-0 right-2 text-xs", children: S })
50
+ header: () => /* @__PURE__ */ b("div", { className: "relative", children: [
51
+ /* @__PURE__ */ o("div", { className: "absolute top-0 left-2 text-xs", children: x }),
52
+ /* @__PURE__ */ o("div", { className: "absolute bottom-0 right-2 text-xs", children: w })
55
53
  ] }),
56
54
  accessorFn: (r) => r.item,
57
55
  cell: (r) => {
58
56
  const e = r.getValue();
59
- if (!c)
60
- return /* @__PURE__ */ o(x, { text: e, maxLength: v, className: "text-left" });
61
- const t = m === e;
57
+ if (!a)
58
+ return /* @__PURE__ */ o(v, { text: e, maxLength: g, className: "text-left" });
59
+ const t = p === e;
62
60
  return /* @__PURE__ */ o(
63
- M,
61
+ j,
64
62
  {
65
63
  variant: "ghost",
66
64
  size: "sm",
67
65
  iconLeft: "ArrowLeftRight",
68
66
  className: "text-right",
69
67
  onClick: () => {
70
- c && (t ? j((s) => !s) : (O(e), j(!0)));
68
+ a && (t ? k((s) => !s) : (I(e), k(!0)));
71
69
  },
72
- children: /* @__PURE__ */ o(x, { text: e, maxLength: v })
70
+ children: /* @__PURE__ */ o(v, { text: e, maxLength: g })
73
71
  }
74
72
  );
75
73
  }
76
74
  }
77
75
  ];
78
- return d.forEach((r) => {
76
+ return u.forEach((r) => {
79
77
  n.push({
80
78
  id: r,
81
79
  accessorFn: (e) => e[r],
82
- header: ({ column: e }) => c ? /* @__PURE__ */ o(
83
- M,
80
+ header: ({ column: e }) => a ? /* @__PURE__ */ o(
81
+ j,
84
82
  {
85
83
  variant: "ghost",
86
84
  size: "sm",
87
85
  iconLeft: "ArrowUpDown",
88
- onClick: c ? () => e.toggleSorting(e.getIsSorted() === "asc") : void 0,
89
- children: /* @__PURE__ */ o(x, { text: r, maxLength: v })
86
+ onClick: a ? () => e.toggleSorting(e.getIsSorted() === "asc") : void 0,
87
+ children: /* @__PURE__ */ o(v, { text: r, maxLength: g })
90
88
  }
91
- ) : /* @__PURE__ */ o(x, { text: r, maxLength: v, className: "font-medium" }),
89
+ ) : /* @__PURE__ */ o(v, { text: r, maxLength: g, className: "font-medium" }),
92
90
  sortingFn: (e, t, s) => {
93
- let l = e.getValue(s), a = t.getValue(s);
94
- return l == null && a == null ? 0 : l == null ? 1 : a == null ? -1 : (l && typeof l == "object" && "value" in l && (l = l.value), a && typeof a == "object" && "value" in a && (a = a.value), typeof l == "number" && typeof a == "number" ? l - a : String(l).localeCompare(String(a)));
91
+ let l = e.getValue(s), i = t.getValue(s);
92
+ return l == null && i == null ? 0 : l == null ? 1 : i == null ? -1 : (l && typeof l == "object" && "value" in l && (l = l.value), i && typeof i == "object" && "value" in i && (i = i.value), typeof l == "number" && typeof i == "number" ? l - i : String(l).localeCompare(String(i)));
95
93
  },
96
94
  //NOTE Cell is responsible for rendering the cell of his column
97
95
  cell: (e) => {
@@ -100,79 +98,86 @@ function ie({
100
98
  }
101
99
  });
102
100
  }), n;
103
- }, [d, w, S, m, c]), q = N(() => h.map((n, r) => {
101
+ }, [u, x, w, p, a]), E = S(() => m.map((n, r) => {
104
102
  const e = { item: n };
105
- return d.forEach((t) => {
103
+ return u.forEach((t) => {
106
104
  var l;
107
- const s = f.indexOf(t);
108
- e[t] = s !== -1 ? ((l = p[r]) == null ? void 0 : l[s]) ?? null : null;
105
+ const s = d.indexOf(t);
106
+ e[t] = s !== -1 ? ((l = f[r]) == null ? void 0 : l[s]) ?? null : null;
109
107
  }), e;
110
- }), [h, d, p, f]), A = J({
111
- data: q,
112
- columns: U,
113
- state: { sorting: B },
114
- onSortingChange: E,
115
- getCoreRowModel: ee(),
116
- getSortedRowModel: F()
108
+ }), [m, u, f, d]), z = P({
109
+ data: E,
110
+ columns: F,
111
+ state: { sorting: L },
112
+ onSortingChange: $,
113
+ getCoreRowModel: W(),
114
+ getSortedRowModel: _()
117
115
  });
118
- if (!p || p.length === 0)
119
- return /* @__PURE__ */ o(R, { children: /* @__PURE__ */ o(L, { colSpan: d.length + 1, children: $ || I }) });
120
- if (g)
116
+ if (!f || f.length === 0)
117
+ return /* @__PURE__ */ o(T, { children: /* @__PURE__ */ o(A, { colSpan: u.length + 1, children: D || M }) });
118
+ if (h)
121
119
  return /* @__PURE__ */ o(
122
- K,
120
+ U,
123
121
  {
124
- headerRow: d,
125
- rowCount: h.length || 5,
126
- columnCount: d.length || 5,
127
- className: k,
128
- cornerHeaderFrom: w,
129
- cornerHeaderTo: S
122
+ headerRow: u,
123
+ rowCount: m.length || 5,
124
+ columnCount: u.length || 5,
125
+ className: N,
126
+ cornerHeaderFrom: x,
127
+ cornerHeaderTo: w
130
128
  }
131
129
  );
132
- const G = (n) => {
133
- const r = n.column.id === "cross-header", e = r && b, t = ["bg-d-secondary"];
134
- r && i || t.push("border-r"), r && i && t.push("sticky left-0"), b && t.push("sticky top-0 z-20"), e ? t.push("z-40") : r && i && t.push("z-30");
130
+ const O = (n) => {
131
+ const r = n.column.id === "cross-header", e = r, t = ["bg-d-secondary"];
132
+ r || t.push("border-r"), r && t.push("sticky left-0"), t.push("sticky top-0 z-20"), e ? t.push("z-40") : r && t.push("z-30");
135
133
  let s = "none";
136
- return r && i ? b ? s = "inset -1px 0 0 0 var(--d-border), 0 1px 0 0 var(--d-border)" : s = "inset -1px 0 0 0 var(--d-border)" : b && (s = "0 1px 0 0 var(--d-border)"), {
134
+ return r && (s = "inset -1px 0 0 0 var(--d-border), 0 1px 0 0 var(--d-border)"), {
137
135
  className: t.join(" "),
138
- style: { boxShadow: s, width: `${V}px` }
136
+ style: { boxShadow: s, width: `${R}px` }
139
137
  };
140
138
  };
141
- return /* @__PURE__ */ o("div", { className: `w-[900px] ${k || ""}`, children: /* @__PURE__ */ o("div", { className: "rounded-md border overflow-auto max-h-[600px]", children: /* @__PURE__ */ y(_, { className: "w-full table-fixed relative border-collapse", children: [
142
- /* @__PURE__ */ o(W, { children: A.getHeaderGroups().map((n) => /* @__PURE__ */ o(
143
- R,
139
+ return /* @__PURE__ */ o("div", { className: `w-[900px] ${N || ""}`, children: /* @__PURE__ */ o("div", { className: "rounded-md border overflow-auto max-h-[600px]", children: /* @__PURE__ */ b(Q, { className: "w-full table-fixed relative border-collapse", children: [
140
+ /* @__PURE__ */ o(
141
+ X,
144
142
  {
145
- className: i ? "sticky top-0 z-20 bg-d-secondary" : "",
146
- children: n.headers.map((r) => {
147
- const e = G(r);
148
- return /* @__PURE__ */ o(
149
- H,
150
- {
151
- className: e.className,
152
- style: e.style,
153
- children: r.isPlaceholder ? null : D(
154
- r.column.columnDef.header,
155
- r.getContext()
156
- )
157
- },
158
- r.id
159
- );
160
- })
161
- },
162
- n.id
163
- )) }),
164
- /* @__PURE__ */ o(z, { children: A.getRowModel().rows.map((n) => /* @__PURE__ */ o(R, { children: n.getVisibleCells().map((r, e) => {
165
- const t = e === 0, s = r.getValue(), l = t && i ? "var(--d-secondary)" : (s == null ? void 0 : s.color) || "transparent";
143
+ className: "sticky top-0 z-20 bg-d-secondary",
144
+ style: { boxShadow: "0 1px 0 0 var(--d-border)" },
145
+ children: z.getHeaderGroups().map((n) => /* @__PURE__ */ o(
146
+ T,
147
+ {
148
+ className: "sticky top-0 z-20 bg-d-secondary",
149
+ children: n.headers.map((r) => {
150
+ const e = O(r);
151
+ return /* @__PURE__ */ o(
152
+ Y,
153
+ {
154
+ className: e.className,
155
+ style: e.style,
156
+ children: r.isPlaceholder ? null : V(
157
+ r.column.columnDef.header,
158
+ r.getContext()
159
+ )
160
+ },
161
+ r.id
162
+ );
163
+ })
164
+ },
165
+ n.id
166
+ ))
167
+ }
168
+ ),
169
+ /* @__PURE__ */ o(Z, { children: z.getRowModel().rows.map((n) => /* @__PURE__ */ o(T, { children: n.getVisibleCells().map((r, e) => {
170
+ const t = e === 0, s = r.getValue(), l = t ? "var(--d-secondary)" : (s == null ? void 0 : s.color) || "transparent";
166
171
  return /* @__PURE__ */ o(
167
- L,
172
+ A,
168
173
  {
169
- className: `text-center ${t && i ? "sticky left-0 z-10" : "border-r"}`,
174
+ className: `text-center ${t ? "sticky left-0 z-10" : "border-r"}`,
170
175
  style: {
171
- boxShadow: t && i ? "inset -1px 0 0 0 var(--d-border)" : "none",
176
+ boxShadow: t ? "inset -1px 0 0 0 var(--d-border)" : "none",
172
177
  backgroundColor: l,
173
- width: `${V}px`
178
+ width: `${R}px`
174
179
  },
175
- children: D(
180
+ children: V(
176
181
  r.column.columnDef.cell,
177
182
  r.getContext()
178
183
  )
@@ -0,0 +1,131 @@
1
+ "use client";
2
+ import { jsx as a, jsxs as i } from "react/jsx-runtime";
3
+ import * as s from "react";
4
+ import { Root as w, Trigger as x, Portal as N, Content as l, Item as m, Label as c, Separator as p, SubTrigger as f, SubContent as u, CheckboxItem as g, ItemIndicator as b, RadioItem as h } from "../../node_modules/@radix-ui/react-dropdown-menu/dist/index.js";
5
+ import { cn as r } from "../../lib/utils.js";
6
+ import y from "../../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
7
+ import v from "../../node_modules/lucide-react/dist/esm/icons/check.js";
8
+ import R from "../../node_modules/lucide-react/dist/esm/icons/circle.js";
9
+ const B = w, E = x, I = s.forwardRef(({ className: e, inset: t, children: o, ...n }, d) => /* @__PURE__ */ i(
10
+ f,
11
+ {
12
+ ref: d,
13
+ className: r(
14
+ "flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
15
+ t && "pl-8",
16
+ e
17
+ ),
18
+ ...n,
19
+ children: [
20
+ o,
21
+ /* @__PURE__ */ a(y, { className: "ml-auto" })
22
+ ]
23
+ }
24
+ ));
25
+ I.displayName = f.displayName;
26
+ const C = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a(
27
+ u,
28
+ {
29
+ ref: o,
30
+ className: r(
31
+ "z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
32
+ e
33
+ ),
34
+ ...t
35
+ }
36
+ ));
37
+ C.displayName = u.displayName;
38
+ const D = s.forwardRef(({ className: e, sideOffset: t = 4, ...o }, n) => /* @__PURE__ */ a(N, { children: /* @__PURE__ */ a(
39
+ l,
40
+ {
41
+ ref: n,
42
+ sideOffset: t,
43
+ className: r(
44
+ "z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md",
45
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-dropdown-menu-content-transform-origin]",
46
+ e
47
+ ),
48
+ ...o
49
+ }
50
+ ) }));
51
+ D.displayName = l.displayName;
52
+ const M = s.forwardRef(({ className: e, inset: t, ...o }, n) => /* @__PURE__ */ a(
53
+ m,
54
+ {
55
+ ref: n,
56
+ className: r(
57
+ "relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",
58
+ t && "pl-8",
59
+ e
60
+ ),
61
+ ...o
62
+ }
63
+ ));
64
+ M.displayName = m.displayName;
65
+ const S = s.forwardRef(({ className: e, children: t, checked: o, ...n }, d) => /* @__PURE__ */ i(
66
+ g,
67
+ {
68
+ ref: d,
69
+ className: r(
70
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
71
+ e
72
+ ),
73
+ checked: o,
74
+ ...n,
75
+ children: [
76
+ /* @__PURE__ */ a("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a(b, { children: /* @__PURE__ */ a(v, { className: "h-4 w-4" }) }) }),
77
+ t
78
+ ]
79
+ }
80
+ ));
81
+ S.displayName = g.displayName;
82
+ const z = s.forwardRef(({ className: e, children: t, ...o }, n) => /* @__PURE__ */ i(
83
+ h,
84
+ {
85
+ ref: n,
86
+ className: r(
87
+ "relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
88
+ e
89
+ ),
90
+ ...o,
91
+ children: [
92
+ /* @__PURE__ */ a("span", { className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center", children: /* @__PURE__ */ a(b, { children: /* @__PURE__ */ a(R, { className: "h-2 w-2 fill-current" }) }) }),
93
+ t
94
+ ]
95
+ }
96
+ ));
97
+ z.displayName = h.displayName;
98
+ const k = s.forwardRef(({ className: e, inset: t, ...o }, n) => /* @__PURE__ */ a(
99
+ c,
100
+ {
101
+ ref: n,
102
+ className: r(
103
+ "px-2 py-1.5 text-sm font-semibold",
104
+ t && "pl-8",
105
+ e
106
+ ),
107
+ ...o
108
+ }
109
+ ));
110
+ k.displayName = c.displayName;
111
+ const T = s.forwardRef(({ className: e, ...t }, o) => /* @__PURE__ */ a(
112
+ p,
113
+ {
114
+ ref: o,
115
+ className: r("-mx-1 my-1 h-px bg-muted", e),
116
+ ...t
117
+ }
118
+ ));
119
+ T.displayName = p.displayName;
120
+ export {
121
+ B as DropdownMenu,
122
+ S as DropdownMenuCheckboxItem,
123
+ D as DropdownMenuContent,
124
+ M as DropdownMenuItem,
125
+ k as DropdownMenuLabel,
126
+ z as DropdownMenuRadioItem,
127
+ T as DropdownMenuSeparator,
128
+ C as DropdownMenuSubContent,
129
+ I as DropdownMenuSubTrigger,
130
+ E as DropdownMenuTrigger
131
+ };
@@ -3,18 +3,11 @@ import { jsx as a } from "react/jsx-runtime";
3
3
  import { cn as o } from "../../lib/utils.js";
4
4
  function n({ className: t, ...e }) {
5
5
  return /* @__PURE__ */ a(
6
- "div",
6
+ "table",
7
7
  {
8
8
  "data-slot": "table-container",
9
- className: "relative w-full overflow-x-auto",
10
- children: /* @__PURE__ */ a(
11
- "table",
12
- {
13
- "data-slot": "table",
14
- className: o("w-full caption-bottom text-sm", t),
15
- ...e
16
- }
17
- )
9
+ className: o("w-full caption-bottom text-sm relative w-full overflow-x-auto ", t),
10
+ ...e
18
11
  }
19
12
  );
20
13
  }
package/dist/index.d.ts CHANGED
@@ -15,6 +15,7 @@ import { default as default_2 } from 'embla-carousel-react';
15
15
  import { default as default_3 } from 'react';
16
16
  import * as DialogPrimitive from '@radix-ui/react-dialog';
17
17
  import { Drawer as Drawer_2 } from 'vaul';
18
+ import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
18
19
  import { FieldError } from 'react-hook-form';
19
20
  import { FieldPath } from 'react-hook-form';
20
21
  import { FieldValues } from 'react-hook-form';
@@ -564,7 +565,7 @@ declare interface CrossTableData {
564
565
  data: (CrossTableCell | null)[][];
565
566
  }
566
567
 
567
- export declare function DataCrossTable({ crossTableData, filterable, loading, emptyComponent, className, notFoundMessage, cornerHeaderFrom, cornerHeaderTo, maxHeaderLength, minWidthCell, initialFreezeColumn, initialFreezeRow, }: DataCrossTableProps): JSX.Element;
568
+ export declare function DataCrossTable({ crossTableData, filterable, loading, emptyComponent, className, notFoundMessage, cornerHeaderFrom, cornerHeaderTo, maxHeaderLength, minWidthCell, }: DataCrossTableProps): JSX.Element;
568
569
 
569
570
  export declare interface DataCrossTableProps {
570
571
  crossTableData: CrossTableData;
@@ -577,8 +578,6 @@ export declare interface DataCrossTableProps {
577
578
  cornerHeaderTo?: string;
578
579
  maxHeaderLength?: number;
579
580
  minWidthCell?: number;
580
- initialFreezeColumn?: boolean;
581
- initialFreezeRow?: boolean;
582
581
  showFreezeControls?: boolean;
583
582
  }
584
583
 
@@ -658,6 +657,22 @@ export declare function DrawerTitle({ className, ...props }: React_2.ComponentPr
658
657
 
659
658
  export declare function DrawerTrigger({ ...props }: React_2.ComponentProps<typeof Drawer_2.Trigger>): JSX.Element;
660
659
 
660
+ export declare const DropdownMenu: React_2.FC<DropdownMenuPrimitive.DropdownMenuProps>;
661
+
662
+ export declare const DropdownMenuContent: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
663
+
664
+ export declare const DropdownMenuItem: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuItemProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
665
+ inset?: boolean;
666
+ } & React_2.RefAttributes<HTMLDivElement>>;
667
+
668
+ export declare const DropdownMenuLabel: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuLabelProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & {
669
+ inset?: boolean;
670
+ } & React_2.RefAttributes<HTMLDivElement>>;
671
+
672
+ export declare const DropdownMenuSeparator: React_2.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuSeparatorProps & React_2.RefAttributes<HTMLDivElement>, "ref"> & React_2.RefAttributes<HTMLDivElement>>;
673
+
674
+ export declare const DropdownMenuTrigger: React_2.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React_2.RefAttributes<HTMLButtonElement>>;
675
+
661
676
  export declare const FilePreview: default_3.ForwardRefExoticComponent<FilePreviewProps & default_3.RefAttributes<HTMLDivElement>>;
662
677
 
663
678
  declare interface FilePreviewProps {