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
package/dist/_virtual/index2.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/index3.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
import { __require as t } from "../node_modules/eventemitter3/index2.js";
|
|
4
|
-
var r = t();
|
|
5
|
-
const m = /* @__PURE__ */ e(r);
|
|
2
|
+
var e = { exports: {} };
|
|
6
3
|
export {
|
|
7
|
-
|
|
4
|
+
e as __module
|
|
8
5
|
};
|
package/dist/_virtual/index4.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/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 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);
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
package/dist/_virtual/index6.js
CHANGED
package/dist/_virtual/index7.js
CHANGED
|
@@ -1,131 +1,157 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as r, jsxs as l, Fragment as
|
|
3
|
-
import * as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
function
|
|
17
|
-
options:
|
|
18
|
-
value:
|
|
19
|
-
onChange:
|
|
20
|
-
onClear:
|
|
2
|
+
import { jsx as r, jsxs as l, Fragment as F } from "react/jsx-runtime";
|
|
3
|
+
import * as t from "react";
|
|
4
|
+
import { useEffect as T } from "react";
|
|
5
|
+
import { cn as p } from "../../lib/utils.js";
|
|
6
|
+
import { Label as G } from "./label.js";
|
|
7
|
+
import { Badge as V } from "./badge.js";
|
|
8
|
+
import { Button as N } from "./button.js";
|
|
9
|
+
import { Popover as X, PopoverTrigger as $, PopoverContent as q } from "./popover.js";
|
|
10
|
+
import { Command as H, CommandList as I, CommandEmpty as J, CommandGroup as K, CommandItem as Q } from "./command.js";
|
|
11
|
+
import { inputVariants as U } from "./input.js";
|
|
12
|
+
import { Checkbox as Y } from "./checkbox.js";
|
|
13
|
+
import { Icon as y } from "./icon.js";
|
|
14
|
+
import Z from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
15
|
+
const _ = t.createContext({ size: "default" });
|
|
16
|
+
function me({
|
|
17
|
+
options: i,
|
|
18
|
+
value: n,
|
|
19
|
+
onChange: s,
|
|
20
|
+
onClear: h,
|
|
21
21
|
placeholder: k = "Seleziona...",
|
|
22
22
|
disabled: z = !1,
|
|
23
|
-
size:
|
|
24
|
-
label:
|
|
23
|
+
size: g = "default",
|
|
24
|
+
label: b,
|
|
25
25
|
labelClassName: M,
|
|
26
|
-
emptyMessage:
|
|
27
|
-
className:
|
|
28
|
-
filterPlaceholder:
|
|
29
|
-
filterable:
|
|
30
|
-
cancelLabel:
|
|
26
|
+
emptyMessage: P = "Nessun risultato trovato",
|
|
27
|
+
className: R,
|
|
28
|
+
filterPlaceholder: j = "Cerca...",
|
|
29
|
+
filterable: D = !1,
|
|
30
|
+
cancelLabel: O = "Cancella selezione",
|
|
31
31
|
cancelButtonLabel: S = "Cancella",
|
|
32
|
-
maxSelectedItems:
|
|
32
|
+
maxSelectedItems: a
|
|
33
33
|
}) {
|
|
34
|
-
const m =
|
|
34
|
+
const m = t.useId(), [o, L] = t.useState(!1), [c, v] = t.useState(""), [B, W] = t.useState(
|
|
35
|
+
void 0
|
|
36
|
+
), A = t.useRef(null), f = t.useRef(null), w = t.useCallback(
|
|
35
37
|
(e) => {
|
|
36
|
-
if (
|
|
37
|
-
|
|
38
|
+
if (n.includes(e))
|
|
39
|
+
s(n.filter((d) => d !== e));
|
|
38
40
|
else {
|
|
39
|
-
if (
|
|
41
|
+
if (a && n.length >= a)
|
|
40
42
|
return;
|
|
41
|
-
|
|
43
|
+
s([...n, e]);
|
|
42
44
|
}
|
|
43
45
|
},
|
|
44
|
-
[
|
|
45
|
-
), x =
|
|
46
|
-
|
|
47
|
-
}, [
|
|
48
|
-
(e) => e.label.toLowerCase().includes(
|
|
49
|
-
) :
|
|
50
|
-
return
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
[n, s, a]
|
|
47
|
+
), x = t.useCallback(() => {
|
|
48
|
+
s([]), v(""), h && h();
|
|
49
|
+
}, [s]), u = t.useMemo(() => i.filter((e) => n.includes(e.value)), [i, n]), E = t.useMemo(() => c ? i.filter(
|
|
50
|
+
(e) => e.label.toLowerCase().includes(c.toLowerCase())
|
|
51
|
+
) : i, [i, c]), C = t.useMemo(() => a ? n.length >= a : !1, [n, a]);
|
|
52
|
+
return T(() => {
|
|
53
|
+
if (o && f.current) {
|
|
54
|
+
const e = f.current.getBoundingClientRect();
|
|
55
|
+
W(e.width);
|
|
56
|
+
}
|
|
57
|
+
}, [o]), /* @__PURE__ */ r(_.Provider, { value: { size: g, id: m }, children: /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
|
|
58
|
+
b && /* @__PURE__ */ r(G, { htmlFor: m, className: M, children: b }),
|
|
59
|
+
/* @__PURE__ */ r(
|
|
53
60
|
"div",
|
|
54
61
|
{
|
|
55
|
-
ref:
|
|
62
|
+
ref: A,
|
|
56
63
|
className: "relative w-full",
|
|
57
64
|
"data-slot": "app-multiple-select-dropdown",
|
|
58
|
-
children: [
|
|
59
|
-
/* @__PURE__ */ l(
|
|
60
|
-
|
|
65
|
+
children: /* @__PURE__ */ l(X, { open: o, onOpenChange: L, children: [
|
|
66
|
+
/* @__PURE__ */ r($, { asChild: !0, children: /* @__PURE__ */ l(
|
|
67
|
+
N,
|
|
61
68
|
{
|
|
62
69
|
id: m,
|
|
63
70
|
type: "button",
|
|
64
71
|
variant: "outline",
|
|
65
72
|
role: "combobox",
|
|
66
|
-
"aria-expanded":
|
|
73
|
+
"aria-expanded": o,
|
|
67
74
|
disabled: z,
|
|
68
|
-
|
|
75
|
+
ref: f,
|
|
76
|
+
className: p(
|
|
69
77
|
"!bg-d-input relative w-full justify-between border font-normal",
|
|
70
|
-
"border-d-input ring-offset-background
|
|
78
|
+
"border-d-input ring-offset-background flex items-center rounded-md border whitespace-nowrap shadow-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
|
|
71
79
|
"aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
|
|
72
|
-
|
|
80
|
+
"focus-visible:ring-d-ring focus-visible:ring-1",
|
|
81
|
+
o && "ring-d-ring ring-1",
|
|
82
|
+
R
|
|
73
83
|
),
|
|
74
|
-
onClick: () => b(!u),
|
|
75
84
|
children: [
|
|
76
|
-
/* @__PURE__ */ r("div", { className: "flex w-full items-center gap-2 overflow-hidden", children:
|
|
85
|
+
/* @__PURE__ */ r("div", { className: "flex w-full items-center justify-between gap-2 overflow-hidden", children: u.length > 0 ? /* @__PURE__ */ l(F, { children: [
|
|
77
86
|
/* @__PURE__ */ l(
|
|
78
|
-
|
|
87
|
+
V,
|
|
79
88
|
{
|
|
80
89
|
variant: "secondary",
|
|
81
|
-
className: "flex items-center gap-1",
|
|
90
|
+
className: "!bg-d-accent flex items-center gap-1",
|
|
82
91
|
children: [
|
|
83
|
-
/* @__PURE__ */ r("span", { children:
|
|
84
|
-
|
|
92
|
+
/* @__PURE__ */ r("span", { children: u.length }),
|
|
93
|
+
u.length === 1 ? " elemento selezionato" : " elementi selezionati"
|
|
85
94
|
]
|
|
86
95
|
}
|
|
87
96
|
),
|
|
88
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ r(
|
|
89
98
|
"div",
|
|
90
99
|
{
|
|
91
|
-
className: "
|
|
100
|
+
className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
|
|
92
101
|
onClick: (e) => {
|
|
93
102
|
e.stopPropagation(), e.preventDefault(), x();
|
|
94
103
|
},
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
104
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
105
|
+
"aria-label": O,
|
|
106
|
+
children: /* @__PURE__ */ r(
|
|
107
|
+
y,
|
|
108
|
+
{
|
|
109
|
+
name: "X",
|
|
110
|
+
size: "xs",
|
|
111
|
+
className: "!text-d-foreground opacity-50"
|
|
112
|
+
}
|
|
113
|
+
)
|
|
99
114
|
}
|
|
100
115
|
)
|
|
101
116
|
] }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: k }) }),
|
|
102
|
-
/* @__PURE__ */ r(
|
|
117
|
+
/* @__PURE__ */ r(Z, { className: "ml-1 h-4 w-4 shrink-0 opacity-50" })
|
|
103
118
|
]
|
|
104
119
|
}
|
|
105
|
-
),
|
|
120
|
+
) }),
|
|
106
121
|
/* @__PURE__ */ r(
|
|
107
|
-
|
|
122
|
+
q,
|
|
108
123
|
{
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
124
|
+
className: p("p-0"),
|
|
125
|
+
style: { width: B },
|
|
126
|
+
align: "start",
|
|
127
|
+
side: "bottom",
|
|
128
|
+
sideOffset: 4,
|
|
129
|
+
onWheel: (e) => e.stopPropagation(),
|
|
130
|
+
avoidCollisions: !1,
|
|
131
|
+
children: /* @__PURE__ */ l(H, { className: "bg-d-popover w-full rounded-md border border-none shadow-lg", children: [
|
|
132
|
+
D && /* @__PURE__ */ l("div", { className: "border-d-border flex items-center justify-between border-b px-3", children: [
|
|
114
133
|
/* @__PURE__ */ l("div", { className: "flex items-center", children: [
|
|
115
|
-
/* @__PURE__ */ r(
|
|
134
|
+
/* @__PURE__ */ r(
|
|
135
|
+
y,
|
|
136
|
+
{
|
|
137
|
+
name: "Search",
|
|
138
|
+
className: "text-d-accent-foreground",
|
|
139
|
+
size: "sm"
|
|
140
|
+
}
|
|
141
|
+
),
|
|
116
142
|
/* @__PURE__ */ r(
|
|
117
143
|
"input",
|
|
118
144
|
{
|
|
119
145
|
id: "app-multiple-select-dropdown-filter",
|
|
120
|
-
placeholder:
|
|
121
|
-
value:
|
|
122
|
-
onChange: (e) =>
|
|
123
|
-
className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${
|
|
146
|
+
placeholder: j,
|
|
147
|
+
value: c,
|
|
148
|
+
onChange: (e) => v(e.target.value),
|
|
149
|
+
className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${U({ size: g })} !shadow-none`
|
|
124
150
|
}
|
|
125
151
|
)
|
|
126
152
|
] }),
|
|
127
|
-
|
|
128
|
-
|
|
153
|
+
u.length > 0 && /* @__PURE__ */ r(
|
|
154
|
+
N,
|
|
129
155
|
{
|
|
130
156
|
variant: "ghost",
|
|
131
157
|
size: "sm",
|
|
@@ -135,26 +161,25 @@ function ie({
|
|
|
135
161
|
}
|
|
136
162
|
)
|
|
137
163
|
] }),
|
|
138
|
-
/* @__PURE__ */ l(
|
|
139
|
-
/* @__PURE__ */ r(
|
|
140
|
-
/* @__PURE__ */ r(
|
|
141
|
-
const
|
|
164
|
+
/* @__PURE__ */ l(I, { className: "max-h-60 w-full", children: [
|
|
165
|
+
/* @__PURE__ */ r(J, { children: P }),
|
|
166
|
+
/* @__PURE__ */ r(K, { children: E.map((e) => {
|
|
167
|
+
const d = n.includes(e.value);
|
|
142
168
|
return /* @__PURE__ */ l(
|
|
143
|
-
|
|
169
|
+
Q,
|
|
144
170
|
{
|
|
145
171
|
value: e.value,
|
|
146
|
-
disabled: e.disabled || !
|
|
172
|
+
disabled: e.disabled || !d && C,
|
|
147
173
|
onSelect: () => w(e.value),
|
|
148
|
-
className:
|
|
174
|
+
className: p(
|
|
149
175
|
"aria-selected:!bg-d-accent aria-selected:text-d-accent-foreground flex cursor-pointer items-center gap-2 px-2 py-1.5",
|
|
150
|
-
(e.disabled || !
|
|
176
|
+
(e.disabled || !d && C) && "cursor-not-allowed opacity-50"
|
|
151
177
|
),
|
|
152
|
-
onPointerDown: (A) => A.stopPropagation(),
|
|
153
178
|
children: [
|
|
154
179
|
/* @__PURE__ */ r(
|
|
155
|
-
|
|
180
|
+
Y,
|
|
156
181
|
{
|
|
157
|
-
checked:
|
|
182
|
+
checked: d,
|
|
158
183
|
className: "z-10 mr-2 flex-shrink-0",
|
|
159
184
|
onCheckedChange: () => {
|
|
160
185
|
console.log("checkbox change for:", e.value), w(e.value);
|
|
@@ -168,14 +193,14 @@ function ie({
|
|
|
168
193
|
);
|
|
169
194
|
}) })
|
|
170
195
|
] })
|
|
171
|
-
] })
|
|
196
|
+
] })
|
|
172
197
|
}
|
|
173
198
|
)
|
|
174
|
-
]
|
|
199
|
+
] })
|
|
175
200
|
}
|
|
176
201
|
)
|
|
177
202
|
] }) });
|
|
178
203
|
}
|
|
179
204
|
export {
|
|
180
|
-
|
|
205
|
+
me as AppMultipleSelectDropdown
|
|
181
206
|
};
|
|
@@ -1,42 +1,62 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
2
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import * as b from "react";
|
|
4
|
+
import { Select as C, SelectTrigger as O, SelectValue as B, SelectContent as G, SelectSeparator as N, SelectGroup as j, SelectLabel as w, SelectItem as D } from "./select.js";
|
|
5
|
+
import { SelectScrollDownButton as F, SelectScrollUpButton as R } from "./select.js";
|
|
6
|
+
function U({
|
|
6
7
|
options: p,
|
|
7
|
-
placeholder:
|
|
8
|
-
children:
|
|
9
|
-
label:
|
|
10
|
-
className:
|
|
11
|
-
labelKey:
|
|
12
|
-
valueKey:
|
|
13
|
-
descriptionKey:
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
placeholder: d,
|
|
9
|
+
children: m,
|
|
10
|
+
label: g,
|
|
11
|
+
className: h,
|
|
12
|
+
labelKey: S,
|
|
13
|
+
valueKey: o,
|
|
14
|
+
descriptionKey: u,
|
|
15
|
+
groupNameKey: a,
|
|
16
|
+
isOptionDisabled: f,
|
|
17
|
+
...A
|
|
16
18
|
}) {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
const i = (t) => {
|
|
20
|
+
const c = S && o, e = String(c ? t[o] : t.value), r = c ? String(t[S]) : t.label, l = c && u ? String(t[u]) : null, x = c ? f?.(t) ?? !1 : t.disabled;
|
|
21
|
+
return /* @__PURE__ */ n(D, { value: e, disabled: x, children: /* @__PURE__ */ s("span", { className: "flex flex-col", children: [
|
|
22
|
+
/* @__PURE__ */ n("span", { children: r }),
|
|
23
|
+
l && /* @__PURE__ */ s("span", { className: "text-muted-foreground text-d-tertiary text-xs", children: [
|
|
24
|
+
"- ",
|
|
25
|
+
l
|
|
26
|
+
] })
|
|
27
|
+
] }) }, e);
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ s(C, { ...A, label: g, className: h, children: [
|
|
30
|
+
m || /* @__PURE__ */ n(O, { className: "w-full", children: /* @__PURE__ */ n(B, { placeholder: d }) }),
|
|
31
|
+
/* @__PURE__ */ n(G, { children: (() => {
|
|
32
|
+
if (!p.some((e) => a ? String(e[a]) : e.groupName))
|
|
33
|
+
return p.map(i);
|
|
34
|
+
const c = p.reduce(
|
|
35
|
+
(e, r) => {
|
|
36
|
+
const l = a ? String(r[a]) : r.groupName || "Altro";
|
|
37
|
+
return e[l] || (e[l] = []), e[l].push(r), e;
|
|
38
|
+
},
|
|
39
|
+
{}
|
|
40
|
+
);
|
|
41
|
+
return Object.entries(c).map(([e, r], l) => /* @__PURE__ */ s(b.Fragment, { children: [
|
|
42
|
+
l > 0 && /* @__PURE__ */ n(N, {}),
|
|
43
|
+
/* @__PURE__ */ s(j, { children: [
|
|
44
|
+
/* @__PURE__ */ n(w, { children: e }),
|
|
45
|
+
r.map(i)
|
|
26
46
|
] })
|
|
27
|
-
] }
|
|
28
|
-
}) })
|
|
47
|
+
] }, e));
|
|
48
|
+
})() })
|
|
29
49
|
] });
|
|
30
50
|
}
|
|
31
51
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
52
|
+
U as AppSelect,
|
|
53
|
+
G as AppSelectContent,
|
|
54
|
+
j as AppSelectGroup,
|
|
55
|
+
D as AppSelectItem,
|
|
56
|
+
w as AppSelectLabel,
|
|
57
|
+
F as AppSelectScrollDownButton,
|
|
58
|
+
R as AppSelectScrollUpButton,
|
|
59
|
+
N as AppSelectSeparator,
|
|
60
|
+
O as AppSelectTrigger,
|
|
61
|
+
B as AppSelectValue
|
|
42
62
|
};
|