@feedmepos/mf-menu 0.32.63-dev.4 → 0.32.64-dev.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-D8wf-3gk.js → App-CcCpnDUd.js} +6 -6
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BBMuf15P.js → ApplyProduct.vue_vue_type_script_setup_true_lang-uCZ06pwL.js} +7 -7
- package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-CR7AGqfY.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-YlaEocnO.js} +3 -3
- package/dist/{Catalog-Dzs2obez.js → Catalog-BLpYToaa.js} +6 -6
- package/dist/{Category-CF-bfcWZ.js → Category-huIVx-Pq.js} +4 -4
- package/dist/{Category-CRG_zlyN.js → Category-slad1Kl9.js} +4 -4
- package/dist/{CookingGuide-CumoLERq.js → CookingGuide-k6g5-DZS.js} +5 -5
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Cw0LfYWI.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-Be5sbD3J.js} +1 -1
- package/dist/{Group-XPHRRll5.js → Group-B8QPt_Mf.js} +3 -3
- package/dist/{Group-Bl6IXiL5.js → Group-DuclGQ8D.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-Dp41u-9T.js → Group.vue_vue_type_script_setup_true_lang-DvBL8b_Z.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DBim4X7-.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-C9na_pxa.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-AK0_2AOY.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-C7y1o_cK.js} +6 -6
- package/dist/{Ingredient-BBi88auU.js → Ingredient-Z1niNy7S.js} +4 -4
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-D8C0do_V.js → InventoryBinding.vue_vue_type_script_setup_true_lang-BtM5R-5S.js} +2 -2
- package/dist/{LinkProductSideSheet-BQc-iCkQ.js → LinkProductSideSheet-CUx5qi-A.js} +4 -4
- package/dist/{MenuSetting-FTo1hoSN.js → MenuSetting-CQzIlzZp.js} +7 -7
- package/dist/{OrderPacing-BUcd8nJm.js → OrderPacing-BiL0cgx1.js} +5 -5
- package/dist/{PrintRoute-DUnqYpDY.js → PrintRoute-D1pZkpH_.js} +5 -5
- package/dist/{Product-5jToTVxL.js → Product-Bg-dwe6e.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-CvUR3VeZ.js → Product.vue_vue_type_script_setup_true_lang-BVQVhWAh.js} +13 -13
- package/dist/{ProductInternalTools-DVo8n6WR.js → ProductInternalTools-B0kk7L-u.js} +6 -6
- package/dist/{Products-74l_V3s-.js → Products-Y7qUSXGq.js} +57 -57
- package/dist/{Publish-C_N7lkj5.js → Publish-BgBw1yYD.js} +4 -4
- package/dist/{Recipe-Ds_84fu9.js → Recipe-BQWy65kw.js} +5 -5
- package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-B1wtDQ9P.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-DN09681x.js} +1 -1
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-ntxQXlpV.js → RuleView.vue_vue_type_script_setup_true_lang-C7kaYvTF.js} +3 -3
- package/dist/{Scheduler--pD1opc1.js → Scheduler-3c53XS3M.js} +3 -3
- package/dist/{ServingSequence-B3xxkMbp.js → ServingSequence-COJkc08j.js} +3 -3
- package/dist/{Setting-GBA945nB.js → Setting-DY-P5PAu.js} +5 -5
- package/dist/{Subcategory-BikyD-je.js → Subcategory-1-uYipz9.js} +6 -6
- package/dist/{Takeaway-DqDIobRV.js → Takeaway-C3dwSDye.js} +1 -1
- package/dist/{Takeaway-XPKWPa1W.js → Takeaway-DTcdrd4N.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CJG-SwOd.js → Takeaway.vue_vue_type_script_setup_true_lang-BQ60zhzJ.js} +10 -10
- package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-ogrcEhDA.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-DOQjcZde.js} +1 -1
- package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-BZfaB7Vl.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-CoK2Y57Z.js} +2 -2
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DaSfi9fx.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BM1nnTTV.js} +605 -603
- package/dist/{Unit-yJJmRvha.js → Unit-CkJp-MxR.js} +2 -2
- package/dist/{Variant-DcCYBJS2.js → Variant-Ck8V9o_n.js} +3 -3
- package/dist/{_id_-BpkYdn5i.js → _id_-DVko2hJ3.js} +9 -9
- package/dist/{app-BMI3O5C9.js → app-CMpNs1Lv.js} +37 -37
- package/dist/{app-BzMTHTrI.js → app-idZd8GBJ.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/app.d.ts +0 -5
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/productImages.d.ts +6 -3
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ProductImageField.vue.d.ts +6 -6
- package/dist/assets/{override-menu-CwJOJV2k.js → linked-status-Oe5zalYU.js} +4 -4
- package/dist/assets/{menu-export-hXupkCVZ.js → menu-export-BZTDjkcV.js} +3 -3
- package/dist/assets/{linked-status-C8NLd-zI.js → override-menu-2ehtF8h1.js} +4 -4
- package/dist/assets/{validate-menu-BrXEl7Mi.js → validate-menu-wNmLgJZW.js} +3 -3
- package/dist/{catalog-L2sdRcQf.js → catalog-C4zqfdRz.js} +1 -1
- package/dist/{catalogSetting-CGSmZhMj.js → catalogSetting-CdrKAkWc.js} +1 -1
- package/dist/{currency-QIXheiUu.js → currency-zP5t_q3e.js} +1 -1
- package/dist/{dayjs.min-CGH3EzsL.js → dayjs.min-CVaDPO4u.js} +2 -2
- package/dist/{discardConfirm-B61hQjlH.js → discardConfirm-D5TZC0up.js} +1 -1
- package/dist/{index-CUcUva0h.js → index-Bdjp_HoJ.js} +6 -6
- package/dist/{index-DCSeBwkM.js → index-CY_PF4JI.js} +5 -5
- package/dist/{index.vue_vue_type_script_setup_true_lang-BVBi4Vvc.js → index.vue_vue_type_script_setup_true_lang-Cxq1w0By.js} +3162 -3152
- package/dist/{item-BMyRZqY8.js → item-DF4sY8Lz.js} +2252 -2275
- package/dist/{jszip.min-BaD6pNmW.js → jszip.min-CfredHU3.js} +3 -3
- package/dist/{linkProducts-CqH6KCgg.js → linkProducts-_ZMDyksQ.js} +4 -4
- package/dist/{memberPricing-DNAuPva3.js → memberPricing-K5VG3VIu.js} +1 -1
- package/dist/{menu-BNrZkzpK.js → menu-CZxNlbpe.js} +1 -1
- package/dist/{menuV2-D1bGhwPG.js → menuV2-BHwuCExt.js} +91 -91
- package/dist/mf-menu.css +1 -1
- package/dist/{order_pacing-CmC9xxja.js → order_pacing-Cme5qoFR.js} +5 -5
- package/dist/{priceTier-DZ5JRGkT.js → priceTier-DSYN-IAO.js} +1 -1
- package/dist/{rules-B2yeUFyY.js → rules-D4rAL20Q.js} +3 -3
- package/dist/{scheduler-DVKJQGbT.js → scheduler-J5Ea4WSr.js} +5 -5
- package/dist/{toExcel-D8feJ9ZC.js → toExcel-XoL9W3Ev.js} +2 -2
- package/dist/{unit-DI5JogzR.js → unit-Bi2EnEOF.js} +3 -3
- package/package.json +1 -1
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { ref as ee, computed as M, getCurrentInstance as Cn, render as In, defineComponent as
|
|
2
|
-
import { x as An, y as Nn, z as Ln, A as Gn, B as Kn, D as rn, G as Ft, P as Bn, I as zn, H as jn, J as Yn, K as At, M as qn, N as Wn, O as an, Q as ln, R as Hn, T as Nt, U as Lt, V as Gt, W as sn, X as Vt, Y as Xn, Z as Qn, $ as Jn, a0 as Zn, a1 as eo, a2 as to, a3 as un, a4 as Ht, a5 as dn, a6 as no, a7 as oo, a8 as ro, a9 as ao, aa as cn, w as lo, ab as io, ac as qe, ad as so, ae as uo, af as co, ag as mo, ah as Xt, ai as po } from "./item-
|
|
3
|
-
import { a as fo, b as go, d as vo, _ as bo, T as yo } from "./app-
|
|
4
|
-
import { l as Ve, u as Kt } from "./discardConfirm-
|
|
5
|
-
import { useI18n as _e, useCoreStore as
|
|
6
|
-
import { useDialog as Qe, useSnackbar as
|
|
7
|
-
import { a as Te, g as Fe, h as xe, u as vt, i as Bt, b as bt, r as ho, F as et, j as he, m as
|
|
1
|
+
import { ref as ee, computed as M, getCurrentInstance as Cn, render as In, defineComponent as fe, onMounted as Xe, resolveComponent as H, resolveDirective as nn, createElementBlock as J, openBlock as A, Fragment as Se, createVNode as s, unref as e, withCtx as q, createElementVNode as K, createBlock as ne, createCommentVNode as Z, normalizeClass as $e, renderList as Ae, toDisplayString as ye, createTextVNode as Tn, withDirectives as at, renderSlot as Be, watch as Oe, h as Ie, isVNode as xn, nextTick as gt, vShow as on, withModifiers as Je, createSlots as Sn, onBeforeUnmount as Rt, watchEffect as En, onUnmounted as Fn, normalizeStyle as mt, mergeProps as Vn, normalizeProps as $n, guardReactiveProps as Pn, mergeModels as Dn, useModel as On, Teleport as Mn, Transition as Un, withKeys as Rn } from "vue";
|
|
2
|
+
import { x as An, y as Nn, z as Ln, A as Gn, B as Kn, D as rn, G as Ft, P as Bn, I as zn, H as jn, J as Yn, K as At, M as qn, N as Wn, O as an, Q as ln, R as Hn, T as Nt, U as Lt, V as Gt, W as sn, X as Vt, Y as Xn, Z as Qn, $ as Jn, a0 as Zn, a1 as eo, a2 as to, a3 as un, a4 as Ht, a5 as dn, a6 as no, a7 as oo, a8 as ro, a9 as ao, aa as cn, w as lo, ab as io, ac as qe, ad as so, ae as uo, af as co, ag as mo, ah as Xt, ai as po } from "./item-DF4sY8Lz.js";
|
|
3
|
+
import { a as fo, b as go, d as vo, _ as bo, T as yo } from "./app-CMpNs1Lv.js";
|
|
4
|
+
import { l as Ve, u as Kt } from "./discardConfirm-D5TZC0up.js";
|
|
5
|
+
import { useI18n as _e, useCoreStore as lt, CustomAttributesForm as mn } from "@feedmepos/mf-common";
|
|
6
|
+
import { useDialog as Qe, useSnackbar as Ye, components as Ce, FmButtonVariant as Pe, FmButtonColorThemeVariant as Re, useBreakpoints as _o, useDialogChild as pn } from "@feedmepos/ui-library";
|
|
7
|
+
import { a as Te, g as Fe, h as xe, u as vt, i as Bt, b as bt, r as ho, F as et, j as he, m as je, d as ke, o as ko, k as ct, l as wo, I as ht, n as fn, s as kt, w as Qt, p as Co, q as Io, t as Jt, v as To } from "./index.vue_vue_type_script_setup_true_lang-Cxq1w0By.js";
|
|
8
8
|
import { defineStore as xo } from "pinia";
|
|
9
|
-
import { _ as Me, a as So } from "./RuleView.vue_vue_type_script_setup_true_lang-
|
|
10
|
-
import { u as
|
|
9
|
+
import { _ as Me, a as So } from "./RuleView.vue_vue_type_script_setup_true_lang-C7kaYvTF.js";
|
|
10
|
+
import { u as be, g as $t, m as Eo } from "./menuV2-BHwuCExt.js";
|
|
11
11
|
import { s as Pt, _ as Fo } from "./index-CD_omf3p.js";
|
|
12
12
|
import { useAppStore as gn, RemyButton as vn } from "@feedmepos/mf-remy-panel";
|
|
13
|
-
import { _ as
|
|
13
|
+
import { _ as Ke } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
|
|
14
14
|
import { c as Vo } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
15
15
|
import { _ as Dt } from "./tooltip-B5BiPMx9.js";
|
|
16
|
-
import { g as
|
|
17
|
-
import { _ as
|
|
18
|
-
import { _ as Ze, T as $o, l as Po } from "./index-
|
|
19
|
-
import { L as Ot } from "./LinkProductSideSheet-
|
|
16
|
+
import { g as st } from "./translation-fNx6yEpy.js";
|
|
17
|
+
import { _ as it } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
18
|
+
import { _ as Ze, T as $o, l as Po } from "./index-Bdjp_HoJ.js";
|
|
19
|
+
import { L as Ot } from "./LinkProductSideSheet-CUx5qi-A.js";
|
|
20
20
|
import { u as Do } from "./search-BAPEUu1R.js";
|
|
21
21
|
import { c as zt } from "./check-C9mY6LiX.js";
|
|
22
|
-
import { f as
|
|
23
|
-
import { u as jt } from "./memberPricing-
|
|
22
|
+
import { f as ze } from "./currency-zP5t_q3e.js";
|
|
23
|
+
import { u as jt } from "./memberPricing-K5VG3VIu.js";
|
|
24
24
|
import { c as Oo } from "./string-DpfFixWH.js";
|
|
25
25
|
import { useInventoryStore as Mo, InventoryBindingSummary as Uo } from "@feedmepos/mf-inventory-portal";
|
|
26
|
-
import { u as Ro } from "./priceTier-
|
|
26
|
+
import { u as Ro } from "./priceTier-DSYN-IAO.js";
|
|
27
27
|
import { d as Yt } from "./RuleConditionSelector.vue_vue_type_style_index_0_lang-CK8z7qA8.js";
|
|
28
|
-
import { _ as Ao } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-
|
|
28
|
+
import { _ as Ao } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-uCZ06pwL.js";
|
|
29
29
|
import "./app-5fxKLAzS.js";
|
|
30
30
|
/* empty css */
|
|
31
|
-
import { a as No, u as Lo } from "./linkProducts-
|
|
31
|
+
import { a as No, u as Lo } from "./linkProducts-_ZMDyksQ.js";
|
|
32
32
|
import { c as pt } from "./object-DVUNCr7w.js";
|
|
33
33
|
import { _ as Go } from "./TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js";
|
|
34
34
|
import { _ as Zt } from "./MenuSelector.vue_vue_type_script_setup_true_lang-K6Z0QJBl.js";
|
|
35
|
-
import { _ as Ko } from "./RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-
|
|
36
|
-
var tt = /* @__PURE__ */ ((i) => (i.PRIMARY = "primary", i.PLAIN = "plain", i))(tt || {}),
|
|
35
|
+
import { _ as Ko } from "./RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-DN09681x.js";
|
|
36
|
+
var tt = /* @__PURE__ */ ((i) => (i.PRIMARY = "primary", i.PLAIN = "plain", i))(tt || {}), Le = /* @__PURE__ */ ((i) => (i.CATEGORY = "view_list", i.ITEM = "fastfood", i.VARIANT = "lunch_dining", i.GROUP = "database", i.FOLDER = "folder", i))(Le || {});
|
|
37
37
|
function wt(i, a) {
|
|
38
38
|
return i <= 0 ? null : { label: a };
|
|
39
39
|
}
|
|
@@ -183,7 +183,7 @@ const yt = xo("mf-menu-tree", () => {
|
|
|
183
183
|
getNodeById: P
|
|
184
184
|
};
|
|
185
185
|
});
|
|
186
|
-
let
|
|
186
|
+
let ut = null, We = null, He = null;
|
|
187
187
|
function bn() {
|
|
188
188
|
return We && (clearTimeout(We), We = null), He ? (He(), He = null, !0) : !1;
|
|
189
189
|
}
|
|
@@ -194,8 +194,8 @@ function Ho(i, a, t) {
|
|
|
194
194
|
if (C != null && C.length && C.length > 0)
|
|
195
195
|
return !1;
|
|
196
196
|
const P = _;
|
|
197
|
-
return r(P),
|
|
198
|
-
|
|
197
|
+
return r(P), ut = { ...P }, We && clearTimeout(We), He = () => {
|
|
198
|
+
ut && (b(ut), ut = null), We = null;
|
|
199
199
|
}, We = setTimeout(() => {
|
|
200
200
|
He && He(), He = null;
|
|
201
201
|
}, 1e3), !0;
|
|
@@ -303,7 +303,7 @@ function ft(i, a) {
|
|
|
303
303
|
return a ? `${i}-${a}` : i;
|
|
304
304
|
}
|
|
305
305
|
const _t = () => {
|
|
306
|
-
const { t: i } = _e(), a = Qe(), t =
|
|
306
|
+
const { t: i } = _e(), a = Qe(), t = be(), o = Cn();
|
|
307
307
|
function m() {
|
|
308
308
|
var C, P, y;
|
|
309
309
|
if (!o) throw new Error("No current instance found");
|
|
@@ -407,10 +407,10 @@ const _t = () => {
|
|
|
407
407
|
key: 1,
|
|
408
408
|
class: "flex flex-col gap-24"
|
|
409
409
|
};
|
|
410
|
-
var
|
|
410
|
+
var Ge = /* @__PURE__ */ function(i) {
|
|
411
411
|
return i.ADD_ON = "ADD_ON", i.PRODUCT = "PRODUCT", i;
|
|
412
|
-
}(
|
|
413
|
-
const gr = /* @__PURE__ */
|
|
412
|
+
}(Ge || {});
|
|
413
|
+
const gr = /* @__PURE__ */ fe({
|
|
414
414
|
__name: "ProductDetail",
|
|
415
415
|
props: {
|
|
416
416
|
isOverride: {
|
|
@@ -429,9 +429,9 @@ const gr = /* @__PURE__ */ ge({
|
|
|
429
429
|
setup(i, {
|
|
430
430
|
emit: a
|
|
431
431
|
}) {
|
|
432
|
-
const t = i, o = vt(), m =
|
|
432
|
+
const t = i, o = vt(), m = be(), r = _t(), {
|
|
433
433
|
checkMenuIsLoading: b
|
|
434
|
-
} = Bt(bt(
|
|
434
|
+
} = Bt(bt(Ye())), F = lt(), c = a, _ = M(() => m.rules.item);
|
|
435
435
|
function C(d) {
|
|
436
436
|
c("update:form", "images", d), c("update:form", "thumbnail", ho({
|
|
437
437
|
images: d,
|
|
@@ -489,7 +489,7 @@ const gr = /* @__PURE__ */ ge({
|
|
|
489
489
|
}, [k("menu.product.form.detail.category.add_new")])])
|
|
490
490
|
});
|
|
491
491
|
Xe(async () => {
|
|
492
|
-
!T.value && t.form.category === void 0 && t.isCreate && g(
|
|
492
|
+
!T.value && t.form.category === void 0 && t.isCreate && g(Ge.PRODUCT);
|
|
493
493
|
});
|
|
494
494
|
const D = M(() => {
|
|
495
495
|
var R;
|
|
@@ -500,20 +500,20 @@ const gr = /* @__PURE__ */ ge({
|
|
|
500
500
|
const d = t.form.name2 || ((R = t.fallback) == null ? void 0 : R.name2);
|
|
501
501
|
return d ? m.items.filter((L) => !!L.category && L._id !== t.form._id && L.name2 === d).length : 0;
|
|
502
502
|
}), f = M(() => o.state.featureFlags.uniqueProductCode), N = M(() => {
|
|
503
|
-
var X, W,
|
|
503
|
+
var X, W, re;
|
|
504
504
|
const d = t.form.code || ((X = t.fallback) == null ? void 0 : X.code);
|
|
505
505
|
if (!d) return 0;
|
|
506
506
|
let R = m.itemCodeMap.get(d) || 0;
|
|
507
|
-
const L = m.items.find((
|
|
508
|
-
return (L == null ? void 0 : L.code) === d && (R -= 1), (
|
|
509
|
-
|
|
507
|
+
const L = m.items.find((ie) => ie._id === t.form._id);
|
|
508
|
+
return (L == null ? void 0 : L.code) === d && (R -= 1), (re = (W = L == null ? void 0 : L.variant) == null ? void 0 : W.variantCombinations) == null || re.forEach((ie) => {
|
|
509
|
+
ie.code === d && (R -= 1);
|
|
510
510
|
}), R;
|
|
511
|
-
}), h = M(() => t.isAddon ?
|
|
511
|
+
}), h = M(() => t.isAddon ? Ge.ADD_ON : Ge.PRODUCT);
|
|
512
512
|
function g(d) {
|
|
513
513
|
var L, X, W;
|
|
514
514
|
if (h.value === d) return;
|
|
515
|
-
const R = d ==
|
|
516
|
-
c("update:form", "category", t.isOverride ? R ? "" : ((L = t.fallback) == null ? void 0 : L.category) ?? ((X = y.value.find((
|
|
515
|
+
const R = d == Ge.ADD_ON;
|
|
516
|
+
c("update:form", "category", t.isOverride ? R ? "" : ((L = t.fallback) == null ? void 0 : L.category) ?? ((X = y.value.find((re) => !!re.value)) == null ? void 0 : X.value) : R ? null : (W = y.value.find((re) => !!re.value)) == null ? void 0 : W.value), R && (c("update:form", "additionalCategories", []), c("update:form", "subCategories", []));
|
|
517
517
|
}
|
|
518
518
|
const U = gn();
|
|
519
519
|
rn("apply-description", (d) => {
|
|
@@ -547,48 +547,48 @@ const gr = /* @__PURE__ */ ge({
|
|
|
547
547
|
}
|
|
548
548
|
}), {
|
|
549
549
|
t: k
|
|
550
|
-
} = _e(), G = ee(!1),
|
|
551
|
-
var W,
|
|
550
|
+
} = _e(), G = ee(!1), B = ee("name"), oe = M(() => {
|
|
551
|
+
var W, re;
|
|
552
552
|
const d = [], R = "en-US", L = t.form.name_locale, X = L == null ? void 0 : L[R];
|
|
553
553
|
return (t.form.name || (W = t.fallback) != null && W.name) && !X && d.push({
|
|
554
554
|
locale: R,
|
|
555
|
-
name: t.form.name || ((
|
|
556
|
-
localeDisplay:
|
|
557
|
-
}), L && Object.entries(L).filter(([
|
|
555
|
+
name: t.form.name || ((re = t.fallback) == null ? void 0 : re.name) || "",
|
|
556
|
+
localeDisplay: st(R)
|
|
557
|
+
}), L && Object.entries(L).filter(([ie, ue]) => ue && ue.trim()).sort(([ie], [ue]) => ie.localeCompare(ue)).forEach(([ie, ue]) => {
|
|
558
558
|
d.push({
|
|
559
|
-
locale:
|
|
560
|
-
name:
|
|
561
|
-
localeDisplay:
|
|
559
|
+
locale: ie,
|
|
560
|
+
name: ue,
|
|
561
|
+
localeDisplay: st(ie)
|
|
562
562
|
});
|
|
563
563
|
}), d;
|
|
564
564
|
}), ce = M(() => {
|
|
565
|
-
var W,
|
|
565
|
+
var W, re;
|
|
566
566
|
const d = [], R = "en-US", L = t.form.description_locale, X = L == null ? void 0 : L[R];
|
|
567
567
|
return (t.form.description || (W = t.fallback) != null && W.description) && !X && d.push({
|
|
568
568
|
locale: R,
|
|
569
|
-
name: t.form.description || ((
|
|
570
|
-
localeDisplay:
|
|
571
|
-
}), L && Object.entries(L).filter(([
|
|
569
|
+
name: t.form.description || ((re = t.fallback) == null ? void 0 : re.description) || "",
|
|
570
|
+
localeDisplay: st(R)
|
|
571
|
+
}), L && Object.entries(L).filter(([ie, ue]) => ue && ue.trim()).sort(([ie], [ue]) => ie.localeCompare(ue)).forEach(([ie, ue]) => {
|
|
572
572
|
d.push({
|
|
573
|
-
locale:
|
|
574
|
-
name:
|
|
575
|
-
localeDisplay:
|
|
573
|
+
locale: ie,
|
|
574
|
+
name: ue,
|
|
575
|
+
localeDisplay: st(ie)
|
|
576
576
|
});
|
|
577
577
|
}), d;
|
|
578
578
|
});
|
|
579
|
-
function
|
|
580
|
-
|
|
579
|
+
function pe() {
|
|
580
|
+
B.value = "name", G.value = !0;
|
|
581
581
|
}
|
|
582
582
|
function O() {
|
|
583
|
-
|
|
583
|
+
B.value = "description", G.value = !0;
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function te(d) {
|
|
586
586
|
c("update:form", "name", d);
|
|
587
587
|
}
|
|
588
|
-
function
|
|
588
|
+
function ve(d) {
|
|
589
589
|
c("update:form", "description", d);
|
|
590
590
|
}
|
|
591
|
-
function
|
|
591
|
+
function me(d) {
|
|
592
592
|
c("update:form", "name_locale", d);
|
|
593
593
|
}
|
|
594
594
|
function I(d) {
|
|
@@ -599,13 +599,13 @@ const gr = /* @__PURE__ */ ge({
|
|
|
599
599
|
return !!t.form.name || !!((d = t.fallback) != null && d.name);
|
|
600
600
|
});
|
|
601
601
|
return (d, R) => {
|
|
602
|
-
var
|
|
603
|
-
const L = H("fm-text-field"), X = H("fm-button"), W = H("FmTooltip"),
|
|
602
|
+
var ae, ge;
|
|
603
|
+
const L = H("fm-text-field"), X = H("fm-button"), W = H("FmTooltip"), re = H("fm-textarea"), ie = H("fm-radio"), ue = H("FmSnackbar"), we = H("FmButton"), z = H("fm-radio-group"), j = H("FmFormGroup"), le = H("fm-stepper-field"), de = nn("tooltip");
|
|
604
604
|
return A(), J(Se, null, [s(Me, {
|
|
605
605
|
title: e(k)("menu.product.form.detail.title")
|
|
606
606
|
}, {
|
|
607
607
|
default: q(() => {
|
|
608
|
-
var Q,
|
|
608
|
+
var Q, Ne, nt, Ue, qt, Wt;
|
|
609
609
|
return [K("div", er, [K("div", tr, [K("div", nr, [s(L, {
|
|
610
610
|
"model-value": d.form.code,
|
|
611
611
|
placeholder: ((Q = d.fallback) == null ? void 0 : Q.code) || e(k)("menu.product.form.detail.fields.code.placeholder"),
|
|
@@ -624,7 +624,7 @@ const gr = /* @__PURE__ */ ge({
|
|
|
624
624
|
count: D.value
|
|
625
625
|
}) : void 0,
|
|
626
626
|
"model-value": d.form.name,
|
|
627
|
-
placeholder: (
|
|
627
|
+
placeholder: (Ne = d.fallback) == null ? void 0 : Ne.name,
|
|
628
628
|
rules: _.value.name ? [(se) => !!se || e(k)("menu.product.form.detail.fields.name.required")] : void 0,
|
|
629
629
|
"label-mark": "required",
|
|
630
630
|
label: e(k)("menu.product.form.detail.fields.name.label"),
|
|
@@ -635,13 +635,13 @@ const gr = /* @__PURE__ */ ge({
|
|
|
635
635
|
placement: "top",
|
|
636
636
|
"z-index": 999
|
|
637
637
|
}, {
|
|
638
|
-
content: q(() => [K("div", rr, [(A(!0), J(Se, null, Ae(
|
|
638
|
+
content: q(() => [K("div", rr, [(A(!0), J(Se, null, Ae(oe.value, (se) => (A(), J("div", {
|
|
639
639
|
key: se.locale
|
|
640
640
|
}, ye(se.name) + " (" + ye(se.localeDisplay) + ") ", 1))), 128))])]),
|
|
641
641
|
default: q(() => [s(X, {
|
|
642
642
|
variant: "tertiary",
|
|
643
643
|
icon: "g_translate",
|
|
644
|
-
onClick:
|
|
644
|
+
onClick: pe,
|
|
645
645
|
disabled: !E.value || !_.value.name
|
|
646
646
|
}, null, 8, ["disabled"])]),
|
|
647
647
|
_: 1
|
|
@@ -657,7 +657,7 @@ const gr = /* @__PURE__ */ ge({
|
|
|
657
657
|
placeholder: ((nt = d.fallback) == null ? void 0 : nt.name2) || e(k)("menu.product.form.detail.fields.name2.placeholder"),
|
|
658
658
|
label: e(k)("menu.product.form.detail.fields.name2.label"),
|
|
659
659
|
"onUpdate:modelValue": R[2] || (R[2] = (se) => c("update:form", "name2", e(Ft)(se, d.isOverride)))
|
|
660
|
-
}, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "label"]), K("div", ar, [s(
|
|
660
|
+
}, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "label"]), K("div", ar, [s(re, {
|
|
661
661
|
disabled: !_.value.description,
|
|
662
662
|
"model-value": d.form.description || "",
|
|
663
663
|
placeholder: ((Ue = d.fallback) == null ? void 0 : Ue.description) || e(k)("menu.product.form.detail.fields.description.placeholder"),
|
|
@@ -676,45 +676,45 @@ const gr = /* @__PURE__ */ ge({
|
|
|
676
676
|
}, ye(se.name) + " (" + ye(se.localeDisplay) + ") ", 1))), 128))])]),
|
|
677
677
|
default: q(() => {
|
|
678
678
|
var se;
|
|
679
|
-
return [
|
|
679
|
+
return [at(s(X, {
|
|
680
680
|
variant: "tertiary",
|
|
681
681
|
icon: "g_translate",
|
|
682
682
|
class: "cursor-pointer",
|
|
683
683
|
disabled: !(d.form.description || (se = d.fallback) != null && se.description) || !_.value.description,
|
|
684
684
|
onClick: O
|
|
685
|
-
}, null, 8, ["disabled"]), [[
|
|
685
|
+
}, null, 8, ["disabled"]), [[de, e(Dt)("Translate description")]])];
|
|
686
686
|
}),
|
|
687
687
|
_: 1
|
|
688
|
-
}),
|
|
688
|
+
}), at(s(e(vn), {
|
|
689
689
|
class: "cursor-pointer",
|
|
690
690
|
onClick: l
|
|
691
|
-
}, null, 512), [[
|
|
691
|
+
}, null, 512), [[de, e(Dt)("Suggest description")]])])]), s(Bn, {
|
|
692
692
|
disabled: !_.value.images,
|
|
693
693
|
"item-id": d.form._id || "",
|
|
694
694
|
"legacy-thumbnail": d.form.thumbnail ?? ((qt = d.fallback) == null ? void 0 : qt.thumbnail) ?? null,
|
|
695
695
|
"menu-items": e(m).state.menu.modules.item,
|
|
696
696
|
"model-value": d.form.images ?? ((Wt = d.fallback) == null ? void 0 : Wt.images) ?? null,
|
|
697
697
|
"onUpdate:modelValue": C
|
|
698
|
-
}, null, 8, ["disabled", "item-id", "legacy-thumbnail", "menu-items", "model-value"])]), s(
|
|
698
|
+
}, null, 8, ["disabled", "item-id", "legacy-thumbnail", "menu-items", "model-value"])]), s(Ke, {
|
|
699
699
|
label: e(m).isV4 ? e(k)("menu.product.form.detail.category.label") : e(k)("menu.product.form.detail.category.label_singular")
|
|
700
700
|
}, {
|
|
701
|
-
default: q(() => [n.value ? (A(),
|
|
701
|
+
default: q(() => [n.value ? (A(), ne(z, {
|
|
702
702
|
key: 0,
|
|
703
703
|
disabled: !_.value.category,
|
|
704
|
-
"model-value": d.isAddon ?
|
|
704
|
+
"model-value": d.isAddon ? Ge.ADD_ON : Ge.PRODUCT,
|
|
705
705
|
"onUpdate:modelValue": R[4] || (R[4] = (se) => g(se))
|
|
706
706
|
}, {
|
|
707
|
-
default: q(() => [K("div", dr, [K("div", cr, [s(
|
|
707
|
+
default: q(() => [K("div", dr, [K("div", cr, [s(ie, {
|
|
708
708
|
disabled: T.value,
|
|
709
|
-
value:
|
|
709
|
+
value: Ge.PRODUCT,
|
|
710
710
|
label: e(k)("menu.product.form.detail.category.options.product.label"),
|
|
711
711
|
sublabel: e(k)("menu.product.form.detail.category.options.product.sublabel")
|
|
712
712
|
}, null, 8, ["disabled", "value", "label", "sublabel"]), s(zn, null, {
|
|
713
|
-
default: q(() => [e(m).isV4 ? (A(),
|
|
713
|
+
default: q(() => [e(m).isV4 ? (A(), ne(x, {
|
|
714
714
|
key: 0
|
|
715
715
|
})) : Z("", !0)]),
|
|
716
716
|
_: 1
|
|
717
|
-
})]), T.value ? (A(), J("div", mr, [s(
|
|
717
|
+
})]), T.value ? (A(), J("div", mr, [s(ue, {
|
|
718
718
|
title: e(k)("menu.product.form.detail.category.add_first"),
|
|
719
719
|
variant: "info"
|
|
720
720
|
}, null, 8, ["title"]), s(we, {
|
|
@@ -722,14 +722,14 @@ const gr = /* @__PURE__ */ ge({
|
|
|
722
722
|
"prepend-icon": "add",
|
|
723
723
|
variant: "secondary",
|
|
724
724
|
onClick: e(r).create
|
|
725
|
-
}, null, 8, ["label", "onClick"])])) : Z("", !0), s(
|
|
726
|
-
value:
|
|
725
|
+
}, null, 8, ["label", "onClick"])])) : Z("", !0), s(ie, {
|
|
726
|
+
value: Ge.ADD_ON,
|
|
727
727
|
disabled: !1,
|
|
728
728
|
label: e(k)("menu.product.form.detail.category.options.addon.label"),
|
|
729
729
|
sublabel: e(k)("menu.product.form.detail.category.options.addon.sublabel")
|
|
730
730
|
}, null, 8, ["value", "label", "sublabel"])])]),
|
|
731
731
|
_: 1
|
|
732
|
-
}, 8, ["disabled", "model-value"])) : Z("", !0), e(m).isV4 ? Z("", !0) : (A(),
|
|
732
|
+
}, 8, ["disabled", "model-value"])) : Z("", !0), e(m).isV4 ? Z("", !0) : (A(), ne(j, {
|
|
733
733
|
key: 1,
|
|
734
734
|
"model-value": d.form.category,
|
|
735
735
|
rules: [(se) => !se && !d.isOverride ? "Category is required" : !0]
|
|
@@ -740,7 +740,7 @@ const gr = /* @__PURE__ */ ge({
|
|
|
740
740
|
_: 1
|
|
741
741
|
}, 8, ["model-value", "rules"]))]),
|
|
742
742
|
_: 1
|
|
743
|
-
}, 8, ["label"]), e(m).isV4 && !d.isAddon ? (A(),
|
|
743
|
+
}, 8, ["label"]), e(m).isV4 && !d.isAddon ? (A(), ne(Ke, {
|
|
744
744
|
key: 0,
|
|
745
745
|
label: e(k)("menu.product.form.detail.path.label")
|
|
746
746
|
}, {
|
|
@@ -753,7 +753,7 @@ const gr = /* @__PURE__ */ ge({
|
|
|
753
753
|
"is-local-only": !0
|
|
754
754
|
}, null, 8, ["modelValue", "items", "placeholder", "disabled"])])]),
|
|
755
755
|
_: 1
|
|
756
|
-
}, 8, ["label"])) : Z("", !0), e(m).isV4 && !d.isOverride ? (A(), J("div", fr, [s(
|
|
756
|
+
}, 8, ["label"])) : Z("", !0), e(m).isV4 && !d.isOverride ? (A(), J("div", fr, [s(le, {
|
|
757
757
|
label: e(k)("menu.product.form.detail.fields.shelf_life.label"),
|
|
758
758
|
"model-value": d.form.shelfLife ?? null,
|
|
759
759
|
rules: [(se) => se == null || se > 0 || e(k)("menu.common.validation.min_value", {
|
|
@@ -779,22 +779,22 @@ const gr = /* @__PURE__ */ ge({
|
|
|
779
779
|
}, 8, ["title"]), s(qn, {
|
|
780
780
|
modelValue: G.value,
|
|
781
781
|
"onUpdate:modelValue": R[9] || (R[9] = (Q) => G.value = Q),
|
|
782
|
-
"product-name": d.form.name || ((
|
|
782
|
+
"product-name": d.form.name || ((ae = d.fallback) == null ? void 0 : ae.name) || "",
|
|
783
783
|
"product-name-locale": d.form.name_locale,
|
|
784
|
-
"product-description": d.form.description || ((
|
|
784
|
+
"product-description": d.form.description || ((ge = d.fallback) == null ? void 0 : ge.description),
|
|
785
785
|
"product-description-locale": d.form.description_locale,
|
|
786
|
-
"initial-section":
|
|
787
|
-
"onUpdate:name":
|
|
788
|
-
"onUpdate:description":
|
|
789
|
-
"onUpdate:nameLocale":
|
|
786
|
+
"initial-section": B.value,
|
|
787
|
+
"onUpdate:name": te,
|
|
788
|
+
"onUpdate:description": ve,
|
|
789
|
+
"onUpdate:nameLocale": me,
|
|
790
790
|
"onUpdate:descriptionLocale": I
|
|
791
791
|
}, null, 8, ["modelValue", "product-name", "product-name-locale", "product-description", "product-description-locale", "initial-section"])], 64);
|
|
792
792
|
};
|
|
793
793
|
}
|
|
794
|
-
}), vr = /* @__PURE__ */
|
|
794
|
+
}), vr = /* @__PURE__ */ it(gr, [["__scopeId", "data-v-30393c7a"]]), br = /* @__PURE__ */ fe({
|
|
795
795
|
__name: "AddForm",
|
|
796
796
|
setup(i) {
|
|
797
|
-
const a =
|
|
797
|
+
const a = be(), t = M(() => a.rules.group), o = M(() => !!a.state.currentCatalogId || !!a.state.currentSchedulerId), m = M(() => {
|
|
798
798
|
const c = !a.state.currentSchedulerId, _ = a.rules.group.type, C = a.version === et.enum.v3, P = a.rules.item.orderFromActiveOnly, y = a.rules.item.bindToVariant;
|
|
799
799
|
return function(T) {
|
|
800
800
|
return {
|
|
@@ -816,13 +816,13 @@ const gr = /* @__PURE__ */ ge({
|
|
|
816
816
|
};
|
|
817
817
|
};
|
|
818
818
|
}), r = () => ({
|
|
819
|
-
...
|
|
819
|
+
...je.generator.initMenuV4Group(),
|
|
820
820
|
type: a.version === et.enum.v4 ? he.enum.PRODUCT : he.enum.NORMAL,
|
|
821
821
|
items: {},
|
|
822
822
|
position: a.groups.length - 1,
|
|
823
823
|
itemsLinked: []
|
|
824
824
|
}), b = ee(r()), { t: F } = _e();
|
|
825
|
-
return (c, _) => t.value.create ? (A(),
|
|
825
|
+
return (c, _) => t.value.create ? (A(), ne(e(Vr), {
|
|
826
826
|
key: 0,
|
|
827
827
|
"categorized-items": e(a).categorizedItems,
|
|
828
828
|
config: m.value,
|
|
@@ -835,12 +835,12 @@ const gr = /* @__PURE__ */ ge({
|
|
|
835
835
|
title: e(F)("menu.group.add")
|
|
836
836
|
}, {
|
|
837
837
|
default: q(({ trigger: C }) => [
|
|
838
|
-
|
|
838
|
+
Be(c.$slots, "default", { trigger: C })
|
|
839
839
|
]),
|
|
840
840
|
_: 3
|
|
841
841
|
}, 8, ["categorized-items", "config", "group", "title"])) : Z("", !0);
|
|
842
842
|
}
|
|
843
|
-
}), yr = { class: "fm-typo-en-title-sm-600" }, _r = { class: "flex items-end space-x-24" }, hr = { class: "flex" }, _n = /* @__PURE__ */
|
|
843
|
+
}), yr = { class: "fm-typo-en-title-sm-600" }, _r = { class: "flex items-end space-x-24" }, hr = { class: "flex" }, _n = /* @__PURE__ */ fe({
|
|
844
844
|
__name: "UpdateForm",
|
|
845
845
|
props: {
|
|
846
846
|
combinations: {},
|
|
@@ -851,7 +851,7 @@ const gr = /* @__PURE__ */ ge({
|
|
|
851
851
|
emits: ["update:combinations"],
|
|
852
852
|
setup(i, { expose: a, emit: t }) {
|
|
853
853
|
var D, u;
|
|
854
|
-
const o = i, m = t, r =
|
|
854
|
+
const o = i, m = t, r = be(), b = Qe(), F = Bt(bt(Ye())), c = ee([]), _ = ee(o.combinations[0].combinationKey || ""), C = M(
|
|
855
855
|
() => c.value.findIndex((f) => f.combinationKey == _.value)
|
|
856
856
|
), P = M(
|
|
857
857
|
() => o.combinations.map((f) => ({
|
|
@@ -944,7 +944,7 @@ const gr = /* @__PURE__ */ ge({
|
|
|
944
944
|
const { t: x } = _e();
|
|
945
945
|
return (f, N) => {
|
|
946
946
|
const h = H("fm-select"), g = H("fm-button"), U = H("fm-card");
|
|
947
|
-
return A(),
|
|
947
|
+
return A(), ne(hn, {
|
|
948
948
|
ref_key: "baseFormRef",
|
|
949
949
|
ref: $,
|
|
950
950
|
"allow-refund-inventory": !0,
|
|
@@ -958,10 +958,10 @@ const gr = /* @__PURE__ */ ge({
|
|
|
958
958
|
"onStatus:show": N[5] || (N[5] = (l) => V.value = l)
|
|
959
959
|
}, {
|
|
960
960
|
default: q(({ trigger: l }) => [
|
|
961
|
-
|
|
961
|
+
Be(f.$slots, "default", { trigger: l })
|
|
962
962
|
]),
|
|
963
963
|
"variant-section": q(() => [
|
|
964
|
-
_.value && !f.hideVariantSection ? (A(),
|
|
964
|
+
_.value && !f.hideVariantSection ? (A(), ne(U, {
|
|
965
965
|
key: 0,
|
|
966
966
|
class: "p-16 bg-fm-color-neutral-gray-100 space-y-24",
|
|
967
967
|
variant: "outlined"
|
|
@@ -1010,7 +1010,7 @@ const gr = /* @__PURE__ */ ge({
|
|
|
1010
1010
|
function Tr(i) {
|
|
1011
1011
|
return typeof i == "function" || Object.prototype.toString.call(i) === "[object Object]" && !xn(i);
|
|
1012
1012
|
}
|
|
1013
|
-
const xr = /* @__PURE__ */
|
|
1013
|
+
const xr = /* @__PURE__ */ fe({
|
|
1014
1014
|
__name: "OptionTable",
|
|
1015
1015
|
props: {
|
|
1016
1016
|
config: {},
|
|
@@ -1024,7 +1024,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1024
1024
|
setup(i, {
|
|
1025
1025
|
emit: a
|
|
1026
1026
|
}) {
|
|
1027
|
-
const t = i, o = a, m =
|
|
1027
|
+
const t = i, o = a, m = lt(), r = be(), b = M(() => Te.Country.getCountry(m.currentCountry.value)), F = ee(!1), c = M(() => t.config.isV4 || t.group.type === he.enum.PRODUCT), _ = M(() => c.value), C = M(() => c.value), P = M(() => Object.values(t.group.items).flatMap((I) => [{
|
|
1028
1028
|
_id: I._id,
|
|
1029
1029
|
combinationKey: void 0
|
|
1030
1030
|
}, ...(I.items ?? []).map((E) => ({
|
|
@@ -1042,7 +1042,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1042
1042
|
link: t.config.link(I),
|
|
1043
1043
|
name: t.config.name(I),
|
|
1044
1044
|
orderFrom: t.config.orderFrom(I)
|
|
1045
|
-
}), Y = M(() => !0), V = (I) => I ?
|
|
1045
|
+
}), Y = M(() => !0), V = (I) => I ? ze(I, !1) : "", $ = (I) => {
|
|
1046
1046
|
var E;
|
|
1047
1047
|
return I == null ? "" : (E = ko()[I]) == null ? void 0 : E.label;
|
|
1048
1048
|
}, x = M(() => Object.values(T.value)), D = ee({}), {
|
|
@@ -1062,11 +1062,11 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1062
1062
|
modelValue: R,
|
|
1063
1063
|
disabled: !S(d.combinationKey).isDefault,
|
|
1064
1064
|
"onUpdate:modelValue": (W) => {
|
|
1065
|
-
var
|
|
1065
|
+
var re;
|
|
1066
1066
|
if (E) {
|
|
1067
|
-
const
|
|
1068
|
-
if (!
|
|
1069
|
-
|
|
1067
|
+
const ie = (re = I.row.getParentRow()) == null ? void 0 : re.original;
|
|
1068
|
+
if (!ie) return;
|
|
1069
|
+
B(ie._id, d.combinationKey ?? "", "isDefault", W);
|
|
1070
1070
|
} else
|
|
1071
1071
|
G(d._id, "isDefault", W);
|
|
1072
1072
|
}
|
|
@@ -1095,26 +1095,26 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1095
1095
|
enableSorting: !1,
|
|
1096
1096
|
cell: (I) => {
|
|
1097
1097
|
var X;
|
|
1098
|
-
const E = I.getValue(), d = I.row.original, R = I.row.depth > 0, L = d.combinationKey ? $t(d.combinationKey,
|
|
1098
|
+
const E = I.getValue(), d = I.row.original, R = I.row.depth > 0, L = d.combinationKey ? $t(d.combinationKey, be().variants) : r.rules.group.linkAddonName ? (X = h.value[d._id]) == null ? void 0 : X.name : null;
|
|
1099
1099
|
return Ie("div", Ie(Ce.FmTextField, {
|
|
1100
1100
|
modelValue: E,
|
|
1101
1101
|
placeholder: L ?? "",
|
|
1102
1102
|
disabled: !S(d.combinationKey).name,
|
|
1103
1103
|
rules: L ? void 0 : [(W) => ((W == null ? void 0 : W.length) ?? 0) > 0 || u("menu.group.option.product_title_required")],
|
|
1104
1104
|
"onUpdate:modelValue": (W) => {
|
|
1105
|
-
var
|
|
1105
|
+
var re;
|
|
1106
1106
|
if (R) {
|
|
1107
|
-
const
|
|
1108
|
-
if (!
|
|
1109
|
-
|
|
1107
|
+
const ie = (re = I.row.getParentRow()) == null ? void 0 : re.original;
|
|
1108
|
+
if (!ie) return;
|
|
1109
|
+
B(ie._id, d.combinationKey ?? "", "name", W || null);
|
|
1110
1110
|
} else
|
|
1111
1111
|
G(d._id, "name", W || null);
|
|
1112
1112
|
},
|
|
1113
1113
|
class: "min-w-[300px]"
|
|
1114
1114
|
}, {
|
|
1115
1115
|
append: () => {
|
|
1116
|
-
var W,
|
|
1117
|
-
return (
|
|
1116
|
+
var W, re;
|
|
1117
|
+
return (re = (W = I.row.original) == null ? void 0 : W.items) != null && re.length ? Ie(Ce.FmIcon, {
|
|
1118
1118
|
name: "keyboard_arrow_up",
|
|
1119
1119
|
onClick: I.row.getToggleExpandedHandler(),
|
|
1120
1120
|
class: ["cursor-pointer", "transition-transform", I.row.getIsExpanded() ? "transform rotate-180" : ""],
|
|
@@ -1134,30 +1134,30 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1134
1134
|
},
|
|
1135
1135
|
size: 400,
|
|
1136
1136
|
cell: (I) => {
|
|
1137
|
-
const E = I.getValue(), d = I.row.original, R = !S(null).priceEdit || d.orderFrom === ct.enum.NONE, L = d.fallbackPrice, X = I.row.depth > 0, W = f.getMemberPricingPriceVariant(d.price_variant),
|
|
1137
|
+
const E = I.getValue(), d = I.row.original, R = !S(null).priceEdit || d.orderFrom === ct.enum.NONE, L = d.fallbackPrice, X = I.row.depth > 0, W = f.getMemberPricingPriceVariant(d.price_variant), re = Object.values(W).every((ie) => ie === null);
|
|
1138
1138
|
return s("div", {
|
|
1139
1139
|
class: "flex items-center gap-8"
|
|
1140
1140
|
}, [s(Ze, {
|
|
1141
1141
|
disable: R,
|
|
1142
|
-
placeholder: L ?
|
|
1142
|
+
placeholder: L ? ze(L) : void 0,
|
|
1143
1143
|
modelValue: E,
|
|
1144
1144
|
required: !L && !R,
|
|
1145
1145
|
nullable: !!L,
|
|
1146
1146
|
min: Y.value ? void 0 : 0,
|
|
1147
|
-
"onUpdate:model-value": (
|
|
1148
|
-
var
|
|
1147
|
+
"onUpdate:model-value": (ie) => {
|
|
1148
|
+
var ue;
|
|
1149
1149
|
if (X) {
|
|
1150
|
-
const we = (
|
|
1150
|
+
const we = (ue = I.row.getParentRow()) == null ? void 0 : ue.original;
|
|
1151
1151
|
if (!we) return;
|
|
1152
|
-
|
|
1152
|
+
B(
|
|
1153
1153
|
we._id,
|
|
1154
1154
|
d.combinationKey ?? "",
|
|
1155
1155
|
// @ts-ignore
|
|
1156
1156
|
"price",
|
|
1157
|
-
|
|
1157
|
+
ie
|
|
1158
1158
|
);
|
|
1159
1159
|
} else
|
|
1160
|
-
G(d._id, "price",
|
|
1160
|
+
G(d._id, "price", ie);
|
|
1161
1161
|
},
|
|
1162
1162
|
showCurrency: !1,
|
|
1163
1163
|
class: "min-w-[88px]"
|
|
@@ -1169,32 +1169,32 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1169
1169
|
priceVariants: W,
|
|
1170
1170
|
showRemy: !1,
|
|
1171
1171
|
basePrice: E,
|
|
1172
|
-
basePriceFallback: L ?
|
|
1173
|
-
"onUpdate:value": (
|
|
1172
|
+
basePriceFallback: L ? ze(L) : void 0,
|
|
1173
|
+
"onUpdate:value": (ie) => {
|
|
1174
1174
|
var we;
|
|
1175
|
-
const
|
|
1176
|
-
price:
|
|
1177
|
-
price_variant: Lt(
|
|
1175
|
+
const ue = {
|
|
1176
|
+
price: ie.basePrice,
|
|
1177
|
+
price_variant: Lt(ie.priceVariants)
|
|
1178
1178
|
};
|
|
1179
1179
|
if (X) {
|
|
1180
|
-
const
|
|
1181
|
-
if (!
|
|
1182
|
-
z
|
|
1180
|
+
const z = (we = I.row.getParentRow()) == null ? void 0 : we.original;
|
|
1181
|
+
if (!z) return;
|
|
1182
|
+
B(z._id, d.combinationKey ?? "", ue);
|
|
1183
1183
|
} else
|
|
1184
|
-
G(d._id,
|
|
1184
|
+
G(d._id, ue);
|
|
1185
1185
|
}
|
|
1186
1186
|
}, {
|
|
1187
1187
|
default: ({
|
|
1188
|
-
trigger:
|
|
1188
|
+
trigger: ie
|
|
1189
1189
|
}) => s(Ce.FmButton, {
|
|
1190
1190
|
variant: Pe.Plain,
|
|
1191
1191
|
label: u("menu.product.form.member_price.configure.title"),
|
|
1192
|
-
onClick: () =>
|
|
1192
|
+
onClick: () => ie()
|
|
1193
1193
|
}, {
|
|
1194
1194
|
default: () => s("span", {
|
|
1195
1195
|
class: "underline line-clamp-2 break-all"
|
|
1196
|
-
}, [
|
|
1197
|
-
num: Object.values(W).filter((
|
|
1196
|
+
}, [re ? u("menu.product.form.member_price.configure.title") : u("menu.product.form.member_price.configure.title_with_tier", {
|
|
1197
|
+
num: Object.values(W).filter((ue) => ue !== null).length
|
|
1198
1198
|
})])
|
|
1199
1199
|
})
|
|
1200
1200
|
}), s(Gt, {
|
|
@@ -1218,10 +1218,10 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1218
1218
|
"onUpdate:modelValue": (X) => {
|
|
1219
1219
|
var W;
|
|
1220
1220
|
if (L) {
|
|
1221
|
-
const
|
|
1222
|
-
if (!
|
|
1223
|
-
|
|
1224
|
-
|
|
1221
|
+
const re = (W = I.row.getParentRow()) == null ? void 0 : W.original;
|
|
1222
|
+
if (!re) return;
|
|
1223
|
+
B(
|
|
1224
|
+
re._id,
|
|
1225
1225
|
d.combinationKey ?? "",
|
|
1226
1226
|
// @ts-ignore
|
|
1227
1227
|
"orderFrom",
|
|
@@ -1271,10 +1271,10 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1271
1271
|
"onUpdate:priceTiers": (X) => {
|
|
1272
1272
|
var W;
|
|
1273
1273
|
if (d) {
|
|
1274
|
-
const
|
|
1275
|
-
if (!
|
|
1276
|
-
|
|
1277
|
-
|
|
1274
|
+
const re = (W = I.row.getParentRow()) == null ? void 0 : W.original;
|
|
1275
|
+
if (!re) return;
|
|
1276
|
+
B(
|
|
1277
|
+
re._id,
|
|
1278
1278
|
E.combinationKey ?? "",
|
|
1279
1279
|
// @ts-ignore
|
|
1280
1280
|
"priceTiers",
|
|
@@ -1291,10 +1291,10 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1291
1291
|
"onUpdate:inventory": (X) => {
|
|
1292
1292
|
var W;
|
|
1293
1293
|
if (d) {
|
|
1294
|
-
const
|
|
1295
|
-
if (!
|
|
1296
|
-
|
|
1297
|
-
|
|
1294
|
+
const re = (W = I.row.getParentRow()) == null ? void 0 : W.original;
|
|
1295
|
+
if (!re) return;
|
|
1296
|
+
B(
|
|
1297
|
+
re._id,
|
|
1298
1298
|
E.combinationKey ?? "",
|
|
1299
1299
|
// @ts-ignore
|
|
1300
1300
|
"inventoryBindings",
|
|
@@ -1343,14 +1343,14 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1343
1343
|
groupId: X._id,
|
|
1344
1344
|
hideVariantSection: !0,
|
|
1345
1345
|
"onUpdate:combinations": (W) => {
|
|
1346
|
-
var
|
|
1347
|
-
const
|
|
1346
|
+
var ie, ue;
|
|
1347
|
+
const re = ((ie = W[0]) == null ? void 0 : ie.groups) || [];
|
|
1348
1348
|
if (d) {
|
|
1349
|
-
const we = (
|
|
1349
|
+
const we = (ue = I.row.getParentRow()) == null ? void 0 : ue.original;
|
|
1350
1350
|
if (!we) return;
|
|
1351
|
-
|
|
1351
|
+
B(we._id, E.combinationKey ?? "", "groups", re);
|
|
1352
1352
|
} else
|
|
1353
|
-
G(E._id, "groups",
|
|
1353
|
+
G(E._id, "groups", re);
|
|
1354
1354
|
}
|
|
1355
1355
|
}, {
|
|
1356
1356
|
default: ({
|
|
@@ -1368,7 +1368,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1368
1368
|
textColor: Re.NeutralGray400,
|
|
1369
1369
|
disabled: d,
|
|
1370
1370
|
onClick: () => {
|
|
1371
|
-
|
|
1371
|
+
oe(E._id);
|
|
1372
1372
|
}
|
|
1373
1373
|
}, null)]);
|
|
1374
1374
|
}
|
|
@@ -1432,11 +1432,11 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1432
1432
|
}
|
|
1433
1433
|
});
|
|
1434
1434
|
}
|
|
1435
|
-
function
|
|
1436
|
-
var
|
|
1437
|
-
const L = ke(t.group), X = (
|
|
1435
|
+
function B(I, E, d, R) {
|
|
1436
|
+
var re, ie;
|
|
1437
|
+
const L = ke(t.group), X = (re = L.items[I].items) == null ? void 0 : re.findIndex((ue) => ue.combinationKey === E);
|
|
1438
1438
|
if (!zt.isSet(X)) return;
|
|
1439
|
-
let W = (
|
|
1439
|
+
let W = (ie = L.items[I].items) == null ? void 0 : ie[X];
|
|
1440
1440
|
W && (typeof d == "object" && d !== null ? W = {
|
|
1441
1441
|
...W,
|
|
1442
1442
|
...d
|
|
@@ -1445,7 +1445,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1445
1445
|
[d]: R
|
|
1446
1446
|
}, L.items[I].items[X] = W, o("update:group", L));
|
|
1447
1447
|
}
|
|
1448
|
-
function
|
|
1448
|
+
function oe(I) {
|
|
1449
1449
|
const E = ke(t.group);
|
|
1450
1450
|
delete E.items[I], o("update:group", E);
|
|
1451
1451
|
}
|
|
@@ -1455,7 +1455,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1455
1455
|
price: E.price,
|
|
1456
1456
|
variants: wo(((d = E.variant) == null ? void 0 : d.variantCombinations) || [], "combinationKey")
|
|
1457
1457
|
}, I;
|
|
1458
|
-
}, {})),
|
|
1458
|
+
}, {})), pe = async (I) => {
|
|
1459
1459
|
let E = ln(t.group);
|
|
1460
1460
|
E = {
|
|
1461
1461
|
...E,
|
|
@@ -1471,17 +1471,17 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1471
1471
|
})
|
|
1472
1472
|
}, o("update:unmap-group", E);
|
|
1473
1473
|
}, O = (I) => I.items;
|
|
1474
|
-
function
|
|
1474
|
+
function te(I) {
|
|
1475
1475
|
const E = ke(t.group);
|
|
1476
1476
|
E.items = I.reduce((d, R) => ({
|
|
1477
1477
|
...d,
|
|
1478
1478
|
[R._id]: R
|
|
1479
1479
|
}), {}), o("update:group", E);
|
|
1480
1480
|
}
|
|
1481
|
-
const
|
|
1481
|
+
const ve = _o(), me = M(() => ve.breakpoints.value.xs);
|
|
1482
1482
|
return (I, E) => {
|
|
1483
1483
|
const d = H("fm-button"), R = H("fm-table");
|
|
1484
|
-
return A(),
|
|
1484
|
+
return A(), ne(Me, {
|
|
1485
1485
|
title: e(u)("menu.group.option.title")
|
|
1486
1486
|
}, {
|
|
1487
1487
|
"append-title": q(() => [I.config.link() ? (A(), J(Se, {
|
|
@@ -1495,7 +1495,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1495
1495
|
"is-local-only": !0,
|
|
1496
1496
|
onSubmit: E[0] || (E[0] = ({
|
|
1497
1497
|
items: L
|
|
1498
|
-
}) =>
|
|
1498
|
+
}) => pe(L))
|
|
1499
1499
|
}, {
|
|
1500
1500
|
default: q(({
|
|
1501
1501
|
trigger: L
|
|
@@ -1519,7 +1519,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1519
1519
|
default: q(() => [K("div", Cr, [K("div", Ir, [s(R, {
|
|
1520
1520
|
"column-defs": N.value,
|
|
1521
1521
|
"column-visibility": p.value,
|
|
1522
|
-
draggable: !
|
|
1522
|
+
draggable: !me.value && S(null).name,
|
|
1523
1523
|
"expanded-state": F.value ? {} : D.value,
|
|
1524
1524
|
"get-sub-row": O,
|
|
1525
1525
|
"page-size": 999,
|
|
@@ -1528,7 +1528,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1528
1528
|
"shrink-at": !1,
|
|
1529
1529
|
"hide-footer": "",
|
|
1530
1530
|
"onUpdate:expandedState": E[1] || (E[1] = (L) => D.value = L),
|
|
1531
|
-
onDndChanged: E[2] || (E[2] = (L) =>
|
|
1531
|
+
onDndChanged: E[2] || (E[2] = (L) => te(L)),
|
|
1532
1532
|
"onUpdate:dragging": E[3] || (E[3] = (L) => F.value = L)
|
|
1533
1533
|
}, null, 8, ["column-defs", "column-visibility", "draggable", "expanded-state", "row-data", "search-value"])])])]),
|
|
1534
1534
|
_: 1
|
|
@@ -1538,7 +1538,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1538
1538
|
}), Sr = { class: "fm-typo-en-title-md-600" }, Er = {
|
|
1539
1539
|
key: 0,
|
|
1540
1540
|
class: "pt-8 space-y-32"
|
|
1541
|
-
}, Fr = { class: "flex gap-8 items-center justify-start" }, hn = /* @__PURE__ */
|
|
1541
|
+
}, Fr = { class: "flex gap-8 items-center justify-start" }, hn = /* @__PURE__ */ fe({
|
|
1542
1542
|
__name: "BaseForm",
|
|
1543
1543
|
props: {
|
|
1544
1544
|
title: {},
|
|
@@ -1551,7 +1551,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1551
1551
|
emits: ["update:group", "submit:group", "status:show"],
|
|
1552
1552
|
setup(i, { expose: a, emit: t }) {
|
|
1553
1553
|
let o = i;
|
|
1554
|
-
const m = t, r =
|
|
1554
|
+
const m = t, r = be(), b = lt(), F = Qe(), c = Bt(bt(Ye())), { countDefaultItems: _, validateGroupItems: C, minMaxValidationRules: P } = Jn(
|
|
1555
1555
|
() => o.group
|
|
1556
1556
|
), y = ee(!1), n = ee(!1), T = (p) => {
|
|
1557
1557
|
zt.isBoolean(p) ? n.value = p : n.value = !n.value;
|
|
@@ -1636,8 +1636,8 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1636
1636
|
const p = {};
|
|
1637
1637
|
return r.state.menu.modules.group.forEach((k) => {
|
|
1638
1638
|
var G;
|
|
1639
|
-
for (const [
|
|
1640
|
-
typeof
|
|
1639
|
+
for (const [B, oe] of Object.entries(k.customAttributes || {}))
|
|
1640
|
+
typeof oe == "string" && oe && !((G = p[B]) != null && G.includes(oe)) && (p[B] = [...p[B] || [], oe]);
|
|
1641
1641
|
}), p;
|
|
1642
1642
|
}), v = (p) => {
|
|
1643
1643
|
o.group && x({
|
|
@@ -1651,10 +1651,10 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1651
1651
|
});
|
|
1652
1652
|
const { t: w } = _e();
|
|
1653
1653
|
return (p, k) => {
|
|
1654
|
-
const G = H("fm-text-field"),
|
|
1654
|
+
const G = H("fm-text-field"), B = H("fm-stepper-field"), oe = H("FmFormGroup"), ce = H("fm-radio"), pe = H("fm-radio-group"), O = H("fm-switch"), te = H("FormSection"), ve = H("fm-button"), me = H("fm-side-sheet");
|
|
1655
1655
|
return A(), J(Se, null, [
|
|
1656
|
-
|
|
1657
|
-
s(
|
|
1656
|
+
Be(p.$slots, "default", { trigger: T }),
|
|
1657
|
+
s(me, {
|
|
1658
1658
|
id: "group-form",
|
|
1659
1659
|
modelValue: n.value,
|
|
1660
1660
|
"onUpdate:modelValue": k[8] || (k[8] = (I) => n.value = I),
|
|
@@ -1671,14 +1671,14 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1671
1671
|
]),
|
|
1672
1672
|
"side-sheet-footer": q(() => [
|
|
1673
1673
|
K("div", Fr, [
|
|
1674
|
-
s(
|
|
1674
|
+
s(ve, {
|
|
1675
1675
|
label: e(Oo)(h.value),
|
|
1676
1676
|
loading: y.value,
|
|
1677
1677
|
size: "lg",
|
|
1678
1678
|
type: "submit",
|
|
1679
1679
|
variant: "primary"
|
|
1680
1680
|
}, null, 8, ["label", "loading"]),
|
|
1681
|
-
s(
|
|
1681
|
+
s(ve, {
|
|
1682
1682
|
label: e(w)("menu.common.actions.cancel"),
|
|
1683
1683
|
size: "lg",
|
|
1684
1684
|
variant: "tertiary",
|
|
@@ -1688,7 +1688,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1688
1688
|
]),
|
|
1689
1689
|
default: q(() => [
|
|
1690
1690
|
p.group ? (A(), J("div", Er, [
|
|
1691
|
-
|
|
1691
|
+
Be(p.$slots, "variant-section"),
|
|
1692
1692
|
s(So, null, {
|
|
1693
1693
|
default: q(() => [
|
|
1694
1694
|
K("div", null, [
|
|
@@ -1703,14 +1703,14 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1703
1703
|
label: e(w)("menu.common.labels.group_name")
|
|
1704
1704
|
}, null, 8, ["modelValue", "disabled", "rules", "label"])
|
|
1705
1705
|
]),
|
|
1706
|
-
s(
|
|
1706
|
+
s(oe, {
|
|
1707
1707
|
"model-value": p.group,
|
|
1708
1708
|
rules: e(P)
|
|
1709
1709
|
}, {
|
|
1710
1710
|
default: q(() => [
|
|
1711
1711
|
s(eo, null, {
|
|
1712
1712
|
default: q(() => [
|
|
1713
|
-
s(
|
|
1713
|
+
s(B, {
|
|
1714
1714
|
modelValue: p.group.min,
|
|
1715
1715
|
"onUpdate:modelValue": k[1] || (k[1] = (I) => p.group.min = I),
|
|
1716
1716
|
disabled: V("min"),
|
|
@@ -1718,7 +1718,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1718
1718
|
class: "flex-1",
|
|
1719
1719
|
label: e(w)("menu.common.labels.min_select")
|
|
1720
1720
|
}, null, 8, ["modelValue", "disabled", "label"]),
|
|
1721
|
-
s(
|
|
1721
|
+
s(B, {
|
|
1722
1722
|
modelValue: p.group.max,
|
|
1723
1723
|
"onUpdate:modelValue": k[2] || (k[2] = (I) => p.group.max = I),
|
|
1724
1724
|
disabled: V("max"),
|
|
@@ -1732,18 +1732,18 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1732
1732
|
]),
|
|
1733
1733
|
_: 1
|
|
1734
1734
|
}, 8, ["model-value", "rules"]),
|
|
1735
|
-
S.value.type ? (A(),
|
|
1735
|
+
S.value.type ? (A(), ne(Ke, {
|
|
1736
1736
|
key: 0,
|
|
1737
1737
|
label: e(w)("menu.common.labels.group_type")
|
|
1738
1738
|
}, {
|
|
1739
1739
|
default: q(() => [
|
|
1740
|
-
s(
|
|
1740
|
+
s(pe, {
|
|
1741
1741
|
disabled: V("type"),
|
|
1742
1742
|
"model-value": p.group.type,
|
|
1743
1743
|
"onUpdate:modelValue": k[3] || (k[3] = (I) => D(I))
|
|
1744
1744
|
}, {
|
|
1745
1745
|
default: q(() => [
|
|
1746
|
-
(A(!0), J(Se, null, Ae($.value, (I) => (A(),
|
|
1746
|
+
(A(!0), J(Se, null, Ae($.value, (I) => (A(), ne(ce, {
|
|
1747
1747
|
key: I.value,
|
|
1748
1748
|
label: e(w)(`menu.group.types.${I.label.toLowerCase()}`),
|
|
1749
1749
|
value: I.value
|
|
@@ -1754,7 +1754,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1754
1754
|
]),
|
|
1755
1755
|
_: 1
|
|
1756
1756
|
}, 8, ["label"])) : Z("", !0),
|
|
1757
|
-
s(
|
|
1757
|
+
s(Ke, {
|
|
1758
1758
|
label: e(w)("menu.common.labels.configuration")
|
|
1759
1759
|
}, {
|
|
1760
1760
|
default: q(() => [
|
|
@@ -1769,7 +1769,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1769
1769
|
]),
|
|
1770
1770
|
_: 1
|
|
1771
1771
|
}, 8, ["label"]),
|
|
1772
|
-
U.value ? (A(), te
|
|
1772
|
+
U.value ? (A(), ne(te, {
|
|
1773
1773
|
key: 1,
|
|
1774
1774
|
title: e(w)("menu.group.form.tagging.title"),
|
|
1775
1775
|
"sub-title": e(w)("menu.group.form.tagging.subtitle")
|
|
@@ -1787,7 +1787,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1787
1787
|
]),
|
|
1788
1788
|
_: 1
|
|
1789
1789
|
}),
|
|
1790
|
-
s(
|
|
1790
|
+
s(oe, {
|
|
1791
1791
|
tag: "div",
|
|
1792
1792
|
modelValue: p.group,
|
|
1793
1793
|
rules: [e(C)],
|
|
@@ -1821,13 +1821,13 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1821
1821
|
}, Dr = { class: "flex-1 flex-shrink space-y-8 min-h-0 overflow-y-scroll p-8" }, Or = { class: "flex justify-between pb-16" }, Mr = { class: "flex gap-8" }, Ur = {
|
|
1822
1822
|
key: 1,
|
|
1823
1823
|
class: "flex flex-col items-center space-y-16"
|
|
1824
|
-
}, Rr = { class: "flex flex-col items-center space-y-4 w-full" }, Ar = { class: "fm-typo-en-title-sm-600" }, Nr = { class: "text-fm-color-typo-secondary" }, Lr = /* @__PURE__ */
|
|
1824
|
+
}, Rr = { class: "flex flex-col items-center space-y-4 w-full" }, Ar = { class: "fm-typo-en-title-sm-600" }, Nr = { class: "text-fm-color-typo-secondary" }, Lr = /* @__PURE__ */ fe({
|
|
1825
1825
|
__name: "SelectGroupDialog",
|
|
1826
1826
|
props: {
|
|
1827
1827
|
groupIds: {}
|
|
1828
1828
|
},
|
|
1829
1829
|
setup(i) {
|
|
1830
|
-
const a = i, t = Qe(), { emitData: o, emitAction: m } = pn(), r =
|
|
1830
|
+
const a = i, t = Qe(), { emitData: o, emitAction: m } = pn(), r = be(), b = M(() => r.rules.group), F = M(() => r.groups);
|
|
1831
1831
|
function c(Y) {
|
|
1832
1832
|
return ke(Y ?? []).sort(($, x) => $.position - x.position);
|
|
1833
1833
|
}
|
|
@@ -1862,7 +1862,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1862
1862
|
};
|
|
1863
1863
|
};
|
|
1864
1864
|
}), M(() => ({
|
|
1865
|
-
...
|
|
1865
|
+
...je.generator.initMenuV4Group(),
|
|
1866
1866
|
type: r.version === et.enum.v4 ? he.enum.PRODUCT : he.enum.NORMAL,
|
|
1867
1867
|
items: {},
|
|
1868
1868
|
position: r.groups.length - 1,
|
|
@@ -1887,7 +1887,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1887
1887
|
(A(!0), J(Se, null, Ae(C.value, (u) => (A(), J("div", {
|
|
1888
1888
|
key: u.value
|
|
1889
1889
|
}, [
|
|
1890
|
-
|
|
1890
|
+
at(s(x, {
|
|
1891
1891
|
modelValue: y.value,
|
|
1892
1892
|
"onUpdate:modelValue": [
|
|
1893
1893
|
V[1] || (V[1] = (f) => y.value = f),
|
|
@@ -1943,7 +1943,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1943
1943
|
]));
|
|
1944
1944
|
};
|
|
1945
1945
|
}
|
|
1946
|
-
}), Gr = /* @__PURE__ */
|
|
1946
|
+
}), Gr = /* @__PURE__ */ fe({
|
|
1947
1947
|
__name: "ProductGroup",
|
|
1948
1948
|
props: {
|
|
1949
1949
|
isOverride: {
|
|
@@ -1960,7 +1960,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1960
1960
|
setup(i, {
|
|
1961
1961
|
emit: a
|
|
1962
1962
|
}) {
|
|
1963
|
-
const t = i, o =
|
|
1963
|
+
const t = i, o = be(), m = Ye(), r = Qe(), {
|
|
1964
1964
|
t: b
|
|
1965
1965
|
} = _e(), F = a, c = M(() => o.rules.group), _ = M(() => o.rules.item), C = M(() => o.groups);
|
|
1966
1966
|
function P(l, v) {
|
|
@@ -1988,11 +1988,11 @@ const xr = /* @__PURE__ */ ge({
|
|
|
1988
1988
|
return v.items.forEach((k) => {
|
|
1989
1989
|
if (k.combinationKey)
|
|
1990
1990
|
return;
|
|
1991
|
-
const G = o.items.find((
|
|
1991
|
+
const G = o.items.find((oe) => oe._id === k._id), B = v.items.filter((oe) => oe._id === k._id && oe.combinationKey).length;
|
|
1992
1992
|
w.push({
|
|
1993
1993
|
code: k.code || (G == null ? void 0 : G.code),
|
|
1994
1994
|
name: k.name || (G == null ? void 0 : G.name),
|
|
1995
|
-
variantCount:
|
|
1995
|
+
variantCount: B
|
|
1996
1996
|
});
|
|
1997
1997
|
}), w.map((k) => {
|
|
1998
1998
|
const G = [(k == null ? void 0 : k.code) || "", (k == null ? void 0 : k.name) || ""].join(" ").trim();
|
|
@@ -2117,12 +2117,12 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2117
2117
|
return;
|
|
2118
2118
|
}
|
|
2119
2119
|
const w = l.reduce((k, G) => {
|
|
2120
|
-
var
|
|
2121
|
-
const
|
|
2120
|
+
var oe;
|
|
2121
|
+
const B = ((oe = t.form.groups) == null ? void 0 : oe.find((ce) => ce._id === G)) || {
|
|
2122
2122
|
_id: G,
|
|
2123
2123
|
groupKey: ""
|
|
2124
2124
|
};
|
|
2125
|
-
return k.push(
|
|
2125
|
+
return k.push(B), k;
|
|
2126
2126
|
}, []);
|
|
2127
2127
|
F("replace:form", Ht(o, {
|
|
2128
2128
|
...t.form,
|
|
@@ -2136,7 +2136,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2136
2136
|
const v = ke(t.form.groups);
|
|
2137
2137
|
v.splice(v.findIndex((G) => G._id === l), 1);
|
|
2138
2138
|
for (const G of ((w = t.form.variant) == null ? void 0 : w.variantCombinations) || [])
|
|
2139
|
-
(k = G.groups) == null || k.splice((p = G.groups) == null ? void 0 : p.findIndex((
|
|
2139
|
+
(k = G.groups) == null || k.splice((p = G.groups) == null ? void 0 : p.findIndex((B) => B._id === l), 1);
|
|
2140
2140
|
F("replace:form", Ht(o, {
|
|
2141
2141
|
...t.form,
|
|
2142
2142
|
groups: v
|
|
@@ -2181,7 +2181,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2181
2181
|
};
|
|
2182
2182
|
return (l, v) => {
|
|
2183
2183
|
const w = H("FmButton"), p = H("FmTable");
|
|
2184
|
-
return A(),
|
|
2184
|
+
return A(), ne(Me, {
|
|
2185
2185
|
title: e(b)("menu.product.form.group.title"),
|
|
2186
2186
|
"sub-title": e(b)("menu.product.form.group.subtitle"),
|
|
2187
2187
|
id: e(De).GROUP
|
|
@@ -2196,7 +2196,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2196
2196
|
default: q(() => [s(dn, null, {
|
|
2197
2197
|
default: q(() => {
|
|
2198
2198
|
var k;
|
|
2199
|
-
return [((k = y.value) == null ? void 0 : k.length) > 0 ? (A(),
|
|
2199
|
+
return [((k = y.value) == null ? void 0 : k.length) > 0 ? (A(), ne(p, {
|
|
2200
2200
|
key: 0,
|
|
2201
2201
|
"column-defs": V.value,
|
|
2202
2202
|
"column-visibility": $.value,
|
|
@@ -2219,7 +2219,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2219
2219
|
class: "xs:overflow-x-scroll"
|
|
2220
2220
|
}, Br = {
|
|
2221
2221
|
class: "xs:min-w-[640px]"
|
|
2222
|
-
}, zr = /* @__PURE__ */
|
|
2222
|
+
}, zr = /* @__PURE__ */ fe({
|
|
2223
2223
|
__name: "ProductInventory",
|
|
2224
2224
|
props: {
|
|
2225
2225
|
isOverride: {
|
|
@@ -2238,7 +2238,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2238
2238
|
}) {
|
|
2239
2239
|
const {
|
|
2240
2240
|
t
|
|
2241
|
-
} = _e(), o = i, m = a, r =
|
|
2241
|
+
} = _e(), o = i, m = a, r = be(), b = M(() => r.rules.item), F = M(() => b.value.inventory), c = M(() => r.state.menu.lowStockThreshold), _ = M(() => o.form.lowStockThreshold), C = M(() => c.value != null ? String(c.value) : t("menu.inventory.threshold.not_set"));
|
|
2242
2242
|
function P(x) {
|
|
2243
2243
|
const D = Ve.clone(o.form);
|
|
2244
2244
|
D.lowStockThreshold = x === null ? void 0 : x, m("replace:form", D);
|
|
@@ -2352,7 +2352,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2352
2352
|
title: e(t)("menu.inventory.title"),
|
|
2353
2353
|
subTitle: e(t)("menu.inventory.subtitle")
|
|
2354
2354
|
}, {
|
|
2355
|
-
default: q(() => [K("div", Kr, [K("div", Br, [(A(!0), J(Se, null, Ae(T.value, (f) => (A(),
|
|
2355
|
+
default: q(() => [K("div", Kr, [K("div", Br, [(A(!0), J(Se, null, Ae(T.value, (f) => (A(), ne(e(Vt), {
|
|
2356
2356
|
key: f._id,
|
|
2357
2357
|
ref_for: !0,
|
|
2358
2358
|
ref_key: "inventoryManagerForms",
|
|
@@ -2406,7 +2406,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2406
2406
|
}, aa = { class: "w-[258px] xs:w-full" }, la = {
|
|
2407
2407
|
key: 1,
|
|
2408
2408
|
class: "space-y-8"
|
|
2409
|
-
}, ia = { class: "pl-32 pb-4 flex space-x-16" }, sa = { class: "w-[258px] xs:w-full" }, ua = /* @__PURE__ */
|
|
2409
|
+
}, ia = { class: "pl-32 pb-4 flex space-x-16" }, sa = { class: "w-[258px] xs:w-full" }, ua = /* @__PURE__ */ fe({
|
|
2410
2410
|
__name: "ProductPrice",
|
|
2411
2411
|
props: {
|
|
2412
2412
|
isOverride: { type: Boolean },
|
|
@@ -2416,7 +2416,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2416
2416
|
},
|
|
2417
2417
|
emits: ["update:form"],
|
|
2418
2418
|
setup(i, { emit: a }) {
|
|
2419
|
-
const t = i, o =
|
|
2419
|
+
const t = i, o = lt(), m = be(), { t: r } = _e(), b = a, F = M(() => m.rules.item), c = M(() => {
|
|
2420
2420
|
var N, h;
|
|
2421
2421
|
const u = t.isOverride ? ((N = t.fallback) == null ? void 0 : N.unit) ?? ((h = t.fallback) == null ? void 0 : h.perXUnit) : void 0, f = t.form.unit ?? t.form.perXUnit ?? u;
|
|
2422
2422
|
return f != null;
|
|
@@ -2475,7 +2475,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2475
2475
|
}
|
|
2476
2476
|
return (u, f) => {
|
|
2477
2477
|
const N = H("fm-select"), h = H("FmButton"), g = H("fm-checkbox"), U = H("fm-text-field"), l = nn("tooltip");
|
|
2478
|
-
return A(),
|
|
2478
|
+
return A(), ne(Me, {
|
|
2479
2479
|
title: e(r)("menu.product.form.price.title")
|
|
2480
2480
|
}, {
|
|
2481
2481
|
default: q(() => {
|
|
@@ -2489,7 +2489,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2489
2489
|
disable: V.value.length > 0 && e(m).currentCatalog && !e(m).currentScheduler,
|
|
2490
2490
|
min: 0,
|
|
2491
2491
|
"model-value": u.form.price || null,
|
|
2492
|
-
placeholder: (v = u.fallback) != null && v.price ? e(
|
|
2492
|
+
placeholder: (v = u.fallback) != null && v.price ? e(ze)(u.fallback.price, !1) : void 0,
|
|
2493
2493
|
rules: [
|
|
2494
2494
|
F.value.price ? (p) => !!p || e(r)("menu.product.form.price.fields.selling_price.required") : void 0
|
|
2495
2495
|
].filter(e(zt).isSet),
|
|
@@ -2499,7 +2499,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2499
2499
|
"onUpdate:modelValue": f[0] || (f[0] = (p) => p && b("update:form", "price", p))
|
|
2500
2500
|
}, {
|
|
2501
2501
|
append: q(() => [
|
|
2502
|
-
|
|
2502
|
+
at(s(e(vn), {
|
|
2503
2503
|
"pure-styling": "",
|
|
2504
2504
|
class: "shrink-0 scale-75",
|
|
2505
2505
|
onClick: S
|
|
@@ -2533,7 +2533,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2533
2533
|
currentConfig: "Main Pricing",
|
|
2534
2534
|
"product-name": u.form.name,
|
|
2535
2535
|
"base-price": u.form.price,
|
|
2536
|
-
"base-price-fallback": (w = u.fallback) != null && w.price ? e(
|
|
2536
|
+
"base-price-fallback": (w = u.fallback) != null && w.price ? e(ze)(u.fallback.price, !1) : void 0,
|
|
2537
2537
|
"price-variants": x.value,
|
|
2538
2538
|
"show-remy": !0,
|
|
2539
2539
|
"onUpdate:basePrice": f[2] || (f[2] = (p) => b("update:form", "price", p)),
|
|
@@ -2551,7 +2551,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2551
2551
|
s(Gt, { "price-variants": x.value }, null, 8, ["price-variants"])
|
|
2552
2552
|
])
|
|
2553
2553
|
])) : Z("", !0),
|
|
2554
|
-
!u.isOverride && e(m).isV4 ? (A(),
|
|
2554
|
+
!u.isOverride && e(m).isV4 ? (A(), ne(Ke, {
|
|
2555
2555
|
key: 1,
|
|
2556
2556
|
label: e(r)("menu.price_tier.price_group"),
|
|
2557
2557
|
description: e(r)("menu.price_tier.description")
|
|
@@ -2567,7 +2567,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2567
2567
|
default: q(() => {
|
|
2568
2568
|
var p;
|
|
2569
2569
|
return [
|
|
2570
|
-
u.isOverride ? Z("", !0) : (A(),
|
|
2570
|
+
u.isOverride ? Z("", !0) : (A(), ne(oo, {
|
|
2571
2571
|
key: 0,
|
|
2572
2572
|
"price-tiers": e(Y).priceTiers.value,
|
|
2573
2573
|
"model-value": u.form.priceTiers || ((p = u.fallback) == null ? void 0 : p.priceTiers) || {},
|
|
@@ -2578,7 +2578,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2578
2578
|
}),
|
|
2579
2579
|
_: 1
|
|
2580
2580
|
}, 8, ["label", "description"])) : Z("", !0),
|
|
2581
|
-
s(
|
|
2581
|
+
s(Ke, {
|
|
2582
2582
|
label: e(r)("menu.product.form.price.settings.title")
|
|
2583
2583
|
}, {
|
|
2584
2584
|
default: q(() => {
|
|
@@ -2591,7 +2591,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2591
2591
|
value: u.form.openPrice,
|
|
2592
2592
|
label: e(r)("menu.product.form.price.settings.open_price.label"),
|
|
2593
2593
|
sublabel: e(r)("menu.product.form.price.settings.open_price.sublabel"),
|
|
2594
|
-
"onUpdate:modelValue": f[5] || (f[5] = (
|
|
2594
|
+
"onUpdate:modelValue": f[5] || (f[5] = (B) => b("update:form", "openPrice", B))
|
|
2595
2595
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
2596
2596
|
K("div", Jr, [
|
|
2597
2597
|
s(g, {
|
|
@@ -2609,8 +2609,8 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2609
2609
|
disabled: !F.value.unit,
|
|
2610
2610
|
"model-value": u.form.perXUnit || ((k = u.fallback) == null ? void 0 : k.perXUnit) || null,
|
|
2611
2611
|
rules: [
|
|
2612
|
-
(
|
|
2613
|
-
(
|
|
2612
|
+
(B) => !!B || e(r)("menu.product.form.price.settings.sell_by_unit.per_unit.required"),
|
|
2613
|
+
(B) => !B || B > 0 || e(r)("menu.product.form.price.settings.sell_by_unit.per_unit.min")
|
|
2614
2614
|
],
|
|
2615
2615
|
inputmode: "numeric",
|
|
2616
2616
|
placeholder: e(r)("menu.product.form.price.settings.sell_by_unit.per_unit.placeholder"),
|
|
@@ -2624,10 +2624,10 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2624
2624
|
disabled: !F.value.unit,
|
|
2625
2625
|
"model-value": u.form.unit || ((G = u.fallback) == null ? void 0 : G.unit) || null,
|
|
2626
2626
|
rules: [
|
|
2627
|
-
(
|
|
2627
|
+
(B) => !!B || e(r)("menu.product.form.price.settings.sell_by_unit.unit.required")
|
|
2628
2628
|
],
|
|
2629
2629
|
placeholder: e(r)("menu.product.form.price.settings.sell_by_unit.unit.placeholder"),
|
|
2630
|
-
"onUpdate:modelValue": f[6] || (f[6] = (
|
|
2630
|
+
"onUpdate:modelValue": f[6] || (f[6] = (B) => b("update:form", "unit", B))
|
|
2631
2631
|
}, null, 8, ["disabled", "model-value", "rules", "placeholder"])
|
|
2632
2632
|
])
|
|
2633
2633
|
])) : Z("", !0)
|
|
@@ -2637,7 +2637,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2637
2637
|
"model-value": !!u.form.costing,
|
|
2638
2638
|
value: !!u.form.costing,
|
|
2639
2639
|
label: e(r)("menu.product.form.price.settings.track_costing.label"),
|
|
2640
|
-
"onUpdate:modelValue": f[7] || (f[7] = (
|
|
2640
|
+
"onUpdate:modelValue": f[7] || (f[7] = (B) => b("update:form", "costing", B ? e(Te.Dinero).zero().toObject() : void 0))
|
|
2641
2641
|
}, null, 8, ["model-value", "value", "label"]),
|
|
2642
2642
|
u.form.costing ? (A(), J("div", ra, [
|
|
2643
2643
|
K("div", aa, [
|
|
@@ -2647,7 +2647,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2647
2647
|
"model-value": u.form.costing || null,
|
|
2648
2648
|
nullable: "",
|
|
2649
2649
|
"show-currency": "",
|
|
2650
|
-
"onUpdate:modelValue": f[8] || (f[8] = (
|
|
2650
|
+
"onUpdate:modelValue": f[8] || (f[8] = (B) => b("update:form", "costing", B ?? e(Te.Dinero).zero().toObject()))
|
|
2651
2651
|
}, null, 8, ["model-value"])
|
|
2652
2652
|
])
|
|
2653
2653
|
])) : Z("", !0)
|
|
@@ -2658,18 +2658,18 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2658
2658
|
"model-value": !!u.form.minPrice,
|
|
2659
2659
|
value: !!u.form.minPrice,
|
|
2660
2660
|
label: e(r)("menu.product.form.price.settings.min_price.label"),
|
|
2661
|
-
"onUpdate:modelValue": f[9] || (f[9] = (
|
|
2661
|
+
"onUpdate:modelValue": f[9] || (f[9] = (B) => b("update:form", "minPrice", B ? e(Te.Dinero).zero().toObject() : void 0))
|
|
2662
2662
|
}, null, 8, ["disabled", "model-value", "value", "label"]),
|
|
2663
2663
|
K("div", ia, [
|
|
2664
2664
|
K("div", sa, [
|
|
2665
|
-
u.form.minPrice ? (A(),
|
|
2665
|
+
u.form.minPrice ? (A(), ne(Ze, {
|
|
2666
2666
|
key: 0,
|
|
2667
2667
|
max: e(Te.Dinero).fromFdoDinero(u.form.price).toUnit(),
|
|
2668
2668
|
min: 0,
|
|
2669
2669
|
"model-value": u.form.minPrice || null,
|
|
2670
2670
|
class: "flex-1",
|
|
2671
2671
|
"show-currency": "",
|
|
2672
|
-
"onUpdate:modelValue": f[10] || (f[10] = (
|
|
2672
|
+
"onUpdate:modelValue": f[10] || (f[10] = (B) => b("update:form", "minPrice", B ?? e(Te.Dinero).zero().toObject()))
|
|
2673
2673
|
}, null, 8, ["max", "model-value"])) : Z("", !0)
|
|
2674
2674
|
])
|
|
2675
2675
|
])
|
|
@@ -2685,7 +2685,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2685
2685
|
}, 8, ["title"]);
|
|
2686
2686
|
};
|
|
2687
2687
|
}
|
|
2688
|
-
}), da = { class: "space-y-16" }, ca = { class: "flex items-center space-x-4" }, ma = { class: "handle" }, pa = { class: "pt-16" }, fa = /* @__PURE__ */
|
|
2688
|
+
}), da = { class: "space-y-16" }, ca = { class: "flex items-center space-x-4" }, ma = { class: "handle" }, pa = { class: "pt-16" }, fa = /* @__PURE__ */ fe({
|
|
2689
2689
|
__name: "ProductPrint",
|
|
2690
2690
|
props: {
|
|
2691
2691
|
isOverride: { type: Boolean },
|
|
@@ -2696,10 +2696,10 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2696
2696
|
},
|
|
2697
2697
|
emits: ["update:form", "replace:form"],
|
|
2698
2698
|
setup(i, { emit: a }) {
|
|
2699
|
-
const t = i, o =
|
|
2699
|
+
const t = i, o = be(), { t: m } = _e(), r = a;
|
|
2700
2700
|
function b() {
|
|
2701
2701
|
return {
|
|
2702
|
-
...
|
|
2702
|
+
...je.generator.initMenuV4PrintSetting(),
|
|
2703
2703
|
// make toRoot default to false
|
|
2704
2704
|
toRoot: !1
|
|
2705
2705
|
};
|
|
@@ -2764,13 +2764,13 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2764
2764
|
() => S(c.value[c.value.length - 1]._id, !0)
|
|
2765
2765
|
), (V, $) => {
|
|
2766
2766
|
const x = H("fm-switch"), D = H("fm-radio"), u = H("fm-radio-group"), f = H("fm-button"), N = H("fm-checkbox");
|
|
2767
|
-
return A(),
|
|
2767
|
+
return A(), ne(Me, {
|
|
2768
2768
|
title: e(m)("menu.product.form.print.title")
|
|
2769
2769
|
}, {
|
|
2770
2770
|
default: q(() => {
|
|
2771
2771
|
var h;
|
|
2772
2772
|
return [
|
|
2773
|
-
F.value.printConfig ? (A(),
|
|
2773
|
+
F.value.printConfig ? (A(), ne(Ke, {
|
|
2774
2774
|
key: 0,
|
|
2775
2775
|
label: e(m)("menu.product.form.print.config.label")
|
|
2776
2776
|
}, {
|
|
@@ -2795,7 +2795,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2795
2795
|
}, {
|
|
2796
2796
|
default: q(() => [
|
|
2797
2797
|
K("div", da, [
|
|
2798
|
-
(A(!0), J(Se, null, Ae(Y.value, (g, U) => (A(),
|
|
2798
|
+
(A(!0), J(Se, null, Ae(Y.value, (g, U) => (A(), ne(D, {
|
|
2799
2799
|
key: U,
|
|
2800
2800
|
label: g.label,
|
|
2801
2801
|
sublabel: g.description,
|
|
@@ -2805,11 +2805,11 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2805
2805
|
]),
|
|
2806
2806
|
_: 1
|
|
2807
2807
|
}, 8, ["label", "model-value"]),
|
|
2808
|
-
s(
|
|
2808
|
+
s(Ke, {
|
|
2809
2809
|
label: e(m)("menu.product.form.print.routes.label")
|
|
2810
2810
|
}, {
|
|
2811
2811
|
default: q(() => [
|
|
2812
|
-
C.value.length ? (A(),
|
|
2812
|
+
C.value.length ? (A(), ne(e(Yt), {
|
|
2813
2813
|
key: 0,
|
|
2814
2814
|
"item-key": (g) => g,
|
|
2815
2815
|
"model-value": C.value,
|
|
@@ -2822,7 +2822,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2822
2822
|
return [
|
|
2823
2823
|
K("div", ca, [
|
|
2824
2824
|
K("div", ma, [
|
|
2825
|
-
_.value ? (A(),
|
|
2825
|
+
_.value ? (A(), ne(f, {
|
|
2826
2826
|
key: 0,
|
|
2827
2827
|
disabled: !((l = (U = t.form.print) == null ? void 0 : U.department) != null && l.includes(g)),
|
|
2828
2828
|
class: "handle",
|
|
@@ -2868,7 +2868,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2868
2868
|
}, 8, ["title"]);
|
|
2869
2869
|
};
|
|
2870
2870
|
}
|
|
2871
|
-
}), ga = /* @__PURE__ */
|
|
2871
|
+
}), ga = /* @__PURE__ */ fe({
|
|
2872
2872
|
__name: "ProductTakeaway",
|
|
2873
2873
|
props: {
|
|
2874
2874
|
isOverride: {
|
|
@@ -2885,7 +2885,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2885
2885
|
setup(i, {
|
|
2886
2886
|
emit: a
|
|
2887
2887
|
}) {
|
|
2888
|
-
const t = i, o =
|
|
2888
|
+
const t = i, o = be(), m = M(() => o.rules.item), {
|
|
2889
2889
|
t: r
|
|
2890
2890
|
} = _e(), b = a, {
|
|
2891
2891
|
hasVariant: F,
|
|
@@ -2950,7 +2950,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2950
2950
|
}]);
|
|
2951
2951
|
return (P, y) => {
|
|
2952
2952
|
const n = H("fm-table");
|
|
2953
|
-
return A(),
|
|
2953
|
+
return A(), ne(Me, {
|
|
2954
2954
|
title: e(r)("menu.product.form.takeaway.title"),
|
|
2955
2955
|
"sub-title": e(r)("menu.product.form.takeaway.subtitle")
|
|
2956
2956
|
}, {
|
|
@@ -2967,7 +2967,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2967
2967
|
}), va = { class: "fm-typo-en-title-md-600" }, ba = { class: "py-16 space-y-32" }, ya = ["data-not-allow-sort"], _a = {
|
|
2968
2968
|
key: 1,
|
|
2969
2969
|
class: "w-24"
|
|
2970
|
-
}, ha = { class: "flex-1" }, ka = { class: "flex gap-8 items-center justify-start" }, wa = /* @__PURE__ */
|
|
2970
|
+
}, ha = { class: "flex-1" }, ka = { class: "flex gap-8 items-center justify-start" }, wa = /* @__PURE__ */ fe({
|
|
2971
2971
|
__name: "VariantManagerForm",
|
|
2972
2972
|
props: {
|
|
2973
2973
|
initialValue: {}
|
|
@@ -2978,7 +2978,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2978
2978
|
setTimeout(() => {
|
|
2979
2979
|
o("update:show", !1);
|
|
2980
2980
|
}, 100);
|
|
2981
|
-
}, r =
|
|
2981
|
+
}, r = be(), { t: b } = _e(), F = M(
|
|
2982
2982
|
() => t.initialValue ? b("menu.variant.form.title.edit") : b("menu.variant.form.title.add")
|
|
2983
2983
|
), c = M(() => t.initialValue ? "Update" : "Add"), _ = () => {
|
|
2984
2984
|
if (t.initialValue) {
|
|
@@ -2988,7 +2988,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
2988
2988
|
name: ""
|
|
2989
2989
|
}), D;
|
|
2990
2990
|
} else
|
|
2991
|
-
return { ...
|
|
2991
|
+
return { ...je.generator.initMenuV4VariantGroup(), usedBy: [] };
|
|
2992
2992
|
}, C = ee(_()), P = ee(!1), y = ee(!1);
|
|
2993
2993
|
function n(D) {
|
|
2994
2994
|
C.value.options = D;
|
|
@@ -3061,7 +3061,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
3061
3061
|
y.value = !0;
|
|
3062
3062
|
}), (D, u) => {
|
|
3063
3063
|
const f = H("fm-text-field"), N = H("fm-icon"), h = H("fm-button"), g = H("fm-side-sheet");
|
|
3064
|
-
return A(),
|
|
3064
|
+
return A(), ne(g, {
|
|
3065
3065
|
id: "variant-form",
|
|
3066
3066
|
modelValue: y.value,
|
|
3067
3067
|
"onUpdate:modelValue": u[2] || (u[2] = (U) => y.value = U),
|
|
@@ -3110,7 +3110,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
3110
3110
|
rules: [(l) => !!l || e(b)("menu.variant.form.name.required")],
|
|
3111
3111
|
placeholder: e(b)("menu.variant.form.name.placeholder")
|
|
3112
3112
|
}, null, 8, ["label", "helper-text", "modelValue", "rules", "placeholder"]),
|
|
3113
|
-
s(
|
|
3113
|
+
s(Ke, {
|
|
3114
3114
|
label: e(b)("menu.variant.form.options.title")
|
|
3115
3115
|
}, {
|
|
3116
3116
|
default: q(() => [
|
|
@@ -3129,7 +3129,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
3129
3129
|
class: $e(["flex items-center", "space-x-8"]),
|
|
3130
3130
|
"data-not-allow-sort": v === C.value.options.length - 1
|
|
3131
3131
|
}, [
|
|
3132
|
-
v !== C.value.options.length - 1 ? (A(),
|
|
3132
|
+
v !== C.value.options.length - 1 ? (A(), ne(N, {
|
|
3133
3133
|
key: 0,
|
|
3134
3134
|
class: "handle",
|
|
3135
3135
|
name: "drag_handle"
|
|
@@ -3168,7 +3168,7 @@ const xr = /* @__PURE__ */ ge({
|
|
|
3168
3168
|
]),
|
|
3169
3169
|
_: 1
|
|
3170
3170
|
}, 8, ["title"]),
|
|
3171
|
-
(U = C.value.usedBy) != null && U.length ? (A(),
|
|
3171
|
+
(U = C.value.usedBy) != null && U.length ? (A(), ne(Ao, {
|
|
3172
3172
|
key: 0,
|
|
3173
3173
|
editable: !1,
|
|
3174
3174
|
overrides: C.value.usedBy || [],
|
|
@@ -3203,13 +3203,13 @@ const Ia = {
|
|
|
3203
3203
|
}, Ta = { class: "flex-1 flex-shrink space-y-8 min-h-0 overflow-y-scroll p-8" }, xa = { class: "flex justify-between pb-16" }, Sa = { class: "flex gap-8" }, Ea = {
|
|
3204
3204
|
key: 1,
|
|
3205
3205
|
class: "flex flex-col items-center space-y-16"
|
|
3206
|
-
}, Fa = { class: "flex flex-col items-center space-y-4 w-full" }, Va = { class: "fm-typo-en-title-sm-600" }, $a = { class: "text-fm-color-typo-secondary" }, Pa = /* @__PURE__ */
|
|
3206
|
+
}, Fa = { class: "flex flex-col items-center space-y-4 w-full" }, Va = { class: "fm-typo-en-title-sm-600" }, $a = { class: "text-fm-color-typo-secondary" }, Pa = /* @__PURE__ */ fe({
|
|
3207
3207
|
__name: "SelectVariantDialog",
|
|
3208
3208
|
props: {
|
|
3209
3209
|
selectedVariants: {}
|
|
3210
3210
|
},
|
|
3211
3211
|
setup(i) {
|
|
3212
|
-
const a = Qe(), { emitData: t, emitAction: o } = pn(), m =
|
|
3212
|
+
const a = Qe(), { emitData: t, emitAction: o } = pn(), m = be(), { t: r } = _e(), b = i, F = M(() => m.variants.map((y) => ({
|
|
3213
3213
|
label: y.name,
|
|
3214
3214
|
value: y._id,
|
|
3215
3215
|
disabled: !1
|
|
@@ -3232,7 +3232,7 @@ const Ia = {
|
|
|
3232
3232
|
(A(!0), J(Se, null, Ae(F.value, (V) => (A(), J("div", {
|
|
3233
3233
|
key: V.value
|
|
3234
3234
|
}, [
|
|
3235
|
-
|
|
3235
|
+
at(s(S, {
|
|
3236
3236
|
modelValue: c.value,
|
|
3237
3237
|
"onUpdate:modelValue": [
|
|
3238
3238
|
n[1] || (n[1] = ($) => c.value = $),
|
|
@@ -3247,7 +3247,7 @@ const Ia = {
|
|
|
3247
3247
|
])
|
|
3248
3248
|
]),
|
|
3249
3249
|
K("div", xa, [
|
|
3250
|
-
e(m).rules.item.variant ? (A(),
|
|
3250
|
+
e(m).rules.item.variant ? (A(), ne(Y, {
|
|
3251
3251
|
key: 0,
|
|
3252
3252
|
label: e(r)("menu.common.actions.add_new_variant"),
|
|
3253
3253
|
variant: "tertiary",
|
|
@@ -3287,7 +3287,7 @@ const Ia = {
|
|
|
3287
3287
|
class: "flex items-center flex-1 h-[36px] px-8 border border-fm-color-neutral-gray-300 rounded-md bg-fm-color-neutral-white"
|
|
3288
3288
|
}, Ua = {
|
|
3289
3289
|
class: "flex-1 fm-typo-en-body-lg-400"
|
|
3290
|
-
}, Ra = /* @__PURE__ */
|
|
3290
|
+
}, Ra = /* @__PURE__ */ fe({
|
|
3291
3291
|
__name: "ProductVariants",
|
|
3292
3292
|
props: {
|
|
3293
3293
|
isOverride: {
|
|
@@ -3304,7 +3304,7 @@ const Ia = {
|
|
|
3304
3304
|
setup(i, {
|
|
3305
3305
|
emit: a
|
|
3306
3306
|
}) {
|
|
3307
|
-
const t = i, o = vt(), m =
|
|
3307
|
+
const t = i, o = vt(), m = be(), r = lo(), b = Ye(), F = Qe(), {
|
|
3308
3308
|
t: c
|
|
3309
3309
|
} = _e(), _ = M(() => m.rules.item), C = M(() => _.value.minPrice && !!t.form.minPrice), P = M(() => !m.state.currentCatalogId), y = M(() => m.variants.reduce((l, v) => (l[v._id] = v, l), {})), n = a;
|
|
3310
3310
|
function T(l) {
|
|
@@ -3343,8 +3343,8 @@ const Ia = {
|
|
|
3343
3343
|
});
|
|
3344
3344
|
}
|
|
3345
3345
|
function V(l) {
|
|
3346
|
-
var
|
|
3347
|
-
const v = ((
|
|
3346
|
+
var B, oe;
|
|
3347
|
+
const v = ((B = t.form.variant) == null ? void 0 : B.variantGroupIds) || [], w = (oe = t.form.variant) == null ? void 0 : oe.variantCombinations, G = l.split(/(?=variant)/g).map((ce) => ce.replace(/\/*$/, "")).filter((ce) => v.some((pe) => ce.includes(pe))).join("/");
|
|
3348
3348
|
return w == null ? void 0 : w.find((ce) => ce.combinationKey === G);
|
|
3349
3349
|
}
|
|
3350
3350
|
const $ = (l) => {
|
|
@@ -3354,8 +3354,8 @@ const Ia = {
|
|
|
3354
3354
|
return (((v = t.form.variant) == null ? void 0 : v.variantCombinations) || []).map((w) => {
|
|
3355
3355
|
var k, G;
|
|
3356
3356
|
const p = (G = (k = t.fallback) == null ? void 0 : k.variant) == null ? void 0 : G.variantCombinations.find(({
|
|
3357
|
-
combinationKey:
|
|
3358
|
-
}) =>
|
|
3357
|
+
combinationKey: B
|
|
3358
|
+
}) => B === w.combinationKey);
|
|
3359
3359
|
return {
|
|
3360
3360
|
...w,
|
|
3361
3361
|
fallback: {
|
|
@@ -3374,17 +3374,17 @@ const Ia = {
|
|
|
3374
3374
|
const w = l.filter((G) => !!G);
|
|
3375
3375
|
let p;
|
|
3376
3376
|
if (w.length) {
|
|
3377
|
-
const G = w.map((
|
|
3378
|
-
combinationKey:
|
|
3377
|
+
const G = w.map((oe) => m.variants.find((ce) => ce._id === oe)), B = je.fullVariantCombination(G).map(({
|
|
3378
|
+
combinationKey: oe
|
|
3379
3379
|
}) => {
|
|
3380
|
-
var
|
|
3381
|
-
const ce = (
|
|
3380
|
+
var pe;
|
|
3381
|
+
const ce = (pe = t.form.variant) == null ? void 0 : pe.variantCombinations.find((O) => O.combinationKey === oe);
|
|
3382
3382
|
return v(ce || {
|
|
3383
3383
|
_id: t.form._id,
|
|
3384
|
-
combinationKey:
|
|
3384
|
+
combinationKey: oe
|
|
3385
3385
|
});
|
|
3386
3386
|
});
|
|
3387
|
-
if (
|
|
3387
|
+
if (B.length > 100) {
|
|
3388
3388
|
b.open({
|
|
3389
3389
|
type: "error",
|
|
3390
3390
|
message: "'Combinations of variant should not be more than 100'"
|
|
@@ -3395,23 +3395,23 @@ const Ia = {
|
|
|
3395
3395
|
...t.form,
|
|
3396
3396
|
variant: {
|
|
3397
3397
|
variantGroupIds: w,
|
|
3398
|
-
variantCombinations:
|
|
3398
|
+
variantCombinations: B
|
|
3399
3399
|
},
|
|
3400
3400
|
inventoryBindings: null,
|
|
3401
3401
|
takeawayUsed: null
|
|
3402
3402
|
};
|
|
3403
3403
|
} else {
|
|
3404
|
-
const G = (k = t.form.variant) == null ? void 0 : k.variantCombinations.map((
|
|
3404
|
+
const G = (k = t.form.variant) == null ? void 0 : k.variantCombinations.map((oe) => oe.takeawayUsed), B = [...new Set(G)];
|
|
3405
3405
|
T([{
|
|
3406
3406
|
key: "variant",
|
|
3407
3407
|
value: void 0
|
|
3408
3408
|
}, {
|
|
3409
3409
|
key: "takeawayUsed",
|
|
3410
|
-
value:
|
|
3410
|
+
value: B.length === 1 ? B[0] : null
|
|
3411
3411
|
}]), p = {
|
|
3412
3412
|
...t.form,
|
|
3413
3413
|
variant: void 0,
|
|
3414
|
-
takeawayUsed:
|
|
3414
|
+
takeawayUsed: B.length === 1 ? B[0] : null
|
|
3415
3415
|
};
|
|
3416
3416
|
}
|
|
3417
3417
|
n("replace:form", r.initDynamicGroupItem(p));
|
|
@@ -3436,19 +3436,19 @@ const Ia = {
|
|
|
3436
3436
|
header: () => c("menu.product.form.variant.columns.code"),
|
|
3437
3437
|
enableSorting: !1,
|
|
3438
3438
|
cell: (l) => {
|
|
3439
|
-
var
|
|
3440
|
-
const v = l.getValue(), w = l.row.original, k = ((
|
|
3439
|
+
var B, oe;
|
|
3440
|
+
const v = l.getValue(), w = l.row.original, k = ((B = w.fallback) == null ? void 0 : B.code) ?? t.form.code ?? ((oe = t.fallback) == null ? void 0 : oe.code), G = o.state.featureFlags.uniqueProductCode;
|
|
3441
3441
|
return Ie(Ce.FmTextField, {
|
|
3442
3442
|
modelValue: v,
|
|
3443
3443
|
placeholder: k || c("menu.product.form.variant.placeholders.no_code"),
|
|
3444
3444
|
rules: [(ce) => {
|
|
3445
|
-
const
|
|
3446
|
-
var
|
|
3447
|
-
if (!G || !
|
|
3448
|
-
let
|
|
3449
|
-
return w.code ===
|
|
3450
|
-
|
|
3451
|
-
}),
|
|
3445
|
+
const pe = ce, O = M(() => {
|
|
3446
|
+
var ve;
|
|
3447
|
+
if (!G || !pe) return 0;
|
|
3448
|
+
let te = m.itemCodeMap.get(pe) || 0;
|
|
3449
|
+
return w.code === pe && te > 0 && (te -= 1), pe === k && (te += 1), (ve = t.form.variant) == null || ve.variantCombinations.forEach((me) => {
|
|
3450
|
+
me.combinationKey !== w.combinationKey && me.code === pe && (te += 1);
|
|
3451
|
+
}), te;
|
|
3452
3452
|
});
|
|
3453
3453
|
return G && O.value > 0 ? c("menu.product.form.detail.fields.code.duplicate_warning", {
|
|
3454
3454
|
count: O.value
|
|
@@ -3472,8 +3472,8 @@ const Ia = {
|
|
|
3472
3472
|
disable: !_.value.orderFrom,
|
|
3473
3473
|
required: _.value.orderFrom && _.value.orderFromActiveOnly,
|
|
3474
3474
|
editActiveOnly: _.value.orderFromActiveOnly || !1,
|
|
3475
|
-
"onUpdate:modelValue": (
|
|
3476
|
-
u(l.row.index, "orderFrom",
|
|
3475
|
+
"onUpdate:modelValue": (B) => {
|
|
3476
|
+
u(l.row.index, "orderFrom", B);
|
|
3477
3477
|
},
|
|
3478
3478
|
label: "",
|
|
3479
3479
|
defaultLabel: "Follow general"
|
|
@@ -3484,14 +3484,14 @@ const Ia = {
|
|
|
3484
3484
|
header: () => c("menu.product.form.variant.columns.price"),
|
|
3485
3485
|
enableSorting: !1,
|
|
3486
3486
|
cell: (l) => {
|
|
3487
|
-
var
|
|
3488
|
-
const v = l.getValue(), w = l.row.original, k = ((
|
|
3487
|
+
var oe, ce, pe;
|
|
3488
|
+
const v = l.getValue(), w = l.row.original, k = ((oe = w.fallback) == null ? void 0 : oe.price) ?? t.form.price ?? ((ce = t.fallback) == null ? void 0 : ce.price), G = N.getMemberPricingPriceVariant(w.price_variant), B = Object.values(G).every((O) => O === null);
|
|
3489
3489
|
return s("div", {
|
|
3490
3490
|
id: ft(De.VARIANT, w.combinationKey ?? ""),
|
|
3491
3491
|
class: "flex items-center gap-8"
|
|
3492
3492
|
}, [s(Ze, {
|
|
3493
3493
|
disable: f.value.length > 0 && m.currentCatalog && !m.currentScheduler,
|
|
3494
|
-
placeholder: k ?
|
|
3494
|
+
placeholder: k ? ze(k) : void 0,
|
|
3495
3495
|
modelValue: v,
|
|
3496
3496
|
min: 0,
|
|
3497
3497
|
"onUpdate:model-value": (O) => {
|
|
@@ -3507,7 +3507,7 @@ const Ia = {
|
|
|
3507
3507
|
priceVariants: G,
|
|
3508
3508
|
showRemy: !1,
|
|
3509
3509
|
basePrice: v,
|
|
3510
|
-
basePriceFallback: k ?
|
|
3510
|
+
basePriceFallback: k ? ze(k) : void 0,
|
|
3511
3511
|
"onUpdate:basePrice": (O) => {
|
|
3512
3512
|
u(l.row.index, "price", O);
|
|
3513
3513
|
},
|
|
@@ -3524,8 +3524,8 @@ const Ia = {
|
|
|
3524
3524
|
}, {
|
|
3525
3525
|
default: () => s("span", {
|
|
3526
3526
|
class: "underline line-clamp-2 break-all"
|
|
3527
|
-
}, [
|
|
3528
|
-
num: Object.values(G).filter((
|
|
3527
|
+
}, [B ? c("menu.product.form.member_price.configure.title") : c("menu.product.form.member_price.configure.title_with_tier", {
|
|
3528
|
+
num: Object.values(G).filter((te) => te !== null).length
|
|
3529
3529
|
})])
|
|
3530
3530
|
})
|
|
3531
3531
|
}), s(Gt, {
|
|
@@ -3534,7 +3534,7 @@ const Ia = {
|
|
|
3534
3534
|
"menu-store": m,
|
|
3535
3535
|
"price-tiers": w.priceTiers,
|
|
3536
3536
|
"price-tiers-variant": w.priceTiers_variant,
|
|
3537
|
-
fallback: (
|
|
3537
|
+
fallback: (pe = w.fallback) == null ? void 0 : pe.priceTiers,
|
|
3538
3538
|
"onUpdate:value": (O) => {
|
|
3539
3539
|
u(l.row.index, "priceTiers", O.priceTiers), u(l.row.index, "priceTiers_variant", io(O.priceTiersVariant));
|
|
3540
3540
|
}
|
|
@@ -3545,12 +3545,12 @@ const Ia = {
|
|
|
3545
3545
|
header: () => c("menu.product.form.variant.columns.min_price"),
|
|
3546
3546
|
enableSorting: !1,
|
|
3547
3547
|
cell: (l) => {
|
|
3548
|
-
var G,
|
|
3549
|
-
const v = l.getValue(), w = l.row.original, k = ((G = w.fallback) == null ? void 0 : G.minPrice) ?? t.form.minPrice ?? ((
|
|
3548
|
+
var G, B, oe;
|
|
3549
|
+
const v = l.getValue(), w = l.row.original, k = ((G = w.fallback) == null ? void 0 : G.minPrice) ?? t.form.minPrice ?? ((B = t.fallback) == null ? void 0 : B.minPrice);
|
|
3550
3550
|
return Ie(Ze, {
|
|
3551
|
-
placeholder: k ?
|
|
3551
|
+
placeholder: k ? ze(k) : void 0,
|
|
3552
3552
|
modelValue: v,
|
|
3553
|
-
max: Te.Dinero.fromFdoDinero(w.price ?? ((
|
|
3553
|
+
max: Te.Dinero.fromFdoDinero(w.price ?? ((oe = w.fallback) == null ? void 0 : oe.price) ?? Te.Dinero.zero().toObject()).toUnit(),
|
|
3554
3554
|
"onUpdate:modelValue": (ce) => {
|
|
3555
3555
|
u(l.row.index, "minPrice", ce);
|
|
3556
3556
|
},
|
|
@@ -3568,12 +3568,12 @@ const Ia = {
|
|
|
3568
3568
|
}
|
|
3569
3569
|
return (l, v) => {
|
|
3570
3570
|
const w = H("fm-button"), p = H("fm-icon"), k = H("FmFormGroup"), G = H("fm-table");
|
|
3571
|
-
return A(),
|
|
3571
|
+
return A(), ne(Me, {
|
|
3572
3572
|
id: e(De).VARIANT,
|
|
3573
3573
|
title: e(c)("menu.product.form.variant.title"),
|
|
3574
3574
|
"sub-title": e(c)("menu.product.form.variant.subtitle")
|
|
3575
3575
|
}, {
|
|
3576
|
-
"append-title": q(() => [e(m).rules.item.variant ? (A(),
|
|
3576
|
+
"append-title": q(() => [e(m).rules.item.variant ? (A(), ne(w, {
|
|
3577
3577
|
key: 0,
|
|
3578
3578
|
label: e(c)("menu.product.form.variant.add"),
|
|
3579
3579
|
variant: "secondary",
|
|
@@ -3581,15 +3581,15 @@ const Ia = {
|
|
|
3581
3581
|
onClick: Y
|
|
3582
3582
|
}, null, 8, ["label"])) : Z("", !0)]),
|
|
3583
3583
|
default: q(() => {
|
|
3584
|
-
var
|
|
3584
|
+
var B;
|
|
3585
3585
|
return [K("div", Da, [s(k, {
|
|
3586
|
-
"model-value": (
|
|
3586
|
+
"model-value": (B = l.form.variant) == null ? void 0 : B.variantGroupIds,
|
|
3587
3587
|
rules: [U]
|
|
3588
3588
|
}, {
|
|
3589
3589
|
default: q(() => {
|
|
3590
|
-
var
|
|
3590
|
+
var oe;
|
|
3591
3591
|
return [s(e(Yt), {
|
|
3592
|
-
"model-value": ((
|
|
3592
|
+
"model-value": ((oe = l.form.variant) == null ? void 0 : oe.variantGroupIds) ?? [],
|
|
3593
3593
|
class: "space-y-16",
|
|
3594
3594
|
group: "variants",
|
|
3595
3595
|
handle: ".handle",
|
|
@@ -3599,17 +3599,17 @@ const Ia = {
|
|
|
3599
3599
|
item: q(({
|
|
3600
3600
|
element: ce
|
|
3601
3601
|
}) => {
|
|
3602
|
-
var
|
|
3602
|
+
var pe;
|
|
3603
3603
|
return [K("div", Oa, [s(w, {
|
|
3604
3604
|
variant: e(Pe).Tertiary,
|
|
3605
3605
|
class: "handle",
|
|
3606
3606
|
"prepend-icon": "drag_handle"
|
|
3607
|
-
}, null, 8, ["variant"]), K("div", Ma, [K("p", Ua, ye((
|
|
3607
|
+
}, null, 8, ["variant"]), K("div", Ma, [K("p", Ua, ye((pe = y.value[ce]) == null ? void 0 : pe.name), 1), s(p, {
|
|
3608
3608
|
class: "cursor-pointer",
|
|
3609
3609
|
name: "close",
|
|
3610
3610
|
onClick: Je((O) => {
|
|
3611
|
-
var
|
|
3612
|
-
return D(((
|
|
3611
|
+
var te;
|
|
3612
|
+
return D(((te = l.form.variant) == null ? void 0 : te.variantGroupIds.filter((ve) => ve !== ce)) ?? []);
|
|
3613
3613
|
}, ["stop"])
|
|
3614
3614
|
}, null, 8, ["onClick"])])])];
|
|
3615
3615
|
}),
|
|
@@ -3618,7 +3618,7 @@ const Ia = {
|
|
|
3618
3618
|
}),
|
|
3619
3619
|
_: 1
|
|
3620
3620
|
}, 8, ["model-value", "rules"]), s(dn, null, {
|
|
3621
|
-
default: q(() => [x.value.length ? (A(),
|
|
3621
|
+
default: q(() => [x.value.length ? (A(), ne(G, {
|
|
3622
3622
|
key: 0,
|
|
3623
3623
|
class: "w-full",
|
|
3624
3624
|
"column-defs": h.value,
|
|
@@ -3659,7 +3659,7 @@ const Ia = {
|
|
|
3659
3659
|
}, ja = {
|
|
3660
3660
|
key: 12,
|
|
3661
3661
|
class: "w-full h-[2px] bg-fm-color-neutral-gray-100"
|
|
3662
|
-
}, Ya = /* @__PURE__ */
|
|
3662
|
+
}, Ya = /* @__PURE__ */ fe({
|
|
3663
3663
|
__name: "ItemForm",
|
|
3664
3664
|
props: {
|
|
3665
3665
|
initialForm: {},
|
|
@@ -3670,43 +3670,43 @@ const Ia = {
|
|
|
3670
3670
|
},
|
|
3671
3671
|
emits: ["update:editingState"],
|
|
3672
3672
|
setup(i, { expose: a, emit: t }) {
|
|
3673
|
-
var W,
|
|
3674
|
-
const o = i, m = t, r =
|
|
3675
|
-
var
|
|
3676
|
-
const
|
|
3677
|
-
if (!
|
|
3673
|
+
var W, re, ie, ue, we;
|
|
3674
|
+
const o = i, m = t, r = lt(), b = be(), { t: F } = _e(), c = yt(), _ = M(() => {
|
|
3675
|
+
var de, ae;
|
|
3676
|
+
const z = (de = o.initialForm) != null && de._id ? c.getNodeById((ae = o.initialForm) == null ? void 0 : ae._id) : null;
|
|
3677
|
+
if (!z)
|
|
3678
3678
|
return [];
|
|
3679
|
-
const
|
|
3680
|
-
let
|
|
3681
|
-
for (;
|
|
3682
|
-
|
|
3683
|
-
label:
|
|
3679
|
+
const j = [];
|
|
3680
|
+
let le = z;
|
|
3681
|
+
for (; le; )
|
|
3682
|
+
j.push({
|
|
3683
|
+
label: le.label,
|
|
3684
3684
|
route: ""
|
|
3685
|
-
}),
|
|
3686
|
-
return
|
|
3685
|
+
}), le = le.parent;
|
|
3686
|
+
return j.reverse();
|
|
3687
3687
|
}), C = ee(null);
|
|
3688
3688
|
Xe(() => {
|
|
3689
|
-
var
|
|
3690
|
-
(
|
|
3689
|
+
var z;
|
|
3690
|
+
(z = C.value) == null || z.setSelectedItemIndex(_.value.length - 1);
|
|
3691
3691
|
});
|
|
3692
3692
|
const P = M(() => b.rules.item), y = ee(), n = ee(
|
|
3693
3693
|
o.initialForm ? ke(o.initialForm) : {
|
|
3694
|
-
...
|
|
3694
|
+
...je.generator.initMenuV4Item(),
|
|
3695
3695
|
category: o.categoryId
|
|
3696
3696
|
}
|
|
3697
3697
|
), T = M(
|
|
3698
3698
|
() => {
|
|
3699
|
-
var
|
|
3700
|
-
return fn(o.menu.modules.variant, (
|
|
3699
|
+
var z;
|
|
3700
|
+
return fn(o.menu.modules.variant, (z = n.value.variant) == null ? void 0 : z.variantGroupIds);
|
|
3701
3701
|
}
|
|
3702
|
-
), S = (
|
|
3703
|
-
var
|
|
3704
|
-
Ve.isEqual(((
|
|
3702
|
+
), S = (z, j) => {
|
|
3703
|
+
var le;
|
|
3704
|
+
Ve.isEqual(((le = n.value) == null ? void 0 : le[z]) || {}, j) || (n.value = {
|
|
3705
3705
|
...ke(n.value),
|
|
3706
|
-
[
|
|
3706
|
+
[z]: j
|
|
3707
3707
|
}, O());
|
|
3708
|
-
}, Y = (
|
|
3709
|
-
n.value =
|
|
3708
|
+
}, Y = (z) => {
|
|
3709
|
+
n.value = z, O();
|
|
3710
3710
|
};
|
|
3711
3711
|
async function V() {
|
|
3712
3712
|
y.value = n.value._id && $.value ? (await Eo(
|
|
@@ -3720,13 +3720,13 @@ const Ia = {
|
|
|
3720
3720
|
const $ = M(
|
|
3721
3721
|
() => !!b.state.currentCatalogId || !!b.state.currentSchedulerId
|
|
3722
3722
|
), x = M(() => {
|
|
3723
|
-
var
|
|
3724
|
-
return $.value ? n.value.category == "" || n.value.category == null && ((
|
|
3723
|
+
var z;
|
|
3724
|
+
return $.value ? n.value.category == "" || n.value.category == null && ((z = y.value) == null ? void 0 : z.category) == null : yn(o.menu) && n.value.category == null;
|
|
3725
3725
|
}), D = M(() => r.itemAttributeSettings.value.length > 0 && !$.value), u = ee(
|
|
3726
3726
|
n.value.category != null || !!n.value.code || !!n.value.orderFrom
|
|
3727
3727
|
);
|
|
3728
|
-
function f(
|
|
3729
|
-
|
|
3728
|
+
function f(z) {
|
|
3729
|
+
z || (n.value = {
|
|
3730
3730
|
...n.value,
|
|
3731
3731
|
name: void 0,
|
|
3732
3732
|
category: void 0,
|
|
@@ -3737,15 +3737,15 @@ const Ia = {
|
|
|
3737
3737
|
}, O());
|
|
3738
3738
|
}
|
|
3739
3739
|
const N = M(() => {
|
|
3740
|
-
const
|
|
3741
|
-
return o.menu.modules.item.forEach((
|
|
3742
|
-
var
|
|
3743
|
-
for (const [
|
|
3744
|
-
typeof
|
|
3745
|
-
}),
|
|
3740
|
+
const z = {};
|
|
3741
|
+
return o.menu.modules.item.forEach((j) => {
|
|
3742
|
+
var le;
|
|
3743
|
+
for (const [de, ae] of Object.entries(j.customAttributes || {}))
|
|
3744
|
+
typeof ae == "string" && ae && !((le = z[de]) != null && le.includes(ae)) && (z[de] = [...z[de] || [], ae]);
|
|
3745
|
+
}), z;
|
|
3746
3746
|
}), h = ee(!!n.value.price || !!n.value.minPrice || !!n.value.costing);
|
|
3747
|
-
function g(
|
|
3748
|
-
|
|
3747
|
+
function g(z) {
|
|
3748
|
+
z || (n.value = {
|
|
3749
3749
|
...n.value,
|
|
3750
3750
|
costing: void 0,
|
|
3751
3751
|
minPrice: void 0,
|
|
@@ -3754,17 +3754,17 @@ const Ia = {
|
|
|
3754
3754
|
}
|
|
3755
3755
|
const U = ee(
|
|
3756
3756
|
(((W = n.value.variant) == null ? void 0 : W.variantCombinations) || []).some(
|
|
3757
|
-
(
|
|
3757
|
+
(z) => !!z.price || !!z.orderFrom || !!z.code
|
|
3758
3758
|
)
|
|
3759
3759
|
);
|
|
3760
|
-
function l(
|
|
3761
|
-
var
|
|
3762
|
-
|
|
3760
|
+
function l(z) {
|
|
3761
|
+
var j, le, de;
|
|
3762
|
+
z || (n.value = {
|
|
3763
3763
|
...n.value,
|
|
3764
3764
|
variant: {
|
|
3765
|
-
variantGroupIds: ((
|
|
3766
|
-
variantCombinations: ((
|
|
3767
|
-
...
|
|
3765
|
+
variantGroupIds: ((j = n.value.variant) == null ? void 0 : j.variantGroupIds) || [],
|
|
3766
|
+
variantCombinations: ((de = (le = n.value.variant) == null ? void 0 : le.variantCombinations) == null ? void 0 : de.map((ae) => ({
|
|
3767
|
+
...ae,
|
|
3768
3768
|
price: void 0,
|
|
3769
3769
|
orderFrom: void 0,
|
|
3770
3770
|
code: void 0
|
|
@@ -3773,80 +3773,80 @@ const Ia = {
|
|
|
3773
3773
|
}, O());
|
|
3774
3774
|
}
|
|
3775
3775
|
const v = ee(
|
|
3776
|
-
!!n.value.inventoryBindings || (((
|
|
3776
|
+
!!n.value.inventoryBindings || (((re = n.value.variant) == null ? void 0 : re.variantCombinations) || []).some((z) => !!z.inventoryBindings) || !1
|
|
3777
3777
|
);
|
|
3778
|
-
function w(
|
|
3779
|
-
var
|
|
3780
|
-
|
|
3778
|
+
function w(z) {
|
|
3779
|
+
var j, le, de;
|
|
3780
|
+
z || (n.value = {
|
|
3781
3781
|
...n.value,
|
|
3782
3782
|
inventoryBindings: void 0,
|
|
3783
3783
|
variant: n.value.variant ? {
|
|
3784
|
-
variantGroupIds: ((
|
|
3785
|
-
variantCombinations: ((
|
|
3786
|
-
...
|
|
3784
|
+
variantGroupIds: ((j = n.value.variant) == null ? void 0 : j.variantGroupIds) || [],
|
|
3785
|
+
variantCombinations: ((de = (le = n.value.variant) == null ? void 0 : le.variantCombinations) == null ? void 0 : de.map((ae) => ({
|
|
3786
|
+
...ae,
|
|
3787
3787
|
inventoryBindings: void 0
|
|
3788
3788
|
}))) || []
|
|
3789
3789
|
} : void 0
|
|
3790
3790
|
}, O());
|
|
3791
3791
|
}
|
|
3792
3792
|
const p = ee(
|
|
3793
|
-
n.value.takeawayUsed != null || (((
|
|
3793
|
+
n.value.takeawayUsed != null || (((ie = n.value.variant) == null ? void 0 : ie.variantCombinations) || []).some((z) => z.takeawayUsed != null) || !1
|
|
3794
3794
|
);
|
|
3795
|
-
function k(
|
|
3796
|
-
var
|
|
3797
|
-
|
|
3795
|
+
function k(z) {
|
|
3796
|
+
var j, le;
|
|
3797
|
+
z || (n.value = {
|
|
3798
3798
|
...n.value,
|
|
3799
3799
|
takeawayUsed: void 0,
|
|
3800
3800
|
variant: {
|
|
3801
|
-
variantGroupIds: ((
|
|
3802
|
-
variantCombinations: ((
|
|
3803
|
-
...
|
|
3801
|
+
variantGroupIds: ((j = n.value.variant) == null ? void 0 : j.variantGroupIds) || [],
|
|
3802
|
+
variantCombinations: ((le = n.value.variant) == null ? void 0 : le.variantCombinations.map((de) => ({
|
|
3803
|
+
...de,
|
|
3804
3804
|
takeawayUsed: void 0
|
|
3805
3805
|
}))) || []
|
|
3806
3806
|
}
|
|
3807
3807
|
}, O());
|
|
3808
3808
|
}
|
|
3809
3809
|
const G = ee(!!n.value.print);
|
|
3810
|
-
function z
|
|
3811
|
-
|
|
3810
|
+
function B(z) {
|
|
3811
|
+
z || (n.value = { ...n.value, print: void 0 }, O());
|
|
3812
3812
|
}
|
|
3813
|
-
const
|
|
3814
|
-
!!((
|
|
3815
|
-
var
|
|
3816
|
-
return !!((
|
|
3813
|
+
const oe = ee(
|
|
3814
|
+
!!((ue = n.value.groups) != null && ue.length) != null || (((we = n.value.variant) == null ? void 0 : we.variantCombinations) || []).some((z) => {
|
|
3815
|
+
var j;
|
|
3816
|
+
return !!((j = z.groups) != null && j.length);
|
|
3817
3817
|
}) || !1
|
|
3818
3818
|
);
|
|
3819
|
-
function ce(
|
|
3820
|
-
var
|
|
3821
|
-
|
|
3819
|
+
function ce(z) {
|
|
3820
|
+
var j, le;
|
|
3821
|
+
z || (n.value = {
|
|
3822
3822
|
...n.value,
|
|
3823
3823
|
groups: [],
|
|
3824
3824
|
variant: {
|
|
3825
|
-
variantGroupIds: ((
|
|
3826
|
-
variantCombinations: ((
|
|
3827
|
-
...
|
|
3825
|
+
variantGroupIds: ((j = n.value.variant) == null ? void 0 : j.variantGroupIds) || [],
|
|
3826
|
+
variantCombinations: ((le = n.value.variant) == null ? void 0 : le.variantCombinations.map((de) => ({
|
|
3827
|
+
...de,
|
|
3828
3828
|
groups: []
|
|
3829
3829
|
}))) || []
|
|
3830
3830
|
}
|
|
3831
3831
|
}, O());
|
|
3832
3832
|
}
|
|
3833
3833
|
Oe(() => {
|
|
3834
|
-
var
|
|
3835
|
-
return (
|
|
3834
|
+
var z;
|
|
3835
|
+
return (z = n.value.price) == null ? void 0 : z.amount;
|
|
3836
3836
|
}, V, { deep: !0 });
|
|
3837
|
-
function
|
|
3837
|
+
function pe() {
|
|
3838
3838
|
n.value = o.initialForm ? ke(o.initialForm) : {
|
|
3839
|
-
...
|
|
3839
|
+
...je.generator.initMenuV4Item(),
|
|
3840
3840
|
category: o.categoryId
|
|
3841
3841
|
};
|
|
3842
3842
|
}
|
|
3843
3843
|
Oe(
|
|
3844
3844
|
() => o.initialForm,
|
|
3845
3845
|
() => {
|
|
3846
|
-
o.initialForm &&
|
|
3846
|
+
o.initialForm && pe();
|
|
3847
3847
|
}
|
|
3848
3848
|
), Xe(() => {
|
|
3849
|
-
|
|
3849
|
+
pe(), V(), r.pushDataLayer(
|
|
3850
3850
|
{
|
|
3851
3851
|
event: "menu_catalog_item_dialog_open",
|
|
3852
3852
|
item: JSON.stringify(n.value)
|
|
@@ -3856,85 +3856,85 @@ const Ia = {
|
|
|
3856
3856
|
}), Rt(() => {
|
|
3857
3857
|
try {
|
|
3858
3858
|
bn();
|
|
3859
|
-
} catch (
|
|
3860
|
-
console.log(
|
|
3859
|
+
} catch (z) {
|
|
3860
|
+
console.log(z);
|
|
3861
3861
|
}
|
|
3862
3862
|
});
|
|
3863
3863
|
function O() {
|
|
3864
3864
|
m("update:editingState", uo(Ve.cloneDeep(n.value)));
|
|
3865
3865
|
}
|
|
3866
|
-
const
|
|
3867
|
-
function
|
|
3866
|
+
const te = ee(null);
|
|
3867
|
+
function ve() {
|
|
3868
3868
|
return !Ve.isEqual(n.value, o.initialForm);
|
|
3869
3869
|
}
|
|
3870
|
-
function
|
|
3871
|
-
var
|
|
3872
|
-
return (
|
|
3870
|
+
function me() {
|
|
3871
|
+
var z;
|
|
3872
|
+
return (z = te.value) == null ? void 0 : z.validateInputsWithoutSubmit();
|
|
3873
3873
|
}
|
|
3874
3874
|
function I() {
|
|
3875
3875
|
return n.value;
|
|
3876
3876
|
}
|
|
3877
|
-
async function E(
|
|
3878
|
-
const
|
|
3879
|
-
if (
|
|
3880
|
-
if (
|
|
3881
|
-
const
|
|
3882
|
-
await new Promise((
|
|
3883
|
-
const
|
|
3884
|
-
|
|
3877
|
+
async function E(z, j = !1) {
|
|
3878
|
+
const le = document.getElementById(z);
|
|
3879
|
+
if (le) {
|
|
3880
|
+
if (le.scrollIntoView({ behavior: "smooth" }), j) {
|
|
3881
|
+
const de = le.tagName === "INPUT" || le.tagName === "BUTTON" || le.tagName === "TEXTAREA";
|
|
3882
|
+
await new Promise((ge) => setTimeout(ge, 500));
|
|
3883
|
+
const ae = de ? le : le.querySelector("input, button, textarea");
|
|
3884
|
+
ae && (ae == null || ae.focus());
|
|
3885
3885
|
}
|
|
3886
3886
|
} else
|
|
3887
|
-
console.warn(`Element with id ${
|
|
3887
|
+
console.warn(`Element with id ${z} not found`);
|
|
3888
3888
|
}
|
|
3889
|
-
function d(
|
|
3890
|
-
|
|
3889
|
+
function d(z) {
|
|
3890
|
+
z.type === "general" ? E(De.GENERAL) : z.type === "price" ? E(De.PRICE, !0) : z.type === "variant" ? E(ft(De.VARIANT, z.id), !0) : z.type === "group" && E(ft(De.GROUP, z.id), !0);
|
|
3891
3891
|
}
|
|
3892
3892
|
En(() => {
|
|
3893
3893
|
o.focused && d(o.focused);
|
|
3894
3894
|
});
|
|
3895
|
-
function R(
|
|
3896
|
-
var
|
|
3895
|
+
function R(z) {
|
|
3896
|
+
var j;
|
|
3897
3897
|
S("serveDelay", {
|
|
3898
|
-
enabled:
|
|
3899
|
-
overriders: ((
|
|
3898
|
+
enabled: z,
|
|
3899
|
+
overriders: ((j = n.value.serveDelay) == null ? void 0 : j.overriders) ?? []
|
|
3900
3900
|
});
|
|
3901
3901
|
}
|
|
3902
|
-
function L(
|
|
3903
|
-
var
|
|
3904
|
-
const
|
|
3902
|
+
function L(z) {
|
|
3903
|
+
var ae, ge;
|
|
3904
|
+
const j = ((ae = n.value.serveDelay) == null ? void 0 : ae.enabled) ?? !1, le = (((ge = n.value.serveDelay) == null ? void 0 : ge.overriders) ?? []).map((Q) => ({
|
|
3905
3905
|
...Q,
|
|
3906
|
-
isDefault:
|
|
3907
|
-
})),
|
|
3908
|
-
|
|
3909
|
-
enabled:
|
|
3910
|
-
overriders:
|
|
3906
|
+
isDefault: z.isDefault ? !1 : Q.isDefault
|
|
3907
|
+
})), de = le.findIndex((Q) => Q.id === z.id);
|
|
3908
|
+
de >= 0 ? le[de] = { ...le[de], isDefault: z.isDefault } : le.push({ id: z.id, isDefault: z.isDefault }), S("serveDelay", {
|
|
3909
|
+
enabled: j,
|
|
3910
|
+
overriders: le
|
|
3911
3911
|
});
|
|
3912
3912
|
}
|
|
3913
|
-
function X(
|
|
3914
|
-
var
|
|
3915
|
-
const
|
|
3913
|
+
function X(z) {
|
|
3914
|
+
var Ne, nt;
|
|
3915
|
+
const j = ((Ne = n.value.serveDelay) == null ? void 0 : Ne.enabled) ?? !1, de = (((nt = n.value.serveDelay) == null ? void 0 : nt.overriders) ?? []).filter((Ue) => z.includes(Ue.id)), ae = new Set(de.map((Ue) => Ue.id)), Q = z.filter((Ue) => !ae.has(Ue)).map((Ue) => ({ id: Ue }));
|
|
3916
3916
|
S("serveDelay", {
|
|
3917
|
-
enabled:
|
|
3918
|
-
overriders: [...
|
|
3917
|
+
enabled: j,
|
|
3918
|
+
overriders: [...de, ...Q]
|
|
3919
3919
|
});
|
|
3920
3920
|
}
|
|
3921
3921
|
return a({
|
|
3922
|
-
validate:
|
|
3922
|
+
validate: me,
|
|
3923
3923
|
getData: I,
|
|
3924
|
-
hasUnsavedChanges:
|
|
3925
|
-
}), (
|
|
3926
|
-
const
|
|
3927
|
-
return A(),
|
|
3924
|
+
hasUnsavedChanges: ve
|
|
3925
|
+
}), (z, j) => {
|
|
3926
|
+
const le = H("FmBreadcrumb"), de = H("FmForm");
|
|
3927
|
+
return A(), ne(de, {
|
|
3928
3928
|
id: e(De).GENERAL,
|
|
3929
3929
|
class: $e(["tree-item-form", ["flex-1 py-24 space-y-24", "xs:w-full"]]),
|
|
3930
3930
|
ref_key: "formWrapper",
|
|
3931
|
-
ref:
|
|
3931
|
+
ref: te,
|
|
3932
3932
|
"blame-form-child-on-validation-failed": !0
|
|
3933
3933
|
}, {
|
|
3934
3934
|
default: q(() => {
|
|
3935
|
-
var
|
|
3935
|
+
var ae, ge;
|
|
3936
3936
|
return [
|
|
3937
|
-
s(
|
|
3937
|
+
s(le, {
|
|
3938
3938
|
ref_key: "breadCrumbRef",
|
|
3939
3939
|
ref: C,
|
|
3940
3940
|
items: _.value
|
|
@@ -3943,8 +3943,8 @@ const Ia = {
|
|
|
3943
3943
|
s(qe, {
|
|
3944
3944
|
toggle: u.value,
|
|
3945
3945
|
"onUpdate:toggle": [
|
|
3946
|
-
|
|
3947
|
-
|
|
3946
|
+
j[0] || (j[0] = (Q) => u.value = Q),
|
|
3947
|
+
j[1] || (j[1] = (Q) => f(Q))
|
|
3948
3948
|
],
|
|
3949
3949
|
disabled: !$.value,
|
|
3950
3950
|
description: e(F)("menu.product.form.sections.general.description"),
|
|
@@ -3966,7 +3966,7 @@ const Ia = {
|
|
|
3966
3966
|
_: 1
|
|
3967
3967
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
3968
3968
|
$.value ? Z("", !0) : (A(), J("div", Aa)),
|
|
3969
|
-
D.value ? (A(),
|
|
3969
|
+
D.value ? (A(), ne(Me, {
|
|
3970
3970
|
key: 1,
|
|
3971
3971
|
title: e(F)("menu.product.form.sections.tagging.title"),
|
|
3972
3972
|
"sub-title": e(F)("menu.product.form.sections.tagging.subtitle")
|
|
@@ -3975,7 +3975,7 @@ const Ia = {
|
|
|
3975
3975
|
s(e(mn), {
|
|
3976
3976
|
entity: "item",
|
|
3977
3977
|
"model-value": n.value.customAttributes || {},
|
|
3978
|
-
"onUpdate:modelValue":
|
|
3978
|
+
"onUpdate:modelValue": j[2] || (j[2] = (Q) => S("customAttributes", Q)),
|
|
3979
3979
|
"value-options": N.value
|
|
3980
3980
|
}, null, 8, ["model-value", "value-options"])
|
|
3981
3981
|
]),
|
|
@@ -3985,8 +3985,8 @@ const Ia = {
|
|
|
3985
3985
|
s(qe, {
|
|
3986
3986
|
toggle: h.value,
|
|
3987
3987
|
"onUpdate:toggle": [
|
|
3988
|
-
|
|
3989
|
-
|
|
3988
|
+
j[3] || (j[3] = (Q) => h.value = Q),
|
|
3989
|
+
j[4] || (j[4] = (Q) => g(Q))
|
|
3990
3990
|
],
|
|
3991
3991
|
disabled: !$.value,
|
|
3992
3992
|
description: e(F)("menu.product.form.sections.price.description"),
|
|
@@ -4004,12 +4004,12 @@ const Ia = {
|
|
|
4004
4004
|
_: 1
|
|
4005
4005
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
4006
4006
|
P.value.print && !$.value ? (A(), J("div", La)) : Z("", !0),
|
|
4007
|
-
P.value.print ? (A(),
|
|
4007
|
+
P.value.print ? (A(), ne(qe, {
|
|
4008
4008
|
key: 4,
|
|
4009
4009
|
toggle: G.value,
|
|
4010
4010
|
"onUpdate:toggle": [
|
|
4011
|
-
|
|
4012
|
-
|
|
4011
|
+
j[6] || (j[6] = (Q) => G.value = Q),
|
|
4012
|
+
j[7] || (j[7] = (Q) => B(Q))
|
|
4013
4013
|
],
|
|
4014
4014
|
description: "Use a different print setting",
|
|
4015
4015
|
disabled: "",
|
|
@@ -4023,7 +4023,7 @@ const Ia = {
|
|
|
4023
4023
|
"is-addon": x.value,
|
|
4024
4024
|
"is-override": $.value,
|
|
4025
4025
|
"onUpdate:form": S,
|
|
4026
|
-
"onReplace:form":
|
|
4026
|
+
"onReplace:form": j[5] || (j[5] = (Q) => Y(Q))
|
|
4027
4027
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4028
4028
|
]),
|
|
4029
4029
|
_: 1
|
|
@@ -4032,8 +4032,8 @@ const Ia = {
|
|
|
4032
4032
|
s(qe, {
|
|
4033
4033
|
toggle: U.value,
|
|
4034
4034
|
"onUpdate:toggle": [
|
|
4035
|
-
|
|
4036
|
-
|
|
4035
|
+
j[9] || (j[9] = (Q) => U.value = Q),
|
|
4036
|
+
j[10] || (j[10] = (Q) => l(Q))
|
|
4037
4037
|
],
|
|
4038
4038
|
disabled: !$.value,
|
|
4039
4039
|
description: e(F)("menu.product.form.sections.variant.description"),
|
|
@@ -4047,18 +4047,18 @@ const Ia = {
|
|
|
4047
4047
|
"is-addon": x.value,
|
|
4048
4048
|
"is-override": $.value,
|
|
4049
4049
|
"onUpdate:form": S,
|
|
4050
|
-
"onReplace:form":
|
|
4050
|
+
"onReplace:form": j[8] || (j[8] = (Q) => Y(Q))
|
|
4051
4051
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4052
4052
|
]),
|
|
4053
4053
|
_: 1
|
|
4054
4054
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
4055
4055
|
P.value.group && !$.value ? (A(), J("div", Ka)) : Z("", !0),
|
|
4056
|
-
P.value.group ? (A(),
|
|
4056
|
+
P.value.group ? (A(), ne(qe, {
|
|
4057
4057
|
key: 7,
|
|
4058
|
-
toggle:
|
|
4058
|
+
toggle: oe.value,
|
|
4059
4059
|
"onUpdate:toggle": [
|
|
4060
|
-
|
|
4061
|
-
|
|
4060
|
+
j[12] || (j[12] = (Q) => oe.value = Q),
|
|
4061
|
+
j[13] || (j[13] = (Q) => ce(Q))
|
|
4062
4062
|
],
|
|
4063
4063
|
disabled: !$.value,
|
|
4064
4064
|
description: "Use a different group setting",
|
|
@@ -4072,18 +4072,18 @@ const Ia = {
|
|
|
4072
4072
|
"is-addon": x.value,
|
|
4073
4073
|
"is-override": $.value,
|
|
4074
4074
|
"onUpdate:form": S,
|
|
4075
|
-
"onReplace:form":
|
|
4075
|
+
"onReplace:form": j[11] || (j[11] = (Q) => Y(Q))
|
|
4076
4076
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4077
4077
|
]),
|
|
4078
4078
|
_: 1
|
|
4079
4079
|
}, 8, ["toggle", "disabled"])) : Z("", !0),
|
|
4080
4080
|
P.value.inventory && !$.value ? (A(), J("div", Ba)) : Z("", !0),
|
|
4081
|
-
P.value.inventory ? (A(),
|
|
4081
|
+
P.value.inventory ? (A(), ne(qe, {
|
|
4082
4082
|
key: 9,
|
|
4083
4083
|
toggle: v.value,
|
|
4084
4084
|
"onUpdate:toggle": [
|
|
4085
|
-
|
|
4086
|
-
|
|
4085
|
+
j[15] || (j[15] = (Q) => v.value = Q),
|
|
4086
|
+
j[16] || (j[16] = (Q) => w(Q))
|
|
4087
4087
|
],
|
|
4088
4088
|
disabled: !$.value,
|
|
4089
4089
|
description: e(F)("menu.product.form.sections.inventory.description"),
|
|
@@ -4097,18 +4097,18 @@ const Ia = {
|
|
|
4097
4097
|
"is-addon": x.value,
|
|
4098
4098
|
"is-override": $.value,
|
|
4099
4099
|
"onUpdate:form": S,
|
|
4100
|
-
"onReplace:form":
|
|
4100
|
+
"onReplace:form": j[14] || (j[14] = (Q) => Y(Q))
|
|
4101
4101
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4102
4102
|
]),
|
|
4103
4103
|
_: 1
|
|
4104
4104
|
}, 8, ["toggle", "disabled", "description", "title"])) : Z("", !0),
|
|
4105
|
-
P.value.takeaway(n.value.category ?? ((
|
|
4106
|
-
P.value.takeaway(n.value.category ?? ((
|
|
4105
|
+
P.value.takeaway(n.value.category ?? ((ae = y.value) == null ? void 0 : ae.category)) && !$.value ? (A(), J("div", za)) : Z("", !0),
|
|
4106
|
+
P.value.takeaway(n.value.category ?? ((ge = y.value) == null ? void 0 : ge.category)) ? (A(), ne(qe, {
|
|
4107
4107
|
key: 11,
|
|
4108
4108
|
toggle: p.value,
|
|
4109
4109
|
"onUpdate:toggle": [
|
|
4110
|
-
|
|
4111
|
-
|
|
4110
|
+
j[18] || (j[18] = (Q) => p.value = Q),
|
|
4111
|
+
j[19] || (j[19] = (Q) => k(Q))
|
|
4112
4112
|
],
|
|
4113
4113
|
disabled: !$.value,
|
|
4114
4114
|
description: e(F)("menu.product.form.sections.takeaway.description"),
|
|
@@ -4122,18 +4122,18 @@ const Ia = {
|
|
|
4122
4122
|
"is-addon": x.value,
|
|
4123
4123
|
"is-override": $.value,
|
|
4124
4124
|
"onUpdate:form": S,
|
|
4125
|
-
"onReplace:form":
|
|
4125
|
+
"onReplace:form": j[17] || (j[17] = (Q) => Y(Q))
|
|
4126
4126
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
4127
4127
|
]),
|
|
4128
4128
|
_: 1
|
|
4129
4129
|
}, 8, ["toggle", "disabled", "description", "title"])) : Z("", !0),
|
|
4130
4130
|
P.value.serveDelay && !$.value ? (A(), J("div", ja)) : Z("", !0),
|
|
4131
|
-
P.value.serveDelay ? (A(),
|
|
4131
|
+
P.value.serveDelay ? (A(), ne(so, {
|
|
4132
4132
|
key: 13,
|
|
4133
4133
|
form: n.value,
|
|
4134
|
-
"onUpdate:linkedOrderPacing":
|
|
4135
|
-
"onUpdate:defaultPreset":
|
|
4136
|
-
"onUpdate:enabled":
|
|
4134
|
+
"onUpdate:linkedOrderPacing": j[20] || (j[20] = (Q) => X(Q)),
|
|
4135
|
+
"onUpdate:defaultPreset": j[21] || (j[21] = (Q) => L(Q)),
|
|
4136
|
+
"onUpdate:enabled": j[22] || (j[22] = (Q) => R(Q))
|
|
4137
4137
|
}, null, 8, ["form"])) : Z("", !0)
|
|
4138
4138
|
];
|
|
4139
4139
|
}),
|
|
@@ -4172,7 +4172,7 @@ const Wa = {
|
|
|
4172
4172
|
}, Ha = { class: "flex-1 pr-24" }, Xa = {
|
|
4173
4173
|
key: 0,
|
|
4174
4174
|
class: "absolute inset-0 flex items-center justify-center bg-white bg-opacity-70"
|
|
4175
|
-
}, Qa = "tree-editor-left-panel-width", Ja = 300, Za = 600, el = 300, tl = /* @__PURE__ */
|
|
4175
|
+
}, Qa = "tree-editor-left-panel-width", Ja = 300, Za = 600, el = 300, tl = /* @__PURE__ */ fe({
|
|
4176
4176
|
__name: "TreeEditorLayout",
|
|
4177
4177
|
setup(i) {
|
|
4178
4178
|
const {
|
|
@@ -4194,7 +4194,7 @@ const Wa = {
|
|
|
4194
4194
|
style: mt({ width: `${e(a)}px`, backgroundColor: "#FDFDFE" }),
|
|
4195
4195
|
class: "flex-shrink-0 pl-24"
|
|
4196
4196
|
}, [
|
|
4197
|
-
|
|
4197
|
+
Be(m.$slots, "left-panel", {}, void 0, !0)
|
|
4198
4198
|
], 4),
|
|
4199
4199
|
K("div", Wa, [
|
|
4200
4200
|
K("div", {
|
|
@@ -4204,14 +4204,14 @@ const Wa = {
|
|
|
4204
4204
|
}, null, 32)
|
|
4205
4205
|
]),
|
|
4206
4206
|
K("div", Ha, [
|
|
4207
|
-
|
|
4207
|
+
Be(m.$slots, "right-panel", {}, void 0, !0)
|
|
4208
4208
|
]),
|
|
4209
4209
|
m.$slots.overlay ? (A(), J("div", Xa, [
|
|
4210
|
-
|
|
4210
|
+
Be(m.$slots, "overlay", {}, void 0, !0)
|
|
4211
4211
|
])) : Z("", !0)
|
|
4212
4212
|
], 512));
|
|
4213
4213
|
}
|
|
4214
|
-
}), nl = /* @__PURE__ */
|
|
4214
|
+
}), nl = /* @__PURE__ */ it(tl, [["__scopeId", "data-v-570141b0"]]);
|
|
4215
4215
|
var Ee = /* @__PURE__ */ ((i) => (i.SELECT_CATEGORY = "SELECT_CATEGORY", i.CREATE_CATEGORY = "CREATE_CATEGORY", i.UPDATE_CATEGORY = "UPDATE_CATEGORY", i.DELETE_CATEGORY = "DELETE_CATEGORY", i.SELECT_ITEM = "SELECT_ITEM", i.CREATE_ITEM = "CREATE_ITEM", i.UPDATE_ITEM = "UPDATE_ITEM", i.DELETE_ITEM = "DELETE_ITEM", i.SELECT_PRICE = "SELECT_PRICE", i.SELECT_VARIANT = "SELECT_VARIANT", i.SELECT_GROUP = "SELECT_GROUP", i.EDIT_GROUP = "EDIT_GROUP", i))(Ee || {});
|
|
4216
4216
|
function ol(i, a, t) {
|
|
4217
4217
|
const o = () => ({
|
|
@@ -4224,10 +4224,10 @@ function ol(i, a, t) {
|
|
|
4224
4224
|
return Object.assign(r, t), m;
|
|
4225
4225
|
}
|
|
4226
4226
|
function kn() {
|
|
4227
|
-
const i =
|
|
4227
|
+
const i = be(), a = Ye();
|
|
4228
4228
|
async function t(F, c = "New product") {
|
|
4229
4229
|
const _ = {
|
|
4230
|
-
...
|
|
4230
|
+
...je.generator.initMenuV4Item(),
|
|
4231
4231
|
category: F,
|
|
4232
4232
|
name: c
|
|
4233
4233
|
};
|
|
@@ -4302,10 +4302,10 @@ function kn() {
|
|
|
4302
4302
|
updateItem: b
|
|
4303
4303
|
};
|
|
4304
4304
|
}
|
|
4305
|
-
var
|
|
4306
|
-
const
|
|
4305
|
+
var rt = /* @__PURE__ */ ((i) => (i.CATEGORY = "category", i.ITEM = "item", i.SUB_CATEGORY = "subCategory", i))(rt || {});
|
|
4306
|
+
const ot = /* @__PURE__ */ new Map(), dt = /* @__PURE__ */ new Map();
|
|
4307
4307
|
function rl() {
|
|
4308
|
-
const { t: i } = _e(), a =
|
|
4308
|
+
const { t: i } = _e(), a = be(), t = _t(), o = kn(), m = M(
|
|
4309
4309
|
() => a.subcategories.reduce((n, T) => (n[T._id] = T, n), {})
|
|
4310
4310
|
);
|
|
4311
4311
|
function r(n) {
|
|
@@ -4332,7 +4332,7 @@ function rl() {
|
|
|
4332
4332
|
for (const x of T.children ?? []) {
|
|
4333
4333
|
if (((Y = x.meta) == null ? void 0 : Y.nodeType) !== "item")
|
|
4334
4334
|
continue;
|
|
4335
|
-
const D =
|
|
4335
|
+
const D = ot.get((V = x.meta) == null ? void 0 : V.rawId);
|
|
4336
4336
|
if (!(D != null && D.subCategories) || !D.subCategories.length)
|
|
4337
4337
|
($ = S.children) == null || $.push(x);
|
|
4338
4338
|
else {
|
|
@@ -4351,7 +4351,7 @@ function rl() {
|
|
|
4351
4351
|
const g = {
|
|
4352
4352
|
id: `category-${T.label}-sub-category-${f}`,
|
|
4353
4353
|
label: r(N),
|
|
4354
|
-
icon:
|
|
4354
|
+
icon: Le.CATEGORY,
|
|
4355
4355
|
children: [],
|
|
4356
4356
|
draggable: !0,
|
|
4357
4357
|
meta: {
|
|
@@ -4406,40 +4406,40 @@ function rl() {
|
|
|
4406
4406
|
return n.map(C);
|
|
4407
4407
|
}
|
|
4408
4408
|
async function y({ eventEmitter: n }) {
|
|
4409
|
-
var
|
|
4410
|
-
const T = a.state.menu, S = !a.state.currentCatalogId, Y = !a.state.currentSchedulerId, V = (((
|
|
4411
|
-
|
|
4409
|
+
var B, oe, ce, pe;
|
|
4410
|
+
const T = a.state.menu, S = !a.state.currentCatalogId, Y = !a.state.currentSchedulerId, V = (((oe = (B = a.currentCatalog) == null ? void 0 : B.linkItemRules) == null ? void 0 : oe.length) ?? 0) > 0, $ = No(), x = a.mergedMenu;
|
|
4411
|
+
ot.clear(), dt.clear();
|
|
4412
4412
|
for (const O of T.modules.item)
|
|
4413
|
-
|
|
4413
|
+
ot.set(O._id, O);
|
|
4414
4414
|
for (const O of x.modules.group)
|
|
4415
4415
|
dt.set(O._id, O);
|
|
4416
|
-
function D(O,
|
|
4416
|
+
function D(O, te) {
|
|
4417
4417
|
return {
|
|
4418
4418
|
id: `add-item-${O}`,
|
|
4419
4419
|
icon: "add",
|
|
4420
4420
|
showOnHover: !0,
|
|
4421
4421
|
tooltip: i("menu.tree_editor.actions.add_product"),
|
|
4422
4422
|
onClick: () => {
|
|
4423
|
-
|
|
4423
|
+
te.createItem(O);
|
|
4424
4424
|
}
|
|
4425
4425
|
};
|
|
4426
4426
|
}
|
|
4427
|
-
function u(O,
|
|
4427
|
+
function u(O, te, ve) {
|
|
4428
4428
|
var I;
|
|
4429
|
-
const
|
|
4430
|
-
(E) => E._id ===
|
|
4429
|
+
const me = x.modules.group.find(
|
|
4430
|
+
(E) => E._id === ve._id
|
|
4431
4431
|
);
|
|
4432
|
-
if (!
|
|
4433
|
-
throw new Error(`Item ${O._id} has unknown group ${
|
|
4434
|
-
return (I =
|
|
4435
|
-
var
|
|
4436
|
-
const R = !!E.combinationKey, L = (
|
|
4437
|
-
(
|
|
4438
|
-
), X = (
|
|
4439
|
-
(
|
|
4432
|
+
if (!me)
|
|
4433
|
+
throw new Error(`Item ${O._id} has unknown group ${ve._id}`);
|
|
4434
|
+
return (I = me.items) == null ? void 0 : I.map((E, d) => {
|
|
4435
|
+
var le, de;
|
|
4436
|
+
const R = !!E.combinationKey, L = (le = ve.items) == null ? void 0 : le.find(
|
|
4437
|
+
(ae) => ae._id === E._id && ae.combinationKey === E.combinationKey
|
|
4438
|
+
), X = (de = ve.items) == null ? void 0 : de.find(
|
|
4439
|
+
(ae) => ae._id === E._id && !ae.combinationKey
|
|
4440
4440
|
);
|
|
4441
4441
|
function W() {
|
|
4442
|
-
var
|
|
4442
|
+
var ae;
|
|
4443
4443
|
if (R && (L != null && L.price))
|
|
4444
4444
|
return {
|
|
4445
4445
|
price: L.price,
|
|
@@ -4453,55 +4453,55 @@ function rl() {
|
|
|
4453
4453
|
if (E.price)
|
|
4454
4454
|
return { price: E.price, overrided: !1 };
|
|
4455
4455
|
if (!E.price) {
|
|
4456
|
-
const
|
|
4456
|
+
const ge = (ae = me == null ? void 0 : me.items) == null ? void 0 : ae.find(
|
|
4457
4457
|
(Q) => Q._id === E._id && !Q.combinationKey
|
|
4458
4458
|
);
|
|
4459
|
-
if (
|
|
4460
|
-
return { price:
|
|
4459
|
+
if (ge != null && ge.price)
|
|
4460
|
+
return { price: ge.price, overrided: !1 };
|
|
4461
4461
|
}
|
|
4462
4462
|
return { price: null, overrided: !1 };
|
|
4463
4463
|
}
|
|
4464
|
-
function
|
|
4465
|
-
var
|
|
4464
|
+
function re() {
|
|
4465
|
+
var ge, Q;
|
|
4466
4466
|
if (E.code)
|
|
4467
4467
|
return E.code;
|
|
4468
|
-
const
|
|
4469
|
-
if (
|
|
4470
|
-
return R ? (Q = (
|
|
4471
|
-
(
|
|
4472
|
-
)) == null ? void 0 : Q.code :
|
|
4468
|
+
const ae = ot.get(E._id);
|
|
4469
|
+
if (ae)
|
|
4470
|
+
return R ? (Q = (ge = ae.variant) == null ? void 0 : ge.variantCombinations.find(
|
|
4471
|
+
(Ne) => Ne.combinationKey === E.combinationKey
|
|
4472
|
+
)) == null ? void 0 : Q.code : ae.code;
|
|
4473
4473
|
}
|
|
4474
|
-
function
|
|
4474
|
+
function ie() {
|
|
4475
4475
|
if (E.name)
|
|
4476
4476
|
return E.name;
|
|
4477
|
-
const
|
|
4478
|
-
return
|
|
4477
|
+
const ae = x.modules.item.find((ge) => ge._id === E._id);
|
|
4478
|
+
return ae ? ae.name : i("menu.tree_editor.labels.unknown");
|
|
4479
4479
|
}
|
|
4480
|
-
function
|
|
4481
|
-
const
|
|
4482
|
-
return
|
|
4480
|
+
function ue() {
|
|
4481
|
+
const ae = (L == null ? void 0 : L.orderFrom) || E.orderFrom;
|
|
4482
|
+
return ae ? Ct(ae) : null;
|
|
4483
4483
|
}
|
|
4484
|
-
const { price: we, overrided:
|
|
4484
|
+
const { price: we, overrided: z } = W(), j = {
|
|
4485
4485
|
label: Te.Dinero.fromFdoDinero(we).toFormat(!0),
|
|
4486
|
-
variant:
|
|
4486
|
+
variant: z ? tt.PRIMARY : tt.PLAIN
|
|
4487
4487
|
};
|
|
4488
4488
|
return {
|
|
4489
|
-
id: `item-${O._id}-variant-${
|
|
4490
|
-
icon: E.combinationKey ?
|
|
4491
|
-
label: en(
|
|
4492
|
-
rightLabel:
|
|
4493
|
-
chips:
|
|
4489
|
+
id: `item-${O._id}-variant-${te == null ? void 0 : te.combinationKey}-group-${ve._id}-${E._id}-${E.combinationKey}-${d}`,
|
|
4490
|
+
icon: E.combinationKey ? Le.VARIANT : Le.ITEM,
|
|
4491
|
+
label: en(ie(), re()),
|
|
4492
|
+
rightLabel: j,
|
|
4493
|
+
chips: ue() ? [ue()] : void 0
|
|
4494
4494
|
};
|
|
4495
4495
|
});
|
|
4496
4496
|
}
|
|
4497
|
-
function f(O,
|
|
4498
|
-
const
|
|
4497
|
+
function f(O, te) {
|
|
4498
|
+
const ve = (R) => te ? `item-${O._id}-variant-${te.combinationKey}-group-${R}` : `item-${O._id}-group-${R}`, me = [];
|
|
4499
4499
|
function I() {
|
|
4500
4500
|
var L;
|
|
4501
4501
|
const R = [];
|
|
4502
|
-
if (
|
|
4502
|
+
if (te)
|
|
4503
4503
|
for (const X of O.groups || []) {
|
|
4504
|
-
const W = (L =
|
|
4504
|
+
const W = (L = te.groups) == null ? void 0 : L.find((re) => re._id === X._id);
|
|
4505
4505
|
W ? R.push(W) : R.push(X);
|
|
4506
4506
|
}
|
|
4507
4507
|
else
|
|
@@ -4520,11 +4520,11 @@ function rl() {
|
|
|
4520
4520
|
const L = dt.get(R._id);
|
|
4521
4521
|
if (!L)
|
|
4522
4522
|
throw new Error(`Item ${O._id} has unknown group ${R._id}`);
|
|
4523
|
-
|
|
4524
|
-
id:
|
|
4525
|
-
icon:
|
|
4523
|
+
me.push({
|
|
4524
|
+
id: ve(L._id),
|
|
4525
|
+
icon: Le.GROUP,
|
|
4526
4526
|
label: L.name,
|
|
4527
|
-
children: u(O,
|
|
4527
|
+
children: u(O, te, R),
|
|
4528
4528
|
onClick: () => {
|
|
4529
4529
|
n({
|
|
4530
4530
|
type: Ee.SELECT_GROUP,
|
|
@@ -4534,19 +4534,19 @@ function rl() {
|
|
|
4534
4534
|
}
|
|
4535
4535
|
});
|
|
4536
4536
|
}
|
|
4537
|
-
return
|
|
4537
|
+
return me;
|
|
4538
4538
|
}
|
|
4539
|
-
function N(O,
|
|
4540
|
-
return f(O,
|
|
4539
|
+
function N(O, te) {
|
|
4540
|
+
return f(O, te);
|
|
4541
4541
|
}
|
|
4542
4542
|
function h(O) {
|
|
4543
4543
|
var I;
|
|
4544
|
-
const
|
|
4545
|
-
if (
|
|
4544
|
+
const te = [], ve = O.groups && O.groups.length > 0, me = ((I = O.variant) == null ? void 0 : I.variantGroupIds) && O.variant.variantGroupIds.length > 0;
|
|
4545
|
+
if (ve && !me) {
|
|
4546
4546
|
const E = f(O);
|
|
4547
|
-
|
|
4547
|
+
te.push(...E);
|
|
4548
4548
|
}
|
|
4549
|
-
if (
|
|
4549
|
+
if (me) {
|
|
4550
4550
|
const E = (L, X) => `item-${L}-variant-${X}`, d = fn(
|
|
4551
4551
|
T.modules.variant,
|
|
4552
4552
|
O.variant.variantGroupIds
|
|
@@ -4557,7 +4557,7 @@ function rl() {
|
|
|
4557
4557
|
), W = It([], X);
|
|
4558
4558
|
return {
|
|
4559
4559
|
id: E(O._id, L.combinationKey),
|
|
4560
|
-
icon:
|
|
4560
|
+
icon: Le.VARIANT,
|
|
4561
4561
|
label: en(
|
|
4562
4562
|
Xo(d, L.combinationKey),
|
|
4563
4563
|
L.code
|
|
@@ -4575,16 +4575,16 @@ function rl() {
|
|
|
4575
4575
|
};
|
|
4576
4576
|
}
|
|
4577
4577
|
);
|
|
4578
|
-
|
|
4578
|
+
te.push(...R);
|
|
4579
4579
|
}
|
|
4580
|
-
return
|
|
4580
|
+
return te;
|
|
4581
4581
|
}
|
|
4582
4582
|
const g = (O) => `category-${O}`, U = kt(
|
|
4583
4583
|
x.modules.category,
|
|
4584
4584
|
(O) => O.name
|
|
4585
4585
|
).map((O) => {
|
|
4586
|
-
const
|
|
4587
|
-
return a.rules.category.create &&
|
|
4586
|
+
const te = [];
|
|
4587
|
+
return a.rules.category.create && te.push(D(O._id, o)), a.rules.category.edit && te.push({
|
|
4588
4588
|
id: `update-category-${O._id}`,
|
|
4589
4589
|
icon: "edit",
|
|
4590
4590
|
showOnHover: !0,
|
|
@@ -4592,7 +4592,7 @@ function rl() {
|
|
|
4592
4592
|
onClick: () => {
|
|
4593
4593
|
t.update(O);
|
|
4594
4594
|
}
|
|
4595
|
-
}), a.rules.category.delete &&
|
|
4595
|
+
}), a.rules.category.delete && te.push({
|
|
4596
4596
|
id: `delete-category-${O._id}`,
|
|
4597
4597
|
icon: "delete",
|
|
4598
4598
|
showOnHover: !0,
|
|
@@ -4600,21 +4600,21 @@ function rl() {
|
|
|
4600
4600
|
onClick: () => {
|
|
4601
4601
|
t.deleteCategory(O);
|
|
4602
4602
|
}
|
|
4603
|
-
}), !S && Y && !V &&
|
|
4603
|
+
}), !S && Y && !V && te.push({
|
|
4604
4604
|
id: `apply-to-catalog-${O._id}`,
|
|
4605
4605
|
icon: "add_link",
|
|
4606
4606
|
showOnHover: !0,
|
|
4607
4607
|
tooltip: i("menu.tree_editor.actions.link_category_to_catalog"),
|
|
4608
4608
|
onClick: () => {
|
|
4609
|
-
const
|
|
4610
|
-
$.addProduct(
|
|
4609
|
+
const ve = a.state.menu.modules.item.filter((me) => Xt(me).some(({ _id: E }) => E === O._id));
|
|
4610
|
+
$.addProduct(ve.map((me) => me._id));
|
|
4611
4611
|
}
|
|
4612
4612
|
}), {
|
|
4613
4613
|
id: g(O._id),
|
|
4614
|
-
icon:
|
|
4614
|
+
icon: Le.CATEGORY,
|
|
4615
4615
|
label: O.name,
|
|
4616
4616
|
children: [],
|
|
4617
|
-
actions:
|
|
4617
|
+
actions: te,
|
|
4618
4618
|
draggable: a.rules.category.sort,
|
|
4619
4619
|
meta: {
|
|
4620
4620
|
nodeType: "category",
|
|
@@ -4624,7 +4624,7 @@ function rl() {
|
|
|
4624
4624
|
};
|
|
4625
4625
|
}), l = yn(x), w = {
|
|
4626
4626
|
id: g("addon"),
|
|
4627
|
-
icon:
|
|
4627
|
+
icon: Le.CATEGORY,
|
|
4628
4628
|
label: i("menu.tree_editor.labels.addon"),
|
|
4629
4629
|
children: [],
|
|
4630
4630
|
// addon category is not draggable
|
|
@@ -4648,26 +4648,27 @@ function rl() {
|
|
|
4648
4648
|
showOnHover: !0,
|
|
4649
4649
|
tooltip: i("menu.tree_editor.actions.link_category_to_catalog"),
|
|
4650
4650
|
onClick: () => {
|
|
4651
|
-
const O = a.state.menu.modules.item.filter((
|
|
4652
|
-
$.addProduct(O.map((
|
|
4651
|
+
const O = a.state.menu.modules.item.filter((te) => !te.category);
|
|
4652
|
+
$.addProduct(O.map((te) => te._id));
|
|
4653
4653
|
}
|
|
4654
4654
|
}), U.push(w));
|
|
4655
|
-
const p = (O,
|
|
4656
|
-
for (const O of x.modules.item)
|
|
4655
|
+
const p = (O, te) => `item-${te ?? "addon"}-${O}`;
|
|
4656
|
+
for (const O of x.modules.item) {
|
|
4657
|
+
const te = ot.get(O._id);
|
|
4657
4658
|
Xt(O).forEach(({ _id: me }) => {
|
|
4658
|
-
var
|
|
4659
|
-
const
|
|
4660
|
-
if (
|
|
4661
|
-
const
|
|
4662
|
-
((
|
|
4663
|
-
i("menu.tree_editor.labels.groups", { count: (
|
|
4664
|
-
),
|
|
4665
|
-
((
|
|
4659
|
+
var E, d, R, L, X, W, re, ie;
|
|
4660
|
+
const I = me ? U.find((ue) => ue.id === g(me)) : w;
|
|
4661
|
+
if (I) {
|
|
4662
|
+
const ue = wt(
|
|
4663
|
+
((E = O.groups) == null ? void 0 : E.length) ?? 0,
|
|
4664
|
+
i("menu.tree_editor.labels.groups", { count: (d = O.groups) == null ? void 0 : d.length })
|
|
4665
|
+
), we = wt(
|
|
4666
|
+
((L = (R = O.variant) == null ? void 0 : R.variantCombinations) == null ? void 0 : L.length) ?? 0,
|
|
4666
4667
|
i("menu.tree_editor.labels.variants", {
|
|
4667
|
-
count: (
|
|
4668
|
+
count: (W = (X = O.variant) == null ? void 0 : X.variantCombinations) == null ? void 0 : W.length
|
|
4668
4669
|
})
|
|
4669
|
-
),
|
|
4670
|
-
a.rules.item.delete &&
|
|
4670
|
+
), z = Ct(O.orderFrom), j = It([], ue, we, z), le = [];
|
|
4671
|
+
a.rules.item.delete && le.push({
|
|
4671
4672
|
id: `delete-item-${O._id}`,
|
|
4672
4673
|
icon: "delete",
|
|
4673
4674
|
showOnHover: !0,
|
|
@@ -4676,10 +4677,10 @@ function rl() {
|
|
|
4676
4677
|
o.deleteItem(O);
|
|
4677
4678
|
}
|
|
4678
4679
|
});
|
|
4679
|
-
const
|
|
4680
|
-
(
|
|
4681
|
-
),
|
|
4682
|
-
!S && Y && !V && (
|
|
4680
|
+
const de = (re = a.currentCatalog) == null ? void 0 : re.override.items, ae = (ie = de == null ? void 0 : de[O._id]) == null ? void 0 : ie.find(
|
|
4681
|
+
(Ne) => !Ne.combinationKey
|
|
4682
|
+
), ge = (ae == null ? void 0 : ae.orderFrom) === ct.enum.NONE;
|
|
4683
|
+
!S && Y && !V && (ge ? le.push({
|
|
4683
4684
|
id: `apply-to-catalog-${O._id}`,
|
|
4684
4685
|
icon: "add_link",
|
|
4685
4686
|
showOnHover: !0,
|
|
@@ -4687,7 +4688,7 @@ function rl() {
|
|
|
4687
4688
|
onClick: () => {
|
|
4688
4689
|
$.addProduct([O._id]);
|
|
4689
4690
|
}
|
|
4690
|
-
}) :
|
|
4691
|
+
}) : le.push({
|
|
4691
4692
|
id: `remove-from-catalog-${O._id}`,
|
|
4692
4693
|
icon: "link_off",
|
|
4693
4694
|
showOnHover: !0,
|
|
@@ -4696,22 +4697,22 @@ function rl() {
|
|
|
4696
4697
|
$.removeProduct([O._id]);
|
|
4697
4698
|
}
|
|
4698
4699
|
}));
|
|
4699
|
-
const
|
|
4700
|
-
|
|
4700
|
+
const Q = O.code ? `${O.code}, ${O.name}` : O.name;
|
|
4701
|
+
I.children.push({
|
|
4701
4702
|
id: p(O._id, me),
|
|
4702
|
-
disabled:
|
|
4703
|
+
disabled: ge,
|
|
4703
4704
|
draggable: a.rules.item.sort,
|
|
4704
4705
|
meta: {
|
|
4705
4706
|
rawId: O._id,
|
|
4706
|
-
rawObject: O,
|
|
4707
|
+
rawObject: te ?? O,
|
|
4707
4708
|
nodeType: "item"
|
|
4708
4709
|
/* ITEM */
|
|
4709
4710
|
},
|
|
4710
|
-
icon:
|
|
4711
|
-
label:
|
|
4712
|
-
children:
|
|
4713
|
-
chips:
|
|
4714
|
-
rightLabel:
|
|
4711
|
+
icon: Le.ITEM,
|
|
4712
|
+
label: Q,
|
|
4713
|
+
children: ge ? void 0 : h(O),
|
|
4714
|
+
chips: ge ? void 0 : j,
|
|
4715
|
+
rightLabel: ge ? void 0 : {
|
|
4715
4716
|
label: Te.Dinero.fromFdoDinero(O.price).toFormat(!0),
|
|
4716
4717
|
onClick: () => {
|
|
4717
4718
|
n({
|
|
@@ -4720,7 +4721,7 @@ function rl() {
|
|
|
4720
4721
|
});
|
|
4721
4722
|
}
|
|
4722
4723
|
},
|
|
4723
|
-
actions:
|
|
4724
|
+
actions: le,
|
|
4724
4725
|
onClick: () => {
|
|
4725
4726
|
n({
|
|
4726
4727
|
type: Ee.SELECT_ITEM,
|
|
@@ -4731,14 +4732,15 @@ function rl() {
|
|
|
4731
4732
|
} else
|
|
4732
4733
|
throw new Error(`Item ${O._id} has unknown category ${O.category}`);
|
|
4733
4734
|
});
|
|
4735
|
+
}
|
|
4734
4736
|
for (const O of U) {
|
|
4735
|
-
const
|
|
4737
|
+
const te = wt(
|
|
4736
4738
|
((ce = O.children) == null ? void 0 : ce.length) ?? 0,
|
|
4737
4739
|
i("menu.tree_editor.labels.products", {
|
|
4738
|
-
count: (
|
|
4740
|
+
count: (pe = O.children) == null ? void 0 : pe.length
|
|
4739
4741
|
})
|
|
4740
4742
|
);
|
|
4741
|
-
|
|
4743
|
+
te && (O.chips = It(O.chips ?? [], te));
|
|
4742
4744
|
}
|
|
4743
4745
|
const k = F(U);
|
|
4744
4746
|
return b(k), {
|
|
@@ -4750,7 +4752,7 @@ function rl() {
|
|
|
4750
4752
|
};
|
|
4751
4753
|
}
|
|
4752
4754
|
function al() {
|
|
4753
|
-
const i =
|
|
4755
|
+
const i = Ye(), a = kn(), t = _t(), o = yt();
|
|
4754
4756
|
function m(h) {
|
|
4755
4757
|
i.open({
|
|
4756
4758
|
message: h,
|
|
@@ -4759,13 +4761,13 @@ function al() {
|
|
|
4759
4761
|
}
|
|
4760
4762
|
const r = (h) => {
|
|
4761
4763
|
var g;
|
|
4762
|
-
return ((g = h.meta) == null ? void 0 : g.nodeType) ===
|
|
4764
|
+
return ((g = h.meta) == null ? void 0 : g.nodeType) === rt.CATEGORY;
|
|
4763
4765
|
}, b = (h) => {
|
|
4764
4766
|
var g;
|
|
4765
|
-
return ((g = h.meta) == null ? void 0 : g.nodeType) ===
|
|
4767
|
+
return ((g = h.meta) == null ? void 0 : g.nodeType) === rt.ITEM;
|
|
4766
4768
|
}, F = (h) => {
|
|
4767
4769
|
var g;
|
|
4768
|
-
return ((g = h.meta) == null ? void 0 : g.nodeType) ===
|
|
4770
|
+
return ((g = h.meta) == null ? void 0 : g.nodeType) === rt.SUB_CATEGORY;
|
|
4769
4771
|
};
|
|
4770
4772
|
function c(h) {
|
|
4771
4773
|
let g = h;
|
|
@@ -4828,8 +4830,8 @@ function al() {
|
|
|
4828
4830
|
const w = T(h), p = T(g);
|
|
4829
4831
|
return (w == null ? void 0 : w.id) === (p == null ? void 0 : p.id) ? !0 : !((w == null ? void 0 : w.id) !== (p == null ? void 0 : p.id) && n(p).some(
|
|
4830
4832
|
(k) => {
|
|
4831
|
-
var G,
|
|
4832
|
-
return ((G = k.meta) == null ? void 0 : G.rawId) === ((
|
|
4833
|
+
var G, B;
|
|
4834
|
+
return ((G = k.meta) == null ? void 0 : G.rawId) === ((B = h.meta) == null ? void 0 : B.rawId);
|
|
4833
4835
|
}
|
|
4834
4836
|
));
|
|
4835
4837
|
}
|
|
@@ -4851,8 +4853,8 @@ function al() {
|
|
|
4851
4853
|
let w = l.findIndex((G) => G.id === g.id);
|
|
4852
4854
|
U === "after" && w++;
|
|
4853
4855
|
const p = l.map((G) => {
|
|
4854
|
-
var
|
|
4855
|
-
return (
|
|
4856
|
+
var B;
|
|
4857
|
+
return (B = G.meta) == null ? void 0 : B.rawId;
|
|
4856
4858
|
}).filter(Boolean), k = Tt(p, v, w);
|
|
4857
4859
|
await t.rearrange(k);
|
|
4858
4860
|
}
|
|
@@ -4878,7 +4880,7 @@ function al() {
|
|
|
4878
4880
|
}
|
|
4879
4881
|
async function x(h, g, U, l) {
|
|
4880
4882
|
var G;
|
|
4881
|
-
const v = C(g), w = ((G = g.children) == null ? void 0 : G.findIndex((
|
|
4883
|
+
const v = C(g), w = ((G = g.children) == null ? void 0 : G.findIndex((B) => B.id === h.id)) ?? -1;
|
|
4882
4884
|
if (w === -1) throw new Error("Source index not found");
|
|
4883
4885
|
const p = Tt(v, w, U), k = _(g);
|
|
4884
4886
|
await a.rearrangeWithSubCategory(p, l, k);
|
|
@@ -4891,7 +4893,7 @@ function al() {
|
|
|
4891
4893
|
id: h.meta.rawId
|
|
4892
4894
|
});
|
|
4893
4895
|
const w = _(g);
|
|
4894
|
-
if (((G = h.meta) == null ? void 0 : G.nodeType) !==
|
|
4896
|
+
if (((G = h.meta) == null ? void 0 : G.nodeType) !== rt.ITEM)
|
|
4895
4897
|
throw new Error("Expected dragged node to be an item");
|
|
4896
4898
|
const p = pt(h.meta.rawObject);
|
|
4897
4899
|
p.category = l._id, p.subCategories = w;
|
|
@@ -4940,13 +4942,13 @@ function al() {
|
|
|
4940
4942
|
const l = h.parent;
|
|
4941
4943
|
if (!l || !l.children)
|
|
4942
4944
|
throw new Error("Parent node not found or has no children");
|
|
4943
|
-
const v = C(l), w = l.children.findIndex((
|
|
4944
|
-
let p = l.children.findIndex((
|
|
4945
|
+
const v = C(l), w = l.children.findIndex((oe) => oe.id === h.id);
|
|
4946
|
+
let p = l.children.findIndex((oe) => oe.id === g.id);
|
|
4945
4947
|
if (w === -1 || p === -1)
|
|
4946
4948
|
throw new Error("Source or target index not found");
|
|
4947
4949
|
U === "after" && p++;
|
|
4948
|
-
const k = Tt(v, w, p), G = c(l),
|
|
4949
|
-
await a.rearrangeWithSubCategory(k, G,
|
|
4950
|
+
const k = Tt(v, w, p), G = c(l), B = _(l);
|
|
4951
|
+
await a.rearrangeWithSubCategory(k, G, B);
|
|
4950
4952
|
}
|
|
4951
4953
|
async function N(h) {
|
|
4952
4954
|
const g = o.getNodeById(h.draggedNodeId), U = o.getNodeById(h.targetNodeId);
|
|
@@ -4960,7 +4962,7 @@ function al() {
|
|
|
4960
4962
|
handleNodeDragDrop: N
|
|
4961
4963
|
};
|
|
4962
4964
|
}
|
|
4963
|
-
const Mt = /* @__PURE__ */
|
|
4965
|
+
const Mt = /* @__PURE__ */ fe({
|
|
4964
4966
|
__name: "FmTreeIcon",
|
|
4965
4967
|
props: {
|
|
4966
4968
|
name: {},
|
|
@@ -4983,7 +4985,7 @@ const Mt = /* @__PURE__ */ ge({
|
|
|
4983
4985
|
], 2);
|
|
4984
4986
|
};
|
|
4985
4987
|
}
|
|
4986
|
-
}), Ut = /* @__PURE__ */
|
|
4988
|
+
}), Ut = /* @__PURE__ */ fe({
|
|
4987
4989
|
__name: "FmTipTreeIcon",
|
|
4988
4990
|
props: {
|
|
4989
4991
|
name: {},
|
|
@@ -4994,7 +4996,7 @@ const Mt = /* @__PURE__ */ ge({
|
|
|
4994
4996
|
setup(i) {
|
|
4995
4997
|
return (a, t) => {
|
|
4996
4998
|
const o = H("FmTooltip");
|
|
4997
|
-
return a.tooltip ? (A(),
|
|
4999
|
+
return a.tooltip ? (A(), ne(o, {
|
|
4998
5000
|
key: 0,
|
|
4999
5001
|
content: a.tooltip,
|
|
5000
5002
|
"z-index": 50
|
|
@@ -5007,7 +5009,7 @@ const Mt = /* @__PURE__ */ ge({
|
|
|
5007
5009
|
}, null, 8, ["name", "visible", "onClick"])
|
|
5008
5010
|
]),
|
|
5009
5011
|
_: 1
|
|
5010
|
-
}, 8, ["content"])) : (A(),
|
|
5012
|
+
}, 8, ["content"])) : (A(), ne(Mt, {
|
|
5011
5013
|
key: 1,
|
|
5012
5014
|
name: a.name,
|
|
5013
5015
|
visible: a.visible,
|
|
@@ -5093,7 +5095,7 @@ function il(i, a) {
|
|
|
5093
5095
|
onMouseUp: b
|
|
5094
5096
|
};
|
|
5095
5097
|
}
|
|
5096
|
-
const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */
|
|
5098
|
+
const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ fe({
|
|
5097
5099
|
__name: "HighlightableSpan",
|
|
5098
5100
|
props: {
|
|
5099
5101
|
text: {},
|
|
@@ -5111,7 +5113,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5111
5113
|
innerHTML: t.value
|
|
5112
5114
|
}, null, 8, ul));
|
|
5113
5115
|
}
|
|
5114
|
-
}), xt = /* @__PURE__ */
|
|
5116
|
+
}), xt = /* @__PURE__ */ it(dl, [["__scopeId", "data-v-f6f1080b"]]), cl = {
|
|
5115
5117
|
class: "flex-1 min-w-0 flex items-center gap-4 relative pl-12"
|
|
5116
5118
|
}, ml = {
|
|
5117
5119
|
class: "flex items-center gap-4 min-w-0"
|
|
@@ -5134,7 +5136,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5134
5136
|
}, hl = {
|
|
5135
5137
|
key: 2,
|
|
5136
5138
|
class: "drop-indicator-inside"
|
|
5137
|
-
}, kl = /* @__PURE__ */
|
|
5139
|
+
}, kl = /* @__PURE__ */ fe({
|
|
5138
5140
|
__name: "FmTreeNode",
|
|
5139
5141
|
props: {
|
|
5140
5142
|
node: {},
|
|
@@ -5196,7 +5198,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5196
5198
|
(...x) => e(P) && e(P)(...x)),
|
|
5197
5199
|
onMouseleave: n[6] || (n[6] = //@ts-ignore
|
|
5198
5200
|
(...x) => e(P) && e(P)(...x))
|
|
5199
|
-
}, [K("div", cl, [K("div", ml, [(Y = y.node) != null && Y.draggable && !y.node.disabled ? (A(),
|
|
5201
|
+
}, [K("div", cl, [K("div", ml, [(Y = y.node) != null && Y.draggable && !y.node.disabled ? (A(), ne(T, {
|
|
5200
5202
|
key: 0,
|
|
5201
5203
|
name: "drag_indicator",
|
|
5202
5204
|
size: "sm",
|
|
@@ -5208,7 +5210,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5208
5210
|
onClick: n[0] || (n[0] = Je(() => {
|
|
5209
5211
|
y.node.disabled || c("toggleExpand");
|
|
5210
5212
|
}, ["stop"]))
|
|
5211
|
-
}, null, 8, ["name", "visible"]), y.node.icon ? (A(),
|
|
5213
|
+
}, null, 8, ["name", "visible"]), y.node.icon ? (A(), ne(T, {
|
|
5212
5214
|
key: 1,
|
|
5213
5215
|
size: "sm",
|
|
5214
5216
|
outline: "",
|
|
@@ -5231,13 +5233,13 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5231
5233
|
highlightedStrings: y.highlightedStrings
|
|
5232
5234
|
}, null, 8, ["class", "text", "highlightedStrings"])]),
|
|
5233
5235
|
_: 1
|
|
5234
|
-
}, 8, ["content"])])]), K("div", gl, [(A(!0), J(Se, null, Ae(y.node.chips, (x) => (A(),
|
|
5236
|
+
}, 8, ["content"])])]), K("div", gl, [(A(!0), J(Se, null, Ae(y.node.chips, (x) => (A(), ne(Go, {
|
|
5235
5237
|
key: x.label,
|
|
5236
5238
|
size: x.size || "xs",
|
|
5237
5239
|
label: x.label,
|
|
5238
5240
|
variant: x.variant || "neutral",
|
|
5239
5241
|
border: x.border
|
|
5240
|
-
}, null, 8, ["size", "label", "variant", "border"]))), 128))])]), K("div", vl, [K("div", bl, [(A(!0), J(Se, null, Ae(y.node.actions, (x) => (A(),
|
|
5242
|
+
}, null, 8, ["size", "label", "variant", "border"]))), 128))])]), K("div", vl, [K("div", bl, [(A(!0), J(Se, null, Ae(y.node.actions, (x) => (A(), ne(Ut, {
|
|
5241
5243
|
key: x.id,
|
|
5242
5244
|
name: x.icon,
|
|
5243
5245
|
tooltip: x.tooltip,
|
|
@@ -5262,7 +5264,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5262
5264
|
}, Il = {
|
|
5263
5265
|
key: 1,
|
|
5264
5266
|
class: "empty-tree-message"
|
|
5265
|
-
}, St = 32, Tl = /* @__PURE__ */
|
|
5267
|
+
}, St = 32, Tl = /* @__PURE__ */ fe({
|
|
5266
5268
|
__name: "FmTree",
|
|
5267
5269
|
props: {
|
|
5268
5270
|
nodes: {},
|
|
@@ -5358,7 +5360,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5358
5360
|
"being-dragged": e(Y) === U.id
|
|
5359
5361
|
}]),
|
|
5360
5362
|
id: `tree-node-${U.id}`
|
|
5361
|
-
}, [(A(),
|
|
5363
|
+
}, [(A(), ne(kl, {
|
|
5362
5364
|
key: U.id,
|
|
5363
5365
|
node: U.node,
|
|
5364
5366
|
selected: m.selectedNodeId === U.id,
|
|
@@ -5388,10 +5390,10 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5388
5390
|
}), K("span", null, ye((g = c.value.find((U) => U.id === e(Y))) == null ? void 0 : g.node.label), 1)])], 4)) : Z("", !0), c.value.length === 0 ? (A(), J("div", Il, ye(e(o)("menu.tree_editor.labels.no_items")), 1)) : Z("", !0)], 16);
|
|
5389
5391
|
};
|
|
5390
5392
|
}
|
|
5391
|
-
}), xl = /* @__PURE__ */
|
|
5393
|
+
}), xl = /* @__PURE__ */ it(Tl, [["__scopeId", "data-v-9244f342"]]), Sl = { class: "py-4 px-8 flex items-center gap-4 text-fm-color-primary cursor-pointer relative" }, El = {
|
|
5392
5394
|
key: 1,
|
|
5393
5395
|
class: "fm-typo-en-body-md-400"
|
|
5394
|
-
}, Et = /* @__PURE__ */
|
|
5396
|
+
}, Et = /* @__PURE__ */ fe({
|
|
5395
5397
|
__name: "TreeTopButton",
|
|
5396
5398
|
props: {
|
|
5397
5399
|
icon: {},
|
|
@@ -5401,7 +5403,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5401
5403
|
return (a, t) => {
|
|
5402
5404
|
const o = H("FmIcon");
|
|
5403
5405
|
return A(), J("div", Sl, [
|
|
5404
|
-
a.icon ? (A(),
|
|
5406
|
+
a.icon ? (A(), ne(o, {
|
|
5405
5407
|
key: 0,
|
|
5406
5408
|
name: a.icon
|
|
5407
5409
|
}, null, 8, ["name"])) : Z("", !0),
|
|
@@ -5416,7 +5418,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5416
5418
|
class: "flex items-center justify-between"
|
|
5417
5419
|
}, $l = {
|
|
5418
5420
|
class: "flex items-center"
|
|
5419
|
-
}, Pl = /* @__PURE__ */
|
|
5421
|
+
}, Pl = /* @__PURE__ */ fe({
|
|
5420
5422
|
__name: "ProductsTree",
|
|
5421
5423
|
props: {
|
|
5422
5424
|
menu: {},
|
|
@@ -5427,7 +5429,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5427
5429
|
setup(i, {
|
|
5428
5430
|
emit: a
|
|
5429
5431
|
}) {
|
|
5430
|
-
const t = i, o = a, m = yt(), r =
|
|
5432
|
+
const t = i, o = a, m = yt(), r = be(), b = _t(), {
|
|
5431
5433
|
canDropFn: F,
|
|
5432
5434
|
handleNodeDragDrop: c
|
|
5433
5435
|
} = al(), _ = M(() => t.filterState.searchKey), C = vo(_, 300), {
|
|
@@ -5460,12 +5462,12 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5460
5462
|
schedulerManager: x,
|
|
5461
5463
|
noScheduler: D
|
|
5462
5464
|
} = Lo(!0);
|
|
5463
|
-
return (u, f) => (A(), J("div", Fl, [K("div", Vl, [e(r).rules.category.create ? (A(),
|
|
5465
|
+
return (u, f) => (A(), J("div", Fl, [K("div", Vl, [e(r).rules.category.create ? (A(), ne(Et, {
|
|
5464
5466
|
key: 0,
|
|
5465
5467
|
label: e(n)("menu.tree_editor.actions.add_category"),
|
|
5466
5468
|
icon: "add",
|
|
5467
5469
|
onClick: f[0] || (f[0] = (N) => e(b).create())
|
|
5468
|
-
}, null, 8, ["label"])) : Z("", !0), e(r).state.currentCatalogId && !e(r).state.currentSchedulerId ? (A(),
|
|
5470
|
+
}, null, 8, ["label"])) : Z("", !0), e(r).state.currentCatalogId && !e(r).state.currentSchedulerId ? (A(), ne(Ot, {
|
|
5469
5471
|
key: 1,
|
|
5470
5472
|
"categorized-items": e($).linkableItems.value,
|
|
5471
5473
|
"initial-value": e($).currentItems.value,
|
|
@@ -5485,7 +5487,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5485
5487
|
onClick: N
|
|
5486
5488
|
}, null, 8, ["label", "onClick"])]),
|
|
5487
5489
|
_: 1
|
|
5488
|
-
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : Z("", !0), e(r).state.currentSchedulerId ? (A(),
|
|
5490
|
+
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : Z("", !0), e(r).state.currentSchedulerId ? (A(), ne(Ot, {
|
|
5489
5491
|
key: 2,
|
|
5490
5492
|
"categorized-items": e(x).linkableItems.value,
|
|
5491
5493
|
"initial-value": e(x).currentItems.value,
|
|
@@ -5527,7 +5529,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5527
5529
|
_: 1
|
|
5528
5530
|
})]));
|
|
5529
5531
|
}
|
|
5530
|
-
}), Dl = { class: "space-y-8" }, Ol = /* @__PURE__ */
|
|
5532
|
+
}), Dl = { class: "space-y-8" }, Ol = /* @__PURE__ */ fe({
|
|
5531
5533
|
__name: "TreeFilter",
|
|
5532
5534
|
props: /* @__PURE__ */ Dn({
|
|
5533
5535
|
menu: {}
|
|
@@ -5537,7 +5539,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5537
5539
|
}),
|
|
5538
5540
|
emits: ["update:modelValue"],
|
|
5539
5541
|
setup(i) {
|
|
5540
|
-
const { t: a } = _e(), t = i, o =
|
|
5542
|
+
const { t: a } = _e(), t = i, o = be(), m = On(i, "modelValue"), r = M(() => [
|
|
5541
5543
|
{
|
|
5542
5544
|
label: a("menu.tree_editor.labels.main_catalog"),
|
|
5543
5545
|
value: null
|
|
@@ -5578,7 +5580,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5578
5580
|
"custom-label": b.value,
|
|
5579
5581
|
"onUpdate:modelValue": y[0] || (y[0] = (T) => m.value.catalogId = T)
|
|
5580
5582
|
}, null, 8, ["model-value", "items", "placeholder", "search-placeholder", "custom-label"]),
|
|
5581
|
-
c.value ? (A(),
|
|
5583
|
+
c.value ? (A(), ne(Zt, {
|
|
5582
5584
|
key: 0,
|
|
5583
5585
|
"model-value": m.value.schedulerId || "",
|
|
5584
5586
|
items: _.value,
|
|
@@ -5587,7 +5589,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5587
5589
|
"custom-label": F.value,
|
|
5588
5590
|
"onUpdate:modelValue": y[1] || (y[1] = (T) => m.value.schedulerId = T)
|
|
5589
5591
|
}, null, 8, ["model-value", "items", "placeholder", "search-placeholder", "custom-label"])) : Z("", !0),
|
|
5590
|
-
C.value ? (A(),
|
|
5592
|
+
C.value ? (A(), ne(Ko, {
|
|
5591
5593
|
key: 1,
|
|
5592
5594
|
"current-restaurant-attr-params": e(o).state.currentRestaurantAttrParams,
|
|
5593
5595
|
onConfirm: y[2] || (y[2] = (T) => e(o).setRestaurantAttrParams(T)),
|
|
@@ -5605,7 +5607,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5605
5607
|
}), Ml = { class: "h-full flex flex-col relative" }, Ul = { class: "p-8" }, Rl = { class: "flex-1 p-8" }, Al = {
|
|
5606
5608
|
key: 0,
|
|
5607
5609
|
class: "absolute inset-0 flex items-center justify-center tree-overlay"
|
|
5608
|
-
}, Nl = { class: "flex items-center justify-center gap-16" }, Ll = /* @__PURE__ */
|
|
5610
|
+
}, Nl = { class: "flex items-center justify-center gap-16" }, Ll = /* @__PURE__ */ fe({
|
|
5609
5611
|
__name: "TreePanel",
|
|
5610
5612
|
props: {
|
|
5611
5613
|
menu: {},
|
|
@@ -5618,7 +5620,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5618
5620
|
catalogId: null,
|
|
5619
5621
|
schedulerId: null,
|
|
5620
5622
|
searchKey: ""
|
|
5621
|
-
}), m =
|
|
5623
|
+
}), m = be();
|
|
5622
5624
|
return Oe([() => o.value.catalogId, () => o.value.schedulerId], () => {
|
|
5623
5625
|
m.selectCatalog(o.value.catalogId), m.selectScheduler(o.value.schedulerId);
|
|
5624
5626
|
}), (r, b) => {
|
|
@@ -5647,13 +5649,13 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5647
5649
|
]);
|
|
5648
5650
|
};
|
|
5649
5651
|
}
|
|
5650
|
-
}), Gl = { class: "pl-24 scroll-y-auto h-full overflow-y-auto relative" }, Kl = { key: 1 }, Bl = { class: "text-center text-sm text-gray-500 p-16" }, zl = /* @__PURE__ */
|
|
5652
|
+
}), Gl = { class: "pl-24 scroll-y-auto h-full overflow-y-auto relative" }, Kl = { key: 1 }, Bl = { class: "text-center text-sm text-gray-500 p-16" }, zl = /* @__PURE__ */ fe({
|
|
5651
5653
|
__name: "TreeEditor",
|
|
5652
5654
|
props: {
|
|
5653
5655
|
menu: {}
|
|
5654
5656
|
},
|
|
5655
5657
|
setup(i) {
|
|
5656
|
-
const { t: a } = _e(), t = i, o =
|
|
5658
|
+
const { t: a } = _e(), t = i, o = be(), m = yt();
|
|
5657
5659
|
Xe(() => {
|
|
5658
5660
|
o.$reinitialize(), o.setMenu(Ve.cloneDeep(t.menu)), o.computeMergedMenu();
|
|
5659
5661
|
}), Rt(() => {
|
|
@@ -5688,7 +5690,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5688
5690
|
}
|
|
5689
5691
|
return n && (b.value = n, m.setSelectedNodeByItemId(n)), !0;
|
|
5690
5692
|
}
|
|
5691
|
-
return (n, T) => (A(),
|
|
5693
|
+
return (n, T) => (A(), ne(nl, null, {
|
|
5692
5694
|
"left-panel": q(() => [
|
|
5693
5695
|
s(Ll, {
|
|
5694
5696
|
menu: n.menu,
|
|
@@ -5699,7 +5701,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5699
5701
|
]),
|
|
5700
5702
|
"right-panel": q(() => [
|
|
5701
5703
|
K("div", Gl, [
|
|
5702
|
-
e(F) ? (A(),
|
|
5704
|
+
e(F) ? (A(), ne(Ya, {
|
|
5703
5705
|
ref_key: "itemFormRef",
|
|
5704
5706
|
ref: r,
|
|
5705
5707
|
key: e(c),
|
|
@@ -5726,7 +5728,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5726
5728
|
])
|
|
5727
5729
|
}, Yl = { class: "fm-typo-en-title-sm-600 mr-auto" }, ql = { class: "flex items-center gap-8" }, Wl = {
|
|
5728
5730
|
class: /* @__PURE__ */ $e(["flex flex-col", "flex-1 overflow-scroll", "w-full"])
|
|
5729
|
-
}, Hl = /* @__PURE__ */
|
|
5731
|
+
}, Hl = /* @__PURE__ */ fe({
|
|
5730
5732
|
__name: "TreeEditorForm",
|
|
5731
5733
|
props: {
|
|
5732
5734
|
menu: {},
|
|
@@ -5734,9 +5736,9 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5734
5736
|
},
|
|
5735
5737
|
emits: ["update:show", "submit"],
|
|
5736
5738
|
setup(i, { emit: a }) {
|
|
5737
|
-
const t = i, o =
|
|
5739
|
+
const t = i, o = Ye(), { minor: m } = bt(o), { t: r } = _e(), b = a, F = () => {
|
|
5738
5740
|
b("update:show", !1);
|
|
5739
|
-
}, c = vt(), _ =
|
|
5741
|
+
}, c = vt(), _ = be();
|
|
5740
5742
|
_.selectCatalog(null), _.selectScheduler(null);
|
|
5741
5743
|
const C = ee(!1), P = () => {
|
|
5742
5744
|
m(
|
|
@@ -5778,7 +5780,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5778
5780
|
);
|
|
5779
5781
|
return (n, T) => {
|
|
5780
5782
|
const S = H("fm-button"), Y = H("fm-form");
|
|
5781
|
-
return A(),
|
|
5783
|
+
return A(), ne(Mn, { to: "body" }, [
|
|
5782
5784
|
s(Un, { name: "fade" }, {
|
|
5783
5785
|
default: q(() => [
|
|
5784
5786
|
s(Y, {
|
|
@@ -5830,7 +5832,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5830
5832
|
]);
|
|
5831
5833
|
};
|
|
5832
5834
|
}
|
|
5833
|
-
}), Xl = /* @__PURE__ */
|
|
5835
|
+
}), Xl = /* @__PURE__ */ it(Hl, [["__scopeId", "data-v-8e2b5ffd"]]), Pi = /* @__PURE__ */ fe({
|
|
5834
5836
|
__name: "TreeEditorOpenner",
|
|
5835
5837
|
setup(i) {
|
|
5836
5838
|
const a = vt(), t = cn();
|
|
@@ -5850,7 +5852,7 @@ const sl = { key: 0 }, ul = ["innerHTML"], dl = /* @__PURE__ */ ge({
|
|
|
5850
5852
|
window.addEventListener("message", r);
|
|
5851
5853
|
}), Rt(() => {
|
|
5852
5854
|
window.removeEventListener("message", r);
|
|
5853
|
-
}), (b, F) =>
|
|
5855
|
+
}), (b, F) => Be(b.$slots, "default", { trigger: o });
|
|
5854
5856
|
}
|
|
5855
5857
|
});
|
|
5856
5858
|
export {
|