vlite3 0.9.5 → 0.9.6
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/ColorPicker/ColorIro.vue3.js +2 -2
- package/components/ColorPicker/ColorPicker.vue.js +2 -2
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/Form/composables/useForm.js +31 -31
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/package.json +1 -1
- /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
|
@@ -6,8 +6,8 @@ import O from "../Input.vue.js";
|
|
|
6
6
|
import "../../core/config.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
import y from "../Button.vue.js";
|
|
9
|
-
import E from "./ColorIro.
|
|
10
|
-
/* empty css
|
|
9
|
+
import E from "./ColorIro.vue2.js";
|
|
10
|
+
/* empty css */
|
|
11
11
|
import { useEyeDropper as P } from "@vueuse/core";
|
|
12
12
|
const I = {
|
|
13
13
|
key: 0,
|
|
@@ -4,7 +4,7 @@ import k from "../Icon.vue.js";
|
|
|
4
4
|
import { $t as E } from "../../utils/i18n.js";
|
|
5
5
|
import { useCommandPaletteItems as Y } from "./useCommandPaletteItems.js";
|
|
6
6
|
import { useCommandPaletteNav as Z } from "./useCommandPaletteNav.js";
|
|
7
|
-
import ee from "./CommandPaletteItem.
|
|
7
|
+
import ee from "./CommandPaletteItem.vue2.js";
|
|
8
8
|
const te = { class: "command-palette-content flex flex-col w-full h-full max-h-[70vh]" }, oe = { class: "flex items-center gap-3 px-4 py-3 border-b border-border/60 shrink-0" }, se = ["placeholder"], ne = ["aria-label"], re = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "flex flex-col items-center justify-center py-14 px-6 text-center select-none",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as w, shallowRef as Q, computed as W, watch as X } from "vue";
|
|
2
2
|
import { deepClone as m, initializeFormValues as Y, cleanSubmitValues as Z, getNestedValue as R, evaluateConditional as $, setNestedValue as z, collectFileFields as _, filterNullCustomFields as ee } from "../utils/form.utils.js";
|
|
3
3
|
import { useFileUpload as le } from "./useFileUpload.js";
|
|
4
4
|
import { $t as ae } from "../../../utils/i18n.js";
|
|
5
5
|
function ce(S) {
|
|
6
|
-
const { schema: d, values: F, isUpdate:
|
|
6
|
+
const { schema: d, values: F, isUpdate: V = !1, folderId: C, onSubmit: I } = S, { handleUploadFile: N } = le(), r = w(F ? m(F) : {}), f = w({}), j = w(!1), b = w(!1), p = w({}), g = Q(
|
|
7
7
|
F ? m(F) : {}
|
|
8
8
|
), A = W(() => d ? Array.isArray(d[0]) ? d.flat() : d : []), O = async (e) => {
|
|
9
9
|
try {
|
|
10
10
|
const l = await Y(d, e);
|
|
11
|
-
|
|
11
|
+
r.value = l, g.value = m(l), b.value = !1;
|
|
12
12
|
} catch (l) {
|
|
13
13
|
console.error("[useForm] Initialization error:", l);
|
|
14
14
|
}
|
|
@@ -21,9 +21,9 @@ function ce(S) {
|
|
|
21
21
|
{ deep: !0 }
|
|
22
22
|
);
|
|
23
23
|
const U = () => ({
|
|
24
|
-
values:
|
|
25
|
-
isUpdate:
|
|
26
|
-
}), D = (e) => R(
|
|
24
|
+
values: r.value,
|
|
25
|
+
isUpdate: V
|
|
26
|
+
}), D = (e) => R(r.value, e), G = (e) => f.value[e] || "", P = (e, l) => {
|
|
27
27
|
l ? f.value[e] = l : delete f.value[e];
|
|
28
28
|
}, x = () => {
|
|
29
29
|
f.value = {};
|
|
@@ -35,8 +35,8 @@ function ce(S) {
|
|
|
35
35
|
const i = e.maxFileSize * 1024 * 1024;
|
|
36
36
|
if (l != null && l !== "") {
|
|
37
37
|
const s = Array.isArray(l) ? l : [l];
|
|
38
|
-
for (const
|
|
39
|
-
const a =
|
|
38
|
+
for (const o of s) {
|
|
39
|
+
const a = o instanceof File ? o.size : o?.fileSize || o?.file?.size || o?.size;
|
|
40
40
|
if (a !== void 0 && a > i) {
|
|
41
41
|
t = `${n} size must be less than ${e.maxFileSize}MB`;
|
|
42
42
|
break;
|
|
@@ -53,8 +53,8 @@ function ce(S) {
|
|
|
53
53
|
try {
|
|
54
54
|
t = await e.validation({
|
|
55
55
|
value: l,
|
|
56
|
-
values:
|
|
57
|
-
isUpdate:
|
|
56
|
+
values: r.value,
|
|
57
|
+
isUpdate: V
|
|
58
58
|
});
|
|
59
59
|
} catch (i) {
|
|
60
60
|
console.error(`[useForm] Validation error in field ${e.name}:`, i), t = "Validation failed";
|
|
@@ -77,16 +77,16 @@ function ce(S) {
|
|
|
77
77
|
console.warn(`[vlite3/useForm] Blocked attempted update to disabled/readonly field: ${e}`);
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
if (
|
|
80
|
+
if (r.value = z(r.value, e, l), b.value = !0, delete f.value[e], n?.updateValues) {
|
|
81
81
|
p.value[e] = !0;
|
|
82
82
|
try {
|
|
83
83
|
const i = await n.updateValues({
|
|
84
|
-
values:
|
|
84
|
+
values: r.value,
|
|
85
85
|
data: t,
|
|
86
|
-
isUpdate:
|
|
86
|
+
isUpdate: V,
|
|
87
87
|
updateError: P
|
|
88
88
|
});
|
|
89
|
-
|
|
89
|
+
i && typeof i == "object" && (r.value = { ...r.value, ...i });
|
|
90
90
|
} catch (i) {
|
|
91
91
|
console.error(`[useForm] Error in updateValues for ${e}:`, i);
|
|
92
92
|
} finally {
|
|
@@ -94,22 +94,22 @@ function ce(S) {
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
}, J = async () => {
|
|
97
|
-
const e = m(
|
|
97
|
+
const e = m(r.value), l = _(d, e), t = (s, o) => {
|
|
98
98
|
let a = null;
|
|
99
99
|
s instanceof File ? a = s : s && typeof s == "object" && s.file instanceof File && (a = s.file);
|
|
100
100
|
const h = {
|
|
101
101
|
...typeof s == "object" ? s : {},
|
|
102
|
-
fileName: s?.fileName || a?.name ||
|
|
103
|
-
fileUrl:
|
|
102
|
+
fileName: s?.fileName || a?.name || o.split("/").pop() || "unknown",
|
|
103
|
+
fileUrl: o,
|
|
104
104
|
fileType: s?.fileType || a?.type || "application/octet-stream",
|
|
105
105
|
fileSize: s?.fileSize || a?.size || 0
|
|
106
106
|
};
|
|
107
107
|
return delete h.file, delete h.base64, h;
|
|
108
108
|
}, n = l.map(async (s) => {
|
|
109
|
-
const { name:
|
|
109
|
+
const { name: o, value: a, field: h } = s, L = h.returnFileObject === !0, M = Array.isArray(a) ? a.some(
|
|
110
110
|
(v) => v instanceof File || v && typeof v == "object" && v.file instanceof File
|
|
111
111
|
) : a instanceof File || a && typeof a == "object" && a.file instanceof File;
|
|
112
|
-
M && (p.value[
|
|
112
|
+
M && (p.value[o] = !0);
|
|
113
113
|
try {
|
|
114
114
|
if (Array.isArray(a)) {
|
|
115
115
|
const v = a.map(async (u) => {
|
|
@@ -123,24 +123,24 @@ function ce(S) {
|
|
|
123
123
|
}
|
|
124
124
|
return u;
|
|
125
125
|
}), c = await Promise.all(v);
|
|
126
|
-
return { name:
|
|
126
|
+
return { name: o, value: c };
|
|
127
127
|
} else {
|
|
128
128
|
if (a instanceof File || a && typeof a == "object" && a.file instanceof File) {
|
|
129
129
|
const c = await N(a, C);
|
|
130
130
|
if (c)
|
|
131
|
-
return { name:
|
|
131
|
+
return { name: o, value: L ? t(a, c) : c };
|
|
132
132
|
} else if (a && typeof a == "object") {
|
|
133
133
|
const c = { ...a };
|
|
134
|
-
return delete c.file, delete c.base64, { name:
|
|
134
|
+
return delete c.file, delete c.base64, { name: o, value: c };
|
|
135
135
|
}
|
|
136
136
|
return null;
|
|
137
137
|
}
|
|
138
138
|
} finally {
|
|
139
|
-
M && (p.value[
|
|
139
|
+
M && (p.value[o] = !1);
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
142
|
return (await Promise.all(n)).forEach((s) => {
|
|
143
|
-
s && (Object.assign(e, z(e, s.name, s.value)),
|
|
143
|
+
s && (Object.assign(e, z(e, s.name, s.value)), r.value = z(r.value, s.name, s.value));
|
|
144
144
|
}), e;
|
|
145
145
|
}, K = (e) => {
|
|
146
146
|
const l = { ...e };
|
|
@@ -155,9 +155,9 @@ function ce(S) {
|
|
|
155
155
|
return l;
|
|
156
156
|
};
|
|
157
157
|
return {
|
|
158
|
-
formValues:
|
|
158
|
+
formValues: r,
|
|
159
159
|
errors: f,
|
|
160
|
-
isSubmitting:
|
|
160
|
+
isSubmitting: j,
|
|
161
161
|
isDirty: b,
|
|
162
162
|
fieldLoading: p,
|
|
163
163
|
handleFieldChange: H,
|
|
@@ -171,11 +171,11 @@ function ce(S) {
|
|
|
171
171
|
setFieldError: P,
|
|
172
172
|
clearErrors: x,
|
|
173
173
|
resetForm: () => {
|
|
174
|
-
|
|
174
|
+
r.value = m(g.value), x(), b.value = !1;
|
|
175
175
|
},
|
|
176
176
|
handleSubmit: async () => {
|
|
177
177
|
if (await q()) {
|
|
178
|
-
|
|
178
|
+
j.value = !0;
|
|
179
179
|
try {
|
|
180
180
|
let l = await J();
|
|
181
181
|
l = K(l), l = await Z(
|
|
@@ -185,12 +185,12 @@ function ce(S) {
|
|
|
185
185
|
S.emitFields
|
|
186
186
|
), I && await I({
|
|
187
187
|
values: l,
|
|
188
|
-
isUpdate:
|
|
189
|
-
}), b.value = !1,
|
|
188
|
+
isUpdate: V
|
|
189
|
+
}), b.value = !1, g.value = m(l);
|
|
190
190
|
} catch (l) {
|
|
191
191
|
throw console.error("[useForm] Submit error:", l), l;
|
|
192
192
|
} finally {
|
|
193
|
-
|
|
193
|
+
j.value = !1;
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
},
|
|
@@ -3,7 +3,7 @@ import L from "./Icon.vue.js";
|
|
|
3
3
|
import v from "./Modal.vue.js";
|
|
4
4
|
import N from "./CommandPalette/CommandPaletteContent.vue.js";
|
|
5
5
|
import { $t as R } from "../utils/i18n.js";
|
|
6
|
-
/* empty css
|
|
6
|
+
/* empty css */
|
|
7
7
|
const U = { class: "block truncate -text-fs-1.5" }, V = { class: "ml-auto inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-mono font-medium border border-border/80 bg-background text-muted-foreground ml-1" }, q = /* @__PURE__ */ x({
|
|
8
8
|
__name: "NavbarCommandPalette",
|
|
9
9
|
props: {
|
|
@@ -12,7 +12,7 @@ import "v-datepicker-lite";
|
|
|
12
12
|
import "v-datepicker-lite/style.css";
|
|
13
13
|
import "@jaames/iro";
|
|
14
14
|
import "@vueuse/core";
|
|
15
|
-
/* empty css
|
|
15
|
+
/* empty css */
|
|
16
16
|
import "iconify-icon-picker";
|
|
17
17
|
import "iconify-icon-picker/style.css";
|
|
18
18
|
import "vue-draggable-plus";
|
package/package.json
CHANGED
|
File without changes
|