@oneclick.dev/cms-core-modules 0.0.110 → 0.0.111
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/{Acquisition-Dt2rREU8.js → Acquisition-DgzDQH51.js} +1 -1
- package/dist/{Acquisition-DNCy8nQz.mjs → Acquisition-FV3QpaUX.mjs} +2 -2
- package/dist/{Audience-Bs7b0TNm.js → Audience-BSgNvcVb.js} +1 -1
- package/dist/{Audience-CUeMVYRy.mjs → Audience-ka0b7YPE.mjs} +2 -2
- package/dist/{ContentEditor-D9-1SJ5F.mjs → ContentEditor-pZPfo0qN.mjs} +4384 -4282
- package/dist/{ContentEditor-BprPiHMJ.js → ContentEditor-tYkh4vRV.js} +42 -42
- package/dist/{Create-89z41K73.js → Create--MOBOTA-.js} +1 -1
- package/dist/{Create-BCklc_T1.mjs → Create-BXNLRQag.mjs} +1 -1
- package/dist/DateFormatter-CSAbE3BC.js +1 -0
- package/dist/{DateFormatter-DUxlo8X8.mjs → DateFormatter-qbhRYxI_.mjs} +226 -222
- package/dist/{Detail-CNlljBfH.mjs → Detail-ChD5XurA.mjs} +1 -1
- package/dist/{Detail-C857g62L.js → Detail-RISEJJab.js} +1 -1
- package/dist/{Find-DIISO5GO.mjs → Find-zN_dKz4p.mjs} +1 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Baqy-rTT.js +1 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dx4Bpa2m.mjs +1263 -0
- package/dist/{Overview-Di84CsR5.mjs → Overview-98nkJUWN.mjs} +162 -157
- package/dist/{Overview-C-Jb_BxY.mjs → Overview-BR_y8x3W.mjs} +1 -1
- package/dist/{Overview-DC9io1bk.js → Overview-CX-n6W7d.js} +1 -1
- package/dist/Overview-Dl8cMlsr.js +1 -0
- package/dist/{Overview-BKAti8nc.mjs → Overview-MpgkLB6m.mjs} +36 -36
- package/dist/{SeoHealth-az1YuNF2.js → SeoHealth-C5npw7mE.js} +1 -1
- package/dist/{SeoHealth-MC3lSCOY.mjs → SeoHealth-bVQj_Xgm.mjs} +29 -29
- package/dist/{TableView-DXHhJ-jm.mjs → TableView-Bf1fdJrD.mjs} +1838 -1822
- package/dist/TableView-DNcXyIMu.js +4 -0
- package/dist/{agenda-IOqtALWf.js → agenda-BaJu3-1c.js} +1 -1
- package/dist/{agenda-DcatSSYQ.mjs → agenda-BwVY_8oM.mjs} +3 -3
- package/dist/cms-core-modules.css +1 -1
- package/dist/{exceptions-CI0B4xVj.js → exceptions-B6P9UiCj.js} +1 -1
- package/dist/{exceptions-YCQkHa6a.mjs → exceptions-De9-FvdP.mjs} +67 -67
- package/dist/{index-CpzDEMeC.mjs → index-B8GvmAwh.mjs} +438 -478
- package/dist/{index-wjkEPsNx.mjs → index-BIF2RB7k.mjs} +1212 -1316
- package/dist/index-ByRsp77L.js +70 -0
- package/dist/{index-BhWvXMOp.mjs → index-CFzn2Lus.mjs} +5 -9
- package/dist/{index-BFLV54kw.mjs → index-CkVwMqpn.mjs} +1114 -1100
- package/dist/index-DL6orwdK.js +35 -0
- package/dist/index-DUlYrnXH.js +58 -0
- package/dist/index-DZV720u-.mjs +439 -0
- package/dist/index-D_nfGegA.js +184 -0
- package/dist/index-DtSvAFLL.js +54 -0
- package/dist/{index-D30apIn-.mjs → index-L54VBzwJ.mjs} +2 -3
- package/dist/{index-BzWmWCo5.mjs → index-hH3e-IYz.mjs} +267 -267
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +15 -15
- package/dist/math-BJ-oX_IM.mjs +80 -0
- package/dist/math-emotyaF6.js +1 -0
- package/dist/{resources-CYOb5Bl6.mjs → resources-DwYxn2Vi.mjs} +1 -1
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/ScopedSelectAll.d.ts +1 -2
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/helpers/useFocus.d.ts +1 -0
- package/package.json +2 -2
- package/dist/DateFormatter-CYAD4GBN.js +0 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Ceoje52V.js +0 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dh9jzvE0.mjs +0 -1255
- package/dist/Overview-UoZHUMUz.js +0 -1
- package/dist/TableView-DQW0A1oG.js +0 -4
- package/dist/array-CbATeQbk.js +0 -1
- package/dist/array-DT5pE8Gm.mjs +0 -108
- package/dist/index-A2kp8Isi.js +0 -75
- package/dist/index-B5aBwdxY.js +0 -54
- package/dist/index-BiT55eU0.js +0 -58
- package/dist/index-G7cIlnGN.js +0 -158
- package/dist/index-V78huaSJ.mjs +0 -442
- package/dist/index-vHmvbEwa.js +0 -35
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModuleRoute as _e, useModule as De, useFirebaseIntegration as Se, useModulePermissions as
|
|
3
|
-
import { _ as
|
|
4
|
-
import {
|
|
1
|
+
import { defineComponent as ce, inject as We, computed as N, ref as z, onMounted as Fe, nextTick as je, onUnmounted as Le, watch as Q, openBlock as v, createElementBlock as T, resolveComponent as V, withModifiers as Ge, createElementVNode as l, Fragment as ie, createVNode as d, unref as e, normalizeStyle as ve, toDisplayString as A, createCommentVNode as K, createBlock as F, isRef as se, withCtx as k, createTextVNode as Z, renderList as he, normalizeClass as re, withDirectives as He, vModelText as Ue, provide as qe } from "vue";
|
|
2
|
+
import { useModuleRoute as _e, useModule as De, useFirebaseIntegration as Se, useModulePermissions as Ye } from "@oneclick.dev/cms-kit";
|
|
3
|
+
import { _ as Xe } from "./EditLayout.vue_vue_type_script_setup_true_lang-DWMqQvHl.mjs";
|
|
4
|
+
import { l as xe, D as Je, I as Qe, v as le, Q as ye, O as Ke, M as we, z as Ce, Z as de, q as $e, J as Ze, t as et, s as tt, r as at, j as st, R as ot, N as nt, n as rt } from "./index-CkVwMqpn.mjs";
|
|
5
5
|
import { componentToString as Me, ChartTooltipContent as Re } from "@oneclick.dev/cms-kit/charts";
|
|
6
|
-
import { Layers as be, ChevronDown as it, ChevronLeft as lt, ChevronRight as
|
|
7
|
-
import { a as vt } from "./index-
|
|
8
|
-
import {
|
|
6
|
+
import { Layers as be, ChevronDown as it, ChevronLeft as lt, ChevronRight as dt, CalendarIcon as ct, Users as Ve, RefreshCw as ut, Search as mt, X as pt, Clock as ft } from "lucide-vue-next";
|
|
7
|
+
import { a as vt } from "./index-CFzn2Lus.mjs";
|
|
8
|
+
import { b as gt, a as Ae, X as ht, c as xt, r as yt, D as pe, $ as Ie, O as fe, z as Te, A as Ee } from "./index-BIF2RB7k.mjs";
|
|
9
9
|
import { _ as bt } from "./_plugin-vue_export-helper-CHgC5LLL.mjs";
|
|
10
10
|
import { F as kt, _ as _t, a as Dt } from "./ReservationDetailDialog.vue_vue_type_script_setup_true_lang-GYNZ_yhD.mjs";
|
|
11
11
|
import { _ as St } from "./OrderDetailDialog.vue_vue_type_script_setup_true_lang-Vb3q8EVv.mjs";
|
|
12
|
-
import { _ as wt } from "./NewReservationDialog.vue_vue_type_script_setup_true_lang-
|
|
13
|
-
function Ct({ x: g, y: h, w: a, h: x, tl: y = !1, tr: b = !1, bl: _ = !1, br:
|
|
12
|
+
import { _ as wt } from "./NewReservationDialog.vue_vue_type_script_setup_true_lang-Dx4Bpa2m.mjs";
|
|
13
|
+
function Ct({ x: g, y: h, w: a, h: x, tl: y = !1, tr: b = !1, bl: _ = !1, br: c = !1, r: n = 0 }) {
|
|
14
14
|
let i;
|
|
15
15
|
i = `M${g + n},${h}h${a - 2 * n}`;
|
|
16
16
|
let s = b ? n : 0, u = b ? 0 : n;
|
|
17
|
-
return i += `a${s},${s} 0 0 1 ${s},${s}`, i += `h${u}v${u}`, i += `v${x - 2 * n}`, s =
|
|
17
|
+
return i += `a${s},${s} 0 0 1 ${s},${s}`, i += `h${u}v${u}`, i += `v${x - 2 * n}`, s = c ? n : 0, u = c ? 0 : n, i += `a${s},${s} 0 0 1 ${-s},${s}`, i += `v${u}h${-u}`, i += `h${2 * n - a}`, s = _ ? n : 0, u = _ ? 0 : n, i += `a${s},${s} 0 0 1 ${-s},${-s}`, i += `h${-u}v${-u}`, i += `v${2 * n - x}`, s = y ? n : 0, u = y ? 0 : n, i += `a${s},${s} 0 0 1 ${s},${-s}`, i += `v${-u}h${u}`, i += "z", i;
|
|
18
18
|
}
|
|
19
|
-
const $t = Object.assign(Object.assign({}, gt), { color: void 0, groupMaxWidth: void 0, groupWidth: void 0, dataStep: void 0, groupPadding: 0.05, barPadding: 0, roundedCorners: 2, barMinHeight: 2, cursor: null, orientation:
|
|
19
|
+
const $t = Object.assign(Object.assign({}, gt), { color: void 0, groupMaxWidth: void 0, groupWidth: void 0, dataStep: void 0, groupPadding: 0.05, barPadding: 0, roundedCorners: 2, barMinHeight: 2, cursor: null, orientation: Ae.Vertical }), ze = xe`
|
|
20
20
|
label: grouped-bar-component;
|
|
21
21
|
`, Mt = Je`
|
|
22
22
|
:root {
|
|
@@ -60,12 +60,12 @@ const $t = Object.assign(Object.assign({}, gt), { color: void 0, groupMaxWidth:
|
|
|
60
60
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
61
61
|
class Be extends ht {
|
|
62
62
|
constructor(h) {
|
|
63
|
-
super(), this._defaultConfig = $t, this.config = this._defaultConfig, this.getAccessors = () =>
|
|
63
|
+
super(), this._defaultConfig = $t, this.config = this._defaultConfig, this.getAccessors = () => Qe(this.config.y) ? this.config.y : [this.config.y], this.events = {}, this._barData = [], h && this.setConfig(h);
|
|
64
64
|
}
|
|
65
65
|
get bleed() {
|
|
66
66
|
if (this._barData = this._getVisibleData(), this._barData.length === 0)
|
|
67
67
|
return { top: 0, bottom: 0, left: 0, right: 0 };
|
|
68
|
-
const h = !this.isVertical() && this.dataScale.range()[0] > this.dataScale.range()[1], a = this.dataScale.domain(), x = this._getGroupWidth() / 2, y = this._barData.map((S,
|
|
68
|
+
const h = !this.isVertical() && this.dataScale.range()[0] > this.dataScale.range()[1], a = this.dataScale.domain(), x = this._getGroupWidth() / 2, y = this._barData.map((S, E) => le(S, this.config.x, E)), b = ye(y), _ = Ke(y), c = this.dataScale(b), n = this.dataScale(_), i = this.dataScale.invert(c + (h ? x : -x)), s = this.dataScale.invert(n + (h ? -x : x)), u = i <= a[0] ? this.dataScale(a[0]) - this.dataScale(i) : 0, I = s > a[1] ? this.dataScale(s) - this.dataScale(a[1]) : 0;
|
|
69
69
|
return {
|
|
70
70
|
top: this.isVertical() ? 0 : h ? -I : u,
|
|
71
71
|
bottom: this.isVertical() ? 0 : h ? -u : I,
|
|
@@ -80,32 +80,32 @@ class Be extends ht {
|
|
|
80
80
|
return this.isVertical() ? this.yScale : this.xScale;
|
|
81
81
|
}
|
|
82
82
|
isVertical() {
|
|
83
|
-
return this.config.orientation ===
|
|
83
|
+
return this.config.orientation === Ae.Vertical;
|
|
84
84
|
}
|
|
85
85
|
_render(h) {
|
|
86
|
-
const { config: a } = this, x = we(h) ? h : a.duration, y = this._getGroupWidth(), b = this.getAccessors(), _ = [-y / 2, y / 2],
|
|
86
|
+
const { config: a } = this, x = we(h) ? h : a.duration, y = this._getGroupWidth(), b = this.getAccessors(), _ = [-y / 2, y / 2], c = xt().domain(yt(b.length)).range(_).paddingInner(a.barPadding).paddingOuter(a.barPadding), n = this.g.selectAll(`.${ke}`).data(this._barData, (P, j) => {
|
|
87
87
|
var M;
|
|
88
|
-
return `${(M = Ce(P, a.id,
|
|
89
|
-
}), i = (P,
|
|
90
|
-
const M = this.dataScale(le(P, a.x,
|
|
91
|
-
return `translate(${U},${
|
|
88
|
+
return `${(M = Ce(P, a.id, j)) !== null && M !== void 0 ? M : j}`;
|
|
89
|
+
}), i = (P, j) => {
|
|
90
|
+
const M = this.dataScale(le(P, a.x, j)), U = this.isVertical() ? M : 0, L = this.isVertical() ? 0 : M;
|
|
91
|
+
return `translate(${U},${L})`;
|
|
92
92
|
}, u = n.enter().append("g").attr("class", ke).attr("transform", i).style("opacity", 1).merge(n);
|
|
93
|
-
|
|
93
|
+
de(u, x).attr("transform", i).style("opacity", 1);
|
|
94
94
|
const I = n.exit().attr("class", Ne);
|
|
95
|
-
|
|
96
|
-
const S =
|
|
97
|
-
const M =
|
|
98
|
-
return this._getBarPath(M, U,
|
|
99
|
-
}).style("fill", (P,
|
|
100
|
-
|
|
101
|
-
const M =
|
|
102
|
-
let q = f ? this.valueScale(0) : this.valueScale(
|
|
95
|
+
de(I, x).style("opacity", 0).remove(), de(I.selectAll(`.${ge}`), x).attr("transform", (P, j, M) => this.isVertical() ? `translate(0,${this.yScale(0)}) scale(1,0)` : `translate(${this.xScale(0)},0) scale(0,1)`);
|
|
96
|
+
const S = c.bandwidth(), E = u.selectAll(`.${ge}`).data((P) => b.map(() => P)), $ = this._getValueAxisDirection(), ne = E.enter().append("path").attr("class", ge).attr("d", (P, j) => {
|
|
97
|
+
const M = c(j), U = this.valueScale(0), L = S;
|
|
98
|
+
return this._getBarPath(M, U, L, 0, !1, $);
|
|
99
|
+
}).style("fill", (P, j) => $e(P, a.color, j)).merge(E);
|
|
100
|
+
de(ne, x).attr("d", (P, j) => {
|
|
101
|
+
const M = c(j), U = S, L = le(P, b[j]), f = L < 0;
|
|
102
|
+
let q = f ? this.valueScale(0) : this.valueScale(L || 0), oe = Math.abs(this.valueScale(0) - this.valueScale(L)) || 0;
|
|
103
103
|
if (oe < a.barMinHeight) {
|
|
104
|
-
const
|
|
105
|
-
q = this.valueScale(0) +
|
|
104
|
+
const X = $ === pe.North ? -1 : 1;
|
|
105
|
+
q = this.valueScale(0) + X * a.barMinHeight, oe = a.barMinHeight;
|
|
106
106
|
}
|
|
107
107
|
return this._getBarPath(M, q, U, oe, f, $);
|
|
108
|
-
}).style("fill", (P,
|
|
108
|
+
}).style("fill", (P, j) => $e(P, a.color, j)).style("cursor", (P, j) => Ce(P, a.cursor, j)), de(E.exit(), x).remove();
|
|
109
109
|
}
|
|
110
110
|
_getValueAxisDirection() {
|
|
111
111
|
return this.valueScale.range()[0] > this.valueScale.range()[1] ? pe.North : pe.South;
|
|
@@ -118,16 +118,16 @@ class Be extends ht {
|
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
120
|
_getBarPath(h, a, x, y, b, _) {
|
|
121
|
-
const { config:
|
|
121
|
+
const { config: c } = this, n = c.roundedCorners ? we(c.roundedCorners) ? +c.roundedCorners : x / 2 : 0, i = st(n, 0, Math.min(y, x) / 2), s = _ === pe.North, u = this.isVertical() && b !== s, I = this.isVertical() && b === s, S = !this.isVertical() && b, E = !this.isVertical() && !b;
|
|
122
122
|
return Ct({
|
|
123
123
|
x: this.isVertical() ? h : a + (s ? 0 : -y),
|
|
124
124
|
y: this.isVertical() ? a + (s ? 0 : -y) : h,
|
|
125
125
|
w: this.isVertical() ? x : y,
|
|
126
126
|
h: this.isVertical() ? y : x,
|
|
127
127
|
tl: u || S,
|
|
128
|
-
tr: u ||
|
|
128
|
+
tr: u || E,
|
|
129
129
|
bl: I || S,
|
|
130
|
-
br: I ||
|
|
130
|
+
br: I || E,
|
|
131
131
|
r: i
|
|
132
132
|
});
|
|
133
133
|
}
|
|
@@ -162,10 +162,10 @@ class Be extends ht {
|
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
Be.selectors = Rt;
|
|
165
|
-
const Vt = { "data-vis-component": "" },
|
|
165
|
+
const Vt = { "data-vis-component": "" }, Oe = /* @__PURE__ */ ce({
|
|
166
166
|
__name: "index",
|
|
167
167
|
props: {
|
|
168
|
-
color: {
|
|
168
|
+
color: {},
|
|
169
169
|
groupWidth: {},
|
|
170
170
|
groupMaxWidth: {},
|
|
171
171
|
dataStep: {},
|
|
@@ -173,10 +173,10 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
173
173
|
barPadding: {},
|
|
174
174
|
roundedCorners: { type: [Number, Boolean] },
|
|
175
175
|
barMinHeight: {},
|
|
176
|
-
cursor: {
|
|
176
|
+
cursor: {},
|
|
177
177
|
orientation: {},
|
|
178
|
-
x: {
|
|
179
|
-
y: {
|
|
178
|
+
x: {},
|
|
179
|
+
y: {},
|
|
180
180
|
id: { type: Function },
|
|
181
181
|
xScale: { type: [Object, Function] },
|
|
182
182
|
yScale: { type: [Object, Function] },
|
|
@@ -187,26 +187,26 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
187
187
|
data: {}
|
|
188
188
|
},
|
|
189
189
|
setup(g, { expose: h }) {
|
|
190
|
-
const a =
|
|
191
|
-
return
|
|
192
|
-
|
|
193
|
-
var
|
|
194
|
-
_.value = new Be(b.value), (
|
|
190
|
+
const a = We(ot), x = g, y = N(() => a.data.value ?? x.data), b = nt(x), _ = z();
|
|
191
|
+
return Fe(() => {
|
|
192
|
+
je(() => {
|
|
193
|
+
var c;
|
|
194
|
+
_.value = new Be(b.value), (c = _.value) == null || c.setData(y.value), a.update(_.value);
|
|
195
195
|
});
|
|
196
|
-
}),
|
|
197
|
-
var
|
|
198
|
-
(
|
|
199
|
-
}),
|
|
196
|
+
}), Le(() => {
|
|
197
|
+
var c;
|
|
198
|
+
(c = _.value) == null || c.destroy(), a.destroy();
|
|
199
|
+
}), Q(b, (c, n) => {
|
|
200
200
|
var i;
|
|
201
|
-
rt(
|
|
202
|
-
}),
|
|
203
|
-
var
|
|
204
|
-
(
|
|
201
|
+
rt(c, n) || (i = _.value) == null || i.setConfig(b.value);
|
|
202
|
+
}), Q(y, () => {
|
|
203
|
+
var c;
|
|
204
|
+
(c = _.value) == null || c.setData(y.value);
|
|
205
205
|
}), h({
|
|
206
206
|
component: _
|
|
207
|
-
}), (
|
|
207
|
+
}), (c, n) => (v(), T("div", Vt));
|
|
208
208
|
}
|
|
209
|
-
}), It = { class: "flex flex-col sm:flex-row" }, Tt = ["data-active"],
|
|
209
|
+
}), It = { class: "flex flex-col sm:flex-row" }, Tt = ["data-active"], Et = { class: "flex items-center gap-2" }, Ot = { class: "block text-muted-foreground text-xs mr-2 max-w-[120px] truncate" }, Pt = { class: "block text-lg leading-none font-bold sm:text-3xl" }, jt = { class: "mx-auto w-full max-w-sm mt-2 mb-8" }, At = { class: "text-muted-foreground" }, zt = { class: "text-muted-foreground" }, Nt = { class: "grid" }, Bt = { class: "flex gap-1 overflow-hidden max-w-80" }, Wt = { class: "truncate" }, Ft = /* @__PURE__ */ ce({
|
|
210
210
|
__name: "ResourceSelector",
|
|
211
211
|
props: {
|
|
212
212
|
resources: {
|
|
@@ -238,9 +238,9 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
238
238
|
set: (i) => {
|
|
239
239
|
x("update:activeChart", i);
|
|
240
240
|
}
|
|
241
|
-
}), { width: _ } = vt(),
|
|
241
|
+
}), { width: _ } = vt(), c = N(() => _.value < 640), n = z(!1);
|
|
242
242
|
return (i, s) => {
|
|
243
|
-
const u = V("DrawerTitle"), I = V("DrawerDescription"), S = V("DrawerHeader"),
|
|
243
|
+
const u = V("DrawerTitle"), I = V("DrawerDescription"), S = V("DrawerHeader"), E = V("Button"), $ = V("DrawerFooter"), Y = V("DrawerContent"), ne = V("Drawer"), P = V("DropdownMenuTrigger"), j = V("DropdownMenuLabel"), M = V("DropdownMenuItem"), U = V("DropdownMenuContent"), L = V("DropdownMenu");
|
|
244
244
|
return v(), T("div", It, [
|
|
245
245
|
g.resources.length > 1 ? (v(), T("button", {
|
|
246
246
|
key: 0,
|
|
@@ -249,39 +249,39 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
249
249
|
onClick: s[0] || (s[0] = (f) => n.value = !0),
|
|
250
250
|
onContextmenu: s[1] || (s[1] = Ge((f) => n.value = !0, ["prevent"]))
|
|
251
251
|
}, [
|
|
252
|
-
l("div",
|
|
252
|
+
l("div", Et, [
|
|
253
253
|
g.viewMode === "stacked" ? (v(), T(ie, { key: 0 }, [
|
|
254
|
-
|
|
254
|
+
d(e(be), { class: "size-3 text-muted-foreground" }),
|
|
255
255
|
s[6] || (s[6] = l("span", { class: "block text-muted-foreground text-xs mr-2 max-w-[120px] truncate" }, "All Resources", -1))
|
|
256
256
|
], 64)) : (v(), T(ie, { key: 1 }, [
|
|
257
257
|
l("div", {
|
|
258
258
|
class: "size-3 rounded-full mr-2",
|
|
259
259
|
style: ve({ backgroundColor: g.resources.find((f) => f.id === g.activeChart)?.color || "#6b7280" })
|
|
260
260
|
}, null, 4),
|
|
261
|
-
l("span",
|
|
261
|
+
l("span", Ot, A(g.resources.find((f) => f.id === g.activeChart)?.name || "Select Resource"), 1)
|
|
262
262
|
], 64)),
|
|
263
|
-
|
|
263
|
+
d(e(it), { class: "ml-auto size-4" })
|
|
264
264
|
]),
|
|
265
|
-
l("span", Pt,
|
|
266
|
-
], 40, Tt)) :
|
|
267
|
-
e(
|
|
265
|
+
l("span", Pt, A(g.viewMode === "stacked" ? Object.values(g.totals).reduce((f, q) => f + q, 0).toLocaleString() : (g.totals[g.activeChart] || 0).toLocaleString()), 1)
|
|
266
|
+
], 40, Tt)) : K("", !0),
|
|
267
|
+
e(c) ? (v(), F(ne, {
|
|
268
268
|
key: 1,
|
|
269
269
|
open: e(n),
|
|
270
270
|
"onUpdate:open": s[3] || (s[3] = (f) => se(n) ? n.value = f : null)
|
|
271
271
|
}, {
|
|
272
272
|
default: k(() => [
|
|
273
|
-
|
|
273
|
+
d(Y, null, {
|
|
274
274
|
default: k(() => [
|
|
275
|
-
l("div",
|
|
276
|
-
|
|
275
|
+
l("div", jt, [
|
|
276
|
+
d(S, null, {
|
|
277
277
|
default: k(() => [
|
|
278
|
-
|
|
278
|
+
d(u, null, {
|
|
279
279
|
default: k(() => [...s[7] || (s[7] = [
|
|
280
280
|
Z("Resources", -1)
|
|
281
281
|
])]),
|
|
282
282
|
_: 1
|
|
283
283
|
}),
|
|
284
|
-
|
|
284
|
+
d(I, null, {
|
|
285
285
|
default: k(() => [...s[8] || (s[8] = [
|
|
286
286
|
Z("Select the resources to display on the timeline.", -1)
|
|
287
287
|
])]),
|
|
@@ -290,21 +290,21 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
290
290
|
]),
|
|
291
291
|
_: 1
|
|
292
292
|
}),
|
|
293
|
-
|
|
293
|
+
d($, null, {
|
|
294
294
|
default: k(() => [
|
|
295
|
-
|
|
295
|
+
d(E, {
|
|
296
296
|
onClick: s[2] || (s[2] = (f) => {
|
|
297
297
|
y.value = "stacked", b.value = "", n.value = !1;
|
|
298
298
|
}),
|
|
299
299
|
variant: g.viewMode === "stacked" ? "secondary" : "outline"
|
|
300
300
|
}, {
|
|
301
301
|
default: k(() => [
|
|
302
|
-
|
|
303
|
-
l("span",
|
|
302
|
+
d(e(be), { class: "size-3 text-muted-foreground" }),
|
|
303
|
+
l("span", At, " All Resources (" + A(Object.values(g.totals).reduce((f, q) => f + q, 0).toLocaleString()) + ") ", 1)
|
|
304
304
|
]),
|
|
305
305
|
_: 1
|
|
306
306
|
}, 8, ["variant"]),
|
|
307
|
-
(v(!0), T(ie, null, he(g.resources, (f) => (v(),
|
|
307
|
+
(v(!0), T(ie, null, he(g.resources, (f) => (v(), F(E, {
|
|
308
308
|
key: f.id,
|
|
309
309
|
onClick: (q) => {
|
|
310
310
|
y.value = "single", b.value = f.id, n.value = !1;
|
|
@@ -316,7 +316,7 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
316
316
|
class: "size-3 rounded-full",
|
|
317
317
|
style: ve({ backgroundColor: f.color || "#6b7280" })
|
|
318
318
|
}, null, 4),
|
|
319
|
-
l("span", zt,
|
|
319
|
+
l("span", zt, A(f.name) + " (" + A((g.totals[f.id] || 0).toLocaleString()) + ") ", 1)
|
|
320
320
|
]),
|
|
321
321
|
_: 2
|
|
322
322
|
}, 1032, ["onClick", "variant"]))), 128))
|
|
@@ -329,13 +329,13 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
329
329
|
})
|
|
330
330
|
]),
|
|
331
331
|
_: 1
|
|
332
|
-
}, 8, ["open"])) : (v(), L
|
|
332
|
+
}, 8, ["open"])) : (v(), F(L, {
|
|
333
333
|
key: 2,
|
|
334
334
|
open: e(n),
|
|
335
335
|
"onUpdate:open": s[5] || (s[5] = (f) => se(n) ? n.value = f : null)
|
|
336
336
|
}, {
|
|
337
337
|
default: k(() => [
|
|
338
|
-
|
|
338
|
+
d(P, { "as-child": "" }, {
|
|
339
339
|
default: k(() => [...s[9] || (s[9] = [
|
|
340
340
|
l("button", {
|
|
341
341
|
tabindex: "-1",
|
|
@@ -344,28 +344,28 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
344
344
|
])]),
|
|
345
345
|
_: 1
|
|
346
346
|
}),
|
|
347
|
-
|
|
347
|
+
d(U, { align: "end" }, {
|
|
348
348
|
default: k(() => [
|
|
349
|
-
|
|
349
|
+
d(j, null, {
|
|
350
350
|
default: k(() => [...s[10] || (s[10] = [
|
|
351
351
|
Z("Resources", -1)
|
|
352
352
|
])]),
|
|
353
353
|
_: 1
|
|
354
354
|
}),
|
|
355
355
|
l("div", Nt, [
|
|
356
|
-
|
|
356
|
+
d(M, {
|
|
357
357
|
onClick: s[4] || (s[4] = (f) => {
|
|
358
358
|
y.value = "stacked", b.value = "", n.value = !1;
|
|
359
359
|
}),
|
|
360
360
|
class: re(g.viewMode === "stacked" ? "bg-input" : "")
|
|
361
361
|
}, {
|
|
362
362
|
default: k(() => [
|
|
363
|
-
|
|
364
|
-
l("span", null, " All Resources (" +
|
|
363
|
+
d(e(be), { class: "size-3 text-muted-foreground" }),
|
|
364
|
+
l("span", null, " All Resources (" + A(Object.values(g.totals).reduce((f, q) => f + q, 0).toLocaleString()) + ") ", 1)
|
|
365
365
|
]),
|
|
366
366
|
_: 1
|
|
367
367
|
}, 8, ["class"]),
|
|
368
|
-
(v(!0), T(ie, null, he(g.resources, (f) => (v(),
|
|
368
|
+
(v(!0), T(ie, null, he(g.resources, (f) => (v(), F(M, {
|
|
369
369
|
key: f.id,
|
|
370
370
|
onClick: (q) => {
|
|
371
371
|
y.value = "single", b.value = f.id, n.value = !1;
|
|
@@ -378,8 +378,8 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
378
378
|
style: ve({ backgroundColor: f.color || "#6b7280" })
|
|
379
379
|
}, null, 4),
|
|
380
380
|
l("span", Bt, [
|
|
381
|
-
l("span",
|
|
382
|
-
l("span", null, "(" +
|
|
381
|
+
l("span", Wt, A(f.name), 1),
|
|
382
|
+
l("span", null, "(" + A((g.totals[f.id] || 0).toLocaleString()) + ")", 1)
|
|
383
383
|
])
|
|
384
384
|
]),
|
|
385
385
|
_: 2
|
|
@@ -394,16 +394,16 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
394
394
|
]);
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
|
-
}),
|
|
397
|
+
}), Lt = { class: "flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6" }, Gt = { class: "flex flex-col sm:flex-row sm:items-center gap-2 sm:gap-3" }, Ht = { class: "flex items-center gap-1" }, Ut = { class: "timeline-date-trigger" }, qt = {
|
|
398
398
|
key: 1,
|
|
399
399
|
class: "flex items-center justify-center px-6 py-4 text-muted-foreground text-sm"
|
|
400
|
-
},
|
|
400
|
+
}, Yt = {
|
|
401
401
|
key: 0,
|
|
402
402
|
class: "flex items-center justify-center h-[250px]"
|
|
403
|
-
},
|
|
403
|
+
}, Xt = {
|
|
404
404
|
key: 1,
|
|
405
405
|
class: "flex items-center justify-center h-[250px]"
|
|
406
|
-
}, Pe = "#61616180", Jt = /* @__PURE__ */
|
|
406
|
+
}, Pe = "#61616180", Jt = /* @__PURE__ */ ce({
|
|
407
407
|
__name: "Timeline",
|
|
408
408
|
props: {
|
|
409
409
|
modelValue: {},
|
|
@@ -414,20 +414,20 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
414
414
|
},
|
|
415
415
|
emits: ["update:modelValue", "update:selectedResource", "update:viewMode"],
|
|
416
416
|
setup(g, { emit: h }) {
|
|
417
|
-
const a = g, x = h, { params: y } = _e(), { config: b } = De(), _ = Se(b.project),
|
|
418
|
-
|
|
417
|
+
const a = g, x = h, { params: y } = _e(), { config: b } = De(), _ = Se(b.project), c = z([]), n = z([]), i = z(!0), s = z(a.viewMode || "stacked"), u = z(a.selectedResource || "");
|
|
418
|
+
Q(s, (t) => {
|
|
419
419
|
x("update:viewMode", t);
|
|
420
|
-
}, { immediate: !0 }),
|
|
420
|
+
}, { immediate: !0 }), Q(u, (t) => {
|
|
421
421
|
x("update:selectedResource", s.value === "single" ? t : null);
|
|
422
|
-
}),
|
|
422
|
+
}), Q(s, (t) => {
|
|
423
423
|
x("update:selectedResource", t === "single" ? u.value : null);
|
|
424
|
-
}),
|
|
424
|
+
}), Q(() => a.selectedResource, (t) => {
|
|
425
425
|
s.value === "single" && t !== u.value && (u.value = t || "");
|
|
426
426
|
});
|
|
427
|
-
const I = /* @__PURE__ */ new Date(), S = z(a.modelValue || /* @__PURE__ */ new Date()),
|
|
428
|
-
|
|
427
|
+
const I = /* @__PURE__ */ new Date(), S = z(a.modelValue || /* @__PURE__ */ new Date()), E = z(null);
|
|
428
|
+
Q(() => a.modelValue, (t) => {
|
|
429
429
|
t && t.getTime() !== S.value.getTime() && (S.value = t);
|
|
430
|
-
}),
|
|
430
|
+
}), Q(S, (t) => {
|
|
431
431
|
x("update:modelValue", t);
|
|
432
432
|
}, { immediate: !0 });
|
|
433
433
|
const $ = N({
|
|
@@ -439,8 +439,8 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
439
439
|
}
|
|
440
440
|
S.value = /* @__PURE__ */ new Date(`${t}T00:00:00`);
|
|
441
441
|
}
|
|
442
|
-
}),
|
|
443
|
-
const t =
|
|
442
|
+
}), Y = () => {
|
|
443
|
+
const t = E.value;
|
|
444
444
|
if (t) {
|
|
445
445
|
if (typeof t.showPicker == "function") {
|
|
446
446
|
t.showPicker();
|
|
@@ -461,12 +461,12 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
461
461
|
}), P = () => {
|
|
462
462
|
const t = new Date(S.value);
|
|
463
463
|
t.setDate(t.getDate() - 1), S.value = t;
|
|
464
|
-
},
|
|
464
|
+
}, j = () => {
|
|
465
465
|
const t = new Date(S.value);
|
|
466
466
|
t.setDate(t.getDate() + 1), S.value = t;
|
|
467
467
|
}, M = () => {
|
|
468
468
|
S.value = /* @__PURE__ */ new Date();
|
|
469
|
-
}, U = N(() => a.resources?.length === 0 ? 10 : Math.max(...(a.resources || []).map((t) => t.capacity || 10))),
|
|
469
|
+
}, U = N(() => a.resources?.length === 0 ? 10 : Math.max(...(a.resources || []).map((t) => t.capacity || 10))), L = N(() => (a.resources?.length || 0) === 0 ? 60 : Math.min(...(a.resources || []).map((t) => t.interval || 60))), f = N(() => {
|
|
470
470
|
const t = {
|
|
471
471
|
total: {
|
|
472
472
|
label: "Total Reservations",
|
|
@@ -480,18 +480,18 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
480
480
|
};
|
|
481
481
|
}), t;
|
|
482
482
|
});
|
|
483
|
-
|
|
483
|
+
Q(() => a.resources, (t) => {
|
|
484
484
|
(t?.length || 0) > 0 && !u.value && (u.value = t[0].id);
|
|
485
485
|
}, { immediate: !0 });
|
|
486
486
|
const q = N(() => [...a.resources || []].sort((t, p) => {
|
|
487
|
-
const C =
|
|
488
|
-
return (
|
|
487
|
+
const C = X.value[t.id] || 0;
|
|
488
|
+
return (X.value[p.id] || 0) - C;
|
|
489
489
|
})), oe = N(() => {
|
|
490
490
|
const t = [];
|
|
491
|
-
return
|
|
491
|
+
return L.value, c.value.forEach((p, C) => {
|
|
492
492
|
p.time.endsWith(":00") && t.push(C);
|
|
493
493
|
}), t;
|
|
494
|
-
}),
|
|
494
|
+
}), X = N(() => {
|
|
495
495
|
const t = {};
|
|
496
496
|
return a.resources?.forEach((p) => {
|
|
497
497
|
t[p.id] = n.value.filter((C) => C.resourceId === p.id).reduce((C, R) => C + (R.reserved || 0), 0);
|
|
@@ -502,15 +502,15 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
502
502
|
}, r = (t) => {
|
|
503
503
|
const [p, C] = t.split(":").map(Number);
|
|
504
504
|
return p * 60 + C;
|
|
505
|
-
}, o = (t, p) => (a.agendaData?.exceptions || []).find((R) => p >= R.startDate && p <= R.endDate ? R.resourceIds === null ? !0 : R.resourceIds?.includes(t) : !1) || null,
|
|
505
|
+
}, o = (t, p) => (a.agendaData?.exceptions || []).find((R) => p >= R.startDate && p <= R.endDate ? R.resourceIds === null ? !0 : R.resourceIds?.includes(t) : !1) || null, O = N(() => {
|
|
506
506
|
const t = ue(S.value), p = S.value.getDay();
|
|
507
507
|
let C = 1440, R = 0;
|
|
508
508
|
if ((a.resources || []).forEach((ae) => {
|
|
509
|
-
const
|
|
510
|
-
if (
|
|
511
|
-
if (
|
|
509
|
+
const W = o(ae.id, t);
|
|
510
|
+
if (W) {
|
|
511
|
+
if (W.isClosed)
|
|
512
512
|
return;
|
|
513
|
-
|
|
513
|
+
W.timeslots.forEach((J) => {
|
|
514
514
|
const D = r(J.startTime), w = r(J.endTime);
|
|
515
515
|
C = Math.min(C, D), R = Math.max(R, w);
|
|
516
516
|
});
|
|
@@ -524,11 +524,11 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
524
524
|
const m = Math.floor(C / 60) * 60, te = Math.ceil(R / 60) * 60;
|
|
525
525
|
return { startMinutes: m, endMinutes: te };
|
|
526
526
|
}), G = () => {
|
|
527
|
-
const t = [], p =
|
|
527
|
+
const t = [], p = L.value, { startMinutes: C, endMinutes: R } = O.value;
|
|
528
528
|
for (let m = C; m < R; m += p) {
|
|
529
|
-
const te = Math.floor(m / 60), ae = m % 60,
|
|
530
|
-
time:
|
|
531
|
-
label:
|
|
529
|
+
const te = Math.floor(m / 60), ae = m % 60, W = `${String(te).padStart(2, "0")}:${String(ae).padStart(2, "0")}`, J = {
|
|
530
|
+
time: W,
|
|
531
|
+
label: W
|
|
532
532
|
};
|
|
533
533
|
a.resources?.forEach((D) => {
|
|
534
534
|
J[D.id] = 0;
|
|
@@ -540,66 +540,66 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
540
540
|
try {
|
|
541
541
|
const t = y.value.id, p = ue(S.value), C = `${t}_${p}`, R = await _.get(b.reservedSpotsCollection, C);
|
|
542
542
|
n.value = [];
|
|
543
|
-
for (const
|
|
544
|
-
const J = R?.[
|
|
543
|
+
for (const W of a.resources || []) {
|
|
544
|
+
const J = R?.[W.id] || {};
|
|
545
545
|
Object.entries(J).forEach(([D, w]) => {
|
|
546
546
|
const [ee, me] = D.split("-");
|
|
547
547
|
n.value.push({
|
|
548
|
-
resourceId:
|
|
548
|
+
resourceId: W.id,
|
|
549
549
|
startTime: ee,
|
|
550
550
|
endTime: me,
|
|
551
551
|
reserved: w
|
|
552
552
|
});
|
|
553
553
|
});
|
|
554
554
|
}
|
|
555
|
-
const m = G(), te =
|
|
556
|
-
n.value.forEach((
|
|
557
|
-
const J = r(
|
|
555
|
+
const m = G(), te = L.value, { startMinutes: ae } = O.value;
|
|
556
|
+
n.value.forEach((W) => {
|
|
557
|
+
const J = r(W.startTime), D = r(W.endTime);
|
|
558
558
|
for (let w = J; w < D; w += te) {
|
|
559
559
|
const ee = Math.floor((w - ae) / te);
|
|
560
560
|
if (ee >= 0 && ee < m.length) {
|
|
561
|
-
const me = m[ee][
|
|
562
|
-
typeof me == "number" && (m[ee][
|
|
561
|
+
const me = m[ee][W.resourceId];
|
|
562
|
+
typeof me == "number" && (m[ee][W.resourceId] = me + (W.reserved || 0));
|
|
563
563
|
}
|
|
564
564
|
}
|
|
565
|
-
}),
|
|
565
|
+
}), c.value = m;
|
|
566
566
|
} catch (t) {
|
|
567
|
-
console.error("Error loading reservation data:", t),
|
|
567
|
+
console.error("Error loading reservation data:", t), c.value = G(), n.value = [];
|
|
568
568
|
} finally {
|
|
569
569
|
i.value = !1;
|
|
570
570
|
}
|
|
571
571
|
};
|
|
572
|
-
return (async () => await H())(),
|
|
572
|
+
return (async () => await H())(), Q(S, () => {
|
|
573
573
|
H();
|
|
574
|
-
}),
|
|
574
|
+
}), Q(() => a.resources, () => {
|
|
575
575
|
(a.resources?.length || 0) > 0 && H();
|
|
576
576
|
}), (t, p) => {
|
|
577
|
-
const C = V("CardTitle"), R = V("Button"), m = V("CardDescription"), te = V("CardHeader"), ae = V("ChartContainer"),
|
|
578
|
-
return v(),
|
|
577
|
+
const C = V("CardTitle"), R = V("Button"), m = V("CardDescription"), te = V("CardHeader"), ae = V("ChartContainer"), W = V("CardContent"), J = V("Card");
|
|
578
|
+
return v(), F(J, { class: "py-4 sm:py-0" }, {
|
|
579
579
|
default: k(() => [
|
|
580
|
-
|
|
580
|
+
d(te, { class: "flex flex-col items-stretch border-b !p-0 sm:flex-row" }, {
|
|
581
581
|
default: k(() => [
|
|
582
|
-
l("div",
|
|
582
|
+
l("div", Lt, [
|
|
583
583
|
l("div", Gt, [
|
|
584
|
-
|
|
584
|
+
d(C, null, {
|
|
585
585
|
default: k(() => [...p[3] || (p[3] = [
|
|
586
586
|
Z("Reservations", -1)
|
|
587
587
|
])]),
|
|
588
588
|
_: 1
|
|
589
589
|
}),
|
|
590
590
|
l("div", Ht, [
|
|
591
|
-
|
|
591
|
+
d(R, {
|
|
592
592
|
variant: "outline",
|
|
593
593
|
size: "icon",
|
|
594
594
|
class: "size-8",
|
|
595
595
|
onClick: P
|
|
596
596
|
}, {
|
|
597
597
|
default: k(() => [
|
|
598
|
-
|
|
598
|
+
d(e(lt), { size: 16 })
|
|
599
599
|
]),
|
|
600
600
|
_: 1
|
|
601
601
|
}),
|
|
602
|
-
|
|
602
|
+
d(R, {
|
|
603
603
|
variant: "outline",
|
|
604
604
|
size: "sm",
|
|
605
605
|
class: "h-8 px-3 text-xs",
|
|
@@ -610,36 +610,36 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
610
610
|
])]),
|
|
611
611
|
_: 1
|
|
612
612
|
}),
|
|
613
|
-
|
|
613
|
+
d(R, {
|
|
614
614
|
variant: "outline",
|
|
615
615
|
size: "icon",
|
|
616
616
|
class: "size-8",
|
|
617
|
-
onClick:
|
|
617
|
+
onClick: j
|
|
618
618
|
}, {
|
|
619
619
|
default: k(() => [
|
|
620
|
-
|
|
620
|
+
d(e(dt), { size: 16 })
|
|
621
621
|
]),
|
|
622
622
|
_: 1
|
|
623
623
|
})
|
|
624
624
|
])
|
|
625
625
|
]),
|
|
626
|
-
|
|
626
|
+
d(m, null, {
|
|
627
627
|
default: k(() => [
|
|
628
628
|
l("div", Ut, [
|
|
629
|
-
|
|
629
|
+
d(R, {
|
|
630
630
|
type: "button",
|
|
631
631
|
variant: "outline",
|
|
632
|
-
onClick:
|
|
632
|
+
onClick: Y
|
|
633
633
|
}, {
|
|
634
634
|
default: k(() => [
|
|
635
|
-
|
|
636
|
-
Z(" " +
|
|
635
|
+
d(e(ct), { class: "size-4" }),
|
|
636
|
+
Z(" " + A(e(ne)), 1)
|
|
637
637
|
]),
|
|
638
638
|
_: 1
|
|
639
639
|
}),
|
|
640
640
|
He(l("input", {
|
|
641
641
|
ref_key: "dateInputRef",
|
|
642
|
-
ref:
|
|
642
|
+
ref: E,
|
|
643
643
|
"onUpdate:modelValue": p[0] || (p[0] = (D) => se($) ? $.value = D : null),
|
|
644
644
|
type: "date",
|
|
645
645
|
class: "timeline-date-picker",
|
|
@@ -652,10 +652,10 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
652
652
|
_: 1
|
|
653
653
|
})
|
|
654
654
|
]),
|
|
655
|
-
g.resources.length > 0 ? (v(),
|
|
655
|
+
g.resources.length > 0 ? (v(), F(Ft, {
|
|
656
656
|
key: 0,
|
|
657
657
|
resources: g.resources,
|
|
658
|
-
totals: e(
|
|
658
|
+
totals: e(X),
|
|
659
659
|
viewMode: e(s),
|
|
660
660
|
"onUpdate:viewMode": p[1] || (p[1] = (D) => se(s) ? s.value = D : null),
|
|
661
661
|
activeChart: e(u),
|
|
@@ -664,26 +664,26 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
664
664
|
]),
|
|
665
665
|
_: 1
|
|
666
666
|
}),
|
|
667
|
-
|
|
667
|
+
d(W, { class: "px-2 sm:p-6" }, {
|
|
668
668
|
default: k(() => [
|
|
669
|
-
e(i) ? (v(), T("div",
|
|
669
|
+
e(i) ? (v(), T("div", Yt, [...p[5] || (p[5] = [
|
|
670
670
|
l("div", { class: "text-muted-foreground" }, "Loading...", -1)
|
|
671
|
-
])])) : g.resources.length === 0 ? (v(), T("div",
|
|
671
|
+
])])) : g.resources.length === 0 ? (v(), T("div", Xt, [...p[6] || (p[6] = [
|
|
672
672
|
l("div", { class: "text-muted-foreground" }, "No resources to display", -1)
|
|
673
|
-
])])) : e(s) === "stacked" ? (v(),
|
|
673
|
+
])])) : e(s) === "stacked" ? (v(), F(ae, {
|
|
674
674
|
key: 2,
|
|
675
675
|
config: e(f),
|
|
676
676
|
class: "aspect-auto h-[250px] w-full",
|
|
677
677
|
cursor: ""
|
|
678
678
|
}, {
|
|
679
679
|
default: k(() => [
|
|
680
|
-
|
|
681
|
-
data: e(
|
|
680
|
+
d(e(Ie), {
|
|
681
|
+
data: e(c),
|
|
682
682
|
margin: { left: -24 },
|
|
683
683
|
"y-domain": [0, e(U)]
|
|
684
684
|
}, {
|
|
685
685
|
default: k(() => [
|
|
686
|
-
(v(!0), T(ie, null, he(e(q), (D) => (v(),
|
|
686
|
+
(v(!0), T(ie, null, he(e(q), (D) => (v(), F(e(Oe), {
|
|
687
687
|
key: D.id,
|
|
688
688
|
x: (w, ee) => ee,
|
|
689
689
|
y: (w) => w[D.id] || 0,
|
|
@@ -691,27 +691,27 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
691
691
|
"bar-padding": 0.1,
|
|
692
692
|
"rounded-corners": 2
|
|
693
693
|
}, null, 8, ["x", "y", "color"]))), 128)),
|
|
694
|
-
|
|
694
|
+
d(e(fe), {
|
|
695
695
|
type: "x",
|
|
696
696
|
x: (D, w) => w,
|
|
697
697
|
"tick-line": !1,
|
|
698
698
|
"domain-line": !1,
|
|
699
699
|
"grid-line": !1,
|
|
700
700
|
"tick-values": e(oe),
|
|
701
|
-
"tick-format": (D) => e(
|
|
701
|
+
"tick-format": (D) => e(c)[D]?.time || ""
|
|
702
702
|
}, null, 8, ["x", "tick-values", "tick-format"]),
|
|
703
|
-
|
|
703
|
+
d(e(fe), {
|
|
704
704
|
type: "y",
|
|
705
705
|
"num-ticks": 3,
|
|
706
706
|
"tick-line": !1,
|
|
707
707
|
"domain-line": !1
|
|
708
708
|
}),
|
|
709
|
-
|
|
710
|
-
|
|
709
|
+
d(e(Te)),
|
|
710
|
+
d(e(Ee), {
|
|
711
711
|
template: e(Me)(e(f), e(Re), {
|
|
712
712
|
labelFormatter(D) {
|
|
713
713
|
const w = Math.round(D);
|
|
714
|
-
return w >= 0 && w < e(
|
|
714
|
+
return w >= 0 && w < e(c).length && e(c)[w]?.time || "";
|
|
715
715
|
}
|
|
716
716
|
}),
|
|
717
717
|
color: "#0000"
|
|
@@ -721,47 +721,47 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
721
721
|
}, 8, ["data", "y-domain"])
|
|
722
722
|
]),
|
|
723
723
|
_: 1
|
|
724
|
-
}, 8, ["config"])) : (v(),
|
|
724
|
+
}, 8, ["config"])) : (v(), F(ae, {
|
|
725
725
|
key: e(u),
|
|
726
726
|
config: e(f),
|
|
727
727
|
class: "aspect-auto h-[250px] w-full",
|
|
728
728
|
cursor: ""
|
|
729
729
|
}, {
|
|
730
730
|
default: k(() => [
|
|
731
|
-
|
|
732
|
-
data: e(
|
|
731
|
+
d(e(Ie), {
|
|
732
|
+
data: e(c),
|
|
733
733
|
margin: { left: -24 },
|
|
734
734
|
"y-domain": [0, e(U)]
|
|
735
735
|
}, {
|
|
736
736
|
default: k(() => [
|
|
737
|
-
|
|
737
|
+
d(e(Oe), {
|
|
738
738
|
x: (D, w) => w,
|
|
739
739
|
y: (D) => D[e(u)] || 0,
|
|
740
740
|
color: (D) => D[e(u)] > 0 ? e(f)[e(u)]?.color : Pe,
|
|
741
741
|
"bar-padding": 0.1,
|
|
742
742
|
"rounded-corners": !1
|
|
743
743
|
}, null, 8, ["x", "y", "color"]),
|
|
744
|
-
|
|
744
|
+
d(e(fe), {
|
|
745
745
|
type: "x",
|
|
746
746
|
x: (D, w) => w,
|
|
747
747
|
"tick-line": !1,
|
|
748
748
|
"domain-line": !1,
|
|
749
749
|
"grid-line": !1,
|
|
750
750
|
"tick-values": e(oe),
|
|
751
|
-
"tick-format": (D) => e(
|
|
751
|
+
"tick-format": (D) => e(c)[D]?.time || ""
|
|
752
752
|
}, null, 8, ["x", "tick-values", "tick-format"]),
|
|
753
|
-
|
|
753
|
+
d(e(fe), {
|
|
754
754
|
type: "y",
|
|
755
755
|
"num-ticks": 3,
|
|
756
756
|
"tick-line": !1,
|
|
757
757
|
"domain-line": !1
|
|
758
758
|
}),
|
|
759
|
-
|
|
760
|
-
|
|
759
|
+
d(e(Te)),
|
|
760
|
+
d(e(Ee), {
|
|
761
761
|
template: e(Me)(e(f), e(Re), {
|
|
762
762
|
labelFormatter(D) {
|
|
763
763
|
const w = Math.round(D);
|
|
764
|
-
return w >= 0 && w < e(
|
|
764
|
+
return w >= 0 && w < e(c).length && e(c)[w]?.time || "";
|
|
765
765
|
}
|
|
766
766
|
}),
|
|
767
767
|
color: "#0000"
|
|
@@ -780,7 +780,7 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
780
780
|
});
|
|
781
781
|
};
|
|
782
782
|
}
|
|
783
|
-
}),
|
|
783
|
+
}), Qt = /* @__PURE__ */ bt(Jt, [["__scopeId", "data-v-62490f67"]]), Kt = { class: "flex flex-row items-center justify-between gap-2" }, Zt = { class: "relative mb-4" }, ea = { class: "flex gap-1 mb-4 flex-wrap" }, ta = {
|
|
784
784
|
key: 0,
|
|
785
785
|
class: "mb-3 text-sm text-muted-foreground"
|
|
786
786
|
}, aa = {
|
|
@@ -795,7 +795,7 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
795
795
|
}, na = {
|
|
796
796
|
key: 4,
|
|
797
797
|
class: "space-y-2"
|
|
798
|
-
}, ra = ["onClick"], ia = { class: "flex items-start justify-between" }, la = { class: "flex-1" },
|
|
798
|
+
}, ra = ["onClick"], ia = { class: "flex items-start justify-between" }, la = { class: "flex-1" }, da = { class: "font-medium" }, ca = { class: "text-sm text-muted-foreground" }, ua = { class: "text-sm text-muted-foreground" }, ma = { class: "flex items-center gap-4 flex-wrap" }, pa = { class: "flex items-center gap-2 mt-1 text-xs text-muted-foreground" }, fa = { class: "flex items-center gap-2 mt-1 text-xs text-muted-foreground" }, va = {
|
|
799
799
|
key: 0,
|
|
800
800
|
class: "flex items-center gap-1 mt-1 text-xs text-muted-foreground"
|
|
801
801
|
}, ga = { class: "text-right" }, ha = {
|
|
@@ -816,7 +816,7 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
816
816
|
}, _a = {
|
|
817
817
|
key: 5,
|
|
818
818
|
class: "text-sm font-medium mt-1"
|
|
819
|
-
}, Da = /* @__PURE__ */
|
|
819
|
+
}, Da = /* @__PURE__ */ ce({
|
|
820
820
|
__name: "BookingsList",
|
|
821
821
|
props: {
|
|
822
822
|
agendaData: {},
|
|
@@ -826,16 +826,16 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
826
826
|
},
|
|
827
827
|
emits: ["resetSelectedResource"],
|
|
828
828
|
setup(g, { emit: h }) {
|
|
829
|
-
const a = g, x = h, { params: y } = _e(), { config: b } = De(), _ = Se(b.project),
|
|
830
|
-
date:
|
|
829
|
+
const a = g, x = h, { params: y } = _e(), { config: b } = De(), _ = Se(b.project), c = z([]), n = z(!0), i = z(""), s = z(null), u = z(null), I = N(() => a.agendaData?.metadataSchema || []), S = N(() => ({
|
|
830
|
+
date: E(a.activeDate),
|
|
831
831
|
resource: null
|
|
832
832
|
}));
|
|
833
833
|
qe("event", S);
|
|
834
|
-
const
|
|
835
|
-
const o = r.getFullYear(),
|
|
836
|
-
return `${o}-${
|
|
834
|
+
const E = (r) => {
|
|
835
|
+
const o = r.getFullYear(), O = String(r.getMonth() + 1).padStart(2, "0"), G = String(r.getDate()).padStart(2, "0");
|
|
836
|
+
return `${o}-${O}-${G}`;
|
|
837
837
|
}, $ = N(() => {
|
|
838
|
-
let r =
|
|
838
|
+
let r = c.value;
|
|
839
839
|
return a.selectedResource && (r = r.filter((o) => o.resourceId === a.selectedResource)), i.value.trim() && (r = new kt(r, {
|
|
840
840
|
keys: [
|
|
841
841
|
"customerInfo.firstName",
|
|
@@ -846,18 +846,18 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
846
846
|
],
|
|
847
847
|
threshold: 0.3,
|
|
848
848
|
ignoreLocation: !0
|
|
849
|
-
}).search(i.value).map((
|
|
850
|
-
}),
|
|
851
|
-
let r = JSON.parse(JSON.stringify(
|
|
849
|
+
}).search(i.value).map((O) => O.item)), r;
|
|
850
|
+
}), Y = N(() => $.value.filter((r) => M.value.includes(r.reservationStatus))), ne = N(() => {
|
|
851
|
+
let r = JSON.parse(JSON.stringify(c.value));
|
|
852
852
|
return a.selectedResource && (r = r.filter((o) => o.resourceId === a.selectedResource)), r.some((o) => o.reservationStatus === "approved" || o.reservationStatus === "needs_approval");
|
|
853
853
|
}), P = N(() => ({
|
|
854
|
-
spots:
|
|
855
|
-
bookings:
|
|
856
|
-
})),
|
|
854
|
+
spots: c.value.reduce((r, o) => r + (o.spots || 0), 0),
|
|
855
|
+
bookings: c.value.length
|
|
856
|
+
})), j = () => {
|
|
857
857
|
i.value = "";
|
|
858
858
|
}, M = z(["needs_approval", "approved"]), U = (r) => {
|
|
859
859
|
M.value.includes(r) ? M.value = M.value.filter((o) => o !== r) : M.value.push(r);
|
|
860
|
-
},
|
|
860
|
+
}, L = (r, o, O = o.date) => {
|
|
861
861
|
const G = a.resources.find((B) => B.id === o.resourceId), H = r.id || r.orderId || o.orderId || "";
|
|
862
862
|
return {
|
|
863
863
|
customerInfo: r.customerInfo,
|
|
@@ -872,7 +872,7 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
872
872
|
res_id: o.id,
|
|
873
873
|
resourceId: o.resourceId,
|
|
874
874
|
spots: o.spots,
|
|
875
|
-
date:
|
|
875
|
+
date: O,
|
|
876
876
|
createdAt: r.createdAt,
|
|
877
877
|
startTime: o.timeslot?.startTime,
|
|
878
878
|
endTime: o.timeslot?.endTime,
|
|
@@ -889,7 +889,7 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
889
889
|
reservationAdjustments: o.adjustments || []
|
|
890
890
|
};
|
|
891
891
|
}, f = async () => {
|
|
892
|
-
await
|
|
892
|
+
await je(), await new Promise((r) => {
|
|
893
893
|
if (typeof requestAnimationFrame == "function") {
|
|
894
894
|
requestAnimationFrame(() => r());
|
|
895
895
|
return;
|
|
@@ -899,88 +899,88 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
899
899
|
}, q = async (r) => {
|
|
900
900
|
const o = await _.get(b.reservationsCollection, r);
|
|
901
901
|
if (!o) return;
|
|
902
|
-
const
|
|
902
|
+
const O = { ...o, id: o.id || r }, G = (O.reservations || []).map((H) => L(O, H));
|
|
903
903
|
G.length && (await f(), u.value?.openDialog({
|
|
904
|
-
id:
|
|
905
|
-
customerInfo:
|
|
906
|
-
status:
|
|
907
|
-
createdAt:
|
|
908
|
-
metadata:
|
|
904
|
+
id: O.id,
|
|
905
|
+
customerInfo: O.customerInfo,
|
|
906
|
+
status: O.status,
|
|
907
|
+
createdAt: O.createdAt,
|
|
908
|
+
metadata: O.metadata || {},
|
|
909
909
|
reservations: G,
|
|
910
|
-
adjustments:
|
|
911
|
-
totalPrice: typeof
|
|
910
|
+
adjustments: O.adjustments || [],
|
|
911
|
+
totalPrice: typeof O.total == "number" ? O.total : G.reduce((H, B) => H + (B.reservationPrice || 0), 0),
|
|
912
912
|
totalSpots: G.reduce((H, B) => H + (B.spots || 0), 0)
|
|
913
913
|
}));
|
|
914
914
|
}, oe = async (r) => {
|
|
915
915
|
await f(), s.value?.openDialog(r);
|
|
916
|
-
},
|
|
917
|
-
n.value = !0,
|
|
916
|
+
}, X = async () => {
|
|
917
|
+
n.value = !0, c.value = [];
|
|
918
918
|
try {
|
|
919
|
-
const r = y.value.id, o =
|
|
919
|
+
const r = y.value.id, o = E(a.activeDate), O = /* @__PURE__ */ new Set();
|
|
920
920
|
a.resources?.forEach((B) => {
|
|
921
921
|
const t = `${B.id}_${o}`;
|
|
922
|
-
|
|
922
|
+
O.add(t);
|
|
923
923
|
});
|
|
924
924
|
const G = await _.find(b.reservationsCollection, {
|
|
925
925
|
filters: [
|
|
926
926
|
{ field: "agendaId", operator: "==", value: r },
|
|
927
927
|
{ field: "status", operator: "==", value: "confirmed" },
|
|
928
|
-
{ field: "flattenedReservationDates", operator: "array-contains-any", value: Array.from(
|
|
928
|
+
{ field: "flattenedReservationDates", operator: "array-contains-any", value: Array.from(O) }
|
|
929
929
|
]
|
|
930
930
|
});
|
|
931
931
|
let H = [];
|
|
932
932
|
G.forEach((B) => {
|
|
933
933
|
(B.reservations?.filter((p) => p.date === o) || []).forEach((p) => {
|
|
934
|
-
H.push(
|
|
934
|
+
H.push(L(B, p, o));
|
|
935
935
|
});
|
|
936
|
-
}),
|
|
936
|
+
}), c.value = H.sort((B, t) => B.startTime?.localeCompare(t.startTime || "") || 0);
|
|
937
937
|
} catch (r) {
|
|
938
|
-
console.error("Error loading orders:", r),
|
|
938
|
+
console.error("Error loading orders:", r), c.value = [];
|
|
939
939
|
} finally {
|
|
940
940
|
n.value = !1;
|
|
941
941
|
}
|
|
942
942
|
};
|
|
943
|
-
return (async () => await
|
|
944
|
-
|
|
943
|
+
return (async () => await X())(), Q(() => a.activeDate, () => {
|
|
944
|
+
X();
|
|
945
945
|
}), (r, o) => {
|
|
946
|
-
const
|
|
947
|
-
return v(),
|
|
946
|
+
const O = V("Badge"), G = V("CardTitle"), H = V("CardDescription"), B = V("Button"), t = V("CardHeader"), p = V("Input"), C = V("CardContent"), R = V("Card");
|
|
947
|
+
return v(), F(R, null, {
|
|
948
948
|
default: k(() => [
|
|
949
|
-
|
|
949
|
+
d(t, null, {
|
|
950
950
|
default: k(() => [
|
|
951
|
-
l("div",
|
|
951
|
+
l("div", Kt, [
|
|
952
952
|
l("div", null, [
|
|
953
|
-
|
|
953
|
+
d(G, { class: "flex items-center gap-2" }, {
|
|
954
954
|
default: k(() => [
|
|
955
955
|
o[9] || (o[9] = Z(" Bookings ", -1)),
|
|
956
|
-
e(P).bookings > 0 ? (v(),
|
|
956
|
+
e(P).bookings > 0 ? (v(), F(O, {
|
|
957
957
|
key: 0,
|
|
958
958
|
variant: "secondary"
|
|
959
959
|
}, {
|
|
960
960
|
default: k(() => [
|
|
961
|
-
Z(
|
|
961
|
+
Z(A(e(P).bookings), 1)
|
|
962
962
|
]),
|
|
963
963
|
_: 1
|
|
964
|
-
})) :
|
|
964
|
+
})) : K("", !0)
|
|
965
965
|
]),
|
|
966
966
|
_: 1
|
|
967
967
|
}),
|
|
968
|
-
|
|
968
|
+
d(H, { class: "flex items-center gap-2 mt-1" }, {
|
|
969
969
|
default: k(() => [
|
|
970
|
-
|
|
971
|
-
l("span", null,
|
|
970
|
+
d(e(Ve), { size: 14 }),
|
|
971
|
+
l("span", null, A(e(P).spots) + " total spots", 1)
|
|
972
972
|
]),
|
|
973
973
|
_: 1
|
|
974
974
|
})
|
|
975
975
|
]),
|
|
976
|
-
|
|
976
|
+
d(B, {
|
|
977
977
|
variant: "ghost",
|
|
978
978
|
size: "icon",
|
|
979
|
-
onClick:
|
|
979
|
+
onClick: X,
|
|
980
980
|
disabled: e(n)
|
|
981
981
|
}, {
|
|
982
982
|
default: k(() => [
|
|
983
|
-
|
|
983
|
+
d(e(ut), {
|
|
984
984
|
size: 16,
|
|
985
985
|
class: re({ "animate-spin": e(n) })
|
|
986
986
|
}, null, 8, ["class"])
|
|
@@ -991,38 +991,38 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
991
991
|
]),
|
|
992
992
|
_: 1
|
|
993
993
|
}),
|
|
994
|
-
|
|
994
|
+
d(C, null, {
|
|
995
995
|
default: k(() => [
|
|
996
996
|
l("div", Zt, [
|
|
997
|
-
|
|
997
|
+
d(e(mt), {
|
|
998
998
|
size: 16,
|
|
999
999
|
class: "absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
|
|
1000
1000
|
}),
|
|
1001
|
-
|
|
1001
|
+
d(p, {
|
|
1002
1002
|
modelValue: e(i),
|
|
1003
1003
|
"onUpdate:modelValue": o[0] || (o[0] = (m) => se(i) ? i.value = m : null),
|
|
1004
1004
|
placeholder: "Search by name, email, or phone...",
|
|
1005
1005
|
class: "pl-9 pr-9"
|
|
1006
1006
|
}, null, 8, ["modelValue"]),
|
|
1007
|
-
e(i) ? (v(),
|
|
1007
|
+
e(i) ? (v(), F(B, {
|
|
1008
1008
|
key: 0,
|
|
1009
1009
|
variant: "ghost",
|
|
1010
1010
|
size: "icon",
|
|
1011
1011
|
class: "absolute right-1 top-1/2 -translate-y-1/2 h-7 w-7",
|
|
1012
|
-
onClick:
|
|
1012
|
+
onClick: j
|
|
1013
1013
|
}, {
|
|
1014
1014
|
default: k(() => [
|
|
1015
|
-
|
|
1015
|
+
d(e(pt), { size: 14 })
|
|
1016
1016
|
]),
|
|
1017
1017
|
_: 1
|
|
1018
|
-
})) :
|
|
1018
|
+
})) : K("", !0)
|
|
1019
1019
|
]),
|
|
1020
1020
|
l("div", ea, [
|
|
1021
1021
|
g.agendaData.needsApproval ? (v(), T("button", {
|
|
1022
1022
|
key: 0,
|
|
1023
1023
|
onClick: o[1] || (o[1] = (m) => U("needs_approval")),
|
|
1024
1024
|
class: re(["px-3 py-1.5 rounded-full text-sm bg-muted", { "opacity-50 hover:opacity-75": !e(M).includes("needs_approval") }])
|
|
1025
|
-
}, " Needs Approval ", 2)) :
|
|
1025
|
+
}, " Needs Approval ", 2)) : K("", !0),
|
|
1026
1026
|
l("button", {
|
|
1027
1027
|
onClick: o[2] || (o[2] = (m) => U("approved")),
|
|
1028
1028
|
class: re(["px-3 py-1.5 rounded-full text-sm bg-muted", { "opacity-50 hover:opacity-75": !e(M).includes("approved") }])
|
|
@@ -1036,12 +1036,12 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
1036
1036
|
class: re(["px-3 py-1.5 rounded-full text-sm bg-muted", { "opacity-50 hover:opacity-75": !e(M).includes("cancelled") }])
|
|
1037
1037
|
}, " Cancelled ", 2)
|
|
1038
1038
|
]),
|
|
1039
|
-
e(i) ? (v(), T("div", ta, " Showing " +
|
|
1039
|
+
e(i) ? (v(), T("div", ta, " Showing " + A(e($).length) + " of " + A(e(c).length) + " bookings ", 1)) : K("", !0),
|
|
1040
1040
|
e(n) ? (v(), T("div", aa, [...o[10] || (o[10] = [
|
|
1041
1041
|
l("div", { class: "animate-spin rounded-full h-8 w-8 border-b-2 border-primary" }, null, -1)
|
|
1042
|
-
])])) : e(
|
|
1042
|
+
])])) : e(Y).length === 0 ? (v(), T("div", sa, [
|
|
1043
1043
|
o[13] || (o[13] = Z(" No bookings for this day ", -1)),
|
|
1044
|
-
e(ne) ? (v(),
|
|
1044
|
+
e(ne) ? (v(), F(B, {
|
|
1045
1045
|
key: 0,
|
|
1046
1046
|
onClick: o[5] || (o[5] = (m) => M.value = ["needs_approval", "approved"])
|
|
1047
1047
|
}, {
|
|
@@ -1049,8 +1049,8 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
1049
1049
|
Z("Reset filters", -1)
|
|
1050
1050
|
])]),
|
|
1051
1051
|
_: 1
|
|
1052
|
-
})) :
|
|
1053
|
-
g.selectedResource !== null ? (v(),
|
|
1052
|
+
})) : K("", !0),
|
|
1053
|
+
g.selectedResource !== null ? (v(), F(B, {
|
|
1054
1054
|
key: 1,
|
|
1055
1055
|
onClick: o[6] || (o[6] = (m) => x("resetSelectedResource"))
|
|
1056
1056
|
}, {
|
|
@@ -1058,7 +1058,7 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
1058
1058
|
Z("Reset resource filter", -1)
|
|
1059
1059
|
])]),
|
|
1060
1060
|
_: 1
|
|
1061
|
-
})) :
|
|
1061
|
+
})) : K("", !0)
|
|
1062
1062
|
])) : e($).length === 0 ? (v(), T("div", oa, " No bookings match your search ")) : (v(), T("div", na, [
|
|
1063
1063
|
(v(!0), T(ie, null, he(e($), (m) => (v(), T("div", {
|
|
1064
1064
|
key: m.res_id || m.id,
|
|
@@ -1067,27 +1067,27 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
1067
1067
|
}, [
|
|
1068
1068
|
l("div", ia, [
|
|
1069
1069
|
l("div", la, [
|
|
1070
|
-
l("div",
|
|
1071
|
-
l("div",
|
|
1072
|
-
l("div", ua,
|
|
1070
|
+
l("div", da, A(m.customerInfo.firstName + " " + m.customerInfo.lastName || "Unknown Customer"), 1),
|
|
1071
|
+
l("div", ca, A(m.customerInfo?.email), 1),
|
|
1072
|
+
l("div", ua, A(m.customerInfo?.phone), 1),
|
|
1073
1073
|
l("div", ma, [
|
|
1074
1074
|
l("div", pa, [
|
|
1075
|
-
|
|
1076
|
-
l("span", null,
|
|
1075
|
+
d(e(ft), { size: 12 }),
|
|
1076
|
+
l("span", null, A(m.startTime) + " - " + A(m.endTime), 1)
|
|
1077
1077
|
]),
|
|
1078
1078
|
l("div", fa, [
|
|
1079
|
-
|
|
1080
|
-
l("span", null,
|
|
1079
|
+
d(e(Ve), { size: 12 }),
|
|
1080
|
+
l("span", null, A(m.spots) + " spots", 1)
|
|
1081
1081
|
]),
|
|
1082
1082
|
m.resourceName ? (v(), T("div", va, [
|
|
1083
1083
|
l("div", {
|
|
1084
1084
|
class: "w-3 h-3 rounded-full",
|
|
1085
1085
|
style: ve({ backgroundColor: m.resourceColor || "#6b7280" })
|
|
1086
1086
|
}, null, 4),
|
|
1087
|
-
l("span", null,
|
|
1088
|
-
])) :
|
|
1087
|
+
l("span", null, A(m.resourceName), 1)
|
|
1088
|
+
])) : K("", !0)
|
|
1089
1089
|
]),
|
|
1090
|
-
|
|
1090
|
+
d(_t, {
|
|
1091
1091
|
metadata: { ...m.metadata, ...m.reservationMetadata },
|
|
1092
1092
|
schema: e(I),
|
|
1093
1093
|
"display-filter": ["highlight", "badge"],
|
|
@@ -1097,7 +1097,7 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
1097
1097
|
]),
|
|
1098
1098
|
l("div", ga, [
|
|
1099
1099
|
m.reservationStatus === "needs_approval" ? (v(), T("span", ha, "Needs Approval")) : m.reservationStatus === "approved" ? (v(), T("span", xa, "Approved")) : m.reservationStatus === "rejected" ? (v(), T("span", ya, "Rejected")) : m.reservationStatus === "cancelled" ? (v(), T("span", ba, "Cancelled")) : (v(), T("span", ka, "Pending")),
|
|
1100
|
-
m.reservationPrice || m.reservationPrice === 0 ? (v(), T("div", _a, " €" +
|
|
1100
|
+
m.reservationPrice || m.reservationPrice === 0 ? (v(), T("div", _a, " €" + A(m.reservationPrice.toFixed(2)), 1)) : K("", !0)
|
|
1101
1101
|
])
|
|
1102
1102
|
])
|
|
1103
1103
|
], 8, ra))), 128))
|
|
@@ -1105,17 +1105,17 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
1105
1105
|
]),
|
|
1106
1106
|
_: 1
|
|
1107
1107
|
}),
|
|
1108
|
-
|
|
1108
|
+
d(Dt, {
|
|
1109
1109
|
ref_key: "reservationDetailDialog",
|
|
1110
1110
|
ref: s,
|
|
1111
1111
|
agendaData: g.agendaData,
|
|
1112
1112
|
"show-order-link": "",
|
|
1113
|
-
onCancelled:
|
|
1114
|
-
onConfirmed:
|
|
1115
|
-
onRejected:
|
|
1113
|
+
onCancelled: X,
|
|
1114
|
+
onConfirmed: X,
|
|
1115
|
+
onRejected: X,
|
|
1116
1116
|
onOpenOrder: o[7] || (o[7] = (m) => q(m))
|
|
1117
1117
|
}, null, 8, ["agendaData"]),
|
|
1118
|
-
|
|
1118
|
+
d(St, {
|
|
1119
1119
|
ref_key: "orderDetailDialog",
|
|
1120
1120
|
ref: u,
|
|
1121
1121
|
agendaData: g.agendaData,
|
|
@@ -1126,54 +1126,54 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
1126
1126
|
});
|
|
1127
1127
|
};
|
|
1128
1128
|
}
|
|
1129
|
-
}), Sa = { class: "space-y-6" }, wa = { class: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4" }, Ca = { class: "text-2xl font-semibold tracking-tight" }, $a = { class: "flex flex-col md:flex-row gap-2" }, Ma = { class: "grid gap-6 md:grid-cols-2 lg:grid-cols-3" }, Ra = { class: "md:col-span-2 lg:col-span-3" },
|
|
1129
|
+
}), Sa = { class: "space-y-6" }, wa = { class: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4" }, Ca = { class: "text-2xl font-semibold tracking-tight" }, $a = { class: "flex flex-col md:flex-row gap-2" }, Ma = { class: "grid gap-6 md:grid-cols-2 lg:grid-cols-3" }, Ra = { class: "md:col-span-2 lg:col-span-3" }, Fa = /* @__PURE__ */ ce({
|
|
1130
1130
|
__name: "index",
|
|
1131
1131
|
setup(g) {
|
|
1132
|
-
const { hasPermission: h } =
|
|
1132
|
+
const { hasPermission: h } = Ye(), { params: a, resolvePath: x } = _e(), { config: y } = De(), b = Se(y.project), _ = z(""), c = z(!0), n = z(/* @__PURE__ */ new Date()), i = z(null), s = z("stacked"), u = z(null), I = z([]);
|
|
1133
1133
|
return (async () => {
|
|
1134
1134
|
try {
|
|
1135
|
-
const
|
|
1136
|
-
_.value =
|
|
1137
|
-
} catch (
|
|
1138
|
-
console.error("Error loading data:",
|
|
1135
|
+
const E = await b.get(y.agendaCollection, a.value.id);
|
|
1136
|
+
_.value = E?.serviceName || "", u.value = E, I.value = E?.resources?.filter(($) => $.isActive) || [];
|
|
1137
|
+
} catch (E) {
|
|
1138
|
+
console.error("Error loading data:", E);
|
|
1139
1139
|
} finally {
|
|
1140
|
-
|
|
1140
|
+
c.value = !1;
|
|
1141
1141
|
}
|
|
1142
|
-
})(), (
|
|
1142
|
+
})(), (E, $) => (v(), F(Xe, null, {
|
|
1143
1143
|
default: k(() => [
|
|
1144
1144
|
l("div", Sa, [
|
|
1145
1145
|
l("div", wa, [
|
|
1146
1146
|
l("div", null, [
|
|
1147
|
-
l("h1", Ca,
|
|
1147
|
+
l("h1", Ca, A(e(_) || "Dashboard"), 1),
|
|
1148
1148
|
$[4] || ($[4] = l("p", { class: "text-muted-foreground text-sm mt-1" }, " Overview and analytics for your booking service ", -1))
|
|
1149
1149
|
]),
|
|
1150
1150
|
l("div", $a, [
|
|
1151
|
-
e(h)("manage-reservations") ? (v(),
|
|
1151
|
+
e(h)("manage-reservations") ? (v(), F(wt, {
|
|
1152
1152
|
key: 0,
|
|
1153
1153
|
"agenda-data": e(u)
|
|
1154
|
-
}, null, 8, ["agenda-data"])) :
|
|
1154
|
+
}, null, 8, ["agenda-data"])) : K("", !0)
|
|
1155
1155
|
])
|
|
1156
1156
|
]),
|
|
1157
|
-
|
|
1157
|
+
d(Qt, {
|
|
1158
1158
|
modelValue: e(n),
|
|
1159
|
-
"onUpdate:modelValue": $[0] || ($[0] = (
|
|
1159
|
+
"onUpdate:modelValue": $[0] || ($[0] = (Y) => se(n) ? n.value = Y : null),
|
|
1160
1160
|
"view-mode": e(s),
|
|
1161
|
-
"onUpdate:viewMode": $[1] || ($[1] = (
|
|
1161
|
+
"onUpdate:viewMode": $[1] || ($[1] = (Y) => se(s) ? s.value = Y : null),
|
|
1162
1162
|
"selected-resource": e(i),
|
|
1163
|
-
"onUpdate:selectedResource": $[2] || ($[2] = (
|
|
1163
|
+
"onUpdate:selectedResource": $[2] || ($[2] = (Y) => se(i) ? i.value = Y : null),
|
|
1164
1164
|
"agenda-data": e(u),
|
|
1165
1165
|
resources: e(I)
|
|
1166
1166
|
}, null, 8, ["modelValue", "view-mode", "selected-resource", "agenda-data", "resources"]),
|
|
1167
1167
|
l("div", Ma, [
|
|
1168
1168
|
l("div", Ra, [
|
|
1169
|
-
e(I).length > 0 ? (v(),
|
|
1169
|
+
e(I).length > 0 ? (v(), F(Da, {
|
|
1170
1170
|
key: 0,
|
|
1171
1171
|
"agenda-data": e(u),
|
|
1172
1172
|
"active-date": e(n),
|
|
1173
1173
|
"selected-resource": e(i),
|
|
1174
1174
|
resources: e(I),
|
|
1175
|
-
onResetSelectedResource: $[3] || ($[3] = (
|
|
1176
|
-
}, null, 8, ["agenda-data", "active-date", "selected-resource", "resources"])) :
|
|
1175
|
+
onResetSelectedResource: $[3] || ($[3] = (Y) => i.value = null)
|
|
1176
|
+
}, null, 8, ["agenda-data", "active-date", "selected-resource", "resources"])) : K("", !0)
|
|
1177
1177
|
])
|
|
1178
1178
|
])
|
|
1179
1179
|
])
|
|
@@ -1183,5 +1183,5 @@ const Vt = { "data-vis-component": "" }, Ee = /* @__PURE__ */ de({
|
|
|
1183
1183
|
}
|
|
1184
1184
|
});
|
|
1185
1185
|
export {
|
|
1186
|
-
|
|
1186
|
+
Fa as default
|
|
1187
1187
|
};
|