@oneclick.dev/cms-core-modules 0.0.53 → 0.0.55
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/CalendarDate-CRT2Viyt.mjs +830 -0
- package/dist/CalendarDate-CWtpXgpD.js +1 -0
- package/dist/Components-D9yIIosM.mjs +623 -0
- package/dist/Components-DXbx0RLV.js +1 -0
- package/dist/ContentEditor-BBdzuTJJ.js +290 -0
- package/dist/ContentEditor-HwHspQO1.mjs +35302 -0
- package/dist/Create-BP8TX6rj.js +1 -0
- package/dist/Create-Bwf1RXdG.mjs +1248 -0
- package/dist/DateFormatter-BbcSwTs4.js +1 -0
- package/dist/DateFormatter-CbO0PVUK.mjs +99 -0
- package/dist/Detail-B-PnkcXD.mjs +3473 -0
- package/dist/Detail-BVlGSjOq.mjs +380 -0
- package/dist/Detail-C4E1T87K.mjs +26 -0
- package/dist/Detail-CNfTDUE5.js +1 -0
- package/dist/Detail-Cd5CBVN0.js +1 -0
- package/dist/Detail-CpfOQChd.mjs +585 -0
- package/dist/Detail-CwagT6gQ.mjs +650 -0
- package/dist/Detail-DUo6qKqO.js +1 -0
- package/dist/Detail-Dd_OkpcN.js +1 -0
- package/dist/Detail-mvSGbnFU.js +1 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-BWuKVkvV.js +1 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs +55 -0
- package/dist/Entries-DcpPvlYj.js +1 -0
- package/dist/Entries-QLMtTYLX.mjs +713 -0
- package/dist/Find-BPR0uU-Z.mjs +229 -0
- package/dist/Find-BidEQJxT.js +1 -0
- package/dist/GlobalStyling-BLQ_1W2y.mjs +1588 -0
- package/dist/GlobalStyling-CnSlXkZc.js +25 -0
- package/dist/Overview-BDlBCUI_.js +1 -0
- package/dist/Overview-BH3NwvNX.mjs +26 -0
- package/dist/Overview-BLsZMHNW.mjs +178 -0
- package/dist/Overview-BNMZ9MUK.js +1 -0
- package/dist/Overview-BbvfH1u-.js +1 -0
- package/dist/Overview-CDN88OSM.mjs +190 -0
- package/dist/Overview-CEPodGCn.mjs +311 -0
- package/dist/Overview-CvquDPhB.js +1 -0
- package/dist/Overview-D54pjmI6.mjs +633 -0
- package/dist/Overview-D67UjG6n.mjs +947 -0
- package/dist/Overview-KT2Mgfh5.js +1 -0
- package/dist/Overview-T-lsy3UZ.js +1 -0
- package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-0xZSq0rx.js +1 -0
- package/dist/RegularSlotEditor.vue_vue_type_script_setup_true_lang-Bj_PVLLV.mjs +392 -0
- package/dist/TableView-CpO53xcX.js +111 -0
- package/dist/TableView-D9J5rUls.mjs +72921 -0
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-B_AtWnHa.js +1 -0
- package/dist/TemplateList.vue_vue_type_script_setup_true_lang-BiLAkhIA.mjs +40 -0
- package/dist/View-DlHBZbFu.js +1 -0
- package/dist/View-Dv5QMrSn.mjs +25 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.js +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.mjs +9 -0
- package/dist/agenda-B49oKGeh.mjs +706 -0
- package/dist/agenda-DipQ5IWP.js +1 -0
- package/dist/availability-C7q9tq6l.js +1 -0
- package/dist/availability-DeCkqiu8.mjs +613 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/countries-BTPvmrsb.mjs +4 -0
- package/dist/countries-CgZ081No.js +1 -0
- package/dist/exceptions-D3b18TiY.mjs +647 -0
- package/dist/exceptions-DJ9zWX3k.js +1 -0
- package/dist/floating-ui.dom-C82nbomj.js +1 -0
- package/dist/floating-ui.dom-ouSgPqty.mjs +1133 -0
- package/dist/google-CvtuJwgk.mjs +4 -0
- package/dist/google-D4N3gb01.js +1 -0
- package/dist/index--jjEzba7.mjs +24 -0
- package/dist/index-9HVlmvK3.js +1 -0
- package/dist/index-BEGU8Kme.mjs +12 -0
- package/dist/index-Bwi1mtkq.mjs +24 -0
- package/dist/index-BzuHN-r8.mjs +24 -0
- package/dist/index-CImCyE3L.mjs +24 -0
- package/dist/index-CKPshlZ8-BQiiP6r_.mjs +1264 -0
- package/dist/index-CKPshlZ8-CIz1tDwX.js +1 -0
- package/dist/index-CQiY-oTN.mjs +24 -0
- package/dist/index-CSxYBeVA.js +1 -0
- package/dist/index-CkiNvRzs.js +1 -0
- package/dist/index-Co4ON2Di.js +1 -0
- package/dist/index-CwqrAU-H.js +1 -0
- package/dist/index-Cz-baGax.js +1 -0
- package/dist/index-D2a6wEPh.js +1 -0
- package/dist/index-DFQGVHTs.js +1 -0
- package/dist/index-DI6mydpm.mjs +138 -0
- package/dist/index-DMoyoaks.mjs +22 -0
- package/dist/index-DT1wWnUk.mjs +24 -0
- package/dist/index-DUeFrD-B.js +1 -0
- package/dist/index-DsnoK4ia.mjs +579 -0
- package/dist/index-R2oUDsjx.js +1 -0
- package/dist/index-RLz1QPrf.mjs +203 -0
- package/dist/index-UtjLbLw-.js +1 -0
- package/dist/index-_mG-aU3Z.mjs +87 -0
- package/dist/index-_sQDF1pH.js +1 -0
- package/dist/index-ijdf0d9-.js +1 -0
- package/dist/index-klI238nT.mjs +24 -0
- package/dist/index.cjs.js +1 -330
- package/dist/index.mjs +287 -69051
- package/dist/interpolation-BNUjI7LH.js +1 -0
- package/dist/interpolation-BpGXqOz8.mjs +59 -0
- package/dist/payment-kTjsV0Jj.js +1 -0
- package/dist/payment-zpCM0LD-.mjs +981 -0
- package/dist/regular-C4_3YXqx.mjs +602 -0
- package/dist/regular-DFwPEbZO.js +1 -0
- package/dist/regular-slots-4ooEpICB.mjs +67 -0
- package/dist/regular-slots-BAVGbomI.js +1 -0
- package/dist/resources-MpQkSstv.mjs +563 -0
- package/dist/resources-iM28T3dD.js +1 -0
- package/dist/src/appointments/index.d.ts +4 -28
- package/dist/src/appointments/routes.d.ts +3 -9
- package/dist/src/content-manager/components/content-editor/ContentLayout.vue.d.ts +8 -0
- package/dist/src/content-manager/components/content-editor/NewSectionDialog.vue.d.ts +5 -1
- package/dist/src/content-manager/components/content-editor/tiptap-extensions/Card.d.ts +6 -0
- package/dist/src/content-manager/components/content-editor/tiptap-extensions/ScopedSelectAll.d.ts +7 -0
- package/dist/src/content-manager/components/content-editor/tiptap-menus/NewNodeView.vue.d.ts +16 -2
- package/dist/src/content-manager/components/content-editor/tiptap-menus/element-editor-views/CardMenu.vue.d.ts +13 -0
- package/dist/src/content-manager/components/content-editor/tiptap-menus/element-editor-views/index.d.ts +14 -0
- package/dist/src/content-manager/components/styling/ButtonStyleDialog.vue.d.ts +7 -7
- package/dist/src/content-manager/components/styling/CardStyleDialog.vue.d.ts +24 -0
- package/dist/src/content-manager/index.d.ts +5 -147
- package/dist/src/content-manager/pages/GlobalStyling.vue.d.ts +46 -8
- package/dist/src/content-manager/routes.d.ts +4 -128
- package/dist/src/custom/index.d.ts +2 -2
- package/dist/src/custom/routes.d.ts +1 -1
- package/dist/src/mail-templates/index.d.ts +2 -30
- package/dist/src/mail-templates/routes.d.ts +1 -11
- package/dist/src/product-collections/index.d.ts +2 -30
- package/dist/src/product-collections/routes.d.ts +1 -11
- package/dist/src/products/index.d.ts +2 -30
- package/dist/src/products/routes.d.ts +1 -11
- package/dist/src/promo-codes/index.d.ts +2 -30
- package/dist/src/promo-codes/routes.d.ts +1 -11
- package/dist/src/shipping-options/index.d.ts +2 -30
- package/dist/src/shipping-options/routes.d.ts +1 -11
- package/dist/src/table/index.d.ts +2 -70
- package/dist/src/table/routes.d.ts +1 -51
- package/dist/utils-BVKy9S2J.mjs +29 -0
- package/dist/utils-D6CaKJbp.js +2 -0
- package/dist/vee-validate-zod-BPQyEfpF.js +1 -0
- package/dist/vee-validate-zod-IXkfh-6Q.mjs +4402 -0
- package/package.json +4 -4
|
@@ -0,0 +1,647 @@
|
|
|
1
|
+
import { defineComponent as ne, ref as E, reactive as ce, computed as te, resolveComponent as i, createBlock as g, openBlock as l, withCtx as r, createVNode as n, createElementVNode as o, createTextVNode as u, toDisplayString as h, createElementBlock as a, createCommentVNode as v, unref as m, Fragment as D, normalizeClass as k, renderList as B, normalizeStyle as re } from "vue";
|
|
2
|
+
import { _ as me } from "./EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs";
|
|
3
|
+
import { n as U, g as b, u as N } from "./CalendarDate-CRT2Viyt.mjs";
|
|
4
|
+
import { $ as ae } from "./DateFormatter-CbO0PVUK.mjs";
|
|
5
|
+
import { Calendar as se, Users as le, BanIcon as de, Trash2 as ie, Plus as ue, CalendarPlus as pe } from "lucide-vue-next";
|
|
6
|
+
import { useModuleRoute as fe, useModule as ve, useFirebaseIntegration as ge } from "@oneclick.dev/cms-kit";
|
|
7
|
+
const xe = { class: "space-y-6 py-4" }, ye = { key: 0 }, _e = { class: "space-y-2" }, be = { class: "flex items-center justify-center w-8 h-8 rounded-full bg-muted" }, Ce = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "w-full h-full rounded-full bg-white scale-50"
|
|
10
|
+
}, ke = { class: "flex items-center justify-center w-8 h-8 rounded-full bg-muted" }, De = {
|
|
11
|
+
key: 0,
|
|
12
|
+
class: "w-full h-full rounded-full bg-white scale-50"
|
|
13
|
+
}, he = {
|
|
14
|
+
key: 0,
|
|
15
|
+
class: "pl-4 pt-2 space-y-1"
|
|
16
|
+
}, we = ["onClick"], Ee = { class: "min-w-0 flex-1" }, $e = { class: "text-sm font-medium truncate" }, Ie = {
|
|
17
|
+
key: 0,
|
|
18
|
+
class: "w-3 h-3 text-white",
|
|
19
|
+
fill: "none",
|
|
20
|
+
viewBox: "0 0 24 24",
|
|
21
|
+
stroke: "currentColor"
|
|
22
|
+
}, Se = {
|
|
23
|
+
key: 0,
|
|
24
|
+
class: "text-xs text-amber-600 mt-2"
|
|
25
|
+
}, Te = { class: "space-y-3" }, Ae = { class: "flex items-center justify-center w-10 h-10 rounded-full bg-destructive/10" }, Re = {
|
|
26
|
+
key: 0,
|
|
27
|
+
class: "w-full h-full rounded-full bg-white scale-50"
|
|
28
|
+
}, Ue = { class: "flex items-center justify-center w-10 h-10 rounded-full bg-primary/10" }, Ve = {
|
|
29
|
+
key: 0,
|
|
30
|
+
class: "w-full h-full rounded-full bg-white scale-50"
|
|
31
|
+
}, ze = { key: 1 }, je = {
|
|
32
|
+
key: 0,
|
|
33
|
+
class: "text-center py-6 text-muted-foreground text-sm"
|
|
34
|
+
}, Pe = {
|
|
35
|
+
key: 1,
|
|
36
|
+
class: "space-y-2 mb-3"
|
|
37
|
+
}, Be = { class: "w-full flex justify-between items-center" }, Ne = { class: "flex items-center gap-2 ml-auto" }, Fe = /* @__PURE__ */ ne({
|
|
38
|
+
__name: "ExceptionDialog",
|
|
39
|
+
props: {
|
|
40
|
+
resources: {}
|
|
41
|
+
},
|
|
42
|
+
emits: ["add-exception", "update-exception", "remove-exception"],
|
|
43
|
+
setup(oe, { expose: V, emit: F }) {
|
|
44
|
+
const I = new ae("en-US", {
|
|
45
|
+
dateStyle: "medium"
|
|
46
|
+
}), T = oe, x = F, y = E(!1), $ = E("add"), A = E(!1), c = E({
|
|
47
|
+
start: U(b()),
|
|
48
|
+
end: U(b())
|
|
49
|
+
}), t = ce({
|
|
50
|
+
id: "",
|
|
51
|
+
startDate: "",
|
|
52
|
+
endDate: "",
|
|
53
|
+
isClosed: !1,
|
|
54
|
+
timeslots: [],
|
|
55
|
+
resourceIds: null
|
|
56
|
+
// null = all resources
|
|
57
|
+
}), C = te({
|
|
58
|
+
get: () => t.resourceIds === null,
|
|
59
|
+
set: (s) => {
|
|
60
|
+
s ? t.resourceIds = null : t.resourceIds = [];
|
|
61
|
+
}
|
|
62
|
+
}), Y = (s) => {
|
|
63
|
+
if (t.resourceIds === null)
|
|
64
|
+
t.resourceIds = [s];
|
|
65
|
+
else {
|
|
66
|
+
const e = t.resourceIds.indexOf(s);
|
|
67
|
+
e === -1 ? t.resourceIds.push(s) : t.resourceIds.splice(e, 1);
|
|
68
|
+
}
|
|
69
|
+
}, L = te(() => !(!c.value.start || t.resourceIds !== null && t.resourceIds.length === 0)), q = (s) => {
|
|
70
|
+
$.value = s ? "edit" : "add", s ? (t.id = s.id, t.startDate = s.startDate, t.endDate = s.endDate, t.isClosed = s.isClosed, t.timeslots = JSON.parse(JSON.stringify(s.timeslots)), t.resourceIds = s.resourceIds ? [...s.resourceIds] : null, c.value = {
|
|
71
|
+
start: N(s.startDate),
|
|
72
|
+
end: N(s.endDate)
|
|
73
|
+
}) : (t.id = "", t.startDate = "", t.endDate = "", t.isClosed = !1, t.timeslots = [], t.resourceIds = null, c.value = {
|
|
74
|
+
start: U(b()),
|
|
75
|
+
end: U(b())
|
|
76
|
+
}), y.value = !0;
|
|
77
|
+
}, H = () => {
|
|
78
|
+
y.value = !1;
|
|
79
|
+
}, M = () => {
|
|
80
|
+
t.timeslots.push({
|
|
81
|
+
id: Date.now(),
|
|
82
|
+
startTime: "",
|
|
83
|
+
endTime: ""
|
|
84
|
+
});
|
|
85
|
+
}, G = (s) => {
|
|
86
|
+
t.timeslots = t.timeslots.filter((e) => e.id !== s);
|
|
87
|
+
}, z = () => {
|
|
88
|
+
if (!c.value.start) return;
|
|
89
|
+
const s = c.value.start.toString(), e = c.value.end?.toString() || s, p = {
|
|
90
|
+
id: Date.now().toString(),
|
|
91
|
+
startDate: s,
|
|
92
|
+
endDate: e,
|
|
93
|
+
isClosed: t.isClosed,
|
|
94
|
+
timeslots: t.isClosed ? [] : [...t.timeslots],
|
|
95
|
+
resourceIds: t.resourceIds
|
|
96
|
+
};
|
|
97
|
+
x("add-exception", p), y.value = !1;
|
|
98
|
+
}, j = () => {
|
|
99
|
+
const s = c.value.start.toString(), e = c.value.end?.toString() || s, p = {
|
|
100
|
+
id: t.id,
|
|
101
|
+
startDate: s,
|
|
102
|
+
endDate: e,
|
|
103
|
+
isClosed: t.isClosed,
|
|
104
|
+
timeslots: t.isClosed ? [] : [...t.timeslots],
|
|
105
|
+
resourceIds: t.resourceIds
|
|
106
|
+
};
|
|
107
|
+
x("update-exception", p), y.value = !1;
|
|
108
|
+
}, O = () => {
|
|
109
|
+
x("remove-exception", t.id), y.value = !1;
|
|
110
|
+
};
|
|
111
|
+
return V({
|
|
112
|
+
openDialog: q
|
|
113
|
+
}), (s, e) => {
|
|
114
|
+
const p = i("DialogTitle"), S = i("DialogHeader"), R = i("Label"), w = i("Button"), K = i("PopoverTrigger"), Q = i("RangeCalendar"), W = i("PopoverContent"), X = i("Popover"), J = i("Input"), Z = i("Card"), f = i("DialogFooter"), _ = i("DialogScrollContent"), ee = i("Dialog");
|
|
115
|
+
return l(), g(ee, {
|
|
116
|
+
open: y.value,
|
|
117
|
+
"onUpdate:open": e[6] || (e[6] = (d) => y.value = d)
|
|
118
|
+
}, {
|
|
119
|
+
default: r(() => [
|
|
120
|
+
n(_, { class: "sm:max-w-2xl" }, {
|
|
121
|
+
default: r(() => [
|
|
122
|
+
n(S, null, {
|
|
123
|
+
default: r(() => [
|
|
124
|
+
n(p, null, {
|
|
125
|
+
default: r(() => [
|
|
126
|
+
u(h($.value === "add" ? "Add Exception" : "Edit Exception"), 1)
|
|
127
|
+
]),
|
|
128
|
+
_: 1
|
|
129
|
+
})
|
|
130
|
+
]),
|
|
131
|
+
_: 1
|
|
132
|
+
}),
|
|
133
|
+
o("div", xe, [
|
|
134
|
+
o("div", null, [
|
|
135
|
+
n(R, { class: "text-sm font-normal mb-1.5" }, {
|
|
136
|
+
default: r(() => [...e[7] || (e[7] = [
|
|
137
|
+
u("Select Date or Date Range", -1)
|
|
138
|
+
])]),
|
|
139
|
+
_: 1
|
|
140
|
+
}),
|
|
141
|
+
n(X, {
|
|
142
|
+
open: A.value,
|
|
143
|
+
"onUpdate:open": e[1] || (e[1] = (d) => A.value = d)
|
|
144
|
+
}, {
|
|
145
|
+
default: r(() => [
|
|
146
|
+
n(K, { "as-child": "" }, {
|
|
147
|
+
default: r(() => [
|
|
148
|
+
n(w, {
|
|
149
|
+
variant: "outline",
|
|
150
|
+
class: "w-full justify-start text-left font-normal"
|
|
151
|
+
}, {
|
|
152
|
+
default: r(() => [
|
|
153
|
+
n(m(se), { class: "mr-2 h-4 w-4" }),
|
|
154
|
+
c.value.start ? (l(), a(D, { key: 0 }, [
|
|
155
|
+
c.value.end && c.value.start.toString() !== c.value.end.toString() ? (l(), a(D, { key: 0 }, [
|
|
156
|
+
u(h(m(I).format(c.value.start.toDate(m(b)()))) + " - " + h(m(I).format(c.value.end.toDate(m(b)()))), 1)
|
|
157
|
+
], 64)) : (l(), a(D, { key: 1 }, [
|
|
158
|
+
u(h(m(I).format(c.value.start.toDate(m(b)()))), 1)
|
|
159
|
+
], 64))
|
|
160
|
+
], 64)) : (l(), a(D, { key: 1 }, [
|
|
161
|
+
u(" Pick a date ")
|
|
162
|
+
], 64))
|
|
163
|
+
]),
|
|
164
|
+
_: 1
|
|
165
|
+
})
|
|
166
|
+
]),
|
|
167
|
+
_: 1
|
|
168
|
+
}),
|
|
169
|
+
n(W, { class: "w-auto p-0" }, {
|
|
170
|
+
default: r(() => [
|
|
171
|
+
n(Q, {
|
|
172
|
+
modelValue: c.value,
|
|
173
|
+
"onUpdate:modelValue": e[0] || (e[0] = (d) => c.value = d),
|
|
174
|
+
"initial-focus": "",
|
|
175
|
+
"number-of-months": 2,
|
|
176
|
+
"min-value": m(U)(m(b)())
|
|
177
|
+
}, null, 8, ["modelValue", "min-value"])
|
|
178
|
+
]),
|
|
179
|
+
_: 1
|
|
180
|
+
})
|
|
181
|
+
]),
|
|
182
|
+
_: 1
|
|
183
|
+
}, 8, ["open"])
|
|
184
|
+
]),
|
|
185
|
+
T.resources && T.resources.length > 0 ? (l(), a("div", ye, [
|
|
186
|
+
n(R, { class: "text-sm font-normal mb-1.5" }, {
|
|
187
|
+
default: r(() => [...e[8] || (e[8] = [
|
|
188
|
+
u("Apply To", -1)
|
|
189
|
+
])]),
|
|
190
|
+
_: 1
|
|
191
|
+
}),
|
|
192
|
+
o("div", _e, [
|
|
193
|
+
o("div", {
|
|
194
|
+
class: k(["flex items-center gap-3 p-3 border rounded-lg cursor-pointer hover:bg-accent transition-colors", C.value ? "bg-accent border-primary" : ""]),
|
|
195
|
+
onClick: e[2] || (e[2] = (d) => C.value = !0)
|
|
196
|
+
}, [
|
|
197
|
+
o("div", be, [
|
|
198
|
+
n(m(le), { class: "h-4 w-4 text-muted-foreground" })
|
|
199
|
+
]),
|
|
200
|
+
e[9] || (e[9] = o("div", { class: "flex-1" }, [
|
|
201
|
+
o("div", { class: "font-medium text-sm" }, "All Resources"),
|
|
202
|
+
o("div", { class: "text-xs text-muted-foreground" }, "Exception applies to all resources")
|
|
203
|
+
], -1)),
|
|
204
|
+
o("div", {
|
|
205
|
+
class: k(["w-4 h-4 rounded-full border-2", C.value ? "border-primary bg-primary" : "border-muted-foreground"])
|
|
206
|
+
}, [
|
|
207
|
+
C.value ? (l(), a("div", Ce)) : v("", !0)
|
|
208
|
+
], 2)
|
|
209
|
+
], 2),
|
|
210
|
+
o("div", {
|
|
211
|
+
class: k(["flex items-center gap-3 p-3 border rounded-lg cursor-pointer hover:bg-accent transition-colors", C.value ? "" : "bg-accent border-primary"]),
|
|
212
|
+
onClick: e[3] || (e[3] = (d) => C.value = !1)
|
|
213
|
+
}, [
|
|
214
|
+
o("div", ke, [
|
|
215
|
+
n(m(le), { class: "h-4 w-4 text-muted-foreground" })
|
|
216
|
+
]),
|
|
217
|
+
e[10] || (e[10] = o("div", { class: "flex-1" }, [
|
|
218
|
+
o("div", { class: "font-medium text-sm" }, "Specific Resources"),
|
|
219
|
+
o("div", { class: "text-xs text-muted-foreground" }, "Select which resources this exception applies to")
|
|
220
|
+
], -1)),
|
|
221
|
+
o("div", {
|
|
222
|
+
class: k(["w-4 h-4 rounded-full border-2", C.value ? "border-muted-foreground" : "border-primary bg-primary"])
|
|
223
|
+
}, [
|
|
224
|
+
C.value ? v("", !0) : (l(), a("div", De))
|
|
225
|
+
], 2)
|
|
226
|
+
], 2),
|
|
227
|
+
C.value ? v("", !0) : (l(), a("div", he, [
|
|
228
|
+
(l(!0), a(D, null, B(T.resources, (d) => (l(), a("div", {
|
|
229
|
+
key: d.id,
|
|
230
|
+
class: k(["flex items-center gap-2 p-2 rounded-md hover:bg-muted cursor-pointer transition-colors", {
|
|
231
|
+
"bg-muted": t.resourceIds?.includes(d.id),
|
|
232
|
+
"opacity-50": t.resourceIds && t.resourceIds.length > 0 && !t.resourceIds.includes(d.id)
|
|
233
|
+
}]),
|
|
234
|
+
onClick: (P) => Y(d.id)
|
|
235
|
+
}, [
|
|
236
|
+
o("div", {
|
|
237
|
+
class: "size-6 rounded-full flex items-center justify-center text-white text-xs font-medium flex-shrink-0",
|
|
238
|
+
style: re({ backgroundColor: d.color || "#6b7280" })
|
|
239
|
+
}, h(d.avatarLabel || d.name.charAt(0).toUpperCase()), 5),
|
|
240
|
+
o("div", Ee, [
|
|
241
|
+
o("div", $e, h(d.name), 1)
|
|
242
|
+
]),
|
|
243
|
+
o("div", {
|
|
244
|
+
class: k(["size-4 rounded border-2 flex items-center justify-center flex-shrink-0", t.resourceIds?.includes(d.id) ? "border-primary bg-primary" : "border-muted-foreground"])
|
|
245
|
+
}, [
|
|
246
|
+
t.resourceIds?.includes(d.id) ? (l(), a("svg", Ie, [...e[11] || (e[11] = [
|
|
247
|
+
o("path", {
|
|
248
|
+
"stroke-linecap": "round",
|
|
249
|
+
"stroke-linejoin": "round",
|
|
250
|
+
"stroke-width": "3",
|
|
251
|
+
d: "M5 13l4 4L19 7"
|
|
252
|
+
}, null, -1)
|
|
253
|
+
])])) : v("", !0)
|
|
254
|
+
], 2)
|
|
255
|
+
], 10, we))), 128)),
|
|
256
|
+
t.resourceIds?.length === 0 ? (l(), a("p", Se, " ⚠️ Please select at least one resource ")) : v("", !0)
|
|
257
|
+
]))
|
|
258
|
+
])
|
|
259
|
+
])) : v("", !0),
|
|
260
|
+
o("div", null, [
|
|
261
|
+
n(R, { class: "text-sm font-normal mb-1.5" }, {
|
|
262
|
+
default: r(() => [...e[12] || (e[12] = [
|
|
263
|
+
u("Exception Type", -1)
|
|
264
|
+
])]),
|
|
265
|
+
_: 1
|
|
266
|
+
}),
|
|
267
|
+
o("div", Te, [
|
|
268
|
+
o("div", {
|
|
269
|
+
class: k(["flex items-center gap-3 p-3 border rounded-lg cursor-pointer hover:bg-accent transition-colors", t.isClosed ? "bg-accent border-primary" : ""]),
|
|
270
|
+
onClick: e[4] || (e[4] = (d) => t.isClosed = !0)
|
|
271
|
+
}, [
|
|
272
|
+
o("div", Ae, [
|
|
273
|
+
n(m(de), { class: "h-5 w-5 text-destructive" })
|
|
274
|
+
]),
|
|
275
|
+
e[13] || (e[13] = o("div", { class: "flex-1" }, [
|
|
276
|
+
o("div", { class: "font-medium" }, "Closed"),
|
|
277
|
+
o("div", { class: "text-sm text-muted-foreground" }, "No appointments available during this period")
|
|
278
|
+
], -1)),
|
|
279
|
+
o("div", {
|
|
280
|
+
class: k(["w-4 h-4 rounded-full border-2", t.isClosed ? "border-primary bg-primary" : "border-muted-foreground"])
|
|
281
|
+
}, [
|
|
282
|
+
t.isClosed ? (l(), a("div", Re)) : v("", !0)
|
|
283
|
+
], 2)
|
|
284
|
+
], 2),
|
|
285
|
+
o("div", {
|
|
286
|
+
class: k(["flex items-center gap-3 p-3 border rounded-lg cursor-pointer hover:bg-accent transition-colors", t.isClosed ? "" : "bg-accent border-primary"]),
|
|
287
|
+
onClick: e[5] || (e[5] = (d) => t.isClosed = !1)
|
|
288
|
+
}, [
|
|
289
|
+
o("div", Ue, [
|
|
290
|
+
n(m(se), { class: "h-5 w-5 text-primary" })
|
|
291
|
+
]),
|
|
292
|
+
e[14] || (e[14] = o("div", { class: "flex-1" }, [
|
|
293
|
+
o("div", { class: "font-medium" }, "Custom Hours"),
|
|
294
|
+
o("div", { class: "text-sm text-muted-foreground" }, "Set specific time slots for this period")
|
|
295
|
+
], -1)),
|
|
296
|
+
o("div", {
|
|
297
|
+
class: k(["w-4 h-4 rounded-full border-2", t.isClosed ? "border-muted-foreground" : "border-primary bg-primary"])
|
|
298
|
+
}, [
|
|
299
|
+
t.isClosed ? v("", !0) : (l(), a("div", Ve))
|
|
300
|
+
], 2)
|
|
301
|
+
], 2)
|
|
302
|
+
])
|
|
303
|
+
]),
|
|
304
|
+
t.isClosed ? v("", !0) : (l(), a("div", ze, [
|
|
305
|
+
n(R, { class: "text-sm font-normal mb-1.5" }, {
|
|
306
|
+
default: r(() => [...e[15] || (e[15] = [
|
|
307
|
+
u("Time Slots", -1)
|
|
308
|
+
])]),
|
|
309
|
+
_: 1
|
|
310
|
+
}),
|
|
311
|
+
n(Z, { class: "p-4" }, {
|
|
312
|
+
default: r(() => [
|
|
313
|
+
t.timeslots.length === 0 ? (l(), a("div", je, ' No time slots added. Click "Add Time Slot" to create one. ')) : (l(), a("div", Pe, [
|
|
314
|
+
(l(!0), a(D, null, B(t.timeslots, (d) => (l(), a("div", {
|
|
315
|
+
key: d.id,
|
|
316
|
+
class: "flex items-center gap-2"
|
|
317
|
+
}, [
|
|
318
|
+
n(J, {
|
|
319
|
+
class: "w-32",
|
|
320
|
+
modelValue: d.startTime,
|
|
321
|
+
"onUpdate:modelValue": (P) => d.startTime = P,
|
|
322
|
+
type: "time"
|
|
323
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
324
|
+
e[16] || (e[16] = o("span", { class: "text-muted-foreground" }, "to", -1)),
|
|
325
|
+
n(J, {
|
|
326
|
+
class: "w-32",
|
|
327
|
+
modelValue: d.endTime,
|
|
328
|
+
"onUpdate:modelValue": (P) => d.endTime = P,
|
|
329
|
+
type: "time"
|
|
330
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
331
|
+
n(w, {
|
|
332
|
+
variant: "ghost",
|
|
333
|
+
size: "icon",
|
|
334
|
+
onClick: (P) => G(d.id)
|
|
335
|
+
}, {
|
|
336
|
+
default: r(() => [
|
|
337
|
+
n(m(ie), { class: "size-4" })
|
|
338
|
+
]),
|
|
339
|
+
_: 1
|
|
340
|
+
}, 8, ["onClick"])
|
|
341
|
+
]))), 128))
|
|
342
|
+
])),
|
|
343
|
+
n(w, {
|
|
344
|
+
onClick: M,
|
|
345
|
+
variant: "outline",
|
|
346
|
+
size: "sm",
|
|
347
|
+
class: "w-full"
|
|
348
|
+
}, {
|
|
349
|
+
default: r(() => [
|
|
350
|
+
n(m(ue), { class: "size-4 mr-1" }),
|
|
351
|
+
e[17] || (e[17] = u(" Add Time Slot ", -1))
|
|
352
|
+
]),
|
|
353
|
+
_: 1
|
|
354
|
+
})
|
|
355
|
+
]),
|
|
356
|
+
_: 1
|
|
357
|
+
})
|
|
358
|
+
]))
|
|
359
|
+
]),
|
|
360
|
+
n(f, { class: "gap-2" }, {
|
|
361
|
+
default: r(() => [
|
|
362
|
+
o("div", Be, [
|
|
363
|
+
$.value === "edit" ? (l(), g(w, {
|
|
364
|
+
key: 0,
|
|
365
|
+
variant: "destructive",
|
|
366
|
+
onClick: O
|
|
367
|
+
}, {
|
|
368
|
+
default: r(() => [...e[18] || (e[18] = [
|
|
369
|
+
u(" Remove Exception ", -1)
|
|
370
|
+
])]),
|
|
371
|
+
_: 1
|
|
372
|
+
})) : v("", !0),
|
|
373
|
+
o("div", Ne, [
|
|
374
|
+
n(w, {
|
|
375
|
+
variant: "outline",
|
|
376
|
+
onClick: H
|
|
377
|
+
}, {
|
|
378
|
+
default: r(() => [...e[19] || (e[19] = [
|
|
379
|
+
u(" Cancel ", -1)
|
|
380
|
+
])]),
|
|
381
|
+
_: 1
|
|
382
|
+
}),
|
|
383
|
+
$.value === "add" ? (l(), g(w, {
|
|
384
|
+
key: 0,
|
|
385
|
+
onClick: z,
|
|
386
|
+
disabled: !L.value
|
|
387
|
+
}, {
|
|
388
|
+
default: r(() => [...e[20] || (e[20] = [
|
|
389
|
+
u(" Add Exception ", -1)
|
|
390
|
+
])]),
|
|
391
|
+
_: 1
|
|
392
|
+
}, 8, ["disabled"])) : (l(), g(w, {
|
|
393
|
+
key: 1,
|
|
394
|
+
onClick: j,
|
|
395
|
+
disabled: !L.value
|
|
396
|
+
}, {
|
|
397
|
+
default: r(() => [...e[21] || (e[21] = [
|
|
398
|
+
u(" Update Exception ", -1)
|
|
399
|
+
])]),
|
|
400
|
+
_: 1
|
|
401
|
+
}, 8, ["disabled"]))
|
|
402
|
+
])
|
|
403
|
+
])
|
|
404
|
+
]),
|
|
405
|
+
_: 1
|
|
406
|
+
})
|
|
407
|
+
]),
|
|
408
|
+
_: 1
|
|
409
|
+
})
|
|
410
|
+
]),
|
|
411
|
+
_: 1
|
|
412
|
+
}, 8, ["open"]);
|
|
413
|
+
};
|
|
414
|
+
}
|
|
415
|
+
}), Le = { class: "max-w-4xl space-y-6" }, He = {
|
|
416
|
+
key: 0,
|
|
417
|
+
class: "flex"
|
|
418
|
+
}, Me = { key: 1 }, Oe = { class: "space-y-3" }, Je = { class: "flex items-start justify-between" }, Ye = { class: "flex-1" }, qe = { class: "flex items-center gap-2 mb-1" }, Ge = { class: "font-medium" }, Ke = {
|
|
419
|
+
key: 0,
|
|
420
|
+
class: "flex items-center gap-1.5 ml-6 mb-2"
|
|
421
|
+
}, Qe = ["title"], We = { class: "text-sm text-muted-foreground ml-6" }, Xe = {
|
|
422
|
+
key: 0,
|
|
423
|
+
class: "text-amber-600"
|
|
424
|
+
}, Ze = {
|
|
425
|
+
key: 1,
|
|
426
|
+
class: "space-y-1"
|
|
427
|
+
}, et = { class: "flex flex-wrap gap-2" }, tt = { class: "flex gap-1" }, st = {
|
|
428
|
+
key: 4,
|
|
429
|
+
class: "flex justify-end pt-4 border-t"
|
|
430
|
+
}, it = /* @__PURE__ */ ne({
|
|
431
|
+
__name: "exceptions",
|
|
432
|
+
setup(oe) {
|
|
433
|
+
const V = new ae("en-US", {
|
|
434
|
+
dateStyle: "medium"
|
|
435
|
+
}), { params: F } = fe(), { config: I } = ve(), T = ge(I.project), x = E([]), y = E([]), $ = E(!1), A = E(!0), c = E(), t = (s) => !s.resourceIds || s.resourceIds.length === 0 ? null : y.value.filter((e) => s.resourceIds?.includes(e.id)), C = async () => {
|
|
436
|
+
try {
|
|
437
|
+
A.value = !0;
|
|
438
|
+
const s = await T.get(I.agendaCollection, F.value.id);
|
|
439
|
+
x.value = s.exceptions || [], y.value = (s.resources || []).filter((e) => e.isActive);
|
|
440
|
+
} catch (s) {
|
|
441
|
+
console.error("Error loading exceptions:", s);
|
|
442
|
+
} finally {
|
|
443
|
+
A.value = !1;
|
|
444
|
+
}
|
|
445
|
+
}, Y = (s, e) => {
|
|
446
|
+
const p = N(s), S = N(e);
|
|
447
|
+
return s === e ? V.format(p.toDate(b())) : `${V.format(p.toDate(b()))} - ${V.format(S.toDate(b()))}`;
|
|
448
|
+
}, L = (s) => {
|
|
449
|
+
x.value.push(s), z();
|
|
450
|
+
}, q = (s) => {
|
|
451
|
+
const e = x.value.findIndex((p) => p.id === s.id);
|
|
452
|
+
e !== -1 && (x.value[e] = s), z();
|
|
453
|
+
}, H = (s) => {
|
|
454
|
+
x.value = x.value.filter((e) => e.id !== s), z();
|
|
455
|
+
}, M = () => {
|
|
456
|
+
c.value?.openDialog();
|
|
457
|
+
}, G = (s) => {
|
|
458
|
+
c.value?.openDialog(s);
|
|
459
|
+
}, z = async () => {
|
|
460
|
+
$.value = !0, await T.update(I.agendaCollection, F.value.id, {
|
|
461
|
+
exceptions: x.value
|
|
462
|
+
}), $.value = !1;
|
|
463
|
+
}, j = te(() => [...x.value].sort((s, e) => s.startDate.localeCompare(e.startDate))), O = (s) => {
|
|
464
|
+
const e = N(s), p = U(b());
|
|
465
|
+
return e.compare(p) < 0;
|
|
466
|
+
};
|
|
467
|
+
return C(), (s, e) => {
|
|
468
|
+
const p = i("Button"), S = i("Badge"), R = i("Card"), w = i("Spinner"), K = i("EmptyMedia"), Q = i("EmptyTitle"), W = i("EmptyDescription"), X = i("EmptyHeader"), J = i("EmptyContent"), Z = i("Empty");
|
|
469
|
+
return l(), g(me, null, {
|
|
470
|
+
default: r(() => [
|
|
471
|
+
e[10] || (e[10] = o("h1", { class: "text-lg font-medium mb-2" }, "Exception Management", -1)),
|
|
472
|
+
e[11] || (e[11] = o("p", { class: "mb-6 text-muted-foreground text-sm" }, " Create exceptions to override your regular schedule. You can close specific dates or set custom hours for special occasions. ", -1)),
|
|
473
|
+
o("div", Le, [
|
|
474
|
+
j.value.length > 0 ? (l(), a("div", He, [
|
|
475
|
+
n(p, { onClick: M }, {
|
|
476
|
+
default: r(() => [
|
|
477
|
+
n(m(ue), { class: "size-4 mr-1" }),
|
|
478
|
+
e[0] || (e[0] = u(" Add Exception ", -1))
|
|
479
|
+
]),
|
|
480
|
+
_: 1
|
|
481
|
+
})
|
|
482
|
+
])) : v("", !0),
|
|
483
|
+
j.value.length > 0 ? (l(), a("div", Me, [
|
|
484
|
+
e[5] || (e[5] = o("h2", { class: "text-base font-medium mb-3" }, "Active Exceptions", -1)),
|
|
485
|
+
o("div", Oe, [
|
|
486
|
+
(l(!0), a(D, null, B(j.value, (f) => (l(), g(R, {
|
|
487
|
+
key: f.id,
|
|
488
|
+
class: k(["p-4", O(f.endDate) ? "opacity-60" : ""])
|
|
489
|
+
}, {
|
|
490
|
+
default: r(() => [
|
|
491
|
+
o("div", Je, [
|
|
492
|
+
o("div", Ye, [
|
|
493
|
+
o("div", qe, [
|
|
494
|
+
f.isClosed ? (l(), g(m(de), {
|
|
495
|
+
key: 0,
|
|
496
|
+
class: "h-4 w-4 text-destructive"
|
|
497
|
+
})) : (l(), g(m(se), {
|
|
498
|
+
key: 1,
|
|
499
|
+
class: "h-4 w-4 text-primary"
|
|
500
|
+
})),
|
|
501
|
+
o("h3", Ge, h(Y(f.startDate, f.endDate)), 1),
|
|
502
|
+
O(f.endDate) ? (l(), g(S, {
|
|
503
|
+
key: 2,
|
|
504
|
+
variant: "secondary",
|
|
505
|
+
class: "text-xs"
|
|
506
|
+
}, {
|
|
507
|
+
default: r(() => [...e[1] || (e[1] = [
|
|
508
|
+
u(" Past ", -1)
|
|
509
|
+
])]),
|
|
510
|
+
_: 1
|
|
511
|
+
})) : v("", !0)
|
|
512
|
+
]),
|
|
513
|
+
y.value.length > 0 ? (l(), a("div", Ke, [
|
|
514
|
+
t(f) ? (l(!0), a(D, { key: 0 }, B(t(f), (_) => (l(), a("div", {
|
|
515
|
+
key: _.id,
|
|
516
|
+
class: "size-5 rounded-full flex items-center justify-center text-white text-[10px] font-medium",
|
|
517
|
+
style: re({ backgroundColor: _.color || "#6b7280" }),
|
|
518
|
+
title: _.name
|
|
519
|
+
}, h(_.avatarLabel || _.name.charAt(0).toUpperCase()), 13, Qe))), 128)) : (l(), g(S, {
|
|
520
|
+
key: 1,
|
|
521
|
+
variant: "outline",
|
|
522
|
+
class: "text-xs"
|
|
523
|
+
}, {
|
|
524
|
+
default: r(() => [...e[2] || (e[2] = [
|
|
525
|
+
u(" All Resources ", -1)
|
|
526
|
+
])]),
|
|
527
|
+
_: 1
|
|
528
|
+
}))
|
|
529
|
+
])) : v("", !0),
|
|
530
|
+
o("div", We, [
|
|
531
|
+
f.isClosed ? (l(), a(D, { key: 0 }, [
|
|
532
|
+
u(" Closed - No appointments available ")
|
|
533
|
+
], 64)) : (l(), a(D, { key: 1 }, [
|
|
534
|
+
f.timeslots.length === 0 ? (l(), a("div", Xe, " ⚠️ No time slots defined ")) : (l(), a("div", Ze, [
|
|
535
|
+
e[3] || (e[3] = o("div", { class: "font-medium text-foreground" }, "Custom Hours:", -1)),
|
|
536
|
+
o("div", et, [
|
|
537
|
+
(l(!0), a(D, null, B(f.timeslots, (_, ee) => (l(), g(S, {
|
|
538
|
+
key: ee,
|
|
539
|
+
variant: "outline",
|
|
540
|
+
class: "font-mono text-xs"
|
|
541
|
+
}, {
|
|
542
|
+
default: r(() => [
|
|
543
|
+
u(h(_.startTime) + " - " + h(_.endTime), 1)
|
|
544
|
+
]),
|
|
545
|
+
_: 2
|
|
546
|
+
}, 1024))), 128))
|
|
547
|
+
])
|
|
548
|
+
]))
|
|
549
|
+
], 64))
|
|
550
|
+
])
|
|
551
|
+
]),
|
|
552
|
+
o("div", tt, [
|
|
553
|
+
n(p, {
|
|
554
|
+
variant: "ghost",
|
|
555
|
+
onClick: (_) => G(f)
|
|
556
|
+
}, {
|
|
557
|
+
default: r(() => [...e[4] || (e[4] = [
|
|
558
|
+
u(" Edit ", -1)
|
|
559
|
+
])]),
|
|
560
|
+
_: 1
|
|
561
|
+
}, 8, ["onClick"]),
|
|
562
|
+
n(p, {
|
|
563
|
+
variant: "ghost",
|
|
564
|
+
size: "icon",
|
|
565
|
+
onClick: (_) => H(f.id)
|
|
566
|
+
}, {
|
|
567
|
+
default: r(() => [
|
|
568
|
+
n(m(ie), { class: "size-4 text-destructive" })
|
|
569
|
+
]),
|
|
570
|
+
_: 1
|
|
571
|
+
}, 8, ["onClick"])
|
|
572
|
+
])
|
|
573
|
+
])
|
|
574
|
+
]),
|
|
575
|
+
_: 2
|
|
576
|
+
}, 1032, ["class"]))), 128))
|
|
577
|
+
])
|
|
578
|
+
])) : A.value ? (l(), g(w, {
|
|
579
|
+
key: 2,
|
|
580
|
+
class: "my-8 size-8"
|
|
581
|
+
})) : (l(), g(Z, {
|
|
582
|
+
key: 3,
|
|
583
|
+
class: "border border-dashed"
|
|
584
|
+
}, {
|
|
585
|
+
default: r(() => [
|
|
586
|
+
n(X, null, {
|
|
587
|
+
default: r(() => [
|
|
588
|
+
n(K, { variant: "icon" }, {
|
|
589
|
+
default: r(() => [
|
|
590
|
+
n(m(pe))
|
|
591
|
+
]),
|
|
592
|
+
_: 1
|
|
593
|
+
}),
|
|
594
|
+
n(Q, null, {
|
|
595
|
+
default: r(() => [...e[6] || (e[6] = [
|
|
596
|
+
u("No Exceptions Created", -1)
|
|
597
|
+
])]),
|
|
598
|
+
_: 1
|
|
599
|
+
}),
|
|
600
|
+
n(W, null, {
|
|
601
|
+
default: r(() => [...e[7] || (e[7] = [
|
|
602
|
+
u(' Your agenda runs smoothly without any exceptions. Click "Add Exception" to create one. ', -1)
|
|
603
|
+
])]),
|
|
604
|
+
_: 1
|
|
605
|
+
})
|
|
606
|
+
]),
|
|
607
|
+
_: 1
|
|
608
|
+
}),
|
|
609
|
+
n(J, null, {
|
|
610
|
+
default: r(() => [
|
|
611
|
+
n(p, {
|
|
612
|
+
variant: "outline",
|
|
613
|
+
size: "sm",
|
|
614
|
+
onClick: M
|
|
615
|
+
}, {
|
|
616
|
+
default: r(() => [...e[8] || (e[8] = [
|
|
617
|
+
u(" Add Exception ", -1)
|
|
618
|
+
])]),
|
|
619
|
+
_: 1
|
|
620
|
+
})
|
|
621
|
+
]),
|
|
622
|
+
_: 1
|
|
623
|
+
})
|
|
624
|
+
]),
|
|
625
|
+
_: 1
|
|
626
|
+
})),
|
|
627
|
+
$.value ? (l(), a("div", st, [...e[9] || (e[9] = [
|
|
628
|
+
o("span", null, "Saving...", -1)
|
|
629
|
+
])])) : v("", !0)
|
|
630
|
+
]),
|
|
631
|
+
n(Fe, {
|
|
632
|
+
ref_key: "exceptionDialogRef",
|
|
633
|
+
ref: c,
|
|
634
|
+
resources: y.value,
|
|
635
|
+
onAddException: L,
|
|
636
|
+
onUpdateException: q,
|
|
637
|
+
onRemoveException: H
|
|
638
|
+
}, null, 8, ["resources"])
|
|
639
|
+
]),
|
|
640
|
+
_: 1
|
|
641
|
+
});
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
export {
|
|
646
|
+
it as default
|
|
647
|
+
};
|