laif-ds 0.1.86 → 0.1.89
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/index2.js +5 -2
- package/dist/_virtual/index3.js +2 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +5 -5
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/ui/app-multiple-select-dropdown.js +115 -90
- package/dist/components/ui/app-select.js +54 -34
- package/dist/components/ui/async-select.js +185 -155
- package/dist/components/ui/button.js +34 -34
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/date-picker.js +7 -7
- package/dist/components/ui/input.js +10 -11
- package/dist/components/ui/multiple-selector.js +205 -191
- package/dist/components/ui/select.js +22 -17
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/weekly-calendar/appointment-card.js +39 -39
- package/dist/components/ui/weekly-calendar/day-column.js +1 -1
- package/dist/index.d.ts +7 -5
- 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/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
- package/dist/components/ui/command-portal.js +0 -67
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as a, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import * as x from "react";
|
|
4
4
|
import { cva as g } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as s } from "../../lib/utils.js";
|
|
6
6
|
import { Label as v } from "./label.js";
|
|
7
7
|
import { Icon as l } from "./icon.js";
|
|
8
8
|
const b = g(
|
|
9
|
-
"file:text-d-foreground placeholder:text-d-muted-foreground selection:bg-d-primary selection:text-d-primary-foreground border-d-input flex w-full min-w-0 rounded-md border bg-d-input px-3 py-1 text-base shadow-sm transition-
|
|
9
|
+
"file:text-d-foreground placeholder:text-d-muted-foreground selection:bg-d-primary selection:text-d-primary-foreground border-d-input flex w-full min-w-0 rounded-md border bg-d-input px-3 py-1 text-base shadow-sm transition-all duration-200 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50 md:text-sm hover:shadow-md",
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
size: {
|
|
@@ -27,14 +27,14 @@ const b = g(
|
|
|
27
27
|
labelClassName: u,
|
|
28
28
|
id: p,
|
|
29
29
|
iconLeft: i,
|
|
30
|
-
iconRight:
|
|
30
|
+
iconRight: d,
|
|
31
31
|
size: t,
|
|
32
32
|
...f
|
|
33
33
|
}, c) => {
|
|
34
34
|
const n = p || (r ? `input-${Math.random().toString(36).substring(2, 9)}` : void 0);
|
|
35
|
-
return /* @__PURE__ */
|
|
35
|
+
return /* @__PURE__ */ a("div", { className: s("space-y-1.5", o), children: [
|
|
36
36
|
r && /* @__PURE__ */ e(v, { htmlFor: n, className: u, children: r }),
|
|
37
|
-
/* @__PURE__ */
|
|
37
|
+
/* @__PURE__ */ a("div", { className: "relative w-full", children: [
|
|
38
38
|
i && /* @__PURE__ */ e("div", { className: "text-d-muted-foreground pointer-events-none absolute top-1/2 left-3 -translate-y-1/2", children: /* @__PURE__ */ e(l, { name: i, size: t === "lg" ? "sm" : "xs" }) }),
|
|
39
39
|
/* @__PURE__ */ e(
|
|
40
40
|
"input",
|
|
@@ -42,19 +42,18 @@ const b = g(
|
|
|
42
42
|
id: n,
|
|
43
43
|
type: m,
|
|
44
44
|
"data-slot": "input",
|
|
45
|
-
className:
|
|
45
|
+
className: s(
|
|
46
46
|
b({ size: t }),
|
|
47
|
-
"focus-visible:ring-ring focus-visible:ring-1 focus-visible:outline-none",
|
|
47
|
+
"focus-visible:ring-d-ring focus-visible:ring-1 focus-visible:outline-none",
|
|
48
48
|
"aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
|
|
49
|
-
"shadow-sm",
|
|
50
49
|
i ? t !== "lg" ? "pl-9" : "pl-10" : "",
|
|
51
|
-
|
|
50
|
+
d ? t !== "lg" ? "pr-9" : "pr-10" : ""
|
|
52
51
|
),
|
|
53
52
|
ref: c,
|
|
54
53
|
...f
|
|
55
54
|
}
|
|
56
55
|
),
|
|
57
|
-
|
|
56
|
+
d && /* @__PURE__ */ e("div", { className: "text-d-muted-foreground pointer-events-none absolute top-1/2 right-3 -translate-y-1/2", children: /* @__PURE__ */ e(l, { name: d, size: t === "lg" ? "sm" : "xs" }) })
|
|
58
57
|
] })
|
|
59
58
|
] });
|
|
60
59
|
}
|
|
@@ -1,366 +1,380 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { Command as
|
|
4
|
-
import * as
|
|
5
|
-
import { useEffect as C, forwardRef as
|
|
6
|
-
import {
|
|
7
|
-
import { Badge as
|
|
8
|
-
import { CommandItem as
|
|
9
|
-
import { cn as
|
|
10
|
-
import { Label as
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
2
|
+
import { jsx as r, jsxs as L, Fragment as G } from "react/jsx-runtime";
|
|
3
|
+
import { Command as ae, useCommandState as ce } from "../../node_modules/cmdk/dist/index.js";
|
|
4
|
+
import * as o from "react";
|
|
5
|
+
import { useEffect as C, forwardRef as fe } from "react";
|
|
6
|
+
import { Popover as me, PopoverTrigger as ge, PopoverContent as he } from "./popover.js";
|
|
7
|
+
import { Badge as pe } from "./badge.js";
|
|
8
|
+
import { CommandItem as I, Command as q, CommandList as ve, CommandGroup as be } from "./command.js";
|
|
9
|
+
import { cn as p } from "../../lib/utils.js";
|
|
10
|
+
import { Label as we } from "./label.js";
|
|
11
|
+
import { Icon as xe } from "./icon.js";
|
|
12
|
+
import Ne from "../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
13
|
+
function ye(s, l) {
|
|
14
|
+
const [i, a] = o.useState(s);
|
|
14
15
|
return C(() => {
|
|
15
|
-
const u = setTimeout(() => a(
|
|
16
|
+
const u = setTimeout(() => a(s), l);
|
|
16
17
|
return () => {
|
|
17
18
|
clearTimeout(u);
|
|
18
19
|
};
|
|
19
|
-
}, [
|
|
20
|
+
}, [s, l]), i;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
if (
|
|
22
|
+
function T(s, l) {
|
|
23
|
+
if (s.length === 0)
|
|
23
24
|
return {};
|
|
24
|
-
if (!
|
|
25
|
+
if (!l)
|
|
25
26
|
return {
|
|
26
|
-
"":
|
|
27
|
+
"": s
|
|
27
28
|
};
|
|
28
|
-
const
|
|
29
|
-
return
|
|
30
|
-
const u = a[
|
|
31
|
-
|
|
32
|
-
}),
|
|
29
|
+
const i = {};
|
|
30
|
+
return s.forEach((a) => {
|
|
31
|
+
const u = a[l] || "";
|
|
32
|
+
i[u] || (i[u] = []), i[u].push(a);
|
|
33
|
+
}), i;
|
|
33
34
|
}
|
|
34
|
-
function
|
|
35
|
-
const
|
|
36
|
-
for (const [a, u] of Object.entries(
|
|
37
|
-
|
|
38
|
-
(
|
|
35
|
+
function Ce(s, l) {
|
|
36
|
+
const i = JSON.parse(JSON.stringify(s));
|
|
37
|
+
for (const [a, u] of Object.entries(i))
|
|
38
|
+
i[a] = u.filter(
|
|
39
|
+
(V) => !l.find((c) => c.value === V.value)
|
|
39
40
|
);
|
|
40
|
-
return
|
|
41
|
+
return i;
|
|
41
42
|
}
|
|
42
|
-
function
|
|
43
|
-
for (const [,
|
|
44
|
-
if (
|
|
43
|
+
function Ee(s, l) {
|
|
44
|
+
for (const [, i] of Object.entries(s))
|
|
45
|
+
if (i.some((a) => l.find((u) => u.value === a.value)))
|
|
45
46
|
return !0;
|
|
46
47
|
return !1;
|
|
47
48
|
}
|
|
48
|
-
const Q =
|
|
49
|
+
const Q = fe(({ className: s, ...l }, i) => ce((u) => u.filtered.count === 0) ? /* @__PURE__ */ r(
|
|
49
50
|
"div",
|
|
50
51
|
{
|
|
51
|
-
ref:
|
|
52
|
-
className:
|
|
52
|
+
ref: i,
|
|
53
|
+
className: p("py-6 text-center text-sm", s),
|
|
53
54
|
"cmdk-empty": "",
|
|
54
55
|
role: "presentation",
|
|
55
|
-
...
|
|
56
|
+
...l
|
|
56
57
|
}
|
|
57
58
|
) : null);
|
|
58
59
|
Q.displayName = "CommandEmpty";
|
|
59
|
-
const
|
|
60
|
+
const Oe = o.forwardRef(
|
|
60
61
|
({
|
|
61
|
-
value:
|
|
62
|
-
onChange:
|
|
63
|
-
placeholder:
|
|
62
|
+
value: s,
|
|
63
|
+
onChange: l,
|
|
64
|
+
placeholder: i,
|
|
64
65
|
defaultOptions: a = [],
|
|
65
66
|
options: u,
|
|
66
|
-
delay:
|
|
67
|
+
delay: V,
|
|
67
68
|
onSearch: c,
|
|
68
|
-
onSearchSync:
|
|
69
|
+
onSearchSync: X,
|
|
69
70
|
loadingIndicator: Y,
|
|
70
71
|
emptyIndicator: D,
|
|
71
72
|
maxSelected: _ = Number.MAX_SAFE_INTEGER,
|
|
72
|
-
onMaxSelected:
|
|
73
|
-
hidePlaceholderWhenSelected:
|
|
74
|
-
disabled:
|
|
75
|
-
groupBy:
|
|
73
|
+
onMaxSelected: A,
|
|
74
|
+
hidePlaceholderWhenSelected: U,
|
|
75
|
+
disabled: N,
|
|
76
|
+
groupBy: v,
|
|
76
77
|
className: Z,
|
|
77
|
-
badgeClassName:
|
|
78
|
-
selectFirstItem:
|
|
79
|
-
creatable:
|
|
80
|
-
triggerSearchOnFocus:
|
|
78
|
+
badgeClassName: B,
|
|
79
|
+
selectFirstItem: P = !0,
|
|
80
|
+
creatable: E = !1,
|
|
81
|
+
triggerSearchOnFocus: R = !1,
|
|
81
82
|
commandProps: m,
|
|
82
|
-
inputProps:
|
|
83
|
-
hideClearAllButton:
|
|
84
|
-
label:
|
|
85
|
-
},
|
|
86
|
-
const
|
|
87
|
-
|
|
88
|
-
),
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
inputProps: O,
|
|
84
|
+
hideClearAllButton: ee = !1,
|
|
85
|
+
label: W
|
|
86
|
+
}, te) => {
|
|
87
|
+
const g = o.useRef(null), [f, S] = o.useState(!1), [ne, z] = o.useState(!1), [H, $] = o.useState(!1), [re, oe] = o.useState(
|
|
88
|
+
void 0
|
|
89
|
+
), j = o.useRef(null), F = o.useRef(null), [t, y] = o.useState(s || []), [b, J] = o.useState(
|
|
90
|
+
T(a, v)
|
|
91
|
+
), [h, K] = o.useState(""), w = ye(h, V || 500);
|
|
92
|
+
o.useImperativeHandle(
|
|
93
|
+
te,
|
|
91
94
|
() => ({
|
|
92
95
|
selectedValue: [...t],
|
|
93
|
-
input:
|
|
94
|
-
focus: () =>
|
|
95
|
-
reset: () =>
|
|
96
|
+
input: g.current,
|
|
97
|
+
focus: () => g?.current?.focus(),
|
|
98
|
+
reset: () => y([])
|
|
96
99
|
}),
|
|
97
100
|
[t]
|
|
98
101
|
);
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
},
|
|
102
|
+
const x = (e) => {
|
|
103
|
+
j.current && !j.current.contains(e.target) && g.current && !g.current.contains(e.target) && (S(!1), g.current.blur());
|
|
104
|
+
}, M = o.useCallback(
|
|
102
105
|
(e) => {
|
|
103
|
-
const n = t.filter((
|
|
104
|
-
|
|
106
|
+
const n = t.filter((d) => d.value !== e.value);
|
|
107
|
+
y(n), l?.(n);
|
|
105
108
|
},
|
|
106
|
-
[
|
|
107
|
-
),
|
|
109
|
+
[l, t]
|
|
110
|
+
), se = o.useCallback(
|
|
108
111
|
(e) => {
|
|
109
|
-
const n =
|
|
110
|
-
n && ((e.key === "Delete" || e.key === "Backspace") && n.value === "" && t.length > 0 && (t[t.length - 1].fixed ||
|
|
112
|
+
const n = g.current;
|
|
113
|
+
n && ((e.key === "Delete" || e.key === "Backspace") && n.value === "" && t.length > 0 && (t[t.length - 1].fixed || M(t[t.length - 1])), e.key === "Escape" && n.blur());
|
|
111
114
|
},
|
|
112
|
-
[
|
|
115
|
+
[M, t]
|
|
113
116
|
);
|
|
114
117
|
C(() => {
|
|
115
118
|
if (typeof document < "u")
|
|
116
|
-
return
|
|
117
|
-
document.removeEventListener("mousedown",
|
|
119
|
+
return f ? (document.addEventListener("mousedown", x), document.addEventListener("touchend", x)) : (document.removeEventListener("mousedown", x), document.removeEventListener("touchend", x)), () => {
|
|
120
|
+
document.removeEventListener("mousedown", x), document.removeEventListener("touchend", x);
|
|
118
121
|
};
|
|
119
|
-
}, [
|
|
120
|
-
|
|
121
|
-
}, [
|
|
122
|
+
}, [f, x]), C(() => {
|
|
123
|
+
s && y(s);
|
|
124
|
+
}, [s]), C(() => {
|
|
122
125
|
if (!u || c)
|
|
123
126
|
return;
|
|
124
|
-
const e =
|
|
125
|
-
JSON.stringify(e) !== JSON.stringify(
|
|
126
|
-
}, [a, u,
|
|
127
|
+
const e = T(u || [], v);
|
|
128
|
+
JSON.stringify(e) !== JSON.stringify(b) && J(e);
|
|
129
|
+
}, [a, u, v, c, b]), C(() => {
|
|
127
130
|
const e = () => {
|
|
128
|
-
const
|
|
129
|
-
T(
|
|
131
|
+
const d = X?.(w);
|
|
132
|
+
J(T(d || [], v));
|
|
130
133
|
};
|
|
131
134
|
(async () => {
|
|
132
|
-
!
|
|
135
|
+
!X || !f || (R && e(), w && e());
|
|
133
136
|
})();
|
|
134
|
-
}, [w,
|
|
137
|
+
}, [w, v, f, R]), C(() => {
|
|
135
138
|
const e = async () => {
|
|
136
139
|
$(!0);
|
|
137
|
-
const
|
|
138
|
-
T(
|
|
140
|
+
const d = await c?.(w);
|
|
141
|
+
J(T(d || [], v)), $(!1);
|
|
139
142
|
};
|
|
140
143
|
(async () => {
|
|
141
|
-
!c || !
|
|
144
|
+
!c || !f || (R && await e(), w && await e());
|
|
142
145
|
})();
|
|
143
|
-
}, [w,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
+
}, [w, v, f, R]), o.useEffect(() => {
|
|
147
|
+
if (f && F.current) {
|
|
148
|
+
const e = F.current.getBoundingClientRect();
|
|
149
|
+
oe(e.width);
|
|
150
|
+
}
|
|
151
|
+
}, [f]);
|
|
152
|
+
const le = () => {
|
|
153
|
+
if (!E || Ee(b, [{ value: h, label: h }]) || t.find((n) => n.value === h))
|
|
146
154
|
return;
|
|
147
|
-
const e = /* @__PURE__ */
|
|
148
|
-
|
|
155
|
+
const e = /* @__PURE__ */ r(
|
|
156
|
+
I,
|
|
149
157
|
{
|
|
150
|
-
value:
|
|
158
|
+
value: h,
|
|
151
159
|
className: "cursor-pointer",
|
|
152
160
|
onMouseDown: (n) => {
|
|
153
161
|
n.preventDefault(), n.stopPropagation();
|
|
154
162
|
},
|
|
155
163
|
onSelect: (n) => {
|
|
156
164
|
if (t.length >= _) {
|
|
157
|
-
|
|
165
|
+
A?.(t.length);
|
|
158
166
|
return;
|
|
159
167
|
}
|
|
160
|
-
|
|
161
|
-
const
|
|
162
|
-
|
|
168
|
+
K("");
|
|
169
|
+
const d = [...t, { value: n, label: n }];
|
|
170
|
+
y(d), l?.(d);
|
|
163
171
|
},
|
|
164
|
-
children: `Create "${
|
|
172
|
+
children: `Create "${h}"`
|
|
165
173
|
}
|
|
166
174
|
);
|
|
167
|
-
if (!c &&
|
|
175
|
+
if (!c && h.length > 0 || c && w.length > 0 && !H)
|
|
168
176
|
return e;
|
|
169
|
-
},
|
|
177
|
+
}, ie = o.useCallback(() => {
|
|
170
178
|
if (D)
|
|
171
|
-
return c && !
|
|
172
|
-
}, [
|
|
173
|
-
() =>
|
|
174
|
-
[
|
|
175
|
-
),
|
|
179
|
+
return c && !E && Object.keys(b).length === 0 ? /* @__PURE__ */ r(I, { value: "-", disabled: !0, children: D }) : /* @__PURE__ */ r(Q, { children: D });
|
|
180
|
+
}, [E, D, c, b]), de = o.useMemo(
|
|
181
|
+
() => Ce(b, t),
|
|
182
|
+
[b, t]
|
|
183
|
+
), ue = o.useCallback(() => {
|
|
176
184
|
if (m?.filter)
|
|
177
185
|
return m.filter;
|
|
178
|
-
if (
|
|
186
|
+
if (E)
|
|
179
187
|
return (e, n) => e.toLowerCase().includes(n.toLowerCase()) ? 1 : -1;
|
|
180
|
-
}, [
|
|
188
|
+
}, [E, m?.filter]);
|
|
181
189
|
return /* @__PURE__ */ L("div", { className: "flex flex-col space-y-1.5", children: [
|
|
182
|
-
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
-
|
|
190
|
+
W && /* @__PURE__ */ r(we, { children: W }),
|
|
191
|
+
/* @__PURE__ */ r(
|
|
192
|
+
q,
|
|
185
193
|
{
|
|
186
|
-
ref:
|
|
194
|
+
ref: j,
|
|
187
195
|
...m,
|
|
188
196
|
onKeyDown: (e) => {
|
|
189
|
-
|
|
197
|
+
se(e), m?.onKeyDown?.(e);
|
|
190
198
|
},
|
|
191
|
-
className:
|
|
192
|
-
"bg-d-input h-auto overflow-visible shadow-sm",
|
|
199
|
+
className: p(
|
|
200
|
+
"bg-d-input border-d-border h-auto overflow-visible shadow-sm",
|
|
193
201
|
m?.className
|
|
194
202
|
),
|
|
195
203
|
shouldFilter: m?.shouldFilter !== void 0 ? m.shouldFilter : !c,
|
|
196
|
-
filter:
|
|
197
|
-
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
204
|
+
filter: ue(),
|
|
205
|
+
children: /* @__PURE__ */ L(me, { open: f, onOpenChange: S, children: [
|
|
206
|
+
/* @__PURE__ */ r(ge, { asChild: !0, children: /* @__PURE__ */ r(
|
|
199
207
|
"div",
|
|
200
208
|
{
|
|
201
|
-
|
|
202
|
-
|
|
209
|
+
ref: F,
|
|
210
|
+
className: p(
|
|
211
|
+
"border-d-input ring-offset-d-background min-h-10 rounded-md border text-base md:text-sm",
|
|
212
|
+
"focus-within:outline-none",
|
|
213
|
+
"focus-visible-within:ring-d-ring focus-visible-within:ring-1",
|
|
214
|
+
f && "ring-d-ring ring-1",
|
|
203
215
|
{
|
|
204
216
|
"px-3 py-2": t.length !== 0,
|
|
205
|
-
"cursor-text": !
|
|
206
|
-
"disabled:cursor-not-allowed disabled:opacity-50":
|
|
217
|
+
"cursor-text": !N && t.length !== 0,
|
|
218
|
+
"disabled:cursor-not-allowed disabled:opacity-50": N
|
|
207
219
|
},
|
|
208
220
|
Z
|
|
209
221
|
),
|
|
210
|
-
onClick: () => {
|
|
211
|
-
v || f?.current?.focus();
|
|
212
|
-
},
|
|
213
222
|
children: /* @__PURE__ */ L("div", { className: "relative flex flex-wrap gap-1", children: [
|
|
214
223
|
t.map((e) => /* @__PURE__ */ L(
|
|
215
|
-
|
|
224
|
+
pe,
|
|
216
225
|
{
|
|
217
|
-
className:
|
|
226
|
+
className: p(
|
|
218
227
|
"data-[disabled]:bg-d-secondary-foreground data-[disabled]:text-d-secondary data-[disabled]:hover:bg-d-secondary-foreground",
|
|
219
228
|
"data-[fixed]:bg-d-secondary-foreground data-[fixed]:text-d-secondary data-[fixed]:hover:bg-d-secondary-foreground",
|
|
220
|
-
|
|
229
|
+
B
|
|
221
230
|
),
|
|
222
231
|
"data-fixed": e.fixed,
|
|
223
|
-
"data-disabled":
|
|
232
|
+
"data-disabled": N || void 0,
|
|
224
233
|
children: [
|
|
225
234
|
e.label,
|
|
226
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ r(
|
|
227
236
|
"button",
|
|
228
237
|
{
|
|
229
238
|
type: "button",
|
|
230
|
-
className:
|
|
239
|
+
className: p(
|
|
231
240
|
"text-d-secondary-foreground ring-offset-d-background focus:ring-d-ring ml-1 rounded-full outline-none focus:ring-1 focus:ring-offset-2",
|
|
232
|
-
(
|
|
241
|
+
(N || e.fixed) && "hidden"
|
|
233
242
|
),
|
|
234
243
|
onKeyDown: (n) => {
|
|
235
|
-
n.key === "Enter" &&
|
|
244
|
+
n.key === "Enter" && M(e);
|
|
236
245
|
},
|
|
237
246
|
onMouseDown: (n) => {
|
|
238
247
|
n.preventDefault(), n.stopPropagation();
|
|
239
248
|
},
|
|
240
|
-
onClick: () =>
|
|
241
|
-
children: /* @__PURE__ */
|
|
249
|
+
onClick: () => M(e),
|
|
250
|
+
children: /* @__PURE__ */ r(Ne, { className: "text-d-secondary-foreground hover:text-d-foreground h-3 w-3 cursor-pointer" })
|
|
242
251
|
}
|
|
243
252
|
)
|
|
244
253
|
]
|
|
245
254
|
},
|
|
246
255
|
e.value
|
|
247
256
|
)),
|
|
248
|
-
/* @__PURE__ */
|
|
249
|
-
|
|
257
|
+
/* @__PURE__ */ r(
|
|
258
|
+
ae.Input,
|
|
250
259
|
{
|
|
251
|
-
...
|
|
252
|
-
ref:
|
|
253
|
-
value:
|
|
254
|
-
disabled:
|
|
260
|
+
...O,
|
|
261
|
+
ref: g,
|
|
262
|
+
value: h,
|
|
263
|
+
disabled: N,
|
|
255
264
|
onValueChange: (e) => {
|
|
256
|
-
|
|
265
|
+
K(e), O?.onValueChange?.(e);
|
|
257
266
|
},
|
|
258
267
|
onBlur: (e) => {
|
|
259
|
-
|
|
268
|
+
ne || S(!1), O?.onBlur?.(e);
|
|
260
269
|
},
|
|
261
270
|
onFocus: (e) => {
|
|
262
|
-
|
|
271
|
+
S(!0), O?.onFocus?.(e);
|
|
263
272
|
},
|
|
264
|
-
placeholder:
|
|
265
|
-
className:
|
|
273
|
+
placeholder: U && t.length !== 0 ? "" : i,
|
|
274
|
+
className: p(
|
|
266
275
|
"placeholder:text-d-muted-foreground flex-1 bg-transparent outline-none",
|
|
267
276
|
{
|
|
268
|
-
"w-full":
|
|
277
|
+
"w-full": U,
|
|
269
278
|
"px-3 py-2": t.length === 0,
|
|
270
279
|
"ml-1": t.length !== 0
|
|
271
280
|
},
|
|
272
|
-
|
|
281
|
+
O?.className
|
|
273
282
|
)
|
|
274
283
|
}
|
|
275
284
|
),
|
|
276
|
-
/* @__PURE__ */
|
|
285
|
+
/* @__PURE__ */ r(
|
|
277
286
|
"div",
|
|
278
287
|
{
|
|
279
|
-
className:
|
|
280
|
-
"
|
|
281
|
-
(
|
|
288
|
+
className: p(
|
|
289
|
+
"border-d-input bg-d-accent cursor-pointer rounded-full p-1",
|
|
290
|
+
(ee || N || t.length < 1 || t.filter((e) => e.fixed).length === t.length) && "hidden"
|
|
282
291
|
),
|
|
283
292
|
onClick: () => {
|
|
284
|
-
|
|
293
|
+
y(t.filter((e) => e.fixed)), l?.(t.filter((e) => e.fixed));
|
|
285
294
|
},
|
|
286
295
|
"aria-label": "Clear selection",
|
|
287
|
-
children: /* @__PURE__ */
|
|
296
|
+
children: /* @__PURE__ */ r(
|
|
297
|
+
xe,
|
|
298
|
+
{
|
|
299
|
+
name: "X",
|
|
300
|
+
size: "xs",
|
|
301
|
+
className: "!text-d-foreground opacity-50"
|
|
302
|
+
}
|
|
303
|
+
)
|
|
288
304
|
}
|
|
289
305
|
)
|
|
290
306
|
] })
|
|
291
307
|
}
|
|
292
|
-
),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
|
|
308
|
+
) }),
|
|
309
|
+
/* @__PURE__ */ r(
|
|
310
|
+
he,
|
|
295
311
|
{
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
children: /* @__PURE__ */ o(
|
|
302
|
-
me,
|
|
312
|
+
className: "border-none p-0 shadow-lg",
|
|
313
|
+
style: { width: re },
|
|
314
|
+
onWheel: (e) => e.stopPropagation(),
|
|
315
|
+
children: /* @__PURE__ */ r(q, { shouldFilter: !1, className: "w-full", children: /* @__PURE__ */ r(
|
|
316
|
+
ve,
|
|
303
317
|
{
|
|
304
318
|
className: "bg-d-popover text-d-popover-foreground animate-in border-d-border w-full rounded-md border shadow-md outline-none",
|
|
305
319
|
onMouseLeave: () => {
|
|
306
|
-
|
|
320
|
+
z(!1);
|
|
307
321
|
},
|
|
308
322
|
onMouseEnter: () => {
|
|
309
|
-
|
|
323
|
+
z(!0);
|
|
310
324
|
},
|
|
311
325
|
onMouseUp: () => {
|
|
312
|
-
|
|
326
|
+
g?.current?.focus();
|
|
313
327
|
},
|
|
314
|
-
children: H ? /* @__PURE__ */
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
!
|
|
318
|
-
Object.entries(
|
|
319
|
-
|
|
328
|
+
children: H ? /* @__PURE__ */ r(G, { children: Y }) : /* @__PURE__ */ L(G, { children: [
|
|
329
|
+
ie(),
|
|
330
|
+
le(),
|
|
331
|
+
!P && /* @__PURE__ */ r(I, { value: "-", className: "hidden" }),
|
|
332
|
+
Object.entries(de).map(([e, n]) => /* @__PURE__ */ r(
|
|
333
|
+
be,
|
|
320
334
|
{
|
|
321
335
|
heading: e,
|
|
322
336
|
className: "h-full overflow-auto",
|
|
323
|
-
children: /* @__PURE__ */
|
|
324
|
-
|
|
337
|
+
children: /* @__PURE__ */ r(G, { children: n.map((d) => /* @__PURE__ */ r(
|
|
338
|
+
I,
|
|
325
339
|
{
|
|
326
|
-
value:
|
|
327
|
-
disabled:
|
|
328
|
-
onMouseDown: (
|
|
329
|
-
|
|
340
|
+
value: d.label,
|
|
341
|
+
disabled: d.disable,
|
|
342
|
+
onMouseDown: (k) => {
|
|
343
|
+
k.preventDefault(), k.stopPropagation();
|
|
330
344
|
},
|
|
331
345
|
onSelect: () => {
|
|
332
346
|
if (t.length >= _) {
|
|
333
|
-
|
|
347
|
+
A?.(t.length);
|
|
334
348
|
return;
|
|
335
349
|
}
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
|
|
350
|
+
K("");
|
|
351
|
+
const k = [...t, d];
|
|
352
|
+
y(k), l?.(k);
|
|
339
353
|
},
|
|
340
|
-
className:
|
|
354
|
+
className: p(
|
|
341
355
|
"cursor-pointer",
|
|
342
|
-
|
|
356
|
+
d.disable && "text-d-secondary-foreground cursor-default"
|
|
343
357
|
),
|
|
344
|
-
children:
|
|
358
|
+
children: d.label
|
|
345
359
|
},
|
|
346
|
-
|
|
360
|
+
d.value
|
|
347
361
|
)) })
|
|
348
362
|
},
|
|
349
363
|
e
|
|
350
364
|
))
|
|
351
365
|
] })
|
|
352
366
|
}
|
|
353
|
-
)
|
|
367
|
+
) })
|
|
354
368
|
}
|
|
355
369
|
)
|
|
356
|
-
]
|
|
370
|
+
] })
|
|
357
371
|
}
|
|
358
372
|
)
|
|
359
373
|
] });
|
|
360
374
|
}
|
|
361
375
|
);
|
|
362
|
-
|
|
376
|
+
Oe.displayName = "MultipleSelector";
|
|
363
377
|
export {
|
|
364
|
-
|
|
365
|
-
|
|
378
|
+
Oe as MultipleSelector,
|
|
379
|
+
ye as useDebounce
|
|
366
380
|
};
|