vlite3 0.7.15 → 0.8.2
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/components/Accordion/Accordion.vue.js +35 -22
- package/components/Accordion/AccordionContent.vue.js +2 -2
- package/components/Accordion/AccordionContent.vue2.js +1 -1
- package/components/Breadcrumb/Breadcrumb.vue.js +2 -2
- package/components/Breadcrumb/Breadcrumb.vue2.js +44 -44
- package/components/Carousel/Carousel.vue.js +1 -1
- package/components/Carousel/Carousel.vue2.js +3 -3
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPalette/CommandPaletteContent.vue.js +1 -1
- package/components/CommandPalette/CommandPaletteContent.vue2.js +2 -2
- package/components/Dropdown/DropdownTrigger.vue.js +1 -1
- package/components/FilePicker/FilePicker.vue.js +16 -16
- package/components/FileTree/FileTree.vue.js +5 -147
- package/components/FileTree/FileTree.vue2.js +164 -2
- package/components/FileTree/FileTreeNode.vue.js +89 -84
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/CustomFields.vue2.js +1 -1
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +133 -129
- package/components/Form/FormField.vue.d.ts +3 -0
- package/components/Form/FormField.vue.js +85 -82
- package/components/Form/FormFields.vue.d.ts +2 -0
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +55 -52
- package/components/Form/composables/useForm.d.ts +2 -0
- package/components/Form/composables/useForm.js +113 -107
- package/components/ImportData/ImportData.vue.js +157 -142
- package/components/ImportData/ImportStep1.vue.d.ts +6 -0
- package/components/ImportData/ImportStep1.vue.js +69 -61
- package/components/ImportData/ImportStep2.vue.js +5 -98
- package/components/ImportData/ImportStep2.vue2.js +105 -2
- package/components/Kanban/Kanban.vue.js +1 -1
- package/components/Kanban/Kanban.vue2.js +1 -1
- package/components/Kanban/KanbanBoard.vue.js +1 -1
- package/components/Kanban/KanbanBoard.vue2.js +92 -83
- package/components/Kanban/useKanbanBoard.d.ts +1 -1
- package/components/Kanban/useKanbanBoard.js +17 -17
- package/components/List/ListFieldRow.vue.js +4 -6
- package/components/MultiSelect/MultiSelect.vue.js +10 -4
- package/components/NavbarCommandPalette.vue.js +2 -2
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +1 -1
- package/components/PermissionMatrix/PermissionEditor.vue.d.ts +2 -0
- package/components/PermissionMatrix/PermissionEditor.vue.js +25 -23
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.d.ts +4 -1
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +2 -2
- package/components/PermissionMatrix/PermissionEditorMatrix.vue2.js +48 -45
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/components/Timeline/Timeline.vue.js +62 -57
- package/components/ToastNotification.vue.js +2 -2
- package/components/ToastNotification.vue2.js +103 -88
- package/components/Workbook/Workbook.vue.js +5 -152
- package/components/Workbook/Workbook.vue2.js +166 -2
- package/package.json +1 -1
- package/style.css +3 -3
- /package/components/ColorPicker/{ColorIro.vue2.js → ColorIro.vue.js} +0 -0
|
@@ -29,19 +29,20 @@ const me = /* @__PURE__ */ B({
|
|
|
29
29
|
error: { default: "" },
|
|
30
30
|
isUpdate: { type: Boolean, default: !1 },
|
|
31
31
|
label: {},
|
|
32
|
-
floatingActive: { type: Boolean, default: !0 }
|
|
32
|
+
floatingActive: { type: Boolean, default: !0 },
|
|
33
|
+
loading: { type: Boolean, default: !1 }
|
|
33
34
|
},
|
|
34
35
|
emits: ["change", "addonChange", "addonAction"],
|
|
35
36
|
setup(l, { emit: A }) {
|
|
36
|
-
const e = l, c = A, d = (
|
|
37
|
-
c("change", { value:
|
|
38
|
-
}, C = (
|
|
39
|
-
c("change", { value:
|
|
37
|
+
const e = l, c = A, d = (a, t) => {
|
|
38
|
+
c("change", { value: a, data: t });
|
|
39
|
+
}, C = (a) => {
|
|
40
|
+
c("change", { value: a });
|
|
40
41
|
}, F = o(() => {
|
|
41
|
-
const
|
|
42
|
-
if (y(
|
|
43
|
-
return N(
|
|
44
|
-
switch (
|
|
42
|
+
const a = e.field.type;
|
|
43
|
+
if (y(a))
|
|
44
|
+
return N(a);
|
|
45
|
+
switch (a) {
|
|
45
46
|
case "text":
|
|
46
47
|
case "email":
|
|
47
48
|
case "password":
|
|
@@ -78,17 +79,17 @@ const me = /* @__PURE__ */ B({
|
|
|
78
79
|
return x;
|
|
79
80
|
}
|
|
80
81
|
}), z = o(() => {
|
|
81
|
-
const
|
|
82
|
+
const a = e.field.type, t = {
|
|
82
83
|
disabled: e.disabled || e.field.disabled === !0,
|
|
83
84
|
...e?.field || {},
|
|
84
85
|
...e.field.props || {},
|
|
85
86
|
label: "",
|
|
86
87
|
labelI18n: ""
|
|
87
88
|
}, i = e.field.placeholderI18n ? D(e.field.placeholderI18n) : e.field.placeholder, g = e.variant === "floating" && e.label && !e.floatingActive, u = g ? "" : i;
|
|
88
|
-
return
|
|
89
|
-
...
|
|
89
|
+
return a === "text" || a === "email" || a === "password" || a === "tel" || a === "url" || a === "search" || a === "textarea" || !a ? {
|
|
90
|
+
...t,
|
|
90
91
|
modelValue: e.value ?? "",
|
|
91
|
-
type:
|
|
92
|
+
type: a || "text",
|
|
92
93
|
placeholder: u,
|
|
93
94
|
label: e.label,
|
|
94
95
|
icon: e.field.icon,
|
|
@@ -103,10 +104,10 @@ const me = /* @__PURE__ */ B({
|
|
|
103
104
|
min: e.field.min,
|
|
104
105
|
// kept for validation attributes if needed
|
|
105
106
|
max: e.field.max,
|
|
106
|
-
rows:
|
|
107
|
+
rows: a === "textarea" ? e.field.props?.rows || 3 : void 0,
|
|
107
108
|
class: `${e.field.className}`
|
|
108
|
-
} :
|
|
109
|
-
...
|
|
109
|
+
} : a === "number" ? {
|
|
110
|
+
...t,
|
|
110
111
|
modelValue: e.value ?? void 0,
|
|
111
112
|
min: e.field.min,
|
|
112
113
|
max: e.field.max,
|
|
@@ -117,19 +118,19 @@ const me = /* @__PURE__ */ B({
|
|
|
117
118
|
rounded: e.rounded,
|
|
118
119
|
placeholder: u,
|
|
119
120
|
class: e.field.className
|
|
120
|
-
} :
|
|
121
|
-
...
|
|
121
|
+
} : a === "switch" ? {
|
|
122
|
+
...t,
|
|
122
123
|
modelValue: !!e.value,
|
|
123
124
|
size: "sm",
|
|
124
125
|
label: ""
|
|
125
126
|
// Label handled externally
|
|
126
|
-
} :
|
|
127
|
-
...
|
|
127
|
+
} : a === "check" ? {
|
|
128
|
+
...t,
|
|
128
129
|
modelValue: !!e.value,
|
|
129
130
|
label: ""
|
|
130
131
|
// Label handled externally
|
|
131
|
-
} :
|
|
132
|
-
...
|
|
132
|
+
} : a === "select" ? {
|
|
133
|
+
...t,
|
|
133
134
|
modelValue: e.value,
|
|
134
135
|
options: e.field.options || [],
|
|
135
136
|
placeholder: u,
|
|
@@ -140,18 +141,18 @@ const me = /* @__PURE__ */ B({
|
|
|
140
141
|
size: e.size,
|
|
141
142
|
...g ? { text: "" } : {}
|
|
142
143
|
}
|
|
143
|
-
} :
|
|
144
|
-
...
|
|
144
|
+
} : a === "multiSelect" ? {
|
|
145
|
+
...t,
|
|
145
146
|
modelValue: Array.isArray(e.value) ? e.value : [],
|
|
146
147
|
options: e.field.options || [],
|
|
147
148
|
placeholder: i,
|
|
148
149
|
variant: e.variant,
|
|
149
150
|
size: e.size,
|
|
150
151
|
rounded: e.rounded
|
|
151
|
-
} :
|
|
152
|
-
...
|
|
152
|
+
} : a === "date" || a === "time" ? {
|
|
153
|
+
...t,
|
|
153
154
|
modelValue: e.value,
|
|
154
|
-
mode:
|
|
155
|
+
mode: a === "time" ? "time" : "date",
|
|
155
156
|
placeholder: u,
|
|
156
157
|
btnProps: {
|
|
157
158
|
variant: e.variant === "floating" ? "outline-floating" : e.variant || "outline",
|
|
@@ -159,32 +160,34 @@ const me = /* @__PURE__ */ B({
|
|
|
159
160
|
class: "px-3!",
|
|
160
161
|
...g ? { text: "" } : {}
|
|
161
162
|
}
|
|
162
|
-
} :
|
|
163
|
-
...
|
|
163
|
+
} : a === "fileUploader" || a === "file" ? {
|
|
164
|
+
...t,
|
|
164
165
|
modelValue: e.value,
|
|
165
166
|
multiSelect: e.field.props?.multiple || !1,
|
|
166
167
|
maxFiles: e.field.maxFiles || e.field.props?.maxFiles,
|
|
167
168
|
fileTypes: e.field.props?.accept ? e.field.props.accept.split(",") : [],
|
|
168
169
|
returnFormat: "base64",
|
|
169
|
-
variant:
|
|
170
|
+
variant: a === "file" ? "input" : "dropzone",
|
|
170
171
|
placeholder: u,
|
|
171
172
|
size: e.size,
|
|
172
173
|
rounded: e.rounded,
|
|
173
|
-
maxSize: e.field.maxFileSize ? e.field.maxFileSize * 1024 * 1024 : void 0
|
|
174
|
-
|
|
174
|
+
maxSize: e.field.maxFileSize ? e.field.maxFileSize * 1024 * 1024 : void 0,
|
|
175
|
+
loading: e.loading
|
|
176
|
+
} : a === "avatarUpload" ? {
|
|
175
177
|
size: "2xl",
|
|
176
|
-
...
|
|
178
|
+
...t,
|
|
177
179
|
modelValue: e.value,
|
|
178
180
|
editable: !e.readonly,
|
|
179
|
-
maxSize: e.field.maxFileSize ? e.field.maxFileSize * 1024 * 1024 : void 0
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
maxSize: e.field.maxFileSize ? e.field.maxFileSize * 1024 * 1024 : void 0,
|
|
182
|
+
loading: e.loading
|
|
183
|
+
} : a === "color" ? {
|
|
184
|
+
...t,
|
|
182
185
|
modelValue: e.value || "#000000"
|
|
183
|
-
} :
|
|
184
|
-
...
|
|
186
|
+
} : a === "iconPicker" ? {
|
|
187
|
+
...t,
|
|
185
188
|
value: e.value || "lucide:smile"
|
|
186
|
-
} :
|
|
187
|
-
...
|
|
189
|
+
} : a === "customFields" ? {
|
|
190
|
+
...t,
|
|
188
191
|
label: e?.field?.label,
|
|
189
192
|
labelI18n: e?.field?.labelI18n,
|
|
190
193
|
modelValue: Array.isArray(e.value) ? e.value : [],
|
|
@@ -195,57 +198,57 @@ const me = /* @__PURE__ */ B({
|
|
|
195
198
|
size: e.size,
|
|
196
199
|
rounded: e.rounded,
|
|
197
200
|
isUpdate: e.isUpdate
|
|
198
|
-
} : y(
|
|
199
|
-
...
|
|
201
|
+
} : y(a) ? {
|
|
202
|
+
...t,
|
|
200
203
|
value: e.value,
|
|
201
204
|
values: e.values
|
|
202
|
-
} :
|
|
205
|
+
} : t;
|
|
203
206
|
}), k = o(() => {
|
|
204
|
-
const
|
|
205
|
-
return
|
|
207
|
+
const a = e.field.type;
|
|
208
|
+
return a === "text" || a === "email" || a === "password" || a === "tel" || a === "url" || a === "search" || a === "textarea" || a === "switch" || a === "check" || a === "number" || !a ? {
|
|
206
209
|
"update:modelValue": C
|
|
207
|
-
} :
|
|
208
|
-
onSelect: (
|
|
209
|
-
d(
|
|
210
|
+
} : a === "select" ? {
|
|
211
|
+
onSelect: (t) => {
|
|
212
|
+
d(t.value, t.data);
|
|
210
213
|
}
|
|
211
|
-
} :
|
|
212
|
-
change: (
|
|
213
|
-
} :
|
|
214
|
-
change: (
|
|
215
|
-
} :
|
|
216
|
-
change: (
|
|
217
|
-
d(
|
|
214
|
+
} : a === "multiSelect" ? {
|
|
215
|
+
change: (t) => d(t)
|
|
216
|
+
} : a === "date" || a === "time" ? {
|
|
217
|
+
change: (t) => d(t)
|
|
218
|
+
} : a === "fileUploader" || a === "file" ? {
|
|
219
|
+
change: (t) => {
|
|
220
|
+
d(t);
|
|
218
221
|
},
|
|
219
|
-
"update:modelValue": (
|
|
220
|
-
d(
|
|
222
|
+
"update:modelValue": (t) => {
|
|
223
|
+
d(t);
|
|
221
224
|
}
|
|
222
|
-
} :
|
|
223
|
-
change: (
|
|
224
|
-
d(
|
|
225
|
+
} : a === "avatarUpload" ? {
|
|
226
|
+
change: (t) => {
|
|
227
|
+
d(t);
|
|
225
228
|
},
|
|
226
|
-
"update:modelValue": (
|
|
227
|
-
d(
|
|
229
|
+
"update:modelValue": (t) => {
|
|
230
|
+
d(t);
|
|
228
231
|
}
|
|
229
|
-
} :
|
|
230
|
-
change: (
|
|
231
|
-
} :
|
|
232
|
-
onSelect: (
|
|
233
|
-
} :
|
|
234
|
-
change: (
|
|
235
|
-
} : y(
|
|
236
|
-
onChange: (
|
|
237
|
-
d(
|
|
232
|
+
} : a === "color" ? {
|
|
233
|
+
change: (t) => d(t)
|
|
234
|
+
} : a === "iconPicker" ? {
|
|
235
|
+
onSelect: (t) => d(t)
|
|
236
|
+
} : a === "customFields" ? {
|
|
237
|
+
change: (t) => d(t)
|
|
238
|
+
} : y(a) ? {
|
|
239
|
+
onChange: (t) => {
|
|
240
|
+
d(t.value, t.data);
|
|
238
241
|
}
|
|
239
242
|
} : {};
|
|
240
243
|
}), P = o(() => v(e.field.addonLeft) || v(e.field.addonRight)), U = o(() => {
|
|
241
|
-
const
|
|
242
|
-
return
|
|
243
|
-
}), I = o(() => P.value && U.value), V = (
|
|
244
|
-
c("addonChange",
|
|
245
|
-
}, S = (
|
|
246
|
-
|
|
244
|
+
const a = e.field.type;
|
|
245
|
+
return a === "text" || a === "email" || a === "password" || a === "tel" || a === "url" || a === "search" || !a;
|
|
246
|
+
}), I = o(() => P.value && U.value), V = (a, t) => {
|
|
247
|
+
c("addonChange", a.name, { value: t.value });
|
|
248
|
+
}, S = (a) => {
|
|
249
|
+
a.action && c("addonAction", a.action);
|
|
247
250
|
};
|
|
248
|
-
return (
|
|
251
|
+
return (a, t) => I.value ? (r(), s(x, f({ key: 0 }, {
|
|
249
252
|
...z.value,
|
|
250
253
|
...l.field?.props || {}
|
|
251
254
|
}, R(k.value)), O({ _: 2 }, [
|
|
@@ -257,7 +260,7 @@ const me = /* @__PURE__ */ B({
|
|
|
257
260
|
modelValue: l.field.addonLeft.name ? l.values[l.field.addonLeft.name] : void 0,
|
|
258
261
|
options: l.field.addonLeft.options || []
|
|
259
262
|
}, l.field.addonLeft.props || {}, {
|
|
260
|
-
onOnSelect:
|
|
263
|
+
onOnSelect: t[0] || (t[0] = (i) => V(l.field.addonLeft, i))
|
|
261
264
|
}), {
|
|
262
265
|
trigger: n(({ selectedLabel: i }) => [
|
|
263
266
|
$(h, { variant: "outline" }, {
|
|
@@ -272,7 +275,7 @@ const me = /* @__PURE__ */ B({
|
|
|
272
275
|
key: 1,
|
|
273
276
|
variant: "outline"
|
|
274
277
|
}, l.field.addonLeft.props || {}, {
|
|
275
|
-
onClick:
|
|
278
|
+
onClick: t[1] || (t[1] = (i) => S(l.field.addonLeft))
|
|
276
279
|
}), {
|
|
277
280
|
default: n(() => [
|
|
278
281
|
m(p(l.field.addonLeft.text), 1)
|
|
@@ -290,7 +293,7 @@ const me = /* @__PURE__ */ B({
|
|
|
290
293
|
modelValue: l.field.addonRight.name ? l.values[l.field.addonRight.name] : void 0,
|
|
291
294
|
options: l.field.addonRight.options || []
|
|
292
295
|
}, l.field.addonRight.props || {}, {
|
|
293
|
-
onOnSelect:
|
|
296
|
+
onOnSelect: t[2] || (t[2] = (i) => V(l.field.addonRight, i))
|
|
294
297
|
}), {
|
|
295
298
|
trigger: n(({ selectedLabel: i }) => [
|
|
296
299
|
$(h, { variant: "outline" }, {
|
|
@@ -305,7 +308,7 @@ const me = /* @__PURE__ */ B({
|
|
|
305
308
|
key: 1,
|
|
306
309
|
variant: "outline"
|
|
307
310
|
}, l.field.addonRight.props || {}, {
|
|
308
|
-
onClick:
|
|
311
|
+
onClick: t[3] || (t[3] = (i) => S(l.field.addonRight))
|
|
309
312
|
}), {
|
|
310
313
|
default: n(() => [
|
|
311
314
|
m(p(l.field.addonRight.text), 1)
|
|
@@ -4,6 +4,7 @@ interface Props {
|
|
|
4
4
|
schema: IForm[];
|
|
5
5
|
values: Record<string, any>;
|
|
6
6
|
errors: Record<string, string>;
|
|
7
|
+
fieldLoading?: Record<string, boolean>;
|
|
7
8
|
variant?: InputVariant;
|
|
8
9
|
size?: InputSize;
|
|
9
10
|
rounded?: InputRounded;
|
|
@@ -29,5 +30,6 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
29
30
|
rounded: InputRounded;
|
|
30
31
|
showRequiredAsterisk: boolean;
|
|
31
32
|
isUpdate: boolean;
|
|
33
|
+
fieldLoading: Record<string, boolean>;
|
|
32
34
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
33
35
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./FormFields.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const e = /* @__PURE__ */ r(o, [["__scopeId", "data-v-df08a3e5"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as M, computed as O, ref as
|
|
2
|
-
import { isComponent as v, getNestedValue as
|
|
1
|
+
import { defineComponent as M, computed as O, ref as j, openBlock as s, createElementBlock as r, normalizeClass as d, Fragment as y, renderList as G, withMemo as J, createBlock as h, withCtx as L, unref as R, resolveDynamicComponent as z, createTextVNode as k, toDisplayString as p, createCommentVNode as c, createElementVNode as K, createVNode as P, markRaw as Q } from "vue";
|
|
2
|
+
import { isComponent as v, getNestedValue as W } from "./utils/form.utils.js";
|
|
3
3
|
import U from "../Label.vue.js";
|
|
4
|
-
import
|
|
5
|
-
import { $t as
|
|
6
|
-
const
|
|
4
|
+
import X from "./FormField.vue.js";
|
|
5
|
+
import { $t as Y } from "../../utils/i18n.js";
|
|
6
|
+
const Z = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "text-destructive ml-0.5"
|
|
9
|
-
},
|
|
9
|
+
}, _ = ["onFocusin", "onFocusout"], ee = ["for"], te = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "text-destructive ml-0.5"
|
|
12
12
|
}, ne = {
|
|
@@ -21,6 +21,7 @@ const Y = {
|
|
|
21
21
|
schema: {},
|
|
22
22
|
values: {},
|
|
23
23
|
errors: {},
|
|
24
|
+
fieldLoading: { default: () => ({}) },
|
|
24
25
|
variant: { default: "outline" },
|
|
25
26
|
size: { default: "md" },
|
|
26
27
|
rounded: { default: "md" },
|
|
@@ -32,19 +33,19 @@ const Y = {
|
|
|
32
33
|
isFieldReadonly: {}
|
|
33
34
|
},
|
|
34
35
|
emits: ["change", "addonAction"],
|
|
35
|
-
setup(
|
|
36
|
-
const
|
|
37
|
-
if (
|
|
38
|
-
}), F = (t) =>
|
|
36
|
+
setup(a, { emit: q }) {
|
|
37
|
+
const o = a, g = q, D = O(() => {
|
|
38
|
+
if (o.className) return o.className;
|
|
39
|
+
}), F = (t) => W(o.values, t.name), l = (t) => o.errors[t.name] || "", $ = (t) => o.isFieldVisible ? o.isFieldVisible(t) : !0, x = (t) => o.isFieldDisabled ? o.isFieldDisabled(t) : t.disabled === !0, A = (t) => o.isFieldReadonly ? o.isFieldReadonly(t) : t.readonly === !0, u = (t) => t.labelI18n ? Y(t.labelI18n) : t.label, w = (t) => {
|
|
39
40
|
if (t)
|
|
40
|
-
return v(t) ?
|
|
41
|
+
return v(t) ? Q(t) : t;
|
|
41
42
|
}, B = (t, n) => {
|
|
42
43
|
g("change", t.name, n);
|
|
43
|
-
}, I = (t) => t.itemClass || "",
|
|
44
|
+
}, I = (t) => t.itemClass || "", f = (t, n) => {
|
|
44
45
|
g("change", t, n);
|
|
45
|
-
},
|
|
46
|
+
}, E = (t) => {
|
|
46
47
|
g("addonAction", t);
|
|
47
|
-
}, m =
|
|
48
|
+
}, m = j({}), T = (t) => {
|
|
48
49
|
m.value[t] = !0;
|
|
49
50
|
}, S = (t) => {
|
|
50
51
|
m.value[t] = !1;
|
|
@@ -55,7 +56,7 @@ const Y = {
|
|
|
55
56
|
const n = t.type || "text";
|
|
56
57
|
return ["text", "email", "password", "tel", "url", "search", "textarea"].includes(n);
|
|
57
58
|
}, H = (t) => t.type === "number" ? (t.props?.variant ?? "split") === "split" ? "left-4" : "left-3" : t.type === "date" || t.type === "time" || t.type === "color" ? "left-10" : "left-3", b = (t) => {
|
|
58
|
-
if (
|
|
59
|
+
if (o.variant !== "floating") return !1;
|
|
59
60
|
const n = t.type || "text";
|
|
60
61
|
return ![
|
|
61
62
|
"switch",
|
|
@@ -70,47 +71,48 @@ const Y = {
|
|
|
70
71
|
if (!(!n || v(n)))
|
|
71
72
|
return n;
|
|
72
73
|
};
|
|
73
|
-
return (t, n) => (
|
|
74
|
-
class: d(["grid",
|
|
74
|
+
return (t, n) => (s(), r("div", {
|
|
75
|
+
class: d(["grid", a.variant === "floating" ? "gap-5 mt-1" : "gap-4", D.value])
|
|
75
76
|
}, [
|
|
76
|
-
(
|
|
77
|
+
(s(!0), r(y, null, G(a.schema, (e) => (s(), r(y, {
|
|
77
78
|
key: e.name
|
|
78
79
|
}, [
|
|
79
|
-
$(e) ?
|
|
80
|
+
$(e) ? J([
|
|
80
81
|
e,
|
|
81
82
|
F(e),
|
|
82
83
|
l(e),
|
|
83
84
|
x(e),
|
|
84
85
|
A(e),
|
|
85
86
|
m.value[e.name],
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
a.variant,
|
|
88
|
+
a.size,
|
|
89
|
+
a.rounded,
|
|
90
|
+
a.isUpdate,
|
|
91
|
+
a.showRequiredAsterisk,
|
|
92
|
+
a.fieldLoading[e.name]
|
|
93
|
+
], () => (s(), r("div", {
|
|
92
94
|
key: 0,
|
|
93
95
|
class: d(["max-md:col-span-full! form-field-item", I(e)])
|
|
94
96
|
}, [
|
|
95
|
-
u(e) && e.type !== "switch" && e.type !== "check" && e.type !== "customFields" && !b(e) ? (
|
|
97
|
+
u(e) && e.type !== "switch" && e.type !== "check" && e.type !== "customFields" && !b(e) ? (s(), h(U, {
|
|
96
98
|
key: 0,
|
|
97
99
|
for: e.name,
|
|
98
100
|
class: "mb-2 block text-sm font-medium"
|
|
99
101
|
}, {
|
|
100
|
-
default:
|
|
101
|
-
|
|
102
|
-
k(
|
|
103
|
-
e.required &&
|
|
102
|
+
default: L(() => [
|
|
103
|
+
R(v)(u(e)) ? (s(), h(z(w(u(e))), { key: 0 })) : (s(), r(y, { key: 1 }, [
|
|
104
|
+
k(p(u(e)) + " ", 1),
|
|
105
|
+
e.required && a.showRequiredAsterisk ? (s(), r("span", Z, "*")) : c("", !0)
|
|
104
106
|
], 64))
|
|
105
107
|
]),
|
|
106
108
|
_: 2
|
|
107
109
|
}, 1032, ["for"])) : c("", !0),
|
|
108
|
-
|
|
110
|
+
K("div", {
|
|
109
111
|
class: d(["relative", ["switch", "check"].includes(e.type) ? "w-auto" : "w-full"]),
|
|
110
|
-
onFocusin: (i) =>
|
|
112
|
+
onFocusin: (i) => T(e.name),
|
|
111
113
|
onFocusout: (i) => S(e.name)
|
|
112
114
|
}, [
|
|
113
|
-
b(e) && N(e) && !V(e) ? (
|
|
115
|
+
b(e) && N(e) && !V(e) ? (s(), r("label", {
|
|
114
116
|
key: 0,
|
|
115
117
|
for: e.name,
|
|
116
118
|
class: d([
|
|
@@ -118,13 +120,13 @@ const Y = {
|
|
|
118
120
|
C(e) ? "-top-2.5 left-3 text-xs bg-background px-1 text-black shadow-[0_4px_4px_-4px_bg-background]" : `top-1/2 -translate-y-1/2 text-sm text-muted-foreground/70 ${H(e)}`
|
|
119
121
|
])
|
|
120
122
|
}, [
|
|
121
|
-
|
|
122
|
-
k(
|
|
123
|
-
e.required ? (
|
|
123
|
+
R(v)(u(e)) ? (s(), h(z(w(u(e))), { key: 0 })) : (s(), r(y, { key: 1 }, [
|
|
124
|
+
k(p(u(e)) + " ", 1),
|
|
125
|
+
e.required ? (s(), r("span", te, "*")) : c("", !0)
|
|
124
126
|
], 64))
|
|
125
127
|
], 10, ee)) : c("", !0),
|
|
126
|
-
|
|
127
|
-
field:
|
|
128
|
+
P(X, {
|
|
129
|
+
field: o.variant === "floating" ? {
|
|
128
130
|
...e,
|
|
129
131
|
placeholder: void 0,
|
|
130
132
|
placeholderI18n: void 0,
|
|
@@ -133,31 +135,32 @@ const Y = {
|
|
|
133
135
|
value: F(e),
|
|
134
136
|
floatingActive: C(e),
|
|
135
137
|
label: e.type === "customFields" ? void 0 : b(e) ? N(e) : void 0,
|
|
136
|
-
values:
|
|
137
|
-
variant:
|
|
138
|
-
size:
|
|
139
|
-
rounded:
|
|
138
|
+
values: a.values,
|
|
139
|
+
variant: a.variant,
|
|
140
|
+
size: a.size,
|
|
141
|
+
rounded: a.rounded,
|
|
140
142
|
disabled: x(e),
|
|
141
143
|
readonly: A(e),
|
|
142
144
|
error: l(e),
|
|
143
|
-
isUpdate:
|
|
145
|
+
isUpdate: a.isUpdate,
|
|
146
|
+
loading: a.fieldLoading[e.name],
|
|
144
147
|
onChange: (i) => B(e, i),
|
|
145
|
-
onAddonChange:
|
|
146
|
-
onAddonAction:
|
|
147
|
-
}, null, 8, ["field", "value", "floatingActive", "label", "values", "variant", "size", "rounded", "disabled", "readonly", "error", "isUpdate", "onChange"])
|
|
148
|
-
], 42,
|
|
149
|
-
u(e) && (e.type === "switch" || e.type === "check") ? (
|
|
148
|
+
onAddonChange: f,
|
|
149
|
+
onAddonAction: E
|
|
150
|
+
}, null, 8, ["field", "value", "floatingActive", "label", "values", "variant", "size", "rounded", "disabled", "readonly", "error", "isUpdate", "loading", "onChange"])
|
|
151
|
+
], 42, _),
|
|
152
|
+
u(e) && (e.type === "switch" || e.type === "check") ? (s(), h(U, {
|
|
150
153
|
key: 1,
|
|
151
154
|
for: e.name,
|
|
152
155
|
class: "ml-2 text-sm font-medium cursor-pointer"
|
|
153
156
|
}, {
|
|
154
|
-
default:
|
|
155
|
-
k(
|
|
156
|
-
e.required ? (
|
|
157
|
+
default: L(() => [
|
|
158
|
+
k(p(u(e)) + " ", 1),
|
|
159
|
+
e.required ? (s(), r("span", ne, "*")) : c("", !0)
|
|
157
160
|
]),
|
|
158
161
|
_: 2
|
|
159
162
|
}, 1032, ["for"])) : c("", !0),
|
|
160
|
-
l(e) ? (
|
|
163
|
+
l(e) ? (s(), r("p", ae, p(l(e)), 1)) : c("", !0)
|
|
161
164
|
], 2)), n, 0) : c("", !0)
|
|
162
165
|
], 64))), 128))
|
|
163
166
|
], 2));
|
|
@@ -17,6 +17,8 @@ export interface UseFormReturn {
|
|
|
17
17
|
isSubmitting: Ref<boolean>;
|
|
18
18
|
/** Whether form has been modified */
|
|
19
19
|
isDirty: Ref<boolean>;
|
|
20
|
+
/** Loading state of individual fields (e.g. file uploads) */
|
|
21
|
+
fieldLoading: Ref<Record<string, boolean>>;
|
|
20
22
|
/** Handle field value change */
|
|
21
23
|
handleFieldChange: (name: string, value: any, data?: any) => void;
|
|
22
24
|
/** Validate a single field */
|