@feedmepos/mf-menu 0.31.70-beta.1 → 0.31.71-alpha.1
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/{App-BYrM7eu_.js → App-C1efkJzL.js} +8 -8
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-DW7WWXPt.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BHDnLuRy.js} +3 -3
- package/dist/{Catalog-DsDT7UmG.js → Catalog-BJjTCl9l.js} +6 -6
- package/dist/{Category-BPYNqqBt.js → Category-C35HseX2.js} +6 -6
- package/dist/{Category-Bh2JPkuX.js → Category-CxrTHk1Y.js} +4 -4
- package/dist/{CookingGuide-trVQ95-q.js → CookingGuide-BwEQicZ8.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-BotLSdlH.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-DhiJEKXO.js} +1 -1
- package/dist/{Group-Cuquhrwi.js → Group-2MAzdN5P.js} +1 -1
- package/dist/{Group-Bcpohxou.js → Group-C_AO4FGn.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-CjA8BFdo.js → Group.vue_vue_type_script_setup_true_lang-DjEPQI2w.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-STwkKlm-.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Cttg3YhQ.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DzGvvAPu.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-8pgeYhp4.js} +7 -7
- package/dist/{Ingredient-CJThMjBf.js → Ingredient-CL_5yWPs.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-BCSXXPGZ.js → InventoryBinding.vue_vue_type_script_setup_true_lang-Di42poKp.js} +2 -2
- package/dist/{LinkProductSideSheet-yD0LZrwl.js → LinkProductSideSheet-Buso155W.js} +3 -3
- package/dist/{MenuSetting-39ILtlpj.js → MenuSetting-CnREg4Yu.js} +5 -5
- package/dist/{PrintRoute-Bo3Uj4WD.js → PrintRoute-C9sWURzn.js} +4 -4
- package/dist/{Product-D-4vOHWb.js → Product-BLRDuiIG.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-DWYIsOXd.js → Product.vue_vue_type_script_setup_true_lang-BpKLqY3j.js} +13 -13
- package/dist/{ProductInternalTools-Cm8btjdU.js → ProductInternalTools-Cn2WRqm6.js} +5 -5
- package/dist/{Products-0a42qrIf.js → Products-BQBfz9A8.js} +11 -11
- package/dist/{Publish-T183LOMo.js → Publish-DMQ9O69V.js} +3 -3
- package/dist/{Recipe-DgLTUxSH.js → Recipe-CXEZt0zY.js} +4 -4
- package/dist/{Scheduler-D00RsNgV.js → Scheduler-hJTrqBhn.js} +3 -3
- package/dist/{ServingSequence-CvOj325Y.js → ServingSequence-CctiqLbz.js} +3 -3
- package/dist/{Setting-Bcsr3GKg.js → Setting-BrKRjfTn.js} +5 -5
- package/dist/{Subcategory-BHPc4SJ-.js → Subcategory-K0jGgZtU.js} +4 -4
- package/dist/{Takeaway-CQMta24J.js → Takeaway-DiJwhBwl.js} +4 -4
- package/dist/{Takeaway-DkTI4pSg.js → Takeaway-o5KBa5oX.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-C7XBPnMH.js → Takeaway.vue_vue_type_script_setup_true_lang-BpgD3grk.js} +5 -5
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-CBA38mrS.js → Thumbnail.vue_vue_type_script_setup_true_lang-BCejAD3E.js} +4 -4
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D0w9G7dB.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CMZfeg2n.js} +625 -625
- package/dist/{Unit-DIiTje9a.js → Unit-BAy6O7xD.js} +2 -2
- package/dist/{Variant-DHZT93Sn.js → Variant-BtXJASw_.js} +3 -3
- package/dist/{_id_-CcOB_m8o.js → _id_-HD8T1NGg.js} +10 -10
- package/dist/{app-BkPmvRZw.js → app-Bp1A4ItJ.js} +26 -26
- package/dist/{app-CZJoDdrX.js → app-C7AqPK-c.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/assets/{linked-status-BxY5iXlt.js → linked-status-DmzniV97.js} +2 -2
- package/dist/assets/{override-menu-DMGB4GDq.js → override-menu-CdzhzFFi.js} +2 -2
- package/dist/assets/{validate-menu-DwLkqjCY.js → validate-menu-BSL_Zd2w.js} +2 -2
- package/dist/{catalog-6Xdri8ZQ.js → catalog-XPyE5k4t.js} +1 -1
- package/dist/{catalogSetting-DiBo-LP9.js → catalogSetting-C-A9fWEC.js} +1 -1
- package/dist/{category-CWW_n9jw.js → category-DXZrXFYj.js} +1 -1
- package/dist/{currency-DVHB2Joi.js → currency-D939gSij.js} +1 -1
- package/dist/{customAttributes-Dw23OTrM.js → customAttributes-bw8OCoHr.js} +1 -1
- package/dist/{dayjs.min-Da7-BKoh.js → dayjs.min-C3Ch6D78.js} +1 -1
- package/dist/{index-mjnhuOLJ.js → index-B4t_Uzk7.js} +3 -3
- package/dist/{index-4ktPiS1O.js → index-BU5aiCzu.js} +4 -4
- package/dist/{index-DxGfr4bl.js → index-CPb1lDPU.js} +1 -1
- package/dist/{index-BYj-oT0C.js → index-Cq9qqaCC.js} +1 -1
- package/dist/{item-B4NROoTp.js → item-D4uNJyVR.js} +103 -103
- package/dist/{jszip.min-Cf8b4Zbq.js → jszip.min-15VIwqfl.js} +2 -2
- package/dist/{menu-Vir3t1K_.js → menu-BSAn1m0K.js} +1 -1
- package/dist/{menu-BfDt7AyU.js → menu-CPLvXPJu.js} +4 -4
- package/dist/{menuV2-CiI8Hnnx.js → menuV2-DZpI5Elt.js} +39 -39
- package/dist/{priceTier-CqS50iW2.js → priceTier-Bs5Ve98k.js} +1 -1
- package/dist/{scheduler-cGkprlVx.js → scheduler-BKwB9GfG.js} +4 -4
- package/dist/{subcategory-D0Yga-Ws.js → subcategory-DJW1_br9.js} +2 -2
- package/dist/{toExcel-D-dRa5v1.js → toExcel-C_lOM1fZ.js} +2 -2
- package/dist/{unit-CTuSt1jZ.js → unit-ioVHtQya.js} +2 -2
- package/package.json +2 -2
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { computed as D, shallowRef as Wt, ref as q, watch as ye, nextTick as nt, getCurrentInstance as xn, onMounted as Ae, defineComponent as ae, resolveComponent as W, createElementBlock as J, openBlock as $, createBlock as H, normalizeClass as fe, createElementVNode as A, createVNode as C, unref as o, withCtx as B, toDisplayString as ge, mergeModels as qt, useModel as Ht, createCommentVNode as X, resolveDirective as Xt, withDirectives as ft, createTextVNode as
|
|
2
|
-
import { g as An, o as Nn, f as Ln, a as Gn, n as Qt, _ as Zt, I as Kn, S as Bn, b as Dt, C as zn, R as We, c as en, d as Et, e as tn, h as Yn, m as jn, F as Wn, M as nn, j as qn, r as Hn, k as on, l as Nt, p as rn, q as Xn, P as Jn, s as Qn, t as an, u as Zn, T as Be } from "./item-
|
|
3
|
-
import { _ as eo, T as to } from "./app-
|
|
4
|
-
import { B as be, J as _e, A as te, G as ot, K as no, M as oo, N as ro, O as Vt, P as ao, D as Le, Q as lo, H as me, R as io, T as $t, I as ke, U as vt, V as so, W as uo, X as bt, Y as Lt, Z as co, u as ln, $ as mo } from "./menu-
|
|
1
|
+
import { computed as D, shallowRef as Wt, ref as q, watch as ye, nextTick as nt, getCurrentInstance as xn, onMounted as Ae, defineComponent as ae, resolveComponent as W, createElementBlock as J, openBlock as $, createBlock as H, normalizeClass as fe, createElementVNode as A, createVNode as C, unref as o, withCtx as B, toDisplayString as ge, mergeModels as qt, useModel as Ht, createCommentVNode as X, resolveDirective as Xt, withDirectives as ft, createTextVNode as Fn, renderSlot as Me, h as ve, Fragment as Oe, renderList as Ne, vShow as Jt, withModifiers as He, createSlots as Sn, onBeforeUnmount as Ot, watchEffect as On, onUnmounted as Dn, normalizeStyle as ct, mergeProps as Vn, normalizeProps as $n, guardReactiveProps as Pn, Teleport as Rn, Transition as Un, withKeys as Mn } from "vue";
|
|
2
|
+
import { g as An, o as Nn, f as Ln, a as Gn, n as Qt, _ as Zt, I as Kn, S as Bn, b as Dt, C as zn, R as We, c as en, d as Et, e as tn, h as Yn, m as jn, F as Wn, M as nn, j as qn, r as Hn, k as on, l as Nt, p as rn, q as Xn, P as Jn, s as Qn, t as an, u as Zn, T as Be } from "./item-D4uNJyVR.js";
|
|
3
|
+
import { _ as eo, T as to } from "./app-Bp1A4ItJ.js";
|
|
4
|
+
import { B as be, J as _e, A as te, G as ot, K as no, M as oo, N as ro, O as Vt, P as ao, D as Le, Q as lo, H as me, R as io, T as $t, I as ke, U as vt, V as so, W as uo, X as bt, Y as Lt, Z as co, u as ln, $ as mo } from "./menu-CPLvXPJu.js";
|
|
5
5
|
import { useI18n as ce, useCoreStore as rt, CustomAttributesForm as sn } from "@feedmepos/mf-common";
|
|
6
|
-
import { useDialog as Ge, useDialogChild as Pt, useSnackbar as
|
|
7
|
-
import { u as
|
|
6
|
+
import { useDialog as Ge, useDialogChild as Pt, useSnackbar as Ue, FmButtonColorThemeVariant as Se, components as Ie, FmButtonVariant as qe, useBreakpoints as po } from "@feedmepos/ui-library";
|
|
7
|
+
import { u as Rt } from "./discardConfirm-BHni0LNu.js";
|
|
8
8
|
import { defineStore as fo } from "pinia";
|
|
9
|
-
import { _ as De, a as
|
|
10
|
-
import { u as se, g as un, m as vo } from "./menuV2-
|
|
11
|
-
import { s as Tt, _ as bo } from "./index-
|
|
12
|
-
import { _ as Gt } from "./category-
|
|
13
|
-
import { _ as _o, a as yo, u as ho } from "./Thumbnail.vue_vue_type_script_setup_true_lang-
|
|
14
|
-
import { _ as Ze, L as xt } from "./LinkProductSideSheet-
|
|
9
|
+
import { _ as De, a as Re, b as go } from "./customAttributes-bw8OCoHr.js";
|
|
10
|
+
import { u as se, g as un, m as vo } from "./menuV2-DZpI5Elt.js";
|
|
11
|
+
import { s as Tt, _ as bo } from "./index-Cq9qqaCC.js";
|
|
12
|
+
import { _ as Gt } from "./category-DXZrXFYj.js";
|
|
13
|
+
import { _ as _o, a as yo, u as ho } from "./Thumbnail.vue_vue_type_script_setup_true_lang-BCejAD3E.js";
|
|
14
|
+
import { _ as Ze, L as xt } from "./LinkProductSideSheet-Buso155W.js";
|
|
15
15
|
import { _ as dn } from "./tooltip-CQW9YRO5.js";
|
|
16
|
-
import { _ as Xe, T as wo, l as Co } from "./index-
|
|
16
|
+
import { _ as Xe, T as wo, l as Co } from "./index-BU5aiCzu.js";
|
|
17
17
|
import { u as Io } from "./search-BAPEUu1R.js";
|
|
18
|
-
import { c as
|
|
19
|
-
import { f as tt } from "./currency-
|
|
18
|
+
import { c as Ut } from "./check-C9mY6LiX.js";
|
|
19
|
+
import { f as tt } from "./currency-D939gSij.js";
|
|
20
20
|
import { c as ko } from "./string-DpfFixWH.js";
|
|
21
21
|
import { useInventoryStore as Eo, InventoryBindingSummary as To } from "@feedmepos/mf-inventory-portal";
|
|
22
|
-
import { u as xo } from "./priceTier-
|
|
22
|
+
import { u as xo } from "./priceTier-Bs5Ve98k.js";
|
|
23
23
|
import { d as Mt } from "./vuedraggable-CK8z7qA8.js";
|
|
24
|
-
import { _ as
|
|
24
|
+
import { _ as Fo } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-BHDnLuRy.js";
|
|
25
25
|
import "./app-5fxKLAzS.js";
|
|
26
26
|
/* empty css */
|
|
27
|
-
import { i as
|
|
27
|
+
import { i as So, t as At, w as Oo, a as cn, b as mn, n as Do, c as Vo, r as $o, _ as Po } from "./index-CPb1lDPU.js";
|
|
28
28
|
import { c as mt } from "./object-DVUNCr7w.js";
|
|
29
|
-
import { _ as
|
|
29
|
+
import { _ as Ro } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
|
|
30
30
|
import { _ as Kt } from "./MenuSelector.vue_vue_type_script_setup_true_lang-K6Z0QJBl.js";
|
|
31
31
|
function ze(n) {
|
|
32
32
|
var r;
|
|
33
33
|
const e = At(n);
|
|
34
34
|
return (r = e == null ? void 0 : e.$el) != null ? r : e;
|
|
35
35
|
}
|
|
36
|
-
const Je =
|
|
36
|
+
const Je = So ? window : void 0;
|
|
37
37
|
function Bt(...n) {
|
|
38
38
|
let r, e, t, m;
|
|
39
39
|
if (typeof n[0] == "string" || Array.isArray(n[0]) ? ([e, t, m] = n, r = Je) : [r, e, t, m] = n, !r)
|
|
@@ -57,14 +57,14 @@ function Bt(...n) {
|
|
|
57
57
|
};
|
|
58
58
|
return mn(w), w;
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Uo() {
|
|
61
61
|
const n = q(!1), r = xn();
|
|
62
62
|
return r && Ae(() => {
|
|
63
63
|
n.value = !0;
|
|
64
64
|
}, r), n;
|
|
65
65
|
}
|
|
66
66
|
function Mo(n) {
|
|
67
|
-
const r =
|
|
67
|
+
const r = Uo();
|
|
68
68
|
return D(() => (r.value, !!n()));
|
|
69
69
|
}
|
|
70
70
|
const lt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, it = "__vueuse_ssr_handlers__", Ao = /* @__PURE__ */ No();
|
|
@@ -126,7 +126,7 @@ function Bo(n, r, e, t = {}) {
|
|
|
126
126
|
console.error(l);
|
|
127
127
|
},
|
|
128
128
|
initOnMounted: I
|
|
129
|
-
} = t,
|
|
129
|
+
} = t, F = (_ ? Wt : q)(typeof r == "function" ? r() : r);
|
|
130
130
|
if (!e)
|
|
131
131
|
try {
|
|
132
132
|
e = Lo("getDefaultStorage", () => {
|
|
@@ -137,10 +137,10 @@ function Bo(n, r, e, t = {}) {
|
|
|
137
137
|
a(l);
|
|
138
138
|
}
|
|
139
139
|
if (!e)
|
|
140
|
-
return
|
|
141
|
-
const O = At(r), k = Go(O), p = (m = t.serializer) != null ? m : Ko[k], { pause: T, resume:
|
|
142
|
-
|
|
143
|
-
() => F
|
|
140
|
+
return F;
|
|
141
|
+
const O = At(r), k = Go(O), p = (m = t.serializer) != null ? m : Ko[k], { pause: T, resume: R } = Oo(
|
|
142
|
+
F,
|
|
143
|
+
() => S(F.value),
|
|
144
144
|
{ flush: s, deep: g, eventFilter: f }
|
|
145
145
|
);
|
|
146
146
|
b && d && cn(() => {
|
|
@@ -156,7 +156,7 @@ function Bo(n, r, e, t = {}) {
|
|
|
156
156
|
}
|
|
157
157
|
}));
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function S(l) {
|
|
160
160
|
try {
|
|
161
161
|
const i = e.getItem(n);
|
|
162
162
|
if (l == null)
|
|
@@ -169,7 +169,7 @@ function Bo(n, r, e, t = {}) {
|
|
|
169
169
|
a(i);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
function
|
|
172
|
+
function U(l) {
|
|
173
173
|
const i = l ? l.newValue : e.getItem(n);
|
|
174
174
|
if (i == null)
|
|
175
175
|
return h && O != null && e.setItem(n, p.write(O)), O;
|
|
@@ -181,17 +181,17 @@ function Bo(n, r, e, t = {}) {
|
|
|
181
181
|
function E(l) {
|
|
182
182
|
if (!(l && l.storageArea !== e)) {
|
|
183
183
|
if (l && l.key == null) {
|
|
184
|
-
|
|
184
|
+
F.value = O;
|
|
185
185
|
return;
|
|
186
186
|
}
|
|
187
187
|
if (!(l && l.key !== n)) {
|
|
188
188
|
T();
|
|
189
189
|
try {
|
|
190
|
-
(l == null ? void 0 : l.newValue) !== p.write(
|
|
190
|
+
(l == null ? void 0 : l.newValue) !== p.write(F.value) && (F.value = U(l));
|
|
191
191
|
} catch (i) {
|
|
192
192
|
a(i);
|
|
193
193
|
} finally {
|
|
194
|
-
l ? nt(
|
|
194
|
+
l ? nt(R) : R();
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
197
|
}
|
|
@@ -199,7 +199,7 @@ function Bo(n, r, e, t = {}) {
|
|
|
199
199
|
function u(l) {
|
|
200
200
|
E(l.detail);
|
|
201
201
|
}
|
|
202
|
-
return
|
|
202
|
+
return F;
|
|
203
203
|
}
|
|
204
204
|
function zo(n, r, e = {}) {
|
|
205
205
|
const { window: t = Je, ...m } = e;
|
|
@@ -240,7 +240,7 @@ function Yo(n, r = { width: 0, height: 0 }, e = {}) {
|
|
|
240
240
|
}
|
|
241
241
|
} else if (f) {
|
|
242
242
|
const a = Array.isArray(f) ? f : [f];
|
|
243
|
-
g.value = a.reduce((I, { inlineSize:
|
|
243
|
+
g.value = a.reduce((I, { inlineSize: F }) => I + F, 0), d.value = a.reduce((I, { blockSize: F }) => I + F, 0);
|
|
244
244
|
} else
|
|
245
245
|
g.value = b.contentRect.width, d.value = b.contentRect.height;
|
|
246
246
|
},
|
|
@@ -353,13 +353,13 @@ function hn(n, r, e, t) {
|
|
|
353
353
|
};
|
|
354
354
|
}
|
|
355
355
|
function Ho(n, r) {
|
|
356
|
-
const e = pn(r), { state: t, source: m, currentList: s, size: g, containerRef: d } = e, h = { overflowX: "auto" }, { itemWidth: w, overscan: _ = 5 } = n, b = fn(t, m, w), f = gn(m, w), a = vn("horizontal", _, f, b, e), I = bn(w, m),
|
|
356
|
+
const e = pn(r), { state: t, source: m, currentList: s, size: g, containerRef: d } = e, h = { overflowX: "auto" }, { itemWidth: w, overscan: _ = 5 } = n, b = fn(t, m, w), f = gn(m, w), a = vn("horizontal", _, f, b, e), I = bn(w, m), F = D(() => I(t.value.start)), O = yn(w, m);
|
|
357
357
|
_n(g, r, d, a);
|
|
358
358
|
const k = hn("horizontal", a, I, d), p = D(() => ({
|
|
359
359
|
style: {
|
|
360
360
|
height: "100%",
|
|
361
|
-
width: `${O.value -
|
|
362
|
-
marginLeft: `${
|
|
361
|
+
width: `${O.value - F.value}px`,
|
|
362
|
+
marginLeft: `${F.value}px`,
|
|
363
363
|
display: "flex"
|
|
364
364
|
}
|
|
365
365
|
}));
|
|
@@ -373,13 +373,13 @@ function Ho(n, r) {
|
|
|
373
373
|
};
|
|
374
374
|
}
|
|
375
375
|
function Xo(n, r) {
|
|
376
|
-
const e = pn(r), { state: t, source: m, currentList: s, size: g, containerRef: d } = e, h = { overflowY: "auto" }, { itemHeight: w, overscan: _ = 5 } = n, b = fn(t, m, w), f = gn(m, w), a = vn("vertical", _, f, b, e), I = bn(w, m),
|
|
376
|
+
const e = pn(r), { state: t, source: m, currentList: s, size: g, containerRef: d } = e, h = { overflowY: "auto" }, { itemHeight: w, overscan: _ = 5 } = n, b = fn(t, m, w), f = gn(m, w), a = vn("vertical", _, f, b, e), I = bn(w, m), F = D(() => I(t.value.start)), O = yn(w, m);
|
|
377
377
|
_n(g, r, d, a);
|
|
378
378
|
const k = hn("vertical", a, I, d), p = D(() => ({
|
|
379
379
|
style: {
|
|
380
380
|
width: "100%",
|
|
381
|
-
height: `${O.value -
|
|
382
|
-
marginTop: `${
|
|
381
|
+
height: `${O.value - F.value}px`,
|
|
382
|
+
marginTop: `${F.value}px`
|
|
383
383
|
}
|
|
384
384
|
}));
|
|
385
385
|
return {
|
|
@@ -516,8 +516,8 @@ const at = fo("mf-menu-tree", () => {
|
|
|
516
516
|
const f = [];
|
|
517
517
|
function a(I) {
|
|
518
518
|
f.push(I.id);
|
|
519
|
-
for (const
|
|
520
|
-
a(
|
|
519
|
+
for (const F of I.children ?? [])
|
|
520
|
+
a(F);
|
|
521
521
|
}
|
|
522
522
|
for (const I of r.value)
|
|
523
523
|
a(I);
|
|
@@ -656,7 +656,7 @@ function ir(n) {
|
|
|
656
656
|
itemFormKey: t
|
|
657
657
|
};
|
|
658
658
|
}
|
|
659
|
-
var
|
|
659
|
+
var Fe = /* @__PURE__ */ ((n) => (n.GENERAL = "anchor-general", n.PRICE = "anchor-price", n.VARIANT = "anchor-variant", n.INVENTORY = "anchor-inventory", n.TAKEAWAY = "anchor-takeaway", n.GROUP = "anchor-group", n))(Fe || {});
|
|
660
660
|
function pt(n, r) {
|
|
661
661
|
return r ? `${n}-${r}` : n;
|
|
662
662
|
}
|
|
@@ -862,7 +862,7 @@ const gr = {
|
|
|
862
862
|
}).onPrimary(() => {
|
|
863
863
|
s();
|
|
864
864
|
});
|
|
865
|
-
}, d =
|
|
865
|
+
}, d = Ue(), h = ot(d), w = () => {
|
|
866
866
|
m.open({
|
|
867
867
|
title: "Upload image",
|
|
868
868
|
message: "Please upload an image for your product.",
|
|
@@ -910,13 +910,13 @@ const gr = {
|
|
|
910
910
|
}, null, 8, ["src"]), _.disabled ? X("", !0) : ($(), J("div", gr, [A("div", vr, [C(f, {
|
|
911
911
|
icon: t.value ? "edit" : "add",
|
|
912
912
|
variant: "secondary",
|
|
913
|
-
"text-color": o(
|
|
913
|
+
"text-color": o(Se).NeutralGray400,
|
|
914
914
|
class: "bg-white",
|
|
915
915
|
onClick: w
|
|
916
916
|
}, null, 8, ["icon", "text-color"]), t.value ? ($(), H(f, {
|
|
917
917
|
key: 0,
|
|
918
918
|
icon: "delete",
|
|
919
|
-
"text-color": o(
|
|
919
|
+
"text-color": o(Se).NeutralGray400,
|
|
920
920
|
variant: "secondary",
|
|
921
921
|
class: "bg-white",
|
|
922
922
|
onClick: g
|
|
@@ -943,9 +943,9 @@ const gr = {
|
|
|
943
943
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-tertiary"
|
|
944
944
|
}, xr = {
|
|
945
945
|
class: "flex flex-col gap-16"
|
|
946
|
-
}, Sr = {
|
|
947
|
-
class: "space-y-8"
|
|
948
946
|
}, Fr = {
|
|
947
|
+
class: "space-y-8"
|
|
948
|
+
}, Sr = {
|
|
949
949
|
key: 0,
|
|
950
950
|
class: "flex items-center gap-8"
|
|
951
951
|
}, Or = {
|
|
@@ -975,13 +975,13 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
975
975
|
}) {
|
|
976
976
|
const e = n, t = se(), m = gt(), {
|
|
977
977
|
checkMenuIsLoading: s
|
|
978
|
-
} = Vt(ot(
|
|
978
|
+
} = Vt(ot(Ue())), g = rt(), d = r, h = D(() => t.rules.item), w = D(() => t.categorizedItems), _ = D(() => {
|
|
979
979
|
const i = w.value.map((v) => ({
|
|
980
980
|
label: v.name,
|
|
981
981
|
value: v.id
|
|
982
982
|
}));
|
|
983
983
|
return e.isAddon ? i : i.filter((v) => !!v.value);
|
|
984
|
-
}), b = D(() => h.value.addon), f = D(() => !_.value.find((i) => !!i.value)), a = D(() => ao(e.form.category ? e.form : e.fallback) || []), I = D(() => a.value.reduce((i, v) => (i[v._id] = v, i), {})),
|
|
984
|
+
}), b = D(() => h.value.addon), f = D(() => !_.value.find((i) => !!i.value)), a = D(() => ao(e.form.category ? e.form : e.fallback) || []), I = D(() => a.value.reduce((i, v) => (i[v._id] = v, i), {})), F = D({
|
|
985
985
|
get() {
|
|
986
986
|
return a.value.map((i) => i._id);
|
|
987
987
|
},
|
|
@@ -1005,8 +1005,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1005
1005
|
ref: O,
|
|
1006
1006
|
disabled: !h.value.category || s(),
|
|
1007
1007
|
items: _.value,
|
|
1008
|
-
modelValue:
|
|
1009
|
-
"onUpdate:model-value": (v) =>
|
|
1008
|
+
modelValue: F.value,
|
|
1009
|
+
"onUpdate:model-value": (v) => F.value = v,
|
|
1010
1010
|
placeholder: l("menu.product.form.detail.category.placeholder"),
|
|
1011
1011
|
multiple: i
|
|
1012
1012
|
}, {
|
|
@@ -1026,21 +1026,21 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1026
1026
|
}, [l("menu.product.form.detail.category.add_new")])])
|
|
1027
1027
|
});
|
|
1028
1028
|
Ae(() => {
|
|
1029
|
-
!f.value && e.form.category === void 0 && e.isCreate &&
|
|
1029
|
+
!f.value && e.form.category === void 0 && e.isCreate && R(Pe.PRODUCT);
|
|
1030
1030
|
});
|
|
1031
1031
|
const p = D(() => {
|
|
1032
1032
|
var v;
|
|
1033
1033
|
const i = e.form.name || ((v = e.fallback) == null ? void 0 : v.name);
|
|
1034
1034
|
return i ? t.items.filter((x) => !!x.category && x._id !== e.form._id && x.name === i).length : 0;
|
|
1035
1035
|
}), T = D(() => e.isAddon ? Pe.ADD_ON : Pe.PRODUCT);
|
|
1036
|
-
function
|
|
1036
|
+
function R(i) {
|
|
1037
1037
|
var x, y, P;
|
|
1038
1038
|
if (T.value === i) return;
|
|
1039
1039
|
const v = i == Pe.ADD_ON;
|
|
1040
1040
|
d("update:form", "category", e.isOverride ? v ? "" : ((x = e.fallback) == null ? void 0 : x.category) ?? ((y = _.value.find((j) => !!j.value)) == null ? void 0 : y.value) : v ? null : (P = _.value.find((j) => !!j.value)) == null ? void 0 : P.value), v && d("update:form", "additionalCategories", []);
|
|
1041
1041
|
}
|
|
1042
1042
|
const M = q(!1);
|
|
1043
|
-
async function
|
|
1043
|
+
async function S() {
|
|
1044
1044
|
var i, v, x;
|
|
1045
1045
|
if (!e.form.name) {
|
|
1046
1046
|
const y = document.getElementById("product-name");
|
|
@@ -1063,7 +1063,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1063
1063
|
M.value = !1;
|
|
1064
1064
|
}
|
|
1065
1065
|
}
|
|
1066
|
-
const
|
|
1066
|
+
const U = D(() => t.subcategories), E = D(() => U.value.map((i) => ({
|
|
1067
1067
|
label: i.name,
|
|
1068
1068
|
value: i._id
|
|
1069
1069
|
}))), u = D({
|
|
@@ -1087,7 +1087,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1087
1087
|
"model-value": i.form.code,
|
|
1088
1088
|
placeholder: ((c = i.fallback) == null ? void 0 : c.code) || o(l)("menu.product.form.detail.fields.code.placeholder"),
|
|
1089
1089
|
label: o(l)("menu.product.form.detail.fields.code.label"),
|
|
1090
|
-
"onUpdate:modelValue": v[0] || (v[0] = (
|
|
1090
|
+
"onUpdate:modelValue": v[0] || (v[0] = (G) => d("update:form", "code", o(Qt)(G, i.isOverride)))
|
|
1091
1091
|
}, null, 8, ["model-value", "placeholder", "label"])]), A("div", Ir, [C(x, {
|
|
1092
1092
|
id: "product-name",
|
|
1093
1093
|
disabled: !h.value.name,
|
|
@@ -1096,37 +1096,37 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1096
1096
|
}) : void 0,
|
|
1097
1097
|
"model-value": i.form.name,
|
|
1098
1098
|
placeholder: (V = i.fallback) == null ? void 0 : V.name,
|
|
1099
|
-
rules: h.value.name ? [(
|
|
1099
|
+
rules: h.value.name ? [(G) => !!G || o(l)("menu.product.form.detail.fields.name.required")] : void 0,
|
|
1100
1100
|
"label-mark": "required",
|
|
1101
1101
|
label: o(l)("menu.product.form.detail.fields.name.label"),
|
|
1102
|
-
"onUpdate:modelValue": v[1] || (v[1] = (
|
|
1102
|
+
"onUpdate:modelValue": v[1] || (v[1] = (G) => d("update:form", "name", G))
|
|
1103
1103
|
}, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), A("div", kr, [C(y, {
|
|
1104
1104
|
disabled: !h.value.description,
|
|
1105
1105
|
"model-value": i.form.description || "",
|
|
1106
1106
|
placeholder: o(l)("menu.product.form.detail.fields.description.placeholder"),
|
|
1107
|
-
"onUpdate:modelValue": v[2] || (v[2] = (
|
|
1107
|
+
"onUpdate:modelValue": v[2] || (v[2] = (G) => d("update:form", "description", G.trim())),
|
|
1108
1108
|
class: "description"
|
|
1109
1109
|
}, {
|
|
1110
|
-
label: B(() => [A("p", Er, [
|
|
1110
|
+
label: B(() => [A("p", Er, [Fn(ge(o(l)("menu.product.form.detail.fields.description.label")) + " ", 1), A("span", Tr, ge(o(l)("menu.product.form.detail.fields.description.optional")), 1)])]),
|
|
1111
1111
|
_: 1
|
|
1112
1112
|
}, 8, ["disabled", "model-value", "placeholder"]), ft(C(Zt, {
|
|
1113
1113
|
class: "absolute top-32 right-4 cursor-pointer",
|
|
1114
|
-
onClick:
|
|
1114
|
+
onClick: S
|
|
1115
1115
|
}, null, 512), [[he, o(dn)("Suggest description")]])])]), C(_r, {
|
|
1116
1116
|
disabled: !h.value.thumbnail,
|
|
1117
1117
|
"item-id": i.form._id || "",
|
|
1118
1118
|
"model-value": i.form.thumbnail || ((N = i.fallback) == null ? void 0 : N.thumbnail) || null,
|
|
1119
|
-
"onUpdate:modelValue": v[3] || (v[3] = (
|
|
1120
|
-
}, null, 8, ["disabled", "item-id", "model-value"])]), C(
|
|
1119
|
+
"onUpdate:modelValue": v[3] || (v[3] = (G) => d("update:form", "thumbnail", G))
|
|
1120
|
+
}, null, 8, ["disabled", "item-id", "model-value"])]), C(Re, {
|
|
1121
1121
|
label: o(t).isV4 ? o(l)("menu.product.form.detail.category.label") : o(l)("menu.product.form.detail.category.label_singular")
|
|
1122
1122
|
}, {
|
|
1123
1123
|
default: B(() => [b.value ? ($(), H(le, {
|
|
1124
1124
|
key: 0,
|
|
1125
1125
|
disabled: !h.value.category,
|
|
1126
1126
|
"model-value": i.isAddon ? Pe.ADD_ON : Pe.PRODUCT,
|
|
1127
|
-
"onUpdate:modelValue": v[4] || (v[4] = (
|
|
1127
|
+
"onUpdate:modelValue": v[4] || (v[4] = (G) => R(G))
|
|
1128
1128
|
}, {
|
|
1129
|
-
default: B(() => [A("div", xr, [A("div",
|
|
1129
|
+
default: B(() => [A("div", xr, [A("div", Fr, [C(P, {
|
|
1130
1130
|
disabled: f.value,
|
|
1131
1131
|
value: Pe.PRODUCT,
|
|
1132
1132
|
label: o(l)("menu.product.form.detail.category.options.product.label"),
|
|
@@ -1136,7 +1136,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1136
1136
|
key: 0
|
|
1137
1137
|
})) : X("", !0)]),
|
|
1138
1138
|
_: 1
|
|
1139
|
-
})]), f.value ? ($(), J("div",
|
|
1139
|
+
})]), f.value ? ($(), J("div", Sr, [C(j, {
|
|
1140
1140
|
title: o(l)("menu.product.form.detail.category.add_first"),
|
|
1141
1141
|
variant: "info"
|
|
1142
1142
|
}, null, 8, ["title"]), C(Q, {
|
|
@@ -1154,7 +1154,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1154
1154
|
}, 8, ["disabled", "model-value"])) : X("", !0), o(t).isV4 ? X("", !0) : ($(), H(Ce, {
|
|
1155
1155
|
key: 1,
|
|
1156
1156
|
"model-value": i.form.category,
|
|
1157
|
-
rules: [(
|
|
1157
|
+
rules: [(G) => !G && !i.isOverride ? "Category is required" : !0]
|
|
1158
1158
|
}, {
|
|
1159
1159
|
default: B(() => [C(k, {
|
|
1160
1160
|
multiple: !1
|
|
@@ -1162,13 +1162,13 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1162
1162
|
_: 1
|
|
1163
1163
|
}, 8, ["model-value", "rules"]))]),
|
|
1164
1164
|
_: 1
|
|
1165
|
-
}, 8, ["label"]), o(t).isV4 && !i.isAddon ? ($(), H(
|
|
1165
|
+
}, 8, ["label"]), o(t).isV4 && !i.isAddon ? ($(), H(Re, {
|
|
1166
1166
|
key: 0,
|
|
1167
1167
|
label: o(l)("menu.product.form.detail.path.label")
|
|
1168
1168
|
}, {
|
|
1169
1169
|
default: B(() => [A("div", Or, [C(Bn, {
|
|
1170
1170
|
modelValue: u.value,
|
|
1171
|
-
"onUpdate:modelValue": v[5] || (v[5] = (
|
|
1171
|
+
"onUpdate:modelValue": v[5] || (v[5] = (G) => u.value = G),
|
|
1172
1172
|
items: E.value,
|
|
1173
1173
|
placeholder: o(l)("menu.product.form.detail.path.placeholder"),
|
|
1174
1174
|
disabled: !h.value.category,
|
|
@@ -1182,7 +1182,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1182
1182
|
required: h.value.orderFrom,
|
|
1183
1183
|
"default-label": o(l)("menu.product.form.detail.order_from.default"),
|
|
1184
1184
|
label: o(l)("menu.product.form.detail.order_from.label"),
|
|
1185
|
-
"onUpdate:modelValue": v[6] || (v[6] = (
|
|
1185
|
+
"onUpdate:modelValue": v[6] || (v[6] = (G) => G && d("update:form", "orderFrom", G))
|
|
1186
1186
|
}, null, 8, ["disabled", "model-value", "order-from-none", "required", "default-label", "label"])];
|
|
1187
1187
|
}),
|
|
1188
1188
|
_: 1
|
|
@@ -1196,15 +1196,15 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1196
1196
|
const h = !r.state.currentSchedulerId, w = r.rules.group.type, _ = r.version === te.F_MENU_VERSION.enum.v3, b = r.rules.item.orderFromActiveOnly, f = r.rules.item.bindToVariant;
|
|
1197
1197
|
return function(I) {
|
|
1198
1198
|
return {
|
|
1199
|
-
link: (
|
|
1200
|
-
name: (
|
|
1201
|
-
isDefault: (
|
|
1199
|
+
link: (F) => !t.value && (!F || f),
|
|
1200
|
+
name: (F) => !t.value && !F,
|
|
1201
|
+
isDefault: (F) => !t.value,
|
|
1202
1202
|
type: w && !I._id && !t.value,
|
|
1203
1203
|
price: I.type !== te.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
|
|
1204
1204
|
priceEdit: !0,
|
|
1205
1205
|
priceTier: r.isV4,
|
|
1206
1206
|
inventory: h ? _ ? !t.value && I.type === te.F_ADDON_GROUP_TYPE.enum.NORMAL : !t.value : !1,
|
|
1207
|
-
orderFrom: (
|
|
1207
|
+
orderFrom: (F) => h ? _ ? I.type === te.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? t.value : !!t.value == !F : t.value : !1,
|
|
1208
1208
|
orderFromActiveOnly: b,
|
|
1209
1209
|
showOrderFrom: h ? _ ? t.value ? !0 : I.type === te.F_ADDON_GROUP_TYPE.enum.PRODUCT : t.value : !1,
|
|
1210
1210
|
bindToVariant: f,
|
|
@@ -1240,9 +1240,9 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1240
1240
|
}
|
|
1241
1241
|
}), Pr = {
|
|
1242
1242
|
key: 0
|
|
1243
|
-
}, Ur = {
|
|
1244
|
-
key: 1
|
|
1245
1243
|
}, Rr = {
|
|
1244
|
+
key: 1
|
|
1245
|
+
}, Ur = {
|
|
1246
1246
|
class: "xs:overflow-x-scroll"
|
|
1247
1247
|
}, Mr = {
|
|
1248
1248
|
class: "xs:min-w-[640px]"
|
|
@@ -1260,7 +1260,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1260
1260
|
setup(n, {
|
|
1261
1261
|
emit: r
|
|
1262
1262
|
}) {
|
|
1263
|
-
const e = n, t = r, m =
|
|
1263
|
+
const e = n, t = r, m = Ue(), s = rt(), g = se(), d = D(() => be.Country.getCountry(s.currentCountry.value)), h = q(!1), w = D(() => e.config.isV4 || e.group.type === te.F_ADDON_GROUP_TYPE.enum.PRODUCT), _ = D(() => w.value), b = D(() => w.value), f = D(() => Object.values(e.group.items).flatMap((c) => [{
|
|
1264
1264
|
_id: c._id,
|
|
1265
1265
|
combinationKey: void 0
|
|
1266
1266
|
}, ...(c.items ?? []).map((V) => ({
|
|
@@ -1269,7 +1269,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1269
1269
|
}))])), {
|
|
1270
1270
|
searchKey: a,
|
|
1271
1271
|
filter: I
|
|
1272
|
-
} = Io(),
|
|
1272
|
+
} = Io(), F = D(() => {
|
|
1273
1273
|
const c = Object.entries(e.group.items).filter(([, V]) => I([V.code || "", V.name || V.fallbackName, p(V.price ?? V.fallbackPrice), T(V.orderFrom || V.fallbackOrder), ...(V.items || []).map((N) => [N.code || "", N.name || N.fallbackName, p(N.price ?? N.fallbackPrice), T(N.orderFrom || N.fallbackOrder)].join(""))]));
|
|
1274
1274
|
return Object.fromEntries(c);
|
|
1275
1275
|
}), O = (c) => ({
|
|
@@ -1281,28 +1281,28 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1281
1281
|
}), k = D(() => !0), p = (c) => c ? tt(c, !1) : "", T = (c) => {
|
|
1282
1282
|
var V;
|
|
1283
1283
|
return c == null ? "" : (V = lo()[c]) == null ? void 0 : V.label;
|
|
1284
|
-
},
|
|
1285
|
-
t:
|
|
1286
|
-
} = ce(),
|
|
1284
|
+
}, R = D(() => Object.values(F.value)), M = q({}), {
|
|
1285
|
+
t: S
|
|
1286
|
+
} = ce(), U = q([{
|
|
1287
1287
|
accessorKey: "isDefault",
|
|
1288
|
-
header: () =>
|
|
1288
|
+
header: () => S("menu.group.option.is_default"),
|
|
1289
1289
|
enableSorting: !1,
|
|
1290
1290
|
size: 75,
|
|
1291
1291
|
cell: (c) => {
|
|
1292
|
-
var
|
|
1293
|
-
if ((z = (
|
|
1292
|
+
var L, z;
|
|
1293
|
+
if ((z = (L = c.row.original) == null ? void 0 : L.items) != null && z.length)
|
|
1294
1294
|
return null;
|
|
1295
|
-
const V = c.row.depth > 0, N = c.row.original,
|
|
1295
|
+
const V = c.row.depth > 0, N = c.row.original, G = !!c.getValue();
|
|
1296
1296
|
return C(Ie.FmCheckbox, {
|
|
1297
1297
|
value: "default",
|
|
1298
|
-
modelValue:
|
|
1298
|
+
modelValue: G,
|
|
1299
1299
|
disabled: !O(N.combinationKey).isDefault,
|
|
1300
1300
|
"onUpdate:modelValue": (oe) => {
|
|
1301
|
-
var
|
|
1301
|
+
var ne;
|
|
1302
1302
|
if (V) {
|
|
1303
|
-
const
|
|
1304
|
-
if (!
|
|
1305
|
-
i(
|
|
1303
|
+
const ee = (ne = c.row.getParentRow()) == null ? void 0 : ne.original;
|
|
1304
|
+
if (!ee) return;
|
|
1305
|
+
i(ee._id, N.combinationKey ?? "", "isDefault", oe);
|
|
1306
1306
|
} else
|
|
1307
1307
|
l(N._id, "isDefault", oe);
|
|
1308
1308
|
}
|
|
@@ -1310,7 +1310,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1310
1310
|
}
|
|
1311
1311
|
}, {
|
|
1312
1312
|
accessorKey: "code",
|
|
1313
|
-
header: () =>
|
|
1313
|
+
header: () => S("menu.group.option.code"),
|
|
1314
1314
|
enableSorting: !1,
|
|
1315
1315
|
size: 100,
|
|
1316
1316
|
cell: (c) => {
|
|
@@ -1327,21 +1327,21 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1327
1327
|
}
|
|
1328
1328
|
}, {
|
|
1329
1329
|
accessorKey: "name",
|
|
1330
|
-
header: () =>
|
|
1330
|
+
header: () => S("menu.group.option.product_title"),
|
|
1331
1331
|
enableSorting: !1,
|
|
1332
1332
|
cell: (c) => {
|
|
1333
|
-
const V = c.getValue(), N = c.row.original,
|
|
1333
|
+
const V = c.getValue(), N = c.row.original, G = c.row.depth > 0, L = N.combinationKey ? un(N.combinationKey, se().variants) : null;
|
|
1334
1334
|
return ve("div", ve(Ie.FmTextField, {
|
|
1335
1335
|
modelValue: V,
|
|
1336
|
-
placeholder:
|
|
1336
|
+
placeholder: L ?? "",
|
|
1337
1337
|
disabled: !O(N.combinationKey).name,
|
|
1338
|
-
rules:
|
|
1338
|
+
rules: L ? void 0 : [(z) => z.length > 0 || S("menu.group.option.product_title_required")],
|
|
1339
1339
|
"onUpdate:modelValue": (z) => {
|
|
1340
1340
|
var oe;
|
|
1341
|
-
if (
|
|
1342
|
-
const
|
|
1343
|
-
if (!
|
|
1344
|
-
i(
|
|
1341
|
+
if (G) {
|
|
1342
|
+
const ne = (oe = c.row.getParentRow()) == null ? void 0 : oe.original;
|
|
1343
|
+
if (!ne) return;
|
|
1344
|
+
i(ne._id, N.combinationKey ?? "", "name", z);
|
|
1345
1345
|
} else
|
|
1346
1346
|
l(N._id, "name", z);
|
|
1347
1347
|
},
|
|
@@ -1353,7 +1353,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1353
1353
|
name: "keyboard_arrow_up",
|
|
1354
1354
|
onClick: c.row.getToggleExpandedHandler(),
|
|
1355
1355
|
class: ["cursor-pointer", "transition-transform", c.row.getIsExpanded() ? "transform rotate-180" : ""],
|
|
1356
|
-
color: O(N.combinationKey).name ? void 0 :
|
|
1356
|
+
color: O(N.combinationKey).name ? void 0 : Se.NeutralGray200
|
|
1357
1357
|
}) : void 0;
|
|
1358
1358
|
}
|
|
1359
1359
|
}));
|
|
@@ -1363,34 +1363,34 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1363
1363
|
enableSorting: !1,
|
|
1364
1364
|
header: () => {
|
|
1365
1365
|
var c;
|
|
1366
|
-
return
|
|
1366
|
+
return S("menu.group.option.price", {
|
|
1367
1367
|
symbol: (c = d.value) == null ? void 0 : c.currency.symbol
|
|
1368
1368
|
});
|
|
1369
1369
|
},
|
|
1370
1370
|
size: 100,
|
|
1371
1371
|
cell: (c) => {
|
|
1372
|
-
const V = c.getValue(), N = c.row.original, L = N.fallbackPrice,
|
|
1372
|
+
const V = c.getValue(), N = c.row.original, G = !O(null).priceEdit || N.orderFrom === te.F_ORDER_FROM.enum.NONE, L = N.fallbackPrice, z = c.row.depth > 0;
|
|
1373
1373
|
return ve(Xe, {
|
|
1374
|
-
disable:
|
|
1374
|
+
disable: G,
|
|
1375
1375
|
placeholder: L ? tt(L) : void 0,
|
|
1376
1376
|
modelValue: V,
|
|
1377
|
-
required: !L,
|
|
1377
|
+
required: !L && !G,
|
|
1378
1378
|
nullable: !!L,
|
|
1379
1379
|
min: k.value ? void 0 : 0,
|
|
1380
|
-
"onUpdate:modelValue": (
|
|
1381
|
-
var
|
|
1382
|
-
if (
|
|
1383
|
-
const ee = (
|
|
1380
|
+
"onUpdate:modelValue": (oe) => {
|
|
1381
|
+
var ne;
|
|
1382
|
+
if (z) {
|
|
1383
|
+
const ee = (ne = c.row.getParentRow()) == null ? void 0 : ne.original;
|
|
1384
1384
|
if (!ee) return;
|
|
1385
1385
|
i(
|
|
1386
1386
|
ee._id,
|
|
1387
1387
|
N.combinationKey ?? "",
|
|
1388
1388
|
// @ts-ignore
|
|
1389
1389
|
"price",
|
|
1390
|
-
|
|
1390
|
+
oe
|
|
1391
1391
|
);
|
|
1392
1392
|
} else
|
|
1393
|
-
l(N._id, "price",
|
|
1393
|
+
l(N._id, "price", oe);
|
|
1394
1394
|
},
|
|
1395
1395
|
showCurrency: !1,
|
|
1396
1396
|
class: "min-w-[88px]"
|
|
@@ -1398,24 +1398,24 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1398
1398
|
}
|
|
1399
1399
|
}, {
|
|
1400
1400
|
accessorKey: "orderFrom",
|
|
1401
|
-
header: () =>
|
|
1401
|
+
header: () => S("menu.common.labels.order_from"),
|
|
1402
1402
|
size: 100,
|
|
1403
1403
|
enableSorting: !1,
|
|
1404
1404
|
cell: (c) => {
|
|
1405
|
-
const V = c.getValue(), N = c.row.original,
|
|
1405
|
+
const V = c.getValue(), N = c.row.original, G = N.fallbackOrder, L = c.row.depth > 0;
|
|
1406
1406
|
return ve(Dt, {
|
|
1407
1407
|
modelValue: V,
|
|
1408
|
-
fallback:
|
|
1408
|
+
fallback: G,
|
|
1409
1409
|
disable: !O(N.combinationKey).orderFrom,
|
|
1410
1410
|
required: !0,
|
|
1411
1411
|
editActiveOnly: O(N.combinationKey).orderFromActiveOnly,
|
|
1412
1412
|
"onUpdate:modelValue": (z) => {
|
|
1413
1413
|
var oe;
|
|
1414
|
-
if (
|
|
1415
|
-
const
|
|
1416
|
-
if (!
|
|
1414
|
+
if (L) {
|
|
1415
|
+
const ne = (oe = c.row.getParentRow()) == null ? void 0 : oe.original;
|
|
1416
|
+
if (!ne) return;
|
|
1417
1417
|
i(
|
|
1418
|
-
|
|
1418
|
+
ne._id,
|
|
1419
1419
|
N.combinationKey ?? "",
|
|
1420
1420
|
// @ts-ignore
|
|
1421
1421
|
"orderFrom",
|
|
@@ -1443,71 +1443,71 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1443
1443
|
}, [O(null).priceTier && C(en, {
|
|
1444
1444
|
menuStore: g,
|
|
1445
1445
|
priceTiers: V.priceTiers,
|
|
1446
|
-
"onUpdate:priceTiers": (
|
|
1447
|
-
var
|
|
1446
|
+
"onUpdate:priceTiers": (G) => {
|
|
1447
|
+
var L;
|
|
1448
1448
|
if (N) {
|
|
1449
|
-
const z = (
|
|
1449
|
+
const z = (L = c.row.getParentRow()) == null ? void 0 : L.original;
|
|
1450
1450
|
if (!z) return;
|
|
1451
1451
|
i(
|
|
1452
1452
|
z._id,
|
|
1453
1453
|
V.combinationKey ?? "",
|
|
1454
1454
|
// @ts-ignore
|
|
1455
1455
|
"priceTiers",
|
|
1456
|
-
|
|
1456
|
+
G
|
|
1457
1457
|
);
|
|
1458
1458
|
} else
|
|
1459
|
-
l(V._id, "priceTiers",
|
|
1459
|
+
l(V._id, "priceTiers", G);
|
|
1460
1460
|
}
|
|
1461
1461
|
}, null), O(V.combinationKey).inventory && C(Et, {
|
|
1462
1462
|
title: "Inventory",
|
|
1463
1463
|
initialValue: V.inventoryBindings ?? [],
|
|
1464
1464
|
name: V.name ?? V.fallbackName ?? "",
|
|
1465
1465
|
allowRefund: e.allowRefundInventory,
|
|
1466
|
-
"onUpdate:inventory": (
|
|
1467
|
-
var
|
|
1466
|
+
"onUpdate:inventory": (G) => {
|
|
1467
|
+
var L;
|
|
1468
1468
|
if (N) {
|
|
1469
|
-
const z = (
|
|
1469
|
+
const z = (L = c.row.getParentRow()) == null ? void 0 : L.original;
|
|
1470
1470
|
if (!z) return;
|
|
1471
1471
|
i(
|
|
1472
1472
|
z._id,
|
|
1473
1473
|
V.combinationKey ?? "",
|
|
1474
1474
|
// @ts-ignore
|
|
1475
1475
|
"inventoryBindings",
|
|
1476
|
-
|
|
1476
|
+
G
|
|
1477
1477
|
);
|
|
1478
1478
|
} else
|
|
1479
|
-
l(V._id, "inventoryBindings",
|
|
1479
|
+
l(V._id, "inventoryBindings", G);
|
|
1480
1480
|
}
|
|
1481
1481
|
}, {
|
|
1482
1482
|
default: ({
|
|
1483
|
-
trigger:
|
|
1483
|
+
trigger: G
|
|
1484
1484
|
}) => C(W("fm-tooltip"), {
|
|
1485
1485
|
content: "Inventory",
|
|
1486
1486
|
zIndex: 110
|
|
1487
1487
|
}, {
|
|
1488
1488
|
default: () => {
|
|
1489
|
-
var
|
|
1489
|
+
var L;
|
|
1490
1490
|
return [C(W("fm-button"), {
|
|
1491
1491
|
variant: qe.Tertiary,
|
|
1492
1492
|
prependIcon: "inventory_2",
|
|
1493
|
-
overwriteIconOutline: (
|
|
1494
|
-
textColor:
|
|
1495
|
-
onClick:
|
|
1493
|
+
overwriteIconOutline: (L = V.inventoryBindings) != null && L.length ? "filled" : "outline",
|
|
1494
|
+
textColor: Se.NeutralGray400,
|
|
1495
|
+
onClick: G
|
|
1496
1496
|
}, null)];
|
|
1497
1497
|
}
|
|
1498
1498
|
})
|
|
1499
1499
|
}), O(V.combinationKey).link && C(W("fm-button"), {
|
|
1500
1500
|
variant: qe.Tertiary,
|
|
1501
1501
|
prependIcon: "delete",
|
|
1502
|
-
textColor:
|
|
1502
|
+
textColor: Se.NeutralGray400,
|
|
1503
1503
|
onClick: () => {
|
|
1504
|
-
var
|
|
1504
|
+
var G, L;
|
|
1505
1505
|
if (N) {
|
|
1506
|
-
const z = (
|
|
1506
|
+
const z = (G = c.row.getParentRow()) == null ? void 0 : G.original;
|
|
1507
1507
|
if (!z) return;
|
|
1508
|
-
if ((((
|
|
1508
|
+
if ((((L = e.group.items[z._id].items) == null ? void 0 : L.length) || 0) <= 1) {
|
|
1509
1509
|
m.open({
|
|
1510
|
-
title:
|
|
1510
|
+
title: S("menu.group.option.should_link_at_least_one_variant", {
|
|
1511
1511
|
name: z.name
|
|
1512
1512
|
}),
|
|
1513
1513
|
type: "error"
|
|
@@ -1546,36 +1546,36 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1546
1546
|
});
|
|
1547
1547
|
}
|
|
1548
1548
|
function l(c, V, N) {
|
|
1549
|
-
const
|
|
1550
|
-
if (!
|
|
1551
|
-
const
|
|
1552
|
-
...
|
|
1549
|
+
const G = e.group.items[c];
|
|
1550
|
+
if (!G) return;
|
|
1551
|
+
const L = {
|
|
1552
|
+
...G
|
|
1553
1553
|
};
|
|
1554
|
-
V === "price" ?
|
|
1554
|
+
V === "price" ? L[V] = !N && !G.fallbackPrice ? be.Dinero.zero().toObject() : N : L[V] = N, t("update:group", {
|
|
1555
1555
|
...e.group,
|
|
1556
1556
|
items: {
|
|
1557
1557
|
...e.group.items,
|
|
1558
|
-
[c]:
|
|
1558
|
+
[c]: L
|
|
1559
1559
|
}
|
|
1560
1560
|
});
|
|
1561
1561
|
}
|
|
1562
|
-
function i(c, V, N,
|
|
1563
|
-
var
|
|
1564
|
-
const
|
|
1565
|
-
if (!
|
|
1566
|
-
let oe = (
|
|
1562
|
+
function i(c, V, N, G) {
|
|
1563
|
+
var ne, ee;
|
|
1564
|
+
const L = me(e.group), z = (ne = L.items[c].items) == null ? void 0 : ne.findIndex((pe) => pe.combinationKey === V);
|
|
1565
|
+
if (!Ut.isSet(z)) return;
|
|
1566
|
+
let oe = (ee = L.items[c].items) == null ? void 0 : ee[z];
|
|
1567
1567
|
oe && (oe = {
|
|
1568
1568
|
...oe,
|
|
1569
|
-
[N]:
|
|
1570
|
-
},
|
|
1569
|
+
[N]: G
|
|
1570
|
+
}, L.items[c].items[z] = oe, t("update:group", L));
|
|
1571
1571
|
}
|
|
1572
1572
|
function v(c) {
|
|
1573
1573
|
const V = me(e.group);
|
|
1574
1574
|
delete V.items[c], t("update:group", V);
|
|
1575
1575
|
}
|
|
1576
1576
|
function x(c, V) {
|
|
1577
|
-
const N = me(e.group),
|
|
1578
|
-
|
|
1577
|
+
const N = me(e.group), G = N.items[c];
|
|
1578
|
+
G && (G.items = (G.items || []).filter((L) => L.combinationKey !== V), N.items[c] = G, t("update:group", N));
|
|
1579
1579
|
}
|
|
1580
1580
|
const y = D(() => e.categorizedItems.flatMap((c) => c.items).reduce((c, V) => {
|
|
1581
1581
|
var N;
|
|
@@ -1584,22 +1584,22 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1584
1584
|
variants: io(((N = V.variant) == null ? void 0 : N.variantCombinations) || [], "combinationKey")
|
|
1585
1585
|
}, c;
|
|
1586
1586
|
}, {})), P = (c) => {
|
|
1587
|
-
var
|
|
1588
|
-
const N = g.state.menu.modules.item.find((oe) => oe._id === c._id),
|
|
1589
|
-
...(
|
|
1587
|
+
var L, z;
|
|
1588
|
+
const N = g.state.menu.modules.item.find((oe) => oe._id === c._id), G = c.combinationKey ? {
|
|
1589
|
+
...(L = N == null ? void 0 : N.variant) == null ? void 0 : L.variantCombinations.find((oe) => oe.combinationKey === c.combinationKey),
|
|
1590
1590
|
name: $t(se().variants, ((z = N == null ? void 0 : N.variant) == null ? void 0 : z.variantGroupIds) || [])[c.combinationKey]
|
|
1591
1591
|
} : N;
|
|
1592
|
-
return
|
|
1592
|
+
return G == null ? void 0 : G.name;
|
|
1593
1593
|
}, j = async (c) => {
|
|
1594
1594
|
let V = tn(e.group);
|
|
1595
1595
|
V = {
|
|
1596
1596
|
...V,
|
|
1597
1597
|
items: c.map((N) => {
|
|
1598
|
-
const
|
|
1599
|
-
return
|
|
1598
|
+
const G = V.items.find((z) => z._id == N._id && z.combinationKey == N.combinationKey), L = y.value[N._id];
|
|
1599
|
+
return G || {
|
|
1600
1600
|
...N,
|
|
1601
1601
|
name: P(N),
|
|
1602
|
-
price: N.combinationKey ?
|
|
1602
|
+
price: N.combinationKey ? L.variants[N.combinationKey || ""].price : L.price,
|
|
1603
1603
|
orderFrom: te.F_ORDER_FROM.enum.ALL
|
|
1604
1604
|
};
|
|
1605
1605
|
})
|
|
@@ -1607,16 +1607,16 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1607
1607
|
}, Q = (c) => c.items;
|
|
1608
1608
|
function le(c) {
|
|
1609
1609
|
const V = me(e.group);
|
|
1610
|
-
V.items = c.reduce((N,
|
|
1610
|
+
V.items = c.reduce((N, G) => ({
|
|
1611
1611
|
...N,
|
|
1612
|
-
[
|
|
1612
|
+
[G._id]: G
|
|
1613
1613
|
}), {}), t("update:group", V);
|
|
1614
1614
|
}
|
|
1615
1615
|
const Ce = po(), he = D(() => Ce.breakpoints.value.xs);
|
|
1616
1616
|
return (c, V) => {
|
|
1617
|
-
const N = W("fm-button"),
|
|
1617
|
+
const N = W("fm-button"), G = W("fm-table");
|
|
1618
1618
|
return $(), H(De, {
|
|
1619
|
-
title: o(
|
|
1619
|
+
title: o(S)("menu.group.option.title")
|
|
1620
1620
|
}, {
|
|
1621
1621
|
"append-title": B(() => [c.config.link() ? ($(), J(Oe, {
|
|
1622
1622
|
key: 0
|
|
@@ -1625,45 +1625,45 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1625
1625
|
"initial-value": f.value,
|
|
1626
1626
|
"show-variant": c.config.bindToVariant,
|
|
1627
1627
|
"select-variant": "",
|
|
1628
|
-
title: o(
|
|
1628
|
+
title: o(S)("menu.group.option.link_products"),
|
|
1629
1629
|
"is-local-only": !0,
|
|
1630
1630
|
onSubmit: V[0] || (V[0] = ({
|
|
1631
|
-
items:
|
|
1632
|
-
}) => j(
|
|
1631
|
+
items: L
|
|
1632
|
+
}) => j(L))
|
|
1633
1633
|
}, {
|
|
1634
1634
|
default: B(({
|
|
1635
|
-
trigger:
|
|
1635
|
+
trigger: L
|
|
1636
1636
|
}) => [C(N, {
|
|
1637
|
-
"text-color": o(
|
|
1638
|
-
"border-color": o(
|
|
1637
|
+
"text-color": o(Se).ColorPrimary,
|
|
1638
|
+
"border-color": o(Se).ColorPrimary,
|
|
1639
1639
|
variant: "secondary",
|
|
1640
|
-
label: o(
|
|
1640
|
+
label: o(S)("menu.group.option.link_products"),
|
|
1641
1641
|
"prepend-icon": "link",
|
|
1642
|
-
onClick:
|
|
1642
|
+
onClick: L
|
|
1643
1643
|
}, null, 8, ["text-color", "border-color", "label", "onClick"])]),
|
|
1644
1644
|
_: 1
|
|
1645
|
-
}, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : ($(), J("div",
|
|
1646
|
-
"text-color": o(
|
|
1647
|
-
"border-color": o(
|
|
1645
|
+
}, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : ($(), J("div", Rr, [C(N, {
|
|
1646
|
+
"text-color": o(Se).ColorPrimary,
|
|
1647
|
+
"border-color": o(Se).ColorPrimary,
|
|
1648
1648
|
variant: "secondary",
|
|
1649
|
-
label: o(
|
|
1649
|
+
label: o(S)("menu.group.option.add_option"),
|
|
1650
1650
|
"prepend-icon": "add",
|
|
1651
1651
|
onClick: u
|
|
1652
1652
|
}, null, 8, ["text-color", "border-color", "label"])]))], 64)) : X("", !0)]),
|
|
1653
|
-
default: B(() => [A("div",
|
|
1654
|
-
"column-defs":
|
|
1653
|
+
default: B(() => [A("div", Ur, [A("div", Mr, [C(G, {
|
|
1654
|
+
"column-defs": U.value,
|
|
1655
1655
|
"column-visibility": E.value,
|
|
1656
1656
|
draggable: !he.value && O(null).name,
|
|
1657
1657
|
"expanded-state": h.value ? {} : M.value,
|
|
1658
1658
|
"get-sub-row": Q,
|
|
1659
1659
|
"page-size": 999,
|
|
1660
|
-
"row-data":
|
|
1660
|
+
"row-data": R.value,
|
|
1661
1661
|
"search-value": o(a),
|
|
1662
1662
|
"shrink-at": !1,
|
|
1663
1663
|
"hide-footer": "",
|
|
1664
|
-
"onUpdate:expandedState": V[1] || (V[1] = (
|
|
1665
|
-
onDndChanged: V[2] || (V[2] = (
|
|
1666
|
-
"onUpdate:dragging": V[3] || (V[3] = (
|
|
1664
|
+
"onUpdate:expandedState": V[1] || (V[1] = (L) => M.value = L),
|
|
1665
|
+
onDndChanged: V[2] || (V[2] = (L) => le(L)),
|
|
1666
|
+
"onUpdate:dragging": V[3] || (V[3] = (L) => h.value = L)
|
|
1667
1667
|
}, null, 8, ["column-defs", "column-visibility", "draggable", "expanded-state", "row-data", "search-value"])])])]),
|
|
1668
1668
|
_: 1
|
|
1669
1669
|
}, 8, ["title"]);
|
|
@@ -1685,11 +1685,11 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1685
1685
|
emits: ["update:group", "submit:group", "status:show"],
|
|
1686
1686
|
setup(n, { expose: r, emit: e }) {
|
|
1687
1687
|
let t = n;
|
|
1688
|
-
const m = e, s = se(), g = rt(), d = Ge(), h = Vt(ot(
|
|
1688
|
+
const m = e, s = se(), g = rt(), d = Ge(), h = Vt(ot(Ue())), { countDefaultItems: w, validateGroupItems: _, minMaxValidationRules: b } = Yn(
|
|
1689
1689
|
() => t.group
|
|
1690
1690
|
), f = q(!1), a = q(!1), I = (y) => {
|
|
1691
|
-
|
|
1692
|
-
},
|
|
1691
|
+
Ut.isBoolean(y) ? a.value = y : a.value = !a.value;
|
|
1692
|
+
}, F = D(() => t.group ? t.config(t.group) : null), O = D(() => jn(F.value)), k = (y) => O.value.includes(y), p = D(() => [
|
|
1693
1693
|
{
|
|
1694
1694
|
label: "Normal",
|
|
1695
1695
|
value: te.F_ADDON_GROUP_TYPE.enum.NORMAL
|
|
@@ -1706,7 +1706,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1706
1706
|
function T(y) {
|
|
1707
1707
|
m("update:group", y);
|
|
1708
1708
|
}
|
|
1709
|
-
function
|
|
1709
|
+
function R(y) {
|
|
1710
1710
|
function P() {
|
|
1711
1711
|
T({
|
|
1712
1712
|
...t.group,
|
|
@@ -1730,11 +1730,11 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1730
1730
|
function M(y) {
|
|
1731
1731
|
return new nn(s, h.updateMenu, d).mapGroups(
|
|
1732
1732
|
[y],
|
|
1733
|
-
|
|
1733
|
+
F.value.isOverride
|
|
1734
1734
|
)[0];
|
|
1735
1735
|
}
|
|
1736
|
-
const
|
|
1737
|
-
() => !ke.isEqual(t.group,
|
|
1736
|
+
const S = q(ke.clone(t.group)), U = Rt(
|
|
1737
|
+
() => !ke.isEqual(t.group, S.value),
|
|
1738
1738
|
() => {
|
|
1739
1739
|
a.value = !1;
|
|
1740
1740
|
}
|
|
@@ -1760,12 +1760,12 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1760
1760
|
ye(
|
|
1761
1761
|
() => a.value,
|
|
1762
1762
|
async (y) => {
|
|
1763
|
-
m("status:show", y), y && (await nt(),
|
|
1763
|
+
m("status:show", y), y && (await nt(), S.value = ke.clone(t.group));
|
|
1764
1764
|
}
|
|
1765
1765
|
);
|
|
1766
1766
|
const l = D(() => {
|
|
1767
1767
|
var y;
|
|
1768
|
-
return ((y = g.groupAttributeSettings) == null ? void 0 : y.value.length) > 0 && !
|
|
1768
|
+
return ((y = g.groupAttributeSettings) == null ? void 0 : y.value.length) > 0 && !F.value.isOverride;
|
|
1769
1769
|
}), i = D(() => {
|
|
1770
1770
|
const y = {};
|
|
1771
1771
|
return s.state.menu.modules.group.forEach((P) => {
|
|
@@ -1785,20 +1785,20 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1785
1785
|
});
|
|
1786
1786
|
const { t: x } = ce();
|
|
1787
1787
|
return (y, P) => {
|
|
1788
|
-
const j = W("fm-text-field"), Q = W("fm-stepper-field"), le = W("FmFormGroup"), Ce = W("fm-radio"), he = W("fm-radio-group"), c = W("fm-switch"), V = W("FormSection"), N = W("fm-button"),
|
|
1788
|
+
const j = W("fm-text-field"), Q = W("fm-stepper-field"), le = W("FmFormGroup"), Ce = W("fm-radio"), he = W("fm-radio-group"), c = W("fm-switch"), V = W("FormSection"), N = W("fm-button"), G = W("fm-side-sheet");
|
|
1789
1789
|
return $(), J(Oe, null, [
|
|
1790
1790
|
Me(y.$slots, "default", { trigger: I }),
|
|
1791
|
-
C(
|
|
1791
|
+
C(G, {
|
|
1792
1792
|
id: "group-form",
|
|
1793
1793
|
modelValue: a.value,
|
|
1794
|
-
"onUpdate:modelValue": P[8] || (P[8] = (
|
|
1794
|
+
"onUpdate:modelValue": P[8] || (P[8] = (L) => a.value = L),
|
|
1795
1795
|
"is-container": o(Ie).FmForm,
|
|
1796
1796
|
"is-container-props": {
|
|
1797
1797
|
onValidationSuccess: u,
|
|
1798
1798
|
blameFormChildOnValidationFailed: !0
|
|
1799
1799
|
},
|
|
1800
1800
|
"max-width": 720,
|
|
1801
|
-
"onOn:clickedAway": o(
|
|
1801
|
+
"onOn:clickedAway": o(U)
|
|
1802
1802
|
}, {
|
|
1803
1803
|
"side-sheet-header": B(() => [
|
|
1804
1804
|
A("p", Nr, ge(y.title), 1)
|
|
@@ -1828,10 +1828,10 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1828
1828
|
A("div", null, [
|
|
1829
1829
|
C(j, {
|
|
1830
1830
|
modelValue: y.group.name,
|
|
1831
|
-
"onUpdate:modelValue": P[0] || (P[0] = (
|
|
1831
|
+
"onUpdate:modelValue": P[0] || (P[0] = (L) => y.group.name = L),
|
|
1832
1832
|
disabled: k("name"),
|
|
1833
1833
|
rules: [
|
|
1834
|
-
(
|
|
1834
|
+
(L) => !!L || o(x)("menu.common.validation.required", { field: o(x)("menu.common.labels.group_name") })
|
|
1835
1835
|
],
|
|
1836
1836
|
autofocus: "",
|
|
1837
1837
|
label: o(x)("menu.common.labels.group_name")
|
|
@@ -1846,7 +1846,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1846
1846
|
default: B(() => [
|
|
1847
1847
|
C(Q, {
|
|
1848
1848
|
modelValue: y.group.min,
|
|
1849
|
-
"onUpdate:modelValue": P[1] || (P[1] = (
|
|
1849
|
+
"onUpdate:modelValue": P[1] || (P[1] = (L) => y.group.min = L),
|
|
1850
1850
|
disabled: k("min"),
|
|
1851
1851
|
min: 0,
|
|
1852
1852
|
class: "flex-1",
|
|
@@ -1854,7 +1854,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1854
1854
|
}, null, 8, ["modelValue", "disabled", "label"]),
|
|
1855
1855
|
C(Q, {
|
|
1856
1856
|
modelValue: y.group.max,
|
|
1857
|
-
"onUpdate:modelValue": P[2] || (P[2] = (
|
|
1857
|
+
"onUpdate:modelValue": P[2] || (P[2] = (L) => y.group.max = L),
|
|
1858
1858
|
disabled: k("max"),
|
|
1859
1859
|
min: y.group.min,
|
|
1860
1860
|
class: "flex-1",
|
|
@@ -1866,7 +1866,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1866
1866
|
]),
|
|
1867
1867
|
_: 1
|
|
1868
1868
|
}, 8, ["model-value", "rules"]),
|
|
1869
|
-
|
|
1869
|
+
F.value.type ? ($(), H(Re, {
|
|
1870
1870
|
key: 0,
|
|
1871
1871
|
label: o(x)("menu.common.labels.group_type")
|
|
1872
1872
|
}, {
|
|
@@ -1874,13 +1874,13 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1874
1874
|
C(he, {
|
|
1875
1875
|
disabled: k("type"),
|
|
1876
1876
|
"model-value": y.group.type,
|
|
1877
|
-
"onUpdate:modelValue": P[3] || (P[3] = (
|
|
1877
|
+
"onUpdate:modelValue": P[3] || (P[3] = (L) => R(L))
|
|
1878
1878
|
}, {
|
|
1879
1879
|
default: B(() => [
|
|
1880
|
-
($(!0), J(Oe, null, Ne(p.value, (
|
|
1881
|
-
key:
|
|
1882
|
-
label: o(x)(`menu.group.types.${
|
|
1883
|
-
value:
|
|
1880
|
+
($(!0), J(Oe, null, Ne(p.value, (L) => ($(), H(Ce, {
|
|
1881
|
+
key: L.value,
|
|
1882
|
+
label: o(x)(`menu.group.types.${L.label.toLowerCase()}`),
|
|
1883
|
+
value: L.value
|
|
1884
1884
|
}, null, 8, ["label", "value"]))), 128))
|
|
1885
1885
|
]),
|
|
1886
1886
|
_: 1
|
|
@@ -1888,13 +1888,13 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1888
1888
|
]),
|
|
1889
1889
|
_: 1
|
|
1890
1890
|
}, 8, ["label"])) : X("", !0),
|
|
1891
|
-
C(
|
|
1891
|
+
C(Re, {
|
|
1892
1892
|
label: o(x)("menu.common.labels.configuration")
|
|
1893
1893
|
}, {
|
|
1894
1894
|
default: B(() => [
|
|
1895
1895
|
C(c, {
|
|
1896
1896
|
modelValue: y.group.stackable,
|
|
1897
|
-
"onUpdate:modelValue": P[4] || (P[4] = (
|
|
1897
|
+
"onUpdate:modelValue": P[4] || (P[4] = (L) => y.group.stackable = L),
|
|
1898
1898
|
disabled: k("stackable"),
|
|
1899
1899
|
label: o(x)("menu.common.labels.stackable"),
|
|
1900
1900
|
"label-placement": "right",
|
|
@@ -1934,10 +1934,10 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1934
1934
|
C(Ar, {
|
|
1935
1935
|
"allow-refund-inventory": y.allowRefundInventory ?? !1,
|
|
1936
1936
|
"categorized-items": y.categorizedItems,
|
|
1937
|
-
config:
|
|
1937
|
+
config: F.value,
|
|
1938
1938
|
group: y.group,
|
|
1939
|
-
"onUpdate:group": P[5] || (P[5] = (
|
|
1940
|
-
"onUpdate:unmapGroup": P[6] || (P[6] = (
|
|
1939
|
+
"onUpdate:group": P[5] || (P[5] = (L) => T(L)),
|
|
1940
|
+
"onUpdate:unmapGroup": P[6] || (P[6] = (L) => T(M(L)))
|
|
1941
1941
|
}, null, 8, ["allow-refund-inventory", "categorized-items", "config", "group"])
|
|
1942
1942
|
]),
|
|
1943
1943
|
_: 1
|
|
@@ -1958,26 +1958,26 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1958
1958
|
},
|
|
1959
1959
|
emits: ["update:combinations"],
|
|
1960
1960
|
setup(n, { expose: r, emit: e }) {
|
|
1961
|
-
var
|
|
1962
|
-
const t = n, m = e, s = se(), g = Ge(), d = Vt(ot(
|
|
1963
|
-
() => h.value.findIndex((
|
|
1961
|
+
var R, M;
|
|
1962
|
+
const t = n, m = e, s = se(), g = Ge(), d = Vt(ot(Ue())), h = q([]), w = q(t.combinations[0].combinationKey || ""), _ = D(
|
|
1963
|
+
() => h.value.findIndex((S) => S.combinationKey == w.value)
|
|
1964
1964
|
), b = D(
|
|
1965
|
-
() => t.combinations.map((
|
|
1966
|
-
label: t.fullCombinations[
|
|
1967
|
-
value:
|
|
1965
|
+
() => t.combinations.map((S) => ({
|
|
1966
|
+
label: t.fullCombinations[S.combinationKey || ""],
|
|
1967
|
+
value: S.combinationKey || ""
|
|
1968
1968
|
}))
|
|
1969
1969
|
), f = D(() => {
|
|
1970
1970
|
var i, v;
|
|
1971
1971
|
if (!k.value) return null;
|
|
1972
|
-
const
|
|
1972
|
+
const S = ((v = (i = h.value[_.value]) == null ? void 0 : i.groups) == null ? void 0 : v.find((x) => x._id === t.groupId)) || {
|
|
1973
1973
|
_id: t.groupId,
|
|
1974
1974
|
groupKey: ""
|
|
1975
|
-
}, E = s.state.menu.modules.group.find((x) => x._id === t.groupId), u = Object.entries({ ...
|
|
1975
|
+
}, E = s.state.menu.modules.group.find((x) => x._id === t.groupId), u = Object.entries({ ...S, items: void 0 }).filter(([, x]) => !!x), l = {
|
|
1976
1976
|
...E,
|
|
1977
1977
|
...Object.fromEntries(u),
|
|
1978
1978
|
items: E.items.map((x) => {
|
|
1979
1979
|
var P;
|
|
1980
|
-
const y = (P =
|
|
1980
|
+
const y = (P = S.items) == null ? void 0 : P.find(
|
|
1981
1981
|
(j) => j._id == x._id && j.combinationKey == x.combinationKey
|
|
1982
1982
|
);
|
|
1983
1983
|
return {
|
|
@@ -1991,28 +1991,28 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
1991
1991
|
};
|
|
1992
1992
|
return new nn(s, d.updateMenu, g).mapGroups([l], !0)[0];
|
|
1993
1993
|
});
|
|
1994
|
-
function a(
|
|
1994
|
+
function a(S) {
|
|
1995
1995
|
var l, i;
|
|
1996
|
-
const
|
|
1996
|
+
const U = (l = h.value[_.value].groups) == null ? void 0 : l.findIndex(
|
|
1997
1997
|
(v) => v._id === t.groupId
|
|
1998
|
-
), E = me(h.value), u = { ...tn(
|
|
1999
|
-
(
|
|
1998
|
+
), E = me(h.value), u = { ...tn(S), _id: t.groupId, groupKey: "" };
|
|
1999
|
+
(U ?? -1) < 0 ? E[_.value] = {
|
|
2000
2000
|
...E[_.value],
|
|
2001
2001
|
groups: [...((i = E[_.value]) == null ? void 0 : i.groups) || [], u]
|
|
2002
|
-
} : E[_.value].groups[
|
|
2002
|
+
} : E[_.value].groups[U] = u, h.value = E;
|
|
2003
2003
|
}
|
|
2004
|
-
function I(
|
|
2005
|
-
const
|
|
2004
|
+
function I(S) {
|
|
2005
|
+
const U = b.value.length;
|
|
2006
2006
|
let E = _.value;
|
|
2007
|
-
|
|
2007
|
+
S === "left" ? E = E === 0 ? U - 1 : E - 1 : E = E === U - 1 ? 0 : E + 1, w.value = b.value[E].value;
|
|
2008
2008
|
}
|
|
2009
|
-
function S
|
|
2009
|
+
function F(S) {
|
|
2010
2010
|
return {
|
|
2011
2011
|
isV4: s.version === te.F_MENU_VERSION.enum.v4,
|
|
2012
|
-
isDefault: (
|
|
2013
|
-
link: (
|
|
2014
|
-
orderFrom: (
|
|
2015
|
-
name: (
|
|
2012
|
+
isDefault: (U) => !1,
|
|
2013
|
+
link: (U) => !1,
|
|
2014
|
+
orderFrom: (U) => !0,
|
|
2015
|
+
name: (U) => !1,
|
|
2016
2016
|
bindToVariant: !1,
|
|
2017
2017
|
inventory: !0,
|
|
2018
2018
|
orderFromActiveOnly: s.rules.item.orderFromActiveOnly,
|
|
@@ -2026,47 +2026,47 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2026
2026
|
};
|
|
2027
2027
|
}
|
|
2028
2028
|
function O() {
|
|
2029
|
-
const
|
|
2029
|
+
const S = h.value.map((U) => {
|
|
2030
2030
|
var E;
|
|
2031
2031
|
return {
|
|
2032
|
-
...
|
|
2033
|
-
groups: (E =
|
|
2034
|
-
...Hn(u,
|
|
2032
|
+
...U,
|
|
2033
|
+
groups: (E = U.groups) == null ? void 0 : E.map((u) => ({
|
|
2034
|
+
...Hn(u, F())
|
|
2035
2035
|
}))
|
|
2036
2036
|
};
|
|
2037
2037
|
});
|
|
2038
|
-
m("update:combinations",
|
|
2038
|
+
m("update:combinations", S);
|
|
2039
2039
|
}
|
|
2040
2040
|
const k = q(!1);
|
|
2041
2041
|
ye(
|
|
2042
2042
|
() => k.value,
|
|
2043
|
-
(
|
|
2044
|
-
|
|
2043
|
+
(S) => {
|
|
2044
|
+
S && (h.value = me(t.combinations), w.value = t.combinations[0].combinationKey || "");
|
|
2045
2045
|
}
|
|
2046
2046
|
);
|
|
2047
2047
|
const p = q();
|
|
2048
2048
|
r({
|
|
2049
|
-
show: (
|
|
2049
|
+
show: (R = p.value) == null ? void 0 : R.show,
|
|
2050
2050
|
trigger: (M = p.value) == null ? void 0 : M.trigger
|
|
2051
2051
|
});
|
|
2052
2052
|
const { t: T } = ce();
|
|
2053
|
-
return (
|
|
2053
|
+
return (S, U) => {
|
|
2054
2054
|
const E = W("fm-select"), u = W("fm-button"), l = W("fm-card");
|
|
2055
2055
|
return $(), H(In, {
|
|
2056
2056
|
ref_key: "baseFormRef",
|
|
2057
2057
|
ref: p,
|
|
2058
2058
|
"allow-refund-inventory": !0,
|
|
2059
2059
|
"categorized-items": o(s).categorizedItems,
|
|
2060
|
-
config:
|
|
2060
|
+
config: F,
|
|
2061
2061
|
group: f.value,
|
|
2062
2062
|
action: "update",
|
|
2063
2063
|
title: o(T)("menu.group.update"),
|
|
2064
|
-
"onUpdate:group":
|
|
2065
|
-
"onSubmit:group":
|
|
2066
|
-
"onStatus:show":
|
|
2064
|
+
"onUpdate:group": U[3] || (U[3] = (i) => a(i)),
|
|
2065
|
+
"onSubmit:group": U[4] || (U[4] = (i) => O()),
|
|
2066
|
+
"onStatus:show": U[5] || (U[5] = (i) => k.value = i)
|
|
2067
2067
|
}, {
|
|
2068
2068
|
default: B(({ trigger: i }) => [
|
|
2069
|
-
Me(
|
|
2069
|
+
Me(S.$slots, "default", { trigger: i })
|
|
2070
2070
|
]),
|
|
2071
2071
|
"variant-section": B(() => [
|
|
2072
2072
|
w.value ? ($(), H(l, {
|
|
@@ -2079,7 +2079,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2079
2079
|
A("div", Br, [
|
|
2080
2080
|
C(E, {
|
|
2081
2081
|
modelValue: w.value,
|
|
2082
|
-
"onUpdate:modelValue":
|
|
2082
|
+
"onUpdate:modelValue": U[0] || (U[0] = (i) => w.value = i),
|
|
2083
2083
|
items: b.value,
|
|
2084
2084
|
class: "flex-1"
|
|
2085
2085
|
}, null, 8, ["modelValue", "items"]),
|
|
@@ -2088,13 +2088,13 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2088
2088
|
variant: o(qe).Tertiary,
|
|
2089
2089
|
"prepend-icon": "keyboard_arrow_left",
|
|
2090
2090
|
size: "lg",
|
|
2091
|
-
onClick:
|
|
2091
|
+
onClick: U[1] || (U[1] = (i) => I("left"))
|
|
2092
2092
|
}, null, 8, ["variant"]),
|
|
2093
2093
|
C(u, {
|
|
2094
2094
|
variant: o(qe).Tertiary,
|
|
2095
2095
|
"prepend-icon": "keyboard_arrow_right",
|
|
2096
2096
|
size: "lg",
|
|
2097
|
-
onClick:
|
|
2097
|
+
onClick: U[2] || (U[2] = (i) => I("right"))
|
|
2098
2098
|
}, null, 8, ["variant"])
|
|
2099
2099
|
])
|
|
2100
2100
|
])
|
|
@@ -2132,21 +2132,21 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2132
2132
|
}))
|
|
2133
2133
|
]), b = D(() => !!s.state.currentCatalogId || !!s.state.currentSchedulerId);
|
|
2134
2134
|
D(() => {
|
|
2135
|
-
const O = !s.state.currentSchedulerId, k = s.rules.group.type, p = s.version == te.F_MENU_VERSION.enum.v3, T = s.rules.item.orderFromActiveOnly,
|
|
2136
|
-
return function(
|
|
2135
|
+
const O = !s.state.currentSchedulerId, k = s.rules.group.type, p = s.version == te.F_MENU_VERSION.enum.v3, T = s.rules.item.orderFromActiveOnly, R = s.rules.item.bindToVariant;
|
|
2136
|
+
return function(S) {
|
|
2137
2137
|
return {
|
|
2138
|
-
isDefault: (
|
|
2139
|
-
link: (
|
|
2140
|
-
name: (
|
|
2141
|
-
type: k && !
|
|
2142
|
-
price:
|
|
2138
|
+
isDefault: (U) => !b.value && !U,
|
|
2139
|
+
link: (U) => !b.value && (!U || R),
|
|
2140
|
+
name: (U) => !b.value && !U,
|
|
2141
|
+
type: k && !S._id && !b.value,
|
|
2142
|
+
price: S.type != te.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
|
|
2143
2143
|
priceEdit: !0,
|
|
2144
2144
|
priceTier: s.isV4,
|
|
2145
|
-
inventory: O ? p ? !b.value &&
|
|
2146
|
-
orderFrom: (
|
|
2145
|
+
inventory: O ? p ? !b.value && S.type == te.F_ADDON_GROUP_TYPE.enum.NORMAL : !b.value : !1,
|
|
2146
|
+
orderFrom: (U) => O ? p ? S.type == te.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? b.value : !!b.value == !U : b.value : !1,
|
|
2147
2147
|
orderFromActiveOnly: T,
|
|
2148
|
-
showOrderFrom: O ? p ? b.value ? !0 :
|
|
2149
|
-
bindToVariant:
|
|
2148
|
+
showOrderFrom: O ? p ? b.value ? !0 : S.type == te.F_ADDON_GROUP_TYPE.enum.PRODUCT : b.value : !1,
|
|
2149
|
+
bindToVariant: R,
|
|
2150
2150
|
isOverride: b.value,
|
|
2151
2151
|
isItemGroup: !1,
|
|
2152
2152
|
isV4: !p
|
|
@@ -2159,11 +2159,11 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2159
2159
|
position: s.groups.length - 1,
|
|
2160
2160
|
itemsLinked: []
|
|
2161
2161
|
}));
|
|
2162
|
-
const f = q(me(r.groupIds || [])), a = q(""), { t: I } = ce(),
|
|
2162
|
+
const f = q(me(r.groupIds || [])), a = q(""), { t: I } = ce(), F = () => {
|
|
2163
2163
|
t(f.value), m("primary"), e.close();
|
|
2164
2164
|
};
|
|
2165
2165
|
return (O, k) => {
|
|
2166
|
-
const p = W("FmSearch"), T = W("FmCheckbox"),
|
|
2166
|
+
const p = W("FmSearch"), T = W("FmCheckbox"), R = W("FmButton");
|
|
2167
2167
|
return _.value.length > 0 ? ($(), J("div", qr, [
|
|
2168
2168
|
A("div", null, [
|
|
2169
2169
|
C(p, {
|
|
@@ -2181,8 +2181,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2181
2181
|
ft(C(T, {
|
|
2182
2182
|
modelValue: f.value,
|
|
2183
2183
|
"onUpdate:modelValue": [
|
|
2184
|
-
k[1] || (k[1] = (
|
|
2185
|
-
k[2] || (k[2] = (
|
|
2184
|
+
k[1] || (k[1] = (S) => f.value = S),
|
|
2185
|
+
k[2] || (k[2] = (S) => o(t)(f.value))
|
|
2186
2186
|
],
|
|
2187
2187
|
label: M.label,
|
|
2188
2188
|
value: M.value
|
|
@@ -2195,24 +2195,24 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2195
2195
|
A("div", Xr, [
|
|
2196
2196
|
C(o(jt), null, {
|
|
2197
2197
|
default: B(({ trigger: M }) => [
|
|
2198
|
-
C(
|
|
2198
|
+
C(R, {
|
|
2199
2199
|
label: o(I)("menu.common.actions.add_group"),
|
|
2200
2200
|
variant: "tertiary",
|
|
2201
2201
|
"text-color": "primary",
|
|
2202
|
-
onClick: (
|
|
2202
|
+
onClick: (S) => M()
|
|
2203
2203
|
}, null, 8, ["label", "onClick"])
|
|
2204
2204
|
]),
|
|
2205
2205
|
_: 1
|
|
2206
2206
|
}),
|
|
2207
2207
|
A("div", Jr, [
|
|
2208
|
-
C(
|
|
2208
|
+
C(R, {
|
|
2209
2209
|
label: o(I)("menu.common.actions.cancel"),
|
|
2210
2210
|
variant: "tertiary",
|
|
2211
2211
|
onClick: k[3] || (k[3] = (M) => o(e).close())
|
|
2212
2212
|
}, null, 8, ["label"]),
|
|
2213
|
-
C(
|
|
2213
|
+
C(R, {
|
|
2214
2214
|
label: o(I)("menu.common.actions.confirm"),
|
|
2215
|
-
onClick: k[4] || (k[4] = (M) =>
|
|
2215
|
+
onClick: k[4] || (k[4] = (M) => F())
|
|
2216
2216
|
}, null, 8, ["label"])
|
|
2217
2217
|
])
|
|
2218
2218
|
])
|
|
@@ -2223,10 +2223,10 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2223
2223
|
]),
|
|
2224
2224
|
C(o(jt), null, {
|
|
2225
2225
|
default: B(({ trigger: M }) => [
|
|
2226
|
-
C(
|
|
2226
|
+
C(R, {
|
|
2227
2227
|
label: o(I)("menu.common.actions.add_group"),
|
|
2228
2228
|
icon: "add",
|
|
2229
|
-
onClick: (
|
|
2229
|
+
onClick: (S) => M()
|
|
2230
2230
|
}, null, 8, ["label", "onClick"])
|
|
2231
2231
|
]),
|
|
2232
2232
|
_: 1
|
|
@@ -2295,7 +2295,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2295
2295
|
const I = D(() => f(w.value).reduce((l, i) => (l[i._id] = {
|
|
2296
2296
|
name: i.name,
|
|
2297
2297
|
type: on(t.items, i.items)
|
|
2298
|
-
}, l), {})),
|
|
2298
|
+
}, l), {})), F = D(() => [...Object.entries(I.value).map(([l, {
|
|
2299
2299
|
name: i,
|
|
2300
2300
|
type: v
|
|
2301
2301
|
}]) => ({
|
|
@@ -2358,11 +2358,11 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2358
2358
|
variant: "tertiary",
|
|
2359
2359
|
textColor: "neutral-gray-400",
|
|
2360
2360
|
onClick: He(async () => {
|
|
2361
|
-
|
|
2361
|
+
R(i);
|
|
2362
2362
|
}, ["stop", "prevent"])
|
|
2363
2363
|
}), ve(Wr, {
|
|
2364
2364
|
// variant items
|
|
2365
|
-
combinations:
|
|
2365
|
+
combinations: S.value ?? [],
|
|
2366
2366
|
// combinationKey: varaintName
|
|
2367
2367
|
fullCombinations: e.fullCombinations,
|
|
2368
2368
|
groupId: i,
|
|
@@ -2371,10 +2371,10 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2371
2371
|
default: ({
|
|
2372
2372
|
trigger: v
|
|
2373
2373
|
}) => ve(Ie.FmButton, {
|
|
2374
|
-
id: pt(
|
|
2374
|
+
id: pt(Fe.GROUP, i),
|
|
2375
2375
|
icon: "edit",
|
|
2376
2376
|
variant: "tertiary",
|
|
2377
|
-
disabled: !
|
|
2377
|
+
disabled: !U(i),
|
|
2378
2378
|
textColor: "neutral-gray-400",
|
|
2379
2379
|
onClick: v
|
|
2380
2380
|
})
|
|
@@ -2408,7 +2408,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2408
2408
|
groups: i
|
|
2409
2409
|
}));
|
|
2410
2410
|
}
|
|
2411
|
-
function
|
|
2411
|
+
function R(l) {
|
|
2412
2412
|
var v, x, y;
|
|
2413
2413
|
if (!e.form.groups)
|
|
2414
2414
|
return;
|
|
@@ -2424,7 +2424,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2424
2424
|
const M = D(() => {
|
|
2425
2425
|
var l;
|
|
2426
2426
|
return !!((l = e.form.variant) != null && l.variantGroupIds.length);
|
|
2427
|
-
}),
|
|
2427
|
+
}), S = D(() => {
|
|
2428
2428
|
var l;
|
|
2429
2429
|
return M.value ? (l = e.form.variant) == null ? void 0 : l.variantCombinations : [{
|
|
2430
2430
|
_id: e.form._id,
|
|
@@ -2432,7 +2432,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2432
2432
|
groups: e.form.groups || []
|
|
2433
2433
|
}];
|
|
2434
2434
|
});
|
|
2435
|
-
function
|
|
2435
|
+
function U(l) {
|
|
2436
2436
|
var v;
|
|
2437
2437
|
if (!l) return !1;
|
|
2438
2438
|
if (h.value.overrideProductGroup) return !0;
|
|
@@ -2450,7 +2450,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2450
2450
|
ye(() => w.value.length, () => T([...b.value, w.value[w.value.length - 1]._id]));
|
|
2451
2451
|
const E = (l) => {
|
|
2452
2452
|
var i;
|
|
2453
|
-
return (i =
|
|
2453
|
+
return (i = F.value.find((v) => v.value === l)) == null ? void 0 : i.label;
|
|
2454
2454
|
}, u = (l) => {
|
|
2455
2455
|
var i;
|
|
2456
2456
|
M.value ? g("update:form", "variant", {
|
|
@@ -2463,7 +2463,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2463
2463
|
return $(), H(De, {
|
|
2464
2464
|
title: o(s)("menu.product.form.group.title"),
|
|
2465
2465
|
"sub-title": o(s)("menu.product.form.group.subtitle"),
|
|
2466
|
-
id: o(
|
|
2466
|
+
id: o(Fe).GROUP
|
|
2467
2467
|
}, {
|
|
2468
2468
|
"append-title": B(() => [C(v, {
|
|
2469
2469
|
class: "flex-shrink-0",
|
|
@@ -2518,11 +2518,11 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2518
2518
|
const {
|
|
2519
2519
|
t: e
|
|
2520
2520
|
} = ce(), t = n, m = r, s = se(), g = D(() => s.rules.item), d = D(() => g.value.inventory);
|
|
2521
|
-
function h(
|
|
2521
|
+
function h(F, O, k, p) {
|
|
2522
2522
|
return !O || O && O.length === 0 ? [{
|
|
2523
2523
|
_id: "",
|
|
2524
2524
|
name: k || "",
|
|
2525
|
-
binding:
|
|
2525
|
+
binding: F || []
|
|
2526
2526
|
}] : O.map((T) => ({
|
|
2527
2527
|
_id: T.combinationKey || "",
|
|
2528
2528
|
name: un(T.combinationKey || "", p),
|
|
@@ -2530,25 +2530,25 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2530
2530
|
}));
|
|
2531
2531
|
}
|
|
2532
2532
|
const w = D(() => {
|
|
2533
|
-
var
|
|
2534
|
-
return t.form.name || ((
|
|
2533
|
+
var F;
|
|
2534
|
+
return t.form.name || ((F = t.fallback) == null ? void 0 : F.name) || "";
|
|
2535
2535
|
}), _ = D(() => {
|
|
2536
|
-
var
|
|
2537
|
-
return h(t.form.inventoryBindings || [], ((
|
|
2536
|
+
var F;
|
|
2537
|
+
return h(t.form.inventoryBindings || [], ((F = t.form.variant) == null ? void 0 : F.variantCombinations) || [], w.value, s.variants);
|
|
2538
2538
|
});
|
|
2539
|
-
function b(
|
|
2540
|
-
var
|
|
2539
|
+
function b(F, O) {
|
|
2540
|
+
var R, M;
|
|
2541
2541
|
let k = ke.clone(t.form);
|
|
2542
2542
|
const p = k.variant;
|
|
2543
|
-
if ((((
|
|
2544
|
-
const
|
|
2545
|
-
if (
|
|
2546
|
-
const
|
|
2547
|
-
|
|
2543
|
+
if ((((R = p == null ? void 0 : p.variantCombinations) == null ? void 0 : R.length) ?? 0) > 0 && p) {
|
|
2544
|
+
const S = p.variantCombinations.findIndex((E) => E.combinationKey === F);
|
|
2545
|
+
if (S < 0) return;
|
|
2546
|
+
const U = ke.clone(p.variantCombinations);
|
|
2547
|
+
U[S].inventoryBindings = O, k = {
|
|
2548
2548
|
...k,
|
|
2549
2549
|
variant: {
|
|
2550
2550
|
variantGroupIds: ((M = k.variant) == null ? void 0 : M.variantGroupIds) || [],
|
|
2551
|
-
variantCombinations:
|
|
2551
|
+
variantCombinations: U
|
|
2552
2552
|
}
|
|
2553
2553
|
};
|
|
2554
2554
|
} else
|
|
@@ -2566,8 +2566,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2566
2566
|
accessorKey: "_skuLinked",
|
|
2567
2567
|
header: () => e("menu.inventory.columns.ingredient"),
|
|
2568
2568
|
enableSorting: !1,
|
|
2569
|
-
cell: (
|
|
2570
|
-
const O =
|
|
2569
|
+
cell: (F) => {
|
|
2570
|
+
const O = F.getValue();
|
|
2571
2571
|
return O ? e("menu.inventory.status.sku_linked", {
|
|
2572
2572
|
count: O
|
|
2573
2573
|
}) : e("menu.inventory.status.not_set");
|
|
@@ -2576,8 +2576,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2576
2576
|
accessorKey: "_recipeLinked",
|
|
2577
2577
|
header: () => e("menu.inventory.columns.recipe"),
|
|
2578
2578
|
enableSorting: !1,
|
|
2579
|
-
cell: (
|
|
2580
|
-
const O =
|
|
2579
|
+
cell: (F) => {
|
|
2580
|
+
const O = F.getValue();
|
|
2581
2581
|
return O ? e("menu.inventory.status.recipe_linked", {
|
|
2582
2582
|
count: O
|
|
2583
2583
|
}) : e("menu.inventory.status.not_set");
|
|
@@ -2586,8 +2586,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2586
2586
|
id: "action",
|
|
2587
2587
|
size: 52,
|
|
2588
2588
|
enableSorting: !1,
|
|
2589
|
-
cell: (
|
|
2590
|
-
const O =
|
|
2589
|
+
cell: (F) => {
|
|
2590
|
+
const O = F.row.original;
|
|
2591
2591
|
return d.value ? C("div", {
|
|
2592
2592
|
class: "flex items-center justify-end"
|
|
2593
2593
|
}, [C(Et, {
|
|
@@ -2605,7 +2605,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2605
2605
|
}) => C(W("fm-button"), {
|
|
2606
2606
|
variant: qe.Tertiary,
|
|
2607
2607
|
prependIcon: "edit",
|
|
2608
|
-
textColor:
|
|
2608
|
+
textColor: Se.NeutralGray400,
|
|
2609
2609
|
onClick: k
|
|
2610
2610
|
}, null)
|
|
2611
2611
|
})]) : null;
|
|
@@ -2613,15 +2613,15 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2613
2613
|
}]);
|
|
2614
2614
|
const f = q([]);
|
|
2615
2615
|
async function a({
|
|
2616
|
-
_id:
|
|
2616
|
+
_id: F
|
|
2617
2617
|
}) {
|
|
2618
2618
|
for (const O of f.value)
|
|
2619
|
-
O.getKey() ===
|
|
2619
|
+
O.getKey() === F && O.trigger(!0);
|
|
2620
2620
|
}
|
|
2621
2621
|
const I = Eo();
|
|
2622
2622
|
return Ae(() => {
|
|
2623
2623
|
I.readInventory();
|
|
2624
|
-
}), (
|
|
2624
|
+
}), (F, O) => ($(), H(De, {
|
|
2625
2625
|
title: o(e)("menu.inventory.title"),
|
|
2626
2626
|
subTitle: o(e)("menu.inventory.subtitle")
|
|
2627
2627
|
}, {
|
|
@@ -2669,8 +2669,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2669
2669
|
emits: ["update:form"],
|
|
2670
2670
|
setup(n, { emit: r }) {
|
|
2671
2671
|
const e = n, t = rt(), m = se(), { t: s } = ce(), g = r, d = D(() => m.rules.item), h = D(() => {
|
|
2672
|
-
var
|
|
2673
|
-
const p = e.isOverride ? ((
|
|
2672
|
+
var R, M;
|
|
2673
|
+
const p = e.isOverride ? ((R = e.fallback) == null ? void 0 : R.unit) ?? ((M = e.fallback) == null ? void 0 : M.perXUnit) : void 0, T = e.form.unit ?? e.form.perXUnit ?? p;
|
|
2674
2674
|
return T != null;
|
|
2675
2675
|
}), w = (p) => {
|
|
2676
2676
|
g("update:form", "unit", p ? "" : void 0), g("update:form", "perXUnit", p ? 0 : void 0);
|
|
@@ -2692,16 +2692,16 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2692
2692
|
}
|
|
2693
2693
|
function a(p) {
|
|
2694
2694
|
if (!p && e.form.perXUnit) {
|
|
2695
|
-
const [T,
|
|
2696
|
-
if (
|
|
2697
|
-
const
|
|
2698
|
-
g("update:form", "perXUnit", parseFloat(
|
|
2695
|
+
const [T, R] = e.form.perXUnit.toString().split(".");
|
|
2696
|
+
if (R && R.length > 4) {
|
|
2697
|
+
const S = (typeof e.form.perXUnit == "string" ? parseFloat(e.form.perXUnit) : e.form.perXUnit).toFixed(4);
|
|
2698
|
+
g("update:form", "perXUnit", parseFloat(S));
|
|
2699
2699
|
}
|
|
2700
2700
|
}
|
|
2701
2701
|
}
|
|
2702
2702
|
const I = q(!1);
|
|
2703
|
-
async function
|
|
2704
|
-
var T,
|
|
2703
|
+
async function F() {
|
|
2704
|
+
var T, R, M, S, U, E, u, l;
|
|
2705
2705
|
if (!(e.form.name || "")) {
|
|
2706
2706
|
const i = document.getElementById("product-name");
|
|
2707
2707
|
if (i) {
|
|
@@ -2724,8 +2724,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2724
2724
|
u,
|
|
2725
2725
|
{
|
|
2726
2726
|
name: e.form.name || "",
|
|
2727
|
-
lat: (M = (
|
|
2728
|
-
lon: (E = (
|
|
2727
|
+
lat: (M = (R = (T = t.currentRestaurant) == null ? void 0 : T.value) == null ? void 0 : R.profile.address.coordinates) == null ? void 0 : M[1],
|
|
2728
|
+
lon: (E = (U = (S = t.currentRestaurant) == null ? void 0 : S.value) == null ? void 0 : U.profile.address.coordinates) == null ? void 0 : E[0]
|
|
2729
2729
|
},
|
|
2730
2730
|
!0
|
|
2731
2731
|
));
|
|
@@ -2738,7 +2738,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2738
2738
|
return ((p = m.currentCatalog) == null ? void 0 : p.priceTierRules) ?? ((T = m.currentCatalog) == null ? void 0 : T.usePriceTiers) ?? [];
|
|
2739
2739
|
});
|
|
2740
2740
|
return (p, T) => {
|
|
2741
|
-
const
|
|
2741
|
+
const R = W("fm-select"), M = W("FmButton"), S = W("fm-checkbox"), U = W("fm-text-field"), E = Xt("tooltip");
|
|
2742
2742
|
return $(), H(De, {
|
|
2743
2743
|
title: o(s)("menu.product.form.price.title")
|
|
2744
2744
|
}, {
|
|
@@ -2746,7 +2746,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2746
2746
|
var u;
|
|
2747
2747
|
return [
|
|
2748
2748
|
A("div", {
|
|
2749
|
-
id: o(
|
|
2749
|
+
id: o(Fe).PRICE,
|
|
2750
2750
|
class: fe(["flex space-x-16", "xs:flex-col xs:space-x-0 xs:space-y-16"])
|
|
2751
2751
|
}, [
|
|
2752
2752
|
C(Xe, {
|
|
@@ -2756,7 +2756,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2756
2756
|
placeholder: (u = p.fallback) != null && u.price ? o(tt)(p.fallback.price, !1) : void 0,
|
|
2757
2757
|
rules: [
|
|
2758
2758
|
d.value.price ? (l) => !!l || o(s)("menu.product.form.price.fields.selling_price.required") : void 0
|
|
2759
|
-
].filter(o(
|
|
2759
|
+
].filter(o(Ut).isSet),
|
|
2760
2760
|
class: "w-[258px] xs:w-full",
|
|
2761
2761
|
label: o(s)("menu.product.form.price.fields.selling_price.label"),
|
|
2762
2762
|
"show-currency": "",
|
|
@@ -2765,14 +2765,14 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2765
2765
|
append: B(() => [
|
|
2766
2766
|
ft(C(Zt, {
|
|
2767
2767
|
"pure-styling": "",
|
|
2768
|
-
onClick:
|
|
2768
|
+
onClick: F
|
|
2769
2769
|
}, null, 512), [
|
|
2770
2770
|
[E, o(dn)("Suggest pricing")]
|
|
2771
2771
|
])
|
|
2772
2772
|
]),
|
|
2773
2773
|
_: 1
|
|
2774
2774
|
}, 8, ["disable", "model-value", "placeholder", "rules", "label"]),
|
|
2775
|
-
C(
|
|
2775
|
+
C(R, {
|
|
2776
2776
|
disabled: !d.value.tax || !_.value.systemCode,
|
|
2777
2777
|
items: _.value.countryTaxOptions,
|
|
2778
2778
|
label: _.value.systemCode ? o(s)("menu.product.form.price.fields.tax.label_with_code", {
|
|
@@ -2785,7 +2785,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2785
2785
|
"onUpdate:modelValue": T[1] || (T[1] = (l) => g("update:form", "taxes", [o(vt).decodeTax(l)]))
|
|
2786
2786
|
}, null, 8, ["disabled", "items", "label", "model-value"])
|
|
2787
2787
|
], 8, ia),
|
|
2788
|
-
!p.isOverride && o(m).isV4 ? ($(), H(
|
|
2788
|
+
!p.isOverride && o(m).isV4 ? ($(), H(Re, {
|
|
2789
2789
|
key: 0,
|
|
2790
2790
|
label: o(s)("menu.price_tier.price_group"),
|
|
2791
2791
|
description: o(s)("menu.price_tier.description")
|
|
@@ -2812,14 +2812,14 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2812
2812
|
}),
|
|
2813
2813
|
_: 1
|
|
2814
2814
|
}, 8, ["label", "description"])) : X("", !0),
|
|
2815
|
-
C(
|
|
2815
|
+
C(Re, {
|
|
2816
2816
|
label: o(s)("menu.product.form.price.settings.title")
|
|
2817
2817
|
}, {
|
|
2818
2818
|
default: B(() => {
|
|
2819
2819
|
var l, i, v;
|
|
2820
2820
|
return [
|
|
2821
2821
|
A("div", sa, [
|
|
2822
|
-
C(
|
|
2822
|
+
C(S, {
|
|
2823
2823
|
disabled: !d.value.openPrice || p.isAddon,
|
|
2824
2824
|
"model-value": p.form.openPrice ?? ((l = p.fallback) == null ? void 0 : l.openPrice) ?? !1,
|
|
2825
2825
|
value: p.form.openPrice,
|
|
@@ -2828,7 +2828,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2828
2828
|
"onUpdate:modelValue": T[3] || (T[3] = (x) => g("update:form", "openPrice", x))
|
|
2829
2829
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
2830
2830
|
A("div", ua, [
|
|
2831
|
-
C(
|
|
2831
|
+
C(S, {
|
|
2832
2832
|
disabled: !d.value.unit || p.isAddon,
|
|
2833
2833
|
"model-value": h.value,
|
|
2834
2834
|
value: h.value,
|
|
@@ -2839,7 +2839,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2839
2839
|
h.value ? ($(), J("div", da, [
|
|
2840
2840
|
A("p", ca, ge(o(s)("menu.product.form.price.settings.sell_by_unit.per_unit.label")), 1),
|
|
2841
2841
|
A("div", ma, [
|
|
2842
|
-
C(
|
|
2842
|
+
C(U, {
|
|
2843
2843
|
disabled: !d.value.unit,
|
|
2844
2844
|
"model-value": p.form.perXUnit || ((i = p.fallback) == null ? void 0 : i.perXUnit) || null,
|
|
2845
2845
|
rules: [
|
|
@@ -2854,7 +2854,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2854
2854
|
}, null, 8, ["disabled", "model-value", "rules", "placeholder"])
|
|
2855
2855
|
]),
|
|
2856
2856
|
A("div", pa, [
|
|
2857
|
-
C(
|
|
2857
|
+
C(U, {
|
|
2858
2858
|
disabled: !d.value.unit,
|
|
2859
2859
|
"model-value": p.form.unit || ((v = p.fallback) == null ? void 0 : v.unit) || null,
|
|
2860
2860
|
rules: [
|
|
@@ -2867,7 +2867,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2867
2867
|
])) : X("", !0)
|
|
2868
2868
|
]),
|
|
2869
2869
|
d.value.costing ? ($(), J("div", fa, [
|
|
2870
|
-
C(
|
|
2870
|
+
C(S, {
|
|
2871
2871
|
"model-value": !!p.form.costing,
|
|
2872
2872
|
value: !!p.form.costing,
|
|
2873
2873
|
label: o(s)("menu.product.form.price.settings.track_costing.label"),
|
|
@@ -2887,7 +2887,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2887
2887
|
])) : X("", !0)
|
|
2888
2888
|
])) : X("", !0),
|
|
2889
2889
|
d.value.minPrice ? ($(), J("div", ba, [
|
|
2890
|
-
C(
|
|
2890
|
+
C(S, {
|
|
2891
2891
|
disabled: !d.value.minPrice || p.isAddon,
|
|
2892
2892
|
"model-value": !!p.form.minPrice,
|
|
2893
2893
|
value: !!p.form.minPrice,
|
|
@@ -2972,10 +2972,10 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2972
2972
|
})
|
|
2973
2973
|
});
|
|
2974
2974
|
}
|
|
2975
|
-
function
|
|
2976
|
-
var
|
|
2977
|
-
let T = [...((M = (
|
|
2978
|
-
p && !T.includes(k) ? T = [...T, k] : p || (T = T.filter((
|
|
2975
|
+
function F(k, p) {
|
|
2976
|
+
var R, M;
|
|
2977
|
+
let T = [...((M = (R = e.form) == null ? void 0 : R.print) == null ? void 0 : M.department) ?? []];
|
|
2978
|
+
p && !T.includes(k) ? T = [...T, k] : p || (T = T.filter((S) => S !== k)), s("update:form", "print", {
|
|
2979
2979
|
...g(),
|
|
2980
2980
|
...e.form.print,
|
|
2981
2981
|
department: T
|
|
@@ -2995,16 +2995,16 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
2995
2995
|
]);
|
|
2996
2996
|
return ye(
|
|
2997
2997
|
() => h.value.length,
|
|
2998
|
-
() =>
|
|
2998
|
+
() => F(h.value[h.value.length - 1]._id, !0)
|
|
2999
2999
|
), (k, p) => {
|
|
3000
|
-
const T = W("fm-switch"),
|
|
3000
|
+
const T = W("fm-switch"), R = W("fm-radio"), M = W("fm-radio-group"), S = W("fm-button"), U = W("fm-checkbox");
|
|
3001
3001
|
return $(), H(De, {
|
|
3002
3002
|
title: o(m)("menu.product.form.print.title")
|
|
3003
3003
|
}, {
|
|
3004
3004
|
default: B(() => {
|
|
3005
3005
|
var E;
|
|
3006
3006
|
return [
|
|
3007
|
-
d.value.printConfig ? ($(), H(
|
|
3007
|
+
d.value.printConfig ? ($(), H(Re, {
|
|
3008
3008
|
key: 0,
|
|
3009
3009
|
label: o(m)("menu.product.form.print.config.label")
|
|
3010
3010
|
}, {
|
|
@@ -3029,7 +3029,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3029
3029
|
}, {
|
|
3030
3030
|
default: B(() => [
|
|
3031
3031
|
A("div", wa, [
|
|
3032
|
-
($(!0), J(Oe, null, Ne(O.value, (u, l) => ($(), H(
|
|
3032
|
+
($(!0), J(Oe, null, Ne(O.value, (u, l) => ($(), H(R, {
|
|
3033
3033
|
key: l,
|
|
3034
3034
|
label: u.label,
|
|
3035
3035
|
sublabel: u.description,
|
|
@@ -3039,7 +3039,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3039
3039
|
]),
|
|
3040
3040
|
_: 1
|
|
3041
3041
|
}, 8, ["label", "model-value"]),
|
|
3042
|
-
C(
|
|
3042
|
+
C(Re, {
|
|
3043
3043
|
label: o(m)("menu.product.form.print.routes.label")
|
|
3044
3044
|
}, {
|
|
3045
3045
|
default: B(() => [
|
|
@@ -3056,7 +3056,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3056
3056
|
return [
|
|
3057
3057
|
A("div", Ca, [
|
|
3058
3058
|
A("div", Ia, [
|
|
3059
|
-
w.value ? ($(), H(
|
|
3059
|
+
w.value ? ($(), H(S, {
|
|
3060
3060
|
key: 0,
|
|
3061
3061
|
disabled: !((i = (l = e.form.print) == null ? void 0 : l.department) != null && i.includes(u)),
|
|
3062
3062
|
class: "handle",
|
|
@@ -3066,14 +3066,14 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3066
3066
|
}, ["stop"]))
|
|
3067
3067
|
}, null, 8, ["disabled"])) : X("", !0)
|
|
3068
3068
|
]),
|
|
3069
|
-
C(
|
|
3069
|
+
C(U, {
|
|
3070
3070
|
id: u,
|
|
3071
3071
|
"data-checked": (x = (v = e.form.print) == null ? void 0 : v.department) == null ? void 0 : x.includes(u),
|
|
3072
3072
|
label: b.value[u],
|
|
3073
3073
|
"model-value": (((y = e.form.print) == null ? void 0 : y.department) ?? []).includes(u),
|
|
3074
3074
|
value: u,
|
|
3075
3075
|
class: "flex-1",
|
|
3076
|
-
"onUpdate:modelValue": (P) =>
|
|
3076
|
+
"onUpdate:modelValue": (P) => F(u, P)
|
|
3077
3077
|
}, null, 8, ["id", "data-checked", "label", "model-value", "value", "onUpdate:modelValue"])
|
|
3078
3078
|
])
|
|
3079
3079
|
];
|
|
@@ -3083,7 +3083,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3083
3083
|
C(o(Jn), { "apply-product": !1 }, {
|
|
3084
3084
|
default: B(({ trigger: u }) => [
|
|
3085
3085
|
A("div", ka, [
|
|
3086
|
-
C(
|
|
3086
|
+
C(S, {
|
|
3087
3087
|
variant: o(qe).Secondary,
|
|
3088
3088
|
label: o(m)("menu.product.form.print.routes.add"),
|
|
3089
3089
|
"prepend-icon": "add",
|
|
@@ -3163,8 +3163,8 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3163
3163
|
menuZIndex: 103,
|
|
3164
3164
|
items: w.value,
|
|
3165
3165
|
shiftMenu: !0,
|
|
3166
|
-
"onUpdate:modelValue": (
|
|
3167
|
-
a.onUpdate(
|
|
3166
|
+
"onUpdate:modelValue": (F) => {
|
|
3167
|
+
a.onUpdate(F || "");
|
|
3168
3168
|
}
|
|
3169
3169
|
}, {
|
|
3170
3170
|
"append-menu": () => t.rules.takeaway.create ? ve("button", {
|
|
@@ -3198,7 +3198,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3198
3198
|
}, 8, ["title", "sub-title"]);
|
|
3199
3199
|
};
|
|
3200
3200
|
}
|
|
3201
|
-
}), xa = { class: "fm-typo-en-title-md-600" },
|
|
3201
|
+
}), xa = { class: "fm-typo-en-title-md-600" }, Fa = { class: "py-16 space-y-32" }, Sa = ["data-not-allow-sort"], Oa = {
|
|
3202
3202
|
key: 1,
|
|
3203
3203
|
class: "w-24"
|
|
3204
3204
|
}, Da = { class: "flex-1" }, Va = { class: "flex gap-8 items-center justify-start" }, $a = /* @__PURE__ */ ae({
|
|
@@ -3216,53 +3216,53 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3216
3216
|
() => e.initialValue ? g("menu.variant.form.title.edit") : g("menu.variant.form.title.add")
|
|
3217
3217
|
), h = D(() => e.initialValue ? "Update" : "Add"), w = () => {
|
|
3218
3218
|
if (e.initialValue) {
|
|
3219
|
-
const
|
|
3220
|
-
return
|
|
3219
|
+
const R = me(e.initialValue);
|
|
3220
|
+
return R.options.push({
|
|
3221
3221
|
_id: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3222
3222
|
name: ""
|
|
3223
|
-
}),
|
|
3223
|
+
}), R;
|
|
3224
3224
|
} else
|
|
3225
3225
|
return { ...Le.generator.initMenuV4VariantGroup(), usedBy: [] };
|
|
3226
3226
|
}, _ = q(w()), b = q(!1), f = q(!1);
|
|
3227
|
-
function a(
|
|
3228
|
-
_.value.options =
|
|
3227
|
+
function a(R) {
|
|
3228
|
+
_.value.options = R;
|
|
3229
3229
|
}
|
|
3230
|
-
function I(
|
|
3231
|
-
const
|
|
3232
|
-
|
|
3230
|
+
function I(R, M) {
|
|
3231
|
+
const S = me(_.value.options), U = S.findIndex((E) => E._id == R);
|
|
3232
|
+
S[U].name = M, _.value.options = S, U === _.value.options.length - 1 && F();
|
|
3233
3233
|
}
|
|
3234
|
-
function
|
|
3235
|
-
const
|
|
3234
|
+
function F() {
|
|
3235
|
+
const R = me(_.value.options);
|
|
3236
3236
|
_.value.options = [
|
|
3237
|
-
...
|
|
3237
|
+
...R,
|
|
3238
3238
|
{
|
|
3239
3239
|
_id: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3240
3240
|
name: ""
|
|
3241
3241
|
}
|
|
3242
3242
|
];
|
|
3243
3243
|
}
|
|
3244
|
-
function O(
|
|
3244
|
+
function O(R) {
|
|
3245
3245
|
const M = me(_.value.options);
|
|
3246
|
-
_.value.options = M.filter((
|
|
3246
|
+
_.value.options = M.filter((S) => S._id !== R);
|
|
3247
3247
|
}
|
|
3248
3248
|
ye(
|
|
3249
3249
|
() => _.value.options,
|
|
3250
|
-
(
|
|
3251
|
-
|
|
3250
|
+
(R) => {
|
|
3251
|
+
R.length <= 0 && F();
|
|
3252
3252
|
},
|
|
3253
3253
|
{
|
|
3254
3254
|
immediate: !0
|
|
3255
3255
|
}
|
|
3256
3256
|
);
|
|
3257
|
-
function k(
|
|
3258
|
-
const M =
|
|
3259
|
-
return M !==
|
|
3257
|
+
function k(R) {
|
|
3258
|
+
const M = R.draggedContext.futureIndex, S = R.relatedContext.list;
|
|
3259
|
+
return M !== S.length - 1;
|
|
3260
3260
|
}
|
|
3261
|
-
const p =
|
|
3261
|
+
const p = Rt(
|
|
3262
3262
|
() => {
|
|
3263
3263
|
if (e.initialValue) {
|
|
3264
|
-
const
|
|
3265
|
-
return !ke.isEqual({ ..._.value, options:
|
|
3264
|
+
const R = _.value.options.filter((M) => !!M.name.trim());
|
|
3265
|
+
return !ke.isEqual({ ..._.value, options: R }, e.initialValue);
|
|
3266
3266
|
} else
|
|
3267
3267
|
return !!(_.value.options.length > 1 || _.value.name.trim());
|
|
3268
3268
|
},
|
|
@@ -3272,15 +3272,15 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3272
3272
|
), T = async () => {
|
|
3273
3273
|
try {
|
|
3274
3274
|
b.value = !0;
|
|
3275
|
-
const
|
|
3276
|
-
|
|
3275
|
+
const R = me(_.value);
|
|
3276
|
+
R.options = R.options.filter((M) => !!M.name.trim()), e.initialValue ? await s.updateMenu({
|
|
3277
3277
|
module: te.F_MENU_MODULE_V4_KEY.enum.variant,
|
|
3278
3278
|
operation: _e.F_OPERATION_TYPE.update,
|
|
3279
|
-
data:
|
|
3279
|
+
data: R
|
|
3280
3280
|
}) : await s.updateMenu({
|
|
3281
3281
|
module: te.F_MENU_MODULE_V4_KEY.enum.variant,
|
|
3282
3282
|
operation: _e.F_OPERATION_TYPE.create,
|
|
3283
|
-
data:
|
|
3283
|
+
data: R
|
|
3284
3284
|
}), m();
|
|
3285
3285
|
} finally {
|
|
3286
3286
|
b.value = !1;
|
|
@@ -3288,13 +3288,13 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3288
3288
|
};
|
|
3289
3289
|
return ye(
|
|
3290
3290
|
() => f.value,
|
|
3291
|
-
(
|
|
3292
|
-
|
|
3291
|
+
(R) => {
|
|
3292
|
+
R ? _.value = w() : m();
|
|
3293
3293
|
}
|
|
3294
3294
|
), Ae(() => {
|
|
3295
3295
|
f.value = !0;
|
|
3296
|
-
}), (
|
|
3297
|
-
const
|
|
3296
|
+
}), (R, M) => {
|
|
3297
|
+
const S = W("fm-text-field"), U = W("fm-icon"), E = W("fm-button"), u = W("fm-side-sheet");
|
|
3298
3298
|
return $(), H(u, {
|
|
3299
3299
|
id: "variant-form",
|
|
3300
3300
|
modelValue: f.value,
|
|
@@ -3330,12 +3330,12 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3330
3330
|
default: B(() => {
|
|
3331
3331
|
var l;
|
|
3332
3332
|
return [
|
|
3333
|
-
A("div",
|
|
3333
|
+
A("div", Fa, [
|
|
3334
3334
|
C(De, {
|
|
3335
3335
|
title: o(g)("menu.variant.form.detail")
|
|
3336
3336
|
}, {
|
|
3337
3337
|
default: B(() => [
|
|
3338
|
-
C(
|
|
3338
|
+
C(S, {
|
|
3339
3339
|
autofocus: "",
|
|
3340
3340
|
label: o(g)("menu.variant.form.name.label"),
|
|
3341
3341
|
"helper-text": o(g)("menu.variant.form.name.helper"),
|
|
@@ -3344,7 +3344,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3344
3344
|
rules: [(i) => !!i || o(g)("menu.variant.form.name.required")],
|
|
3345
3345
|
placeholder: o(g)("menu.variant.form.name.placeholder")
|
|
3346
3346
|
}, null, 8, ["label", "helper-text", "modelValue", "rules", "placeholder"]),
|
|
3347
|
-
C(
|
|
3347
|
+
C(Re, {
|
|
3348
3348
|
label: o(g)("menu.variant.form.options.title")
|
|
3349
3349
|
}, {
|
|
3350
3350
|
default: B(() => [
|
|
@@ -3363,13 +3363,13 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3363
3363
|
class: fe(["flex items-center", "space-x-8"]),
|
|
3364
3364
|
"data-not-allow-sort": v === _.value.options.length - 1
|
|
3365
3365
|
}, [
|
|
3366
|
-
v !== _.value.options.length - 1 ? ($(), H(
|
|
3366
|
+
v !== _.value.options.length - 1 ? ($(), H(U, {
|
|
3367
3367
|
key: 0,
|
|
3368
3368
|
class: "handle",
|
|
3369
3369
|
name: "drag_handle"
|
|
3370
3370
|
})) : v > 0 ? ($(), J("div", Oa)) : X("", !0),
|
|
3371
3371
|
A("div", Da, [
|
|
3372
|
-
C(
|
|
3372
|
+
C(S, {
|
|
3373
3373
|
"model-value": i.name,
|
|
3374
3374
|
rules: [
|
|
3375
3375
|
() => !!_.value.options.length || o(g)("menu.variant.form.options.min_required"),
|
|
@@ -3378,11 +3378,11 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3378
3378
|
class: "flex-1",
|
|
3379
3379
|
placeholder: o(g)("menu.variant.form.options.placeholder"),
|
|
3380
3380
|
"onUpdate:modelValue": (x) => I(i._id, x)
|
|
3381
|
-
},
|
|
3381
|
+
}, Sn({ _: 2 }, [
|
|
3382
3382
|
v !== _.value.options.length - 1 ? {
|
|
3383
3383
|
name: "append",
|
|
3384
3384
|
fn: B(() => [
|
|
3385
|
-
C(
|
|
3385
|
+
C(U, {
|
|
3386
3386
|
name: "close",
|
|
3387
3387
|
onClick: (x) => O(i._id)
|
|
3388
3388
|
}, null, 8, ["onClick"])
|
|
@@ -3391,7 +3391,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3391
3391
|
} : void 0
|
|
3392
3392
|
]), 1032, ["model-value", "rules", "placeholder", "onUpdate:modelValue"])
|
|
3393
3393
|
])
|
|
3394
|
-
], 8,
|
|
3394
|
+
], 8, Sa)
|
|
3395
3395
|
]),
|
|
3396
3396
|
_: 1
|
|
3397
3397
|
}, 8, ["model-value"])
|
|
@@ -3402,7 +3402,7 @@ const Dr = /* @__PURE__ */ ae({
|
|
|
3402
3402
|
]),
|
|
3403
3403
|
_: 1
|
|
3404
3404
|
}, 8, ["title"]),
|
|
3405
|
-
(l = _.value.usedBy) != null && l.length ? ($(), H(
|
|
3405
|
+
(l = _.value.usedBy) != null && l.length ? ($(), H(Fo, {
|
|
3406
3406
|
key: 0,
|
|
3407
3407
|
editable: !1,
|
|
3408
3408
|
overrides: _.value.usedBy || [],
|
|
@@ -3431,10 +3431,10 @@ function Pa() {
|
|
|
3431
3431
|
createVariant: r
|
|
3432
3432
|
};
|
|
3433
3433
|
}
|
|
3434
|
-
const
|
|
3434
|
+
const Ra = {
|
|
3435
3435
|
key: 0,
|
|
3436
3436
|
class: "flex flex-col space-y-16 h-[440px]"
|
|
3437
|
-
},
|
|
3437
|
+
}, Ua = { class: "flex-1 flex-shrink space-y-8 min-h-0 overflow-y-scroll p-8" }, Ma = { class: "flex justify-between pb-16" }, Aa = { class: "flex gap-8" }, Na = {
|
|
3438
3438
|
key: 1,
|
|
3439
3439
|
class: "flex flex-col items-center space-y-16"
|
|
3440
3440
|
}, La = { class: "flex flex-col items-center space-y-4 w-full" }, Ga = { class: "fm-typo-en-title-sm-600" }, Ka = { class: "text-fm-color-typo-secondary" }, Ba = /* @__PURE__ */ ae({
|
|
@@ -3451,8 +3451,8 @@ const Ua = {
|
|
|
3451
3451
|
e(h.value), t("primary"), r.close();
|
|
3452
3452
|
};
|
|
3453
3453
|
return (f, a) => {
|
|
3454
|
-
const I = W("FmSearch"),
|
|
3455
|
-
return d.value.length > 0 ? ($(), J("div",
|
|
3454
|
+
const I = W("FmSearch"), F = W("FmCheckbox"), O = W("FmButton");
|
|
3455
|
+
return d.value.length > 0 ? ($(), J("div", Ra, [
|
|
3456
3456
|
A("div", null, [
|
|
3457
3457
|
C(I, {
|
|
3458
3458
|
autofocus: "",
|
|
@@ -3461,12 +3461,12 @@ const Ua = {
|
|
|
3461
3461
|
placeholder: o(s)("menu.common.labels.search_variants")
|
|
3462
3462
|
}, null, 8, ["modelValue", "placeholder"])
|
|
3463
3463
|
]),
|
|
3464
|
-
A("div",
|
|
3464
|
+
A("div", Ua, [
|
|
3465
3465
|
A("div", null, [
|
|
3466
3466
|
($(!0), J(Oe, null, Ne(d.value, (k) => ($(), J("div", {
|
|
3467
3467
|
key: k.value
|
|
3468
3468
|
}, [
|
|
3469
|
-
ft(C(
|
|
3469
|
+
ft(C(F, {
|
|
3470
3470
|
modelValue: h.value,
|
|
3471
3471
|
"onUpdate:modelValue": [
|
|
3472
3472
|
a[1] || (a[1] = (p) => h.value = p),
|
|
@@ -3538,7 +3538,7 @@ const Ua = {
|
|
|
3538
3538
|
setup(n, {
|
|
3539
3539
|
emit: r
|
|
3540
3540
|
}) {
|
|
3541
|
-
const e = n, t = se(), m = Zn(), s =
|
|
3541
|
+
const e = n, t = se(), m = Zn(), s = Ue(), g = Ge(), {
|
|
3542
3542
|
t: d
|
|
3543
3543
|
} = ce(), h = D(() => t.rules.item), w = D(() => h.value.minPrice && !!e.form.minPrice), _ = D(() => !t.state.currentCatalogId), b = D(() => t.variants.reduce((u, l) => (u[l._id] = l, u), {}));
|
|
3544
3544
|
q(!1);
|
|
@@ -3571,7 +3571,7 @@ const Ua = {
|
|
|
3571
3571
|
})))
|
|
3572
3572
|
};
|
|
3573
3573
|
}
|
|
3574
|
-
function
|
|
3574
|
+
function F() {
|
|
3575
3575
|
var u;
|
|
3576
3576
|
g.open({
|
|
3577
3577
|
title: "Add variant",
|
|
@@ -3657,7 +3657,7 @@ const Ua = {
|
|
|
3657
3657
|
}
|
|
3658
3658
|
f("replace:form", m.initDynamicGroupItem(v));
|
|
3659
3659
|
}
|
|
3660
|
-
async function
|
|
3660
|
+
async function R(u, l, i) {
|
|
3661
3661
|
const v = ke.clone(e.form);
|
|
3662
3662
|
v.variant.variantCombinations[u][l] = i, a([{
|
|
3663
3663
|
key: "variant",
|
|
@@ -3667,7 +3667,7 @@ const Ua = {
|
|
|
3667
3667
|
const M = D(() => {
|
|
3668
3668
|
var u, l;
|
|
3669
3669
|
return ((u = t.currentCatalog) == null ? void 0 : u.priceTierRules) ?? ((l = t.currentCatalog) == null ? void 0 : l.usePriceTiers) ?? [];
|
|
3670
|
-
}),
|
|
3670
|
+
}), S = D(() => [{
|
|
3671
3671
|
accessorKey: "combinationKey",
|
|
3672
3672
|
header: () => d("menu.product.form.variant.columns.variant"),
|
|
3673
3673
|
enableSorting: !1,
|
|
@@ -3683,7 +3683,7 @@ const Ua = {
|
|
|
3683
3683
|
modelValue: l,
|
|
3684
3684
|
placeholder: x || d("menu.product.form.variant.placeholders.no_code"),
|
|
3685
3685
|
"onUpdate:modelValue": (j) => {
|
|
3686
|
-
|
|
3686
|
+
R(u.row.index, "code", Qt(j, !0));
|
|
3687
3687
|
}
|
|
3688
3688
|
});
|
|
3689
3689
|
}
|
|
@@ -3701,7 +3701,7 @@ const Ua = {
|
|
|
3701
3701
|
required: h.value.orderFrom && h.value.orderFromActiveOnly,
|
|
3702
3702
|
editActiveOnly: h.value.orderFromActiveOnly || !1,
|
|
3703
3703
|
"onUpdate:modelValue": (P) => {
|
|
3704
|
-
|
|
3704
|
+
R(u.row.index, "orderFrom", P);
|
|
3705
3705
|
},
|
|
3706
3706
|
label: "",
|
|
3707
3707
|
defaultLabel: "Follow general"
|
|
@@ -3715,7 +3715,7 @@ const Ua = {
|
|
|
3715
3715
|
var y, P, j;
|
|
3716
3716
|
const l = u.getValue(), i = u.row.original, x = ((y = i.fallback) == null ? void 0 : y.price) ?? e.form.price ?? ((P = e.fallback) == null ? void 0 : P.price);
|
|
3717
3717
|
return C("div", {
|
|
3718
|
-
id: pt(
|
|
3718
|
+
id: pt(Fe.VARIANT, i.combinationKey ?? ""),
|
|
3719
3719
|
class: "flex items-center gap-8"
|
|
3720
3720
|
}, [C(Xe, {
|
|
3721
3721
|
disable: M.value.length > 0 && t.currentCatalog && !t.currentScheduler,
|
|
@@ -3723,7 +3723,7 @@ const Ua = {
|
|
|
3723
3723
|
modelValue: l,
|
|
3724
3724
|
min: 0,
|
|
3725
3725
|
"onUpdate:model-value": (Q) => {
|
|
3726
|
-
|
|
3726
|
+
R(u.row.index, "price", Q);
|
|
3727
3727
|
},
|
|
3728
3728
|
nullable: !0,
|
|
3729
3729
|
showCurrency: !1
|
|
@@ -3731,7 +3731,7 @@ const Ua = {
|
|
|
3731
3731
|
"menu-store": t,
|
|
3732
3732
|
"price-tiers": i.priceTiers,
|
|
3733
3733
|
fallback: (j = i.fallback) == null ? void 0 : j.priceTiers,
|
|
3734
|
-
"onUpdate:price-tiers": (Q) =>
|
|
3734
|
+
"onUpdate:price-tiers": (Q) => R(u.row.index, "priceTiers", Q)
|
|
3735
3735
|
}, null)]);
|
|
3736
3736
|
}
|
|
3737
3737
|
}, {
|
|
@@ -3746,13 +3746,13 @@ const Ua = {
|
|
|
3746
3746
|
modelValue: l,
|
|
3747
3747
|
max: be.Dinero.fromFdoDinero(i.price ?? ((j = i.fallback) == null ? void 0 : j.price) ?? be.Dinero.zero().toObject()).toUnit(),
|
|
3748
3748
|
"onUpdate:modelValue": (Q) => {
|
|
3749
|
-
|
|
3749
|
+
R(u.row.index, "minPrice", Q);
|
|
3750
3750
|
},
|
|
3751
3751
|
nullable: !0,
|
|
3752
3752
|
showCurrency: !1
|
|
3753
3753
|
});
|
|
3754
3754
|
}
|
|
3755
|
-
}]),
|
|
3755
|
+
}]), U = D(() => ({
|
|
3756
3756
|
minPrice: w.value
|
|
3757
3757
|
}));
|
|
3758
3758
|
function E(u) {
|
|
@@ -3763,7 +3763,7 @@ const Ua = {
|
|
|
3763
3763
|
return (u, l) => {
|
|
3764
3764
|
const i = W("fm-button"), v = W("fm-icon"), x = W("FmFormGroup"), y = W("fm-table");
|
|
3765
3765
|
return $(), H(De, {
|
|
3766
|
-
id: o(
|
|
3766
|
+
id: o(Fe).VARIANT,
|
|
3767
3767
|
title: o(d)("menu.product.form.variant.title"),
|
|
3768
3768
|
"sub-title": o(d)("menu.product.form.variant.subtitle")
|
|
3769
3769
|
}, {
|
|
@@ -3772,7 +3772,7 @@ const Ua = {
|
|
|
3772
3772
|
label: o(d)("menu.product.form.variant.add"),
|
|
3773
3773
|
variant: "secondary",
|
|
3774
3774
|
"prepend-icon": "add",
|
|
3775
|
-
onClick:
|
|
3775
|
+
onClick: F
|
|
3776
3776
|
}, null, 8, ["label"])) : X("", !0)]),
|
|
3777
3777
|
default: B(() => {
|
|
3778
3778
|
var P;
|
|
@@ -3815,8 +3815,8 @@ const Ua = {
|
|
|
3815
3815
|
default: B(() => [p.value.length ? ($(), H(y, {
|
|
3816
3816
|
key: 0,
|
|
3817
3817
|
class: "w-full",
|
|
3818
|
-
"column-defs":
|
|
3819
|
-
"column-visibility":
|
|
3818
|
+
"column-defs": S.value,
|
|
3819
|
+
"column-visibility": U.value,
|
|
3820
3820
|
"page-size": p.value.length ?? 0,
|
|
3821
3821
|
"row-data": p.value ?? [],
|
|
3822
3822
|
"hide-footer": "",
|
|
@@ -3861,7 +3861,7 @@ const Ua = {
|
|
|
3861
3861
|
},
|
|
3862
3862
|
emits: ["update:editingState"],
|
|
3863
3863
|
setup(n, { expose: r, emit: e }) {
|
|
3864
|
-
var
|
|
3864
|
+
var ne, ee, pe, Ee, Ve;
|
|
3865
3865
|
const t = n, m = e, s = rt(), g = se(), { t: d } = ce();
|
|
3866
3866
|
D(() => {
|
|
3867
3867
|
var K;
|
|
@@ -3895,7 +3895,7 @@ const Ua = {
|
|
|
3895
3895
|
var K;
|
|
3896
3896
|
return $t(t.menu.modules.variant, (K = a.value.variant) == null ? void 0 : K.variantGroupIds);
|
|
3897
3897
|
}
|
|
3898
|
-
),
|
|
3898
|
+
), F = (K, Y) => {
|
|
3899
3899
|
var re;
|
|
3900
3900
|
ke.isEqual(((re = a.value) == null ? void 0 : re[K]) || {}, Y) || (a.value = {
|
|
3901
3901
|
...me(a.value),
|
|
@@ -3918,10 +3918,10 @@ const Ua = {
|
|
|
3918
3918
|
), T = D(() => {
|
|
3919
3919
|
var K;
|
|
3920
3920
|
return p.value ? a.value.category == "" || a.value.category == null && ((K = f.value) == null ? void 0 : K.category) == null : Cn(t.menu) && a.value.category == null;
|
|
3921
|
-
}),
|
|
3921
|
+
}), R = D(() => s.itemAttributeSettings.value.length > 0 && !p.value), M = q(
|
|
3922
3922
|
a.value.category != null || !!a.value.code || !!a.value.orderFrom
|
|
3923
3923
|
);
|
|
3924
|
-
function
|
|
3924
|
+
function S(K) {
|
|
3925
3925
|
K || (a.value = {
|
|
3926
3926
|
...a.value,
|
|
3927
3927
|
name: void 0,
|
|
@@ -3930,7 +3930,7 @@ const Ua = {
|
|
|
3930
3930
|
orderFrom: void 0
|
|
3931
3931
|
}, c());
|
|
3932
3932
|
}
|
|
3933
|
-
const
|
|
3933
|
+
const U = D(() => {
|
|
3934
3934
|
const K = {};
|
|
3935
3935
|
return t.menu.modules.item.forEach((Y) => {
|
|
3936
3936
|
var re;
|
|
@@ -3947,7 +3947,7 @@ const Ua = {
|
|
|
3947
3947
|
}, c());
|
|
3948
3948
|
}
|
|
3949
3949
|
const l = q(
|
|
3950
|
-
(((
|
|
3950
|
+
(((ne = a.value.variant) == null ? void 0 : ne.variantCombinations) || []).some(
|
|
3951
3951
|
(K) => !!K.price || !!K.orderFrom || !!K.code
|
|
3952
3952
|
)
|
|
3953
3953
|
);
|
|
@@ -3967,7 +3967,7 @@ const Ua = {
|
|
|
3967
3967
|
}, c());
|
|
3968
3968
|
}
|
|
3969
3969
|
const v = q(
|
|
3970
|
-
!!a.value.inventoryBindings || (((
|
|
3970
|
+
!!a.value.inventoryBindings || (((ee = a.value.variant) == null ? void 0 : ee.variantCombinations) || []).some((K) => !!K.inventoryBindings) || !1
|
|
3971
3971
|
);
|
|
3972
3972
|
function x(K) {
|
|
3973
3973
|
var Y, re, ue;
|
|
@@ -4066,11 +4066,11 @@ const Ua = {
|
|
|
4066
4066
|
function N() {
|
|
4067
4067
|
return !ke.isEqual(a.value, t.initialForm);
|
|
4068
4068
|
}
|
|
4069
|
-
function
|
|
4069
|
+
function G() {
|
|
4070
4070
|
var K;
|
|
4071
4071
|
return (K = V.value) == null ? void 0 : K.validateInputsWithoutSubmit();
|
|
4072
4072
|
}
|
|
4073
|
-
function
|
|
4073
|
+
function L() {
|
|
4074
4074
|
return a.value;
|
|
4075
4075
|
}
|
|
4076
4076
|
async function z(K, Y = !1) {
|
|
@@ -4086,18 +4086,18 @@ const Ua = {
|
|
|
4086
4086
|
console.warn(`Element with id ${K} not found`);
|
|
4087
4087
|
}
|
|
4088
4088
|
function oe(K) {
|
|
4089
|
-
K.type === "general" ? z(
|
|
4089
|
+
K.type === "general" ? z(Fe.GENERAL) : K.type === "price" ? z(Fe.PRICE, !0) : K.type === "variant" ? z(pt(Fe.VARIANT, K.id), !0) : K.type === "group" && z(pt(Fe.GROUP, K.id), !0);
|
|
4090
4090
|
}
|
|
4091
4091
|
return On(() => {
|
|
4092
4092
|
t.focused && oe(t.focused);
|
|
4093
4093
|
}), r({
|
|
4094
|
-
validate:
|
|
4095
|
-
getData:
|
|
4094
|
+
validate: G,
|
|
4095
|
+
getData: L,
|
|
4096
4096
|
hasUnsavedChanges: N
|
|
4097
4097
|
}), (K, Y) => {
|
|
4098
4098
|
const re = W("FmBreadcrumb"), ue = W("FmForm");
|
|
4099
4099
|
return $(), H(ue, {
|
|
4100
|
-
id: o(
|
|
4100
|
+
id: o(Fe).GENERAL,
|
|
4101
4101
|
class: fe(["tree-item-form", ["flex-1 py-24 space-y-24", "xs:w-full"]]),
|
|
4102
4102
|
ref_key: "formWrapper",
|
|
4103
4103
|
ref: V,
|
|
@@ -4116,7 +4116,7 @@ const Ua = {
|
|
|
4116
4116
|
toggle: M.value,
|
|
4117
4117
|
"onUpdate:toggle": [
|
|
4118
4118
|
Y[0] || (Y[0] = (Z) => M.value = Z),
|
|
4119
|
-
Y[1] || (Y[1] = (Z) =>
|
|
4119
|
+
Y[1] || (Y[1] = (Z) => S(Z))
|
|
4120
4120
|
],
|
|
4121
4121
|
disabled: !p.value,
|
|
4122
4122
|
description: o(d)("menu.product.form.sections.general.description"),
|
|
@@ -4131,14 +4131,14 @@ const Ua = {
|
|
|
4131
4131
|
"is-addon": T.value,
|
|
4132
4132
|
"is-override": p.value,
|
|
4133
4133
|
"is-create": !((Z = t.initialForm) != null && Z._id),
|
|
4134
|
-
"onUpdate:form":
|
|
4134
|
+
"onUpdate:form": F
|
|
4135
4135
|
}, null, 8, ["fallback", "form", "is-addon", "is-override", "is-create"])
|
|
4136
4136
|
];
|
|
4137
4137
|
}),
|
|
4138
4138
|
_: 1
|
|
4139
4139
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
4140
4140
|
p.value ? X("", !0) : ($(), J("div", Ha)),
|
|
4141
|
-
|
|
4141
|
+
R.value ? ($(), H(De, {
|
|
4142
4142
|
key: 1,
|
|
4143
4143
|
title: o(d)("menu.product.form.sections.tagging.title"),
|
|
4144
4144
|
"sub-title": o(d)("menu.product.form.sections.tagging.subtitle")
|
|
@@ -4147,13 +4147,13 @@ const Ua = {
|
|
|
4147
4147
|
C(o(sn), {
|
|
4148
4148
|
entity: "item",
|
|
4149
4149
|
"model-value": a.value.customAttributes || {},
|
|
4150
|
-
"onUpdate:modelValue": Y[2] || (Y[2] = (Z) =>
|
|
4151
|
-
"value-options":
|
|
4150
|
+
"onUpdate:modelValue": Y[2] || (Y[2] = (Z) => F("customAttributes", Z)),
|
|
4151
|
+
"value-options": U.value
|
|
4152
4152
|
}, null, 8, ["model-value", "value-options"])
|
|
4153
4153
|
]),
|
|
4154
4154
|
_: 1
|
|
4155
4155
|
}, 8, ["title", "sub-title"])) : X("", !0),
|
|
4156
|
-
|
|
4156
|
+
R.value ? ($(), J("div", Xa)) : X("", !0),
|
|
4157
4157
|
C(Be, {
|
|
4158
4158
|
toggle: E.value,
|
|
4159
4159
|
"onUpdate:toggle": [
|
|
@@ -4170,7 +4170,7 @@ const Ua = {
|
|
|
4170
4170
|
form: a.value,
|
|
4171
4171
|
"is-addon": T.value,
|
|
4172
4172
|
"is-override": p.value,
|
|
4173
|
-
"onUpdate:form":
|
|
4173
|
+
"onUpdate:form": F
|
|
4174
4174
|
}, null, 8, ["fallback", "form", "is-addon", "is-override"])
|
|
4175
4175
|
]),
|
|
4176
4176
|
_: 1
|
|
@@ -4194,7 +4194,7 @@ const Ua = {
|
|
|
4194
4194
|
"full-combinations": I.value,
|
|
4195
4195
|
"is-addon": T.value,
|
|
4196
4196
|
"is-override": p.value,
|
|
4197
|
-
"onUpdate:form":
|
|
4197
|
+
"onUpdate:form": F,
|
|
4198
4198
|
"onReplace:form": Y[5] || (Y[5] = (Z) => O(Z))
|
|
4199
4199
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4200
4200
|
]),
|
|
@@ -4218,7 +4218,7 @@ const Ua = {
|
|
|
4218
4218
|
"full-combinations": I.value,
|
|
4219
4219
|
"is-addon": T.value,
|
|
4220
4220
|
"is-override": p.value,
|
|
4221
|
-
"onUpdate:form":
|
|
4221
|
+
"onUpdate:form": F,
|
|
4222
4222
|
"onReplace:form": Y[8] || (Y[8] = (Z) => O(Z))
|
|
4223
4223
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4224
4224
|
]),
|
|
@@ -4243,7 +4243,7 @@ const Ua = {
|
|
|
4243
4243
|
"full-combinations": I.value,
|
|
4244
4244
|
"is-addon": T.value,
|
|
4245
4245
|
"is-override": p.value,
|
|
4246
|
-
"onUpdate:form":
|
|
4246
|
+
"onUpdate:form": F,
|
|
4247
4247
|
"onReplace:form": Y[11] || (Y[11] = (Z) => O(Z))
|
|
4248
4248
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4249
4249
|
]),
|
|
@@ -4268,7 +4268,7 @@ const Ua = {
|
|
|
4268
4268
|
"full-combinations": I.value,
|
|
4269
4269
|
"is-addon": T.value,
|
|
4270
4270
|
"is-override": p.value,
|
|
4271
|
-
"onUpdate:form":
|
|
4271
|
+
"onUpdate:form": F,
|
|
4272
4272
|
"onReplace:form": Y[14] || (Y[14] = (Z) => O(Z))
|
|
4273
4273
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4274
4274
|
]),
|
|
@@ -4293,7 +4293,7 @@ const Ua = {
|
|
|
4293
4293
|
"full-combinations": I.value,
|
|
4294
4294
|
"is-addon": T.value,
|
|
4295
4295
|
"is-override": p.value,
|
|
4296
|
-
"onUpdate:form":
|
|
4296
|
+
"onUpdate:form": F,
|
|
4297
4297
|
"onReplace:form": Y[17] || (Y[17] = (Z) => O(Z))
|
|
4298
4298
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4299
4299
|
]),
|
|
@@ -4388,7 +4388,7 @@ function pl(n, r, e) {
|
|
|
4388
4388
|
return Object.assign(s, e), m;
|
|
4389
4389
|
}
|
|
4390
4390
|
function kn() {
|
|
4391
|
-
const n = se(), r =
|
|
4391
|
+
const n = se(), r = Ue();
|
|
4392
4392
|
async function e(d, h = "New product") {
|
|
4393
4393
|
const w = {
|
|
4394
4394
|
...Le.generator.initMenuV4Item(),
|
|
@@ -4422,11 +4422,11 @@ function kn() {
|
|
|
4422
4422
|
async function s(d, h, w, _) {
|
|
4423
4423
|
let b = mt(h);
|
|
4424
4424
|
const f = /* @__PURE__ */ new Map(), a = mt(n.state.menu);
|
|
4425
|
-
for (const
|
|
4426
|
-
f.set(
|
|
4427
|
-
d.forEach((
|
|
4428
|
-
if (
|
|
4429
|
-
const k = f.get(
|
|
4425
|
+
for (const F of a.modules.item)
|
|
4426
|
+
f.set(F._id, F);
|
|
4427
|
+
d.forEach((F, O) => {
|
|
4428
|
+
if (F.type === "item") {
|
|
4429
|
+
const k = f.get(F.id);
|
|
4430
4430
|
if (k) {
|
|
4431
4431
|
let p = null;
|
|
4432
4432
|
_ && _._id !== h._id && (p = so(
|
|
@@ -4441,14 +4441,14 @@ function kn() {
|
|
|
4441
4441
|
);
|
|
4442
4442
|
Object.assign(k, T);
|
|
4443
4443
|
}
|
|
4444
|
-
} else if (
|
|
4445
|
-
b = pl(b, [...w,
|
|
4444
|
+
} else if (F.type === "subCategory")
|
|
4445
|
+
b = pl(b, [...w, F.id], {
|
|
4446
4446
|
position: O
|
|
4447
4447
|
});
|
|
4448
4448
|
else
|
|
4449
4449
|
throw new Error("Invalid item type");
|
|
4450
4450
|
});
|
|
4451
|
-
const I = a.modules.category.find((
|
|
4451
|
+
const I = a.modules.category.find((F) => F._id === (h == null ? void 0 : h._id) || null);
|
|
4452
4452
|
I && (I.subCategoryMeta = b.subCategoryMeta), n.setMenu(a);
|
|
4453
4453
|
}
|
|
4454
4454
|
async function g(d, h) {
|
|
@@ -4478,50 +4478,50 @@ function fl() {
|
|
|
4478
4478
|
return ((I = m.value[a]) == null ? void 0 : I.name) || a;
|
|
4479
4479
|
}
|
|
4480
4480
|
function g(a) {
|
|
4481
|
-
function I(
|
|
4482
|
-
if (
|
|
4483
|
-
for (const O of
|
|
4484
|
-
O.parent =
|
|
4481
|
+
function I(F) {
|
|
4482
|
+
if (F.children && F.children.length > 0)
|
|
4483
|
+
for (const O of F.children)
|
|
4484
|
+
O.parent = F, I(O);
|
|
4485
4485
|
}
|
|
4486
|
-
for (const
|
|
4487
|
-
I(
|
|
4486
|
+
for (const F of a)
|
|
4487
|
+
I(F);
|
|
4488
4488
|
return a;
|
|
4489
4489
|
}
|
|
4490
4490
|
function d(a) {
|
|
4491
4491
|
return a.map((I) => {
|
|
4492
4492
|
var O, k, p;
|
|
4493
|
-
const
|
|
4493
|
+
const F = {
|
|
4494
4494
|
...I,
|
|
4495
4495
|
children: []
|
|
4496
4496
|
};
|
|
4497
4497
|
for (const T of I.children ?? []) {
|
|
4498
4498
|
if (((O = T.meta) == null ? void 0 : O.nodeType) !== "item")
|
|
4499
4499
|
continue;
|
|
4500
|
-
const
|
|
4501
|
-
if (!(
|
|
4502
|
-
(p =
|
|
4500
|
+
const R = ut.get((k = T.meta) == null ? void 0 : k.rawId);
|
|
4501
|
+
if (!(R != null && R.subCategories) || !R.subCategories.length)
|
|
4502
|
+
(p = F.children) == null || p.push(T);
|
|
4503
4503
|
else {
|
|
4504
|
-
let M =
|
|
4505
|
-
for (const
|
|
4506
|
-
|
|
4504
|
+
let M = F.children, S = "";
|
|
4505
|
+
for (const U of R.subCategories || []) {
|
|
4506
|
+
S += U;
|
|
4507
4507
|
const E = M.find(
|
|
4508
4508
|
(u) => {
|
|
4509
4509
|
var l, i;
|
|
4510
|
-
return ((l = u.meta) == null ? void 0 : l.nodeType) === "subCategory" && ((i = u.meta) == null ? void 0 : i.rawId) ===
|
|
4510
|
+
return ((l = u.meta) == null ? void 0 : l.nodeType) === "subCategory" && ((i = u.meta) == null ? void 0 : i.rawId) === U;
|
|
4511
4511
|
}
|
|
4512
4512
|
);
|
|
4513
4513
|
if (E)
|
|
4514
4514
|
E.children = E.children || [], M = E.children;
|
|
4515
4515
|
else {
|
|
4516
4516
|
const u = {
|
|
4517
|
-
id: `category-${I.label}-sub-category-${
|
|
4518
|
-
label: s(
|
|
4517
|
+
id: `category-${I.label}-sub-category-${S}`,
|
|
4518
|
+
label: s(U),
|
|
4519
4519
|
icon: $e.CATEGORY,
|
|
4520
4520
|
children: [],
|
|
4521
4521
|
draggable: !0,
|
|
4522
4522
|
meta: {
|
|
4523
4523
|
nodeType: "subCategory",
|
|
4524
|
-
rawId:
|
|
4524
|
+
rawId: U
|
|
4525
4525
|
}
|
|
4526
4526
|
};
|
|
4527
4527
|
M.push(u), M = u.children;
|
|
@@ -4530,7 +4530,7 @@ function fl() {
|
|
|
4530
4530
|
M.push(T);
|
|
4531
4531
|
}
|
|
4532
4532
|
}
|
|
4533
|
-
return
|
|
4533
|
+
return F;
|
|
4534
4534
|
});
|
|
4535
4535
|
}
|
|
4536
4536
|
function h(a) {
|
|
@@ -4540,10 +4540,10 @@ function fl() {
|
|
|
4540
4540
|
return 0;
|
|
4541
4541
|
}
|
|
4542
4542
|
function w(a) {
|
|
4543
|
-
var
|
|
4543
|
+
var F;
|
|
4544
4544
|
let I = a;
|
|
4545
4545
|
for (; I; ) {
|
|
4546
|
-
if (((
|
|
4546
|
+
if (((F = I.meta) == null ? void 0 : F.nodeType) === "category")
|
|
4547
4547
|
return I;
|
|
4548
4548
|
I = I.parent;
|
|
4549
4549
|
}
|
|
@@ -4553,16 +4553,16 @@ function fl() {
|
|
|
4553
4553
|
var O, k, p, T;
|
|
4554
4554
|
if (!a.children)
|
|
4555
4555
|
return a;
|
|
4556
|
-
const I = ((k = (O = w(a)) == null ? void 0 : O.meta) == null ? void 0 : k.rawId) ?? null,
|
|
4556
|
+
const I = ((k = (O = w(a)) == null ? void 0 : O.meta) == null ? void 0 : k.rawId) ?? null, F = co(I);
|
|
4557
4557
|
return ((p = a.meta) == null ? void 0 : p.nodeType) === "category" || ((T = a.meta) == null ? void 0 : T.nodeType) === "subCategory" ? (a.children = bt(
|
|
4558
4558
|
a.children,
|
|
4559
|
-
(
|
|
4560
|
-
(
|
|
4561
|
-
var M,
|
|
4562
|
-
if (((M =
|
|
4563
|
-
return h(
|
|
4564
|
-
if (((
|
|
4565
|
-
return
|
|
4559
|
+
(R) => R.label,
|
|
4560
|
+
(R) => {
|
|
4561
|
+
var M, S;
|
|
4562
|
+
if (((M = R.meta) == null ? void 0 : M.nodeType) === "subCategory")
|
|
4563
|
+
return h(R);
|
|
4564
|
+
if (((S = R.meta) == null ? void 0 : S.nodeType) === "item")
|
|
4565
|
+
return F(R.meta.rawObject);
|
|
4566
4566
|
throw new Error("Should not have other node type in category");
|
|
4567
4567
|
}
|
|
4568
4568
|
), { ...a, children: a.children.map(_) }) : a;
|
|
@@ -4572,13 +4572,13 @@ function fl() {
|
|
|
4572
4572
|
}
|
|
4573
4573
|
async function f({ eventEmitter: a }) {
|
|
4574
4574
|
var Q, le, Ce, he;
|
|
4575
|
-
const I = r.state.menu,
|
|
4575
|
+
const I = r.state.menu, F = !r.state.currentCatalogId, O = !r.state.currentSchedulerId, k = (((le = (Q = r.currentCatalog) == null ? void 0 : Q.linkItemRules) == null ? void 0 : le.length) ?? 0) > 0, p = yo(), T = r.mergedMenu;
|
|
4576
4576
|
ut.clear(), dt.clear();
|
|
4577
4577
|
for (const c of I.modules.item)
|
|
4578
4578
|
ut.set(c._id, c);
|
|
4579
4579
|
for (const c of T.modules.group)
|
|
4580
4580
|
dt.set(c._id, c);
|
|
4581
|
-
function
|
|
4581
|
+
function R(c, V) {
|
|
4582
4582
|
return {
|
|
4583
4583
|
id: `add-item-${c}`,
|
|
4584
4584
|
icon: "add",
|
|
@@ -4590,27 +4590,27 @@ function fl() {
|
|
|
4590
4590
|
};
|
|
4591
4591
|
}
|
|
4592
4592
|
function M(c, V, N) {
|
|
4593
|
-
var
|
|
4594
|
-
const
|
|
4593
|
+
var L;
|
|
4594
|
+
const G = T.modules.group.find(
|
|
4595
4595
|
(z) => z._id === N._id
|
|
4596
4596
|
);
|
|
4597
|
-
if (!
|
|
4597
|
+
if (!G)
|
|
4598
4598
|
throw new Error(`Item ${c._id} has unknown group ${N._id}`);
|
|
4599
|
-
return (
|
|
4599
|
+
return (L = G.items) == null ? void 0 : L.map((z, oe) => {
|
|
4600
4600
|
var Te, Z;
|
|
4601
|
-
const
|
|
4601
|
+
const ne = !!z.combinationKey, ee = (Te = N.items) == null ? void 0 : Te.find(
|
|
4602
4602
|
(de) => de._id === z._id && de.combinationKey === z.combinationKey
|
|
4603
4603
|
), pe = (Z = N.items) == null ? void 0 : Z.find(
|
|
4604
4604
|
(de) => de._id === z._id && !de.combinationKey
|
|
4605
4605
|
);
|
|
4606
4606
|
function Ee() {
|
|
4607
4607
|
var de;
|
|
4608
|
-
if (
|
|
4608
|
+
if (ne && (ee != null && ee.price))
|
|
4609
4609
|
return {
|
|
4610
|
-
price:
|
|
4610
|
+
price: ee.price,
|
|
4611
4611
|
overrided: !0
|
|
4612
4612
|
};
|
|
4613
|
-
if (!
|
|
4613
|
+
if (!ne && (pe != null && pe.price))
|
|
4614
4614
|
return {
|
|
4615
4615
|
price: pe.price,
|
|
4616
4616
|
overrided: !0
|
|
@@ -4618,7 +4618,7 @@ function fl() {
|
|
|
4618
4618
|
if (z.price)
|
|
4619
4619
|
return { price: z.price, overrided: !1 };
|
|
4620
4620
|
if (!z.price) {
|
|
4621
|
-
const xe = (de =
|
|
4621
|
+
const xe = (de = G == null ? void 0 : G.items) == null ? void 0 : de.find(
|
|
4622
4622
|
(Ke) => Ke._id === z._id && !Ke.combinationKey
|
|
4623
4623
|
);
|
|
4624
4624
|
if (xe != null && xe.price)
|
|
@@ -4632,7 +4632,7 @@ function fl() {
|
|
|
4632
4632
|
return z.code;
|
|
4633
4633
|
const de = ut.get(z._id);
|
|
4634
4634
|
if (de)
|
|
4635
|
-
return
|
|
4635
|
+
return ne ? (Ke = (xe = de.variant) == null ? void 0 : xe.variantCombinations.find(
|
|
4636
4636
|
(Tn) => Tn.combinationKey === z.combinationKey
|
|
4637
4637
|
)) == null ? void 0 : Ke.code : de.code;
|
|
4638
4638
|
}
|
|
@@ -4643,7 +4643,7 @@ function fl() {
|
|
|
4643
4643
|
return de ? de.name : n("menu.tree_editor.labels.unknown");
|
|
4644
4644
|
}
|
|
4645
4645
|
function Y() {
|
|
4646
|
-
const de = (
|
|
4646
|
+
const de = (ee == null ? void 0 : ee.orderFrom) || z.orderFrom;
|
|
4647
4647
|
return de ? yt(de) : null;
|
|
4648
4648
|
}
|
|
4649
4649
|
const { price: re, overrided: ue } = Ee(), ie = {
|
|
@@ -4659,88 +4659,88 @@ function fl() {
|
|
|
4659
4659
|
};
|
|
4660
4660
|
});
|
|
4661
4661
|
}
|
|
4662
|
-
function
|
|
4663
|
-
const N = (
|
|
4664
|
-
function
|
|
4665
|
-
var
|
|
4666
|
-
const
|
|
4662
|
+
function S(c, V) {
|
|
4663
|
+
const N = (ne) => V ? `item-${c._id}-variant-${V.combinationKey}-group-${ne}` : `item-${c._id}-group-${ne}`, G = [];
|
|
4664
|
+
function L() {
|
|
4665
|
+
var ee;
|
|
4666
|
+
const ne = [];
|
|
4667
4667
|
if (V)
|
|
4668
4668
|
for (const pe of c.groups || []) {
|
|
4669
|
-
const Ee = (
|
|
4670
|
-
Ee ?
|
|
4669
|
+
const Ee = (ee = V.groups) == null ? void 0 : ee.find((Ve) => Ve._id === pe._id);
|
|
4670
|
+
Ee ? ne.push(Ee) : ne.push(pe);
|
|
4671
4671
|
}
|
|
4672
4672
|
else
|
|
4673
|
-
|
|
4674
|
-
return
|
|
4673
|
+
ne.push(...c.groups || []);
|
|
4674
|
+
return ne;
|
|
4675
4675
|
}
|
|
4676
|
-
const z =
|
|
4677
|
-
z.map((
|
|
4678
|
-
const
|
|
4679
|
-
return { ...
|
|
4676
|
+
const z = L(), oe = bt(
|
|
4677
|
+
z.map((ne) => {
|
|
4678
|
+
const ee = dt.get(ne._id);
|
|
4679
|
+
return { ...ne, position: ee == null ? void 0 : ee.position, name: (ee == null ? void 0 : ee.name) || "" };
|
|
4680
4680
|
}),
|
|
4681
|
-
(
|
|
4681
|
+
(ne) => ne.name
|
|
4682
4682
|
);
|
|
4683
4683
|
if (oe)
|
|
4684
|
-
for (const
|
|
4685
|
-
const
|
|
4686
|
-
if (!
|
|
4687
|
-
throw new Error(`Item ${c._id} has unknown group ${
|
|
4688
|
-
|
|
4689
|
-
id: N(
|
|
4684
|
+
for (const ne of oe) {
|
|
4685
|
+
const ee = dt.get(ne._id);
|
|
4686
|
+
if (!ee)
|
|
4687
|
+
throw new Error(`Item ${c._id} has unknown group ${ne._id}`);
|
|
4688
|
+
G.push({
|
|
4689
|
+
id: N(ee._id),
|
|
4690
4690
|
icon: $e.GROUP,
|
|
4691
|
-
label:
|
|
4692
|
-
children: M(c, V,
|
|
4691
|
+
label: ee.name,
|
|
4692
|
+
children: M(c, V, ne),
|
|
4693
4693
|
onClick: () => {
|
|
4694
4694
|
a({
|
|
4695
4695
|
type: we.SELECT_GROUP,
|
|
4696
4696
|
itemId: c._id,
|
|
4697
|
-
groupId:
|
|
4697
|
+
groupId: ne._id
|
|
4698
4698
|
});
|
|
4699
4699
|
}
|
|
4700
4700
|
});
|
|
4701
4701
|
}
|
|
4702
|
-
return
|
|
4702
|
+
return G;
|
|
4703
4703
|
}
|
|
4704
|
-
function
|
|
4705
|
-
return
|
|
4704
|
+
function U(c, V) {
|
|
4705
|
+
return S(c, V);
|
|
4706
4706
|
}
|
|
4707
4707
|
function E(c) {
|
|
4708
|
-
var
|
|
4709
|
-
const V = [], N = c.groups && c.groups.length > 0,
|
|
4710
|
-
if (N && !
|
|
4711
|
-
const z =
|
|
4708
|
+
var L;
|
|
4709
|
+
const V = [], N = c.groups && c.groups.length > 0, G = ((L = c.variant) == null ? void 0 : L.variantGroupIds) && c.variant.variantGroupIds.length > 0;
|
|
4710
|
+
if (N && !G) {
|
|
4711
|
+
const z = S(c);
|
|
4712
4712
|
V.push(...z);
|
|
4713
4713
|
}
|
|
4714
|
-
if (
|
|
4715
|
-
const z = (
|
|
4714
|
+
if (G) {
|
|
4715
|
+
const z = (ee, pe) => `item-${ee}-variant-${pe}`, oe = $t(
|
|
4716
4716
|
I.modules.variant,
|
|
4717
4717
|
c.variant.variantGroupIds
|
|
4718
|
-
),
|
|
4719
|
-
(
|
|
4718
|
+
), ne = c.variant.variantCombinations.map(
|
|
4719
|
+
(ee) => {
|
|
4720
4720
|
const pe = yt(
|
|
4721
|
-
|
|
4721
|
+
ee.orderFrom || c.orderFrom
|
|
4722
4722
|
), Ee = ht([], pe);
|
|
4723
4723
|
return {
|
|
4724
|
-
id: z(c._id,
|
|
4724
|
+
id: z(c._id, ee.combinationKey),
|
|
4725
4725
|
icon: $e.VARIANT,
|
|
4726
4726
|
label: Yt(
|
|
4727
|
-
rr(oe,
|
|
4728
|
-
|
|
4727
|
+
rr(oe, ee.combinationKey),
|
|
4728
|
+
ee.code
|
|
4729
4729
|
),
|
|
4730
|
-
children:
|
|
4731
|
-
rightLabel: Jo(c,
|
|
4730
|
+
children: U(c, ee),
|
|
4731
|
+
rightLabel: Jo(c, ee),
|
|
4732
4732
|
chips: Ee,
|
|
4733
4733
|
onClick: () => {
|
|
4734
4734
|
a({
|
|
4735
4735
|
type: we.SELECT_VARIANT,
|
|
4736
4736
|
itemId: c._id,
|
|
4737
|
-
combinationKey:
|
|
4737
|
+
combinationKey: ee.combinationKey
|
|
4738
4738
|
});
|
|
4739
4739
|
}
|
|
4740
4740
|
};
|
|
4741
4741
|
}
|
|
4742
4742
|
);
|
|
4743
|
-
V.push(...
|
|
4743
|
+
V.push(...ne);
|
|
4744
4744
|
}
|
|
4745
4745
|
return V;
|
|
4746
4746
|
}
|
|
@@ -4749,7 +4749,7 @@ function fl() {
|
|
|
4749
4749
|
(c) => c.name
|
|
4750
4750
|
).map((c) => {
|
|
4751
4751
|
const V = [];
|
|
4752
|
-
return r.rules.category.create && V.push(
|
|
4752
|
+
return r.rules.category.create && V.push(R(c._id, t)), r.rules.category.edit && V.push({
|
|
4753
4753
|
id: `update-category-${c._id}`,
|
|
4754
4754
|
icon: "edit",
|
|
4755
4755
|
showOnHover: !0,
|
|
@@ -4765,14 +4765,14 @@ function fl() {
|
|
|
4765
4765
|
onClick: () => {
|
|
4766
4766
|
e.deleteCategory(c);
|
|
4767
4767
|
}
|
|
4768
|
-
}), !
|
|
4768
|
+
}), !F && O && !k && V.push({
|
|
4769
4769
|
id: `apply-to-catalog-${c._id}`,
|
|
4770
4770
|
icon: "add_link",
|
|
4771
4771
|
showOnHover: !0,
|
|
4772
4772
|
tooltip: n("menu.tree_editor.actions.link_category_to_catalog"),
|
|
4773
4773
|
onClick: () => {
|
|
4774
|
-
const N = r.state.menu.modules.item.filter((
|
|
4775
|
-
p.addProduct(N.map((
|
|
4774
|
+
const N = r.state.menu.modules.item.filter((G) => Lt(G).some(({ _id: z }) => z === c._id));
|
|
4775
|
+
p.addProduct(N.map((G) => G._id));
|
|
4776
4776
|
}
|
|
4777
4777
|
}), {
|
|
4778
4778
|
id: u(c._id),
|
|
@@ -4807,7 +4807,7 @@ function fl() {
|
|
|
4807
4807
|
rawObject: null
|
|
4808
4808
|
}
|
|
4809
4809
|
};
|
|
4810
|
-
i && (r.rules.category.create && x.actions.push(
|
|
4810
|
+
i && (r.rules.category.create && x.actions.push(R(null, t)), r.currentCatalog && x.actions.push({
|
|
4811
4811
|
id: "apply-to-catalog-addon",
|
|
4812
4812
|
icon: "add_link",
|
|
4813
4813
|
showOnHover: !0,
|
|
@@ -4820,16 +4820,16 @@ function fl() {
|
|
|
4820
4820
|
const y = (c, V) => `item-${V ?? "addon"}-${c}`;
|
|
4821
4821
|
for (const c of T.modules.item)
|
|
4822
4822
|
Lt(c).forEach(({ _id: N }) => {
|
|
4823
|
-
var
|
|
4824
|
-
const
|
|
4825
|
-
if (
|
|
4823
|
+
var L, z, oe, ne, ee, pe, Ee, Ve;
|
|
4824
|
+
const G = N ? l.find((K) => K.id === u(N)) : x;
|
|
4825
|
+
if (G) {
|
|
4826
4826
|
const K = _t(
|
|
4827
|
-
((
|
|
4827
|
+
((L = c.groups) == null ? void 0 : L.length) ?? 0,
|
|
4828
4828
|
n("menu.tree_editor.labels.groups", { count: (z = c.groups) == null ? void 0 : z.length })
|
|
4829
4829
|
), Y = _t(
|
|
4830
|
-
((
|
|
4830
|
+
((ne = (oe = c.variant) == null ? void 0 : oe.variantCombinations) == null ? void 0 : ne.length) ?? 0,
|
|
4831
4831
|
n("menu.tree_editor.labels.variants", {
|
|
4832
|
-
count: (pe = (
|
|
4832
|
+
count: (pe = (ee = c.variant) == null ? void 0 : ee.variantCombinations) == null ? void 0 : pe.length
|
|
4833
4833
|
})
|
|
4834
4834
|
), re = yt(c.orderFrom), ue = ht([], K, Y, re), ie = [];
|
|
4835
4835
|
r.rules.item.delete && ie.push({
|
|
@@ -4844,7 +4844,7 @@ function fl() {
|
|
|
4844
4844
|
const Te = (Ee = r.currentCatalog) == null ? void 0 : Ee.override.items, Z = (Ve = Te == null ? void 0 : Te[c._id]) == null ? void 0 : Ve.find(
|
|
4845
4845
|
(Ke) => !Ke.combinationKey
|
|
4846
4846
|
), de = (Z == null ? void 0 : Z.orderFrom) === te.F_ORDER_FROM.enum.NONE;
|
|
4847
|
-
!
|
|
4847
|
+
!F && O && !k && (de ? ie.push({
|
|
4848
4848
|
id: `apply-to-catalog-${c._id}`,
|
|
4849
4849
|
icon: "add_link",
|
|
4850
4850
|
showOnHover: !0,
|
|
@@ -4862,7 +4862,7 @@ function fl() {
|
|
|
4862
4862
|
}
|
|
4863
4863
|
}));
|
|
4864
4864
|
const xe = c.code ? `${c.code}, ${c.name}` : c.name;
|
|
4865
|
-
|
|
4865
|
+
G.children.push({
|
|
4866
4866
|
id: y(c._id, N),
|
|
4867
4867
|
disabled: de,
|
|
4868
4868
|
draggable: r.rules.item.sort,
|
|
@@ -4915,7 +4915,7 @@ function fl() {
|
|
|
4915
4915
|
};
|
|
4916
4916
|
}
|
|
4917
4917
|
function gl() {
|
|
4918
|
-
const n =
|
|
4918
|
+
const n = Ue(), r = kn(), e = gt(), t = at();
|
|
4919
4919
|
function m(E) {
|
|
4920
4920
|
n.open({
|
|
4921
4921
|
message: E,
|
|
@@ -4988,7 +4988,7 @@ function gl() {
|
|
|
4988
4988
|
}
|
|
4989
4989
|
return null;
|
|
4990
4990
|
}
|
|
4991
|
-
function
|
|
4991
|
+
function F(E, u, l, i, v) {
|
|
4992
4992
|
if (g(u)) {
|
|
4993
4993
|
const x = I(E), y = I(u);
|
|
4994
4994
|
return (x == null ? void 0 : x.id) === (y == null ? void 0 : y.id) ? !0 : !((x == null ? void 0 : x.id) !== (y == null ? void 0 : y.id) && a(y).some(
|
|
@@ -5005,7 +5005,7 @@ function gl() {
|
|
|
5005
5005
|
}
|
|
5006
5006
|
const O = (E, u, l) => {
|
|
5007
5007
|
const i = t.getNodeById(E), v = t.getNodeById(u), x = i == null ? void 0 : i.parent, y = v == null ? void 0 : v.parent;
|
|
5008
|
-
return !i || !v ? !1 : s(i) ? b(i, v) : d(i) ? f(i, v, l, x, y) : g(i) ?
|
|
5008
|
+
return !i || !v ? !1 : s(i) ? b(i, v) : d(i) ? f(i, v, l, x, y) : g(i) ? F(i, v, l, x, y) : !1;
|
|
5009
5009
|
};
|
|
5010
5010
|
async function k(E, u, l) {
|
|
5011
5011
|
if (!b(E, u)) {
|
|
@@ -5048,7 +5048,7 @@ function gl() {
|
|
|
5048
5048
|
const y = wt(v, x, l), P = w(u);
|
|
5049
5049
|
await r.rearrangeWithSubCategory(y, i, P);
|
|
5050
5050
|
}
|
|
5051
|
-
async function
|
|
5051
|
+
async function R(E, u, l, i) {
|
|
5052
5052
|
var j;
|
|
5053
5053
|
const v = _(u);
|
|
5054
5054
|
v.splice(l, 0, {
|
|
@@ -5071,7 +5071,7 @@ function gl() {
|
|
|
5071
5071
|
async function M(E, u, l) {
|
|
5072
5072
|
var i;
|
|
5073
5073
|
try {
|
|
5074
|
-
if (!
|
|
5074
|
+
if (!F(E, u, l, E.parent, u.parent)) {
|
|
5075
5075
|
m("Cannot drop item here");
|
|
5076
5076
|
return;
|
|
5077
5077
|
}
|
|
@@ -5081,7 +5081,7 @@ function gl() {
|
|
|
5081
5081
|
v.parent,
|
|
5082
5082
|
v.index,
|
|
5083
5083
|
x
|
|
5084
|
-
) : await
|
|
5084
|
+
) : await R(
|
|
5085
5085
|
E,
|
|
5086
5086
|
v.parent,
|
|
5087
5087
|
v.index,
|
|
@@ -5091,7 +5091,7 @@ function gl() {
|
|
|
5091
5091
|
m(v.message || "Failed to move item");
|
|
5092
5092
|
}
|
|
5093
5093
|
}
|
|
5094
|
-
async function
|
|
5094
|
+
async function S(E, u, l) {
|
|
5095
5095
|
if (!f(
|
|
5096
5096
|
E,
|
|
5097
5097
|
u,
|
|
@@ -5113,19 +5113,19 @@ function gl() {
|
|
|
5113
5113
|
const P = wt(v, x, y), j = h(i), Q = w(i);
|
|
5114
5114
|
await r.rearrangeWithSubCategory(P, j, Q);
|
|
5115
5115
|
}
|
|
5116
|
-
async function
|
|
5116
|
+
async function U(E) {
|
|
5117
5117
|
const u = t.getNodeById(E.draggedNodeId), l = t.getNodeById(E.targetNodeId);
|
|
5118
|
-
!u || !l || (s(u) ? await k(u, l, E.dragPosition) : g(u) ? await M(u, l, E.dragPosition) : d(u) ? await
|
|
5118
|
+
!u || !l || (s(u) ? await k(u, l, E.dragPosition) : g(u) ? await M(u, l, E.dragPosition) : d(u) ? await S(u, l, E.dragPosition) : m("Unsupported drag operation"));
|
|
5119
5119
|
}
|
|
5120
5120
|
return {
|
|
5121
5121
|
isCategoryNode: s,
|
|
5122
5122
|
isItemNode: g,
|
|
5123
5123
|
isSubCategoryNode: d,
|
|
5124
5124
|
canDropFn: O,
|
|
5125
|
-
handleNodeDragDrop:
|
|
5125
|
+
handleNodeDragDrop: U
|
|
5126
5126
|
};
|
|
5127
5127
|
}
|
|
5128
|
-
const
|
|
5128
|
+
const Ft = /* @__PURE__ */ ae({
|
|
5129
5129
|
__name: "FmTreeIcon",
|
|
5130
5130
|
props: {
|
|
5131
5131
|
name: {},
|
|
@@ -5148,7 +5148,7 @@ const St = /* @__PURE__ */ ae({
|
|
|
5148
5148
|
], 2);
|
|
5149
5149
|
};
|
|
5150
5150
|
}
|
|
5151
|
-
}),
|
|
5151
|
+
}), St = /* @__PURE__ */ ae({
|
|
5152
5152
|
__name: "FmTipTreeIcon",
|
|
5153
5153
|
props: {
|
|
5154
5154
|
name: {},
|
|
@@ -5165,14 +5165,14 @@ const St = /* @__PURE__ */ ae({
|
|
|
5165
5165
|
"z-index": 50
|
|
5166
5166
|
}, {
|
|
5167
5167
|
default: B(() => [
|
|
5168
|
-
C(
|
|
5168
|
+
C(Ft, {
|
|
5169
5169
|
name: r.name,
|
|
5170
5170
|
visible: r.visible,
|
|
5171
5171
|
onClick: r.onClick
|
|
5172
5172
|
}, null, 8, ["name", "visible", "onClick"])
|
|
5173
5173
|
]),
|
|
5174
5174
|
_: 1
|
|
5175
|
-
}, 8, ["content"])) : ($(), H(
|
|
5175
|
+
}, 8, ["content"])) : ($(), H(Ft, {
|
|
5176
5176
|
key: 1,
|
|
5177
5177
|
name: r.name,
|
|
5178
5178
|
visible: r.visible,
|
|
@@ -5185,7 +5185,7 @@ function vl(n) {
|
|
|
5185
5185
|
const { itemHeight: r, emit: e, getFlattenedItems: t, getContainerRef: m, canDropFn: s } = n, g = q(!1), d = q(null), h = q(null), w = q(null), _ = q(0), b = q({ x: 0, y: 0 }), f = q(/* @__PURE__ */ new Map());
|
|
5186
5186
|
function a(k, p) {
|
|
5187
5187
|
p.button === 0 && (b.value = { x: p.clientX, y: p.clientY }, d.value = k, _.value = p.clientY, f.value = nr(t()), setTimeout(() => {
|
|
5188
|
-
d.value === k && (g.value = !0, b.value = { x: p.clientX, y: p.clientY }, e("updateDragState", k, null, null), document.addEventListener("mousemove", I), document.addEventListener("mouseup",
|
|
5188
|
+
d.value === k && (g.value = !0, b.value = { x: p.clientX, y: p.clientY }, e("updateDragState", k, null, null), document.addEventListener("mousemove", I), document.addEventListener("mouseup", F));
|
|
5189
5189
|
}, En));
|
|
5190
5190
|
}
|
|
5191
5191
|
function I(k) {
|
|
@@ -5196,9 +5196,9 @@ function vl(n) {
|
|
|
5196
5196
|
});
|
|
5197
5197
|
const p = m();
|
|
5198
5198
|
if (!p) return;
|
|
5199
|
-
const T = p.getBoundingClientRect(),
|
|
5200
|
-
if (M >= 0 && M <
|
|
5201
|
-
const l =
|
|
5199
|
+
const T = p.getBoundingClientRect(), R = k.clientY - T.top + p.scrollTop, M = Math.floor(R / r), S = t();
|
|
5200
|
+
if (M >= 0 && M < S.length) {
|
|
5201
|
+
const l = S[M].id;
|
|
5202
5202
|
if (l === d.value) {
|
|
5203
5203
|
h.value = null, w.value = null, e("updateDragState", d.value, null, null);
|
|
5204
5204
|
return;
|
|
@@ -5215,18 +5215,18 @@ function vl(n) {
|
|
|
5215
5215
|
}
|
|
5216
5216
|
e("updateDragState", d.value, h.value, w.value);
|
|
5217
5217
|
}
|
|
5218
|
-
const
|
|
5219
|
-
k.clientY - T.top <
|
|
5218
|
+
const U = 50;
|
|
5219
|
+
k.clientY - T.top < U ? p.scrollTop -= 10 : T.bottom - k.clientY < U && (p.scrollTop += 10);
|
|
5220
5220
|
}
|
|
5221
|
-
function
|
|
5222
|
-
document.removeEventListener("mousemove", I), document.removeEventListener("mouseup",
|
|
5221
|
+
function F() {
|
|
5222
|
+
document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", F), g.value && d.value && h.value && w.value && e("nodeDragDrop", {
|
|
5223
5223
|
draggedNodeId: d.value,
|
|
5224
5224
|
targetNodeId: h.value,
|
|
5225
5225
|
dragPosition: w.value
|
|
5226
5226
|
}), g.value = !1, e("updateDragState", null, null, null), d.value = null, h.value = null, w.value = null, f.value.clear();
|
|
5227
5227
|
}
|
|
5228
5228
|
function O() {
|
|
5229
|
-
document.removeEventListener("mousemove", I), document.removeEventListener("mouseup",
|
|
5229
|
+
document.removeEventListener("mousemove", I), document.removeEventListener("mouseup", F), g.value = !1, e("updateDragState", null, null, null), d.value = null, h.value = null, w.value = null, f.value.clear();
|
|
5230
5230
|
}
|
|
5231
5231
|
return {
|
|
5232
5232
|
isDragging: g,
|
|
@@ -5290,10 +5290,10 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5290
5290
|
class: "right-area flex items-center gap-4"
|
|
5291
5291
|
}, xl = {
|
|
5292
5292
|
class: "flex flex-nowrap items-center show-on-hover"
|
|
5293
|
-
},
|
|
5293
|
+
}, Fl = {
|
|
5294
5294
|
key: 0,
|
|
5295
5295
|
class: "drop-indicator-before"
|
|
5296
|
-
},
|
|
5296
|
+
}, Sl = {
|
|
5297
5297
|
key: 1,
|
|
5298
5298
|
class: "drop-indicator-after"
|
|
5299
5299
|
}, Ol = {
|
|
@@ -5344,14 +5344,14 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5344
5344
|
});
|
|
5345
5345
|
return (f, a) => {
|
|
5346
5346
|
var O, k, p;
|
|
5347
|
-
const I = W("FmIcon"),
|
|
5347
|
+
const I = W("FmIcon"), F = W("FmTooltip");
|
|
5348
5348
|
return $(), J("div", {
|
|
5349
5349
|
class: fe(["tree-node", "max-w-full", "py-4 px-8 flex items-center justify-between gap-4", "fm-corner-radius-sm", "select-none", m.value, s.value, g.value, {
|
|
5350
5350
|
"opacity-50": f.dragging
|
|
5351
5351
|
}, "hover-effect"]),
|
|
5352
5352
|
onClick: a[2] || (a[2] = He(() => {
|
|
5353
|
-
var T,
|
|
5354
|
-
f.node.disabled || (
|
|
5353
|
+
var T, R;
|
|
5354
|
+
f.node.disabled || (R = (T = f.node).onClick) == null || R.call(T);
|
|
5355
5355
|
}, ["stop"])),
|
|
5356
5356
|
onMousedown: a[3] || (a[3] = //@ts-ignore
|
|
5357
5357
|
(...T) => o(w) && o(w)(...T)),
|
|
@@ -5367,7 +5367,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5367
5367
|
size: "sm",
|
|
5368
5368
|
outline: "",
|
|
5369
5369
|
class: "text-fm-color-neutral-gray-400 drag-handle flex-shrink-0"
|
|
5370
|
-
})) : X("", !0), C(
|
|
5370
|
+
})) : X("", !0), C(Ft, {
|
|
5371
5371
|
name: t.value,
|
|
5372
5372
|
visible: e.expandable,
|
|
5373
5373
|
onClick: a[0] || (a[0] = He(() => {
|
|
@@ -5379,7 +5379,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5379
5379
|
outline: "",
|
|
5380
5380
|
name: f.node.icon,
|
|
5381
5381
|
class: "text-fm-color-neutral-gray-400 flex-shrink-0"
|
|
5382
|
-
}, null, 8, ["name"])) : X("", !0), A("div", Il, [C(
|
|
5382
|
+
}, null, 8, ["name"])) : X("", !0), A("div", Il, [C(F, {
|
|
5383
5383
|
content: f.node.label,
|
|
5384
5384
|
variant: "rich",
|
|
5385
5385
|
placement: "top",
|
|
@@ -5396,18 +5396,18 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5396
5396
|
highlightedStrings: f.highlightedStrings
|
|
5397
5397
|
}, null, 8, ["class", "text", "highlightedStrings"])]),
|
|
5398
5398
|
_: 1
|
|
5399
|
-
}, 8, ["content"])])]), A("div", El, [($(!0), J(Oe, null, Ne(f.node.chips, (T) => ($(), H(
|
|
5399
|
+
}, 8, ["content"])])]), A("div", El, [($(!0), J(Oe, null, Ne(f.node.chips, (T) => ($(), H(Ro, {
|
|
5400
5400
|
key: T.label,
|
|
5401
5401
|
size: T.size || "xs",
|
|
5402
5402
|
label: T.label,
|
|
5403
5403
|
variant: T.variant || "neutral",
|
|
5404
5404
|
border: T.border
|
|
5405
|
-
}, null, 8, ["size", "label", "variant", "border"]))), 128))])]), A("div", Tl, [A("div", xl, [($(!0), J(Oe, null, Ne(f.node.actions, (T) => ($(), H(
|
|
5405
|
+
}, null, 8, ["size", "label", "variant", "border"]))), 128))])]), A("div", Tl, [A("div", xl, [($(!0), J(Oe, null, Ne(f.node.actions, (T) => ($(), H(St, {
|
|
5406
5406
|
key: T.id,
|
|
5407
5407
|
name: T.icon,
|
|
5408
5408
|
tooltip: T.tooltip,
|
|
5409
5409
|
visible: !0,
|
|
5410
|
-
onClick: (
|
|
5410
|
+
onClick: (R) => {
|
|
5411
5411
|
var M;
|
|
5412
5412
|
return (M = T.onClick) == null ? void 0 : M.call(T);
|
|
5413
5413
|
}
|
|
@@ -5416,10 +5416,10 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5416
5416
|
text: (p = f.node.rightLabel) == null ? void 0 : p.label,
|
|
5417
5417
|
highlightedStrings: f.highlightedStrings,
|
|
5418
5418
|
onClick: a[1] || (a[1] = He((T) => {
|
|
5419
|
-
var
|
|
5420
|
-
return (M = (
|
|
5419
|
+
var R, M;
|
|
5420
|
+
return (M = (R = f.node.rightLabel) == null ? void 0 : R.onClick) == null ? void 0 : M.call(R);
|
|
5421
5421
|
}, ["stop"]))
|
|
5422
|
-
}, null, 8, ["class", "text", "highlightedStrings"])]), f.dropTarget && f.dropPosition === "before" ? ($(), J("div",
|
|
5422
|
+
}, null, 8, ["class", "text", "highlightedStrings"])]), f.dropTarget && f.dropPosition === "before" ? ($(), J("div", Fl)) : X("", !0), f.dropTarget && f.dropPosition === "after" ? ($(), J("div", Sl)) : X("", !0), f.dropTarget && f.dropPosition === "inside" ? ($(), J("div", Ol)) : X("", !0)], 34);
|
|
5423
5423
|
};
|
|
5424
5424
|
}
|
|
5425
5425
|
}), Vl = ["id"], $l = {
|
|
@@ -5427,7 +5427,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5427
5427
|
}, Pl = {
|
|
5428
5428
|
key: 1,
|
|
5429
5429
|
class: "empty-tree-message"
|
|
5430
|
-
}, It = 32,
|
|
5430
|
+
}, It = 32, Rl = /* @__PURE__ */ ae({
|
|
5431
5431
|
__name: "FmTree",
|
|
5432
5432
|
props: {
|
|
5433
5433
|
nodes: {},
|
|
@@ -5445,22 +5445,22 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5445
5445
|
const {
|
|
5446
5446
|
t
|
|
5447
5447
|
} = ce(), m = n, s = e;
|
|
5448
|
-
function g(
|
|
5449
|
-
const
|
|
5450
|
-
|
|
5448
|
+
function g(S) {
|
|
5449
|
+
const U = m.expandedNodeIds;
|
|
5450
|
+
U != null && U.includes(S) ? s("updateExpandedNodeIds", U.filter((E) => E !== S)) : s("updateExpandedNodeIds", [...U || [], S]);
|
|
5451
5451
|
}
|
|
5452
5452
|
const d = D(() => new Set(m.expandedNodeIds)), h = D(() => {
|
|
5453
|
-
const
|
|
5454
|
-
function
|
|
5453
|
+
const S = [];
|
|
5454
|
+
function U(E, u = 0) {
|
|
5455
5455
|
if (E)
|
|
5456
5456
|
for (const l of E)
|
|
5457
|
-
|
|
5457
|
+
S.push({
|
|
5458
5458
|
id: l.id,
|
|
5459
5459
|
level: u,
|
|
5460
5460
|
node: l
|
|
5461
|
-
}), d.value.has(l.id) && l.children && l.children.length > 0 &&
|
|
5461
|
+
}), d.value.has(l.id) && l.children && l.children.length > 0 && U(l.children, u + 1);
|
|
5462
5462
|
}
|
|
5463
|
-
return
|
|
5463
|
+
return U(m.nodes), S;
|
|
5464
5464
|
});
|
|
5465
5465
|
q(null);
|
|
5466
5466
|
const {
|
|
@@ -5472,29 +5472,29 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5472
5472
|
itemHeight: It,
|
|
5473
5473
|
overscan: 10
|
|
5474
5474
|
});
|
|
5475
|
-
ye(() => h.value.length, async (
|
|
5476
|
-
const
|
|
5477
|
-
|
|
5475
|
+
ye(() => h.value.length, async (S) => {
|
|
5476
|
+
const U = b.ref.value;
|
|
5477
|
+
U && S * It < U.scrollTop && (await nt(), _(0));
|
|
5478
5478
|
});
|
|
5479
5479
|
function a() {
|
|
5480
5480
|
_(0);
|
|
5481
5481
|
}
|
|
5482
|
-
function I(
|
|
5483
|
-
const
|
|
5484
|
-
|
|
5482
|
+
function I(S) {
|
|
5483
|
+
const U = h.value.findIndex((E) => E.id === S);
|
|
5484
|
+
U !== -1 && _(U);
|
|
5485
5485
|
}
|
|
5486
5486
|
const {
|
|
5487
|
-
isDragging:
|
|
5487
|
+
isDragging: F,
|
|
5488
5488
|
draggedNodeId: O,
|
|
5489
5489
|
dropTargetNodeId: k,
|
|
5490
5490
|
dropPosition: p,
|
|
5491
5491
|
mousePosition: T,
|
|
5492
|
-
onDragStart:
|
|
5492
|
+
onDragStart: R,
|
|
5493
5493
|
cancelDrag: M
|
|
5494
5494
|
} = vl({
|
|
5495
5495
|
itemHeight: It,
|
|
5496
|
-
emit: (
|
|
5497
|
-
|
|
5496
|
+
emit: (S, ...U) => {
|
|
5497
|
+
S === "updateDragState" ? s("updateDragState", ...U) : S === "nodeDragDrop" && s("nodeDragDrop", U[0]);
|
|
5498
5498
|
},
|
|
5499
5499
|
getFlattenedItems: () => h.value,
|
|
5500
5500
|
getContainerRef: () => b.ref.value,
|
|
@@ -5504,7 +5504,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5504
5504
|
scrollToTop: a,
|
|
5505
5505
|
scrollToNode: I,
|
|
5506
5506
|
cancelDrag: M
|
|
5507
|
-
}), (
|
|
5507
|
+
}), (S, U) => {
|
|
5508
5508
|
var u;
|
|
5509
5509
|
const E = W("FmIcon");
|
|
5510
5510
|
return $(), J("div", Vn({
|
|
@@ -5530,16 +5530,16 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5530
5530
|
expandable: !!((i = l.node.children) != null && i.length && l.node.children.length > 0),
|
|
5531
5531
|
expanded: d.value.has(l.id),
|
|
5532
5532
|
highlightedStrings: l.node.highlightedStrings,
|
|
5533
|
-
dragging: o(
|
|
5533
|
+
dragging: o(F) && o(O) === l.id,
|
|
5534
5534
|
dropTarget: o(k) === l.id,
|
|
5535
5535
|
dropPosition: o(k) === l.id ? o(p) : null,
|
|
5536
5536
|
onToggleExpand: (v) => g(l.id),
|
|
5537
|
-
onDragStart: (v) => o(
|
|
5537
|
+
onDragStart: (v) => o(R)(l.id, v),
|
|
5538
5538
|
style: ct({
|
|
5539
5539
|
paddingLeft: `${l.level * 20}px`
|
|
5540
5540
|
})
|
|
5541
5541
|
}, null, 8, ["node", "selected", "expandable", "expanded", "highlightedStrings", "dragging", "dropTarget", "dropPosition", "onToggleExpand", "onDragStart", "style"]))], 10, Vl);
|
|
5542
|
-
}), 128))], 16), o(
|
|
5542
|
+
}), 128))], 16), o(F) && o(O) ? ($(), J("div", {
|
|
5543
5543
|
key: 0,
|
|
5544
5544
|
class: "drag-overlay",
|
|
5545
5545
|
style: ct({
|
|
@@ -5553,7 +5553,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5553
5553
|
}), A("span", null, ge((u = h.value.find((l) => l.id === o(O))) == null ? void 0 : u.node.label), 1)])], 4)) : X("", !0), h.value.length === 0 ? ($(), J("div", Pl, ge(o(t)("menu.tree_editor.labels.no_items")), 1)) : X("", !0)], 16);
|
|
5554
5554
|
};
|
|
5555
5555
|
}
|
|
5556
|
-
}),
|
|
5556
|
+
}), Ul = /* @__PURE__ */ Ze(Rl, [["__scopeId", "data-v-9244f342"]]), Ml = { class: "py-4 px-8 flex items-center gap-4 text-fm-color-primary cursor-pointer relative" }, Al = {
|
|
5557
5557
|
key: 1,
|
|
5558
5558
|
class: "fm-typo-en-body-md-400"
|
|
5559
5559
|
}, kt = /* @__PURE__ */ ae({
|
|
@@ -5609,8 +5609,8 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5609
5609
|
ye([() => e.overridedMenu, () => _.value], async () => {
|
|
5610
5610
|
const M = await f();
|
|
5611
5611
|
if (e.filterState.searchKey) {
|
|
5612
|
-
const
|
|
5613
|
-
m.setTreeNodes(
|
|
5612
|
+
const S = er(M.tree, e.filterState.searchKey);
|
|
5613
|
+
m.setTreeNodes(S.subTree), m.setExpandedNodeIds(S.shouldExpandNodeIds);
|
|
5614
5614
|
} else
|
|
5615
5615
|
m.setTreeNodes(M.tree);
|
|
5616
5616
|
});
|
|
@@ -5618,36 +5618,36 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5618
5618
|
t: a
|
|
5619
5619
|
} = ce(), {
|
|
5620
5620
|
menuItems: I,
|
|
5621
|
-
categories:
|
|
5621
|
+
categories: F,
|
|
5622
5622
|
linkItemRules: O,
|
|
5623
5623
|
handleSubmit: k,
|
|
5624
5624
|
catalogManager: p,
|
|
5625
5625
|
schedulerManager: T,
|
|
5626
|
-
noScheduler:
|
|
5626
|
+
noScheduler: R
|
|
5627
5627
|
} = ho(!0);
|
|
5628
|
-
return (M,
|
|
5628
|
+
return (M, S) => ($(), J("div", Nl, [A("div", Ll, [o(s).rules.category.create ? ($(), H(kt, {
|
|
5629
5629
|
key: 0,
|
|
5630
5630
|
label: o(a)("menu.tree_editor.actions.add_category"),
|
|
5631
5631
|
icon: "add",
|
|
5632
|
-
onClick:
|
|
5632
|
+
onClick: S[0] || (S[0] = (U) => o(g).create())
|
|
5633
5633
|
}, null, 8, ["label"])) : X("", !0), o(s).state.currentCatalogId && !o(s).state.currentSchedulerId ? ($(), H(xt, {
|
|
5634
5634
|
key: 1,
|
|
5635
5635
|
"categorized-items": o(p).linkableItems.value,
|
|
5636
5636
|
"initial-value": o(p).currentItems.value,
|
|
5637
5637
|
"menu-items": o(I),
|
|
5638
|
-
categories: o(
|
|
5638
|
+
categories: o(F),
|
|
5639
5639
|
"link-item-rules": o(O),
|
|
5640
5640
|
"show-variant": !1,
|
|
5641
|
-
"no-scheduler": o(
|
|
5641
|
+
"no-scheduler": o(R),
|
|
5642
5642
|
"is-local-only": !0,
|
|
5643
5643
|
onSubmit: o(k)
|
|
5644
5644
|
}, {
|
|
5645
5645
|
default: B(({
|
|
5646
|
-
trigger:
|
|
5646
|
+
trigger: U
|
|
5647
5647
|
}) => [C(kt, {
|
|
5648
5648
|
label: o(a)("menu.catalog.edit.link_product"),
|
|
5649
5649
|
icon: "link",
|
|
5650
|
-
onClick:
|
|
5650
|
+
onClick: U
|
|
5651
5651
|
}, null, 8, ["label", "onClick"])]),
|
|
5652
5652
|
_: 1
|
|
5653
5653
|
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : X("", !0), o(s).state.currentSchedulerId ? ($(), H(xt, {
|
|
@@ -5655,39 +5655,39 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5655
5655
|
"categorized-items": o(T).linkableItems.value,
|
|
5656
5656
|
"initial-value": o(T).currentItems.value,
|
|
5657
5657
|
"menu-items": o(I),
|
|
5658
|
-
categories: o(
|
|
5658
|
+
categories: o(F),
|
|
5659
5659
|
"link-item-rules": o(O),
|
|
5660
5660
|
"show-variant": !1,
|
|
5661
|
-
"no-scheduler": o(
|
|
5661
|
+
"no-scheduler": o(R),
|
|
5662
5662
|
"is-local-only": !0,
|
|
5663
5663
|
onSubmit: o(k)
|
|
5664
5664
|
}, {
|
|
5665
5665
|
default: B(({
|
|
5666
|
-
trigger:
|
|
5666
|
+
trigger: U
|
|
5667
5667
|
}) => [C(kt, {
|
|
5668
5668
|
label: o(a)("menu.catalog.edit.apply_scheduler"),
|
|
5669
5669
|
icon: "link",
|
|
5670
|
-
onClick:
|
|
5670
|
+
onClick: U
|
|
5671
5671
|
}, null, 8, ["label", "onClick"])]),
|
|
5672
5672
|
_: 1
|
|
5673
|
-
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : X("", !0), A("div", Gl, [C(
|
|
5673
|
+
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : X("", !0), A("div", Gl, [C(St, {
|
|
5674
5674
|
name: "expand_all",
|
|
5675
5675
|
tooltip: o(a)("menu.tree_editor.actions.expand_all"),
|
|
5676
5676
|
visible: !0,
|
|
5677
|
-
onClick:
|
|
5678
|
-
}, null, 8, ["tooltip"]), C(
|
|
5677
|
+
onClick: S[1] || (S[1] = (U) => o(m).expandAllNodes())
|
|
5678
|
+
}, null, 8, ["tooltip"]), C(St, {
|
|
5679
5679
|
name: "collapse_all",
|
|
5680
5680
|
tooltip: o(a)("menu.tree_editor.actions.collapse_all"),
|
|
5681
5681
|
visible: !0,
|
|
5682
|
-
onClick:
|
|
5682
|
+
onClick: S[2] || (S[2] = (U) => o(m).collapseAllNodes())
|
|
5683
5683
|
}, null, 8, ["tooltip"])])]), C(eo, null, {
|
|
5684
|
-
default: B(() => [C(
|
|
5684
|
+
default: B(() => [C(Ul, {
|
|
5685
5685
|
nodes: o(m).treeNodes,
|
|
5686
5686
|
selectedNodeId: o(m).selectedNodeId,
|
|
5687
5687
|
expandedNodeIds: o(m).expandedNodeIds,
|
|
5688
5688
|
canDropFn: o(d),
|
|
5689
|
-
onUpdateExpandedNodeIds:
|
|
5690
|
-
onNodeDragDrop:
|
|
5689
|
+
onUpdateExpandedNodeIds: S[3] || (S[3] = (U) => o(m).setExpandedNodeIds(U)),
|
|
5690
|
+
onNodeDragDrop: S[4] || (S[4] = (U) => o(h)(U))
|
|
5691
5691
|
}, null, 8, ["nodes", "selectedNodeId", "expandedNodeIds", "canDropFn"])]),
|
|
5692
5692
|
_: 1
|
|
5693
5693
|
})]));
|
|
@@ -5845,10 +5845,10 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5845
5845
|
}
|
|
5846
5846
|
}
|
|
5847
5847
|
function f(a) {
|
|
5848
|
-
var I,
|
|
5848
|
+
var I, F, O;
|
|
5849
5849
|
if (((I = d.value) == null ? void 0 : I._id) === a)
|
|
5850
5850
|
return !0;
|
|
5851
|
-
if (g.value && g.value !== a && ((
|
|
5851
|
+
if (g.value && g.value !== a && ((F = s.value) != null && F.hasUnsavedChanges())) {
|
|
5852
5852
|
const k = (O = s.value) == null ? void 0 : O.validate();
|
|
5853
5853
|
if (!k || k.length > 0)
|
|
5854
5854
|
return !1;
|
|
@@ -5901,7 +5901,7 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5901
5901
|
},
|
|
5902
5902
|
emits: ["update:show", "submit"],
|
|
5903
5903
|
setup(n, { emit: r }) {
|
|
5904
|
-
const e = n, t =
|
|
5904
|
+
const e = n, t = Ue(), { minor: m } = ot(t), { t: s } = ce(), g = r, d = () => {
|
|
5905
5905
|
g("update:show", !1);
|
|
5906
5906
|
}, h = ln(), w = se();
|
|
5907
5907
|
w.selectCatalog(null), w.selectScheduler(null);
|
|
@@ -5918,16 +5918,16 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5918
5918
|
successMessage: "Menu updated successfully"
|
|
5919
5919
|
}
|
|
5920
5920
|
);
|
|
5921
|
-
}, f =
|
|
5921
|
+
}, f = Rt(
|
|
5922
5922
|
() => !ke.isEqual(e.menu.modules, w.state.menu.modules),
|
|
5923
5923
|
() => {
|
|
5924
5924
|
d();
|
|
5925
5925
|
}
|
|
5926
5926
|
);
|
|
5927
5927
|
return (a, I) => {
|
|
5928
|
-
const
|
|
5929
|
-
return $(), H(
|
|
5930
|
-
C(
|
|
5928
|
+
const F = W("fm-button"), O = W("fm-form");
|
|
5929
|
+
return $(), H(Rn, { to: "body" }, [
|
|
5930
|
+
C(Un, { name: "fade" }, {
|
|
5931
5931
|
default: B(() => [
|
|
5932
5932
|
C(O, {
|
|
5933
5933
|
"blame-form-child-on-validation-failed": "",
|
|
@@ -5941,24 +5941,24 @@ const _l = { key: 0 }, yl = ["innerHTML"], hl = /* @__PURE__ */ ae({
|
|
|
5941
5941
|
A("div", ti, [
|
|
5942
5942
|
A("p", ni, ge(o(s)("menu.tree_editor.title")), 1),
|
|
5943
5943
|
A("div", oi, [
|
|
5944
|
-
C(
|
|
5944
|
+
C(F, {
|
|
5945
5945
|
icon: "undo",
|
|
5946
5946
|
disabled: !o(w).canUndoHistory,
|
|
5947
5947
|
variant: "tertiary",
|
|
5948
5948
|
onClick: o(w).undoHistory
|
|
5949
5949
|
}, null, 8, ["disabled", "onClick"]),
|
|
5950
|
-
C(
|
|
5950
|
+
C(F, {
|
|
5951
5951
|
icon: "redo",
|
|
5952
5952
|
disabled: !o(w).canRedoHistory,
|
|
5953
5953
|
variant: "tertiary",
|
|
5954
5954
|
onClick: o(w).redoHistory
|
|
5955
5955
|
}, null, 8, ["disabled", "onClick"]),
|
|
5956
|
-
C(
|
|
5956
|
+
C(F, {
|
|
5957
5957
|
label: o(s)("common.cancel"),
|
|
5958
5958
|
variant: "tertiary",
|
|
5959
5959
|
onClick: o(f)
|
|
5960
5960
|
}, null, 8, ["label", "onClick"]),
|
|
5961
|
-
C(
|
|
5961
|
+
C(F, {
|
|
5962
5962
|
label: o(s)("common.save"),
|
|
5963
5963
|
type: "submit",
|
|
5964
5964
|
variant: "primary",
|