laif-ds 0.2.22 → 0.2.24
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/_virtual/index.js +3 -5
- package/dist/_virtual/index3.js +5 -2
- package/dist/_virtual/index4.js +5 -3
- package/dist/_virtual/index5.js +5 -5
- package/dist/_virtual/index6.js +2 -5
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/ui/alert-dialog.js +6 -6
- package/dist/components/ui/app-multiple-select-dropdown.js +34 -34
- package/dist/components/ui/app-select.js +127 -124
- package/dist/components/ui/badge.js +13 -12
- package/dist/components/ui/button.js +20 -18
- package/dist/components/ui/calendar.js +6 -6
- package/dist/components/ui/checkbox.js +9 -9
- package/dist/components/ui/confirmer.js +45 -19
- package/dist/components/ui/context-menu.js +4 -4
- package/dist/components/ui/input-otp.js +16 -16
- package/dist/components/ui/input-selector.js +19 -19
- package/dist/components/ui/input.js +19 -19
- package/dist/components/ui/menubar.js +1 -1
- package/dist/components/ui/pagination.js +90 -77
- package/dist/components/ui/radio-group.js +14 -14
- package/dist/components/ui/select.js +27 -27
- package/dist/components/ui/switch.js +8 -6
- package/dist/components/ui/table.js +16 -16
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +6 -6
- package/dist/components/ui/tables/data-table/components/data-table-actions.js +51 -0
- package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +470 -0
- package/dist/components/ui/tables/data-table/components/data-table-body.js +340 -0
- package/dist/components/ui/tables/data-table/components/data-table-column-visibility.js +274 -0
- package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +177 -0
- package/dist/components/ui/tables/data-table/components/data-table-filters.js +286 -0
- package/dist/components/ui/tables/data-table/components/data-table-pagination.js +131 -0
- package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +112 -0
- package/dist/components/ui/tables/data-table/components/data-table-simple-filters.js +263 -0
- package/dist/components/ui/tables/data-table/components/data-table-sorting.js +128 -0
- package/dist/components/ui/tables/data-table/data-table-constants.js +58 -0
- package/dist/components/ui/tables/data-table/data-table-i18n.js +138 -0
- package/dist/components/ui/tables/data-table/data-table.js +549 -0
- package/dist/components/ui/tables/data-table/data-table.service.js +254 -0
- package/dist/components/ui/tabs.js +33 -33
- package/dist/components/ui/textarea.js +18 -15
- package/dist/components/ui/tooltip.js +10 -10
- package/dist/css-for-template.css +57 -0
- package/dist/index.d.ts +247 -76
- package/dist/index.js +64 -64
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +5 -3
- package/dist/components/ui/data-table.js +0 -461
- package/dist/components/ui/data-table.service.js +0 -62
package/dist/_virtual/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
var r = t();
|
|
5
|
-
const m = /* @__PURE__ */ e(r);
|
|
2
|
+
import { __require as r } from "../node_modules/use-sync-external-store/shim/index.js";
|
|
3
|
+
var i = r();
|
|
6
4
|
export {
|
|
7
|
-
|
|
5
|
+
i as s
|
|
8
6
|
};
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
2
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as t } from "../node_modules/eventemitter3/index2.js";
|
|
4
|
+
var r = t();
|
|
5
|
+
const m = /* @__PURE__ */ e(r);
|
|
3
6
|
export {
|
|
4
|
-
|
|
7
|
+
m as default
|
|
5
8
|
};
|
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
|
|
4
|
+
var t = e();
|
|
5
|
+
const a = /* @__PURE__ */ r(t);
|
|
4
6
|
export {
|
|
5
|
-
|
|
7
|
+
a as default
|
|
6
8
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var t =
|
|
5
|
-
const
|
|
2
|
+
import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
|
|
3
|
+
import { __require as r } from "../node_modules/extend/index.js";
|
|
4
|
+
var t = r();
|
|
5
|
+
const x = /* @__PURE__ */ e(t);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
x as default
|
|
8
8
|
};
|
package/dist/_virtual/index6.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { __require as r } from "../node_modules/extend/index.js";
|
|
4
|
-
var t = r();
|
|
5
|
-
const x = /* @__PURE__ */ e(t);
|
|
2
|
+
var e = {};
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
e as __exports
|
|
8
5
|
};
|
package/dist/_virtual/index7.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
3
3
|
import { Root as n, Trigger as i, Content as s, Title as d, Description as c, Action as g, Cancel as u, Portal as f, Overlay as m } from "../../node_modules/@radix-ui/react-alert-dialog/dist/index.js";
|
|
4
|
-
import { cn as o } from "../../lib/utils.js";
|
|
5
4
|
import { buttonVariants as l } from "./button.js";
|
|
5
|
+
import { cn as o } from "../../lib/utils.js";
|
|
6
6
|
function N({ ...t }) {
|
|
7
7
|
return /* @__PURE__ */ e(n, { "data-slot": "alert-dialog", ...t });
|
|
8
8
|
}
|
|
@@ -64,7 +64,7 @@ function C({ className: t, ...a }) {
|
|
|
64
64
|
}
|
|
65
65
|
);
|
|
66
66
|
}
|
|
67
|
-
function
|
|
67
|
+
function h({ className: t, ...a }) {
|
|
68
68
|
return /* @__PURE__ */ e(
|
|
69
69
|
d,
|
|
70
70
|
{
|
|
@@ -74,7 +74,7 @@ function z({ className: t, ...a }) {
|
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function z({
|
|
78
78
|
className: t,
|
|
79
79
|
...a
|
|
80
80
|
}) {
|
|
@@ -100,7 +100,7 @@ function O({ className: t, ...a }) {
|
|
|
100
100
|
return /* @__PURE__ */ e(
|
|
101
101
|
u,
|
|
102
102
|
{
|
|
103
|
-
className: o(l({ variant: "
|
|
103
|
+
className: o(l({ variant: "ghost" }), t),
|
|
104
104
|
...a
|
|
105
105
|
}
|
|
106
106
|
);
|
|
@@ -110,11 +110,11 @@ export {
|
|
|
110
110
|
j as AlertDialogAction,
|
|
111
111
|
O as AlertDialogCancel,
|
|
112
112
|
T as AlertDialogContent,
|
|
113
|
-
|
|
113
|
+
z as AlertDialogDescription,
|
|
114
114
|
C as AlertDialogFooter,
|
|
115
115
|
w as AlertDialogHeader,
|
|
116
116
|
x as AlertDialogOverlay,
|
|
117
117
|
p as AlertDialogPortal,
|
|
118
|
-
|
|
118
|
+
h as AlertDialogTitle,
|
|
119
119
|
y as AlertDialogTrigger
|
|
120
120
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r, jsxs as l, Fragment as A } from "react/jsx-runtime";
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
3
|
+
import { Badge as B } from "./badge.js";
|
|
4
|
+
import { Command as E, CommandList as F, CommandEmpty as V, CommandGroup as G, CommandItem as X } from "./command.js";
|
|
5
|
+
import { Label as $ } from "./label.js";
|
|
5
6
|
import { cn as u } from "../../lib/utils.js";
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { inputVariants as K } from "./input.js";
|
|
11
|
-
import { Checkbox as Q } from "./checkbox.js";
|
|
7
|
+
import * as t from "react";
|
|
8
|
+
import { useEffect as q } from "react";
|
|
9
|
+
import { selectTriggerVariants as H } from "./async-select.js";
|
|
10
|
+
import { Checkbox as I } from "./checkbox.js";
|
|
12
11
|
import { Icon as N } from "./icon.js";
|
|
13
|
-
import {
|
|
12
|
+
import { inputVariants as J } from "./input.js";
|
|
13
|
+
import { Popover as K, PopoverTrigger as Q, PopoverContent as U } from "./popover.js";
|
|
14
14
|
import Y from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
15
15
|
const Z = t.createContext({ size: "default" });
|
|
16
16
|
function ue({
|
|
@@ -30,12 +30,12 @@ function ue({
|
|
|
30
30
|
cancelLabel: j = "Cancella selezione",
|
|
31
31
|
maxSelectedItems: i
|
|
32
32
|
}) {
|
|
33
|
-
const f = t.useId(), [s, D] = t.useState(!1), [
|
|
33
|
+
const f = t.useId(), [s, D] = t.useState(!1), [d, v] = t.useState(""), [O, S] = t.useState(
|
|
34
34
|
void 0
|
|
35
35
|
), L = t.useRef(null), p = t.useRef(null), w = t.useCallback(
|
|
36
36
|
(e) => {
|
|
37
37
|
if (n.includes(e))
|
|
38
|
-
o(n.filter((
|
|
38
|
+
o(n.filter((c) => c !== e));
|
|
39
39
|
else {
|
|
40
40
|
if (i && n.length >= i)
|
|
41
41
|
return;
|
|
@@ -45,24 +45,24 @@ function ue({
|
|
|
45
45
|
[n, o, i]
|
|
46
46
|
), T = t.useCallback(() => {
|
|
47
47
|
o([]), v(""), g && g();
|
|
48
|
-
}, [o]), h = t.useMemo(() => a.filter((e) => n.includes(e.value)), [a, n]), W = t.useMemo(() =>
|
|
49
|
-
(e) => e.label.toLowerCase().includes(
|
|
50
|
-
) : a, [a,
|
|
51
|
-
return
|
|
48
|
+
}, [o]), h = t.useMemo(() => a.filter((e) => n.includes(e.value)), [a, n]), W = t.useMemo(() => d ? a.filter(
|
|
49
|
+
(e) => e.label.toLowerCase().includes(d.toLowerCase())
|
|
50
|
+
) : a, [a, d]), x = t.useMemo(() => i ? n.length >= i : !1, [n, i]);
|
|
51
|
+
return q(() => {
|
|
52
52
|
if (s && p.current) {
|
|
53
53
|
const e = p.current.getBoundingClientRect();
|
|
54
54
|
S(e.width);
|
|
55
55
|
}
|
|
56
56
|
}, [s]), /* @__PURE__ */ r(Z.Provider, { value: { size: m, id: f }, children: /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
|
|
57
|
-
b && /* @__PURE__ */ r(
|
|
57
|
+
b && /* @__PURE__ */ r($, { htmlFor: f, className: u(k, "w-fit"), children: b }),
|
|
58
58
|
/* @__PURE__ */ r(
|
|
59
59
|
"div",
|
|
60
60
|
{
|
|
61
61
|
ref: L,
|
|
62
62
|
className: "relative w-full",
|
|
63
63
|
"data-slot": "app-multiple-select-dropdown",
|
|
64
|
-
children: /* @__PURE__ */ l(
|
|
65
|
-
/* @__PURE__ */ r(
|
|
64
|
+
children: /* @__PURE__ */ l(K, { open: s, onOpenChange: D, children: [
|
|
65
|
+
/* @__PURE__ */ r(Q, { asChild: !0, children: /* @__PURE__ */ l(
|
|
66
66
|
"button",
|
|
67
67
|
{
|
|
68
68
|
id: f,
|
|
@@ -72,10 +72,10 @@ function ue({
|
|
|
72
72
|
disabled: y,
|
|
73
73
|
ref: p,
|
|
74
74
|
className: u(
|
|
75
|
-
|
|
75
|
+
H({ size: m }),
|
|
76
76
|
"!bg-d-input hover:bg-d-input/50 relative w-full justify-between font-normal",
|
|
77
77
|
"ring-offset-background border-d-border/50 flex items-center rounded-md border whitespace-nowrap focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
78
|
-
"aria-invalid:ring-d-destructive/20
|
|
78
|
+
"aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive",
|
|
79
79
|
"focus-visible:ring-d-ring focus-visible:ring-1",
|
|
80
80
|
s && "ring-d-ring ring-1",
|
|
81
81
|
z
|
|
@@ -83,7 +83,7 @@ function ue({
|
|
|
83
83
|
children: [
|
|
84
84
|
/* @__PURE__ */ r("div", { className: "flex w-full items-center justify-between gap-2 overflow-hidden", children: h.length > 0 ? /* @__PURE__ */ l(A, { children: [
|
|
85
85
|
/* @__PURE__ */ l(
|
|
86
|
-
|
|
86
|
+
B,
|
|
87
87
|
{
|
|
88
88
|
variant: "secondary",
|
|
89
89
|
className: "!bg-d-accent flex items-center gap-1",
|
|
@@ -118,7 +118,7 @@ function ue({
|
|
|
118
118
|
}
|
|
119
119
|
) }),
|
|
120
120
|
/* @__PURE__ */ r(
|
|
121
|
-
|
|
121
|
+
U,
|
|
122
122
|
{
|
|
123
123
|
className: u("p-0"),
|
|
124
124
|
style: { width: O },
|
|
@@ -127,7 +127,7 @@ function ue({
|
|
|
127
127
|
sideOffset: 4,
|
|
128
128
|
onWheel: (e) => e.stopPropagation(),
|
|
129
129
|
avoidCollisions: !1,
|
|
130
|
-
children: /* @__PURE__ */ l(
|
|
130
|
+
children: /* @__PURE__ */ l(E, { className: "bg-d-popover w-full rounded-md border border-none", children: [
|
|
131
131
|
R && /* @__PURE__ */ r("div", { className: "border-d-border flex items-center justify-between border-b px-3", children: /* @__PURE__ */ l("div", { className: "flex items-center", children: [
|
|
132
132
|
/* @__PURE__ */ r(
|
|
133
133
|
N,
|
|
@@ -142,31 +142,31 @@ function ue({
|
|
|
142
142
|
{
|
|
143
143
|
id: "app-multiple-select-dropdown-filter",
|
|
144
144
|
placeholder: P,
|
|
145
|
-
value:
|
|
145
|
+
value: d,
|
|
146
146
|
onChange: (e) => v(e.target.value),
|
|
147
|
-
className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${
|
|
147
|
+
className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${J({ size: m })} !shadow-none`
|
|
148
148
|
}
|
|
149
149
|
)
|
|
150
150
|
] }) }),
|
|
151
|
-
/* @__PURE__ */ l(
|
|
152
|
-
/* @__PURE__ */ r(
|
|
153
|
-
/* @__PURE__ */ r(
|
|
154
|
-
const
|
|
151
|
+
/* @__PURE__ */ l(F, { className: "max-h-60 w-full", children: [
|
|
152
|
+
/* @__PURE__ */ r(V, { children: M }),
|
|
153
|
+
/* @__PURE__ */ r(G, { children: W.map((e) => {
|
|
154
|
+
const c = n.includes(e.value);
|
|
155
155
|
return /* @__PURE__ */ l(
|
|
156
|
-
|
|
156
|
+
X,
|
|
157
157
|
{
|
|
158
158
|
value: e.value,
|
|
159
|
-
disabled: e.disabled || !
|
|
159
|
+
disabled: e.disabled || !c && x,
|
|
160
160
|
onSelect: () => w(e.value),
|
|
161
161
|
className: u(
|
|
162
162
|
"aria-selected:!bg-d-accent aria-selected:text-d-accent-foreground flex cursor-pointer items-center gap-2 px-2 py-1.5",
|
|
163
|
-
(e.disabled || !
|
|
163
|
+
(e.disabled || !c && x) && "cursor-not-allowed opacity-50"
|
|
164
164
|
),
|
|
165
165
|
children: [
|
|
166
166
|
/* @__PURE__ */ r(
|
|
167
|
-
|
|
167
|
+
I,
|
|
168
168
|
{
|
|
169
|
-
checked:
|
|
169
|
+
checked: c,
|
|
170
170
|
className: "z-10 mr-2 flex-shrink-0",
|
|
171
171
|
onCheckedChange: () => {
|
|
172
172
|
console.log("checkbox change for:", e.value), w(e.value);
|
|
@@ -1,197 +1,200 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as s, jsx as
|
|
3
|
-
import { Badge as
|
|
4
|
-
import { Command as
|
|
5
|
-
import { Label as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { useState as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import he from "
|
|
12
|
-
|
|
2
|
+
import { jsxs as s, jsx as r, Fragment as le } from "react/jsx-runtime";
|
|
3
|
+
import { Badge as re } from "./badge.js";
|
|
4
|
+
import { Command as ne, CommandInput as te, CommandList as ae, CommandEmpty as se, CommandGroup as j, CommandItem as B } from "./command.js";
|
|
5
|
+
import { Label as ie } from "./label.js";
|
|
6
|
+
import { cn as y } from "../../lib/utils.js";
|
|
7
|
+
import { useState as h, useRef as oe, useMemo as N, useCallback as de, useEffect as ce } from "react";
|
|
8
|
+
import { Button as D } from "./button.js";
|
|
9
|
+
import { Checkbox as ue } from "./checkbox.js";
|
|
10
|
+
import { Icon as me } from "./icon.js";
|
|
11
|
+
import { Popover as fe, PopoverTrigger as he, PopoverContent as pe } from "./popover.js";
|
|
12
|
+
import ge from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
13
|
+
const ve = {
|
|
13
14
|
sm: "min-h-8 h-8 text-xs py-1.5",
|
|
14
15
|
default: "min-h-9 h-9 text-sm py-2",
|
|
15
16
|
lg: "min-h-10 h-10 text-base py-2"
|
|
16
|
-
}, ge = {
|
|
17
|
-
sm: "h-5 w-5",
|
|
18
|
-
default: "h-5 w-5",
|
|
19
|
-
lg: "h-5.5 w-5.5"
|
|
20
17
|
};
|
|
21
|
-
function
|
|
18
|
+
function ke(S) {
|
|
22
19
|
const {
|
|
23
|
-
multiple:
|
|
24
|
-
options:
|
|
25
|
-
value:
|
|
26
|
-
defaultValue:
|
|
27
|
-
onValueChange:
|
|
28
|
-
onClear:
|
|
29
|
-
placeholder:
|
|
30
|
-
emptyPlaceholder:
|
|
31
|
-
searchPlaceholder:
|
|
32
|
-
addItemPlaceholder:
|
|
33
|
-
itemCountMessage:
|
|
34
|
-
maxSelectedMessage:
|
|
20
|
+
multiple: n = !1,
|
|
21
|
+
options: m,
|
|
22
|
+
value: A,
|
|
23
|
+
defaultValue: L,
|
|
24
|
+
onValueChange: M,
|
|
25
|
+
onClear: p,
|
|
26
|
+
placeholder: R = "Seleziona...",
|
|
27
|
+
emptyPlaceholder: X = "Nessun risultato",
|
|
28
|
+
searchPlaceholder: E = "Cerca...",
|
|
29
|
+
addItemPlaceholder: F = "Aggiungi",
|
|
30
|
+
itemCountMessage: T = (e) => `${e} elementi selezionati`,
|
|
31
|
+
maxSelectedMessage: W = (e) => `Puoi selezionare fino a ${e} elementi`,
|
|
35
32
|
label: P,
|
|
36
33
|
className: $ = "",
|
|
37
|
-
wrpClassName:
|
|
38
|
-
searchable:
|
|
39
|
-
creatable:
|
|
40
|
-
groupBy:
|
|
34
|
+
wrpClassName: G = "",
|
|
35
|
+
searchable: O = !1,
|
|
36
|
+
creatable: q = !1,
|
|
37
|
+
groupBy: g = "group",
|
|
41
38
|
maxSelected: o,
|
|
42
39
|
showChipsInsteadOfCount: H = !1,
|
|
43
|
-
disabled:
|
|
44
|
-
size:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
40
|
+
disabled: v,
|
|
41
|
+
size: J = "default",
|
|
42
|
+
isSingleSelectClearable: K = !1
|
|
43
|
+
} = S, [b, x] = h(!1), [d, C] = h(""), w = oe(null), [Q, U] = h(0), V = S.hasOwnProperty("value"), [Y, Z] = h(L), i = V ? A : Y, c = (e) => {
|
|
44
|
+
V || Z(e), M?.(e);
|
|
45
|
+
}, t = N(() => n ? Array.isArray(i) ? i : [] : i != null ? [i] : [], [i, n]), u = N(() => {
|
|
46
|
+
const e = m.filter((a) => t.includes(a.value));
|
|
47
|
+
if (n) {
|
|
48
|
+
const a = t.filter((l) => !e.find((f) => f.value === l)).map((l) => ({ value: l, label: l }));
|
|
49
|
+
return [...e, ...a];
|
|
50
|
+
} else if (t.length && !e.length)
|
|
51
|
+
return [{ value: t[0], label: t[0] }];
|
|
54
52
|
return e;
|
|
55
|
-
}, [
|
|
53
|
+
}, [m, t, n]), z = (e) => {
|
|
56
54
|
if (!e.disabled)
|
|
57
|
-
if (
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
55
|
+
if (n) {
|
|
56
|
+
const a = t.includes(e.value);
|
|
57
|
+
if (!a && o !== void 0 && t.length >= o)
|
|
60
58
|
return;
|
|
61
59
|
c(
|
|
62
|
-
|
|
60
|
+
a ? t.filter((l) => l !== e.value) : [...t, e.value]
|
|
63
61
|
);
|
|
64
62
|
} else
|
|
65
|
-
c(e.value),
|
|
66
|
-
},
|
|
67
|
-
c([]),
|
|
68
|
-
}, [c,
|
|
69
|
-
(e,
|
|
70
|
-
const
|
|
71
|
-
return e[
|
|
63
|
+
c(e.value), x(!1);
|
|
64
|
+
}, k = de(() => {
|
|
65
|
+
c(n ? [] : void 0), C(""), p && p();
|
|
66
|
+
}, [c, p, n]), _ = N(() => g ? m.reduce(
|
|
67
|
+
(e, a) => {
|
|
68
|
+
const l = a[g] || "";
|
|
69
|
+
return e[l] = e[l] || [], e[l].push(a), e;
|
|
72
70
|
},
|
|
73
71
|
{}
|
|
74
|
-
) : { "":
|
|
75
|
-
return
|
|
76
|
-
|
|
77
|
-
}, [
|
|
78
|
-
P && /* @__PURE__ */
|
|
72
|
+
) : { "": m }, [m, g]);
|
|
73
|
+
return ce(() => {
|
|
74
|
+
b && w.current && U(w.current.getBoundingClientRect().width);
|
|
75
|
+
}, [b]), /* @__PURE__ */ s("div", { className: y("flex flex-col gap-2", G), children: [
|
|
76
|
+
P && /* @__PURE__ */ r(ie, { children: P }),
|
|
79
77
|
/* @__PURE__ */ s(
|
|
80
|
-
|
|
78
|
+
fe,
|
|
81
79
|
{
|
|
82
|
-
open:
|
|
83
|
-
onOpenChange: (e) => !
|
|
80
|
+
open: v ? !1 : b,
|
|
81
|
+
onOpenChange: (e) => !v && x(e),
|
|
84
82
|
modal: !0,
|
|
85
83
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
84
|
+
/* @__PURE__ */ r(he, { asChild: !0, children: /* @__PURE__ */ s(
|
|
87
85
|
"div",
|
|
88
86
|
{
|
|
89
|
-
ref:
|
|
90
|
-
className:
|
|
91
|
-
"bg-d-input border-d-border/50 focus-within:ring-d-ring flex min-h-10 w-full min-w-[100px] items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm focus-within:ring-1",
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
ref: w,
|
|
88
|
+
className: y(
|
|
89
|
+
"bg-d-input border-d-border/50 focus-within:ring-d-ring flex min-h-10 w-full min-w-[100px] cursor-pointer items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm focus-within:ring-1",
|
|
90
|
+
ve[J],
|
|
91
|
+
v && "cursor-not-allowed opacity-50",
|
|
94
92
|
$
|
|
95
93
|
),
|
|
96
94
|
children: [
|
|
97
|
-
|
|
98
|
-
/* @__PURE__ */
|
|
99
|
-
|
|
95
|
+
u.length === 0 ? /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: R }) : n ? /* @__PURE__ */ s("div", { className: "flex h-full w-full min-w-0 items-center justify-between gap-2", children: [
|
|
96
|
+
/* @__PURE__ */ r("div", { className: "flex min-w-0 flex-nowrap gap-1 overflow-auto", children: H ? /* @__PURE__ */ r(le, { children: u.map((e) => /* @__PURE__ */ s(
|
|
97
|
+
re,
|
|
100
98
|
{
|
|
101
99
|
variant: "secondary",
|
|
102
100
|
className: "hover:bg-d-secondary/100 bg-d-secondary/50 border-d-border flex cursor-pointer items-center gap-1 border",
|
|
103
|
-
onClick: (
|
|
104
|
-
|
|
101
|
+
onClick: (a) => {
|
|
102
|
+
a.stopPropagation(), z(e);
|
|
105
103
|
},
|
|
106
104
|
children: [
|
|
107
105
|
e.label,
|
|
108
|
-
!e.fixed && /* @__PURE__ */
|
|
106
|
+
!e.fixed && /* @__PURE__ */ r(me, { name: "X", size: "xs" })
|
|
109
107
|
]
|
|
110
108
|
},
|
|
111
109
|
e.value
|
|
112
|
-
)) }) : /* @__PURE__ */
|
|
113
|
-
/* @__PURE__ */
|
|
114
|
-
|
|
110
|
+
)) }) : /* @__PURE__ */ r("div", { children: T(u.length) }) }),
|
|
111
|
+
n && /* @__PURE__ */ r(
|
|
112
|
+
D,
|
|
115
113
|
{
|
|
116
|
-
className: h
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
114
|
+
className: "h-6 w-6 rounded-full",
|
|
115
|
+
iconLeft: "X",
|
|
116
|
+
variant: "ghost-destructive",
|
|
117
|
+
size: "icon",
|
|
120
118
|
onClick: (e) => {
|
|
121
|
-
e.stopPropagation(), e.preventDefault(),
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
119
|
+
e.stopPropagation(), e.preventDefault(), k();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] }) : /* @__PURE__ */ s("div", { className: "flex h-full w-full min-w-0 items-center justify-between gap-2", children: [
|
|
124
|
+
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1 truncate", children: typeof u[0]?.label == "string" ? /* @__PURE__ */ r("span", { children: u[0]?.label }) : u[0]?.label }),
|
|
125
|
+
K && i !== void 0 && i !== null && /* @__PURE__ */ r(
|
|
126
|
+
D,
|
|
127
|
+
{
|
|
128
|
+
className: "h-6 w-6 rounded-full",
|
|
129
|
+
iconLeft: "X",
|
|
130
|
+
variant: "ghost-destructive",
|
|
131
|
+
size: "icon",
|
|
132
|
+
onClick: (e) => {
|
|
133
|
+
e.stopPropagation(), e.preventDefault(), k();
|
|
134
|
+
}
|
|
132
135
|
}
|
|
133
136
|
)
|
|
134
|
-
] })
|
|
135
|
-
/* @__PURE__ */
|
|
137
|
+
] }),
|
|
138
|
+
/* @__PURE__ */ r(ge, { className: "h-4 w-4 opacity-50" })
|
|
136
139
|
]
|
|
137
140
|
}
|
|
138
141
|
) }),
|
|
139
|
-
/* @__PURE__ */
|
|
140
|
-
|
|
142
|
+
/* @__PURE__ */ r(
|
|
143
|
+
pe,
|
|
141
144
|
{
|
|
142
145
|
className: "p-0",
|
|
143
|
-
style: { width:
|
|
146
|
+
style: { width: Q },
|
|
144
147
|
align: "start",
|
|
145
148
|
sideOffset: 4,
|
|
146
|
-
children: /* @__PURE__ */ s(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
children: /* @__PURE__ */ s(ne, { shouldFilter: !!O, className: "w-full", children: [
|
|
150
|
+
O && /* @__PURE__ */ r(
|
|
151
|
+
te,
|
|
149
152
|
{
|
|
150
|
-
placeholder:
|
|
153
|
+
placeholder: E,
|
|
151
154
|
className: "placeholder:text-d-muted-foreground",
|
|
152
|
-
value:
|
|
153
|
-
onValueChange:
|
|
155
|
+
value: d,
|
|
156
|
+
onValueChange: C
|
|
154
157
|
}
|
|
155
158
|
),
|
|
156
|
-
/* @__PURE__ */ s(
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
/* @__PURE__ */ s(ae, { className: "max-h-60 overflow-auto overscroll-contain", children: [
|
|
160
|
+
/* @__PURE__ */ r(se, { children: X }),
|
|
161
|
+
q && d && /* @__PURE__ */ r(j, { children: /* @__PURE__ */ r(
|
|
162
|
+
B,
|
|
160
163
|
{
|
|
161
164
|
className: "cursor-pointer",
|
|
162
165
|
onSelect: () => {
|
|
163
|
-
|
|
166
|
+
d && (c(n ? [...t, d] : d), C(""), !n && x(!1));
|
|
164
167
|
},
|
|
165
168
|
children: /* @__PURE__ */ s("div", { className: "text-d-foreground text-xs", children: [
|
|
166
|
-
|
|
169
|
+
F,
|
|
167
170
|
" “",
|
|
168
|
-
|
|
171
|
+
d,
|
|
169
172
|
"”"
|
|
170
173
|
] })
|
|
171
174
|
}
|
|
172
175
|
) }),
|
|
173
|
-
Object.entries(
|
|
174
|
-
const
|
|
176
|
+
Object.entries(_).map(([e, a]) => /* @__PURE__ */ r(j, { heading: e || void 0, children: a.map((l) => {
|
|
177
|
+
const f = t.includes(l.value), ee = n && o !== void 0 && !f && t.length >= o, I = l.disabled || ee;
|
|
175
178
|
return /* @__PURE__ */ s(
|
|
176
|
-
|
|
179
|
+
B,
|
|
177
180
|
{
|
|
178
|
-
value: typeof
|
|
179
|
-
onSelect: () => !
|
|
180
|
-
className:
|
|
181
|
+
value: typeof l.label == "string" ? l.label : String(l.value),
|
|
182
|
+
onSelect: () => !I && z(l),
|
|
183
|
+
className: y(
|
|
181
184
|
"cursor-pointer",
|
|
182
|
-
|
|
183
|
-
!
|
|
185
|
+
I && "cursor-not-allowed opacity-50",
|
|
186
|
+
!n && f && "bg-d-accent/75 text-d-accent-foreground"
|
|
184
187
|
),
|
|
185
188
|
children: [
|
|
186
|
-
|
|
187
|
-
/* @__PURE__ */
|
|
189
|
+
n && /* @__PURE__ */ r(ue, { checked: f, className: "mr-1" }),
|
|
190
|
+
typeof l.label == "string" ? /* @__PURE__ */ r("span", { children: l.label }) : l.label
|
|
188
191
|
]
|
|
189
192
|
},
|
|
190
|
-
|
|
193
|
+
l.value
|
|
191
194
|
);
|
|
192
195
|
}) }, e))
|
|
193
196
|
] }),
|
|
194
|
-
|
|
197
|
+
n && o !== void 0 && t.length >= o && /* @__PURE__ */ r("div", { className: "border-d-border text-d-muted-foreground border-t px-2 py-1 text-xs", children: W(o) })
|
|
195
198
|
] })
|
|
196
199
|
}
|
|
197
200
|
)
|
|
@@ -201,5 +204,5 @@ function ze(M) {
|
|
|
201
204
|
] });
|
|
202
205
|
}
|
|
203
206
|
export {
|
|
204
|
-
|
|
207
|
+
ke as AppSelect
|
|
205
208
|
};
|