vlite3 0.1.7 → 0.1.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/README.md +1 -0
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +1 -1
- package/components/Form/composables/useFileUpload.js +1 -0
- package/components/Form/composables/useForm.js +81 -73
- package/components/Navbar/Navbar.vue.d.ts +12 -1
- package/components/Navbar/Navbar.vue.js +151 -131
- package/components/SidePanel.vue.d.ts +2 -0
- package/components/SidePanel.vue.js +2 -2
- package/components/SidePanel.vue2.js +56 -52
- package/components/SidebarMenu/SidebarMenuItem.vue.js +1 -1
- package/components/Textarea.vue.js +1 -1
- package/components/ToastNotification.vue.js +2 -2
- package/components/ToastNotification.vue2.js +97 -95
- package/package.json +1 -1
- package/style.css +16 -13
- package/types/navbar.type.d.ts +4 -0
package/README.md
CHANGED
|
@@ -73,6 +73,7 @@ You can customize these colors in your CSS by overriding the variables in `:root
|
|
|
73
73
|
| `--secondary` | `bg-secondary` | Secondary background | Used for secondary actions or muted sections. |
|
|
74
74
|
| `--secondary-foreground` | `text-secondary-foreground` | Secondary text color | Text color for content on top of secondary background. |
|
|
75
75
|
| `--muted` | `bg-muted` | Muted background | Subtle backgrounds (e.g., table headers, disabled states). |
|
|
76
|
+
| `--muted` | `text-muted` | Muted Text | Secondary text, Unactive Link, description. |
|
|
76
77
|
| `--muted-foreground` | `text-muted-foreground` | Muted text color | Secondary text, hints, placeholders. |
|
|
77
78
|
| `--accent` | `bg-accent` | Accent background | Used for hover states, selection highlights. |
|
|
78
79
|
| `--accent-foreground` | `text-accent-foreground` | Accent text color | Text color on accent backgrounds. |
|
|
@@ -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
|
|
4
|
+
const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-353f6094"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -204,7 +204,7 @@ const le = {
|
|
|
204
204
|
class: h([
|
|
205
205
|
"form-footer flex items-center justify-end gap-3",
|
|
206
206
|
e.footerClass,
|
|
207
|
-
$.value ? "sticky bottom-0 z-20 bg-body pt-4 border-t border-border -mx-4 px-4 mt-4" : "mt-6"
|
|
207
|
+
$.value ? "sticky bottom-0 z-20 bg-body pt-4 border-t border-border/40 -mx-4 px-4 mt-4" : "mt-6"
|
|
208
208
|
])
|
|
209
209
|
}, [
|
|
210
210
|
G.value ? (s(), p(N, {
|
|
@@ -1,109 +1,117 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import { initializeFormValues as
|
|
3
|
-
import { useFileUpload as
|
|
4
|
-
function
|
|
5
|
-
const { schema:
|
|
6
|
-
|
|
7
|
-
() =>
|
|
1
|
+
import { ref as d, computed as H, watch as J } from "vue";
|
|
2
|
+
import { initializeFormValues as O, deepClone as f, getNestedValue as z, evaluateConditional as b, setNestedValue as w, collectFileFields as K, filterNullCustomFields as L } from "../utils/form.utils.js";
|
|
3
|
+
import { useFileUpload as M } from "./useFileUpload.js";
|
|
4
|
+
function ee(I) {
|
|
5
|
+
const { schema: n, values: A, isUpdate: v = !1, folderId: g, onSubmit: U } = I, { handleUploadFile: E } = M(), t = d(O(n, A)), r = d({}), F = d(!1), c = d(!1), y = d(f(t.value)), m = H(() => n ? Array.isArray(n[0]) ? n.flat() : n : []);
|
|
6
|
+
J(
|
|
7
|
+
() => A,
|
|
8
8
|
(e) => {
|
|
9
|
-
e && (t.value =
|
|
9
|
+
e && (t.value = O(n, e), y.value = f(t.value), c.value = !1);
|
|
10
10
|
},
|
|
11
11
|
{ deep: !0 }
|
|
12
12
|
);
|
|
13
|
-
const
|
|
13
|
+
const h = () => ({
|
|
14
14
|
values: t.value,
|
|
15
|
-
isUpdate:
|
|
16
|
-
}),
|
|
17
|
-
|
|
18
|
-
},
|
|
15
|
+
isUpdate: v
|
|
16
|
+
}), S = (e) => z(t.value, e), R = (e) => r.value[e] || "", C = (e, a) => {
|
|
17
|
+
a ? r.value[e] = a : delete r.value[e];
|
|
18
|
+
}, V = () => {
|
|
19
19
|
r.value = {};
|
|
20
|
-
},
|
|
21
|
-
const
|
|
22
|
-
let
|
|
23
|
-
return e.required && (
|
|
24
|
-
value:
|
|
20
|
+
}, j = (e) => e.when ? b(e.when, h()) : !0, P = (e) => b(e.disabled, h()), $ = (e) => b(e.readonly, h()), N = (e) => {
|
|
21
|
+
const a = S(e.name);
|
|
22
|
+
let l = "";
|
|
23
|
+
return e.required && (a == null || a === "" || Array.isArray(a) && a.length === 0) && (l = `${e.label || e.name} is required`), !l && e.validation && (l = e.validation({
|
|
24
|
+
value: a,
|
|
25
25
|
values: t.value,
|
|
26
|
-
isUpdate:
|
|
27
|
-
})),
|
|
28
|
-
},
|
|
29
|
-
|
|
26
|
+
isUpdate: v
|
|
27
|
+
})), l ? r.value[e.name] = l : delete r.value[e.name], l;
|
|
28
|
+
}, q = () => {
|
|
29
|
+
V();
|
|
30
30
|
let e = !0;
|
|
31
|
-
for (const
|
|
32
|
-
if (!
|
|
33
|
-
|
|
31
|
+
for (const a of m.value) {
|
|
32
|
+
if (!j(a) || P(a)) continue;
|
|
33
|
+
N(a) && (e = !1);
|
|
34
34
|
}
|
|
35
35
|
return e;
|
|
36
|
-
},
|
|
37
|
-
t.value =
|
|
38
|
-
const o =
|
|
36
|
+
}, k = (e, a, l) => {
|
|
37
|
+
t.value = w(t.value, e, a), c.value = !0, delete r.value[e];
|
|
38
|
+
const o = m.value.find((s) => s.name === e);
|
|
39
39
|
if (o?.updateValues) {
|
|
40
40
|
const s = o.updateValues({
|
|
41
41
|
values: t.value,
|
|
42
|
-
data:
|
|
43
|
-
isUpdate:
|
|
44
|
-
updateError:
|
|
42
|
+
data: l,
|
|
43
|
+
isUpdate: v,
|
|
44
|
+
updateError: C
|
|
45
45
|
});
|
|
46
46
|
s && typeof s == "object" && (t.value = { ...t.value, ...s });
|
|
47
47
|
}
|
|
48
|
-
},
|
|
49
|
-
const e =
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
48
|
+
}, B = async () => {
|
|
49
|
+
const e = f(t.value), l = K(n, e).map(async (s) => {
|
|
50
|
+
const { name: x, value: i } = s;
|
|
51
|
+
if (Array.isArray(i)) {
|
|
52
|
+
const D = i.map(async (u) => u instanceof File || u && typeof u == "object" && u.file instanceof File ? await E(u, g) || null : u), p = await Promise.all(D);
|
|
53
|
+
return { name: x, value: p };
|
|
54
|
+
} else {
|
|
55
|
+
if (i instanceof File || i && typeof i == "object" && i.file instanceof File) {
|
|
56
|
+
const p = await E(i, g);
|
|
57
|
+
if (p)
|
|
58
|
+
return { name: x, value: p };
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
55
61
|
}
|
|
56
|
-
}
|
|
57
|
-
return
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
62
|
+
});
|
|
63
|
+
return (await Promise.all(l)).forEach((s) => {
|
|
64
|
+
s && Object.assign(e, w(e, s.name, s.value));
|
|
65
|
+
}), e;
|
|
66
|
+
}, G = (e) => {
|
|
67
|
+
const a = { ...e };
|
|
68
|
+
for (const l of m.value)
|
|
69
|
+
if (l.type === "customFields" && l.props?.schema) {
|
|
70
|
+
const o = z(a, l.name);
|
|
63
71
|
if (Array.isArray(o)) {
|
|
64
|
-
const s =
|
|
65
|
-
Object.assign(
|
|
72
|
+
const s = L(o, l.props.schema);
|
|
73
|
+
Object.assign(a, w(a, l.name, s));
|
|
66
74
|
}
|
|
67
75
|
}
|
|
68
|
-
return
|
|
76
|
+
return a;
|
|
69
77
|
};
|
|
70
78
|
return {
|
|
71
79
|
formValues: t,
|
|
72
80
|
errors: r,
|
|
73
|
-
isSubmitting:
|
|
74
|
-
isDirty:
|
|
75
|
-
handleFieldChange:
|
|
76
|
-
validateField:
|
|
77
|
-
validateAll:
|
|
78
|
-
isFieldVisible:
|
|
79
|
-
isFieldDisabled:
|
|
80
|
-
isFieldReadonly:
|
|
81
|
-
getFieldValue:
|
|
82
|
-
getFieldError:
|
|
83
|
-
setFieldError:
|
|
84
|
-
clearErrors:
|
|
81
|
+
isSubmitting: F,
|
|
82
|
+
isDirty: c,
|
|
83
|
+
handleFieldChange: k,
|
|
84
|
+
validateField: N,
|
|
85
|
+
validateAll: q,
|
|
86
|
+
isFieldVisible: j,
|
|
87
|
+
isFieldDisabled: P,
|
|
88
|
+
isFieldReadonly: $,
|
|
89
|
+
getFieldValue: S,
|
|
90
|
+
getFieldError: R,
|
|
91
|
+
setFieldError: C,
|
|
92
|
+
clearErrors: V,
|
|
85
93
|
resetForm: () => {
|
|
86
|
-
t.value =
|
|
94
|
+
t.value = f(y.value), V(), c.value = !1;
|
|
87
95
|
},
|
|
88
96
|
handleSubmit: async () => {
|
|
89
|
-
if (
|
|
90
|
-
|
|
97
|
+
if (q()) {
|
|
98
|
+
F.value = !0;
|
|
91
99
|
try {
|
|
92
|
-
let
|
|
93
|
-
|
|
94
|
-
values:
|
|
95
|
-
isUpdate:
|
|
96
|
-
}),
|
|
97
|
-
} catch (
|
|
98
|
-
throw console.error("[useForm] Submit error:",
|
|
100
|
+
let a = await B();
|
|
101
|
+
a = G(a), U && await U({
|
|
102
|
+
values: a,
|
|
103
|
+
isUpdate: v
|
|
104
|
+
}), c.value = !1, y.value = f(a);
|
|
105
|
+
} catch (a) {
|
|
106
|
+
throw console.error("[useForm] Submit error:", a), a;
|
|
99
107
|
} finally {
|
|
100
|
-
|
|
108
|
+
F.value = !1;
|
|
101
109
|
}
|
|
102
110
|
}
|
|
103
111
|
},
|
|
104
|
-
flatSchema:
|
|
112
|
+
flatSchema: m
|
|
105
113
|
};
|
|
106
114
|
}
|
|
107
115
|
export {
|
|
108
|
-
|
|
116
|
+
ee as useForm
|
|
109
117
|
};
|
|
@@ -2,7 +2,14 @@ import { NavbarProps } from '../../types/navbar.type';
|
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
attrs: Partial<{}>;
|
|
4
4
|
slots: {
|
|
5
|
-
'mobile-trigger'?(_: {
|
|
5
|
+
'mobile-trigger'?(_: {
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
toggle: () => boolean;
|
|
8
|
+
}): any;
|
|
9
|
+
'mobile-trigger'?(_: {
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
toggle: () => boolean;
|
|
12
|
+
}): any;
|
|
6
13
|
logo?(_: {}): any;
|
|
7
14
|
logo?(_: {}): any;
|
|
8
15
|
logo?(_: {}): any;
|
|
@@ -35,6 +42,7 @@ declare const __VLS_component: import('vue').DefineComponent<NavbarProps, {}, {}
|
|
|
35
42
|
width: string;
|
|
36
43
|
height: string;
|
|
37
44
|
variant: import('../../types/navbar.type').NavbarVariant;
|
|
45
|
+
contentClass: string;
|
|
38
46
|
border: boolean;
|
|
39
47
|
position: import('../../types/navbar.type').NavbarPosition;
|
|
40
48
|
compact: boolean;
|
|
@@ -42,6 +50,9 @@ declare const __VLS_component: import('vue').DefineComponent<NavbarProps, {}, {}
|
|
|
42
50
|
glass: boolean;
|
|
43
51
|
floating: boolean;
|
|
44
52
|
mobileBreakpoint: "sm" | "md" | "lg" | "xl";
|
|
53
|
+
logoClass: string;
|
|
54
|
+
rightClass: string;
|
|
55
|
+
mobileTriggerClass: string;
|
|
45
56
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLElement>;
|
|
46
57
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
47
58
|
export default _default;
|