@feedmepos/mf-menu 0.32.43 → 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-C9b4SjED.js → App-BXkiQoTM.js} +5 -5
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-C1T4Ewek.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BoSL4dm7.js} +3 -3
- package/dist/{Catalog-BVrf3VaX.js → Catalog-CLFVLyor.js} +44 -44
- package/dist/{Category-BkReM5IG.js → Category-BdyouDU8.js} +24 -24
- package/dist/{Category-BMzIQqIE.js → Category-CNuVHuI3.js} +25 -25
- package/dist/{CookingGuide-CvctI1TH.js → CookingGuide-Bed7bUt1.js} +105 -105
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-bYSEp6Wb.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CZDL2xJC.js} +1 -1
- package/dist/{Group-CHkNuuHE.js → Group-D4UTsIxI.js} +3 -3
- package/dist/{Group-BQzmXagr.js → Group-TUqCPmO3.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BkruJTpL.js → Group.vue_vue_type_script_setup_true_lang-BJPT8flL.js} +19 -19
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CBz83Qd1.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D83liryu.js} +30 -30
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Dpx4meDa.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-CRIRinHB.js} +10 -11
- package/dist/{Ingredient-BNsKYrQB.js → Ingredient-CcxoeuDd.js} +20 -20
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-DzzwwdA_.js → InventoryBinding.vue_vue_type_script_setup_true_lang-58tyxdVh.js} +2 -2
- package/dist/{LinkProductSideSheet-C6-wef-M.js → LinkProductSideSheet-DazOkwkd.js} +45 -45
- package/dist/{MenuSetting-DRaw7b6m.js → MenuSetting-B3oLll4C.js} +47 -47
- package/dist/{PrintRoute-BKB-thVp.js → PrintRoute-D878qPu8.js} +39 -39
- package/dist/{Product-vviXmBR1.js → Product-DOC8y_mW.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-5h-k6zad.js → Product.vue_vue_type_script_setup_true_lang-tZyBhWYT.js} +140 -140
- package/dist/{ProductInternalTools-DtLk3xFR.js → ProductInternalTools-9TgIc2bR.js} +66 -66
- package/dist/Products-DfUGnHmD.js +1568 -0
- package/dist/{Publish-jx0_H_26.js → Publish-BktK_PKq.js} +29 -29
- package/dist/{Recipe-Dk04ge-_.js → Recipe-eA0xrGYk.js} +24 -24
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-DaCVUn1i.js → RuleView.vue_vue_type_script_setup_true_lang-t8M7z09s.js} +2 -2
- package/dist/{Scheduler-vFTvCVcY.js → Scheduler-CKSqPZLQ.js} +11 -11
- package/dist/{ServingSequence-DiBqQ_iS.js → ServingSequence-Ea20baNj.js} +44 -44
- package/dist/{Setting-CtzJ_pVM.js → Setting-u6lX_Dzg.js} +17 -17
- package/dist/{Subcategory-Cmv2W67T.js → Subcategory-C6s7OMOb.js} +51 -51
- package/dist/{Takeaway-DBW4UPFZ.js → Takeaway-B9kr-Nf4.js} +13 -13
- package/dist/{Takeaway-ChaYk0Ix.js → Takeaway-lWxS9oWe.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-C7RL3ITP.js → Takeaway.vue_vue_type_script_setup_true_lang-oA0e9oI5.js} +54 -54
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-edwJ1203.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-BgLqPMLe.js → Unit-DkQlUg2l.js} +8 -8
- package/dist/{Variant-B8yxF5mJ.js → Variant-BF5r2WLL.js} +25 -25
- package/dist/{_id_-CDN7as0K.js → _id_-_oqk-OhC.js} +28 -28
- package/dist/app-CfCYl2pO.js +363 -0
- package/dist/{app-0AQBxO0B.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-DTIHdzDw.js → linked-status-AoXjo9FF.js} +2 -2
- package/dist/assets/{menu-export-CpcyYnR-.js → menu-export-BHcaWhM3.js} +2 -2
- package/dist/assets/{override-menu-CASoFjhZ.js → override-menu-B9xQcjuJ.js} +2 -2
- package/dist/assets/{validate-menu-C5AkexWv.js → validate-menu-D-ezd4W8.js} +2 -2
- package/dist/{catalog-BA1e4WAu.js → catalog-CvN9Wu8V.js} +1 -1
- package/dist/{catalogSetting-DE5rjVfj.js → catalogSetting-qS5Np22q.js} +1 -1
- package/dist/{currency-D5qYOpxI.js → currency-Nxod6uwl.js} +1 -1
- package/dist/dayjs.min-B1AjAGva.js +6 -0
- package/dist/index-C0Zw1cSS.js +545 -0
- package/dist/{index-vPs04fVf.js → index-Cq-czJjU.js} +31 -31
- package/dist/index-nKlYiotY.js +246 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-DSZsSghE.js → index.vue_vue_type_script_setup_true_lang-YXKayPEp.js} +103 -78
- package/dist/{item-Dp17qTYi.js → item-CUZSonzT.js} +2587 -2587
- package/dist/{jszip.min-DlpCmtaR.js → jszip.min-BnkZQ6lD.js} +6 -7
- package/dist/{menu-BOVrJ7di.js → menu-BP_ArXCI.js} +1 -1
- package/dist/{menuV2-BHnldQiM.js → menuV2-BGEYgQ8-.js} +59 -59
- package/dist/{priceTier-BRQz1GRF.js → priceTier-B-Qa0xaO.js} +1 -1
- package/dist/{rules-CO49kqfr.js → rules-Dchd_ilF.js} +12 -12
- package/dist/{scheduler-BDHjl8t7.js → scheduler-DN7ZGLk8.js} +29 -29
- package/dist/{toExcel-DGdZKSxT.js → toExcel-jHmkDqcm.js} +2 -2
- package/dist/{translation-BCZ1Ruvv.js → translation-Cdap0IVg.js} +21 -35
- package/dist/{unit-D7QVgTp_.js → unit-DgL56pkI.js} +35 -35
- package/package.json +1 -1
- package/dist/Products-BR3iBVFd.js +0 -307
- package/dist/RestaurantAttributesSelector.vue_vue_type_script_setup_true_lang-I6qrPmxY.js +0 -144
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-Cs6s_csi.js +0 -196
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DIbjlDVn.js +0 -5767
- package/dist/app-BU6wILmn.js +0 -2286
- package/dist/dayjs.min-BFDAHpA8.js +0 -7
- package/dist/index--nQbIQ0d.js +0 -545
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
import { defineComponent as I, computed as m, ref as W, resolveComponent as C, createBlock as c, openBlock as l, unref as e, withCtx as _, createElementVNode as d, toDisplayString as Z, createVNode as u, createCommentVNode as M, createElementBlock as U, Fragment as j } from "vue";
|
|
2
|
-
import { D as V } from "./dayjs.min-BFDAHpA8.js";
|
|
3
|
-
import { J as re, F as ie } from "./jszip.min-DlpCmtaR.js";
|
|
4
|
-
import { u as K, B as Q, z, D as H, y as X, A as le, G as ue, H as L, I as ce } from "./index.vue_vue_type_script_setup_true_lang-DSZsSghE.js";
|
|
5
|
-
import { w as me } from "./ImportProductDialog.vue_vue_type_script_setup_true_lang-Dpx4meDa.js";
|
|
6
|
-
import { h as F, A as O } from "./app-BU6wILmn.js";
|
|
7
|
-
import { useCoreStore as ee, useI18n as de } from "@feedmepos/mf-common";
|
|
8
|
-
import { useDialog as te, useDialogChild as pe, useSnackbar as ne, useBreakpoints as _e, FmButtonVariant as E, FmButtonColorThemeVariant as h } from "@feedmepos/ui-library";
|
|
9
|
-
import { _ as T } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
10
|
-
import { _ as fe, a as q } from "./BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js";
|
|
11
|
-
import { _ as ve } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
|
|
12
|
-
import { u as ge, a as be } from "./menu-BOVrJ7di.js";
|
|
13
|
-
import { u as ye } from "./item-Dp17qTYi.js";
|
|
14
|
-
import { _ as G, a as ke } from "./Product.vue_vue_type_script_setup_true_lang-5h-k6zad.js";
|
|
15
|
-
import { L as J } from "./LinkProductSideSheet-C6-wef-M.js";
|
|
16
|
-
import { _ as xe } from "./TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DIbjlDVn.js";
|
|
17
|
-
import { u as Se } from "./Thumbnail.vue_vue_type_script_setup_true_lang-edwJ1203.js";
|
|
18
|
-
import { m as he } from "./toExcel-DGdZKSxT.js";
|
|
19
|
-
const Me = { class: "space-y-24 mb-24" }, Ce = ["innerHTML"], we = { class: "flex justify-end gap-8" }, Fe = /* @__PURE__ */ I({
|
|
20
|
-
__name: "ConfirmActionDialog",
|
|
21
|
-
props: {
|
|
22
|
-
description: {},
|
|
23
|
-
value: {},
|
|
24
|
-
message: { default: "To confirm your action, type <b>[[value]]</b> in the text field." }
|
|
25
|
-
},
|
|
26
|
-
setup($) {
|
|
27
|
-
const n = $, y = m(() => n.message.replace("[[value]]", n.value)), x = W(""), s = te(), { emitAction: S } = pe();
|
|
28
|
-
return (f, i) => {
|
|
29
|
-
const v = C("FmTextField"), g = C("FmButton"), b = C("FmForm");
|
|
30
|
-
return l(), c(b, {
|
|
31
|
-
"on-validation-success": () => e(S)("primary"),
|
|
32
|
-
"blame-form-child-on-validation-failed": ""
|
|
33
|
-
}, {
|
|
34
|
-
default: _(() => [
|
|
35
|
-
d("div", Me, [
|
|
36
|
-
d("div", null, Z(f.description), 1),
|
|
37
|
-
d("div", { innerHTML: y.value }, null, 8, Ce),
|
|
38
|
-
d("div", null, [
|
|
39
|
-
u(v, {
|
|
40
|
-
modelValue: x.value,
|
|
41
|
-
"onUpdate:modelValue": [
|
|
42
|
-
i[0] || (i[0] = (p) => x.value = p),
|
|
43
|
-
i[1] || (i[1] = () => {
|
|
44
|
-
})
|
|
45
|
-
],
|
|
46
|
-
placeholder: f.value,
|
|
47
|
-
rules: [(p) => p === f.value || "Value does not match"]
|
|
48
|
-
}, null, 8, ["modelValue", "placeholder", "rules"])
|
|
49
|
-
]),
|
|
50
|
-
d("div", we, [
|
|
51
|
-
u(g, {
|
|
52
|
-
label: "Cancel",
|
|
53
|
-
variant: "secondary",
|
|
54
|
-
onClick: i[2] || (i[2] = (p) => e(s).close())
|
|
55
|
-
}),
|
|
56
|
-
u(g, {
|
|
57
|
-
label: "Confirm",
|
|
58
|
-
type: "submit"
|
|
59
|
-
})
|
|
60
|
-
])
|
|
61
|
-
])
|
|
62
|
-
]),
|
|
63
|
-
_: 1
|
|
64
|
-
}, 8, ["on-validation-success"]);
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
}), $e = /* @__PURE__ */ I({
|
|
68
|
-
__name: "Migrate",
|
|
69
|
-
setup($) {
|
|
70
|
-
const n = K(), y = ee(), x = ne(), { minor: s } = Q(x), S = W(!1), f = te();
|
|
71
|
-
async function i() {
|
|
72
|
-
v.value || S.value || f.open({
|
|
73
|
-
title: "Migrate to new version",
|
|
74
|
-
contentComponent: Fe,
|
|
75
|
-
contentComponentProps: {
|
|
76
|
-
value: "MIGRATE",
|
|
77
|
-
description: "Do you want to migrate to new version? Once migrate it will unable to revert to the older version."
|
|
78
|
-
}
|
|
79
|
-
}).onPrimary(async () => {
|
|
80
|
-
f.close(), await s(
|
|
81
|
-
async () => {
|
|
82
|
-
await n.migrate(), setTimeout(() => {
|
|
83
|
-
window.location.reload();
|
|
84
|
-
}, 2e3);
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
isLoading: S,
|
|
88
|
-
customId: n.state.menu._id,
|
|
89
|
-
message: "Migrating menu",
|
|
90
|
-
successMessage: "Migration completed"
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
const v = m(() => {
|
|
96
|
-
const g = y.restaurants.value;
|
|
97
|
-
if (!g.length) return "Required at least one restaurant to migrate";
|
|
98
|
-
const b = g.filter((k) => !k.posVersion || !z.Pos.canUse({ feature: H.F_FEATURE.enum.menuV4, posVersion: k.posVersion }));
|
|
99
|
-
return b.length ? `Upgrade POS to V${z.Pos.minVersionToUse(H.F_FEATURE.enum.menuV4)} to use new menu: ${b.map((k) => k.profile.name).join(", ")}` : null;
|
|
100
|
-
});
|
|
101
|
-
return m(() => v.value ? v.value : "Migrate your menu to new version to enjoy more features. Content of new menu will remain the same as current."), (g, b) => {
|
|
102
|
-
const p = C("FmSnackbar");
|
|
103
|
-
return !v.value && e(n).version !== e(X.F_MENU_VERSION).enum.v4 ? (l(), c(p, {
|
|
104
|
-
key: 0,
|
|
105
|
-
class: "!max-w-full",
|
|
106
|
-
title: "New version of menu is out now!",
|
|
107
|
-
description: "Migrate your current menu version to the latest to enjoy more features such as product sequential dispatch, serving sequence, scheduler and more! Your content and current setting will be preserved.",
|
|
108
|
-
variant: "info",
|
|
109
|
-
action: "Migrate",
|
|
110
|
-
"z-index": 0,
|
|
111
|
-
onOnAction: i
|
|
112
|
-
})) : M("", !0);
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
}), Ve = "/assets/menu-export-CpcyYnR-.js", Ee = { class: "flex-1 flex justify-between gap-8 pl-8" }, Te = { class: "flex items-center" }, Ie = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, Ae = { class: "fm-typo-en-body-md-600 font-semibold" }, De = { class: "flex gap-8" }, Xe = /* @__PURE__ */ I({
|
|
116
|
-
__name: "Products",
|
|
117
|
-
setup($) {
|
|
118
|
-
const { t: n } = de(), y = ee(), x = Q(ne()), s = K(), S = m(() => s.rules.item), f = ye(), i = m(() => !s.state.currentSchedulerId), { selectedCategories: v } = ge(), g = m(() => ({
|
|
119
|
-
...le.menuV4ToV3(ue(s.state.menu)),
|
|
120
|
-
_id: s.state.menu._id,
|
|
121
|
-
_rev: s.state.menu._rev
|
|
122
|
-
})), b = m(() => {
|
|
123
|
-
const r = L.flatten(v.value.map((t) => t.items));
|
|
124
|
-
return L.uniqBy(r, (t) => t._id).length;
|
|
125
|
-
});
|
|
126
|
-
async function p(r, t) {
|
|
127
|
-
const o = new re();
|
|
128
|
-
for (let w = 0; w < r.length; w++)
|
|
129
|
-
o.file(`${t[w]}.xlsx`, r[w]);
|
|
130
|
-
const a = await o.generateAsync({ type: "blob" });
|
|
131
|
-
ie.saveAs(a, `books_${V().format("DD-MM-YYYY_HH-mm")}.zip`);
|
|
132
|
-
}
|
|
133
|
-
async function k() {
|
|
134
|
-
await x.minor(
|
|
135
|
-
async () => {
|
|
136
|
-
if (await s.readMenu(), s.version === X.F_MENU_VERSION.enum.v4) {
|
|
137
|
-
const r = s.state.menu, t = V().format("DD-MM-YYYY_HH-mm"), o = [
|
|
138
|
-
`menu_${t}`,
|
|
139
|
-
`addonGroup_${t}`,
|
|
140
|
-
`itemLinkedAddon_${t}`
|
|
141
|
-
], a = await ce(
|
|
142
|
-
Ve,
|
|
143
|
-
JSON.stringify({
|
|
144
|
-
menu: r,
|
|
145
|
-
attributeSettings: y.itemAttributeSettings.value
|
|
146
|
-
})
|
|
147
|
-
);
|
|
148
|
-
await p(a, o);
|
|
149
|
-
} else {
|
|
150
|
-
const r = he(g.value), t = `menu_${V().format("DD-MM-YYYY_HH-mm")}`;
|
|
151
|
-
await me(r, `${t}.xlsx`, {
|
|
152
|
-
bookType: "xlsx",
|
|
153
|
-
bookSST: !0,
|
|
154
|
-
type: "array",
|
|
155
|
-
compression: !0
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
{ successMessage: "Menu exported", customId: s.state.menu._id }
|
|
160
|
-
);
|
|
161
|
-
}
|
|
162
|
-
const {
|
|
163
|
-
menuItems: A,
|
|
164
|
-
categories: D,
|
|
165
|
-
linkItemRules: B,
|
|
166
|
-
handleSubmit: N,
|
|
167
|
-
catalogManager: Y,
|
|
168
|
-
schedulerManager: P
|
|
169
|
-
} = Se(!1), oe = _e(), ae = m(() => oe.breakpoints.value.xs), se = m(() => {
|
|
170
|
-
var o;
|
|
171
|
-
const r = ((o = y.sessionUser.value) == null ? void 0 : o.permissions) ?? [], t = {
|
|
172
|
-
action: F.Action.manage,
|
|
173
|
-
subject: F.Subject.Business.menu_menuManagement
|
|
174
|
-
};
|
|
175
|
-
return O([t], r).granted;
|
|
176
|
-
}), R = m(() => {
|
|
177
|
-
var o;
|
|
178
|
-
const r = ((o = y.sessionUser.value) == null ? void 0 : o.permissions) ?? [], t = {
|
|
179
|
-
action: F.Action.manage,
|
|
180
|
-
subject: F.Subject.Business.menu_importExport
|
|
181
|
-
};
|
|
182
|
-
return O([t], r).granted;
|
|
183
|
-
});
|
|
184
|
-
return be().resetOnMount(), (r, t) => {
|
|
185
|
-
const o = C("fm-button");
|
|
186
|
-
return l(), c(ve, {
|
|
187
|
-
heading: e(n)("menu.products.title")
|
|
188
|
-
}, {
|
|
189
|
-
default: _(() => [
|
|
190
|
-
u($e),
|
|
191
|
-
u(ke)
|
|
192
|
-
]),
|
|
193
|
-
"append-heading": _(() => [
|
|
194
|
-
d("div", Ee, [
|
|
195
|
-
d("div", Te, [
|
|
196
|
-
d("div", Ie, [
|
|
197
|
-
d("p", Ae, Z(b.value), 1)
|
|
198
|
-
])
|
|
199
|
-
]),
|
|
200
|
-
d("div", De, [
|
|
201
|
-
ae.value ? (l(), c(G, { key: 1 }, {
|
|
202
|
-
default: _(({ trigger: a }) => [
|
|
203
|
-
u(fe, null, {
|
|
204
|
-
default: _(() => [
|
|
205
|
-
u(q, {
|
|
206
|
-
label: e(n)("menu.products.actions.export"),
|
|
207
|
-
onClick: k
|
|
208
|
-
}, null, 8, ["label"]),
|
|
209
|
-
u(q, {
|
|
210
|
-
label: e(n)("menu.products.actions.import"),
|
|
211
|
-
onClick: a
|
|
212
|
-
}, null, 8, ["label", "onClick"])
|
|
213
|
-
]),
|
|
214
|
-
_: 2
|
|
215
|
-
}, 1024)
|
|
216
|
-
]),
|
|
217
|
-
_: 1
|
|
218
|
-
})) : (l(), U(j, { key: 0 }, [
|
|
219
|
-
se.value ? (l(), c(xe, { key: 0 }, {
|
|
220
|
-
default: _(({ trigger: a }) => [
|
|
221
|
-
u(o, {
|
|
222
|
-
label: e(n)("menu.tree_editor.title"),
|
|
223
|
-
"bg-color": e(h).NeutralGray100,
|
|
224
|
-
"text-color": e(h).TypoSecondary,
|
|
225
|
-
variant: e(E).Primary,
|
|
226
|
-
onClick: a
|
|
227
|
-
}, null, 8, ["label", "bg-color", "text-color", "variant", "onClick"])
|
|
228
|
-
]),
|
|
229
|
-
_: 1
|
|
230
|
-
})) : M("", !0),
|
|
231
|
-
R.value ? (l(), c(o, {
|
|
232
|
-
key: 1,
|
|
233
|
-
"bg-color": e(h).NeutralGray100,
|
|
234
|
-
"text-color": e(h).TypoSecondary,
|
|
235
|
-
variant: e(E).Primary,
|
|
236
|
-
label: e(n)("menu.products.actions.export"),
|
|
237
|
-
onClick: k
|
|
238
|
-
}, null, 8, ["bg-color", "text-color", "variant", "label"])) : M("", !0),
|
|
239
|
-
R.value ? (l(), c(G, { key: 2 }, {
|
|
240
|
-
default: _(({ trigger: a }) => [
|
|
241
|
-
u(o, {
|
|
242
|
-
"bg-color": e(h).NeutralGray100,
|
|
243
|
-
"text-color": e(h).TypoSecondary,
|
|
244
|
-
variant: e(E).Primary,
|
|
245
|
-
label: e(n)("menu.products.actions.import"),
|
|
246
|
-
onClick: a
|
|
247
|
-
}, null, 8, ["bg-color", "text-color", "variant", "label", "onClick"])
|
|
248
|
-
]),
|
|
249
|
-
_: 1
|
|
250
|
-
})) : M("", !0)
|
|
251
|
-
], 64)),
|
|
252
|
-
b.value > 0 ? (l(), U(j, { key: 2 }, [
|
|
253
|
-
S.value.create ? (l(), c(T, {
|
|
254
|
-
key: 0,
|
|
255
|
-
label: e(n)("menu.products.actions.add"),
|
|
256
|
-
"prepend-icon": "add",
|
|
257
|
-
onClick: t[0] || (t[0] = (a) => e(f).create(null))
|
|
258
|
-
}, null, 8, ["label"])) : i.value ? (l(), c(J, {
|
|
259
|
-
key: 1,
|
|
260
|
-
"categorized-items": e(Y).linkableItems.value,
|
|
261
|
-
"initial-value": e(Y).currentItems.value,
|
|
262
|
-
"show-variant": !1,
|
|
263
|
-
"menu-items": e(A),
|
|
264
|
-
categories: e(D),
|
|
265
|
-
"link-item-rules": e(B),
|
|
266
|
-
"no-scheduler": i.value,
|
|
267
|
-
onSubmit: e(N)
|
|
268
|
-
}, {
|
|
269
|
-
default: _(({ trigger: a }) => [
|
|
270
|
-
u(T, {
|
|
271
|
-
label: e(n)("menu.products.actions.link"),
|
|
272
|
-
"prepend-icon": "link",
|
|
273
|
-
onClick: a
|
|
274
|
-
}, null, 8, ["label", "onClick"])
|
|
275
|
-
]),
|
|
276
|
-
_: 1
|
|
277
|
-
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"])) : (l(), c(J, {
|
|
278
|
-
key: 2,
|
|
279
|
-
"categorized-items": e(P).linkableItems.value,
|
|
280
|
-
"initial-value": e(P).currentItems.value,
|
|
281
|
-
"show-variant": !1,
|
|
282
|
-
"menu-items": e(A),
|
|
283
|
-
categories: e(D),
|
|
284
|
-
"link-item-rules": e(B),
|
|
285
|
-
"no-scheduler": i.value,
|
|
286
|
-
onSubmit: e(N)
|
|
287
|
-
}, {
|
|
288
|
-
default: _(({ trigger: a }) => [
|
|
289
|
-
u(T, {
|
|
290
|
-
label: e(n)("menu.products.actions.apply_scheduler"),
|
|
291
|
-
onClick: a
|
|
292
|
-
}, null, 8, ["label", "onClick"])
|
|
293
|
-
]),
|
|
294
|
-
_: 1
|
|
295
|
-
}, 8, ["categorized-items", "initial-value", "menu-items", "categories", "link-item-rules", "no-scheduler", "onSubmit"]))
|
|
296
|
-
], 64)) : M("", !0)
|
|
297
|
-
])
|
|
298
|
-
])
|
|
299
|
-
]),
|
|
300
|
-
_: 1
|
|
301
|
-
}, 8, ["heading"]);
|
|
302
|
-
};
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
export {
|
|
306
|
-
Xe as default
|
|
307
|
-
};
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import { defineComponent as D, ref as R, resolveComponent as u, createElementBlock as E, openBlock as P, Fragment as B, createElementVNode as f, createVNode as l, normalizeClass as A, withCtx as i, toDisplayString as g, unref as o, h as I } from "vue";
|
|
2
|
-
import { useI18n as T, useCustomAttributes as K, useCoreStore as N } from "@feedmepos/mf-common";
|
|
3
|
-
import { components as U } from "@feedmepos/ui-library";
|
|
4
|
-
import { d as W, _ as y } from "./RuleView.vue_vue_type_script_setup_true_lang-DaCVUn1i.js";
|
|
5
|
-
const j = {
|
|
6
|
-
class: /* @__PURE__ */ A(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap", "text-fm-color-neutral-gray-400"])
|
|
7
|
-
}, O = {
|
|
8
|
-
class: "fm-typo-en-title-sm-600"
|
|
9
|
-
}, $ = {
|
|
10
|
-
class: "max-h-[60vh] flex-1 overflow-y-auto min-h-0"
|
|
11
|
-
}, L = /* @__PURE__ */ D({
|
|
12
|
-
__name: "RestaurantAttributesSelector",
|
|
13
|
-
props: {
|
|
14
|
-
fullWidth: {
|
|
15
|
-
type: Boolean,
|
|
16
|
-
default: !1
|
|
17
|
-
},
|
|
18
|
-
currentRestaurantAttrParams: {}
|
|
19
|
-
},
|
|
20
|
-
emits: ["confirm"],
|
|
21
|
-
setup(C, {
|
|
22
|
-
emit: w
|
|
23
|
-
}) {
|
|
24
|
-
const p = C, {
|
|
25
|
-
t: r
|
|
26
|
-
} = T(), {
|
|
27
|
-
attributes: c
|
|
28
|
-
} = K({
|
|
29
|
-
valueSource: N().restaurants,
|
|
30
|
-
entity: "restaurant"
|
|
31
|
-
}), {
|
|
32
|
-
restaurantAttributes: m
|
|
33
|
-
} = W(), _ = [{
|
|
34
|
-
header: () => r("portalshell.customAttributes.form.key"),
|
|
35
|
-
accessorKey: "key",
|
|
36
|
-
enableSorting: !1
|
|
37
|
-
}, {
|
|
38
|
-
header: () => r("portalshell.customAttributes.form.value"),
|
|
39
|
-
accessorKey: "values",
|
|
40
|
-
enableSorting: !1,
|
|
41
|
-
cell: (s) => {
|
|
42
|
-
const e = s.row.original, a = e.values;
|
|
43
|
-
return I(U.FmSelect, {
|
|
44
|
-
modelValue: e.value,
|
|
45
|
-
placeholder: r("portalshell.customAttributes.form.valuePlaceholder"),
|
|
46
|
-
items: a.map((t) => ({
|
|
47
|
-
label: t,
|
|
48
|
-
value: t
|
|
49
|
-
})),
|
|
50
|
-
clearable: !0,
|
|
51
|
-
searchable: !0,
|
|
52
|
-
"onUpdate:modelValue": (t) => e.value = t
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}], k = w;
|
|
56
|
-
function b(s) {
|
|
57
|
-
return s.reduce((e, a) => (a.value != null && (e[a.key] = a.value), e), {});
|
|
58
|
-
}
|
|
59
|
-
const F = () => {
|
|
60
|
-
const s = c.value.filter((t) => t.value != null), e = m.value.filter((t) => t.value != null), a = {
|
|
61
|
-
restaurantCustomAttributes: b(s),
|
|
62
|
-
restaurantAttributes: b(e)
|
|
63
|
-
};
|
|
64
|
-
k("confirm", a), h();
|
|
65
|
-
}, d = R(!1);
|
|
66
|
-
function S() {
|
|
67
|
-
var a, t;
|
|
68
|
-
d.value = !0;
|
|
69
|
-
const s = ((a = p.currentRestaurantAttrParams) == null ? void 0 : a.restaurantCustomAttributes) ?? {};
|
|
70
|
-
c.value.forEach((n) => {
|
|
71
|
-
n.value = s[n.key] ?? void 0;
|
|
72
|
-
});
|
|
73
|
-
const e = ((t = p.currentRestaurantAttrParams) == null ? void 0 : t.restaurantAttributes) ?? {};
|
|
74
|
-
m.value.forEach((n) => {
|
|
75
|
-
n.value = e[n.key] ?? void 0;
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
function h() {
|
|
79
|
-
d.value = !1;
|
|
80
|
-
}
|
|
81
|
-
return (s, e) => {
|
|
82
|
-
const a = u("FmIcon"), t = u("FmChip"), n = u("FmTable"), x = u("FmSpacer"), v = u("fm-button"), z = u("FmDialog");
|
|
83
|
-
return P(), E(B, null, [f("div", {
|
|
84
|
-
class: "cursor-pointer",
|
|
85
|
-
onClick: S
|
|
86
|
-
}, [l(t, {
|
|
87
|
-
class: A([s.fullWidth ? "w-full justify-between" : ""])
|
|
88
|
-
}, {
|
|
89
|
-
default: i(() => [f("div", j, g(o(r)("menu.catalog.form.restaurant_attributes_title")), 1), l(a, {
|
|
90
|
-
color: "neutral-gray-400",
|
|
91
|
-
name: "launch",
|
|
92
|
-
size: "sm"
|
|
93
|
-
})]),
|
|
94
|
-
_: 1
|
|
95
|
-
}, 8, ["class"])]), l(z, {
|
|
96
|
-
modelValue: d.value,
|
|
97
|
-
"onUpdate:modelValue": e[0] || (e[0] = (V) => d.value = V),
|
|
98
|
-
overlay: !0,
|
|
99
|
-
"min-width": "min(calc(100% - 48px), 560px)"
|
|
100
|
-
}, {
|
|
101
|
-
"dialog-header": i(() => [f("div", O, g(o(r)("menu.catalog.form.restaurant_attributes_title")), 1)]),
|
|
102
|
-
"dialog-footer": i(() => [l(x), l(v, {
|
|
103
|
-
label: o(r)("menu.common.actions.confirm"),
|
|
104
|
-
size: "lg",
|
|
105
|
-
type: "submit",
|
|
106
|
-
variant: "primary",
|
|
107
|
-
onClick: F
|
|
108
|
-
}, null, 8, ["label"]), l(v, {
|
|
109
|
-
label: o(r)("menu.common.actions.cancel"),
|
|
110
|
-
size: "lg",
|
|
111
|
-
variant: "tertiary",
|
|
112
|
-
onClick: h
|
|
113
|
-
}, null, 8, ["label"])]),
|
|
114
|
-
default: i(() => [f("div", $, [l(y, {
|
|
115
|
-
title: o(r)("menu.link_product.rules.restaurant_custom_attributes_filter")
|
|
116
|
-
}, {
|
|
117
|
-
default: i(() => [l(n, {
|
|
118
|
-
"column-defs": _,
|
|
119
|
-
"row-data": o(c),
|
|
120
|
-
"shrink-at": !1,
|
|
121
|
-
"page-size": o(c).length,
|
|
122
|
-
"hide-footer": ""
|
|
123
|
-
}, null, 8, ["row-data", "page-size"])]),
|
|
124
|
-
_: 1
|
|
125
|
-
}, 8, ["title"]), l(y, {
|
|
126
|
-
title: o(r)("menu.link_product.rules.restaurant_filter")
|
|
127
|
-
}, {
|
|
128
|
-
default: i(() => [l(n, {
|
|
129
|
-
"column-defs": _,
|
|
130
|
-
"row-data": o(m),
|
|
131
|
-
"shrink-at": !1,
|
|
132
|
-
"page-size": o(m).length,
|
|
133
|
-
"hide-footer": ""
|
|
134
|
-
}, null, 8, ["row-data", "page-size"])]),
|
|
135
|
-
_: 1
|
|
136
|
-
}, 8, ["title"])])]),
|
|
137
|
-
_: 1
|
|
138
|
-
}, 8, ["modelValue"])], 64);
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
export {
|
|
143
|
-
L as _
|
|
144
|
-
};
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
import { defineComponent as J, ref as h, watch as O, computed as j, resolveComponent as _, createBlock as T, openBlock as d, unref as a, withCtx as v, createElementVNode as t, toDisplayString as m, createElementBlock as p, createCommentVNode as F, Fragment as x, renderList as C, createVNode as r } from "vue";
|
|
2
|
-
import { H as I } from "./index.vue_vue_type_script_setup_true_lang-DSZsSghE.js";
|
|
3
|
-
import { useI18n as K, ALL_LOCALE_OPTIONS as y } from "@feedmepos/mf-common";
|
|
4
|
-
import { u as Q } from "./discardConfirm-BHni0LNu.js";
|
|
5
|
-
import { g as V, a as S, _ as R, b as W } from "./translation-BCZ1Ruvv.js";
|
|
6
|
-
const X = { class: "fm-typo-en-title-md-600" }, Y = { class: "pt-8 space-y-24" }, Z = { class: "flex flex-col gap-8" }, ee = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, oe = { class: "flex items-center gap-8 flex-wrap" }, le = { class: "w-24 h-24 rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600" }, te = { class: "fm-typo-en-body-md-600" }, ae = ["onClick"], ne = { class: "flex items-center gap-8" }, se = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, ce = { class: "fm-typo-en-body-md-400" }, me = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, de = { class: "flex items-center gap-16" }, ie = { class: "fm-typo-en-body-lg-600" }, re = { class: "flex flex-col gap-32 pl-32" }, ue = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "space-y-8"
|
|
9
|
-
}, pe = { class: "flex w-[100px] items-center gap-8" }, fe = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, _e = { class: "fm-typo-en-body-md-400" }, ve = { class: "flex-1" }, he = { class: "flex gap-8 items-center justify-start" }, Ve = /* @__PURE__ */ J({
|
|
10
|
-
__name: "TranslationSideSheet",
|
|
11
|
-
props: {
|
|
12
|
-
modelValue: { type: Boolean },
|
|
13
|
-
title: {},
|
|
14
|
-
name: {},
|
|
15
|
-
nameLocale: {}
|
|
16
|
-
},
|
|
17
|
-
emits: ["update:modelValue", "update:name", "update:nameLocale"],
|
|
18
|
-
setup(A, { emit: B }) {
|
|
19
|
-
const s = A, f = B, { t: i } = K(), c = h([]), k = h([]), u = h(s.name), L = h(s.name);
|
|
20
|
-
O(
|
|
21
|
-
() => s.name,
|
|
22
|
-
(e) => {
|
|
23
|
-
u.value = e;
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
function D() {
|
|
27
|
-
return !s.nameLocale || Object.keys(s.nameLocale).length === 0 ? [] : Object.entries(s.nameLocale).map(([e, o]) => ({
|
|
28
|
-
localeCode: e,
|
|
29
|
-
value: o
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
O(
|
|
33
|
-
() => [s.modelValue, s.nameLocale],
|
|
34
|
-
([e]) => {
|
|
35
|
-
e && (c.value = D(), k.value = I.clone(c.value), u.value = s.name, L.value = s.name);
|
|
36
|
-
},
|
|
37
|
-
{ immediate: !0 }
|
|
38
|
-
);
|
|
39
|
-
const w = j(() => {
|
|
40
|
-
const e = new Set(c.value.map((n) => n.localeCode));
|
|
41
|
-
return y.filter((n) => !e.has(n.code)).map(
|
|
42
|
-
(n) => ({
|
|
43
|
-
code: n.code,
|
|
44
|
-
name: n.name,
|
|
45
|
-
icon: V(n.code)
|
|
46
|
-
})
|
|
47
|
-
);
|
|
48
|
-
});
|
|
49
|
-
function U(e) {
|
|
50
|
-
const o = y.find((n) => n.code === e);
|
|
51
|
-
o && c.value.push({
|
|
52
|
-
localeCode: o.code,
|
|
53
|
-
value: ""
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
function $(e) {
|
|
57
|
-
c.value = c.value.filter((o) => o.localeCode !== e);
|
|
58
|
-
}
|
|
59
|
-
function z() {
|
|
60
|
-
const e = u.value !== L.value, o = !I.isEqual(c.value, k.value);
|
|
61
|
-
return e || o;
|
|
62
|
-
}
|
|
63
|
-
function M() {
|
|
64
|
-
u.value !== s.name && f("update:name", u.value);
|
|
65
|
-
const e = c.value.filter((o) => o.value.trim());
|
|
66
|
-
if (e.length === 0)
|
|
67
|
-
f("update:nameLocale", void 0);
|
|
68
|
-
else {
|
|
69
|
-
const o = {};
|
|
70
|
-
e.forEach((n) => {
|
|
71
|
-
o[n.localeCode] = n.value.trim();
|
|
72
|
-
}), f("update:nameLocale", o);
|
|
73
|
-
}
|
|
74
|
-
f("update:modelValue", !1);
|
|
75
|
-
}
|
|
76
|
-
function q() {
|
|
77
|
-
f("update:modelValue", !1);
|
|
78
|
-
}
|
|
79
|
-
const N = Q(z, q), E = j({
|
|
80
|
-
get: () => s.modelValue,
|
|
81
|
-
set: (e) => f("update:modelValue", e)
|
|
82
|
-
});
|
|
83
|
-
return (e, o) => {
|
|
84
|
-
const n = _("FmIcon"), g = _("fm-button"), H = _("FmMenu"), P = _("fm-text-field"), G = _("fm-side-sheet");
|
|
85
|
-
return d(), T(G, {
|
|
86
|
-
modelValue: E.value,
|
|
87
|
-
"onUpdate:modelValue": o[1] || (o[1] = (l) => E.value = l),
|
|
88
|
-
"max-width": 720,
|
|
89
|
-
"onOn:clickedAway": a(N)
|
|
90
|
-
}, {
|
|
91
|
-
"side-sheet-header": v(() => [
|
|
92
|
-
t("p", X, m(e.title) + " " + m(a(i)("menu.common.translation.title_suffix")), 1)
|
|
93
|
-
]),
|
|
94
|
-
"side-sheet-footer": v(() => [
|
|
95
|
-
t("div", he, [
|
|
96
|
-
r(g, {
|
|
97
|
-
label: a(i)("common.save"),
|
|
98
|
-
size: "lg",
|
|
99
|
-
variant: "primary",
|
|
100
|
-
onClick: M
|
|
101
|
-
}, null, 8, ["label"]),
|
|
102
|
-
r(g, {
|
|
103
|
-
label: a(i)("common.cancel"),
|
|
104
|
-
size: "lg",
|
|
105
|
-
variant: "tertiary",
|
|
106
|
-
onClick: a(N)
|
|
107
|
-
}, null, 8, ["label", "onClick"])
|
|
108
|
-
])
|
|
109
|
-
]),
|
|
110
|
-
default: v(() => [
|
|
111
|
-
t("div", Y, [
|
|
112
|
-
t("div", Z, [
|
|
113
|
-
t("p", ee, m(a(i)("menu.common.translation.language")), 1),
|
|
114
|
-
t("div", oe, [
|
|
115
|
-
(d(!0), p(x, null, C(c.value, (l) => (d(), p("div", {
|
|
116
|
-
key: l.localeCode,
|
|
117
|
-
class: "flex items-center gap-8 p-8 border border-fm-color-primary text-fm-color-primary rounded-full"
|
|
118
|
-
}, [
|
|
119
|
-
t("div", le, m(a(V)(l.localeCode)), 1),
|
|
120
|
-
t("span", te, m(a(S)(l.localeCode, a(y))), 1),
|
|
121
|
-
r(n, {
|
|
122
|
-
name: "close",
|
|
123
|
-
class: "cursor-pointer",
|
|
124
|
-
variant: "secondary",
|
|
125
|
-
onClick: (b) => $(l.localeCode)
|
|
126
|
-
}, null, 8, ["onClick"])
|
|
127
|
-
]))), 128)),
|
|
128
|
-
w.value.length > 0 ? (d(), T(H, { key: 0 }, {
|
|
129
|
-
"menu-button": v(() => [
|
|
130
|
-
r(g, {
|
|
131
|
-
variant: "secondary",
|
|
132
|
-
"border-color": "neutral-gray-300",
|
|
133
|
-
"text-color": "neutral-gray-400",
|
|
134
|
-
icon: "add"
|
|
135
|
-
})
|
|
136
|
-
]),
|
|
137
|
-
default: v(() => [
|
|
138
|
-
(d(!0), p(x, null, C(w.value, (l) => (d(), p("div", {
|
|
139
|
-
class: "p-12 cursor-pointer hover:bg-fm-color-opacity-md rounded-sm",
|
|
140
|
-
key: l.code,
|
|
141
|
-
onClick: (b) => U(l.code)
|
|
142
|
-
}, [
|
|
143
|
-
t("div", ne, [
|
|
144
|
-
t("div", se, m(l.icon), 1),
|
|
145
|
-
t("span", ce, m(l.name), 1)
|
|
146
|
-
])
|
|
147
|
-
], 8, ae))), 128))
|
|
148
|
-
]),
|
|
149
|
-
_: 1
|
|
150
|
-
})) : F("", !0)
|
|
151
|
-
])
|
|
152
|
-
]),
|
|
153
|
-
t("div", me, [
|
|
154
|
-
t("div", de, [
|
|
155
|
-
r(n, { name: "keyboard_arrow_down" }),
|
|
156
|
-
t("p", ie, m(a(i)("menu.common.translation.name_section", { entity: e.title })), 1)
|
|
157
|
-
]),
|
|
158
|
-
t("div", re, [
|
|
159
|
-
r(R, {
|
|
160
|
-
label: a(i)("menu.common.translation.default"),
|
|
161
|
-
modelValue: u.value,
|
|
162
|
-
"onUpdate:modelValue": o[0] || (o[0] = (l) => u.value = l)
|
|
163
|
-
}, null, 8, ["label", "modelValue"]),
|
|
164
|
-
c.value.length > 0 ? (d(), p("div", ue, [
|
|
165
|
-
r(W, {
|
|
166
|
-
label: a(i)("menu.common.translation.translation_label")
|
|
167
|
-
}, null, 8, ["label"]),
|
|
168
|
-
(d(!0), p(x, null, C(c.value, (l) => (d(), p("div", {
|
|
169
|
-
key: l.localeCode,
|
|
170
|
-
class: "flex items-center gap-16"
|
|
171
|
-
}, [
|
|
172
|
-
t("div", pe, [
|
|
173
|
-
t("div", fe, m(a(V)(l.localeCode)), 1),
|
|
174
|
-
t("span", _e, m(a(S)(l.localeCode, a(y))), 1)
|
|
175
|
-
]),
|
|
176
|
-
t("div", ve, [
|
|
177
|
-
r(P, {
|
|
178
|
-
modelValue: l.value,
|
|
179
|
-
"onUpdate:modelValue": (b) => l.value = b,
|
|
180
|
-
placeholder: a(i)("menu.group.translation.placeholder")
|
|
181
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
182
|
-
])
|
|
183
|
-
]))), 128))
|
|
184
|
-
])) : F("", !0)
|
|
185
|
-
])
|
|
186
|
-
])
|
|
187
|
-
])
|
|
188
|
-
]),
|
|
189
|
-
_: 1
|
|
190
|
-
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
export {
|
|
195
|
-
Ve as _
|
|
196
|
-
};
|