@feedmepos/mf-menu 0.32.76 → 0.32.78

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 (82) hide show
  1. package/dist/{App-D2pK798q.js → App-DPCHWImL.js} +8 -8
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CHoFzx9k.js → ApplyProduct.vue_vue_type_script_setup_true_lang-C4iacJky.js} +3 -3
  3. package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-DKmzpuS7.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-BWoRN4s5.js} +3 -3
  4. package/dist/{Catalog-Da2qmeW2.js → Catalog-CBYCvZ4i.js} +6 -6
  5. package/dist/{Category-BXYjH0dH.js → Category-CbNtnuBB.js} +4 -4
  6. package/dist/{Category-QRUzSOLZ.js → Category-Dpc6jnS1.js} +14 -14
  7. package/dist/{CookingGuide-CPI7qV9Z.js → CookingGuide-B848njOa.js} +5 -5
  8. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-D-lfN4Xw.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CkNSC4k9.js} +1 -1
  9. package/dist/{Group-C4_-7vPz.js → Group-WQdbziVl.js} +1 -1
  10. package/dist/{Group-C3bKVuCF.js → Group-yhtx74q4.js} +8 -8
  11. package/dist/Group.vue_vue_type_script_setup_true_lang-Q0Z5rAEg.js +627 -0
  12. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DmZV1yCe.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-R2zzBkf0.js} +5 -5
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CmbxGud_.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-_R7RQdJk.js} +2672 -2665
  14. package/dist/{Ingredient-q8zKgNTY.js → Ingredient-C5i01EIS.js} +4 -4
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CKaRVmyj.js → InventoryBinding.vue_vue_type_script_setup_true_lang-OpRB3dyV.js} +2 -2
  16. package/dist/{LinkProductSideSheet-h94g93ZW.js → LinkProductSideSheet-Dt78f3fG.js} +4 -4
  17. package/dist/{MenuSetting-Juhf48gV.js → MenuSetting-LhwHiH3C.js} +7 -7
  18. package/dist/{OrderPacing-_4_iXa6e.js → OrderPacing-DXj4J7Sp.js} +5 -5
  19. package/dist/{PrintRoute-BujMv7Zl.js → PrintRoute-DZQYeMsQ.js} +5 -5
  20. package/dist/{Product-DnByb90X.js → Product--7aX0fcK.js} +1 -1
  21. package/dist/{Product.vue_vue_type_script_setup_true_lang-BDL64d7Q.js → Product.vue_vue_type_script_setup_true_lang-BSsS2dqJ.js} +14 -14
  22. package/dist/{ProductInternalTools-LMHxDc6R.js → ProductInternalTools-C4_r1tAz.js} +7 -7
  23. package/dist/{Products-qkRrsj1W.js → Products-CmtzWP4r.js} +40 -40
  24. package/dist/{Publish-aa8PbFqn.js → Publish-Bquodjpf.js} +4 -4
  25. package/dist/{Recipe-C5mMNuY_.js → Recipe-DanBt83W.js} +5 -5
  26. package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-DfcX0gDQ.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-Ck5gHsEQ.js} +1 -1
  27. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DJBV2o8C.js → RuleView.vue_vue_type_script_setup_true_lang-xuzVQmfE.js} +791 -791
  28. package/dist/{Scheduler-Bp05_Qv6.js → Scheduler-CNQbEpCH.js} +3 -3
  29. package/dist/{ServingSequence-Cs-ST8Oc.js → ServingSequence-BpLukp5s.js} +3 -3
  30. package/dist/{Setting-BnIq46pa.js → Setting-CqtVbgEX.js} +5 -5
  31. package/dist/{Subcategory-BAgZ5vsm.js → Subcategory-D05nSckm.js} +6 -6
  32. package/dist/{Takeaway-DUd0KVAX.js → Takeaway-BojkiMWZ.js} +1 -1
  33. package/dist/{Takeaway-BIMtyXGB.js → Takeaway-o938dKSs.js} +4 -4
  34. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-Ch-0hq7k.js → Takeaway.vue_vue_type_script_setup_true_lang-CyItVmUO.js} +5 -5
  35. package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-BfqnNbPl.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-BrLUgeet.js} +1 -1
  36. package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-CbYBwX8e.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-BlgJ9HSX.js} +2 -2
  37. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Dl7sYg0Q.js +5971 -0
  38. package/dist/{Unit-CLG2PrgL.js → Unit-BO34czMi.js} +2 -2
  39. package/dist/{Variant-Cy0JvleU.js → Variant-9hYjzP27.js} +3 -3
  40. package/dist/{_id_-jplkA1eL.js → _id_-C9EPUJMN.js} +10 -10
  41. package/dist/{app-J9vFNODI.js → app-BJeTqtv9.js} +331 -331
  42. package/dist/{app-30Z6mZbq.js → app-Br1rwkSn.js} +1 -1
  43. package/dist/app.js +1 -1
  44. package/dist/apps/mf-menu/src/app.d.ts +50 -0
  45. package/dist/apps/mf-menu/src/components/feature/GroupManager/BaseForm.vue.d.ts +5 -0
  46. package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/BaseForm.vue.d.ts +5 -0
  47. package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/index.d.ts +9 -0
  48. package/dist/apps/mf-menu/src/composable/groupHidden.d.ts +26 -0
  49. package/dist/apps/mf-menu/src/helper/itemCategories.d.ts +47 -13
  50. package/dist/apps/mf-menu/src/manager/menu/group.d.ts +12 -3
  51. package/dist/apps/mf-menu/src/manager/menu/groupExtraction.d.ts +17 -1
  52. package/dist/apps/mf-menu/src/manager/menu/groupImmutableFields.d.ts +2 -0
  53. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  54. package/dist/assets/{linked-status-BffktJ2X.js → linked-status-DeOWgUtC.js} +4 -4
  55. package/dist/assets/{menu-export-cv_rQBxw.js → menu-export-C4lP1SAy.js} +3 -3
  56. package/dist/assets/{override-menu-BxfuFlXS.js → override-menu-D_fBjnbT.js} +4 -4
  57. package/dist/assets/{validate-menu-CBVSVrx9.js → validate-menu-Cyw7mq4e.js} +3 -3
  58. package/dist/catalog-xBfYjm-n.js +235 -0
  59. package/dist/{catalogSetting-DR6N1dMx.js → catalogSetting-CuHh62ii.js} +1 -1
  60. package/dist/{currency-TzQJueZa.js → currency-CSYrHGCM.js} +1 -1
  61. package/dist/{dayjs.min-CqRhbatW.js → dayjs.min-DMxeixDE.js} +2 -2
  62. package/dist/{discardConfirm-JZF5xM6V.js → discardConfirm-DEE_kXqK.js} +1 -1
  63. package/dist/{index-BlsVC9Ep.js → index-CFAe9jDS.js} +71 -57
  64. package/dist/{index-CUViEtmn.js → index-CgR6vyM1.js} +5 -5
  65. package/dist/{index-DAkwVhKq.js → index-nDpqIsxv.js} +6 -6
  66. package/dist/{index.vue_vue_type_script_setup_true_lang-CEZndQrA.js → index.vue_vue_type_script_setup_true_lang-CDnlHcKS.js} +7 -7
  67. package/dist/{item-CqPMNjVQ.js → item-Cg4hkIm0.js} +4670 -4549
  68. package/dist/{jszip.min-BAB8KFbL.js → jszip.min-BGGp26Zm.js} +167 -167
  69. package/dist/{linkProducts-CMKCTrne.js → linkProducts-rOzmlZmQ.js} +4 -4
  70. package/dist/{memberPricing-Bv62STuu.js → memberPricing-BVC55wej.js} +1 -1
  71. package/dist/{menu-wjZ0VHbh.js → menu-sD696lXn.js} +1 -1
  72. package/dist/{menuV2-CwtrrHxb.js → menuV2-Cf41MUAw.js} +28 -28
  73. package/dist/{order_pacing-3Un89bxb.js → order_pacing-D-VDq_AN.js} +5 -5
  74. package/dist/{priceTier-CRHLKied.js → priceTier-Dajfy9ll.js} +1 -1
  75. package/dist/{rules-B_ftcBV6.js → rules-BTp32qER.js} +3 -3
  76. package/dist/{scheduler-DYeWfbj0.js → scheduler-Ct06dHRB.js} +5 -5
  77. package/dist/{toExcel-JddNv1bE.js → toExcel-BOsLuO7C.js} +2 -2
  78. package/dist/{unit-Y0iUG9B2.js → unit-D-Sppjh0.js} +3 -3
  79. package/package.json +2 -2
  80. package/dist/Group.vue_vue_type_script_setup_true_lang-CltccIA5.js +0 -622
  81. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DzeQ5yJ6.js +0 -5865
  82. package/dist/catalog-Q6KsvtTp.js +0 -199
