vlite3 0.5.3 → 0.5.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/README.md +4 -0
- package/components/Barcode/Barcode.vue.js +1 -1
- package/components/ExportData/ExportData.vue.js +42 -42
- package/components/ImportData/ImportStep1.vue.js +1 -1
- package/components/QRCode/QRCode.vue.js +4 -4
- package/package.json +1 -1
- package/_virtual/Barcode.js +0 -4
- package/_virtual/CODE128.js +0 -4
- package/_virtual/CODE128A.js +0 -4
- package/_virtual/CODE128B.js +0 -4
- package/_virtual/CODE128C.js +0 -4
- package/_virtual/CODE128_AUTO.js +0 -4
- package/_virtual/CODE93.js +0 -4
- package/_virtual/CODE93FullASCII.js +0 -4
- package/_virtual/EAN.js +0 -4
- package/_virtual/EAN13.js +0 -4
- package/_virtual/EAN2.js +0 -4
- package/_virtual/EAN5.js +0 -4
- package/_virtual/EAN8.js +0 -4
- package/_virtual/ErrorHandler.js +0 -4
- package/_virtual/FileSaver.min.js +0 -5
- package/_virtual/FileSaver.min2.js +0 -4
- package/_virtual/ITF.js +0 -4
- package/_virtual/ITF14.js +0 -4
- package/_virtual/JsBarcode.js +0 -7
- package/_virtual/MSI.js +0 -4
- package/_virtual/MSI10.js +0 -4
- package/_virtual/MSI1010.js +0 -4
- package/_virtual/MSI11.js +0 -4
- package/_virtual/MSI1110.js +0 -4
- package/_virtual/UPC.js +0 -4
- package/_virtual/UPCE.js +0 -4
- package/_virtual/_commonjsHelpers.js +0 -8
- package/_virtual/alignment-pattern.js +0 -4
- package/_virtual/auto.js +0 -4
- package/_virtual/browser.js +0 -7
- package/_virtual/browser2.js +0 -4
- package/_virtual/canvas.js +0 -4
- package/_virtual/canvas2.js +0 -4
- package/_virtual/checksums.js +0 -4
- package/_virtual/constants.js +0 -4
- package/_virtual/constants2.js +0 -4
- package/_virtual/constants3.js +0 -4
- package/_virtual/constants4.js +0 -4
- package/_virtual/defaults.js +0 -4
- package/_virtual/dijkstra.js +0 -4
- package/_virtual/encoder.js +0 -4
- package/_virtual/error-correction-code.js +0 -4
- package/_virtual/error-correction-level.js +0 -4
- package/_virtual/exceptions.js +0 -4
- package/_virtual/finder-pattern.js +0 -4
- package/_virtual/fixOptions.js +0 -4
- package/_virtual/format-info.js +0 -4
- package/_virtual/galois-field.js +0 -4
- package/_virtual/getOptionsFromElement.js +0 -4
- package/_virtual/getRenderProperties.js +0 -4
- package/_virtual/index.js +0 -4
- package/_virtual/index10.js +0 -4
- package/_virtual/index11.js +0 -4
- package/_virtual/index2.js +0 -4
- package/_virtual/index3.js +0 -4
- package/_virtual/index4.js +0 -4
- package/_virtual/index5.js +0 -4
- package/_virtual/index6.js +0 -4
- package/_virtual/index7.js +0 -4
- package/_virtual/index8.js +0 -4
- package/_virtual/index9.js +0 -4
- package/_virtual/linearizeEncodings.js +0 -4
- package/_virtual/mask-pattern.js +0 -4
- package/_virtual/merge.js +0 -4
- package/_virtual/mode.js +0 -4
- package/_virtual/object.js +0 -4
- package/_virtual/optionsFromStrings.js +0 -4
- package/_virtual/papaparse.min.js +0 -7
- package/_virtual/papaparse.min2.js +0 -4
- package/_virtual/polynomial.js +0 -4
- package/_virtual/qrcode.js +0 -4
- package/_virtual/regex.js +0 -4
- package/_virtual/segments.js +0 -4
- package/_virtual/shared.js +0 -4
- package/_virtual/svg-tag.js +0 -4
- package/_virtual/svg.js +0 -4
- package/_virtual/utils.js +0 -4
- package/_virtual/utils2.js +0 -4
- package/_virtual/version-check.js +0 -4
- package/_virtual/version.js +0 -4
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as d, ref as i, onMounted as f, watch as m, openBlock as r, createElementBlock as l, toDisplayString as p, createCommentVNode as v, withDirectives as h, vShow as g } from "vue";
|
|
2
|
-
import w from "
|
|
2
|
+
import w from "jsbarcode";
|
|
3
3
|
import { barcodesConstants as b } from "./types.js";
|
|
4
4
|
const y = { class: "inline-flex justify-center items-center max-w-full flex-col gap-2" }, x = {
|
|
5
5
|
key: 0,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import { defineComponent as _, computed as k, openBlock as i, createElementBlock as g, createBlock as f, withCtx as v, createElementVNode as u, toDisplayString as y, Fragment as j, renderList as T, createVNode as D } from "vue";
|
|
2
|
+
import * as d from "xlsx";
|
|
3
|
+
import N from "papaparse";
|
|
4
|
+
import { saveAs as b } from "file-saver";
|
|
5
5
|
import w from "../Button.vue.js";
|
|
6
6
|
import I from "../Modal.vue.js";
|
|
7
7
|
import O from "../Icon.vue.js";
|
|
8
|
-
import { showToast as
|
|
8
|
+
import { showToast as p } from "../../composables/useNotifications.js";
|
|
9
9
|
import { $t as E } from "../../utils/i18n.js";
|
|
10
|
-
const V = { class: "px-1 py-1 text-sm" }, U = { class: "font-medium mb-3 text-muted-foreground" },
|
|
10
|
+
const V = { class: "px-1 py-1 text-sm" }, U = { class: "font-medium mb-3 text-muted-foreground" }, A = { class: "space-y-3" }, H = /* @__PURE__ */ _({
|
|
11
11
|
__name: "ExportData",
|
|
12
12
|
props: {
|
|
13
13
|
data: {},
|
|
@@ -20,101 +20,101 @@ const V = { class: "px-1 py-1 text-sm" }, U = { class: "font-medium mb-3 text-mu
|
|
|
20
20
|
mode: { default: "frontend" },
|
|
21
21
|
onExport: {}
|
|
22
22
|
},
|
|
23
|
-
setup(n, { expose:
|
|
24
|
-
const a = n,
|
|
23
|
+
setup(n, { expose: F }) {
|
|
24
|
+
const a = n, s = (r, e, t) => {
|
|
25
25
|
const o = t ? E(r, t) : E(r);
|
|
26
26
|
return o !== r ? o : e;
|
|
27
|
-
},
|
|
27
|
+
}, $ = (r, e) => {
|
|
28
28
|
if (!(!r || !e))
|
|
29
29
|
return e.includes(".") ? e.split(".").reduce((t, o) => t?.[o], r) : r[e];
|
|
30
30
|
}, h = k(() => [
|
|
31
31
|
{ label: "Excel (.xlsx)", value: "excel", icon: "lucide:file-spreadsheet" },
|
|
32
32
|
{ label: "CSV (.csv)", value: "csv", icon: "lucide:file-text" },
|
|
33
33
|
{ label: "JSON (.json)", value: "json", icon: "lucide:file-json" }
|
|
34
|
-
].filter((e) => a.formats.includes(e.value))),
|
|
34
|
+
].filter((e) => a.formats.includes(e.value))), B = () => a.data.map((r) => {
|
|
35
35
|
const e = {};
|
|
36
36
|
return a.fields.forEach((t) => {
|
|
37
|
-
const o =
|
|
37
|
+
const o = $(r, t.field);
|
|
38
38
|
t.format ? e[t.title] = t.format(o, r) : e[t.title] = o ?? "";
|
|
39
39
|
}), e;
|
|
40
|
-
}),
|
|
40
|
+
}), x = async (r, e) => {
|
|
41
41
|
if (a.mode === "backend" && a.onExport)
|
|
42
42
|
try {
|
|
43
43
|
await a.onExport(r), e && e();
|
|
44
44
|
return;
|
|
45
45
|
} catch (t) {
|
|
46
|
-
console.error("Backend export error:", t),
|
|
46
|
+
console.error("Backend export error:", t), p(s("vlite.exportData.error", "An error occurred while exporting data."), "error");
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
if (!a.data || a.data.length === 0) {
|
|
50
|
-
|
|
50
|
+
p(s("vlite.exportData.noData", "No data available to export."), "warning");
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
try {
|
|
54
|
-
const t = a.filename ? a.filename : `${a.title.toLowerCase().replace(/\s+/g, "-")}-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}`, o =
|
|
54
|
+
const t = a.filename ? a.filename : `${a.title.toLowerCase().replace(/\s+/g, "-")}-${(/* @__PURE__ */ new Date()).toISOString().split("T")[0]}`, o = B();
|
|
55
55
|
switch (r) {
|
|
56
56
|
case "excel": {
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
b
|
|
57
|
+
const l = d.utils.book_new(), c = d.utils.json_to_sheet(o);
|
|
58
|
+
d.utils.book_append_sheet(l, c, a.title.substring(0, 31));
|
|
59
|
+
const m = d.write(l, { bookType: "xlsx", type: "array" }), C = new Blob([m], { type: "application/octet-stream" });
|
|
60
|
+
b(C, `${t}.xlsx`);
|
|
61
61
|
break;
|
|
62
62
|
}
|
|
63
63
|
case "csv": {
|
|
64
|
-
const c =
|
|
65
|
-
b
|
|
64
|
+
const c = N.unparse(o), m = new Blob(["\uFEFF" + c], { type: "text/csv;charset=utf-8;" });
|
|
65
|
+
b(m, `${t}.csv`);
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
case "json": {
|
|
69
|
-
const
|
|
70
|
-
b
|
|
69
|
+
const l = JSON.stringify(o, null, 2), c = new Blob([l], { type: "application/json" });
|
|
70
|
+
b(c, `${t}.json`);
|
|
71
71
|
break;
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
p(
|
|
75
|
+
s("vlite.exportData.success", `Data exported successfully as ${r.toUpperCase()}`, {
|
|
76
76
|
format: r.toUpperCase()
|
|
77
77
|
}),
|
|
78
78
|
"success"
|
|
79
79
|
), e && e();
|
|
80
80
|
} catch (t) {
|
|
81
|
-
console.error("Export error:", t),
|
|
81
|
+
console.error("Export error:", t), p(s("vlite.exportData.error", "An error occurred while exporting data."), "error");
|
|
82
82
|
}
|
|
83
|
-
},
|
|
84
|
-
return
|
|
85
|
-
exportData:
|
|
83
|
+
}, S = k(() => s("vlite.exportData.selectFormat", "Select Export Format"));
|
|
84
|
+
return F({
|
|
85
|
+
exportData: x,
|
|
86
86
|
availableFormats: h
|
|
87
87
|
}), (r, e) => (i(), g("div", null, [
|
|
88
|
-
n.formats.length === 1 ? (i(),
|
|
88
|
+
n.formats.length === 1 ? (i(), f(w, {
|
|
89
89
|
key: 0,
|
|
90
90
|
text: n.buttonText,
|
|
91
91
|
icon: n.buttonIcon,
|
|
92
92
|
variant: "outline",
|
|
93
|
-
onClick: e[0] || (e[0] = (t) =>
|
|
94
|
-
}, null, 8, ["text", "icon"])) : (i(),
|
|
93
|
+
onClick: e[0] || (e[0] = (t) => x(n.formats[0]))
|
|
94
|
+
}, null, 8, ["text", "icon"])) : (i(), f(I, {
|
|
95
95
|
key: 1,
|
|
96
96
|
title: n.title,
|
|
97
97
|
"max-width": "sm:max-w-[400px]"
|
|
98
98
|
}, {
|
|
99
|
-
trigger:
|
|
100
|
-
|
|
99
|
+
trigger: v(() => [
|
|
100
|
+
D(w, {
|
|
101
101
|
text: n.buttonText,
|
|
102
102
|
icon: n.buttonIcon,
|
|
103
103
|
variant: "outline"
|
|
104
104
|
}, null, 8, ["text", "icon"])
|
|
105
105
|
]),
|
|
106
|
-
default:
|
|
106
|
+
default: v(({ close: t }) => [
|
|
107
107
|
u("div", V, [
|
|
108
|
-
u("h6", U, y(
|
|
109
|
-
u("div",
|
|
110
|
-
(i(!0), g(j, null, T(h.value, (o) => (i(),
|
|
108
|
+
u("h6", U, y(S.value), 1),
|
|
109
|
+
u("div", A, [
|
|
110
|
+
(i(!0), g(j, null, T(h.value, (o) => (i(), f(w, {
|
|
111
111
|
key: o.value,
|
|
112
112
|
variant: "outline",
|
|
113
113
|
class: "w-full flex items-center justify-start gap-3 h-12",
|
|
114
|
-
onClick: (
|
|
114
|
+
onClick: (l) => x(o.value, t)
|
|
115
115
|
}, {
|
|
116
|
-
default:
|
|
117
|
-
|
|
116
|
+
default: v(() => [
|
|
117
|
+
D(O, {
|
|
118
118
|
icon: o.icon,
|
|
119
119
|
class: "text-muted-foreground h-5 w-5"
|
|
120
120
|
}, null, 8, ["icon"]),
|
|
@@ -131,5 +131,5 @@ const V = { class: "px-1 py-1 text-sm" }, U = { class: "font-medium mb-3 text-mu
|
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
133
|
export {
|
|
134
|
-
|
|
134
|
+
H as default
|
|
135
135
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as A, ref as b, computed as d, openBlock as w, createElementBlock as V, createElementVNode as a, toDisplayString as l, withModifiers as F, normalizeClass as E, createVNode as h, createCommentVNode as J, withCtx as K, createTextVNode as L } from "vue";
|
|
2
|
-
import R from "
|
|
2
|
+
import R from "papaparse";
|
|
3
3
|
import M from "../Icon.vue.js";
|
|
4
4
|
import W from "../Button.vue.js";
|
|
5
5
|
import q from "../Textarea.vue.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as u, computed as r, openBlock as o, createElementBlock as l, normalizeStyle as m, createCommentVNode as f } from "vue";
|
|
2
|
-
import {
|
|
2
|
+
import { useQRCode as p } from "@vueuse/integrations/useQRCode";
|
|
3
3
|
const d = ["src"], h = /* @__PURE__ */ u({
|
|
4
4
|
__name: "QRCode",
|
|
5
5
|
props: {
|
|
@@ -9,11 +9,11 @@ const d = ["src"], h = /* @__PURE__ */ u({
|
|
|
9
9
|
margin: { default: 4 },
|
|
10
10
|
color: {}
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const e =
|
|
12
|
+
setup(c) {
|
|
13
|
+
const e = c, i = r(() => e.value || ""), a = p(i, {
|
|
14
14
|
margin: e.margin,
|
|
15
15
|
color: e.color
|
|
16
|
-
}), n = r(() => e.imageUrl ? e.imageUrl : e.value ?
|
|
16
|
+
}), n = r(() => e.imageUrl ? e.imageUrl : e.value ? a.value : ""), s = r(() => {
|
|
17
17
|
const t = typeof e.size == "number" ? `${e.size}px` : e.size;
|
|
18
18
|
return {
|
|
19
19
|
width: t,
|
package/package.json
CHANGED
package/_virtual/Barcode.js
DELETED
package/_virtual/CODE128.js
DELETED
package/_virtual/CODE128A.js
DELETED
package/_virtual/CODE128B.js
DELETED
package/_virtual/CODE128C.js
DELETED
package/_virtual/CODE128_AUTO.js
DELETED
package/_virtual/CODE93.js
DELETED
package/_virtual/EAN.js
DELETED
package/_virtual/EAN13.js
DELETED
package/_virtual/EAN2.js
DELETED
package/_virtual/EAN5.js
DELETED
package/_virtual/EAN8.js
DELETED
package/_virtual/ErrorHandler.js
DELETED
package/_virtual/ITF.js
DELETED
package/_virtual/ITF14.js
DELETED
package/_virtual/JsBarcode.js
DELETED
package/_virtual/MSI.js
DELETED
package/_virtual/MSI10.js
DELETED
package/_virtual/MSI1010.js
DELETED
package/_virtual/MSI11.js
DELETED
package/_virtual/MSI1110.js
DELETED
package/_virtual/UPC.js
DELETED
package/_virtual/UPCE.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
var o = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2
|
-
function l(e) {
|
|
3
|
-
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
|
-
}
|
|
5
|
-
export {
|
|
6
|
-
o as commonjsGlobal,
|
|
7
|
-
l as getDefaultExportFromCjs
|
|
8
|
-
};
|
package/_virtual/auto.js
DELETED
package/_virtual/browser.js
DELETED
package/_virtual/browser2.js
DELETED
package/_virtual/canvas.js
DELETED
package/_virtual/canvas2.js
DELETED
package/_virtual/checksums.js
DELETED
package/_virtual/constants.js
DELETED
package/_virtual/constants2.js
DELETED
package/_virtual/constants3.js
DELETED
package/_virtual/constants4.js
DELETED
package/_virtual/defaults.js
DELETED
package/_virtual/dijkstra.js
DELETED
package/_virtual/encoder.js
DELETED
package/_virtual/exceptions.js
DELETED
package/_virtual/fixOptions.js
DELETED
package/_virtual/format-info.js
DELETED
package/_virtual/galois-field.js
DELETED
package/_virtual/index.js
DELETED
package/_virtual/index10.js
DELETED
package/_virtual/index11.js
DELETED
package/_virtual/index2.js
DELETED
package/_virtual/index3.js
DELETED
package/_virtual/index4.js
DELETED
package/_virtual/index5.js
DELETED
package/_virtual/index6.js
DELETED
package/_virtual/index7.js
DELETED
package/_virtual/index8.js
DELETED
package/_virtual/index9.js
DELETED
package/_virtual/mask-pattern.js
DELETED
package/_virtual/merge.js
DELETED
package/_virtual/mode.js
DELETED
package/_virtual/object.js
DELETED
package/_virtual/polynomial.js
DELETED
package/_virtual/qrcode.js
DELETED
package/_virtual/regex.js
DELETED
package/_virtual/segments.js
DELETED
package/_virtual/shared.js
DELETED
package/_virtual/svg-tag.js
DELETED
package/_virtual/svg.js
DELETED
package/_virtual/utils.js
DELETED
package/_virtual/utils2.js
DELETED
package/_virtual/version.js
DELETED