@feedmepos/mf-menu 0.32.55 → 0.32.56

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 (79) hide show
  1. package/dist/{App-D9i97kPC.js → App-BUePFRjb.js} +7 -7
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BxhzKypm.js → ApplyProduct.vue_vue_type_script_setup_true_lang-oPq3AcV2.js} +3 -3
  3. package/dist/{ApplyProductDialog.vue_vue_type_script_setup_true_lang-kPOpOatz.js → ApplyProductDialog.vue_vue_type_script_setup_true_lang-r2W9cuVe.js} +2 -2
  4. package/dist/{Catalog-DFJXgNsO.js → Catalog-uo0vO8uy.js} +6 -6
  5. package/dist/{Category-FaheENIM.js → Category-BvetZzck.js} +4 -4
  6. package/dist/{Category-DcN5huA8.js → Category-CHN6aSPS.js} +4 -4
  7. package/dist/{CookingGuide-w9A6JMSR.js → CookingGuide-DU8D0T0w.js} +5 -5
  8. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-BGCVlZ7J.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-DIxKLpe8.js} +1 -1
  9. package/dist/{Group-Dy8HcG_Y.js → Group-BFGFyGhC.js} +3 -3
  10. package/dist/{Group-DdqHR86E.js → Group-Cd1OoALN.js} +1 -1
  11. package/dist/{Group.vue_vue_type_script_setup_true_lang-Dvq7j79a.js → Group.vue_vue_type_script_setup_true_lang-Dyb9On55.js} +8 -8
  12. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BBcE09pP.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-XcNt0ZBv.js} +5 -5
  13. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DbIKyjW3.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Dw3IXPUL.js} +7 -7
  14. package/dist/{Ingredient-gj1v3spC.js → Ingredient-CXU04qIu.js} +3 -3
  15. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DV-RjIZv.js → InventoryBinding.vue_vue_type_script_setup_true_lang-q9DVgfMD.js} +2 -2
  16. package/dist/LinkProductSideSheet-CaFKMMSd.js +721 -0
  17. package/dist/MenuSetting-EeJdFNfx.js +685 -0
  18. package/dist/{OrderPacing-D0FFFm3T.js → OrderPacing-Db4P-2ea.js} +6 -6
  19. package/dist/{PrintRoute-Cgcxblv_.js → PrintRoute-CSScKjFa.js} +4 -4
  20. package/dist/{Product-Nti0T9iE.js → Product-tvbYvK5u.js} +1 -1
  21. package/dist/{Product.vue_vue_type_script_setup_true_lang-DyWLMrUC.js → Product.vue_vue_type_script_setup_true_lang-BQ_PgMDP.js} +12 -12
  22. package/dist/{ProductInternalTools-oOMZV7kK.js → ProductInternalTools-D2rmgEby.js} +6 -6
  23. package/dist/{Products-9elHDYp6.js → Products-WPvLY_wr.js} +43 -43
  24. package/dist/{Publish-Bi33tD6L.js → Publish-BJ9rz75C.js} +3 -3
  25. package/dist/{Recipe-BSysXC_H.js → Recipe-BMRTd58L.js} +4 -4
  26. package/dist/{RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BqsEM8Kj.js → RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-BefgcG34.js} +1 -1
  27. package/dist/RuleView.vue_vue_type_script_setup_true_lang-DlzIboPc.js +3305 -0
  28. package/dist/{Scheduler-CmXIA0tH.js → Scheduler-CHQ5YcBq.js} +3 -3
  29. package/dist/{ServingSequence-CPVOcSSM.js → ServingSequence-BtXSEzfn.js} +3 -3
  30. package/dist/{Setting-BQPHY7B-.js → Setting-BnXj1uTa.js} +5 -5
  31. package/dist/{Subcategory-DQAT58lU.js → Subcategory-miGPIoku.js} +5 -5
  32. package/dist/{Takeaway-DOi4Xogf.js → Takeaway-DtVvfRQy.js} +1 -1
  33. package/dist/{Takeaway-DtyEbDDB.js → Takeaway-zaChLDgt.js} +4 -4
  34. package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-CNccXS8u.js → Takeaway.vue_vue_type_script_setup_true_lang-BFnbiGsG.js} +5 -5
  35. package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-D9VV1s1E.js → Thumbnail.vue_vue_type_script_setup_true_lang-CNYxe969.js} +4 -4
  36. package/dist/{TranslationFieldSection.vue_vue_type_script_setup_true_lang-Cpg0cCuJ.js → TranslationFieldSection.vue_vue_type_script_setup_true_lang-D4fWF46n.js} +1 -1
  37. package/dist/{TranslationSideSheet.vue_vue_type_script_setup_true_lang-CGXXpcYQ.js → TranslationSideSheet.vue_vue_type_script_setup_true_lang-DLqeQRkH.js} +2 -2
  38. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DUxEgL0r.js +5974 -0
  39. package/dist/{Unit-BVGd9vOo.js → Unit-BaLVANd9.js} +2 -2
  40. package/dist/{Variant-wgsEnYNH.js → Variant-Bnb4SllS.js} +3 -3
  41. package/dist/{_id_-XLbzesLX.js → _id_-btH88hnV.js} +9 -9
  42. package/dist/{app-DBDi3v7O.js → app-BO16t-ps.js} +32 -32
  43. package/dist/{app-DXZuPEOd.js → app-D1a9CqKF.js} +1 -1
  44. package/dist/app.js +1 -1
  45. package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/thumbnailUpload.d.ts +6 -0
  46. package/dist/apps/mf-menu/src/components/feature/TreeEditor/image/ImageUploadForm.vue.d.ts +35 -29
  47. package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ProductDetail.vue.d.ts +3 -0
  48. package/dist/apps/mf-menu/src/components/rule_group/CatalogLinkItemRuleView.vue.d.ts +2 -0
  49. package/dist/apps/mf-menu/src/components/rule_group/RuleView.vue.d.ts +2 -0
  50. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  51. package/dist/assets/{override-menu-BiwqdooM.js → linked-status-zxrRiX3x.js} +3 -3
  52. package/dist/assets/{menu-export-BemM1bWH.js → menu-export-DXB8Py6r.js} +2 -2
  53. package/dist/assets/{linked-status-BELOy4Ju.js → override-menu-CEIJGR_x.js} +3 -3
  54. package/dist/assets/{validate-menu-mNalZZpy.js → validate-menu-DN3P-OR7.js} +2 -2
  55. package/dist/{catalog-Beh91hfF.js → catalog-COu1SO_p.js} +1 -1
  56. package/dist/{catalogSetting-CvotY0sm.js → catalogSetting-D34fLwdB.js} +1 -1
  57. package/dist/{currency-DWU0Lz6M.js → currency-DlfcFoj5.js} +1 -1
  58. package/dist/{dayjs.min-b9_NYDqQ.js → dayjs.min-xM9KAjrx.js} +2 -2
  59. package/dist/{index-ZpjMtEkL.js → index-B5d_uvVc.js} +5 -5
  60. package/dist/{index-B2zWt4Ih.js → index-ByEp1JD0.js} +5 -5
  61. package/dist/{index.vue_vue_type_script_setup_true_lang-CSSSNBt8.js → index.vue_vue_type_script_setup_true_lang-DAJSG8i1.js} +6 -6
  62. package/dist/{item-DtR73Afo.js → item-CtfWra_w.js} +19 -19
  63. package/dist/{jszip.min-DgMmizjt.js → jszip.min-CNLaYb3p.js} +175 -175
  64. package/dist/{memberPricing-RVw5I6LL.js → memberPricing-DSqwOAgM.js} +1 -1
  65. package/dist/{menu-CaFnkDPh.js → menu-DUsES-YM.js} +1 -1
  66. package/dist/{menuV2-CphaxHaj.js → menuV2-BaY8Z_1c.js} +39 -39
  67. package/dist/mf-menu.css +1 -1
  68. package/dist/{order_pacing-CUyiMmGB.js → order_pacing-B5a8Fch-.js} +5 -5
  69. package/dist/{priceTier-CGLpjMw4.js → priceTier-bxvu4c84.js} +1 -1
  70. package/dist/{rules-3d19nDAK.js → rules-CTd3QZhN.js} +3 -3
  71. package/dist/{scheduler-CyPQu2Jd.js → scheduler-DIl9SPsA.js} +4 -4
  72. package/dist/{toExcel-Dbqi_aWn.js → toExcel-CUAEPhEv.js} +2 -2
  73. package/dist/{unit-CidyefuC.js → unit-DThoovpF.js} +3 -3
  74. package/package.json +1 -1
  75. package/dist/LinkProductSideSheet-Bwt2W9XG.js +0 -687
  76. package/dist/MenuSetting-CRCDO92S.js +0 -648
  77. package/dist/RuleView.vue_vue_type_script_setup_true_lang-Cxl5Mvc1.js +0 -3285
  78. package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Dl-6UT3T.js +0 -5940
  79. /package/dist/{vuedraggable-CK8z7qA8.js → RuleConditionSelector.vue_vue_type_style_index_0_lang-CK8z7qA8.js} +0 -0
