vlite3 1.0.10 → 1.1.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.
Files changed (113) hide show
  1. package/README.md +4 -1
  2. package/components/AttachmentsList/AttachmentsList.vue.d.ts +1 -16
  3. package/components/AttachmentsList/AttachmentsList.vue.js +191 -167
  4. package/components/AvatarGroup/AvatarGroup.vue.d.ts +24 -0
  5. package/components/AvatarGroup/AvatarGroup.vue.js +91 -0
  6. package/components/AvatarGroup/AvatarGroup.vue2.js +4 -0
  7. package/components/AvatarGroup/index.d.ts +2 -0
  8. package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
  9. package/components/Barcode/Barcode.vue.js +6 -5
  10. package/components/Button.vue.d.ts +1 -1
  11. package/components/Calendar/Calendar.vue.d.ts +229 -0
  12. package/components/Calendar/Calendar.vue.js +7 -0
  13. package/components/Calendar/Calendar.vue2.js +186 -0
  14. package/components/Calendar/CalendarEventItem.vue.d.ts +17 -0
  15. package/components/Calendar/CalendarEventItem.vue.js +111 -0
  16. package/components/Calendar/CalendarEventItem.vue2.js +4 -0
  17. package/components/Calendar/index.d.ts +2 -0
  18. package/components/Carousel/Carousel.vue.d.ts +2 -2
  19. package/components/CategoryManager/CategoryManager.vue.d.ts +2 -1
  20. package/components/CategoryManager/CategoryManager.vue.js +322 -0
  21. package/components/CategoryManager/CategoryManager.vue2.js +4 -0
  22. package/components/CategoryManager/CategoryNode.vue.js +224 -0
  23. package/components/CategoryManager/CategoryNode.vue2.js +4 -0
  24. package/components/CategoryManager/types.d.ts +14 -0
  25. package/components/Chip/Chip.vue.d.ts +2 -2
  26. package/components/ColorPicker/ColorIro.vue3.js +2 -2
  27. package/components/ColorPicker/ColorPicker.vue.js +2 -2
  28. package/components/CommandPalette/CommandPaletteContent.vue.js +1 -1
  29. package/components/CommandPalette/CommandPaletteContent.vue2.js +7 -7
  30. package/components/CommandPalette/{CommandPaletteItem.vue2.js → CommandPaletteItem.vue.js} +1 -1
  31. package/components/ConfirmationModal.vue.d.ts +2 -2
  32. package/components/CustomFieldsDisplay/CustomFieldsDisplay.vue.d.ts +48 -0
  33. package/components/CustomFieldsDisplay/CustomFieldsDisplay.vue.js +97 -0
  34. package/components/CustomFieldsDisplay/CustomFieldsDisplay.vue2.js +4 -0
  35. package/components/CustomFieldsDisplay/index.d.ts +2 -0
  36. package/components/CustomFieldsDisplay/types.d.ts +18 -0
  37. package/components/DataTable/DataTable.vue.d.ts +3 -3
  38. package/components/DateTime/DateTime.vue.d.ts +2 -0
  39. package/components/DateTime/DateTime.vue.js +9 -23
  40. package/components/Dropdown/Dropdown.vue.d.ts +3 -3
  41. package/components/Dropdown/DropdownGroupedLayout.vue.d.ts +1 -1
  42. package/components/Dropdown/DropdownMenu.vue.d.ts +2 -2
  43. package/components/Dropdown/DropdownTrigger.vue.d.ts +1 -1
  44. package/components/FilePicker/FilePicker.vue.d.ts +1 -1
  45. package/components/Form/CustomFields.vue.d.ts +1 -1
  46. package/components/Form/Form.vue.js +2 -2
  47. package/components/Form/Form.vue2.js +230 -241
  48. package/components/Form/FormField.vue.d.ts +1 -1
  49. package/components/Form/composables/useForm.d.ts +2 -0
  50. package/components/Form/composables/useForm.js +76 -69
  51. package/components/Form/utils/form.utils.js +66 -66
  52. package/components/ImportData/ImportData.vue.js +48 -48
  53. package/components/ImportData/ImportStep2.vue.js +116 -5
  54. package/components/ImportData/ImportStep2.vue2.js +2 -105
  55. package/components/Input.vue.d.ts +3 -3
  56. package/components/Invoice/Invoice.vue.d.ts +3 -0
  57. package/components/Invoice/Invoice.vue.js +38 -0
  58. package/components/Invoice/Invoice.vue2.js +4 -0
  59. package/components/Invoice/InvoiceVariant1.vue.d.ts +13 -0
  60. package/components/Invoice/InvoiceVariant1.vue.js +360 -0
  61. package/components/Invoice/InvoiceVariant1.vue2.js +4 -0
  62. package/components/Invoice/InvoiceVariant2.vue.d.ts +13 -0
  63. package/components/Invoice/InvoiceVariant2.vue.js +226 -0
  64. package/components/Invoice/InvoiceVariant2.vue2.js +4 -0
  65. package/components/Invoice/InvoiceVariant3.vue.d.ts +13 -0
  66. package/components/Invoice/InvoiceVariant3.vue.js +292 -0
  67. package/components/Invoice/InvoiceVariant3.vue2.js +4 -0
  68. package/components/Invoice/InvoiceVariant4.vue.d.ts +13 -0
  69. package/components/Invoice/InvoiceVariant4.vue.js +343 -0
  70. package/components/Invoice/InvoiceVariant4.vue2.js +4 -0
  71. package/components/Invoice/index.d.ts +2 -0
  72. package/components/Invoice/types.d.ts +97 -0
  73. package/components/List/List.vue.d.ts +1 -9
  74. package/components/List/List.vue.js +166 -165
  75. package/components/List/ListFieldRow.vue.d.ts +10 -2
  76. package/components/List/ListFieldRow.vue.js +80 -78
  77. package/components/List/utils.d.ts +2 -1
  78. package/components/List/utils.js +8 -39
  79. package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
  80. package/components/Navbar/NavbarItem.vue.d.ts +1 -1
  81. package/components/Navbar/NavbarTabs.vue.js +2 -2
  82. package/components/NavbarCommandPalette.vue.js +1 -1
  83. package/components/NumberInput.vue.d.ts +2 -2
  84. package/components/NumberInput.vue.js +2 -2
  85. package/components/NumberInput.vue2.js +38 -38
  86. package/components/OTPInput/OTPInput.vue.d.ts +1 -1
  87. package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
  88. package/components/Screen/ScreenFilter.vue.js +22 -21
  89. package/components/Screen/components/ScreenQuickFilters.vue.js +6 -5
  90. package/components/SidebarMenu/SidebarMenu.vue.d.ts +1 -1
  91. package/components/Stats/Stats.vue.d.ts +1 -1
  92. package/components/StatusChip/status-map.js +27 -7
  93. package/components/Tabes/Tabes.vue.d.ts +1 -0
  94. package/components/Tabes/Tabes.vue.js +2 -2
  95. package/components/Tabes/Tabes.vue2.js +33 -32
  96. package/components/ThumbnailSelector/ThumbnailSelector.vue.d.ts +2 -2
  97. package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
  98. package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +141 -115
  99. package/components/Workbook/Workbook.vue.d.ts +3 -3
  100. package/core/config.d.ts +76 -0
  101. package/core/index.js +17 -5
  102. package/index.d.ts +6 -1
  103. package/index.js +271 -256
  104. package/package.json +2 -1
  105. package/style.css +5 -3
  106. package/types/config.type.d.ts +6 -0
  107. package/types/list.type.d.ts +6 -0
  108. package/utils/configUtils.d.ts +9 -0
  109. package/utils/configUtils.js +7 -0
  110. package/utils/index.d.ts +1 -0
  111. package/utils/status.d.ts +5 -0
  112. package/utils/status.js +33 -0
  113. /package/components/ColorPicker/{ColorIro.vue.js → ColorIro.vue2.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { defineComponent as E, ref as b, watch as l, onMounted as D, computed as g, openBlock as i, createElementBlock as p, normalizeClass as u, normalizeStyle as N, createCommentVNode as y, Fragment as O, renderList as P, createBlock as x, resolveDynamicComponent as T, mergeProps as F, withCtx as _, createElementVNode as q, toDisplayString as G, nextTick as H } from "vue";
1
+ import { defineComponent as E, ref as m, watch as l, onMounted as D, computed as g, openBlock as i, createElementBlock as p, normalizeClass as u, normalizeStyle as N, createCommentVNode as y, Fragment as O, renderList as P, createBlock as x, resolveDynamicComponent as T, mergeProps as F, withCtx as _, createElementVNode as q, toDisplayString as G, nextTick as H } from "vue";
2
2
  import { useResizeObserver as J } from "@vueuse/core";
3
3
  import K from "../Icon.vue.js";
4
4
  import { $t as Q } from "../../utils/i18n.js";
@@ -11,37 +11,38 @@ const Z = /* @__PURE__ */ E({
11
11
  variant: { default: "surface" },
12
12
  block: { type: Boolean, default: !1 },
13
13
  textClass: {},
14
- wrap: { type: Boolean, default: !1 }
14
+ wrap: { type: Boolean, default: !1 },
15
+ tabClass: {}
15
16
  },
16
17
  emits: ["update:modelValue", "change"],
17
18
  setup(s, { emit: h }) {
18
- const a = s, v = h, d = b(null), f = b(/* @__PURE__ */ new Map()), k = (e, n) => {
19
+ const r = s, v = h, d = m(null), f = m(/* @__PURE__ */ new Map()), k = (e, n) => {
19
20
  e ? f.value.set(n, e) : f.value.delete(n);
20
- }, m = b({
21
+ }, b = m({
21
22
  width: "0px",
22
23
  height: "0px",
23
24
  transform: "translate(0px, 0px)",
24
25
  opacity: 0
25
26
  }), o = async () => {
26
27
  await H();
27
- const e = d.value, n = f.value.get(a.modelValue);
28
+ const e = d.value, n = f.value.get(r.modelValue);
28
29
  if (!e || !n) {
29
- m.value.opacity = 0;
30
+ b.value.opacity = 0;
30
31
  return;
31
32
  }
32
- const t = e.getBoundingClientRect(), r = n.getBoundingClientRect(), c = r.left - t.left, M = r.top - t.top, j = r.width, A = r.height;
33
- m.value = {
33
+ const t = e.getBoundingClientRect(), a = n.getBoundingClientRect(), c = a.left - t.left, M = a.top - t.top, j = a.width, A = a.height;
34
+ b.value = {
34
35
  width: `${j}px`,
35
36
  height: `${A}px`,
36
37
  transform: `translate(${c}px, ${M}px)`,
37
38
  opacity: 1
38
39
  };
39
40
  };
40
- J(d, o), l(() => a.modelValue, o), l(() => a.options, o, { deep: !0 }), l(() => a.size, o), l(() => a.block, o), l(() => a.wrap, o), D(o);
41
+ J(d, o), l(() => r.modelValue, o), l(() => r.options, o, { deep: !0 }), l(() => r.size, o), l(() => r.block, o), l(() => r.wrap, o), D(o);
41
42
  const C = (e) => {
42
43
  e.disabled || (v("update:modelValue", e.value), v("change", e.value));
43
44
  }, w = g(() => {
44
- const e = a.variant === "line", n = {
45
+ const e = r.variant === "line", n = {
45
46
  surface: "bg-secondary/80 p-1",
46
47
  primary: "bg-secondary p-1",
47
48
  secondary: "bg-secondary p-1",
@@ -49,51 +50,51 @@ const Z = /* @__PURE__ */ E({
49
50
  success: "bg-success/10 p-1",
50
51
  outline: "bg-transparent border border-border p-1",
51
52
  line: "bg-transparent gap-6 rounded-none p-0 border-b border-border"
52
- }, t = a.wrap && !e ? "flex-wrap" : "";
53
- return [`${a.block || e ? "flex w-full" : "inline-flex"} rounded-lg relative isolate ${t}`, n[a.variant]];
53
+ }, t = r.wrap && !e ? "flex-wrap" : "";
54
+ return [`${r.block || e ? "flex w-full" : "inline-flex"} rounded-lg relative isolate ${t}`, n[r.variant]];
54
55
  }), z = {
55
56
  sm: "text-xs px-2.5 py-1",
56
57
  md: "-text-fs-2 px-3 py-1",
57
58
  lg: "-text-fs-1 px-4 py-1"
58
59
  }, $ = g(() => {
59
- const e = a.variant === "line", n = e ? "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none outline-none focus-visible:ring-2 focus-visible:ring-primary/50 pb-2 border-b-2 border-transparent hover:text-foreground" : "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-primary/50", t = (a.block || a.wrap) && !e ? "flex-1" : "";
60
+ const e = r.variant === "line", n = e ? "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none outline-none focus-visible:ring-2 focus-visible:ring-primary/50 pb-2 border-b-2 border-transparent hover:text-foreground" : "relative z-10 flex items-center justify-center gap-2 font-medium transition-colors duration-50 ease-out cursor-pointer select-none rounded-md outline-none focus-visible:ring-2 focus-visible:ring-primary/50", t = (r.block || r.wrap) && !e ? "flex-1" : "";
60
61
  return [n, t];
61
62
  }), V = (e) => {
62
- const n = e.value === a.modelValue, t = a.variant === "line";
63
- let r = "";
63
+ const n = e.value === r.modelValue, t = r.variant === "line";
64
+ let a = "";
64
65
  if (n)
65
66
  if (t)
66
- r = "text-primary";
67
+ a = "text-primary";
67
68
  else
68
- switch (a.variant) {
69
+ switch (r.variant) {
69
70
  case "surface":
70
- r = "text-foreground";
71
+ a = "text-foreground";
71
72
  break;
72
73
  case "primary":
73
- r = "text-primary-foreground";
74
+ a = "text-primary-foreground";
74
75
  break;
75
76
  case "secondary":
76
- r = "text-secondary";
77
+ a = "text-secondary";
77
78
  break;
78
79
  case "danger":
79
- r = "text-danger-fg";
80
+ a = "text-danger-fg";
80
81
  break;
81
82
  case "success":
82
- r = "text-success-fg";
83
+ a = "text-success-fg";
83
84
  break;
84
85
  case "outline":
85
- r = "text-accent-foreground";
86
+ a = "text-accent-foreground";
86
87
  break;
87
88
  default:
88
- r = "text-foreground";
89
+ a = "text-foreground";
89
90
  }
90
91
  else
91
- r = t ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground/80";
92
+ a = t ? "text-muted-foreground" : "text-muted-foreground hover:text-foreground/80";
92
93
  const c = e.disabled ? "opacity-50 cursor-not-allowed" : "";
93
- return [$.value, r, c].join(" ");
94
+ return [$.value, a, r?.tabClass, c].join(" ");
94
95
  }, R = g(() => {
95
96
  const e = "absolute left-0 top-0 transition-all duration-300 ease-[cubic-bezier(0.25,0.1,0.25,1)] z-0 pointer-events-none";
96
- return a.variant === "line" ? `${e} !h-[2px] !top-auto bottom-0` : `${e} rounded-md shadow-sm`;
97
+ return r.variant === "line" ? `${e} !h-[2px] !top-auto bottom-0` : `${e} rounded-md shadow-sm`;
97
98
  }), B = () => ({
98
99
  surface: "bg-background",
99
100
  primary: "bg-primary",
@@ -102,7 +103,7 @@ const Z = /* @__PURE__ */ E({
102
103
  success: "bg-success",
103
104
  outline: "bg-accent/50 ring-1 ring-border",
104
105
  line: "bg-primary"
105
- })[a.variant], S = (e) => e.labelI18n ? Q(e.labelI18n) : e.label, I = (e) => e.to ? "router-link" : e.href ? "a" : "button", L = (e) => e.to ? { to: e.to } : e.href ? { href: e.href, target: "_blank", rel: "noopener noreferrer" } : { type: "button" };
106
+ })[r.variant], S = (e) => e.labelI18n ? Q(e.labelI18n) : e.label, I = (e) => e.to ? "router-link" : e.href ? "a" : "button", L = (e) => e.to ? { to: e.to } : e.href ? { href: e.href, target: "_blank", rel: "noopener noreferrer" } : { type: "button" };
106
107
  return (e, n) => (i(), p("div", {
107
108
  ref_key: "containerRef",
108
109
  ref: d,
@@ -113,18 +114,18 @@ const Z = /* @__PURE__ */ E({
113
114
  s.modelValue !== void 0 && !s.wrap ? (i(), p("div", {
114
115
  key: 0,
115
116
  class: u([R.value, B()]),
116
- style: N(m.value)
117
+ style: N(b.value)
117
118
  }, null, 6)) : y("", !0),
118
119
  (i(!0), p(O, null, P(s.options, (t) => (i(), x(T(I(t)), F({
119
120
  key: t.value,
120
121
  ref_for: !0,
121
- ref: (r) => k(r?.$el || r, t.value),
122
+ ref: (a) => k(a?.$el || a, t.value),
122
123
  role: "tab",
123
124
  "aria-selected": s.modelValue === t.value,
124
125
  disabled: t.disabled,
125
- class: [V(t), z[a.size]]
126
+ class: [V(t), z[r.size]]
126
127
  }, { ref_for: !0 }, L(t), {
127
- onClick: (r) => C(t)
128
+ onClick: (a) => C(t)
128
129
  }), {
129
130
  default: _(() => [
130
131
  t.icon ? (i(), x(K, {
@@ -27,9 +27,9 @@ declare const _default: import('vue').DefineComponent<ThumbnailSelectorProps, {}
27
27
  "onUpdate:images"?: (value: string[]) => any;
28
28
  "onUpdate:thumbnail"?: (value: string) => any;
29
29
  }>, {
30
- disabled: boolean;
31
30
  loading: boolean;
32
- images: string[];
33
31
  thumbnail: string | null;
32
+ disabled: boolean;
33
+ images: string[];
34
34
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
35
35
  export default _default;
@@ -1,7 +1,7 @@
1
1
  import o from "./ThumbnailSelector.vue2.js";
2
2
  /* empty css */
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ t(o, [["__scopeId", "data-v-72ffdc55"]]);
4
+ const e = /* @__PURE__ */ t(o, [["__scopeId", "data-v-74a988ab"]]);
5
5
  export {
6
- f as default
6
+ e as default
7
7
  };
@@ -1,23 +1,21 @@
1
- import { defineComponent as R, ref as w, watch as _, computed as m, openBlock as o, createElementBlock as u, toDisplayString as f, createCommentVNode as v, createElementVNode as h, createVNode as p, Fragment as A, renderList as E, normalizeClass as k, withModifiers as L, createBlock as y, withCtx as P } from "vue";
2
- import g from "../Icon.vue.js";
3
- import D from "../FilePicker/FilePicker.vue.js";
4
- import { $t as S } from "../../utils/i18n.js";
5
- const F = { class: "vl-thumbnail-selector flex flex-col gap-3" }, M = {
1
+ import { defineComponent as L, ref as w, watch as _, computed as m, openBlock as i, createElementBlock as d, toDisplayString as p, createCommentVNode as g, createElementVNode as v, createVNode as f, unref as P, withCtx as k, Fragment as V, renderList as F, normalizeClass as S, withModifiers as C, createBlock as y } from "vue";
2
+ import h from "../Icon.vue.js";
3
+ import M from "../FilePicker/FilePicker.vue.js";
4
+ import { VueDraggable as O } from "vue-draggable-plus";
5
+ import { $t as z } from "../../utils/i18n.js";
6
+ const q = { class: "vl-thumbnail-selector flex flex-col gap-3" }, G = {
6
7
  key: 0,
7
8
  class: "text-sm font-medium text-foreground"
8
- }, O = {
9
+ }, H = {
9
10
  class: "vl-thumbnail-selector__preview w-full rounded-lg border border-border bg-muted/30 overflow-hidden flex items-center justify-center",
10
11
  style: { "aspect-ratio": "1/1" }
11
- }, q = ["src", "alt"], G = {
12
+ }, J = ["src", "alt"], K = {
12
13
  key: 1,
13
14
  class: "flex flex-col items-center gap-2 text-muted-foreground/40 select-none"
14
- }, H = { class: "text-xs" }, J = {
15
- class: "vl-thumbnail-selector__grid grid grid-cols-3 sm:grid-cols-4 gap-2",
16
- style: { "will-change": "transform", contain: "layout style" }
17
- }, K = ["onClick"], Q = ["src", "alt"], V = ["title", "onClick"], W = {
18
- key: 1,
15
+ }, Q = { class: "text-xs" }, W = ["onClick"], X = ["src", "alt"], Y = ["title"], Z = ["title", "onClick"], ee = {
16
+ key: 2,
19
17
  class: "absolute bottom-0.5 left-0.5 z-10 w-4 h-4 flex items-center justify-center rounded-full bg-primary pointer-events-none"
20
- }, X = ["onClick"], Y = { class: "text-[10px] mt-0.5 leading-tight" }, ie = /* @__PURE__ */ R({
18
+ }, te = ["onClick"], le = { class: "text-[10px] mt-0.5 leading-tight" }, de = /* @__PURE__ */ L({
21
19
  name: "ThumbnailSelector",
22
20
  __name: "ThumbnailSelector",
23
21
  props: {
@@ -29,130 +27,158 @@ const F = { class: "vl-thumbnail-selector flex flex-col gap-3" }, M = {
29
27
  label: {}
30
28
  },
31
29
  emits: ["update:images", "update:thumbnail", "change"],
32
- setup(a, { emit: C }) {
33
- const s = a, r = C, c = w([...s.images || []]), i = w(s.thumbnail ?? null);
30
+ setup(l, { emit: j }) {
31
+ const c = l, n = j, r = w([...c.images || []]), o = w(c.thumbnail ?? null);
34
32
  _(
35
- () => s.images,
36
- (t) => {
37
- c.value = [...t || []];
33
+ () => c.images,
34
+ (e) => {
35
+ r.value = [...e || []];
38
36
  }
39
37
  ), _(
40
- () => s.thumbnail,
41
- (t) => {
42
- i.value = t ?? null;
38
+ () => c.thumbnail,
39
+ (e) => {
40
+ o.value = e ?? null;
43
41
  }
44
42
  );
45
- const x = m(() => i.value || c.value[0] || null), b = (t, d, e) => {
46
- const l = e ? S(t, e) : S(t);
47
- return l !== t ? l : d;
48
- }, I = m(() => b("vlite.thumbnailSelector.preview", "Thumbnail preview")), j = m(() => b("vlite.thumbnailSelector.noImageSelected", "No image selected")), z = m(() => b("vlite.thumbnailSelector.image", "Image")), T = m(() => b("vlite.thumbnailSelector.removeImage", "Remove image")), U = m(() => b("vlite.thumbnailSelector.upload", "Upload")), $ = (t) => {
49
- s.disabled || s.loading || (i.value = t, r("update:thumbnail", t), r("change", { images: c.value, thumbnail: t }));
50
- }, B = (t, d) => {
51
- if (d.stopPropagation(), s.disabled || s.loading) return;
52
- const e = c.value.filter((n) => n !== t);
53
- c.value = e;
54
- let l = i.value;
55
- i.value === t && (l = e[0] ?? null, i.value = l, r("update:thumbnail", l)), r("update:images", e), r("change", { images: e, thumbnail: l });
56
- }, N = (t) => {
57
- if (!t) return;
58
- const d = Array.isArray(t) ? t : [t], e = [];
59
- for (const n of d)
60
- if (n.base64)
61
- e.push(n.base64);
62
- else if (n.file)
43
+ const x = m(() => o.value || r.value[0] || null), b = (e, u, t) => {
44
+ const a = t ? z(e, t) : z(e);
45
+ return a !== e ? a : u;
46
+ }, T = m(() => b("vlite.thumbnailSelector.preview", "Thumbnail preview")), U = m(() => b("vlite.thumbnailSelector.noImageSelected", "No image selected")), I = m(() => b("vlite.thumbnailSelector.image", "Image")), R = m(() => b("vlite.thumbnailSelector.removeImage", "Remove image")), $ = m(() => b("vlite.thumbnailSelector.upload", "Upload")), B = m(() => b("vlite.thumbnailSelector.dragToReorder", "Drag to reorder")), D = (e) => {
47
+ c.disabled || c.loading || (o.value = e, n("update:thumbnail", e), n("change", { images: r.value, thumbnail: e }));
48
+ }, N = (e, u) => {
49
+ if (u.stopPropagation(), c.disabled || c.loading) return;
50
+ const t = r.value.filter((s) => s !== e);
51
+ r.value = t;
52
+ let a = o.value;
53
+ o.value === e && (a = t[0] ?? null, o.value = a, n("update:thumbnail", a)), n("update:images", t), n("change", { images: t, thumbnail: a });
54
+ }, A = (e) => {
55
+ if (!e) return;
56
+ const u = Array.isArray(e) ? e : [e], t = [];
57
+ for (const s of u)
58
+ if (s.base64)
59
+ t.push(s.base64);
60
+ else if (s.file)
63
61
  try {
64
- e.push(URL.createObjectURL(n.file));
62
+ t.push(URL.createObjectURL(s.file));
65
63
  } catch {
66
64
  }
67
- if (e.length === 0) return;
68
- const l = [...c.value, ...e];
69
- c.value = l, i.value || (i.value = e[0], r("update:thumbnail", e[0])), r("update:images", l), r("change", { images: l, thumbnail: i.value });
65
+ if (t.length === 0) return;
66
+ const a = [...r.value, ...t];
67
+ r.value = a, o.value || (o.value = t[0], n("update:thumbnail", t[0])), n("update:images", a), n("change", { images: a, thumbnail: o.value });
68
+ }, E = (e) => {
69
+ r.value = e, n("update:images", e), n("change", { images: e, thumbnail: o.value });
70
70
  };
71
- return (t, d) => (o(), u("div", F, [
72
- a.label ? (o(), u("p", M, f(a.label), 1)) : v("", !0),
73
- h("div", O, [
74
- x.value ? (o(), u("img", {
71
+ return (e, u) => (i(), d("div", q, [
72
+ l.label ? (i(), d("p", G, p(l.label), 1)) : g("", !0),
73
+ v("div", H, [
74
+ x.value ? (i(), d("img", {
75
75
  key: 0,
76
76
  src: x.value,
77
77
  class: "w-full h-full object-cover",
78
- alt: I.value
79
- }, null, 8, q)) : (o(), u("div", G, [
80
- p(g, {
78
+ alt: T.value
79
+ }, null, 8, J)) : (i(), d("div", K, [
80
+ f(h, {
81
81
  icon: "lucide:image",
82
82
  class: "w-10 h-10"
83
83
  }),
84
- h("span", H, f(j.value), 1)
84
+ v("span", Q, p(U.value), 1)
85
85
  ]))
86
86
  ]),
87
- h("div", J, [
88
- (o(!0), u(A, null, E(c.value, (e, l) => (o(), u("div", {
89
- key: e + l,
90
- class: k(["vl-thumbnail-selector__card relative rounded-md overflow-hidden cursor-pointer border-2 transition-all duration-150 w-full", [
91
- i.value === e ? "border-primary shadow-sm shadow-primary/20" : "border-border",
92
- a.disabled || a.loading ? "pointer-events-none opacity-60" : ""
93
- ]]),
94
- style: { "aspect-ratio": "1/1" },
95
- onClick: (n) => $(e)
96
- }, [
97
- h("img", {
98
- src: e,
99
- class: "w-full h-full object-cover",
100
- alt: `${z.value} ${l + 1}`
101
- }, null, 8, Q),
102
- a.disabled ? v("", !0) : (o(), u("button", {
103
- key: 0,
104
- type: "button",
105
- class: "vl-thumbnail-selector__delete absolute top-0.5 right-0.5 z-10 w-5 h-5 flex items-center justify-center rounded-full bg-background/90 border border-border text-muted-foreground shadow-sm opacity-0 transition-opacity duration-150 hover:text-destructive hover:border-destructive",
106
- title: T.value,
107
- onClick: L((n) => B(e, n), ["stop"])
87
+ f(P(O), {
88
+ "model-value": r.value,
89
+ "onUpdate:modelValue": E,
90
+ animation: 150,
91
+ disabled: l.disabled || l.loading,
92
+ draggable: ".vl-thumbnail-selector__card",
93
+ handle: ".drag-handle",
94
+ filter: ".vl-thumbnail-selector__filepicker-inline, .vl-thumbnail-selector__upload",
95
+ "ghost-class": "opacity-50",
96
+ class: "vl-thumbnail-selector__grid grid grid-cols-3 sm:grid-cols-4 gap-2",
97
+ style: { "will-change": "transform", contain: "layout style" }
98
+ }, {
99
+ default: k(() => [
100
+ (i(!0), d(V, null, F(r.value, (t, a) => (i(), d("div", {
101
+ key: t,
102
+ class: S(["vl-thumbnail-selector__card relative rounded-md overflow-hidden cursor-pointer border-2 transition-all duration-150 w-full", [
103
+ o.value === t ? "border-primary shadow-sm shadow-primary/20" : "border-border",
104
+ l.disabled || l.loading ? "pointer-events-none opacity-60" : ""
105
+ ]]),
106
+ style: { "aspect-ratio": "1/1" },
107
+ onClick: (s) => D(t)
108
108
  }, [
109
- p(g, {
110
- icon: "lucide:x",
111
- class: "w-3 h-3"
112
- })
113
- ], 8, V)),
114
- i.value === e ? (o(), u("div", W, [
115
- p(g, {
116
- icon: "lucide:check",
117
- class: "w-2.5 h-2.5 text-primary-foreground"
118
- })
119
- ])) : v("", !0)
120
- ], 10, K))), 128)),
121
- a.disabled ? v("", !0) : (o(), y(D, {
122
- key: 0,
123
- disabled: a.disabled || a.loading,
124
- "return-format": "base64",
125
- "file-types": ["image/jpeg", "image/png", "image/webp", "image/gif", "image/svg+xml"],
126
- "max-size": a.maxSize ? a.maxSize * 1024 * 1024 : void 0,
127
- "multi-select": !0,
128
- class: "vl-thumbnail-selector__filepicker-inline",
129
- onChange: N
130
- }, {
131
- trigger: P(({ trigger: e, isLoading: l }) => [
132
- h("button", {
109
+ v("img", {
110
+ src: t,
111
+ class: "w-full h-full object-cover",
112
+ alt: `${I.value} ${a + 1}`
113
+ }, null, 8, X),
114
+ l.disabled ? g("", !0) : (i(), d("div", {
115
+ key: 0,
116
+ class: "drag-handle vl-thumbnail-selector__drag-handle absolute top-1 left-1 z-10 w-6 h-6 flex items-center justify-center rounded bg-background/60 backdrop-blur-sm border border-border text-muted-foreground shadow-sm cursor-grab active:cursor-grabbing hover:bg-background/90 hover:text-foreground opacity-0 transition-opacity duration-150",
117
+ title: B.value,
118
+ onClick: u[0] || (u[0] = C(() => {
119
+ }, ["stop"]))
120
+ }, [
121
+ f(h, {
122
+ icon: "lucide:grip-horizontal",
123
+ class: "w-3.5 h-3.5"
124
+ })
125
+ ], 8, Y)),
126
+ l.disabled ? g("", !0) : (i(), d("button", {
127
+ key: 1,
133
128
  type: "button",
134
- class: k(["vl-thumbnail-selector__upload flex flex-col items-center justify-center rounded-md border-2 border-dashed border-border text-muted-foreground/60 hover:border-primary/50 hover:text-primary/60 transition-all cursor-pointer w-full", l || a.loading ? "opacity-60 pointer-events-none" : ""]),
135
- style: { "aspect-ratio": "1/1" },
136
- onClick: e
129
+ class: "vl-thumbnail-selector__delete absolute top-0.5 right-0.5 z-10 w-5 h-5 flex items-center justify-center rounded-full bg-background/90 border border-border text-muted-foreground shadow-sm opacity-0 transition-opacity duration-150 hover:text-destructive hover:border-destructive",
130
+ title: R.value,
131
+ onClick: C((s) => N(t, s), ["stop"])
137
132
  }, [
138
- l || a.loading ? (o(), y(g, {
139
- key: 0,
140
- icon: "lucide:loader-2",
141
- class: "w-5 h-5 animate-spin"
142
- })) : (o(), y(g, {
143
- key: 1,
144
- icon: "lucide:plus",
145
- class: "w-5 h-5"
146
- })),
147
- h("span", Y, f(U.value), 1)
148
- ], 10, X)
149
- ]),
150
- _: 1
151
- }, 8, ["disabled", "max-size"]))
152
- ])
133
+ f(h, {
134
+ icon: "lucide:x",
135
+ class: "w-3 h-3"
136
+ })
137
+ ], 8, Z)),
138
+ o.value === t ? (i(), d("div", ee, [
139
+ f(h, {
140
+ icon: "lucide:check",
141
+ class: "w-2.5 h-2.5 text-primary-foreground"
142
+ })
143
+ ])) : g("", !0)
144
+ ], 10, W))), 128)),
145
+ l.disabled ? g("", !0) : (i(), y(M, {
146
+ key: 0,
147
+ disabled: l.disabled || l.loading,
148
+ "return-format": "base64",
149
+ "file-types": ["image/jpeg", "image/png", "image/webp", "image/gif", "image/svg+xml"],
150
+ "max-size": l.maxSize ? l.maxSize * 1024 * 1024 : void 0,
151
+ "multi-select": !0,
152
+ class: "vl-thumbnail-selector__filepicker-inline",
153
+ onChange: A
154
+ }, {
155
+ trigger: k(({ trigger: t, isLoading: a }) => [
156
+ v("button", {
157
+ type: "button",
158
+ class: S(["vl-thumbnail-selector__upload flex flex-col items-center justify-center rounded-md border-2 border-dashed border-border text-muted-foreground/60 hover:border-primary/50 hover:text-primary/60 transition-all cursor-pointer w-full", a || l.loading ? "opacity-60 pointer-events-none" : ""]),
159
+ style: { "aspect-ratio": "1/1" },
160
+ onClick: t
161
+ }, [
162
+ a || l.loading ? (i(), y(h, {
163
+ key: 0,
164
+ icon: "lucide:loader-2",
165
+ class: "w-5 h-5 animate-spin"
166
+ })) : (i(), y(h, {
167
+ key: 1,
168
+ icon: "lucide:plus",
169
+ class: "w-5 h-5"
170
+ })),
171
+ v("span", le, p($.value), 1)
172
+ ], 10, te)
173
+ ]),
174
+ _: 1
175
+ }, 8, ["disabled", "max-size"]))
176
+ ]),
177
+ _: 1
178
+ }, 8, ["model-value", "disabled"])
153
179
  ]));
154
180
  }
155
181
  });
156
182
  export {
157
- ie as default
183
+ de as default
158
184
  };
@@ -13,18 +13,18 @@ declare function __VLS_template(): {
13
13
  };
14
14
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
15
15
  declare const __VLS_component: import('vue').DefineComponent<WorkbookProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
16
- change: (id: string) => any;
17
16
  delete: (id: string) => any;
18
17
  add: () => any;
18
+ change: (id: string) => any;
19
19
  "update:modelValue": (id: string) => any;
20
20
  "edit-start": (id: string) => any;
21
21
  "edit-end": (id: string) => any;
22
22
  duplicate: (id: string) => any;
23
23
  "update:sheets": (sheets: WorkbookSheet[]) => any;
24
24
  }, string, import('vue').PublicProps, Readonly<WorkbookProps> & Readonly<{
25
- onChange?: (id: string) => any;
26
25
  onDelete?: (id: string) => any;
27
26
  onAdd?: () => any;
27
+ onChange?: (id: string) => any;
28
28
  "onUpdate:modelValue"?: (id: string) => any;
29
29
  "onEdit-start"?: (id: string) => any;
30
30
  "onEdit-end"?: (id: string) => any;
@@ -32,10 +32,10 @@ declare const __VLS_component: import('vue').DefineComponent<WorkbookProps, {},
32
32
  "onUpdate:sheets"?: (sheets: WorkbookSheet[]) => any;
33
33
  }>, {
34
34
  variant: "chrome" | "folder" | "simple" | "card";
35
+ itemClass: string;
35
36
  modelValue: string;
36
37
  editable: boolean;
37
38
  draggable: boolean;
38
- itemClass: string;
39
39
  confirmDelete: boolean;
40
40
  allowIconChange: boolean;
41
41
  activeItemClass: string;
package/core/config.d.ts CHANGED
@@ -43,6 +43,44 @@ export declare const configState: {
43
43
  hideIcon?: boolean;
44
44
  customStatuses?: Record<string, import('..').CustomStatusConfig>;
45
45
  };
46
+ attachmentsList?: {
47
+ variant?: "default" | "list" | "inline" | "card";
48
+ size?: "sm" | "md" | "lg";
49
+ canView?: boolean;
50
+ canDownload?: boolean;
51
+ clickToPreview?: boolean;
52
+ showDownloadInList?: boolean;
53
+ rootClass?: string;
54
+ gridClass?: string;
55
+ cardClass?: string;
56
+ cardThumbnailClass?: string;
57
+ cardInfoClass?: string;
58
+ cardActionsClass?: string;
59
+ listClass?: string;
60
+ itemClass?: string;
61
+ itemIconBoxClass?: string;
62
+ itemNameClass?: string;
63
+ itemSizeClass?: string;
64
+ itemActionsClass?: string;
65
+ emptyClass?: string;
66
+ };
67
+ list?: {
68
+ title?: string;
69
+ class?: string;
70
+ titleI18n?: string;
71
+ variant?: import('..').ListVariant;
72
+ titleIcon?: string;
73
+ columns?: import('..').ListColumns;
74
+ showColon?: boolean;
75
+ loading?: boolean;
76
+ skeletonRows?: number;
77
+ stackedBorderStyle?: import('..').StackedBorderStyle;
78
+ };
79
+ invoice?: {
80
+ variant?: import('..').InvoiceVariant;
81
+ compact?: boolean;
82
+ displayBarcodeValue?: boolean;
83
+ };
46
84
  };
47
85
  };
48
86
  /**
@@ -88,5 +126,43 @@ export declare function useVLiteConfig(): {
88
126
  hideIcon?: boolean;
89
127
  customStatuses?: Record<string, import('..').CustomStatusConfig>;
90
128
  };
129
+ attachmentsList?: {
130
+ variant?: "default" | "list" | "inline" | "card";
131
+ size?: "sm" | "md" | "lg";
132
+ canView?: boolean;
133
+ canDownload?: boolean;
134
+ clickToPreview?: boolean;
135
+ showDownloadInList?: boolean;
136
+ rootClass?: string;
137
+ gridClass?: string;
138
+ cardClass?: string;
139
+ cardThumbnailClass?: string;
140
+ cardInfoClass?: string;
141
+ cardActionsClass?: string;
142
+ listClass?: string;
143
+ itemClass?: string;
144
+ itemIconBoxClass?: string;
145
+ itemNameClass?: string;
146
+ itemSizeClass?: string;
147
+ itemActionsClass?: string;
148
+ emptyClass?: string;
149
+ };
150
+ list?: {
151
+ title?: string;
152
+ class?: string;
153
+ titleI18n?: string;
154
+ variant?: import('..').ListVariant;
155
+ titleIcon?: string;
156
+ columns?: import('..').ListColumns;
157
+ showColon?: boolean;
158
+ loading?: boolean;
159
+ skeletonRows?: number;
160
+ stackedBorderStyle?: import('..').StackedBorderStyle;
161
+ };
162
+ invoice?: {
163
+ variant?: import('..').InvoiceVariant;
164
+ compact?: boolean;
165
+ displayBarcodeValue?: boolean;
166
+ };
91
167
  };
92
168
  };
package/core/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { configState as t, VLITE_CONFIG_KEY as s } from "./config.js";
2
- import { updateConfig as n, useVLiteConfig as p } from "./config.js";
3
- function o(e = {}) {
2
+ import { updateConfig as i, useVLiteConfig as r } from "./config.js";
3
+ function n(e = {}) {
4
4
  return {
5
5
  install(m) {
6
6
  e && (e.services && (t.services = { ...t.services, ...e.services }), e.importData && (t.importData = { ...t.importData, ...e.importData }), e.exportData && (t.exportData = { ...t.exportData, ...e.exportData }), e.components && (t.components = {
@@ -29,6 +29,18 @@ function o(e = {}) {
29
29
  ...t.components?.statusChip?.customStatuses || {},
30
30
  ...e.components.statusChip?.customStatuses || {}
31
31
  }
32
+ },
33
+ attachmentsList: {
34
+ ...t.components?.attachmentsList || {},
35
+ ...e.components.attachmentsList || {}
36
+ },
37
+ list: {
38
+ ...t.components?.list || {},
39
+ ...e.components.list || {}
40
+ },
41
+ invoice: {
42
+ ...t.components?.invoice || {},
43
+ ...e.components.invoice || {}
32
44
  }
33
45
  })), m.provide(s, t), m.config.globalProperties.$vlite = t;
34
46
  }
@@ -37,7 +49,7 @@ function o(e = {}) {
37
49
  export {
38
50
  s as VLITE_CONFIG_KEY,
39
51
  t as configState,
40
- o as createVLite,
41
- n as updateConfig,
42
- p as useVLiteConfig
52
+ n as createVLite,
53
+ i as updateConfig,
54
+ r as useVLiteConfig
43
55
  };