@feedmepos/mf-menu 0.31.32-beta.1 → 0.31.33-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/dist/{App-yoGgbqrM.js → App-B4rnpCXN.js} +6 -6
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BVMh9pzs.js → ApplyProduct.vue_vue_type_script_setup_true_lang-LtwWMoPW.js} +2 -2
  3. package/dist/{Catalog-DWd4efi8.js → Catalog-Cd7J8de0.js} +5 -5
  4. package/dist/{Category-9z0kkVLe.js → Category-D3WDm9Fe.js} +5 -5
  5. package/dist/{Category-C_UM22c2.js → Category-p8UUDEiv.js} +4 -4
  6. package/dist/{CookingGuide-NcJxtCtr.js → CookingGuide-hFtxmtGj.js} +3 -3
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-BcTbvvKC.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-Cf17Iy5i.js} +1 -1
  8. package/dist/{Group-ARggNMfD.js → Group-BTrqZgFd.js} +3 -3
  9. package/dist/{Group-D0C2wOCd.js → Group-Bv0dyi8v.js} +1 -1
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-5Eh-CZWE.js → Group.vue_vue_type_script_setup_true_lang-vk1J9IxK.js} +7 -7
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BTPKqEge.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B1wrLnf6.js} +3 -3
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CD9G715F.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-CxPaVLVu.js} +8336 -8695
  13. package/dist/{Ingredient-Dn92XCcb.js → Ingredient-BCostN4Y.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-Orm3VUIW.js → InventoryBinding.vue_vue_type_script_setup_true_lang-MAqpI7ZD.js} +2 -2
  15. package/dist/{LinkProductSideSheet-BAHtc-N_.js → LinkProductSideSheet-abzVzmo3.js} +1 -1
  16. package/dist/{MenuSetting-C3KA280i.js → MenuSetting-TfAo82-E.js} +4 -4
  17. package/dist/{PrintRoute--Shz3LaS.js → PrintRoute-B43rP5A9.js} +3 -3
  18. package/dist/{Product-CO-6260H.js → Product-C7cYyDHH.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-BdnjlsP4.js → Product.vue_vue_type_script_setup_true_lang-BOq8wMzq.js} +11 -11
  20. package/dist/{ProductInternalTools-D76Li9N4.js → ProductInternalTools-CkswVuAF.js} +5 -5
  21. package/dist/Products-C7BtAjhB.js +659 -0
  22. package/dist/{Publish-DtGB-qLN.js → Publish-DIKqaH2f.js} +3 -3
  23. package/dist/{Recipe-DYTKW3WF.js → Recipe-_ApT00c_.js} +4 -4
  24. package/dist/{Scheduler-4XCiKqSf.js → Scheduler-DWY1kKHO.js} +3 -3
  25. package/dist/{ServingSequence-DUrmY-I4.js → ServingSequence-Z1S9zOTO.js} +3 -3
  26. package/dist/{Setting-DAPcBpdV.js → Setting-Bfuf26Gc.js} +4 -4
  27. package/dist/{Subcategory-BFL6ayml.js → Subcategory-Lqq6XHz2.js} +4 -4
  28. package/dist/{Takeaway-dg_9E-b_.js → Takeaway-DGvM9SBP.js} +1 -1
  29. package/dist/{Takeaway-IzItYMn1.js → Takeaway-DiGzrarg.js} +4 -4
  30. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DYWH-hf-.js → Takeaway.vue_vue_type_script_setup_true_lang-BfWy217t.js} +5 -5
  31. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BiKsz8oU.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B2wC_Mf0.js} +12 -12
  32. package/dist/{Unit-BxkdcTob.js → Unit-D11rRFAf.js} +2 -2
  33. package/dist/{Variant-DO3kI2Mq.js → Variant-LaKYPxDe.js} +3 -3
  34. package/dist/{_id_-Bgtie8Eq.js → _id_-Q_Tyhr4U.js} +9 -9
  35. package/dist/{app-4mp76LBw.js → app-Br9mC24D.js} +1 -1
  36. package/dist/{app-DmzrVi1v.js → app-C5UXrJGj.js} +24 -24
  37. package/dist/app.js +1 -1
  38. package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +123 -0
  39. package/dist/apps/mf-menu/src/helper/menuExport.d.ts +32 -0
  40. package/dist/apps/mf-menu/src/helper/{import-export.d.ts → menuImport.d.ts} +3 -127
  41. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  42. package/dist/assets/{linked-status-B3GK0lkt.js → linked-status-BhGrXd73.js} +2 -2
  43. package/dist/assets/{override-menu-BDiFcZqQ.js → override-menu-CUNDHOWA.js} +2 -2
  44. package/dist/assets/{validate-menu-ByfkOKUz.js → validate-menu-BqOizHsX.js} +2 -2
  45. package/dist/{catalog-j7WdQV3w.js → catalog-BDyG_i9q.js} +1 -1
  46. package/dist/{catalogSetting-DR2wkdhm.js → catalogSetting-C33p_dck.js} +1 -1
  47. package/dist/{category-65gMW4we.js → category-Bi6gpIYU.js} +1 -1
  48. package/dist/{currency-k6CAzMi0.js → currency-DDseyYg1.js} +1 -1
  49. package/dist/{dayjs.min-BJ08QQbt.js → dayjs.min-DoQgN0KD.js} +1 -1
  50. package/dist/{index-DbX8VUTJ.js → index-C-zLHAG1.js} +1 -1
  51. package/dist/{index-C7EMP2i4.js → index-DTUmry92.js} +3 -3
  52. package/dist/{index-Djltsima.js → index-DxrEwDTr.js} +2 -2
  53. package/dist/{item-D1xBXT5U.js → item-DqXzPUy9.js} +14 -14
  54. package/dist/{jszip.min-i_8AZTD0.js → jszip.min-iAC5WNVU.js} +2 -2
  55. package/dist/{menu-DvADmo1b.js → menu-Cir-22ei.js} +4 -4
  56. package/dist/{menu-BavjwQ0r.js → menu-D6df9rcz.js} +1 -1
  57. package/dist/{priceTier-D-rhuTb5.js → priceTier-C56BYecC.js} +1 -1
  58. package/dist/{scheduler-Vsrzit9V.js → scheduler-DCSpt65t.js} +3 -3
  59. package/dist/{subcategory-DpIvUGdf.js → subcategory-CydaPy_X.js} +46 -46
  60. package/dist/{toExcel-DRc4oNPw.js → toExcel-Bil8CwJs.js} +15 -15
  61. package/dist/{unit-26oewOyX.js → unit-8DyuBx-X.js} +1 -1
  62. package/package.json +1 -1
  63. package/dist/Products-DE7_VRGo.js +0 -270
