@feedmepos/mf-menu 0.32.39-dev.1 → 0.32.40-dev

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 (98) hide show
  1. package/dist/{App-DRncp_Ei.js → App-_MLzeklD.js} +5 -5
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CkxXD8WW.js → ApplyProduct.vue_vue_type_script_setup_true_lang-UstB0HCf.js} +3 -3
  3. package/dist/{Catalog-DUiSF-WF.js → Catalog-CmM9e7VE.js} +6 -6
  4. package/dist/{Category-DE197NW1.js → Category-C72bnp32.js} +5 -5
  5. package/dist/{Category-DVPD4xrP.js → Category-ab7o-IpT.js} +4 -4
  6. package/dist/{CookingGuide-CHoGojcW.js → CookingGuide-CcW7ludO.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-dLiFrsWf.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CfBX_YEE.js} +1 -1
  8. package/dist/{Group-BXV1pM34.js → Group-BSoAjpHp.js} +3 -3
  9. package/dist/{Group-DMegQbpX.js → Group-DD1lzsQY.js} +1 -1
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-C_fcE1nx.js → Group.vue_vue_type_script_setup_true_lang-BUeaIf4N.js} +116 -116
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-wPIx9YCb.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CFeyZvxS.js} +5 -5
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CPMD7DRL.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-C8nNRSHM.js} +1958 -1942
  13. package/dist/{Ingredient-Dfibdd-o.js → Ingredient-824DB4pP.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-BN4dh1LS.js → InventoryBinding.vue_vue_type_script_setup_true_lang-NpqmWdGE.js} +2 -2
  15. package/dist/{LinkProductSideSheet-D6Mqf5Hl.js → LinkProductSideSheet-DdyUWMWm.js} +3 -3
  16. package/dist/{MenuSetting-BESOJBlx.js → MenuSetting-DUX-xalJ.js} +5 -5
  17. package/dist/{PrintRoute-TPhGObk9.js → PrintRoute-CdTJK7Pp.js} +4 -4
  18. package/dist/{Product-Dp6HbElI.js → Product-Cbto_NJg.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-PDIUXdAC.js → Product.vue_vue_type_script_setup_true_lang-CP2VvoZ6.js} +13 -13
  20. package/dist/{ProductInternalTools-LWUFfPxo.js → ProductInternalTools-C_314g2l.js} +5 -5
  21. package/dist/{Products-Do5CagOW.js → Products-BEKsOtCj.js} +19 -19
  22. package/dist/{Publish-BD-AclFq.js → Publish-CN9S-t8t.js} +3 -3
  23. package/dist/{Recipe-Hzo2Izmw.js → Recipe-BCSIDC6j.js} +4 -4
  24. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DhSvT1fH.js → RuleView.vue_vue_type_script_setup_true_lang-DlW4Zx5S.js} +2 -2
  25. package/dist/{Scheduler-pTJ_CkJq.js → Scheduler-ZG2xvJvE.js} +3 -3
  26. package/dist/{ServingSequence-CvwLzA7G.js → ServingSequence-D8moUhOq.js} +3 -3
  27. package/dist/{Setting-BiUPxIvh.js → Setting-BKq7u_IL.js} +5 -5
  28. package/dist/Subcategory-BgTadpyj.js +349 -0
  29. package/dist/{Takeaway-CWNo49PD.js → Takeaway-C9bpWn4s.js} +4 -4
  30. package/dist/{Takeaway-C9dqWzrT.js → Takeaway-DyJrzpN-.js} +1 -1
  31. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CpUGSiIF.js → Takeaway.vue_vue_type_script_setup_true_lang-aFnWB49Z.js} +6 -6
  32. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-D8oVVt5f.js → Thumbnail.vue_vue_type_script_setup_true_lang-MKl8NdrG.js} +4 -4
  33. package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-wnFIuSpr.js +194 -0
  34. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Bye20Huu.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B556mEdE.js} +1907 -1899
  35. package/dist/{Unit-DKV2cfnv.js → Unit-CG_GyiVH.js} +2 -2
  36. package/dist/{Variant-CBr8tub8.js → Variant-D_ZlWQ43.js} +4 -4
  37. package/dist/{_id_-Ce6NN5vT.js → _id_-CSInNRCp.js} +9 -9
  38. package/dist/{app-CImDLyt0.js → app-b4ZmiMK2.js} +26 -26
  39. package/dist/{app-B7B_bbMc.js → app-vIXTx6c7.js} +1 -1
  40. package/dist/app.js +1 -1
  41. package/dist/apps/mf-menu/src/components/ProductTranslationDialog.vue.d.ts +4 -0
  42. package/dist/apps/mf-menu/src/components/TranslationFieldSection.vue.d.ts +7 -3
  43. package/dist/apps/mf-menu/src/components/TranslationSideSheet.vue.d.ts +2 -0
  44. package/dist/apps/mf-menu/src/components/feature/ApplyProduct/index.d.ts +6 -0
  45. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierButton.vue.d.ts +6 -0
  46. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierForm.vue.d.ts +6 -0
  47. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/item.d.ts +6 -0
  48. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/scheduler.d.ts +3 -0
  49. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/useItemFormManagement.d.ts +3 -0
  50. package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ItemForm.vue.d.ts +9 -0
  51. package/dist/apps/mf-menu/src/components/feature/TreeEditor/menuUtils.d.ts +3 -0
  52. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +7 -0
  53. package/dist/apps/mf-menu/src/components/import/PreviewAddonContent.vue.d.ts +6 -0
  54. package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +3 -0
  55. package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +17 -0
  56. package/dist/apps/mf-menu/src/helper/itemCategories.d.ts +3 -0
  57. package/dist/apps/mf-menu/src/helper/menu.d.ts +3 -0
  58. package/dist/apps/mf-menu/src/helper/menuExport.d.ts +2 -2
  59. package/dist/apps/mf-menu/src/helper/menuImport.d.ts +7 -0
  60. package/dist/apps/mf-menu/src/helper/menuSanitizer.d.ts +7 -0
  61. package/dist/apps/mf-menu/src/manager/menu/item.d.ts +7 -0
  62. package/dist/apps/mf-menu/src/stores/manager/item.d.ts +9 -0
  63. package/dist/apps/mf-menu/src/stores/manager/scheduler.d.ts +3 -0
  64. package/dist/apps/mf-menu/src/stores/menu.d.ts +7 -0
  65. package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/Form.vue.d.ts +6 -0
  66. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  67. package/dist/assets/linked-status-J1LJXkYU.js +13 -0
  68. package/dist/assets/{menu-export-C2ctrNOt.js → menu-export-C4zy8Etx.js} +45 -45
  69. package/dist/assets/override-menu-CwpHJJ36.js +13 -0
  70. package/dist/assets/validate-menu-WYp7xh5-.js +13 -0
  71. package/dist/{catalog-RXap_5ft.js → catalog-Ce7o_N7a.js} +1 -1
  72. package/dist/{catalogSetting-D10sgkdu.js → catalogSetting-CeTOf9lJ.js} +1 -1
  73. package/dist/{currency-CPC6-Naj.js → currency-hq_koFDw.js} +1 -1
  74. package/dist/{dayjs.min-BgxdFykA.js → dayjs.min-UytF3izD.js} +1 -1
  75. package/dist/index-BydcrqXX.js +545 -0
  76. package/dist/{index-D35XBgVx.js → index-DYh6XlbG.js} +1 -1
  77. package/dist/{index-BWlfJ1Hv.js → index-WFUD7oh5.js} +58 -54
  78. package/dist/{index.vue_vue_type_script_setup_true_lang-CbdGF_YP.js → index.vue_vue_type_script_setup_true_lang-DOhr-m71.js} +14226 -14185
  79. package/dist/{item-Chx3oZ7b.js → item-BBqfgtk1.js} +2968 -2926
  80. package/dist/{jszip.min-DH0CoV5k.js → jszip.min-C4UMTEuA.js} +2 -2
  81. package/dist/{menu-DZhJl6lE.js → menu-CGK50Gwb.js} +1 -1
  82. package/dist/{menuV2-B1fegOdA.js → menuV2-DiyUO2p3.js} +50 -50
  83. package/dist/mf-menu.css +1 -1
  84. package/dist/{priceTier-C-ocPg-3.js → priceTier-eEeeQpw0.js} +1 -1
  85. package/dist/rules-BDtO9_2x.js +216 -0
  86. package/dist/{scheduler-J-XrlyVY.js → scheduler-C-UR0pvC.js} +4 -4
  87. package/dist/{toExcel-C9btsoRs.js → toExcel-Dr3CybYc.js} +2 -2
  88. package/dist/translation-Cdap0IVg.js +79 -0
  89. package/dist/{unit-Gtkb_1WB.js → unit-DMQom_GI.js} +2 -2
  90. package/package.json +3 -3
  91. package/dist/Subcategory-BpWPnu4s.js +0 -345
  92. package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-BSfPHkEr.js +0 -185
  93. package/dist/assets/linked-status-uqBsZwlR.js +0 -13
  94. package/dist/assets/override-menu-C-S-pdcA.js +0 -13
  95. package/dist/assets/validate-menu-D4bw2s4G.js +0 -13
  96. package/dist/index-B6yzhB_O.js +0 -539
  97. package/dist/rules-BBgzPaJ8.js +0 -212
  98. package/dist/translation-BeqjfyEb.js +0 -75
