@oneclick.dev/cms-core-modules 0.0.105 → 0.0.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Acquisition-CPlZzUBo.mjs → Acquisition-B2pM5vSp.mjs} +2 -2
- package/dist/{Acquisition-Br1Pfny3.js → Acquisition-Dt2rREU8.js} +1 -1
- package/dist/{Audience-BfkrmBuQ.js → Audience-Bs7b0TNm.js} +1 -1
- package/dist/{Audience-DTblSAiL.mjs → Audience-VLnUsQvW.mjs} +2 -2
- package/dist/{ContentEditor-B1nfKG_5.mjs → ContentEditor-BNLEv-qJ.mjs} +3119 -3098
- package/dist/{ContentEditor-DdFU8piH.js → ContentEditor-BUvvqfG1.js} +36 -36
- package/dist/{Create-qPeQxkdl.js → Create-89z41K73.js} +1 -1
- package/dist/{Create-BRBh0xjM.mjs → Create-Cn_Eufga.mjs} +5 -1
- package/dist/{Entries-C8UJkrVC.mjs → Entries-BdhUyJR5.mjs} +1 -1
- package/dist/{Entries-BaS6H6ak.js → Entries-CEXM_SkO.js} +1 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-Ceoje52V.js +1 -0
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-DMGcRmm-.mjs +1255 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-COrK1j0S.js +1 -0
- package/dist/OrderDetailDialog.vue_vue_type_script_setup_true_lang-Vb3q8EVv.mjs +330 -0
- package/dist/{Overview-CpHhuiaV.js → Overview-Bn1Xx3_j.js} +1 -1
- package/dist/{Overview-BrCwozey.js → Overview-DC9io1bk.js} +1 -1
- package/dist/Overview-Di84CsR5.mjs +476 -0
- package/dist/Overview-UoZHUMUz.js +1 -0
- package/dist/{Overview-kaMhsIUq.mjs → Overview-ejh4vUMT.mjs} +3 -3
- package/dist/{Overview-D_T3K6aq.mjs → Overview-lWAyyenp.mjs} +1 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CuwREvXD.js +349 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-GYNZ_yhD.mjs +3077 -0
- package/dist/{SeoHealth-BzcWd_w7.mjs → SeoHealth-DsbVdd2l.mjs} +3 -3
- package/dist/SeoHealth-az1YuNF2.js +1 -0
- package/dist/{TableView-DXmEF6pY.mjs → TableView-Bm6HaRHm.mjs} +1 -1
- package/dist/{TableView-CPAw3h8g.js → TableView-DQW0A1oG.js} +1 -1
- package/dist/agenda-IOqtALWf.js +1 -0
- package/dist/agenda-neyeLWv-.mjs +1165 -0
- package/dist/cms-core-modules.css +1 -1
- package/dist/{index-C4YUVWzJ.js → index-A2kp8Isi.js} +6 -6
- package/dist/{index-BuzLn4Km.js → index-B5aBwdxY.js} +2 -2
- package/dist/{index-p5Uqu8c2.mjs → index-BRdCrvcz.mjs} +52 -47
- package/dist/{index-D3L8WAJI.js → index-BiT55eU0.js} +2 -2
- package/dist/{index-CMk3uhUt.mjs → index-Bvxc5xv_.mjs} +153 -147
- package/dist/{index-DQYBP8Js.js → index-G7cIlnGN.js} +4 -4
- package/dist/{index-DjDCYQ_6.mjs → index-X6LV64jK.mjs} +102 -101
- package/dist/{index-_2lRVt_k.mjs → index-uOkqO74I.mjs} +105 -107
- package/dist/index-unsDfNYv.mjs +1187 -0
- package/dist/index-vHmvbEwa.js +35 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +14 -14
- package/dist/interpolation-CHn59tIC.js +1 -0
- package/dist/interpolation-w7IRDJwK.mjs +180 -0
- package/dist/orders-C65SlpJy.mjs +618 -0
- package/dist/orders-XVzWAgG1.js +1 -0
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +11 -2
- package/dist/src/appointments/components/edit/EventDialog/OrderDetailDialog.vue.d.ts +55 -0
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +6 -1
- package/dist/src/appointments/components/edit/NewReservationDialog/CustomerInformation.vue.d.ts +10 -0
- package/dist/src/appointments/components/edit/NewReservationDialog/NewReservationDialog.vue.d.ts +25 -1
- package/dist/src/appointments/components/edit/NewReservationDialog/QuickReservationAdder.vue.d.ts +26 -0
- package/dist/src/appointments/components/edit/NewReservationDialog/ReservationLines.vue.d.ts +31 -0
- package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +3 -1
- package/dist/src/appointments/composables/useHorizontalScroll.d.ts +20 -0
- package/dist/src/lib/interpolation.d.ts +6 -0
- package/package.json +2 -2
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-9Q7TMm4u.mjs +0 -401
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-DiNzGl-q.js +0 -1
- package/dist/Overview-BYMrsZjM.mjs +0 -332
- package/dist/Overview-t0pG5xjA.js +0 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cz_22Oce.mjs +0 -2927
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-DPPNc-Z5.js +0 -349
- package/dist/SeoHealth-09sEOu3G.js +0 -1
- package/dist/agenda-BNG05SAq.js +0 -1
- package/dist/agenda-D1RxMxBS.mjs +0 -1152
- package/dist/index-BtujSJeg.js +0 -35
- package/dist/index-dOdMm1pV.mjs +0 -1105
- package/dist/interpolation-DEDSLETn.mjs +0 -128
- package/dist/interpolation-DERg6Lwt.js +0 -1
- package/dist/orders-CzzcFQha.mjs +0 -559
- package/dist/orders-ETtbA4aQ.js +0 -1
- package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +0 -110
- package/dist/src/appointments/pages/edit/orders.vue.d.ts +0 -98
|
@@ -1,332 +0,0 @@
|
|
|
1
|
-
import { defineComponent as K, ref as D, resolveComponent as i, openBlock as l, createElementBlock as f, Fragment as V, createElementVNode as p, createVNode as t, createBlock as g, withCtx as n, unref as a, createTextVNode as d, toDisplayString as O, createCommentVNode as M, renderList as Q, normalizeClass as W } from "vue";
|
|
2
|
-
import { useModule as Z, useFirebaseIntegration as ee, useModuleRoute as te, useConfirmation as ne, useModulePermissions as oe, useModuleBreadcrumbs as le } from "@oneclick.dev/cms-kit";
|
|
3
|
-
import { CalendarX as ae, MoreHorizontalIcon as z, Copy as se, ChevronsLeftRightEllipsis as ie, Upload as de, Trash2Icon as re, ImportIcon as ue } from "lucide-vue-next";
|
|
4
|
-
const ce = { class: "container mx-auto p-8" }, pe = { key: 0 }, fe = { class: "flex gap-2" }, me = { key: 2 }, ve = { class: "flex justify-between items-center gap-4 mb-4" }, ge = {
|
|
5
|
-
key: 0,
|
|
6
|
-
class: "flex items-center gap-2"
|
|
7
|
-
}, _e = { class: "mr-2" }, ye = ["onClick"], Ce = { class: "flex justify-between items-center mb-2" }, ke = ["onClick"], we = { class: "text-lg font-medium" }, xe = { class: "text-sm text-muted-foreground" }, be = { key: 0 }, Ae = { key: 1 }, Ee = {
|
|
8
|
-
key: 0,
|
|
9
|
-
class: "flex justify-end mt-8"
|
|
10
|
-
}, Ne = /* @__PURE__ */ K({
|
|
11
|
-
__name: "Overview",
|
|
12
|
-
setup(Me) {
|
|
13
|
-
const { config: y } = Z(), b = ee(y.project), { navigateTo: C } = te(), { confirm: G } = ne(), { hasPermission: _ } = oe();
|
|
14
|
-
le(() => []);
|
|
15
|
-
const A = D(null), m = D(!1), r = D([]), I = D("importAgendasInput"), R = (s) => {
|
|
16
|
-
m.value = !0, r.value = [s];
|
|
17
|
-
}, $ = async () => {
|
|
18
|
-
A.value = await b.find(y.agendaCollection);
|
|
19
|
-
}, H = async (s) => {
|
|
20
|
-
if (!_("create-agendas")) return;
|
|
21
|
-
const e = await b.get(y.agendaCollection, s);
|
|
22
|
-
if (!e) {
|
|
23
|
-
alert("Agenda not found");
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
const u = prompt("Enter name for duplicated agenda", e.serviceName + " (Copy)");
|
|
27
|
-
if (!u)
|
|
28
|
-
return;
|
|
29
|
-
const c = { ...e, serviceName: u };
|
|
30
|
-
delete c.id, await b.add(y.agendaCollection, c), await $();
|
|
31
|
-
}, J = async (s) => {
|
|
32
|
-
!_("delete-agendas") || !await G("Are you sure you want to delete this agenda? This action cannot be undone.") || (await b.remove(y.agendaCollection, s), await $());
|
|
33
|
-
}, P = async () => {
|
|
34
|
-
let s = A.value.filter((c) => r.value.includes(c.id));
|
|
35
|
-
s = s.map((c) => {
|
|
36
|
-
const { id: k, ...w } = c;
|
|
37
|
-
return w;
|
|
38
|
-
});
|
|
39
|
-
const e = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(s, null, 2)), u = document.createElement("a");
|
|
40
|
-
u.setAttribute("href", e), u.setAttribute("download", "agendas_export.json"), document.body.appendChild(u), u.click(), u.remove(), m.value = !1, r.value = [];
|
|
41
|
-
}, F = async (s) => {
|
|
42
|
-
const e = s.target;
|
|
43
|
-
if (!e.files || e.files.length === 0)
|
|
44
|
-
return;
|
|
45
|
-
const c = await e.files[0].text();
|
|
46
|
-
let k;
|
|
47
|
-
try {
|
|
48
|
-
k = JSON.parse(c);
|
|
49
|
-
} catch {
|
|
50
|
-
alert("Invalid JSON file");
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
if (!Array.isArray(k)) {
|
|
54
|
-
alert("Invalid agendas format");
|
|
55
|
-
return;
|
|
56
|
-
}
|
|
57
|
-
for (const w of k)
|
|
58
|
-
await b.add(y.agendaCollection, w);
|
|
59
|
-
e.value = "", await $();
|
|
60
|
-
}, L = (s) => {
|
|
61
|
-
m.value || (_("edit-agendas") ? C(`/edit/${s}`) : C(`/edit/${s}/agenda`));
|
|
62
|
-
};
|
|
63
|
-
return $(), (s, e) => {
|
|
64
|
-
const u = i("Spinner"), c = i("EmptyMedia"), k = i("EmptyTitle"), w = i("EmptyDescription"), U = i("EmptyHeader"), v = i("Button"), Y = i("EmptyContent"), X = i("Empty"), N = i("DropdownMenuTrigger"), E = i("DropdownMenuItem"), T = i("DropdownMenuGroup"), h = i("DropdownMenuContent"), j = i("DropdownMenu"), B = i("ButtonGroup"), S = i("Checkbox");
|
|
65
|
-
return l(), f(V, null, [
|
|
66
|
-
p("div", ce, [
|
|
67
|
-
A.value === null ? (l(), f("div", pe, [
|
|
68
|
-
t(u, { class: "mx-auto" })
|
|
69
|
-
])) : A.value.length === 0 ? (l(), g(X, { key: 1 }, {
|
|
70
|
-
default: n(() => [
|
|
71
|
-
t(U, null, {
|
|
72
|
-
default: n(() => [
|
|
73
|
-
t(c, { variant: "icon" }, {
|
|
74
|
-
default: n(() => [
|
|
75
|
-
t(a(ae), { class: "size-4-6" })
|
|
76
|
-
]),
|
|
77
|
-
_: 1
|
|
78
|
-
}),
|
|
79
|
-
t(k, null, {
|
|
80
|
-
default: n(() => [...e[4] || (e[4] = [
|
|
81
|
-
d("No Agendas Yet", -1)
|
|
82
|
-
])]),
|
|
83
|
-
_: 1
|
|
84
|
-
}),
|
|
85
|
-
t(w, null, {
|
|
86
|
-
default: n(() => [...e[5] || (e[5] = [
|
|
87
|
-
d(" You haven't created any agenda yet. Get started by creating your first agenda. ", -1)
|
|
88
|
-
])]),
|
|
89
|
-
_: 1
|
|
90
|
-
})
|
|
91
|
-
]),
|
|
92
|
-
_: 1
|
|
93
|
-
}),
|
|
94
|
-
t(Y, null, {
|
|
95
|
-
default: n(() => [
|
|
96
|
-
p("div", fe, [
|
|
97
|
-
t(v, {
|
|
98
|
-
onClick: e[0] || (e[0] = (o) => a(C)("/create"))
|
|
99
|
-
}, {
|
|
100
|
-
default: n(() => [...e[6] || (e[6] = [
|
|
101
|
-
d("Create Agenda", -1)
|
|
102
|
-
])]),
|
|
103
|
-
_: 1
|
|
104
|
-
})
|
|
105
|
-
])
|
|
106
|
-
]),
|
|
107
|
-
_: 1
|
|
108
|
-
})
|
|
109
|
-
]),
|
|
110
|
-
_: 1
|
|
111
|
-
})) : (l(), f("div", me, [
|
|
112
|
-
p("div", ve, [
|
|
113
|
-
e[9] || (e[9] = p("h2", { class: "text-2xl font-bold" }, "Agendas", -1)),
|
|
114
|
-
m.value ? (l(), f("div", ge, [
|
|
115
|
-
p("span", _e, O(r.value.length) + " selected", 1),
|
|
116
|
-
t(v, {
|
|
117
|
-
variant: "outline",
|
|
118
|
-
onClick: e[1] || (e[1] = (o) => {
|
|
119
|
-
m.value = !1, r.value = [];
|
|
120
|
-
})
|
|
121
|
-
}, {
|
|
122
|
-
default: n(() => [...e[7] || (e[7] = [
|
|
123
|
-
d(" Cancel ", -1)
|
|
124
|
-
])]),
|
|
125
|
-
_: 1
|
|
126
|
-
}),
|
|
127
|
-
t(v, {
|
|
128
|
-
onClick: P,
|
|
129
|
-
disabled: r.value.length === 0
|
|
130
|
-
}, {
|
|
131
|
-
default: n(() => [...e[8] || (e[8] = [
|
|
132
|
-
d(" Export ", -1)
|
|
133
|
-
])]),
|
|
134
|
-
_: 1
|
|
135
|
-
}, 8, ["disabled"])
|
|
136
|
-
])) : M("", !0)
|
|
137
|
-
]),
|
|
138
|
-
(l(!0), f(V, null, Q(A.value, (o) => (l(), f("button", {
|
|
139
|
-
key: o.id,
|
|
140
|
-
class: W(["block w-full mb-4 p-4 border rounded-md bg-background", { "cursor-pointer hover:bg-accent focus-visible:outline-0 focus:ring-2 ring-ring/50": m.value }]),
|
|
141
|
-
onClick: (x) => m.value ? r.value.includes(o.id) ? r.value = r.value.filter((q) => q !== o.id) : r.value.push(o.id) : null
|
|
142
|
-
}, [
|
|
143
|
-
p("div", Ce, [
|
|
144
|
-
p("div", {
|
|
145
|
-
class: "flex flex-col items-start",
|
|
146
|
-
onClick: (x) => L(o.id)
|
|
147
|
-
}, [
|
|
148
|
-
p("h3", we, O(o.serviceName), 1),
|
|
149
|
-
p("p", xe, [
|
|
150
|
-
o.type === "regular" ? (l(), f("span", be, "Regular Agenda")) : M("", !0)
|
|
151
|
-
])
|
|
152
|
-
], 8, ke),
|
|
153
|
-
m.value ? (l(), f("div", Ae, [
|
|
154
|
-
r.value.includes(o.id) ? (l(), g(S, {
|
|
155
|
-
key: 0,
|
|
156
|
-
tabindex: "-1",
|
|
157
|
-
defaultValue: !0
|
|
158
|
-
})) : (l(), g(S, {
|
|
159
|
-
key: 1,
|
|
160
|
-
tabindex: "-1",
|
|
161
|
-
defaultValue: !1
|
|
162
|
-
}))
|
|
163
|
-
])) : (l(), g(B, { key: 0 }, {
|
|
164
|
-
default: n(() => [
|
|
165
|
-
a(_)("edit-agendas") ? (l(), g(v, {
|
|
166
|
-
key: 0,
|
|
167
|
-
variant: "outline",
|
|
168
|
-
onClick: (x) => a(C)(`/edit/${o.id}`)
|
|
169
|
-
}, {
|
|
170
|
-
default: n(() => [...e[10] || (e[10] = [
|
|
171
|
-
d(" Edit Agenda ", -1)
|
|
172
|
-
])]),
|
|
173
|
-
_: 1
|
|
174
|
-
}, 8, ["onClick"])) : (l(), g(v, {
|
|
175
|
-
key: 1,
|
|
176
|
-
variant: "outline",
|
|
177
|
-
onClick: (x) => a(C)(`/edit/${o.id}/agenda`)
|
|
178
|
-
}, {
|
|
179
|
-
default: n(() => [...e[11] || (e[11] = [
|
|
180
|
-
d(" View Agenda ", -1)
|
|
181
|
-
])]),
|
|
182
|
-
_: 1
|
|
183
|
-
}, 8, ["onClick"])),
|
|
184
|
-
t(j, null, {
|
|
185
|
-
default: n(() => [
|
|
186
|
-
t(N, { "as-child": "" }, {
|
|
187
|
-
default: n(() => [
|
|
188
|
-
t(v, {
|
|
189
|
-
variant: "outline",
|
|
190
|
-
size: "icon",
|
|
191
|
-
"aria-label": "More Options"
|
|
192
|
-
}, {
|
|
193
|
-
default: n(() => [
|
|
194
|
-
t(a(z))
|
|
195
|
-
]),
|
|
196
|
-
_: 1
|
|
197
|
-
})
|
|
198
|
-
]),
|
|
199
|
-
_: 1
|
|
200
|
-
}),
|
|
201
|
-
t(h, {
|
|
202
|
-
align: "end",
|
|
203
|
-
class: "w-52"
|
|
204
|
-
}, {
|
|
205
|
-
default: n(() => [
|
|
206
|
-
t(T, null, {
|
|
207
|
-
default: n(() => [
|
|
208
|
-
a(_)("create-agendas") ? (l(), g(E, {
|
|
209
|
-
key: 0,
|
|
210
|
-
onClick: (x) => H(o.id)
|
|
211
|
-
}, {
|
|
212
|
-
default: n(() => [
|
|
213
|
-
t(a(se)),
|
|
214
|
-
e[12] || (e[12] = d(" Duplicate Agenda ", -1))
|
|
215
|
-
]),
|
|
216
|
-
_: 1
|
|
217
|
-
}, 8, ["onClick"])) : M("", !0),
|
|
218
|
-
t(E, null, {
|
|
219
|
-
default: n(() => [
|
|
220
|
-
t(a(ie)),
|
|
221
|
-
e[13] || (e[13] = d(" API Set-up ", -1))
|
|
222
|
-
]),
|
|
223
|
-
_: 1
|
|
224
|
-
}),
|
|
225
|
-
t(E, {
|
|
226
|
-
onClick: (x) => R(o.id)
|
|
227
|
-
}, {
|
|
228
|
-
default: n(() => [
|
|
229
|
-
t(a(de)),
|
|
230
|
-
e[14] || (e[14] = d(" Export Agenda ", -1))
|
|
231
|
-
]),
|
|
232
|
-
_: 1
|
|
233
|
-
}, 8, ["onClick"]),
|
|
234
|
-
a(_)("delete-agendas") ? (l(), g(E, {
|
|
235
|
-
key: 1,
|
|
236
|
-
variant: "destructive",
|
|
237
|
-
onClick: (x) => J(o.id)
|
|
238
|
-
}, {
|
|
239
|
-
default: n(() => [
|
|
240
|
-
t(a(re)),
|
|
241
|
-
e[15] || (e[15] = d(" Remove Agenda ", -1))
|
|
242
|
-
]),
|
|
243
|
-
_: 1
|
|
244
|
-
}, 8, ["onClick"])) : M("", !0)
|
|
245
|
-
]),
|
|
246
|
-
_: 2
|
|
247
|
-
}, 1024)
|
|
248
|
-
]),
|
|
249
|
-
_: 2
|
|
250
|
-
}, 1024)
|
|
251
|
-
]),
|
|
252
|
-
_: 2
|
|
253
|
-
}, 1024)
|
|
254
|
-
]),
|
|
255
|
-
_: 2
|
|
256
|
-
}, 1024))
|
|
257
|
-
])
|
|
258
|
-
], 10, ye))), 128)),
|
|
259
|
-
a(_)("create-agendas") ? (l(), f("div", Ee, [
|
|
260
|
-
t(B, null, {
|
|
261
|
-
default: n(() => [
|
|
262
|
-
t(v, {
|
|
263
|
-
onClick: e[2] || (e[2] = (o) => a(C)("/create")),
|
|
264
|
-
class: "border-r"
|
|
265
|
-
}, {
|
|
266
|
-
default: n(() => [...e[16] || (e[16] = [
|
|
267
|
-
d("New Agenda", -1)
|
|
268
|
-
])]),
|
|
269
|
-
_: 1
|
|
270
|
-
}),
|
|
271
|
-
t(j, null, {
|
|
272
|
-
default: n(() => [
|
|
273
|
-
t(N, { "as-child": "" }, {
|
|
274
|
-
default: n(() => [
|
|
275
|
-
t(v, {
|
|
276
|
-
size: "icon",
|
|
277
|
-
"aria-label": "More Options"
|
|
278
|
-
}, {
|
|
279
|
-
default: n(() => [
|
|
280
|
-
t(a(z))
|
|
281
|
-
]),
|
|
282
|
-
_: 1
|
|
283
|
-
})
|
|
284
|
-
]),
|
|
285
|
-
_: 1
|
|
286
|
-
}),
|
|
287
|
-
t(h, {
|
|
288
|
-
align: "end",
|
|
289
|
-
class: "w-52"
|
|
290
|
-
}, {
|
|
291
|
-
default: n(() => [
|
|
292
|
-
t(T, null, {
|
|
293
|
-
default: n(() => [
|
|
294
|
-
t(E, {
|
|
295
|
-
onClick: e[3] || (e[3] = (o) => I.value.click())
|
|
296
|
-
}, {
|
|
297
|
-
default: n(() => [
|
|
298
|
-
t(a(ue)),
|
|
299
|
-
e[17] || (e[17] = d(" Import Agendas... ", -1))
|
|
300
|
-
]),
|
|
301
|
-
_: 1
|
|
302
|
-
})
|
|
303
|
-
]),
|
|
304
|
-
_: 1
|
|
305
|
-
})
|
|
306
|
-
]),
|
|
307
|
-
_: 1
|
|
308
|
-
})
|
|
309
|
-
]),
|
|
310
|
-
_: 1
|
|
311
|
-
})
|
|
312
|
-
]),
|
|
313
|
-
_: 1
|
|
314
|
-
})
|
|
315
|
-
])) : M("", !0)
|
|
316
|
-
]))
|
|
317
|
-
]),
|
|
318
|
-
p("input", {
|
|
319
|
-
type: "file",
|
|
320
|
-
ref_key: "importAgendasInput",
|
|
321
|
-
ref: I,
|
|
322
|
-
class: "hidden",
|
|
323
|
-
accept: ".json,application/json",
|
|
324
|
-
onChange: F
|
|
325
|
-
}, null, 544)
|
|
326
|
-
], 64);
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
export {
|
|
331
|
-
Ne as default
|
|
332
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),v=require("@oneclick.dev/cms-kit"),s=require("lucide-vue-next"),G={class:"container mx-auto p-8"},R={key:0},H={class:"flex gap-2"},P={key:2},q={class:"flex justify-between items-center gap-4 mb-4"},F={key:0,class:"flex items-center gap-2"},J={class:"mr-2"},L=["onClick"],U={class:"flex justify-between items-center mb-2"},Y=["onClick"],K={class:"text-lg font-medium"},X={class:"text-sm text-muted-foreground"},Q={key:0},W={key:1},Z={key:0,class:"flex justify-end mt-8"},ee=e.defineComponent({__name:"Overview",setup(te){const{config:u}=v.useModule(),k=v.useFirebaseIntegration(u.project),{navigateTo:p}=v.useModuleRoute(),{confirm:b}=v.useConfirmation(),{hasPermission:c}=v.useModulePermissions();v.useModuleBreadcrumbs(()=>[]);const g=e.ref(null),d=e.ref(!1),a=e.ref([]),V=e.ref("importAgendasInput"),A=n=>{d.value=!0,a.value=[n]},N=async()=>{g.value=await k.find(u.agendaCollection)},M=async n=>{if(!c("create-agendas"))return;const t=await k.get(u.agendaCollection,n);if(!t){alert("Agenda not found");return}const l=prompt("Enter name for duplicated agenda",t.serviceName+" (Copy)");if(!l)return;const r={...t,serviceName:l};delete r.id,await k.add(u.agendaCollection,r),await N()},T=async n=>{!c("delete-agendas")||!await b("Are you sure you want to delete this agenda? This action cannot be undone.")||(await k.remove(u.agendaCollection,n),await N())},$=async()=>{let n=g.value.filter(r=>a.value.includes(r.id));n=n.map(r=>{const{id:m,...f}=r;return f});const t="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(n,null,2)),l=document.createElement("a");l.setAttribute("href",t),l.setAttribute("download","agendas_export.json"),document.body.appendChild(l),l.click(),l.remove(),d.value=!1,a.value=[]},D=async n=>{const t=n.target;if(!t.files||t.files.length===0)return;const r=await t.files[0].text();let m;try{m=JSON.parse(r)}catch{alert("Invalid JSON file");return}if(!Array.isArray(m)){alert("Invalid agendas format");return}for(const f of m)await k.add(u.agendaCollection,f);t.value="",await N()},I=n=>{d.value||(c("edit-agendas")?p(`/edit/${n}`):p(`/edit/${n}/agenda`))};return N(),(n,t)=>{const l=e.resolveComponent("Spinner"),r=e.resolveComponent("EmptyMedia"),m=e.resolveComponent("EmptyTitle"),f=e.resolveComponent("EmptyDescription"),S=e.resolveComponent("EmptyHeader"),i=e.resolveComponent("Button"),j=e.resolveComponent("EmptyContent"),O=e.resolveComponent("Empty"),_=e.resolveComponent("DropdownMenuTrigger"),x=e.resolveComponent("DropdownMenuItem"),w=e.resolveComponent("DropdownMenuGroup"),y=e.resolveComponent("DropdownMenuContent"),B=e.resolveComponent("DropdownMenu"),E=e.resolveComponent("ButtonGroup"),h=e.resolveComponent("Checkbox");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",G,[g.value===null?(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(l,{class:"mx-auto"})])):g.value.length===0?(e.openBlock(),e.createBlock(O,{key:1},{default:e.withCtx(()=>[e.createVNode(S,null,{default:e.withCtx(()=>[e.createVNode(r,{variant:"icon"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.CalendarX),{class:"size-4-6"})]),_:1}),e.createVNode(m,null,{default:e.withCtx(()=>[...t[4]||(t[4]=[e.createTextVNode("No Agendas Yet",-1)])]),_:1}),e.createVNode(f,null,{default:e.withCtx(()=>[...t[5]||(t[5]=[e.createTextVNode(" You haven't created any agenda yet. Get started by creating your first agenda. ",-1)])]),_:1})]),_:1}),e.createVNode(j,null,{default:e.withCtx(()=>[e.createElementVNode("div",H,[e.createVNode(i,{onClick:t[0]||(t[0]=o=>e.unref(p)("/create"))},{default:e.withCtx(()=>[...t[6]||(t[6]=[e.createTextVNode("Create Agenda",-1)])]),_:1})])]),_:1})]),_:1})):(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("div",q,[t[9]||(t[9]=e.createElementVNode("h2",{class:"text-2xl font-bold"},"Agendas",-1)),d.value?(e.openBlock(),e.createElementBlock("div",F,[e.createElementVNode("span",J,e.toDisplayString(a.value.length)+" selected",1),e.createVNode(i,{variant:"outline",onClick:t[1]||(t[1]=o=>{d.value=!1,a.value=[]})},{default:e.withCtx(()=>[...t[7]||(t[7]=[e.createTextVNode(" Cancel ",-1)])]),_:1}),e.createVNode(i,{onClick:$,disabled:a.value.length===0},{default:e.withCtx(()=>[...t[8]||(t[8]=[e.createTextVNode(" Export ",-1)])]),_:1},8,["disabled"])])):e.createCommentVNode("",!0)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,o=>(e.openBlock(),e.createElementBlock("button",{key:o.id,class:e.normalizeClass(["block w-full mb-4 p-4 border rounded-md bg-background",{"cursor-pointer hover:bg-accent focus-visible:outline-0 focus:ring-2 ring-ring/50":d.value}]),onClick:C=>d.value?a.value.includes(o.id)?a.value=a.value.filter(z=>z!==o.id):a.value.push(o.id):null},[e.createElementVNode("div",U,[e.createElementVNode("div",{class:"flex flex-col items-start",onClick:C=>I(o.id)},[e.createElementVNode("h3",K,e.toDisplayString(o.serviceName),1),e.createElementVNode("p",X,[o.type==="regular"?(e.openBlock(),e.createElementBlock("span",Q,"Regular Agenda")):e.createCommentVNode("",!0)])],8,Y),d.value?(e.openBlock(),e.createElementBlock("div",W,[a.value.includes(o.id)?(e.openBlock(),e.createBlock(h,{key:0,tabindex:"-1",defaultValue:!0})):(e.openBlock(),e.createBlock(h,{key:1,tabindex:"-1",defaultValue:!1}))])):(e.openBlock(),e.createBlock(E,{key:0},{default:e.withCtx(()=>[e.unref(c)("edit-agendas")?(e.openBlock(),e.createBlock(i,{key:0,variant:"outline",onClick:C=>e.unref(p)(`/edit/${o.id}`)},{default:e.withCtx(()=>[...t[10]||(t[10]=[e.createTextVNode(" Edit Agenda ",-1)])]),_:1},8,["onClick"])):(e.openBlock(),e.createBlock(i,{key:1,variant:"outline",onClick:C=>e.unref(p)(`/edit/${o.id}/agenda`)},{default:e.withCtx(()=>[...t[11]||(t[11]=[e.createTextVNode(" View Agenda ",-1)])]),_:1},8,["onClick"])),e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(_,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(i,{variant:"outline",size:"icon","aria-label":"More Options"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.MoreHorizontalIcon))]),_:1})]),_:1}),e.createVNode(y,{align:"end",class:"w-52"},{default:e.withCtx(()=>[e.createVNode(w,null,{default:e.withCtx(()=>[e.unref(c)("create-agendas")?(e.openBlock(),e.createBlock(x,{key:0,onClick:C=>M(o.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(s.Copy)),t[12]||(t[12]=e.createTextVNode(" Duplicate Agenda ",-1))]),_:1},8,["onClick"])):e.createCommentVNode("",!0),e.createVNode(x,null,{default:e.withCtx(()=>[e.createVNode(e.unref(s.ChevronsLeftRightEllipsis)),t[13]||(t[13]=e.createTextVNode(" API Set-up ",-1))]),_:1}),e.createVNode(x,{onClick:C=>A(o.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(s.Upload)),t[14]||(t[14]=e.createTextVNode(" Export Agenda ",-1))]),_:1},8,["onClick"]),e.unref(c)("delete-agendas")?(e.openBlock(),e.createBlock(x,{key:1,variant:"destructive",onClick:C=>T(o.id)},{default:e.withCtx(()=>[e.createVNode(e.unref(s.Trash2Icon)),t[15]||(t[15]=e.createTextVNode(" Remove Agenda ",-1))]),_:1},8,["onClick"])):e.createCommentVNode("",!0)]),_:2},1024)]),_:2},1024)]),_:2},1024)]),_:2},1024))])],10,L))),128)),e.unref(c)("create-agendas")?(e.openBlock(),e.createElementBlock("div",Z,[e.createVNode(E,null,{default:e.withCtx(()=>[e.createVNode(i,{onClick:t[2]||(t[2]=o=>e.unref(p)("/create")),class:"border-r"},{default:e.withCtx(()=>[...t[16]||(t[16]=[e.createTextVNode("New Agenda",-1)])]),_:1}),e.createVNode(B,null,{default:e.withCtx(()=>[e.createVNode(_,{"as-child":""},{default:e.withCtx(()=>[e.createVNode(i,{size:"icon","aria-label":"More Options"},{default:e.withCtx(()=>[e.createVNode(e.unref(s.MoreHorizontalIcon))]),_:1})]),_:1}),e.createVNode(y,{align:"end",class:"w-52"},{default:e.withCtx(()=>[e.createVNode(w,null,{default:e.withCtx(()=>[e.createVNode(x,{onClick:t[3]||(t[3]=o=>V.value.click())},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ImportIcon)),t[17]||(t[17]=e.createTextVNode(" Import Agendas... ",-1))]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})])):e.createCommentVNode("",!0)]))]),e.createElementVNode("input",{type:"file",ref_key:"importAgendasInput",ref:V,class:"hidden",accept:".json,application/json",onChange:D},null,544)],64)}}});exports.default=ee;
|