@feedmepos/mf-menu 0.32.28 → 0.32.29-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-BlcUDeo2.js → App-D38_Ja6B.js} +7 -7
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-R7J1LE2s.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CzrV5bJD.js} +3 -3
- package/dist/{Catalog-P4qC8Lhe.js → Catalog-Cgl_aw1K.js} +6 -6
- package/dist/{Category-Cooj51Ez.js → Category-5hb4ZVvb.js} +4 -4
- package/dist/{Category-BtZV6wiB.js → Category-Bc8xVjWy.js} +6 -6
- package/dist/{CookingGuide-QtsRAHd6.js → CookingGuide-CHBsJVu0.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DdoN5vmc.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-fKCJuDMb.js} +1 -1
- package/dist/{Group-CUYgyIPq.js → Group-CmvbIst-.js} +3 -3
- package/dist/{Group-CCywie69.js → Group-Zn-MdA7x.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-DqEXk2Re.js → Group.vue_vue_type_script_setup_true_lang-DTI8I3Go.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-C5GsxMvl.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B2hjCGni.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-yxyEtGAP.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-CVajAM-y.js} +1450 -1450
- package/dist/{Ingredient-Nc5zT4Gj.js → Ingredient-DSyDQ6Mb.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-BIQo4aI5.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DK_cV_IF.js} +2 -2
- package/dist/{LinkProductSideSheet-2AFi6azl.js → LinkProductSideSheet-ChwvlToR.js} +3 -3
- package/dist/{MenuSetting-BaqHKwim.js → MenuSetting-Bvrev6yD.js} +5 -5
- package/dist/{PrintRoute-B1s8eGTJ.js → PrintRoute-COvZekYI.js} +4 -4
- package/dist/{Product-fTuVlqZm.js → Product-CgwRnDSH.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-CkRhLhUk.js → Product.vue_vue_type_script_setup_true_lang-5Qnw4yBD.js} +12 -12
- package/dist/{ProductInternalTools-DBxG_GrG.js → ProductInternalTools-BSG6vXax.js} +6 -6
- package/dist/{Products-BHXE_ZPZ.js → Products-rWW3EtWo.js} +33 -33
- package/dist/{Publish-qjjPACRs.js → Publish-DDWj9NUM.js} +3 -3
- package/dist/{Recipe-DsBpxpvb.js → Recipe-Bu6ZBczX.js} +4 -4
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-iOWkeKh_.js → RuleView.vue_vue_type_script_setup_true_lang-DacY7P2d.js} +366 -366
- package/dist/{Scheduler-DDlRC5tB.js → Scheduler-DpkcRNHk.js} +3 -3
- package/dist/{ServingSequence-BH4WjmTJ.js → ServingSequence-5fwT51AS.js} +3 -3
- package/dist/{Setting-8wyn41ch.js → Setting-SneXKm5p.js} +5 -5
- package/dist/{Subcategory-DZsjkEvC.js → Subcategory-Bc2SWFJz.js} +4 -4
- package/dist/{Takeaway-DXBvSQFx.js → Takeaway-B1tqH9Q-.js} +1 -1
- package/dist/{Takeaway-BI7fQoSc.js → Takeaway-CIvXKn-m.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DUbBRoDk.js → Takeaway.vue_vue_type_script_setup_true_lang-B4wNVbsn.js} +5 -5
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-DCyH8vjZ.js → Thumbnail.vue_vue_type_script_setup_true_lang-Di2ye03t.js} +4 -4
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CiNkRyST.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Z0EYswUJ.js} +14 -14
- package/dist/{Unit-DwWO4TyX.js → Unit-DLmvb5c_.js} +2 -2
- package/dist/{Variant-DZSoI-cE.js → Variant-BZBuTMHP.js} +3 -3
- package/dist/{_id_-ClJ7SHo_.js → _id_-uPN-h7JG.js} +9 -9
- package/dist/{app-Bh6LVU9L.js → app-BoCI5pZn.js} +26 -26
- package/dist/{app-TSk3ND0r.js → app-CEZaz_Rs.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/assets/{linked-status-CRatj879.js → linked-status-BKiZZUlY.js} +2 -2
- package/dist/assets/{menu-export-CqvwSaXO.js → menu-export-IPfh9JSv.js} +2 -2
- package/dist/assets/{override-menu-Cm0sXIF0.js → override-menu-DTlN6naU.js} +2 -2
- package/dist/assets/{validate-menu-DiVFKnBL.js → validate-menu-B0uaX8mm.js} +2 -2
- package/dist/{catalog-DZdIHjVM.js → catalog-D_1U8iDr.js} +1 -1
- package/dist/{catalogSetting-Zy1tUZ17.js → catalogSetting-BcXxtYCf.js} +1 -1
- package/dist/{category-C1FthNrA.js → category-BmAon-dy.js} +1 -1
- package/dist/{currency-B5Qbey7d.js → currency-BwUzDagK.js} +1 -1
- package/dist/{dayjs.min-B8rUGf24.js → dayjs.min-B3EshoUn.js} +1 -1
- package/dist/{index-Biru77b7.js → index-BfnOYIxd.js} +3 -3
- package/dist/{index-Bw3KlaRr.js → index-CXf65dvu.js} +1 -1
- package/dist/{index-190cTcX3.js → index-bqTcqM5q.js} +4 -4
- package/dist/{index.vue_vue_type_script_setup_true_lang-MeH7nJqW.js → index.vue_vue_type_script_setup_true_lang-g1yV8stZ.js} +6 -6
- package/dist/{item-DHYFdr0F.js → item-Dd8IFCry.js} +1040 -1035
- package/dist/{jszip.min-DM4_34Dp.js → jszip.min-WEsduBYI.js} +2 -2
- package/dist/{menu-Cism8Z4S.js → menu-hGZkcqd4.js} +1 -1
- package/dist/{menuV2-CYZOYZ3h.js → menuV2-xBraW3Hj.js} +69 -69
- package/dist/{priceTier-CuRrxRkB.js → priceTier-BRPOA6Bj.js} +1 -1
- package/dist/{scheduler-CKuNWae0.js → scheduler-BJRi7TLa.js} +4 -4
- package/dist/{subcategory-D7wFXe4g.js → subcategory-we_u9uxu.js} +2 -2
- package/dist/{toExcel-J5ydeaO1.js → toExcel-DNqjKojT.js} +2 -2
- package/dist/{unit-DRdGblv6.js → unit-D12TVPlb.js} +2 -2
- package/package.json +1 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { defineStore as Oi } from "pinia";
|
|
2
|
-
import { defineComponent as de, resolveComponent as
|
|
3
|
-
import { M as Ce, A as Y, am as xn, ao as Rn, $ as An, I as ue, D as Ee, B as xe, W as Mn, u as ye, J as Ve, G as Xe, Q as qe, R as On, T as Fn, U as zn, V as Ft, ag as In, X as En, O as Tn, N as hi } from "./index.vue_vue_type_script_setup_true_lang-
|
|
2
|
+
import { defineComponent as de, resolveComponent as B, createElementBlock as ne, createBlock as H, openBlock as M, createElementVNode as D, createVNode as g, toDisplayString as ce, Fragment as Me, renderList as Ue, h as Se, ref as te, computed as O, watch as Re, unref as h, renderSlot as fe, withCtx as P, createCommentVNode as ie, Transition as gn, normalizeClass as Fe, resolveDynamicComponent as St, withDirectives as ut, vShow as Ct, mergeProps as Fi, withModifiers as kt, onMounted as ot, onUnmounted as bn, createTextVNode as Vt, resolveDirective as zi, getCurrentInstance as Ii, markRaw as yn, render as Ut, mergeModels as _n, useModel as wn, nextTick as Ei, normalizeProps as Sn, guardReactiveProps as Cn, normalizeStyle as kn } from "vue";
|
|
3
|
+
import { M as Ce, A as Y, am as xn, ao as Rn, $ as An, I as ue, D as Ee, B as xe, W as Mn, u as ye, J as Ve, G as Xe, Q as qe, R as On, T as Fn, U as zn, V as Ft, ag as In, X as En, O as Tn, N as hi } from "./index.vue_vue_type_script_setup_true_lang-g1yV8stZ.js";
|
|
4
4
|
import { useI18n as pe, useCoreStore as pt, CustomAttributesForm as Ti } from "@feedmepos/mf-common";
|
|
5
5
|
import { useDialog as Be, useSnackbar as $e, components as Ae, FmButtonColorThemeVariant as je, FmButtonVariant as Ze, useBreakpoints as Di, useDialogChild as Pi } from "@feedmepos/ui-library";
|
|
6
|
-
import { C as Ke } from "./catalog-
|
|
6
|
+
import { C as Ke } from "./catalog-D_1U8iDr.js";
|
|
7
7
|
import { c as Dn } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
8
8
|
import { a as fi, _ as Vi } from "./tooltip-B5BiPMx9.js";
|
|
9
|
-
import { H as Pn, L as Vn } from "./LinkProductSideSheet-
|
|
10
|
-
import { e as Un, _ as Le, a as $n } from "./RuleView.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import { H as Pn, L as Vn } from "./LinkProductSideSheet-ChwvlToR.js";
|
|
10
|
+
import { e as Un, _ as Le, a as $n } from "./RuleView.vue_vue_type_script_setup_true_lang-DacY7P2d.js";
|
|
11
11
|
import { s as $t, F as Nn, _ as Bn } from "./index-CisutoS9.js";
|
|
12
|
-
import { a as Ln } from "./app-
|
|
12
|
+
import { a as Ln } from "./app-BoCI5pZn.js";
|
|
13
13
|
import { _ as it } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
|
-
import { g as Ui, b as Gn, c as jn, a as Kn, m as Wn } from "./menuV2-
|
|
14
|
+
import { g as Ui, b as Gn, c as jn, a as Kn, m as Wn } from "./menuV2-xBraW3Hj.js";
|
|
15
15
|
import { useAppStore as Ht, RemyButton as $i } from "@feedmepos/mf-remy-panel";
|
|
16
16
|
import { _ as Ye } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
|
|
17
|
-
import { u as Yn } from "./subcategory-
|
|
18
|
-
import { u as Hn } from "./category-
|
|
17
|
+
import { u as Yn } from "./subcategory-we_u9uxu.js";
|
|
18
|
+
import { u as Hn } from "./category-BmAon-dy.js";
|
|
19
19
|
import { u as Xt } from "./discardConfirm-BHni0LNu.js";
|
|
20
|
-
import { _ as et, l as Nt, T as Xn } from "./index-
|
|
20
|
+
import { _ as et, l as Nt, T as Xn } from "./index-bqTcqM5q.js";
|
|
21
21
|
import { useInventoryStore as Ni, InventoryBindingForm as qn, InventoryBindingSummary as Zn } from "@feedmepos/mf-inventory-portal";
|
|
22
22
|
import { c as ht } from "./check-C9mY6LiX.js";
|
|
23
23
|
import { c as Qn } from "./object-DVUNCr7w.js";
|
|
24
|
-
import { f as at } from "./currency-
|
|
25
|
-
import { u as Bi } from "./priceTier-
|
|
24
|
+
import { f as at } from "./currency-BwUzDagK.js";
|
|
25
|
+
import { u as Bi } from "./priceTier-BRPOA6Bj.js";
|
|
26
26
|
import { u as Jn } from "./search-BAPEUu1R.js";
|
|
27
27
|
import { c as eo } from "./string-DpfFixWH.js";
|
|
28
28
|
import { d as Li } from "./vuedraggable-CK8z7qA8.js";
|
|
29
|
-
import { _ as to } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-
|
|
30
|
-
import { V as vi } from "./index-
|
|
29
|
+
import { _ as to } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-CzrV5bJD.js";
|
|
30
|
+
import { V as vi } from "./index-BfnOYIxd.js";
|
|
31
31
|
class _t {
|
|
32
32
|
constructor(i, t, n, a) {
|
|
33
33
|
this.scheduler = i, this.menuStore = t, this.updateMenu = n, this.dialog = a;
|
|
@@ -382,14 +382,14 @@ class ji {
|
|
|
382
382
|
const a = this.menuStore.state.menu.modules.item, o = this.menuStore.items;
|
|
383
383
|
function r(l, s) {
|
|
384
384
|
const u = l.items.reduce((c, m) => {
|
|
385
|
-
var G,
|
|
385
|
+
var G, N, W;
|
|
386
386
|
const p = a.find((R) => m._id === R._id);
|
|
387
387
|
if (!p && t) return c;
|
|
388
388
|
const v = m.combinationKey ? {
|
|
389
389
|
...(G = p == null ? void 0 : p.variant) == null ? void 0 : G.variantCombinations.find(
|
|
390
390
|
(R) => R.combinationKey === m.combinationKey
|
|
391
391
|
),
|
|
392
|
-
name: Mn(ye().variants, ((
|
|
392
|
+
name: Mn(ye().variants, ((N = p == null ? void 0 : p.variant) == null ? void 0 : N.variantGroupIds) || [])[m.combinationKey]
|
|
393
393
|
} : p, y = !t && !m.combinationKey, b = (W = s.find(
|
|
394
394
|
(R) => R._id == m._id && R.combinationKey == m.combinationKey
|
|
395
395
|
)) == null ? void 0 : W.price, _ = m.name ?? null, f = (v == null ? void 0 : v.name) ?? null, C = {
|
|
@@ -546,16 +546,16 @@ const ao = {
|
|
|
546
546
|
});
|
|
547
547
|
}
|
|
548
548
|
return (a, o) => {
|
|
549
|
-
const r =
|
|
550
|
-
return i.variant === "full" ? (
|
|
549
|
+
const r = B("FmButton");
|
|
550
|
+
return i.variant === "full" ? (M(), ne("div", ao, [
|
|
551
551
|
D("div", ro, ce(a.title), 1),
|
|
552
552
|
g(Pn),
|
|
553
|
-
(
|
|
553
|
+
(M(!0), ne(Me, null, Ue(a.items, (l) => (M(), H(fi, {
|
|
554
554
|
key: l.name,
|
|
555
555
|
name: l.name,
|
|
556
556
|
value: l.value || "--"
|
|
557
557
|
}, null, 8, ["name", "value"]))), 128))
|
|
558
|
-
])) : (
|
|
558
|
+
])) : (M(), H(r, {
|
|
559
559
|
key: 1,
|
|
560
560
|
icon: "info",
|
|
561
561
|
variant: "tertiary",
|
|
@@ -570,7 +570,7 @@ const ao = {
|
|
|
570
570
|
},
|
|
571
571
|
emits: ["update:catalogAndScheduler"],
|
|
572
572
|
setup(e, { emit: i }) {
|
|
573
|
-
const t = e, n = i, { t: a } = pe(), o = ye(), r = te(o.state.currentCatalogId || null), l =
|
|
573
|
+
const t = e, n = i, { t: a } = pe(), o = ye(), r = te(o.state.currentCatalogId || null), l = O(() => {
|
|
574
574
|
const m = Object.keys(t.linkedStatus.catalogs).map((p) => {
|
|
575
575
|
var v;
|
|
576
576
|
return {
|
|
@@ -585,7 +585,7 @@ const ao = {
|
|
|
585
585
|
},
|
|
586
586
|
...m
|
|
587
587
|
];
|
|
588
|
-
}), s = te(o.state.currentSchedulerId || null), u = () => r.value ? t.linkedStatus.catalogs[r.value].schedulers : t.linkedStatus.schedulers, d =
|
|
588
|
+
}), s = te(o.state.currentSchedulerId || null), u = () => r.value ? t.linkedStatus.catalogs[r.value].schedulers : t.linkedStatus.schedulers, d = O(() => {
|
|
589
589
|
const p = u().map((v) => {
|
|
590
590
|
var y;
|
|
591
591
|
return {
|
|
@@ -613,8 +613,8 @@ const ao = {
|
|
|
613
613
|
c();
|
|
614
614
|
}
|
|
615
615
|
), (m, p) => {
|
|
616
|
-
const v =
|
|
617
|
-
return
|
|
616
|
+
const v = B("FmSelect");
|
|
617
|
+
return M(), ne("div", so, [
|
|
618
618
|
D("div", lo, [
|
|
619
619
|
D("div", uo, ce(h(a)("menu.catalog_scheduler.title")), 1),
|
|
620
620
|
D("div", co, ce(h(a)("menu.catalog_scheduler.subtitle")), 1)
|
|
@@ -655,8 +655,8 @@ const ao = {
|
|
|
655
655
|
setup(e, { emit: i }) {
|
|
656
656
|
const t = i;
|
|
657
657
|
return (n, a) => {
|
|
658
|
-
const o =
|
|
659
|
-
return n.disabled ? fe(n.$slots, "default", { key: 0 }, void 0, !0) : (
|
|
658
|
+
const o = B("fm-switch"), r = B("fm-card");
|
|
659
|
+
return n.disabled ? fe(n.$slots, "default", { key: 0 }, void 0, !0) : (M(), H(r, {
|
|
660
660
|
key: 1,
|
|
661
661
|
class: "p-16 space-y-24",
|
|
662
662
|
variant: "outlined"
|
|
@@ -665,7 +665,7 @@ const ao = {
|
|
|
665
665
|
D("div", vo, [
|
|
666
666
|
D("div", go, [
|
|
667
667
|
D("p", bo, ce(n.title), 1),
|
|
668
|
-
n.description ? (
|
|
668
|
+
n.description ? (M(), ne("p", yo, ce(n.description), 1)) : ie("", !0)
|
|
669
669
|
]),
|
|
670
670
|
g(o, {
|
|
671
671
|
"model-value": n.toggle,
|
|
@@ -674,7 +674,7 @@ const ao = {
|
|
|
674
674
|
]),
|
|
675
675
|
g(gn, { name: "expand" }, {
|
|
676
676
|
default: P(() => [
|
|
677
|
-
n.toggle ? (
|
|
677
|
+
n.toggle ? (M(), ne("div", _o, [
|
|
678
678
|
fe(n.$slots, "default", {}, void 0, !0)
|
|
679
679
|
])) : ie("", !0)
|
|
680
680
|
]),
|
|
@@ -751,7 +751,7 @@ async function vl(e, i, t = {}) {
|
|
|
751
751
|
}
|
|
752
752
|
const Ro = {}, Ao = { class: "pl-32" };
|
|
753
753
|
function Mo(e, i) {
|
|
754
|
-
return
|
|
754
|
+
return M(), ne("div", Ao, [
|
|
755
755
|
fe(e.$slots, "default")
|
|
756
756
|
]);
|
|
757
757
|
}
|
|
@@ -801,7 +801,7 @@ const Oo = /* @__PURE__ */ it(Ro, [["render", Mo]]), Fo = { class: "flex flex-co
|
|
|
801
801
|
}, u = () => {
|
|
802
802
|
var v;
|
|
803
803
|
(v = o.value) == null || v.toggleMenu(!1);
|
|
804
|
-
}, d =
|
|
804
|
+
}, d = O(() => n.items.reduce(
|
|
805
805
|
(v, y) => (v[y.value] = y, v),
|
|
806
806
|
{}
|
|
807
807
|
)), c = te(!1);
|
|
@@ -812,12 +812,12 @@ const Oo = /* @__PURE__ */ it(Ro, [["render", Mo]]), Fo = { class: "flex flex-co
|
|
|
812
812
|
},
|
|
813
813
|
{ immediate: !0 }
|
|
814
814
|
);
|
|
815
|
-
const m =
|
|
815
|
+
const m = O(() => n.shouldShowSelectedItemsWithinPlaceholder && r.value.length > 0), p = O(() => m.value ? r.value.map((v) => v.label).join(", ") : n.placeholder);
|
|
816
816
|
return i({
|
|
817
817
|
hideMenu: u
|
|
818
818
|
}), (v, y) => {
|
|
819
|
-
const b =
|
|
820
|
-
return
|
|
819
|
+
const b = B("FmIcon"), _ = B("FmField"), f = B("FmMenuItem"), C = B("FmMenu"), G = B("FmFormGroup"), N = B("FmChipGroup");
|
|
820
|
+
return M(), ne("div", Fo, [
|
|
821
821
|
g(G, {
|
|
822
822
|
"model-value": v.modelValue,
|
|
823
823
|
disabled: v.disabled,
|
|
@@ -859,7 +859,7 @@ const Oo = /* @__PURE__ */ it(Ro, [["render", Mo]]), Fo = { class: "flex flex-co
|
|
|
859
859
|
]),
|
|
860
860
|
default: P(() => [
|
|
861
861
|
D("div", zo, [
|
|
862
|
-
(
|
|
862
|
+
(M(!0), ne(Me, null, Ue(v.items, (R) => (M(), H(f, {
|
|
863
863
|
key: R.value,
|
|
864
864
|
disabled: R.disabled,
|
|
865
865
|
"has-checkbox": !0,
|
|
@@ -875,8 +875,8 @@ const Oo = /* @__PURE__ */ it(Ro, [["render", Mo]]), Fo = { class: "flex flex-co
|
|
|
875
875
|
]),
|
|
876
876
|
_: 3
|
|
877
877
|
}, 8, ["model-value", "disabled", "focused", "helper-state", "helper-text", "rules"]),
|
|
878
|
-
v.shouldShowChips && r.value.length > 0 ? (
|
|
879
|
-
g(
|
|
878
|
+
v.shouldShowChips && r.value.length > 0 ? (M(), ne("div", Io, [
|
|
879
|
+
g(N, {
|
|
880
880
|
disabled: v.disabled,
|
|
881
881
|
items: r.value.map((W) => ({ label: W.label })),
|
|
882
882
|
removable: "",
|
|
@@ -1133,7 +1133,7 @@ var dt = function(e, i) {
|
|
|
1133
1133
|
this.touches.length && this.$emit("drag-end"), this.hovered && (this.$emit("leave"), this.hovered = !1), this.touches = [];
|
|
1134
1134
|
} }, emits: ["drag", "drag-end", "leave", "enter"] };
|
|
1135
1135
|
Qt.render = function(e, i, t, n, a, o) {
|
|
1136
|
-
return
|
|
1136
|
+
return M(), H("div", { ref: "draggable", class: t.classname, onTouchstart: i[1] || (i[1] = function() {
|
|
1137
1137
|
return o.onTouchStart && o.onTouchStart.apply(o, arguments);
|
|
1138
1138
|
}), onMousedown: i[2] || (i[2] = function() {
|
|
1139
1139
|
return o.onMouseDown && o.onMouseDown.apply(o, arguments);
|
|
@@ -1152,8 +1152,8 @@ var It = Te("vue-handler-wrapper"), qi = { name: "HandlerWrapper", components: {
|
|
|
1152
1152
|
return { root: e, draggable: It("draggable") };
|
|
1153
1153
|
} }, emits: ["leave", "enter", "drag", "drag-end"] };
|
|
1154
1154
|
qi.render = function(e, i, t, n, a, o) {
|
|
1155
|
-
var r =
|
|
1156
|
-
return
|
|
1155
|
+
var r = B("DraggableElement");
|
|
1156
|
+
return M(), H("div", { class: o.classes.root }, [g(r, { class: o.classes.draggable, onDrag: i[1] || (i[1] = function(l) {
|
|
1157
1157
|
return e.$emit("drag", l);
|
|
1158
1158
|
}), onDragEnd: i[2] || (i[2] = function(l) {
|
|
1159
1159
|
return e.$emit("drag-end");
|
|
@@ -1170,8 +1170,8 @@ var $o = Te("vue-line-wrapper"), Zi = { name: "LineWrapper", components: { Dragg
|
|
|
1170
1170
|
return $o((ze(e = {}, this.position, !0), ze(e, "disabled", this.disabled), e));
|
|
1171
1171
|
} }, emits: ["leave", "enter", "drag", "drag-end"] };
|
|
1172
1172
|
Zi.render = function(e, i, t, n, a, o) {
|
|
1173
|
-
var r =
|
|
1174
|
-
return
|
|
1173
|
+
var r = B("DraggableElement");
|
|
1174
|
+
return M(), H(r, { class: o.classname, onDrag: i[1] || (i[1] = function(l) {
|
|
1175
1175
|
return e.$emit("drag", l);
|
|
1176
1176
|
}), onDragEnd: i[2] || (i[2] = function(l) {
|
|
1177
1177
|
return e.$emit("drag-end");
|
|
@@ -1439,8 +1439,8 @@ var ia = Te("vue-simple-handler"), na = Te("vue-simple-handler-wrapper"), Jt = {
|
|
|
1439
1439
|
this.$emit("drag-end");
|
|
1440
1440
|
} }, emits: ["drag", "drag-end"] };
|
|
1441
1441
|
Jt.render = function(e, i, t, n, a, o) {
|
|
1442
|
-
var r =
|
|
1443
|
-
return
|
|
1442
|
+
var r = B("HandlerWrapper");
|
|
1443
|
+
return M(), H(r, { class: o.classes.wrapper, "vertical-position": t.verticalPosition, "horizontal-position": t.horizontalPosition, disabled: t.disabled, onDrag: o.onDrag, onDragEnd: o.onDragEnd, onEnter: o.onEnter, onLeave: o.onLeave }, { default: P(function() {
|
|
1444
1444
|
return [g("div", { class: o.classes.default }, null, 2)];
|
|
1445
1445
|
}), _: 1 }, 8, ["class", "vertical-position", "horizontal-position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
|
|
1446
1446
|
};
|
|
@@ -1458,8 +1458,8 @@ var oa = Te("vue-simple-line"), aa = Te("vue-simple-line-wrapper"), ei = { name:
|
|
|
1458
1458
|
this.$emit("drag-end");
|
|
1459
1459
|
} }, emits: ["drag", "drag-end"] };
|
|
1460
1460
|
ei.render = function(e, i, t, n, a, o) {
|
|
1461
|
-
var r =
|
|
1462
|
-
return
|
|
1461
|
+
var r = B("LineWrapper");
|
|
1462
|
+
return M(), H(r, { class: o.classes.wrapper, position: t.position, disabled: t.disabled, onDrag: o.onDrag, onDragEnd: o.onDragEnd, onEnter: o.onEnter, onLeave: o.onLeave }, { default: P(function() {
|
|
1463
1463
|
return [g("div", { class: o.classes.root }, null, 2)];
|
|
1464
1464
|
}), _: 1 }, 8, ["class", "position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
|
|
1465
1465
|
};
|
|
@@ -1525,14 +1525,14 @@ var Tt = Te("vue-bounding-box"), ra = ["east", "west", null], sa = ["south", "no
|
|
|
1525
1525
|
i === "west" ? l.left -= o : i === "east" && (l.right += o), t === "north" ? l.top -= r : t === "south" && (l.bottom += r), !t && i ? n = "width" : t && !i && (n = "height"), this.resizable && this.$emit("resize", new Vo(l, { allowedDirections: { left: i === "west" || !i, right: i === "east" || !i, bottom: t === "south" || !t, top: t === "north" || !t }, preserveAspectRatio: e.nativeEvent && e.nativeEvent.shiftKey, respectDirection: n }));
|
|
1526
1526
|
} }, emits: ["resize", "resize-end"] };
|
|
1527
1527
|
tn.render = function(e, i, t, n, a, o) {
|
|
1528
|
-
return
|
|
1529
|
-
return
|
|
1528
|
+
return M(), H("div", { ref: "box", class: o.classes.root, style: o.style }, [fe(e.$slots, "default"), g("div", null, [(M(!0), H(Me, null, Ue(o.lineNodes, function(r) {
|
|
1529
|
+
return M(), H(St(r.component), { key: r.name, "default-class": r.class, "hover-class": r.hoverClass, "wrapper-class": r.wrapperClass, position: r.name, disabled: r.disabled, onDrag: function(l) {
|
|
1530
1530
|
return o.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
|
|
1531
1531
|
}, onDragEnd: i[1] || (i[1] = function(l) {
|
|
1532
1532
|
return o.onEnd();
|
|
1533
1533
|
}) }, null, 8, ["default-class", "hover-class", "wrapper-class", "position", "disabled", "onDrag"]);
|
|
1534
|
-
}), 128))]), (
|
|
1535
|
-
return
|
|
1534
|
+
}), 128))]), (M(!0), H(Me, null, Ue(o.handlerNodes, function(r) {
|
|
1535
|
+
return M(), H("div", { key: r.name, style: r.wrapperStyle, class: r.wrapperClass }, [(M(), H(St(r.component), { "default-class": r.class, "hover-class": r.hoverClass, "wrapper-class": r.wrapperClass, "horizontal-position": r.horizontalDirection, "vertical-position": r.verticalDirection, disabled: r.disabled, onDrag: function(l) {
|
|
1536
1536
|
return o.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
|
|
1537
1537
|
}, onDragEnd: i[2] || (i[2] = function(l) {
|
|
1538
1538
|
return o.onEnd();
|
|
@@ -1578,7 +1578,7 @@ var la = Te("vue-draggable-area"), nn = { name: "DraggableArea", props: { movabl
|
|
|
1578
1578
|
this.touches.length && this.$emit("move-end"), this.touches = [];
|
|
1579
1579
|
} }, emits: ["move", "move-end"] };
|
|
1580
1580
|
nn.render = function(e, i, t, n, a, o) {
|
|
1581
|
-
return
|
|
1581
|
+
return M(), H("div", { ref: "container", onTouchstart: i[1] || (i[1] = function() {
|
|
1582
1582
|
return o.onTouchStart && o.onTouchStart.apply(o, arguments);
|
|
1583
1583
|
}), onMousedown: i[2] || (i[2] = function() {
|
|
1584
1584
|
return o.onMouseDown && o.onMouseDown.apply(o, arguments);
|
|
@@ -1722,7 +1722,7 @@ var an = { props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { typ
|
|
|
1722
1722
|
var r, l;
|
|
1723
1723
|
} }, emits: ["resize", "move", "transform-end"] };
|
|
1724
1724
|
an.render = function(e, i, t, n, a, o) {
|
|
1725
|
-
return
|
|
1725
|
+
return M(), H("div", { ref: "container", onTouchstart: i[1] || (i[1] = function() {
|
|
1726
1726
|
return o.onTouchStart && o.onTouchStart.apply(o, arguments);
|
|
1727
1727
|
}), onMousedown: i[2] || (i[2] = function() {
|
|
1728
1728
|
return o.onMouseDown && o.onMouseDown.apply(o, arguments);
|
|
@@ -1732,8 +1732,8 @@ an.render = function(e, i, t, n, a, o) {
|
|
|
1732
1732
|
};
|
|
1733
1733
|
var Wt = { components: { TransformableImage: an }, props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { type: Boolean, required: !0 }, touchResize: { type: Boolean, required: !0 }, wheelResize: { type: [Boolean, Object], required: !0 } }, emits: ["resize", "move"] };
|
|
1734
1734
|
Wt.render = function(e, i, t, n, a, o) {
|
|
1735
|
-
var r =
|
|
1736
|
-
return
|
|
1735
|
+
var r = B("transformable-image");
|
|
1736
|
+
return M(), H(r, { "touch-move": t.touchMove, "touch-resize": t.touchResize, "mouse-move": t.mouseMove, "wheel-resize": t.wheelResize, onMove: i[1] || (i[1] = function(l) {
|
|
1737
1737
|
return e.$emit("move", l);
|
|
1738
1738
|
}), onResize: i[2] || (i[2] = function(l) {
|
|
1739
1739
|
return e.$emit("resize", l);
|
|
@@ -1785,12 +1785,12 @@ var yt = Te("vue-preview"), rn = { props: { coordinates: { type: Object }, trans
|
|
|
1785
1785
|
e && e.complete && this.refreshImage(), this.refresh();
|
|
1786
1786
|
} } };
|
|
1787
1787
|
rn.render = function(e, i, t, n, a, o) {
|
|
1788
|
-
return
|
|
1788
|
+
return M(), H("div", { ref: "root", class: o.classes.root, style: o.style }, [g("div", { ref: "wrapper", class: o.classes.wrapper, style: o.wrapperStyle }, [ut(g("img", { ref: "image", src: t.image && t.image.src, class: o.classes.image, style: o.imageStyle }, null, 14, ["src"]), [[Ct, t.image && t.image.src]])], 6)], 6);
|
|
1789
1789
|
};
|
|
1790
1790
|
var sn = { components: { Preview: rn }, inheritAttrs: !1 };
|
|
1791
1791
|
sn.render = function(e, i, t, n, a, o) {
|
|
1792
|
-
var r =
|
|
1793
|
-
return
|
|
1792
|
+
var r = B("preview");
|
|
1793
|
+
return M(), H(r, Fi(e.$attrs, { fill: !0 }), null, 16);
|
|
1794
1794
|
};
|
|
1795
1795
|
var Pt = Te("vue-rectangle-stencil"), ln = { name: "RectangleStencil", components: { StencilPreview: sn, BoundingBox: tn, DraggableArea: nn }, props: { image: { type: Object }, coordinates: { type: Object }, stencilCoordinates: { type: Object }, handlers: { type: Object }, handlersComponent: { type: [Object, String], default: function() {
|
|
1796
1796
|
return Jt;
|
|
@@ -1823,8 +1823,8 @@ var Pt = Te("vue-rectangle-stencil"), ln = { name: "RectangleStencil", component
|
|
|
1823
1823
|
return { minimum: this.aspectRatio || this.minAspectRatio, maximum: this.aspectRatio || this.maxAspectRatio };
|
|
1824
1824
|
} }, emits: ["resize", "resize-end", "move", "move-end"] };
|
|
1825
1825
|
ln.render = function(e, i, t, n, a, o) {
|
|
1826
|
-
var r =
|
|
1827
|
-
return
|
|
1826
|
+
var r = B("stencil-preview"), l = B("draggable-area"), s = B("bounding-box");
|
|
1827
|
+
return M(), H("div", { class: o.classes.stencil, style: o.style }, [g(s, { width: t.stencilCoordinates.width, height: t.stencilCoordinates.height, transitions: t.transitions, class: o.classes.boundingBox, handlers: t.handlers, "handlers-component": t.handlersComponent, "handlers-classes": t.handlersClasses, "handlers-wrappers-classes": t.handlersWrappersClasses, lines: t.lines, "lines-component": t.linesComponent, "lines-classes": t.linesClasses, "lines-wrappers-classes": t.linesWrappersClasses, resizable: t.resizable, onResize: o.onResize, onResizeEnd: o.onResizeEnd }, { default: P(function() {
|
|
1828
1828
|
return [g(l, { movable: t.movable, onMove: o.onMove, onMoveEnd: o.onMoveEnd }, { default: P(function() {
|
|
1829
1829
|
return [g(r, { image: t.image, coordinates: t.coordinates, width: t.stencilCoordinates.width, height: t.stencilCoordinates.height, class: o.classes.preview, transitions: t.transitions }, null, 8, ["image", "coordinates", "width", "height", "class", "transitions"])];
|
|
1830
1830
|
}), _: 1 }, 8, ["movable", "onMove", "onMoveEnd"])];
|
|
@@ -2257,9 +2257,9 @@ var da = ["transitions"], Ge = Te("vue-advanced-cropper"), un = { name: "Cropper
|
|
|
2257
2257
|
}
|
|
2258
2258
|
} }, emits: ["change", "error", "ready"] }, ma = { key: 0, ref: "canvas", style: { display: "none" } }, pa = { key: 1, ref: "sourceCanvas", style: { display: "none" } };
|
|
2259
2259
|
un.render = function(e, i, t, n, a, o) {
|
|
2260
|
-
return
|
|
2260
|
+
return M(), H("div", { ref: "cropper", class: o.classes.cropper }, [g("div", { ref: "stretcher", class: o.classes.stretcher }, null, 2), g("div", { class: o.classes.boundaries, style: o.boundariesStyle }, [(M(), H(St(t.backgroundWrapperComponent), { class: o.classes.cropperWrapper, "wheel-resize": o.settings.resizeImage.wheel, "touch-resize": o.settings.resizeImage.touch, "touch-move": o.settings.moveImage.touch, "mouse-move": o.settings.moveImage.mouse, onMove: o.onManipulateImage, onResize: o.onManipulateImage }, { default: P(function() {
|
|
2261
2261
|
return [g("div", { class: o.classes.background, style: o.boundariesStyle }, null, 6), g("div", { class: o.classes.imageWrapper }, [g("img", { ref: "image", crossorigin: a.imageAttributes.crossOrigin, src: a.imageAttributes.src, class: o.classes.image, style: o.imageStyle, onMousedown: i[1] || (i[1] = kt(function() {
|
|
2262
|
-
}, ["prevent"])) }, null, 46, ["crossorigin", "src"])], 2), g("div", { class: o.classes.foreground, style: o.boundariesStyle }, null, 6), ut((
|
|
2262
|
+
}, ["prevent"])) }, null, 46, ["crossorigin", "src"])], 2), g("div", { class: o.classes.foreground, style: o.boundariesStyle }, null, 6), ut((M(), H(St(t.stencilComponent), Fi({ ref: "stencil", image: o.image, coordinates: a.coordinates, "stencil-coordinates": o.stencilCoordinates, transitions: o.transitionsOptions }, t.stencilProps, { onResize: o.onResize, onResizeEnd: o.onResizeEnd, onMove: o.onMove, onMoveEnd: o.onMoveEnd }), null, 16, ["image", "coordinates", "stencil-coordinates", "transitions", "onResize", "onResizeEnd", "onMove", "onMoveEnd"])), [[Ct, a.imageLoaded]]), t.canvas ? (M(), H("canvas", ma, null, 512)) : ie("", !0), t.canvas ? (M(), H("canvas", pa, null, 512)) : ie("", !0)];
|
|
2263
2263
|
}), _: 1 }, 8, ["class", "wheel-resize", "touch-resize", "touch-move", "mouse-move", "onMove", "onResize"]))], 6)], 2);
|
|
2264
2264
|
};
|
|
2265
2265
|
function ti(e, i) {
|
|
@@ -2306,7 +2306,7 @@ const va = {
|
|
|
2306
2306
|
},
|
|
2307
2307
|
emits: ["update:model-value", "reset:model-value"],
|
|
2308
2308
|
setup(e, { emit: i }) {
|
|
2309
|
-
const t = e, { t: n } = pe(), a = i, o =
|
|
2309
|
+
const t = e, { t: n } = pe(), a = i, o = O(() => t.modelValue ? URL.createObjectURL(t.modelValue) : ""), r = te(), l = te(), s = te(!1);
|
|
2310
2310
|
async function u([b]) {
|
|
2311
2311
|
if (!b) return;
|
|
2312
2312
|
s.value = !0;
|
|
@@ -2334,7 +2334,7 @@ const va = {
|
|
|
2334
2334
|
function m() {
|
|
2335
2335
|
r.value = void 0, l.value = void 0, a("reset:model-value");
|
|
2336
2336
|
}
|
|
2337
|
-
const p = Ht(), v =
|
|
2337
|
+
const p = Ht(), v = O(() => !!p.showRemy);
|
|
2338
2338
|
ti("apply-image", (b) => {
|
|
2339
2339
|
b != null && b.imageData && (r.value = b.imageData, l.value = b.imageData);
|
|
2340
2340
|
});
|
|
@@ -2351,8 +2351,8 @@ const va = {
|
|
|
2351
2351
|
});
|
|
2352
2352
|
}
|
|
2353
2353
|
return (b, _) => {
|
|
2354
|
-
const f =
|
|
2355
|
-
return r.value || o.value ? (
|
|
2354
|
+
const f = B("fm-icon"), C = B("fm-drop-field");
|
|
2355
|
+
return r.value || o.value ? (M(), ne("div", va, [
|
|
2356
2356
|
D("p", ga, [
|
|
2357
2357
|
Vt(ce(h(n)("menu.common.labels.product_image")) + " ", 1),
|
|
2358
2358
|
D("span", ba, ce(h(n)("menu.common.labels.optional")), 1)
|
|
@@ -2384,7 +2384,7 @@ const va = {
|
|
|
2384
2384
|
}, [
|
|
2385
2385
|
g(f, { name: "close" })
|
|
2386
2386
|
]),
|
|
2387
|
-
v.value ? (
|
|
2387
|
+
v.value ? (M(), ne("button", {
|
|
2388
2388
|
key: 0,
|
|
2389
2389
|
class: Fe([
|
|
2390
2390
|
"w-24 h-24 rounded-[50%]",
|
|
@@ -2402,7 +2402,7 @@ const va = {
|
|
|
2402
2402
|
])
|
|
2403
2403
|
])
|
|
2404
2404
|
])
|
|
2405
|
-
])) : (
|
|
2405
|
+
])) : (M(), H(C, {
|
|
2406
2406
|
key: 1,
|
|
2407
2407
|
accept: ".jpg, .jpeg, .png, .gif, .JPG, .JPEG, .PNG, .GIF",
|
|
2408
2408
|
"content-class": "h-[150px] w-[200px]",
|
|
@@ -2463,7 +2463,7 @@ const va = {
|
|
|
2463
2463
|
},
|
|
2464
2464
|
emits: ["update:model-value"],
|
|
2465
2465
|
setup(e, { emit: i }) {
|
|
2466
|
-
const t = e, { t: n } = pe(), a = i, o =
|
|
2466
|
+
const t = e, { t: n } = pe(), a = i, o = O(() => ({
|
|
2467
2467
|
ALL: {
|
|
2468
2468
|
label: n("menu.order.from.options.all"),
|
|
2469
2469
|
value: Y.F_ORDER_FROM.enum.ALL
|
|
@@ -2476,7 +2476,7 @@ const va = {
|
|
|
2476
2476
|
label: n("menu.order.from.options.none"),
|
|
2477
2477
|
value: Y.F_ORDER_FROM.enum.NONE
|
|
2478
2478
|
}
|
|
2479
|
-
})), r =
|
|
2479
|
+
})), r = O(() => {
|
|
2480
2480
|
const u = Object.values(o.value);
|
|
2481
2481
|
if (t.disable) return u;
|
|
2482
2482
|
let d = t.editActiveOnly ? [o.value.ALL, o.value.NONE] : u;
|
|
@@ -2492,14 +2492,14 @@ const va = {
|
|
|
2492
2492
|
let d = u;
|
|
2493
2493
|
return t.editActiveOnly && u && (d = d === Y.F_ORDER_FROM.enum.NONE ? Y.F_ORDER_FROM.enum.NONE : Y.F_ORDER_FROM.enum.ALL), d;
|
|
2494
2494
|
}
|
|
2495
|
-
const s =
|
|
2495
|
+
const s = O(() => {
|
|
2496
2496
|
if (t.modelValue) return t.modelValue;
|
|
2497
2497
|
const u = t.editActiveOnly || t.required, d = r.value.some((m) => m.value === null), c = u && !d ? t.fallback ?? r.value[0].value : t.modelValue;
|
|
2498
2498
|
return c ? l(c) : null;
|
|
2499
2499
|
});
|
|
2500
2500
|
return (u, d) => {
|
|
2501
|
-
const c =
|
|
2502
|
-
return
|
|
2501
|
+
const c = B("fm-select");
|
|
2502
|
+
return M(), ne("div", null, [
|
|
2503
2503
|
g(c, {
|
|
2504
2504
|
disabled: e.disable,
|
|
2505
2505
|
items: r.value,
|
|
@@ -2547,10 +2547,10 @@ const va = {
|
|
|
2547
2547
|
}, v = () => {
|
|
2548
2548
|
var f;
|
|
2549
2549
|
(f = u.value) == null || f.toggleMenu(!1), c.create();
|
|
2550
|
-
}, y =
|
|
2550
|
+
}, y = O(() => t.items.reduce(
|
|
2551
2551
|
(f, C) => (f[C.value] = C, f),
|
|
2552
2552
|
{}
|
|
2553
|
-
)), b =
|
|
2553
|
+
)), b = O(() => d.value.length > 0 ? d.value.map((f) => f.label).join("/") : t.placeholder), _ = te(!1);
|
|
2554
2554
|
return Re(
|
|
2555
2555
|
() => t.modelValue,
|
|
2556
2556
|
(f) => {
|
|
@@ -2558,8 +2558,8 @@ const va = {
|
|
|
2558
2558
|
},
|
|
2559
2559
|
{ immediate: !0 }
|
|
2560
2560
|
), (f, C) => {
|
|
2561
|
-
const G =
|
|
2562
|
-
return
|
|
2561
|
+
const G = B("FmIcon"), N = B("FmField"), W = B("FmMenuItem"), R = B("FmMenu"), V = B("FmFormGroup"), E = B("FmChipGroup");
|
|
2562
|
+
return M(), ne("div", Aa, [
|
|
2563
2563
|
g(V, {
|
|
2564
2564
|
"model-value": f.modelValue,
|
|
2565
2565
|
disabled: f.disabled,
|
|
@@ -2568,19 +2568,19 @@ const va = {
|
|
|
2568
2568
|
"helper-text": f.helperText,
|
|
2569
2569
|
rules: f.rules
|
|
2570
2570
|
}, {
|
|
2571
|
-
default: P(({ invalid:
|
|
2571
|
+
default: P(({ invalid: U }) => [
|
|
2572
2572
|
g(R, {
|
|
2573
2573
|
disabled: f.disabled,
|
|
2574
2574
|
ref_key: "fmMenuRef",
|
|
2575
2575
|
ref: u,
|
|
2576
2576
|
"close-on-click": !1,
|
|
2577
|
-
onMenuChanged: C[1] || (C[1] = (
|
|
2577
|
+
onMenuChanged: C[1] || (C[1] = (k) => _.value = k)
|
|
2578
2578
|
}, {
|
|
2579
2579
|
"menu-button": P(() => [
|
|
2580
|
-
g(
|
|
2580
|
+
g(N, {
|
|
2581
2581
|
class: Fe(f.disabled ? "cursor-not-allowed" : "cursor-pointer"),
|
|
2582
2582
|
focused: _.value,
|
|
2583
|
-
invalid:
|
|
2583
|
+
invalid: U
|
|
2584
2584
|
}, {
|
|
2585
2585
|
append: P(() => [
|
|
2586
2586
|
g(G, {
|
|
@@ -2601,18 +2601,18 @@ const va = {
|
|
|
2601
2601
|
]),
|
|
2602
2602
|
default: P(() => [
|
|
2603
2603
|
D("div", Ma, [
|
|
2604
|
-
(
|
|
2605
|
-
key:
|
|
2606
|
-
disabled:
|
|
2604
|
+
(M(!0), ne(Me, null, Ue(f.items, (k) => (M(), H(W, {
|
|
2605
|
+
key: k.value,
|
|
2606
|
+
disabled: k.disabled,
|
|
2607
2607
|
"has-checkbox": !0,
|
|
2608
|
-
label:
|
|
2609
|
-
"model-value": d.value.some((S) => S.value ===
|
|
2610
|
-
"onUpdate:modelValue": (S) => m(S,
|
|
2608
|
+
label: k.label,
|
|
2609
|
+
"model-value": d.value.some((S) => S.value === k.value),
|
|
2610
|
+
"onUpdate:modelValue": (S) => m(S, k)
|
|
2611
2611
|
}, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue"]))), 128)),
|
|
2612
2612
|
D("button", {
|
|
2613
2613
|
class: "flex items-center py-8 px-16 space-x-8",
|
|
2614
2614
|
type: "button",
|
|
2615
|
-
onClick: C[0] || (C[0] = (
|
|
2615
|
+
onClick: C[0] || (C[0] = (k) => v())
|
|
2616
2616
|
}, [
|
|
2617
2617
|
g(G, {
|
|
2618
2618
|
color: "primary",
|
|
@@ -2628,10 +2628,10 @@ const va = {
|
|
|
2628
2628
|
]),
|
|
2629
2629
|
_: 1
|
|
2630
2630
|
}, 8, ["model-value", "disabled", "focused", "helper-state", "helper-text", "rules"]),
|
|
2631
|
-
d.value.length > 0 ? (
|
|
2632
|
-
g(
|
|
2631
|
+
d.value.length > 0 ? (M(), ne("div", Fa, [
|
|
2632
|
+
g(E, {
|
|
2633
2633
|
disabled: f.disabled,
|
|
2634
|
-
items: d.value.map((
|
|
2634
|
+
items: d.value.map((U) => ({ label: U.label })),
|
|
2635
2635
|
removable: "",
|
|
2636
2636
|
onChipClosed: p
|
|
2637
2637
|
}, null, 8, ["disabled", "items"])
|
|
@@ -2699,47 +2699,47 @@ const Wa = /* @__PURE__ */ de({
|
|
|
2699
2699
|
menuLoader: s
|
|
2700
2700
|
}), {
|
|
2701
2701
|
checkMenuIsLoading: d
|
|
2702
|
-
} = qe(Xe($e())), c = i, m =
|
|
2703
|
-
const
|
|
2704
|
-
label:
|
|
2705
|
-
value:
|
|
2702
|
+
} = qe(Xe($e())), c = i, m = O(() => n.rules.item), p = O(() => n.categorizedItems), v = O(() => {
|
|
2703
|
+
const T = p.value.map(($) => ({
|
|
2704
|
+
label: $.name,
|
|
2705
|
+
value: $.id
|
|
2706
2706
|
}));
|
|
2707
|
-
return t.isAddon ?
|
|
2708
|
-
}), y =
|
|
2707
|
+
return t.isAddon ? T : T.filter(($) => !!$.value);
|
|
2708
|
+
}), y = O(() => m.value.addon), b = O(() => !v.value.find((T) => !!T.value)), _ = O(() => On(t.form.category ? t.form : t.fallback) || []), f = O(() => _.value.reduce((T, $) => (T[$._id] = $, T), {})), C = O({
|
|
2709
2709
|
get() {
|
|
2710
|
-
return _.value.map((
|
|
2710
|
+
return _.value.map((T) => T._id);
|
|
2711
2711
|
},
|
|
2712
|
-
set(
|
|
2713
|
-
const [
|
|
2714
|
-
const
|
|
2715
|
-
return
|
|
2716
|
-
_id:
|
|
2712
|
+
set(T = []) {
|
|
2713
|
+
const [$, ...A] = T.map((z) => {
|
|
2714
|
+
const j = f.value[z];
|
|
2715
|
+
return j || {
|
|
2716
|
+
_id: z,
|
|
2717
2717
|
position: null
|
|
2718
2718
|
};
|
|
2719
2719
|
});
|
|
2720
|
-
if (
|
|
2720
|
+
if (!$) {
|
|
2721
2721
|
c("update:form", "category", null), c("update:form", "additionalCategories", []);
|
|
2722
2722
|
return;
|
|
2723
2723
|
}
|
|
2724
|
-
c("update:form", "category",
|
|
2724
|
+
c("update:form", "category", $._id), c("update:form", "additionalCategories", A);
|
|
2725
2725
|
}
|
|
2726
|
-
}), G = te(),
|
|
2727
|
-
multiple:
|
|
2726
|
+
}), G = te(), N = ({
|
|
2727
|
+
multiple: T = !0
|
|
2728
2728
|
} = {}) => t.isAddon ? null : g(To, {
|
|
2729
2729
|
ref: G,
|
|
2730
2730
|
disabled: !m.value.category || t.isAddon || d(),
|
|
2731
2731
|
items: v.value,
|
|
2732
2732
|
modelValue: C.value,
|
|
2733
|
-
"onUpdate:model-value": (
|
|
2734
|
-
placeholder:
|
|
2735
|
-
multiple:
|
|
2733
|
+
"onUpdate:model-value": ($) => C.value = $,
|
|
2734
|
+
placeholder: F("menu.product.form.detail.category.placeholder"),
|
|
2735
|
+
multiple: T
|
|
2736
2736
|
}, {
|
|
2737
2737
|
"append-menu": () => g("button", {
|
|
2738
2738
|
class: "flex items-center py-8 px-16 space-x-8",
|
|
2739
2739
|
type: "button",
|
|
2740
2740
|
onClick: () => {
|
|
2741
|
-
var
|
|
2742
|
-
(
|
|
2741
|
+
var $;
|
|
2742
|
+
($ = G.value) == null || $.hideMenu(), u.create();
|
|
2743
2743
|
}
|
|
2744
2744
|
}, [g(Ae.FmIcon, {
|
|
2745
2745
|
color: "primary",
|
|
@@ -2747,196 +2747,196 @@ const Wa = /* @__PURE__ */ de({
|
|
|
2747
2747
|
size: "md"
|
|
2748
2748
|
}, null), g("p", {
|
|
2749
2749
|
class: "fm-typo-en-body-lg-600 text-fm-color-primary"
|
|
2750
|
-
}, [
|
|
2750
|
+
}, [F("menu.product.form.detail.category.add_new")])])
|
|
2751
2751
|
});
|
|
2752
2752
|
ot(async () => {
|
|
2753
|
-
!b.value && t.form.category === void 0 && t.isCreate &&
|
|
2753
|
+
!b.value && t.form.category === void 0 && t.isCreate && E(Je.PRODUCT);
|
|
2754
2754
|
});
|
|
2755
|
-
const W =
|
|
2756
|
-
var
|
|
2757
|
-
const
|
|
2758
|
-
return
|
|
2759
|
-
}), R =
|
|
2760
|
-
var
|
|
2755
|
+
const W = O(() => {
|
|
2756
|
+
var $;
|
|
2757
|
+
const T = t.form.name || (($ = t.fallback) == null ? void 0 : $.name);
|
|
2758
|
+
return T ? n.items.filter((A) => !!A.category && A._id !== t.form._id && A.name === T).length : 0;
|
|
2759
|
+
}), R = O(() => {
|
|
2760
|
+
var z, j, q;
|
|
2761
2761
|
if (!n.state.featureFlags.uniqueProductCode) return 0;
|
|
2762
|
-
const
|
|
2763
|
-
if (!
|
|
2764
|
-
let
|
|
2765
|
-
const A = n.items.find((
|
|
2766
|
-
return (A == null ? void 0 : A.code) ===
|
|
2767
|
-
|
|
2768
|
-
}),
|
|
2769
|
-
}), V =
|
|
2770
|
-
function T
|
|
2771
|
-
var A,
|
|
2772
|
-
if (V.value ===
|
|
2773
|
-
const
|
|
2774
|
-
c("update:form", "category", t.isOverride ?
|
|
2762
|
+
const T = t.form.code || ((z = t.fallback) == null ? void 0 : z.code);
|
|
2763
|
+
if (!T) return 0;
|
|
2764
|
+
let $ = n.itemCodeMap.get(T) || 0;
|
|
2765
|
+
const A = n.items.find((Z) => Z._id === t.form._id);
|
|
2766
|
+
return (A == null ? void 0 : A.code) === T && ($ -= 1), (q = (j = A == null ? void 0 : A.variant) == null ? void 0 : j.variantCombinations) == null || q.forEach((Z) => {
|
|
2767
|
+
Z.code === T && ($ -= 1);
|
|
2768
|
+
}), $;
|
|
2769
|
+
}), V = O(() => t.isAddon ? Je.ADD_ON : Je.PRODUCT);
|
|
2770
|
+
function E(T) {
|
|
2771
|
+
var A, z, j;
|
|
2772
|
+
if (V.value === T) return;
|
|
2773
|
+
const $ = T == Je.ADD_ON;
|
|
2774
|
+
c("update:form", "category", t.isOverride ? $ ? "" : ((A = t.fallback) == null ? void 0 : A.category) ?? ((z = v.value.find((q) => !!q.value)) == null ? void 0 : z.value) : $ ? null : (j = v.value.find((q) => !!q.value)) == null ? void 0 : j.value), $ && c("update:form", "additionalCategories", []);
|
|
2775
2775
|
}
|
|
2776
|
-
const
|
|
2777
|
-
ti("apply-description", (
|
|
2778
|
-
c("update:form", "description",
|
|
2776
|
+
const U = Ht();
|
|
2777
|
+
ti("apply-description", (T) => {
|
|
2778
|
+
c("update:form", "description", T || "");
|
|
2779
2779
|
});
|
|
2780
|
-
async function
|
|
2780
|
+
async function k() {
|
|
2781
2781
|
if (!t.form.name) {
|
|
2782
|
-
const
|
|
2783
|
-
if (
|
|
2784
|
-
|
|
2782
|
+
const T = document.getElementById("product-name");
|
|
2783
|
+
if (T) {
|
|
2784
|
+
T.focus();
|
|
2785
2785
|
return;
|
|
2786
2786
|
} else
|
|
2787
2787
|
return;
|
|
2788
2788
|
}
|
|
2789
2789
|
a.pushDataLayer({
|
|
2790
2790
|
event: "menu_catalog_item_general_remy_suggest_description"
|
|
2791
|
-
}),
|
|
2791
|
+
}), U.activate({
|
|
2792
2792
|
prompt: `Suggest a menu description for ${t.form.name}`,
|
|
2793
2793
|
command: "suggestDescription"
|
|
2794
2794
|
});
|
|
2795
2795
|
}
|
|
2796
|
-
const S =
|
|
2797
|
-
label:
|
|
2798
|
-
value:
|
|
2799
|
-
}))),
|
|
2796
|
+
const S = O(() => n.subcategories), w = O(() => S.value.map((T) => ({
|
|
2797
|
+
label: T.name,
|
|
2798
|
+
value: T._id
|
|
2799
|
+
}))), I = O({
|
|
2800
2800
|
get() {
|
|
2801
2801
|
return t.form.subCategories || [];
|
|
2802
2802
|
},
|
|
2803
|
-
set(
|
|
2804
|
-
c("update:form", "subCategories",
|
|
2803
|
+
set(T) {
|
|
2804
|
+
c("update:form", "subCategories", T);
|
|
2805
2805
|
}
|
|
2806
|
-
}),
|
|
2807
|
-
function x(
|
|
2808
|
-
c("update:form", "minimumOrderQuantity", t.isOverride ?
|
|
2806
|
+
}), L = O(() => t.isOverride ? t.form.minimumOrderQuantity ?? null : t.form.minimumOrderQuantity ?? 0);
|
|
2807
|
+
function x(T) {
|
|
2808
|
+
c("update:form", "minimumOrderQuantity", t.isOverride ? T : T ?? 0);
|
|
2809
2809
|
}
|
|
2810
2810
|
const {
|
|
2811
|
-
t:
|
|
2811
|
+
t: F
|
|
2812
2812
|
} = pe();
|
|
2813
|
-
return (
|
|
2814
|
-
const A =
|
|
2815
|
-
return
|
|
2816
|
-
title: h(
|
|
2813
|
+
return (T, $) => {
|
|
2814
|
+
const A = B("fm-text-field"), z = B("fm-textarea"), j = B("fm-radio"), q = B("FmSnackbar"), Z = B("FmButton"), ae = B("fm-radio-group"), Q = B("FmFormGroup"), re = B("FmStepperField"), ve = zi("tooltip");
|
|
2815
|
+
return M(), H(Le, {
|
|
2816
|
+
title: h(F)("menu.product.form.detail.title")
|
|
2817
2817
|
}, {
|
|
2818
2818
|
default: P(() => {
|
|
2819
2819
|
var ke, ct;
|
|
2820
2820
|
return [D("div", Ea, [D("div", Ta, [D("div", Da, [D("div", Pa, [g(A, {
|
|
2821
|
-
"model-value":
|
|
2822
|
-
placeholder: ((ke =
|
|
2823
|
-
label: h(
|
|
2824
|
-
rules: [(oe) => R.value === 0 || h(
|
|
2821
|
+
"model-value": T.form.code,
|
|
2822
|
+
placeholder: ((ke = T.fallback) == null ? void 0 : ke.code) || h(F)("menu.product.form.detail.fields.code.placeholder"),
|
|
2823
|
+
label: h(F)("menu.product.form.detail.fields.code.label"),
|
|
2824
|
+
rules: [(oe) => R.value === 0 || h(F)("menu.product.form.detail.fields.code.duplicate_warning", {
|
|
2825
2825
|
count: R.value
|
|
2826
2826
|
})],
|
|
2827
|
-
"onUpdate:modelValue":
|
|
2827
|
+
"onUpdate:modelValue": $[0] || ($[0] = (oe) => c("update:form", "code", h(cn)(oe, T.isOverride)))
|
|
2828
2828
|
}, null, 8, ["model-value", "placeholder", "label", "rules"])]), D("div", Va, [g(A, {
|
|
2829
2829
|
id: "product-name",
|
|
2830
2830
|
disabled: !m.value.name,
|
|
2831
|
-
"helper-text": W.value > 0 ? h(
|
|
2831
|
+
"helper-text": W.value > 0 ? h(F)("menu.product.form.detail.fields.name.duplicate_warning", {
|
|
2832
2832
|
count: W.value
|
|
2833
2833
|
}) : void 0,
|
|
2834
|
-
"model-value":
|
|
2835
|
-
placeholder: (ct =
|
|
2836
|
-
rules: m.value.name ? [(oe) => !!oe || h(
|
|
2834
|
+
"model-value": T.form.name,
|
|
2835
|
+
placeholder: (ct = T.fallback) == null ? void 0 : ct.name,
|
|
2836
|
+
rules: m.value.name ? [(oe) => !!oe || h(F)("menu.product.form.detail.fields.name.required")] : void 0,
|
|
2837
2837
|
"label-mark": "required",
|
|
2838
2838
|
autofocus: "",
|
|
2839
|
-
label: h(
|
|
2840
|
-
"onUpdate:modelValue":
|
|
2841
|
-
}, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), D("div", Ua, [g(
|
|
2839
|
+
label: h(F)("menu.product.form.detail.fields.name.label"),
|
|
2840
|
+
"onUpdate:modelValue": $[1] || ($[1] = (oe) => c("update:form", "name", oe))
|
|
2841
|
+
}, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), D("div", Ua, [g(z, {
|
|
2842
2842
|
disabled: !m.value.description,
|
|
2843
|
-
"model-value":
|
|
2844
|
-
placeholder: h(
|
|
2845
|
-
"onUpdate:modelValue":
|
|
2843
|
+
"model-value": T.form.description || void 0,
|
|
2844
|
+
placeholder: h(F)("menu.product.form.detail.fields.description.placeholder"),
|
|
2845
|
+
"onUpdate:modelValue": $[2] || ($[2] = (oe) => c("update:form", "description", oe.trim())),
|
|
2846
2846
|
class: "description"
|
|
2847
2847
|
}, {
|
|
2848
|
-
label: P(() => [D("p", $a, [Vt(ce(h(
|
|
2848
|
+
label: P(() => [D("p", $a, [Vt(ce(h(F)("menu.product.form.detail.fields.description.label")) + " ", 1), D("span", Na, ce(h(F)("menu.product.form.detail.fields.description.optional")), 1)])]),
|
|
2849
2849
|
_: 1
|
|
2850
2850
|
}, 8, ["disabled", "model-value", "placeholder"]), ut(g(h($i), {
|
|
2851
2851
|
class: "absolute top-32 right-4 cursor-pointer",
|
|
2852
|
-
onClick:
|
|
2852
|
+
onClick: k
|
|
2853
2853
|
}, null, 512), [[ve, h(Vi)("Suggest description")]])])]), g(Ra, {
|
|
2854
2854
|
disabled: !m.value.thumbnail,
|
|
2855
|
-
"model-value":
|
|
2856
|
-
"onUpdate:modelValue":
|
|
2857
|
-
"onReset:modelValue":
|
|
2858
|
-
"onUpdate:trackingId":
|
|
2855
|
+
"model-value": T.thumbnail,
|
|
2856
|
+
"onUpdate:modelValue": $[3] || ($[3] = (oe) => c("update:thumbnail", oe)),
|
|
2857
|
+
"onReset:modelValue": $[4] || ($[4] = (oe) => c("reset:thumbnail")),
|
|
2858
|
+
"onUpdate:trackingId": $[5] || ($[5] = (oe) => c("update:form", "_thumbnailTrackingId", oe))
|
|
2859
2859
|
}, null, 8, ["disabled", "model-value"])]), g(Ye, {
|
|
2860
|
-
label: h(n).isV4 ? h(
|
|
2860
|
+
label: h(n).isV4 ? h(F)("menu.product.form.detail.category.label") : h(F)("menu.product.form.detail.category.label_singular")
|
|
2861
2861
|
}, {
|
|
2862
|
-
default: P(() => [y.value ? (
|
|
2862
|
+
default: P(() => [y.value ? (M(), H(ae, {
|
|
2863
2863
|
key: 0,
|
|
2864
2864
|
disabled: !m.value.category,
|
|
2865
2865
|
"model-value": V.value,
|
|
2866
|
-
"onUpdate:modelValue":
|
|
2866
|
+
"onUpdate:modelValue": $[6] || ($[6] = (oe) => E(oe))
|
|
2867
2867
|
}, {
|
|
2868
|
-
default: P(() => [D("div", Ba, [D("div", La, [g(
|
|
2868
|
+
default: P(() => [D("div", Ba, [D("div", La, [g(j, {
|
|
2869
2869
|
disabled: b.value || !m.value.category,
|
|
2870
2870
|
value: Je.PRODUCT,
|
|
2871
|
-
label: h(
|
|
2872
|
-
sublabel: h(
|
|
2871
|
+
label: h(F)("menu.product.form.detail.category.options.product.label"),
|
|
2872
|
+
sublabel: h(F)("menu.product.form.detail.category.options.product.sublabel")
|
|
2873
2873
|
}, null, 8, ["disabled", "value", "label", "sublabel"]), g(Oo, null, {
|
|
2874
|
-
default: P(() => [h(n).isV4 ? (
|
|
2874
|
+
default: P(() => [h(n).isV4 ? (M(), H(N, {
|
|
2875
2875
|
key: 0
|
|
2876
2876
|
})) : ie("", !0)]),
|
|
2877
2877
|
_: 1
|
|
2878
|
-
})]), b.value ? (
|
|
2879
|
-
title: h(
|
|
2878
|
+
})]), b.value ? (M(), ne("div", Ga, [g(q, {
|
|
2879
|
+
title: h(F)("menu.product.form.detail.category.add_first"),
|
|
2880
2880
|
variant: "info"
|
|
2881
|
-
}, null, 8, ["title"]), g(
|
|
2882
|
-
label: h(
|
|
2881
|
+
}, null, 8, ["title"]), g(Z, {
|
|
2882
|
+
label: h(F)("menu.common.actions.add"),
|
|
2883
2883
|
"prepend-icon": "add",
|
|
2884
2884
|
variant: "secondary",
|
|
2885
2885
|
onClick: h(u).create
|
|
2886
|
-
}, null, 8, ["label", "onClick"])])) : ie("", !0), g(
|
|
2886
|
+
}, null, 8, ["label", "onClick"])])) : ie("", !0), g(j, {
|
|
2887
2887
|
value: Je.ADD_ON,
|
|
2888
|
-
label: h(
|
|
2889
|
-
sublabel: h(
|
|
2888
|
+
label: h(F)("menu.product.form.detail.category.options.addon.label"),
|
|
2889
|
+
sublabel: h(F)("menu.product.form.detail.category.options.addon.sublabel")
|
|
2890
2890
|
}, null, 8, ["value", "label", "sublabel"])])]),
|
|
2891
2891
|
_: 1
|
|
2892
|
-
}, 8, ["disabled", "model-value"])) : ie("", !0), h(n).isV4 ? ie("", !0) : (
|
|
2892
|
+
}, 8, ["disabled", "model-value"])) : ie("", !0), h(n).isV4 ? ie("", !0) : (M(), H(Q, {
|
|
2893
2893
|
key: 1,
|
|
2894
|
-
"model-value":
|
|
2895
|
-
rules: [(oe) => !oe && !
|
|
2896
|
-
"onUpdate:modelValue":
|
|
2894
|
+
"model-value": T.form.category,
|
|
2895
|
+
rules: [(oe) => !oe && !T.isOverride ? "Category is required" : !0],
|
|
2896
|
+
"onUpdate:modelValue": $[7] || ($[7] = (oe) => c("update:form", "category", oe))
|
|
2897
2897
|
}, {
|
|
2898
|
-
default: P(() => [g(
|
|
2898
|
+
default: P(() => [g(N, {
|
|
2899
2899
|
multiple: !1
|
|
2900
2900
|
})]),
|
|
2901
2901
|
_: 1
|
|
2902
2902
|
}, 8, ["model-value", "rules"]))]),
|
|
2903
2903
|
_: 1
|
|
2904
|
-
}, 8, ["label"]), h(n).isV4 && !
|
|
2904
|
+
}, 8, ["label"]), h(n).isV4 && !T.isAddon ? (M(), H(Ye, {
|
|
2905
2905
|
key: 0,
|
|
2906
|
-
label: h(
|
|
2906
|
+
label: h(F)("menu.product.form.detail.path.label")
|
|
2907
2907
|
}, {
|
|
2908
2908
|
default: P(() => [D("div", ja, [g(Ia, {
|
|
2909
|
-
modelValue:
|
|
2910
|
-
"onUpdate:modelValue":
|
|
2911
|
-
items:
|
|
2912
|
-
placeholder: h(
|
|
2909
|
+
modelValue: I.value,
|
|
2910
|
+
"onUpdate:modelValue": $[8] || ($[8] = (oe) => I.value = oe),
|
|
2911
|
+
items: w.value,
|
|
2912
|
+
placeholder: h(F)("menu.product.form.detail.path.placeholder"),
|
|
2913
2913
|
disabled: !m.value.category,
|
|
2914
2914
|
"is-local-only": !1
|
|
2915
2915
|
}, null, 8, ["modelValue", "items", "placeholder", "disabled"])])]),
|
|
2916
2916
|
_: 1
|
|
2917
2917
|
}, 8, ["label"])) : ie("", !0), D("div", Ka, [g(re, {
|
|
2918
2918
|
label: "Shelf Life (mins)",
|
|
2919
|
-
"model-value":
|
|
2920
|
-
rules: [(oe) => oe == null || oe > 0 || h(
|
|
2919
|
+
"model-value": T.form.shelfLife ?? null,
|
|
2920
|
+
rules: [(oe) => oe == null || oe > 0 || h(F)("menu.common.validation.min_value", {
|
|
2921
2921
|
value: 1
|
|
2922
2922
|
})],
|
|
2923
|
-
"onUpdate:modelValue":
|
|
2923
|
+
"onUpdate:modelValue": $[9] || ($[9] = (oe) => {
|
|
2924
2924
|
(oe == null || oe > 0) && c("update:form", "shelfLife", oe);
|
|
2925
2925
|
})
|
|
2926
2926
|
}, null, 8, ["model-value", "rules"]), g(re, {
|
|
2927
|
-
label: h(
|
|
2928
|
-
"model-value":
|
|
2927
|
+
label: h(F)("menu.product.form.detail.fields.minimum_order_quantity.label"),
|
|
2928
|
+
"model-value": L.value,
|
|
2929
2929
|
min: 0,
|
|
2930
2930
|
step: 1,
|
|
2931
2931
|
"onUpdate:modelValue": x
|
|
2932
2932
|
}, null, 8, ["label", "model-value"])]), g(ii, {
|
|
2933
2933
|
disabled: !m.value.orderFrom,
|
|
2934
|
-
"model-value":
|
|
2934
|
+
"model-value": T.form.orderFrom,
|
|
2935
2935
|
"order-from-none": m.value.orderFromNone,
|
|
2936
2936
|
required: m.value.orderFrom,
|
|
2937
|
-
"default-label": h(
|
|
2938
|
-
label: h(
|
|
2939
|
-
"onUpdate:modelValue":
|
|
2937
|
+
"default-label": h(F)("menu.product.form.detail.order_from.default"),
|
|
2938
|
+
label: h(F)("menu.product.form.detail.order_from.label"),
|
|
2939
|
+
"onUpdate:modelValue": $[10] || ($[10] = (oe) => oe && c("update:form", "orderFrom", oe))
|
|
2940
2940
|
}, null, 8, ["disabled", "model-value", "order-from-none", "required", "default-label", "label"])];
|
|
2941
2941
|
}),
|
|
2942
2942
|
_: 1
|
|
@@ -2945,7 +2945,7 @@ const Wa = /* @__PURE__ */ de({
|
|
|
2945
2945
|
}
|
|
2946
2946
|
}), Ya = /* @__PURE__ */ it(Wa, [["__scopeId", "data-v-0e4f5a8a"]]), Ha = {}, Xa = { class: "overflow-x-auto" }, qa = { class: "xs:w-[600px]" };
|
|
2947
2947
|
function Za(e, i) {
|
|
2948
|
-
return
|
|
2948
|
+
return M(), ne("div", Xa, [
|
|
2949
2949
|
D("div", qa, [
|
|
2950
2950
|
fe(e.$slots, "default")
|
|
2951
2951
|
])
|
|
@@ -2954,7 +2954,7 @@ function Za(e, i) {
|
|
|
2954
2954
|
const dn = /* @__PURE__ */ it(Ha, [["render", Za]]), Qa = /* @__PURE__ */ de({
|
|
2955
2955
|
__name: "AddForm",
|
|
2956
2956
|
setup(e) {
|
|
2957
|
-
const i = ye(), t =
|
|
2957
|
+
const i = ye(), t = O(() => i.rules.group), n = O(() => !!i.state.currentCatalogId || !!i.state.currentSchedulerId), a = O(() => {
|
|
2958
2958
|
const s = !i.state.currentSchedulerId, u = i.rules.group.type, d = i.version === Y.F_MENU_VERSION.enum.v3, c = i.rules.item.orderFromActiveOnly, m = i.rules.item.bindToVariant;
|
|
2959
2959
|
return function(v) {
|
|
2960
2960
|
return {
|
|
@@ -2982,7 +2982,7 @@ const dn = /* @__PURE__ */ it(Ha, [["render", Za]]), Qa = /* @__PURE__ */ de({
|
|
|
2982
2982
|
position: i.groups.length - 1,
|
|
2983
2983
|
itemsLinked: []
|
|
2984
2984
|
}), r = te(o()), { t: l } = pe();
|
|
2985
|
-
return (s, u) => t.value.create ? (
|
|
2985
|
+
return (s, u) => t.value.create ? (M(), H(h(xr), {
|
|
2986
2986
|
key: 0,
|
|
2987
2987
|
"categorized-items": h(i).categorizedItems,
|
|
2988
2988
|
config: a.value,
|
|
@@ -3002,7 +3002,7 @@ const dn = /* @__PURE__ */ it(Ha, [["render", Za]]), Qa = /* @__PURE__ */ de({
|
|
|
3002
3002
|
}
|
|
3003
3003
|
}), Ja = {}, er = { class: "flex gap-16" };
|
|
3004
3004
|
function tr(e, i) {
|
|
3005
|
-
return
|
|
3005
|
+
return M(), ne("div", er, [
|
|
3006
3006
|
fe(e.$slots, "default")
|
|
3007
3007
|
]);
|
|
3008
3008
|
}
|
|
@@ -3039,8 +3039,8 @@ const ir = /* @__PURE__ */ it(Ja, [["render", tr]]), nr = { class: "fm-typo-en-t
|
|
|
3039
3039
|
), i({ getKey: () => n.bindingKey, trigger: o });
|
|
3040
3040
|
const { t: c } = pe(), m = Ni();
|
|
3041
3041
|
return (p, v) => {
|
|
3042
|
-
const y =
|
|
3043
|
-
return
|
|
3042
|
+
const y = B("fm-text-field"), b = B("fm-card"), _ = B("fm-button"), f = B("fm-side-sheet");
|
|
3043
|
+
return M(), ne(Me, null, [
|
|
3044
3044
|
fe(p.$slots, "default", { trigger: o }),
|
|
3045
3045
|
g(f, {
|
|
3046
3046
|
id: "inventory-form",
|
|
@@ -3186,8 +3186,8 @@ const mn = /* @__PURE__ */ de({
|
|
|
3186
3186
|
enableSorting: !1
|
|
3187
3187
|
}];
|
|
3188
3188
|
return (r, l) => {
|
|
3189
|
-
const s =
|
|
3190
|
-
return
|
|
3189
|
+
const s = B("FmTable");
|
|
3190
|
+
return M(), ne("div", null, [g(s, {
|
|
3191
3191
|
"column-defs": o,
|
|
3192
3192
|
"row-data": r.priceTiers,
|
|
3193
3193
|
"page-size": r.priceTiers.length,
|
|
@@ -3206,7 +3206,7 @@ const mn = /* @__PURE__ */ de({
|
|
|
3206
3206
|
setup(e, { emit: i }) {
|
|
3207
3207
|
const { t } = pe(), n = i, a = te(!0), o = () => {
|
|
3208
3208
|
a.value = !1, n("update:show", !1);
|
|
3209
|
-
}, r =
|
|
3209
|
+
}, r = O(() => t("menu.price_tier.price_tier_config")), l = O(() => t("common.update")), s = e, u = Bi(s.menuStore), d = te(s.initialValue ? Qn(s.initialValue) : {}), c = Xt(
|
|
3210
3210
|
() => !Ve.isEqual(s.initialValue || {}, d.value),
|
|
3211
3211
|
() => {
|
|
3212
3212
|
o();
|
|
@@ -3216,8 +3216,8 @@ const mn = /* @__PURE__ */ de({
|
|
|
3216
3216
|
n("submit", d.value), o();
|
|
3217
3217
|
}
|
|
3218
3218
|
return (p, v) => {
|
|
3219
|
-
const y =
|
|
3220
|
-
return
|
|
3219
|
+
const y = B("FmButton"), b = B("fm-button"), _ = B("FmSideSheet");
|
|
3220
|
+
return M(), H(_, {
|
|
3221
3221
|
id: "business-form",
|
|
3222
3222
|
modelValue: a.value,
|
|
3223
3223
|
"onUpdate:modelValue": v[1] || (v[1] = (f) => a.value = f),
|
|
@@ -3289,7 +3289,7 @@ const mn = /* @__PURE__ */ de({
|
|
|
3289
3289
|
},
|
|
3290
3290
|
emits: ["update:priceTiers"],
|
|
3291
3291
|
setup(e, { emit: i }) {
|
|
3292
|
-
const t = e, n = i, a =
|
|
3292
|
+
const t = e, n = i, a = O(() => Object.keys(t.priceTiers || {}).length > 0 ? "filled" : "outline"), o = sr();
|
|
3293
3293
|
function r() {
|
|
3294
3294
|
o.open({
|
|
3295
3295
|
component: dr,
|
|
@@ -3304,8 +3304,8 @@ const mn = /* @__PURE__ */ de({
|
|
|
3304
3304
|
}
|
|
3305
3305
|
const { t: l } = pe();
|
|
3306
3306
|
return (s, u) => {
|
|
3307
|
-
const d =
|
|
3308
|
-
return s.$slots.default ? fe(s.$slots, "default", { key: 0 }) : (
|
|
3307
|
+
const d = B("FmButton"), c = B("FmTooltip");
|
|
3308
|
+
return s.$slots.default ? fe(s.$slots, "default", { key: 0 }) : (M(), H(c, {
|
|
3309
3309
|
key: 1,
|
|
3310
3310
|
content: h(l)("menu.price_tier.price_tier_config"),
|
|
3311
3311
|
"z-index": 999,
|
|
@@ -3347,17 +3347,17 @@ const mn = /* @__PURE__ */ de({
|
|
|
3347
3347
|
setup(e, {
|
|
3348
3348
|
emit: i
|
|
3349
3349
|
}) {
|
|
3350
|
-
const t = e, n = i, a = pt(), o = ye(), r =
|
|
3350
|
+
const t = e, n = i, a = pt(), o = ye(), r = O(() => xe.Country.getCountry(a.currentCountry.value)), l = te(!1), s = O(() => t.config.isV4 || t.group.type === Y.F_ADDON_GROUP_TYPE.enum.PRODUCT), u = O(() => s.value), d = O(() => s.value), c = O(() => Object.values(t.group.items).flatMap((A) => [{
|
|
3351
3351
|
_id: A._id,
|
|
3352
3352
|
combinationKey: void 0
|
|
3353
|
-
}, ...(A.items ?? []).filter((
|
|
3354
|
-
_id:
|
|
3355
|
-
combinationKey:
|
|
3353
|
+
}, ...(A.items ?? []).filter((z) => z.orderFrom !== Y.F_ORDER_FROM.enum.NONE).map((z) => ({
|
|
3354
|
+
_id: z._id,
|
|
3355
|
+
combinationKey: z.combinationKey
|
|
3356
3356
|
}))])), {
|
|
3357
3357
|
searchKey: m,
|
|
3358
3358
|
filter: p
|
|
3359
|
-
} = Jn(), v =
|
|
3360
|
-
const A = Object.entries(t.group.items).filter(([,
|
|
3359
|
+
} = Jn(), v = O(() => {
|
|
3360
|
+
const A = Object.entries(t.group.items).filter(([, z]) => p([z.code || "", z.name || z.fallbackName, _(z.price ?? z.fallbackPrice), f(z.orderFrom || z.fallbackOrder), ...(z.items || []).map((j) => [j.code || "", j.name || j.fallbackName, _(j.price ?? j.fallbackPrice), f(j.orderFrom || j.fallbackOrder)].join(""))]));
|
|
3361
3361
|
return Object.fromEntries(A);
|
|
3362
3362
|
}), y = (A) => ({
|
|
3363
3363
|
...t.config,
|
|
@@ -3365,73 +3365,73 @@ const mn = /* @__PURE__ */ de({
|
|
|
3365
3365
|
link: t.config.link(A),
|
|
3366
3366
|
name: t.config.name(A),
|
|
3367
3367
|
orderFrom: t.config.orderFrom(A)
|
|
3368
|
-
}), b =
|
|
3369
|
-
var
|
|
3370
|
-
return A == null ? "" : (
|
|
3371
|
-
}, C =
|
|
3372
|
-
t:
|
|
3368
|
+
}), b = O(() => !0), _ = (A) => A ? at(A, !1) : "", f = (A) => {
|
|
3369
|
+
var z;
|
|
3370
|
+
return A == null ? "" : (z = Fn()[A]) == null ? void 0 : z.label;
|
|
3371
|
+
}, C = O(() => Object.values(v.value)), G = te({}), {
|
|
3372
|
+
t: N
|
|
3373
3373
|
} = pe(), W = te([{
|
|
3374
3374
|
accessorKey: "isDefault",
|
|
3375
|
-
header: () =>
|
|
3375
|
+
header: () => N("menu.group.option.is_default"),
|
|
3376
3376
|
enableSorting: !1,
|
|
3377
3377
|
size: 75,
|
|
3378
3378
|
cell: (A) => {
|
|
3379
|
-
var ae,
|
|
3380
|
-
if ((
|
|
3379
|
+
var ae, Q;
|
|
3380
|
+
if ((Q = (ae = A.row.original) == null ? void 0 : ae.items) != null && Q.length)
|
|
3381
3381
|
return null;
|
|
3382
|
-
const
|
|
3382
|
+
const z = A.row.depth > 0, j = A.row.original, q = !y(j.combinationKey).isDefault || j.orderFrom === Y.F_ORDER_FROM.enum.NONE, Z = !!A.getValue();
|
|
3383
3383
|
return g(Ae.FmCheckbox, {
|
|
3384
3384
|
value: "default",
|
|
3385
|
-
modelValue:
|
|
3386
|
-
disabled:
|
|
3385
|
+
modelValue: Z,
|
|
3386
|
+
disabled: q,
|
|
3387
3387
|
"onUpdate:modelValue": (re) => {
|
|
3388
3388
|
var ve;
|
|
3389
|
-
if (
|
|
3389
|
+
if (z) {
|
|
3390
3390
|
const ke = (ve = A.row.getParentRow()) == null ? void 0 : ve.original;
|
|
3391
3391
|
if (!ke) return;
|
|
3392
|
-
|
|
3392
|
+
U(ke._id, j.combinationKey ?? "", "isDefault", re);
|
|
3393
3393
|
} else
|
|
3394
|
-
|
|
3394
|
+
E(j._id, "isDefault", re);
|
|
3395
3395
|
}
|
|
3396
3396
|
}, null);
|
|
3397
3397
|
}
|
|
3398
3398
|
}, {
|
|
3399
3399
|
accessorKey: "code",
|
|
3400
|
-
header: () =>
|
|
3400
|
+
header: () => N("menu.group.option.code"),
|
|
3401
3401
|
enableSorting: !1,
|
|
3402
3402
|
size: 100,
|
|
3403
3403
|
cell: (A) => {
|
|
3404
|
-
const
|
|
3404
|
+
const z = A.getValue();
|
|
3405
3405
|
return g(Ae.FmTooltip, {
|
|
3406
3406
|
class: "flex",
|
|
3407
|
-
content:
|
|
3407
|
+
content: z,
|
|
3408
3408
|
zIndex: 110
|
|
3409
3409
|
}, {
|
|
3410
3410
|
default: () => [g("div", {
|
|
3411
3411
|
class: "break-all max-w-[100px]"
|
|
3412
|
-
}, [
|
|
3412
|
+
}, [z])]
|
|
3413
3413
|
});
|
|
3414
3414
|
}
|
|
3415
3415
|
}, {
|
|
3416
3416
|
accessorKey: "name",
|
|
3417
|
-
header: () =>
|
|
3417
|
+
header: () => N("menu.group.option.product_title"),
|
|
3418
3418
|
enableSorting: !1,
|
|
3419
3419
|
cell: (A) => {
|
|
3420
|
-
var
|
|
3421
|
-
const
|
|
3420
|
+
var Q;
|
|
3421
|
+
const z = A.getValue(), j = A.row.original, q = !y(j.combinationKey).name || j.orderFrom === Y.F_ORDER_FROM.enum.NONE, Z = A.row.depth > 0, ae = j.combinationKey ? Ui(j.combinationKey, ye().variants) : (Q = w.value[j._id]) == null ? void 0 : Q.name;
|
|
3422
3422
|
return Se("div", Se(Ae.FmTextField, {
|
|
3423
|
-
modelValue:
|
|
3423
|
+
modelValue: z,
|
|
3424
3424
|
placeholder: ae ?? "",
|
|
3425
|
-
disabled:
|
|
3426
|
-
rules: ae ? void 0 : [(re) => ((re == null ? void 0 : re.length) ?? 0) > 0 ||
|
|
3425
|
+
disabled: q,
|
|
3426
|
+
rules: ae ? void 0 : [(re) => ((re == null ? void 0 : re.length) ?? 0) > 0 || N("menu.group.option.product_title_required")],
|
|
3427
3427
|
"onUpdate:modelValue": (re) => {
|
|
3428
3428
|
var ve;
|
|
3429
|
-
if (
|
|
3429
|
+
if (Z) {
|
|
3430
3430
|
const ke = (ve = A.row.getParentRow()) == null ? void 0 : ve.original;
|
|
3431
3431
|
if (!ke) return;
|
|
3432
|
-
|
|
3432
|
+
U(ke._id, j.combinationKey ?? "", "name", re || null);
|
|
3433
3433
|
} else
|
|
3434
|
-
|
|
3434
|
+
E(j._id, "name", re || null);
|
|
3435
3435
|
},
|
|
3436
3436
|
class: "min-w-[300px]"
|
|
3437
3437
|
}, {
|
|
@@ -3441,7 +3441,7 @@ const mn = /* @__PURE__ */ de({
|
|
|
3441
3441
|
name: "keyboard_arrow_up",
|
|
3442
3442
|
onClick: A.row.getToggleExpandedHandler(),
|
|
3443
3443
|
class: ["cursor-pointer", "transition-transform", A.row.getIsExpanded() ? "transform rotate-180" : ""],
|
|
3444
|
-
color: y(
|
|
3444
|
+
color: y(j.combinationKey).name ? void 0 : je.NeutralGray200
|
|
3445
3445
|
}) : void 0;
|
|
3446
3446
|
}
|
|
3447
3447
|
}));
|
|
@@ -3451,34 +3451,34 @@ const mn = /* @__PURE__ */ de({
|
|
|
3451
3451
|
enableSorting: !1,
|
|
3452
3452
|
header: () => {
|
|
3453
3453
|
var A;
|
|
3454
|
-
return
|
|
3454
|
+
return N("menu.group.option.price", {
|
|
3455
3455
|
symbol: (A = r.value) == null ? void 0 : A.currency.symbol
|
|
3456
3456
|
});
|
|
3457
3457
|
},
|
|
3458
3458
|
size: 100,
|
|
3459
3459
|
cell: (A) => {
|
|
3460
|
-
const
|
|
3460
|
+
const z = A.getValue(), j = A.row.original, q = !y(null).priceEdit || j.orderFrom === Y.F_ORDER_FROM.enum.NONE, Z = j.fallbackPrice, ae = A.row.depth > 0;
|
|
3461
3461
|
return Se(et, {
|
|
3462
|
-
disable:
|
|
3463
|
-
placeholder:
|
|
3464
|
-
modelValue:
|
|
3465
|
-
required: !
|
|
3466
|
-
nullable: !!
|
|
3462
|
+
disable: q,
|
|
3463
|
+
placeholder: Z ? at(Z) : void 0,
|
|
3464
|
+
modelValue: z,
|
|
3465
|
+
required: !Z && !q,
|
|
3466
|
+
nullable: !!Z,
|
|
3467
3467
|
min: b.value ? void 0 : 0,
|
|
3468
|
-
"onUpdate:modelValue": (
|
|
3468
|
+
"onUpdate:modelValue": (Q) => {
|
|
3469
3469
|
var re;
|
|
3470
3470
|
if (ae) {
|
|
3471
3471
|
const ve = (re = A.row.getParentRow()) == null ? void 0 : re.original;
|
|
3472
3472
|
if (!ve) return;
|
|
3473
|
-
|
|
3473
|
+
U(
|
|
3474
3474
|
ve._id,
|
|
3475
|
-
|
|
3475
|
+
j.combinationKey ?? "",
|
|
3476
3476
|
// @ts-ignore
|
|
3477
3477
|
"price",
|
|
3478
|
-
|
|
3478
|
+
Q
|
|
3479
3479
|
);
|
|
3480
3480
|
} else
|
|
3481
|
-
|
|
3481
|
+
E(j._id, "price", Q);
|
|
3482
3482
|
},
|
|
3483
3483
|
showCurrency: !1,
|
|
3484
3484
|
class: "min-w-[88px]"
|
|
@@ -3486,31 +3486,31 @@ const mn = /* @__PURE__ */ de({
|
|
|
3486
3486
|
}
|
|
3487
3487
|
}, {
|
|
3488
3488
|
accessorKey: "orderFrom",
|
|
3489
|
-
header: () =>
|
|
3489
|
+
header: () => N("menu.common.labels.order_from"),
|
|
3490
3490
|
size: 100,
|
|
3491
3491
|
enableSorting: !1,
|
|
3492
3492
|
cell: (A) => {
|
|
3493
|
-
const
|
|
3493
|
+
const z = A.getValue(), j = A.row.original, q = j.fallbackOrder, Z = A.row.depth > 0;
|
|
3494
3494
|
return Se(ii, {
|
|
3495
|
-
modelValue:
|
|
3496
|
-
fallback:
|
|
3497
|
-
disable: !y(
|
|
3495
|
+
modelValue: z,
|
|
3496
|
+
fallback: q,
|
|
3497
|
+
disable: !y(j.combinationKey).orderFrom,
|
|
3498
3498
|
required: !0,
|
|
3499
|
-
editActiveOnly: y(
|
|
3499
|
+
editActiveOnly: y(j.combinationKey).orderFromActiveOnly,
|
|
3500
3500
|
"onUpdate:modelValue": (ae) => {
|
|
3501
|
-
var
|
|
3502
|
-
if (
|
|
3503
|
-
const re = (
|
|
3501
|
+
var Q;
|
|
3502
|
+
if (Z) {
|
|
3503
|
+
const re = (Q = A.row.getParentRow()) == null ? void 0 : Q.original;
|
|
3504
3504
|
if (!re) return;
|
|
3505
|
-
|
|
3505
|
+
U(
|
|
3506
3506
|
re._id,
|
|
3507
|
-
|
|
3507
|
+
j.combinationKey ?? "",
|
|
3508
3508
|
// @ts-ignore
|
|
3509
3509
|
"orderFrom",
|
|
3510
3510
|
ae
|
|
3511
3511
|
);
|
|
3512
3512
|
} else
|
|
3513
|
-
|
|
3513
|
+
E(j._id, "orderFrom", ae);
|
|
3514
3514
|
},
|
|
3515
3515
|
label: "",
|
|
3516
3516
|
menuZIndex: 101
|
|
@@ -3525,77 +3525,77 @@ const mn = /* @__PURE__ */ de({
|
|
|
3525
3525
|
// size: rules.value.inventory && rules.value.link ? 80 : 40,
|
|
3526
3526
|
size: 80,
|
|
3527
3527
|
cell: (A) => {
|
|
3528
|
-
const
|
|
3528
|
+
const z = A.row.original, j = z.orderFrom === Y.F_ORDER_FROM.enum.NONE, q = A.row.depth > 0;
|
|
3529
3529
|
return g("div", {
|
|
3530
3530
|
class: "flex items-center justify-end"
|
|
3531
3531
|
}, [y(null).priceTier && g(pn, {
|
|
3532
|
-
priceTiers:
|
|
3533
|
-
disabled:
|
|
3534
|
-
"onUpdate:priceTiers": (
|
|
3532
|
+
priceTiers: z.priceTiers,
|
|
3533
|
+
disabled: j,
|
|
3534
|
+
"onUpdate:priceTiers": (Z) => {
|
|
3535
3535
|
var ae;
|
|
3536
|
-
if (
|
|
3537
|
-
const
|
|
3538
|
-
if (!
|
|
3539
|
-
|
|
3540
|
-
|
|
3541
|
-
|
|
3536
|
+
if (q) {
|
|
3537
|
+
const Q = (ae = A.row.getParentRow()) == null ? void 0 : ae.original;
|
|
3538
|
+
if (!Q) return;
|
|
3539
|
+
U(
|
|
3540
|
+
Q._id,
|
|
3541
|
+
z.combinationKey ?? "",
|
|
3542
3542
|
// @ts-ignore
|
|
3543
3543
|
"priceTiers",
|
|
3544
|
-
|
|
3544
|
+
Z
|
|
3545
3545
|
);
|
|
3546
3546
|
} else
|
|
3547
|
-
|
|
3547
|
+
E(z._id, "priceTiers", Z);
|
|
3548
3548
|
}
|
|
3549
|
-
}, null), y(
|
|
3549
|
+
}, null), y(z.combinationKey).inventory && g(Yt, {
|
|
3550
3550
|
title: "Inventory",
|
|
3551
|
-
initialValue:
|
|
3552
|
-
name:
|
|
3551
|
+
initialValue: z.inventoryBindings ?? [],
|
|
3552
|
+
name: z.name ?? z.fallbackName ?? "",
|
|
3553
3553
|
allowRefund: t.allowRefundInventory,
|
|
3554
|
-
"onUpdate:inventory": (
|
|
3554
|
+
"onUpdate:inventory": (Z) => {
|
|
3555
3555
|
var ae;
|
|
3556
|
-
if (
|
|
3557
|
-
const
|
|
3558
|
-
if (!
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3556
|
+
if (q) {
|
|
3557
|
+
const Q = (ae = A.row.getParentRow()) == null ? void 0 : ae.original;
|
|
3558
|
+
if (!Q) return;
|
|
3559
|
+
U(
|
|
3560
|
+
Q._id,
|
|
3561
|
+
z.combinationKey ?? "",
|
|
3562
3562
|
// @ts-ignore
|
|
3563
3563
|
"inventoryBindings",
|
|
3564
|
-
|
|
3564
|
+
Z
|
|
3565
3565
|
);
|
|
3566
3566
|
} else
|
|
3567
|
-
|
|
3567
|
+
E(z._id, "inventoryBindings", Z);
|
|
3568
3568
|
}
|
|
3569
3569
|
}, {
|
|
3570
3570
|
default: ({
|
|
3571
|
-
trigger:
|
|
3572
|
-
}) => g(
|
|
3571
|
+
trigger: Z
|
|
3572
|
+
}) => g(B("fm-tooltip"), {
|
|
3573
3573
|
content: "Inventory",
|
|
3574
3574
|
zIndex: 110
|
|
3575
3575
|
}, {
|
|
3576
3576
|
default: () => {
|
|
3577
3577
|
var ae;
|
|
3578
|
-
return [g(
|
|
3578
|
+
return [g(B("fm-button"), {
|
|
3579
3579
|
variant: Ze.Tertiary,
|
|
3580
|
-
disabled:
|
|
3580
|
+
disabled: j,
|
|
3581
3581
|
prependIcon: "inventory_2",
|
|
3582
|
-
overwriteIconOutline: (ae =
|
|
3582
|
+
overwriteIconOutline: (ae = z.inventoryBindings) != null && ae.length ? "filled" : "outline",
|
|
3583
3583
|
textColor: je.NeutralGray400,
|
|
3584
|
-
onClick:
|
|
3584
|
+
onClick: Z
|
|
3585
3585
|
}, null)];
|
|
3586
3586
|
}
|
|
3587
3587
|
})
|
|
3588
|
-
}), y(
|
|
3588
|
+
}), y(z.combinationKey).link && g(B("fm-button"), {
|
|
3589
3589
|
variant: Ze.Tertiary,
|
|
3590
3590
|
prependIcon: "delete",
|
|
3591
3591
|
textColor: je.NeutralGray400,
|
|
3592
|
-
disabled:
|
|
3592
|
+
disabled: q,
|
|
3593
3593
|
onClick: () => {
|
|
3594
|
-
|
|
3594
|
+
k(z._id);
|
|
3595
3595
|
}
|
|
3596
3596
|
}, null)]);
|
|
3597
3597
|
}
|
|
3598
|
-
}]), R =
|
|
3598
|
+
}]), R = O(() => ({
|
|
3599
3599
|
code: d.value,
|
|
3600
3600
|
name: !0,
|
|
3601
3601
|
price: y(null).price,
|
|
@@ -3620,129 +3620,129 @@ const mn = /* @__PURE__ */ de({
|
|
|
3620
3620
|
}
|
|
3621
3621
|
});
|
|
3622
3622
|
}
|
|
3623
|
-
function
|
|
3624
|
-
const
|
|
3625
|
-
if (!
|
|
3626
|
-
const
|
|
3627
|
-
...
|
|
3623
|
+
function E(A, z, j) {
|
|
3624
|
+
const q = t.group.items[A];
|
|
3625
|
+
if (!q) return;
|
|
3626
|
+
const Z = {
|
|
3627
|
+
...q
|
|
3628
3628
|
};
|
|
3629
|
-
|
|
3629
|
+
z === "price" ? Z[z] = !j && !q.fallbackPrice ? xe.Dinero.zero().toObject() : j : Z[z] = j, n("update:group", {
|
|
3630
3630
|
...t.group,
|
|
3631
3631
|
items: {
|
|
3632
3632
|
...t.group.items,
|
|
3633
|
-
[A]:
|
|
3633
|
+
[A]: Z
|
|
3634
3634
|
}
|
|
3635
3635
|
});
|
|
3636
3636
|
}
|
|
3637
|
-
function
|
|
3637
|
+
function U(A, z, j, q) {
|
|
3638
3638
|
var re, ve;
|
|
3639
|
-
const
|
|
3639
|
+
const Z = ue(t.group), ae = (re = Z.items[A].items) == null ? void 0 : re.findIndex((ke) => ke.combinationKey === z);
|
|
3640
3640
|
if (!ht.isSet(ae)) return;
|
|
3641
|
-
let
|
|
3642
|
-
|
|
3643
|
-
...
|
|
3644
|
-
[
|
|
3645
|
-
},
|
|
3641
|
+
let Q = (ve = Z.items[A].items) == null ? void 0 : ve[ae];
|
|
3642
|
+
Q && (Q = {
|
|
3643
|
+
...Q,
|
|
3644
|
+
[j]: q
|
|
3645
|
+
}, Z.items[A].items[ae] = Q, n("update:group", Z));
|
|
3646
3646
|
}
|
|
3647
|
-
function
|
|
3648
|
-
const
|
|
3649
|
-
delete
|
|
3647
|
+
function k(A) {
|
|
3648
|
+
const z = ue(t.group);
|
|
3649
|
+
delete z.items[A], n("update:group", z);
|
|
3650
3650
|
}
|
|
3651
|
-
const S =
|
|
3652
|
-
var
|
|
3653
|
-
return A[
|
|
3654
|
-
price:
|
|
3655
|
-
variants: zn(((
|
|
3651
|
+
const S = O(() => t.categorizedItems.flatMap((A) => A.items).reduce((A, z) => {
|
|
3652
|
+
var j;
|
|
3653
|
+
return A[z._id] = {
|
|
3654
|
+
price: z.price,
|
|
3655
|
+
variants: zn(((j = z.variant) == null ? void 0 : j.variantCombinations) || [], "combinationKey")
|
|
3656
3656
|
}, A;
|
|
3657
|
-
}, {})),
|
|
3658
|
-
function
|
|
3659
|
-
const
|
|
3660
|
-
return A.forEach((
|
|
3661
|
-
var
|
|
3662
|
-
if (
|
|
3657
|
+
}, {})), w = O(() => o.state.menu.modules.item.reduce((A, z) => (A[z._id] = z, A), {}));
|
|
3658
|
+
function I(A) {
|
|
3659
|
+
const z = [], j = new Set(A.filter((q) => q.combinationKey).map((q) => `${q._id}:${q.combinationKey}`));
|
|
3660
|
+
return A.forEach((q) => {
|
|
3661
|
+
var Q;
|
|
3662
|
+
if (q.combinationKey)
|
|
3663
3663
|
return;
|
|
3664
|
-
|
|
3665
|
-
const
|
|
3666
|
-
if (!
|
|
3664
|
+
z.push(q);
|
|
3665
|
+
const Z = w.value[q._id];
|
|
3666
|
+
if (!Z || !Z.variant || ((Q = Z.variant.variantCombinations) == null ? void 0 : Q.length) === 0)
|
|
3667
3667
|
return;
|
|
3668
|
-
(
|
|
3669
|
-
const ve = `${re._id}:${re.combinationKey}`, ke = !
|
|
3670
|
-
|
|
3668
|
+
(Z.variant.variantCombinations || []).forEach((re) => {
|
|
3669
|
+
const ve = `${re._id}:${re.combinationKey}`, ke = !j.has(ve);
|
|
3670
|
+
z.push({
|
|
3671
3671
|
_id: re._id,
|
|
3672
3672
|
combinationKey: re.combinationKey,
|
|
3673
3673
|
orderFrom: ke ? Y.F_ORDER_FROM.enum.NONE : Y.F_ORDER_FROM.enum.ALL
|
|
3674
3674
|
});
|
|
3675
3675
|
});
|
|
3676
|
-
}),
|
|
3676
|
+
}), z;
|
|
3677
3677
|
}
|
|
3678
|
-
const
|
|
3679
|
-
let
|
|
3680
|
-
const
|
|
3681
|
-
|
|
3682
|
-
...
|
|
3683
|
-
items:
|
|
3684
|
-
const
|
|
3685
|
-
|
|
3686
|
-
const ae = S.value[
|
|
3687
|
-
return
|
|
3688
|
-
...
|
|
3678
|
+
const L = async (A) => {
|
|
3679
|
+
let z = qt(t.group);
|
|
3680
|
+
const j = I(A);
|
|
3681
|
+
z = {
|
|
3682
|
+
...z,
|
|
3683
|
+
items: j.map((q) => {
|
|
3684
|
+
const Z = z.items.find((Q) => Q._id == q._id && Q.combinationKey == q.combinationKey);
|
|
3685
|
+
q.orderFrom && Z && (Z.orderFrom = q.orderFrom);
|
|
3686
|
+
const ae = S.value[q._id];
|
|
3687
|
+
return Z || {
|
|
3688
|
+
...q,
|
|
3689
3689
|
name: null,
|
|
3690
3690
|
// By default for linking products, setting null making the item name be determined by fallback name, which is the original item/variant name, and user can still edit the name if needed.
|
|
3691
|
-
price:
|
|
3692
|
-
orderFrom:
|
|
3691
|
+
price: q.combinationKey ? ae.variants[q.combinationKey || ""].price : ae.price,
|
|
3692
|
+
orderFrom: q.orderFrom ?? Y.F_ORDER_FROM.enum.ALL
|
|
3693
3693
|
};
|
|
3694
3694
|
})
|
|
3695
|
-
}, n("update:unmap-group",
|
|
3695
|
+
}, n("update:unmap-group", z);
|
|
3696
3696
|
}, x = (A) => A.items;
|
|
3697
|
-
function
|
|
3698
|
-
const
|
|
3699
|
-
|
|
3700
|
-
...
|
|
3701
|
-
[
|
|
3702
|
-
}), {}), n("update:group",
|
|
3697
|
+
function F(A) {
|
|
3698
|
+
const z = ue(t.group);
|
|
3699
|
+
z.items = A.reduce((j, q) => ({
|
|
3700
|
+
...j,
|
|
3701
|
+
[q._id]: q
|
|
3702
|
+
}), {}), n("update:group", z);
|
|
3703
3703
|
}
|
|
3704
|
-
const
|
|
3705
|
-
return (A,
|
|
3706
|
-
const
|
|
3707
|
-
return
|
|
3708
|
-
title: h(
|
|
3709
|
-
"sub-title": A.config.link() && u.value ? h(
|
|
3704
|
+
const T = Di(), $ = O(() => T.breakpoints.value.xs);
|
|
3705
|
+
return (A, z) => {
|
|
3706
|
+
const j = B("fm-button"), q = B("fm-table");
|
|
3707
|
+
return M(), H(Le, {
|
|
3708
|
+
title: h(N)("menu.group.option.title"),
|
|
3709
|
+
"sub-title": A.config.link() && u.value ? h(N)("menu.group.option.subtitle") : ""
|
|
3710
3710
|
}, {
|
|
3711
|
-
"append-title": P(() => [A.config.link() ? (
|
|
3711
|
+
"append-title": P(() => [A.config.link() ? (M(), ne(Me, {
|
|
3712
3712
|
key: 0
|
|
3713
|
-
}, [u.value ? (
|
|
3713
|
+
}, [u.value ? (M(), ne("div", mr, [g(Vn, {
|
|
3714
3714
|
"categorized-items": A.categorizedItems,
|
|
3715
3715
|
"initial-value": c.value,
|
|
3716
3716
|
"show-variant": A.config.bindToVariant,
|
|
3717
3717
|
"select-variant": "",
|
|
3718
|
-
title: h(
|
|
3719
|
-
onSubmit:
|
|
3720
|
-
items:
|
|
3721
|
-
}) =>
|
|
3718
|
+
title: h(N)("menu.group.option.link_products"),
|
|
3719
|
+
onSubmit: z[0] || (z[0] = ({
|
|
3720
|
+
items: Z
|
|
3721
|
+
}) => L(Z))
|
|
3722
3722
|
}, {
|
|
3723
3723
|
default: P(({
|
|
3724
|
-
trigger:
|
|
3725
|
-
}) => [g(
|
|
3724
|
+
trigger: Z
|
|
3725
|
+
}) => [g(j, {
|
|
3726
3726
|
"text-color": h(je).ColorPrimary,
|
|
3727
3727
|
"border-color": h(je).ColorPrimary,
|
|
3728
3728
|
variant: "secondary",
|
|
3729
|
-
label: h(
|
|
3729
|
+
label: h(N)("menu.group.option.link_products"),
|
|
3730
3730
|
"prepend-icon": "link",
|
|
3731
|
-
onClick:
|
|
3731
|
+
onClick: Z
|
|
3732
3732
|
}, null, 8, ["text-color", "border-color", "label", "onClick"])]),
|
|
3733
3733
|
_: 1
|
|
3734
|
-
}, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (
|
|
3734
|
+
}, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (M(), ne("div", pr, [g(j, {
|
|
3735
3735
|
"text-color": h(je).ColorPrimary,
|
|
3736
3736
|
"border-color": h(je).ColorPrimary,
|
|
3737
3737
|
variant: "secondary",
|
|
3738
|
-
label: h(
|
|
3738
|
+
label: h(N)("menu.group.option.add_option"),
|
|
3739
3739
|
"prepend-icon": "add",
|
|
3740
3740
|
onClick: V
|
|
3741
3741
|
}, null, 8, ["text-color", "border-color", "label"])]))], 64)) : ie("", !0)]),
|
|
3742
|
-
default: P(() => [D("div", hr, [D("div", fr, [g(
|
|
3742
|
+
default: P(() => [D("div", hr, [D("div", fr, [g(q, {
|
|
3743
3743
|
"column-defs": W.value,
|
|
3744
3744
|
"column-visibility": R.value,
|
|
3745
|
-
draggable:
|
|
3745
|
+
draggable: !$.value && y(null).name,
|
|
3746
3746
|
"expanded-state": l.value ? {} : G.value,
|
|
3747
3747
|
"get-sub-row": x,
|
|
3748
3748
|
"page-size": 999,
|
|
@@ -3750,9 +3750,9 @@ const mn = /* @__PURE__ */ de({
|
|
|
3750
3750
|
"search-value": h(m),
|
|
3751
3751
|
"shrink-at": !1,
|
|
3752
3752
|
"hide-footer": "",
|
|
3753
|
-
"onUpdate:expandedState":
|
|
3754
|
-
onDndChanged:
|
|
3755
|
-
"onUpdate:dragging":
|
|
3753
|
+
"onUpdate:expandedState": z[1] || (z[1] = (Z) => G.value = Z),
|
|
3754
|
+
onDndChanged: z[2] || (z[2] = (Z) => F(Z)),
|
|
3755
|
+
"onUpdate:dragging": z[3] || (z[3] = (Z) => l.value = Z)
|
|
3756
3756
|
}, null, 8, ["column-defs", "column-visibility", "draggable", "expanded-state", "row-data", "search-value"])])])]),
|
|
3757
3757
|
_: 1
|
|
3758
3758
|
}, 8, ["title", "sub-title"]);
|
|
@@ -3782,7 +3782,7 @@ function gr(e) {
|
|
|
3782
3782
|
function a(r) {
|
|
3783
3783
|
return t(r) <= r.max ? !0 : i("menu.common.validation.max_default_items", { max: r.max });
|
|
3784
3784
|
}
|
|
3785
|
-
const o =
|
|
3785
|
+
const o = O(() => [
|
|
3786
3786
|
// Check if min and max are integers
|
|
3787
3787
|
() => {
|
|
3788
3788
|
const r = e();
|
|
@@ -3838,7 +3838,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
3838
3838
|
() => n.group
|
|
3839
3839
|
), p = te(!1), v = te(!1), y = (x) => {
|
|
3840
3840
|
ht.isBoolean(x) ? v.value = x : v.value = !v.value;
|
|
3841
|
-
}, b =
|
|
3841
|
+
}, b = O(() => n.group ? n.config(n.group) : null), _ = O(() => Ki(b.value)), f = (x) => _.value.includes(x), C = O(() => [
|
|
3842
3842
|
{
|
|
3843
3843
|
label: "Normal",
|
|
3844
3844
|
value: Y.F_ADDON_GROUP_TYPE.enum.NORMAL
|
|
@@ -3855,8 +3855,8 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
3855
3855
|
function G(x) {
|
|
3856
3856
|
a("update:group", x);
|
|
3857
3857
|
}
|
|
3858
|
-
function
|
|
3859
|
-
function
|
|
3858
|
+
function N(x) {
|
|
3859
|
+
function F() {
|
|
3860
3860
|
G({
|
|
3861
3861
|
...n.group,
|
|
3862
3862
|
items: {},
|
|
@@ -3874,7 +3874,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
3874
3874
|
text: "No",
|
|
3875
3875
|
close: !0
|
|
3876
3876
|
}
|
|
3877
|
-
}).onPrimary(
|
|
3877
|
+
}).onPrimary(F) : F();
|
|
3878
3878
|
}
|
|
3879
3879
|
function W(x) {
|
|
3880
3880
|
return new ji(o, u.updateMenu, l).mapGroups(
|
|
@@ -3887,31 +3887,31 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
3887
3887
|
() => {
|
|
3888
3888
|
v.value = !1;
|
|
3889
3889
|
}
|
|
3890
|
-
),
|
|
3891
|
-
async function
|
|
3890
|
+
), E = O(() => n.action === "add" ? L("common.add") : L("common.update"));
|
|
3891
|
+
async function U() {
|
|
3892
3892
|
var x;
|
|
3893
3893
|
if (n.action === "add") {
|
|
3894
|
-
const { group:
|
|
3894
|
+
const { group: F, linkItems: T } = Gi(n.group), $ = {
|
|
3895
3895
|
module: Y.F_MENU_MODULE_V4_KEY.enum.group,
|
|
3896
3896
|
operation: Ce.F_OPERATION_TYPE.create,
|
|
3897
|
-
data:
|
|
3897
|
+
data: F,
|
|
3898
3898
|
link: [
|
|
3899
3899
|
{
|
|
3900
3900
|
module: Y.F_MENU_MODULE_V4_KEY.enum.item,
|
|
3901
3901
|
id: "",
|
|
3902
|
-
data:
|
|
3902
|
+
data: T
|
|
3903
3903
|
}
|
|
3904
3904
|
]
|
|
3905
3905
|
};
|
|
3906
|
-
await u.updateMenu(
|
|
3906
|
+
await u.updateMenu($, F.name), a("submit:group", n.group);
|
|
3907
3907
|
} else if (n.action === "update") {
|
|
3908
|
-
for (const
|
|
3909
|
-
if (Gn(o.state.menu, n.group._id,
|
|
3908
|
+
for (const F of Object.values(((x = n.group) == null ? void 0 : x.items) ?? {}))
|
|
3909
|
+
if (Gn(o.state.menu, n.group._id, F._id)) {
|
|
3910
3910
|
s.open({
|
|
3911
3911
|
type: "error",
|
|
3912
|
-
message:
|
|
3912
|
+
message: L("menu.product.form.group.circularError", {
|
|
3913
3913
|
groupName: n.group.name,
|
|
3914
|
-
productName:
|
|
3914
|
+
productName: F.name
|
|
3915
3915
|
})
|
|
3916
3916
|
});
|
|
3917
3917
|
return;
|
|
@@ -3926,43 +3926,43 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
3926
3926
|
a("status:show", x), x && (await Ei(), R.value = Ve.clone(n.group));
|
|
3927
3927
|
}
|
|
3928
3928
|
);
|
|
3929
|
-
const
|
|
3929
|
+
const k = O(() => {
|
|
3930
3930
|
var x;
|
|
3931
3931
|
return ((x = r.groupAttributeSettings) == null ? void 0 : x.value.length) > 0 && !b.value.isOverride;
|
|
3932
|
-
}), S =
|
|
3932
|
+
}), S = O(() => {
|
|
3933
3933
|
const x = {};
|
|
3934
|
-
return o.state.menu.modules.group.forEach((
|
|
3935
|
-
var
|
|
3936
|
-
for (const [
|
|
3937
|
-
typeof A == "string" && A && !((
|
|
3934
|
+
return o.state.menu.modules.group.forEach((F) => {
|
|
3935
|
+
var T;
|
|
3936
|
+
for (const [$, A] of Object.entries(F.customAttributes || {}))
|
|
3937
|
+
typeof A == "string" && A && !((T = x[$]) != null && T.includes(A)) && (x[$] = [...x[$] || [], A]);
|
|
3938
3938
|
}), x;
|
|
3939
|
-
}),
|
|
3939
|
+
}), w = (x) => {
|
|
3940
3940
|
n.group && G({
|
|
3941
3941
|
...n.group,
|
|
3942
3942
|
customAttributes: x
|
|
3943
3943
|
});
|
|
3944
|
-
},
|
|
3944
|
+
}, I = O(() => [
|
|
3945
3945
|
// Required validation
|
|
3946
|
-
(x) => !!x ||
|
|
3946
|
+
(x) => !!x || L("menu.common.validation.required", { field: L("menu.common.labels.group_name") }),
|
|
3947
3947
|
// Duplicate name validation
|
|
3948
|
-
(x) => n.action === "add" ? !o.groups.find((
|
|
3948
|
+
(x) => n.action === "add" ? !o.groups.find((T) => T.name === x) || L("menu.group.validation.name_duplicate") : n.action === "update" ? !o.groups.find((T) => T.name === x && T._id !== n.group._id) || L("menu.group.validation.name_duplicate") : !0
|
|
3949
3949
|
]);
|
|
3950
3950
|
i({
|
|
3951
3951
|
trigger: y,
|
|
3952
3952
|
show: v
|
|
3953
3953
|
});
|
|
3954
|
-
const { t:
|
|
3955
|
-
return (x,
|
|
3956
|
-
const
|
|
3957
|
-
return
|
|
3954
|
+
const { t: L } = pe();
|
|
3955
|
+
return (x, F) => {
|
|
3956
|
+
const T = B("fm-text-field"), $ = B("fm-stepper-field"), A = B("FmFormGroup"), z = B("fm-radio"), j = B("fm-radio-group"), q = B("fm-switch"), Z = B("fm-button"), ae = B("fm-side-sheet");
|
|
3957
|
+
return M(), ne(Me, null, [
|
|
3958
3958
|
fe(x.$slots, "default", { trigger: y }),
|
|
3959
3959
|
g(ae, {
|
|
3960
3960
|
id: "group-form",
|
|
3961
3961
|
modelValue: v.value,
|
|
3962
|
-
"onUpdate:modelValue":
|
|
3962
|
+
"onUpdate:modelValue": F[8] || (F[8] = (Q) => v.value = Q),
|
|
3963
3963
|
"is-container": h(Ae).FmForm,
|
|
3964
3964
|
"is-container-props": {
|
|
3965
|
-
onValidationSuccess:
|
|
3965
|
+
onValidationSuccess: U,
|
|
3966
3966
|
blameFormChildOnValidationFailed: !0
|
|
3967
3967
|
},
|
|
3968
3968
|
"max-width": 720,
|
|
@@ -3973,34 +3973,34 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
3973
3973
|
]),
|
|
3974
3974
|
"side-sheet-footer": P(() => [
|
|
3975
3975
|
D("div", _r, [
|
|
3976
|
-
g(
|
|
3977
|
-
label: h(eo)(
|
|
3976
|
+
g(Z, {
|
|
3977
|
+
label: h(eo)(E.value),
|
|
3978
3978
|
loading: p.value,
|
|
3979
3979
|
size: "lg",
|
|
3980
3980
|
type: "submit",
|
|
3981
3981
|
variant: "primary"
|
|
3982
3982
|
}, null, 8, ["label", "loading"]),
|
|
3983
|
-
g(
|
|
3984
|
-
label: h(
|
|
3983
|
+
g(Z, {
|
|
3984
|
+
label: h(L)("menu.common.actions.cancel"),
|
|
3985
3985
|
size: "lg",
|
|
3986
3986
|
variant: "tertiary",
|
|
3987
|
-
onClick:
|
|
3987
|
+
onClick: F[7] || (F[7] = () => v.value = !1)
|
|
3988
3988
|
}, null, 8, ["label"])
|
|
3989
3989
|
])
|
|
3990
3990
|
]),
|
|
3991
3991
|
default: P(() => [
|
|
3992
|
-
x.group ? (
|
|
3992
|
+
x.group ? (M(), ne("div", yr, [
|
|
3993
3993
|
fe(x.$slots, "variant-section"),
|
|
3994
3994
|
g($n, null, {
|
|
3995
3995
|
default: P(() => [
|
|
3996
3996
|
D("div", null, [
|
|
3997
|
-
g(
|
|
3997
|
+
g(T, {
|
|
3998
3998
|
modelValue: x.group.name,
|
|
3999
|
-
"onUpdate:modelValue":
|
|
3999
|
+
"onUpdate:modelValue": F[0] || (F[0] = (Q) => x.group.name = Q),
|
|
4000
4000
|
disabled: f("name"),
|
|
4001
|
-
rules:
|
|
4001
|
+
rules: I.value,
|
|
4002
4002
|
autofocus: "",
|
|
4003
|
-
label: h(
|
|
4003
|
+
label: h(L)("menu.common.labels.group_name")
|
|
4004
4004
|
}, null, 8, ["modelValue", "disabled", "rules", "label"])
|
|
4005
4005
|
]),
|
|
4006
4006
|
g(A, {
|
|
@@ -4010,21 +4010,21 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4010
4010
|
default: P(() => [
|
|
4011
4011
|
g(ir, null, {
|
|
4012
4012
|
default: P(() => [
|
|
4013
|
-
g(
|
|
4013
|
+
g($, {
|
|
4014
4014
|
modelValue: x.group.min,
|
|
4015
|
-
"onUpdate:modelValue":
|
|
4015
|
+
"onUpdate:modelValue": F[1] || (F[1] = (Q) => x.group.min = Q),
|
|
4016
4016
|
disabled: f("min"),
|
|
4017
4017
|
min: 0,
|
|
4018
4018
|
class: "flex-1",
|
|
4019
|
-
label: h(
|
|
4019
|
+
label: h(L)("menu.common.labels.min_select")
|
|
4020
4020
|
}, null, 8, ["modelValue", "disabled", "label"]),
|
|
4021
|
-
g(
|
|
4021
|
+
g($, {
|
|
4022
4022
|
modelValue: x.group.max,
|
|
4023
|
-
"onUpdate:modelValue":
|
|
4023
|
+
"onUpdate:modelValue": F[2] || (F[2] = (Q) => x.group.max = Q),
|
|
4024
4024
|
disabled: f("max"),
|
|
4025
4025
|
min: x.group.min,
|
|
4026
4026
|
class: "flex-1",
|
|
4027
|
-
label: h(
|
|
4027
|
+
label: h(L)("menu.common.labels.max_select")
|
|
4028
4028
|
}, null, 8, ["modelValue", "disabled", "min", "label"])
|
|
4029
4029
|
]),
|
|
4030
4030
|
_: 1
|
|
@@ -4032,21 +4032,21 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4032
4032
|
]),
|
|
4033
4033
|
_: 1
|
|
4034
4034
|
}, 8, ["model-value", "rules"]),
|
|
4035
|
-
b.value.type ? (
|
|
4035
|
+
b.value.type ? (M(), H(Ye, {
|
|
4036
4036
|
key: 0,
|
|
4037
|
-
label: h(
|
|
4037
|
+
label: h(L)("menu.common.labels.group_type")
|
|
4038
4038
|
}, {
|
|
4039
4039
|
default: P(() => [
|
|
4040
|
-
g(
|
|
4040
|
+
g(j, {
|
|
4041
4041
|
disabled: f("type"),
|
|
4042
4042
|
"model-value": x.group.type,
|
|
4043
|
-
"onUpdate:modelValue":
|
|
4043
|
+
"onUpdate:modelValue": F[3] || (F[3] = (Q) => N(Q))
|
|
4044
4044
|
}, {
|
|
4045
4045
|
default: P(() => [
|
|
4046
|
-
(
|
|
4047
|
-
key:
|
|
4048
|
-
label: h(
|
|
4049
|
-
value:
|
|
4046
|
+
(M(!0), ne(Me, null, Ue(C.value, (Q) => (M(), H(z, {
|
|
4047
|
+
key: Q.value,
|
|
4048
|
+
label: h(L)(`menu.group.types.${Q.label.toLowerCase()}`),
|
|
4049
|
+
value: Q.value
|
|
4050
4050
|
}, null, 8, ["label", "value"]))), 128))
|
|
4051
4051
|
]),
|
|
4052
4052
|
_: 1
|
|
@@ -4055,30 +4055,30 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4055
4055
|
_: 1
|
|
4056
4056
|
}, 8, ["label"])) : ie("", !0),
|
|
4057
4057
|
g(Ye, {
|
|
4058
|
-
label: h(
|
|
4058
|
+
label: h(L)("menu.common.labels.configuration")
|
|
4059
4059
|
}, {
|
|
4060
4060
|
default: P(() => [
|
|
4061
|
-
g(
|
|
4061
|
+
g(q, {
|
|
4062
4062
|
modelValue: x.group.stackable,
|
|
4063
|
-
"onUpdate:modelValue":
|
|
4063
|
+
"onUpdate:modelValue": F[4] || (F[4] = (Q) => x.group.stackable = Q),
|
|
4064
4064
|
disabled: f("stackable"),
|
|
4065
|
-
label: h(
|
|
4065
|
+
label: h(L)("menu.common.labels.stackable"),
|
|
4066
4066
|
"label-placement": "right",
|
|
4067
|
-
sublabel: h(
|
|
4067
|
+
sublabel: h(L)("menu.common.labels.stackable_sublabel")
|
|
4068
4068
|
}, null, 8, ["modelValue", "disabled", "label", "sublabel"])
|
|
4069
4069
|
]),
|
|
4070
4070
|
_: 1
|
|
4071
4071
|
}, 8, ["label"]),
|
|
4072
|
-
|
|
4072
|
+
k.value ? (M(), H(Le, {
|
|
4073
4073
|
key: 1,
|
|
4074
|
-
title: h(
|
|
4075
|
-
"sub-title": h(
|
|
4074
|
+
title: h(L)("menu.group.form.tagging.title"),
|
|
4075
|
+
"sub-title": h(L)("menu.group.form.tagging.subtitle")
|
|
4076
4076
|
}, {
|
|
4077
4077
|
default: P(() => [
|
|
4078
4078
|
g(h(Ti), {
|
|
4079
4079
|
entity: "group",
|
|
4080
4080
|
"model-value": x.group.customAttributes || {},
|
|
4081
|
-
"onUpdate:modelValue":
|
|
4081
|
+
"onUpdate:modelValue": w,
|
|
4082
4082
|
"value-options": S.value
|
|
4083
4083
|
}, null, 8, ["model-value", "value-options"])
|
|
4084
4084
|
]),
|
|
@@ -4091,7 +4091,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4091
4091
|
tag: "div",
|
|
4092
4092
|
modelValue: x.group,
|
|
4093
4093
|
rules: [h(c)],
|
|
4094
|
-
"helper-text": h(
|
|
4094
|
+
"helper-text": h(L)("menu.common.validation.default_items_tip", {
|
|
4095
4095
|
count: h(d)(x.group),
|
|
4096
4096
|
max: x.group.max
|
|
4097
4097
|
})
|
|
@@ -4102,8 +4102,8 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4102
4102
|
"categorized-items": x.categorizedItems,
|
|
4103
4103
|
config: b.value,
|
|
4104
4104
|
group: x.group,
|
|
4105
|
-
"onUpdate:group":
|
|
4106
|
-
"onUpdate:unmapGroup":
|
|
4105
|
+
"onUpdate:group": F[5] || (F[5] = (Q) => G(Q)),
|
|
4106
|
+
"onUpdate:unmapGroup": F[6] || (F[6] = (Q) => G(W(Q)))
|
|
4107
4107
|
}, null, 8, ["allow-refund-inventory", "categorized-items", "config", "group"])
|
|
4108
4108
|
]),
|
|
4109
4109
|
_: 1
|
|
@@ -4124,48 +4124,48 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4124
4124
|
},
|
|
4125
4125
|
emits: ["update:combinations"],
|
|
4126
4126
|
setup(e, { expose: i, emit: t }) {
|
|
4127
|
-
var G,
|
|
4128
|
-
const n = e, a = t, o = ye(), r = Be(), l = qe(Xe($e())), s = te([]), u = te(n.combinations[0].combinationKey || ""), d =
|
|
4127
|
+
var G, N;
|
|
4128
|
+
const n = e, a = t, o = ye(), r = Be(), l = qe(Xe($e())), s = te([]), u = te(n.combinations[0].combinationKey || ""), d = O(
|
|
4129
4129
|
() => s.value.findIndex((W) => W.combinationKey == u.value)
|
|
4130
|
-
), c =
|
|
4130
|
+
), c = O(
|
|
4131
4131
|
() => n.combinations.map((W) => ({
|
|
4132
4132
|
label: n.fullCombinations[W.combinationKey || ""],
|
|
4133
4133
|
value: W.combinationKey || ""
|
|
4134
4134
|
}))
|
|
4135
|
-
), m =
|
|
4136
|
-
var
|
|
4135
|
+
), m = O(() => {
|
|
4136
|
+
var k, S;
|
|
4137
4137
|
if (!_.value) return null;
|
|
4138
|
-
const W = ((S = (
|
|
4138
|
+
const W = ((S = (k = s.value[d.value]) == null ? void 0 : k.groups) == null ? void 0 : S.find((w) => w._id === n.groupId)) || {
|
|
4139
4139
|
_id: n.groupId,
|
|
4140
4140
|
groupKey: ""
|
|
4141
|
-
}, V = o.state.menu.modules.group.find((
|
|
4141
|
+
}, V = o.state.menu.modules.group.find((w) => w._id === n.groupId), E = Object.entries({ ...W, items: void 0 }).filter(([, w]) => !!w), U = {
|
|
4142
4142
|
...V,
|
|
4143
|
-
...Object.fromEntries(
|
|
4144
|
-
items: V.items.map((
|
|
4145
|
-
var
|
|
4146
|
-
const
|
|
4147
|
-
(x) => x._id ==
|
|
4143
|
+
...Object.fromEntries(E),
|
|
4144
|
+
items: V.items.map((w) => {
|
|
4145
|
+
var L;
|
|
4146
|
+
const I = (L = W.items) == null ? void 0 : L.find(
|
|
4147
|
+
(x) => x._id == w._id && x.combinationKey == w.combinationKey
|
|
4148
4148
|
);
|
|
4149
4149
|
return {
|
|
4150
|
-
...
|
|
4151
|
-
|
|
4152
|
-
price: (
|
|
4153
|
-
priceTiers: (
|
|
4154
|
-
inventoryBindings: (
|
|
4150
|
+
...w,
|
|
4151
|
+
...I ?? {},
|
|
4152
|
+
price: (I == null ? void 0 : I.price) || null,
|
|
4153
|
+
priceTiers: (I == null ? void 0 : I.priceTiers) || null,
|
|
4154
|
+
inventoryBindings: (I == null ? void 0 : I.inventoryBindings) || null
|
|
4155
4155
|
};
|
|
4156
4156
|
})
|
|
4157
4157
|
};
|
|
4158
|
-
return new ji(o, l.updateMenu, r).mapGroups([
|
|
4158
|
+
return new ji(o, l.updateMenu, r).mapGroups([U], !0)[0];
|
|
4159
4159
|
});
|
|
4160
4160
|
function p(W) {
|
|
4161
|
-
var
|
|
4162
|
-
const R = (
|
|
4161
|
+
var U, k;
|
|
4162
|
+
const R = (U = s.value[d.value].groups) == null ? void 0 : U.findIndex(
|
|
4163
4163
|
(S) => S._id === n.groupId
|
|
4164
|
-
), V = ue(s.value),
|
|
4164
|
+
), V = ue(s.value), E = { ...qt(W), _id: n.groupId, groupKey: "" };
|
|
4165
4165
|
(R ?? -1) < 0 ? V[d.value] = {
|
|
4166
4166
|
...V[d.value],
|
|
4167
|
-
groups: [...((
|
|
4168
|
-
} : V[d.value].groups[R] =
|
|
4167
|
+
groups: [...((k = V[d.value]) == null ? void 0 : k.groups) || [], E]
|
|
4168
|
+
} : V[d.value].groups[R] = E, s.value = V;
|
|
4169
4169
|
}
|
|
4170
4170
|
function v(W) {
|
|
4171
4171
|
const R = c.value.length;
|
|
@@ -4196,8 +4196,8 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4196
4196
|
var V;
|
|
4197
4197
|
return {
|
|
4198
4198
|
...R,
|
|
4199
|
-
groups: (V = R.groups) == null ? void 0 : V.map((
|
|
4200
|
-
...oo(
|
|
4199
|
+
groups: (V = R.groups) == null ? void 0 : V.map((E) => ({
|
|
4200
|
+
...oo(E, y())
|
|
4201
4201
|
}))
|
|
4202
4202
|
};
|
|
4203
4203
|
});
|
|
@@ -4213,12 +4213,12 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4213
4213
|
const f = te();
|
|
4214
4214
|
i({
|
|
4215
4215
|
show: (G = f.value) == null ? void 0 : G.show,
|
|
4216
|
-
trigger: (
|
|
4216
|
+
trigger: (N = f.value) == null ? void 0 : N.trigger
|
|
4217
4217
|
});
|
|
4218
4218
|
const { t: C } = pe();
|
|
4219
4219
|
return (W, R) => {
|
|
4220
|
-
const V =
|
|
4221
|
-
return
|
|
4220
|
+
const V = B("fm-select"), E = B("fm-button"), U = B("fm-card");
|
|
4221
|
+
return M(), H(hn, {
|
|
4222
4222
|
ref_key: "baseFormRef",
|
|
4223
4223
|
ref: f,
|
|
4224
4224
|
"allow-refund-inventory": !0,
|
|
@@ -4227,15 +4227,15 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4227
4227
|
group: m.value,
|
|
4228
4228
|
action: "update",
|
|
4229
4229
|
title: h(C)("menu.group.update"),
|
|
4230
|
-
"onUpdate:group": R[3] || (R[3] = (
|
|
4231
|
-
"onSubmit:group": R[4] || (R[4] = (
|
|
4232
|
-
"onStatus:show": R[5] || (R[5] = (
|
|
4230
|
+
"onUpdate:group": R[3] || (R[3] = (k) => p(k)),
|
|
4231
|
+
"onSubmit:group": R[4] || (R[4] = (k) => b()),
|
|
4232
|
+
"onStatus:show": R[5] || (R[5] = (k) => _.value = k)
|
|
4233
4233
|
}, {
|
|
4234
|
-
default: P(({ trigger:
|
|
4235
|
-
fe(W.$slots, "default", { trigger:
|
|
4234
|
+
default: P(({ trigger: k }) => [
|
|
4235
|
+
fe(W.$slots, "default", { trigger: k })
|
|
4236
4236
|
]),
|
|
4237
4237
|
"variant-section": P(() => [
|
|
4238
|
-
u.value ? (
|
|
4238
|
+
u.value ? (M(), H(U, {
|
|
4239
4239
|
key: 0,
|
|
4240
4240
|
class: "p-16 bg-fm-color-neutral-gray-100 space-y-24",
|
|
4241
4241
|
variant: "outlined"
|
|
@@ -4245,22 +4245,22 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4245
4245
|
D("div", Sr, [
|
|
4246
4246
|
g(V, {
|
|
4247
4247
|
modelValue: u.value,
|
|
4248
|
-
"onUpdate:modelValue": R[0] || (R[0] = (
|
|
4248
|
+
"onUpdate:modelValue": R[0] || (R[0] = (k) => u.value = k),
|
|
4249
4249
|
items: c.value,
|
|
4250
4250
|
class: "flex-1"
|
|
4251
4251
|
}, null, 8, ["modelValue", "items"]),
|
|
4252
4252
|
D("div", Cr, [
|
|
4253
|
-
g(
|
|
4253
|
+
g(E, {
|
|
4254
4254
|
variant: h(Ze).Tertiary,
|
|
4255
4255
|
"prepend-icon": "keyboard_arrow_left",
|
|
4256
4256
|
size: "lg",
|
|
4257
|
-
onClick: R[1] || (R[1] = (
|
|
4257
|
+
onClick: R[1] || (R[1] = (k) => v("left"))
|
|
4258
4258
|
}, null, 8, ["variant"]),
|
|
4259
|
-
g(
|
|
4259
|
+
g(E, {
|
|
4260
4260
|
variant: h(Ze).Tertiary,
|
|
4261
4261
|
"prepend-icon": "keyboard_arrow_right",
|
|
4262
4262
|
size: "lg",
|
|
4263
|
-
onClick: R[2] || (R[2] = (
|
|
4263
|
+
onClick: R[2] || (R[2] = (k) => v("right"))
|
|
4264
4264
|
}, null, 8, ["variant"])
|
|
4265
4265
|
])
|
|
4266
4266
|
])
|
|
@@ -4284,20 +4284,20 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4284
4284
|
groupIds: {}
|
|
4285
4285
|
},
|
|
4286
4286
|
setup(e) {
|
|
4287
|
-
const i = e, t = Be(), { emitData: n, emitAction: a } = Pi(), o = ye(), r =
|
|
4287
|
+
const i = e, t = Be(), { emitData: n, emitAction: a } = Pi(), o = ye(), r = O(() => o.rules.group), l = O(() => o.groups);
|
|
4288
4288
|
function s(b) {
|
|
4289
4289
|
return ue(b ?? []).sort((f, C) => f.position - C.position);
|
|
4290
4290
|
}
|
|
4291
|
-
const u =
|
|
4291
|
+
const u = O(() => s(l.value).reduce((b, _) => (b[_._id] = {
|
|
4292
4292
|
name: _.name,
|
|
4293
4293
|
type: xt(o.items, _.items)
|
|
4294
|
-
}, b), {})), d =
|
|
4294
|
+
}, b), {})), d = O(() => [
|
|
4295
4295
|
...Object.entries(u.value).map(([b, { name: _, type: f }]) => ({
|
|
4296
4296
|
label: `${_} ${r.value.type ? `(${$t(f)})` : ""}`.trim(),
|
|
4297
4297
|
value: b
|
|
4298
4298
|
}))
|
|
4299
|
-
]), c =
|
|
4300
|
-
|
|
4299
|
+
]), c = O(() => !!o.state.currentCatalogId || !!o.state.currentSchedulerId);
|
|
4300
|
+
O(() => {
|
|
4301
4301
|
const b = !o.state.currentSchedulerId, _ = o.rules.group.type, f = o.version == Y.F_MENU_VERSION.enum.v3, C = o.rules.item.orderFromActiveOnly, G = o.rules.item.bindToVariant;
|
|
4302
4302
|
return function(W) {
|
|
4303
4303
|
return {
|
|
@@ -4318,7 +4318,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4318
4318
|
isV4: !f
|
|
4319
4319
|
};
|
|
4320
4320
|
};
|
|
4321
|
-
}),
|
|
4321
|
+
}), O(() => ({
|
|
4322
4322
|
...Ee.generator.initMenuV4Group(),
|
|
4323
4323
|
type: o.version === Y.F_MENU_VERSION.enum.v4 ? Y.F_ADDON_GROUP_TYPE.enum.PRODUCT : Y.F_ADDON_GROUP_TYPE.enum.NORMAL,
|
|
4324
4324
|
items: {},
|
|
@@ -4329,20 +4329,20 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4329
4329
|
n(m.value), a("primary"), t.close();
|
|
4330
4330
|
};
|
|
4331
4331
|
return (b, _) => {
|
|
4332
|
-
const f =
|
|
4333
|
-
return d.value.length > 0 ? (
|
|
4332
|
+
const f = B("FmSearch"), C = B("FmCheckbox"), G = B("FmButton");
|
|
4333
|
+
return d.value.length > 0 ? (M(), ne("div", Ar, [
|
|
4334
4334
|
D("div", null, [
|
|
4335
4335
|
g(f, {
|
|
4336
4336
|
autofocus: "",
|
|
4337
4337
|
modelValue: p.value,
|
|
4338
|
-
"onUpdate:modelValue": _[0] || (_[0] = (
|
|
4338
|
+
"onUpdate:modelValue": _[0] || (_[0] = (N) => p.value = N),
|
|
4339
4339
|
placeholder: h(v)("menu.common.labels.search_groups")
|
|
4340
4340
|
}, null, 8, ["modelValue", "placeholder"])
|
|
4341
4341
|
]),
|
|
4342
4342
|
D("div", Mr, [
|
|
4343
4343
|
D("div", null, [
|
|
4344
|
-
(
|
|
4345
|
-
key:
|
|
4344
|
+
(M(!0), ne(Me, null, Ue(d.value, (N) => (M(), ne("div", {
|
|
4345
|
+
key: N.value
|
|
4346
4346
|
}, [
|
|
4347
4347
|
ut(g(C, {
|
|
4348
4348
|
modelValue: m.value,
|
|
@@ -4350,22 +4350,22 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4350
4350
|
_[1] || (_[1] = (W) => m.value = W),
|
|
4351
4351
|
_[2] || (_[2] = (W) => h(n)(m.value))
|
|
4352
4352
|
],
|
|
4353
|
-
label:
|
|
4354
|
-
value:
|
|
4353
|
+
label: N.label,
|
|
4354
|
+
value: N.value
|
|
4355
4355
|
}, null, 8, ["modelValue", "label", "value"]), [
|
|
4356
|
-
[Ct,
|
|
4356
|
+
[Ct, N.label.toLowerCase().includes(p.value.toLowerCase())]
|
|
4357
4357
|
])
|
|
4358
4358
|
]))), 128))
|
|
4359
4359
|
])
|
|
4360
4360
|
]),
|
|
4361
4361
|
D("div", Or, [
|
|
4362
4362
|
g(h(Mi), null, {
|
|
4363
|
-
default: P(({ trigger:
|
|
4363
|
+
default: P(({ trigger: N }) => [
|
|
4364
4364
|
g(G, {
|
|
4365
4365
|
label: h(v)("menu.common.actions.add_group"),
|
|
4366
4366
|
variant: "tertiary",
|
|
4367
4367
|
"text-color": "primary",
|
|
4368
|
-
onClick: (W) =>
|
|
4368
|
+
onClick: (W) => N()
|
|
4369
4369
|
}, null, 8, ["label", "onClick"])
|
|
4370
4370
|
]),
|
|
4371
4371
|
_: 1
|
|
@@ -4374,25 +4374,25 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4374
4374
|
g(G, {
|
|
4375
4375
|
label: h(v)("menu.common.actions.cancel"),
|
|
4376
4376
|
variant: "tertiary",
|
|
4377
|
-
onClick: _[3] || (_[3] = (
|
|
4377
|
+
onClick: _[3] || (_[3] = (N) => h(t).close())
|
|
4378
4378
|
}, null, 8, ["label"]),
|
|
4379
4379
|
g(G, {
|
|
4380
4380
|
label: h(v)("menu.common.actions.confirm"),
|
|
4381
|
-
onClick: _[4] || (_[4] = (
|
|
4381
|
+
onClick: _[4] || (_[4] = (N) => y())
|
|
4382
4382
|
}, null, 8, ["label"])
|
|
4383
4383
|
])
|
|
4384
4384
|
])
|
|
4385
|
-
])) : (
|
|
4385
|
+
])) : (M(), ne("div", zr, [
|
|
4386
4386
|
D("div", Ir, [
|
|
4387
4387
|
D("p", Er, ce(h(v)("menu.common.empty.no_group.title")), 1),
|
|
4388
4388
|
D("p", Tr, ce(h(v)("menu.common.empty.no_group.subtitle")), 1)
|
|
4389
4389
|
]),
|
|
4390
4390
|
g(h(Mi), null, {
|
|
4391
|
-
default: P(({ trigger:
|
|
4391
|
+
default: P(({ trigger: N }) => [
|
|
4392
4392
|
g(G, {
|
|
4393
4393
|
label: h(v)("menu.common.actions.add_group"),
|
|
4394
4394
|
icon: "add",
|
|
4395
|
-
onClick: (W) =>
|
|
4395
|
+
onClick: (W) => N()
|
|
4396
4396
|
}, null, 8, ["label", "onClick"])
|
|
4397
4397
|
]),
|
|
4398
4398
|
_: 1
|
|
@@ -4419,61 +4419,61 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4419
4419
|
}) {
|
|
4420
4420
|
const t = e, n = $e(), a = ye(), o = ni(), r = Be(), {
|
|
4421
4421
|
t: l
|
|
4422
|
-
} = pe(), s = i, u =
|
|
4423
|
-
function m(S,
|
|
4424
|
-
return ue(
|
|
4425
|
-
const x = S.find((
|
|
4422
|
+
} = pe(), s = i, u = O(() => a.rules.group), d = O(() => a.rules.item), c = O(() => a.groups);
|
|
4423
|
+
function m(S, w) {
|
|
4424
|
+
return ue(w ?? []).map((L) => {
|
|
4425
|
+
const x = S.find((F) => F._id === L._id);
|
|
4426
4426
|
return {
|
|
4427
4427
|
name: (x == null ? void 0 : x.name) ?? "",
|
|
4428
|
-
...
|
|
4428
|
+
...L,
|
|
4429
4429
|
position: x == null ? void 0 : x.position
|
|
4430
4430
|
};
|
|
4431
4431
|
});
|
|
4432
4432
|
}
|
|
4433
|
-
const p =
|
|
4434
|
-
var
|
|
4435
|
-
return [...v(m(c.value, t.form.groups || ((
|
|
4433
|
+
const p = O(() => {
|
|
4434
|
+
var w;
|
|
4435
|
+
return [...v(m(c.value, t.form.groups || ((w = t.fallback) == null ? void 0 : w.groups) || [])).map((I) => I._id)];
|
|
4436
4436
|
});
|
|
4437
4437
|
function v(S) {
|
|
4438
|
-
return ue(S ?? []).sort((
|
|
4438
|
+
return ue(S ?? []).sort((I, L) => I.position - L.position);
|
|
4439
4439
|
}
|
|
4440
4440
|
function y(S) {
|
|
4441
|
-
const
|
|
4442
|
-
if (!
|
|
4441
|
+
const w = c.value.find((x) => x._id === S);
|
|
4442
|
+
if (!w)
|
|
4443
4443
|
return [];
|
|
4444
|
-
const
|
|
4445
|
-
return
|
|
4444
|
+
const I = [];
|
|
4445
|
+
return w.items.forEach((x) => {
|
|
4446
4446
|
if (x.combinationKey)
|
|
4447
4447
|
return;
|
|
4448
|
-
const
|
|
4449
|
-
|
|
4450
|
-
code: x.code || (
|
|
4451
|
-
name: x.name || (
|
|
4452
|
-
variantCount:
|
|
4448
|
+
const F = a.items.find(($) => $._id === x._id), T = w.items.filter(($) => $._id === x._id && $.combinationKey).length;
|
|
4449
|
+
I.push({
|
|
4450
|
+
code: x.code || (F == null ? void 0 : F.code),
|
|
4451
|
+
name: x.name || (F == null ? void 0 : F.name),
|
|
4452
|
+
variantCount: T
|
|
4453
4453
|
});
|
|
4454
|
-
}),
|
|
4455
|
-
const
|
|
4456
|
-
return (x.variantCount || 0) > 1 ? `${
|
|
4454
|
+
}), I.map((x) => {
|
|
4455
|
+
const F = [(x == null ? void 0 : x.code) || "", (x == null ? void 0 : x.name) || ""].join(" ").trim();
|
|
4456
|
+
return (x.variantCount || 0) > 1 ? `${F} (${l("menu.group.list.variants", {
|
|
4457
4457
|
count: x.variantCount
|
|
4458
|
-
})})` :
|
|
4458
|
+
})})` : F;
|
|
4459
4459
|
});
|
|
4460
4460
|
}
|
|
4461
|
-
const b =
|
|
4462
|
-
name:
|
|
4463
|
-
type: xt(a.items,
|
|
4464
|
-
}, S), {})), _ =
|
|
4465
|
-
name:
|
|
4466
|
-
type:
|
|
4461
|
+
const b = O(() => v(c.value).reduce((S, w) => (S[w._id] = {
|
|
4462
|
+
name: w.name,
|
|
4463
|
+
type: xt(a.items, w.items)
|
|
4464
|
+
}, S), {})), _ = O(() => [...Object.entries(b.value).map(([S, {
|
|
4465
|
+
name: w,
|
|
4466
|
+
type: I
|
|
4467
4467
|
}]) => ({
|
|
4468
|
-
label: `${
|
|
4468
|
+
label: `${w} ${u.value.type ? `(${$t(I)})` : ""}`.trim(),
|
|
4469
4469
|
value: S
|
|
4470
|
-
}))]), f =
|
|
4470
|
+
}))]), f = O(() => [{
|
|
4471
4471
|
accessorKey: "name",
|
|
4472
4472
|
header: () => l("menu.product.form.group.columns.title"),
|
|
4473
4473
|
enableSorting: !1,
|
|
4474
4474
|
cell: (S) => {
|
|
4475
|
-
const
|
|
4476
|
-
return w
|
|
4475
|
+
const w = S.row.original._id;
|
|
4476
|
+
return U(w);
|
|
4477
4477
|
}
|
|
4478
4478
|
}, {
|
|
4479
4479
|
id: "type",
|
|
@@ -4481,9 +4481,9 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4481
4481
|
header: () => l("menu.product.form.group.columns.type"),
|
|
4482
4482
|
enableSorting: !1,
|
|
4483
4483
|
cell: (S) => {
|
|
4484
|
-
var
|
|
4485
|
-
const
|
|
4486
|
-
return $t((
|
|
4484
|
+
var I;
|
|
4485
|
+
const w = S.row.original._id;
|
|
4486
|
+
return $t((I = b.value[w]) == null ? void 0 : I.type);
|
|
4487
4487
|
}
|
|
4488
4488
|
}, {
|
|
4489
4489
|
accessorKey: "items",
|
|
@@ -4491,7 +4491,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4491
4491
|
enableSorting: !1,
|
|
4492
4492
|
size: 200,
|
|
4493
4493
|
cell: (S) => {
|
|
4494
|
-
const
|
|
4494
|
+
const w = S.row.original._id, L = y(w).join(", ");
|
|
4495
4495
|
return g(Ae.FmTooltip, {
|
|
4496
4496
|
"z-index": 51,
|
|
4497
4497
|
class: "flex",
|
|
@@ -4500,14 +4500,14 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4500
4500
|
}, {
|
|
4501
4501
|
default: () => g("div", {
|
|
4502
4502
|
class: "line-clamp-2 break-all"
|
|
4503
|
-
}, [
|
|
4503
|
+
}, [L]),
|
|
4504
4504
|
content: () => g("div", {
|
|
4505
4505
|
class: "py-12 px-16 space-y-12"
|
|
4506
4506
|
}, [g("p", {
|
|
4507
4507
|
class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-600"
|
|
4508
4508
|
}, [l("menu.group.list.columns.products")]), g("div", {
|
|
4509
4509
|
class: "flex flex-wrap gap-8"
|
|
4510
|
-
}, [
|
|
4510
|
+
}, [L])])
|
|
4511
4511
|
});
|
|
4512
4512
|
}
|
|
4513
4513
|
}, {
|
|
@@ -4516,7 +4516,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4516
4516
|
size: 52,
|
|
4517
4517
|
enableSorting: !1,
|
|
4518
4518
|
cell: (S) => {
|
|
4519
|
-
const
|
|
4519
|
+
const w = S.row.original._id;
|
|
4520
4520
|
return Se("div", {
|
|
4521
4521
|
class: "flex justify-end"
|
|
4522
4522
|
}, [Se(Ae.FmButton, {
|
|
@@ -4524,28 +4524,28 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4524
4524
|
variant: "tertiary",
|
|
4525
4525
|
textColor: "neutral-gray-400",
|
|
4526
4526
|
onClick: kt(async () => {
|
|
4527
|
-
W(
|
|
4527
|
+
W(w);
|
|
4528
4528
|
}, ["stop", "prevent"])
|
|
4529
4529
|
}), Se(Rr, {
|
|
4530
4530
|
// variant items
|
|
4531
4531
|
combinations: V.value ?? [],
|
|
4532
4532
|
// combinationKey: varaintName
|
|
4533
4533
|
fullCombinations: t.fullCombinations,
|
|
4534
|
-
groupId:
|
|
4535
|
-
"onUpdate:combinations":
|
|
4534
|
+
groupId: w,
|
|
4535
|
+
"onUpdate:combinations": k
|
|
4536
4536
|
}, {
|
|
4537
4537
|
default: ({
|
|
4538
|
-
trigger:
|
|
4538
|
+
trigger: I
|
|
4539
4539
|
}) => Se(Ae.FmButton, {
|
|
4540
4540
|
icon: "edit",
|
|
4541
4541
|
variant: "tertiary",
|
|
4542
|
-
disabled: !
|
|
4542
|
+
disabled: !E(w),
|
|
4543
4543
|
textColor: "neutral-gray-400",
|
|
4544
|
-
onClick:
|
|
4544
|
+
onClick: I
|
|
4545
4545
|
})
|
|
4546
4546
|
})]);
|
|
4547
4547
|
}
|
|
4548
|
-
}]), C =
|
|
4548
|
+
}]), C = O(() => ({
|
|
4549
4549
|
type: a.version !== Y.F_MENU_VERSION.enum.v4
|
|
4550
4550
|
}));
|
|
4551
4551
|
function G() {
|
|
@@ -4556,53 +4556,53 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4556
4556
|
groupIds: p.value
|
|
4557
4557
|
}
|
|
4558
4558
|
}).onPrimary((S) => {
|
|
4559
|
-
var
|
|
4560
|
-
for (const
|
|
4561
|
-
if (jn(a.state.menu,
|
|
4562
|
-
const
|
|
4559
|
+
var w;
|
|
4560
|
+
for (const I of S)
|
|
4561
|
+
if (jn(a.state.menu, I, t.form._id)) {
|
|
4562
|
+
const L = (w = b.value[I]) == null ? void 0 : w.name;
|
|
4563
4563
|
n.open({
|
|
4564
4564
|
type: "error",
|
|
4565
4565
|
message: l("menu.product.form.group.circularError", {
|
|
4566
|
-
groupName:
|
|
4566
|
+
groupName: L,
|
|
4567
4567
|
productName: t.form.name
|
|
4568
4568
|
})
|
|
4569
4569
|
});
|
|
4570
4570
|
return;
|
|
4571
4571
|
}
|
|
4572
|
-
|
|
4572
|
+
N(S);
|
|
4573
4573
|
});
|
|
4574
4574
|
}
|
|
4575
|
-
function
|
|
4576
|
-
const
|
|
4577
|
-
var
|
|
4578
|
-
const x = ((
|
|
4579
|
-
_id:
|
|
4575
|
+
function N(S) {
|
|
4576
|
+
const w = S.reduce((I, L) => {
|
|
4577
|
+
var F;
|
|
4578
|
+
const x = ((F = t.form.groups) == null ? void 0 : F.find((T) => T._id === L)) || {
|
|
4579
|
+
_id: L,
|
|
4580
4580
|
groupKey: ""
|
|
4581
4581
|
};
|
|
4582
|
-
return
|
|
4582
|
+
return I.push(x), I;
|
|
4583
4583
|
}, []);
|
|
4584
4584
|
s("replace:form", o.initDynamicGroupItem({
|
|
4585
4585
|
...t.form,
|
|
4586
|
-
groups:
|
|
4586
|
+
groups: w
|
|
4587
4587
|
}));
|
|
4588
4588
|
}
|
|
4589
4589
|
function W(S) {
|
|
4590
|
-
var
|
|
4590
|
+
var I, L, x;
|
|
4591
4591
|
if (!t.form.groups)
|
|
4592
4592
|
return;
|
|
4593
|
-
const
|
|
4594
|
-
|
|
4595
|
-
for (const
|
|
4596
|
-
(x =
|
|
4593
|
+
const w = ue(t.form.groups);
|
|
4594
|
+
w.splice(w.findIndex((F) => F._id === S), 1);
|
|
4595
|
+
for (const F of ((I = t.form.variant) == null ? void 0 : I.variantCombinations) || [])
|
|
4596
|
+
(x = F.groups) == null || x.splice((L = F.groups) == null ? void 0 : L.findIndex((T) => T._id === S), 1);
|
|
4597
4597
|
s("replace:form", o.initDynamicGroupItem({
|
|
4598
4598
|
...t.form,
|
|
4599
|
-
groups:
|
|
4599
|
+
groups: w
|
|
4600
4600
|
}));
|
|
4601
4601
|
}
|
|
4602
|
-
const R =
|
|
4602
|
+
const R = O(() => {
|
|
4603
4603
|
var S;
|
|
4604
4604
|
return !!((S = t.form.variant) != null && S.variantGroupIds.length);
|
|
4605
|
-
}), V =
|
|
4605
|
+
}), V = O(() => {
|
|
4606
4606
|
var S;
|
|
4607
4607
|
return R.value ? (S = t.form.variant) == null ? void 0 : S.variantCombinations : [{
|
|
4608
4608
|
_id: t.form._id,
|
|
@@ -4610,11 +4610,11 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4610
4610
|
groups: t.form.groups || []
|
|
4611
4611
|
}];
|
|
4612
4612
|
});
|
|
4613
|
-
function
|
|
4614
|
-
var
|
|
4613
|
+
function E(S) {
|
|
4614
|
+
var I;
|
|
4615
4615
|
if (!S) return !1;
|
|
4616
4616
|
if (d.value.overrideProductGroup) return !0;
|
|
4617
|
-
switch ((
|
|
4617
|
+
switch ((I = b.value[S]) == null ? void 0 : I.type) {
|
|
4618
4618
|
case Y.F_ADDON_GROUP_TYPE.enum.DYNAMIC:
|
|
4619
4619
|
return !0;
|
|
4620
4620
|
case Y.F_ADDON_GROUP_TYPE.enum.PRODUCT:
|
|
@@ -4625,24 +4625,24 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4625
4625
|
return !1;
|
|
4626
4626
|
}
|
|
4627
4627
|
}
|
|
4628
|
-
Re(() => c.value.length, () =>
|
|
4629
|
-
const
|
|
4630
|
-
var
|
|
4631
|
-
return (
|
|
4632
|
-
},
|
|
4633
|
-
var
|
|
4628
|
+
Re(() => c.value.length, () => N([...p.value, c.value[c.value.length - 1]._id]));
|
|
4629
|
+
const U = (S) => {
|
|
4630
|
+
var w;
|
|
4631
|
+
return (w = _.value.find((I) => I.value === S)) == null ? void 0 : w.label;
|
|
4632
|
+
}, k = (S) => {
|
|
4633
|
+
var w;
|
|
4634
4634
|
R.value ? s("update:form", "variant", {
|
|
4635
|
-
variantGroupIds: ((
|
|
4635
|
+
variantGroupIds: ((w = t.form.variant) == null ? void 0 : w.variantGroupIds) || [],
|
|
4636
4636
|
variantCombinations: S
|
|
4637
4637
|
}) : s("update:form", "groups", S[0].groups || []);
|
|
4638
4638
|
};
|
|
4639
|
-
return (S,
|
|
4640
|
-
const
|
|
4641
|
-
return
|
|
4639
|
+
return (S, w) => {
|
|
4640
|
+
const I = B("FmButton"), L = B("FmTable");
|
|
4641
|
+
return M(), H(Le, {
|
|
4642
4642
|
title: h(l)("menu.product.form.group.title"),
|
|
4643
4643
|
"sub-title": h(l)("menu.product.form.group.subtitle")
|
|
4644
4644
|
}, {
|
|
4645
|
-
"append-title": P(() => [g(
|
|
4645
|
+
"append-title": P(() => [g(I, {
|
|
4646
4646
|
class: "flex-shrink-0",
|
|
4647
4647
|
label: h(l)("menu.product.form.group.add"),
|
|
4648
4648
|
"prepend-icon": "add",
|
|
@@ -4652,12 +4652,12 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4652
4652
|
default: P(() => [g(dn, null, {
|
|
4653
4653
|
default: P(() => {
|
|
4654
4654
|
var x;
|
|
4655
|
-
return [((x = p.value) == null ? void 0 : x.length) > 0 ? (
|
|
4655
|
+
return [((x = p.value) == null ? void 0 : x.length) > 0 ? (M(), H(L, {
|
|
4656
4656
|
key: 0,
|
|
4657
4657
|
"column-defs": f.value,
|
|
4658
4658
|
"column-visibility": C.value,
|
|
4659
|
-
"row-data": p.value.map((
|
|
4660
|
-
_id:
|
|
4659
|
+
"row-data": p.value.map((F) => ({
|
|
4660
|
+
_id: F
|
|
4661
4661
|
})),
|
|
4662
4662
|
"page-size": p.value.length,
|
|
4663
4663
|
"hide-footer": "",
|
|
@@ -4694,7 +4694,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4694
4694
|
}) {
|
|
4695
4695
|
const {
|
|
4696
4696
|
t
|
|
4697
|
-
} = pe(), n = e, a = i, o = ye(), r =
|
|
4697
|
+
} = pe(), n = e, a = i, o = ye(), r = O(() => o.rules.item), l = O(() => r.value.inventory);
|
|
4698
4698
|
function s(y, b, _, f) {
|
|
4699
4699
|
return !b || b && b.length === 0 ? [{
|
|
4700
4700
|
_id: "",
|
|
@@ -4706,15 +4706,15 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4706
4706
|
binding: C.inventoryBindings || []
|
|
4707
4707
|
}));
|
|
4708
4708
|
}
|
|
4709
|
-
const u =
|
|
4709
|
+
const u = O(() => {
|
|
4710
4710
|
var y;
|
|
4711
4711
|
return n.form.name || ((y = n.fallback) == null ? void 0 : y.name) || "";
|
|
4712
|
-
}), d =
|
|
4712
|
+
}), d = O(() => {
|
|
4713
4713
|
var y;
|
|
4714
4714
|
return s(n.form.inventoryBindings || [], ((y = n.form.variant) == null ? void 0 : y.variantCombinations) || [], u.value, o.variants);
|
|
4715
4715
|
});
|
|
4716
4716
|
function c(y, b) {
|
|
4717
|
-
var G,
|
|
4717
|
+
var G, N;
|
|
4718
4718
|
let _ = Ve.clone(n.form);
|
|
4719
4719
|
const f = _.variant;
|
|
4720
4720
|
if ((((G = f == null ? void 0 : f.variantCombinations) == null ? void 0 : G.length) ?? 0) > 0 && f) {
|
|
@@ -4724,7 +4724,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4724
4724
|
R[W].inventoryBindings = b, _ = {
|
|
4725
4725
|
..._,
|
|
4726
4726
|
variant: {
|
|
4727
|
-
variantGroupIds: ((
|
|
4727
|
+
variantGroupIds: ((N = _.variant) == null ? void 0 : N.variantGroupIds) || [],
|
|
4728
4728
|
variantCombinations: R
|
|
4729
4729
|
}
|
|
4730
4730
|
};
|
|
@@ -4779,7 +4779,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4779
4779
|
}, {
|
|
4780
4780
|
default: ({
|
|
4781
4781
|
trigger: _
|
|
4782
|
-
}) => g(
|
|
4782
|
+
}) => g(B("fm-button"), {
|
|
4783
4783
|
variant: Ze.Tertiary,
|
|
4784
4784
|
prependIcon: "edit",
|
|
4785
4785
|
textColor: je.NeutralGray400,
|
|
@@ -4798,11 +4798,11 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4798
4798
|
const v = Ni();
|
|
4799
4799
|
return ot(() => {
|
|
4800
4800
|
v.readInventory();
|
|
4801
|
-
}), (y, b) => (
|
|
4801
|
+
}), (y, b) => (M(), H(Le, {
|
|
4802
4802
|
title: h(t)("menu.inventory.title"),
|
|
4803
4803
|
subTitle: h(t)("menu.inventory.subtitle")
|
|
4804
4804
|
}, {
|
|
4805
|
-
default: P(() => [D("div", Vr, [D("div", Ur, [(
|
|
4805
|
+
default: P(() => [D("div", Vr, [D("div", Ur, [(M(!0), ne(Me, null, Ue(d.value, (_) => (M(), H(h(Yt), {
|
|
4806
4806
|
key: _._id,
|
|
4807
4807
|
ref_for: !0,
|
|
4808
4808
|
ref_key: "inventoryManagerForms",
|
|
@@ -4847,16 +4847,16 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4847
4847
|
},
|
|
4848
4848
|
emits: ["update:form"],
|
|
4849
4849
|
setup(e, { emit: i }) {
|
|
4850
|
-
const t = e, n = pt(), a = ye(), o = Bi(), { t: r } = pe(), l = i, s =
|
|
4851
|
-
var G,
|
|
4852
|
-
const f = t.isOverride ? ((G = t.fallback) == null ? void 0 : G.unit) ?? ((
|
|
4850
|
+
const t = e, n = pt(), a = ye(), o = Bi(), { t: r } = pe(), l = i, s = O(() => a.rules.item), u = O(() => {
|
|
4851
|
+
var G, N;
|
|
4852
|
+
const f = t.isOverride ? ((G = t.fallback) == null ? void 0 : G.unit) ?? ((N = t.fallback) == null ? void 0 : N.perXUnit) : void 0, C = t.form.unit ?? t.form.perXUnit ?? f;
|
|
4853
4853
|
return C != null;
|
|
4854
4854
|
}), d = (f) => {
|
|
4855
4855
|
l("update:form", "unit", f ? "" : void 0), l("update:form", "perXUnit", f ? 0 : void 0);
|
|
4856
|
-
}, c =
|
|
4856
|
+
}, c = O(() => {
|
|
4857
4857
|
const f = a.isV4;
|
|
4858
4858
|
return Ft.setCoreStore(n).taxSetting(f);
|
|
4859
|
-
}), m =
|
|
4859
|
+
}), m = O(() => {
|
|
4860
4860
|
var f;
|
|
4861
4861
|
return Ft.getSelectedTax(
|
|
4862
4862
|
t.form.taxes,
|
|
@@ -4897,31 +4897,31 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4897
4897
|
command: "suggestPrice"
|
|
4898
4898
|
});
|
|
4899
4899
|
}
|
|
4900
|
-
const _ =
|
|
4900
|
+
const _ = O(() => {
|
|
4901
4901
|
var f, C;
|
|
4902
4902
|
return ((f = a.currentCatalog) == null ? void 0 : f.priceTierRules) ?? ((C = a.currentCatalog) == null ? void 0 : C.usePriceTiers) ?? [];
|
|
4903
4903
|
});
|
|
4904
4904
|
return (f, C) => {
|
|
4905
|
-
const G =
|
|
4906
|
-
return
|
|
4905
|
+
const G = B("fm-select"), N = B("FmButton"), W = B("fm-checkbox"), R = B("fm-text-field"), V = zi("tooltip");
|
|
4906
|
+
return M(), H(Le, {
|
|
4907
4907
|
title: h(r)("menu.product.form.price.title")
|
|
4908
4908
|
}, {
|
|
4909
4909
|
default: P(() => {
|
|
4910
|
-
var
|
|
4910
|
+
var E;
|
|
4911
4911
|
return [
|
|
4912
4912
|
D("div", Nr, [
|
|
4913
4913
|
g(et, {
|
|
4914
4914
|
disable: _.value.length > 0 && h(a).currentCatalog && !h(a).currentScheduler,
|
|
4915
4915
|
min: 0,
|
|
4916
4916
|
"model-value": f.form.price || null,
|
|
4917
|
-
placeholder: (
|
|
4917
|
+
placeholder: (E = f.fallback) != null && E.price ? h(at)(f.fallback.price, !1) : void 0,
|
|
4918
4918
|
rules: [
|
|
4919
|
-
s.value.price ? (
|
|
4919
|
+
s.value.price ? (U) => !!U || h(r)("menu.product.form.price.fields.selling_price.required") : void 0
|
|
4920
4920
|
].filter(h(ht).isSet),
|
|
4921
4921
|
class: "w-[258px] xs:w-full",
|
|
4922
4922
|
label: h(r)("menu.product.form.price.fields.selling_price.label"),
|
|
4923
4923
|
"show-currency": "",
|
|
4924
|
-
"onUpdate:modelValue": C[0] || (C[0] = (
|
|
4924
|
+
"onUpdate:modelValue": C[0] || (C[0] = (U) => U && l("update:form", "price", U))
|
|
4925
4925
|
}, {
|
|
4926
4926
|
append: P(() => [
|
|
4927
4927
|
ut(g(h($i), {
|
|
@@ -4944,16 +4944,16 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4944
4944
|
placeholder: "--",
|
|
4945
4945
|
class: "flex-1",
|
|
4946
4946
|
"shift-menu": "",
|
|
4947
|
-
"onUpdate:modelValue": C[1] || (C[1] = (
|
|
4947
|
+
"onUpdate:modelValue": C[1] || (C[1] = (U) => l("update:form", "taxes", [h(Ft).decodeTax(U)]))
|
|
4948
4948
|
}, null, 8, ["disabled", "items", "label", "model-value"])
|
|
4949
4949
|
]),
|
|
4950
|
-
!f.isOverride && h(a).isV4 ? (
|
|
4950
|
+
!f.isOverride && h(a).isV4 ? (M(), H(Ye, {
|
|
4951
4951
|
key: 0,
|
|
4952
4952
|
label: h(r)("menu.price_tier.price_group"),
|
|
4953
4953
|
description: h(r)("menu.price_tier.description")
|
|
4954
4954
|
}, {
|
|
4955
4955
|
append: P(() => [
|
|
4956
|
-
g(
|
|
4956
|
+
g(N, {
|
|
4957
4957
|
label: h(r)("menu.price_tier.add_price_group"),
|
|
4958
4958
|
icon: "add",
|
|
4959
4959
|
variant: "secondary",
|
|
@@ -4961,14 +4961,14 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4961
4961
|
}, null, 8, ["label", "onClick"])
|
|
4962
4962
|
]),
|
|
4963
4963
|
default: P(() => {
|
|
4964
|
-
var
|
|
4964
|
+
var U;
|
|
4965
4965
|
return [
|
|
4966
|
-
f.isOverride ? ie("", !0) : (
|
|
4966
|
+
f.isOverride ? ie("", !0) : (M(), H(mn, {
|
|
4967
4967
|
key: 0,
|
|
4968
4968
|
"price-tiers": h(o).priceTiers.value,
|
|
4969
|
-
"model-value": f.form.priceTiers || ((
|
|
4969
|
+
"model-value": f.form.priceTiers || ((U = f.fallback) == null ? void 0 : U.priceTiers) || {},
|
|
4970
4970
|
"allow-negative-price": !1,
|
|
4971
|
-
"onUpdate:modelValue": C[2] || (C[2] = (
|
|
4971
|
+
"onUpdate:modelValue": C[2] || (C[2] = (k) => l("update:form", "priceTiers", k))
|
|
4972
4972
|
}, null, 8, ["price-tiers", "model-value"]))
|
|
4973
4973
|
];
|
|
4974
4974
|
}),
|
|
@@ -4978,16 +4978,16 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4978
4978
|
label: h(r)("menu.product.form.price.settings.title")
|
|
4979
4979
|
}, {
|
|
4980
4980
|
default: P(() => {
|
|
4981
|
-
var
|
|
4981
|
+
var U, k, S;
|
|
4982
4982
|
return [
|
|
4983
4983
|
D("div", Br, [
|
|
4984
4984
|
g(W, {
|
|
4985
4985
|
disabled: !s.value.openPrice || f.isAddon,
|
|
4986
|
-
"model-value": f.form.openPrice ?? ((
|
|
4986
|
+
"model-value": f.form.openPrice ?? ((U = f.fallback) == null ? void 0 : U.openPrice) ?? !1,
|
|
4987
4987
|
value: f.form.openPrice,
|
|
4988
4988
|
label: h(r)("menu.product.form.price.settings.open_price.label"),
|
|
4989
4989
|
sublabel: h(r)("menu.product.form.price.settings.open_price.sublabel"),
|
|
4990
|
-
"onUpdate:modelValue": C[3] || (C[3] = (
|
|
4990
|
+
"onUpdate:modelValue": C[3] || (C[3] = (w) => l("update:form", "openPrice", w))
|
|
4991
4991
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
4992
4992
|
D("div", Lr, [
|
|
4993
4993
|
g(W, {
|
|
@@ -4998,15 +4998,15 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4998
4998
|
sublabel: h(r)("menu.product.form.price.settings.sell_by_unit.sublabel"),
|
|
4999
4999
|
"onUpdate:modelValue": d
|
|
5000
5000
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
5001
|
-
u.value ? (
|
|
5001
|
+
u.value ? (M(), ne("div", Gr, [
|
|
5002
5002
|
D("p", jr, ce(h(r)("menu.product.form.price.settings.sell_by_unit.per_unit.label")), 1),
|
|
5003
5003
|
D("div", Kr, [
|
|
5004
5004
|
g(R, {
|
|
5005
5005
|
disabled: !s.value.unit,
|
|
5006
|
-
"model-value": f.form.perXUnit || ((
|
|
5006
|
+
"model-value": f.form.perXUnit || ((k = f.fallback) == null ? void 0 : k.perXUnit) || null,
|
|
5007
5007
|
rules: [
|
|
5008
|
-
(
|
|
5009
|
-
(
|
|
5008
|
+
(w) => !!w || h(r)("menu.product.form.price.settings.sell_by_unit.per_unit.required"),
|
|
5009
|
+
(w) => !w || w > 0 || h(r)("menu.product.form.price.settings.sell_by_unit.per_unit.min")
|
|
5010
5010
|
],
|
|
5011
5011
|
inputmode: "numeric",
|
|
5012
5012
|
placeholder: h(r)("menu.product.form.price.settings.sell_by_unit.per_unit.placeholder"),
|
|
@@ -5020,22 +5020,22 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5020
5020
|
disabled: !s.value.unit,
|
|
5021
5021
|
"model-value": f.form.unit || ((S = f.fallback) == null ? void 0 : S.unit) || null,
|
|
5022
5022
|
rules: [
|
|
5023
|
-
(
|
|
5023
|
+
(w) => !!w || h(r)("menu.product.form.price.settings.sell_by_unit.unit.required")
|
|
5024
5024
|
],
|
|
5025
5025
|
placeholder: h(r)("menu.product.form.price.settings.sell_by_unit.unit.placeholder"),
|
|
5026
|
-
"onUpdate:modelValue": C[4] || (C[4] = (
|
|
5026
|
+
"onUpdate:modelValue": C[4] || (C[4] = (w) => l("update:form", "unit", w))
|
|
5027
5027
|
}, null, 8, ["disabled", "model-value", "rules", "placeholder"])
|
|
5028
5028
|
])
|
|
5029
5029
|
])) : ie("", !0)
|
|
5030
5030
|
]),
|
|
5031
|
-
s.value.costing ? (
|
|
5031
|
+
s.value.costing ? (M(), ne("div", Yr, [
|
|
5032
5032
|
g(W, {
|
|
5033
5033
|
"model-value": !!f.form.costing,
|
|
5034
5034
|
value: !!f.form.costing,
|
|
5035
5035
|
label: h(r)("menu.product.form.price.settings.track_costing.label"),
|
|
5036
|
-
"onUpdate:modelValue": C[5] || (C[5] = (
|
|
5036
|
+
"onUpdate:modelValue": C[5] || (C[5] = (w) => l("update:form", "costing", w ? h(xe.Dinero).zero().toObject() : void 0))
|
|
5037
5037
|
}, null, 8, ["model-value", "value", "label"]),
|
|
5038
|
-
f.form.costing ? (
|
|
5038
|
+
f.form.costing ? (M(), ne("div", Hr, [
|
|
5039
5039
|
D("div", Xr, [
|
|
5040
5040
|
g(et, {
|
|
5041
5041
|
class: "w-full",
|
|
@@ -5043,29 +5043,29 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5043
5043
|
"model-value": f.form.costing || null,
|
|
5044
5044
|
nullable: "",
|
|
5045
5045
|
"show-currency": "",
|
|
5046
|
-
"onUpdate:modelValue": C[6] || (C[6] = (
|
|
5046
|
+
"onUpdate:modelValue": C[6] || (C[6] = (w) => l("update:form", "costing", w ?? h(xe.Dinero).zero().toObject()))
|
|
5047
5047
|
}, null, 8, ["model-value"])
|
|
5048
5048
|
])
|
|
5049
5049
|
])) : ie("", !0)
|
|
5050
5050
|
])) : ie("", !0),
|
|
5051
|
-
s.value.minPrice ? (
|
|
5051
|
+
s.value.minPrice ? (M(), ne("div", qr, [
|
|
5052
5052
|
g(W, {
|
|
5053
5053
|
disabled: !s.value.minPrice || f.isAddon,
|
|
5054
5054
|
"model-value": !!f.form.minPrice,
|
|
5055
5055
|
value: !!f.form.minPrice,
|
|
5056
5056
|
label: h(r)("menu.product.form.price.settings.min_price.label"),
|
|
5057
|
-
"onUpdate:modelValue": C[7] || (C[7] = (
|
|
5057
|
+
"onUpdate:modelValue": C[7] || (C[7] = (w) => l("update:form", "minPrice", w ? h(xe.Dinero).zero().toObject() : void 0))
|
|
5058
5058
|
}, null, 8, ["disabled", "model-value", "value", "label"]),
|
|
5059
5059
|
D("div", Zr, [
|
|
5060
5060
|
D("div", Qr, [
|
|
5061
|
-
f.form.minPrice ? (
|
|
5061
|
+
f.form.minPrice ? (M(), H(et, {
|
|
5062
5062
|
key: 0,
|
|
5063
5063
|
max: h(xe.Dinero).fromFdoDinero(f.form.price).toUnit(),
|
|
5064
5064
|
min: 0,
|
|
5065
5065
|
"model-value": f.form.minPrice || null,
|
|
5066
5066
|
class: "flex-1",
|
|
5067
5067
|
"show-currency": "",
|
|
5068
|
-
"onUpdate:modelValue": C[8] || (C[8] = (
|
|
5068
|
+
"onUpdate:modelValue": C[8] || (C[8] = (w) => l("update:form", "minPrice", w ?? h(xe.Dinero).zero().toObject()))
|
|
5069
5069
|
}, null, 8, ["max", "model-value"])) : ie("", !0)
|
|
5070
5070
|
])
|
|
5071
5071
|
])
|
|
@@ -5088,9 +5088,9 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5088
5088
|
applyProduct: { type: Boolean }
|
|
5089
5089
|
},
|
|
5090
5090
|
setup(e) {
|
|
5091
|
-
const { t: i } = pe(), t = e, n = qe(Xe($e())), a =
|
|
5091
|
+
const { t: i } = pe(), t = e, n = qe(Xe($e())), a = O(
|
|
5092
5092
|
() => t.initialValue ? i("menu.print_dept.update") : i("menu.print_dept.add")
|
|
5093
|
-
), o =
|
|
5093
|
+
), o = O(
|
|
5094
5094
|
() => t.initialValue ? i("menu.common.actions.update") : i("menu.common.actions.add")
|
|
5095
5095
|
), r = te(
|
|
5096
5096
|
t.initialValue ? ue(t.initialValue) : { ...Ee.generator.initMenuV4PrintDepartment(), usedBy: [] }
|
|
@@ -5129,8 +5129,8 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5129
5129
|
c && (r.value = t.initialValue ? ue(t.initialValue) : { ...Ee.generator.initMenuV4PrintDepartment(), usedBy: [] });
|
|
5130
5130
|
}
|
|
5131
5131
|
), (c, m) => {
|
|
5132
|
-
const p =
|
|
5133
|
-
return
|
|
5132
|
+
const p = B("fm-text-field"), v = B("fm-button"), y = B("fm-side-sheet");
|
|
5133
|
+
return M(), ne(Me, null, [
|
|
5134
5134
|
fe(c.$slots, "default", { trigger: u }),
|
|
5135
5135
|
g(y, {
|
|
5136
5136
|
id: "variant-form",
|
|
@@ -5177,7 +5177,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5177
5177
|
autofocus: "",
|
|
5178
5178
|
label: h(i)("menu.print_dept.columns.name")
|
|
5179
5179
|
}, null, 8, ["modelValue", "rules", "label"]),
|
|
5180
|
-
c.applyProduct ? (
|
|
5180
|
+
c.applyProduct ? (M(), H(to, {
|
|
5181
5181
|
key: 0,
|
|
5182
5182
|
overrides: r.value.usedBy || [],
|
|
5183
5183
|
"select-variant": !1,
|
|
@@ -5211,16 +5211,16 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5211
5211
|
toRoot: !1
|
|
5212
5212
|
};
|
|
5213
5213
|
}
|
|
5214
|
-
const l =
|
|
5214
|
+
const l = O(() => n.rules.item), s = O(() => n.printDepartments), u = O(() => {
|
|
5215
5215
|
var _;
|
|
5216
5216
|
return ((_ = t.form.print) == null ? void 0 : _.sequential) ?? !1;
|
|
5217
|
-
}), d =
|
|
5217
|
+
}), d = O(() => {
|
|
5218
5218
|
var _;
|
|
5219
5219
|
return u.value ? s.value.reduce(
|
|
5220
5220
|
(f, { _id: C }) => (f.includes(C) || (f = [...f, C]), f),
|
|
5221
5221
|
[...((_ = t.form.print) == null ? void 0 : _.department) ?? []]
|
|
5222
5222
|
) : s.value.map(({ _id: f }) => f);
|
|
5223
|
-
}), c =
|
|
5223
|
+
}), c = O(() => s.value.reduce((_, f) => (_[f._id] = f.name, _), {}));
|
|
5224
5224
|
function m(_) {
|
|
5225
5225
|
o("update:form", "print", {
|
|
5226
5226
|
...r(),
|
|
@@ -5246,15 +5246,15 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5246
5246
|
});
|
|
5247
5247
|
}
|
|
5248
5248
|
function y(_, f) {
|
|
5249
|
-
var G,
|
|
5250
|
-
let C = [...((
|
|
5249
|
+
var G, N;
|
|
5250
|
+
let C = [...((N = (G = t.form) == null ? void 0 : G.print) == null ? void 0 : N.department) ?? []];
|
|
5251
5251
|
f && !C.includes(_) ? C = [...C, _] : f || (C = C.filter((W) => W !== _)), o("update:form", "print", {
|
|
5252
5252
|
...r(),
|
|
5253
5253
|
...t.form.print,
|
|
5254
5254
|
department: C
|
|
5255
5255
|
});
|
|
5256
5256
|
}
|
|
5257
|
-
const b =
|
|
5257
|
+
const b = O(() => [
|
|
5258
5258
|
{
|
|
5259
5259
|
label: a("menu.product.form.print.kds.options.all.label"),
|
|
5260
5260
|
value: !1,
|
|
@@ -5270,43 +5270,43 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5270
5270
|
() => s.value.length,
|
|
5271
5271
|
() => y(s.value[s.value.length - 1]._id, !0)
|
|
5272
5272
|
), (_, f) => {
|
|
5273
|
-
const C =
|
|
5274
|
-
return
|
|
5273
|
+
const C = B("fm-switch"), G = B("fm-radio"), N = B("fm-radio-group"), W = B("fm-button"), R = B("fm-checkbox");
|
|
5274
|
+
return M(), H(Le, {
|
|
5275
5275
|
title: h(a)("menu.product.form.print.title")
|
|
5276
5276
|
}, {
|
|
5277
5277
|
default: P(() => {
|
|
5278
5278
|
var V;
|
|
5279
5279
|
return [
|
|
5280
|
-
l.value.printConfig ? (
|
|
5280
|
+
l.value.printConfig ? (M(), H(Ye, {
|
|
5281
5281
|
key: 0,
|
|
5282
5282
|
label: h(a)("menu.product.form.print.config.label")
|
|
5283
5283
|
}, {
|
|
5284
5284
|
default: P(() => {
|
|
5285
|
-
var
|
|
5285
|
+
var E;
|
|
5286
5286
|
return [
|
|
5287
5287
|
g(C, {
|
|
5288
|
-
"model-value": !((
|
|
5288
|
+
"model-value": !((E = _.form.print) != null && E.toRoot),
|
|
5289
5289
|
label: h(a)("menu.product.form.print.config.group_parent.label"),
|
|
5290
5290
|
"label-placement": "right",
|
|
5291
5291
|
sublabel: h(a)("menu.product.form.print.config.group_parent.sublabel"),
|
|
5292
|
-
"onUpdate:modelValue": f[0] || (f[0] = (
|
|
5292
|
+
"onUpdate:modelValue": f[0] || (f[0] = (U) => m(U))
|
|
5293
5293
|
}, null, 8, ["model-value", "label", "sublabel"])
|
|
5294
5294
|
];
|
|
5295
5295
|
}),
|
|
5296
5296
|
_: 1
|
|
5297
5297
|
}, 8, ["label"])) : ie("", !0),
|
|
5298
|
-
g(
|
|
5298
|
+
g(N, {
|
|
5299
5299
|
label: h(a)("menu.product.form.print.kds.label"),
|
|
5300
5300
|
"model-value": ((V = _.form.print) == null ? void 0 : V.sequential) ?? !1,
|
|
5301
|
-
"onUpdate:modelValue": f[1] || (f[1] = (
|
|
5301
|
+
"onUpdate:modelValue": f[1] || (f[1] = (E) => p(E))
|
|
5302
5302
|
}, {
|
|
5303
5303
|
default: P(() => [
|
|
5304
5304
|
D("div", as, [
|
|
5305
|
-
(
|
|
5306
|
-
key:
|
|
5307
|
-
label:
|
|
5308
|
-
sublabel:
|
|
5309
|
-
value:
|
|
5305
|
+
(M(!0), ne(Me, null, Ue(b.value, (E, U) => (M(), H(G, {
|
|
5306
|
+
key: U,
|
|
5307
|
+
label: E.label,
|
|
5308
|
+
sublabel: E.description,
|
|
5309
|
+
value: E.value
|
|
5310
5310
|
}, null, 8, ["label", "sublabel", "value"]))), 128))
|
|
5311
5311
|
])
|
|
5312
5312
|
]),
|
|
@@ -5316,22 +5316,22 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5316
5316
|
label: h(a)("menu.product.form.print.routes.label")
|
|
5317
5317
|
}, {
|
|
5318
5318
|
default: P(() => [
|
|
5319
|
-
d.value.length ? (
|
|
5319
|
+
d.value.length ? (M(), H(h(Li), {
|
|
5320
5320
|
key: 0,
|
|
5321
|
-
"item-key": (
|
|
5321
|
+
"item-key": (E) => E,
|
|
5322
5322
|
"model-value": d.value,
|
|
5323
5323
|
handle: ".handle",
|
|
5324
|
-
"onUpdate:modelValue": f[3] || (f[3] = (
|
|
5324
|
+
"onUpdate:modelValue": f[3] || (f[3] = (E) => v(E)),
|
|
5325
5325
|
class: "space-y-16"
|
|
5326
5326
|
}, {
|
|
5327
|
-
item: P(({ element:
|
|
5328
|
-
var
|
|
5327
|
+
item: P(({ element: E }) => {
|
|
5328
|
+
var U, k, S, w, I;
|
|
5329
5329
|
return [
|
|
5330
5330
|
D("div", rs, [
|
|
5331
5331
|
D("div", ss, [
|
|
5332
|
-
u.value ? (
|
|
5332
|
+
u.value ? (M(), H(W, {
|
|
5333
5333
|
key: 0,
|
|
5334
|
-
disabled: !((
|
|
5334
|
+
disabled: !((k = (U = t.form.print) == null ? void 0 : U.department) != null && k.includes(E)),
|
|
5335
5335
|
class: "handle",
|
|
5336
5336
|
"prepend-icon": "drag_handle",
|
|
5337
5337
|
variant: "tertiary",
|
|
@@ -5340,13 +5340,13 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5340
5340
|
}, null, 8, ["disabled"])) : ie("", !0)
|
|
5341
5341
|
]),
|
|
5342
5342
|
g(R, {
|
|
5343
|
-
id:
|
|
5344
|
-
"data-checked": (
|
|
5345
|
-
label: c.value[
|
|
5346
|
-
"model-value": (((
|
|
5347
|
-
value:
|
|
5343
|
+
id: E,
|
|
5344
|
+
"data-checked": (w = (S = t.form.print) == null ? void 0 : S.department) == null ? void 0 : w.includes(E),
|
|
5345
|
+
label: c.value[E],
|
|
5346
|
+
"model-value": (((I = t.form.print) == null ? void 0 : I.department) ?? []).includes(E),
|
|
5347
|
+
value: E,
|
|
5348
5348
|
class: "flex-1",
|
|
5349
|
-
"onUpdate:modelValue": (
|
|
5349
|
+
"onUpdate:modelValue": (L) => y(E, L)
|
|
5350
5350
|
}, null, 8, ["id", "data-checked", "label", "model-value", "value", "onUpdate:modelValue"])
|
|
5351
5351
|
])
|
|
5352
5352
|
];
|
|
@@ -5354,13 +5354,13 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5354
5354
|
_: 1
|
|
5355
5355
|
}, 8, ["item-key", "model-value"])) : ie("", !0),
|
|
5356
5356
|
g(h(os), { "apply-product": !1 }, {
|
|
5357
|
-
default: P(({ trigger:
|
|
5357
|
+
default: P(({ trigger: E }) => [
|
|
5358
5358
|
D("div", ls, [
|
|
5359
5359
|
g(W, {
|
|
5360
5360
|
variant: h(Ze).Secondary,
|
|
5361
5361
|
label: h(a)("menu.product.form.print.routes.add"),
|
|
5362
5362
|
"prepend-icon": "add",
|
|
5363
|
-
onClick:
|
|
5363
|
+
onClick: E
|
|
5364
5364
|
}, null, 8, ["variant", "label", "onClick"])
|
|
5365
5365
|
])
|
|
5366
5366
|
]),
|
|
@@ -5377,10 +5377,10 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5377
5377
|
}
|
|
5378
5378
|
});
|
|
5379
5379
|
function cs(e, i, t) {
|
|
5380
|
-
const n =
|
|
5380
|
+
const n = O(() => {
|
|
5381
5381
|
var s, u;
|
|
5382
5382
|
return !!((u = (s = e.form.variant) == null ? void 0 : s.variantCombinations) != null && u.length);
|
|
5383
|
-
}), a =
|
|
5383
|
+
}), a = O(() => n.value && t.value.bindToVariant), o = O(() => {
|
|
5384
5384
|
var s;
|
|
5385
5385
|
return [
|
|
5386
5386
|
{
|
|
@@ -5401,7 +5401,7 @@ function cs(e, i, t) {
|
|
|
5401
5401
|
}
|
|
5402
5402
|
}
|
|
5403
5403
|
];
|
|
5404
|
-
}), r =
|
|
5404
|
+
}), r = O(() => {
|
|
5405
5405
|
var u;
|
|
5406
5406
|
const s = (((u = e.form.variant) == null ? void 0 : u.variantCombinations) || []).map((d, c) => ({
|
|
5407
5407
|
key: d.combinationKey || "",
|
|
@@ -5417,7 +5417,7 @@ function cs(e, i, t) {
|
|
|
5417
5417
|
}
|
|
5418
5418
|
}));
|
|
5419
5419
|
return [...o.value, ...s];
|
|
5420
|
-
}), l =
|
|
5420
|
+
}), l = O(
|
|
5421
5421
|
() => a.value ? r.value : o.value
|
|
5422
5422
|
);
|
|
5423
5423
|
return {
|
|
@@ -5444,12 +5444,12 @@ const ds = {
|
|
|
5444
5444
|
setup(e, {
|
|
5445
5445
|
emit: i
|
|
5446
5446
|
}) {
|
|
5447
|
-
const t = e, n = ye(), a =
|
|
5447
|
+
const t = e, n = ye(), a = O(() => n.rules.item), o = qe(Xe($e())), {
|
|
5448
5448
|
t: r
|
|
5449
5449
|
} = pe(), l = i, {
|
|
5450
5450
|
hasVariant: s,
|
|
5451
5451
|
takeaways: u
|
|
5452
|
-
} = cs(t, l, a), d =
|
|
5452
|
+
} = cs(t, l, a), d = O(() => [t.isOverride ? {
|
|
5453
5453
|
label: r("menu.product.form.takeaway.options.follows_main"),
|
|
5454
5454
|
value: null
|
|
5455
5455
|
} : {
|
|
@@ -5506,7 +5506,7 @@ const ds = {
|
|
|
5506
5506
|
})
|
|
5507
5507
|
});
|
|
5508
5508
|
}
|
|
5509
|
-
}]), m =
|
|
5509
|
+
}]), m = O(() => {
|
|
5510
5510
|
const b = n.state.featureFlags.showTakeawayAvailability, _ = n.rules.item.takeawayConfig;
|
|
5511
5511
|
return {
|
|
5512
5512
|
app: _ && b.app,
|
|
@@ -5523,13 +5523,13 @@ const ds = {
|
|
|
5523
5523
|
l("update:form", "takeawayConfig", C);
|
|
5524
5524
|
};
|
|
5525
5525
|
}
|
|
5526
|
-
const v =
|
|
5526
|
+
const v = O({
|
|
5527
5527
|
get() {
|
|
5528
5528
|
var b;
|
|
5529
5529
|
return ((b = t.form.takeawayConfig) == null ? void 0 : b.pos) ?? !0;
|
|
5530
5530
|
},
|
|
5531
5531
|
set: p("pos")
|
|
5532
|
-
}), y =
|
|
5532
|
+
}), y = O({
|
|
5533
5533
|
get() {
|
|
5534
5534
|
var b;
|
|
5535
5535
|
return ((b = t.form.takeawayConfig) == null ? void 0 : b.app) ?? !0;
|
|
@@ -5537,19 +5537,19 @@ const ds = {
|
|
|
5537
5537
|
set: p("app")
|
|
5538
5538
|
});
|
|
5539
5539
|
return (b, _) => {
|
|
5540
|
-
const f =
|
|
5541
|
-
return
|
|
5540
|
+
const f = B("FmCheckbox"), C = B("fm-table");
|
|
5541
|
+
return M(), H(Le, {
|
|
5542
5542
|
title: h(r)("menu.product.form.takeaway.title"),
|
|
5543
5543
|
"sub-title": h(r)("menu.product.form.takeaway.subtitle")
|
|
5544
5544
|
}, {
|
|
5545
|
-
default: P(() => [D("div", ds, [m.value.pos ? (
|
|
5545
|
+
default: P(() => [D("div", ds, [m.value.pos ? (M(), H(f, {
|
|
5546
5546
|
key: 0,
|
|
5547
5547
|
modelValue: v.value,
|
|
5548
5548
|
"onUpdate:modelValue": _[0] || (_[0] = (G) => v.value = G),
|
|
5549
5549
|
label: h(r)("menu.product.form.takeaway.takeawayConfig.pos.label"),
|
|
5550
5550
|
sublabel: h(r)("menu.product.form.takeaway.takeawayConfig.pos.sublabel"),
|
|
5551
5551
|
value: !0
|
|
5552
|
-
}, null, 8, ["modelValue", "label", "sublabel"])) : ie("", !0), m.value.app ? (
|
|
5552
|
+
}, null, 8, ["modelValue", "label", "sublabel"])) : ie("", !0), m.value.app ? (M(), H(f, {
|
|
5553
5553
|
key: 1,
|
|
5554
5554
|
modelValue: y.value,
|
|
5555
5555
|
"onUpdate:modelValue": _[1] || (_[1] = (G) => y.value = G),
|
|
@@ -5578,7 +5578,7 @@ const ds = {
|
|
|
5578
5578
|
selectedVariants: {}
|
|
5579
5579
|
},
|
|
5580
5580
|
setup(e) {
|
|
5581
|
-
const i = Be(), { emitData: t, emitAction: n } = Pi(), a = ye(), { t: o } = pe(), r = e, l =
|
|
5581
|
+
const i = Be(), { emitData: t, emitAction: n } = Pi(), a = ye(), { t: o } = pe(), r = e, l = O(() => a.variants.map((c) => ({
|
|
5582
5582
|
label: c.name,
|
|
5583
5583
|
value: c._id,
|
|
5584
5584
|
disabled: !1
|
|
@@ -5586,8 +5586,8 @@ const ds = {
|
|
|
5586
5586
|
t(s.value), n("primary"), i.close();
|
|
5587
5587
|
};
|
|
5588
5588
|
return (c, m) => {
|
|
5589
|
-
const p =
|
|
5590
|
-
return l.value.length > 0 ? (
|
|
5589
|
+
const p = B("FmSearch"), v = B("FmCheckbox"), y = B("FmButton");
|
|
5590
|
+
return l.value.length > 0 ? (M(), ne("div", ps, [
|
|
5591
5591
|
D("div", null, [
|
|
5592
5592
|
g(p, {
|
|
5593
5593
|
autofocus: "",
|
|
@@ -5598,7 +5598,7 @@ const ds = {
|
|
|
5598
5598
|
]),
|
|
5599
5599
|
D("div", hs, [
|
|
5600
5600
|
D("div", null, [
|
|
5601
|
-
(
|
|
5601
|
+
(M(!0), ne(Me, null, Ue(l.value, (b) => (M(), ne("div", {
|
|
5602
5602
|
key: b.value
|
|
5603
5603
|
}, [
|
|
5604
5604
|
ut(g(v, {
|
|
@@ -5618,7 +5618,7 @@ const ds = {
|
|
|
5618
5618
|
D("div", fs, [
|
|
5619
5619
|
g(h(vi), null, {
|
|
5620
5620
|
default: P(({ trigger: b }) => [
|
|
5621
|
-
h(a).rules.item.variant ? (
|
|
5621
|
+
h(a).rules.item.variant ? (M(), H(y, {
|
|
5622
5622
|
key: 0,
|
|
5623
5623
|
label: h(o)("menu.common.actions.add_new_variant"),
|
|
5624
5624
|
variant: "tertiary",
|
|
@@ -5640,7 +5640,7 @@ const ds = {
|
|
|
5640
5640
|
}, null, 8, ["label"])
|
|
5641
5641
|
])
|
|
5642
5642
|
])
|
|
5643
|
-
])) : (
|
|
5643
|
+
])) : (M(), ne("div", gs, [
|
|
5644
5644
|
D("div", bs, [
|
|
5645
5645
|
D("p", ys, ce(h(o)("menu.common.empty.no_variant.title")), 1),
|
|
5646
5646
|
D("p", _s, ce(h(o)("menu.common.empty.no_variant.subtitle")), 1)
|
|
@@ -5685,156 +5685,161 @@ const ds = {
|
|
|
5685
5685
|
}) {
|
|
5686
5686
|
const t = e, n = ye(), a = ni(), o = $e(), r = Be(), {
|
|
5687
5687
|
t: l
|
|
5688
|
-
} = pe(), s = te(!1), u =
|
|
5689
|
-
function v(
|
|
5690
|
-
const
|
|
5688
|
+
} = pe(), s = te(!1), u = O(() => n.rules.item), d = O(() => u.value.minPrice && !!t.form.minPrice), c = O(() => !n.state.currentCatalogId), m = O(() => n.variants.reduce((k, S) => (k[S._id] = S, k), {})), p = i;
|
|
5689
|
+
function v(k) {
|
|
5690
|
+
const S = Ve.clone(t.form);
|
|
5691
5691
|
for (const {
|
|
5692
|
-
key:
|
|
5693
|
-
value:
|
|
5694
|
-
} of
|
|
5695
|
-
|
|
5696
|
-
p("replace:form",
|
|
5692
|
+
key: w,
|
|
5693
|
+
value: I
|
|
5694
|
+
} of k)
|
|
5695
|
+
S[w] = I;
|
|
5696
|
+
p("replace:form", S);
|
|
5697
5697
|
}
|
|
5698
|
-
function y(
|
|
5699
|
-
var
|
|
5700
|
-
const
|
|
5698
|
+
function y(k) {
|
|
5699
|
+
var w;
|
|
5700
|
+
const S = _(k.combinationKey || "");
|
|
5701
5701
|
return {
|
|
5702
|
-
...
|
|
5703
|
-
price:
|
|
5704
|
-
inventoryBindings: (
|
|
5705
|
-
takeawayUsed: (
|
|
5706
|
-
groups: (
|
|
5707
|
-
...
|
|
5702
|
+
...k,
|
|
5703
|
+
price: S == null ? void 0 : S.price,
|
|
5704
|
+
inventoryBindings: (S == null ? void 0 : S.inventoryBindings) || t.form.inventoryBindings,
|
|
5705
|
+
takeawayUsed: (S == null ? void 0 : S.takeawayUsed) || t.form.takeawayUsed,
|
|
5706
|
+
groups: (S == null ? void 0 : S.groups) || ((w = t.form.groups) == null ? void 0 : w.map((I) => ({
|
|
5707
|
+
...I,
|
|
5708
5708
|
groupKey: ""
|
|
5709
5709
|
})))
|
|
5710
5710
|
};
|
|
5711
5711
|
}
|
|
5712
5712
|
function b() {
|
|
5713
|
-
var
|
|
5713
|
+
var k;
|
|
5714
5714
|
r.open({
|
|
5715
5715
|
title: "Add variant",
|
|
5716
5716
|
contentComponent: ws,
|
|
5717
5717
|
contentComponentProps: {
|
|
5718
|
-
selectedVariants: ((
|
|
5718
|
+
selectedVariants: ((k = t.form.variant) == null ? void 0 : k.variantGroupIds) ?? []
|
|
5719
5719
|
}
|
|
5720
|
-
}).onPrimary(async (
|
|
5721
|
-
G(
|
|
5720
|
+
}).onPrimary(async (S) => {
|
|
5721
|
+
G(S, y);
|
|
5722
5722
|
});
|
|
5723
5723
|
}
|
|
5724
|
-
function _(
|
|
5725
|
-
var
|
|
5726
|
-
const
|
|
5727
|
-
return
|
|
5724
|
+
function _(k) {
|
|
5725
|
+
var F, T;
|
|
5726
|
+
const S = ((F = t.form.variant) == null ? void 0 : F.variantGroupIds) || [], w = (T = t.form.variant) == null ? void 0 : T.variantCombinations, x = k.split(/(?=variant)/g).map(($) => $.replace(/\/*$/, "")).filter(($) => S.some((A) => $.includes(A))).join("/");
|
|
5727
|
+
return w == null ? void 0 : w.find(($) => $.combinationKey === x);
|
|
5728
5728
|
}
|
|
5729
|
-
const f = (
|
|
5730
|
-
G(
|
|
5731
|
-
}, C =
|
|
5732
|
-
var
|
|
5733
|
-
return (((
|
|
5734
|
-
var
|
|
5735
|
-
const
|
|
5736
|
-
combinationKey:
|
|
5737
|
-
}) =>
|
|
5729
|
+
const f = (k) => {
|
|
5730
|
+
G(k);
|
|
5731
|
+
}, C = O(() => {
|
|
5732
|
+
var S;
|
|
5733
|
+
return (((S = t.form.variant) == null ? void 0 : S.variantCombinations) || []).map((w) => {
|
|
5734
|
+
var L, x;
|
|
5735
|
+
const I = (x = (L = t.fallback) == null ? void 0 : L.variant) == null ? void 0 : x.variantCombinations.find(({
|
|
5736
|
+
combinationKey: F
|
|
5737
|
+
}) => F === w.combinationKey);
|
|
5738
5738
|
return {
|
|
5739
|
-
...
|
|
5739
|
+
...w,
|
|
5740
|
+
// If price is disabled, we should not show the price from variant combination, but fallback to product price or price group's price.
|
|
5741
|
+
// So we set price to null to make it clear that price is disabled for this variant combination.
|
|
5742
|
+
...R.value && {
|
|
5743
|
+
price: null
|
|
5744
|
+
},
|
|
5740
5745
|
fallback: {
|
|
5741
|
-
...
|
|
5742
|
-
_id:
|
|
5743
|
-
combinationKey:
|
|
5744
|
-
price: c.value ? t.form.price ?? (
|
|
5745
|
-
minPrice: t.form.minPrice ?? (
|
|
5746
|
+
...I,
|
|
5747
|
+
_id: w._id,
|
|
5748
|
+
combinationKey: w.combinationKey,
|
|
5749
|
+
price: c.value ? t.form.price ?? (I == null ? void 0 : I.price) : R.value ? I == null ? void 0 : I.price : w.price,
|
|
5750
|
+
minPrice: t.form.minPrice ?? (I == null ? void 0 : I.minPrice),
|
|
5746
5751
|
priceTiers: t.form.priceTiers
|
|
5747
5752
|
}
|
|
5748
5753
|
};
|
|
5749
5754
|
});
|
|
5750
5755
|
});
|
|
5751
|
-
function G(
|
|
5752
|
-
var
|
|
5753
|
-
const
|
|
5754
|
-
let
|
|
5755
|
-
if (
|
|
5756
|
-
const
|
|
5757
|
-
combinationKey:
|
|
5756
|
+
function G(k, S = (w) => w) {
|
|
5757
|
+
var L;
|
|
5758
|
+
const w = k.filter((x) => !!x);
|
|
5759
|
+
let I;
|
|
5760
|
+
if (w.length) {
|
|
5761
|
+
const x = w.map((T) => n.variants.find(($) => $._id === T)), F = Ee.fullVariantCombination(x).map(({
|
|
5762
|
+
combinationKey: T
|
|
5758
5763
|
}) => {
|
|
5759
|
-
var
|
|
5760
|
-
const
|
|
5761
|
-
return
|
|
5764
|
+
var A;
|
|
5765
|
+
const $ = (A = t.form.variant) == null ? void 0 : A.variantCombinations.find((z) => z.combinationKey === T);
|
|
5766
|
+
return S($ || {
|
|
5762
5767
|
_id: t.form._id,
|
|
5763
|
-
combinationKey:
|
|
5768
|
+
combinationKey: T
|
|
5764
5769
|
});
|
|
5765
5770
|
});
|
|
5766
|
-
if (
|
|
5771
|
+
if (F.length > 100) {
|
|
5767
5772
|
o.open({
|
|
5768
5773
|
type: "error",
|
|
5769
5774
|
message: "'Combinations of variant should not be more than 100'"
|
|
5770
5775
|
});
|
|
5771
5776
|
return;
|
|
5772
5777
|
}
|
|
5773
|
-
|
|
5778
|
+
I = {
|
|
5774
5779
|
...t.form,
|
|
5775
5780
|
variant: {
|
|
5776
|
-
variantGroupIds:
|
|
5777
|
-
variantCombinations:
|
|
5781
|
+
variantGroupIds: w,
|
|
5782
|
+
variantCombinations: F
|
|
5778
5783
|
},
|
|
5779
5784
|
inventoryBindings: null,
|
|
5780
5785
|
takeawayUsed: null
|
|
5781
5786
|
};
|
|
5782
5787
|
} else {
|
|
5783
|
-
const
|
|
5788
|
+
const x = (L = t.form.variant) == null ? void 0 : L.variantCombinations.map((T) => T.takeawayUsed), F = [...new Set(x)];
|
|
5784
5789
|
v([{
|
|
5785
5790
|
key: "variant",
|
|
5786
5791
|
value: void 0
|
|
5787
5792
|
}, {
|
|
5788
5793
|
key: "takeawayUsed",
|
|
5789
|
-
value:
|
|
5790
|
-
}]),
|
|
5794
|
+
value: F.length === 1 ? F[0] : null
|
|
5795
|
+
}]), I = {
|
|
5791
5796
|
...t.form,
|
|
5792
5797
|
variant: void 0,
|
|
5793
|
-
takeawayUsed:
|
|
5798
|
+
takeawayUsed: F.length === 1 ? F[0] : null
|
|
5794
5799
|
};
|
|
5795
5800
|
}
|
|
5796
|
-
p("replace:form", a.initDynamicGroupItem(
|
|
5801
|
+
p("replace:form", a.initDynamicGroupItem(I));
|
|
5797
5802
|
}
|
|
5798
|
-
async function
|
|
5799
|
-
const
|
|
5800
|
-
|
|
5803
|
+
async function N(k, S, w) {
|
|
5804
|
+
const I = Ve.clone(t.form);
|
|
5805
|
+
I.variant.variantCombinations[k][S] = w, v([{
|
|
5801
5806
|
key: "variant",
|
|
5802
|
-
value:
|
|
5807
|
+
value: I.variant
|
|
5803
5808
|
}]);
|
|
5804
5809
|
}
|
|
5805
|
-
const W =
|
|
5806
|
-
var
|
|
5807
|
-
return ((
|
|
5808
|
-
}), R =
|
|
5810
|
+
const W = O(() => {
|
|
5811
|
+
var k, S;
|
|
5812
|
+
return ((k = n.currentCatalog) == null ? void 0 : k.priceTierRules) ?? ((S = n.currentCatalog) == null ? void 0 : S.usePriceTiers) ?? [];
|
|
5813
|
+
}), R = O(() => W.value.length > 0 && n.currentCatalog && !n.currentScheduler), V = O(() => [{
|
|
5809
5814
|
accessorKey: "combinationKey",
|
|
5810
5815
|
header: () => l("menu.product.form.variant.columns.variant"),
|
|
5811
5816
|
enableSorting: !1,
|
|
5812
|
-
cell: (
|
|
5817
|
+
cell: (k) => t.fullCombinations[k.getValue()]
|
|
5813
5818
|
}, {
|
|
5814
5819
|
accessorKey: "code",
|
|
5815
5820
|
header: () => l("menu.product.form.variant.columns.code"),
|
|
5816
5821
|
enableSorting: !1,
|
|
5817
|
-
cell: (
|
|
5818
|
-
var
|
|
5819
|
-
const
|
|
5822
|
+
cell: (k) => {
|
|
5823
|
+
var x, F;
|
|
5824
|
+
const S = k.getValue(), w = k.row.original, L = ((x = w.fallback) == null ? void 0 : x.code) ?? t.form.code ?? ((F = t.fallback) == null ? void 0 : F.code);
|
|
5820
5825
|
return g(Ae.FmTextField, {
|
|
5821
|
-
modelValue:
|
|
5822
|
-
placeholder:
|
|
5823
|
-
rules: [(
|
|
5824
|
-
const
|
|
5825
|
-
var
|
|
5826
|
-
if (!n.state.featureFlags.uniqueProductCode ||
|
|
5827
|
-
let
|
|
5828
|
-
return
|
|
5829
|
-
|
|
5830
|
-
}),
|
|
5826
|
+
modelValue: S,
|
|
5827
|
+
placeholder: L || l("menu.product.form.variant.placeholders.no_code"),
|
|
5828
|
+
rules: [(T) => {
|
|
5829
|
+
const $ = T, A = O(() => {
|
|
5830
|
+
var j;
|
|
5831
|
+
if (!n.state.featureFlags.uniqueProductCode || !$) return 0;
|
|
5832
|
+
let z = n.itemCodeMap.get($) || 0;
|
|
5833
|
+
return w.code === $ && z > 0 && (z -= 1), $ === L && (z += 1), (j = t.form.variant) == null || j.variantCombinations.forEach((q) => {
|
|
5834
|
+
q.combinationKey !== w.combinationKey && q.code === $ && (z += 1);
|
|
5835
|
+
}), z;
|
|
5831
5836
|
});
|
|
5832
|
-
return s.value &&
|
|
5833
|
-
count:
|
|
5837
|
+
return s.value && A.value > 0 ? l("menu.product.form.detail.fields.code.duplicate_warning", {
|
|
5838
|
+
count: A.value
|
|
5834
5839
|
}) : !0;
|
|
5835
5840
|
}],
|
|
5836
|
-
"onUpdate:model-value": (
|
|
5837
|
-
|
|
5841
|
+
"onUpdate:model-value": (T) => {
|
|
5842
|
+
N(k.row.index, "code", cn(T, !0));
|
|
5838
5843
|
}
|
|
5839
5844
|
}, null);
|
|
5840
5845
|
}
|
|
@@ -5842,17 +5847,17 @@ const ds = {
|
|
|
5842
5847
|
accessorKey: "orderFrom",
|
|
5843
5848
|
header: () => l("menu.product.form.variant.columns.order_from"),
|
|
5844
5849
|
enableSorting: !1,
|
|
5845
|
-
cell: (
|
|
5846
|
-
var
|
|
5847
|
-
const
|
|
5850
|
+
cell: (k) => {
|
|
5851
|
+
var L, x;
|
|
5852
|
+
const S = k.getValue(), I = (L = k.row.original.fallback) == null ? void 0 : L.orderFrom;
|
|
5848
5853
|
return g(ii, {
|
|
5849
|
-
modelValue:
|
|
5850
|
-
fallback: t.form.orderFrom ??
|
|
5854
|
+
modelValue: S,
|
|
5855
|
+
fallback: t.form.orderFrom ?? I ?? ((x = t.fallback) == null ? void 0 : x.orderFrom),
|
|
5851
5856
|
disable: !u.value.orderFrom,
|
|
5852
5857
|
required: u.value.orderFrom && u.value.orderFromActiveOnly,
|
|
5853
5858
|
editActiveOnly: u.value.orderFromActiveOnly || !1,
|
|
5854
|
-
"onUpdate:model-value": (
|
|
5855
|
-
|
|
5859
|
+
"onUpdate:model-value": (F) => {
|
|
5860
|
+
N(k.row.index, "orderFrom", F);
|
|
5856
5861
|
},
|
|
5857
5862
|
label: "",
|
|
5858
5863
|
defaultLabel: "Follow general"
|
|
@@ -5863,60 +5868,60 @@ const ds = {
|
|
|
5863
5868
|
header: () => l("menu.product.form.variant.columns.price"),
|
|
5864
5869
|
size: 200,
|
|
5865
5870
|
enableSorting: !1,
|
|
5866
|
-
cell: (
|
|
5867
|
-
var
|
|
5868
|
-
const
|
|
5871
|
+
cell: (k) => {
|
|
5872
|
+
var x, F, T;
|
|
5873
|
+
const S = k.getValue(), w = k.row.original, L = ((x = w.fallback) == null ? void 0 : x.price) ?? t.form.price ?? ((F = t.fallback) == null ? void 0 : F.price);
|
|
5869
5874
|
return g("div", {
|
|
5870
5875
|
class: "flex items-center gap-8"
|
|
5871
5876
|
}, [g(et, {
|
|
5872
|
-
disable:
|
|
5873
|
-
placeholder:
|
|
5874
|
-
modelValue:
|
|
5877
|
+
disable: R.value,
|
|
5878
|
+
placeholder: L ? at(L) : void 0,
|
|
5879
|
+
modelValue: S,
|
|
5875
5880
|
min: 0,
|
|
5876
|
-
"onUpdate:model-value": (
|
|
5877
|
-
|
|
5881
|
+
"onUpdate:model-value": ($) => {
|
|
5882
|
+
N(k.row.index, "price", $);
|
|
5878
5883
|
},
|
|
5879
5884
|
nullable: !0,
|
|
5880
5885
|
showCurrency: !1
|
|
5881
5886
|
}, null), n.isV4 && !t.isOverride && g(pn, {
|
|
5882
|
-
"price-tiers":
|
|
5883
|
-
fallback: (
|
|
5884
|
-
"onUpdate:price-tiers": (
|
|
5887
|
+
"price-tiers": w.priceTiers,
|
|
5888
|
+
fallback: (T = w.fallback) == null ? void 0 : T.priceTiers,
|
|
5889
|
+
"onUpdate:price-tiers": ($) => N(k.row.index, "priceTiers", $)
|
|
5885
5890
|
}, null)]);
|
|
5886
5891
|
}
|
|
5887
5892
|
}, {
|
|
5888
5893
|
accessorKey: "minPrice",
|
|
5889
5894
|
header: () => l("menu.product.form.variant.columns.min_price"),
|
|
5890
5895
|
enableSorting: !1,
|
|
5891
|
-
cell: (
|
|
5892
|
-
var
|
|
5893
|
-
const
|
|
5896
|
+
cell: (k) => {
|
|
5897
|
+
var x, F, T;
|
|
5898
|
+
const S = k.getValue(), w = k.row.original, L = ((x = w.fallback) == null ? void 0 : x.minPrice) ?? t.form.minPrice ?? ((F = t.fallback) == null ? void 0 : F.minPrice);
|
|
5894
5899
|
return g(et, {
|
|
5895
|
-
placeholder:
|
|
5896
|
-
modelValue:
|
|
5897
|
-
max: xe.Dinero.fromFdoDinero(
|
|
5898
|
-
"onUpdate:model-value": (
|
|
5899
|
-
|
|
5900
|
+
placeholder: L ? at(L) : void 0,
|
|
5901
|
+
modelValue: S,
|
|
5902
|
+
max: xe.Dinero.fromFdoDinero(w.price ?? ((T = w.fallback) == null ? void 0 : T.price) ?? xe.Dinero.zero().toObject()).toUnit(),
|
|
5903
|
+
"onUpdate:model-value": ($) => {
|
|
5904
|
+
N(k.row.index, "minPrice", $);
|
|
5900
5905
|
},
|
|
5901
5906
|
nullable: !0,
|
|
5902
5907
|
showCurrency: !1
|
|
5903
5908
|
}, null);
|
|
5904
5909
|
}
|
|
5905
|
-
}]),
|
|
5910
|
+
}]), E = O(() => ({
|
|
5906
5911
|
minPrice: d.value
|
|
5907
5912
|
}));
|
|
5908
|
-
function
|
|
5909
|
-
return
|
|
5913
|
+
function U(k) {
|
|
5914
|
+
return k != null && k.length && k.length > n.rules.item.maxVariant ? l("menu.product.form.variant.validation.max_variants", {
|
|
5910
5915
|
max: n.rules.item.maxVariant
|
|
5911
5916
|
}) : !0;
|
|
5912
5917
|
}
|
|
5913
|
-
return (
|
|
5914
|
-
const
|
|
5915
|
-
return
|
|
5918
|
+
return (k, S) => {
|
|
5919
|
+
const w = B("fm-button"), I = B("fm-icon"), L = B("FmFormGroup"), x = B("fm-table");
|
|
5920
|
+
return M(), H(Le, {
|
|
5916
5921
|
title: h(l)("menu.product.form.variant.title"),
|
|
5917
5922
|
"sub-title": h(l)("menu.product.form.variant.subtitle")
|
|
5918
5923
|
}, {
|
|
5919
|
-
"append-title": P(() => [h(n).rules.item.variant ? (
|
|
5924
|
+
"append-title": P(() => [h(n).rules.item.variant ? (M(), H(w, {
|
|
5920
5925
|
key: 0,
|
|
5921
5926
|
label: h(l)("menu.product.form.variant.add"),
|
|
5922
5927
|
variant: "secondary",
|
|
@@ -5924,15 +5929,15 @@ const ds = {
|
|
|
5924
5929
|
onClick: b
|
|
5925
5930
|
}, null, 8, ["label"])) : ie("", !0)]),
|
|
5926
5931
|
default: P(() => {
|
|
5927
|
-
var
|
|
5928
|
-
return [D("div", Ss, [g(
|
|
5929
|
-
"model-value": (
|
|
5930
|
-
rules: [
|
|
5932
|
+
var F;
|
|
5933
|
+
return [D("div", Ss, [g(L, {
|
|
5934
|
+
"model-value": (F = k.form.variant) == null ? void 0 : F.variantGroupIds,
|
|
5935
|
+
rules: [U]
|
|
5931
5936
|
}, {
|
|
5932
5937
|
default: P(() => {
|
|
5933
|
-
var
|
|
5938
|
+
var T;
|
|
5934
5939
|
return [g(h(Li), {
|
|
5935
|
-
"model-value": ((
|
|
5940
|
+
"model-value": ((T = k.form.variant) == null ? void 0 : T.variantGroupIds) ?? [],
|
|
5936
5941
|
class: "space-y-16",
|
|
5937
5942
|
group: "variants",
|
|
5938
5943
|
handle: ".handle",
|
|
@@ -5940,19 +5945,19 @@ const ds = {
|
|
|
5940
5945
|
"onUpdate:modelValue": f
|
|
5941
5946
|
}, {
|
|
5942
5947
|
item: P(({
|
|
5943
|
-
element:
|
|
5948
|
+
element: $
|
|
5944
5949
|
}) => {
|
|
5945
|
-
var
|
|
5946
|
-
return [D("div", Cs, [g(
|
|
5950
|
+
var A;
|
|
5951
|
+
return [D("div", Cs, [g(w, {
|
|
5947
5952
|
variant: h(Ze).Tertiary,
|
|
5948
5953
|
class: "handle",
|
|
5949
5954
|
"prepend-icon": "drag_handle"
|
|
5950
|
-
}, null, 8, ["variant"]), D("div", ks, [D("p", xs, ce((
|
|
5955
|
+
}, null, 8, ["variant"]), D("div", ks, [D("p", xs, ce((A = m.value[$]) == null ? void 0 : A.name), 1), g(I, {
|
|
5951
5956
|
class: "cursor-pointer",
|
|
5952
5957
|
name: "close",
|
|
5953
|
-
onClick: kt((
|
|
5954
|
-
var
|
|
5955
|
-
return G(((
|
|
5958
|
+
onClick: kt((z) => {
|
|
5959
|
+
var j;
|
|
5960
|
+
return G(((j = k.form.variant) == null ? void 0 : j.variantGroupIds.filter((q) => q !== $)) ?? []);
|
|
5956
5961
|
}, ["stop"])
|
|
5957
5962
|
}, null, 8, ["onClick"])])])];
|
|
5958
5963
|
}),
|
|
@@ -5961,11 +5966,11 @@ const ds = {
|
|
|
5961
5966
|
}),
|
|
5962
5967
|
_: 1
|
|
5963
5968
|
}, 8, ["model-value", "rules"]), g(dn, null, {
|
|
5964
|
-
default: P(() => [C.value.length ? (
|
|
5969
|
+
default: P(() => [C.value.length ? (M(), H(x, {
|
|
5965
5970
|
key: 0,
|
|
5966
5971
|
class: "w-full",
|
|
5967
|
-
"column-defs":
|
|
5968
|
-
"column-visibility":
|
|
5972
|
+
"column-defs": V.value,
|
|
5973
|
+
"column-visibility": E.value,
|
|
5969
5974
|
"page-size": C.value.length ?? 0,
|
|
5970
5975
|
"row-data": C.value ?? [],
|
|
5971
5976
|
"hide-footer": "",
|
|
@@ -6012,7 +6017,7 @@ const ds = {
|
|
|
6012
6017
|
emits: ["update:show", "submit:form"],
|
|
6013
6018
|
setup(e, { emit: i }) {
|
|
6014
6019
|
var oi, ai, ri, si, li;
|
|
6015
|
-
const t = e, n = i, a = ye(), o = pt(), { t: r } = pe(), l =
|
|
6020
|
+
const t = e, n = i, a = ye(), o = pt(), { t: r } = pe(), l = O(() => t.action === "add" ? r("menu.product.form.title.add") : r("menu.product.form.title.update")), s = O(() => a.rules.item), u = (X) => new Promise((K) => setTimeout(K, X));
|
|
6016
6021
|
ot(async () => {
|
|
6017
6022
|
t.autoShow && (await u(100), c());
|
|
6018
6023
|
});
|
|
@@ -6046,11 +6051,11 @@ const ds = {
|
|
|
6046
6051
|
immediate: !0
|
|
6047
6052
|
}
|
|
6048
6053
|
);
|
|
6049
|
-
const y = ni(), b = async ([X,
|
|
6050
|
-
a.selectCatalog(X), a.selectScheduler(
|
|
6054
|
+
const y = ni(), b = async ([X, K]) => {
|
|
6055
|
+
a.selectCatalog(X), a.selectScheduler(K), await Ei(), y.update(p.value._id), setTimeout(() => {
|
|
6051
6056
|
n("update:show", !1);
|
|
6052
6057
|
}, 100);
|
|
6053
|
-
}, _ =
|
|
6058
|
+
}, _ = O(() => {
|
|
6054
6059
|
var X;
|
|
6055
6060
|
return a.mapVariant((X = p.value.variant) == null ? void 0 : X.variantGroupIds);
|
|
6056
6061
|
}), f = te(null);
|
|
@@ -6063,28 +6068,28 @@ const ds = {
|
|
|
6063
6068
|
immediate: !0
|
|
6064
6069
|
}
|
|
6065
6070
|
);
|
|
6066
|
-
const C = (X,
|
|
6071
|
+
const C = (X, K) => {
|
|
6067
6072
|
p.value = {
|
|
6068
6073
|
...ue(p.value),
|
|
6069
|
-
[X]:
|
|
6074
|
+
[X]: K
|
|
6070
6075
|
};
|
|
6071
6076
|
};
|
|
6072
6077
|
async function G() {
|
|
6073
|
-
var X,
|
|
6074
|
-
m.value = p.value._id &&
|
|
6078
|
+
var X, K;
|
|
6079
|
+
m.value = p.value._id && N.value ? (await Wn(
|
|
6075
6080
|
a.mergedMenu,
|
|
6076
6081
|
[p.value],
|
|
6077
6082
|
a.state.menu,
|
|
6078
6083
|
(X = a.currentCatalog) == null ? void 0 : X._id,
|
|
6079
|
-
(
|
|
6084
|
+
(K = a.currentScheduler) == null ? void 0 : K._id
|
|
6080
6085
|
))[0] : void 0;
|
|
6081
6086
|
}
|
|
6082
|
-
const
|
|
6087
|
+
const N = O(
|
|
6083
6088
|
() => !!a.currentCatalog || !!a.state.currentSchedulerId
|
|
6084
|
-
), W =
|
|
6089
|
+
), W = O(() => {
|
|
6085
6090
|
var X;
|
|
6086
|
-
return
|
|
6087
|
-
}), R =
|
|
6091
|
+
return N.value ? p.value.category == "" || p.value.category == null && ((X = m.value) == null ? void 0 : X.category) == null : a.version === Y.F_MENU_VERSION.enum.v4 && p.value.category == null;
|
|
6092
|
+
}), R = O(() => o.itemAttributeSettings.value.length > 0 && !N.value);
|
|
6088
6093
|
function V() {
|
|
6089
6094
|
var he;
|
|
6090
6095
|
const X = a.getSelectedTax(
|
|
@@ -6094,11 +6099,11 @@ const ds = {
|
|
|
6094
6099
|
), me = a.taxSetting.countryTaxOptions.find((J) => J.value === X);
|
|
6095
6100
|
return me ? In(me.meta.rate) : "-";
|
|
6096
6101
|
}
|
|
6097
|
-
function
|
|
6102
|
+
function E() {
|
|
6098
6103
|
f.value = null, p.value.thumbnail = null;
|
|
6099
6104
|
}
|
|
6100
|
-
const
|
|
6101
|
-
var X,
|
|
6105
|
+
const U = O(() => {
|
|
6106
|
+
var X, K, me, he, J, ui, ci, di, mi;
|
|
6102
6107
|
return {
|
|
6103
6108
|
title: r("menu.product.form.summary.title"),
|
|
6104
6109
|
items: [
|
|
@@ -6108,7 +6113,7 @@ const ds = {
|
|
|
6108
6113
|
},
|
|
6109
6114
|
{
|
|
6110
6115
|
name: r("menu.product.form.summary.fields.name"),
|
|
6111
|
-
value: p.value.name || ((
|
|
6116
|
+
value: p.value.name || ((K = m.value) == null ? void 0 : K.name) || "-"
|
|
6112
6117
|
},
|
|
6113
6118
|
{
|
|
6114
6119
|
name: r("menu.product.form.summary.fields.category"),
|
|
@@ -6141,7 +6146,7 @@ const ds = {
|
|
|
6141
6146
|
}
|
|
6142
6147
|
]
|
|
6143
6148
|
};
|
|
6144
|
-
}),
|
|
6149
|
+
}), k = te(
|
|
6145
6150
|
p.value.category != null || !!p.value.code || !!p.value.orderFrom
|
|
6146
6151
|
);
|
|
6147
6152
|
function S(X) {
|
|
@@ -6153,15 +6158,15 @@ const ds = {
|
|
|
6153
6158
|
orderFrom: void 0
|
|
6154
6159
|
});
|
|
6155
6160
|
}
|
|
6156
|
-
const
|
|
6161
|
+
const w = O(() => {
|
|
6157
6162
|
const X = {};
|
|
6158
|
-
return a.state.menu.modules.item.forEach((
|
|
6163
|
+
return a.state.menu.modules.item.forEach((K) => {
|
|
6159
6164
|
var me;
|
|
6160
|
-
for (const [he, J] of Object.entries(
|
|
6165
|
+
for (const [he, J] of Object.entries(K.customAttributes || {}))
|
|
6161
6166
|
typeof J == "string" && J && !((me = X[he]) != null && me.includes(J)) && (X[he] = [...X[he] || [], J]);
|
|
6162
6167
|
}), X;
|
|
6163
|
-
}),
|
|
6164
|
-
function
|
|
6168
|
+
}), I = te(!!p.value.price || !!p.value.minPrice || !!p.value.costing);
|
|
6169
|
+
function L(X) {
|
|
6165
6170
|
X || (p.value = {
|
|
6166
6171
|
...p.value,
|
|
6167
6172
|
costing: void 0,
|
|
@@ -6174,12 +6179,12 @@ const ds = {
|
|
|
6174
6179
|
(X) => !!X.price || !!X.orderFrom || !!X.code
|
|
6175
6180
|
)
|
|
6176
6181
|
);
|
|
6177
|
-
function
|
|
6178
|
-
var
|
|
6182
|
+
function F(X) {
|
|
6183
|
+
var K, me, he;
|
|
6179
6184
|
X || (p.value = {
|
|
6180
6185
|
...p.value,
|
|
6181
6186
|
variant: {
|
|
6182
|
-
variantGroupIds: ((
|
|
6187
|
+
variantGroupIds: ((K = p.value.variant) == null ? void 0 : K.variantGroupIds) || [],
|
|
6183
6188
|
variantCombinations: ((he = (me = p.value.variant) == null ? void 0 : me.variantCombinations) == null ? void 0 : he.map((J) => ({
|
|
6184
6189
|
...J,
|
|
6185
6190
|
price: void 0,
|
|
@@ -6189,16 +6194,16 @@ const ds = {
|
|
|
6189
6194
|
}
|
|
6190
6195
|
});
|
|
6191
6196
|
}
|
|
6192
|
-
const
|
|
6197
|
+
const T = te(
|
|
6193
6198
|
!!p.value.inventoryBindings || (((ai = p.value.variant) == null ? void 0 : ai.variantCombinations) || []).some((X) => !!X.inventoryBindings) || !1
|
|
6194
6199
|
);
|
|
6195
|
-
function
|
|
6196
|
-
var
|
|
6200
|
+
function $(X) {
|
|
6201
|
+
var K, me, he;
|
|
6197
6202
|
X || (p.value = {
|
|
6198
6203
|
...p.value,
|
|
6199
6204
|
inventoryBindings: void 0,
|
|
6200
6205
|
variant: p.value.variant ? {
|
|
6201
|
-
variantGroupIds: ((
|
|
6206
|
+
variantGroupIds: ((K = p.value.variant) == null ? void 0 : K.variantGroupIds) || [],
|
|
6202
6207
|
variantCombinations: ((he = (me = p.value.variant) == null ? void 0 : me.variantCombinations) == null ? void 0 : he.map((J) => ({
|
|
6203
6208
|
...J,
|
|
6204
6209
|
inventoryBindings: void 0
|
|
@@ -6209,13 +6214,13 @@ const ds = {
|
|
|
6209
6214
|
const A = te(
|
|
6210
6215
|
p.value.takeawayUsed != null || (((ri = p.value.variant) == null ? void 0 : ri.variantCombinations) || []).some((X) => X.takeawayUsed != null) || !1
|
|
6211
6216
|
);
|
|
6212
|
-
function
|
|
6213
|
-
var
|
|
6217
|
+
function z(X) {
|
|
6218
|
+
var K, me;
|
|
6214
6219
|
X || (p.value = {
|
|
6215
6220
|
...p.value,
|
|
6216
6221
|
takeawayUsed: void 0,
|
|
6217
6222
|
variant: {
|
|
6218
|
-
variantGroupIds: ((
|
|
6223
|
+
variantGroupIds: ((K = p.value.variant) == null ? void 0 : K.variantGroupIds) || [],
|
|
6219
6224
|
variantCombinations: ((me = p.value.variant) == null ? void 0 : me.variantCombinations.map((he) => ({
|
|
6220
6225
|
...he,
|
|
6221
6226
|
takeawayUsed: void 0
|
|
@@ -6223,23 +6228,23 @@ const ds = {
|
|
|
6223
6228
|
}
|
|
6224
6229
|
});
|
|
6225
6230
|
}
|
|
6226
|
-
const
|
|
6227
|
-
function
|
|
6231
|
+
const j = te(!!p.value.print);
|
|
6232
|
+
function q(X) {
|
|
6228
6233
|
X || (p.value = { ...p.value, print: void 0 });
|
|
6229
6234
|
}
|
|
6230
|
-
const
|
|
6235
|
+
const Z = te(
|
|
6231
6236
|
!!((si = p.value.groups) != null && si.length) != null || (((li = p.value.variant) == null ? void 0 : li.variantCombinations) || []).some((X) => {
|
|
6232
|
-
var
|
|
6233
|
-
return !!((
|
|
6237
|
+
var K;
|
|
6238
|
+
return !!((K = X.groups) != null && K.length);
|
|
6234
6239
|
}) || !1
|
|
6235
6240
|
);
|
|
6236
6241
|
function ae(X) {
|
|
6237
|
-
var
|
|
6242
|
+
var K, me;
|
|
6238
6243
|
X || (p.value = {
|
|
6239
6244
|
...p.value,
|
|
6240
6245
|
groups: [],
|
|
6241
6246
|
variant: {
|
|
6242
|
-
variantGroupIds: ((
|
|
6247
|
+
variantGroupIds: ((K = p.value.variant) == null ? void 0 : K.variantGroupIds) || [],
|
|
6243
6248
|
variantCombinations: ((me = p.value.variant) == null ? void 0 : me.variantCombinations.map((he) => ({
|
|
6244
6249
|
...he,
|
|
6245
6250
|
groups: []
|
|
@@ -6272,22 +6277,22 @@ const ds = {
|
|
|
6272
6277
|
console.log(X);
|
|
6273
6278
|
}
|
|
6274
6279
|
});
|
|
6275
|
-
const
|
|
6280
|
+
const Q = So();
|
|
6276
6281
|
ot(() => {
|
|
6277
|
-
|
|
6282
|
+
Q.isUpdatingItem || (Q.isUpdatingItem = !0, Q.storedCatalogId = a.state.currentCatalogId, Q.storedSchedulerId = a.state.currentSchedulerId);
|
|
6278
6283
|
});
|
|
6279
6284
|
function re() {
|
|
6280
|
-
|
|
6285
|
+
Q.isUpdatingItem = !1, a.selectCatalog(Q.storedCatalogId), a.selectScheduler(Q.storedSchedulerId);
|
|
6281
6286
|
}
|
|
6282
6287
|
function ve() {
|
|
6283
|
-
|
|
6284
|
-
[
|
|
6285
|
-
[
|
|
6286
|
-
].forEach(([
|
|
6287
|
-
|
|
6288
|
+
N.value && [
|
|
6289
|
+
[k.value, S],
|
|
6290
|
+
[I.value, L]
|
|
6291
|
+
].forEach(([K, me]) => {
|
|
6292
|
+
K || me(!1);
|
|
6288
6293
|
}), n(
|
|
6289
6294
|
"submit:form",
|
|
6290
|
-
En(ue(p.value),
|
|
6295
|
+
En(ue(p.value), N.value),
|
|
6291
6296
|
f.value
|
|
6292
6297
|
), c(), re();
|
|
6293
6298
|
}
|
|
@@ -6295,7 +6300,7 @@ const ds = {
|
|
|
6295
6300
|
c(), re();
|
|
6296
6301
|
}
|
|
6297
6302
|
const { isAtMost: ct } = Di(), oe = te(null), vn = Ln(oe);
|
|
6298
|
-
return (X,
|
|
6303
|
+
return (X, K) => (M(), ne(Me, null, [
|
|
6299
6304
|
fe(X.$slots, "trigger", Sn(Cn({
|
|
6300
6305
|
trigger: c
|
|
6301
6306
|
}))),
|
|
@@ -6315,17 +6320,17 @@ const ds = {
|
|
|
6315
6320
|
onOnCancel: ke
|
|
6316
6321
|
}, {
|
|
6317
6322
|
"append-title": P(() => [
|
|
6318
|
-
h(ct)("sm") ? (
|
|
6323
|
+
h(ct)("sm") ? (M(), H(gi, {
|
|
6319
6324
|
key: 0,
|
|
6320
6325
|
variant: "dialog",
|
|
6321
|
-
title:
|
|
6322
|
-
items:
|
|
6326
|
+
title: U.value.title,
|
|
6327
|
+
items: U.value.items
|
|
6323
6328
|
}, null, 8, ["title", "items"])) : ie("", !0)
|
|
6324
6329
|
]),
|
|
6325
6330
|
default: P(() => {
|
|
6326
6331
|
var me, he;
|
|
6327
6332
|
return [
|
|
6328
|
-
h(ct)("sm") ? ie("", !0) : (
|
|
6333
|
+
h(ct)("sm") ? ie("", !0) : (M(), H(gi, {
|
|
6329
6334
|
key: 0,
|
|
6330
6335
|
class: "fixed",
|
|
6331
6336
|
style: kn({
|
|
@@ -6333,8 +6338,8 @@ const ds = {
|
|
|
6333
6338
|
left: h(vn).right + "px"
|
|
6334
6339
|
}),
|
|
6335
6340
|
variant: "full",
|
|
6336
|
-
title:
|
|
6337
|
-
items:
|
|
6341
|
+
title: U.value.title,
|
|
6342
|
+
items: U.value.items
|
|
6338
6343
|
}, null, 8, ["style", "title", "items"])),
|
|
6339
6344
|
D("div", As, [
|
|
6340
6345
|
D("div", {
|
|
@@ -6342,19 +6347,19 @@ const ds = {
|
|
|
6342
6347
|
ref: oe,
|
|
6343
6348
|
class: Fe(["flex-1 py-24 space-y-24", "xs:w-full"])
|
|
6344
6349
|
}, [
|
|
6345
|
-
v.value && (Object.keys(v.value.catalogs || {}).length > 0 || v.value.schedulers.length > 0) ? (
|
|
6350
|
+
v.value && (Object.keys(v.value.catalogs || {}).length > 0 || v.value.schedulers.length > 0) ? (M(), H(fo, {
|
|
6346
6351
|
key: 0,
|
|
6347
6352
|
"linked-status": v.value,
|
|
6348
6353
|
"onUpdate:catalogAndScheduler": b
|
|
6349
6354
|
}, null, 8, ["linked-status"])) : ie("", !0),
|
|
6350
6355
|
g(Bn, { "menu-store": h(a) }, null, 8, ["menu-store"]),
|
|
6351
6356
|
g(Qe, {
|
|
6352
|
-
toggle:
|
|
6357
|
+
toggle: k.value,
|
|
6353
6358
|
"onUpdate:toggle": [
|
|
6354
|
-
|
|
6355
|
-
|
|
6359
|
+
K[1] || (K[1] = (J) => k.value = J),
|
|
6360
|
+
K[2] || (K[2] = (J) => S(J))
|
|
6356
6361
|
],
|
|
6357
|
-
disabled: !
|
|
6362
|
+
disabled: !N.value,
|
|
6358
6363
|
description: h(r)("menu.product.form.sections.general.description"),
|
|
6359
6364
|
title: h(r)("menu.product.form.sections.general.title")
|
|
6360
6365
|
}, {
|
|
@@ -6363,18 +6368,18 @@ const ds = {
|
|
|
6363
6368
|
fallback: m.value,
|
|
6364
6369
|
form: p.value,
|
|
6365
6370
|
"is-addon": W.value,
|
|
6366
|
-
"is-override":
|
|
6371
|
+
"is-override": N.value,
|
|
6367
6372
|
"is-create": t.action === "add",
|
|
6368
6373
|
thumbnail: f.value,
|
|
6369
6374
|
"onUpdate:form": C,
|
|
6370
|
-
"onUpdate:thumbnail":
|
|
6371
|
-
"onReset:thumbnail":
|
|
6375
|
+
"onUpdate:thumbnail": K[0] || (K[0] = (J) => f.value = J),
|
|
6376
|
+
"onReset:thumbnail": E
|
|
6372
6377
|
}, null, 8, ["fallback", "form", "is-addon", "is-override", "is-create", "thumbnail"])
|
|
6373
6378
|
]),
|
|
6374
6379
|
_: 1
|
|
6375
6380
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
6376
|
-
|
|
6377
|
-
R.value ? (
|
|
6381
|
+
N.value ? ie("", !0) : (M(), ne("div", Ms)),
|
|
6382
|
+
R.value ? (M(), H(Le, {
|
|
6378
6383
|
key: 2,
|
|
6379
6384
|
title: h(r)("menu.product.form.sections.tagging.title"),
|
|
6380
6385
|
"sub-title": h(r)("menu.product.form.sections.tagging.subtitle")
|
|
@@ -6383,20 +6388,20 @@ const ds = {
|
|
|
6383
6388
|
g(h(Ti), {
|
|
6384
6389
|
entity: "item",
|
|
6385
6390
|
"model-value": p.value.customAttributes || {},
|
|
6386
|
-
"onUpdate:modelValue":
|
|
6387
|
-
"value-options":
|
|
6391
|
+
"onUpdate:modelValue": K[3] || (K[3] = (J) => C("customAttributes", J)),
|
|
6392
|
+
"value-options": w.value
|
|
6388
6393
|
}, null, 8, ["model-value", "value-options"])
|
|
6389
6394
|
]),
|
|
6390
6395
|
_: 1
|
|
6391
6396
|
}, 8, ["title", "sub-title"])) : ie("", !0),
|
|
6392
|
-
R.value ? (
|
|
6397
|
+
R.value ? (M(), ne("div", Os)) : ie("", !0),
|
|
6393
6398
|
g(Qe, {
|
|
6394
|
-
toggle:
|
|
6399
|
+
toggle: I.value,
|
|
6395
6400
|
"onUpdate:toggle": [
|
|
6396
|
-
|
|
6397
|
-
|
|
6401
|
+
K[4] || (K[4] = (J) => I.value = J),
|
|
6402
|
+
K[5] || (K[5] = (J) => L(J))
|
|
6398
6403
|
],
|
|
6399
|
-
disabled: !
|
|
6404
|
+
disabled: !N.value,
|
|
6400
6405
|
description: h(r)("menu.product.form.sections.price.description"),
|
|
6401
6406
|
title: h(r)("menu.product.form.sections.price.title")
|
|
6402
6407
|
}, {
|
|
@@ -6405,19 +6410,19 @@ const ds = {
|
|
|
6405
6410
|
fallback: m.value,
|
|
6406
6411
|
form: p.value,
|
|
6407
6412
|
"is-addon": W.value,
|
|
6408
|
-
"is-override":
|
|
6413
|
+
"is-override": N.value,
|
|
6409
6414
|
"onUpdate:form": C
|
|
6410
6415
|
}, null, 8, ["fallback", "form", "is-addon", "is-override"])
|
|
6411
6416
|
]),
|
|
6412
6417
|
_: 1
|
|
6413
6418
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
6414
|
-
s.value.print && !
|
|
6415
|
-
s.value.print ? (
|
|
6419
|
+
s.value.print && !N.value ? (M(), ne("div", Fs)) : ie("", !0),
|
|
6420
|
+
s.value.print ? (M(), H(Qe, {
|
|
6416
6421
|
key: 5,
|
|
6417
|
-
toggle:
|
|
6422
|
+
toggle: j.value,
|
|
6418
6423
|
"onUpdate:toggle": [
|
|
6419
|
-
|
|
6420
|
-
|
|
6424
|
+
K[7] || (K[7] = (J) => j.value = J),
|
|
6425
|
+
K[8] || (K[8] = (J) => q(J))
|
|
6421
6426
|
],
|
|
6422
6427
|
description: "Use a different print setting",
|
|
6423
6428
|
disabled: "",
|
|
@@ -6429,21 +6434,21 @@ const ds = {
|
|
|
6429
6434
|
form: p.value,
|
|
6430
6435
|
"full-combinations": _.value,
|
|
6431
6436
|
"is-addon": W.value,
|
|
6432
|
-
"is-override":
|
|
6437
|
+
"is-override": N.value,
|
|
6433
6438
|
"onUpdate:form": C,
|
|
6434
|
-
"onReplace:form":
|
|
6439
|
+
"onReplace:form": K[6] || (K[6] = (J) => p.value = J)
|
|
6435
6440
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6436
6441
|
]),
|
|
6437
6442
|
_: 1
|
|
6438
6443
|
}, 8, ["toggle"])) : ie("", !0),
|
|
6439
|
-
|
|
6444
|
+
N.value ? ie("", !0) : (M(), ne("div", zs)),
|
|
6440
6445
|
g(Qe, {
|
|
6441
6446
|
toggle: x.value,
|
|
6442
6447
|
"onUpdate:toggle": [
|
|
6443
|
-
|
|
6444
|
-
|
|
6448
|
+
K[10] || (K[10] = (J) => x.value = J),
|
|
6449
|
+
K[11] || (K[11] = (J) => F(J))
|
|
6445
6450
|
],
|
|
6446
|
-
disabled: !
|
|
6451
|
+
disabled: !N.value,
|
|
6447
6452
|
description: h(r)("menu.product.form.sections.variant.description"),
|
|
6448
6453
|
title: h(r)("menu.product.form.sections.variant.title")
|
|
6449
6454
|
}, {
|
|
@@ -6453,22 +6458,22 @@ const ds = {
|
|
|
6453
6458
|
form: p.value,
|
|
6454
6459
|
"full-combinations": _.value,
|
|
6455
6460
|
"is-addon": W.value,
|
|
6456
|
-
"is-override":
|
|
6461
|
+
"is-override": N.value,
|
|
6457
6462
|
"onUpdate:form": C,
|
|
6458
|
-
"onReplace:form":
|
|
6463
|
+
"onReplace:form": K[9] || (K[9] = (J) => p.value = J)
|
|
6459
6464
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6460
6465
|
]),
|
|
6461
6466
|
_: 1
|
|
6462
6467
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
6463
|
-
s.value.group && !
|
|
6464
|
-
s.value.group ? (
|
|
6468
|
+
s.value.group && !N.value ? (M(), ne("div", Is)) : ie("", !0),
|
|
6469
|
+
s.value.group ? (M(), H(Qe, {
|
|
6465
6470
|
key: 8,
|
|
6466
|
-
toggle:
|
|
6471
|
+
toggle: Z.value,
|
|
6467
6472
|
"onUpdate:toggle": [
|
|
6468
|
-
|
|
6469
|
-
|
|
6473
|
+
K[13] || (K[13] = (J) => Z.value = J),
|
|
6474
|
+
K[14] || (K[14] = (J) => ae(J))
|
|
6470
6475
|
],
|
|
6471
|
-
disabled: !
|
|
6476
|
+
disabled: !N.value,
|
|
6472
6477
|
description: "Use a different group setting",
|
|
6473
6478
|
title: "Update group"
|
|
6474
6479
|
}, {
|
|
@@ -6478,22 +6483,22 @@ const ds = {
|
|
|
6478
6483
|
form: p.value,
|
|
6479
6484
|
"full-combinations": _.value,
|
|
6480
6485
|
"is-addon": W.value,
|
|
6481
|
-
"is-override":
|
|
6486
|
+
"is-override": N.value,
|
|
6482
6487
|
"onUpdate:form": C,
|
|
6483
|
-
"onReplace:form":
|
|
6488
|
+
"onReplace:form": K[12] || (K[12] = (J) => p.value = J)
|
|
6484
6489
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6485
6490
|
]),
|
|
6486
6491
|
_: 1
|
|
6487
6492
|
}, 8, ["toggle", "disabled"])) : ie("", !0),
|
|
6488
|
-
s.value.inventory && !
|
|
6489
|
-
s.value.inventory ? (
|
|
6493
|
+
s.value.inventory && !N.value ? (M(), ne("div", Es)) : ie("", !0),
|
|
6494
|
+
s.value.inventory ? (M(), H(Qe, {
|
|
6490
6495
|
key: 10,
|
|
6491
|
-
toggle:
|
|
6496
|
+
toggle: T.value,
|
|
6492
6497
|
"onUpdate:toggle": [
|
|
6493
|
-
|
|
6494
|
-
|
|
6498
|
+
K[16] || (K[16] = (J) => T.value = J),
|
|
6499
|
+
K[17] || (K[17] = (J) => $(J))
|
|
6495
6500
|
],
|
|
6496
|
-
disabled: !
|
|
6501
|
+
disabled: !N.value,
|
|
6497
6502
|
description: h(r)("menu.product.form.sections.inventory.description"),
|
|
6498
6503
|
title: h(r)("menu.product.form.sections.inventory.title")
|
|
6499
6504
|
}, {
|
|
@@ -6503,22 +6508,22 @@ const ds = {
|
|
|
6503
6508
|
form: p.value,
|
|
6504
6509
|
"full-combinations": _.value,
|
|
6505
6510
|
"is-addon": W.value,
|
|
6506
|
-
"is-override":
|
|
6511
|
+
"is-override": N.value,
|
|
6507
6512
|
"onUpdate:form": C,
|
|
6508
|
-
"onReplace:form":
|
|
6513
|
+
"onReplace:form": K[15] || (K[15] = (J) => p.value = J)
|
|
6509
6514
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6510
6515
|
]),
|
|
6511
6516
|
_: 1
|
|
6512
6517
|
}, 8, ["toggle", "disabled", "description", "title"])) : ie("", !0),
|
|
6513
|
-
s.value.takeaway(p.value.category ?? ((me = m.value) == null ? void 0 : me.category)) && !
|
|
6514
|
-
s.value.takeaway(p.value.category ?? ((he = m.value) == null ? void 0 : he.category)) ? (
|
|
6518
|
+
s.value.takeaway(p.value.category ?? ((me = m.value) == null ? void 0 : me.category)) && !N.value ? (M(), ne("div", Ts)) : ie("", !0),
|
|
6519
|
+
s.value.takeaway(p.value.category ?? ((he = m.value) == null ? void 0 : he.category)) ? (M(), H(Qe, {
|
|
6515
6520
|
key: 12,
|
|
6516
6521
|
toggle: A.value,
|
|
6517
6522
|
"onUpdate:toggle": [
|
|
6518
|
-
|
|
6519
|
-
|
|
6523
|
+
K[19] || (K[19] = (J) => A.value = J),
|
|
6524
|
+
K[20] || (K[20] = (J) => z(J))
|
|
6520
6525
|
],
|
|
6521
|
-
disabled: !
|
|
6526
|
+
disabled: !N.value,
|
|
6522
6527
|
description: h(r)("menu.product.form.sections.takeaway.description"),
|
|
6523
6528
|
title: h(r)("menu.product.form.sections.takeaway.title")
|
|
6524
6529
|
}, {
|
|
@@ -6528,15 +6533,15 @@ const ds = {
|
|
|
6528
6533
|
form: p.value,
|
|
6529
6534
|
"full-combinations": _.value,
|
|
6530
6535
|
"is-addon": W.value,
|
|
6531
|
-
"is-override":
|
|
6536
|
+
"is-override": N.value,
|
|
6532
6537
|
"onUpdate:form": C,
|
|
6533
|
-
"onReplace:form":
|
|
6538
|
+
"onReplace:form": K[18] || (K[18] = (J) => p.value = J)
|
|
6534
6539
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6535
6540
|
]),
|
|
6536
6541
|
_: 1
|
|
6537
6542
|
}, 8, ["toggle", "disabled", "description", "title"])) : ie("", !0)
|
|
6538
6543
|
], 512),
|
|
6539
|
-
|
|
6544
|
+
K[21] || (K[21] = D("div", { class: "w-[360px] xs:hidden sm:hidden" }, null, -1))
|
|
6540
6545
|
])
|
|
6541
6546
|
];
|
|
6542
6547
|
}),
|
|
@@ -6648,8 +6653,8 @@ const ni = Oi("item-manager", () => {
|
|
|
6648
6653
|
const { container: V } = Dn(Ps, o, {
|
|
6649
6654
|
...R,
|
|
6650
6655
|
autoShow: !0,
|
|
6651
|
-
"onUpdate:show": async (
|
|
6652
|
-
|
|
6656
|
+
"onUpdate:show": async (E) => {
|
|
6657
|
+
E || (Ut(null, V), V.remove());
|
|
6653
6658
|
}
|
|
6654
6659
|
});
|
|
6655
6660
|
};
|
|
@@ -6658,21 +6663,21 @@ const ni = Oi("item-manager", () => {
|
|
|
6658
6663
|
l({
|
|
6659
6664
|
action: "add",
|
|
6660
6665
|
categoryId: R,
|
|
6661
|
-
"onSubmit:form": async (
|
|
6662
|
-
|
|
6663
|
-
const
|
|
6664
|
-
await V(
|
|
6666
|
+
"onSubmit:form": async (E, U) => {
|
|
6667
|
+
E.inventoryBindings ?? (E.inventoryBindings = []), E.inventoryBindings.length === 0 && (E.inventoryBindings = null);
|
|
6668
|
+
const k = hi();
|
|
6669
|
+
await V(E, Ce.F_OPERATION_TYPE.create, k, U);
|
|
6665
6670
|
}
|
|
6666
6671
|
});
|
|
6667
6672
|
}
|
|
6668
|
-
async function u(R, V,
|
|
6673
|
+
async function u(R, V, E) {
|
|
6669
6674
|
l({
|
|
6670
6675
|
initialForm: $s(R, V || []),
|
|
6671
6676
|
action: "update",
|
|
6672
|
-
"onSubmit:form": async (
|
|
6673
|
-
|
|
6677
|
+
"onSubmit:form": async (U) => {
|
|
6678
|
+
U.inventoryBindings ?? (U.inventoryBindings = []), U.inventoryBindings.length === 0 && (U.inventoryBindings = null), await E(
|
|
6674
6679
|
Vs(
|
|
6675
|
-
[
|
|
6680
|
+
[U],
|
|
6676
6681
|
e.state.menu,
|
|
6677
6682
|
e.state.currentCatalogId,
|
|
6678
6683
|
e.state.currentSchedulerId
|
|
@@ -6683,94 +6688,94 @@ const ni = Oi("item-manager", () => {
|
|
|
6683
6688
|
}
|
|
6684
6689
|
async function d(R) {
|
|
6685
6690
|
var S;
|
|
6686
|
-
const V = e.currentCatalog,
|
|
6687
|
-
await u(R,
|
|
6688
|
-
const
|
|
6689
|
-
(
|
|
6691
|
+
const V = e.currentCatalog, E = e.state.currentSchedulerId, U = V.override.scheduler[E] ?? {}, k = (S = U == null ? void 0 : U.items) == null ? void 0 : S.filter((w) => w._id === R._id);
|
|
6692
|
+
await u(R, k, async (w) => {
|
|
6693
|
+
const I = w.modules.catalog.find(
|
|
6694
|
+
(L) => L._id === V._id
|
|
6690
6695
|
);
|
|
6691
|
-
await new Ke(
|
|
6696
|
+
await new Ke(I, e, a.updateMenu, t).update();
|
|
6692
6697
|
});
|
|
6693
6698
|
}
|
|
6694
6699
|
async function c(R) {
|
|
6695
6700
|
const V = e.currentCatalog;
|
|
6696
|
-
await u(R, V.override.items[R._id], async (
|
|
6697
|
-
const
|
|
6698
|
-
(
|
|
6701
|
+
await u(R, V.override.items[R._id], async (E) => {
|
|
6702
|
+
const U = E.modules.catalog.find(
|
|
6703
|
+
(k) => k._id === V._id
|
|
6699
6704
|
);
|
|
6700
|
-
await new Ke(
|
|
6705
|
+
await new Ke(U, e, a.updateMenu, t).update();
|
|
6701
6706
|
});
|
|
6702
6707
|
}
|
|
6703
6708
|
async function m(R) {
|
|
6704
6709
|
const V = e.schedulers.find(
|
|
6705
|
-
(
|
|
6706
|
-
),
|
|
6707
|
-
await u(R,
|
|
6708
|
-
const
|
|
6710
|
+
(U) => U._id === e.state.currentSchedulerId
|
|
6711
|
+
), E = V.items.filter((U) => U._id === R._id);
|
|
6712
|
+
await u(R, E, async (U) => {
|
|
6713
|
+
const k = U.modules.scheduler.find(
|
|
6709
6714
|
(S) => S._id === V._id
|
|
6710
6715
|
);
|
|
6711
|
-
await new _t(
|
|
6716
|
+
await new _t(k, e, a.updateMenu, t).update();
|
|
6712
6717
|
});
|
|
6713
6718
|
}
|
|
6714
6719
|
async function p(R) {
|
|
6715
|
-
var
|
|
6716
|
-
const V = e.state.currentSchedulerId,
|
|
6717
|
-
if (
|
|
6718
|
-
const
|
|
6719
|
-
return
|
|
6720
|
+
var k, S;
|
|
6721
|
+
const V = e.state.currentSchedulerId, E = ue(e.currentCatalog), U = (S = ((k = E.override.scheduler[V]) == null ? void 0 : k.items) || []) == null ? void 0 : S.reduce((w, I) => {
|
|
6722
|
+
if (I.combinationKey) return [...w, I];
|
|
6723
|
+
const L = R.find((x) => x._id === I._id);
|
|
6724
|
+
return L ? [...w, { ...I, price: L.price }] : [...w, I];
|
|
6720
6725
|
}, []);
|
|
6721
|
-
|
|
6722
|
-
...
|
|
6726
|
+
E.override.scheduler = {
|
|
6727
|
+
...E.override.scheduler,
|
|
6723
6728
|
[V]: {
|
|
6724
|
-
...
|
|
6729
|
+
...E.override.scheduler[V],
|
|
6725
6730
|
_id: V,
|
|
6726
|
-
items:
|
|
6731
|
+
items: U
|
|
6727
6732
|
}
|
|
6728
|
-
}, await new Ke(
|
|
6733
|
+
}, await new Ke(E, e, a.updateMenu, t).update();
|
|
6729
6734
|
}
|
|
6730
6735
|
async function v(R) {
|
|
6731
|
-
var
|
|
6732
|
-
const V = ue(e.currentCatalog),
|
|
6733
|
-
(S, [
|
|
6734
|
-
const
|
|
6735
|
-
if (!
|
|
6736
|
-
return S[
|
|
6737
|
-
const x =
|
|
6738
|
-
return S[
|
|
6739
|
-
|
|
6736
|
+
var k;
|
|
6737
|
+
const V = ue(e.currentCatalog), E = (k = Object.entries(V.override.items)) == null ? void 0 : k.reduce(
|
|
6738
|
+
(S, [w, I]) => {
|
|
6739
|
+
const L = R.find((F) => F._id === w);
|
|
6740
|
+
if (!L)
|
|
6741
|
+
return S[w] = I, S;
|
|
6742
|
+
const x = I.find((F) => !F.combinationKey);
|
|
6743
|
+
return S[w] = [
|
|
6744
|
+
...I.filter((F) => !!F.combinationKey),
|
|
6740
6745
|
{
|
|
6741
6746
|
...x,
|
|
6742
|
-
code:
|
|
6743
|
-
name:
|
|
6744
|
-
price:
|
|
6745
|
-
orderFrom:
|
|
6747
|
+
code: L.code || void 0,
|
|
6748
|
+
name: L.name,
|
|
6749
|
+
price: L.price,
|
|
6750
|
+
orderFrom: L.orderFrom ?? x.orderFrom
|
|
6746
6751
|
}
|
|
6747
6752
|
], S;
|
|
6748
6753
|
},
|
|
6749
6754
|
{}
|
|
6750
|
-
), { updateMenu:
|
|
6755
|
+
), { updateMenu: U } = a;
|
|
6751
6756
|
await new Ke(
|
|
6752
6757
|
{
|
|
6753
6758
|
...V,
|
|
6754
6759
|
override: {
|
|
6755
6760
|
...V.override,
|
|
6756
|
-
items:
|
|
6761
|
+
items: E
|
|
6757
6762
|
}
|
|
6758
6763
|
},
|
|
6759
6764
|
e,
|
|
6760
|
-
|
|
6765
|
+
U,
|
|
6761
6766
|
t
|
|
6762
6767
|
).update();
|
|
6763
6768
|
}
|
|
6764
6769
|
async function y(R) {
|
|
6765
|
-
const V = ue(e.currentScheduler),
|
|
6766
|
-
if (
|
|
6767
|
-
const S = R.find((
|
|
6768
|
-
return S ? [...
|
|
6770
|
+
const V = ue(e.currentScheduler), E = V.items.reduce((U, k) => {
|
|
6771
|
+
if (k.combinationKey) return [...U, k];
|
|
6772
|
+
const S = R.find((w) => w._id === k._id);
|
|
6773
|
+
return S ? [...U, { ...k, price: S.price }] : [...U, k];
|
|
6769
6774
|
}, []);
|
|
6770
6775
|
await new _t(
|
|
6771
6776
|
{
|
|
6772
6777
|
...V,
|
|
6773
|
-
items:
|
|
6778
|
+
items: E
|
|
6774
6779
|
},
|
|
6775
6780
|
e,
|
|
6776
6781
|
a.updateMenu,
|
|
@@ -6778,25 +6783,25 @@ const ni = Oi("item-manager", () => {
|
|
|
6778
6783
|
).update();
|
|
6779
6784
|
}
|
|
6780
6785
|
async function b(R) {
|
|
6781
|
-
const V = R.reduce((
|
|
6782
|
-
const S = e.items.find((
|
|
6783
|
-
return S &&
|
|
6786
|
+
const V = R.reduce((U, k) => {
|
|
6787
|
+
const S = e.items.find((w) => w._id === k._id);
|
|
6788
|
+
return S && U.push({
|
|
6784
6789
|
...S,
|
|
6785
|
-
code:
|
|
6786
|
-
name:
|
|
6787
|
-
price:
|
|
6788
|
-
orderFrom:
|
|
6789
|
-
taxes:
|
|
6790
|
-
category:
|
|
6791
|
-
position:
|
|
6792
|
-
additionalCategories:
|
|
6793
|
-
}),
|
|
6794
|
-
}, []), { updateMenu:
|
|
6795
|
-
await
|
|
6796
|
-
V.map((
|
|
6790
|
+
code: k.code ?? S.code,
|
|
6791
|
+
name: k.name || S.name,
|
|
6792
|
+
price: k.price ?? S.price,
|
|
6793
|
+
orderFrom: k.orderFrom ?? S.orderFrom,
|
|
6794
|
+
taxes: k.taxes ?? S.taxes,
|
|
6795
|
+
category: k.category === void 0 ? S.category : k.category,
|
|
6796
|
+
position: k.position ?? S.position,
|
|
6797
|
+
additionalCategories: k.additionalCategories ?? S.additionalCategories
|
|
6798
|
+
}), U;
|
|
6799
|
+
}, []), { updateMenu: E } = a;
|
|
6800
|
+
await E(
|
|
6801
|
+
V.map((U) => ({
|
|
6797
6802
|
module: Y.F_MENU_MODULE_V4_KEY.enum.item,
|
|
6798
6803
|
operation: Ce.F_OPERATION_TYPE.update,
|
|
6799
|
-
data:
|
|
6804
|
+
data: U
|
|
6800
6805
|
})),
|
|
6801
6806
|
`${V.length} products`
|
|
6802
6807
|
);
|
|
@@ -6806,14 +6811,14 @@ const ni = Oi("item-manager", () => {
|
|
|
6806
6811
|
l({
|
|
6807
6812
|
initialForm: R,
|
|
6808
6813
|
action: "update",
|
|
6809
|
-
"onSubmit:form": async (
|
|
6810
|
-
const
|
|
6811
|
-
|
|
6814
|
+
"onSubmit:form": async (E, U) => {
|
|
6815
|
+
const k = hi(R._id);
|
|
6816
|
+
E.inventoryBindings ?? (E.inventoryBindings = []), E.inventoryBindings.length === 0 && (E.inventoryBindings = null), await V(E, Ce.F_OPERATION_TYPE.update, k, U);
|
|
6812
6817
|
}
|
|
6813
6818
|
});
|
|
6814
6819
|
}
|
|
6815
6820
|
async function f(R) {
|
|
6816
|
-
const V = e.state.menu.modules.item.find((
|
|
6821
|
+
const V = e.state.menu.modules.item.find((E) => E._id === R);
|
|
6817
6822
|
e.currentCatalog ? e.state.currentSchedulerId ? await d(V) : await c(V) : e.state.currentSchedulerId ? await m(V) : _(V);
|
|
6818
6823
|
}
|
|
6819
6824
|
async function C(R) {
|
|
@@ -6823,10 +6828,10 @@ const ni = Oi("item-manager", () => {
|
|
|
6823
6828
|
);
|
|
6824
6829
|
}
|
|
6825
6830
|
function G(R) {
|
|
6826
|
-
const { updateMenu: V } = a,
|
|
6831
|
+
const { updateMenu: V } = a, E = R.length > 1 ? `${R.length} products` : R[0].name;
|
|
6827
6832
|
t.open({
|
|
6828
6833
|
title: r("menu.common.dialog.remove.product.title"),
|
|
6829
|
-
message: r("menu.common.dialog.remove.product.message", { name:
|
|
6834
|
+
message: r("menu.common.dialog.remove.product.message", { name: E }),
|
|
6830
6835
|
primaryActions: {
|
|
6831
6836
|
text: r("menu.common.actions.remove"),
|
|
6832
6837
|
close: !0,
|
|
@@ -6838,23 +6843,23 @@ const ni = Oi("item-manager", () => {
|
|
|
6838
6843
|
}
|
|
6839
6844
|
}).onPrimary(async () => {
|
|
6840
6845
|
await V(
|
|
6841
|
-
R.map(({ _id:
|
|
6846
|
+
R.map(({ _id: U }) => ({
|
|
6842
6847
|
module: Y.F_MENU_MODULE_V4_KEY.enum.item,
|
|
6843
6848
|
operation: Ce.F_OPERATION_TYPE.delete,
|
|
6844
|
-
data:
|
|
6849
|
+
data: U
|
|
6845
6850
|
})),
|
|
6846
|
-
|
|
6851
|
+
E,
|
|
6847
6852
|
!0
|
|
6848
6853
|
);
|
|
6849
|
-
for (const
|
|
6850
|
-
|
|
6854
|
+
for (const U of R)
|
|
6855
|
+
U.thumbnail && await Tn.delete(U.thumbnail);
|
|
6851
6856
|
i.open({
|
|
6852
6857
|
message: r("menu.common.dialog.remove.product.success"),
|
|
6853
6858
|
type: "success"
|
|
6854
6859
|
});
|
|
6855
6860
|
});
|
|
6856
6861
|
}
|
|
6857
|
-
async function
|
|
6862
|
+
async function N(R) {
|
|
6858
6863
|
e.currentScheduler ? await new _t(
|
|
6859
6864
|
e.currentScheduler,
|
|
6860
6865
|
e,
|
|
@@ -6883,7 +6888,7 @@ const ni = Oi("item-manager", () => {
|
|
|
6883
6888
|
create: s,
|
|
6884
6889
|
update: f,
|
|
6885
6890
|
updateMany: C,
|
|
6886
|
-
deleteItem:
|
|
6891
|
+
deleteItem: N,
|
|
6887
6892
|
rearrange: W
|
|
6888
6893
|
};
|
|
6889
6894
|
});
|