@feedmepos/mf-menu 0.23.10-prod.2 → 0.23.10-prod.3

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 (60) hide show
  1. package/dist/{App-C8YvLeTF.js → App-CUdOF1lD.js} +3 -3
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CTFJvWM4.js → ApplyProduct.vue_vue_type_script_setup_true_lang-C0EsSY5o.js} +2 -2
  3. package/dist/{Catalog-ClzUdFxt.js → Catalog-DQ3qzamR.js} +20 -20
  4. package/dist/{Category-Cmfpovi8.js → Category-BEfmTsto.js} +5 -5
  5. package/dist/{CookingGuide-iOt0swkn.js → CookingGuide-BlGNp0gD.js} +4 -4
  6. package/dist/{Group-DAvakz4L.js → Group-B_TWCv5p.js} +3 -3
  7. package/dist/{Group-DYmn8IOl.js → Group-msc3rkCR.js} +1 -1
  8. package/dist/Group.vue_vue_type_script_setup_true_lang-BZongvdE.js +589 -0
  9. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BUxXXG6k.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-DZ7YvsYT.js} +2 -2
  10. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-BZrQQSZJ.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-B4HjTI4n.js} +29495 -26316
  11. package/dist/{Ingredient-C1f4ZN7_.js → Ingredient-D6c6GtL9.js} +15 -15
  12. package/dist/InventoryBinding.vue_vue_type_script_setup_true_lang-D07Mn484.js +21909 -0
  13. package/dist/{LinkProductSideSheet-DtdP_0BL.js → LinkProductSideSheet-FGQN0RjX.js} +2 -2
  14. package/dist/{MenuSetting-DI38_4FS.js → MenuSetting-CROJoPLL.js} +2 -2
  15. package/dist/{PrintRoute-GTCRYqGb.js → PrintRoute-BQkAmutA.js} +4 -4
  16. package/dist/{Product-Dkasmjmt.js → Product-BCOosmBf.js} +1 -1
  17. package/dist/{Product.vue_vue_type_script_setup_true_lang-mGnQ2LUs.js → Product.vue_vue_type_script_setup_true_lang-wBpGPDSk.js} +10 -10
  18. package/dist/Products-DeT0VXY4.js +327 -0
  19. package/dist/{Publish-H42TQv2L.js → Publish-DqiH_qtX.js} +30 -30
  20. package/dist/{Recipe-DUoZ7TTF.js → Recipe-DoH-Zx-x.js} +14 -14
  21. package/dist/{Scheduler-CdO9E38B.js → Scheduler-BXnsSB0J.js} +3 -3
  22. package/dist/{SchedulerSelector.vue_vue_type_script_setup_true_lang-CJPgvvv7.js → SchedulerSelector.vue_vue_type_script_setup_true_lang-Dodk0Sro.js} +1 -1
  23. package/dist/{ServingSequence-9PQmhk2e.js → ServingSequence-CTl_2Eav.js} +3 -3
  24. package/dist/{Setting-nYK5jgil.js → Setting-Da-WTI2Q.js} +4 -4
  25. package/dist/{Takeaway-QpAn57vg.js → Takeaway-C0gEPnF9.js} +1 -1
  26. package/dist/{Takeaway-CFVXJXbf.js → Takeaway-DkB3Fedy.js} +4 -4
  27. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-BMJwiQr6.js → Takeaway.vue_vue_type_script_setup_true_lang-DA-1Dbck.js} +5 -5
  28. package/dist/{Unit-CYIhqZeX.js → Unit-DHYLncIX.js} +2 -2
  29. package/dist/{Variant-D4yWn2iM.js → Variant-CBO_rkOu.js} +3 -3
  30. package/dist/{_id_-DCKaeAgj.js → _id_-0m5rPhWo.js} +7 -7
  31. package/dist/{app-BUcYRyrl.js → app-B8Q4Y-Fy.js} +1 -1
  32. package/dist/{app-DQYJxThv.js → app-CzifZMeS.js} +515 -679
  33. package/dist/app.js +1 -1
  34. package/dist/apps/mf-menu/src/app.d.ts +2 -0
  35. package/dist/apps/mf-menu/src/components/import/PreviewAddonContent.vue.d.ts +71 -0
  36. package/dist/apps/mf-menu/src/components/import/PreviewContent2.vue.d.ts +7 -3
  37. package/dist/apps/mf-menu/src/helper/import-export.d.ts +176 -116
  38. package/dist/apps/mf-menu/src/manager/menu/item.d.ts +2 -0
  39. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  40. package/dist/assets/{linked-status-BVq3G91g.js → linked-status-DYP1aR1Y.js} +3 -3
  41. package/dist/assets/{override-menu-BSF4at2W.js → override-menu-kB69jb7a.js} +3 -3
  42. package/dist/assets/{validate-menu-CecOIaf7.js → validate-menu-BfPd18qC.js} +3 -3
  43. package/dist/{catalog-D7Ldv7BK.js → catalog-BceRoIR7.js} +1 -1
  44. package/dist/{catalogSetting-BYgjjocH.js → catalogSetting-C4uMnH59.js} +1 -1
  45. package/dist/{currency-CN3EG_m3.js → currency-DE-aZP97.js} +1 -1
  46. package/dist/{discardConfirm-BQpwWpH7.js → discardConfirm-BBQeyzO_.js} +1 -1
  47. package/dist/{index-BZ4Y7cEu.js → index-DIUiBgC4.js} +3 -3
  48. package/dist/{index-BhU6NNaY.js → index-DkT8pmkQ.js} +4 -4
  49. package/dist/{item-C2drLoa9.js → item-BDe4ci28.js} +2445 -2389
  50. package/dist/{menu-BeISDKAr.js → menu-Cm-vmC2P.js} +1 -1
  51. package/dist/{menu-Cij6u5dZ.js → menu-q1fS_eLt.js} +19 -19
  52. package/dist/{remy-BGM4_GGa.js → remy-jsi7Gg_X.js} +2 -2
  53. package/dist/{scheduler-1DH1E_Uz.js → scheduler-CiZNsD7o.js} +4 -4
  54. package/dist/style.css +1 -1
  55. package/dist/{toExcel-C1OFwAWV.js → toExcel-CxZ1LIqR.js} +2 -2
  56. package/dist/{unit-TjPR0QL1.js → unit-BxL1Pe1l.js} +5 -5
  57. package/package.json +7 -6
  58. package/dist/Group.vue_vue_type_script_setup_true_lang-eHQf10NK.js +0 -576
  59. package/dist/InventoryBinding.vue_vue_type_script_setup_true_lang-5-qX5lbB.js +0 -7393
  60. package/dist/Products-WjNex4as.js +0 -244