@@ -0,0 +1,349 @@
1
+ import { defineComponent as z, ref as x, computed as V, watch as te, resolveComponent as C, createElementBlock as k, openBlock as p, Fragment as A, renderSlot as oe, createVNode as m, unref as n, withCtx as y, createElementVNode as c, renderList as H, toDisplayString as T, h as N, withModifiers as J, getCurrentInstance as ne, createBlock as U, createCommentVNode as le } from "vue";
2
+ import { useI18n as R } from "@feedmepos/mf-common";
3
+ import { useSnackbar as P, components as W, useDialog as X, FmButtonVariant as q, useBreakpoints as se, FmButtonColorThemeVariant as ie } from "@feedmepos/ui-library";
4
+ import { _ as re } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
+ import { G as Y, u as K, Q as G, M as Z, A as ee, a4 as ce } from "./index.vue_vue_type_script_setup_true_lang-DOhr-m71.js";
6
+ import { _ as ue } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
7
+ import { _ as me } from "./app-b4ZmiMK2.js";
8
+ import { c as de } from "./createForm-BoUQeZTd.js";
9
+ import { u as pe } from "./discardConfirm-BHni0LNu.js";
10
+ import { c as Q } from "./object-DVUNCr7w.js";
11
+ import { r as _e, u as ae } from "./rules-BDtO9_2x.js";
12
+ import { _ as fe } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-wnFIuSpr.js";
13
+ import { c as ve } from "./check-C9mY6LiX.js";
14
+ import { g as I } from "./translation-Cdap0IVg.js";
15
+ import { a as ge } from "./menu-CGK50Gwb.js";
16
+ const ye = {
17
+ class: "fm-typo-en-title-md-600"
18
+ }, be = {
19
+ class: "flex flex-col gap-32 h-full min-h-0 py-16"
20
+ }, he = {
21
+ class: "py-12 px-16 space-y-4"
22
+ }, xe = {
23
+ class: "flex gap-8 items-center justify-start"
24
+ }, Ce = /* @__PURE__ */ z({
25
+ __name: "Form",
26
+ props: {
27
+ initialValue: {}
28
+ },
29
+ setup(D, {
30
+ expose: w
31
+ }) {
32
+ const h = D, S = P(), F = Y(S), E = G(F), d = K(), {
33
+ t: l
34
+ } = R(), L = x(!1), o = x(!1), $ = x(!1), u = x(void 0), M = (e) => {
35
+ ve.isBoolean(e) ? o.value = e : o.value = !o.value;
36
+ }, s = x(Q(h.initialValue)), O = V(() => !!s.value.name), B = V(() => {
37
+ var b;
38
+ const e = [], t = "en-US", a = (b = u.value) == null ? void 0 : b[t];
39
+ return s.value.name && !a && e.push({
40
+ locale: t,
41
+ name: s.value.name,
42
+ localeDisplay: I(t)
43
+ }), u.value && Object.entries(u.value).filter(([g, f]) => f && f.trim()).sort(([g], [f]) => g.localeCompare(f)).forEach(([g, f]) => {
44
+ e.push({
45
+ locale: g,
46
+ name: f,
47
+ localeDisplay: I(g)
48
+ });
49
+ }), e;
50
+ });
51
+ function j(e) {
52
+ u.value = e;
53
+ }
54
+ function i(e) {
55
+ s.value.name = e;
56
+ }
57
+ const r = pe(() => {
58
+ const e = d.subcategories.find((f) => f._id === s.value._id), t = s.value.name !== (e == null ? void 0 : e.name), a = (e == null ? void 0 : e.name_locale) || {}, b = u.value || {}, g = JSON.stringify(a) !== JSON.stringify(b);
59
+ return t || g;
60
+ }, () => {
61
+ o.value = !1;
62
+ });
63
+ async function _() {
64
+ const e = d.subcategories.find((a) => a._id === s.value._id), {
65
+ updateMenu: t
66
+ } = E;
67
+ await t({
68
+ module: ee.F_MENU_MODULE_V4_KEY.enum.subCategory,
69
+ operation: Z.F_OPERATION_TYPE.update,
70
+ // @ts-ignore FIXME: The backend hasn't exported SubcategoryRequest yet. Fix this once it's available.
71
+ data: {
72
+ ...e,
73
+ name: s.value.name ?? (e == null ? void 0 : e.name),
74
+ ...u.value && {
75
+ name_locale: u.value
76
+ }
77
+ }
78
+ }, s.value.name), M(!1);
79
+ }
80
+ return te(() => o.value, () => {
81
+ if (!o.value) return;
82
+ s.value = Q(h.initialValue);
83
+ const e = d.subcategories.find((t) => t._id === s.value._id);
84
+ u.value = e == null ? void 0 : e.name_locale;
85
+ }), w({
86
+ trigger: M,
87
+ show: o
88
+ }), (e, t) => {
89
+ const a = C("fm-button"), b = C("FmTooltip"), g = C("FmTextField"), f = C("fm-side-sheet");
90
+ return p(), k(A, null, [oe(e.$slots, "default", {
91
+ trigger: M
92
+ }), m(f, {
93
+ id: "group-form",
94
+ modelValue: o.value,
95
+ "onUpdate:modelValue": t[3] || (t[3] = (v) => o.value = v),
96
+ "is-container": n(W).FmForm,
97
+ "is-container-props": {
98
+ onValidationSuccess: _,
99
+ blameFormChildOnValidationFailed: !0
100
+ },
101
+ "max-width": 560,
102
+ "onOn:clickedAway": n(r)
103
+ }, {
104
+ "side-sheet-header": y(() => [c("p", ye, T(n(l)("menu.subcategory.title")), 1)]),
105
+ "side-sheet-footer": y(() => [c("div", xe, [m(a, {
106
+ label: n(l)("menu.common.actions.update"),
107
+ loading: L.value,
108
+ size: "lg",
109
+ type: "submit",
110
+ variant: "primary",
111
+ disabled: !s.value._id
112
+ }, null, 8, ["label", "loading", "disabled"]), m(a, {
113
+ label: n(l)("menu.common.actions.cancel"),
114
+ size: "lg",
115
+ variant: "tertiary",
116
+ onClick: t[2] || (t[2] = () => o.value = !1)
117
+ }, null, 8, ["label"])])]),
118
+ default: y(() => [c("div", be, [m(g, {
119
+ label: n(l)("menu.subcategory.name"),
120
+ modelValue: s.value.name,
121
+ "onUpdate:modelValue": t[1] || (t[1] = (v) => s.value.name = v),
122
+ disabled: !s.value._id,
123
+ rules: [n(_e)]
124
+ }, {
125
+ append: y(() => [m(b, {
126
+ variant: "plain",
127
+ placement: "top",
128
+ "z-index": 999
129
+ }, {
130
+ content: y(() => [c("div", he, [(p(!0), k(A, null, H(B.value, (v) => (p(), k("div", {
131
+ key: v.locale
132
+ }, T(v.name) + " (" + T(v.localeDisplay) + ") ", 1))), 128))])]),
133
+ default: y(() => [m(a, {
134
+ variant: "tertiary",
135
+ icon: "g_translate",
136
+ onClick: t[0] || (t[0] = (v) => $.value = !0),
137
+ disabled: !O.value
138
+ }, null, 8, ["disabled"])]),
139
+ _: 1
140
+ })]),
141
+ _: 1
142
+ }, 8, ["label", "modelValue", "disabled", "rules"])])]),
143
+ _: 1
144
+ }, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"]), m(fe, {
145
+ modelValue: $.value,
146
+ "onUpdate:modelValue": t[4] || (t[4] = (v) => $.value = v),
147
+ title: n(l)("menu.subcategory.title"),
148
+ name: s.value.name,
149
+ "name-locale": u.value,
150
+ "onUpdate:name": i,
151
+ "onUpdate:nameLocale": j
152
+ }, null, 8, ["modelValue", "title", "name", "name-locale"])], 64);
153
+ };
154
+ }
155
+ }), ke = Ce, Ve = {
156
+ key: 0
157
+ }, we = {
158
+ class: "flex justify-end items-center"
159
+ }, Fe = {
160
+ class: "w-[320px]"
161
+ }, Le = {
162
+ key: 1,
163
+ class: "flex-1 flex flex-col min-h-0"
164
+ }, $e = {
165
+ class: "p-8"
166
+ }, Se = {
167
+ class: "flex flex-1 flex-col min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64"
168
+ }, Ee = ["onClick"], Me = {
169
+ class: "flex-1 space-y-4"
170
+ }, Ne = {
171
+ class: "fm-typo-en-body-lg-600"
172
+ }, Te = /* @__PURE__ */ z({
173
+ __name: "SubcategoryTable",
174
+ setup(D) {
175
+ const w = X(), h = P(), S = Y(h), F = G(S), E = ae({
176
+ dialog: w,
177
+ menuLoader: F
178
+ }), d = V(() => K().subcategories), l = x(""), L = V(() => d.value.filter((i) => i.name.toLowerCase().includes(l.value.toLowerCase()))), {
179
+ t: o
180
+ } = R(), $ = x([{
181
+ accessorKey: "name",
182
+ header: () => o("menu.subcategory.columns.title"),
183
+ enableSorting: !1,
184
+ meta: {
185
+ width: "auto"
186
+ },
187
+ cell: (i) => {
188
+ const r = i.row.original, _ = i.getValue(), t = Object.keys(r.name_locale ?? {}).map((a) => I(a));
189
+ return N("div", {
190
+ class: "flex items-center gap-8"
191
+ }, [N("span", {
192
+ class: "break-all"
193
+ }, _), ...t.map((a) => N("div", {
194
+ class: "rounded-lg border border-fm-color-primary text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600 px-8"
195
+ }, a))]);
196
+ }
197
+ }, {
198
+ id: "actions",
199
+ size: 52,
200
+ meta: {
201
+ cellClass: "pl-16",
202
+ headerContentClass: "-mx-16"
203
+ },
204
+ header: "",
205
+ cell: (i) => {
206
+ const r = i.row.original;
207
+ return N("div", {
208
+ class: "flex justify-end"
209
+ }, [N(W.FmButton, {
210
+ icon: "delete",
211
+ disabled: !r._id,
212
+ variant: "tertiary",
213
+ textColor: "neutral-gray-400",
214
+ onClick: J(async () => {
215
+ await u(r);
216
+ }, ["stop", "prevent"])
217
+ })]);
218
+ }
219
+ }]);
220
+ async function u(i) {
221
+ if (!i._id) {
222
+ h.open({
223
+ message: o("menu.subcategory.dialog.remove.error"),
224
+ type: "warning"
225
+ });
226
+ return;
227
+ }
228
+ w.open({
229
+ title: o("menu.subcategory.dialog.remove.title"),
230
+ message: o("menu.common.dialog.remove_confirmation", {
231
+ name: i.name
232
+ }),
233
+ primaryActions: {
234
+ text: "Remove",
235
+ close: !0,
236
+ variant: q.Destructive
237
+ },
238
+ secondaryActions: {
239
+ text: "Cancel",
240
+ close: !0
241
+ }
242
+ }).onPrimary(async () => {
243
+ await F.updateMenu({
244
+ module: ee.F_MENU_MODULE_V4_KEY.enum.subCategory,
245
+ operation: Z.F_OPERATION_TYPE.delete,
246
+ data: i._id
247
+ }, i.name, !0);
248
+ });
249
+ }
250
+ async function M(i) {
251
+ const r = i.map((_) => _._id).filter((_) => !!_);
252
+ await E.rearrange(r);
253
+ }
254
+ const s = ne();
255
+ async function O(i) {
256
+ de(s, ke, {
257
+ initialValue: i
258
+ });
259
+ }
260
+ const B = se(), j = V(() => B.breakpoints.value.xs);
261
+ return (i, r) => {
262
+ const _ = C("FmSearch"), e = C("FmTable"), t = C("FmButton");
263
+ return j.value ? (p(), k("div", Le, [c("div", $e, [m(_, {
264
+ autofocus: "",
265
+ modelValue: l.value,
266
+ "onUpdate:modelValue": r[2] || (r[2] = (a) => l.value = a),
267
+ class: "w-full",
268
+ placeholder: n(o)("menu.common.labels.search_placeholder", {
269
+ type: "categories"
270
+ })
271
+ }, null, 8, ["modelValue", "placeholder"])]), c("div", Se, [(p(!0), k(A, null, H(L.value, (a) => (p(), k("div", {
272
+ key: a._id || "",
273
+ class: "flex flex-row py-12 px-16",
274
+ onClick: (b) => O(a)
275
+ }, [c("div", Me, [c("p", Ne, T(a.name), 1)]), m(t, {
276
+ "text-color": n(ie).NeutralGray400,
277
+ variant: n(q).Tertiary,
278
+ "prepend-icon": "delete",
279
+ disabled: !a._id,
280
+ onClick: J((b) => u(a), ["stop"])
281
+ }, null, 8, ["text-color", "variant", "disabled", "onClick"])], 8, Ee))), 128))])])) : (p(), k("div", Ve, [c("div", we, [c("div", Fe, [m(_, {
282
+ modelValue: l.value,
283
+ "onUpdate:modelValue": r[0] || (r[0] = (a) => l.value = a),
284
+ autofocus: "",
285
+ class: "mb-8",
286
+ placeholder: n(o)("menu.common.labels.search_placeholder", {
287
+ type: n(o)("menu.subcategory.title")
288
+ })
289
+ }, null, 8, ["modelValue", "placeholder"])])]), m(me, null, {
290
+ default: y(() => [m(e, {
291
+ "column-defs": $.value,
292
+ draggable: !0,
293
+ "page-size": d.value.length,
294
+ "row-data": d.value,
295
+ "search-value": l.value,
296
+ "shrink-at": !1,
297
+ "hide-footer": "",
298
+ "pin-header-row": "",
299
+ onDndChanged: M,
300
+ onRowClick: r[1] || (r[1] = (a) => O(a.original))
301
+ }, null, 8, ["column-defs", "page-size", "row-data", "search-value"])]),
302
+ _: 1
303
+ })]));
304
+ };
305
+ }
306
+ }), Oe = { class: "flex-1 flex justify-between gap-8 pl-8" }, Ue = { class: "flex items-center" }, De = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Be = { class: "fm-typo-en-body-md-600 font-semibold" }, Ze = /* @__PURE__ */ z({
307
+ __name: "Subcategory",
308
+ setup(D) {
309
+ const w = X(), h = P(), S = Y(h), F = G(S), E = ae({ dialog: w, menuLoader: F }), d = V(() => K().subcategories), { t: l } = R();
310
+ function L() {
311
+ E.create();
312
+ }
313
+ const o = V(() => d.value.length);
314
+ return ge().resetOnMount(), ($, u) => (p(), U(ue, {
315
+ heading: n(l)("menu.subcategory.title")
316
+ }, {
317
+ default: y(() => [
318
+ d.value.length > 0 ? (p(), U(Te, { key: 0 })) : (p(), U(n(ce), {
319
+ key: 1,
320
+ action: {
321
+ text: n(l)("menu.subcategory.add"),
322
+ callback: L
323
+ },
324
+ subtitle: n(l)("menu.subcategory.empty.subtitle"),
325
+ title: n(l)("menu.subcategory.empty.title")
326
+ }, null, 8, ["action", "subtitle", "title"]))
327
+ ]),
328
+ "append-heading": y(() => [
329
+ c("div", Oe, [
330
+ c("div", Ue, [
331
+ c("div", De, [
332
+ c("p", Be, T(o.value), 1)
333
+ ])
334
+ ]),
335
+ d.value.length > 0 ? (p(), U(re, {
336
+ key: 0,
337
+ label: n(l)("menu.subcategory.add"),
338
+ "prepend-icon": "add",
339
+ onClick: L
340
+ }, null, 8, ["label"])) : le("", !0)
341
+ ])
342
+ ]),
343
+ _: 1
344
+ }, 8, ["heading"]));
345
+ }
346
+ });
347
+ export {
348
+ Ze as default
349
+ };
@@ -1,12 +1,12 @@
1
1
  import { defineComponent as f, computed as y, ref as k, createBlock as i, openBlock as d, unref as a, withCtx as s, createElementVNode as t, toDisplayString as b, createCommentVNode as g, createVNode as m } from "vue";
