@feedmepos/mf-menu 0.31.40-prod → 0.31.41-prod

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist/{App-aWEH-ZEk.js → App-5Lzy8zHZ.js} +8 -8
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-jJyinQZl.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BnKXsQH-.js} +3 -3
  3. package/dist/{Catalog-BoFfFdn8.js → Catalog-s5b8V8nw.js} +8 -9
  4. package/dist/{Category-CWYbb3Jn.js → Category-BJzScJEY.js} +4 -4
  5. package/dist/{Category-DZ45uikR.js → Category-DZ-xqIMI.js} +6 -6
  6. package/dist/{CookingGuide-BU0PRWIQ.js → CookingGuide-Bkd6GPww.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Z5xsKDIE.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-B8tIjKOW.js} +1 -1
  8. package/dist/{Group-BMQDeqiS.js → Group-0b2Qiov3.js} +1 -1
  9. package/dist/{Group-C0T_uknK.js → Group-BOaCcKiI.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-DyfmY6F1.js → Group.vue_vue_type_script_setup_true_lang-DUlUfMAs.js} +8 -8
  11. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CouimeC4.js +399 -0
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Dl-Wvt3D.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DOvQmbrZ.js} +13 -14
  13. package/dist/{Ingredient-3lwDUQx_.js → Ingredient-ChcYUvOg.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-VLrrTkSC.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DE1HkipX.js} +2 -2
  15. package/dist/LinkProductSideSheet-BdzBGYxG.js +361 -0
  16. package/dist/MenuSetting-zAAttaoA.js +618 -0
  17. package/dist/{PrintRoute-DfJ-vUAb.js → PrintRoute-T-vuO5N8.js} +4 -4
  18. package/dist/{Product-F4PoLm9v.js → Product-B5q291VF.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-DT5gffpA.js → Product.vue_vue_type_script_setup_true_lang-DLRlT10W.js} +468 -465
  20. package/dist/{ProductInternalTools-DSGU-OqU.js → ProductInternalTools-BOlc0VUR.js} +5 -5
  21. package/dist/{Products-COzW2Z4g.js → Products-Cd4Mqhm3.js} +88 -85
  22. package/dist/{Publish-CDXVWCk2.js → Publish-SuRzt-_D.js} +3 -3
  23. package/dist/{Recipe-BZx4wrcP.js → Recipe-BKrjNs5g.js} +4 -4
  24. package/dist/{Scheduler-wHCWSeU2.js → Scheduler-DnDgImLC.js} +3 -3
  25. package/dist/{ServingSequence-BbYEhDYh.js → ServingSequence-D602bVnm.js} +3 -3
  26. package/dist/{Setting-C9Tlw1Iy.js → Setting-FMT4oBYH.js} +44 -45
  27. package/dist/{Subcategory-C8AwfrKb.js → Subcategory-CpYmjAvA.js} +4 -4
  28. package/dist/{Takeaway-t1053wg2.js → Takeaway-BXh3iuME.js} +1 -1
  29. package/dist/{Takeaway-DaEUn-yM.js → Takeaway-D4hjN5z5.js} +4 -4
  30. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-7XycP5fU.js → Takeaway.vue_vue_type_script_setup_true_lang-By1f-FCO.js} +5 -5
  31. package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-CZUwa5C_.js +440 -0
  32. package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Ci6iqOry.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DfjtfcCh.js} +604 -600
  33. package/dist/{Unit-CnqptGCz.js → Unit-CsjHkV-h.js} +2 -2
  34. package/dist/{Variant-DiOYOwJs.js → Variant-Djra14ZX.js} +3 -3
  35. package/dist/{_id_-BSfU16VO.js → _id_-BXkqoCzB.js} +78 -75
  36. package/dist/{app-Ddb81PNo.js → app-CVqWWV4x.js} +278 -278
  37. package/dist/{LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js → app-CiBqmBzO.js} +2120 -2084
  38. package/dist/{app-Cou6qPF2.js → app-PhBJNss_.js} +1 -1
  39. package/dist/app.js +1 -1
  40. package/dist/apps/mf-menu/src/api/menu.d.ts +2 -1
  41. package/dist/apps/mf-menu/src/app.d.ts +144 -0
  42. package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierRuleEditor.vue.d.ts +36 -0
  43. package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesSelector.vue.d.ts +9 -3
  44. package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +294 -4
  45. package/dist/apps/mf-menu/src/composable/attributes.d.ts +26 -0
  46. package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +40 -0
  47. package/dist/apps/mf-menu/src/helper/import-export.d.ts +285 -0
  48. package/dist/apps/mf-menu/src/helper/menu.d.ts +285 -0
  49. package/dist/apps/mf-menu/src/manager/menu/item.d.ts +285 -0
  50. package/dist/apps/mf-menu/src/stores/menu.d.ts +293 -3
  51. package/dist/apps/mf-menu/src/utils/array.d.ts +1 -0
  52. package/dist/apps/mf-menu/src/utils/customAttributes.d.ts +12 -0
  53. package/dist/apps/mf-menu/src/views/MenuSetting/LinkProductRuleGroups.vue.d.ts +2 -0
  54. package/dist/apps/mf-menu/src/views/MenuSetting/RuleGroupSideSheet.vue.d.ts +176 -0
  55. package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +166 -0
  56. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  57. package/dist/assets/linked-status-WlVAcpRn.js +13 -0
  58. package/dist/assets/override-menu-__h4D7ac.js +13 -0
  59. package/dist/assets/validate-menu-DyPuzLRg.js +13 -0
  60. package/dist/{catalog-DSuJhsUb.js → catalog-C_TuQLxq.js} +1 -1
  61. package/dist/{catalogSetting-C3gEw9ov.js → catalogSetting-BUlJu6hG.js} +1 -1
  62. package/dist/{category-CwWq3KCE.js → category-CmVw1Kj-.js} +1 -1
  63. package/dist/{currency-g45Sh-t6.js → currency-OhOTnAqk.js} +1 -1
  64. package/dist/customAttributes-fpOfmGnw.js +180 -0
  65. package/dist/{dayjs.min-g3eN5z-V.js → dayjs.min-CDhP-7L5.js} +1 -1
  66. package/dist/{index-QsLFbxyG.js → index-BJZEWB5C.js} +4 -4
  67. package/dist/{index-BLQCYEc6.js → index-DHAYGEPp.js} +7 -8
  68. package/dist/{index-0yRUi7LL.js → index-DtwHmS38.js} +1 -1
  69. package/dist/index-N3cGc8ex.js +245 -0
  70. package/dist/{item-BvvQ9urP.js → item-BELLphR0.js} +16 -16
  71. package/dist/{jszip.min-DzdUiaR4.js → jszip.min-CZtcGb7A.js} +353 -353
  72. package/dist/{menu-QrVg2Ph7.js → menu-Csyr6W9A.js} +7 -7
  73. package/dist/{menu-DFNvhoNQ.js → menu-DS_ERmBf.js} +23355 -23206
  74. package/dist/{menuV2-Ezf_jW40.js → menuV2-DKzAZ4Ss.js} +151 -146
  75. package/dist/mf-menu.css +1 -1
  76. package/dist/{priceTier-zENsn3P_.js → priceTier-CYWS5lDS.js} +1 -1
  77. package/dist/{scheduler-BuwGSv6A.js → scheduler-DI5dXC7Y.js} +8 -8
  78. package/dist/{subcategory-O3L_zCJA.js → subcategory-D_ao-IV9.js} +2 -2
  79. package/dist/{toExcel-CpRy_4nG.js → toExcel-Cml-rkJQ.js} +2 -2
  80. package/dist/{unit-Ct_7Hfa2.js → unit-BWDp2LkV.js} +42 -41
  81. package/package.json +3 -3
  82. package/dist/FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js +0 -50
  83. package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D6qro5w_.js +0 -367
  84. package/dist/LinkProductSideSheet-LDZjKX95.js +0 -297
  85. package/dist/MenuSetting-AhutsCVy.js +0 -185
  86. package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-B7oLH9cP.js +0 -431
  87. package/dist/assets/linked-status-B_crHhZH.js +0 -24
  88. package/dist/assets/override-menu-BmlCEpHH.js +0 -24
  89. package/dist/assets/validate-menu-CF-psoB-.js +0 -24
  90. package/dist/index-0Q5T9VZV.js +0 -214
