@oneclick.dev/cms-core-modules 0.0.59 → 0.0.61
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/{Components-D9yIIosM.mjs → Components-C83O-xlF.mjs} +1 -1
- package/dist/{ContentEditor-DCmt_y_R.js → ContentEditor-BAepN3Yd.js} +51 -34
- package/dist/{ContentEditor-CtGeIzC4.mjs → ContentEditor-BPjWW3d1.mjs} +12341 -10099
- package/dist/Create-Bh4g6QW4.js +1 -0
- package/dist/{Create-Bwf1RXdG.mjs → Create-Cf7pvh5G.mjs} +38 -39
- package/dist/DateFormatter-BPPBZp1j.js +1 -0
- package/dist/{CalendarDate-CRT2Viyt.mjs → DateFormatter-DsmlAuYV.mjs} +353 -256
- package/dist/{Detail-CpfOQChd.mjs → Detail-B4b_FLDa.mjs} +2 -2
- package/dist/{Detail-B-PnkcXD.mjs → Detail-BGD75ul4.mjs} +2 -2
- package/dist/{Detail-Dd_OkpcN.js → Detail-BayNaAg9.js} +1 -1
- package/dist/{Detail-C4E1T87K.mjs → Detail-Byk781b4.mjs} +3 -3
- package/dist/{Detail-Cd5CBVN0.js → Detail-CnK-qbhE.js} +1 -1
- package/dist/Detail-CtbWzq-R.js +1 -0
- package/dist/{Detail-CNfTDUE5.js → Detail-Cxd2VMOl.js} +1 -1
- package/dist/{Detail-BVlGSjOq.mjs → Detail-D10shmpK.mjs} +6 -7
- package/dist/{Detail-CwagT6gQ.mjs → Detail-U0mgLKt6.mjs} +2 -2
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-CcysXzmW.mjs +75 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-Czu6Dcde.js +1 -0
- package/dist/{Entries-zyhycw1M.mjs → Entries-C6Di46My.mjs} +1 -1
- package/dist/{Find-BPR0uU-Z.mjs → Find-B4sAEx0B.mjs} +2 -2
- package/dist/{Find-BidEQJxT.js → Find-Ds6OvuH6.js} +1 -1
- package/dist/{GlobalStyling-BLQ_1W2y.mjs → GlobalStyling-C9VthHWK.mjs} +1 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BJitmbPE.mjs +396 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-D50uTpZY.js +1 -0
- package/dist/Overview-B-8TLLjh.js +1 -0
- package/dist/{Overview-CDN88OSM.mjs → Overview-BCpJNiEB.mjs} +1 -1
- package/dist/Overview-B_99j5eA.js +1 -0
- package/dist/{Overview-BLsZMHNW.mjs → Overview-CIa1E-HH.mjs} +1 -1
- package/dist/{Overview-D1nJLBe1.mjs → Overview-CgViRnNc.mjs} +1 -1
- package/dist/Overview-DtWvKB3W.mjs +327 -0
- package/dist/Overview-HvlDEgqi.mjs +862 -0
- package/dist/{Overview-BH3NwvNX.mjs → Overview-Su8ZUbMs.mjs} +3 -3
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CI8YgHdU.js +345 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-P-MWwcVh.mjs +2093 -0
- package/dist/{TableView-CS13LLxk.mjs → TableView-DlhHyuUZ.mjs} +48394 -36321
- package/dist/TableView-_2cP-w_7.js +312 -0
- package/dist/{TemplateList.vue_vue_type_script_setup_true_lang-BiLAkhIA.mjs → TemplateList.vue_vue_type_script_setup_true_lang-Cmovy7kk.mjs} +5 -5
- package/dist/{View-C7axVP9t.mjs → View-DDXN0tKD.mjs} +7 -7
- package/dist/View-DfzaVOzS.js +1 -0
- package/dist/agenda-D81m29_4.mjs +1135 -0
- package/dist/agenda-uzPPxgsW.js +1 -0
- package/dist/availability-B-tRp8hB.mjs +629 -0
- package/dist/availability-BiBbzEIM.js +1 -0
- package/dist/{exceptions-D3b18TiY.mjs → exceptions-BFchkR06.mjs} +70 -71
- package/dist/exceptions-C-DPRNQa.js +1 -0
- package/dist/index-4tjmIans.js +1 -0
- package/dist/index-AmUV8LZQ.mjs +176 -0
- package/dist/index-BDaVYdkD.mjs +7763 -0
- package/dist/{index-DT1wWnUk.mjs → index-BWDwEd8D.mjs} +1 -1
- package/dist/{index-CImCyE3L.mjs → index-BfBBm9uY.mjs} +1 -1
- package/dist/{index-DMoyoaks.mjs → index-Bkq58CeQ.mjs} +2 -2
- package/dist/{index-DI6mydpm.mjs → index-CABh6Qn6.mjs} +2 -2
- package/dist/{index-CQiY-oTN.mjs → index-CQkOH2_3.mjs} +1 -1
- package/dist/{index-Bwi1mtkq.mjs → index-CU-tbS5W.mjs} +1 -1
- package/dist/{index-BzuHN-r8.mjs → index-Cpnn_Pxd.mjs} +1 -1
- package/dist/index-CxETuRsG.js +1 -0
- package/dist/{index-DyCHxFp3.mjs → index-DRqJOqUR.mjs} +502 -449
- package/dist/index-DTago6vW-Bhr8E1Y6.js +88 -0
- package/dist/index-DTago6vW-CnomHQ_S.mjs +4123 -0
- package/dist/index-DfV8-6ON.js +245 -0
- package/dist/index-Dnn2SCSl.js +1 -0
- package/dist/{index-BEGU8Kme.mjs → index-Dpl9sU6a.mjs} +2 -2
- package/dist/index-Uf7TwBuW.mjs +110 -0
- package/dist/{index-CKPshlZ8-BQiiP6r_.mjs → index-YMaY4uuk-BshejgNP.mjs} +400 -363
- package/dist/index-YMaY4uuk-BxVT7IpO.js +1 -0
- package/dist/{index--jjEzba7.mjs → index-cOnxXTbF.mjs} +1 -1
- package/dist/index-hlylYYgy.mjs +24 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +98 -81
- package/dist/orders-Bh8w0ueq.mjs +346 -0
- package/dist/orders-Dt0zMz97.js +1 -0
- package/dist/payment-BQaAqQ5q.js +1 -0
- package/dist/payment-BbWByERf.mjs +1080 -0
- package/dist/regular-1LXNPviB.js +1 -0
- package/dist/regular-_05oq5Tx.mjs +1101 -0
- package/dist/regular-slots-Bs3WJB3U.js +1 -0
- package/dist/regular-slots-C2NYxLPn.mjs +222 -0
- package/dist/resources-DgPnEv76.mjs +811 -0
- package/dist/resources-eb0pivDL.js +1 -0
- package/dist/src/appointments/components/edit/EditLayout.vue.d.ts +2 -2
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +92 -0
- package/dist/src/appointments/components/edit/EventDialog/CancelReservationDialog.vue.d.ts +8 -0
- package/dist/src/appointments/components/edit/EventDialog/EventDialog.vue.d.ts +10 -0
- package/dist/src/appointments/components/edit/{EventDialog.vue.d.ts → EventDialog/ResendConfirmationDialog.vue.d.ts} +1 -1
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +51 -0
- package/dist/src/appointments/components/edit/EventDialog/TimelineChart.vue.d.ts +24 -0
- package/dist/src/appointments/components/edit/EventDialog/TransferReservationDialog.vue.d.ts +4 -0
- package/dist/src/appointments/components/edit/EventTimeline.vue.d.ts +15 -7
- package/dist/src/appointments/components/edit/NewReservationDialog/NewReservationDialog.vue.d.ts +2 -0
- package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +68 -0
- package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +15 -0
- package/dist/src/appointments/components/edit/dashboard/timeline/ResourceSelector.vue.d.ts +50 -0
- package/dist/src/appointments/config.d.ts +30 -0
- package/dist/src/appointments/index.d.ts +32 -5
- package/dist/src/appointments/pages/edit/agenda.vue.d.ts +1 -1
- package/dist/src/appointments/pages/edit/availability.vue.d.ts +1 -1
- package/dist/src/appointments/pages/edit/index.vue.d.ts +1 -1
- package/dist/src/appointments/pages/edit/orders.vue.d.ts +64 -0
- package/dist/src/appointments/pages/edit/payment.vue.d.ts +1 -1
- package/dist/src/appointments/pages/edit/regular-slots.vue.d.ts +1 -1
- package/dist/src/appointments/pages/edit/resources.vue.d.ts +1 -1
- package/dist/src/appointments/routes.d.ts +2 -5
- package/dist/src/appointments/types.d.ts +16 -0
- package/dist/src/appointments/utils/printReservation.d.ts +45 -0
- package/dist/src/content-manager/components/content-editor/ContentStructuredContentSections.vue.d.ts +4 -0
- package/dist/src/content-manager/components/content-editor/PageSettings.vue.d.ts +2 -0
- package/dist/src/content-manager/components/content-editor/SidebarSectionWrapper.vue.d.ts +11 -1
- package/dist/src/content-manager/types.d.ts +5 -0
- package/dist/{vee-validate-zod-BPQyEfpF.js → vee-validate-zod-ByykgYKJ.js} +1 -1
- package/dist/{vee-validate-zod-IXkfh-6Q.mjs → vee-validate-zod-CcOwoF6y.mjs} +4 -4
- package/package.json +4 -2
- package/dist/CalendarDate-CWtpXgpD.js +0 -1
- package/dist/Create-BP8TX6rj.js +0 -1
- package/dist/DateFormatter-BbcSwTs4.js +0 -1
- package/dist/DateFormatter-CbO0PVUK.mjs +0 -99
- package/dist/Detail-DUo6qKqO.js +0 -1
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-BWuKVkvV.js +0 -1
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs +0 -55
- package/dist/Overview-BNMZ9MUK.js +0 -1
- package/dist/Overview-CEPodGCn.mjs +0 -311
- package/dist/Overview-CvquDPhB.js +0 -1
- package/dist/Overview-D67UjG6n.mjs +0 -947
- package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-0xZSq0rx.js +0 -1
- package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-Bj_PVLLV.mjs +0 -392
- package/dist/TableView-Dv4YXBD1.js +0 -111
- package/dist/View-7qb_ohVo.js +0 -1
- package/dist/agenda-B49oKGeh.mjs +0 -706
- package/dist/agenda-DipQ5IWP.js +0 -1
- package/dist/availability-C7q9tq6l.js +0 -1
- package/dist/availability-DeCkqiu8.mjs +0 -613
- package/dist/exceptions-DJ9zWX3k.js +0 -1
- package/dist/index-CKPshlZ8-CIz1tDwX.js +0 -1
- package/dist/index-DUeFrD-B.js +0 -1
- package/dist/index-DsnoK4ia.mjs +0 -579
- package/dist/index-WL1P6d3j.js +0 -1
- package/dist/index-_mG-aU3Z.mjs +0 -87
- package/dist/index-_sQDF1pH.js +0 -1
- package/dist/index-klI238nT.mjs +0 -24
- package/dist/payment-kTjsV0Jj.js +0 -1
- package/dist/payment-zpCM0LD-.mjs +0 -981
- package/dist/regular-C4_3YXqx.mjs +0 -602
- package/dist/regular-DFwPEbZO.js +0 -1
- package/dist/regular-slots-4ooEpICB.mjs +0 -67
- package/dist/regular-slots-BAVGbomI.js +0 -1
- package/dist/resources-MpQkSstv.mjs +0 -563
- package/dist/resources-iM28T3dD.js +0 -1
- package/dist/src/appointments/components/edit/RegularSlotEditor.vue.d.ts +0 -16
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { defineComponent as y, ref as w, resolveComponent as n, unref as o, openBlock as s, createBlock as N, withCtx as d, createTextVNode as $, createElementVNode as r, createElementBlock as c, createVNode as a, createCommentVNode as g, renderSlot as M } from "vue";
|
|
2
|
+
import { useModuleRoute as V, useModulePermissions as P, useRoute as A, useModuleBreadcrumbs as B, useModule as S, useFirebaseIntegration as E } from "@oneclick.dev/cms-kit";
|
|
3
|
+
import { ClipboardClock as L, User as R, Calendar as D, CalendarClock as O, CalendarCog as j, Tickets as T, HandCoins as q, Receipt as F } from "lucide-vue-next";
|
|
4
|
+
const G = {
|
|
5
|
+
key: 1,
|
|
6
|
+
class: "@container mt-4 w-full"
|
|
7
|
+
}, H = { class: "flex flex-col space-y-8 @5xl:flex-row @5xl:space-x-8 @5xl:space-y-0 w-full" }, I = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "hidden @5xl:block @5xl:w-1/4 @7xl:w-1/5"
|
|
10
|
+
}, U = { class: "flex flex-col flex-1" }, W = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "@5xl:hidden"
|
|
13
|
+
}, X = /* @__PURE__ */ y({
|
|
14
|
+
__name: "EditLayout",
|
|
15
|
+
setup(Y) {
|
|
16
|
+
const { params: e, resolvePath: t } = V(), { hasPermission: i } = P(), v = A();
|
|
17
|
+
B(() => [
|
|
18
|
+
{ text: "Edit" }
|
|
19
|
+
]);
|
|
20
|
+
const { config: u } = S(), _ = E(u.project), f = w(null);
|
|
21
|
+
(async () => {
|
|
22
|
+
let l = await _.get(u.agendaCollection, e.value.id);
|
|
23
|
+
f.value = l;
|
|
24
|
+
})();
|
|
25
|
+
const m = [
|
|
26
|
+
{ to: t(`/edit/${e.value.id}/`), title: "Overview", icon: L, subtitle: "General info and quick details" },
|
|
27
|
+
{ to: t(`/edit/${e.value.id}/resources`), title: "Resource Management", icon: R, subtitle: "Manage resources" },
|
|
28
|
+
{ to: t(`/edit/${e.value.id}/agenda`), title: "Agenda", icon: D, subtitle: "Manage scheduled events and sessions" },
|
|
29
|
+
{ to: t(`/edit/${e.value.id}/regular-slots`), title: "Slot Configuration", icon: O, subtitle: "Define recurring time slots and patterns" },
|
|
30
|
+
{ to: t(`/edit/${e.value.id}/exceptions`), title: "Override Slots", icon: j, subtitle: "Adjust or block times" },
|
|
31
|
+
{ to: t(`/edit/${e.value.id}/availability`), title: "Availability Settings", icon: T, subtitle: "Booking rules & limits" },
|
|
32
|
+
{ to: t(`/edit/${e.value.id}/payment`), title: "Payment Settings", icon: q, subtitle: "Payment options & policies" },
|
|
33
|
+
{ to: t(`/edit/${e.value.id}/orders`), title: "Orders", icon: F, subtitle: "Manage orders and payments" }
|
|
34
|
+
];
|
|
35
|
+
return (l, p) => {
|
|
36
|
+
const x = n("NuxtLink"), C = n("VerticalNav"), k = n("DrawerNav"), b = n("CardContent"), h = n("Card");
|
|
37
|
+
return !o(i)("edit-agendas") && !o(v).fullPath.endsWith("/agenda") ? (s(), N(x, {
|
|
38
|
+
key: 0,
|
|
39
|
+
class: "group",
|
|
40
|
+
to: o(t)(`/edit/${o(e).id}/agenda`)
|
|
41
|
+
}, {
|
|
42
|
+
default: d(() => [...p[0] || (p[0] = [
|
|
43
|
+
$("You have no access to this page. ", -1),
|
|
44
|
+
r("span", { class: "group-hover:underline" }, "View agenda", -1)
|
|
45
|
+
])]),
|
|
46
|
+
_: 1
|
|
47
|
+
}, 8, ["to"])) : (s(), c("div", G, [
|
|
48
|
+
r("div", H, [
|
|
49
|
+
o(i)("edit-agendas") ? (s(), c("div", I, [
|
|
50
|
+
a(C, { links: m })
|
|
51
|
+
])) : g("", !0),
|
|
52
|
+
r("div", U, [
|
|
53
|
+
o(i)("edit-agendas") ? (s(), c("div", W, [
|
|
54
|
+
a(k, { links: m })
|
|
55
|
+
])) : g("", !0),
|
|
56
|
+
a(h, { class: "flex-1 w-full" }, {
|
|
57
|
+
default: d(() => [
|
|
58
|
+
a(b, null, {
|
|
59
|
+
default: d(() => [
|
|
60
|
+
M(l.$slots, "default")
|
|
61
|
+
]),
|
|
62
|
+
_: 3
|
|
63
|
+
})
|
|
64
|
+
]),
|
|
65
|
+
_: 3
|
|
66
|
+
})
|
|
67
|
+
])
|
|
68
|
+
])
|
|
69
|
+
]));
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
export {
|
|
74
|
+
X as _
|
|
75
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),s=require("@oneclick.dev/cms-kit"),n=require("lucide-vue-next"),C={key:1,class:"@container mt-4 w-full"},k={class:"flex flex-col space-y-8 @5xl:flex-row @5xl:space-x-8 @5xl:space-y-0 w-full"},x={key:0,class:"hidden @5xl:block @5xl:w-1/4 @7xl:w-1/5"},h={class:"flex flex-col flex-1"},N={key:0,class:"@5xl:hidden"},b=e.defineComponent({__name:"EditLayout",setup(w){const{params:t,resolvePath:o}=s.useModuleRoute(),{hasPermission:a}=s.useModulePermissions(),d=s.useRoute();s.useModuleBreadcrumbs(()=>[{text:"Edit"}]);const{config:l}=s.useModule(),u=s.useFirebaseIntegration(l.project),m=e.ref(null);(async()=>{let i=await u.get(l.agendaCollection,t.value.id);m.value=i})();const r=[{to:o(`/edit/${t.value.id}/`),title:"Overview",icon:n.ClipboardClock,subtitle:"General info and quick details"},{to:o(`/edit/${t.value.id}/resources`),title:"Resource Management",icon:n.User,subtitle:"Manage resources"},{to:o(`/edit/${t.value.id}/agenda`),title:"Agenda",icon:n.Calendar,subtitle:"Manage scheduled events and sessions"},{to:o(`/edit/${t.value.id}/regular-slots`),title:"Slot Configuration",icon:n.CalendarClock,subtitle:"Define recurring time slots and patterns"},{to:o(`/edit/${t.value.id}/exceptions`),title:"Override Slots",icon:n.CalendarCog,subtitle:"Adjust or block times"},{to:o(`/edit/${t.value.id}/availability`),title:"Availability Settings",icon:n.Tickets,subtitle:"Booking rules & limits"},{to:o(`/edit/${t.value.id}/payment`),title:"Payment Settings",icon:n.HandCoins,subtitle:"Payment options & policies"},{to:o(`/edit/${t.value.id}/orders`),title:"Orders",icon:n.Receipt,subtitle:"Manage orders and payments"}];return(i,c)=>{const p=e.resolveComponent("NuxtLink"),v=e.resolveComponent("VerticalNav"),g=e.resolveComponent("DrawerNav"),_=e.resolveComponent("CardContent"),f=e.resolveComponent("Card");return!e.unref(a)("edit-agendas")&&!e.unref(d).fullPath.endsWith("/agenda")?(e.openBlock(),e.createBlock(p,{key:0,class:"group",to:e.unref(o)(`/edit/${e.unref(t).id}/agenda`)},{default:e.withCtx(()=>[...c[0]||(c[0]=[e.createTextVNode("You have no access to this page. ",-1),e.createElementVNode("span",{class:"group-hover:underline"},"View agenda",-1)])]),_:1},8,["to"])):(e.openBlock(),e.createElementBlock("div",C,[e.createElementVNode("div",k,[e.unref(a)("edit-agendas")?(e.openBlock(),e.createElementBlock("div",x,[e.createVNode(v,{links:r})])):e.createCommentVNode("",!0),e.createElementVNode("div",h,[e.unref(a)("edit-agendas")?(e.openBlock(),e.createElementBlock("div",N,[e.createVNode(g,{links:r})])):e.createCommentVNode("",!0),e.createVNode(f,{class:"flex-1 w-full"},{default:e.withCtx(()=>[e.createVNode(_,null,{default:e.withCtx(()=>[e.renderSlot(i.$slots,"default")]),_:3})]),_:3})])])]))}}});exports._sfc_main=b;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as O, inject as j, computed as G, resolveComponent as a,
|
|
1
|
+
import { defineComponent as O, inject as j, computed as G, resolveComponent as a, openBlock as c, createBlock as C, withCtx as n, createVNode as t, unref as o, createCommentVNode as h, createTextVNode as v, toDisplayString as x, createElementBlock as E, Fragment as q, renderList as te, withModifiers as X, createElementVNode as d, ref as F, renderSlot as ue, watch as de, onMounted as ce, onUnmounted as pe, provide as K, withKeys as fe } from "vue";
|
|
2
2
|
import { Globe as ve, Pencil as me, Filter as ge, RotateCcw as _e, ExternalLink as be, ChevronLeft as ye, Search as Ce, Plus as xe } from "lucide-vue-next";
|
|
3
3
|
import { useModule as we, useModuleRoute as Y, useModulePermissions as Z, useFirebaseIntegration as J, useConfirmation as he, useModuleBreadcrumbs as ke } from "@oneclick.dev/cms-kit";
|
|
4
4
|
import { i as Pe } from "./interpolation-BHSqsh8Q.mjs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as Y, ref as y, withAsyncContext as M, watch as $, onMounted as O, resolveComponent as s,
|
|
1
|
+
import { defineComponent as Y, ref as y, withAsyncContext as M, watch as $, onMounted as O, resolveComponent as s, openBlock as d, createElementBlock as j, createElementVNode as c, createVNode as t, unref as v, withCtx as l, createTextVNode as o, createBlock as g, createCommentVNode as T, toDisplayString as r, Fragment as Q, renderList as h } from "vue";
|
|
2
2
|
import { useModulePermissions as G, useModuleRoute as J, useModuleStorage as K, useModuleBreadcrumbs as W, useFirebaseIntegration as X, useRoute as Z, useRouter as ee } from "@oneclick.dev/cms-kit";
|
|
3
3
|
import { Plus as te, Search as le, Loader2 as ne, Pencil as oe } from "lucide-vue-next";
|
|
4
|
-
import { u as se } from "./index-
|
|
4
|
+
import { u as se } from "./index-Uf7TwBuW.mjs";
|
|
5
5
|
const ae = { class: "relative" }, ue = {
|
|
6
6
|
ref: "container",
|
|
7
7
|
class: "w-full max-w-5xl mx-auto"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("@oneclick.dev/cms-kit"),x=require("lucide-vue-next"),P=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("@oneclick.dev/cms-kit"),x=require("lucide-vue-next"),P=require("./index-4tjmIans.js"),A={class:"relative"},M={ref:"container",class:"w-full max-w-5xl mx-auto"},j={class:"flex justify-between items-center mb-4"},z={class:"relative w-full max-w-sm items-center"},F={class:"absolute start-0 inset-y-0 flex items-center justify-center px-2 pointer-events-none"},R={class:"absolute end-0 inset-y-0 flex items-center justify-center px-2 pointer-events-none"},H=e.defineComponent({__name:"Find",props:{config:{type:Object,required:!0}},async setup(T){let n,d;const f=T,{hasPermission:I}=r.useModulePermissions(),{navigateTo:N}=r.useModuleRoute(),{getModuleData:b}=r.useModuleStorage();r.useModuleBreadcrumbs(()=>[{text:"Promo codes list"}]);const m=e.ref([]);m.value=([n,d]=e.withAsyncContext(()=>b("promo-types")),n=await n,d(),n||[]);const c=e.ref([]),v=r.useFirebaseIntegration(f.config.project);c.value=([n,d]=e.withAsyncContext(()=>v.find(f.config.promoCodeCollection)),n=await n,d(),n);const V=r.useRoute(),k=r.useRouter(),l=e.ref(V.query.q||""),p=e.ref(""),C=e.ref(!1),y=P.useDebounceFn(async()=>{C.value=!0;let a=l.value.trim().toUpperCase();a.length===0?c.value=await v.find(f.config.promoCodeCollection):c.value=await v.find(f.config.promoCodeCollection,{filters:[{field:"code",operator:">=",value:a},{field:"code",operator:"<",value:a.slice(0,-1)+String.fromCharCode(a.slice(-1).charCodeAt(0)+1)}]}),p.value=l.value,C.value=!1},600);e.watch(l,async()=>{await y(),k.replace({query:{...V.query,q:l.value.trim()?l.value.trim():void 0}})});const h=a=>{const t=new Date;return a.expiresAt>t&&a.startsAt<t};return e.onMounted(async()=>{l.value.trim()&&await y()}),(a,t)=>{const w=e.resolveComponent("Button"),B=e.resolveComponent("Input"),_=e.resolveComponent("TableCaption"),s=e.resolveComponent("TableHead"),g=e.resolveComponent("TableRow"),S=e.resolveComponent("TableHeader"),i=e.resolveComponent("TableCell"),q=e.resolveComponent("TableBody"),D=e.resolveComponent("Table"),E=e.resolveComponent("Card");return e.openBlock(),e.createElementBlock("div",A,[e.createElementVNode("div",M,[e.createElementVNode("div",j,[t[3]||(t[3]=e.createElementVNode("h1",{class:"text-2xl font-bold"},"Find Promo Codes",-1)),e.createVNode(w,{onClick:t[0]||(t[0]=o=>e.unref(N)("")),variant:"outline"},{default:e.withCtx(()=>[e.createVNode(e.unref(x.Plus),{class:"size-4"}),t[2]||(t[2]=e.createTextVNode(" Create New Promo Code ",-1))]),_:1})]),e.createVNode(E,{class:"p-4"},{default:e.withCtx(()=>[e.createElementVNode("div",z,[e.createVNode(B,{id:"search",type:"text",placeholder:"Search...",modelValue:l.value,"onUpdate:modelValue":t[1]||(t[1]=o=>l.value=o),class:"px-8"},null,8,["modelValue"]),e.createElementVNode("span",F,[e.createVNode(e.unref(x.Search),{class:"size-4 text-muted-foreground"})]),e.createElementVNode("span",R,[C.value?(e.openBlock(),e.createBlock(e.unref(x.Loader2),{key:0,class:"size-4 text-muted-foreground animate-spin"})):e.createCommentVNode("",!0)])]),e.createVNode(D,null,{default:e.withCtx(()=>[p.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(_,{key:0},{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode("A list of your most recent promo codes.",-1)])]),_:1})),p.value?(e.openBlock(),e.createBlock(_,{key:1},{default:e.withCtx(()=>[t[5]||(t[5]=e.createTextVNode("A list of your promo codes starting with ",-1)),e.createElementVNode("strong",null,'"'+e.toDisplayString(p.value)+'"',1),t[6]||(t[6]=e.createTextVNode(".",-1))]),_:1})):e.createCommentVNode("",!0),e.createVNode(S,null,{default:e.withCtx(()=>[e.createVNode(g,null,{default:e.withCtx(()=>[e.createVNode(s,null,{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode("Code",-1)])]),_:1}),e.createVNode(s,null,{default:e.withCtx(()=>[...t[8]||(t[8]=[e.createTextVNode("Type",-1)])]),_:1}),e.createVNode(s,null,{default:e.withCtx(()=>[...t[9]||(t[9]=[e.createTextVNode("Value",-1)])]),_:1}),e.createVNode(s,null,{default:e.withCtx(()=>[...t[10]||(t[10]=[e.createTextVNode("Used",-1)])]),_:1}),e.createVNode(s,null,{default:e.withCtx(()=>[...t[11]||(t[11]=[e.createTextVNode("Still eligible",-1)])]),_:1}),e.createVNode(s,null,{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode("Action",-1)])]),_:1})]),_:1})]),_:1}),c.value?.length>0?(e.openBlock(),e.createBlock(q,{key:2},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,o=>(e.openBlock(),e.createBlock(g,{key:o.id},{default:e.withCtx(()=>[e.createVNode(i,{class:"font-medium uppercase"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.code),1)]),_:2},1024),e.createVNode(i,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value.find(u=>u.key===o.type)?.label),1)]),_:2},1024),e.createVNode(i,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m.value.find(u=>u.key===o.type)?.valuePrefix)+" "+e.toDisplayString(o.value)+" "+e.toDisplayString(m.value.find(u=>u.key===o.type)?.valueSuffix),1)]),_:2},1024),e.createVNode(i,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.usageLimit===1?o.usageCount>0?"Yes":"No":o.usageCount===0?"No":o.usageCount===1?"1 time":o.usageCount+" times"),1)]),_:2},1024),e.createVNode(i,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(h(o)?"Yes":"No"),1)]),_:2},1024),e.createVNode(i,null,{default:e.withCtx(()=>[e.createVNode(w,{variant:"ghost",size:"icon",onClick:u=>e.unref(N)("/promo-codes/"+o.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(x.Pencil),{class:"size-4"})]),_:1},8,["onClick"])]),_:2},1024)]),_:2},1024))),128))]),_:1})):e.createCommentVNode("",!0)]),_:1})]),_:1})],512)])}}});exports.default=H;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as X, ref as w, reactive as h, resolveComponent as f,
|
|
1
|
+
import { defineComponent as X, ref as w, reactive as h, resolveComponent as f, openBlock as a, createBlock as p, withCtx as n, createVNode as s, createTextVNode as m, toDisplayString as R, createElementVNode as t, withDirectives as I, vModelText as O, createElementBlock as F, createCommentVNode as G, computed as Q, normalizeStyle as N, unref as g, onMounted as le, Fragment as W, renderList as Y } from "vue";
|
|
2
2
|
import { useConfirmation as ee, useModuleRoute as te, useModuleStorage as oe, useModuleBreadcrumbs as se } from "@oneclick.dev/cms-kit";
|
|
3
3
|
import { Circle as B, CircleCheckBig as A, ChevronLeft as ne, Plus as Z } from "lucide-vue-next";
|
|
4
4
|
const ae = { class: "grid py-4" }, re = { class: "grid grid-cols-2 gap-2 mb-6" }, de = { class: "relative" }, ie = { class: "grid grid-cols-3 gap-2 mb-6" }, ue = { class: "relative" }, ce = { class: "relative" }, me = { class: "relative" }, ye = { class: "grid grid-cols-1 gap-2 mb-6" }, pe = { class: "relative" }, ve = { class: "flex items-center space-x-2" }, be = { class: "flex items-center space-x-2" }, ge = { class: "grid grid-cols-2 gap-2 mb-6" }, fe = { key: 0 }, xe = { class: "relative" }, Ce = { key: 1 }, ke = { class: "relative" }, De = {
|
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { defineComponent as ie, ref as d, watch as de, inject as re, computed as pe, resolveComponent as n, openBlock as V, createBlock as U, withCtx as t, createVNode as l, unref as p, createTextVNode as u, createElementVNode as o, toDisplayString as S, createElementBlock as N, Fragment as h, renderList as k, normalizeClass as ce } from "vue";
|
|
2
|
+
import { Plus as me, CalendarIcon as ve } from "lucide-vue-next";
|
|
3
|
+
import { useModuleRoute as fe, useModule as ge, useFirebaseIntegration as _e } from "@oneclick.dev/cms-kit";
|
|
4
|
+
import { c as Ve } from "./utils-BVKy9S2J.mjs";
|
|
5
|
+
import { o as q, g as M, h as Se } from "./DateFormatter-DsmlAuYV.mjs";
|
|
6
|
+
const De = { class: "@container/new-res-form space-y-5 py-4" }, xe = { class: "grid gap-4" }, be = { class: "grid gap-4 @md/new-res-form:grid-cols-2" }, Pe = { class: "grid gap-2" }, we = { class: "flex gap-2 items-center" }, ye = { class: "grid gap-2" }, Te = { class: "flex gap-2 items-center" }, $e = { class: "grid gap-2" }, Ce = { class: "grid gap-2" }, Ne = { class: "grid gap-4" }, Oe = { class: "grid gap-4 @md/new-res-form:grid-cols-2" }, Fe = { class: "grid gap-2" }, Ie = { class: "grid gap-4 @md/new-res-form:grid-cols-2" }, Ue = { class: "grid gap-2" }, he = { class: "grid gap-2" }, ke = { class: "flex items-center h-9 px-3 text-sm text-muted-foreground" }, Me = { class: "grid gap-4" }, Le = { class: "grid gap-4 @md/new-res-form:grid-cols-2" }, Re = { class: "grid gap-2" }, Be = { class: "grid gap-2" }, Ee = { class: "grid gap-4 @md/new-res-form:grid-cols-2" }, Ae = { class: "grid gap-2" }, je = { class: "grid gap-2" }, He = { class: "mt-4 text-red-400" }, ze = { class: "list-disc pl-4" }, Xe = /* @__PURE__ */ ie({
|
|
7
|
+
__name: "NewReservationDialog",
|
|
8
|
+
setup(Ge) {
|
|
9
|
+
const { params: J } = fe(), { config: L } = ge(), K = _e(L.project), y = d(!1);
|
|
10
|
+
de(y, (s) => {
|
|
11
|
+
s && (T.value = [], _.value = 1, f.value = 0, c.value = i.value?.resources?.[0]?.id ?? "", m.value = i.value?.pricingOptions?.find((e) => e.isDefault === !0)?.id ?? "", r.value = "", P.value = "", w.value = "", D.value = "", $.value = "");
|
|
12
|
+
});
|
|
13
|
+
const R = d(!1), i = re("agendaData", d({})), T = d([]), _ = d(1), f = d(0), c = d(""), m = d(""), r = d(""), P = d(""), w = d(""), D = d(""), $ = d(""), Q = q(M()), g = d(), W = new Se("en-US", {
|
|
14
|
+
dateStyle: "long"
|
|
15
|
+
}), B = pe(() => {
|
|
16
|
+
if (!r.value || !m.value) return "";
|
|
17
|
+
const s = i.value?.pricingOptions?.find((I) => I.id === m.value);
|
|
18
|
+
if (!s?.duration) return r.value;
|
|
19
|
+
const [e, x] = r.value.split(":").map(Number);
|
|
20
|
+
if (isNaN(e) || isNaN(x)) return "";
|
|
21
|
+
const C = e * 60 + x + s.duration, O = Math.floor(C / 60) % 24, F = C % 60;
|
|
22
|
+
return `${O.toString().padStart(2, "0")}:${F.toString().padStart(2, "0")}`;
|
|
23
|
+
}), X = () => {
|
|
24
|
+
const s = [];
|
|
25
|
+
return T.value = [], _.value < 1 && _.value > 9999 && s.push("Please fill in a correct number of spots."), f.value < 0 && (f.value = 0), c.value || s.push("Please select a resource."), m.value || s.push("Please select a type."), g.value || s.push("Please select the booking date."), (!r.value || r.value.length !== 5 || r.value?.indexOf(":") === -1 || !parseInt(r.value?.replace(":", ""))) && s.push("Please select a correct booking time."), P.value || s.push("Please fill in the first name of the customer."), w.value || s.push("Please fill in the last name of the customer."), (!D.value || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(D.value) === !1) && s.push("Please fill in the correct email of the customer."), T.value = s, s.length === 0;
|
|
26
|
+
}, Y = async () => {
|
|
27
|
+
if (X())
|
|
28
|
+
try {
|
|
29
|
+
R.value = !0;
|
|
30
|
+
const s = {
|
|
31
|
+
agendaId: J.value.id,
|
|
32
|
+
customerInfo: {
|
|
33
|
+
firstName: P.value,
|
|
34
|
+
lastName: w.value,
|
|
35
|
+
email: D.value,
|
|
36
|
+
phone: $.value
|
|
37
|
+
},
|
|
38
|
+
amountPaid: parseFloat(f.value) ?? 0,
|
|
39
|
+
amountDue: 0,
|
|
40
|
+
subtotal: parseFloat(f.value) ?? 0,
|
|
41
|
+
total: parseFloat(f.value) ?? 0,
|
|
42
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
43
|
+
updatedAt: /* @__PURE__ */ new Date(),
|
|
44
|
+
discount: 0,
|
|
45
|
+
flattenedReservations: [`${c.value}_${g.value}_${r.value?.replace(":", "")}`],
|
|
46
|
+
paymentStatus: "paid",
|
|
47
|
+
paymentType: "full",
|
|
48
|
+
reservations: [{
|
|
49
|
+
totalPrice: parseFloat(f.value?.toFixed(2)) ?? 0,
|
|
50
|
+
basePrice: parseFloat((f.value / _.value).toFixed(2)) ?? 0,
|
|
51
|
+
addOnsPrice: 0,
|
|
52
|
+
addOns: [],
|
|
53
|
+
date: `${g.value}`,
|
|
54
|
+
id: `res_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`,
|
|
55
|
+
pricingOption: {
|
|
56
|
+
duration: i.value?.pricingOptions?.find((e) => e.id === m.value)?.duration || "",
|
|
57
|
+
id: i.value?.pricingOptions?.find((e) => e.id === m.value)?.id || "",
|
|
58
|
+
name: i.value?.pricingOptions?.find((e) => e.id === m.value)?.name || "",
|
|
59
|
+
price: i.value?.pricingOptions?.find((e) => e.id === m.value)?.price || ""
|
|
60
|
+
},
|
|
61
|
+
pricingOptionId: m.value,
|
|
62
|
+
resource: {
|
|
63
|
+
avatarLabel: i.value?.resources?.find((e) => e.id === c.value)?.avatarLabel || "",
|
|
64
|
+
color: i.value?.resources?.find((e) => e.id === c.value)?.color || "",
|
|
65
|
+
description: i.value?.resources?.find((e) => e.id === c.value)?.description || "",
|
|
66
|
+
id: i.value?.resources?.find((e) => e.id === c.value)?.id || "",
|
|
67
|
+
name: i.value?.resources?.find((e) => e.id === c.value)?.name || ""
|
|
68
|
+
},
|
|
69
|
+
resourceId: c.value,
|
|
70
|
+
spots: _.value,
|
|
71
|
+
timeslot: {
|
|
72
|
+
startTime: r.value,
|
|
73
|
+
endTime: B.value
|
|
74
|
+
}
|
|
75
|
+
}],
|
|
76
|
+
status: "confirmed"
|
|
77
|
+
};
|
|
78
|
+
await K.add(L.reservationsCollection, s);
|
|
79
|
+
} catch {
|
|
80
|
+
} finally {
|
|
81
|
+
R.value = !1, y.value = !1;
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
return (s, e) => {
|
|
85
|
+
const x = n("Button"), C = n("DialogTrigger"), O = n("DialogTitle"), F = n("DialogDescription"), I = n("DialogHeader"), v = n("Label"), b = n("Input"), E = n("SelectValue"), A = n("SelectTrigger"), j = n("SelectItem"), H = n("SelectGroup"), z = n("SelectContent"), G = n("Select"), Z = n("PopoverTrigger"), ee = n("Calendar"), le = n("PopoverContent"), te = n("Popover"), ae = n("TimeInput"), oe = n("DialogFooter"), ne = n("DialogScrollContent"), se = n("Dialog");
|
|
86
|
+
return V(), U(se, {
|
|
87
|
+
open: y.value,
|
|
88
|
+
"onUpdate:open": e[10] || (e[10] = (a) => y.value = a)
|
|
89
|
+
}, {
|
|
90
|
+
default: t(() => [
|
|
91
|
+
l(C, { "as-child": "" }, {
|
|
92
|
+
default: t(() => [
|
|
93
|
+
l(x, null, {
|
|
94
|
+
default: t(() => [
|
|
95
|
+
l(p(me), { class: "size-4" }),
|
|
96
|
+
e[11] || (e[11] = u(" Add Reservation ", -1))
|
|
97
|
+
]),
|
|
98
|
+
_: 1
|
|
99
|
+
})
|
|
100
|
+
]),
|
|
101
|
+
_: 1
|
|
102
|
+
}),
|
|
103
|
+
l(ne, { class: "sm:max-w-xl" }, {
|
|
104
|
+
default: t(() => [
|
|
105
|
+
l(I, null, {
|
|
106
|
+
default: t(() => [
|
|
107
|
+
l(O, null, {
|
|
108
|
+
default: t(() => [...e[12] || (e[12] = [
|
|
109
|
+
u("Create new reservation", -1)
|
|
110
|
+
])]),
|
|
111
|
+
_: 1
|
|
112
|
+
}),
|
|
113
|
+
l(F)
|
|
114
|
+
]),
|
|
115
|
+
_: 1
|
|
116
|
+
}),
|
|
117
|
+
o("div", De, [
|
|
118
|
+
o("div", xe, [
|
|
119
|
+
o("div", be, [
|
|
120
|
+
o("div", Pe, [
|
|
121
|
+
l(v, null, {
|
|
122
|
+
default: t(() => [...e[13] || (e[13] = [
|
|
123
|
+
u("Spots/tickets", -1)
|
|
124
|
+
])]),
|
|
125
|
+
_: 1
|
|
126
|
+
}),
|
|
127
|
+
o("div", we, [
|
|
128
|
+
l(b, {
|
|
129
|
+
modelValue: _.value,
|
|
130
|
+
"onUpdate:modelValue": e[0] || (e[0] = (a) => _.value = a),
|
|
131
|
+
modelModifiers: { number: !0 },
|
|
132
|
+
type: "number",
|
|
133
|
+
min: "1",
|
|
134
|
+
class: "no-spinner"
|
|
135
|
+
}, null, 8, ["modelValue"])
|
|
136
|
+
])
|
|
137
|
+
]),
|
|
138
|
+
o("div", ye, [
|
|
139
|
+
l(v, null, {
|
|
140
|
+
default: t(() => [...e[14] || (e[14] = [
|
|
141
|
+
u("Total price paid", -1)
|
|
142
|
+
])]),
|
|
143
|
+
_: 1
|
|
144
|
+
}),
|
|
145
|
+
o("div", Te, [
|
|
146
|
+
l(b, {
|
|
147
|
+
modelValue: f.value,
|
|
148
|
+
"onUpdate:modelValue": e[1] || (e[1] = (a) => f.value = a),
|
|
149
|
+
modelModifiers: { number: !0 },
|
|
150
|
+
type: "number",
|
|
151
|
+
min: "0",
|
|
152
|
+
class: "no-spinner"
|
|
153
|
+
}, null, 8, ["modelValue"]),
|
|
154
|
+
u(" " + S(p(i).currency), 1)
|
|
155
|
+
])
|
|
156
|
+
]),
|
|
157
|
+
o("div", $e, [
|
|
158
|
+
l(v, null, {
|
|
159
|
+
default: t(() => [...e[15] || (e[15] = [
|
|
160
|
+
u("Resource", -1)
|
|
161
|
+
])]),
|
|
162
|
+
_: 1
|
|
163
|
+
}),
|
|
164
|
+
l(G, {
|
|
165
|
+
modelValue: c.value,
|
|
166
|
+
"onUpdate:modelValue": e[2] || (e[2] = (a) => c.value = a)
|
|
167
|
+
}, {
|
|
168
|
+
default: t(() => [
|
|
169
|
+
l(A, { class: "w-full" }, {
|
|
170
|
+
default: t(() => [
|
|
171
|
+
l(E, { placeholder: "Select resource" })
|
|
172
|
+
]),
|
|
173
|
+
_: 1
|
|
174
|
+
}),
|
|
175
|
+
l(z, null, {
|
|
176
|
+
default: t(() => [
|
|
177
|
+
l(H, null, {
|
|
178
|
+
default: t(() => [
|
|
179
|
+
(V(!0), N(h, null, k(p(i).resources, (a) => (V(), U(j, {
|
|
180
|
+
value: a.id
|
|
181
|
+
}, {
|
|
182
|
+
default: t(() => [
|
|
183
|
+
u(S(a.name), 1)
|
|
184
|
+
]),
|
|
185
|
+
_: 2
|
|
186
|
+
}, 1032, ["value"]))), 256))
|
|
187
|
+
]),
|
|
188
|
+
_: 1
|
|
189
|
+
})
|
|
190
|
+
]),
|
|
191
|
+
_: 1
|
|
192
|
+
})
|
|
193
|
+
]),
|
|
194
|
+
_: 1
|
|
195
|
+
}, 8, ["modelValue"])
|
|
196
|
+
]),
|
|
197
|
+
o("div", Ce, [
|
|
198
|
+
l(v, null, {
|
|
199
|
+
default: t(() => [...e[16] || (e[16] = [
|
|
200
|
+
u("Type", -1)
|
|
201
|
+
])]),
|
|
202
|
+
_: 1
|
|
203
|
+
}),
|
|
204
|
+
l(G, {
|
|
205
|
+
modelValue: m.value,
|
|
206
|
+
"onUpdate:modelValue": e[3] || (e[3] = (a) => m.value = a)
|
|
207
|
+
}, {
|
|
208
|
+
default: t(() => [
|
|
209
|
+
l(A, { class: "w-full" }, {
|
|
210
|
+
default: t(() => [
|
|
211
|
+
l(E, { placeholder: "Select type" })
|
|
212
|
+
]),
|
|
213
|
+
_: 1
|
|
214
|
+
}),
|
|
215
|
+
l(z, null, {
|
|
216
|
+
default: t(() => [
|
|
217
|
+
l(H, null, {
|
|
218
|
+
default: t(() => [
|
|
219
|
+
(V(!0), N(h, null, k(p(i).pricingOptions, (a) => (V(), U(j, {
|
|
220
|
+
value: a.id
|
|
221
|
+
}, {
|
|
222
|
+
default: t(() => [
|
|
223
|
+
u(S(a.name) + " (" + S(a.duration) + "min) ", 1)
|
|
224
|
+
]),
|
|
225
|
+
_: 2
|
|
226
|
+
}, 1032, ["value"]))), 256))
|
|
227
|
+
]),
|
|
228
|
+
_: 1
|
|
229
|
+
})
|
|
230
|
+
]),
|
|
231
|
+
_: 1
|
|
232
|
+
})
|
|
233
|
+
]),
|
|
234
|
+
_: 1
|
|
235
|
+
}, 8, ["modelValue"])
|
|
236
|
+
])
|
|
237
|
+
])
|
|
238
|
+
]),
|
|
239
|
+
o("div", Ne, [
|
|
240
|
+
o("div", Oe, [
|
|
241
|
+
o("div", Fe, [
|
|
242
|
+
l(v, null, {
|
|
243
|
+
default: t(() => [...e[17] || (e[17] = [
|
|
244
|
+
u("Date", -1)
|
|
245
|
+
])]),
|
|
246
|
+
_: 1
|
|
247
|
+
}),
|
|
248
|
+
l(te, null, {
|
|
249
|
+
default: t(({ close: a }) => [
|
|
250
|
+
l(Z, { "as-child": "" }, {
|
|
251
|
+
default: t(() => [
|
|
252
|
+
l(x, {
|
|
253
|
+
variant: "outline",
|
|
254
|
+
class: ce(p(Ve)("w-[240px] justify-start text-left font-normal", !g.value && "text-muted-foreground"))
|
|
255
|
+
}, {
|
|
256
|
+
default: t(() => [
|
|
257
|
+
l(p(ve)),
|
|
258
|
+
u(" " + S(g.value ? p(W).format(g.value.toDate(p(M)())) : "Pick a date"), 1)
|
|
259
|
+
]),
|
|
260
|
+
_: 1
|
|
261
|
+
}, 8, ["class"])
|
|
262
|
+
]),
|
|
263
|
+
_: 1
|
|
264
|
+
}),
|
|
265
|
+
l(le, {
|
|
266
|
+
class: "w-auto p-0",
|
|
267
|
+
align: "start"
|
|
268
|
+
}, {
|
|
269
|
+
default: t(() => [
|
|
270
|
+
l(ee, {
|
|
271
|
+
modelValue: g.value,
|
|
272
|
+
"onUpdate:modelValue": [
|
|
273
|
+
e[4] || (e[4] = (ue) => g.value = ue),
|
|
274
|
+
a
|
|
275
|
+
],
|
|
276
|
+
"default-placeholder": p(Q),
|
|
277
|
+
layout: "month-and-year",
|
|
278
|
+
"initial-focus": "",
|
|
279
|
+
minValue: p(q)(p(M)())
|
|
280
|
+
}, null, 8, ["modelValue", "default-placeholder", "onUpdate:modelValue", "minValue"])
|
|
281
|
+
]),
|
|
282
|
+
_: 2
|
|
283
|
+
}, 1024)
|
|
284
|
+
]),
|
|
285
|
+
_: 1
|
|
286
|
+
})
|
|
287
|
+
])
|
|
288
|
+
]),
|
|
289
|
+
o("div", Ie, [
|
|
290
|
+
o("div", Ue, [
|
|
291
|
+
l(v, null, {
|
|
292
|
+
default: t(() => [...e[18] || (e[18] = [
|
|
293
|
+
u("Start time", -1)
|
|
294
|
+
])]),
|
|
295
|
+
_: 1
|
|
296
|
+
}),
|
|
297
|
+
l(ae, {
|
|
298
|
+
modelValue: r.value,
|
|
299
|
+
"onUpdate:modelValue": e[5] || (e[5] = (a) => r.value = a)
|
|
300
|
+
}, null, 8, ["modelValue"])
|
|
301
|
+
]),
|
|
302
|
+
o("div", he, [
|
|
303
|
+
l(v, null, {
|
|
304
|
+
default: t(() => [...e[19] || (e[19] = [
|
|
305
|
+
u("End time", -1)
|
|
306
|
+
])]),
|
|
307
|
+
_: 1
|
|
308
|
+
}),
|
|
309
|
+
o("div", ke, S(p(B) || "--:--"), 1)
|
|
310
|
+
])
|
|
311
|
+
])
|
|
312
|
+
]),
|
|
313
|
+
o("div", Me, [
|
|
314
|
+
o("div", Le, [
|
|
315
|
+
o("div", Re, [
|
|
316
|
+
l(v, null, {
|
|
317
|
+
default: t(() => [...e[20] || (e[20] = [
|
|
318
|
+
u("Firstname", -1)
|
|
319
|
+
])]),
|
|
320
|
+
_: 1
|
|
321
|
+
}),
|
|
322
|
+
l(b, {
|
|
323
|
+
modelValue: P.value,
|
|
324
|
+
"onUpdate:modelValue": e[6] || (e[6] = (a) => P.value = a)
|
|
325
|
+
}, null, 8, ["modelValue"])
|
|
326
|
+
]),
|
|
327
|
+
o("div", Be, [
|
|
328
|
+
l(v, null, {
|
|
329
|
+
default: t(() => [...e[21] || (e[21] = [
|
|
330
|
+
u("Lastname", -1)
|
|
331
|
+
])]),
|
|
332
|
+
_: 1
|
|
333
|
+
}),
|
|
334
|
+
l(b, {
|
|
335
|
+
modelValue: w.value,
|
|
336
|
+
"onUpdate:modelValue": e[7] || (e[7] = (a) => w.value = a)
|
|
337
|
+
}, null, 8, ["modelValue"])
|
|
338
|
+
])
|
|
339
|
+
]),
|
|
340
|
+
o("div", Ee, [
|
|
341
|
+
o("div", Ae, [
|
|
342
|
+
l(v, null, {
|
|
343
|
+
default: t(() => [...e[22] || (e[22] = [
|
|
344
|
+
u("E-mail", -1)
|
|
345
|
+
])]),
|
|
346
|
+
_: 1
|
|
347
|
+
}),
|
|
348
|
+
l(b, {
|
|
349
|
+
modelValue: D.value,
|
|
350
|
+
"onUpdate:modelValue": e[8] || (e[8] = (a) => D.value = a)
|
|
351
|
+
}, null, 8, ["modelValue"])
|
|
352
|
+
]),
|
|
353
|
+
o("div", je, [
|
|
354
|
+
l(v, null, {
|
|
355
|
+
default: t(() => [...e[23] || (e[23] = [
|
|
356
|
+
u("Phone Nr ", -1),
|
|
357
|
+
o("span", { class: "italic text-xs opacity-50" }, "optional", -1)
|
|
358
|
+
])]),
|
|
359
|
+
_: 1
|
|
360
|
+
}),
|
|
361
|
+
l(b, {
|
|
362
|
+
modelValue: $.value,
|
|
363
|
+
"onUpdate:modelValue": e[9] || (e[9] = (a) => $.value = a)
|
|
364
|
+
}, null, 8, ["modelValue"])
|
|
365
|
+
])
|
|
366
|
+
])
|
|
367
|
+
]),
|
|
368
|
+
o("div", He, [
|
|
369
|
+
o("ul", ze, [
|
|
370
|
+
(V(!0), N(h, null, k(T.value, (a) => (V(), N("li", { key: a }, S(a), 1))), 128))
|
|
371
|
+
])
|
|
372
|
+
])
|
|
373
|
+
]),
|
|
374
|
+
l(oe, { class: "gap-2" }, {
|
|
375
|
+
default: t(() => [
|
|
376
|
+
l(x, { onClick: Y }, {
|
|
377
|
+
default: t(() => [...e[24] || (e[24] = [
|
|
378
|
+
u("Add reservation", -1)
|
|
379
|
+
])]),
|
|
380
|
+
_: 1
|
|
381
|
+
})
|
|
382
|
+
]),
|
|
383
|
+
_: 1
|
|
384
|
+
})
|
|
385
|
+
]),
|
|
386
|
+
_: 1
|
|
387
|
+
})
|
|
388
|
+
]),
|
|
389
|
+
_: 1
|
|
390
|
+
}, 8, ["open"]);
|
|
391
|
+
};
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
export {
|
|
395
|
+
Xe as _
|
|
396
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("vue"),O=require("lucide-vue-next"),D=require("@oneclick.dev/cms-kit"),X=require("./utils-D6CaKJbp.js"),f=require("./DateFormatter-BPPBZp1j.js"),Y={class:"@container/new-res-form space-y-5 py-4"},Z={class:"grid gap-4"},ee={class:"grid gap-4 @md/new-res-form:grid-cols-2"},te={class:"grid gap-2"},oe={class:"flex gap-2 items-center"},ae={class:"grid gap-2"},le={class:"flex gap-2 items-center"},ne={class:"grid gap-2"},re={class:"grid gap-2"},se={class:"grid gap-4"},de={class:"grid gap-4 @md/new-res-form:grid-cols-2"},ie={class:"grid gap-2"},ue={class:"grid gap-4 @md/new-res-form:grid-cols-2"},ce={class:"grid gap-2"},pe={class:"grid gap-2"},me={class:"flex items-center h-9 px-3 text-sm text-muted-foreground"},ve={class:"grid gap-4"},fe={class:"grid gap-4 @md/new-res-form:grid-cols-2"},Ve={class:"grid gap-2"},ge={class:"grid gap-2"},Ne={class:"grid gap-4 @md/new-res-form:grid-cols-2"},_e={class:"grid gap-2"},xe={class:"grid gap-2"},Ce={class:"mt-4 text-red-400"},we={class:"list-disc pl-4"},he=e.defineComponent({__name:"NewReservationDialog",setup(Te){const{params:I}=D.useModuleRoute(),{config:S}=D.useModule(),U=D.useFirebaseIntegration(S.project),N=e.ref(!1);e.watch(N,a=>{a&&(_.value=[],c.value=1,i.value=0,r.value=l.value?.resources?.[0]?.id??"",s.value=l.value?.pricingOptions?.find(t=>t.isDefault===!0)?.id??"",n.value="",V.value="",g.value="",p.value="",x.value="")});const E=e.ref(!1),l=e.inject("agendaData",e.ref({})),_=e.ref([]),c=e.ref(1),i=e.ref(0),r=e.ref(""),s=e.ref(""),n=e.ref(""),V=e.ref(""),g=e.ref(""),p=e.ref(""),x=e.ref(""),L=f.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3(f.$14e0f24ef4ac5c92$export$aa8b41735afcabd2()),u=e.ref(),M=new f.$fb18d541ea1ad717$export$ad991b66133851cf("en-US",{dateStyle:"long"}),b=e.computed(()=>{if(!n.value||!s.value)return"";const a=l.value?.pricingOptions?.find(T=>T.id===s.value);if(!a?.duration)return n.value;const[t,m]=n.value.split(":").map(Number);if(isNaN(t)||isNaN(m))return"";const C=t*60+m+a.duration,w=Math.floor(C/60)%24,h=C%60;return`${w.toString().padStart(2,"0")}:${h.toString().padStart(2,"0")}`}),R=()=>{const a=[];return _.value=[],c.value<1&&c.value>9999&&a.push("Please fill in a correct number of spots."),i.value<0&&(i.value=0),r.value||a.push("Please select a resource."),s.value||a.push("Please select a type."),u.value||a.push("Please select the booking date."),(!n.value||n.value.length!==5||n.value?.indexOf(":")===-1||!parseInt(n.value?.replace(":","")))&&a.push("Please select a correct booking time."),V.value||a.push("Please fill in the first name of the customer."),g.value||a.push("Please fill in the last name of the customer."),(!p.value||/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(p.value)===!1)&&a.push("Please fill in the correct email of the customer."),_.value=a,a.length===0},q=async()=>{if(R())try{E.value=!0;const a={agendaId:I.value.id,customerInfo:{firstName:V.value,lastName:g.value,email:p.value,phone:x.value},amountPaid:parseFloat(i.value)??0,amountDue:0,subtotal:parseFloat(i.value)??0,total:parseFloat(i.value)??0,createdAt:new Date,updatedAt:new Date,discount:0,flattenedReservations:[`${r.value}_${u.value}_${n.value?.replace(":","")}`],paymentStatus:"paid",paymentType:"full",reservations:[{totalPrice:parseFloat(i.value?.toFixed(2))??0,basePrice:parseFloat((i.value/c.value).toFixed(2))??0,addOnsPrice:0,addOns:[],date:`${u.value}`,id:`res_${Date.now()}_${Math.random().toString(36).substring(2,9)}`,pricingOption:{duration:l.value?.pricingOptions?.find(t=>t.id===s.value)?.duration||"",id:l.value?.pricingOptions?.find(t=>t.id===s.value)?.id||"",name:l.value?.pricingOptions?.find(t=>t.id===s.value)?.name||"",price:l.value?.pricingOptions?.find(t=>t.id===s.value)?.price||""},pricingOptionId:s.value,resource:{avatarLabel:l.value?.resources?.find(t=>t.id===r.value)?.avatarLabel||"",color:l.value?.resources?.find(t=>t.id===r.value)?.color||"",description:l.value?.resources?.find(t=>t.id===r.value)?.description||"",id:l.value?.resources?.find(t=>t.id===r.value)?.id||"",name:l.value?.resources?.find(t=>t.id===r.value)?.name||""},resourceId:r.value,spots:c.value,timeslot:{startTime:n.value,endTime:b.value}}],status:"confirmed"};await U.add(S.reservationsCollection,a)}catch{}finally{E.value=!1,N.value=!1}};return(a,t)=>{const m=e.resolveComponent("Button"),C=e.resolveComponent("DialogTrigger"),w=e.resolveComponent("DialogTitle"),h=e.resolveComponent("DialogDescription"),T=e.resolveComponent("DialogHeader"),d=e.resolveComponent("Label"),v=e.resolveComponent("Input"),y=e.resolveComponent("SelectValue"),$=e.resolveComponent("SelectTrigger"),P=e.resolveComponent("SelectItem"),k=e.resolveComponent("SelectGroup"),B=e.resolveComponent("SelectContent"),F=e.resolveComponent("Select"),A=e.resolveComponent("PopoverTrigger"),j=e.resolveComponent("Calendar"),H=e.resolveComponent("PopoverContent"),z=e.resolveComponent("Popover"),G=e.resolveComponent("TimeInput"),K=e.resolveComponent("DialogFooter"),J=e.resolveComponent("DialogScrollContent"),Q=e.resolveComponent("Dialog");return e.openBlock(),e.createBlock(Q,{open:N.value,"onUpdate:open":t[10]||(t[10]=o=>N.value=o)},{default:e.withCtx(()=>[e.createVNode(C,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(m,null,{default:e.withCtx(()=>[e.createVNode(e.unref(O.Plus),{class:"size-4"}),t[11]||(t[11]=e.createTextVNode(" Add Reservation ",-1))]),_:1})]),_:1}),e.createVNode(J,{class:"sm:max-w-xl"},{default:e.withCtx(()=>[e.createVNode(T,null,{default:e.withCtx(()=>[e.createVNode(w,null,{default:e.withCtx(()=>[...t[12]||(t[12]=[e.createTextVNode("Create new reservation",-1)])]),_:1}),e.createVNode(h)]),_:1}),e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createElementVNode("div",ee,[e.createElementVNode("div",te,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[13]||(t[13]=[e.createTextVNode("Spots/tickets",-1)])]),_:1}),e.createElementVNode("div",oe,[e.createVNode(v,{modelValue:c.value,"onUpdate:modelValue":t[0]||(t[0]=o=>c.value=o),modelModifiers:{number:!0},type:"number",min:"1",class:"no-spinner"},null,8,["modelValue"])])]),e.createElementVNode("div",ae,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[14]||(t[14]=[e.createTextVNode("Total price paid",-1)])]),_:1}),e.createElementVNode("div",le,[e.createVNode(v,{modelValue:i.value,"onUpdate:modelValue":t[1]||(t[1]=o=>i.value=o),modelModifiers:{number:!0},type:"number",min:"0",class:"no-spinner"},null,8,["modelValue"]),e.createTextVNode(" "+e.toDisplayString(e.unref(l).currency),1)])]),e.createElementVNode("div",ne,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[15]||(t[15]=[e.createTextVNode("Resource",-1)])]),_:1}),e.createVNode(F,{modelValue:r.value,"onUpdate:modelValue":t[2]||(t[2]=o=>r.value=o)},{default:e.withCtx(()=>[e.createVNode($,{class:"w-full"},{default:e.withCtx(()=>[e.createVNode(y,{placeholder:"Select resource"})]),_:1}),e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(k,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l).resources,o=>(e.openBlock(),e.createBlock(P,{value:o.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.name),1)]),_:2},1032,["value"]))),256))]),_:1})]),_:1})]),_:1},8,["modelValue"])]),e.createElementVNode("div",re,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[16]||(t[16]=[e.createTextVNode("Type",-1)])]),_:1}),e.createVNode(F,{modelValue:s.value,"onUpdate:modelValue":t[3]||(t[3]=o=>s.value=o)},{default:e.withCtx(()=>[e.createVNode($,{class:"w-full"},{default:e.withCtx(()=>[e.createVNode(y,{placeholder:"Select type"})]),_:1}),e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(k,null,{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l).pricingOptions,o=>(e.openBlock(),e.createBlock(P,{value:o.id},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.name)+" ("+e.toDisplayString(o.duration)+"min) ",1)]),_:2},1032,["value"]))),256))]),_:1})]),_:1})]),_:1},8,["modelValue"])])])]),e.createElementVNode("div",se,[e.createElementVNode("div",de,[e.createElementVNode("div",ie,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[17]||(t[17]=[e.createTextVNode("Date",-1)])]),_:1}),e.createVNode(z,null,{default:e.withCtx(({close:o})=>[e.createVNode(A,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(m,{variant:"outline",class:e.normalizeClass(e.unref(X.classNames)("w-[240px] justify-start text-left font-normal",!u.value&&"text-muted-foreground"))},{default:e.withCtx(()=>[e.createVNode(e.unref(O.CalendarIcon)),e.createTextVNode(" "+e.toDisplayString(u.value?e.unref(M).format(u.value.toDate(e.unref(f.$14e0f24ef4ac5c92$export$aa8b41735afcabd2)())):"Pick a date"),1)]),_:1},8,["class"])]),_:1}),e.createVNode(H,{class:"w-auto p-0",align:"start"},{default:e.withCtx(()=>[e.createVNode(j,{modelValue:u.value,"onUpdate:modelValue":[t[4]||(t[4]=W=>u.value=W),o],"default-placeholder":e.unref(L),layout:"month-and-year","initial-focus":"",minValue:e.unref(f.$14e0f24ef4ac5c92$export$d0bdf45af03a6ea3)(e.unref(f.$14e0f24ef4ac5c92$export$aa8b41735afcabd2)())},null,8,["modelValue","default-placeholder","onUpdate:modelValue","minValue"])]),_:2},1024)]),_:1})])]),e.createElementVNode("div",ue,[e.createElementVNode("div",ce,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[18]||(t[18]=[e.createTextVNode("Start time",-1)])]),_:1}),e.createVNode(G,{modelValue:n.value,"onUpdate:modelValue":t[5]||(t[5]=o=>n.value=o)},null,8,["modelValue"])]),e.createElementVNode("div",pe,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[19]||(t[19]=[e.createTextVNode("End time",-1)])]),_:1}),e.createElementVNode("div",me,e.toDisplayString(e.unref(b)||"--:--"),1)])])]),e.createElementVNode("div",ve,[e.createElementVNode("div",fe,[e.createElementVNode("div",Ve,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[20]||(t[20]=[e.createTextVNode("Firstname",-1)])]),_:1}),e.createVNode(v,{modelValue:V.value,"onUpdate:modelValue":t[6]||(t[6]=o=>V.value=o)},null,8,["modelValue"])]),e.createElementVNode("div",ge,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[21]||(t[21]=[e.createTextVNode("Lastname",-1)])]),_:1}),e.createVNode(v,{modelValue:g.value,"onUpdate:modelValue":t[7]||(t[7]=o=>g.value=o)},null,8,["modelValue"])])]),e.createElementVNode("div",Ne,[e.createElementVNode("div",_e,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[22]||(t[22]=[e.createTextVNode("E-mail",-1)])]),_:1}),e.createVNode(v,{modelValue:p.value,"onUpdate:modelValue":t[8]||(t[8]=o=>p.value=o)},null,8,["modelValue"])]),e.createElementVNode("div",xe,[e.createVNode(d,null,{default:e.withCtx(()=>[...t[23]||(t[23]=[e.createTextVNode("Phone Nr ",-1),e.createElementVNode("span",{class:"italic text-xs opacity-50"},"optional",-1)])]),_:1}),e.createVNode(v,{modelValue:x.value,"onUpdate:modelValue":t[9]||(t[9]=o=>x.value=o)},null,8,["modelValue"])])])]),e.createElementVNode("div",Ce,[e.createElementVNode("ul",we,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(_.value,o=>(e.openBlock(),e.createElementBlock("li",{key:o},e.toDisplayString(o),1))),128))])])]),e.createVNode(K,{class:"gap-2"},{default:e.withCtx(()=>[e.createVNode(m,{onClick:q},{default:e.withCtx(()=>[...t[24]||(t[24]=[e.createTextVNode("Add reservation",-1)])]),_:1})]),_:1})]),_:1})]),_:1},8,["open"])}}});exports._sfc_main=he;
|