@@ -0,0 +1,627 @@
1
+ import { defineComponent as le, computed as v, resolveComponent as V, createBlock as $, openBlock as d, withCtx as C, createElementBlock as _, Fragment as L, renderList as oe, createElementVNode as f, normalizeClass as W, toDisplayString as A, createVNode as i, createCommentVNode as R, unref as u, ref as E, watch as De, h as H, mergeProps as Te, createSlots as Pe, withModifiers as Ee, isRef as Q, nextTick as fe } from "vue";
2
+ import { l as te } from "./discardConfirm-DEE_kXqK.js";
3
+ import { d as Le } from "./RuleConditionSelector.vue_vue_type_style_index_0_lang-CK8z7qA8.js";
4
+ import { u as _e, i as Ue, b as je, F as ne, j as w, m as ze, _ as Be, a as Ke, h as ve, g as Ye } from "./index.vue_vue_type_script_setup_true_lang-CDnlHcKS.js";
5
+ import { b as ge, H as He } from "./app-5fxKLAzS.js";
6
+ import { useI18n as be, useCoreStore as qe, useCustomAttributes as Qe } from "@feedmepos/mf-common";
7
+ import { useBreakpoints as he, useSnackbar as We, useDialog as Je, components as Xe, FmButtonVariant as Ze } from "@feedmepos/ui-library";
8
+ import { _ as et, a as tt } from "./CustomAttributeChip.vue_vue_type_script_setup_true_lang-CkNSC4k9.js";
9
+ import { _ as nt } from "./app-BJeTqtv9.js";
10
+ import { _ as ot, a as lt } from "./BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js";
11
+ import { c as rt } from "./object-DVUNCr7w.js";
12
+ import { _ as at } from "./ApplyProductDialog.vue_vue_type_script_setup_true_lang-BWoRN4s5.js";
13
+ import { O as ye, as as ut, at as st, ao as it, a8 as ct, a4 as mt, U as dt } from "./item-Cg4hkIm0.js";
14
+ import { _ as pt } from "./TranslationViewChip.vue_vue_type_script_setup_true_lang-DiK3fi9J.js";
15
+ import { u as ft } from "./search-BAPEUu1R.js";
16
+ import { c as vt } from "./check-C9mY6LiX.js";
17
+ import { C as gt, e as yt, d as _t } from "./catalog-xBfYjm-n.js";
18
+ const bt = /* @__PURE__ */ le({
19
+ __name: "ResponsiveContextMenu",
20
+ props: {
21
+ items: {}
22
+ },
23
+ setup(J) {
24
+ const U = he(), r = v(() => U.breakpoints.value.xs);
25
+ return (O, N) => {
26
+ const h = V("FmButton"), k = V("FmMenuItem"), y = V("FmMenu");
27
+ return r.value ? (d(), $(ot, { key: 0 }, {
28
+ default: C(() => [
29
+ (d(!0), _(L, null, oe(O.items, ({ icon: I, label: S, disabled: x, itemClass: j, onClick: F }) => (d(), $(lt, {
30
+ key: S,
31
+ icon: I,
32
+ label: S,
33
+ disabled: x,
34
+ itemClass: j,
35
+ onClick: () => {
36
+ !x && (F == null || F());
37
+ }
38
+ }, null, 8, ["icon", "label", "disabled", "itemClass", "onClick"]))), 128))
39
+ ]),
40
+ _: 1
41
+ })) : (d(), $(y, {
42
+ key: 1,
43
+ "stop-click-propagation": "",
44
+ shift: !0
45
+ }, {
46
+ "menu-button": C(() => [
47
+ i(h, {
48
+ type: "button",
49
+ variant: "tertiary",
50
+ icon: "more_vert",
51
+ "text-color": "neutral-gray-400",
52
+ size: "md"
53
+ })
54
+ ]),
55
+ default: C(() => [
56
+ (d(!0), _(L, null, oe(O.items, ({ icon: I, label: S, disabled: x, itemClass: j, onClick: F }) => (d(), $(k, {
57
+ key: S,
58
+ disabled: x,
59
+ onClick: () => {
60
+ !x && (F == null || F());
61
+ },
62
+ label: S
63
+ }, {
64
+ label: C(() => [
65
+ f("span", {
66
+ class: W(x ? "text-fm-color-typo-disabled" : j)
67
+ }, A(S), 3)
68
+ ]),
69
+ _: 2
70
+ }, 1032, ["disabled", "onClick", "label"]))), 128))
71
+ ]),
72
+ _: 1
73
+ }));
74
+ };
75
+ }
76
+ }), ht = {
77
+ key: 0,
78
+ class: "mt-4"
79
+ }, kt = { class: "text-fm-color-typo-secondary mb-2" }, xt = { class: "list-disc list-inside text-fm-color-typo-secondary ml-4 space-y-1" }, wt = /* @__PURE__ */ le({
80
+ __name: "DeleteGroupDialog",
81
+ props: {
82
+ group: {}
83
+ },
84
+ setup(J) {
85
+ const U = J, { t: r } = be(), O = _e(), N = v(() => U.group.itemsLinked.map((h) => {
86
+ const k = O.state.menu.modules.item.find((y) => y._id === h);
87
+ return (k == null ? void 0 : k.name) || h;
88
+ }).filter(Boolean));
89
+ return (h, k) => (d(), _("div", null, [
90
+ f("div", null, A(u(r)("menu.group.dialogs.delete.message", { name: h.group.name })), 1),
91
+ N.value.length > 0 ? (d(), _("div", ht, [
92
+ f("div", kt, A(u(r)("menu.group.dialogs.delete.unlink_warning", { count: N.value.length })), 1),
93
+ f("ul", xt, [
94
+ (d(!0), _(L, null, oe(N.value, (y) => (d(), _("li", {
95
+ key: y,
96
+ class: "text-sm"
97
+ }, A(y), 1))), 128))
98
+ ])
99
+ ])) : R("", !0)
100
+ ]));
101
+ }
102
+ }), Ct = {
103
+ key: 1,
104
+ class: "xs:pt-24"
105
+ }, Mt = {
106
+ key: 0,
107
+ class: /* @__PURE__ */ W(["flex-1 overflow-hidden", "space-y-8", "flex flex-col", "overflow-hidden", "pt-16"])
108
+ }, Gt = {
109
+ class: "flex justify-between items-center space-x-8"
110
+ }, At = {
111
+ class: "w-[320px]"
112
+ }, St = {
113
+ key: 0
114
+ }, Ft = {
115
+ class: "px-16 py-8"
116
+ }, Vt = {
117
+ class: "py-8 px-16"
118
+ }, It = {
119
+ key: 0,
120
+ class: "px-16 py-8"
121
+ }, Ot = {
122
+ class: "flex items-center flex-1"
123
+ }, Nt = {
124
+ class: "flex-1 space-y-4"
125
+ }, Rt = {
126
+ class: "fm-typo-en-body-lg-600"
127
+ }, $t = {
128
+ key: 0,
129
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
130
+ }, Dt = {
131
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
132
+ }, en = /* @__PURE__ */ le({
133
+ __name: "Group",
134
+ emits: ["update:count"],
135
+ setup(J, {
136
+ emit: U
137
+ }) {
138
+ const r = _e(), O = qe(), N = We(), h = Ue(je(N)), k = Je(), y = v(() => r.rules.group), I = v(() => new ye(r, h.updateMenu, k)), S = v(() => I.value.mapGroups(r.groups, !1)), {
139
+ searchKey: x,
140
+ filter: j
141
+ } = ft(), F = E(!1), b = E(null), {
142
+ attributes: re,
143
+ filterRule: D,
144
+ mongoQuery: ae
145
+ } = Qe({
146
+ valueSource: S,
147
+ entity: "group"
148
+ }), z = v(() => {
149
+ const t = (n) => j([n.name, ...Object.values(n.items).flatMap((l) => `${l.code} ${l.name ?? l.fallbackName} ${Ke.Dinero.fromFdoDinero(l.price).toFormat()}`), n.type]), e = (n) => !n.customAttributes && !ae.value ? !0 : He(n.customAttributes ?? {}, ae.value);
150
+ return S.value.filter((n) => t(n) && e(n)).filter((n) => !b.value || n.type === b.value);
151
+ }), ke = U;
152
+ De(() => z.value.length, () => {
153
+ ke("update:count", z.value.length);
154
+ }, {
155
+ immediate: !0
156
+ });
157
+ const c = v(() => !!r.state.currentCatalogId || !!r.state.currentSchedulerId);
158
+ function ue(t) {
159
+ var P, a;
160
+ const e = !r.state.currentCatalogId, n = !r.state.currentSchedulerId, l = ((P = r.currentCatalog) == null ? void 0 : P.priceTierRules) ?? ((a = r.currentCatalog) == null ? void 0 : a.usePriceTiers), s = r.rules.item.bindToVariant, g = r.rules.group.type, p = r.version === ne.enum.v3, M = r.rules.item.orderFromActiveOnly;
161
+ return {
162
+ link: (m) => !c.value && (!m || s),
163
+ name: (m) => !c.value && !m,
164
+ isDefault: (m) => !c.value,
165
+ type: g && !t._id && !c.value,
166
+ price: !p || t.type !== w.enum.DYNAMIC,
167
+ priceEdit: !(l && l.length > 0 && !p && n),
168
+ priceTier: !p && n && e,
169
+ inventory: n ? p ? !c.value && t.type === w.enum.NORMAL : !c.value : !1,
170
+ orderFrom: (m) => n ? p ? t.type === w.enum.DYNAMIC ? !r.state.currentSchedulerId : !!r.state.currentSchedulerId == !m : !r.state.currentSchedulerId : !1,
171
+ orderFromActiveOnly: M,
172
+ showOrderFrom: n ? p ? c.value ? !0 : t.type === w.enum.PRODUCT : !0 : !1,
173
+ bindToVariant: s,
174
+ minMax: n,
175
+ hideGroup: c.value && n,
176
+ isOverride: c.value,
177
+ isItemGroup: !1,
178
+ isV4: !p
179
+ };
180
+ }
181
+ const xe = v(() => {
182
+ const t = !r.state.currentSchedulerId, e = r.rules.group.type, n = r.version === ne.enum.v3, l = r.rules.item.orderFromActiveOnly, s = r.rules.item.bindToVariant;
183
+ return function(p) {
184
+ return {
185
+ link: (M) => !c.value && (!M || s),
186
+ name: (M) => !c.value && !M,
187
+ isDefault: (M) => !c.value,
188
+ type: e && !p._id && !c.value,
189
+ price: p.type !== w.enum.DYNAMIC,
190
+ priceEdit: !0,
191
+ priceTier: r.isV4,
192
+ inventory: t ? n ? !c.value && p.type === w.enum.NORMAL : !c.value : !1,
193
+ orderFrom: (M) => t ? n ? p.type === w.enum.DYNAMIC ? c.value : !!c.value == !M : c.value : !1,
194
+ orderFromActiveOnly: l,
195
+ showOrderFrom: t ? n ? c.value ? !0 : p.type === w.enum.PRODUCT : c.value : !1,
196
+ bindToVariant: s,
197
+ minMax: !c.value,
198
+ hideGroup: !1,
199
+ isOverride: c.value,
200
+ isItemGroup: !1,
201
+ isV4: !n
202
+ };
203
+ };
204
+ }), we = v(() => ({
205
+ ...ze.generator.initMenuV4Group(),
206
+ type: r.version === ne.enum.v4 ? w.enum.PRODUCT : w.enum.NORMAL,
207
+ items: {},
208
+ position: r.groups.length - 1,
209
+ itemsLinked: []
210
+ })), X = v(() => xe.value(we.value).type);
211
+ function se(t) {
212
+ I.value.sortGroups(t);
213
+ }
214
+ function Ce(t) {
215
+ k.open({
216
+ title: o("menu.group.actions.duplicate.title"),
217
+ message: o("menu.group.actions.duplicate.message", {
218
+ name: t.name
219
+ }),
220
+ primaryActions: {
221
+ text: o("menu.common.actions.yes"),
222
+ close: !0
223
+ },
224
+ secondaryActions: {
225
+ text: o("menu.common.actions.cancel"),
226
+ close: !0
227
+ }
228
+ }).onPrimary(() => I.value.duplicateGroup(t));
229
+ }
230
+ const Z = v(() => r.currentCatalog), B = v(() => r.currentScheduler), K = v(() => new gt(Z.value, r, h.updateMenu, k)), ee = v(() => new ut(B.value, r, h.updateMenu, k)), Me = (t) => {
231
+ let e = t;
232
+ function n(l) {
233
+ const g = r.state.menu.modules.group.find((m) => m._id === l._id), p = (l.items ?? []).reduce((m, G) => (m[G._id] = [...m[G._id] || [], G.combinationKey || ""], m), {}), P = (g.items ?? []).filter((m) => {
234
+ var G;
235
+ return !((G = p[m._id]) != null && G.includes(m.combinationKey || ""));
236
+ }).map((m) => ({
237
+ _id: m._id,
238
+ combinationKey: m.combinationKey,
239
+ selection: m.selection
240
+ })).filter((m) => !!r.mergedMenu.modules.item.find((G) => G._id === m._id)), a = Object.entries(l).filter(([m, G]) => m === "min" || m === "max" ? vt.isSet(G) : !!G);
241
+ return {
242
+ ...g,
243
+ ...Object.fromEntries(a),
244
+ items: [...l.items ?? [], ...P]
245
+ };
246
+ }
247
+ if (c.value) {
248
+ let l;
249
+ Z.value ? B.value ? l = K.value.getCatalogSchedulerGroup(t._id, B.value._id) : l = K.value.getCatalogGroup(t._id) : l = ee.value.getSchedulerGroup(t._id);
250
+ const s = n(l);
251
+ e = new ye(r, h.updateMenu, k).mapGroups([s], !0)[0];
252
+ }
253
+ return {
254
+ group: e,
255
+ config: ue,
256
+ categorizedItems: r.categorizedItems
257
+ };
258
+ };
259
+ function Ge(t) {
260
+ k.open({
261
+ title: o("menu.group.dialogs.delete.title"),
262
+ contentComponent: wt,
263
+ contentComponentProps: {
264
+ group: t
265
+ },
266
+ primaryActions: {
267
+ text: o("menu.common.actions.delete"),
268
+ close: !0,
269
+ variant: Ze.Destructive
270
+ },
271
+ secondaryActions: {
272
+ text: o("menu.common.actions.cancel"),
273
+ close: !0
274
+ }
275
+ }).onPrimary(async () => {
276
+ await I.value.deleteGroup(t);
277
+ });
278
+ }
279
+ function ie(t, e) {
280
+ return H(at, {
281
+ key: t._id,
282
+ initialValue: t.itemsLinked,
283
+ group: yt(t),
284
+ editable: y.value.applyProduct,
285
+ "onApply:product": async (n) => {
286
+ var l;
287
+ for (const s of n)
288
+ if (ct(r.state.menu, t._id, s._id)) {
289
+ const g = (l = r.state.menu.modules.item.find((p) => p._id === s._id)) == null ? void 0 : l.name;
290
+ N.open({
291
+ type: "error",
292
+ message: o("menu.product.form.group.circularError", {
293
+ groupName: t.name,
294
+ productName: g
295
+ })
296
+ });
297
+ return;
298
+ }
299
+ await I.value.applyItems(t, n.map((s) => s._id));
300
+ }
301
+ }, {
302
+ default: e
303
+ });
304
+ }
305
+ const ce = (t) => {
306
+ const e = t.group;
307
+ return ie(e, ({
308
+ trigger: l
309
+ }) => {
310
+ const s = [{
311
+ label: o("menu.common.actions.edit"),
312
+ onClick: () => de(e)
313
+ }, {
314
+ label: o("menu.group.actions.apply_product"),
315
+ disable: !y.value.applyProduct,
316
+ onClick: l
317
+ }, {
318
+ label: o("menu.group.actions.duplicate_action"),
319
+ disabled: !y.value.create,
320
+ onClick: () => Ce(e)
321
+ }, {
322
+ label: o("menu.common.actions.delete"),
323
+ itemClass: "text-fm-color-typo-error",
324
+ disabled: !y.value.delete,
325
+ onClick: () => Ge(e)
326
+ }];
327
+ return i(bt, {
328
+ class: t.className,
329
+ items: s
330
+ }, null);
331
+ });
332
+ }, Ae = v(() => [{
333
+ accessorKey: "name",
334
+ header: () => o("menu.group.list.columns.name"),
335
+ enableSorting: !1,
336
+ cell: (t) => {
337
+ const e = t.row.original, n = t.getValue();
338
+ return H("div", {
339
+ class: "flex items-center gap-8"
340
+ }, [H("span", {
341
+ class: "break-all"
342
+ }, n), e.name_locale ? H(pt, {
343
+ nameLocale: e.name_locale ?? {}
344
+ }) : null]);
345
+ }
346
+ }, {
347
+ accessorKey: "items",
348
+ header: () => o("menu.group.list.columns.products"),
349
+ enableSorting: !1,
350
+ cell: (t) => {
351
+ const e = t.getValue(), n = Object.values(e).map((l) => {
352
+ var g;
353
+ const s = [(l == null ? void 0 : l.code) || "", l.name || l.fallbackName].join(" ").trim();
354
+ return (l.items || []).length > 1 ? `${s} (${o("menu.group.list.variants", {
355
+ count: (g = l.items) == null ? void 0 : g.length
356
+ })})` : s;
357
+ });
358
+ return n.length > 5 ? `${n.slice(0, 5).join(", ")} ${o("menu.group.list.more_items", {
359
+ count: n.length - 5
360
+ })}` : n.join(", ");
361
+ }
362
+ }, {
363
+ accessorKey: "type",
364
+ header: () => o("menu.group.list.columns.type"),
365
+ enableSorting: !1,
366
+ cell: (t) => {
367
+ const e = t.row.original;
368
+ return {
369
+ [w.enum.NORMAL]: o("menu.group.list.types.normal"),
370
+ [w.enum.PRODUCT]: o("menu.group.list.types.product"),
371
+ [w.enum.DYNAMIC]: o("menu.group.list.types.dynamic")
372
+ }[e.type] || "-";
373
+ },
374
+ meta: {
375
+ width: "80px"
376
+ }
377
+ }, {
378
+ id: "tagging",
379
+ accessorKey: "tagging",
380
+ header: () => o("menu.product.table.columns.tagging"),
381
+ enableSorting: !1,
382
+ size: 140,
383
+ cell: (t) => {
384
+ const e = t.row.original;
385
+ return H(et, {
386
+ // FIXME:FdoCustomAttribute under "@feedmepos/custom-attributes" is not compatible
387
+ // with FdoCustomAttribute from "@feedmepos/core", ! mark should be removed when fixed
388
+ customAttributes: e.customAttributes
389
+ });
390
+ }
391
+ }, {
392
+ accessorKey: "itemsLinked",
393
+ header: () => o("menu.group.list.columns.applied_products"),
394
+ enableSorting: !1,
395
+ cell: (t) => {
396
+ const e = t.getValue(), n = o("menu.group.list.items_linked", {
397
+ count: e.length
398
+ });
399
+ return ie(t.row.original, ({
400
+ trigger: l
401
+ }) => i("div", {
402
+ class: "w-fit cursor-pointer border-b border-dashed border-fm-color-neutral-gray-300 hover:border-fm-color-neutral-gray-400",
403
+ onClick: (s) => {
404
+ s.stopPropagation(), l(s);
405
+ }
406
+ }, [n]));
407
+ }
408
+ }, {
409
+ id: "action",
410
+ meta: {
411
+ cellClass: "pl-16",
412
+ headerContentClass: "-mx-16"
413
+ },
414
+ cell: (t) => {
415
+ const e = t.row.original;
416
+ return ce({
417
+ group: e,
418
+ className: "flex justify-end w-full"
419
+ });
420
+ }
421
+ }]), Se = v(() => {
422
+ var t;
423
+ return {
424
+ itemsLinked: y.value.showAppliedProduct,
425
+ type: y.value.type,
426
+ tagging: ((t = O.groupAttributeSettings) == null ? void 0 : t.value.length) > 0
427
+ };
428
+ }), Fe = async (t) => {
429
+ const e = mt(t), n = e.group, l = dt(n, ue(t)), s = _t(l, r.state.menu.modules.group.find((g) => g._id === l._id));
430
+ if (c.value)
431
+ Z.value ? (B.value ? K.value.overrideCatalogSchedulerGroups([s], B.value._id) : K.value.overrideCatalogGroups([s]), await K.value.update()) : (ee.value.overrideSchedulerGroups([s]), await ee.value.update());
432
+ else {
433
+ const g = {
434
+ module: ve.enum.group,
435
+ operation: Ye.F_OPERATION_TYPE.update,
436
+ data: l,
437
+ link: [{
438
+ module: ve.enum.item,
439
+ id: "",
440
+ data: e.linkItems
441
+ }]
442
+ };
443
+ await h.updateMenu(g, l.name);
444
+ }
445
+ }, T = E(null), Ve = v(() => Me(T.value)), me = E(null), de = async (t) => {
446
+ var e;
447
+ T.value = rt(t), await fe(), (e = me.value) == null || e.trigger(!0);
448
+ };
449
+ function Ie(t) {
450
+ de(t.original);
451
+ }
452
+ const Oe = he(), Ne = v(() => Oe.breakpoints.value.xs), {
453
+ t: o
454
+ } = be(), Re = v(() => {
455
+ var t;
456
+ return ((t = O.groupAttributeSettings) == null ? void 0 : t.value.length) > 0;
457
+ }), Y = E(!1), q = E(null);
458
+ async function $e() {
459
+ Y.value = !Y.value, Y.value && (await fe(), q.value && q.value.toggleProperty(!0));
460
+ }
461
+ const pe = () => y.value.multiScheduler ? i(tt, null, {
462
+ append: () => Re.value ? i("div", {
463
+ class: "pl-8 flex items-center justify-center border-l border-fm-color-neutral-gray-200",
464
+ onClick: (t) => {
465
+ t.stopPropagation(), $e();
466
+ }
467
+ }, [i(Xe.FmIcon, {
468
+ name: "filter_alt",
469
+ outline: !0,
470
+ color: "neutral-gray-400",
471
+ size: "sm"
472
+ }, null)]) : null
473
+ }) : null;
474
+ return (t, e) => {
475
+ const n = V("fm-button"), l = V("fm-chip"), s = V("fm-menu-item"), g = V("fm-menu"), p = V("fm-search"), M = V("fm-table"), P = V("fm-bottom-sheet");
476
+ return d(), _(L, null, [T.value ? (d(), $(st, Te({
477
+ ref_key: "groupManagerFormRef",
478
+ ref: me,
479
+ key: T.value._id
480
+ }, Ve.value, {
481
+ action: "update",
482
+ title: u(o)("menu.group.dialogs.update.title"),
483
+ group: T.value,
484
+ "onUpdate:group": e[0] || (e[0] = (a) => T.value = a),
485
+ "onSubmit:group": e[1] || (e[1] = (a) => Fe(a))
486
+ }), null, 16, ["title", "group"])) : R("", !0), S.value.length === 0 ? (d(), _("div", Ct, [i(Be, {
487
+ subtitle: u(o)("menu.group.empty.subtitle"),
488
+ title: u(o)("menu.group.empty.title")
489
+ }, Pe({
490
+ _: 2
491
+ }, [y.value.create ? {
492
+ name: "action",
493
+ fn: C(() => [i(u(it), null, {
494
+ default: C(({
495
+ trigger: a
496
+ }) => [i(n, {
497
+ "prepend-icon": "add",
498
+ label: u(o)("menu.group.actions.add"),
499
+ onClick: Ee(a, ["stop"])
500
+ }, null, 8, ["label", "onClick"])]),
501
+ _: 1
502
+ })]),
503
+ key: "0"
504
+ } : void 0]), 1032, ["subtitle", "title"])])) : (d(), _(L, {
505
+ key: 2
506
+ }, [Ne.value ? (d(), _(L, {
507
+ key: 1
508
+ }, [f("div", Ft, [i(p, {
509
+ autofocus: "",
510
+ modelValue: u(x),
511
+ "onUpdate:modelValue": e[9] || (e[9] = (a) => Q(x) ? x.value = a : null),
512
+ placeholder: u(o)("menu.group.search.placeholder")
513
+ }, null, 8, ["modelValue", "placeholder"])]), e[17] || (e[17] = f("div", {
514
+ class: "bg-fm-color-neutral-gray-100 w-full h-px rounded-md"
515
+ }, null, -1)), f("div", Vt, [i(pe), X.value ? (d(), $(P, {
516
+ key: 0,
517
+ modelValue: F.value,
518
+ "onUpdate:modelValue": e[14] || (e[14] = (a) => F.value = a)
519
+ }, {
520
+ "bottom-sheet-button": C(() => [i(l, {
521
+ label: u(o)("menu.group.type.title", {
522
+ type: b.value ? u(te.capitalize)(b.value) : u(o)("menu.common.labels.all")
523
+ }),
524
+ class: "text-fm-color-typo-secondary",
525
+ "right-icon": "keyboard_arrow_down"
526
+ }, null, 8, ["label"])]),
527
+ default: C(() => [f("div", null, [f("div", {
528
+ class: "px-16 py-8",
529
+ onClick: e[10] || (e[10] = (a) => b.value = null)
530
+ }, A(u(o)("menu.group.type.all")), 1), f("div", {
531
+ class: "px-16 py-8",
532
+ onClick: e[11] || (e[11] = (a) => b.value = "NORMAL")
533
+ }, A(u(o)("menu.group.type.normal")), 1), f("div", {
534
+ class: "px-16 py-8",
535
+ onClick: e[12] || (e[12] = (a) => b.value = "PRODUCT")
536
+ }, A(u(o)("menu.group.type.product")), 1), f("div", {
537
+ class: "px-16 py-8",
538
+ onClick: e[13] || (e[13] = (a) => b.value = "DYNAMIC")
539
+ }, A(u(o)("menu.group.type.dynamic")), 1)])]),
540
+ _: 1
541
+ }, 8, ["modelValue"])) : R("", !0)]), Y.value ? (d(), _("div", It, [i(u(ge), {
542
+ ref_key: "attributeFilterRef",
543
+ ref: q,
544
+ attributes: u(re),
545
+ modelValue: u(D),
546
+ "onUpdate:modelValue": e[15] || (e[15] = (a) => Q(D) ? D.value = a : null)
547
+ }, null, 8, ["attributes", "modelValue"])])) : R("", !0), i(u(Le), {
548
+ class: W(["flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"]),
549
+ "model-value": z.value,
550
+ group: "categories",
551
+ handle: ".handle",
552
+ "item-key": "_id",
553
+ "onUpdate:modelValue": e[16] || (e[16] = (a) => se(a))
554
+ }, {
555
+ item: C(({
556
+ element: a
557
+ }) => [(d(), _("div", {
558
+ key: a._id,
559
+ class: W(["py-12 px-16", "flex space-x-16", "items-center"])
560
+ }, [f("div", Ot, [f("div", Nt, [f("p", Rt, A(a.name), 1), f("div", null, [X.value ? (d(), _("p", $t, A(u(te.capitalize)(a.type)) + " type ", 1)) : R("", !0), f("p", Dt, A(u(o)("menu.group.list.products_linked", {
561
+ count: a.itemsLinked.length
562
+ })), 1)])]), i(ce, {
563
+ group: a
564
+ }, null, 8, ["group"])])]))]),
565
+ _: 1
566
+ }, 8, ["model-value"])], 64)) : (d(), _("div", Mt, [f("div", Gt, [i(pe), X.value ? (d(), $(g, {
567
+ key: 0
568
+ }, {
569
+ "menu-button": C(() => [i(l, {
570
+ label: u(o)("menu.group.type.title", {
571
+ type: b.value ? u(te.capitalize)(b.value) : u(o)("menu.common.labels.all")
572
+ }),
573
+ class: "text-fm-color-typo-secondary",
574
+ "right-icon": "keyboard_arrow_down"
575
+ }, null, 8, ["label"])]),
576
+ default: C(() => [f("div", null, [i(s, {
577
+ class: "px-16 py-8",
578
+ label: u(o)("menu.group.type.all"),
579
+ onClick: e[2] || (e[2] = (a) => b.value = null)
580
+ }, null, 8, ["label"]), i(s, {
581
+ class: "px-16 py-8",
582
+ label: u(o)("menu.group.type.normal"),
583
+ onClick: e[3] || (e[3] = (a) => b.value = "NORMAL")
584
+ }, null, 8, ["label"]), i(s, {
585
+ class: "px-16 py-8",
586
+ label: u(o)("menu.group.type.product"),
587
+ onClick: e[4] || (e[4] = (a) => b.value = "PRODUCT")
588
+ }, null, 8, ["label"]), i(s, {
589
+ class: "px-16 py-8",
590
+ label: u(o)("menu.group.type.dynamic"),
591
+ onClick: e[5] || (e[5] = (a) => b.value = "DYNAMIC")
592
+ }, null, 8, ["label"])])]),
593
+ _: 1
594
+ })) : R("", !0), f("div", At, [i(p, {
595
+ autofocus: "",
596
+ modelValue: u(x),
597
+ "onUpdate:modelValue": e[6] || (e[6] = (a) => Q(x) ? x.value = a : null),
598
+ placeholder: u(o)("menu.group.search.placeholder")
599
+ }, null, 8, ["modelValue", "placeholder"])])]), Y.value ? (d(), _("div", St, [i(u(ge), {
600
+ ref_key: "attributeFilterRef",
601
+ ref: q,
602
+ attributes: u(re),
603
+ modelValue: u(D),
604
+ "onUpdate:modelValue": e[7] || (e[7] = (a) => Q(D) ? D.value = a : null)
605
+ }, null, 8, ["attributes", "modelValue"])])) : R("", !0), i(nt, null, {
606
+ default: C(() => [i(M, {
607
+ "column-defs": Ae.value,
608
+ "column-visibility": Se.value,
609
+ loading: u(h).checkMenuIsLoading(),
610
+ "page-size": z.value.length,
611
+ "row-data": z.value,
612
+ "shrink-at": !1,
613
+ class: "flex-1 overflow-hidden",
614
+ draggable: "",
615
+ "hide-footer": "",
616
+ "pin-header-row": "",
617
+ onRowClick: Ie,
618
+ onDndChanged: e[8] || (e[8] = (a) => se(a))
619
+ }, null, 8, ["column-defs", "column-visibility", "loading", "page-size", "row-data"])]),
620
+ _: 1
621
+ })]))], 64))], 64);
622
+ };
623
+ }
624
+ });
625
+ export {
626
+ en as _
627
+ };
@@ -1,14 +1,14 @@
1
1
  import { defineComponent as N, useModel as K, computed as B, resolveComponent as d, createBlock as I, openBlock as b, ref as L, watch as W, withCtx as f, createElementBlock as F, createElementVNode as U, Fragment as q, renderList as X, createVNode as u, unref as e, createCommentVNode as $, withModifiers as Q, onMounted as te, renderSlot as le, toDisplayString as h, createTextVNode as ae } from "vue";
