@feedmepos/mf-menu 0.32.21-dev → 0.32.23-dev
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-Dwla-J1j.js → App-CAOIKfMD.js} +5 -5
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BmJmC8Bs.js → ApplyProduct.vue_vue_type_script_setup_true_lang-RQVYf4A4.js} +3 -3
- package/dist/{Catalog-Vis5yD-r.js → Catalog-CJuiJfL9.js} +6 -6
- package/dist/{Category-heg6FU7b.js → Category-BqnZierG.js} +4 -4
- package/dist/{Category-DVQz16Ry.js → Category-CFUJ_EsE.js} +6 -6
- package/dist/{CookingGuide-Bc8ct0sG.js → CookingGuide-DxVSGE0M.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Cumf8lby.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-wz08z0VQ.js} +1 -1
- package/dist/{Group-DbAgxVzi.js → Group-BI828pC8.js} +1 -1
- package/dist/{Group-C_jFM4CC.js → Group-FWfm-vEB.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-D63IXz9P.js → Group.vue_vue_type_script_setup_true_lang-DHSTZOFI.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Dda9XLl2.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D_pZCDQw.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Djc10Q7Q.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DP0_Vu0i.js} +6 -6
- package/dist/{Ingredient-GAUMl80x.js → Ingredient-D_pE3xfR.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CYIYXpsY.js → InventoryBinding.vue_vue_type_script_setup_true_lang-9IC67-fN.js} +2 -2
- package/dist/{LinkProductSideSheet-D7jEO5m7.js → LinkProductSideSheet-DUrebn2j.js} +3 -3
- package/dist/{MenuSetting-BGgaKmhk.js → MenuSetting-BoY7Iv31.js} +5 -5
- package/dist/{PrintRoute-o50xSmjE.js → PrintRoute-B8Jnft5v.js} +4 -4
- package/dist/{Product-DU4b9WOa.js → Product-EPdNsg96.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-DyEohirr.js → Product.vue_vue_type_script_setup_true_lang-BnoJKHkn.js} +12 -12
- package/dist/{ProductInternalTools-DtbfmPUP.js → ProductInternalTools-C0DStj0q.js} +5 -5
- package/dist/{Products-PxQ1DBGT.js → Products-CmtlTeb3.js} +46 -46
- package/dist/{Publish-D7z9KyQO.js → Publish-9oo4vdUY.js} +3 -3
- package/dist/{Recipe-lZLB0--K.js → Recipe-cyBJQqq-.js} +4 -4
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-Dl1egq8i.js → RuleView.vue_vue_type_script_setup_true_lang-C90TWyXI.js} +223 -223
- package/dist/{Scheduler-Dx-QnQy0.js → Scheduler-BX0LMRWZ.js} +3 -3
- package/dist/{ServingSequence-BSro9G7x.js → ServingSequence-DQkVg60M.js} +3 -3
- package/dist/{Setting-D4-lixQW.js → Setting-B4jz4UWp.js} +5 -5
- package/dist/{Subcategory-B52bfESq.js → Subcategory-B4dTprP8.js} +4 -4
- package/dist/{Takeaway-BeLl3GP7.js → Takeaway-CA-RFy_z.js} +4 -4
- package/dist/{Takeaway-Bx5xyHv7.js → Takeaway-CaLTgMO4.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-C1zHdUAQ.js → Takeaway.vue_vue_type_script_setup_true_lang-C2IEzYa5.js} +5 -5
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-DVQ7GO7o.js → Thumbnail.vue_vue_type_script_setup_true_lang-8rQTcdvO.js} +4 -4
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DYtprN7X.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BmnhSCYJ.js} +13 -13
- package/dist/{Unit-DaCYLXzg.js → Unit-BgU5L_g-.js} +2 -2
- package/dist/{Variant-D9rGqnlg.js → Variant-DAzBNVnp.js} +3 -3
- package/dist/{_id_-DClzbDlU.js → _id_-CWsXHGPD.js} +9 -9
- package/dist/{app-B5dd_eIe.js → app-ljx4X7j5.js} +1 -1
- package/dist/{app-fPD0ZEP9.js → app-t_jA_fe-.js} +26 -26
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/types/rule.d.ts +1 -0
- package/dist/assets/{linked-status-SOByQJgY.js → linked-status-BK0n8nVZ.js} +2 -2
- package/dist/assets/{menu-export-CuwJS47o.js → menu-export-DKR-QKkV.js} +2 -2
- package/dist/assets/{override-menu-C7XPhEmL.js → override-menu-DCKxlook.js} +2 -2
- package/dist/assets/{validate-menu-DOAddUd2.js → validate-menu-tySDOc4N.js} +2 -2
- package/dist/{catalog-CNnbWu96.js → catalog-5tB9X7Xs.js} +1 -1
- package/dist/{catalogSetting-DP62DWkB.js → catalogSetting-QxWRxva5.js} +1 -1
- package/dist/{category-CdzhVKm4.js → category-DrvPbpMM.js} +1 -1
- package/dist/{currency-DFxqwIUr.js → currency-CMVwARyT.js} +1 -1
- package/dist/{dayjs.min-DfZ_ykTm.js → dayjs.min-B3O9b4rR.js} +1 -1
- package/dist/{index-C9q-JDYc.js → index-BMKv7cXG.js} +1 -1
- package/dist/{index-CJNbchv4.js → index-BqIyQm3G.js} +4 -4
- package/dist/{index-CTutVGPk.js → index-CPo5EAsu.js} +3 -3
- package/dist/{index.vue_vue_type_script_setup_true_lang-Df9ujiv_.js → index.vue_vue_type_script_setup_true_lang-C7QFfxg3.js} +6 -5
- package/dist/{item-coitMxGZ.js → item-DTHPxJ6P.js} +807 -795
- package/dist/{jszip.min-B7sXIIg2.js → jszip.min-DN3rFY5x.js} +383 -383
- package/dist/{menu-3pJDXeSy.js → menu-B9lAniAI.js} +1 -1
- package/dist/{menuV2-XGSkthHP.js → menuV2-1YBShKfa.js} +98 -97
- package/dist/{priceTier-BmfxjZ96.js → priceTier-ox717yO7.js} +1 -1
- package/dist/{scheduler-CBv977hM.js → scheduler-DgqZEEDd.js} +4 -4
- package/dist/{subcategory-DCaC7zXY.js → subcategory-D6xrUj-f.js} +2 -2
- package/dist/{toExcel-Cwuf30kF.js → toExcel-CVN-t5FF.js} +2 -2
- package/dist/{unit-nGbEMHUd.js → unit-BYzivjgn.js} +2 -2
- package/package.json +1 -1
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import { defineStore as Oi } from "pinia";
|
|
2
|
-
import { defineComponent as me, resolveComponent as N, createElementBlock as ne, createBlock as
|
|
3
|
-
import { M as ke, A as
|
|
2
|
+
import { defineComponent as me, resolveComponent as N, createElementBlock as ne, createBlock as H, openBlock as A, createElementVNode as P, createVNode as g, toDisplayString as de, Fragment as Me, renderList as Ne, h as Ce, ref as te, computed as O, watch as Re, unref as h, renderSlot as ve, withCtx as V, createCommentVNode as ie, Transition as bn, normalizeClass as Fe, resolveDynamicComponent as St, withDirectives as ct, vShow as Ct, mergeProps as Fi, withModifiers as kt, onMounted as at, onUnmounted as yn, createTextVNode as Vt, resolveDirective as zi, getCurrentInstance as Ii, markRaw as _n, render as Ut, mergeModels as wn, useModel as Sn, nextTick as Ei, normalizeProps as Cn, guardReactiveProps as kn, normalizeStyle as xn } from "vue";
|
|
3
|
+
import { M as ke, A as Y, am as Rn, ao as An, $ as Mn, I as ue, D as Te, B as xe, V as Ti, u as ye, J as $e, G as qe, Q as Ze, R as On, T as Fn, U as zn, W as Ft, ag as In, X as En, O as Tn, N as hi } from "./index.vue_vue_type_script_setup_true_lang-C7QFfxg3.js";
|
|
4
4
|
import { useI18n as he, useCoreStore as pt, CustomAttributesForm as Di } from "@feedmepos/mf-common";
|
|
5
5
|
import { useDialog as Le, useSnackbar as De, components as Ae, FmButtonColorThemeVariant as je, FmButtonVariant as Qe, useBreakpoints as Pi, useDialogChild as Vi } from "@feedmepos/ui-library";
|
|
6
|
-
import { C as We } from "./catalog-
|
|
6
|
+
import { C as We } from "./catalog-5tB9X7Xs.js";
|
|
7
7
|
import { c as Dn } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
8
8
|
import { a as fi, _ as Ui } from "./tooltip-B5BiPMx9.js";
|
|
9
|
-
import { H as Pn, L as Vn } from "./LinkProductSideSheet-
|
|
10
|
-
import { e as Un, _ as Ge, a as $n } from "./RuleView.vue_vue_type_script_setup_true_lang-
|
|
9
|
+
import { H as Pn, L as Vn } from "./LinkProductSideSheet-DUrebn2j.js";
|
|
10
|
+
import { e as Un, _ as Ge, a as $n } from "./RuleView.vue_vue_type_script_setup_true_lang-C90TWyXI.js";
|
|
11
11
|
import { s as $t, F as Nn, _ as Bn } from "./index-CisutoS9.js";
|
|
12
|
-
import { a as Ln } from "./app-
|
|
12
|
+
import { a as Ln } from "./app-t_jA_fe-.js";
|
|
13
13
|
import { _ as nt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
14
|
-
import { g as $i, b as Gn, c as Kn, a as jn, m as Wn } from "./menuV2-
|
|
14
|
+
import { g as $i, b as Gn, c as Kn, a as jn, m as Wn } from "./menuV2-1YBShKfa.js";
|
|
15
15
|
import { useAppStore as Ht, RemyButton as Ni } from "@feedmepos/mf-remy-panel";
|
|
16
16
|
import { _ as He } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
|
|
17
|
-
import { u as Yn } from "./subcategory-
|
|
18
|
-
import { u as Hn } from "./category-
|
|
17
|
+
import { u as Yn } from "./subcategory-D6xrUj-f.js";
|
|
18
|
+
import { u as Hn } from "./category-DrvPbpMM.js";
|
|
19
19
|
import { u as Xt } from "./discardConfirm-BHni0LNu.js";
|
|
20
|
-
import { _ as tt, l as Nt, T as Xn } from "./index-
|
|
20
|
+
import { _ as tt, l as Nt, T as Xn } from "./index-BqIyQm3G.js";
|
|
21
21
|
import { useInventoryStore as Bi, InventoryBindingForm as qn, InventoryBindingSummary as Zn } from "@feedmepos/mf-inventory-portal";
|
|
22
22
|
import { c as ht } from "./check-C9mY6LiX.js";
|
|
23
23
|
import { c as Qn } from "./object-DVUNCr7w.js";
|
|
24
|
-
import { f as rt } from "./currency-
|
|
25
|
-
import { u as Li } from "./priceTier-
|
|
24
|
+
import { f as rt } from "./currency-CMVwARyT.js";
|
|
25
|
+
import { u as Li } from "./priceTier-ox717yO7.js";
|
|
26
26
|
import { u as Jn } from "./search-BAPEUu1R.js";
|
|
27
27
|
import { c as eo } from "./string-DpfFixWH.js";
|
|
28
28
|
import { d as Gi } from "./vuedraggable-CK8z7qA8.js";
|
|
29
|
-
import { _ as to } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-
|
|
30
|
-
import { V as vi } from "./index-
|
|
29
|
+
import { _ as to } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-RQVYf4A4.js";
|
|
30
|
+
import { V as vi } from "./index-CPo5EAsu.js";
|
|
31
31
|
class _t {
|
|
32
32
|
constructor(i, t, n, a) {
|
|
33
33
|
this.scheduler = i, this.menuStore = t, this.updateMenu = n, this.dialog = a;
|
|
@@ -36,7 +36,7 @@ class _t {
|
|
|
36
36
|
this.promptDialog().onPrimary(async (i) => {
|
|
37
37
|
await this.updateMenu(
|
|
38
38
|
{
|
|
39
|
-
module:
|
|
39
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.scheduler,
|
|
40
40
|
operation: ke.F_OPERATION_TYPE.create,
|
|
41
41
|
data: i
|
|
42
42
|
},
|
|
@@ -50,7 +50,7 @@ class _t {
|
|
|
50
50
|
async update() {
|
|
51
51
|
this.scheduler && await this.updateMenu(
|
|
52
52
|
{
|
|
53
|
-
module:
|
|
53
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.scheduler,
|
|
54
54
|
operation: ke.F_OPERATION_TYPE.update,
|
|
55
55
|
data: this.scheduler
|
|
56
56
|
},
|
|
@@ -73,7 +73,7 @@ class _t {
|
|
|
73
73
|
}).onPrimary(async () => {
|
|
74
74
|
await this.updateMenu(
|
|
75
75
|
{
|
|
76
|
-
module:
|
|
76
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.scheduler,
|
|
77
77
|
operation: ke.F_OPERATION_TYPE.delete,
|
|
78
78
|
data: i._id
|
|
79
79
|
},
|
|
@@ -193,7 +193,7 @@ class _t {
|
|
|
193
193
|
if (!this.scheduler) return null;
|
|
194
194
|
const i = this.menuStore.currentCatalog, t = i ? ((n = i.override.scheduler[this.scheduler._id]) == null ? void 0 : n.items) ?? [] : this.scheduler.items;
|
|
195
195
|
return [
|
|
196
|
-
...new Set(t.filter((a) => a.orderFrom !=
|
|
196
|
+
...new Set(t.filter((a) => a.orderFrom != Y.F_ORDER_FROM.enum.NONE).map((a) => a._id))
|
|
197
197
|
];
|
|
198
198
|
}
|
|
199
199
|
async updateItemAvailable(i) {
|
|
@@ -241,10 +241,10 @@ class _t {
|
|
|
241
241
|
function xt(e, i) {
|
|
242
242
|
for (const t of i) {
|
|
243
243
|
const n = e.find((a) => a._id === t._id);
|
|
244
|
-
if (n != null && n.isDynamicAddon || t.isDynamicAddon) return
|
|
245
|
-
if (n != null && n.category) return
|
|
244
|
+
if (n != null && n.isDynamicAddon || t.isDynamicAddon) return Y.F_ADDON_GROUP_TYPE.enum.DYNAMIC;
|
|
245
|
+
if (n != null && n.category) return Y.F_ADDON_GROUP_TYPE.enum.PRODUCT;
|
|
246
246
|
}
|
|
247
|
-
return
|
|
247
|
+
return Y.F_ADDON_GROUP_TYPE.enum.NORMAL;
|
|
248
248
|
}
|
|
249
249
|
function io(e) {
|
|
250
250
|
return [...new Set(e.map((t) => t._id))].reduce((t, n) => {
|
|
@@ -305,9 +305,9 @@ function Ki(e) {
|
|
|
305
305
|
code: o.code ?? "",
|
|
306
306
|
name: o.name ?? "",
|
|
307
307
|
price: o.price ?? xe.Dinero.zero().toObject(),
|
|
308
|
-
orderFrom:
|
|
308
|
+
orderFrom: Y.F_ORDER_FROM.enum.ALL,
|
|
309
309
|
groups: [],
|
|
310
|
-
isDynamicAddon: e.type ===
|
|
310
|
+
isDynamicAddon: e.type === Y.F_ADDON_GROUP_TYPE.enum.DYNAMIC
|
|
311
311
|
}));
|
|
312
312
|
return {
|
|
313
313
|
group: {
|
|
@@ -382,28 +382,28 @@ class ji {
|
|
|
382
382
|
const a = this.menuStore.state.menu.modules.item, o = this.menuStore.state.menu.modules.group, r = this.menuStore.items;
|
|
383
383
|
function l(s, u) {
|
|
384
384
|
const d = s.items.reduce((m, p) => {
|
|
385
|
-
var U,
|
|
386
|
-
const
|
|
387
|
-
if (!
|
|
385
|
+
var U, j, M, D;
|
|
386
|
+
const v = a.find((I) => p._id === I._id);
|
|
387
|
+
if (!v && t) return m;
|
|
388
388
|
const b = p.combinationKey ? {
|
|
389
|
-
...(U =
|
|
389
|
+
...(U = v == null ? void 0 : v.variant) == null ? void 0 : U.variantCombinations.find(
|
|
390
390
|
(I) => I.combinationKey === p.combinationKey
|
|
391
391
|
),
|
|
392
|
-
name: Ti(ye().variants, ((
|
|
393
|
-
} :
|
|
392
|
+
name: Ti(ye().variants, ((j = v == null ? void 0 : v.variant) == null ? void 0 : j.variantGroupIds) || [])[p.combinationKey]
|
|
393
|
+
} : v, y = (M = o.find((I) => I._id === s._id)) == null ? void 0 : M.items.find((I) => I._id === p._id && I.combinationKey === p.combinationKey), _ = !t && !p.combinationKey, f = (D = u.find(
|
|
394
394
|
(I) => I._id == p._id && I.combinationKey == p.combinationKey
|
|
395
|
-
)) == null ? void 0 : D.price,
|
|
395
|
+
)) == null ? void 0 : D.price, C = p.name ?? (y == null ? void 0 : y.name) ?? (b == null ? void 0 : b.name) ?? "", K = {
|
|
396
396
|
...p,
|
|
397
|
-
name:
|
|
397
|
+
name: C,
|
|
398
398
|
code: b == null ? void 0 : b.code,
|
|
399
|
-
fallbackName: _ ? null :
|
|
399
|
+
fallbackName: _ ? null : C,
|
|
400
400
|
price: p.price,
|
|
401
|
-
fallbackPrice: _ ? null :
|
|
401
|
+
fallbackPrice: _ ? null : f,
|
|
402
402
|
orderFrom: p.orderFrom,
|
|
403
403
|
fallbackOrder: b == null ? void 0 : b.orderFrom,
|
|
404
404
|
priceTiers: p.priceTiers
|
|
405
405
|
};
|
|
406
|
-
return [...m,
|
|
406
|
+
return [...m, K];
|
|
407
407
|
}, []), c = xt(a, s.items);
|
|
408
408
|
return {
|
|
409
409
|
...s,
|
|
@@ -419,7 +419,7 @@ class ji {
|
|
|
419
419
|
}
|
|
420
420
|
async sortGroups(i) {
|
|
421
421
|
const t = {
|
|
422
|
-
module:
|
|
422
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.group,
|
|
423
423
|
operation: ke.F_OPERATION_TYPE.rearrange,
|
|
424
424
|
data: i.map((n) => n._id)
|
|
425
425
|
};
|
|
@@ -427,12 +427,12 @@ class ji {
|
|
|
427
427
|
}
|
|
428
428
|
async duplicateGroup(i) {
|
|
429
429
|
const t = ue(i);
|
|
430
|
-
i.type ===
|
|
430
|
+
i.type === Y.F_ADDON_GROUP_TYPE.enum.PRODUCT || (t.items = Object.entries(t.items).reduce((r, [l, s]) => (r[l] = {
|
|
431
431
|
...s,
|
|
432
432
|
items: (s.items ?? []).map((u) => ({ ...u, _id: "" }))
|
|
433
433
|
}, r), {}));
|
|
434
434
|
const a = Ki(t), o = {
|
|
435
|
-
module:
|
|
435
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.group,
|
|
436
436
|
operation: ke.F_OPERATION_TYPE.create,
|
|
437
437
|
data: {
|
|
438
438
|
...a.group,
|
|
@@ -440,7 +440,7 @@ class ji {
|
|
|
440
440
|
},
|
|
441
441
|
link: [
|
|
442
442
|
{
|
|
443
|
-
module:
|
|
443
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.item,
|
|
444
444
|
id: "",
|
|
445
445
|
data: a.linkItems
|
|
446
446
|
}
|
|
@@ -451,7 +451,7 @@ class ji {
|
|
|
451
451
|
async deleteGroup(i) {
|
|
452
452
|
i.itemsLinked.length > 0 && await this.applyItems(i, []);
|
|
453
453
|
const t = {
|
|
454
|
-
module:
|
|
454
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.group,
|
|
455
455
|
operation: ke.F_OPERATION_TYPE.delete,
|
|
456
456
|
data: i._id
|
|
457
457
|
};
|
|
@@ -464,9 +464,9 @@ class ji {
|
|
|
464
464
|
}
|
|
465
465
|
function a(s, u, d) {
|
|
466
466
|
var p;
|
|
467
|
-
const c = n(u.groups, d), m = (((p = u.variant) == null ? void 0 : p.variantCombinations) ?? []).map((
|
|
468
|
-
const b = n(
|
|
469
|
-
return { ...
|
|
467
|
+
const c = n(u.groups, d), m = (((p = u.variant) == null ? void 0 : p.variantCombinations) ?? []).map((v) => {
|
|
468
|
+
const b = n(v.groups ?? [], d);
|
|
469
|
+
return { ...v, groups: b };
|
|
470
470
|
});
|
|
471
471
|
return vn(s, {
|
|
472
472
|
...u,
|
|
@@ -482,7 +482,7 @@ class ji {
|
|
|
482
482
|
(d) => d._id === s
|
|
483
483
|
);
|
|
484
484
|
return {
|
|
485
|
-
module:
|
|
485
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.item,
|
|
486
486
|
operation: ke.F_OPERATION_TYPE.update,
|
|
487
487
|
id: s,
|
|
488
488
|
data: a(this.menuStore, u, !t.includes(s))
|
|
@@ -550,12 +550,12 @@ const ao = {
|
|
|
550
550
|
return i.variant === "full" ? (A(), ne("div", ao, [
|
|
551
551
|
P("div", ro, de(a.title), 1),
|
|
552
552
|
g(Pn),
|
|
553
|
-
(A(!0), ne(Me, null, Ne(a.items, (l) => (A(),
|
|
553
|
+
(A(!0), ne(Me, null, Ne(a.items, (l) => (A(), H(fi, {
|
|
554
554
|
key: l.name,
|
|
555
555
|
name: l.name,
|
|
556
556
|
value: l.value || "--"
|
|
557
557
|
}, null, 8, ["name", "value"]))), 128))
|
|
558
|
-
])) : (A(),
|
|
558
|
+
])) : (A(), H(r, {
|
|
559
559
|
key: 1,
|
|
560
560
|
icon: "info",
|
|
561
561
|
variant: "tertiary",
|
|
@@ -572,9 +572,9 @@ const ao = {
|
|
|
572
572
|
setup(e, { emit: i }) {
|
|
573
573
|
const t = e, n = i, { t: a } = he(), o = ye(), r = te(o.state.currentCatalogId || null), l = O(() => {
|
|
574
574
|
const m = Object.keys(t.linkedStatus.catalogs).map((p) => {
|
|
575
|
-
var
|
|
575
|
+
var v;
|
|
576
576
|
return {
|
|
577
|
-
label: ((
|
|
577
|
+
label: ((v = o.state.menu.modules.catalog.find((b) => b._id === p)) == null ? void 0 : v.name) || "Unknown",
|
|
578
578
|
value: p
|
|
579
579
|
};
|
|
580
580
|
});
|
|
@@ -586,11 +586,11 @@ const ao = {
|
|
|
586
586
|
...m
|
|
587
587
|
];
|
|
588
588
|
}), s = te(o.state.currentSchedulerId || null), u = () => r.value ? t.linkedStatus.catalogs[r.value].schedulers : t.linkedStatus.schedulers, d = O(() => {
|
|
589
|
-
const p = u().map((
|
|
589
|
+
const p = u().map((v) => {
|
|
590
590
|
var b;
|
|
591
591
|
return {
|
|
592
|
-
label: ((b = o.state.menu.modules.scheduler.find((y) => y._id ===
|
|
593
|
-
value:
|
|
592
|
+
label: ((b = o.state.menu.modules.scheduler.find((y) => y._id === v)) == null ? void 0 : b.name) || "Unknown",
|
|
593
|
+
value: v
|
|
594
594
|
};
|
|
595
595
|
});
|
|
596
596
|
return [
|
|
@@ -613,7 +613,7 @@ const ao = {
|
|
|
613
613
|
c();
|
|
614
614
|
}
|
|
615
615
|
), (m, p) => {
|
|
616
|
-
const
|
|
616
|
+
const v = N("FmSelect");
|
|
617
617
|
return A(), ne("div", so, [
|
|
618
618
|
P("div", lo, [
|
|
619
619
|
P("div", uo, de(h(a)("menu.catalog_scheduler.title")), 1),
|
|
@@ -621,7 +621,7 @@ const ao = {
|
|
|
621
621
|
]),
|
|
622
622
|
P("div", mo, [
|
|
623
623
|
P("div", po, [
|
|
624
|
-
g(
|
|
624
|
+
g(v, {
|
|
625
625
|
label: h(a)("menu.common.labels.catalog"),
|
|
626
626
|
items: l.value,
|
|
627
627
|
modelValue: r.value,
|
|
@@ -629,7 +629,7 @@ const ao = {
|
|
|
629
629
|
}, null, 8, ["label", "items", "modelValue"])
|
|
630
630
|
]),
|
|
631
631
|
P("div", ho, [
|
|
632
|
-
g(
|
|
632
|
+
g(v, {
|
|
633
633
|
label: h(a)("menu.common.labels.scheduler"),
|
|
634
634
|
items: d.value,
|
|
635
635
|
modelValue: s.value,
|
|
@@ -656,7 +656,7 @@ const ao = {
|
|
|
656
656
|
const t = i;
|
|
657
657
|
return (n, a) => {
|
|
658
658
|
const o = N("fm-switch"), r = N("fm-card");
|
|
659
|
-
return n.disabled ? ve(n.$slots, "default", { key: 0 }, void 0, !0) : (A(),
|
|
659
|
+
return n.disabled ? ve(n.$slots, "default", { key: 0 }, void 0, !0) : (A(), H(r, {
|
|
660
660
|
key: 1,
|
|
661
661
|
class: "p-16 space-y-24",
|
|
662
662
|
variant: "outlined"
|
|
@@ -703,13 +703,13 @@ async function Co(e) {
|
|
|
703
703
|
onBatchEnd: l
|
|
704
704
|
} = e, s = i.length, u = [];
|
|
705
705
|
for (let d = 0; d < i.length; d += n) {
|
|
706
|
-
const c = i.slice(d, d + n), m = d + 1, p = Math.min(d + n, i.length),
|
|
707
|
-
r && (r.value =
|
|
706
|
+
const c = i.slice(d, d + n), m = d + 1, p = Math.min(d + n, i.length), v = `Processing items ${m}-${p}/${s}...`;
|
|
707
|
+
r && (r.value = v), o && o({
|
|
708
708
|
current: d,
|
|
709
709
|
total: s,
|
|
710
710
|
batchStart: m,
|
|
711
711
|
batchEnd: p,
|
|
712
|
-
message:
|
|
712
|
+
message: v
|
|
713
713
|
});
|
|
714
714
|
const b = c.map(t), y = await Promise.all(b);
|
|
715
715
|
u.push(...y), l && l({
|
|
@@ -774,16 +774,16 @@ const Oo = /* @__PURE__ */ nt(Ro, [["render", Mo]]), Fo = { class: "flex flex-co
|
|
|
774
774
|
},
|
|
775
775
|
emits: ["update:modelValue"],
|
|
776
776
|
setup(e, { expose: i, emit: t }) {
|
|
777
|
-
const n = e, a = t, o = te(null), r = te([]), l = (
|
|
777
|
+
const n = e, a = t, o = te(null), r = te([]), l = (v, b) => {
|
|
778
778
|
var y;
|
|
779
|
-
if (
|
|
779
|
+
if (v)
|
|
780
780
|
if (!n.multiple)
|
|
781
781
|
r.value = [b], (y = o.value) == null || y.toggleMenu(!1);
|
|
782
782
|
else if (b.value === "" || b.value === null)
|
|
783
783
|
r.value = [b];
|
|
784
784
|
else {
|
|
785
785
|
const _ = r.value.filter(
|
|
786
|
-
(
|
|
786
|
+
(f) => f.value !== "" && f.value !== null
|
|
787
787
|
);
|
|
788
788
|
r.value = [..._, b];
|
|
789
789
|
}
|
|
@@ -793,42 +793,42 @@ const Oo = /* @__PURE__ */ nt(Ro, [["render", Mo]]), Fo = { class: "flex flex-co
|
|
|
793
793
|
"update:modelValue",
|
|
794
794
|
r.value.map((_) => _.value)
|
|
795
795
|
);
|
|
796
|
-
}, s = (
|
|
797
|
-
r.value.length <= 1 || (r.value = r.value.filter((b, y) => y !==
|
|
796
|
+
}, s = (v) => {
|
|
797
|
+
r.value.length <= 1 || (r.value = r.value.filter((b, y) => y !== v), a(
|
|
798
798
|
"update:modelValue",
|
|
799
799
|
r.value.map((b) => b.value)
|
|
800
800
|
));
|
|
801
801
|
}, u = () => {
|
|
802
|
-
var
|
|
803
|
-
(
|
|
802
|
+
var v;
|
|
803
|
+
(v = o.value) == null || v.toggleMenu(!1);
|
|
804
804
|
}, d = O(() => n.items.reduce(
|
|
805
|
-
(
|
|
805
|
+
(v, b) => (v[b.value] = b, v),
|
|
806
806
|
{}
|
|
807
807
|
)), c = te(!1);
|
|
808
808
|
Re(
|
|
809
809
|
() => n.modelValue,
|
|
810
|
-
(
|
|
811
|
-
|
|
810
|
+
(v) => {
|
|
811
|
+
v != null && v.length ? r.value = v.map((b) => d.value[b]).filter((b) => !!b) : r.value = [];
|
|
812
812
|
},
|
|
813
813
|
{ immediate: !0 }
|
|
814
814
|
);
|
|
815
|
-
const m = O(() => n.shouldShowSelectedItemsWithinPlaceholder && r.value.length > 0), p = O(() => m.value ? r.value.map((
|
|
815
|
+
const m = O(() => n.shouldShowSelectedItemsWithinPlaceholder && r.value.length > 0), p = O(() => m.value ? r.value.map((v) => v.label).join(", ") : n.placeholder);
|
|
816
816
|
return i({
|
|
817
817
|
hideMenu: u
|
|
818
|
-
}), (
|
|
819
|
-
const y = N("FmIcon"), _ = N("FmField"),
|
|
818
|
+
}), (v, b) => {
|
|
819
|
+
const y = N("FmIcon"), _ = N("FmField"), f = N("FmMenuItem"), C = N("FmMenu"), K = N("FmFormGroup"), U = N("FmChipGroup");
|
|
820
820
|
return A(), ne("div", Fo, [
|
|
821
|
-
g(
|
|
822
|
-
"model-value":
|
|
823
|
-
disabled:
|
|
821
|
+
g(K, {
|
|
822
|
+
"model-value": v.modelValue,
|
|
823
|
+
disabled: v.disabled,
|
|
824
824
|
focused: c.value,
|
|
825
|
-
"helper-state":
|
|
826
|
-
"helper-text":
|
|
827
|
-
rules:
|
|
825
|
+
"helper-state": v.helperState,
|
|
826
|
+
"helper-text": v.helperText,
|
|
827
|
+
rules: v.rules
|
|
828
828
|
}, {
|
|
829
|
-
default: V(({ invalid:
|
|
830
|
-
g(
|
|
831
|
-
disabled:
|
|
829
|
+
default: V(({ invalid: j }) => [
|
|
830
|
+
g(C, {
|
|
831
|
+
disabled: v.disabled,
|
|
832
832
|
ref_key: "fmMenuRef",
|
|
833
833
|
ref: o,
|
|
834
834
|
"close-on-click": !1,
|
|
@@ -836,13 +836,13 @@ const Oo = /* @__PURE__ */ nt(Ro, [["render", Mo]]), Fo = { class: "flex flex-co
|
|
|
836
836
|
}, {
|
|
837
837
|
"menu-button": V(() => [
|
|
838
838
|
g(_, {
|
|
839
|
-
class: Fe(
|
|
839
|
+
class: Fe(v.disabled ? "cursor-not-allowed" : "cursor-pointer"),
|
|
840
840
|
focused: c.value,
|
|
841
|
-
invalid:
|
|
841
|
+
invalid: j
|
|
842
842
|
}, {
|
|
843
843
|
append: V(() => [
|
|
844
844
|
g(y, {
|
|
845
|
-
color:
|
|
845
|
+
color: v.disabled ? "#C7C7CC" : "black",
|
|
846
846
|
name: c.value ? "expand_less" : "expand_more",
|
|
847
847
|
size: "md"
|
|
848
848
|
}, null, 8, ["color", "name"])
|
|
@@ -850,7 +850,7 @@ const Oo = /* @__PURE__ */ nt(Ro, [["render", Mo]]), Fo = { class: "flex flex-co
|
|
|
850
850
|
default: V(() => [
|
|
851
851
|
P("div", {
|
|
852
852
|
class: Fe([[
|
|
853
|
-
|
|
853
|
+
v.disabled ? "text-fm-color-typo-disabled" : m.value ? "text-fm-color-typo-primary" : "text-fm-color-typo-tertiary"
|
|
854
854
|
], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
|
|
855
855
|
}, de(p.value), 3)
|
|
856
856
|
]),
|
|
@@ -859,7 +859,7 @@ const Oo = /* @__PURE__ */ nt(Ro, [["render", Mo]]), Fo = { class: "flex flex-co
|
|
|
859
859
|
]),
|
|
860
860
|
default: V(() => [
|
|
861
861
|
P("div", zo, [
|
|
862
|
-
(A(!0), ne(Me, null, Ne(
|
|
862
|
+
(A(!0), ne(Me, null, Ne(v.items, (M) => (A(), H(f, {
|
|
863
863
|
key: M.value,
|
|
864
864
|
disabled: M.disabled,
|
|
865
865
|
"has-checkbox": !0,
|
|
@@ -867,7 +867,7 @@ const Oo = /* @__PURE__ */ nt(Ro, [["render", Mo]]), Fo = { class: "flex flex-co
|
|
|
867
867
|
"model-value": r.value.some((D) => D.value === M.value),
|
|
868
868
|
"onUpdate:modelValue": (D) => l(D, M)
|
|
869
869
|
}, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue"]))), 128)),
|
|
870
|
-
ve(
|
|
870
|
+
ve(v.$slots, "append-menu", {}, void 0, !0)
|
|
871
871
|
])
|
|
872
872
|
]),
|
|
873
873
|
_: 2
|
|
@@ -875,10 +875,10 @@ const Oo = /* @__PURE__ */ nt(Ro, [["render", Mo]]), Fo = { class: "flex flex-co
|
|
|
875
875
|
]),
|
|
876
876
|
_: 3
|
|
877
877
|
}, 8, ["model-value", "disabled", "focused", "helper-state", "helper-text", "rules"]),
|
|
878
|
-
|
|
878
|
+
v.shouldShowChips && r.value.length > 0 ? (A(), ne("div", Io, [
|
|
879
879
|
g(U, {
|
|
880
|
-
disabled:
|
|
881
|
-
items: r.value.map((
|
|
880
|
+
disabled: v.disabled,
|
|
881
|
+
items: r.value.map((j) => ({ label: j.label })),
|
|
882
882
|
removable: "",
|
|
883
883
|
onChipClosed: s
|
|
884
884
|
}, null, 8, ["disabled", "items"])
|
|
@@ -1133,7 +1133,7 @@ var dt = function(e, i) {
|
|
|
1133
1133
|
this.touches.length && this.$emit("drag-end"), this.hovered && (this.$emit("leave"), this.hovered = !1), this.touches = [];
|
|
1134
1134
|
} }, emits: ["drag", "drag-end", "leave", "enter"] };
|
|
1135
1135
|
Qt.render = function(e, i, t, n, a, o) {
|
|
1136
|
-
return A(),
|
|
1136
|
+
return A(), H("div", { ref: "draggable", class: t.classname, onTouchstart: i[1] || (i[1] = function() {
|
|
1137
1137
|
return o.onTouchStart && o.onTouchStart.apply(o, arguments);
|
|
1138
1138
|
}), onMousedown: i[2] || (i[2] = function() {
|
|
1139
1139
|
return o.onMouseDown && o.onMouseDown.apply(o, arguments);
|
|
@@ -1153,7 +1153,7 @@ var It = Pe("vue-handler-wrapper"), Zi = { name: "HandlerWrapper", components: {
|
|
|
1153
1153
|
} }, emits: ["leave", "enter", "drag", "drag-end"] };
|
|
1154
1154
|
Zi.render = function(e, i, t, n, a, o) {
|
|
1155
1155
|
var r = N("DraggableElement");
|
|
1156
|
-
return A(),
|
|
1156
|
+
return A(), H("div", { class: o.classes.root }, [g(r, { class: o.classes.draggable, onDrag: i[1] || (i[1] = function(l) {
|
|
1157
1157
|
return e.$emit("drag", l);
|
|
1158
1158
|
}), onDragEnd: i[2] || (i[2] = function(l) {
|
|
1159
1159
|
return e.$emit("drag-end");
|
|
@@ -1171,7 +1171,7 @@ var $o = Pe("vue-line-wrapper"), Qi = { name: "LineWrapper", components: { Dragg
|
|
|
1171
1171
|
} }, emits: ["leave", "enter", "drag", "drag-end"] };
|
|
1172
1172
|
Qi.render = function(e, i, t, n, a, o) {
|
|
1173
1173
|
var r = N("DraggableElement");
|
|
1174
|
-
return A(),
|
|
1174
|
+
return A(), H(r, { class: o.classname, onDrag: i[1] || (i[1] = function(l) {
|
|
1175
1175
|
return e.$emit("drag", l);
|
|
1176
1176
|
}), onDragEnd: i[2] || (i[2] = function(l) {
|
|
1177
1177
|
return e.$emit("drag-end");
|
|
@@ -1308,8 +1308,8 @@ function jo(e) {
|
|
|
1308
1308
|
return (Array.isArray(t) ? t : [t]).forEach(function(d) {
|
|
1309
1309
|
var c = {};
|
|
1310
1310
|
_e((c = typeof d == "function" ? d({ coordinates: u, imageSize: n, visibleArea: l }) : d).width) && _e(c.height) || (u = function(m, p) {
|
|
1311
|
-
var
|
|
1312
|
-
return s(
|
|
1311
|
+
var v = ee(ee(ee({}, m), Ye({ width: p.width, height: p.height, sizeRestrictions: a, aspectRatio: r })), { left: 0, top: 0 });
|
|
1312
|
+
return s(v, { left: m.left, top: m.top });
|
|
1313
1313
|
}(u, ee(ee({}, u), c))), _e(c.left) && _e(c.top) || (u = s(u, ee(ee({}, u), c)));
|
|
1314
1314
|
}), u;
|
|
1315
1315
|
}
|
|
@@ -1321,8 +1321,8 @@ function Wo(e) {
|
|
|
1321
1321
|
e.stencilReference;
|
|
1322
1322
|
var s, u, d, c = ee({}, n), m = ee({}, a), p = ee({}, o);
|
|
1323
1323
|
s = le(p), u = le(c), d === void 0 && (d = 1e-3), (s === 0 || u === 0 ? Math.abs(u - s) < d : Math.abs(u / s) < 1 + d && Math.abs(u / s) > 1 - d) || (c = ee(ee({}, c), Ye({ sizeRestrictions: r, width: c.width, height: c.height, aspectRatio: { minimum: le(p), maximum: le(p) } })));
|
|
1324
|
-
var
|
|
1325
|
-
return
|
|
1324
|
+
var v = At(m = Ee(m, c.width * t.width / (m.width * p.width)), i({ visibleArea: m, type: "resize" }));
|
|
1325
|
+
return v !== 1 && (m = Ee(m, v), c = Ee(c, v)), m = Se(m = Oe(m, st(we(c), we(m))), i({ visibleArea: m, type: "move" })), { coordinates: c = Se(c, Mt(Be(m), l)), visibleArea: m };
|
|
1326
1326
|
}
|
|
1327
1327
|
function Yo(e) {
|
|
1328
1328
|
var i = e.event, t = e.getAreaRestrictions, n = e.boundaries, a = e.coordinates, o = e.visibleArea;
|
|
@@ -1371,12 +1371,12 @@ function gt(e, i) {
|
|
|
1371
1371
|
return tn(e, Be(i));
|
|
1372
1372
|
}
|
|
1373
1373
|
function Jo(e) {
|
|
1374
|
-
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, d = ee({}, n), c = ee({}, t), m = 1, p = 1,
|
|
1374
|
+
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, d = ee({}, n), c = ee({}, t), m = 1, p = 1, v = s.factor && Math.abs(s.factor - 1) > 1e-3;
|
|
1375
1375
|
d = Oe(d, { left: u.left || 0, top: u.top || 0 });
|
|
1376
1376
|
var b = { stencil: { minimum: Math.max(a.minWidth ? a.minWidth / c.width : 0, a.minHeight ? a.minHeight / c.height : 0), maximum: Math.min(a.maxWidth ? a.maxWidth / c.width : 1 / 0, a.maxHeight ? a.maxHeight / c.height : 1 / 0, lt(c, r)) }, area: { maximum: lt(d, o({ visibleArea: d, type: "resize" })) } };
|
|
1377
|
-
s.factor &&
|
|
1378
|
-
var y = t.left - n.left, _ = n.width + n.left - (t.width + t.left),
|
|
1379
|
-
return d = Se(d = Oe(d, ut(d, { left: r.left !== void 0 ? r.left - y * p : void 0, top: r.top !== void 0 ? r.top -
|
|
1377
|
+
s.factor && v && (s.factor < 1 ? (p = Math.max(s.factor, b.stencil.minimum)) > 1 && (p = 1) : s.factor > 1 && (p = Math.min(s.factor, Math.min(b.area.maximum, b.stencil.maximum))) < 1 && (p = 1)), p && (d = Ee(d, p, s.center));
|
|
1378
|
+
var y = t.left - n.left, _ = n.width + n.left - (t.width + t.left), f = t.top - n.top, C = n.height + n.top - (t.height + t.top);
|
|
1379
|
+
return d = Se(d = Oe(d, ut(d, { left: r.left !== void 0 ? r.left - y * p : void 0, top: r.top !== void 0 ? r.top - f * p : void 0, bottom: r.bottom !== void 0 ? r.bottom + C * p : void 0, right: r.right !== void 0 ? r.right + _ * p : void 0 })), o({ visibleArea: d, type: "move" })), c.width = c.width * p, c.height = c.height * p, c.left = d.left + y * p, c.top = d.top + f * p, c = Se(c, Mt(Be(d), r)), s.factor && v && l && (s.factor > 1 ? m = Math.min(b.area.maximum, s.factor) / p : s.factor < 1 && (m = Math.max(c.height / d.height, c.width / d.width, s.factor / p)), m !== 1 && (d = Oe(d = Se(d = Ee(d, m, s.factor > 1 ? s.center : we(c)), o({ visibleArea: d, type: "move" })), Rt(ut(c, Be(d)))))), { coordinates: c, visibleArea: d };
|
|
1380
1380
|
}
|
|
1381
1381
|
function ea(e) {
|
|
1382
1382
|
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, d = ee({}, n), c = ee({}, a), m = Xe(we(ee({ left: 0, top: 0 }, s)), u);
|
|
@@ -1385,8 +1385,8 @@ function ea(e) {
|
|
|
1385
1385
|
function ta(e) {
|
|
1386
1386
|
var i = e.flip, t = e.previousFlip, n = e.rotate, a = e.getAreaRestrictions, o = e.coordinates, r = e.visibleArea, l = e.imageSize, s = ee({}, o), u = ee({}, r), d = t.horizontal !== i.horizontal, c = t.vertical !== i.vertical;
|
|
1387
1387
|
if (d || c) {
|
|
1388
|
-
var m = Xe({ left: l.width / 2, top: l.height / 2 }, -n), p = Xe(we(s), -n),
|
|
1389
|
-
s = Oe(s, st(
|
|
1388
|
+
var m = Xe({ left: l.width / 2, top: l.height / 2 }, -n), p = Xe(we(s), -n), v = Xe({ left: d ? m.left - (p.left - m.left) : p.left, top: c ? m.top - (p.top - m.top) : p.top }, n);
|
|
1389
|
+
s = Oe(s, st(v, we(s))), p = Xe(we(u), -n), u = Se(u = Oe(u, st(v = Xe({ left: d ? m.left - (p.left - m.left) : p.left, top: c ? m.top - (p.top - m.top) : p.top }, n), we(u))), a({ visibleArea: u, type: "move" }));
|
|
1390
1390
|
}
|
|
1391
1391
|
return { coordinates: s, visibleArea: u };
|
|
1392
1392
|
}
|
|
@@ -1410,9 +1410,9 @@ function Ri(e) {
|
|
|
1410
1410
|
m[b] !== 1 / 0 && (s[b] *= m[b]);
|
|
1411
1411
|
});
|
|
1412
1412
|
if (u = Ve(t, s).width, d = Ve(t, s).height, s.right + s.left && (u > o.maxWidth ? m.width = (o.maxWidth - t.width) / (s.right + s.left) : u < o.minWidth && (m.width = (o.minWidth - t.width) / (s.right + s.left))), s.bottom + s.top && (d > o.maxHeight ? m.height = (o.maxHeight - t.height) / (s.bottom + s.top) : d < o.minHeight && (m.height = (o.minHeight - t.height) / (s.bottom + s.top))), r) {
|
|
1413
|
-
var
|
|
1414
|
-
|
|
1415
|
-
s[b] *=
|
|
1413
|
+
var v = Math.min(m.width, m.height);
|
|
1414
|
+
v !== 1 / 0 && Ue.forEach(function(b) {
|
|
1415
|
+
s[b] *= v;
|
|
1416
1416
|
});
|
|
1417
1417
|
} else m.width !== 1 / 0 && No.forEach(function(b) {
|
|
1418
1418
|
s[b] *= m.width;
|
|
@@ -1440,7 +1440,7 @@ var ia = Pe("vue-simple-handler"), na = Pe("vue-simple-handler-wrapper"), Jt = {
|
|
|
1440
1440
|
} }, emits: ["drag", "drag-end"] };
|
|
1441
1441
|
Jt.render = function(e, i, t, n, a, o) {
|
|
1442
1442
|
var r = N("HandlerWrapper");
|
|
1443
|
-
return A(),
|
|
1443
|
+
return A(), H(r, { class: o.classes.wrapper, "vertical-position": t.verticalPosition, "horizontal-position": t.horizontalPosition, disabled: t.disabled, onDrag: o.onDrag, onDragEnd: o.onDragEnd, onEnter: o.onEnter, onLeave: o.onLeave }, { default: V(function() {
|
|
1444
1444
|
return [g("div", { class: o.classes.default }, null, 2)];
|
|
1445
1445
|
}), _: 1 }, 8, ["class", "vertical-position", "horizontal-position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
|
|
1446
1446
|
};
|
|
@@ -1459,7 +1459,7 @@ var oa = Pe("vue-simple-line"), aa = Pe("vue-simple-line-wrapper"), ei = { name:
|
|
|
1459
1459
|
} }, emits: ["drag", "drag-end"] };
|
|
1460
1460
|
ei.render = function(e, i, t, n, a, o) {
|
|
1461
1461
|
var r = N("LineWrapper");
|
|
1462
|
-
return A(),
|
|
1462
|
+
return A(), H(r, { class: o.classes.wrapper, position: t.position, disabled: t.disabled, onDrag: o.onDrag, onDragEnd: o.onDragEnd, onEnter: o.onEnter, onLeave: o.onLeave }, { default: V(function() {
|
|
1463
1463
|
return [g("div", { class: o.classes.root }, null, 2)];
|
|
1464
1464
|
}), _: 1 }, 8, ["class", "position", "disabled", "onDrag", "onDragEnd", "onEnter", "onLeave"]);
|
|
1465
1465
|
};
|
|
@@ -1525,14 +1525,14 @@ var Tt = Pe("vue-bounding-box"), ra = ["east", "west", null], sa = ["south", "no
|
|
|
1525
1525
|
i === "west" ? l.left -= o : i === "east" && (l.right += o), t === "north" ? l.top -= r : t === "south" && (l.bottom += r), !t && i ? n = "width" : t && !i && (n = "height"), this.resizable && this.$emit("resize", new Vo(l, { allowedDirections: { left: i === "west" || !i, right: i === "east" || !i, bottom: t === "south" || !t, top: t === "north" || !t }, preserveAspectRatio: e.nativeEvent && e.nativeEvent.shiftKey, respectDirection: n }));
|
|
1526
1526
|
} }, emits: ["resize", "resize-end"] };
|
|
1527
1527
|
nn.render = function(e, i, t, n, a, o) {
|
|
1528
|
-
return A(),
|
|
1529
|
-
return A(),
|
|
1528
|
+
return A(), H("div", { ref: "box", class: o.classes.root, style: o.style }, [ve(e.$slots, "default"), g("div", null, [(A(!0), H(Me, null, Ne(o.lineNodes, function(r) {
|
|
1529
|
+
return A(), H(St(r.component), { key: r.name, "default-class": r.class, "hover-class": r.hoverClass, "wrapper-class": r.wrapperClass, position: r.name, disabled: r.disabled, onDrag: function(l) {
|
|
1530
1530
|
return o.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
|
|
1531
1531
|
}, onDragEnd: i[1] || (i[1] = function(l) {
|
|
1532
1532
|
return o.onEnd();
|
|
1533
1533
|
}) }, null, 8, ["default-class", "hover-class", "wrapper-class", "position", "disabled", "onDrag"]);
|
|
1534
|
-
}), 128))]), (A(!0),
|
|
1535
|
-
return A(),
|
|
1534
|
+
}), 128))]), (A(!0), H(Me, null, Ne(o.handlerNodes, function(r) {
|
|
1535
|
+
return A(), H("div", { key: r.name, style: r.wrapperStyle, class: r.wrapperClass }, [(A(), H(St(r.component), { "default-class": r.class, "hover-class": r.hoverClass, "wrapper-class": r.wrapperClass, "horizontal-position": r.horizontalDirection, "vertical-position": r.verticalDirection, disabled: r.disabled, onDrag: function(l) {
|
|
1536
1536
|
return o.onHandlerDrag(l, r.horizontalDirection, r.verticalDirection);
|
|
1537
1537
|
}, onDragEnd: i[2] || (i[2] = function(l) {
|
|
1538
1538
|
return o.onEnd();
|
|
@@ -1578,7 +1578,7 @@ var la = Pe("vue-draggable-area"), on = { name: "DraggableArea", props: { movabl
|
|
|
1578
1578
|
this.touches.length && this.$emit("move-end"), this.touches = [];
|
|
1579
1579
|
} }, emits: ["move", "move-end"] };
|
|
1580
1580
|
on.render = function(e, i, t, n, a, o) {
|
|
1581
|
-
return A(),
|
|
1581
|
+
return A(), H("div", { ref: "container", onTouchstart: i[1] || (i[1] = function() {
|
|
1582
1582
|
return o.onTouchStart && o.onTouchStart.apply(o, arguments);
|
|
1583
1583
|
}), onMousedown: i[2] || (i[2] = function() {
|
|
1584
1584
|
return o.onMouseDown && o.onMouseDown.apply(o, arguments);
|
|
@@ -1634,9 +1634,9 @@ function ca(e) {
|
|
|
1634
1634
|
}
|
|
1635
1635
|
s++;
|
|
1636
1636
|
}
|
|
1637
|
-
if (o && (n = o + 10, function(p,
|
|
1637
|
+
if (o && (n = o + 10, function(p, v, b) {
|
|
1638
1638
|
var y, _ = "";
|
|
1639
|
-
for (y =
|
|
1639
|
+
for (y = v, b += v; y < b; y++) _ += String.fromCharCode(p.getUint8(y));
|
|
1640
1640
|
return _;
|
|
1641
1641
|
}(t, o + 4, 4) === "Exif")) {
|
|
1642
1642
|
var u = t.getUint16(n);
|
|
@@ -1722,7 +1722,7 @@ var rn = { props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { typ
|
|
|
1722
1722
|
var r, l;
|
|
1723
1723
|
} }, emits: ["resize", "move", "transform-end"] };
|
|
1724
1724
|
rn.render = function(e, i, t, n, a, o) {
|
|
1725
|
-
return A(),
|
|
1725
|
+
return A(), H("div", { ref: "container", onTouchstart: i[1] || (i[1] = function() {
|
|
1726
1726
|
return o.onTouchStart && o.onTouchStart.apply(o, arguments);
|
|
1727
1727
|
}), onMousedown: i[2] || (i[2] = function() {
|
|
1728
1728
|
return o.onMouseDown && o.onMouseDown.apply(o, arguments);
|
|
@@ -1733,7 +1733,7 @@ rn.render = function(e, i, t, n, a, o) {
|
|
|
1733
1733
|
var Wt = { components: { TransformableImage: rn }, props: { touchMove: { type: Boolean, required: !0 }, mouseMove: { type: Boolean, required: !0 }, touchResize: { type: Boolean, required: !0 }, wheelResize: { type: [Boolean, Object], required: !0 } }, emits: ["resize", "move"] };
|
|
1734
1734
|
Wt.render = function(e, i, t, n, a, o) {
|
|
1735
1735
|
var r = N("transformable-image");
|
|
1736
|
-
return A(),
|
|
1736
|
+
return A(), H(r, { "touch-move": t.touchMove, "touch-resize": t.touchResize, "mouse-move": t.mouseMove, "wheel-resize": t.wheelResize, onMove: i[1] || (i[1] = function(l) {
|
|
1737
1737
|
return e.$emit("move", l);
|
|
1738
1738
|
}), onResize: i[2] || (i[2] = function(l) {
|
|
1739
1739
|
return e.$emit("resize", l);
|
|
@@ -1785,12 +1785,12 @@ var yt = Pe("vue-preview"), sn = { props: { coordinates: { type: Object }, trans
|
|
|
1785
1785
|
e && e.complete && this.refreshImage(), this.refresh();
|
|
1786
1786
|
} } };
|
|
1787
1787
|
sn.render = function(e, i, t, n, a, o) {
|
|
1788
|
-
return A(),
|
|
1788
|
+
return A(), H("div", { ref: "root", class: o.classes.root, style: o.style }, [g("div", { ref: "wrapper", class: o.classes.wrapper, style: o.wrapperStyle }, [ct(g("img", { ref: "image", src: t.image && t.image.src, class: o.classes.image, style: o.imageStyle }, null, 14, ["src"]), [[Ct, t.image && t.image.src]])], 6)], 6);
|
|
1789
1789
|
};
|
|
1790
1790
|
var ln = { components: { Preview: sn }, inheritAttrs: !1 };
|
|
1791
1791
|
ln.render = function(e, i, t, n, a, o) {
|
|
1792
1792
|
var r = N("preview");
|
|
1793
|
-
return A(),
|
|
1793
|
+
return A(), H(r, Fi(e.$attrs, { fill: !0 }), null, 16);
|
|
1794
1794
|
};
|
|
1795
1795
|
var Pt = Pe("vue-rectangle-stencil"), un = { name: "RectangleStencil", components: { StencilPreview: ln, BoundingBox: nn, DraggableArea: on }, props: { image: { type: Object }, coordinates: { type: Object }, stencilCoordinates: { type: Object }, handlers: { type: Object }, handlersComponent: { type: [Object, String], default: function() {
|
|
1796
1796
|
return Jt;
|
|
@@ -1824,7 +1824,7 @@ var Pt = Pe("vue-rectangle-stencil"), un = { name: "RectangleStencil", component
|
|
|
1824
1824
|
} }, emits: ["resize", "resize-end", "move", "move-end"] };
|
|
1825
1825
|
un.render = function(e, i, t, n, a, o) {
|
|
1826
1826
|
var r = N("stencil-preview"), l = N("draggable-area"), s = N("bounding-box");
|
|
1827
|
-
return A(),
|
|
1827
|
+
return A(), H("div", { class: o.classes.stencil, style: o.style }, [g(s, { width: t.stencilCoordinates.width, height: t.stencilCoordinates.height, transitions: t.transitions, class: o.classes.boundingBox, handlers: t.handlers, "handlers-component": t.handlersComponent, "handlers-classes": t.handlersClasses, "handlers-wrappers-classes": t.handlersWrappersClasses, lines: t.lines, "lines-component": t.linesComponent, "lines-classes": t.linesClasses, "lines-wrappers-classes": t.linesWrappersClasses, resizable: t.resizable, onResize: o.onResize, onResizeEnd: o.onResizeEnd }, { default: V(function() {
|
|
1828
1828
|
return [g(l, { movable: t.movable, onMove: o.onMove, onMoveEnd: o.onMoveEnd }, { default: V(function() {
|
|
1829
1829
|
return [g(r, { image: t.image, coordinates: t.coordinates, width: t.stencilCoordinates.width, height: t.stencilCoordinates.height, class: o.classes.preview, transitions: t.transitions }, null, 8, ["image", "coordinates", "width", "height", "class", "transitions"])];
|
|
1830
1830
|
}), _: 1 }, 8, ["movable", "onMove", "onMoveEnd"])];
|
|
@@ -1842,29 +1842,29 @@ var da = ["transitions"], Ke = Pe("vue-advanced-cropper"), cn = { name: "Cropper
|
|
|
1842
1842
|
return !(typeof e == "string" && e !== "fill" && e !== "fit");
|
|
1843
1843
|
} }, priority: { type: String, default: "coordinates" }, stencilSize: { type: [Object, Function] }, resizeImage: { type: [Boolean, Object], default: !0 }, moveImage: { type: [Boolean, Object], default: !0 }, autoZoomAlgorithm: { type: Function }, resizeAlgorithm: { type: Function, default: function(e) {
|
|
1844
1844
|
var i = e.event, t = e.coordinates, n = e.aspectRatio, a = e.positionRestrictions, o = e.sizeRestrictions, r = ee(ee({}, t), { right: t.left + t.width, bottom: t.top + t.height }), l = i.params || {}, s = ee({}, i.directions), u = l.allowedDirections || { left: !0, right: !0, bottom: !0, top: !0 };
|
|
1845
|
-
o.widthFrozen && (s.left = 0, s.right = 0), o.heightFrozen && (s.top = 0, s.bottom = 0), Ue.forEach(function(
|
|
1846
|
-
u[
|
|
1845
|
+
o.widthFrozen && (s.left = 0, s.right = 0), o.heightFrozen && (s.top = 0, s.bottom = 0), Ue.forEach(function(K) {
|
|
1846
|
+
u[K] || (s[K] = 0);
|
|
1847
1847
|
});
|
|
1848
1848
|
var d = Ve(r, s = Ri({ coordinates: r, directions: s, sizeRestrictions: o, positionRestrictions: a })).width, c = Ve(r, s).height, m = l.preserveRatio ? le(r) : Et(d / c, n);
|
|
1849
1849
|
if (m) {
|
|
1850
1850
|
var p = l.respectDirection;
|
|
1851
1851
|
if (p || (p = r.width >= r.height || m === 1 ? "width" : "height"), p === "width") {
|
|
1852
|
-
var
|
|
1852
|
+
var v = d / m - r.height;
|
|
1853
1853
|
if (u.top && u.bottom) {
|
|
1854
1854
|
var b = s.top, y = s.bottom;
|
|
1855
|
-
s.bottom = bt(
|
|
1856
|
-
} else u.bottom ? s.bottom =
|
|
1855
|
+
s.bottom = bt(v, y, b), s.top = bt(v, b, y);
|
|
1856
|
+
} else u.bottom ? s.bottom = v : u.top ? s.top = v : u.right ? s.right = 0 : u.left && (s.left = 0);
|
|
1857
1857
|
} else if (p === "height") {
|
|
1858
1858
|
var _ = r.width - c * m;
|
|
1859
1859
|
if (u.left && u.right) {
|
|
1860
|
-
var
|
|
1861
|
-
s.left = -bt(_,
|
|
1860
|
+
var f = s.left, C = s.right;
|
|
1861
|
+
s.left = -bt(_, f, C), s.right = -bt(_, C, f);
|
|
1862
1862
|
} else u.left ? s.left = -_ : u.right ? s.right = -_ : u.top ? s.top = 0 : u.bottom && (s.bottom = 0);
|
|
1863
1863
|
}
|
|
1864
1864
|
s = Ri({ directions: s, coordinates: r, sizeRestrictions: o, positionRestrictions: a, preserveRatio: !0, compensate: l.compensate });
|
|
1865
1865
|
}
|
|
1866
|
-
return d = Ve(r, s).width, c = Ve(r, s).height, (m = l.preserveRatio ? le(r) : Et(d / c, n)) && Math.abs(m - d / c) > 1e-3 && Ue.forEach(function(
|
|
1867
|
-
u[
|
|
1866
|
+
return d = Ve(r, s).width, c = Ve(r, s).height, (m = l.preserveRatio ? le(r) : Et(d / c, n)) && Math.abs(m - d / c) > 1e-3 && Ue.forEach(function(K) {
|
|
1867
|
+
u[K] || (s[K] = 0);
|
|
1868
1868
|
}), jt({ event: new Zt({ left: -s.left, top: -s.top }), coordinates: { width: t.width + s.right + s.left, height: t.height + s.top + s.bottom, left: t.left, top: t.top }, positionRestrictions: a });
|
|
1869
1869
|
} }, moveAlgorithm: { type: Function, default: jt }, initStretcher: { type: Function, default: function(e) {
|
|
1870
1870
|
var i = e.stretcher, t = e.imageSize, n = le(t);
|
|
@@ -2036,10 +2036,10 @@ var da = ["transitions"], Ke = Pe("vue-advanced-cropper"), cn = { name: "Cropper
|
|
|
2036
2036
|
}, getCanvas: function() {
|
|
2037
2037
|
if (this.$refs.canvas) {
|
|
2038
2038
|
var e = this.$refs.canvas, i = this.$refs.image, t = this.imageTransforms.rotate !== 0 || this.imageTransforms.flip.horizontal || this.imageTransforms.flip.vertical ? function(l, s, u) {
|
|
2039
|
-
var d = u.rotate, c = u.flip, m = { width: s.naturalWidth, height: s.naturalHeight }, p = en(m, d),
|
|
2040
|
-
l.height = p.height, l.width = p.width,
|
|
2039
|
+
var d = u.rotate, c = u.flip, m = { width: s.naturalWidth, height: s.naturalHeight }, p = en(m, d), v = l.getContext("2d");
|
|
2040
|
+
l.height = p.height, l.width = p.width, v.save();
|
|
2041
2041
|
var b = Xe(we(ee({ left: 0, top: 0 }, m)), d);
|
|
2042
|
-
return
|
|
2042
|
+
return v.translate(-(b.left - p.width / 2), -(b.top - p.height / 2)), v.rotate(d * Math.PI / 180), v.translate(c.horizontal ? m.width : 0, c.vertical ? m.height : 0), v.scale(c.horizontal ? -1 : 1, c.vertical ? -1 : 1), v.drawImage(s, 0, 0, m.width, m.height), v.restore(), l;
|
|
2043
2043
|
}(this.$refs.sourceCanvas, i, this.imageTransforms) : i, n = se({ minWidth: 0, minHeight: 0, maxWidth: 1 / 0, maxHeight: 1 / 0, maxArea: this.maxCanvasSize, imageSmoothingEnabled: !0, imageSmoothingQuality: "high", fillColor: "transparent" }, this.canvas), a = function(l) {
|
|
2044
2044
|
return l.find(function(s) {
|
|
2045
2045
|
return u = s, !Number.isNaN(parseFloat(u)) && isFinite(u);
|
|
@@ -2054,8 +2054,8 @@ var da = ["transitions"], Ke = Pe("vue-advanced-cropper"), cn = { name: "Cropper
|
|
|
2054
2054
|
l.width = d ? d.width : u.width, l.height = d ? d.height : u.height;
|
|
2055
2055
|
var m = l.getContext("2d");
|
|
2056
2056
|
m.clearRect(0, 0, l.width, l.height), c && (c.imageSmoothingEnabled && (m.imageSmoothingEnabled = c.imageSmoothingEnabled), c.imageSmoothingQuality && (m.imageSmoothingQuality = c.imageSmoothingQuality), c.fillColor && (m.fillStyle = c.fillColor, m.fillRect(0, 0, l.width, l.height), m.save()));
|
|
2057
|
-
var p = u.left < 0 ? -u.left : 0,
|
|
2058
|
-
m.drawImage(s, u.left + p, u.top +
|
|
2057
|
+
var p = u.left < 0 ? -u.left : 0, v = u.top < 0 ? -u.top : 0;
|
|
2058
|
+
m.drawImage(s, u.left + p, u.top + v, u.width, u.height, p * (l.width / u.width), v * (l.height / u.height), l.width, l.height);
|
|
2059
2059
|
}(e, t, this.coordinates, o, n), e;
|
|
2060
2060
|
}
|
|
2061
2061
|
}, update: function() {
|
|
@@ -2257,9 +2257,9 @@ var da = ["transitions"], Ke = Pe("vue-advanced-cropper"), cn = { name: "Cropper
|
|
|
2257
2257
|
}
|
|
2258
2258
|
} }, emits: ["change", "error", "ready"] }, ma = { key: 0, ref: "canvas", style: { display: "none" } }, pa = { key: 1, ref: "sourceCanvas", style: { display: "none" } };
|
|
2259
2259
|
cn.render = function(e, i, t, n, a, o) {
|
|
2260
|
-
return A(),
|
|
2260
|
+
return A(), H("div", { ref: "cropper", class: o.classes.cropper }, [g("div", { ref: "stretcher", class: o.classes.stretcher }, null, 2), g("div", { class: o.classes.boundaries, style: o.boundariesStyle }, [(A(), H(St(t.backgroundWrapperComponent), { class: o.classes.cropperWrapper, "wheel-resize": o.settings.resizeImage.wheel, "touch-resize": o.settings.resizeImage.touch, "touch-move": o.settings.moveImage.touch, "mouse-move": o.settings.moveImage.mouse, onMove: o.onManipulateImage, onResize: o.onManipulateImage }, { default: V(function() {
|
|
2261
2261
|
return [g("div", { class: o.classes.background, style: o.boundariesStyle }, null, 6), g("div", { class: o.classes.imageWrapper }, [g("img", { ref: "image", crossorigin: a.imageAttributes.crossOrigin, src: a.imageAttributes.src, class: o.classes.image, style: o.imageStyle, onMousedown: i[1] || (i[1] = kt(function() {
|
|
2262
|
-
}, ["prevent"])) }, null, 46, ["crossorigin", "src"])], 2), g("div", { class: o.classes.foreground, style: o.boundariesStyle }, null, 6), ct((A(),
|
|
2262
|
+
}, ["prevent"])) }, null, 46, ["crossorigin", "src"])], 2), g("div", { class: o.classes.foreground, style: o.boundariesStyle }, null, 6), ct((A(), H(St(t.stencilComponent), Fi({ ref: "stencil", image: o.image, coordinates: a.coordinates, "stencil-coordinates": o.stencilCoordinates, transitions: o.transitionsOptions }, t.stencilProps, { onResize: o.onResize, onResizeEnd: o.onResizeEnd, onMove: o.onMove, onMoveEnd: o.onMoveEnd }), null, 16, ["image", "coordinates", "stencil-coordinates", "transitions", "onResize", "onResizeEnd", "onMove", "onMoveEnd"])), [[Ct, a.imageLoaded]]), t.canvas ? (A(), H("canvas", ma, null, 512)) : ie("", !0), t.canvas ? (A(), H("canvas", pa, null, 512)) : ie("", !0)];
|
|
2263
2263
|
}), _: 1 }, 8, ["class", "wheel-resize", "touch-resize", "touch-move", "mouse-move", "onMove", "onResize"]))], 6)], 2);
|
|
2264
2264
|
};
|
|
2265
2265
|
function ti(e, i) {
|
|
@@ -2312,11 +2312,11 @@ const va = {
|
|
|
2312
2312
|
s.value = !0;
|
|
2313
2313
|
const _ = new FileReader();
|
|
2314
2314
|
_.onload = () => {
|
|
2315
|
-
const
|
|
2316
|
-
|
|
2317
|
-
const
|
|
2318
|
-
r.value =
|
|
2319
|
-
},
|
|
2315
|
+
const f = new Image();
|
|
2316
|
+
f.src = _.result, l.value = _.result, f.onload = () => {
|
|
2317
|
+
const C = fa(f, 1.7777777777777777);
|
|
2318
|
+
r.value = C, s.value = !1;
|
|
2319
|
+
}, f.onerror = () => {
|
|
2320
2320
|
s.value = !1;
|
|
2321
2321
|
};
|
|
2322
2322
|
}, _.readAsDataURL(y);
|
|
@@ -2326,15 +2326,15 @@ const va = {
|
|
|
2326
2326
|
};
|
|
2327
2327
|
async function c(y) {
|
|
2328
2328
|
!r.value && o.value && (r.value = o.value);
|
|
2329
|
-
const { canvas: _ } = y,
|
|
2330
|
-
l.value =
|
|
2331
|
-
const
|
|
2332
|
-
a("update:model-value",
|
|
2329
|
+
const { canvas: _ } = y, f = _.toDataURL("image/jpeg", 0.75);
|
|
2330
|
+
l.value = f;
|
|
2331
|
+
const C = await (await fetch(f)).blob(), K = new File([C], "img.jpeg", { type: "image/jpeg" });
|
|
2332
|
+
a("update:model-value", K);
|
|
2333
2333
|
}
|
|
2334
2334
|
function m() {
|
|
2335
2335
|
r.value = void 0, l.value = void 0, a("reset:model-value");
|
|
2336
2336
|
}
|
|
2337
|
-
const p = Ht(),
|
|
2337
|
+
const p = Ht(), v = O(() => !!p.showRemy);
|
|
2338
2338
|
ti("apply-image", (y) => {
|
|
2339
2339
|
y != null && y.imageData && (r.value = y.imageData, l.value = y.imageData);
|
|
2340
2340
|
});
|
|
@@ -2351,7 +2351,7 @@ const va = {
|
|
|
2351
2351
|
});
|
|
2352
2352
|
}
|
|
2353
2353
|
return (y, _) => {
|
|
2354
|
-
const
|
|
2354
|
+
const f = N("fm-icon"), C = N("fm-drop-field");
|
|
2355
2355
|
return r.value || o.value ? (A(), ne("div", va, [
|
|
2356
2356
|
P("p", ga, [
|
|
2357
2357
|
Vt(de(h(n)("menu.common.labels.product_image")) + " ", 1),
|
|
@@ -2382,9 +2382,9 @@ const va = {
|
|
|
2382
2382
|
type: "button",
|
|
2383
2383
|
onClick: m
|
|
2384
2384
|
}, [
|
|
2385
|
-
g(
|
|
2385
|
+
g(f, { name: "close" })
|
|
2386
2386
|
]),
|
|
2387
|
-
|
|
2387
|
+
v.value ? (A(), ne("button", {
|
|
2388
2388
|
key: 0,
|
|
2389
2389
|
class: Fe([
|
|
2390
2390
|
"w-24 h-24 rounded-[50%]",
|
|
@@ -2394,7 +2394,7 @@ const va = {
|
|
|
2394
2394
|
type: "button",
|
|
2395
2395
|
onClick: b
|
|
2396
2396
|
}, [
|
|
2397
|
-
g(
|
|
2397
|
+
g(f, {
|
|
2398
2398
|
name: "auto_awesome",
|
|
2399
2399
|
size: "sm"
|
|
2400
2400
|
})
|
|
@@ -2402,7 +2402,7 @@ const va = {
|
|
|
2402
2402
|
])
|
|
2403
2403
|
])
|
|
2404
2404
|
])
|
|
2405
|
-
])) : (A(),
|
|
2405
|
+
])) : (A(), H(C, {
|
|
2406
2406
|
key: 1,
|
|
2407
2407
|
accept: ".jpg, .jpeg, .png, .gif, .JPG, .JPEG, .PNG, .GIF",
|
|
2408
2408
|
"content-class": "h-[150px] w-[200px]",
|
|
@@ -2466,15 +2466,15 @@ const va = {
|
|
|
2466
2466
|
const t = e, { t: n } = he(), a = i, o = O(() => ({
|
|
2467
2467
|
ALL: {
|
|
2468
2468
|
label: n("menu.order.from.options.all"),
|
|
2469
|
-
value:
|
|
2469
|
+
value: Y.F_ORDER_FROM.enum.ALL
|
|
2470
2470
|
},
|
|
2471
2471
|
POS_ONLY: {
|
|
2472
2472
|
label: n("menu.order.from.options.pos_only"),
|
|
2473
|
-
value:
|
|
2473
|
+
value: Y.F_ORDER_FROM.enum.POS_ONLY
|
|
2474
2474
|
},
|
|
2475
2475
|
NONE: {
|
|
2476
2476
|
label: n("menu.order.from.options.none"),
|
|
2477
|
-
value:
|
|
2477
|
+
value: Y.F_ORDER_FROM.enum.NONE
|
|
2478
2478
|
}
|
|
2479
2479
|
})), r = O(() => {
|
|
2480
2480
|
const u = Object.values(o.value);
|
|
@@ -2486,11 +2486,11 @@ const va = {
|
|
|
2486
2486
|
value: null
|
|
2487
2487
|
},
|
|
2488
2488
|
...d
|
|
2489
|
-
]), t.orderFromNone ? d : d.filter((c) => c.value !==
|
|
2489
|
+
]), t.orderFromNone ? d : d.filter((c) => c.value !== Y.F_ORDER_FROM.enum.NONE);
|
|
2490
2490
|
});
|
|
2491
2491
|
function l(u) {
|
|
2492
2492
|
let d = u;
|
|
2493
|
-
return t.editActiveOnly && u && (d = d ===
|
|
2493
|
+
return t.editActiveOnly && u && (d = d === Y.F_ORDER_FROM.enum.NONE ? Y.F_ORDER_FROM.enum.NONE : Y.F_ORDER_FROM.enum.ALL), d;
|
|
2494
2494
|
}
|
|
2495
2495
|
const s = O(() => {
|
|
2496
2496
|
if (t.modelValue) return t.modelValue;
|
|
@@ -2534,57 +2534,57 @@ const va = {
|
|
|
2534
2534
|
dialog: a,
|
|
2535
2535
|
menuLoader: l,
|
|
2536
2536
|
isLocalOnly: t.isLocalOnly
|
|
2537
|
-
}), m = (
|
|
2538
|
-
|
|
2537
|
+
}), m = (f, C) => {
|
|
2538
|
+
f ? d.value = [...d.value, C] : d.value = d.value.filter((K) => K.value !== C.value), n(
|
|
2539
2539
|
"update:modelValue",
|
|
2540
|
-
d.value.map((
|
|
2540
|
+
d.value.map((K) => K.value)
|
|
2541
2541
|
);
|
|
2542
|
-
}, p = (
|
|
2543
|
-
d.value = d.value.filter((
|
|
2542
|
+
}, p = (f) => {
|
|
2543
|
+
d.value = d.value.filter((C, K) => K !== f), n(
|
|
2544
2544
|
"update:modelValue",
|
|
2545
|
-
d.value.map((
|
|
2545
|
+
d.value.map((C) => C.value)
|
|
2546
2546
|
);
|
|
2547
|
-
},
|
|
2548
|
-
var
|
|
2549
|
-
(
|
|
2547
|
+
}, v = () => {
|
|
2548
|
+
var f;
|
|
2549
|
+
(f = u.value) == null || f.toggleMenu(!1), c.create();
|
|
2550
2550
|
}, b = O(() => t.items.reduce(
|
|
2551
|
-
(
|
|
2551
|
+
(f, C) => (f[C.value] = C, f),
|
|
2552
2552
|
{}
|
|
2553
|
-
)), y = O(() => d.value.length > 0 ? d.value.map((
|
|
2553
|
+
)), y = O(() => d.value.length > 0 ? d.value.map((f) => f.label).join("/") : t.placeholder), _ = te(!1);
|
|
2554
2554
|
return Re(
|
|
2555
2555
|
() => t.modelValue,
|
|
2556
|
-
(
|
|
2557
|
-
|
|
2556
|
+
(f) => {
|
|
2557
|
+
f != null && f.length ? d.value = f.map((C) => b.value[C]).filter((C) => !!C) : d.value = [];
|
|
2558
2558
|
},
|
|
2559
2559
|
{ immediate: !0 }
|
|
2560
|
-
), (
|
|
2561
|
-
const
|
|
2560
|
+
), (f, C) => {
|
|
2561
|
+
const K = N("FmIcon"), U = N("FmField"), j = N("FmMenuItem"), M = N("FmMenu"), D = N("FmFormGroup"), I = N("FmChipGroup");
|
|
2562
2562
|
return A(), ne("div", Aa, [
|
|
2563
2563
|
g(D, {
|
|
2564
|
-
"model-value":
|
|
2565
|
-
disabled:
|
|
2564
|
+
"model-value": f.modelValue,
|
|
2565
|
+
disabled: f.disabled,
|
|
2566
2566
|
focused: _.value,
|
|
2567
|
-
"helper-state":
|
|
2568
|
-
"helper-text":
|
|
2569
|
-
rules:
|
|
2567
|
+
"helper-state": f.helperState,
|
|
2568
|
+
"helper-text": f.helperText,
|
|
2569
|
+
rules: f.rules
|
|
2570
2570
|
}, {
|
|
2571
2571
|
default: V(({ invalid: w }) => [
|
|
2572
2572
|
g(M, {
|
|
2573
|
-
disabled:
|
|
2573
|
+
disabled: f.disabled,
|
|
2574
2574
|
ref_key: "fmMenuRef",
|
|
2575
2575
|
ref: u,
|
|
2576
2576
|
"close-on-click": !1,
|
|
2577
|
-
onMenuChanged:
|
|
2577
|
+
onMenuChanged: C[1] || (C[1] = (R) => _.value = R)
|
|
2578
2578
|
}, {
|
|
2579
2579
|
"menu-button": V(() => [
|
|
2580
2580
|
g(U, {
|
|
2581
|
-
class: Fe(
|
|
2581
|
+
class: Fe(f.disabled ? "cursor-not-allowed" : "cursor-pointer"),
|
|
2582
2582
|
focused: _.value,
|
|
2583
2583
|
invalid: w
|
|
2584
2584
|
}, {
|
|
2585
2585
|
append: V(() => [
|
|
2586
|
-
g(
|
|
2587
|
-
color:
|
|
2586
|
+
g(K, {
|
|
2587
|
+
color: f.disabled ? "#C7C7CC" : "black",
|
|
2588
2588
|
name: _.value ? "expand_less" : "expand_more",
|
|
2589
2589
|
size: "md"
|
|
2590
2590
|
}, null, 8, ["color", "name"])
|
|
@@ -2592,7 +2592,7 @@ const va = {
|
|
|
2592
2592
|
default: V(() => [
|
|
2593
2593
|
P("div", {
|
|
2594
2594
|
class: Fe([[
|
|
2595
|
-
|
|
2595
|
+
f.disabled ? "text-fm-color-typo-disabled" : d.value.length > 0 ? "text-fm-color-typo-primary" : "text-fm-color-typo-tertiary"
|
|
2596
2596
|
], "break-all fm-typo-en-body-lg-400 line-clamp-1"])
|
|
2597
2597
|
}, de(y.value), 3)
|
|
2598
2598
|
]),
|
|
@@ -2601,7 +2601,7 @@ const va = {
|
|
|
2601
2601
|
]),
|
|
2602
2602
|
default: V(() => [
|
|
2603
2603
|
P("div", Ma, [
|
|
2604
|
-
(A(!0), ne(Me, null, Ne(
|
|
2604
|
+
(A(!0), ne(Me, null, Ne(f.items, (R) => (A(), H(j, {
|
|
2605
2605
|
key: R.value,
|
|
2606
2606
|
disabled: R.disabled,
|
|
2607
2607
|
"has-checkbox": !0,
|
|
@@ -2612,9 +2612,9 @@ const va = {
|
|
|
2612
2612
|
P("button", {
|
|
2613
2613
|
class: "flex items-center py-8 px-16 space-x-8",
|
|
2614
2614
|
type: "button",
|
|
2615
|
-
onClick:
|
|
2615
|
+
onClick: C[0] || (C[0] = (R) => v())
|
|
2616
2616
|
}, [
|
|
2617
|
-
g(
|
|
2617
|
+
g(K, {
|
|
2618
2618
|
color: "primary",
|
|
2619
2619
|
name: "add",
|
|
2620
2620
|
size: "md"
|
|
@@ -2630,7 +2630,7 @@ const va = {
|
|
|
2630
2630
|
}, 8, ["model-value", "disabled", "focused", "helper-state", "helper-text", "rules"]),
|
|
2631
2631
|
d.value.length > 0 ? (A(), ne("div", Fa, [
|
|
2632
2632
|
g(I, {
|
|
2633
|
-
disabled:
|
|
2633
|
+
disabled: f.disabled,
|
|
2634
2634
|
items: d.value.map((w) => ({ label: w.label })),
|
|
2635
2635
|
removable: "",
|
|
2636
2636
|
onChipClosed: p
|
|
@@ -2699,19 +2699,19 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2699
2699
|
menuLoader: s
|
|
2700
2700
|
}), {
|
|
2701
2701
|
checkMenuIsLoading: d
|
|
2702
|
-
} = Ze(qe(De())), c = i, m = O(() => n.rules.item), p = O(() => n.categorizedItems),
|
|
2702
|
+
} = Ze(qe(De())), c = i, m = O(() => n.rules.item), p = O(() => n.categorizedItems), v = O(() => {
|
|
2703
2703
|
const T = p.value.map((L) => ({
|
|
2704
2704
|
label: L.name,
|
|
2705
2705
|
value: L.id
|
|
2706
2706
|
}));
|
|
2707
2707
|
return t.isAddon ? T : T.filter((L) => !!L.value);
|
|
2708
|
-
}), b = O(() => m.value.addon), y = O(() => !
|
|
2708
|
+
}), b = O(() => m.value.addon), y = O(() => !v.value.find((T) => !!T.value)), _ = O(() => On(t.form.category ? t.form : t.fallback) || []), f = O(() => _.value.reduce((T, L) => (T[L._id] = L, T), {})), C = O({
|
|
2709
2709
|
get() {
|
|
2710
2710
|
return _.value.map((T) => T._id);
|
|
2711
2711
|
},
|
|
2712
2712
|
set(T = []) {
|
|
2713
2713
|
const [L, ...ae] = T.map((z) => {
|
|
2714
|
-
const E =
|
|
2714
|
+
const E = f.value[z];
|
|
2715
2715
|
return E || {
|
|
2716
2716
|
_id: z,
|
|
2717
2717
|
position: null
|
|
@@ -2723,14 +2723,14 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2723
2723
|
}
|
|
2724
2724
|
c("update:form", "category", L._id), c("update:form", "additionalCategories", ae);
|
|
2725
2725
|
}
|
|
2726
|
-
}),
|
|
2726
|
+
}), K = te(), U = ({
|
|
2727
2727
|
multiple: T = !0
|
|
2728
2728
|
} = {}) => t.isAddon ? null : g(To, {
|
|
2729
|
-
ref:
|
|
2729
|
+
ref: K,
|
|
2730
2730
|
disabled: !m.value.category || t.isAddon || d(),
|
|
2731
|
-
items:
|
|
2732
|
-
modelValue:
|
|
2733
|
-
"onUpdate:model-value": (L) =>
|
|
2731
|
+
items: v.value,
|
|
2732
|
+
modelValue: C.value,
|
|
2733
|
+
"onUpdate:model-value": (L) => C.value = L,
|
|
2734
2734
|
placeholder: F("menu.product.form.detail.category.placeholder"),
|
|
2735
2735
|
multiple: T
|
|
2736
2736
|
}, {
|
|
@@ -2739,7 +2739,7 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2739
2739
|
type: "button",
|
|
2740
2740
|
onClick: () => {
|
|
2741
2741
|
var L;
|
|
2742
|
-
(L =
|
|
2742
|
+
(L = K.value) == null || L.hideMenu(), u.create();
|
|
2743
2743
|
}
|
|
2744
2744
|
}, [g(Ae.FmIcon, {
|
|
2745
2745
|
color: "primary",
|
|
@@ -2752,18 +2752,18 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2752
2752
|
at(async () => {
|
|
2753
2753
|
!y.value && t.form.category === void 0 && t.isCreate && I(et.PRODUCT);
|
|
2754
2754
|
});
|
|
2755
|
-
const
|
|
2755
|
+
const j = O(() => {
|
|
2756
2756
|
var L;
|
|
2757
2757
|
const T = t.form.name || ((L = t.fallback) == null ? void 0 : L.name);
|
|
2758
2758
|
return T ? n.items.filter((ae) => !!ae.category && ae._id !== t.form._id && ae.name === T).length : 0;
|
|
2759
2759
|
}), M = O(() => {
|
|
2760
|
-
var z, E,
|
|
2760
|
+
var z, E, W;
|
|
2761
2761
|
if (!n.state.featureFlags.uniqueProductCode) return 0;
|
|
2762
2762
|
const T = t.form.code || ((z = t.fallback) == null ? void 0 : z.code);
|
|
2763
2763
|
if (!T) return 0;
|
|
2764
2764
|
let L = n.itemCodeMap.get(T) || 0;
|
|
2765
2765
|
const ae = n.items.find((Z) => Z._id === t.form._id);
|
|
2766
|
-
return (ae == null ? void 0 : ae.code) === T && (L -= 1), (
|
|
2766
|
+
return (ae == null ? void 0 : ae.code) === T && (L -= 1), (W = (E = ae == null ? void 0 : ae.variant) == null ? void 0 : E.variantCombinations) == null || W.forEach((Z) => {
|
|
2767
2767
|
Z.code === T && (L -= 1);
|
|
2768
2768
|
}), L;
|
|
2769
2769
|
}), D = O(() => t.isAddon ? et.ADD_ON : et.PRODUCT);
|
|
@@ -2771,7 +2771,7 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2771
2771
|
var ae, z, E;
|
|
2772
2772
|
if (D.value === T) return;
|
|
2773
2773
|
const L = T == et.ADD_ON;
|
|
2774
|
-
c("update:form", "category", t.isOverride ? L ? "" : ((ae = t.fallback) == null ? void 0 : ae.category) ?? ((z =
|
|
2774
|
+
c("update:form", "category", t.isOverride ? L ? "" : ((ae = t.fallback) == null ? void 0 : ae.category) ?? ((z = v.value.find((W) => !!W.value)) == null ? void 0 : z.value) : L ? null : (E = v.value.find((W) => !!W.value)) == null ? void 0 : E.value), L && c("update:form", "additionalCategories", []);
|
|
2775
2775
|
}
|
|
2776
2776
|
const w = Ht();
|
|
2777
2777
|
ti("apply-description", (T) => {
|
|
@@ -2793,7 +2793,7 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2793
2793
|
command: "suggestDescription"
|
|
2794
2794
|
});
|
|
2795
2795
|
}
|
|
2796
|
-
const S = O(() => n.subcategories),
|
|
2796
|
+
const S = O(() => n.subcategories), x = O(() => S.value.map((T) => ({
|
|
2797
2797
|
label: T.name,
|
|
2798
2798
|
value: T._id
|
|
2799
2799
|
}))), $ = O({
|
|
@@ -2804,15 +2804,15 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2804
2804
|
c("update:form", "subCategories", T);
|
|
2805
2805
|
}
|
|
2806
2806
|
}), B = O(() => t.isOverride ? t.form.minimumOrderQuantity ?? null : t.form.minimumOrderQuantity ?? 0);
|
|
2807
|
-
function
|
|
2807
|
+
function k(T) {
|
|
2808
2808
|
c("update:form", "minimumOrderQuantity", t.isOverride ? T : T ?? 0);
|
|
2809
2809
|
}
|
|
2810
2810
|
const {
|
|
2811
2811
|
t: F
|
|
2812
2812
|
} = he();
|
|
2813
2813
|
return (T, L) => {
|
|
2814
|
-
const ae = N("fm-text-field"), z = N("fm-textarea"), E = N("fm-radio"),
|
|
2815
|
-
return A(),
|
|
2814
|
+
const ae = N("fm-text-field"), z = N("fm-textarea"), E = N("fm-radio"), W = N("FmSnackbar"), Z = N("FmButton"), Q = N("fm-radio-group"), q = N("FmFormGroup"), oe = N("FmStepperField"), ce = zi("tooltip");
|
|
2815
|
+
return A(), H(Ge, {
|
|
2816
2816
|
title: h(F)("menu.product.form.detail.title")
|
|
2817
2817
|
}, {
|
|
2818
2818
|
default: V(() => {
|
|
@@ -2828,8 +2828,8 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2828
2828
|
}, null, 8, ["model-value", "placeholder", "label", "rules"])]), P("div", Va, [g(ae, {
|
|
2829
2829
|
id: "product-name",
|
|
2830
2830
|
disabled: !m.value.name,
|
|
2831
|
-
"helper-text":
|
|
2832
|
-
count:
|
|
2831
|
+
"helper-text": j.value > 0 ? h(F)("menu.product.form.detail.fields.name.duplicate_warning", {
|
|
2832
|
+
count: j.value
|
|
2833
2833
|
}) : void 0,
|
|
2834
2834
|
"model-value": T.form.name,
|
|
2835
2835
|
placeholder: (ze = T.fallback) == null ? void 0 : ze.name,
|
|
@@ -2859,7 +2859,7 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2859
2859
|
}, null, 8, ["disabled", "model-value"])]), g(He, {
|
|
2860
2860
|
label: h(n).isV4 ? h(F)("menu.product.form.detail.category.label") : h(F)("menu.product.form.detail.category.label_singular")
|
|
2861
2861
|
}, {
|
|
2862
|
-
default: V(() => [b.value ? (A(),
|
|
2862
|
+
default: V(() => [b.value ? (A(), H(Q, {
|
|
2863
2863
|
key: 0,
|
|
2864
2864
|
disabled: !m.value.category,
|
|
2865
2865
|
"model-value": D.value,
|
|
@@ -2871,11 +2871,11 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2871
2871
|
label: h(F)("menu.product.form.detail.category.options.product.label"),
|
|
2872
2872
|
sublabel: h(F)("menu.product.form.detail.category.options.product.sublabel")
|
|
2873
2873
|
}, null, 8, ["disabled", "value", "label", "sublabel"]), g(Oo, null, {
|
|
2874
|
-
default: V(() => [h(n).isV4 ? (A(),
|
|
2874
|
+
default: V(() => [h(n).isV4 ? (A(), H(U, {
|
|
2875
2875
|
key: 0
|
|
2876
2876
|
})) : ie("", !0)]),
|
|
2877
2877
|
_: 1
|
|
2878
|
-
})]), y.value ? (A(), ne("div", Ga, [g(
|
|
2878
|
+
})]), y.value ? (A(), ne("div", Ga, [g(W, {
|
|
2879
2879
|
title: h(F)("menu.product.form.detail.category.add_first"),
|
|
2880
2880
|
variant: "info"
|
|
2881
2881
|
}, null, 8, ["title"]), g(Z, {
|
|
@@ -2889,7 +2889,7 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2889
2889
|
sublabel: h(F)("menu.product.form.detail.category.options.addon.sublabel")
|
|
2890
2890
|
}, null, 8, ["value", "label", "sublabel"])])]),
|
|
2891
2891
|
_: 1
|
|
2892
|
-
}, 8, ["disabled", "model-value"])) : ie("", !0), h(n).isV4 ? ie("", !0) : (A(),
|
|
2892
|
+
}, 8, ["disabled", "model-value"])) : ie("", !0), h(n).isV4 ? ie("", !0) : (A(), H(q, {
|
|
2893
2893
|
key: 1,
|
|
2894
2894
|
"model-value": T.form.category,
|
|
2895
2895
|
rules: [(re) => !re && !T.isOverride ? "Category is required" : !0],
|
|
@@ -2901,14 +2901,14 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2901
2901
|
_: 1
|
|
2902
2902
|
}, 8, ["model-value", "rules"]))]),
|
|
2903
2903
|
_: 1
|
|
2904
|
-
}, 8, ["label"]), h(n).isV4 && !T.isAddon ? (A(),
|
|
2904
|
+
}, 8, ["label"]), h(n).isV4 && !T.isAddon ? (A(), H(He, {
|
|
2905
2905
|
key: 0,
|
|
2906
2906
|
label: h(F)("menu.product.form.detail.path.label")
|
|
2907
2907
|
}, {
|
|
2908
2908
|
default: V(() => [P("div", Ka, [g(Ia, {
|
|
2909
2909
|
modelValue: $.value,
|
|
2910
2910
|
"onUpdate:modelValue": L[8] || (L[8] = (re) => $.value = re),
|
|
2911
|
-
items:
|
|
2911
|
+
items: x.value,
|
|
2912
2912
|
placeholder: h(F)("menu.product.form.detail.path.placeholder"),
|
|
2913
2913
|
disabled: !m.value.category,
|
|
2914
2914
|
"is-local-only": !1
|
|
@@ -2928,7 +2928,7 @@ const Wa = /* @__PURE__ */ me({
|
|
|
2928
2928
|
"model-value": B.value,
|
|
2929
2929
|
min: 0,
|
|
2930
2930
|
step: 1,
|
|
2931
|
-
"onUpdate:modelValue":
|
|
2931
|
+
"onUpdate:modelValue": k
|
|
2932
2932
|
}, null, 8, ["label", "model-value"])]), g(ii, {
|
|
2933
2933
|
disabled: !m.value.orderFrom,
|
|
2934
2934
|
"model-value": T.form.orderFrom,
|
|
@@ -2955,20 +2955,20 @@ const mn = /* @__PURE__ */ nt(Ha, [["render", Za]]), Qa = /* @__PURE__ */ me({
|
|
|
2955
2955
|
__name: "AddForm",
|
|
2956
2956
|
setup(e) {
|
|
2957
2957
|
const i = ye(), t = O(() => i.rules.group), n = O(() => !!i.state.currentCatalogId || !!i.state.currentSchedulerId), a = O(() => {
|
|
2958
|
-
const s = !i.state.currentSchedulerId, u = i.rules.group.type, d = i.version ===
|
|
2959
|
-
return function(
|
|
2958
|
+
const s = !i.state.currentSchedulerId, u = i.rules.group.type, d = i.version === Y.F_MENU_VERSION.enum.v3, c = i.rules.item.orderFromActiveOnly, m = i.rules.item.bindToVariant;
|
|
2959
|
+
return function(v) {
|
|
2960
2960
|
return {
|
|
2961
2961
|
link: (b) => !n.value && (!b || m),
|
|
2962
2962
|
name: (b) => !n.value && !b,
|
|
2963
2963
|
isDefault: (b) => !n.value,
|
|
2964
|
-
type: u && !
|
|
2965
|
-
price:
|
|
2964
|
+
type: u && !v._id && !n.value,
|
|
2965
|
+
price: v.type !== Y.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
|
|
2966
2966
|
priceEdit: !0,
|
|
2967
2967
|
priceTier: i.isV4,
|
|
2968
|
-
inventory: s ? d ? !n.value &&
|
|
2969
|
-
orderFrom: (b) => s ? d ?
|
|
2968
|
+
inventory: s ? d ? !n.value && v.type === Y.F_ADDON_GROUP_TYPE.enum.NORMAL : !n.value : !1,
|
|
2969
|
+
orderFrom: (b) => s ? d ? v.type === Y.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? n.value : !!n.value == !b : n.value : !1,
|
|
2970
2970
|
orderFromActiveOnly: c,
|
|
2971
|
-
showOrderFrom: s ? d ? n.value ? !0 :
|
|
2971
|
+
showOrderFrom: s ? d ? n.value ? !0 : v.type === Y.F_ADDON_GROUP_TYPE.enum.PRODUCT : n.value : !1,
|
|
2972
2972
|
bindToVariant: m,
|
|
2973
2973
|
isOverride: n.value,
|
|
2974
2974
|
isItemGroup: !1,
|
|
@@ -2977,12 +2977,12 @@ const mn = /* @__PURE__ */ nt(Ha, [["render", Za]]), Qa = /* @__PURE__ */ me({
|
|
|
2977
2977
|
};
|
|
2978
2978
|
}), o = () => ({
|
|
2979
2979
|
...Te.generator.initMenuV4Group(),
|
|
2980
|
-
type: i.version ===
|
|
2980
|
+
type: i.version === Y.F_MENU_VERSION.enum.v4 ? Y.F_ADDON_GROUP_TYPE.enum.PRODUCT : Y.F_ADDON_GROUP_TYPE.enum.NORMAL,
|
|
2981
2981
|
items: {},
|
|
2982
2982
|
position: i.groups.length - 1,
|
|
2983
2983
|
itemsLinked: []
|
|
2984
2984
|
}), r = te(o()), { t: l } = he();
|
|
2985
|
-
return (s, u) => t.value.create ? (A(),
|
|
2985
|
+
return (s, u) => t.value.create ? (A(), H(h(xr), {
|
|
2986
2986
|
key: 0,
|
|
2987
2987
|
"categorized-items": h(i).categorizedItems,
|
|
2988
2988
|
config: a.value,
|
|
@@ -3038,14 +3038,14 @@ const ir = /* @__PURE__ */ nt(Ja, [["render", tr]]), nr = { class: "fm-typo-en-t
|
|
|
3038
3038
|
}
|
|
3039
3039
|
), i({ getKey: () => n.bindingKey, trigger: o });
|
|
3040
3040
|
const { t: c } = he(), m = Bi();
|
|
3041
|
-
return (p,
|
|
3042
|
-
const b = N("fm-text-field"), y = N("fm-card"), _ = N("fm-button"),
|
|
3041
|
+
return (p, v) => {
|
|
3042
|
+
const b = N("fm-text-field"), y = N("fm-card"), _ = N("fm-button"), f = N("fm-side-sheet");
|
|
3043
3043
|
return A(), ne(Me, null, [
|
|
3044
3044
|
ve(p.$slots, "default", { trigger: o }),
|
|
3045
|
-
g(
|
|
3045
|
+
g(f, {
|
|
3046
3046
|
id: "inventory-form",
|
|
3047
3047
|
modelValue: a.value,
|
|
3048
|
-
"onUpdate:modelValue":
|
|
3048
|
+
"onUpdate:modelValue": v[2] || (v[2] = (C) => a.value = C),
|
|
3049
3049
|
"close-button": !1,
|
|
3050
3050
|
"is-container": h(Ae).FmForm,
|
|
3051
3051
|
"is-container-props": {
|
|
@@ -3070,7 +3070,7 @@ const ir = /* @__PURE__ */ nt(Ja, [["render", tr]]), nr = { class: "fm-typo-en-t
|
|
|
3070
3070
|
label: h(c)("menu.common.actions.cancel"),
|
|
3071
3071
|
size: "lg",
|
|
3072
3072
|
variant: "tertiary",
|
|
3073
|
-
onClick:
|
|
3073
|
+
onClick: v[1] || (v[1] = () => a.value = !1)
|
|
3074
3074
|
}, null, 8, ["label"])
|
|
3075
3075
|
])
|
|
3076
3076
|
]),
|
|
@@ -3088,7 +3088,7 @@ const ir = /* @__PURE__ */ nt(Ja, [["render", tr]]), nr = { class: "fm-typo-en-t
|
|
|
3088
3088
|
default: V(() => [
|
|
3089
3089
|
g(h(qn), {
|
|
3090
3090
|
modelValue: r.value,
|
|
3091
|
-
"onUpdate:modelValue":
|
|
3091
|
+
"onUpdate:modelValue": v[0] || (v[0] = (C) => r.value = C)
|
|
3092
3092
|
}, null, 8, ["modelValue"])
|
|
3093
3093
|
]),
|
|
3094
3094
|
_: 1
|
|
@@ -3215,12 +3215,12 @@ const pn = /* @__PURE__ */ me({
|
|
|
3215
3215
|
function m() {
|
|
3216
3216
|
n("submit", d.value), o();
|
|
3217
3217
|
}
|
|
3218
|
-
return (p,
|
|
3218
|
+
return (p, v) => {
|
|
3219
3219
|
const b = N("FmButton"), y = N("fm-button"), _ = N("FmSideSheet");
|
|
3220
|
-
return A(),
|
|
3220
|
+
return A(), H(_, {
|
|
3221
3221
|
id: "business-form",
|
|
3222
3222
|
modelValue: a.value,
|
|
3223
|
-
"onUpdate:modelValue":
|
|
3223
|
+
"onUpdate:modelValue": v[1] || (v[1] = (f) => a.value = f),
|
|
3224
3224
|
"is-container": h(Ae).FmForm,
|
|
3225
3225
|
"is-container-props": {
|
|
3226
3226
|
onValidationSuccess: m,
|
|
@@ -3268,7 +3268,7 @@ const pn = /* @__PURE__ */ me({
|
|
|
3268
3268
|
"price-tiers": h(u).priceTiers.value,
|
|
3269
3269
|
"model-value": d.value,
|
|
3270
3270
|
fallback: p.fallback,
|
|
3271
|
-
"onUpdate:modelValue":
|
|
3271
|
+
"onUpdate:modelValue": v[0] || (v[0] = (f) => d.value = f)
|
|
3272
3272
|
}, null, 8, ["price-tiers", "model-value", "fallback"])
|
|
3273
3273
|
]),
|
|
3274
3274
|
_: 1
|
|
@@ -3305,7 +3305,7 @@ const pn = /* @__PURE__ */ me({
|
|
|
3305
3305
|
const { t: l } = he();
|
|
3306
3306
|
return (s, u) => {
|
|
3307
3307
|
const d = N("FmButton"), c = N("FmTooltip");
|
|
3308
|
-
return s.$slots.default ? ve(s.$slots, "default", { key: 0 }) : (A(),
|
|
3308
|
+
return s.$slots.default ? ve(s.$slots, "default", { key: 0 }) : (A(), H(c, {
|
|
3309
3309
|
key: 1,
|
|
3310
3310
|
content: h(l)("menu.price_tier.price_tier_config"),
|
|
3311
3311
|
"z-index": 999,
|
|
@@ -3349,17 +3349,17 @@ const pn = /* @__PURE__ */ me({
|
|
|
3349
3349
|
}) {
|
|
3350
3350
|
const t = e, n = i;
|
|
3351
3351
|
De();
|
|
3352
|
-
const a = pt(), o = ye(), r = O(() => xe.Country.getCountry(a.currentCountry.value)), l = te(!1), s = O(() => t.config.isV4 || t.group.type ===
|
|
3352
|
+
const a = pt(), o = ye(), r = O(() => xe.Country.getCountry(a.currentCountry.value)), l = te(!1), s = O(() => t.config.isV4 || t.group.type === Y.F_ADDON_GROUP_TYPE.enum.PRODUCT), u = O(() => s.value), d = O(() => s.value), c = O(() => Object.values(t.group.items).flatMap((z) => [{
|
|
3353
3353
|
_id: z._id,
|
|
3354
3354
|
combinationKey: void 0
|
|
3355
|
-
}, ...(z.items ?? []).filter((E) => E.orderFrom !==
|
|
3355
|
+
}, ...(z.items ?? []).filter((E) => E.orderFrom !== Y.F_ORDER_FROM.enum.NONE).map((E) => ({
|
|
3356
3356
|
_id: E._id,
|
|
3357
3357
|
combinationKey: E.combinationKey
|
|
3358
3358
|
}))])), {
|
|
3359
3359
|
searchKey: m,
|
|
3360
3360
|
filter: p
|
|
3361
|
-
} = Jn(),
|
|
3362
|
-
const z = Object.entries(t.group.items).filter(([, E]) => p([E.code || "", E.name || E.fallbackName, _(E.price ?? E.fallbackPrice),
|
|
3361
|
+
} = Jn(), v = O(() => {
|
|
3362
|
+
const z = Object.entries(t.group.items).filter(([, E]) => p([E.code || "", E.name || E.fallbackName, _(E.price ?? E.fallbackPrice), f(E.orderFrom || E.fallbackOrder), ...(E.items || []).map((W) => [W.code || "", W.name || W.fallbackName, _(W.price ?? W.fallbackPrice), f(W.orderFrom || W.fallbackOrder)].join(""))]));
|
|
3363
3363
|
return Object.fromEntries(z);
|
|
3364
3364
|
}), b = (z) => ({
|
|
3365
3365
|
...t.config,
|
|
@@ -3367,12 +3367,12 @@ const pn = /* @__PURE__ */ me({
|
|
|
3367
3367
|
link: t.config.link(z),
|
|
3368
3368
|
name: t.config.name(z),
|
|
3369
3369
|
orderFrom: t.config.orderFrom(z)
|
|
3370
|
-
}), y = O(() => !0), _ = (z) => z ? rt(z, !1) : "",
|
|
3370
|
+
}), y = O(() => !0), _ = (z) => z ? rt(z, !1) : "", f = (z) => {
|
|
3371
3371
|
var E;
|
|
3372
3372
|
return z == null ? "" : (E = Fn()[z]) == null ? void 0 : E.label;
|
|
3373
|
-
},
|
|
3373
|
+
}, C = O(() => Object.values(v.value)), K = te({}), {
|
|
3374
3374
|
t: U
|
|
3375
|
-
} = he(),
|
|
3375
|
+
} = he(), j = te([{
|
|
3376
3376
|
accessorKey: "isDefault",
|
|
3377
3377
|
header: () => U("menu.group.option.is_default"),
|
|
3378
3378
|
enableSorting: !1,
|
|
@@ -3381,7 +3381,7 @@ const pn = /* @__PURE__ */ me({
|
|
|
3381
3381
|
var q, oe;
|
|
3382
3382
|
if ((oe = (q = z.row.original) == null ? void 0 : q.items) != null && oe.length)
|
|
3383
3383
|
return null;
|
|
3384
|
-
const E = z.row.depth > 0,
|
|
3384
|
+
const E = z.row.depth > 0, W = z.row.original, Z = !b(W.combinationKey).isDefault || W.orderFrom === Y.F_ORDER_FROM.enum.NONE, Q = !!z.getValue();
|
|
3385
3385
|
return g(Ae.FmCheckbox, {
|
|
3386
3386
|
value: "default",
|
|
3387
3387
|
modelValue: Q,
|
|
@@ -3391,9 +3391,9 @@ const pn = /* @__PURE__ */ me({
|
|
|
3391
3391
|
if (E) {
|
|
3392
3392
|
const ze = (ge = z.row.getParentRow()) == null ? void 0 : ge.original;
|
|
3393
3393
|
if (!ze) return;
|
|
3394
|
-
w(ze._id,
|
|
3394
|
+
w(ze._id, W.combinationKey ?? "", "isDefault", ce);
|
|
3395
3395
|
} else
|
|
3396
|
-
I(
|
|
3396
|
+
I(W._id, "isDefault", ce);
|
|
3397
3397
|
}
|
|
3398
3398
|
}, null);
|
|
3399
3399
|
}
|
|
@@ -3419,7 +3419,7 @@ const pn = /* @__PURE__ */ me({
|
|
|
3419
3419
|
header: () => U("menu.group.option.product_title"),
|
|
3420
3420
|
enableSorting: !1,
|
|
3421
3421
|
cell: (z) => {
|
|
3422
|
-
const E = z.getValue(),
|
|
3422
|
+
const E = z.getValue(), W = z.row.original, Z = !b(W.combinationKey).name || W.orderFrom === Y.F_ORDER_FROM.enum.NONE, Q = z.row.depth > 0, q = W.combinationKey ? $i(W.combinationKey, ye().variants) : null;
|
|
3423
3423
|
return Ce("div", Ce(Ae.FmTextField, {
|
|
3424
3424
|
modelValue: E,
|
|
3425
3425
|
placeholder: q ?? "",
|
|
@@ -3430,9 +3430,9 @@ const pn = /* @__PURE__ */ me({
|
|
|
3430
3430
|
if (Q) {
|
|
3431
3431
|
const ge = (ce = z.row.getParentRow()) == null ? void 0 : ce.original;
|
|
3432
3432
|
if (!ge) return;
|
|
3433
|
-
w(ge._id,
|
|
3433
|
+
w(ge._id, W.combinationKey ?? "", "name", oe);
|
|
3434
3434
|
} else
|
|
3435
|
-
I(
|
|
3435
|
+
I(W._id, "name", oe);
|
|
3436
3436
|
},
|
|
3437
3437
|
class: "min-w-[300px]"
|
|
3438
3438
|
}, {
|
|
@@ -3442,7 +3442,7 @@ const pn = /* @__PURE__ */ me({
|
|
|
3442
3442
|
name: "keyboard_arrow_up",
|
|
3443
3443
|
onClick: z.row.getToggleExpandedHandler(),
|
|
3444
3444
|
class: ["cursor-pointer", "transition-transform", z.row.getIsExpanded() ? "transform rotate-180" : ""],
|
|
3445
|
-
color: b(
|
|
3445
|
+
color: b(W.combinationKey).name ? void 0 : je.NeutralGray200
|
|
3446
3446
|
}) : void 0;
|
|
3447
3447
|
}
|
|
3448
3448
|
}));
|
|
@@ -3458,7 +3458,7 @@ const pn = /* @__PURE__ */ me({
|
|
|
3458
3458
|
},
|
|
3459
3459
|
size: 100,
|
|
3460
3460
|
cell: (z) => {
|
|
3461
|
-
const E = z.getValue(),
|
|
3461
|
+
const E = z.getValue(), W = z.row.original, Z = !b(null).priceEdit || W.orderFrom === Y.F_ORDER_FROM.enum.NONE, Q = W.fallbackPrice, q = z.row.depth > 0;
|
|
3462
3462
|
return Ce(tt, {
|
|
3463
3463
|
disable: Z,
|
|
3464
3464
|
placeholder: Q ? rt(Q) : void 0,
|
|
@@ -3473,13 +3473,13 @@ const pn = /* @__PURE__ */ me({
|
|
|
3473
3473
|
if (!ge) return;
|
|
3474
3474
|
w(
|
|
3475
3475
|
ge._id,
|
|
3476
|
-
|
|
3476
|
+
W.combinationKey ?? "",
|
|
3477
3477
|
// @ts-ignore
|
|
3478
3478
|
"price",
|
|
3479
3479
|
oe
|
|
3480
3480
|
);
|
|
3481
3481
|
} else
|
|
3482
|
-
I(
|
|
3482
|
+
I(W._id, "price", oe);
|
|
3483
3483
|
},
|
|
3484
3484
|
showCurrency: !1,
|
|
3485
3485
|
class: "min-w-[88px]"
|
|
@@ -3491,13 +3491,13 @@ const pn = /* @__PURE__ */ me({
|
|
|
3491
3491
|
size: 100,
|
|
3492
3492
|
enableSorting: !1,
|
|
3493
3493
|
cell: (z) => {
|
|
3494
|
-
const E = z.getValue(),
|
|
3494
|
+
const E = z.getValue(), W = z.row.original, Z = W.fallbackOrder, Q = z.row.depth > 0;
|
|
3495
3495
|
return Ce(ii, {
|
|
3496
3496
|
modelValue: E,
|
|
3497
3497
|
fallback: Z,
|
|
3498
|
-
disable: !b(
|
|
3498
|
+
disable: !b(W.combinationKey).orderFrom,
|
|
3499
3499
|
required: !0,
|
|
3500
|
-
editActiveOnly: b(
|
|
3500
|
+
editActiveOnly: b(W.combinationKey).orderFromActiveOnly,
|
|
3501
3501
|
"onUpdate:modelValue": (q) => {
|
|
3502
3502
|
var oe;
|
|
3503
3503
|
if (Q) {
|
|
@@ -3505,13 +3505,13 @@ const pn = /* @__PURE__ */ me({
|
|
|
3505
3505
|
if (!ce) return;
|
|
3506
3506
|
w(
|
|
3507
3507
|
ce._id,
|
|
3508
|
-
|
|
3508
|
+
W.combinationKey ?? "",
|
|
3509
3509
|
// @ts-ignore
|
|
3510
3510
|
"orderFrom",
|
|
3511
3511
|
q
|
|
3512
3512
|
);
|
|
3513
3513
|
} else
|
|
3514
|
-
I(
|
|
3514
|
+
I(W._id, "orderFrom", q);
|
|
3515
3515
|
},
|
|
3516
3516
|
label: "",
|
|
3517
3517
|
menuZIndex: 101
|
|
@@ -3526,12 +3526,12 @@ const pn = /* @__PURE__ */ me({
|
|
|
3526
3526
|
// size: rules.value.inventory && rules.value.link ? 80 : 40,
|
|
3527
3527
|
size: 80,
|
|
3528
3528
|
cell: (z) => {
|
|
3529
|
-
const E = z.row.original,
|
|
3529
|
+
const E = z.row.original, W = E.orderFrom === Y.F_ORDER_FROM.enum.NONE, Z = z.row.depth > 0;
|
|
3530
3530
|
return g("div", {
|
|
3531
3531
|
class: "flex items-center justify-end"
|
|
3532
3532
|
}, [b(null).priceTier && g(hn, {
|
|
3533
3533
|
priceTiers: E.priceTiers,
|
|
3534
|
-
disabled:
|
|
3534
|
+
disabled: W,
|
|
3535
3535
|
"onUpdate:priceTiers": (Q) => {
|
|
3536
3536
|
var q;
|
|
3537
3537
|
if (Z) {
|
|
@@ -3578,7 +3578,7 @@ const pn = /* @__PURE__ */ me({
|
|
|
3578
3578
|
var q;
|
|
3579
3579
|
return [g(N("fm-button"), {
|
|
3580
3580
|
variant: Qe.Tertiary,
|
|
3581
|
-
disabled:
|
|
3581
|
+
disabled: W,
|
|
3582
3582
|
prependIcon: "inventory_2",
|
|
3583
3583
|
overwriteIconOutline: (q = E.inventoryBindings) != null && q.length ? "filled" : "outline",
|
|
3584
3584
|
textColor: je.NeutralGray400,
|
|
@@ -3614,20 +3614,20 @@ const pn = /* @__PURE__ */ me({
|
|
|
3614
3614
|
name: "",
|
|
3615
3615
|
inventoryBindings: [],
|
|
3616
3616
|
price: xe.Dinero.zero().toObject(),
|
|
3617
|
-
isDynamicAddon: t.group.type ===
|
|
3617
|
+
isDynamicAddon: t.group.type === Y.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
|
|
3618
3618
|
items: [],
|
|
3619
|
-
orderFrom:
|
|
3619
|
+
orderFrom: Y.F_ORDER_FROM.enum.ALL
|
|
3620
3620
|
}
|
|
3621
3621
|
}
|
|
3622
3622
|
});
|
|
3623
3623
|
}
|
|
3624
|
-
function I(z, E,
|
|
3624
|
+
function I(z, E, W) {
|
|
3625
3625
|
const Z = t.group.items[z];
|
|
3626
3626
|
if (!Z) return;
|
|
3627
3627
|
const Q = {
|
|
3628
3628
|
...Z
|
|
3629
3629
|
};
|
|
3630
|
-
E === "price" ? Q[E] = !
|
|
3630
|
+
E === "price" ? Q[E] = !W && !Z.fallbackPrice ? xe.Dinero.zero().toObject() : W : Q[E] = W, n("update:group", {
|
|
3631
3631
|
...t.group,
|
|
3632
3632
|
items: {
|
|
3633
3633
|
...t.group.items,
|
|
@@ -3635,14 +3635,14 @@ const pn = /* @__PURE__ */ me({
|
|
|
3635
3635
|
}
|
|
3636
3636
|
});
|
|
3637
3637
|
}
|
|
3638
|
-
function w(z, E,
|
|
3638
|
+
function w(z, E, W, Z) {
|
|
3639
3639
|
var ce, ge;
|
|
3640
3640
|
const Q = ue(t.group), q = (ce = Q.items[z].items) == null ? void 0 : ce.findIndex((ze) => ze.combinationKey === E);
|
|
3641
3641
|
if (!ht.isSet(q)) return;
|
|
3642
3642
|
let oe = (ge = Q.items[z].items) == null ? void 0 : ge[q];
|
|
3643
3643
|
oe && (oe = {
|
|
3644
3644
|
...oe,
|
|
3645
|
-
[
|
|
3645
|
+
[W]: Z
|
|
3646
3646
|
}, Q.items[z].items[q] = oe, n("update:group", Q));
|
|
3647
3647
|
}
|
|
3648
3648
|
function R(z) {
|
|
@@ -3650,21 +3650,21 @@ const pn = /* @__PURE__ */ me({
|
|
|
3650
3650
|
delete E.items[z], n("update:group", E);
|
|
3651
3651
|
}
|
|
3652
3652
|
const S = O(() => t.categorizedItems.flatMap((z) => z.items).reduce((z, E) => {
|
|
3653
|
-
var
|
|
3653
|
+
var W;
|
|
3654
3654
|
return z[E._id] = {
|
|
3655
3655
|
price: E.price,
|
|
3656
|
-
variants: zn(((
|
|
3656
|
+
variants: zn(((W = E.variant) == null ? void 0 : W.variantCombinations) || [], "combinationKey")
|
|
3657
3657
|
}, z;
|
|
3658
|
-
}, {})),
|
|
3658
|
+
}, {})), x = (z) => {
|
|
3659
3659
|
var Q, q;
|
|
3660
|
-
const
|
|
3661
|
-
...(Q =
|
|
3662
|
-
name: Ti(ye().variants, ((q =
|
|
3663
|
-
} :
|
|
3660
|
+
const W = o.state.menu.modules.item.find((oe) => oe._id === z._id), Z = z.combinationKey ? {
|
|
3661
|
+
...(Q = W == null ? void 0 : W.variant) == null ? void 0 : Q.variantCombinations.find((oe) => oe.combinationKey === z.combinationKey),
|
|
3662
|
+
name: Ti(ye().variants, ((q = W == null ? void 0 : W.variant) == null ? void 0 : q.variantGroupIds) || [])[z.combinationKey]
|
|
3663
|
+
} : W;
|
|
3664
3664
|
return Z == null ? void 0 : Z.name;
|
|
3665
3665
|
}, $ = O(() => o.state.menu.modules.item.reduce((z, E) => (z[E._id] = E, z), {}));
|
|
3666
3666
|
function B(z) {
|
|
3667
|
-
const E = [],
|
|
3667
|
+
const E = [], W = new Set(z.filter((Z) => Z.combinationKey).map((Z) => `${Z._id}:${Z.combinationKey}`));
|
|
3668
3668
|
return z.forEach((Z) => {
|
|
3669
3669
|
var oe;
|
|
3670
3670
|
if (Z.combinationKey)
|
|
@@ -3674,44 +3674,44 @@ const pn = /* @__PURE__ */ me({
|
|
|
3674
3674
|
if (!Q || !Q.variant || ((oe = Q.variant.variantCombinations) == null ? void 0 : oe.length) === 0)
|
|
3675
3675
|
return;
|
|
3676
3676
|
(Q.variant.variantCombinations || []).forEach((ce) => {
|
|
3677
|
-
const ge = `${ce._id}:${ce.combinationKey}`, ze = !
|
|
3677
|
+
const ge = `${ce._id}:${ce.combinationKey}`, ze = !W.has(ge);
|
|
3678
3678
|
E.push({
|
|
3679
3679
|
_id: ce._id,
|
|
3680
3680
|
combinationKey: ce.combinationKey,
|
|
3681
|
-
orderFrom: ze ?
|
|
3681
|
+
orderFrom: ze ? Y.F_ORDER_FROM.enum.NONE : Y.F_ORDER_FROM.enum.ALL
|
|
3682
3682
|
});
|
|
3683
3683
|
});
|
|
3684
3684
|
}), E;
|
|
3685
3685
|
}
|
|
3686
|
-
const
|
|
3686
|
+
const k = async (z) => {
|
|
3687
3687
|
let E = qt(t.group);
|
|
3688
|
-
const
|
|
3688
|
+
const W = B(z);
|
|
3689
3689
|
E = {
|
|
3690
3690
|
...E,
|
|
3691
|
-
items:
|
|
3691
|
+
items: W.map((Z) => {
|
|
3692
3692
|
const Q = E.items.find((oe) => oe._id == Z._id && oe.combinationKey == Z.combinationKey);
|
|
3693
3693
|
Z.orderFrom && Q && (Q.orderFrom = Z.orderFrom);
|
|
3694
3694
|
const q = S.value[Z._id];
|
|
3695
3695
|
return Q || {
|
|
3696
3696
|
...Z,
|
|
3697
|
-
name:
|
|
3697
|
+
name: x(Z),
|
|
3698
3698
|
price: Z.combinationKey ? q.variants[Z.combinationKey || ""].price : q.price,
|
|
3699
|
-
orderFrom: Z.orderFrom ??
|
|
3699
|
+
orderFrom: Z.orderFrom ?? Y.F_ORDER_FROM.enum.ALL
|
|
3700
3700
|
};
|
|
3701
3701
|
})
|
|
3702
3702
|
}, n("update:unmap-group", E);
|
|
3703
3703
|
}, F = (z) => z.items;
|
|
3704
3704
|
function T(z) {
|
|
3705
3705
|
const E = ue(t.group);
|
|
3706
|
-
E.items = z.reduce((
|
|
3707
|
-
...
|
|
3706
|
+
E.items = z.reduce((W, Z) => ({
|
|
3707
|
+
...W,
|
|
3708
3708
|
[Z._id]: Z
|
|
3709
3709
|
}), {}), n("update:group", E);
|
|
3710
3710
|
}
|
|
3711
3711
|
const L = Pi(), ae = O(() => L.breakpoints.value.xs);
|
|
3712
3712
|
return (z, E) => {
|
|
3713
|
-
const
|
|
3714
|
-
return A(),
|
|
3713
|
+
const W = N("fm-button"), Z = N("fm-table");
|
|
3714
|
+
return A(), H(Ge, {
|
|
3715
3715
|
title: h(U)("menu.group.option.title"),
|
|
3716
3716
|
"sub-title": z.config.link() && u.value ? h(U)("menu.group.option.subtitle") : ""
|
|
3717
3717
|
}, {
|
|
@@ -3725,11 +3725,11 @@ const pn = /* @__PURE__ */ me({
|
|
|
3725
3725
|
title: h(U)("menu.group.option.link_products"),
|
|
3726
3726
|
onSubmit: E[0] || (E[0] = ({
|
|
3727
3727
|
items: Q
|
|
3728
|
-
}) =>
|
|
3728
|
+
}) => k(Q))
|
|
3729
3729
|
}, {
|
|
3730
3730
|
default: V(({
|
|
3731
3731
|
trigger: Q
|
|
3732
|
-
}) => [g(
|
|
3732
|
+
}) => [g(W, {
|
|
3733
3733
|
"text-color": h(je).ColorPrimary,
|
|
3734
3734
|
"border-color": h(je).ColorPrimary,
|
|
3735
3735
|
variant: "secondary",
|
|
@@ -3738,7 +3738,7 @@ const pn = /* @__PURE__ */ me({
|
|
|
3738
3738
|
onClick: Q
|
|
3739
3739
|
}, null, 8, ["text-color", "border-color", "label", "onClick"])]),
|
|
3740
3740
|
_: 1
|
|
3741
|
-
}, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (A(), ne("div", pr, [g(
|
|
3741
|
+
}, 8, ["categorized-items", "initial-value", "show-variant", "title"])])) : (A(), ne("div", pr, [g(W, {
|
|
3742
3742
|
"text-color": h(je).ColorPrimary,
|
|
3743
3743
|
"border-color": h(je).ColorPrimary,
|
|
3744
3744
|
variant: "secondary",
|
|
@@ -3747,17 +3747,17 @@ const pn = /* @__PURE__ */ me({
|
|
|
3747
3747
|
onClick: D
|
|
3748
3748
|
}, null, 8, ["text-color", "border-color", "label"])]))], 64)) : ie("", !0)]),
|
|
3749
3749
|
default: V(() => [P("div", hr, [P("div", fr, [g(Z, {
|
|
3750
|
-
"column-defs":
|
|
3750
|
+
"column-defs": j.value,
|
|
3751
3751
|
"column-visibility": M.value,
|
|
3752
3752
|
draggable: !ae.value && b(null).name,
|
|
3753
|
-
"expanded-state": l.value ? {} :
|
|
3753
|
+
"expanded-state": l.value ? {} : K.value,
|
|
3754
3754
|
"get-sub-row": F,
|
|
3755
3755
|
"page-size": 999,
|
|
3756
|
-
"row-data":
|
|
3756
|
+
"row-data": C.value,
|
|
3757
3757
|
"search-value": h(m),
|
|
3758
3758
|
"shrink-at": !1,
|
|
3759
3759
|
"hide-footer": "",
|
|
3760
|
-
"onUpdate:expandedState": E[1] || (E[1] = (Q) =>
|
|
3760
|
+
"onUpdate:expandedState": E[1] || (E[1] = (Q) => K.value = Q),
|
|
3761
3761
|
onDndChanged: E[2] || (E[2] = (Q) => T(Q)),
|
|
3762
3762
|
"onUpdate:dragging": E[3] || (E[3] = (Q) => l.value = Q)
|
|
3763
3763
|
}, null, 8, ["column-defs", "column-visibility", "draggable", "expanded-state", "row-data", "search-value"])])])]),
|
|
@@ -3780,9 +3780,9 @@ function gr(e) {
|
|
|
3780
3780
|
function n(r) {
|
|
3781
3781
|
let l = 0;
|
|
3782
3782
|
for (const s of Object.values(r.items)) {
|
|
3783
|
-
s.orderFrom !==
|
|
3783
|
+
s.orderFrom !== Y.F_ORDER_FROM.enum.NONE && l++;
|
|
3784
3784
|
for (const u of s.items ?? [])
|
|
3785
|
-
u.orderFrom !==
|
|
3785
|
+
u.orderFrom !== Y.F_ORDER_FROM.enum.NONE && l++;
|
|
3786
3786
|
}
|
|
3787
3787
|
return l;
|
|
3788
3788
|
}
|
|
@@ -3843,31 +3843,31 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
3843
3843
|
let n = e;
|
|
3844
3844
|
const a = t, o = ye(), r = pt(), l = Le(), s = De(), u = Ze(qe(s)), { countDefaultItems: d, validateGroupItems: c, minMaxValidationRules: m } = gr(
|
|
3845
3845
|
() => n.group
|
|
3846
|
-
), p = te(!1),
|
|
3847
|
-
ht.isBoolean(
|
|
3848
|
-
}, y = O(() => n.group ? n.config(n.group) : null), _ = O(() => Wi(y.value)),
|
|
3846
|
+
), p = te(!1), v = te(!1), b = (k) => {
|
|
3847
|
+
ht.isBoolean(k) ? v.value = k : v.value = !v.value;
|
|
3848
|
+
}, y = O(() => n.group ? n.config(n.group) : null), _ = O(() => Wi(y.value)), f = (k) => _.value.includes(k), C = O(() => [
|
|
3849
3849
|
{
|
|
3850
3850
|
label: "Normal",
|
|
3851
|
-
value:
|
|
3851
|
+
value: Y.F_ADDON_GROUP_TYPE.enum.NORMAL
|
|
3852
3852
|
},
|
|
3853
3853
|
{
|
|
3854
3854
|
label: "Product",
|
|
3855
|
-
value:
|
|
3855
|
+
value: Y.F_ADDON_GROUP_TYPE.enum.PRODUCT
|
|
3856
3856
|
},
|
|
3857
3857
|
{
|
|
3858
3858
|
label: "Dynamic",
|
|
3859
|
-
value:
|
|
3859
|
+
value: Y.F_ADDON_GROUP_TYPE.enum.DYNAMIC
|
|
3860
3860
|
}
|
|
3861
3861
|
]);
|
|
3862
|
-
function
|
|
3863
|
-
a("update:group",
|
|
3862
|
+
function K(k) {
|
|
3863
|
+
a("update:group", k);
|
|
3864
3864
|
}
|
|
3865
|
-
function U(
|
|
3865
|
+
function U(k) {
|
|
3866
3866
|
function F() {
|
|
3867
|
-
|
|
3867
|
+
K({
|
|
3868
3868
|
...n.group,
|
|
3869
3869
|
items: {},
|
|
3870
|
-
type:
|
|
3870
|
+
type: k
|
|
3871
3871
|
});
|
|
3872
3872
|
}
|
|
3873
3873
|
Object.keys(n.group.items).length > 0 ? l.open({
|
|
@@ -3883,28 +3883,28 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
3883
3883
|
}
|
|
3884
3884
|
}).onPrimary(F) : F();
|
|
3885
3885
|
}
|
|
3886
|
-
function
|
|
3886
|
+
function j(k) {
|
|
3887
3887
|
return new ji(o, u.updateMenu, l).mapGroups(
|
|
3888
|
-
[
|
|
3888
|
+
[k],
|
|
3889
3889
|
y.value.isOverride
|
|
3890
3890
|
)[0];
|
|
3891
3891
|
}
|
|
3892
3892
|
const M = te($e.clone(n.group)), D = Xt(
|
|
3893
3893
|
() => !$e.isEqual(n.group, M.value),
|
|
3894
3894
|
() => {
|
|
3895
|
-
|
|
3895
|
+
v.value = !1;
|
|
3896
3896
|
}
|
|
3897
3897
|
), I = O(() => n.action === "add" ? B("common.add") : B("common.update"));
|
|
3898
3898
|
async function w() {
|
|
3899
|
-
var
|
|
3899
|
+
var k;
|
|
3900
3900
|
if (n.action === "add") {
|
|
3901
3901
|
const { group: F, linkItems: T } = Ki(n.group), L = {
|
|
3902
|
-
module:
|
|
3902
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.group,
|
|
3903
3903
|
operation: ke.F_OPERATION_TYPE.create,
|
|
3904
3904
|
data: F,
|
|
3905
3905
|
link: [
|
|
3906
3906
|
{
|
|
3907
|
-
module:
|
|
3907
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.item,
|
|
3908
3908
|
id: "",
|
|
3909
3909
|
data: T
|
|
3910
3910
|
}
|
|
@@ -3912,7 +3912,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
3912
3912
|
};
|
|
3913
3913
|
await u.updateMenu(L, F.name), a("submit:group", n.group);
|
|
3914
3914
|
} else if (n.action === "update") {
|
|
3915
|
-
for (const F of Object.values(((
|
|
3915
|
+
for (const F of Object.values(((k = n.group) == null ? void 0 : k.items) ?? {}))
|
|
3916
3916
|
if (Gn(o.state.menu, n.group._id, F._id)) {
|
|
3917
3917
|
s.open({
|
|
3918
3918
|
type: "error",
|
|
@@ -3928,45 +3928,45 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
3928
3928
|
b(!1);
|
|
3929
3929
|
}
|
|
3930
3930
|
Re(
|
|
3931
|
-
() =>
|
|
3932
|
-
async (
|
|
3933
|
-
a("status:show",
|
|
3931
|
+
() => v.value,
|
|
3932
|
+
async (k) => {
|
|
3933
|
+
a("status:show", k), k && (await Ei(), M.value = $e.clone(n.group));
|
|
3934
3934
|
}
|
|
3935
3935
|
);
|
|
3936
3936
|
const R = O(() => {
|
|
3937
|
-
var
|
|
3938
|
-
return ((
|
|
3937
|
+
var k;
|
|
3938
|
+
return ((k = r.groupAttributeSettings) == null ? void 0 : k.value.length) > 0 && !y.value.isOverride;
|
|
3939
3939
|
}), S = O(() => {
|
|
3940
|
-
const
|
|
3940
|
+
const k = {};
|
|
3941
3941
|
return o.state.menu.modules.group.forEach((F) => {
|
|
3942
3942
|
var T;
|
|
3943
3943
|
for (const [L, ae] of Object.entries(F.customAttributes || {}))
|
|
3944
|
-
typeof ae == "string" && ae && !((T =
|
|
3945
|
-
}),
|
|
3946
|
-
}),
|
|
3947
|
-
n.group &&
|
|
3944
|
+
typeof ae == "string" && ae && !((T = k[L]) != null && T.includes(ae)) && (k[L] = [...k[L] || [], ae]);
|
|
3945
|
+
}), k;
|
|
3946
|
+
}), x = (k) => {
|
|
3947
|
+
n.group && K({
|
|
3948
3948
|
...n.group,
|
|
3949
|
-
customAttributes:
|
|
3949
|
+
customAttributes: k
|
|
3950
3950
|
});
|
|
3951
3951
|
}, $ = O(() => [
|
|
3952
3952
|
// Required validation
|
|
3953
|
-
(
|
|
3953
|
+
(k) => !!k || B("menu.common.validation.required", { field: B("menu.common.labels.group_name") }),
|
|
3954
3954
|
// Duplicate name validation
|
|
3955
|
-
(
|
|
3955
|
+
(k) => n.action === "add" ? !o.groups.find((T) => T.name === k) || B("menu.group.validation.name_duplicate") : n.action === "update" ? !o.groups.find((T) => T.name === k && T._id !== n.group._id) || B("menu.group.validation.name_duplicate") : !0
|
|
3956
3956
|
]);
|
|
3957
3957
|
i({
|
|
3958
3958
|
trigger: b,
|
|
3959
|
-
show:
|
|
3959
|
+
show: v
|
|
3960
3960
|
});
|
|
3961
3961
|
const { t: B } = he();
|
|
3962
|
-
return (
|
|
3963
|
-
const T = N("fm-text-field"), L = N("fm-stepper-field"), ae = N("FmFormGroup"), z = N("fm-radio"), E = N("fm-radio-group"),
|
|
3962
|
+
return (k, F) => {
|
|
3963
|
+
const T = N("fm-text-field"), L = N("fm-stepper-field"), ae = N("FmFormGroup"), z = N("fm-radio"), E = N("fm-radio-group"), W = N("fm-switch"), Z = N("fm-button"), Q = N("fm-side-sheet");
|
|
3964
3964
|
return A(), ne(Me, null, [
|
|
3965
|
-
ve(
|
|
3965
|
+
ve(k.$slots, "default", { trigger: b }),
|
|
3966
3966
|
g(Q, {
|
|
3967
3967
|
id: "group-form",
|
|
3968
|
-
modelValue:
|
|
3969
|
-
"onUpdate:modelValue": F[8] || (F[8] = (q) =>
|
|
3968
|
+
modelValue: v.value,
|
|
3969
|
+
"onUpdate:modelValue": F[8] || (F[8] = (q) => v.value = q),
|
|
3970
3970
|
"is-container": h(Ae).FmForm,
|
|
3971
3971
|
"is-container-props": {
|
|
3972
3972
|
onValidationSuccess: w,
|
|
@@ -3976,7 +3976,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
3976
3976
|
"onOn:clickedAway": h(D)
|
|
3977
3977
|
}, {
|
|
3978
3978
|
"side-sheet-header": V(() => [
|
|
3979
|
-
P("p", br, de(
|
|
3979
|
+
P("p", br, de(k.title), 1)
|
|
3980
3980
|
]),
|
|
3981
3981
|
"side-sheet-footer": V(() => [
|
|
3982
3982
|
P("div", _r, [
|
|
@@ -3991,45 +3991,45 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
3991
3991
|
label: h(B)("menu.common.actions.cancel"),
|
|
3992
3992
|
size: "lg",
|
|
3993
3993
|
variant: "tertiary",
|
|
3994
|
-
onClick: F[7] || (F[7] = () =>
|
|
3994
|
+
onClick: F[7] || (F[7] = () => v.value = !1)
|
|
3995
3995
|
}, null, 8, ["label"])
|
|
3996
3996
|
])
|
|
3997
3997
|
]),
|
|
3998
3998
|
default: V(() => [
|
|
3999
|
-
|
|
4000
|
-
ve(
|
|
3999
|
+
k.group ? (A(), ne("div", yr, [
|
|
4000
|
+
ve(k.$slots, "variant-section"),
|
|
4001
4001
|
g($n, null, {
|
|
4002
4002
|
default: V(() => [
|
|
4003
4003
|
P("div", null, [
|
|
4004
4004
|
g(T, {
|
|
4005
|
-
modelValue:
|
|
4006
|
-
"onUpdate:modelValue": F[0] || (F[0] = (q) =>
|
|
4007
|
-
disabled:
|
|
4005
|
+
modelValue: k.group.name,
|
|
4006
|
+
"onUpdate:modelValue": F[0] || (F[0] = (q) => k.group.name = q),
|
|
4007
|
+
disabled: f("name"),
|
|
4008
4008
|
rules: $.value,
|
|
4009
4009
|
autofocus: "",
|
|
4010
4010
|
label: h(B)("menu.common.labels.group_name")
|
|
4011
4011
|
}, null, 8, ["modelValue", "disabled", "rules", "label"])
|
|
4012
4012
|
]),
|
|
4013
4013
|
g(ae, {
|
|
4014
|
-
"model-value":
|
|
4014
|
+
"model-value": k.group.min + " " + k.group.max,
|
|
4015
4015
|
rules: h(m)
|
|
4016
4016
|
}, {
|
|
4017
4017
|
default: V(() => [
|
|
4018
4018
|
g(ir, null, {
|
|
4019
4019
|
default: V(() => [
|
|
4020
4020
|
g(L, {
|
|
4021
|
-
modelValue:
|
|
4022
|
-
"onUpdate:modelValue": F[1] || (F[1] = (q) =>
|
|
4023
|
-
disabled:
|
|
4021
|
+
modelValue: k.group.min,
|
|
4022
|
+
"onUpdate:modelValue": F[1] || (F[1] = (q) => k.group.min = q),
|
|
4023
|
+
disabled: f("min"),
|
|
4024
4024
|
min: 0,
|
|
4025
4025
|
class: "flex-1",
|
|
4026
4026
|
label: h(B)("menu.common.labels.min_select")
|
|
4027
4027
|
}, null, 8, ["modelValue", "disabled", "label"]),
|
|
4028
4028
|
g(L, {
|
|
4029
|
-
modelValue:
|
|
4030
|
-
"onUpdate:modelValue": F[2] || (F[2] = (q) =>
|
|
4031
|
-
disabled:
|
|
4032
|
-
min:
|
|
4029
|
+
modelValue: k.group.max,
|
|
4030
|
+
"onUpdate:modelValue": F[2] || (F[2] = (q) => k.group.max = q),
|
|
4031
|
+
disabled: f("max"),
|
|
4032
|
+
min: k.group.min,
|
|
4033
4033
|
class: "flex-1",
|
|
4034
4034
|
label: h(B)("menu.common.labels.max_select")
|
|
4035
4035
|
}, null, 8, ["modelValue", "disabled", "min", "label"])
|
|
@@ -4039,18 +4039,18 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4039
4039
|
]),
|
|
4040
4040
|
_: 1
|
|
4041
4041
|
}, 8, ["model-value", "rules"]),
|
|
4042
|
-
y.value.type ? (A(),
|
|
4042
|
+
y.value.type ? (A(), H(He, {
|
|
4043
4043
|
key: 0,
|
|
4044
4044
|
label: h(B)("menu.common.labels.group_type")
|
|
4045
4045
|
}, {
|
|
4046
4046
|
default: V(() => [
|
|
4047
4047
|
g(E, {
|
|
4048
|
-
disabled:
|
|
4049
|
-
"model-value":
|
|
4048
|
+
disabled: f("type"),
|
|
4049
|
+
"model-value": k.group.type,
|
|
4050
4050
|
"onUpdate:modelValue": F[3] || (F[3] = (q) => U(q))
|
|
4051
4051
|
}, {
|
|
4052
4052
|
default: V(() => [
|
|
4053
|
-
(A(!0), ne(Me, null, Ne(
|
|
4053
|
+
(A(!0), ne(Me, null, Ne(C.value, (q) => (A(), H(z, {
|
|
4054
4054
|
key: q.value,
|
|
4055
4055
|
label: h(B)(`menu.group.types.${q.label.toLowerCase()}`),
|
|
4056
4056
|
value: q.value
|
|
@@ -4065,10 +4065,10 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4065
4065
|
label: h(B)("menu.common.labels.configuration")
|
|
4066
4066
|
}, {
|
|
4067
4067
|
default: V(() => [
|
|
4068
|
-
g(
|
|
4069
|
-
modelValue:
|
|
4070
|
-
"onUpdate:modelValue": F[4] || (F[4] = (q) =>
|
|
4071
|
-
disabled:
|
|
4068
|
+
g(W, {
|
|
4069
|
+
modelValue: k.group.stackable,
|
|
4070
|
+
"onUpdate:modelValue": F[4] || (F[4] = (q) => k.group.stackable = q),
|
|
4071
|
+
disabled: f("stackable"),
|
|
4072
4072
|
label: h(B)("menu.common.labels.stackable"),
|
|
4073
4073
|
"label-placement": "right",
|
|
4074
4074
|
sublabel: h(B)("menu.common.labels.stackable_sublabel")
|
|
@@ -4076,7 +4076,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4076
4076
|
]),
|
|
4077
4077
|
_: 1
|
|
4078
4078
|
}, 8, ["label"]),
|
|
4079
|
-
R.value ? (A(),
|
|
4079
|
+
R.value ? (A(), H(Ge, {
|
|
4080
4080
|
key: 1,
|
|
4081
4081
|
title: h(B)("menu.group.form.tagging.title"),
|
|
4082
4082
|
"sub-title": h(B)("menu.group.form.tagging.subtitle")
|
|
@@ -4084,8 +4084,8 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4084
4084
|
default: V(() => [
|
|
4085
4085
|
g(h(Di), {
|
|
4086
4086
|
entity: "group",
|
|
4087
|
-
"model-value":
|
|
4088
|
-
"onUpdate:modelValue":
|
|
4087
|
+
"model-value": k.group.customAttributes || {},
|
|
4088
|
+
"onUpdate:modelValue": x,
|
|
4089
4089
|
"value-options": S.value
|
|
4090
4090
|
}, null, 8, ["model-value", "value-options"])
|
|
4091
4091
|
]),
|
|
@@ -4096,21 +4096,21 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4096
4096
|
}),
|
|
4097
4097
|
g(ae, {
|
|
4098
4098
|
tag: "div",
|
|
4099
|
-
modelValue:
|
|
4099
|
+
modelValue: k.group,
|
|
4100
4100
|
rules: [h(c)],
|
|
4101
4101
|
"helper-text": h(B)("menu.common.validation.default_items_tip", {
|
|
4102
|
-
count: h(d)(
|
|
4103
|
-
max:
|
|
4102
|
+
count: h(d)(k.group),
|
|
4103
|
+
max: k.group.max
|
|
4104
4104
|
})
|
|
4105
4105
|
}, {
|
|
4106
4106
|
default: V(() => [
|
|
4107
4107
|
g(vr, {
|
|
4108
|
-
"allow-refund-inventory":
|
|
4109
|
-
"categorized-items":
|
|
4108
|
+
"allow-refund-inventory": k.allowRefundInventory ?? !1,
|
|
4109
|
+
"categorized-items": k.categorizedItems,
|
|
4110
4110
|
config: y.value,
|
|
4111
|
-
group:
|
|
4112
|
-
"onUpdate:group": F[5] || (F[5] = (q) =>
|
|
4113
|
-
"onUpdate:unmapGroup": F[6] || (F[6] = (q) =>
|
|
4111
|
+
group: k.group,
|
|
4112
|
+
"onUpdate:group": F[5] || (F[5] = (q) => K(q)),
|
|
4113
|
+
"onUpdate:unmapGroup": F[6] || (F[6] = (q) => K(j(q)))
|
|
4114
4114
|
}, null, 8, ["allow-refund-inventory", "categorized-items", "config", "group"])
|
|
4115
4115
|
]),
|
|
4116
4116
|
_: 1
|
|
@@ -4131,30 +4131,30 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4131
4131
|
},
|
|
4132
4132
|
emits: ["update:combinations"],
|
|
4133
4133
|
setup(e, { expose: i, emit: t }) {
|
|
4134
|
-
var
|
|
4134
|
+
var K, U;
|
|
4135
4135
|
const n = e, a = t, o = ye(), r = Le(), l = Ze(qe(De())), s = te([]), u = te(n.combinations[0].combinationKey || ""), d = O(
|
|
4136
|
-
() => s.value.findIndex((
|
|
4136
|
+
() => s.value.findIndex((j) => j.combinationKey == u.value)
|
|
4137
4137
|
), c = O(
|
|
4138
|
-
() => n.combinations.map((
|
|
4139
|
-
label: n.fullCombinations[
|
|
4140
|
-
value:
|
|
4138
|
+
() => n.combinations.map((j) => ({
|
|
4139
|
+
label: n.fullCombinations[j.combinationKey || ""],
|
|
4140
|
+
value: j.combinationKey || ""
|
|
4141
4141
|
}))
|
|
4142
4142
|
), m = O(() => {
|
|
4143
4143
|
var R, S;
|
|
4144
4144
|
if (!_.value) return null;
|
|
4145
|
-
const
|
|
4145
|
+
const j = ((S = (R = s.value[d.value]) == null ? void 0 : R.groups) == null ? void 0 : S.find((x) => x._id === n.groupId)) || {
|
|
4146
4146
|
_id: n.groupId,
|
|
4147
4147
|
groupKey: ""
|
|
4148
|
-
}, D = o.state.menu.modules.group.find((
|
|
4148
|
+
}, D = o.state.menu.modules.group.find((x) => x._id === n.groupId), I = Object.entries({ ...j, items: void 0 }).filter(([, x]) => !!x), w = {
|
|
4149
4149
|
...D,
|
|
4150
4150
|
...Object.fromEntries(I),
|
|
4151
|
-
items: D.items.map((
|
|
4151
|
+
items: D.items.map((x) => {
|
|
4152
4152
|
var B;
|
|
4153
|
-
const $ = (B =
|
|
4154
|
-
(
|
|
4153
|
+
const $ = (B = j.items) == null ? void 0 : B.find(
|
|
4154
|
+
(k) => k._id == x._id && k.combinationKey == x.combinationKey
|
|
4155
4155
|
);
|
|
4156
4156
|
return {
|
|
4157
|
-
...
|
|
4157
|
+
...x,
|
|
4158
4158
|
...$ ?? {},
|
|
4159
4159
|
price: ($ == null ? void 0 : $.price) || null,
|
|
4160
4160
|
priceTiers: ($ == null ? void 0 : $.priceTiers) || null,
|
|
@@ -4164,24 +4164,24 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4164
4164
|
};
|
|
4165
4165
|
return new ji(o, l.updateMenu, r).mapGroups([w], !0)[0];
|
|
4166
4166
|
});
|
|
4167
|
-
function p(
|
|
4167
|
+
function p(j) {
|
|
4168
4168
|
var w, R;
|
|
4169
4169
|
const M = (w = s.value[d.value].groups) == null ? void 0 : w.findIndex(
|
|
4170
4170
|
(S) => S._id === n.groupId
|
|
4171
|
-
), D = ue(s.value), I = { ...qt(
|
|
4171
|
+
), D = ue(s.value), I = { ...qt(j), _id: n.groupId, groupKey: "" };
|
|
4172
4172
|
(M ?? -1) < 0 ? D[d.value] = {
|
|
4173
4173
|
...D[d.value],
|
|
4174
4174
|
groups: [...((R = D[d.value]) == null ? void 0 : R.groups) || [], I]
|
|
4175
4175
|
} : D[d.value].groups[M] = I, s.value = D;
|
|
4176
4176
|
}
|
|
4177
|
-
function
|
|
4177
|
+
function v(j) {
|
|
4178
4178
|
const M = c.value.length;
|
|
4179
4179
|
let D = d.value;
|
|
4180
|
-
|
|
4180
|
+
j === "left" ? D = D === 0 ? M - 1 : D - 1 : D = D === M - 1 ? 0 : D + 1, u.value = c.value[D].value;
|
|
4181
4181
|
}
|
|
4182
|
-
function b(
|
|
4182
|
+
function b(j) {
|
|
4183
4183
|
return {
|
|
4184
|
-
isV4: o.version ===
|
|
4184
|
+
isV4: o.version === Y.F_MENU_VERSION.enum.v4,
|
|
4185
4185
|
isDefault: (M) => !1,
|
|
4186
4186
|
link: (M) => !1,
|
|
4187
4187
|
orderFrom: (M) => !0,
|
|
@@ -4199,7 +4199,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4199
4199
|
};
|
|
4200
4200
|
}
|
|
4201
4201
|
function y() {
|
|
4202
|
-
const
|
|
4202
|
+
const j = s.value.map((M) => {
|
|
4203
4203
|
var D;
|
|
4204
4204
|
return {
|
|
4205
4205
|
...M,
|
|
@@ -4208,47 +4208,47 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4208
4208
|
}))
|
|
4209
4209
|
};
|
|
4210
4210
|
});
|
|
4211
|
-
a("update:combinations",
|
|
4211
|
+
a("update:combinations", j);
|
|
4212
4212
|
}
|
|
4213
4213
|
const _ = te(!1);
|
|
4214
4214
|
Re(
|
|
4215
4215
|
() => _.value,
|
|
4216
|
-
(
|
|
4217
|
-
|
|
4216
|
+
(j) => {
|
|
4217
|
+
j && (s.value = ue(n.combinations), u.value = n.combinations[0].combinationKey || "");
|
|
4218
4218
|
}
|
|
4219
4219
|
);
|
|
4220
|
-
const
|
|
4220
|
+
const f = te();
|
|
4221
4221
|
i({
|
|
4222
|
-
show: (
|
|
4223
|
-
trigger: (U =
|
|
4222
|
+
show: (K = f.value) == null ? void 0 : K.show,
|
|
4223
|
+
trigger: (U = f.value) == null ? void 0 : U.trigger
|
|
4224
4224
|
});
|
|
4225
|
-
const { t:
|
|
4226
|
-
return (
|
|
4225
|
+
const { t: C } = he();
|
|
4226
|
+
return (j, M) => {
|
|
4227
4227
|
const D = N("fm-select"), I = N("fm-button"), w = N("fm-card");
|
|
4228
|
-
return A(),
|
|
4228
|
+
return A(), H(fn, {
|
|
4229
4229
|
ref_key: "baseFormRef",
|
|
4230
|
-
ref:
|
|
4230
|
+
ref: f,
|
|
4231
4231
|
"allow-refund-inventory": !0,
|
|
4232
4232
|
"categorized-items": h(o).categorizedItems,
|
|
4233
4233
|
config: b,
|
|
4234
4234
|
group: m.value,
|
|
4235
4235
|
action: "update",
|
|
4236
|
-
title: h(
|
|
4236
|
+
title: h(C)("menu.group.update"),
|
|
4237
4237
|
"onUpdate:group": M[3] || (M[3] = (R) => p(R)),
|
|
4238
4238
|
"onSubmit:group": M[4] || (M[4] = (R) => y()),
|
|
4239
4239
|
"onStatus:show": M[5] || (M[5] = (R) => _.value = R)
|
|
4240
4240
|
}, {
|
|
4241
4241
|
default: V(({ trigger: R }) => [
|
|
4242
|
-
ve(
|
|
4242
|
+
ve(j.$slots, "default", { trigger: R })
|
|
4243
4243
|
]),
|
|
4244
4244
|
"variant-section": V(() => [
|
|
4245
|
-
u.value ? (A(),
|
|
4245
|
+
u.value ? (A(), H(w, {
|
|
4246
4246
|
key: 0,
|
|
4247
4247
|
class: "p-16 bg-fm-color-neutral-gray-100 space-y-24",
|
|
4248
4248
|
variant: "outlined"
|
|
4249
4249
|
}, {
|
|
4250
4250
|
default: V(() => [
|
|
4251
|
-
P("p", wr, de(h(
|
|
4251
|
+
P("p", wr, de(h(C)("menu.group.option.variant")), 1),
|
|
4252
4252
|
P("div", Sr, [
|
|
4253
4253
|
g(D, {
|
|
4254
4254
|
modelValue: u.value,
|
|
@@ -4261,13 +4261,13 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4261
4261
|
variant: h(Qe).Tertiary,
|
|
4262
4262
|
"prepend-icon": "keyboard_arrow_left",
|
|
4263
4263
|
size: "lg",
|
|
4264
|
-
onClick: M[1] || (M[1] = (R) =>
|
|
4264
|
+
onClick: M[1] || (M[1] = (R) => v("left"))
|
|
4265
4265
|
}, null, 8, ["variant"]),
|
|
4266
4266
|
g(I, {
|
|
4267
4267
|
variant: h(Qe).Tertiary,
|
|
4268
4268
|
"prepend-icon": "keyboard_arrow_right",
|
|
4269
4269
|
size: "lg",
|
|
4270
|
-
onClick: M[2] || (M[2] = (R) =>
|
|
4270
|
+
onClick: M[2] || (M[2] = (R) => v("right"))
|
|
4271
4271
|
}, null, 8, ["variant"])
|
|
4272
4272
|
])
|
|
4273
4273
|
])
|
|
@@ -4293,57 +4293,57 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4293
4293
|
setup(e) {
|
|
4294
4294
|
const i = e, t = Le(), { emitData: n, emitAction: a } = Vi(), o = ye(), r = O(() => o.rules.group), l = O(() => o.groups);
|
|
4295
4295
|
function s(y) {
|
|
4296
|
-
return ue(y ?? []).sort((
|
|
4296
|
+
return ue(y ?? []).sort((f, C) => f.position - C.position);
|
|
4297
4297
|
}
|
|
4298
4298
|
const u = O(() => s(l.value).reduce((y, _) => (y[_._id] = {
|
|
4299
4299
|
name: _.name,
|
|
4300
4300
|
type: xt(o.items, _.items)
|
|
4301
4301
|
}, y), {})), d = O(() => [
|
|
4302
|
-
...Object.entries(u.value).map(([y, { name: _, type:
|
|
4303
|
-
label: `${_} ${r.value.type ? `(${$t(
|
|
4302
|
+
...Object.entries(u.value).map(([y, { name: _, type: f }]) => ({
|
|
4303
|
+
label: `${_} ${r.value.type ? `(${$t(f)})` : ""}`.trim(),
|
|
4304
4304
|
value: y
|
|
4305
4305
|
}))
|
|
4306
4306
|
]), c = O(() => !!o.state.currentCatalogId || !!o.state.currentSchedulerId);
|
|
4307
4307
|
O(() => {
|
|
4308
|
-
const y = !o.state.currentSchedulerId, _ = o.rules.group.type,
|
|
4309
|
-
return function(
|
|
4308
|
+
const y = !o.state.currentSchedulerId, _ = o.rules.group.type, f = o.version == Y.F_MENU_VERSION.enum.v3, C = o.rules.item.orderFromActiveOnly, K = o.rules.item.bindToVariant;
|
|
4309
|
+
return function(j) {
|
|
4310
4310
|
return {
|
|
4311
4311
|
isDefault: (M) => !c.value && !M,
|
|
4312
|
-
link: (M) => !c.value && (!M ||
|
|
4312
|
+
link: (M) => !c.value && (!M || K),
|
|
4313
4313
|
name: (M) => !c.value && !M,
|
|
4314
|
-
type: _ && !
|
|
4315
|
-
price:
|
|
4314
|
+
type: _ && !j._id && !c.value,
|
|
4315
|
+
price: j.type != Y.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
|
|
4316
4316
|
priceEdit: !0,
|
|
4317
4317
|
priceTier: o.isV4,
|
|
4318
|
-
inventory: y ?
|
|
4319
|
-
orderFrom: (M) => y ?
|
|
4320
|
-
orderFromActiveOnly:
|
|
4321
|
-
showOrderFrom: y ?
|
|
4322
|
-
bindToVariant:
|
|
4318
|
+
inventory: y ? f ? !c.value && j.type == Y.F_ADDON_GROUP_TYPE.enum.NORMAL : !c.value : !1,
|
|
4319
|
+
orderFrom: (M) => y ? f ? j.type == Y.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? c.value : !!c.value == !M : c.value : !1,
|
|
4320
|
+
orderFromActiveOnly: C,
|
|
4321
|
+
showOrderFrom: y ? f ? c.value ? !0 : j.type == Y.F_ADDON_GROUP_TYPE.enum.PRODUCT : c.value : !1,
|
|
4322
|
+
bindToVariant: K,
|
|
4323
4323
|
isOverride: c.value,
|
|
4324
4324
|
isItemGroup: !1,
|
|
4325
|
-
isV4: !
|
|
4325
|
+
isV4: !f
|
|
4326
4326
|
};
|
|
4327
4327
|
};
|
|
4328
4328
|
}), O(() => ({
|
|
4329
4329
|
...Te.generator.initMenuV4Group(),
|
|
4330
|
-
type: o.version ===
|
|
4330
|
+
type: o.version === Y.F_MENU_VERSION.enum.v4 ? Y.F_ADDON_GROUP_TYPE.enum.PRODUCT : Y.F_ADDON_GROUP_TYPE.enum.NORMAL,
|
|
4331
4331
|
items: {},
|
|
4332
4332
|
position: o.groups.length - 1,
|
|
4333
4333
|
itemsLinked: []
|
|
4334
4334
|
}));
|
|
4335
|
-
const m = te(ue(i.groupIds || [])), p = te(""), { t:
|
|
4335
|
+
const m = te(ue(i.groupIds || [])), p = te(""), { t: v } = he(), b = () => {
|
|
4336
4336
|
n(m.value), a("primary"), t.close();
|
|
4337
4337
|
};
|
|
4338
4338
|
return (y, _) => {
|
|
4339
|
-
const
|
|
4339
|
+
const f = N("FmSearch"), C = N("FmCheckbox"), K = N("FmButton");
|
|
4340
4340
|
return d.value.length > 0 ? (A(), ne("div", Ar, [
|
|
4341
4341
|
P("div", null, [
|
|
4342
|
-
g(
|
|
4342
|
+
g(f, {
|
|
4343
4343
|
autofocus: "",
|
|
4344
4344
|
modelValue: p.value,
|
|
4345
4345
|
"onUpdate:modelValue": _[0] || (_[0] = (U) => p.value = U),
|
|
4346
|
-
placeholder: h(
|
|
4346
|
+
placeholder: h(v)("menu.common.labels.search_groups")
|
|
4347
4347
|
}, null, 8, ["modelValue", "placeholder"])
|
|
4348
4348
|
]),
|
|
4349
4349
|
P("div", Mr, [
|
|
@@ -4351,11 +4351,11 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4351
4351
|
(A(!0), ne(Me, null, Ne(d.value, (U) => (A(), ne("div", {
|
|
4352
4352
|
key: U.value
|
|
4353
4353
|
}, [
|
|
4354
|
-
ct(g(
|
|
4354
|
+
ct(g(C, {
|
|
4355
4355
|
modelValue: m.value,
|
|
4356
4356
|
"onUpdate:modelValue": [
|
|
4357
|
-
_[1] || (_[1] = (
|
|
4358
|
-
_[2] || (_[2] = (
|
|
4357
|
+
_[1] || (_[1] = (j) => m.value = j),
|
|
4358
|
+
_[2] || (_[2] = (j) => h(n)(m.value))
|
|
4359
4359
|
],
|
|
4360
4360
|
label: U.label,
|
|
4361
4361
|
value: U.value
|
|
@@ -4368,38 +4368,38 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4368
4368
|
P("div", Or, [
|
|
4369
4369
|
g(h(Mi), null, {
|
|
4370
4370
|
default: V(({ trigger: U }) => [
|
|
4371
|
-
g(
|
|
4372
|
-
label: h(
|
|
4371
|
+
g(K, {
|
|
4372
|
+
label: h(v)("menu.common.actions.add_group"),
|
|
4373
4373
|
variant: "tertiary",
|
|
4374
4374
|
"text-color": "primary",
|
|
4375
|
-
onClick: (
|
|
4375
|
+
onClick: (j) => U()
|
|
4376
4376
|
}, null, 8, ["label", "onClick"])
|
|
4377
4377
|
]),
|
|
4378
4378
|
_: 1
|
|
4379
4379
|
}),
|
|
4380
4380
|
P("div", Fr, [
|
|
4381
|
-
g(
|
|
4382
|
-
label: h(
|
|
4381
|
+
g(K, {
|
|
4382
|
+
label: h(v)("menu.common.actions.cancel"),
|
|
4383
4383
|
variant: "tertiary",
|
|
4384
4384
|
onClick: _[3] || (_[3] = (U) => h(t).close())
|
|
4385
4385
|
}, null, 8, ["label"]),
|
|
4386
|
-
g(
|
|
4387
|
-
label: h(
|
|
4386
|
+
g(K, {
|
|
4387
|
+
label: h(v)("menu.common.actions.confirm"),
|
|
4388
4388
|
onClick: _[4] || (_[4] = (U) => b())
|
|
4389
4389
|
}, null, 8, ["label"])
|
|
4390
4390
|
])
|
|
4391
4391
|
])
|
|
4392
4392
|
])) : (A(), ne("div", zr, [
|
|
4393
4393
|
P("div", Ir, [
|
|
4394
|
-
P("p", Er, de(h(
|
|
4395
|
-
P("p", Tr, de(h(
|
|
4394
|
+
P("p", Er, de(h(v)("menu.common.empty.no_group.title")), 1),
|
|
4395
|
+
P("p", Tr, de(h(v)("menu.common.empty.no_group.subtitle")), 1)
|
|
4396
4396
|
]),
|
|
4397
4397
|
g(h(Mi), null, {
|
|
4398
4398
|
default: V(({ trigger: U }) => [
|
|
4399
|
-
g(
|
|
4400
|
-
label: h(
|
|
4399
|
+
g(K, {
|
|
4400
|
+
label: h(v)("menu.common.actions.add_group"),
|
|
4401
4401
|
icon: "add",
|
|
4402
|
-
onClick: (
|
|
4402
|
+
onClick: (j) => U()
|
|
4403
4403
|
}, null, 8, ["label", "onClick"])
|
|
4404
4404
|
]),
|
|
4405
4405
|
_: 1
|
|
@@ -4427,60 +4427,60 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4427
4427
|
const t = e, n = De(), a = ye(), o = ni(), r = Le(), {
|
|
4428
4428
|
t: l
|
|
4429
4429
|
} = he(), s = i, u = O(() => a.rules.group), d = O(() => a.rules.item), c = O(() => a.groups);
|
|
4430
|
-
function m(S,
|
|
4431
|
-
return ue(
|
|
4432
|
-
const
|
|
4430
|
+
function m(S, x) {
|
|
4431
|
+
return ue(x ?? []).map((B) => {
|
|
4432
|
+
const k = S.find((F) => F._id === B._id);
|
|
4433
4433
|
return {
|
|
4434
|
-
name: (
|
|
4434
|
+
name: (k == null ? void 0 : k.name) ?? "",
|
|
4435
4435
|
...B,
|
|
4436
|
-
position:
|
|
4436
|
+
position: k == null ? void 0 : k.position
|
|
4437
4437
|
};
|
|
4438
4438
|
});
|
|
4439
4439
|
}
|
|
4440
4440
|
const p = O(() => {
|
|
4441
|
-
var
|
|
4442
|
-
return [...
|
|
4441
|
+
var x;
|
|
4442
|
+
return [...v(m(c.value, t.form.groups || ((x = t.fallback) == null ? void 0 : x.groups) || [])).map(($) => $._id)];
|
|
4443
4443
|
});
|
|
4444
|
-
function
|
|
4444
|
+
function v(S) {
|
|
4445
4445
|
return ue(S ?? []).sort(($, B) => $.position - B.position);
|
|
4446
4446
|
}
|
|
4447
4447
|
function b(S) {
|
|
4448
|
-
const
|
|
4449
|
-
if (!
|
|
4448
|
+
const x = c.value.find((k) => k._id === S);
|
|
4449
|
+
if (!x)
|
|
4450
4450
|
return [];
|
|
4451
4451
|
const $ = [];
|
|
4452
|
-
return
|
|
4453
|
-
if (
|
|
4452
|
+
return x.items.forEach((k) => {
|
|
4453
|
+
if (k.combinationKey)
|
|
4454
4454
|
return;
|
|
4455
|
-
const F = a.items.find((L) => L._id ===
|
|
4455
|
+
const F = a.items.find((L) => L._id === k._id), T = x.items.filter((L) => L._id === k._id && L.combinationKey).length;
|
|
4456
4456
|
$.push({
|
|
4457
|
-
code:
|
|
4458
|
-
name:
|
|
4457
|
+
code: k.code || (F == null ? void 0 : F.code),
|
|
4458
|
+
name: k.name || (F == null ? void 0 : F.name),
|
|
4459
4459
|
variantCount: T
|
|
4460
4460
|
});
|
|
4461
|
-
}), $.map((
|
|
4462
|
-
const F = [(
|
|
4463
|
-
return (
|
|
4464
|
-
count:
|
|
4461
|
+
}), $.map((k) => {
|
|
4462
|
+
const F = [(k == null ? void 0 : k.code) || "", (k == null ? void 0 : k.name) || ""].join(" ").trim();
|
|
4463
|
+
return (k.variantCount || 0) > 1 ? `${F} (${l("menu.group.list.variants", {
|
|
4464
|
+
count: k.variantCount
|
|
4465
4465
|
})})` : F;
|
|
4466
4466
|
});
|
|
4467
4467
|
}
|
|
4468
|
-
const y = O(() =>
|
|
4469
|
-
name:
|
|
4470
|
-
type: xt(a.items,
|
|
4468
|
+
const y = O(() => v(c.value).reduce((S, x) => (S[x._id] = {
|
|
4469
|
+
name: x.name,
|
|
4470
|
+
type: xt(a.items, x.items)
|
|
4471
4471
|
}, S), {})), _ = O(() => [...Object.entries(y.value).map(([S, {
|
|
4472
|
-
name:
|
|
4472
|
+
name: x,
|
|
4473
4473
|
type: $
|
|
4474
4474
|
}]) => ({
|
|
4475
|
-
label: `${
|
|
4475
|
+
label: `${x} ${u.value.type ? `(${$t($)})` : ""}`.trim(),
|
|
4476
4476
|
value: S
|
|
4477
|
-
}))]),
|
|
4477
|
+
}))]), f = O(() => [{
|
|
4478
4478
|
accessorKey: "name",
|
|
4479
4479
|
header: () => l("menu.product.form.group.columns.title"),
|
|
4480
4480
|
enableSorting: !1,
|
|
4481
4481
|
cell: (S) => {
|
|
4482
|
-
const
|
|
4483
|
-
return w(
|
|
4482
|
+
const x = S.row.original._id;
|
|
4483
|
+
return w(x);
|
|
4484
4484
|
}
|
|
4485
4485
|
}, {
|
|
4486
4486
|
id: "type",
|
|
@@ -4489,8 +4489,8 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4489
4489
|
enableSorting: !1,
|
|
4490
4490
|
cell: (S) => {
|
|
4491
4491
|
var $;
|
|
4492
|
-
const
|
|
4493
|
-
return $t(($ = y.value[
|
|
4492
|
+
const x = S.row.original._id;
|
|
4493
|
+
return $t(($ = y.value[x]) == null ? void 0 : $.type);
|
|
4494
4494
|
}
|
|
4495
4495
|
}, {
|
|
4496
4496
|
accessorKey: "items",
|
|
@@ -4498,7 +4498,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4498
4498
|
enableSorting: !1,
|
|
4499
4499
|
size: 200,
|
|
4500
4500
|
cell: (S) => {
|
|
4501
|
-
const
|
|
4501
|
+
const x = S.row.original._id, B = b(x).join(", ");
|
|
4502
4502
|
return g(Ae.FmTooltip, {
|
|
4503
4503
|
"z-index": 51,
|
|
4504
4504
|
class: "flex",
|
|
@@ -4523,7 +4523,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4523
4523
|
size: 52,
|
|
4524
4524
|
enableSorting: !1,
|
|
4525
4525
|
cell: (S) => {
|
|
4526
|
-
const
|
|
4526
|
+
const x = S.row.original._id;
|
|
4527
4527
|
return Ce("div", {
|
|
4528
4528
|
class: "flex justify-end"
|
|
4529
4529
|
}, [Ce(Ae.FmButton, {
|
|
@@ -4531,14 +4531,14 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4531
4531
|
variant: "tertiary",
|
|
4532
4532
|
textColor: "neutral-gray-400",
|
|
4533
4533
|
onClick: kt(async () => {
|
|
4534
|
-
|
|
4534
|
+
j(x);
|
|
4535
4535
|
}, ["stop", "prevent"])
|
|
4536
4536
|
}), Ce(Rr, {
|
|
4537
4537
|
// variant items
|
|
4538
4538
|
combinations: D.value ?? [],
|
|
4539
4539
|
// combinationKey: varaintName
|
|
4540
4540
|
fullCombinations: t.fullCombinations,
|
|
4541
|
-
groupId:
|
|
4541
|
+
groupId: x,
|
|
4542
4542
|
"onUpdate:combinations": R
|
|
4543
4543
|
}, {
|
|
4544
4544
|
default: ({
|
|
@@ -4546,16 +4546,16 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4546
4546
|
}) => Ce(Ae.FmButton, {
|
|
4547
4547
|
icon: "edit",
|
|
4548
4548
|
variant: "tertiary",
|
|
4549
|
-
disabled: !I(
|
|
4549
|
+
disabled: !I(x),
|
|
4550
4550
|
textColor: "neutral-gray-400",
|
|
4551
4551
|
onClick: $
|
|
4552
4552
|
})
|
|
4553
4553
|
})]);
|
|
4554
4554
|
}
|
|
4555
|
-
}]),
|
|
4556
|
-
type: a.version !==
|
|
4555
|
+
}]), C = O(() => ({
|
|
4556
|
+
type: a.version !== Y.F_MENU_VERSION.enum.v4
|
|
4557
4557
|
}));
|
|
4558
|
-
function
|
|
4558
|
+
function K() {
|
|
4559
4559
|
r.open({
|
|
4560
4560
|
title: l("menu.product.form.group.add"),
|
|
4561
4561
|
contentComponent: Dr,
|
|
@@ -4563,10 +4563,10 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4563
4563
|
groupIds: p.value
|
|
4564
4564
|
}
|
|
4565
4565
|
}).onPrimary((S) => {
|
|
4566
|
-
var
|
|
4566
|
+
var x;
|
|
4567
4567
|
for (const $ of S)
|
|
4568
4568
|
if (Kn(a.state.menu, $, t.form._id)) {
|
|
4569
|
-
const B = (
|
|
4569
|
+
const B = (x = y.value[$]) == null ? void 0 : x.name;
|
|
4570
4570
|
n.open({
|
|
4571
4571
|
type: "error",
|
|
4572
4572
|
message: l("menu.product.form.group.circularError", {
|
|
@@ -4580,30 +4580,30 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4580
4580
|
});
|
|
4581
4581
|
}
|
|
4582
4582
|
function U(S) {
|
|
4583
|
-
const
|
|
4583
|
+
const x = S.reduce(($, B) => {
|
|
4584
4584
|
var F;
|
|
4585
|
-
const
|
|
4585
|
+
const k = ((F = t.form.groups) == null ? void 0 : F.find((T) => T._id === B)) || {
|
|
4586
4586
|
_id: B,
|
|
4587
4587
|
groupKey: ""
|
|
4588
4588
|
};
|
|
4589
|
-
return $.push(
|
|
4589
|
+
return $.push(k), $;
|
|
4590
4590
|
}, []);
|
|
4591
4591
|
s("replace:form", o.initDynamicGroupItem({
|
|
4592
4592
|
...t.form,
|
|
4593
|
-
groups:
|
|
4593
|
+
groups: x
|
|
4594
4594
|
}));
|
|
4595
4595
|
}
|
|
4596
|
-
function
|
|
4597
|
-
var $, B,
|
|
4596
|
+
function j(S) {
|
|
4597
|
+
var $, B, k;
|
|
4598
4598
|
if (!t.form.groups)
|
|
4599
4599
|
return;
|
|
4600
|
-
const
|
|
4601
|
-
|
|
4600
|
+
const x = ue(t.form.groups);
|
|
4601
|
+
x.splice(x.findIndex((F) => F._id === S), 1);
|
|
4602
4602
|
for (const F of (($ = t.form.variant) == null ? void 0 : $.variantCombinations) || [])
|
|
4603
|
-
(
|
|
4603
|
+
(k = F.groups) == null || k.splice((B = F.groups) == null ? void 0 : B.findIndex((T) => T._id === S), 1);
|
|
4604
4604
|
s("replace:form", o.initDynamicGroupItem({
|
|
4605
4605
|
...t.form,
|
|
4606
|
-
groups:
|
|
4606
|
+
groups: x
|
|
4607
4607
|
}));
|
|
4608
4608
|
}
|
|
4609
4609
|
const M = O(() => {
|
|
@@ -4622,11 +4622,11 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4622
4622
|
if (!S) return !1;
|
|
4623
4623
|
if (d.value.overrideProductGroup) return !0;
|
|
4624
4624
|
switch (($ = y.value[S]) == null ? void 0 : $.type) {
|
|
4625
|
-
case
|
|
4625
|
+
case Y.F_ADDON_GROUP_TYPE.enum.DYNAMIC:
|
|
4626
4626
|
return !0;
|
|
4627
|
-
case
|
|
4627
|
+
case Y.F_ADDON_GROUP_TYPE.enum.PRODUCT:
|
|
4628
4628
|
return d.value.overrideProductGroup;
|
|
4629
|
-
case
|
|
4629
|
+
case Y.F_ADDON_GROUP_TYPE.enum.NORMAL:
|
|
4630
4630
|
return !1;
|
|
4631
4631
|
default:
|
|
4632
4632
|
return !1;
|
|
@@ -4634,18 +4634,18 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4634
4634
|
}
|
|
4635
4635
|
Re(() => c.value.length, () => U([...p.value, c.value[c.value.length - 1]._id]));
|
|
4636
4636
|
const w = (S) => {
|
|
4637
|
-
var
|
|
4638
|
-
return (
|
|
4637
|
+
var x;
|
|
4638
|
+
return (x = _.value.find(($) => $.value === S)) == null ? void 0 : x.label;
|
|
4639
4639
|
}, R = (S) => {
|
|
4640
|
-
var
|
|
4640
|
+
var x;
|
|
4641
4641
|
M.value ? s("update:form", "variant", {
|
|
4642
|
-
variantGroupIds: ((
|
|
4642
|
+
variantGroupIds: ((x = t.form.variant) == null ? void 0 : x.variantGroupIds) || [],
|
|
4643
4643
|
variantCombinations: S
|
|
4644
4644
|
}) : s("update:form", "groups", S[0].groups || []);
|
|
4645
4645
|
};
|
|
4646
|
-
return (S,
|
|
4646
|
+
return (S, x) => {
|
|
4647
4647
|
const $ = N("FmButton"), B = N("FmTable");
|
|
4648
|
-
return A(),
|
|
4648
|
+
return A(), H(Ge, {
|
|
4649
4649
|
title: h(l)("menu.product.form.group.title"),
|
|
4650
4650
|
"sub-title": h(l)("menu.product.form.group.subtitle")
|
|
4651
4651
|
}, {
|
|
@@ -4654,15 +4654,15 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4654
4654
|
label: h(l)("menu.product.form.group.add"),
|
|
4655
4655
|
"prepend-icon": "add",
|
|
4656
4656
|
variant: "secondary",
|
|
4657
|
-
onClick:
|
|
4657
|
+
onClick: K
|
|
4658
4658
|
}, null, 8, ["label"])]),
|
|
4659
4659
|
default: V(() => [g(mn, null, {
|
|
4660
4660
|
default: V(() => {
|
|
4661
|
-
var
|
|
4662
|
-
return [((
|
|
4661
|
+
var k;
|
|
4662
|
+
return [((k = p.value) == null ? void 0 : k.length) > 0 ? (A(), H(B, {
|
|
4663
4663
|
key: 0,
|
|
4664
|
-
"column-defs":
|
|
4665
|
-
"column-visibility":
|
|
4664
|
+
"column-defs": f.value,
|
|
4665
|
+
"column-visibility": C.value,
|
|
4666
4666
|
"row-data": p.value.map((F) => ({
|
|
4667
4667
|
_id: F
|
|
4668
4668
|
})),
|
|
@@ -4702,15 +4702,15 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4702
4702
|
const {
|
|
4703
4703
|
t
|
|
4704
4704
|
} = he(), n = e, a = i, o = ye(), r = O(() => o.rules.item), l = O(() => r.value.inventory);
|
|
4705
|
-
function s(b, y, _,
|
|
4705
|
+
function s(b, y, _, f) {
|
|
4706
4706
|
return !y || y && y.length === 0 ? [{
|
|
4707
4707
|
_id: "",
|
|
4708
4708
|
name: _ || "",
|
|
4709
4709
|
binding: b || []
|
|
4710
|
-
}] : y.map((
|
|
4711
|
-
_id:
|
|
4712
|
-
name: $i(
|
|
4713
|
-
binding:
|
|
4710
|
+
}] : y.map((C) => ({
|
|
4711
|
+
_id: C.combinationKey || "",
|
|
4712
|
+
name: $i(C.combinationKey || "", f),
|
|
4713
|
+
binding: C.inventoryBindings || []
|
|
4714
4714
|
}));
|
|
4715
4715
|
}
|
|
4716
4716
|
const u = O(() => {
|
|
@@ -4721,14 +4721,14 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4721
4721
|
return s(n.form.inventoryBindings || [], ((b = n.form.variant) == null ? void 0 : b.variantCombinations) || [], u.value, o.variants);
|
|
4722
4722
|
});
|
|
4723
4723
|
function c(b, y) {
|
|
4724
|
-
var
|
|
4724
|
+
var K, U;
|
|
4725
4725
|
let _ = $e.clone(n.form);
|
|
4726
|
-
const
|
|
4727
|
-
if ((((
|
|
4728
|
-
const
|
|
4729
|
-
if (
|
|
4730
|
-
const M = $e.clone(
|
|
4731
|
-
M[
|
|
4726
|
+
const f = _.variant;
|
|
4727
|
+
if ((((K = f == null ? void 0 : f.variantCombinations) == null ? void 0 : K.length) ?? 0) > 0 && f) {
|
|
4728
|
+
const j = f.variantCombinations.findIndex((D) => D.combinationKey === b);
|
|
4729
|
+
if (j < 0) return;
|
|
4730
|
+
const M = $e.clone(f.variantCombinations);
|
|
4731
|
+
M[j].inventoryBindings = y, _ = {
|
|
4732
4732
|
..._,
|
|
4733
4733
|
variant: {
|
|
4734
4734
|
variantGroupIds: ((U = _.variant) == null ? void 0 : U.variantGroupIds) || [],
|
|
@@ -4802,14 +4802,14 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4802
4802
|
for (const y of m.value)
|
|
4803
4803
|
y.getKey() === b && y.trigger(!0);
|
|
4804
4804
|
}
|
|
4805
|
-
const
|
|
4805
|
+
const v = Bi();
|
|
4806
4806
|
return at(() => {
|
|
4807
|
-
|
|
4808
|
-
}), (b, y) => (A(),
|
|
4807
|
+
v.readInventory();
|
|
4808
|
+
}), (b, y) => (A(), H(Ge, {
|
|
4809
4809
|
title: h(t)("menu.inventory.title"),
|
|
4810
4810
|
subTitle: h(t)("menu.inventory.subtitle")
|
|
4811
4811
|
}, {
|
|
4812
|
-
default: V(() => [P("div", Vr, [P("div", Ur, [(A(!0), ne(Me, null, Ne(d.value, (_) => (A(),
|
|
4812
|
+
default: V(() => [P("div", Vr, [P("div", Ur, [(A(!0), ne(Me, null, Ne(d.value, (_) => (A(), H(h(Yt), {
|
|
4813
4813
|
key: _._id,
|
|
4814
4814
|
ref_for: !0,
|
|
4815
4815
|
ref_key: "inventoryManagerForms",
|
|
@@ -4820,8 +4820,8 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4820
4820
|
name: _.name || "",
|
|
4821
4821
|
bindingKey: _._id,
|
|
4822
4822
|
initialValue: _.binding ?? [],
|
|
4823
|
-
"onUpdate:inventory": (
|
|
4824
|
-
c(_._id,
|
|
4823
|
+
"onUpdate:inventory": (f) => {
|
|
4824
|
+
c(_._id, f);
|
|
4825
4825
|
}
|
|
4826
4826
|
}, null, 8, ["title", "name", "bindingKey", "initialValue", "onUpdate:inventory"]))), 128)), g(h(Zn), {
|
|
4827
4827
|
"row-data": d.value,
|
|
@@ -4855,62 +4855,62 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4855
4855
|
emits: ["update:form"],
|
|
4856
4856
|
setup(e, { emit: i }) {
|
|
4857
4857
|
const t = e, n = pt(), a = ye(), o = Li(), { t: r } = he(), l = i, s = O(() => a.rules.item), u = O(() => {
|
|
4858
|
-
var
|
|
4859
|
-
const
|
|
4860
|
-
return
|
|
4861
|
-
}), d = (
|
|
4862
|
-
l("update:form", "unit",
|
|
4858
|
+
var K, U;
|
|
4859
|
+
const f = t.isOverride ? ((K = t.fallback) == null ? void 0 : K.unit) ?? ((U = t.fallback) == null ? void 0 : U.perXUnit) : void 0, C = t.form.unit ?? t.form.perXUnit ?? f;
|
|
4860
|
+
return C != null;
|
|
4861
|
+
}), d = (f) => {
|
|
4862
|
+
l("update:form", "unit", f ? "" : void 0), l("update:form", "perXUnit", f ? 0 : void 0);
|
|
4863
4863
|
}, c = O(() => {
|
|
4864
|
-
const
|
|
4865
|
-
return Ft.setCoreStore(n).taxSetting(
|
|
4864
|
+
const f = a.isV4;
|
|
4865
|
+
return Ft.setCoreStore(n).taxSetting(f);
|
|
4866
4866
|
}), m = O(() => {
|
|
4867
|
-
var
|
|
4867
|
+
var f;
|
|
4868
4868
|
return Ft.getSelectedTax(
|
|
4869
4869
|
t.form.taxes,
|
|
4870
|
-
(
|
|
4870
|
+
(f = t.fallback) == null ? void 0 : f.taxes,
|
|
4871
4871
|
c.value.countryTaxOptions
|
|
4872
4872
|
);
|
|
4873
4873
|
});
|
|
4874
|
-
function p(
|
|
4875
|
-
const
|
|
4876
|
-
if (!
|
|
4877
|
-
l("update:form", "perXUnit", parseFloat(
|
|
4874
|
+
function p(f) {
|
|
4875
|
+
const C = f.replace(/[^0-9.]/g, "");
|
|
4876
|
+
if (!f) return !1;
|
|
4877
|
+
l("update:form", "perXUnit", parseFloat(C));
|
|
4878
4878
|
}
|
|
4879
|
-
function f
|
|
4880
|
-
if (!
|
|
4881
|
-
const [
|
|
4882
|
-
if (
|
|
4883
|
-
const
|
|
4884
|
-
l("update:form", "perXUnit", parseFloat(
|
|
4879
|
+
function v(f) {
|
|
4880
|
+
if (!f && t.form.perXUnit) {
|
|
4881
|
+
const [C, K] = t.form.perXUnit.toString().split(".");
|
|
4882
|
+
if (K && K.length > 4) {
|
|
4883
|
+
const j = (typeof t.form.perXUnit == "string" ? parseFloat(t.form.perXUnit) : t.form.perXUnit).toFixed(4);
|
|
4884
|
+
l("update:form", "perXUnit", parseFloat(j));
|
|
4885
4885
|
}
|
|
4886
4886
|
}
|
|
4887
4887
|
}
|
|
4888
4888
|
const b = Ht();
|
|
4889
|
-
ti("apply-pricing", (
|
|
4890
|
-
l("update:form", "price", xe.Dinero.fromNumber({ number:
|
|
4889
|
+
ti("apply-pricing", (f) => {
|
|
4890
|
+
l("update:form", "price", xe.Dinero.fromNumber({ number: f }).toObject());
|
|
4891
4891
|
});
|
|
4892
4892
|
async function y() {
|
|
4893
|
-
const
|
|
4894
|
-
if (!
|
|
4895
|
-
const
|
|
4896
|
-
if (
|
|
4897
|
-
|
|
4893
|
+
const f = t.form.name || "";
|
|
4894
|
+
if (!f) {
|
|
4895
|
+
const C = document.getElementById("product-name");
|
|
4896
|
+
if (C) {
|
|
4897
|
+
C.focus();
|
|
4898
4898
|
return;
|
|
4899
4899
|
} else
|
|
4900
4900
|
return;
|
|
4901
4901
|
}
|
|
4902
4902
|
n.pushDataLayer({ event: "menu_catalog_item_price_remy_suggest_pricing" }), b.activate({
|
|
4903
|
-
prompt: `Suggest a price for ${
|
|
4903
|
+
prompt: `Suggest a price for ${f}`,
|
|
4904
4904
|
command: "suggestPrice"
|
|
4905
4905
|
});
|
|
4906
4906
|
}
|
|
4907
4907
|
const _ = O(() => {
|
|
4908
|
-
var
|
|
4909
|
-
return ((
|
|
4908
|
+
var f, C;
|
|
4909
|
+
return ((f = a.currentCatalog) == null ? void 0 : f.priceTierRules) ?? ((C = a.currentCatalog) == null ? void 0 : C.usePriceTiers) ?? [];
|
|
4910
4910
|
});
|
|
4911
|
-
return (
|
|
4912
|
-
const
|
|
4913
|
-
return A(),
|
|
4911
|
+
return (f, C) => {
|
|
4912
|
+
const K = N("fm-select"), U = N("FmButton"), j = N("fm-checkbox"), M = N("fm-text-field"), D = zi("tooltip");
|
|
4913
|
+
return A(), H(Ge, {
|
|
4914
4914
|
title: h(r)("menu.product.form.price.title")
|
|
4915
4915
|
}, {
|
|
4916
4916
|
default: V(() => {
|
|
@@ -4920,15 +4920,15 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4920
4920
|
g(tt, {
|
|
4921
4921
|
disable: _.value.length > 0 && h(a).currentCatalog && !h(a).currentScheduler,
|
|
4922
4922
|
min: 0,
|
|
4923
|
-
"model-value":
|
|
4924
|
-
placeholder: (I =
|
|
4923
|
+
"model-value": f.form.price || null,
|
|
4924
|
+
placeholder: (I = f.fallback) != null && I.price ? h(rt)(f.fallback.price, !1) : void 0,
|
|
4925
4925
|
rules: [
|
|
4926
4926
|
s.value.price ? (w) => !!w || h(r)("menu.product.form.price.fields.selling_price.required") : void 0
|
|
4927
4927
|
].filter(h(ht).isSet),
|
|
4928
4928
|
class: "w-[258px] xs:w-full",
|
|
4929
4929
|
label: h(r)("menu.product.form.price.fields.selling_price.label"),
|
|
4930
4930
|
"show-currency": "",
|
|
4931
|
-
"onUpdate:modelValue":
|
|
4931
|
+
"onUpdate:modelValue": C[0] || (C[0] = (w) => w && l("update:form", "price", w))
|
|
4932
4932
|
}, {
|
|
4933
4933
|
append: V(() => [
|
|
4934
4934
|
ct(g(h(Ni), {
|
|
@@ -4941,7 +4941,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4941
4941
|
]),
|
|
4942
4942
|
_: 1
|
|
4943
4943
|
}, 8, ["disable", "model-value", "placeholder", "rules", "label"]),
|
|
4944
|
-
g(
|
|
4944
|
+
g(K, {
|
|
4945
4945
|
disabled: !s.value.tax || !c.value.systemCode,
|
|
4946
4946
|
items: c.value.countryTaxOptions,
|
|
4947
4947
|
label: c.value.systemCode ? h(r)("menu.product.form.price.fields.tax.label_with_code", {
|
|
@@ -4951,10 +4951,10 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4951
4951
|
placeholder: "--",
|
|
4952
4952
|
class: "flex-1",
|
|
4953
4953
|
"shift-menu": "",
|
|
4954
|
-
"onUpdate:modelValue":
|
|
4954
|
+
"onUpdate:modelValue": C[1] || (C[1] = (w) => l("update:form", "taxes", [h(Ft).decodeTax(w)]))
|
|
4955
4955
|
}, null, 8, ["disabled", "items", "label", "model-value"])
|
|
4956
4956
|
]),
|
|
4957
|
-
!
|
|
4957
|
+
!f.isOverride && h(a).isV4 ? (A(), H(He, {
|
|
4958
4958
|
key: 0,
|
|
4959
4959
|
label: h(r)("menu.price_tier.price_group"),
|
|
4960
4960
|
description: h(r)("menu.price_tier.description")
|
|
@@ -4970,12 +4970,12 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4970
4970
|
default: V(() => {
|
|
4971
4971
|
var w;
|
|
4972
4972
|
return [
|
|
4973
|
-
|
|
4973
|
+
f.isOverride ? ie("", !0) : (A(), H(pn, {
|
|
4974
4974
|
key: 0,
|
|
4975
4975
|
"price-tiers": h(o).priceTiers.value,
|
|
4976
|
-
"model-value":
|
|
4976
|
+
"model-value": f.form.priceTiers || ((w = f.fallback) == null ? void 0 : w.priceTiers) || {},
|
|
4977
4977
|
"allow-negative-price": !1,
|
|
4978
|
-
"onUpdate:modelValue":
|
|
4978
|
+
"onUpdate:modelValue": C[2] || (C[2] = (R) => l("update:form", "priceTiers", R))
|
|
4979
4979
|
}, null, 8, ["price-tiers", "model-value"]))
|
|
4980
4980
|
];
|
|
4981
4981
|
}),
|
|
@@ -4988,17 +4988,17 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
4988
4988
|
var w, R, S;
|
|
4989
4989
|
return [
|
|
4990
4990
|
P("div", Br, [
|
|
4991
|
-
g(
|
|
4992
|
-
disabled: !s.value.openPrice ||
|
|
4993
|
-
"model-value":
|
|
4994
|
-
value:
|
|
4991
|
+
g(j, {
|
|
4992
|
+
disabled: !s.value.openPrice || f.isAddon,
|
|
4993
|
+
"model-value": f.form.openPrice ?? ((w = f.fallback) == null ? void 0 : w.openPrice) ?? !1,
|
|
4994
|
+
value: f.form.openPrice,
|
|
4995
4995
|
label: h(r)("menu.product.form.price.settings.open_price.label"),
|
|
4996
4996
|
sublabel: h(r)("menu.product.form.price.settings.open_price.sublabel"),
|
|
4997
|
-
"onUpdate:modelValue":
|
|
4997
|
+
"onUpdate:modelValue": C[3] || (C[3] = (x) => l("update:form", "openPrice", x))
|
|
4998
4998
|
}, null, 8, ["disabled", "model-value", "value", "label", "sublabel"]),
|
|
4999
4999
|
P("div", Lr, [
|
|
5000
|
-
g(
|
|
5001
|
-
disabled: !s.value.unit ||
|
|
5000
|
+
g(j, {
|
|
5001
|
+
disabled: !s.value.unit || f.isAddon,
|
|
5002
5002
|
"model-value": u.value,
|
|
5003
5003
|
value: u.value,
|
|
5004
5004
|
label: h(r)("menu.product.form.price.settings.sell_by_unit.label"),
|
|
@@ -5010,69 +5010,69 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5010
5010
|
P("div", jr, [
|
|
5011
5011
|
g(M, {
|
|
5012
5012
|
disabled: !s.value.unit,
|
|
5013
|
-
"model-value":
|
|
5013
|
+
"model-value": f.form.perXUnit || ((R = f.fallback) == null ? void 0 : R.perXUnit) || null,
|
|
5014
5014
|
rules: [
|
|
5015
|
-
(
|
|
5016
|
-
(
|
|
5015
|
+
(x) => !!x || h(r)("menu.product.form.price.settings.sell_by_unit.per_unit.required"),
|
|
5016
|
+
(x) => !x || x > 0 || h(r)("menu.product.form.price.settings.sell_by_unit.per_unit.min")
|
|
5017
5017
|
],
|
|
5018
5018
|
inputmode: "numeric",
|
|
5019
5019
|
placeholder: h(r)("menu.product.form.price.settings.sell_by_unit.per_unit.placeholder"),
|
|
5020
5020
|
type: "number",
|
|
5021
|
-
onFocusChanged:
|
|
5021
|
+
onFocusChanged: v,
|
|
5022
5022
|
"onUpdate:modelValue": p
|
|
5023
5023
|
}, null, 8, ["disabled", "model-value", "rules", "placeholder"])
|
|
5024
5024
|
]),
|
|
5025
5025
|
P("div", Wr, [
|
|
5026
5026
|
g(M, {
|
|
5027
5027
|
disabled: !s.value.unit,
|
|
5028
|
-
"model-value":
|
|
5028
|
+
"model-value": f.form.unit || ((S = f.fallback) == null ? void 0 : S.unit) || null,
|
|
5029
5029
|
rules: [
|
|
5030
|
-
(
|
|
5030
|
+
(x) => !!x || h(r)("menu.product.form.price.settings.sell_by_unit.unit.required")
|
|
5031
5031
|
],
|
|
5032
5032
|
placeholder: h(r)("menu.product.form.price.settings.sell_by_unit.unit.placeholder"),
|
|
5033
|
-
"onUpdate:modelValue":
|
|
5033
|
+
"onUpdate:modelValue": C[4] || (C[4] = (x) => l("update:form", "unit", x))
|
|
5034
5034
|
}, null, 8, ["disabled", "model-value", "rules", "placeholder"])
|
|
5035
5035
|
])
|
|
5036
5036
|
])) : ie("", !0)
|
|
5037
5037
|
]),
|
|
5038
5038
|
s.value.costing ? (A(), ne("div", Yr, [
|
|
5039
|
-
g(
|
|
5040
|
-
"model-value": !!
|
|
5041
|
-
value: !!
|
|
5039
|
+
g(j, {
|
|
5040
|
+
"model-value": !!f.form.costing,
|
|
5041
|
+
value: !!f.form.costing,
|
|
5042
5042
|
label: h(r)("menu.product.form.price.settings.track_costing.label"),
|
|
5043
|
-
"onUpdate:modelValue":
|
|
5043
|
+
"onUpdate:modelValue": C[5] || (C[5] = (x) => l("update:form", "costing", x ? h(xe.Dinero).zero().toObject() : void 0))
|
|
5044
5044
|
}, null, 8, ["model-value", "value", "label"]),
|
|
5045
|
-
|
|
5045
|
+
f.form.costing ? (A(), ne("div", Hr, [
|
|
5046
5046
|
P("div", Xr, [
|
|
5047
5047
|
g(tt, {
|
|
5048
5048
|
class: "w-full",
|
|
5049
5049
|
min: 0,
|
|
5050
|
-
"model-value":
|
|
5050
|
+
"model-value": f.form.costing || null,
|
|
5051
5051
|
nullable: "",
|
|
5052
5052
|
"show-currency": "",
|
|
5053
|
-
"onUpdate:modelValue":
|
|
5053
|
+
"onUpdate:modelValue": C[6] || (C[6] = (x) => l("update:form", "costing", x ?? h(xe.Dinero).zero().toObject()))
|
|
5054
5054
|
}, null, 8, ["model-value"])
|
|
5055
5055
|
])
|
|
5056
5056
|
])) : ie("", !0)
|
|
5057
5057
|
])) : ie("", !0),
|
|
5058
5058
|
s.value.minPrice ? (A(), ne("div", qr, [
|
|
5059
|
-
g(
|
|
5060
|
-
disabled: !s.value.minPrice ||
|
|
5061
|
-
"model-value": !!
|
|
5062
|
-
value: !!
|
|
5059
|
+
g(j, {
|
|
5060
|
+
disabled: !s.value.minPrice || f.isAddon,
|
|
5061
|
+
"model-value": !!f.form.minPrice,
|
|
5062
|
+
value: !!f.form.minPrice,
|
|
5063
5063
|
label: h(r)("menu.product.form.price.settings.min_price.label"),
|
|
5064
|
-
"onUpdate:modelValue":
|
|
5064
|
+
"onUpdate:modelValue": C[7] || (C[7] = (x) => l("update:form", "minPrice", x ? h(xe.Dinero).zero().toObject() : void 0))
|
|
5065
5065
|
}, null, 8, ["disabled", "model-value", "value", "label"]),
|
|
5066
5066
|
P("div", Zr, [
|
|
5067
5067
|
P("div", Qr, [
|
|
5068
|
-
|
|
5068
|
+
f.form.minPrice ? (A(), H(tt, {
|
|
5069
5069
|
key: 0,
|
|
5070
|
-
max: h(xe.Dinero).fromFdoDinero(
|
|
5070
|
+
max: h(xe.Dinero).fromFdoDinero(f.form.price).toUnit(),
|
|
5071
5071
|
min: 0,
|
|
5072
|
-
"model-value":
|
|
5072
|
+
"model-value": f.form.minPrice || null,
|
|
5073
5073
|
class: "flex-1",
|
|
5074
5074
|
"show-currency": "",
|
|
5075
|
-
"onUpdate:modelValue":
|
|
5075
|
+
"onUpdate:modelValue": C[8] || (C[8] = (x) => l("update:form", "minPrice", x ?? h(xe.Dinero).zero().toObject()))
|
|
5076
5076
|
}, null, 8, ["max", "model-value"])) : ie("", !0)
|
|
5077
5077
|
])
|
|
5078
5078
|
])
|
|
@@ -5109,7 +5109,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5109
5109
|
try {
|
|
5110
5110
|
l.value = !0, t.initialValue ? await n.updateMenu(
|
|
5111
5111
|
{
|
|
5112
|
-
module:
|
|
5112
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.printDepartment,
|
|
5113
5113
|
operation: ke.F_OPERATION_TYPE.update,
|
|
5114
5114
|
data: r.value,
|
|
5115
5115
|
link: Nt(((c = r.value) == null ? void 0 : c.usedBy) || [])
|
|
@@ -5117,7 +5117,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5117
5117
|
r.value.name
|
|
5118
5118
|
) : await n.updateMenu(
|
|
5119
5119
|
{
|
|
5120
|
-
module:
|
|
5120
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.printDepartment,
|
|
5121
5121
|
operation: ke.F_OPERATION_TYPE.create,
|
|
5122
5122
|
data: r.value,
|
|
5123
5123
|
link: Nt(((m = r.value) == null ? void 0 : m.usedBy) || [])
|
|
@@ -5136,7 +5136,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5136
5136
|
c && (r.value = t.initialValue ? ue(t.initialValue) : { ...Te.generator.initMenuV4PrintDepartment(), usedBy: [] });
|
|
5137
5137
|
}
|
|
5138
5138
|
), (c, m) => {
|
|
5139
|
-
const p = N("fm-text-field"),
|
|
5139
|
+
const p = N("fm-text-field"), v = N("fm-button"), b = N("fm-side-sheet");
|
|
5140
5140
|
return A(), ne(Me, null, [
|
|
5141
5141
|
ve(c.$slots, "default", { trigger: u }),
|
|
5142
5142
|
g(b, {
|
|
@@ -5156,14 +5156,14 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5156
5156
|
]),
|
|
5157
5157
|
"side-sheet-footer": V(() => [
|
|
5158
5158
|
P("div", is, [
|
|
5159
|
-
g(
|
|
5159
|
+
g(v, {
|
|
5160
5160
|
label: o.value,
|
|
5161
5161
|
loading: l.value,
|
|
5162
5162
|
size: "lg",
|
|
5163
5163
|
type: "submit",
|
|
5164
5164
|
variant: "primary"
|
|
5165
5165
|
}, null, 8, ["label", "loading"]),
|
|
5166
|
-
g(
|
|
5166
|
+
g(v, {
|
|
5167
5167
|
label: h(i)("menu.common.actions.cancel"),
|
|
5168
5168
|
size: "lg",
|
|
5169
5169
|
variant: "tertiary",
|
|
@@ -5184,7 +5184,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5184
5184
|
autofocus: "",
|
|
5185
5185
|
label: h(i)("menu.print_dept.columns.name")
|
|
5186
5186
|
}, null, 8, ["modelValue", "rules", "label"]),
|
|
5187
|
-
c.applyProduct ? (A(),
|
|
5187
|
+
c.applyProduct ? (A(), H(to, {
|
|
5188
5188
|
key: 0,
|
|
5189
5189
|
overrides: r.value.usedBy || [],
|
|
5190
5190
|
"select-variant": !1,
|
|
@@ -5224,10 +5224,10 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5224
5224
|
}), d = O(() => {
|
|
5225
5225
|
var _;
|
|
5226
5226
|
return u.value ? s.value.reduce(
|
|
5227
|
-
(
|
|
5227
|
+
(f, { _id: C }) => (f.includes(C) || (f = [...f, C]), f),
|
|
5228
5228
|
[...((_ = t.form.print) == null ? void 0 : _.department) ?? []]
|
|
5229
|
-
) : s.value.map(({ _id:
|
|
5230
|
-
}), c = O(() => s.value.reduce((_,
|
|
5229
|
+
) : s.value.map(({ _id: f }) => f);
|
|
5230
|
+
}), c = O(() => s.value.reduce((_, f) => (_[f._id] = f.name, _), {}));
|
|
5231
5231
|
function m(_) {
|
|
5232
5232
|
o("update:form", "print", {
|
|
5233
5233
|
...r(),
|
|
@@ -5242,23 +5242,23 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5242
5242
|
sequential: _
|
|
5243
5243
|
});
|
|
5244
5244
|
}
|
|
5245
|
-
function
|
|
5245
|
+
function v(_) {
|
|
5246
5246
|
o("update:form", "print", {
|
|
5247
5247
|
...r(),
|
|
5248
5248
|
...t.form.print,
|
|
5249
|
-
department: _.filter((
|
|
5250
|
-
var
|
|
5251
|
-
return (((
|
|
5249
|
+
department: _.filter((f) => {
|
|
5250
|
+
var C;
|
|
5251
|
+
return (((C = t.form.print) == null ? void 0 : C.department) ?? []).includes(f);
|
|
5252
5252
|
})
|
|
5253
5253
|
});
|
|
5254
5254
|
}
|
|
5255
|
-
function b(_,
|
|
5256
|
-
var
|
|
5257
|
-
let
|
|
5258
|
-
|
|
5255
|
+
function b(_, f) {
|
|
5256
|
+
var K, U;
|
|
5257
|
+
let C = [...((U = (K = t.form) == null ? void 0 : K.print) == null ? void 0 : U.department) ?? []];
|
|
5258
|
+
f && !C.includes(_) ? C = [...C, _] : f || (C = C.filter((j) => j !== _)), o("update:form", "print", {
|
|
5259
5259
|
...r(),
|
|
5260
5260
|
...t.form.print,
|
|
5261
|
-
department:
|
|
5261
|
+
department: C
|
|
5262
5262
|
});
|
|
5263
5263
|
}
|
|
5264
5264
|
const y = O(() => [
|
|
@@ -5276,27 +5276,27 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5276
5276
|
return Re(
|
|
5277
5277
|
() => s.value.length,
|
|
5278
5278
|
() => b(s.value[s.value.length - 1]._id, !0)
|
|
5279
|
-
), (_,
|
|
5280
|
-
const
|
|
5281
|
-
return A(),
|
|
5279
|
+
), (_, f) => {
|
|
5280
|
+
const C = N("fm-switch"), K = N("fm-radio"), U = N("fm-radio-group"), j = N("fm-button"), M = N("fm-checkbox");
|
|
5281
|
+
return A(), H(Ge, {
|
|
5282
5282
|
title: h(a)("menu.product.form.print.title")
|
|
5283
5283
|
}, {
|
|
5284
5284
|
default: V(() => {
|
|
5285
5285
|
var D;
|
|
5286
5286
|
return [
|
|
5287
|
-
l.value.printConfig ? (A(),
|
|
5287
|
+
l.value.printConfig ? (A(), H(He, {
|
|
5288
5288
|
key: 0,
|
|
5289
5289
|
label: h(a)("menu.product.form.print.config.label")
|
|
5290
5290
|
}, {
|
|
5291
5291
|
default: V(() => {
|
|
5292
5292
|
var I;
|
|
5293
5293
|
return [
|
|
5294
|
-
g(
|
|
5294
|
+
g(C, {
|
|
5295
5295
|
"model-value": !((I = _.form.print) != null && I.toRoot),
|
|
5296
5296
|
label: h(a)("menu.product.form.print.config.group_parent.label"),
|
|
5297
5297
|
"label-placement": "right",
|
|
5298
5298
|
sublabel: h(a)("menu.product.form.print.config.group_parent.sublabel"),
|
|
5299
|
-
"onUpdate:modelValue":
|
|
5299
|
+
"onUpdate:modelValue": f[0] || (f[0] = (w) => m(w))
|
|
5300
5300
|
}, null, 8, ["model-value", "label", "sublabel"])
|
|
5301
5301
|
];
|
|
5302
5302
|
}),
|
|
@@ -5305,11 +5305,11 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5305
5305
|
g(U, {
|
|
5306
5306
|
label: h(a)("menu.product.form.print.kds.label"),
|
|
5307
5307
|
"model-value": ((D = _.form.print) == null ? void 0 : D.sequential) ?? !1,
|
|
5308
|
-
"onUpdate:modelValue":
|
|
5308
|
+
"onUpdate:modelValue": f[1] || (f[1] = (I) => p(I))
|
|
5309
5309
|
}, {
|
|
5310
5310
|
default: V(() => [
|
|
5311
5311
|
P("div", as, [
|
|
5312
|
-
(A(!0), ne(Me, null, Ne(y.value, (I, w) => (A(),
|
|
5312
|
+
(A(!0), ne(Me, null, Ne(y.value, (I, w) => (A(), H(K, {
|
|
5313
5313
|
key: w,
|
|
5314
5314
|
label: I.label,
|
|
5315
5315
|
sublabel: I.description,
|
|
@@ -5323,32 +5323,32 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5323
5323
|
label: h(a)("menu.product.form.print.routes.label")
|
|
5324
5324
|
}, {
|
|
5325
5325
|
default: V(() => [
|
|
5326
|
-
d.value.length ? (A(),
|
|
5326
|
+
d.value.length ? (A(), H(h(Gi), {
|
|
5327
5327
|
key: 0,
|
|
5328
5328
|
"item-key": (I) => I,
|
|
5329
5329
|
"model-value": d.value,
|
|
5330
5330
|
handle: ".handle",
|
|
5331
|
-
"onUpdate:modelValue":
|
|
5331
|
+
"onUpdate:modelValue": f[3] || (f[3] = (I) => v(I)),
|
|
5332
5332
|
class: "space-y-16"
|
|
5333
5333
|
}, {
|
|
5334
5334
|
item: V(({ element: I }) => {
|
|
5335
|
-
var w, R, S,
|
|
5335
|
+
var w, R, S, x, $;
|
|
5336
5336
|
return [
|
|
5337
5337
|
P("div", rs, [
|
|
5338
5338
|
P("div", ss, [
|
|
5339
|
-
u.value ? (A(),
|
|
5339
|
+
u.value ? (A(), H(j, {
|
|
5340
5340
|
key: 0,
|
|
5341
5341
|
disabled: !((R = (w = t.form.print) == null ? void 0 : w.department) != null && R.includes(I)),
|
|
5342
5342
|
class: "handle",
|
|
5343
5343
|
"prepend-icon": "drag_handle",
|
|
5344
5344
|
variant: "tertiary",
|
|
5345
|
-
onClick:
|
|
5345
|
+
onClick: f[2] || (f[2] = kt(() => {
|
|
5346
5346
|
}, ["stop"]))
|
|
5347
5347
|
}, null, 8, ["disabled"])) : ie("", !0)
|
|
5348
5348
|
]),
|
|
5349
5349
|
g(M, {
|
|
5350
5350
|
id: I,
|
|
5351
|
-
"data-checked": (
|
|
5351
|
+
"data-checked": (x = (S = t.form.print) == null ? void 0 : S.department) == null ? void 0 : x.includes(I),
|
|
5352
5352
|
label: c.value[I],
|
|
5353
5353
|
"model-value": ((($ = t.form.print) == null ? void 0 : $.department) ?? []).includes(I),
|
|
5354
5354
|
value: I,
|
|
@@ -5363,7 +5363,7 @@ const br = { class: "fm-typo-en-title-md-600" }, yr = {
|
|
|
5363
5363
|
g(h(os), { "apply-product": !1 }, {
|
|
5364
5364
|
default: V(({ trigger: I }) => [
|
|
5365
5365
|
P("div", ls, [
|
|
5366
|
-
g(
|
|
5366
|
+
g(j, {
|
|
5367
5367
|
variant: h(Qe).Secondary,
|
|
5368
5368
|
label: h(a)("menu.product.form.print.routes.add"),
|
|
5369
5369
|
"prepend-icon": "add",
|
|
@@ -5415,8 +5415,8 @@ function cs(e, i, t) {
|
|
|
5415
5415
|
name: e.fullCombinations[d.combinationKey || ""],
|
|
5416
5416
|
takeaway: d.takeawayUsed,
|
|
5417
5417
|
onUpdate: (m) => {
|
|
5418
|
-
var
|
|
5419
|
-
const p = ue(((
|
|
5418
|
+
var v, b;
|
|
5419
|
+
const p = ue(((v = e.form.variant) == null ? void 0 : v.variantCombinations) || []);
|
|
5420
5420
|
p[c].takeawayUsed = m, i("update:form", "variant", {
|
|
5421
5421
|
variantGroupIds: ((b = e.form.variant) == null ? void 0 : b.variantGroupIds) || [],
|
|
5422
5422
|
variantCombinations: p
|
|
@@ -5462,9 +5462,9 @@ const ds = {
|
|
|
5462
5462
|
} : {
|
|
5463
5463
|
label: r("menu.product.form.takeaway.options.no_preset"),
|
|
5464
5464
|
value: null
|
|
5465
|
-
}, ...n.takeaways.map((
|
|
5466
|
-
label:
|
|
5467
|
-
value:
|
|
5465
|
+
}, ...n.takeaways.map((y) => ({
|
|
5466
|
+
label: y.name,
|
|
5467
|
+
value: y._id
|
|
5468
5468
|
}))]), c = te([{
|
|
5469
5469
|
accessorKey: "name",
|
|
5470
5470
|
enableSorting: !1,
|
|
@@ -5473,36 +5473,36 @@ const ds = {
|
|
|
5473
5473
|
accessorKey: "takeaway",
|
|
5474
5474
|
enableSorting: !1,
|
|
5475
5475
|
header: () => r("menu.product.form.takeaway.columns.takeaway"),
|
|
5476
|
-
cell: (
|
|
5477
|
-
const
|
|
5476
|
+
cell: (y) => {
|
|
5477
|
+
const _ = y.getValue(), f = y.row.original;
|
|
5478
5478
|
return Ce(Xn, {
|
|
5479
5479
|
action: "add",
|
|
5480
5480
|
applyProduct: !1,
|
|
5481
5481
|
bindToVariant: n.rules.item.bindToVariant,
|
|
5482
|
-
"onUpdate:takeaway": async (
|
|
5482
|
+
"onUpdate:takeaway": async (C) => {
|
|
5483
5483
|
await o.updateMenu({
|
|
5484
|
-
module:
|
|
5484
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.takeaway,
|
|
5485
5485
|
operation: ke.F_OPERATION_TYPE.create,
|
|
5486
|
-
data:
|
|
5487
|
-
link: Nt(
|
|
5488
|
-
},
|
|
5486
|
+
data: C,
|
|
5487
|
+
link: Nt(C.usedBy || [])
|
|
5488
|
+
}, C.name);
|
|
5489
5489
|
}
|
|
5490
5490
|
}, {
|
|
5491
5491
|
default: ({
|
|
5492
|
-
trigger:
|
|
5492
|
+
trigger: C
|
|
5493
5493
|
}) => Ce(Ae.FmSelect, {
|
|
5494
|
-
modelValue:
|
|
5494
|
+
modelValue: _ || null,
|
|
5495
5495
|
menuZIndex: 103,
|
|
5496
5496
|
items: d.value,
|
|
5497
5497
|
shiftMenu: !0,
|
|
5498
|
-
"onUpdate:modelValue": (
|
|
5499
|
-
|
|
5498
|
+
"onUpdate:modelValue": (K) => {
|
|
5499
|
+
f.onUpdate(K || "");
|
|
5500
5500
|
}
|
|
5501
5501
|
}, {
|
|
5502
5502
|
"append-menu": () => n.rules.takeaway.create ? Ce("button", {
|
|
5503
5503
|
class: "flex items-center py-8 px-16 space-x-8",
|
|
5504
5504
|
type: "button",
|
|
5505
|
-
onClick:
|
|
5505
|
+
onClick: C
|
|
5506
5506
|
}, [Ce(Ae.FmIcon, {
|
|
5507
5507
|
name: "add",
|
|
5508
5508
|
size: "md",
|
|
@@ -5513,45 +5513,57 @@ const ds = {
|
|
|
5513
5513
|
})
|
|
5514
5514
|
});
|
|
5515
5515
|
}
|
|
5516
|
-
}])
|
|
5517
|
-
|
|
5518
|
-
return
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5516
|
+
}]), m = O(() => {
|
|
5517
|
+
const y = n.state.featureFlags.showTakeawayAvailability, _ = n.rules.item.takeawayConfig;
|
|
5518
|
+
return {
|
|
5519
|
+
app: _ && y.app,
|
|
5520
|
+
pos: _ && y.pos
|
|
5521
|
+
};
|
|
5522
|
+
});
|
|
5523
|
+
function p(y) {
|
|
5524
|
+
return (_) => {
|
|
5525
|
+
const f = t.form.takeawayConfig, C = {
|
|
5526
|
+
pos: (f == null ? void 0 : f.pos) ?? !0,
|
|
5527
|
+
app: (f == null ? void 0 : f.app) ?? !0,
|
|
5528
|
+
[y]: _
|
|
5523
5529
|
};
|
|
5524
|
-
l("update:form", "takeawayConfig",
|
|
5530
|
+
l("update:form", "takeawayConfig", C);
|
|
5525
5531
|
};
|
|
5526
5532
|
}
|
|
5527
|
-
O({
|
|
5533
|
+
const v = O({
|
|
5528
5534
|
get() {
|
|
5529
|
-
var
|
|
5530
|
-
return ((
|
|
5535
|
+
var y;
|
|
5536
|
+
return ((y = t.form.takeawayConfig) == null ? void 0 : y.pos) ?? !0;
|
|
5531
5537
|
},
|
|
5532
|
-
set:
|
|
5533
|
-
})
|
|
5534
|
-
const p = O({
|
|
5538
|
+
set: p("pos")
|
|
5539
|
+
}), b = O({
|
|
5535
5540
|
get() {
|
|
5536
|
-
var
|
|
5537
|
-
return ((
|
|
5541
|
+
var y;
|
|
5542
|
+
return ((y = t.form.takeawayConfig) == null ? void 0 : y.app) ?? !0;
|
|
5538
5543
|
},
|
|
5539
|
-
set:
|
|
5544
|
+
set: p("app")
|
|
5540
5545
|
});
|
|
5541
|
-
return (
|
|
5542
|
-
const
|
|
5543
|
-
return A(),
|
|
5546
|
+
return (y, _) => {
|
|
5547
|
+
const f = N("FmCheckbox"), C = N("fm-table");
|
|
5548
|
+
return A(), H(Ge, {
|
|
5544
5549
|
title: h(r)("menu.product.form.takeaway.title"),
|
|
5545
5550
|
"sub-title": h(r)("menu.product.form.takeaway.subtitle")
|
|
5546
5551
|
}, {
|
|
5547
|
-
default: V(() => [P("div", ds, [
|
|
5552
|
+
default: V(() => [P("div", ds, [m.value.pos ? (A(), H(f, {
|
|
5548
5553
|
key: 0,
|
|
5549
|
-
modelValue:
|
|
5550
|
-
"onUpdate:modelValue":
|
|
5554
|
+
modelValue: v.value,
|
|
5555
|
+
"onUpdate:modelValue": _[0] || (_[0] = (K) => v.value = K),
|
|
5556
|
+
label: h(r)("menu.product.form.takeaway.takeawayConfig.pos.label"),
|
|
5557
|
+
sublabel: h(r)("menu.product.form.takeaway.takeawayConfig.pos.sublabel"),
|
|
5558
|
+
value: !0
|
|
5559
|
+
}, null, 8, ["modelValue", "label", "sublabel"])) : ie("", !0), m.value.app ? (A(), H(f, {
|
|
5560
|
+
key: 1,
|
|
5561
|
+
modelValue: b.value,
|
|
5562
|
+
"onUpdate:modelValue": _[1] || (_[1] = (K) => b.value = K),
|
|
5551
5563
|
label: h(r)("menu.product.form.takeaway.takeawayConfig.app.label"),
|
|
5552
5564
|
sublabel: h(r)("menu.product.form.takeaway.takeawayConfig.app.sublabel"),
|
|
5553
5565
|
value: !0
|
|
5554
|
-
}, null, 8, ["modelValue", "label", "sublabel"])) : ie("", !0)]), g(
|
|
5566
|
+
}, null, 8, ["modelValue", "label", "sublabel"])) : ie("", !0)]), g(C, {
|
|
5555
5567
|
columnDefs: c.value,
|
|
5556
5568
|
"page-size": h(u).length,
|
|
5557
5569
|
"row-data": h(u),
|
|
@@ -5581,7 +5593,7 @@ const ds = {
|
|
|
5581
5593
|
t(s.value), n("primary"), i.close();
|
|
5582
5594
|
};
|
|
5583
5595
|
return (c, m) => {
|
|
5584
|
-
const p = N("FmSearch"),
|
|
5596
|
+
const p = N("FmSearch"), v = N("FmCheckbox"), b = N("FmButton");
|
|
5585
5597
|
return l.value.length > 0 ? (A(), ne("div", ps, [
|
|
5586
5598
|
P("div", null, [
|
|
5587
5599
|
g(p, {
|
|
@@ -5596,7 +5608,7 @@ const ds = {
|
|
|
5596
5608
|
(A(!0), ne(Me, null, Ne(l.value, (y) => (A(), ne("div", {
|
|
5597
5609
|
key: y.value
|
|
5598
5610
|
}, [
|
|
5599
|
-
ct(g(
|
|
5611
|
+
ct(g(v, {
|
|
5600
5612
|
modelValue: s.value,
|
|
5601
5613
|
"onUpdate:modelValue": [
|
|
5602
5614
|
m[1] || (m[1] = (_) => s.value = _),
|
|
@@ -5613,7 +5625,7 @@ const ds = {
|
|
|
5613
5625
|
P("div", fs, [
|
|
5614
5626
|
g(h(vi), null, {
|
|
5615
5627
|
default: V(({ trigger: y }) => [
|
|
5616
|
-
h(a).rules.item.variant ? (A(),
|
|
5628
|
+
h(a).rules.item.variant ? (A(), H(b, {
|
|
5617
5629
|
key: 0,
|
|
5618
5630
|
label: h(o)("menu.common.actions.add_new_variant"),
|
|
5619
5631
|
variant: "tertiary",
|
|
@@ -5681,13 +5693,13 @@ const ds = {
|
|
|
5681
5693
|
const t = e, n = ye(), a = ni(), o = De(), r = Le(), {
|
|
5682
5694
|
t: l
|
|
5683
5695
|
} = he(), s = te(!1), u = O(() => n.rules.item), d = O(() => u.value.minPrice && !!t.form.minPrice), c = O(() => !n.state.currentCatalogId), m = O(() => n.variants.reduce((w, R) => (w[R._id] = R, w), {})), p = i;
|
|
5684
|
-
function
|
|
5696
|
+
function v(w) {
|
|
5685
5697
|
const R = $e.clone(t.form);
|
|
5686
5698
|
for (const {
|
|
5687
5699
|
key: S,
|
|
5688
|
-
value:
|
|
5700
|
+
value: x
|
|
5689
5701
|
} of w)
|
|
5690
|
-
R[S] =
|
|
5702
|
+
R[S] = x;
|
|
5691
5703
|
p("replace:form", R);
|
|
5692
5704
|
}
|
|
5693
5705
|
function b(w) {
|
|
@@ -5698,8 +5710,8 @@ const ds = {
|
|
|
5698
5710
|
price: R == null ? void 0 : R.price,
|
|
5699
5711
|
inventoryBindings: (R == null ? void 0 : R.inventoryBindings) || t.form.inventoryBindings,
|
|
5700
5712
|
takeawayUsed: (R == null ? void 0 : R.takeawayUsed) || t.form.takeawayUsed,
|
|
5701
|
-
groups: (R == null ? void 0 : R.groups) || ((S = t.form.groups) == null ? void 0 : S.map((
|
|
5702
|
-
...
|
|
5713
|
+
groups: (R == null ? void 0 : R.groups) || ((S = t.form.groups) == null ? void 0 : S.map((x) => ({
|
|
5714
|
+
...x,
|
|
5703
5715
|
groupKey: ""
|
|
5704
5716
|
})))
|
|
5705
5717
|
};
|
|
@@ -5713,42 +5725,42 @@ const ds = {
|
|
|
5713
5725
|
selectedVariants: ((w = t.form.variant) == null ? void 0 : w.variantGroupIds) ?? []
|
|
5714
5726
|
}
|
|
5715
5727
|
}).onPrimary(async (R) => {
|
|
5716
|
-
|
|
5728
|
+
K(R, b);
|
|
5717
5729
|
});
|
|
5718
5730
|
}
|
|
5719
5731
|
function _(w) {
|
|
5720
|
-
var
|
|
5721
|
-
const R = ((
|
|
5732
|
+
var k, F;
|
|
5733
|
+
const R = ((k = t.form.variant) == null ? void 0 : k.variantGroupIds) || [], S = (F = t.form.variant) == null ? void 0 : F.variantCombinations, B = w.split(/(?=variant)/g).map((T) => T.replace(/\/*$/, "")).filter((T) => R.some((L) => T.includes(L))).join("/");
|
|
5722
5734
|
return S == null ? void 0 : S.find((T) => T.combinationKey === B);
|
|
5723
5735
|
}
|
|
5724
|
-
const
|
|
5725
|
-
|
|
5726
|
-
},
|
|
5736
|
+
const f = (w) => {
|
|
5737
|
+
K(w);
|
|
5738
|
+
}, C = O(() => {
|
|
5727
5739
|
var R;
|
|
5728
5740
|
return (((R = t.form.variant) == null ? void 0 : R.variantCombinations) || []).map((S) => {
|
|
5729
5741
|
var $, B;
|
|
5730
|
-
const
|
|
5731
|
-
combinationKey:
|
|
5732
|
-
}) =>
|
|
5742
|
+
const x = (B = ($ = t.fallback) == null ? void 0 : $.variant) == null ? void 0 : B.variantCombinations.find(({
|
|
5743
|
+
combinationKey: k
|
|
5744
|
+
}) => k === S.combinationKey);
|
|
5733
5745
|
return {
|
|
5734
5746
|
...S,
|
|
5735
5747
|
fallback: {
|
|
5736
|
-
...
|
|
5748
|
+
...x,
|
|
5737
5749
|
_id: S._id,
|
|
5738
5750
|
combinationKey: S.combinationKey,
|
|
5739
|
-
price: c.value ? t.form.price ?? (
|
|
5740
|
-
minPrice: t.form.minPrice ?? (
|
|
5751
|
+
price: c.value ? t.form.price ?? (x == null ? void 0 : x.price) : S.price ?? (x == null ? void 0 : x.price),
|
|
5752
|
+
minPrice: t.form.minPrice ?? (x == null ? void 0 : x.minPrice),
|
|
5741
5753
|
priceTiers: t.form.priceTiers
|
|
5742
5754
|
}
|
|
5743
5755
|
};
|
|
5744
5756
|
});
|
|
5745
5757
|
});
|
|
5746
|
-
function
|
|
5758
|
+
function K(w, R = (S) => S) {
|
|
5747
5759
|
var $;
|
|
5748
5760
|
const S = w.filter((B) => !!B);
|
|
5749
|
-
let
|
|
5761
|
+
let x;
|
|
5750
5762
|
if (S.length) {
|
|
5751
|
-
const B = S.map((F) => n.variants.find((T) => T._id === F)),
|
|
5763
|
+
const B = S.map((F) => n.variants.find((T) => T._id === F)), k = Te.fullVariantCombination(B).map(({
|
|
5752
5764
|
combinationKey: F
|
|
5753
5765
|
}) => {
|
|
5754
5766
|
var L;
|
|
@@ -5758,46 +5770,46 @@ const ds = {
|
|
|
5758
5770
|
combinationKey: F
|
|
5759
5771
|
});
|
|
5760
5772
|
});
|
|
5761
|
-
if (
|
|
5773
|
+
if (k.length > 100) {
|
|
5762
5774
|
o.open({
|
|
5763
5775
|
type: "error",
|
|
5764
5776
|
message: "'Combinations of variant should not be more than 100'"
|
|
5765
5777
|
});
|
|
5766
5778
|
return;
|
|
5767
5779
|
}
|
|
5768
|
-
|
|
5780
|
+
x = {
|
|
5769
5781
|
...t.form,
|
|
5770
5782
|
variant: {
|
|
5771
5783
|
variantGroupIds: S,
|
|
5772
|
-
variantCombinations:
|
|
5784
|
+
variantCombinations: k
|
|
5773
5785
|
},
|
|
5774
5786
|
inventoryBindings: null,
|
|
5775
5787
|
takeawayUsed: null
|
|
5776
5788
|
};
|
|
5777
5789
|
} else {
|
|
5778
|
-
const B = ($ = t.form.variant) == null ? void 0 : $.variantCombinations.map((F) => F.takeawayUsed),
|
|
5779
|
-
|
|
5790
|
+
const B = ($ = t.form.variant) == null ? void 0 : $.variantCombinations.map((F) => F.takeawayUsed), k = [...new Set(B)];
|
|
5791
|
+
v([{
|
|
5780
5792
|
key: "variant",
|
|
5781
5793
|
value: void 0
|
|
5782
5794
|
}, {
|
|
5783
5795
|
key: "takeawayUsed",
|
|
5784
|
-
value:
|
|
5785
|
-
}]),
|
|
5796
|
+
value: k.length === 1 ? k[0] : null
|
|
5797
|
+
}]), x = {
|
|
5786
5798
|
...t.form,
|
|
5787
5799
|
variant: void 0,
|
|
5788
|
-
takeawayUsed:
|
|
5800
|
+
takeawayUsed: k.length === 1 ? k[0] : null
|
|
5789
5801
|
};
|
|
5790
5802
|
}
|
|
5791
|
-
p("replace:form", a.initDynamicGroupItem(
|
|
5803
|
+
p("replace:form", a.initDynamicGroupItem(x));
|
|
5792
5804
|
}
|
|
5793
5805
|
async function U(w, R, S) {
|
|
5794
|
-
const
|
|
5795
|
-
|
|
5806
|
+
const x = $e.clone(t.form);
|
|
5807
|
+
x.variant.variantCombinations[w][R] = S, v([{
|
|
5796
5808
|
key: "variant",
|
|
5797
|
-
value:
|
|
5809
|
+
value: x.variant
|
|
5798
5810
|
}]);
|
|
5799
5811
|
}
|
|
5800
|
-
const
|
|
5812
|
+
const j = O(() => {
|
|
5801
5813
|
var w, R;
|
|
5802
5814
|
return ((w = n.currentCatalog) == null ? void 0 : w.priceTierRules) ?? ((R = n.currentCatalog) == null ? void 0 : R.usePriceTiers) ?? [];
|
|
5803
5815
|
}), M = O(() => [{
|
|
@@ -5810,8 +5822,8 @@ const ds = {
|
|
|
5810
5822
|
header: () => l("menu.product.form.variant.columns.code"),
|
|
5811
5823
|
enableSorting: !1,
|
|
5812
5824
|
cell: (w) => {
|
|
5813
|
-
var B,
|
|
5814
|
-
const R = w.getValue(), S = w.row.original, $ = ((B = S.fallback) == null ? void 0 : B.code) ?? t.form.code ?? ((
|
|
5825
|
+
var B, k;
|
|
5826
|
+
const R = w.getValue(), S = w.row.original, $ = ((B = S.fallback) == null ? void 0 : B.code) ?? t.form.code ?? ((k = t.fallback) == null ? void 0 : k.code);
|
|
5815
5827
|
return g(Ae.FmTextField, {
|
|
5816
5828
|
modelValue: R,
|
|
5817
5829
|
placeholder: $ || l("menu.product.form.variant.placeholders.no_code"),
|
|
@@ -5839,15 +5851,15 @@ const ds = {
|
|
|
5839
5851
|
enableSorting: !1,
|
|
5840
5852
|
cell: (w) => {
|
|
5841
5853
|
var $, B;
|
|
5842
|
-
const R = w.getValue(),
|
|
5854
|
+
const R = w.getValue(), x = ($ = w.row.original.fallback) == null ? void 0 : $.orderFrom;
|
|
5843
5855
|
return g(ii, {
|
|
5844
5856
|
modelValue: R,
|
|
5845
|
-
fallback: t.form.orderFrom ??
|
|
5857
|
+
fallback: t.form.orderFrom ?? x ?? ((B = t.fallback) == null ? void 0 : B.orderFrom),
|
|
5846
5858
|
disable: !u.value.orderFrom,
|
|
5847
5859
|
required: u.value.orderFrom && u.value.orderFromActiveOnly,
|
|
5848
5860
|
editActiveOnly: u.value.orderFromActiveOnly || !1,
|
|
5849
|
-
"onUpdate:model-value": (
|
|
5850
|
-
U(w.row.index, "orderFrom",
|
|
5861
|
+
"onUpdate:model-value": (k) => {
|
|
5862
|
+
U(w.row.index, "orderFrom", k);
|
|
5851
5863
|
},
|
|
5852
5864
|
label: "",
|
|
5853
5865
|
defaultLabel: "Follow general"
|
|
@@ -5859,12 +5871,12 @@ const ds = {
|
|
|
5859
5871
|
size: 200,
|
|
5860
5872
|
enableSorting: !1,
|
|
5861
5873
|
cell: (w) => {
|
|
5862
|
-
var B,
|
|
5863
|
-
const R = w.getValue(), S = w.row.original, $ = ((B = S.fallback) == null ? void 0 : B.price) ?? t.form.price ?? ((
|
|
5874
|
+
var B, k, F;
|
|
5875
|
+
const R = w.getValue(), S = w.row.original, $ = ((B = S.fallback) == null ? void 0 : B.price) ?? t.form.price ?? ((k = t.fallback) == null ? void 0 : k.price);
|
|
5864
5876
|
return g("div", {
|
|
5865
5877
|
class: "flex items-center gap-8"
|
|
5866
5878
|
}, [g(tt, {
|
|
5867
|
-
disable:
|
|
5879
|
+
disable: j.value.length > 0 && n.currentCatalog && !n.currentScheduler,
|
|
5868
5880
|
placeholder: $ ? rt($) : void 0,
|
|
5869
5881
|
modelValue: R,
|
|
5870
5882
|
min: 0,
|
|
@@ -5884,8 +5896,8 @@ const ds = {
|
|
|
5884
5896
|
header: () => l("menu.product.form.variant.columns.min_price"),
|
|
5885
5897
|
enableSorting: !1,
|
|
5886
5898
|
cell: (w) => {
|
|
5887
|
-
var B,
|
|
5888
|
-
const R = w.getValue(), S = w.row.original, $ = ((B = S.fallback) == null ? void 0 : B.minPrice) ?? t.form.minPrice ?? ((
|
|
5899
|
+
var B, k, F;
|
|
5900
|
+
const R = w.getValue(), S = w.row.original, $ = ((B = S.fallback) == null ? void 0 : B.minPrice) ?? t.form.minPrice ?? ((k = t.fallback) == null ? void 0 : k.minPrice);
|
|
5889
5901
|
return g(tt, {
|
|
5890
5902
|
placeholder: $ ? rt($) : void 0,
|
|
5891
5903
|
modelValue: R,
|
|
@@ -5906,12 +5918,12 @@ const ds = {
|
|
|
5906
5918
|
}) : !0;
|
|
5907
5919
|
}
|
|
5908
5920
|
return (w, R) => {
|
|
5909
|
-
const S = N("fm-button"),
|
|
5910
|
-
return A(),
|
|
5921
|
+
const S = N("fm-button"), x = N("fm-icon"), $ = N("FmFormGroup"), B = N("fm-table");
|
|
5922
|
+
return A(), H(Ge, {
|
|
5911
5923
|
title: h(l)("menu.product.form.variant.title"),
|
|
5912
5924
|
"sub-title": h(l)("menu.product.form.variant.subtitle")
|
|
5913
5925
|
}, {
|
|
5914
|
-
"append-title": V(() => [h(n).rules.item.variant ? (A(),
|
|
5926
|
+
"append-title": V(() => [h(n).rules.item.variant ? (A(), H(S, {
|
|
5915
5927
|
key: 0,
|
|
5916
5928
|
label: h(l)("menu.product.form.variant.add"),
|
|
5917
5929
|
variant: "secondary",
|
|
@@ -5919,9 +5931,9 @@ const ds = {
|
|
|
5919
5931
|
onClick: y
|
|
5920
5932
|
}, null, 8, ["label"])) : ie("", !0)]),
|
|
5921
5933
|
default: V(() => {
|
|
5922
|
-
var
|
|
5934
|
+
var k;
|
|
5923
5935
|
return [P("div", Ss, [g($, {
|
|
5924
|
-
"model-value": (
|
|
5936
|
+
"model-value": (k = w.form.variant) == null ? void 0 : k.variantGroupIds,
|
|
5925
5937
|
rules: [I]
|
|
5926
5938
|
}, {
|
|
5927
5939
|
default: V(() => {
|
|
@@ -5932,7 +5944,7 @@ const ds = {
|
|
|
5932
5944
|
group: "variants",
|
|
5933
5945
|
handle: ".handle",
|
|
5934
5946
|
"item-key": "id",
|
|
5935
|
-
"onUpdate:modelValue":
|
|
5947
|
+
"onUpdate:modelValue": f
|
|
5936
5948
|
}, {
|
|
5937
5949
|
item: V(({
|
|
5938
5950
|
element: T
|
|
@@ -5942,12 +5954,12 @@ const ds = {
|
|
|
5942
5954
|
variant: h(Qe).Tertiary,
|
|
5943
5955
|
class: "handle",
|
|
5944
5956
|
"prepend-icon": "drag_handle"
|
|
5945
|
-
}, null, 8, ["variant"]), P("div", ks, [P("p", xs, de((L = m.value[T]) == null ? void 0 : L.name), 1), g(
|
|
5957
|
+
}, null, 8, ["variant"]), P("div", ks, [P("p", xs, de((L = m.value[T]) == null ? void 0 : L.name), 1), g(x, {
|
|
5946
5958
|
class: "cursor-pointer",
|
|
5947
5959
|
name: "close",
|
|
5948
5960
|
onClick: kt((ae) => {
|
|
5949
5961
|
var z;
|
|
5950
|
-
return
|
|
5962
|
+
return K(((z = w.form.variant) == null ? void 0 : z.variantGroupIds.filter((E) => E !== T)) ?? []);
|
|
5951
5963
|
}, ["stop"])
|
|
5952
5964
|
}, null, 8, ["onClick"])])])];
|
|
5953
5965
|
}),
|
|
@@ -5956,13 +5968,13 @@ const ds = {
|
|
|
5956
5968
|
}),
|
|
5957
5969
|
_: 1
|
|
5958
5970
|
}, 8, ["model-value", "rules"]), g(mn, null, {
|
|
5959
|
-
default: V(() => [
|
|
5971
|
+
default: V(() => [C.value.length ? (A(), H(B, {
|
|
5960
5972
|
key: 0,
|
|
5961
5973
|
class: "w-full",
|
|
5962
5974
|
"column-defs": M.value,
|
|
5963
5975
|
"column-visibility": D.value,
|
|
5964
|
-
"page-size":
|
|
5965
|
-
"row-data":
|
|
5976
|
+
"page-size": C.value.length ?? 0,
|
|
5977
|
+
"row-data": C.value ?? [],
|
|
5966
5978
|
"hide-footer": "",
|
|
5967
5979
|
"shrink-at": !1
|
|
5968
5980
|
}, null, 8, ["column-defs", "column-visibility", "page-size", "row-data"])) : ie("", !0)]),
|
|
@@ -6025,12 +6037,12 @@ const ds = {
|
|
|
6025
6037
|
...Te.generator.initMenuV4Item(),
|
|
6026
6038
|
category: t.categoryId
|
|
6027
6039
|
}
|
|
6028
|
-
),
|
|
6040
|
+
), v = te(null);
|
|
6029
6041
|
Re(
|
|
6030
6042
|
() => t.initialForm,
|
|
6031
6043
|
async () => {
|
|
6032
6044
|
if (t.initialForm)
|
|
6033
|
-
|
|
6045
|
+
v.value = await jn(
|
|
6034
6046
|
a.state.menu,
|
|
6035
6047
|
t.initialForm._id
|
|
6036
6048
|
);
|
|
@@ -6048,23 +6060,23 @@ const ds = {
|
|
|
6048
6060
|
}, _ = O(() => {
|
|
6049
6061
|
var X;
|
|
6050
6062
|
return a.mapVariant((X = p.value.variant) == null ? void 0 : X.variantGroupIds);
|
|
6051
|
-
}),
|
|
6063
|
+
}), f = te(null);
|
|
6052
6064
|
Re(
|
|
6053
6065
|
() => p.value.thumbnail,
|
|
6054
6066
|
async (X) => {
|
|
6055
|
-
X && (typeof X == "string" ?
|
|
6067
|
+
X && (typeof X == "string" ? f.value = await xo(X, "thumbnail.jpg", "image/jpeg") : f.value = X);
|
|
6056
6068
|
},
|
|
6057
6069
|
{
|
|
6058
6070
|
immediate: !0
|
|
6059
6071
|
}
|
|
6060
6072
|
);
|
|
6061
|
-
const
|
|
6073
|
+
const C = (X, G) => {
|
|
6062
6074
|
p.value = {
|
|
6063
6075
|
...ue(p.value),
|
|
6064
6076
|
[X]: G
|
|
6065
6077
|
};
|
|
6066
6078
|
};
|
|
6067
|
-
async function
|
|
6079
|
+
async function K() {
|
|
6068
6080
|
var X, G;
|
|
6069
6081
|
m.value = p.value._id && U.value ? (await Wn(
|
|
6070
6082
|
a.mergedMenu,
|
|
@@ -6076,9 +6088,9 @@ const ds = {
|
|
|
6076
6088
|
}
|
|
6077
6089
|
const U = O(
|
|
6078
6090
|
() => !!a.currentCatalog || !!a.state.currentSchedulerId
|
|
6079
|
-
),
|
|
6091
|
+
), j = O(() => {
|
|
6080
6092
|
var X;
|
|
6081
|
-
return U.value ? p.value.category == "" || p.value.category == null && ((X = m.value) == null ? void 0 : X.category) == null : a.version ===
|
|
6093
|
+
return U.value ? p.value.category == "" || p.value.category == null && ((X = m.value) == null ? void 0 : X.category) == null : a.version === Y.F_MENU_VERSION.enum.v4 && p.value.category == null;
|
|
6082
6094
|
}), M = O(() => o.itemAttributeSettings.value.length > 0 && !U.value);
|
|
6083
6095
|
function D() {
|
|
6084
6096
|
var fe;
|
|
@@ -6090,7 +6102,7 @@ const ds = {
|
|
|
6090
6102
|
return pe ? In(pe.meta.rate) : "-";
|
|
6091
6103
|
}
|
|
6092
6104
|
function I() {
|
|
6093
|
-
|
|
6105
|
+
f.value = null, p.value.thumbnail = null;
|
|
6094
6106
|
}
|
|
6095
6107
|
const w = O(() => {
|
|
6096
6108
|
var X, G, pe, fe, J, ui, ci, di, mi;
|
|
@@ -6148,7 +6160,7 @@ const ds = {
|
|
|
6148
6160
|
orderFrom: void 0
|
|
6149
6161
|
});
|
|
6150
6162
|
}
|
|
6151
|
-
const
|
|
6163
|
+
const x = O(() => {
|
|
6152
6164
|
const X = {};
|
|
6153
6165
|
return a.state.menu.modules.item.forEach((G) => {
|
|
6154
6166
|
var pe;
|
|
@@ -6164,7 +6176,7 @@ const ds = {
|
|
|
6164
6176
|
price: void 0
|
|
6165
6177
|
});
|
|
6166
6178
|
}
|
|
6167
|
-
const
|
|
6179
|
+
const k = te(
|
|
6168
6180
|
(((oi = p.value.variant) == null ? void 0 : oi.variantCombinations) || []).some(
|
|
6169
6181
|
(X) => !!X.price || !!X.orderFrom || !!X.code
|
|
6170
6182
|
)
|
|
@@ -6219,7 +6231,7 @@ const ds = {
|
|
|
6219
6231
|
});
|
|
6220
6232
|
}
|
|
6221
6233
|
const E = te(!!p.value.print);
|
|
6222
|
-
function
|
|
6234
|
+
function W(X) {
|
|
6223
6235
|
X || (p.value = { ...p.value, print: void 0 });
|
|
6224
6236
|
}
|
|
6225
6237
|
const Z = te(
|
|
@@ -6245,7 +6257,7 @@ const ds = {
|
|
|
6245
6257
|
Re(() => {
|
|
6246
6258
|
var X;
|
|
6247
6259
|
return (X = p.value.price) == null ? void 0 : X.amount;
|
|
6248
|
-
},
|
|
6260
|
+
}, K, { deep: !0 }), Re(
|
|
6249
6261
|
() => d.value,
|
|
6250
6262
|
(X) => {
|
|
6251
6263
|
X && (p.value = t.initialForm ? ue(t.initialForm) : {
|
|
@@ -6254,7 +6266,7 @@ const ds = {
|
|
|
6254
6266
|
});
|
|
6255
6267
|
}
|
|
6256
6268
|
), at(() => {
|
|
6257
|
-
|
|
6269
|
+
K();
|
|
6258
6270
|
try {
|
|
6259
6271
|
o.pushDataLayer(
|
|
6260
6272
|
{
|
|
@@ -6283,7 +6295,7 @@ const ds = {
|
|
|
6283
6295
|
}), n(
|
|
6284
6296
|
"submit:form",
|
|
6285
6297
|
En(ue(p.value), U.value),
|
|
6286
|
-
|
|
6298
|
+
f.value
|
|
6287
6299
|
), c(), oe();
|
|
6288
6300
|
}
|
|
6289
6301
|
function ge() {
|
|
@@ -6310,7 +6322,7 @@ const ds = {
|
|
|
6310
6322
|
onOnCancel: ge
|
|
6311
6323
|
}, {
|
|
6312
6324
|
"append-title": V(() => [
|
|
6313
|
-
h(ze)("sm") ? (A(),
|
|
6325
|
+
h(ze)("sm") ? (A(), H(gi, {
|
|
6314
6326
|
key: 0,
|
|
6315
6327
|
variant: "dialog",
|
|
6316
6328
|
title: w.value.title,
|
|
@@ -6320,7 +6332,7 @@ const ds = {
|
|
|
6320
6332
|
default: V(() => {
|
|
6321
6333
|
var pe, fe;
|
|
6322
6334
|
return [
|
|
6323
|
-
h(ze)("sm") ? ie("", !0) : (A(),
|
|
6335
|
+
h(ze)("sm") ? ie("", !0) : (A(), H(gi, {
|
|
6324
6336
|
key: 0,
|
|
6325
6337
|
class: "fixed",
|
|
6326
6338
|
style: xn({
|
|
@@ -6337,9 +6349,9 @@ const ds = {
|
|
|
6337
6349
|
ref: re,
|
|
6338
6350
|
class: Fe(["flex-1 py-24 space-y-24", "xs:w-full"])
|
|
6339
6351
|
}, [
|
|
6340
|
-
|
|
6352
|
+
v.value && (Object.keys(v.value.catalogs || {}).length > 0 || v.value.schedulers.length > 0) ? (A(), H(fo, {
|
|
6341
6353
|
key: 0,
|
|
6342
|
-
"linked-status":
|
|
6354
|
+
"linked-status": v.value,
|
|
6343
6355
|
"onUpdate:catalogAndScheduler": y
|
|
6344
6356
|
}, null, 8, ["linked-status"])) : ie("", !0),
|
|
6345
6357
|
g(Bn, { "menu-store": h(a) }, null, 8, ["menu-store"]),
|
|
@@ -6357,19 +6369,19 @@ const ds = {
|
|
|
6357
6369
|
g(Ya, {
|
|
6358
6370
|
fallback: m.value,
|
|
6359
6371
|
form: p.value,
|
|
6360
|
-
"is-addon":
|
|
6372
|
+
"is-addon": j.value,
|
|
6361
6373
|
"is-override": U.value,
|
|
6362
6374
|
"is-create": t.action === "add",
|
|
6363
|
-
thumbnail:
|
|
6364
|
-
"onUpdate:form":
|
|
6365
|
-
"onUpdate:thumbnail": G[0] || (G[0] = (J) =>
|
|
6375
|
+
thumbnail: f.value,
|
|
6376
|
+
"onUpdate:form": C,
|
|
6377
|
+
"onUpdate:thumbnail": G[0] || (G[0] = (J) => f.value = J),
|
|
6366
6378
|
"onReset:thumbnail": I
|
|
6367
6379
|
}, null, 8, ["fallback", "form", "is-addon", "is-override", "is-create", "thumbnail"])
|
|
6368
6380
|
]),
|
|
6369
6381
|
_: 1
|
|
6370
6382
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
6371
6383
|
U.value ? ie("", !0) : (A(), ne("div", Ms)),
|
|
6372
|
-
M.value ? (A(),
|
|
6384
|
+
M.value ? (A(), H(Ge, {
|
|
6373
6385
|
key: 2,
|
|
6374
6386
|
title: h(r)("menu.product.form.sections.tagging.title"),
|
|
6375
6387
|
"sub-title": h(r)("menu.product.form.sections.tagging.subtitle")
|
|
@@ -6378,8 +6390,8 @@ const ds = {
|
|
|
6378
6390
|
g(h(Di), {
|
|
6379
6391
|
entity: "item",
|
|
6380
6392
|
"model-value": p.value.customAttributes || {},
|
|
6381
|
-
"onUpdate:modelValue": G[3] || (G[3] = (J) =>
|
|
6382
|
-
"value-options":
|
|
6393
|
+
"onUpdate:modelValue": G[3] || (G[3] = (J) => C("customAttributes", J)),
|
|
6394
|
+
"value-options": x.value
|
|
6383
6395
|
}, null, 8, ["model-value", "value-options"])
|
|
6384
6396
|
]),
|
|
6385
6397
|
_: 1
|
|
@@ -6399,20 +6411,20 @@ const ds = {
|
|
|
6399
6411
|
g(Jr, {
|
|
6400
6412
|
fallback: m.value,
|
|
6401
6413
|
form: p.value,
|
|
6402
|
-
"is-addon":
|
|
6414
|
+
"is-addon": j.value,
|
|
6403
6415
|
"is-override": U.value,
|
|
6404
|
-
"onUpdate:form":
|
|
6416
|
+
"onUpdate:form": C
|
|
6405
6417
|
}, null, 8, ["fallback", "form", "is-addon", "is-override"])
|
|
6406
6418
|
]),
|
|
6407
6419
|
_: 1
|
|
6408
6420
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
6409
6421
|
s.value.print && !U.value ? (A(), ne("div", Fs)) : ie("", !0),
|
|
6410
|
-
s.value.print ? (A(),
|
|
6422
|
+
s.value.print ? (A(), H(Je, {
|
|
6411
6423
|
key: 5,
|
|
6412
6424
|
toggle: E.value,
|
|
6413
6425
|
"onUpdate:toggle": [
|
|
6414
6426
|
G[7] || (G[7] = (J) => E.value = J),
|
|
6415
|
-
G[8] || (G[8] = (J) =>
|
|
6427
|
+
G[8] || (G[8] = (J) => W(J))
|
|
6416
6428
|
],
|
|
6417
6429
|
description: "Use a different print setting",
|
|
6418
6430
|
disabled: "",
|
|
@@ -6423,9 +6435,9 @@ const ds = {
|
|
|
6423
6435
|
fallback: m.value,
|
|
6424
6436
|
form: p.value,
|
|
6425
6437
|
"full-combinations": _.value,
|
|
6426
|
-
"is-addon":
|
|
6438
|
+
"is-addon": j.value,
|
|
6427
6439
|
"is-override": U.value,
|
|
6428
|
-
"onUpdate:form":
|
|
6440
|
+
"onUpdate:form": C,
|
|
6429
6441
|
"onReplace:form": G[6] || (G[6] = (J) => p.value = J)
|
|
6430
6442
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6431
6443
|
]),
|
|
@@ -6433,9 +6445,9 @@ const ds = {
|
|
|
6433
6445
|
}, 8, ["toggle"])) : ie("", !0),
|
|
6434
6446
|
U.value ? ie("", !0) : (A(), ne("div", zs)),
|
|
6435
6447
|
g(Je, {
|
|
6436
|
-
toggle:
|
|
6448
|
+
toggle: k.value,
|
|
6437
6449
|
"onUpdate:toggle": [
|
|
6438
|
-
G[10] || (G[10] = (J) =>
|
|
6450
|
+
G[10] || (G[10] = (J) => k.value = J),
|
|
6439
6451
|
G[11] || (G[11] = (J) => F(J))
|
|
6440
6452
|
],
|
|
6441
6453
|
disabled: !U.value,
|
|
@@ -6447,16 +6459,16 @@ const ds = {
|
|
|
6447
6459
|
fallback: m.value,
|
|
6448
6460
|
form: p.value,
|
|
6449
6461
|
"full-combinations": _.value,
|
|
6450
|
-
"is-addon":
|
|
6462
|
+
"is-addon": j.value,
|
|
6451
6463
|
"is-override": U.value,
|
|
6452
|
-
"onUpdate:form":
|
|
6464
|
+
"onUpdate:form": C,
|
|
6453
6465
|
"onReplace:form": G[9] || (G[9] = (J) => p.value = J)
|
|
6454
6466
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6455
6467
|
]),
|
|
6456
6468
|
_: 1
|
|
6457
6469
|
}, 8, ["toggle", "disabled", "description", "title"]),
|
|
6458
6470
|
s.value.group && !U.value ? (A(), ne("div", Is)) : ie("", !0),
|
|
6459
|
-
s.value.group ? (A(),
|
|
6471
|
+
s.value.group ? (A(), H(Je, {
|
|
6460
6472
|
key: 8,
|
|
6461
6473
|
toggle: Z.value,
|
|
6462
6474
|
"onUpdate:toggle": [
|
|
@@ -6472,16 +6484,16 @@ const ds = {
|
|
|
6472
6484
|
fallback: m.value,
|
|
6473
6485
|
form: p.value,
|
|
6474
6486
|
"full-combinations": _.value,
|
|
6475
|
-
"is-addon":
|
|
6487
|
+
"is-addon": j.value,
|
|
6476
6488
|
"is-override": U.value,
|
|
6477
|
-
"onUpdate:form":
|
|
6489
|
+
"onUpdate:form": C,
|
|
6478
6490
|
"onReplace:form": G[12] || (G[12] = (J) => p.value = J)
|
|
6479
6491
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6480
6492
|
]),
|
|
6481
6493
|
_: 1
|
|
6482
6494
|
}, 8, ["toggle", "disabled"])) : ie("", !0),
|
|
6483
6495
|
s.value.inventory && !U.value ? (A(), ne("div", Es)) : ie("", !0),
|
|
6484
|
-
s.value.inventory ? (A(),
|
|
6496
|
+
s.value.inventory ? (A(), H(Je, {
|
|
6485
6497
|
key: 10,
|
|
6486
6498
|
toggle: T.value,
|
|
6487
6499
|
"onUpdate:toggle": [
|
|
@@ -6497,16 +6509,16 @@ const ds = {
|
|
|
6497
6509
|
fallback: m.value,
|
|
6498
6510
|
form: p.value,
|
|
6499
6511
|
"full-combinations": _.value,
|
|
6500
|
-
"is-addon":
|
|
6512
|
+
"is-addon": j.value,
|
|
6501
6513
|
"is-override": U.value,
|
|
6502
|
-
"onUpdate:form":
|
|
6514
|
+
"onUpdate:form": C,
|
|
6503
6515
|
"onReplace:form": G[15] || (G[15] = (J) => p.value = J)
|
|
6504
6516
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6505
6517
|
]),
|
|
6506
6518
|
_: 1
|
|
6507
6519
|
}, 8, ["toggle", "disabled", "description", "title"])) : ie("", !0),
|
|
6508
6520
|
s.value.takeaway(p.value.category ?? ((pe = m.value) == null ? void 0 : pe.category)) && !U.value ? (A(), ne("div", Ts)) : ie("", !0),
|
|
6509
|
-
s.value.takeaway(p.value.category ?? ((fe = m.value) == null ? void 0 : fe.category)) ? (A(),
|
|
6521
|
+
s.value.takeaway(p.value.category ?? ((fe = m.value) == null ? void 0 : fe.category)) ? (A(), H(Je, {
|
|
6510
6522
|
key: 12,
|
|
6511
6523
|
toggle: ae.value,
|
|
6512
6524
|
"onUpdate:toggle": [
|
|
@@ -6522,9 +6534,9 @@ const ds = {
|
|
|
6522
6534
|
fallback: m.value,
|
|
6523
6535
|
form: p.value,
|
|
6524
6536
|
"full-combinations": _.value,
|
|
6525
|
-
"is-addon":
|
|
6537
|
+
"is-addon": j.value,
|
|
6526
6538
|
"is-override": U.value,
|
|
6527
|
-
"onUpdate:form":
|
|
6539
|
+
"onUpdate:form": C,
|
|
6528
6540
|
"onReplace:form": G[18] || (G[18] = (J) => p.value = J)
|
|
6529
6541
|
}, null, 8, ["fallback", "form", "full-combinations", "is-addon", "is-override"])
|
|
6530
6542
|
]),
|
|
@@ -6544,24 +6556,24 @@ function vn(e, i) {
|
|
|
6544
6556
|
var o, r, l, s;
|
|
6545
6557
|
const t = (o = i.groups) == null ? void 0 : o.reduce((u, d) => {
|
|
6546
6558
|
const c = e.groups.find((p) => p._id === d._id);
|
|
6547
|
-
return xt(e.items, c.items) ===
|
|
6559
|
+
return xt(e.items, c.items) === Y.F_ADDON_GROUP_TYPE.enum.DYNAMIC && u.push(c), u;
|
|
6548
6560
|
}, []);
|
|
6549
6561
|
if (!(t != null && t.length)) return i;
|
|
6550
6562
|
const n = t.map((u) => u._id);
|
|
6551
6563
|
function a(u) {
|
|
6552
6564
|
const d = t.map((c) => {
|
|
6553
|
-
var
|
|
6554
|
-
const m = u.find((b) => b._id === c._id), p = (
|
|
6565
|
+
var v;
|
|
6566
|
+
const m = u.find((b) => b._id === c._id), p = (v = c.items) == null ? void 0 : v.map((b) => {
|
|
6555
6567
|
var _;
|
|
6556
6568
|
const y = (_ = m == null ? void 0 : m.items) == null ? void 0 : _.find(
|
|
6557
|
-
(
|
|
6569
|
+
(f) => f._id === b._id && f.combinationKey == b.combinationKey
|
|
6558
6570
|
);
|
|
6559
6571
|
return {
|
|
6560
6572
|
...y || {},
|
|
6561
6573
|
_id: b._id,
|
|
6562
6574
|
combinationKey: b.combinationKey,
|
|
6563
6575
|
price: (y == null ? void 0 : y.price) ?? xe.Dinero.zero().toObject(),
|
|
6564
|
-
orderFrom: (y == null ? void 0 : y.orderFrom) ??
|
|
6576
|
+
orderFrom: (y == null ? void 0 : y.orderFrom) ?? Y.F_ORDER_FROM.enum.ALL
|
|
6565
6577
|
};
|
|
6566
6578
|
});
|
|
6567
6579
|
return {
|
|
@@ -6587,10 +6599,10 @@ function vn(e, i) {
|
|
|
6587
6599
|
function Vs(e, i, t, n) {
|
|
6588
6600
|
const a = ue(i), o = t ? a.modules.catalog.find((m) => m._id === t) : null, r = n ? a.modules.scheduler.find((m) => m._id === n) : null, l = o ? ue(o) : void 0, s = t ? a.modules.catalog.filter((m) => m._id !== t) : [], u = r ? ue(r) : void 0, d = e.reduce((m, p) => (m[p._id] = Us(p), m), {});
|
|
6589
6601
|
function c(m = []) {
|
|
6590
|
-
const p = e.map((
|
|
6602
|
+
const p = e.map((v) => v._id);
|
|
6591
6603
|
return [
|
|
6592
|
-
...m.filter((
|
|
6593
|
-
...Object.values(d).flatMap((
|
|
6604
|
+
...m.filter((v) => !p.includes(v._id)),
|
|
6605
|
+
...Object.values(d).flatMap((v) => v)
|
|
6594
6606
|
];
|
|
6595
6607
|
}
|
|
6596
6608
|
return l && n ? (l.override.scheduler = {
|
|
@@ -6600,7 +6612,7 @@ function Vs(e, i, t, n) {
|
|
|
6600
6612
|
_id: n,
|
|
6601
6613
|
items: c(u == null ? void 0 : u.items).map((m) => ({
|
|
6602
6614
|
...m,
|
|
6603
|
-
orderFrom:
|
|
6615
|
+
orderFrom: Y.F_ORDER_FROM.enum.ALL
|
|
6604
6616
|
}))
|
|
6605
6617
|
}
|
|
6606
6618
|
}, a.modules.catalog = [...s, l], a) : l ? (l.override.items = {
|
|
@@ -6678,9 +6690,9 @@ const ni = Oi("item-manager", () => {
|
|
|
6678
6690
|
}
|
|
6679
6691
|
async function d(M) {
|
|
6680
6692
|
var S;
|
|
6681
|
-
const D = e.currentCatalog, I = e.state.currentSchedulerId, w = D.override.scheduler[I] ?? {}, R = (S = w == null ? void 0 : w.items) == null ? void 0 : S.filter((
|
|
6682
|
-
await u(M, R, async (
|
|
6683
|
-
const $ =
|
|
6693
|
+
const D = e.currentCatalog, I = e.state.currentSchedulerId, w = D.override.scheduler[I] ?? {}, R = (S = w == null ? void 0 : w.items) == null ? void 0 : S.filter((x) => x._id === M._id);
|
|
6694
|
+
await u(M, R, async (x) => {
|
|
6695
|
+
const $ = x.modules.catalog.find(
|
|
6684
6696
|
(B) => B._id === D._id
|
|
6685
6697
|
);
|
|
6686
6698
|
await new We($, e, a.updateMenu, t).update();
|
|
@@ -6708,10 +6720,10 @@ const ni = Oi("item-manager", () => {
|
|
|
6708
6720
|
}
|
|
6709
6721
|
async function p(M) {
|
|
6710
6722
|
var R, S;
|
|
6711
|
-
const D = e.state.currentSchedulerId, I = ue(e.currentCatalog), w = (S = ((R = I.override.scheduler[D]) == null ? void 0 : R.items) || []) == null ? void 0 : S.reduce((
|
|
6712
|
-
if ($.combinationKey) return [...
|
|
6713
|
-
const B = M.find((
|
|
6714
|
-
return B ? [...
|
|
6723
|
+
const D = e.state.currentSchedulerId, I = ue(e.currentCatalog), w = (S = ((R = I.override.scheduler[D]) == null ? void 0 : R.items) || []) == null ? void 0 : S.reduce((x, $) => {
|
|
6724
|
+
if ($.combinationKey) return [...x, $];
|
|
6725
|
+
const B = M.find((k) => k._id === $._id);
|
|
6726
|
+
return B ? [...x, { ...$, price: B.price }] : [...x, $];
|
|
6715
6727
|
}, []);
|
|
6716
6728
|
I.override.scheduler = {
|
|
6717
6729
|
...I.override.scheduler,
|
|
@@ -6722,22 +6734,22 @@ const ni = Oi("item-manager", () => {
|
|
|
6722
6734
|
}
|
|
6723
6735
|
}, await new We(I, e, a.updateMenu, t).update();
|
|
6724
6736
|
}
|
|
6725
|
-
async function
|
|
6737
|
+
async function v(M) {
|
|
6726
6738
|
var R;
|
|
6727
6739
|
const D = ue(e.currentCatalog), I = (R = Object.entries(D.override.items)) == null ? void 0 : R.reduce(
|
|
6728
|
-
(S, [
|
|
6729
|
-
const B = M.find((F) => F._id ===
|
|
6740
|
+
(S, [x, $]) => {
|
|
6741
|
+
const B = M.find((F) => F._id === x);
|
|
6730
6742
|
if (!B)
|
|
6731
|
-
return S[
|
|
6732
|
-
const
|
|
6733
|
-
return S[
|
|
6743
|
+
return S[x] = $, S;
|
|
6744
|
+
const k = $.find((F) => !F.combinationKey);
|
|
6745
|
+
return S[x] = [
|
|
6734
6746
|
...$.filter((F) => !!F.combinationKey),
|
|
6735
6747
|
{
|
|
6736
|
-
...
|
|
6748
|
+
...k,
|
|
6737
6749
|
code: B.code || void 0,
|
|
6738
6750
|
name: B.name,
|
|
6739
6751
|
price: B.price,
|
|
6740
|
-
orderFrom: B.orderFrom ??
|
|
6752
|
+
orderFrom: B.orderFrom ?? k.orderFrom
|
|
6741
6753
|
}
|
|
6742
6754
|
], S;
|
|
6743
6755
|
},
|
|
@@ -6759,7 +6771,7 @@ const ni = Oi("item-manager", () => {
|
|
|
6759
6771
|
async function b(M) {
|
|
6760
6772
|
const D = ue(e.currentScheduler), I = D.items.reduce((w, R) => {
|
|
6761
6773
|
if (R.combinationKey) return [...w, R];
|
|
6762
|
-
const S = M.find((
|
|
6774
|
+
const S = M.find((x) => x._id === R._id);
|
|
6763
6775
|
return S ? [...w, { ...R, price: S.price }] : [...w, R];
|
|
6764
6776
|
}, []);
|
|
6765
6777
|
await new _t(
|
|
@@ -6774,7 +6786,7 @@ const ni = Oi("item-manager", () => {
|
|
|
6774
6786
|
}
|
|
6775
6787
|
async function y(M) {
|
|
6776
6788
|
const D = M.reduce((w, R) => {
|
|
6777
|
-
const S = e.items.find((
|
|
6789
|
+
const S = e.items.find((x) => x._id === R._id);
|
|
6778
6790
|
return S && w.push({
|
|
6779
6791
|
...S,
|
|
6780
6792
|
code: R.code ?? S.code,
|
|
@@ -6789,7 +6801,7 @@ const ni = Oi("item-manager", () => {
|
|
|
6789
6801
|
}, []), { updateMenu: I } = a;
|
|
6790
6802
|
await I(
|
|
6791
6803
|
D.map((w) => ({
|
|
6792
|
-
module:
|
|
6804
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.item,
|
|
6793
6805
|
operation: ke.F_OPERATION_TYPE.update,
|
|
6794
6806
|
data: w
|
|
6795
6807
|
})),
|
|
@@ -6807,17 +6819,17 @@ const ni = Oi("item-manager", () => {
|
|
|
6807
6819
|
}
|
|
6808
6820
|
});
|
|
6809
6821
|
}
|
|
6810
|
-
async function
|
|
6822
|
+
async function f(M) {
|
|
6811
6823
|
const D = e.state.menu.modules.item.find((I) => I._id === M);
|
|
6812
6824
|
e.currentCatalog ? e.state.currentSchedulerId ? await d(D) : await c(D) : e.state.currentSchedulerId ? await m(D) : _(D);
|
|
6813
6825
|
}
|
|
6814
|
-
async function
|
|
6815
|
-
e.currentCatalog ? e.currentScheduler ? await p(M) : await
|
|
6826
|
+
async function C(M) {
|
|
6827
|
+
e.currentCatalog ? e.currentScheduler ? await p(M) : await v(M) : (
|
|
6816
6828
|
// If Main
|
|
6817
6829
|
e.currentScheduler ? await b(M) : await y(M)
|
|
6818
6830
|
);
|
|
6819
6831
|
}
|
|
6820
|
-
function
|
|
6832
|
+
function K(M) {
|
|
6821
6833
|
const { updateMenu: D } = a, I = M.length > 1 ? `${M.length} products` : M[0].name;
|
|
6822
6834
|
t.open({
|
|
6823
6835
|
title: r("menu.common.dialog.remove.product.title"),
|
|
@@ -6834,7 +6846,7 @@ const ni = Oi("item-manager", () => {
|
|
|
6834
6846
|
}).onPrimary(async () => {
|
|
6835
6847
|
await D(
|
|
6836
6848
|
M.map(({ _id: w }) => ({
|
|
6837
|
-
module:
|
|
6849
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.item,
|
|
6838
6850
|
operation: ke.F_OPERATION_TYPE.delete,
|
|
6839
6851
|
data: w
|
|
6840
6852
|
})),
|
|
@@ -6860,13 +6872,13 @@ const ni = Oi("item-manager", () => {
|
|
|
6860
6872
|
e,
|
|
6861
6873
|
a.updateMenu,
|
|
6862
6874
|
t
|
|
6863
|
-
).unlinkProduct(M.map((D) => D._id)) :
|
|
6875
|
+
).unlinkProduct(M.map((D) => D._id)) : K(M);
|
|
6864
6876
|
}
|
|
6865
|
-
async function
|
|
6877
|
+
async function j(M) {
|
|
6866
6878
|
const { updateMenu: D } = a;
|
|
6867
6879
|
await D(
|
|
6868
6880
|
{
|
|
6869
|
-
module:
|
|
6881
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.item,
|
|
6870
6882
|
operation: ke.F_OPERATION_TYPE.rearrange,
|
|
6871
6883
|
data: M
|
|
6872
6884
|
},
|
|
@@ -6876,10 +6888,10 @@ const ni = Oi("item-manager", () => {
|
|
|
6876
6888
|
return {
|
|
6877
6889
|
initDynamicGroupItem: (M) => vn(e, M),
|
|
6878
6890
|
create: s,
|
|
6879
|
-
update:
|
|
6880
|
-
updateMany:
|
|
6891
|
+
update: f,
|
|
6892
|
+
updateMany: C,
|
|
6881
6893
|
deleteItem: U,
|
|
6882
|
-
rearrange:
|
|
6894
|
+
rearrange: j
|
|
6883
6895
|
};
|
|
6884
6896
|
});
|
|
6885
6897
|
export {
|