vlite3 0.3.1 → 0.3.4
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/AvatarUploader/AvatarUploader.vue.d.ts +2 -2
- package/components/AvatarUploader/AvatarUploader.vue.js +53 -36
- package/components/DataList/DataList.vue.d.ts +47 -0
- package/components/DataList/DataList.vue.js +98 -0
- package/components/DataList/DataList.vue2.js +4 -0
- package/components/DataList/index.d.ts +2 -0
- package/components/DataList/types.d.ts +23 -0
- package/components/FilePicker/FilePicker.vue.d.ts +1 -0
- package/components/FilePicker/FilePicker.vue.js +159 -139
- package/components/Form/FormField.vue.js +53 -50
- package/components/Form/composables/useForm.js +80 -63
- package/components/Form/types.d.ts +4 -0
- package/components/ThemeToggle.vue.d.ts +8 -1
- package/components/ThemeToggle.vue.js +23 -14
- package/index.d.ts +1 -0
- package/index.js +13 -11
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as N, computed as n, markRaw as P, openBlock as r, createBlock as
|
|
1
|
+
import { defineComponent as N, computed as n, markRaw as P, openBlock as r, createBlock as f, mergeProps as u, toHandlers as S, createSlots as B, unref as R, withCtx as o, createVNode as z, createTextVNode as c, toDisplayString as m, createCommentVNode as L, resolveDynamicComponent as O } from "vue";
|
|
2
2
|
import { isComponent as h, isAddonObject as p } from "./utils/form.utils.js";
|
|
3
3
|
import I from "../NumberInput.vue.js";
|
|
4
4
|
import v from "../Button.vue.js";
|
|
@@ -14,7 +14,7 @@ import G from "../DatePicker.vue.js";
|
|
|
14
14
|
import J from "../ColorPicker/ColorPicker.vue.js";
|
|
15
15
|
import K from "../IconPicker.vue.js";
|
|
16
16
|
import M from "./CustomFields.vue.js";
|
|
17
|
-
const
|
|
17
|
+
const ue = /* @__PURE__ */ N({
|
|
18
18
|
__name: "FormField",
|
|
19
19
|
props: {
|
|
20
20
|
field: {},
|
|
@@ -29,12 +29,12 @@ const fe = /* @__PURE__ */ N({
|
|
|
29
29
|
isUpdate: { type: Boolean, default: !1 }
|
|
30
30
|
},
|
|
31
31
|
emits: ["change", "addonChange", "addonAction"],
|
|
32
|
-
setup(l, { emit:
|
|
33
|
-
const e = l, s =
|
|
32
|
+
setup(l, { emit: $ }) {
|
|
33
|
+
const e = l, s = $, i = (t, a) => {
|
|
34
34
|
s("change", { value: t, data: a });
|
|
35
|
-
},
|
|
35
|
+
}, C = (t) => {
|
|
36
36
|
s("change", { value: t });
|
|
37
|
-
},
|
|
37
|
+
}, F = n(() => {
|
|
38
38
|
const t = e.field.type;
|
|
39
39
|
if (h(t))
|
|
40
40
|
return P(t);
|
|
@@ -75,7 +75,7 @@ const fe = /* @__PURE__ */ N({
|
|
|
75
75
|
default:
|
|
76
76
|
return g;
|
|
77
77
|
}
|
|
78
|
-
}),
|
|
78
|
+
}), x = n(() => {
|
|
79
79
|
const t = e.field.type, a = {
|
|
80
80
|
disabled: e.disabled || e.field.disabled === !0,
|
|
81
81
|
...e.field.props || {}
|
|
@@ -147,17 +147,20 @@ const fe = /* @__PURE__ */ N({
|
|
|
147
147
|
...a,
|
|
148
148
|
modelValue: e.value,
|
|
149
149
|
multiSelect: e.field.props?.multiple || !1,
|
|
150
|
+
maxFiles: e.field.maxFiles || e.field.props?.maxFiles,
|
|
150
151
|
fileTypes: e.field.props?.accept ? e.field.props.accept.split(",") : [],
|
|
151
152
|
returnFormat: "base64",
|
|
152
153
|
variant: t === "file" ? "input" : "dropzone",
|
|
153
154
|
placeholder: e.field.placeholder,
|
|
154
155
|
size: e.size,
|
|
155
|
-
rounded: e.rounded
|
|
156
|
+
rounded: e.rounded,
|
|
157
|
+
maxSize: e.field.maxFileSize ? e.field.maxFileSize * 1024 * 1024 : void 0
|
|
156
158
|
} : t === "avatarUpload" ? {
|
|
157
159
|
size: "2xl",
|
|
158
160
|
...a,
|
|
159
161
|
modelValue: e.value,
|
|
160
|
-
editable: !e.readonly
|
|
162
|
+
editable: !e.readonly,
|
|
163
|
+
maxSize: e.field.maxFileSize ? e.field.maxFileSize * 1024 * 1024 : void 0
|
|
161
164
|
} : t === "color" ? {
|
|
162
165
|
...a,
|
|
163
166
|
modelValue: e.value || "#000000"
|
|
@@ -179,79 +182,79 @@ const fe = /* @__PURE__ */ N({
|
|
|
179
182
|
value: e.value,
|
|
180
183
|
values: e.values
|
|
181
184
|
} : a;
|
|
182
|
-
}),
|
|
185
|
+
}), V = n(() => {
|
|
183
186
|
const t = e.field.type;
|
|
184
187
|
return t === "text" || t === "email" || t === "password" || t === "tel" || t === "url" || t === "search" || t === "textarea" || t === "switch" || t === "check" || t === "number" || !t ? {
|
|
185
|
-
"update:modelValue":
|
|
188
|
+
"update:modelValue": C
|
|
186
189
|
} : t === "select" ? {
|
|
187
190
|
onSelect: (a) => {
|
|
188
|
-
|
|
191
|
+
i(a.value, a.data);
|
|
189
192
|
}
|
|
190
193
|
} : t === "multiSelect" ? {
|
|
191
|
-
change: (a) =>
|
|
194
|
+
change: (a) => i(a)
|
|
192
195
|
} : t === "date" || t === "time" ? {
|
|
193
|
-
change: (a) =>
|
|
196
|
+
change: (a) => i(a)
|
|
194
197
|
} : t === "fileUploader" || t === "file" ? {
|
|
195
198
|
change: (a) => {
|
|
196
|
-
|
|
199
|
+
i(a);
|
|
197
200
|
},
|
|
198
201
|
"update:modelValue": (a) => {
|
|
199
|
-
|
|
202
|
+
i(a);
|
|
200
203
|
}
|
|
201
204
|
} : t === "avatarUpload" ? {
|
|
202
205
|
change: (a) => {
|
|
203
|
-
|
|
206
|
+
i(a);
|
|
204
207
|
},
|
|
205
208
|
"update:modelValue": (a) => {
|
|
206
|
-
|
|
209
|
+
i(a);
|
|
207
210
|
}
|
|
208
211
|
} : t === "color" ? {
|
|
209
|
-
change: (a) =>
|
|
212
|
+
change: (a) => i(a)
|
|
210
213
|
} : t === "iconPicker" ? {
|
|
211
|
-
onSelect: (a) =>
|
|
214
|
+
onSelect: (a) => i(a)
|
|
212
215
|
} : t === "customFields" ? {
|
|
213
|
-
change: (a) =>
|
|
216
|
+
change: (a) => i(a)
|
|
214
217
|
} : h(t) ? {
|
|
215
218
|
onChange: (a) => {
|
|
216
|
-
|
|
219
|
+
i(a.value, a.data);
|
|
217
220
|
}
|
|
218
221
|
} : {};
|
|
219
|
-
}),
|
|
222
|
+
}), w = n(() => p(e.field.addonLeft) || p(e.field.addonRight)), A = n(() => {
|
|
220
223
|
const t = e.field.type;
|
|
221
224
|
return t === "text" || t === "email" || t === "password" || t === "tel" || t === "url" || t === "search" || !t;
|
|
222
|
-
}),
|
|
225
|
+
}), U = n(() => w.value && A.value), b = (t, a) => {
|
|
223
226
|
s("addonChange", t.name, { value: a.value });
|
|
224
|
-
},
|
|
227
|
+
}, k = (t) => {
|
|
225
228
|
t.action && s("addonAction", t.action);
|
|
226
229
|
};
|
|
227
|
-
return (t, a) =>
|
|
228
|
-
...
|
|
230
|
+
return (t, a) => U.value ? (r(), f(g, u({ key: 0 }, {
|
|
231
|
+
...x.value,
|
|
229
232
|
...l.field?.props || {}
|
|
230
|
-
},
|
|
231
|
-
|
|
233
|
+
}, S(V.value)), B({ _: 2 }, [
|
|
234
|
+
R(p)(l.field.addonLeft) ? {
|
|
232
235
|
name: "addon-left",
|
|
233
236
|
fn: o(() => [
|
|
234
|
-
l.field.addonLeft.type === "select" ? (r(),
|
|
237
|
+
l.field.addonLeft.type === "select" ? (r(), f(y, u({
|
|
235
238
|
key: 0,
|
|
236
|
-
modelValue: l.values[l.field.addonLeft.name],
|
|
239
|
+
modelValue: l.field.addonLeft.name ? l.values[l.field.addonLeft.name] : void 0,
|
|
237
240
|
options: l.field.addonLeft.options || []
|
|
238
241
|
}, l.field.addonLeft.props || {}, {
|
|
239
|
-
onOnSelect: a[0] || (a[0] = (
|
|
242
|
+
onOnSelect: a[0] || (a[0] = (d) => b(l.field.addonLeft, d))
|
|
240
243
|
}), {
|
|
241
|
-
trigger: o(({ selectedLabel:
|
|
242
|
-
|
|
244
|
+
trigger: o(({ selectedLabel: d }) => [
|
|
245
|
+
z(v, { variant: "outline" }, {
|
|
243
246
|
default: o(() => [
|
|
244
|
-
c(m(
|
|
247
|
+
c(m(d), 1)
|
|
245
248
|
]),
|
|
246
249
|
_: 2
|
|
247
250
|
}, 1024)
|
|
248
251
|
]),
|
|
249
252
|
_: 1
|
|
250
|
-
}, 16, ["modelValue", "options"])) : l.field.addonLeft.type === "button" ? (r(),
|
|
253
|
+
}, 16, ["modelValue", "options"])) : l.field.addonLeft.type === "button" ? (r(), f(v, u({
|
|
251
254
|
key: 1,
|
|
252
255
|
variant: "outline"
|
|
253
256
|
}, l.field.addonLeft.props || {}, {
|
|
254
|
-
onClick: a[1] || (a[1] = (
|
|
257
|
+
onClick: a[1] || (a[1] = (d) => k(l.field.addonLeft))
|
|
255
258
|
}), {
|
|
256
259
|
default: o(() => [
|
|
257
260
|
c(m(l.field.addonLeft.text), 1)
|
|
@@ -261,30 +264,30 @@ const fe = /* @__PURE__ */ N({
|
|
|
261
264
|
]),
|
|
262
265
|
key: "0"
|
|
263
266
|
} : void 0,
|
|
264
|
-
|
|
267
|
+
R(p)(l.field.addonRight) ? {
|
|
265
268
|
name: "addon-right",
|
|
266
269
|
fn: o(() => [
|
|
267
|
-
l.field.addonRight.type === "select" ? (r(),
|
|
270
|
+
l.field.addonRight.type === "select" ? (r(), f(y, u({
|
|
268
271
|
key: 0,
|
|
269
|
-
modelValue: l.values[l.field.addonRight.name],
|
|
272
|
+
modelValue: l.field.addonRight.name ? l.values[l.field.addonRight.name] : void 0,
|
|
270
273
|
options: l.field.addonRight.options || []
|
|
271
274
|
}, l.field.addonRight.props || {}, {
|
|
272
|
-
onOnSelect: a[2] || (a[2] = (
|
|
275
|
+
onOnSelect: a[2] || (a[2] = (d) => b(l.field.addonRight, d))
|
|
273
276
|
}), {
|
|
274
|
-
trigger: o(({ selectedLabel:
|
|
275
|
-
|
|
277
|
+
trigger: o(({ selectedLabel: d }) => [
|
|
278
|
+
z(v, { variant: "outline" }, {
|
|
276
279
|
default: o(() => [
|
|
277
|
-
c(m(
|
|
280
|
+
c(m(d), 1)
|
|
278
281
|
]),
|
|
279
282
|
_: 2
|
|
280
283
|
}, 1024)
|
|
281
284
|
]),
|
|
282
285
|
_: 1
|
|
283
|
-
}, 16, ["modelValue", "options"])) : l.field.addonRight.type === "button" ? (r(),
|
|
286
|
+
}, 16, ["modelValue", "options"])) : l.field.addonRight.type === "button" ? (r(), f(v, u({
|
|
284
287
|
key: 1,
|
|
285
288
|
variant: "outline"
|
|
286
289
|
}, l.field.addonRight.props || {}, {
|
|
287
|
-
onClick: a[3] || (a[3] = (
|
|
290
|
+
onClick: a[3] || (a[3] = (d) => k(l.field.addonRight))
|
|
288
291
|
}), {
|
|
289
292
|
default: o(() => [
|
|
290
293
|
c(m(l.field.addonRight.text), 1)
|
|
@@ -294,12 +297,12 @@ const fe = /* @__PURE__ */ N({
|
|
|
294
297
|
]),
|
|
295
298
|
key: "1"
|
|
296
299
|
} : void 0
|
|
297
|
-
]), 1040)) : (r(),
|
|
298
|
-
...
|
|
300
|
+
]), 1040)) : (r(), f(O(F.value), u({ key: 1 }, {
|
|
301
|
+
...x.value,
|
|
299
302
|
...l.field?.props || {}
|
|
300
|
-
},
|
|
303
|
+
}, S(V.value)), null, 16));
|
|
301
304
|
}
|
|
302
305
|
});
|
|
303
306
|
export {
|
|
304
|
-
|
|
307
|
+
ue as default
|
|
305
308
|
};
|
|
@@ -1,115 +1,132 @@
|
|
|
1
|
-
import { ref as d, computed as
|
|
2
|
-
import { initializeFormValues as
|
|
3
|
-
import { useFileUpload as
|
|
4
|
-
function ee(
|
|
5
|
-
const { schema:
|
|
6
|
-
|
|
7
|
-
() =>
|
|
1
|
+
import { ref as d, computed as G, watch as H } from "vue";
|
|
2
|
+
import { initializeFormValues as q, deepClone as v, getNestedValue as B, evaluateConditional as A, setNestedValue as S, collectFileFields as J, filterNullCustomFields as K } from "../utils/form.utils.js";
|
|
3
|
+
import { useFileUpload as L } from "./useFileUpload.js";
|
|
4
|
+
function ee(D) {
|
|
5
|
+
const { schema: u, values: w, isUpdate: m = !1, folderId: x, onSubmit: g } = D, { handleUploadFile: z } = L(), t = d(q(u, w)), n = d({}), y = d(!1), f = d(!1), h = d(v(t.value)), p = G(() => u ? Array.isArray(u[0]) ? u.flat() : u : []);
|
|
6
|
+
H(
|
|
7
|
+
() => w,
|
|
8
8
|
(e) => {
|
|
9
|
-
e && (t.value =
|
|
9
|
+
e && (t.value = q(u, e), h.value = v(t.value), f.value = !1);
|
|
10
10
|
},
|
|
11
11
|
{ deep: !0 }
|
|
12
12
|
);
|
|
13
|
-
const
|
|
13
|
+
const b = () => ({
|
|
14
14
|
values: t.value,
|
|
15
|
-
isUpdate:
|
|
16
|
-
}),
|
|
17
|
-
a ?
|
|
15
|
+
isUpdate: m
|
|
16
|
+
}), U = (e) => B(t.value, e), M = (e) => n.value[e] || "", E = (e, a) => {
|
|
17
|
+
a ? n.value[e] = a : delete n.value[e];
|
|
18
18
|
}, V = () => {
|
|
19
|
-
|
|
20
|
-
},
|
|
21
|
-
const a =
|
|
19
|
+
n.value = {};
|
|
20
|
+
}, C = (e) => e.when ? A(e.when, b()) : !0, j = (e) => A(e.disabled, b()), O = (e) => A(e.readonly, b()), P = (e) => {
|
|
21
|
+
const a = U(e.name);
|
|
22
22
|
let l = "";
|
|
23
|
-
|
|
23
|
+
if (e.required && (a == null || a === "" || Array.isArray(a) && a.length === 0) && (l = `${e.label || e.name} is required`), !l && e.maxFileSize) {
|
|
24
|
+
const r = e.maxFileSize * 1024 * 1024;
|
|
25
|
+
if (a != null && a !== "") {
|
|
26
|
+
const s = Array.isArray(a) ? a : [a];
|
|
27
|
+
for (const o of s) {
|
|
28
|
+
const i = o instanceof File ? o.size : o?.fileSize || o?.file?.size || o?.size;
|
|
29
|
+
if (i !== void 0 && i > r) {
|
|
30
|
+
l = `${e.label || e.name} size must be less than ${e.maxFileSize}MB`;
|
|
31
|
+
break;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (!l && (e.type === "file" || e.type === "fileUploader") && (e.props?.multiple || e.maxFiles)) {
|
|
37
|
+
const r = e.maxFiles || e.props?.maxFiles;
|
|
38
|
+
r && Array.isArray(a) && a.length > r && (l = `Maximum ${r} files allowed`);
|
|
39
|
+
}
|
|
40
|
+
return !l && e.validation && (l = e.validation({
|
|
24
41
|
value: a,
|
|
25
42
|
values: t.value,
|
|
26
|
-
isUpdate:
|
|
27
|
-
})), l ?
|
|
28
|
-
},
|
|
43
|
+
isUpdate: m
|
|
44
|
+
})), l ? n.value[e.name] = l : delete n.value[e.name], l;
|
|
45
|
+
}, $ = () => {
|
|
29
46
|
V();
|
|
30
47
|
let e = !0;
|
|
31
|
-
for (const a of
|
|
32
|
-
if (!
|
|
33
|
-
|
|
48
|
+
for (const a of p.value) {
|
|
49
|
+
if (!C(a) || j(a)) continue;
|
|
50
|
+
P(a) && (e = !1);
|
|
34
51
|
}
|
|
35
52
|
return e;
|
|
36
53
|
}, k = (e, a, l) => {
|
|
37
|
-
t.value =
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
const s =
|
|
54
|
+
t.value = S(t.value, e, a), f.value = !0, delete n.value[e];
|
|
55
|
+
const r = p.value.find((s) => s.name === e);
|
|
56
|
+
if (r?.updateValues) {
|
|
57
|
+
const s = r.updateValues({
|
|
41
58
|
values: t.value,
|
|
42
59
|
data: l,
|
|
43
|
-
isUpdate:
|
|
44
|
-
updateError:
|
|
60
|
+
isUpdate: m,
|
|
61
|
+
updateError: E
|
|
45
62
|
});
|
|
46
63
|
s && typeof s == "object" && (t.value = { ...t.value, ...s });
|
|
47
64
|
}
|
|
48
|
-
},
|
|
49
|
-
const e =
|
|
50
|
-
const { name:
|
|
65
|
+
}, I = async () => {
|
|
66
|
+
const e = v(t.value), l = J(u, e).map(async (s) => {
|
|
67
|
+
const { name: o, value: i } = s;
|
|
51
68
|
if (Array.isArray(i)) {
|
|
52
|
-
const
|
|
53
|
-
return { name:
|
|
69
|
+
const N = i.map(async (c) => c instanceof File || c && typeof c == "object" && c.file instanceof File ? await z(c, x) || null : c), F = await Promise.all(N);
|
|
70
|
+
return { name: o, value: F };
|
|
54
71
|
} else {
|
|
55
72
|
if (i instanceof File || i && typeof i == "object" && i.file instanceof File) {
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
58
|
-
return { name:
|
|
73
|
+
const F = await z(i, x);
|
|
74
|
+
if (F)
|
|
75
|
+
return { name: o, value: F };
|
|
59
76
|
}
|
|
60
77
|
return null;
|
|
61
78
|
}
|
|
62
79
|
});
|
|
63
80
|
return (await Promise.all(l)).forEach((s) => {
|
|
64
|
-
s && Object.assign(e,
|
|
81
|
+
s && Object.assign(e, S(e, s.name, s.value));
|
|
65
82
|
}), e;
|
|
66
|
-
},
|
|
83
|
+
}, R = (e) => {
|
|
67
84
|
const a = { ...e };
|
|
68
|
-
for (const l of
|
|
85
|
+
for (const l of p.value)
|
|
69
86
|
if (l.type === "customFields" && l.props?.schema) {
|
|
70
|
-
const
|
|
71
|
-
if (Array.isArray(
|
|
72
|
-
const s =
|
|
73
|
-
Object.assign(a,
|
|
87
|
+
const r = B(a, l.name);
|
|
88
|
+
if (Array.isArray(r)) {
|
|
89
|
+
const s = K(r, l.props.schema);
|
|
90
|
+
Object.assign(a, S(a, l.name, s));
|
|
74
91
|
}
|
|
75
92
|
}
|
|
76
93
|
return a;
|
|
77
94
|
};
|
|
78
95
|
return {
|
|
79
96
|
formValues: t,
|
|
80
|
-
errors:
|
|
81
|
-
isSubmitting:
|
|
82
|
-
isDirty:
|
|
97
|
+
errors: n,
|
|
98
|
+
isSubmitting: y,
|
|
99
|
+
isDirty: f,
|
|
83
100
|
handleFieldChange: k,
|
|
84
|
-
validateField:
|
|
85
|
-
validateAll:
|
|
86
|
-
isFieldVisible:
|
|
87
|
-
isFieldDisabled:
|
|
88
|
-
isFieldReadonly:
|
|
89
|
-
getFieldValue:
|
|
90
|
-
getFieldError:
|
|
91
|
-
setFieldError:
|
|
101
|
+
validateField: P,
|
|
102
|
+
validateAll: $,
|
|
103
|
+
isFieldVisible: C,
|
|
104
|
+
isFieldDisabled: j,
|
|
105
|
+
isFieldReadonly: O,
|
|
106
|
+
getFieldValue: U,
|
|
107
|
+
getFieldError: M,
|
|
108
|
+
setFieldError: E,
|
|
92
109
|
clearErrors: V,
|
|
93
110
|
resetForm: () => {
|
|
94
|
-
t.value =
|
|
111
|
+
t.value = v(h.value), V(), f.value = !1;
|
|
95
112
|
},
|
|
96
113
|
handleSubmit: async () => {
|
|
97
|
-
if (
|
|
98
|
-
|
|
114
|
+
if ($()) {
|
|
115
|
+
y.value = !0;
|
|
99
116
|
try {
|
|
100
|
-
let a = await
|
|
101
|
-
a =
|
|
117
|
+
let a = await I();
|
|
118
|
+
a = R(a), g && await g({
|
|
102
119
|
values: a,
|
|
103
|
-
isUpdate:
|
|
104
|
-
}),
|
|
120
|
+
isUpdate: m
|
|
121
|
+
}), f.value = !1, h.value = v(a);
|
|
105
122
|
} catch (a) {
|
|
106
123
|
throw console.error("[useForm] Submit error:", a), a;
|
|
107
124
|
} finally {
|
|
108
|
-
|
|
125
|
+
y.value = !1;
|
|
109
126
|
}
|
|
110
127
|
}
|
|
111
128
|
},
|
|
112
|
-
flatSchema:
|
|
129
|
+
flatSchema: p
|
|
113
130
|
};
|
|
114
131
|
}
|
|
115
132
|
export {
|
|
@@ -113,6 +113,10 @@ export interface IForm {
|
|
|
113
113
|
min?: number;
|
|
114
114
|
/** Max value for number inputs */
|
|
115
115
|
max?: number;
|
|
116
|
+
/** Maximum file size in MB for file/avatar uploads */
|
|
117
|
+
maxFileSize?: number;
|
|
118
|
+
/** Maximum number of files allowed when multiple is true */
|
|
119
|
+
maxFiles?: number;
|
|
116
120
|
/** i18n keys */
|
|
117
121
|
labelI8n?: string;
|
|
118
122
|
placeholderI8n?: string;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import { ButtonRounded, ButtonSize, ButtonVariant } from '../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
class?: string;
|
|
4
|
+
rounded?: ButtonRounded;
|
|
5
|
+
size?: ButtonSize;
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
};
|
|
1
8
|
declare function __VLS_template(): {
|
|
2
9
|
attrs: Partial<{}>;
|
|
3
10
|
slots: {
|
|
@@ -10,7 +17,7 @@ declare function __VLS_template(): {
|
|
|
10
17
|
rootEl: any;
|
|
11
18
|
};
|
|
12
19
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
13
|
-
declare const __VLS_component: import('vue').DefineComponent<
|
|
20
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
14
21
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
15
22
|
export default _default;
|
|
16
23
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,23 +1,32 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
1
|
+
import { defineComponent as a, renderSlot as l, unref as e, createVNode as r, normalizeClass as s } from "vue";
|
|
2
|
+
import { useTheme as m } from "../composables/useTheme.js";
|
|
3
3
|
import c from "./Button.vue.js";
|
|
4
|
-
const
|
|
4
|
+
const g = /* @__PURE__ */ a({
|
|
5
5
|
__name: "ThemeToggle",
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
props: {
|
|
7
|
+
class: {},
|
|
8
|
+
rounded: {},
|
|
9
|
+
size: {},
|
|
10
|
+
variant: {}
|
|
11
|
+
},
|
|
12
|
+
setup(t) {
|
|
13
|
+
const { theme: o, toggleTheme: n } = m();
|
|
14
|
+
return (i, d) => l(i.$slots, "default", {
|
|
15
|
+
toggleTheme: e(n),
|
|
16
|
+
theme: e(o)
|
|
11
17
|
}, () => [
|
|
12
18
|
r(c, {
|
|
13
|
-
icon: e(
|
|
14
|
-
variant: "secondary",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
icon: e(o) === "light" ? "lucide:sun" : "lucide:moon",
|
|
20
|
+
variant: t.variant || "secondary",
|
|
21
|
+
rounded: t.rounded || "md",
|
|
22
|
+
size: t.size,
|
|
23
|
+
class: s(t.class),
|
|
24
|
+
title: e(o) === "light" ? "Switch to dark mode" : "Switch to light mode",
|
|
25
|
+
onClick: e(n)
|
|
26
|
+
}, null, 8, ["icon", "variant", "rounded", "size", "class", "title", "onClick"])
|
|
18
27
|
]);
|
|
19
28
|
}
|
|
20
29
|
});
|
|
21
30
|
export {
|
|
22
|
-
|
|
31
|
+
g as default
|
|
23
32
|
};
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -10,7 +10,7 @@ import { default as S } from "./components/Badge.vue.js";
|
|
|
10
10
|
import { default as P } from "./components/Button.vue.js";
|
|
11
11
|
import { default as v } from "./components/ButtonGroup.vue.js";
|
|
12
12
|
import { default as C } from "./components/Carousel/Carousel.vue.js";
|
|
13
|
-
import { default as
|
|
13
|
+
import { default as F } from "./components/CheckBox.vue.js";
|
|
14
14
|
import { default as y } from "./components/Chip/Chip.vue.js";
|
|
15
15
|
import { default as k } from "./components/ChoiceBox/ChoiceBox.vue.js";
|
|
16
16
|
import { default as M } from "./components/ColorPicker/ColorPicker.vue.js";
|
|
@@ -37,7 +37,7 @@ import { useForm as Se } from "./components/Form/composables/useForm.js";
|
|
|
37
37
|
import { useFileUpload as Pe } from "./components/Form/composables/useFileUpload.js";
|
|
38
38
|
import { default as ve } from "./components/Heatmap/Heatmap.vue.js";
|
|
39
39
|
import { default as Ce } from "./components/Icon.vue.js";
|
|
40
|
-
import { default as
|
|
40
|
+
import { default as Fe } from "./components/IconPicker.vue.js";
|
|
41
41
|
import { default as ye } from "./components/Input.vue.js";
|
|
42
42
|
import { default as ke } from "./components/Kanban/Kanban.vue.js";
|
|
43
43
|
import { default as Me } from "./components/Kanban/KanbanBoard.vue.js";
|
|
@@ -64,7 +64,7 @@ import { default as bo } from "./components/Slider.vue.js";
|
|
|
64
64
|
import { default as Io } from "./components/Spinner/Spinner.vue.js";
|
|
65
65
|
import { default as ho } from "./components/Switch.vue.js";
|
|
66
66
|
import { default as Ao } from "./components/Tabes/Tabes.vue.js";
|
|
67
|
-
import { default as
|
|
67
|
+
import { default as Do } from "./components/Textarea.vue.js";
|
|
68
68
|
import { default as wo } from "./components/ThemeToggle.vue.js";
|
|
69
69
|
import { default as No } from "./components/Timeline.vue.js";
|
|
70
70
|
import { default as Bo } from "./components/ToastNotification.vue.js";
|
|
@@ -80,9 +80,10 @@ import { vScrollReveal as tr } from "./directives/vScrollReveal.js";
|
|
|
80
80
|
import { createVLite as fr } from "./core/index.js";
|
|
81
81
|
import { deepMerge as mr } from "./utils/object.js";
|
|
82
82
|
import { camelCase as dr, capitalize as sr, copyToClipboard as ur, debounce as xr, delay as ir, downloadFile as nr, flattenArray as cr, formatCurrency as Tr, getUniqueId as gr, isAppleDevice as br, isEmpty as Sr, randomNumber as Ir, removeExtraProperties as Pr, slugify as hr, throttle as vr, truncate as Ar } from "./utils/functions.js";
|
|
83
|
-
import { lazySearch as
|
|
83
|
+
import { lazySearch as Dr, resetSearchIndex as Fr, search as wr } from "./utils/search.util.js";
|
|
84
84
|
import { env as Nr } from "./utils/env.js";
|
|
85
|
-
import {
|
|
85
|
+
import { default as Br } from "./components/DataList/DataList.vue.js";
|
|
86
|
+
import { useVLiteConfig as Kr } from "./core/config.js";
|
|
86
87
|
export {
|
|
87
88
|
f as Accordion,
|
|
88
89
|
u as AccordionContent,
|
|
@@ -95,12 +96,13 @@ export {
|
|
|
95
96
|
P as Button,
|
|
96
97
|
v as ButtonGroup,
|
|
97
98
|
C as Carousel,
|
|
98
|
-
|
|
99
|
+
F as CheckBox,
|
|
99
100
|
y as Chip,
|
|
100
101
|
k as ChoiceBox,
|
|
101
102
|
M as ColorPicker,
|
|
102
103
|
L as ConfirmationModal,
|
|
103
104
|
ge as CustomFields,
|
|
105
|
+
Br as DataList,
|
|
104
106
|
O as DataTable,
|
|
105
107
|
z as DataTableHeader,
|
|
106
108
|
V as DataTableRow,
|
|
@@ -119,7 +121,7 @@ export {
|
|
|
119
121
|
t as GoogleSignInPlugin,
|
|
120
122
|
ve as Heatmap,
|
|
121
123
|
Ce as Icon,
|
|
122
|
-
|
|
124
|
+
Fe as IconPicker,
|
|
123
125
|
ye as Input,
|
|
124
126
|
ke as Kanban,
|
|
125
127
|
Me as KanbanBoard,
|
|
@@ -146,7 +148,7 @@ export {
|
|
|
146
148
|
Io as Spinner,
|
|
147
149
|
ho as Switch,
|
|
148
150
|
Ao as Tabes,
|
|
149
|
-
|
|
151
|
+
Do as Textarea,
|
|
150
152
|
wo as ThemeToggle,
|
|
151
153
|
No as Timeline,
|
|
152
154
|
Bo as ToastNotification,
|
|
@@ -167,12 +169,12 @@ export {
|
|
|
167
169
|
gr as getUniqueId,
|
|
168
170
|
br as isAppleDevice,
|
|
169
171
|
Sr as isEmpty,
|
|
170
|
-
|
|
172
|
+
Dr as lazySearch,
|
|
171
173
|
Wo as pauseTimers,
|
|
172
174
|
Ir as randomNumber,
|
|
173
175
|
Pr as removeExtraProperties,
|
|
174
176
|
Yo as removeToast,
|
|
175
|
-
|
|
177
|
+
Fr as resetSearchIndex,
|
|
176
178
|
_o as resumeTimers,
|
|
177
179
|
wr as search,
|
|
178
180
|
jo as showToast,
|
|
@@ -190,6 +192,6 @@ export {
|
|
|
190
192
|
Qo as useNotifications,
|
|
191
193
|
Zo as useTheme,
|
|
192
194
|
de as useTreeSelection,
|
|
193
|
-
|
|
195
|
+
Kr as useVLiteConfig,
|
|
194
196
|
tr as vScrollReveal
|
|
195
197
|
};
|