@@ -1,648 +0,0 @@
1
- import { defineComponent as W, ref as V, computed as A, watch as j, resolveComponent as f, createBlock as B, openBlock as m, unref as e, withCtx as b, createElementVNode as r, createVNode as o, createElementBlock as k, Fragment as K, renderList as ee, createCommentVNode as R, toDisplayString as M, withModifiers as oe } from "vue";
2
- import { u as te, H as Q, a5 as ue, B as se, z as ie, G as ne } from "./index.vue_vue_type_script_setup_true_lang-CSSSNBt8.js";
3
- import { useI18n as X, useCoreStore as me } from "@feedmepos/mf-common";
4
- import { components as Y, FmButtonVariant as U, useDialog as ce, useSnackbar as ae, useBreakpoints as de, FmButtonColorThemeVariant as H } from "@feedmepos/ui-library";
5
- import { b as pe, m as E, _ as J, c as _e, d as ve, f as q } from "./RuleView.vue_vue_type_script_setup_true_lang-Cxl5Mvc1.js";
6
- import { _ as le } from "./app-DBDi3v7O.js";
7
- import { u as ge } from "./discardConfirm-BHni0LNu.js";
8
- import { _ as fe } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
9
- import { _ as re } from "./PageLayout.vue_vue_type_script_setup_true_lang-BVmHMvKD.js";
10
- import { u as be } from "./memberPricing-RVw5I6LL.js";
11
- import { C as O, a as N } from "./catalogSetting-CvotY0sm.js";
12
- import { u as ye } from "./priceTier-CGLpjMw4.js";
13
- const he = {
14
- class: "fm-typo-en-title-md-600 mr-auto"
15
- }, ke = {
16
- class: "py-8 px-8 overflow-y-auto space-y-24"
17
- }, xe = {
18
- class: "space-y-16"
19
- }, Se = {
20
- class: "flex flex-col"
21
- }, we = {
22
- class: "flex-1 relative border border-fm-color-neutral-gray-200 rounded-md p-16"
23
- }, Ce = {
24
- key: 0,
25
- class: "flex items-center select-none ml-16"
26
- }, Te = {
27
- class: "fm-typo-en-body-lg-400 text-fm-color-neutral-gray-300"
28
- }, Fe = {
29
- class: "flex gap-8 items-center justify-start"
30
- }, Re = /* @__PURE__ */ W({
31
- __name: "RuleGroupSideSheet",
32
- props: {
33
- modelValue: {
34
- type: Boolean
35
- },
36
- editingGroup: {}
37
- },
38
- emits: ["update:modelValue", "submit"],
39
- setup(L, {
40
- emit: l
41
- }) {
42
- const d = L, w = l, {
43
- t: i
44
- } = X(), x = te(), n = V({
45
- name: "",
46
- description: "",
47
- rules: []
48
- }), {
49
- convertCategoryIdToName: y,
50
- convertCategoryNameToId: C
51
- } = pe({
52
- menuItems: A(() => x.state.menu.modules.item || []),
53
- categories: A(() => x.categories || [])
54
- }), p = A({
55
- get: () => d.modelValue,
56
- set: (s) => w("update:modelValue", s)
57
- }), $ = V(null);
58
- j(() => d.editingGroup, (s) => {
59
- s ? n.value = {
60
- name: s.name,
61
- description: s.description,
62
- rules: s.rules.map((t) => ({
63
- ...t,
64
- restaurantRule: t.restaurantRule ? {
65
- restaurantAttributes: E(t.restaurantRule.restaurantAttributes),
66
- restaurantCustomAttributes: E(t.restaurantRule.restaurantCustomAttributes)
67
- } : void 0,
68
- itemRule: t.itemRule ? {
69
- itemAttributes: y(E(t.itemRule.itemAttributes)),
70
- itemCustomAttributes: E(t.itemRule.itemCustomAttributes)
71
- } : void 0
72
- }))
73
- } : n.value = {
74
- name: "",
75
- description: "",
76
- rules: []
77
- }, $.value = Q.cloneDeep(n.value);
78
- }, {
79
- immediate: !0
80
- }), j(() => d.modelValue, (s) => {
81
- s || (n.value = {
82
- name: "",
83
- description: "",
84
- rules: []
85
- });
86
- });
87
- function T(s) {
88
- return `${s}_${(/* @__PURE__ */ new Date()).toISOString()}`;
89
- }
90
- async function I() {
91
- var t;
92
- const s = {
93
- _id: ((t = d.editingGroup) == null ? void 0 : t._id) ?? T("group"),
94
- name: n.value.name,
95
- description: n.value.description,
96
- rules: n.value.rules.map((a) => ({
97
- _id: a._id,
98
- restaurantRule: a.restaurantRule ? {
99
- restaurantAttributes: q(a.restaurantRule.restaurantAttributes),
100
- restaurantCustomAttributes: q(a.restaurantRule.restaurantCustomAttributes)
101
- } : void 0,
102
- itemRule: a.itemRule ? {
103
- itemAttributes: q(C(a.itemRule.itemAttributes)),
104
- itemCustomAttributes: q(a.itemRule.itemCustomAttributes)
105
- } : void 0
106
- }))
107
- };
108
- w("submit", s);
109
- }
110
- const F = () => ({
111
- _id: T("rule"),
112
- restaurantRule: {
113
- restaurantAttributes: null,
114
- restaurantCustomAttributes: null
115
- },
116
- itemRule: {
117
- itemAttributes: null,
118
- itemCustomAttributes: null
119
- }
120
- });
121
- function z(s) {
122
- n.value.rules = n.value.rules.filter((t) => t._id !== s);
123
- }
124
- function P() {
125
- p.value = !1;
126
- }
127
- const g = ge(() => !Q.isEqual($.value, n.value), () => {
128
- p.value = !1;
129
- });
130
- function c(s) {
131
- n.value.rules.map((a) => a._id).includes(s.menuRule._id) ? n.value.rules = n.value.rules.map((a) => a._id === s.menuRule._id ? s.menuRule : a) : n.value.rules.push({
132
- ...s.menuRule
133
- });
134
- }
135
- const _ = V();
136
- return (s, t) => {
137
- const a = f("fm-button"), v = f("FmTextField"), S = f("FmButton"), G = f("FmFormGroup"), h = f("fm-side-sheet");
138
- return m(), B(h, {
139
- modelValue: p.value,
140
- "onUpdate:modelValue": t[6] || (t[6] = (u) => p.value = u),
141
- "is-container": e(Y).FmForm,
142
- "is-container-props": {
143
- onValidationSuccess: I,
144
- blameFormChildOnValidationFailed: !0
145
- },
146
- "max-width": 760,
147
- "onOn:clickedAway": e(g)
148
- }, {
149
- "side-sheet-header": b(() => [o(a, {
150
- variant: e(U).Tertiary,
151
- class: "cursor-pointer mr-4",
152
- "prepend-icon": "arrow_back",
153
- onClick: t[0] || (t[0] = () => p.value = !1)
154
- }, null, 8, ["variant"]), r("p", he, M(s.editingGroup ? e(i)("menu.rule_groups.edit_group") : e(i)("menu.rule_groups.create_group")), 1)]),
155
- "side-sheet-footer": b(() => [r("div", Fe, [o(a, {
156
- label: e(i)("common.save"),
157
- size: "lg",
158
- type: "submit",
159
- variant: "primary"
160
- }, null, 8, ["label"]), o(a, {
161
- label: e(i)("common.cancel"),
162
- size: "lg",
163
- variant: "tertiary",
164
- onClick: P
165
- }, null, 8, ["label"])])]),
166
- default: b(() => [r("div", ke, [o(J, {
167
- title: e(i)("menu.rule_groups.form.basic_info")
168
- }, {
169
- default: b(() => [r("div", xe, [o(v, {
170
- label: e(i)("menu.rule_groups.form.name"),
171
- "label-mark": "required",
172
- modelValue: n.value.name,
173
- "onUpdate:modelValue": t[1] || (t[1] = (u) => n.value.name = u),
174
- placeholder: e(i)("menu.rule_groups.form.name_placeholder"),
175
- required: "",
176
- rules: [(u) => !!(u != null && u.trim()) || e(i)("menu.rule_groups.validation.name_required")]
177
- }, null, 8, ["label", "modelValue", "placeholder", "rules"]), o(v, {
178
- label: e(i)("menu.rule_groups.form.description"),
179
- "label-mark": "optional",
180
- modelValue: n.value.description,
181
- "onUpdate:modelValue": t[2] || (t[2] = (u) => n.value.description = u),
182
- placeholder: e(i)("menu.rule_groups.form.description_placeholder"),
183
- multiline: "",
184
- rows: 3
185
- }, null, 8, ["label", "modelValue", "placeholder"])])]),
186
- _: 1
187
- }, 8, ["title"]), o(G, {
188
- tag: "div",
189
- "model-value": n.value.rules,
190
- rules: [(u) => u.length > 0 || e(i)("menu.rule_groups.validation.at_least_one_rule_required")]
191
- }, {
192
- default: b(() => [o(J, {
193
- title: e(i)("menu.rule_groups.form.rules"),
194
- "sub-title": e(i)("menu.rule_groups.form.rules_description")
195
- }, {
196
- default: b(() => [n.value.rules.length > 0 ? (m(!0), k(K, {
197
- key: 0
198
- }, ee(n.value.rules, (u, D) => (m(), k(K, {
199
- key: D
200
- }, [r("div", Se, [r("div", we, [o(_e, {
201
- "model-value": u,
202
- title: `${e(i)("menu.rule_groups.condition_view.rule")} ${D + 1}`,
203
- "onUpdate:modelValue": t[3] || (t[3] = (Z) => c(Z)),
204
- onDeleteRule: t[4] || (t[4] = (Z) => z(Z))
205
- }, null, 8, ["model-value", "title"])])]), n.value.rules.length > 1 && D < n.value.rules.length - 1 ? (m(), k("div", Ce, [r("span", Te, M(e(i)("menu.rule_groups.condition_view.or")), 1)])) : R("", !0)], 64))), 128)) : (m(), B(ue, {
206
- key: 1,
207
- title: "",
208
- subtitle: e(i)("menu.rule_groups.condition_view.empty_data.no_rule_available"),
209
- action: {
210
- text: e(i)("menu.link_product.rules.add_rule"),
211
- callback: () => {
212
- var u;
213
- (u = _.value) == null || u.trigger();
214
- }
215
- }
216
- }, null, 8, ["subtitle", "action"])), r("div", null, [o(ve, {
217
- ref_key: "ruleFormRef",
218
- ref: _,
219
- "is-edit-mode": !0,
220
- "model-value": F(),
221
- "onUpdate:modelValue": t[5] || (t[5] = (u) => c(u))
222
- }, {
223
- default: b(({
224
- trigger: u
225
- }) => [n.value.rules.length > 0 ? (m(), B(S, {
226
- key: 0,
227
- variant: e(U).Primary,
228
- label: e(i)("menu.link_product.rules.add_rule"),
229
- "prepend-icon": "add",
230
- onClick: oe(u, ["stop"])
231
- }, null, 8, ["variant", "label", "onClick"])) : R("", !0)]),
232
- _: 1
233
- }, 8, ["model-value"])])]),
234
- _: 1
235
- }, 8, ["title", "sub-title"])]),
236
- _: 1
237
- }, 8, ["model-value", "rules"])])]),
238
- _: 1
239
- }, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"]);
240
- };
241
- }
242
- }), Ve = {
243
- key: 0,
244
- class: "space-y-8"
245
- }, Ae = {
246
- class: "flex items-center justify-between"
247
- }, $e = {
248
- class: "fm-typo-en-title-md-600"
249
- }, Ge = {
250
- class: "text-fm-color-typo-secondary"
251
- }, Me = {
252
- class: "flex justify-end items-center"
253
- }, Ue = {
254
- class: "w-[320px]"
255
- }, Be = {
256
- key: 1,
257
- class: "flex-1 flex flex-col min-h-0"
258
- }, Ie = {
259
- class: "flex items-center justify-between p-8"
260
- }, Pe = {
261
- class: "flex-1 mr-8"
262
- }, Ne = {
263
- class: "flex flex-1 flex-col min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64"
264
- }, ze = ["onClick"], De = {
265
- class: "flex-1 space-y-4"
266
- }, Oe = {
267
- class: "fm-typo-en-body-lg-600"
268
- }, je = {
269
- key: 0,
270
- class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
271
- }, Le = /* @__PURE__ */ W({
272
- __name: "LinkProductRuleGroups",
273
- setup(L) {
274
- const {
275
- t: l
276
- } = X(), d = ce(), w = ae(), i = se(w), x = te(), n = V(x.state.menu.ruleGroupSettings || {
277
- groups: []
278
- });
279
- j(() => x.state.menu.ruleGroupSettings, (t) => {
280
- n.value = t || {
281
- groups: []
282
- };
283
- }, {
284
- deep: !0
285
- });
286
- const y = V(!1), C = V(null), p = de(), $ = A(() => p.breakpoints.value.xs), T = V(""), I = A(() => n.value.groups.filter((t) => t.name.toLowerCase().includes(T.value.toLowerCase()))), F = [{
287
- header: l("menu.rule_groups.table.columns.name"),
288
- accessorKey: "name",
289
- enableSorting: !0
290
- }, {
291
- header: l("menu.rule_groups.table.columns.description"),
292
- accessorKey: "description",
293
- enableSorting: !1
294
- }, {
295
- id: "actions",
296
- size: 100,
297
- cell: (t) => o("div", {
298
- class: "px-4 flex justify-end"
299
- }, [o(Y.FmButton, {
300
- icon: "delete",
301
- "text-color": H.NeutralGray400,
302
- variant: U.Tertiary,
303
- onClick: (a) => {
304
- a.stopPropagation(), c(t.row.original._id);
305
- }
306
- }, null)])
307
- }];
308
- function z(t) {
309
- g(t.original);
310
- }
311
- function P() {
312
- C.value = null, y.value = !0;
313
- }
314
- function g(t) {
315
- C.value = t, y.value = !0;
316
- }
317
- function c(t) {
318
- const a = n.value.groups.find((v) => v._id === t);
319
- a && d.open({
320
- title: l("menu.rule_groups.delete_dialog.title"),
321
- message: l("menu.rule_groups.delete_dialog.message", {
322
- name: a.name
323
- }),
324
- primaryActions: {
325
- text: l("menu.common.actions.remove"),
326
- close: !1,
327
- variant: U.Destructive
328
- },
329
- secondaryActions: {
330
- text: l("menu.common.actions.cancel"),
331
- close: !0
332
- }
333
- }).onPrimary(async () => {
334
- const v = Q.cloneDeep(n.value);
335
- v.groups = v.groups.filter((S) => S._id !== t), await _(v), d.close();
336
- });
337
- }
338
- async function _(t) {
339
- await i.minor(async () => {
340
- await x.updateMenuSetting({
341
- ruleGroupSettings: t
342
- });
343
- }, {
344
- successMessage: l("menu.rule_groups.saved_successfully")
345
- });
346
- }
347
- async function s(t) {
348
- var S;
349
- const a = (S = n.value.groups) == null ? void 0 : S.findIndex((G) => G._id === t._id), v = Q.cloneDeep(n.value);
350
- a >= 0 ? v.groups[a] = t : v.groups.push(t), await _(v), y.value = !1;
351
- }
352
- return j(() => y.value, (t) => {
353
- t || (C.value = null);
354
- }), (t, a) => {
355
- const v = f("FmButton"), S = f("FmSearch"), G = f("FmTable");
356
- return m(), k("div", null, [$.value ? (m(), k("div", Be, [r("div", Ie, [r("div", Pe, [o(S, {
357
- modelValue: T.value,
358
- "onUpdate:modelValue": a[1] || (a[1] = (h) => T.value = h),
359
- autofocus: "",
360
- class: "w-full",
361
- placeholder: e(l)("menu.rule_groups.search_placeholder")
362
- }, null, 8, ["modelValue", "placeholder"])]), o(v, {
363
- icon: "add",
364
- variant: e(U).Secondary,
365
- onClick: P
366
- }, null, 8, ["variant"])]), r("div", Ne, [(m(!0), k(K, null, ee(I.value, (h) => (m(), k("div", {
367
- key: h._id,
368
- class: "flex flex-row py-12 px-16 cursor-pointer",
369
- onClick: (u) => g(h)
370
- }, [r("div", De, [r("p", Oe, M(h.name), 1), h.description ? (m(), k("p", je, M(h.description), 1)) : R("", !0)]), o(v, {
371
- "text-color": e(H).NeutralGray400,
372
- variant: e(U).Tertiary,
373
- icon: "delete",
374
- onClick: oe((u) => c(h._id), ["stop"])
375
- }, null, 8, ["text-color", "variant", "onClick"])], 8, ze))), 128))])])) : (m(), k("div", Ve, [r("div", Ae, [r("div", null, [r("h1", $e, M(e(l)("menu.rule_groups.title")), 1), r("p", Ge, M(e(l)("menu.rule_groups.description")), 1)]), o(v, {
376
- label: e(l)("menu.rule_groups.create_group"),
377
- icon: "add",
378
- onClick: P
379
- }, null, 8, ["label"])]), r("div", Me, [r("div", Ue, [o(S, {
380
- modelValue: T.value,
381
- "onUpdate:modelValue": a[0] || (a[0] = (h) => T.value = h),
382
- autofocus: "",
383
- class: "mb-8",
384
- placeholder: e(l)("menu.rule_groups.search_placeholder")
385
- }, null, 8, ["modelValue", "placeholder"])])]), o(le, null, {
386
- default: b(() => [o(G, {
387
- "column-defs": F,
388
- "row-data": I.value,
389
- "page-size": I.value.length,
390
- "hide-footer": !0,
391
- onRowClick: z
392
- }, null, 8, ["row-data", "page-size"])]),
393
- _: 1
394
- })])), o(Re, {
395
- modelValue: y.value,
396
- "onUpdate:modelValue": a[2] || (a[2] = (h) => y.value = h),
397
- "editing-group": C.value,
398
- onSubmit: s
399
- }, null, 8, ["modelValue", "editing-group"])]);
400
- };
401
- }
402
- }), Ee = {
403
- key: 0
404
- }, qe = /* @__PURE__ */ W({
405
- __name: "MemberPricing",
406
- setup(L) {
407
- const {
408
- t: l
409
- } = X(), d = be(), w = A(() => d.memberPricings.value.length), i = [{
410
- header: l("menu.member_pricing.table.columns.name"),
411
- accessorKey: "key",
412
- enableSorting: !1
413
- }, {
414
- id: "actions",
415
- size: 50,
416
- cell: (n) => o("div", {
417
- class: "px-4 flex justify-end"
418
- }, [o(Y.FmButton, {
419
- icon: "delete",
420
- "text-color": H.NeutralGray400,
421
- variant: U.Tertiary,
422
- onClick: () => d.deleteMemberPricings(n.row.original.key)
423
- }, null)])
424
- }];
425
- function x() {
426
- d.create();
427
- }
428
- return (n, y) => {
429
- const C = f("FmTable");
430
- return m(), B(re, {
431
- heading: e(l)("menu.member_pricing.title"),
432
- subheading: e(l)("menu.member_pricing.description")
433
- }, {
434
- default: b(() => [w.value > 0 ? (m(), k("div", Ee, [o(le, null, {
435
- default: b(() => [o(C, {
436
- "column-defs": i,
437
- "row-data": e(d).memberPricings.value,
438
- "page-size": e(d).memberPricings.value.length,
439
- "hide-footer": !0
440
- }, null, 8, ["row-data", "page-size"])]),
441
- _: 1
442
- })])) : (m(), B(e(ue), {
443
- key: 1,
444
- action: {
445
- text: e(l)("menu.member_pricing.add_member_tier"),
446
- callback: x
447
- },
448
- subtitle: e(l)("menu.member_pricing.empty.subtitle"),
449
- title: e(l)("menu.member_pricing.empty.title")
450
- }, null, 8, ["action", "subtitle", "title"]))]),
451
- "append-heading": b(() => [w.value > 0 ? (m(), B(fe, {
452
- key: 0,
453
- label: e(l)("menu.member_pricing.add_member_tier"),
454
- "prepend-icon": "add",
455
- onClick: x
456
- }, null, 8, ["label"])) : R("", !0)]),
457
- _: 1
458
- }, 8, ["heading", "subheading"]);
459
- };
460
- }
461
- }), Ke = {
462
- class: "py-16"
463
- }, Qe = {
464
- key: 0,
465
- class: "space-y-32 max-w-[750px] xs:p-16"
466
- }, He = {
467
- key: 0,
468
- class: "pl-32 space-x-8"
469
- }, Je = {
470
- key: 1
471
- }, We = {
472
- class: "space-y-8"
473
- }, Xe = {
474
- class: "flex items-center justify-between"
475
- }, Ye = {
476
- class: "fm-typo-en-title-md-600"
477
- }, Ze = {
478
- class: "text-fm-color-typo-secondary"
479
- }, et = {
480
- key: 2
481
- }, tt = {
482
- key: 3
483
- }, _t = /* @__PURE__ */ W({
484
- __name: "MenuSetting",
485
- setup(L) {
486
- var P;
487
- const {
488
- t: l
489
- } = X(), d = te(), w = me(), i = ae(), x = se(i), n = A(() => ({
490
- lowStock: d.state.menu.lowStockThreshold,
491
- taxSetting: d.state.menu.masterCatalogSetting,
492
- priceTierSettings: d.state.menu.priceTierSettings
493
- })), y = V("conf"), C = A(() => [{
494
- label: l("menu.menu_setting.tabs.menu_configuration"),
495
- value: "conf"
496
- }, ...d.isV4 ? [{
497
- label: l("menu.menu_setting.tabs.price_group"),
498
- value: "price-group"
499
- }, ...d.state.featureFlags.showMemberPriceSettings ? [{
500
- label: l("menu.menu_setting.tabs.member_pricing"),
501
- value: "member-pricing"
502
- }] : [], {
503
- label: l("menu.menu_setting.tabs.link_product_rule_groups"),
504
- value: "link-product-rule-groups"
505
- }] : []]), p = V(O.transformTax((P = n.value.taxSetting) == null ? void 0 : P.inclusiveTaxes));
506
- j(() => n.value, (g) => {
507
- var c;
508
- p.value = O.transformTax((c = g.taxSetting) == null ? void 0 : c.inclusiveTaxes);
509
- });
510
- const $ = A(() => {
511
- if (!w.currentCountry.value) return [];
512
- const g = p.value.mode === N.MANUAL ? p.value.inclusive ?? [] : [];
513
- return ie.Country.getCountry(w.currentCountry.value).taxSystems.map((_) => {
514
- const s = g.find((t) => t.systemCode === _.code);
515
- return {
516
- inclusive: (s == null ? void 0 : s.inclusive) || !1,
517
- systemCode: _.code
518
- };
519
- });
520
- });
521
- function T(g) {
522
- const c = p.value, _ = c.mode === N.AUTO ? O.manualTax($.value) : ne(c);
523
- _.inclusive ?? (_.inclusive = []);
524
- const s = _.inclusive.findIndex((t) => t.systemCode === g.systemCode);
525
- s < 0 ? _.inclusive.push(g) : _.inclusive.splice(s, 1, g), p.value = _;
526
- }
527
- async function I() {
528
- if (n.value.lowStock !== null && n.value.lowStock !== void 0 && !Number.isInteger(n.value.lowStock))
529
- return;
530
- const g = p.value.mode === N.AUTO ? null : ne(p.value.inclusive);
531
- await x.minor(async () => {
532
- const c = n.value.lowStock === null || n.value.lowStock === void 0 || n.value.lowStock === 0;
533
- await d.updateMenuSetting({
534
- masterCatalogSetting: {
535
- inclusiveTaxes: g
536
- },
537
- lowStockThreshold: c ? null : n.value.lowStock,
538
- priceTierSettings: F.priceTiers.value
539
- });
540
- }, {
541
- successMessage: l("menu.menu_setting.fields.low_stock.updated")
542
- });
543
- }
544
- const F = ye(), z = [{
545
- header: l("menu.price_tier.settings_table.columns.name"),
546
- accessorKey: "key",
547
- enableSorting: !1
548
- }, {
549
- id: "actions",
550
- size: 50,
551
- cell: (g) => o("div", {
552
- class: "px-4 flex justify-end"
553
- }, [o(Y.FmButton, {
554
- icon: "delete",
555
- "text-color": H.NeutralGray400,
556
- variant: U.Tertiary,
557
- onClick: () => F.deletePriceTier(g.row.original.key)
558
- }, null)])
559
- }];
560
- return (g, c) => {
561
- const _ = f("FmTabs"), s = f("fm-radio"), t = f("fm-radio-group"), a = f("fm-checkbox"), v = f("FormItem"), S = f("FmStepperField"), G = f("FmButton"), h = f("FmTable");
562
- return m(), B(re, {
563
- heading: e(l)("menu.menu_setting.title")
564
- }, {
565
- default: b(() => [o(_, {
566
- items: C.value,
567
- modelValue: y.value,
568
- "onUpdate:modelValue": c[0] || (c[0] = (u) => y.value = u)
569
- }, null, 8, ["items", "modelValue"]), r("div", Ke, [y.value === "conf" ? (m(), k("div", Qe, [o(J, {
570
- title: e(l)("menu.tax_setting.title")
571
- }, {
572
- default: b(() => [o(v, {
573
- label: e(l)("menu.setting.tax.title")
574
- }, {
575
- default: b(() => [o(t, {
576
- "model-value": p.value.mode,
577
- "onUpdate:modelValue": c[1] || (c[1] = (u) => {
578
- u === e(N).AUTO ? p.value = e(O).autoTax() : p.value = e(O).manualTax($.value);
579
- })
580
- }, {
581
- default: b(() => [o(s, {
582
- value: e(N).AUTO,
583
- label: e(l)("menu.setting.tax.modes.auto.label"),
584
- sublabel: e(l)("menu.setting.tax.modes.auto.sublabel")
585
- }, null, 8, ["value", "label", "sublabel"]), o(s, {
586
- value: e(N).MANUAL,
587
- label: e(l)("menu.setting.tax.modes.manual.label"),
588
- sublabel: e(l)("menu.setting.tax.modes.manual.sublabel")
589
- }, null, 8, ["value", "label", "sublabel"])]),
590
- _: 1
591
- }, 8, ["model-value"]), p.value.mode === e(N).MANUAL ? (m(), k("div", He, [(m(!0), k(K, null, ee($.value, (u) => (m(), B(a, {
592
- key: u.systemCode,
593
- "model-value": u.inclusive,
594
- value: !0,
595
- label: e(l)("menu.catalog.form.tax.inclusive", {
596
- code: u.systemCode
597
- }),
598
- "onUpdate:modelValue": (D) => {
599
- T({
600
- ...u,
601
- inclusive: D
602
- });
603
- }
604
- }, null, 8, ["model-value", "label", "onUpdate:modelValue"]))), 128))])) : R("", !0)]),
605
- _: 1
606
- }, 8, ["label"])]),
607
- _: 1
608
- }, 8, ["title"]), o(J, {
609
- title: e(l)("menu.menu_setting.fields.low_stock.title"),
610
- "sub-title": e(l)("menu.menu_setting.fields.low_stock.subtitle")
611
- }, {
612
- default: b(() => [o(S, {
613
- "model-value": n.value.lowStock || null,
614
- min: 0,
615
- max: 1e3,
616
- step: 1,
617
- placeholder: e(l)("menu.menu_setting.fields.low_stock.not_set"),
618
- "onUpdate:modelValue": c[2] || (c[2] = (u) => {
619
- n.value.lowStock = u;
620
- }),
621
- rules: [(u) => u === null || Number.isInteger(u) || e(l)("menu.menu_setting.fields.low_stock.must_be_integer")],
622
- "helper-text": e(l)("menu.menu_setting.fields.low_stock.helper_text")
623
- }, null, 8, ["model-value", "placeholder", "rules", "helper-text"])]),
624
- _: 1
625
- }, 8, ["title", "sub-title"]), o(G, {
626
- onClick: I,
627
- label: e(l)("common.save")
628
- }, null, 8, ["label"])])) : R("", !0), y.value === "price-group" ? (m(), k("div", Je, [r("div", We, [r("div", Xe, [r("div", null, [r("h1", Ye, M(e(l)("menu.price_tier.price_group")), 1), r("p", Ze, M(e(l)("menu.price_tier.description")), 1)]), o(G, {
629
- label: e(l)("menu.price_tier.add_price_group"),
630
- icon: "add",
631
- onClick: e(F).create
632
- }, null, 8, ["label", "onClick"])]), o(le, null, {
633
- default: b(() => [o(h, {
634
- "column-defs": z,
635
- "row-data": e(F).priceTiers.value,
636
- "page-size": e(F).priceTiers.value.length,
637
- "hide-footer": !0
638
- }, null, 8, ["row-data", "page-size"])]),
639
- _: 1
640
- })])])) : R("", !0), y.value === "member-pricing" ? (m(), k("div", et, [o(qe)])) : R("", !0), y.value === "link-product-rule-groups" ? (m(), k("div", tt, [o(Le)])) : R("", !0)])]),
641
- _: 1
642
- }, 8, ["heading"]);
643
- };
644
- }
645
- });
646
- export {
647
- _t as default
648
- };