laif-ds 0.1.43 → 0.1.44

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.
@@ -1,3 +1,6 @@
1
1
  "use client";
2
- import { __require as e } from "../node_modules/react-is/index.js";
3
- e();
2
+ import { __require as r } from "../node_modules/use-sync-external-store/shim/index.js";
3
+ var i = r();
4
+ export {
5
+ i as s
6
+ };
@@ -1,6 +1,3 @@
1
1
  "use client";
2
- import { __require as r } from "../node_modules/use-sync-external-store/shim/index.js";
3
- var i = r();
4
- export {
5
- i as s
6
- };
2
+ import { __require as e } from "../node_modules/react-is/index.js";
3
+ e();
@@ -1,5 +1,8 @@
1
1
  "use client";
2
- var e = {};
2
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
+ import { __require as e } from "../node_modules/classnames/index.js";
4
+ var s = e();
5
+ const o = /* @__PURE__ */ r(s);
3
6
  export {
4
- e as __exports
7
+ o as default
5
8
  };
@@ -1,8 +1,5 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
- import { __require as e } from "../node_modules/classnames/index.js";
4
- var s = e();
5
- const o = /* @__PURE__ */ r(s);
2
+ var e = {};
6
3
  export {
7
- o as default
4
+ e as __exports
8
5
  };
@@ -1,101 +1,92 @@
1
1
  "use client";
2
- import { jsx as r, jsxs as l, Fragment as R } from "react/jsx-runtime";
3
- import * as a from "react";
4
- import { useEffect as A } from "react";
5
- import { cn as N } from "../../lib/utils.js";
6
- import { Label as B } from "./label.js";
7
- import { Badge as D } from "./badge.js";
2
+ import { jsx as r, jsxs as a, Fragment as P } from "react/jsx-runtime";
3
+ import * as t from "react";
4
+ import { cn as C } from "../../lib/utils.js";
5
+ import { Label as A } from "./label.js";
6
+ import { Badge as B } from "./badge.js";
8
7
  import { Button as p } from "./button.js";
9
- import { Command as F, CommandList as P, CommandEmpty as G, CommandGroup as X, CommandItem as q } from "./command.js";
10
- import { Input as H } from "./input.js";
11
- import { Checkbox as I } from "./checkbox.js";
8
+ import { Command as D, CommandList as F, CommandEmpty as E, CommandGroup as G, CommandItem as X } from "./command.js";
9
+ import { Input as q } from "./input.js";
10
+ import { Checkbox as H } from "./checkbox.js";
11
+ import { CommandPortal as I } from "./command-portal.js";
12
12
  import J from "../../node_modules/lucide-react/dist/esm/icons/x.js";
13
13
  import K from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
14
14
  import Q from "../../node_modules/lucide-react/dist/esm/icons/check.js";
