@feedmepos/mf-menu 0.18.17 → 0.19.0-beta.2

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 (90) hide show
  1. package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-DFJJHptK.js +158 -0
  2. package/dist/{ApplyProducts.vue_vue_type_script_setup_true_lang-BJ0b_uKf.js → ApplyProducts.vue_vue_type_script_setup_true_lang-CXoRwrTi.js} +2 -2
  3. package/dist/Catalog-CXzqtCF8.js +551 -0
  4. package/dist/Category-DKbtLbq8.js +387 -0
  5. package/dist/CookingGuide-BKon8TdH.js +862 -0
  6. package/dist/Group-D1UDksBG.js +46 -0
  7. package/dist/{Group-jEtbECLb.js → Group-izOWb_Bh.js} +1 -1
  8. package/dist/Group.vue_vue_type_script_setup_true_lang-DAlQcgYp.js +558 -0
  9. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Q7es2wmt.js +237 -0
  10. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Bw4uxqAp.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Db0uYw5O.js} +11723 -11723
  11. package/dist/Ingredient-BIJu9P_9.js +484 -0
  12. package/dist/LinkProductSideSheet-BNdFZThd.js +104 -0
  13. package/dist/PrintRoute--fYPFcy7.js +417 -0
  14. package/dist/{Product-Bnr9oFr2.js → Product-vLtISbkD.js} +1 -1
  15. package/dist/Product.vue_vue_type_script_setup_true_lang-BHCihe6o.js +826 -0
  16. package/dist/Products-JaCNtcHS.js +236 -0
  17. package/dist/Publish-jpmiyB-b.js +525 -0
  18. package/dist/Recipe-B6y-oLPG.js +320 -0
  19. package/dist/Scheduler-Dj1rlr-U.js +222 -0
  20. package/dist/SchedulerSelector.vue_vue_type_script_setup_true_lang-BVAkohGJ.js +48 -0
  21. package/dist/ServingSequence-BhIfCyXl.js +4 -0
  22. package/dist/{Setting-DN8TQdIR.js → Setting-B5R1JfaL.js} +1 -1
  23. package/dist/Setting.vue_vue_type_script_setup_true_lang-xXtg0JOn.js +253 -0
  24. package/dist/Takeaway-BSFSz_JL.js +63 -0
  25. package/dist/{Takeaway-y0Nk0JAb.js → Takeaway-DjFTtbw6.js} +1 -1
  26. package/dist/Takeaway.vue_vue_type_script_setup_true_lang-BUGL0wfZ.js +302 -0
  27. package/dist/TaxSetting-D9Q8XNgJ.js +25 -0
  28. package/dist/Unit-Cr_8O3zB.js +142 -0
  29. package/dist/Variant-loUMfNRB.js +222 -0
  30. package/dist/_id_-0w7KjYyQ.js +189 -0
  31. package/dist/{app-D7e31gIv.js → app-t9ONnc0s.js} +31701 -26207
  32. package/dist/app.js +7 -6
  33. package/dist/apps/mf-menu/src/app.d.ts +2784 -0
  34. package/dist/apps/mf-menu/src/components/feature/Fields/OrderFrom.vue.d.ts +2 -2
  35. package/dist/apps/mf-menu/src/components/feature/LinkProduct/LinkProductSideSheet.vue.d.ts +2 -2
  36. package/dist/apps/mf-menu/src/manager/menu/catalog.d.ts +1 -0
  37. package/dist/apps/mf-menu/src/stores/manager/item.d.ts +1 -1
  38. package/dist/apps/mf-menu/src/stores/menu.d.ts +16 -16
  39. package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +12 -12
  40. package/dist/apps/mf-menu/src/views/Scheduler/FilterForm.vue.d.ts +4 -4
  41. package/dist/apps/mf-menu/src/views/Scheduler/SchedulerDialog.vue.d.ts +4 -4
  42. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  43. package/dist/assets/{linked-status-D5tq3eE2.js → linked-status-DLL4aRiX.js} +8 -8
  44. package/dist/assets/{validate-menu-AcCpPyQZ.js → validate-menu-CoXc16jh.js} +8 -8
  45. package/dist/{catalog-Ck7lLTN2.js → catalog-4OmC0JA3.js} +66 -62
  46. package/dist/category-BE33DRqp.js +155 -0
  47. package/dist/{currency-CclA5a-2.js → currency-JHgYNbTQ.js} +1 -1
  48. package/dist/{index-DDd9B_ur.js → index-CE3zjhyh.js} +732 -740
  49. package/dist/index-pSg9p-28.js +238 -0
  50. package/dist/item-CEPx51U1.js +6371 -0
  51. package/dist/{lodash-BIQx_fko.js → lodash-VivR_BQ2.js} +1 -1
  52. package/dist/{menu-CYzbNubv.js → menu-ETQrtbbU.js} +1 -1
  53. package/dist/{object-DUtbNpoS.js → object-DEM5FMTB.js} +4 -4
  54. package/dist/scheduler-SRT_5Nio.js +491 -0
  55. package/dist/string-DpfFixWH.js +4 -0
  56. package/dist/style.css +1 -1
  57. package/dist/takeaway-RcvqKigG.js +267 -0
  58. package/dist/{toExcel-BXPcj8Gp.js → toExcel-BcgskY3F.js} +2 -2
  59. package/dist/unit-DLL7xIF1.js +350 -0
  60. package/package.json +4 -2
  61. package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-D9QsJ4vO.js +0 -155
  62. package/dist/Catalog-CZW54QJU.js +0 -570
  63. package/dist/Category-DvsP_L7d.js +0 -405
  64. package/dist/CookingGuide-DC3uXetk.js +0 -848
  65. package/dist/Group-DK5xqeYX.js +0 -44
  66. package/dist/Group.vue_vue_type_script_setup_true_lang-DGZ9hnPg.js +0 -538
  67. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BQXqlXw4.js +0 -234
  68. package/dist/Ingredient-354LLwdX.js +0 -498
  69. package/dist/LinkProductSideSheet-anxSsu0z.js +0 -102
  70. package/dist/PrintRoute-DrSvtNLX.js +0 -425
  71. package/dist/Product.vue_vue_type_script_setup_true_lang-bBY54Q_1.js +0 -815
  72. package/dist/Products-CZyueqSO.js +0 -234
  73. package/dist/Publish-kRM1UuPk.js +0 -518
  74. package/dist/Recipe-nKpLIJs8.js +0 -345
  75. package/dist/Scheduler-DmZ8atXG.js +0 -233
  76. package/dist/SchedulerSelector.vue_vue_type_script_setup_true_lang-CdsxA-p0.js +0 -48
  77. package/dist/ServingSequence-j00_ko5R.js +0 -4
  78. package/dist/Setting.vue_vue_type_script_setup_true_lang-Cx06MCJs.js +0 -247
  79. package/dist/Takeaway-BXZXCAaM.js +0 -61
  80. package/dist/Takeaway.vue_vue_type_script_setup_true_lang-9WVkdLZF.js +0 -316
  81. package/dist/TaxSetting-DdHx7ACN.js +0 -21
  82. package/dist/Unit-biPvleyL.js +0 -161
  83. package/dist/Variant-BP1IRNQx.js +0 -231
  84. package/dist/_id_-BiaNDI2N.js +0 -188
  85. package/dist/category-KiA5-36F.js +0 -154
  86. package/dist/index-BFeZlU8X.js +0 -232
  87. package/dist/item-Bcg7SiYv.js +0 -6325
  88. package/dist/scheduler-D1tgE0_9.js +0 -480
  89. package/dist/takeaway-BKsoD4EL.js +0 -264
  90. package/dist/unit-CswFvAyc.js +0 -346
