@feedmepos/mf-menu 0.31.40-prod → 0.31.41-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-aWEH-ZEk.js → App-5Lzy8zHZ.js} +8 -8
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-jJyinQZl.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BnKXsQH-.js} +3 -3
- package/dist/{Catalog-BoFfFdn8.js → Catalog-s5b8V8nw.js} +8 -9
- package/dist/{Category-CWYbb3Jn.js → Category-BJzScJEY.js} +4 -4
- package/dist/{Category-DZ45uikR.js → Category-DZ-xqIMI.js} +6 -6
- package/dist/{CookingGuide-BU0PRWIQ.js → CookingGuide-Bkd6GPww.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Z5xsKDIE.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-B8tIjKOW.js} +1 -1
- package/dist/{Group-BMQDeqiS.js → Group-0b2Qiov3.js} +1 -1
- package/dist/{Group-C0T_uknK.js → Group-BOaCcKiI.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-DyfmY6F1.js → Group.vue_vue_type_script_setup_true_lang-DUlUfMAs.js} +8 -8
- package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-CouimeC4.js +399 -0
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Dl-Wvt3D.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-DOvQmbrZ.js} +13 -14
- package/dist/{Ingredient-3lwDUQx_.js → Ingredient-ChcYUvOg.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-VLrrTkSC.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DE1HkipX.js} +2 -2
- package/dist/LinkProductSideSheet-BdzBGYxG.js +361 -0
- package/dist/MenuSetting-zAAttaoA.js +618 -0
- package/dist/{PrintRoute-DfJ-vUAb.js → PrintRoute-T-vuO5N8.js} +4 -4
- package/dist/{Product-F4PoLm9v.js → Product-B5q291VF.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-DT5gffpA.js → Product.vue_vue_type_script_setup_true_lang-DLRlT10W.js} +468 -465
- package/dist/{ProductInternalTools-DSGU-OqU.js → ProductInternalTools-BOlc0VUR.js} +5 -5
- package/dist/{Products-COzW2Z4g.js → Products-Cd4Mqhm3.js} +88 -85
- package/dist/{Publish-CDXVWCk2.js → Publish-SuRzt-_D.js} +3 -3
- package/dist/{Recipe-BZx4wrcP.js → Recipe-BKrjNs5g.js} +4 -4
- package/dist/{Scheduler-wHCWSeU2.js → Scheduler-DnDgImLC.js} +3 -3
- package/dist/{ServingSequence-BbYEhDYh.js → ServingSequence-D602bVnm.js} +3 -3
- package/dist/{Setting-C9Tlw1Iy.js → Setting-FMT4oBYH.js} +44 -45
- package/dist/{Subcategory-C8AwfrKb.js → Subcategory-CpYmjAvA.js} +4 -4
- package/dist/{Takeaway-t1053wg2.js → Takeaway-BXh3iuME.js} +1 -1
- package/dist/{Takeaway-DaEUn-yM.js → Takeaway-D4hjN5z5.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-7XycP5fU.js → Takeaway.vue_vue_type_script_setup_true_lang-By1f-FCO.js} +5 -5
- package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-CZUwa5C_.js +440 -0
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-Ci6iqOry.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DfjtfcCh.js} +604 -600
- package/dist/{Unit-CnqptGCz.js → Unit-CsjHkV-h.js} +2 -2
- package/dist/{Variant-DiOYOwJs.js → Variant-Djra14ZX.js} +3 -3
- package/dist/{_id_-BSfU16VO.js → _id_-BXkqoCzB.js} +78 -75
- package/dist/{app-Ddb81PNo.js → app-CVqWWV4x.js} +278 -278
- package/dist/{LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js → app-CiBqmBzO.js} +2120 -2084
- package/dist/{app-Cou6qPF2.js → app-PhBJNss_.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/api/menu.d.ts +2 -1
- package/dist/apps/mf-menu/src/app.d.ts +144 -0
- package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierRuleEditor.vue.d.ts +36 -0
- package/dist/apps/mf-menu/src/components/feature/RestaurantAttributesSelector.vue.d.ts +9 -3
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +294 -4
- package/dist/apps/mf-menu/src/composable/attributes.d.ts +26 -0
- package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +40 -0
- package/dist/apps/mf-menu/src/helper/import-export.d.ts +285 -0
- package/dist/apps/mf-menu/src/helper/menu.d.ts +285 -0
- package/dist/apps/mf-menu/src/manager/menu/item.d.ts +285 -0
- package/dist/apps/mf-menu/src/stores/menu.d.ts +293 -3
- package/dist/apps/mf-menu/src/utils/array.d.ts +1 -0
- package/dist/apps/mf-menu/src/utils/customAttributes.d.ts +12 -0
- package/dist/apps/mf-menu/src/views/MenuSetting/LinkProductRuleGroups.vue.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/MenuSetting/RuleGroupSideSheet.vue.d.ts +176 -0
- package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +166 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/linked-status-WlVAcpRn.js +13 -0
- package/dist/assets/override-menu-__h4D7ac.js +13 -0
- package/dist/assets/validate-menu-DyPuzLRg.js +13 -0
- package/dist/{catalog-DSuJhsUb.js → catalog-C_TuQLxq.js} +1 -1
- package/dist/{catalogSetting-C3gEw9ov.js → catalogSetting-BUlJu6hG.js} +1 -1
- package/dist/{category-CwWq3KCE.js → category-CmVw1Kj-.js} +1 -1
- package/dist/{currency-g45Sh-t6.js → currency-OhOTnAqk.js} +1 -1
- package/dist/customAttributes-fpOfmGnw.js +180 -0
- package/dist/{dayjs.min-g3eN5z-V.js → dayjs.min-CDhP-7L5.js} +1 -1
- package/dist/{index-QsLFbxyG.js → index-BJZEWB5C.js} +4 -4
- package/dist/{index-BLQCYEc6.js → index-DHAYGEPp.js} +7 -8
- package/dist/{index-0yRUi7LL.js → index-DtwHmS38.js} +1 -1
- package/dist/index-N3cGc8ex.js +245 -0
- package/dist/{item-BvvQ9urP.js → item-BELLphR0.js} +16 -16
- package/dist/{jszip.min-DzdUiaR4.js → jszip.min-CZtcGb7A.js} +353 -353
- package/dist/{menu-QrVg2Ph7.js → menu-Csyr6W9A.js} +7 -7
- package/dist/{menu-DFNvhoNQ.js → menu-DS_ERmBf.js} +23355 -23206
- package/dist/{menuV2-Ezf_jW40.js → menuV2-DKzAZ4Ss.js} +151 -146
- package/dist/mf-menu.css +1 -1
- package/dist/{priceTier-zENsn3P_.js → priceTier-CYWS5lDS.js} +1 -1
- package/dist/{scheduler-BuwGSv6A.js → scheduler-DI5dXC7Y.js} +8 -8
- package/dist/{subcategory-O3L_zCJA.js → subcategory-D_ao-IV9.js} +2 -2
- package/dist/{toExcel-CpRy_4nG.js → toExcel-Cml-rkJQ.js} +2 -2
- package/dist/{unit-Ct_7Hfa2.js → unit-BWDp2LkV.js} +42 -41
- package/package.json +3 -3
- package/dist/FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js +0 -50
- package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D6qro5w_.js +0 -367
- package/dist/LinkProductSideSheet-LDZjKX95.js +0 -297
- package/dist/MenuSetting-AhutsCVy.js +0 -185
- package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-B7oLH9cP.js +0 -431
- package/dist/assets/linked-status-B_crHhZH.js +0 -24
- package/dist/assets/override-menu-BmlCEpHH.js +0 -24
- package/dist/assets/validate-menu-CF-psoB-.js +0 -24
- package/dist/index-0Q5T9VZV.js +0 -214
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
import { defineComponent as B, useModel as G, computed as A, resolveComponent as p, createBlock as S, openBlock as v, ref as I, watch as H, withCtx as _, createElementBlock as C, createElementVNode as M, Fragment as z, renderList as Y, createVNode as u, unref as e, createCommentVNode as U, withModifiers as q, onMounted as Z, renderSlot as ee, toDisplayString as D, createTextVNode as le } from "vue";
|
|
2
|
-
import { useI18n as L, EMPTY_RULE as x, isEmptyMongoQuery as te, isEmptyRule as h, useCustomAttributes as ae, useCoreStore as oe } from "@feedmepos/mf-common";
|
|
3
|
-
import { a as J, L as re } from "./LinkProductSideSheet-LDZjKX95.js";
|
|
4
|
-
import { u as w } from "./priceTier-zENsn3P_.js";
|
|
5
|
-
import { x as ue, N as ne, b as ie } from "./LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js";
|
|
6
|
-
import { FmButtonVariant as K, useDialog as se, components as me, FmButtonColorThemeVariant as j } from "@feedmepos/ui-library";
|
|
7
|
-
import { _ as de } from "./FormSection.vue_vue_type_script_setup_true_lang-CO4YGYLB.js";
|
|
8
|
-
import { L as y } from "./catalogSetting-C3gEw9ov.js";
|
|
9
|
-
import { c as O } from "./check-C9mY6LiX.js";
|
|
10
|
-
import { u as pe, H as Q, aj as ce } from "./menu-DFNvhoNQ.js";
|
|
11
|
-
import { c as ve } from "./string-DpfFixWH.js";
|
|
12
|
-
const fe = /* @__PURE__ */ B({
|
|
13
|
-
__name: "LinkPriceTier",
|
|
14
|
-
props: {
|
|
15
|
-
modelValue: { required: !0 },
|
|
16
|
-
modelModifiers: {}
|
|
17
|
-
},
|
|
18
|
-
emits: ["update:modelValue"],
|
|
19
|
-
setup(k) {
|
|
20
|
-
const { t: T } = L(), o = G(k, "modelValue"), r = w(), a = A(() => r.priceTiers.value.map((b) => ({
|
|
21
|
-
label: b.key,
|
|
22
|
-
value: b.key
|
|
23
|
-
})));
|
|
24
|
-
return (b, f) => {
|
|
25
|
-
const i = p("FmSelect");
|
|
26
|
-
return v(), S(i, {
|
|
27
|
-
items: a.value,
|
|
28
|
-
"model-value": o.value ?? [],
|
|
29
|
-
multiselect: !0,
|
|
30
|
-
keepSelectionOrder: !0,
|
|
31
|
-
"onUpdate:modelValue": f[0] || (f[0] = (s) => o.value = s)
|
|
32
|
-
}, null, 8, ["items", "model-value"]);
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
}), _e = {
|
|
36
|
-
class: "flex justify-end"
|
|
37
|
-
}, be = /* @__PURE__ */ B({
|
|
38
|
-
__name: "PriceTierRuleEditor",
|
|
39
|
-
props: {
|
|
40
|
-
modelValue: {
|
|
41
|
-
required: !0
|
|
42
|
-
},
|
|
43
|
-
modelModifiers: {}
|
|
44
|
-
},
|
|
45
|
-
emits: ["update:modelValue"],
|
|
46
|
-
setup(k) {
|
|
47
|
-
var V;
|
|
48
|
-
const {
|
|
49
|
-
t: T
|
|
50
|
-
} = L(), o = G(k, "modelValue"), r = I((V = o.value) == null ? void 0 : V.map((t) => ({
|
|
51
|
-
...t,
|
|
52
|
-
restaurantAttributes: te(t.restaurantAttributes) ? x : ue.build(t.restaurantAttributes)
|
|
53
|
-
})));
|
|
54
|
-
H(r, (t) => {
|
|
55
|
-
o.value = t == null ? void 0 : t.map((n) => ({
|
|
56
|
-
priceTier: n.priceTier,
|
|
57
|
-
restaurantAttributes: h(n.restaurantAttributes) ? null : ne.build(n.restaurantAttributes)
|
|
58
|
-
}));
|
|
59
|
-
}, {
|
|
60
|
-
deep: !0
|
|
61
|
-
});
|
|
62
|
-
const a = w(), {
|
|
63
|
-
attributes: b
|
|
64
|
-
} = ae({
|
|
65
|
-
valueSource: oe().restaurants,
|
|
66
|
-
entity: "restaurant"
|
|
67
|
-
});
|
|
68
|
-
function f(t, n) {
|
|
69
|
-
r.value && r.value[t] && (h(n) ? r.value[t].restaurantAttributes = x : r.value[t].restaurantAttributes = n);
|
|
70
|
-
}
|
|
71
|
-
const i = A(() => a.priceTiers.value.map((t) => ({
|
|
72
|
-
value: t.key,
|
|
73
|
-
label: t.key
|
|
74
|
-
})));
|
|
75
|
-
function s() {
|
|
76
|
-
r.value = [...r.value || [], {
|
|
77
|
-
priceTier: "",
|
|
78
|
-
restaurantAttributes: x
|
|
79
|
-
}];
|
|
80
|
-
}
|
|
81
|
-
function l(t) {
|
|
82
|
-
r.value && r.value.splice(t, 1);
|
|
83
|
-
}
|
|
84
|
-
return (t, n) => {
|
|
85
|
-
const N = p("FmSelect"), $ = p("fm-button"), m = p("FmCard"), c = p("FmButton");
|
|
86
|
-
return v(), S(de, null, {
|
|
87
|
-
default: _(() => [(v(!0), C(z, null, Y(r.value, (F, P) => (v(), S(m, {
|
|
88
|
-
key: P,
|
|
89
|
-
class: "p-16 space-y-16",
|
|
90
|
-
variant: "outlined"
|
|
91
|
-
}, {
|
|
92
|
-
default: _(() => [M("div", null, [u(N, {
|
|
93
|
-
label: "Price groups",
|
|
94
|
-
"label-mark": "required",
|
|
95
|
-
items: i.value,
|
|
96
|
-
"model-value": F.priceTier,
|
|
97
|
-
rules: [(g) => !!g || e(T)("menu.common.validation.required_field")],
|
|
98
|
-
"onUpdate:modelValue": (g) => F.priceTier = g
|
|
99
|
-
}, null, 8, ["items", "model-value", "rules", "onUpdate:modelValue"])]), u(J, {
|
|
100
|
-
label: "Restaurant filter"
|
|
101
|
-
}, {
|
|
102
|
-
default: _(() => [u(e(ie), {
|
|
103
|
-
attributes: e(b),
|
|
104
|
-
"model-value": F.restaurantAttributes,
|
|
105
|
-
"onUpdate:modelValue": (g) => f(P, g)
|
|
106
|
-
}, null, 8, ["attributes", "model-value", "onUpdate:modelValue"])]),
|
|
107
|
-
_: 2
|
|
108
|
-
}, 1024), M("div", _e, [u($, {
|
|
109
|
-
variant: e(K).Tertiary,
|
|
110
|
-
"prepend-icon": "delete",
|
|
111
|
-
onClick: (g) => l(P)
|
|
112
|
-
}, null, 8, ["variant", "onClick"])])]),
|
|
113
|
-
_: 2
|
|
114
|
-
}, 1024))), 128)), M("div", null, [u(c, {
|
|
115
|
-
label: "Add rule",
|
|
116
|
-
onClick: s
|
|
117
|
-
})])]),
|
|
118
|
-
_: 1
|
|
119
|
-
});
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}), Be = /* @__PURE__ */ B({
|
|
123
|
-
__name: "LinkPriceTierSection",
|
|
124
|
-
props: {
|
|
125
|
-
modelValue: {},
|
|
126
|
-
isMainCatalog: {
|
|
127
|
-
type: Boolean
|
|
128
|
-
},
|
|
129
|
-
isV4: {
|
|
130
|
-
type: Boolean
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
emits: ["update:modelValue"],
|
|
134
|
-
setup(k, {
|
|
135
|
-
emit: T
|
|
136
|
-
}) {
|
|
137
|
-
const o = k, r = T, {
|
|
138
|
-
t: a
|
|
139
|
-
} = L(), b = w(), f = I(o.modelValue.priceTierRules && o.modelValue.priceTierRules.length > 0 ? y.Rules : y.Normal);
|
|
140
|
-
function i(s) {
|
|
141
|
-
r("update:modelValue", {
|
|
142
|
-
...o.modelValue,
|
|
143
|
-
...s
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
return (s, l) => {
|
|
147
|
-
const V = p("fm-radio"), t = p("fm-radio-group");
|
|
148
|
-
return !s.isMainCatalog && s.isV4 && e(b).priceTiers.value.length > 0 ? (v(), S(J, {
|
|
149
|
-
key: 0,
|
|
150
|
-
label: e(a)("menu.price_tier.link_price_tier")
|
|
151
|
-
}, {
|
|
152
|
-
default: _(() => [u(t, {
|
|
153
|
-
"model-value": f.value,
|
|
154
|
-
"onUpdate:modelValue": l[4] || (l[4] = (n) => {
|
|
155
|
-
f.value = n, n === e(y).Normal && i({
|
|
156
|
-
priceTierRules: null
|
|
157
|
-
});
|
|
158
|
-
})
|
|
159
|
-
}, {
|
|
160
|
-
default: _(() => [u(V, {
|
|
161
|
-
value: e(y).Normal,
|
|
162
|
-
label: e(a)("menu.price_tier.link_price_group"),
|
|
163
|
-
sublabel: e(a)("menu.price_tier.link_price_group_description")
|
|
164
|
-
}, null, 8, ["value", "label", "sublabel"]), f.value === e(y).Normal ? (v(), C("div", {
|
|
165
|
-
key: 0,
|
|
166
|
-
onClick: l[1] || (l[1] = q(() => {
|
|
167
|
-
}, ["prevent"])),
|
|
168
|
-
class: "pl-32"
|
|
169
|
-
}, [u(fe, {
|
|
170
|
-
"model-value": s.modelValue.usePriceTiers,
|
|
171
|
-
"onUpdate:modelValue": l[0] || (l[0] = (n) => i({
|
|
172
|
-
usePriceTiers: n
|
|
173
|
-
}))
|
|
174
|
-
}, null, 8, ["model-value"])])) : U("", !0), u(V, {
|
|
175
|
-
value: e(y).Rules,
|
|
176
|
-
label: e(a)("menu.price_tier.price_group_rule"),
|
|
177
|
-
sublabel: e(a)("menu.price_tier.price_group_rule_description")
|
|
178
|
-
}, null, 8, ["value", "label", "sublabel"]), f.value === e(y).Rules ? (v(), C("div", {
|
|
179
|
-
key: 1,
|
|
180
|
-
onClick: l[3] || (l[3] = q(() => {
|
|
181
|
-
}, ["prevent"])),
|
|
182
|
-
class: "pl-32"
|
|
183
|
-
}, [u(be, {
|
|
184
|
-
"model-value": s.modelValue.priceTierRules,
|
|
185
|
-
"onUpdate:modelValue": l[2] || (l[2] = (n) => i({
|
|
186
|
-
priceTierRules: n
|
|
187
|
-
}))
|
|
188
|
-
}, null, 8, ["model-value"])])) : U("", !0)]),
|
|
189
|
-
_: 1
|
|
190
|
-
}, 8, ["model-value"])]),
|
|
191
|
-
_: 1
|
|
192
|
-
}, 8, ["label"])) : U("", !0);
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
}), ge = { class: "space-y-16" }, ke = { class: "ml-32 mt-16 space-y-8" }, Ve = {
|
|
196
|
-
key: 0,
|
|
197
|
-
class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
|
|
198
|
-
}, Le = /* @__PURE__ */ B({
|
|
199
|
-
__name: "GroupMarkupPriceDialog",
|
|
200
|
-
props: {
|
|
201
|
-
modelValue: {},
|
|
202
|
-
items: {},
|
|
203
|
-
categories: {},
|
|
204
|
-
action: {}
|
|
205
|
-
},
|
|
206
|
-
emits: ["update:model-value"],
|
|
207
|
-
setup(k, { emit: T }) {
|
|
208
|
-
const o = k, r = pe();
|
|
209
|
-
se();
|
|
210
|
-
const { t: a } = L(), b = T, f = A(() => o.action === "add" ? a("menu.markup.dialog.title.add") : a("menu.markup.dialog.title.update")), i = I(!1), s = (m) => {
|
|
211
|
-
O.isBoolean(m) ? i.value = m : i.value = !i.value;
|
|
212
|
-
}, l = I(
|
|
213
|
-
o.modelValue ? Q(o.modelValue) : {
|
|
214
|
-
percentage: 0,
|
|
215
|
-
includeItems: null
|
|
216
|
-
}
|
|
217
|
-
);
|
|
218
|
-
H(
|
|
219
|
-
() => i.value,
|
|
220
|
-
(m) => {
|
|
221
|
-
m && (l.value = o.modelValue ? Q(o.modelValue) : {
|
|
222
|
-
percentage: 0,
|
|
223
|
-
includeItems: null
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
), A(
|
|
227
|
-
() => ce(r.variants, o.categories, o.items)
|
|
228
|
-
);
|
|
229
|
-
function V(m) {
|
|
230
|
-
l.value = {
|
|
231
|
-
...l.value,
|
|
232
|
-
includeItems: m
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
const t = I(
|
|
236
|
-
0
|
|
237
|
-
/* ALL */
|
|
238
|
-
);
|
|
239
|
-
function n(m) {
|
|
240
|
-
t.value = m, l.value = {
|
|
241
|
-
...l.value,
|
|
242
|
-
includeItems: m === 0 ? null : []
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
const N = A(() => [
|
|
246
|
-
{
|
|
247
|
-
label: a("menu.markup.dialog.options.all"),
|
|
248
|
-
value: 0
|
|
249
|
-
/* ALL */
|
|
250
|
-
},
|
|
251
|
-
{
|
|
252
|
-
label: a("menu.markup.dialog.options.custom"),
|
|
253
|
-
value: 1
|
|
254
|
-
/* CUSTOM */
|
|
255
|
-
}
|
|
256
|
-
]);
|
|
257
|
-
async function $() {
|
|
258
|
-
b("update:model-value", l.value), s(!1);
|
|
259
|
-
}
|
|
260
|
-
return Z(() => {
|
|
261
|
-
t.value = l.value && l.value.includeItems === null ? 0 : 1;
|
|
262
|
-
}), (m, c) => {
|
|
263
|
-
const F = p("fm-icon"), P = p("fm-stepper-field"), g = p("fm-radio"), W = p("fm-radio-group"), E = p("fm-button"), X = p("fm-dialog");
|
|
264
|
-
return v(), C(z, null, [
|
|
265
|
-
ee(m.$slots, "default", { trigger: s }),
|
|
266
|
-
u(X, {
|
|
267
|
-
modelValue: i.value,
|
|
268
|
-
"onUpdate:modelValue": c[4] || (c[4] = (R) => i.value = R),
|
|
269
|
-
"is-component": e(me).FmForm,
|
|
270
|
-
"is-component-props": {
|
|
271
|
-
onValidationSuccess: $
|
|
272
|
-
}
|
|
273
|
-
}, {
|
|
274
|
-
"dialog-header": _(() => [
|
|
275
|
-
le(D(f.value), 1)
|
|
276
|
-
]),
|
|
277
|
-
"dialog-footer": _(() => [
|
|
278
|
-
u(E, {
|
|
279
|
-
class: "sm:w-full xs:w-full ml-auto",
|
|
280
|
-
label: "Cancel",
|
|
281
|
-
variant: "tertiary",
|
|
282
|
-
onClick: c[3] || (c[3] = (R) => s(!1))
|
|
283
|
-
}),
|
|
284
|
-
u(E, {
|
|
285
|
-
label: e(ve)(m.action),
|
|
286
|
-
class: "sm:w-full xs:w-full",
|
|
287
|
-
size: "md",
|
|
288
|
-
type: "submit",
|
|
289
|
-
variant: "primary"
|
|
290
|
-
}, null, 8, ["label"])
|
|
291
|
-
]),
|
|
292
|
-
default: _(() => {
|
|
293
|
-
var R;
|
|
294
|
-
return [
|
|
295
|
-
M("div", ge, [
|
|
296
|
-
u(P, {
|
|
297
|
-
modelValue: l.value.percentage,
|
|
298
|
-
"onUpdate:modelValue": c[0] || (c[0] = (d) => l.value.percentage = d),
|
|
299
|
-
decimal: 0,
|
|
300
|
-
max: 100,
|
|
301
|
-
min: 0,
|
|
302
|
-
rules: [
|
|
303
|
-
(d) => e(O).isSet(d) && d >= 0 || e(a)("menu.markup.dialog.fields.percentage.required")
|
|
304
|
-
],
|
|
305
|
-
label: e(a)("menu.markup.dialog.fields.percentage.label"),
|
|
306
|
-
placeholder: e(a)("menu.markup.dialog.fields.percentage.placeholder")
|
|
307
|
-
}, {
|
|
308
|
-
prepend: _(() => [
|
|
309
|
-
u(F, { name: "percent" })
|
|
310
|
-
]),
|
|
311
|
-
_: 1
|
|
312
|
-
}, 8, ["modelValue", "rules", "label", "placeholder"]),
|
|
313
|
-
M("div", null, [
|
|
314
|
-
u(W, {
|
|
315
|
-
modelValue: t.value,
|
|
316
|
-
"onUpdate:modelValue": [
|
|
317
|
-
c[1] || (c[1] = (d) => t.value = d),
|
|
318
|
-
n
|
|
319
|
-
],
|
|
320
|
-
class: "space-y-8"
|
|
321
|
-
}, {
|
|
322
|
-
default: _(() => [
|
|
323
|
-
(v(!0), C(z, null, Y(N.value, (d) => (v(), S(g, {
|
|
324
|
-
key: d.value,
|
|
325
|
-
label: d.label,
|
|
326
|
-
value: d.value
|
|
327
|
-
}, null, 8, ["label", "value"]))), 128))
|
|
328
|
-
]),
|
|
329
|
-
_: 1
|
|
330
|
-
}, 8, ["modelValue"]),
|
|
331
|
-
M("div", ke, [
|
|
332
|
-
u(re, {
|
|
333
|
-
title: "Link products",
|
|
334
|
-
"categorized-items": e(r).categorizedItems,
|
|
335
|
-
"initial-value": l.value.includeItems || [],
|
|
336
|
-
"show-variant": !1,
|
|
337
|
-
onSubmit: c[2] || (c[2] = ({ items: d }) => V(d))
|
|
338
|
-
}, {
|
|
339
|
-
default: _(({ trigger: d }) => [
|
|
340
|
-
t.value === 1 ? (v(), S(E, {
|
|
341
|
-
key: 0,
|
|
342
|
-
"text-color": e(j).ColorPrimary,
|
|
343
|
-
"border-color": e(j).ColorPrimary,
|
|
344
|
-
variant: e(K).Secondary,
|
|
345
|
-
label: e(a)("menu.markup.dialog.products.link"),
|
|
346
|
-
"prepend-icon": "link",
|
|
347
|
-
onClick: d
|
|
348
|
-
}, null, 8, ["text-color", "border-color", "variant", "label", "onClick"])) : U("", !0)
|
|
349
|
-
]),
|
|
350
|
-
_: 1
|
|
351
|
-
}, 8, ["categorized-items", "initial-value"]),
|
|
352
|
-
(R = l.value.includeItems) != null && R.length ? (v(), C("p", Ve, D(e(a)("menu.markup.dialog.products.count", { count: l.value.includeItems.length })), 1)) : U("", !0)
|
|
353
|
-
])
|
|
354
|
-
])
|
|
355
|
-
])
|
|
356
|
-
];
|
|
357
|
-
}),
|
|
358
|
-
_: 1
|
|
359
|
-
}, 8, ["modelValue", "is-component", "is-component-props"])
|
|
360
|
-
], 64);
|
|
361
|
-
};
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
export {
|
|
365
|
-
Le as _,
|
|
366
|
-
Be as a
|
|
367
|
-
};
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import { defineComponent as G, createElementBlock as b, openBlock as c, createElementVNode as u, renderSlot as U, createCommentVNode as w, toDisplayString as B, ref as A, computed as S, watch as D, resolveComponent as R, Fragment as O, createVNode as n, unref as l, withCtx as v, createBlock as N, renderList as de } from "vue";
|
|
2
|
-
import { H as V, Q as ce, u as pe, A as fe, I as j } from "./menu-DFNvhoNQ.js";
|
|
3
|
-
import { N as Q, b as T, x as P } from "./LinkProductSideSheet.vue_vue_type_style_index_0_scoped_97fa9d58_lang-DvG3mOom.js";
|
|
4
|
-
import { useI18n as ve, isEmptyRule as C, useCustomAttributes as H, useCoreStore as be, ItemSelector as _e, EMPTY_RULE as F, isEmptyMongoQuery as Y } from "@feedmepos/mf-common";
|
|
5
|
-
import { components as ye, FmButtonVariant as q } from "@feedmepos/ui-library";
|
|
6
|
-
import { u as he } from "./discardConfirm-BHni0LNu.js";
|
|
7
|
-
import { u as ke } from "./menuV2-Ezf_jW40.js";
|
|
8
|
-
import { c as Ae } from "./check-C9mY6LiX.js";
|
|
9
|
-
const Re = (r, p) => {
|
|
10
|
-
const s = r.__vccOpts || r;
|
|
11
|
-
for (const [g, i] of p)
|
|
12
|
-
s[g] = i;
|
|
13
|
-
return s;
|
|
14
|
-
}, ge = { class: "space-y-8" }, Ie = { class: "flex items-center justify-between" }, Se = { class: "space-y-8" }, Ve = { class: "fm-typo-en-body-lg-600" }, Ce = {
|
|
15
|
-
key: 0,
|
|
16
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
17
|
-
}, $ = /* @__PURE__ */ G({
|
|
18
|
-
__name: "FormItem",
|
|
19
|
-
props: {
|
|
20
|
-
label: {},
|
|
21
|
-
description: {}
|
|
22
|
-
},
|
|
23
|
-
setup(r) {
|
|
24
|
-
return (p, s) => (c(), b("div", ge, [
|
|
25
|
-
u("div", Ie, [
|
|
26
|
-
u("div", Se, [
|
|
27
|
-
u("p", Ve, B(p.label), 1),
|
|
28
|
-
p.description ? (c(), b("p", Ce, B(p.description), 1)) : w("", !0)
|
|
29
|
-
]),
|
|
30
|
-
U(p.$slots, "append")
|
|
31
|
-
]),
|
|
32
|
-
U(p.$slots, "default")
|
|
33
|
-
]));
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
var m = /* @__PURE__ */ ((r) => (r[r.Normal = 0] = "Normal", r[r.Rules = 1] = "Rules", r))(m || {});
|
|
37
|
-
const Fe = { class: "fm-typo-en-title-md-600 mr-auto" }, we = {
|
|
38
|
-
key: 1,
|
|
39
|
-
class: "flex items-center gap-12"
|
|
40
|
-
}, Be = { class: "flex items-center gap-8" }, Ee = { class: "text-neutral-600 fm-typo-body-sm" }, Oe = { class: "grid md:grid-cols-3 gap-16" }, Ne = { class: "md:col-span-2 space-y-16" }, $e = { class: "flex justify-end" }, Ue = { class: "flex gap-8 items-center justify-start" }, Le = /* @__PURE__ */ G({
|
|
41
|
-
__name: "LinkProductSideSheet",
|
|
42
|
-
props: {
|
|
43
|
-
initialValue: { default: () => [] },
|
|
44
|
-
linkItemRules: {},
|
|
45
|
-
menuItems: {},
|
|
46
|
-
noScheduler: { type: Boolean },
|
|
47
|
-
isLocalOnly: { type: Boolean, default: !1 },
|
|
48
|
-
categorizedItems: { default: () => [] },
|
|
49
|
-
selectVariant: { type: Boolean, default: !1 },
|
|
50
|
-
showVariant: { type: Boolean, default: !1 },
|
|
51
|
-
showAddon: { type: Boolean, default: !0 },
|
|
52
|
-
title: { default: void 0 },
|
|
53
|
-
useCloseBtn: { type: Boolean }
|
|
54
|
-
},
|
|
55
|
-
emits: ["submit"],
|
|
56
|
-
setup(r, { emit: p }) {
|
|
57
|
-
const s = r, g = p, { t: i } = ve(), _ = A(m.Normal);
|
|
58
|
-
function J(t) {
|
|
59
|
-
_.value = t;
|
|
60
|
-
}
|
|
61
|
-
const f = A(!1), L = (t) => {
|
|
62
|
-
Ae.isBoolean(t) ? f.value = t : f.value = !f.value;
|
|
63
|
-
};
|
|
64
|
-
function E(t) {
|
|
65
|
-
return t.reduce((e, a) => (e[a._id] = [...e[a._id] ?? [], a], e), {});
|
|
66
|
-
}
|
|
67
|
-
const K = s.initialValue, h = A(E(V(K))), M = S(() => Object.values(h.value).flatMap((t) => t)), k = A(
|
|
68
|
-
V(s.linkItemRules)
|
|
69
|
-
), o = A();
|
|
70
|
-
function x() {
|
|
71
|
-
var t;
|
|
72
|
-
return (t = k.value) == null ? void 0 : t.map((e) => ({
|
|
73
|
-
...e,
|
|
74
|
-
restaurantAttributes: Y(e.restaurantAttributes) ? F : P.build(e.restaurantAttributes),
|
|
75
|
-
itemAttributes: Y(e.itemAttributes) ? F : P.build(e.itemAttributes)
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
o.value = x(), D(
|
|
79
|
-
o,
|
|
80
|
-
(t) => {
|
|
81
|
-
k.value = t == null ? void 0 : t.map((e) => ({
|
|
82
|
-
...e,
|
|
83
|
-
restaurantAttributes: C(e.restaurantAttributes) ? null : Q.build(e.restaurantAttributes),
|
|
84
|
-
itemAttributes: C(e.itemAttributes) ? null : Q.build(e.itemAttributes)
|
|
85
|
-
}));
|
|
86
|
-
},
|
|
87
|
-
{ deep: !0 }
|
|
88
|
-
);
|
|
89
|
-
const W = he(
|
|
90
|
-
() => !j.isEqual(E(s.initialValue), h.value) || !j.isEqual(s.linkItemRules, k.value),
|
|
91
|
-
() => {
|
|
92
|
-
f.value = !1;
|
|
93
|
-
}
|
|
94
|
-
);
|
|
95
|
-
function X() {
|
|
96
|
-
_.value === m.Rules ? g("submit", {
|
|
97
|
-
mode: m.Rules,
|
|
98
|
-
linkItemRules: k.value || []
|
|
99
|
-
}) : g("submit", {
|
|
100
|
-
mode: m.Normal,
|
|
101
|
-
items: M.value
|
|
102
|
-
}), f.value = !1;
|
|
103
|
-
}
|
|
104
|
-
D(
|
|
105
|
-
() => f.value,
|
|
106
|
-
() => {
|
|
107
|
-
h.value = E(V(s.initialValue)), k.value = V(s.linkItemRules), o.value = x(), _.value = s.noScheduler && s.linkItemRules && s.linkItemRules.length > 0 ? m.Rules : m.Normal;
|
|
108
|
-
}
|
|
109
|
-
);
|
|
110
|
-
const Z = S(() => {
|
|
111
|
-
const t = ce();
|
|
112
|
-
return Object.values(t).sort((e, a) => a.sortingIndex - e.sortingIndex).map((e) => ({ label: e.label, value: e.value }));
|
|
113
|
-
}), { attributes: ee } = H({
|
|
114
|
-
valueSource: be().restaurants,
|
|
115
|
-
entity: "restaurant"
|
|
116
|
-
}), te = S(() => s.menuItems || []), { attributes: le } = H({
|
|
117
|
-
valueSource: te,
|
|
118
|
-
entity: "item"
|
|
119
|
-
});
|
|
120
|
-
function ae() {
|
|
121
|
-
const t = [
|
|
122
|
-
...o.value || [],
|
|
123
|
-
{
|
|
124
|
-
orderFrom: fe.F_ORDER_FROM.enum.ALL,
|
|
125
|
-
restaurantAttributes: null,
|
|
126
|
-
itemAttributes: null
|
|
127
|
-
}
|
|
128
|
-
];
|
|
129
|
-
o.value = t;
|
|
130
|
-
}
|
|
131
|
-
function se(t) {
|
|
132
|
-
if (!o.value) return;
|
|
133
|
-
const e = [...o.value];
|
|
134
|
-
e.splice(t, 1), o.value = e.length ? e : [];
|
|
135
|
-
}
|
|
136
|
-
function oe(t, e) {
|
|
137
|
-
if (!o.value) return;
|
|
138
|
-
const a = [...o.value];
|
|
139
|
-
C(e) ? a[t].restaurantAttributes = null : a[t].restaurantAttributes = e, o.value = a;
|
|
140
|
-
}
|
|
141
|
-
function ne(t, e) {
|
|
142
|
-
if (!o.value) return;
|
|
143
|
-
const a = [...o.value];
|
|
144
|
-
C(e) ? a[t].itemAttributes = null : a[t].itemAttributes = e, o.value = a;
|
|
145
|
-
}
|
|
146
|
-
const z = S(() => {
|
|
147
|
-
const t = s.isLocalOnly ? ke() : pe();
|
|
148
|
-
return s.noScheduler && t.currentCatalog;
|
|
149
|
-
});
|
|
150
|
-
return (t, e) => {
|
|
151
|
-
const a = R("fm-button"), ue = R("fm-switch"), re = R("FmSelect"), ie = R("FmCard"), me = R("fm-side-sheet");
|
|
152
|
-
return c(), b(O, null, [
|
|
153
|
-
U(t.$slots, "default", { trigger: L }, void 0, !0),
|
|
154
|
-
n(me, {
|
|
155
|
-
id: "group-form",
|
|
156
|
-
modelValue: f.value,
|
|
157
|
-
"onUpdate:modelValue": e[3] || (e[3] = (d) => f.value = d),
|
|
158
|
-
"close-button": t.useCloseBtn,
|
|
159
|
-
"is-container": l(ye).FmForm,
|
|
160
|
-
"is-container-props": {
|
|
161
|
-
onValidationSuccess: X,
|
|
162
|
-
blameFormChildOnValidationFailed: !0
|
|
163
|
-
},
|
|
164
|
-
"max-width": 760,
|
|
165
|
-
"onOn:clickedAway": l(W)
|
|
166
|
-
}, {
|
|
167
|
-
"side-sheet-header": v(() => [
|
|
168
|
-
t.useCloseBtn ? w("", !0) : (c(), N(a, {
|
|
169
|
-
key: 0,
|
|
170
|
-
variant: l(q).Tertiary,
|
|
171
|
-
class: "cursor-pointer mr-4",
|
|
172
|
-
"prepend-icon": "arrow_back",
|
|
173
|
-
onClick: L
|
|
174
|
-
}, null, 8, ["variant"])),
|
|
175
|
-
u("p", Fe, B(t.title || l(i)("menu.link_product.title")), 1),
|
|
176
|
-
z.value ? (c(), b("div", we, [
|
|
177
|
-
u("div", Be, [
|
|
178
|
-
n(ue, {
|
|
179
|
-
label: l(i)("menu.link_product.rules.section_title"),
|
|
180
|
-
"model-value": _.value === l(m).Rules,
|
|
181
|
-
"onUpdate:modelValue": e[0] || (e[0] = (d) => J(d ? l(m).Rules : l(m).Normal))
|
|
182
|
-
}, null, 8, ["label", "model-value"])
|
|
183
|
-
])
|
|
184
|
-
])) : w("", !0)
|
|
185
|
-
]),
|
|
186
|
-
"side-sheet-footer": v(() => [
|
|
187
|
-
u("div", Ue, [
|
|
188
|
-
n(a, {
|
|
189
|
-
label: l(i)("menu.common.actions.confirm"),
|
|
190
|
-
size: "lg",
|
|
191
|
-
type: "submit",
|
|
192
|
-
variant: "primary"
|
|
193
|
-
}, null, 8, ["label"]),
|
|
194
|
-
n(a, {
|
|
195
|
-
label: l(i)("menu.common.actions.cancel"),
|
|
196
|
-
size: "lg",
|
|
197
|
-
variant: "tertiary",
|
|
198
|
-
onClick: e[2] || (e[2] = () => f.value = !1)
|
|
199
|
-
}, null, 8, ["label"])
|
|
200
|
-
])
|
|
201
|
-
]),
|
|
202
|
-
default: v(() => [
|
|
203
|
-
(c(), b("div", {
|
|
204
|
-
class: "py-8 px-8 overflow-y-auto space-y-24",
|
|
205
|
-
key: _.value
|
|
206
|
-
}, [
|
|
207
|
-
_.value === l(m).Normal ? (c(), N(l(_e), {
|
|
208
|
-
key: 0,
|
|
209
|
-
"auto-focus-search": !0,
|
|
210
|
-
"categorized-items": t.categorizedItems,
|
|
211
|
-
data: h.value,
|
|
212
|
-
"select-variant": t.selectVariant,
|
|
213
|
-
"selected-items": M.value,
|
|
214
|
-
"show-variant": t.showVariant,
|
|
215
|
-
"show-addon": t.showAddon,
|
|
216
|
-
"onUpdate:data": e[1] || (e[1] = (d) => h.value = d)
|
|
217
|
-
}, null, 8, ["categorized-items", "data", "select-variant", "selected-items", "show-variant", "show-addon"])) : z.value ? (c(), b(O, { key: 1 }, [
|
|
218
|
-
u("p", Ee, B(l(i)("menu.link_product.rules.hint")), 1),
|
|
219
|
-
(c(!0), b(O, null, de(o.value, (d, I) => (c(), N(ie, {
|
|
220
|
-
key: I,
|
|
221
|
-
class: "p-16 space-y-16",
|
|
222
|
-
variant: "outlined"
|
|
223
|
-
}, {
|
|
224
|
-
default: v(() => [
|
|
225
|
-
u("div", Oe, [
|
|
226
|
-
u("div", null, [
|
|
227
|
-
n($, {
|
|
228
|
-
label: l(i)("menu.link_product.rules.order_from")
|
|
229
|
-
}, {
|
|
230
|
-
default: v(() => [
|
|
231
|
-
n(re, {
|
|
232
|
-
items: Z.value,
|
|
233
|
-
"model-value": d.orderFrom,
|
|
234
|
-
"onUpdate:modelValue": (y) => d.orderFrom = y
|
|
235
|
-
}, null, 8, ["items", "model-value", "onUpdate:modelValue"])
|
|
236
|
-
]),
|
|
237
|
-
_: 2
|
|
238
|
-
}, 1032, ["label"])
|
|
239
|
-
]),
|
|
240
|
-
u("div", Ne, [
|
|
241
|
-
n($, {
|
|
242
|
-
label: l(i)("menu.link_product.rules.restaurant_filter")
|
|
243
|
-
}, {
|
|
244
|
-
default: v(() => [
|
|
245
|
-
n(l(T), {
|
|
246
|
-
attributes: l(ee),
|
|
247
|
-
"model-value": d.restaurantAttributes || l(F),
|
|
248
|
-
"onUpdate:modelValue": (y) => oe(I, y)
|
|
249
|
-
}, null, 8, ["attributes", "model-value", "onUpdate:modelValue"])
|
|
250
|
-
]),
|
|
251
|
-
_: 2
|
|
252
|
-
}, 1032, ["label"]),
|
|
253
|
-
n($, {
|
|
254
|
-
label: l(i)("menu.link_product.rules.item_filter")
|
|
255
|
-
}, {
|
|
256
|
-
default: v(() => [
|
|
257
|
-
n(l(T), {
|
|
258
|
-
attributes: l(le),
|
|
259
|
-
"model-value": d.itemAttributes || l(F),
|
|
260
|
-
"onUpdate:modelValue": (y) => ne(I, y)
|
|
261
|
-
}, null, 8, ["attributes", "model-value", "onUpdate:modelValue"])
|
|
262
|
-
]),
|
|
263
|
-
_: 2
|
|
264
|
-
}, 1032, ["label"])
|
|
265
|
-
])
|
|
266
|
-
]),
|
|
267
|
-
u("div", $e, [
|
|
268
|
-
n(a, {
|
|
269
|
-
variant: l(q).Tertiary,
|
|
270
|
-
"prepend-icon": "delete",
|
|
271
|
-
onClick: (y) => se(I)
|
|
272
|
-
}, null, 8, ["variant", "onClick"])
|
|
273
|
-
])
|
|
274
|
-
]),
|
|
275
|
-
_: 2
|
|
276
|
-
}, 1024))), 128)),
|
|
277
|
-
u("div", null, [
|
|
278
|
-
n(a, {
|
|
279
|
-
label: l(i)("menu.link_product.rules.add_rule"),
|
|
280
|
-
onClick: ae
|
|
281
|
-
}, null, 8, ["label"])
|
|
282
|
-
])
|
|
283
|
-
], 64)) : w("", !0)
|
|
284
|
-
]))
|
|
285
|
-
]),
|
|
286
|
-
_: 1
|
|
287
|
-
}, 8, ["modelValue", "close-button", "is-container", "is-container-props", "onOn:clickedAway"])
|
|
288
|
-
], 64);
|
|
289
|
-
};
|
|
290
|
-
}
|
|
291
|
-
}), He = /* @__PURE__ */ Re(Le, [["__scopeId", "data-v-97fa9d58"]]);
|
|
292
|
-
export {
|
|
293
|
-
He as L,
|
|
294
|
-
Re as _,
|
|
295
|
-
$ as a,
|
|
296
|
-
m as b
|
|
297
|
-
};
|