vlite3 1.3.8 → 1.3.10

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.
@@ -16,7 +16,7 @@ import "v-datepicker-lite";
16
16
  import "v-datepicker-lite/style.css";
17
17
  import "@jaames/iro";
18
18
  import "@vueuse/core";
19
- /* empty css */
19
+ /* empty css */
20
20
  import Ue from "../IconPicker.vue.js";
21
21
  /* empty css */
22
22
  /* empty css */
@@ -1,5 +1,5 @@
1
- import o from "./ColorIro.vue.js";
2
- /* empty css */
1
+ import o from "./ColorIro.vue2.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -6,8 +6,8 @@ import O from "../Input.vue.js";
6
6
  import "../../core/config.js";
7
7
  /* empty css */
8
8
  import y from "../Button.vue.js";
9
- import E from "./ColorIro.vue.js";
10
- /* empty css */
9
+ import E from "./ColorIro.vue2.js";
10
+ /* empty css */
11
11
  import { useEyeDropper as P } from "@vueuse/core";
12
12
  const I = {
13
13
  key: 0,
@@ -4,7 +4,7 @@ import k from "../Icon.vue.js";
4
4
  import { $t as E } from "../../utils/i18n.js";
5
5
  import { useCommandPaletteItems as Y } from "./useCommandPaletteItems.js";
6
6
  import { useCommandPaletteNav as Z } from "./useCommandPaletteNav.js";
7
- import ee from "./CommandPaletteItem.vue.js";
7
+ import ee from "./CommandPaletteItem.vue2.js";
8
8
  const te = { class: "command-palette-content flex flex-col w-full h-full max-h-[70vh]" }, oe = { class: "flex items-center gap-3 px-4 py-3 border-b border-border/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,5 +1,5 @@
1
1
  import t from "./CommandPaletteItem.vue3.js";
2
- /* empty css */
2
+ /* empty css */
3
3
  import o from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const r = /* @__PURE__ */ o(t, [["__scopeId", "data-v-66b1ae06"]]);
5
5
  export {
@@ -1,16 +1,16 @@
1
- import { defineComponent as ne, computed as h, ref as b, shallowRef as $, openBlock as n, createBlock as d, withCtx as w, createElementVNode as B, createTextVNode as U, toDisplayString as _, createElementBlock as N, createCommentVNode as T, createVNode as ue, unref as pe, Fragment as ce, renderList as de, renderSlot as ve } from "vue";
1
+ import { defineComponent as ne, computed as h, ref as y, shallowRef as $, openBlock as n, createBlock as d, withCtx as b, createElementVNode as B, createTextVNode as U, toDisplayString as _, createElementBlock as N, createCommentVNode as T, createVNode as ue, unref as pe, Fragment as ce, renderList as de, renderSlot as ve } from "vue";
2
2
  import me from "../Modal.vue.js";
3
3
  import I from "../Button.vue.js";
4
4
  import fe from "../Timeline/Timeline.vue.js";
5
5
  import "@iconify/vue";
6
- import { $t as j } from "../../utils/i18n.js";
6
+ import { $t as E } from "../../utils/i18n.js";
7
7
  import "../../core/config.js";
8
8
  import he from "./ImportStep1.vue.js";
9
9
  import ge from "./ImportStep2.vue.js";
10
- import be from "./ImportStep3.vue.js";
11
- import we from "./ImportStep4.vue.js";
12
- import { showToast as E } from "../../composables/useNotifications.js";
13
- const xe = { class: "px-2" }, ye = { class: "min-h-[300px]" }, De = {
10
+ import ye from "./ImportStep3.vue.js";
11
+ import be from "./ImportStep4.vue.js";
12
+ import { showToast as j } from "../../composables/useNotifications.js";
13
+ const we = { class: "px-2" }, xe = { class: "min-h-[300px]" }, De = {
14
14
  key: 0,
15
15
  class: "mt-4 p-3 bg-destructive/10 border border-destructive/20 rounded-lg text-sm text-destructive"
16
16
  }, ke = { class: "list-disc pl-5 space-y-1" }, _e = { class: "flex items-center justify-between w-full" }, Ie = { key: 1 }, ze = /* @__PURE__ */ ne({
@@ -27,23 +27,23 @@ const xe = { class: "px-2" }, ye = { class: "min-h-[300px]" }, De = {
27
27
  show: { type: Boolean, default: !1 }
28
28
  },
29
29
  emits: ["update:show"],
30
- setup(x, { emit: L }) {
31
- const s = x, R = L, P = h({
32
- get: () => s.show,
33
- set: (e) => R("update:show", e)
34
- }), c = (e, o, u) => {
35
- const i = u ? j(e, u) : j(e);
36
- return i !== e ? i : o;
37
- }, A = h(() => {
38
- if (s.titleI18n) {
39
- const e = j(s.titleI18n);
40
- if (e !== s.titleI18n) return e;
30
+ setup(w, { emit: K }) {
31
+ const i = w, L = K, A = h({
32
+ get: () => i.show,
33
+ set: (e) => L("update:show", e)
34
+ }), c = (e, r, u) => {
35
+ const a = u ? E(e, u) : E(e);
36
+ return a !== e ? a : r;
37
+ }, R = h(() => {
38
+ if (i.titleI18n) {
39
+ const e = E(i.titleI18n);
40
+ if (e !== i.titleI18n) return e;
41
41
  }
42
- return s.title;
43
- }), a = b(1), v = b(!1), M = $([]), m = b({}), q = b({
42
+ return i.title;
43
+ }), l = y(1), m = y(!1), C = $([]), v = y({}), q = y({
44
44
  existing: "replace",
45
45
  new: "create"
46
- }), C = b(""), O = $(null), S = $([]), F = $([]), y = b([]), V = {
46
+ }), M = y(""), O = $(null), S = $([]), F = $([]), x = y([]), V = {
47
47
  total: 0,
48
48
  processed: 0,
49
49
  created: 0,
@@ -52,197 +52,200 @@ const xe = { class: "px-2" }, ye = { class: "min-h-[300px]" }, De = {
52
52
  failed: 0,
53
53
  percentage: 0,
54
54
  errors: []
55
- }, l = b({ ...V }), H = () => {
56
- a.value = 1, v.value = !1, M.value = [], m.value = {}, q.value = { existing: "replace", new: "create" }, C.value = "", O.value = null, S.value = [], F.value = [], y.value = [], l.value = { ...V };
55
+ }, o = y({ ...V }), H = () => {
56
+ l.value = 1, m.value = !1, C.value = [], v.value = {}, q.value = { existing: "replace", new: "create" }, M.value = "", O.value = null, S.value = [], F.value = [], x.value = [], o.value = { ...V };
57
57
  }, G = () => {
58
- const e = [], o = {};
59
- for (const t in m.value) {
60
- const p = m.value[t];
61
- p && (o[p] || (o[p] = []), o[p].push(t));
58
+ const e = [], r = {};
59
+ for (const t in v.value) {
60
+ const p = v.value[t];
61
+ p && (r[p] || (r[p] = []), r[p].push(t));
62
62
  }
63
- for (const t in o)
64
- o[t].length > 1 && e.push(
65
- `Field "${t}" is mapped to multiple headers: ${o[t].join(", ")}`
63
+ for (const t in r)
64
+ r[t].length > 1 && e.push(
65
+ `Field "${t}" is mapped to multiple headers: ${r[t].join(", ")}`
66
66
  );
67
- const u = s.fields.filter((t) => t.required).map((t) => t.field), i = Object.values(m.value);
67
+ const u = i.fields.filter((t) => t.required).map((t) => t.field), a = Object.values(v.value);
68
68
  for (const t of u)
69
- if (!i.includes(t)) {
70
- const p = s.fields.find((r) => r.field === t)?.title || t;
69
+ if (!a.includes(t)) {
70
+ const p = i.fields.find((s) => s.field === t)?.title || t;
71
71
  e.push(`Required field "${p}" is not mapped.`);
72
72
  }
73
73
  return e;
74
74
  }, z = () => {
75
- a.value === 2 && (y.value = G(), y.value.length > 0) || a.value < 4 && a.value++;
75
+ l.value === 2 && (x.value = G(), x.value.length > 0) || l.value < 4 && l.value++;
76
76
  }, J = () => {
77
- a.value > 1 && !v.value && a.value--;
78
- }, Q = (e, o) => e.map((u) => {
79
- const i = {};
80
- for (const t in o) {
81
- const p = o[t];
77
+ l.value > 1 && !m.value && l.value--;
78
+ }, Q = (e, r) => e.map((u) => {
79
+ const a = {};
80
+ for (const t in r) {
81
+ const p = r[t];
82
82
  if (!p) continue;
83
- let r = u[t];
84
- const g = s.fields.find((f) => f.field === p);
85
- if ((r == null || r === "") && g?.defaultValue !== void 0 && (r = g.defaultValue), g?.expectedType && (g.expectedType === "number" && (r = Number(r) || 0), g.expectedType === "boolean" && (r = !!(r && r.toString().toLowerCase() !== "false" && r !== "0"))), g?.onMatch && (r = g.onMatch(r)), p.includes(".")) {
83
+ let s = u[t];
84
+ const g = i.fields.find((f) => f.field === p);
85
+ if ((s == null || s === "") && g?.defaultValue !== void 0 && (s = g.defaultValue), g?.expectedType && (g.expectedType === "number" && (s = Number(s) || 0), g.expectedType === "boolean" && (s = !!(s && s.toString().toLowerCase() !== "false" && s !== "0"))), g?.onMatch && (s = g.onMatch(s)), p.includes(".")) {
86
86
  const f = p.split(".");
87
- let D = i;
87
+ let D = a;
88
88
  for (let k = 0; k < f.length - 1; k++)
89
89
  D[f[k]] || (D[f[k]] = {}), D = D[f[k]];
90
- D[f[f.length - 1]] = r;
90
+ D[f[f.length - 1]] = s;
91
91
  } else
92
- i[p] = r;
92
+ a[p] = s;
93
93
  }
94
- return i;
94
+ return a;
95
95
  }), W = async () => {
96
- v.value = !0, z();
96
+ m.value = !0, z();
97
97
  try {
98
- const e = Q(M.value, m.value);
99
- l.value = { ...V, total: e.length };
100
- const o = [];
101
- for (let i = 0; i < e.length; i += s.batchSize)
102
- o.push(e.slice(i, i + s.batchSize));
98
+ const e = Q(C.value, v.value);
99
+ o.value = { ...V, total: e.length };
100
+ const r = [];
101
+ for (let a = 0; a < e.length; a += i.batchSize)
102
+ r.push(e.slice(a, a + i.batchSize));
103
103
  const u = setInterval(() => {
104
- l.value.percentage < 90 && (l.value.percentage += Math.floor(Math.random() * 5) + 1);
104
+ o.value.percentage < 90 && (o.value.percentage += Math.floor(Math.random() * 5) + 1);
105
105
  }, 1e3);
106
- for (const i of o) {
107
- const t = await s.processBatch({
108
- data: i,
109
- options: q.value
106
+ for (const a of r) {
107
+ const t = await i.processBatch({
108
+ data: a,
109
+ options: q.value,
110
+ mappings: v.value
110
111
  });
111
- l.value.processed += t.processed, l.value.created += t.created, l.value.updated += t.updated, l.value.skipped += t.skipped, l.value.failed += t.failed, l.value.errors = [...l.value.errors, ...t.errors || []], l.value.percentage = Math.min(
112
+ o.value.processed += t.processed, o.value.created += t.created, o.value.updated += t.updated, o.value.skipped += t.skipped, o.value.failed += t.failed, o.value.errors = [...o.value.errors, ...t.errors || []], o.value.percentage = Math.min(
112
113
  99,
113
- Math.floor(l.value.processed / l.value.total * 100)
114
+ Math.floor(o.value.processed / o.value.total * 100)
114
115
  );
115
116
  }
116
- clearInterval(u), l.value.percentage = 100, l.value.failed === 0 ? E(c("vlite.importData.success", "Data imported successfully."), "success") : E(c("vlite.importData.partial", "Import completed with some errors."), "warning"), s.onComplete && s.onComplete();
117
+ clearInterval(u), o.value.percentage = 100, o.value.failed === 0 ? j(c("vlite.importData.success", "Data imported successfully."), "success") : j(c("vlite.importData.partial", "Import completed with some errors."), "warning"), i?.onComplete && (typeof i.onComplete == "function" ? i.onComplete() : Array.isArray(i.onComplete) && i.onComplete.forEach((a) => {
118
+ typeof a == "function" && a();
119
+ }));
117
120
  } catch (e) {
118
- console.error(e), E(c("vlite.importData.error", "A critical error occurred during import."), "error");
121
+ console.error(e), j(c("vlite.importData.error", "A critical error occurred during import."), "error");
119
122
  } finally {
120
- v.value = !1;
123
+ m.value = !1;
121
124
  }
122
- }, X = h(() => s.fields.map((e) => ({ value: e.field, label: e.title, required: e.required }))), Y = h(() => [
125
+ }, X = h(() => i.fields.map((e) => ({ value: e.field, label: e.title, required: e.required }))), Y = h(() => [
123
126
  { id: 1, title: c("vlite.importData.stepUpload", "Upload"), icon: "lucide:upload" },
124
127
  { id: 2, title: c("vlite.importData.stepMapping", "Mapping"), icon: "lucide:git-pull-request" },
125
128
  { id: 3, title: c("vlite.importData.stepOptions", "Options"), icon: "lucide:settings-2" },
126
129
  { id: 4, title: c("vlite.importData.stepImport", "Import"), icon: "lucide:loader" }
127
130
  ]), Z = h(() => c("vlite.importData.btnBack", "Back")), ee = h(() => c("vlite.importData.btnNext", "Next")), te = h(() => c("vlite.importData.btnStart", "Start Import")), ae = h(() => c("vlite.importData.btnDone", "Done")), le = (e) => {
128
- C.value = e;
129
- }, ie = (e) => {
130
- O.value = e;
131
- }, K = (e) => {
132
- m.value = e;
131
+ M.value = e;
133
132
  }, oe = (e) => {
133
+ O.value = e;
134
+ }, P = (e) => {
135
+ v.value = e;
136
+ }, ie = (e) => {
134
137
  S.value = e;
135
138
  }, re = (e) => {
136
139
  F.value = e;
137
140
  }, se = (e) => {
138
- M.value = e;
141
+ C.value = e;
139
142
  };
140
- return (e, o) => (n(), d(me, {
141
- show: P.value,
142
- "onUpdate:show": o[0] || (o[0] = (u) => P.value = u),
143
- title: A.value,
143
+ return (e, r) => (n(), d(me, {
144
+ show: A.value,
145
+ "onUpdate:show": r[0] || (r[0] = (u) => A.value = u),
146
+ title: R.value,
144
147
  "max-width": "sm:max-w-4xl",
145
148
  onClose: H,
146
- "close-outside": !v.value
149
+ "close-outside": !m.value
147
150
  }, {
148
- trigger: w(() => [
151
+ trigger: b(() => [
149
152
  ve(e.$slots, "trigger", {}, () => [
150
- x.show ? T("", !0) : (n(), d(I, {
153
+ w.show ? T("", !0) : (n(), d(I, {
151
154
  key: 0,
152
- text: x.buttonText,
153
- icon: x.buttonIcon,
155
+ text: w.buttonText,
156
+ icon: w.buttonIcon,
154
157
  variant: "outline"
155
158
  }, null, 8, ["text", "icon"]))
156
159
  ])
157
160
  ]),
158
- default: w(({ close: u }) => [
159
- B("div", xe, [
161
+ default: b(({ close: u }) => [
162
+ B("div", we, [
160
163
  ue(pe(fe), {
161
164
  steps: Y.value,
162
- "active-step": a.value - 1,
165
+ "active-step": l.value - 1,
163
166
  class: "mb-8"
164
167
  }, null, 8, ["steps", "active-step"]),
165
- B("div", ye, [
166
- a.value === 1 ? (n(), d(he, {
168
+ B("div", xe, [
169
+ l.value === 1 ? (n(), d(he, {
167
170
  key: 0,
168
- importMethod: C.value,
171
+ importMethod: M.value,
169
172
  csvFile: O.value,
170
- mappings: m.value,
171
- fields: x.fields,
173
+ mappings: v.value,
174
+ fields: w.fields,
172
175
  headers: S.value,
173
176
  preview: F.value,
174
- importData: M.value,
177
+ importData: C.value,
175
178
  "onUpdate:importMethod": le,
176
- "onUpdate:csvFile": ie,
177
- "onUpdate:mappings": K,
178
- "onUpdate:headers": oe,
179
+ "onUpdate:csvFile": oe,
180
+ "onUpdate:mappings": P,
181
+ "onUpdate:headers": ie,
179
182
  "onUpdate:preview": re,
180
183
  "onUpdate:importData": se,
181
184
  onNext: z
182
- }, null, 8, ["importMethod", "csvFile", "mappings", "fields", "headers", "preview", "importData"])) : a.value === 2 ? (n(), d(ge, {
185
+ }, null, 8, ["importMethod", "csvFile", "mappings", "fields", "headers", "preview", "importData"])) : l.value === 2 ? (n(), d(ge, {
183
186
  key: 1,
184
- mappings: m.value,
187
+ mappings: v.value,
185
188
  headers: S.value,
186
189
  preview: F.value,
187
190
  availableFields: X.value,
188
- "onUpdate:mappings": K
189
- }, null, 8, ["mappings", "headers", "preview", "availableFields"])) : a.value === 3 ? (n(), d(be, {
191
+ "onUpdate:mappings": P
192
+ }, null, 8, ["mappings", "headers", "preview", "availableFields"])) : l.value === 3 ? (n(), d(ye, {
190
193
  key: 2,
191
194
  importOptions: q.value
192
- }, null, 8, ["importOptions"])) : a.value === 4 ? (n(), d(we, {
195
+ }, null, 8, ["importOptions"])) : l.value === 4 ? (n(), d(be, {
193
196
  key: 3,
194
- progress: l.value
197
+ progress: o.value
195
198
  }, null, 8, ["progress"])) : T("", !0)
196
199
  ]),
197
- y.value.length > 0 && a.value === 2 ? (n(), N("div", De, [
200
+ x.value.length > 0 && l.value === 2 ? (n(), N("div", De, [
198
201
  B("ul", ke, [
199
- (n(!0), N(ce, null, de(y.value, (i) => (n(), N("li", { key: i }, _(i), 1))), 128))
202
+ (n(!0), N(ce, null, de(x.value, (a) => (n(), N("li", { key: a }, _(a), 1))), 128))
200
203
  ])
201
204
  ])) : T("", !0)
202
205
  ])
203
206
  ]),
204
- footer: w(({ close: u }) => [
207
+ footer: b(({ close: u }) => [
205
208
  B("div", _e, [
206
- a.value > 1 && a.value < 4 ? (n(), d(I, {
209
+ l.value > 1 && l.value < 4 ? (n(), d(I, {
207
210
  key: 0,
208
211
  variant: "outline",
209
212
  onClick: J,
210
- disabled: v.value,
213
+ disabled: m.value,
211
214
  icon: "lucide:arrow-left"
212
215
  }, {
213
- default: w(() => [
216
+ default: b(() => [
214
217
  U(_(Z.value), 1)
215
218
  ]),
216
219
  _: 1
217
220
  }, 8, ["disabled"])) : (n(), N("div", Ie)),
218
- a.value < 3 ? (n(), d(I, {
221
+ l.value < 3 ? (n(), d(I, {
219
222
  key: 2,
220
223
  variant: "primary",
221
224
  onClick: z,
222
- disabled: a.value === 1 && !C.value || v.value,
225
+ disabled: l.value === 1 && !M.value || m.value,
223
226
  "icon-right": "lucide:arrow-right"
224
227
  }, {
225
- default: w(() => [
228
+ default: b(() => [
226
229
  U(_(ee.value), 1)
227
230
  ]),
228
231
  _: 1
229
- }, 8, ["disabled"])) : a.value === 3 ? (n(), d(I, {
232
+ }, 8, ["disabled"])) : l.value === 3 ? (n(), d(I, {
230
233
  key: 3,
231
234
  variant: "primary",
232
235
  icon: "lucide:play",
233
236
  onClick: W,
234
- loading: v.value
237
+ loading: m.value
235
238
  }, {
236
- default: w(() => [
239
+ default: b(() => [
237
240
  U(_(te.value), 1)
238
241
  ]),
239
242
  _: 1
240
- }, 8, ["loading"])) : a.value === 4 && l.value.percentage >= 100 ? (n(), d(I, {
243
+ }, 8, ["loading"])) : l.value === 4 && o.value.percentage >= 100 ? (n(), d(I, {
241
244
  key: 4,
242
245
  variant: "primary",
243
246
  onClick: u
244
247
  }, {
245
- default: w(() => [
248
+ default: b(() => [
246
249
  U(_(ae.value), 1)
247
250
  ]),
248
251
  _: 1
@@ -1,11 +1,11 @@
1
- import { defineComponent as A, ref as x, computed as d, openBlock as w, createElementBlock as V, createElementVNode as r, toDisplayString as l, withModifiers as F, normalizeClass as E, createVNode as v, createCommentVNode as J, withCtx as K, createTextVNode as L } from "vue";
1
+ import { defineComponent as A, ref as b, computed as d, openBlock as w, createElementBlock as V, createElementVNode as r, toDisplayString as n, withModifiers as F, normalizeClass as E, createVNode as v, createCommentVNode as J, withCtx as K, createTextVNode as L } from "vue";
2
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";
6
6
  import { showToast as h } from "../../composables/useNotifications.js";
7
7
  import { $t as k } from "../../utils/i18n.js";
8
- import { camelCase as b } from "../../utils/functions.js";
8
+ import { camelCase as g } from "../../utils/functions.js";
9
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" }, ae = {
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"
@@ -28,14 +28,14 @@ const G = { class: "space-y-2" }, Q = { class: "font-medium text-md" }, X = { cl
28
28
  "update:importData",
29
29
  "next"
30
30
  ],
31
- setup(n, { emit: P }) {
32
- const y = n, i = P, o = (t, e, a) => {
33
- const s = a ? k(t, a) : k(t);
34
- return s !== t ? s : e;
35
- }, D = x(null), m = x(!1), c = x(""), S = (t) => {
31
+ setup(l, { emit: P }) {
32
+ const y = l, i = P, s = (t, e, a) => {
33
+ const o = a ? k(t, a) : k(t);
34
+ return o !== t ? o : e;
35
+ }, D = b(null), m = b(!1), c = b(""), S = (t) => {
36
36
  if (t.preventDefault(), m.value = !1, t.dataTransfer?.files && t.dataTransfer.files.length > 0) {
37
37
  const e = t.dataTransfer.files[0];
38
- e.type === "text/csv" || e.name.endsWith(".csv") ? _(e) : h(o("vlite.importData.csvOnly", "Please upload a CSV file"), "error");
38
+ e.type === "text/csv" || e.name.endsWith(".csv") ? _(e) : h(s("vlite.importData.csvOnly", "Please upload a CSV file"), "error");
39
39
  }
40
40
  }, _ = (t) => {
41
41
  i("update:csvFile", t), i("update:importMethod", "file");
@@ -46,10 +46,10 @@ const G = { class: "space-y-2" }, Q = { class: "font-medium text-md" }, X = { cl
46
46
  }, T = () => {
47
47
  i("update:importMethod", "paste"), c.value && C(c.value);
48
48
  }, j = (t) => {
49
- const e = b(t).replace(/\s+/g, ""), a = {};
50
- return y.fields.forEach((s) => {
51
- a[b(s.field)] = s.field, s.matchings?.forEach((u) => {
52
- a[b(u)] = s.field;
49
+ const e = g(t), a = {};
50
+ return y.fields.forEach((o) => {
51
+ a[g(o.field)] = o.field, a[g(o.title)] = o.field, o.matchings?.forEach((u) => {
52
+ a[g(u)] = o.field;
53
53
  });
54
54
  }), a[e] || "";
55
55
  }, C = (t) => {
@@ -59,18 +59,18 @@ const G = { class: "space-y-2" }, Q = { class: "font-medium text-md" }, X = { cl
59
59
  skipEmptyLines: !0,
60
60
  complete: (e) => {
61
61
  if (!e.data || e.data.length === 0) {
62
- h(o("vlite.importData.emptyCsv", "The CSV file is empty."), "warning");
62
+ h(s("vlite.importData.emptyCsv", "The CSV file is empty."), "warning");
63
63
  return;
64
64
  }
65
65
  const a = Object.keys(e.data[0]);
66
66
  i("update:headers", a);
67
- const s = e.data.map((p) => {
67
+ const o = e.data.map((p) => {
68
68
  const f = {};
69
- return Object.keys(p).forEach((g) => {
70
- f[g] = p[g] || y.fields.find((B) => B.field === g)?.defaultValue;
69
+ return Object.keys(p).forEach((x) => {
70
+ f[x] = p[x] || y.fields.find((B) => B.field === x)?.defaultValue;
71
71
  }), f;
72
72
  });
73
- i("update:importData", s), i("update:preview", e.data.slice(0, 3));
73
+ i("update:importData", o), i("update:preview", e.data.slice(0, 3));
74
74
  const u = {};
75
75
  a.forEach((p) => {
76
76
  const f = j(p);
@@ -78,25 +78,25 @@ const G = { class: "space-y-2" }, Q = { class: "font-medium text-md" }, X = { cl
78
78
  }), i("update:mappings", u), i("next");
79
79
  },
80
80
  error: (e) => h(
81
- o("vlite.importData.parseError", "Failed to parse CSV: ") + e.message,
81
+ s("vlite.importData.parseError", "Failed to parse CSV: ") + e.message,
82
82
  "error"
83
83
  )
84
84
  });
85
85
  } catch (e) {
86
- h(o("vlite.importData.processError", "Error processing CSV data"), "error"), console.error(e);
86
+ h(s("vlite.importData.processError", "Error processing CSV data"), "error"), console.error(e);
87
87
  }
88
88
  }, O = (t) => {
89
89
  const e = t.target;
90
90
  e.files && e.files.length > 0 && _(e.files[0]);
91
- }, $ = 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
91
+ }, $ = d(() => s("vlite.importData.uploadData", "Upload Data")), I = d(() => s("vlite.importData.dragDrop", "Drag & drop a file here or click to browse")), z = 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
92
  1, John Doe, john@example.com`));
93
93
  return (t, e) => (w(), V("div", G, [
94
- r("h5", Q, l($.value), 1),
94
+ r("h5", Q, n($.value), 1),
95
95
  r("div", X, [
96
96
  r("div", {
97
97
  class: E([
98
98
  "relative border-2 border-dashed rounded-xl p-8 text-center cursor-pointer transition-colors",
99
- n.importMethod === "file" ? "border-primary bg-primary/5" : "border-border hover:border-primary/50",
99
+ l.importMethod === "file" ? "border-primary bg-primary/5" : "border-border hover:border-primary/50",
100
100
  m.value ? "border-primary bg-primary/10 scale-[1.01]" : ""
101
101
  ]),
102
102
  onClick: e[0] || (e[0] = (a) => D.value?.click()),
@@ -119,15 +119,15 @@ const G = { class: "space-y-2" }, Q = { class: "font-medium text-md" }, X = { cl
119
119
  class: "w-6 h-6"
120
120
  })
121
121
  ]),
122
- r("p", ee, l(I.value), 1),
123
- r("p", te, l(z.value), 1),
124
- n.csvFile ? (w(), V("p", ae, l(n.csvFile.name) + " (" + l((n.csvFile.size / 1024).toFixed(2)) + " KB) ", 1)) : J("", !0)
122
+ r("p", ee, n(I.value), 1),
123
+ r("p", te, n(z.value), 1),
124
+ l.csvFile ? (w(), V("p", ae, n(l.csvFile.name) + " (" + n((l.csvFile.size / 1024).toFixed(2)) + " KB) ", 1)) : J("", !0)
125
125
  ])
126
126
  ], 34),
127
127
  r("div", {
128
128
  class: E([
129
129
  "border rounded-xl p-6 transition-colors",
130
- n.importMethod === "paste" ? "border-primary shadow-sm ring-1 ring-primary/20" : "border-border"
130
+ l.importMethod === "paste" ? "border-primary shadow-sm ring-1 ring-primary/20" : "border-border"
131
131
  ])
132
132
  }, [
133
133
  r("div", re, [
@@ -138,7 +138,7 @@ const G = { class: "space-y-2" }, Q = { class: "font-medium text-md" }, X = { cl
138
138
  })
139
139
  ]),
140
140
  r("div", null, [
141
- r("p", se, l(H.value), 1)
141
+ r("p", se, n(H.value), 1)
142
142
  ])
143
143
  ]),
144
144
  v(q, {
@@ -155,7 +155,7 @@ const G = { class: "space-y-2" }, Q = { class: "font-medium text-md" }, X = { cl
155
155
  disabled: !c.value
156
156
  }, {
157
157
  default: K(() => [
158
- L(l(N.value), 1)
158
+ L(n(N.value), 1)
159
159
  ]),
160
160
  _: 1
161
161
  }, 8, ["disabled"])
@@ -2,7 +2,7 @@ import { defineComponent as _, computed as o, openBlock as g, createElementBlock
2
2
  import c from "../Icon.vue.js";
3
3
  import p from "../ChoiceBox/ChoiceBox.vue.js";
4
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__ */ _({
5
+ const k = { class: "space-y-8 -mt-2" }, 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
6
  __name: "ImportStep3",
7
7
  props: {
8
8
  importOptions: {}
@@ -11,17 +11,30 @@ const k = { class: "space-y-8" }, y = { class: "font-medium text-md mb-2" }, O =
11
11
  const t = (d, i) => {
12
12
  const s = b(d);
13
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(() => [
14
+ }, m = o(() => t("vlite.importData.options", "Import Options")), u = o(() => t("vlite.importData.matchFound", "When a match is found")), h = o(
15
+ () => t(
16
+ "vlite.importData.matchFoundDesc",
17
+ "Determine how to handle records that already exist in the system."
18
+ )
19
+ ), v = o(() => t("vlite.importData.noMatch", "When no match is found")), x = o(
20
+ () => t("vlite.importData.noMatchDesc", "Determine how to handle completely new records.")
21
+ ), f = o(() => [
15
22
  {
16
23
  id: "add",
17
24
  title: t("vlite.importData.optAddTitle", "Add New"),
18
- description: t("vlite.importData.optAddDesc", "Creates a duplicate record instead of overwriting."),
25
+ description: t(
26
+ "vlite.importData.optAddDesc",
27
+ "Creates a duplicate record instead of overwriting."
28
+ ),
19
29
  icon: "lucide:plus-circle"
20
30
  },
21
31
  {
22
32
  id: "replace",
23
33
  title: t("vlite.importData.optReplaceTitle", "Update"),
24
- description: t("vlite.importData.optReplaceDesc", "Overwrites existing fields with the imported data."),
34
+ description: t(
35
+ "vlite.importData.optReplaceDesc",
36
+ "Overwrites existing fields with the imported data."
37
+ ),
25
38
  icon: "lucide:refresh-cw"
26
39
  },
27
40
  {
@@ -34,13 +47,19 @@ const k = { class: "space-y-8" }, y = { class: "font-medium text-md mb-2" }, O =
34
47
  {
35
48
  id: "create",
36
49
  title: t("vlite.importData.optCreateTitle", "Create New"),
37
- description: t("vlite.importData.optCreateDesc", "Creates a completely new record in the system."),
50
+ description: t(
51
+ "vlite.importData.optCreateDesc",
52
+ "Creates a completely new record in the system."
53
+ ),
38
54
  icon: "lucide:check-circle-2"
39
55
  },
40
56
  {
41
57
  id: "skip",
42
58
  title: t("vlite.importData.optSkipNewTitle", "Skip"),
43
- description: t("vlite.importData.optSkipNewDesc", "Ignores the row if it does not already exist."),
59
+ description: t(
60
+ "vlite.importData.optSkipNewDesc",
61
+ "Ignores the row if it does not already exist."
62
+ ),
44
63
  icon: "lucide:ban"
45
64
  }
46
65
  ]);
@@ -27,6 +27,7 @@ export interface ImportOptions {
27
27
  export interface ImportBatchPayload {
28
28
  data: any[];
29
29
  options: ImportOptions;
30
+ mappings?: Record<string, string>;
30
31
  }
31
32
  export interface ImportBatchResult {
32
33
  processed: number;
@@ -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: {
@@ -14,7 +14,7 @@ import "v-datepicker-lite";
14
14
  import "v-datepicker-lite/style.css";
15
15
  import "@jaames/iro";
16
16
  import "@vueuse/core";
17
- /* empty css */
17
+ /* empty css */
18
18
  import "iconify-icon-picker";
19
19
  import "iconify-icon-picker/style.css";
20
20
  /* empty css */
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.3.8",
6
+ "version": "1.3.10",
7
7
  "type": "module",
8
8
  "main": "index.js",
9
9
  "module": "index.js",
package/style.css CHANGED
@@ -17,6 +17,7 @@
17
17
  --color-border: '';
18
18
  --color-input: '';
19
19
  --color-card: '';
20
+ --color-card-light: '';
20
21
  --color-secondary: '';
21
22
  --color-secondary-foreground: '';
22
23
  --color-muted: '';
@@ -651,12 +652,16 @@
651
652
  .dark .bg-card-light {
652
653
  --color-body: #121212 !important;
653
654
  --color-white: #121212 !important;
655
+ --color-mixture-1: #1b1b1b !important;
656
+ --color-mixture-2: #ffffff !important;
654
657
  background-color: #121212 !important;
655
658
  }
656
659
 
657
660
  .dark .bg-card .bg-card-light {
658
661
  --color-body: #1a1a1a !important;
659
662
  --color-white: #1a1a1a !important;
663
+ --color-mixture-1: #232323 !important;
664
+ --color-mixture-2: #000000;
660
665
  background-color: #1a1a1a !important;
661
666
  }
662
667
 
@@ -34,7 +34,11 @@ function h(t) {
34
34
  Object?.values(r)?.flatMap?.((n) => typeof n == "object" ? h([n]) : [n])
35
35
  ) : e.concat(r), []);
36
36
  }
37
- const F = (t) => typeof t == "string" ? t?.replace(/(^\w|[.!?]\s+\w)/g, (e) => e.toUpperCase()) : t, N = (t) => !t || typeof t != "string" ? "" : t[0].toLowerCase() + t.slice(1);
37
+ const F = (t) => typeof t == "string" ? t?.replace(/(^\w|[.!?]\s+\w)/g, (e) => e.toUpperCase()) : t, N = (t) => {
38
+ if (!t || typeof t != "string") return "";
39
+ const e = t.replace(/\s+/g, "");
40
+ return e[0]?.toLowerCase() + e.slice(1);
41
+ };
38
42
  function D(t, e) {
39
43
  let r = null, n = null, o = null;
40
44
  const s = () => {
@@ -137,10 +141,10 @@ const E = (t, e = {}) => {
137
141
  const n = m?.components?.datetime?.format || "MMM DD, YYYY", o = t ? c(t).format(n) : "";
138
142
  let s = e;
139
143
  if (e) {
140
- const [i, d] = e.split(":");
141
- if (i && d) {
142
- const l = c().hour(Number(i)).minute(Number(d));
143
- l.isValid() && (s = l.format("hh:mm"));
144
+ const [i, l] = e.split(":");
145
+ if (i && l) {
146
+ const d = c().hour(Number(i)).minute(Number(l));
147
+ d.isValid() && (s = d.format("hh:mm"));
144
148
  }
145
149
  }
146
150
  let a = r;