@@ -1,5 +1,5 @@
1
- import { b as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-CD9G715F.js";
2
- import "./menu-DvADmo1b.js";
1
+ import { d as C } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-CxPaVLVu.js";
2
+ import "./menu-Cir-22ei.js";
3
3
  var Z = {
4
4
  defaultAmount: 0,
5
5
  defaultCurrency: "USD",
@@ -716,12 +716,12 @@ var d = q(), mt = function t(i) {
716
716
  allocate: function(o) {
717
717
  var s = this;
718
718
  dt(o);
719
- for (var l = o.reduce(function(O, b) {
720
- return d.add(O, b);
719
+ for (var l = o.reduce(function(O, D) {
720
+ return d.add(O, D);
721
721
  }), m = this.getAmount(), A = o.map(function(O) {
722
- var b = Math.floor(d.divide(d.multiply(s.getAmount(), O), l));
723
- return m = d.subtract(m, b), f.call(s, {
724
- amount: b
722
+ var D = Math.floor(d.divide(d.multiply(s.getAmount(), O), l));
723
+ return m = d.subtract(m, D), f.call(s, {
724
+ amount: D
725
725
  });
726
726
  }), y = 0; m > 0; )
727
727
  o[y] > 0 && (A[y] = A[y].add(f.call(this, {
@@ -835,7 +835,7 @@ var d = q(), mt = function t(i) {
835
835
  * @return {Promise}
836
836
  */
837
837
  convert: function(o) {
838
- var s = this, l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = l.endpoint, A = m === void 0 ? M.endpoint : m, y = l.propertyPath, O = y === void 0 ? M.propertyPath || "rates.{{to}}" : y, b = l.headers, V = b === void 0 ? M.headers : b, L = l.roundingMode, X = L === void 0 ? g : L, j = Object.assign({}, {
838
+ var s = this, l = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, m = l.endpoint, A = m === void 0 ? M.endpoint : m, y = l.propertyPath, O = y === void 0 ? M.propertyPath || "rates.{{to}}" : y, D = l.headers, V = D === void 0 ? M.headers : D, L = l.roundingMode, X = L === void 0 ? g : L, j = Object.assign({}, {
839
839
  endpoint: A,
840
840
  propertyPath: O,
841
841
  headers: V,
@@ -1251,7 +1251,7 @@ var d = q(), mt = function t(i) {
1251
1251
  return this.toObject();
1252
1252
  }
1253
1253
  };
1254
- }, D = Object.assign(mt, Z, J, tt), S = /* @__PURE__ */ ((t) => (t.PRODUCT_PRICE = "PRODUCT_PRICE", t.PRODUCT_VARIANT_PRICE = "PRODUCT_VARIANT_PRICE", t.PRODUCT_ORDER_FROM = "PRODUCT_ORDER_FROM", t.PRODUCT_NAME = "PRODUCT_NAME", t.PRODUCT_SCHEDULE = "PRODUCT_SCHEDULE", t.PRODUCT_SCHEDULE_PRICE = "PRODUCT_SCHEDULE_PRICE", t.PRODUCT_CODE = "PRODUCT_CODE", t.PRODUCT_VARIANT_CODE = "PRODUCT_VARIANT_CODE", t.PRODUCT_VARIANT_SCHEDULE_PRICE = "PRODUCT_VARIANT_SCHEDULE_PRICE", t.ADDON_AVAILABLE = "ADDON_AVAILABLE", t.ADDON_NAME = "ADDON_NAME", t.ADDON_PRICE = "ADDON_PRICE", t.ADDON_VARIANT_PRICE = "ADDON_VARIANT_PRICE", t.ADDON_ORDER_FROM = "ADDON_ORDER_FROM", t))(S || {});
1254
+ }, b = Object.assign(mt, Z, J, tt), S = /* @__PURE__ */ ((t) => (t.PRODUCT_PRICE = "PRODUCT_PRICE", t.PRODUCT_VARIANT_PRICE = "PRODUCT_VARIANT_PRICE", t.PRODUCT_ORDER_FROM = "PRODUCT_ORDER_FROM", t.PRODUCT_NAME = "PRODUCT_NAME", t.PRODUCT_SCHEDULE = "PRODUCT_SCHEDULE", t.PRODUCT_SCHEDULE_PRICE = "PRODUCT_SCHEDULE_PRICE", t.PRODUCT_CODE = "PRODUCT_CODE", t.PRODUCT_VARIANT_CODE = "PRODUCT_VARIANT_CODE", t.PRODUCT_VARIANT_SCHEDULE_PRICE = "PRODUCT_VARIANT_SCHEDULE_PRICE", t.ADDON_AVAILABLE = "ADDON_AVAILABLE", t.ADDON_NAME = "ADDON_NAME", t.ADDON_PRICE = "ADDON_PRICE", t.ADDON_VARIANT_PRICE = "ADDON_VARIANT_PRICE", t.ADDON_ORDER_FROM = "ADDON_ORDER_FROM", t))(S || {});
1255
1255
  function h(t) {
1256
1256
  return t = t.split("/").map((i) => {
1257
1257
  const n = i.split("_");
@@ -1285,7 +1285,7 @@ function gt(t, i = !1) {
1285
1285
  variantKey: "",
1286
1286
  variant: "",
1287
1287
  vcStatus: "",
1288
- price: D(e.price).toFormat("0.00"),
1288
+ price: b(e.price).toFormat("0.00"),
1289
1289
  perXUnit: e.unit ? ((u = e.perXUnit) == null ? void 0 : u.toString()) ?? "" : "",
1290
1290
  unit: e.unit || "",
1291
1291
  categoryName: (r == null ? void 0 : r.name) ?? "",
@@ -1300,7 +1300,7 @@ function gt(t, i = !1) {
1300
1300
  variantKey: h(p.combinationKey),
1301
1301
  variant: p.selectionName.join("/"),
1302
1302
  vcStatus: p.active ? "active" : "inactive",
1303
- price: p.price ? D(p.price).toFormat("0.00") : D(e.price).toFormat("0.00"),
1303
+ price: p.price ? b(p.price).toFormat("0.00") : b(e.price).toFormat("0.00"),
1304
1304
  perXUnit: e.unit ? ((g = e.perXUnit) == null ? void 0 : g.toString()) ?? "" : "",
1305
1305
  unit: e.unit || "",
1306
1306
  categoryName: (r == null ? void 0 : r.name) ?? "",
@@ -1327,17 +1327,17 @@ function gt(t, i = !1) {
1327
1327
  ) : null;
1328
1328
  f && v ? r = {
1329
1329
  ...r,
1330
- [`${u.name} (${h(u._id)})`]: D(
1330
+ [`${u.name} (${h(u._id)})`]: b(
1331
1331
  v.value
1332
1332
  ).toFormat("0.00")
1333
1333
  } : f && !v && (l != null && l.price) ? r = {
1334
1334
  ...r,
1335
- [`${u.name} (${h(u._id)})`]: D(
1335
+ [`${u.name} (${h(u._id)})`]: b(
1336
1336
  l.price
1337
1337
  ).toFormat("0.00")
1338
1338
  } : f && !v && !(l != null && l.price) && c ? r = {
1339
1339
  ...r,
1340
- [`${u.name} (${h(u._id)})`]: D(
1340
+ [`${u.name} (${h(u._id)})`]: b(
1341
1341
  c.value
1342
1342
  ).toFormat("0.00")
1343
1343
  } : f && !v && !(l != null && l.price) && !c ? r = {
@@ -1345,7 +1345,7 @@ function gt(t, i = !1) {
1345
1345
  [`${u.name} (${h(u._id)})`]: e.price
1346
1346
  } : !f && c ? r = {
1347
1347
  ...r,
1348
- [`${u.name} (${h(u._id)})`]: D(
1348
+ [`${u.name} (${h(u._id)})`]: b(
1349
1349
  c.value
1350
1350
  ).toFormat("0.00")
1351
1351
  } : r = {
@@ -1,6 +1,6 @@
1
1
  import { defineStore as J } from "pinia";
2
2
  import { defineComponent as O, computed as U, ref as h, watch as T, resolveComponent as V, createBlock as W, openBlock as F, withCtx as w, createVNode as m, createElementVNode as f, normalizeClass as Q, createElementBlock as A, toDisplayString as M, unref as l, Fragment as q, renderSlot as X, renderList as Z, getCurrentInstance as ee } from "vue";
3
- import { a7 as B, a8 as te, a5 as P, H as k, O as $, D as I, B as E, I as ne, a6 as ae, J as C, G as D, u as oe } from "./menu-DvADmo1b.js";
3
+ import { a7 as B, a8 as te, a5 as P, H as k, O as $, D as I, B as E, I as ne, a6 as ae, J as C, G as D, u as oe } from "./menu-Cir-22ei.js";
4
4
  import { useI18n as L } from "@feedmepos/mf-common";
5
5
  import { useSnackbar as j, components as le, useDialog as ue, FmButtonVariant as ie } from "@feedmepos/ui-library";
6
6
  import { u as se } from "./discardConfirm-BHni0LNu.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-menu",
3
- "version": "0.31.32-beta.1",
3
+ "version": "0.31.33-beta.1",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -1,270 +0,0 @@
1
- import { defineComponent as Y, computed as g, ref as z, resolveComponent as h, createBlock as y, openBlock as d, unref as e, withCtx as m, createElementVNode as u, toDisplayString as U, createVNode as a, createCommentVNode as L, createElementBlock as D, Fragment as T } from "vue";
2
- import { D as C } from "./dayjs.min-BJ08QQbt.js";
3
- import { u as W, a as X, M as ee, w as te } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-CD9G715F.js";
4
- import { J as oe, F as ne } from "./jszip.min-i_8AZTD0.js";
5
- import { u as q, D as G, A as I, e as H, G as O, B as ae, H as N, I as B } from "./menu-DvADmo1b.js";
6
- import { useCoreStore as re, useI18n as se } from "@feedmepos/mf-common";
7
- import { useDialog as j, useDialogChild as ie, useSnackbar as J, useBreakpoints as le, FmButtonVariant as $, FmButtonColorThemeVariant as M } from "@feedmepos/ui-library";
8
- import { _ as V } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
9
- import { _ as ue, a as P } from "./BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js";
10
- import { _ as ce } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
11
- import { u as me, a as de } from "./menu-BavjwQ0r.js";
12
- import { u as pe } from "./item-D1xBXT5U.js";
13
- import { _ as A, a as fe } from "./Product.vue_vue_type_script_setup_true_lang-BdnjlsP4.js";
14
- import { L as R } from "./LinkProductSideSheet-BAHtc-N_.js";
15
- import { _ as _e } from "./TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BiKsz8oU.js";
16
- import { m as ve } from "./toExcel-DRc4oNPw.js";
17
- const ge = { class: "space-y-24 mb-24" }, be = ["innerHTML"], ye = { class: "flex justify-end gap-8" }, xe = /* @__PURE__ */ Y({
18
- __name: "ConfirmActionDialog",
19
- props: {
20
- description: {},
21
- value: {},
22
- message: { default: "To confirm your action, type <b>[[value]]</b> in the text field." }
23
- },
24
- setup(F) {
25
- const t = F, S = g(() => t.message.replace("[[value]]", t.value)), r = z(""), w = j(), { emitAction: x } = ie();
26
- return (p, s) => {
27
- const i = h("FmTextField"), f = h("FmButton"), b = h("FmForm");
28
- return d(), y(b, {
29
- "on-validation-success": () => e(x)("primary"),
30
- "blame-form-child-on-validation-failed": ""
31
- }, {
32
- default: m(() => [
33
- u("div", ge, [
34
- u("div", null, U(p.description), 1),
35
- u("div", { innerHTML: S.value }, null, 8, be),
36
- u("div", null, [
37
- a(i, {
38
- modelValue: r.value,
39
- "onUpdate:modelValue": [
40
- s[0] || (s[0] = (l) => r.value = l),
41
- s[1] || (s[1] = () => {
42
- })
43
- ],
44
- placeholder: p.value,
45
- rules: [(l) => l === p.value || "Value does not match"]
46
- }, null, 8, ["modelValue", "placeholder", "rules"])
47
- ]),
48
- u("div", ye, [
49
- a(f, {
50
- label: "Cancel",
51
- variant: "secondary",
52
- onClick: s[2] || (s[2] = (l) => e(w).close())
53
- }),
54
- a(f, {
55
- label: "Confirm",
56
- type: "submit"
57
- })
58
- ])
59
- ])
60
- ]),
61
- _: 1
62
- }, 8, ["on-validation-success"]);
63
- };
64
- }
65
- }), ke = /* @__PURE__ */ Y({
66
- __name: "Migrate",
67
- setup(F) {
68
- const t = q(), S = re(), r = J(), { minor: w } = G(r), x = z(!1), p = j();
69
- async function s() {
70
- i.value || x.value || p.open({
71
- title: "Migrate to new version",
72
- contentComponent: xe,
73
- contentComponentProps: {
74
- value: "MIGRATE",
75
- description: "Do you want to migrate to new version? Once migrate it will unable to revert to the older version."
76
- }
77
- }).onPrimary(async () => {
78
- p.close(), await w(
79
- async () => {
80
- await t.migrate(), setTimeout(() => {
81
- window.location.reload();
82
- }, 2e3);
83
- },
84
- {
85
- isLoading: x,
86
- customId: t.state.menu._id,
87
- message: "Migrating menu",
88
- successMessage: "Migration completed"
89
- }
90
- );
91
- });
92
- }
93
- const i = g(() => {
94
- const f = S.restaurants.value;
95
- if (!f.length) return "Required at least one restaurant to migrate";
96
- const b = f.filter((k) => !k.posVersion || !I.Pos.canUse({ feature: H.F_FEATURE.enum.menuV4, posVersion: k.posVersion }));
97
- return b.length ? `Upgrade POS to V${I.Pos.minVersionToUse(H.F_FEATURE.enum.menuV4)} to use new menu: ${b.map((k) => k.profile.name).join(", ")}` : null;
98
- });
99
- return g(() => i.value ? i.value : "Migrate your menu to new version to enjoy more features. Content of new menu will remain the same as current."), (f, b) => {
100
- const l = h("FmSnackbar");
101
- return !i.value && e(t).version !== e(O.F_MENU_VERSION).enum.v4 ? (d(), y(l, {
102
- key: 0,
103
- class: "!max-w-full",
104
- title: "New version of menu is out now!",
105
- description: "Migrate your current menu version to the latest to enjoy more features such as product sequential dispatch, serving sequence, scheduler and more! Your content and current setting will be preserved.",
106
- variant: "info",
107
- action: "Migrate",
108
- "z-index": 0,
109
- onOnAction: s
110
- })) : L("", !0);
111
- };
112
- }
113
- }), Me = { class: "flex-1 flex justify-between gap-8 pl-8" }, Se = { class: "flex items-center" }, we = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ce = { class: "fm-typo-en-body-md-600 font-semibold" }, he = { class: "flex gap-8" }, Le = /* @__PURE__ */ Y({
114
- __name: "Products",
115
- setup(F) {
116
- const { t } = se(), S = G(J()), r = q(), w = g(() => r.rules.item), x = pe(), p = g(() => !r.state.currentSchedulerId), s = W(), i = X(), { selectedCategories: f } = me(), b = g(() => ({
117
- ...ae.menuV4ToV3(N(r.state.menu)),
118
- _id: r.state.menu._id,
119
- _rev: r.state.menu._rev
120
- })), l = g(() => {
121
- const c = B.flatten(f.value.map((o) => o.items));
122
- return B.uniqBy(c, (o) => o._id).length;
123
- });
124
- async function k(c, o) {
125
- const _ = new oe();
126
- for (let v = 0; v < c.length; v++) {
127
- const Q = await c[v].xlsx.writeBuffer();
128
- _.file(`${o[v]}.xlsx`, Q);
129
- }
130
- const n = await _.generateAsync({ type: "blob" });
131
- ne.saveAs(n, `books_${C().format("DD-MM-YYYY_HH-mm")}.zip`);
132
- }
133
- async function E() {
134
- await S.minor(
135
- async () => {
136
- if (await r.readMenu(), r.version === O.F_MENU_VERSION.enum.v4) {
137
- const c = N(r.state.menu), o = new ee(c).exportToExcel(), _ = [
138
- `menu_${C().format("DD-MM-YYYY_HH-mm")}`,
139
- `addonGroup_${C().format("DD-MM-YYYY_HH-mm")}`,
140
- `itemLinkedAddon${C().format("DD-MM-YYYY_HH-mm")}`
141
- ];
142
- k(o, _);
143
- } else {
144
- const c = ve(b.value), o = `menu_${C().format("DD-MM-YYYY_HH-mm")}`;
145
- await te(c, `${o}.xlsx`, {
146
- bookType: "xlsx",
147
- bookSST: !1,
148
- type: "array"
149
- });
150
- }
151
- },
152
- { successMessage: "Menu exported", customId: r.state.menu._id }
153
- );
154
- }
155
- const Z = le(), K = g(() => Z.breakpoints.value.xs);
156
- return de().resetOnMount(), (c, o) => {
157
- const _ = h("fm-button");
158
- return d(), y(ce, {
159
- heading: e(t)("menu.products.title")
160
- }, {
161
- default: m(() => [
162
- a(ke),
163
- a(fe)
164
- ]),
165
- "append-heading": m(() => [
166
- u("div", Me, [
167
- u("div", Se, [
168
- u("div", we, [
169
- u("p", Ce, U(l.value), 1)
170
- ])
171
- ]),
172
- u("div", he, [
173
- K.value ? (d(), y(A, { key: 1 }, {
174
- default: m(({ trigger: n }) => [
175
- a(ue, null, {
176
- default: m(() => [
177
- a(P, {
178
- label: e(t)("menu.products.actions.export"),
179
- onClick: E
180
- }, null, 8, ["label"]),
181
- a(P, {
182
- label: e(t)("menu.products.actions.import"),
183
- onClick: n
184
- }, null, 8, ["label", "onClick"])
185
- ]),
186
- _: 2
187
- }, 1024)
188
- ]),
189
- _: 1
190
- })) : (d(), D(T, { key: 0 }, [
191
- a(_e, null, {
192
- default: m(({ trigger: n }) => [
193
- a(_, {
194
- label: e(t)("menu.tree_editor.title"),
195
- "bg-color": e(M).NeutralGray100,
196
- "text-color": e(M).TypoSecondary,
197
- variant: e($).Primary,
198
- onClick: n
199
- }, null, 8, ["label", "bg-color", "text-color", "variant", "onClick"])
200
- ]),
201
- _: 1
202
- }),
203
- a(_, {
204
- "bg-color": e(M).NeutralGray100,
205
- "text-color": e(M).TypoSecondary,
206
- variant: e($).Primary,
207
- label: e(t)("menu.products.actions.export"),
208
- onClick: E
209
- }, null, 8, ["bg-color", "text-color", "variant", "label"]),
210
- a(A, null, {
211
- default: m(({ trigger: n }) => [
212
- a(_, {
213
- "bg-color": e(M).NeutralGray100,
214
- "text-color": e(M).TypoSecondary,
215
- variant: e($).Primary,
216
- label: e(t)("menu.products.actions.import"),
217
- onClick: n
218
- }, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])
219
- ]),
220
- _: 1
221
- })
222
- ], 64)),
223
- l.value > 0 ? (d(), D(T, { key: 2 }, [
224
- w.value.create ? (d(), y(V, {
225
- key: 0,
226
- label: e(t)("menu.products.actions.add"),
227
- "prepend-icon": "add",
228
- onClick: o[0] || (o[0] = (n) => e(x).create(null))
229
- }, null, 8, ["label"])) : p.value ? (d(), y(R, {
230
- key: 1,
231
- "categorized-items": e(s).linkableItems.value,
232
- "initial-value": e(s).currentItems.value,
233
- "show-variant": !1,
234
- onSubmit: o[1] || (o[1] = (n) => e(s).applyProduct(n.map((v) => v._id)))
235
- }, {
236
- default: m(({ trigger: n }) => [
237
- a(V, {
238
- label: e(t)("menu.products.actions.link"),
239
- "prepend-icon": "link",
240
- onClick: n
241
- }, null, 8, ["label", "onClick"])
242
- ]),
243
- _: 1
244
- }, 8, ["categorized-items", "initial-value"])) : (d(), y(R, {
245
- key: 2,
246
- "categorized-items": e(i).linkableItems.value,
247
- "initial-value": e(i).currentItems.value,
248
- "show-variant": !1,
249
- onSubmit: o[2] || (o[2] = (n) => e(i).applyProduct(n.map((v) => v._id)))
250
- }, {
251
- default: m(({ trigger: n }) => [
252
- a(V, {
253
- label: e(t)("menu.products.actions.apply_scheduler"),
254
- onClick: n
255
- }, null, 8, ["label", "onClick"])
256
- ]),
257
- _: 1
258
- }, 8, ["categorized-items", "initial-value"]))
259
- ], 64)) : L("", !0)
260
- ])
261
- ])
262
- ]),
263
- _: 1
264
- }, 8, ["heading"]);
265
- };
266
- }
267
- });
268
- export {
269
- Le as default
270
- };