vlite3 0.4.8 → 0.5.2
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 +201 -100
- package/_virtual/Barcode.js +4 -0
- package/_virtual/CODE128.js +4 -0
- package/_virtual/CODE128A.js +4 -0
- package/_virtual/CODE128B.js +4 -0
- package/_virtual/CODE128C.js +4 -0
- package/_virtual/CODE128_AUTO.js +4 -0
- package/_virtual/CODE93.js +4 -0
- package/_virtual/CODE93FullASCII.js +4 -0
- package/_virtual/EAN.js +4 -0
- package/_virtual/EAN13.js +4 -0
- package/_virtual/EAN2.js +4 -0
- package/_virtual/EAN5.js +4 -0
- package/_virtual/EAN8.js +4 -0
- package/_virtual/ErrorHandler.js +4 -0
- package/_virtual/FileSaver.min.js +5 -0
- package/_virtual/FileSaver.min2.js +4 -0
- package/_virtual/ITF.js +4 -0
- package/_virtual/ITF14.js +4 -0
- package/_virtual/JsBarcode.js +7 -0
- package/_virtual/MSI.js +4 -0
- package/_virtual/MSI10.js +4 -0
- package/_virtual/MSI1010.js +4 -0
- package/_virtual/MSI11.js +4 -0
- package/_virtual/MSI1110.js +4 -0
- package/_virtual/UPC.js +4 -0
- package/_virtual/UPCE.js +4 -0
- package/_virtual/_commonjsHelpers.js +8 -0
- package/_virtual/alignment-pattern.js +4 -0
- package/_virtual/auto.js +4 -0
- package/_virtual/browser.js +7 -0
- package/_virtual/browser2.js +4 -0
- package/_virtual/canvas.js +4 -0
- package/_virtual/canvas2.js +4 -0
- package/_virtual/checksums.js +4 -0
- package/_virtual/constants.js +4 -0
- package/_virtual/constants2.js +4 -0
- package/_virtual/constants3.js +4 -0
- package/_virtual/constants4.js +4 -0
- package/_virtual/defaults.js +4 -0
- package/_virtual/dijkstra.js +4 -0
- package/_virtual/encoder.js +4 -0
- package/_virtual/error-correction-code.js +4 -0
- package/_virtual/error-correction-level.js +4 -0
- package/_virtual/exceptions.js +4 -0
- package/_virtual/finder-pattern.js +4 -0
- package/_virtual/fixOptions.js +4 -0
- package/_virtual/format-info.js +4 -0
- package/_virtual/galois-field.js +4 -0
- package/_virtual/getOptionsFromElement.js +4 -0
- package/_virtual/getRenderProperties.js +4 -0
- package/_virtual/index.js +4 -0
- package/_virtual/index10.js +4 -0
- package/_virtual/index11.js +4 -0
- package/_virtual/index2.js +4 -0
- package/_virtual/index3.js +4 -0
- package/_virtual/index4.js +4 -0
- package/_virtual/index5.js +4 -0
- package/_virtual/index6.js +4 -0
- package/_virtual/index7.js +4 -0
- package/_virtual/index8.js +4 -0
- package/_virtual/index9.js +4 -0
- package/_virtual/linearizeEncodings.js +4 -0
- package/_virtual/mask-pattern.js +4 -0
- package/_virtual/merge.js +4 -0
- package/_virtual/mode.js +4 -0
- package/_virtual/object.js +4 -0
- package/_virtual/optionsFromStrings.js +4 -0
- package/_virtual/papaparse.min.js +7 -0
- package/_virtual/papaparse.min2.js +4 -0
- package/_virtual/polynomial.js +4 -0
- package/_virtual/qrcode.js +4 -0
- package/_virtual/regex.js +4 -0
- package/_virtual/segments.js +4 -0
- package/_virtual/shared.js +4 -0
- package/_virtual/svg-tag.js +4 -0
- package/_virtual/svg.js +4 -0
- package/_virtual/utils.js +4 -0
- package/_virtual/utils2.js +4 -0
- package/_virtual/version-check.js +4 -0
- package/_virtual/version.js +4 -0
- package/components/Accordion/Accordion.vue.d.ts +7 -7
- package/components/Accordion/AccordionItem.vue.d.ts +4 -4
- package/components/Accordion/AccordionTrigger.vue.d.ts +2 -2
- package/components/Alert.vue.d.ts +1 -1
- package/components/Avatar.vue.d.ts +2 -2
- package/components/Avatar.vue.js +2 -2
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +5 -5
- package/components/Badge.vue.d.ts +1 -1
- package/components/Barcode/Barcode.vue.d.ts +22 -0
- package/components/Barcode/Barcode.vue.js +58 -0
- package/components/Barcode/Barcode.vue2.js +4 -0
- package/components/Barcode/index.d.ts +2 -0
- package/components/Barcode/types.d.ts +5 -0
- package/components/Barcode/types.js +15 -0
- package/components/Breadcrumb/Breadcrumb.vue.d.ts +23 -0
- package/components/Breadcrumb/Breadcrumb.vue.js +7 -0
- package/components/Breadcrumb/Breadcrumb.vue2.js +84 -0
- package/components/Breadcrumb/BreadcrumbItem.vue.d.ts +27 -0
- package/components/Breadcrumb/BreadcrumbItem.vue.js +7 -0
- package/components/Breadcrumb/BreadcrumbItem.vue2.js +50 -0
- package/components/Breadcrumb/index.d.ts +3 -0
- package/components/Breadcrumb/types.d.ts +19 -0
- package/components/Button.vue.d.ts +4 -4
- package/components/Button.vue.js +32 -29
- package/components/ButtonGroup.vue.d.ts +1 -1
- package/components/Carousel/Carousel.vue.d.ts +58 -58
- package/components/CheckBox.vue.d.ts +2 -2
- package/components/Chip/Chip.vue.d.ts +3 -3
- package/components/ChoiceBox/ChoiceBox.vue.d.ts +4 -4
- package/components/ColorPicker/ColorPicker.vue.d.ts +3 -3
- package/components/ColorPicker/index.d.ts +1 -0
- package/components/CommandPaletteContent.vue.d.ts +15 -0
- package/components/CommandPaletteContent.vue.js +7 -0
- package/components/CommandPaletteContent.vue2.js +287 -0
- package/components/ConfirmationModal.vue.js +12 -10
- package/components/DataList/DataList.vue.d.ts +2 -2
- package/components/DataTable/DataTable.vue.d.ts +6 -6
- package/components/DataTable/DataTableRow.vue.d.ts +3 -3
- package/components/DatePicker.vue.d.ts +2 -2
- package/components/DatePicker.vue.js +7 -7
- package/components/DateRangePicker.vue.d.ts +29 -0
- package/components/DateRangePicker.vue.js +231 -0
- package/components/DateRangePicker.vue2.js +4 -0
- package/components/Dropdown/Dropdown.vue.d.ts +11 -6
- package/components/Dropdown/Dropdown.vue.js +147 -109
- package/components/Dropdown/DropdownBooleanItem.vue.js +9 -8
- package/components/Dropdown/DropdownGroupedLayout.vue.d.ts +1 -1
- package/components/Dropdown/DropdownGroupedLayout.vue.js +35 -34
- package/components/Dropdown/DropdownItem.vue.js +11 -10
- package/components/Dropdown/DropdownMenu.vue.d.ts +5 -3
- package/components/Dropdown/DropdownMenu.vue.js +114 -111
- package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
- package/components/Dropdown/DropdownTrigger.vue.js +9 -7
- package/components/ExportData/ExportData.vue.d.ts +16 -0
- package/components/ExportData/ExportData.vue.js +135 -0
- package/components/ExportData/ExportData.vue2.js +4 -0
- package/components/ExportData/index.d.ts +2 -0
- package/components/ExportData/types.d.ts +17 -0
- package/components/FilePicker/FilePicker.vue.d.ts +5 -5
- package/components/Form/CustomFields.vue.d.ts +6 -6
- package/components/Form/CustomFields.vue.js +1 -1
- package/components/Form/Form.vue.d.ts +4 -5
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +221 -178
- package/components/Form/FormField.vue.d.ts +4 -3
- package/components/Form/FormField.vue.js +70 -62
- package/components/Form/FormFields.vue.d.ts +3 -1
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +105 -59
- package/components/GoogleLogin.vue.d.ts +2 -2
- package/components/Icon.vue.d.ts +2 -0
- package/components/Icon.vue.js +12 -11
- package/components/ImportData/ImportData.vue.d.ts +31 -0
- package/components/ImportData/ImportData.vue.js +242 -0
- package/components/ImportData/ImportData.vue2.js +4 -0
- package/components/ImportData/ImportStep1.vue.d.ts +23 -0
- package/components/ImportData/ImportStep1.vue.js +162 -0
- package/components/ImportData/ImportStep1.vue2.js +4 -0
- package/components/ImportData/ImportStep2.vue.d.ts +20 -0
- package/components/ImportData/ImportStep2.vue.js +98 -0
- package/components/ImportData/ImportStep2.vue2.js +4 -0
- package/components/ImportData/ImportStep3.vue.d.ts +6 -0
- package/components/ImportData/ImportStep3.vue.js +98 -0
- package/components/ImportData/ImportStep3.vue2.js +4 -0
- package/components/ImportData/ImportStep4.vue.d.ts +6 -0
- package/components/ImportData/ImportStep4.vue.js +139 -0
- package/components/ImportData/ImportStep4.vue2.js +4 -0
- package/components/ImportData/index.d.ts +2 -0
- package/components/ImportData/types.d.ts +51 -0
- package/components/Input.vue.d.ts +9 -9
- package/components/Input.vue.js +137 -120
- package/components/List/List.vue.d.ts +18 -0
- package/components/List/List.vue.js +189 -0
- package/components/List/List.vue2.js +4 -0
- package/components/List/ListFieldRow.vue.d.ts +35 -0
- package/components/List/ListFieldRow.vue.js +119 -0
- package/components/List/ListFieldRow.vue2.js +4 -0
- package/components/List/index.d.ts +4 -0
- package/components/List/types.d.ts +1 -0
- package/components/List/utils.d.ts +9 -0
- package/components/List/utils.js +64 -0
- package/components/Masonry/Masonry.vue.d.ts +2 -2
- package/components/Modal.vue.js +5 -122
- package/components/Modal.vue2.js +133 -2
- package/components/MultiSelect/MultiSelect.vue.d.ts +12 -9
- package/components/MultiSelect/MultiSelect.vue.js +101 -64
- package/components/Navbar/Navbar.vue.d.ts +48 -9
- package/components/Navbar/Navbar.vue.js +418 -146
- package/components/Navbar/NavbarItem.vue.d.ts +2 -2
- package/components/Navbar/NavbarTabs.vue.d.ts +21 -0
- package/components/Navbar/NavbarTabs.vue.js +179 -0
- package/components/Navbar/NavbarTabs.vue3.js +5 -0
- package/components/Navbar/index.d.ts +3 -0
- package/components/NavbarCommandPalette.vue.d.ts +48 -0
- package/components/NumberInput.vue.d.ts +8 -8
- package/components/OTPInput/OTPInput.vue.d.ts +7 -7
- package/components/Pagination/Pagination.vue.d.ts +1 -1
- package/components/PermissionMatrix/PermissionEditor.vue.d.ts +36 -0
- package/components/PermissionMatrix/PermissionEditor.vue.js +323 -0
- package/components/PermissionMatrix/PermissionEditor.vue2.js +4 -0
- package/components/PermissionMatrix/PermissionMatrix.vue.d.ts +15 -0
- package/components/PermissionMatrix/PermissionMatrix.vue.js +7 -0
- package/components/PermissionMatrix/PermissionMatrix.vue2.js +245 -0
- package/components/PermissionMatrix/index.d.ts +3 -0
- package/components/PermissionMatrix/types.d.ts +59 -0
- package/components/PricingPlan/PricingPlan.vue.d.ts +3 -3
- package/components/ProgressBar/ProgressBar.vue.d.ts +3 -3
- package/components/QRCode/QRCode.vue.d.ts +15 -0
- package/components/QRCode/QRCode.vue.js +38 -0
- package/components/QRCode/QRCode.vue2.js +4 -0
- package/components/QRCode/index.d.ts +1 -0
- package/components/Screen/Screen.vue.d.ts +232 -5
- package/components/Screen/Screen.vue.js +423 -271
- package/components/Screen/ScreenFilter.vue.d.ts +2 -2
- package/components/Screen/ScreenFilter.vue.js +9 -9
- package/components/Screen/types.d.ts +12 -0
- package/components/SidePanel.vue.d.ts +2 -2
- package/components/SidebarMenu/SidebarMenu.vue.d.ts +15 -2
- package/components/SidebarMenu/SidebarMenu.vue.js +117 -47
- package/components/SidebarMenu/SidebarMenuItem.vue.d.ts +2 -0
- package/components/SidebarMenu/SidebarMenuItem.vue.js +192 -175
- package/components/SidebarMenu/types.d.ts +32 -5
- package/components/Slider.vue.d.ts +2 -2
- package/components/Spinner/Spinner.vue.d.ts +2 -2
- package/components/Stats/Stats.vue.d.ts +14 -0
- package/components/Stats/Stats.vue.js +307 -0
- package/components/Stats/Stats.vue2.js +4 -0
- package/components/Stats/index.d.ts +2 -0
- package/components/Stats/types.d.ts +32 -0
- package/components/Switch.vue.d.ts +2 -1
- package/components/Switch.vue.js +4 -2
- package/components/Tabes/Tabes.vue.d.ts +3 -3
- package/components/Tabes/Tabes.vue.js +60 -57
- package/components/Tabes/types.d.ts +5 -0
- package/components/Textarea.vue.d.ts +3 -3
- package/components/{Timeline.vue.d.ts → Timeline/Timeline.vue.d.ts} +23 -2
- package/components/Timeline/Timeline.vue.js +92 -0
- package/components/Timeline/TimelineIndicator.vue.d.ts +9 -0
- package/components/Timeline/TimelineIndicator.vue.js +68 -0
- package/components/Timeline/TimelineIndicator.vue2.js +4 -0
- package/components/Timeline/TimelineItem.vue.d.ts +56 -0
- package/components/Timeline/TimelineItem.vue.js +173 -0
- package/components/Timeline/TimelineItem.vue2.js +4 -0
- package/components/Timeline/index.d.ts +3 -0
- package/components/Tooltip.vue.d.ts +2 -2
- package/components/Workbook/Sheet.vue.d.ts +2 -2
- package/components/Workbook/Workbook.vue.d.ts +3 -3
- package/components/index.d.ts +62 -0
- package/composables/useBreadcrumb.d.ts +17 -0
- package/composables/useBreadcrumb.js +27 -0
- package/core/config.d.ts +34 -0
- package/core/config.js +10 -7
- package/core/index.js +15 -8
- package/index.d.ts +55 -44
- package/index.js +243 -200
- package/package.json +12 -2
- package/router.d.ts +2 -0
- package/style.css +7 -5
- package/types/button.d.ts +1 -1
- package/types/config.type.d.ts +35 -0
- package/types/form.type.d.ts +3 -1
- package/types/index.d.ts +2 -1
- package/types/list.type.d.ts +57 -0
- package/types/navbar.type.d.ts +38 -1
- package/types/timeline.type.d.ts +14 -4
- package/components/Timeline.vue.js +0 -160
- /package/components/{Timeline.vue2.js → Timeline/Timeline.vue2.js} +0 -0
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { defineComponent as te, computed as h, ref as c, openBlock as n, createBlock as v, withCtx as x, createElementVNode as S, createTextVNode as C, toDisplayString as I, createElementBlock as F, createCommentVNode as $, createVNode as ae, unref as le, Fragment as ie, renderList as oe, renderSlot as re } from "vue";
|
|
2
|
+
import se from "../Modal.vue.js";
|
|
3
|
+
import _ from "../Button.vue.js";
|
|
4
|
+
import ne from "../Timeline/Timeline.vue.js";
|
|
5
|
+
import "@iconify/vue";
|
|
6
|
+
import { $t as z } from "../../utils/i18n.js";
|
|
7
|
+
import ue from "./ImportStep1.vue.js";
|
|
8
|
+
import pe from "./ImportStep2.vue.js";
|
|
9
|
+
import de from "./ImportStep3.vue.js";
|
|
10
|
+
import ce from "./ImportStep4.vue.js";
|
|
11
|
+
import { showToast as j } from "../../composables/useNotifications.js";
|
|
12
|
+
const ve = { class: "px-2 sm:px-4 py-2" }, me = { class: "min-h-[300px]" }, fe = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "mt-4 p-3 bg-destructive/10 border border-destructive/20 rounded-lg text-sm text-destructive"
|
|
15
|
+
}, ge = { class: "list-disc pl-5 space-y-1" }, he = { class: "flex items-center justify-between w-full" }, be = { key: 1 }, $e = /* @__PURE__ */ te({
|
|
16
|
+
__name: "ImportData",
|
|
17
|
+
props: {
|
|
18
|
+
title: { default: "Import Data" },
|
|
19
|
+
titleI18n: {},
|
|
20
|
+
buttonText: { default: "Import" },
|
|
21
|
+
buttonIcon: { default: "lucide:upload" },
|
|
22
|
+
fields: {},
|
|
23
|
+
batchSize: { default: 200 },
|
|
24
|
+
processBatch: {},
|
|
25
|
+
onComplete: {},
|
|
26
|
+
show: { type: Boolean, default: !1 }
|
|
27
|
+
},
|
|
28
|
+
emits: ["update:show"],
|
|
29
|
+
setup(y, { emit: K }) {
|
|
30
|
+
const s = y, L = K, E = h({
|
|
31
|
+
get: () => s.show,
|
|
32
|
+
set: (e) => L("update:show", e)
|
|
33
|
+
}), d = (e, a, u) => {
|
|
34
|
+
const t = u ? z(e, u) : z(e);
|
|
35
|
+
return t !== e ? t : a;
|
|
36
|
+
}, P = h(() => {
|
|
37
|
+
if (s.titleI18n) {
|
|
38
|
+
const e = z(s.titleI18n);
|
|
39
|
+
if (e !== s.titleI18n) return e;
|
|
40
|
+
}
|
|
41
|
+
return s.title;
|
|
42
|
+
}), i = c(1), f = c(!1), B = c([]), m = c({}), N = c({
|
|
43
|
+
existing: "replace",
|
|
44
|
+
new: "create"
|
|
45
|
+
}), M = c(""), T = c(null), q = c([]), O = c([]), w = c([]), U = {
|
|
46
|
+
total: 0,
|
|
47
|
+
processed: 0,
|
|
48
|
+
created: 0,
|
|
49
|
+
updated: 0,
|
|
50
|
+
skipped: 0,
|
|
51
|
+
failed: 0,
|
|
52
|
+
percentage: 0,
|
|
53
|
+
errors: []
|
|
54
|
+
}, o = c({ ...U }), A = () => {
|
|
55
|
+
i.value = 1, f.value = !1, B.value = [], m.value = {}, N.value = { existing: "replace", new: "create" }, M.value = "", T.value = null, q.value = [], O.value = [], w.value = [], o.value = { ...U };
|
|
56
|
+
}, R = () => {
|
|
57
|
+
const e = [], a = {};
|
|
58
|
+
for (const l in m.value) {
|
|
59
|
+
const p = m.value[l];
|
|
60
|
+
p && (a[p] || (a[p] = []), a[p].push(l));
|
|
61
|
+
}
|
|
62
|
+
for (const l in a)
|
|
63
|
+
a[l].length > 1 && e.push(
|
|
64
|
+
`Field "${l}" is mapped to multiple headers: ${a[l].join(", ")}`
|
|
65
|
+
);
|
|
66
|
+
const u = s.fields.filter((l) => l.required).map((l) => l.field), t = Object.values(m.value);
|
|
67
|
+
for (const l of u)
|
|
68
|
+
if (!t.includes(l)) {
|
|
69
|
+
const p = s.fields.find((r) => r.field === l)?.title || l;
|
|
70
|
+
e.push(`Required field "${p}" is not mapped.`);
|
|
71
|
+
}
|
|
72
|
+
return e;
|
|
73
|
+
}, V = () => {
|
|
74
|
+
i.value === 2 && (w.value = R(), w.value.length > 0) || i.value < 4 && i.value++;
|
|
75
|
+
}, G = () => {
|
|
76
|
+
i.value > 1 && !f.value && i.value--;
|
|
77
|
+
}, H = (e, a) => e.map((u) => {
|
|
78
|
+
const t = {};
|
|
79
|
+
for (const l in a) {
|
|
80
|
+
const p = a[l];
|
|
81
|
+
if (!p) continue;
|
|
82
|
+
let r = u[l];
|
|
83
|
+
const b = s.fields.find((g) => g.field === p);
|
|
84
|
+
if ((r == null || r === "") && b?.defaultValue !== void 0 && (r = b.defaultValue), b?.expectedType && (b.expectedType === "number" && (r = Number(r) || 0), b.expectedType === "boolean" && (r = !!(r && r.toString().toLowerCase() !== "false" && r !== "0"))), b?.onMatch && (r = b.onMatch(r)), p.includes(".")) {
|
|
85
|
+
const g = p.split(".");
|
|
86
|
+
let k = t;
|
|
87
|
+
for (let D = 0; D < g.length - 1; D++)
|
|
88
|
+
k[g[D]] || (k[g[D]] = {}), k = k[g[D]];
|
|
89
|
+
k[g[g.length - 1]] = r;
|
|
90
|
+
} else
|
|
91
|
+
t[p] = r;
|
|
92
|
+
}
|
|
93
|
+
return t;
|
|
94
|
+
}), J = async () => {
|
|
95
|
+
f.value = !0, V();
|
|
96
|
+
try {
|
|
97
|
+
const e = H(B.value, m.value);
|
|
98
|
+
o.value = { ...U, total: e.length };
|
|
99
|
+
const a = [];
|
|
100
|
+
for (let t = 0; t < e.length; t += s.batchSize)
|
|
101
|
+
a.push(e.slice(t, t + s.batchSize));
|
|
102
|
+
const u = setInterval(() => {
|
|
103
|
+
o.value.percentage < 90 && (o.value.percentage += Math.floor(Math.random() * 5) + 1);
|
|
104
|
+
}, 1e3);
|
|
105
|
+
for (const t of a) {
|
|
106
|
+
const l = await s.processBatch({
|
|
107
|
+
data: t,
|
|
108
|
+
options: N.value
|
|
109
|
+
});
|
|
110
|
+
o.value.processed += l.processed, o.value.created += l.created, o.value.updated += l.updated, o.value.skipped += l.skipped, o.value.failed += l.failed, o.value.errors = [...o.value.errors, ...l.errors || []], o.value.percentage = Math.min(
|
|
111
|
+
99,
|
|
112
|
+
Math.floor(o.value.processed / o.value.total * 100)
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
clearInterval(u), o.value.percentage = 100, o.value.failed === 0 ? j(d("vlite.importData.success", "Data imported successfully."), "success") : j(d("vlite.importData.partial", "Import completed with some errors."), "warning"), s.onComplete && s.onComplete();
|
|
116
|
+
} catch (e) {
|
|
117
|
+
console.error(e), j(d("vlite.importData.error", "A critical error occurred during import."), "error");
|
|
118
|
+
} finally {
|
|
119
|
+
f.value = !1;
|
|
120
|
+
}
|
|
121
|
+
}, Q = h(() => s.fields.map((e) => ({ value: e.field, label: e.title, required: e.required }))), W = h(() => [
|
|
122
|
+
{ id: 1, title: d("vlite.importData.stepUpload", "Upload"), icon: "lucide:upload" },
|
|
123
|
+
{ id: 2, title: d("vlite.importData.stepMapping", "Mapping"), icon: "lucide:git-pull-request" },
|
|
124
|
+
{ id: 3, title: d("vlite.importData.stepOptions", "Options"), icon: "lucide:settings-2" },
|
|
125
|
+
{ id: 4, title: d("vlite.importData.stepImport", "Import"), icon: "lucide:loader" }
|
|
126
|
+
]), X = h(() => d("vlite.importData.btnBack", "Back")), Y = h(() => d("vlite.importData.btnNext", "Next")), Z = h(() => d("vlite.importData.btnStart", "Start Import")), ee = h(() => d("vlite.importData.btnDone", "Done"));
|
|
127
|
+
return (e, a) => (n(), v(se, {
|
|
128
|
+
show: E.value,
|
|
129
|
+
"onUpdate:show": a[4] || (a[4] = (u) => E.value = u),
|
|
130
|
+
title: P.value,
|
|
131
|
+
"max-width": "sm:max-w-4xl",
|
|
132
|
+
onClose: A,
|
|
133
|
+
"close-outside": !f.value
|
|
134
|
+
}, {
|
|
135
|
+
trigger: x(() => [
|
|
136
|
+
re(e.$slots, "trigger", {}, () => [
|
|
137
|
+
y.show ? $("", !0) : (n(), v(_, {
|
|
138
|
+
key: 0,
|
|
139
|
+
text: y.buttonText,
|
|
140
|
+
icon: y.buttonIcon,
|
|
141
|
+
variant: "outline"
|
|
142
|
+
}, null, 8, ["text", "icon"]))
|
|
143
|
+
])
|
|
144
|
+
]),
|
|
145
|
+
default: x(({ close: u }) => [
|
|
146
|
+
S("div", ve, [
|
|
147
|
+
ae(le(ne), {
|
|
148
|
+
steps: W.value,
|
|
149
|
+
"active-step": i.value - 1,
|
|
150
|
+
class: "mb-13"
|
|
151
|
+
}, null, 8, ["steps", "active-step"]),
|
|
152
|
+
S("div", me, [
|
|
153
|
+
i.value === 1 ? (n(), v(ue, {
|
|
154
|
+
key: 0,
|
|
155
|
+
importMethod: M.value,
|
|
156
|
+
"onUpdate:importMethod": a[0] || (a[0] = (t) => M.value = t),
|
|
157
|
+
csvFile: T.value,
|
|
158
|
+
"onUpdate:csvFile": a[1] || (a[1] = (t) => T.value = t),
|
|
159
|
+
mappings: m.value,
|
|
160
|
+
"onUpdate:mappings": a[2] || (a[2] = (t) => m.value = t),
|
|
161
|
+
fields: y.fields,
|
|
162
|
+
headers: q.value,
|
|
163
|
+
preview: O.value,
|
|
164
|
+
importData: B.value,
|
|
165
|
+
onNext: V
|
|
166
|
+
}, null, 8, ["importMethod", "csvFile", "mappings", "fields", "headers", "preview", "importData"])) : i.value === 2 ? (n(), v(pe, {
|
|
167
|
+
key: 1,
|
|
168
|
+
mappings: m.value,
|
|
169
|
+
"onUpdate:mappings": a[3] || (a[3] = (t) => m.value = t),
|
|
170
|
+
headers: q.value,
|
|
171
|
+
preview: O.value,
|
|
172
|
+
availableFields: Q.value
|
|
173
|
+
}, null, 8, ["mappings", "headers", "preview", "availableFields"])) : i.value === 3 ? (n(), v(de, {
|
|
174
|
+
key: 2,
|
|
175
|
+
importOptions: N.value
|
|
176
|
+
}, null, 8, ["importOptions"])) : i.value === 4 ? (n(), v(ce, {
|
|
177
|
+
key: 3,
|
|
178
|
+
progress: o.value
|
|
179
|
+
}, null, 8, ["progress"])) : $("", !0)
|
|
180
|
+
]),
|
|
181
|
+
w.value.length > 0 && i.value === 2 ? (n(), F("div", fe, [
|
|
182
|
+
S("ul", ge, [
|
|
183
|
+
(n(!0), F(ie, null, oe(w.value, (t) => (n(), F("li", { key: t }, I(t), 1))), 128))
|
|
184
|
+
])
|
|
185
|
+
])) : $("", !0)
|
|
186
|
+
])
|
|
187
|
+
]),
|
|
188
|
+
footer: x(({ close: u }) => [
|
|
189
|
+
S("div", he, [
|
|
190
|
+
i.value > 1 && i.value < 4 ? (n(), v(_, {
|
|
191
|
+
key: 0,
|
|
192
|
+
variant: "outline",
|
|
193
|
+
onClick: G,
|
|
194
|
+
disabled: f.value,
|
|
195
|
+
icon: "lucide:arrow-left"
|
|
196
|
+
}, {
|
|
197
|
+
default: x(() => [
|
|
198
|
+
C(I(X.value), 1)
|
|
199
|
+
]),
|
|
200
|
+
_: 1
|
|
201
|
+
}, 8, ["disabled"])) : (n(), F("div", be)),
|
|
202
|
+
i.value < 3 ? (n(), v(_, {
|
|
203
|
+
key: 2,
|
|
204
|
+
variant: "primary",
|
|
205
|
+
onClick: V,
|
|
206
|
+
disabled: i.value === 1 && !M.value || f.value,
|
|
207
|
+
"icon-right": "lucide:arrow-right"
|
|
208
|
+
}, {
|
|
209
|
+
default: x(() => [
|
|
210
|
+
C(I(Y.value), 1)
|
|
211
|
+
]),
|
|
212
|
+
_: 1
|
|
213
|
+
}, 8, ["disabled"])) : i.value === 3 ? (n(), v(_, {
|
|
214
|
+
key: 3,
|
|
215
|
+
variant: "primary",
|
|
216
|
+
icon: "lucide:play",
|
|
217
|
+
onClick: J,
|
|
218
|
+
loading: f.value
|
|
219
|
+
}, {
|
|
220
|
+
default: x(() => [
|
|
221
|
+
C(I(Z.value), 1)
|
|
222
|
+
]),
|
|
223
|
+
_: 1
|
|
224
|
+
}, 8, ["loading"])) : i.value === 4 && o.value.percentage >= 100 ? (n(), v(_, {
|
|
225
|
+
key: 4,
|
|
226
|
+
variant: "primary",
|
|
227
|
+
onClick: u
|
|
228
|
+
}, {
|
|
229
|
+
default: x(() => [
|
|
230
|
+
C(I(ee.value), 1)
|
|
231
|
+
]),
|
|
232
|
+
_: 1
|
|
233
|
+
}, 8, ["onClick"])) : $("", !0)
|
|
234
|
+
])
|
|
235
|
+
]),
|
|
236
|
+
_: 3
|
|
237
|
+
}, 8, ["show", "title", "close-outside"]));
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
export {
|
|
241
|
+
$e as default
|
|
242
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ImportField } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
importMethod: string;
|
|
4
|
+
csvFile: File | null;
|
|
5
|
+
headers: string[];
|
|
6
|
+
fields: ImportField[];
|
|
7
|
+
preview: any[];
|
|
8
|
+
importData: any[];
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
next: (...args: any[]) => void;
|
|
12
|
+
"update:importMethod": (...args: any[]) => void;
|
|
13
|
+
"update:csvFile": (...args: any[]) => void;
|
|
14
|
+
"update:mappings": (...args: any[]) => void;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onNext?: (...args: any[]) => any;
|
|
17
|
+
"onUpdate:importMethod"?: (...args: any[]) => any;
|
|
18
|
+
"onUpdate:csvFile"?: (...args: any[]) => any;
|
|
19
|
+
"onUpdate:mappings"?: (...args: any[]) => any;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
21
|
+
fileInput: HTMLInputElement;
|
|
22
|
+
}, HTMLDivElement>;
|
|
23
|
+
export default _default;
|
|
@@ -0,0 +1,162 @@
|
|
|
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 "../../_virtual/papaparse.min.js";
|
|
3
|
+
import M from "../Icon.vue.js";
|
|
4
|
+
import W from "../Button.vue.js";
|
|
5
|
+
import q from "../Textarea.vue.js";
|
|
6
|
+
import { showToast as g } from "../../composables/useNotifications.js";
|
|
7
|
+
import { $t as k } from "../../utils/i18n.js";
|
|
8
|
+
import { camelCase as y } from "../../utils/functions.js";
|
|
9
|
+
const G = { class: "space-y-2" }, Q = { class: "font-medium text-md" }, X = { class: "space-y-6" }, Y = { class: "flex flex-col items-center justify-center pointer-events-none" }, Z = { class: "w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center mb-4 text-primary" }, ee = { class: "font-medium text-foreground mb-1" }, te = { class: "text-sm text-muted-foreground" }, re = {
|
|
10
|
+
key: 0,
|
|
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
|
+
}, ae = { class: "flex items-center gap-3 mb-4" }, oe = { class: "w-8 h-8 rounded-lg bg-secondary flex items-center justify-center text-secondary-foreground" }, se = { class: "font-medium text-foreground leading-none" }, ie = { class: "flex justify-end mt-3" }, ve = /* @__PURE__ */ A({
|
|
13
|
+
__name: "ImportStep1",
|
|
14
|
+
props: {
|
|
15
|
+
importMethod: {},
|
|
16
|
+
csvFile: {},
|
|
17
|
+
headers: {},
|
|
18
|
+
fields: {},
|
|
19
|
+
preview: {},
|
|
20
|
+
importData: {}
|
|
21
|
+
},
|
|
22
|
+
emits: ["update:importMethod", "update:csvFile", "update:mappings", "next"],
|
|
23
|
+
setup(n, { emit: P }) {
|
|
24
|
+
const i = n, c = P, o = (t, e, r) => {
|
|
25
|
+
const s = r ? k(t, r) : k(t);
|
|
26
|
+
return s !== t ? s : e;
|
|
27
|
+
}, D = b(null), f = b(!1), p = b(""), S = (t) => {
|
|
28
|
+
if (t.preventDefault(), f.value = !1, t.dataTransfer?.files && t.dataTransfer.files.length > 0) {
|
|
29
|
+
const e = t.dataTransfer.files[0];
|
|
30
|
+
e.type === "text/csv" || e.name.endsWith(".csv") ? _(e) : g(o("vlite.importData.csvOnly", "Please upload a CSV file"), "error");
|
|
31
|
+
}
|
|
32
|
+
}, _ = (t) => {
|
|
33
|
+
c("update:csvFile", t), c("update:importMethod", "file");
|
|
34
|
+
const e = new FileReader();
|
|
35
|
+
e.onload = (r) => {
|
|
36
|
+
r.target?.result && C(r.target.result);
|
|
37
|
+
}, e.readAsText(t);
|
|
38
|
+
}, T = () => {
|
|
39
|
+
c("update:importMethod", "paste"), p.value && C(p.value);
|
|
40
|
+
}, j = (t) => {
|
|
41
|
+
const e = y(t).replace(/\s+/g, ""), r = {};
|
|
42
|
+
return i.fields.forEach((s) => {
|
|
43
|
+
r[y(s.field)] = s.field, s.matchings?.forEach((u) => {
|
|
44
|
+
r[y(u)] = s.field;
|
|
45
|
+
});
|
|
46
|
+
}), r[e] || "";
|
|
47
|
+
}, C = (t) => {
|
|
48
|
+
try {
|
|
49
|
+
R.parse(t, {
|
|
50
|
+
header: !0,
|
|
51
|
+
skipEmptyLines: !0,
|
|
52
|
+
complete: (e) => {
|
|
53
|
+
if (!e.data || e.data.length === 0) {
|
|
54
|
+
g(o("vlite.importData.emptyCsv", "The CSV file is empty."), "warning");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const r = Object.keys(e.data[0]);
|
|
58
|
+
i.headers.splice(0, i.headers.length, ...r);
|
|
59
|
+
const s = e.data.map((m) => {
|
|
60
|
+
const v = {};
|
|
61
|
+
return Object.keys(m).forEach((x) => {
|
|
62
|
+
v[x] = m[x] || i.fields.find((B) => B.field === x)?.defaultValue;
|
|
63
|
+
}), v;
|
|
64
|
+
});
|
|
65
|
+
i.importData.splice(0, i.importData.length, ...s), i.preview.splice(0, i.preview.length, ...e.data.slice(0, 3));
|
|
66
|
+
const u = {};
|
|
67
|
+
r.forEach((m) => {
|
|
68
|
+
const v = j(m);
|
|
69
|
+
u[m] = v || "";
|
|
70
|
+
}), c("update:mappings", u), c("next");
|
|
71
|
+
},
|
|
72
|
+
error: (e) => g(
|
|
73
|
+
o("vlite.importData.parseError", "Failed to parse CSV: ") + e.message,
|
|
74
|
+
"error"
|
|
75
|
+
)
|
|
76
|
+
});
|
|
77
|
+
} catch (e) {
|
|
78
|
+
g(o("vlite.importData.processError", "Error processing CSV data"), "error"), console.error(e);
|
|
79
|
+
}
|
|
80
|
+
}, O = (t) => {
|
|
81
|
+
const e = t.target;
|
|
82
|
+
e.files && e.files.length > 0 && _(e.files[0]);
|
|
83
|
+
}, $ = d(() => o("vlite.importData.uploadData", "Upload Data")), I = d(() => o("vlite.importData.dragDrop", "Drag & drop a file here or click to browse")), z = d(() => o("vlite.importData.csvOnlyHint", "Only CSV files are supported")), H = d(() => o("vlite.importData.pasteData", "Or paste CSV/Excel data")), N = d(() => o("vlite.importData.process", "Process Data")), U = d(() => o("vlite.importData.pastePlaceholder", `id, name, email
|
|
84
|
+
1, John Doe, john@example.com`));
|
|
85
|
+
return (t, e) => (w(), V("div", G, [
|
|
86
|
+
a("h5", Q, l($.value), 1),
|
|
87
|
+
a("div", X, [
|
|
88
|
+
a("div", {
|
|
89
|
+
class: E([
|
|
90
|
+
"relative border-2 border-dashed rounded-xl p-8 text-center cursor-pointer transition-colors",
|
|
91
|
+
n.importMethod === "file" ? "border-primary bg-primary/5" : "border-border hover:border-primary/50",
|
|
92
|
+
f.value ? "border-primary bg-primary/10 scale-[1.01]" : ""
|
|
93
|
+
]),
|
|
94
|
+
onClick: e[0] || (e[0] = (r) => D.value?.click()),
|
|
95
|
+
onDragover: e[1] || (e[1] = F((r) => f.value = !0, ["prevent"])),
|
|
96
|
+
onDragleave: e[2] || (e[2] = F((r) => f.value = !1, ["prevent"])),
|
|
97
|
+
onDrop: S
|
|
98
|
+
}, [
|
|
99
|
+
a("input", {
|
|
100
|
+
type: "file",
|
|
101
|
+
ref_key: "fileInput",
|
|
102
|
+
ref: D,
|
|
103
|
+
class: "hidden",
|
|
104
|
+
accept: ".csv",
|
|
105
|
+
onChange: O
|
|
106
|
+
}, null, 544),
|
|
107
|
+
a("div", Y, [
|
|
108
|
+
a("div", Z, [
|
|
109
|
+
h(M, {
|
|
110
|
+
icon: "lucide:upload-cloud",
|
|
111
|
+
class: "w-6 h-6"
|
|
112
|
+
})
|
|
113
|
+
]),
|
|
114
|
+
a("p", ee, l(I.value), 1),
|
|
115
|
+
a("p", te, l(z.value), 1),
|
|
116
|
+
n.csvFile ? (w(), V("p", re, l(n.csvFile.name) + " (" + l((n.csvFile.size / 1024).toFixed(2)) + " KB) ", 1)) : J("", !0)
|
|
117
|
+
])
|
|
118
|
+
], 34),
|
|
119
|
+
a("div", {
|
|
120
|
+
class: E([
|
|
121
|
+
"border rounded-xl p-6 transition-colors",
|
|
122
|
+
n.importMethod === "paste" ? "border-primary shadow-sm ring-1 ring-primary/20" : "border-border"
|
|
123
|
+
])
|
|
124
|
+
}, [
|
|
125
|
+
a("div", ae, [
|
|
126
|
+
a("div", oe, [
|
|
127
|
+
h(M, {
|
|
128
|
+
icon: "lucide:clipboard-paste",
|
|
129
|
+
class: "w-4 h-4"
|
|
130
|
+
})
|
|
131
|
+
]),
|
|
132
|
+
a("div", null, [
|
|
133
|
+
a("p", se, l(H.value), 1)
|
|
134
|
+
])
|
|
135
|
+
]),
|
|
136
|
+
h(q, {
|
|
137
|
+
modelValue: p.value,
|
|
138
|
+
"onUpdate:modelValue": e[3] || (e[3] = (r) => p.value = r),
|
|
139
|
+
class: "w-full h-32",
|
|
140
|
+
placeholder: U.value
|
|
141
|
+
}, null, 8, ["modelValue", "placeholder"]),
|
|
142
|
+
a("div", ie, [
|
|
143
|
+
h(W, {
|
|
144
|
+
variant: "secondary",
|
|
145
|
+
size: "sm",
|
|
146
|
+
onClick: T,
|
|
147
|
+
disabled: !p.value
|
|
148
|
+
}, {
|
|
149
|
+
default: K(() => [
|
|
150
|
+
L(l(N.value), 1)
|
|
151
|
+
]),
|
|
152
|
+
_: 1
|
|
153
|
+
}, 8, ["disabled"])
|
|
154
|
+
])
|
|
155
|
+
], 2)
|
|
156
|
+
])
|
|
157
|
+
]));
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
export {
|
|
161
|
+
ve as default
|
|
162
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
headers: string[];
|
|
3
|
+
preview: any[];
|
|
4
|
+
mappings: Record<string, string>;
|
|
5
|
+
availableFields: {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
required?: boolean;
|
|
9
|
+
}[];
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
+
next: (...args: any[]) => void;
|
|
13
|
+
"update:mappings": (...args: any[]) => void;
|
|
14
|
+
prev: (...args: any[]) => void;
|
|
15
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
16
|
+
onNext?: (...args: any[]) => any;
|
|
17
|
+
"onUpdate:mappings"?: (...args: any[]) => any;
|
|
18
|
+
onPrev?: (...args: any[]) => any;
|
|
19
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { defineComponent as H, ref as M, computed as c, openBlock as o, createElementBlock as l, createElementVNode as e, toDisplayString as a, Fragment as m, renderList as v, normalizeClass as N, createBlock as V, unref as $, createCommentVNode as x, createVNode as z } from "vue";
|
|
2
|
+
import A from "../Dropdown/Dropdown.vue.js";
|
|
3
|
+
import "@iconify/vue";
|
|
4
|
+
import { $t as B } from "../../utils/i18n.js";
|
|
5
|
+
import I from "../CheckBox.vue.js";
|
|
6
|
+
const O = { class: "space-y-6" }, j = { class: "font-medium text-lg mb-1" }, E = { class: "text-sm text-muted-foreground" }, P = { class: "border border-border rounded-xl overflow-hidden" }, R = { class: "overflow-x-auto max-h-[400px]" }, U = { class: "w-full text-sm text-left" }, q = { class: "text-xs text-muted-foreground uppercase bg-muted sticky top-0 z-10" }, L = { class: "px-4 py-3 font-medium" }, W = { class: "px-4 py-3 font-medium" }, G = { class: "px-4 py-3 font-medium" }, J = { class: "divide-y divide-border" }, K = { class: "px-4 py-3 font-medium text-foreground whitespace-nowrap" }, Q = { class: "px-4 py-2 min-w-[200px]" }, T = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "text-xs italic text-muted-foreground"
|
|
9
|
+
}, X = { class: "px-4 py-3 text-muted-foreground min-w-[200px] max-w-[300px]" }, Y = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "space-y-1"
|
|
12
|
+
}, Z = { class: "px-4 py-3 text-center align-middle" }, ee = { class: "flex justify-center items-center h-full" }, te = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "text-center text-sm text-warning font-medium p-4 bg-warning/10 rounded-lg border border-warning/20"
|
|
15
|
+
}, ae = /* @__PURE__ */ H({
|
|
16
|
+
__name: "ImportStep2",
|
|
17
|
+
props: {
|
|
18
|
+
headers: {},
|
|
19
|
+
preview: {},
|
|
20
|
+
mappings: {},
|
|
21
|
+
availableFields: {}
|
|
22
|
+
},
|
|
23
|
+
emits: ["next", "prev", "update:mappings"],
|
|
24
|
+
setup(p, { emit: g }) {
|
|
25
|
+
const u = p, _ = g, n = M([]), d = (t, i) => {
|
|
26
|
+
const s = B(t);
|
|
27
|
+
return s !== t ? s : i;
|
|
28
|
+
}, f = c(() => u.headers.filter((t) => u.mappings[t] !== "")), h = (t) => {
|
|
29
|
+
const i = { ...u.mappings };
|
|
30
|
+
n.value.includes(t) ? n.value = n.value.filter((r) => r !== t) : n.value.push(t), i[t] !== "" && (i[t] = ""), _("update:mappings", i);
|
|
31
|
+
}, y = () => u.availableFields.map((t) => ({
|
|
32
|
+
label: t.required ? `${t.label} *` : t.label,
|
|
33
|
+
value: t.value
|
|
34
|
+
})), w = c(() => d("vlite.importData.assignFields", "Assign Fields")), b = c(() => d("vlite.importData.assignDesc", "Match your CSV columns to the correct system fields.")), k = c(() => d("vlite.importData.csvHeader", "CSV Header")), D = c(() => d("vlite.importData.fieldMapping", "System Field")), S = c(() => d("vlite.importData.preview", "Data Preview")), F = c(() => d("vlite.importData.noHeaders", "No headers mapped. Data will not be imported properly."));
|
|
35
|
+
return (t, i) => (o(), l("div", O, [
|
|
36
|
+
e("div", null, [
|
|
37
|
+
e("h4", j, a(w.value), 1),
|
|
38
|
+
e("p", E, a(b.value), 1)
|
|
39
|
+
]),
|
|
40
|
+
e("div", P, [
|
|
41
|
+
e("div", R, [
|
|
42
|
+
e("table", U, [
|
|
43
|
+
e("thead", q, [
|
|
44
|
+
e("tr", null, [
|
|
45
|
+
e("th", L, a(k.value), 1),
|
|
46
|
+
e("th", W, a(D.value), 1),
|
|
47
|
+
e("th", G, a(S.value), 1),
|
|
48
|
+
i[0] || (i[0] = e("th", { class: "px-4 py-3 font-medium text-center w-16" }, "Ignore", -1))
|
|
49
|
+
])
|
|
50
|
+
]),
|
|
51
|
+
e("tbody", J, [
|
|
52
|
+
(o(!0), l(m, null, v(p.headers, (s) => (o(), l("tr", {
|
|
53
|
+
key: s,
|
|
54
|
+
class: N(n.value.includes(s) ? "bg-muted/30 opacity-60" : "hover:bg-muted/10")
|
|
55
|
+
}, [
|
|
56
|
+
e("td", K, a(s), 1),
|
|
57
|
+
e("td", Q, [
|
|
58
|
+
n.value.includes(s) ? (o(), l("span", T, "Ignored")) : (o(), V($(A), {
|
|
59
|
+
key: 0,
|
|
60
|
+
class: "w-full",
|
|
61
|
+
options: y(),
|
|
62
|
+
selected: p.mappings[s],
|
|
63
|
+
placeholder: "Select Field",
|
|
64
|
+
variant: "outline",
|
|
65
|
+
showCaret: "",
|
|
66
|
+
"btn-props": { class: "w-full justify-between" },
|
|
67
|
+
onOnSelect: (r) => p.mappings[s] = r.value
|
|
68
|
+
}, null, 8, ["options", "selected", "onOnSelect"]))
|
|
69
|
+
]),
|
|
70
|
+
e("td", X, [
|
|
71
|
+
n.value.includes(s) ? x("", !0) : (o(), l("div", Y, [
|
|
72
|
+
(o(!0), l(m, null, v(p.preview, (r, C) => (o(), l("div", {
|
|
73
|
+
key: C,
|
|
74
|
+
class: "truncate text-xs"
|
|
75
|
+
}, a(String(r[s] || "").slice(0, 50)), 1))), 128))
|
|
76
|
+
]))
|
|
77
|
+
]),
|
|
78
|
+
e("td", Z, [
|
|
79
|
+
e("div", ee, [
|
|
80
|
+
z(I, {
|
|
81
|
+
checked: n.value.includes(s),
|
|
82
|
+
"onUpdate:checked": (r) => h(s),
|
|
83
|
+
size: "sm"
|
|
84
|
+
}, null, 8, ["checked", "onUpdate:checked"])
|
|
85
|
+
])
|
|
86
|
+
])
|
|
87
|
+
], 2))), 128))
|
|
88
|
+
])
|
|
89
|
+
])
|
|
90
|
+
])
|
|
91
|
+
]),
|
|
92
|
+
f.value.length === 0 ? (o(), l("div", te, a(F.value), 1)) : x("", !0)
|
|
93
|
+
]));
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
export {
|
|
97
|
+
ae as default
|
|
98
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ImportOptions } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
importOptions: ImportOptions;
|
|
4
|
+
};
|
|
5
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { defineComponent as _, computed as o, openBlock as g, createElementBlock as w, createElementVNode as e, toDisplayString as r, createVNode as a, unref as l } from "vue";
|
|
2
|
+
import c from "../Icon.vue.js";
|
|
3
|
+
import p from "../ChoiceBox/ChoiceBox.vue.js";
|
|
4
|
+
import { $t as b } from "../../utils/i18n.js";
|
|
5
|
+
const k = { class: "space-y-8" }, y = { class: "font-medium text-md mb-2" }, O = { class: "bg-card rounded-xl p-5 border border-border shadow-sm" }, N = { class: "flex items-center mb-6" }, S = { class: "bg-primary/10 p-2.5 rounded-lg mr-4 text-primary shrink-0" }, V = { class: "font-semibold text-foreground text-base" }, C = { class: "text-sm text-muted-foreground" }, M = { class: "bg-card rounded-xl p-5 border border-border shadow-sm" }, T = { class: "flex items-center mb-6" }, F = { class: "bg-primary/10 p-2.5 rounded-lg mr-4 text-primary shrink-0" }, A = { class: "font-semibold text-foreground text-base" }, I = { class: "text-sm text-muted-foreground" }, R = /* @__PURE__ */ _({
|
|
6
|
+
__name: "ImportStep3",
|
|
7
|
+
props: {
|
|
8
|
+
importOptions: {}
|
|
9
|
+
},
|
|
10
|
+
setup(n) {
|
|
11
|
+
const t = (d, i) => {
|
|
12
|
+
const s = b(d);
|
|
13
|
+
return s !== d ? s : i;
|
|
14
|
+
}, m = o(() => t("vlite.importData.options", "Import Options")), u = o(() => t("vlite.importData.matchFound", "When a match is found")), h = o(() => t("vlite.importData.matchFoundDesc", "Determine how to handle records that already exist in the system.")), v = o(() => t("vlite.importData.noMatch", "When no match is found")), x = o(() => t("vlite.importData.noMatchDesc", "Determine how to handle completely new records.")), f = o(() => [
|
|
15
|
+
{
|
|
16
|
+
id: "add",
|
|
17
|
+
title: t("vlite.importData.optAddTitle", "Add New"),
|
|
18
|
+
description: t("vlite.importData.optAddDesc", "Creates a duplicate record instead of overwriting."),
|
|
19
|
+
icon: "lucide:plus-circle"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: "replace",
|
|
23
|
+
title: t("vlite.importData.optReplaceTitle", "Update"),
|
|
24
|
+
description: t("vlite.importData.optReplaceDesc", "Overwrites existing fields with the imported data."),
|
|
25
|
+
icon: "lucide:refresh-cw"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "skip",
|
|
29
|
+
title: t("vlite.importData.optSkipTitle", "Skip"),
|
|
30
|
+
description: t("vlite.importData.optSkipDesc", "Leaves existing records completely untouched."),
|
|
31
|
+
icon: "lucide:skip-forward"
|
|
32
|
+
}
|
|
33
|
+
]), D = o(() => [
|
|
34
|
+
{
|
|
35
|
+
id: "create",
|
|
36
|
+
title: t("vlite.importData.optCreateTitle", "Create New"),
|
|
37
|
+
description: t("vlite.importData.optCreateDesc", "Creates a completely new record in the system."),
|
|
38
|
+
icon: "lucide:check-circle-2"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: "skip",
|
|
42
|
+
title: t("vlite.importData.optSkipNewTitle", "Skip"),
|
|
43
|
+
description: t("vlite.importData.optSkipNewDesc", "Ignores the row if it does not already exist."),
|
|
44
|
+
icon: "lucide:ban"
|
|
45
|
+
}
|
|
46
|
+
]);
|
|
47
|
+
return (d, i) => (g(), w("div", k, [
|
|
48
|
+
e("div", null, [
|
|
49
|
+
e("div", null, [
|
|
50
|
+
e("h5", y, r(m.value), 1)
|
|
51
|
+
]),
|
|
52
|
+
e("div", O, [
|
|
53
|
+
e("div", N, [
|
|
54
|
+
e("div", S, [
|
|
55
|
+
a(c, {
|
|
56
|
+
icon: "lucide:git-compare",
|
|
57
|
+
class: "w-6 h-6"
|
|
58
|
+
})
|
|
59
|
+
]),
|
|
60
|
+
e("div", null, [
|
|
61
|
+
e("h6", V, r(u.value), 1),
|
|
62
|
+
e("p", C, r(h.value), 1)
|
|
63
|
+
])
|
|
64
|
+
]),
|
|
65
|
+
a(l(p), {
|
|
66
|
+
modelValue: n.importOptions.existing,
|
|
67
|
+
"onUpdate:modelValue": i[0] || (i[0] = (s) => n.importOptions.existing = s),
|
|
68
|
+
options: f.value,
|
|
69
|
+
grid: 3
|
|
70
|
+
}, null, 8, ["modelValue", "options"])
|
|
71
|
+
])
|
|
72
|
+
]),
|
|
73
|
+
e("div", M, [
|
|
74
|
+
e("div", T, [
|
|
75
|
+
e("div", F, [
|
|
76
|
+
a(c, {
|
|
77
|
+
icon: "lucide:file-plus",
|
|
78
|
+
class: "w-6 h-6"
|
|
79
|
+
})
|
|
80
|
+
]),
|
|
81
|
+
e("div", null, [
|
|
82
|
+
e("h6", A, r(v.value), 1),
|
|
83
|
+
e("p", I, r(x.value), 1)
|
|
84
|
+
])
|
|
85
|
+
]),
|
|
86
|
+
a(l(p), {
|
|
87
|
+
modelValue: n.importOptions.new,
|
|
88
|
+
"onUpdate:modelValue": i[1] || (i[1] = (s) => n.importOptions.new = s),
|
|
89
|
+
options: D.value,
|
|
90
|
+
grid: 2
|
|
91
|
+
}, null, 8, ["modelValue", "options"])
|
|
92
|
+
])
|
|
93
|
+
]));
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
export {
|
|
97
|
+
R as default
|
|
98
|
+
};
|