@feedmepos/mf-menu 0.31.57-prod → 0.31.58-prod
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-BWnYrgSU.js → App-CEwyPSKB.js} +8 -8
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-Cablfr4b.js → ApplyProduct.vue_vue_type_script_setup_true_lang-B1PaP0os.js} +3 -3
- package/dist/{Catalog-0-s4Hs5O.js → Catalog-CrgKBjTt.js} +6 -6
- package/dist/{Category-CDOTTdYz.js → Category-Brt03UVR.js} +4 -4
- package/dist/{Category-BF40su4h.js → Category-Do3tDNNq.js} +6 -6
- package/dist/{CookingGuide-BdjDObjP.js → CookingGuide-DtkAi9bK.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-QnzOuwOb.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-8ObJv2LZ.js} +1 -1
- package/dist/{Group-BnRpzm_K.js → Group-CX1rH4Ba.js} +1 -1
- package/dist/{Group-D292KrzI.js → Group-gQPAHr2A.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-B7Ms48v5.js → Group.vue_vue_type_script_setup_true_lang-DWVGPzwc.js} +7 -7
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-4j-PyUrF.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-PQJm4GbD.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Bx93YqHv.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DLVjK7wR.js} +4107 -4075
- package/dist/{Ingredient-BBT7zzIm.js → Ingredient-_nl97wdl.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-BojJh80b.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DAO5hp3N.js} +2 -2
- package/dist/{LinkProductSideSheet-CQECcvWg.js → LinkProductSideSheet-0p5Z66Ua.js} +3 -3
- package/dist/{MenuSetting-C8PBPHOv.js → MenuSetting-CHOMVwXS.js} +5 -5
- package/dist/{PrintRoute-dTkMyEHm.js → PrintRoute-PR9yqoD5.js} +4 -4
- package/dist/{Product-Dkzq_6Cz.js → Product-D74PpxCy.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-CVUCY68d.js → Product.vue_vue_type_script_setup_true_lang-CW6W8Ros.js} +13 -13
- package/dist/{ProductInternalTools-Cv0xS7du.js → ProductInternalTools-BH4Rtb8s.js} +5 -5
- package/dist/{Products-DM8IW9Jn.js → Products-BoP_Sfwi.js} +248 -234
- package/dist/{Publish-Bv3JoNMU.js → Publish-B82vhm2_.js} +3 -3
- package/dist/{Recipe-9ROHWlwr.js → Recipe-C8KXjAzg.js} +4 -4
- package/dist/{Scheduler-BJUOJYhh.js → Scheduler-CkAclfQw.js} +3 -3
- package/dist/{ServingSequence-CNnGYksh.js → ServingSequence-BlUDI5uT.js} +3 -3
- package/dist/{Setting-79njp0t2.js → Setting-B7jaIIPx.js} +5 -5
- package/dist/{Subcategory-Bijs3Olt.js → Subcategory-ZoTKyleD.js} +4 -4
- package/dist/{Takeaway-BztOhncW.js → Takeaway-bOnEUU7z.js} +1 -1
- package/dist/{Takeaway-CabdtF3Z.js → Takeaway-hSioiPLy.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CvXZJX0b.js → Takeaway.vue_vue_type_script_setup_true_lang-B5HjkmRS.js} +5 -5
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-DSuNtZkm.js → Thumbnail.vue_vue_type_script_setup_true_lang-SR02hz_g.js} +4 -4
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B2bjDghV.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D6_okQqi.js} +14 -14
- package/dist/{Unit-B0hRSazK.js → Unit-iVeouD8Q.js} +2 -2
- package/dist/{Variant-Khx4MvQ1.js → Variant-09Ayb-LB.js} +3 -3
- package/dist/{_id_-CejDAH9A.js → _id_-T4NFKO76.js} +10 -10
- package/dist/{app-BHhkNQJL.js → app-BeeqJ5ia.js} +1 -1
- package/dist/{app-r_PLzQPv.js → app-G1eIeNve.js} +26 -26
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +3 -0
- package/dist/apps/mf-menu/src/helper/menuExport.d.ts +5 -1
- package/dist/apps/mf-menu/src/helper/menuImport.d.ts +5 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{validate-menu-XSARGuLs.js → linked-status-D54oQ8ty.js} +7 -7
- package/dist/assets/{override-menu-D9Pp7JwO.js → override-menu-CTzTh4oF.js} +2 -2
- package/dist/assets/{linked-status-B6J14c_0.js → validate-menu-DEP4gzNo.js} +7 -7
- package/dist/{catalog-DJAomoNt.js → catalog-DireBPbe.js} +1 -1
- package/dist/{catalogSetting-CUNMIE44.js → catalogSetting-8687T4sf.js} +1 -1
- package/dist/{category-BQOeVhVK.js → category-CxZ7l7TH.js} +1 -1
- package/dist/{currency-B-jPRiWC.js → currency-C-x74Ihc.js} +1 -1
- package/dist/{customAttributes-BfGQfRtM.js → customAttributes-PLOo5TFF.js} +1 -1
- package/dist/{dayjs.min-B2n-XPGe.js → dayjs.min-D4oh6LGN.js} +1 -1
- package/dist/{index-BWa11nqo.js → index-B6y1Idp6.js} +3 -3
- package/dist/{index-Lc84U-0z.js → index-CWlWCkLQ.js} +1 -1
- package/dist/{index-B0YrxBOA.js → index-Deb8Se9C.js} +4 -4
- package/dist/{index-C7xEyPoA.js → index-Dr70dTcK.js} +1 -1
- package/dist/{item-Dg-056O8.js → item-8v-mL4Tk.js} +16 -16
- package/dist/{jszip.min-DIzwB7QO.js → jszip.min-BlCVvZNl.js} +2 -2
- package/dist/{menu-Bw7rj5bt.js → menu-CbIzWmhP.js} +4 -4
- package/dist/{menu-BghVVLGg.js → menu-DhH8YWvV.js} +1 -1
- package/dist/{menuV2-Big1rjS7.js → menuV2-B3QHrvzJ.js} +164 -164
- package/dist/{priceTier-icYK6X_C.js → priceTier-BHuvA89h.js} +1 -1
- package/dist/{scheduler-DKxyet-8.js → scheduler-PDDah5xR.js} +4 -4
- package/dist/{subcategory-YCdzS5hb.js → subcategory-B-usgK3T.js} +2 -2
- package/dist/{toExcel-DDiQLisy.js → toExcel-C6kSxe7z.js} +2 -2
- package/dist/{unit-BHpJzCJq.js → unit-CtG4RVnF.js} +2 -2
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
var le = Object.defineProperty;
|
|
2
2
|
var ue = (x, e, i) => e in x ? le(x, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : x[e] = i;
|
|
3
|
-
var
|
|
4
|
-
import { defineComponent as W, computed as S, ref as te, resolveComponent as
|
|
5
|
-
import { D as
|
|
6
|
-
import { m as R, A as P, f as
|
|
7
|
-
import { J as pe, F as fe } from "./jszip.min-
|
|
8
|
-
import { u as
|
|
9
|
-
import { useCoreStore as
|
|
10
|
-
import { useDialog as se, useDialogChild as
|
|
3
|
+
var K = (x, e, i) => ue(x, typeof e != "symbol" ? e + "" : e, i);
|
|
4
|
+
import { defineComponent as W, computed as S, ref as te, resolveComponent as V, createBlock as D, openBlock as E, unref as l, withCtx as I, createElementVNode as M, toDisplayString as oe, createVNode as _, createCommentVNode as ae, createElementBlock as j, Fragment as B } from "vue";
|
|
5
|
+
import { D as G } from "./dayjs.min-D4oh6LGN.js";
|
|
6
|
+
import { m as R, A as P, f as h, a as H, b as L, e as A, n as O, w as de } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-DLVjK7wR.js";
|
|
7
|
+
import { J as pe, F as fe } from "./jszip.min-BlCVvZNl.js";
|
|
8
|
+
import { u as re, G as ne, B as J, e as z, A as ie, D as be, H as q, I as X } from "./menu-CbIzWmhP.js";
|
|
9
|
+
import { useCoreStore as ge, useI18n as he } from "@feedmepos/mf-common";
|
|
10
|
+
import { useDialog as se, useDialogChild as ye, useSnackbar as ce, useBreakpoints as _e, FmButtonVariant as U, FmButtonColorThemeVariant as N } from "@feedmepos/ui-library";
|
|
11
11
|
import { _ as Y } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
12
12
|
import { _ as ke, a as Z } from "./BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js";
|
|
13
13
|
import { _ as ve } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
|
|
14
|
-
import { u as we, a as xe } from "./menu-
|
|
15
|
-
import { u as
|
|
16
|
-
import { _ as Q, a as
|
|
17
|
-
import { L as ee } from "./LinkProductSideSheet-
|
|
18
|
-
import { _ as Me } from "./TreeEditorOpenner.vue_vue_type_script_setup_true_lang-
|
|
19
|
-
import { u as Ie } from "./Thumbnail.vue_vue_type_script_setup_true_lang-
|
|
20
|
-
import { m as Ee } from "./toExcel-
|
|
14
|
+
import { u as we, a as xe } from "./menu-DhH8YWvV.js";
|
|
15
|
+
import { u as Ce } from "./item-8v-mL4Tk.js";
|
|
16
|
+
import { _ as Q, a as Fe } from "./Product.vue_vue_type_script_setup_true_lang-CW6W8Ros.js";
|
|
17
|
+
import { L as ee } from "./LinkProductSideSheet-0p5Z66Ua.js";
|
|
18
|
+
import { _ as Me } from "./TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D6_okQqi.js";
|
|
19
|
+
import { u as Ie } from "./Thumbnail.vue_vue_type_script_setup_true_lang-SR02hz_g.js";
|
|
20
|
+
import { m as Ee } from "./toExcel-C6kSxe7z.js";
|
|
21
21
|
const Te = { class: "space-y-24 mb-24" }, Se = ["innerHTML"], De = { class: "flex justify-end gap-8" }, Ne = /* @__PURE__ */ W({
|
|
22
22
|
__name: "ConfirmActionDialog",
|
|
23
23
|
props: {
|
|
@@ -26,34 +26,34 @@ const Te = { class: "space-y-24 mb-24" }, Se = ["innerHTML"], De = { class: "fle
|
|
|
26
26
|
message: { default: "To confirm your action, type <b>[[value]]</b> in the text field." }
|
|
27
27
|
},
|
|
28
28
|
setup(x) {
|
|
29
|
-
const e = x, i = S(() => e.message.replace("[[value]]", e.value)), a = te(""), t = se(), { emitAction:
|
|
30
|
-
return (
|
|
31
|
-
const
|
|
32
|
-
return E(), D(
|
|
33
|
-
"on-validation-success": () => l(
|
|
29
|
+
const e = x, i = S(() => e.message.replace("[[value]]", e.value)), a = te(""), t = se(), { emitAction: r } = ye();
|
|
30
|
+
return (n, o) => {
|
|
31
|
+
const m = V("FmTextField"), s = V("FmButton"), d = V("FmForm");
|
|
32
|
+
return E(), D(d, {
|
|
33
|
+
"on-validation-success": () => l(r)("primary"),
|
|
34
34
|
"blame-form-child-on-validation-failed": ""
|
|
35
35
|
}, {
|
|
36
36
|
default: I(() => [
|
|
37
37
|
M("div", Te, [
|
|
38
|
-
M("div", null, oe(
|
|
38
|
+
M("div", null, oe(n.description), 1),
|
|
39
39
|
M("div", { innerHTML: i.value }, null, 8, Se),
|
|
40
40
|
M("div", null, [
|
|
41
|
-
_(
|
|
41
|
+
_(m, {
|
|
42
42
|
modelValue: a.value,
|
|
43
43
|
"onUpdate:modelValue": [
|
|
44
|
-
o[0] || (o[0] = (
|
|
44
|
+
o[0] || (o[0] = (c) => a.value = c),
|
|
45
45
|
o[1] || (o[1] = () => {
|
|
46
46
|
})
|
|
47
47
|
],
|
|
48
|
-
placeholder:
|
|
49
|
-
rules: [(
|
|
48
|
+
placeholder: n.value,
|
|
49
|
+
rules: [(c) => c === n.value || "Value does not match"]
|
|
50
50
|
}, null, 8, ["modelValue", "placeholder", "rules"])
|
|
51
51
|
]),
|
|
52
52
|
M("div", De, [
|
|
53
53
|
_(s, {
|
|
54
54
|
label: "Cancel",
|
|
55
55
|
variant: "secondary",
|
|
56
|
-
onClick: o[2] || (o[2] = (
|
|
56
|
+
onClick: o[2] || (o[2] = (c) => l(t).close())
|
|
57
57
|
}),
|
|
58
58
|
_(s, {
|
|
59
59
|
label: "Confirm",
|
|
@@ -69,9 +69,9 @@ const Te = { class: "space-y-24 mb-24" }, Se = ["innerHTML"], De = { class: "fle
|
|
|
69
69
|
}), Ke = /* @__PURE__ */ W({
|
|
70
70
|
__name: "Migrate",
|
|
71
71
|
setup(x) {
|
|
72
|
-
const e =
|
|
72
|
+
const e = re(), i = ge(), a = ce(), { minor: t } = ne(a), r = te(!1), n = se();
|
|
73
73
|
async function o() {
|
|
74
|
-
|
|
74
|
+
m.value || r.value || n.open({
|
|
75
75
|
title: "Migrate to new version",
|
|
76
76
|
contentComponent: Ne,
|
|
77
77
|
contentComponentProps: {
|
|
@@ -79,14 +79,14 @@ const Te = { class: "space-y-24 mb-24" }, Se = ["innerHTML"], De = { class: "fle
|
|
|
79
79
|
description: "Do you want to migrate to new version? Once migrate it will unable to revert to the older version."
|
|
80
80
|
}
|
|
81
81
|
}).onPrimary(async () => {
|
|
82
|
-
|
|
82
|
+
n.close(), await t(
|
|
83
83
|
async () => {
|
|
84
84
|
await e.migrate(), setTimeout(() => {
|
|
85
85
|
window.location.reload();
|
|
86
86
|
}, 2e3);
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
|
-
isLoading:
|
|
89
|
+
isLoading: r,
|
|
90
90
|
customId: e.state.menu._id,
|
|
91
91
|
message: "Migrating menu",
|
|
92
92
|
successMessage: "Migration completed"
|
|
@@ -94,15 +94,15 @@ const Te = { class: "space-y-24 mb-24" }, Se = ["innerHTML"], De = { class: "fle
|
|
|
94
94
|
);
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
|
-
const
|
|
97
|
+
const m = S(() => {
|
|
98
98
|
const s = i.restaurants.value;
|
|
99
99
|
if (!s.length) return "Required at least one restaurant to migrate";
|
|
100
|
-
const
|
|
101
|
-
return
|
|
100
|
+
const d = s.filter((u) => !u.posVersion || !J.Pos.canUse({ feature: z.F_FEATURE.enum.menuV4, posVersion: u.posVersion }));
|
|
101
|
+
return d.length ? `Upgrade POS to V${J.Pos.minVersionToUse(z.F_FEATURE.enum.menuV4)} to use new menu: ${d.map((u) => u.profile.name).join(", ")}` : null;
|
|
102
102
|
});
|
|
103
|
-
return S(() =>
|
|
104
|
-
const
|
|
105
|
-
return !
|
|
103
|
+
return S(() => m.value ? m.value : "Migrate your menu to new version to enjoy more features. Content of new menu will remain the same as current."), (s, d) => {
|
|
104
|
+
const c = V("FmSnackbar");
|
|
105
|
+
return !m.value && l(e).version !== l(ie.F_MENU_VERSION).enum.v4 ? (E(), D(c, {
|
|
106
106
|
key: 0,
|
|
107
107
|
class: "!max-w-full",
|
|
108
108
|
title: "New version of menu is out now!",
|
|
@@ -117,25 +117,28 @@ const Te = { class: "space-y-24 mb-24" }, Se = ["innerHTML"], De = { class: "fle
|
|
|
117
117
|
});
|
|
118
118
|
class Ge {
|
|
119
119
|
constructor(e) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
K(this, "menu");
|
|
121
|
+
K(this, "categoryMap");
|
|
122
|
+
K(this, "takeawayMap");
|
|
123
|
+
K(this, "subCategoryMap");
|
|
124
|
+
this.menu = e, this.categoryMap = e.modules.category.reduce((a, t) => (a[t._id] = t, a), {}), this.takeawayMap = e.modules.takeaway.reduce((a, t) => (a[t._id] = t, a), {});
|
|
125
|
+
const i = e.modules.subCategory || [];
|
|
126
|
+
this.subCategoryMap = i.reduce((a, t) => (a[t._id] = t, a), {});
|
|
124
127
|
}
|
|
125
128
|
transformData() {
|
|
126
129
|
let e = [], i = [];
|
|
127
130
|
return this.menu.modules.item.forEach((a) => {
|
|
128
|
-
var
|
|
129
|
-
const t = a.variant ? R(this.menu, a.variant.variantGroupIds) : {},
|
|
130
|
-
(s,
|
|
131
|
-
const
|
|
131
|
+
var m;
|
|
132
|
+
const t = a.variant ? R(this.menu, a.variant.variantGroupIds) : {}, r = this.transformProductToDataRow(a, t), o = (((m = a.variant) == null ? void 0 : m.variantCombinations) ?? []).reduce(
|
|
133
|
+
(s, d) => {
|
|
134
|
+
const c = this.transformProductToDataRow(
|
|
132
135
|
a,
|
|
133
136
|
t,
|
|
134
|
-
|
|
137
|
+
d.combinationKey
|
|
135
138
|
);
|
|
136
|
-
return s.push(
|
|
139
|
+
return s.push(c), s;
|
|
137
140
|
},
|
|
138
|
-
[
|
|
141
|
+
[r]
|
|
139
142
|
);
|
|
140
143
|
i = [...i, ...o.flatMap((s) => Object.keys(s.tag))], e = [...e, ...o];
|
|
141
144
|
}), {
|
|
@@ -148,38 +151,38 @@ class Ge {
|
|
|
148
151
|
}
|
|
149
152
|
transformOverrideData(e) {
|
|
150
153
|
let i = [], a = [], t = [];
|
|
151
|
-
const
|
|
152
|
-
(
|
|
154
|
+
const r = e.reduce(
|
|
155
|
+
(n, o) => (n[o._id] || (n[o._id] = []), o.combinationKey && n[o._id].push(o.combinationKey), n),
|
|
153
156
|
{}
|
|
154
157
|
);
|
|
155
|
-
for (let
|
|
156
|
-
const o = e[
|
|
157
|
-
if (
|
|
158
|
-
const s =
|
|
158
|
+
for (let n = 0; n < e.length; n++) {
|
|
159
|
+
const o = e[n], m = this.menu.modules.item.find((s) => s._id === o._id);
|
|
160
|
+
if (m && m.variant) {
|
|
161
|
+
const s = m.variant.variantCombinations.map(
|
|
159
162
|
(p) => p.combinationKey
|
|
160
|
-
),
|
|
161
|
-
if (
|
|
162
|
-
const k =
|
|
163
|
-
(
|
|
163
|
+
), d = r[o._id] || [], c = s.filter((p) => !d.includes(p)), u = [];
|
|
164
|
+
if (c.forEach((p) => {
|
|
165
|
+
const k = m.variant.variantCombinations.find(
|
|
166
|
+
(g) => g.combinationKey === p
|
|
164
167
|
);
|
|
165
|
-
k && (
|
|
168
|
+
k && (u.push({
|
|
166
169
|
_id: o._id,
|
|
167
170
|
combinationKey: p,
|
|
168
171
|
price: k.price,
|
|
169
172
|
orderFrom: k.orderFrom
|
|
170
|
-
}),
|
|
171
|
-
}),
|
|
172
|
-
const p = e.findIndex((
|
|
173
|
-
e.splice(k, 0, ...
|
|
173
|
+
}), r[o._id].push(p));
|
|
174
|
+
}), u.length > 0) {
|
|
175
|
+
const p = e.findIndex((g) => g._id === o._id && !g.combinationKey), k = p >= 0 ? p + 1 : n + 1;
|
|
176
|
+
e.splice(k, 0, ...u), n += u.length;
|
|
174
177
|
}
|
|
175
178
|
}
|
|
176
179
|
}
|
|
177
|
-
for (let
|
|
178
|
-
const o = e[
|
|
179
|
-
if (!
|
|
180
|
+
for (let n = 0; n < e.length; n++) {
|
|
181
|
+
const o = e[n], m = this.menu.modules.item.find((u) => u._id === o._id);
|
|
182
|
+
if (!m)
|
|
180
183
|
throw new Error(`Invalid item ${o._id} in catalog`);
|
|
181
|
-
const s =
|
|
182
|
-
t = [...t, ...
|
|
184
|
+
const s = m.variant ? R(this.menu, m.variant.variantGroupIds) : {}, c = [this.transformOverrideDataToRow(o, s)];
|
|
185
|
+
t = [...t, ...c.flatMap((u) => Object.keys(u.priceTier))], a = [...a, ...c.flatMap((u) => Object.keys(u.tag))], i = [...i, ...c];
|
|
183
186
|
}
|
|
184
187
|
return {
|
|
185
188
|
rows: i,
|
|
@@ -189,71 +192,82 @@ class Ge {
|
|
|
189
192
|
}
|
|
190
193
|
};
|
|
191
194
|
}
|
|
195
|
+
getSubCategoryNames(e, i) {
|
|
196
|
+
return i || !e.subCategories ? "" : e.subCategories.map((a) => {
|
|
197
|
+
var t;
|
|
198
|
+
return ((t = this.subCategoryMap[a]) == null ? void 0 : t.name) || "";
|
|
199
|
+
}).filter((a) => a).join(",");
|
|
200
|
+
}
|
|
192
201
|
transformProductToDataRow(e, i, a) {
|
|
193
|
-
var
|
|
194
|
-
const t = (
|
|
195
|
-
(
|
|
202
|
+
var m, s, d;
|
|
203
|
+
const t = (m = e.variant) == null ? void 0 : m.variantCombinations.find(
|
|
204
|
+
(c) => c.combinationKey === a
|
|
196
205
|
);
|
|
197
206
|
if (a && !t)
|
|
198
207
|
throw new Error(`Invalid combination key ${a}`);
|
|
199
|
-
const
|
|
200
|
-
let
|
|
201
|
-
if (t ?
|
|
208
|
+
const r = e.category ? (s = this.categoryMap[e.category]) == null ? void 0 : s.name : P;
|
|
209
|
+
let n;
|
|
210
|
+
if (t ? n = t.takeawayUsed ? this.takeawayMap[t.takeawayUsed] : void 0 : n = e.takeawayUsed ? this.takeawayMap[e.takeawayUsed] : void 0, !r)
|
|
202
211
|
throw new Error(`Invalid category ${e.category}`);
|
|
212
|
+
const o = this.getSubCategoryNames(e, !!t);
|
|
203
213
|
return {
|
|
204
214
|
_id: e._id,
|
|
205
215
|
code: t && t.code || e.code,
|
|
206
216
|
name: e.name,
|
|
207
217
|
variantKey: (t == null ? void 0 : t.combinationKey) ?? "",
|
|
208
218
|
variantName: t ? i[t.combinationKey] : "",
|
|
209
|
-
category:
|
|
219
|
+
category: r,
|
|
220
|
+
subCategories: o,
|
|
210
221
|
orderFrom: t ? t.orderFrom ?? e.orderFrom : e.orderFrom,
|
|
211
222
|
perXUnit: e.perXUnit || "",
|
|
212
223
|
unit: e.unit || "",
|
|
213
224
|
openPrice: e.openPrice === !0 ? "T" : "",
|
|
214
|
-
price: t ? t.price ? parseFloat(
|
|
225
|
+
price: t ? t.price ? parseFloat(h(t.price)) : parseFloat(h(e.price)) : parseFloat(h(e.price)),
|
|
215
226
|
priceTier: e.priceTiers || {},
|
|
216
|
-
trackingCost: e.costing ? parseFloat(
|
|
217
|
-
minPrice: e.minPrice ? parseFloat(
|
|
218
|
-
groupByParent: ((
|
|
219
|
-
takeawayName: (
|
|
220
|
-
takeawayPrice:
|
|
227
|
+
trackingCost: e.costing ? parseFloat(h(e.costing)) : "",
|
|
228
|
+
minPrice: e.minPrice ? parseFloat(h(e.minPrice)) : "",
|
|
229
|
+
groupByParent: ((d = e.print) == null ? void 0 : d.toRoot) === !0 ? "" : "T",
|
|
230
|
+
takeawayName: (n == null ? void 0 : n.name) || "",
|
|
231
|
+
takeawayPrice: n != null && n.price ? parseFloat(h(n == null ? void 0 : n.price)) : "",
|
|
221
232
|
tag: e.customAttributes || {}
|
|
222
233
|
};
|
|
223
234
|
}
|
|
224
235
|
transformOverrideDataToRow(e, i, a) {
|
|
225
|
-
var
|
|
226
|
-
const t = this.menu.modules.item.find((
|
|
236
|
+
var s, d;
|
|
237
|
+
const t = this.menu.modules.item.find((c) => c._id === e._id);
|
|
227
238
|
if (!t)
|
|
228
239
|
throw new Error(`Invalid item ${e._id} in catelog`);
|
|
229
|
-
const
|
|
230
|
-
(
|
|
240
|
+
const r = (s = t.variant) == null ? void 0 : s.variantCombinations.find(
|
|
241
|
+
(c) => c.combinationKey === e.combinationKey
|
|
231
242
|
);
|
|
232
|
-
if (a && !
|
|
243
|
+
if (a && !r)
|
|
233
244
|
throw new Error(`Invalid combination key ${a}`);
|
|
234
|
-
const
|
|
235
|
-
var
|
|
236
|
-
return e.category ? e.category ? (
|
|
245
|
+
const n = () => {
|
|
246
|
+
var c, u;
|
|
247
|
+
return e.category ? e.category ? (u = this.categoryMap[e.category]) == null ? void 0 : u.name : P : t.category ? (c = this.categoryMap[t.category]) == null ? void 0 : c.name : P;
|
|
237
248
|
};
|
|
238
249
|
let o;
|
|
239
|
-
|
|
250
|
+
r ? e.takeawayUsed ? o = e.takeawayUsed ? this.takeawayMap[e.takeawayUsed] : void 0 : o = r.takeawayUsed ? this.takeawayMap[r.takeawayUsed] : void 0 : e.takeawayUsed ? o = e.takeawayUsed ? this.takeawayMap[e.takeawayUsed] : void 0 : o = t.takeawayUsed ? this.takeawayMap[t.takeawayUsed] : void 0;
|
|
251
|
+
const m = this.getSubCategoryNames(t, !!r);
|
|
252
|
+
return {
|
|
240
253
|
_id: e._id,
|
|
241
|
-
code: e.code ? e.code :
|
|
254
|
+
code: e.code ? e.code : r && r.code || t.code,
|
|
242
255
|
name: t.name,
|
|
243
|
-
variantKey: e.combinationKey ? e.combinationKey : (
|
|
244
|
-
variantName:
|
|
245
|
-
category:
|
|
246
|
-
|
|
256
|
+
variantKey: e.combinationKey ? e.combinationKey : (r == null ? void 0 : r.combinationKey) ?? "",
|
|
257
|
+
variantName: r ? i[r.combinationKey] : "",
|
|
258
|
+
category: n(),
|
|
259
|
+
subCategories: m,
|
|
260
|
+
orderFrom: e.orderFrom ? e.orderFrom : r ? r.orderFrom ?? t.orderFrom : t.orderFrom,
|
|
247
261
|
perXUnit: t.perXUnit || "",
|
|
248
262
|
unit: t.unit || "",
|
|
249
263
|
openPrice: t.openPrice === !0 ? "T" : "",
|
|
250
|
-
price: e.price ? parseFloat(
|
|
264
|
+
price: e.price ? parseFloat(h(e.price)) : r ? r.price ? parseFloat(h(r.price)) : parseFloat(h(t.price)) : parseFloat(h(t.price)),
|
|
251
265
|
priceTier: t.priceTiers || {},
|
|
252
|
-
trackingCost: t.costing ? parseFloat(
|
|
253
|
-
minPrice: e.minPrice ? parseFloat(
|
|
254
|
-
groupByParent: ((
|
|
266
|
+
trackingCost: t.costing ? parseFloat(h(t.costing)) : "",
|
|
267
|
+
minPrice: e.minPrice ? parseFloat(h(e.minPrice)) : t.minPrice ? parseFloat(h(t.minPrice)) : "",
|
|
268
|
+
groupByParent: ((d = t.print) == null ? void 0 : d.toRoot) === !0 ? "" : "T",
|
|
255
269
|
takeawayName: (o == null ? void 0 : o.name) || "",
|
|
256
|
-
takeawayPrice: o != null && o.price ? parseFloat(
|
|
270
|
+
takeawayPrice: o != null && o.price ? parseFloat(h(o == null ? void 0 : o.price)) : "",
|
|
257
271
|
tag: t.customAttributes || {}
|
|
258
272
|
};
|
|
259
273
|
}
|
|
@@ -267,49 +281,49 @@ class Ge {
|
|
|
267
281
|
const i = this.menu.modules.group.map((t) => t._id), a = e.map((t) => t._id);
|
|
268
282
|
return i.forEach((t) => {
|
|
269
283
|
if (!a.includes(t)) {
|
|
270
|
-
const
|
|
284
|
+
const r = this.menu.modules.group.find((n) => n._id === t);
|
|
271
285
|
e.push({
|
|
272
|
-
...
|
|
286
|
+
...r,
|
|
273
287
|
groupKey: ""
|
|
274
288
|
});
|
|
275
289
|
}
|
|
276
|
-
}), e.sort((t,
|
|
277
|
-
const
|
|
278
|
-
if (!
|
|
290
|
+
}), e.sort((t, r) => i.indexOf(t._id) - i.indexOf(r._id)), e.flatMap((t) => {
|
|
291
|
+
const r = this.menu.modules.group.find((o) => o._id === t._id);
|
|
292
|
+
if (!r)
|
|
279
293
|
throw new Error("Invalid addon group id");
|
|
280
|
-
const
|
|
281
|
-
return
|
|
282
|
-
var
|
|
283
|
-
const s = this.menu.modules.item.find((
|
|
294
|
+
const n = {};
|
|
295
|
+
return r.items.map((o, m) => {
|
|
296
|
+
var g, w, C;
|
|
297
|
+
const s = this.menu.modules.item.find((y) => y._id === o._id);
|
|
284
298
|
if (!s)
|
|
285
299
|
throw new Error("Invalid item id");
|
|
286
|
-
let
|
|
287
|
-
o.combinationKey && (
|
|
288
|
-
(
|
|
300
|
+
let d;
|
|
301
|
+
o.combinationKey && (d = (g = s.variant) == null ? void 0 : g.variantCombinations.find(
|
|
302
|
+
(y) => y.combinationKey === o.combinationKey
|
|
289
303
|
));
|
|
290
|
-
const
|
|
291
|
-
(
|
|
292
|
-
),
|
|
304
|
+
const c = (w = t.items) == null ? void 0 : w.find(
|
|
305
|
+
(y) => y._id === o._id && y.combinationKey === o.combinationKey
|
|
306
|
+
), u = s.name, p = R(
|
|
293
307
|
this.menu,
|
|
294
|
-
((
|
|
295
|
-
), k = (
|
|
296
|
-
return o.name && !o.combinationKey && (
|
|
308
|
+
((C = s.variant) == null ? void 0 : C.variantGroupIds) ?? []
|
|
309
|
+
), k = (c == null ? void 0 : c.price) ?? o.price ?? (d == null ? void 0 : d.price) ?? s.price;
|
|
310
|
+
return o.name && !o.combinationKey && (n[o._id] = o.name), {
|
|
297
311
|
id: t._id,
|
|
298
|
-
name:
|
|
299
|
-
min:
|
|
300
|
-
max:
|
|
301
|
-
stackable:
|
|
312
|
+
name: r.name,
|
|
313
|
+
min: r.min,
|
|
314
|
+
max: r.max,
|
|
315
|
+
stackable: r.stackable === !0 ? "T" : "",
|
|
302
316
|
itemId: o._id,
|
|
303
317
|
itemCode: s.code || "",
|
|
304
|
-
itemName:
|
|
305
|
-
itemNameOverrider:
|
|
318
|
+
itemName: u,
|
|
319
|
+
itemNameOverrider: n[o._id] || "",
|
|
306
320
|
combinationKey: o.combinationKey ?? "",
|
|
307
321
|
combinationName: o.combinationKey ? p[o.combinationKey] : "",
|
|
308
|
-
price: parseFloat(
|
|
322
|
+
price: parseFloat(h(k)),
|
|
309
323
|
priceTier: o.priceTiers || {},
|
|
310
|
-
orderFrom: (
|
|
324
|
+
orderFrom: (c == null ? void 0 : c.orderFrom) ?? o.orderFrom ?? s.orderFrom ?? "ALL",
|
|
311
325
|
isDefault: o.isDefault === !0 ? "T" : "",
|
|
312
|
-
index:
|
|
326
|
+
index: m
|
|
313
327
|
};
|
|
314
328
|
});
|
|
315
329
|
});
|
|
@@ -317,18 +331,18 @@ class Ge {
|
|
|
317
331
|
mapAddonGroup(e) {
|
|
318
332
|
return e.flatMap((i) => {
|
|
319
333
|
let a = {};
|
|
320
|
-
return a = i.items.reduce((t,
|
|
321
|
-
var
|
|
322
|
-
const
|
|
323
|
-
if (!
|
|
334
|
+
return a = i.items.reduce((t, r) => (t[r._id] || r.name && !r.combinationKey && (t[r._id] = r.name), t), {}), i.items.map((t, r) => {
|
|
335
|
+
var d, c;
|
|
336
|
+
const n = this.menu.modules.item.find((u) => u._id === t._id);
|
|
337
|
+
if (!n)
|
|
324
338
|
throw new Error("Invalid item id");
|
|
325
339
|
let o;
|
|
326
|
-
t.combinationKey && (o = (
|
|
327
|
-
(
|
|
340
|
+
t.combinationKey && (o = (d = n.variant) == null ? void 0 : d.variantCombinations.find(
|
|
341
|
+
(u) => u.combinationKey === t.combinationKey
|
|
328
342
|
));
|
|
329
|
-
const
|
|
343
|
+
const m = t.price ?? (o == null ? void 0 : o.price) ?? n.price, s = R(
|
|
330
344
|
this.menu,
|
|
331
|
-
((
|
|
345
|
+
((c = n.variant) == null ? void 0 : c.variantGroupIds) ?? []
|
|
332
346
|
);
|
|
333
347
|
return {
|
|
334
348
|
id: i._id,
|
|
@@ -337,16 +351,16 @@ class Ge {
|
|
|
337
351
|
max: i.max,
|
|
338
352
|
stackable: i.stackable === !0 ? "T" : "",
|
|
339
353
|
itemId: t._id,
|
|
340
|
-
itemCode:
|
|
341
|
-
itemName:
|
|
354
|
+
itemCode: n.code || "",
|
|
355
|
+
itemName: n.name,
|
|
342
356
|
itemNameOverrider: a[t._id] || "",
|
|
343
357
|
combinationKey: t.combinationKey ?? "",
|
|
344
358
|
combinationName: t.combinationKey ? s[t.combinationKey] : "",
|
|
345
|
-
price: parseFloat(
|
|
359
|
+
price: parseFloat(h(m)),
|
|
346
360
|
priceTier: t.priceTiers || {},
|
|
347
|
-
orderFrom: t.orderFrom ??
|
|
361
|
+
orderFrom: t.orderFrom ?? n.orderFrom,
|
|
348
362
|
isDefault: t.isDefault === !0 ? "T" : "",
|
|
349
|
-
index:
|
|
363
|
+
index: r
|
|
350
364
|
};
|
|
351
365
|
});
|
|
352
366
|
});
|
|
@@ -371,52 +385,52 @@ class Ge {
|
|
|
371
385
|
exportToExcel() {
|
|
372
386
|
var k;
|
|
373
387
|
const e = [], { rows: i, metaData: a } = this.transformData();
|
|
374
|
-
a.priceTiers = ((k = this.menu.priceTierSettings) == null ? void 0 : k.map((
|
|
375
|
-
const t = i.map(({ priceTier:
|
|
376
|
-
const
|
|
388
|
+
a.priceTiers = ((k = this.menu.priceTierSettings) == null ? void 0 : k.map((g) => g.key)) || [];
|
|
389
|
+
const t = i.map(({ priceTier: g, tag: w, ...C }) => {
|
|
390
|
+
const y = Object.entries(C), F = y.findIndex(([b]) => b === "price");
|
|
377
391
|
return [
|
|
378
|
-
...
|
|
392
|
+
...y.slice(0, F + 1).map(([, b]) => b),
|
|
379
393
|
...a.priceTiers.map(
|
|
380
|
-
(
|
|
394
|
+
(b) => parseFloat(h(g[b])) || ""
|
|
381
395
|
),
|
|
382
|
-
...
|
|
383
|
-
...a.tags.map((
|
|
396
|
+
...y.slice(F + 1).map(([, b]) => b),
|
|
397
|
+
...a.tags.map((b) => w[b] || "")
|
|
384
398
|
];
|
|
385
|
-
}),
|
|
399
|
+
}), r = this.createWorkbookExcelJS(
|
|
386
400
|
t,
|
|
387
401
|
"Default Catalog",
|
|
388
402
|
this.exportCatalogToExcelExcelJS()
|
|
389
|
-
),
|
|
390
|
-
H(
|
|
391
|
-
const
|
|
392
|
-
const { index:
|
|
403
|
+
), n = r.worksheets[0];
|
|
404
|
+
H(n, a.tags, a.priceTiers), this.formatWorkbookCell(r);
|
|
405
|
+
const m = this.transformAddonGroup().map(({ priceTier: g, ...w }) => {
|
|
406
|
+
const { index: C, ...y } = w, F = Object.entries(y), b = F.findIndex(([f]) => f === "price");
|
|
393
407
|
return [
|
|
394
|
-
...
|
|
408
|
+
...F.slice(0, b + 1).map(([, f]) => f),
|
|
395
409
|
...a.priceTiers.map(
|
|
396
|
-
(f) => parseFloat(
|
|
410
|
+
(f) => parseFloat(h(g[f])) || ""
|
|
397
411
|
),
|
|
398
|
-
...
|
|
412
|
+
...F.slice(b + 1).map(([, f]) => f)
|
|
399
413
|
];
|
|
400
414
|
}), s = this.createWorkbookExcelJS(
|
|
401
|
-
|
|
415
|
+
m,
|
|
402
416
|
"Default AddonGroup",
|
|
403
417
|
this.exportCatalogAddonToExcelExcelJS()
|
|
404
|
-
),
|
|
405
|
-
L(
|
|
406
|
-
const
|
|
407
|
-
if (
|
|
408
|
-
|
|
409
|
-
const
|
|
410
|
-
if (!
|
|
411
|
-
const
|
|
412
|
-
|
|
418
|
+
), d = s.worksheets[0];
|
|
419
|
+
L(d, a.priceTiers), this.formatWorkbookCell(s);
|
|
420
|
+
const c = this.transformItemsLinkWithGroup(), u = Object.keys(c), p = new A.Workbook();
|
|
421
|
+
if (u.length > 0)
|
|
422
|
+
u.forEach((g, w) => {
|
|
423
|
+
const C = Object.values(c[g]), y = this.menu.modules.group.find((f) => f._id === g);
|
|
424
|
+
if (!y) throw new Error(`Group not found for id: ${g}`);
|
|
425
|
+
const F = O(`${w + 1}. ${y.name}`), b = p.addWorksheet(F);
|
|
426
|
+
b.columns = [
|
|
413
427
|
{ header: "Group ID", key: "groupId" },
|
|
414
428
|
{ header: "Item ID", key: "itemId" },
|
|
415
429
|
{ header: "Item Name", key: "itemName" },
|
|
416
430
|
{ header: "Default Catalog", key: "defaultCatalog" }
|
|
417
|
-
],
|
|
418
|
-
|
|
419
|
-
groupId:
|
|
431
|
+
], C.forEach((f) => {
|
|
432
|
+
b.addRow({
|
|
433
|
+
groupId: g,
|
|
420
434
|
itemId: f.itemId,
|
|
421
435
|
itemName: f.itemName,
|
|
422
436
|
defaultCatalog: f.defaultCatalog
|
|
@@ -424,24 +438,24 @@ class Ge {
|
|
|
424
438
|
});
|
|
425
439
|
});
|
|
426
440
|
else {
|
|
427
|
-
const
|
|
428
|
-
|
|
441
|
+
const g = p.addWorksheet("Group Name");
|
|
442
|
+
g.columns = [
|
|
429
443
|
{ header: "Group ID", key: "groupId" },
|
|
430
444
|
{ header: "Item ID", key: "itemId" },
|
|
431
445
|
{ header: "Item Name", key: "itemName" },
|
|
432
446
|
{ header: "Default Catalog", key: "defaultCatalog" }
|
|
433
447
|
];
|
|
434
448
|
}
|
|
435
|
-
return this.formatWorkbookCell(p), e.push(
|
|
449
|
+
return this.formatWorkbookCell(p), e.push(r, s, p), e;
|
|
436
450
|
}
|
|
437
451
|
createWorkbookExcelJS(e, i, a) {
|
|
438
|
-
const t = new A.Workbook(),
|
|
439
|
-
return e.forEach((
|
|
440
|
-
|
|
441
|
-
}), a && a.worksheets.forEach((
|
|
442
|
-
const o = t.addWorksheet(
|
|
443
|
-
|
|
444
|
-
const s =
|
|
452
|
+
const t = new A.Workbook(), r = t.addWorksheet(i);
|
|
453
|
+
return e.forEach((n) => {
|
|
454
|
+
r.addRow(n);
|
|
455
|
+
}), a && a.worksheets.forEach((n) => {
|
|
456
|
+
const o = t.addWorksheet(n.name);
|
|
457
|
+
n.eachRow({ includeEmpty: !0 }, (m) => {
|
|
458
|
+
const s = m.values;
|
|
445
459
|
o.addRow(s.slice(1));
|
|
446
460
|
});
|
|
447
461
|
}), t;
|
|
@@ -449,15 +463,15 @@ class Ge {
|
|
|
449
463
|
formatWorkbookCell(e) {
|
|
450
464
|
e.eachSheet((i) => {
|
|
451
465
|
i.eachRow({ includeEmpty: !0 }, (t) => {
|
|
452
|
-
t.eachCell({ includeEmpty: !0 }, (
|
|
453
|
-
|
|
466
|
+
t.eachCell({ includeEmpty: !0 }, (r) => {
|
|
467
|
+
r.font = {
|
|
454
468
|
name: "Calibri",
|
|
455
469
|
size: 12
|
|
456
|
-
}, t.number === 1 && (
|
|
470
|
+
}, t.number === 1 && (r.fill = {
|
|
457
471
|
type: "pattern",
|
|
458
472
|
pattern: "solid",
|
|
459
473
|
fgColor: { argb: "FABF8F" }
|
|
460
|
-
},
|
|
474
|
+
}, r.alignment = { horizontal: "center", vertical: "middle" });
|
|
461
475
|
});
|
|
462
476
|
});
|
|
463
477
|
const a = i.getRow(1);
|
|
@@ -476,63 +490,63 @@ class Ge {
|
|
|
476
490
|
exportCatalogToExcelExcelJS() {
|
|
477
491
|
const e = new A.Workbook();
|
|
478
492
|
return this.menu.modules.catalog.forEach((i) => {
|
|
479
|
-
const a = Object.values(i.override.items).flatMap((s) => s), { rows: t, metaData:
|
|
480
|
-
...Object.entries(
|
|
481
|
-
...
|
|
482
|
-
]), o = O(i.name),
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
}), H(
|
|
493
|
+
const a = Object.values(i.override.items).flatMap((s) => s), { rows: t, metaData: r } = this.transformOverrideData(a), n = t.map(({ priceTier: s, tag: d, ...c }) => [
|
|
494
|
+
...Object.entries(c).map(([, p]) => p),
|
|
495
|
+
...r.tags.map((p) => d[p] || "")
|
|
496
|
+
]), o = O(i.name), m = e.addWorksheet(o);
|
|
497
|
+
n.forEach((s) => {
|
|
498
|
+
m.addRow(s);
|
|
499
|
+
}), H(m, r.tags, r.priceTiers, i);
|
|
486
500
|
}), e;
|
|
487
501
|
}
|
|
488
502
|
exportCatalogAddonToExcelExcelJS() {
|
|
489
503
|
const e = new A.Workbook();
|
|
490
504
|
return this.menu.modules.catalog.forEach((i) => {
|
|
491
505
|
const a = Object.values(i.override.groups).flatMap(
|
|
492
|
-
(
|
|
493
|
-
),
|
|
494
|
-
const { index:
|
|
495
|
-
return [...Object.entries(
|
|
496
|
-
}),
|
|
497
|
-
|
|
498
|
-
o.addRow(
|
|
506
|
+
(m) => m
|
|
507
|
+
), r = this.transformOverrideAddonGroup(a).map(({ priceTier: m, ...s }) => {
|
|
508
|
+
const { index: d, ...c } = s;
|
|
509
|
+
return [...Object.entries(c).map(([, p]) => p)];
|
|
510
|
+
}), n = O(i.name), o = e.addWorksheet(n);
|
|
511
|
+
r.forEach((m) => {
|
|
512
|
+
o.addRow(m);
|
|
499
513
|
}), L(o);
|
|
500
514
|
}), e;
|
|
501
515
|
}
|
|
502
516
|
}
|
|
503
|
-
const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "flex items-center" }, Re = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ae = { class: "fm-typo-en-body-md-600 font-semibold" }, Pe = { class: "flex gap-8" },
|
|
517
|
+
const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "flex items-center" }, Re = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ae = { class: "fm-typo-en-body-md-600 font-semibold" }, Pe = { class: "flex gap-8" }, rt = /* @__PURE__ */ W({
|
|
504
518
|
__name: "Products",
|
|
505
519
|
setup(x) {
|
|
506
|
-
const { t: e } =
|
|
507
|
-
...
|
|
520
|
+
const { t: e } = he(), i = ne(ce()), a = re(), t = S(() => a.rules.item), r = Ce(), n = S(() => !a.state.currentSchedulerId), { selectedCategories: o } = we(), m = S(() => ({
|
|
521
|
+
...be.menuV4ToV3(q(a.state.menu)),
|
|
508
522
|
_id: a.state.menu._id,
|
|
509
523
|
_rev: a.state.menu._rev
|
|
510
524
|
})), s = S(() => {
|
|
511
|
-
const
|
|
512
|
-
return X.uniqBy(
|
|
525
|
+
const b = X.flatten(o.value.map((f) => f.items));
|
|
526
|
+
return X.uniqBy(b, (f) => f._id).length;
|
|
513
527
|
});
|
|
514
|
-
async function
|
|
528
|
+
async function d(b, f) {
|
|
515
529
|
const T = new pe();
|
|
516
|
-
for (let
|
|
517
|
-
const me = await
|
|
518
|
-
T.file(`${f[
|
|
530
|
+
for (let $ = 0; $ < b.length; $++) {
|
|
531
|
+
const me = await b[$].xlsx.writeBuffer();
|
|
532
|
+
T.file(`${f[$]}.xlsx`, me);
|
|
519
533
|
}
|
|
520
534
|
const v = await T.generateAsync({ type: "blob" });
|
|
521
|
-
fe.saveAs(v, `books_${
|
|
535
|
+
fe.saveAs(v, `books_${G().format("DD-MM-YYYY_HH-mm")}.zip`);
|
|
522
536
|
}
|
|
523
|
-
async function
|
|
537
|
+
async function c() {
|
|
524
538
|
await i.minor(
|
|
525
539
|
async () => {
|
|
526
540
|
if (await a.readMenu(), a.version === ie.F_MENU_VERSION.enum.v4) {
|
|
527
|
-
const
|
|
528
|
-
`menu_${
|
|
529
|
-
`addonGroup_${
|
|
530
|
-
`itemLinkedAddon${
|
|
541
|
+
const b = q(a.state.menu), f = new Ge(b).exportToExcel(), T = [
|
|
542
|
+
`menu_${G().format("DD-MM-YYYY_HH-mm")}`,
|
|
543
|
+
`addonGroup_${G().format("DD-MM-YYYY_HH-mm")}`,
|
|
544
|
+
`itemLinkedAddon${G().format("DD-MM-YYYY_HH-mm")}`
|
|
531
545
|
];
|
|
532
|
-
|
|
546
|
+
d(f, T);
|
|
533
547
|
} else {
|
|
534
|
-
const
|
|
535
|
-
await de(
|
|
548
|
+
const b = Ee(m.value), f = `menu_${G().format("DD-MM-YYYY_HH-mm")}`;
|
|
549
|
+
await de(b, `${f}.xlsx`, {
|
|
536
550
|
bookType: "xlsx",
|
|
537
551
|
bookSST: !1,
|
|
538
552
|
type: "array"
|
|
@@ -543,21 +557,21 @@ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "f
|
|
|
543
557
|
);
|
|
544
558
|
}
|
|
545
559
|
const {
|
|
546
|
-
menuItems:
|
|
560
|
+
menuItems: u,
|
|
547
561
|
categories: p,
|
|
548
562
|
linkItemRules: k,
|
|
549
|
-
handleSubmit:
|
|
563
|
+
handleSubmit: g,
|
|
550
564
|
catalogManager: w,
|
|
551
|
-
schedulerManager:
|
|
552
|
-
} = Ie(!1),
|
|
553
|
-
return xe().resetOnMount(), (
|
|
554
|
-
const T =
|
|
565
|
+
schedulerManager: C
|
|
566
|
+
} = Ie(!1), y = _e(), F = S(() => y.breakpoints.value.xs);
|
|
567
|
+
return xe().resetOnMount(), (b, f) => {
|
|
568
|
+
const T = V("fm-button");
|
|
555
569
|
return E(), D(ve, {
|
|
556
570
|
heading: l(e)("menu.products.title")
|
|
557
571
|
}, {
|
|
558
572
|
default: I(() => [
|
|
559
573
|
_(Ke),
|
|
560
|
-
_(
|
|
574
|
+
_(Fe)
|
|
561
575
|
]),
|
|
562
576
|
"append-heading": I(() => [
|
|
563
577
|
M("div", Ve, [
|
|
@@ -567,13 +581,13 @@ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "f
|
|
|
567
581
|
])
|
|
568
582
|
]),
|
|
569
583
|
M("div", Pe, [
|
|
570
|
-
|
|
584
|
+
F.value ? (E(), D(Q, { key: 1 }, {
|
|
571
585
|
default: I(({ trigger: v }) => [
|
|
572
586
|
_(ke, null, {
|
|
573
587
|
default: I(() => [
|
|
574
588
|
_(Z, {
|
|
575
589
|
label: l(e)("menu.products.actions.export"),
|
|
576
|
-
onClick:
|
|
590
|
+
onClick: c
|
|
577
591
|
}, null, 8, ["label"]),
|
|
578
592
|
_(Z, {
|
|
579
593
|
label: l(e)("menu.products.actions.import"),
|
|
@@ -602,7 +616,7 @@ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "f
|
|
|
602
616
|
"text-color": l(N).TypoSecondary,
|
|
603
617
|
variant: l(U).Primary,
|
|
604
618
|
label: l(e)("menu.products.actions.export"),
|
|
605
|
-
onClick:
|
|
619
|
+
onClick: c
|
|
606
620
|
}, null, 8, ["bg-color", "text-color", "variant", "label"]),
|
|
607
621
|
_(Q, null, {
|
|
608
622
|
default: I(({ trigger: v }) => [
|
|
@@ -622,17 +636,17 @@ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "f
|
|
|
622
636
|
key: 0,
|
|
623
637
|
label: l(e)("menu.products.actions.add"),
|
|
624
638
|
"prepend-icon": "add",
|
|
625
|
-
onClick: f[0] || (f[0] = (v) => l(
|
|
626
|
-
}, null, 8, ["label"])) :
|
|
639
|
+
onClick: f[0] || (f[0] = (v) => l(r).create(null))
|
|
640
|
+
}, null, 8, ["label"])) : n.value ? (E(), D(ee, {
|
|
627
641
|
key: 1,
|
|
628
642
|
"categorized-items": l(w).linkableItems.value,
|
|
629
643
|
"initial-value": l(w).currentItems.value,
|
|
630
644
|
"show-variant": !1,
|
|
631
|
-
"menu-items": l(
|
|
645
|
+
"menu-items": l(u),
|
|
632
646
|
categories: l(p),
|
|
633
647
|
"link-item-rules": l(k),
|
|
634
|
-
"no-scheduler":
|
|
635
|
-
onSubmit: l(
|
|
648
|
+
"no-scheduler": n.value,
|
|
649
|
+
onSubmit: l(g)
|
|
636
650
|
}, {
|
|
637
651
|
default: I(({ trigger: v }) => [
|
|
638
652
|
_(Y, {
|
|
@@ -644,14 +658,14 @@ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "f
|
|
|
644
658
|
_: 1
|
|
645
659
|
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : (E(), D(ee, {
|
|
646
660
|
key: 2,
|
|
647
|
-
"categorized-items": l(
|
|
648
|
-
"initial-value": l(
|
|
661
|
+
"categorized-items": l(C).linkableItems.value,
|
|
662
|
+
"initial-value": l(C).currentItems.value,
|
|
649
663
|
"show-variant": !1,
|
|
650
|
-
"menu-items": l(
|
|
664
|
+
"menu-items": l(u),
|
|
651
665
|
categories: l(p),
|
|
652
666
|
"link-item-rules": l(k),
|
|
653
|
-
"no-scheduler":
|
|
654
|
-
onSubmit: l(
|
|
667
|
+
"no-scheduler": n.value,
|
|
668
|
+
onSubmit: l(g)
|
|
655
669
|
}, {
|
|
656
670
|
default: I(({ trigger: v }) => [
|
|
657
671
|
_(Y, {
|
|
@@ -671,5 +685,5 @@ const Ve = { class: "flex-1 flex justify-between gap-8 pl-8" }, $e = { class: "f
|
|
|
671
685
|
}
|
|
672
686
|
});
|
|
673
687
|
export {
|
|
674
|
-
|
|
688
|
+
rt as default
|
|
675
689
|
};
|