vlite3 1.4.4 → 1.4.6

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 (102) hide show
  1. package/components/AppShell/AppShellLayoutStorefront.vue.d.ts +4 -17
  2. package/components/AppShell/AppShellLayoutStorefront.vue.js +116 -152
  3. package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
  4. package/components/AvatarUploader/AvatarUploader.vue.js +1 -1
  5. package/components/Cart/Cart.vue.js +242 -0
  6. package/components/Cart/Cart.vue2.js +4 -0
  7. package/components/Cart/CartCouponInput.vue.js +176 -0
  8. package/components/Cart/CartCouponInput.vue2.js +4 -0
  9. package/components/Cart/CartEmptyState.vue.js +48 -0
  10. package/components/Cart/CartEmptyState.vue2.js +4 -0
  11. package/components/Cart/CartLineItem.vue.js +341 -0
  12. package/components/Cart/CartLineItem.vue2.js +4 -0
  13. package/components/Cart/CartSummary.vue.js +157 -0
  14. package/components/Cart/CartSummary.vue2.js +4 -0
  15. package/components/Cart/CartVariant1.vue.js +156 -0
  16. package/components/Cart/CartVariant1.vue2.js +4 -0
  17. package/components/Cart/CartVariant2.vue.js +154 -0
  18. package/components/Cart/CartVariant2.vue2.js +4 -0
  19. package/components/Cart/CartVariant3.vue.js +192 -0
  20. package/components/Cart/CartVariant3.vue2.js +4 -0
  21. package/components/Cart/CartVariant4.vue.js +145 -0
  22. package/components/Cart/CartVariant4.vue2.js +4 -0
  23. package/components/Cart/composables/useCart.d.ts +46 -0
  24. package/components/Cart/composables/useCart.js +110 -0
  25. package/components/Cart/composables/useCartCalculation.js +145 -0
  26. package/components/Cart/index.d.ts +2 -0
  27. package/components/CategoryManager/CategoryManager.vue.js +3 -3
  28. package/components/CategoryManager/CategoryManager.vue2.js +225 -249
  29. package/components/CategoryManager/utils.d.ts +3 -0
  30. package/components/CategoryManager/utils.js +31 -0
  31. package/components/CategoryMenu/CategoryMenu.vue.d.ts +2 -0
  32. package/components/CategoryMenu/CategoryMenu.vue.js +46 -40
  33. package/components/CategoryMenu/CategoryMenuVariant1.vue.d.ts +5 -1
  34. package/components/CategoryMenu/CategoryMenuVariant1.vue.js +5 -144
  35. package/components/CategoryMenu/CategoryMenuVariant1.vue2.js +220 -2
  36. package/components/CategoryMenu/CategoryMenuVariant2.vue.d.ts +5 -1
  37. package/components/CategoryMenu/CategoryMenuVariant2.vue.js +5 -160
  38. package/components/CategoryMenu/CategoryMenuVariant2.vue2.js +235 -2
  39. package/components/CategoryMenu/types.d.ts +5 -2
  40. package/components/Chat/ChatInterface.vue.js +1 -1
  41. package/components/Comment/CommentEditor.vue.js +1 -1
  42. package/components/Dropdown/Dropdown.vue.d.ts +1 -0
  43. package/components/Dropdown/Dropdown.vue.js +31 -29
  44. package/components/FilePicker/FilePickerDropzone.vue.d.ts +27 -0
  45. package/components/FilePicker/FilePickerDropzone.vue.js +117 -0
  46. package/components/FilePicker/FilePickerDropzone.vue2.js +4 -0
  47. package/components/FilePicker/FilePickerInput.vue.d.ts +22 -0
  48. package/components/FilePicker/FilePickerInput.vue.js +147 -0
  49. package/components/FilePicker/FilePickerInput.vue2.js +4 -0
  50. package/components/FilePicker/FilePreview.vue.d.ts +21 -0
  51. package/components/FilePicker/FilePreview.vue.js +95 -0
  52. package/components/FilePicker/FilePreview.vue2.js +4 -0
  53. package/components/FilePicker/composables/useFileProcessing.d.ts +65 -0
  54. package/components/FilePicker/composables/useFileProcessing.js +141 -0
  55. package/components/FilePicker/index.d.ts +2 -2
  56. package/components/FilePicker/{FilePicker.vue.d.ts → index.vue.d.ts} +11 -18
  57. package/components/FilePicker/index.vue.js +131 -0
  58. package/components/FilePicker/index.vue2.js +4 -0
  59. package/components/FilePicker/types.d.ts +17 -0
  60. package/components/FilePicker/utils.d.ts +23 -0
  61. package/components/FilePicker/utils.js +37 -0
  62. package/components/Form/AccordionView.vue.d.ts +26 -0
  63. package/components/Form/AccordionView.vue.js +219 -0
  64. package/components/Form/AccordionView.vue2.js +4 -0
  65. package/components/Form/FormField.vue.js +3 -3
  66. package/components/Form/FormFields.vue.js +2 -2
  67. package/components/Form/TableRow.vue.d.ts +18 -0
  68. package/components/Form/TableRow.vue.js +88 -0
  69. package/components/Form/TableRow.vue2.js +4 -0
  70. package/components/Form/TableView.vue.d.ts +23 -0
  71. package/components/Form/TableView.vue.js +88 -0
  72. package/components/Form/TableView.vue2.js +4 -0
  73. package/components/Form/composables/useCustomFieldRows.d.ts +52 -0
  74. package/components/Form/composables/useCustomFieldRows.js +77 -0
  75. package/components/Form/index.d.ts +1 -1
  76. package/components/Form/{CustomFields.vue.d.ts → index.vue.d.ts} +8 -5
  77. package/components/Form/index.vue.js +7 -0
  78. package/components/Form/index.vue2.js +141 -0
  79. package/components/Form/rowHelpers.d.ts +45 -0
  80. package/components/Form/rowHelpers.js +40 -0
  81. package/components/Form/types.d.ts +3 -0
  82. package/components/IconPicker.vue.d.ts +2 -2
  83. package/components/Modal.vue.d.ts +2 -0
  84. package/components/Modal.vue.js +1 -1
  85. package/components/Modal.vue2.js +30 -28
  86. package/components/Screen/ScreenFilter.vue.js +4 -3
  87. package/components/SidePanel.vue.d.ts +2 -0
  88. package/components/SidePanel.vue.js +1 -1
  89. package/components/SidePanel.vue2.js +25 -23
  90. package/components/SidebarMenu/SidebarMenu.vue.js +145 -128
  91. package/components/ThumbnailSelector/ThumbnailSelector.vue.js +1 -1
  92. package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +1 -1
  93. package/components/index.d.ts +2 -1
  94. package/core/config.d.ts +6 -6
  95. package/index.d.ts +1 -0
  96. package/index.js +328 -307
  97. package/package.json +1 -1
  98. package/style.css +1 -1
  99. package/components/FilePicker/FilePicker.vue.js +0 -361
  100. package/components/FilePicker/FilePicker.vue2.js +0 -4
  101. package/components/Form/CustomFields.vue.js +0 -7
  102. package/components/Form/CustomFields.vue2.js +0 -261
