@feedmepos/mf-menu 0.32.43-dev.1 → 0.32.44
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.
- package/dist/{App-CiqMdAvF.js → App-BXkiQoTM.js} +7 -7
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-CVs7MfmX.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BoSL4dm7.js} +3 -3
- package/dist/{Catalog-KzftKfOt.js → Catalog-CLFVLyor.js} +44 -44
- package/dist/{Category-pNQdkIvn.js → Category-BdyouDU8.js} +24 -24
- package/dist/{Category-em6K5yk3.js → Category-CNuVHuI3.js} +25 -25
- package/dist/{CookingGuide-Bp9CvTAi.js → CookingGuide-Bed7bUt1.js} +105 -105
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-BbsxEs6O.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CZDL2xJC.js} +1 -1
- package/dist/{Group-mIwdwq58.js → Group-D4UTsIxI.js} +3 -3
- package/dist/{Group-eE_snSRq.js → Group-TUqCPmO3.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-C5l4ycJB.js → Group.vue_vue_type_script_setup_true_lang-BJPT8flL.js} +19 -19
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-B4PznWDZ.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D83liryu.js} +30 -30
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-eS8pMvVG.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-CRIRinHB.js} +1651 -1652
- package/dist/{Ingredient-BNvYYdb5.js → Ingredient-CcxoeuDd.js} +20 -20
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CzQIddna.js → InventoryBinding.vue_vue_type_script_setup_true_lang-58tyxdVh.js} +2 -2
- package/dist/{LinkProductSideSheet-BQQtUuCr.js → LinkProductSideSheet-DazOkwkd.js} +45 -45
- package/dist/{MenuSetting-s9syqMsT.js → MenuSetting-B3oLll4C.js} +47 -47
- package/dist/{PrintRoute-BqMxtnus.js → PrintRoute-D878qPu8.js} +39 -39
- package/dist/{Product-CHhpb-2E.js → Product-DOC8y_mW.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-DHny0uGc.js → Product.vue_vue_type_script_setup_true_lang-tZyBhWYT.js} +140 -140
- package/dist/{ProductInternalTools-DEB8Xhnv.js → ProductInternalTools-9TgIc2bR.js} +66 -66
- package/dist/Products-DfUGnHmD.js +1568 -0
- package/dist/{Publish-tnJY6n8r.js → Publish-BktK_PKq.js} +29 -29
- package/dist/{Recipe-DDPXv3AU.js → Recipe-eA0xrGYk.js} +24 -24
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-roEHTZnU.js → RuleView.vue_vue_type_script_setup_true_lang-t8M7z09s.js} +366 -366
- package/dist/{Scheduler-CMKwUkNN.js → Scheduler-CKSqPZLQ.js} +11 -11
- package/dist/{ServingSequence-NA0yeDMF.js → ServingSequence-Ea20baNj.js} +44 -44
- package/dist/{Setting-BRfi_hxY.js → Setting-u6lX_Dzg.js} +17 -17
- package/dist/{Subcategory-W9faZY7n.js → Subcategory-C6s7OMOb.js} +51 -51
- package/dist/{Takeaway-fijUedLA.js → Takeaway-B9kr-Nf4.js} +13 -13
- package/dist/{Takeaway-5DKxdpZ3.js → Takeaway-lWxS9oWe.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-BhiFnON_.js → Takeaway.vue_vue_type_script_setup_true_lang-oA0e9oI5.js} +54 -54
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-BUNPf1OD.js → Thumbnail.vue_vue_type_script_setup_true_lang-T40ChY7j.js} +27 -27
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-CcIGCUwk.js +194 -0
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B1e3d-uX.js +6130 -0
- package/dist/{Unit-582FVjPq.js → Unit-DkQlUg2l.js} +8 -8
- package/dist/{Variant-Cb02SmoL.js → Variant-BF5r2WLL.js} +25 -25
- package/dist/{_id_-BYU1xwzB.js → _id_-_oqk-OhC.js} +28 -28
- package/dist/app-CfCYl2pO.js +363 -0
- package/dist/{app-CcPyLfvj.js → app-DIYHNWEw.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-C1DHqpkR.js → linked-status-AoXjo9FF.js} +5 -5
- package/dist/assets/{menu-export-Ci-MXpn1.js → menu-export-BHcaWhM3.js} +2 -2
- package/dist/assets/{override-menu-CajXgOdO.js → override-menu-B9xQcjuJ.js} +5 -5
- package/dist/assets/{validate-menu-DDPswAia.js → validate-menu-D-ezd4W8.js} +2 -2
- package/dist/{catalog-Bs3SNL7n.js → catalog-CvN9Wu8V.js} +1 -1
- package/dist/{catalogSetting-BN4d_FvT.js → catalogSetting-qS5Np22q.js} +1 -1
- package/dist/{currency-Cma3AX0v.js → currency-Nxod6uwl.js} +1 -1
- package/dist/dayjs.min-B1AjAGva.js +6 -0
- package/dist/index-C0Zw1cSS.js +545 -0
- package/dist/{index-3wsuY29D.js → index-Cq-czJjU.js} +31 -31
- package/dist/index-nKlYiotY.js +246 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-DotsunNI.js → index.vue_vue_type_script_setup_true_lang-YXKayPEp.js} +269 -244
- package/dist/{item-DOcT7NVT.js → item-CUZSonzT.js} +2587 -2587
- package/dist/{jszip.min-h2cXUF_-.js → jszip.min-BnkZQ6lD.js} +6 -7
- package/dist/{menu-CAmS3pcT.js → menu-BP_ArXCI.js} +1 -1
- package/dist/{menuV2-COwLB3e1.js → menuV2-BGEYgQ8-.js} +128 -128
- package/dist/{priceTier-DrrQcFCh.js → priceTier-B-Qa0xaO.js} +1 -1
- package/dist/{rules-DGRdKiV6.js → rules-Dchd_ilF.js} +12 -12
- package/dist/{scheduler-BpEV0N8K.js → scheduler-DN7ZGLk8.js} +29 -29
- package/dist/{toExcel-eN1zgiqN.js → toExcel-jHmkDqcm.js} +2 -2
- package/dist/{translation-BCZ1Ruvv.js → translation-Cdap0IVg.js} +21 -35
- package/dist/{unit-BAcozp9s.js → unit-DgL56pkI.js} +35 -35
- package/package.json +2 -2
- package/dist/Products-C7UtJMGZ.js +0 -307
- package/dist/RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-PFRwBb1c.js +0 -144
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-DZp38dX4.js +0 -196
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DC4naR16.js +0 -5767
- package/dist/app-0m01R0SM.js +0 -2286
- package/dist/dayjs.min-D-HR3H5W.js +0 -7
- package/dist/index-DXY5zcNA.js +0 -545
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { defineComponent as
|
|
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
2
|
import { useI18n as R } from "@feedmepos/mf-common";
|
|
3
|
-
import { useSnackbar as P, components as W, useDialog as X, FmButtonVariant as
|
|
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
4
|
import { _ as re } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
5
|
-
import {
|
|
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-YXKayPEp.js";
|
|
6
6
|
import { _ as ue } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
|
|
7
|
-
import { _ as me } from "./app-
|
|
7
|
+
import { _ as me } from "./app-CfCYl2pO.js";
|
|
8
8
|
import { c as de } from "./createForm-BoUQeZTd.js";
|
|
9
9
|
import { u as pe } from "./discardConfirm-BHni0LNu.js";
|
|
10
|
-
import { c as
|
|
11
|
-
import { r as _e, u as ae } from "./rules-
|
|
12
|
-
import { _ as fe } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-
|
|
10
|
+
import { c as Q } from "./object-DVUNCr7w.js";
|
|
11
|
+
import { r as _e, u as ae } from "./rules-Dchd_ilF.js";
|
|
12
|
+
import { _ as fe } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-CcIGCUwk.js";
|
|
13
13
|
import { c as ve } from "./check-C9mY6LiX.js";
|
|
14
|
-
import { g as
|
|
15
|
-
import { a as ge } from "./menu-
|
|
14
|
+
import { g as I } from "./translation-Cdap0IVg.js";
|
|
15
|
+
import { a as ge } from "./menu-BP_ArXCI.js";
|
|
16
16
|
const ye = {
|
|
17
17
|
class: "fm-typo-en-title-md-600"
|
|
18
18
|
}, be = {
|
|
@@ -21,30 +21,30 @@ const ye = {
|
|
|
21
21
|
class: "py-12 px-16 space-y-4"
|
|
22
22
|
}, xe = {
|
|
23
23
|
class: "flex gap-8 items-center justify-start"
|
|
24
|
-
}, Ce = /* @__PURE__ */
|
|
24
|
+
}, Ce = /* @__PURE__ */ z({
|
|
25
25
|
__name: "Form",
|
|
26
26
|
props: {
|
|
27
27
|
initialValue: {}
|
|
28
28
|
},
|
|
29
|
-
setup(
|
|
29
|
+
setup(D, {
|
|
30
30
|
expose: w
|
|
31
31
|
}) {
|
|
32
|
-
const h =
|
|
32
|
+
const h = D, S = P(), F = Y(S), E = G(F), d = K(), {
|
|
33
33
|
t: l
|
|
34
|
-
} = R(), L = x(!1), o = x(!1), $ = x(!1), u = x(void 0),
|
|
34
|
+
} = R(), L = x(!1), o = x(!1), $ = x(!1), u = x(void 0), M = (e) => {
|
|
35
35
|
ve.isBoolean(e) ? o.value = e : o.value = !o.value;
|
|
36
|
-
}, s = x(
|
|
36
|
+
}, s = x(Q(h.initialValue)), O = V(() => !!s.value.name), B = V(() => {
|
|
37
37
|
var b;
|
|
38
38
|
const e = [], t = "en-US", a = (b = u.value) == null ? void 0 : b[t];
|
|
39
39
|
return s.value.name && !a && e.push({
|
|
40
40
|
locale: t,
|
|
41
41
|
name: s.value.name,
|
|
42
|
-
localeDisplay:
|
|
42
|
+
localeDisplay: I(t)
|
|
43
43
|
}), u.value && Object.entries(u.value).filter(([g, f]) => f && f.trim()).sort(([g], [f]) => g.localeCompare(f)).forEach(([g, f]) => {
|
|
44
44
|
e.push({
|
|
45
45
|
locale: g,
|
|
46
46
|
name: f,
|
|
47
|
-
localeDisplay:
|
|
47
|
+
localeDisplay: I(g)
|
|
48
48
|
});
|
|
49
49
|
}), e;
|
|
50
50
|
});
|
|
@@ -75,20 +75,20 @@ const ye = {
|
|
|
75
75
|
name_locale: u.value
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
}, s.value.name),
|
|
78
|
+
}, s.value.name), M(!1);
|
|
79
79
|
}
|
|
80
80
|
return te(() => o.value, () => {
|
|
81
81
|
if (!o.value) return;
|
|
82
|
-
s.value =
|
|
82
|
+
s.value = Q(h.initialValue);
|
|
83
83
|
const e = d.subcategories.find((t) => t._id === s.value._id);
|
|
84
84
|
u.value = e == null ? void 0 : e.name_locale;
|
|
85
85
|
}), w({
|
|
86
|
-
trigger:
|
|
86
|
+
trigger: M,
|
|
87
87
|
show: o
|
|
88
88
|
}), (e, t) => {
|
|
89
89
|
const a = C("fm-button"), b = C("FmTooltip"), g = C("FmTextField"), f = C("fm-side-sheet");
|
|
90
|
-
return p(), k(
|
|
91
|
-
trigger:
|
|
90
|
+
return p(), k(A, null, [oe(e.$slots, "default", {
|
|
91
|
+
trigger: M
|
|
92
92
|
}), m(f, {
|
|
93
93
|
id: "group-form",
|
|
94
94
|
modelValue: o.value,
|
|
@@ -101,7 +101,7 @@ const ye = {
|
|
|
101
101
|
"max-width": 560,
|
|
102
102
|
"onOn:clickedAway": n(r)
|
|
103
103
|
}, {
|
|
104
|
-
"side-sheet-header": y(() => [c("p", ye,
|
|
104
|
+
"side-sheet-header": y(() => [c("p", ye, T(n(l)("menu.subcategory.title")), 1)]),
|
|
105
105
|
"side-sheet-footer": y(() => [c("div", xe, [m(a, {
|
|
106
106
|
label: n(l)("menu.common.actions.update"),
|
|
107
107
|
loading: L.value,
|
|
@@ -127,9 +127,9 @@ const ye = {
|
|
|
127
127
|
placement: "top",
|
|
128
128
|
"z-index": 999
|
|
129
129
|
}, {
|
|
130
|
-
content: y(() => [c("div", he, [(p(!0), k(
|
|
130
|
+
content: y(() => [c("div", he, [(p(!0), k(A, null, H(B.value, (v) => (p(), k("div", {
|
|
131
131
|
key: v.locale
|
|
132
|
-
},
|
|
132
|
+
}, T(v.name) + " (" + T(v.localeDisplay) + ") ", 1))), 128))])]),
|
|
133
133
|
default: y(() => [m(a, {
|
|
134
134
|
variant: "tertiary",
|
|
135
135
|
icon: "g_translate",
|
|
@@ -165,17 +165,17 @@ const ye = {
|
|
|
165
165
|
class: "p-8"
|
|
166
166
|
}, Se = {
|
|
167
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"],
|
|
168
|
+
}, Ee = ["onClick"], Me = {
|
|
169
169
|
class: "flex-1 space-y-4"
|
|
170
|
-
},
|
|
170
|
+
}, Ne = {
|
|
171
171
|
class: "fm-typo-en-body-lg-600"
|
|
172
|
-
},
|
|
172
|
+
}, Te = /* @__PURE__ */ z({
|
|
173
173
|
__name: "SubcategoryTable",
|
|
174
|
-
setup(
|
|
175
|
-
const w = X(), h = P(), S = Y(h), F =
|
|
174
|
+
setup(D) {
|
|
175
|
+
const w = X(), h = P(), S = Y(h), F = G(S), E = ae({
|
|
176
176
|
dialog: w,
|
|
177
177
|
menuLoader: F
|
|
178
|
-
}), d = V(() =>
|
|
178
|
+
}), d = V(() => K().subcategories), l = x(""), L = V(() => d.value.filter((i) => i.name.toLowerCase().includes(l.value.toLowerCase()))), {
|
|
179
179
|
t: o
|
|
180
180
|
} = R(), $ = x([{
|
|
181
181
|
accessorKey: "name",
|
|
@@ -185,12 +185,12 @@ const ye = {
|
|
|
185
185
|
width: "auto"
|
|
186
186
|
},
|
|
187
187
|
cell: (i) => {
|
|
188
|
-
const r = i.row.original, _ = i.getValue(), t = Object.keys(r.name_locale ?? {}).map((a) =>
|
|
189
|
-
return
|
|
188
|
+
const r = i.row.original, _ = i.getValue(), t = Object.keys(r.name_locale ?? {}).map((a) => I(a));
|
|
189
|
+
return N("div", {
|
|
190
190
|
class: "flex items-center gap-8"
|
|
191
|
-
}, [
|
|
191
|
+
}, [N("span", {
|
|
192
192
|
class: "break-all"
|
|
193
|
-
}, _), ...t.map((a) =>
|
|
193
|
+
}, _), ...t.map((a) => N("div", {
|
|
194
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
195
|
}, a))]);
|
|
196
196
|
}
|
|
@@ -204,14 +204,14 @@ const ye = {
|
|
|
204
204
|
header: "",
|
|
205
205
|
cell: (i) => {
|
|
206
206
|
const r = i.row.original;
|
|
207
|
-
return
|
|
207
|
+
return N("div", {
|
|
208
208
|
class: "flex justify-end"
|
|
209
|
-
}, [
|
|
209
|
+
}, [N(W.FmButton, {
|
|
210
210
|
icon: "delete",
|
|
211
211
|
disabled: !r._id,
|
|
212
212
|
variant: "tertiary",
|
|
213
213
|
textColor: "neutral-gray-400",
|
|
214
|
-
onClick:
|
|
214
|
+
onClick: J(async () => {
|
|
215
215
|
await u(r);
|
|
216
216
|
}, ["stop", "prevent"])
|
|
217
217
|
})]);
|
|
@@ -233,7 +233,7 @@ const ye = {
|
|
|
233
233
|
primaryActions: {
|
|
234
234
|
text: "Remove",
|
|
235
235
|
close: !0,
|
|
236
|
-
variant:
|
|
236
|
+
variant: q.Destructive
|
|
237
237
|
},
|
|
238
238
|
secondaryActions: {
|
|
239
239
|
text: "Cancel",
|
|
@@ -247,7 +247,7 @@ const ye = {
|
|
|
247
247
|
}, i.name, !0);
|
|
248
248
|
});
|
|
249
249
|
}
|
|
250
|
-
async function
|
|
250
|
+
async function M(i) {
|
|
251
251
|
const r = i.map((_) => _._id).filter((_) => !!_);
|
|
252
252
|
await E.rearrange(r);
|
|
253
253
|
}
|
|
@@ -257,7 +257,7 @@ const ye = {
|
|
|
257
257
|
initialValue: i
|
|
258
258
|
});
|
|
259
259
|
}
|
|
260
|
-
const
|
|
260
|
+
const B = se(), j = V(() => B.breakpoints.value.xs);
|
|
261
261
|
return (i, r) => {
|
|
262
262
|
const _ = C("FmSearch"), e = C("FmTable"), t = C("FmButton");
|
|
263
263
|
return j.value ? (p(), k("div", Le, [c("div", $e, [m(_, {
|
|
@@ -268,16 +268,16 @@ const ye = {
|
|
|
268
268
|
placeholder: n(o)("menu.common.labels.search_placeholder", {
|
|
269
269
|
type: "categories"
|
|
270
270
|
})
|
|
271
|
-
}, null, 8, ["modelValue", "placeholder"])]), c("div", Se, [(p(!0), k(
|
|
271
|
+
}, null, 8, ["modelValue", "placeholder"])]), c("div", Se, [(p(!0), k(A, null, H(L.value, (a) => (p(), k("div", {
|
|
272
272
|
key: a._id || "",
|
|
273
273
|
class: "flex flex-row py-12 px-16",
|
|
274
274
|
onClick: (b) => O(a)
|
|
275
|
-
}, [c("div",
|
|
275
|
+
}, [c("div", Me, [c("p", Ne, T(a.name), 1)]), m(t, {
|
|
276
276
|
"text-color": n(ie).NeutralGray400,
|
|
277
|
-
variant: n(
|
|
277
|
+
variant: n(q).Tertiary,
|
|
278
278
|
"prepend-icon": "delete",
|
|
279
279
|
disabled: !a._id,
|
|
280
|
-
onClick:
|
|
280
|
+
onClick: J((b) => u(a), ["stop"])
|
|
281
281
|
}, null, 8, ["text-color", "variant", "disabled", "onClick"])], 8, Ee))), 128))])])) : (p(), k("div", Ve, [c("div", we, [c("div", Fe, [m(_, {
|
|
282
282
|
modelValue: l.value,
|
|
283
283
|
"onUpdate:modelValue": r[0] || (r[0] = (a) => l.value = a),
|
|
@@ -296,17 +296,17 @@ const ye = {
|
|
|
296
296
|
"shrink-at": !1,
|
|
297
297
|
"hide-footer": "",
|
|
298
298
|
"pin-header-row": "",
|
|
299
|
-
onDndChanged:
|
|
299
|
+
onDndChanged: M,
|
|
300
300
|
onRowClick: r[1] || (r[1] = (a) => O(a.original))
|
|
301
301
|
}, null, 8, ["column-defs", "page-size", "row-data", "search-value"])]),
|
|
302
302
|
_: 1
|
|
303
303
|
})]));
|
|
304
304
|
};
|
|
305
305
|
}
|
|
306
|
-
}), Oe = { class: "flex-1 flex justify-between gap-8 pl-8" }, Ue = { class: "flex items-center" },
|
|
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
307
|
__name: "Subcategory",
|
|
308
|
-
setup(
|
|
309
|
-
const w = X(), h = P(), S = Y(h), F =
|
|
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
310
|
function L() {
|
|
311
311
|
E.create();
|
|
312
312
|
}
|
|
@@ -315,7 +315,7 @@ const ye = {
|
|
|
315
315
|
heading: n(l)("menu.subcategory.title")
|
|
316
316
|
}, {
|
|
317
317
|
default: y(() => [
|
|
318
|
-
d.value.length > 0 ? (p(), U(
|
|
318
|
+
d.value.length > 0 ? (p(), U(Te, { key: 0 })) : (p(), U(n(ce), {
|
|
319
319
|
key: 1,
|
|
320
320
|
action: {
|
|
321
321
|
text: n(l)("menu.subcategory.add"),
|
|
@@ -328,8 +328,8 @@ const ye = {
|
|
|
328
328
|
"append-heading": y(() => [
|
|
329
329
|
c("div", Oe, [
|
|
330
330
|
c("div", Ue, [
|
|
331
|
-
c("div",
|
|
332
|
-
c("p",
|
|
331
|
+
c("div", De, [
|
|
332
|
+
c("p", Be, T(o.value), 1)
|
|
333
333
|
])
|
|
334
334
|
]),
|
|
335
335
|
d.value.length > 0 ? (p(), U(re, {
|
|
@@ -1,17 +1,17 @@
|
|
|
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 {
|
|
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-YXKayPEp.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-
|
|
8
|
-
import { T as
|
|
9
|
-
import { a as
|
|
10
|
-
const
|
|
7
|
+
import { _ as N } from "./Takeaway.vue_vue_type_script_setup_true_lang-oA0e9oI5.js";
|
|
8
|
+
import { T as S, l as L } from "./index-Cq-czJjU.js";
|
|
9
|
+
import { a as O } from "./menu-BP_ArXCI.js";
|
|
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
|
-
setup(
|
|
12
|
+
setup(D) {
|
|
13
13
|
const u = V(), l = x(u), p = v(), c = w(l), _ = y(() => p.rules.item.bindToVariant), n = k(0), { t: r } = T();
|
|
14
|
-
return
|
|
14
|
+
return O().resetOnMount(), (I, o) => (d(), i(C, {
|
|
15
15
|
heading: a(r)("menu.takeaway.title")
|
|
16
16
|
}, {
|
|
17
17
|
default: s(() => [
|
|
@@ -20,14 +20,14 @@ const L = { class: "flex-1 flex justify-between gap-8 pl-8" }, U = { class: "fle
|
|
|
20
20
|
})
|
|
21
21
|
]),
|
|
22
22
|
"append-heading": s(() => [
|
|
23
|
-
t("div",
|
|
24
|
-
t("div",
|
|
23
|
+
t("div", U, [
|
|
24
|
+
t("div", B, [
|
|
25
25
|
t("div", F, [
|
|
26
|
-
t("p",
|
|
26
|
+
t("p", A, b(n.value), 1)
|
|
27
27
|
])
|
|
28
28
|
]),
|
|
29
29
|
t("div", null, [
|
|
30
|
-
n.value > 0 ? (d(), i(a(
|
|
30
|
+
n.value > 0 ? (d(), i(a(S), {
|
|
31
31
|
key: 0,
|
|
32
32
|
"bind-to-variant": _.value,
|
|
33
33
|
action: "add",
|
|
@@ -37,7 +37,7 @@ const L = { class: "flex-1 flex justify-between gap-8 pl-8" }, U = { class: "fle
|
|
|
37
37
|
module: a(M.F_MENU_MODULE_V4_KEY).enum.takeaway,
|
|
38
38
|
operation: a(E.F_OPERATION_TYPE).create,
|
|
39
39
|
data: e,
|
|
40
|
-
link: a(
|
|
40
|
+
link: a(L)(e.usedBy || [])
|
|
41
41
|
},
|
|
42
42
|
e.name
|
|
43
43
|
))
|
|
@@ -60,5 +60,5 @@ const L = { class: "flex-1 flex justify-between gap-8 pl-8" }, U = { class: "fle
|
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
62
|
export {
|
|
63
|
-
|
|
63
|
+
z as default
|
|
64
64
|
};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { getCurrentInstance as te, defineComponent as ne, computed as T, watch as oe, h as
|
|
2
|
-
import {
|
|
1
|
+
import { getCurrentInstance as te, defineComponent as ne, computed as T, watch as oe, h as U, resolveComponent as L, createElementBlock as V, openBlock as w, Fragment as O, normalizeClass as D, createElementVNode as g, createVNode as I, unref as i, isRef as j, withCtx as P, renderList as ie, createBlock as G, createCommentVNode as $, toDisplayString as B, withModifiers as q } from "vue";
|
|
2
|
+
import { G as H, u as J, Q as W, M as N, A as z, I as Y, B as se, ap as Q, a4 as re } from "./index.vue_vue_type_script_setup_true_lang-YXKayPEp.js";
|
|
3
3
|
import { useI18n as X, useCoreStore as le } from "@feedmepos/mf-common";
|
|
4
|
-
import { useDialog as ce, useSnackbar as Z, FmButtonVariant as A, components as de, useBreakpoints as
|
|
5
|
-
import { _ as
|
|
6
|
-
import { a as ye, l as ee, T as pe } from "./index-
|
|
4
|
+
import { useDialog as ce, useSnackbar as Z, FmButtonVariant as A, components as de, useBreakpoints as ue } from "@feedmepos/ui-library";
|
|
5
|
+
import { _ as me } from "./app-CfCYl2pO.js";
|
|
6
|
+
import { a as ye, l as ee, T as pe } from "./index-Cq-czJjU.js";
|
|
7
7
|
import { u as fe } from "./search-BAPEUu1R.js";
|
|
8
|
-
import { f as F } from "./currency-
|
|
8
|
+
import { f as F } from "./currency-Nxod6uwl.js";
|
|
9
9
|
import { defineStore as _e } from "pinia";
|
|
10
|
-
import { C as ke } from "./catalog-
|
|
10
|
+
import { C as ke } from "./catalog-CvN9Wu8V.js";
|
|
11
11
|
import { c as ve } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
12
|
-
import { g as we } from "./translation-
|
|
13
|
-
function ge(b, _, l,
|
|
12
|
+
import { g as we } from "./translation-Cdap0IVg.js";
|
|
13
|
+
function ge(b, _, l, u) {
|
|
14
14
|
var y, p, k;
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
return
|
|
15
|
+
if (u >= 0) {
|
|
16
|
+
const m = (y = b.override.items[_._id][u]) == null ? void 0 : y.takeawayUsed;
|
|
17
|
+
return m == null ? void 0 : Y(m);
|
|
18
18
|
}
|
|
19
|
-
const e = l.find((
|
|
20
|
-
return _.combinationKey ? ((k = (p = e == null ? void 0 : e.variant) == null ? void 0 : p.variantCombinations.find((
|
|
19
|
+
const e = l.find((m) => m._id === _._id);
|
|
20
|
+
return _.combinationKey ? ((k = (p = e == null ? void 0 : e.variant) == null ? void 0 : p.variantCombinations.find((m) => m.combinationKey === _.combinationKey)) == null ? void 0 : k.takeawayUsed) ?? (e == null ? void 0 : e.takeawayUsed) : e == null ? void 0 : e.takeawayUsed;
|
|
21
21
|
}
|
|
22
|
-
function be(b, _, l,
|
|
23
|
-
var k,
|
|
22
|
+
function be(b, _, l, u) {
|
|
23
|
+
var k, m;
|
|
24
24
|
const e = Y(b);
|
|
25
25
|
e.override.takeaway[l._id] = { price: l.price || void 0 };
|
|
26
26
|
const y = [...l.usedBy, ..._.usedBy];
|
|
@@ -29,7 +29,7 @@ function be(b, _, l, m) {
|
|
|
29
29
|
(s) => s._id === o._id && s.combinationKey === o.combinationKey
|
|
30
30
|
) ? l._id : "", a = (e.override.items[o._id] || []).findIndex(
|
|
31
31
|
(s) => s.combinationKey === o.combinationKey
|
|
32
|
-
), d = ge(e, o,
|
|
32
|
+
), d = ge(e, o, u, a);
|
|
33
33
|
if (a >= 0)
|
|
34
34
|
e.override.items[o._id][a].takeawayUsed = c;
|
|
35
35
|
else if (d !== c) {
|
|
@@ -43,8 +43,8 @@ function be(b, _, l, m) {
|
|
|
43
43
|
}
|
|
44
44
|
const p = [...new Set(y.map((o) => o._id))];
|
|
45
45
|
for (const o of p) {
|
|
46
|
-
const v =
|
|
47
|
-
if (!((
|
|
46
|
+
const v = u.find((d) => d._id === o);
|
|
47
|
+
if (!((m = (k = v == null ? void 0 : v.variant) == null ? void 0 : k.variantCombinations) != null && m.length)) continue;
|
|
48
48
|
const c = (e.override.items[o] || []).findIndex(
|
|
49
49
|
(d) => !d.combinationKey
|
|
50
50
|
);
|
|
@@ -54,7 +54,7 @@ function be(b, _, l, m) {
|
|
|
54
54
|
return e;
|
|
55
55
|
}
|
|
56
56
|
const he = _e("takeaway-manager", () => {
|
|
57
|
-
const b = ce(), _ = Z(), l = H(_),
|
|
57
|
+
const b = ce(), _ = Z(), l = H(_), u = W(l), e = J(), y = te(), { t: p } = X(), k = (a) => {
|
|
58
58
|
var s, h;
|
|
59
59
|
const { vNode: d } = ve(
|
|
60
60
|
ye,
|
|
@@ -63,7 +63,7 @@ const he = _e("takeaway-manager", () => {
|
|
|
63
63
|
);
|
|
64
64
|
(h = (s = d.component) == null ? void 0 : s.exposed) == null || h.trigger();
|
|
65
65
|
};
|
|
66
|
-
async function
|
|
66
|
+
async function m(a) {
|
|
67
67
|
var h, E;
|
|
68
68
|
const s = ((E = (h = e.currentCatalog) == null ? void 0 : h.override.takeaway[a._id]) == null ? void 0 : E.price) ? null : e.state.menu.modules.takeaway.find((x) => x._id === a._id);
|
|
69
69
|
k({
|
|
@@ -74,7 +74,7 @@ const he = _e("takeaway-manager", () => {
|
|
|
74
74
|
action: "update",
|
|
75
75
|
"onUpdate:takeaway": async (x) => {
|
|
76
76
|
let n = Y(e.currentCatalog);
|
|
77
|
-
x.price ? n.override.takeaway[a._id] = { price: x.price } : delete n.override.takeaway[a._id], n = be(n, a, x, e.state.menu.modules.item), await new ke(n, e,
|
|
77
|
+
x.price ? n.override.takeaway[a._id] = { price: x.price } : delete n.override.takeaway[a._id], n = be(n, a, x, e.state.menu.modules.item), await new ke(n, e, u.updateMenu, b).update();
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
}
|
|
@@ -85,10 +85,10 @@ const he = _e("takeaway-manager", () => {
|
|
|
85
85
|
applyProduct: !0,
|
|
86
86
|
action: "update",
|
|
87
87
|
"onUpdate:takeaway": async (d) => {
|
|
88
|
-
await
|
|
88
|
+
await u.updateMenu(
|
|
89
89
|
{
|
|
90
|
-
module:
|
|
91
|
-
operation:
|
|
90
|
+
module: z.F_MENU_MODULE_V4_KEY.enum.takeaway,
|
|
91
|
+
operation: N.F_OPERATION_TYPE.update,
|
|
92
92
|
data: d,
|
|
93
93
|
link: ee(d.usedBy || [])
|
|
94
94
|
},
|
|
@@ -98,7 +98,7 @@ const he = _e("takeaway-manager", () => {
|
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
100
|
async function v(a) {
|
|
101
|
-
e.currentCatalog ? await
|
|
101
|
+
e.currentCatalog ? await m(a) : await o(a);
|
|
102
102
|
}
|
|
103
103
|
async function c(a) {
|
|
104
104
|
b.open({
|
|
@@ -114,10 +114,10 @@ const he = _e("takeaway-manager", () => {
|
|
|
114
114
|
close: !0
|
|
115
115
|
}
|
|
116
116
|
}).onPrimary(async () => {
|
|
117
|
-
await
|
|
117
|
+
await u.updateMenu(
|
|
118
118
|
{
|
|
119
|
-
module:
|
|
120
|
-
operation:
|
|
119
|
+
module: z.F_MENU_MODULE_V4_KEY.enum.takeaway,
|
|
120
|
+
operation: N.F_OPERATION_TYPE.delete,
|
|
121
121
|
data: a._id
|
|
122
122
|
},
|
|
123
123
|
a.name,
|
|
@@ -140,7 +140,7 @@ const he = _e("takeaway-manager", () => {
|
|
|
140
140
|
class: "px-16 pt-8"
|
|
141
141
|
}, Ie = {
|
|
142
142
|
class: /* @__PURE__ */ D(["flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100"])
|
|
143
|
-
},
|
|
143
|
+
}, Me = ["onClick"], Ue = {
|
|
144
144
|
class: "flex-1"
|
|
145
145
|
}, Ee = {
|
|
146
146
|
class: "fm-typo-en-body-lg-600 mb-4"
|
|
@@ -157,7 +157,7 @@ const he = _e("takeaway-manager", () => {
|
|
|
157
157
|
setup(b, {
|
|
158
158
|
emit: _
|
|
159
159
|
}) {
|
|
160
|
-
const l =
|
|
160
|
+
const l = J(), u = he(), e = T(() => l.rules.item.bindToVariant), y = T(() => l.rules.takeaway), p = W(H(Z())), k = le(), m = T(() => se.Country.getCountry(k.currentCountry.value).currency), o = T(() => l.takeaways.map((n) => ({
|
|
161
161
|
...n,
|
|
162
162
|
usedBy: l.items.reduce((r, f) => {
|
|
163
163
|
var t, K, R;
|
|
@@ -192,19 +192,19 @@ const he = _e("takeaway-manager", () => {
|
|
|
192
192
|
enableSorting: !1,
|
|
193
193
|
size: 700,
|
|
194
194
|
cell: (n) => {
|
|
195
|
-
const r = n.row.original, f = n.getValue(),
|
|
196
|
-
return
|
|
195
|
+
const r = n.row.original, f = n.getValue(), M = Object.keys(r.name_locale ?? {}).map((t) => we(t));
|
|
196
|
+
return U("div", {
|
|
197
197
|
class: "flex items-center gap-8"
|
|
198
|
-
}, [
|
|
198
|
+
}, [U("span", {
|
|
199
199
|
class: "break-all"
|
|
200
|
-
}, f), ...
|
|
200
|
+
}, f), ...M.map((t) => U("div", {
|
|
201
201
|
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"
|
|
202
202
|
}, t))]);
|
|
203
203
|
}
|
|
204
204
|
}, {
|
|
205
205
|
accessorKey: "price",
|
|
206
206
|
header: () => s("menu.takeaway.table.columns.price", {
|
|
207
|
-
symbol:
|
|
207
|
+
symbol: m.value.symbol
|
|
208
208
|
}),
|
|
209
209
|
enableSorting: !1,
|
|
210
210
|
size: 200,
|
|
@@ -221,7 +221,7 @@ const he = _e("takeaway-manager", () => {
|
|
|
221
221
|
enableSorting: !1,
|
|
222
222
|
size: 200,
|
|
223
223
|
cell: (n) => {
|
|
224
|
-
const r = n.getValue(), f =
|
|
224
|
+
const r = n.getValue(), f = Q(l.categorizedItems, r).flatMap((C) => C.items).length ?? 0;
|
|
225
225
|
return s("menu.takeaway.table.items_linked", {
|
|
226
226
|
count: f
|
|
227
227
|
});
|
|
@@ -233,22 +233,22 @@ const he = _e("takeaway-manager", () => {
|
|
|
233
233
|
cellClass: "pl-16",
|
|
234
234
|
headerContentClass: "-mx-16"
|
|
235
235
|
},
|
|
236
|
-
cell: (n) =>
|
|
236
|
+
cell: (n) => U("div", {
|
|
237
237
|
class: "flex justify-end items-center"
|
|
238
|
-
}, [y.value.delete ?
|
|
238
|
+
}, [y.value.delete ? U(de.FmButton, {
|
|
239
239
|
prependIcon: "delete",
|
|
240
240
|
variant: A.Tertiary,
|
|
241
241
|
textColor: "neutral-gray-400",
|
|
242
242
|
onClick: (r) => {
|
|
243
|
-
r.stopPropagation(),
|
|
243
|
+
r.stopPropagation(), u.deleteTakeaway(n.row.original);
|
|
244
244
|
}
|
|
245
245
|
}) : null])
|
|
246
|
-
}]), E =
|
|
246
|
+
}]), E = ue(), x = T(() => E.breakpoints.value.xs);
|
|
247
247
|
return (n, r) => {
|
|
248
|
-
const f =
|
|
249
|
-
return o.value.length ? (w(), V(
|
|
248
|
+
const f = L("fm-search"), C = L("fm-table"), M = L("fm-button");
|
|
249
|
+
return o.value.length ? (w(), V(O, {
|
|
250
250
|
key: 0
|
|
251
|
-
}, [x.value ? (w(), V(
|
|
251
|
+
}, [x.value ? (w(), V(O, {
|
|
252
252
|
key: 1
|
|
253
253
|
}, [g("div", Ve, [I(f, {
|
|
254
254
|
class: "w-full",
|
|
@@ -256,24 +256,24 @@ const he = _e("takeaway-manager", () => {
|
|
|
256
256
|
modelValue: i(c),
|
|
257
257
|
"onUpdate:modelValue": r[2] || (r[2] = (t) => j(c) ? c.value = t : null),
|
|
258
258
|
placeholder: i(s)("menu.takeaway.table.search.placeholder")
|
|
259
|
-
}, null, 8, ["modelValue", "placeholder"])]), g("div", Ie, [(w(!0), V(
|
|
259
|
+
}, null, 8, ["modelValue", "placeholder"])]), g("div", Ie, [(w(!0), V(O, null, ie(a.value, (t) => (w(), V("div", {
|
|
260
260
|
key: t._id,
|
|
261
261
|
class: D(["py-12 px-16", "flex space-x-8", "items-center"]),
|
|
262
262
|
onClick: () => {
|
|
263
|
-
y.value.edit && i(
|
|
263
|
+
y.value.edit && i(u).updateTakeaway(t);
|
|
264
264
|
}
|
|
265
|
-
}, [g("div",
|
|
265
|
+
}, [g("div", Ue, [g("p", Ee, B(t.name), 1), g("p", Ke, B(`${i(Q)(i(l).categorizedItems, t.usedBy).flatMap((K) => K.items).length ?? 0} items linked`), 1), g("p", Se, " Price: " + B(m.value.symbol) + B(i(F)(t.price, !1)), 1)]), y.value.delete ? (w(), G(M, {
|
|
266
266
|
key: 0,
|
|
267
267
|
variant: i(A).Tertiary,
|
|
268
268
|
"text-color": "neutral-gray-400",
|
|
269
269
|
"prepend-icon": "delete",
|
|
270
|
-
onClick: q(() => i(
|
|
271
|
-
}, null, 8, ["variant", "onClick"])) : $("", !0)], 8,
|
|
270
|
+
onClick: q(() => i(u).deleteTakeaway(t), ["stop"])
|
|
271
|
+
}, null, 8, ["variant", "onClick"])) : $("", !0)], 8, Me))), 128))])], 64)) : (w(), V("div", xe, [g("div", Ce, [g("div", Te, [I(f, {
|
|
272
272
|
autofocus: "",
|
|
273
273
|
modelValue: i(c),
|
|
274
274
|
"onUpdate:modelValue": r[0] || (r[0] = (t) => j(c) ? c.value = t : null),
|
|
275
275
|
placeholder: i(s)("menu.takeaway.table.search.placeholder")
|
|
276
|
-
}, null, 8, ["modelValue", "placeholder"])])]), I(
|
|
276
|
+
}, null, 8, ["modelValue", "placeholder"])])]), I(me, null, {
|
|
277
277
|
default: P(() => [I(C, {
|
|
278
278
|
"column-defs": h.value,
|
|
279
279
|
loading: i(p).checkMenuIsLoading(),
|
|
@@ -285,7 +285,7 @@ const he = _e("takeaway-manager", () => {
|
|
|
285
285
|
"hide-footer": "",
|
|
286
286
|
"pin-header-row": "",
|
|
287
287
|
onRowClick: r[1] || (r[1] = (t) => {
|
|
288
|
-
y.value.edit && i(
|
|
288
|
+
y.value.edit && i(u).updateTakeaway(t.original);
|
|
289
289
|
})
|
|
290
290
|
}, null, 8, ["column-defs", "loading", "page-size", "row-data", "search-value"])]),
|
|
291
291
|
_: 1
|
|
@@ -299,15 +299,15 @@ const he = _e("takeaway-manager", () => {
|
|
|
299
299
|
action: "add",
|
|
300
300
|
"apply-product": "",
|
|
301
301
|
"onUpdate:takeaway": r[3] || (r[3] = (t) => i(p).updateMenu({
|
|
302
|
-
module: i(
|
|
303
|
-
operation: i(
|
|
302
|
+
module: i(z.F_MENU_MODULE_V4_KEY).enum.takeaway,
|
|
303
|
+
operation: i(N.F_OPERATION_TYPE).create,
|
|
304
304
|
data: t,
|
|
305
305
|
link: i(ee)(t.usedBy || [])
|
|
306
306
|
}, t.name))
|
|
307
307
|
}, {
|
|
308
308
|
default: P(({
|
|
309
309
|
trigger: t
|
|
310
|
-
}) => [I(
|
|
310
|
+
}) => [I(M, {
|
|
311
311
|
"prepend-icon": "add",
|
|
312
312
|
label: i(s)("menu.takeaway.empty.action"),
|
|
313
313
|
onClick: q(t, ["stop"])
|