@@ -1,576 +0,0 @@
1
- import { defineComponent as W, computed as b, resolveComponent as C, openBlock as v, createBlock as V, withCtx as k, createElementBlock as F, Fragment as T, renderList as ne, createVNode as c, createElementVNode as p, normalizeClass as j, toDisplayString as P, ref as S, renderSlot as Oe, unref as n, watch as we, mergeProps as De, createCommentVNode as E, createSlots as Ce, withModifiers as Me, isRef as le, h as xe, nextTick as Ae } from "vue";
2
- import { l as z, u as Ge } from "./discardConfirm-BQpwWpH7.js";
3
- import { V as Fe } from "./vuedraggable-WU01qJgi.js";
4
- import { u as ue, K as Pe, B as Ve, z as Ne, G as f, A as Re, J as Ue } from "./menu-Cij6u5dZ.js";
5
- import { useI18n as se } from "@feedmepos/mf-common";
6
- import { useBreakpoints as ie, components as Ee, useSnackbar as Se, useDialog as Te, FmButtonVariant as Ie } from "@feedmepos/ui-library";
7
- import { _ as $e } from "./app-DQYJxThv.js";
8
- import { _ as Ye, a as Le } from "./BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DPis3HVx.js";
9
- import { c as ze } from "./object-DNBFWMt7.js";
10
- import { _ as Ke } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-CTFJvWM4.js";
11
- import { c as je } from "./check-C9mY6LiX.js";
12
- import { _ as Be } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
13
- import { M as ae, S as qe, _ as He, A as Je, e as Qe, b as We } from "./item-C2drLoa9.js";
14
- import { _ as re } from "./SchedulerSelector.vue_vue_type_script_setup_true_lang-CJPgvvv7.js";
15
- import { u as Xe } from "./search-7ZYHUW7s.js";
16
- import { C as Ze } from "./catalog-D7Ldv7BK.js";
17
- const et = /* @__PURE__ */ W({
18
- __name: "ResponsiveContextMenu",
19
- props: {
20
- items: {}
21
- },
22
- setup(B) {
23
- const I = ie(), a = b(() => I.breakpoints.value.xs);
24
- return (M, G) => {
25
- const h = C("FmButton"), O = C("FmMenuItem"), R = C("FmMenu");
26
- return a.value ? (v(), V(Ye, { key: 0 }, {
27
- default: k(() => [
28
- (v(!0), F(T, null, ne(M.items, ({ icon: _, label: w, disabled: x, itemClass: s, onClick: d }) => (v(), V(Le, {
29
- key: w,
30
- icon: _,
31
- label: w,
32
- disabled: x,
33
- itemClass: s,
34
- onClick: () => {
35
- !x && (d == null || d());
36
- }
37
- }, null, 8, ["icon", "label", "disabled", "itemClass", "onClick"]))), 128))
38
- ]),
39
- _: 1
40
- })) : (v(), V(R, {
41
- key: 1,
42
- "stop-click-propagation": "",
43
- shift: !0
44
- }, {
45
- "menu-button": k(() => [
46
- c(h, {
47
- type: "button",
48
- variant: "tertiary",
49
- icon: "more_vert",
50
- "text-color": "neutral-gray-400",
51
- size: "md"
52
- })
53
- ]),
54
- default: k(() => [
55
- (v(!0), F(T, null, ne(M.items, ({ icon: _, label: w, disabled: x, itemClass: s, onClick: d }) => (v(), V(O, {
56
- key: w,
57
- disabled: x,
58
- onClick: () => {
59
- !x && (d == null || d());
60
- },
61
- label: w
62
- }, {
63
- label: k(() => [
64
- p("span", {
65
- class: j(x ? "text-fm-color-typo-disabled" : s)
66
- }, P(w), 3)
67
- ]),
68
- _: 2
69
- }, 1032, ["disabled", "onClick", "label"]))), 128))
70
- ]),
71
- _: 1
72
- }));
73
- };
74
- }
75
- }), tt = { class: "fm-typo-en-title-md-600" }, ot = { class: "flex gap-8 items-center justify-start" }, nt = /* @__PURE__ */ W({
76
- __name: "ApplyProductDialog",
77
- props: {
78
- title: {},
79
- initialValue: {},
80
- group: {},
81
- editable: { type: Boolean }
82
- },
83
- emits: ["apply:product"],
84
- setup(B, { emit: I }) {
85
- const a = B, M = I, { t: G } = se(), h = a.initialValue.map((s) => ({ _id: s })), O = S(z.clone(h)), R = Ge(
86
- () => !z.isEqual(O.value, h),
87
- () => {
88
- _.value = !1;
89
- }
90
- ), _ = S(!1), w = (s) => {
91
- je.isBoolean(s) ? _.value = s : _.value = !_.value, _.value && (O.value = a.initialValue.map((d) => ({ _id: d })));
92
- }, x = ue();
93
- return (s, d) => {
94
- const K = C("fm-button"), u = C("fm-side-sheet");
95
- return v(), F(T, null, [
96
- Oe(s.$slots, "default", { trigger: w }),
97
- c(u, {
98
- id: "group-form",
99
- modelValue: _.value,
100
- "onUpdate:modelValue": d[1] || (d[1] = ($) => _.value = $),
101
- "is-container": n(Ee).FmForm,
102
- "is-container-props": {
103
- onValidationSuccess: () => {
104
- M("apply:product", O.value), w(!1);
105
- },
106
- blameFormChildOnValidationFailed: !0
107
- },
108
- "max-width": 560,
109
- "onOn:clickedAway": n(R)
110
- }, {
111
- "side-sheet-header": k(() => [
112
- p("p", tt, P(s.title), 1)
113
- ]),
114
- "side-sheet-footer": k(() => [
115
- p("div", ot, [
116
- c(K, {
117
- label: n(G)("common.save"),
118
- size: "lg",
119
- type: "submit",
120
- variant: "primary"
121
- }, null, 8, ["label"]),
122
- c(K, {
123
- label: "Cancel",
124
- size: "lg",
125
- variant: "tertiary",
126
- onClick: w
127
- })
128
- ])
129
- ]),
130
- default: k(() => [
131
- c(Ke, {
132
- overrides: O.value,
133
- "onUpdate:overrides": d[0] || (d[0] = ($) => O.value = $),
134
- "categorized-items": n(x).categorizedItems,
135
- editable: s.editable,
136
- "select-variant": !1,
137
- "show-variant": !1,
138
- "link-button-label": n(G)("menu.group.actions.apply_product"),
139
- title: "Product"
140
- }, null, 8, ["overrides", "categorized-items", "editable", "link-button-label"])
141
- ]),
142
- _: 1
143
- }, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"])
144
- ], 64);
145
- };
146
- }
147
- }), lt = {
148
- key: 1,
149
- class: "xs:pt-24"
150
- }, at = {
151
- key: 0,
152
- class: /* @__PURE__ */ j(["flex-1 overflow-hidden", "space-y-8", "flex flex-col", "overflow-hidden"])
153
- }, rt = {
154
- class: "flex justify-between items-center space-x-8"
155
- }, ut = {
156
- class: "w-[320px]"
157
- }, st = {
158
- class: "px-16 py-8"
159
- }, it = {
160
- class: "py-8 px-16"
161
- }, mt = {
162
- class: "flex items-center flex-1"
163
- }, ct = {
164
- class: "flex-1 space-y-4"
165
- }, dt = {
166
- class: "fm-typo-en-body-lg-600"
167
- }, pt = {
168
- key: 0,
169
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
170
- }, vt = {
171
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
172
- }, Pt = /* @__PURE__ */ W({
173
- __name: "Group",
174
- emits: ["update:count"],
175
- setup(B, {
176
- emit: I
177
- }) {
178
- const a = ue(), M = Pe(Ve(Se())), G = Te(), h = b(() => a.rules.group), O = b(() => new ae(a, M.updateMenu, G)), R = b(() => O.value.mapGroups(a.groups, !1)), {
179
- searchKey: _,
180
- filter: w
181
- } = Xe(), x = S(!1), s = S(null), d = b(() => R.value.filter((t) => w([t.name, ...Object.values(t.items).flatMap((e) => `${e.code} ${e.name} ${Ne.Dinero.fromFdoDinero(e.price).toFormat()}`), t.type])).filter((t) => !s.value || t.type === s.value)), K = I;
182
- we(() => d.value.length, () => {
183
- K("update:count", d.value.length);
184
- }, {
185
- immediate: !0
186
- });
187
- const u = b(() => !!a.state.currentCatalogId || !!a.state.currentSchedulerId);
188
- function $(t) {
189
- const e = !a.state.currentSchedulerId, l = a.rules.item.bindToVariant, i = a.rules.group.type, m = a.version === f.F_MENU_VERSION.enum.v3, D = a.rules.item.orderFromActiveOnly;
190
- return {
191
- link: (y) => !u.value && (!y || l),
192
- name: (y) => !u.value && !y,
193
- isDefault: (y) => !u.value,
194
- type: i && !t._id && !u.value,
195
- price: t.type !== f.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
196
- inventory: e ? m ? !u.value && t.type === f.F_ADDON_GROUP_TYPE.enum.NORMAL : !u.value : !1,
197
- orderFrom: (y) => e ? m ? t.type === f.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? u.value : !!u.value == !y : u.value : !1,
198
- orderFromActiveOnly: D,
199
- showOrderFrom: e ? m ? u.value ? !0 : t.type === f.F_ADDON_GROUP_TYPE.enum.PRODUCT : u.value : !1,
200
- bindToVariant: l,
201
- isOverride: u.value,
202
- isItemGroup: !1,
203
- isV4: !m
204
- };
205
- }
206
- const me = b(() => {
207
- const t = !a.state.currentSchedulerId, e = a.rules.group.type, l = a.version === f.F_MENU_VERSION.enum.v3, i = a.rules.item.orderFromActiveOnly, m = a.rules.item.bindToVariant;
208
- return function(y) {
209
- return {
210
- link: (A) => !u.value && (!A || m),
211
- name: (A) => !u.value && !A,
212
- isDefault: (A) => !u.value,
213
- type: e && !y._id && !u.value,
214
- price: y.type !== f.F_ADDON_GROUP_TYPE.enum.DYNAMIC,
215
- inventory: t ? l ? !u.value && y.type === f.F_ADDON_GROUP_TYPE.enum.NORMAL : !u.value : !1,
216
- orderFrom: (A) => t ? l ? y.type === f.F_ADDON_GROUP_TYPE.enum.DYNAMIC ? u.value : !!u.value == !A : u.value : !1,
217
- orderFromActiveOnly: i,
218
- showOrderFrom: t ? l ? u.value ? !0 : y.type === f.F_ADDON_GROUP_TYPE.enum.PRODUCT : u.value : !1,
219
- bindToVariant: m,
220
- isOverride: u.value,
221
- isItemGroup: !1,
222
- isV4: !l
223
- };
224
- };
225
- }), ce = b(() => ({
226
- ...Re.generator.initMenuV4Group(),
227
- type: a.version === f.F_MENU_VERSION.enum.v4 ? f.F_ADDON_GROUP_TYPE.enum.PRODUCT : f.F_ADDON_GROUP_TYPE.enum.NORMAL,
228
- items: {},
229
- position: a.groups.length - 1,
230
- itemsLinked: []
231
- })), q = b(() => me.value(ce.value).type);
232
- function X(t) {
233
- O.value.sortGroups(t);
234
- }
235
- function de(t) {
236
- G.open({
237
- title: o("menu.group.actions.duplicate.title"),
238
- message: o("menu.group.actions.duplicate.message", {
239
- name: t.name
240
- }),
241
- primaryActions: {
242
- text: o("menu.common.actions.yes"),
243
- close: !0
244
- },
245
- secondaryActions: {
246
- text: o("menu.common.actions.cancel"),
247
- close: !0
248
- }
249
- }).onPrimary(() => O.value.duplicateGroup(t));
250
- }
251
- const H = b(() => a.currentCatalog), Y = b(() => a.currentScheduler), L = b(() => new Ze(H.value, a, M.updateMenu, G)), J = b(() => new qe(Y.value, a, M.updateMenu, G)), pe = (t) => {
252
- let e = t;
253
- if (u.value) {
254
- let i = function(D) {
255
- const A = a.state.menu.modules.group.find((g) => g._id === D._id), Q = (D.items ?? []).reduce((g, N) => (g[N._id] = [...g[N._id] || [], N.combinationKey || ""], g), {}), he = (A.items ?? []).filter((g) => {
256
- var N;
257
- return !((N = Q[g._id]) != null && N.includes(g.combinationKey || ""));
258
- }).map((g) => ({
259
- _id: g._id,
260
- combinationKey: g.combinationKey,
261
- selection: g.selection
262
- })).filter((g) => !!a.mergedMenu.modules.item.find((N) => N._id === g._id));
263
- return {
264
- ...A,
265
- ...Object.fromEntries(Object.entries(D).filter(([, g]) => !!g)),
266
- items: [...D.items ?? [], ...he]
267
- };
268
- }, l;
269
- H.value ? Y.value ? l = L.value.getCatalogSchedulerGroup(t._id, Y.value._id) : l = L.value.getCatalogGroup(t._id) : l = J.value.getSchedulerGroup(t._id);
270
- const m = i(l);
271
- e = new ae(a, M.updateMenu, G).mapGroups([m], !0)[0];
272
- }
273
- return {
274
- group: e,
275
- config: $,
276
- categorizedItems: a.categorizedItems
277
- };
278
- };
279
- function ve(t) {
280
- G.open({
281
- title: o("menu.group.dialogs.delete.title"),
282
- message: o("menu.group.dialogs.delete.message", {
283
- name: t.name
284
- }),
285
- primaryActions: {
286
- text: o("menu.common.actions.delete"),
287
- close: !0,
288
- variant: Ie.Destructive
289
- },
290
- secondaryActions: {
291
- text: o("menu.common.actions.cancel"),
292
- close: !0
293
- }
294
- }).onPrimary(async () => O.value.deleteGroup(t));
295
- }
296
- function Z(t, e) {
297
- return xe(nt, {
298
- key: t._id,
299
- initialValue: t.itemsLinked,
300
- group: Qe(t),
301
- editable: h.value.applyProduct,
302
- "onApply:product": async (l) => {
303
- await O.value.applyItems(t, l.map((i) => i._id));
304
- }
305
- }, {
306
- default: e
307
- });
308
- }
309
- const ee = (t) => {
310
- const e = t.group;
311
- return Z(e, ({
312
- trigger: i
313
- }) => {
314
- const m = [{
315
- label: o("menu.common.actions.edit"),
316
- onClick: () => oe(e)
317
- }, {
318
- label: o("menu.group.actions.apply_product"),
319
- disable: !h.value.applyProduct,
320
- onClick: i
321
- }, {
322
- label: o("menu.group.actions.duplicate_action"),
323
- disabled: !h.value.create,
324
- onClick: () => de(e)
325
- }, {
326
- label: o("menu.common.actions.delete"),
327
- itemClass: "text-fm-color-typo-error",
328
- disabled: !h.value.delete,
329
- onClick: () => ve(e)
330
- }];
331
- return c(et, {
332
- class: t.className,
333
- items: m
334
- }, null);
335
- });
336
- }, fe = b(() => [{
337
- accessorKey: "name",
338
- header: () => o("menu.group.list.columns.name"),
339
- enableSorting: !1
340
- }, {
341
- accessorKey: "items",
342
- header: () => o("menu.group.list.columns.products"),
343
- enableSorting: !1,
344
- cell: (t) => {
345
- const e = t.getValue(), l = Object.values(e).map((i) => {
346
- var D;
347
- const m = [(i == null ? void 0 : i.code) || "", i.name ?? i.fallbackName].join(" ").trim();
348
- return (i.items || []).length > 1 ? `${m} (${o("menu.group.list.variants", {
349
- count: (D = i.items) == null ? void 0 : D.length
350
- })})` : m;
351
- });
352
- return l.length > 5 ? `${l.slice(0, 5).join(", ")} ${o("menu.group.list.more_items", {
353
- count: l.length - 5
354
- })}` : l.join(", ");
355
- }
356
- }, {
357
- accessorKey: "type",
358
- header: () => o("menu.group.list.columns.type"),
359
- enableSorting: !1,
360
- cell: (t) => {
361
- const e = t.row.original;
362
- return {
363
- [f.F_ADDON_GROUP_TYPE.enum.NORMAL]: o("menu.group.list.types.normal"),
364
- [f.F_ADDON_GROUP_TYPE.enum.PRODUCT]: o("menu.group.list.types.product"),
365
- [f.F_ADDON_GROUP_TYPE.enum.DYNAMIC]: o("menu.group.list.types.dynamic")
366
- }[e.type] || "-";
367
- },
368
- meta: {
369
- width: "80px"
370
- }
371
- }, {
372
- accessorKey: "itemsLinked",
373
- header: () => o("menu.group.list.columns.applied_products"),
374
- enableSorting: !1,
375
- cell: (t) => {
376
- const e = t.getValue(), l = o("menu.group.list.items_linked", {
377
- count: e.length
378
- });
379
- return Z(t.row.original, ({
380
- trigger: i
381
- }) => c("div", {
382
- class: "w-fit cursor-pointer border-b border-dashed border-fm-color-neutral-gray-300 hover:border-fm-color-neutral-gray-400",
383
- onClick: (m) => {
384
- m.stopPropagation(), i(m);
385
- }
386
- }, [l]));
387
- }
388
- }, {
389
- id: "action",
390
- meta: {
391
- cellClass: "pl-16",
392
- headerContentClass: "-mx-16"
393
- },
394
- cell: (t) => {
395
- const e = t.row.original;
396
- return ee({
397
- group: e,
398
- className: "flex justify-end w-full"
399
- });
400
- }
401
- }]), _e = b(() => ({
402
- itemsLinked: h.value.showAppliedProduct,
403
- type: h.value.type
404
- })), ye = async (t) => {
405
- const e = We(t), l = e.group;
406
- if (u.value)
407
- H.value ? (Y.value ? L.value.overrideCatalogSchedulerGroups([l], Y.value._id) : L.value.overrideCatalogGroups([l]), await L.value.update()) : (J.value.overrideSchedulerGroups([l]), await J.value.update());
408
- else {
409
- const i = {
410
- module: f.F_MENU_MODULE_V4_KEY.enum.group,
411
- operation: Ue.F_OPERATION_TYPE.update,
412
- data: l,
413
- link: [{
414
- module: f.F_MENU_MODULE_V4_KEY.enum.item,
415
- id: "",
416
- data: e.linkItems
417
- }]
418
- };
419
- await M.updateMenu(i, l.name);
420
- }
421
- }, U = S(null), te = S(null), oe = async (t) => {
422
- var e;
423
- U.value = ze(t), await Ae(), (e = te.value) == null || e.trigger(!0);
424
- };
425
- function ge(t) {
426
- oe(t.original);
427
- }
428
- const be = ie(), ke = b(() => be.breakpoints.value.xs), {
429
- t: o
430
- } = se();
431
- return (t, e) => {
432
- const l = C("fm-button"), i = C("fm-chip"), m = C("fm-menu-item"), D = C("fm-menu"), y = C("fm-search"), A = C("fm-table"), Q = C("fm-bottom-sheet");
433
- return v(), F(T, null, [U.value ? (v(), V(He, De({
434
- ref_key: "groupManagerFormRef",
435
- ref: te,
436
- key: U.value._id
437
- }, pe(U.value), {
438
- action: "update",
439
- title: n(o)("menu.group.dialogs.update.title"),
440
- group: U.value,
441
- "onUpdate:group": e[0] || (e[0] = (r) => U.value = r),
442
- "onSubmit:group": e[1] || (e[1] = (r) => ye(r))
443
- }), null, 16, ["title", "group"])) : E("", !0), R.value.length === 0 ? (v(), F("div", lt, [c(Be, {
444
- subtitle: n(o)("menu.group.empty.subtitle"),
445
- title: n(o)("menu.group.empty.title")
446
- }, Ce({
447
- _: 2
448
- }, [h.value.create ? {
449
- name: "action",
450
- fn: k(() => [c(n(Je), null, {
451
- default: k(({
452
- trigger: r
453
- }) => [c(l, {
454
- "prepend-icon": "add",
455
- label: n(o)("menu.group.actions.add"),
456
- onClick: Me(r, ["stop"])
457
- }, null, 8, ["label", "onClick"])]),
458
- _: 1
459
- })]),
460
- key: "0"
461
- } : void 0]), 1032, ["subtitle", "title"])])) : (v(), F(T, {
462
- key: 2
463
- }, [ke.value ? (v(), F(T, {
464
- key: 1
465
- }, [p("div", st, [c(y, {
466
- autofocus: "",
467
- modelValue: n(_),
468
- "onUpdate:modelValue": e[8] || (e[8] = (r) => le(_) ? _.value = r : null),
469
- placeholder: n(o)("menu.group.search.placeholder")
470
- }, null, 8, ["modelValue", "placeholder"])]), e[15] || (e[15] = p("div", {
471
- class: "bg-fm-color-neutral-gray-100 w-full h-px rounded-md"
472
- }, null, -1)), p("div", it, [h.value.multiScheduler ? (v(), V(re, {
473
- key: 0
474
- })) : E("", !0), q.value ? (v(), V(Q, {
475
- key: 1,
476
- modelValue: x.value,
477
- "onUpdate:modelValue": e[13] || (e[13] = (r) => x.value = r)
478
- }, {
479
- "bottom-sheet-button": k(() => [c(i, {
480
- label: n(o)("menu.group.type.title", {
481
- type: s.value ? n(z.capitalize)(s.value) : n(o)("menu.common.labels.all")
482
- }),
483
- class: "text-fm-color-typo-secondary",
484
- "right-icon": "keyboard_arrow_down"
485
- }, null, 8, ["label"])]),
486
- default: k(() => [p("div", null, [p("div", {
487
- class: "px-16 py-8",
488
- onClick: e[9] || (e[9] = (r) => s.value = null)
489
- }, P(n(o)("menu.group.type.all")), 1), p("div", {
490
- class: "px-16 py-8",
491
- onClick: e[10] || (e[10] = (r) => s.value = "NORMAL")
492
- }, P(n(o)("menu.group.type.normal")), 1), p("div", {
493
- class: "px-16 py-8",
494
- onClick: e[11] || (e[11] = (r) => s.value = "PRODUCT")
495
- }, P(n(o)("menu.group.type.product")), 1), p("div", {
496
- class: "px-16 py-8",
497
- onClick: e[12] || (e[12] = (r) => s.value = "DYNAMIC")
498
- }, P(n(o)("menu.group.type.dynamic")), 1)])]),
499
- _: 1
500
- }, 8, ["modelValue"])) : E("", !0)]), c(n(Fe), {
501
- class: j(["flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"]),
502
- "model-value": d.value,
503
- group: "categories",
504
- handle: ".handle",
505
- "item-key": "_id",
506
- "onUpdate:modelValue": e[14] || (e[14] = (r) => X(r))
507
- }, {
508
- item: k(({
509
- element: r
510
- }) => [(v(), F("div", {
511
- key: r._id,
512
- class: j(["py-12 px-16", "flex space-x-16", "items-center"])
513
- }, [p("div", mt, [p("div", ct, [p("p", dt, P(r.name), 1), p("div", null, [q.value ? (v(), F("p", pt, P(n(z.capitalize)(r.type)) + " type ", 1)) : E("", !0), p("p", vt, P(n(o)("menu.group.list.products_linked", {
514
- count: r.itemsLinked.length
515
- })), 1)])]), c(ee, {
516
- group: r
517
- }, null, 8, ["group"])])]))]),
518
- _: 1
519
- }, 8, ["model-value"])], 64)) : (v(), F("div", at, [p("div", rt, [h.value.multiScheduler ? (v(), V(re, {
520
- key: 0
521
- })) : E("", !0), q.value ? (v(), V(D, {
522
- key: 1
523
- }, {
524
- "menu-button": k(() => [c(i, {
525
- label: n(o)("menu.group.type.title", {
526
- type: s.value ? n(z.capitalize)(s.value) : n(o)("menu.common.labels.all")
527
- }),
528
- class: "text-fm-color-typo-secondary",
529
- "right-icon": "keyboard_arrow_down"
530
- }, null, 8, ["label"])]),
531
- default: k(() => [p("div", null, [c(m, {
532
- class: "px-16 py-8",
533
- label: n(o)("menu.group.type.all"),
534
- onClick: e[2] || (e[2] = (r) => s.value = null)
535
- }, null, 8, ["label"]), c(m, {
536
- class: "px-16 py-8",
537
- label: n(o)("menu.group.type.normal"),
538
- onClick: e[3] || (e[3] = (r) => s.value = "NORMAL")
539
- }, null, 8, ["label"]), c(m, {
540
- class: "px-16 py-8",
541
- label: n(o)("menu.group.type.product"),
542
- onClick: e[4] || (e[4] = (r) => s.value = "PRODUCT")
543
- }, null, 8, ["label"]), c(m, {
544
- class: "px-16 py-8",
545
- label: n(o)("menu.group.type.dynamic"),
546
- onClick: e[5] || (e[5] = (r) => s.value = "DYNAMIC")
547
- }, null, 8, ["label"])])]),
548
- _: 1
549
- })) : E("", !0), p("div", ut, [c(y, {
550
- autofocus: "",
551
- modelValue: n(_),
552
- "onUpdate:modelValue": e[6] || (e[6] = (r) => le(_) ? _.value = r : null),
553
- placeholder: n(o)("menu.group.search.placeholder")
554
- }, null, 8, ["modelValue", "placeholder"])])]), c($e, null, {
555
- default: k(() => [c(A, {
556
- "column-defs": fe.value,
557
- "column-visibility": _e.value,
558
- loading: n(M).checkMenuIsLoading(),
559
- "page-size": d.value.length,
560
- "row-data": d.value,
561
- "shrink-at": !1,
562
- class: "flex-1 overflow-hidden",
563
- draggable: "",
564
- "hide-footer": "",
565
- "pin-header-row": "",
566
- onRowClick: ge,
567
- onDndChanged: e[7] || (e[7] = (r) => X(r))
568
- }, null, 8, ["column-defs", "column-visibility", "loading", "page-size", "row-data"])]),
569
- _: 1
570
- })]))], 64))], 64);
571
- };
572
- }
573
- });
574
- export {
575
- Pt as _
576
- };