@@ -7,31 +7,18 @@ declare function __VLS_template(): {
7
7
  toggle: () => boolean;
8
8
  }): any;
9
9
  left?(_: {}): any;
10
- left?(_: {}): any;
11
- nav?(_: {}): any;
12
- nav?(_: {}): any;
13
- logo?(_: {}): any;
14
- logo?(_: {}): any;
15
- center?(_: {}): any;
16
10
  center?(_: {}): any;
17
- search?(_: {}): any;
18
- search?(_: {}): any;
19
- actions?(_: {}): any;
20
- actions?(_: {}): any;
21
11
  right?(_: {}): any;
22
- right?(_: {}): any;
23
- 'mobile-search'?(_: {}): any;
24
- categories?(_: {
25
- categoryRoutePrefix: string;
26
- }): any;
12
+ 'mobile-bottom'?(_: {}): any;
27
13
  categories?(_: {
28
14
  categoryRoutePrefix: string;
29
15
  }): any;
30
16
  main?(_: {}): any;
31
17
  footer?(_: {}): any;
32
18
  'mobile-sidebar-header'?(_: {}): any;
33
- 'mobile-sidebar'?(_: {}): any;
34
- 'mobile-nav'?(_: {}): any;
19
+ 'mobile-sidebar'?(_: {
20
+ categoryRoutePrefix: string;
21
+ }): any;
35
22
  'mobile-sidebar-footer'?(_: {}): any;
36
23
  };
