@algodomain/smart-forms 0.1.3 → 0.1.4
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/{SmartTags-DPqw9PG1.d.cts → SmartTags-DEpmTDF5.d.cts} +30 -17
- package/dist/{SmartTags-DPqw9PG1.d.ts → SmartTags-DEpmTDF5.d.ts} +30 -17
- package/dist/{chunk-CT6GW6PK.js → chunk-BNQNL7GF.js} +625 -145
- package/dist/chunk-BNQNL7GF.js.map +1 -0
- package/dist/{chunk-3L7TKJIB.js → chunk-RHECLW3K.js} +68 -4
- package/dist/chunk-RHECLW3K.js.map +1 -0
- package/dist/{chunk-TJ6EFR2O.cjs → chunk-VGP3HY5Y.cjs} +729 -239
- package/dist/chunk-VGP3HY5Y.cjs.map +1 -0
- package/dist/{chunk-MBC5TYXA.cjs → chunk-WIBCOQPP.cjs} +68 -4
- package/dist/chunk-WIBCOQPP.cjs.map +1 -0
- package/dist/fields.cjs +162 -479
- package/dist/fields.cjs.map +1 -1
- package/dist/fields.d.cts +3 -23
- package/dist/fields.d.ts +3 -23
- package/dist/fields.js +9 -329
- package/dist/fields.js.map +1 -1
- package/dist/index.cjs +34 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/opinionated.cjs +18 -18
- package/dist/opinionated.js +2 -2
- package/package.json +4 -2
- package/dist/chunk-3L7TKJIB.js.map +0 -1
- package/dist/chunk-CT6GW6PK.js.map +0 -1
- package/dist/chunk-MBC5TYXA.cjs.map +0 -1
- package/dist/chunk-TJ6EFR2O.cjs.map +0 -1
package/dist/fields.cjs
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkVGP3HY5Y_cjs = require('./chunk-VGP3HY5Y.cjs');
|
|
4
|
+
var chunkWIBCOQPP_cjs = require('./chunk-WIBCOQPP.cjs');
|
|
5
|
+
var React2 = require('react');
|
|
6
6
|
var lucideReact = require('lucide-react');
|
|
7
|
-
var cmdk = require('cmdk');
|
|
8
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
|
-
var reactSlot = require('@radix-ui/react-slot');
|
|
10
|
-
var classVarianceAuthority = require('class-variance-authority');
|
|
11
8
|
var SliderPrimitive = require('@radix-ui/react-slider');
|
|
12
9
|
|
|
13
10
|
function _interopNamespace(e) {
|
|
@@ -28,326 +25,9 @@ function _interopNamespace(e) {
|
|
|
28
25
|
return Object.freeze(n);
|
|
29
26
|
}
|
|
30
27
|
|
|
31
|
-
var
|
|
28
|
+
var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
|
|
32
29
|
var SliderPrimitive__namespace = /*#__PURE__*/_interopNamespace(SliderPrimitive);
|
|
33
30
|
|
|
34
|
-
function Command({
|
|
35
|
-
className,
|
|
36
|
-
...props
|
|
37
|
-
}) {
|
|
38
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39
|
-
cmdk.Command,
|
|
40
|
-
{
|
|
41
|
-
"data-slot": "command",
|
|
42
|
-
className: chunkMBC5TYXA_cjs.cn(
|
|
43
|
-
"bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
|
|
44
|
-
className
|
|
45
|
-
),
|
|
46
|
-
...props
|
|
47
|
-
}
|
|
48
|
-
);
|
|
49
|
-
}
|
|
50
|
-
function CommandInput({
|
|
51
|
-
className,
|
|
52
|
-
...props
|
|
53
|
-
}) {
|
|
54
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
55
|
-
"div",
|
|
56
|
-
{
|
|
57
|
-
"data-slot": "command-input-wrapper",
|
|
58
|
-
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
59
|
-
children: [
|
|
60
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.SearchIcon, { className: "size-4 shrink-0 opacity-50" }),
|
|
61
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
-
cmdk.Command.Input,
|
|
63
|
-
{
|
|
64
|
-
"data-slot": "command-input",
|
|
65
|
-
className: chunkMBC5TYXA_cjs.cn(
|
|
66
|
-
"placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
67
|
-
className
|
|
68
|
-
),
|
|
69
|
-
...props
|
|
70
|
-
}
|
|
71
|
-
)
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
function CommandList({
|
|
77
|
-
className,
|
|
78
|
-
...props
|
|
79
|
-
}) {
|
|
80
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
81
|
-
cmdk.Command.List,
|
|
82
|
-
{
|
|
83
|
-
"data-slot": "command-list",
|
|
84
|
-
className: chunkMBC5TYXA_cjs.cn(
|
|
85
|
-
"max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
|
|
86
|
-
className
|
|
87
|
-
),
|
|
88
|
-
...props
|
|
89
|
-
}
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
function CommandEmpty({
|
|
93
|
-
...props
|
|
94
|
-
}) {
|
|
95
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
-
cmdk.Command.Empty,
|
|
97
|
-
{
|
|
98
|
-
"data-slot": "command-empty",
|
|
99
|
-
className: "py-6 text-center text-sm",
|
|
100
|
-
...props
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
}
|
|
104
|
-
function CommandGroup({
|
|
105
|
-
className,
|
|
106
|
-
...props
|
|
107
|
-
}) {
|
|
108
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
109
|
-
cmdk.Command.Group,
|
|
110
|
-
{
|
|
111
|
-
"data-slot": "command-group",
|
|
112
|
-
className: chunkMBC5TYXA_cjs.cn(
|
|
113
|
-
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
|
|
114
|
-
className
|
|
115
|
-
),
|
|
116
|
-
...props
|
|
117
|
-
}
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
function CommandItem({
|
|
121
|
-
className,
|
|
122
|
-
...props
|
|
123
|
-
}) {
|
|
124
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
125
|
-
cmdk.Command.Item,
|
|
126
|
-
{
|
|
127
|
-
"data-slot": "command-item",
|
|
128
|
-
className: chunkMBC5TYXA_cjs.cn(
|
|
129
|
-
"data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
130
|
-
className
|
|
131
|
-
),
|
|
132
|
-
...props
|
|
133
|
-
}
|
|
134
|
-
);
|
|
135
|
-
}
|
|
136
|
-
var badgeVariants = classVarianceAuthority.cva(
|
|
137
|
-
"inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",
|
|
138
|
-
{
|
|
139
|
-
variants: {
|
|
140
|
-
variant: {
|
|
141
|
-
default: "border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
|
|
142
|
-
secondary: "border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
|
|
143
|
-
destructive: "border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",
|
|
144
|
-
outline: "text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
|
-
defaultVariants: {
|
|
148
|
-
variant: "default"
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
);
|
|
152
|
-
function Badge({
|
|
153
|
-
className,
|
|
154
|
-
variant,
|
|
155
|
-
asChild = false,
|
|
156
|
-
...props
|
|
157
|
-
}) {
|
|
158
|
-
const Comp = asChild ? reactSlot.Slot : "span";
|
|
159
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
160
|
-
Comp,
|
|
161
|
-
{
|
|
162
|
-
"data-slot": "badge",
|
|
163
|
-
className: chunkMBC5TYXA_cjs.cn(badgeVariants({ variant }), className),
|
|
164
|
-
...props
|
|
165
|
-
}
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
function Combobox({
|
|
169
|
-
options,
|
|
170
|
-
value = "",
|
|
171
|
-
onChange,
|
|
172
|
-
placeholder = "Select option...",
|
|
173
|
-
searchPlaceholder = "Search...",
|
|
174
|
-
noResultsText = "No results found.",
|
|
175
|
-
width = "100%",
|
|
176
|
-
isDisabled = false,
|
|
177
|
-
allowCustom = false
|
|
178
|
-
}) {
|
|
179
|
-
const [open, setOpen] = React__namespace.default.useState(false);
|
|
180
|
-
const [searchValue, setSearchValue] = React.useState("");
|
|
181
|
-
const containerStyles = {
|
|
182
|
-
width
|
|
183
|
-
};
|
|
184
|
-
const combinedOptions = allowCustom ? [
|
|
185
|
-
...options,
|
|
186
|
-
...searchValue && !options.some(
|
|
187
|
-
(opt) => opt.label.toLowerCase() === searchValue.toLowerCase()
|
|
188
|
-
) ? [
|
|
189
|
-
{
|
|
190
|
-
value: searchValue.toLowerCase().replace(/\s+/g, "-"),
|
|
191
|
-
label: searchValue
|
|
192
|
-
}
|
|
193
|
-
] : []
|
|
194
|
-
] : options;
|
|
195
|
-
const filteredOptions = combinedOptions.filter(
|
|
196
|
-
(option) => option.label.toLowerCase().includes(searchValue.toLowerCase())
|
|
197
|
-
);
|
|
198
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: containerStyles, children: /* @__PURE__ */ jsxRuntime.jsxs(chunkTJ6EFR2O_cjs.Popover, { open, onOpenChange: setOpen, children: [
|
|
199
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkTJ6EFR2O_cjs.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
200
|
-
chunkTJ6EFR2O_cjs.Button,
|
|
201
|
-
{
|
|
202
|
-
variant: "outline",
|
|
203
|
-
role: "combobox",
|
|
204
|
-
"aria-expanded": open,
|
|
205
|
-
style: containerStyles,
|
|
206
|
-
className: `flex items-center justify-between relative ${isDisabled ? "cursor-not-allowed opacity-50" : ""}`,
|
|
207
|
-
disabled: isDisabled,
|
|
208
|
-
children: [
|
|
209
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 min-w-0 text-left", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "truncate", children: value ? combinedOptions.find((option) => option.value === value)?.label || value : placeholder }) }),
|
|
210
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronsUpDown, { className: "ml-2 h-4 w-4 flex-shrink-0 opacity-50" })
|
|
211
|
-
]
|
|
212
|
-
}
|
|
213
|
-
) }),
|
|
214
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkTJ6EFR2O_cjs.PopoverContent, { className: "w-[var(--radix-popover-trigger-width)] p-0", children: /* @__PURE__ */ jsxRuntime.jsxs(Command, { className: "w-full", children: [
|
|
215
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
216
|
-
CommandInput,
|
|
217
|
-
{
|
|
218
|
-
value: searchValue,
|
|
219
|
-
onValueChange: setSearchValue,
|
|
220
|
-
placeholder: searchPlaceholder,
|
|
221
|
-
className: "h-9"
|
|
222
|
-
}
|
|
223
|
-
),
|
|
224
|
-
/* @__PURE__ */ jsxRuntime.jsx(CommandList, { children: filteredOptions.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(CommandGroup, { className: "max-h-[200px] overflow-y-auto", children: filteredOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
225
|
-
CommandItem,
|
|
226
|
-
{
|
|
227
|
-
value: option.value,
|
|
228
|
-
onSelect: (currentValue) => {
|
|
229
|
-
onChange(currentValue === value ? "" : currentValue);
|
|
230
|
-
setOpen(false);
|
|
231
|
-
setSearchValue("");
|
|
232
|
-
},
|
|
233
|
-
className: "flex items-center",
|
|
234
|
-
style: { width: "100%" },
|
|
235
|
-
children: [
|
|
236
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center w-full min-w-0", children: [
|
|
237
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
238
|
-
lucideReact.Check,
|
|
239
|
-
{
|
|
240
|
-
className: `mr-2 h-4 w-4 flex-shrink-0 ${value === option.value ? "opacity-100" : "opacity-0"}`
|
|
241
|
-
}
|
|
242
|
-
),
|
|
243
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate flex-1", children: option.label })
|
|
244
|
-
] }),
|
|
245
|
-
option.badge && /* @__PURE__ */ jsxRuntime.jsx(
|
|
246
|
-
Badge,
|
|
247
|
-
{
|
|
248
|
-
variant: "outline",
|
|
249
|
-
className: "ml-2 text-[10px] px-2 py-0 h-5 font-normal",
|
|
250
|
-
children: option.badge
|
|
251
|
-
}
|
|
252
|
-
)
|
|
253
|
-
]
|
|
254
|
-
},
|
|
255
|
-
option.value
|
|
256
|
-
)) }) : /* @__PURE__ */ jsxRuntime.jsxs(CommandEmpty, { children: [
|
|
257
|
-
allowCustom && searchValue && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
258
|
-
chunkTJ6EFR2O_cjs.Button,
|
|
259
|
-
{
|
|
260
|
-
variant: "ghost",
|
|
261
|
-
className: "w-full justify-start",
|
|
262
|
-
onClick: () => {
|
|
263
|
-
const newOption = {
|
|
264
|
-
value: searchValue.toLowerCase().replace(/\s+/g, "-")};
|
|
265
|
-
onChange(newOption.value);
|
|
266
|
-
setOpen(false);
|
|
267
|
-
setSearchValue("");
|
|
268
|
-
},
|
|
269
|
-
children: [
|
|
270
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Plus, { className: "mr-2 h-4 w-4" }),
|
|
271
|
-
'Add "',
|
|
272
|
-
searchValue,
|
|
273
|
-
'" as a new option'
|
|
274
|
-
]
|
|
275
|
-
}
|
|
276
|
-
),
|
|
277
|
-
!searchValue && noResultsText
|
|
278
|
-
] }) })
|
|
279
|
-
] }) })
|
|
280
|
-
] }) });
|
|
281
|
-
}
|
|
282
|
-
var SmartCombobox = ({
|
|
283
|
-
field,
|
|
284
|
-
label,
|
|
285
|
-
options,
|
|
286
|
-
className = "",
|
|
287
|
-
placeholder,
|
|
288
|
-
allowCustom = false,
|
|
289
|
-
validation,
|
|
290
|
-
required = false,
|
|
291
|
-
defaultValue,
|
|
292
|
-
info,
|
|
293
|
-
subLabel,
|
|
294
|
-
disabled,
|
|
295
|
-
hidden
|
|
296
|
-
}) => {
|
|
297
|
-
const { formData } = chunkMBC5TYXA_cjs.useSmartForm();
|
|
298
|
-
const { value, error, onChange, fieldRef, registerValidation } = chunkMBC5TYXA_cjs.useFormField(field);
|
|
299
|
-
const fieldDetection = chunkMBC5TYXA_cjs.useFieldDetection();
|
|
300
|
-
const hasRegistered = React.useRef(false);
|
|
301
|
-
const hasSetDefault = React.useRef(false);
|
|
302
|
-
const isDisabled = typeof disabled === "function" ? disabled(formData) : disabled || false;
|
|
303
|
-
const isHidden = typeof hidden === "function" ? hidden(formData) : hidden || false;
|
|
304
|
-
if (isHidden) return null;
|
|
305
|
-
React.useEffect(() => {
|
|
306
|
-
if (validation && !hasRegistered.current) {
|
|
307
|
-
hasRegistered.current = true;
|
|
308
|
-
registerValidation(field, validation);
|
|
309
|
-
}
|
|
310
|
-
}, [validation, field, registerValidation]);
|
|
311
|
-
React.useEffect(() => {
|
|
312
|
-
if (fieldDetection?.registerField) {
|
|
313
|
-
fieldDetection.registerField(field);
|
|
314
|
-
}
|
|
315
|
-
}, [field, fieldDetection]);
|
|
316
|
-
React.useEffect(() => {
|
|
317
|
-
if (defaultValue !== void 0 && !hasSetDefault.current && (value === void 0 || value === null || value === "")) {
|
|
318
|
-
onChange(defaultValue);
|
|
319
|
-
hasSetDefault.current = true;
|
|
320
|
-
}
|
|
321
|
-
}, [defaultValue, value, onChange]);
|
|
322
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex-1 min-w-0 ${className}`, children: [
|
|
323
|
-
label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2", children: [
|
|
324
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
325
|
-
/* @__PURE__ */ jsxRuntime.jsxs(chunkMBC5TYXA_cjs.Label, { className: "text-sm font-medium text-foreground", children: [
|
|
326
|
-
label,
|
|
327
|
-
" ",
|
|
328
|
-
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive", children: "*" })
|
|
329
|
-
] }),
|
|
330
|
-
info && /* @__PURE__ */ jsxRuntime.jsx(chunkMBC5TYXA_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkMBC5TYXA_cjs.Tooltip, { children: [
|
|
331
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkMBC5TYXA_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-4 w-4 text-muted-foreground cursor-pointer mr-2" }) }),
|
|
332
|
-
/* @__PURE__ */ jsxRuntime.jsx(chunkMBC5TYXA_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-xs", children: info }) })
|
|
333
|
-
] }) })
|
|
334
|
-
] }),
|
|
335
|
-
subLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: subLabel })
|
|
336
|
-
] }),
|
|
337
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: fieldRef, "data-field": field, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
338
|
-
Combobox,
|
|
339
|
-
{
|
|
340
|
-
options: (options || []).map((o) => ({ value: o.value, label: o.label })),
|
|
341
|
-
value: value || "",
|
|
342
|
-
onChange: (newValue) => onChange(newValue),
|
|
343
|
-
placeholder: placeholder || (label ? `Select ${label.toLowerCase()}` : `Select ${field}`),
|
|
344
|
-
allowCustom,
|
|
345
|
-
isDisabled
|
|
346
|
-
}
|
|
347
|
-
) }),
|
|
348
|
-
error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-sm mt-1", children: error })
|
|
349
|
-
] });
|
|
350
|
-
};
|
|
351
31
|
var SmartFileUpload = ({
|
|
352
32
|
field,
|
|
353
33
|
label,
|
|
@@ -368,38 +48,38 @@ var SmartFileUpload = ({
|
|
|
368
48
|
disabled,
|
|
369
49
|
hidden
|
|
370
50
|
}) => {
|
|
371
|
-
const { formData, registerSubmitHook, unregisterSubmitHook } =
|
|
372
|
-
const { value, error, onChange, fieldRef, registerValidation } =
|
|
373
|
-
const fieldDetection =
|
|
374
|
-
const hasRegistered =
|
|
375
|
-
const hasSetDefault =
|
|
376
|
-
const inputRef =
|
|
51
|
+
const { formData, registerSubmitHook, unregisterSubmitHook } = chunkWIBCOQPP_cjs.useSmartForm();
|
|
52
|
+
const { value, error, onChange, fieldRef, registerValidation } = chunkWIBCOQPP_cjs.useFormField(field);
|
|
53
|
+
const fieldDetection = chunkWIBCOQPP_cjs.useFieldDetection();
|
|
54
|
+
const hasRegistered = React2.useRef(false);
|
|
55
|
+
const hasSetDefault = React2.useRef(false);
|
|
56
|
+
const inputRef = React2.useRef(null);
|
|
377
57
|
const isDisabled = typeof disabled === "function" ? disabled(formData) : disabled || false;
|
|
378
58
|
const isHidden = typeof hidden === "function" ? hidden(formData) : hidden || false;
|
|
379
59
|
if (isHidden) return null;
|
|
380
|
-
|
|
60
|
+
React2.useEffect(() => {
|
|
381
61
|
if (validation && !hasRegistered.current) {
|
|
382
62
|
hasRegistered.current = true;
|
|
383
63
|
registerValidation(field, validation);
|
|
384
64
|
}
|
|
385
65
|
}, [validation, field, registerValidation]);
|
|
386
|
-
|
|
66
|
+
React2.useEffect(() => {
|
|
387
67
|
if (fieldDetection?.registerField) {
|
|
388
68
|
fieldDetection.registerField(field);
|
|
389
69
|
}
|
|
390
70
|
}, [field, fieldDetection]);
|
|
391
|
-
|
|
71
|
+
React2.useEffect(() => {
|
|
392
72
|
if (defaultValue !== void 0 && !hasSetDefault.current && (value === void 0 || value === null || value === "")) {
|
|
393
73
|
onChange(defaultValue);
|
|
394
74
|
hasSetDefault.current = true;
|
|
395
75
|
}
|
|
396
76
|
}, [defaultValue, value, onChange]);
|
|
397
|
-
const normalizedFiles =
|
|
77
|
+
const normalizedFiles = React2.useMemo(() => {
|
|
398
78
|
const filesAny = Array.isArray(value) ? value : value ? [value] : [];
|
|
399
79
|
return filesAny.filter((f) => f instanceof File);
|
|
400
80
|
}, [value]);
|
|
401
|
-
const [previewUrls, setPreviewUrls] =
|
|
402
|
-
|
|
81
|
+
const [previewUrls, setPreviewUrls] = React2.useState(/* @__PURE__ */ new Map());
|
|
82
|
+
React2.useEffect(() => {
|
|
403
83
|
const newUrls = /* @__PURE__ */ new Map();
|
|
404
84
|
normalizedFiles.forEach((file) => {
|
|
405
85
|
if (file.type.startsWith("image/")) {
|
|
@@ -418,7 +98,7 @@ var SmartFileUpload = ({
|
|
|
418
98
|
});
|
|
419
99
|
setPreviewUrls(newUrls);
|
|
420
100
|
}, [normalizedFiles]);
|
|
421
|
-
|
|
101
|
+
React2.useEffect(() => {
|
|
422
102
|
return () => {
|
|
423
103
|
previewUrls.forEach((url) => URL.revokeObjectURL(url));
|
|
424
104
|
};
|
|
@@ -490,7 +170,7 @@ var SmartFileUpload = ({
|
|
|
490
170
|
if (onError) onError(err);
|
|
491
171
|
}
|
|
492
172
|
};
|
|
493
|
-
|
|
173
|
+
React2.useEffect(() => {
|
|
494
174
|
if (!uploadOnSelect || !uploadApi) return;
|
|
495
175
|
const filesAny = Array.isArray(value) ? value : value ? [value] : [];
|
|
496
176
|
const files = filesAny.filter((f) => f instanceof File);
|
|
@@ -498,7 +178,7 @@ var SmartFileUpload = ({
|
|
|
498
178
|
void performUpload();
|
|
499
179
|
}
|
|
500
180
|
}, [value, uploadOnSelect, uploadApi]);
|
|
501
|
-
|
|
181
|
+
React2.useEffect(() => {
|
|
502
182
|
const key = `smart-file-upload:${field}`;
|
|
503
183
|
if (uploadApi && !uploadOnSelect) {
|
|
504
184
|
registerSubmitHook(key, performUpload);
|
|
@@ -506,24 +186,24 @@ var SmartFileUpload = ({
|
|
|
506
186
|
}
|
|
507
187
|
return () => unregisterSubmitHook(key);
|
|
508
188
|
}, [field, uploadApi, uploadOnSelect, registerSubmitHook, unregisterSubmitHook, value, multiple]);
|
|
509
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
189
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWIBCOQPP_cjs.cn("flex-1 min-w-0", className), children: [
|
|
510
190
|
label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2", children: [
|
|
511
191
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
512
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
192
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Label, { className: "text-sm font-medium text-foreground", children: [
|
|
513
193
|
label,
|
|
514
194
|
" ",
|
|
515
195
|
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive", children: "*" })
|
|
516
196
|
] }),
|
|
517
|
-
info && /* @__PURE__ */ jsxRuntime.jsx(
|
|
518
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
519
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
197
|
+
info && /* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Tooltip, { children: [
|
|
198
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-4 w-4 text-muted-foreground cursor-pointer mr-2" }) }),
|
|
199
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-xs", children: info }) })
|
|
520
200
|
] }) })
|
|
521
201
|
] }),
|
|
522
202
|
subLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: subLabel })
|
|
523
203
|
] }),
|
|
524
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
204
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWIBCOQPP_cjs.cn("flex items-center gap-2", error && "text-destructive"), children: [
|
|
525
205
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
526
|
-
|
|
206
|
+
chunkWIBCOQPP_cjs.Input,
|
|
527
207
|
{
|
|
528
208
|
ref: (el) => {
|
|
529
209
|
inputRef.current = el;
|
|
@@ -533,12 +213,12 @@ var SmartFileUpload = ({
|
|
|
533
213
|
accept,
|
|
534
214
|
multiple,
|
|
535
215
|
onChange: onInputChange,
|
|
536
|
-
className:
|
|
216
|
+
className: chunkWIBCOQPP_cjs.cn(error && "border-destructive"),
|
|
537
217
|
"data-field": field,
|
|
538
218
|
disabled: isDisabled
|
|
539
219
|
}
|
|
540
220
|
),
|
|
541
|
-
(Array.isArray(value) ? value.length > 0 : !!value) && /* @__PURE__ */ jsxRuntime.jsx(
|
|
221
|
+
(Array.isArray(value) ? value.length > 0 : !!value) && /* @__PURE__ */ jsxRuntime.jsx(chunkVGP3HY5Y_cjs.Button, { type: "button", variant: "secondary", onClick: clearSelection, disabled: isDisabled, children: "Clear" })
|
|
542
222
|
] }),
|
|
543
223
|
normalizedFiles.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 text-sm text-muted-foreground", children: "No file selected" }) : /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "mt-2 space-y-1", children: normalizedFiles.map((f, idx) => {
|
|
544
224
|
const isImage = f.type.startsWith("image/");
|
|
@@ -563,7 +243,7 @@ var SmartFileUpload = ({
|
|
|
563
243
|
] })
|
|
564
244
|
] }),
|
|
565
245
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
566
|
-
|
|
246
|
+
chunkVGP3HY5Y_cjs.Button,
|
|
567
247
|
{
|
|
568
248
|
type: "button",
|
|
569
249
|
variant: "ghost",
|
|
@@ -587,7 +267,7 @@ function Slider({
|
|
|
587
267
|
max = 100,
|
|
588
268
|
...props
|
|
589
269
|
}) {
|
|
590
|
-
const _values =
|
|
270
|
+
const _values = React2__namespace.useMemo(
|
|
591
271
|
() => Array.isArray(value) ? value : Array.isArray(defaultValue) ? defaultValue : [min, max],
|
|
592
272
|
[value, defaultValue, min, max]
|
|
593
273
|
);
|
|
@@ -599,7 +279,7 @@ function Slider({
|
|
|
599
279
|
value,
|
|
600
280
|
min,
|
|
601
281
|
max,
|
|
602
|
-
className:
|
|
282
|
+
className: chunkWIBCOQPP_cjs.cn(
|
|
603
283
|
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
604
284
|
className
|
|
605
285
|
),
|
|
@@ -609,14 +289,14 @@ function Slider({
|
|
|
609
289
|
SliderPrimitive__namespace.Track,
|
|
610
290
|
{
|
|
611
291
|
"data-slot": "slider-track",
|
|
612
|
-
className:
|
|
292
|
+
className: chunkWIBCOQPP_cjs.cn(
|
|
613
293
|
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
614
294
|
),
|
|
615
295
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
616
296
|
SliderPrimitive__namespace.Range,
|
|
617
297
|
{
|
|
618
298
|
"data-slot": "slider-range",
|
|
619
|
-
className:
|
|
299
|
+
className: chunkWIBCOQPP_cjs.cn(
|
|
620
300
|
"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
621
301
|
)
|
|
622
302
|
}
|
|
@@ -652,26 +332,26 @@ var SmartSlider = ({
|
|
|
652
332
|
disabled,
|
|
653
333
|
hidden
|
|
654
334
|
}) => {
|
|
655
|
-
const { formData } =
|
|
656
|
-
const { value, error, onChange, fieldRef, registerValidation } =
|
|
657
|
-
const fieldDetection =
|
|
658
|
-
const hasRegistered =
|
|
659
|
-
const hasSetDefault =
|
|
335
|
+
const { formData } = chunkWIBCOQPP_cjs.useSmartForm();
|
|
336
|
+
const { value, error, onChange, fieldRef, registerValidation } = chunkWIBCOQPP_cjs.useFormField(field);
|
|
337
|
+
const fieldDetection = chunkWIBCOQPP_cjs.useFieldDetection();
|
|
338
|
+
const hasRegistered = React2.useRef(false);
|
|
339
|
+
const hasSetDefault = React2.useRef(false);
|
|
660
340
|
const isDisabled = typeof disabled === "function" ? disabled(formData) : disabled || false;
|
|
661
341
|
const isHidden = typeof hidden === "function" ? hidden(formData) : hidden || false;
|
|
662
342
|
if (isHidden) return null;
|
|
663
|
-
|
|
343
|
+
React2.useEffect(() => {
|
|
664
344
|
if (validation && !hasRegistered.current) {
|
|
665
345
|
hasRegistered.current = true;
|
|
666
346
|
registerValidation(field, validation);
|
|
667
347
|
}
|
|
668
348
|
}, [validation, field, registerValidation]);
|
|
669
|
-
|
|
349
|
+
React2.useEffect(() => {
|
|
670
350
|
if (fieldDetection?.registerField) {
|
|
671
351
|
fieldDetection.registerField(field);
|
|
672
352
|
}
|
|
673
353
|
}, [field, fieldDetection]);
|
|
674
|
-
|
|
354
|
+
React2.useEffect(() => {
|
|
675
355
|
if (defaultValue !== void 0 && !hasSetDefault.current && (value === void 0 || value === null || value === "")) {
|
|
676
356
|
onChange(defaultValue);
|
|
677
357
|
hasSetDefault.current = true;
|
|
@@ -685,7 +365,7 @@ var SmartSlider = ({
|
|
|
685
365
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex-1 min-w-0 ${className}`, children: [
|
|
686
366
|
label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2", children: [
|
|
687
367
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
688
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
368
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Label, { className: "text-sm font-medium text-foreground", children: [
|
|
689
369
|
label,
|
|
690
370
|
" ",
|
|
691
371
|
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive", children: "*" }),
|
|
@@ -695,9 +375,9 @@ var SmartSlider = ({
|
|
|
695
375
|
")"
|
|
696
376
|
] })
|
|
697
377
|
] }),
|
|
698
|
-
info && /* @__PURE__ */ jsxRuntime.jsx(
|
|
699
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
700
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
378
|
+
info && /* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Tooltip, { children: [
|
|
379
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-4 w-4 text-muted-foreground cursor-pointer mr-2" }) }),
|
|
380
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-xs", children: info }) })
|
|
701
381
|
] }) })
|
|
702
382
|
] }),
|
|
703
383
|
subLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: subLabel })
|
|
@@ -747,42 +427,42 @@ var SmartDualRangeSlider = ({
|
|
|
747
427
|
disabled,
|
|
748
428
|
hidden
|
|
749
429
|
}) => {
|
|
750
|
-
const { formData } =
|
|
751
|
-
const minFormField =
|
|
752
|
-
const maxFormField =
|
|
753
|
-
const fieldDetection =
|
|
754
|
-
const hasRegisteredMin =
|
|
755
|
-
const hasRegisteredMax =
|
|
756
|
-
const hasSetDefaultMin =
|
|
757
|
-
const hasSetDefaultMax =
|
|
430
|
+
const { formData } = chunkWIBCOQPP_cjs.useSmartForm();
|
|
431
|
+
const minFormField = chunkWIBCOQPP_cjs.useFormField(minField);
|
|
432
|
+
const maxFormField = chunkWIBCOQPP_cjs.useFormField(maxField);
|
|
433
|
+
const fieldDetection = chunkWIBCOQPP_cjs.useFieldDetection();
|
|
434
|
+
const hasRegisteredMin = React2.useRef(false);
|
|
435
|
+
const hasRegisteredMax = React2.useRef(false);
|
|
436
|
+
const hasSetDefaultMin = React2.useRef(false);
|
|
437
|
+
const hasSetDefaultMax = React2.useRef(false);
|
|
758
438
|
const isDisabled = typeof disabled === "function" ? disabled(formData) : disabled || false;
|
|
759
439
|
const isHidden = typeof hidden === "function" ? hidden(formData) : hidden || false;
|
|
760
440
|
if (isHidden) return null;
|
|
761
|
-
|
|
441
|
+
React2.useEffect(() => {
|
|
762
442
|
if (minValidation && !hasRegisteredMin.current) {
|
|
763
443
|
hasRegisteredMin.current = true;
|
|
764
444
|
minFormField.registerValidation(minField, minValidation);
|
|
765
445
|
}
|
|
766
446
|
}, [minValidation, minField, minFormField]);
|
|
767
|
-
|
|
447
|
+
React2.useEffect(() => {
|
|
768
448
|
if (maxValidation && !hasRegisteredMax.current) {
|
|
769
449
|
hasRegisteredMax.current = true;
|
|
770
450
|
maxFormField.registerValidation(maxField, maxValidation);
|
|
771
451
|
}
|
|
772
452
|
}, [maxValidation, maxField, maxFormField]);
|
|
773
|
-
|
|
453
|
+
React2.useEffect(() => {
|
|
774
454
|
if (fieldDetection?.registerField) {
|
|
775
455
|
fieldDetection.registerField(minField);
|
|
776
456
|
fieldDetection.registerField(maxField);
|
|
777
457
|
}
|
|
778
458
|
}, [minField, maxField, fieldDetection]);
|
|
779
|
-
|
|
459
|
+
React2.useEffect(() => {
|
|
780
460
|
if (defaultMinValue !== void 0 && !hasSetDefaultMin.current && (minFormField.value === void 0 || minFormField.value === null || minFormField.value === "")) {
|
|
781
461
|
minFormField.onChange(defaultMinValue);
|
|
782
462
|
hasSetDefaultMin.current = true;
|
|
783
463
|
}
|
|
784
464
|
}, [defaultMinValue, minFormField.value]);
|
|
785
|
-
|
|
465
|
+
React2.useEffect(() => {
|
|
786
466
|
if (defaultMaxValue !== void 0 && !hasSetDefaultMax.current && (maxFormField.value === void 0 || maxFormField.value === null || maxFormField.value === "")) {
|
|
787
467
|
maxFormField.onChange(defaultMaxValue);
|
|
788
468
|
hasSetDefaultMax.current = true;
|
|
@@ -799,14 +479,14 @@ var SmartDualRangeSlider = ({
|
|
|
799
479
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex-1 min-w-0 ${className}`, children: [
|
|
800
480
|
label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2", children: [
|
|
801
481
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
802
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
482
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Label, { className: "text-sm font-medium text-foreground", children: [
|
|
803
483
|
label,
|
|
804
484
|
" ",
|
|
805
485
|
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive", children: "*" })
|
|
806
486
|
] }),
|
|
807
|
-
info && /* @__PURE__ */ jsxRuntime.jsx(
|
|
808
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
809
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
487
|
+
info && /* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Tooltip, { children: [
|
|
488
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-4 w-4 text-muted-foreground cursor-pointer mr-2" }) }),
|
|
489
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-xs", children: info }) })
|
|
810
490
|
] }) })
|
|
811
491
|
] }),
|
|
812
492
|
subLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: subLabel })
|
|
@@ -843,7 +523,7 @@ var SmartDualRangeSlider = ({
|
|
|
843
523
|
combinedError && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-sm mt-1", children: combinedError })
|
|
844
524
|
] });
|
|
845
525
|
};
|
|
846
|
-
var TagsContext =
|
|
526
|
+
var TagsContext = React2.createContext({
|
|
847
527
|
value: void 0,
|
|
848
528
|
setValue: void 0,
|
|
849
529
|
open: false,
|
|
@@ -853,7 +533,7 @@ var TagsContext = React.createContext({
|
|
|
853
533
|
setWidth: void 0
|
|
854
534
|
});
|
|
855
535
|
var useTagsContext = () => {
|
|
856
|
-
const context =
|
|
536
|
+
const context = React2.useContext(TagsContext);
|
|
857
537
|
if (!context) {
|
|
858
538
|
throw new Error("useTagsContext must be used within a TagsProvider");
|
|
859
539
|
}
|
|
@@ -867,12 +547,12 @@ var Tags = ({
|
|
|
867
547
|
children,
|
|
868
548
|
className
|
|
869
549
|
}) => {
|
|
870
|
-
const [uncontrolledOpen, setUncontrolledOpen] =
|
|
871
|
-
const [width, setWidth] =
|
|
872
|
-
const ref =
|
|
550
|
+
const [uncontrolledOpen, setUncontrolledOpen] = React2.useState(false);
|
|
551
|
+
const [width, setWidth] = React2.useState();
|
|
552
|
+
const ref = React2.useRef(null);
|
|
873
553
|
const open = controlledOpen ?? uncontrolledOpen;
|
|
874
554
|
const onOpenChange = controlledOnOpenChange ?? setUncontrolledOpen;
|
|
875
|
-
|
|
555
|
+
React2.useEffect(() => {
|
|
876
556
|
if (!ref.current) {
|
|
877
557
|
return;
|
|
878
558
|
}
|
|
@@ -888,7 +568,7 @@ var Tags = ({
|
|
|
888
568
|
TagsContext.Provider,
|
|
889
569
|
{
|
|
890
570
|
value: { value, setValue, open, onOpenChange, width, setWidth },
|
|
891
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
571
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkVGP3HY5Y_cjs.Popover, { onOpenChange, open, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkWIBCOQPP_cjs.cn("relative w-full", className), ref, children }) })
|
|
892
572
|
}
|
|
893
573
|
);
|
|
894
574
|
};
|
|
@@ -896,10 +576,10 @@ var TagsTrigger = ({
|
|
|
896
576
|
className,
|
|
897
577
|
children,
|
|
898
578
|
...props
|
|
899
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
900
|
-
|
|
579
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(chunkVGP3HY5Y_cjs.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
580
|
+
chunkVGP3HY5Y_cjs.Button,
|
|
901
581
|
{
|
|
902
|
-
className:
|
|
582
|
+
className: chunkWIBCOQPP_cjs.cn("h-auto w-full justify-between p-2", className),
|
|
903
583
|
role: "combobox",
|
|
904
584
|
variant: "outline",
|
|
905
585
|
...props,
|
|
@@ -920,7 +600,7 @@ var TagsValue = ({
|
|
|
920
600
|
event.stopPropagation();
|
|
921
601
|
onRemove?.();
|
|
922
602
|
};
|
|
923
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Badge, { className:
|
|
603
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(chunkVGP3HY5Y_cjs.Badge, { className: chunkWIBCOQPP_cjs.cn("flex items-center gap-2", className), ...props, children: [
|
|
924
604
|
children,
|
|
925
605
|
onRemove && // biome-ignore lint/a11y/noStaticElementInteractions: "This is a clickable badge"
|
|
926
606
|
// biome-ignore lint/a11y/useKeyWithClickEvents: "This is a clickable badge"
|
|
@@ -941,27 +621,27 @@ var TagsContent = ({
|
|
|
941
621
|
}) => {
|
|
942
622
|
const { width } = useTagsContext();
|
|
943
623
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
944
|
-
|
|
624
|
+
chunkVGP3HY5Y_cjs.PopoverContent,
|
|
945
625
|
{
|
|
946
|
-
className:
|
|
626
|
+
className: chunkWIBCOQPP_cjs.cn("p-0", className),
|
|
947
627
|
style: { width },
|
|
948
628
|
...props,
|
|
949
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Command, { children })
|
|
629
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(chunkVGP3HY5Y_cjs.Command, { children })
|
|
950
630
|
}
|
|
951
631
|
);
|
|
952
632
|
};
|
|
953
|
-
var TagsInput = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(CommandInput, { className:
|
|
954
|
-
var TagsList = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(CommandList, { className:
|
|
633
|
+
var TagsInput = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(chunkVGP3HY5Y_cjs.CommandInput, { className: chunkWIBCOQPP_cjs.cn("h-9", className), ...props });
|
|
634
|
+
var TagsList = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(chunkVGP3HY5Y_cjs.CommandList, { className: chunkWIBCOQPP_cjs.cn("max-h-[200px]", className), ...props });
|
|
955
635
|
var TagsEmpty = ({
|
|
956
636
|
children,
|
|
957
637
|
className,
|
|
958
638
|
...props
|
|
959
|
-
}) => /* @__PURE__ */ jsxRuntime.jsx(CommandEmpty, { ...props, children: children ?? "No tags found." });
|
|
960
|
-
var TagsGroup = CommandGroup;
|
|
639
|
+
}) => /* @__PURE__ */ jsxRuntime.jsx(chunkVGP3HY5Y_cjs.CommandEmpty, { ...props, children: children ?? "No tags found." });
|
|
640
|
+
var TagsGroup = chunkVGP3HY5Y_cjs.CommandGroup;
|
|
961
641
|
var TagsItem = ({ className, ...props }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
962
|
-
CommandItem,
|
|
642
|
+
chunkVGP3HY5Y_cjs.CommandItem,
|
|
963
643
|
{
|
|
964
|
-
className:
|
|
644
|
+
className: chunkWIBCOQPP_cjs.cn("cursor-pointer items-center justify-between", className),
|
|
965
645
|
...props
|
|
966
646
|
}
|
|
967
647
|
);
|
|
@@ -982,35 +662,35 @@ var SmartAutoSuggestTags = ({
|
|
|
982
662
|
disabled,
|
|
983
663
|
hidden
|
|
984
664
|
}) => {
|
|
985
|
-
const { formData } =
|
|
986
|
-
const { value, error, onChange, fieldRef, registerValidation } =
|
|
987
|
-
const fieldDetection =
|
|
988
|
-
const hasRegistered =
|
|
989
|
-
const hasSetDefault =
|
|
665
|
+
const { formData } = chunkWIBCOQPP_cjs.useSmartForm();
|
|
666
|
+
const { value, error, onChange, fieldRef, registerValidation } = chunkWIBCOQPP_cjs.useFormField(field);
|
|
667
|
+
const fieldDetection = chunkWIBCOQPP_cjs.useFieldDetection();
|
|
668
|
+
const hasRegistered = React2.useRef(false);
|
|
669
|
+
const hasSetDefault = React2.useRef(false);
|
|
990
670
|
const isDisabled = typeof disabled === "function" ? disabled(formData) : disabled || false;
|
|
991
671
|
const isHidden = typeof hidden === "function" ? hidden(formData) : hidden || false;
|
|
992
672
|
if (isHidden) return null;
|
|
993
|
-
const [tags, setTags] =
|
|
994
|
-
const [newTag, setNewTag] =
|
|
673
|
+
const [tags, setTags] = React2.useState(initialOptions);
|
|
674
|
+
const [newTag, setNewTag] = React2.useState("");
|
|
995
675
|
const selected = Array.isArray(value) ? value : [];
|
|
996
|
-
|
|
676
|
+
React2.useEffect(() => {
|
|
997
677
|
if (validation && !hasRegistered.current) {
|
|
998
678
|
hasRegistered.current = true;
|
|
999
679
|
registerValidation(field, validation);
|
|
1000
680
|
}
|
|
1001
681
|
}, [validation, field, registerValidation]);
|
|
1002
|
-
|
|
682
|
+
React2.useEffect(() => {
|
|
1003
683
|
if (fieldDetection?.registerField) {
|
|
1004
684
|
fieldDetection.registerField(field);
|
|
1005
685
|
}
|
|
1006
686
|
}, [field, fieldDetection]);
|
|
1007
|
-
|
|
687
|
+
React2.useEffect(() => {
|
|
1008
688
|
if (defaultValue !== void 0 && !hasSetDefault.current && (!value || Array.isArray(value) && value.length === 0)) {
|
|
1009
689
|
onChange(defaultValue);
|
|
1010
690
|
hasSetDefault.current = true;
|
|
1011
691
|
}
|
|
1012
692
|
}, [defaultValue, value, onChange]);
|
|
1013
|
-
|
|
693
|
+
React2.useEffect(() => {
|
|
1014
694
|
setTags(initialOptions);
|
|
1015
695
|
}, [initialOptions]);
|
|
1016
696
|
const handleRemove = (tagId) => {
|
|
@@ -1053,7 +733,7 @@ var SmartAutoSuggestTags = ({
|
|
|
1053
733
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `flex-1 min-w-0 ${className}`, children: [
|
|
1054
734
|
label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2", children: [
|
|
1055
735
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1056
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
736
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Label, { className: "text-sm font-medium text-foreground", children: [
|
|
1057
737
|
label,
|
|
1058
738
|
" ",
|
|
1059
739
|
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive", children: "*" }),
|
|
@@ -1065,14 +745,14 @@ var SmartAutoSuggestTags = ({
|
|
|
1065
745
|
")"
|
|
1066
746
|
] })
|
|
1067
747
|
] }),
|
|
1068
|
-
info && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1069
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1070
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
748
|
+
info && /* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Tooltip, { children: [
|
|
749
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-4 w-4 text-muted-foreground cursor-pointer mr-2" }) }),
|
|
750
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-xs", children: info }) })
|
|
1071
751
|
] }) })
|
|
1072
752
|
] }),
|
|
1073
753
|
subLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: subLabel })
|
|
1074
754
|
] }),
|
|
1075
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: fieldRef, "data-field": field, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className:
|
|
755
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: fieldRef, "data-field": field, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkWIBCOQPP_cjs.cn(
|
|
1076
756
|
"w-full rounded-md border border-input bg-background text-sm ring-offset-background",
|
|
1077
757
|
"focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
|
|
1078
758
|
error && "border-destructive focus-within:ring-destructive",
|
|
@@ -1195,34 +875,34 @@ var SmartBasicRichTextbox = ({
|
|
|
1195
875
|
disabled,
|
|
1196
876
|
hidden
|
|
1197
877
|
}) => {
|
|
1198
|
-
const { formData } =
|
|
1199
|
-
const { value, error, onChange, fieldRef, registerValidation } =
|
|
1200
|
-
const fieldDetection =
|
|
1201
|
-
const hasRegistered =
|
|
1202
|
-
const hasSetDefault =
|
|
1203
|
-
const editorRef =
|
|
1204
|
-
const [isFocused, setIsFocused] =
|
|
878
|
+
const { formData } = chunkWIBCOQPP_cjs.useSmartForm();
|
|
879
|
+
const { value, error, onChange, fieldRef, registerValidation } = chunkWIBCOQPP_cjs.useFormField(field);
|
|
880
|
+
const fieldDetection = chunkWIBCOQPP_cjs.useFieldDetection();
|
|
881
|
+
const hasRegistered = React2.useRef(false);
|
|
882
|
+
const hasSetDefault = React2.useRef(false);
|
|
883
|
+
const editorRef = React2.useRef(null);
|
|
884
|
+
const [isFocused, setIsFocused] = React2.useState(false);
|
|
1205
885
|
const isDisabled = typeof disabled === "function" ? disabled(formData) : disabled || false;
|
|
1206
886
|
const isHidden = typeof hidden === "function" ? hidden(formData) : hidden || false;
|
|
1207
887
|
if (isHidden) return null;
|
|
1208
|
-
|
|
888
|
+
React2.useEffect(() => {
|
|
1209
889
|
if (validation && !hasRegistered.current) {
|
|
1210
890
|
hasRegistered.current = true;
|
|
1211
891
|
registerValidation(field, validation);
|
|
1212
892
|
}
|
|
1213
893
|
}, [validation, field, registerValidation]);
|
|
1214
|
-
|
|
894
|
+
React2.useEffect(() => {
|
|
1215
895
|
if (fieldDetection?.registerField) {
|
|
1216
896
|
fieldDetection.registerField(field);
|
|
1217
897
|
}
|
|
1218
898
|
}, [field, fieldDetection]);
|
|
1219
|
-
|
|
899
|
+
React2.useEffect(() => {
|
|
1220
900
|
if (defaultValue !== void 0 && !hasSetDefault.current && (value === void 0 || value === null || value === "")) {
|
|
1221
901
|
onChange(defaultValue);
|
|
1222
902
|
hasSetDefault.current = true;
|
|
1223
903
|
}
|
|
1224
904
|
}, [defaultValue, value, onChange]);
|
|
1225
|
-
|
|
905
|
+
React2.useEffect(() => {
|
|
1226
906
|
if (editorRef.current && value !== void 0) {
|
|
1227
907
|
const sanitized = sanitizeHtml(value || "");
|
|
1228
908
|
if (editorRef.current.innerHTML !== sanitized) {
|
|
@@ -1230,21 +910,21 @@ var SmartBasicRichTextbox = ({
|
|
|
1230
910
|
}
|
|
1231
911
|
}
|
|
1232
912
|
}, [value]);
|
|
1233
|
-
const handleInput =
|
|
913
|
+
const handleInput = React2.useCallback(() => {
|
|
1234
914
|
if (editorRef.current) {
|
|
1235
915
|
const html = editorRef.current.innerHTML;
|
|
1236
916
|
const sanitized = sanitizeHtml(html);
|
|
1237
917
|
onChange(sanitized);
|
|
1238
918
|
}
|
|
1239
919
|
}, [onChange]);
|
|
1240
|
-
const handleKeyDown =
|
|
920
|
+
const handleKeyDown = React2.useCallback((e) => {
|
|
1241
921
|
if (e.key === "Enter" && !e.shiftKey) {
|
|
1242
922
|
e.preventDefault();
|
|
1243
923
|
document.execCommand("insertParagraph", false);
|
|
1244
924
|
return;
|
|
1245
925
|
}
|
|
1246
926
|
}, []);
|
|
1247
|
-
const execCommand =
|
|
927
|
+
const execCommand = React2.useCallback((command, value2) => {
|
|
1248
928
|
document.execCommand(command, false, value2);
|
|
1249
929
|
editorRef.current?.focus();
|
|
1250
930
|
handleInput();
|
|
@@ -1254,17 +934,17 @@ var SmartBasicRichTextbox = ({
|
|
|
1254
934
|
const toggleUnderline = () => execCommand("underline");
|
|
1255
935
|
const toggleBulletList = () => execCommand("insertUnorderedList");
|
|
1256
936
|
const toggleNumberedList = () => execCommand("insertOrderedList");
|
|
1257
|
-
const isFormatActive =
|
|
937
|
+
const isFormatActive = React2.useCallback((format) => {
|
|
1258
938
|
return document.queryCommandState(format);
|
|
1259
939
|
}, []);
|
|
1260
|
-
const [activeFormats, setActiveFormats] =
|
|
940
|
+
const [activeFormats, setActiveFormats] = React2.useState({
|
|
1261
941
|
bold: false,
|
|
1262
942
|
italic: false,
|
|
1263
943
|
underline: false,
|
|
1264
944
|
bulletList: false,
|
|
1265
945
|
numberedList: false
|
|
1266
946
|
});
|
|
1267
|
-
const updateActiveFormats =
|
|
947
|
+
const updateActiveFormats = React2.useCallback(() => {
|
|
1268
948
|
if (isFocused) {
|
|
1269
949
|
setActiveFormats({
|
|
1270
950
|
bold: isFormatActive("bold"),
|
|
@@ -1275,7 +955,7 @@ var SmartBasicRichTextbox = ({
|
|
|
1275
955
|
});
|
|
1276
956
|
}
|
|
1277
957
|
}, [isFocused, isFormatActive]);
|
|
1278
|
-
|
|
958
|
+
React2.useEffect(() => {
|
|
1279
959
|
if (isFocused) {
|
|
1280
960
|
document.addEventListener("selectionchange", updateActiveFormats);
|
|
1281
961
|
return () => document.removeEventListener("selectionchange", updateActiveFormats);
|
|
@@ -1288,17 +968,17 @@ var SmartBasicRichTextbox = ({
|
|
|
1288
968
|
const handleBlur = () => {
|
|
1289
969
|
setIsFocused(false);
|
|
1290
970
|
};
|
|
1291
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
971
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWIBCOQPP_cjs.cn("flex-1 min-w-0", className), children: [
|
|
1292
972
|
label && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-2", children: [
|
|
1293
973
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
1294
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
974
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Label, { className: "text-sm font-medium text-foreground", children: [
|
|
1295
975
|
label,
|
|
1296
976
|
" ",
|
|
1297
977
|
required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-destructive", children: "*" })
|
|
1298
978
|
] }),
|
|
1299
|
-
info && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1300
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1301
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
979
|
+
info && /* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Tooltip, { children: [
|
|
980
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.InfoIcon, { className: "h-4 w-4 text-muted-foreground cursor-pointer mr-2" }) }),
|
|
981
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "max-w-xs", children: info }) })
|
|
1302
982
|
] }) })
|
|
1303
983
|
] }),
|
|
1304
984
|
subLabel && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground mt-1", children: subLabel })
|
|
@@ -1308,22 +988,22 @@ var SmartBasicRichTextbox = ({
|
|
|
1308
988
|
{
|
|
1309
989
|
ref: fieldRef,
|
|
1310
990
|
"data-field": field,
|
|
1311
|
-
className:
|
|
991
|
+
className: chunkWIBCOQPP_cjs.cn(
|
|
1312
992
|
"w-full rounded-md border border-input bg-background",
|
|
1313
993
|
"focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
|
|
1314
994
|
error && "border-destructive focus-within:ring-destructive",
|
|
1315
995
|
isDisabled && "cursor-not-allowed opacity-50"
|
|
1316
996
|
),
|
|
1317
997
|
children: [
|
|
1318
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className:
|
|
1319
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1320
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1321
|
-
|
|
998
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkWIBCOQPP_cjs.cn("flex items-center gap-0.5 p-1.5 border-b border-border bg-muted/30", isDisabled && "pointer-events-none"), children: [
|
|
999
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Tooltip, { children: [
|
|
1000
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1001
|
+
chunkVGP3HY5Y_cjs.Button,
|
|
1322
1002
|
{
|
|
1323
1003
|
type: "button",
|
|
1324
1004
|
variant: "ghost",
|
|
1325
1005
|
size: "sm",
|
|
1326
|
-
className:
|
|
1006
|
+
className: chunkWIBCOQPP_cjs.cn(
|
|
1327
1007
|
"h-8 w-8 p-0 hover:bg-accent hover:text-accent-foreground",
|
|
1328
1008
|
activeFormats.bold && "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
1329
1009
|
),
|
|
@@ -1332,16 +1012,16 @@ var SmartBasicRichTextbox = ({
|
|
|
1332
1012
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bold, { className: "h-4 w-4" })
|
|
1333
1013
|
}
|
|
1334
1014
|
) }),
|
|
1335
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1015
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Bold (Ctrl+B)" }) })
|
|
1336
1016
|
] }) }),
|
|
1337
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1338
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1339
|
-
|
|
1017
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Tooltip, { children: [
|
|
1018
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1019
|
+
chunkVGP3HY5Y_cjs.Button,
|
|
1340
1020
|
{
|
|
1341
1021
|
type: "button",
|
|
1342
1022
|
variant: "ghost",
|
|
1343
1023
|
size: "sm",
|
|
1344
|
-
className:
|
|
1024
|
+
className: chunkWIBCOQPP_cjs.cn(
|
|
1345
1025
|
"h-8 w-8 p-0 hover:bg-accent hover:text-accent-foreground",
|
|
1346
1026
|
activeFormats.italic && "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
1347
1027
|
),
|
|
@@ -1350,16 +1030,16 @@ var SmartBasicRichTextbox = ({
|
|
|
1350
1030
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Italic, { className: "h-4 w-4" })
|
|
1351
1031
|
}
|
|
1352
1032
|
) }),
|
|
1353
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1033
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Italic (Ctrl+I)" }) })
|
|
1354
1034
|
] }) }),
|
|
1355
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1356
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1357
|
-
|
|
1035
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Tooltip, { children: [
|
|
1036
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1037
|
+
chunkVGP3HY5Y_cjs.Button,
|
|
1358
1038
|
{
|
|
1359
1039
|
type: "button",
|
|
1360
1040
|
variant: "ghost",
|
|
1361
1041
|
size: "sm",
|
|
1362
|
-
className:
|
|
1042
|
+
className: chunkWIBCOQPP_cjs.cn(
|
|
1363
1043
|
"h-8 w-8 p-0 hover:bg-accent hover:text-accent-foreground",
|
|
1364
1044
|
activeFormats.underline && "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
1365
1045
|
),
|
|
@@ -1368,17 +1048,17 @@ var SmartBasicRichTextbox = ({
|
|
|
1368
1048
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Underline, { className: "h-4 w-4" })
|
|
1369
1049
|
}
|
|
1370
1050
|
) }),
|
|
1371
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1051
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Underline (Ctrl+U)" }) })
|
|
1372
1052
|
] }) }),
|
|
1373
1053
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-px h-5 bg-border mx-1" }),
|
|
1374
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1375
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1376
|
-
|
|
1054
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Tooltip, { children: [
|
|
1055
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1056
|
+
chunkVGP3HY5Y_cjs.Button,
|
|
1377
1057
|
{
|
|
1378
1058
|
type: "button",
|
|
1379
1059
|
variant: "ghost",
|
|
1380
1060
|
size: "sm",
|
|
1381
|
-
className:
|
|
1061
|
+
className: chunkWIBCOQPP_cjs.cn(
|
|
1382
1062
|
"h-8 w-8 p-0 hover:bg-accent hover:text-accent-foreground",
|
|
1383
1063
|
activeFormats.bulletList && "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
1384
1064
|
),
|
|
@@ -1387,16 +1067,16 @@ var SmartBasicRichTextbox = ({
|
|
|
1387
1067
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.List, { className: "h-4 w-4" })
|
|
1388
1068
|
}
|
|
1389
1069
|
) }),
|
|
1390
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1070
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Bullet List" }) })
|
|
1391
1071
|
] }) }),
|
|
1392
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1393
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1394
|
-
|
|
1072
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(chunkWIBCOQPP_cjs.Tooltip, { children: [
|
|
1073
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1074
|
+
chunkVGP3HY5Y_cjs.Button,
|
|
1395
1075
|
{
|
|
1396
1076
|
type: "button",
|
|
1397
1077
|
variant: "ghost",
|
|
1398
1078
|
size: "sm",
|
|
1399
|
-
className:
|
|
1079
|
+
className: chunkWIBCOQPP_cjs.cn(
|
|
1400
1080
|
"h-8 w-8 p-0 hover:bg-accent hover:text-accent-foreground",
|
|
1401
1081
|
activeFormats.numberedList && "bg-primary text-primary-foreground hover:bg-primary/90"
|
|
1402
1082
|
),
|
|
@@ -1405,7 +1085,7 @@ var SmartBasicRichTextbox = ({
|
|
|
1405
1085
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ListOrdered, { className: "h-4 w-4" })
|
|
1406
1086
|
}
|
|
1407
1087
|
) }),
|
|
1408
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1088
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkWIBCOQPP_cjs.TooltipContent, { children: /* @__PURE__ */ jsxRuntime.jsx("p", { children: "Numbered List" }) })
|
|
1409
1089
|
] }) })
|
|
1410
1090
|
] }),
|
|
1411
1091
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1417,7 +1097,7 @@ var SmartBasicRichTextbox = ({
|
|
|
1417
1097
|
onKeyDown: handleKeyDown,
|
|
1418
1098
|
onFocus: handleFocus,
|
|
1419
1099
|
onBlur: handleBlur,
|
|
1420
|
-
className:
|
|
1100
|
+
className: chunkWIBCOQPP_cjs.cn(
|
|
1421
1101
|
"w-full px-3 py-2 text-sm text-foreground",
|
|
1422
1102
|
"bg-background",
|
|
1423
1103
|
"focus:outline-none",
|
|
@@ -1449,43 +1129,46 @@ var SmartBasicRichTextbox = ({
|
|
|
1449
1129
|
|
|
1450
1130
|
Object.defineProperty(exports, "SmartCheckbox", {
|
|
1451
1131
|
enumerable: true,
|
|
1452
|
-
get: function () { return
|
|
1132
|
+
get: function () { return chunkVGP3HY5Y_cjs.SmartCheckbox; }
|
|
1133
|
+
});
|
|
1134
|
+
Object.defineProperty(exports, "SmartCombobox", {
|
|
1135
|
+
enumerable: true,
|
|
1136
|
+
get: function () { return chunkVGP3HY5Y_cjs.SmartCombobox; }
|
|
1453
1137
|
});
|
|
1454
1138
|
Object.defineProperty(exports, "SmartDatePicker", {
|
|
1455
1139
|
enumerable: true,
|
|
1456
|
-
get: function () { return
|
|
1140
|
+
get: function () { return chunkVGP3HY5Y_cjs.SmartDatePicker; }
|
|
1457
1141
|
});
|
|
1458
1142
|
Object.defineProperty(exports, "SmartRadioGroup", {
|
|
1459
1143
|
enumerable: true,
|
|
1460
|
-
get: function () { return
|
|
1144
|
+
get: function () { return chunkVGP3HY5Y_cjs.SmartRadioGroup; }
|
|
1461
1145
|
});
|
|
1462
1146
|
Object.defineProperty(exports, "SmartSelect", {
|
|
1463
1147
|
enumerable: true,
|
|
1464
|
-
get: function () { return
|
|
1148
|
+
get: function () { return chunkVGP3HY5Y_cjs.SmartSelect; }
|
|
1465
1149
|
});
|
|
1466
1150
|
Object.defineProperty(exports, "SmartTags", {
|
|
1467
1151
|
enumerable: true,
|
|
1468
|
-
get: function () { return
|
|
1152
|
+
get: function () { return chunkVGP3HY5Y_cjs.SmartTags; }
|
|
1469
1153
|
});
|
|
1470
1154
|
Object.defineProperty(exports, "SmartFormProvider", {
|
|
1471
1155
|
enumerable: true,
|
|
1472
|
-
get: function () { return
|
|
1156
|
+
get: function () { return chunkWIBCOQPP_cjs.SmartFormProvider; }
|
|
1473
1157
|
});
|
|
1474
1158
|
Object.defineProperty(exports, "SmartInput", {
|
|
1475
1159
|
enumerable: true,
|
|
1476
|
-
get: function () { return
|
|
1160
|
+
get: function () { return chunkWIBCOQPP_cjs.SmartInput; }
|
|
1477
1161
|
});
|
|
1478
1162
|
Object.defineProperty(exports, "useFormField", {
|
|
1479
1163
|
enumerable: true,
|
|
1480
|
-
get: function () { return
|
|
1164
|
+
get: function () { return chunkWIBCOQPP_cjs.useFormField; }
|
|
1481
1165
|
});
|
|
1482
1166
|
Object.defineProperty(exports, "useSmartForm", {
|
|
1483
1167
|
enumerable: true,
|
|
1484
|
-
get: function () { return
|
|
1168
|
+
get: function () { return chunkWIBCOQPP_cjs.useSmartForm; }
|
|
1485
1169
|
});
|
|
1486
1170
|
exports.SmartAutoSuggestTags = SmartAutoSuggestTags;
|
|
1487
1171
|
exports.SmartBasicRichTextbox = SmartBasicRichTextbox;
|
|
1488
|
-
exports.SmartCombobox = SmartCombobox;
|
|
1489
1172
|
exports.SmartDualRangeSlider = SmartDualRangeSlider;
|
|
1490
1173
|
exports.SmartFileUpload = SmartFileUpload;
|
|
1491
1174
|
exports.SmartSlider = SmartSlider;
|