@oneclick.dev/cms-core-modules 0.0.76 → 0.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/AppointmentDetailsCard-BfBwWxTU.js +1 -0
  2. package/dist/{AppointmentDetailsCard-i4Ky8WnK.mjs → AppointmentDetailsCard-SMNXi117.mjs} +43 -42
  3. package/dist/AppointmentListTable-Dk-CnNR6.js +1 -0
  4. package/dist/{AppointmentListTable-G5dIeCYj.mjs → AppointmentListTable-vMSMt0M5.mjs} +24 -23
  5. package/dist/{ContentEditor-3JFlC9N1.js → ContentEditor-4e80zFyn.js} +1 -1
  6. package/dist/{ContentEditor-7SDjf5Hk.mjs → ContentEditor-Dk-iDEjl.mjs} +1 -1
  7. package/dist/{CountryBreakdownCard-Dc_vZ9dJ.mjs → CountryBreakdownCard-B_VhBsm8.mjs} +27 -26
  8. package/dist/CountryBreakdownCard-Ghg0Wz-h.js +1 -0
  9. package/dist/{DeviceBreakdownCard-BJcQNo8a.mjs → DeviceBreakdownCard-CQR65Zr_.mjs} +50 -49
  10. package/dist/DeviceBreakdownCard-Cpcj75Rv.js +1 -0
  11. package/dist/PeakHoursCard-CFIg8dys.js +1 -0
  12. package/dist/{PeakHoursCard-hV8PdGsf.mjs → PeakHoursCard-_1JS0tpZ.mjs} +51 -50
  13. package/dist/{ProductDetailsCard-CJBkZSER.mjs → ProductDetailsCard-C5gqBJag.mjs} +20 -19
  14. package/dist/ProductDetailsCard-Ce11f_9r.js +1 -0
  15. package/dist/RealtimeCard-CatAzdxv.js +1 -0
  16. package/dist/{RealtimeCard-CRJHS64l.mjs → RealtimeCard-CtX6Yyk-.mjs} +33 -32
  17. package/dist/SearchTermsCard-BPAdRL-r.js +1 -0
  18. package/dist/{SearchTermsCard-Dwa-P7My.mjs → SearchTermsCard-DzSu9jzo.mjs} +38 -37
  19. package/dist/TopPagesCard-BA9Are_Z.js +1 -0
  20. package/dist/{TopPagesCard-Dv52to_J.mjs → TopPagesCard-D7lH_QYV.mjs} +27 -26
  21. package/dist/TrafficSourcesCard-DV13ZOBq.js +1 -0
  22. package/dist/{TrafficSourcesCard-CMhcj2k2.mjs → TrafficSourcesCard-Fng3fVh7.mjs} +53 -52
  23. package/dist/VisitorStatsCard-CAzAZtKD.js +1 -0
  24. package/dist/{VisitorStatsCard-BHn4oSnt.mjs → VisitorStatsCard-CuXXnMBc.mjs} +22 -21
  25. package/dist/index.cjs.js +1 -1
  26. package/dist/index.mjs +12 -12
  27. package/package.json +3 -2
  28. package/dist/AppointmentDetailsCard-CtK0Cj_O.js +0 -1
  29. package/dist/AppointmentListTable-CQ3uXfa8.js +0 -1
  30. package/dist/CountryBreakdownCard-BUfJ-umQ.js +0 -1
  31. package/dist/DeviceBreakdownCard-CsoK6JUO.js +0 -1
  32. package/dist/PeakHoursCard-BNl_U1r_.js +0 -1
  33. package/dist/ProductDetailsCard-BwktdlIf.js +0 -1
  34. package/dist/RealtimeCard-CxtqQHee.js +0 -1
  35. package/dist/SearchTermsCard-DGRbo5ZP.js +0 -1
  36. package/dist/TopPagesCard-pZ-nAsaI.js +0 -1
  37. package/dist/TrafficSourcesCard-CBOPV1J1.js +0 -1
  38. package/dist/VisitorStatsCard-tApB_7v8.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("lucide-vue-next"),p=require("@oneclick.dev/cms-kit"),E={class:"w-full"},h={key:0,class:"flex items-center gap-2 py-3"},S={key:1,class:"text-xs text-destructive py-2"},B={key:2,class:"rounded-xl border bg-background p-4 text-center"},D={key:3,class:"space-y-3"},I={class:"flex items-start gap-3"},C={class:"shrink-0 size-10 rounded-lg bg-primary/10 flex items-center justify-center"},z={class:"flex-1 min-w-0"},T={class:"text-sm font-semibold truncate"},w={class:"flex items-center gap-2 mt-1 flex-wrap"},j={key:0,class:"text-xs font-medium"},A={class:"grid grid-cols-2 gap-2 text-xs text-muted-foreground"},L={class:"flex items-center gap-1.5"},P={class:"truncate"},$={class:"flex items-center gap-1.5"},M={class:"flex items-center gap-1.5"},q={class:"flex items-center gap-1.5"},F=e.defineComponent({__name:"AppointmentDetailsCard",props:{toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(u,{emit:f}){const d=u,g=f,x=p.useRoute(),v=e.computed(()=>x.params.slug),N=p.useModuleApi(d.instanceId),c=e.ref(!0),a=e.ref(null),l=e.ref([]);async function k(){const{name:s,email:n,date:i}=d.resolvedArgs||{};if(!i){a.value="No date provided",c.value=!1;return}c.value=!0,a.value=null;try{const t=new URLSearchParams;s&&t.set("name",s),n&&t.set("email",n),i&&t.set("date",i);const V=await N.get(`/appointments/find?${t.toString()}`);l.value=V.appointments||[],m({count:l.value.length,appointments:l.value.map(r=>({orderId:r.orderId,reservationId:r.reservationId,customerName:`${r.customerInfo?.firstName||""} ${r.customerInfo?.lastName||""}`.trim(),email:r.customerInfo?.email,date:r.date,startTime:r.startTime,endTime:r.endTime,spots:r.spots,status:r.reservationStatus||r.status,price:r.reservationPrice}))})}catch(t){a.value=t?.data?.statusMessage||t?.message||"Failed to find appointment",m(`Error finding appointment: ${a.value}`)}finally{c.value=!1}}e.onMounted(()=>{k()});function m(s){d.status!=="completed"&&g("submit",s)}const _=s=>{switch(s){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"}},y=s=>{switch(s){case"approved":return"Approved";case"needs_approval":return"Needs Approval";case"rejected":return"Rejected";case"cancelled":return"Cancelled";case"confirmed":return"Confirmed";default:return s||"Pending"}},b=s=>s==null?"":`€${s.toFixed(2)}`;return(s,n)=>{const i=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",E,[e.unref(c)?(e.openBlock(),e.createElementBlock("div",h,[e.createVNode(e.unref(o.Loader2),{class:"size-4 animate-spin text-muted-foreground"}),n[0]||(n[0]=e.createElementVNode("span",{class:"text-xs text-muted-foreground"},"Searching appointments…",-1))])):e.unref(a)?(e.openBlock(),e.createElementBlock("div",S,e.toDisplayString(e.unref(a)),1)):e.unref(l).length===0?(e.openBlock(),e.createElementBlock("div",B,[e.createVNode(e.unref(o.CalendarDays),{class:"size-8 text-muted-foreground mx-auto mb-2"}),n[1]||(n[1]=e.createElementVNode("p",{class:"text-sm text-muted-foreground"},"No appointments found for the given criteria.",-1))])):(e.openBlock(),e.createElementBlock("div",D,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(l),t=>(e.openBlock(),e.createElementBlock("div",{key:t.reservationId||t.orderId,class:"rounded-xl border bg-background p-3 space-y-3"},[e.createElementVNode("div",I,[e.createElementVNode("div",C,[e.createVNode(e.unref(o.CalendarDays),{class:"size-5 text-primary"})]),e.createElementVNode("div",z,[e.createElementVNode("p",T,e.toDisplayString(t.customerInfo?.firstName)+" "+e.toDisplayString(t.customerInfo?.lastName),1),e.createElementVNode("div",w,[e.createElementVNode("span",{class:e.normalizeClass(["text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase",_(t.reservationStatus||t.status)])},e.toDisplayString(y(t.reservationStatus||t.status)),3),t.reservationPrice!=null?(e.openBlock(),e.createElementBlock("span",j,e.toDisplayString(b(t.reservationPrice)),1)):e.createCommentVNode("",!0)])])]),e.createElementVNode("div",A,[e.createElementVNode("div",L,[e.createVNode(e.unref(o.Mail),{class:"size-3"}),e.createElementVNode("span",P,e.toDisplayString(t.customerInfo?.email||"—"),1)]),e.createElementVNode("div",$,[e.createVNode(e.unref(o.CalendarDays),{class:"size-3"}),e.createElementVNode("span",null,e.toDisplayString(t.date),1)]),e.createElementVNode("div",M,[e.createVNode(e.unref(o.Clock),{class:"size-3"}),e.createElementVNode("span",null,e.toDisplayString(t.startTime)+" – "+e.toDisplayString(t.endTime),1)]),e.createElementVNode("div",q,[e.createVNode(e.unref(o.Users),{class:"size-3"}),e.createElementVNode("span",null,e.toDisplayString(t.spots||1)+" "+e.toDisplayString((t.spots||1)===1?"spot":"spots"),1)])]),e.createVNode(i,{to:`/projects/${e.unref(v)}/modules/${u.instanceId}`,class:"inline-flex items-center gap-1.5 text-xs text-primary hover:underline"},{default:e.withCtx(()=>[e.createVNode(e.unref(o.ExternalLink),{class:"size-3"}),n[2]||(n[2]=e.createTextVNode(" Open in agenda ",-1))]),_:1},8,["to"])]))),128))]))])}}});exports.default=F;
