vlite3 0.7.3 → 0.7.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.
@@ -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
  };
@@ -5,8 +5,8 @@ import O from "../Input.vue.js";
5
5
  /* empty css */
6
6
  import "../../core/config.js";
7
7
  import y from "../Button.vue.js";
8
- import E from "./ColorIro.vue.js";
9
- /* empty css */
8
+ import E from "./ColorIro.vue2.js";
9
+ /* empty css */
10
10
  import { useEyeDropper as P } from "@vueuse/core";
11
11
  const I = {
12
12
  key: 0,
@@ -1,10 +1,10 @@
1
- import { defineComponent as Pe, provide as q, useSlots as Ie, computed as i, ref as x, watch as z, resolveComponent as $e, openBlock as l, createElementBlock as s, normalizeClass as A, createElementVNode as y, renderSlot as p, toDisplayString as f, createBlock as c, withCtx as d, createVNode as u, createCommentVNode as m, unref as w, resolveDynamicComponent as H, Fragment as I, mergeProps as g, createTextVNode as B, renderList as Se } from "vue";
1
+ import { defineComponent as Pe, provide as z, useSlots as Ie, computed as i, ref as x, watch as H, resolveComponent as $e, openBlock as l, createElementBlock as s, normalizeClass as N, createElementVNode as y, renderSlot as p, toDisplayString as f, createBlock as c, withCtx as d, createVNode as u, createCommentVNode as m, unref as w, resolveDynamicComponent as K, Fragment as I, mergeProps as g, createTextVNode as B, renderList as Se } from "vue";
2
2
  import Te from "../Input.vue.js";
3
3
  /* empty css */
4
4
  import h from "../Button.vue.js";
5
- import N from "../Icon.vue.js";
5
+ import F from "../Icon.vue.js";
6
6
  import Ve from "../Tooltip.vue.js";
7
- import K from "../Modal.vue.js";
7
+ import J from "../Modal.vue.js";
8
8
  import Re from "../ConfirmationModal.vue.js";
9
9
  import Ee from "../Pagination/Pagination.vue.js";
10
10
  import Oe from "../Empty/Empty.vue.js";
@@ -81,60 +81,60 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
81
81
  headerClass: {}
82
82
  },
83
83
  emits: ["add", "delete"],
