@oneclick.dev/cms-core-modules 0.0.102 → 0.0.104
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/AgendaOpeningHoursCard-B7ROIPWw.js +1 -0
- package/dist/AgendaOpeningHoursCard-Cp4wxUeK.mjs +172 -0
- package/dist/AppointmentListTable-DZJNmTMb.mjs +177 -0
- package/dist/AppointmentListTable-Dieu9US_.js +1 -0
- package/dist/{ContentEditor-Cjqgb64R.mjs → ContentEditor-B1nfKG_5.mjs} +706 -677
- package/dist/{ContentEditor-YgOS3kxS.js → ContentEditor-DdFU8piH.js} +15 -16
- package/dist/{Create-6uT9HWar.mjs → Create-BRBh0xjM.mjs} +2 -2
- package/dist/{Create-DuZ5nZrX.js → Create-qPeQxkdl.js} +1 -1
- package/dist/{DateFormatter-2B0R-DY4.mjs → DateFormatter-Bw-87W31.mjs} +212 -227
- package/dist/DateFormatter-CYAD4GBN.js +1 -0
- package/dist/{Detail-BZ-iE9vf.js → Detail-C857g62L.js} +1 -1
- package/dist/{Detail-CJVMJDP7.mjs → Detail-CujdFApD.mjs} +2 -2
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DWMqQvHl.mjs +76 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-kpjbVSXg.js +1 -0
- package/dist/{Entries-DkRhOt95.js → Entries-BaS6H6ak.js} +1 -1
- package/dist/{Entries-dLlCrXXe.mjs → Entries-C8UJkrVC.mjs} +1 -1
- package/dist/{Find-Bd1uLqSa.mjs → Find-B24ZEhYM.mjs} +1 -1
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-9Q7TMm4u.mjs} +37 -37
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-CqERfyYb.js → NewReservationDialog.vue_vue_type_script_setup_true_lang-DiNzGl-q.js} +1 -1
- package/dist/{Overview-DoOASlNz.mjs → Overview-3HWhsqaz.mjs} +2 -2
- package/dist/{Overview-37nilXzE.js → Overview-CpHhuiaV.js} +1 -1
- package/dist/{Overview-DeQQ0FY3.js → Overview-DAxCu9XC.js} +1 -1
- package/dist/{Overview-C--dq51X.mjs → Overview-D_T3K6aq.mjs} +1 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cz_22Oce.mjs +2927 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DPPNc-Z5.js +349 -0
- package/dist/TableView-CPAw3h8g.js +4 -0
- package/dist/TableView-DXmEF6pY.mjs +6143 -0
- package/dist/agenda-BNG05SAq.js +1 -0
- package/dist/agenda-D1RxMxBS.mjs +1152 -0
- package/dist/availability-CMrRa5y2.mjs +269 -0
- package/dist/availability-Cf2YfMwM.js +1 -0
- package/dist/booking-data-DgJd0BcM.mjs +889 -0
- package/dist/booking-data-Di5GmH_8.js +1 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/{exceptions-Bp5BSvxO.js → exceptions-CI0B4xVj.js} +1 -1
- package/dist/{exceptions-C97cNZYl.mjs → exceptions-vo8SA5SE.mjs} +68 -68
- package/dist/index-BtujSJeg.js +35 -0
- package/dist/{index-CrGjxSwa.mjs → index-CrgzoTyR.mjs} +1 -1
- package/dist/{index-D2a6wEPh.js → index-DPd3waTN.js} +1 -1
- package/dist/{index-CABh6Qn6.mjs → index-DrXxXB2F.mjs} +15 -15
- package/dist/{index-B-lVEpFX.mjs → index-MYWjg0zi.mjs} +3 -3
- package/dist/index-dOdMm1pV.mjs +1105 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +196 -143
- package/dist/interpolation-DEDSLETn.mjs +128 -0
- package/dist/interpolation-DERg6Lwt.js +1 -0
- package/dist/orders-CzzcFQha.mjs +559 -0
- package/dist/orders-ETtbA4aQ.js +1 -0
- package/dist/{payment-Bosr0m3u.mjs → payment-C3ohkehF.mjs} +1 -1
- package/dist/{payment-DDnC03jb.js → payment-Dfr-Ro-a.js} +1 -1
- package/dist/{resources-BtF5RUUq.js → resources-CxeFd57z.js} +1 -1
- package/dist/{resources-B7qDBC91.mjs → resources-WI_4SO6T.mjs} +2 -2
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +457 -387
- package/dist/src/appointments/chat-components/AgendaOpeningHoursCard.vue.d.ts +15 -0
- package/dist/src/appointments/components/edit/CustomerInformationFieldEditorDialog.vue.d.ts +17 -5
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +8 -3
- package/dist/src/appointments/components/edit/EventDialog/EventDialog.vue.d.ts +1 -0
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +6 -3
- package/dist/src/appointments/components/edit/EventTimeline.vue.d.ts +3 -0
- package/dist/src/appointments/components/edit/EventView.vue.d.ts +6 -1
- package/dist/src/appointments/components/edit/MetadataSchemaEditorDialog.vue.d.ts +12 -0
- package/dist/src/appointments/components/edit/OrderMetadataDisplay.vue.d.ts +21 -0
- package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +8 -3
- package/dist/src/appointments/index.d.ts +53 -0
- package/dist/src/appointments/pages/edit/agenda.vue.d.ts +3 -1
- package/dist/src/appointments/pages/edit/availability.vue.d.ts +1 -26
- package/dist/src/appointments/pages/edit/booking-data.vue.d.ts +65 -0
- package/dist/src/appointments/pages/edit/orders.vue.d.ts +7 -3
- package/dist/src/appointments/tools.d.ts +52 -0
- package/dist/src/appointments/types.d.ts +12 -0
- package/dist/src/table/config.d.ts +200 -0
- package/dist/src/table/get_data_flow-DEFAULT.json.d.ts +129 -0
- package/dist/src/table/index.d.ts +200 -0
- package/dist/utils-CanmrIWO.mjs +47 -0
- package/dist/utils-Yd6F5mea.js +3 -0
- package/package.json +2 -2
- package/src/appointments/tools.ts +38 -0
- package/dist/AppointmentListTable-CQ0WIXtj.js +0 -1
- package/dist/AppointmentListTable-aV_UJd6j.mjs +0 -159
- package/dist/DateFormatter-DbtOLV0L.js +0 -1
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DXa-Xxue.mjs +0 -74
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-ozYrxb2g.js +0 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CL5kbDII.mjs +0 -2782
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DcyyNvf6.js +0 -349
- package/dist/TableView-CIJs118q.mjs +0 -5929
- package/dist/TableView-DzZYf34i.js +0 -4
- package/dist/agenda-CCOjPiwP.mjs +0 -1133
- package/dist/agenda-CNPQfaIQ.js +0 -1
- package/dist/availability-B1D4Fyzi.mjs +0 -629
- package/dist/availability-DxrUcYbW.js +0 -1
- package/dist/index-BOnqrBfY.js +0 -35
- package/dist/index-Bj0qaL1N.mjs +0 -1091
- package/dist/interpolation-BBwG_ON6.mjs +0 -65
- package/dist/interpolation-CsOrww73.js +0 -1
- package/dist/orders-BJV5vRQr.mjs +0 -397
- package/dist/orders-C1C5IEIP.js +0 -1
- package/dist/regular-slots-Cc1jmKuC.mjs +0 -222
- package/dist/regular-slots-DBs1XVeN.js +0 -1
- package/dist/src/appointments/pages/edit/regular-slots.vue.d.ts +0 -2
- package/dist/utils-BVKy9S2J.mjs +0 -29
- package/dist/utils-D6CaKJbp.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("lucide-vue-next"),C={class:"w-full"},V={key:0,class:"flex items-center gap-2 py-3"},b={key:1,class:"text-xs text-destructive py-2"},w={key:2,class:"rounded-xl border bg-background p-3 space-y-3"},D={class:"relative flex items-start gap-3"},S={class:"shrink-0 size-10 rounded-lg bg-primary/10 flex items-center justify-center"},I={class:"flex-1 min-w-0 pr-10"},M={class:"text-sm font-semibold truncate"},$={class:"text-xs text-muted-foreground"},T={key:0,class:"text-xs text-muted-foreground text-center py-2"},j={key:1,class:"space-y-2"},z={class:"flex items-center justify-between"},A={class:"text-xs font-medium"},L={key:0,class:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 uppercase"},F={key:0,class:"flex items-center gap-1.5 text-xs text-red-500"},q={key:1,class:"space-y-0.5"},O={key:2,class:"text-xs text-muted-foreground"},H=e.defineComponent({__name:"AgendaOpeningHoursCard",props:{toolName:{},projectSlug:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(r,{emit:f}){const{$useModuleApi:x}=useNuxtApp(),i=r,y=f,k=x(i.instanceId),u=e.ref(!0),a=e.ref(null),d=e.ref(null),v=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];async function N(){const{agendaId:n,date:t}=i.resolvedArgs||{};if(!n||!t){a.value="Agenda ID and date are required",u.value=!1,m(`Error: ${a.value}`);return}u.value=!0,a.value=null;try{const o=await k.get(`/agendas/${n}/opening-hours?date=${t}`);d.value=o,m({agendaId:o.agendaId,serviceName:o.serviceName,date:o.date,resources:o.resources.map(s=>({resourceId:s.resourceId,resourceName:s.resourceName,isClosed:s.isClosed,hours:s.hours,isException:s.isException}))})}catch(o){a.value=o?.data?.statusMessage||o?.message||"Failed to load opening hours",m(`Error loading opening hours: ${a.value}`)}finally{u.value=!1}}e.onMounted(()=>{N()});function m(n){i.status!=="completed"&&y("submit",n)}const h=e.computed(()=>{if(!d.value?.date)return"";const n=new Date(d.value.date+"T00:00:00");return`${v[n.getDay()]}, ${n.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})}`});return(n,t)=>{const o=e.resolveComponent("DropdownMenuTrigger"),s=e.resolveComponent("NuxtLink"),p=e.resolveComponent("DropdownMenuItem"),_=e.resolveComponent("DropdownMenuContent"),E=e.resolveComponent("DropdownMenu");return e.openBlock(),e.createElementBlock("div",C,[e.unref(u)?(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(e.unref(c.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),t[0]||(t[0]=e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"Loading opening hours…",-1))])):e.unref(a)?(e.openBlock(),e.createElementBlock("div",b,e.toDisplayString(e.unref(a)),1)):e.unref(d)?(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",D,[e.createElementVNode("div",S,[e.createVNode(e.unref(c.CalendarDays),{class:"size-5 text-primary"})]),e.createElementVNode("div",I,[e.createElementVNode("p",M,e.toDisplayString(e.unref(d).serviceName),1),e.createElementVNode("p",$,e.toDisplayString(e.unref(h)),1)]),e.createVNode(E,null,{default:e.withCtx(()=>[e.createVNode(o,{class:"absolute top-2 right-2"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.Settings),{class:"size-4 text-muted-foreground hover:text-foreground transition-colors"})]),_:1}),e.createVNode(_,{align:"end"},{default:e.withCtx(()=>[e.createVNode(p,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(s,{to:`/projects/${r.projectSlug}/modules/${r.instanceId}/edit/${r.resolvedArgs.agendaId}/resources`},{default:e.withCtx(()=>[e.createVNode(e.unref(c.CalendarCog),{class:"size-4"}),t[1]||(t[1]=e.createTextVNode(" Regular hours ",-1))]),_:1},8,["to"])]),_:1}),e.createVNode(p,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(s,{to:`/projects/${r.projectSlug}/modules/${r.instanceId}/edit/${r.resolvedArgs.agendaId}/exceptions`},{default:e.withCtx(()=>[e.createVNode(e.unref(c.CalendarCog),{class:"size-4"}),t[2]||(t[2]=e.createTextVNode(" Closures & exceptions ",-1))]),_:1},8,["to"])]),_:1})]),_:1})]),_:1})]),e.unref(d).resources.length===0?(e.openBlock(),e.createElementBlock("div",T," No active resources found for this agenda. ")):(e.openBlock(),e.createElementBlock("div",j,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(d).resources,l=>(e.openBlock(),e.createElementBlock("div",{key:l.resourceId,class:"rounded-lg border px-3 py-2 space-y-1"},[e.createElementVNode("div",z,[e.createElementVNode("span",A,e.toDisplayString(l.resourceName),1),l.isException?(e.openBlock(),e.createElementBlock("span",L," Exception ")):e.createCommentVNode("",!0)]),l.isClosed?(e.openBlock(),e.createElementBlock("div",F,[e.createVNode(e.unref(c.BanIcon),{class:"size-3"}),t[3]||(t[3]=e.createElementVNode("span",null,"Closed",-1))])):l.hours.length>0?(e.openBlock(),e.createElementBlock("div",q,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.hours,(g,B)=>(e.openBlock(),e.createElementBlock("div",{key:B,class:"flex items-center gap-1.5 text-xs text-muted-foreground"},[e.createVNode(e.unref(c.Clock),{class:"size-3"}),e.createElementVNode("span",null,e.toDisplayString(g.start)+" – "+e.toDisplayString(g.end),1)]))),128))])):(e.openBlock(),e.createElementBlock("div",O," No hours set "))]))),128))]))])):e.createCommentVNode("",!0)])}}});exports.default=H;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { defineComponent as V, ref as _, onMounted as B, computed as F, resolveComponent as x, openBlock as t, createElementBlock as s, unref as e, createVNode as o, createElementVNode as r, toDisplayString as g, withCtx as m, createTextVNode as b, Fragment as N, renderList as C, createCommentVNode as I } from "vue";
|
|
2
|
+
import { Loader2 as H, CalendarDays as O, Settings as q, CalendarCog as D, BanIcon as R, Clock as U } from "lucide-vue-next";
|
|
3
|
+
const W = { class: "w-full" }, G = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "flex items-center gap-2 py-3"
|
|
6
|
+
}, J = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "text-xs text-destructive py-2"
|
|
9
|
+
}, K = {
|
|
10
|
+
key: 2,
|
|
11
|
+
class: "rounded-xl border bg-background p-3 space-y-3"
|
|
12
|
+
}, P = { class: "relative flex items-start gap-3" }, Q = { class: "shrink-0 size-10 rounded-lg bg-primary/10 flex items-center justify-center" }, X = { class: "flex-1 min-w-0 pr-10" }, Y = { class: "text-sm font-semibold truncate" }, Z = { class: "text-xs text-muted-foreground" }, ee = {
|
|
13
|
+
key: 0,
|
|
14
|
+
class: "text-xs text-muted-foreground text-center py-2"
|
|
15
|
+
}, te = {
|
|
16
|
+
key: 1,
|
|
17
|
+
class: "space-y-2"
|
|
18
|
+
}, se = { class: "flex items-center justify-between" }, oe = { class: "text-xs font-medium" }, ne = {
|
|
19
|
+
key: 0,
|
|
20
|
+
class: "text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-amber-50 dark:bg-amber-900/20 text-amber-600 dark:text-amber-400 uppercase"
|
|
21
|
+
}, ae = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "flex items-center gap-1.5 text-xs text-red-500"
|
|
24
|
+
}, re = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "space-y-0.5"
|
|
27
|
+
}, de = {
|
|
28
|
+
key: 2,
|
|
29
|
+
class: "text-xs text-muted-foreground"
|
|
30
|
+
}, le = /* @__PURE__ */ V({
|
|
31
|
+
__name: "AgendaOpeningHoursCard",
|
|
32
|
+
props: {
|
|
33
|
+
toolName: {},
|
|
34
|
+
projectSlug: {},
|
|
35
|
+
instanceId: {},
|
|
36
|
+
instanceName: {},
|
|
37
|
+
moduleType: {},
|
|
38
|
+
resolvedArgs: {},
|
|
39
|
+
status: {}
|
|
40
|
+
},
|
|
41
|
+
emits: ["submit"],
|
|
42
|
+
setup(u, { emit: w }) {
|
|
43
|
+
const { $useModuleApi: $ } = useNuxtApp(), y = u, M = w, S = $(y.instanceId), f = _(!0), l = _(null), c = _(null), z = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
|
|
44
|
+
async function A() {
|
|
45
|
+
const { agendaId: d, date: n } = y.resolvedArgs || {};
|
|
46
|
+
if (!d || !n) {
|
|
47
|
+
l.value = "Agenda ID and date are required", f.value = !1, v(`Error: ${l.value}`);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
f.value = !0, l.value = null;
|
|
51
|
+
try {
|
|
52
|
+
const a = await S.get(`/agendas/${d}/opening-hours?date=${n}`);
|
|
53
|
+
c.value = a, v({
|
|
54
|
+
agendaId: a.agendaId,
|
|
55
|
+
serviceName: a.serviceName,
|
|
56
|
+
date: a.date,
|
|
57
|
+
resources: a.resources.map((i) => ({
|
|
58
|
+
resourceId: i.resourceId,
|
|
59
|
+
resourceName: i.resourceName,
|
|
60
|
+
isClosed: i.isClosed,
|
|
61
|
+
hours: i.hours,
|
|
62
|
+
isException: i.isException
|
|
63
|
+
}))
|
|
64
|
+
});
|
|
65
|
+
} catch (a) {
|
|
66
|
+
l.value = a?.data?.statusMessage || a?.message || "Failed to load opening hours", v(`Error loading opening hours: ${l.value}`);
|
|
67
|
+
} finally {
|
|
68
|
+
f.value = !1;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
B(() => {
|
|
72
|
+
A();
|
|
73
|
+
});
|
|
74
|
+
function v(d) {
|
|
75
|
+
y.status !== "completed" && M("submit", d);
|
|
76
|
+
}
|
|
77
|
+
const E = F(() => {
|
|
78
|
+
if (!c.value?.date) return "";
|
|
79
|
+
const d = /* @__PURE__ */ new Date(c.value.date + "T00:00:00");
|
|
80
|
+
return `${z[d.getDay()]}, ${d.toLocaleDateString("en-US", { month: "long", day: "numeric", year: "numeric" })}`;
|
|
81
|
+
});
|
|
82
|
+
return (d, n) => {
|
|
83
|
+
const a = x("DropdownMenuTrigger"), i = x("NuxtLink"), h = x("DropdownMenuItem"), j = x("DropdownMenuContent"), T = x("DropdownMenu");
|
|
84
|
+
return t(), s("div", W, [
|
|
85
|
+
e(f) ? (t(), s("div", G, [
|
|
86
|
+
o(e(H), { class: "size-4 animate-spin text-muted-foreground" }),
|
|
87
|
+
n[0] || (n[0] = r("span", { class: "text-xs text-muted-foreground" }, "Loading opening hours…", -1))
|
|
88
|
+
])) : e(l) ? (t(), s("div", J, g(e(l)), 1)) : e(c) ? (t(), s("div", K, [
|
|
89
|
+
r("div", P, [
|
|
90
|
+
r("div", Q, [
|
|
91
|
+
o(e(O), { class: "size-5 text-primary" })
|
|
92
|
+
]),
|
|
93
|
+
r("div", X, [
|
|
94
|
+
r("p", Y, g(e(c).serviceName), 1),
|
|
95
|
+
r("p", Z, g(e(E)), 1)
|
|
96
|
+
]),
|
|
97
|
+
o(T, null, {
|
|
98
|
+
default: m(() => [
|
|
99
|
+
o(a, { class: "absolute top-2 right-2" }, {
|
|
100
|
+
default: m(() => [
|
|
101
|
+
o(e(q), { class: "size-4 text-muted-foreground hover:text-foreground transition-colors" })
|
|
102
|
+
]),
|
|
103
|
+
_: 1
|
|
104
|
+
}),
|
|
105
|
+
o(j, { align: "end" }, {
|
|
106
|
+
default: m(() => [
|
|
107
|
+
o(h, { "as-child": "" }, {
|
|
108
|
+
default: m(() => [
|
|
109
|
+
o(i, {
|
|
110
|
+
to: `/projects/${u.projectSlug}/modules/${u.instanceId}/edit/${u.resolvedArgs.agendaId}/resources`
|
|
111
|
+
}, {
|
|
112
|
+
default: m(() => [
|
|
113
|
+
o(e(D), { class: "size-4" }),
|
|
114
|
+
n[1] || (n[1] = b(" Regular hours ", -1))
|
|
115
|
+
]),
|
|
116
|
+
_: 1
|
|
117
|
+
}, 8, ["to"])
|
|
118
|
+
]),
|
|
119
|
+
_: 1
|
|
120
|
+
}),
|
|
121
|
+
o(h, { "as-child": "" }, {
|
|
122
|
+
default: m(() => [
|
|
123
|
+
o(i, {
|
|
124
|
+
to: `/projects/${u.projectSlug}/modules/${u.instanceId}/edit/${u.resolvedArgs.agendaId}/exceptions`
|
|
125
|
+
}, {
|
|
126
|
+
default: m(() => [
|
|
127
|
+
o(e(D), { class: "size-4" }),
|
|
128
|
+
n[2] || (n[2] = b(" Closures & exceptions ", -1))
|
|
129
|
+
]),
|
|
130
|
+
_: 1
|
|
131
|
+
}, 8, ["to"])
|
|
132
|
+
]),
|
|
133
|
+
_: 1
|
|
134
|
+
})
|
|
135
|
+
]),
|
|
136
|
+
_: 1
|
|
137
|
+
})
|
|
138
|
+
]),
|
|
139
|
+
_: 1
|
|
140
|
+
})
|
|
141
|
+
]),
|
|
142
|
+
e(c).resources.length === 0 ? (t(), s("div", ee, " No active resources found for this agenda. ")) : (t(), s("div", te, [
|
|
143
|
+
(t(!0), s(N, null, C(e(c).resources, (p) => (t(), s("div", {
|
|
144
|
+
key: p.resourceId,
|
|
145
|
+
class: "rounded-lg border px-3 py-2 space-y-1"
|
|
146
|
+
}, [
|
|
147
|
+
r("div", se, [
|
|
148
|
+
r("span", oe, g(p.resourceName), 1),
|
|
149
|
+
p.isException ? (t(), s("span", ne, " Exception ")) : I("", !0)
|
|
150
|
+
]),
|
|
151
|
+
p.isClosed ? (t(), s("div", ae, [
|
|
152
|
+
o(e(R), { class: "size-3" }),
|
|
153
|
+
n[3] || (n[3] = r("span", null, "Closed", -1))
|
|
154
|
+
])) : p.hours.length > 0 ? (t(), s("div", re, [
|
|
155
|
+
(t(!0), s(N, null, C(p.hours, (k, L) => (t(), s("div", {
|
|
156
|
+
key: L,
|
|
157
|
+
class: "flex items-center gap-1.5 text-xs text-muted-foreground"
|
|
158
|
+
}, [
|
|
159
|
+
o(e(U), { class: "size-3" }),
|
|
160
|
+
r("span", null, g(k.start) + " – " + g(k.end), 1)
|
|
161
|
+
]))), 128))
|
|
162
|
+
])) : (t(), s("div", de, " No hours set "))
|
|
163
|
+
]))), 128))
|
|
164
|
+
]))
|
|
165
|
+
])) : I("", !0)
|
|
166
|
+
]);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
export {
|
|
171
|
+
le as default
|
|
172
|
+
};
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { defineComponent as A, computed as L, ref as x, onMounted as j, resolveComponent as D, openBlock as d, createElementBlock as i, unref as o, createVNode as m, createElementVNode as t, toDisplayString as n, Fragment as P, renderList as z, normalizeClass as E, withCtx as F, createTextVNode as V } from "vue";
|
|
2
|
+
import { Loader2 as q, CalendarDays as M, ExternalLink as B } from "lucide-vue-next";
|
|
3
|
+
const R = { class: "w-full" }, U = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "flex items-center gap-2 py-3"
|
|
6
|
+
}, S = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "text-xs text-destructive py-2"
|
|
9
|
+
}, G = {
|
|
10
|
+
key: 2,
|
|
11
|
+
class: "rounded-xl border bg-background p-4 text-center"
|
|
12
|
+
}, H = {
|
|
13
|
+
key: 3,
|
|
14
|
+
class: "rounded-xl border bg-background overflow-hidden"
|
|
15
|
+
}, J = { class: "overflow-x-auto" }, K = { class: "w-full text-xs" }, O = { class: "px-3 py-2" }, Q = { class: "font-medium truncate max-w-[160px]" }, W = { class: "text-muted-foreground truncate max-w-[160px]" }, X = { class: "px-3 py-2 whitespace-nowrap" }, Y = { class: "px-3 py-2 whitespace-nowrap" }, Z = { class: "px-3 py-2 text-center" }, ee = { class: "px-3 py-2" }, te = { class: "px-3 py-2 text-right font-medium whitespace-nowrap" }, se = { class: "px-3 py-2 border-t bg-muted/20 flex items-center justify-between" }, re = { class: "text-xs text-muted-foreground" }, ae = /* @__PURE__ */ A({
|
|
16
|
+
__name: "AppointmentListTable",
|
|
17
|
+
props: {
|
|
18
|
+
toolName: {},
|
|
19
|
+
instanceId: {},
|
|
20
|
+
instanceName: {},
|
|
21
|
+
moduleType: {},
|
|
22
|
+
resolvedArgs: {},
|
|
23
|
+
status: {}
|
|
24
|
+
},
|
|
25
|
+
emits: ["submit"],
|
|
26
|
+
setup(f, { emit: b }) {
|
|
27
|
+
const { $useRoute: h, $useModuleApi: v } = useNuxtApp(), u = f, y = b, _ = h(), k = L(() => _.params.slug), w = v(u.instanceId), p = x(!0), l = x(null), a = x([]);
|
|
28
|
+
async function I() {
|
|
29
|
+
const r = u.resolvedArgs?.quantity || 20, s = u.resolvedArgs?.status || "confirmed";
|
|
30
|
+
p.value = !0, l.value = null;
|
|
31
|
+
try {
|
|
32
|
+
const c = await w.get(`/appointments?quantity=${r}&status=${s}`);
|
|
33
|
+
a.value = c.appointments || [], g({
|
|
34
|
+
count: a.value.length,
|
|
35
|
+
appointments: a.value.map((e) => ({
|
|
36
|
+
orderId: e.orderId,
|
|
37
|
+
reservationId: e.reservationId,
|
|
38
|
+
customerName: `${e.customerInfo?.firstName || ""} ${e.customerInfo?.lastName || ""}`.trim(),
|
|
39
|
+
email: e.customerInfo?.email,
|
|
40
|
+
date: e.date,
|
|
41
|
+
startTime: e.startTime,
|
|
42
|
+
endTime: e.endTime,
|
|
43
|
+
spots: e.spots,
|
|
44
|
+
status: e.reservationStatus || e.status,
|
|
45
|
+
price: e.reservationPrice
|
|
46
|
+
}))
|
|
47
|
+
});
|
|
48
|
+
} catch (c) {
|
|
49
|
+
l.value = c?.data?.statusMessage || c?.message || "Failed to load appointments", g(`Error loading appointments: ${l.value}`);
|
|
50
|
+
} finally {
|
|
51
|
+
p.value = !1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
j(() => {
|
|
55
|
+
I();
|
|
56
|
+
});
|
|
57
|
+
function g(r) {
|
|
58
|
+
u.status !== "completed" && y("submit", r);
|
|
59
|
+
}
|
|
60
|
+
const N = (r, s) => {
|
|
61
|
+
if (s !== "confirmed")
|
|
62
|
+
switch (s) {
|
|
63
|
+
case "pending":
|
|
64
|
+
return "text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20";
|
|
65
|
+
case "cancelled":
|
|
66
|
+
return "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";
|
|
67
|
+
default:
|
|
68
|
+
return "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";
|
|
69
|
+
}
|
|
70
|
+
switch (r || s) {
|
|
71
|
+
case "approved":
|
|
72
|
+
return "text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20";
|
|
73
|
+
case "needs_approval":
|
|
74
|
+
return "text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20";
|
|
75
|
+
case "rejected":
|
|
76
|
+
case "cancelled":
|
|
77
|
+
return "text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";
|
|
78
|
+
default:
|
|
79
|
+
return "text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20";
|
|
80
|
+
}
|
|
81
|
+
}, C = (r, s) => {
|
|
82
|
+
if (s !== "confirmed")
|
|
83
|
+
switch (s) {
|
|
84
|
+
case "pending":
|
|
85
|
+
return "Pending";
|
|
86
|
+
case "cancelled":
|
|
87
|
+
return "Cancelled";
|
|
88
|
+
default:
|
|
89
|
+
return s || "Unknown";
|
|
90
|
+
}
|
|
91
|
+
switch (r || s) {
|
|
92
|
+
case "approved":
|
|
93
|
+
return "Approved";
|
|
94
|
+
case "needs_approval":
|
|
95
|
+
return "Needs Approval";
|
|
96
|
+
case "rejected":
|
|
97
|
+
return "Rejected";
|
|
98
|
+
case "cancelled":
|
|
99
|
+
return "Cancelled";
|
|
100
|
+
case "confirmed":
|
|
101
|
+
return "Confirmed";
|
|
102
|
+
default:
|
|
103
|
+
return r || s || "Pending";
|
|
104
|
+
}
|
|
105
|
+
}, T = (r) => r == null ? "—" : `€${r.toFixed(2)}`, $ = (r) => {
|
|
106
|
+
if (!r) return "—";
|
|
107
|
+
try {
|
|
108
|
+
return new Date(r).toLocaleDateString("en-US", { weekday: "short", month: "short", day: "numeric" });
|
|
109
|
+
} catch {
|
|
110
|
+
return r;
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
return (r, s) => {
|
|
114
|
+
const c = D("NuxtLink");
|
|
115
|
+
return d(), i("div", R, [
|
|
116
|
+
o(p) ? (d(), i("div", U, [
|
|
117
|
+
m(o(q), { class: "size-4 animate-spin text-muted-foreground" }),
|
|
118
|
+
s[0] || (s[0] = t("span", { class: "text-xs text-muted-foreground" }, "Loading appointments…", -1))
|
|
119
|
+
])) : o(l) ? (d(), i("div", S, n(o(l)), 1)) : o(a).length === 0 ? (d(), i("div", G, [
|
|
120
|
+
m(o(M), { class: "size-8 text-muted-foreground mx-auto mb-2" }),
|
|
121
|
+
s[1] || (s[1] = t("p", { class: "text-sm text-muted-foreground" }, "No recent appointments found.", -1))
|
|
122
|
+
])) : (d(), i("div", H, [
|
|
123
|
+
t("div", J, [
|
|
124
|
+
t("table", K, [
|
|
125
|
+
s[2] || (s[2] = t("thead", null, [
|
|
126
|
+
t("tr", { class: "border-b bg-muted/40" }, [
|
|
127
|
+
t("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Customer"),
|
|
128
|
+
t("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Date"),
|
|
129
|
+
t("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Time"),
|
|
130
|
+
t("th", { class: "text-center px-3 py-2 font-medium text-muted-foreground" }, "Spots"),
|
|
131
|
+
t("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Status"),
|
|
132
|
+
t("th", { class: "text-right px-3 py-2 font-medium text-muted-foreground" }, "Price")
|
|
133
|
+
])
|
|
134
|
+
], -1)),
|
|
135
|
+
t("tbody", null, [
|
|
136
|
+
(d(!0), i(P, null, z(o(a), (e) => (d(), i("tr", {
|
|
137
|
+
key: e.reservationId || e.orderId,
|
|
138
|
+
class: "border-b last:border-b-0 hover:bg-muted/30 transition-colors"
|
|
139
|
+
}, [
|
|
140
|
+
t("td", O, [
|
|
141
|
+
t("div", Q, n(e.customerInfo?.firstName) + " " + n(e.customerInfo?.lastName), 1),
|
|
142
|
+
t("div", W, n(e.customerInfo?.email), 1)
|
|
143
|
+
]),
|
|
144
|
+
t("td", X, n($(e.date)), 1),
|
|
145
|
+
t("td", Y, n(e.startTime) + " – " + n(e.endTime), 1),
|
|
146
|
+
t("td", Z, n(e.spots || 1), 1),
|
|
147
|
+
t("td", ee, [
|
|
148
|
+
t("span", {
|
|
149
|
+
class: E(["inline-block text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase whitespace-nowrap", N(e.reservationStatus, e.status)])
|
|
150
|
+
}, n(C(e.reservationStatus, e.status)), 3)
|
|
151
|
+
]),
|
|
152
|
+
t("td", te, n(T(e.reservationPrice)), 1)
|
|
153
|
+
]))), 128))
|
|
154
|
+
])
|
|
155
|
+
])
|
|
156
|
+
]),
|
|
157
|
+
t("div", se, [
|
|
158
|
+
t("span", re, n(o(a).length) + " appointment" + n(o(a).length === 1 ? "" : "s"), 1),
|
|
159
|
+
m(c, {
|
|
160
|
+
to: `/projects/${o(k)}/modules/${f.instanceId}`,
|
|
161
|
+
class: "inline-flex items-center gap-1.5 text-xs text-primary hover:underline"
|
|
162
|
+
}, {
|
|
163
|
+
default: F(() => [
|
|
164
|
+
m(o(B), { class: "size-3" }),
|
|
165
|
+
s[3] || (s[3] = V(" View all ", -1))
|
|
166
|
+
]),
|
|
167
|
+
_: 1
|
|
168
|
+
}, 8, ["to"])
|
|
169
|
+
])
|
|
170
|
+
]))
|
|
171
|
+
]);
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
export {
|
|
176
|
+
ae as default
|
|
177
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("lucide-vue-next"),E={class:"w-full"},V={key:0,class:"flex items-center gap-2 py-3"},w={key:1,class:"text-xs text-destructive py-2"},D={key:2,class:"rounded-xl border bg-background p-4 text-center"},I={key:3,class:"rounded-xl border bg-background overflow-hidden"},B={class:"overflow-x-auto"},S={class:"w-full text-xs"},T={class:"px-3 py-2"},C={class:"font-medium truncate max-w-[160px]"},$={class:"text-muted-foreground truncate max-w-[160px]"},A={class:"px-3 py-2 whitespace-nowrap"},L={class:"px-3 py-2 whitespace-nowrap"},j={class:"px-3 py-2 text-center"},P={class:"px-3 py-2"},q={class:"px-3 py-2 text-right font-medium whitespace-nowrap"},z={class:"px-3 py-2 border-t bg-muted/20 flex items-center justify-between"},F={class:"text-xs text-muted-foreground"},M=e.defineComponent({__name:"AppointmentListTable",props:{toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(i,{emit:m}){const{$useRoute:p,$useModuleApi:x}=useNuxtApp(),d=i,f=m,g=p(),b=e.computed(()=>g.params.slug),y=x(d.instanceId),l=e.ref(!0),a=e.ref(null),o=e.ref([]);async function N(){const n=d.resolvedArgs?.quantity||20,r=d.resolvedArgs?.status||"confirmed";l.value=!0,a.value=null;try{const s=await y.get(`/appointments?quantity=${n}&status=${r}`);o.value=s.appointments||[],u({count:o.value.length,appointments:o.value.map(t=>({orderId:t.orderId,reservationId:t.reservationId,customerName:`${t.customerInfo?.firstName||""} ${t.customerInfo?.lastName||""}`.trim(),email:t.customerInfo?.email,date:t.date,startTime:t.startTime,endTime:t.endTime,spots:t.spots,status:t.reservationStatus||t.status,price:t.reservationPrice}))})}catch(s){a.value=s?.data?.statusMessage||s?.message||"Failed to load appointments",u(`Error loading appointments: ${a.value}`)}finally{l.value=!1}}e.onMounted(()=>{N()});function u(n){d.status!=="completed"&&f("submit",n)}const h=(n,r)=>{if(r!=="confirmed")switch(r){case"pending":return"text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20";case"cancelled":return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";default:return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20"}switch(n||r){case"approved":return"text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-900/20";case"needs_approval":return"text-blue-600 dark:text-blue-400 bg-blue-50 dark:bg-blue-900/20";case"rejected":case"cancelled":return"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-900/20";default:return"text-amber-600 dark:text-amber-400 bg-amber-50 dark:bg-amber-900/20"}},k=(n,r)=>{if(r!=="confirmed")switch(r){case"pending":return"Pending";case"cancelled":return"Cancelled";default:return r||"Unknown"}switch(n||r){case"approved":return"Approved";case"needs_approval":return"Needs Approval";case"rejected":return"Rejected";case"cancelled":return"Cancelled";case"confirmed":return"Confirmed";default:return n||r||"Pending"}},v=n=>n==null?"—":`€${n.toFixed(2)}`,_=n=>{if(!n)return"—";try{return new Date(n).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}catch{return n}};return(n,r)=>{const s=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",E,[e.unref(l)?(e.openBlock(),e.createElementBlock("div",V,[e.createVNode(e.unref(c.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),r[0]||(r[0]=e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"Loading appointments…",-1))])):e.unref(a)?(e.openBlock(),e.createElementBlock("div",w,e.toDisplayString(e.unref(a)),1)):e.unref(o).length===0?(e.openBlock(),e.createElementBlock("div",D,[e.createVNode(e.unref(c.CalendarDays),{class:"size-8 text-muted-foreground mx-auto mb-2"}),r[1]||(r[1]=e.createElementVNode("p",{class:"text-sm text-muted-foreground"},"No recent appointments found.",-1))])):(e.openBlock(),e.createElementBlock("div",I,[e.createElementVNode("div",B,[e.createElementVNode("table",S,[r[2]||(r[2]=e.createElementVNode("thead",null,[e.createElementVNode("tr",{class:"border-b bg-muted/40"},[e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Customer"),e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Date"),e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Time"),e.createElementVNode("th",{class:"text-center px-3 py-2 font-medium text-muted-foreground"},"Spots"),e.createElementVNode("th",{class:"text-left px-3 py-2 font-medium text-muted-foreground"},"Status"),e.createElementVNode("th",{class:"text-right px-3 py-2 font-medium text-muted-foreground"},"Price")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(o),t=>(e.openBlock(),e.createElementBlock("tr",{key:t.reservationId||t.orderId,class:"border-b last:border-b-0 hover:bg-muted/30 transition-colors"},[e.createElementVNode("td",T,[e.createElementVNode("div",C,e.toDisplayString(t.customerInfo?.firstName)+" "+e.toDisplayString(t.customerInfo?.lastName),1),e.createElementVNode("div",$,e.toDisplayString(t.customerInfo?.email),1)]),e.createElementVNode("td",A,e.toDisplayString(_(t.date)),1),e.createElementVNode("td",L,e.toDisplayString(t.startTime)+" – "+e.toDisplayString(t.endTime),1),e.createElementVNode("td",j,e.toDisplayString(t.spots||1),1),e.createElementVNode("td",P,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase whitespace-nowrap",h(t.reservationStatus,t.status)])},e.toDisplayString(k(t.reservationStatus,t.status)),3)]),e.createElementVNode("td",q,e.toDisplayString(v(t.reservationPrice)),1)]))),128))])])]),e.createElementVNode("div",z,[e.createElementVNode("span",F,e.toDisplayString(e.unref(o).length)+" appointment"+e.toDisplayString(e.unref(o).length===1?"":"s"),1),e.createVNode(s,{to:`/projects/${e.unref(b)}/modules/${i.instanceId}`,class:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline"},{default:e.withCtx(()=>[e.createVNode(e.unref(c.ExternalLink),{class:"size-3"}),r[3]||(r[3]=e.createTextVNode(" View all ",-1))]),_:1},8,["to"])])]))])}}});exports.default=M;
|