@feedmepos/mf-menu 0.23.8 → 0.23.9
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-BeKJ9IOz.js → App-DtqKFa-M.js} +4 -4
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-vtR4Fvpy.js → ApplyProduct.vue_vue_type_script_setup_true_lang-DMqELa0a.js} +2 -2
- package/dist/{Catalog-B0mHwkh9.js → Catalog-Bx46vALl.js} +5 -5
- package/dist/{Category-NHUFeykQ.js → Category-DGtEAdJZ.js} +5 -5
- package/dist/{CookingGuide-B8Sd_KQy.js → CookingGuide-b7YyO9Uy.js} +4 -4
- package/dist/{Group-fOaAlLbj.js → Group-BTUGQYMx.js} +1 -1
- package/dist/{Group-CB3ddgwt.js → Group-COCWh9QO.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-CpBa8jtg.js → Group.vue_vue_type_script_setup_true_lang-DCivMxe6.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-mmttyFQ_.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BBJaNNDB.js} +2 -2
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CNNaRS7z.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-OyB5MZ6E.js} +6 -6
- package/dist/{Ingredient-C0VZiyVj.js → Ingredient-CRoJXhJg.js} +4 -4
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-BadspHhf.js → InventoryBinding.vue_vue_type_script_setup_true_lang-BWZziQhN.js} +23 -23
- package/dist/{LinkProductSideSheet-BNptv32c.js → LinkProductSideSheet-DCbv5LOb.js} +2 -2
- package/dist/{MenuSetting-CFUgBwGz.js → MenuSetting-0MA-y5Uo.js} +2 -2
- package/dist/{PrintRoute-Ckm1rauF.js → PrintRoute-C8UqmCC-.js} +4 -4
- package/dist/{Product-B1JbnC0z.js → Product-BLaiwDHh.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-C0k2Eh4v.js → Product.vue_vue_type_script_setup_true_lang-RudSoGAO.js} +10 -10
- package/dist/{Products-DKKVUIEJ.js → Products-CGSNvUUN.js} +8 -8
- package/dist/{Publish-DKGu2HDv.js → Publish-DorH8Kkg.js} +3 -3
- package/dist/{Recipe-CCl0hqMy.js → Recipe-3PKNbSja.js} +5 -5
- package/dist/{Scheduler-BPaHC6Wj.js → Scheduler-DQp8JrtH.js} +3 -3
- package/dist/{SchedulerSelector.vue_vue_type_script_setup_true_lang-wlgFnvqA.js → SchedulerSelector.vue_vue_type_script_setup_true_lang-D--M_zHZ.js} +1 -1
- package/dist/{ServingSequence-C4LlF7Hy.js → ServingSequence-D_nZTbyM.js} +3 -3
- package/dist/{Setting-DQSoNPn6.js → Setting-CQNoA3wW.js} +4 -4
- package/dist/{Takeaway-Cjw0J0x3.js → Takeaway-B9Wb5yaU.js} +1 -1
- package/dist/{Takeaway-B-SSlfnU.js → Takeaway-sTbaVafp.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-BM78kV4o.js → Takeaway.vue_vue_type_script_setup_true_lang-CMqg7VPL.js} +5 -5
- package/dist/{Unit-DYiVlP9f.js → Unit-ktOnE-cI.js} +2 -2
- package/dist/{Variant-UxLzw7b7.js → Variant-AoSfk5Rq.js} +3 -3
- package/dist/{_id_-DS5LdSKM.js → _id_-C1wv42CB.js} +7 -7
- package/dist/{app-DR0waiLb.js → app-BZMBFu8I.js} +1 -1
- package/dist/{app-scj4Ofmx.js → app-cqyYeBCV.js} +117 -117
- package/dist/app.js +1 -1
- package/dist/assets/{linked-status-u7nqjfkc.js → linked-status-Dt294ozy.js} +3 -3
- package/dist/assets/{override-menu-C9R4zCW6.js → override-menu-BLgReVRT.js} +3 -3
- package/dist/assets/{validate-menu-E2Wi-jtn.js → validate-menu-DVcfUeaF.js} +8 -8
- package/dist/{catalog-CEyRJOiB.js → catalog-Xy4edEu0.js} +1 -1
- package/dist/{catalogSetting-CKKSTfei.js → catalogSetting-Dj4uJ6ap.js} +1 -1
- package/dist/{currency-B_npZioU.js → currency-D47utL_H.js} +1 -1
- package/dist/{discardConfirm-BV12-j-L.js → discardConfirm-DrKZ0dlv.js} +1 -1
- package/dist/{index-CAtUBOax.js → index-BMRkuLfJ.js} +4 -4
- package/dist/{index-DzzBCpZZ.js → index-Cj8NFmQq.js} +3 -3
- package/dist/{item-CVA2onis.js → item-CZZFhIzx.js} +258 -258
- package/dist/{menu-Cf_K80hJ.js → menu-2uZhJ8-G.js} +1 -1
- package/dist/{menu-dJAe59ow.js → menu-cH-dKOpr.js} +175 -175
- package/dist/remy-CmV80QtE.js +37 -0
- package/dist/{scheduler-C9hgrKJq.js → scheduler-B6inGG_h.js} +4 -4
- package/dist/{toExcel-C_EQEymt.js → toExcel-DKWtLi4q.js} +2 -2
- package/dist/{unit-CqaDTFDp.js → unit-BY8M4FGB.js} +2 -2
- package/package.json +1 -1
- package/dist/remy-BK-ZlMqV.js +0 -37
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { defineStore as Pi } from "pinia";
|
|
2
|
-
import { openBlock as O, createElementBlock as Q, createElementVNode as P, defineComponent as ue, resolveComponent as G, toDisplayString as de, createVNode as w, Fragment as
|
|
3
|
-
import { G as B, J as pe, Y as Rn, a0 as xn, a1 as
|
|
2
|
+
import { openBlock as O, createElementBlock as Q, createElementVNode as P, defineComponent as ue, resolveComponent as G, toDisplayString as de, createVNode as w, Fragment as ke, renderList as Ye, createBlock as Y, h as he, ref as J, computed as F, watch as Re, unref as p, renderSlot as ve, withCtx as L, createCommentVNode as te, Transition as bn, resolveDynamicComponent as St, withDirectives as Qe, vShow as At, mergeProps as Ti, withModifiers as Rt, createTextVNode as Ct, normalizeClass as Le, onMounted as ut, resolveDirective as Nt, nextTick as Ui, onBeforeUnmount as yn, normalizeProps as _n, guardReactiveProps as wn, normalizeStyle as Sn, getCurrentInstance as Cn, render as An } from "vue";
|
|
3
|
+
import { G as B, J as pe, Y as Rn, a0 as xn, a1 as Mn, H as ne, z as Se, B as Ae, a2 as Vi, u as fe, a3 as $i, a4 as bi, A as He, K as Xe, U as kn, a5 as On, V as Et, W as zn, a6 as yi, a7 as En } from "./menu-cH-dKOpr.js";
|
|
4
4
|
import { useI18n as me, useCoreStore as Zt, CustomAttributesForm as Fn } from "@feedmepos/mf-common";
|
|
5
5
|
import { useDialog as Be, useDialogChild as Jt, useSnackbar as De, components as xe, FmButtonColorThemeVariant as je, FmButtonVariant as qe, useBreakpoints as Ni } from "@feedmepos/ui-library";
|
|
6
|
-
import { C as Ue } from "./catalog-
|
|
6
|
+
import { C as Ue } from "./catalog-Xy4edEu0.js";
|
|
7
7
|
import { u as In, c as Dn } from "./search-7ZYHUW7s.js";
|
|
8
|
-
import { p as Qt, u as Pn } from "./app-
|
|
8
|
+
import { p as Qt, u as Pn } from "./app-cqyYeBCV.js";
|
|
9
9
|
import { _ as _i, a as Li } from "./tooltip-DpokWKto.js";
|
|
10
10
|
import { _ as st } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
11
11
|
import { _ as Ke, a as Tn } from "./FormSection.vue_vue_type_script_setup_true_lang-BWJUD8NZ.js";
|
|
12
12
|
import { s as Lt, F as Un } from "./object-DNBFWMt7.js";
|
|
13
|
-
import { l as $e, u as Bi } from "./discardConfirm-
|
|
14
|
-
import { R as Ne } from "./remy-
|
|
13
|
+
import { l as $e, u as Bi } from "./discardConfirm-DrKZ0dlv.js";
|
|
14
|
+
import { R as Ne } from "./remy-CmV80QtE.js";
|
|
15
15
|
import { _ as nt } from "./FormItem.vue_vue_type_script_setup_true_lang-DKsxEK-8.js";
|
|
16
|
-
import { _ as it, l as Bt, T as Vn } from "./index-
|
|
16
|
+
import { _ as it, l as Bt, T as Vn } from "./index-BMRkuLfJ.js";
|
|
17
17
|
import { useInventoryStore as Ki, InventoryBindingForm as $n, InventoryBindingSummary as Nn } from "@feedmepos/mf-inventory-portal";
|
|
18
18
|
import { c as pt } from "./check-C9mY6LiX.js";
|
|
19
|
-
import { L as Ln } from "./LinkProductSideSheet-
|
|
20
|
-
import { f as mt } from "./currency-
|
|
19
|
+
import { L as Ln } from "./LinkProductSideSheet-DCbv5LOb.js";
|
|
20
|
+
import { f as mt } from "./currency-D47utL_H.js";
|
|
21
21
|
import { c as Bn } from "./string-DpfFixWH.js";
|
|
22
22
|
import { V as Gi } from "./vuedraggable-WU01qJgi.js";
|
|
23
|
-
import { _ as Kn } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-
|
|
24
|
-
import { V as wi } from "./index-
|
|
23
|
+
import { _ as Kn } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-DMqELa0a.js";
|
|
24
|
+
import { V as wi } from "./index-Cj8NFmQq.js";
|
|
25
25
|
class _t {
|
|
26
26
|
constructor(i, t, n, a) {
|
|
27
27
|
this.scheduler = i, this.menuStore = t, this.updateMenu = n, this.dialog = a;
|
|
@@ -222,7 +222,7 @@ class _t {
|
|
|
222
222
|
const i = xn(
|
|
223
223
|
this.menuStore.variants,
|
|
224
224
|
this.menuStore.categories,
|
|
225
|
-
|
|
225
|
+
Mn(this.menuStore.state.menu.modules.item, (a) => a.code || a.name)
|
|
226
226
|
), t = new Set(
|
|
227
227
|
this.menuStore.currentCatalog ? Ue.getItemAvailable(this.menuStore.currentCatalog) : this.menuStore.state.menu.modules.item.map((a) => a._id)
|
|
228
228
|
);
|
|
@@ -367,14 +367,14 @@ class Wi {
|
|
|
367
367
|
const n = this.getFallbackPrices(i), a = this.menuStore.state.menu.modules.item, o = this.menuStore.state.menu.modules.group, r = this.menuStore.items;
|
|
368
368
|
function l(s, u) {
|
|
369
369
|
const c = s.items.reduce((h, m) => {
|
|
370
|
-
var D,
|
|
370
|
+
var D, k, y, g;
|
|
371
371
|
const b = a.find((C) => m._id === C._id);
|
|
372
372
|
if (!b && t) return h;
|
|
373
373
|
const v = m.combinationKey ? {
|
|
374
374
|
...(D = b == null ? void 0 : b.variant) == null ? void 0 : D.variantCombinations.find(
|
|
375
375
|
(C) => C.combinationKey === m.combinationKey
|
|
376
376
|
),
|
|
377
|
-
name: Vi(fe().variants, ((
|
|
377
|
+
name: Vi(fe().variants, ((k = b == null ? void 0 : b.variant) == null ? void 0 : k.variantGroupIds) || [])[m.combinationKey]
|
|
378
378
|
} : b, f = (y = o.find((C) => C._id === s._id)) == null ? void 0 : y.items.find((C) => C._id === m._id && C.combinationKey === m.combinationKey), S = !t && !m.combinationKey, z = (g = u.find(
|
|
379
379
|
(C) => C._id == m._id && C.combinationKey == m.combinationKey
|
|
380
380
|
)) == null ? void 0 : g.price, E = m.name ?? (f == null ? void 0 : f.name) ?? (v == null ? void 0 : v.name) ?? "", j = {
|
|
@@ -513,7 +513,7 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
|
|
|
513
513
|
return i.variant === "full" ? (O(), Q("div", Hn, [
|
|
514
514
|
P("div", Xn, de(a.title), 1),
|
|
515
515
|
w(Yn),
|
|
516
|
-
(O(!0), Q(
|
|
516
|
+
(O(!0), Q(ke, null, Ye(a.items, (l) => (O(), Y(_i, {
|
|
517
517
|
key: l.name,
|
|
518
518
|
name: l.name,
|
|
519
519
|
value: l.value || "--"
|
|
@@ -648,7 +648,7 @@ const Yn = /* @__PURE__ */ st(jn, [["render", Wn]]), Hn = {
|
|
|
648
648
|
}));
|
|
649
649
|
};
|
|
650
650
|
}
|
|
651
|
-
}), Ze = /* @__PURE__ */ st(uo, [["__scopeId", "data-v-e920f110"]]), co = "/assets/linked-status-
|
|
651
|
+
}), Ze = /* @__PURE__ */ st(uo, [["__scopeId", "data-v-e920f110"]]), co = "/assets/linked-status-Dt294ozy.js", mo = "/assets/override-menu-BLgReVRT.js";
|
|
652
652
|
function ho(e) {
|
|
653
653
|
var n;
|
|
654
654
|
const i = ne(e), t = (n = i.variant) == null ? void 0 : n.variantCombinations;
|
|
@@ -956,7 +956,7 @@ function Dt(e, i) {
|
|
|
956
956
|
for (var t = 0, n = new Array(i); t < i; t++) n[t] = e[t];
|
|
957
957
|
return n;
|
|
958
958
|
}
|
|
959
|
-
var Ai,
|
|
959
|
+
var Ai, Mo, ft, ge = (Ai = function(e) {
|
|
960
960
|
/*!
|
|
961
961
|
Copyright (c) 2018 Jed Watson.
|
|
962
962
|
Licensed under the MIT License (MIT), see
|
|
@@ -983,7 +983,7 @@ var Ai, ko, ft, ge = (Ai = function(e) {
|
|
|
983
983
|
}
|
|
984
984
|
e.exports ? (t.default = t, e.exports = t) : window.classNames = t;
|
|
985
985
|
})();
|
|
986
|
-
}, Ai(ft = { path:
|
|
986
|
+
}, Ai(ft = { path: Mo, exports: {}, require: function(e, i) {
|
|
987
987
|
return function() {
|
|
988
988
|
throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs");
|
|
989
989
|
}(i == null && ft.path);
|
|
@@ -1082,7 +1082,7 @@ function Zi(e, i) {
|
|
|
1082
1082
|
}
|
|
1083
1083
|
var dt = function(e, i) {
|
|
1084
1084
|
e === void 0 && (e = {}), i === void 0 && (i = {}), this.type = "manipulateImage", this.move = e, this.scale = i;
|
|
1085
|
-
},
|
|
1085
|
+
}, ko = function(e, i) {
|
|
1086
1086
|
i === void 0 && (i = {}), this.type = "resize", this.directions = e, this.params = i;
|
|
1087
1087
|
}, ti = function(e) {
|
|
1088
1088
|
this.type = "move", this.directions = e;
|
|
@@ -1192,8 +1192,8 @@ Qi.render = function(e, i, t, n, a, o) {
|
|
|
1192
1192
|
return [ve(e.$slots, "default")];
|
|
1193
1193
|
}), _: 3 }, 8, ["class"]);
|
|
1194
1194
|
};
|
|
1195
|
-
var Ie = ["left", "right", "top", "bottom"], Eo = ["left", "right"], Fo = ["top", "bottom"], Io = ["left", "top"], Do = ["fill-area", "fit-area", "stencil", "none"],
|
|
1196
|
-
function
|
|
1195
|
+
var Ie = ["left", "right", "top", "bottom"], Eo = ["left", "right"], Fo = ["top", "bottom"], Io = ["left", "top"], Do = ["fill-area", "fit-area", "stencil", "none"], Mi = { left: 0, top: 0, width: 0, height: 0 };
|
|
1196
|
+
function ki(e, i, t) {
|
|
1197
1197
|
return !(t = t || ["width", "height", "left", "top"]).some(function(n) {
|
|
1198
1198
|
return e[n] !== i[n];
|
|
1199
1199
|
});
|
|
@@ -1217,10 +1217,10 @@ function ht(e, i) {
|
|
|
1217
1217
|
function Fe(e, i) {
|
|
1218
1218
|
return { left: e.left - i.left, top: e.top - i.top, width: e.width + i.left + i.right, height: e.height + i.top + i.bottom };
|
|
1219
1219
|
}
|
|
1220
|
-
function
|
|
1220
|
+
function Mt(e) {
|
|
1221
1221
|
return { left: -e.left, top: -e.top };
|
|
1222
1222
|
}
|
|
1223
|
-
function
|
|
1223
|
+
function Me(e, i) {
|
|
1224
1224
|
return X(X({}, e), { left: e.left + i.left, top: e.top + i.top });
|
|
1225
1225
|
}
|
|
1226
1226
|
function ze(e, i, t, n) {
|
|
@@ -1259,14 +1259,14 @@ function We(e, i) {
|
|
|
1259
1259
|
var t = i * Math.PI / 180;
|
|
1260
1260
|
return { left: e.left * Math.cos(t) - e.top * Math.sin(t), top: e.left * Math.sin(t) + e.top * Math.cos(t) };
|
|
1261
1261
|
}
|
|
1262
|
-
function
|
|
1262
|
+
function kt(e, i) {
|
|
1263
1263
|
var t = ht(we(e, i), i);
|
|
1264
1264
|
return t.left + t.right + t.top + t.bottom ? t.left + t.right > t.top + t.bottom ? Math.min((e.width + t.left + t.right) / e.width, at(e, i)) : Math.min((e.height + t.top + t.bottom) / e.height, at(e, i)) : 1;
|
|
1265
1265
|
}
|
|
1266
1266
|
function we(e, i, t) {
|
|
1267
1267
|
t === void 0 && (t = !1);
|
|
1268
1268
|
var n = rt(e, i);
|
|
1269
|
-
return
|
|
1269
|
+
return Me(e, t ? Mt(n) : n);
|
|
1270
1270
|
}
|
|
1271
1271
|
function Yt(e) {
|
|
1272
1272
|
return { width: e.right !== void 0 && e.left !== void 0 ? e.right - e.left : 1 / 0, height: e.bottom !== void 0 && e.top !== void 0 ? e.bottom - e.top : 1 / 0 };
|
|
@@ -1307,8 +1307,8 @@ function Ve(e) {
|
|
|
1307
1307
|
return s && { width: s.width, height: s.height };
|
|
1308
1308
|
}
|
|
1309
1309
|
function Ht(e) {
|
|
1310
|
-
var i = e.event, t = e.coordinates, n = e.positionRestrictions, a = n === void 0 ? {} : n, o =
|
|
1311
|
-
return
|
|
1310
|
+
var i = e.event, t = e.coordinates, n = e.positionRestrictions, a = n === void 0 ? {} : n, o = Me(t, i.directions);
|
|
1311
|
+
return Me(o, rt(o, a));
|
|
1312
1312
|
}
|
|
1313
1313
|
function To(e) {
|
|
1314
1314
|
var i = e.coordinates, t = e.transform, n = e.imageSize, a = e.sizeRestrictions, o = e.positionRestrictions, r = e.aspectRatio, l = e.visibleArea, s = function(c, d) {
|
|
@@ -1330,8 +1330,8 @@ function Uo(e) {
|
|
|
1330
1330
|
e.stencilReference;
|
|
1331
1331
|
var s, u, c, d = X({}, n), h = X({}, a), m = X({}, o);
|
|
1332
1332
|
s = ae(m), u = ae(d), c === void 0 && (c = 1e-3), (s === 0 || u === 0 ? Math.abs(u - s) < c : Math.abs(u / s) < 1 + c && Math.abs(u / s) > 1 - c) || (d = X(X({}, d), Ve({ sizeRestrictions: r, width: d.width, height: d.height, aspectRatio: { minimum: ae(m), maximum: ae(m) } })));
|
|
1333
|
-
var b =
|
|
1334
|
-
return b !== 1 && (h = ze(h, b), d = ze(d, b)), h = we(h =
|
|
1333
|
+
var b = kt(h = ze(h, d.width * t.width / (h.width * m.width)), i({ visibleArea: h, type: "resize" }));
|
|
1334
|
+
return b !== 1 && (h = ze(h, b), d = ze(d, b)), h = we(h = Me(h, ot(_e(d), _e(h))), i({ visibleArea: h, type: "move" })), { coordinates: d = we(d, Ot(Pe(h), l)), visibleArea: h };
|
|
1335
1335
|
}
|
|
1336
1336
|
function Vo(e) {
|
|
1337
1337
|
var i = e.event, t = e.getAreaRestrictions, n = e.boundaries, a = e.coordinates, o = e.visibleArea;
|
|
@@ -1342,8 +1342,8 @@ function Vo(e) {
|
|
|
1342
1342
|
if (a && o && i.type !== "manipulateImage") {
|
|
1343
1343
|
var u = { width: 0, height: 0 };
|
|
1344
1344
|
s.width, n.width, ae(n) > ae(l) ? (u.height = 0.8 * n.height, u.width = u.height * ae(l)) : (u.width = 0.8 * n.width, u.height = u.width * ae(l));
|
|
1345
|
-
var c =
|
|
1346
|
-
s = ze(s, c), c !== 1 && (u.height /= c, u.width /= c), s = we(s =
|
|
1345
|
+
var c = kt(s = ze(s, l.width * n.width / (s.width * u.width)), t({ visibleArea: s, type: "resize" }));
|
|
1346
|
+
s = ze(s, c), c !== 1 && (u.height /= c, u.width /= c), s = we(s = Me(s, ot(_e(l), _e(s))), t({ visibleArea: s, type: "move" })), l = we(l, Ot(Pe(s), r));
|
|
1347
1347
|
}
|
|
1348
1348
|
return { coordinates: l, visibleArea: s };
|
|
1349
1349
|
}
|
|
@@ -1351,7 +1351,7 @@ function $o(e) {
|
|
|
1351
1351
|
var i = e.event, t = e.coordinates, n = e.visibleArea, a = e.getAreaRestrictions, o = X({}, n), r = X({}, t);
|
|
1352
1352
|
if (i.type === "setCoordinates") {
|
|
1353
1353
|
var l = Math.max(0, r.width - o.width), s = Math.max(0, r.height - o.height);
|
|
1354
|
-
l > s ? o = ze(o, Math.min(r.width / o.width, at(o, a({ visibleArea: o, type: "resize" })))) : s > l && (o = ze(o, Math.min(r.height / o.height, at(o, a({ visibleArea: o, type: "resize" }))))), o = we(o =
|
|
1354
|
+
l > s ? o = ze(o, Math.min(r.width / o.width, at(o, a({ visibleArea: o, type: "resize" })))) : s > l && (o = ze(o, Math.min(r.height / o.height, at(o, a({ visibleArea: o, type: "resize" }))))), o = we(o = Me(o, Mt(rt(r, Pe(o)))), a({ visibleArea: o, type: "move" }));
|
|
1355
1355
|
}
|
|
1356
1356
|
return { visibleArea: o, coordinates: r };
|
|
1357
1357
|
}
|
|
@@ -1381,21 +1381,21 @@ function vt(e, i) {
|
|
|
1381
1381
|
}
|
|
1382
1382
|
function Go(e) {
|
|
1383
1383
|
var i = e.event, t = e.coordinates, n = e.visibleArea, a = e.sizeRestrictions, o = e.getAreaRestrictions, r = e.positionRestrictions, l = e.adjustStencil, s = i.scale, u = i.move, c = X({}, n), d = X({}, t), h = 1, m = 1, b = s.factor && Math.abs(s.factor - 1) > 1e-3;
|
|
1384
|
-
c =
|
|
1384
|
+
c = Me(c, { left: u.left || 0, top: u.top || 0 });
|
|
1385
1385
|
var v = { stencil: { minimum: Math.max(a.minWidth ? a.minWidth / d.width : 0, a.minHeight ? a.minHeight / d.height : 0), maximum: Math.min(a.maxWidth ? a.maxWidth / d.width : 1 / 0, a.maxHeight ? a.maxHeight / d.height : 1 / 0, at(d, r)) }, area: { maximum: at(c, o({ visibleArea: c, type: "resize" })) } };
|
|
1386
1386
|
s.factor && b && (s.factor < 1 ? (m = Math.max(s.factor, v.stencil.minimum)) > 1 && (m = 1) : s.factor > 1 && (m = Math.min(s.factor, Math.min(v.area.maximum, v.stencil.maximum))) < 1 && (m = 1)), m && (c = ze(c, m, s.center));
|
|
1387
1387
|
var f = t.left - n.left, S = n.width + n.left - (t.width + t.left), z = t.top - n.top, E = n.height + n.top - (t.height + t.top);
|
|
1388
|
-
return c = we(c =
|
|
1388
|
+
return c = we(c = Me(c, rt(c, { left: r.left !== void 0 ? r.left - f * m : void 0, top: r.top !== void 0 ? r.top - z * m : void 0, bottom: r.bottom !== void 0 ? r.bottom + E * m : void 0, right: r.right !== void 0 ? r.right + S * m : void 0 })), o({ visibleArea: c, type: "move" })), d.width = d.width * m, d.height = d.height * m, d.left = c.left + f * m, d.top = c.top + z * m, d = we(d, Ot(Pe(c), r)), s.factor && b && l && (s.factor > 1 ? h = Math.min(v.area.maximum, s.factor) / m : s.factor < 1 && (h = Math.max(d.height / c.height, d.width / c.width, s.factor / m)), h !== 1 && (c = Me(c = we(c = ze(c, h, s.factor > 1 ? s.center : _e(d)), o({ visibleArea: c, type: "move" })), Mt(rt(d, Pe(c)))))), { coordinates: d, visibleArea: c };
|
|
1389
1389
|
}
|
|
1390
1390
|
function jo(e) {
|
|
1391
1391
|
var i = e.aspectRatio, t = e.getAreaRestrictions, n = e.coordinates, a = e.visibleArea, o = e.sizeRestrictions, r = e.positionRestrictions, l = e.imageSize, s = e.previousImageSize, u = e.angle, c = X({}, n), d = X({}, a), h = We(_e(X({ left: 0, top: 0 }, s)), u);
|
|
1392
|
-
return (c = X(X({}, Ve({ sizeRestrictions: o, aspectRatio: i, width: c.width, height: c.height })), We(_e(c), u))).left -= h.left - l.width / 2 + c.width / 2, c.top -= h.top - l.height / 2 + c.height / 2, d = ze(d,
|
|
1392
|
+
return (c = X(X({}, Ve({ sizeRestrictions: o, aspectRatio: i, width: c.width, height: c.height })), We(_e(c), u))).left -= h.left - l.width / 2 + c.width / 2, c.top -= h.top - l.height / 2 + c.height / 2, d = ze(d, kt(d, t({ visibleArea: d, type: "resize" }))), { coordinates: c = we(c, r), visibleArea: d = we(d = Me(d, ot(_e(c), _e(n))), t({ visibleArea: d, type: "move" })) };
|
|
1393
1393
|
}
|
|
1394
1394
|
function Wo(e) {
|
|
1395
1395
|
var i = e.flip, t = e.previousFlip, n = e.rotate, a = e.getAreaRestrictions, o = e.coordinates, r = e.visibleArea, l = e.imageSize, s = X({}, o), u = X({}, r), c = t.horizontal !== i.horizontal, d = t.vertical !== i.vertical;
|
|
1396
1396
|
if (c || d) {
|
|
1397
1397
|
var h = We({ left: l.width / 2, top: l.height / 2 }, -n), m = We(_e(s), -n), b = We({ left: c ? h.left - (m.left - h.left) : m.left, top: d ? h.top - (m.top - h.top) : m.top }, n);
|
|
1398
|
-
s =
|
|
1398
|
+
s = Me(s, ot(b, _e(s))), m = We(_e(u), -n), u = we(u = Me(u, ot(b = We({ left: c ? h.left - (m.left - h.left) : m.left, top: d ? h.top - (m.top - h.top) : m.top }, n), _e(u))), a({ visibleArea: u, type: "move" }));
|
|
1399
1399
|
}
|
|
1400
1400
|
return { coordinates: s, visibleArea: u };
|
|
1401
1401
|
}
|
|
@@ -1531,16 +1531,16 @@ var Ut = Ee("vue-bounding-box"), Zo = ["east", "west", null], Jo = ["south", "no
|
|
|
1531
1531
|
this.$emit("resize-end");
|
|
1532
1532
|
}, onHandlerDrag: function(e, i, t) {
|
|
1533
1533
|
var n, a = e.shift(), o = a.left, r = a.top, l = { left: 0, right: 0, top: 0, bottom: 0 };
|
|
1534
|
-
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
|
|
1534
|
+
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 ko(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 }));
|
|
1535
1535
|
} }, emits: ["resize", "resize-end"] };
|
|
1536
1536
|
on.render = function(e, i, t, n, a, o) {
|
|
1537
|
-
return O(), Y("div", { ref: "box", class: o.classes.root, style: o.style }, [ve(e.$slots, "default"), w("div", null, [(O(!0), Y(
|
|
1537
|
+
return O(), Y("div", { ref: "box", class: o.classes.root, style: o.style }, [ve(e.$slots, "default"), w("div", null, [(O(!0), Y(ke, null, Ye(o.lineNodes, function(r) {
|
|
1538
1538
|
return O(), Y(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) {
|
|
1539
1539
|
return o.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
|
|
1540
1540
|
}, onDragEnd: i[1] || (i[1] = function(l) {
|
|
1541
1541
|
return o.onEnd();
|
|
1542
1542
|
}) }, null, 8, ["default-class", "hover-class", "wrapper-class", "position", "disabled", "onDrag"]);
|
|
1543
|
-
}), 128))]), (O(!0), Y(
|
|
1543
|
+
}), 128))]), (O(!0), Y(ke, null, Ye(o.handlerNodes, function(r) {
|
|
1544
1544
|
return O(), Y("div", { key: r.name, style: r.wrapperStyle, class: r.wrapperClass }, [(O(), Y(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) {
|
|
1545
1545
|
return o.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
|
|
1546
1546
|
}, onDragEnd: i[2] || (i[2] = function(l) {
|
|
@@ -1880,12 +1880,12 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
|
|
|
1880
1880
|
i.style.width = t.width + "px", i.style.height = i.clientWidth / n + "px", i.style.width = i.clientWidth + "px";
|
|
1881
1881
|
} }, fitCoordinates: { type: Function, default: function(e) {
|
|
1882
1882
|
var i = e.visibleArea, t = e.coordinates, n = e.aspectRatio, a = e.sizeRestrictions, o = e.positionRestrictions, r = X(X({}, t), Ve({ width: t.width, height: t.height, aspectRatio: n, sizeRestrictions: { maxWidth: i.width, maxHeight: i.height, minHeight: Math.min(i.height, a.minHeight), minWidth: Math.min(i.width, a.minWidth) } }));
|
|
1883
|
-
return r = we(r =
|
|
1883
|
+
return r = we(r = Me(r, ot(_e(t), _e(r))), Ot(Pe(i), o));
|
|
1884
1884
|
} }, fitVisibleArea: { type: Function, default: function(e) {
|
|
1885
1885
|
var i = e.visibleArea, t = e.boundaries, n = e.getAreaRestrictions, a = e.coordinates, o = X({}, i);
|
|
1886
1886
|
o.height = o.width / ae(t), o.top += (i.height - o.height) / 2, (a.height - o.height > 0 || a.width - o.width > 0) && (o = ze(o, Math.max(a.height / o.height, a.width / o.width)));
|
|
1887
|
-
var r =
|
|
1888
|
-
return o.width < a.width && (r.left = 0), o.height < a.height && (r.top = 0), o = we(o =
|
|
1887
|
+
var r = Mt(rt(a, Pe(o = ze(o, kt(o, n({ visibleArea: o, type: "resize" }))))));
|
|
1888
|
+
return o.width < a.width && (r.left = 0), o.height < a.height && (r.top = 0), o = we(o = Me(o, r), n({ visibleArea: o, type: "move" }));
|
|
1889
1889
|
} }, areaRestrictionsAlgorithm: { type: Function, default: function(e) {
|
|
1890
1890
|
var i = e.visibleArea, t = e.boundaries, n = e.imageSize, a = e.imageRestriction, o = e.type, r = {};
|
|
1891
1891
|
return a === "fill-area" ? r = { left: 0, top: 0, right: n.width, bottom: n.height } : a === "fit-area" && (ae(t) > ae(n) ? (r = { top: 0, bottom: n.height }, i && o === "move" && (i.width > n.width ? (r.left = -(i.width - n.width) / 2, r.right = n.width - r.left) : (r.left = 0, r.right = n.width))) : (r = { left: 0, right: n.width }, i && o === "move" && (i.height > n.height ? (r.top = -(i.height - n.height) / 2, r.bottom = n.height - r.top) : (r.top = 0, r.bottom = n.height)))), r;
|
|
@@ -1895,7 +1895,7 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
|
|
|
1895
1895
|
var i = e.imageSize, t = {};
|
|
1896
1896
|
return e.imageRestriction !== "none" && (t = { left: 0, top: 0, right: i.width, bottom: i.height }), t;
|
|
1897
1897
|
} } }, data: function() {
|
|
1898
|
-
return { transitionsActive: !1, imageLoaded: !1, imageAttributes: { width: null, height: null, crossOrigin: null, src: null }, defaultImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, appliedImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, boundaries: { width: 0, height: 0 }, visibleArea: null, coordinates: oe({},
|
|
1898
|
+
return { transitionsActive: !1, imageLoaded: !1, imageAttributes: { width: null, height: null, crossOrigin: null, src: null }, defaultImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, appliedImageTransforms: { rotate: 0, flip: { horizontal: !1, vertical: !1 } }, boundaries: { width: 0, height: 0 }, visibleArea: null, coordinates: oe({}, Mi) };
|
|
1899
1899
|
}, computed: { image: function() {
|
|
1900
1900
|
return { src: this.imageAttributes.src, width: this.imageAttributes.width, height: this.imageAttributes.height, transforms: this.imageTransforms };
|
|
1901
1901
|
}, imageTransforms: function() {
|
|
@@ -2020,7 +2020,7 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
|
|
|
2020
2020
|
var a = this.autoZoomAlgorithm;
|
|
2021
2021
|
a || (a = this.stencilSize ? Uo : this.autoZoom ? Vo : $o);
|
|
2022
2022
|
var o = a({ event: { type: e, params: n }, visibleArea: i, coordinates: t, boundaries: this.boundaries, aspectRatio: this.getAspectRatio(), positionRestrictions: this.positionRestrictions, getAreaRestrictions: this.getAreaRestrictions, sizeRestrictions: this.sizeRestrictions, stencilSize: this.getStencilSize() });
|
|
2023
|
-
return oe(oe({}, o), {}, { changed: !
|
|
2023
|
+
return oe(oe({}, o), {}, { changed: !ki(o.visibleArea, i) || !ki(o.coordinates, t) });
|
|
2024
2024
|
}, runAutoZoom: function(e) {
|
|
2025
2025
|
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = i.transitions, n = t !== void 0 && t, a = xo(i, ia), o = this.processAutoZoom(e, this.visibleArea, this.coordinates, a), r = o.visibleArea, l = o.coordinates, s = o.changed;
|
|
2026
2026
|
n && s && this.enableTransitions(), this.visibleArea = r, this.coordinates = l, n && s && this.debouncedDisableTransitions();
|
|
@@ -2247,7 +2247,7 @@ var ia = ["transitions"], Te = Ee("vue-advanced-cropper"), dn = { name: "Cropper
|
|
|
2247
2247
|
}, getPublicProperties: function() {
|
|
2248
2248
|
return { coefficient: this.coefficient, visibleArea: this.visibleArea, coordinates: this.coordinates, boundaries: this.boundaries, sizeRestrictions: this.sizeRestrictions, positionRestrictions: this.positionRestrictions, aspectRatio: this.getAspectRatio(), imageRestriction: this.imageRestriction };
|
|
2249
2249
|
}, defaultCoordinates: function() {
|
|
2250
|
-
return oe({},
|
|
2250
|
+
return oe({}, Mi);
|
|
2251
2251
|
}, flip: function(e, i) {
|
|
2252
2252
|
var t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, n = t.transitions, a = n === void 0 || n;
|
|
2253
2253
|
if (!this.transitionsActive) {
|
|
@@ -2304,8 +2304,8 @@ const aa = {
|
|
|
2304
2304
|
const { width: v, height: f } = b, S = 16 / 9, z = v / f;
|
|
2305
2305
|
let E = v, j = f;
|
|
2306
2306
|
z > S ? j = E / S : E = j * S;
|
|
2307
|
-
const D = l(E, j),
|
|
2308
|
-
return C.fillStyle = "white", C.fillRect(0, 0, D.width, D.height), C.drawImage(b, 0, 0, E, j, y, g, D.width, D.height),
|
|
2307
|
+
const D = l(E, j), k = Ro(D.width, D.height), y = E > v ? (E - v) / 2 * D.ratio : 0, g = j > f ? (j - f) / 2 * D.ratio : 0, C = k.getContext("2d");
|
|
2308
|
+
return C.fillStyle = "white", C.fillRect(0, 0, D.width, D.height), C.drawImage(b, 0, 0, E, j, y, g, D.width, D.height), k.toDataURL();
|
|
2309
2309
|
}
|
|
2310
2310
|
const u = J(!1);
|
|
2311
2311
|
async function c([b]) {
|
|
@@ -2701,9 +2701,9 @@ const Ca = {
|
|
|
2701
2701
|
class: /* @__PURE__ */ Le(["flex space-x-16", "xs:flex-col xs:space-x-0 xs:space-y-16"])
|
|
2702
2702
|
}, xa = {
|
|
2703
2703
|
class: "w-[160px] xs:w-full"
|
|
2704
|
-
}, ka = {
|
|
2705
|
-
class: "flex-1"
|
|
2706
2704
|
}, Ma = {
|
|
2705
|
+
class: "flex-1"
|
|
2706
|
+
}, ka = {
|
|
2707
2707
|
class: "relative"
|
|
2708
2708
|
}, Oa = {
|
|
2709
2709
|
class: "fm-typo-en-body-lg-600"
|
|
@@ -2746,17 +2746,17 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2746
2746
|
}), {
|
|
2747
2747
|
checkMenuIsLoading: u
|
|
2748
2748
|
} = Xe(He(De())), c = i, d = F(() => n.rules.item), h = F(() => n.categorizedItems), m = F(() => {
|
|
2749
|
-
const
|
|
2749
|
+
const k = h.value.map((y) => ({
|
|
2750
2750
|
label: y.name,
|
|
2751
2751
|
value: y.id
|
|
2752
2752
|
}));
|
|
2753
|
-
return t.isAddon ?
|
|
2754
|
-
}), b = F(() => d.value.addon), v = F(() => !m.value.find((
|
|
2755
|
-
var
|
|
2753
|
+
return t.isAddon ? k : k.filter((y) => !!y.value);
|
|
2754
|
+
}), b = F(() => d.value.addon), v = F(() => !m.value.find((k) => !!k.value)), f = () => {
|
|
2755
|
+
var k;
|
|
2756
2756
|
return t.isAddon ? null : Qe(w(xe.FmSelect, {
|
|
2757
2757
|
disabled: !d.value.category || t.isAddon || u(),
|
|
2758
2758
|
items: m.value,
|
|
2759
|
-
modelValue: t.form.category ?? ((
|
|
2759
|
+
modelValue: t.form.category ?? ((k = t.fallback) == null ? void 0 : k.category),
|
|
2760
2760
|
shiftMenu: !0,
|
|
2761
2761
|
"onUpdate:model-value": (y) => c("update:form", "category", y)
|
|
2762
2762
|
}, {
|
|
@@ -2778,17 +2778,17 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2778
2778
|
});
|
|
2779
2779
|
const S = F(() => {
|
|
2780
2780
|
var y;
|
|
2781
|
-
const
|
|
2782
|
-
return
|
|
2781
|
+
const k = t.form.name || ((y = t.fallback) == null ? void 0 : y.name);
|
|
2782
|
+
return k ? n.items.filter((g) => !!g.category && g._id !== t.form._id && g.name === k).length : 0;
|
|
2783
2783
|
});
|
|
2784
|
-
function z(
|
|
2784
|
+
function z(k) {
|
|
2785
2785
|
var g, C, x;
|
|
2786
|
-
const y =
|
|
2787
|
-
c("update:form", "category", t.isOverride ? y ? "" : ((g = t.fallback) == null ? void 0 : g.category) ?? ((C = m.value.find((
|
|
2786
|
+
const y = k == Je.ADD_ON;
|
|
2787
|
+
c("update:form", "category", t.isOverride ? y ? "" : ((g = t.fallback) == null ? void 0 : g.category) ?? ((C = m.value.find((M) => !!M.value)) == null ? void 0 : C.value) : y ? null : (x = m.value.find((M) => !!M.value)) == null ? void 0 : x.value);
|
|
2788
2788
|
}
|
|
2789
2789
|
const E = J(!1);
|
|
2790
2790
|
async function j() {
|
|
2791
|
-
var
|
|
2791
|
+
var k, y, g;
|
|
2792
2792
|
if (!t.form.name) {
|
|
2793
2793
|
const C = document.getElementById("product-name");
|
|
2794
2794
|
if (C) {
|
|
@@ -2802,7 +2802,7 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2802
2802
|
E.value = !0, Qt({
|
|
2803
2803
|
event: "menu_catalog_item_general_remy_suggest_description"
|
|
2804
2804
|
}), Ne.toggleDialog(!0);
|
|
2805
|
-
const C = await ((y = (
|
|
2805
|
+
const C = await ((y = (k = Ne).getItemDescription) == null ? void 0 : y.call(k, {
|
|
2806
2806
|
name: t.form.name || ""
|
|
2807
2807
|
}, !0)), x = (g = C == null ? void 0 : C.data) == null ? void 0 : g.value;
|
|
2808
2808
|
typeof x == "string" && c("update:form", "description", x);
|
|
@@ -2813,34 +2813,34 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2813
2813
|
const {
|
|
2814
2814
|
t: D
|
|
2815
2815
|
} = me();
|
|
2816
|
-
return (
|
|
2817
|
-
const g = G("fm-text-field"), C = G("fm-textarea"), x = G("fm-radio"),
|
|
2816
|
+
return (k, y) => {
|
|
2817
|
+
const g = G("fm-text-field"), C = G("fm-textarea"), x = G("fm-radio"), M = G("FmSnackbar"), R = G("FmButton"), _ = G("fm-radio-group"), A = G("FmFormGroup"), U = Nt("tooltip");
|
|
2818
2818
|
return O(), Y(Ke, {
|
|
2819
2819
|
title: p(D)("menu.product.form.detail.title")
|
|
2820
2820
|
}, {
|
|
2821
2821
|
default: L(() => {
|
|
2822
2822
|
var V, N;
|
|
2823
2823
|
return [P("div", Ca, [P("div", Aa, [P("div", Ra, [P("div", xa, [w(g, {
|
|
2824
|
-
"model-value":
|
|
2825
|
-
placeholder: ((V =
|
|
2824
|
+
"model-value": k.form.code,
|
|
2825
|
+
placeholder: ((V = k.fallback) == null ? void 0 : V.code) || p(D)("menu.product.form.detail.fields.code.placeholder"),
|
|
2826
2826
|
label: p(D)("menu.product.form.detail.fields.code.label"),
|
|
2827
|
-
"onUpdate:modelValue": y[0] || (y[0] = (q) => c("update:form", "code", p(hn)(q,
|
|
2828
|
-
}, null, 8, ["model-value", "placeholder", "label"])]), P("div",
|
|
2827
|
+
"onUpdate:modelValue": y[0] || (y[0] = (q) => c("update:form", "code", p(hn)(q, k.isOverride)))
|
|
2828
|
+
}, null, 8, ["model-value", "placeholder", "label"])]), P("div", Ma, [w(g, {
|
|
2829
2829
|
id: "product-name",
|
|
2830
2830
|
disabled: !d.value.name,
|
|
2831
2831
|
"helper-text": S.value > 0 ? p(D)("menu.product.form.detail.fields.name.duplicate_warning", {
|
|
2832
2832
|
count: S.value
|
|
2833
2833
|
}) : void 0,
|
|
2834
|
-
"model-value":
|
|
2835
|
-
placeholder: (N =
|
|
2834
|
+
"model-value": k.form.name,
|
|
2835
|
+
placeholder: (N = k.fallback) == null ? void 0 : N.name,
|
|
2836
2836
|
rules: d.value.name ? [(q) => !!q || p(D)("menu.product.form.detail.fields.name.required")] : void 0,
|
|
2837
2837
|
"label-mark": "required",
|
|
2838
2838
|
autofocus: "",
|
|
2839
2839
|
label: p(D)("menu.product.form.detail.fields.name.label"),
|
|
2840
2840
|
"onUpdate:modelValue": y[1] || (y[1] = (q) => c("update:form", "name", q))
|
|
2841
|
-
}, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), P("div",
|
|
2841
|
+
}, null, 8, ["disabled", "helper-text", "model-value", "placeholder", "rules", "label"])])]), P("div", ka, [w(C, {
|
|
2842
2842
|
disabled: !d.value.description,
|
|
2843
|
-
"model-value":
|
|
2843
|
+
"model-value": k.form.description,
|
|
2844
2844
|
placeholder: p(D)("menu.product.form.detail.fields.description.placeholder"),
|
|
2845
2845
|
"onUpdate:modelValue": y[2] || (y[2] = (q) => c("update:form", "description", q.trim())),
|
|
2846
2846
|
class: "description"
|
|
@@ -2852,7 +2852,7 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2852
2852
|
onClick: j
|
|
2853
2853
|
}, null, 512), [[U, p(Li)("Suggest description")]])])]), w(pa, {
|
|
2854
2854
|
disabled: !d.value.thumbnail,
|
|
2855
|
-
"model-value":
|
|
2855
|
+
"model-value": k.thumbnail,
|
|
2856
2856
|
"onUpdate:modelValue": y[3] || (y[3] = (q) => c("update:thumbnail", q)),
|
|
2857
2857
|
"onReset:modelValue": y[4] || (y[4] = (q) => c("reset:thumbnail"))
|
|
2858
2858
|
}, null, 8, ["disabled", "model-value"])]), w(nt, {
|
|
@@ -2861,7 +2861,7 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2861
2861
|
default: L(() => [b.value ? (O(), Y(_, {
|
|
2862
2862
|
key: 0,
|
|
2863
2863
|
disabled: !d.value.category,
|
|
2864
|
-
"model-value":
|
|
2864
|
+
"model-value": k.isAddon ? Je.ADD_ON : Je.PRODUCT,
|
|
2865
2865
|
"onUpdate:modelValue": y[5] || (y[5] = (q) => z(q))
|
|
2866
2866
|
}, {
|
|
2867
2867
|
default: L(() => [P("div", Ea, [P("div", Fa, [w(x, {
|
|
@@ -2874,7 +2874,7 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2874
2874
|
key: 0
|
|
2875
2875
|
})) : te("", !0)]),
|
|
2876
2876
|
_: 1
|
|
2877
|
-
})]), v.value ? (O(), Q("div", Ia, [w(
|
|
2877
|
+
})]), v.value ? (O(), Q("div", Ia, [w(M, {
|
|
2878
2878
|
title: p(D)("menu.product.form.detail.category.add_first"),
|
|
2879
2879
|
variant: "info"
|
|
2880
2880
|
}, null, 8, ["title"]), w(R, {
|
|
@@ -2890,9 +2890,9 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2890
2890
|
_: 1
|
|
2891
2891
|
}, 8, ["disabled", "model-value"])) : te("", !0), p(n).isV4 ? te("", !0) : (O(), Y(A, {
|
|
2892
2892
|
key: 1,
|
|
2893
|
-
modelValue:
|
|
2894
|
-
"onUpdate:modelValue": y[6] || (y[6] = (q) =>
|
|
2895
|
-
rules: [(q) => !q && !
|
|
2893
|
+
modelValue: k.form.category,
|
|
2894
|
+
"onUpdate:modelValue": y[6] || (y[6] = (q) => k.form.category = q),
|
|
2895
|
+
rules: [(q) => !q && !k.isOverride ? "Category is required" : !0]
|
|
2896
2896
|
}, {
|
|
2897
2897
|
default: L(() => [w(f)]),
|
|
2898
2898
|
_: 1
|
|
@@ -2900,7 +2900,7 @@ const Da = /* @__PURE__ */ ue({
|
|
|
2900
2900
|
_: 1
|
|
2901
2901
|
}, 8, ["label"]), w(ai, {
|
|
2902
2902
|
disabled: !d.value.orderFrom,
|
|
2903
|
-
"model-value":
|
|
2903
|
+
"model-value": k.form.orderFrom,
|
|
2904
2904
|
"order-from-none": d.value.orderFromNone,
|
|
2905
2905
|
required: d.value.orderFrom,
|
|
2906
2906
|
"default-label": p(D)("menu.product.form.detail.order_from.default"),
|
|
@@ -3007,7 +3007,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3007
3007
|
const { t: d } = me(), h = Ki();
|
|
3008
3008
|
return (m, b) => {
|
|
3009
3009
|
const v = G("fm-text-field"), f = G("fm-card"), S = G("fm-button"), z = G("fm-side-sheet");
|
|
3010
|
-
return O(), Q(
|
|
3010
|
+
return O(), Q(ke, null, [
|
|
3011
3011
|
ve(m.$slots, "default", { trigger: o }),
|
|
3012
3012
|
w(z, {
|
|
3013
3013
|
id: "inventory-form",
|
|
@@ -3109,12 +3109,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3109
3109
|
orderFrom: t.config.orderFrom(I)
|
|
3110
3110
|
}), S = F(() => t.config.isItemGroup), z = (I) => I ? mt(I, !1) : "", E = (I) => {
|
|
3111
3111
|
var T;
|
|
3112
|
-
return I == null ? "" : (T =
|
|
3112
|
+
return I == null ? "" : (T = kn()[I]) == null ? void 0 : T.label;
|
|
3113
3113
|
}, j = F(() => Object.values(v.value)), D = J({}), {
|
|
3114
|
-
t:
|
|
3114
|
+
t: k
|
|
3115
3115
|
} = me(), y = J([{
|
|
3116
3116
|
accessorKey: "isDefault",
|
|
3117
|
-
header: () =>
|
|
3117
|
+
header: () => k("menu.group.option.is_default"),
|
|
3118
3118
|
enableSorting: !1,
|
|
3119
3119
|
size: 75,
|
|
3120
3120
|
cell: (I) => {
|
|
@@ -3131,7 +3131,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3131
3131
|
if (T) {
|
|
3132
3132
|
const Ge = (ye = I.row.getParentRow()) == null ? void 0 : ye.original;
|
|
3133
3133
|
if (!Ge) return;
|
|
3134
|
-
|
|
3134
|
+
M(Ge._id, K.combinationKey ?? "", "isDefault", le);
|
|
3135
3135
|
} else
|
|
3136
3136
|
x(K._id, "isDefault", le);
|
|
3137
3137
|
}
|
|
@@ -3139,7 +3139,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3139
3139
|
}
|
|
3140
3140
|
}, {
|
|
3141
3141
|
accessorKey: "code",
|
|
3142
|
-
header: () =>
|
|
3142
|
+
header: () => k("menu.group.option.code"),
|
|
3143
3143
|
enableSorting: !1,
|
|
3144
3144
|
size: 100,
|
|
3145
3145
|
cell: (I) => {
|
|
@@ -3156,7 +3156,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3156
3156
|
}
|
|
3157
3157
|
}, {
|
|
3158
3158
|
accessorKey: "name",
|
|
3159
|
-
header: () =>
|
|
3159
|
+
header: () => k("menu.group.option.product_title"),
|
|
3160
3160
|
enableSorting: !1,
|
|
3161
3161
|
cell: (I) => {
|
|
3162
3162
|
const T = I.getValue(), K = I.row.original, Z = I.row.depth > 0, ee = K.combinationKey ? Yi(K.combinationKey, fe().variants) : null;
|
|
@@ -3164,13 +3164,13 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3164
3164
|
modelValue: T,
|
|
3165
3165
|
placeholder: ee ?? "",
|
|
3166
3166
|
disabled: !f(K.combinationKey).name,
|
|
3167
|
-
rules: ee ? void 0 : [(ie) => ie.length > 0 ||
|
|
3167
|
+
rules: ee ? void 0 : [(ie) => ie.length > 0 || k("menu.group.option.product_title_required")],
|
|
3168
3168
|
"onUpdate:modelValue": (ie) => {
|
|
3169
3169
|
var le;
|
|
3170
3170
|
if (Z) {
|
|
3171
3171
|
const ye = (le = I.row.getParentRow()) == null ? void 0 : le.original;
|
|
3172
3172
|
if (!ye) return;
|
|
3173
|
-
|
|
3173
|
+
M(ye._id, K.combinationKey ?? "", "name", ie);
|
|
3174
3174
|
} else
|
|
3175
3175
|
x(K._id, "name", ie);
|
|
3176
3176
|
},
|
|
@@ -3192,7 +3192,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3192
3192
|
enableSorting: !1,
|
|
3193
3193
|
header: () => {
|
|
3194
3194
|
var I;
|
|
3195
|
-
return
|
|
3195
|
+
return k("menu.group.option.price", {
|
|
3196
3196
|
symbol: (I = l.value) == null ? void 0 : I.currency.symbol
|
|
3197
3197
|
});
|
|
3198
3198
|
},
|
|
@@ -3210,7 +3210,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3210
3210
|
if (ee) {
|
|
3211
3211
|
const ye = (le = I.row.getParentRow()) == null ? void 0 : le.original;
|
|
3212
3212
|
if (!ye) return;
|
|
3213
|
-
|
|
3213
|
+
M(
|
|
3214
3214
|
ye._id,
|
|
3215
3215
|
K.combinationKey ?? "",
|
|
3216
3216
|
// @ts-ignore
|
|
@@ -3226,7 +3226,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3226
3226
|
}
|
|
3227
3227
|
}, {
|
|
3228
3228
|
accessorKey: "orderFrom",
|
|
3229
|
-
header: () =>
|
|
3229
|
+
header: () => k("menu.common.labels.order_from"),
|
|
3230
3230
|
size: 100,
|
|
3231
3231
|
enableSorting: !1,
|
|
3232
3232
|
cell: (I) => {
|
|
@@ -3242,7 +3242,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3242
3242
|
if (ee) {
|
|
3243
3243
|
const ye = (le = I.row.getParentRow()) == null ? void 0 : le.original;
|
|
3244
3244
|
if (!ye) return;
|
|
3245
|
-
|
|
3245
|
+
M(
|
|
3246
3246
|
ye._id,
|
|
3247
3247
|
K.combinationKey ?? "",
|
|
3248
3248
|
// @ts-ignore
|
|
@@ -3278,7 +3278,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3278
3278
|
if (K) {
|
|
3279
3279
|
const ie = (ee = I.row.getParentRow()) == null ? void 0 : ee.original;
|
|
3280
3280
|
if (!ie) return;
|
|
3281
|
-
|
|
3281
|
+
M(
|
|
3282
3282
|
ie._id,
|
|
3283
3283
|
T.combinationKey ?? "",
|
|
3284
3284
|
// @ts-ignore
|
|
@@ -3317,7 +3317,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3317
3317
|
if (!ie) return;
|
|
3318
3318
|
if ((((ee = t.group.items[ie._id].items) == null ? void 0 : ee.length) || 0) <= 1) {
|
|
3319
3319
|
a.open({
|
|
3320
|
-
title:
|
|
3320
|
+
title: k("menu.group.option.should_link_at_least_one_variant", {
|
|
3321
3321
|
name: ie.name
|
|
3322
3322
|
}),
|
|
3323
3323
|
type: "error"
|
|
@@ -3369,7 +3369,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3369
3369
|
}
|
|
3370
3370
|
});
|
|
3371
3371
|
}
|
|
3372
|
-
function
|
|
3372
|
+
function M(I, T, K, Z) {
|
|
3373
3373
|
var ye, Ge;
|
|
3374
3374
|
const ee = ne(t.group), ie = (ye = ee.items[I].items) == null ? void 0 : ye.findIndex((lt) => lt.combinationKey === T);
|
|
3375
3375
|
if (!pt.isSet(ie)) return;
|
|
@@ -3426,16 +3426,16 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3426
3426
|
return (I, T) => {
|
|
3427
3427
|
const K = G("fm-button"), Z = G("fm-table");
|
|
3428
3428
|
return O(), Y(Ke, {
|
|
3429
|
-
title: p(
|
|
3429
|
+
title: p(k)("menu.group.option.title")
|
|
3430
3430
|
}, {
|
|
3431
|
-
"append-title": L(() => [I.config.link() ? (O(), Q(
|
|
3431
|
+
"append-title": L(() => [I.config.link() ? (O(), Q(ke, {
|
|
3432
3432
|
key: 0
|
|
3433
3433
|
}, [c.value ? (O(), Q("div", Xa, [w(Ln, {
|
|
3434
3434
|
"categorized-items": I.categorizedItems,
|
|
3435
3435
|
"initial-value": h.value,
|
|
3436
3436
|
"show-variant": I.config.bindToVariant,
|
|
3437
3437
|
"select-variant": "",
|
|
3438
|
-
title: p(
|
|
3438
|
+
title: p(k)("menu.group.option.link_products"),
|
|
3439
3439
|
onSubmit: V
|
|
3440
3440
|
}, {
|
|
3441
3441
|
default: L(({
|
|
@@ -3444,7 +3444,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3444
3444
|
"text-color": p(je).ColorPrimary,
|
|
3445
3445
|
"border-color": p(je).ColorPrimary,
|
|
3446
3446
|
variant: "secondary",
|
|
3447
|
-
label: p(
|
|
3447
|
+
label: p(k)("menu.group.option.link_products"),
|
|
3448
3448
|
"prepend-icon": "link",
|
|
3449
3449
|
onClick: ee
|
|
3450
3450
|
}, null, 8, ["text-color", "border-color", "label", "onClick"])]),
|
|
@@ -3453,7 +3453,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3453
3453
|
"text-color": p(je).ColorPrimary,
|
|
3454
3454
|
"border-color": p(je).ColorPrimary,
|
|
3455
3455
|
variant: "secondary",
|
|
3456
|
-
label: p(
|
|
3456
|
+
label: p(k)("menu.group.option.add_option"),
|
|
3457
3457
|
"prepend-icon": "add",
|
|
3458
3458
|
onClick: C
|
|
3459
3459
|
}, null, 8, ["text-color", "border-color", "label"])]))], 64)) : te("", !0)]),
|
|
@@ -3548,14 +3548,14 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3548
3548
|
return g;
|
|
3549
3549
|
}
|
|
3550
3550
|
function S(y) {
|
|
3551
|
-
return f(y) <= y.max ||
|
|
3551
|
+
return f(y) <= y.max || k("menu.common.validation.max_default_items", { max: y.max });
|
|
3552
3552
|
}
|
|
3553
3553
|
const z = J($e.clone(n.group)), E = Bi(
|
|
3554
3554
|
() => !$e.isEqual(n.group, z.value),
|
|
3555
3555
|
() => {
|
|
3556
3556
|
u.value = !1;
|
|
3557
3557
|
}
|
|
3558
|
-
), j = F(() => n.action === "add" ?
|
|
3558
|
+
), j = F(() => n.action === "add" ? k("common.add") : k("common.update"));
|
|
3559
3559
|
async function D() {
|
|
3560
3560
|
if (n.action === "add") {
|
|
3561
3561
|
const { group: y, linkItems: g } = ji(n.group), C = {
|
|
@@ -3583,10 +3583,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3583
3583
|
trigger: c,
|
|
3584
3584
|
show: u
|
|
3585
3585
|
});
|
|
3586
|
-
const { t:
|
|
3586
|
+
const { t: k } = me();
|
|
3587
3587
|
return (y, g) => {
|
|
3588
|
-
const C = G("fm-text-field"), x = G("fm-stepper-field"),
|
|
3589
|
-
return O(), Q(
|
|
3588
|
+
const C = G("fm-text-field"), x = G("fm-stepper-field"), M = G("FmFormGroup"), R = G("fm-radio"), _ = G("fm-radio-group"), A = G("fm-switch"), U = G("fm-button"), V = G("fm-side-sheet");
|
|
3589
|
+
return O(), Q(ke, null, [
|
|
3590
3590
|
ve(y.$slots, "default", { trigger: c }),
|
|
3591
3591
|
w(V, {
|
|
3592
3592
|
id: "group-form",
|
|
@@ -3613,7 +3613,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3613
3613
|
variant: "primary"
|
|
3614
3614
|
}, null, 8, ["label", "loading"]),
|
|
3615
3615
|
w(U, {
|
|
3616
|
-
label: p(
|
|
3616
|
+
label: p(k)("menu.common.actions.cancel"),
|
|
3617
3617
|
size: "lg",
|
|
3618
3618
|
variant: "tertiary",
|
|
3619
3619
|
onClick: g[7] || (g[7] = () => u.value = !1)
|
|
@@ -3631,15 +3631,15 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3631
3631
|
"onUpdate:modelValue": g[0] || (g[0] = (N) => y.group.name = N),
|
|
3632
3632
|
disabled: !d.value.link(),
|
|
3633
3633
|
rules: [
|
|
3634
|
-
(N) => !!N || p(
|
|
3634
|
+
(N) => !!N || p(k)("menu.common.validation.required", { field: p(k)("menu.common.labels.group_name") })
|
|
3635
3635
|
],
|
|
3636
3636
|
autofocus: "",
|
|
3637
|
-
label: p(
|
|
3637
|
+
label: p(k)("menu.common.labels.group_name")
|
|
3638
3638
|
}, null, 8, ["modelValue", "disabled", "rules", "label"])
|
|
3639
3639
|
]),
|
|
3640
|
-
w(
|
|
3640
|
+
w(M, {
|
|
3641
3641
|
"model-value": y.group,
|
|
3642
|
-
rules: [() => y.group.min <= y.group.max || p(
|
|
3642
|
+
rules: [() => y.group.min <= y.group.max || p(k)("menu.common.validation.min_max")]
|
|
3643
3643
|
}, {
|
|
3644
3644
|
default: L(() => [
|
|
3645
3645
|
w(Ga, null, {
|
|
@@ -3650,7 +3650,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3650
3650
|
disabled: !d.value.link(),
|
|
3651
3651
|
min: 0,
|
|
3652
3652
|
class: "flex-1",
|
|
3653
|
-
label: p(
|
|
3653
|
+
label: p(k)("menu.common.labels.min_select")
|
|
3654
3654
|
}, null, 8, ["modelValue", "disabled", "label"]),
|
|
3655
3655
|
w(x, {
|
|
3656
3656
|
modelValue: y.group.max,
|
|
@@ -3658,7 +3658,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3658
3658
|
disabled: !d.value.link(),
|
|
3659
3659
|
min: y.group.min,
|
|
3660
3660
|
class: "flex-1",
|
|
3661
|
-
label: p(
|
|
3661
|
+
label: p(k)("menu.common.labels.max_select")
|
|
3662
3662
|
}, null, 8, ["modelValue", "disabled", "min", "label"])
|
|
3663
3663
|
]),
|
|
3664
3664
|
_: 1
|
|
@@ -3668,7 +3668,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3668
3668
|
}, 8, ["model-value", "rules"]),
|
|
3669
3669
|
d.value.type ? (O(), Y(nt, {
|
|
3670
3670
|
key: 0,
|
|
3671
|
-
label: p(
|
|
3671
|
+
label: p(k)("menu.common.labels.group_type")
|
|
3672
3672
|
}, {
|
|
3673
3673
|
default: L(() => [
|
|
3674
3674
|
w(_, {
|
|
@@ -3677,9 +3677,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3677
3677
|
"onUpdate:modelValue": g[3] || (g[3] = (N) => b(N))
|
|
3678
3678
|
}, {
|
|
3679
3679
|
default: L(() => [
|
|
3680
|
-
(O(!0), Q(
|
|
3680
|
+
(O(!0), Q(ke, null, Ye(h.value, (N) => (O(), Y(R, {
|
|
3681
3681
|
key: N.value,
|
|
3682
|
-
label: p(
|
|
3682
|
+
label: p(k)(`menu.group.types.${N.label.toLowerCase()}`),
|
|
3683
3683
|
value: N.value
|
|
3684
3684
|
}, null, 8, ["label", "value"]))), 128))
|
|
3685
3685
|
]),
|
|
@@ -3689,16 +3689,16 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3689
3689
|
_: 1
|
|
3690
3690
|
}, 8, ["label"])) : te("", !0),
|
|
3691
3691
|
w(nt, {
|
|
3692
|
-
label: p(
|
|
3692
|
+
label: p(k)("menu.common.labels.configuration")
|
|
3693
3693
|
}, {
|
|
3694
3694
|
default: L(() => [
|
|
3695
3695
|
w(A, {
|
|
3696
3696
|
modelValue: y.group.stackable,
|
|
3697
3697
|
"onUpdate:modelValue": g[4] || (g[4] = (N) => y.group.stackable = N),
|
|
3698
3698
|
disabled: !d.value.link(),
|
|
3699
|
-
label: p(
|
|
3699
|
+
label: p(k)("menu.common.labels.stackable"),
|
|
3700
3700
|
"label-placement": "right",
|
|
3701
|
-
sublabel: p(
|
|
3701
|
+
sublabel: p(k)("menu.common.labels.stackable_sublabel")
|
|
3702
3702
|
}, null, 8, ["modelValue", "disabled", "label", "sublabel"])
|
|
3703
3703
|
]),
|
|
3704
3704
|
_: 1
|
|
@@ -3706,11 +3706,11 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3706
3706
|
]),
|
|
3707
3707
|
_: 1
|
|
3708
3708
|
}),
|
|
3709
|
-
w(
|
|
3709
|
+
w(M, {
|
|
3710
3710
|
tag: "div",
|
|
3711
3711
|
modelValue: y.group,
|
|
3712
3712
|
rules: [S],
|
|
3713
|
-
"helper-text": p(
|
|
3713
|
+
"helper-text": p(k)("menu.common.validation.default_items_tip", {
|
|
3714
3714
|
count: f(y.group),
|
|
3715
3715
|
max: y.group.max
|
|
3716
3716
|
})
|
|
@@ -3745,26 +3745,26 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3745
3745
|
setup(e, { expose: i, emit: t }) {
|
|
3746
3746
|
var j, D;
|
|
3747
3747
|
const n = e, a = t, o = fe(), r = Be(), l = Xe(He(De())), s = J([]), u = J(n.combinations[0].combinationKey || ""), c = F(
|
|
3748
|
-
() => s.value.findIndex((
|
|
3748
|
+
() => s.value.findIndex((k) => k.combinationKey == u.value)
|
|
3749
3749
|
), d = F(
|
|
3750
|
-
() => n.combinations.map((
|
|
3751
|
-
label: n.fullCombinations[
|
|
3752
|
-
value:
|
|
3750
|
+
() => n.combinations.map((k) => ({
|
|
3751
|
+
label: n.fullCombinations[k.combinationKey || ""],
|
|
3752
|
+
value: k.combinationKey || ""
|
|
3753
3753
|
}))
|
|
3754
3754
|
), h = F(() => {
|
|
3755
|
-
var
|
|
3755
|
+
var M, R;
|
|
3756
3756
|
if (!S.value) return null;
|
|
3757
|
-
const
|
|
3757
|
+
const k = ((R = (M = s.value[c.value]) == null ? void 0 : M.groups) == null ? void 0 : R.find(
|
|
3758
3758
|
(_) => _._id === n.groupId
|
|
3759
3759
|
)) || {
|
|
3760
3760
|
_id: n.groupId,
|
|
3761
3761
|
groupKey: ""
|
|
3762
|
-
}, g = o.state.menu.modules.group.find((_) => _._id === n.groupId), C = Object.entries({ ...
|
|
3762
|
+
}, g = o.state.menu.modules.group.find((_) => _._id === n.groupId), C = Object.entries({ ...k, items: void 0 }).filter(([, _]) => !!_), x = {
|
|
3763
3763
|
...g,
|
|
3764
3764
|
...Object.fromEntries(C),
|
|
3765
3765
|
items: g.items.map((_) => {
|
|
3766
3766
|
var U;
|
|
3767
|
-
const A = (U =
|
|
3767
|
+
const A = (U = k.items) == null ? void 0 : U.find(
|
|
3768
3768
|
(V) => V._id == _._id && V.combinationKey == _.combinationKey
|
|
3769
3769
|
);
|
|
3770
3770
|
return {
|
|
@@ -3777,22 +3777,22 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3777
3777
|
};
|
|
3778
3778
|
return new Wi(o, l.updateMenu, r).mapGroups([x], !0)[0];
|
|
3779
3779
|
});
|
|
3780
|
-
function m(
|
|
3781
|
-
var x,
|
|
3780
|
+
function m(k) {
|
|
3781
|
+
var x, M;
|
|
3782
3782
|
const y = (x = s.value[c.value].groups) == null ? void 0 : x.findIndex(
|
|
3783
3783
|
(R) => R._id === n.groupId
|
|
3784
|
-
), g = ne(s.value), C = { ...ei(
|
|
3784
|
+
), g = ne(s.value), C = { ...ei(k), _id: n.groupId, groupKey: "" };
|
|
3785
3785
|
(y ?? -1) < 0 ? g[c.value] = {
|
|
3786
3786
|
...g[c.value],
|
|
3787
|
-
groups: [...((
|
|
3787
|
+
groups: [...((M = g[c.value]) == null ? void 0 : M.groups) || [], C]
|
|
3788
3788
|
} : g[c.value].groups[y] = C, s.value = g;
|
|
3789
3789
|
}
|
|
3790
|
-
function b(
|
|
3790
|
+
function b(k) {
|
|
3791
3791
|
const y = d.value.length;
|
|
3792
3792
|
let g = c.value;
|
|
3793
|
-
|
|
3793
|
+
k === "left" ? g = g === 0 ? y - 1 : g - 1 : g = g === y - 1 ? 0 : g + 1, u.value = d.value[g].value;
|
|
3794
3794
|
}
|
|
3795
|
-
function v(
|
|
3795
|
+
function v(k) {
|
|
3796
3796
|
return {
|
|
3797
3797
|
isV4: o.version === B.F_MENU_VERSION.enum.v4,
|
|
3798
3798
|
isDefault: (y) => !1,
|
|
@@ -3815,8 +3815,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3815
3815
|
const S = J(!1);
|
|
3816
3816
|
Re(
|
|
3817
3817
|
() => S.value,
|
|
3818
|
-
(
|
|
3819
|
-
|
|
3818
|
+
(k) => {
|
|
3819
|
+
k && (s.value = ne(n.combinations), u.value = n.combinations[0].combinationKey || "");
|
|
3820
3820
|
}
|
|
3821
3821
|
);
|
|
3822
3822
|
const z = J();
|
|
@@ -3825,7 +3825,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3825
3825
|
trigger: (D = z.value) == null ? void 0 : D.trigger
|
|
3826
3826
|
});
|
|
3827
3827
|
const { t: E } = me();
|
|
3828
|
-
return (
|
|
3828
|
+
return (k, y) => {
|
|
3829
3829
|
const g = G("fm-select"), C = G("fm-button"), x = G("fm-card");
|
|
3830
3830
|
return O(), Y(fn, {
|
|
3831
3831
|
ref_key: "sheet",
|
|
@@ -3836,12 +3836,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3836
3836
|
group: h.value,
|
|
3837
3837
|
action: "update",
|
|
3838
3838
|
title: p(E)("menu.group.update"),
|
|
3839
|
-
"onUpdate:group": y[3] || (y[3] = (
|
|
3840
|
-
"onSubmit:group": y[4] || (y[4] = (
|
|
3841
|
-
"onStatus:show": y[5] || (y[5] = (
|
|
3839
|
+
"onUpdate:group": y[3] || (y[3] = (M) => m(M)),
|
|
3840
|
+
"onSubmit:group": y[4] || (y[4] = (M) => f()),
|
|
3841
|
+
"onStatus:show": y[5] || (y[5] = (M) => S.value = M)
|
|
3842
3842
|
}, {
|
|
3843
|
-
default: L(({ trigger:
|
|
3844
|
-
ve(
|
|
3843
|
+
default: L(({ trigger: M }) => [
|
|
3844
|
+
ve(k.$slots, "default", { trigger: M })
|
|
3845
3845
|
]),
|
|
3846
3846
|
"variant-section": L(() => [
|
|
3847
3847
|
u.value ? (O(), Y(x, {
|
|
@@ -3854,7 +3854,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3854
3854
|
P("div", or, [
|
|
3855
3855
|
w(g, {
|
|
3856
3856
|
modelValue: u.value,
|
|
3857
|
-
"onUpdate:modelValue": y[0] || (y[0] = (
|
|
3857
|
+
"onUpdate:modelValue": y[0] || (y[0] = (M) => u.value = M),
|
|
3858
3858
|
items: d.value,
|
|
3859
3859
|
class: "flex-1"
|
|
3860
3860
|
}, null, 8, ["modelValue", "items"]),
|
|
@@ -3863,13 +3863,13 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3863
3863
|
variant: p(qe).Tertiary,
|
|
3864
3864
|
"prepend-icon": "keyboard_arrow_left",
|
|
3865
3865
|
size: "lg",
|
|
3866
|
-
onClick: y[1] || (y[1] = (
|
|
3866
|
+
onClick: y[1] || (y[1] = (M) => b("left"))
|
|
3867
3867
|
}, null, 8, ["variant"]),
|
|
3868
3868
|
w(C, {
|
|
3869
3869
|
variant: p(qe).Tertiary,
|
|
3870
3870
|
"prepend-icon": "keyboard_arrow_right",
|
|
3871
3871
|
size: "lg",
|
|
3872
|
-
onClick: y[2] || (y[2] = (
|
|
3872
|
+
onClick: y[2] || (y[2] = (M) => b("right"))
|
|
3873
3873
|
}, null, 8, ["variant"])
|
|
3874
3874
|
])
|
|
3875
3875
|
])
|
|
@@ -3906,10 +3906,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3906
3906
|
value: z
|
|
3907
3907
|
}))
|
|
3908
3908
|
]), d = F(() => !!o.state.currentCatalogId || !!o.state.currentSchedulerId), h = F(() => {
|
|
3909
|
-
const z = !o.state.currentSchedulerId, E = o.rules.group.type, j = o.version == B.F_MENU_VERSION.enum.v3, D = o.rules.item.orderFromActiveOnly,
|
|
3909
|
+
const z = !o.state.currentSchedulerId, E = o.rules.group.type, j = o.version == B.F_MENU_VERSION.enum.v3, D = o.rules.item.orderFromActiveOnly, k = o.rules.item.bindToVariant;
|
|
3910
3910
|
return function(g) {
|
|
3911
3911
|
return {
|
|
3912
|
-
link: (C) => !d.value && (!C ||
|
|
3912
|
+
link: (C) => !d.value && (!C || k),
|
|
3913
3913
|
name: (C) => !d.value && !C,
|
|
3914
3914
|
type: E && !g._id && !d.value,
|
|
3915
3915
|
price: g.type != B.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
|
|
@@ -3917,7 +3917,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3917
3917
|
orderFrom: (C) => z ? j ? g.type == B.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? d.value : !!d.value == !C : d.value : !1,
|
|
3918
3918
|
orderFromActiveOnly: D,
|
|
3919
3919
|
showOrderFrom: z ? j ? d.value ? !0 : g.type == B.F_ADDON_GROUP_TYPE.enum.PRODUCT : d.value : !1,
|
|
3920
|
-
bindToVariant:
|
|
3920
|
+
bindToVariant: k,
|
|
3921
3921
|
isOverride: d.value,
|
|
3922
3922
|
isItemGroup: !1,
|
|
3923
3923
|
isV4: !j
|
|
@@ -3933,7 +3933,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3933
3933
|
n(b.value), a("primary"), t.close();
|
|
3934
3934
|
};
|
|
3935
3935
|
return (z, E) => {
|
|
3936
|
-
const j = G("FmSearch"), D = G("FmCheckbox"),
|
|
3936
|
+
const j = G("FmSearch"), D = G("FmCheckbox"), k = G("FmButton");
|
|
3937
3937
|
return c.value.length > 0 ? (O(), Q("div", ur, [
|
|
3938
3938
|
P("div", null, [
|
|
3939
3939
|
w(j, {
|
|
@@ -3945,7 +3945,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3945
3945
|
]),
|
|
3946
3946
|
P("div", cr, [
|
|
3947
3947
|
P("div", null, [
|
|
3948
|
-
(O(!0), Q(
|
|
3948
|
+
(O(!0), Q(ke, null, Ye(c.value, (y) => (O(), Q("div", {
|
|
3949
3949
|
key: y.value
|
|
3950
3950
|
}, [
|
|
3951
3951
|
Qe(w(D, {
|
|
@@ -3965,7 +3965,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3965
3965
|
P("div", dr, [
|
|
3966
3966
|
w(p(Di), null, {
|
|
3967
3967
|
default: L(({ trigger: y }) => [
|
|
3968
|
-
w(
|
|
3968
|
+
w(k, {
|
|
3969
3969
|
label: p(f)("menu.common.actions.add_group"),
|
|
3970
3970
|
variant: "tertiary",
|
|
3971
3971
|
"text-color": "primary",
|
|
@@ -3975,12 +3975,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3975
3975
|
_: 1
|
|
3976
3976
|
}),
|
|
3977
3977
|
P("div", mr, [
|
|
3978
|
-
w(
|
|
3978
|
+
w(k, {
|
|
3979
3979
|
label: p(f)("menu.common.actions.cancel"),
|
|
3980
3980
|
variant: "tertiary",
|
|
3981
3981
|
onClick: E[3] || (E[3] = (y) => p(t).close())
|
|
3982
3982
|
}, null, 8, ["label"]),
|
|
3983
|
-
w(
|
|
3983
|
+
w(k, {
|
|
3984
3984
|
label: p(f)("menu.common.actions.confirm"),
|
|
3985
3985
|
onClick: E[4] || (E[4] = (y) => S())
|
|
3986
3986
|
}, null, 8, ["label"])
|
|
@@ -3999,7 +3999,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
3999
3999
|
title: p(f)("menu.group.add")
|
|
4000
4000
|
}, {
|
|
4001
4001
|
default: L(({ trigger: y }) => [
|
|
4002
|
-
w(
|
|
4002
|
+
w(k, {
|
|
4003
4003
|
label: p(f)("menu.common.actions.add_group"),
|
|
4004
4004
|
icon: "add",
|
|
4005
4005
|
onClick: (g) => y()
|
|
@@ -4141,7 +4141,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4141
4141
|
combinations: y.value ?? [],
|
|
4142
4142
|
fullCombinations: t.fullCombinations,
|
|
4143
4143
|
groupId: _,
|
|
4144
|
-
"onUpdate:combinations":
|
|
4144
|
+
"onUpdate:combinations": M
|
|
4145
4145
|
}, {
|
|
4146
4146
|
default: ({
|
|
4147
4147
|
trigger: A
|
|
@@ -4190,12 +4190,12 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4190
4190
|
groups: _
|
|
4191
4191
|
}));
|
|
4192
4192
|
}
|
|
4193
|
-
const
|
|
4193
|
+
const k = F(() => {
|
|
4194
4194
|
var R;
|
|
4195
4195
|
return !!((R = t.form.variant) != null && R.variantGroupIds.length);
|
|
4196
4196
|
}), y = F(() => {
|
|
4197
4197
|
var R;
|
|
4198
|
-
return
|
|
4198
|
+
return k.value ? (R = t.form.variant) == null ? void 0 : R.variantCombinations : [{
|
|
4199
4199
|
_id: t.form._id,
|
|
4200
4200
|
combinationKey: "",
|
|
4201
4201
|
groups: t.form.groups || []
|
|
@@ -4247,9 +4247,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4247
4247
|
const x = (R) => {
|
|
4248
4248
|
var _;
|
|
4249
4249
|
return (_ = f.value.find((A) => A.value === R)) == null ? void 0 : _.label;
|
|
4250
|
-
},
|
|
4250
|
+
}, M = (R) => {
|
|
4251
4251
|
var _;
|
|
4252
|
-
|
|
4252
|
+
k.value ? l("update:form", "variant", {
|
|
4253
4253
|
variantGroupIds: ((_ = t.form.variant) == null ? void 0 : _.variantGroupIds) || [],
|
|
4254
4254
|
variantCombinations: R
|
|
4255
4255
|
}) : l("update:form", "groups", R[0].groups || []);
|
|
@@ -4336,10 +4336,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4336
4336
|
let S = $e.clone(n.form);
|
|
4337
4337
|
const z = S.variant;
|
|
4338
4338
|
if ((((j = z == null ? void 0 : z.variantCombinations) == null ? void 0 : j.length) ?? 0) > 0 && z) {
|
|
4339
|
-
const
|
|
4340
|
-
if (
|
|
4339
|
+
const k = z.variantCombinations.findIndex((g) => g.combinationKey === v);
|
|
4340
|
+
if (k < 0) return;
|
|
4341
4341
|
const y = $e.clone(z.variantCombinations);
|
|
4342
|
-
y[
|
|
4342
|
+
y[k].inventoryBindings = f, S = {
|
|
4343
4343
|
...S,
|
|
4344
4344
|
variant: {
|
|
4345
4345
|
variantGroupIds: ((D = S.variant) == null ? void 0 : D.variantGroupIds) || [],
|
|
@@ -4420,7 +4420,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4420
4420
|
title: p(t)("menu.inventory.title"),
|
|
4421
4421
|
subTitle: p(t)("menu.inventory.subtitle")
|
|
4422
4422
|
}, {
|
|
4423
|
-
default: L(() => [P("div", yr, [P("div", _r, [(O(!0), Q(
|
|
4423
|
+
default: L(() => [P("div", yr, [P("div", _r, [(O(!0), Q(ke, null, Ye(c.value, (S) => (O(), Y(p(qt), {
|
|
4424
4424
|
ref_for: !0,
|
|
4425
4425
|
ref_key: "inventoryManagerForms",
|
|
4426
4426
|
ref: h,
|
|
@@ -4445,7 +4445,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4445
4445
|
}, Cr = { class: "space-y-16" }, Ar = { class: "space-y-8" }, Rr = {
|
|
4446
4446
|
key: 0,
|
|
4447
4447
|
class: "pl-32 pb-4 space-x-16 flex items-center"
|
|
4448
|
-
}, xr = { class: "fm-typo-en-body-lg-400" },
|
|
4448
|
+
}, xr = { class: "fm-typo-en-body-lg-400" }, Mr = { class: "w-[258px]" }, kr = { class: "w-[117px]" }, Or = {
|
|
4449
4449
|
key: 0,
|
|
4450
4450
|
class: "space-y-8"
|
|
4451
4451
|
}, zr = {
|
|
@@ -4494,7 +4494,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4494
4494
|
}
|
|
4495
4495
|
const b = J(!1);
|
|
4496
4496
|
async function v() {
|
|
4497
|
-
var S, z, E, j, D,
|
|
4497
|
+
var S, z, E, j, D, k, y, g;
|
|
4498
4498
|
if (!(t.form.name || "")) {
|
|
4499
4499
|
const C = document.getElementById("product-name");
|
|
4500
4500
|
if (C) {
|
|
@@ -4518,7 +4518,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4518
4518
|
{
|
|
4519
4519
|
name: t.form.name || "",
|
|
4520
4520
|
lat: (E = (z = (S = n.currentRestaurant) == null ? void 0 : S.value) == null ? void 0 : z.profile.address.coordinates) == null ? void 0 : E[1],
|
|
4521
|
-
lon: (
|
|
4521
|
+
lon: (k = (D = (j = n.currentRestaurant) == null ? void 0 : j.value) == null ? void 0 : D.profile.address.coordinates) == null ? void 0 : k[0]
|
|
4522
4522
|
},
|
|
4523
4523
|
!0
|
|
4524
4524
|
));
|
|
@@ -4532,13 +4532,13 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4532
4532
|
title: p(o)("menu.product.form.price.title")
|
|
4533
4533
|
}, {
|
|
4534
4534
|
default: L(() => {
|
|
4535
|
-
var
|
|
4535
|
+
var k;
|
|
4536
4536
|
return [
|
|
4537
4537
|
P("div", Sr, [
|
|
4538
4538
|
w(it, {
|
|
4539
4539
|
min: 0,
|
|
4540
4540
|
"model-value": f.form.price || null,
|
|
4541
|
-
placeholder: (
|
|
4541
|
+
placeholder: (k = f.fallback) != null && k.price ? p(mt)(f.fallback.price, !1) : void 0,
|
|
4542
4542
|
rules: [
|
|
4543
4543
|
l.value.price ? (y) => !!y || p(o)("menu.product.form.price.fields.selling_price.required") : void 0
|
|
4544
4544
|
].filter(p(pt).isSet),
|
|
@@ -4596,7 +4596,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4596
4596
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
4597
4597
|
s.value ? (O(), Q("div", Rr, [
|
|
4598
4598
|
P("p", xr, de(p(o)("menu.product.form.price.settings.sell_by_unit.per_unit.label")), 1),
|
|
4599
|
-
P("div",
|
|
4599
|
+
P("div", Mr, [
|
|
4600
4600
|
w(j, {
|
|
4601
4601
|
disabled: !l.value.unit,
|
|
4602
4602
|
"model-value": f.form.perXUnit || null,
|
|
@@ -4611,7 +4611,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4611
4611
|
"onUpdate:modelValue": h
|
|
4612
4612
|
}, null, 8, ["disabled", "model-value", "rules", "placeholder"])
|
|
4613
4613
|
]),
|
|
4614
|
-
P("div",
|
|
4614
|
+
P("div", kr, [
|
|
4615
4615
|
w(j, {
|
|
4616
4616
|
"model-value": f.form.unit || null,
|
|
4617
4617
|
rules: [
|
|
@@ -4725,7 +4725,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4725
4725
|
}
|
|
4726
4726
|
), (d, h) => {
|
|
4727
4727
|
const m = G("fm-text-field"), b = G("fm-button"), v = G("fm-side-sheet");
|
|
4728
|
-
return O(), Q(
|
|
4728
|
+
return O(), Q(ke, null, [
|
|
4729
4729
|
ve(d.$slots, "default", { trigger: u }),
|
|
4730
4730
|
w(v, {
|
|
4731
4731
|
id: "variant-form",
|
|
@@ -4843,7 +4843,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4843
4843
|
function v(S, z) {
|
|
4844
4844
|
var j, D;
|
|
4845
4845
|
let E = [...((D = (j = t.form) == null ? void 0 : j.print) == null ? void 0 : D.department) ?? []];
|
|
4846
|
-
z && !E.includes(S) ? E = [...E, S] : z || (E = E.filter((
|
|
4846
|
+
z && !E.includes(S) ? E = [...E, S] : z || (E = E.filter((k) => k !== S)), o("update:form", "print", {
|
|
4847
4847
|
...r(),
|
|
4848
4848
|
...t.form.print,
|
|
4849
4849
|
department: E
|
|
@@ -4865,7 +4865,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4865
4865
|
() => s.value.length,
|
|
4866
4866
|
() => v(s.value[s.value.length - 1]._id, !0)
|
|
4867
4867
|
), (S, z) => {
|
|
4868
|
-
const E = G("fm-switch"), j = G("fm-radio"), D = G("fm-radio-group"),
|
|
4868
|
+
const E = G("fm-switch"), j = G("fm-radio"), D = G("fm-radio-group"), k = G("fm-button"), y = G("fm-checkbox");
|
|
4869
4869
|
return O(), Y(Ke, {
|
|
4870
4870
|
title: p(a)("menu.product.form.print.title")
|
|
4871
4871
|
}, {
|
|
@@ -4897,7 +4897,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4897
4897
|
}, {
|
|
4898
4898
|
default: L(() => [
|
|
4899
4899
|
P("div", Lr, [
|
|
4900
|
-
(O(!0), Q(
|
|
4900
|
+
(O(!0), Q(ke, null, Ye(f.value, (C, x) => (O(), Y(j, {
|
|
4901
4901
|
key: x,
|
|
4902
4902
|
label: C.label,
|
|
4903
4903
|
sublabel: C.description,
|
|
@@ -4920,13 +4920,13 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4920
4920
|
class: "space-y-16"
|
|
4921
4921
|
}, {
|
|
4922
4922
|
item: L(({ element: C }) => {
|
|
4923
|
-
var x,
|
|
4923
|
+
var x, M, R, _, A;
|
|
4924
4924
|
return [
|
|
4925
4925
|
P("div", Br, [
|
|
4926
4926
|
P("div", Kr, [
|
|
4927
|
-
u.value ? (O(), Y(
|
|
4927
|
+
u.value ? (O(), Y(k, {
|
|
4928
4928
|
key: 0,
|
|
4929
|
-
disabled: !((
|
|
4929
|
+
disabled: !((M = (x = t.form.print) == null ? void 0 : x.department) != null && M.includes(C)),
|
|
4930
4930
|
class: "handle",
|
|
4931
4931
|
"prepend-icon": "drag_handle",
|
|
4932
4932
|
variant: "tertiary",
|
|
@@ -4951,7 +4951,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
4951
4951
|
w(p(Nr), { "apply-product": !1 }, {
|
|
4952
4952
|
default: L(({ trigger: C }) => [
|
|
4953
4953
|
P("div", Gr, [
|
|
4954
|
-
w(
|
|
4954
|
+
w(k, {
|
|
4955
4955
|
variant: p(qe).Secondary,
|
|
4956
4956
|
label: p(a)("menu.product.form.print.routes.add"),
|
|
4957
4957
|
"prepend-icon": "add",
|
|
@@ -5121,7 +5121,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5121
5121
|
]),
|
|
5122
5122
|
P("div", Hr, [
|
|
5123
5123
|
P("div", null, [
|
|
5124
|
-
(O(!0), Q(
|
|
5124
|
+
(O(!0), Q(ke, null, Ye(l.value, (f) => (O(), Q("div", {
|
|
5125
5125
|
key: f.value
|
|
5126
5126
|
}, [
|
|
5127
5127
|
Qe(w(b, {
|
|
@@ -5215,9 +5215,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5215
5215
|
const C = $e.clone(t.form);
|
|
5216
5216
|
for (const {
|
|
5217
5217
|
key: x,
|
|
5218
|
-
value:
|
|
5218
|
+
value: M
|
|
5219
5219
|
} of g)
|
|
5220
|
-
C[x] =
|
|
5220
|
+
C[x] = M;
|
|
5221
5221
|
h("replace:form", C);
|
|
5222
5222
|
}
|
|
5223
5223
|
F(() => n.variants.map((g) => ({
|
|
@@ -5233,8 +5233,8 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5233
5233
|
price: C == null ? void 0 : C.price,
|
|
5234
5234
|
inventoryBindings: (C == null ? void 0 : C.inventoryBindings) || t.form.inventoryBindings,
|
|
5235
5235
|
takeawayUsed: (C == null ? void 0 : C.takeawayUsed) || t.form.takeawayUsed,
|
|
5236
|
-
groups: (C == null ? void 0 : C.groups) || ((x = t.form.groups) == null ? void 0 : x.map((
|
|
5237
|
-
...
|
|
5236
|
+
groups: (C == null ? void 0 : C.groups) || ((x = t.form.groups) == null ? void 0 : x.map((M) => ({
|
|
5237
|
+
...M,
|
|
5238
5238
|
groupKey: ""
|
|
5239
5239
|
})))
|
|
5240
5240
|
};
|
|
@@ -5262,17 +5262,17 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5262
5262
|
var C;
|
|
5263
5263
|
return (((C = t.form.variant) == null ? void 0 : C.variantCombinations) || []).map((x) => {
|
|
5264
5264
|
var R, _;
|
|
5265
|
-
const
|
|
5265
|
+
const M = (_ = (R = t.fallback) == null ? void 0 : R.variant) == null ? void 0 : _.variantCombinations.find(({
|
|
5266
5266
|
combinationKey: A
|
|
5267
5267
|
}) => A === x.combinationKey);
|
|
5268
5268
|
return {
|
|
5269
5269
|
...x,
|
|
5270
5270
|
fallback: {
|
|
5271
|
-
...
|
|
5271
|
+
...M,
|
|
5272
5272
|
_id: x._id,
|
|
5273
5273
|
combinationKey: x.combinationKey,
|
|
5274
|
-
price: c.value ? t.form.price ?? (
|
|
5275
|
-
minPrice: t.form.minPrice ?? (
|
|
5274
|
+
price: c.value ? t.form.price ?? (M == null ? void 0 : M.price) : x.price ?? (M == null ? void 0 : M.price),
|
|
5275
|
+
minPrice: t.form.minPrice ?? (M == null ? void 0 : M.minPrice)
|
|
5276
5276
|
}
|
|
5277
5277
|
};
|
|
5278
5278
|
});
|
|
@@ -5280,7 +5280,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5280
5280
|
function E(g, C = (x) => x) {
|
|
5281
5281
|
var R;
|
|
5282
5282
|
const x = g.filter((_) => !!_);
|
|
5283
|
-
let
|
|
5283
|
+
let M;
|
|
5284
5284
|
if (x.length) {
|
|
5285
5285
|
const _ = x.map((U) => n.variants.find((V) => V._id === U)), A = Se.fullVariantCombination(_).map(({
|
|
5286
5286
|
combinationKey: U
|
|
@@ -5299,7 +5299,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5299
5299
|
});
|
|
5300
5300
|
return;
|
|
5301
5301
|
}
|
|
5302
|
-
|
|
5302
|
+
M = {
|
|
5303
5303
|
...t.form,
|
|
5304
5304
|
variant: {
|
|
5305
5305
|
variantGroupIds: x,
|
|
@@ -5316,19 +5316,19 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5316
5316
|
}, {
|
|
5317
5317
|
key: "takeawayUsed",
|
|
5318
5318
|
value: A.length === 1 ? A[0] : null
|
|
5319
|
-
}]),
|
|
5319
|
+
}]), M = {
|
|
5320
5320
|
...t.form,
|
|
5321
5321
|
variant: void 0,
|
|
5322
5322
|
takeawayUsed: A.length === 1 ? A[0] : null
|
|
5323
5323
|
};
|
|
5324
5324
|
}
|
|
5325
|
-
h("replace:form", a.initDynamicGroupItem(
|
|
5325
|
+
h("replace:form", a.initDynamicGroupItem(M));
|
|
5326
5326
|
}
|
|
5327
5327
|
async function j(g, C, x) {
|
|
5328
|
-
const
|
|
5329
|
-
|
|
5328
|
+
const M = $e.clone(t.form);
|
|
5329
|
+
M.variant.variantCombinations[g][C] = x, m([{
|
|
5330
5330
|
key: "variant",
|
|
5331
|
-
value:
|
|
5331
|
+
value: M.variant
|
|
5332
5332
|
}]);
|
|
5333
5333
|
}
|
|
5334
5334
|
const D = F(() => [{
|
|
@@ -5357,10 +5357,10 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5357
5357
|
enableSorting: !1,
|
|
5358
5358
|
cell: (g) => {
|
|
5359
5359
|
var R, _;
|
|
5360
|
-
const C = g.getValue(),
|
|
5360
|
+
const C = g.getValue(), M = (R = g.row.original.fallback) == null ? void 0 : R.orderFrom;
|
|
5361
5361
|
return he(ai, {
|
|
5362
5362
|
modelValue: C ?? null,
|
|
5363
|
-
fallback: t.form.orderFrom ??
|
|
5363
|
+
fallback: t.form.orderFrom ?? M ?? ((_ = t.fallback) == null ? void 0 : _.orderFrom),
|
|
5364
5364
|
disable: !s.value.orderFrom,
|
|
5365
5365
|
required: s.value.orderFrom && s.value.orderFromActiveOnly,
|
|
5366
5366
|
editActiveOnly: s.value.orderFromActiveOnly || !1,
|
|
@@ -5407,7 +5407,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5407
5407
|
showCurrency: !1
|
|
5408
5408
|
});
|
|
5409
5409
|
}
|
|
5410
|
-
}]),
|
|
5410
|
+
}]), k = F(() => ({
|
|
5411
5411
|
minPrice: u.value
|
|
5412
5412
|
}));
|
|
5413
5413
|
function y(g) {
|
|
@@ -5416,7 +5416,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5416
5416
|
}) : !0;
|
|
5417
5417
|
}
|
|
5418
5418
|
return (g, C) => {
|
|
5419
|
-
const x = G("fm-button"),
|
|
5419
|
+
const x = G("fm-button"), M = G("fm-icon"), R = G("FmFormGroup"), _ = G("fm-table");
|
|
5420
5420
|
return O(), Y(Ke, {
|
|
5421
5421
|
title: p(l)("menu.product.form.variant.title"),
|
|
5422
5422
|
"sub-title": p(l)("menu.product.form.variant.subtitle")
|
|
@@ -5452,7 +5452,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5452
5452
|
variant: p(qe).Tertiary,
|
|
5453
5453
|
class: "handle",
|
|
5454
5454
|
"prepend-icon": "drag_handle"
|
|
5455
|
-
}, null, 8, ["variant"]), P("div", os, [P("p", as, de((N = d.value[V]) == null ? void 0 : N.name), 1), w(
|
|
5455
|
+
}, null, 8, ["variant"]), P("div", os, [P("p", as, de((N = d.value[V]) == null ? void 0 : N.name), 1), w(M, {
|
|
5456
5456
|
class: "cursor-pointer",
|
|
5457
5457
|
name: "close",
|
|
5458
5458
|
onClick: Rt((q) => {
|
|
@@ -5470,7 +5470,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5470
5470
|
key: 0,
|
|
5471
5471
|
class: "w-full",
|
|
5472
5472
|
"column-defs": D.value,
|
|
5473
|
-
"column-visibility":
|
|
5473
|
+
"column-visibility": k.value,
|
|
5474
5474
|
"page-size": z.value.length ?? 0,
|
|
5475
5475
|
"row-data": z.value ?? [],
|
|
5476
5476
|
"hide-footer": "",
|
|
@@ -5593,7 +5593,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5593
5593
|
}
|
|
5594
5594
|
const D = F(
|
|
5595
5595
|
() => !!a.currentCatalog || !!a.state.currentSchedulerId
|
|
5596
|
-
),
|
|
5596
|
+
), k = F(() => {
|
|
5597
5597
|
var W;
|
|
5598
5598
|
return D.value ? m.value.category == "" || m.value.category == null && ((W = h.value) == null ? void 0 : W.category) == null : a.version === B.F_MENU_VERSION.enum.v4 && m.value.category == null;
|
|
5599
5599
|
}), y = F(() => o.itemAttributeSettings.value.length > 0 && !D.value);
|
|
@@ -5653,7 +5653,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5653
5653
|
}
|
|
5654
5654
|
]
|
|
5655
5655
|
};
|
|
5656
|
-
}),
|
|
5656
|
+
}), M = J(
|
|
5657
5657
|
m.value.category != null || !!m.value.code || !!m.value.orderFrom
|
|
5658
5658
|
);
|
|
5659
5659
|
function R(W) {
|
|
@@ -5804,7 +5804,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5804
5804
|
}
|
|
5805
5805
|
function ye() {
|
|
5806
5806
|
D.value && [
|
|
5807
|
-
[
|
|
5807
|
+
[M.value, R],
|
|
5808
5808
|
[A.value, U]
|
|
5809
5809
|
].forEach(([$, se]) => {
|
|
5810
5810
|
$ || se(!1);
|
|
@@ -5816,7 +5816,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5816
5816
|
const { isAtMost: lt } = Ni();
|
|
5817
5817
|
F(() => lt("sm"));
|
|
5818
5818
|
const si = J(null), vn = Pn(si);
|
|
5819
|
-
return (W, $) => (O(), Q(
|
|
5819
|
+
return (W, $) => (O(), Q(ke, null, [
|
|
5820
5820
|
ve(W.$slots, "trigger", _n(wn({
|
|
5821
5821
|
trigger: d
|
|
5822
5822
|
}))),
|
|
@@ -5869,9 +5869,9 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5869
5869
|
"onUpdate:catalogAndScheduler": f
|
|
5870
5870
|
}, null, 8, ["linked-status"])) : te("", !0),
|
|
5871
5871
|
w(Ze, {
|
|
5872
|
-
toggle:
|
|
5872
|
+
toggle: M.value,
|
|
5873
5873
|
"onUpdate:toggle": [
|
|
5874
|
-
$[1] || ($[1] = (H) =>
|
|
5874
|
+
$[1] || ($[1] = (H) => M.value = H),
|
|
5875
5875
|
$[2] || ($[2] = (H) => R(H))
|
|
5876
5876
|
],
|
|
5877
5877
|
disabled: !D.value,
|
|
@@ -5882,7 +5882,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5882
5882
|
w(Pa, {
|
|
5883
5883
|
fallback: h.value,
|
|
5884
5884
|
form: m.value,
|
|
5885
|
-
"is-addon":
|
|
5885
|
+
"is-addon": k.value,
|
|
5886
5886
|
"is-override": D.value,
|
|
5887
5887
|
"is-create": t.action === "add",
|
|
5888
5888
|
thumbnail: z.value,
|
|
@@ -5925,7 +5925,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5925
5925
|
w(Pr, {
|
|
5926
5926
|
fallback: h.value,
|
|
5927
5927
|
form: m.value,
|
|
5928
|
-
"is-addon":
|
|
5928
|
+
"is-addon": k.value,
|
|
5929
5929
|
"is-override": D.value,
|
|
5930
5930
|
"onUpdate:form": E
|
|
5931
5931
|
}, null, 8, ["fallback", "form", "is-addon", "is-override"])
|
|
@@ -5949,7 +5949,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5949
5949
|
fallback: h.value,
|
|
5950
5950
|
form: m.value,
|
|
5951
5951
|
"full-combinations": S.value,
|
|
5952
|
-
"is-addon":
|
|
5952
|
+
"is-addon": k.value,
|
|
5953
5953
|
"is-override": D.value,
|
|
5954
5954
|
"onUpdate:form": E,
|
|
5955
5955
|
"onReplace:form": $[6] || ($[6] = (H) => m.value = H)
|
|
@@ -5973,7 +5973,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5973
5973
|
fallback: h.value,
|
|
5974
5974
|
form: m.value,
|
|
5975
5975
|
"full-combinations": S.value,
|
|
5976
|
-
"is-addon":
|
|
5976
|
+
"is-addon": k.value,
|
|
5977
5977
|
"is-override": D.value,
|
|
5978
5978
|
"onUpdate:form": E,
|
|
5979
5979
|
"onReplace:form": $[9] || ($[9] = (H) => m.value = H)
|
|
@@ -5998,7 +5998,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
5998
5998
|
fallback: h.value,
|
|
5999
5999
|
form: m.value,
|
|
6000
6000
|
"full-combinations": S.value,
|
|
6001
|
-
"is-addon":
|
|
6001
|
+
"is-addon": k.value,
|
|
6002
6002
|
"is-override": D.value,
|
|
6003
6003
|
"onUpdate:form": E,
|
|
6004
6004
|
"onReplace:form": $[12] || ($[12] = (H) => m.value = H)
|
|
@@ -6023,7 +6023,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
6023
6023
|
fallback: h.value,
|
|
6024
6024
|
form: m.value,
|
|
6025
6025
|
"full-combinations": S.value,
|
|
6026
|
-
"is-addon":
|
|
6026
|
+
"is-addon": k.value,
|
|
6027
6027
|
"is-override": D.value,
|
|
6028
6028
|
"onUpdate:form": E,
|
|
6029
6029
|
"onReplace:form": $[15] || ($[15] = (H) => m.value = H)
|
|
@@ -6048,7 +6048,7 @@ const Ga = /* @__PURE__ */ st(La, [["render", Ka]]), ja = { class: "fm-typo-en-t
|
|
|
6048
6048
|
fallback: h.value,
|
|
6049
6049
|
form: m.value,
|
|
6050
6050
|
"full-combinations": S.value,
|
|
6051
|
-
"is-addon":
|
|
6051
|
+
"is-addon": k.value,
|
|
6052
6052
|
"is-override": D.value,
|
|
6053
6053
|
"onUpdate:form": E,
|
|
6054
6054
|
"onReplace:form": $[18] || ($[18] = (H) => m.value = H)
|
|
@@ -6113,21 +6113,21 @@ function gn(e, i) {
|
|
|
6113
6113
|
const ri = Pi("item-manager", () => {
|
|
6114
6114
|
const e = fe(), i = De(), t = Be(), n = He(i), a = Xe(n), o = Cn(), { t: r } = me(), l = (x) => {
|
|
6115
6115
|
if (!o) throw new Error("No current instance found");
|
|
6116
|
-
const { container:
|
|
6116
|
+
const { container: M } = Dn(vs, o, {
|
|
6117
6117
|
...x,
|
|
6118
6118
|
autoShow: !0,
|
|
6119
6119
|
"onUpdate:show": async (R) => {
|
|
6120
|
-
R || (An(null,
|
|
6120
|
+
R || (An(null, M), M.remove());
|
|
6121
6121
|
}
|
|
6122
6122
|
});
|
|
6123
6123
|
};
|
|
6124
6124
|
function s(x) {
|
|
6125
6125
|
var _;
|
|
6126
|
-
const
|
|
6127
|
-
return delete
|
|
6126
|
+
const M = ne(x), R = (_ = M.variant) == null ? void 0 : _.variantCombinations;
|
|
6127
|
+
return delete M.variant, delete M.thumbnail, [M, ...R || []];
|
|
6128
6128
|
}
|
|
6129
|
-
function u(x,
|
|
6130
|
-
const A = ne(
|
|
6129
|
+
function u(x, M, R, _) {
|
|
6130
|
+
const A = ne(M), U = R ? A.modules.catalog.find((T) => T._id === R) : null, V = _ ? A.modules.scheduler.find((T) => T._id === _) : null, N = U ? ne(U) : void 0, q = R ? A.modules.catalog.filter((T) => T._id !== R) : [], re = V ? ne(V) : void 0, Ce = x.reduce((T, K) => (T[K._id] = s(K), T), {});
|
|
6131
6131
|
function I(T = []) {
|
|
6132
6132
|
const K = x.map((Z) => Z._id);
|
|
6133
6133
|
return [
|
|
@@ -6164,31 +6164,31 @@ const ri = Pi("item-manager", () => {
|
|
|
6164
6164
|
};
|
|
6165
6165
|
}
|
|
6166
6166
|
function c(x) {
|
|
6167
|
-
const { saveMenuWithThumbnail:
|
|
6167
|
+
const { saveMenuWithThumbnail: M } = a;
|
|
6168
6168
|
l({
|
|
6169
6169
|
action: "add",
|
|
6170
6170
|
categoryId: x,
|
|
6171
6171
|
"onSubmit:form": async (R, _) => {
|
|
6172
6172
|
R.inventoryBindings ?? (R.inventoryBindings = []), R.inventoryBindings.length === 0 && (R.inventoryBindings = null);
|
|
6173
6173
|
const A = yi();
|
|
6174
|
-
await
|
|
6174
|
+
await M(R, pe.F_OPERATION_TYPE.create, A, _);
|
|
6175
6175
|
}
|
|
6176
6176
|
});
|
|
6177
6177
|
}
|
|
6178
|
-
function d(x,
|
|
6178
|
+
function d(x, M) {
|
|
6179
6179
|
var _;
|
|
6180
6180
|
return {
|
|
6181
|
-
...
|
|
6181
|
+
...M.find((A) => !A.combinationKey),
|
|
6182
6182
|
variant: {
|
|
6183
6183
|
...x.variant,
|
|
6184
|
-
variantCombinations: (_ = x.variant) == null ? void 0 : _.variantCombinations.map((A) =>
|
|
6184
|
+
variantCombinations: (_ = x.variant) == null ? void 0 : _.variantCombinations.map((A) => M.find((V) => V.combinationKey === A.combinationKey) || { _id: x._id, combinationKey: A.combinationKey })
|
|
6185
6185
|
},
|
|
6186
6186
|
_id: x._id
|
|
6187
6187
|
};
|
|
6188
6188
|
}
|
|
6189
|
-
async function h(x,
|
|
6189
|
+
async function h(x, M, R) {
|
|
6190
6190
|
l({
|
|
6191
|
-
initialForm: d(x,
|
|
6191
|
+
initialForm: d(x, M || []),
|
|
6192
6192
|
action: "update",
|
|
6193
6193
|
"onSubmit:form": async (_) => {
|
|
6194
6194
|
_.inventoryBindings ?? (_.inventoryBindings = []), _.inventoryBindings.length === 0 && (_.inventoryBindings = null), await R(
|
|
@@ -6204,55 +6204,55 @@ const ri = Pi("item-manager", () => {
|
|
|
6204
6204
|
}
|
|
6205
6205
|
async function m(x) {
|
|
6206
6206
|
var U;
|
|
6207
|
-
const
|
|
6207
|
+
const M = e.currentCatalog, R = e.state.currentSchedulerId, _ = M.override.scheduler[R] ?? {
|
|
6208
6208
|
_id: R
|
|
6209
6209
|
}, A = (U = _ == null ? void 0 : _.items) == null ? void 0 : U.filter((V) => V._id === x._id);
|
|
6210
6210
|
await h(x, A, async (V) => {
|
|
6211
6211
|
const N = V.modules.catalog.find(
|
|
6212
|
-
(q) => q._id ===
|
|
6212
|
+
(q) => q._id === M._id
|
|
6213
6213
|
);
|
|
6214
6214
|
await new Ue(N, e, a.updateMenu, t).update();
|
|
6215
6215
|
});
|
|
6216
6216
|
}
|
|
6217
6217
|
async function b(x) {
|
|
6218
|
-
const
|
|
6219
|
-
await h(x,
|
|
6218
|
+
const M = e.currentCatalog;
|
|
6219
|
+
await h(x, M.override.items[x._id], async (R) => {
|
|
6220
6220
|
const _ = R.modules.catalog.find(
|
|
6221
|
-
(A) => A._id ===
|
|
6221
|
+
(A) => A._id === M._id
|
|
6222
6222
|
);
|
|
6223
6223
|
await new Ue(_, e, a.updateMenu, t).update();
|
|
6224
6224
|
});
|
|
6225
6225
|
}
|
|
6226
6226
|
async function v(x) {
|
|
6227
|
-
const
|
|
6227
|
+
const M = e.schedulers.find(
|
|
6228
6228
|
(_) => _._id === e.state.currentSchedulerId
|
|
6229
|
-
), R =
|
|
6229
|
+
), R = M.items.filter((_) => _._id === x._id);
|
|
6230
6230
|
await h(x, R, async (_) => {
|
|
6231
6231
|
const A = _.modules.scheduler.find(
|
|
6232
|
-
(U) => U._id ===
|
|
6232
|
+
(U) => U._id === M._id
|
|
6233
6233
|
);
|
|
6234
6234
|
await new _t(A, e, a.updateMenu, t).update();
|
|
6235
6235
|
});
|
|
6236
6236
|
}
|
|
6237
6237
|
async function f(x) {
|
|
6238
6238
|
var A, U;
|
|
6239
|
-
const
|
|
6239
|
+
const M = e.state.currentSchedulerId, R = ne(e.currentCatalog), _ = (U = ((A = R.override.scheduler[M]) == null ? void 0 : A.items) || []) == null ? void 0 : U.reduce((V, N) => {
|
|
6240
6240
|
if (N.combinationKey) return [...V, N];
|
|
6241
6241
|
const q = x.find((re) => re._id === N._id);
|
|
6242
6242
|
return q ? [...V, { ...N, price: q.price }] : [...V, N];
|
|
6243
6243
|
}, []);
|
|
6244
6244
|
R.override.scheduler = {
|
|
6245
6245
|
...R.override.scheduler,
|
|
6246
|
-
[
|
|
6247
|
-
...R.override.scheduler[
|
|
6248
|
-
_id:
|
|
6246
|
+
[M]: {
|
|
6247
|
+
...R.override.scheduler[M],
|
|
6248
|
+
_id: M,
|
|
6249
6249
|
items: _
|
|
6250
6250
|
}
|
|
6251
6251
|
}, await new Ue(R, e, a.updateMenu, t).update();
|
|
6252
6252
|
}
|
|
6253
6253
|
async function S(x) {
|
|
6254
6254
|
var A;
|
|
6255
|
-
const
|
|
6255
|
+
const M = ne(e.currentCatalog), R = (A = Object.entries(M.override.items)) == null ? void 0 : A.reduce(
|
|
6256
6256
|
(U, [V, N]) => {
|
|
6257
6257
|
const q = x.find((Ce) => Ce._id === V);
|
|
6258
6258
|
if (!q)
|
|
@@ -6273,9 +6273,9 @@ const ri = Pi("item-manager", () => {
|
|
|
6273
6273
|
), { updateMenu: _ } = a;
|
|
6274
6274
|
await new Ue(
|
|
6275
6275
|
{
|
|
6276
|
-
...
|
|
6276
|
+
...M,
|
|
6277
6277
|
override: {
|
|
6278
|
-
...
|
|
6278
|
+
...M.override,
|
|
6279
6279
|
items: R
|
|
6280
6280
|
}
|
|
6281
6281
|
},
|
|
@@ -6285,14 +6285,14 @@ const ri = Pi("item-manager", () => {
|
|
|
6285
6285
|
).update();
|
|
6286
6286
|
}
|
|
6287
6287
|
async function z(x) {
|
|
6288
|
-
const
|
|
6288
|
+
const M = ne(e.currentScheduler), R = M.items.reduce((_, A) => {
|
|
6289
6289
|
if (A.combinationKey) return [..._, A];
|
|
6290
6290
|
const U = x.find((V) => V._id === A._id);
|
|
6291
6291
|
return U ? [..._, { ...A, price: U.price }] : [..._, A];
|
|
6292
6292
|
}, []);
|
|
6293
6293
|
await new _t(
|
|
6294
6294
|
{
|
|
6295
|
-
...
|
|
6295
|
+
...M,
|
|
6296
6296
|
items: R
|
|
6297
6297
|
},
|
|
6298
6298
|
e,
|
|
@@ -6301,7 +6301,7 @@ const ri = Pi("item-manager", () => {
|
|
|
6301
6301
|
).update();
|
|
6302
6302
|
}
|
|
6303
6303
|
async function E(x) {
|
|
6304
|
-
const
|
|
6304
|
+
const M = x.reduce((_, A) => {
|
|
6305
6305
|
const U = e.items.find((V) => V._id === A._id);
|
|
6306
6306
|
return U && _.push({
|
|
6307
6307
|
...U,
|
|
@@ -6314,37 +6314,37 @@ const ri = Pi("item-manager", () => {
|
|
|
6314
6314
|
}), _;
|
|
6315
6315
|
}, []), { updateMenu: R } = a;
|
|
6316
6316
|
await R(
|
|
6317
|
-
|
|
6317
|
+
M.map((_) => ({
|
|
6318
6318
|
module: B.F_MENU_MODULE_V4_KEY.enum.item,
|
|
6319
6319
|
operation: pe.F_OPERATION_TYPE.update,
|
|
6320
6320
|
data: _
|
|
6321
6321
|
})),
|
|
6322
|
-
`${
|
|
6322
|
+
`${M.length} products`
|
|
6323
6323
|
);
|
|
6324
6324
|
}
|
|
6325
6325
|
function j(x) {
|
|
6326
|
-
const { saveMenuWithThumbnail:
|
|
6326
|
+
const { saveMenuWithThumbnail: M } = a;
|
|
6327
6327
|
l({
|
|
6328
6328
|
initialForm: x,
|
|
6329
6329
|
action: "update",
|
|
6330
6330
|
"onSubmit:form": async (R, _) => {
|
|
6331
6331
|
const A = yi(x._id);
|
|
6332
|
-
R.inventoryBindings ?? (R.inventoryBindings = []), R.inventoryBindings.length === 0 && (R.inventoryBindings = null), await
|
|
6332
|
+
R.inventoryBindings ?? (R.inventoryBindings = []), R.inventoryBindings.length === 0 && (R.inventoryBindings = null), await M(R, pe.F_OPERATION_TYPE.update, A, _);
|
|
6333
6333
|
}
|
|
6334
6334
|
});
|
|
6335
6335
|
}
|
|
6336
6336
|
async function D(x) {
|
|
6337
|
-
const
|
|
6338
|
-
e.currentCatalog ? e.state.currentSchedulerId ? await m(
|
|
6337
|
+
const M = e.state.menu.modules.item.find((R) => R._id === x);
|
|
6338
|
+
e.currentCatalog ? e.state.currentSchedulerId ? await m(M) : await b(M) : e.state.currentSchedulerId ? await v(M) : j(M);
|
|
6339
6339
|
}
|
|
6340
|
-
async function
|
|
6340
|
+
async function k(x) {
|
|
6341
6341
|
e.currentCatalog ? e.currentScheduler ? await f(x) : await S(x) : (
|
|
6342
6342
|
// If Main
|
|
6343
6343
|
e.currentScheduler ? await z(x) : await E(x)
|
|
6344
6344
|
);
|
|
6345
6345
|
}
|
|
6346
6346
|
function y(x) {
|
|
6347
|
-
const { updateMenu:
|
|
6347
|
+
const { updateMenu: M } = a, R = x.length > 1 ? `${x.length} products` : x[0].name;
|
|
6348
6348
|
t.open({
|
|
6349
6349
|
title: r("menu.common.dialog.remove.product.title"),
|
|
6350
6350
|
message: r("menu.common.dialog.remove.product.message", { name: R }),
|
|
@@ -6358,7 +6358,7 @@ const ri = Pi("item-manager", () => {
|
|
|
6358
6358
|
close: !0
|
|
6359
6359
|
}
|
|
6360
6360
|
}).onPrimary(async () => {
|
|
6361
|
-
await
|
|
6361
|
+
await M(
|
|
6362
6362
|
x.map(({ _id: _ }) => ({
|
|
6363
6363
|
module: B.F_MENU_MODULE_V4_KEY.enum.item,
|
|
6364
6364
|
operation: pe.F_OPERATION_TYPE.delete,
|
|
@@ -6381,16 +6381,16 @@ const ri = Pi("item-manager", () => {
|
|
|
6381
6381
|
e,
|
|
6382
6382
|
a.updateMenu,
|
|
6383
6383
|
t
|
|
6384
|
-
).unlinkProduct(x.map((
|
|
6384
|
+
).unlinkProduct(x.map((M) => M._id)) : e.currentCatalog ? await new Ue(
|
|
6385
6385
|
e.currentCatalog,
|
|
6386
6386
|
e,
|
|
6387
6387
|
a.updateMenu,
|
|
6388
6388
|
t
|
|
6389
|
-
).unlinkProduct(x.map((
|
|
6389
|
+
).unlinkProduct(x.map((M) => M._id)) : y(x);
|
|
6390
6390
|
}
|
|
6391
6391
|
async function C(x) {
|
|
6392
|
-
const { updateMenu:
|
|
6393
|
-
await
|
|
6392
|
+
const { updateMenu: M } = a;
|
|
6393
|
+
await M(
|
|
6394
6394
|
{
|
|
6395
6395
|
module: B.F_MENU_MODULE_V4_KEY.enum.item,
|
|
6396
6396
|
operation: pe.F_OPERATION_TYPE.rearrange,
|
|
@@ -6403,7 +6403,7 @@ const ri = Pi("item-manager", () => {
|
|
|
6403
6403
|
initDynamicGroupItem: (x) => gn(e, x),
|
|
6404
6404
|
create: c,
|
|
6405
6405
|
update: D,
|
|
6406
|
-
updateMany:
|
|
6406
|
+
updateMany: k,
|
|
6407
6407
|
deleteItem: g,
|
|
6408
6408
|
rearrange: C
|
|
6409
6409
|
};
|