@@ -1,21 +1,22 @@
1
- import { defineComponent as T, computed as A, ref as x, onMounted as L, resolveComponent as $, openBlock as d, createElementBlock as l, unref as r, createVNode as i, createElementVNode as t, toDisplayString as a, Fragment as j, renderList as P, normalizeClass as E, createCommentVNode as M, withCtx as V, createTextVNode as D } from "vue";
1
+ import { defineComponent as T, computed as A, ref as x, onMounted as L, resolveComponent as $, openBlock as d, createElementBlock as l, unref as r, createVNode as i, createElementVNode as t, toDisplayString as o, Fragment as j, renderList as P, normalizeClass as E, createCommentVNode as M, withCtx as V, createTextVNode as D } from "vue";
2
2
  import { Loader2 as F, CalendarDays as g, Mail as R, Clock as B, Users as U, ExternalLink as O } from "lucide-vue-next";
3
- const q = { class: "w-full" }, G = {
3
+ import { useRoute as q, useModuleApi as G } from "@oneclick.dev/cms-kit";
4
+ const H = { class: "w-full" }, J = {
4
5
  key: 0,
5
6
  class: "flex items-center gap-2 py-3"
6
- }, H = {
7
+ }, K = {
7
8
  key: 1,
8
9
  class: "text-xs text-destructive py-2"
9
- }, J = {
10
+ }, Q = {
10
11
  key: 2,
11
12
  class: "rounded-xl border bg-background p-4 text-center"
12
- }, K = {
13
+ }, W = {
13
14
  key: 3,
14
15
  class: "space-y-3"
15
- }, Q = { class: "flex items-start gap-3" }, W = { class: "shrink-0 size-10 rounded-lg bg-primary/10 flex items-center justify-center" }, X = { class: "flex-1 min-w-0" }, Y = { class: "text-sm font-semibold truncate" }, Z = { class: "flex items-center gap-2 mt-1 flex-wrap" }, ee = {
16
+ }, X = { class: "flex items-start gap-3" }, Y = { class: "shrink-0 size-10 rounded-lg bg-primary/10 flex items-center justify-center" }, Z = { class: "flex-1 min-w-0" }, ee = { class: "text-sm font-semibold truncate" }, te = { class: "flex items-center gap-2 mt-1 flex-wrap" }, se = {
16
17
  key: 0,
17
18
  class: "text-xs font-medium"
18
- }, te = { class: "grid grid-cols-2 gap-2 text-xs text-muted-foreground" }, se = { class: "flex items-center gap-1.5" }, re = { class: "truncate" }, ne = { class: "flex items-center gap-1.5" }, ae = { class: "flex items-center gap-1.5" }, oe = { class: "flex items-center gap-1.5" }, le = /* @__PURE__ */ T({
19
+ }, re = { class: "grid grid-cols-2 gap-2 text-xs text-muted-foreground" }, ne = { class: "flex items-center gap-1.5" }, oe = { class: "truncate" }, ae = { class: "flex items-center gap-1.5" }, ie = { class: "flex items-center gap-1.5" }, de = { class: "flex items-center gap-1.5" }, ue = /* @__PURE__ */ T({
19
20
  __name: "AppointmentDetailsCard",
20
21
  props: {
21
22
  toolName: {},
@@ -27,21 +28,21 @@ const q = { class: "w-full" }, G = {
27
28
  },
28
29
  emits: ["submit"],
29
30
  setup(v, { emit: b }) {
30
- const f = v, h = b, k = useRoute(), y = A(() => k.params.slug), N = useModuleApi(f.instanceId), p = x(!0), c = x(null), u = x([]);
31
+ const f = v, h = b, k = q(), y = A(() => k.params.slug), N = G(f.instanceId), p = x(!0), c = x(null), m = x([]);
31
32
  async function I() {
32
- const { name: s, email: o, date: m } = f.resolvedArgs || {};
33
- if (!m) {
33
+ const { name: s, email: a, date: u } = f.resolvedArgs || {};
34
+ if (!u) {
34
35
  c.value = "No date provided", p.value = !1;
35
36
  return;
36
37
  }
37
38
  p.value = !0, c.value = null;
38
39
  try {
39
40
  const e = new URLSearchParams();
40
- s && e.set("name", s), o && e.set("email", o), m && e.set("date", m);
41
+ s && e.set("name", s), a && e.set("email", a), u && e.set("date", u);
41
42
  const w = await N.get(`/appointments/find?${e.toString()}`);
42
- u.value = w.appointments || [], _({
43
- count: u.value.length,
44
- appointments: u.value.map((n) => ({
43
+ m.value = w.appointments || [], _({
44
+ count: m.value.length,
45
+ appointments: m.value.map((n) => ({
45
46
  orderId: n.orderId,
46
47
  reservationId: n.reservationId,
47
48
  customerName: `${n.customerInfo?.firstName || ""} ${n.customerInfo?.lastName || ""}`.trim(),
@@ -94,59 +95,59 @@ const q = { class: "w-full" }, G = {
94
95
  return s || "Pending";
95
96
  }
96
97
  }, S = (s) => s == null ? "" : `€${s.toFixed(2)}`;
97
- return (s, o) => {
98
- const m = $("NuxtLink");
99
- return d(), l("div", q, [
100
- r(p) ? (d(), l("div", G, [
98
+ return (s, a) => {
99
+ const u = $("NuxtLink");
100
+ return d(), l("div", H, [
101
+ r(p) ? (d(), l("div", J, [
101
102
  i(r(F), { class: "size-4 animate-spin text-muted-foreground" }),
102
- o[0] || (o[0] = t("span", { class: "text-xs text-muted-foreground" }, "Searching appointments…", -1))
103
- ])) : r(c) ? (d(), l("div", H, a(r(c)), 1)) : r(u).length === 0 ? (d(), l("div", J, [
103
+ a[0] || (a[0] = t("span", { class: "text-xs text-muted-foreground" }, "Searching appointments…", -1))
104
+ ])) : r(c) ? (d(), l("div", K, o(r(c)), 1)) : r(m).length === 0 ? (d(), l("div", Q, [
104
105
  i(r(g), { class: "size-8 text-muted-foreground mx-auto mb-2" }),
105
- o[1] || (o[1] = t("p", { class: "text-sm text-muted-foreground" }, "No appointments found for the given criteria.", -1))
106
- ])) : (d(), l("div", K, [
107
- (d(!0), l(j, null, P(r(u), (e) => (d(), l("div", {
106
+ a[1] || (a[1] = t("p", { class: "text-sm text-muted-foreground" }, "No appointments found for the given criteria.", -1))
107
+ ])) : (d(), l("div", W, [
108
+ (d(!0), l(j, null, P(r(m), (e) => (d(), l("div", {
108
109
  key: e.reservationId || e.orderId,
109
110
  class: "rounded-xl border bg-background p-3 space-y-3"
110
111
  }, [
111
- t("div", Q, [
112
- t("div", W, [
112
+ t("div", X, [
113
+ t("div", Y, [
113
114
  i(r(g), { class: "size-5 text-primary" })
114
115
  ]),
115
- t("div", X, [
116
- t("p", Y, a(e.customerInfo?.firstName) + " " + a(e.customerInfo?.lastName), 1),
117
- t("div", Z, [
116
+ t("div", Z, [
117
+ t("p", ee, o(e.customerInfo?.firstName) + " " + o(e.customerInfo?.lastName), 1),
118
+ t("div", te, [
118
119
  t("span", {
119
120
  class: E(["text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase", C(e.reservationStatus || e.status)])
120
- }, a(z(e.reservationStatus || e.status)), 3),
121
- e.reservationPrice != null ? (d(), l("span", ee, a(S(e.reservationPrice)), 1)) : M("", !0)
121
+ }, o(z(e.reservationStatus || e.status)), 3),
122
+ e.reservationPrice != null ? (d(), l("span", se, o(S(e.reservationPrice)), 1)) : M("", !0)
122
123
  ])
123
124
  ])
124
125
  ]),
125
- t("div", te, [
126
- t("div", se, [
126
+ t("div", re, [
127
+ t("div", ne, [
127
128
  i(r(R), { class: "size-3" }),
128
- t("span", re, a(e.customerInfo?.email || "—"), 1)
129
+ t("span", oe, o(e.customerInfo?.email || "—"), 1)
129
130
  ]),
130
- t("div", ne, [
131
+ t("div", ae, [
131
132
  i(r(g), { class: "size-3" }),
132
- t("span", null, a(e.date), 1)
133
+ t("span", null, o(e.date), 1)
133
134
  ]),
134
- t("div", ae, [
135
+ t("div", ie, [
135
136
  i(r(B), { class: "size-3" }),
136
- t("span", null, a(e.startTime) + " – " + a(e.endTime), 1)
137
+ t("span", null, o(e.startTime) + " – " + o(e.endTime), 1)
137
138
  ]),
138
- t("div", oe, [
139
+ t("div", de, [
139
140
  i(r(U), { class: "size-3" }),
140
- t("span", null, a(e.spots || 1) + " " + a((e.spots || 1) === 1 ? "spot" : "spots"), 1)
141
+ t("span", null, o(e.spots || 1) + " " + o((e.spots || 1) === 1 ? "spot" : "spots"), 1)
141
142
  ])
142
143
  ]),
143
- i(m, {
144
+ i(u, {
144
145
  to: `/projects/${r(y)}/modules/${v.instanceId}`,
145
146
  class: "inline-flex items-center gap-1.5 text-xs text-primary hover:underline"
146
147
  }, {
147
148
  default: V(() => [
148
149
  i(r(O), { class: "size-3" }),
149
- o[2] || (o[2] = D(" Open in agenda ", -1))
150
+ a[2] || (a[2] = D(" Open in agenda ", -1))
150
151
  ]),
151
152
  _: 1
152
153
  }, 8, ["to"])
@@ -157,5 +158,5 @@ const q = { class: "w-full" }, G = {
157
158
  }
158
159
  });
159
160
  export {
160
- le as default
161
+ ue as default
161
162
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),c=require("lucide-vue-next"),m=require("@oneclick.dev/cms-kit"),k={class:"w-full"},E={key:0,class:"flex items-center gap-2 py-3"},V={key:1,class:"text-xs text-destructive py-2"},w={key:2,class:"rounded-xl border bg-background p-4 text-center"},S={key:3,class:"rounded-xl border bg-background overflow-hidden"},D={class:"overflow-x-auto"},I={class:"w-full text-xs"},B={class:"px-3 py-2"},T={class:"font-medium truncate max-w-[160px]"},C={class:"text-muted-foreground truncate max-w-[160px]"},L={class:"px-3 py-2 whitespace-nowrap"},j={class:"px-3 py-2 whitespace-nowrap"},A={class:"px-3 py-2 text-center"},$={class:"px-3 py-2"},q={class:"px-3 py-2 text-right font-medium whitespace-nowrap"},P={class:"px-3 py-2 border-t bg-muted/20 flex items-center justify-between"},z={class:"text-xs text-muted-foreground"},M=e.defineComponent({__name:"AppointmentListTable",props:{toolName:{},instanceId:{},instanceName:{},moduleType:{},resolvedArgs:{},status:{}},emits:["submit"],setup(i,{emit:p}){const d=i,x=p,f=m.useRoute(),g=e.computed(()=>f.params.slug),y=m.useModuleApi(d.instanceId),l=e.ref(!0),a=e.ref(null),s=e.ref([]);async function b(){const t=d.resolvedArgs?.quantity||20;l.value=!0,a.value=null;try{const r=await y.get(`/appointments?quantity=${t}`);s.value=r.appointments||[],u({count:s.value.length,appointments:s.value.map(o=>({orderId:o.orderId,reservationId:o.reservationId,customerName:`${o.customerInfo?.firstName||""} ${o.customerInfo?.lastName||""}`.trim(),email:o.customerInfo?.email,date:o.date,startTime:o.startTime,endTime:o.endTime,spots:o.spots,status:o.reservationStatus||o.status,price:o.reservationPrice}))})}catch(r){a.value=r?.data?.statusMessage||r?.message||"Failed to load appointments",u(`Error loading appointments: ${a.value}`)}finally{l.value=!1}}e.onMounted(()=>{b()});function u(t){d.status!=="completed"&&x("submit",t)}const N=t=>{switch(t){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"}},v=t=>{switch(t){case"approved":return"Approved";case"needs_approval":return"Needs Approval";case"rejected":return"Rejected";case"cancelled":return"Cancelled";case"confirmed":return"Confirmed";default:return t||"Pending"}},h=t=>t==null?"—":`€${t.toFixed(2)}`,_=t=>{if(!t)return"—";try{return new Date(t).toLocaleDateString("en-US",{weekday:"short",month:"short",day:"numeric"})}catch{return t}};return(t,r)=>{const o=e.resolveComponent("NuxtLink");return e.openBlock(),e.createElementBlock("div",k,[e.unref(l)?(e.openBlock(),e.createElementBlock("div",E,[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",V,e.toDisplayString(e.unref(a)),1)):e.unref(s).length===0?(e.openBlock(),e.createElementBlock("div",w,[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",S,[e.createElementVNode("div",D,[e.createElementVNode("table",I,[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(s),n=>(e.openBlock(),e.createElementBlock("tr",{key:n.reservationId||n.orderId,class:"border-b last:border-b-0 hover:bg-muted/30 transition-colors"},[e.createElementVNode("td",B,[e.createElementVNode("div",T,e.toDisplayString(n.customerInfo?.firstName)+" "+e.toDisplayString(n.customerInfo?.lastName),1),e.createElementVNode("div",C,e.toDisplayString(n.customerInfo?.email),1)]),e.createElementVNode("td",L,e.toDisplayString(_(n.date)),1),e.createElementVNode("td",j,e.toDisplayString(n.startTime)+" – "+e.toDisplayString(n.endTime),1),e.createElementVNode("td",A,e.toDisplayString(n.spots||1),1),e.createElementVNode("td",$,[e.createElementVNode("span",{class:e.normalizeClass(["inline-block text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase whitespace-nowrap",N(n.reservationStatus||n.status)])},e.toDisplayString(v(n.reservationStatus||n.status)),3)]),e.createElementVNode("td",q,e.toDisplayString(h(n.reservationPrice)),1)]))),128))])])]),e.createElementVNode("div",P,[e.createElementVNode("span",z,e.toDisplayString(e.unref(s).length)+" appointment"+e.toDisplayString(e.unref(s).length===1?"":"s"),1),e.createVNode(o,{to:`/projects/${e.unref(g)}/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;
@@ -1,18 +1,19 @@
1
1
  import { defineComponent as C, computed as L, ref as x, onMounted as S, resolveComponent as A, openBlock as i, createElementBlock as u, unref as a, createVNode as c, createElementVNode as e, toDisplayString as n, Fragment as $, renderList as j, normalizeClass as D, withCtx as P, createTextVNode as z } from "vue";
2
2
  import { Loader2 as E, CalendarDays as V, ExternalLink as q } from "lucide-vue-next";
3
- const F = { class: "w-full" }, M = {
3
+ import { useRoute as F, useModuleApi as M } from "@oneclick.dev/cms-kit";
4
+ const B = { class: "w-full" }, R = {
4
5
  key: 0,
5
6
  class: "flex items-center gap-2 py-3"
6
- }, B = {
7
+ }, U = {
7
8
  key: 1,
8
9
  class: "text-xs text-destructive py-2"
9
- }, R = {
10
+ }, G = {
10
11
  key: 2,
11
12
  class: "rounded-xl border bg-background p-4 text-center"
12
- }, U = {
13
+ }, H = {
13
14
  key: 3,
14
15
  class: "rounded-xl border bg-background overflow-hidden"
15
- }, G = { class: "overflow-x-auto" }, H = { class: "w-full text-xs" }, J = { class: "px-3 py-2" }, K = { class: "font-medium truncate max-w-[160px]" }, O = { class: "text-muted-foreground truncate max-w-[160px]" }, Q = { class: "px-3 py-2 whitespace-nowrap" }, W = { class: "px-3 py-2 whitespace-nowrap" }, X = { class: "px-3 py-2 text-center" }, Y = { class: "px-3 py-2" }, Z = { class: "px-3 py-2 text-right font-medium whitespace-nowrap" }, ee = { class: "px-3 py-2 border-t bg-muted/20 flex items-center justify-between" }, te = { class: "text-xs text-muted-foreground" }, re = /* @__PURE__ */ C({
16
+ }, 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" }, oe = { class: "text-xs text-muted-foreground" }, de = /* @__PURE__ */ C({
16
17
  __name: "AppointmentListTable",
17
18
  props: {
18
19
  toolName: {},
@@ -24,7 +25,7 @@ const F = { class: "w-full" }, M = {
24
25
  },
25
26
  emits: ["submit"],
26
27
  setup(f, { emit: b }) {
27
- const m = f, h = b, v = useRoute(), y = L(() => v.params.slug), _ = useModuleApi(m.instanceId), p = x(!0), l = x(null), d = x([]);
28
+ const m = f, h = b, v = F(), y = L(() => v.params.slug), _ = M(m.instanceId), p = x(!0), l = x(null), d = x([]);
28
29
  async function k() {
29
30
  const t = m.resolvedArgs?.quantity || 20;
30
31
  p.value = !0, l.value = null;
@@ -94,16 +95,16 @@ const F = { class: "w-full" }, M = {
94
95
  };
95
96
  return (t, s) => {
96
97
  const o = A("NuxtLink");
97
- return i(), u("div", F, [
98
- a(p) ? (i(), u("div", M, [
98
+ return i(), u("div", B, [
99
+ a(p) ? (i(), u("div", R, [
99
100
  c(a(E), { class: "size-4 animate-spin text-muted-foreground" }),
100
101
  s[0] || (s[0] = e("span", { class: "text-xs text-muted-foreground" }, "Loading appointments…", -1))
101
- ])) : a(l) ? (i(), u("div", B, n(a(l)), 1)) : a(d).length === 0 ? (i(), u("div", R, [
102
+ ])) : a(l) ? (i(), u("div", U, n(a(l)), 1)) : a(d).length === 0 ? (i(), u("div", G, [
102
103
  c(a(V), { class: "size-8 text-muted-foreground mx-auto mb-2" }),
103
104
  s[1] || (s[1] = e("p", { class: "text-sm text-muted-foreground" }, "No recent appointments found.", -1))
104
- ])) : (i(), u("div", U, [
105
- e("div", G, [
106
- e("table", H, [
105
+ ])) : (i(), u("div", H, [
106
+ e("div", J, [
107
+ e("table", K, [
107
108
  s[2] || (s[2] = e("thead", null, [
108
109
  e("tr", { class: "border-b bg-muted/40" }, [
109
110
  e("th", { class: "text-left px-3 py-2 font-medium text-muted-foreground" }, "Customer"),
@@ -119,25 +120,25 @@ const F = { class: "w-full" }, M = {
119
120
  key: r.reservationId || r.orderId,
120
121
  class: "border-b last:border-b-0 hover:bg-muted/30 transition-colors"
121
122
  }, [
122
- e("td", J, [
123
- e("div", K, n(r.customerInfo?.firstName) + " " + n(r.customerInfo?.lastName), 1),
124
- e("div", O, n(r.customerInfo?.email), 1)
123
+ e("td", O, [
124
+ e("div", Q, n(r.customerInfo?.firstName) + " " + n(r.customerInfo?.lastName), 1),
125
+ e("div", W, n(r.customerInfo?.email), 1)
125
126
  ]),
126
- e("td", Q, n(T(r.date)), 1),
127
- e("td", W, n(r.startTime) + " – " + n(r.endTime), 1),
128
- e("td", X, n(r.spots || 1), 1),
129
- e("td", Y, [
127
+ e("td", X, n(T(r.date)), 1),
128
+ e("td", Y, n(r.startTime) + " – " + n(r.endTime), 1),
129
+ e("td", Z, n(r.spots || 1), 1),
130
+ e("td", ee, [
130
131
  e("span", {
131
132
  class: D(["inline-block text-[10px] font-medium px-1.5 py-0.5 rounded-full uppercase whitespace-nowrap", w(r.reservationStatus || r.status)])
132
133
  }, n(I(r.reservationStatus || r.status)), 3)
133
134
  ]),
134
- e("td", Z, n(N(r.reservationPrice)), 1)
135
+ e("td", te, n(N(r.reservationPrice)), 1)
135
136
  ]))), 128))
136
137
  ])
137
138
  ])
138
139
  ]),
139
- e("div", ee, [
140
- e("span", te, n(a(d).length) + " appointment" + n(a(d).length === 1 ? "" : "s"), 1),
140
+ e("div", se, [
141
+ e("span", oe, n(a(d).length) + " appointment" + n(a(d).length === 1 ? "" : "s"), 1),
141
142
  c(o, {
142
143
  to: `/projects/${a(y)}/modules/${f.instanceId}`,
143
144
  class: "inline-flex items-center gap-1.5 text-xs text-primary hover:underline"
@@ -155,5 +156,5 @@ const F = { class: "w-full" }, M = {
155
156
  }
156
157
  });
157
158
  export {
158
- re as default
159
+ de as default
159
160
  };