@oneclick.dev/cms-core-modules 0.0.52 → 0.0.54
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-DRJFQKCv.mjs +34915 -0
- package/dist/ContentEditor-DzTi8fSZ.js +290 -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-CMzPRd18.js +17 -0
- package/dist/GlobalStyling-DoLHUJeV.mjs +988 -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 -357
- package/dist/index.mjs +287 -69281
- 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/components/edit/PaymentAddons/Addon.vue.d.ts +12 -2
- package/dist/src/appointments/index.d.ts +4 -28
- package/dist/src/appointments/routes.d.ts +3 -9
- package/dist/src/content-manager/index.d.ts +5 -147
- 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/lib/interpolation.d.ts +2 -2
- 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 +28 -29
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
import { defineComponent as W, ref as S, reactive as J, resolveComponent as a, createBlock as g, openBlock as c, withCtx as i, createVNode as t, createElementVNode as d, createTextVNode as u, createElementBlock as y, createCommentVNode as w, Fragment as j, renderList as H, toDisplayString as M, unref as C } from "vue";
|
|
2
|
+
import { _ as Y } from "./EditLayout.vue_vue_type_script_setup_true_lang-D0-EcU0_.mjs";
|
|
3
|
+
import { Pencil as Z, Eye as h, EyeOff as ee, Trash2 as te, PlusCircle as ie } from "lucide-vue-next";
|
|
4
|
+
import { useModuleRoute as oe, useModule as le, useFirebaseIntegration as ne } from "@oneclick.dev/cms-kit";
|
|
5
|
+
const se = { class: "space-y-6 py-4" }, ae = { key: 0 }, de = { key: 1 }, ue = { class: "flex items-center gap-3" }, re = { class: "w-full flex justify-between items-center" }, me = { class: "flex items-center gap-2 ml-auto" }, ce = /* @__PURE__ */ W({
|
|
6
|
+
__name: "CustomerInformationFieldEditorDialog",
|
|
7
|
+
emits: ["add-field", "update-field", "remove-field"],
|
|
8
|
+
setup(K, { expose: A, emit: T }) {
|
|
9
|
+
const N = T, v = S(!1), l = S("add"), s = J({
|
|
10
|
+
id: "",
|
|
11
|
+
fieldName: "",
|
|
12
|
+
fieldDescription: "",
|
|
13
|
+
fieldType: "text",
|
|
14
|
+
required: !1,
|
|
15
|
+
isNativeField: !1,
|
|
16
|
+
visible: !0,
|
|
17
|
+
options: []
|
|
18
|
+
}), D = [
|
|
19
|
+
{ value: "text", label: "Text Box" },
|
|
20
|
+
{ value: "checkbox", label: "Checkbox" },
|
|
21
|
+
{ value: "radio", label: "Radio Button" },
|
|
22
|
+
{ value: "select", label: "Select" }
|
|
23
|
+
], k = (f) => {
|
|
24
|
+
l.value = f ? "edit" : "add", s.id = f?.id || "", s.fieldName = f?.fieldName || "", s.fieldDescription = f?.fieldDescription || "", s.fieldType = f?.fieldType || "text", s.required = f?.required || !1, s.isNativeField = f?.isNativeField || !1, s.options = f?.options || [], s.visible = f?.visible !== void 0 ? f.visible : !0, v.value = !0;
|
|
25
|
+
}, L = () => {
|
|
26
|
+
v.value = !1;
|
|
27
|
+
}, R = () => {
|
|
28
|
+
N("add-field", { ...s }), v.value = !1;
|
|
29
|
+
}, U = () => {
|
|
30
|
+
N("update-field", { ...s }), v.value = !1;
|
|
31
|
+
}, $ = () => {
|
|
32
|
+
N("remove-field", s.id), v.value = !1;
|
|
33
|
+
};
|
|
34
|
+
return A({
|
|
35
|
+
openDialog: k
|
|
36
|
+
}), (f, n) => {
|
|
37
|
+
const o = a("DialogTitle"), e = a("DialogHeader"), p = a("Label"), b = a("Input"), B = a("SelectValue"), x = a("SelectTrigger"), P = a("SelectItem"), E = a("SelectContent"), V = a("Select"), q = a("TagsInputItemText"), z = a("TagsInputItemDelete"), G = a("TagsInputItem"), F = a("TagsInputInput"), _ = a("TagsInput"), r = a("Checkbox"), I = a("Button"), O = a("DialogFooter"), Q = a("DialogScrollContent"), X = a("Dialog");
|
|
38
|
+
return c(), g(X, {
|
|
39
|
+
open: v.value,
|
|
40
|
+
"onUpdate:open": n[5] || (n[5] = (m) => v.value = m)
|
|
41
|
+
}, {
|
|
42
|
+
default: i(() => [
|
|
43
|
+
t(Q, { class: "sm:max-w-2xl" }, {
|
|
44
|
+
default: i(() => [
|
|
45
|
+
t(e, null, {
|
|
46
|
+
default: i(() => [
|
|
47
|
+
t(o, null, {
|
|
48
|
+
default: i(() => [...n[6] || (n[6] = [
|
|
49
|
+
u("Customer Information", -1)
|
|
50
|
+
])]),
|
|
51
|
+
_: 1
|
|
52
|
+
})
|
|
53
|
+
]),
|
|
54
|
+
_: 1
|
|
55
|
+
}),
|
|
56
|
+
d("div", se, [
|
|
57
|
+
d("div", null, [
|
|
58
|
+
t(p, {
|
|
59
|
+
class: "text-bsmase font-normal mb-1.5",
|
|
60
|
+
for: "customer-info-field-dialog-fieldname"
|
|
61
|
+
}, {
|
|
62
|
+
default: i(() => [...n[7] || (n[7] = [
|
|
63
|
+
u("Field Name", -1)
|
|
64
|
+
])]),
|
|
65
|
+
_: 1
|
|
66
|
+
}),
|
|
67
|
+
t(b, {
|
|
68
|
+
modelValue: s.fieldName,
|
|
69
|
+
"onUpdate:modelValue": n[0] || (n[0] = (m) => s.fieldName = m),
|
|
70
|
+
id: "customer-info-field-dialog-fieldname"
|
|
71
|
+
}, null, 8, ["modelValue"])
|
|
72
|
+
]),
|
|
73
|
+
d("div", null, [
|
|
74
|
+
t(p, {
|
|
75
|
+
class: "text-sm font-normal mb-1.5",
|
|
76
|
+
for: "customer-info-field-dialog-field-description"
|
|
77
|
+
}, {
|
|
78
|
+
default: i(() => [...n[8] || (n[8] = [
|
|
79
|
+
u("Field Description", -1)
|
|
80
|
+
])]),
|
|
81
|
+
_: 1
|
|
82
|
+
}),
|
|
83
|
+
t(b, {
|
|
84
|
+
modelValue: s.fieldDescription,
|
|
85
|
+
"onUpdate:modelValue": n[1] || (n[1] = (m) => s.fieldDescription = m),
|
|
86
|
+
id: "customer-info-field-dialog-field-description"
|
|
87
|
+
}, null, 8, ["modelValue"])
|
|
88
|
+
]),
|
|
89
|
+
s.isNativeField ? w("", !0) : (c(), y("div", ae, [
|
|
90
|
+
t(p, { class: "text-sm font-normal mb-1.5" }, {
|
|
91
|
+
default: i(() => [...n[9] || (n[9] = [
|
|
92
|
+
u("Field Type", -1)
|
|
93
|
+
])]),
|
|
94
|
+
_: 1
|
|
95
|
+
}),
|
|
96
|
+
t(V, {
|
|
97
|
+
modelValue: s.fieldType,
|
|
98
|
+
"onUpdate:modelValue": n[2] || (n[2] = (m) => s.fieldType = m)
|
|
99
|
+
}, {
|
|
100
|
+
default: i(() => [
|
|
101
|
+
t(x, null, {
|
|
102
|
+
default: i(() => [
|
|
103
|
+
t(B, { placeholder: "Select field type" })
|
|
104
|
+
]),
|
|
105
|
+
_: 1
|
|
106
|
+
}),
|
|
107
|
+
t(E, null, {
|
|
108
|
+
default: i(() => [
|
|
109
|
+
(c(), y(j, null, H(D, (m) => t(P, {
|
|
110
|
+
key: m.value,
|
|
111
|
+
value: m.value
|
|
112
|
+
}, {
|
|
113
|
+
default: i(() => [
|
|
114
|
+
u(M(m.label), 1)
|
|
115
|
+
]),
|
|
116
|
+
_: 2
|
|
117
|
+
}, 1032, ["value"])), 64))
|
|
118
|
+
]),
|
|
119
|
+
_: 1
|
|
120
|
+
})
|
|
121
|
+
]),
|
|
122
|
+
_: 1
|
|
123
|
+
}, 8, ["modelValue"])
|
|
124
|
+
])),
|
|
125
|
+
s.fieldType === "select" || s.fieldType === "radio" ? (c(), y("div", de, [
|
|
126
|
+
t(p, {
|
|
127
|
+
class: "text-sm font-normal mb-1.5",
|
|
128
|
+
for: "customer-info-field-dialog-field-new-option"
|
|
129
|
+
}, {
|
|
130
|
+
default: i(() => [...n[10] || (n[10] = [
|
|
131
|
+
u("Options", -1)
|
|
132
|
+
])]),
|
|
133
|
+
_: 1
|
|
134
|
+
}),
|
|
135
|
+
t(_, {
|
|
136
|
+
modelValue: s.options,
|
|
137
|
+
"onUpdate:modelValue": n[3] || (n[3] = (m) => s.options = m)
|
|
138
|
+
}, {
|
|
139
|
+
default: i(() => [
|
|
140
|
+
(c(!0), y(j, null, H(s.options, (m) => (c(), g(G, {
|
|
141
|
+
key: m,
|
|
142
|
+
value: m
|
|
143
|
+
}, {
|
|
144
|
+
default: i(() => [
|
|
145
|
+
t(q),
|
|
146
|
+
t(z)
|
|
147
|
+
]),
|
|
148
|
+
_: 1
|
|
149
|
+
}, 8, ["value"]))), 128)),
|
|
150
|
+
t(F, {
|
|
151
|
+
placeholder: "New option...",
|
|
152
|
+
id: "customer-info-field-dialog-field-new-option"
|
|
153
|
+
})
|
|
154
|
+
]),
|
|
155
|
+
_: 1
|
|
156
|
+
}, 8, ["modelValue"])
|
|
157
|
+
])) : w("", !0),
|
|
158
|
+
d("div", ue, [
|
|
159
|
+
t(r, {
|
|
160
|
+
id: "customer-info-field-dialog-field-required",
|
|
161
|
+
modelValue: s.required,
|
|
162
|
+
"onUpdate:modelValue": n[4] || (n[4] = (m) => s.required = m)
|
|
163
|
+
}, null, 8, ["modelValue"]),
|
|
164
|
+
t(p, {
|
|
165
|
+
for: "customer-info-field-dialog-field-required",
|
|
166
|
+
class: "text-base font-normal cursor-pointer"
|
|
167
|
+
}, {
|
|
168
|
+
default: i(() => [...n[11] || (n[11] = [
|
|
169
|
+
u(" Is this field mandatory? ", -1)
|
|
170
|
+
])]),
|
|
171
|
+
_: 1
|
|
172
|
+
})
|
|
173
|
+
])
|
|
174
|
+
]),
|
|
175
|
+
t(O, { class: "gap-2" }, {
|
|
176
|
+
default: i(() => [
|
|
177
|
+
d("div", re, [
|
|
178
|
+
l.value === "edit" && !s.isNativeField ? (c(), g(I, {
|
|
179
|
+
key: 0,
|
|
180
|
+
variant: "destructive",
|
|
181
|
+
onClick: $
|
|
182
|
+
}, {
|
|
183
|
+
default: i(() => [...n[12] || (n[12] = [
|
|
184
|
+
u(" Remove Field ", -1)
|
|
185
|
+
])]),
|
|
186
|
+
_: 1
|
|
187
|
+
})) : w("", !0),
|
|
188
|
+
d("div", me, [
|
|
189
|
+
t(I, {
|
|
190
|
+
variant: "outline",
|
|
191
|
+
onClick: L
|
|
192
|
+
}, {
|
|
193
|
+
default: i(() => [...n[13] || (n[13] = [
|
|
194
|
+
u(" Cancel ", -1)
|
|
195
|
+
])]),
|
|
196
|
+
_: 1
|
|
197
|
+
}),
|
|
198
|
+
l.value === "add" ? (c(), g(I, {
|
|
199
|
+
key: 0,
|
|
200
|
+
onClick: R
|
|
201
|
+
}, {
|
|
202
|
+
default: i(() => [...n[14] || (n[14] = [
|
|
203
|
+
u(" Add Field ", -1)
|
|
204
|
+
])]),
|
|
205
|
+
_: 1
|
|
206
|
+
})) : (c(), g(I, {
|
|
207
|
+
key: 1,
|
|
208
|
+
onClick: U
|
|
209
|
+
}, {
|
|
210
|
+
default: i(() => [...n[15] || (n[15] = [
|
|
211
|
+
u(" Update Field ", -1)
|
|
212
|
+
])]),
|
|
213
|
+
_: 1
|
|
214
|
+
}))
|
|
215
|
+
])
|
|
216
|
+
])
|
|
217
|
+
]),
|
|
218
|
+
_: 1
|
|
219
|
+
})
|
|
220
|
+
]),
|
|
221
|
+
_: 1
|
|
222
|
+
})
|
|
223
|
+
]),
|
|
224
|
+
_: 1
|
|
225
|
+
}, 8, ["open"]);
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
}), pe = {
|
|
229
|
+
key: 0,
|
|
230
|
+
class: "max-w-2xl"
|
|
231
|
+
}, fe = {
|
|
232
|
+
key: 0,
|
|
233
|
+
class: "text-sm text-orange-500 mt-2"
|
|
234
|
+
}, ve = { class: "border rounded-md p-4 mb-4" }, ge = { class: "font-medium text-sm" }, ye = { class: "flex justify-start mt-8" }, Ne = /* @__PURE__ */ W({
|
|
235
|
+
__name: "availability",
|
|
236
|
+
setup(K) {
|
|
237
|
+
const { params: A } = oe(), { config: T } = le(), N = ne(T.project), v = [
|
|
238
|
+
{
|
|
239
|
+
id: "1",
|
|
240
|
+
fieldName: "First Name",
|
|
241
|
+
fieldType: "text",
|
|
242
|
+
required: !0,
|
|
243
|
+
visible: !0,
|
|
244
|
+
isNativeField: !0
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
id: "2",
|
|
248
|
+
fieldName: "Last Name",
|
|
249
|
+
fieldType: "text",
|
|
250
|
+
required: !0,
|
|
251
|
+
visible: !0,
|
|
252
|
+
isNativeField: !0
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
id: "3",
|
|
256
|
+
fieldName: "Phone No",
|
|
257
|
+
fieldType: "tel",
|
|
258
|
+
required: !0,
|
|
259
|
+
visible: !0,
|
|
260
|
+
isNativeField: !0
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
id: "4",
|
|
264
|
+
fieldName: "Email",
|
|
265
|
+
fieldType: "email",
|
|
266
|
+
required: !0,
|
|
267
|
+
visible: !0,
|
|
268
|
+
isNativeField: !0
|
|
269
|
+
}
|
|
270
|
+
], l = J({
|
|
271
|
+
minimumAdvanceNotice: {
|
|
272
|
+
value: 0,
|
|
273
|
+
unit: "minutes"
|
|
274
|
+
},
|
|
275
|
+
serviceVisibility: 60,
|
|
276
|
+
capacity: "",
|
|
277
|
+
maxTicketsPerReservation: "",
|
|
278
|
+
customerInformationFields: [...v]
|
|
279
|
+
}), s = S(!1), D = S(!0), k = S(null), L = async () => {
|
|
280
|
+
s.value = !0;
|
|
281
|
+
try {
|
|
282
|
+
const o = A.value.id;
|
|
283
|
+
if (!o) throw new Error("Missing agenda ID");
|
|
284
|
+
await N.update(T.agendaCollection, o, {
|
|
285
|
+
minimumAdvanceNotice: {
|
|
286
|
+
value: Number(l.minimumAdvanceNotice?.value) || 0,
|
|
287
|
+
unit: l.minimumAdvanceNotice?.unit ?? "minutes"
|
|
288
|
+
},
|
|
289
|
+
serviceVisibility: Math.max(Number(l.serviceVisibility) || 1, 1),
|
|
290
|
+
capacity: Math.max(Number(l.capacity) || 0, 0),
|
|
291
|
+
maxTicketsPerReservation: Math.max(Number(l.maxTicketsPerReservation) || 0, 0),
|
|
292
|
+
customerInformationFields: l.customerInformationFields ?? []
|
|
293
|
+
});
|
|
294
|
+
} catch (o) {
|
|
295
|
+
console.error("Error saving changes:", o);
|
|
296
|
+
} finally {
|
|
297
|
+
s.value = !1;
|
|
298
|
+
}
|
|
299
|
+
}, R = async (o) => {
|
|
300
|
+
delete o.isNativeField, o.fieldType !== "radio" && o.fieldType !== "select" && delete o.options;
|
|
301
|
+
let e = Math.random().toString(36).substr(2, 9);
|
|
302
|
+
for (; l.customerInformationFields.find((p) => p.id === e); )
|
|
303
|
+
e = Math.random().toString(36).substr(2, 9);
|
|
304
|
+
l.customerInformationFields.push({ ...o, id: e });
|
|
305
|
+
}, U = async (o) => {
|
|
306
|
+
o.isNativeField || delete o.isNativeField, o.fieldType !== "radio" && o.fieldType !== "select" && delete o.options;
|
|
307
|
+
const e = l.customerInformationFields.findIndex((p) => p.id === o.id);
|
|
308
|
+
e !== -1 && (l.customerInformationFields[e] = { ...o });
|
|
309
|
+
}, $ = async (o) => {
|
|
310
|
+
l.customerInformationFields = l.customerInformationFields.filter((e) => e.id !== o);
|
|
311
|
+
}, f = async () => {
|
|
312
|
+
try {
|
|
313
|
+
const o = await N.get(T.agendaCollection, A.value.id);
|
|
314
|
+
o && (console.log("Loaded agenda data:", o), l.minimumAdvanceNotice = o.minimumAdvanceNotice || { value: 0, unit: "minutes" }, l.serviceVisibility = o.serviceVisibility || 60, l.capacity = Number(o.capacity) && o.capacity > 0 ? parseInt(o.capacity) : "", l.maxTicketsPerReservation = Number(o.maxTicketsPerReservation) && o.maxTicketsPerReservation > 0 ? parseInt(o.maxTicketsPerReservation) : "", l.customerInformationFields = o.customerInformationFields || [...v]);
|
|
315
|
+
} catch (o) {
|
|
316
|
+
console.error("Error loading agenda data:", o);
|
|
317
|
+
} finally {
|
|
318
|
+
D.value = !1;
|
|
319
|
+
}
|
|
320
|
+
}, n = () => {
|
|
321
|
+
let o = Math.abs(l.minimumAdvanceNotice.value), e = l.minimumAdvanceNotice.unit;
|
|
322
|
+
return o === 1 ? (e.endsWith("s") && (e = e.slice(0, -1)), `Lead time is negative. Bookings remain open for 1 ${e} after the slot has started.`) : `Lead time is negative. Bookings remain open for ${o} ${e} after the slot has started.`;
|
|
323
|
+
};
|
|
324
|
+
return f(), (o, e) => {
|
|
325
|
+
const p = a("Label"), b = a("InputGroupInput"), B = a("Search"), x = a("InputGroupAddon"), P = a("SelectValue"), E = a("SelectTrigger"), V = a("SelectItem"), q = a("SelectGroup"), z = a("SelectContent"), G = a("Select"), F = a("InputGroup"), _ = a("Button");
|
|
326
|
+
return c(), g(Y, null, {
|
|
327
|
+
default: i(() => [
|
|
328
|
+
e[28] || (e[28] = d("h1", { class: "text-lg font-medium mb-8" }, "Availability Settings", -1)),
|
|
329
|
+
D.value ? w("", !0) : (c(), y("div", pe, [
|
|
330
|
+
d("div", null, [
|
|
331
|
+
t(p, {
|
|
332
|
+
for: "lead-time",
|
|
333
|
+
class: "text-base font-medium mb-2"
|
|
334
|
+
}, {
|
|
335
|
+
default: i(() => [...e[7] || (e[7] = [
|
|
336
|
+
u(" Minimum Advance Notice - Lead Time (Optional) ", -1)
|
|
337
|
+
])]),
|
|
338
|
+
_: 1
|
|
339
|
+
}),
|
|
340
|
+
t(F, { class: "max-w-md" }, {
|
|
341
|
+
default: i(() => [
|
|
342
|
+
t(b, {
|
|
343
|
+
placeholder: "0",
|
|
344
|
+
id: "lead-time",
|
|
345
|
+
modelValue: l.minimumAdvanceNotice.value,
|
|
346
|
+
"onUpdate:modelValue": e[0] || (e[0] = (r) => l.minimumAdvanceNotice.value = r),
|
|
347
|
+
modelModifiers: { value: !0 },
|
|
348
|
+
type: "number",
|
|
349
|
+
class: "no-spinner"
|
|
350
|
+
}, null, 8, ["modelValue"]),
|
|
351
|
+
t(x, null, {
|
|
352
|
+
default: i(() => [
|
|
353
|
+
t(B)
|
|
354
|
+
]),
|
|
355
|
+
_: 1
|
|
356
|
+
}),
|
|
357
|
+
t(x, { align: "inline-end" }, {
|
|
358
|
+
default: i(() => [
|
|
359
|
+
t(G, {
|
|
360
|
+
modelValue: l.minimumAdvanceNotice.unit,
|
|
361
|
+
"onUpdate:modelValue": e[1] || (e[1] = (r) => l.minimumAdvanceNotice.unit = r)
|
|
362
|
+
}, {
|
|
363
|
+
default: i(() => [
|
|
364
|
+
t(E, { class: "w-[180px] border-0 bg-transparent -mr-1.5" }, {
|
|
365
|
+
default: i(() => [
|
|
366
|
+
t(P)
|
|
367
|
+
]),
|
|
368
|
+
_: 1
|
|
369
|
+
}),
|
|
370
|
+
t(z, null, {
|
|
371
|
+
default: i(() => [
|
|
372
|
+
t(q, null, {
|
|
373
|
+
default: i(() => [
|
|
374
|
+
t(V, { value: "minutes" }, {
|
|
375
|
+
default: i(() => [...e[8] || (e[8] = [
|
|
376
|
+
u(" Minutes ", -1)
|
|
377
|
+
])]),
|
|
378
|
+
_: 1
|
|
379
|
+
}),
|
|
380
|
+
t(V, { value: "hours" }, {
|
|
381
|
+
default: i(() => [...e[9] || (e[9] = [
|
|
382
|
+
u(" Hours ", -1)
|
|
383
|
+
])]),
|
|
384
|
+
_: 1
|
|
385
|
+
}),
|
|
386
|
+
t(V, { value: "days" }, {
|
|
387
|
+
default: i(() => [...e[10] || (e[10] = [
|
|
388
|
+
u(" Days ", -1)
|
|
389
|
+
])]),
|
|
390
|
+
_: 1
|
|
391
|
+
})
|
|
392
|
+
]),
|
|
393
|
+
_: 1
|
|
394
|
+
})
|
|
395
|
+
]),
|
|
396
|
+
_: 1
|
|
397
|
+
})
|
|
398
|
+
]),
|
|
399
|
+
_: 1
|
|
400
|
+
}, 8, ["modelValue"])
|
|
401
|
+
]),
|
|
402
|
+
_: 1
|
|
403
|
+
})
|
|
404
|
+
]),
|
|
405
|
+
_: 1
|
|
406
|
+
}),
|
|
407
|
+
e[11] || (e[11] = d("p", { class: "text-sm text-muted-foreground mt-2" }, " Set how far in advance a customer must book your slot. ", -1)),
|
|
408
|
+
l.minimumAdvanceNotice.value < 0 ? (c(), y("p", fe, M(n()), 1)) : w("", !0)
|
|
409
|
+
]),
|
|
410
|
+
e[24] || (e[24] = d("hr", { class: "my-8" }, null, -1)),
|
|
411
|
+
d("div", null, [
|
|
412
|
+
t(p, {
|
|
413
|
+
for: "service-visibility",
|
|
414
|
+
class: "text-base font-medium mb-2"
|
|
415
|
+
}, {
|
|
416
|
+
default: i(() => [...e[12] || (e[12] = [
|
|
417
|
+
u(" Service Visibility ", -1)
|
|
418
|
+
])]),
|
|
419
|
+
_: 1
|
|
420
|
+
}),
|
|
421
|
+
t(F, { class: "max-w-md" }, {
|
|
422
|
+
default: i(() => [
|
|
423
|
+
t(b, {
|
|
424
|
+
id: "service-visibility",
|
|
425
|
+
modelValue: l.serviceVisibility,
|
|
426
|
+
"onUpdate:modelValue": e[2] || (e[2] = (r) => l.serviceVisibility = r),
|
|
427
|
+
modelModifiers: { number: !0 },
|
|
428
|
+
placeholder: "1",
|
|
429
|
+
type: "number",
|
|
430
|
+
class: "no-spinner",
|
|
431
|
+
min: "1",
|
|
432
|
+
onBlur: e[3] || (e[3] = (r) => l.serviceVisibility = Math.max(l.serviceVisibility, 1))
|
|
433
|
+
}, null, 8, ["modelValue"]),
|
|
434
|
+
t(x, { align: "inline-end" }, {
|
|
435
|
+
default: i(() => [...e[13] || (e[13] = [
|
|
436
|
+
u(" days ", -1)
|
|
437
|
+
])]),
|
|
438
|
+
_: 1
|
|
439
|
+
})
|
|
440
|
+
]),
|
|
441
|
+
_: 1
|
|
442
|
+
}),
|
|
443
|
+
e[14] || (e[14] = d("p", { class: "text-sm text-muted-foreground mt-2" }, " Set how many days in advance the service is visible to customers. ", -1))
|
|
444
|
+
]),
|
|
445
|
+
e[25] || (e[25] = d("hr", { class: "my-8" }, null, -1)),
|
|
446
|
+
d("div", null, [
|
|
447
|
+
t(p, {
|
|
448
|
+
for: "capacity",
|
|
449
|
+
class: "text-base font-medium mb-2"
|
|
450
|
+
}, {
|
|
451
|
+
default: i(() => [...e[15] || (e[15] = [
|
|
452
|
+
u(" Default Capacity ", -1)
|
|
453
|
+
])]),
|
|
454
|
+
_: 1
|
|
455
|
+
}),
|
|
456
|
+
t(F, { class: "max-w-md" }, {
|
|
457
|
+
default: i(() => [
|
|
458
|
+
t(b, {
|
|
459
|
+
placeholder: "∞",
|
|
460
|
+
type: "number",
|
|
461
|
+
id: "capacity",
|
|
462
|
+
class: "no-spinner",
|
|
463
|
+
min: "1",
|
|
464
|
+
modelValue: l.capacity,
|
|
465
|
+
"onUpdate:modelValue": e[4] || (e[4] = (r) => l.capacity = r),
|
|
466
|
+
modelModifiers: { number: !0 }
|
|
467
|
+
}, null, 8, ["modelValue"]),
|
|
468
|
+
t(x, { align: "inline-end" }, {
|
|
469
|
+
default: i(() => [...e[16] || (e[16] = [
|
|
470
|
+
u(" available spots ", -1)
|
|
471
|
+
])]),
|
|
472
|
+
_: 1
|
|
473
|
+
})
|
|
474
|
+
]),
|
|
475
|
+
_: 1
|
|
476
|
+
}),
|
|
477
|
+
e[17] || (e[17] = d("p", { class: "text-sm text-muted-foreground mt-2" }, " Default number of bookings per time slot. Individual resources can override this with their own capacity. ", -1))
|
|
478
|
+
]),
|
|
479
|
+
e[26] || (e[26] = d("hr", { class: "my-8" }, null, -1)),
|
|
480
|
+
d("div", null, [
|
|
481
|
+
t(p, {
|
|
482
|
+
for: "max-capacity",
|
|
483
|
+
class: "text-base font-medium mb-2"
|
|
484
|
+
}, {
|
|
485
|
+
default: i(() => [...e[18] || (e[18] = [
|
|
486
|
+
u(" Maximum Tickets Per Booking ", -1)
|
|
487
|
+
])]),
|
|
488
|
+
_: 1
|
|
489
|
+
}),
|
|
490
|
+
t(F, { class: "max-w-md" }, {
|
|
491
|
+
default: i(() => [
|
|
492
|
+
t(b, {
|
|
493
|
+
placeholder: "∞",
|
|
494
|
+
type: "number",
|
|
495
|
+
id: "max-capacity",
|
|
496
|
+
class: "no-spinner",
|
|
497
|
+
min: "1",
|
|
498
|
+
modelValue: l.maxTicketsPerReservation,
|
|
499
|
+
"onUpdate:modelValue": e[5] || (e[5] = (r) => l.maxTicketsPerReservation = r),
|
|
500
|
+
modelModifiers: { number: !0 }
|
|
501
|
+
}, null, 8, ["modelValue"]),
|
|
502
|
+
t(x, { align: "inline-end" }, {
|
|
503
|
+
default: i(() => [...e[19] || (e[19] = [
|
|
504
|
+
u(" spots ", -1)
|
|
505
|
+
])]),
|
|
506
|
+
_: 1
|
|
507
|
+
})
|
|
508
|
+
]),
|
|
509
|
+
_: 1
|
|
510
|
+
}),
|
|
511
|
+
e[20] || (e[20] = d("p", { class: "text-sm text-muted-foreground mt-2" }, " Limit how many spots a customer can book in a single reservation. ", -1))
|
|
512
|
+
]),
|
|
513
|
+
e[27] || (e[27] = d("hr", { class: "my-8" }, null, -1)),
|
|
514
|
+
d("div", null, [
|
|
515
|
+
t(p, { class: "text-base font-medium" }, {
|
|
516
|
+
default: i(() => [...e[21] || (e[21] = [
|
|
517
|
+
u(" Customer Information (Optional) ", -1)
|
|
518
|
+
])]),
|
|
519
|
+
_: 1
|
|
520
|
+
}),
|
|
521
|
+
e[23] || (e[23] = d("p", { class: "text-sm text-muted-foreground mb-2" }, " Collect additional details about your customer. ", -1)),
|
|
522
|
+
d("div", ve, [
|
|
523
|
+
(c(!0), y(j, null, H(l.customerInformationFields, (r) => (c(), y("div", {
|
|
524
|
+
key: r.id,
|
|
525
|
+
class: "flex items-center justify-between hover:bg-input/50 px-2 rounded"
|
|
526
|
+
}, [
|
|
527
|
+
d("div", null, [
|
|
528
|
+
d("p", ge, M(r.fieldName), 1)
|
|
529
|
+
]),
|
|
530
|
+
d("div", null, [
|
|
531
|
+
t(_, {
|
|
532
|
+
variant: "ghost",
|
|
533
|
+
size: "icon",
|
|
534
|
+
onClick: (I) => k.value.openDialog(r),
|
|
535
|
+
class: "active:scale-90 transition-transform duration-150"
|
|
536
|
+
}, {
|
|
537
|
+
default: i(() => [
|
|
538
|
+
t(C(Z), { class: "size-4" })
|
|
539
|
+
]),
|
|
540
|
+
_: 1
|
|
541
|
+
}, 8, ["onClick"]),
|
|
542
|
+
t(_, {
|
|
543
|
+
variant: "ghost",
|
|
544
|
+
size: "icon",
|
|
545
|
+
onClick: (I) => r.visible = !r.visible,
|
|
546
|
+
class: "active:scale-90 transition-transform duration-150"
|
|
547
|
+
}, {
|
|
548
|
+
default: i(() => [
|
|
549
|
+
r.visible ? (c(), g(C(h), {
|
|
550
|
+
key: 0,
|
|
551
|
+
class: "size-4"
|
|
552
|
+
})) : (c(), g(C(ee), {
|
|
553
|
+
key: 1,
|
|
554
|
+
class: "size-4"
|
|
555
|
+
}))
|
|
556
|
+
]),
|
|
557
|
+
_: 2
|
|
558
|
+
}, 1032, ["onClick"]),
|
|
559
|
+
t(_, {
|
|
560
|
+
variant: "ghost",
|
|
561
|
+
size: "icon",
|
|
562
|
+
disabled: r.isNativeField,
|
|
563
|
+
onClick: (I) => l.customerInformationFields = l.customerInformationFields.filter((O) => O.id !== r.id),
|
|
564
|
+
class: "active:scale-90 transition-transform duration-150"
|
|
565
|
+
}, {
|
|
566
|
+
default: i(() => [
|
|
567
|
+
t(C(te), { class: "size-4" })
|
|
568
|
+
]),
|
|
569
|
+
_: 1
|
|
570
|
+
}, 8, ["disabled", "onClick"])
|
|
571
|
+
])
|
|
572
|
+
]))), 128)),
|
|
573
|
+
t(_, {
|
|
574
|
+
variant: "outline",
|
|
575
|
+
class: "mt-4",
|
|
576
|
+
onClick: e[6] || (e[6] = (r) => k.value.openDialog())
|
|
577
|
+
}, {
|
|
578
|
+
default: i(() => [
|
|
579
|
+
t(C(ie), { class: "size-4" }),
|
|
580
|
+
e[22] || (e[22] = u(" Add New Field ", -1))
|
|
581
|
+
]),
|
|
582
|
+
_: 1
|
|
583
|
+
})
|
|
584
|
+
]),
|
|
585
|
+
t(ce, {
|
|
586
|
+
ref_key: "customerInfoFieldDialog",
|
|
587
|
+
ref: k,
|
|
588
|
+
onAddField: R,
|
|
589
|
+
onUpdateField: U,
|
|
590
|
+
onRemoveField: $
|
|
591
|
+
}, null, 512)
|
|
592
|
+
]),
|
|
593
|
+
d("div", ye, [
|
|
594
|
+
t(_, {
|
|
595
|
+
onClick: L,
|
|
596
|
+
disabled: s.value
|
|
597
|
+
}, {
|
|
598
|
+
default: i(() => [
|
|
599
|
+
u(M(s.value ? "Saving..." : "Save Changes"), 1)
|
|
600
|
+
]),
|
|
601
|
+
_: 1
|
|
602
|
+
}, 8, ["disabled"])
|
|
603
|
+
])
|
|
604
|
+
]))
|
|
605
|
+
]),
|
|
606
|
+
_: 1
|
|
607
|
+
});
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
});
|
|
611
|
+
export {
|
|
612
|
+
Ne as default
|
|
613
|
+
};
|