37
24
  refs: {
@@ -1,215 +1,179 @@
1
- import { defineComponent as T, inject as P, computed as v, openBlock as r, createElementBlock as t, renderSlot as o, createCommentVNode as i, createElementVNode as d, normalizeClass as a, unref as s, createVNode as b, isRef as y, createSlots as R, withCtx as $ } from "vue";
2
- import V from "../Icon.vue.js";
3
- import j from "../SidePanel.vue.js";
4
- import x from "../Navbar/NavbarTabs.vue.js";
1
+ import { defineComponent as z, inject as T, computed as v, openBlock as t, createElementBlock as i, renderSlot as l, createCommentVNode as d, createElementVNode as a, normalizeClass as n, unref as e, createVNode as f, isRef as y, createSlots as _, withCtx as w } from "vue";
2
+ import R from "../Icon.vue.js";
3
+ import P from "../SidePanel.vue.js";
4
+ import V from "../Navbar/NavbarTabs.vue.js";
5
5
  /* empty css */
6
- import N from "../Breadcrumb/Breadcrumb.vue.js";
6
+ import j from "../Breadcrumb/Breadcrumb.vue.js";
7
7
  /* empty css */
8
- import { APPSHELL_LAYOUT_KEY as B } from "./useAppShell.js";
9
- import { normalizeRoutePrefix as E } from "../CategoryMenu/utils.js";
10
- const L = { class: "vlite-app-layout flex flex-col w-full h-full min-h-0 bg-body text-foreground overflow-hidden" }, M = {
8
+ import { APPSHELL_LAYOUT_KEY as N } from "./useAppShell.js";
9
+ import { normalizeRoutePrefix as B } from "../CategoryMenu/utils.js";
10
+ const E = { class: "vlite-app-layout flex flex-col w-full h-full min-h-0 bg-body text-foreground overflow-hidden" }, L = {
11
11
  key: 0,
12
12
  class: "shrink-0 w-full"
13
- }, O = { class: "w-full mx-auto max-w-7xl px-3 sm:px-4 md:px-6 lg:px-8" }, A = { class: "flex items-center gap-2 min-w-0" }, U = ["aria-label"], Y = { class: "w-full mx-auto max-w-7xl px-3 sm:px-4 md:px-6 lg:px-8" }, D = {
13
+ }, M = { class: "w-full mx-auto max-w-7xl px-3 sm:px-4 md:px-6 lg:px-8" }, O = ["aria-label"], A = {
14
+ key: 0,
15
+ class: "flex items-center justify-center min-w-0 flex-1 px-2"
16
+ }, U = { class: "w-full min-w-0 max-w-7xl mx-auto overflow-hidden px-3 sm:px-4 md:px-6 lg:px-8" }, Y = {
14
17
  key: 0,
15
18
  class: "shrink-0 w-full"
16
- }, H = {
19
+ }, D = {
17
20
  key: 2,
18
21
  class: "shrink-0 w-full border-t border-border bg-background"
19
- }, I = { class: "flex flex-col h-full" }, K = {
22
+ }, H = { class: "flex flex-col h-full" }, I = {
20
23
  class: "flex-1 overflow-y-auto px-3.5 py-4 space-y-4 scrollbar-thin scrollbar-stable",
21
24
  style: { "will-change": "transform", contain: "layout style" }
22
- }, q = {
25
+ }, K = {
23
26
  key: 0,
24
27
  class: "mt-auto border-t border-border px-3.5 py-3"
25
- }, te = /* @__PURE__ */ T({
28
+ }, te = /* @__PURE__ */ z({
26
29
  __name: "AppShellLayoutStorefront",
27
- setup(F) {
28
- const w = P(B), {
29
- props: l,
30
- isMobileMenuOpen: n,
31
- isSidebarVisible: G,
32
- toggleSidebar: J,
33
- pageTitle: Q,
34
- breadcrumbData: g,
35
- breakpointClasses: m,
36
- nestedTabsItems: p,
30
+ setup(q) {
31
+ const k = T(N), {
32
+ props: s,
33
+ isMobileMenuOpen: r,
34
+ isSidebarVisible: F,
35
+ toggleSidebar: G,
36
+ pageTitle: J,
37
+ breadcrumbData: p,
38
+ breakpointClasses: u,
39
+ nestedTabsItems: g,
37
40
  activeNestedTab: c,
38
- handleNestedTabClick: k,
39
- mainScrollRef: C,
40
- layoutMainRef: S
41
- } = w, z = v(() => [
41
+ handleNestedTabClick: x,
42
+ mainScrollRef: $,
43
+ layoutMainRef: C
44
+ } = k, S = v(() => [
42
45
  "w-full shrink-0 bg-background transition-shadow duration-200",
43
46
  {
44
47
  fixed: "fixed top-0 left-0 z-50",
45
48
  sticky: "sticky top-0 z-50",
46
49
  relative: "relative z-20",
47
50
  absolute: "absolute top-0 left-0 w-full z-50"
48
- }[l.position || "sticky"],
49
- l.border ? "border-b border-border" : "",
50
- l.glass ? "bg-background/90 backdrop-blur-md" : "",
51
- l.floating ? "m-3 rounded-lg border border-border shadow-sm overflow-hidden" : "",
52
- l.class
53
- ].filter(Boolean).join(" ")), h = v(() => E(l.categoryRoutePrefix));
54
- return (e, u) => (r(), t("div", L, [
55
- e.$slots.announcement ? (r(), t("div", M, [
56
- o(e.$slots, "announcement")
57
- ])) : i("", !0),
58
- d("header", {
59
- class: a(z.value)
51
+ }[s.position || "sticky"],
52
+ s.border ? "border-b border-border" : "",
53
+ s.glass ? "bg-background/90 backdrop-blur-md" : "",
54
+ s.floating ? "m-3 rounded-lg border border-border shadow-sm overflow-hidden" : "",
55
+ s.class
56
+ ].filter(Boolean).join(" ")), h = v(() => B(s.categoryRoutePrefix));
57
+ return (o, m) => (t(), i("div", E, [
58
+ o.$slots.announcement ? (t(), i("div", L, [
59
+ l(o.$slots, "announcement")
60
+ ])) : d("", !0),
61
+ a("header", {
62
+ class: n(S.value)
60
63
  }, [
61
- d("div", O, [
62
- d("div", {
63
- class: a(["grid w-full grid-cols-[auto_minmax(0,1fr)_auto] md:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] items-center gap-3", s(l).height])
64
+ a("div", M, [
65
+ a("div", {
66
+ class: n(["flex w-full items-center justify-between gap-3 md:gap-6", e(s).height])
64
67
  }, [
65
- d("div", A, [
66
- o(e.$slots, "mobile-trigger", {
67
- isOpen: s(n),
68
- toggle: () => n.value = !s(n)
68
+ a("div", {
69
+ class: n(["flex items-center gap-2 sm:gap-4 min-w-0 shrink-0", { "flex-1": !o.$slots.center }])
70
+ }, [
71
+ l(o.$slots, "mobile-trigger", {
72
+ isOpen: e(r),
73
+ toggle: () => r.value = !e(r)
69
74
  }, () => [
70
- d("button", {
75
+ a("button", {
71
76
  type: "button",
72
- class: a(["inline-flex items-center justify-center w-9 h-9 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent", [s(m).mobileTrigger, s(l).mobileTriggerClass]]),
73
- "aria-label": s(n) ? "Close menu" : "Open menu",
74
- onClick: u[0] || (u[0] = (f) => n.value = !s(n))
77
+ class: n(["inline-flex items-center justify-center w-9 h-9 rounded-md text-muted-foreground hover:text-foreground hover:bg-accent", [e(u).mobileTrigger, e(s).mobileTriggerClass]]),
78
+ "aria-label": e(r) ? "Close menu" : "Open menu",
79
+ onClick: m[0] || (m[0] = (b) => r.value = !e(r))
75
80
  }, [
76
- b(V, {
77
- icon: s(n) ? "lucide:x" : "lucide:menu",
81
+ f(R, {
82
+ icon: e(r) ? "lucide:x" : "lucide:menu",
78
83
  class: "w-5 h-5"
79
84
  }, null, 8, ["icon"])
80
- ], 10, U)
85
+ ], 10, O)
81
86
  ]),
82
- e.$slots.left ? (r(), t("div", {
83
- key: 0,
84
- class: a(["items-center gap-2 min-w-0", s(m).desktopContent])
85
- }, [
86
- o(e.$slots, "left")
87
- ], 2)) : i("", !0),
88
- e.$slots.nav ? (r(), t("nav", {
89
- key: 1,
90
- class: a(["items-center gap-1 min-w-0", s(m).desktopContent]),
91
- "aria-label": "Primary navigation"
92
- }, [
93
- o(e.$slots, "nav")
94
- ], 2)) : i("", !0)
95
- ]),
96
- e.$slots.logo || e.$slots.center ? (r(), t("div", {
97
- key: 0,
98
- class: a(["min-w-0 justify-self-center flex items-center justify-center", s(l).logoClass])
99
- }, [
100
- o(e.$slots, "logo", {}, () => [
101
- o(e.$slots, "center")
102
- ])
103
- ], 2)) : i("", !0),
104
- d("div", {
105
- class: a(["flex items-center justify-end gap-2 min-w-0 justify-self-end", s(l).rightClass])
87
+ l(o.$slots, "left")
88
+ ], 2),
89
+ o.$slots.center ? (t(), i("div", A, [
90
+ l(o.$slots, "center")
91
+ ])) : d("", !0),
92
+ a("div", {
93
+ class: n(["flex items-center justify-end gap-2 sm:gap-4 min-w-0 shrink-0", [e(s).rightClass, { "flex-1": !o.$slots.center }]])
106
94
  }, [
107
- e.$slots.search ? (r(), t("div", {
108
- key: 0,
109
- class: a(["items-center min-w-0 w-full max-w-sm", s(m).desktopContent])
110
- }, [
111
- o(e.$slots, "search")
112
- ], 2)) : i("", !0),
113
- o(e.$slots, "actions", {}, () => [
114
- o(e.$slots, "right")
115
- ])
95
+ l(o.$slots, "right")
116
96
  ], 2)
117
97
  ], 2),
118
- e.$slots["mobile-search"] || e.$slots.search ? (r(), t("div", {
98
+ o.$slots["mobile-bottom"] ? (t(), i("div", {
119
99
  key: 0,
120
- class: a(["pb-3", s(m).mobileTrigger])
100
+ class: n(["pb-3 w-full", e(u).mobileTrigger])
121
101
  }, [
122
- o(e.$slots, "mobile-search", {}, () => [
123
- o(e.$slots, "search")
124
- ])
125
- ], 2)) : i("", !0)
102
+ l(o.$slots, "mobile-bottom")
103
+ ], 2)) : d("", !0)
126
104
  ]),
127
- e.$slots.categories ? (r(), t("div", {
105
+ o.$slots.categories ? (t(), i("div", {
128
106
  key: 0,
129
- class: a(["w-full border-t border-border bg-background", [s(m).desktopContent, s(l).menuClass]])
107
+ class: n(["w-full min-w-0 overflow-hidden border-t border-border bg-background", [e(u).desktopContent, e(s).menuClass]])
130
108
  }, [
131
- d("div", Y, [
132
- o(e.$slots, "categories", { categoryRoutePrefix: h.value })
109
+ a("div", U, [
110
+ l(o.$slots, "categories", { categoryRoutePrefix: h.value })
133
111
  ])
134
- ], 2)) : i("", !0)
112
+ ], 2)) : d("", !0)
135
113
  ], 2),
136
- e.$slots.main ? (r(), t("main", {
114
+ o.$slots.main ? (t(), i("main", {
137
115
  key: 1,
138
116
  ref_key: "layoutMainRef",
139
- ref: S,
117
+ ref: C,
140
118
  class: "flex-1 overflow-hidden w-full relative flex flex-col min-h-0"
141
119
  }, [
142
- s(l).renderNestedTabs && s(p).length > 0 ? (r(), t("div", D, [
143
- b(x, {
144
- modelValue: s(c),
145
- "onUpdate:modelValue": u[1] || (u[1] = (f) => y(c) ? c.value = f : null),
146
- onChange: s(k),
147
- items: s(p)
120
+ e(s).renderNestedTabs && e(g).length > 0 ? (t(), i("div", Y, [
121
+ f(V, {
122
+ modelValue: e(c),
123
+ "onUpdate:modelValue": m[1] || (m[1] = (b) => y(c) ? c.value = b : null),
124
+ onChange: e(x),
125
+ items: e(g)
148
126
  }, null, 8, ["modelValue", "onChange", "items"])
149
- ])) : i("", !0),
150
- s(l).breadcrumb && s(l).breadcrumbPosition === "main" && s(g).items.value.length > 1 ? (r(), t("div", {
127
+ ])) : d("", !0),
128
+ e(s).breadcrumb && e(s).breadcrumbPosition === "main" && e(p).items.value.length > 1 ? (t(), i("div", {
151
129
  key: 1,
152
- class: a(["shrink-0 w-full border-b border-border px-6 py-2", s(l).breadcrumbClass])
130
+ class: n(["shrink-0 w-full border-b border-border px-6 py-2", e(s).breadcrumbClass])
153
131
  }, [
154
- b(s(N), {
155
- items: s(g).items.value,
156
- variant: s(l).breadcrumbVariant,
157
- separator: s(l).breadcrumbSeparator,
158
- size: s(l).breadcrumbSize
132
+ f(e(j), {
133
+ items: e(p).items.value,
134
+ variant: e(s).breadcrumbVariant,
135
+ separator: e(s).breadcrumbSeparator,
136
+ size: e(s).breadcrumbSize
159
137
  }, null, 8, ["items", "variant", "separator", "size"])
160
- ], 2)) : i("", !0),
161
- d("div", {
138
+ ], 2)) : d("", !0),
139
+ a("div", {
162
140
  ref_key: "mainScrollRef",
163
- ref: C,
141
+ ref: $,
164
142
  style: { "will-change": "transform", contain: "layout style" },
165
- class: a(["flex-1 overflow-y-auto w-full relative h-full scrollbar-thin scrollbar-stable", s(l).contentClass])
143
+ class: n(["flex-1 overflow-y-auto w-full relative h-full scrollbar-thin scrollbar-stable", e(s).contentClass])
166
144
  }, [
167
- o(e.$slots, "main")
145
+ l(o.$slots, "main")
168
146
  ], 2)
169
- ], 512)) : i("", !0),
170
- e.$slots.footer ? (r(), t("footer", H, [
171
- o(e.$slots, "footer")
172
- ])) : i("", !0),
173
- b(j, {
174
- show: s(n),
175
- "onUpdate:show": u[2] || (u[2] = (f) => y(n) ? n.value = f : null),
147
+ ], 512)) : d("", !0),
148
+ o.$slots.footer ? (t(), i("footer", D, [
149
+ l(o.$slots, "footer")
150
+ ])) : d("", !0),
151
+ f(P, {
152
+ show: e(r),
153
+ "onUpdate:show": m[2] || (m[2] = (b) => y(r) ? r.value = b : null),
176
154
  position: "left",
177
155
  size: "sm",
178
- triggerClass: s(m).mobileTrigger,
179
- class: a(["z-60", s(m).mobileTrigger]),
156
+ triggerClass: e(u).mobileTrigger,
157
+ class: n(["z-60", e(u).mobileTrigger]),
180
158
  headerClass: "pl-3! pr-4.5! py-3!",
181
159
  bodyClass: "p-0!"
182
- }, R({
183
- default: $(() => [
184
- d("div", I, [
185
- d("div", K, [
186
- o(e.$slots, "mobile-sidebar", {}, () => [
187
- o(e.$slots, "mobile-nav", {}, () => [
188
- o(e.$slots, "nav")
189
- ]),
190
- o(e.$slots, "categories", { categoryRoutePrefix: h.value }),
191
- o(e.$slots, "left")
192
- ])
160
+ }, _({
161
+ default: w(() => [
162
+ a("div", H, [
163
+ a("div", I, [
164
+ l(o.$slots, "mobile-sidebar", { categoryRoutePrefix: h.value })
193
165
  ]),
194
- e.$slots["mobile-sidebar-footer"] || e.$slots.actions || e.$slots.right ? (r(), t("div", q, [
195
- o(e.$slots, "mobile-sidebar-footer", {}, () => [
196
- o(e.$slots, "actions", {}, () => [
197
- o(e.$slots, "right")
198
- ])
199
- ])
200
- ])) : i("", !0)
166
+ o.$slots["mobile-sidebar-footer"] ? (t(), i("div", K, [
167
+ l(o.$slots, "mobile-sidebar-footer")
168
+ ])) : d("", !0)
201
169
  ])
202
170
  ]),
203
171
  _: 2
204
172
  }, [
205
- e.$slots["mobile-sidebar-header"] || e.$slots.logo || e.$slots.center ? {
173
+ o.$slots["mobile-sidebar-header"] ? {
206
174
  name: "header",
207
- fn: $(() => [
208
- o(e.$slots, "mobile-sidebar-header", {}, () => [
209
- o(e.$slots, "logo", {}, () => [
210
- o(e.$slots, "center")
211
- ])
212
- ])
175
+ fn: w(() => [
176
+ l(o.$slots, "mobile-sidebar-header")
213
177
  ]),
214
178
  key: "0"
215
179
  } : void 0
@@ -1,4 +1,4 @@
1
- import { FilePickerValue } from '../FilePicker/FilePicker.vue';
1
+ import { FilePickerValue } from '../FilePicker/types';
2
2
  import { AvatarSize, AvatarRounded } from '../../types';
3
3
  export interface Props {
4
4
  modelValue?: any;
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as x, ref as w, computed as z, openBlock as i, createElementBlock as n, createElementVNode as b, normalizeClass as r, createVNode as o, withCtx as V, createCommentVNode as g, withModifiers as C } from "vue";
2
2
  import c from "../Icon.vue.js";
3
- import U from "../FilePicker/FilePicker.vue.js";
3
+ import U from "../FilePicker/index.vue.js";
4
4
  import $ from "../Avatar.vue.js";
5
5
  const A = ["data-testid"], R = ["onClick"], F = /* @__PURE__ */ x({
6
6
  name: "AvatarUploader",
@@ -0,0 +1,242 @@
1
+ import { defineComponent as N, computed as s, ref as R, watch as f, openBlock as Q, createBlock as U, resolveDynamicComponent as F } from "vue";
2
+ import { getComponentConfig as P } from "../../utils/configUtils.js";
3
+ import { calculateCartTotals as z } from "./composables/useCartCalculation.js";
4
+ import H from "./CartVariant1.vue.js";
5
+ import L from "./CartVariant2.vue.js";
6
+ import j from "./CartVariant3.vue.js";
7
+ import E from "./CartVariant4.vue.js";
8
+ const Y = /* @__PURE__ */ N({
9
+ __name: "Cart",
10
+ props: {
11
+ data: {},
12
+ variant: { default: "Variant1" },
13
+ actions: {},
14
+ features: {},
15
+ labels: {},
16
+ containerClass: {},
17
+ validateCoupon: {}
18
+ },
19
+ emits: ["update:quantity", "remove", "clear", "apply-coupon", "remove-coupon", "coupon-change", "continue", "continue-shopping", "update:coupon", "update:totals"],
20
+ setup(v, { emit: C }) {
21
+ const t = v, o = C, c = P("cart") || {}, g = s(() => {
22
+ switch (t.variant ?? c.variant ?? "Variant1") {
23
+ case "Variant2":
24
+ return L;
25
+ case "Variant3":
26
+ return j;
27
+ case "Variant4":
28
+ return E;
29
+ default:
30
+ return H;
31
+ }
32
+ }), h = s(() => {
33
+ const e = {
34
+ editableQuantity: !0,
35
+ removable: !0,
36
+ clearable: !0,
37
+ coupon: !0,
38
+ subtotal: !0,
39
+ discount: !0,
40
+ estimatedTax: !0,
41
+ shipping: !0,
42
+ totalSavings: !0,
43
+ continue: !0,
44
+ continueShopping: !0,
45
+ thumbnails: !0,
46
+ description: !0,
47
+ sku: !0,
48
+ itemVariant: !0,
49
+ emptyState: !0,
50
+ trustSignals: !0
51
+ }, n = c.features ?? {}, u = t.features ?? {}, i = t.data?.readonly ? { editableQuantity: !1, removable: !1, clearable: !1, coupon: !1 } : {};
52
+ return { ...e, ...n, ...u, ...i };
53
+ }), y = s(() => ({
54
+ showContinue: !0,
55
+ showContinueShopping: !0,
56
+ continueDisabled: !1,
57
+ continueShoppingDisabled: !1,
58
+ ...c.actions ?? {},
59
+ ...t.actions ?? {}
60
+ })), r = R(null), p = s(() => r.value ?? t.data.coupon), d = s(() => z({
61
+ items: t.data.items || [],
62
+ tax: t.data.tax,
63
+ shipping: t.data.shipping,
64
+ coupon: p.value,
65
+ currency: t.data.currency
66
+ }).totals);
67
+ s(() => t.data.totals === void 0);
68
+ const m = s(() => t.data.totals ? t.data.totals : d.value);
69
+ f(
70
+ m,
71
+ (e) => o("update:totals", e),
72
+ { deep: !0 }
73
+ );
74
+ const b = s(
75
+ () => !!t.validateCoupon || !!t.data.coupons?.length
76
+ );
77
+ f(
78
+ () => t.data.coupon,
79
+ (e) => {
80
+ e && r.value && e.code === r.value.code ? r.value = null : e || (r.value = null);
81
+ },
82
+ { deep: !0 }
83
+ );
84
+ async function k(e) {
85
+ const n = e.trim().toUpperCase(), u = d.value.subtotal, i = t.data.currency;
86
+ if (t.data.coupons?.length) {
87
+ const a = t.data.coupons.find(
88
+ (l) => l.code.trim().toUpperCase() === n
89
+ );
90
+ if (!a)
91
+ return {
92
+ ok: !1,
93
+ coupon: {
94
+ code: e,
95
+ state: "invalid",
96
+ message: `Coupon code "${e}" is not recognised.`
97
+ }
98
+ };
99
+ if (a.expiresAt) {
100
+ const l = a.expiresAt instanceof Date ? a.expiresAt : new Date(a.expiresAt);
101
+ if (!Number.isNaN(l.getTime()) && l.getTime() < Date.now())
102
+ return {
103
+ ok: !1,
104
+ coupon: {
105
+ code: e,
106
+ state: "expired",
107
+ message: `Coupon "${e}" expired on ${l.toLocaleDateString()}.`
108
+ }
109
+ };
110
+ }
111
+ return a.minSubtotal !== void 0 && u < a.minSubtotal ? {
112
+ ok: !1,
113
+ coupon: {
114
+ code: e,
115
+ state: "error",
116
+ message: `Add ${(a.minSubtotal - u).toFixed(2)} more to use "${e}".`
117
+ }
118
+ } : a.minItems !== void 0 && (t.data.items || []).reduce(
119
+ (B, I) => B + (I.quantity || 0),
120
+ 0
121
+ ) < a.minItems ? {
122
+ ok: !1,
123
+ coupon: {
124
+ code: e,
125
+ state: "error",
126
+ message: `"${e}" requires at least ${a.minItems} items.`
127
+ }
128
+ } : a.currency && i && a.currency !== i ? {
129
+ ok: !1,
130
+ coupon: {
131
+ code: e,
132
+ state: "error",
133
+ message: `"${e}" is only valid for ${a.currency} orders.`
134
+ }
135
+ } : { ok: !0, definition: a };
136
+ }
137
+ if (t.validateCoupon)
138
+ try {
139
+ const a = await t.validateCoupon(e, {
140
+ subtotal: u,
141
+ currency: i,
142
+ items: t.data.items || []
143
+ });
144
+ return a ? "type" in a ? { ok: !0, definition: a } : {
145
+ ok: !1,
146
+ coupon: {
147
+ code: e,
148
+ state: a.state || "error",
149
+ message: a.message
150
+ }
151
+ } : {
152
+ ok: !1,
153
+ coupon: {
154
+ code: e,
155
+ state: "invalid",
156
+ message: `Coupon code "${e}" is not recognised.`
157
+ }
158
+ };
159
+ } catch (a) {
160
+ return {
161
+ ok: !1,
162
+ coupon: {
163
+ code: e,
164
+ state: "error",
165
+ message: a?.message || `Could not validate "${e}". Please try again.`
166
+ }
167
+ };
168
+ }
169
+ return {
170
+ ok: !1,
171
+ coupon: { code: e, state: "error", message: "No coupon validator configured." }
172
+ };
173
+ }
174
+ function x(e, n) {
175
+ return {
176
+ code: n.code,
177
+ description: n.description,
178
+ state: "applied",
179
+ definition: n,
180
+ expiresAt: n.expiresAt
181
+ };
182
+ }
183
+ function $(e, n) {
184
+ o("update:quantity", e, n);
185
+ }
186
+ function _(e) {
187
+ o("remove", e);
188
+ }
189
+ function S() {
190
+ o("clear");
191
+ }
192
+ async function A(e) {
193
+ if (o("apply-coupon", e), !b.value)
194
+ return;
195
+ const n = e.trim();
196
+ r.value = { code: n, state: "applying" }, t.validateCoupon || await new Promise((i) => setTimeout(i, 120));
197
+ const u = await k(n);
198
+ if (u.ok === !0) {
199
+ const i = x(n, u.definition);
200
+ r.value = null, o("update:coupon", i);
201
+ } else
202
+ r.value = null, o("update:coupon", u.coupon);
203
+ }
204
+ function w() {
205
+ r.value = null, o("update:coupon", null), o("remove-coupon");
206
+ }
207
+ function V(e) {
208
+ o("coupon-change", e);
209
+ }
210
+ function D() {
211
+ o("continue");
212
+ }
213
+ function T() {
214
+ o("continue-shopping");
215
+ }
216
+ const q = s(() => ({
217
+ ...t.data,
218
+ items: t.data.items || [],
219
+ totals: m.value,
220
+ coupon: p.value
221
+ }));
222
+ return (e, n) => (Q(), U(F(g.value), {
223
+ data: q.value,
224
+ variant: t.variant,
225
+ actions: y.value,
226
+ features: h.value,
227
+ labels: t.labels,
228
+ "container-class": t.containerClass,
229
+ "onUpdate:quantity": $,
230
+ onRemove: _,
231
+ onClear: S,
232
+ onApplyCoupon: A,
233
+ onRemoveCoupon: w,
234
+ onCouponChange: V,
235
+ onContinue: D,
236
+ onContinueShopping: T
237
+ }, null, 40, ["data", "variant", "actions", "features", "labels", "container-class"]));
238
+ }
239
+ });
240
+ export {
241
+ Y as default
242
+ };
@@ -0,0 +1,4 @@
1
+ import f from "./Cart.vue.js";
2
+ export {
3
+ f as default
4
+ };