@oneclick.dev/cms-core-modules 0.0.83 → 0.0.84
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-CxKirDdL.mjs → ContentEditor-DPhhOkx3.mjs} +7068 -5926
- package/dist/{ContentEditor-CRFkD4tE.js → ContentEditor-DrxtH_Hq.js} +42 -42
- package/dist/{Create-CsqVYhPO.mjs → Create-6uT9HWar.mjs} +35 -35
- package/dist/{Create-ip0MnS0o.js → Create-DuZ5nZrX.js} +1 -1
- package/dist/{DateFormatter-CvOfaUnU.mjs → DateFormatter-2B0R-DY4.mjs} +204 -400
- package/dist/DateFormatter-DbtOLV0L.js +1 -0
- package/dist/{Detail-RMXFuSRQ.js → Detail-BZ-iE9vf.js} +1 -1
- package/dist/{Detail-B4b_FLDa.mjs → Detail-C1Blq61w.mjs} +90 -90
- package/dist/{Detail-BayNaAg9.js → Detail-C8wQiDcv.js} +1 -1
- package/dist/{Detail-CbLk1v37.mjs → Detail-CJVMJDP7.mjs} +17 -17
- package/dist/{Detail-CnK-qbhE.js → Detail-CPqug27l.js} +1 -1
- package/dist/Detail-CjuhjPby.js +1 -0
- package/dist/{Detail-U0mgLKt6.mjs → Detail-CtItxMX4.mjs} +62 -63
- package/dist/{Detail-CVgWHbMC.mjs → Detail-Dnpnmy4-.mjs} +158 -158
- package/dist/{Entries-D7MHylQE.mjs → Entries-BkOPae4R.mjs} +49 -49
- package/dist/Entries-CcEW98F5.js +1 -0
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-CDc8MIq2.mjs → NewReservationDialog.vue_vue_type_script_setup_true_lang-Bc946oSc.mjs} +1 -1
- package/dist/{NewReservationDialog.vue_vue_type_script_setup_true_lang-StaNp-3y.js → NewReservationDialog.vue_vue_type_script_setup_true_lang-CqERfyYb.js} +1 -1
- package/dist/{Overview-CwCAeBnX.js → Overview-CA8wh_BI.js} +1 -1
- package/dist/{Overview-CgViRnNc.mjs → Overview-D4MFwRI_.mjs} +67 -68
- package/dist/{Overview-B2bFNGhH.js → Overview-Da0XexiT.js} +1 -1
- package/dist/Overview-DeQQ0FY3.js +1 -0
- package/dist/{Overview--XpvBbqz.mjs → Overview-DoOASlNz.mjs} +1 -3
- package/dist/{Overview-Cczt_dcE.mjs → Overview-gJSvftdE.mjs} +34 -34
- package/dist/{ReservationDetailDialog.vue_vue_type_script_setup_true_lang-B7ks5mbf.mjs → ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Cohhnd5x.mjs} +0 -1
- package/dist/{ReservationDetailDialog.vue_vue_type_script_setup_true_lang-Vxubki_v.js → ReservationDetailDialog.vue_vue_type_script_setup_true_lang-VWVIxIr6.js} +1 -1
- package/dist/{SeoHealth-ZpvB7CS2.mjs → SeoHealth-Bc5chnaa.mjs} +14 -14
- package/dist/{SeoHealth-DFZ0LLBH.js → SeoHealth-BkpJ1F2Y.js} +1 -1
- package/dist/TableView-BPWAx--G.mjs +5743 -0
- package/dist/TableView-D63QrVlK.js +4 -0
- package/dist/View-BL70u98U.js +1 -0
- package/dist/{View-DDXN0tKD.mjs → View-BO5N911y.mjs} +5 -5
- package/dist/{agenda-Cl3s_FIE.mjs → agenda-C5grvzSa.mjs} +166 -169
- package/dist/agenda-DXMwVWpN.js +1 -0
- package/dist/{availability-B-tRp8hB.mjs → availability-C1NqOFsQ.mjs} +81 -81
- package/dist/{availability-BiBbzEIM.js → availability-D_wnfLsH.js} +1 -1
- package/dist/cms-core-modules.css +1 -1
- package/dist/{exceptions-DQPSFSj7.mjs → exceptions-BIwMhYa4.mjs} +1 -1
- package/dist/{exceptions-BA3PsW4n.js → exceptions-Cn7zooEu.js} +1 -1
- package/dist/{index-CBC9dWZ9.js → index-C9pSS15N.js} +2 -2
- package/dist/{index-YOOlBEZB.mjs → index-MwjeLHPP.mjs} +3 -3
- package/dist/index.cjs.js +1 -1
- package/dist/index.mjs +22 -22
- package/dist/orders-CG1QUCN8.js +1 -0
- package/dist/{orders-DZzdsHOW.mjs → orders-CeixEBcU.mjs} +57 -58
- package/dist/server-handlers.cjs.js +1 -1
- package/dist/server-handlers.mjs +142 -147
- package/package.json +2 -2
- package/dist/DateFormatter-ls6HfWpS.js +0 -1
- package/dist/Detail-BcboL7NF.js +0 -1
- package/dist/Entries-BPkZ7Jg5.js +0 -1
- package/dist/Overview-B-8TLLjh.js +0 -1
- package/dist/TableView-BUPPcHUW.mjs +0 -89505
- package/dist/TableView-CksiPsTL.js +0 -586
- package/dist/View-DfzaVOzS.js +0 -1
- package/dist/agenda-rlFma_wn.js +0 -1
- package/dist/floating-ui.dom-B9WYoHj2.js +0 -1
- package/dist/floating-ui.dom-fpIfhXTZ.mjs +0 -1291
- package/dist/index-DYpruS-A-Cw57iwdY.mjs +0 -4210
- package/dist/index-DYpruS-A-DwDXo9Tq.js +0 -88
- package/dist/index-YMaY4uuk-BgpTtr73.js +0 -1
- package/dist/index-YMaY4uuk-C_xV5K9Z.mjs +0 -1300
- package/dist/orders-tP4WdF5q.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as B, inject as Q, ref as R, resolveComponent as
|
|
1
|
+
import { defineComponent as B, inject as Q, ref as R, resolveComponent as i, openBlock as d, createBlock as O, withCtx as s, createVNode as n, createElementVNode as o, createTextVNode as v, isRef as N, unref as e, createElementBlock as b, toDisplayString as _, createCommentVNode as f, watch as ee, Fragment as X, renderList as H, normalizeClass as te, computed as oe, onMounted as ne, provide as se } from "vue";
|
|
2
2
|
import { u as W, a as S, t as le, o as ie, p as J, c as q, s as F, b as ae, f as de } from "./vee-validate-zod-CcOwoF6y.mjs";
|
|
3
3
|
import { r as j } from "./countries-BTPvmrsb.mjs";
|
|
4
4
|
import { ChevronsUpDown as re, Search as ce, Check as ue, X as pe, Tag as me, ChevronRight as fe, Trash as _e, Loader2 as K } from "lucide-vue-next";
|
|
@@ -16,10 +16,10 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
16
16
|
}, Se = /* @__PURE__ */ B({
|
|
17
17
|
__name: "Main",
|
|
18
18
|
setup(P) {
|
|
19
|
-
const x = Q("isLoadingCompleted", R(!1)), { errors: l } = W(), { value:
|
|
19
|
+
const x = Q("isLoadingCompleted", R(!1)), { errors: l } = W(), { value: u } = S("title"), { value: a } = S("description"), { value: r } = S("price");
|
|
20
20
|
return (g, t) => {
|
|
21
|
-
const m =
|
|
22
|
-
return d(), O(
|
|
21
|
+
const m = i("Label"), h = i("Input"), C = i("Textarea"), I = i("CardContent"), T = i("Card");
|
|
22
|
+
return d(), O(T, null, {
|
|
23
23
|
default: s(() => [
|
|
24
24
|
n(I, { class: "flex flex-col gap-4" }, {
|
|
25
25
|
default: s(() => [
|
|
@@ -38,8 +38,8 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
38
38
|
type: "text",
|
|
39
39
|
id: "title",
|
|
40
40
|
placeholder: e(x) ? "Fast shipping" : "",
|
|
41
|
-
modelValue: e(
|
|
42
|
-
"onUpdate:modelValue": t[0] || (t[0] = (M) => N(
|
|
41
|
+
modelValue: e(u),
|
|
42
|
+
"onUpdate:modelValue": t[0] || (t[0] = (M) => N(u) ? u.value = M : null)
|
|
43
43
|
}, null, 8, ["placeholder", "modelValue"]),
|
|
44
44
|
e(l).title ? (d(), b("p", ye, _(e(l).title), 1)) : f("", !0)
|
|
45
45
|
])
|
|
@@ -58,8 +58,8 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
58
58
|
n(C, {
|
|
59
59
|
id: "description",
|
|
60
60
|
placeholder: e(x) ? "Ships next day" : "",
|
|
61
|
-
modelValue: e(
|
|
62
|
-
"onUpdate:modelValue": t[1] || (t[1] = (M) => N(
|
|
61
|
+
modelValue: e(a),
|
|
62
|
+
"onUpdate:modelValue": t[1] || (t[1] = (M) => N(a) ? a.value = M : null)
|
|
63
63
|
}, null, 8, ["placeholder", "modelValue"]),
|
|
64
64
|
e(l).description ? (d(), b("p", Oe, _(e(l).description), 1)) : f("", !0)
|
|
65
65
|
])
|
|
@@ -102,32 +102,32 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
102
102
|
__name: "Countries",
|
|
103
103
|
setup(P) {
|
|
104
104
|
const { errors: x } = W(), { value: l } = S("countries");
|
|
105
|
-
return ee(l, (
|
|
106
|
-
let
|
|
107
|
-
for (let g = 0; g <
|
|
108
|
-
if (
|
|
105
|
+
return ee(l, (u) => {
|
|
106
|
+
let a = u?.sort((g, t) => !g || !t ? 0 : j.find((m) => m.cca2 === g)?.name.common.localeCompare(j.find((m) => m.cca2 === t)?.name.common)), r = !0;
|
|
107
|
+
for (let g = 0; g < u.length; g++)
|
|
108
|
+
if (u[g] !== l.value[g]) {
|
|
109
109
|
r = !1;
|
|
110
110
|
break;
|
|
111
111
|
}
|
|
112
|
-
r || (l.value =
|
|
113
|
-
}), (
|
|
114
|
-
const r =
|
|
115
|
-
return d(), O(
|
|
112
|
+
r || (l.value = a);
|
|
113
|
+
}), (u, a) => {
|
|
114
|
+
const r = i("Label"), g = i("Button"), t = i("ComboboxTrigger"), m = i("ComboboxAnchor"), h = i("ComboboxInput"), C = i("ComboboxEmpty"), I = i("ComboboxItemIndicator"), T = i("ComboboxItem"), M = i("ComboboxGroup"), w = i("ComboboxList"), G = i("Combobox"), D = i("CardContent"), z = i("Card");
|
|
115
|
+
return d(), O(z, null, {
|
|
116
116
|
default: s(() => [
|
|
117
117
|
n(D, { class: "flex flex-col gap-4" }, {
|
|
118
118
|
default: s(() => [
|
|
119
|
-
|
|
119
|
+
a[3] || (a[3] = o("h3", { class: "text-lg font-semibold mb-4" }, "Countries", -1)),
|
|
120
120
|
o("div", Ne, [
|
|
121
121
|
o("div", Le, [
|
|
122
122
|
n(r, { class: "text-sm mb-2" }, {
|
|
123
|
-
default: s(() => [...
|
|
123
|
+
default: s(() => [...a[1] || (a[1] = [
|
|
124
124
|
v("For which countries should this option be available?", -1)
|
|
125
125
|
])]),
|
|
126
126
|
_: 1
|
|
127
127
|
}),
|
|
128
128
|
n(G, {
|
|
129
129
|
modelValue: e(l),
|
|
130
|
-
"onUpdate:modelValue":
|
|
130
|
+
"onUpdate:modelValue": a[0] || (a[0] = (y) => N(l) ? l.value = y : null),
|
|
131
131
|
multiple: !0
|
|
132
132
|
}, {
|
|
133
133
|
default: s(() => [
|
|
@@ -163,14 +163,14 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
163
163
|
])
|
|
164
164
|
]),
|
|
165
165
|
n(C, null, {
|
|
166
|
-
default: s(() => [...
|
|
166
|
+
default: s(() => [...a[2] || (a[2] = [
|
|
167
167
|
v(" No countries found. ", -1)
|
|
168
168
|
])]),
|
|
169
169
|
_: 1
|
|
170
170
|
}),
|
|
171
171
|
n(M, { class: "max-h-72 overflow-y-scroll" }, {
|
|
172
172
|
default: s(() => [
|
|
173
|
-
(d(!0), b(X, null, H(e(j), (y) => (d(), O(
|
|
173
|
+
(d(!0), b(X, null, H(e(j), (y) => (d(), O(T, {
|
|
174
174
|
key: y.cca2,
|
|
175
175
|
value: y.cca2
|
|
176
176
|
}, {
|
|
@@ -244,19 +244,19 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
244
244
|
}, ct = /* @__PURE__ */ B({
|
|
245
245
|
__name: "Condition",
|
|
246
246
|
setup(P) {
|
|
247
|
-
const x = Q("isLoadingCompleted", R(!1)), { errors: l } = W(), { value:
|
|
247
|
+
const x = Q("isLoadingCompleted", R(!1)), { errors: l } = W(), { value: u } = S("condition"), { value: a } = S("condition_min"), { value: r } = S("condition_max");
|
|
248
248
|
return (g, t) => {
|
|
249
|
-
const m =
|
|
249
|
+
const m = i("RadioGroupItem"), h = i("Label"), C = i("RadioGroup"), I = i("Input"), T = i("CardContent"), M = i("Card");
|
|
250
250
|
return d(), O(M, null, {
|
|
251
251
|
default: s(() => [
|
|
252
|
-
n(
|
|
252
|
+
n(T, { class: "flex flex-col gap-4" }, {
|
|
253
253
|
default: s(() => [
|
|
254
254
|
t[16] || (t[16] = o("h3", { class: "text-lg font-semibold mb-4" }, "Condition", -1)),
|
|
255
255
|
t[17] || (t[17] = o("p", null, " Specify when this option should be available ", -1)),
|
|
256
256
|
n(C, {
|
|
257
257
|
"default-value": "always",
|
|
258
|
-
modelValue: e(
|
|
259
|
-
"onUpdate:modelValue": t[0] || (t[0] = (w) => N(
|
|
258
|
+
modelValue: e(u),
|
|
259
|
+
"onUpdate:modelValue": t[0] || (t[0] = (w) => N(u) ? u.value = w : null),
|
|
260
260
|
class: te(["flex flex-col transition-all duration-300", { "opacity-0 pointer-events-none": !e(x) }])
|
|
261
261
|
}, {
|
|
262
262
|
default: s(() => [
|
|
@@ -299,7 +299,7 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
299
299
|
]),
|
|
300
300
|
_: 1
|
|
301
301
|
}, 8, ["modelValue", "class"]),
|
|
302
|
-
e(
|
|
302
|
+
e(u) === "weight_based" ? (d(), b("div", qe, [
|
|
303
303
|
o("div", We, [
|
|
304
304
|
o("div", Xe, [
|
|
305
305
|
n(h, {
|
|
@@ -317,8 +317,8 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
317
317
|
id: "condition_min",
|
|
318
318
|
min: "0",
|
|
319
319
|
placeholder: "0",
|
|
320
|
-
modelValue: e(
|
|
321
|
-
"onUpdate:modelValue": t[1] || (t[1] = (w) => N(
|
|
320
|
+
modelValue: e(a),
|
|
321
|
+
"onUpdate:modelValue": t[1] || (t[1] = (w) => N(a) ? a.value = w : null),
|
|
322
322
|
class: "no-spinner pr-10"
|
|
323
323
|
}, null, 8, ["modelValue"]),
|
|
324
324
|
t[9] || (t[9] = o("span", { class: "absolute pointer-events-none top-1/2 right-3 -translate-y-1/2 text-sm text-muted-foreground" }, "kg", -1))
|
|
@@ -352,7 +352,7 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
352
352
|
e(l).condition_max ? (d(), b("p", et, _(e(l).condition_max), 1)) : f("", !0)
|
|
353
353
|
])
|
|
354
354
|
])
|
|
355
|
-
])) : e(
|
|
355
|
+
])) : e(u) === "price_based" ? (d(), b("div", tt, [
|
|
356
356
|
o("div", ot, [
|
|
357
357
|
o("div", nt, [
|
|
358
358
|
n(h, {
|
|
@@ -370,8 +370,8 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
370
370
|
id: "condition_min",
|
|
371
371
|
min: "0",
|
|
372
372
|
placeholder: "0, 00",
|
|
373
|
-
modelValue: e(
|
|
374
|
-
"onUpdate:modelValue": t[3] || (t[3] = (w) => N(
|
|
373
|
+
modelValue: e(a),
|
|
374
|
+
"onUpdate:modelValue": t[3] || (t[3] = (w) => N(a) ? a.value = w : null),
|
|
375
375
|
class: "no-spinner pl-8"
|
|
376
376
|
}, null, 8, ["modelValue"]),
|
|
377
377
|
t[13] || (t[13] = o("span", { class: "absolute pointer-events-none top-1/2 left-3 -translate-y-1/2 text-sm text-muted-foreground" }, "€", -1))
|
|
@@ -420,9 +420,9 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
420
420
|
}, _t = { class: "ml-auto shrink-0" }, xt = { class: "font-bold" }, vt = /* @__PURE__ */ B({
|
|
421
421
|
__name: "Example",
|
|
422
422
|
setup(P) {
|
|
423
|
-
const { value: x } = S("title"), { value: l } = S("description"), { value:
|
|
424
|
-
return (
|
|
425
|
-
const g =
|
|
423
|
+
const { value: x } = S("title"), { value: l } = S("description"), { value: u } = S("price");
|
|
424
|
+
return (a, r) => {
|
|
425
|
+
const g = i("CardContent"), t = i("Card");
|
|
426
426
|
return d(), O(t, null, {
|
|
427
427
|
default: s(() => [
|
|
428
428
|
n(g, null, {
|
|
@@ -439,7 +439,7 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
439
439
|
e(l) ? (d(), b("p", ft, _(e(l)), 1)) : f("", !0)
|
|
440
440
|
]),
|
|
441
441
|
o("div", _t, [
|
|
442
|
-
o("p", xt, _(e(
|
|
442
|
+
o("p", xt, _(e(u) ? "€" + e(u).toFixed(2) : "FREE"), 1)
|
|
443
443
|
])
|
|
444
444
|
])
|
|
445
445
|
]),
|
|
@@ -462,26 +462,26 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
462
462
|
}
|
|
463
463
|
},
|
|
464
464
|
setup(P) {
|
|
465
|
-
const x = P, { hasPermission: l, hasAnyPermission:
|
|
465
|
+
const x = P, { hasPermission: l, hasAnyPermission: u } = xe(), { params: a, navigateTo: r } = ve(), { confirm: g } = be(), t = ge(x.config.project), m = oe(() => !a.value.optionId || a.value.optionId === "new"), h = R(!1), C = R(!1), I = le(ie({
|
|
466
466
|
id: F().optional(),
|
|
467
467
|
status: F().optional(),
|
|
468
468
|
title: F().min(1, "Title is required"),
|
|
469
469
|
description: F().optional(),
|
|
470
470
|
price: J(
|
|
471
|
-
(
|
|
471
|
+
(p) => p === "" ? void 0 : p,
|
|
472
472
|
q.number().positive("Must be positive").optional()
|
|
473
473
|
),
|
|
474
474
|
countries: ae(F()).optional(),
|
|
475
475
|
condition: F(),
|
|
476
476
|
condition_min: J(
|
|
477
|
-
(
|
|
477
|
+
(p) => p === "" ? void 0 : p,
|
|
478
478
|
q.number().positive("Must be positive").optional()
|
|
479
479
|
),
|
|
480
480
|
condition_max: J(
|
|
481
|
-
(
|
|
481
|
+
(p) => p === "" ? void 0 : p,
|
|
482
482
|
q.number().positive("Must be positive").optional()
|
|
483
483
|
)
|
|
484
|
-
})), { handleSubmit:
|
|
484
|
+
})), { handleSubmit: T, errors: M, values: w, setValues: G } = de({
|
|
485
485
|
validationSchema: I,
|
|
486
486
|
initialValues: {
|
|
487
487
|
status: "published",
|
|
@@ -492,33 +492,32 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
492
492
|
he(() => [
|
|
493
493
|
{ text: w.title ?? "New Option" }
|
|
494
494
|
]);
|
|
495
|
-
const D =
|
|
495
|
+
const D = T(async (p) => {
|
|
496
496
|
C.value = !0;
|
|
497
|
-
let c = await
|
|
497
|
+
let c = await z() || [];
|
|
498
498
|
if (m.value) {
|
|
499
|
-
let k = JSON.parse(JSON.stringify(
|
|
499
|
+
let k = JSON.parse(JSON.stringify(p));
|
|
500
500
|
k.id = crypto.randomUUID();
|
|
501
501
|
const V = [...c, k], $ = x.config.shippingOptionsCollection.split(":");
|
|
502
502
|
await t.update($[0], null, { [$[1]]: V }), r(k.id), E.success("Shipping option created");
|
|
503
503
|
} else {
|
|
504
|
-
let k = JSON.parse(JSON.stringify(
|
|
505
|
-
const V = c.map((
|
|
506
|
-
await t.update($[0], null, { [$[1]]: V }), r(`${
|
|
504
|
+
let k = JSON.parse(JSON.stringify(p));
|
|
505
|
+
const V = c.map((U) => U.id === a.value.optionId ? k : U), $ = x.config.shippingOptionsCollection.split(":");
|
|
506
|
+
await t.update($[0], null, { [$[1]]: V }), r(`${a.value.optionId}`), E.success("Shipping option updated");
|
|
507
507
|
}
|
|
508
508
|
C.value = !1;
|
|
509
|
-
}),
|
|
509
|
+
}), z = async () => {
|
|
510
510
|
if (!x.config.shippingOptionsCollection) return [];
|
|
511
|
-
const
|
|
512
|
-
return
|
|
511
|
+
const p = x.config.shippingOptionsCollection.split(":");
|
|
512
|
+
return p.length !== 2 ? [] : (await t.get(p[0]))?.[p[1]] || [];
|
|
513
513
|
}, y = async () => {
|
|
514
|
-
const c = (await
|
|
514
|
+
const c = (await z()).find((k) => k.id === a.value.optionId);
|
|
515
515
|
G(c), h.value = !0;
|
|
516
516
|
}, L = async () => {
|
|
517
517
|
try {
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
const V = [...await U() || [], c], $ = x.config.shippingOptionsCollection.split(":");
|
|
518
|
+
let c = { ...[...await z() || []].find((U) => U.id === a.value.optionId) };
|
|
519
|
+
c.id = crypto.randomUUID(), c.status = "published", c.title = c.title + " (copy)";
|
|
520
|
+
const V = [...await z() || [], c], $ = x.config.shippingOptionsCollection.split(":");
|
|
522
521
|
await t.update($[0], null, { [$[1]]: V }), r(c.id), E.success("Option duplicated");
|
|
523
522
|
} catch {
|
|
524
523
|
E.error("Failed to duplicate option");
|
|
@@ -526,9 +525,9 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
526
525
|
}, A = async () => {
|
|
527
526
|
if (await g("Are you sure you want to delete this option?"))
|
|
528
527
|
try {
|
|
529
|
-
const c = await
|
|
530
|
-
if (c.length === 0 || !
|
|
531
|
-
const k = c.filter(($) => $.id !==
|
|
528
|
+
const c = await z() || [];
|
|
529
|
+
if (c.length === 0 || !a.value.optionId) throw new Error("Error loading values");
|
|
530
|
+
const k = c.filter(($) => $.id !== a.value.optionId), V = x.config.shippingOptionsCollection.split(":");
|
|
532
531
|
await t.update(V[0], null, { [V[1]]: k }), r(""), E.success("Option deleted");
|
|
533
532
|
} catch {
|
|
534
533
|
E.error("Failed to delete option");
|
|
@@ -536,8 +535,8 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
536
535
|
};
|
|
537
536
|
return ne(() => {
|
|
538
537
|
m.value ? h.value = !0 : y();
|
|
539
|
-
}), se("isLoadingCompleted", h), (
|
|
540
|
-
const k =
|
|
538
|
+
}), se("isLoadingCompleted", h), (p, c) => {
|
|
539
|
+
const k = i("Button"), V = i("MenubarTrigger"), $ = i("MenubarMenu"), U = i("MenubarItem"), Y = i("MenubarContent"), Z = i("Menubar");
|
|
541
540
|
return d(), b("div", bt, [
|
|
542
541
|
o("div", gt, [
|
|
543
542
|
o("div", ht, [
|
|
@@ -569,7 +568,7 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
569
568
|
]),
|
|
570
569
|
_: 1
|
|
571
570
|
})) : f("", !0),
|
|
572
|
-
e(
|
|
571
|
+
e(u)("edit-collection", "delete-option") ? (d(), O($, { key: 1 }, {
|
|
573
572
|
default: s(() => [
|
|
574
573
|
n(V, null, {
|
|
575
574
|
default: s(() => [...c[2] || (c[2] = [
|
|
@@ -579,7 +578,7 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
579
578
|
}),
|
|
580
579
|
n(Y, null, {
|
|
581
580
|
default: s(() => [
|
|
582
|
-
e(l)("delete-option") ? (d(), O(
|
|
581
|
+
e(l)("delete-option") ? (d(), O(U, {
|
|
583
582
|
key: 0,
|
|
584
583
|
variant: "destructive",
|
|
585
584
|
onClick: A
|
|
@@ -610,7 +609,7 @@ const Ce = { class: "flex flex-col gap-4" }, we = { class: "flex flex-col gap-2"
|
|
|
610
609
|
n(vt)
|
|
611
610
|
])
|
|
612
611
|
]),
|
|
613
|
-
e(
|
|
612
|
+
e(u)("create-option", "edit-option") ? (d(), b("div", $t, [
|
|
614
613
|
o("div", Ot, [
|
|
615
614
|
m.value && e(l)("create-option") ? (d(), O(k, {
|
|
616
615
|
key: 0,
|