vlite3 0.3.8 → 0.4.3
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/Button.vue.js +32 -26
- package/components/ConfirmationModal.vue.js +30 -24
- package/components/Form/Form.vue.d.ts +3 -0
- package/components/Form/Form.vue.js +1 -1
- package/components/Form/Form.vue2.js +45 -43
- package/components/Form/composables/useForm.d.ts +1 -0
- package/components/Form/composables/useForm.js +103 -89
- package/components/Form/types.d.ts +16 -0
- package/components/Form/utils/form.utils.d.ts +7 -0
- package/components/Form/utils/form.utils.js +138 -70
- package/components/Screen/Screen.vue.js +23 -23
- package/package.json +1 -1
- package/style.css +2 -2
- package/types/button.d.ts +2 -2
package/components/Button.vue.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as B, useSlots as I, computed as r, inject as R, withDirectives as S, openBlock as s, createElementBlock as g, normalizeClass as
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent as B, useSlots as I, computed as r, inject as R, withDirectives as S, openBlock as s, createElementBlock as g, normalizeClass as i, createBlock as d, createCommentVNode as h, renderSlot as m, createTextVNode as f, toDisplayString as b, unref as G } from "vue";
|
|
2
|
+
import u from "./Icon.vue.js";
|
|
3
3
|
import { vRipple as j } from "../directives/vRipple.js";
|
|
4
4
|
const V = ["type", "disabled"], E = /* @__PURE__ */ B({
|
|
5
5
|
__name: "Button",
|
|
@@ -20,8 +20,8 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
|
|
|
20
20
|
asIcon: { type: Boolean }
|
|
21
21
|
},
|
|
22
22
|
setup(e) {
|
|
23
|
-
const
|
|
24
|
-
const
|
|
23
|
+
const n = e, x = I(), l = r(() => n?.asIcon || n.icon && !n.text && !x.default), v = R("buttonGroup", null), w = r(() => !!v?.isInGroup), p = r(() => {
|
|
24
|
+
const t = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 active:scale-[0.98] cursor-pointer gap-2", o = {
|
|
25
25
|
primary: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
26
26
|
"primary-light": "bg-primary-light text-primary-fg-light hover:bg-primary/20",
|
|
27
27
|
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
@@ -41,27 +41,31 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
|
|
|
41
41
|
"outline-success": "border border-success text-success hover:bg-success/10",
|
|
42
42
|
ghost: "hover:bg-accent hover:text-accent-foreground text-foreground",
|
|
43
43
|
link: "text-primary underline-offset-4 hover:underline"
|
|
44
|
-
},
|
|
44
|
+
}, y = {
|
|
45
45
|
xs: "h-6.5 px-2",
|
|
46
46
|
sm: "h-7.5 px-3",
|
|
47
|
+
sm2: "h-8 px-3",
|
|
47
48
|
md: "h-9 px-4 py-2",
|
|
48
49
|
lg: "h-10 px-6",
|
|
49
50
|
xl: "h-12 px-10"
|
|
50
51
|
}, z = {
|
|
51
52
|
xs: "h-6.5 w-6.5 min-h-6.5 min-w-6.5",
|
|
52
53
|
sm: "h-7 w-7 min-h-7 min-w-7",
|
|
54
|
+
sm2: "h-7 w-7 min-h-7 min-w-7",
|
|
53
55
|
md: "h-7.5 w-7.5 min-h-7.5 min-w-7.5",
|
|
54
56
|
lg: "h-8 w-8 min-h-8 min-w-8",
|
|
55
57
|
xl: "h-8.5 w-8.5 min-h-8.5 min-w-8.5"
|
|
56
58
|
}, C = {
|
|
57
59
|
xs: "px-2",
|
|
58
60
|
sm: "px-3",
|
|
61
|
+
sm2: "px-3",
|
|
59
62
|
md: "px-4",
|
|
60
63
|
lg: "px-6",
|
|
61
64
|
xl: "px-10"
|
|
62
65
|
}, k = {
|
|
63
66
|
none: "rounded-none",
|
|
64
67
|
sm: "rounded-sm",
|
|
68
|
+
sm2: "rounded-sm",
|
|
65
69
|
md: "rounded",
|
|
66
70
|
lg: "rounded-lg",
|
|
67
71
|
xl: "rounded-xl",
|
|
@@ -69,57 +73,59 @@ const V = ["type", "disabled"], E = /* @__PURE__ */ B({
|
|
|
69
73
|
full: "rounded-full"
|
|
70
74
|
};
|
|
71
75
|
let c;
|
|
72
|
-
return l.value ? c = w.value ? C[
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
k[
|
|
76
|
+
return l.value ? c = w.value ? C[n.size] : z[n.size] : c = y[n.size], [
|
|
77
|
+
t,
|
|
78
|
+
o[n.variant],
|
|
79
|
+
k[n.rounded],
|
|
76
80
|
c,
|
|
77
|
-
|
|
81
|
+
n.class
|
|
78
82
|
].join(" ");
|
|
79
83
|
}), a = r(() => {
|
|
80
|
-
const
|
|
84
|
+
const t = {
|
|
81
85
|
xs: "w-3 h-3",
|
|
82
86
|
sm: "w-4 h-4",
|
|
87
|
+
sm2: "w-4 h-4",
|
|
83
88
|
md: "w-4 h-4",
|
|
84
89
|
lg: "w-4 h-4",
|
|
85
90
|
xl: "w-4 h-4"
|
|
86
|
-
},
|
|
91
|
+
}, o = {
|
|
87
92
|
xs: "w-3 h-3",
|
|
88
93
|
sm: "w-3.5 h-3.5",
|
|
94
|
+
sm2: "w-3.5 h-3.5",
|
|
89
95
|
md: "w-3.5 h-3.5",
|
|
90
96
|
lg: "w-4 h-4",
|
|
91
97
|
xl: "w-4 h-4"
|
|
92
98
|
};
|
|
93
|
-
return l.value ?
|
|
99
|
+
return l.value ? o[n.size] : t[n.size];
|
|
94
100
|
});
|
|
95
|
-
return (
|
|
101
|
+
return (t, o) => S((s(), g("button", {
|
|
96
102
|
type: e.type,
|
|
97
|
-
class:
|
|
103
|
+
class: i(p.value),
|
|
98
104
|
disabled: e.disabled || e.loading
|
|
99
105
|
}, [
|
|
100
|
-
e.loading ? (s(), u
|
|
106
|
+
e.loading ? (s(), d(u, {
|
|
101
107
|
key: 0,
|
|
102
108
|
icon: "lucide:loader-2",
|
|
103
|
-
class:
|
|
104
|
-
}, null, 8, ["class"])) : e.icon ? (s(), u
|
|
109
|
+
class: i(["animate-spin pointer-events-none", a.value])
|
|
110
|
+
}, null, 8, ["class"])) : e.icon ? (s(), d(u, {
|
|
105
111
|
key: 1,
|
|
106
112
|
icon: e.icon,
|
|
107
|
-
class:
|
|
113
|
+
class: i(["pointer-events-none", [e.iconClass, a.value, l.value ? "mx-auto" : ""]])
|
|
108
114
|
}, null, 8, ["icon", "class"])) : h("", !0),
|
|
109
115
|
e.textClass ? (s(), g("span", {
|
|
110
116
|
key: 2,
|
|
111
|
-
class:
|
|
117
|
+
class: i(e.textClass)
|
|
112
118
|
}, [
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
m(t.$slots, "default", {}, () => [
|
|
120
|
+
f(b(e.text), 1)
|
|
115
121
|
])
|
|
116
|
-
], 2)) :
|
|
117
|
-
|
|
122
|
+
], 2)) : m(t.$slots, "default", { key: 3 }, () => [
|
|
123
|
+
f(b(e.text), 1)
|
|
118
124
|
]),
|
|
119
|
-
e.iconRight && !e.loading ? (s(), u
|
|
125
|
+
e.iconRight && !e.loading ? (s(), d(u, {
|
|
120
126
|
key: 4,
|
|
121
127
|
icon: e.iconRight,
|
|
122
|
-
class:
|
|
128
|
+
class: i([[e.iconRightClass, a.value], "h-4 w-4 pointer-events-none"])
|
|
123
129
|
}, null, 8, ["icon", "class"])) : h("", !0)
|
|
124
130
|
], 10, V)), [
|
|
125
131
|
[G(j)]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const w = { class: "flex w-full items-center justify-end space-x-2" },
|
|
1
|
+
import { defineComponent as x, openBlock as u, createBlock as g, withCtx as i, createElementVNode as n, toDisplayString as d, createVNode as c, renderSlot as r } from "vue";
|
|
2
|
+
import p from "./Modal.vue.js";
|
|
3
|
+
import m from "./Button.vue.js";
|
|
4
|
+
const h = { class: "py-2 px-[2px]" }, w = { class: "mb-1.5" }, C = { class: "text-sm text-muted" }, v = { class: "flex w-full items-center justify-end space-x-2 px-[2px]" }, B = /* @__PURE__ */ x({
|
|
5
5
|
__name: "ConfirmationModal",
|
|
6
6
|
props: {
|
|
7
7
|
show: { type: Boolean, default: !1 },
|
|
@@ -13,46 +13,52 @@ const w = { class: "flex w-full items-center justify-end space-x-2" }, k = /* @_
|
|
|
13
13
|
variant: { default: "danger" }
|
|
14
14
|
},
|
|
15
15
|
emits: ["cancel", "confirm"],
|
|
16
|
-
setup(e, { emit:
|
|
17
|
-
const
|
|
18
|
-
|
|
16
|
+
setup(e, { emit: f }) {
|
|
17
|
+
const l = f, o = () => {
|
|
18
|
+
l("cancel");
|
|
19
19
|
};
|
|
20
|
-
return (
|
|
20
|
+
return (s, t) => (u(), g(p, {
|
|
21
21
|
show: e.show,
|
|
22
|
-
title: e.title,
|
|
23
|
-
description: e.description,
|
|
24
22
|
footerClass: "border-t-0! pt-0! pb-3.5!",
|
|
25
23
|
"max-width": "max-w-[400px]",
|
|
26
|
-
onClose:
|
|
27
|
-
"onUpdate:show": t[1] || (t[1] = (
|
|
24
|
+
onClose: o,
|
|
25
|
+
"onUpdate:show": t[1] || (t[1] = (a) => !a && o())
|
|
28
26
|
}, {
|
|
29
|
-
trigger:
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
trigger: i(() => [
|
|
28
|
+
r(s.$slots, "trigger", {}, () => [
|
|
29
|
+
r(s.$slots, "default")
|
|
32
30
|
])
|
|
33
31
|
]),
|
|
34
|
-
footer:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
variant: "
|
|
32
|
+
footer: i(({ close: a }) => [
|
|
33
|
+
n("div", v, [
|
|
34
|
+
c(m, {
|
|
35
|
+
variant: "secondary",
|
|
38
36
|
text: e.cancelText,
|
|
39
37
|
disabled: e.loading,
|
|
38
|
+
size: "sm2",
|
|
40
39
|
onClick: () => {
|
|
41
|
-
|
|
40
|
+
a?.(), o?.();
|
|
42
41
|
}
|
|
43
42
|
}, null, 8, ["text", "disabled", "onClick"]),
|
|
44
|
-
|
|
43
|
+
c(m, {
|
|
44
|
+
size: "sm2",
|
|
45
45
|
variant: e.variant,
|
|
46
46
|
text: e.confirmText,
|
|
47
47
|
loading: e.loading,
|
|
48
|
-
onClick: t[0] || (t[0] = (
|
|
48
|
+
onClick: t[0] || (t[0] = (y) => l("confirm"))
|
|
49
49
|
}, null, 8, ["variant", "text", "loading"])
|
|
50
50
|
])
|
|
51
51
|
]),
|
|
52
|
+
default: i(() => [
|
|
53
|
+
n("div", h, [
|
|
54
|
+
n("h3", w, d(e.title), 1),
|
|
55
|
+
n("p", C, d(e.description), 1)
|
|
56
|
+
])
|
|
57
|
+
]),
|
|
52
58
|
_: 3
|
|
53
|
-
}, 8, ["show"
|
|
59
|
+
}, 8, ["show"]));
|
|
54
60
|
}
|
|
55
61
|
});
|
|
56
62
|
export {
|
|
57
|
-
|
|
63
|
+
B as default
|
|
58
64
|
};
|
|
@@ -44,6 +44,8 @@ interface Props {
|
|
|
44
44
|
footerClass?: string;
|
|
45
45
|
/** Timeline text position */
|
|
46
46
|
timelineTextPosition?: TimelineTextPosition;
|
|
47
|
+
/** Fields to explicitly include in the submit payload */
|
|
48
|
+
emitFields?: string[];
|
|
47
49
|
}
|
|
48
50
|
declare function __VLS_template(): {
|
|
49
51
|
attrs: Partial<{}>;
|
|
@@ -89,6 +91,7 @@ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {},
|
|
|
89
91
|
showCancel: boolean;
|
|
90
92
|
groupClass: string;
|
|
91
93
|
timelineTextPosition: TimelineTextPosition;
|
|
94
|
+
emitFields: string[];
|
|
92
95
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLFormElement>;
|
|
93
96
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
94
97
|
export default _default;
|
|
@@ -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 f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
4
|
+
const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-a67bf34e"]]);
|
|
5
5
|
export {
|
|
6
6
|
f as default
|
|
7
7
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as W, inject as X, computed as d, ref as Y, watch as Z, openBlock as
|
|
2
|
-
import { useForm as
|
|
1
|
+
import { defineComponent as W, inject as X, computed as d, ref as Y, watch as Z, openBlock as s, createElementBlock as o, withModifiers as _, normalizeClass as h, createVNode as x, createCommentVNode as c, unref as t, Fragment as ee, renderList as te, createElementVNode as U, toDisplayString as k, renderSlot as ae, createBlock as p, mergeProps as ie } from "vue";
|
|
2
|
+
import { useForm as le } from "./composables/useForm.js";
|
|
3
3
|
import D from "./FormFields.vue.js";
|
|
4
4
|
import A from "../Button.vue.js";
|
|
5
|
-
import
|
|
5
|
+
import se from "../Timeline.vue.js";
|
|
6
6
|
const ne = {
|
|
7
7
|
key: 0,
|
|
8
8
|
class: "form-timeline mb-18"
|
|
@@ -45,40 +45,42 @@ const ne = {
|
|
|
45
45
|
groupClass: { default: "" },
|
|
46
46
|
headerClass: { default: "" },
|
|
47
47
|
footerClass: { default: "" },
|
|
48
|
-
timelineTextPosition: { default: "bottom" }
|
|
48
|
+
timelineTextPosition: { default: "bottom" },
|
|
49
|
+
emitFields: { default: () => ["__typename"] }
|
|
49
50
|
},
|
|
50
51
|
emits: ["onSubmit", "onCancel", "onStepChange", "onAddonAction"],
|
|
51
52
|
setup(e, { emit: M }) {
|
|
52
|
-
const
|
|
53
|
+
const l = e, m = M, f = X("modal-context", null), G = d(() => l.showCancel || !!f), $ = d(() => !!f), b = d(() => !l.schema || l.schema.length === 0 ? !1 : Array.isArray(l.schema[0])), r = d(() => l.tabs && l.tabs.length > 0 && b.value), i = Y(0), w = d(() => l.tabs ? l.tabs.map((n, a) => ({
|
|
53
54
|
id: n.id?.toString() || a.toString(),
|
|
54
55
|
title: n.title,
|
|
55
56
|
icon: n.icon,
|
|
56
57
|
description: n.description,
|
|
57
58
|
status: a < i.value ? "completed" : a === i.value ? "current" : "upcoming"
|
|
58
|
-
})) : []), g = d(() => b.value ?
|
|
59
|
+
})) : []), g = d(() => b.value ? l.schema : [l.schema]), P = d(() => r.value ? g.value[i.value] || [] : []), {
|
|
59
60
|
formValues: y,
|
|
60
|
-
errors:
|
|
61
|
+
errors: F,
|
|
61
62
|
isSubmitting: N,
|
|
62
63
|
handleFieldChange: j,
|
|
63
64
|
validateField: E,
|
|
64
65
|
validateAll: he,
|
|
65
|
-
isFieldVisible:
|
|
66
|
-
isFieldDisabled:
|
|
66
|
+
isFieldVisible: S,
|
|
67
|
+
isFieldDisabled: C,
|
|
67
68
|
isFieldReadonly: V,
|
|
68
69
|
getFieldValue: be,
|
|
69
70
|
handleSubmit: L,
|
|
70
71
|
flatSchema: ge
|
|
71
|
-
} =
|
|
72
|
-
schema:
|
|
73
|
-
values:
|
|
74
|
-
isUpdate:
|
|
75
|
-
folderId:
|
|
72
|
+
} = le({
|
|
73
|
+
schema: l.schema,
|
|
74
|
+
values: l.values,
|
|
75
|
+
isUpdate: l.isUpdate,
|
|
76
|
+
folderId: l.folderId,
|
|
77
|
+
emitFields: l.emitFields,
|
|
76
78
|
onSubmit: (n) => {
|
|
77
79
|
m("onSubmit", n, f?.close);
|
|
78
80
|
}
|
|
79
81
|
});
|
|
80
82
|
Z(
|
|
81
|
-
() =>
|
|
83
|
+
() => l.values,
|
|
82
84
|
(n) => {
|
|
83
85
|
},
|
|
84
86
|
{ deep: !0 }
|
|
@@ -90,7 +92,7 @@ const ne = {
|
|
|
90
92
|
const n = P.value;
|
|
91
93
|
let a = !0;
|
|
92
94
|
for (const u of n) {
|
|
93
|
-
if (!
|
|
95
|
+
if (!S(u) || C(u)) continue;
|
|
94
96
|
E(u) && (a = !1);
|
|
95
97
|
}
|
|
96
98
|
return a;
|
|
@@ -112,12 +114,12 @@ const ne = {
|
|
|
112
114
|
}, O = () => {
|
|
113
115
|
m("onCancel"), f && f?.close?.();
|
|
114
116
|
};
|
|
115
|
-
return (n, a) => (
|
|
116
|
-
class: h(["form-container",
|
|
117
|
+
return (n, a) => (s(), o("form", {
|
|
118
|
+
class: h(["form-container", l.class]),
|
|
117
119
|
onSubmit: _(H, ["prevent"])
|
|
118
120
|
}, [
|
|
119
|
-
r.value && w.value.length > 0 ? (
|
|
120
|
-
x(
|
|
121
|
+
r.value && w.value.length > 0 ? (s(), o("div", ne, [
|
|
122
|
+
x(se, {
|
|
121
123
|
steps: w.value,
|
|
122
124
|
activeStep: i.value,
|
|
123
125
|
direction: "horizontal",
|
|
@@ -126,71 +128,71 @@ const ne = {
|
|
|
126
128
|
onStepClick: K
|
|
127
129
|
}, null, 8, ["steps", "activeStep", "textPosition"])
|
|
128
130
|
])) : c("", !0),
|
|
129
|
-
b.value ? b.value && !r.value ? (
|
|
130
|
-
(
|
|
131
|
+
b.value ? b.value && !r.value ? (s(), o("div", re, [
|
|
132
|
+
(s(!0), o(ee, null, te(g.value, (u, v) => (s(), o("div", {
|
|
131
133
|
key: v,
|
|
132
134
|
class: h(["form-group border rounded-lg overflow-hidden", e.groupClass])
|
|
133
135
|
}, [
|
|
134
|
-
e.groupsHeadings?.[v] ? (
|
|
136
|
+
e.groupsHeadings?.[v] ? (s(), o("div", {
|
|
135
137
|
key: 0,
|
|
136
138
|
class: h(["form-group-header bg-muted/50 px-6 py-4 border-b", e.headerClass])
|
|
137
139
|
}, [
|
|
138
140
|
U("h3", de, k(e.groupsHeadings[v]), 1),
|
|
139
|
-
e.groupHeadingsDescription?.[v] ? (
|
|
141
|
+
e.groupHeadingsDescription?.[v] ? (s(), o("p", ue, k(e.groupHeadingsDescription[v]), 1)) : c("", !0)
|
|
140
142
|
], 2)) : c("", !0),
|
|
141
143
|
U("div", ce, [
|
|
142
144
|
x(D, {
|
|
143
145
|
schema: u,
|
|
144
146
|
values: t(y),
|
|
145
|
-
errors: t(
|
|
147
|
+
errors: t(F),
|
|
146
148
|
variant: e.variant,
|
|
147
149
|
size: e.size,
|
|
148
150
|
rounded: e.rounded,
|
|
149
151
|
className: e.className,
|
|
150
152
|
isUpdate: e.isUpdate,
|
|
151
|
-
isFieldVisible: t(
|
|
152
|
-
isFieldDisabled: t(
|
|
153
|
+
isFieldVisible: t(S),
|
|
154
|
+
isFieldDisabled: t(C),
|
|
153
155
|
isFieldReadonly: t(V),
|
|
154
156
|
onChange: z,
|
|
155
157
|
onAddonAction: a[1] || (a[1] = (Q) => m("onAddonAction", Q))
|
|
156
158
|
}, null, 8, ["schema", "values", "errors", "variant", "size", "rounded", "className", "isUpdate", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
|
|
157
159
|
])
|
|
158
160
|
], 2))), 128))
|
|
159
|
-
])) : r.value ? (
|
|
160
|
-
e.tabs?.[i.value] ? (
|
|
161
|
+
])) : r.value ? (s(), o("div", me, [
|
|
162
|
+
e.tabs?.[i.value] ? (s(), o("div", {
|
|
161
163
|
key: 0,
|
|
162
164
|
class: h(["form-step-header mb-6", e.headerClass])
|
|
163
165
|
}, [
|
|
164
166
|
U("h2", ve, k(e.tabs[i.value].title), 1),
|
|
165
|
-
e.tabs[i.value].description ? (
|
|
167
|
+
e.tabs[i.value].description ? (s(), o("p", fe, k(e.tabs[i.value].description), 1)) : c("", !0)
|
|
166
168
|
], 2)) : c("", !0),
|
|
167
169
|
x(D, {
|
|
168
170
|
schema: P.value,
|
|
169
171
|
values: t(y),
|
|
170
|
-
errors: t(
|
|
172
|
+
errors: t(F),
|
|
171
173
|
variant: e.variant,
|
|
172
174
|
size: e.size,
|
|
173
175
|
rounded: e.rounded,
|
|
174
176
|
className: e.className,
|
|
175
177
|
isUpdate: e.isUpdate,
|
|
176
|
-
isFieldVisible: t(
|
|
177
|
-
isFieldDisabled: t(
|
|
178
|
+
isFieldVisible: t(S),
|
|
179
|
+
isFieldDisabled: t(C),
|
|
178
180
|
isFieldReadonly: t(V),
|
|
179
181
|
onChange: z,
|
|
180
182
|
onAddonAction: a[2] || (a[2] = (u) => m("onAddonAction", u))
|
|
181
183
|
}, null, 8, ["schema", "values", "errors", "variant", "size", "rounded", "className", "isUpdate", "isFieldVisible", "isFieldDisabled", "isFieldReadonly"])
|
|
182
|
-
])) : c("", !0) : (
|
|
184
|
+
])) : c("", !0) : (s(), o("div", oe, [
|
|
183
185
|
x(D, {
|
|
184
186
|
schema: e.schema,
|
|
185
187
|
values: t(y),
|
|
186
|
-
errors: t(
|
|
188
|
+
errors: t(F),
|
|
187
189
|
variant: e.variant,
|
|
188
190
|
size: e.size,
|
|
189
191
|
rounded: e.rounded,
|
|
190
192
|
className: e.className,
|
|
191
193
|
isUpdate: e.isUpdate,
|
|
192
|
-
isFieldVisible: t(
|
|
193
|
-
isFieldDisabled: t(
|
|
194
|
+
isFieldVisible: t(S),
|
|
195
|
+
isFieldDisabled: t(C),
|
|
194
196
|
isFieldReadonly: t(V),
|
|
195
197
|
onChange: z,
|
|
196
198
|
onAddonAction: a[0] || (a[0] = (u) => m("onAddonAction", u))
|
|
@@ -198,11 +200,11 @@ const ne = {
|
|
|
198
200
|
])),
|
|
199
201
|
ae(n.$slots, "default", {
|
|
200
202
|
values: t(y),
|
|
201
|
-
errors: t(
|
|
203
|
+
errors: t(F),
|
|
202
204
|
isSubmitting: t(N),
|
|
203
205
|
handleSubmit: H
|
|
204
206
|
}, void 0, !0),
|
|
205
|
-
e.footer ? (
|
|
207
|
+
e.footer ? (s(), o("div", {
|
|
206
208
|
key: 4,
|
|
207
209
|
class: h([
|
|
208
210
|
"form-footer flex items-center justify-end gap-3",
|
|
@@ -210,7 +212,7 @@ const ne = {
|
|
|
210
212
|
$.value ? "sticky bottom-0 z-20 bg-body pt-4 border-t border-border/75 -mx-4 px-4 mt-8" : "mt-6"
|
|
211
213
|
])
|
|
212
214
|
}, [
|
|
213
|
-
G.value ? (
|
|
215
|
+
G.value ? (s(), p(A, {
|
|
214
216
|
key: 0,
|
|
215
217
|
type: "button",
|
|
216
218
|
variant: "outline",
|
|
@@ -218,7 +220,7 @@ const ne = {
|
|
|
218
220
|
disabled: e.loading || t(N),
|
|
219
221
|
onClick: O
|
|
220
222
|
}, null, 8, ["text", "disabled"])) : c("", !0),
|
|
221
|
-
r.value && R.value ? (
|
|
223
|
+
r.value && R.value ? (s(), p(A, {
|
|
222
224
|
key: 1,
|
|
223
225
|
type: "button",
|
|
224
226
|
variant: "outline",
|
|
@@ -226,14 +228,14 @@ const ne = {
|
|
|
226
228
|
text: "Previous",
|
|
227
229
|
onClick: J
|
|
228
230
|
})) : c("", !0),
|
|
229
|
-
r.value && !B.value ? (
|
|
231
|
+
r.value && !B.value ? (s(), p(A, {
|
|
230
232
|
key: 2,
|
|
231
233
|
type: "button",
|
|
232
234
|
variant: "primary",
|
|
233
235
|
text: "Next",
|
|
234
236
|
iconRight: "lucide:arrow-right",
|
|
235
237
|
onClick: T
|
|
236
|
-
})) : (
|
|
238
|
+
})) : (s(), p(A, ie({
|
|
237
239
|
key: 3,
|
|
238
240
|
type: "submit",
|
|
239
241
|
variant: "primary",
|
|
@@ -1,134 +1,148 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { initializeFormValues as
|
|
3
|
-
import { useFileUpload as
|
|
4
|
-
function
|
|
5
|
-
const { schema:
|
|
6
|
-
|
|
7
|
-
() =>
|
|
1
|
+
import { ref as v, computed as K, watch as L } from "vue";
|
|
2
|
+
import { initializeFormValues as B, deepClone as m, cleanSubmitValues as Q, getNestedValue as M, evaluateConditional as z, setNestedValue as w, collectFileFields as W, filterNullCustomFields as X } from "../utils/form.utils.js";
|
|
3
|
+
import { useFileUpload as Y } from "./useFileUpload.js";
|
|
4
|
+
function te(x) {
|
|
5
|
+
const { schema: o, values: U, isUpdate: F = !1, folderId: g, onSubmit: j } = x, { handleUploadFile: E } = Y(), t = v(B(o, U)), u = v({}), b = v(!1), d = v(!1), h = v(m(t.value)), y = K(() => o ? Array.isArray(o[0]) ? o.flat() : o : []);
|
|
6
|
+
L(
|
|
7
|
+
() => U,
|
|
8
8
|
(e) => {
|
|
9
|
-
e && (t.value =
|
|
9
|
+
e && (t.value = B(o, e), h.value = m(t.value), d.value = !1);
|
|
10
10
|
},
|
|
11
11
|
{ deep: !0 }
|
|
12
12
|
);
|
|
13
|
-
const
|
|
13
|
+
const V = () => ({
|
|
14
14
|
values: t.value,
|
|
15
|
-
isUpdate:
|
|
16
|
-
}),
|
|
17
|
-
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
const
|
|
22
|
-
let
|
|
23
|
-
if (e.required && (
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
for (const
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
|
|
15
|
+
isUpdate: F
|
|
16
|
+
}), C = (e) => M(t.value, e), T = (e) => u.value[e] || "", N = (e, l) => {
|
|
17
|
+
l ? u.value[e] = l : delete u.value[e];
|
|
18
|
+
}, S = () => {
|
|
19
|
+
u.value = {};
|
|
20
|
+
}, O = (e) => e.when ? z(e.when, V()) : !0, D = (e) => z(e.disabled, V()), I = (e) => z(e.readonly, V()), P = (e) => {
|
|
21
|
+
const l = C(e.name);
|
|
22
|
+
let a = "";
|
|
23
|
+
if (e.required && (l == null || l === "" || Array.isArray(l) && l.length === 0) && (a = `${e.label || e.name} is required`), !a && e.maxFileSize) {
|
|
24
|
+
const i = e.maxFileSize * 1024 * 1024;
|
|
25
|
+
if (l != null && l !== "") {
|
|
26
|
+
const n = Array.isArray(l) ? l : [l];
|
|
27
|
+
for (const s of n) {
|
|
28
|
+
const c = s instanceof File ? s.size : s?.fileSize || s?.file?.size || s?.size;
|
|
29
|
+
if (c !== void 0 && c > i) {
|
|
30
|
+
a = `${e.label || e.name} size must be less than ${e.maxFileSize}MB`;
|
|
31
31
|
break;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
if (!
|
|
37
|
-
const
|
|
38
|
-
|
|
36
|
+
if (!a && (e.type === "file" || e.type === "fileUploader") && (e.props?.multiple || e.maxFiles)) {
|
|
37
|
+
const i = e.maxFiles || e.props?.maxFiles;
|
|
38
|
+
i && Array.isArray(l) && l.length > i && (a = `Maximum ${i} files allowed`);
|
|
39
39
|
}
|
|
40
|
-
return !
|
|
41
|
-
value:
|
|
40
|
+
return !a && e.validation && (a = e.validation({
|
|
41
|
+
value: l,
|
|
42
42
|
values: t.value,
|
|
43
|
-
isUpdate:
|
|
44
|
-
})),
|
|
43
|
+
isUpdate: F
|
|
44
|
+
})), a ? u.value[e.name] = a : delete u.value[e.name], a;
|
|
45
45
|
}, $ = () => {
|
|
46
|
-
|
|
46
|
+
S();
|
|
47
47
|
let e = !0;
|
|
48
|
-
for (const
|
|
49
|
-
if (!
|
|
50
|
-
P(
|
|
48
|
+
for (const l of y.value) {
|
|
49
|
+
if (!O(l) || D(l)) continue;
|
|
50
|
+
P(l) && (e = !1);
|
|
51
51
|
}
|
|
52
52
|
return e;
|
|
53
|
-
},
|
|
54
|
-
t.value =
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
const
|
|
53
|
+
}, R = (e, l, a) => {
|
|
54
|
+
t.value = w(t.value, e, l), d.value = !0, delete u.value[e];
|
|
55
|
+
const i = y.value.find((n) => n.name === e);
|
|
56
|
+
if (i?.updateValues) {
|
|
57
|
+
const n = i.updateValues({
|
|
58
58
|
values: t.value,
|
|
59
|
-
data:
|
|
60
|
-
isUpdate:
|
|
61
|
-
updateError:
|
|
59
|
+
data: a,
|
|
60
|
+
isUpdate: F,
|
|
61
|
+
updateError: N
|
|
62
62
|
});
|
|
63
|
-
|
|
63
|
+
n && typeof n == "object" && (t.value = { ...t.value, ...n });
|
|
64
64
|
}
|
|
65
|
-
},
|
|
66
|
-
const e =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
}, G = async () => {
|
|
66
|
+
const e = m(t.value), l = W(o, e), a = (s, c) => {
|
|
67
|
+
let r = null;
|
|
68
|
+
return s instanceof File ? r = s : s && typeof s == "object" && s.file instanceof File && (r = s.file), {
|
|
69
|
+
fileName: s?.fileName || r?.name || c.split("/").pop() || "unknown",
|
|
70
|
+
fileUrl: c,
|
|
71
|
+
fileType: s?.fileType || r?.type || "application/octet-stream",
|
|
72
|
+
fileSize: s?.fileSize || r?.size || 0
|
|
73
|
+
};
|
|
74
|
+
}, i = l.map(async (s) => {
|
|
75
|
+
const { name: c, value: r, field: J } = s, k = J.returnFileObject === !0;
|
|
76
|
+
if (Array.isArray(r)) {
|
|
77
|
+
const q = r.map(async (f) => {
|
|
78
|
+
if (f instanceof File || f && typeof f == "object" && f.file instanceof File) {
|
|
79
|
+
const A = await E(f, g);
|
|
80
|
+
return A ? k ? a(f, A) : A : null;
|
|
81
|
+
}
|
|
82
|
+
return f;
|
|
83
|
+
}), p = await Promise.all(q);
|
|
84
|
+
return { name: c, value: p };
|
|
71
85
|
} else {
|
|
72
|
-
if (
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
return { name:
|
|
86
|
+
if (r instanceof File || r && typeof r == "object" && r.file instanceof File) {
|
|
87
|
+
const p = await E(r, g);
|
|
88
|
+
if (p)
|
|
89
|
+
return { name: c, value: k ? a(r, p) : p };
|
|
76
90
|
}
|
|
77
91
|
return null;
|
|
78
92
|
}
|
|
79
93
|
});
|
|
80
|
-
return (await Promise.all(
|
|
81
|
-
s && Object.assign(e,
|
|
94
|
+
return (await Promise.all(i)).forEach((s) => {
|
|
95
|
+
s && Object.assign(e, w(e, s.name, s.value));
|
|
82
96
|
}), e;
|
|
83
|
-
},
|
|
84
|
-
const
|
|
85
|
-
for (const
|
|
86
|
-
if (
|
|
87
|
-
const
|
|
88
|
-
if (Array.isArray(
|
|
89
|
-
const
|
|
90
|
-
Object.assign(
|
|
97
|
+
}, H = (e) => {
|
|
98
|
+
const l = { ...e };
|
|
99
|
+
for (const a of y.value)
|
|
100
|
+
if (a.type === "customFields" && a.props?.schema) {
|
|
101
|
+
const i = M(l, a.name);
|
|
102
|
+
if (Array.isArray(i)) {
|
|
103
|
+
const n = X(i, a.props.schema);
|
|
104
|
+
Object.assign(l, w(l, a.name, n));
|
|
91
105
|
}
|
|
92
106
|
}
|
|
93
|
-
return
|
|
107
|
+
return l;
|
|
94
108
|
};
|
|
95
109
|
return {
|
|
96
110
|
formValues: t,
|
|
97
|
-
errors:
|
|
98
|
-
isSubmitting:
|
|
99
|
-
isDirty:
|
|
100
|
-
handleFieldChange:
|
|
111
|
+
errors: u,
|
|
112
|
+
isSubmitting: b,
|
|
113
|
+
isDirty: d,
|
|
114
|
+
handleFieldChange: R,
|
|
101
115
|
validateField: P,
|
|
102
116
|
validateAll: $,
|
|
103
|
-
isFieldVisible:
|
|
104
|
-
isFieldDisabled:
|
|
105
|
-
isFieldReadonly:
|
|
106
|
-
getFieldValue:
|
|
107
|
-
getFieldError:
|
|
108
|
-
setFieldError:
|
|
109
|
-
clearErrors:
|
|
117
|
+
isFieldVisible: O,
|
|
118
|
+
isFieldDisabled: D,
|
|
119
|
+
isFieldReadonly: I,
|
|
120
|
+
getFieldValue: C,
|
|
121
|
+
getFieldError: T,
|
|
122
|
+
setFieldError: N,
|
|
123
|
+
clearErrors: S,
|
|
110
124
|
resetForm: () => {
|
|
111
|
-
t.value =
|
|
125
|
+
t.value = m(h.value), S(), d.value = !1;
|
|
112
126
|
},
|
|
113
127
|
handleSubmit: async () => {
|
|
114
128
|
if ($()) {
|
|
115
|
-
|
|
129
|
+
b.value = !0;
|
|
116
130
|
try {
|
|
117
|
-
let
|
|
118
|
-
|
|
119
|
-
values:
|
|
120
|
-
isUpdate:
|
|
121
|
-
}),
|
|
122
|
-
} catch (
|
|
123
|
-
throw console.error("[useForm] Submit error:",
|
|
131
|
+
let l = await G();
|
|
132
|
+
l = H(l), l = Q(l, o, x.emitFields, []), j && await j({
|
|
133
|
+
values: l,
|
|
134
|
+
isUpdate: F
|
|
135
|
+
}), d.value = !1, h.value = m(l);
|
|
136
|
+
} catch (l) {
|
|
137
|
+
throw console.error("[useForm] Submit error:", l), l;
|
|
124
138
|
} finally {
|
|
125
|
-
|
|
139
|
+
b.value = !1;
|
|
126
140
|
}
|
|
127
141
|
}
|
|
128
142
|
},
|
|
129
|
-
flatSchema:
|
|
143
|
+
flatSchema: y
|
|
130
144
|
};
|
|
131
145
|
}
|
|
132
146
|
export {
|
|
133
|
-
|
|
147
|
+
te as useForm
|
|
134
148
|
};
|
|
@@ -71,6 +71,18 @@ export interface IFormCustomFieldsProps {
|
|
|
71
71
|
export interface IForm {
|
|
72
72
|
/** Field name - supports dot notation for nested paths (e.g., 'pricing.baseAmount') */
|
|
73
73
|
name: string;
|
|
74
|
+
/** Read initial value from a different key in the incoming data (defaults to name) */
|
|
75
|
+
mapFrom?: string;
|
|
76
|
+
/** Write submit value to a different key in the payload (defaults to name) */
|
|
77
|
+
mapTo?: string;
|
|
78
|
+
/** Key to extract from object or array of objects. Useful for mapping arrays of objects to simple values. */
|
|
79
|
+
valueKey?: string;
|
|
80
|
+
/** Alias for valueKey */
|
|
81
|
+
key?: string;
|
|
82
|
+
/** Format raw value before passing to form state */
|
|
83
|
+
format?: (value: any, rawValues: Record<string, any>) => any;
|
|
84
|
+
/** Transform form value before submitting */
|
|
85
|
+
transform?: (value: any, formValues: Record<string, any>) => any;
|
|
74
86
|
/** Field label - can be string or Vue component */
|
|
75
87
|
label?: string | Component;
|
|
76
88
|
/** Placeholder text */
|
|
@@ -117,6 +129,8 @@ export interface IForm {
|
|
|
117
129
|
maxFileSize?: number;
|
|
118
130
|
/** Maximum number of files allowed when multiple is true */
|
|
119
131
|
maxFiles?: number;
|
|
132
|
+
/** Return file values as objects { fileName, fileUrl, fileType, fileSize } instead of string URLs */
|
|
133
|
+
returnFileObject?: boolean;
|
|
120
134
|
}
|
|
121
135
|
/**
|
|
122
136
|
* Timeline step for multi-step forms
|
|
@@ -173,6 +187,8 @@ export interface IFormProps {
|
|
|
173
187
|
headerClass?: string;
|
|
174
188
|
/** Custom class for the footer area */
|
|
175
189
|
footerClass?: string;
|
|
190
|
+
/** Fields to explicitly include in the submit payload (e.g., ['__typename', 'id']) */
|
|
191
|
+
emitFields?: string[];
|
|
176
192
|
}
|
|
177
193
|
/**
|
|
178
194
|
* Form submit payload
|
|
@@ -33,6 +33,7 @@ export declare function collectFileFields(schema: IForm[] | IForm[][], values: R
|
|
|
33
33
|
name: string;
|
|
34
34
|
value: any;
|
|
35
35
|
type: string;
|
|
36
|
+
field: IForm;
|
|
36
37
|
}>;
|
|
37
38
|
/**
|
|
38
39
|
* Deep clone an object
|
|
@@ -46,3 +47,9 @@ export declare function getFieldKey(name: string): string;
|
|
|
46
47
|
* Check if a value is a Vue component
|
|
47
48
|
*/
|
|
48
49
|
export declare function isComponent(value: any): boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Cleans the submit payload by extracting only schema fields,
|
|
52
|
+
* injecting specified emitFields, and removing ignoreFields recursively.
|
|
53
|
+
* Also processes mapped output and transformation functions.
|
|
54
|
+
*/
|
|
55
|
+
export declare function cleanSubmitValues(values: Record<string, any>, schema: IForm[] | IForm[][], emitFields?: string[], ignoreFields?: string[]): Record<string, any>;
|
|
@@ -1,106 +1,174 @@
|
|
|
1
|
-
function
|
|
1
|
+
function k(e) {
|
|
2
2
|
return !!e && typeof e == "object";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function p(e, n) {
|
|
5
5
|
if (!n || !e) return;
|
|
6
|
-
const
|
|
7
|
-
let
|
|
8
|
-
for (const
|
|
9
|
-
if (
|
|
10
|
-
|
|
6
|
+
const r = n.split(".");
|
|
7
|
+
let l = e;
|
|
8
|
+
for (const t of r) {
|
|
9
|
+
if (l == null) return;
|
|
10
|
+
l = l[t];
|
|
11
11
|
}
|
|
12
|
-
return
|
|
12
|
+
return l;
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function m(e, n, r) {
|
|
15
15
|
if (!n) return e;
|
|
16
|
-
const
|
|
17
|
-
let
|
|
18
|
-
for (let
|
|
19
|
-
const
|
|
20
|
-
Array.isArray(
|
|
16
|
+
const l = n.split("."), t = { ...e };
|
|
17
|
+
let f = t;
|
|
18
|
+
for (let i = 0; i < l.length - 1; i++) {
|
|
19
|
+
const c = l[i];
|
|
20
|
+
Array.isArray(f[c]) ? f[c] = [...f[c]] : f[c] = f[c] ? { ...f[c] } : {}, f = f[c];
|
|
21
21
|
}
|
|
22
|
-
return
|
|
22
|
+
return f[l[l.length - 1]] = r, t;
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
return !
|
|
24
|
+
function v(e, n) {
|
|
25
|
+
return !k(n) || !n.name ? e : p(e, n.name) === void 0 && n.value !== void 0 ? m(e, n.name, n.value) : e;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
let
|
|
29
|
-
const
|
|
30
|
-
for (const
|
|
31
|
-
if (!
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
27
|
+
function E(e, n) {
|
|
28
|
+
let r = n ? d(n) : {};
|
|
29
|
+
const l = Array.isArray(e[0]) ? e.flat() : e;
|
|
30
|
+
for (const t of l) {
|
|
31
|
+
if (!t.name) continue;
|
|
32
|
+
const f = t.mapFrom || t.name;
|
|
33
|
+
let i = n ? p(n, f) : void 0;
|
|
34
|
+
if (i != null) {
|
|
35
|
+
const c = t.valueKey || t.key;
|
|
36
|
+
c && (Array.isArray(i) ? i = i.map(
|
|
37
|
+
(u) => u && typeof u == "object" ? p(u, c) : u
|
|
38
|
+
) : typeof i == "object" && (i = p(i, c))), t.format && (i = t.format(i, n || {}));
|
|
35
39
|
}
|
|
36
|
-
|
|
40
|
+
if (i === void 0) {
|
|
41
|
+
if (t.mapFrom && n) {
|
|
42
|
+
const c = p(n, t.name);
|
|
43
|
+
c !== void 0 && (i = c);
|
|
44
|
+
}
|
|
45
|
+
if (i === void 0) {
|
|
46
|
+
const c = typeof t.value == "function" ? t.value() : t.value;
|
|
47
|
+
c !== void 0 && Object.assign(r, m(r, t.name, c));
|
|
48
|
+
} else
|
|
49
|
+
Object.assign(r, m(r, t.name, i));
|
|
50
|
+
} else
|
|
51
|
+
Object.assign(r, m(r, t.name, i));
|
|
52
|
+
r = v(r, t.addonLeft), r = v(r, t.addonRight);
|
|
37
53
|
}
|
|
38
|
-
return
|
|
54
|
+
return r;
|
|
39
55
|
}
|
|
40
|
-
function
|
|
56
|
+
function O(e, n) {
|
|
41
57
|
return e === void 0 ? !1 : typeof e == "boolean" ? e : typeof e == "function" ? e(n) : !1;
|
|
42
58
|
}
|
|
43
|
-
function
|
|
44
|
-
return Array.isArray(e) ? e.filter((
|
|
45
|
-
const
|
|
46
|
-
return
|
|
59
|
+
function S(e, n) {
|
|
60
|
+
return Array.isArray(e) ? e.filter((r) => r ? !n.every((t) => {
|
|
61
|
+
const f = r[t.name];
|
|
62
|
+
return f == null || f === "";
|
|
47
63
|
}) : !1) : [];
|
|
48
64
|
}
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
for (const
|
|
52
|
-
if (!
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
name:
|
|
58
|
-
value:
|
|
59
|
-
type:
|
|
65
|
+
function F(e, n) {
|
|
66
|
+
const r = [], l = Array.isArray(e[0]) ? e.flat() : e;
|
|
67
|
+
for (const t of l) {
|
|
68
|
+
if (!t.name) continue;
|
|
69
|
+
const f = t.type;
|
|
70
|
+
if (f === "file" || f === "avatarUpload" || f === "fileUploader") {
|
|
71
|
+
const i = p(n, t.name);
|
|
72
|
+
i && r.push({
|
|
73
|
+
name: t.name,
|
|
74
|
+
value: i,
|
|
75
|
+
type: f,
|
|
76
|
+
field: t
|
|
60
77
|
});
|
|
61
78
|
}
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
if (Array.isArray(
|
|
65
|
-
const
|
|
66
|
-
(
|
|
79
|
+
if (f === "customFields" && t.props?.schema) {
|
|
80
|
+
const i = p(n, t.name);
|
|
81
|
+
if (Array.isArray(i)) {
|
|
82
|
+
const u = t.props.schema.filter(
|
|
83
|
+
(s) => s.type === "file" || s.type === "avatarUpload" || s.type === "fileUploader"
|
|
67
84
|
);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
const
|
|
71
|
-
|
|
72
|
-
name: `${
|
|
73
|
-
value:
|
|
74
|
-
type:
|
|
85
|
+
u.length > 0 && i.forEach((s, o) => {
|
|
86
|
+
u.forEach((a) => {
|
|
87
|
+
const y = s?.[a.name];
|
|
88
|
+
y && r.push({
|
|
89
|
+
name: `${t.name}.${o}.${a.name}`,
|
|
90
|
+
value: y,
|
|
91
|
+
type: a.type,
|
|
92
|
+
field: a
|
|
75
93
|
});
|
|
76
94
|
});
|
|
77
95
|
});
|
|
78
96
|
}
|
|
79
97
|
}
|
|
80
98
|
}
|
|
81
|
-
return
|
|
99
|
+
return r;
|
|
82
100
|
}
|
|
83
|
-
function
|
|
101
|
+
function d(e) {
|
|
84
102
|
if (e === null || typeof e != "object") return e;
|
|
85
103
|
if (e instanceof Date) return new Date(e.getTime());
|
|
86
104
|
if (e instanceof File) return e;
|
|
87
|
-
if (Array.isArray(e)) return e.map((
|
|
105
|
+
if (Array.isArray(e)) return e.map((r) => d(r));
|
|
88
106
|
const n = {};
|
|
89
|
-
for (const
|
|
90
|
-
Object.prototype.hasOwnProperty.call(e,
|
|
107
|
+
for (const r in e)
|
|
108
|
+
Object.prototype.hasOwnProperty.call(e, r) && (n[r] = d(e[r]));
|
|
91
109
|
return n;
|
|
92
110
|
}
|
|
93
|
-
function
|
|
111
|
+
function x(e) {
|
|
94
112
|
return e ? typeof e == "object" && (typeof e.render == "function" || typeof e.setup == "function" || e.__name !== void 0 || e.name !== void 0) : !1;
|
|
95
113
|
}
|
|
114
|
+
function g(e, n, r, l) {
|
|
115
|
+
const t = r === void 0 && l === void 0, f = t ? d(e) : {}, i = Array.isArray(n[0]) ? n.flat() : n, c = r || [], u = l || [];
|
|
116
|
+
for (const s of i) {
|
|
117
|
+
if (!s.name) continue;
|
|
118
|
+
let o = p(e, s.name);
|
|
119
|
+
if (o === void 0) continue;
|
|
120
|
+
if (s.type === "customFields" && s.props?.schema && Array.isArray(o)) {
|
|
121
|
+
const A = s.props.schema;
|
|
122
|
+
o = o.map((h) => g(h, A, r, l));
|
|
123
|
+
}
|
|
124
|
+
let a = !1;
|
|
125
|
+
s.transform && (o = s.transform(o, e), a = !0);
|
|
126
|
+
const y = s.mapTo || s.name;
|
|
127
|
+
y !== s.name && (a = !0, t && !s.name.includes(".") && delete f[s.name]), !t || a ? Object.assign(f, m(f, y, o)) : Object.assign(f, m(f, s.name, o));
|
|
128
|
+
}
|
|
129
|
+
if (c.length > 0) {
|
|
130
|
+
const s = (o, a) => {
|
|
131
|
+
if (!(!o || typeof o != "object") && !(!a || typeof a != "object"))
|
|
132
|
+
if (Array.isArray(o) && Array.isArray(a))
|
|
133
|
+
o.forEach((y, A) => {
|
|
134
|
+
a[A] && s(y, a[A]);
|
|
135
|
+
});
|
|
136
|
+
else {
|
|
137
|
+
for (const y of c)
|
|
138
|
+
o[y] !== void 0 && a[y] === void 0 && (a[y] = d(o[y]));
|
|
139
|
+
for (const y in a)
|
|
140
|
+
typeof a[y] == "object" && typeof o[y] == "object" && s(o[y], a[y]);
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
for (const o of c)
|
|
144
|
+
e[o] !== void 0 && f[o] === void 0 && (f[o] = d(e[o]));
|
|
145
|
+
s(e, f);
|
|
146
|
+
}
|
|
147
|
+
if (u.length > 0) {
|
|
148
|
+
const s = (o) => {
|
|
149
|
+
if (!(!o || typeof o != "object"))
|
|
150
|
+
if (Array.isArray(o))
|
|
151
|
+
o.forEach(s);
|
|
152
|
+
else {
|
|
153
|
+
for (const a of u)
|
|
154
|
+
delete o[a];
|
|
155
|
+
for (const a in o)
|
|
156
|
+
s(o[a]);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
s(f);
|
|
160
|
+
}
|
|
161
|
+
return f;
|
|
162
|
+
}
|
|
96
163
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
k as
|
|
105
|
-
|
|
164
|
+
g as cleanSubmitValues,
|
|
165
|
+
F as collectFileFields,
|
|
166
|
+
d as deepClone,
|
|
167
|
+
O as evaluateConditional,
|
|
168
|
+
S as filterNullCustomFields,
|
|
169
|
+
p as getNestedValue,
|
|
170
|
+
E as initializeFormValues,
|
|
171
|
+
k as isAddonObject,
|
|
172
|
+
x as isComponent,
|
|
173
|
+
m as setNestedValue
|
|
106
174
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as W, computed as
|
|
1
|
+
import { defineComponent as W, computed as N, ref as y, provide as E, watch as R, resolveComponent as X, openBlock as a, createElementBlock as i, normalizeClass as D, createElementVNode as h, renderSlot as B, toDisplayString as f, createCommentVNode as m, createBlock as s, unref as I, createVNode as r, resolveDynamicComponent as U, Fragment as P, mergeProps as c, withCtx as o, createTextVNode as v } from "vue";
|
|
2
2
|
import Y from "../Input.vue.js";
|
|
3
3
|
import u from "../Button.vue.js";
|
|
4
4
|
import F from "../Icon.vue.js";
|
|
@@ -61,32 +61,32 @@ const ae = { class: "flex flex-col w-full space-y-8" }, ne = { class: "flex flex
|
|
|
61
61
|
},
|
|
62
62
|
emits: ["add", "delete"],
|
|
63
63
|
setup(e, { emit: L }) {
|
|
64
|
-
const l = e,
|
|
64
|
+
const l = e, j = L, K = N(() => l.name || l.title || "default-screen"), b = te(
|
|
65
65
|
`view-mode-${K.value}`,
|
|
66
66
|
l.table ? "table" : "list"
|
|
67
|
-
), x = y(""), A = y({}), w = y(l.pageInfo?.currentPage || 1), $ = y(l.pageInfo?.itemsPerPage || l.paginationProps?.itemsPerPage || 10), g = y([]),
|
|
68
|
-
E("screen-selected-rows", g), E("screen-request-delete", (t) =>
|
|
69
|
-
const
|
|
70
|
-
|
|
67
|
+
), x = y(""), A = y({}), w = y(l.pageInfo?.currentPage || 1), $ = y(l.pageInfo?.itemsPerPage || l.paginationProps?.itemsPerPage || 10), g = y([]), V = y([]), k = y(!1);
|
|
68
|
+
E("screen-selected-rows", g), E("screen-request-delete", (t) => S(t));
|
|
69
|
+
const S = (t) => {
|
|
70
|
+
V.value = t, k.value = !0;
|
|
71
71
|
}, O = () => {
|
|
72
|
-
|
|
72
|
+
j("delete", V.value), k.value = !1, g.value = [];
|
|
73
73
|
}, Q = (t) => {
|
|
74
|
-
|
|
74
|
+
j("delete", t), g.value = [];
|
|
75
75
|
};
|
|
76
|
-
|
|
76
|
+
R(
|
|
77
77
|
() => l.pageInfo?.currentPage,
|
|
78
78
|
(t) => {
|
|
79
79
|
t && (w.value = t);
|
|
80
80
|
}
|
|
81
|
-
),
|
|
81
|
+
), R(
|
|
82
82
|
() => l.pageInfo?.itemsPerPage,
|
|
83
83
|
(t) => {
|
|
84
84
|
t && ($.value = t);
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
|
-
let
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
let T = null;
|
|
88
|
+
R(x, (t) => {
|
|
89
|
+
T && clearTimeout(T), T = setTimeout(() => {
|
|
90
90
|
w.value = 1, C();
|
|
91
91
|
}, 300);
|
|
92
92
|
});
|
|
@@ -108,7 +108,7 @@ const ae = { class: "flex flex-col w-full space-y-8" }, ne = { class: "flex flex
|
|
|
108
108
|
filter: A.value
|
|
109
109
|
};
|
|
110
110
|
l.refetch && l.refetch(t);
|
|
111
|
-
}, z =
|
|
111
|
+
}, z = N(() => b.value === "table" && l.table ? l.table : l.list), M = N(() => l.data && l.data.length > 0);
|
|
112
112
|
return (t, n) => {
|
|
113
113
|
const q = X("router-link");
|
|
114
114
|
return a(), i("div", ae, [
|
|
@@ -132,13 +132,13 @@ const ae = { class: "flex flex-col w-full space-y-8" }, ne = { class: "flex flex
|
|
|
132
132
|
class: "hover:bg-destructive/10 shrink-0 h-9! w-9!",
|
|
133
133
|
icon: "lucide:trash-2",
|
|
134
134
|
title: "Delete Selected",
|
|
135
|
-
onClick: n[0] || (n[0] = (d) =>
|
|
135
|
+
onClick: n[0] || (n[0] = (d) => S(g.value))
|
|
136
136
|
})) : m("", !0),
|
|
137
137
|
e.table && e.list ? (a(), i("div", se, [
|
|
138
138
|
h("button", {
|
|
139
139
|
onClick: n[1] || (n[1] = (d) => b.value = "list"),
|
|
140
140
|
class: D(["p-1.5 rounded", [
|
|
141
|
-
I(b) === "list" ? "bg-secondary/85 dark:bg-
|
|
141
|
+
I(b) === "list" ? "bg-secondary/85 dark:bg-secondary shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
142
142
|
]]),
|
|
143
143
|
title: "List View"
|
|
144
144
|
}, [
|
|
@@ -150,7 +150,7 @@ const ae = { class: "flex flex-col w-full space-y-8" }, ne = { class: "flex flex
|
|
|
150
150
|
h("button", {
|
|
151
151
|
onClick: n[2] || (n[2] = (d) => b.value = "table"),
|
|
152
152
|
class: D(["p-1.5 rounded", [
|
|
153
|
-
I(b) === "table" ? "bg-secondary/85 dark:bg-
|
|
153
|
+
I(b) === "table" ? "bg-secondary/85 dark:bg-secondary shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
154
154
|
]]),
|
|
155
155
|
title: "Table View"
|
|
156
156
|
}, [
|
|
@@ -194,7 +194,7 @@ const ae = { class: "flex flex-col w-full space-y-8" }, ne = { class: "flex flex
|
|
|
194
194
|
]),
|
|
195
195
|
h("div", ue, [
|
|
196
196
|
B(t.$slots, "actions", {}, () => [
|
|
197
|
-
e.addComponent ? (a(), s(
|
|
197
|
+
e.addComponent ? (a(), s(U(e.addComponent), { key: 0 })) : e.canAdd ? (a(), i(P, { key: 1 }, [
|
|
198
198
|
e.addBtn ? (a(), i(P, { key: 0 }, [
|
|
199
199
|
e.addBtn.modal ? (a(), s(H, c({
|
|
200
200
|
key: 0,
|
|
@@ -293,7 +293,7 @@ const ae = { class: "flex flex-col w-full space-y-8" }, ne = { class: "flex flex
|
|
|
293
293
|
icon: e.emptyIcon
|
|
294
294
|
}, {
|
|
295
295
|
action: o(() => [
|
|
296
|
-
e.addComponent ? (a(), s(
|
|
296
|
+
e.addComponent ? (a(), s(U(e.addComponent), { key: 0 })) : e.canAdd ? (a(), i(P, { key: 1 }, [
|
|
297
297
|
e.addBtn ? (a(), i(P, { key: 0 }, [
|
|
298
298
|
e.addBtn.modal ? (a(), s(H, c({
|
|
299
299
|
key: 0,
|
|
@@ -373,14 +373,14 @@ const ae = { class: "flex flex-col w-full space-y-8" }, ne = { class: "flex flex
|
|
|
373
373
|
_: 1
|
|
374
374
|
}, 8, ["title", "description", "icon"])
|
|
375
375
|
]) : (a(), i(P, { key: 1 }, [
|
|
376
|
-
z.value ? (a(), s(
|
|
376
|
+
z.value ? (a(), s(U(z.value), {
|
|
377
377
|
key: 0,
|
|
378
378
|
data: e.data,
|
|
379
379
|
loading: e.loading,
|
|
380
380
|
refetch: e.refetch,
|
|
381
381
|
selectedRows: g.value,
|
|
382
382
|
"onUpdate:selectedRows": n[9] || (n[9] = (d) => g.value = d),
|
|
383
|
-
delete:
|
|
383
|
+
delete: S,
|
|
384
384
|
onDelete: Q
|
|
385
385
|
}, null, 40, ["data", "loading", "refetch", "selectedRows"])) : (a(), i("div", me, " Please provide a `:list` or `:table` component. "))
|
|
386
386
|
], 64))
|
|
@@ -399,13 +399,13 @@ const ae = { class: "flex flex-col w-full space-y-8" }, ne = { class: "flex flex
|
|
|
399
399
|
show: k.value,
|
|
400
400
|
"onUpdate:show": n[10] || (n[10] = (d) => k.value = d),
|
|
401
401
|
title: "Confirm Deletion",
|
|
402
|
-
description:
|
|
402
|
+
description: `Are you sure you want to delete the selected ${V.value.length > 1 ? "items" : "item"}?`,
|
|
403
403
|
"confirm-text": "Delete",
|
|
404
404
|
"cancel-text": "Cancel",
|
|
405
405
|
variant: "danger",
|
|
406
406
|
onConfirm: O,
|
|
407
407
|
onCancel: n[11] || (n[11] = (d) => k.value = !1)
|
|
408
|
-
}, null, 8, ["show"])
|
|
408
|
+
}, null, 8, ["show", "description"])
|
|
409
409
|
]);
|
|
410
410
|
};
|
|
411
411
|
}
|
package/package.json
CHANGED
package/style.css
CHANGED
|
@@ -259,7 +259,7 @@
|
|
|
259
259
|
@custom-variant dark (&:where(.dark, .dark *));
|
|
260
260
|
|
|
261
261
|
|
|
262
|
-
|
|
262
|
+
.dark {
|
|
263
263
|
--color-white: #0b0b0b !important;
|
|
264
264
|
--color-mixture-1: #0c0c0c !important;
|
|
265
265
|
--color-mixture-2: #ffffff !important;
|
|
@@ -713,5 +713,5 @@ textarea::-webkit-scrollbar-thumb {
|
|
|
713
713
|
}
|
|
714
714
|
|
|
715
715
|
/* --- Vite Generated CSS --- */
|
|
716
|
-
.accordion-enter-active[data-v-aa189e08],.accordion-leave-active[data-v-aa189e08]{transition:height .3s ease-in-out}.button-group[data-v-ba735fac] button{align-self:stretch;height:auto!important;min-height:unset!important;min-width:unset!important;width:auto!important}.button-group[data-v-ba735fac]:not(.vertical-group) button{aspect-ratio:unset}.attached-group[data-v-ba735fac] button{position:relative;--radius: .375rem}.attached-group[data-v-ba735fac] button:focus-visible,.attached-group[data-v-ba735fac] button:hover{z-index:10}.attached-group[data-v-ba735fac]:not(.vertical-group) button:not(:first-child){margin-left:-1px}.attached-group[data-v-ba735fac]:not(.vertical-group) button:first-child{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius);border-top-right-radius:0;border-bottom-right-radius:0}.attached-group[data-v-ba735fac]:not(.vertical-group) button:not(:first-child):not(:last-child){border-radius:0}.attached-group[data-v-ba735fac]:not(.vertical-group) button:last-child{border-top-right-radius:var(--radius);border-bottom-right-radius:var(--radius);border-top-left-radius:0;border-bottom-left-radius:0}.vertical-group[data-v-ba735fac] button:not(:first-child){margin-top:-1px}.vertical-group[data-v-ba735fac] button:first-child{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.vertical-group[data-v-ba735fac] button:not(:first-child):not(:last-child){border-radius:0}.vertical-group[data-v-ba735fac] button:last-child{border-bottom-left-radius:var(--radius);border-bottom-right-radius:var(--radius);border-top-left-radius:0;border-top-right-radius:0}.attached-group[data-v-ba735fac]:not(.vertical-group) button:not(:first-child):not(.border):before{content:"";position:absolute;left:0;top:0;bottom:0;width:1px;background-color:currentColor;opacity:.15;z-index:5;pointer-events:none;height:100%}.vertical-group[data-v-ba735fac] button:not(:first-child):not(.border):before{content:"";position:absolute;top:0;left:0;right:0;height:1px;width:100%;background-color:currentColor;opacity:.15;z-index:5;pointer-events:none}.carousel-wrapper[data-v-655a78c8]{width:100%;position:relative}.IroBox{border-radius:8px!important}input[data-v-e7171c4f]::-webkit-outer-spin-button,input[data-v-e7171c4f]::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;margin:0}input[type=number][data-v-e7171c4f]{-moz-appearance:textfield;appearance:textfield}.custom-fields-table[data-v-ce6a94e8] .form-field-item{margin-bottom:0!important;height:100%}.custom-fields-table[data-v-ce6a94e8] input,.custom-fields-table[data-v-ce6a94e8] textarea{padding-left:1em;padding-right:.5em}.custom-fields-table[data-v-ce6a94e8] input,.custom-fields-table[data-v-ce6a94e8] textarea,.custom-fields-table[data-v-ce6a94e8] select,.custom-fields-table[data-v-ce6a94e8] .input-wrapper,.custom-fields-table[data-v-ce6a94e8] .tooltip-trigger button{border:none!important;background:transparent!important;box-shadow:none!important;border-radius:0!important;height:100%!important;min-height:40px}.custom-fields-table[data-v-ce6a94e8] .tooltip-trigger button{justify-content:space-between!important}.custom-fields-table[data-v-ce6a94e8] input:focus,.custom-fields-table[data-v-ce6a94e8] textarea:focus,.custom-fields-table[data-v-ce6a94e8] select:focus,.custom-fields-table[data-v-ce6a94e8] .input-wrapper:focus-within{background-color:hsla(var(--primary) / .03)!important;box-shadow:inset 0 0 0 2px hsla(var(--primary) / .1)!important}.custom-fields-table[data-v-ce6a94e8] .w-full{width:100%;height:100%}.list-enter-active[data-v-ce6a94e8]{transition:all .15s cubic-bezier(.16,1,.3,1)}.list-enter-from[data-v-ce6a94e8]{opacity:0;transform:translateY(-5px)}.form-field-item[data-v-47af145c]{display:flex;flex-direction:column}.form-field-item[data-v-47af145c]:has([role=switch]),.form-field-item[data-v-47af145c]:has([role=checkbox]){flex-direction:row;align-items:center}.form-container[data-v-
|
|
716
|
+
.accordion-enter-active[data-v-aa189e08],.accordion-leave-active[data-v-aa189e08]{transition:height .3s ease-in-out}.button-group[data-v-ba735fac] button{align-self:stretch;height:auto!important;min-height:unset!important;min-width:unset!important;width:auto!important}.button-group[data-v-ba735fac]:not(.vertical-group) button{aspect-ratio:unset}.attached-group[data-v-ba735fac] button{position:relative;--radius: .375rem}.attached-group[data-v-ba735fac] button:focus-visible,.attached-group[data-v-ba735fac] button:hover{z-index:10}.attached-group[data-v-ba735fac]:not(.vertical-group) button:not(:first-child){margin-left:-1px}.attached-group[data-v-ba735fac]:not(.vertical-group) button:first-child{border-top-left-radius:var(--radius);border-bottom-left-radius:var(--radius);border-top-right-radius:0;border-bottom-right-radius:0}.attached-group[data-v-ba735fac]:not(.vertical-group) button:not(:first-child):not(:last-child){border-radius:0}.attached-group[data-v-ba735fac]:not(.vertical-group) button:last-child{border-top-right-radius:var(--radius);border-bottom-right-radius:var(--radius);border-top-left-radius:0;border-bottom-left-radius:0}.vertical-group[data-v-ba735fac] button:not(:first-child){margin-top:-1px}.vertical-group[data-v-ba735fac] button:first-child{border-top-left-radius:var(--radius);border-top-right-radius:var(--radius);border-bottom-left-radius:0;border-bottom-right-radius:0}.vertical-group[data-v-ba735fac] button:not(:first-child):not(:last-child){border-radius:0}.vertical-group[data-v-ba735fac] button:last-child{border-bottom-left-radius:var(--radius);border-bottom-right-radius:var(--radius);border-top-left-radius:0;border-top-right-radius:0}.attached-group[data-v-ba735fac]:not(.vertical-group) button:not(:first-child):not(.border):before{content:"";position:absolute;left:0;top:0;bottom:0;width:1px;background-color:currentColor;opacity:.15;z-index:5;pointer-events:none;height:100%}.vertical-group[data-v-ba735fac] button:not(:first-child):not(.border):before{content:"";position:absolute;top:0;left:0;right:0;height:1px;width:100%;background-color:currentColor;opacity:.15;z-index:5;pointer-events:none}.carousel-wrapper[data-v-655a78c8]{width:100%;position:relative}.IroBox{border-radius:8px!important}input[data-v-e7171c4f]::-webkit-outer-spin-button,input[data-v-e7171c4f]::-webkit-inner-spin-button{-webkit-appearance:none;appearance:none;margin:0}input[type=number][data-v-e7171c4f]{-moz-appearance:textfield;appearance:textfield}.custom-fields-table[data-v-ce6a94e8] .form-field-item{margin-bottom:0!important;height:100%}.custom-fields-table[data-v-ce6a94e8] input,.custom-fields-table[data-v-ce6a94e8] textarea{padding-left:1em;padding-right:.5em}.custom-fields-table[data-v-ce6a94e8] input,.custom-fields-table[data-v-ce6a94e8] textarea,.custom-fields-table[data-v-ce6a94e8] select,.custom-fields-table[data-v-ce6a94e8] .input-wrapper,.custom-fields-table[data-v-ce6a94e8] .tooltip-trigger button{border:none!important;background:transparent!important;box-shadow:none!important;border-radius:0!important;height:100%!important;min-height:40px}.custom-fields-table[data-v-ce6a94e8] .tooltip-trigger button{justify-content:space-between!important}.custom-fields-table[data-v-ce6a94e8] input:focus,.custom-fields-table[data-v-ce6a94e8] textarea:focus,.custom-fields-table[data-v-ce6a94e8] select:focus,.custom-fields-table[data-v-ce6a94e8] .input-wrapper:focus-within{background-color:hsla(var(--primary) / .03)!important;box-shadow:inset 0 0 0 2px hsla(var(--primary) / .1)!important}.custom-fields-table[data-v-ce6a94e8] .w-full{width:100%;height:100%}.list-enter-active[data-v-ce6a94e8]{transition:all .15s cubic-bezier(.16,1,.3,1)}.list-enter-from[data-v-ce6a94e8]{opacity:0;transform:translateY(-5px)}.form-field-item[data-v-47af145c]{display:flex;flex-direction:column}.form-field-item[data-v-47af145c]:has([role=switch]),.form-field-item[data-v-47af145c]:has([role=checkbox]){flex-direction:row;align-items:center}.form-container[data-v-a67bf34e]{width:100%}.heatmap-container[data-v-00476f00]{width:100%;height:100%;display:flex;flex-direction:column;min-height:0}.heatmap-wrapper[data-v-00476f00]{width:100%;height:100%;overflow:auto;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:16px;box-sizing:border-box;position:relative}.heatmap-grid[data-v-00476f00]{width:fit-content;height:fit-content;transition:all .2s ease-in-out}.heatmap-cell[data-v-00476f00]{aspect-ratio:1 / 1;border-radius:2px;transition:all .15s ease-in-out;border:1px solid transparent;box-sizing:border-box}.heatmap-cell-interactive[data-v-00476f00]{cursor:pointer}.heatmap-cell-interactive[data-v-00476f00]:hover{transform:scale(1.1);border-color:var(--border);box-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;z-index:10;position:relative}.heatmap-cell-empty[data-v-00476f00]{opacity:.6}.heatmap-cell-hovered[data-v-00476f00]{outline:2px solid var(--primary);outline-offset:1px}.heatmap-cell-label[data-v-00476f00]{font-size:8px;font-weight:500;color:var(--foreground);opacity:.8;display:flex;align-items:center;justify-content:center;height:100%;width:100%;pointer-events:none}.heatmap-legend[data-v-00476f00]{display:flex;align-items:center;gap:.5rem;margin-top:1rem;font-size:.75rem;color:var(--muted-foreground);flex-shrink:0}.heatmap-legend-label[data-v-00476f00]{font-weight:500}.heatmap-legend-colors[data-v-00476f00]{display:flex;gap:.125rem}.heatmap-legend-item[data-v-00476f00]{width:.75rem;height:.75rem;border-radius:.375rem;border:1px solid var(--border)}@media(max-width:640px){.heatmap-wrapper[data-v-00476f00]{padding:12px}.heatmap-cell[data-v-00476f00]{border-radius:2px}.heatmap-cell-label[data-v-00476f00]{font-size:7px}}@media(min-width:641px)and (max-width:1023px){.heatmap-wrapper[data-v-00476f00]{padding:14px}.heatmap-cell[data-v-00476f00]{border-radius:2px}}@media(min-width:1024px){.heatmap-wrapper[data-v-00476f00]{padding:16px}.heatmap-cell[data-v-00476f00]{border-radius:3px}}.custom-scrollbar[data-v-9ac38977]::-webkit-scrollbar{width:0px}.custom-scrollbar[data-v-9ac38977]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar[data-v-9ac38977]::-webkit-scrollbar-thumb{background-color:var(--color-border);border-radius:10px}.custom-scrollbar-x[data-v-11bc76c9]::-webkit-scrollbar{height:8px}.custom-scrollbar-x[data-v-11bc76c9]::-webkit-scrollbar-track{background:transparent}.custom-scrollbar-x[data-v-11bc76c9]::-webkit-scrollbar-thumb{background-color:var(--color-border);border-radius:10px}.masonry-item[data-v-c29d0159]{content-visibility:auto;contain-intrinsic-size:1px 200px}.slide-right-enter-active[data-v-495f8aa0],.slide-right-leave-active[data-v-495f8aa0],.slide-left-enter-active[data-v-495f8aa0],.slide-left-leave-active[data-v-495f8aa0]{transition:transform .3s ease-in-out}.slide-right-enter-from[data-v-495f8aa0],.slide-right-leave-to[data-v-495f8aa0]{transform:translate(100%)}.slide-left-enter-from[data-v-495f8aa0],.slide-left-leave-to[data-v-495f8aa0]{transform:translate(-100%)}.sidebar-manu-item .tooltip-trigger{width:100%!important}.sidebar-menu-tooltip{margin-left:4px!important}[dir=rtl] .sidebar-menu-tooltip{margin-right:4px!important}.first-toast-enter-active[data-v-6b631840]{animation:first-toast-in-6b631840 .45s cubic-bezier(.23,1,.32,1) forwards}.first-toast-leave-active[data-v-6b631840]{transition:all .25s ease-in}.first-toast-leave-to[data-v-6b631840]{opacity:0;transform:scale(.98)}@keyframes first-toast-in-6b631840{0%{opacity:var(--entrance-opacity, .6);transform:translateY(var(--entrance-offset, 25px)) scale(.98)}to{opacity:1;transform:translateY(0) scale(1)}}.stack-toast-enter-active[data-v-6b631840],.stack-toast-leave-active[data-v-6b631840]{transition:all .3s cubic-bezier(.16,1,.3,1)}.stack-toast-enter-from[data-v-6b631840]{opacity:0;transform:scale(.95) translateY(10px)}.stack-toast-leave-to[data-v-6b631840]{opacity:0;transform:scale(.95)}.stack-toast-move[data-v-6b631840]{transition:transform .4s cubic-bezier(.16,1,.3,1)}.bg-stripe[data-v-454a1505]{background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-size:1rem 1rem}.animate-progress-stripe[data-v-454a1505]{animation:progress-stripe-454a1505 1s linear infinite}@keyframes progress-stripe-454a1505{0%{background-position:1rem 0}to{background-position:0 0}}.animate-progress-indeterminate[data-v-454a1505]{animation:progress-indeterminate-454a1505 1.5s infinite cubic-bezier(.65,.815,.735,.395)}@keyframes progress-indeterminate-454a1505{0%{transform:translate(-100%) scaleX(.2)}50%{transform:translate(0) scaleX(.5)}to{transform:translate(100%) scaleX(.2)}}
|
|
717
717
|
|
package/types/button.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type ButtonVariant = 'primary' | 'primary-light' | 'secondary' | 'danger' | 'danger-light' | 'warning' | 'warning-light' | 'info' | 'info-light' | 'success' | 'success-light' | 'outline' | 'outline-primary' | 'outline-danger' | 'outline-warning' | 'outline-info' | 'outline-success' | 'ghost' | 'link';
|
|
2
|
-
export type ButtonSize = 'xs' | '
|
|
3
|
-
export type ButtonRounded = 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
|
|
2
|
+
export type ButtonSize = 'xs' | 'sm' | 'sm2' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type ButtonRounded = 'none' | 'sm' | 'sm2' | 'md' | 'lg' | 'xl' | '2xl' | 'full';
|
|
4
4
|
export interface ButtonProps {
|
|
5
5
|
variant?: ButtonVariant;
|
|
6
6
|
size?: ButtonSize;
|