@oneclick.dev/cms-core-modules 0.0.115 → 0.0.116
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/{ContentEditor-MctMvN7D.js → ContentEditor-CsbOFg3a.js} +52 -52
- package/dist/{ContentEditor-C5yNNLeV.mjs → ContentEditor-Df5uWpVC.mjs} +10337 -8677
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-gozJKXvM.js +1 -0
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-pDO9b4Pv.mjs +77 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-BHeMJ6nr.mjs +1476 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-C2zwt5UF.js +1 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-BYSeUW_V.js +925 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-DwAUYR8p.mjs +5021 -0
- package/dist/Overview-CBahJviK.js +1 -0
- package/dist/Overview-CVQ1pkuD.mjs +527 -0
- package/dist/TableView-Csv5Lycy.mjs +6234 -0
- package/dist/TableView-Cwal0BPW.js +4 -0
- package/dist/agenda-BSdlrfxv.mjs +1253 -0
- package/dist/agenda-Bev1mO7E.js +1 -0
- package/dist/availability-ClBGVgE9.js +1 -0
- package/dist/availability-D8JdA4rP.mjs +274 -0
- package/dist/booking-data-Px7XCIfU.mjs +1024 -0
- package/dist/booking-data-aMS1p_3g.js +1 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/exceptions-CqityDo9.mjs +651 -0
- package/dist/exceptions-DXqc0Nza.js +1 -0
- package/dist/index-CM4eaK5T.mjs +1245 -0
- package/dist/index-DliTZzwI.js +35 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +12 -11
- package/dist/orders-1swJVKw2.js +1 -0
- package/dist/orders-D41GbzIa.mjs +624 -0
- package/dist/payment-BJHgpaeT.js +1 -0
- package/dist/payment-D5j-68Ig.mjs +1278 -0
- package/dist/refunds-D9nTeD2d.mjs +436 -0
- package/dist/refunds-oVB2Opib.js +1 -0
- package/dist/resources-8WouFvJe.js +1 -0
- package/dist/resources-B-D5MUhV.mjs +975 -0
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +626 -515
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +146 -5
- package/dist/src/appointments/components/edit/EventDialog/CancelRefundReservationDialog.vue.d.ts +33 -0
- package/dist/src/appointments/components/edit/EventDialog/OrderDetailDialog.vue.d.ts +26 -8
- package/dist/src/appointments/components/edit/EventDialog/RefundDetailsDisplay.vue.d.ts +8 -0
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +91 -5
- package/dist/src/appointments/components/edit/EventDialog/TransferReservationDialog.vue.d.ts +20 -3
- package/dist/src/appointments/components/edit/NewReservationDialog/ReservationLines.vue.d.ts +5 -0
- package/dist/src/appointments/components/edit/OrderMetadataDisplay.vue.d.ts +20 -2
- package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +240 -0
- package/dist/src/appointments/composables/useAgendaMetadataSchema.d.ts +37 -0
- package/dist/src/appointments/pages/edit/orders.vue.d.ts +225 -0
- package/dist/src/appointments/pages/edit/refunds.vue.d.ts +2 -0
- package/dist/src/appointments/server.d.ts +2 -0
- package/dist/src/appointments/types.d.ts +6 -0
- package/dist/src/appointments/utils/printReservation.d.ts +65 -3
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/table/Table.d.ts +36 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/table/Table.vue.d.ts +95 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/table/TableCell.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/table/TableHeader.d.ts +6 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/table/TableRow.d.ts +6 -0
- package/dist/src/contentManager/components/content-editor/tiptap-extensions/table/index.d.ts +4 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/TableMenu.vue.d.ts +13 -0
- package/dist/src/contentManager/components/content-editor/tiptap-menus/element-editor-views/index.d.ts +14 -0
- package/package.json +2 -2
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-DWMqQvHl.mjs +0 -76
- package/dist/EditLayout.vue_vue_type_script_setup_true_lang-kpjbVSXg.js +0 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Baqy-rTT.js +0 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Dx4Bpa2m.mjs +0 -1263
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-COrK1j0S.js +0 -1
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-Vb3q8EVv.mjs +0 -330
- package/dist/Overview-98nkJUWN.mjs +0 -481
- package/dist/Overview-Dl8cMlsr.js +0 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CuwREvXD.js +0 -349
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-GYNZ_yhD.mjs +0 -3077
- package/dist/TableView-CVfkyj1k.js +0 -4
- package/dist/TableView-zDx0IegJ.mjs +0 -6096
- package/dist/agenda-BaJu3-1c.js +0 -1
- package/dist/agenda-BwVY_8oM.mjs +0 -1165
- package/dist/availability-CMrRa5y2.mjs +0 -269
- package/dist/availability-Cf2YfMwM.js +0 -1
- package/dist/booking-data-DgJd0BcM.mjs +0 -889
- package/dist/booking-data-Di5GmH_8.js +0 -1
- package/dist/exceptions-B6P9UiCj.js +0 -1
- package/dist/exceptions-De9-FvdP.mjs +0 -646
- package/dist/index-DL6orwdK.js +0 -35
- package/dist/index-hH3e-IYz.mjs +0 -1187
- package/dist/orders-C65SlpJy.mjs +0 -618
- package/dist/orders-XVzWAgG1.js +0 -1
- package/dist/payment-C3ohkehF.mjs +0 -1080
- package/dist/payment-Dfr-Ro-a.js +0 -1
- package/dist/resources-CxeFd57z.js +0 -1
- package/dist/resources-DwYxn2Vi.mjs +0 -811
|
@@ -0,0 +1,975 @@
|
|
|
1
|
+
import { defineComponent as xe, ref as D, reactive as Me, computed as P, resolveComponent as i, openBlock as c, createBlock as L, withCtx as l, createVNode as e, createTextVNode as d, toDisplayString as g, createElementVNode as s, createElementBlock as v, Fragment as U, renderList as J, normalizeStyle as Z, normalizeClass as fe, unref as b, createCommentVNode as k, withModifiers as ve } from "vue";
|
|
2
|
+
import { _ as $e } from "./EditLayout.vue_vue_type_script_setup_true_lang-pDO9b4Pv.mjs";
|
|
3
|
+
import { Clock as Le, MoreHorizontal as Te, Trash2 as _e, ListOrdered as Ie, Plus as ge, Pencil as Ee, Copy as Ue, Users as be, CircleAlert as Ne, GripVertical as He, ArrowUp as Fe, ArrowDown as je } from "lucide-vue-next";
|
|
4
|
+
import { useModuleRoute as Oe, useModulePermissions as Be, useConfirmation as Ye, useModule as Pe, useFirebaseIntegration as Je } from "@oneclick.dev/cms-kit";
|
|
5
|
+
import { a as qe } from "./index-CFzn2Lus.mjs";
|
|
6
|
+
const We = { class: "text-xs opacity-50" }, Ge = { class: "space-y-5 py-4" }, Qe = { class: "flex flex-wrap gap-2 mt-2" }, Ke = ["onClick"], Xe = { class: "space-y-2" }, Ze = { class: "flex items-center justify-between mb-2" }, et = { class: "text-sm font-medium" }, tt = { class: "flex items-center gap-1" }, ot = { class: "space-y-2" }, st = {
|
|
7
|
+
key: 0,
|
|
8
|
+
class: "text-sm text-muted-foreground italic py-1"
|
|
9
|
+
}, lt = { class: "flex items-center justify-between rounded-lg border p-4" }, nt = { class: "space-y-0.5" }, at = { class: "text-xs text-muted-foreground" }, it = { class: "w-full flex justify-between items-center gap-4 flex-col @sm/dialog-footer:flex-row" }, rt = { class: "flex items-center gap-2 ml-auto w-full @sm/dialog-footer:w-auto flex-col-reverse @sm/dialog-footer:flex-row" }, dt = /* @__PURE__ */ xe({
|
|
10
|
+
__name: "ResourceEditorDialog",
|
|
11
|
+
emits: ["add-resource", "update-resource", "remove-resource"],
|
|
12
|
+
setup(we, { expose: ee, emit: q }) {
|
|
13
|
+
const N = q, C = D(!1), h = D("add"), W = ["#ef4444", "#f97316", "#f59e0b", "#eab308", "#84cc16", "#22c55e", "#10b981", "#14b8a6", "#06b6d4", "#0ea5e9", "#3b82f6", "#6366f1", "#8b5cf6", "#a855f7", "#d946ef", "#ec4899", "#f43f5e"], m = [
|
|
14
|
+
{ value: 1, label: "Monday" },
|
|
15
|
+
{ value: 2, label: "Tuesday" },
|
|
16
|
+
{ value: 3, label: "Wednesday" },
|
|
17
|
+
{ value: 4, label: "Thursday" },
|
|
18
|
+
{ value: 5, label: "Friday" },
|
|
19
|
+
{ value: 6, label: "Saturday" },
|
|
20
|
+
{ value: 0, label: "Sunday" }
|
|
21
|
+
], a = Me({
|
|
22
|
+
id: "",
|
|
23
|
+
name: "",
|
|
24
|
+
publicLabel: "",
|
|
25
|
+
avatarLabel: "",
|
|
26
|
+
description: "",
|
|
27
|
+
capacity: 1,
|
|
28
|
+
interval: 30,
|
|
29
|
+
openingHours: {
|
|
30
|
+
0: [],
|
|
31
|
+
// Sunday
|
|
32
|
+
1: [{ start: "09:00", end: "17:00" }],
|
|
33
|
+
// Monday
|
|
34
|
+
2: [{ start: "09:00", end: "17:00" }],
|
|
35
|
+
// Tuesday
|
|
36
|
+
3: [{ start: "09:00", end: "17:00" }],
|
|
37
|
+
// Wednesday
|
|
38
|
+
4: [{ start: "09:00", end: "17:00" }],
|
|
39
|
+
// Thursday
|
|
40
|
+
5: [{ start: "09:00", end: "17:00" }],
|
|
41
|
+
// Friday
|
|
42
|
+
6: []
|
|
43
|
+
// Saturday
|
|
44
|
+
},
|
|
45
|
+
color: "blue",
|
|
46
|
+
isActive: !0
|
|
47
|
+
}), H = (p) => {
|
|
48
|
+
h.value = p ? "edit" : "add", a.id = p?.id || "", a.name = p?.name || "", a.publicLabel = p?.publicLabel || "", a.avatarLabel = p?.avatarLabel || "", a.description = p?.description || "", a.capacity = p?.capacity || 1, a.interval = p?.interval || 30, a.openingHours = p?.openingHours || {
|
|
49
|
+
0: [],
|
|
50
|
+
1: [{ start: "09:00", end: "17:00" }],
|
|
51
|
+
2: [{ start: "09:00", end: "17:00" }],
|
|
52
|
+
3: [{ start: "09:00", end: "17:00" }],
|
|
53
|
+
4: [{ start: "09:00", end: "17:00" }],
|
|
54
|
+
5: [{ start: "09:00", end: "17:00" }],
|
|
55
|
+
6: []
|
|
56
|
+
}, a.color = p?.color || "blue", a.isActive = p?.isActive !== void 0 ? p.isActive : !0, C.value = !0;
|
|
57
|
+
}, F = () => {
|
|
58
|
+
C.value = !1;
|
|
59
|
+
}, T = () => {
|
|
60
|
+
N("add-resource", { ...a }), C.value = !1;
|
|
61
|
+
}, A = () => {
|
|
62
|
+
N("update-resource", { ...a }), C.value = !1;
|
|
63
|
+
}, x = () => {
|
|
64
|
+
N("remove-resource", a.id), C.value = !1;
|
|
65
|
+
}, M = P(() => a.name.trim().length > 0), G = (p) => {
|
|
66
|
+
a.openingHours[p] || (a.openingHours[p] = []), a.openingHours[p].push({ start: "09:00", end: "17:00" });
|
|
67
|
+
}, te = (p, t) => {
|
|
68
|
+
a.openingHours[p].splice(t, 1);
|
|
69
|
+
}, S = (p) => {
|
|
70
|
+
const t = a.openingHours[p];
|
|
71
|
+
m.forEach((j) => {
|
|
72
|
+
a.openingHours[j.value] = JSON.parse(JSON.stringify(t));
|
|
73
|
+
});
|
|
74
|
+
}, oe = (p) => {
|
|
75
|
+
a.openingHours[p] = [];
|
|
76
|
+
};
|
|
77
|
+
return ee({
|
|
78
|
+
openDialog: H
|
|
79
|
+
}), (p, t) => {
|
|
80
|
+
const j = i("DialogTitle"), se = i("DialogDescription"), Q = i("DialogHeader"), _ = i("Label"), $ = i("Input"), O = i("NumberFieldDecrement"), le = i("NumberFieldInput"), ne = i("NumberFieldIncrement"), K = i("NumberFieldContent"), ae = i("NumberField"), B = i("SelectValue"), ie = i("SelectTrigger"), V = i("SelectItem"), re = i("SelectContent"), de = i("Select"), n = i("Button"), o = i("DropdownMenuTrigger"), f = i("DropdownMenuItem"), z = i("DropdownMenuContent"), I = i("DropdownMenu"), R = i("Textarea"), ue = i("Switch"), ce = i("DialogFooter"), me = i("DialogScrollContent"), pe = i("Dialog");
|
|
81
|
+
return c(), L(pe, {
|
|
82
|
+
open: C.value,
|
|
83
|
+
"onUpdate:open": t[7] || (t[7] = (u) => C.value = u)
|
|
84
|
+
}, {
|
|
85
|
+
default: l(() => [
|
|
86
|
+
e(me, { class: "sm:max-w-xl lg:max-w-2xl" }, {
|
|
87
|
+
default: l(() => [
|
|
88
|
+
e(Q, null, {
|
|
89
|
+
default: l(() => [
|
|
90
|
+
e(j, null, {
|
|
91
|
+
default: l(() => [
|
|
92
|
+
d(g(h.value === "add" ? "Add New Resource" : "Edit Resource") + " ", 1),
|
|
93
|
+
s("span", We, "#" + g(a.id), 1)
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
}),
|
|
97
|
+
e(se, null, {
|
|
98
|
+
default: l(() => [
|
|
99
|
+
d(g(h.value === "add" ? "Define a new bookable resource such as staff member, room, or equipment." : "Update the details of this resource."), 1)
|
|
100
|
+
]),
|
|
101
|
+
_: 1
|
|
102
|
+
})
|
|
103
|
+
]),
|
|
104
|
+
_: 1
|
|
105
|
+
}),
|
|
106
|
+
s("div", Ge, [
|
|
107
|
+
s("div", null, [
|
|
108
|
+
e(_, {
|
|
109
|
+
class: "text-sm font-normal mb-1.5",
|
|
110
|
+
for: "resource-name"
|
|
111
|
+
}, {
|
|
112
|
+
default: l(() => [...t[8] || (t[8] = [
|
|
113
|
+
d(" Resource Name ", -1),
|
|
114
|
+
s("span", { class: "text-destructive" }, "*", -1)
|
|
115
|
+
])]),
|
|
116
|
+
_: 1
|
|
117
|
+
}),
|
|
118
|
+
e($, {
|
|
119
|
+
modelValue: a.name,
|
|
120
|
+
"onUpdate:modelValue": t[0] || (t[0] = (u) => a.name = u),
|
|
121
|
+
id: "resource-name",
|
|
122
|
+
placeholder: "e.g., James, Box 1, Meeting Room A"
|
|
123
|
+
}, null, 8, ["modelValue"]),
|
|
124
|
+
t[9] || (t[9] = s("p", { class: "text-xs text-muted-foreground mt-1" }, " Internal name visible to your team. ", -1))
|
|
125
|
+
]),
|
|
126
|
+
s("div", null, [
|
|
127
|
+
e(_, {
|
|
128
|
+
class: "text-sm font-normal mb-1.5",
|
|
129
|
+
for: "resource-public-label"
|
|
130
|
+
}, {
|
|
131
|
+
default: l(() => [...t[10] || (t[10] = [
|
|
132
|
+
d(" Public Label ", -1)
|
|
133
|
+
])]),
|
|
134
|
+
_: 1
|
|
135
|
+
}),
|
|
136
|
+
e($, {
|
|
137
|
+
modelValue: a.publicLabel,
|
|
138
|
+
"onUpdate:modelValue": t[1] || (t[1] = (u) => a.publicLabel = u),
|
|
139
|
+
id: "resource-public-label",
|
|
140
|
+
placeholder: "Name shown to customers"
|
|
141
|
+
}, null, 8, ["modelValue"]),
|
|
142
|
+
t[11] || (t[11] = s("p", { class: "text-xs text-muted-foreground mt-1" }, " If empty, the internal name will be displayed to customers. ", -1))
|
|
143
|
+
]),
|
|
144
|
+
s("div", null, [
|
|
145
|
+
e(_, {
|
|
146
|
+
class: "text-sm font-normal mb-1.5",
|
|
147
|
+
for: "resource-avatar-label"
|
|
148
|
+
}, {
|
|
149
|
+
default: l(() => [...t[12] || (t[12] = [
|
|
150
|
+
d(" Avatar Label ", -1)
|
|
151
|
+
])]),
|
|
152
|
+
_: 1
|
|
153
|
+
}),
|
|
154
|
+
e($, {
|
|
155
|
+
modelValue: a.avatarLabel,
|
|
156
|
+
"onUpdate:modelValue": t[2] || (t[2] = (u) => a.avatarLabel = u),
|
|
157
|
+
id: "resource-avatar-label",
|
|
158
|
+
placeholder: "e.g., B1, 1, JD",
|
|
159
|
+
maxlength: "3"
|
|
160
|
+
}, null, 8, ["modelValue"]),
|
|
161
|
+
t[13] || (t[13] = s("p", { class: "text-xs text-muted-foreground mt-1" }, " Short text shown in the colored circle (max 3 characters). If empty, first letter of name is used. ", -1))
|
|
162
|
+
]),
|
|
163
|
+
s("div", null, [
|
|
164
|
+
e(_, { class: "text-sm font-normal mb-1.5" }, {
|
|
165
|
+
default: l(() => [...t[14] || (t[14] = [
|
|
166
|
+
d("Color", -1)
|
|
167
|
+
])]),
|
|
168
|
+
_: 1
|
|
169
|
+
}),
|
|
170
|
+
s("div", Qe, [
|
|
171
|
+
(c(), v(U, null, J(W, (u) => s("button", {
|
|
172
|
+
key: u,
|
|
173
|
+
type: "button",
|
|
174
|
+
class: fe(["size-7 rounded-full transition-all ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", [
|
|
175
|
+
a.color === u ? "ring-2 ring-ring ring-offset-2" : "hover:scale-110"
|
|
176
|
+
]]),
|
|
177
|
+
style: Z({ background: u }),
|
|
178
|
+
onClick: (w) => a.color = u
|
|
179
|
+
}, null, 14, Ke)), 64))
|
|
180
|
+
]),
|
|
181
|
+
t[15] || (t[15] = s("p", { class: "text-xs text-muted-foreground mt-2" }, " Used for visual identification in the calendar. ", -1))
|
|
182
|
+
]),
|
|
183
|
+
s("div", null, [
|
|
184
|
+
e(_, {
|
|
185
|
+
class: "text-sm font-normal mb-1.5",
|
|
186
|
+
for: "resource-capacity"
|
|
187
|
+
}, {
|
|
188
|
+
default: l(() => [...t[16] || (t[16] = [
|
|
189
|
+
d(" Capacity ", -1)
|
|
190
|
+
])]),
|
|
191
|
+
_: 1
|
|
192
|
+
}),
|
|
193
|
+
e(ae, {
|
|
194
|
+
id: "resource-capacity",
|
|
195
|
+
modelValue: a.capacity,
|
|
196
|
+
"onUpdate:modelValue": t[3] || (t[3] = (u) => a.capacity = u),
|
|
197
|
+
min: 1,
|
|
198
|
+
max: 999
|
|
199
|
+
}, {
|
|
200
|
+
default: l(() => [
|
|
201
|
+
e(K, null, {
|
|
202
|
+
default: l(() => [
|
|
203
|
+
e(O),
|
|
204
|
+
e(le),
|
|
205
|
+
e(ne)
|
|
206
|
+
]),
|
|
207
|
+
_: 1
|
|
208
|
+
})
|
|
209
|
+
]),
|
|
210
|
+
_: 1
|
|
211
|
+
}, 8, ["modelValue"]),
|
|
212
|
+
t[17] || (t[17] = s("p", { class: "text-xs text-muted-foreground mt-1" }, " Maximum simultaneous bookings allowed for this resource. ", -1))
|
|
213
|
+
]),
|
|
214
|
+
s("div", null, [
|
|
215
|
+
e(_, {
|
|
216
|
+
class: "text-sm font-normal mb-1.5",
|
|
217
|
+
for: "resource-interval"
|
|
218
|
+
}, {
|
|
219
|
+
default: l(() => [...t[18] || (t[18] = [
|
|
220
|
+
d(" Booking Interval ", -1)
|
|
221
|
+
])]),
|
|
222
|
+
_: 1
|
|
223
|
+
}),
|
|
224
|
+
e(de, {
|
|
225
|
+
modelValue: a.interval,
|
|
226
|
+
"onUpdate:modelValue": t[4] || (t[4] = (u) => a.interval = u),
|
|
227
|
+
modelModifiers: { number: !0 }
|
|
228
|
+
}, {
|
|
229
|
+
default: l(() => [
|
|
230
|
+
e(ie, { id: "resource-interval" }, {
|
|
231
|
+
default: l(() => [
|
|
232
|
+
e(B, { placeholder: "Select interval" })
|
|
233
|
+
]),
|
|
234
|
+
_: 1
|
|
235
|
+
}),
|
|
236
|
+
e(re, null, {
|
|
237
|
+
default: l(() => [
|
|
238
|
+
e(V, { value: 5 }, {
|
|
239
|
+
default: l(() => [...t[19] || (t[19] = [
|
|
240
|
+
d("5 minutes", -1)
|
|
241
|
+
])]),
|
|
242
|
+
_: 1
|
|
243
|
+
}),
|
|
244
|
+
e(V, { value: 10 }, {
|
|
245
|
+
default: l(() => [...t[20] || (t[20] = [
|
|
246
|
+
d("10 minutes", -1)
|
|
247
|
+
])]),
|
|
248
|
+
_: 1
|
|
249
|
+
}),
|
|
250
|
+
e(V, { value: 15 }, {
|
|
251
|
+
default: l(() => [...t[21] || (t[21] = [
|
|
252
|
+
d("15 minutes", -1)
|
|
253
|
+
])]),
|
|
254
|
+
_: 1
|
|
255
|
+
}),
|
|
256
|
+
e(V, { value: 30 }, {
|
|
257
|
+
default: l(() => [...t[22] || (t[22] = [
|
|
258
|
+
d("30 minutes", -1)
|
|
259
|
+
])]),
|
|
260
|
+
_: 1
|
|
261
|
+
}),
|
|
262
|
+
e(V, { value: 60 }, {
|
|
263
|
+
default: l(() => [...t[23] || (t[23] = [
|
|
264
|
+
d("1 hour", -1)
|
|
265
|
+
])]),
|
|
266
|
+
_: 1
|
|
267
|
+
})
|
|
268
|
+
]),
|
|
269
|
+
_: 1
|
|
270
|
+
})
|
|
271
|
+
]),
|
|
272
|
+
_: 1
|
|
273
|
+
}, 8, ["modelValue"]),
|
|
274
|
+
t[24] || (t[24] = s("p", { class: "text-xs text-muted-foreground mt-1" }, " Time slots will be generated at this interval within operating hours. ", -1))
|
|
275
|
+
]),
|
|
276
|
+
s("div", null, [
|
|
277
|
+
e(_, { class: "text-sm font-normal mb-2 flex items-center gap-2" }, {
|
|
278
|
+
default: l(() => [
|
|
279
|
+
e(b(Le), { class: "w-4 h-4" }),
|
|
280
|
+
t[25] || (t[25] = d(" Operating Hours ", -1))
|
|
281
|
+
]),
|
|
282
|
+
_: 1
|
|
283
|
+
}),
|
|
284
|
+
s("div", Xe, [
|
|
285
|
+
(c(), v(U, null, J(m, (u) => s("div", {
|
|
286
|
+
key: u.value,
|
|
287
|
+
class: "rounded-md bg-muted/30 p-2 sm:p-3"
|
|
288
|
+
}, [
|
|
289
|
+
s("div", Ze, [
|
|
290
|
+
s("span", et, g(u.label), 1),
|
|
291
|
+
s("div", tt, [
|
|
292
|
+
e(n, {
|
|
293
|
+
variant: "outline",
|
|
294
|
+
size: "sm",
|
|
295
|
+
class: "h-7 px-2 text-xs",
|
|
296
|
+
onClick: (w) => G(u.value)
|
|
297
|
+
}, {
|
|
298
|
+
default: l(() => [...t[26] || (t[26] = [
|
|
299
|
+
d(" Add ", -1)
|
|
300
|
+
])]),
|
|
301
|
+
_: 1
|
|
302
|
+
}, 8, ["onClick"]),
|
|
303
|
+
e(I, null, {
|
|
304
|
+
default: l(() => [
|
|
305
|
+
e(o, { "as-child": "" }, {
|
|
306
|
+
default: l(() => [
|
|
307
|
+
e(n, {
|
|
308
|
+
variant: "ghost",
|
|
309
|
+
size: "icon",
|
|
310
|
+
class: "size-7"
|
|
311
|
+
}, {
|
|
312
|
+
default: l(() => [
|
|
313
|
+
e(b(Te), { class: "w-4 h-4" })
|
|
314
|
+
]),
|
|
315
|
+
_: 1
|
|
316
|
+
})
|
|
317
|
+
]),
|
|
318
|
+
_: 1
|
|
319
|
+
}),
|
|
320
|
+
e(z, { align: "end" }, {
|
|
321
|
+
default: l(() => [
|
|
322
|
+
e(f, {
|
|
323
|
+
onClick: (w) => S(u.value)
|
|
324
|
+
}, {
|
|
325
|
+
default: l(() => [...t[27] || (t[27] = [
|
|
326
|
+
d(" Copy to all days ", -1)
|
|
327
|
+
])]),
|
|
328
|
+
_: 1
|
|
329
|
+
}, 8, ["onClick"]),
|
|
330
|
+
e(f, {
|
|
331
|
+
onClick: (w) => oe(u.value),
|
|
332
|
+
variant: "destructive"
|
|
333
|
+
}, {
|
|
334
|
+
default: l(() => [...t[28] || (t[28] = [
|
|
335
|
+
d(" Set as closed ", -1)
|
|
336
|
+
])]),
|
|
337
|
+
_: 1
|
|
338
|
+
}, 8, ["onClick"])
|
|
339
|
+
]),
|
|
340
|
+
_: 2
|
|
341
|
+
}, 1024)
|
|
342
|
+
]),
|
|
343
|
+
_: 2
|
|
344
|
+
}, 1024)
|
|
345
|
+
])
|
|
346
|
+
]),
|
|
347
|
+
s("div", ot, [
|
|
348
|
+
a.openingHours[u.value]?.length === 0 ? (c(), v("div", st, " Closed ")) : k("", !0),
|
|
349
|
+
(c(!0), v(U, null, J(a.openingHours[u.value], (w, X) => (c(), v("div", {
|
|
350
|
+
key: X,
|
|
351
|
+
class: "flex items-center gap-1.5 sm:gap-2"
|
|
352
|
+
}, [
|
|
353
|
+
e($, {
|
|
354
|
+
modelValue: w.start,
|
|
355
|
+
"onUpdate:modelValue": (E) => w.start = E,
|
|
356
|
+
type: "time",
|
|
357
|
+
class: "flex-1 min-w-0 h-8 text-sm"
|
|
358
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
359
|
+
t[29] || (t[29] = s("span", { class: "text-muted-foreground text-xs sm:text-sm shrink-0" }, "to", -1)),
|
|
360
|
+
e($, {
|
|
361
|
+
modelValue: w.end,
|
|
362
|
+
"onUpdate:modelValue": (E) => w.end = E,
|
|
363
|
+
type: "time",
|
|
364
|
+
class: "flex-1 min-w-0 h-8 text-sm"
|
|
365
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
366
|
+
e(n, {
|
|
367
|
+
variant: "ghost",
|
|
368
|
+
size: "icon",
|
|
369
|
+
class: "size-7 shrink-0",
|
|
370
|
+
onClick: (E) => te(u.value, X)
|
|
371
|
+
}, {
|
|
372
|
+
default: l(() => [
|
|
373
|
+
e(b(_e), { class: "w-3.5 h-3.5 text-destructive" })
|
|
374
|
+
]),
|
|
375
|
+
_: 1
|
|
376
|
+
}, 8, ["onClick"])
|
|
377
|
+
]))), 128))
|
|
378
|
+
])
|
|
379
|
+
])), 64))
|
|
380
|
+
]),
|
|
381
|
+
t[30] || (t[30] = s("p", { class: "text-xs text-muted-foreground mt-2" }, " Define when this resource is available. You can add multiple time ranges per day for split shifts. ", -1))
|
|
382
|
+
]),
|
|
383
|
+
s("div", null, [
|
|
384
|
+
e(_, {
|
|
385
|
+
class: "text-sm font-normal mb-1.5",
|
|
386
|
+
for: "resource-description"
|
|
387
|
+
}, {
|
|
388
|
+
default: l(() => [...t[31] || (t[31] = [
|
|
389
|
+
d(" Description ", -1)
|
|
390
|
+
])]),
|
|
391
|
+
_: 1
|
|
392
|
+
}),
|
|
393
|
+
e(R, {
|
|
394
|
+
modelValue: a.description,
|
|
395
|
+
"onUpdate:modelValue": t[5] || (t[5] = (u) => a.description = u),
|
|
396
|
+
id: "resource-description",
|
|
397
|
+
placeholder: "Internal notes about this resource...",
|
|
398
|
+
rows: "3"
|
|
399
|
+
}, null, 8, ["modelValue"]),
|
|
400
|
+
t[32] || (t[32] = s("p", { class: "text-xs text-muted-foreground mt-1" }, " Admin-only notes. Not shown to customers. ", -1))
|
|
401
|
+
]),
|
|
402
|
+
s("div", lt, [
|
|
403
|
+
s("div", nt, [
|
|
404
|
+
e(_, { class: "text-sm font-medium" }, {
|
|
405
|
+
default: l(() => [...t[33] || (t[33] = [
|
|
406
|
+
d("Active", -1)
|
|
407
|
+
])]),
|
|
408
|
+
_: 1
|
|
409
|
+
}),
|
|
410
|
+
s("p", at, g(a.isActive ? "Resource can be used for new slots and bookings." : "Existing bookings stay, but no new ones can be created."), 1)
|
|
411
|
+
]),
|
|
412
|
+
e(ue, {
|
|
413
|
+
modelValue: a.isActive,
|
|
414
|
+
"onUpdate:modelValue": t[6] || (t[6] = (u) => a.isActive = u)
|
|
415
|
+
}, null, 8, ["modelValue"])
|
|
416
|
+
])
|
|
417
|
+
]),
|
|
418
|
+
e(ce, { class: "@container/dialog-footer gap-2" }, {
|
|
419
|
+
default: l(() => [
|
|
420
|
+
s("div", it, [
|
|
421
|
+
h.value === "edit" ? (c(), L(n, {
|
|
422
|
+
key: 0,
|
|
423
|
+
variant: "destructive",
|
|
424
|
+
onClick: x,
|
|
425
|
+
class: "w-full @sm/dialog-footer:w-auto"
|
|
426
|
+
}, {
|
|
427
|
+
default: l(() => [...t[34] || (t[34] = [
|
|
428
|
+
d(" Delete Resource ", -1)
|
|
429
|
+
])]),
|
|
430
|
+
_: 1
|
|
431
|
+
})) : k("", !0),
|
|
432
|
+
s("div", rt, [
|
|
433
|
+
e(n, {
|
|
434
|
+
variant: "outline",
|
|
435
|
+
onClick: F,
|
|
436
|
+
class: "w-full @sm/dialog-footer:w-auto"
|
|
437
|
+
}, {
|
|
438
|
+
default: l(() => [...t[35] || (t[35] = [
|
|
439
|
+
d(" Cancel ", -1)
|
|
440
|
+
])]),
|
|
441
|
+
_: 1
|
|
442
|
+
}),
|
|
443
|
+
h.value === "add" ? (c(), L(n, {
|
|
444
|
+
key: 0,
|
|
445
|
+
onClick: T,
|
|
446
|
+
disabled: !M.value,
|
|
447
|
+
class: "w-full @sm/dialog-footer:w-auto"
|
|
448
|
+
}, {
|
|
449
|
+
default: l(() => [...t[36] || (t[36] = [
|
|
450
|
+
d(" Add Resource ", -1)
|
|
451
|
+
])]),
|
|
452
|
+
_: 1
|
|
453
|
+
}, 8, ["disabled"])) : (c(), L(n, {
|
|
454
|
+
key: 1,
|
|
455
|
+
onClick: A,
|
|
456
|
+
disabled: !M.value,
|
|
457
|
+
class: "w-full @sm/dialog-footer:w-auto"
|
|
458
|
+
}, {
|
|
459
|
+
default: l(() => [...t[37] || (t[37] = [
|
|
460
|
+
d(" Save Changes ", -1)
|
|
461
|
+
])]),
|
|
462
|
+
_: 1
|
|
463
|
+
}, 8, ["disabled"]))
|
|
464
|
+
])
|
|
465
|
+
])
|
|
466
|
+
]),
|
|
467
|
+
_: 1
|
|
468
|
+
})
|
|
469
|
+
]),
|
|
470
|
+
_: 1
|
|
471
|
+
})
|
|
472
|
+
]),
|
|
473
|
+
_: 1
|
|
474
|
+
}, 8, ["open"]);
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
}), ut = {
|
|
478
|
+
key: 0,
|
|
479
|
+
class: "@container/resources"
|
|
480
|
+
}, ct = { class: "flex flex-col @lg/resources:flex-row @lg/resources:items-center @lg/resources:justify-between gap-4 mb-6" }, mt = {
|
|
481
|
+
key: 0,
|
|
482
|
+
class: "flex flex-col @sm/resources:flex-row gap-2"
|
|
483
|
+
}, pt = { class: "space-y-6" }, ft = {
|
|
484
|
+
key: 0,
|
|
485
|
+
class: "flex flex-col @md/resources:flex-row gap-4 items-start @md/resources:items-center justify-between"
|
|
486
|
+
}, vt = { class: "relative w-full @md/resources:w-64" }, gt = { class: "text-sm text-muted-foreground" }, bt = {
|
|
487
|
+
key: 1,
|
|
488
|
+
class: "grid grid-cols-1 @2xl/resources:grid-cols-2 @4xl/resources:grid-cols-3 gap-4"
|
|
489
|
+
}, xt = { class: "p-4 pl-5" }, _t = { class: "flex items-start gap-3" }, wt = { class: "flex-1 min-w-0" }, yt = { class: "flex items-center gap-2" }, kt = { class: "font-semibold truncate text-base" }, Dt = { key: 0 }, Ct = {
|
|
490
|
+
key: 0,
|
|
491
|
+
class: "text-sm text-muted-foreground truncate"
|
|
492
|
+
}, ht = {
|
|
493
|
+
key: 0,
|
|
494
|
+
class: "text-sm text-muted-foreground mt-3 line-clamp-2"
|
|
495
|
+
}, Rt = { class: "flex items-center flex-wrap gap-3 mt-4 pt-3 border-t" }, St = { class: "flex items-center gap-1.5 text-xs text-muted-foreground" }, Vt = { class: "flex items-center gap-1.5 text-xs text-muted-foreground" }, zt = { class: "flex items-center gap-2" }, At = { class: "text-xs text-muted-foreground" }, Mt = {
|
|
496
|
+
key: 1,
|
|
497
|
+
class: "flex items-center gap-1.5 text-xs text-orange-500"
|
|
498
|
+
}, $t = {
|
|
499
|
+
key: 2,
|
|
500
|
+
class: "text-center py-8 text-muted-foreground"
|
|
501
|
+
}, Lt = {
|
|
502
|
+
key: 3,
|
|
503
|
+
class: "flex justify-center py-12"
|
|
504
|
+
}, Tt = {
|
|
505
|
+
key: 5,
|
|
506
|
+
class: "fixed bottom-4 right-4 bg-background border rounded-lg px-4 py-2 shadow-lg flex items-center gap-2"
|
|
507
|
+
}, It = { key: 1 }, Et = { class: "py-4" }, Ut = { class: "space-y-2" }, Nt = ["onDragover"], Ht = ["aria-label", "onDragstart"], Ft = { class: "min-w-0 flex-1" }, jt = { class: "flex items-center gap-2 min-w-0" }, Ot = { class: "truncate text-sm font-medium" }, Bt = {
|
|
508
|
+
key: 0,
|
|
509
|
+
class: "shrink-0 rounded-sm bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground"
|
|
510
|
+
}, Yt = {
|
|
511
|
+
key: 0,
|
|
512
|
+
class: "truncate text-xs text-muted-foreground"
|
|
513
|
+
}, Pt = { class: "w-8 shrink-0 text-right text-xs tabular-nums text-muted-foreground" }, Jt = { class: "flex shrink-0 items-center gap-1" }, qt = { class: "flex w-full flex-col-reverse gap-2 @sm/reorder-footer:flex-row @sm/reorder-footer:justify-end" }, Zt = /* @__PURE__ */ xe({
|
|
514
|
+
__name: "resources",
|
|
515
|
+
setup(we) {
|
|
516
|
+
const { width: ee } = qe(), { params: q } = Oe(), { hasPermission: N } = Be(), { confirm: C } = Ye(), { config: h } = Pe(), W = Je(h.project), m = D([]), a = D(!1), H = D(!0), F = D(), T = D(""), A = D(!1), x = D([]), M = D(null), G = () => Date.now().toString(36) + Math.random().toString(36).substr(2), te = async () => {
|
|
517
|
+
try {
|
|
518
|
+
H.value = !0;
|
|
519
|
+
const n = await W.get(h.agendaCollection, q.value.id);
|
|
520
|
+
m.value = n.resources || [];
|
|
521
|
+
} catch (n) {
|
|
522
|
+
console.error("Error loading resources:", n);
|
|
523
|
+
} finally {
|
|
524
|
+
H.value = !1;
|
|
525
|
+
}
|
|
526
|
+
}, S = async () => {
|
|
527
|
+
a.value = !0;
|
|
528
|
+
try {
|
|
529
|
+
return await W.update(h.agendaCollection, q.value.id, {
|
|
530
|
+
resources: m.value
|
|
531
|
+
}), !0;
|
|
532
|
+
} catch (n) {
|
|
533
|
+
return console.error("Error saving resources:", n), !1;
|
|
534
|
+
} finally {
|
|
535
|
+
a.value = !1;
|
|
536
|
+
}
|
|
537
|
+
}, oe = (n) => {
|
|
538
|
+
const o = {
|
|
539
|
+
...n,
|
|
540
|
+
id: G()
|
|
541
|
+
};
|
|
542
|
+
m.value.push(o), S();
|
|
543
|
+
}, p = (n) => {
|
|
544
|
+
const o = m.value.findIndex((f) => f.id === n.id);
|
|
545
|
+
o !== -1 && (m.value[o] = n), S();
|
|
546
|
+
}, t = async (n) => {
|
|
547
|
+
await C("Are you sure you want to delete this resource? This action cannot be undone.", "Delete Resource", "Delete") && (m.value = m.value.filter((f) => f.id !== n), S());
|
|
548
|
+
}, j = async (n) => {
|
|
549
|
+
const o = m.value.findIndex((f) => f.id === n.id);
|
|
550
|
+
o !== -1 && (m.value[o].isActive = !m.value[o].isActive, await S());
|
|
551
|
+
}, se = (n) => {
|
|
552
|
+
const o = {
|
|
553
|
+
...n,
|
|
554
|
+
id: G(),
|
|
555
|
+
name: `${n.name} (Copy)`,
|
|
556
|
+
publicLabel: n.publicLabel ? `${n.publicLabel} (Copy)` : ""
|
|
557
|
+
};
|
|
558
|
+
m.value.push(o), S();
|
|
559
|
+
}, Q = () => {
|
|
560
|
+
F.value?.openDialog();
|
|
561
|
+
}, _ = (n) => {
|
|
562
|
+
F.value?.openDialog(n);
|
|
563
|
+
}, $ = () => {
|
|
564
|
+
x.value = [...m.value], A.value = !0;
|
|
565
|
+
}, O = (n, o) => {
|
|
566
|
+
if (o < 0 || o >= x.value.length) return;
|
|
567
|
+
const f = [...x.value], [z] = f.splice(n, 1);
|
|
568
|
+
f.splice(o, 0, z), x.value = f;
|
|
569
|
+
}, le = (n, o) => {
|
|
570
|
+
M.value = n, o.dataTransfer?.setData("text/plain", n), o.dataTransfer && (o.dataTransfer.effectAllowed = "move");
|
|
571
|
+
}, ne = (n, o) => {
|
|
572
|
+
o.preventDefault(), o.dataTransfer && (o.dataTransfer.dropEffect = "move");
|
|
573
|
+
const f = M.value;
|
|
574
|
+
if (!f || f === n) return;
|
|
575
|
+
const z = x.value.findIndex((R) => R.id === f), I = x.value.findIndex((R) => R.id === n);
|
|
576
|
+
z === -1 || I === -1 || O(z, I);
|
|
577
|
+
}, K = () => {
|
|
578
|
+
M.value = null;
|
|
579
|
+
}, ae = async () => {
|
|
580
|
+
const n = [...m.value];
|
|
581
|
+
m.value = [...x.value], await S() ? A.value = !1 : m.value = n;
|
|
582
|
+
}, B = P(() => {
|
|
583
|
+
if (!T.value.trim())
|
|
584
|
+
return m.value;
|
|
585
|
+
const n = T.value.toLowerCase();
|
|
586
|
+
return m.value.filter(
|
|
587
|
+
(o) => o.name.toLowerCase().includes(n) || o.publicLabel?.toLowerCase().includes(n)
|
|
588
|
+
);
|
|
589
|
+
}), ie = P(() => m.value.filter((n) => n.isActive).length), V = P(() => m.value.length), re = P(() => x.value.map((n) => n.id).join("|") !== m.value.map((n) => n.id).join("|")), de = (n) => n.publicLabel || n.name;
|
|
590
|
+
return te(), (n, o) => {
|
|
591
|
+
const f = i("Button"), z = i("Input"), I = i("DropdownMenuTrigger"), R = i("DropdownMenuItem"), ue = i("DropdownMenuSeparator"), ce = i("DropdownMenuContent"), me = i("DropdownMenu"), pe = i("Switch"), u = i("Card"), w = i("Spinner"), X = i("EmptyMedia"), E = i("EmptyTitle"), ye = i("EmptyDescription"), ke = i("EmptyHeader"), De = i("EmptyContent"), Ce = i("Empty"), he = i("DialogTitle"), Re = i("DialogDescription"), Se = i("DialogHeader"), Ve = i("DialogFooter"), ze = i("DialogScrollContent"), Ae = i("Dialog");
|
|
592
|
+
return c(), L($e, null, {
|
|
593
|
+
default: l(() => [
|
|
594
|
+
b(N)("manage-resources") ? (c(), v("div", ut, [
|
|
595
|
+
s("div", ct, [
|
|
596
|
+
o[5] || (o[5] = s("div", null, [
|
|
597
|
+
s("h1", { class: "text-lg font-medium" }, "Resource Management"),
|
|
598
|
+
s("p", { class: "text-muted-foreground text-sm mt-1" }, " Define the rooms, boxes, or staff that can be booked in this agenda. ")
|
|
599
|
+
], -1)),
|
|
600
|
+
m.value.length > 0 ? (c(), v("div", mt, [
|
|
601
|
+
e(f, {
|
|
602
|
+
variant: "outline",
|
|
603
|
+
onClick: $,
|
|
604
|
+
disabled: m.value.length < 2 || a.value
|
|
605
|
+
}, {
|
|
606
|
+
default: l(() => [
|
|
607
|
+
e(b(Ie), { class: "size-4 mr-1.5" }),
|
|
608
|
+
o[3] || (o[3] = d(" Reorder ", -1))
|
|
609
|
+
]),
|
|
610
|
+
_: 1
|
|
611
|
+
}, 8, ["disabled"]),
|
|
612
|
+
e(f, { onClick: Q }, {
|
|
613
|
+
default: l(() => [
|
|
614
|
+
e(b(ge), { class: "size-4 mr-1.5" }),
|
|
615
|
+
o[4] || (o[4] = d(" Add Resource ", -1))
|
|
616
|
+
]),
|
|
617
|
+
_: 1
|
|
618
|
+
})
|
|
619
|
+
])) : k("", !0)
|
|
620
|
+
]),
|
|
621
|
+
s("div", pt, [
|
|
622
|
+
m.value.length > 0 ? (c(), v("div", ft, [
|
|
623
|
+
s("div", vt, [
|
|
624
|
+
e(z, {
|
|
625
|
+
modelValue: T.value,
|
|
626
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => T.value = r),
|
|
627
|
+
placeholder: "Search resources...",
|
|
628
|
+
class: "pl-9"
|
|
629
|
+
}, null, 8, ["modelValue"]),
|
|
630
|
+
o[6] || (o[6] = s("svg", {
|
|
631
|
+
class: "absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground",
|
|
632
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
633
|
+
fill: "none",
|
|
634
|
+
viewBox: "0 0 24 24",
|
|
635
|
+
stroke: "currentColor"
|
|
636
|
+
}, [
|
|
637
|
+
s("path", {
|
|
638
|
+
"stroke-linecap": "round",
|
|
639
|
+
"stroke-linejoin": "round",
|
|
640
|
+
"stroke-width": "2",
|
|
641
|
+
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
642
|
+
})
|
|
643
|
+
], -1))
|
|
644
|
+
]),
|
|
645
|
+
s("div", gt, g(ie.value) + " active of " + g(V.value) + " resource" + g(V.value !== 1 ? "s" : ""), 1)
|
|
646
|
+
])) : k("", !0),
|
|
647
|
+
B.value.length > 0 ? (c(), v("div", bt, [
|
|
648
|
+
(c(!0), v(U, null, J(B.value, (r) => (c(), L(u, {
|
|
649
|
+
key: r.id,
|
|
650
|
+
class: fe(["group relative overflow-hidden transition-all duration-200 hover:shadow-md", r.isActive ? "" : "opacity-60 grayscale-[30%]"])
|
|
651
|
+
}, {
|
|
652
|
+
default: l(() => [
|
|
653
|
+
s("div", {
|
|
654
|
+
class: "absolute inset-y-0 left-0 w-1 transition-all duration-200 group-hover:w-1.5",
|
|
655
|
+
style: Z({ background: r.color })
|
|
656
|
+
}, null, 4),
|
|
657
|
+
s("div", xt, [
|
|
658
|
+
s("div", _t, [
|
|
659
|
+
s("div", {
|
|
660
|
+
class: "size-11 rounded-xl flex-shrink-0 flex items-center justify-center text-white font-semibold text-sm shadow-sm",
|
|
661
|
+
style: Z({ background: r.color })
|
|
662
|
+
}, g(r.avatarLabel || r.name.charAt(0).toUpperCase()), 5),
|
|
663
|
+
s("div", wt, [
|
|
664
|
+
s("div", yt, [
|
|
665
|
+
s("h3", kt, [
|
|
666
|
+
d(g(r.name) + " ", 1),
|
|
667
|
+
r.isActive ? k("", !0) : (c(), v("span", Dt, "(Inactive)"))
|
|
668
|
+
])
|
|
669
|
+
]),
|
|
670
|
+
r.publicLabel && r.publicLabel !== r.name ? (c(), v("p", Ct, g(r.publicLabel), 1)) : k("", !0)
|
|
671
|
+
]),
|
|
672
|
+
e(me, null, {
|
|
673
|
+
default: l(() => [
|
|
674
|
+
e(I, { "as-child": "" }, {
|
|
675
|
+
default: l(() => [
|
|
676
|
+
e(f, {
|
|
677
|
+
variant: "ghost",
|
|
678
|
+
size: "icon",
|
|
679
|
+
class: "size-8"
|
|
680
|
+
}, {
|
|
681
|
+
default: l(() => [...o[7] || (o[7] = [
|
|
682
|
+
s("svg", {
|
|
683
|
+
class: "size-4",
|
|
684
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
685
|
+
fill: "none",
|
|
686
|
+
viewBox: "0 0 24 24",
|
|
687
|
+
stroke: "currentColor"
|
|
688
|
+
}, [
|
|
689
|
+
s("path", {
|
|
690
|
+
"stroke-linecap": "round",
|
|
691
|
+
"stroke-linejoin": "round",
|
|
692
|
+
"stroke-width": "2",
|
|
693
|
+
d: "M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"
|
|
694
|
+
})
|
|
695
|
+
], -1)
|
|
696
|
+
])]),
|
|
697
|
+
_: 1
|
|
698
|
+
})
|
|
699
|
+
]),
|
|
700
|
+
_: 1
|
|
701
|
+
}),
|
|
702
|
+
e(ce, { align: "end" }, {
|
|
703
|
+
default: l(() => [
|
|
704
|
+
e(R, {
|
|
705
|
+
onClick: (y) => _(r)
|
|
706
|
+
}, {
|
|
707
|
+
default: l(() => [
|
|
708
|
+
e(b(Ee), { class: "size-4 mr-2" }),
|
|
709
|
+
o[8] || (o[8] = d(" Edit ", -1))
|
|
710
|
+
]),
|
|
711
|
+
_: 1
|
|
712
|
+
}, 8, ["onClick"]),
|
|
713
|
+
e(R, {
|
|
714
|
+
onClick: (y) => se(r)
|
|
715
|
+
}, {
|
|
716
|
+
default: l(() => [
|
|
717
|
+
e(b(Ue), { class: "size-4 mr-2" }),
|
|
718
|
+
o[9] || (o[9] = d(" Duplicate ", -1))
|
|
719
|
+
]),
|
|
720
|
+
_: 1
|
|
721
|
+
}, 8, ["onClick"]),
|
|
722
|
+
e(ue),
|
|
723
|
+
e(R, {
|
|
724
|
+
variant: "destructive",
|
|
725
|
+
onClick: (y) => t(r.id)
|
|
726
|
+
}, {
|
|
727
|
+
default: l(() => [
|
|
728
|
+
e(b(_e), { class: "size-4 mr-2" }),
|
|
729
|
+
o[10] || (o[10] = d(" Delete ", -1))
|
|
730
|
+
]),
|
|
731
|
+
_: 1
|
|
732
|
+
}, 8, ["onClick"])
|
|
733
|
+
]),
|
|
734
|
+
_: 2
|
|
735
|
+
}, 1024)
|
|
736
|
+
]),
|
|
737
|
+
_: 2
|
|
738
|
+
}, 1024)
|
|
739
|
+
]),
|
|
740
|
+
r.description ? (c(), v("p", ht, g(r.description), 1)) : k("", !0),
|
|
741
|
+
s("div", Rt, [
|
|
742
|
+
s("div", St, [
|
|
743
|
+
e(b(be), { class: "size-3.5" }),
|
|
744
|
+
s("span", null, g(r.capacity) + " " + g(r.capacity === 1 ? "slot" : "slots"), 1)
|
|
745
|
+
]),
|
|
746
|
+
s("div", Vt, [
|
|
747
|
+
o[11] || (o[11] = s("svg", {
|
|
748
|
+
class: "size-3.5",
|
|
749
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
750
|
+
fill: "none",
|
|
751
|
+
viewBox: "0 0 24 24",
|
|
752
|
+
stroke: "currentColor"
|
|
753
|
+
}, [
|
|
754
|
+
s("path", {
|
|
755
|
+
"stroke-linecap": "round",
|
|
756
|
+
"stroke-linejoin": "round",
|
|
757
|
+
"stroke-width": "2",
|
|
758
|
+
d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z"
|
|
759
|
+
})
|
|
760
|
+
], -1)),
|
|
761
|
+
s("span", null, g(r.interval) + " min", 1)
|
|
762
|
+
]),
|
|
763
|
+
b(ee) >= 640 ? (c(), v(U, { key: 0 }, [
|
|
764
|
+
o[12] || (o[12] = s("div", { class: "flex-1" }, null, -1)),
|
|
765
|
+
s("div", zt, [
|
|
766
|
+
s("span", At, g(r.isActive ? "Active" : "Inactive"), 1),
|
|
767
|
+
e(pe, {
|
|
768
|
+
defaultValue: r.isActive,
|
|
769
|
+
"onUpdate:modelValue": (y) => j(r),
|
|
770
|
+
class: "scale-90"
|
|
771
|
+
}, null, 8, ["defaultValue", "onUpdate:modelValue"])
|
|
772
|
+
])
|
|
773
|
+
], 64)) : r.isActive ? k("", !0) : (c(), v("div", Mt, [
|
|
774
|
+
e(b(Ne), { class: "size-3.5" }),
|
|
775
|
+
o[13] || (o[13] = s("span", null, "Inactive", -1))
|
|
776
|
+
]))
|
|
777
|
+
])
|
|
778
|
+
])
|
|
779
|
+
]),
|
|
780
|
+
_: 2
|
|
781
|
+
}, 1032, ["class"]))), 128))
|
|
782
|
+
])) : m.value.length > 0 && B.value.length === 0 ? (c(), v("div", $t, [...o[14] || (o[14] = [
|
|
783
|
+
s("p", null, "No resources match your search.", -1)
|
|
784
|
+
])])) : H.value ? (c(), v("div", Lt, [
|
|
785
|
+
e(w, { class: "size-8" })
|
|
786
|
+
])) : (c(), L(Ce, {
|
|
787
|
+
key: 4,
|
|
788
|
+
class: "border border-dashed"
|
|
789
|
+
}, {
|
|
790
|
+
default: l(() => [
|
|
791
|
+
e(ke, null, {
|
|
792
|
+
default: l(() => [
|
|
793
|
+
e(X, { variant: "icon" }, {
|
|
794
|
+
default: l(() => [
|
|
795
|
+
e(b(be), { class: "size-6" })
|
|
796
|
+
]),
|
|
797
|
+
_: 1
|
|
798
|
+
}),
|
|
799
|
+
e(E, null, {
|
|
800
|
+
default: l(() => [...o[15] || (o[15] = [
|
|
801
|
+
d("No Resources Yet", -1)
|
|
802
|
+
])]),
|
|
803
|
+
_: 1
|
|
804
|
+
}),
|
|
805
|
+
e(ye, null, {
|
|
806
|
+
default: l(() => [...o[16] || (o[16] = [
|
|
807
|
+
d(" You haven't added any bookable resources yet. Define your staff, rooms, or equipment to start configuring availability. ", -1)
|
|
808
|
+
])]),
|
|
809
|
+
_: 1
|
|
810
|
+
})
|
|
811
|
+
]),
|
|
812
|
+
_: 1
|
|
813
|
+
}),
|
|
814
|
+
e(De, null, {
|
|
815
|
+
default: l(() => [
|
|
816
|
+
e(f, {
|
|
817
|
+
variant: "outline",
|
|
818
|
+
onClick: Q
|
|
819
|
+
}, {
|
|
820
|
+
default: l(() => [
|
|
821
|
+
e(b(ge), { class: "size-4 mr-1.5" }),
|
|
822
|
+
o[17] || (o[17] = d(" Add Your First Resource ", -1))
|
|
823
|
+
]),
|
|
824
|
+
_: 1
|
|
825
|
+
})
|
|
826
|
+
]),
|
|
827
|
+
_: 1
|
|
828
|
+
})
|
|
829
|
+
]),
|
|
830
|
+
_: 1
|
|
831
|
+
})),
|
|
832
|
+
a.value ? (c(), v("div", Tt, [
|
|
833
|
+
e(w, { class: "size-4" }),
|
|
834
|
+
o[18] || (o[18] = s("span", { class: "text-sm" }, "Saving...", -1))
|
|
835
|
+
])) : k("", !0)
|
|
836
|
+
])
|
|
837
|
+
])) : (c(), v("div", It, [...o[19] || (o[19] = [
|
|
838
|
+
s("h1", { class: "text-lg font-medium mb-2" }, "Access Denied", -1),
|
|
839
|
+
s("p", { class: "text-sm text-muted-foreground" }, "You do not have permission to view or edit resources.", -1)
|
|
840
|
+
])])),
|
|
841
|
+
e(dt, {
|
|
842
|
+
ref_key: "resourceDialogRef",
|
|
843
|
+
ref: F,
|
|
844
|
+
onAddResource: oe,
|
|
845
|
+
onUpdateResource: p,
|
|
846
|
+
onRemoveResource: t
|
|
847
|
+
}, null, 512),
|
|
848
|
+
e(Ae, {
|
|
849
|
+
open: A.value,
|
|
850
|
+
"onUpdate:open": o[2] || (o[2] = (r) => A.value = r)
|
|
851
|
+
}, {
|
|
852
|
+
default: l(() => [
|
|
853
|
+
e(ze, { class: "sm:max-w-lg" }, {
|
|
854
|
+
default: l(() => [
|
|
855
|
+
e(Se, null, {
|
|
856
|
+
default: l(() => [
|
|
857
|
+
e(he, null, {
|
|
858
|
+
default: l(() => [...o[20] || (o[20] = [
|
|
859
|
+
d("Resource Order", -1)
|
|
860
|
+
])]),
|
|
861
|
+
_: 1
|
|
862
|
+
}),
|
|
863
|
+
e(Re, { class: "sr-only" }, {
|
|
864
|
+
default: l(() => [...o[21] || (o[21] = [
|
|
865
|
+
d(" Set the saved order for bookable resources. ", -1)
|
|
866
|
+
])]),
|
|
867
|
+
_: 1
|
|
868
|
+
})
|
|
869
|
+
]),
|
|
870
|
+
_: 1
|
|
871
|
+
}),
|
|
872
|
+
s("div", Et, [
|
|
873
|
+
s("div", Ut, [
|
|
874
|
+
(c(!0), v(U, null, J(x.value, (r, y) => (c(), v("div", {
|
|
875
|
+
key: r.id,
|
|
876
|
+
class: fe(["group flex items-center gap-3 rounded-md border bg-background p-2 transition-all hover:bg-muted/40", M.value === r.id ? "opacity-50 ring-2 ring-ring" : ""]),
|
|
877
|
+
onDragover: (Y) => ne(r.id, Y),
|
|
878
|
+
onDrop: ve(K, ["prevent"])
|
|
879
|
+
}, [
|
|
880
|
+
s("div", {
|
|
881
|
+
role: "button",
|
|
882
|
+
tabindex: "0",
|
|
883
|
+
draggable: "true",
|
|
884
|
+
class: "resource-reorder-handle size-8 shrink-0 cursor-grab active:cursor-grabbing rounded-md flex items-center justify-center hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
885
|
+
"aria-label": `Drag ${r.name}`,
|
|
886
|
+
onDragstart: ve((Y) => le(r.id, Y), ["stop"]),
|
|
887
|
+
onDragend: K
|
|
888
|
+
}, [
|
|
889
|
+
e(b(He), { class: "size-4 text-muted-foreground" })
|
|
890
|
+
], 40, Ht),
|
|
891
|
+
s("div", {
|
|
892
|
+
class: "size-9 shrink-0 rounded-md flex items-center justify-center text-white text-xs font-semibold",
|
|
893
|
+
style: Z({ background: r.color || "#6b7280" })
|
|
894
|
+
}, g(r.avatarLabel || r.name.charAt(0).toUpperCase()), 5),
|
|
895
|
+
s("div", Ft, [
|
|
896
|
+
s("div", jt, [
|
|
897
|
+
s("p", Ot, g(r.name), 1),
|
|
898
|
+
r.isActive ? k("", !0) : (c(), v("span", Bt, " Inactive "))
|
|
899
|
+
]),
|
|
900
|
+
r.publicLabel && r.publicLabel !== r.name ? (c(), v("p", Yt, g(de(r)), 1)) : k("", !0)
|
|
901
|
+
]),
|
|
902
|
+
s("span", Pt, g(y + 1), 1),
|
|
903
|
+
s("div", Jt, [
|
|
904
|
+
e(f, {
|
|
905
|
+
variant: "ghost",
|
|
906
|
+
size: "icon",
|
|
907
|
+
class: "size-8",
|
|
908
|
+
disabled: y === 0,
|
|
909
|
+
"aria-label": `Move ${r.name} up`,
|
|
910
|
+
onClick: (Y) => O(y, y - 1)
|
|
911
|
+
}, {
|
|
912
|
+
default: l(() => [
|
|
913
|
+
e(b(Fe), { class: "size-4" })
|
|
914
|
+
]),
|
|
915
|
+
_: 1
|
|
916
|
+
}, 8, ["disabled", "aria-label", "onClick"]),
|
|
917
|
+
e(f, {
|
|
918
|
+
variant: "ghost",
|
|
919
|
+
size: "icon",
|
|
920
|
+
class: "size-8",
|
|
921
|
+
disabled: y === x.value.length - 1,
|
|
922
|
+
"aria-label": `Move ${r.name} down`,
|
|
923
|
+
onClick: (Y) => O(y, y + 1)
|
|
924
|
+
}, {
|
|
925
|
+
default: l(() => [
|
|
926
|
+
e(b(je), { class: "size-4" })
|
|
927
|
+
]),
|
|
928
|
+
_: 1
|
|
929
|
+
}, 8, ["disabled", "aria-label", "onClick"])
|
|
930
|
+
])
|
|
931
|
+
], 42, Nt))), 128))
|
|
932
|
+
])
|
|
933
|
+
]),
|
|
934
|
+
e(Ve, { class: "@container/reorder-footer gap-2" }, {
|
|
935
|
+
default: l(() => [
|
|
936
|
+
s("div", qt, [
|
|
937
|
+
e(f, {
|
|
938
|
+
variant: "outline",
|
|
939
|
+
class: "w-full @sm/reorder-footer:w-auto",
|
|
940
|
+
onClick: o[1] || (o[1] = (r) => A.value = !1)
|
|
941
|
+
}, {
|
|
942
|
+
default: l(() => [...o[22] || (o[22] = [
|
|
943
|
+
d(" Cancel ", -1)
|
|
944
|
+
])]),
|
|
945
|
+
_: 1
|
|
946
|
+
}),
|
|
947
|
+
e(f, {
|
|
948
|
+
class: "w-full @sm/reorder-footer:w-auto",
|
|
949
|
+
disabled: !re.value || a.value,
|
|
950
|
+
onClick: ae
|
|
951
|
+
}, {
|
|
952
|
+
default: l(() => [...o[23] || (o[23] = [
|
|
953
|
+
d(" Save Order ", -1)
|
|
954
|
+
])]),
|
|
955
|
+
_: 1
|
|
956
|
+
}, 8, ["disabled"])
|
|
957
|
+
])
|
|
958
|
+
]),
|
|
959
|
+
_: 1
|
|
960
|
+
})
|
|
961
|
+
]),
|
|
962
|
+
_: 1
|
|
963
|
+
})
|
|
964
|
+
]),
|
|
965
|
+
_: 1
|
|
966
|
+
}, 8, ["open"])
|
|
967
|
+
]),
|
|
968
|
+
_: 1
|
|
969
|
+
});
|
|
970
|
+
};
|
|
971
|
+
}
|
|
972
|
+
});
|
|
973
|
+
export {
|
|
974
|
+
Zt as default
|
|
975
|
+
};
|