15
- const T = a.createContext({ size: "default" });
15
+ const T = t.createContext({ size: "default" });
16
16
  function ne({
17
17
  options: o,
18
- value: t,
18
+ value: l,
19
19
  onChange: i,
20
- placeholder: C = "Seleziona...",
21
- disabled: k = !1,
22
- size: d = "default",
23
- label: g,
24
- labelClassName: y,
25
- emptyMessage: L = "Nessun risultato trovato",
26
- className: M,
20
+ placeholder: N = "Seleziona...",
21
+ disabled: y = !1,
22
+ size: c = "default",
23
+ label: h,
24
+ labelClassName: k,
25
+ emptyMessage: M = "Nessun risultato trovato",
26
+ className: L,
27
27
  filterPlaceholder: z = "Cerca...",
28
- cancelLabel: E = "Cancella selezione",
29
- cancelButtonLabel: O = "Cancella",
30
- maxSelectedItems: s
28
+ cancelLabel: R = "Cancella selezione",
29
+ cancelButtonLabel: S = "Cancella",
30
+ maxSelectedItems: n
31
31
  }) {
32
- const f = a.useId(), [c, b] = a.useState(!1), [m, v] = a.useState(""), h = a.useRef(null);
33
- A(() => {
34
- const e = (n) => {
35
- h.current && !h.current.contains(n.target) && c && b(!1);
36
- };
37
- return document.addEventListener("mousedown", e), () => {
38
- document.removeEventListener("mousedown", e);
39
- };
40
- }, [c]);
41
- const S = a.useCallback(
32
+ const u = t.useId(), [f, g] = t.useState(!1), [d, b] = t.useState(""), x = t.useRef(null), j = t.useCallback(
42
33
  (e) => {
43
- if (t.includes(e))
44
- i(t.filter((n) => n !== e));
34
+ if (l.includes(e))
35
+ i(l.filter((s) => s !== e));
45
36
  else {
46
- if (s && t.length >= s)
37
+ if (n && l.length >= n)
47
38
  return;
48
- i([...t, e]);
39
+ i([...l, e]);
49
40
  }
50
41
  },
51
- [t, i, s]
52
- ), w = a.useCallback(() => {
53
- i([]), v("");
54
- }, [i]), u = a.useMemo(() => o.filter((e) => t.includes(e.value)), [o, t]), j = a.useMemo(() => m ? o.filter(
55
- (e) => e.label.toLowerCase().includes(m.toLowerCase())
56
- ) : o, [o, m]), x = a.useMemo(() => s ? t.length >= s : !1, [t, s]);
57
- return /* @__PURE__ */ r(T.Provider, { value: { size: d, id: f }, children: /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
58
- g && /* @__PURE__ */ r(B, { htmlFor: f, className: y, children: g }),
59
- /* @__PURE__ */ l(
42
+ [l, i, n]
43
+ ), w = t.useCallback(() => {
44
+ i([]), b("");
45
+ }, [i]), m = t.useMemo(() => o.filter((e) => l.includes(e.value)), [o, l]), O = t.useMemo(() => d ? o.filter(
46
+ (e) => e.label.toLowerCase().includes(d.toLowerCase())
47
+ ) : o, [o, d]), v = t.useMemo(() => n ? l.length >= n : !1, [l, n]);
48
+ return /* @__PURE__ */ r(T.Provider, { value: { size: c, id: u }, children: /* @__PURE__ */ a("div", { className: "space-y-1.5", children: [
49
+ h && /* @__PURE__ */ r(A, { htmlFor: u, className: k, children: h }),
50
+ /* @__PURE__ */ a(
60
51
  "div",
61
52
  {
62
- ref: h,
53
+ ref: x,
63
54
  className: "relative w-full",
64
55
  "data-slot": "app-multiple-select-dropdown",
65
56
  children: [
66
- /* @__PURE__ */ l(
57
+ /* @__PURE__ */ a(
67
58
  p,
68
59
  {
69
- id: f,
60
+ id: u,
70
61
  type: "button",
71
62
  variant: "outline",
72
63
  role: "combobox",
73
- "aria-expanded": c,
74
- disabled: k,
75
- className: N(
76
- "relative w-full justify-between border font-normal",
77
- "border-d-input ring-offset-background focus:ring-ring flex items-center rounded-md border bg-transparent whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
64
+ "aria-expanded": f,
65
+ disabled: y,
66
+ className: C(
67
+ "relative w-full justify-between border bg-transparent font-normal",
68
+ "border-d-input ring-offset-background focus:ring-ring flex items-center rounded-md border !bg-transparent whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
78
69
  "aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
79
- d === "default" && "h-9 px-3 py-2 text-sm",
80
- d === "sm" && "h-8 px-2 py-1 text-xs",
81
- d === "lg" && "h-10 px-4 py-2 text-lg",
82
- M
70
+ c === "default" && "h-9 px-3 py-2 text-sm",
71
+ c === "sm" && "h-8 px-2 py-1 text-xs",
72
+ c === "lg" && "h-10 px-4 py-2 text-lg",
73
+ L
83
74
  ),
84
- onClick: () => b(!c),
75
+ onClick: () => g(!f),
85
76
  children: [
86
- /* @__PURE__ */ r("div", { className: "flex w-full items-center gap-2 overflow-hidden", children: u.length > 0 ? /* @__PURE__ */ l(R, { children: [
87
- /* @__PURE__ */ l(
88
- D,
77
+ /* @__PURE__ */ r("div", { className: "flex w-full items-center gap-2 overflow-hidden", children: m.length > 0 ? /* @__PURE__ */ a(P, { children: [
78
+ /* @__PURE__ */ a(
79
+ B,
89
80
  {
90
81
  variant: "secondary",
91
82
  className: "flex items-center gap-1",
92
83
  children: [
93
- /* @__PURE__ */ r("span", { children: u.length }),
94
- u.length === 1 ? " elemento selezionato" : " elementi selezionati"
84
+ /* @__PURE__ */ r("span", { children: m.length }),
85
+ m.length === 1 ? " elemento selezionato" : " elementi selezionati"
95
86
  ]
96
87
  }
97
88
  ),
98
- /* @__PURE__ */ l(
89
+ /* @__PURE__ */ a(
99
90
  p,
100
91
  {
101
92
  variant: "ghost",
@@ -106,71 +97,79 @@ function ne({
106
97
  },
107
98
  children: [
108
99
  /* @__PURE__ */ r(J, { className: "h-3 w-3" }),
109
- /* @__PURE__ */ r("span", { className: "sr-only", children: E })
100
+ /* @__PURE__ */ r("span", { className: "sr-only", children: R })
110
101
  ]
111
102
  }
112
103
  )
113
- ] }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: C }) }),
104
+ ] }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground", children: N }) }),
114
105
  /* @__PURE__ */ r(K, { className: "ml-1 h-4 w-4 shrink-0 opacity-50" })
115
106
  ]
116
107
  }
117
108
  ),
118
- c && /* @__PURE__ */ r("div", { className: "absolute z-50 mt-1 w-full", children: /* @__PURE__ */ l(F, { className: "bg-d-popover w-full rounded-md shadow-md", children: [
119
- /* @__PURE__ */ l("div", { className: "flex items-center border-b px-3", children: [
120
- /* @__PURE__ */ r(
121
- H,
122
- {
123
- iconLeft: "Search",
124
- placeholder: z,
125
- value: m,
126
- onChange: (e) => v(e.target.value),
127
- className: "w-full !border-0 !border-none shadow-none !outline-none focus-visible:ring-0"
128
- }
129
- ),
130
- u.length > 0 && /* @__PURE__ */ r(
131
- p,
132
- {
133
- variant: "ghost",
134
- size: "sm",
135
- className: "h-6 px-2 text-xs",
136
- onClick: w,
137
- children: O
138
- }
139
- )
140
- ] }),
141
- /* @__PURE__ */ l(P, { className: "max-h-60 w-full overflow-auto", children: [
142
- /* @__PURE__ */ r(G, { children: L }),
143
- /* @__PURE__ */ r(X, { children: j.map((e) => {
144
- const n = t.includes(e.value);
145
- return /* @__PURE__ */ l(
146
- q,
147
- {
148
- value: e.value,
149
- disabled: e.disabled || !n && x,
150
- onSelect: () => S(e.value),
151
- className: N(
152
- "aria-selected:bg-d-accent aria-selected:text-d-accent-foreground flex cursor-pointer items-center gap-2 px-2 py-1.5",
153
- (e.disabled || !n && x) && "cursor-not-allowed opacity-50"
154
- ),
155
- children: [
156
- /* @__PURE__ */ r(
157
- I,
158
- {
159
- checked: n,
160
- className: "mr-2 flex-shrink-0",
161
- onCheckedChange: () => {
162
- }
163
- }
164
- ),
165
- /* @__PURE__ */ r("span", { className: "flex-1 truncate", children: e.label }),
166
- n && /* @__PURE__ */ r(Q, { className: "text-d-primary ml-auto h-4 w-4 flex-shrink-0" })
167
- ]
168
- },
169
- e.value
170
- );
171
- }) })
172
- ] })
173
- ] }) })
109
+ /* @__PURE__ */ r(
110
+ I,
111
+ {
112
+ open: f,
113
+ triggerRef: x,
114
+ onClose: () => g(!1),
115
+ children: /* @__PURE__ */ a(D, { className: "bg-d-popover w-full rounded-md shadow-md", children: [
116
+ /* @__PURE__ */ a("div", { className: "flex items-center border-b px-3", children: [
117
+ /* @__PURE__ */ r(
118
+ q,
119
+ {
120
+ iconLeft: "Search",
121
+ placeholder: z,
122
+ value: d,
123
+ onChange: (e) => b(e.target.value),
124
+ className: "w-full !border-0 !border-none shadow-none !outline-none focus-visible:ring-0"
125
+ }
126
+ ),
127
+ m.length > 0 && /* @__PURE__ */ r(
128
+ p,
129
+ {
130
+ variant: "ghost",
131
+ size: "sm",
132
+ className: "h-6 px-2 text-xs",
133
+ onClick: w,
134
+ children: S
135
+ }
136
+ )
137
+ ] }),
138
+ /* @__PURE__ */ a(F, { className: "max-h-60 w-full overflow-auto", children: [
139
+ /* @__PURE__ */ r(E, { children: M }),
140
+ /* @__PURE__ */ r(G, { children: O.map((e) => {
141
+ const s = l.includes(e.value);
142
+ return /* @__PURE__ */ a(
143
+ X,
144
+ {
145
+ value: e.value,
146
+ disabled: e.disabled || !s && v,
147
+ onSelect: () => j(e.value),
148
+ className: C(
149
+ "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 || !s && v) && "cursor-not-allowed opacity-50"
151
+ ),
152
+ children: [
153
+ /* @__PURE__ */ r(
154
+ H,
155
+ {
156
+ checked: s,
157
+ className: "mr-2 flex-shrink-0",
158
+ onCheckedChange: () => {
159
+ }
160
+ }
161
+ ),
162
+ /* @__PURE__ */ r("span", { className: "flex-1 truncate", children: e.label }),
163
+ s && /* @__PURE__ */ r(Q, { className: "text-d-primary ml-auto h-4 w-4 flex-shrink-0" })
164
+ ]
165
+ },
166
+ e.value
167
+ );
168
+ }) })
169
+ ] })
170
+ ] })
171
+ }
172
+ )
174
173
  ]
175
174
  }
176
175
  )
@@ -0,0 +1,66 @@
1
+ "use client";
2
+ import { jsx as m } from "react/jsx-runtime";
3
+ import * as f from "react";
4
+ import { useState as h, useEffect as o } from "react";
5
+ import { Portal as x } from "../../node_modules/@radix-ui/react-select/dist/index.js";
6
+ import { cn as E } from "../../lib/utils.js";
7
+ function C({
8
+ children: w,
9
+ open: t,
10
+ className: v,
11
+ triggerRef: r,
12
+ onClose: s
13
+ }) {
14
+ const l = f.useRef(null), [i, c] = h(null), n = f.useCallback(() => {
15
+ if (t && r.current) {
16
+ const e = r.current.getBoundingClientRect();
17
+ c({
18
+ top: e.bottom + window.scrollY,
19
+ left: e.left + window.scrollX,
20
+ width: e.width
21
+ });
22
+ } else
23
+ c(null);
24
+ }, [t, r]);
25
+ return o(() => {
26
+ n();
27
+ }, [t, n]), o(() => {
28
+ if (t)
29
+ return window.addEventListener("resize", n), () => {
30
+ window.removeEventListener("resize", n);
31
+ };
32
+ }, [t, n]), o(() => {
33
+ if (t) {
34
+ const e = setInterval(n, 100);
35
+ return () => {
36
+ clearInterval(e);
37
+ };
38
+ }
39
+ }, [t, n]), o(() => {
40
+ if (!t || !s) return;
41
+ const e = (p) => {
42
+ var a, d;
43
+ const u = p.target;
44
+ (a = r.current) != null && a.contains(u) || (d = l.current) != null && d.contains(u) || s();
45
+ };
46
+ return document.addEventListener("mousedown", e), () => {
47
+ document.removeEventListener("mousedown", e);
48
+ };
49
+ }, [t, s, r]), !t || !i ? null : /* @__PURE__ */ m(x, { children: /* @__PURE__ */ m(
50
+ "div",
51
+ {
52
+ ref: l,
53
+ className: E("fixed z-50 mt-1", v),
54
+ style: {
55
+ top: `${i.top}px`,
56
+ left: `${i.left}px`,
57
+ width: `${i.width}px`
58
+ },
59
+ onClick: (e) => e.stopPropagation(),
60
+ children: w
61
+ }
62
+ ) });
63
+ }
64
+ export {
65
+ C as CommandPortal
66
+ };
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx as o, jsxs as M, Fragment as N } from "react/jsx-runtime";
3
3
  import { useContext as R, useRef as a, useState as s, useCallback as k, useMemo as y, useEffect as u } from "react";
4
- import A from "../../../../../_virtual/index8.js";
4
+ import A from "../../../../../_virtual/index7.js";
5
5
  import B from "../../../../../_virtual/debounce.js";
6
6
  import { GanttContext as F } from "../Gantt/GanttContext.js";
7
7
  import { transformData as O } from "../../utils/transformData.js";