@@ -0,0 +1,142 @@
1
+ import { defineComponent as L, computed as m, ref as g, h as k, withModifiers as x, resolveComponent as p, openBlock as a, createBlock as b, unref as e, withCtx as h, createElementBlock as u, Fragment as v, createElementVNode as o, createVNode as i, renderList as N, normalizeClass as C, toDisplayString as f, createCommentVNode as T } from "vue";
2
+ import { a as E, u as K, n as R, _ as D, k as q, f as A } from "./app-t9ONnc0s.js";
3
+ import { useSnackbar as G, components as H, useBreakpoints as I, FmButtonVariant as J } from "@feedmepos/ui-library";
4
+ import "@feedmepos/mf-common";
5
+ import "vue-router";
6
+ import { u as O, U as P } from "./unit-DLL7xIF1.js";
7
+ const Q = {
8
+ key: 0,
9
+ class: "h-[600px]"
10
+ }, W = {
11
+ class: "flex justify-end items-center"
12
+ }, X = {
13
+ class: "flex justify-end items-center my-8 px-16"
14
+ }, Y = {
15
+ class: /* @__PURE__ */ C(["flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"])
16
+ }, Z = ["onClick"], ee = {
17
+ class: "flex-1"
18
+ }, te = {
19
+ class: "fm-typo-en-body-lg-600 mb-4"
20
+ }, ne = {
21
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
22
+ }, oe = {
23
+ class: "flex-1 flex justify-between gap-8 pl-8"
24
+ }, le = {
25
+ class: "flex items-center"
26
+ }, ae = {
27
+ class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4"
28
+ }, se = {
29
+ class: "fm-typo-en-body-md-600 font-semibold"
30
+ }, fe = /* @__PURE__ */ L({
31
+ __name: "Unit",
32
+ setup(ie) {
33
+ const w = G();
34
+ E(w);
35
+ const S = K(), r = O(), {
36
+ t: n
37
+ } = R(), d = m(() => S.units), _ = m(() => d.value.filter((s) => `${s.name} ${s.abbrev}`.toLowerCase().includes(c.value.toLowerCase()))), c = g(""), U = g([{
38
+ accessorKey: "name",
39
+ header: () => n("menu.unit.columns.name"),
40
+ enableSorting: !1
41
+ }, {
42
+ accessorKey: "abbrev",
43
+ header: () => n("menu.unit.columns.symbol"),
44
+ enableSorting: !1
45
+ }, {
46
+ id: "actions",
47
+ size: 52,
48
+ meta: {
49
+ cellClass: "pl-16",
50
+ headerContentClass: "-mx-16"
51
+ },
52
+ header: "",
53
+ cell: (s) => {
54
+ const l = s.row.original;
55
+ return k("div", {
56
+ class: "flex justify-end"
57
+ }, [k(H.FmButton, {
58
+ icon: "delete",
59
+ textColor: "neutral-gray-400",
60
+ variant: "tertiary",
61
+ onClick: x(async () => {
62
+ r.deleteUnit(l);
63
+ }, ["stop", "prevent"])
64
+ })]);
65
+ }
66
+ }]);
67
+ function V(s) {
68
+ r.updateUnit(s);
69
+ }
70
+ const F = m(() => d.value.length), B = I(), M = m(() => B.breakpoints.value.xs);
71
+ return (s, l) => {
72
+ const y = p("FmSearch"), $ = p("FmTable"), j = p("fm-button"), z = p("FmSpacer");
73
+ return a(), b(D, {
74
+ heading: e(n)("menu.unit.title")
75
+ }, {
76
+ default: h(() => [d.value.length === 0 ? (a(), b(e(q), {
77
+ key: 0,
78
+ action: {
79
+ text: e(n)("menu.unit.add"),
80
+ callback() {
81
+ e(r).createUnit();
82
+ }
83
+ },
84
+ subtitle: e(n)("menu.unit.empty.subtitle"),
85
+ title: e(n)("menu.unit.empty.title")
86
+ }, null, 8, ["action", "subtitle", "title"])) : (a(), u(v, {
87
+ key: 1
88
+ }, [M.value ? (a(), u(v, {
89
+ key: 1
90
+ }, [o("div", X, [i(y, {
91
+ modelValue: c.value,
92
+ "onUpdate:modelValue": l[2] || (l[2] = (t) => c.value = t),
93
+ autofocus: "",
94
+ class: "w-full",
95
+ placeholder: e(n)("menu.common.labels.search_placeholder", {
96
+ type: "units"
97
+ })
98
+ }, null, 8, ["modelValue", "placeholder"])]), o("div", Y, [(a(!0), u(v, null, N(_.value, (t) => (a(), u("div", {
99
+ key: t._id,
100
+ class: C(["py-12 px-16", "flex space-x-8", "items-center"]),
101
+ onClick: () => e(r).updateUnit(t)
102
+ }, [o("div", ee, [o("p", te, f(t.name), 1), o("p", ne, f(e(n)("menu.common.labels.symbol")) + ": " + f(t.abbrev), 1)]), i(j, {
103
+ variant: e(J).Tertiary,
104
+ "prepend-icon": "delete",
105
+ "text-color": "neutral-gray-400",
106
+ onClick: x(() => e(r).deleteUnit(t), ["stop"])
107
+ }, null, 8, ["variant", "onClick"])], 8, Z))), 128))])], 64)) : (a(), u("div", Q, [o("div", W, [i(y, {
108
+ modelValue: c.value,
109
+ "onUpdate:modelValue": l[0] || (l[0] = (t) => c.value = t),
110
+ autofocus: "",
111
+ class: "mb-8 w-[320px]",
112
+ placeholder: e(n)("menu.common.labels.search_placeholder", {
113
+ type: "units"
114
+ })
115
+ }, null, 8, ["modelValue", "placeholder"])]), i($, {
116
+ "column-defs": U.value,
117
+ "page-size": _.value.length,
118
+ "row-data": _.value,
119
+ "shrink-at": !1,
120
+ "hide-footer": "",
121
+ "pin-header-row": "",
122
+ onRowClick: l[1] || (l[1] = (t) => V(t.original))
123
+ }, null, 8, ["column-defs", "page-size", "row-data"])]))], 64))]),
124
+ "append-heading": h(() => [o("div", oe, [o("div", le, [o("div", ae, [o("p", se, f(F.value), 1)])]), i(z), i(e(P), null, {
125
+ default: h(({
126
+ trigger: t
127
+ }) => [d.value.length > 0 ? (a(), b(A, {
128
+ key: 0,
129
+ label: e(n)("menu.unit.add"),
130
+ "prepend-icon": "add",
131
+ onClick: t
132
+ }, null, 8, ["label", "onClick"])) : T("", !0)]),
133
+ _: 1
134
+ })])]),
135
+ _: 1
136
+ }, 8, ["heading"]);
137
+ };
138
+ }
139
+ });
140
+ export {
141
+ fe as default
142
+ };
@@ -0,0 +1,222 @@
1
+ import { getCurrentInstance as $, defineComponent as A, computed as g, onMounted as O, h as E, resolveComponent as x, openBlock as m, createBlock as F, unref as e, withCtx as p, createVNode as i, withModifiers as V, createCommentVNode as R, createElementBlock as f, Fragment as C, createElementVNode as r, isRef as L, renderList as Y, normalizeClass as I, toDisplayString as w } from "vue";
2
+ import { a as N, u as j, n as D, b as G, h as q, i as K, l as H, o as J, _ as Q, f as W, j as X, k as Z } from "./app-t9ONnc0s.js";
3
+ import { useDialog as ee, useSnackbar as P, FmButtonVariant as M, components as ae, useBreakpoints as ne } from "@feedmepos/ui-library";
4
+ import { V as S } from "./index-pSg9p-28.js";
5
+ import { defineStore as te } from "pinia";
6
+ const oe = te("variant-manager", () => {
7
+ const B = ee(), n = P(), _ = N(n), h = K(_);
8
+ j();
9
+ const d = $(), { t: c } = D(), b = (s) => {
10
+ var y, o;
11
+ const { vNode: k } = H(
12
+ S,
13
+ d,
14
+ s
15
+ );
16
+ (o = (y = k.component) == null ? void 0 : y.exposed) == null || o.trigger();
17
+ };
18
+ async function l(s) {
19
+ b({
20
+ initialValue: s
21
+ });
22
+ }
23
+ async function v(s) {
24
+ B.open({
25
+ title: c("menu.common.dialog.remove.variant.title"),
26
+ message: c("menu.common.dialog.remove.variant.message", { name: s.name }),
27
+ primaryActions: {
28
+ text: c("menu.common.actions.remove"),
29
+ close: !0,
30
+ variant: M.Destructive
31
+ },
32
+ secondaryActions: {
33
+ text: c("menu.common.actions.cancel"),
34
+ close: !0
35
+ }
36
+ }).onPrimary(async () => {
37
+ await h.updateMenu(
38
+ {
39
+ module: G.F_MENU_MODULE_V4_KEY.enum.variant,
40
+ operation: q.F_OPERATION_TYPE.delete,
41
+ data: s._id
42
+ },
43
+ s.name,
44
+ !0
45
+ );
46
+ });
47
+ }
48
+ return {
49
+ deleteVariant: v,
50
+ updateVariant: l
51
+ };
52
+ }), le = {
53
+ key: 0,
54
+ class: "flex-1 flex flex-col overflow-hidden max-h-[calc(100vh-56px)] gap-8"
55
+ }, se = {
56
+ class: "flex justify-end"
57
+ }, ie = {
58
+ class: "w-[320px]"
59
+ }, re = {
60
+ class: "px-16 py-8"
61
+ }, ce = {
62
+ class: /* @__PURE__ */ I(["flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"])
63
+ }, me = ["onClick"], ue = {
64
+ class: "flex-1 space-y-4"
65
+ }, de = {
66
+ class: "fm-typo-en-body-lg-600"
67
+ }, pe = {
68
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
69
+ }, fe = {
70
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
71
+ }, _e = {
72
+ key: 1,
73
+ class: "xs:pt-16"
74
+ }, ke = /* @__PURE__ */ A({
75
+ __name: "Variant",
76
+ setup(B) {
77
+ const {
78
+ t: n
79
+ } = D(), _ = j(), h = K(N(P())), d = oe(), c = g(() => _.variants.map((o) => ({
80
+ ...o,
81
+ usedBy: _.items.filter((t) => {
82
+ var u;
83
+ return (u = t.variant) == null ? void 0 : u.variantGroupIds.includes(o._id);
84
+ }).map(({
85
+ _id: t
86
+ }) => ({
87
+ _id: t
88
+ }))
89
+ }))), {
90
+ filter: b,
91
+ searchKey: l
92
+ } = J(), v = g(() => c.value.filter((o) => b([o.name])));
93
+ O(() => _.selectCatalog(null));
94
+ const s = g(() => [{
95
+ accessorKey: "name",
96
+ header: () => n("menu.variant.columns.name"),
97
+ size: 360,
98
+ enableSorting: !1
99
+ }, {
100
+ accessorKey: "options",
101
+ header: () => n("menu.variant.columns.options"),
102
+ size: 560,
103
+ enableSorting: !1,
104
+ cell: (o) => {
105
+ var t;
106
+ return (t = o.getValue()) == null ? void 0 : t.map((u) => u.name).join(", ");
107
+ }
108
+ }, {
109
+ accessorKey: "usedBy",
110
+ header: () => n("menu.variant.columns.applied_products"),
111
+ enableSorting: !1,
112
+ size: 180,
113
+ cell: (o) => n("menu.common.labels.items_linked", {
114
+ count: o.getValue().length
115
+ })
116
+ }, {
117
+ id: "action",
118
+ size: 52,
119
+ meta: {
120
+ cellClass: "pl-16",
121
+ headerContentClass: "-mx-16"
122
+ },
123
+ cell: (o) => E("div", {
124
+ class: "w-full flex justify-end items-center"
125
+ }, [E(ae.FmButton, {
126
+ prependIcon: "delete",
127
+ variant: M.Tertiary,
128
+ textColor: "neutral-gray-400",
129
+ onClick: (t) => {
130
+ t.stopPropagation(), d.deleteVariant(o.row.original);
131
+ }
132
+ })])
133
+ }]), k = ne(), y = g(() => k.breakpoints.value.xs);
134
+ return (o, t) => {
135
+ const u = x("fm-search"), T = x("fm-table"), z = x("fm-button");
136
+ return m(), F(Q, {
137
+ heading: e(n)("menu.variant.title")
138
+ }, {
139
+ "append-heading": p(() => [c.value.length ? (m(), F(e(S), {
140
+ key: 0
141
+ }, {
142
+ default: p(({
143
+ trigger: a
144
+ }) => [i(W, {
145
+ class: "ml-auto",
146
+ label: e(n)("menu.variant.add"),
147
+ "prepend-icon": "add",
148
+ onClick: V(a, ["stop"])
149
+ }, null, 8, ["label", "onClick"])]),
150
+ _: 1
151
+ })) : R("", !0)]),
152
+ default: p(() => [c.value.length ? (m(), f(C, {
153
+ key: 0
154
+ }, [y.value ? (m(), f(C, {
155
+ key: 1
156
+ }, [r("div", re, [i(u, {
157
+ autofocus: "",
158
+ modelValue: e(l),
159
+ "onUpdate:modelValue": t[2] || (t[2] = (a) => L(l) ? l.value = a : null),
160
+ placeholder: e(n)("menu.common.labels.search_placeholder", {
161
+ type: "variants"
162
+ })
163
+ }, null, 8, ["modelValue", "placeholder"])]), r("div", ce, [(m(!0), f(C, null, Y(v.value, (a) => (m(), f("div", {
164
+ key: a._id,
165
+ class: I(["py-12 px-16", "flex space-x-8", "items-center", "cursor-pointer"]),
166
+ onClick: () => e(d).updateVariant(a)
167
+ }, [r("div", ue, [r("p", de, w(a.name), 1), r("div", null, [r("p", pe, w(e(n)("menu.common.labels.items_linked", {
168
+ count: a.usedBy.length
169
+ })), 1), r("p", fe, w(e(n)("menu.variant.mobile.value", {
170
+ values: a.options.map((U) => U.name).join(", ")
171
+ })), 1)])]), i(z, {
172
+ variant: e(M).Tertiary,
173
+ "prepend-icon": "delete",
174
+ "text-color": "neutral-gray-400",
175
+ onClick: V(() => e(d).deleteVariant(a), ["stop"])
176
+ }, null, 8, ["variant", "onClick"])], 8, me))), 128))])], 64)) : (m(), f("div", le, [r("div", se, [r("div", ie, [i(u, {
177
+ autofocus: "",
178
+ modelValue: e(l),
179
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => L(l) ? l.value = a : null),
180
+ placeholder: e(n)("menu.common.labels.search_placeholder", {
181
+ type: "variants"
182
+ })
183
+ }, null, 8, ["modelValue", "placeholder"])])]), i(X, null, {
184
+ default: p(() => [i(T, {
185
+ "column-defs": s.value,
186
+ loading: e(h).checkMenuIsLoading(),
187
+ "page-size": v.value.length,
188
+ "row-data": v.value,
189
+ "search-value": e(l),
190
+ "shrink-at": !1,
191
+ class: "flex-1 overflow-hidden",
192
+ "hide-footer": "",
193
+ "pin-header-row": "",
194
+ onRowClick: t[1] || (t[1] = (a) => {
195
+ e(d).updateVariant(a.original);
196
+ })
197
+ }, null, 8, ["column-defs", "loading", "page-size", "row-data", "search-value"])]),
198
+ _: 1
199
+ })]))], 64)) : (m(), f("div", _e, [i(Z, {
200
+ subtitle: e(n)("menu.variant.empty.subtitle"),
201
+ title: e(n)("menu.variant.empty.title")
202
+ }, {
203
+ action: p(() => [i(e(S), null, {
204
+ default: p(({
205
+ trigger: a
206
+ }) => [i(z, {
207
+ "prepend-icon": "add",
208
+ label: e(n)("menu.variant.add"),
209
+ onClick: V(a, ["stop"])
210
+ }, null, 8, ["label", "onClick"])]),
211
+ _: 1
212
+ })]),
213
+ _: 1
214
+ }, 8, ["subtitle", "title"])]))]),
215
+ _: 1
216
+ }, 8, ["heading"]);
217
+ };
218
+ }
219
+ });
220
+ export {
221
+ ke as default
222
+ };
@@ -0,0 +1,189 @@
1
+ import { defineComponent as B, computed as u, ref as p, watch as C, onMounted as q, resolveComponent as c, openBlock as x, createElementBlock as F, Fragment as H, createVNode as l, withCtx as r, createElementVNode as i, toDisplayString as T, unref as n, createBlock as I } from "vue";
2
+ import { useRoute as K, useRouter as W } from "vue-router";
3
+ import { a as j, u as J, n as Q, R as m, m as X, d as Z, _ as ee, f as M, i as te, D as ae } from "./app-t9ONnc0s.js";
4
+ import { useDialog as oe, useSnackbar as ne, useBreakpoints as le } from "@feedmepos/ui-library";
5
+ import { _ as se, u as ue, c as re } from "./scheduler-SRT_5Nio.js";
6
+ import { m as ie } from "./toExcel-BcgskY3F.js";
7
+ import { u as me, a as ce, _ as de, w as pe } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-Db0uYw5O.js";
8
+ import { L as A } from "./LinkProductSideSheet-BNdFZThd.js";
9
+ import { a as _e } from "./menu-ETQrtbbU.js";
10
+ const fe = { class: "px-12 py-8" }, ge = { class: "px-12 py-8" }, ve = { class: "flex ml-auto space-x-8" }, be = { class: "flex-1 flex flex-col overflow-hidden" }, Ae = /* @__PURE__ */ B({
11
+ __name: "[id]",
12
+ setup(ke) {
13
+ const D = K(), _ = W();
14
+ oe();
15
+ const S = j(ne()), y = te(S), a = J(), f = me(), g = ce(), { t: s } = Q(), R = u(() => a.categorizedRawMenuItems), V = u(() => !a.state.currentSchedulerId);
16
+ u(() => a.rules.item.multiScheduler), u(() => y.checkMenuIsLoading()), u(() => [
17
+ { label: "All Day", value: "" },
18
+ ...a.schedulers.map((t) => ({
19
+ label: t.name.length > 15 ? `${t.name.substring(0, 15)}...` : t.name,
20
+ value: t._id
21
+ }))
22
+ ]);
23
+ const L = p();
24
+ u(() => a.state.currentSchedulerId);
25
+ async function E(t) {
26
+ const e = t._id ? ue(t) : re(t);
27
+ await y.updateMenu(e, t.name);
28
+ }
29
+ const h = [
30
+ {
31
+ label: s("menu.catalog.edit.tabs.product"),
32
+ value: m.EDIT_CATALOG_PRODUCT
33
+ },
34
+ {
35
+ label: s("menu.catalog.edit.tabs.group"),
36
+ value: m.EDIT_CATALOG_GROUP
37
+ },
38
+ {
39
+ label: s("menu.catalog.edit.tabs.takeaway"),
40
+ value: m.EDIT_CATALOG_TAKEAWAY
41
+ },
42
+ {
43
+ label: s("menu.catalog.edit.tabs.setting"),
44
+ value: m.EDIT_CATALOG_SETTING
45
+ }
46
+ ], d = p(h[0].value);
47
+ C(d, (t) => {
48
+ _.replace({
49
+ name: t
50
+ });
51
+ }), q(() => {
52
+ _.currentRoute.value.name !== m.EDIT_CATALOG && (d.value = _.currentRoute.value.name);
53
+ }), C(
54
+ () => a.state.menu._id,
55
+ (t) => {
56
+ const e = D.params.id;
57
+ t && e !== "main" && a.selectCatalog(e);
58
+ }
59
+ );
60
+ const O = u(() => ({
61
+ ...X.menuV4ToV3(Z(a.state.menu)),
62
+ _id: a.state.menu._id,
63
+ _rev: a.state.menu._rev
64
+ }));
65
+ async function z() {
66
+ await S.minor(
67
+ async () => {
68
+ await a.readMenu();
69
+ const t = await ie(O.value), e = `menu_${ae().format("DD-MM-YYYY_HH-mm")}`;
70
+ await pe(t, `${e}.xlsx`, {
71
+ bookType: "xlsx",
72
+ bookSST: !1,
73
+ type: "array"
74
+ });
75
+ },
76
+ { successMessage: "Menu exported", customId: a.state.menu._id }
77
+ );
78
+ }
79
+ const v = p(!1), b = p(!1), G = le();
80
+ return u(() => G.breakpoints.value.xs), _e().resetOnUnmount(), (t, e) => {
81
+ var w;
82
+ const $ = c("fm-bottom-sheet"), U = c("fm-button"), N = c("router-link"), P = c("fm-tabs"), Y = c("router-view");
83
+ return x(), F(H, null, [
84
+ l(se, {
85
+ ref_key: "schedulerDialogRef",
86
+ ref: L,
87
+ "categorized-items": R.value,
88
+ onOnComplete: E
89
+ }, null, 8, ["categorized-items"]),
90
+ l(de, {
91
+ modelValue: v.value,
92
+ "onUpdate:modelValue": e[0] || (e[0] = (o) => v.value = o)
93
+ }, null, 8, ["modelValue"]),
94
+ l($, {
95
+ modelValue: b.value,
96
+ "onUpdate:modelValue": e[2] || (e[2] = (o) => b.value = o),
97
+ "no-header": ""
98
+ }, {
99
+ default: r(() => [
100
+ i("div", fe, [
101
+ i("p", {
102
+ class: "fm-typo-en-body-md-400",
103
+ onClick: z
104
+ }, T(n(s)("menu.catalog.edit.export")), 1)
105
+ ]),
106
+ i("div", ge, [
107
+ i("p", {
108
+ class: "fm-typo-en-body-md-400",
109
+ onClick: e[1] || (e[1] = () => {
110
+ v.value = !0, b.value = !1;
111
+ })
112
+ }, T(n(s)("menu.catalog.edit.import")), 1)
113
+ ])
114
+ ]),
115
+ _: 1
116
+ }, 8, ["modelValue"]),
117
+ l(ee, {
118
+ heading: ((w = n(a).currentCatalog) == null ? void 0 : w.name) ?? "Main",
119
+ class: "flex flex-col max-h-[calc(100vh-56px)] overflow-hidden"
120
+ }, {
121
+ "prepend-heading": r(() => [
122
+ l(N, {
123
+ to: { name: n(m).CATALOG },
124
+ class: "mr-8",
125
+ title: n(s)("menu.catalog.edit.back")
126
+ }, {
127
+ default: r(() => [
128
+ l(U, {
129
+ "prepend-icon": "arrow_back",
130
+ variant: "tertiary"
131
+ })
132
+ ]),
133
+ _: 1
134
+ }, 8, ["to", "title"])
135
+ ]),
136
+ "append-heading": r(() => [
137
+ i("div", ve, [
138
+ V.value ? (x(), I(A, {
139
+ key: 0,
140
+ "categorized-items": n(f).linkableItems,
141
+ "initial-value": n(f).currentItems,
142
+ "show-variant": !1,
143
+ onSubmit: e[3] || (e[3] = (o) => n(f).applyProduct(o.map((k) => k._id)))
144
+ }, {
145
+ default: r(({ trigger: o }) => [
146
+ l(M, {
147
+ label: n(s)("menu.catalog.edit.link_product"),
148
+ "prepend-icon": "link",
149
+ onClick: o
150
+ }, null, 8, ["label", "onClick"])
151
+ ]),
152
+ _: 1
153
+ }, 8, ["categorized-items", "initial-value"])) : (x(), I(A, {
154
+ key: 1,
155
+ "categorized-items": n(g).linkableItems,
156
+ "initial-value": n(g).currentItems,
157
+ "show-variant": !1,
158
+ onSubmit: e[4] || (e[4] = (o) => n(g).applyProduct(o.map((k) => k._id)))
159
+ }, {
160
+ default: r(({ trigger: o }) => [
161
+ l(M, {
162
+ label: n(s)("menu.catalog.edit.apply_scheduler"),
163
+ onClick: o
164
+ }, null, 8, ["label", "onClick"])
165
+ ]),
166
+ _: 1
167
+ }, 8, ["categorized-items", "initial-value"]))
168
+ ])
169
+ ]),
170
+ default: r(() => [
171
+ l(P, {
172
+ modelValue: d.value,
173
+ "onUpdate:modelValue": e[5] || (e[5] = (o) => d.value = o),
174
+ items: h,
175
+ class: "mb-7 xs:mb-0 xs:px-32"
176
+ }, null, 8, ["modelValue"]),
177
+ i("div", be, [
178
+ l(Y)
179
+ ])
180
+ ]),
181
+ _: 1
182
+ }, 8, ["heading"])
183
+ ], 64);
184
+ };
185
+ }
186
+ });
187
+ export {
188
+ Ae as default
189
+ };