@oneclick.dev/cms-core-modules 0.0.61 → 0.0.63
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-BAepN3Yd.js → ContentEditor-DKFCmfOs.js} +1 -1
- package/dist/{ContentEditor-BPjWW3d1.mjs → ContentEditor-owdOIage.mjs} +1 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-DRVxQswt.js +1 -0
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-BJitmbPE.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-DkgDWC2i.mjs} +130 -125
- package/dist/{Overview-DtWvKB3W.mjs → Overview-DiBYtvEX.mjs} +124 -119
- package/dist/Overview-qP1guKjx.js +1 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-B7ks5mbf.mjs +2332 -0
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Vxubki_v.js +349 -0
- package/dist/{TableView-_2cP-w_7.js → TableView-BqhL_P45.js} +100 -100
- package/dist/{TableView-DlhHyuUZ.mjs → TableView-Dbl8qcUy.mjs} +14991 -14728
- package/dist/agenda-DFNJ8C1N.mjs +1136 -0
- package/dist/agenda-MjkwV63A.js +1 -0
- package/dist/floating-ui.dom-CBBY0Ism.js +1 -0
- package/dist/floating-ui.dom-xfqXu4GA.mjs +1138 -0
- package/dist/{index-DTago6vW-Bhr8E1Y6.js → index-CgfL8UKf-DAN7RkzR.js} +10 -10
- package/dist/{index-DTago6vW-CnomHQ_S.mjs → index-CgfL8UKf-DUUg9HDA.mjs} +904 -875
- package/dist/index-DBDq-h4j.js +245 -0
- package/dist/{index-BDaVYdkD.mjs → index-X0L4AHBR.mjs} +2406 -2394
- package/dist/index-YMaY4uuk-BgpTtr73.js +1 -0
- package/dist/{index-YMaY4uuk-BshejgNP.mjs → index-YMaY4uuk-C_xV5K9Z.mjs} +13 -14
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +6 -6
- package/dist/orders-Bqa3Z3tH.mjs +356 -0
- package/dist/orders-D5GJOZXN.js +1 -0
- package/dist/src/appointments/components/edit/EventDialog/ApproveReservationDialog.vue.d.ts +8 -0
- package/dist/src/appointments/components/edit/EventDialog/BookingsList.vue.d.ts +39 -9
- package/dist/src/appointments/components/edit/EventDialog/CancelReservationDialog.vue.d.ts +2 -2
- package/dist/src/appointments/components/edit/EventDialog/RejectReservationDialog.vue.d.ts +8 -0
- package/dist/src/appointments/components/edit/EventDialog/ReservationDetailDialog.vue.d.ts +36 -8
- package/dist/src/appointments/components/edit/dashboard/BookingsList.vue.d.ts +46 -9
- package/dist/src/appointments/components/edit/dashboard/Timeline.vue.d.ts +19 -0
- package/dist/src/appointments/pages/edit/orders.vue.d.ts +39 -9
- package/package.json +1 -1
- package/dist/NewReservationDialog.vue_vue_type_script_setup_true_lang-D50uTpZY.js +0 -1
- package/dist/Overview-B_99j5eA.js +0 -1
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-CI8YgHdU.js +0 -345
- package/dist/ReservationDetailDialog.vue_vue_type_script_setup_true_lang-P-MWwcVh.mjs +0 -2093
- package/dist/agenda-D81m29_4.mjs +0 -1135
- package/dist/agenda-uzPPxgsW.js +0 -1
- package/dist/floating-ui.dom-C82nbomj.js +0 -1
- package/dist/floating-ui.dom-ouSgPqty.mjs +0 -1133
- package/dist/index-DfV8-6ON.js +0 -245
- package/dist/index-YMaY4uuk-BxVT7IpO.js +0 -1
- package/dist/orders-Bh8w0ueq.mjs +0 -346
- package/dist/orders-Dt0zMz97.js +0 -1
- package/dist/src/appointments/components/edit/EventDialog/ResendConfirmationDialog.vue.d.ts +0 -4
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useModule as
|
|
3
|
-
import { CalendarX as ae, MoreHorizontalIcon as z, Copy as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as K, ref as D, resolveComponent as i, openBlock as o, createElementBlock as f, Fragment as V, createElementVNode as p, createVNode as t, createBlock as v, 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 }, ge = { class: "flex justify-between items-center gap-4 mb-4" }, ve = {
|
|
5
5
|
key: 0,
|
|
6
6
|
class: "flex items-center gap-2"
|
|
7
|
-
},
|
|
7
|
+
}, _e = { class: "mr-2" }, ye = ["onClick"], Ce = { class: "flex justify-between items-center mb-2" }, ke = { class: "text-lg font-medium" }, we = { class: "text-sm text-muted-foreground" }, xe = { key: 0 }, be = { key: 1 }, Ae = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "flex justify-end mt-8"
|
|
10
|
-
},
|
|
10
|
+
}, Ie = /* @__PURE__ */ K({
|
|
11
11
|
__name: "Overview",
|
|
12
12
|
setup(Ee) {
|
|
13
|
-
const { config:
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
}, H = async (
|
|
20
|
-
if (!
|
|
21
|
-
const e = await
|
|
13
|
+
const { config: y } = Z(), x = ee(y.project), { navigateTo: C } = te(), { confirm: G } = ne(), { hasPermission: _ } = oe();
|
|
14
|
+
le(() => []);
|
|
15
|
+
const b = D(null), m = D(!1), r = D([]), I = D("importAgendasInput"), R = (s) => {
|
|
16
|
+
m.value = !0, r.value = [s];
|
|
17
|
+
}, $ = async () => {
|
|
18
|
+
b.value = await x.find(y.agendaCollection);
|
|
19
|
+
}, H = async (s) => {
|
|
20
|
+
if (!_("create-agendas")) return;
|
|
21
|
+
const e = await x.get(y.agendaCollection, s);
|
|
22
22
|
if (!e) {
|
|
23
23
|
alert("Agenda not found");
|
|
24
24
|
return;
|
|
@@ -27,76 +27,78 @@ const ue = { class: "container mx-auto p-8" }, ce = { key: 0 }, pe = { class: "f
|
|
|
27
27
|
if (!u)
|
|
28
28
|
return;
|
|
29
29
|
const c = { ...e, serviceName: u };
|
|
30
|
-
delete c.id, await
|
|
31
|
-
}, J = async (
|
|
32
|
-
!
|
|
30
|
+
delete c.id, await x.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 x.remove(y.agendaCollection, s), await $());
|
|
33
33
|
}, P = async () => {
|
|
34
|
-
let
|
|
35
|
-
|
|
36
|
-
const { id:
|
|
37
|
-
return
|
|
34
|
+
let s = b.value.filter((c) => r.value.includes(c.id));
|
|
35
|
+
s = s.map((c) => {
|
|
36
|
+
const { id: k, ...w } = c;
|
|
37
|
+
return w;
|
|
38
38
|
});
|
|
39
|
-
const e = "data:text/json;charset=utf-8," + encodeURIComponent(JSON.stringify(
|
|
40
|
-
u.setAttribute("href", e), u.setAttribute("download", "agendas_export.json"), document.body.appendChild(u), u.click(), u.remove(),
|
|
41
|
-
}, F = async (
|
|
42
|
-
const e =
|
|
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
43
|
if (!e.files || e.files.length === 0)
|
|
44
44
|
return;
|
|
45
45
|
const c = await e.files[0].text();
|
|
46
|
-
let
|
|
46
|
+
let k;
|
|
47
47
|
try {
|
|
48
|
-
|
|
48
|
+
k = JSON.parse(c);
|
|
49
49
|
} catch {
|
|
50
50
|
alert("Invalid JSON file");
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
|
-
if (!Array.isArray(
|
|
53
|
+
if (!Array.isArray(k)) {
|
|
54
54
|
alert("Invalid agendas format");
|
|
55
55
|
return;
|
|
56
56
|
}
|
|
57
|
-
for (const
|
|
58
|
-
await
|
|
59
|
-
e.value = "", await
|
|
57
|
+
for (const w of k)
|
|
58
|
+
await x.add(y.agendaCollection, w);
|
|
59
|
+
e.value = "", await $();
|
|
60
|
+
}, L = (s) => {
|
|
61
|
+
m.value || (_("edit-agendas") ? C(`/edit/${s}`) : C(`/edit/${s}/agenda`));
|
|
60
62
|
};
|
|
61
|
-
return
|
|
62
|
-
const u =
|
|
63
|
+
return $(), (s, e) => {
|
|
64
|
+
const u = i("Spinner"), c = i("EmptyMedia"), k = i("EmptyTitle"), w = i("EmptyDescription"), U = i("EmptyHeader"), g = i("Button"), Y = i("EmptyContent"), X = i("Empty"), N = i("DropdownMenuTrigger"), A = i("DropdownMenuItem"), T = i("DropdownMenuGroup"), j = i("DropdownMenuContent"), B = i("DropdownMenu"), S = i("ButtonGroup"), h = i("Checkbox");
|
|
63
65
|
return o(), f(V, null, [
|
|
64
|
-
p("div",
|
|
65
|
-
|
|
66
|
+
p("div", ce, [
|
|
67
|
+
b.value === null ? (o(), f("div", pe, [
|
|
66
68
|
t(u, { class: "mx-auto" })
|
|
67
|
-
])) :
|
|
69
|
+
])) : b.value.length === 0 ? (o(), v(X, { key: 1 }, {
|
|
68
70
|
default: n(() => [
|
|
69
|
-
t(
|
|
71
|
+
t(U, null, {
|
|
70
72
|
default: n(() => [
|
|
71
73
|
t(c, { variant: "icon" }, {
|
|
72
74
|
default: n(() => [
|
|
73
|
-
t(
|
|
75
|
+
t(a(ae), { class: "size-4-6" })
|
|
74
76
|
]),
|
|
75
77
|
_: 1
|
|
76
78
|
}),
|
|
77
|
-
t(
|
|
79
|
+
t(k, null, {
|
|
78
80
|
default: n(() => [...e[4] || (e[4] = [
|
|
79
|
-
|
|
81
|
+
d("No Agendas Yet", -1)
|
|
80
82
|
])]),
|
|
81
83
|
_: 1
|
|
82
84
|
}),
|
|
83
|
-
t(
|
|
85
|
+
t(w, null, {
|
|
84
86
|
default: n(() => [...e[5] || (e[5] = [
|
|
85
|
-
|
|
87
|
+
d(" You haven't created any agenda yet. Get started by creating your first agenda. ", -1)
|
|
86
88
|
])]),
|
|
87
89
|
_: 1
|
|
88
90
|
})
|
|
89
91
|
]),
|
|
90
92
|
_: 1
|
|
91
93
|
}),
|
|
92
|
-
t(
|
|
94
|
+
t(Y, null, {
|
|
93
95
|
default: n(() => [
|
|
94
|
-
p("div",
|
|
95
|
-
t(
|
|
96
|
-
onClick: e[0] || (e[0] = (
|
|
96
|
+
p("div", fe, [
|
|
97
|
+
t(g, {
|
|
98
|
+
onClick: e[0] || (e[0] = (l) => a(C)("/create"))
|
|
97
99
|
}, {
|
|
98
100
|
default: n(() => [...e[6] || (e[6] = [
|
|
99
|
-
|
|
101
|
+
d("Create Agenda", -1)
|
|
100
102
|
])]),
|
|
101
103
|
_: 1
|
|
102
104
|
})
|
|
@@ -106,137 +108,140 @@ const ue = { class: "container mx-auto p-8" }, ce = { key: 0 }, pe = { class: "f
|
|
|
106
108
|
})
|
|
107
109
|
]),
|
|
108
110
|
_: 1
|
|
109
|
-
})) : (o(), f("div",
|
|
110
|
-
p("div",
|
|
111
|
+
})) : (o(), f("div", me, [
|
|
112
|
+
p("div", ge, [
|
|
111
113
|
e[9] || (e[9] = p("h2", { class: "text-2xl font-bold" }, "Agendas", -1)),
|
|
112
|
-
|
|
113
|
-
p("span",
|
|
114
|
-
t(
|
|
114
|
+
m.value ? (o(), f("div", ve, [
|
|
115
|
+
p("span", _e, O(r.value.length) + " selected", 1),
|
|
116
|
+
t(g, {
|
|
115
117
|
variant: "outline",
|
|
116
|
-
onClick: e[1] || (e[1] = (
|
|
117
|
-
|
|
118
|
+
onClick: e[1] || (e[1] = (l) => {
|
|
119
|
+
m.value = !1, r.value = [];
|
|
118
120
|
})
|
|
119
121
|
}, {
|
|
120
122
|
default: n(() => [...e[7] || (e[7] = [
|
|
121
|
-
|
|
123
|
+
d(" Cancel ", -1)
|
|
122
124
|
])]),
|
|
123
125
|
_: 1
|
|
124
126
|
}),
|
|
125
|
-
t(
|
|
127
|
+
t(g, {
|
|
126
128
|
onClick: P,
|
|
127
129
|
disabled: r.value.length === 0
|
|
128
130
|
}, {
|
|
129
131
|
default: n(() => [...e[8] || (e[8] = [
|
|
130
|
-
|
|
132
|
+
d(" Export ", -1)
|
|
131
133
|
])]),
|
|
132
134
|
_: 1
|
|
133
135
|
}, 8, ["disabled"])
|
|
134
|
-
])) :
|
|
136
|
+
])) : M("", !0)
|
|
135
137
|
]),
|
|
136
|
-
(o(!0), f(V, null,
|
|
137
|
-
key:
|
|
138
|
-
class:
|
|
139
|
-
onClick: (
|
|
138
|
+
(o(!0), f(V, null, Q(b.value, (l) => (o(), f("button", {
|
|
139
|
+
key: l.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: (E) => m.value ? r.value.includes(l.id) ? r.value = r.value.filter((q) => q !== l.id) : r.value.push(l.id) : null
|
|
140
142
|
}, [
|
|
141
|
-
p("div",
|
|
142
|
-
p("div",
|
|
143
|
-
|
|
143
|
+
p("div", Ce, [
|
|
144
|
+
p("div", {
|
|
145
|
+
class: "flex flex-col items-start",
|
|
146
|
+
onClick: L
|
|
147
|
+
}, [
|
|
148
|
+
p("h3", ke, O(l.serviceName), 1),
|
|
144
149
|
p("p", we, [
|
|
145
|
-
|
|
150
|
+
l.type === "regular" ? (o(), f("span", xe, "Regular Agenda")) : M("", !0)
|
|
146
151
|
])
|
|
147
152
|
]),
|
|
148
|
-
|
|
149
|
-
r.value.includes(
|
|
153
|
+
m.value ? (o(), f("div", be, [
|
|
154
|
+
r.value.includes(l.id) ? (o(), v(h, {
|
|
150
155
|
key: 0,
|
|
151
156
|
tabindex: "-1",
|
|
152
157
|
defaultValue: !0
|
|
153
|
-
})) : (o(),
|
|
158
|
+
})) : (o(), v(h, {
|
|
154
159
|
key: 1,
|
|
155
160
|
tabindex: "-1",
|
|
156
161
|
defaultValue: !1
|
|
157
162
|
}))
|
|
158
|
-
])) : (o(),
|
|
163
|
+
])) : (o(), v(S, { key: 0 }, {
|
|
159
164
|
default: n(() => [
|
|
160
|
-
|
|
165
|
+
a(_)("edit-agendas") ? (o(), v(g, {
|
|
161
166
|
key: 0,
|
|
162
167
|
variant: "outline",
|
|
163
|
-
onClick: (
|
|
168
|
+
onClick: (E) => a(C)(`/edit/${l.id}`)
|
|
164
169
|
}, {
|
|
165
170
|
default: n(() => [...e[10] || (e[10] = [
|
|
166
|
-
|
|
171
|
+
d(" Edit Agenda ", -1)
|
|
167
172
|
])]),
|
|
168
173
|
_: 1
|
|
169
|
-
}, 8, ["onClick"])) : (o(), g
|
|
174
|
+
}, 8, ["onClick"])) : (o(), v(g, {
|
|
170
175
|
key: 1,
|
|
171
176
|
variant: "outline",
|
|
172
|
-
onClick: (
|
|
177
|
+
onClick: (E) => a(C)(`/edit/${l.id}/agenda`)
|
|
173
178
|
}, {
|
|
174
179
|
default: n(() => [...e[11] || (e[11] = [
|
|
175
|
-
|
|
180
|
+
d(" View Agenda ", -1)
|
|
176
181
|
])]),
|
|
177
182
|
_: 1
|
|
178
183
|
}, 8, ["onClick"])),
|
|
179
|
-
t(
|
|
184
|
+
t(B, null, {
|
|
180
185
|
default: n(() => [
|
|
181
|
-
t(
|
|
186
|
+
t(N, { "as-child": "" }, {
|
|
182
187
|
default: n(() => [
|
|
183
|
-
t(
|
|
188
|
+
t(g, {
|
|
184
189
|
variant: "outline",
|
|
185
190
|
size: "icon",
|
|
186
191
|
"aria-label": "More Options"
|
|
187
192
|
}, {
|
|
188
193
|
default: n(() => [
|
|
189
|
-
t(
|
|
194
|
+
t(a(z))
|
|
190
195
|
]),
|
|
191
196
|
_: 1
|
|
192
197
|
})
|
|
193
198
|
]),
|
|
194
199
|
_: 1
|
|
195
200
|
}),
|
|
196
|
-
t(
|
|
201
|
+
t(j, {
|
|
197
202
|
align: "end",
|
|
198
203
|
class: "w-52"
|
|
199
204
|
}, {
|
|
200
205
|
default: n(() => [
|
|
201
|
-
t(
|
|
206
|
+
t(T, null, {
|
|
202
207
|
default: n(() => [
|
|
203
|
-
|
|
208
|
+
a(_)("create-agendas") ? (o(), v(A, {
|
|
204
209
|
key: 0,
|
|
205
|
-
onClick: (
|
|
210
|
+
onClick: (E) => H(l.id)
|
|
206
211
|
}, {
|
|
207
212
|
default: n(() => [
|
|
208
|
-
t(
|
|
209
|
-
e[12] || (e[12] =
|
|
213
|
+
t(a(se)),
|
|
214
|
+
e[12] || (e[12] = d(" Duplicate Agenda ", -1))
|
|
210
215
|
]),
|
|
211
216
|
_: 1
|
|
212
|
-
}, 8, ["onClick"])) :
|
|
213
|
-
t(
|
|
217
|
+
}, 8, ["onClick"])) : M("", !0),
|
|
218
|
+
t(A, null, {
|
|
214
219
|
default: n(() => [
|
|
215
|
-
t(
|
|
216
|
-
e[13] || (e[13] =
|
|
220
|
+
t(a(ie)),
|
|
221
|
+
e[13] || (e[13] = d(" API Set-up ", -1))
|
|
217
222
|
]),
|
|
218
223
|
_: 1
|
|
219
224
|
}),
|
|
220
|
-
t(
|
|
221
|
-
onClick: (
|
|
225
|
+
t(A, {
|
|
226
|
+
onClick: (E) => R(l.id)
|
|
222
227
|
}, {
|
|
223
228
|
default: n(() => [
|
|
224
|
-
t(
|
|
225
|
-
e[14] || (e[14] =
|
|
229
|
+
t(a(de)),
|
|
230
|
+
e[14] || (e[14] = d(" Export Agenda ", -1))
|
|
226
231
|
]),
|
|
227
232
|
_: 1
|
|
228
233
|
}, 8, ["onClick"]),
|
|
229
|
-
|
|
234
|
+
a(_)("delete-agendas") ? (o(), v(A, {
|
|
230
235
|
key: 1,
|
|
231
236
|
variant: "destructive",
|
|
232
|
-
onClick: (
|
|
237
|
+
onClick: (E) => J(l.id)
|
|
233
238
|
}, {
|
|
234
239
|
default: n(() => [
|
|
235
|
-
t(
|
|
236
|
-
e[15] || (e[15] =
|
|
240
|
+
t(a(re)),
|
|
241
|
+
e[15] || (e[15] = d(" Remove Agenda ", -1))
|
|
237
242
|
]),
|
|
238
243
|
_: 1
|
|
239
|
-
}, 8, ["onClick"])) :
|
|
244
|
+
}, 8, ["onClick"])) : M("", !0)
|
|
240
245
|
]),
|
|
241
246
|
_: 2
|
|
242
247
|
}, 1024)
|
|
@@ -250,48 +255,48 @@ const ue = { class: "container mx-auto p-8" }, ce = { key: 0 }, pe = { class: "f
|
|
|
250
255
|
_: 2
|
|
251
256
|
}, 1024))
|
|
252
257
|
])
|
|
253
|
-
], 10,
|
|
254
|
-
|
|
255
|
-
t(
|
|
258
|
+
], 10, ye))), 128)),
|
|
259
|
+
a(_)("create-agendas") ? (o(), f("div", Ae, [
|
|
260
|
+
t(S, null, {
|
|
256
261
|
default: n(() => [
|
|
257
|
-
t(
|
|
258
|
-
onClick: e[2] || (e[2] = (
|
|
262
|
+
t(g, {
|
|
263
|
+
onClick: e[2] || (e[2] = (l) => a(C)("/create")),
|
|
259
264
|
class: "border-r"
|
|
260
265
|
}, {
|
|
261
266
|
default: n(() => [...e[16] || (e[16] = [
|
|
262
|
-
|
|
267
|
+
d("New Agenda", -1)
|
|
263
268
|
])]),
|
|
264
269
|
_: 1
|
|
265
270
|
}),
|
|
266
|
-
t(
|
|
271
|
+
t(B, null, {
|
|
267
272
|
default: n(() => [
|
|
268
|
-
t(
|
|
273
|
+
t(N, { "as-child": "" }, {
|
|
269
274
|
default: n(() => [
|
|
270
|
-
t(
|
|
275
|
+
t(g, {
|
|
271
276
|
size: "icon",
|
|
272
277
|
"aria-label": "More Options"
|
|
273
278
|
}, {
|
|
274
279
|
default: n(() => [
|
|
275
|
-
t(
|
|
280
|
+
t(a(z))
|
|
276
281
|
]),
|
|
277
282
|
_: 1
|
|
278
283
|
})
|
|
279
284
|
]),
|
|
280
285
|
_: 1
|
|
281
286
|
}),
|
|
282
|
-
t(
|
|
287
|
+
t(j, {
|
|
283
288
|
align: "end",
|
|
284
289
|
class: "w-52"
|
|
285
290
|
}, {
|
|
286
291
|
default: n(() => [
|
|
287
|
-
t(
|
|
292
|
+
t(T, null, {
|
|
288
293
|
default: n(() => [
|
|
289
|
-
t(
|
|
290
|
-
onClick: e[3] || (e[3] = (
|
|
294
|
+
t(A, {
|
|
295
|
+
onClick: e[3] || (e[3] = (l) => I.value.click())
|
|
291
296
|
}, {
|
|
292
297
|
default: n(() => [
|
|
293
|
-
t(
|
|
294
|
-
e[17] || (e[17] =
|
|
298
|
+
t(a(ue)),
|
|
299
|
+
e[17] || (e[17] = d(" Import Agendas... ", -1))
|
|
295
300
|
]),
|
|
296
301
|
_: 1
|
|
297
302
|
})
|
|
@@ -307,13 +312,13 @@ const ue = { class: "container mx-auto p-8" }, ce = { key: 0 }, pe = { class: "f
|
|
|
307
312
|
]),
|
|
308
313
|
_: 1
|
|
309
314
|
})
|
|
310
|
-
])) :
|
|
315
|
+
])) : M("", !0)
|
|
311
316
|
]))
|
|
312
317
|
]),
|
|
313
318
|
p("input", {
|
|
314
319
|
type: "file",
|
|
315
320
|
ref_key: "importAgendasInput",
|
|
316
|
-
ref:
|
|
321
|
+
ref: I,
|
|
317
322
|
class: "hidden",
|
|
318
323
|
accept: ".json,application/json",
|
|
319
324
|
onChange: F
|
|
@@ -323,5 +328,5 @@ const ue = { class: "container mx-auto p-8" }, ce = { key: 0 }, pe = { class: "f
|
|
|
323
328
|
}
|
|
324
329
|
});
|
|
325
330
|
export {
|
|
326
|
-
|
|
331
|
+
Ie as default
|
|
327
332
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),C=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={class:"text-lg font-medium"},K={class:"text-sm text-muted-foreground"},X={key:0},Q={key:1},W={key:0,class:"flex justify-end mt-8"},Z=e.defineComponent({__name:"Overview",setup(ee){const{config:u}=C.useModule(),v=C.useFirebaseIntegration(u.project),{navigateTo:p}=C.useModuleRoute(),{confirm:b}=C.useConfirmation(),{hasPermission:c}=C.useModulePermissions();C.useModuleBreadcrumbs(()=>[]);const k=e.ref(null),d=e.ref(!1),a=e.ref([]),V=e.ref("importAgendasInput"),A=n=>{d.value=!0,a.value=[n]},N=async()=>{k.value=await v.find(u.agendaCollection)},M=async n=>{if(!c("create-agendas"))return;const t=await v.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 v.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 v.remove(u.agendaCollection,n),await N())},D=async()=>{let n=k.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=[]},I=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 v.add(u.agendaCollection,f);t.value="",await N()},$=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"),w=e.resolveComponent("DropdownMenuTrigger"),g=e.resolveComponent("DropdownMenuItem"),_=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,[k.value===null?(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(l,{class:"mx-auto"})])):k.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:D,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(k.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:x=>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:$},[e.createElementVNode("h3",Y,e.toDisplayString(o.serviceName),1),e.createElementVNode("p",K,[o.type==="regular"?(e.openBlock(),e.createElementBlock("span",X,"Regular Agenda")):e.createCommentVNode("",!0)])]),d.value?(e.openBlock(),e.createElementBlock("div",Q,[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:x=>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:x=>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(w,{"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(_,null,{default:e.withCtx(()=>[e.unref(c)("create-agendas")?(e.openBlock(),e.createBlock(g,{key:0,onClick:x=>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(g,null,{default:e.withCtx(()=>[e.createVNode(e.unref(s.ChevronsLeftRightEllipsis)),t[13]||(t[13]=e.createTextVNode(" API Set-up ",-1))]),_:1}),e.createVNode(g,{onClick:x=>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(g,{key:1,variant:"destructive",onClick:x=>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",W,[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(w,{"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(_,null,{default:e.withCtx(()=>[e.createVNode(g,{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:I},null,544)],64)}}});exports.default=Z;
|