84
- setup(t, { emit: _ }) {
85
- const a = t, $ = Me(), J = _;
86
- q(Ue, {
84
+ setup(t, { emit: ee }) {
85
+ const a = t, $ = Me(), Q = ee;
86
+ z(Ue, {
87
87
  disableSearch: !0,
88
88
  forceSelectable: !0
89
89
  });
90
- const ee = Ie(), te = i(() => a.name || a.title || "default-screen"), k = Le(
90
+ const V = Ie(), te = i(() => a.name || a.title || "default-screen"), k = Le(
91
91
  `view-mode-${te.value}`,
92
- a.table || ee.table ? "table" : "list"
93
- ), S = x(""), V = x({}), C = x(a.pageInfo?.currentPage || 1), R = x(a.pageInfo?.itemsPerPage || a.paginationProps?.itemsPerPage || 10), v = x([]), E = x([]), T = x(!1);
94
- q("screen-selected-rows", v), q("screen-request-delete", (e) => D(e));
92
+ a.table || V.table ? "table" : "list"
93
+ ), S = x(""), R = x({}), C = x(a.pageInfo?.currentPage || 1), E = x(a.pageInfo?.itemsPerPage || a.paginationProps?.itemsPerPage || 10), v = x([]), O = x([]), T = x(!1);
94
+ z("screen-selected-rows", v), z("screen-request-delete", (e) => D(e));
95
95
  const D = (e) => {
96
- E.value = e, T.value = !0;
96
+ O.value = e, T.value = !0;
97
97
  }, ae = () => {
98
- J("delete", E.value), T.value = !1, v.value = [];
98
+ Q("delete", O.value), T.value = !1, v.value = [];
99
99
  }, le = (e) => {
100
- J("delete", e), v.value = [];
100
+ Q("delete", e), v.value = [];
101
101
  };
102
- z(
102
+ H(
103
103
  () => a.pageInfo?.currentPage,
104
104
  (e) => {
105
105
  e && (C.value = e);
106
106
  }
107
- ), z(
107
+ ), H(
108
108
  () => a.pageInfo?.itemsPerPage,
109
109
  (e) => {
110
- e && (R.value = e);
110
+ e && (E.value = e);
111
111
  }
112
112
  );
113
- let F = null;
114
- z(S, () => {
115
- F && clearTimeout(F), F = setTimeout(() => {
113
+ let L = null;
114
+ H(S, () => {
115
+ L && clearTimeout(L), L = setTimeout(() => {
116
116
  C.value = 1, P();
117
117
  }, 300);
118
118
  });
119
119
  const ne = (e) => {
120
120
  C.value = e, P();
121
121
  }, oe = (e) => {
122
- R.value = e, C.value = 1, P();
122
+ E.value = e, C.value = 1, P();
123
123
  }, P = () => {
124
124
  const e = {
125
125
  pageinfo: {
126
126
  page: C.value,
127
- limit: R.value
127
+ limit: E.value
128
128
  },
129
129
  pagination: {
130
130
  page: C.value,
131
- limit: R.value
131
+ limit: E.value
132
132
  },
133
133
  search: S.value,
134
- filter: V.value
134
+ filter: R.value
135
135
  };
136
136
  a.refetch && a.refetch(e);
137
- }, Q = i(() => k.value === "table" && a.table ? a.table : a.list), ie = i(() => a.data && a.data.length > 0), X = i(() => a.titleI18n ? r(a.titleI18n) : a.title), Y = i(
137
+ }, X = i(() => k.value === "table" ? a.table || !!V.table : a.list || !!V.list || !!V.grid), ie = i(() => a.data && a.data.length > 0), Y = i(() => a.titleI18n ? r(a.titleI18n) : a.title), G = i(
138
138
  () => a.descriptionI18n ? r(a.descriptionI18n) : a.description
139
139
  ), re = i(() => {
140
140
  const e = r("vlite.screen.deleteSelected");
@@ -155,8 +155,8 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
155
155
  const e = r("vlite.screen.confirmDeleteTitle");
156
156
  return e !== "vlite.screen.confirmDeleteTitle" ? e : "Confirm Deletion";
157
157
  }), fe = i(() => {
158
- const e = r("vlite.screen.confirmDeleteDesc", { count: E.value.length });
159
- return e !== "vlite.screen.confirmDeleteDesc" ? e : `Are you sure you want to delete the selected ${E.value.length > 1 ? "items" : "item"}?`;
158
+ const e = r("vlite.screen.confirmDeleteDesc", { count: O.value.length });
159
+ return e !== "vlite.screen.confirmDeleteDesc" ? e : `Are you sure you want to delete the selected ${O.value.length > 1 ? "items" : "item"}?`;
160
160
  }), ve = i(() => {
161
161
  const e = r("vlite.screen.confirmDeleteBtn");
162
162
  return e !== "vlite.screen.confirmDeleteBtn" ? e : "Delete";
@@ -171,20 +171,20 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
171
171
  if (a.addBtn?.label) return a.addBtn.label;
172
172
  const e = r("vlite.screen.addNew");
173
173
  return e !== "vlite.screen.addNew" ? e : "Add New";
174
- }), G = i(() => {
174
+ }), W = i(() => {
175
175
  const e = a.exportSchema && a.exportSchema.length > 0 && a.exportProps !== !1, n = a.importSchema && a.importSchema.length > 0 && a.importProps !== !1;
176
176
  return e || n;
177
- }), L = i(() => {
177
+ }), M = i(() => {
178
178
  const e = r("vlite.screen.exportData");
179
179
  return e !== "vlite.screen.exportData" ? e : "Export Data";
180
- }), W = i(() => {
180
+ }), Z = i(() => {
181
181
  const e = r("vlite.screen.importData");
182
182
  return e !== "vlite.screen.importData" ? e : "Import Data";
183
183
  }), ye = i(() => {
184
184
  const e = [];
185
- return a.exportProps !== !1 && e.push({ value: "export", label: L.value, icon: "lucide:download" }), a.importProps !== !1 && e.push({ value: "import", label: W.value, icon: "lucide:upload" }), e;
186
- }), M = x(null), xe = x(null), O = x(!1), U = x(!1), pe = (e) => {
187
- e.value === "export" ? O.value = !0 : e.value === "import" && (U.value = !0);
185
+ return a.exportProps !== !1 && e.push({ value: "export", label: M.value, icon: "lucide:download" }), a.importProps !== !1 && e.push({ value: "import", label: Z.value, icon: "lucide:upload" }), e;
186
+ }), U = x(null), xe = x(null), j = x(!1), q = x(!1), pe = (e) => {
187
+ e.value === "export" ? j.value = !0 : e.value === "import" && (q.value = !0);
188
188
  }, we = i(() => a.exportSchema ? a.exportSchema.map((e) => ({
189
189
  field: e.name || e.field,
190
190
  title: e.label || e.title || e.name || e.field
@@ -208,7 +208,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
208
208
  const n = {
209
209
  format: e,
210
210
  search: S.value,
211
- filter: V.value
211
+ filter: R.value
212
212
  };
213
213
  await $.services.exportApi(a.exportType, n);
214
214
  } else
@@ -217,16 +217,16 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
217
217
  );
218
218
  };
219
219
  return (e, n) => {
220
- const Z = $e("router-link");
220
+ const _ = $e("router-link");
221
221
  return l(), s("div", qe, [
222
222
  t.customHeader ? p(e.$slots, "custom-header", { key: 1 }) : (l(), s("div", {
223
223
  key: 0,
224
- class: A([t.headerClass, "flex flex-col md:flex-row sm:items-start md:items-center justify-between gap-4"])
224
+ class: N([t.headerClass, "flex flex-col md:flex-row sm:items-start md:items-center justify-between gap-4"])
225
225
  }, [
226
226
  y("div", ze, [
227
227
  p(e.$slots, "title", {}, () => [
228
- X.value ? (l(), s("div", He, [
229
- y("h1", Ke, f(X.value), 1),
228
+ Y.value ? (l(), s("div", He, [
229
+ y("h1", Ke, f(Y.value), 1),
230
230
  t.info || t.infoI18n ? (l(), c(Ve, {
231
231
  key: 0,
232
232
  content: t.info,
@@ -234,7 +234,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
234
234
  placement: "right"
235
235
  }, {
236
236
  default: d(() => [
237
- u(N, {
237
+ u(F, {
238
238
  icon: "lucide:info",
239
239
  class: "w-[18px] h-[18px] mt-3! text-muted-foreground hover:text-foreground cursor-pointer transition-colors outline-none"
240
240
  })
@@ -244,7 +244,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
244
244
  ])) : m("", !0)
245
245
  ]),
246
246
  p(e.$slots, "description", {}, () => [
247
- Y.value ? (l(), s("p", Je, f(Y.value), 1)) : m("", !0)
247
+ G.value ? (l(), s("p", Je, f(G.value), 1)) : m("", !0)
248
248
  ])
249
249
  ]),
250
250
  y("div", Qe, [
@@ -260,24 +260,24 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
260
260
  (t.table || e.$slots.table) && (t.list || e.$slots.list || e.$slots.grid) ? (l(), s("div", Ye, [
261
261
  y("button", {
262
262
  onClick: n[1] || (n[1] = (o) => k.value = "list"),
263
- class: A(["p-1.5 rounded", [
263
+ class: N(["p-1.5 rounded", [
264
264
  w(k) === "list" ? "bg-secondary/85 dark:bg-secondary shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
265
265
  ]]),
266
266
  title: de.value
267
267
  }, [
268
- u(N, {
268
+ u(F, {
269
269
  icon: "lucide:layout-grid",
270
270
  class: "w-4 h-4"
271
271
  })
272
272
  ], 10, Ge),
273
273
  y("button", {
274
274
  onClick: n[2] || (n[2] = (o) => k.value = "table"),
275
- class: A(["p-1.5 rounded", [
275
+ class: N(["p-1.5 rounded", [
276
276
  w(k) === "table" ? "bg-secondary/85 dark:bg-secondary shadow-sm text-foreground" : "text-muted-foreground hover:text-foreground"
277
277
  ]]),
278
278
  title: se.value
279
279
  }, [
280
- u(N, {
280
+ u(F, {
281
281
  icon: "lucide:list",
282
282
  class: "w-4 h-4"
283
283
  })
@@ -298,8 +298,8 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
298
298
  key: 3,
299
299
  schema: t.filterSchema,
300
300
  type: t.filterType,
301
- modelValue: V.value,
302
- "onUpdate:modelValue": n[3] || (n[3] = (o) => V.value = o),
301
+ modelValue: R.value,
302
+ "onUpdate:modelValue": n[3] || (n[3] = (o) => R.value = o),
303
303
  onChange: P
304
304
  }, null, 8, ["schema", "type", "modelValue"])) : m("", !0),
305
305
  t.canSearch ? (l(), s("div", Ze, [
@@ -317,9 +317,9 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
317
317
  ]),
318
318
  y("div", _e, [
319
319
  p(e.$slots, "actions", {}, () => [
320
- t.addComponent ? (l(), c(H(t.addComponent), { key: 0 })) : t.canAdd ? (l(), s(I, { key: 1 }, [
320
+ t.addComponent ? (l(), c(K(t.addComponent), { key: 0 })) : t.canAdd ? (l(), s(I, { key: 1 }, [
321
321
  t.addBtn ? (l(), s(I, { key: 0 }, [
322
- t.addBtn.modal ? (l(), c(K, g({
322
+ t.addBtn.modal ? (l(), c(J, g({
323
323
  key: 0,
324
324
  body: t.addBtn.modal
325
325
  }, t.addBtn.modalProps, {
@@ -341,7 +341,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
341
341
  }, 16, ["icon", "variant"])
342
342
  ]),
343
343
  _: 1
344
- }, 16, ["body", "refetch", "data", "loading"])) : t.addBtn.to ? (l(), c(Z, {
344
+ }, 16, ["body", "refetch", "data", "loading"])) : t.addBtn.to ? (l(), c(_, {
345
345
  key: 1,
346
346
  to: t.addBtn.to,
347
347
  class: "inline-flex w-full sm:w-auto"
@@ -391,7 +391,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
391
391
  ], 64)) : m("", !0)
392
392
  ], 64)) : m("", !0)
393
393
  ]),
394
- G.value ? (l(), c(Ae, {
394
+ W.value ? (l(), c(Ae, {
395
395
  key: 0,
396
396
  closeOnSelect: "",
397
397
  position: "bottom-end",
@@ -414,7 +414,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
414
414
  ], 2)),
415
415
  p(e.$slots, "sub-header"),
416
416
  y("div", {
417
- class: A(["flex-1 w-full relative", t.containerClass])
417
+ class: N(["flex-1 w-full relative", t.containerClass])
418
418
  }, [
419
419
  !ie.value && !t.loading ? p(e.$slots, "empty", { key: 0 }, () => [
420
420
  u(w(Oe), {
@@ -425,9 +425,9 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
425
425
  icon: t.emptyIcon
426
426
  }, {
427
427
  action: d(() => [
428
- t.addComponent ? (l(), c(H(t.addComponent), { key: 0 })) : t.canAdd ? (l(), s(I, { key: 1 }, [
428
+ t.addComponent ? (l(), c(K(t.addComponent), { key: 0 })) : t.canAdd ? (l(), s(I, { key: 1 }, [
429
429
  t.addBtn ? (l(), s(I, { key: 0 }, [
430
- t.addBtn.modal ? (l(), c(K, g({
430
+ t.addBtn.modal ? (l(), c(J, g({
431
431
  key: 0,
432
432
  body: t.addBtn.modal
433
433
  }, t.addBtn.modalProps), {
@@ -445,7 +445,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
445
445
  }, 16, ["icon", "variant"])
446
446
  ]),
447
447
  _: 1
448
- }, 16, ["body"])) : t.addBtn.to ? (l(), c(Z, {
448
+ }, 16, ["body"])) : t.addBtn.to ? (l(), c(_, {
449
449
  key: 1,
450
450
  to: t.addBtn.to,
451
451
  class: "inline-flex"
@@ -526,7 +526,7 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
526
526
  selectedRows: v.value,
527
527
  delete: D,
528
528
  updateSelectedRows: (o) => v.value = o
529
- }) : Q.value ? (l(), c(H(Q.value), {
529
+ }) : X.value ? (l(), c(K(X.value), {
530
530
  key: 3,
531
531
  data: t.data,
532
532
  loading: t.loading,
@@ -559,44 +559,44 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
559
559
  onConfirm: ae,
560
560
  onCancel: n[10] || (n[10] = (o) => T.value = !1)
561
561
  }, null, 8, ["show", "title", "description", "confirm-text", "cancel-text"]),
562
- O.value ? (l(), c(K, {
562
+ j.value ? (l(), c(J, {
563
563
  key: 3,
564
- show: O.value,
565
- "onUpdate:show": n[11] || (n[11] = (o) => O.value = o),
566
- title: L.value,
564
+ show: j.value,
565
+ "onUpdate:show": n[11] || (n[11] = (o) => j.value = o),
566
+ title: M.value,
567
567
  "max-width": "sm:max-w-[400px]"
568
568
  }, {
569
569
  default: d(({ close: o }) => [
570
570
  u(Ne, g({
571
571
  ref_key: "exportDataRef",
572
- ref: M,
572
+ ref: U,
573
573
  data: t.data || [],
574
574
  fields: we.value,
575
575
  mode: Ce.value,
576
576
  "on-export": De
577
577
  }, typeof t.exportProps == "object" ? t.exportProps : {}, {
578
- title: L.value,
578
+ title: M.value,
579
579
  class: "hidden!"
580
580
  }), null, 16, ["data", "fields", "mode", "title"]),
581
581
  y("div", nt, [
582
582
  y("h6", ot, f(w(r)("vlite.exportData.selectFormat") !== "vlite.exportData.selectFormat" ? w(r)("vlite.exportData.selectFormat") : "Select Export Format"), 1),
583
583
  y("div", it, [
584
- (l(!0), s(I, null, Se(M.value?.availableFormats || [
584
+ (l(!0), s(I, null, Se(U.value?.availableFormats || [
585
585
  { value: "excel", label: "Excel (.xlsx)", icon: "lucide:file-spreadsheet" },
586
586
  { value: "csv", label: "CSV (.csv)", icon: "lucide:file-text" },
587
587
  { value: "json", label: "JSON (.json)", icon: "lucide:file-json" }
588
- ], (j) => (l(), c(h, {
589
- key: j.value,
588
+ ], (A) => (l(), c(h, {
589
+ key: A.value,
590
590
  variant: "outline",
591
591
  class: "w-full flex items-center justify-start gap-3 h-12",
592
- onClick: (st) => M.value?.exportData(j.value, o)
592
+ onClick: (st) => U.value?.exportData(A.value, o)
593
593
  }, {
594
594
  default: d(() => [
595
- u(N, {
596
- icon: j.icon,
595
+ u(F, {
596
+ icon: A.icon,
597
597
  class: "text-muted-foreground h-5 w-5"
598
598
  }, null, 8, ["icon"]),
599
- y("span", null, f(j.label), 1)
599
+ y("span", null, f(A.label), 1)
600
600
  ]),
601
601
  _: 2
602
602
  }, 1032, ["onClick"]))), 128))
@@ -605,17 +605,17 @@ const qe = { class: "flex flex-col w-full space-y-8" }, ze = { class: "flex flex
605
605
  ]),
606
606
  _: 1
607
607
  }, 8, ["show", "title"])) : m("", !0),
608
- G.value ? (l(), s("div", rt, [
608
+ W.value ? (l(), s("div", rt, [
609
609
  u(Fe, g({
610
- show: U.value,
611
- "onUpdate:show": n[12] || (n[12] = (o) => U.value = o),
610
+ show: q.value,
611
+ "onUpdate:show": n[12] || (n[12] = (o) => q.value = o),
612
612
  ref_key: "importDataRef",
613
613
  ref: xe,
614
614
  fields: be.value,
615
615
  processBatch: Be,
616
616
  onComplete: ke
617
617
  }, typeof t.importProps == "object" ? t.importProps : {}, {
618
- title: W.value,
618
+ title: Z.value,
619
619
  class: "hidden!"
620
620
  }), null, 16, ["show", "fields", "title"])
621
621
  ])) : m("", !0)
@@ -11,7 +11,7 @@ import "v-datepicker-lite";
11
11
  import "v-datepicker-lite/style.css";
12
12
  import "@jaames/iro";
13
13
  import "@vueuse/core";
14
- /* empty css */
14
+ /* empty css */
15
15
  import "iconify-icon-picker";
16
16
  import "iconify-icon-picker/style.css";
17
17
  /* 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": "0.7.3",
6
+ "version": "0.7.4",
7
7
  "type": "module",
8
8
  "main": "index.js",
9
9
  "module": "index.js",