@feedmepos/mf-menu 1.0.0 → 1.0.1-dev.2
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-Dx2igC7a.js → App-CdIN4s5n.js} +5 -4
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BFZokcY6.js → ApplyProduct.vue_vue_type_script_setup_true_lang-C9OSr8ft.js} +1 -1
- package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-Cqo6_VtR.js → BindingTable.vue_vue_type_script_setup_true_lang-CoHlJwpz.js} +1 -1
- package/dist/{Catalog-B-RloKQ4.js → Catalog-DjAubC9s.js} +4 -4
- package/dist/{CatalogBinding-CgIYwGGu.js → CatalogBinding-5JNRTbyZ.js} +3 -3
- package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-DKHW_Iqx.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-BorOjk1k.js} +3 -3
- package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-BJXpYF1Z.js → CatalogEditor.vue_vue_type_script_setup_true_lang-CkF7O_V-.js} +7 -7
- package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-Oo24DDWy.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-3fL43MuR.js} +3 -3
- package/dist/{Category-Buu8cQY6.js → Category-BbiN4hd7.js} +5 -5
- package/dist/{Category-Bk6LDBUg.js → Category-COug7fz8.js} +2 -2
- package/dist/{CategoryList.vue_vue_type_script_setup_true_lang-BF6z8ULI.js → CategoryList.vue_vue_type_script_setup_true_lang-B_9aPMIN.js} +5 -5
- package/dist/{CookingGuide-Cf029w_4.js → CookingGuide-Dg7kuF6l.js} +82 -82
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-pY-_msnM.js +1774 -0
- package/dist/{Group-tqaxMELg.js → Group-BRpmTqyT.js} +5 -5
- package/dist/{Group-DEcK54PQ.js → Group-C-hwlkgJ.js} +2 -2
- package/dist/{GroupList.vue_vue_type_script_setup_true_lang-BROG27Yx.js → GroupList.vue_vue_type_script_setup_true_lang-DowoJ3WM.js} +7 -7
- package/dist/{Ingredient-DB25SQ_o.js → Ingredient-BQYnARdC.js} +3 -3
- package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CgTDkHle.js +707 -0
- package/dist/{MenuSetting-DUYQvadY.js → MenuSetting-DsdM2_OW.js} +546 -513
- package/dist/{OrderPacing-CjUkaRbu.js → OrderPacing-5x2YH-_l.js} +6 -6
- package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-DJXhbkeG.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-DVGJjpiM.js} +2 -2
- package/dist/Preview-AdgGTYlQ.js +321 -0
- package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-gfsuBoHt.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-vmxVZ2ya.js} +1 -1
- package/dist/{PrintRoute-CysE-4tE.js → PrintRoute-COkCv4gf.js} +4 -4
- package/dist/{Product-iVtmB1C8.js → Product-BJFb_J4h.js} +4 -4
- package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang-B7eUmZuN.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-Tpp8MBYS.js} +2 -2
- package/dist/{ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-b8DaMgRx.js → ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-C25Pwqme.js} +4 -4
- package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-B5vq5hbc.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-BMAtAK9D.js} +1 -1
- package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-C1ghNMTf.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-Dl4Zr5tx.js} +11 -11
- package/dist/{ProductInternalTools-BQDxL6qv.js → ProductInternalTools-thlSvqbA.js} +2 -2
- package/dist/{ProductInventoryDialog-W1F98eXc.js → ProductInventoryDialog-C3ruRWU5.js} +1 -1
- package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-Cp4ZIcMK.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-MpdIixqI.js} +1 -1
- package/dist/{ProductList.vue_vue_type_script_setup_true_lang-B1N4e-Kd.js → ProductList.vue_vue_type_script_setup_true_lang-9_ohgfqE.js} +9 -9
- package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-DengE8Aj.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Ctbz-8cd.js} +1 -1
- package/dist/{Products-C9O4viX6.js → Products-DMrjQFfu.js} +3 -3
- package/dist/{Publish-B2-c2SAA.js → Publish-f6g0dIao.js} +3 -3
- package/dist/{Recipe-CU9raTsa.js → Recipe-p-wxadSN.js} +3 -3
- package/dist/{Scheduler-BE0dziMd.js → Scheduler-CtebRafn.js} +4 -4
- package/dist/{ServingSequence-Bd99-lK0.js → ServingSequence-CEd4ywOQ.js} +2 -2
- package/dist/{Setting-CEPdYW3h.js → Setting-bPKadRu-.js} +6 -6
- package/dist/{Subcategory-BdcLXhuv.js → Subcategory-DBCnIP0b.js} +2 -2
- package/dist/{Takeaway-CmEdi9LZ.js → Takeaway-GNRHR5kN.js} +2 -2
- package/dist/{Takeaway-DbAA4-wL.js → Takeaway-VBkdW1DM.js} +5 -5
- package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-b2AoUuPc.js → TakeawayList.vue_vue_type_script_setup_true_lang-DvX3k0Jg.js} +4 -4
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-ByHzS1zz.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D1qaEVUu.js} +7 -7
- package/dist/{Unit-Di23l3Rf.js → Unit-DbGKIprZ.js} +2 -2
- package/dist/{Variant-CrMulK0_.js → Variant-_edSAKif.js} +19 -19
- package/dist/{_id_-B-xHjH3V.js → _id_-BNVtBV3q.js} +3 -3
- package/dist/{app-BiteOZSg.js → app-BlTv5xag.js} +153 -150
- package/dist/app.js +2 -2
- package/dist/apps/mf-menu/src/app.d.ts +360 -0
- package/dist/apps/mf-menu/src/components/preview/MenuPreview.vue.d.ts +13 -0
- package/dist/apps/mf-menu/src/components/preview/simulatorPort.d.ts +23 -0
- package/dist/apps/mf-menu/src/router/shared.d.ts +1 -0
- package/dist/apps/mf-menu/src/utils/ruleValueKey.d.ts +12 -0
- package/dist/apps/mf-menu/src/views/Preview/Preview.vue.d.ts +2 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{menu-compute-Cf88Yt0l.js → menu-compute-BzchkTYh.js} +36 -36
- package/dist/assets/{validate-menu-DEpbyLnq.js → validate-menu-CTV_cJNG.js} +4 -4
- package/dist/{provide-DHcnZPMQ.js → provide-dbE6Qt1z.js} +35458 -34831
- package/dist/ruleValueKey-BF52PuHb.js +10 -0
- package/dist/{useActionFeedback-B8L3Gpei.js → useActionFeedback-CdY_C_HX.js} +1 -1
- package/package.json +1 -1
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-DMTby3OA.js +0 -4473
- package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-BAp_X51e.js +0 -671
|
@@ -1,671 +0,0 @@
|
|
|
1
|
-
import { defineComponent as Ve, ref as L, computed as h, watch as oe, resolveComponent as w, openBlock as m, createBlock as V, unref as n, withCtx as y, createElementBlock as g, createVNode as s, createElementVNode as r, toDisplayString as _, createCommentVNode as z, withModifiers as W, Fragment as q, renderList as H } from "vue";
|
|
2
|
-
import { V as xe } from "./FormSection.vue_vue_type_script_setup_true_lang-DMTby3OA.js";
|
|
3
|
-
import { useI18n as Fe, ItemSelector as Ie } from "@feedmepos/mf-common";
|
|
4
|
-
import { components as Ee } from "@feedmepos/ui-library";
|
|
5
|
-
import { _ as Oe } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
|
|
6
|
-
const Ne = {
|
|
7
|
-
ALL: "menu.order.from.options.all",
|
|
8
|
-
POS_ONLY: "menu.order.from.options.pos_only",
|
|
9
|
-
NONE: "menu.order.from.options.none"
|
|
10
|
-
}, pl = {
|
|
11
|
-
NORMAL: "menu.group.list.types.normal",
|
|
12
|
-
PRODUCT: "menu.group.list.types.product",
|
|
13
|
-
DYNAMIC: "menu.group.list.types.dynamic"
|
|
14
|
-
}, _l = {
|
|
15
|
-
ALL: "menu.product.table.availability.all",
|
|
16
|
-
POS_ONLY: "menu.product.table.availability.pos_only",
|
|
17
|
-
NONE: "menu.product.table.availability.none"
|
|
18
|
-
}, Pe = { class: "fm-typo-en-title-md-600 mr-auto" }, Ue = {
|
|
19
|
-
key: 0,
|
|
20
|
-
class: "py-8 px-8 overflow-y-auto"
|
|
21
|
-
}, Ae = {
|
|
22
|
-
key: 1,
|
|
23
|
-
class: "p-8 overflow-y-auto flex flex-col gap-16"
|
|
24
|
-
}, je = { class: "relative top-0 -mb-8 leading-6 tracking-normal fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ze = {
|
|
25
|
-
key: 0,
|
|
26
|
-
class: "text-fm-color-typo-error",
|
|
27
|
-
role: "alert"
|
|
28
|
-
}, Ge = { class: "flex flex-col gap-8" }, Be = { class: "border border-fm-color-neutral-gray-200 rounded-md p-16" }, Me = { class: "flex items-center justify-between gap-8" }, $e = { class: "flex items-center gap-8 min-w-0" }, De = { class: "text-fm-color-neutral-gray-300" }, Ke = { class: "flex gap-8" }, Ye = { class: "flex flex-col gap-8 mt-8" }, Te = { class: "fm-typo-en-body-lg-600" }, We = { class: "flex gap-8" }, qe = { class: "fm-typo-en-body-lg-600" }, He = {
|
|
29
|
-
key: 0,
|
|
30
|
-
class: "text-fm-color-neutral-gray-300 pl-16"
|
|
31
|
-
}, Je = { class: "flex items-center gap-24" }, Qe = { class: "fm-typo-en-headline-lg-600" }, Xe = { class: "overflow-y-auto" }, Ze = { class: "mt-24 flex flex-col gap-16" }, el = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, ll = { class: "mt-24 flex flex-col gap-16" }, tl = { class: "link-product-rule-editor-sheet-marker fm-typo-en-body-lg-600" }, ol = { class: "flex w-full justify-between gap-16" }, nl = { class: "break-all fm-typo-en-body-lg-400 line-clamp-1" }, al = { class: "flex w-full items-center justify-end gap-16" }, ul = {
|
|
32
|
-
key: 0,
|
|
33
|
-
class: "flex gap-8 items-center justify-start"
|
|
34
|
-
}, sl = {
|
|
35
|
-
key: 1,
|
|
36
|
-
class: "flex gap-8 items-center justify-start"
|
|
37
|
-
}, G = "__null__", vl = /* @__PURE__ */ Ve({
|
|
38
|
-
__name: "LinkProductSideSheet",
|
|
39
|
-
props: {
|
|
40
|
-
modelValue: { type: Boolean },
|
|
41
|
-
catalogue: {},
|
|
42
|
-
selectedProductIds: { default: () => [] },
|
|
43
|
-
selectedProducts: { default: void 0 },
|
|
44
|
-
selectVariant: { type: Boolean, default: !1 },
|
|
45
|
-
title: {},
|
|
46
|
-
rulesSession: { default: null },
|
|
47
|
-
rulesView: { default: null },
|
|
48
|
-
selectionSession: { default: null }
|
|
49
|
-
},
|
|
50
|
-
emits: ["update:modelValue", "submit", "submitLinks", "submit-rules"],
|
|
51
|
-
setup(ne, { emit: ae }) {
|
|
52
|
-
const u = ne, x = ae, { t: o } = Fe(), S = L("normal"), R = L(null), N = L([]), P = L([]), J = [
|
|
53
|
-
{ value: "in", label: "menu.rule_groups.condition_view.operator.in" },
|
|
54
|
-
{
|
|
55
|
-
value: "notIn",
|
|
56
|
-
label: "menu.rule_groups.condition_view.operator.not_in"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
value: "startsWith",
|
|
60
|
-
label: "menu.rule_groups.condition_view.operator.starts_with"
|
|
61
|
-
}
|
|
62
|
-
], f = h(() => u.rulesView ?? null), B = h(
|
|
63
|
-
() => {
|
|
64
|
-
var e;
|
|
65
|
-
return !!u.rulesSession && ((e = f.value) == null ? void 0 : e.rulesCapability.state) === "allowed";
|
|
66
|
-
}
|
|
67
|
-
), F = h(() => {
|
|
68
|
-
var e;
|
|
69
|
-
return ((e = f.value) == null ? void 0 : e.rules) ?? [];
|
|
70
|
-
}), Q = h(() => R.value !== null), ue = h(
|
|
71
|
-
() => J.map((e) => ({ label: o(e.label), value: e.value }))
|
|
72
|
-
);
|
|
73
|
-
function se() {
|
|
74
|
-
var e;
|
|
75
|
-
return (((e = f.value) == null ? void 0 : e.attributeOptions) ?? []).map((l) => ({
|
|
76
|
-
label: o(l.label),
|
|
77
|
-
value: l.key
|
|
78
|
-
}));
|
|
79
|
-
}
|
|
80
|
-
function re(e) {
|
|
81
|
-
var l, t;
|
|
82
|
-
return (((t = (l = f.value) == null ? void 0 : l.attributeOptions.find(
|
|
83
|
-
(a) => a.key === e.attribute
|
|
84
|
-
)) == null ? void 0 : t.values) ?? []).map((a) => ({
|
|
85
|
-
label: a.value === null ? o("menu.link_product.rules.addon") : a.label,
|
|
86
|
-
value: a.value === null ? G : a.value
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
function ie(e) {
|
|
90
|
-
var t;
|
|
91
|
-
const l = (t = f.value) == null ? void 0 : t.attributeOptions.find(
|
|
92
|
-
(a) => a.key === e.attribute
|
|
93
|
-
);
|
|
94
|
-
return e.values.map((a) => {
|
|
95
|
-
const p = l == null ? void 0 : l.values.find(
|
|
96
|
-
(j) => (j.value === null ? G : j.value) === a
|
|
97
|
-
);
|
|
98
|
-
return (p == null ? void 0 : p.value) === null ? o("menu.link_product.rules.addon") : (p == null ? void 0 : p.label) ?? String(a);
|
|
99
|
-
}).join(o("menu.link_product.rules.value_separator"));
|
|
100
|
-
}
|
|
101
|
-
function de(e, l) {
|
|
102
|
-
return e.values[l] === null ? o("menu.link_product.rules.addon") : e.valueLabels[l] ?? "";
|
|
103
|
-
}
|
|
104
|
-
function ce(e) {
|
|
105
|
-
return e.values.map(
|
|
106
|
-
(l, t) => de(e, t)
|
|
107
|
-
).join(o("menu.link_product.rules.value_separator"));
|
|
108
|
-
}
|
|
109
|
-
function M(e) {
|
|
110
|
-
const l = u.rulesSession;
|
|
111
|
-
if (!l) return;
|
|
112
|
-
const t = (e == null ? void 0 : e.id) ?? l.addRule();
|
|
113
|
-
t && l.openRuleEditor(t) && (P.value = [], R.value = t);
|
|
114
|
-
}
|
|
115
|
-
function I() {
|
|
116
|
-
var e;
|
|
117
|
-
(e = u.rulesSession) == null || e.closeRuleEditor(), R.value = null, P.value = [];
|
|
118
|
-
}
|
|
119
|
-
function me() {
|
|
120
|
-
const e = R.value, l = u.rulesSession;
|
|
121
|
-
if (!e || !l) return;
|
|
122
|
-
const t = l.saveRuleEditor();
|
|
123
|
-
t.kind === "accepted" ? I() : t.kind === "rejected" && (P.value = t.issues);
|
|
124
|
-
}
|
|
125
|
-
const $ = L(""), X = h(
|
|
126
|
-
() => {
|
|
127
|
-
var e;
|
|
128
|
-
return ((e = C.value) == null ? void 0 : e.ruleGroupIds) ?? [];
|
|
129
|
-
}
|
|
130
|
-
), pe = h(() => {
|
|
131
|
-
var t;
|
|
132
|
-
const e = ((t = f.value) == null ? void 0 : t.ruleGroupOptions) ?? [], l = $.value.trim().toLowerCase();
|
|
133
|
-
return l ? e.filter(
|
|
134
|
-
(a) => a.name.toLowerCase().includes(l)
|
|
135
|
-
) : e;
|
|
136
|
-
});
|
|
137
|
-
function _e(e) {
|
|
138
|
-
const l = u.rulesSession;
|
|
139
|
-
if (!l) return;
|
|
140
|
-
const t = X.value;
|
|
141
|
-
l.setRuleEditorGroupIds(
|
|
142
|
-
t.includes(e) ? t.filter((a) => a !== e) : [...t, e]
|
|
143
|
-
);
|
|
144
|
-
}
|
|
145
|
-
function U(e, l) {
|
|
146
|
-
var a;
|
|
147
|
-
return ((a = C.value) != null && a.issues.length ? C.value.issues : P.value).find((p) => p.field === `conditions.${e}.${l}`) ?? null;
|
|
148
|
-
}
|
|
149
|
-
function D(e) {
|
|
150
|
-
return e ? o(e.code) : "";
|
|
151
|
-
}
|
|
152
|
-
function ve(e) {
|
|
153
|
-
var t;
|
|
154
|
-
const l = (t = u.rulesSession) == null ? void 0 : t.reorderRules(e.map((a) => a.id));
|
|
155
|
-
N.value = (l == null ? void 0 : l.kind) === "rejected" ? l.issues : [];
|
|
156
|
-
}
|
|
157
|
-
function be(e) {
|
|
158
|
-
var t;
|
|
159
|
-
const l = (t = u.rulesSession) == null ? void 0 : t.duplicateRule(e);
|
|
160
|
-
N.value = (l == null ? void 0 : l.kind) === "rejected" ? l.issues : [];
|
|
161
|
-
}
|
|
162
|
-
function fe(e) {
|
|
163
|
-
return o(Ne[e]);
|
|
164
|
-
}
|
|
165
|
-
function E(e) {
|
|
166
|
-
return o("menu.link_product.rules.rule_number", { index: e + 1 });
|
|
167
|
-
}
|
|
168
|
-
function O(e) {
|
|
169
|
-
return o("menu.link_product.rules.condition_number", { index: e + 1 });
|
|
170
|
-
}
|
|
171
|
-
function ye(e) {
|
|
172
|
-
var l;
|
|
173
|
-
(l = u.rulesSession) == null || l.removeRuleEditorCondition(e);
|
|
174
|
-
}
|
|
175
|
-
function ge() {
|
|
176
|
-
var e;
|
|
177
|
-
(e = u.rulesSession) == null || e.addRuleEditorCondition();
|
|
178
|
-
}
|
|
179
|
-
function ke() {
|
|
180
|
-
x("submit-rules");
|
|
181
|
-
}
|
|
182
|
-
function Z() {
|
|
183
|
-
return u.selectedProducts ?? u.selectedProductIds.map((e) => ({ itemId: e }));
|
|
184
|
-
}
|
|
185
|
-
function ee(e) {
|
|
186
|
-
const l = {};
|
|
187
|
-
for (const t of e) {
|
|
188
|
-
const a = l[t.itemId] ?? [];
|
|
189
|
-
a.push(
|
|
190
|
-
t.combinationKey ? { _id: t.itemId, combinationKey: t.combinationKey } : { _id: t.itemId }
|
|
191
|
-
), l[t.itemId] = a;
|
|
192
|
-
}
|
|
193
|
-
return l;
|
|
194
|
-
}
|
|
195
|
-
const A = L(ee(Z()));
|
|
196
|
-
function he(e) {
|
|
197
|
-
A.value = e, u.selectionSession && u.selectionSession.setSelectedProductIds([
|
|
198
|
-
...new Set(
|
|
199
|
-
Object.values(e).flat().map((l) => l._id)
|
|
200
|
-
)
|
|
201
|
-
]);
|
|
202
|
-
}
|
|
203
|
-
oe(
|
|
204
|
-
() => u.modelValue,
|
|
205
|
-
(e) => {
|
|
206
|
-
var l;
|
|
207
|
-
if (e) {
|
|
208
|
-
const t = (l = u.selectionSession) == null ? void 0 : l.get(), a = (t == null ? void 0 : t.status) === "ready" ? t.value.selectedProductIds : void 0;
|
|
209
|
-
A.value = ee(
|
|
210
|
-
a ? a.map((p) => ({ itemId: p })) : Z()
|
|
211
|
-
), S.value = B.value && F.value.length > 0 ? "rules" : "normal";
|
|
212
|
-
} else
|
|
213
|
-
I();
|
|
214
|
-
}
|
|
215
|
-
), oe(F, (e) => {
|
|
216
|
-
u.modelValue && B.value && e.length > 0 && R.value === null && S.value === "normal" && (S.value = "rules");
|
|
217
|
-
});
|
|
218
|
-
const K = h(() => Object.values(A.value).flat()), C = h(() => {
|
|
219
|
-
var l, t;
|
|
220
|
-
if ((l = f.value) != null && l.editor) return f.value.editor;
|
|
221
|
-
const e = (t = f.value) == null ? void 0 : t.rules.find(
|
|
222
|
-
(a) => a.id === R.value
|
|
223
|
-
);
|
|
224
|
-
return e ? {
|
|
225
|
-
ruleId: e.id,
|
|
226
|
-
mode: "update",
|
|
227
|
-
orderFrom: e.orderFrom,
|
|
228
|
-
ruleGroupIds: e.ruleGroupIds,
|
|
229
|
-
conditions: e.conditions.map((a) => ({
|
|
230
|
-
attribute: a.attribute,
|
|
231
|
-
operator: a.operator,
|
|
232
|
-
values: a.values
|
|
233
|
-
})),
|
|
234
|
-
issues: []
|
|
235
|
-
} : null;
|
|
236
|
-
}), we = h(
|
|
237
|
-
() => {
|
|
238
|
-
var e;
|
|
239
|
-
return (((e = u.catalogue) == null ? void 0 : e.groups) ?? []).map((l) => ({
|
|
240
|
-
id: l.id,
|
|
241
|
-
name: l.isSynthetic ? o("menu.tree_editor.labels.addon") : l.name,
|
|
242
|
-
items: l.products.map((t) => ({
|
|
243
|
-
_id: t.id,
|
|
244
|
-
name: t.name,
|
|
245
|
-
code: t.code,
|
|
246
|
-
codeName: t.label,
|
|
247
|
-
// `ItemSelector` reads combinations off `variant.variantCombinations`
|
|
248
|
-
// and labels them by `codeName` (mf-common ItemSelector.vue:83-107); it
|
|
249
|
-
// only maps them when `selectVariant` is on, so this is inert for the
|
|
250
|
-
// hosts that link whole products.
|
|
251
|
-
variant: {
|
|
252
|
-
variantCombinations: t.variants.map((a) => ({
|
|
253
|
-
combinationKey: a.combinationKey,
|
|
254
|
-
codeName: a.label
|
|
255
|
-
}))
|
|
256
|
-
},
|
|
257
|
-
customAttributes: t.customAttributes
|
|
258
|
-
}))
|
|
259
|
-
}));
|
|
260
|
-
}
|
|
261
|
-
);
|
|
262
|
-
function Y() {
|
|
263
|
-
x("update:modelValue", !1);
|
|
264
|
-
}
|
|
265
|
-
function Se() {
|
|
266
|
-
u.selectedProducts !== void 0 ? x(
|
|
267
|
-
"submitLinks",
|
|
268
|
-
K.value.map(
|
|
269
|
-
(e) => e.combinationKey ? { itemId: e._id, combinationKey: e.combinationKey } : { itemId: e._id }
|
|
270
|
-
)
|
|
271
|
-
) : x(
|
|
272
|
-
"submit",
|
|
273
|
-
K.value.map((e) => e._id)
|
|
274
|
-
);
|
|
275
|
-
}
|
|
276
|
-
return (e, l) => {
|
|
277
|
-
const t = w("FmButton"), a = w("FmSwitch"), p = w("FmRadio"), j = w("FmRadioGroup"), Re = w("FmSearch"), Ce = w("FmMenuItem"), Le = w("FmMenu"), T = w("FmSelect"), le = w("FmSideSheet");
|
|
278
|
-
return m(), V(le, {
|
|
279
|
-
"close-button": !1,
|
|
280
|
-
"is-container": n(Ee).FmForm,
|
|
281
|
-
"is-container-props": {
|
|
282
|
-
onValidationSuccess: S.value === "normal" ? Se : ke
|
|
283
|
-
},
|
|
284
|
-
"max-width": 760,
|
|
285
|
-
"model-value": u.modelValue,
|
|
286
|
-
"z-index": 100,
|
|
287
|
-
"onUpdate:modelValue": l[4] || (l[4] = (c) => x("update:modelValue", c))
|
|
288
|
-
}, {
|
|
289
|
-
"side-sheet-header": y(() => [
|
|
290
|
-
s(t, {
|
|
291
|
-
"aria-label": n(o)("menu.common.actions.back"),
|
|
292
|
-
class: "cursor-pointer mr-4",
|
|
293
|
-
"prepend-icon": "arrow_back",
|
|
294
|
-
variant: "tertiary",
|
|
295
|
-
onClick: Y
|
|
296
|
-
}, null, 8, ["aria-label"]),
|
|
297
|
-
r("p", Pe, _(u.title ?? n(o)("menu.link_product.title")), 1),
|
|
298
|
-
B.value ? (m(), V(a, {
|
|
299
|
-
key: 0,
|
|
300
|
-
"model-value": S.value === "rules",
|
|
301
|
-
label: n(o)("menu.link_product.rules.section_title"),
|
|
302
|
-
"onUpdate:modelValue": l[0] || (l[0] = (c) => S.value = c ? "rules" : "normal")
|
|
303
|
-
}, null, 8, ["model-value", "label"])) : z("", !0)
|
|
304
|
-
]),
|
|
305
|
-
"side-sheet-footer": y(() => {
|
|
306
|
-
var c, v;
|
|
307
|
-
return [
|
|
308
|
-
S.value === "normal" ? (m(), g("div", ul, [
|
|
309
|
-
s(t, {
|
|
310
|
-
label: n(o)("menu.common.actions.confirm"),
|
|
311
|
-
size: "lg",
|
|
312
|
-
type: "submit",
|
|
313
|
-
variant: "primary"
|
|
314
|
-
}, null, 8, ["label"]),
|
|
315
|
-
s(t, {
|
|
316
|
-
label: n(o)("menu.common.actions.cancel"),
|
|
317
|
-
size: "lg",
|
|
318
|
-
variant: "tertiary",
|
|
319
|
-
onClick: Y
|
|
320
|
-
}, null, 8, ["label"])
|
|
321
|
-
])) : (m(), g("div", sl, [
|
|
322
|
-
s(t, {
|
|
323
|
-
label: n(o)("menu.common.actions.confirm"),
|
|
324
|
-
size: "lg",
|
|
325
|
-
variant: "primary",
|
|
326
|
-
disabled: ((c = f.value) == null ? void 0 : c.submit.state) !== "allowed",
|
|
327
|
-
loading: ((v = f.value) == null ? void 0 : v.status) === "submitting",
|
|
328
|
-
type: "submit"
|
|
329
|
-
}, null, 8, ["label", "disabled", "loading"]),
|
|
330
|
-
s(t, {
|
|
331
|
-
label: n(o)("common.cancel"),
|
|
332
|
-
size: "lg",
|
|
333
|
-
variant: "tertiary",
|
|
334
|
-
onClick: Y
|
|
335
|
-
}, null, 8, ["label"])
|
|
336
|
-
]))
|
|
337
|
-
];
|
|
338
|
-
}),
|
|
339
|
-
default: y(() => [
|
|
340
|
-
S.value === "normal" ? (m(), g("div", Ue, [
|
|
341
|
-
s(n(Ie), {
|
|
342
|
-
"auto-focus-search": !0,
|
|
343
|
-
"categorized-items": we.value,
|
|
344
|
-
data: A.value,
|
|
345
|
-
"select-variant": u.selectVariant,
|
|
346
|
-
"selected-items": K.value,
|
|
347
|
-
"show-addon": !0,
|
|
348
|
-
"show-variant": u.selectVariant,
|
|
349
|
-
"onUpdate:data": he
|
|
350
|
-
}, null, 8, ["categorized-items", "data", "select-variant", "selected-items", "show-variant"])
|
|
351
|
-
])) : (m(), g("div", Ae, [
|
|
352
|
-
r("p", je, _(n(o)("menu.link_product.rules.hint")), 1),
|
|
353
|
-
N.value.length > 0 ? (m(), g("p", ze, _(D(N.value[0] ?? null)), 1)) : z("", !0),
|
|
354
|
-
s(n(xe), {
|
|
355
|
-
"model-value": [...F.value],
|
|
356
|
-
"item-key": "id",
|
|
357
|
-
handle: ".link-product-rule-drag-handle",
|
|
358
|
-
class: "flex flex-col gap-8",
|
|
359
|
-
"onUpdate:modelValue": ve
|
|
360
|
-
}, {
|
|
361
|
-
item: y(({ element: c, index: v }) => [
|
|
362
|
-
r("div", Ge, [
|
|
363
|
-
r("div", Be, [
|
|
364
|
-
r("div", Me, [
|
|
365
|
-
r("div", $e, [
|
|
366
|
-
s(t, {
|
|
367
|
-
class: "link-product-rule-drag-handle cursor-grab",
|
|
368
|
-
variant: "tertiary",
|
|
369
|
-
"prepend-icon": "drag_indicator",
|
|
370
|
-
"aria-label": n(o)("menu.common.labels.a11y_labelled_name", {
|
|
371
|
-
label: n(o)("menu.menu_setting.rule_groups.reorder_rule"),
|
|
372
|
-
name: E(v)
|
|
373
|
-
})
|
|
374
|
-
}, null, 8, ["aria-label"]),
|
|
375
|
-
r("p", De, _(E(v)), 1)
|
|
376
|
-
]),
|
|
377
|
-
r("div", Ke, [
|
|
378
|
-
s(t, {
|
|
379
|
-
variant: "tertiary",
|
|
380
|
-
"prepend-icon": "edit",
|
|
381
|
-
"aria-label": n(o)("menu.common.labels.a11y_labelled_name", {
|
|
382
|
-
label: n(o)("menu.link_product.rules.edit_rule"),
|
|
383
|
-
name: E(v)
|
|
384
|
-
}),
|
|
385
|
-
onClick: W((d) => M(c), ["stop"])
|
|
386
|
-
}, null, 8, ["aria-label", "onClick"]),
|
|
387
|
-
s(t, {
|
|
388
|
-
variant: "tertiary",
|
|
389
|
-
"prepend-icon": "file_copy",
|
|
390
|
-
"aria-label": n(o)("menu.common.labels.a11y_labelled_name", {
|
|
391
|
-
label: n(o)("menu.menu_setting.rule_groups.copy_rule"),
|
|
392
|
-
name: E(v)
|
|
393
|
-
}),
|
|
394
|
-
onClick: W((d) => be(c.id), ["stop"])
|
|
395
|
-
}, null, 8, ["aria-label", "onClick"]),
|
|
396
|
-
s(t, {
|
|
397
|
-
variant: "tertiary",
|
|
398
|
-
"prepend-icon": "delete",
|
|
399
|
-
"text-color": "typo-error",
|
|
400
|
-
"aria-label": n(o)("menu.common.labels.a11y_labelled_name", {
|
|
401
|
-
label: n(o)("menu.menu_setting.rule_groups.remove_rule"),
|
|
402
|
-
name: E(v)
|
|
403
|
-
}),
|
|
404
|
-
onClick: W((d) => {
|
|
405
|
-
var i;
|
|
406
|
-
return (i = u.rulesSession) == null ? void 0 : i.removeRule(c.id);
|
|
407
|
-
}, ["stop"])
|
|
408
|
-
}, null, 8, ["aria-label", "onClick"])
|
|
409
|
-
])
|
|
410
|
-
]),
|
|
411
|
-
r("div", Ye, [
|
|
412
|
-
r("div", Te, _(n(o)("menu.rule_groups.condition_view.when")), 1),
|
|
413
|
-
(m(!0), g(q, null, H(c.conditions, (d, i) => {
|
|
414
|
-
var b;
|
|
415
|
-
return m(), g("div", {
|
|
416
|
-
key: `${c.id}-${i}`,
|
|
417
|
-
class: "flex gap-8"
|
|
418
|
-
}, [
|
|
419
|
-
r("span", null, _(n(o)("menu.link_product.rules.condition_summary", {
|
|
420
|
-
condition: O(i),
|
|
421
|
-
attribute: n(o)(d.attributeLabel),
|
|
422
|
-
operator: n(o)(
|
|
423
|
-
((b = J.find(
|
|
424
|
-
(k) => k.value === d.operator
|
|
425
|
-
)) == null ? void 0 : b.label) ?? ""
|
|
426
|
-
),
|
|
427
|
-
value: ce(d)
|
|
428
|
-
})), 1)
|
|
429
|
-
]);
|
|
430
|
-
}), 128)),
|
|
431
|
-
r("div", We, [
|
|
432
|
-
r("span", qe, _(n(o)("menu.rule_groups.condition_view.then")), 1),
|
|
433
|
-
r("span", null, _(n(o)("menu.link_product.rules.order_from_summary", {
|
|
434
|
-
label: n(o)("menu.link_product.rules.order_from"),
|
|
435
|
-
value: fe(c.orderFrom)
|
|
436
|
-
})), 1)
|
|
437
|
-
])
|
|
438
|
-
])
|
|
439
|
-
]),
|
|
440
|
-
v < F.value.length - 1 ? (m(), g("div", He, _(n(o)("menu.link_product.rules.or")), 1)) : z("", !0)
|
|
441
|
-
])
|
|
442
|
-
]),
|
|
443
|
-
_: 1
|
|
444
|
-
}, 8, ["model-value"]),
|
|
445
|
-
F.value.length === 0 ? (m(), V(n(Oe), {
|
|
446
|
-
key: 1,
|
|
447
|
-
title: n(o)("menu.rule_groups.condition_view.empty_data.no_rules_added"),
|
|
448
|
-
subtitle: n(o)("menu.rule_groups.condition_view.empty_data.subtitle"),
|
|
449
|
-
action: {
|
|
450
|
-
text: n(o)("menu.link_product.rules.add_rule"),
|
|
451
|
-
callback: () => M()
|
|
452
|
-
}
|
|
453
|
-
}, null, 8, ["title", "subtitle", "action"])) : (m(), V(t, {
|
|
454
|
-
key: 2,
|
|
455
|
-
variant: "primary",
|
|
456
|
-
"prepend-icon": "add",
|
|
457
|
-
label: n(o)("menu.link_product.rules.add_rule"),
|
|
458
|
-
onClick: l[1] || (l[1] = (c) => M())
|
|
459
|
-
}, null, 8, ["label"]))
|
|
460
|
-
])),
|
|
461
|
-
Q.value ? (m(), V(le, {
|
|
462
|
-
key: 2,
|
|
463
|
-
"model-value": Q.value,
|
|
464
|
-
"max-width": 760,
|
|
465
|
-
"z-index": 101,
|
|
466
|
-
"close-button": !1,
|
|
467
|
-
"onUpdate:modelValue": I
|
|
468
|
-
}, {
|
|
469
|
-
"side-sheet-header": y(() => {
|
|
470
|
-
var c;
|
|
471
|
-
return [
|
|
472
|
-
r("div", Je, [
|
|
473
|
-
s(t, {
|
|
474
|
-
variant: "tertiary",
|
|
475
|
-
"prepend-icon": "arrow_back",
|
|
476
|
-
"aria-label": n(o)("menu.common.actions.back"),
|
|
477
|
-
onClick: I
|
|
478
|
-
}, null, 8, ["aria-label"]),
|
|
479
|
-
r("p", Qe, _(n(o)(
|
|
480
|
-
((c = C.value) == null ? void 0 : c.mode) === "create" ? "menu.link_product.rules.add_rule" : "menu.link_product.rules.edit_rule"
|
|
481
|
-
)), 1)
|
|
482
|
-
])
|
|
483
|
-
];
|
|
484
|
-
}),
|
|
485
|
-
"side-sheet-footer": y(() => [
|
|
486
|
-
r("div", al, [
|
|
487
|
-
s(t, {
|
|
488
|
-
label: n(o)("common.cancel"),
|
|
489
|
-
variant: "secondary",
|
|
490
|
-
onClick: I
|
|
491
|
-
}, null, 8, ["label"]),
|
|
492
|
-
s(t, {
|
|
493
|
-
label: n(o)("common.save"),
|
|
494
|
-
variant: "primary",
|
|
495
|
-
onClick: me
|
|
496
|
-
}, null, 8, ["label"])
|
|
497
|
-
])
|
|
498
|
-
]),
|
|
499
|
-
default: y(() => {
|
|
500
|
-
var c, v;
|
|
501
|
-
return [
|
|
502
|
-
r("div", Xe, [
|
|
503
|
-
s(j, {
|
|
504
|
-
"model-value": ((c = C.value) == null ? void 0 : c.orderFrom) ?? "ALL",
|
|
505
|
-
label: n(o)("menu.link_product.rules.availability"),
|
|
506
|
-
"onUpdate:modelValue": l[2] || (l[2] = (d) => {
|
|
507
|
-
var i;
|
|
508
|
-
return (i = u.rulesSession) == null ? void 0 : i.setRuleEditorOrderFrom(
|
|
509
|
-
d
|
|
510
|
-
);
|
|
511
|
-
})
|
|
512
|
-
}, {
|
|
513
|
-
default: y(() => [
|
|
514
|
-
s(p, {
|
|
515
|
-
label: n(o)("menu.link_product.rules.all"),
|
|
516
|
-
value: "ALL"
|
|
517
|
-
}, null, 8, ["label"]),
|
|
518
|
-
s(p, {
|
|
519
|
-
label: n(o)("menu.link_product.rules.pos_only"),
|
|
520
|
-
value: "POS_ONLY"
|
|
521
|
-
}, null, 8, ["label"]),
|
|
522
|
-
s(p, {
|
|
523
|
-
label: n(o)("menu.link_product.rules.none"),
|
|
524
|
-
value: "NONE"
|
|
525
|
-
}, null, 8, ["label"])
|
|
526
|
-
]),
|
|
527
|
-
_: 1
|
|
528
|
-
}, 8, ["model-value", "label"]),
|
|
529
|
-
l[5] || (l[5] = r("div", { class: "mt-24 h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)),
|
|
530
|
-
r("div", Ze, [
|
|
531
|
-
r("p", el, _(n(o)("menu.link_product.rules.use_rule_group")), 1),
|
|
532
|
-
s(Le, { "close-on-click": !1 }, {
|
|
533
|
-
"menu-button": y(() => [
|
|
534
|
-
s(t, {
|
|
535
|
-
variant: "plain",
|
|
536
|
-
"prepend-icon": "add",
|
|
537
|
-
class: "self-start",
|
|
538
|
-
label: n(o)("menu.link_product.rules.add_rule_group")
|
|
539
|
-
}, null, 8, ["label"])
|
|
540
|
-
]),
|
|
541
|
-
default: y(() => [
|
|
542
|
-
s(Re, {
|
|
543
|
-
"model-value": $.value,
|
|
544
|
-
"onUpdate:modelValue": l[3] || (l[3] = (d) => $.value = d),
|
|
545
|
-
class: "w-[200px] px-8",
|
|
546
|
-
placeholder: n(o)("menu.link_product.rules.filter_result")
|
|
547
|
-
}, null, 8, ["model-value", "placeholder"]),
|
|
548
|
-
(m(!0), g(q, null, H(pe.value, (d) => (m(), V(Ce, {
|
|
549
|
-
key: d.id,
|
|
550
|
-
label: d.name,
|
|
551
|
-
"has-checkbox": "",
|
|
552
|
-
"model-value": X.value.includes(d.id),
|
|
553
|
-
onClick: (i) => _e(d.id)
|
|
554
|
-
}, null, 8, ["label", "model-value", "onClick"]))), 128))
|
|
555
|
-
]),
|
|
556
|
-
_: 1
|
|
557
|
-
})
|
|
558
|
-
]),
|
|
559
|
-
r("div", ll, [
|
|
560
|
-
r("p", tl, _(n(o)("menu.rule_groups.condition_view.condition")), 1),
|
|
561
|
-
(m(!0), g(q, null, H(((v = C.value) == null ? void 0 : v.conditions) ?? [], (d, i) => (m(), g("div", {
|
|
562
|
-
key: i,
|
|
563
|
-
class: "flex justify-between gap-8"
|
|
564
|
-
}, [
|
|
565
|
-
r("div", ol, [
|
|
566
|
-
s(T, {
|
|
567
|
-
class: "flex w-full",
|
|
568
|
-
"menu-z-index": 102,
|
|
569
|
-
"model-value": d.attribute,
|
|
570
|
-
items: se(),
|
|
571
|
-
placeholder: n(o)("menu.rule_groups.condition_view.select_item"),
|
|
572
|
-
"aria-label": n(o)("menu.common.labels.a11y_labelled_name", {
|
|
573
|
-
label: n(o)(
|
|
574
|
-
"menu.menu_setting.rule_groups.condition.attribute"
|
|
575
|
-
),
|
|
576
|
-
name: O(i)
|
|
577
|
-
}),
|
|
578
|
-
"onUpdate:modelValue": (b) => {
|
|
579
|
-
var k;
|
|
580
|
-
(k = u.rulesSession) == null || k.setRuleEditorCondition(i, {
|
|
581
|
-
attribute: b,
|
|
582
|
-
values: []
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
|
-
}, null, 8, ["model-value", "items", "placeholder", "aria-label", "onUpdate:modelValue"]),
|
|
586
|
-
s(T, {
|
|
587
|
-
class: "flex w-full",
|
|
588
|
-
"menu-z-index": 102,
|
|
589
|
-
"model-value": d.operator,
|
|
590
|
-
items: ue.value,
|
|
591
|
-
placeholder: n(o)("menu.rule_groups.condition_view.select_item"),
|
|
592
|
-
"aria-label": n(o)("menu.common.labels.a11y_labelled_name", {
|
|
593
|
-
label: n(o)(
|
|
594
|
-
"menu.menu_setting.rule_groups.condition.operator"
|
|
595
|
-
),
|
|
596
|
-
name: O(i)
|
|
597
|
-
}),
|
|
598
|
-
"helper-state": U(i, "operator") ? "error" : "none",
|
|
599
|
-
"helper-text": D(U(i, "operator")),
|
|
600
|
-
"onUpdate:modelValue": (b) => {
|
|
601
|
-
var k;
|
|
602
|
-
return (k = u.rulesSession) == null ? void 0 : k.setRuleEditorCondition(i, {
|
|
603
|
-
operator: b
|
|
604
|
-
});
|
|
605
|
-
}
|
|
606
|
-
}, null, 8, ["model-value", "items", "placeholder", "aria-label", "helper-state", "helper-text", "onUpdate:modelValue"]),
|
|
607
|
-
s(T, {
|
|
608
|
-
class: "flex w-full",
|
|
609
|
-
"menu-z-index": 102,
|
|
610
|
-
"model-value": d.values.map(
|
|
611
|
-
(b) => b === null ? G : b
|
|
612
|
-
),
|
|
613
|
-
items: re(d),
|
|
614
|
-
multiselect: "",
|
|
615
|
-
"hide-chips": "",
|
|
616
|
-
placeholder: n(o)("menu.rule_groups.condition_view.select_item"),
|
|
617
|
-
"aria-label": n(o)("menu.common.labels.a11y_labelled_name", {
|
|
618
|
-
label: n(o)("menu.menu_setting.rule_groups.condition.value"),
|
|
619
|
-
name: O(i)
|
|
620
|
-
}),
|
|
621
|
-
"helper-state": U(i, "values") ? "error" : "none",
|
|
622
|
-
"helper-text": D(U(i, "values")),
|
|
623
|
-
"onUpdate:modelValue": (b) => {
|
|
624
|
-
var k;
|
|
625
|
-
return (k = u.rulesSession) == null ? void 0 : k.setRuleEditorCondition(i, {
|
|
626
|
-
values: b.map(
|
|
627
|
-
(te) => te === G ? null : te
|
|
628
|
-
)
|
|
629
|
-
});
|
|
630
|
-
}
|
|
631
|
-
}, {
|
|
632
|
-
default: y(() => [
|
|
633
|
-
r("div", nl, _(ie(d)), 1)
|
|
634
|
-
]),
|
|
635
|
-
_: 2
|
|
636
|
-
}, 1032, ["model-value", "items", "placeholder", "aria-label", "helper-state", "helper-text", "onUpdate:modelValue"])
|
|
637
|
-
]),
|
|
638
|
-
s(t, {
|
|
639
|
-
variant: "tertiary",
|
|
640
|
-
"prepend-icon": "close",
|
|
641
|
-
"aria-label": n(o)("menu.common.labels.a11y_labelled_name", {
|
|
642
|
-
label: n(o)("menu.menu_setting.rule_groups.remove_condition"),
|
|
643
|
-
name: O(i)
|
|
644
|
-
}),
|
|
645
|
-
onClick: (b) => ye(i)
|
|
646
|
-
}, null, 8, ["aria-label", "onClick"])
|
|
647
|
-
]))), 128)),
|
|
648
|
-
s(t, {
|
|
649
|
-
variant: "plain",
|
|
650
|
-
"prepend-icon": "add",
|
|
651
|
-
label: n(o)("menu.rule_groups.condition_view.add_condition"),
|
|
652
|
-
onClick: ge
|
|
653
|
-
}, null, 8, ["label"])
|
|
654
|
-
])
|
|
655
|
-
])
|
|
656
|
-
];
|
|
657
|
-
}),
|
|
658
|
-
_: 1
|
|
659
|
-
}, 8, ["model-value"])) : z("", !0)
|
|
660
|
-
]),
|
|
661
|
-
_: 1
|
|
662
|
-
}, 8, ["is-container", "is-container-props", "model-value"]);
|
|
663
|
-
};
|
|
664
|
-
}
|
|
665
|
-
});
|
|
666
|
-
export {
|
|
667
|
-
pl as A,
|
|
668
|
-
_l as O,
|
|
669
|
-
vl as _,
|
|
670
|
-
Ne as a
|
|
671
|
-
};
|