@feedmepos/mf-menu 0.32.7-beta.2 → 0.32.7-dev
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-BIQ0CTci.js → App-DCkQc7e4.js} +98 -98
- package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-uzmq3vwy.js +161 -0
- package/dist/BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-DhrXKy3b.js +74 -0
- package/dist/{Catalog-D2wc24o8.js → Catalog-CUPoRid3.js} +9 -9
- package/dist/{Category-DA5-55d2.js → Category-BkvhZ57Y.js} +7 -7
- package/dist/{Category-BPufryqK.js → Category-Cdw0ikhP.js} +4 -4
- package/dist/{CookingGuide-DKvou40e.js → CookingGuide-BZ-4oULM.js} +6 -6
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DHoAYdGI.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CJvVFWdR.js} +3 -3
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js +26 -0
- package/dist/{Group-D60oAvmM.js → Group-C1FaXdUb.js} +1 -1
- package/dist/{Group-Bgpc6qE1.js → Group-Cec83DWm.js} +4 -4
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BXn3--BL.js → Group.vue_vue_type_script_setup_true_lang-2_lLBdX2.js} +128 -128
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BD9IZkwW.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BEDyKWhK.js} +91 -91
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-BE3LdBYY.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-BteTvMnx.js} +3225 -3225
- package/dist/{Ingredient-Brv4hml-.js → Ingredient-DulL8h2B.js} +29 -29
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CIOX-pq1.js → InventoryBinding.vue_vue_type_script_setup_true_lang-DoBx7Dal.js} +104 -104
- package/dist/{LinkProductSideSheet-BDMbKJ8o.js → LinkProductSideSheet-Br2eE8pC.js} +251 -251
- package/dist/MenuSelector.vue_vue_type_script_setup_true_lang-K6Z0QJBl.js +69 -0
- package/dist/{MenuSetting-DvCu23my.js → MenuSetting-DxW4LCW4.js} +77 -77
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-vFqWGM6P.js → PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js} +8 -8
- package/dist/{PrintRoute-DwgLKDUV.js → PrintRoute-Da6Zkx-0.js} +5 -5
- package/dist/{Product-EmoWM778.js → Product-Cs76t18_.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-5HyO_RYw.js → Product.vue_vue_type_script_setup_true_lang-C6SOu4Vv.js} +606 -606
- package/dist/{ProductInternalTools-PqzouaF2.js → ProductInternalTools-DPbeRvTM.js} +10 -10
- package/dist/{Products-ZgfTT9dI.js → Products--7dGfuuT.js} +52 -52
- package/dist/{Publish-CUdRwmN1.js → Publish-COmZtiyX.js} +5 -5
- package/dist/{Recipe-BRUxyire.js → Recipe-BaN_1zrP.js} +5 -5
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-CPFGkaTr.js → RuleView.vue_vue_type_script_setup_true_lang-DputprQj.js} +451 -448
- package/dist/{Scheduler-BXdZh-xC.js → Scheduler-BSUpIAaK.js} +4 -4
- package/dist/{ServingSequence-EAZHOHiy.js → ServingSequence-dXBb7e5d.js} +4 -4
- package/dist/{Setting-BRut_Xj0.js → Setting-CalEQW0n.js} +6 -6
- package/dist/{Subcategory-D6Yrs-vO.js → Subcategory-zPHtX7Vc.js} +5 -5
- package/dist/{Takeaway-Bi8JfDWa.js → Takeaway-CRDj2Bpe.js} +5 -5
- package/dist/{Takeaway-CRdlNTu7.js → Takeaway-CcnmeTmu.js} +1 -1
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-DKQZ9J8Z.js → Takeaway.vue_vue_type_script_setup_true_lang-Cj7vyOaP.js} +5 -5
- package/dist/{TextChip.vue_vue_type_script_setup_true_lang-BJMcI3U2.js → TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js} +5 -5
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-DDWk-WUW.js → Thumbnail.vue_vue_type_script_setup_true_lang-B0552qsN.js} +74 -74
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-BwnyIDNH.js +6038 -0
- package/dist/{Unit-Ccs_k5IS.js → Unit-C7-Oj5S3.js} +3 -3
- package/dist/{Variant-BHmgMXq7.js → Variant-CYiMkE0q.js} +4 -4
- package/dist/{_id_-DSSoi4Gy.js → _id_-D75ZcNlf.js} +11 -11
- package/dist/{app-CzXxFrl1.js → app-5fxKLAzS.js} +447 -447
- package/dist/{app-C8Dm2-h4.js → app-BhLVpUSl.js} +35 -35
- package/dist/{app-B9seAt5l.js → app-DzVMOviz.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/app.d.ts +20 -0
- package/dist/apps/mf-menu/src/components/feature/CategoryManager/CategoriesSelector.vue.d.ts +1 -1
- package/dist/apps/mf-menu/src/components/feature/MenuSelector.vue.d.ts +1 -1
- package/dist/apps/mf-menu/src/components/feature/SubcategoryManager/SubcategorySelector.vue.d.ts +1 -1
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +2 -1
- package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/linked-status-BoIPm5hC.js +13 -0
- package/dist/assets/override-menu-DfTrwWpR.js +13 -0
- package/dist/assets/validate-menu-BhWvQ3T9.js +13 -0
- package/dist/{catalog-CD-fdGdY.js → catalog-CudNSsIP.js} +1 -1
- package/dist/{catalogSetting-Ci85lXor.js → catalogSetting-BVHO9tK3.js} +1 -1
- package/dist/{category-6NAH0dUF.js → category-BQpgz1lk.js} +1 -1
- package/dist/{currency-BP_z7R5d.js → currency-BfS7H2KE.js} +1 -1
- package/dist/{index-BLMijxTj.js → index-BHdPJta4.js} +91 -91
- package/dist/{index-C1XCbqC-.js → index-DmGJvREM.js} +56 -56
- package/dist/{index-Cftm4-G_.js → index-DuLXS699.js} +5 -5
- package/dist/{index-DgDQzkPR.js → index-aaoziUNI.js} +30 -30
- package/dist/{index.vue_vue_type_script_setup_true_lang-D-k9WcQV.js → index.vue_vue_type_script_setup_true_lang-Dje9kp-F.js} +40026 -40153
- package/dist/item-BtKW0wdj.js +7685 -0
- package/dist/{iteration-ZG64Re91.js → iteration-CaliNodx.js} +1 -1
- package/dist/{jszip.min-BETdv0rh.js → jszip.min-DXbkmgRD.js} +102 -102
- package/dist/{menu-COMXycAe.js → menu-D-lUEuvX.js} +1 -1
- package/dist/{menuV2-CeRS0Jw3.js → menuV2-D-6O36DO.js} +357 -348
- package/dist/mf-menu.css +1 -1
- package/dist/packages/shared/src/components/form/SelectFilter.vue.d.ts +1 -1
- package/dist/{priceTier-t2T3Q87F.js → priceTier-DKnYaOA9.js} +1 -1
- package/dist/{scheduler-BbJUVuiK.js → scheduler-DEwfbYPL.js} +7 -7
- package/dist/{subcategory-61kOQh4g.js → subcategory-CQKklgcd.js} +2 -2
- package/dist/{toExcel-DIYaK18-.js → toExcel-CRwL-QqF.js} +2 -2
- package/dist/{unit-B6StucsI.js → unit-BzM1rmN7.js} +151 -151
- package/dist/{vuedraggable-DnBIRDMr.js → vuedraggable-CK8z7qA8.js} +2 -2
- package/package.json +3 -2
- package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-BpEjqhAC.js +0 -161
- package/dist/BottomSheetMenuItem.vue_vue_type_script_setup_true_lang-CnCoRLDg.js +0 -74
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-B3Ixruh-.js +0 -26
- package/dist/MenuSelector.vue_vue_type_script_setup_true_lang-Bm_hSelC.js +0 -69
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-JdHaBpaX.js +0 -5997
- package/dist/assets/linked-status-Cuf8X8_g.js +0 -13
- package/dist/assets/override-menu-yxQLf82k.js +0 -13
- package/dist/assets/validate-menu-BwbenBs6.js +0 -13
- package/dist/item-ByEPWjef.js +0 -6819
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import { createElementBlock as b, openBlock as i, createElementVNode as F, defineComponent as ae, ref as k, computed as z, resolveComponent as
|
|
2
|
-
import { u as le, z as ue, H as ee, a3 as ve, I as ie } from "./index.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { createElementBlock as b, openBlock as i, createElementVNode as F, defineComponent as ae, ref as k, computed as z, resolveComponent as x, createBlock as U, unref as u, withCtx as B, createVNode as y, toDisplayString as T, Fragment as j, renderList as X, createCommentVNode as Y, withModifiers as oe, watch as re, renderSlot as pe } from "vue";
|
|
2
|
+
import { u as le, z as ue, H as ee, a3 as ve, I as ie } from "./index.vue_vue_type_script_setup_true_lang-Dje9kp-F.js";
|
|
3
3
|
import { useI18n as se, ItemSelector as fe } from "@feedmepos/mf-common";
|
|
4
4
|
import { components as de, FmButtonVariant as Z } from "@feedmepos/ui-library";
|
|
5
5
|
import { u as _e } from "./discardConfirm-BHni0LNu.js";
|
|
6
|
-
import { u as ye } from "./menuV2-
|
|
7
|
-
import { m as O, g as Re, h as be, b as ge, u as he, f as te } from "./RuleView.vue_vue_type_script_setup_true_lang-
|
|
6
|
+
import { u as ye } from "./menuV2-D-6O36DO.js";
|
|
7
|
+
import { m as O, g as Re, h as be, b as ge, u as he, f as te } from "./RuleView.vue_vue_type_script_setup_true_lang-DputprQj.js";
|
|
8
8
|
import { c as Ce } from "./check-C9mY6LiX.js";
|
|
9
9
|
/* empty css */
|
|
10
|
-
const ce = (
|
|
11
|
-
const o =
|
|
12
|
-
for (const [D,
|
|
13
|
-
o[D] =
|
|
10
|
+
const ce = (R, L) => {
|
|
11
|
+
const o = R.__vccOpts || R;
|
|
12
|
+
for (const [D, d] of L)
|
|
13
|
+
o[D] = d;
|
|
14
14
|
return o;
|
|
15
15
|
}, ke = {};
|
|
16
|
-
function Ae(
|
|
17
|
-
return i(), b("div", null,
|
|
16
|
+
function Ae(R, L) {
|
|
17
|
+
return i(), b("div", null, L[0] || (L[0] = [
|
|
18
18
|
F("div", { class: "h-px w-full bg-fm-color-neutral-gray-100" }, null, -1)
|
|
19
|
-
])
|
|
19
|
+
]));
|
|
20
20
|
}
|
|
21
|
-
const Fe = /* @__PURE__ */ ce(ke, [["render", Ae]])
|
|
22
|
-
var M = /* @__PURE__ */ ((m) => (m[m.Normal = 0] = "Normal", m[m.Rules = 1] = "Rules", m))(M || {});
|
|
23
|
-
const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1 }, Ve = { class: "flex flex-col gap-24 h-full" }, $e = { class: "flex flex-col gap-24 overflow-y-auto flex-1" }, Se = { class: "flex flex-col gap-16" }, Ne = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, Ge = { class: "flex justify-between" }, Oe = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-lg-600" }, De = { key: 0 }, Me = {
|
|
21
|
+
const Fe = /* @__PURE__ */ ce(ke, [["render", Ae]]), Ie = { class: "flex items-center gap-24" }, we = { key: 0 }, Ve = { key: 1 }, xe = { class: "flex flex-col gap-24 h-full" }, $e = { class: "flex flex-col gap-24 overflow-y-auto flex-1" }, Se = { class: "flex flex-col gap-16" }, Ne = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, Ge = { class: "flex justify-between" }, Oe = { class: "text-fm-color-neutral-gray-400 fm-typo-en-body-lg-600" }, De = { key: 0 }, Me = {
|
|
24
22
|
key: 0,
|
|
25
23
|
class: "text-fm-color-neutral-gray-300 p-16 ml-16"
|
|
26
24
|
}, Be = { class: "flex justify-end gap-16" }, Le = /* @__PURE__ */ ae({
|
|
@@ -48,13 +46,13 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
48
46
|
}
|
|
49
47
|
},
|
|
50
48
|
emits: ["update:modelValue", "close-form"],
|
|
51
|
-
setup(
|
|
52
|
-
const { t: o } = se(), D =
|
|
49
|
+
setup(R, { emit: L }) {
|
|
50
|
+
const { t: o } = se(), D = R, d = k(!0), $ = L, q = k(D.orderFrom), g = k(""), C = k(
|
|
53
51
|
D.existingRuleGroups.reduce(
|
|
54
52
|
(r, s) => (r[s.id] = !0, r),
|
|
55
53
|
{}
|
|
56
54
|
)
|
|
57
|
-
),
|
|
55
|
+
), w = k({}), P = z(
|
|
58
56
|
() => {
|
|
59
57
|
var r;
|
|
60
58
|
return (((r = le().state.menu.ruleGroupSettings) == null ? void 0 : r.groups) || []).map((s) => ({
|
|
@@ -62,81 +60,81 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
62
60
|
value: s._id
|
|
63
61
|
}));
|
|
64
62
|
}
|
|
65
|
-
),
|
|
63
|
+
), V = z(() => {
|
|
66
64
|
const r = P.value;
|
|
67
65
|
if (g.value) {
|
|
68
|
-
const s = g.value.toLowerCase(), n = r.filter((a) => C.value[a.value]),
|
|
66
|
+
const s = g.value.toLowerCase(), n = r.filter((a) => C.value[a.value]), v = r.filter(
|
|
69
67
|
(a) => !C.value[a.value] && a.label.toLowerCase().includes(s)
|
|
70
68
|
);
|
|
71
|
-
return [...n, ...
|
|
69
|
+
return [...n, ...v];
|
|
72
70
|
}
|
|
73
71
|
return r.sort((s, n) => {
|
|
74
|
-
const
|
|
75
|
-
return
|
|
72
|
+
const v = C.value[s.value] || !1, a = C.value[n.value] || !1;
|
|
73
|
+
return v && !a ? -1 : !v && a ? 1 : 0;
|
|
76
74
|
});
|
|
77
75
|
}), J = z(() => {
|
|
78
76
|
var n;
|
|
79
|
-
const r = Object.entries(C.value).filter(([
|
|
80
|
-
return r.map((
|
|
81
|
-
const a = s.find((
|
|
77
|
+
const r = Object.entries(C.value).filter(([v, a]) => a).map(([v]) => v), s = ((n = le().state.menu.ruleGroupSettings) == null ? void 0 : n.groups) || [];
|
|
78
|
+
return r.map((v) => {
|
|
79
|
+
const a = s.find((p) => p._id === v);
|
|
82
80
|
return {
|
|
83
81
|
...a,
|
|
84
|
-
rules: (a == null ? void 0 : a.rules.map((
|
|
85
|
-
var A, S, N,
|
|
82
|
+
rules: (a == null ? void 0 : a.rules.map((p) => {
|
|
83
|
+
var A, S, N, _;
|
|
86
84
|
return {
|
|
87
|
-
...
|
|
88
|
-
_id:
|
|
85
|
+
...p,
|
|
86
|
+
_id: p._id,
|
|
89
87
|
restaurantRule: {
|
|
90
88
|
restaurantAttributes: O(
|
|
91
|
-
(A =
|
|
89
|
+
(A = p.restaurantRule) == null ? void 0 : A.restaurantAttributes
|
|
92
90
|
),
|
|
93
91
|
restaurantCustomAttributes: O(
|
|
94
|
-
(S =
|
|
92
|
+
(S = p.restaurantRule) == null ? void 0 : S.restaurantCustomAttributes
|
|
95
93
|
)
|
|
96
94
|
},
|
|
97
95
|
itemRule: {
|
|
98
96
|
itemAttributes: D.convertCategoryIdToName(
|
|
99
|
-
O((N =
|
|
97
|
+
O((N = p.itemRule) == null ? void 0 : N.itemAttributes)
|
|
100
98
|
),
|
|
101
|
-
itemCustomAttributes: O((
|
|
99
|
+
itemCustomAttributes: O((_ = p.itemRule) == null ? void 0 : _.itemCustomAttributes)
|
|
102
100
|
}
|
|
103
101
|
};
|
|
104
102
|
})) || []
|
|
105
103
|
};
|
|
106
|
-
}).filter((
|
|
107
|
-
}),
|
|
104
|
+
}).filter((v) => v !== null);
|
|
105
|
+
}), c = k([]);
|
|
108
106
|
function h(r) {
|
|
109
|
-
var
|
|
110
|
-
const s = ((
|
|
107
|
+
var p, A, S, N;
|
|
108
|
+
const s = ((p = r.restaurantRule) == null ? void 0 : p.restaurantAttributes.rules) ?? [], n = ((A = r.restaurantRule) == null ? void 0 : A.restaurantCustomAttributes.rules) ?? [], v = ((S = r.itemRule) == null ? void 0 : S.itemAttributes.rules) ?? [], a = ((N = r.itemRule) == null ? void 0 : N.itemCustomAttributes.rules) ?? [];
|
|
111
109
|
return [
|
|
112
|
-
...s.map((
|
|
113
|
-
...
|
|
114
|
-
property: `${o("menu.catalog.usage.restaurant")} ${
|
|
110
|
+
...s.map((_) => ({
|
|
111
|
+
..._,
|
|
112
|
+
property: `${o("menu.catalog.usage.restaurant")} ${_.property}`
|
|
115
113
|
})),
|
|
116
|
-
...n.map((
|
|
117
|
-
...
|
|
118
|
-
property: `${o("menu.catalog.usage.restaurant")} ${
|
|
114
|
+
...n.map((_) => ({
|
|
115
|
+
..._,
|
|
116
|
+
property: `${o("menu.catalog.usage.restaurant")} ${_.property}`
|
|
119
117
|
})),
|
|
120
|
-
...
|
|
121
|
-
...
|
|
122
|
-
property: `${o("menu.product.title")} ${
|
|
118
|
+
...v.map((_) => ({
|
|
119
|
+
..._,
|
|
120
|
+
property: `${o("menu.product.title")} ${_.property}`
|
|
123
121
|
})),
|
|
124
|
-
...a.map((
|
|
125
|
-
...
|
|
126
|
-
property: `${o("menu.product.title")} ${
|
|
122
|
+
...a.map((_) => ({
|
|
123
|
+
..._,
|
|
124
|
+
property: `${o("menu.product.title")} ${_.property}`
|
|
127
125
|
}))
|
|
128
126
|
];
|
|
129
127
|
}
|
|
130
|
-
function
|
|
131
|
-
var A, S, N,
|
|
132
|
-
const r = D.groupCustomRule, s = Object.entries(C.value).filter(([e, G]) => G).map(([e]) => e), n = [],
|
|
133
|
-
|
|
128
|
+
function I() {
|
|
129
|
+
var A, S, N, _, W, m, t, l;
|
|
130
|
+
const r = D.groupCustomRule, s = Object.entries(C.value).filter(([e, G]) => G).map(([e]) => e), n = [], v = [], a = [], p = [];
|
|
131
|
+
c.value.length > 0 && (c.value.forEach((e) => {
|
|
134
132
|
e.property.startsWith("restaurant_attr") ? n.push({
|
|
135
133
|
property: e.property.replace("restaurant_attr_", ""),
|
|
136
134
|
operator: e.operator,
|
|
137
135
|
value: e.value,
|
|
138
136
|
type: e.type
|
|
139
|
-
}) : e.property.startsWith("restaurant_custom") ?
|
|
137
|
+
}) : e.property.startsWith("restaurant_custom") ? v.push({
|
|
140
138
|
property: e.property.replace("restaurant_custom_", ""),
|
|
141
139
|
operator: e.operator,
|
|
142
140
|
value: e.value,
|
|
@@ -146,7 +144,7 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
146
144
|
operator: e.operator,
|
|
147
145
|
value: e.value,
|
|
148
146
|
type: e.type
|
|
149
|
-
}) : e.property.startsWith("item_custom") &&
|
|
147
|
+
}) : e.property.startsWith("item_custom") && p.push({
|
|
150
148
|
property: e.property.replace("item_custom_", ""),
|
|
151
149
|
operator: e.operator,
|
|
152
150
|
value: e.value,
|
|
@@ -158,157 +156,157 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
158
156
|
rules: n
|
|
159
157
|
},
|
|
160
158
|
restaurantCustomAttributes: {
|
|
161
|
-
logic: ((
|
|
162
|
-
rules:
|
|
159
|
+
logic: ((_ = (N = r.restaurantRule) == null ? void 0 : N.restaurantCustomAttributes) == null ? void 0 : _.logic) ?? "AND",
|
|
160
|
+
rules: v
|
|
163
161
|
}
|
|
164
162
|
}, r.itemRule = {
|
|
165
163
|
itemAttributes: {
|
|
166
|
-
logic: ((
|
|
164
|
+
logic: ((m = (W = r.itemRule) == null ? void 0 : W.itemAttributes) == null ? void 0 : m.logic) ?? "AND",
|
|
167
165
|
rules: a
|
|
168
166
|
},
|
|
169
167
|
itemCustomAttributes: {
|
|
170
|
-
logic: ((
|
|
171
|
-
rules:
|
|
168
|
+
logic: ((l = (t = r.itemRule) == null ? void 0 : t.itemCustomAttributes) == null ? void 0 : l.logic) ?? "AND",
|
|
169
|
+
rules: p
|
|
172
170
|
}
|
|
173
171
|
}), $("update:modelValue", {
|
|
174
172
|
orderFrom: q.value,
|
|
175
173
|
ruleGroupIds: s,
|
|
176
174
|
restaurantRule: r.restaurantRule,
|
|
177
175
|
itemRule: r.itemRule
|
|
178
|
-
}),
|
|
176
|
+
}), f();
|
|
179
177
|
}
|
|
180
|
-
function
|
|
181
|
-
|
|
178
|
+
function f() {
|
|
179
|
+
d.value = !1, $("close-form");
|
|
182
180
|
}
|
|
183
181
|
return (r, s) => {
|
|
184
|
-
const n =
|
|
182
|
+
const n = x("FmButton"), v = x("FmRadio"), a = x("FmRadioGroup"), p = x("FmIcon"), A = x("FmCard"), S = x("FmSearch"), N = x("FmMenuItem"), _ = x("FmMenu"), W = x("FmSideSheet");
|
|
185
183
|
return i(), U(W, {
|
|
186
|
-
modelValue:
|
|
187
|
-
"onUpdate:modelValue": s[3] || (s[3] = (
|
|
184
|
+
modelValue: d.value,
|
|
185
|
+
"onUpdate:modelValue": s[3] || (s[3] = (m) => d.value = m),
|
|
188
186
|
"max-width": 760,
|
|
189
187
|
"close-button": !1,
|
|
190
|
-
"is-container":
|
|
188
|
+
"is-container": u(de).FmForm,
|
|
191
189
|
"is-container-props": {
|
|
192
|
-
onValidationSuccess:
|
|
190
|
+
onValidationSuccess: I,
|
|
193
191
|
blameFormChildOnValidationFailed: !0
|
|
194
192
|
}
|
|
195
193
|
}, {
|
|
196
194
|
"side-sheet-header": B(() => [
|
|
197
|
-
F("div",
|
|
198
|
-
|
|
199
|
-
variant:
|
|
195
|
+
F("div", Ie, [
|
|
196
|
+
y(n, {
|
|
197
|
+
variant: u(Z).Tertiary,
|
|
200
198
|
"prepend-icon": "arrow_back",
|
|
201
|
-
onClick: oe(
|
|
199
|
+
onClick: oe(f, ["stop"])
|
|
202
200
|
}, null, 8, ["variant"]),
|
|
203
|
-
|
|
201
|
+
R.isEditMode ? (i(), b("p", we, T(u(o)("menu.link_product.rules.edit_rule")), 1)) : (i(), b("p", Ve, T(u(o)("menu.link_product.rules.add_rule")), 1))
|
|
204
202
|
])
|
|
205
203
|
]),
|
|
206
204
|
"side-sheet-footer": B(() => [
|
|
207
205
|
F("div", Be, [
|
|
208
|
-
|
|
209
|
-
variant:
|
|
210
|
-
label:
|
|
211
|
-
onClick: oe(
|
|
206
|
+
y(n, {
|
|
207
|
+
variant: u(Z).Secondary,
|
|
208
|
+
label: u(o)("common.cancel"),
|
|
209
|
+
onClick: oe(f, ["stop"])
|
|
212
210
|
}, null, 8, ["variant", "label"]),
|
|
213
|
-
|
|
214
|
-
variant:
|
|
215
|
-
label:
|
|
211
|
+
y(n, {
|
|
212
|
+
variant: u(Z).Primary,
|
|
213
|
+
label: u(o)("common.save"),
|
|
216
214
|
type: "submit"
|
|
217
215
|
}, null, 8, ["variant", "label"])
|
|
218
216
|
])
|
|
219
217
|
]),
|
|
220
218
|
default: B(() => [
|
|
221
|
-
F("div",
|
|
222
|
-
|
|
219
|
+
F("div", xe, [
|
|
220
|
+
y(a, {
|
|
223
221
|
modelValue: q.value,
|
|
224
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
225
|
-
label:
|
|
222
|
+
"onUpdate:modelValue": s[0] || (s[0] = (m) => q.value = m),
|
|
223
|
+
label: u(o)("menu.link_product.rules.availability")
|
|
226
224
|
}, {
|
|
227
225
|
default: B(() => [
|
|
228
|
-
|
|
226
|
+
y(v, {
|
|
229
227
|
label: "All",
|
|
230
|
-
value:
|
|
228
|
+
value: u(ue.F_ORDER_FROM).Enum.ALL
|
|
231
229
|
}, null, 8, ["value"]),
|
|
232
|
-
|
|
230
|
+
y(v, {
|
|
233
231
|
label: "POS Only",
|
|
234
|
-
value:
|
|
232
|
+
value: u(ue.F_ORDER_FROM).Enum.POS_ONLY
|
|
235
233
|
}, null, 8, ["value"]),
|
|
236
|
-
|
|
234
|
+
y(v, {
|
|
237
235
|
label: "None",
|
|
238
|
-
value:
|
|
236
|
+
value: u(ue.F_ORDER_FROM).Enum.NONE
|
|
239
237
|
}, null, 8, ["value"])
|
|
240
238
|
]),
|
|
241
239
|
_: 1
|
|
242
240
|
}, 8, ["modelValue", "label"]),
|
|
243
|
-
|
|
241
|
+
y(Fe),
|
|
244
242
|
F("div", $e, [
|
|
245
243
|
F("div", Se, [
|
|
246
|
-
F("p", Ne, T(
|
|
247
|
-
(i(!0), b(j, null, X(J.value, (
|
|
248
|
-
key:
|
|
244
|
+
F("p", Ne, T(u(o)("menu.link_product.rules.use_rule_group")), 1),
|
|
245
|
+
(i(!0), b(j, null, X(J.value, (m) => (i(), b("div", {
|
|
246
|
+
key: m._id
|
|
249
247
|
}, [
|
|
250
|
-
|
|
248
|
+
y(A, {
|
|
251
249
|
variant: "outlined",
|
|
252
250
|
class: "p-24 gap-24 space-y-16"
|
|
253
251
|
}, {
|
|
254
252
|
default: B(() => [
|
|
255
253
|
F("div", Ge, [
|
|
256
|
-
F("p", Oe, T(
|
|
257
|
-
|
|
258
|
-
name:
|
|
259
|
-
onClick: oe((
|
|
254
|
+
F("p", Oe, T(m.name), 1),
|
|
255
|
+
y(p, {
|
|
256
|
+
name: w.value[m._id] ? "expand_less" : "expand_more",
|
|
257
|
+
onClick: oe((t) => w.value[m._id] = !w.value[m._id], ["stop", "prevent"])
|
|
260
258
|
}, null, 8, ["name", "onClick"])
|
|
261
259
|
]),
|
|
262
|
-
|
|
263
|
-
(i(!0), b(j, null, X(
|
|
264
|
-
key:
|
|
260
|
+
w.value[m._id] ? (i(), b("div", De, [
|
|
261
|
+
(i(!0), b(j, null, X(m.rules, (t, l) => (i(), b("div", {
|
|
262
|
+
key: t._id
|
|
265
263
|
}, [
|
|
266
|
-
(i(!0), b(j, null, X(h(
|
|
264
|
+
(i(!0), b(j, null, X(h(t), (e, G) => (i(), U(Re, {
|
|
267
265
|
key: G,
|
|
268
266
|
number: G + 1,
|
|
269
267
|
property: e.property,
|
|
270
268
|
operator: e.operator,
|
|
271
269
|
value: e.value
|
|
272
270
|
}, null, 8, ["number", "property", "operator", "value"]))), 128)),
|
|
273
|
-
|
|
271
|
+
l < m.rules.length - 1 ? (i(), b("p", Me, T(u(o)("menu.link_product.rules.or")), 1)) : Y("", !0)
|
|
274
272
|
]))), 128))
|
|
275
273
|
])) : Y("", !0)
|
|
276
274
|
]),
|
|
277
275
|
_: 2
|
|
278
276
|
}, 1024)
|
|
279
277
|
]))), 128)),
|
|
280
|
-
|
|
278
|
+
y(_, { "close-on-click": !1 }, {
|
|
281
279
|
"menu-button": B(() => [
|
|
282
|
-
|
|
283
|
-
variant:
|
|
280
|
+
y(n, {
|
|
281
|
+
variant: u(Z).Plain,
|
|
284
282
|
"prepend-icon": "add",
|
|
285
|
-
label:
|
|
283
|
+
label: u(o)("menu.link_product.rules.add_rule_group")
|
|
286
284
|
}, null, 8, ["variant", "label"])
|
|
287
285
|
]),
|
|
288
286
|
default: B(() => [
|
|
289
|
-
|
|
287
|
+
y(S, {
|
|
290
288
|
"model-value": g.value,
|
|
291
|
-
"onUpdate:modelValue": s[1] || (s[1] = (
|
|
289
|
+
"onUpdate:modelValue": s[1] || (s[1] = (m) => g.value = m),
|
|
292
290
|
class: "w-[200px]",
|
|
293
|
-
placeholder:
|
|
291
|
+
placeholder: u(o)("menu.link_product.rules.filter_result")
|
|
294
292
|
}, null, 8, ["model-value", "placeholder"]),
|
|
295
|
-
(i(!0), b(j, null, X(
|
|
296
|
-
key:
|
|
297
|
-
label:
|
|
293
|
+
(i(!0), b(j, null, X(V.value, (m) => (i(), U(N, {
|
|
294
|
+
key: m.value,
|
|
295
|
+
label: m.label,
|
|
298
296
|
"has-checkbox": "",
|
|
299
|
-
"model-value": C.value[
|
|
297
|
+
"model-value": C.value[m.value],
|
|
300
298
|
onClick: () => {
|
|
301
|
-
C.value[
|
|
299
|
+
C.value[m.value] = !C.value[m.value];
|
|
302
300
|
}
|
|
303
301
|
}, null, 8, ["label", "model-value", "onClick"]))), 128))
|
|
304
302
|
]),
|
|
305
303
|
_: 1
|
|
306
304
|
})
|
|
307
305
|
]),
|
|
308
|
-
|
|
309
|
-
"model-value":
|
|
310
|
-
"onUpdate:modelValue": s[2] || (s[2] = (
|
|
311
|
-
|
|
306
|
+
y(be, {
|
|
307
|
+
"model-value": R.groupCustomRule,
|
|
308
|
+
"onUpdate:modelValue": s[2] || (s[2] = (m) => {
|
|
309
|
+
c.value = m;
|
|
312
310
|
})
|
|
313
311
|
}, null, 8, ["model-value"])
|
|
314
312
|
])
|
|
@@ -343,33 +341,33 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
343
341
|
}
|
|
344
342
|
},
|
|
345
343
|
emits: ["update:model-value", "delete-rule"],
|
|
346
|
-
setup(
|
|
344
|
+
setup(R, {
|
|
347
345
|
expose: L,
|
|
348
346
|
emit: o
|
|
349
347
|
}) {
|
|
350
348
|
const {
|
|
351
349
|
t: D
|
|
352
|
-
} = se(),
|
|
353
|
-
var
|
|
354
|
-
return ((
|
|
350
|
+
} = se(), d = R, $ = o, q = z(() => {
|
|
351
|
+
var c;
|
|
352
|
+
return ((c = le().state.menu.ruleGroupSettings) == null ? void 0 : c.groups) || [];
|
|
355
353
|
});
|
|
356
|
-
function g(
|
|
357
|
-
return
|
|
354
|
+
function g(c) {
|
|
355
|
+
return c.flatMap((h) => {
|
|
358
356
|
var r, s;
|
|
359
|
-
const
|
|
357
|
+
const I = ((r = q.value.find((n) => n._id === h)) == null ? void 0 : r.rules) || [], f = ((s = q.value.find((n) => n._id === h)) == null ? void 0 : s.name) || "";
|
|
360
358
|
return {
|
|
361
359
|
id: h,
|
|
362
|
-
name:
|
|
363
|
-
rules:
|
|
364
|
-
var
|
|
360
|
+
name: f,
|
|
361
|
+
rules: I.map((n) => {
|
|
362
|
+
var v, a, p, A;
|
|
365
363
|
return {
|
|
366
364
|
...n,
|
|
367
365
|
restaurantRule: {
|
|
368
|
-
restaurantAttributes: O((
|
|
366
|
+
restaurantAttributes: O((v = n.restaurantRule) == null ? void 0 : v.restaurantAttributes),
|
|
369
367
|
restaurantCustomAttributes: O((a = n.restaurantRule) == null ? void 0 : a.restaurantCustomAttributes)
|
|
370
368
|
},
|
|
371
369
|
itemRule: {
|
|
372
|
-
itemAttributes:
|
|
370
|
+
itemAttributes: d.convertCategoryIdToName(O((p = n.itemRule) == null ? void 0 : p.itemAttributes)),
|
|
373
371
|
itemCustomAttributes: O((A = n.itemRule) == null ? void 0 : A.itemCustomAttributes)
|
|
374
372
|
}
|
|
375
373
|
};
|
|
@@ -377,50 +375,52 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
377
375
|
};
|
|
378
376
|
});
|
|
379
377
|
}
|
|
380
|
-
const C = k(g(
|
|
378
|
+
const C = k(g(d.modelValue.ruleGroupIds ?? [])), w = k({
|
|
381
379
|
_id: "customRule",
|
|
382
|
-
restaurantRule:
|
|
383
|
-
itemRule:
|
|
384
|
-
}), P = k(
|
|
385
|
-
re(() =>
|
|
386
|
-
C.value = g(
|
|
380
|
+
restaurantRule: d.modelValue.restaurantRule,
|
|
381
|
+
itemRule: d.modelValue.itemRule
|
|
382
|
+
}), P = k(d.modelValue.orderFrom);
|
|
383
|
+
re(() => d.modelValue, (c) => {
|
|
384
|
+
C.value = g(c.ruleGroupIds ?? []), w.value = {
|
|
387
385
|
_id: "customRule",
|
|
388
|
-
restaurantRule:
|
|
389
|
-
itemRule:
|
|
386
|
+
restaurantRule: c.restaurantRule,
|
|
387
|
+
itemRule: c.itemRule
|
|
390
388
|
};
|
|
391
389
|
}, {
|
|
392
390
|
deep: !0
|
|
393
391
|
});
|
|
394
|
-
const
|
|
392
|
+
const V = k(d.showForm);
|
|
395
393
|
L({
|
|
396
|
-
showForm:
|
|
397
|
-
}), re(() =>
|
|
398
|
-
|
|
394
|
+
showForm: V
|
|
395
|
+
}), re(() => V.value, (c, h) => {
|
|
396
|
+
d.isDraft && h === !0 && c === !1 && $("delete-rule");
|
|
399
397
|
});
|
|
400
|
-
function J(
|
|
401
|
-
P.value =
|
|
398
|
+
function J(c) {
|
|
399
|
+
P.value = c.orderFrom, w.value.restaurantRule = c.restaurantRule, w.value.itemRule = c.itemRule, C.value = g(c.ruleGroupIds ?? []), $("update:model-value", c);
|
|
402
400
|
}
|
|
403
|
-
return (
|
|
401
|
+
return (c, h) => V.value ? (i(), U(Le, {
|
|
404
402
|
key: 1,
|
|
405
|
-
"is-edit-mode": !
|
|
403
|
+
"is-edit-mode": !R.isDraft,
|
|
406
404
|
"order-from": P.value,
|
|
407
405
|
"existing-rule-groups": C.value,
|
|
408
|
-
"group-custom-rule":
|
|
409
|
-
"convert-category-id-to-name":
|
|
410
|
-
onCloseForm: h[2] || (h[2] = (
|
|
411
|
-
"onUpdate:modelValue": h[3] || (h[3] = (
|
|
406
|
+
"group-custom-rule": w.value,
|
|
407
|
+
"convert-category-id-to-name": R.convertCategoryIdToName,
|
|
408
|
+
onCloseForm: h[2] || (h[2] = (I) => V.value = !1),
|
|
409
|
+
"onUpdate:modelValue": h[3] || (h[3] = (I) => J(I))
|
|
412
410
|
}, null, 8, ["is-edit-mode", "order-from", "existing-rule-groups", "group-custom-rule", "convert-category-id-to-name"])) : (i(), U(ge, {
|
|
413
411
|
key: 0,
|
|
414
|
-
"model-value":
|
|
415
|
-
title: `${
|
|
412
|
+
"model-value": w.value,
|
|
413
|
+
title: `${u(D)("menu.rule_groups.condition_view.rule")} ${R.index + 1}`,
|
|
416
414
|
"is-catalog-link-item-rule-view": !0,
|
|
417
|
-
"rule-group-names": C.value.map((
|
|
415
|
+
"rule-group-names": C.value.map((I) => I.name).filter((I) => I !== ""),
|
|
418
416
|
"order-from": P.value,
|
|
419
|
-
onOpenCatalogLinkItemRuleForm: h[0] || (h[0] = (
|
|
420
|
-
onDeleteRule: h[1] || (h[1] = (
|
|
417
|
+
onOpenCatalogLinkItemRuleForm: h[0] || (h[0] = (I) => V.value = !0),
|
|
418
|
+
onDeleteRule: h[1] || (h[1] = (I) => c.$emit("delete-rule"))
|
|
421
419
|
}, null, 8, ["model-value", "title", "rule-group-names", "order-from"]));
|
|
422
420
|
}
|
|
423
|
-
})
|
|
421
|
+
});
|
|
422
|
+
var M = /* @__PURE__ */ ((R) => (R[R.Normal = 0] = "Normal", R[R.Rules = 1] = "Rules", R))(M || {});
|
|
423
|
+
const Ee = { class: "fm-typo-en-title-md-600 mr-auto" }, Te = {
|
|
424
424
|
key: 1,
|
|
425
425
|
class: "flex items-center gap-12"
|
|
426
426
|
}, Ue = { class: "flex items-center gap-8" }, qe = { class: "text-neutral-600 fm-typo-body-sm" }, ze = {
|
|
@@ -446,68 +446,68 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
446
446
|
useCloseBtn: { type: Boolean }
|
|
447
447
|
},
|
|
448
448
|
emits: ["submit"],
|
|
449
|
-
setup(
|
|
450
|
-
const o =
|
|
451
|
-
function q(
|
|
452
|
-
$.value =
|
|
449
|
+
setup(R, { emit: L }) {
|
|
450
|
+
const o = R, D = L, { t: d } = se(), $ = k(M.Normal);
|
|
451
|
+
function q(t) {
|
|
452
|
+
$.value = t;
|
|
453
453
|
}
|
|
454
|
-
const g = k(!1), C = (
|
|
455
|
-
Ce.isBoolean(
|
|
454
|
+
const g = k(!1), C = (t) => {
|
|
455
|
+
Ce.isBoolean(t) ? g.value = t : g.value = !g.value;
|
|
456
456
|
};
|
|
457
|
-
function
|
|
458
|
-
return
|
|
457
|
+
function w(t) {
|
|
458
|
+
return t.reduce((l, e) => (l[e._id] = [...l[e._id] ?? [], e], l), {});
|
|
459
459
|
}
|
|
460
|
-
const P = o.initialValue,
|
|
460
|
+
const P = o.initialValue, V = k(w(ee(P))), J = z(() => Object.values(V.value).flatMap((t) => t)), { convertCategoryIdToName: c, convertCategoryNameToId: h } = he({
|
|
461
461
|
menuItems: z(() => o.menuItems || []),
|
|
462
462
|
categories: z(() => o.categories || [])
|
|
463
|
-
}),
|
|
463
|
+
}), I = k(
|
|
464
464
|
ee(o.linkItemRules)
|
|
465
|
-
),
|
|
465
|
+
), f = k();
|
|
466
466
|
function r() {
|
|
467
|
-
var
|
|
468
|
-
return (
|
|
467
|
+
var t;
|
|
468
|
+
return (t = I.value) == null ? void 0 : t.map((l) => {
|
|
469
469
|
var e, G, H, Q;
|
|
470
470
|
return {
|
|
471
|
-
...
|
|
471
|
+
...l,
|
|
472
472
|
restaurantRule: {
|
|
473
|
-
restaurantAttributes: O((e =
|
|
474
|
-
restaurantCustomAttributes: O((G =
|
|
473
|
+
restaurantAttributes: O((e = l.restaurantRule) == null ? void 0 : e.restaurantAttributes),
|
|
474
|
+
restaurantCustomAttributes: O((G = l.restaurantRule) == null ? void 0 : G.restaurantCustomAttributes)
|
|
475
475
|
},
|
|
476
476
|
itemRule: {
|
|
477
|
-
itemAttributes:
|
|
478
|
-
itemCustomAttributes: O((Q =
|
|
477
|
+
itemAttributes: c(O((H = l.itemRule) == null ? void 0 : H.itemAttributes)),
|
|
478
|
+
itemCustomAttributes: O((Q = l.itemRule) == null ? void 0 : Q.itemCustomAttributes)
|
|
479
479
|
}
|
|
480
480
|
};
|
|
481
481
|
});
|
|
482
482
|
}
|
|
483
|
-
|
|
483
|
+
f.value = r();
|
|
484
484
|
function s() {
|
|
485
|
-
var
|
|
486
|
-
return (
|
|
485
|
+
var t;
|
|
486
|
+
return (t = f.value) == null ? void 0 : t.map((l) => {
|
|
487
487
|
var e, G, H, Q;
|
|
488
488
|
return {
|
|
489
|
-
...
|
|
489
|
+
...l,
|
|
490
490
|
restaurantRule: {
|
|
491
|
-
restaurantAttributes: te((e =
|
|
492
|
-
restaurantCustomAttributes: te((G =
|
|
491
|
+
restaurantAttributes: te((e = l.restaurantRule) == null ? void 0 : e.restaurantAttributes),
|
|
492
|
+
restaurantCustomAttributes: te((G = l.restaurantRule) == null ? void 0 : G.restaurantCustomAttributes)
|
|
493
493
|
},
|
|
494
494
|
itemRule: {
|
|
495
|
-
itemAttributes: te(h((H =
|
|
496
|
-
itemCustomAttributes: te((Q =
|
|
495
|
+
itemAttributes: te(h((H = l.itemRule) == null ? void 0 : H.itemAttributes)),
|
|
496
|
+
itemCustomAttributes: te((Q = l.itemRule) == null ? void 0 : Q.itemCustomAttributes)
|
|
497
497
|
}
|
|
498
498
|
};
|
|
499
499
|
});
|
|
500
500
|
}
|
|
501
501
|
const n = _e(
|
|
502
502
|
() => {
|
|
503
|
-
const
|
|
504
|
-
return !ie.isEqual(
|
|
503
|
+
const t = s() ?? null;
|
|
504
|
+
return !ie.isEqual(w(o.initialValue), V.value) || !ie.isEqual(o.linkItemRules, t);
|
|
505
505
|
},
|
|
506
506
|
() => {
|
|
507
507
|
g.value = !1;
|
|
508
508
|
}
|
|
509
509
|
);
|
|
510
|
-
function
|
|
510
|
+
function v() {
|
|
511
511
|
$.value === M.Rules ? D("submit", {
|
|
512
512
|
mode: M.Rules,
|
|
513
513
|
linkItemRules: s() ?? []
|
|
@@ -519,10 +519,10 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
519
519
|
re(
|
|
520
520
|
() => g.value,
|
|
521
521
|
() => {
|
|
522
|
-
|
|
522
|
+
V.value = w(ee(o.initialValue)), I.value = ee(o.linkItemRules), f.value = r(), a.value = null, p.value = !1, $.value = o.noScheduler && o.linkItemRules && o.linkItemRules.length > 0 ? M.Rules : M.Normal;
|
|
523
523
|
}
|
|
524
524
|
);
|
|
525
|
-
const a = k(null),
|
|
525
|
+
const a = k(null), p = k(!1), A = () => {
|
|
526
526
|
a.value = {
|
|
527
527
|
orderFrom: ue.F_ORDER_FROM.enum.ALL,
|
|
528
528
|
restaurantRule: {
|
|
@@ -533,77 +533,77 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
533
533
|
itemAttributes: null,
|
|
534
534
|
itemCustomAttributes: null
|
|
535
535
|
}
|
|
536
|
-
},
|
|
536
|
+
}, p.value = !0;
|
|
537
537
|
};
|
|
538
|
-
function S(
|
|
539
|
-
|
|
538
|
+
function S(t) {
|
|
539
|
+
f.value = [...f.value || [], t], a.value = null, p.value = !1;
|
|
540
540
|
}
|
|
541
541
|
function N() {
|
|
542
|
-
a.value = null,
|
|
542
|
+
a.value = null, p.value = !1;
|
|
543
543
|
}
|
|
544
|
-
function
|
|
545
|
-
if (!
|
|
546
|
-
const
|
|
547
|
-
|
|
544
|
+
function _(t) {
|
|
545
|
+
if (!f.value) return;
|
|
546
|
+
const l = [...f.value];
|
|
547
|
+
l.splice(t, 1), f.value = l.length ? l : [];
|
|
548
548
|
}
|
|
549
549
|
const W = z(() => {
|
|
550
|
-
const
|
|
551
|
-
return o.noScheduler &&
|
|
550
|
+
const t = o.isLocalOnly ? ye() : le();
|
|
551
|
+
return o.noScheduler && t.currentCatalog;
|
|
552
552
|
});
|
|
553
|
-
function
|
|
554
|
-
if (!
|
|
555
|
-
const e = [...
|
|
556
|
-
e[
|
|
553
|
+
function m(t, l) {
|
|
554
|
+
if (!f.value) return;
|
|
555
|
+
const e = [...f.value];
|
|
556
|
+
e[t] = l, f.value = e;
|
|
557
557
|
}
|
|
558
|
-
return (
|
|
559
|
-
const e =
|
|
558
|
+
return (t, l) => {
|
|
559
|
+
const e = x("fm-button"), G = x("fm-switch"), H = x("FmCard"), Q = x("fm-side-sheet");
|
|
560
560
|
return i(), b(j, null, [
|
|
561
|
-
pe(
|
|
562
|
-
|
|
561
|
+
pe(t.$slots, "default", { trigger: C }, void 0, !0),
|
|
562
|
+
y(Q, {
|
|
563
563
|
id: "group-form",
|
|
564
564
|
modelValue: g.value,
|
|
565
|
-
"onUpdate:modelValue":
|
|
566
|
-
"close-button":
|
|
567
|
-
"is-container":
|
|
565
|
+
"onUpdate:modelValue": l[3] || (l[3] = (E) => g.value = E),
|
|
566
|
+
"close-button": t.useCloseBtn,
|
|
567
|
+
"is-container": u(de).FmForm,
|
|
568
568
|
"is-container-props": {
|
|
569
|
-
onValidationSuccess:
|
|
569
|
+
onValidationSuccess: v,
|
|
570
570
|
blameFormChildOnValidationFailed: !0
|
|
571
571
|
},
|
|
572
572
|
"max-width": 760,
|
|
573
|
-
"onOn:clickedAway":
|
|
573
|
+
"onOn:clickedAway": u(n)
|
|
574
574
|
}, {
|
|
575
575
|
"side-sheet-header": B(() => [
|
|
576
|
-
|
|
576
|
+
t.useCloseBtn ? Y("", !0) : (i(), U(e, {
|
|
577
577
|
key: 0,
|
|
578
|
-
variant:
|
|
578
|
+
variant: u(Z).Tertiary,
|
|
579
579
|
class: "cursor-pointer mr-4",
|
|
580
580
|
"prepend-icon": "arrow_back",
|
|
581
581
|
onClick: C
|
|
582
582
|
}, null, 8, ["variant"])),
|
|
583
|
-
F("p", Ee, T(
|
|
583
|
+
F("p", Ee, T(t.title || u(d)("menu.link_product.title")), 1),
|
|
584
584
|
W.value ? (i(), b("div", Te, [
|
|
585
585
|
F("div", Ue, [
|
|
586
|
-
|
|
587
|
-
label:
|
|
588
|
-
"model-value": $.value ===
|
|
589
|
-
"onUpdate:modelValue":
|
|
586
|
+
y(G, {
|
|
587
|
+
label: u(d)("menu.link_product.rules.section_title"),
|
|
588
|
+
"model-value": $.value === u(M).Rules,
|
|
589
|
+
"onUpdate:modelValue": l[0] || (l[0] = (E) => q(E ? u(M).Rules : u(M).Normal))
|
|
590
590
|
}, null, 8, ["label", "model-value"])
|
|
591
591
|
])
|
|
592
592
|
])) : Y("", !0)
|
|
593
593
|
]),
|
|
594
594
|
"side-sheet-footer": B(() => [
|
|
595
595
|
F("div", Qe, [
|
|
596
|
-
|
|
597
|
-
label:
|
|
596
|
+
y(e, {
|
|
597
|
+
label: u(d)("menu.common.actions.confirm"),
|
|
598
598
|
size: "lg",
|
|
599
599
|
type: "submit",
|
|
600
600
|
variant: "primary"
|
|
601
601
|
}, null, 8, ["label"]),
|
|
602
|
-
|
|
603
|
-
label:
|
|
602
|
+
y(e, {
|
|
603
|
+
label: u(d)("menu.common.actions.cancel"),
|
|
604
604
|
size: "lg",
|
|
605
605
|
variant: "tertiary",
|
|
606
|
-
onClick:
|
|
606
|
+
onClick: l[2] || (l[2] = () => g.value = !1)
|
|
607
607
|
}, null, 8, ["label"])
|
|
608
608
|
])
|
|
609
609
|
]),
|
|
@@ -612,29 +612,29 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
612
612
|
class: "py-8 px-8 overflow-y-auto space-y-24",
|
|
613
613
|
key: $.value
|
|
614
614
|
}, [
|
|
615
|
-
$.value ===
|
|
615
|
+
$.value === u(M).Normal ? (i(), U(u(fe), {
|
|
616
616
|
key: 0,
|
|
617
617
|
"auto-focus-search": !0,
|
|
618
|
-
"categorized-items":
|
|
619
|
-
data:
|
|
620
|
-
"select-variant":
|
|
618
|
+
"categorized-items": t.categorizedItems,
|
|
619
|
+
data: V.value,
|
|
620
|
+
"select-variant": t.selectVariant,
|
|
621
621
|
"selected-items": J.value,
|
|
622
|
-
"show-variant":
|
|
623
|
-
"show-addon":
|
|
624
|
-
"onUpdate:data":
|
|
622
|
+
"show-variant": t.showVariant,
|
|
623
|
+
"show-addon": t.showAddon,
|
|
624
|
+
"onUpdate:data": l[1] || (l[1] = (E) => V.value = E)
|
|
625
625
|
}, null, 8, ["categorized-items", "data", "select-variant", "selected-items", "show-variant", "show-addon"])) : W.value ? (i(), b(j, { key: 1 }, [
|
|
626
|
-
F("p", qe, T(
|
|
627
|
-
(!
|
|
626
|
+
F("p", qe, T(u(d)("menu.link_product.rules.hint")), 1),
|
|
627
|
+
(!f.value || f.value.length <= 0) && !p.value ? (i(), U(u(ve), {
|
|
628
628
|
key: 0,
|
|
629
|
-
title:
|
|
630
|
-
subtitle:
|
|
629
|
+
title: u(d)("menu.rule_groups.condition_view.empty_data.no_rules_added"),
|
|
630
|
+
subtitle: u(d)("menu.rule_groups.condition_view.empty_data.subtitle"),
|
|
631
631
|
action: {
|
|
632
|
-
text:
|
|
632
|
+
text: u(d)("menu.link_product.rules.add_rule"),
|
|
633
633
|
icon: "add",
|
|
634
634
|
callback: A
|
|
635
635
|
}
|
|
636
636
|
}, null, 8, ["title", "subtitle", "action"])) : (i(), b("div", ze, [
|
|
637
|
-
|
|
637
|
+
p.value && a.value ? (i(), U(H, {
|
|
638
638
|
key: 0,
|
|
639
639
|
class: "p-16 space-y-16",
|
|
640
640
|
variant: "outlined"
|
|
@@ -642,10 +642,10 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
642
642
|
default: B(() => {
|
|
643
643
|
var E;
|
|
644
644
|
return [
|
|
645
|
-
|
|
645
|
+
y(me, {
|
|
646
646
|
"model-value": a.value,
|
|
647
|
-
index: ((E =
|
|
648
|
-
convertCategoryIdToName:
|
|
647
|
+
index: ((E = f.value) == null ? void 0 : E.length) ?? 0,
|
|
648
|
+
convertCategoryIdToName: u(c),
|
|
649
649
|
"show-form": !0,
|
|
650
650
|
"is-draft": !0,
|
|
651
651
|
onDeleteRule: N,
|
|
@@ -655,23 +655,23 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
655
655
|
}),
|
|
656
656
|
_: 1
|
|
657
657
|
})) : Y("", !0),
|
|
658
|
-
(i(!0), b(j, null, X(
|
|
658
|
+
(i(!0), b(j, null, X(f.value, (E, K) => (i(), b(j, { key: K }, [
|
|
659
659
|
F("div", je, [
|
|
660
|
-
F("span", Pe, T(
|
|
661
|
-
|
|
660
|
+
F("span", Pe, T(u(d)("menu.rule_groups.condition_view.and")), 1),
|
|
661
|
+
y(me, {
|
|
662
662
|
"model-value": E,
|
|
663
663
|
index: K,
|
|
664
|
-
convertCategoryIdToName:
|
|
665
|
-
onDeleteRule: (ne) =>
|
|
666
|
-
"onUpdate:modelValue": (ne) =>
|
|
664
|
+
convertCategoryIdToName: u(c),
|
|
665
|
+
onDeleteRule: (ne) => _(K),
|
|
666
|
+
"onUpdate:modelValue": (ne) => m(K, ne)
|
|
667
667
|
}, null, 8, ["model-value", "index", "convertCategoryIdToName", "onDeleteRule", "onUpdate:modelValue"])
|
|
668
668
|
]),
|
|
669
|
-
|
|
670
|
-
F("span", He, T(
|
|
669
|
+
f.value && f.value.length > 1 && K < f.value.length - 1 ? (i(), b("div", We, [
|
|
670
|
+
F("span", He, T(u(d)("menu.rule_groups.condition_view.or")), 1)
|
|
671
671
|
])) : Y("", !0)
|
|
672
672
|
], 64))), 128)),
|
|
673
|
-
|
|
674
|
-
label:
|
|
673
|
+
y(e, {
|
|
674
|
+
label: u(d)("menu.link_product.rules.add_rule"),
|
|
675
675
|
onClick: A
|
|
676
676
|
}, null, 8, ["label"])
|
|
677
677
|
]))
|
|
@@ -683,7 +683,7 @@ const xe = { class: "flex items-center gap-24" }, Ie = { key: 0 }, we = { key: 1
|
|
|
683
683
|
], 64);
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
|
-
}), rt = /* @__PURE__ */ ce(Ye, [["__scopeId", "data-v-
|
|
686
|
+
}), rt = /* @__PURE__ */ ce(Ye, [["__scopeId", "data-v-60163177"]]);
|
|
687
687
|
export {
|
|
688
688
|
Fe as H,
|
|
689
689
|
rt as L,
|