@@ -0,0 +1,618 @@
1
+ import { defineComponent as le, ref as U, computed as V, watch as P, resolveComponent as g, createBlock as J, openBlock as y, unref as e, withCtx as p, createElementVNode as r, createVNode as l, createElementBlock as R, Fragment as ue, renderList as oe, toDisplayString as D, createCommentVNode as z, withModifiers as be } from "vue";
2
+ import { u as se, I as W, G as ce, B as ge, H as re } from "./menu-DS_ERmBf.js";
3
+ import { useI18n as ae, useCustomAttributes as ie, useCoreStore as de, EMPTY_RULE as Q, isEmptyRule as me } from "@feedmepos/mf-common";
4
+ import { components as ne, FmButtonVariant as E, useDialog as ye, useSnackbar as pe, useBreakpoints as he, FmButtonColorThemeVariant as te } from "@feedmepos/ui-library";
5
+ import { u as ke, c as Ce, m as q, _ as X, a as K, f as H } from "./customAttributes-fpOfmGnw.js";
6
+ import { _ as _e } from "./app-CVqWWV4x.js";
7
+ import { b as Y } from "./app-CiBqmBzO.js";
8
+ import { u as Se } from "./discardConfirm-BHni0LNu.js";
9
+ import { _ as xe } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
10
+ import { C as j, a as N } from "./catalogSetting-BUlJu6hG.js";
11
+ import { u as we } from "./priceTier-CYWS5lDS.js";
12
+ const Re = {
13
+ class: "fm-typo-en-title-md-600 mr-auto"
14
+ }, Ae = {
15
+ class: "py-8 px-8 overflow-y-auto space-y-24"
16
+ }, Te = {
17
+ class: "space-y-16"
18
+ }, Ve = {
19
+ class: "grid md:grid-cols-3 gap-16"
20
+ }, Fe = {
21
+ class: "md:col-span-2 space-y-16"
22
+ }, Ge = {
23
+ class: "flex justify-end"
24
+ }, Ue = {
25
+ class: "flex gap-8 items-center justify-start"
26
+ }, $e = /* @__PURE__ */ le({
27
+ __name: "RuleGroupSideSheet",
28
+ props: {
29
+ modelValue: {
30
+ type: Boolean
31
+ },
32
+ editingGroup: {}
33
+ },
34
+ emits: ["update:modelValue", "submit"],
35
+ setup(Z, {
36
+ emit: o
37
+ }) {
38
+ const S = Z, $ = o, {
39
+ t: i
40
+ } = ae(), A = se(), t = U({
41
+ name: "",
42
+ description: "",
43
+ rules: []
44
+ }), {
45
+ attributes: k
46
+ } = ie({
47
+ valueSource: de().restaurants,
48
+ entity: "restaurant"
49
+ }), {
50
+ attributes: F
51
+ } = ie({
52
+ valueSource: V(() => A.state.menu.modules.item || []),
53
+ entity: "item"
54
+ }), {
55
+ restaurantAttributes: h
56
+ } = ke(), {
57
+ itemAttributes: M,
58
+ convertCategoryIdToName: T,
59
+ convertCategoryNameToId: I
60
+ } = Ce({
61
+ menuItems: V(() => A.state.menu.modules.item || []),
62
+ categories: V(() => A.categories || [])
63
+ }), x = V({
64
+ get: () => S.modelValue,
65
+ set: (u) => $("update:modelValue", u)
66
+ }), L = U(null);
67
+ P(() => S.editingGroup, (u) => {
68
+ u ? t.value = {
69
+ name: u.name,
70
+ description: u.description,
71
+ rules: u.rules.map((a) => ({
72
+ ...a,
73
+ restaurantRule: a.restaurantRule ? {
74
+ restaurantAttributes: q(a.restaurantRule.restaurantAttributes),
75
+ restaurantCustomAttributes: q(a.restaurantRule.restaurantCustomAttributes)
76
+ } : void 0,
77
+ itemRule: a.itemRule ? {
78
+ itemAttributes: T(q(a.itemRule.itemAttributes)),
79
+ itemCustomAttributes: q(a.itemRule.itemCustomAttributes)
80
+ } : void 0
81
+ }))
82
+ } : t.value = {
83
+ name: "",
84
+ description: "",
85
+ rules: []
86
+ }, L.value = W.cloneDeep(t.value);
87
+ }, {
88
+ immediate: !0
89
+ }), P(() => S.modelValue, (u) => {
90
+ u || (t.value = {
91
+ name: "",
92
+ description: "",
93
+ rules: []
94
+ });
95
+ });
96
+ function G(u) {
97
+ return `${u}_${(/* @__PURE__ */ new Date()).toISOString()}`;
98
+ }
99
+ async function _() {
100
+ var a;
101
+ const u = {
102
+ _id: ((a = S.editingGroup) == null ? void 0 : a._id) ?? G("group"),
103
+ name: t.value.name,
104
+ description: t.value.description,
105
+ rules: t.value.rules.map((s) => ({
106
+ _id: s._id,
107
+ restaurantRule: s.restaurantRule ? {
108
+ restaurantAttributes: H(s.restaurantRule.restaurantAttributes),
109
+ restaurantCustomAttributes: H(s.restaurantRule.restaurantCustomAttributes)
110
+ } : void 0,
111
+ itemRule: s.itemRule ? {
112
+ itemAttributes: H(I(s.itemRule.itemAttributes)),
113
+ itemCustomAttributes: H(s.itemRule.itemCustomAttributes)
114
+ } : void 0
115
+ }))
116
+ };
117
+ $("submit", u);
118
+ }
119
+ function m() {
120
+ t.value.rules.push({
121
+ _id: G("rule"),
122
+ restaurantRule: {
123
+ restaurantAttributes: null,
124
+ restaurantCustomAttributes: null
125
+ },
126
+ itemRule: {
127
+ itemAttributes: null,
128
+ itemCustomAttributes: null
129
+ }
130
+ });
131
+ }
132
+ function v(u) {
133
+ t.value.rules.splice(u, 1);
134
+ }
135
+ function C(u, a, s) {
136
+ t.value.rules[u].restaurantRule || (t.value.rules[u].restaurantRule = {}), me(a) ? t.value.rules[u].restaurantRule[s] = null : t.value.rules[u].restaurantRule[s] = a;
137
+ }
138
+ function n(u, a, s) {
139
+ t.value.rules[u].itemRule || (t.value.rules[u].itemRule = {}), me(a) ? t.value.rules[u].itemRule[s] = null : t.value.rules[u].itemRule[s] = a;
140
+ }
141
+ function c() {
142
+ x.value = !1;
143
+ }
144
+ const f = Se(() => !W.isEqual(L.value, t.value), () => {
145
+ x.value = !1;
146
+ });
147
+ return (u, a) => {
148
+ const s = g("fm-button"), d = g("FmTextField"), ee = g("FmCard"), ve = g("FmFormGroup"), fe = g("fm-side-sheet");
149
+ return y(), J(fe, {
150
+ modelValue: x.value,
151
+ "onUpdate:modelValue": a[3] || (a[3] = (b) => x.value = b),
152
+ "is-container": e(ne).FmForm,
153
+ "is-container-props": {
154
+ onValidationSuccess: _,
155
+ blameFormChildOnValidationFailed: !0
156
+ },
157
+ "max-width": 760,
158
+ "onOn:clickedAway": e(f)
159
+ }, {
160
+ "side-sheet-header": p(() => [l(s, {
161
+ variant: e(E).Tertiary,
162
+ class: "cursor-pointer mr-4",
163
+ "prepend-icon": "arrow_back",
164
+ onClick: a[0] || (a[0] = () => x.value = !1)
165
+ }, null, 8, ["variant"]), r("p", Re, D(u.editingGroup ? e(i)("menu.rule_groups.edit_group") : e(i)("menu.rule_groups.create_group")), 1)]),
166
+ "side-sheet-footer": p(() => [r("div", Ue, [l(s, {
167
+ label: e(i)("common.save"),
168
+ size: "lg",
169
+ type: "submit",
170
+ variant: "primary"
171
+ }, null, 8, ["label"]), l(s, {
172
+ label: e(i)("common.cancel"),
173
+ size: "lg",
174
+ variant: "tertiary",
175
+ onClick: c
176
+ }, null, 8, ["label"])])]),
177
+ default: p(() => [r("div", Ae, [l(X, {
178
+ title: e(i)("menu.rule_groups.form.basic_info")
179
+ }, {
180
+ default: p(() => [r("div", Te, [l(d, {
181
+ label: e(i)("menu.rule_groups.form.name"),
182
+ "label-mark": "required",
183
+ modelValue: t.value.name,
184
+ "onUpdate:modelValue": a[1] || (a[1] = (b) => t.value.name = b),
185
+ placeholder: e(i)("menu.rule_groups.form.name_placeholder"),
186
+ required: "",
187
+ rules: [(b) => !!(b != null && b.trim()) || e(i)("menu.rule_groups.validation.name_required")]
188
+ }, null, 8, ["label", "modelValue", "placeholder", "rules"]), l(d, {
189
+ label: e(i)("menu.rule_groups.form.description"),
190
+ "label-mark": "optional",
191
+ modelValue: t.value.description,
192
+ "onUpdate:modelValue": a[2] || (a[2] = (b) => t.value.description = b),
193
+ placeholder: e(i)("menu.rule_groups.form.description_placeholder"),
194
+ multiline: "",
195
+ rows: 3
196
+ }, null, 8, ["label", "modelValue", "placeholder"])])]),
197
+ _: 1
198
+ }, 8, ["title"]), l(ve, {
199
+ tag: "div",
200
+ "model-value": t.value.rules,
201
+ rules: [(b) => b.length > 0 || e(i)("menu.rule_groups.validation.at_least_one_rule_required")]
202
+ }, {
203
+ default: p(() => [l(X, {
204
+ title: e(i)("menu.rule_groups.form.rules"),
205
+ "sub-title": e(i)("menu.rule_groups.form.rules_description")
206
+ }, {
207
+ default: p(() => [(y(!0), R(ue, null, oe(t.value.rules, (b, O) => (y(), J(ee, {
208
+ key: O,
209
+ class: "p-16 space-y-16",
210
+ variant: "outlined"
211
+ }, {
212
+ default: p(() => [r("div", Ve, [r("div", Fe, [l(K, {
213
+ label: e(i)("menu.link_product.rules.restaurant_filter")
214
+ }, {
215
+ default: p(() => {
216
+ var w;
217
+ return [l(e(Y), {
218
+ attributes: e(h),
219
+ "model-value": ((w = b.restaurantRule) == null ? void 0 : w.restaurantAttributes) || e(Q),
220
+ "onUpdate:modelValue": (B) => C(O, B, "restaurantAttributes")
221
+ }, null, 8, ["attributes", "model-value", "onUpdate:modelValue"])];
222
+ }),
223
+ _: 2
224
+ }, 1032, ["label"]), l(K, {
225
+ label: e(i)("menu.link_product.rules.restaurant_custom_attributes_filter")
226
+ }, {
227
+ default: p(() => {
228
+ var w;
229
+ return [l(e(Y), {
230
+ attributes: e(k),
231
+ "model-value": ((w = b.restaurantRule) == null ? void 0 : w.restaurantCustomAttributes) || e(Q),
232
+ "onUpdate:modelValue": (B) => C(O, B, "restaurantCustomAttributes")
233
+ }, null, 8, ["attributes", "model-value", "onUpdate:modelValue"])];
234
+ }),
235
+ _: 2
236
+ }, 1032, ["label"]), l(K, {
237
+ label: e(i)("menu.link_product.rules.item_filter")
238
+ }, {
239
+ default: p(() => {
240
+ var w;
241
+ return [l(e(Y), {
242
+ attributes: e(M),
243
+ "model-value": ((w = b.itemRule) == null ? void 0 : w.itemAttributes) || e(Q),
244
+ "onUpdate:modelValue": (B) => n(O, B, "itemAttributes")
245
+ }, null, 8, ["attributes", "model-value", "onUpdate:modelValue"])];
246
+ }),
247
+ _: 2
248
+ }, 1032, ["label"]), l(K, {
249
+ label: e(i)("menu.link_product.rules.item_custom_attributes_filter")
250
+ }, {
251
+ default: p(() => {
252
+ var w;
253
+ return [l(e(Y), {
254
+ attributes: e(F),
255
+ "model-value": ((w = b.itemRule) == null ? void 0 : w.itemCustomAttributes) || e(Q),
256
+ "onUpdate:modelValue": (B) => n(O, B, "itemCustomAttributes")
257
+ }, null, 8, ["attributes", "model-value", "onUpdate:modelValue"])];
258
+ }),
259
+ _: 2
260
+ }, 1032, ["label"])])]), r("div", Ge, [l(s, {
261
+ variant: e(E).Tertiary,
262
+ "prepend-icon": "delete",
263
+ onClick: (w) => v(O)
264
+ }, null, 8, ["variant", "onClick"])])]),
265
+ _: 2
266
+ }, 1024))), 128)), r("div", null, [l(s, {
267
+ label: e(i)("menu.link_product.rules.add_rule"),
268
+ onClick: m
269
+ }, null, 8, ["label"])])]),
270
+ _: 1
271
+ }, 8, ["title", "sub-title"])]),
272
+ _: 1
273
+ }, 8, ["model-value", "rules"])])]),
274
+ _: 1
275
+ }, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"]);
276
+ };
277
+ }
278
+ }), Me = {
279
+ key: 0,
280
+ class: "space-y-8"
281
+ }, Ie = {
282
+ class: "flex items-center justify-between"
283
+ }, Be = {
284
+ class: "fm-typo-en-title-md-600"
285
+ }, Ne = {
286
+ class: "text-fm-color-typo-secondary"
287
+ }, De = {
288
+ class: "flex justify-end items-center"
289
+ }, Ee = {
290
+ class: "w-[320px]"
291
+ }, Le = {
292
+ key: 1,
293
+ class: "flex-1 flex flex-col min-h-0"
294
+ }, Oe = {
295
+ class: "flex items-center justify-between p-8"
296
+ }, je = {
297
+ class: "flex-1 mr-8"
298
+ }, ze = {
299
+ class: "flex flex-1 flex-col min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64"
300
+ }, Pe = ["onClick"], Qe = {
301
+ class: "flex-1 space-y-4"
302
+ }, qe = {
303
+ class: "fm-typo-en-body-lg-600"
304
+ }, Ke = {
305
+ key: 0,
306
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
307
+ }, He = /* @__PURE__ */ le({
308
+ __name: "LinkProductRuleGroups",
309
+ setup(Z) {
310
+ const {
311
+ t: o
312
+ } = ae(), S = ye(), $ = pe(), i = ce($), A = se(), t = U(A.state.menu.ruleGroupSettings || {
313
+ groups: []
314
+ });
315
+ P(() => A.state.menu.ruleGroupSettings, (n) => {
316
+ t.value = n || {
317
+ groups: []
318
+ };
319
+ }, {
320
+ deep: !0
321
+ });
322
+ const k = U(!1), F = U(null), h = he(), M = V(() => h.breakpoints.value.xs), T = U(""), I = V(() => t.value.groups.filter((n) => n.name.toLowerCase().includes(T.value.toLowerCase()))), x = [{
323
+ header: o("menu.rule_groups.table.columns.name"),
324
+ accessorKey: "name",
325
+ enableSorting: !0
326
+ }, {
327
+ header: o("menu.rule_groups.table.columns.description"),
328
+ accessorKey: "description",
329
+ enableSorting: !1
330
+ }, {
331
+ id: "actions",
332
+ size: 100,
333
+ cell: (n) => l("div", {
334
+ class: "px-4 flex justify-end"
335
+ }, [l(ne.FmButton, {
336
+ icon: "delete",
337
+ "text-color": te.NeutralGray400,
338
+ variant: E.Tertiary,
339
+ onClick: (c) => {
340
+ c.stopPropagation(), m(n.row.original._id);
341
+ }
342
+ }, null)])
343
+ }];
344
+ function L(n) {
345
+ _(n.original);
346
+ }
347
+ function G() {
348
+ F.value = null, k.value = !0;
349
+ }
350
+ function _(n) {
351
+ F.value = n, k.value = !0;
352
+ }
353
+ function m(n) {
354
+ const c = t.value.groups.find((f) => f._id === n);
355
+ c && S.open({
356
+ title: o("menu.rule_groups.delete_dialog.title"),
357
+ message: o("menu.rule_groups.delete_dialog.message", {
358
+ name: c.name
359
+ }),
360
+ primaryActions: {
361
+ text: o("menu.common.actions.remove"),
362
+ close: !1,
363
+ variant: E.Destructive
364
+ },
365
+ secondaryActions: {
366
+ text: o("menu.common.actions.cancel"),
367
+ close: !0
368
+ }
369
+ }).onPrimary(async () => {
370
+ const f = W.cloneDeep(t.value);
371
+ f.groups = f.groups.filter((u) => u._id !== n), await v(f), S.close();
372
+ });
373
+ }
374
+ async function v(n) {
375
+ await i.minor(async () => {
376
+ await A.updateMenuSetting({
377
+ ruleGroupSettings: n
378
+ });
379
+ }, {
380
+ successMessage: o("menu.rule_groups.saved_successfully")
381
+ });
382
+ }
383
+ async function C(n) {
384
+ var u;
385
+ const c = (u = t.value.groups) == null ? void 0 : u.findIndex((a) => a._id === n._id), f = W.cloneDeep(t.value);
386
+ c >= 0 ? f.groups[c] = n : f.groups.push(n), await v(f), k.value = !1;
387
+ }
388
+ return P(() => k.value, (n) => {
389
+ n || (F.value = null);
390
+ }), (n, c) => {
391
+ const f = g("FmButton"), u = g("FmSearch"), a = g("FmTable");
392
+ return y(), R("div", null, [M.value ? (y(), R("div", Le, [r("div", Oe, [r("div", je, [l(u, {
393
+ modelValue: T.value,
394
+ "onUpdate:modelValue": c[1] || (c[1] = (s) => T.value = s),
395
+ autofocus: "",
396
+ class: "w-full",
397
+ placeholder: e(o)("menu.rule_groups.search_placeholder")
398
+ }, null, 8, ["modelValue", "placeholder"])]), l(f, {
399
+ icon: "add",
400
+ variant: e(E).Secondary,
401
+ onClick: G
402
+ }, null, 8, ["variant"])]), r("div", ze, [(y(!0), R(ue, null, oe(I.value, (s) => (y(), R("div", {
403
+ key: s._id,
404
+ class: "flex flex-row py-12 px-16 cursor-pointer",
405
+ onClick: (d) => _(s)
406
+ }, [r("div", Qe, [r("p", qe, D(s.name), 1), s.description ? (y(), R("p", Ke, D(s.description), 1)) : z("", !0)]), l(f, {
407
+ "text-color": e(te).NeutralGray400,
408
+ variant: e(E).Tertiary,
409
+ icon: "delete",
410
+ onClick: be((d) => m(s._id), ["stop"])
411
+ }, null, 8, ["text-color", "variant", "onClick"])], 8, Pe))), 128))])])) : (y(), R("div", Me, [r("div", Ie, [r("div", null, [r("h1", Be, D(e(o)("menu.rule_groups.title")), 1), r("p", Ne, D(e(o)("menu.rule_groups.description")), 1)]), l(f, {
412
+ label: e(o)("menu.rule_groups.create_group"),
413
+ icon: "add",
414
+ onClick: G
415
+ }, null, 8, ["label"])]), r("div", De, [r("div", Ee, [l(u, {
416
+ modelValue: T.value,
417
+ "onUpdate:modelValue": c[0] || (c[0] = (s) => T.value = s),
418
+ autofocus: "",
419
+ class: "mb-8",
420
+ placeholder: e(o)("menu.rule_groups.search_placeholder")
421
+ }, null, 8, ["modelValue", "placeholder"])])]), l(_e, null, {
422
+ default: p(() => [l(a, {
423
+ "column-defs": x,
424
+ "row-data": I.value,
425
+ "page-size": I.value.length,
426
+ "hide-footer": !0,
427
+ onRowClick: L
428
+ }, null, 8, ["row-data", "page-size"])]),
429
+ _: 1
430
+ })])), l($e, {
431
+ modelValue: k.value,
432
+ "onUpdate:modelValue": c[2] || (c[2] = (s) => k.value = s),
433
+ "editing-group": F.value,
434
+ onSubmit: C
435
+ }, null, 8, ["modelValue", "editing-group"])]);
436
+ };
437
+ }
438
+ }), Ye = {
439
+ class: "py-16"
440
+ }, Je = {
441
+ key: 0,
442
+ class: "space-y-32 max-w-[750px] xs:p-16"
443
+ }, We = {
444
+ key: 0,
445
+ class: "pl-32 space-x-8"
446
+ }, Xe = {
447
+ key: 1
448
+ }, Ze = {
449
+ class: "space-y-8"
450
+ }, et = {
451
+ class: "flex items-center justify-between"
452
+ }, tt = {
453
+ class: "fm-typo-en-title-md-600"
454
+ }, lt = {
455
+ class: "text-fm-color-typo-secondary"
456
+ }, ut = {
457
+ key: 2
458
+ }, vt = /* @__PURE__ */ le({
459
+ __name: "MenuSetting",
460
+ setup(Z) {
461
+ var G;
462
+ const {
463
+ t: o
464
+ } = ae(), S = se(), $ = de(), i = pe(), A = ce(i), t = V(() => ({
465
+ lowStock: S.state.menu.lowStockThreshold,
466
+ taxSetting: S.state.menu.masterCatalogSetting,
467
+ priceTierSettings: S.state.menu.priceTierSettings
468
+ })), k = U("conf"), F = V(() => [{
469
+ label: o("menu.menu_setting.tabs.menu_configuration"),
470
+ value: "conf"
471
+ }, ...S.isV4 ? [{
472
+ label: o("menu.menu_setting.tabs.price_group"),
473
+ value: "price-group"
474
+ }, {
475
+ label: o("menu.menu_setting.tabs.link_product_rule_groups"),
476
+ value: "link-product-rule-groups"
477
+ }] : []]), h = U(j.transformTax((G = t.value.taxSetting) == null ? void 0 : G.inclusiveTaxes));
478
+ P(() => t.value, (_) => {
479
+ var m;
480
+ h.value = j.transformTax((m = _.taxSetting) == null ? void 0 : m.inclusiveTaxes);
481
+ });
482
+ const M = V(() => {
483
+ if (!$.currentCountry.value) return [];
484
+ const _ = h.value.mode === N.MANUAL ? h.value.inclusive ?? [] : [];
485
+ return ge.Country.getCountry($.currentCountry.value).taxSystems.map((v) => {
486
+ const C = _.find((n) => n.systemCode === v.code);
487
+ return {
488
+ inclusive: (C == null ? void 0 : C.inclusive) || !1,
489
+ systemCode: v.code
490
+ };
491
+ });
492
+ });
493
+ function T(_) {
494
+ const m = h.value, v = m.mode === N.AUTO ? j.manualTax(M.value) : re(m);
495
+ v.inclusive ?? (v.inclusive = []);
496
+ const C = v.inclusive.findIndex((n) => n.systemCode === _.systemCode);
497
+ C < 0 ? v.inclusive.push(_) : v.inclusive.splice(C, 1, _), h.value = v;
498
+ }
499
+ async function I() {
500
+ if (t.value.lowStock !== null && t.value.lowStock !== void 0 && !Number.isInteger(t.value.lowStock))
501
+ return;
502
+ const _ = h.value.mode === N.AUTO ? null : re(h.value.inclusive);
503
+ await A.minor(async () => {
504
+ const m = t.value.lowStock === null || t.value.lowStock === void 0 || t.value.lowStock === 0;
505
+ await S.updateMenuSetting({
506
+ masterCatalogSetting: {
507
+ inclusiveTaxes: _
508
+ },
509
+ lowStockThreshold: m ? null : t.value.lowStock,
510
+ priceTierSettings: x.priceTiers.value
511
+ });
512
+ }, {
513
+ successMessage: o("menu.menu_setting.fields.low_stock.updated")
514
+ });
515
+ }
516
+ const x = we(), L = [{
517
+ header: o("menu.price_tier.settings_table.columns.name"),
518
+ accessorKey: "key",
519
+ enableSorting: !1
520
+ }, {
521
+ id: "actions",
522
+ size: 50,
523
+ cell: (_) => l("div", {
524
+ class: "px-4 flex justify-end"
525
+ }, [l(ne.FmButton, {
526
+ icon: "delete",
527
+ "text-color": te.NeutralGray400,
528
+ variant: E.Tertiary,
529
+ onClick: () => x.deletePriceTier(_.row.original.key)
530
+ }, null)])
531
+ }];
532
+ return (_, m) => {
533
+ const v = g("FmTabs"), C = g("fm-radio"), n = g("fm-radio-group"), c = g("fm-checkbox"), f = g("FormItem"), u = g("FmStepperField"), a = g("FmButton"), s = g("FmTable");
534
+ return y(), J(xe, {
535
+ heading: e(o)("menu.menu_setting.title")
536
+ }, {
537
+ default: p(() => [l(v, {
538
+ items: F.value,
539
+ modelValue: k.value,
540
+ "onUpdate:modelValue": m[0] || (m[0] = (d) => k.value = d)
541
+ }, null, 8, ["items", "modelValue"]), r("div", Ye, [k.value === "conf" ? (y(), R("div", Je, [l(X, {
542
+ title: "Tax setting"
543
+ }, {
544
+ default: p(() => [l(f, {
545
+ label: e(o)("menu.setting.tax.title")
546
+ }, {
547
+ default: p(() => [l(n, {
548
+ "model-value": h.value.mode,
549
+ "onUpdate:modelValue": m[1] || (m[1] = (d) => {
550
+ d === e(N).AUTO ? h.value = e(j).autoTax() : h.value = e(j).manualTax(M.value);
551
+ })
552
+ }, {
553
+ default: p(() => [l(C, {
554
+ value: e(N).AUTO,
555
+ label: e(o)("menu.setting.tax.modes.auto.label"),
556
+ sublabel: e(o)("menu.setting.tax.modes.auto.sublabel")
557
+ }, null, 8, ["value", "label", "sublabel"]), l(C, {
558
+ value: e(N).MANUAL,
559
+ label: e(o)("menu.setting.tax.modes.manual.label"),
560
+ sublabel: e(o)("menu.setting.tax.modes.manual.sublabel")
561
+ }, null, 8, ["value", "label", "sublabel"])]),
562
+ _: 1
563
+ }, 8, ["model-value"]), h.value.mode === e(N).MANUAL ? (y(), R("div", We, [(y(!0), R(ue, null, oe(M.value, (d) => (y(), J(c, {
564
+ key: d.systemCode,
565
+ "model-value": d.inclusive,
566
+ value: !0,
567
+ label: d.systemCode + " inclusive",
568
+ "onUpdate:modelValue": (ee) => {
569
+ T({
570
+ ...d,
571
+ inclusive: ee
572
+ });
573
+ }
574
+ }, null, 8, ["model-value", "label", "onUpdate:modelValue"]))), 128))])) : z("", !0)]),
575
+ _: 1
576
+ }, 8, ["label"])]),
577
+ _: 1
578
+ }), l(X, {
579
+ title: e(o)("menu.menu_setting.fields.low_stock.title"),
580
+ "sub-title": e(o)("menu.menu_setting.fields.low_stock.subtitle")
581
+ }, {
582
+ default: p(() => [l(u, {
583
+ "model-value": t.value.lowStock || null,
584
+ min: 0,
585
+ max: 1e3,
586
+ step: 1,
587
+ placeholder: e(o)("menu.menu_setting.fields.low_stock.not_set"),
588
+ "onUpdate:modelValue": m[2] || (m[2] = (d) => {
589
+ t.value.lowStock = d;
590
+ }),
591
+ rules: [(d) => d === null || Number.isInteger(d) || e(o)("menu.menu_setting.fields.low_stock.must_be_integer")],
592
+ "helper-text": e(o)("menu.menu_setting.fields.low_stock.helper_text")
593
+ }, null, 8, ["model-value", "placeholder", "rules", "helper-text"])]),
594
+ _: 1
595
+ }, 8, ["title", "sub-title"]), l(a, {
596
+ onClick: I,
597
+ label: e(o)("common.save")
598
+ }, null, 8, ["label"])])) : z("", !0), k.value === "price-group" ? (y(), R("div", Xe, [r("div", Ze, [r("div", et, [r("div", null, [r("h1", tt, D(e(o)("menu.price_tier.price_group")), 1), r("p", lt, D(e(o)("menu.price_tier.description")), 1)]), l(a, {
599
+ label: e(o)("menu.price_tier.add_price_group"),
600
+ icon: "add",
601
+ onClick: e(x).create
602
+ }, null, 8, ["label", "onClick"])]), l(_e, null, {
603
+ default: p(() => [l(s, {
604
+ "column-defs": L,
605
+ "row-data": e(x).priceTiers.value,
606
+ "page-size": e(x).priceTiers.value.length,
607
+ "hide-footer": !0
608
+ }, null, 8, ["row-data", "page-size"])]),
609
+ _: 1
610
+ })])])) : z("", !0), k.value === "link-product-rule-groups" ? (y(), R("div", ut, [l(He)])) : z("", !0)])]),
611
+ _: 1
612
+ }, 8, ["heading"]);
613
+ };
614
+ }
615
+ });
616
+ export {
617
+ vt as default
618
+ };
@@ -2,11 +2,11 @@ import { defineComponent as H, ref as T, computed as f, resolveComponent as g, c
2
2
  import { useI18n as Q } from "@feedmepos/mf-common";
3
3
  import { components as W, useSnackbar as te, useDialog as oe } from "@feedmepos/ui-library";
4
4
  import { _ as ne } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
5
- import { _ as ae } from "./app-Ddb81PNo.js";
6
- import { H as j, I as le, J as Y, A as C, u as re, O as se, G as ie } from "./menu-DFNvhoNQ.js";
7
- import { _ as G } from "./FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js";
5
+ import { _ as ae } from "./app-CVqWWV4x.js";
6
+ import { H as j, I as le, J as Y, A as C, u as re, O as se, G as ie } from "./menu-DS_ERmBf.js";
7
+ import { _ as G } from "./customAttributes-fpOfmGnw.js";
8
8
  import { u as ue } from "./discardConfirm-BHni0LNu.js";
9
- import { L as de } from "./LinkProductSideSheet-LDZjKX95.js";
9
+ import { L as de } from "./LinkProductSideSheet-BdzBGYxG.js";
10
10
  import { _ as ce } from "./index.vue_vue_type_script_setup_true_lang-BgqsTzLI.js";
11
11
  import { _ as me } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
12
12
  const pe = { class: "fm-typo-en-title-md-600" }, _e = { class: "space-y-32" }, fe = { class: "space-y-16" }, ve = { class: "flex items-center gap-8" }, ye = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ge = { class: "flex-1" }, he = { class: "grow overflow-y-auto" }, be = { class: "text-fm-color-typo-secondary bg-fm-color-neutral-gray-100 px-16 py-8 border-b border-b-fm-color-neutral-gray-200" }, xe = { class: "px-16 py-8 flex-1" }, ke = { class: "py-8" }, Fe = { class: "flex gap-8 items-center justify-start" }, Ie = /* @__PURE__ */ H({
@@ -1,4 +1,4 @@
1
- import { a as f } from "./Product.vue_vue_type_script_setup_true_lang-DT5gffpA.js";
1
+ import { a as f } from "./Product.vue_vue_type_script_setup_true_lang-DLRlT10W.js";
2
2
  export {
3
3
  f as default
4
4
  };