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