2
- import { G as x, u as v, Q as w, M as E, A as M } from "./index.vue_vue_type_script_setup_true_lang-CbdGF_YP.js";
2
+ import { G as x, u as v, Q as w, M as E, A as M } from "./index.vue_vue_type_script_setup_true_lang-DOhr-m71.js";
3
3
  import { useI18n as T } from "@feedmepos/mf-common";
4
4
  import { useSnackbar as V } from "@feedmepos/ui-library";
5
5
  import { _ as h } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
6
6
  import { _ as C } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
7
- import { _ as N } from "./Takeaway.vue_vue_type_script_setup_true_lang-CpUGSiIF.js";
8
- import { T as S, l as L } from "./index-BWlfJ1Hv.js";
9
- import { a as O } from "./menu-DZhJl6lE.js";
7
+ import { _ as N } from "./Takeaway.vue_vue_type_script_setup_true_lang-aFnWB49Z.js";
8
+ import { T as S, l as L } from "./index-WFUD7oh5.js";
9
+ import { a as O } from "./menu-CGK50Gwb.js";
10
10
  const U = { class: "flex-1 flex justify-between gap-8 pl-8" }, B = { class: "flex items-center" }, F = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, A = { class: "fm-typo-en-body-md-600 font-semibold" }, z = /* @__PURE__ */ f({
11
11
  __name: "Takeaway",
12
12
  setup(D) {
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./Takeaway.vue_vue_type_script_setup_true_lang-CpUGSiIF.js";
1
+ import { _ as f } from "./Takeaway.vue_vue_type_script_setup_true_lang-aFnWB49Z.js";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,15 +1,15 @@
1
1
  import { getCurrentInstance as te, defineComponent as oe, computed as x, watch as ne, h as E, resolveComponent as O, createElementBlock as C, openBlock as _, Fragment as P, normalizeClass as Y, createElementVNode as k, createVNode as V, unref as n, isRef as j, withCtx as F, renderList as ie, createBlock as G, createCommentVNode as $, toDisplayString as S, withModifiers as Q } from "vue";
2
- import { G as H, u as J, Q as W, M as N, A as z, I as A, B as se, ap as q, a4 as re } from "./index.vue_vue_type_script_setup_true_lang-CbdGF_YP.js";
2
+ import { G as H, u as J, Q as W, M as N, A as z, I as A, B as se, ap as q, a4 as re } from "./index.vue_vue_type_script_setup_true_lang-DOhr-m71.js";
3
3
  import { useI18n as X, useCoreStore as le } from "@feedmepos/mf-common";
4
4
  import { useDialog as ce, useSnackbar as Z, FmButtonVariant as D, components as de, useBreakpoints as me } from "@feedmepos/ui-library";
5
- import { _ as ue } from "./app-CImDLyt0.js";
6
- import { a as pe, l as ee, T as ye } from "./index-BWlfJ1Hv.js";
5
+ import { _ as ue } from "./app-b4ZmiMK2.js";
6
+ import { a as pe, l as ee, T as ye } from "./index-WFUD7oh5.js";
7
7
  import { u as fe } from "./search-BAPEUu1R.js";
8
- import { f as L } from "./currency-CPC6-Naj.js";
8
+ import { f as L } from "./currency-hq_koFDw.js";
9
9
  import { defineStore as _e } from "pinia";
10
- import { C as ke } from "./catalog-RXap_5ft.js";
10
+ import { C as ke } from "./catalog-Ce7o_N7a.js";
11
11
  import { c as ve } from "./createComponentProgrammatically-Bt2rn1IQ.js";
12
- import { g as we } from "./translation-BeqjfyEb.js";
12
+ import { g as we } from "./translation-Cdap0IVg.js";
13
13
  function ge(T, M, l, p) {
14
14
  var y, v, w, g;
15
15
  const s = A(T);
@@ -1,9 +1,9 @@
1
1
  import { computed as d, defineComponent as x, ref as F, resolveComponent as b, createElementBlock as L, openBlock as w, normalizeClass as R, createVNode as K, normalizeStyle as $, withCtx as B, createBlock as U, createCommentVNode as j } from "vue";
2
- import { A as h, M as E, G as C, Q as O, al as Y, u as y, a as G } from "./index.vue_vue_type_script_setup_true_lang-CbdGF_YP.js";
3
- import { u as S } from "./menuV2-B1fegOdA.js";
4
- import { C as v, h as N } from "./catalog-RXap_5ft.js";
2
+ import { A as h, M as E, G as C, Q as O, al as Y, u as y, a as G } from "./index.vue_vue_type_script_setup_true_lang-DOhr-m71.js";
3
+ import { u as S } from "./menuV2-DiyUO2p3.js";
4
+ import { C as v, h as N } from "./catalog-Ce7o_N7a.js";
5
5
  import { useSnackbar as P, useDialog as z } from "@feedmepos/ui-library";
6
- import { a as T } from "./LinkProductSideSheet-D6Mqf5Hl.js";
6
+ import { a as T } from "./LinkProductSideSheet-DdyUWMWm.js";
7
7
  import { useI18n as Q } from "@feedmepos/mf-common";
8
8
  function q() {
9
9
  const t = S(), o = d(() => t.categorizedRawMenuItems.filter((u) => u.items.length > 0)), i = d(() => {
@@ -0,0 +1,194 @@
1
+ import { defineComponent as K, ref as y, watch as E, computed as F, unref as a, resolveComponent as _, createBlock as T, openBlock as i, withCtx as v, createElementVNode as t, toDisplayString as m, createElementBlock as p, createCommentVNode as B, Fragment as x, renderList as C, createVNode as r } from "vue";
2
+ import { J as D } from "./index.vue_vue_type_script_setup_true_lang-DOhr-m71.js";
3
+ import { useI18n as P, useLocale as Q } from "@feedmepos/mf-common";
4
+ import { u as R } from "./discardConfirm-BHni0LNu.js";
5
+ import { g as V, a as I, _ as W, b as X } from "./translation-Cdap0IVg.js";
6
+ const Y = { class: "fm-typo-en-title-md-600" }, Z = { class: "pt-8 space-y-24" }, ee = { class: "flex flex-col gap-8" }, oe = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, le = { class: "flex items-center gap-8 flex-wrap" }, te = { class: "w-24 h-24 rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600" }, ae = { class: "fm-typo-en-body-md-600" }, ne = ["onClick"], se = { class: "flex items-center gap-8" }, ce = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, me = { class: "fm-typo-en-body-md-400" }, ie = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, de = { class: "flex items-center gap-16" }, re = { class: "fm-typo-en-body-lg-600" }, ue = { class: "flex flex-col gap-32 pl-32" }, pe = {
7
+ key: 0,
8
+ class: "space-y-8"
9
+ }, fe = { class: "flex w-[100px] items-center gap-8" }, _e = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, ve = { class: "fm-typo-en-body-md-400" }, he = { class: "flex-1" }, ye = { class: "flex gap-8 items-center justify-start" }, ke = /* @__PURE__ */ K({
10
+ __name: "TranslationSideSheet",
11
+ props: {
12
+ modelValue: { type: Boolean },
13
+ title: {},
14
+ name: {},
15
+ nameLocale: {}
16
+ },
17
+ emits: ["update:modelValue", "update:name", "update:nameLocale"],
18
+ setup(O, { emit: S }) {
19
+ const s = O, f = S, { t: d } = P(), { localeList: h } = Q(), c = y([]), k = y([]), u = y(s.name), L = y(s.name);
20
+ E(
21
+ () => s.name,
22
+ (e) => {
23
+ u.value = e;
24
+ }
25
+ );
26
+ function U() {
27
+ return !s.nameLocale || Object.keys(s.nameLocale).length === 0 ? [] : Object.entries(s.nameLocale).map(([e, o]) => ({
28
+ localeCode: e,
29
+ value: o
30
+ }));
31
+ }
32
+ E(
33
+ () => [s.modelValue, s.nameLocale],
34
+ ([e]) => {
35
+ e && (c.value = U(), k.value = D.clone(c.value), u.value = s.name, L.value = s.name);
36
+ },
37
+ { immediate: !0 }
38
+ );
39
+ const w = F(() => {
40
+ const e = new Set(c.value.map((n) => n.localeCode));
41
+ return a(h).filter((n) => !e.has(n.code)).map((n) => ({
42
+ code: n.code,
43
+ name: n.name,
44
+ icon: V(n.code)
45
+ }));
46
+ });
47
+ function $(e) {
48
+ const o = a(h).find((n) => n.code === e);
49
+ o && c.value.push({
50
+ localeCode: o.code,
51
+ value: ""
52
+ });
53
+ }
54
+ function z(e) {
55
+ c.value = c.value.filter((o) => o.localeCode !== e);
56
+ }
57
+ function A() {
58
+ const e = u.value !== L.value, o = !D.isEqual(c.value, k.value);
59
+ return e || o;
60
+ }
61
+ function M() {
62
+ u.value !== s.name && f("update:name", u.value);
63
+ const e = c.value.filter((o) => o.value.trim());
64
+ if (e.length === 0)
65
+ f("update:nameLocale", void 0);
66
+ else {
67
+ const o = {};
68
+ e.forEach((n) => {
69
+ o[n.localeCode] = n.value.trim();
70
+ }), f("update:nameLocale", o);
71
+ }
72
+ f("update:modelValue", !1);
73
+ }
74
+ function q() {
75
+ f("update:modelValue", !1);
76
+ }
77
+ const N = R(A, q), j = F({
78
+ get: () => s.modelValue,
79
+ set: (e) => f("update:modelValue", e)
80
+ });
81
+ return (e, o) => {
82
+ const n = _("FmIcon"), g = _("fm-button"), J = _("FmMenu"), G = _("fm-text-field"), H = _("fm-side-sheet");
83
+ return i(), T(H, {
84
+ modelValue: j.value,
85
+ "onUpdate:modelValue": o[1] || (o[1] = (l) => j.value = l),
86
+ "max-width": 720,
87
+ "onOn:clickedAway": a(N)
88
+ }, {
89
+ "side-sheet-header": v(() => [
90
+ t("p", Y, m(e.title) + " " + m(a(d)("menu.common.translation.title_suffix")), 1)
91
+ ]),
92
+ "side-sheet-footer": v(() => [
93
+ t("div", ye, [
94
+ r(g, {
95
+ label: a(d)("common.save"),
96
+ size: "lg",
97
+ variant: "primary",
98
+ onClick: M
99
+ }, null, 8, ["label"]),
100
+ r(g, {
101
+ label: a(d)("common.cancel"),
102
+ size: "lg",
103
+ variant: "tertiary",
104
+ onClick: a(N)
105
+ }, null, 8, ["label", "onClick"])
106
+ ])
107
+ ]),
108
+ default: v(() => [
109
+ t("div", Z, [
110
+ t("div", ee, [
111
+ t("p", oe, m(a(d)("menu.common.translation.language")), 1),
112
+ t("div", le, [
113
+ (i(!0), p(x, null, C(c.value, (l) => (i(), p("div", {
114
+ key: l.localeCode,
115
+ class: "flex items-center gap-8 p-8 border border-fm-color-primary text-fm-color-primary rounded-full"
116
+ }, [
117
+ t("div", te, m(a(V)(l.localeCode)), 1),
118
+ t("span", ae, m(a(I)(l.localeCode, a(h))), 1),
119
+ r(n, {
120
+ name: "close",
121
+ class: "cursor-pointer",
122
+ variant: "secondary",
123
+ onClick: (b) => z(l.localeCode)
124
+ }, null, 8, ["onClick"])
125
+ ]))), 128)),
126
+ w.value.length > 0 ? (i(), T(J, { key: 0 }, {
127
+ "menu-button": v(() => [
128
+ r(g, {
129
+ variant: "secondary",
130
+ "border-color": "neutral-gray-300",
131
+ "text-color": "neutral-gray-400",
132
+ icon: "add"
133
+ })
134
+ ]),
135
+ default: v(() => [
136
+ (i(!0), p(x, null, C(w.value, (l) => (i(), p("div", {
137
+ class: "p-12 cursor-pointer hover:bg-fm-color-opacity-md rounded-sm",
138
+ key: l.code,
139
+ onClick: (b) => $(l.code)
140
+ }, [
141
+ t("div", se, [
142
+ t("div", ce, m(l.icon), 1),
143
+ t("span", me, m(l.name), 1)
144
+ ])
145
+ ], 8, ne))), 128))
146
+ ]),
147
+ _: 1
148
+ })) : B("", !0)
149
+ ])
150
+ ]),
151
+ t("div", ie, [
152
+ t("div", de, [
153
+ r(n, { name: "keyboard_arrow_down" }),
154
+ t("p", re, m(a(d)("menu.common.translation.name_section", { entity: e.title })), 1)
155
+ ]),
156
+ t("div", ue, [
157
+ r(W, {
158
+ label: a(d)("menu.common.translation.default"),
159
+ modelValue: u.value,
160
+ "onUpdate:modelValue": o[0] || (o[0] = (l) => u.value = l)
161
+ }, null, 8, ["label", "modelValue"]),
162
+ c.value.length > 0 ? (i(), p("div", pe, [
163
+ r(X, {
164
+ label: a(d)("menu.common.translation.translation_label")
165
+ }, null, 8, ["label"]),
166
+ (i(!0), p(x, null, C(c.value, (l) => (i(), p("div", {
167
+ key: l.localeCode,
168
+ class: "flex items-center gap-16"
169
+ }, [
170
+ t("div", fe, [
171
+ t("div", _e, m(a(V)(l.localeCode)), 1),
172
+ t("span", ve, m(a(I)(l.localeCode, a(h))), 1)
173
+ ]),
174
+ t("div", he, [
175
+ r(G, {
176
+ modelValue: l.value,
177
+ "onUpdate:modelValue": (b) => l.value = b,
178
+ placeholder: a(d)("menu.group.translation.placeholder")
179
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
180
+ ])
181
+ ]))), 128))
182
+ ])) : B("", !0)
183
+ ])
184
+ ])
185
+ ])
186
+ ]),
187
+ _: 1
188
+ }, 8, ["modelValue", "onOn:clickedAway"]);
189
+ };
190
+ }
191
+ });
192
+ export {
193
+ ke as _
194
+ };