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,19 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { defineComponent as k, computed as R, openBlock as d, createElementBlock as a, normalizeClass as u, unref as t, normalizeStyle as x, createCommentVNode as s, Fragment as g, renderList as y, toDisplayString as c, createVNode as B, withCtx as T, isMemoSame as N, createBlock as S, createElementVNode as h } from "vue";
|
|
2
|
+
import { useBreakpoints as z, breakpointsTailwind as C } from "@vueuse/core";
|
|
3
|
+
import { VueDraggable as F } from "vue-draggable-plus";
|
|
4
|
+
import U from "./TableRow.vue.js";
|
|
5
|
+
const V = {
|
|
5
6
|
key: 0,
|
|
6
7
|
class: "w-10 flex-none p-3 border-r border-border"
|
|
7
8
|
}, D = {
|
|
8
9
|
key: 1,
|
|
9
10
|
class: "w-10 flex-none p-3 text-center border-r border-border"
|
|
10
|
-
},
|
|
11
|
+
}, H = {
|
|
11
12
|
key: 2,
|
|
12
13
|
class: "p-3 border-l border-border"
|
|
13
|
-
},
|
|
14
|
-
key: 1,
|
|
15
|
-
class: "flex flex-col items-center justify-center py-6 text-center bg-muted/5"
|
|
16
|
-
}, E = { class: "text-sm font-medium text-foreground" }, j = { class: "text-xs text-muted-foreground mt-1" }, M = /* @__PURE__ */ y({
|
|
14
|
+
}, E = { class: "text-sm font-medium text-foreground" }, K = { class: "text-xs text-muted-foreground mt-1" }, q = /* @__PURE__ */ k({
|
|
17
15
|
__name: "TableView",
|
|
18
16
|
props: {
|
|
19
17
|
rows: {},
|
|
@@ -30,80 +28,104 @@ const U = { class: "custom-fields-table border border-border rounded overflow-hi
|
|
|
30
28
|
helpers: {},
|
|
31
29
|
emptyTitle: {},
|
|
32
30
|
emptyDescription: {},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
variant: { default: "outline" },
|
|
32
|
+
size: { default: "md" },
|
|
33
|
+
rounded: { default: "md" },
|
|
34
|
+
rowTitleKey: { default: void 0 },
|
|
35
|
+
onFieldChange: {},
|
|
36
|
+
onRemoveRow: {},
|
|
37
|
+
onDragUpdate: {}
|
|
36
38
|
},
|
|
37
39
|
setup(e) {
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
return
|
|
40
|
+
const o = e, r = z(C).smaller("md"), f = R(() => {
|
|
41
|
+
const l = [];
|
|
42
|
+
return o.draggable && !o.disabled && !o.readonly && l.push("2.5rem"), o.showRowNumbers && l.push("2.5rem"), l.push(...o.visibleSchemaFields.map(() => "minmax(0, 1fr)")), o.canRemoveRow && l.push("2.5rem"), l.join(" ");
|
|
41
43
|
});
|
|
42
|
-
return (
|
|
43
|
-
|
|
44
|
+
return (l, v) => (d(), a("div", {
|
|
45
|
+
class: u([
|
|
46
|
+
"custom-fields-table min-w-0 max-w-full w-full",
|
|
47
|
+
t(r) ? "is-stacked bg-transparent" : "border border-border rounded overflow-hidden bg-background"
|
|
48
|
+
])
|
|
49
|
+
}, [
|
|
50
|
+
!t(r) && e.columnHeaders.length > 1 ? (d(), a("div", {
|
|
44
51
|
key: 0,
|
|
45
52
|
class: "grid border-b border-border bg-muted/50 text-gray-800 text-xs font-semibold uppercase tracking-wider min-w-0",
|
|
46
|
-
style:
|
|
53
|
+
style: x({ gridTemplateColumns: f.value })
|
|
47
54
|
}, [
|
|
48
|
-
e.draggable && !e.disabled && !e.readonly ? (
|
|
49
|
-
e.showRowNumbers ? (
|
|
50
|
-
(
|
|
51
|
-
key:
|
|
52
|
-
class:
|
|
53
|
-
},
|
|
54
|
-
e.canRemoveRow ? (
|
|
55
|
-
], 4)) :
|
|
56
|
-
|
|
55
|
+
e.draggable && !e.disabled && !e.readonly ? (d(), a("div", V)) : s("", !0),
|
|
56
|
+
e.showRowNumbers ? (d(), a("div", D, " # ")) : s("", !0),
|
|
57
|
+
(d(!0), a(g, null, y(e.columnHeaders, (n, i) => (d(), a("div", {
|
|
58
|
+
key: i,
|
|
59
|
+
class: u(["p-3 min-w-0 truncate", { "border-l border-border": i > 0 }])
|
|
60
|
+
}, c(n), 3))), 128)),
|
|
61
|
+
e.canRemoveRow ? (d(), a("div", H)) : s("", !0)
|
|
62
|
+
], 4)) : s("", !0),
|
|
63
|
+
B(t(F), {
|
|
57
64
|
"model-value": e.rows,
|
|
58
65
|
"onUpdate:modelValue": e.onDragUpdate,
|
|
59
66
|
disabled: !e.draggable || e.disabled || e.readonly,
|
|
60
67
|
animation: 150,
|
|
61
68
|
handle: ".drag-handle",
|
|
62
69
|
"ghost-class": "opacity-50",
|
|
63
|
-
class: "divide-y divide-border
|
|
70
|
+
class: u(["min-w-0", t(r) ? "space-y-3" : "divide-y divide-border"])
|
|
64
71
|
}, {
|
|
65
|
-
default:
|
|
66
|
-
(
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
default: T(() => [
|
|
73
|
+
(d(!0), a(g, null, y(e.rows, (n, i, A, m) => {
|
|
74
|
+
const b = [
|
|
75
|
+
n,
|
|
76
|
+
i,
|
|
70
77
|
e.visibleSchemaFields,
|
|
78
|
+
e.columnHeaders,
|
|
71
79
|
e.disabled,
|
|
72
80
|
e.readonly,
|
|
73
81
|
e.isUpdate,
|
|
74
82
|
e.showRowNumbers,
|
|
75
83
|
e.canRemoveRow,
|
|
76
84
|
e.draggable,
|
|
77
|
-
|
|
85
|
+
t(r),
|
|
86
|
+
e.variant,
|
|
87
|
+
e.size,
|
|
88
|
+
e.rounded,
|
|
89
|
+
e.rowTitleKey,
|
|
90
|
+
e.helpers.getRowErrorsHash(i)
|
|
78
91
|
];
|
|
79
|
-
if (
|
|
80
|
-
const
|
|
81
|
-
key:
|
|
82
|
-
row:
|
|
83
|
-
"row-index":
|
|
92
|
+
if (m && m.key === n._id && N(m, b)) return m;
|
|
93
|
+
const w = (d(), S(U, {
|
|
94
|
+
key: n._id,
|
|
95
|
+
row: n,
|
|
96
|
+
"row-index": i,
|
|
84
97
|
fields: e.visibleSchemaFields,
|
|
98
|
+
"column-headers": e.columnHeaders,
|
|
85
99
|
draggable: e.draggable,
|
|
86
100
|
disabled: e.disabled,
|
|
87
101
|
readonly: e.readonly,
|
|
88
102
|
"is-update": e.isUpdate,
|
|
89
103
|
"show-row-numbers": e.showRowNumbers,
|
|
90
104
|
"can-remove-row": e.canRemoveRow,
|
|
105
|
+
"is-stacked": t(r),
|
|
106
|
+
variant: e.variant,
|
|
107
|
+
size: e.size,
|
|
108
|
+
rounded: e.rounded,
|
|
109
|
+
"row-title-key": e.rowTitleKey,
|
|
91
110
|
helpers: e.helpers,
|
|
92
111
|
"on-field-change": e.onFieldChange,
|
|
93
112
|
"on-remove-row": e.onRemoveRow
|
|
94
|
-
}, null, 8, ["row", "row-index", "fields", "draggable", "disabled", "readonly", "is-update", "show-row-numbers", "can-remove-row", "helpers", "on-field-change", "on-remove-row"]));
|
|
95
|
-
return
|
|
96
|
-
},
|
|
113
|
+
}, null, 8, ["row", "row-index", "fields", "column-headers", "draggable", "disabled", "readonly", "is-update", "show-row-numbers", "can-remove-row", "is-stacked", "variant", "size", "rounded", "row-title-key", "helpers", "on-field-change", "on-remove-row"]));
|
|
114
|
+
return w.memo = b, w;
|
|
115
|
+
}, v, 0), 128))
|
|
97
116
|
]),
|
|
98
117
|
_: 1
|
|
99
|
-
}, 8, ["model-value", "onUpdate:modelValue", "disabled"]),
|
|
100
|
-
e.rows.length === 0 ? (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
118
|
+
}, 8, ["model-value", "onUpdate:modelValue", "disabled", "class"]),
|
|
119
|
+
e.rows.length === 0 ? (d(), a("div", {
|
|
120
|
+
key: 1,
|
|
121
|
+
class: u(["flex flex-col items-center justify-center py-6 text-center bg-muted/5", t(r) ? "border border-border rounded" : ""])
|
|
122
|
+
}, [
|
|
123
|
+
h("p", E, c(e.emptyTitle), 1),
|
|
124
|
+
h("p", K, c(e.emptyDescription), 1)
|
|
125
|
+
], 2)) : s("", !0)
|
|
126
|
+
], 2));
|
|
105
127
|
}
|
|
106
128
|
});
|
|
107
129
|
export {
|
|
108
|
-
|
|
130
|
+
q as default
|
|
109
131
|
};
|
|
@@ -1,101 +1,105 @@
|
|
|
1
|
-
import { shallowRef as
|
|
2
|
-
import { deepClone as A, initializeFormValues as se, cleanSubmitValues as ie, getNestedValue as
|
|
1
|
+
import { shallowRef as V, computed as ae, watch as le } from "vue";
|
|
2
|
+
import { deepClone as A, initializeFormValues as se, cleanSubmitValues as ie, getNestedValue as Q, evaluateConditional as j, setNestedValue as I, collectFileFields as re, filterNullCustomFields as oe } from "../utils/form.utils.js";
|
|
3
3
|
import { useFileUpload as ne } from "./useFileUpload.js";
|
|
4
4
|
import { resolveI18nText as ue } from "../../../utils/i18n.js";
|
|
5
5
|
function he(M) {
|
|
6
|
-
let { schema:
|
|
7
|
-
const { handleUploadFile: O } = ne(),
|
|
8
|
-
|
|
6
|
+
let { schema: X, values: F, isUpdate: h = !1, folderId: C, onSubmit: R } = M;
|
|
7
|
+
const { handleUploadFile: O } = ne(), i = V(F ? A(F) : {}), y = V({}), D = V(!1), z = V(!1), E = V({}), x = V(X), N = V(
|
|
8
|
+
F ? A(F) : {}
|
|
9
9
|
), S = (e, t) => {
|
|
10
10
|
if (t) {
|
|
11
|
-
if (
|
|
12
|
-
|
|
11
|
+
if (y.value[e] === t) return;
|
|
12
|
+
y.value = { ...y.value, [e]: t };
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
-
if (!(e in
|
|
16
|
-
const
|
|
17
|
-
delete
|
|
18
|
-
},
|
|
15
|
+
if (!(e in y.value)) return;
|
|
16
|
+
const n = { ...y.value };
|
|
17
|
+
delete n[e], y.value = n;
|
|
18
|
+
}, w = (e, t) => {
|
|
19
19
|
E.value[e] !== t && (E.value = { ...E.value, [e]: t });
|
|
20
20
|
}, U = ae(() => {
|
|
21
21
|
const e = x.value;
|
|
22
22
|
return e ? Array.isArray(e[0]) ? e.flat() : e : [];
|
|
23
23
|
}), P = async (e) => {
|
|
24
24
|
try {
|
|
25
|
-
const t = await se(x.value, e,
|
|
26
|
-
|
|
25
|
+
const t = await se(x.value, e, i.value, h);
|
|
26
|
+
i.value = t, N.value = A(t), z.value = !1;
|
|
27
27
|
} catch (t) {
|
|
28
28
|
console.error("[useForm] Initialization error:", t);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
|
-
P(
|
|
32
|
-
() =>
|
|
31
|
+
P(F), le(
|
|
32
|
+
() => F,
|
|
33
33
|
(e) => {
|
|
34
34
|
e && P(e);
|
|
35
35
|
},
|
|
36
36
|
{ deep: !0 }
|
|
37
37
|
);
|
|
38
38
|
const T = () => ({
|
|
39
|
-
values:
|
|
40
|
-
globalValues:
|
|
41
|
-
isUpdate:
|
|
42
|
-
}), W = (e) =>
|
|
39
|
+
values: i.value,
|
|
40
|
+
globalValues: i.value,
|
|
41
|
+
isUpdate: h
|
|
42
|
+
}), W = (e) => Q(i.value, e), Y = (e) => y.value[e] || "", H = (e, t) => {
|
|
43
43
|
S(e, t);
|
|
44
44
|
}, k = () => {
|
|
45
|
-
Object.keys(
|
|
46
|
-
}, $ = (e) => e.when ? j(e.when, T()) : !0, L = (e) => j(e.disabled, T()), G = (e) => j(e.readonly, T()), B = async (e, t = "") => {
|
|
47
|
-
const
|
|
48
|
-
let
|
|
49
|
-
const
|
|
45
|
+
Object.keys(y.value).length !== 0 && (y.value = {});
|
|
46
|
+
}, $ = (e) => e.when ? j(e.when, T()) : !0, L = (e) => j(e.disabled, T()), G = (e) => j(e.readonly, T()), B = async (e, t = "", n = i.value) => {
|
|
47
|
+
const u = t ? `${t}.${e.name}` : e.name, l = W(u);
|
|
48
|
+
let a = "";
|
|
49
|
+
const d = typeof e.label == "string" ? e.label : e.name, s = ue(e.labelI18n, d) ?? d;
|
|
50
50
|
if (e.required) {
|
|
51
|
-
const
|
|
52
|
-
(
|
|
51
|
+
const c = typeof l == "string" && /<\/?[a-z][^>]*>/i.test(l) && l.replace(/<[^>]*>/g, "").replace(/ /gi, " ").trim() === "";
|
|
52
|
+
(l == null || l === "" || Array.isArray(l) && l.length === 0 || c) && (a = `${s} is required`);
|
|
53
53
|
}
|
|
54
|
-
if (!
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
const
|
|
58
|
-
for (const p of
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
|
|
54
|
+
if (!a && e.maxFileSize) {
|
|
55
|
+
const c = e.maxFileSize * 1024 * 1024;
|
|
56
|
+
if (l != null && l !== "") {
|
|
57
|
+
const g = Array.isArray(l) ? l : [l];
|
|
58
|
+
for (const p of g) {
|
|
59
|
+
const r = p instanceof File ? p.size : p?.fileSize || p?.file?.size || p?.size;
|
|
60
|
+
if (r !== void 0 && r > c) {
|
|
61
|
+
a = `${s} size must be less than ${e.maxFileSize}MB`;
|
|
62
62
|
break;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
if (!
|
|
68
|
-
const
|
|
69
|
-
|
|
67
|
+
if (!a && (e.type === "file" || e.type === "fileUploader") && (e.props?.multiple || e.maxFiles)) {
|
|
68
|
+
const c = e.maxFiles || e.props?.maxFiles;
|
|
69
|
+
c && Array.isArray(l) && l.length > c && (a = `Maximum ${c} files allowed`);
|
|
70
70
|
}
|
|
71
|
-
if (!
|
|
72
|
-
|
|
71
|
+
if (!a && e.validation) {
|
|
72
|
+
w(u, !0);
|
|
73
73
|
try {
|
|
74
|
-
|
|
75
|
-
value:
|
|
76
|
-
values:
|
|
77
|
-
globalValues:
|
|
78
|
-
isUpdate:
|
|
74
|
+
a = await e.validation({
|
|
75
|
+
value: l,
|
|
76
|
+
values: n,
|
|
77
|
+
globalValues: i.value,
|
|
78
|
+
isUpdate: h
|
|
79
79
|
});
|
|
80
|
-
} catch (
|
|
81
|
-
console.error(`[useForm] Validation error in field ${
|
|
80
|
+
} catch (c) {
|
|
81
|
+
console.error(`[useForm] Validation error in field ${u}:`, c), a = "Validation failed";
|
|
82
82
|
} finally {
|
|
83
|
-
|
|
83
|
+
w(u, !1);
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
if (S(
|
|
87
|
-
const
|
|
86
|
+
if (S(u, a), e.type === "customFields" && e.props?.schema) {
|
|
87
|
+
const c = e.props.schema, g = Array.isArray(l) ? l : [];
|
|
88
88
|
let p = !1;
|
|
89
|
-
for (let
|
|
90
|
-
const
|
|
91
|
-
for (const
|
|
92
|
-
const
|
|
93
|
-
|
|
89
|
+
for (let r = 0; r < g.length; r++) {
|
|
90
|
+
const f = g[r] || {}, o = { values: f, globalValues: i.value, isUpdate: h };
|
|
91
|
+
for (const m of c) {
|
|
92
|
+
const v = !m.when || j(m.when, o), K = j(m.disabled, o);
|
|
93
|
+
v && !K ? await B(
|
|
94
|
+
m,
|
|
95
|
+
`${u}.${r}`,
|
|
96
|
+
f
|
|
97
|
+
) && (p = !0) : S(`${u}.${r}.${m.name}`, "");
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
|
-
p && !
|
|
100
|
+
p && !a && (a = "Please fix errors in the list.", S(u, a));
|
|
97
101
|
}
|
|
98
|
-
return
|
|
102
|
+
return a;
|
|
99
103
|
}, J = async () => {
|
|
100
104
|
k();
|
|
101
105
|
let e = !0;
|
|
@@ -104,151 +108,151 @@ function he(M) {
|
|
|
104
108
|
await B(t) && (e = !1);
|
|
105
109
|
}
|
|
106
110
|
return e;
|
|
107
|
-
},
|
|
108
|
-
const
|
|
109
|
-
let
|
|
110
|
-
if (!
|
|
111
|
+
}, Z = async (e, t, n) => {
|
|
112
|
+
const u = U.value.filter((a) => a.name === e);
|
|
113
|
+
let l = u.find((a) => $(a));
|
|
114
|
+
if (!l && u.length > 0 && (l = u[0]), l && (!$(l) || L(l) || G(l))) {
|
|
111
115
|
console.warn(`[vlite3/useForm] Blocked attempted update to disabled/readonly/hidden field: ${e}`);
|
|
112
116
|
return;
|
|
113
117
|
}
|
|
114
|
-
if (
|
|
115
|
-
|
|
118
|
+
if (i.value = I(i.value, e, t), z.value = !0, S(e, ""), l?.updateValues) {
|
|
119
|
+
w(e, !0);
|
|
116
120
|
try {
|
|
117
|
-
const
|
|
121
|
+
const a = await l.updateValues({
|
|
118
122
|
value: t,
|
|
119
123
|
// Exposing the explicitly requested value
|
|
120
|
-
values:
|
|
121
|
-
globalValues:
|
|
122
|
-
data:
|
|
123
|
-
isUpdate:
|
|
124
|
+
values: i.value,
|
|
125
|
+
globalValues: i.value,
|
|
126
|
+
data: n,
|
|
127
|
+
isUpdate: h,
|
|
124
128
|
updateError: H
|
|
125
129
|
});
|
|
126
|
-
|
|
127
|
-
} catch (
|
|
128
|
-
console.error(`[useForm] Error in updateValues for ${e}:`,
|
|
130
|
+
a && typeof a == "object" && (i.value = { ...i.value, ...a });
|
|
131
|
+
} catch (a) {
|
|
132
|
+
console.error(`[useForm] Error in updateValues for ${e}:`, a);
|
|
129
133
|
} finally {
|
|
130
|
-
|
|
134
|
+
w(e, !1);
|
|
131
135
|
}
|
|
132
136
|
}
|
|
133
|
-
},
|
|
134
|
-
const e = A(
|
|
135
|
-
let
|
|
136
|
-
|
|
137
|
-
const
|
|
138
|
-
...typeof
|
|
139
|
-
fileName:
|
|
140
|
-
fileUrl:
|
|
141
|
-
fileType:
|
|
142
|
-
fileSize:
|
|
137
|
+
}, _ = async () => {
|
|
138
|
+
const e = A(i.value), t = re(x.value, e, i.value, h), n = (a, d) => {
|
|
139
|
+
let s = null;
|
|
140
|
+
a instanceof File ? s = a : a && typeof a == "object" && a.file instanceof File && (s = a.file);
|
|
141
|
+
const c = {
|
|
142
|
+
...typeof a == "object" ? a : {},
|
|
143
|
+
fileName: a?.fileName || s?.name || d.split("/").pop() || "unknown",
|
|
144
|
+
fileUrl: d,
|
|
145
|
+
fileType: a?.fileType || s?.type || "application/octet-stream",
|
|
146
|
+
fileSize: a?.fileSize || s?.size || 0
|
|
143
147
|
};
|
|
144
|
-
return delete
|
|
145
|
-
},
|
|
146
|
-
const { name:
|
|
147
|
-
if (
|
|
148
|
-
const
|
|
149
|
-
|
|
148
|
+
return delete c.file, delete c.base64, c;
|
|
149
|
+
}, u = t.map(async (a) => {
|
|
150
|
+
const { name: d, value: s, field: c } = a;
|
|
151
|
+
if (a.type === "thumbnailSelector") {
|
|
152
|
+
const r = s, f = Array.isArray(r.images) ? r.images : [], o = r.thumbnail;
|
|
153
|
+
w(d, !0);
|
|
150
154
|
try {
|
|
151
|
-
const
|
|
152
|
-
|
|
153
|
-
if (
|
|
154
|
-
const q = await (await fetch(
|
|
155
|
-
return await O(te, C) ||
|
|
155
|
+
const m = await Promise.all(
|
|
156
|
+
f.map(async (b) => {
|
|
157
|
+
if (b.startsWith("data:image/")) {
|
|
158
|
+
const q = await (await fetch(b)).blob(), te = new File([q], `thumbnail-${Date.now()}.${q.type.split("/")[1] || "jpg"}`, { type: q.type });
|
|
159
|
+
return await O(te, C) || b;
|
|
156
160
|
}
|
|
157
|
-
return
|
|
161
|
+
return b;
|
|
158
162
|
})
|
|
159
163
|
);
|
|
160
|
-
let
|
|
161
|
-
if (
|
|
162
|
-
const
|
|
163
|
-
|
|
164
|
+
let v = o;
|
|
165
|
+
if (o && o.startsWith("data:image/")) {
|
|
166
|
+
const b = f.indexOf(o);
|
|
167
|
+
b !== -1 && m[b] && (v = m[b]);
|
|
164
168
|
}
|
|
165
|
-
return { name:
|
|
169
|
+
return { name: d, value: { images: m, thumbnail: v } };
|
|
166
170
|
} finally {
|
|
167
|
-
|
|
171
|
+
w(d, !1);
|
|
168
172
|
}
|
|
169
173
|
}
|
|
170
|
-
const
|
|
171
|
-
(
|
|
172
|
-
) :
|
|
173
|
-
|
|
174
|
+
const g = c.returnFileObject === !0, p = Array.isArray(s) ? s.some(
|
|
175
|
+
(r) => r instanceof File || r && typeof r == "object" && r.file instanceof File
|
|
176
|
+
) : s instanceof File || s && typeof s == "object" && s.file instanceof File;
|
|
177
|
+
p && w(d, !0);
|
|
174
178
|
try {
|
|
175
|
-
if (Array.isArray(
|
|
176
|
-
const
|
|
177
|
-
if (
|
|
178
|
-
const
|
|
179
|
-
return
|
|
179
|
+
if (Array.isArray(s)) {
|
|
180
|
+
const r = s.map(async (o) => {
|
|
181
|
+
if (o instanceof File || o && typeof o == "object" && o.file instanceof File) {
|
|
182
|
+
const v = await O(o, C);
|
|
183
|
+
return v ? g ? n(o, v) : v : null;
|
|
180
184
|
}
|
|
181
|
-
if (
|
|
182
|
-
const
|
|
183
|
-
return delete
|
|
185
|
+
if (o && typeof o == "object") {
|
|
186
|
+
const v = { ...o };
|
|
187
|
+
return delete v.file, delete v.base64, v;
|
|
184
188
|
}
|
|
185
|
-
return
|
|
186
|
-
}),
|
|
187
|
-
return { name:
|
|
189
|
+
return o;
|
|
190
|
+
}), f = await Promise.all(r);
|
|
191
|
+
return { name: d, value: f };
|
|
188
192
|
} else {
|
|
189
|
-
if (
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
return { name:
|
|
193
|
-
} else if (
|
|
194
|
-
const
|
|
195
|
-
return delete
|
|
193
|
+
if (s instanceof File || s && typeof s == "object" && s.file instanceof File) {
|
|
194
|
+
const f = await O(s, C);
|
|
195
|
+
if (f)
|
|
196
|
+
return { name: d, value: g ? n(s, f) : f };
|
|
197
|
+
} else if (s && typeof s == "object") {
|
|
198
|
+
const f = { ...s };
|
|
199
|
+
return delete f.file, delete f.base64, { name: d, value: f };
|
|
196
200
|
}
|
|
197
201
|
return null;
|
|
198
202
|
}
|
|
199
203
|
} finally {
|
|
200
|
-
|
|
204
|
+
p && w(d, !1);
|
|
201
205
|
}
|
|
202
206
|
});
|
|
203
|
-
return (await Promise.all(
|
|
204
|
-
|
|
207
|
+
return (await Promise.all(u)).forEach((a) => {
|
|
208
|
+
a && (Object.assign(e, I(e, a.name, a.value)), i.value = I(i.value, a.name, a.value));
|
|
205
209
|
}), e;
|
|
206
|
-
},
|
|
210
|
+
}, ee = (e) => {
|
|
207
211
|
const t = { ...e };
|
|
208
|
-
for (const
|
|
209
|
-
if ($(
|
|
210
|
-
const
|
|
211
|
-
if (Array.isArray(
|
|
212
|
-
const
|
|
213
|
-
Object.assign(t, I(t,
|
|
212
|
+
for (const n of U.value)
|
|
213
|
+
if ($(n) && n.type === "customFields" && n.props?.schema) {
|
|
214
|
+
const u = Q(t, n.name);
|
|
215
|
+
if (Array.isArray(u)) {
|
|
216
|
+
const l = oe(u, n.props.schema);
|
|
217
|
+
Object.assign(t, I(t, n.name, l));
|
|
214
218
|
}
|
|
215
219
|
}
|
|
216
220
|
return t;
|
|
217
221
|
};
|
|
218
222
|
return {
|
|
219
|
-
formValues:
|
|
220
|
-
errors:
|
|
223
|
+
formValues: i,
|
|
224
|
+
errors: y,
|
|
221
225
|
isSubmitting: D,
|
|
222
226
|
isDirty: z,
|
|
223
227
|
fieldLoading: E,
|
|
224
|
-
handleFieldChange:
|
|
228
|
+
handleFieldChange: Z,
|
|
225
229
|
validateField: B,
|
|
226
230
|
validateAll: J,
|
|
227
231
|
isFieldVisible: $,
|
|
228
232
|
isFieldDisabled: L,
|
|
229
233
|
isFieldReadonly: G,
|
|
230
234
|
getFieldValue: W,
|
|
231
|
-
getFieldError:
|
|
235
|
+
getFieldError: Y,
|
|
232
236
|
setFieldError: H,
|
|
233
237
|
clearErrors: k,
|
|
234
238
|
resetForm: () => {
|
|
235
|
-
|
|
239
|
+
i.value = A(N.value), k(), z.value = !1;
|
|
236
240
|
},
|
|
237
241
|
handleSubmit: async () => {
|
|
238
242
|
if (await J()) {
|
|
239
243
|
D.value = !0;
|
|
240
244
|
try {
|
|
241
|
-
let t = await
|
|
242
|
-
t =
|
|
245
|
+
let t = await _();
|
|
246
|
+
t = ee(t), t = await ie(
|
|
243
247
|
t,
|
|
244
248
|
x.value,
|
|
245
249
|
M.emitFields,
|
|
246
250
|
void 0,
|
|
247
|
-
|
|
248
|
-
|
|
251
|
+
i.value,
|
|
252
|
+
h
|
|
249
253
|
), R && await R({
|
|
250
254
|
values: t,
|
|
251
|
-
isUpdate:
|
|
255
|
+
isUpdate: h
|
|
252
256
|
}), z.value = !1, N.value = A(t);
|
|
253
257
|
} catch (t) {
|
|
254
258
|
throw console.error("[useForm] Submit error:", t), t;
|
|
@@ -259,7 +263,7 @@ function he(M) {
|
|
|
259
263
|
},
|
|
260
264
|
flatSchema: U,
|
|
261
265
|
reinitialize: async (e, t) => {
|
|
262
|
-
e !== void 0 && (x.value = e), t !== void 0 && (
|
|
266
|
+
e !== void 0 && (x.value = e), t !== void 0 && (F = t), await P(t !== void 0 ? t : F);
|
|
263
267
|
}
|
|
264
268
|
};
|
|
265
269
|
}
|
|
@@ -22,6 +22,9 @@ interface Props {
|
|
|
22
22
|
errors?: Record<string, string>;
|
|
23
23
|
isUpdate?: boolean;
|
|
24
24
|
layout?: 'table' | 'accordion';
|
|
25
|
+
/** Row key for accordion + stacked-mobile card titles (e.g. `'label'`). */
|
|
26
|
+
rowTitleKey?: string;
|
|
27
|
+
/** @deprecated Use `rowTitleKey`. Alias kept for backward compatibility. */
|
|
25
28
|
accordionTitleKey?: string;
|
|
26
29
|
}
|
|
27
30
|
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
@@ -42,10 +45,11 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
42
45
|
modelValue: Record<string, any>[];
|
|
43
46
|
errors: Record<string, string>;
|
|
44
47
|
showRowNumbers: boolean;
|
|
45
|
-
|
|
48
|
+
rowTitleKey: string;
|
|
46
49
|
headers: string[];
|
|
47
50
|
minRows: number;
|
|
48
51
|
maxRows: number;
|
|
49
52
|
addButtonText: string;
|
|
53
|
+
accordionTitleKey: string;
|
|
50
54
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
51
55
|
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./index.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const s = /* @__PURE__ */ t(o, [["__scopeId", "data-v-63b24d19"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
s as default
|
|
7
7
|
};
|