vlite3 1.4.33 → 1.4.34
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 +7 -0
- package/components/Alert.vue.js +45 -40
- package/components/Barcode/Barcode.vue.js +34 -21
- package/components/CategoryManager/CategoryManager.vue2.js +1 -1
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/ExportData/ExportData.vue.js +85 -63
- package/components/FilePreview/FilePreview.vue.js +31 -13
- package/components/Form/{AccordionView.vue.js → AccordionView.vue2.js} +1 -1
- package/components/Form/index.vue2.js +1 -1
- package/components/ImportData/ImportStep1.vue.js +80 -75
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/QRCode/QRCode.vue.js +31 -26
- package/components/Screen/ScreenFilter.vue.js +1 -1
- package/directives/vScrollReveal.js +23 -18
- package/package.json +2 -2
- package/utils/UtilsModuleInterop.d.ts +6 -0
- package/utils/UtilsModuleInterop.js +9 -0
- /package/components/Dropdown/{DropdownMenu.vue3.js → DropdownMenu.vue2.js} +0 -0
package/README.md
CHANGED
|
@@ -20,6 +20,13 @@ yarn add vlite3
|
|
|
20
20
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
+
### Server-side rendering
|
|
24
|
+
|
|
25
|
+
The package entry is safe to evaluate during Vue SSR. Browser-only export,
|
|
26
|
+
import, barcode, QR-code, and scroll-reveal runtimes are loaded lazily when
|
|
27
|
+
their client-side actions or lifecycle hooks run. SSR applications can import
|
|
28
|
+
VLite3 components normally without evaluating those dependencies on the server.
|
|
29
|
+
|
|
23
30
|
## 2. Tailwind CSS Setup (Tailwind v4)
|
|
24
31
|
|
|
25
32
|
`vite.config.ts`
|
package/components/Alert.vue.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import { $t as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as $, useSlots as S, ref as T, computed as t, openBlock as r, createElementBlock as i, normalizeClass as n, renderSlot as v, createBlock as D, createCommentVNode as a, createElementVNode as f, toDisplayString as b, unref as E, createTextVNode as z, createVNode as A } from "vue";
|
|
2
|
+
import m from "./Icon.vue.js";
|
|
3
|
+
import { $t as y } from "../utils/i18n.js";
|
|
4
|
+
const O = ["role"], R = {
|
|
5
5
|
key: 1,
|
|
6
6
|
class: "text-sm opacity-90 [&_p]:leading-relaxed"
|
|
7
|
-
},
|
|
7
|
+
}, F = /* @__PURE__ */ $({
|
|
8
8
|
__name: "Alert",
|
|
9
9
|
props: {
|
|
10
10
|
title: {},
|
|
@@ -18,71 +18,76 @@ const D = ["role"], E = {
|
|
|
18
18
|
class: { default: "" }
|
|
19
19
|
},
|
|
20
20
|
emits: ["close"],
|
|
21
|
-
setup(s, { emit:
|
|
22
|
-
const e = s, x =
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
() => e.descriptionI18n ? m(e.descriptionI18n) : e.description
|
|
26
|
-
), k = t(() => ({
|
|
21
|
+
setup(s, { emit: x }) {
|
|
22
|
+
const e = s, h = x, c = S(), d = T(!0), k = () => {
|
|
23
|
+
d.value = !1, h("close");
|
|
24
|
+
}, g = t(() => e.titleI18n ? y(e.titleI18n) : e.title), u = t(() => e.descriptionI18n ? y(e.descriptionI18n) : e.description), w = t(() => ({
|
|
27
25
|
danger: "bg-danger-subtle text-danger-subtle-fg border-danger-subtle-border/20",
|
|
28
26
|
primary: "bg-primary-light text-primary-light-fg border-primary/10",
|
|
29
27
|
success: "bg-success-subtle text-success-subtle-fg border-success-subtle-border/20",
|
|
30
28
|
warning: "bg-warning-subtle text-warning-subtle-fg border-warning-subtle-border/20"
|
|
31
|
-
})[e.variant]),
|
|
29
|
+
})[e.variant]), C = t(() => ({
|
|
32
30
|
primary: "text-primary-light-fg!",
|
|
33
31
|
success: "text-success-subtle-fg!",
|
|
34
32
|
warning: "text-warning-subtle-fg!",
|
|
35
33
|
danger: "text-danger-subtle-fg!"
|
|
36
|
-
})[e.variant]),
|
|
37
|
-
"relative w-full rounded-lg border px-4
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
})[e.variant]), I = t(() => !!(e.icon || c.icon)), l = t(() => !u.value && !c.default), B = t(() => [
|
|
35
|
+
"relative w-full rounded-lg border px-4",
|
|
36
|
+
"[&>svg]:absolute [&>svg]:left-4 [&>svg]:text-foreground",
|
|
37
|
+
l.value ? "py-3" : "pt-4 pb-2",
|
|
38
|
+
l.value ? "[&>svg]:top-1/2 [&>svg]:-translate-y-1/2" : "[&>svg]:top-4 [&>svg+div]:translate-y-[-3px]",
|
|
39
|
+
w.value,
|
|
41
40
|
e.class
|
|
42
|
-
]
|
|
41
|
+
]), V = t(() => [
|
|
43
42
|
"font-medium leading-none tracking-tight text-inherit!",
|
|
44
|
-
|
|
45
|
-
]
|
|
46
|
-
return (
|
|
43
|
+
!l.value && "mb-1"
|
|
44
|
+
]), N = t(() => e.role ? e.role : ["danger", "warning"].includes(e.variant) ? "alert" : "status");
|
|
45
|
+
return (o, p) => d.value ? (r(), i("div", {
|
|
47
46
|
key: 0,
|
|
48
|
-
class:
|
|
49
|
-
role:
|
|
47
|
+
class: n(B.value),
|
|
48
|
+
role: N.value
|
|
50
49
|
}, [
|
|
51
|
-
|
|
52
|
-
s.icon ? (r(),
|
|
50
|
+
v(o.$slots, "icon", {}, () => [
|
|
51
|
+
s.icon ? (r(), D(m, {
|
|
53
52
|
key: 0,
|
|
54
53
|
icon: s.icon,
|
|
55
|
-
class:
|
|
54
|
+
class: n(["h-4 w-4", C.value])
|
|
56
55
|
}, null, 8, ["icon", "class"])) : a("", !0)
|
|
57
56
|
]),
|
|
58
|
-
|
|
59
|
-
class:
|
|
57
|
+
f("div", {
|
|
58
|
+
class: n({
|
|
59
|
+
"pl-7": I.value,
|
|
60
|
+
"pr-6": s.closable
|
|
61
|
+
})
|
|
60
62
|
}, [
|
|
61
|
-
|
|
63
|
+
g.value ? (r(), i("h5", {
|
|
62
64
|
key: 0,
|
|
63
|
-
class:
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
class: n(V.value)
|
|
66
|
+
}, b(g.value), 3)) : a("", !0),
|
|
67
|
+
u.value || E(c).default ? (r(), i("div", R, [
|
|
68
|
+
v(o.$slots, "default", {}, () => [
|
|
69
|
+
z(b(u.value), 1)
|
|
68
70
|
])
|
|
69
71
|
])) : a("", !0)
|
|
70
72
|
], 2),
|
|
71
73
|
s.closable ? (r(), i("button", {
|
|
72
74
|
key: 0,
|
|
73
75
|
type: "button",
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
class: n([
|
|
77
|
+
"absolute right-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
|
|
78
|
+
l.value ? "top-1/2 -translate-y-1/2" : "top-4"
|
|
79
|
+
]),
|
|
80
|
+
onClick: k
|
|
76
81
|
}, [
|
|
77
|
-
|
|
82
|
+
A(m, {
|
|
78
83
|
icon: "lucide:x",
|
|
79
84
|
class: "h-4 w-4"
|
|
80
85
|
}),
|
|
81
|
-
|
|
86
|
+
p[0] || (p[0] = f("span", { class: "sr-only" }, " Close ", -1))
|
|
82
87
|
], 2)) : a("", !0)
|
|
83
|
-
], 10,
|
|
88
|
+
], 10, O)) : a("", !0);
|
|
84
89
|
}
|
|
85
90
|
});
|
|
86
91
|
export {
|
|
87
|
-
|
|
92
|
+
F as default
|
|
88
93
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as p, ref as f, onMounted as h, watch as g, openBlock as i, createElementBlock as u, toDisplayString as w, createCommentVNode as b, withDirectives as y, vShow as x } from "vue";
|
|
2
|
+
import { barcodesConstants as _ } from "./types.js";
|
|
3
|
+
import { resolveModuleRuntime as C } from "../../utils/UtilsModuleInterop.js";
|
|
4
|
+
const k = { class: "inline-flex justify-center items-center max-w-full flex-col gap-2" }, B = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "text-sm text-destructive px-4 py-2 bg-destructive/10 rounded-md border border-destructive/20 text-center whitespace-normal overflow-wrap-anywhere"
|
|
7
|
-
},
|
|
7
|
+
}, D = /* @__PURE__ */ p({
|
|
8
8
|
__name: "Barcode",
|
|
9
9
|
props: {
|
|
10
10
|
value: {},
|
|
@@ -16,16 +16,26 @@ const y = { class: "inline-flex justify-center items-center max-w-full flex-col
|
|
|
16
16
|
background: { default: "#ffffff" },
|
|
17
17
|
margin: { default: 10 }
|
|
18
18
|
},
|
|
19
|
-
setup(
|
|
20
|
-
const e =
|
|
21
|
-
|
|
19
|
+
setup(m) {
|
|
20
|
+
const e = m, o = f(null), r = f("");
|
|
21
|
+
let a = 0;
|
|
22
|
+
const s = async () => {
|
|
23
|
+
const n = ++a;
|
|
24
|
+
if (r.value = "", o.value && e.value) {
|
|
22
25
|
o.value.innerHTML = "";
|
|
23
26
|
try {
|
|
24
|
-
const t =
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const t = await import("jsbarcode");
|
|
28
|
+
if (n !== a || !o.value) return;
|
|
29
|
+
const c = C(
|
|
30
|
+
t,
|
|
31
|
+
(l) => typeof l == "function"
|
|
32
|
+
);
|
|
33
|
+
if (!c) throw new Error("The barcode runtime is unavailable.");
|
|
34
|
+
const d = _.find(
|
|
35
|
+
(l) => l.value.toLowerCase() === e.format.toLowerCase()
|
|
36
|
+
), v = d ? d.value : e.format;
|
|
37
|
+
c(o.value, e.value, {
|
|
38
|
+
format: v,
|
|
29
39
|
displayValue: e.displayValue,
|
|
30
40
|
width: e.width,
|
|
31
41
|
height: e.height,
|
|
@@ -35,25 +45,28 @@ const y = { class: "inline-flex justify-center items-center max-w-full flex-col
|
|
|
35
45
|
margin: e.margin
|
|
36
46
|
});
|
|
37
47
|
} catch (t) {
|
|
38
|
-
|
|
48
|
+
if (n !== a) return;
|
|
49
|
+
console.error("Failed to generate barcode:", t), r.value = typeof t == "string" ? t : t?.message || "Invalid barcode value for this format";
|
|
39
50
|
}
|
|
40
51
|
}
|
|
41
52
|
};
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
}),
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
return h(() => {
|
|
54
|
+
s();
|
|
55
|
+
}), g(() => e, () => {
|
|
56
|
+
s();
|
|
57
|
+
}, { deep: !0 }), (n, t) => (i(), u("div", k, [
|
|
58
|
+
r.value ? (i(), u("div", B, w(r.value), 1)) : b("", !0),
|
|
59
|
+
y((i(), u("svg", {
|
|
47
60
|
ref_key: "barcodeRef",
|
|
48
61
|
ref: o,
|
|
49
62
|
class: "w-full h-auto max-w-full",
|
|
50
63
|
preserveAspectRatio: "xMidYMid meet"
|
|
51
64
|
}, null, 512)), [
|
|
52
|
-
[
|
|
65
|
+
[x, !r.value]
|
|
53
66
|
])
|
|
54
67
|
]));
|
|
55
68
|
}
|
|
56
69
|
});
|
|
57
70
|
export {
|
|
58
|
-
|
|
71
|
+
D as default
|
|
59
72
|
};
|
|
@@ -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.vue.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/80 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,13 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import N from "papaparse";
|
|
4
|
-
import { saveAs as b } from "file-saver";
|
|
5
|
-
import w from "../Button.vue.js";
|
|
1
|
+
import { defineComponent as N, computed as k, openBlock as c, createElementBlock as E, createBlock as v, withCtx as w, createElementVNode as u, toDisplayString as g, Fragment as V, renderList as A, createVNode as D } from "vue";
|
|
2
|
+
import b from "../Button.vue.js";
|
|
6
3
|
import I from "../Modal.vue.js";
|
|
7
4
|
import O from "../Icon.vue.js";
|
|
8
5
|
import { showToast as p } from "../../composables/useNotifications.js";
|
|
9
|
-
import { $t as
|
|
10
|
-
|
|
6
|
+
import { $t as F } from "../../utils/i18n.js";
|
|
7
|
+
import { resolveModuleRuntime as h } from "../../utils/UtilsModuleInterop.js";
|
|
8
|
+
const R = { class: "px-1 py-1 text-sm" }, L = { class: "font-medium mb-3 text-muted-foreground" }, M = { class: "space-y-3" }, H = /* @__PURE__ */ N({
|
|
11
9
|
__name: "ExportData",
|
|
12
10
|
props: {
|
|
13
11
|
data: {},
|
|
@@ -20,105 +18,129 @@ const V = { class: "px-1 py-1 text-sm" }, U = { class: "font-medium mb-3 text-mu
|
|
|
20
18
|
mode: { default: "frontend" },
|
|
21
19
|
onExport: {}
|
|
22
20
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
const o =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
setup(s, { expose: B }) {
|
|
22
|
+
const S = async () => {
|
|
23
|
+
const o = await import("xlsx"), e = h(
|
|
24
|
+
o,
|
|
25
|
+
(t) => !!(t && typeof t == "object" && "utils" in t && "write" in t && typeof t.write == "function")
|
|
26
|
+
);
|
|
27
|
+
if (!e)
|
|
28
|
+
throw new Error("The spreadsheet export runtime is unavailable.");
|
|
29
|
+
return e;
|
|
30
|
+
}, C = async () => {
|
|
31
|
+
const o = await import("papaparse"), e = h(
|
|
32
|
+
o,
|
|
33
|
+
(t) => !!(t && typeof t == "object" && "unparse" in t && typeof t.unparse == "function")
|
|
34
|
+
);
|
|
35
|
+
if (!e)
|
|
36
|
+
throw new Error("The CSV export runtime is unavailable.");
|
|
37
|
+
return e;
|
|
38
|
+
}, m = async (o, e) => {
|
|
39
|
+
const t = await import("file-saver"), r = t, a = h(
|
|
40
|
+
t,
|
|
41
|
+
(l) => typeof l == "function"
|
|
42
|
+
) || r.saveAs || r.default?.saveAs;
|
|
43
|
+
if (!a)
|
|
44
|
+
throw new Error("The file download runtime is unavailable.");
|
|
45
|
+
a(o, e);
|
|
46
|
+
}, n = s, i = (o, e, t) => {
|
|
47
|
+
const r = t ? F(o, t) : F(o);
|
|
48
|
+
return r !== o ? r : e;
|
|
49
|
+
}, $ = (o, e) => {
|
|
50
|
+
if (!(!o || !e))
|
|
51
|
+
return e.includes(".") ? e.split(".").reduce((t, r) => t?.[r], o) : o[e];
|
|
52
|
+
}, y = k(() => [
|
|
31
53
|
{ label: "Excel (.xlsx)", value: "excel", icon: "lucide:file-spreadsheet" },
|
|
32
54
|
{ label: "CSV (.csv)", value: "csv", icon: "lucide:file-text" },
|
|
33
55
|
{ label: "JSON (.json)", value: "json", icon: "lucide:file-json" }
|
|
34
|
-
].filter((e) =>
|
|
56
|
+
].filter((e) => n.formats.includes(e.value))), j = () => n.data.map((o) => {
|
|
35
57
|
const e = {};
|
|
36
|
-
return
|
|
37
|
-
const
|
|
38
|
-
t.format ? e[t.title] = t.format(
|
|
58
|
+
return n.fields.forEach((t) => {
|
|
59
|
+
const r = $(o, t.field);
|
|
60
|
+
t.format ? e[t.title] = t.format(r, o) : e[t.title] = r ?? "";
|
|
39
61
|
}), e;
|
|
40
|
-
}),
|
|
41
|
-
if (
|
|
62
|
+
}), f = async (o, e) => {
|
|
63
|
+
if (n.mode === "backend" && n.onExport)
|
|
42
64
|
try {
|
|
43
|
-
await
|
|
65
|
+
await n.onExport(o), e && e();
|
|
44
66
|
return;
|
|
45
67
|
} catch (t) {
|
|
46
|
-
console.error("Backend export error:", t), p(
|
|
68
|
+
console.error("Backend export error:", t), p(i("vlite.exportData.error", "An error occurred while exporting data."), "error");
|
|
47
69
|
return;
|
|
48
70
|
}
|
|
49
|
-
if (!
|
|
50
|
-
p(
|
|
71
|
+
if (!n.data || n.data.length === 0) {
|
|
72
|
+
p(i("vlite.exportData.noData", "No data available to export."), "warning");
|
|
51
73
|
return;
|
|
52
74
|
}
|
|
53
75
|
try {
|
|
54
|
-
const t =
|
|
55
|
-
switch (
|
|
76
|
+
const t = n.filename ? n.filename : `${n.title.toLowerCase().replace(/\s+/g, "-")}-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}`, r = j();
|
|
77
|
+
switch (o) {
|
|
56
78
|
case "excel": {
|
|
57
|
-
const l =
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
79
|
+
const a = await S(), l = a.utils.book_new(), x = a.utils.json_to_sheet(r);
|
|
80
|
+
a.utils.book_append_sheet(l, x, n.title.substring(0, 31));
|
|
81
|
+
const d = a.write(l, { bookType: "xlsx", type: "array" }), _ = new Blob([d], { type: "application/octet-stream" });
|
|
82
|
+
await m(_, `${t}.xlsx`);
|
|
61
83
|
break;
|
|
62
84
|
}
|
|
63
85
|
case "csv": {
|
|
64
|
-
const
|
|
65
|
-
|
|
86
|
+
const a = await C(), l = "\uFEFF", x = a.unparse(r), d = new Blob([l + x], { type: "text/csv;charset=utf-8;" });
|
|
87
|
+
await m(d, `${t}.csv`);
|
|
66
88
|
break;
|
|
67
89
|
}
|
|
68
90
|
case "json": {
|
|
69
|
-
const
|
|
70
|
-
|
|
91
|
+
const a = JSON.stringify(r, null, 2), l = new Blob([a], { type: "application/json" });
|
|
92
|
+
await m(l, `${t}.json`);
|
|
71
93
|
break;
|
|
72
94
|
}
|
|
73
95
|
}
|
|
74
96
|
p(
|
|
75
|
-
|
|
76
|
-
format:
|
|
97
|
+
i("vlite.exportData.success", `Data exported successfully as ${o.toUpperCase()}`, {
|
|
98
|
+
format: o.toUpperCase()
|
|
77
99
|
}),
|
|
78
100
|
"success"
|
|
79
101
|
), e && e();
|
|
80
102
|
} catch (t) {
|
|
81
|
-
console.error("Export error:", t), p(
|
|
103
|
+
console.error("Export error:", t), p(i("vlite.exportData.error", "An error occurred while exporting data."), "error");
|
|
82
104
|
}
|
|
83
|
-
},
|
|
84
|
-
return
|
|
85
|
-
exportData:
|
|
86
|
-
availableFormats:
|
|
87
|
-
}), (
|
|
88
|
-
|
|
105
|
+
}, T = k(() => i("vlite.exportData.selectFormat", "Select Export Format"));
|
|
106
|
+
return B({
|
|
107
|
+
exportData: f,
|
|
108
|
+
availableFormats: y
|
|
109
|
+
}), (o, e) => (c(), E("div", null, [
|
|
110
|
+
s.formats.length === 1 ? (c(), v(b, {
|
|
89
111
|
key: 0,
|
|
90
|
-
text:
|
|
91
|
-
icon:
|
|
112
|
+
text: s.buttonText,
|
|
113
|
+
icon: s.buttonIcon,
|
|
92
114
|
variant: "outline",
|
|
93
|
-
onClick: e[0] || (e[0] = (t) =>
|
|
94
|
-
}, null, 8, ["text", "icon"])) : (
|
|
115
|
+
onClick: e[0] || (e[0] = (t) => f(s.formats[0]))
|
|
116
|
+
}, null, 8, ["text", "icon"])) : (c(), v(I, {
|
|
95
117
|
key: 1,
|
|
96
|
-
title:
|
|
118
|
+
title: s.title,
|
|
97
119
|
"max-width": "sm:max-w-[400px]"
|
|
98
120
|
}, {
|
|
99
|
-
trigger:
|
|
100
|
-
D(
|
|
101
|
-
text:
|
|
102
|
-
icon:
|
|
121
|
+
trigger: w(() => [
|
|
122
|
+
D(b, {
|
|
123
|
+
text: s.buttonText,
|
|
124
|
+
icon: s.buttonIcon,
|
|
103
125
|
variant: "outline"
|
|
104
126
|
}, null, 8, ["text", "icon"])
|
|
105
127
|
]),
|
|
106
|
-
default:
|
|
107
|
-
u("div",
|
|
108
|
-
u("h6",
|
|
109
|
-
u("div",
|
|
110
|
-
(
|
|
111
|
-
key:
|
|
128
|
+
default: w(({ close: t }) => [
|
|
129
|
+
u("div", R, [
|
|
130
|
+
u("h6", L, g(T.value), 1),
|
|
131
|
+
u("div", M, [
|
|
132
|
+
(c(!0), E(V, null, A(y.value, (r) => (c(), v(b, {
|
|
133
|
+
key: r.value,
|
|
112
134
|
variant: "outline",
|
|
113
135
|
class: "w-full flex items-center justify-start gap-3 h-12",
|
|
114
|
-
onClick: (
|
|
136
|
+
onClick: (a) => f(r.value, t)
|
|
115
137
|
}, {
|
|
116
|
-
default:
|
|
138
|
+
default: w(() => [
|
|
117
139
|
D(O, {
|
|
118
|
-
icon:
|
|
140
|
+
icon: r.icon,
|
|
119
141
|
class: "text-muted-foreground h-5 w-5"
|
|
120
142
|
}, null, 8, ["icon"]),
|
|
121
|
-
u("span", null,
|
|
143
|
+
u("span", null, g(r.label), 1)
|
|
122
144
|
]),
|
|
123
145
|
_: 2
|
|
124
146
|
}, 1032, ["onClick"]))), 128))
|
|
@@ -1,27 +1,45 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VFileViewer as d } from "v-file-preview";
|
|
1
|
+
import { defineComponent as c, shallowRef as n, onMounted as s, openBlock as l, createElementBlock as a, createElementVNode as i, createBlock as d, resolveDynamicComponent as u } from "vue";
|
|
3
2
|
import "v-file-preview/dist/style.css";
|
|
4
|
-
const
|
|
3
|
+
const m = { class: "flex flex-col h-[70vh] w-full min-h-[400px]" }, v = { class: "flex-1 relative bg-muted/10 rounded-lg border border-border overflow-hidden flex items-center justify-center" }, f = { class: "w-full h-full overflow-auto" }, w = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "p-6 text-center text-sm text-muted",
|
|
6
|
+
role: "alert"
|
|
7
|
+
}, p = {
|
|
8
|
+
key: 2,
|
|
9
|
+
class: "p-6 text-center text-sm text-muted",
|
|
10
|
+
role: "status",
|
|
11
|
+
"aria-live": "polite"
|
|
12
|
+
}, y = /* @__PURE__ */ c({
|
|
5
13
|
__name: "FilePreview",
|
|
6
14
|
props: {
|
|
7
15
|
url: {},
|
|
8
16
|
name: {},
|
|
9
17
|
canDownload: { type: Boolean, default: !0 }
|
|
10
18
|
},
|
|
11
|
-
setup(
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
setup(o) {
|
|
20
|
+
const r = n(null), t = n("loading");
|
|
21
|
+
return s(async () => {
|
|
22
|
+
try {
|
|
23
|
+
const e = await import("v-file-preview");
|
|
24
|
+
if (!e.VFileViewer) throw new Error("The file viewer component is unavailable.");
|
|
25
|
+
r.value = e.VFileViewer, t.value = "ready";
|
|
26
|
+
} catch (e) {
|
|
27
|
+
console.error("File preview runtime failed to load.", e), t.value = "error";
|
|
28
|
+
}
|
|
29
|
+
}), (e, h) => (l(), a("div", m, [
|
|
30
|
+
i("div", v, [
|
|
31
|
+
i("div", f, [
|
|
32
|
+
t.value === "ready" && r.value ? (l(), d(u(r.value), {
|
|
33
|
+
key: 0,
|
|
34
|
+
url: o.url,
|
|
35
|
+
name: o.name,
|
|
36
|
+
"can-download": o.canDownload
|
|
37
|
+
}, null, 8, ["url", "name", "can-download"])) : t.value === "error" ? (l(), a("p", w, " This file preview is unavailable. ")) : (l(), a("p", p, " Loading file preview… "))
|
|
20
38
|
])
|
|
21
39
|
])
|
|
22
40
|
]));
|
|
23
41
|
}
|
|
24
42
|
});
|
|
25
43
|
export {
|
|
26
|
-
|
|
44
|
+
y as default
|
|
27
45
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as b, computed as d, openBlock as n, createElementBlock as g, createElementVNode as R, createBlock as r, withCtx as x, createTextVNode as k, toDisplayString as I, createCommentVNode as v, unref as l } from "vue";
|
|
2
2
|
import B from "./TableView.vue.js";
|
|
3
|
-
import C from "./AccordionView.
|
|
3
|
+
import C from "./AccordionView.vue2.js";
|
|
4
4
|
import U from "../Label.vue.js";
|
|
5
5
|
import N from "../Button.vue.js";
|
|
6
6
|
import { useCustomFieldRows as V } from "./composables/useCustomFieldRows.js";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import q from "../Textarea.vue.js";
|
|
1
|
+
import { defineComponent as J, ref as y, computed as d, openBlock as V, createElementBlock as F, createElementVNode as o, toDisplayString as n, withModifiers as E, normalizeClass as M, createVNode as v, createCommentVNode as K, withCtx as L, createTextVNode as W } from "vue";
|
|
2
|
+
import S from "../Icon.vue.js";
|
|
3
|
+
import q from "../Button.vue.js";
|
|
4
|
+
import G from "../Textarea.vue.js";
|
|
6
5
|
import { showToast as h } from "../../composables/useNotifications.js";
|
|
7
6
|
import { $t as k } from "../../utils/i18n.js";
|
|
8
7
|
import { camelCase as g } from "../../utils/functions.js";
|
|
9
|
-
|
|
8
|
+
import { resolveModuleRuntime as Q } from "../../utils/UtilsModuleInterop.js";
|
|
9
|
+
const X = { class: "space-y-2" }, Y = { class: "font-medium text-md" }, Z = { class: "space-y-6" }, ee = { class: "flex flex-col items-center justify-center pointer-events-none" }, te = { class: "w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mb-4 text-primary" }, re = { class: "font-medium text-foreground mb-1" }, ae = { class: "text-sm text-muted-foreground" }, oe = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "mt-4 text-sm font-semibold text-primary bg-background px-3 py-1 rounded-md border border-border shadow-sm inline-block"
|
|
12
|
-
},
|
|
12
|
+
}, se = { class: "flex items-center gap-3 mb-4" }, ie = { class: "w-8 h-8 rounded-lg bg-secondary flex items-center justify-center text-secondary-foreground" }, ne = { class: "font-medium text-foreground leading-none" }, le = { class: "flex justify-end mt-3" }, ge = /* @__PURE__ */ J({
|
|
13
13
|
__name: "ImportStep1",
|
|
14
14
|
props: {
|
|
15
15
|
importMethod: {},
|
|
@@ -29,133 +29,138 @@ const G = { class: "space-y-2" }, Q = { class: "font-medium text-md" }, X = { cl
|
|
|
29
29
|
"next"
|
|
30
30
|
],
|
|
31
31
|
setup(l, { emit: P }) {
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
return
|
|
35
|
-
}, D =
|
|
36
|
-
if (
|
|
37
|
-
const e =
|
|
38
|
-
e.type === "text/csv" || e.name.endsWith(".csv") ?
|
|
32
|
+
const b = l, i = P, s = (r, e, a) => {
|
|
33
|
+
const t = a ? k(r, a) : k(r);
|
|
34
|
+
return t !== r ? t : e;
|
|
35
|
+
}, D = y(null), m = y(!1), c = y(""), T = (r) => {
|
|
36
|
+
if (r.preventDefault(), m.value = !1, r.dataTransfer?.files && r.dataTransfer.files.length > 0) {
|
|
37
|
+
const e = r.dataTransfer.files[0];
|
|
38
|
+
e.type === "text/csv" || e.name.endsWith(".csv") ? w(e) : h(s("vlite.importData.csvOnly", "Please upload a CSV file"), "error");
|
|
39
39
|
}
|
|
40
|
-
},
|
|
41
|
-
i("update:csvFile",
|
|
40
|
+
}, w = (r) => {
|
|
41
|
+
i("update:csvFile", r), i("update:importMethod", "file");
|
|
42
42
|
const e = new FileReader();
|
|
43
43
|
e.onload = (a) => {
|
|
44
|
-
a.target?.result &&
|
|
45
|
-
}, e.readAsText(
|
|
46
|
-
},
|
|
47
|
-
i("update:importMethod", "paste"), c.value &&
|
|
48
|
-
},
|
|
49
|
-
const e = g(
|
|
50
|
-
return
|
|
51
|
-
a[g(
|
|
52
|
-
a[g(u)] =
|
|
44
|
+
a.target?.result && _(a.target.result);
|
|
45
|
+
}, e.readAsText(r);
|
|
46
|
+
}, j = () => {
|
|
47
|
+
i("update:importMethod", "paste"), c.value && _(c.value);
|
|
48
|
+
}, O = (r) => {
|
|
49
|
+
const e = g(r), a = {};
|
|
50
|
+
return b.fields.forEach((t) => {
|
|
51
|
+
a[g(t.field)] = t.field, a[g(t.title)] = t.field, t.matchings?.forEach((u) => {
|
|
52
|
+
a[g(u)] = t.field;
|
|
53
53
|
});
|
|
54
54
|
}), a[e] || "";
|
|
55
|
-
},
|
|
55
|
+
}, _ = async (r) => {
|
|
56
56
|
try {
|
|
57
|
-
|
|
57
|
+
const e = await import("papaparse"), a = Q(
|
|
58
|
+
e,
|
|
59
|
+
(t) => !!(t && typeof t == "object" && "parse" in t && typeof t.parse == "function")
|
|
60
|
+
);
|
|
61
|
+
if (!a) throw new Error("The CSV import runtime is unavailable.");
|
|
62
|
+
a.parse(r, {
|
|
58
63
|
header: !0,
|
|
59
64
|
skipEmptyLines: !0,
|
|
60
|
-
complete: (
|
|
61
|
-
if (!
|
|
65
|
+
complete: (t) => {
|
|
66
|
+
if (!t.data || t.data.length === 0) {
|
|
62
67
|
h(s("vlite.importData.emptyCsv", "The CSV file is empty."), "warning");
|
|
63
68
|
return;
|
|
64
69
|
}
|
|
65
|
-
const
|
|
66
|
-
i("update:headers",
|
|
67
|
-
const
|
|
70
|
+
const u = Object.keys(t.data[0]);
|
|
71
|
+
i("update:headers", u);
|
|
72
|
+
const A = t.data.map((p) => {
|
|
68
73
|
const f = {};
|
|
69
74
|
return Object.keys(p).forEach((x) => {
|
|
70
|
-
f[x] = p[x] ||
|
|
75
|
+
f[x] = p[x] || b.fields.find((R) => R.field === x)?.defaultValue;
|
|
71
76
|
}), f;
|
|
72
77
|
});
|
|
73
|
-
i("update:importData",
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
const f =
|
|
77
|
-
|
|
78
|
-
}), i("update:mappings",
|
|
78
|
+
i("update:importData", A), i("update:preview", t.data.slice(0, 3));
|
|
79
|
+
const C = {};
|
|
80
|
+
u.forEach((p) => {
|
|
81
|
+
const f = O(p);
|
|
82
|
+
C[p] = f || "";
|
|
83
|
+
}), i("update:mappings", C), i("next");
|
|
79
84
|
},
|
|
80
|
-
error: (
|
|
81
|
-
s("vlite.importData.parseError", "Failed to parse CSV: ") +
|
|
85
|
+
error: (t) => h(
|
|
86
|
+
s("vlite.importData.parseError", "Failed to parse CSV: ") + t.message,
|
|
82
87
|
"error"
|
|
83
88
|
)
|
|
84
89
|
});
|
|
85
90
|
} catch (e) {
|
|
86
91
|
h(s("vlite.importData.processError", "Error processing CSV data"), "error"), console.error(e);
|
|
87
92
|
}
|
|
88
|
-
},
|
|
89
|
-
const e =
|
|
90
|
-
e.files && e.files.length > 0 &&
|
|
91
|
-
},
|
|
93
|
+
}, $ = (r) => {
|
|
94
|
+
const e = r.target;
|
|
95
|
+
e.files && e.files.length > 0 && w(e.files[0]);
|
|
96
|
+
}, I = d(() => s("vlite.importData.uploadData", "Upload Data")), z = d(() => s("vlite.importData.dragDrop", "Drag & drop a file here or click to browse")), B = d(() => s("vlite.importData.csvOnlyHint", "Only CSV files are supported")), H = d(() => s("vlite.importData.pasteData", "Or paste CSV/Excel data")), N = d(() => s("vlite.importData.process", "Process Data")), U = d(() => s("vlite.importData.pastePlaceholder", `id, name, email
|
|
92
97
|
1, John Doe, john@example.com`));
|
|
93
|
-
return (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
class:
|
|
98
|
+
return (r, e) => (V(), F("div", X, [
|
|
99
|
+
o("h5", Y, n(I.value), 1),
|
|
100
|
+
o("div", Z, [
|
|
101
|
+
o("div", {
|
|
102
|
+
class: M([
|
|
98
103
|
"relative border-2 border-dashed rounded-xl p-8 text-center cursor-pointer transition-colors",
|
|
99
104
|
l.importMethod === "file" ? "border-primary bg-primary/5" : "border-border hover:border-primary/50",
|
|
100
105
|
m.value ? "border-primary bg-primary/10 scale-[1.01]" : ""
|
|
101
106
|
]),
|
|
102
107
|
onClick: e[0] || (e[0] = (a) => D.value?.click()),
|
|
103
|
-
onDragover: e[1] || (e[1] =
|
|
104
|
-
onDragleave: e[2] || (e[2] =
|
|
105
|
-
onDrop:
|
|
108
|
+
onDragover: e[1] || (e[1] = E((a) => m.value = !0, ["prevent"])),
|
|
109
|
+
onDragleave: e[2] || (e[2] = E((a) => m.value = !1, ["prevent"])),
|
|
110
|
+
onDrop: T
|
|
106
111
|
}, [
|
|
107
|
-
|
|
112
|
+
o("input", {
|
|
108
113
|
type: "file",
|
|
109
114
|
ref_key: "fileInput",
|
|
110
115
|
ref: D,
|
|
111
116
|
class: "hidden",
|
|
112
117
|
accept: ".csv",
|
|
113
|
-
onChange:
|
|
118
|
+
onChange: $
|
|
114
119
|
}, null, 544),
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
v(
|
|
120
|
+
o("div", ee, [
|
|
121
|
+
o("div", te, [
|
|
122
|
+
v(S, {
|
|
118
123
|
icon: "lucide:upload-cloud",
|
|
119
124
|
class: "w-6 h-6"
|
|
120
125
|
})
|
|
121
126
|
]),
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
l.csvFile ? (
|
|
127
|
+
o("p", re, n(z.value), 1),
|
|
128
|
+
o("p", ae, n(B.value), 1),
|
|
129
|
+
l.csvFile ? (V(), F("p", oe, n(l.csvFile.name) + " (" + n((l.csvFile.size / 1024).toFixed(2)) + " KB) ", 1)) : K("", !0)
|
|
125
130
|
])
|
|
126
131
|
], 34),
|
|
127
|
-
|
|
128
|
-
class:
|
|
132
|
+
o("div", {
|
|
133
|
+
class: M([
|
|
129
134
|
"border rounded-xl p-6 transition-colors",
|
|
130
135
|
l.importMethod === "paste" ? "border-primary shadow-sm ring-1 ring-primary/20" : "border-border"
|
|
131
136
|
])
|
|
132
137
|
}, [
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
v(
|
|
138
|
+
o("div", se, [
|
|
139
|
+
o("div", ie, [
|
|
140
|
+
v(S, {
|
|
136
141
|
icon: "lucide:clipboard-paste",
|
|
137
142
|
class: "w-4 h-4"
|
|
138
143
|
})
|
|
139
144
|
]),
|
|
140
|
-
|
|
141
|
-
|
|
145
|
+
o("div", null, [
|
|
146
|
+
o("p", ne, n(H.value), 1)
|
|
142
147
|
])
|
|
143
148
|
]),
|
|
144
|
-
v(
|
|
149
|
+
v(G, {
|
|
145
150
|
modelValue: c.value,
|
|
146
151
|
"onUpdate:modelValue": e[3] || (e[3] = (a) => c.value = a),
|
|
147
152
|
class: "w-full h-32",
|
|
148
153
|
placeholder: U.value
|
|
149
154
|
}, null, 8, ["modelValue", "placeholder"]),
|
|
150
|
-
|
|
151
|
-
v(
|
|
155
|
+
o("div", le, [
|
|
156
|
+
v(q, {
|
|
152
157
|
variant: "secondary",
|
|
153
158
|
size: "sm",
|
|
154
|
-
onClick:
|
|
159
|
+
onClick: j,
|
|
155
160
|
disabled: !c.value
|
|
156
161
|
}, {
|
|
157
|
-
default:
|
|
158
|
-
|
|
162
|
+
default: L(() => [
|
|
163
|
+
W(n(N.value), 1)
|
|
159
164
|
]),
|
|
160
165
|
_: 1
|
|
161
166
|
}, 8, ["disabled"])
|
|
@@ -166,5 +171,5 @@ const G = { class: "space-y-2" }, Q = { class: "font-medium text-md" }, X = { cl
|
|
|
166
171
|
}
|
|
167
172
|
});
|
|
168
173
|
export {
|
|
169
|
-
|
|
174
|
+
ge as default
|
|
170
175
|
};
|
|
@@ -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 U } from "../utils/i18n.js";
|
|
6
|
-
/* empty css
|
|
6
|
+
/* empty css */
|
|
7
7
|
const V = { class: "block truncate -text-fs-1.5" }, S = { 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" }, A = /* @__PURE__ */ x({
|
|
8
8
|
__name: "NavbarCommandPalette",
|
|
9
9
|
props: {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import _ from "
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as x, ref as g, computed as s, watchEffect as R, openBlock as u, createElementBlock as f, normalizeStyle as U, toDisplayString as z, createCommentVNode as C } from "vue";
|
|
2
|
+
import { resolveModuleRuntime as _ } from "../../utils/UtilsModuleInterop.js";
|
|
3
|
+
const k = ["src", "alt"], L = {
|
|
4
4
|
key: 1,
|
|
5
5
|
class: "text-[10px] text-danger text-center leading-tight px-1"
|
|
6
|
-
},
|
|
6
|
+
}, Q = /* @__PURE__ */ x({
|
|
7
7
|
__name: "QRCode",
|
|
8
8
|
props: {
|
|
9
9
|
value: {},
|
|
@@ -15,19 +15,19 @@ const U = ["src", "alt"], k = {
|
|
|
15
15
|
alt: { default: "QR Code" },
|
|
16
16
|
color: {}
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const e =
|
|
20
|
-
let
|
|
21
|
-
const
|
|
18
|
+
setup(m) {
|
|
19
|
+
const e = m, a = g(""), r = g("");
|
|
20
|
+
let l = 0;
|
|
21
|
+
const i = s(() => {
|
|
22
22
|
const t = e.value || "";
|
|
23
23
|
return /^data:image\//i.test(t) ? t : "";
|
|
24
24
|
});
|
|
25
|
-
|
|
26
|
-
const t = ++
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
if (!
|
|
30
|
-
const
|
|
25
|
+
R(async () => {
|
|
26
|
+
const t = ++l;
|
|
27
|
+
a.value = "", r.value = "";
|
|
28
|
+
const c = e.value?.trim() || "", y = e.imageUrl || i.value;
|
|
29
|
+
if (typeof window > "u" || !c || y) return;
|
|
30
|
+
const v = {
|
|
31
31
|
errorCorrectionLevel: e.errorCorrectionLevel,
|
|
32
32
|
margin: e.margin,
|
|
33
33
|
color: {
|
|
@@ -35,34 +35,39 @@ const U = ["src", "alt"], k = {
|
|
|
35
35
|
light: e.color?.light || "#ffffffff"
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
typeof e.size == "number" && (
|
|
38
|
+
typeof e.size == "number" && (v.width = e.size * e.scale);
|
|
39
39
|
try {
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
const o = await import("qrcode"), p = _(
|
|
41
|
+
o,
|
|
42
|
+
(n) => !!(n && typeof n == "object" && "toDataURL" in n && typeof n.toDataURL == "function")
|
|
43
|
+
);
|
|
44
|
+
if (!p) throw new Error("The QR code runtime is unavailable.");
|
|
45
|
+
const w = await p.toDataURL(c, v);
|
|
46
|
+
t === l && (a.value = w);
|
|
47
|
+
} catch (o) {
|
|
48
|
+
t === l && (r.value = o instanceof Error ? o.message : "Failed to render QR code");
|
|
44
49
|
}
|
|
45
50
|
});
|
|
46
|
-
const d =
|
|
51
|
+
const d = s(() => e.imageUrl ? e.imageUrl : i.value ? i.value : a.value), h = s(() => {
|
|
47
52
|
const t = typeof e.size == "number" ? `${e.size}px` : e.size;
|
|
48
53
|
return {
|
|
49
54
|
width: t,
|
|
50
55
|
height: t
|
|
51
56
|
};
|
|
52
57
|
});
|
|
53
|
-
return (t,
|
|
58
|
+
return (t, c) => (u(), f("div", {
|
|
54
59
|
class: "inline-flex justify-center items-center max-w-full",
|
|
55
|
-
style:
|
|
60
|
+
style: U(h.value)
|
|
56
61
|
}, [
|
|
57
|
-
d.value ? (
|
|
62
|
+
d.value ? (u(), f("img", {
|
|
58
63
|
key: 0,
|
|
59
64
|
src: d.value,
|
|
60
|
-
alt:
|
|
65
|
+
alt: m.alt,
|
|
61
66
|
class: "w-full h-full object-contain pointer-events-none"
|
|
62
|
-
}, null, 8,
|
|
67
|
+
}, null, 8, k)) : r.value ? (u(), f("span", L, z(r.value), 1)) : C("", !0)
|
|
63
68
|
], 4));
|
|
64
69
|
}
|
|
65
70
|
});
|
|
66
71
|
export {
|
|
67
|
-
|
|
72
|
+
Q as default
|
|
68
73
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import { resolveModuleRuntime as f } from "../utils/UtilsModuleInterop.js";
|
|
2
|
+
const s = /* @__PURE__ */ new WeakMap(), i = {
|
|
3
3
|
distance: "50px",
|
|
4
4
|
duration: 800,
|
|
5
5
|
delay: 200,
|
|
@@ -15,34 +15,39 @@ const o = /* @__PURE__ */ new WeakMap(), s = {
|
|
|
15
15
|
useDelay: "always",
|
|
16
16
|
viewFactor: 0
|
|
17
17
|
};
|
|
18
|
-
function
|
|
18
|
+
function a(e) {
|
|
19
19
|
if (!e) return window;
|
|
20
20
|
if (e === document.body || e === document.documentElement)
|
|
21
21
|
return document.documentElement;
|
|
22
22
|
const t = getComputedStyle(e).overflowY;
|
|
23
|
-
return (t === "auto" || t === "scroll" || t === "overlay") && e.scrollHeight > e.clientHeight ? e :
|
|
23
|
+
return (t === "auto" || t === "scroll" || t === "overlay") && e.scrollHeight > e.clientHeight ? e : a(e.parentElement);
|
|
24
24
|
}
|
|
25
|
-
const
|
|
26
|
-
mounted: (e,
|
|
25
|
+
const d = {
|
|
26
|
+
mounted: async (e, n) => {
|
|
27
27
|
if (typeof window > "u") return;
|
|
28
|
-
const t =
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const t = await import("scrollreveal"), o = f(
|
|
29
|
+
t,
|
|
30
|
+
(u) => typeof u == "function"
|
|
31
|
+
);
|
|
32
|
+
if (!o) return;
|
|
33
|
+
const l = a(e.parentElement);
|
|
34
|
+
let r = s.get(l);
|
|
35
|
+
r || (r = o({
|
|
31
36
|
// If container is window/html, ScrollReveal expects 'document.documentElement' usually,
|
|
32
37
|
// but 'container' option defaults to window.document.documentElement.
|
|
33
38
|
// If it's a specific div, we pass that div.
|
|
34
|
-
container:
|
|
35
|
-
}),
|
|
36
|
-
const
|
|
37
|
-
e.classList.add("v-scroll-reveal"),
|
|
39
|
+
container: l === window ? document.documentElement : l
|
|
40
|
+
}), s.set(l, r));
|
|
41
|
+
const c = Object.assign({}, i, n.value);
|
|
42
|
+
e.classList.add("v-scroll-reveal"), r.reveal(e, c);
|
|
38
43
|
},
|
|
39
|
-
updated: (e,
|
|
40
|
-
if (!(typeof window > "u") && JSON.stringify(
|
|
41
|
-
const t =
|
|
42
|
-
|
|
44
|
+
updated: (e, n) => {
|
|
45
|
+
if (!(typeof window > "u") && JSON.stringify(n.value) !== JSON.stringify(n.oldValue)) {
|
|
46
|
+
const t = a(e.parentElement), o = s.get(t);
|
|
47
|
+
o && o.reveal(e, Object.assign({}, i, n.value));
|
|
43
48
|
}
|
|
44
49
|
}
|
|
45
50
|
};
|
|
46
51
|
export {
|
|
47
|
-
|
|
52
|
+
d as vScrollReveal
|
|
48
53
|
};
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"private": false,
|
|
4
4
|
"description": "A Vue 3 UI component library built with Tailwind CSS.",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "1.4.
|
|
6
|
+
"version": "1.4.34",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "index.js",
|
|
9
9
|
"module": "index.js",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"tailwindcss": "^4.1.18",
|
|
58
58
|
"v-datepicker-lite": "^0.1.10",
|
|
59
59
|
"v-event-calendar": "^0.0.10",
|
|
60
|
-
"v-file-preview": "
|
|
60
|
+
"v-file-preview": "0.1.5",
|
|
61
61
|
"v-tooltip-lite": "^1.0.2",
|
|
62
62
|
"vue-carousel-lite": "^0.2.9",
|
|
63
63
|
"vue-draggable-plus": "^0.5.3",
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves either a native ESM namespace or a CommonJS value exposed through
|
|
3
|
+
* an ESM `default` wrapper. Browser-only integrations use this after a lazy
|
|
4
|
+
* import so their packages are never evaluated during server rendering.
|
|
5
|
+
*/
|
|
6
|
+
export declare const resolveModuleRuntime: <T>(imported: unknown, isRuntime: (candidate: unknown) => candidate is T) => T | null;
|
|
File without changes
|