2
2
  import { useI18n as z, useCustomAttributes as ue, useCoreStore as re, isEmptyRule as oe, EMPTY_RULE as w } from "@feedmepos/mf-common";
3
3
  import { _ as x } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
4
- import { u as D } from "./priceTier-CRHLKied.js";
4
+ import { u as D } from "./priceTier-Dajfy9ll.js";
5
5
  import { b as O } from "./app-5fxKLAzS.js";
6
6
  import { FmButtonVariant as Z, useDialog as ne, components as ie, FmButtonColorThemeVariant as Y } from "@feedmepos/ui-library";
7
- import { m as j, f as G, e as se, _ as me } from "./RuleView.vue_vue_type_script_setup_true_lang-DJBV2o8C.js";
8
- import { L as R } from "./catalogSetting-DR6N1dMx.js";
9
- import { L as de } from "./LinkProductSideSheet-h94g93ZW.js";
7
+ import { m as j, f as G, e as se, _ as me } from "./RuleView.vue_vue_type_script_setup_true_lang-xuzVQmfE.js";
8
+ import { L as R } from "./catalogSetting-CuHh62ii.js";
9
+ import { L as de } from "./LinkProductSideSheet-Dt78f3fG.js";
10
10
  import { c as H } from "./check-C9mY6LiX.js";
11
- import { u as pe, d as J, Y as ce } from "./index.vue_vue_type_script_setup_true_lang-CEZndQrA.js";
11
+ import { u as pe, d as J, Y as ce } from "./index.vue_vue_type_script_setup_true_lang-CDnlHcKS.js";
12
12
  import { c as ve } from "./string-DpfFixWH.js";
13
13
  const _e = /* @__PURE__ */ N({
14
14
  __name: "LinkPriceTier",