vlite3 0.6.7 → 0.6.9
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/_virtual/_commonjsHelpers.js +6 -0
- package/_virtual/dayjs.min.js +7 -0
- package/_virtual/dayjs.min2.js +4 -0
- package/components/Barcode/Barcode.vue.d.ts +1 -1
- package/components/Breadcrumb/BreadcrumbItem.vue.js +2 -2
- package/components/ConfirmationModal.vue.js +30 -25
- package/components/DataTable/DataTableRow.vue.js +70 -64
- package/components/Date/Date.vue.d.ts +8 -0
- package/components/Date/Date.vue.js +21 -0
- package/components/Date/Date.vue2.js +4 -0
- package/components/Date/index.d.ts +1 -0
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +39 -36
- package/components/List/ListFieldRow.vue.js +150 -107
- package/components/Modal.vue.js +2 -2
- package/components/Modal.vue2.js +43 -42
- package/components/Navbar/Navbar.vue.d.ts +33 -19
- package/components/Navbar/Navbar.vue.js +295 -185
- package/components/Navbar/NavbarTabs.vue.js +1 -1
- package/components/PermissionMatrix/PermissionEditor.vue.js +37 -37
- package/components/PermissionMatrix/PermissionEditorList.vue.js +5 -154
- package/components/PermissionMatrix/PermissionEditorList.vue2.js +160 -2
- package/components/PermissionMatrix/PermissionEditorMatrix.vue.js +5 -205
- package/components/PermissionMatrix/PermissionEditorMatrix.vue2.js +204 -2
- package/components/PermissionMatrix/PermissionMatrix.vue.js +1 -1
- package/components/PermissionMatrix/PermissionMatrix.vue2.js +115 -126
- package/components/Price/Price.vue.d.ts +8 -0
- package/components/Price/Price.vue.js +26 -0
- package/components/Price/Price.vue2.js +4 -0
- package/components/Price/index.d.ts +1 -0
- package/components/Screen/Screen.vue.js +19 -19
- package/components/SidebarMenu/SidebarMenu.vue.js +95 -93
- package/components/SidebarMenu/SidebarMenuItem.vue.js +42 -42
- package/components/Tabes/Tabes.vue.d.ts +6 -0
- package/components/Tabes/Tabes.vue.js +63 -56
- package/core/config.d.ts +14 -1
- package/core/config.js +15 -9
- package/core/index.d.ts +0 -22
- package/core/index.js +17 -9
- package/index.d.ts +2 -0
- package/index.js +18 -14
- package/package.json +2 -1
- package/style.css +1 -1
- package/types/config.type.d.ts +6 -0
- package/types/navbar.type.d.ts +7 -17
|
@@ -9,9 +9,9 @@ export interface BarcodeProps {
|
|
|
9
9
|
margin?: number;
|
|
10
10
|
}
|
|
11
11
|
declare const _default: import('vue').DefineComponent<BarcodeProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BarcodeProps> & Readonly<{}>, {
|
|
12
|
+
format: string;
|
|
12
13
|
width: number;
|
|
13
14
|
height: number;
|
|
14
|
-
format: string;
|
|
15
15
|
displayValue: boolean;
|
|
16
16
|
margin: number;
|
|
17
17
|
lineColor: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./BreadcrumbItem.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-ecb5df7c"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
e as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as I, computed as l, openBlock as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as I, computed as l, openBlock as y, createBlock as h, createSlots as w, withCtx as c, createElementVNode as r, toDisplayString as f, createVNode as m, renderSlot as x } from "vue";
|
|
2
|
+
import b from "./Modal.vue.js";
|
|
3
3
|
import p from "./Button.vue.js";
|
|
4
4
|
import { $t as n } from "../utils/i18n.js";
|
|
5
|
-
const
|
|
5
|
+
const k = { class: "pb-2 px-[2px]" }, $ = { class: "mb-1.5 font-semibold text-lg" }, B = { class: "text-sm text-muted-foreground" }, S = { class: "flex w-full items-center justify-end space-x-2 px-[2px]" }, _ = /* @__PURE__ */ I({
|
|
6
6
|
__name: "ConfirmationModal",
|
|
7
7
|
props: {
|
|
8
8
|
show: { type: Boolean, default: !1 },
|
|
@@ -21,9 +21,9 @@ const b = { class: "pb-2 px-[2px]" }, k = { class: "mb-1.5 font-semibold text-lg
|
|
|
21
21
|
setup(o, { emit: u }) {
|
|
22
22
|
const t = o, d = u, a = () => {
|
|
23
23
|
d("cancel");
|
|
24
|
-
}, v = l(() => t.titleI18n ? n(t.titleI18n) : t.title),
|
|
24
|
+
}, v = l(() => t.titleI18n ? n(t.titleI18n) : t.title), g = l(
|
|
25
25
|
() => t.descriptionI18n ? n(t.descriptionI18n) : t.description
|
|
26
|
-
),
|
|
26
|
+
), T = l(() => {
|
|
27
27
|
if (t.confirmTextI18n) return n(t.confirmTextI18n);
|
|
28
28
|
if (t.confirmText) return t.confirmText;
|
|
29
29
|
const e = n("vlite.confirmation.confirm");
|
|
@@ -34,48 +34,53 @@ const b = { class: "pb-2 px-[2px]" }, k = { class: "mb-1.5 font-semibold text-lg
|
|
|
34
34
|
const e = n("vlite.confirmation.cancel");
|
|
35
35
|
return e !== "vlite.confirmation.cancel" ? e : "Cancel";
|
|
36
36
|
});
|
|
37
|
-
return (e, i) => (
|
|
37
|
+
return (e, i) => (y(), h(b, {
|
|
38
38
|
show: o.show,
|
|
39
39
|
footerClass: "border-t-0! pt-0! pb-3.5!",
|
|
40
40
|
"max-width": "max-w-[400px]",
|
|
41
41
|
onClose: a,
|
|
42
|
-
"onUpdate:show": i[1] || (i[1] = (
|
|
43
|
-
}, {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
x(e.$slots, "default")
|
|
47
|
-
])
|
|
48
|
-
]),
|
|
49
|
-
footer: s(({ close: c }) => [
|
|
50
|
-
r("div", B, [
|
|
42
|
+
"onUpdate:show": i[1] || (i[1] = (s) => !s && a())
|
|
43
|
+
}, w({
|
|
44
|
+
footer: c(({ close: s }) => [
|
|
45
|
+
r("div", S, [
|
|
51
46
|
m(p, {
|
|
52
47
|
variant: "secondary",
|
|
53
48
|
text: C.value,
|
|
54
49
|
disabled: o.loading,
|
|
55
50
|
size: "sm2",
|
|
56
51
|
onClick: () => {
|
|
57
|
-
|
|
52
|
+
s?.(), a?.();
|
|
58
53
|
}
|
|
59
54
|
}, null, 8, ["text", "disabled", "onClick"]),
|
|
60
55
|
m(p, {
|
|
61
56
|
size: "sm2",
|
|
62
57
|
variant: o.variant,
|
|
63
|
-
text:
|
|
58
|
+
text: T.value,
|
|
64
59
|
loading: o.loading,
|
|
65
|
-
onClick: i[0] || (i[0] = (
|
|
60
|
+
onClick: i[0] || (i[0] = (z) => d("confirm"))
|
|
66
61
|
}, null, 8, ["variant", "text", "loading"])
|
|
67
62
|
])
|
|
68
63
|
]),
|
|
69
|
-
default:
|
|
70
|
-
r("div",
|
|
71
|
-
r("h3",
|
|
72
|
-
r("p",
|
|
64
|
+
default: c(() => [
|
|
65
|
+
r("div", k, [
|
|
66
|
+
r("h3", $, f(v.value), 1),
|
|
67
|
+
r("p", B, f(g.value), 1)
|
|
73
68
|
])
|
|
74
69
|
]),
|
|
75
|
-
_:
|
|
76
|
-
},
|
|
70
|
+
_: 2
|
|
71
|
+
}, [
|
|
72
|
+
e.$slots?.trigger ? {
|
|
73
|
+
name: "trigger",
|
|
74
|
+
fn: c(() => [
|
|
75
|
+
x(e.$slots, "trigger", {}, () => [
|
|
76
|
+
x(e.$slots, "default")
|
|
77
|
+
])
|
|
78
|
+
]),
|
|
79
|
+
key: "0"
|
|
80
|
+
} : void 0
|
|
81
|
+
]), 1032, ["show"]));
|
|
77
82
|
}
|
|
78
83
|
});
|
|
79
84
|
export {
|
|
80
|
-
|
|
85
|
+
_ as default
|
|
81
86
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { defineComponent as C, computed as S, openBlock as s, createElementBlock as d, normalizeClass as u, withModifiers as B, createElementVNode as M, createVNode as p, createCommentVNode as N, Fragment as V, renderList as z, renderSlot as F, createBlock as m } from "vue";
|
|
2
|
+
import L from "../CheckBox.vue.js";
|
|
3
|
+
import $ from "../Price/Price.vue.js";
|
|
4
|
+
import T from "../Date/Date.vue.js";
|
|
5
|
+
const E = ["data-state"], H = { class: "flex items-center justify-center" }, I = ["title", "innerHTML"], j = /* @__PURE__ */ C({
|
|
4
6
|
__name: "DataTableRow",
|
|
5
7
|
props: {
|
|
6
8
|
row: {},
|
|
@@ -14,30 +16,23 @@ const L = ["data-state"], U = { class: "flex items-center justify-center" }, h =
|
|
|
14
16
|
compact: { type: Boolean, default: !1 }
|
|
15
17
|
},
|
|
16
18
|
emits: ["select", "rowClick"],
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
if (!(!
|
|
20
|
-
return
|
|
21
|
-
}, g = (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
month: "short",
|
|
27
|
-
day: "numeric"
|
|
28
|
-
}) : e.type === "number" ? new Intl.NumberFormat("en-US").format(Number(t)) : String(t), x = (e, t, n) => {
|
|
29
|
-
const l = [];
|
|
30
|
-
if (e.capitalize && l.push("capitalize"), e.addStatusColor) {
|
|
31
|
-
const s = w(t);
|
|
32
|
-
s && l.push(s);
|
|
19
|
+
setup(t, { emit: f }) {
|
|
20
|
+
const a = t, r = f, n = (l, i) => {
|
|
21
|
+
if (!(!l || !i))
|
|
22
|
+
return i.includes(".") ? i.split(".").reduce((e, o) => e?.[o], l) : l[i];
|
|
23
|
+
}, g = (l, i, e) => l.format ? l.format(i, e) : i == null ? "-" : l.type === "number" ? new Intl.NumberFormat("en-US").format(Number(i)) : String(i), w = (l, i, e) => {
|
|
24
|
+
const o = [];
|
|
25
|
+
if (l.capitalize && o.push("capitalize"), l.addStatusColor) {
|
|
26
|
+
const c = x(i);
|
|
27
|
+
c && o.push(c);
|
|
33
28
|
}
|
|
34
|
-
if (typeof
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
} else
|
|
38
|
-
return
|
|
39
|
-
},
|
|
40
|
-
const
|
|
29
|
+
if (typeof l.class == "function") {
|
|
30
|
+
const c = l.class(i, e);
|
|
31
|
+
c && o.push(c);
|
|
32
|
+
} else l.class && o.push(l.class);
|
|
33
|
+
return o.join(" ");
|
|
34
|
+
}, x = (l) => {
|
|
35
|
+
const i = {
|
|
41
36
|
active: "text-success font-medium",
|
|
42
37
|
inactive: "text-muted-foreground",
|
|
43
38
|
pending: "text-warning font-medium",
|
|
@@ -51,67 +46,78 @@ const L = ["data-state"], U = { class: "flex items-center justify-center" }, h =
|
|
|
51
46
|
high: "text-destructive font-medium",
|
|
52
47
|
medium: "text-warning font-medium",
|
|
53
48
|
low: "text-muted-foreground"
|
|
54
|
-
},
|
|
55
|
-
return
|
|
56
|
-
}, y = (
|
|
49
|
+
}, e = String(l).toLowerCase().replace(/[-_\s]/g, "");
|
|
50
|
+
return i[e] || "";
|
|
51
|
+
}, y = (l) => ({
|
|
57
52
|
left: "text-left",
|
|
58
53
|
center: "text-center",
|
|
59
54
|
right: "text-right"
|
|
60
|
-
})[
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
|
|
55
|
+
})[l.align || "left"], b = S(() => n(a.row, a.keyField)), k = () => {
|
|
56
|
+
r("rowClick", { row: a.row, index: a.index });
|
|
57
|
+
}, v = () => {
|
|
58
|
+
r("select", b.value);
|
|
64
59
|
};
|
|
65
|
-
return (
|
|
60
|
+
return (l, i) => (s(), d("tr", {
|
|
66
61
|
class: u(["border-b data-[state=selected]:bg-muted h-full", [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
t.hoverable ? "hover:bg-muted/20" : "",
|
|
63
|
+
t.striped && t.index % 2 === 1 ? "bg-muted/20" : "bg-background",
|
|
64
|
+
t.isSelected ? "bg-muted! hover:bg-muted/30" : "",
|
|
70
65
|
"group"
|
|
71
66
|
]]),
|
|
72
|
-
"data-state":
|
|
73
|
-
onClick:
|
|
67
|
+
"data-state": t.isSelected ? "selected" : void 0,
|
|
68
|
+
onClick: k
|
|
74
69
|
}, [
|
|
75
|
-
|
|
70
|
+
t.selectable ? (s(), d("td", {
|
|
76
71
|
key: 0,
|
|
77
|
-
class: "w-[48px] px-0 py-
|
|
72
|
+
class: "w-[48px] px-0 py-5.5! align-middle text-center",
|
|
78
73
|
style: { width: "48px" },
|
|
79
|
-
onClick:
|
|
74
|
+
onClick: i[0] || (i[0] = B(() => {
|
|
80
75
|
}, ["stop"]))
|
|
81
76
|
}, [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
"model-value":
|
|
77
|
+
M("div", H, [
|
|
78
|
+
p(L, {
|
|
79
|
+
"model-value": t.isSelected,
|
|
85
80
|
size: "xs",
|
|
86
|
-
"onUpdate:modelValue":
|
|
81
|
+
"onUpdate:modelValue": v
|
|
87
82
|
}, null, 8, ["model-value"])
|
|
88
83
|
])
|
|
89
|
-
])) :
|
|
90
|
-
(
|
|
91
|
-
key:
|
|
84
|
+
])) : N("", !0),
|
|
85
|
+
(s(!0), d(V, null, z(t.headers, (e) => (s(), d("td", {
|
|
86
|
+
key: e.field,
|
|
92
87
|
class: u(["align-middle overflow-hidden", [
|
|
93
|
-
|
|
94
|
-
y(
|
|
95
|
-
|
|
96
|
-
|
|
88
|
+
t.compact ? "p-2" : "py-2! px-3 -text-fs-1.5!",
|
|
89
|
+
y(e),
|
|
90
|
+
e.hideOnMobile ? "hidden md:table-cell" : "",
|
|
91
|
+
w(e, n(t.row, e.field), t.row)
|
|
97
92
|
]])
|
|
98
93
|
}, [
|
|
99
|
-
|
|
100
|
-
value:
|
|
101
|
-
row:
|
|
102
|
-
index:
|
|
103
|
-
field:
|
|
94
|
+
F(l.$slots, e.field, {
|
|
95
|
+
value: n(t.row, e.field),
|
|
96
|
+
row: t.row,
|
|
97
|
+
index: t.index,
|
|
98
|
+
field: e.field
|
|
104
99
|
}, () => [
|
|
105
|
-
|
|
100
|
+
e.type === "price" ? (s(), m($, {
|
|
101
|
+
key: 0,
|
|
102
|
+
value: n(t.row, e.field),
|
|
106
103
|
class: "truncate block",
|
|
107
|
-
title: String(
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
title: String(n(t.row, e.field))
|
|
105
|
+
}, null, 8, ["value", "title"])) : e.type === "date" ? (s(), m(T, {
|
|
106
|
+
key: 1,
|
|
107
|
+
value: n(t.row, e.field),
|
|
108
|
+
class: "truncate block",
|
|
109
|
+
title: String(n(t.row, e.field))
|
|
110
|
+
}, null, 8, ["value", "title"])) : (s(), d("span", {
|
|
111
|
+
key: 2,
|
|
112
|
+
class: "truncate block",
|
|
113
|
+
title: String(n(t.row, e.field)),
|
|
114
|
+
innerHTML: g(e, n(t.row, e.field), t.row)
|
|
115
|
+
}, null, 8, I))
|
|
110
116
|
])
|
|
111
117
|
], 2))), 128))
|
|
112
|
-
], 10,
|
|
118
|
+
], 10, E));
|
|
113
119
|
}
|
|
114
120
|
});
|
|
115
121
|
export {
|
|
116
|
-
|
|
122
|
+
j as default
|
|
117
123
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** The date value to format (can be string, number/timestamp, or Date object) */
|
|
3
|
+
value?: string | number | Date;
|
|
4
|
+
/** Custom format string overriding the global configuration */
|
|
5
|
+
format?: string;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLSpanElement>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineComponent as c, computed as o, openBlock as s, createElementBlock as u, toDisplayString as i } from "vue";
|
|
2
|
+
import f from "../../_virtual/dayjs.min.js";
|
|
3
|
+
import { useVLiteConfig as p } from "../../core/config.js";
|
|
4
|
+
const D = /* @__PURE__ */ c({
|
|
5
|
+
__name: "Date",
|
|
6
|
+
props: {
|
|
7
|
+
value: {},
|
|
8
|
+
format: {}
|
|
9
|
+
},
|
|
10
|
+
setup(r) {
|
|
11
|
+
const t = r, n = p(), a = o(() => t.format || n?.components?.date?.format || "MM/DD/YYYY"), m = o(() => {
|
|
12
|
+
if (!t.value) return "--";
|
|
13
|
+
const e = f(t.value);
|
|
14
|
+
return e.isValid() ? e.format(a.value) : String(t.value);
|
|
15
|
+
});
|
|
16
|
+
return (e, l) => (s(), u("span", null, i(m.value), 1));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
D as default
|
|
21
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Date } from './Date.vue';
|
|
@@ -21,7 +21,7 @@ const ve = ["dir"], ye = {
|
|
|
21
21
|
}, ke = {
|
|
22
22
|
key: 0,
|
|
23
23
|
class: "h-px bg-border my-1 mx-1"
|
|
24
|
-
}, we = ["onMouseenter"], pe = { class: "flex items-center
|
|
24
|
+
}, we = ["onMouseenter"], pe = { class: "flex items-center flex-1 min-w-0" }, xe = { class: "truncate" }, Se = {
|
|
25
25
|
key: 3,
|
|
26
26
|
class: "flex justify-center py-2"
|
|
27
27
|
}, Oe = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./Form.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-e5c8ab25"]]);
|
|
5
5
|
export {
|
|
6
6
|
p as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as le, inject as oe, computed as
|
|
1
|
+
import { defineComponent as le, inject as oe, computed as r, ref as ne, watch as G, onUnmounted as re, openBlock as o, createElementBlock as d, withModifiers as ue, normalizeClass as g, createVNode as N, unref as s, createCommentVNode as c, Fragment as de, renderList as ce, createElementVNode as p, toDisplayString as U, renderSlot as me, createBlock as S, mergeProps as $ } from "vue";
|
|
2
2
|
import { useForm as ve } from "./composables/useForm.js";
|
|
3
3
|
import H from "./FormFields.vue.js";
|
|
4
4
|
import C from "../Button.vue.js";
|
|
@@ -20,7 +20,7 @@ const he = {
|
|
|
20
20
|
}, ke = { class: "text-lg font-semibold text-foreground" }, xe = {
|
|
21
21
|
key: 0,
|
|
22
22
|
class: "text-sm text-muted-foreground mt-1"
|
|
23
|
-
}, Fe = { class: "flex items-center gap-3" },
|
|
23
|
+
}, Fe = { class: "flex items-center gap-3" }, qe = /* @__PURE__ */ le({
|
|
24
24
|
__name: "Form",
|
|
25
25
|
props: {
|
|
26
26
|
schema: {},
|
|
@@ -53,15 +53,15 @@ const he = {
|
|
|
53
53
|
const i = e, m = I, v = oe(
|
|
54
54
|
"modal-context",
|
|
55
55
|
null
|
|
56
|
-
), K = ge(), k =
|
|
56
|
+
), K = ge(), k = r(() => K?.components?.form || {}), z = r(() => i.variant ?? k.value.variant ?? "outline"), D = r(() => i.size ?? k.value.size ?? "md"), P = r(() => i.rounded ?? k.value.rounded ?? "md"), q = r(
|
|
57
57
|
() => i.showRequiredAsterisk ?? k.value.showRequiredAsterisk ?? !0
|
|
58
|
-
), J =
|
|
58
|
+
), J = r(() => i.showCancel || !!v), O = r(() => !!v), x = r(() => !i.schema || i.schema.length === 0 ? !1 : Array.isArray(i.schema[0])), n = r(() => i.tabs && i.tabs.length > 0 && x.value), l = ne(0), M = r(() => i.tabs ? i.tabs.map((a, t) => ({
|
|
59
59
|
id: a.id?.toString() || t.toString(),
|
|
60
60
|
title: a.title,
|
|
61
61
|
icon: a.icon,
|
|
62
62
|
description: a.description,
|
|
63
63
|
status: t < l.value ? "completed" : t === l.value ? "current" : "upcoming"
|
|
64
|
-
})) : []), h =
|
|
64
|
+
})) : []), h = r(() => x.value ? i.schema : [i.schema]), E = r(() => n.value ? h.value[l.value] || [] : []), {
|
|
65
65
|
formValues: F,
|
|
66
66
|
errors: b,
|
|
67
67
|
isSubmitting: y,
|
|
@@ -71,9 +71,9 @@ const he = {
|
|
|
71
71
|
isFieldVisible: A,
|
|
72
72
|
isFieldDisabled: w,
|
|
73
73
|
isFieldReadonly: T,
|
|
74
|
-
getFieldValue:
|
|
74
|
+
getFieldValue: Ae,
|
|
75
75
|
handleSubmit: Y,
|
|
76
|
-
flatSchema:
|
|
76
|
+
flatSchema: we
|
|
77
77
|
} = ve({
|
|
78
78
|
schema: i.schema,
|
|
79
79
|
values: i.values,
|
|
@@ -85,7 +85,7 @@ const he = {
|
|
|
85
85
|
}));
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
|
-
|
|
88
|
+
G(
|
|
89
89
|
() => i.loading || y.value,
|
|
90
90
|
(a) => {
|
|
91
91
|
v?.setSubmitting && v.setSubmitting(a);
|
|
@@ -93,7 +93,7 @@ const he = {
|
|
|
93
93
|
{ immediate: !0 }
|
|
94
94
|
), re(() => {
|
|
95
95
|
v?.setSubmitting && v.setSubmitting(!1);
|
|
96
|
-
}),
|
|
96
|
+
}), G(
|
|
97
97
|
() => i.values,
|
|
98
98
|
(a) => {
|
|
99
99
|
},
|
|
@@ -102,29 +102,29 @@ const he = {
|
|
|
102
102
|
const B = (a, t) => {
|
|
103
103
|
Q(a, t.value, t.data);
|
|
104
104
|
}, Z = () => {
|
|
105
|
-
if (!
|
|
105
|
+
if (!n.value) return !0;
|
|
106
106
|
const a = E.value;
|
|
107
107
|
let t = !0;
|
|
108
|
-
for (const
|
|
109
|
-
if (!A(
|
|
110
|
-
W(
|
|
108
|
+
for (const u of a) {
|
|
109
|
+
if (!A(u) || w(u)) continue;
|
|
110
|
+
W(u) && (t = !1);
|
|
111
111
|
}
|
|
112
112
|
return t;
|
|
113
|
-
}, _ =
|
|
113
|
+
}, _ = r(() => n.value ? l.value < h.value.length - 1 : !1), L = r(() => n.value ? l.value > 0 : !1), R = r(() => n.value ? l.value === h.value.length - 1 : !0), j = () => {
|
|
114
114
|
_.value && Z() && (l.value++, m("onStepChange", l.value));
|
|
115
115
|
}, ee = () => {
|
|
116
116
|
L.value && (l.value--, m("onStepChange", l.value));
|
|
117
117
|
}, te = (a, t) => {
|
|
118
118
|
t <= l.value && (l.value = t, m("onStepChange", l.value));
|
|
119
119
|
}, V = async () => {
|
|
120
|
-
if (
|
|
120
|
+
if (n.value) {
|
|
121
121
|
if (!R.value && !i.isUpdate) {
|
|
122
|
-
|
|
122
|
+
j();
|
|
123
123
|
return;
|
|
124
124
|
}
|
|
125
125
|
if (!X()) {
|
|
126
126
|
const t = h.value.findIndex(
|
|
127
|
-
(
|
|
127
|
+
(u) => u.some((f) => !!b.value[f.name])
|
|
128
128
|
);
|
|
129
129
|
t !== -1 && t !== l.value && (l.value = t, m("onStepChange", l.value));
|
|
130
130
|
return;
|
|
@@ -136,8 +136,8 @@ const he = {
|
|
|
136
136
|
}
|
|
137
137
|
}, ie = (a) => {
|
|
138
138
|
if (a.key !== "Enter") return;
|
|
139
|
-
const
|
|
140
|
-
|
|
139
|
+
const u = a.target.tagName.toLowerCase();
|
|
140
|
+
u !== "textarea" && u !== "button" && (a.preventDefault(), V());
|
|
141
141
|
}, ae = () => {
|
|
142
142
|
m("onCancel"), v && v?.close?.();
|
|
143
143
|
};
|
|
@@ -146,7 +146,7 @@ const he = {
|
|
|
146
146
|
onSubmit: ue(V, ["prevent"]),
|
|
147
147
|
onKeydown: ie
|
|
148
148
|
}, [
|
|
149
|
-
|
|
149
|
+
n.value && M.value.length > 0 ? (o(), d("div", {
|
|
150
150
|
key: 0,
|
|
151
151
|
class: g(["form-timeline", e.timelineTextPosition == "right" ? "mb-6.5" : "mb-13"])
|
|
152
152
|
}, [
|
|
@@ -159,8 +159,8 @@ const he = {
|
|
|
159
159
|
onStepClick: te
|
|
160
160
|
}, null, 8, ["steps", "activeStep", "textPosition"])
|
|
161
161
|
], 2)) : c("", !0),
|
|
162
|
-
x.value ? x.value && !
|
|
163
|
-
(o(!0), d(de, null, ce(h.value, (
|
|
162
|
+
x.value ? x.value && !n.value ? (o(), d("div", be, [
|
|
163
|
+
(o(!0), d(de, null, ce(h.value, (u, f) => (o(), d("div", {
|
|
164
164
|
key: f,
|
|
165
165
|
class: g(["form-group border rounded overflow-hidden", e.groupClass])
|
|
166
166
|
}, [
|
|
@@ -173,7 +173,7 @@ const he = {
|
|
|
173
173
|
], 2)) : c("", !0),
|
|
174
174
|
p("div", Se, [
|
|
175
175
|
N(H, {
|
|
176
|
-
schema:
|
|
176
|
+
schema: u,
|
|
177
177
|
values: s(F),
|
|
178
178
|
errors: s(b),
|
|
179
179
|
variant: z.value,
|
|
@@ -190,7 +190,7 @@ const he = {
|
|
|
190
190
|
}, null, 8, ["schema", "values", "errors", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
|
|
191
191
|
])
|
|
192
192
|
], 2))), 128))
|
|
193
|
-
])) :
|
|
193
|
+
])) : n.value ? (o(), d("div", Ce, [
|
|
194
194
|
e.tabs?.[l.value] ? (o(), d("div", {
|
|
195
195
|
key: 0,
|
|
196
196
|
class: g(["form-step-header mb-6", e.headerClass])
|
|
@@ -212,7 +212,7 @@ const he = {
|
|
|
212
212
|
isFieldDisabled: s(w),
|
|
213
213
|
isFieldReadonly: s(T),
|
|
214
214
|
onChange: B,
|
|
215
|
-
onAddonAction: t[2] || (t[2] = (
|
|
215
|
+
onAddonAction: t[2] || (t[2] = (u) => m("onAddonAction", u))
|
|
216
216
|
}, null, 8, ["schema", "values", "errors", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
|
|
217
217
|
])) : c("", !0) : (o(), d("div", he, [
|
|
218
218
|
N(H, {
|
|
@@ -229,7 +229,7 @@ const he = {
|
|
|
229
229
|
isFieldDisabled: s(w),
|
|
230
230
|
isFieldReadonly: s(T),
|
|
231
231
|
onChange: B,
|
|
232
|
-
onAddonAction: t[0] || (t[0] = (
|
|
232
|
+
onAddonAction: t[0] || (t[0] = (u) => m("onAddonAction", u))
|
|
233
233
|
}, null, 8, ["schema", "values", "errors", "variant", "size", "rounded", "className", "isUpdate", "showRequiredAsterisk", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
|
|
234
234
|
])),
|
|
235
235
|
me(a.$slots, "default", {
|
|
@@ -241,9 +241,10 @@ const he = {
|
|
|
241
241
|
e.footer ? (o(), d("div", {
|
|
242
242
|
key: 4,
|
|
243
243
|
class: g([
|
|
244
|
-
"form-footer flex items-center
|
|
244
|
+
"form-footer flex items-center gap-3",
|
|
245
245
|
e.footerClass,
|
|
246
|
-
|
|
246
|
+
n.value ? "justify-between" : "justify-end",
|
|
247
|
+
O.value ? "sticky bottom-0 z-20 bg-body pt-3.5 border-t border-border/75 -mx-4 px-4 mt-8" : "mt-6"
|
|
247
248
|
])
|
|
248
249
|
}, [
|
|
249
250
|
p("div", Fe, [
|
|
@@ -255,7 +256,7 @@ const he = {
|
|
|
255
256
|
disabled: e.loading || s(y),
|
|
256
257
|
onClick: ae
|
|
257
258
|
}, null, 8, ["text", "disabled"])) : c("", !0),
|
|
258
|
-
|
|
259
|
+
n.value && e.isUpdate && !R.value ? (o(), S(C, $({
|
|
259
260
|
key: 1,
|
|
260
261
|
type: "button",
|
|
261
262
|
variant: "primary",
|
|
@@ -265,8 +266,10 @@ const he = {
|
|
|
265
266
|
onClick: V
|
|
266
267
|
}), null, 16, ["text", "loading"])) : c("", !0)
|
|
267
268
|
]),
|
|
268
|
-
p("div",
|
|
269
|
-
|
|
269
|
+
p("div", {
|
|
270
|
+
class: g(["flex items-center gap-3", n.value && "ml-auto"])
|
|
271
|
+
}, [
|
|
272
|
+
n.value && L.value ? (o(), S(C, {
|
|
270
273
|
key: 0,
|
|
271
274
|
type: "button",
|
|
272
275
|
variant: "outline",
|
|
@@ -274,15 +277,15 @@ const he = {
|
|
|
274
277
|
text: "Previous",
|
|
275
278
|
onClick: ee
|
|
276
279
|
})) : c("", !0),
|
|
277
|
-
|
|
280
|
+
n.value && !R.value ? (o(), S(C, {
|
|
278
281
|
key: 1,
|
|
279
282
|
type: "button",
|
|
280
283
|
variant: e.isUpdate ? "outline" : "primary",
|
|
281
284
|
text: "Next",
|
|
282
285
|
iconRight: "lucide:arrow-right",
|
|
283
|
-
onClick:
|
|
286
|
+
onClick: j
|
|
284
287
|
}, null, 8, ["variant"])) : c("", !0),
|
|
285
|
-
!
|
|
288
|
+
!n.value || R.value ? (o(), S(C, $({
|
|
286
289
|
key: 2,
|
|
287
290
|
type: "submit",
|
|
288
291
|
variant: "primary",
|
|
@@ -290,11 +293,11 @@ const he = {
|
|
|
290
293
|
}, e.submitProps, {
|
|
291
294
|
loading: e.loading || s(y)
|
|
292
295
|
}), null, 16, ["text", "loading"])) : c("", !0)
|
|
293
|
-
])
|
|
296
|
+
], 2)
|
|
294
297
|
], 2)) : c("", !0)
|
|
295
298
|
], 34));
|
|
296
299
|
}
|
|
297
300
|
});
|
|
298
301
|
export {
|
|
299
|
-
|
|
302
|
+
qe as default
|
|
300
303
|
};
|