vlite3 1.4.39 → 1.4.41
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/AppShell/AppShellLayoutClassic.vue.js +27 -28
- package/components/AppShell/AppShellLayoutDashboard.vue.js +48 -48
- package/components/AppShell/AppShellLayoutDock.vue.js +51 -51
- package/components/AppShell/AppShellLayoutHeaderShell.vue.js +69 -69
- package/components/AppShell/AppShellLayoutSidebarFirst.vue.d.ts +2 -2
- package/components/AppShell/AppShellLayoutSidebarFirst.vue.js +78 -78
- package/components/AppShell/AppShellLayoutStorefront.vue.js +14 -15
- package/components/AppShell/useAppShell.d.ts +4 -0
- package/components/AppShell/useAppShell.js +45 -40
- package/components/AsyncSelect/createAsyncSelect.js +10 -10
- package/components/AttachmentsList/AttachmentsList.vue.d.ts +50 -2
- package/components/AttachmentsList/AttachmentsList.vue.js +289 -272
- package/components/AttachmentsList/types.d.ts +37 -0
- package/components/BackButton.vue.js +2 -2
- package/components/Button.vue.d.ts +1 -0
- package/components/Button.vue.js +5 -241
- package/components/Button.vue2.js +245 -2
- package/components/ButtonGroup.vue.js +2 -2
- package/components/ButtonGroup.vue2.js +4 -1
- package/components/Calendar/Calendar.vue2.js +16 -16
- package/components/Cart/CartCouponInput.vue.js +24 -24
- package/components/Cart/CartEmptyState.vue.js +4 -4
- package/components/Cart/CartLineItem.vue.js +33 -33
- package/components/Cart/CartVariant1.vue.js +3 -3
- package/components/Cart/CartVariant2.vue.js +5 -5
- package/components/Cart/CartVariant3.vue.js +25 -25
- package/components/Cart/CartVariant4.vue.js +9 -9
- package/components/CategoryManager/CategoryManager.vue2.js +18 -18
- package/components/CategoryManager/CategoryNode.vue.js +4 -4
- package/components/CategoryMenu/CategoryMenu.vue.js +3 -2
- package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +3 -2
- package/components/Chat/ChatInterface.vue.js +23 -23
- package/components/Clipboard.vue.d.ts +7 -1
- package/components/Clipboard.vue.js +19 -17
- package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +22 -22
- package/components/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +8 -8
- package/components/Comment/CommentEditor.vue.js +14 -14
- package/components/Comment/CommentItem.vue2.js +6 -6
- package/components/Comment/CommentThread.vue.js +4 -4
- package/components/DataList/DataList.vue.js +7 -7
- package/components/DataTable/DataTable.vue.d.ts +9 -0
- package/components/DataTable/DataTable.vue.js +380 -265
- package/components/DataTable/DataTableRow.vue.d.ts +23 -2
- package/components/DataTable/DataTableRow.vue.js +5 -198
- package/components/DataTable/DataTableRow.vue2.js +360 -2
- package/components/DataTable/dataTableHeaders.d.ts +18 -0
- package/components/DataTable/dataTableHeaders.js +9 -0
- package/components/DataTable/types.d.ts +11 -0
- package/components/DatePicker.vue.js +8 -9
- package/components/DateRangePicker.vue2.js +34 -34
- package/components/Dropdown/Dropdown.vue.d.ts +7 -2
- package/components/Dropdown/Dropdown.vue.js +146 -139
- package/components/Dropdown/DropdownTrigger.vue.js +6 -6
- package/components/ExportData/ExportData.vue.js +15 -15
- package/components/FilePicker/FilePickerDropzone.vue.js +16 -16
- package/components/FilePicker/FilePickerInput.vue.js +3 -2
- package/components/FilePicker/FilePreview.vue.js +3 -3
- package/components/FileTree/FileTree.vue.js +4 -4
- package/components/FileTree/FileTree.vue2.js +9 -9
- package/components/FileTree/FileTreeNode.vue.js +76 -72
- package/components/Footer/Variant1.vue.js +48 -48
- package/components/Footer/Variant2.vue.js +42 -42
- package/components/Form/AccordionView.vue.d.ts +1 -1
- package/components/Form/AccordionView.vue2.js +2 -2
- package/components/Form/AccordionView.vue3.js +61 -57
- package/components/Form/Form.vue2.js +41 -41
- package/components/Form/TableRow.vue.d.ts +7 -0
- package/components/Form/TableRow.vue.js +187 -41
- package/components/Form/TableView.vue.d.ts +11 -1
- package/components/Form/TableView.vue.js +71 -49
- package/components/Form/composables/useForm.js +146 -142
- package/components/Form/index.vue.d.ts +5 -1
- package/components/Form/index.vue.js +2 -2
- package/components/Form/index.vue2.js +44 -37
- package/components/Form/rowHelpers.d.ts +20 -0
- package/components/Form/rowHelpers.js +76 -28
- package/components/Form/types.d.ts +11 -0
- package/components/GoogleLogin.vue.js +4 -4
- package/components/IconPicker.vue.js +9 -9
- package/components/ImportData/ImportData.vue.js +11 -11
- package/components/ImportData/ImportStep1.vue.js +10 -10
- package/components/ImportData/ImportStep2.vue.js +15 -14
- package/components/Input.vue.js +133 -129
- package/components/Kanban/KanbanBoard.vue.js +1 -1
- package/components/Kanban/KanbanBoard.vue2.js +9 -9
- package/components/MultiSelect/MultiSelect.vue.js +3 -2
- package/components/Navbar/Navbar.vue.js +17 -17
- package/components/Navbar/NavbarGroup.vue.js +8 -7
- package/components/Navbar/NavbarItem.vue.js +40 -39
- package/components/Navbar/NavbarTabs.vue.js +6 -184
- package/components/Navbar/NavbarTabs.vue2.js +204 -0
- package/components/Navbar/useNavbar.js +3 -3
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +81 -77
- package/components/OTPInput/OTPInput.vue.js +24 -23
- package/components/Pagination/Pagination.vue.d.ts +1 -1
- package/components/Pagination/Pagination.vue.js +5 -274
- package/components/Pagination/Pagination.vue2.js +283 -2
- package/components/PermissionMatrix/PermissionTopBar.vue.js +19 -18
- package/components/PricingPlan/PricingPlanItem.vue.js +7 -7
- package/components/Screen/Screen.vue.d.ts +1 -1
- package/components/Screen/Screen.vue.js +21 -21
- package/components/Screen/ScreenFilter.vue.js +5 -5
- package/components/Screen/components/ScreenAddAction.vue.js +3 -3
- package/components/Screen/components/ScreenEmptyState.vue.js +10 -10
- package/components/Screen/components/ScreenExportModal.vue.js +12 -12
- package/components/Screen/components/ScreenOptionsDropdown.vue.js +5 -5
- package/components/Screen/components/ScreenToolbar.vue.js +15 -15
- package/components/SidePanel.vue.js +2 -2
- package/components/SidePanel.vue2.js +6 -6
- package/components/SidebarMenu/SidebarMenu.vue.js +77 -72
- package/components/SidebarMenu/SidebarMenuItem.vue.js +172 -168
- package/components/Slider.vue.js +123 -108
- package/components/Tabes/Tabes.vue.d.ts +8 -3
- package/components/Tabes/Tabes.vue.js +2 -2
- package/components/Tabes/Tabes.vue2.js +209 -200
- package/components/Tabes/tabes.utils.d.ts +23 -0
- package/components/Tabes/tabes.utils.js +39 -16
- package/components/Textarea.vue.d.ts +2 -0
- package/components/Textarea.vue.js +19 -16
- package/components/ThemeToggle.vue.js +8 -8
- package/components/ToastNotification.vue2.js +10 -10
- package/components/TreeConnectors/TreeConnectors.vue.d.ts +1 -1
- package/components/TreeConnectors/TreeConnectors.vue.js +13 -8
- package/components/TreeConnectors/geometry.js +77 -69
- package/components/Workbook/WorkbookAddButton.vue.js +2 -2
- package/composables/useRtl.d.ts +14 -0
- package/composables/useRtl.js +33 -0
- package/index.js +470 -471
- package/package.json +1 -1
- package/style.css +86 -1
- package/types/button.d.ts +8 -0
- package/components/Navbar/NavbarTabs.vue3.js +0 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as Ge, computed as o, inject as He, getCurrentInstance as $e, onMounted as Me, onUnmounted as _, shallowRef as ee, watch as te, nextTick as Oe, openBlock as n, createElementBlock as c, withKeys as ye, withModifiers as ae, normalizeClass as
|
|
1
|
+
import { defineComponent as Ge, computed as o, inject as He, getCurrentInstance as $e, onMounted as Me, onUnmounted as _, shallowRef as ee, watch as te, nextTick as Oe, openBlock as n, createElementBlock as c, withKeys as ye, withModifiers as ae, normalizeClass as v, createElementVNode as p, createVNode as k, mergeProps as O, toDisplayString as j, renderSlot as he, unref as l, createCommentVNode as d, createBlock as C, withCtx as be, Fragment as je, renderList as Ke, isMemoSame as Ye } from "vue";
|
|
2
2
|
import { useForm as Je } from "./composables/useForm.js";
|
|
3
3
|
import X from "./FormFields.vue.js";
|
|
4
4
|
import Qe from "./FormField.vue.js";
|
|
@@ -25,7 +25,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
25
25
|
}, ct = {
|
|
26
26
|
key: 3,
|
|
27
27
|
class: "form-step"
|
|
28
|
-
},
|
|
28
|
+
}, vt = { class: "text-lg font-semibold text-foreground" }, mt = {
|
|
29
29
|
key: 0,
|
|
30
30
|
class: "text-sm text-muted-foreground mt-1"
|
|
31
31
|
}, ft = {
|
|
@@ -139,8 +139,8 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
139
139
|
if (Array.isArray(t)) return t;
|
|
140
140
|
try {
|
|
141
141
|
const a = t({
|
|
142
|
-
values:
|
|
143
|
-
globalValues:
|
|
142
|
+
values: m.value,
|
|
143
|
+
globalValues: m.value,
|
|
144
144
|
isUpdate: i.isUpdate
|
|
145
145
|
});
|
|
146
146
|
return Array.isArray(a) ? a : [];
|
|
@@ -153,7 +153,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
153
153
|
const t = G.value, a = [];
|
|
154
154
|
for (let s = 0; s < t.length; s++) {
|
|
155
155
|
const x = t[s];
|
|
156
|
-
!Array.isArray(x) || x.length === 0 || x.some((
|
|
156
|
+
!Array.isArray(x) || x.length === 0 || x.some((me) => R(me)) && a.push({ schema: x, originalIndex: s });
|
|
157
157
|
}
|
|
158
158
|
return a;
|
|
159
159
|
}), Ae = o(
|
|
@@ -168,11 +168,11 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
168
168
|
t.set(`form-group-${a.originalIndex}`, a.schema);
|
|
169
169
|
return t;
|
|
170
170
|
}), h = o(() => u.value ? null : (T.value ? i.schema.flat() : i.schema).find((a) => at(a, {
|
|
171
|
-
values:
|
|
172
|
-
globalValues:
|
|
171
|
+
values: m.value,
|
|
172
|
+
globalValues: m.value,
|
|
173
173
|
isUpdate: i.isUpdate
|
|
174
174
|
}) === "thumbnailSelector") ?? null), P = o(() => !!h.value), {
|
|
175
|
-
formValues:
|
|
175
|
+
formValues: m,
|
|
176
176
|
errors: b,
|
|
177
177
|
isSubmitting: y,
|
|
178
178
|
fieldLoading: V,
|
|
@@ -213,7 +213,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
213
213
|
}
|
|
214
214
|
);
|
|
215
215
|
const M = (t, a) => {
|
|
216
|
-
re(t, a.value, a.data), f("onChange",
|
|
216
|
+
re(t, a.value, a.data), f("onChange", m.value);
|
|
217
217
|
}, Ve = async () => {
|
|
218
218
|
if (!u.value) return !0;
|
|
219
219
|
const t = ne.value;
|
|
@@ -253,11 +253,11 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
253
253
|
if (!a) return;
|
|
254
254
|
const s = a.tagName.toLowerCase();
|
|
255
255
|
s !== "textarea" && s !== "button" && (a.isContentEditable || (t.preventDefault(), w()));
|
|
256
|
-
},
|
|
256
|
+
}, ve = (t) => {
|
|
257
257
|
(t.metaKey || t.ctrlKey) && t.key === "s" && (t.preventDefault(), w());
|
|
258
258
|
};
|
|
259
259
|
xe({
|
|
260
|
-
formValues:
|
|
260
|
+
formValues: m,
|
|
261
261
|
errors: b,
|
|
262
262
|
isSubmitting: y,
|
|
263
263
|
handleSubmit: w,
|
|
@@ -271,17 +271,17 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
271
271
|
f("onCancel"), g && g?.close?.();
|
|
272
272
|
};
|
|
273
273
|
return (t, a) => (n(), c("form", {
|
|
274
|
-
class:
|
|
274
|
+
class: v(["form-container", i.class, e.isPage && "pb-10"]),
|
|
275
275
|
onSubmit: ae(w, ["prevent"]),
|
|
276
276
|
onKeydown: [
|
|
277
277
|
Ee,
|
|
278
|
-
ye(ae(
|
|
279
|
-
ye(ae(
|
|
278
|
+
ye(ae(ve, ["meta", "prevent"]), ["s"]),
|
|
279
|
+
ye(ae(ve, ["ctrl", "prevent"]), ["s"])
|
|
280
280
|
]
|
|
281
281
|
}, [
|
|
282
282
|
e.isPage ? (n(), c("div", {
|
|
283
283
|
key: 0,
|
|
284
|
-
class:
|
|
284
|
+
class: v([
|
|
285
285
|
"form-page-header sticky top-0 z-30 bg-background flex items-center justify-between pb-3.5 pt-4 -mt-3.5 mb-4.5",
|
|
286
286
|
e.pageHeaderClass
|
|
287
287
|
])
|
|
@@ -292,12 +292,12 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
292
292
|
class: "max-sm:w-8 max-sm:h-8 max-sm:min-w-8 max-sm:min-h-8 max-sm:px-0 shrink-0"
|
|
293
293
|
}), null, 16, ["fallback"]),
|
|
294
294
|
p("h1", {
|
|
295
|
-
class:
|
|
295
|
+
class: v(["text-foreground max-sm:text-lg text-fs-5 truncate", e.pageTitleClass])
|
|
296
296
|
}, j(ke.value), 3)
|
|
297
297
|
]),
|
|
298
298
|
p("div", st, [
|
|
299
299
|
he(t.$slots, "header-actions", {
|
|
300
|
-
values: l(
|
|
300
|
+
values: l(m),
|
|
301
301
|
isSubmitting: l(y),
|
|
302
302
|
handleSubmit: w
|
|
303
303
|
}, void 0, !0),
|
|
@@ -315,7 +315,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
315
315
|
], 2)) : d("", !0),
|
|
316
316
|
!e.schemaLoading && u.value && se.value.length > 0 ? (n(), c("div", {
|
|
317
317
|
key: 1,
|
|
318
|
-
class:
|
|
318
|
+
class: v(["form-timeline", e.timelineTextPosition == "right" ? "mb-2" : "mb-8"])
|
|
319
319
|
}, [
|
|
320
320
|
k(l(_e), {
|
|
321
321
|
steps: se.value,
|
|
@@ -327,21 +327,21 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
327
327
|
}, null, 8, ["steps", "activeStep", "textPosition"])
|
|
328
328
|
], 2)) : d("", !0),
|
|
329
329
|
p("div", {
|
|
330
|
-
class:
|
|
330
|
+
class: v(e.footer && L.value ? "pb-2" : "")
|
|
331
331
|
}, [
|
|
332
332
|
e.schemaLoading ? (n(), C(We, {
|
|
333
333
|
key: 0,
|
|
334
334
|
isGrouped: T.value
|
|
335
335
|
}, null, 8, ["isGrouped"])) : (n(), c("div", {
|
|
336
336
|
key: 1,
|
|
337
|
-
class:
|
|
337
|
+
class: v(P.value ? "flex flex-col lg:flex-row gap-10 lg:gap-16" : "")
|
|
338
338
|
}, [
|
|
339
339
|
P.value ? (n(), c("div", nt, [
|
|
340
340
|
h.value && l(R)(h.value) ? (n(), C(Qe, {
|
|
341
341
|
key: 0,
|
|
342
342
|
field: h.value,
|
|
343
|
-
value: l(
|
|
344
|
-
values: l(
|
|
343
|
+
value: l(m)[h.value.name],
|
|
344
|
+
values: l(m),
|
|
345
345
|
errors: l(b),
|
|
346
346
|
variant: U.value,
|
|
347
347
|
size: I.value,
|
|
@@ -355,17 +355,17 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
355
355
|
}, null, 8, ["field", "value", "values", "errors", "variant", "size", "rounded", "disabled", "readonly", "error", "isUpdate", "loading"])) : d("", !0)
|
|
356
356
|
])) : d("", !0),
|
|
357
357
|
p("div", {
|
|
358
|
-
class:
|
|
358
|
+
class: v(P.value ? "flex-1 min-w-0 order-last lg:order-first" : "w-full")
|
|
359
359
|
}, [
|
|
360
360
|
T.value ? T.value && !u.value && e.groupLayout === "basic" ? (n(), c("div", {
|
|
361
361
|
key: 1,
|
|
362
|
-
class:
|
|
362
|
+
class: v(["form-groups space-y-6", e.groupContainerClass])
|
|
363
363
|
}, [
|
|
364
|
-
(n(!0), c(je, null, Ke(H.value, (s, x,
|
|
364
|
+
(n(!0), c(je, null, Ke(H.value, (s, x, me, W) => {
|
|
365
365
|
const fe = [
|
|
366
366
|
s.schema,
|
|
367
367
|
s.originalIndex,
|
|
368
|
-
l(
|
|
368
|
+
l(m),
|
|
369
369
|
l(b),
|
|
370
370
|
l(V),
|
|
371
371
|
U.value,
|
|
@@ -383,7 +383,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
383
383
|
if (W && W.key === s.originalIndex && Ye(W, fe)) return W;
|
|
384
384
|
const ge = (n(), c("div", {
|
|
385
385
|
key: s.originalIndex,
|
|
386
|
-
class:
|
|
386
|
+
class: v([
|
|
387
387
|
"form-group overflow-hidden bg-body",
|
|
388
388
|
e.groupClass,
|
|
389
389
|
H.value.length > 1 ? "border rounded" : ""
|
|
@@ -391,17 +391,17 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
391
391
|
}, [
|
|
392
392
|
J.value?.[s.originalIndex] ? (n(), c("div", {
|
|
393
393
|
key: 0,
|
|
394
|
-
class:
|
|
394
|
+
class: v(["form-group-header bg-muted/50 px-4 py-2.5 border-b", e.headerClass])
|
|
395
395
|
}, [
|
|
396
396
|
p("h3", ut, j(J.value[s.originalIndex]), 1),
|
|
397
397
|
Q.value?.[s.originalIndex] ? (n(), c("p", dt, j(Q.value[s.originalIndex]), 1)) : d("", !0)
|
|
398
398
|
], 2)) : d("", !0),
|
|
399
399
|
p("div", {
|
|
400
|
-
class:
|
|
400
|
+
class: v(["form-group-body", [e.groupBodyClass, H.value.length > 1 ? "p-4.5" : ""]])
|
|
401
401
|
}, [
|
|
402
402
|
k(X, {
|
|
403
403
|
schema: s.schema,
|
|
404
|
-
values: l(
|
|
404
|
+
values: l(m),
|
|
405
405
|
errors: l(b),
|
|
406
406
|
fieldLoading: l(V),
|
|
407
407
|
variant: U.value,
|
|
@@ -423,18 +423,18 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
423
423
|
}, a, 3), 128))
|
|
424
424
|
], 2)) : T.value && !u.value && e.groupLayout === "accordion" ? (n(), c("div", {
|
|
425
425
|
key: 2,
|
|
426
|
-
class:
|
|
426
|
+
class: v(e.groupContainerClass)
|
|
427
427
|
}, [
|
|
428
428
|
k(Xe, {
|
|
429
429
|
variant: "solid",
|
|
430
430
|
items: Ae.value,
|
|
431
431
|
"allow-multiple": "",
|
|
432
|
-
class:
|
|
432
|
+
class: v(e.groupClass)
|
|
433
433
|
}, {
|
|
434
434
|
content: be(({ item: s }) => [
|
|
435
435
|
k(X, {
|
|
436
436
|
schema: Te.value.get(s.id) || [],
|
|
437
|
-
values: l(
|
|
437
|
+
values: l(m),
|
|
438
438
|
errors: l(b),
|
|
439
439
|
fieldLoading: l(V),
|
|
440
440
|
variant: U.value,
|
|
@@ -456,14 +456,14 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
456
456
|
], 2)) : u.value ? (n(), c("div", ct, [
|
|
457
457
|
e.tabs?.[r.value] ? (n(), c("div", {
|
|
458
458
|
key: 0,
|
|
459
|
-
class:
|
|
459
|
+
class: v(["form-step-header mb-6", e.headerClass])
|
|
460
460
|
}, [
|
|
461
|
-
p("h2",
|
|
462
|
-
e.tabs[r.value].description ? (n(), c("p",
|
|
461
|
+
p("h2", vt, j(e.tabs[r.value].title), 1),
|
|
462
|
+
e.tabs[r.value].description ? (n(), c("p", mt, j(e.tabs[r.value].description), 1)) : d("", !0)
|
|
463
463
|
], 2)) : d("", !0),
|
|
464
464
|
k(X, {
|
|
465
465
|
schema: ne.value,
|
|
466
|
-
values: l(
|
|
466
|
+
values: l(m),
|
|
467
467
|
errors: l(b),
|
|
468
468
|
fieldLoading: l(V),
|
|
469
469
|
variant: U.value,
|
|
@@ -482,7 +482,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
482
482
|
])) : d("", !0) : (n(), c("div", ot, [
|
|
483
483
|
k(X, {
|
|
484
484
|
schema: e.schema,
|
|
485
|
-
values: l(
|
|
485
|
+
values: l(m),
|
|
486
486
|
errors: l(b),
|
|
487
487
|
fieldLoading: l(V),
|
|
488
488
|
variant: U.value,
|
|
@@ -522,7 +522,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
522
522
|
}, 8, ["schema", "values", "errors", "fieldLoading", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly", "excludeTypes", "layout"])
|
|
523
523
|
])),
|
|
524
524
|
he(t.$slots, "default", {
|
|
525
|
-
values: l(
|
|
525
|
+
values: l(m),
|
|
526
526
|
errors: l(b),
|
|
527
527
|
isSubmitting: l(y),
|
|
528
528
|
handleSubmit: w
|
|
@@ -534,7 +534,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
534
534
|
key: 2,
|
|
535
535
|
ref_key: "footerRef",
|
|
536
536
|
ref: F,
|
|
537
|
-
class:
|
|
537
|
+
class: v([
|
|
538
538
|
"form-footer items-center gap-3 z-20 rounded-b-md!",
|
|
539
539
|
e.isPage ? "flex sm:hidden" : "flex",
|
|
540
540
|
e.footerClass,
|
|
@@ -572,7 +572,7 @@ const lt = ["onKeydown"], it = { class: "flex items-center gap-3" }, st = { clas
|
|
|
572
572
|
}), null, 16, ["text", "loading"])) : d("", !0)
|
|
573
573
|
])) : d("", !0),
|
|
574
574
|
p("div", {
|
|
575
|
-
class:
|
|
575
|
+
class: v(["flex gap-3 items-center", [
|
|
576
576
|
u.value && "ml-auto",
|
|
577
577
|
!u.value || N.value ? "w-full justify-end" : ""
|
|
578
578
|
]])
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
+
import { InputVariant, InputSize, InputRounded } from '../../types';
|
|
1
2
|
import { IForm, IFormFieldChangePayload } from './types';
|
|
2
3
|
import { CustomFieldRow, RowHelpers } from './rowHelpers';
|
|
3
4
|
interface Props {
|
|
4
5
|
row: CustomFieldRow;
|
|
5
6
|
rowIndex: number;
|
|
6
7
|
fields: IForm[];
|
|
8
|
+
columnHeaders: string[];
|
|
7
9
|
draggable: boolean;
|
|
8
10
|
disabled: boolean;
|
|
9
11
|
readonly: boolean;
|
|
10
12
|
isUpdate: boolean;
|
|
11
13
|
showRowNumbers: boolean;
|
|
12
14
|
canRemoveRow: boolean;
|
|
15
|
+
isStacked: boolean;
|
|
16
|
+
variant: InputVariant;
|
|
17
|
+
size: InputSize;
|
|
18
|
+
rounded: InputRounded;
|
|
19
|
+
rowTitleKey?: string;
|
|
13
20
|
helpers: RowHelpers;
|
|
14
21
|
onFieldChange: (rowIndex: number, fieldName: string, payload: IFormFieldChangePayload) => void;
|
|
15
22
|
onRemoveRow: (index: number) => void;
|
|
@@ -1,103 +1,249 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
1
|
+
import { defineComponent as D, computed as s, withMemo as F, openBlock as a, createElementBlock as l, createElementVNode as u, normalizeClass as m, createVNode as w, createCommentVNode as d, toDisplayString as i, createBlock as h, Fragment as f, renderList as C, withCtx as T, createTextVNode as B, unref as K, normalizeStyle as L } from "vue";
|
|
2
|
+
import S from "./FormField.vue.js";
|
|
3
|
+
import z from "../Icon.vue.js";
|
|
4
|
+
import N from "../Button.vue.js";
|
|
5
|
+
import V from "../Label.vue.js";
|
|
6
|
+
import { fieldRendersOwnErrorMessage as q, resolveFieldType as M } from "./utils/form.utils.js";
|
|
7
|
+
import { resolveCustomFieldRowTitle as G } from "./rowHelpers.js";
|
|
8
|
+
const O = { class: "flex items-center justify-between gap-2 px-3 py-2 bg-muted/30 border-b border-border" }, A = { class: "flex items-center gap-2 min-w-0 flex-1" }, J = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "text-xs font-semibold text-muted-foreground tabular-nums shrink-0"
|
|
11
|
+
}, P = ["title"], Q = { class: "flex flex-col gap-4 p-3 min-w-0" }, W = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "text-destructive ml-0.5"
|
|
14
|
+
}, X = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "text-destructive ml-0.5"
|
|
17
|
+
}, Y = {
|
|
18
|
+
key: 1,
|
|
19
|
+
class: "text-xs text-destructive"
|
|
20
|
+
}, Z = {
|
|
7
21
|
key: 1,
|
|
8
22
|
class: "w-10 flex-none flex items-center justify-center text-xs text-muted-foreground border-r border-border bg-muted/20"
|
|
9
|
-
},
|
|
23
|
+
}, p = {
|
|
10
24
|
key: 2,
|
|
11
25
|
class: "w-10 flex-none flex items-center justify-center border-l border-border bg-muted/20"
|
|
12
|
-
},
|
|
26
|
+
}, le = /* @__PURE__ */ D({
|
|
13
27
|
__name: "TableRow",
|
|
14
28
|
props: {
|
|
15
29
|
row: {},
|
|
16
30
|
rowIndex: {},
|
|
17
31
|
fields: {},
|
|
32
|
+
columnHeaders: {},
|
|
18
33
|
draggable: { type: Boolean },
|
|
19
34
|
disabled: { type: Boolean },
|
|
20
35
|
readonly: { type: Boolean },
|
|
21
36
|
isUpdate: { type: Boolean },
|
|
22
37
|
showRowNumbers: { type: Boolean },
|
|
23
38
|
canRemoveRow: { type: Boolean },
|
|
39
|
+
isStacked: { type: Boolean },
|
|
40
|
+
variant: {},
|
|
41
|
+
size: {},
|
|
42
|
+
rounded: {},
|
|
43
|
+
rowTitleKey: {},
|
|
24
44
|
helpers: {},
|
|
25
45
|
onFieldChange: { type: Function },
|
|
26
46
|
onRemoveRow: { type: Function }
|
|
27
47
|
},
|
|
28
48
|
setup(e) {
|
|
29
|
-
const o = e,
|
|
30
|
-
|
|
49
|
+
const o = e, b = s(() => o.draggable && !o.disabled && !o.readonly), k = s(() => o.helpers.getRowErrorsHash(o.rowIndex)), g = s(
|
|
50
|
+
() => G({
|
|
51
|
+
row: o.row,
|
|
52
|
+
titleKey: o.rowTitleKey,
|
|
53
|
+
schema: o.fields
|
|
54
|
+
})
|
|
55
|
+
), v = s(() => g.value || `#${o.rowIndex + 1}`), R = s(
|
|
56
|
+
() => o.showRowNumbers && !!g.value
|
|
57
|
+
), x = (r) => M(r, o.helpers.getRowContext(o.rowIndex)), U = (r) => {
|
|
58
|
+
const n = x(r);
|
|
59
|
+
return {
|
|
60
|
+
...r,
|
|
61
|
+
props: {
|
|
62
|
+
...n === "multiSelect" ? { showControls: !1, wrap: !1 } : {},
|
|
63
|
+
...n === "file" || n === "fileUploader" ? { variant: "input" } : {},
|
|
64
|
+
...n === "switch" ? { switchVariant: "basic" } : {},
|
|
65
|
+
...n === "check" ? { size: "sm" } : {},
|
|
66
|
+
...n === "color" ? { trigger: "swatch" } : {},
|
|
67
|
+
...r.props || {}
|
|
68
|
+
},
|
|
69
|
+
label: void 0
|
|
70
|
+
};
|
|
71
|
+
}, E = (r) => {
|
|
72
|
+
const n = x(r);
|
|
31
73
|
return {
|
|
32
74
|
...r,
|
|
33
75
|
props: {
|
|
34
|
-
...
|
|
35
|
-
...t === "file" || t === "fileUploader" ? { variant: "input" } : {},
|
|
36
|
-
...t === "switch" ? { switchVariant: "basic" } : {},
|
|
37
|
-
...t === "check" ? { size: "sm" } : {},
|
|
38
|
-
...t === "color" ? { trigger: "swatch" } : {},
|
|
76
|
+
...n === "switch" ? { switchVariant: "basic" } : {},
|
|
39
77
|
...r.props || {}
|
|
40
78
|
},
|
|
41
79
|
label: void 0
|
|
42
80
|
};
|
|
43
|
-
},
|
|
81
|
+
}, H = (r) => ["switch", "check"].includes(String(x(r))), I = (r) => {
|
|
82
|
+
const n = String(o.helpers.getResolvedType(r, o.rowIndex));
|
|
83
|
+
return n === "check" || n === "switch" && r.props?.switchVariant === "basic";
|
|
84
|
+
}, j = (r, n) => {
|
|
85
|
+
if (!n) return !1;
|
|
86
|
+
const t = String(o.helpers.getResolvedType(r, o.rowIndex));
|
|
87
|
+
return t !== "switch" && t !== "check" && t !== "customFields" && t !== "choiceBox";
|
|
88
|
+
}, $ = s(() => {
|
|
44
89
|
const r = [];
|
|
45
|
-
return
|
|
90
|
+
return b.value && r.push("2.5rem"), o.showRowNumbers && r.push("2.5rem"), r.push(...o.fields.map(() => "minmax(0, 1fr)")), o.canRemoveRow && r.push("2.5rem"), r.join(" ");
|
|
46
91
|
});
|
|
47
|
-
return (r,
|
|
92
|
+
return (r, n) => e.isStacked ? F([
|
|
93
|
+
e.row,
|
|
94
|
+
e.disabled,
|
|
95
|
+
e.readonly,
|
|
96
|
+
e.isUpdate,
|
|
97
|
+
e.showRowNumbers,
|
|
98
|
+
e.canRemoveRow,
|
|
99
|
+
e.draggable,
|
|
100
|
+
e.rowIndex,
|
|
101
|
+
e.columnHeaders,
|
|
102
|
+
e.variant,
|
|
103
|
+
e.size,
|
|
104
|
+
e.rounded,
|
|
105
|
+
e.rowTitleKey,
|
|
106
|
+
v.value,
|
|
107
|
+
R.value,
|
|
108
|
+
k.value
|
|
109
|
+
], () => (a(), l("div", {
|
|
110
|
+
key: 0,
|
|
111
|
+
class: "custom-fields-table-row--stacked border border-border rounded-lg overflow-hidden bg-white min-w-0"
|
|
112
|
+
}, [
|
|
113
|
+
u("div", O, [
|
|
114
|
+
u("div", A, [
|
|
115
|
+
b.value ? (a(), l("button", {
|
|
116
|
+
key: 0,
|
|
117
|
+
type: "button",
|
|
118
|
+
class: m(["drag-handle flex items-center justify-center w-8 h-8 shrink-0 rounded text-muted-foreground hover:text-foreground hover:bg-muted/50 cursor-grab active:cursor-grabbing", e.disabled ? "cursor-not-allowed opacity-50" : ""]),
|
|
119
|
+
"aria-label": "Reorder row"
|
|
120
|
+
}, [
|
|
121
|
+
w(z, {
|
|
122
|
+
icon: "lucide:grip-vertical",
|
|
123
|
+
class: "w-4 h-4"
|
|
124
|
+
})
|
|
125
|
+
], 2)) : d("", !0),
|
|
126
|
+
R.value ? (a(), l("span", J, " #" + i(e.rowIndex + 1), 1)) : d("", !0),
|
|
127
|
+
u("span", {
|
|
128
|
+
class: m(["text-sm font-medium text-foreground truncate min-w-0", g.value ? "" : "text-muted-foreground"]),
|
|
129
|
+
title: v.value
|
|
130
|
+
}, i(v.value), 11, P)
|
|
131
|
+
]),
|
|
132
|
+
e.canRemoveRow ? (a(), h(N, {
|
|
133
|
+
key: 0,
|
|
134
|
+
type: "button",
|
|
135
|
+
variant: "ghost",
|
|
136
|
+
size: "xs",
|
|
137
|
+
icon: "lucide:trash-2",
|
|
138
|
+
class: "shrink-0",
|
|
139
|
+
disabled: e.disabled || e.readonly,
|
|
140
|
+
onClick: n[0] || (n[0] = (t) => e.onRemoveRow(e.rowIndex))
|
|
141
|
+
}, null, 8, ["disabled"])) : d("", !0)
|
|
142
|
+
]),
|
|
143
|
+
u("div", Q, [
|
|
144
|
+
(a(!0), l(f, null, C(e.fields, (t, c) => (a(), l("div", {
|
|
145
|
+
key: t.name,
|
|
146
|
+
class: "flex flex-col min-w-0 gap-1.5"
|
|
147
|
+
}, [
|
|
148
|
+
e.helpers.isFieldVisible(e.rowIndex, t) ? (a(), l(f, { key: 0 }, [
|
|
149
|
+
j(t, e.columnHeaders[c] || "") ? (a(), h(V, {
|
|
150
|
+
key: 0,
|
|
151
|
+
class: "text-xs font-semibold uppercase tracking-wider text-muted-foreground"
|
|
152
|
+
}, {
|
|
153
|
+
default: T(() => [
|
|
154
|
+
B(i(e.columnHeaders[c]) + " ", 1),
|
|
155
|
+
t.required ? (a(), l("span", W, "*")) : d("", !0)
|
|
156
|
+
]),
|
|
157
|
+
_: 2
|
|
158
|
+
}, 1024)) : d("", !0),
|
|
159
|
+
u("div", {
|
|
160
|
+
class: m(["relative min-w-0", I(t) ? "w-auto flex items-center" : "w-full"])
|
|
161
|
+
}, [
|
|
162
|
+
w(S, {
|
|
163
|
+
field: E(t),
|
|
164
|
+
value: e.helpers.getFieldValue(e.rowIndex, t.name),
|
|
165
|
+
values: e.row,
|
|
166
|
+
errors: e.helpers.errors,
|
|
167
|
+
error: e.helpers.getFieldError(e.rowIndex, t.name),
|
|
168
|
+
variant: e.variant,
|
|
169
|
+
size: e.size,
|
|
170
|
+
rounded: e.rounded,
|
|
171
|
+
disabled: e.disabled || e.helpers.isFieldDisabled(e.rowIndex, t),
|
|
172
|
+
readonly: e.readonly || e.helpers.isFieldReadonly(e.rowIndex, t),
|
|
173
|
+
isUpdate: e.isUpdate,
|
|
174
|
+
class: "w-full",
|
|
175
|
+
onChange: (y) => e.onFieldChange(e.rowIndex, t.name, y)
|
|
176
|
+
}, null, 8, ["field", "value", "values", "errors", "error", "variant", "size", "rounded", "disabled", "readonly", "isUpdate", "onChange"]),
|
|
177
|
+
I(t) ? (a(), h(V, {
|
|
178
|
+
key: 0,
|
|
179
|
+
class: "ml-2 text-sm font-medium cursor-pointer"
|
|
180
|
+
}, {
|
|
181
|
+
default: T(() => [
|
|
182
|
+
B(i(e.columnHeaders[c]) + " ", 1),
|
|
183
|
+
t.required ? (a(), l("span", X, "*")) : d("", !0)
|
|
184
|
+
]),
|
|
185
|
+
_: 2
|
|
186
|
+
}, 1024)) : d("", !0)
|
|
187
|
+
], 2),
|
|
188
|
+
e.helpers.getFieldError(e.rowIndex, t.name) && !K(q)(e.helpers.getResolvedType(t, e.rowIndex)) ? (a(), l("p", Y, i(e.helpers.getFieldError(e.rowIndex, t.name)), 1)) : d("", !0)
|
|
189
|
+
], 64)) : d("", !0)
|
|
190
|
+
]))), 128))
|
|
191
|
+
])
|
|
192
|
+
])), n, 1) : F([e.row, e.disabled, e.readonly, e.isUpdate, e.showRowNumbers, e.canRemoveRow, e.draggable, e.rowIndex, k.value], () => (a(), l("div", {
|
|
193
|
+
key: 1,
|
|
48
194
|
class: "grid group bg-white transition-colors min-w-0",
|
|
49
|
-
style:
|
|
195
|
+
style: L({ gridTemplateColumns: $.value })
|
|
50
196
|
}, [
|
|
51
|
-
|
|
197
|
+
b.value ? (a(), l("div", {
|
|
52
198
|
key: 0,
|
|
53
199
|
class: m([
|
|
54
200
|
"w-10 flex-none flex items-center justify-center border-r border-border bg-muted/5 drag-handle transition-colors",
|
|
55
201
|
e.disabled ? "cursor-not-allowed opacity-50" : "cursor-grab active:cursor-grabbing hover:bg-muted/10 text-muted-foreground hover:text-foreground"
|
|
56
202
|
])
|
|
57
203
|
}, [
|
|
58
|
-
|
|
204
|
+
w(z, {
|
|
59
205
|
icon: "lucide:grip-vertical",
|
|
60
206
|
class: "w-4 h-4"
|
|
61
207
|
})
|
|
62
|
-
], 2)) :
|
|
63
|
-
e.showRowNumbers ? (a(), l("div",
|
|
64
|
-
(a(!0), l(
|
|
65
|
-
key:
|
|
208
|
+
], 2)) : d("", !0),
|
|
209
|
+
e.showRowNumbers ? (a(), l("div", Z, i(e.rowIndex + 1), 1)) : d("", !0),
|
|
210
|
+
(a(!0), l(f, null, C(e.fields, (t, c) => (a(), l("div", {
|
|
211
|
+
key: t.name,
|
|
66
212
|
class: m(["min-w-0 relative", [
|
|
67
|
-
{ "border-l border-border":
|
|
68
|
-
|
|
213
|
+
{ "border-l border-border": c > 0 },
|
|
214
|
+
H(t) ? "flex items-center px-3" : ""
|
|
69
215
|
]])
|
|
70
216
|
}, [
|
|
71
|
-
e.helpers.isFieldVisible(e.rowIndex,
|
|
217
|
+
e.helpers.isFieldVisible(e.rowIndex, t) ? (a(), h(S, {
|
|
72
218
|
key: 0,
|
|
73
|
-
field:
|
|
74
|
-
value: e.helpers.getFieldValue(e.rowIndex,
|
|
219
|
+
field: U(t),
|
|
220
|
+
value: e.helpers.getFieldValue(e.rowIndex, t.name),
|
|
75
221
|
values: e.row,
|
|
76
222
|
errors: e.helpers.errors,
|
|
77
|
-
error: e.helpers.getFieldError(e.rowIndex,
|
|
223
|
+
error: e.helpers.getFieldError(e.rowIndex, t.name),
|
|
78
224
|
variant: "transparent",
|
|
79
225
|
size: "sm",
|
|
80
226
|
rounded: "none",
|
|
81
|
-
disabled: e.disabled || e.helpers.isFieldDisabled(e.rowIndex,
|
|
82
|
-
readonly: e.readonly || e.helpers.isFieldReadonly(e.rowIndex,
|
|
227
|
+
disabled: e.disabled || e.helpers.isFieldDisabled(e.rowIndex, t),
|
|
228
|
+
readonly: e.readonly || e.helpers.isFieldReadonly(e.rowIndex, t),
|
|
83
229
|
isUpdate: e.isUpdate,
|
|
84
230
|
class: "w-full h-full min-h-[40px]",
|
|
85
|
-
onChange: (
|
|
86
|
-
}, null, 8, ["field", "value", "values", "errors", "error", "disabled", "readonly", "isUpdate", "onChange"])) :
|
|
231
|
+
onChange: (y) => e.onFieldChange(e.rowIndex, t.name, y)
|
|
232
|
+
}, null, 8, ["field", "value", "values", "errors", "error", "disabled", "readonly", "isUpdate", "onChange"])) : d("", !0)
|
|
87
233
|
], 2))), 128)),
|
|
88
|
-
e.canRemoveRow ? (a(), l("div",
|
|
89
|
-
|
|
234
|
+
e.canRemoveRow ? (a(), l("div", p, [
|
|
235
|
+
w(N, {
|
|
90
236
|
type: "button",
|
|
91
237
|
variant: "ghost",
|
|
92
238
|
size: "xs",
|
|
93
239
|
icon: "lucide:trash-2",
|
|
94
240
|
disabled: e.disabled || e.readonly,
|
|
95
|
-
onClick:
|
|
241
|
+
onClick: n[2] || (n[2] = (t) => e.onRemoveRow(e.rowIndex))
|
|
96
242
|
}, null, 8, ["disabled"])
|
|
97
|
-
])) :
|
|
98
|
-
], 4)),
|
|
243
|
+
])) : d("", !0)
|
|
244
|
+
], 4)), n, 3);
|
|
99
245
|
}
|
|
100
246
|
});
|
|
101
247
|
export {
|
|
102
|
-
|
|
248
|
+
le as default
|
|
103
249
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { InputVariant, InputSize, InputRounded } from '../../types';
|
|
1
2
|
import { IForm, IFormFieldChangePayload } from './types';
|
|
2
3
|
import { CustomFieldRow, RowHelpers } from './rowHelpers';
|
|
3
4
|
interface Props {
|
|
@@ -15,9 +16,18 @@ interface Props {
|
|
|
15
16
|
helpers: RowHelpers;
|
|
16
17
|
emptyTitle: string;
|
|
17
18
|
emptyDescription: string;
|
|
19
|
+
variant?: InputVariant;
|
|
20
|
+
size?: InputSize;
|
|
21
|
+
rounded?: InputRounded;
|
|
22
|
+
rowTitleKey?: string;
|
|
18
23
|
onFieldChange: (rowIndex: number, fieldName: string, payload: IFormFieldChangePayload) => void;
|
|
19
24
|
onRemoveRow: (index: number) => void;
|
|
20
25
|
onDragUpdate: (rows: CustomFieldRow[]) => void;
|
|
21
26
|
}
|
|
22
|
-
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
27
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
28
|
+
variant: InputVariant;
|
|
29
|
+
size: InputSize;
|
|
30
|
+
rounded: InputRounded;
|
|
31
|
+
rowTitleKey: string;
|
|
32
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
23
33
|
export default _default;
|