@oneclick.dev/cms-core-modules 0.0.117 → 0.0.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ContentEditor-DWoXc0T_.js → ContentEditor-BnOVpmsQ.js} +36 -36
- package/dist/{ContentEditor-CUe6-NwF.mjs → ContentEditor-Cm28u_14.mjs} +3289 -3251
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-BXTkYCm_.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-CcMEKZzd.mjs} +95 -95
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-C2zwt5UF.js → NewReservationDialog.vue_vue_type_script_setup_true_lang-CkFsdcvP.js} +1 -1
- package/dist/{TableView-BQI3CWll.mjs → TableView-Ctnep-Qu.mjs} +1174 -1161
- package/dist/TableView-DJqyJL9L.js +4 -0
- package/dist/agenda-BtmnpFmi.js +1 -0
- package/dist/agenda-D0QBOJUy.mjs +1258 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/index-BnFWz40Q.mjs +1261 -0
- package/dist/index-DcGPR_vt.js +35 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +5 -5
- package/dist/{orders-D41GbzIa.mjs → orders-C5NT99Fy.mjs} +82 -82
- package/dist/orders-lO3dZ5un.js +1 -0
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +1 -0
- package/dist/src/shims-vue.d.ts +6 -0
- package/dist/src/table/components/DataTableAction.vue.d.ts +1 -0
- package/dist/src/table/flow-builder-extensions/row-item.d.ts +5 -5
- package/package.json +2 -2
- package/dist/TableView-Cwal0BPW.js +0 -4
- package/dist/agenda-B3nj388v.mjs +0 -1253
- package/dist/agenda-Bev1mO7E.js +0 -1
- package/dist/index-Djp4EBb0.mjs +0 -1245
- package/dist/index-DliTZzwI.js +0 -35
- package/dist/orders-1swJVKw2.js +0 -1
package/dist/index.mjs
CHANGED
|
@@ -54,7 +54,7 @@ const I = "data:image/webp;base64,UklGRg5VAABXRUJQVlA4WAoAAAAMAAAA4wAA4wAAVlA4IJ
|
|
|
54
54
|
default: !1
|
|
55
55
|
}
|
|
56
56
|
}), l = [
|
|
57
|
-
{ path: "", component: () => import("./TableView-
|
|
57
|
+
{ path: "", component: () => import("./TableView-Ctnep-Qu.mjs") }
|
|
58
58
|
], p = [], rA = {
|
|
59
59
|
component: () => import("./index-Bkq58CeQ.mjs"),
|
|
60
60
|
metadata: C,
|
|
@@ -557,7 +557,7 @@ const I = "data:image/webp;base64,UklGRg5VAABXRUJQVlA4WAoAAAAMAAAA4wAA4wAAVlA4IJ
|
|
|
557
557
|
{ path: "", component: () => import("./Overview-lWAyyenp.mjs") },
|
|
558
558
|
{ path: "/collections", component: () => import("./Overview-lWAyyenp.mjs") },
|
|
559
559
|
{ path: "/collections/:collectionId", component: () => import("./Entries-BdhUyJR5.mjs") },
|
|
560
|
-
{ path: "/collections/:collectionId/:entryId", component: () => import("./ContentEditor-
|
|
560
|
+
{ path: "/collections/:collectionId/:entryId", component: () => import("./ContentEditor-Cm28u_14.mjs") },
|
|
561
561
|
{ path: "/components", component: () => import("./Components-iU3ZaJm5.mjs") },
|
|
562
562
|
{ path: "/global-styling", component: () => import("./GlobalStyling-Bp2PiOWt.mjs") }
|
|
563
563
|
], q = [
|
|
@@ -637,14 +637,14 @@ const I = "data:image/webp;base64,UklGRg5VAABXRUJQVlA4WAoAAAAMAAAA4wAA4wAAVlA4IJ
|
|
|
637
637
|
{ path: "/create/regular", component: () => import("./regular-_05oq5Tx.mjs") },
|
|
638
638
|
// { path: '/create/full-day', component: () => import('./pages/create/full-day.vue') },
|
|
639
639
|
// { path: '/create/multi-day', component: () => import('./pages/create/multi-day.vue') },
|
|
640
|
-
{ path: "/edit/:id", component: () => import("./index-
|
|
641
|
-
{ path: "/edit/:id/agenda", component: () => import("./agenda-
|
|
640
|
+
{ path: "/edit/:id", component: () => import("./index-BnFWz40Q.mjs") },
|
|
641
|
+
{ path: "/edit/:id/agenda", component: () => import("./agenda-D0QBOJUy.mjs") },
|
|
642
642
|
{ path: "/edit/:id/exceptions", component: () => import("./exceptions-Dgj54ULn.mjs") },
|
|
643
643
|
{ path: "/edit/:id/availability", component: () => import("./availability-D8JdA4rP.mjs") },
|
|
644
644
|
{ path: "/edit/:id/payment", component: () => import("./payment-D5j-68Ig.mjs") },
|
|
645
645
|
{ path: "/edit/:id/refunds", component: () => import("./refunds-D9nTeD2d.mjs") },
|
|
646
646
|
{ path: "/edit/:id/resources", component: () => import("./resources-CK0oWssj.mjs") },
|
|
647
|
-
{ path: "/edit/:id/orders", component: () => import("./orders-
|
|
647
|
+
{ path: "/edit/:id/orders", component: () => import("./orders-C5NT99Fy.mjs") },
|
|
648
648
|
{ path: "/edit/:id/booking-data", component: () => import("./booking-data-Px7XCIfU.mjs") }
|
|
649
649
|
], iA = [
|
|
650
650
|
{ key: "create-agendas", name: "Create agendas", description: "Team member can create agendas" },
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as ke, computed as k, ref as _, provide as be, onMounted as we, watch as
|
|
1
|
+
import { defineComponent as ke, computed as k, ref as _, provide as be, onMounted as we, watch as se, resolveComponent as b, openBlock as n, createElementBlock as l, Fragment as N, createVNode as r, withCtx as v, createElementVNode as a, unref as o, createTextVNode as w, renderList as L, toDisplayString as i, createBlock as ae, createCommentVNode as D, normalizeClass as De, withDirectives as Ce, isRef as oe, vModelText as Ie, normalizeStyle as ne, nextTick as Se } from "vue";
|
|
2
2
|
import { useRoute as Pe, useRouter as Ae, useOverlayParams as Ne, useModuleRoute as ze, useModule as Oe, useFirebaseIntegration as Te } from "@oneclick.dev/cms-kit";
|
|
3
|
-
import { ShoppingBag as
|
|
3
|
+
import { ShoppingBag as re, Users as E, ChevronLeft as je, ChevronRight as Re, RefreshCw as Fe, CalendarIcon as H, Search as Be, X as $e, Clock as le } from "lucide-vue-next";
|
|
4
4
|
import { u as Me, F as Ve, _ as q, a as Ue, b as Le } from "./OrderDetailDialog.vue_vue_type_script_setup_true_lang-DwAUYR8p.mjs";
|
|
5
5
|
import { _ as Ee } from "./EditLayout.vue_vue_type_script_setup_true_lang-pDO9b4Pv.mjs";
|
|
6
6
|
import { _ as He } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
7
7
|
const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4" }, Qe = { class: "text-2xl font-semibold tracking-tight flex items-center gap-2" }, Xe = { class: "flex gap-1 border rounded-lg p-1 w-fit" }, Ge = { class: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4" }, Je = { class: "flex items-center gap-1" }, Ke = { class: "flex items-center gap-1" }, We = { class: "flex items-center gap-2" }, Ze = { class: "flex items-center gap-1" }, et = { class: "mt-2 text-sm text-muted-foreground" }, tt = { class: "orders-date-trigger" }, st = { class: "relative mb-4" }, at = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "mb-3 text-sm text-muted-foreground"
|
|
10
|
-
},
|
|
10
|
+
}, ot = {
|
|
11
11
|
key: 1,
|
|
12
12
|
class: "flex items-center justify-center py-8"
|
|
13
|
-
},
|
|
13
|
+
}, nt = {
|
|
14
14
|
key: 2,
|
|
15
15
|
class: "text-center py-8 text-muted-foreground"
|
|
16
16
|
}, rt = {
|
|
@@ -84,11 +84,11 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
84
84
|
setup(ts) {
|
|
85
85
|
const Y = Pe();
|
|
86
86
|
Ae();
|
|
87
|
-
const Q = Ne(), { params: T } = ze(), { config: z } = Oe(), j = Te(z.project), X = k(() => T.value?.id ?? T.id ?? ""), { metadataSchema: R } = Me(X), x = _([]), S = _([]), P = _(!0), F = _(null), y = _(""), A = _(null), B = _(null), I = _("confirmed"), C = /* @__PURE__ */ new Date(), m = _(/* @__PURE__ */ new Date()), G = _(null),
|
|
87
|
+
const Q = Ne(), { params: T } = ze(), { config: z } = Oe(), j = Te(z.project), X = k(() => T.value?.id ?? T.id ?? ""), { metadataSchema: R } = Me(X), x = _([]), S = _([]), P = _(!0), F = _(null), y = _(""), A = _(null), B = _(null), I = _("confirmed"), C = /* @__PURE__ */ new Date(), m = _(/* @__PURE__ */ new Date()), G = _(null), ie = k(() => ({
|
|
88
88
|
date: J(m.value),
|
|
89
89
|
resource: null
|
|
90
90
|
}));
|
|
91
|
-
be("event",
|
|
91
|
+
be("event", ie);
|
|
92
92
|
const $ = k({
|
|
93
93
|
get: () => J(m.value),
|
|
94
94
|
set: (t) => {
|
|
@@ -98,7 +98,7 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
98
98
|
}
|
|
99
99
|
m.value = /* @__PURE__ */ new Date(`${t}T00:00:00`);
|
|
100
100
|
}
|
|
101
|
-
}),
|
|
101
|
+
}), de = () => {
|
|
102
102
|
const t = G.value;
|
|
103
103
|
if (t) {
|
|
104
104
|
if (typeof t.showPicker == "function") {
|
|
@@ -107,7 +107,7 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
107
107
|
}
|
|
108
108
|
t.focus(), t.click();
|
|
109
109
|
}
|
|
110
|
-
},
|
|
110
|
+
}, ce = k(() => {
|
|
111
111
|
const t = new Date(C);
|
|
112
112
|
t.setDate(C.getDate() - 1);
|
|
113
113
|
const e = new Date(C);
|
|
@@ -117,16 +117,16 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
117
117
|
day: "numeric",
|
|
118
118
|
year: "numeric"
|
|
119
119
|
});
|
|
120
|
-
}),
|
|
120
|
+
}), ue = () => {
|
|
121
121
|
const t = new Date(m.value);
|
|
122
122
|
t.setDate(t.getDate() - 1), m.value = t;
|
|
123
|
-
},
|
|
123
|
+
}, me = () => {
|
|
124
124
|
const t = new Date(m.value);
|
|
125
125
|
t.setDate(t.getDate() + 1), t <= C && (m.value = t);
|
|
126
|
-
},
|
|
126
|
+
}, fe = k(() => {
|
|
127
127
|
const t = new Date(m.value);
|
|
128
128
|
return t.setDate(t.getDate() + 1), t <= C;
|
|
129
|
-
}),
|
|
129
|
+
}), ve = () => {
|
|
130
130
|
m.value = /* @__PURE__ */ new Date();
|
|
131
131
|
}, J = (t) => {
|
|
132
132
|
const e = t.getFullYear(), d = String(t.getMonth() + 1).padStart(2, "0"), u = String(t.getDate()).padStart(2, "0");
|
|
@@ -192,7 +192,7 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
192
192
|
],
|
|
193
193
|
threshold: 0.3,
|
|
194
194
|
ignoreLocation: !0
|
|
195
|
-
}).search(y.value).map((e) => e.item) : x.value),
|
|
195
|
+
}).search(y.value).map((e) => e.item) : x.value), ee = k(() => {
|
|
196
196
|
const t = /* @__PURE__ */ new Map();
|
|
197
197
|
for (const e of V.value) {
|
|
198
198
|
t.has(e.id) || t.set(e.id, {
|
|
@@ -210,10 +210,10 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
210
210
|
d.reservations.push(e), d.totalPrice = typeof e.total == "number" ? e.total : d.totalPrice + (e.reservationPrice || 0), d.totalSpots += e.spots || 0;
|
|
211
211
|
}
|
|
212
212
|
return Array.from(t.values());
|
|
213
|
-
}), O = k(() => ({
|
|
213
|
+
}), O = k(() => (console.log("orderssss", x.value), {
|
|
214
214
|
spots: x.value.reduce((t, e) => t + (e.spots || 0), 0),
|
|
215
215
|
bookings: x.value.length,
|
|
216
|
-
revenue:
|
|
216
|
+
revenue: ee.value.reduce((t, e) => t + (e.totalPrice || 0), 0)
|
|
217
217
|
})), pe = () => {
|
|
218
218
|
y.value = "";
|
|
219
219
|
}, xe = async () => {
|
|
@@ -251,7 +251,7 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
251
251
|
}
|
|
252
252
|
}, ge = async () => {
|
|
253
253
|
await xe(), await h();
|
|
254
|
-
},
|
|
254
|
+
}, te = async (t, e) => {
|
|
255
255
|
const d = await j.get(z.reservationsCollection, t);
|
|
256
256
|
if (!d) return;
|
|
257
257
|
const u = { ...d, id: d.id || t }, p = (u.reservations || []).map((f) => Z(u, f));
|
|
@@ -279,31 +279,31 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
279
279
|
const t = Q.value.orderId || Y.query.orderId, e = Q.value.reservationId || Y.query.reservationId;
|
|
280
280
|
if (t) {
|
|
281
281
|
const d = new URL(window.location.href);
|
|
282
|
-
d.searchParams.delete("orderId"), d.searchParams.delete("reservationId"), window.history.replaceState(window.history.state, "", d.toString()), await
|
|
282
|
+
d.searchParams.delete("orderId"), d.searchParams.delete("reservationId"), window.history.replaceState(window.history.state, "", d.toString()), await te(t, e);
|
|
283
283
|
}
|
|
284
|
-
}),
|
|
284
|
+
}), se(m, () => {
|
|
285
285
|
h();
|
|
286
|
-
}),
|
|
286
|
+
}), se(I, () => {
|
|
287
287
|
h();
|
|
288
288
|
}), (t, e) => {
|
|
289
289
|
const d = b("Button"), u = b("Badge"), p = b("CardTitle"), f = b("CardDescription"), g = b("CardHeader"), U = b("Input"), ye = b("CardContent"), he = b("Card");
|
|
290
|
-
return
|
|
290
|
+
return n(), l(N, null, [
|
|
291
291
|
r(Ee, null, {
|
|
292
292
|
default: v(() => [
|
|
293
293
|
a("div", qe, [
|
|
294
294
|
a("div", Ye, [
|
|
295
295
|
a("div", null, [
|
|
296
296
|
a("h1", Qe, [
|
|
297
|
-
r(
|
|
297
|
+
r(o(re), { class: "size-6" }),
|
|
298
298
|
e[4] || (e[4] = w(" Orders ", -1))
|
|
299
299
|
]),
|
|
300
300
|
e[5] || (e[5] = a("p", { class: "text-muted-foreground text-sm mt-1" }, " View orders by when they were placed ", -1))
|
|
301
301
|
])
|
|
302
302
|
]),
|
|
303
303
|
a("div", Xe, [
|
|
304
|
-
(
|
|
304
|
+
(n(), l(N, null, L(["confirmed", "pending", "cancelled"], (s) => r(d, {
|
|
305
305
|
key: s,
|
|
306
|
-
variant:
|
|
306
|
+
variant: o(I) === s ? "default" : "ghost",
|
|
307
307
|
size: "sm",
|
|
308
308
|
class: "capitalize",
|
|
309
309
|
onClick: (c) => I.value = s
|
|
@@ -323,12 +323,12 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
323
323
|
r(p, { class: "flex items-center gap-2" }, {
|
|
324
324
|
default: v(() => [
|
|
325
325
|
e[6] || (e[6] = w(" Orders received ", -1)),
|
|
326
|
-
|
|
326
|
+
o(O).bookings > 0 ? (n(), ae(u, {
|
|
327
327
|
key: 0,
|
|
328
328
|
variant: "secondary"
|
|
329
329
|
}, {
|
|
330
330
|
default: v(() => [
|
|
331
|
-
w(i(
|
|
331
|
+
w(i(o(O).bookings), 1)
|
|
332
332
|
]),
|
|
333
333
|
_: 1
|
|
334
334
|
})) : D("", !0)
|
|
@@ -338,10 +338,10 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
338
338
|
r(f, { class: "flex items-center gap-4 mt-1" }, {
|
|
339
339
|
default: v(() => [
|
|
340
340
|
a("span", Je, [
|
|
341
|
-
r(
|
|
342
|
-
w(" " + i(
|
|
341
|
+
r(o(E), { size: 14 }),
|
|
342
|
+
w(" " + i(o(O).spots) + " spots ", 1)
|
|
343
343
|
]),
|
|
344
|
-
a("span", Ke, " €" + i(
|
|
344
|
+
a("span", Ke, " €" + i(o(O).revenue.toFixed(2)) + i(o(I) === "pending" ? " pending " : o(I) === "cancelled" ? " cancelled " : " ") + "revenue ", 1)
|
|
345
345
|
]),
|
|
346
346
|
_: 1
|
|
347
347
|
})
|
|
@@ -352,10 +352,10 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
352
352
|
variant: "outline",
|
|
353
353
|
size: "icon",
|
|
354
354
|
class: "size-8",
|
|
355
|
-
onClick:
|
|
355
|
+
onClick: ue
|
|
356
356
|
}, {
|
|
357
357
|
default: v(() => [
|
|
358
|
-
r(
|
|
358
|
+
r(o(je), { size: 16 })
|
|
359
359
|
]),
|
|
360
360
|
_: 1
|
|
361
361
|
}),
|
|
@@ -363,7 +363,7 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
363
363
|
variant: "outline",
|
|
364
364
|
size: "sm",
|
|
365
365
|
class: "h-8 px-3 text-xs",
|
|
366
|
-
onClick:
|
|
366
|
+
onClick: ve
|
|
367
367
|
}, {
|
|
368
368
|
default: v(() => [...e[7] || (e[7] = [
|
|
369
369
|
w(" Today ", -1)
|
|
@@ -374,11 +374,11 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
374
374
|
variant: "outline",
|
|
375
375
|
size: "icon",
|
|
376
376
|
class: "size-8",
|
|
377
|
-
onClick:
|
|
378
|
-
disabled: !
|
|
377
|
+
onClick: me,
|
|
378
|
+
disabled: !o(fe)
|
|
379
379
|
}, {
|
|
380
380
|
default: v(() => [
|
|
381
|
-
r(
|
|
381
|
+
r(o(Re), { size: 16 })
|
|
382
382
|
]),
|
|
383
383
|
_: 1
|
|
384
384
|
}, 8, ["disabled"])
|
|
@@ -387,12 +387,12 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
387
387
|
variant: "outline",
|
|
388
388
|
size: "icon",
|
|
389
389
|
onClick: h,
|
|
390
|
-
disabled:
|
|
390
|
+
disabled: o(P)
|
|
391
391
|
}, {
|
|
392
392
|
default: v(() => [
|
|
393
|
-
r(
|
|
393
|
+
r(o(Fe), {
|
|
394
394
|
size: 16,
|
|
395
|
-
class: De({ "animate-spin":
|
|
395
|
+
class: De({ "animate-spin": o(P) })
|
|
396
396
|
}, null, 8, ["class"])
|
|
397
397
|
]),
|
|
398
398
|
_: 1
|
|
@@ -404,23 +404,23 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
404
404
|
r(d, {
|
|
405
405
|
type: "button",
|
|
406
406
|
variant: "outline",
|
|
407
|
-
onClick:
|
|
407
|
+
onClick: de
|
|
408
408
|
}, {
|
|
409
409
|
default: v(() => [
|
|
410
|
-
r(
|
|
411
|
-
w(" " + i(
|
|
410
|
+
r(o(H), { class: "size-4" }),
|
|
411
|
+
w(" " + i(o(ce)), 1)
|
|
412
412
|
]),
|
|
413
413
|
_: 1
|
|
414
414
|
}),
|
|
415
415
|
Ce(a("input", {
|
|
416
416
|
ref_key: "dateInputRef",
|
|
417
417
|
ref: G,
|
|
418
|
-
"onUpdate:modelValue": e[0] || (e[0] = (s) =>
|
|
418
|
+
"onUpdate:modelValue": e[0] || (e[0] = (s) => oe($) ? $.value = s : null),
|
|
419
419
|
type: "date",
|
|
420
420
|
class: "orders-date-picker",
|
|
421
421
|
"aria-label": "Select order date"
|
|
422
422
|
}, null, 512), [
|
|
423
|
-
[Ie,
|
|
423
|
+
[Ie, o($)]
|
|
424
424
|
])
|
|
425
425
|
])
|
|
426
426
|
])
|
|
@@ -430,17 +430,17 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
430
430
|
r(ye, null, {
|
|
431
431
|
default: v(() => [
|
|
432
432
|
a("div", st, [
|
|
433
|
-
r(
|
|
433
|
+
r(o(Be), {
|
|
434
434
|
size: 16,
|
|
435
435
|
class: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
|
|
436
436
|
}),
|
|
437
437
|
r(U, {
|
|
438
|
-
modelValue:
|
|
439
|
-
"onUpdate:modelValue": e[1] || (e[1] = (s) =>
|
|
438
|
+
modelValue: o(y),
|
|
439
|
+
"onUpdate:modelValue": e[1] || (e[1] = (s) => oe(y) ? y.value = s : null),
|
|
440
440
|
placeholder: "Search by name, email, or phone...",
|
|
441
441
|
class: "pl-9 pr-9"
|
|
442
442
|
}, null, 8, ["modelValue"]),
|
|
443
|
-
|
|
443
|
+
o(y) ? (n(), ae(d, {
|
|
444
444
|
key: 0,
|
|
445
445
|
variant: "ghost",
|
|
446
446
|
size: "icon",
|
|
@@ -448,26 +448,26 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
448
448
|
onClick: pe
|
|
449
449
|
}, {
|
|
450
450
|
default: v(() => [
|
|
451
|
-
r(
|
|
451
|
+
r(o($e), { size: 14 })
|
|
452
452
|
]),
|
|
453
453
|
_: 1
|
|
454
454
|
})) : D("", !0)
|
|
455
455
|
]),
|
|
456
|
-
|
|
457
|
-
|
|
456
|
+
o(y) ? (n(), l("div", at, " Showing " + i(o(V).length) + " of " + i(o(x).length) + " orders ", 1)) : D("", !0),
|
|
457
|
+
o(P) ? (n(), l("div", ot, [...e[8] || (e[8] = [
|
|
458
458
|
a("div", { class: "animate-spin rounded-full h-8 w-8 border-b-2 border-primary" }, null, -1)
|
|
459
|
-
])])) :
|
|
460
|
-
r(
|
|
459
|
+
])])) : o(x).length === 0 ? (n(), l("div", nt, [
|
|
460
|
+
r(o(re), { class: "size-12 mx-auto mb-3 opacity-50" }),
|
|
461
461
|
e[9] || (e[9] = a("p", null, "No orders received on this day", -1))
|
|
462
|
-
])) :
|
|
463
|
-
(
|
|
462
|
+
])) : o(V).length === 0 ? (n(), l("div", rt, " No orders match your search ")) : (n(), l("div", lt, [
|
|
463
|
+
(n(!0), l(N, null, L(o(ee), (s) => (n(), l("div", {
|
|
464
464
|
key: s.id,
|
|
465
465
|
class: "border rounded-lg overflow-hidden shadow-sm"
|
|
466
466
|
}, [
|
|
467
|
-
s.reservations.length === 1 ? (
|
|
467
|
+
s.reservations.length === 1 ? (n(), l("div", {
|
|
468
468
|
key: 0,
|
|
469
469
|
class: "p-3 hover:bg-muted/50 transition-colors cursor-pointer",
|
|
470
|
-
onClick: (c) =>
|
|
470
|
+
onClick: (c) => o(A)?.openDialog(s.reservations[0])
|
|
471
471
|
}, [
|
|
472
472
|
a("div", dt, [
|
|
473
473
|
a("div", ct, [
|
|
@@ -476,14 +476,14 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
476
476
|
a("div", ft, i(s.customerInfo?.phone), 1),
|
|
477
477
|
a("div", vt, [
|
|
478
478
|
a("div", pt, [
|
|
479
|
-
r(
|
|
479
|
+
r(o(H), { size: 12 }),
|
|
480
480
|
a("span", null, i(W(s.reservations[0].date)) + " · " + i(s.reservations[0].startTime) + " - " + i(s.reservations[0].endTime), 1)
|
|
481
481
|
]),
|
|
482
482
|
a("div", xt, [
|
|
483
|
-
r(
|
|
483
|
+
r(o(E), { size: 12 }),
|
|
484
484
|
a("span", null, i(s.reservations[0].spots) + " spots", 1)
|
|
485
485
|
]),
|
|
486
|
-
s.reservations[0].resourceName ? (
|
|
486
|
+
s.reservations[0].resourceName ? (n(), l("div", gt, [
|
|
487
487
|
a("div", {
|
|
488
488
|
class: "w-3 h-3 rounded-full",
|
|
489
489
|
style: ne({ backgroundColor: s.reservations[0].resourceColor || "#6b7280" })
|
|
@@ -492,26 +492,26 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
492
492
|
])) : D("", !0)
|
|
493
493
|
]),
|
|
494
494
|
a("div", _t, [
|
|
495
|
-
r(
|
|
495
|
+
r(o(le), { size: 12 }),
|
|
496
496
|
a("span", null, "Ordered at " + i(K(s.createdAt)), 1)
|
|
497
497
|
]),
|
|
498
498
|
r(q, {
|
|
499
499
|
metadata: { ...s.reservations[0].metadata, ...s.reservations[0].reservationMetadata },
|
|
500
|
-
schema:
|
|
500
|
+
schema: o(R),
|
|
501
501
|
"display-filter": ["highlight", "badge"],
|
|
502
502
|
compact: "",
|
|
503
503
|
class: "mt-1"
|
|
504
504
|
}, null, 8, ["metadata", "schema"])
|
|
505
505
|
]),
|
|
506
506
|
a("div", yt, [
|
|
507
|
-
s.reservations[0].status === "pending" ? (
|
|
508
|
-
s.reservations[0].reservationPrice || s.reservations[0].reservationPrice === 0 ? (
|
|
507
|
+
s.reservations[0].status === "pending" ? (n(), l("span", ht, "Pending")) : s.reservations[0].status === "cancelled" ? (n(), l("span", kt, "Cancelled")) : s.reservations[0].reservationStatus === "needs_approval" ? (n(), l("span", bt, "Needs Approval")) : s.reservations[0].reservationStatus === "approved" ? (n(), l("span", wt, "Approved")) : s.reservations[0].reservationStatus === "cancelled" ? (n(), l("span", Dt, "Cancelled")) : s.reservations[0].reservationStatus === "rejected" ? (n(), l("span", Ct, "Rejected")) : (n(), l("span", It, "Pending")),
|
|
508
|
+
s.reservations[0].reservationPrice || s.reservations[0].reservationPrice === 0 ? (n(), l("div", St, " €" + i(s.totalPrice.toFixed(2)), 1)) : D("", !0)
|
|
509
509
|
])
|
|
510
510
|
])
|
|
511
|
-
], 8, it)) : (
|
|
511
|
+
], 8, it)) : (n(), l(N, { key: 1 }, [
|
|
512
512
|
a("div", {
|
|
513
513
|
class: "p-3 bg-muted/30 hover:bg-muted/50 transition-colors cursor-pointer",
|
|
514
|
-
onClick: (c) =>
|
|
514
|
+
onClick: (c) => o(B)?.openDialog(s)
|
|
515
515
|
}, [
|
|
516
516
|
a("div", At, [
|
|
517
517
|
a("div", Nt, [
|
|
@@ -530,39 +530,39 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
530
530
|
a("div", Tt, i(s.customerInfo?.email), 1),
|
|
531
531
|
a("div", jt, i(s.customerInfo?.phone), 1),
|
|
532
532
|
a("div", Rt, [
|
|
533
|
-
r(
|
|
533
|
+
r(o(le), { size: 12 }),
|
|
534
534
|
a("span", null, "Ordered at " + i(K(s.createdAt)), 1)
|
|
535
535
|
]),
|
|
536
536
|
r(q, {
|
|
537
537
|
metadata: s.metadata,
|
|
538
|
-
schema:
|
|
538
|
+
schema: o(R),
|
|
539
539
|
"display-filter": ["highlight", "badge"],
|
|
540
540
|
compact: "",
|
|
541
541
|
class: "mt-1"
|
|
542
542
|
}, null, 8, ["metadata", "schema"])
|
|
543
543
|
]),
|
|
544
544
|
a("div", Ft, [
|
|
545
|
-
s.status === "pending" ? (
|
|
545
|
+
s.status === "pending" ? (n(), l("span", Bt, "Pending")) : s.status === "cancelled" ? (n(), l("span", $t, "Cancelled")) : (n(), l("span", Mt, "Confirmed")),
|
|
546
546
|
a("div", Vt, " €" + i(s.totalPrice.toFixed(2)), 1)
|
|
547
547
|
])
|
|
548
548
|
])
|
|
549
549
|
], 8, Pt),
|
|
550
|
-
(
|
|
550
|
+
(n(!0), l(N, null, L(s.reservations, (c) => (n(), l("div", {
|
|
551
551
|
key: c.res_id,
|
|
552
552
|
class: "p-3 border-t bg-muted/50 dark:bg-transparent dark:hover:bg-muted/50 transition-colors cursor-pointer",
|
|
553
|
-
onClick: (ss) =>
|
|
553
|
+
onClick: (ss) => o(A)?.openDialog(c)
|
|
554
554
|
}, [
|
|
555
555
|
a("div", Lt, [
|
|
556
556
|
a("div", Et, [
|
|
557
557
|
a("div", Ht, [
|
|
558
|
-
r(
|
|
558
|
+
r(o(H), { size: 12 }),
|
|
559
559
|
a("span", null, i(W(c.date)) + " · " + i(c.startTime) + " - " + i(c.endTime), 1)
|
|
560
560
|
]),
|
|
561
561
|
a("div", qt, [
|
|
562
|
-
r(
|
|
562
|
+
r(o(E), { size: 12 }),
|
|
563
563
|
a("span", null, i(c.spots) + " spots", 1)
|
|
564
564
|
]),
|
|
565
|
-
c.resourceName ? (
|
|
565
|
+
c.resourceName ? (n(), l("div", Yt, [
|
|
566
566
|
a("div", {
|
|
567
567
|
class: "w-3 h-3 rounded-full",
|
|
568
568
|
style: ne({ backgroundColor: c.resourceColor || "#6b7280" })
|
|
@@ -570,14 +570,14 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
570
570
|
a("span", null, i(c.resourceName), 1)
|
|
571
571
|
])) : D("", !0)
|
|
572
572
|
]),
|
|
573
|
-
c.status === "confirmed" ? (
|
|
574
|
-
c.reservationStatus === "needs_approval" ? (
|
|
575
|
-
c.reservationPrice || c.reservationPrice === 0 ? (
|
|
573
|
+
c.status === "confirmed" ? (n(), l("div", Qt, [
|
|
574
|
+
c.reservationStatus === "needs_approval" ? (n(), l("span", Xt, "Needs Approval")) : c.reservationStatus === "approved" ? (n(), l("span", Gt, "Approved")) : c.reservationStatus === "cancelled" ? (n(), l("span", Jt, "Cancelled")) : c.reservationStatus === "rejected" ? (n(), l("span", Kt, "Rejected")) : (n(), l("span", Wt, "Pending")),
|
|
575
|
+
c.reservationPrice || c.reservationPrice === 0 ? (n(), l("div", Zt, " €" + i(c.reservationPrice.toFixed(2)), 1)) : D("", !0)
|
|
576
576
|
])) : D("", !0)
|
|
577
577
|
]),
|
|
578
578
|
r(q, {
|
|
579
579
|
metadata: c.reservationMetadata,
|
|
580
|
-
schema:
|
|
580
|
+
schema: o(R),
|
|
581
581
|
"display-filter": ["highlight", "badge"],
|
|
582
582
|
compact: "",
|
|
583
583
|
class: "mt-1"
|
|
@@ -599,26 +599,26 @@ const qe = { class: "space-y-6" }, Ye = { class: "flex flex-col sm:flex-row sm:i
|
|
|
599
599
|
r(Ue, {
|
|
600
600
|
ref_key: "reservationDetailDialog",
|
|
601
601
|
ref: A,
|
|
602
|
-
"agenda-data":
|
|
603
|
-
resources:
|
|
602
|
+
"agenda-data": o(F),
|
|
603
|
+
resources: o(S),
|
|
604
604
|
"show-order-link": "",
|
|
605
605
|
onCancelled: h,
|
|
606
606
|
onConfirmed: h,
|
|
607
607
|
onRejected: h,
|
|
608
608
|
onTransferred: h,
|
|
609
|
-
onOpenOrder: e[2] || (e[2] = (s) =>
|
|
609
|
+
onOpenOrder: e[2] || (e[2] = (s) => te(s))
|
|
610
610
|
}, null, 8, ["agenda-data", "resources"]),
|
|
611
611
|
r(Le, {
|
|
612
612
|
ref_key: "orderDetailDialog",
|
|
613
613
|
ref: B,
|
|
614
|
-
"agenda-data":
|
|
615
|
-
resources:
|
|
614
|
+
"agenda-data": o(F),
|
|
615
|
+
resources: o(S),
|
|
616
616
|
onOpenReservation: e[3] || (e[3] = (s) => _e(s))
|
|
617
617
|
}, null, 8, ["agenda-data", "resources"])
|
|
618
618
|
], 64);
|
|
619
619
|
};
|
|
620
620
|
}
|
|
621
|
-
}), ds = /* @__PURE__ */ He(es, [["__scopeId", "data-v-
|
|
621
|
+
}), ds = /* @__PURE__ */ He(es, [["__scopeId", "data-v-3e5d1883"]]);
|
|
622
622
|
export {
|
|
623
623
|
ds as default
|
|
624
624
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("@oneclick.dev/cms-kit"),d=require("lucide-vue-next"),v=require("./OrderDetailDialog.vue_vue_type_script_setup_true_lang-BYSeUW_V.js"),oe=require("./EditLayout.vue_vue_type_script_setup_true_lang-gozJKXvM.js"),ne=require("./_plugin-vue_export-helper-BHFhmbuH.js"),ae={class:"space-y-6"},re={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},se={class:"text-2xl font-semibold tracking-tight flex items-center gap-2"},le={class:"flex gap-1 border rounded-lg p-1 w-fit"},ce={class:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4"},de={class:"flex items-center gap-1"},ie={class:"flex items-center gap-1"},ue={class:"flex items-center gap-2"},me={class:"flex items-center gap-1"},fe={class:"mt-2 text-sm text-muted-foreground"},pe={class:"orders-date-trigger"},ge={class:"relative mb-4"},ve={key:0,class:"mb-3 text-sm text-muted-foreground"},xe={key:1,class:"flex items-center justify-center py-8"},ke={key:2,class:"text-center py-8 text-muted-foreground"},_e={key:3,class:"text-center py-8 text-muted-foreground"},ye={key:4,class:"space-y-2"},he=["onClick"],Ne={class:"flex items-start justify-between"},Ve={class:"flex-1"},we={class:"font-medium"},be={class:"text-sm text-muted-foreground"},De={class:"text-sm text-muted-foreground"},Ee={class:"flex items-center gap-4 flex-wrap mt-1"},Ce={class:"flex items-center gap-2 text-xs text-muted-foreground"},Se={class:"flex items-center gap-2 text-xs text-muted-foreground"},Be={key:0,class:"flex items-center gap-1 text-xs text-muted-foreground"},Ie={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},Pe={class:"text-right"},Te={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},Ae={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},ze={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},Oe={key:3,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},je={key:4,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Re={key:5,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},Fe={key:6,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},Le={key:7,class:"text-sm font-medium mt-1"},Me=["onClick"],Ue={class:"flex items-start justify-between"},qe={class:"flex-1"},$e={class:"flex items-center gap-2"},He={class:"font-medium"},Ye={class:"text-sm text-muted-foreground"},Ke={class:"text-sm text-muted-foreground"},Qe={class:"flex items-center gap-2 mt-1 text-xs text-muted-foreground"},Xe={class:"text-right"},Ge={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},Je={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},We={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},Ze={class:"text-sm font-medium mt-1"},et=["onClick"],tt={class:"flex items-center justify-between"},ot={class:"flex items-center gap-4 flex-wrap"},nt={class:"flex items-center gap-2 text-xs text-muted-foreground"},at={class:"flex items-center gap-2 text-xs text-muted-foreground"},rt={key:0,class:"flex items-center gap-1 text-xs text-muted-foreground"},st={key:0,class:"text-right flex items-center gap-2"},lt={key:0,class:"inline-block px-2 py-1 text-xs rounded-full bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-400"},ct={key:1,class:"inline-block px-2 py-1 text-xs rounded-full bg-green-100 text-green-800 dark:bg-green-900/30 dark:text-green-400"},dt={key:2,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},it={key:3,class:"inline-block px-2 py-1 text-xs rounded-full bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-400"},ut={key:4,class:"inline-block px-2 py-1 text-xs rounded-full bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-400"},mt={key:5,class:"text-sm font-medium"},ft=e.defineComponent({__name:"orders",setup(gt){const T=k.useRoute();k.useRouter();const A=k.useOverlayParams(),{params:w}=k.useModuleRoute(),{config:N}=k.useModule(),b=k.useFirebaseIntegration(N.project),z=e.computed(()=>w.value?.id??w.id??""),{metadataSchema:D}=v.useAgendaMetadataSchema(z),u=e.ref([]),_=e.ref([]),y=e.ref(!0),E=e.ref(null),f=e.ref(""),h=e.ref(null),C=e.ref(null),x=e.ref("confirmed"),g=new Date,l=e.ref(new Date),O=e.ref(null),q=e.computed(()=>({date:j(l.value),resource:null}));e.provide("event",q);const S=e.computed({get:()=>j(l.value),set:o=>{if(!o){l.value=new Date;return}l.value=new Date(`${o}T00:00:00`)}}),$=()=>{const o=O.value;if(o){if(typeof o.showPicker=="function"){o.showPicker();return}o.focus(),o.click()}},H=e.computed(()=>{const o=new Date(g);o.setDate(g.getDate()-1);const t=new Date(g);return t.setDate(g.getDate()+1),l.value.toDateString()===g.toDateString()?"Today":l.value.toDateString()===o.toDateString()?"Yesterday":l.value.toDateString()===t.toDateString()?"Tomorrow":l.value.toLocaleDateString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric"})}),Y=()=>{const o=new Date(l.value);o.setDate(o.getDate()-1),l.value=o},K=()=>{const o=new Date(l.value);o.setDate(o.getDate()+1),o<=g&&(l.value=o)},Q=e.computed(()=>{const o=new Date(l.value);return o.setDate(o.getDate()+1),o<=g}),X=()=>{l.value=new Date},j=o=>{const t=o.getFullYear(),a=String(o.getMonth()+1).padStart(2,"0"),s=String(o.getDate()).padStart(2,"0");return`${t}-${a}-${s}`},R=o=>o?new Date(o).toLocaleTimeString("en-US",{hour:"2-digit",minute:"2-digit",hour12:!1}):"",F=o=>o?new Date(o).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"}):"",L=(o,t)=>{const a=_.value.find(i=>i.id===t.resourceId),s=o.id||o.orderId||t.orderId||"";return{customerInfo:o.customerInfo,amountDue:o.amountDue,amountPaid:o.amountPaid,status:o.status,reservationStatus:t.status,subtotal:o.subtotal,total:o.total,discount:o.discount,id:s,res_id:t.id,resourceId:t.resourceId,spots:t.spots,date:t.date,createdAt:o.createdAt,startTime:t.timeslot?.startTime,endTime:t.timeslot?.endTime,reservationPrice:t.totalPrice,reservationBasePrice:t.basePrice,reservationAddOnsPrice:t.addOnsPrice,pricingOptionId:t.pricingOptionId,pricingOption:t.pricingOption,resourceName:a?.name,resourceColor:a?.color,metadata:o.metadata||{},reservationMetadata:t.metadata||{},refundStatus:t.refundStatus,refundedAt:t.refundedAt,refundedAmount:t.refundedAmount,refunds:Array.isArray(t.refunds)?t.refunds:[],adjustments:o.adjustments||[],reservationAdjustments:t.adjustments||[]}},B=async()=>{await e.nextTick(),await new Promise(o=>{if(typeof requestAnimationFrame=="function"){requestAnimationFrame(()=>o());return}o()})},I=e.computed(()=>f.value.trim()?new v.Fuse(u.value,{keys:["customerInfo.firstName","customerInfo.lastName","customerInfo.email","customerInfo.phone","resourceName"],threshold:.3,ignoreLocation:!0}).search(f.value).map(t=>t.item):u.value),M=e.computed(()=>{const o=new Map;for(const t of I.value){o.has(t.id)||o.set(t.id,{id:t.id,customerInfo:t.customerInfo,status:t.status,createdAt:t.createdAt,metadata:t.metadata||{},reservations:[],adjustments:t.adjustments||[],totalPrice:0,totalSpots:0});const a=o.get(t.id);a.reservations.push(t),a.totalPrice=typeof t.total=="number"?t.total:a.totalPrice+(t.reservationPrice||0),a.totalSpots+=t.spots||0}return Array.from(o.values())}),V=e.computed(()=>(console.log("orderssss",u.value),{spots:u.value.reduce((o,t)=>o+(t.spots||0),0),bookings:u.value.length,revenue:M.value.reduce((o,t)=>o+(t.totalPrice||0),0)})),G=()=>{f.value=""},J=async()=>{try{const o=await b.get(N.agendaCollection,z.value);E.value=o,_.value=o?.resources?.filter(t=>t.isActive)||[]}catch(o){console.error("Error loading resources:",o),_.value=[]}},p=async()=>{y.value=!0,u.value=[];try{const o=w.value.id,t=new Date(l.value);t.setHours(0,0,0,0);const a=new Date(l.value);a.setHours(23,59,59,999);const s=await b.find(N.reservationsCollection,{filters:[{field:"agendaId",operator:"==",value:o},{field:"createdAt",operator:">=",value:t.toISOString()},{field:"createdAt",operator:"<=",value:a.toISOString()},{field:"status",operator:"==",value:x.value}]});let i=[];s.forEach(c=>{(c.reservations||[]).forEach(P=>{i.push(L(c,P))})}),u.value=i.sort((c,m)=>(m.createdAt||"").localeCompare(c.createdAt||""))}catch(o){console.error("Error loading orders:",o),u.value=[]}finally{y.value=!1}},W=async()=>{await J(),await p()},U=async(o,t)=>{const a=await b.get(N.reservationsCollection,o);if(!a)return;const s={...a,id:a.id||o},i=(s.reservations||[]).map(c=>L(s,c));if(t){const c=i.find(m=>m.res_id===t);if(!c)return;await B(),h.value?.openDialog(c);return}i.length&&(await B(),C.value?.openDialog({id:s.id,customerInfo:s.customerInfo,status:s.status,createdAt:s.createdAt,metadata:s.metadata||{},reservations:i,adjustments:s.adjustments||[],totalPrice:typeof s.total=="number"?s.total:i.reduce((c,m)=>c+(m.reservationPrice||0),0),totalSpots:i.reduce((c,m)=>c+(m.spots||0),0)}))},Z=async o=>{await B(),h.value?.openDialog(o)};return W(),e.onMounted(async()=>{const o=A.value.orderId||T.query.orderId,t=A.value.reservationId||T.query.reservationId;if(o){const a=new URL(window.location.href);a.searchParams.delete("orderId"),a.searchParams.delete("reservationId"),window.history.replaceState(window.history.state,"",a.toString()),await U(o,t)}}),e.watch(l,()=>{p()}),e.watch(x,()=>{p()}),(o,t)=>{const a=e.resolveComponent("Button"),s=e.resolveComponent("Badge"),i=e.resolveComponent("CardTitle"),c=e.resolveComponent("CardDescription"),m=e.resolveComponent("CardHeader"),P=e.resolveComponent("Input"),ee=e.resolveComponent("CardContent"),te=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(oe._sfc_main,null,{default:e.withCtx(()=>[e.createElementVNode("div",ae,[e.createElementVNode("div",re,[e.createElementVNode("div",null,[e.createElementVNode("h1",se,[e.createVNode(e.unref(d.ShoppingBag),{class:"size-6"}),t[4]||(t[4]=e.createTextVNode(" Orders ",-1))]),t[5]||(t[5]=e.createElementVNode("p",{class:"text-muted-foreground text-sm mt-1"}," View orders by when they were placed ",-1))])]),e.createElementVNode("div",le,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(["confirmed","pending","cancelled"],n=>e.createVNode(a,{key:n,variant:e.unref(x)===n?"default":"ghost",size:"sm",class:"capitalize",onClick:r=>x.value=n},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n),1)]),_:2},1032,["variant","onClick"])),64))]),e.createVNode(te,null,{default:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>[e.createElementVNode("div",ce,[e.createElementVNode("div",null,[e.createVNode(i,{class:"flex items-center gap-2"},{default:e.withCtx(()=>[t[6]||(t[6]=e.createTextVNode(" Orders received ",-1)),e.unref(V).bookings>0?(e.openBlock(),e.createBlock(s,{key:0,variant:"secondary"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(V).bookings),1)]),_:1})):e.createCommentVNode("",!0)]),_:1}),e.createVNode(c,{class:"flex items-center gap-4 mt-1"},{default:e.withCtx(()=>[e.createElementVNode("span",de,[e.createVNode(e.unref(d.Users),{size:14}),e.createTextVNode(" "+e.toDisplayString(e.unref(V).spots)+" spots ",1)]),e.createElementVNode("span",ie," €"+e.toDisplayString(e.unref(V).revenue.toFixed(2))+e.toDisplayString(e.unref(x)==="pending"?" pending ":e.unref(x)==="cancelled"?" cancelled ":" ")+"revenue ",1)]),_:1})]),e.createElementVNode("div",ue,[e.createElementVNode("div",me,[e.createVNode(a,{variant:"outline",size:"icon",class:"size-8",onClick:Y},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ChevronLeft),{size:16})]),_:1}),e.createVNode(a,{variant:"outline",size:"sm",class:"h-8 px-3 text-xs",onClick:X},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode(" Today ",-1)])]),_:1}),e.createVNode(a,{variant:"outline",size:"icon",class:"size-8",onClick:K,disabled:!e.unref(Q)},{default:e.withCtx(()=>[e.createVNode(e.unref(d.ChevronRight),{size:16})]),_:1},8,["disabled"])]),e.createVNode(a,{variant:"outline",size:"icon",onClick:p,disabled:e.unref(y)},{default:e.withCtx(()=>[e.createVNode(e.unref(d.RefreshCw),{size:16,class:e.normalizeClass({"animate-spin":e.unref(y)})},null,8,["class"])]),_:1},8,["disabled"])])]),e.createElementVNode("div",fe,[e.createElementVNode("div",pe,[e.createVNode(a,{type:"button",variant:"outline",onClick:$},{default:e.withCtx(()=>[e.createVNode(e.unref(d.CalendarIcon),{class:"size-4"}),e.createTextVNode(" "+e.toDisplayString(e.unref(H)),1)]),_:1}),e.withDirectives(e.createElementVNode("input",{ref_key:"dateInputRef",ref:O,"onUpdate:modelValue":t[0]||(t[0]=n=>e.isRef(S)?S.value=n:null),type:"date",class:"orders-date-picker","aria-label":"Select order date"},null,512),[[e.vModelText,e.unref(S)]])])])]),_:1}),e.createVNode(ee,null,{default:e.withCtx(()=>[e.createElementVNode("div",ge,[e.createVNode(e.unref(d.Search),{size:16,class:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"}),e.createVNode(P,{modelValue:e.unref(f),"onUpdate:modelValue":t[1]||(t[1]=n=>e.isRef(f)?f.value=n:null),placeholder:"Search by name, email, or phone...",class:"pl-9 pr-9"},null,8,["modelValue"]),e.unref(f)?(e.openBlock(),e.createBlock(a,{key:0,variant:"ghost",size:"icon",class:"absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",onClick:G},{default:e.withCtx(()=>[e.createVNode(e.unref(d.X),{size:14})]),_:1})):e.createCommentVNode("",!0)]),e.unref(f)?(e.openBlock(),e.createElementBlock("div",ve," Showing "+e.toDisplayString(e.unref(I).length)+" of "+e.toDisplayString(e.unref(u).length)+" orders ",1)):e.createCommentVNode("",!0),e.unref(y)?(e.openBlock(),e.createElementBlock("div",xe,[...t[8]||(t[8]=[e.createElementVNode("div",{class:"animate-spin rounded-full h-8 w-8 border-b-2 border-primary"},null,-1)])])):e.unref(u).length===0?(e.openBlock(),e.createElementBlock("div",ke,[e.createVNode(e.unref(d.ShoppingBag),{class:"size-12 mx-auto mb-3 opacity-50"}),t[9]||(t[9]=e.createElementVNode("p",null,"No orders received on this day",-1))])):e.unref(I).length===0?(e.openBlock(),e.createElementBlock("div",_e," No orders match your search ")):(e.openBlock(),e.createElementBlock("div",ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(M),n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"border rounded-lg overflow-hidden shadow-sm"},[n.reservations.length===1?(e.openBlock(),e.createElementBlock("div",{key:0,class:"p-3 hover:bg-muted/50 transition-colors cursor-pointer",onClick:r=>e.unref(h)?.openDialog(n.reservations[0])},[e.createElementVNode("div",Ne,[e.createElementVNode("div",Ve,[e.createElementVNode("div",we,e.toDisplayString(n.customerInfo?.firstName||n.customerInfo?.lastName?[n.customerInfo?.firstName,n.customerInfo?.lastName].filter(Boolean).join(" "):"Unknown Customer"),1),e.createElementVNode("div",be,e.toDisplayString(n.customerInfo?.email),1),e.createElementVNode("div",De,e.toDisplayString(n.customerInfo?.phone),1),e.createElementVNode("div",Ee,[e.createElementVNode("div",Ce,[e.createVNode(e.unref(d.CalendarIcon),{size:12}),e.createElementVNode("span",null,e.toDisplayString(F(n.reservations[0].date))+" · "+e.toDisplayString(n.reservations[0].startTime)+" - "+e.toDisplayString(n.reservations[0].endTime),1)]),e.createElementVNode("div",Se,[e.createVNode(e.unref(d.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(n.reservations[0].spots)+" spots",1)]),n.reservations[0].resourceName?(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("div",{class:"w-3 h-3 rounded-full",style:e.normalizeStyle({backgroundColor:n.reservations[0].resourceColor||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(n.reservations[0].resourceName),1)])):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ie,[e.createVNode(e.unref(d.Clock),{size:12}),e.createElementVNode("span",null,"Ordered at "+e.toDisplayString(R(n.createdAt)),1)]),e.createVNode(v._sfc_main,{metadata:{...n.reservations[0].metadata,...n.reservations[0].reservationMetadata},schema:e.unref(D),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])]),e.createElementVNode("div",Pe,[n.reservations[0].status==="pending"?(e.openBlock(),e.createElementBlock("span",Te,"Pending")):n.reservations[0].status==="cancelled"?(e.openBlock(),e.createElementBlock("span",Ae,"Cancelled")):n.reservations[0].reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",ze,"Needs Approval")):n.reservations[0].reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",Oe,"Approved")):n.reservations[0].reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",je,"Cancelled")):n.reservations[0].reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",Re,"Rejected")):(e.openBlock(),e.createElementBlock("span",Fe,"Pending")),n.reservations[0].reservationPrice||n.reservations[0].reservationPrice===0?(e.openBlock(),e.createElementBlock("div",Le," €"+e.toDisplayString(n.totalPrice.toFixed(2)),1)):e.createCommentVNode("",!0)])])],8,he)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[e.createElementVNode("div",{class:"p-3 bg-muted/30 hover:bg-muted/50 transition-colors cursor-pointer",onClick:r=>e.unref(C)?.openDialog(n)},[e.createElementVNode("div",Ue,[e.createElementVNode("div",qe,[e.createElementVNode("div",$e,[e.createElementVNode("div",He,e.toDisplayString(n.customerInfo?.firstName||n.customerInfo?.lastName?[n.customerInfo?.firstName,n.customerInfo?.lastName].filter(Boolean).join(" "):"Unknown Customer"),1),e.createVNode(s,{variant:"secondary",class:"text-xs"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(n.reservations.length)+" reservations ",1)]),_:2},1024)]),e.createElementVNode("div",Ye,e.toDisplayString(n.customerInfo?.email),1),e.createElementVNode("div",Ke,e.toDisplayString(n.customerInfo?.phone),1),e.createElementVNode("div",Qe,[e.createVNode(e.unref(d.Clock),{size:12}),e.createElementVNode("span",null,"Ordered at "+e.toDisplayString(R(n.createdAt)),1)]),e.createVNode(v._sfc_main,{metadata:n.metadata,schema:e.unref(D),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])]),e.createElementVNode("div",Xe,[n.status==="pending"?(e.openBlock(),e.createElementBlock("span",Ge,"Pending")):n.status==="cancelled"?(e.openBlock(),e.createElementBlock("span",Je,"Cancelled")):(e.openBlock(),e.createElementBlock("span",We,"Confirmed")),e.createElementVNode("div",Ze," €"+e.toDisplayString(n.totalPrice.toFixed(2)),1)])])],8,Me),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.reservations,r=>(e.openBlock(),e.createElementBlock("div",{key:r.res_id,class:"p-3 border-t bg-muted/50 dark:bg-transparent dark:hover:bg-muted/50 transition-colors cursor-pointer",onClick:vt=>e.unref(h)?.openDialog(r)},[e.createElementVNode("div",tt,[e.createElementVNode("div",ot,[e.createElementVNode("div",nt,[e.createVNode(e.unref(d.CalendarIcon),{size:12}),e.createElementVNode("span",null,e.toDisplayString(F(r.date))+" · "+e.toDisplayString(r.startTime)+" - "+e.toDisplayString(r.endTime),1)]),e.createElementVNode("div",at,[e.createVNode(e.unref(d.Users),{size:12}),e.createElementVNode("span",null,e.toDisplayString(r.spots)+" spots",1)]),r.resourceName?(e.openBlock(),e.createElementBlock("div",rt,[e.createElementVNode("div",{class:"w-3 h-3 rounded-full",style:e.normalizeStyle({backgroundColor:r.resourceColor||"#6b7280"})},null,4),e.createElementVNode("span",null,e.toDisplayString(r.resourceName),1)])):e.createCommentVNode("",!0)]),r.status==="confirmed"?(e.openBlock(),e.createElementBlock("div",st,[r.reservationStatus==="needs_approval"?(e.openBlock(),e.createElementBlock("span",lt,"Needs Approval")):r.reservationStatus==="approved"?(e.openBlock(),e.createElementBlock("span",ct,"Approved")):r.reservationStatus==="cancelled"?(e.openBlock(),e.createElementBlock("span",dt,"Cancelled")):r.reservationStatus==="rejected"?(e.openBlock(),e.createElementBlock("span",it,"Rejected")):(e.openBlock(),e.createElementBlock("span",ut,"Pending")),r.reservationPrice||r.reservationPrice===0?(e.openBlock(),e.createElementBlock("div",mt," €"+e.toDisplayString(r.reservationPrice.toFixed(2)),1)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),e.createVNode(v._sfc_main,{metadata:r.reservationMetadata,schema:e.unref(D),"display-filter":["highlight","badge"],compact:"",class:"mt-1"},null,8,["metadata","schema"])],8,et))),128))],64))]))),128))]))]),_:1})]),_:1})])]),_:1}),e.createVNode(v._sfc_main$1,{ref_key:"reservationDetailDialog",ref:h,"agenda-data":e.unref(E),resources:e.unref(_),"show-order-link":"",onCancelled:p,onConfirmed:p,onRejected:p,onTransferred:p,onOpenOrder:t[2]||(t[2]=n=>U(n))},null,8,["agenda-data","resources"]),e.createVNode(v._sfc_main$2,{ref_key:"orderDetailDialog",ref:C,"agenda-data":e.unref(E),resources:e.unref(_),onOpenReservation:t[3]||(t[3]=n=>Z(n))},null,8,["agenda-data","resources"])],64)}}}),pt=ne._export_sfc(ft,[["__scopeId","data-v-3e5d1883"]]);exports.default=pt;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface TableRowActions {
|
|
2
|
-
create
|
|
3
|
-
update
|
|
4
|
-
remove
|
|
2
|
+
create?: (data?: any) => void;
|
|
3
|
+
update?: (index: number, data?: any, merge?: boolean) => void;
|
|
4
|
+
remove?: (index: number) => void;
|
|
5
5
|
}
|
|
6
6
|
export interface TableRowExtensionConfig {
|
|
7
7
|
tableRowActions?: TableRowActions;
|
|
@@ -28,8 +28,8 @@ export default function createTableRowExtension(config?: TableRowExtensionConfig
|
|
|
28
28
|
}>> & Readonly<{
|
|
29
29
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
30
30
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>>;
|
|
31
|
-
node: any
|
|
32
|
-
processFunction(input:
|
|
31
|
+
node: import('vue').Raw<import('vue').DefineComponent<Record<string, unknown>, Record<string, unknown>, any>>;
|
|
32
|
+
processFunction(input: Record<string, any>, { node }: {
|
|
33
33
|
node: any;
|
|
34
34
|
}): Promise<{
|
|
35
35
|
finishedTableAction: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oneclick.dev/cms-core-modules",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.119",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"@formkit/drag-and-drop": "^0.5.3",
|
|
30
30
|
"@internationalized/date": "^3.8.0",
|
|
31
|
-
"@oneclick.dev/cms-kit": "0.0.
|
|
31
|
+
"@oneclick.dev/cms-kit": "0.0.138",
|
|
32
32
|
"@tanstack/vue-table": "^8.21.3",
|
|
33
33
|
"@vee-validate/zod": "^4.15.0",
|
|
34
34
|
"@vue-flow/core": "^1.48.1",
|