laif-ds 0.2.74 → 0.2.76
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/CHANGELOG.md +446 -0
- package/dist/agent-docs/adoption-report.json +615 -0
- package/dist/agent-docs/components/Accordion.md +46 -16
- package/dist/agent-docs/components/Alert.md +90 -95
- package/dist/agent-docs/components/AlertDialog.md +132 -126
- package/dist/agent-docs/components/AppEditor.md +90 -90
- package/dist/agent-docs/components/AppRadioGroup.md +18 -18
- package/dist/agent-docs/components/AppSidebar.md +129 -122
- package/dist/agent-docs/components/AppStepper.md +81 -77
- package/dist/agent-docs/components/AspectRatio.md +70 -62
- package/dist/agent-docs/components/AudioVisualizer.md +5 -5
- package/dist/agent-docs/components/Avatar.md +112 -113
- package/dist/agent-docs/components/Badge.md +123 -118
- package/dist/agent-docs/components/Breadcrumb.md +8 -1
- package/dist/agent-docs/components/Button.md +131 -129
- package/dist/agent-docs/components/Card.md +172 -147
- package/dist/agent-docs/components/Carousel.md +148 -129
- package/dist/agent-docs/components/Chat.md +121 -109
- package/dist/agent-docs/components/ChatMessage.md +72 -61
- package/dist/agent-docs/components/Checkbox.md +150 -135
- package/dist/agent-docs/components/CircularProgress.md +53 -49
- package/dist/agent-docs/components/CodeHighlighter.md +4 -4
- package/dist/agent-docs/components/Collapsible.md +114 -95
- package/dist/agent-docs/components/Command.md +141 -142
- package/dist/agent-docs/components/Confirmer.md +182 -175
- package/dist/agent-docs/components/ContextMenu.md +196 -191
- package/dist/agent-docs/components/DataCrossTable.md +114 -94
- package/dist/agent-docs/components/DataTable.md +32 -24
- package/dist/agent-docs/components/Dialog.md +130 -125
- package/dist/agent-docs/components/Drawer.md +141 -127
- package/dist/agent-docs/components/FilePreviewer.md +138 -139
- package/dist/agent-docs/components/FileUploader.md +149 -129
- package/dist/agent-docs/components/Form.md +3 -1
- package/dist/agent-docs/components/FormComposer.md +163 -137
- package/dist/agent-docs/components/GanttChart.md +125 -122
- package/dist/agent-docs/components/HoverCard.md +1 -1
- package/dist/agent-docs/components/Icon.md +98 -99
- package/dist/agent-docs/components/Input.md +173 -138
- package/dist/agent-docs/components/InputOtp.md +6 -1
- package/dist/agent-docs/components/InputSelector.md +94 -97
- package/dist/agent-docs/components/InterruptPrompt.md +4 -4
- package/dist/agent-docs/components/MarkdownRenderer.md +5 -2
- package/dist/agent-docs/components/Menubar.md +60 -57
- package/dist/agent-docs/components/MessageInput.md +134 -131
- package/dist/agent-docs/components/MessageList.md +110 -96
- package/dist/agent-docs/components/MultipleSelector.md +147 -146
- package/dist/agent-docs/components/NavigationMenu.md +6 -2
- package/dist/agent-docs/components/Popover.md +112 -103
- package/dist/agent-docs/components/PromptSuggestions.md +5 -5
- package/dist/agent-docs/components/RadioGroup.md +97 -90
- package/dist/agent-docs/components/Resizable.md +4 -1
- package/dist/agent-docs/components/ResizePrompt.md +12 -13
- package/dist/agent-docs/components/ScrollArea.md +6 -2
- package/dist/agent-docs/components/SecurePdfViewer.md +10 -6
- package/dist/agent-docs/components/Select.md +131 -132
- package/dist/agent-docs/components/Sheet.md +8 -1
- package/dist/agent-docs/components/ShikiHighlighter.md +5 -5
- package/dist/agent-docs/components/Sidebar.md +94 -85
- package/dist/agent-docs/components/Slider.md +62 -58
- package/dist/agent-docs/components/Sonner.md +1 -0
- package/dist/agent-docs/components/Spinner.md +14 -14
- package/dist/agent-docs/components/Stepper.md +93 -67
- package/dist/agent-docs/components/Switch.md +41 -42
- package/dist/agent-docs/components/TableSkeleton.md +8 -8
- package/dist/agent-docs/components/Tabs.md +106 -86
- package/dist/agent-docs/components/TextArea.md +51 -52
- package/dist/agent-docs/components/ThemeSwitcher.md +72 -69
- package/dist/agent-docs/components/Toaster.md +1 -0
- package/dist/agent-docs/components/Tooltip.md +102 -91
- package/dist/agent-docs/components/Typo.md +68 -65
- package/dist/agent-docs/components/WeeklyCalendar.md +63 -64
- package/dist/agent-docs/components-list.md +1 -0
- package/dist/agent-docs/manifest.json +5981 -0
- package/dist/agent-docs/truncated-cell.md +342 -0
- package/dist/components/editor/editor-hooks/use-update-toolbar.js +6 -6
- package/dist/components/editor/plugins/actions/counter-character-plugin.js +6 -6
- package/dist/components/editor/plugins/toolbar/font-format-toolbar-plugin.js +18 -18
- package/dist/components/editor/plugins/toolbar/history-toolbar-plugin.js +10 -10
- package/dist/components/editor/plugins/toolbar/toolbar-plugin.js +9 -9
- package/dist/components/ui/app-checkbox.js +1 -1
- package/dist/components/ui/app-dialog.js +70 -64
- package/dist/components/ui/app-editor.js +51 -51
- package/dist/components/ui/app-form.js +81 -81
- package/dist/components/ui/app-multiple-select-dropdown.js +36 -36
- package/dist/components/ui/app-select.js +109 -104
- package/dist/components/ui/app-sidebar.js +41 -41
- package/dist/components/ui/app-stepper.js +1 -1
- package/dist/components/ui/app-time-picker.js +18 -18
- package/dist/components/ui/app-tooltip.js +1 -1
- package/dist/components/ui/async-select.js +5 -5
- package/dist/components/ui/audio-visualizer.js +61 -58
- package/dist/components/ui/card.js +1 -1
- package/dist/components/ui/carousel.js +2 -2
- package/dist/components/ui/chart.js +1 -1
- package/dist/components/ui/chat-message.js +8 -8
- package/dist/components/ui/chat.js +86 -88
- package/dist/components/ui/command.js +2 -2
- package/dist/components/ui/copy-button.js +4 -4
- package/dist/components/ui/date-picker.js +20 -20
- package/dist/components/ui/file-preview/index.js +13 -13
- package/dist/components/ui/file-previewer.js +12 -11
- package/dist/components/ui/file-uploader.js +86 -78
- package/dist/components/ui/form.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Bars/Bars.js +56 -56
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarItem/BarItem.js +12 -12
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsItems/BarItems.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/BarsRow.js +4 -4
- package/dist/components/ui/gantt/components/Chart/Bars/BarsRow/RepeteadBars/RepeteadBars.js +2 -2
- package/dist/components/ui/gantt/components/Chart/Chart.js +23 -23
- package/dist/components/ui/gantt/components/Chart/Scale/Scale.js +1 -1
- package/dist/components/ui/gantt/components/Chart/Tree/Tree.js +34 -34
- package/dist/components/ui/gantt/components/Controls/Controls.js +5 -5
- package/dist/components/ui/gantt/components/Gantt/Gantt.js +4 -4
- package/dist/components/ui/gantt/hooks/useGanttCalculate.js +25 -18
- package/dist/components/ui/input-selector.js +1 -1
- package/dist/components/ui/input.js +23 -23
- package/dist/components/ui/kanban.js +8 -9
- package/dist/components/ui/markdown-renderer.js +41 -35
- package/dist/components/ui/message-input.js +45 -44
- package/dist/components/ui/multiple-selector.js +91 -82
- package/dist/components/ui/secure-pdf-viewer.js +19 -7
- package/dist/components/ui/sidebar.js +1 -1
- package/dist/components/ui/slider.js +1 -1
- package/dist/components/ui/spinner.js +4 -4
- package/dist/components/ui/stepper.js +157 -138
- package/dist/components/ui/tables/data-cross-table/data-cross-table-buttons.js +29 -29
- package/dist/components/ui/tables/data-cross-table/data-cross-table.js +258 -246
- package/dist/components/ui/tables/data-table/components/data-table-advanced-filter.js +4 -1
- package/dist/components/ui/tables/data-table/components/data-table-body.js +211 -367
- package/dist/components/ui/tables/data-table/components/data-table-filter-inputs.js +114 -112
- package/dist/components/ui/tables/data-table/components/data-table-filters.js +116 -96
- package/dist/components/ui/tables/data-table/components/data-table-header.js +211 -0
- package/dist/components/ui/tables/data-table/components/data-table-searchbar.js +8 -8
- package/dist/components/ui/tables/data-table/components/data-table-skeleton-rows.js +33 -0
- package/dist/components/ui/tables/data-table/data-table.js +258 -250
- package/dist/components/ui/tables/data-table/data-table.service.js +112 -97
- package/dist/components/ui/tables/data-table/data-table.utils.js +25 -15
- package/dist/components/ui/textarea.js +2 -2
- package/dist/components/ui/theme-switcher.js +1 -1
- package/dist/components/ui/toggle-group.js +2 -2
- package/dist/components/ui/truncated-cell.js +100 -0
- package/dist/components/ui/weekly-calendar/appointment-card.js +16 -16
- package/dist/components/ui/weekly-calendar/calendar-context.js +6 -6
- package/dist/components/ui/weekly-calendar/calendar-header.js +12 -12
- package/dist/components/ui/weekly-calendar/day-column.js +16 -16
- package/dist/components/ui/weekly-calendar/time-column.js +4 -4
- package/dist/components/ui/weekly-calendar/weekly-calendar.js +4 -4
- package/dist/hooks/use-audio-recording.js +1 -1
- package/dist/hooks/use-auto-scroll.js +18 -18
- package/dist/hooks/use-autosize-textarea.js +12 -13
- package/dist/index.d.ts +100 -45
- package/dist/index.js +362 -360
- package/dist/lib/utils.js +6 -6
- package/dist/styles.v3.css +1 -1
- package/package.json +14 -4
|
@@ -1,55 +1,55 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { AppSelect as
|
|
6
|
-
import { AsyncSelect as
|
|
7
|
-
import { Button as
|
|
8
|
-
import { Checkbox as
|
|
9
|
-
import { DatePicker as
|
|
10
|
-
import { Input as
|
|
3
|
+
import { Controller as O } from "../../node_modules/react-hook-form/dist/index.esm.js";
|
|
4
|
+
import { cn as s } from "../../lib/utils.js";
|
|
5
|
+
import { AppSelect as v } from "./app-select.js";
|
|
6
|
+
import { AsyncSelect as I } from "./async-select.js";
|
|
7
|
+
import { Button as A } from "./button.js";
|
|
8
|
+
import { Checkbox as F } from "./checkbox.js";
|
|
9
|
+
import { DatePicker as b } from "./date-picker.js";
|
|
10
|
+
import { Input as j } from "./input.js";
|
|
11
11
|
import { Label as t } from "./label.js";
|
|
12
|
-
import { RadioGroup as
|
|
13
|
-
import { Slider as
|
|
14
|
-
import { Switch as
|
|
15
|
-
import { Textarea as
|
|
12
|
+
import { RadioGroup as R, RadioGroupItem as M } from "./radio-group.js";
|
|
13
|
+
import { Slider as B } from "./slider.js";
|
|
14
|
+
import { Switch as T } from "./switch.js";
|
|
15
|
+
import { Textarea as $ } from "./textarea.js";
|
|
16
16
|
import { Typo as i } from "./typo.js";
|
|
17
|
-
const
|
|
18
|
-
items:
|
|
19
|
-
cols:
|
|
20
|
-
form:
|
|
17
|
+
const Z = ({
|
|
18
|
+
items: u,
|
|
19
|
+
cols: g = "2",
|
|
20
|
+
form: m,
|
|
21
21
|
submitText: x = "Invia",
|
|
22
22
|
onSubmit: C,
|
|
23
|
-
isSubmitting:
|
|
23
|
+
isSubmitting: p = !1,
|
|
24
24
|
showSubmitButton: N = !1
|
|
25
25
|
}) => {
|
|
26
26
|
const {
|
|
27
27
|
control: y,
|
|
28
28
|
handleSubmit: f,
|
|
29
|
-
formState: { errors:
|
|
30
|
-
} =
|
|
31
|
-
const c =
|
|
29
|
+
formState: { errors: V, isValid: S, isDirty: k }
|
|
30
|
+
} = m, w = (e) => {
|
|
31
|
+
const c = V[e.name]?.message, o = c ? String(c) : void 0;
|
|
32
32
|
return /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
33
|
-
|
|
33
|
+
O,
|
|
34
34
|
{
|
|
35
35
|
name: e.name,
|
|
36
36
|
control: y,
|
|
37
37
|
render: ({ field: r }) => {
|
|
38
|
-
const
|
|
38
|
+
const d = /* @__PURE__ */ l("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
39
39
|
/* @__PURE__ */ a(t, { children: e.label }),
|
|
40
|
-
|
|
40
|
+
o && /* @__PURE__ */ a("span", { className: "text-d-destructive text-xs", children: o })
|
|
41
41
|
] });
|
|
42
42
|
switch (e.component) {
|
|
43
43
|
case "input":
|
|
44
44
|
return /* @__PURE__ */ l("div", { children: [
|
|
45
|
-
|
|
45
|
+
d,
|
|
46
46
|
/* @__PURE__ */ a(
|
|
47
|
-
|
|
47
|
+
j,
|
|
48
48
|
{
|
|
49
49
|
...r,
|
|
50
50
|
type: e.inputType,
|
|
51
51
|
placeholder: e.placeholder,
|
|
52
|
-
className:
|
|
52
|
+
className: s(o && "border-d-destructive"),
|
|
53
53
|
disabled: e.disabled
|
|
54
54
|
}
|
|
55
55
|
)
|
|
@@ -58,14 +58,14 @@ const ne = ({
|
|
|
58
58
|
case "async-multiple": {
|
|
59
59
|
if (!e.fetcher || !e.renderOptionItem || !e.resolveOptionValue || !e.renderSelectedValue)
|
|
60
60
|
return /* @__PURE__ */ l("div", { children: [
|
|
61
|
-
|
|
61
|
+
d,
|
|
62
62
|
/* @__PURE__ */ a(i, { variant: "caption", className: "text-d-destructive", children: "Async select non configurato correttamente." })
|
|
63
63
|
] });
|
|
64
64
|
const n = e.component === "async-multiple";
|
|
65
65
|
return /* @__PURE__ */ l("div", { children: [
|
|
66
|
-
|
|
66
|
+
d,
|
|
67
67
|
/* @__PURE__ */ a(
|
|
68
|
-
|
|
68
|
+
I,
|
|
69
69
|
{
|
|
70
70
|
multiple: n,
|
|
71
71
|
fetcher: e.fetcher,
|
|
@@ -87,38 +87,38 @@ const ne = ({
|
|
|
87
87
|
}
|
|
88
88
|
case "textarea":
|
|
89
89
|
return /* @__PURE__ */ l("div", { children: [
|
|
90
|
-
|
|
90
|
+
d,
|
|
91
91
|
/* @__PURE__ */ a(
|
|
92
|
-
|
|
92
|
+
$,
|
|
93
93
|
{
|
|
94
94
|
...r,
|
|
95
95
|
placeholder: e.placeholder,
|
|
96
|
-
className:
|
|
96
|
+
className: s(o && "border-d-destructive"),
|
|
97
97
|
disabled: e.disabled
|
|
98
98
|
}
|
|
99
99
|
)
|
|
100
100
|
] });
|
|
101
101
|
case "radio":
|
|
102
102
|
return /* @__PURE__ */ l("div", { children: [
|
|
103
|
-
|
|
103
|
+
d,
|
|
104
104
|
/* @__PURE__ */ a(
|
|
105
|
-
|
|
105
|
+
R,
|
|
106
106
|
{
|
|
107
107
|
value: r.value != null ? String(r.value) : "",
|
|
108
108
|
onValueChange: (n) => r.onChange(n),
|
|
109
109
|
className: "space-y-2",
|
|
110
110
|
disabled: e.disabled,
|
|
111
111
|
children: (e.options ?? []).map((n) => {
|
|
112
|
-
const
|
|
112
|
+
const h = `${e.name}-${n.value}`;
|
|
113
113
|
return /* @__PURE__ */ l(
|
|
114
114
|
"div",
|
|
115
115
|
{
|
|
116
116
|
className: "flex items-center gap-2",
|
|
117
117
|
children: [
|
|
118
118
|
/* @__PURE__ */ a(
|
|
119
|
-
|
|
119
|
+
M,
|
|
120
120
|
{
|
|
121
|
-
id:
|
|
121
|
+
id: h,
|
|
122
122
|
value: String(n.value),
|
|
123
123
|
disabled: e.disabled
|
|
124
124
|
}
|
|
@@ -126,8 +126,8 @@ const ne = ({
|
|
|
126
126
|
/* @__PURE__ */ a(
|
|
127
127
|
t,
|
|
128
128
|
{
|
|
129
|
-
htmlFor:
|
|
130
|
-
className:
|
|
129
|
+
htmlFor: h,
|
|
130
|
+
className: s(
|
|
131
131
|
"cursor-pointer",
|
|
132
132
|
e.disabled && "cursor-not-allowed opacity-60"
|
|
133
133
|
),
|
|
@@ -144,9 +144,9 @@ const ne = ({
|
|
|
144
144
|
] });
|
|
145
145
|
case "select":
|
|
146
146
|
return /* @__PURE__ */ l("div", { children: [
|
|
147
|
-
|
|
147
|
+
d,
|
|
148
148
|
/* @__PURE__ */ a(
|
|
149
|
-
|
|
149
|
+
v,
|
|
150
150
|
{
|
|
151
151
|
...r,
|
|
152
152
|
onValueChange: (n) => r.onChange(n),
|
|
@@ -158,9 +158,9 @@ const ne = ({
|
|
|
158
158
|
] });
|
|
159
159
|
case "multiselect":
|
|
160
160
|
return /* @__PURE__ */ l("div", { children: [
|
|
161
|
-
|
|
161
|
+
d,
|
|
162
162
|
/* @__PURE__ */ a(
|
|
163
|
-
|
|
163
|
+
v,
|
|
164
164
|
{
|
|
165
165
|
...r,
|
|
166
166
|
multiple: !0,
|
|
@@ -171,38 +171,38 @@ const ne = ({
|
|
|
171
171
|
}
|
|
172
172
|
)
|
|
173
173
|
] });
|
|
174
|
-
case "datepicker":
|
|
175
|
-
const {
|
|
176
|
-
mode: n,
|
|
177
|
-
value: p,
|
|
178
|
-
onChange: L,
|
|
179
|
-
customCalendarProps: E,
|
|
180
|
-
...O
|
|
181
|
-
} = e.datePickerProps || {}, P = {
|
|
182
|
-
value: r.value,
|
|
183
|
-
onChange: e.disabled || e.calendarRange ? void 0 : (u) => r.onChange(u),
|
|
184
|
-
placeholder: e.placeholder,
|
|
185
|
-
disabled: e.disabled,
|
|
186
|
-
customCalendarProps: e.disabled ? {
|
|
187
|
-
disabled: !0,
|
|
188
|
-
mode: "single"
|
|
189
|
-
} : e.calendarRange ? {
|
|
190
|
-
mode: "range",
|
|
191
|
-
selected: r.value,
|
|
192
|
-
onSelect: (u) => r.onChange(u)
|
|
193
|
-
} : void 0,
|
|
194
|
-
...O
|
|
195
|
-
};
|
|
174
|
+
case "datepicker":
|
|
196
175
|
return /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
197
|
-
|
|
198
|
-
/* @__PURE__ */ a(
|
|
176
|
+
d,
|
|
177
|
+
e.calendarRange ? /* @__PURE__ */ a(
|
|
178
|
+
b,
|
|
179
|
+
{
|
|
180
|
+
mode: "range",
|
|
181
|
+
value: r.value,
|
|
182
|
+
onChange: e.disabled ? void 0 : (n) => r.onChange(n),
|
|
183
|
+
placeholder: e.placeholder,
|
|
184
|
+
disabled: e.disabled
|
|
185
|
+
}
|
|
186
|
+
) : /* @__PURE__ */ a(
|
|
187
|
+
b,
|
|
188
|
+
{
|
|
189
|
+
mode: "single",
|
|
190
|
+
value: r.value,
|
|
191
|
+
onChange: e.disabled ? void 0 : (n) => r.onChange(n),
|
|
192
|
+
placeholder: e.placeholder,
|
|
193
|
+
disabled: e.disabled,
|
|
194
|
+
customCalendarProps: e.disabled ? {
|
|
195
|
+
disabled: !0,
|
|
196
|
+
mode: "single"
|
|
197
|
+
} : void 0
|
|
198
|
+
}
|
|
199
|
+
)
|
|
199
200
|
] });
|
|
200
|
-
}
|
|
201
201
|
case "checkbox":
|
|
202
202
|
return /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
|
|
203
203
|
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
204
204
|
/* @__PURE__ */ a(
|
|
205
|
-
|
|
205
|
+
F,
|
|
206
206
|
{
|
|
207
207
|
...r,
|
|
208
208
|
id: e.name,
|
|
@@ -215,14 +215,14 @@ const ne = ({
|
|
|
215
215
|
t,
|
|
216
216
|
{
|
|
217
217
|
htmlFor: e.name,
|
|
218
|
-
className:
|
|
218
|
+
className: s(
|
|
219
219
|
"cursor-pointer",
|
|
220
220
|
e.disabled && "cursor-not-allowed opacity-60"
|
|
221
221
|
),
|
|
222
222
|
children: e.label
|
|
223
223
|
}
|
|
224
224
|
),
|
|
225
|
-
|
|
225
|
+
o && /* @__PURE__ */ a("span", { className: "text-d-destructive text-xs", children: o })
|
|
226
226
|
] }),
|
|
227
227
|
e.caption && /* @__PURE__ */ a(
|
|
228
228
|
i,
|
|
@@ -248,7 +248,7 @@ const ne = ({
|
|
|
248
248
|
)
|
|
249
249
|
] }),
|
|
250
250
|
/* @__PURE__ */ a(
|
|
251
|
-
|
|
251
|
+
T,
|
|
252
252
|
{
|
|
253
253
|
id: e.name,
|
|
254
254
|
checked: !!r.value,
|
|
@@ -257,13 +257,13 @@ const ne = ({
|
|
|
257
257
|
}
|
|
258
258
|
)
|
|
259
259
|
] }),
|
|
260
|
-
|
|
260
|
+
o && /* @__PURE__ */ a("span", { className: "text-d-destructive text-xs", children: o })
|
|
261
261
|
] });
|
|
262
262
|
case "slider":
|
|
263
263
|
return /* @__PURE__ */ l("div", { children: [
|
|
264
|
-
|
|
264
|
+
d,
|
|
265
265
|
/* @__PURE__ */ a(
|
|
266
|
-
|
|
266
|
+
B,
|
|
267
267
|
{
|
|
268
268
|
value: Array.isArray(r.value) ? r.value : [r.value || e.min || 0],
|
|
269
269
|
onValueChange: (n) => r.onChange(n[0]),
|
|
@@ -289,25 +289,25 @@ const ne = ({
|
|
|
289
289
|
) });
|
|
290
290
|
};
|
|
291
291
|
return /* @__PURE__ */ l("form", { onSubmit: f((e) => C?.(e)), children: [
|
|
292
|
-
/* @__PURE__ */ a("div", { className:
|
|
292
|
+
/* @__PURE__ */ a("div", { className: s("grid gap-4", `grid-cols-${g}`), children: u.map((e, c) => /* @__PURE__ */ a(
|
|
293
293
|
"div",
|
|
294
294
|
{
|
|
295
|
-
className:
|
|
295
|
+
className: s(c === u.length - 1 && "col-span-full"),
|
|
296
296
|
children: w(e)
|
|
297
297
|
},
|
|
298
298
|
e.name
|
|
299
299
|
)) }),
|
|
300
300
|
N && /* @__PURE__ */ a("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ a(
|
|
301
|
-
|
|
301
|
+
A,
|
|
302
302
|
{
|
|
303
303
|
type: "submit",
|
|
304
|
-
disabled: !
|
|
305
|
-
isLoading:
|
|
304
|
+
disabled: !S || !k || p,
|
|
305
|
+
isLoading: p,
|
|
306
306
|
children: x
|
|
307
307
|
}
|
|
308
308
|
) })
|
|
309
309
|
] });
|
|
310
310
|
};
|
|
311
311
|
export {
|
|
312
|
-
|
|
312
|
+
Z as AppForm
|
|
313
313
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as r, jsxs as l, Fragment as A } from "react/jsx-runtime";
|
|
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";
|
|
6
|
-
import { cn as u } from "../../lib/utils.js";
|
|
7
3
|
import * as t from "react";
|
|
8
|
-
import { useEffect as
|
|
4
|
+
import { useEffect as B } from "react";
|
|
5
|
+
import { Badge as E } from "./badge.js";
|
|
6
|
+
import { Command as F, CommandList as V, CommandEmpty as G, CommandGroup as X, CommandItem as $ } from "./command.js";
|
|
7
|
+
import { Label as q } from "./label.js";
|
|
8
|
+
import { cn as u } from "../../lib/utils.js";
|
|
9
9
|
import { selectTriggerVariants as H } from "./async-select.js";
|
|
10
10
|
import { Checkbox as I } from "./checkbox.js";
|
|
11
11
|
import { Icon as x } from "./icon.js";
|
|
@@ -16,11 +16,11 @@ const Z = t.createContext({ size: "default" });
|
|
|
16
16
|
function ue({
|
|
17
17
|
options: a,
|
|
18
18
|
value: n,
|
|
19
|
-
onChange:
|
|
20
|
-
onClear:
|
|
19
|
+
onChange: s,
|
|
20
|
+
onClear: m,
|
|
21
21
|
placeholder: C = "Seleziona...",
|
|
22
22
|
disabled: y = !1,
|
|
23
|
-
size:
|
|
23
|
+
size: f = "default",
|
|
24
24
|
label: b,
|
|
25
25
|
labelClassName: k,
|
|
26
26
|
emptyMessage: M = "Nessun risultato trovato",
|
|
@@ -30,66 +30,66 @@ function ue({
|
|
|
30
30
|
cancelLabel: j = "Cancella selezione",
|
|
31
31
|
maxSelectedItems: i
|
|
32
32
|
}) {
|
|
33
|
-
const
|
|
33
|
+
const p = t.useId(), [o, D] = t.useState(!1), [c, v] = t.useState(""), [O, S] = t.useState(
|
|
34
34
|
void 0
|
|
35
|
-
), L = t.useRef(null),
|
|
35
|
+
), L = t.useRef(null), h = t.useRef(null), w = t.useCallback(
|
|
36
36
|
(e) => {
|
|
37
37
|
if (n.includes(e))
|
|
38
|
-
|
|
38
|
+
s(n.filter((d) => d !== e));
|
|
39
39
|
else {
|
|
40
40
|
if (i && n.length >= i)
|
|
41
41
|
return;
|
|
42
|
-
|
|
42
|
+
s([...n, e]);
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
|
-
[n,
|
|
45
|
+
[n, s, i]
|
|
46
46
|
), T = t.useCallback(() => {
|
|
47
|
-
|
|
48
|
-
}, [
|
|
47
|
+
s([]), v(""), m && m();
|
|
48
|
+
}, [s, m]), g = t.useMemo(() => a.filter((e) => n.includes(e.value)), [a, n]), W = t.useMemo(() => c ? a.filter(
|
|
49
49
|
(e) => e.label.toLowerCase().includes(c.toLowerCase())
|
|
50
50
|
) : a, [a, c]), N = t.useMemo(() => i ? n.length >= i : !1, [n, i]);
|
|
51
|
-
return
|
|
52
|
-
if (
|
|
53
|
-
const e =
|
|
51
|
+
return B(() => {
|
|
52
|
+
if (o && h.current) {
|
|
53
|
+
const e = h.current.getBoundingClientRect();
|
|
54
54
|
S(e.width);
|
|
55
55
|
}
|
|
56
|
-
}, [
|
|
57
|
-
b && /* @__PURE__ */ r(
|
|
56
|
+
}, [o]), /* @__PURE__ */ r(Z.Provider, { value: { size: f, id: p }, children: /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
|
|
57
|
+
b && /* @__PURE__ */ r(q, { htmlFor: p, 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(K, { open:
|
|
64
|
+
children: /* @__PURE__ */ l(K, { open: o, onOpenChange: D, children: [
|
|
65
65
|
/* @__PURE__ */ r(Q, { asChild: !0, children: /* @__PURE__ */ l(
|
|
66
66
|
"button",
|
|
67
67
|
{
|
|
68
|
-
id:
|
|
68
|
+
id: p,
|
|
69
69
|
type: "button",
|
|
70
70
|
role: "combobox",
|
|
71
|
-
"aria-expanded":
|
|
71
|
+
"aria-expanded": o,
|
|
72
72
|
disabled: y,
|
|
73
|
-
ref:
|
|
73
|
+
ref: h,
|
|
74
74
|
className: u(
|
|
75
|
-
H({ size:
|
|
75
|
+
H({ size: f }),
|
|
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
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
|
+
o && "ring-d-ring ring-1",
|
|
81
81
|
z
|
|
82
82
|
),
|
|
83
83
|
children: [
|
|
84
|
-
/* @__PURE__ */ r("div", { className: "flex w-full items-center justify-between gap-2 overflow-hidden", children:
|
|
84
|
+
/* @__PURE__ */ r("div", { className: "flex w-full items-center justify-between gap-2 overflow-hidden", children: g.length > 0 ? /* @__PURE__ */ l(A, { children: [
|
|
85
85
|
/* @__PURE__ */ l(
|
|
86
|
-
|
|
86
|
+
E,
|
|
87
87
|
{
|
|
88
88
|
variant: "secondary",
|
|
89
89
|
className: "!bg-d-accent flex items-center gap-1",
|
|
90
90
|
children: [
|
|
91
|
-
/* @__PURE__ */ r("span", { children:
|
|
92
|
-
|
|
91
|
+
/* @__PURE__ */ r("span", { children: g.length }),
|
|
92
|
+
g.length === 1 ? " elemento selezionato" : " elementi selezionati"
|
|
93
93
|
]
|
|
94
94
|
}
|
|
95
95
|
),
|
|
@@ -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(F, { 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
|
x,
|
|
@@ -144,16 +144,16 @@ function ue({
|
|
|
144
144
|
placeholder: P,
|
|
145
145
|
value: c,
|
|
146
146
|
onChange: (e) => v(e.target.value),
|
|
147
|
-
className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${J({ size:
|
|
147
|
+
className: `focus-visible:ring-none border-none focus-visible:border-none disabled:opacity-50 ${J({ size: f })} !shadow-none`
|
|
148
148
|
}
|
|
149
149
|
)
|
|
150
150
|
] }) }),
|
|
151
|
-
/* @__PURE__ */ l(
|
|
152
|
-
/* @__PURE__ */ r(
|
|
153
|
-
/* @__PURE__ */ r(
|
|
151
|
+
/* @__PURE__ */ l(V, { className: "max-h-60 w-full", children: [
|
|
152
|
+
/* @__PURE__ */ r(G, { children: M }),
|
|
153
|
+
/* @__PURE__ */ r(X, { children: W.map((e) => {
|
|
154
154
|
const d = n.includes(e.value);
|
|
155
155
|
return /* @__PURE__ */ l(
|
|
156
|
-
|
|
156
|
+
$,
|
|
157
157
|
{
|
|
158
158
|
value: e.value,
|
|
159
159
|
disabled: e.disabled || !d && N,
|