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 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 f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-9ccf0187"]]);
4
+ const p = /* @__PURE__ */ r(o, [["__scopeId", "data-v-353f6094"]]);
5
5
  export {
6
- f as default
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, {
@@ -4,6 +4,7 @@ function g() {
4
4
  const s = u(!1), a = u(null), i = d(), c = async (r, t) => {
5
5
  try {
6
6
  const e = r instanceof File ? r : r.file;
7
+ if (!e) return null;
7
8
  if (i.services?.upload)
8
9
  try {
9
10
  return await i.services.upload(e, t);
@@ -1,109 +1,117 @@
1
- import { ref as u, computed as $, watch as k } from "vue";
2
- import { initializeFormValues as j, deepClone as c, getNestedValue as N, evaluateConditional as y, setNestedValue as h, collectFileFields as B, filterNullCustomFields as G } from "../utils/form.utils.js";
3
- import { useFileUpload as H } from "./useFileUpload.js";
4
- function Y(q) {
5
- const { schema: i, values: V, isUpdate: d = !1, folderId: x, onSubmit: b } = q, { handleUploadFile: D, loading: J } = H(), t = u(j(i, V)), r = u({}), v = u(!1), n = u(!1), m = u(c(t.value)), f = $(() => i ? Array.isArray(i[0]) ? i.flat() : i : []);
6
- k(
7
- () => V,
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 = j(i, e), m.value = c(t.value), n.value = !1);
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 p = () => ({
13
+ const h = () => ({
14
14
  values: t.value,
15
- isUpdate: d
16
- }), g = (e) => N(t.value, e), O = (e) => r.value[e] || "", A = (e, l) => {
17
- l ? r.value[e] = l : delete r.value[e];
18
- }, F = () => {
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
- }, S = (e) => e.when ? y(e.when, p()) : !0, w = (e) => y(e.disabled, p()), z = (e) => y(e.readonly, p()), C = (e) => {
21
- const l = g(e.name);
22
- let a = "";
23
- return e.required && (l == null || l === "" || Array.isArray(l) && l.length === 0) && (a = `${e.label || e.name} is required`), !a && e.validation && (a = e.validation({
24
- value: l,
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: d
27
- })), a ? r.value[e.name] = a : delete r.value[e.name], a;
28
- }, E = () => {
29
- F();
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 l of f.value) {
32
- if (!S(l) || w(l)) continue;
33
- C(l) && (e = !1);
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
- }, I = (e, l, a) => {
37
- t.value = h(t.value, e, l), n.value = !0, delete r.value[e];
38
- const o = f.value.find((s) => s.name === e);
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: a,
43
- isUpdate: d,
44
- updateError: A
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
- }, L = async () => {
49
- const e = c(t.value), l = B(i, e);
50
- for (const a of l) {
51
- const { name: o, value: s, type: P } = a;
52
- if (s instanceof File || s && typeof s == "object" && s.file instanceof File) {
53
- const U = await D(s, x);
54
- U && Object.assign(e, h(e, o, U));
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 e;
58
- }, R = (e) => {
59
- const l = { ...e };
60
- for (const a of f.value)
61
- if (a.type === "customFields" && a.props?.schema) {
62
- const o = N(l, a.name);
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 = G(o, a.props.schema);
65
- Object.assign(l, h(l, a.name, s));
72
+ const s = L(o, l.props.schema);
73
+ Object.assign(a, w(a, l.name, s));
66
74
  }
67
75
  }
68
- return l;
76
+ return a;
69
77
  };
70
78
  return {
71
79
  formValues: t,
72
80
  errors: r,
73
- isSubmitting: v,
74
- isDirty: n,
75
- handleFieldChange: I,
76
- validateField: C,
77
- validateAll: E,
78
- isFieldVisible: S,
79
- isFieldDisabled: w,
80
- isFieldReadonly: z,
81
- getFieldValue: g,
82
- getFieldError: O,
83
- setFieldError: A,
84
- clearErrors: F,
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 = c(m.value), F(), n.value = !1;
94
+ t.value = f(y.value), V(), c.value = !1;
87
95
  },
88
96
  handleSubmit: async () => {
89
- if (E()) {
90
- v.value = !0;
97
+ if (q()) {
98
+ F.value = !0;
91
99
  try {
92
- let l = await L();
93
- l = R(l), b && await b({
94
- values: l,
95
- isUpdate: d
96
- }), n.value = !1, m.value = c(l);
97
- } catch (l) {
98
- throw console.error("[useForm] Submit error:", l), l;
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
- v.value = !1;
108
+ F.value = !1;
101
109
  }
102
110
  }
103
111
  },
104
- flatSchema: f
112
+ flatSchema: m
105
113
  };
106
114
  }
107
115
  export {
108
- Y as useForm
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'?(_: {}): any;
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;