@feedmepos/mf-menu 1.0.1-dev.1 → 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-CXamBqwS.js → App-CdIN4s5n.js} +5 -4
- package/dist/{BindingTable.vue_vue_type_script_setup_true_lang-DzNuoUmQ.js → BindingTable.vue_vue_type_script_setup_true_lang-CoHlJwpz.js} +1 -1
- package/dist/{Catalog-BHb5ZB6_.js → Catalog-DjAubC9s.js} +4 -4
- package/dist/{CatalogBinding-X-AHRvcJ.js → CatalogBinding-5JNRTbyZ.js} +3 -3
- package/dist/{CatalogEditTabs.vue_vue_type_script_setup_true_lang-NFeJpXLh.js → CatalogEditTabs.vue_vue_type_script_setup_true_lang-BorOjk1k.js} +3 -3
- package/dist/{CatalogEditor.vue_vue_type_script_setup_true_lang-CrrkUkfD.js → CatalogEditor.vue_vue_type_script_setup_true_lang-CkF7O_V-.js} +6 -6
- package/dist/{CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-C43Ettr2.js → CatalogLinkProductAction.vue_vue_type_script_setup_true_lang-3fL43MuR.js} +3 -3
- package/dist/{Category-DsTyhvYK.js → Category-BbiN4hd7.js} +5 -5
- package/dist/{Category-MXhBgKnb.js → Category-COug7fz8.js} +2 -2
- package/dist/{CategoryList.vue_vue_type_script_setup_true_lang-BJTKjE25.js → CategoryList.vue_vue_type_script_setup_true_lang-B_9aPMIN.js} +4 -4
- package/dist/{CookingGuide-yBqMRWrs.js → CookingGuide-Dg7kuF6l.js} +4 -4
- package/dist/{Group-CMKmmN3C.js → Group-BRpmTqyT.js} +5 -5
- package/dist/{Group-DINfX6Wn.js → Group-C-hwlkgJ.js} +2 -2
- package/dist/{GroupList.vue_vue_type_script_setup_true_lang-BEBZmPdu.js → GroupList.vue_vue_type_script_setup_true_lang-DowoJ3WM.js} +5 -5
- package/dist/{Ingredient-BNQ2LIqN.js → Ingredient-BQYnARdC.js} +3 -3
- package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-CgTDkHle.js +707 -0
- package/dist/{MenuSetting-DARGZW4u.js → MenuSetting-DsdM2_OW.js} +546 -513
- package/dist/{OrderPacing-DuGDpSLN.js → OrderPacing-5x2YH-_l.js} +4 -4
- package/dist/{OrderPacingFields.vue_vue_type_script_setup_true_lang-2V1SiXyH.js → OrderPacingFields.vue_vue_type_script_setup_true_lang-DVGJjpiM.js} +1 -1
- package/dist/Preview-AdgGTYlQ.js +321 -0
- package/dist/{PriceTierNotice.vue_vue_type_script_setup_true_lang-hbG9eqTr.js → PriceTierNotice.vue_vue_type_script_setup_true_lang-vmxVZ2ya.js} +1 -1
- package/dist/{PrintRoute-N0gXx2Wx.js → PrintRoute-COkCv4gf.js} +3 -3
- package/dist/{Product-Cp2dYxav.js → Product-BJFb_J4h.js} +4 -4
- package/dist/{ProductEditorHost.vue_vue_type_script_setup_true_lang-imCNnKvi.js → ProductEditorHost.vue_vue_type_script_setup_true_lang-Tpp8MBYS.js} +2 -2
- package/dist/{ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-BqZ2jz39.js → ProductGroupCreateSheet.vue_vue_type_script_setup_true_lang-C25Pwqme.js} +3 -3
- package/dist/{ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-KrQJLxU2.js → ProductImageEditorDialog.vue_vue_type_script_setup_true_lang-BMAtAK9D.js} +1 -1
- package/dist/{ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-i0smKuFw.js → ProductInlineCreateHost.vue_vue_type_script_setup_true_lang-Dl4Zr5tx.js} +10 -10
- package/dist/{ProductInternalTools-CJG8TsE4.js → ProductInternalTools-thlSvqbA.js} +2 -2
- package/dist/{ProductInventoryDialog-DmN4sXP_.js → ProductInventoryDialog-C3ruRWU5.js} +1 -1
- package/dist/{ProductInventoryDialog.vue_vue_type_script_setup_true_lang-UOIkIylV.js → ProductInventoryDialog.vue_vue_type_script_setup_true_lang-MpdIixqI.js} +1 -1
- package/dist/{ProductList.vue_vue_type_script_setup_true_lang-C262_Dsq.js → ProductList.vue_vue_type_script_setup_true_lang-9_ohgfqE.js} +8 -8
- package/dist/{ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-wTwunTLr.js → ProductVariantTranslationSheet.vue_vue_type_script_setup_true_lang-Ctbz-8cd.js} +1 -1
- package/dist/{Products-BSthFwvC.js → Products-DMrjQFfu.js} +3 -3
- package/dist/{Publish-BcUXfV7Z.js → Publish-f6g0dIao.js} +3 -3
- package/dist/{Recipe-Nhmop5G3.js → Recipe-p-wxadSN.js} +3 -3
- package/dist/{Scheduler-DEMpmXNY.js → Scheduler-CtebRafn.js} +3 -3
- package/dist/{ServingSequence-Dkd70bsy.js → ServingSequence-CEd4ywOQ.js} +2 -2
- package/dist/{Setting-LWEFUdQK.js → Setting-bPKadRu-.js} +6 -6
- package/dist/{Subcategory-YvAbjlgi.js → Subcategory-DBCnIP0b.js} +2 -2
- package/dist/{Takeaway-CoK-aka9.js → Takeaway-GNRHR5kN.js} +2 -2
- package/dist/{Takeaway-DUoXWAQT.js → Takeaway-VBkdW1DM.js} +5 -5
- package/dist/{TakeawayList.vue_vue_type_script_setup_true_lang-D4xu-gHa.js → TakeawayList.vue_vue_type_script_setup_true_lang-DvX3k0Jg.js} +3 -3
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-1iGMM-Xt.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-D1qaEVUu.js} +6 -6
- package/dist/{Unit-BIoPBeiP.js → Unit-DbGKIprZ.js} +2 -2
- package/dist/{Variant-X4llcQO6.js → Variant-_edSAKif.js} +3 -3
- package/dist/{_id_-gKOWPBVp.js → _id_-BNVtBV3q.js} +3 -3
- package/dist/{app-DUyvBFfY.js → app-BlTv5xag.js} +137 -114
- package/dist/app.js +1 -1
- 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--bTrGqr1.js → menu-compute-BzchkTYh.js} +36 -36
- package/dist/assets/{validate-menu-mv20U_e_.js → validate-menu-CTV_cJNG.js} +4 -4
- package/dist/{provide-CxmHxIEV.js → provide-dbE6Qt1z.js} +35458 -34831
- package/dist/ruleValueKey-BF52PuHb.js +10 -0
- package/dist/{useActionFeedback-Di6FGqLG.js → useActionFeedback-CdY_C_HX.js} +1 -1
- package/package.json +1 -1
- package/dist/LinkProductSideSheet.vue_vue_type_script_setup_true_lang-B8n517dM.js +0 -671
|
@@ -1,67 +1,68 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useI18n as
|
|
3
|
-
import { _ as
|
|
4
|
-
import { _ as ee, d as
|
|
5
|
-
import { u as le } from "./useActionFeedback-
|
|
6
|
-
import { b as
|
|
7
|
-
import { useDialogChild as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { _ as
|
|
11
|
-
import { _ as
|
|
12
|
-
|
|
1
|
+
import { defineComponent as E, onUnmounted as ye, computed as U, resolveComponent as C, openBlock as i, createElementBlock as y, createVNode as u, unref as t, withCtx as v, createElementVNode as n, Fragment as O, renderList as W, createBlock as S, createCommentVNode as A, ref as P, watch as Ee, h as N, withModifiers as T, toDisplayString as w, shallowRef as be, withDirectives as qe } from "vue";
|
|
2
|
+
import { useI18n as q } from "@feedmepos/mf-common";
|
|
3
|
+
import { _ as Ke } from "./FormItem.vue_vue_type_script_setup_true_lang-C2S6QCyR.js";
|
|
4
|
+
import { _ as ee, d as We } from "./FormSection.vue_vue_type_script_setup_true_lang-pY-_msnM.js";
|
|
5
|
+
import { u as le } from "./useActionFeedback-CdY_C_HX.js";
|
|
6
|
+
import { b as he, u as H, r as ie, a as He } from "./provide-dbE6Qt1z.js";
|
|
7
|
+
import { useDialogChild as Je, useDialog as re, components as te, useBreakpoints as Qe } from "@feedmepos/ui-library";
|
|
8
|
+
import { _ as ke } from "./index.vue_vue_type_script_setup_true_lang-CGPDazqs.js";
|
|
9
|
+
import { _ as xe } from "./app-BlTv5xag.js";
|
|
10
|
+
import { _ as we } from "./PageLayout.vue_vue_type_script_setup_true_lang-B3szUH39.js";
|
|
11
|
+
import { _ as Xe } from "./AddPriceGroupDialog.vue_vue_type_script_setup_true_lang-DhKyG3gY.js";
|
|
12
|
+
import { r as Ye, a as fe } from "./ruleValueKey-BF52PuHb.js";
|
|
13
|
+
const Ze = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "space-y-32 max-w-[750px] xs:p-16"
|
|
15
|
-
},
|
|
16
|
+
}, et = {
|
|
16
17
|
key: 0,
|
|
17
18
|
class: "pl-32 space-x-8"
|
|
18
|
-
},
|
|
19
|
+
}, tt = { class: "space-y-16" }, lt = /* @__PURE__ */ E({
|
|
19
20
|
__name: "ConfigurationTab",
|
|
20
21
|
props: {
|
|
21
22
|
sdk: {}
|
|
22
23
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
const c =
|
|
24
|
+
setup(L) {
|
|
25
|
+
const p = L, { t: e } = q(), b = he(), { run: F } = le(), g = p.sdk.menuSetting.configuration();
|
|
26
|
+
ye(() => g.dispose());
|
|
27
|
+
const c = H(g), m = U(
|
|
27
28
|
() => c.value.status === "ready" ? c.value.value : null
|
|
28
|
-
),
|
|
29
|
-
var
|
|
30
|
-
const
|
|
31
|
-
if (
|
|
32
|
-
const
|
|
33
|
-
return Number.isNaN(
|
|
29
|
+
), I = U(() => {
|
|
30
|
+
var $;
|
|
31
|
+
const h = (($ = m.value) == null ? void 0 : $.lowStockThreshold) ?? "";
|
|
32
|
+
if (h.trim() === "") return null;
|
|
33
|
+
const r = Number(h);
|
|
34
|
+
return Number.isNaN(r) ? null : r;
|
|
34
35
|
});
|
|
35
|
-
async function
|
|
36
|
-
await
|
|
36
|
+
async function B() {
|
|
37
|
+
await F(() => g.submit(), {
|
|
37
38
|
successMessage: e("menu.menu_setting.fields.low_stock.updated"),
|
|
38
39
|
// A non-integer threshold is decided locally and never reaches the wire,
|
|
39
40
|
// so a loading toast here would show an indicator legacy never had.
|
|
40
41
|
showLoading: () => {
|
|
41
|
-
var
|
|
42
|
-
return ((
|
|
42
|
+
var h;
|
|
43
|
+
return ((h = m.value) == null ? void 0 : h.status) === "submitting";
|
|
43
44
|
}
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
|
-
return (
|
|
47
|
-
const
|
|
48
|
-
return
|
|
49
|
-
|
|
47
|
+
return (h, r) => {
|
|
48
|
+
const $ = C("FmRadio"), k = C("FmRadioGroup"), d = C("FmCheckbox"), z = C("FmSwitch"), K = C("FmStepperField"), j = C("FmButton");
|
|
49
|
+
return m.value ? (i(), y("div", Ze, [
|
|
50
|
+
u(ee, {
|
|
50
51
|
title: t(e)("menu.tax_setting.title")
|
|
51
52
|
}, {
|
|
52
|
-
default:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"model-value":
|
|
56
|
-
"onUpdate:modelValue":
|
|
53
|
+
default: v(() => [
|
|
54
|
+
n("div", null, [
|
|
55
|
+
u(k, {
|
|
56
|
+
"model-value": m.value.taxMode,
|
|
57
|
+
"onUpdate:modelValue": r[0] || (r[0] = (V) => t(g).setTaxMode(V))
|
|
57
58
|
}, {
|
|
58
|
-
default:
|
|
59
|
-
|
|
59
|
+
default: v(() => [
|
|
60
|
+
u($, {
|
|
60
61
|
value: "automatic",
|
|
61
62
|
label: t(e)("menu.setting.tax.modes.auto.label"),
|
|
62
63
|
sublabel: t(e)("menu.setting.tax.modes.auto.sublabel")
|
|
63
64
|
}, null, 8, ["label", "sublabel"]),
|
|
64
|
-
|
|
65
|
+
u($, {
|
|
65
66
|
value: "manual",
|
|
66
67
|
label: t(e)("menu.setting.tax.modes.manual.label"),
|
|
67
68
|
sublabel: t(e)("menu.setting.tax.modes.manual.sublabel")
|
|
@@ -69,100 +70,100 @@ const We = {
|
|
|
69
70
|
]),
|
|
70
71
|
_: 1
|
|
71
72
|
}, 8, ["model-value"]),
|
|
72
|
-
|
|
73
|
-
(
|
|
74
|
-
key:
|
|
75
|
-
"model-value":
|
|
73
|
+
m.value.taxMode === "manual" ? (i(), y("div", et, [
|
|
74
|
+
(i(!0), y(O, null, W(m.value.taxSystems, (V) => (i(), S(d, {
|
|
75
|
+
key: V.systemCode,
|
|
76
|
+
"model-value": V.inclusive,
|
|
76
77
|
value: !0,
|
|
77
|
-
label: t(e)("menu.setting.tax.inclusive", { code:
|
|
78
|
-
"onUpdate:modelValue": (
|
|
78
|
+
label: t(e)("menu.setting.tax.inclusive", { code: V.systemCode }),
|
|
79
|
+
"onUpdate:modelValue": (M) => t(g).setTaxInclusive(V.systemCode, !!M)
|
|
79
80
|
}, null, 8, ["model-value", "label", "onUpdate:modelValue"]))), 128))
|
|
80
|
-
])) :
|
|
81
|
+
])) : A("", !0)
|
|
81
82
|
]),
|
|
82
|
-
|
|
83
|
+
m.value.statutoryChargeWaivers.length > 0 ? (i(), S(Ke, {
|
|
83
84
|
key: 0,
|
|
84
85
|
label: t(e)("menu.catalog.form.statutory_charges.title")
|
|
85
86
|
}, {
|
|
86
|
-
default:
|
|
87
|
-
|
|
88
|
-
(
|
|
89
|
-
key:
|
|
90
|
-
"model-value":
|
|
87
|
+
default: v(() => [
|
|
88
|
+
n("div", tt, [
|
|
89
|
+
(i(!0), y(O, null, W(m.value.statutoryChargeWaivers, (V) => (i(), S(z, {
|
|
90
|
+
key: V.code,
|
|
91
|
+
"model-value": V.waived,
|
|
91
92
|
label: t(e)("menu.catalog.form.statutory_charges.waive", {
|
|
92
|
-
name:
|
|
93
|
+
name: V.name
|
|
93
94
|
}),
|
|
94
95
|
sublabel: t(e)("menu.menu_setting.statutory_charges.sublabel"),
|
|
95
96
|
"label-placement": "right",
|
|
96
|
-
"onUpdate:modelValue": (
|
|
97
|
+
"onUpdate:modelValue": (M) => t(g).setStatutoryChargeWaived(V.code, M)
|
|
97
98
|
}, null, 8, ["model-value", "label", "sublabel", "onUpdate:modelValue"]))), 128))
|
|
98
99
|
])
|
|
99
100
|
]),
|
|
100
101
|
_: 1
|
|
101
|
-
}, 8, ["label"])) :
|
|
102
|
+
}, 8, ["label"])) : A("", !0)
|
|
102
103
|
]),
|
|
103
104
|
_: 1
|
|
104
105
|
}, 8, ["title"]),
|
|
105
|
-
|
|
106
|
+
u(ee, {
|
|
106
107
|
title: t(e)("menu.menu_setting.fields.low_stock.title"),
|
|
107
108
|
"sub-title": t(e)("menu.menu_setting.fields.low_stock.subtitle")
|
|
108
109
|
}, {
|
|
109
|
-
default:
|
|
110
|
-
|
|
111
|
-
"model-value":
|
|
110
|
+
default: v(() => [
|
|
111
|
+
u(K, {
|
|
112
|
+
"model-value": I.value,
|
|
112
113
|
min: 0,
|
|
113
114
|
max: 1e3,
|
|
114
115
|
step: 1,
|
|
115
116
|
placeholder: t(e)("menu.menu_setting.fields.low_stock.not_set"),
|
|
116
|
-
"helper-state":
|
|
117
|
-
"helper-text":
|
|
118
|
-
"onUpdate:modelValue":
|
|
119
|
-
|
|
117
|
+
"helper-state": m.value.lowStockIssue ? "error" : "none",
|
|
118
|
+
"helper-text": m.value.lowStockIssue ? t(b)(m.value.lowStockIssue) : t(e)("menu.menu_setting.fields.low_stock.helper_text"),
|
|
119
|
+
"onUpdate:modelValue": r[1] || (r[1] = (V) => t(g).setLowStockThreshold(
|
|
120
|
+
V == null ? "" : String(V)
|
|
120
121
|
))
|
|
121
122
|
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text"])
|
|
122
123
|
]),
|
|
123
124
|
_: 1
|
|
124
125
|
}, 8, ["title", "sub-title"]),
|
|
125
|
-
|
|
126
|
+
u(j, {
|
|
126
127
|
label: t(e)("menu.common.actions.save"),
|
|
127
|
-
disabled:
|
|
128
|
-
loading:
|
|
129
|
-
onClick:
|
|
128
|
+
disabled: m.value.submit.state !== "allowed",
|
|
129
|
+
loading: m.value.status === "submitting",
|
|
130
|
+
onClick: B
|
|
130
131
|
}, null, 8, ["label", "disabled", "loading"])
|
|
131
|
-
])) :
|
|
132
|
+
])) : A("", !0);
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
|
-
}),
|
|
135
|
+
}), at = /* @__PURE__ */ E({
|
|
135
136
|
__name: "AddMemberTierDialog",
|
|
136
|
-
setup(
|
|
137
|
-
const { t:
|
|
138
|
-
return
|
|
139
|
-
const c =
|
|
140
|
-
return
|
|
141
|
-
modelValue:
|
|
142
|
-
"onUpdate:modelValue":
|
|
143
|
-
label: t(
|
|
137
|
+
setup(L) {
|
|
138
|
+
const { t: p } = q(), { emitData: e } = Je(), b = P("");
|
|
139
|
+
return Ee(b, (F) => e(F)), (F, g) => {
|
|
140
|
+
const c = C("FmTextField");
|
|
141
|
+
return i(), S(c, {
|
|
142
|
+
modelValue: b.value,
|
|
143
|
+
"onUpdate:modelValue": g[0] || (g[0] = (m) => b.value = m),
|
|
144
|
+
label: t(p)("menu.member_pricing.name_title")
|
|
144
145
|
}, null, 8, ["modelValue", "label"]);
|
|
145
146
|
};
|
|
146
147
|
}
|
|
147
|
-
}),
|
|
148
|
+
}), ot = /* @__PURE__ */ E({
|
|
148
149
|
__name: "MemberPricingTab",
|
|
149
150
|
props: {
|
|
150
151
|
sdk: {}
|
|
151
152
|
},
|
|
152
|
-
setup(
|
|
153
|
-
const
|
|
154
|
-
() =>
|
|
155
|
-
),
|
|
156
|
-
var
|
|
157
|
-
return [...((
|
|
153
|
+
setup(L) {
|
|
154
|
+
const p = L, { t: e } = q(), b = re(), { run: F } = le(), g = H(p.sdk.memberPricing.list), c = U(
|
|
155
|
+
() => g.value.status === "ready" ? g.value.value : null
|
|
156
|
+
), m = U(() => {
|
|
157
|
+
var r;
|
|
158
|
+
return [...((r = c.value) == null ? void 0 : r.rows) ?? []];
|
|
158
159
|
});
|
|
159
|
-
function
|
|
160
|
-
var
|
|
161
|
-
((
|
|
160
|
+
function I() {
|
|
161
|
+
var r;
|
|
162
|
+
((r = c.value) == null ? void 0 : r.create.state) === "allowed" && b.open({
|
|
162
163
|
// The dialog wears the TAB's title, not an "Add…" phrasing — unlike
|
|
163
164
|
// the Price group tab beside it (`member-pricing/create/dialog-open`).
|
|
164
165
|
title: e("menu.member_pricing.title"),
|
|
165
|
-
contentComponent:
|
|
166
|
+
contentComponent: at,
|
|
166
167
|
primaryActions: {
|
|
167
168
|
text: e("menu.category.manager.dialog.add.action"),
|
|
168
169
|
close: !1
|
|
@@ -171,19 +172,19 @@ const We = {
|
|
|
171
172
|
text: e("menu.common.actions.cancel"),
|
|
172
173
|
close: !0
|
|
173
174
|
}
|
|
174
|
-
}).onPrimary(async (
|
|
175
|
-
(await
|
|
175
|
+
}).onPrimary(async ($) => {
|
|
176
|
+
(await F(
|
|
176
177
|
// An untouched field never emits, so it arrives as `undefined`. It is
|
|
177
178
|
// forwarded as the empty string rather than defended against here:
|
|
178
179
|
// whether an empty name is submittable is the SDK's rule.
|
|
179
|
-
() =>
|
|
180
|
+
() => p.sdk.memberPricing.create(String($ ?? "")),
|
|
180
181
|
{
|
|
181
182
|
// The success copy INTERPOLATES the tier name, unlike the Price
|
|
182
183
|
// group tab's generic line. The name comes back from the outcome
|
|
183
184
|
// rather than from the typed input, so the message can only ever
|
|
184
185
|
// describe the tier the write actually established.
|
|
185
|
-
successMessage: (
|
|
186
|
-
name:
|
|
186
|
+
successMessage: (d) => e("menu.member_pricing.add_member_tier_success", {
|
|
187
|
+
name: d.key
|
|
187
188
|
}),
|
|
188
189
|
// Two rejections settle here without a round trip and legacy shows
|
|
189
190
|
// no pending pill for either: the empty name is silent altogether
|
|
@@ -201,21 +202,21 @@ const We = {
|
|
|
201
202
|
// SDK's own answer, and it keeps answering correctly if either
|
|
202
203
|
// guard ever moves.
|
|
203
204
|
showLoading: () => {
|
|
204
|
-
var
|
|
205
|
-
return ((
|
|
205
|
+
var d;
|
|
206
|
+
return ((d = c.value) == null ? void 0 : d.create.state) !== "allowed";
|
|
206
207
|
}
|
|
207
208
|
}
|
|
208
|
-
)).kind === "success" &&
|
|
209
|
+
)).kind === "success" && b.close();
|
|
209
210
|
});
|
|
210
211
|
}
|
|
211
|
-
function
|
|
212
|
-
|
|
212
|
+
function B(r) {
|
|
213
|
+
r.remove.state === "allowed" && b.open({
|
|
213
214
|
title: e("menu.member_pricing.delete_dialog.title"),
|
|
214
215
|
// Names the tier and says nothing about which products are priced
|
|
215
216
|
// against it, because legacy runs no reference check
|
|
216
217
|
// (`member-pricing/delete/confirmation`).
|
|
217
218
|
message: e("menu.member_pricing.delete_dialog.message", {
|
|
218
|
-
name:
|
|
219
|
+
name: r.key
|
|
219
220
|
}),
|
|
220
221
|
primaryActions: {
|
|
221
222
|
text: e("menu.common.actions.remove"),
|
|
@@ -226,17 +227,17 @@ const We = {
|
|
|
226
227
|
close: !0
|
|
227
228
|
}
|
|
228
229
|
}).onPrimary(async () => {
|
|
229
|
-
(await
|
|
230
|
-
() =>
|
|
230
|
+
(await F(
|
|
231
|
+
() => p.sdk.memberPricing.remove(r.key),
|
|
231
232
|
{
|
|
232
233
|
// Generic, where create interpolates. That inconsistency is
|
|
233
234
|
// internal to this unit and is reproduced, not tidied.
|
|
234
235
|
successMessage: e("menu.member_pricing.delete_dialog.success")
|
|
235
236
|
}
|
|
236
|
-
)).kind === "success" &&
|
|
237
|
+
)).kind === "success" && b.close();
|
|
237
238
|
});
|
|
238
239
|
}
|
|
239
|
-
const
|
|
240
|
+
const h = U(() => [
|
|
240
241
|
{
|
|
241
242
|
accessorKey: "key",
|
|
242
243
|
enableSorting: !1,
|
|
@@ -251,52 +252,52 @@ const We = {
|
|
|
251
252
|
// addition the new app owns. It is the screen-reader name, not a
|
|
252
253
|
// locator: "Remove member tier" contains no "delete", unlike the Price
|
|
253
254
|
// group tab's label, and must not be renamed toward one.
|
|
254
|
-
cell: (
|
|
255
|
-
|
|
255
|
+
cell: (r) => N("div", { class: "flex justify-end px-4" }, [
|
|
256
|
+
N(te.FmButton, {
|
|
256
257
|
icon: "delete",
|
|
257
258
|
variant: "tertiary",
|
|
258
259
|
textColor: "neutral-gray-400",
|
|
259
260
|
"aria-label": e("menu.member_pricing.table.actions.delete"),
|
|
260
|
-
disabled:
|
|
261
|
-
onClick:
|
|
262
|
-
() =>
|
|
261
|
+
disabled: r.row.original.remove.state !== "allowed",
|
|
262
|
+
onClick: T(
|
|
263
|
+
() => B(r.row.original),
|
|
263
264
|
["stop", "prevent"]
|
|
264
265
|
)
|
|
265
266
|
})
|
|
266
267
|
])
|
|
267
268
|
}
|
|
268
269
|
]);
|
|
269
|
-
return (
|
|
270
|
-
const
|
|
271
|
-
return c.value ? (
|
|
270
|
+
return (r, $) => {
|
|
271
|
+
const k = C("FmButton"), d = C("FmTable");
|
|
272
|
+
return c.value ? (i(), S(we, {
|
|
272
273
|
key: 0,
|
|
273
274
|
heading: t(e)("menu.member_pricing.title"),
|
|
274
275
|
subheading: t(e)("menu.member_pricing.description")
|
|
275
276
|
}, {
|
|
276
|
-
"append-heading":
|
|
277
|
-
c.value.rows.length > 0 ? (
|
|
277
|
+
"append-heading": v(() => [
|
|
278
|
+
c.value.rows.length > 0 ? (i(), S(k, {
|
|
278
279
|
key: 0,
|
|
279
280
|
label: t(e)("menu.member_pricing.add_member_tier"),
|
|
280
281
|
disabled: c.value.create.state !== "allowed",
|
|
281
282
|
"prepend-icon": "add",
|
|
282
|
-
onClick:
|
|
283
|
-
}, null, 8, ["label", "disabled"])) :
|
|
283
|
+
onClick: I
|
|
284
|
+
}, null, 8, ["label", "disabled"])) : A("", !0)
|
|
284
285
|
]),
|
|
285
|
-
default:
|
|
286
|
-
c.value.rows.length === 0 ? (
|
|
286
|
+
default: v(() => [
|
|
287
|
+
c.value.rows.length === 0 ? (i(), S(t(ke), {
|
|
287
288
|
key: 0,
|
|
288
289
|
action: {
|
|
289
290
|
text: t(e)("menu.member_pricing.add_member_tier"),
|
|
290
|
-
callback:
|
|
291
|
+
callback: I
|
|
291
292
|
},
|
|
292
293
|
subtitle: t(e)("menu.member_pricing.empty.subtitle"),
|
|
293
294
|
title: t(e)("menu.member_pricing.empty.title")
|
|
294
|
-
}, null, 8, ["action", "subtitle", "title"])) : (
|
|
295
|
-
default:
|
|
296
|
-
|
|
297
|
-
"column-defs":
|
|
295
|
+
}, null, 8, ["action", "subtitle", "title"])) : (i(), S(xe, { key: 1 }, {
|
|
296
|
+
default: v(() => [
|
|
297
|
+
u(d, {
|
|
298
|
+
"column-defs": h.value,
|
|
298
299
|
"page-size": c.value.rows.length,
|
|
299
|
-
"row-data":
|
|
300
|
+
"row-data": m.value,
|
|
300
301
|
"shrink-at": !1,
|
|
301
302
|
"hide-footer": "",
|
|
302
303
|
"pin-header-row": ""
|
|
@@ -306,29 +307,29 @@ const We = {
|
|
|
306
307
|
}))
|
|
307
308
|
]),
|
|
308
309
|
_: 1
|
|
309
|
-
}, 8, ["heading", "subheading"])) :
|
|
310
|
+
}, 8, ["heading", "subheading"])) : A("", !0);
|
|
310
311
|
};
|
|
311
312
|
}
|
|
312
|
-
}),
|
|
313
|
+
}), nt = {
|
|
313
314
|
key: 0,
|
|
314
315
|
class: "flex flex-col gap-16"
|
|
315
|
-
},
|
|
316
|
+
}, st = { class: "flex items-center justify-between gap-16" }, ut = { class: "fm-typo-en-title-md-600" }, it = { class: "text-fm-color-typo-secondary" }, rt = /* @__PURE__ */ E({
|
|
316
317
|
__name: "PriceGroupTab",
|
|
317
318
|
props: {
|
|
318
319
|
sdk: {}
|
|
319
320
|
},
|
|
320
|
-
setup(
|
|
321
|
-
const
|
|
322
|
-
() =>
|
|
323
|
-
),
|
|
324
|
-
var
|
|
325
|
-
return [...((
|
|
321
|
+
setup(L) {
|
|
322
|
+
const p = L, { t: e } = q(), b = re(), { run: F } = le(), g = H(p.sdk.priceTier.list), c = U(
|
|
323
|
+
() => g.value.status === "ready" ? g.value.value : null
|
|
324
|
+
), m = U(() => {
|
|
325
|
+
var r;
|
|
326
|
+
return [...((r = c.value) == null ? void 0 : r.rows) ?? []];
|
|
326
327
|
});
|
|
327
|
-
function
|
|
328
|
-
var
|
|
329
|
-
((
|
|
328
|
+
function I() {
|
|
329
|
+
var r;
|
|
330
|
+
((r = c.value) == null ? void 0 : r.create.state) === "allowed" && b.open({
|
|
330
331
|
title: e("menu.price_tier.add_price_group"),
|
|
331
|
-
contentComponent:
|
|
332
|
+
contentComponent: Xe,
|
|
332
333
|
primaryActions: {
|
|
333
334
|
text: e("menu.category.manager.dialog.add.action"),
|
|
334
335
|
close: !1
|
|
@@ -337,12 +338,12 @@ const We = {
|
|
|
337
338
|
text: e("menu.common.actions.cancel"),
|
|
338
339
|
close: !0
|
|
339
340
|
}
|
|
340
|
-
}).onPrimary(async (
|
|
341
|
-
(await
|
|
341
|
+
}).onPrimary(async ($) => {
|
|
342
|
+
(await F(
|
|
342
343
|
// An untouched field never emits, so it arrives as `undefined`. It is
|
|
343
344
|
// forwarded as the empty string rather than defended against here:
|
|
344
345
|
// whether an empty title is submittable is the SDK's rule.
|
|
345
|
-
() =>
|
|
346
|
+
() => p.sdk.priceTier.create(String($ ?? "")),
|
|
346
347
|
{
|
|
347
348
|
successMessage: e("menu.price_tier.add_price_group_success"),
|
|
348
349
|
// The empty title is refused locally with no request, and legacy
|
|
@@ -360,17 +361,17 @@ const We = {
|
|
|
360
361
|
// SDK's own answer, and it keeps answering correctly if the
|
|
361
362
|
// submittability rule ever moves.
|
|
362
363
|
showLoading: () => {
|
|
363
|
-
var
|
|
364
|
-
return ((
|
|
364
|
+
var d;
|
|
365
|
+
return ((d = c.value) == null ? void 0 : d.create.state) !== "allowed";
|
|
365
366
|
}
|
|
366
367
|
}
|
|
367
|
-
)).kind === "success" &&
|
|
368
|
+
)).kind === "success" && b.close();
|
|
368
369
|
});
|
|
369
370
|
}
|
|
370
|
-
function
|
|
371
|
-
|
|
371
|
+
function B(r) {
|
|
372
|
+
r.remove.state === "allowed" && b.open({
|
|
372
373
|
title: e("menu.price_tier.delete_dialog.title"),
|
|
373
|
-
message: e("menu.price_tier.delete_dialog.message", { name:
|
|
374
|
+
message: e("menu.price_tier.delete_dialog.message", { name: r.key }),
|
|
374
375
|
primaryActions: {
|
|
375
376
|
text: e("menu.common.actions.remove"),
|
|
376
377
|
close: !1
|
|
@@ -380,13 +381,13 @@ const We = {
|
|
|
380
381
|
close: !0
|
|
381
382
|
}
|
|
382
383
|
}).onPrimary(async () => {
|
|
383
|
-
(await
|
|
384
|
-
() =>
|
|
384
|
+
(await F(
|
|
385
|
+
() => p.sdk.priceTier.remove(r.key),
|
|
385
386
|
{ successMessage: e("menu.price_tier.delete_dialog.success") }
|
|
386
|
-
)).kind === "success" &&
|
|
387
|
+
)).kind === "success" && b.close();
|
|
387
388
|
});
|
|
388
389
|
}
|
|
389
|
-
const
|
|
390
|
+
const h = U(() => [
|
|
390
391
|
{
|
|
391
392
|
accessorKey: "key",
|
|
392
393
|
enableSorting: !1,
|
|
@@ -399,95 +400,107 @@ const We = {
|
|
|
399
400
|
header: "",
|
|
400
401
|
// Legacy's control is icon-only with NO accessible name; the name is an
|
|
401
402
|
// addition the new app owns, naming the control for a screen reader.
|
|
402
|
-
cell: (
|
|
403
|
-
|
|
403
|
+
cell: (r) => N("div", { class: "flex justify-end px-4" }, [
|
|
404
|
+
N(te.FmButton, {
|
|
404
405
|
icon: "delete",
|
|
405
406
|
variant: "tertiary",
|
|
406
407
|
textColor: "neutral-gray-400",
|
|
407
408
|
"aria-label": e("menu.price_tier.settings_table.actions.delete"),
|
|
408
|
-
disabled:
|
|
409
|
-
onClick:
|
|
410
|
-
() =>
|
|
409
|
+
disabled: r.row.original.remove.state !== "allowed",
|
|
410
|
+
onClick: T(
|
|
411
|
+
() => B(r.row.original),
|
|
411
412
|
["stop", "prevent"]
|
|
412
413
|
)
|
|
413
414
|
})
|
|
414
415
|
])
|
|
415
416
|
}
|
|
416
417
|
]);
|
|
417
|
-
return (
|
|
418
|
-
const
|
|
419
|
-
return c.value ? (
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
418
|
+
return (r, $) => {
|
|
419
|
+
const k = C("FmButton"), d = C("FmTable");
|
|
420
|
+
return c.value ? (i(), y("div", nt, [
|
|
421
|
+
n("div", st, [
|
|
422
|
+
n("div", null, [
|
|
423
|
+
n("h1", ut, w(t(e)("menu.price_tier.price_group")), 1),
|
|
424
|
+
n("p", it, w(t(e)("menu.price_tier.description")), 1)
|
|
424
425
|
]),
|
|
425
|
-
|
|
426
|
+
u(k, {
|
|
426
427
|
label: t(e)("menu.price_tier.add_price_group"),
|
|
427
428
|
disabled: c.value.create.state !== "allowed",
|
|
428
429
|
"prepend-icon": "add",
|
|
429
|
-
onClick:
|
|
430
|
+
onClick: I
|
|
430
431
|
}, null, 8, ["label", "disabled"])
|
|
431
432
|
]),
|
|
432
|
-
|
|
433
|
-
"column-defs":
|
|
433
|
+
u(d, {
|
|
434
|
+
"column-defs": h.value,
|
|
434
435
|
"page-size": Math.max(c.value.rows.length, 1),
|
|
435
|
-
"row-data":
|
|
436
|
+
"row-data": m.value,
|
|
436
437
|
"shrink-at": !1,
|
|
437
438
|
"hide-footer": "",
|
|
438
439
|
"pin-header-row": ""
|
|
439
440
|
}, null, 8, ["column-defs", "page-size", "row-data"])
|
|
440
|
-
])) :
|
|
441
|
+
])) : A("", !0);
|
|
441
442
|
};
|
|
442
443
|
}
|
|
443
|
-
}),
|
|
444
|
+
}), ct = { key: 0 }, dt = {
|
|
444
445
|
key: 0,
|
|
445
446
|
class: "space-y-8"
|
|
446
|
-
},
|
|
447
|
+
}, mt = { class: "flex items-center justify-between" }, pt = { class: "fm-typo-en-title-md-600" }, _t = { class: "text-fm-color-typo-secondary" }, vt = { class: "flex justify-end items-center" }, gt = { class: "w-[320px]" }, bt = {
|
|
447
448
|
key: 1,
|
|
448
449
|
class: "flex-1 flex flex-col min-h-0"
|
|
449
|
-
},
|
|
450
|
+
}, ft = { class: "flex items-center justify-between p-8" }, yt = { class: "flex-1 mr-8" }, ht = { class: "flex flex-1 flex-col min-h-0 overflow-scroll divide-y divide-fm-color-neutral-gray-100 pb-64" }, kt = ["onClick"], xt = { class: "flex-1 space-y-4" }, wt = { class: "fm-typo-en-body-lg-600" }, Ct = {
|
|
450
451
|
key: 0,
|
|
451
452
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
452
|
-
},
|
|
453
|
+
}, Ft = { class: "fm-typo-en-title-md-600 mr-auto" }, St = { class: "py-8 px-8 overflow-y-auto space-y-24" }, $t = { class: "space-y-16" }, Vt = { class: "rule-item" }, Rt = { class: "flex items-center space-x-16" }, Tt = { class: "flex flex-col min-w-0 w-full" }, Ut = { class: "flex-1 relative border border-fm-color-neutral-gray-200 rounded-md p-16" }, Mt = { class: "flex items-center justify-between pb-8" }, At = { class: "text-fm-color-neutral-gray-300" }, It = { class: "flex gap-8" }, Lt = { class: "flex flex-col space-y-8" }, Bt = { class: "fm-typo-en-body-lg-600" }, Pt = { class: "w-24" }, jt = { class: "flex w-full fm-typo-en-body-lg-400 space-x-8 overflow-hidden" }, Gt = { class: "whitespace-nowrap" }, Dt = { class: "fm-typo-en-body-lg-600 whitespace-nowrap" }, zt = ["onClick"], Ot = {
|
|
453
454
|
key: 0,
|
|
454
455
|
class: "flex items-center select-none ml-16"
|
|
455
|
-
},
|
|
456
|
+
}, Nt = { class: "fm-typo-en-body-lg-400 text-fm-color-neutral-gray-300" }, Et = { class: "flex gap-8 items-center justify-start" }, qt = { class: "flex items-center gap-24" }, Kt = { class: "fm-typo-en-headline-lg-600" }, Wt = { class: "p-16 flex flex-col gap-16" }, Ht = { class: "fm-typo-en-body-lg-600" }, Jt = { class: "flex flex-col gap-16" }, Qt = { class: "flex w-full justify-between gap-16" }, Xt = {
|
|
457
|
+
key: 0,
|
|
458
|
+
class: "flex w-full [&>*]:w-full"
|
|
459
|
+
}, Yt = { class: "break-all fm-typo-en-body-lg-400 line-clamp-1" }, Zt = { class: "flex gap-16 items-center" }, el = /* @__PURE__ */ E({
|
|
456
460
|
__name: "RuleGroupsTab",
|
|
457
461
|
props: {
|
|
458
462
|
sdk: {}
|
|
459
463
|
},
|
|
460
|
-
setup(
|
|
461
|
-
const
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
464
|
+
setup(L) {
|
|
465
|
+
const p = L, { t: e } = q(), b = {
|
|
466
|
+
mounted: (l, a) => {
|
|
467
|
+
var o;
|
|
468
|
+
(o = l.querySelector("input")) == null || o.setAttribute("aria-label", a.value);
|
|
469
|
+
},
|
|
470
|
+
updated: (l, a) => {
|
|
471
|
+
var o;
|
|
472
|
+
(o = l.querySelector("input")) == null || o.setAttribute("aria-label", a.value);
|
|
473
|
+
}
|
|
474
|
+
}, F = he(), g = re(), { run: c } = le(), { breakpoints: m } = Qe(), I = U(() => m.value.xs), B = H(
|
|
475
|
+
p.sdk.menuSetting.ruleGroupList
|
|
476
|
+
), h = U(
|
|
477
|
+
() => B.value.status === "ready" ? B.value.value : null
|
|
478
|
+
), r = U(() => {
|
|
479
|
+
var l;
|
|
480
|
+
return [...((l = h.value) == null ? void 0 : l.rows) ?? []];
|
|
481
|
+
}), $ = P(!1), k = be(null), d = be(null);
|
|
482
|
+
let z = null;
|
|
483
|
+
function K(l) {
|
|
471
484
|
j();
|
|
472
|
-
const
|
|
473
|
-
|
|
474
|
-
(
|
|
475
|
-
|
|
485
|
+
const a = p.sdk.menuSetting.ruleGroupEditor(l);
|
|
486
|
+
k.value = a, z = a.subscribe(
|
|
487
|
+
(o) => {
|
|
488
|
+
d.value = o.status === "ready" ? o.value : null;
|
|
476
489
|
}
|
|
477
|
-
),
|
|
490
|
+
), $.value = !0;
|
|
478
491
|
}
|
|
479
492
|
function j() {
|
|
480
|
-
var
|
|
481
|
-
|
|
493
|
+
var l;
|
|
494
|
+
M.value = !1, z == null || z(), z = null, (l = k.value) == null || l.dispose(), k.value = null, d.value = null, $.value = !1;
|
|
482
495
|
}
|
|
483
|
-
|
|
484
|
-
function
|
|
485
|
-
var
|
|
486
|
-
if (!((
|
|
496
|
+
ye(() => j());
|
|
497
|
+
function V() {
|
|
498
|
+
var l;
|
|
499
|
+
if (!((l = d.value) != null && l.dirty)) {
|
|
487
500
|
j();
|
|
488
501
|
return;
|
|
489
502
|
}
|
|
490
|
-
|
|
503
|
+
g.open({
|
|
491
504
|
title: e("menu.common.dialog.dismiss.title"),
|
|
492
505
|
message: e("menu.common.dialog.dismiss.message"),
|
|
493
506
|
primaryActions: {
|
|
@@ -500,17 +513,17 @@ const We = {
|
|
|
500
513
|
}
|
|
501
514
|
}).onPrimary(() => j());
|
|
502
515
|
}
|
|
503
|
-
const
|
|
504
|
-
let
|
|
505
|
-
function
|
|
506
|
-
return
|
|
507
|
-
key: `condition-${
|
|
516
|
+
const M = P(!1), ae = P(null), ce = P(!1), D = P([]), oe = P([]), J = P(""), Q = P("");
|
|
517
|
+
let de = 0;
|
|
518
|
+
function X() {
|
|
519
|
+
return de += 1, {
|
|
520
|
+
key: `condition-${de}`,
|
|
508
521
|
attribute: null,
|
|
509
522
|
operator: null,
|
|
510
523
|
values: []
|
|
511
524
|
};
|
|
512
525
|
}
|
|
513
|
-
const
|
|
526
|
+
const me = [
|
|
514
527
|
{ value: "in", label: "menu.rule_groups.condition_view.operator.in" },
|
|
515
528
|
{
|
|
516
529
|
value: "notIn",
|
|
@@ -520,133 +533,136 @@ const We = {
|
|
|
520
533
|
value: "startsWith",
|
|
521
534
|
label: "menu.rule_groups.condition_view.operator.starts_with"
|
|
522
535
|
}
|
|
523
|
-
],
|
|
524
|
-
() =>
|
|
536
|
+
], Ce = U(
|
|
537
|
+
() => me.map((l) => ({ label: e(l.label), value: l.value }))
|
|
525
538
|
);
|
|
526
|
-
function
|
|
527
|
-
var
|
|
528
|
-
const
|
|
529
|
-
return
|
|
539
|
+
function Fe(l) {
|
|
540
|
+
var o;
|
|
541
|
+
const a = (o = me.find((f) => f.value === l)) == null ? void 0 : o.label;
|
|
542
|
+
return a ? e(a) : "";
|
|
530
543
|
}
|
|
531
|
-
function
|
|
532
|
-
var
|
|
533
|
-
return (((
|
|
534
|
-
(
|
|
544
|
+
function pe(l) {
|
|
545
|
+
var a;
|
|
546
|
+
return (((a = d.value) == null ? void 0 : a.attributeOptions) ?? []).find(
|
|
547
|
+
(o) => o.key === l
|
|
535
548
|
) ?? null;
|
|
536
549
|
}
|
|
537
|
-
function
|
|
538
|
-
var
|
|
539
|
-
const
|
|
540
|
-
return (((
|
|
541
|
-
label: e(
|
|
542
|
-
value:
|
|
543
|
-
})).filter((
|
|
550
|
+
function Se(l) {
|
|
551
|
+
var f;
|
|
552
|
+
const a = D.value.filter((R) => R.key !== l.key).map((R) => R.attribute), o = J.value.trim().toLowerCase();
|
|
553
|
+
return (((f = d.value) == null ? void 0 : f.attributeOptions) ?? []).filter((R) => !a.includes(R.key)).map((R) => ({
|
|
554
|
+
label: e(R.label, R.labelParams ?? {}),
|
|
555
|
+
value: R.key
|
|
556
|
+
})).filter((R) => !o || R.label.toLowerCase().includes(o));
|
|
544
557
|
}
|
|
545
|
-
function
|
|
546
|
-
var
|
|
547
|
-
const
|
|
548
|
-
return (((
|
|
558
|
+
function $e(l) {
|
|
559
|
+
var o;
|
|
560
|
+
const a = Q.value.trim().toLowerCase();
|
|
561
|
+
return (((o = pe(l.attribute)) == null ? void 0 : o.values) ?? []).map((f) => ({
|
|
549
562
|
// Display text, not a code: a value is business data shown verbatim.
|
|
550
|
-
label:
|
|
551
|
-
// FmSelect needs a primitive;
|
|
552
|
-
|
|
553
|
-
|
|
563
|
+
label: f.label,
|
|
564
|
+
// FmSelect needs a primitive; a value travels as its key.
|
|
565
|
+
value: fe(f.value),
|
|
566
|
+
selected: l.values.includes(f.value)
|
|
554
567
|
})).filter(
|
|
555
|
-
(
|
|
556
|
-
|
|
557
|
-
);
|
|
568
|
+
(f) => !a || f.label.toLowerCase().includes(a) || // A chosen value stays listed while filtering, so FmSelect keeps it.
|
|
569
|
+
f.selected
|
|
570
|
+
).map(({ label: f, value: R }) => ({ label: f, value: R }));
|
|
558
571
|
}
|
|
559
|
-
function
|
|
560
|
-
const
|
|
561
|
-
return
|
|
562
|
-
(
|
|
563
|
-
var
|
|
564
|
-
return ((
|
|
565
|
-
(U) => (U.value === null ? Z : U.value) === n
|
|
566
|
-
)) == null ? void 0 : y.label) ?? String(n);
|
|
572
|
+
function Ve(l) {
|
|
573
|
+
const a = pe(l.attribute);
|
|
574
|
+
return l.values.map(
|
|
575
|
+
(o) => {
|
|
576
|
+
var f;
|
|
577
|
+
return ((f = a == null ? void 0 : a.values.find((R) => R.value === o)) == null ? void 0 : f.label) ?? String(o);
|
|
567
578
|
}
|
|
568
579
|
).join(", ");
|
|
569
580
|
}
|
|
570
|
-
function
|
|
571
|
-
return
|
|
572
|
-
(
|
|
581
|
+
function G(l, a) {
|
|
582
|
+
return oe.value.find(
|
|
583
|
+
(o) => o.field === `conditions.${l}.${a}`
|
|
573
584
|
) ?? null;
|
|
574
585
|
}
|
|
575
|
-
function
|
|
576
|
-
|
|
577
|
-
...
|
|
578
|
-
attribute:
|
|
579
|
-
operator:
|
|
580
|
-
values:
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
586
|
+
function Y(l) {
|
|
587
|
+
ae.value = (l == null ? void 0 : l.id) ?? null, ce.value = !!l && l.conditions.length > 0, D.value = l != null && l.conditions.length ? l.conditions.map((a) => ({
|
|
588
|
+
...X(),
|
|
589
|
+
attribute: a.attribute,
|
|
590
|
+
operator: a.operator,
|
|
591
|
+
values: [...a.values]
|
|
592
|
+
})) : [X()], oe.value = [], J.value = "", Q.value = "", M.value = !0;
|
|
593
|
+
}
|
|
594
|
+
function Re() {
|
|
595
|
+
D.value = [...D.value, X()];
|
|
596
|
+
}
|
|
597
|
+
function Te(l) {
|
|
598
|
+
const a = D.value.filter((o) => o.key !== l);
|
|
599
|
+
D.value = a.length > 0 ? a : [X()];
|
|
584
600
|
}
|
|
585
|
-
function
|
|
586
|
-
|
|
601
|
+
function Ue(l, a) {
|
|
602
|
+
l.attribute = a, l.values = [];
|
|
587
603
|
}
|
|
588
|
-
function
|
|
589
|
-
|
|
590
|
-
P.value = l.length > 0 ? l : [Q()];
|
|
604
|
+
function Me(l) {
|
|
605
|
+
return ie(l.operator) === "text";
|
|
591
606
|
}
|
|
592
|
-
function
|
|
593
|
-
o
|
|
607
|
+
function Ae(l, a) {
|
|
608
|
+
const o = ie(l.operator);
|
|
609
|
+
l.operator = a, ie(l.operator) !== o && (l.values = []);
|
|
594
610
|
}
|
|
595
|
-
function
|
|
596
|
-
if (!
|
|
597
|
-
const
|
|
598
|
-
attribute:
|
|
599
|
-
operator:
|
|
600
|
-
values:
|
|
601
|
-
})),
|
|
602
|
-
if (
|
|
603
|
-
|
|
611
|
+
function Ie() {
|
|
612
|
+
if (!k.value) return;
|
|
613
|
+
const l = D.value.map((o) => ({
|
|
614
|
+
attribute: o.attribute,
|
|
615
|
+
operator: o.operator,
|
|
616
|
+
values: [...o.values]
|
|
617
|
+
})), a = ae.value ? k.value.updateRule(ae.value, l) : k.value.addRule(l);
|
|
618
|
+
if (a.kind === "rejected") {
|
|
619
|
+
oe.value = a.issues;
|
|
604
620
|
return;
|
|
605
621
|
}
|
|
606
|
-
|
|
622
|
+
M.value = !1;
|
|
607
623
|
}
|
|
608
|
-
function
|
|
609
|
-
return `${e("menu.rule_groups.condition_view.rule")} ${
|
|
624
|
+
function Le(l) {
|
|
625
|
+
return `${e("menu.rule_groups.condition_view.rule")} ${l + 1}`;
|
|
610
626
|
}
|
|
611
|
-
const
|
|
627
|
+
const Z = U(
|
|
612
628
|
() => {
|
|
613
|
-
var
|
|
614
|
-
return (((
|
|
629
|
+
var l;
|
|
630
|
+
return (((l = d.value) == null ? void 0 : l.rules) ?? []).map((a) => ({ id: a.id, rule: a }));
|
|
615
631
|
}
|
|
616
632
|
);
|
|
617
|
-
function
|
|
618
|
-
var
|
|
619
|
-
(
|
|
633
|
+
function Be(l) {
|
|
634
|
+
var a;
|
|
635
|
+
(a = k.value) == null || a.reorderRules(l.map((o) => o.id));
|
|
620
636
|
}
|
|
621
|
-
function
|
|
622
|
-
var
|
|
623
|
-
(
|
|
637
|
+
function Pe(l) {
|
|
638
|
+
var a;
|
|
639
|
+
(a = k.value) == null || a.duplicateRule(l);
|
|
624
640
|
}
|
|
625
|
-
function
|
|
626
|
-
var
|
|
627
|
-
(
|
|
641
|
+
function je(l) {
|
|
642
|
+
var a;
|
|
643
|
+
(a = k.value) == null || a.removeRule(l);
|
|
628
644
|
}
|
|
629
|
-
async function
|
|
630
|
-
const
|
|
631
|
-
if (!
|
|
632
|
-
(await
|
|
645
|
+
async function Ge() {
|
|
646
|
+
const l = k.value;
|
|
647
|
+
if (!l) return;
|
|
648
|
+
(await c(() => l.submit(), {
|
|
633
649
|
successMessage: e("menu.rule_groups.saved_successfully"),
|
|
634
650
|
showLoading: () => {
|
|
635
|
-
var
|
|
636
|
-
return ((
|
|
651
|
+
var o;
|
|
652
|
+
return ((o = d.value) == null ? void 0 : o.status) === "submitting";
|
|
637
653
|
}
|
|
638
654
|
})).kind === "success" && j();
|
|
639
655
|
}
|
|
640
|
-
async function
|
|
641
|
-
await
|
|
656
|
+
async function De(l) {
|
|
657
|
+
await c(() => p.sdk.menuSetting.copyRuleGroup(l.id), {
|
|
642
658
|
successMessage: e("menu.rule_groups.saved_successfully")
|
|
643
659
|
});
|
|
644
660
|
}
|
|
645
|
-
function
|
|
646
|
-
|
|
661
|
+
function _e(l) {
|
|
662
|
+
g.open({
|
|
647
663
|
title: e("menu.rule_groups.delete_dialog.title"),
|
|
648
664
|
message: e("menu.rule_groups.delete_dialog.message", {
|
|
649
|
-
name:
|
|
665
|
+
name: l.name
|
|
650
666
|
}),
|
|
651
667
|
// Destructive, as legacy renders it (`LinkProductRuleGroups.vue:123`).
|
|
652
668
|
primaryActions: {
|
|
@@ -659,12 +675,12 @@ const We = {
|
|
|
659
675
|
close: !0
|
|
660
676
|
}
|
|
661
677
|
}).onPrimary(async () => {
|
|
662
|
-
await
|
|
678
|
+
await c(() => p.sdk.menuSetting.removeRuleGroup(l.id), {
|
|
663
679
|
successMessage: e("menu.rule_groups.saved_successfully")
|
|
664
|
-
}),
|
|
680
|
+
}), g.close();
|
|
665
681
|
});
|
|
666
682
|
}
|
|
667
|
-
const
|
|
683
|
+
const ze = U(() => [
|
|
668
684
|
{
|
|
669
685
|
accessorKey: "name",
|
|
670
686
|
enableSorting: !0,
|
|
@@ -683,138 +699,138 @@ const We = {
|
|
|
683
699
|
// Both actions are icon-only in legacy and carry NO accessible name.
|
|
684
700
|
// The new app gives them one here; without it neither a locator nor a
|
|
685
701
|
// screen reader can tell them apart.
|
|
686
|
-
cell: (
|
|
687
|
-
|
|
702
|
+
cell: (l) => N("div", { class: "px-4 flex justify-end" }, [
|
|
703
|
+
N(te.FmButton, {
|
|
688
704
|
icon: "file_copy",
|
|
689
705
|
variant: "tertiary",
|
|
690
706
|
textColor: "neutral-gray-400",
|
|
691
707
|
"aria-label": e("menu.menu_setting.rule_groups.copy_action"),
|
|
692
|
-
disabled:
|
|
693
|
-
onClick:
|
|
694
|
-
() =>
|
|
708
|
+
disabled: l.row.original.copy.state !== "allowed",
|
|
709
|
+
onClick: T(
|
|
710
|
+
() => De(l.row.original),
|
|
695
711
|
["stop", "prevent"]
|
|
696
712
|
)
|
|
697
713
|
}),
|
|
698
|
-
|
|
714
|
+
N(te.FmButton, {
|
|
699
715
|
icon: "delete",
|
|
700
716
|
variant: "tertiary",
|
|
701
717
|
textColor: "neutral-gray-400",
|
|
702
718
|
"aria-label": e("menu.menu_setting.rule_groups.delete_action"),
|
|
703
|
-
disabled:
|
|
704
|
-
onClick:
|
|
705
|
-
() =>
|
|
719
|
+
disabled: l.row.original.remove.state !== "allowed",
|
|
720
|
+
onClick: T(
|
|
721
|
+
() => _e(l.row.original),
|
|
706
722
|
["stop", "prevent"]
|
|
707
723
|
)
|
|
708
724
|
})
|
|
709
725
|
])
|
|
710
726
|
}
|
|
711
727
|
]);
|
|
712
|
-
return (
|
|
713
|
-
const
|
|
714
|
-
return
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
"model-value":
|
|
728
|
+
return (l, a) => {
|
|
729
|
+
const o = C("FmButton"), f = C("FmSearch"), R = C("FmTable"), ne = C("FmTextField"), Oe = C("FmMenu"), Ne = C("FmHelperText"), ve = C("FmSideSheet"), se = C("FmSelect");
|
|
730
|
+
return h.value ? (i(), y("div", ct, [
|
|
731
|
+
I.value ? (i(), y("div", bt, [
|
|
732
|
+
n("div", ft, [
|
|
733
|
+
n("div", yt, [
|
|
734
|
+
u(f, {
|
|
735
|
+
"model-value": h.value.query,
|
|
720
736
|
autofocus: "",
|
|
721
737
|
class: "w-full",
|
|
722
738
|
placeholder: t(e)("menu.rule_groups.search_placeholder"),
|
|
723
|
-
"onUpdate:modelValue":
|
|
739
|
+
"onUpdate:modelValue": a[3] || (a[3] = (s) => l.sdk.menuSetting.searchRuleGroups(String(s ?? "")))
|
|
724
740
|
}, null, 8, ["model-value", "placeholder"])
|
|
725
741
|
]),
|
|
726
|
-
|
|
742
|
+
u(o, {
|
|
727
743
|
icon: "add",
|
|
728
744
|
variant: "secondary",
|
|
729
745
|
"aria-label": t(e)("menu.rule_groups.create_group"),
|
|
730
|
-
disabled:
|
|
731
|
-
onClick:
|
|
746
|
+
disabled: h.value.create.state !== "allowed",
|
|
747
|
+
onClick: a[4] || (a[4] = (s) => K())
|
|
732
748
|
}, null, 8, ["aria-label", "disabled"])
|
|
733
749
|
]),
|
|
734
|
-
|
|
735
|
-
(
|
|
750
|
+
n("div", ht, [
|
|
751
|
+
(i(!0), y(O, null, W(h.value.rows, (s) => (i(), y("div", {
|
|
736
752
|
key: s.id,
|
|
737
753
|
class: "flex flex-row py-12 px-16 cursor-pointer",
|
|
738
|
-
onClick: (
|
|
754
|
+
onClick: (x) => K(s.id)
|
|
739
755
|
}, [
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
s.description ? (
|
|
756
|
+
n("div", xt, [
|
|
757
|
+
n("p", wt, w(s.name), 1),
|
|
758
|
+
s.description ? (i(), y("p", Ct, w(s.description), 1)) : A("", !0)
|
|
743
759
|
]),
|
|
744
|
-
|
|
760
|
+
u(o, {
|
|
745
761
|
"text-color": "neutral-gray-400",
|
|
746
762
|
variant: "tertiary",
|
|
747
763
|
icon: "delete",
|
|
748
764
|
"aria-label": t(e)("menu.menu_setting.rule_groups.delete_action"),
|
|
749
765
|
disabled: s.remove.state !== "allowed",
|
|
750
|
-
onClick:
|
|
766
|
+
onClick: T((x) => _e(s), ["stop"])
|
|
751
767
|
}, null, 8, ["aria-label", "disabled", "onClick"])
|
|
752
|
-
], 8,
|
|
768
|
+
], 8, kt))), 128))
|
|
753
769
|
])
|
|
754
|
-
])) : (
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
770
|
+
])) : (i(), y("div", dt, [
|
|
771
|
+
n("div", mt, [
|
|
772
|
+
n("div", null, [
|
|
773
|
+
n("h1", pt, w(t(e)("menu.rule_groups.title")), 1),
|
|
774
|
+
n("p", _t, w(t(e)("menu.rule_groups.description")), 1)
|
|
759
775
|
]),
|
|
760
|
-
|
|
776
|
+
u(o, {
|
|
761
777
|
label: t(e)("menu.rule_groups.create_group"),
|
|
762
778
|
"prepend-icon": "add",
|
|
763
|
-
disabled:
|
|
764
|
-
onClick:
|
|
779
|
+
disabled: h.value.create.state !== "allowed",
|
|
780
|
+
onClick: a[0] || (a[0] = (s) => K())
|
|
765
781
|
}, null, 8, ["label", "disabled"])
|
|
766
782
|
]),
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
"model-value":
|
|
783
|
+
n("div", vt, [
|
|
784
|
+
n("div", gt, [
|
|
785
|
+
u(f, {
|
|
786
|
+
"model-value": h.value.query,
|
|
771
787
|
autofocus: "",
|
|
772
788
|
class: "mb-8",
|
|
773
789
|
placeholder: t(e)("menu.rule_groups.search_placeholder"),
|
|
774
|
-
"onUpdate:modelValue":
|
|
790
|
+
"onUpdate:modelValue": a[1] || (a[1] = (s) => l.sdk.menuSetting.searchRuleGroups(String(s ?? "")))
|
|
775
791
|
}, null, 8, ["model-value", "placeholder"])
|
|
776
792
|
])
|
|
777
793
|
]),
|
|
778
|
-
|
|
779
|
-
default:
|
|
780
|
-
|
|
781
|
-
"column-defs":
|
|
782
|
-
"row-data":
|
|
783
|
-
"page-size": Math.max(
|
|
794
|
+
u(xe, null, {
|
|
795
|
+
default: v(() => [
|
|
796
|
+
u(R, {
|
|
797
|
+
"column-defs": ze.value,
|
|
798
|
+
"row-data": r.value,
|
|
799
|
+
"page-size": Math.max(r.value.length, 1),
|
|
784
800
|
"hide-footer": "",
|
|
785
|
-
onRowClick:
|
|
801
|
+
onRowClick: a[2] || (a[2] = (s) => K(s.original.id))
|
|
786
802
|
}, null, 8, ["column-defs", "row-data", "page-size"])
|
|
787
803
|
]),
|
|
788
804
|
_: 1
|
|
789
805
|
})
|
|
790
806
|
])),
|
|
791
|
-
|
|
807
|
+
$.value && d.value ? (i(), S(ve, {
|
|
792
808
|
key: 2,
|
|
793
|
-
"model-value":
|
|
809
|
+
"model-value": $.value,
|
|
794
810
|
"max-width": 760,
|
|
795
|
-
"onOn:clickedAway":
|
|
811
|
+
"onOn:clickedAway": V
|
|
796
812
|
}, {
|
|
797
|
-
"side-sheet-header":
|
|
798
|
-
|
|
813
|
+
"side-sheet-header": v(() => [
|
|
814
|
+
u(o, {
|
|
799
815
|
variant: "tertiary",
|
|
800
816
|
class: "cursor-pointer mr-4",
|
|
801
817
|
"prepend-icon": "arrow_back",
|
|
802
818
|
"aria-label": t(e)("menu.common.actions.back"),
|
|
803
819
|
onClick: j
|
|
804
820
|
}, null, 8, ["aria-label"]),
|
|
805
|
-
|
|
821
|
+
n("p", Ft, w(d.value.mode === "create" ? t(e)("menu.rule_groups.create_group") : t(e)("menu.rule_groups.edit_group")), 1)
|
|
806
822
|
]),
|
|
807
|
-
"side-sheet-footer":
|
|
808
|
-
|
|
809
|
-
|
|
823
|
+
"side-sheet-footer": v(() => [
|
|
824
|
+
n("div", Et, [
|
|
825
|
+
u(o, {
|
|
810
826
|
label: t(e)("menu.common.actions.save"),
|
|
811
827
|
size: "lg",
|
|
812
828
|
variant: "primary",
|
|
813
|
-
disabled:
|
|
814
|
-
loading:
|
|
815
|
-
onClick:
|
|
829
|
+
disabled: d.value.submit.state !== "allowed",
|
|
830
|
+
loading: d.value.status === "submitting",
|
|
831
|
+
onClick: Ge
|
|
816
832
|
}, null, 8, ["label", "disabled", "loading"]),
|
|
817
|
-
|
|
833
|
+
u(o, {
|
|
818
834
|
label: t(e)("menu.common.actions.cancel"),
|
|
819
835
|
size: "lg",
|
|
820
836
|
variant: "tertiary",
|
|
@@ -822,117 +838,120 @@ const We = {
|
|
|
822
838
|
}, null, 8, ["label"])
|
|
823
839
|
])
|
|
824
840
|
]),
|
|
825
|
-
default:
|
|
826
|
-
|
|
827
|
-
|
|
841
|
+
default: v(() => [
|
|
842
|
+
n("div", St, [
|
|
843
|
+
u(ee, {
|
|
828
844
|
title: t(e)("menu.rule_groups.form.basic_info")
|
|
829
845
|
}, {
|
|
830
|
-
default:
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
"model-value":
|
|
846
|
+
default: v(() => [
|
|
847
|
+
n("div", $t, [
|
|
848
|
+
u(ne, {
|
|
849
|
+
"model-value": d.value.name,
|
|
834
850
|
label: t(e)("menu.rule_groups.form.name"),
|
|
835
851
|
"label-mark": "required",
|
|
836
852
|
placeholder: t(e)("menu.rule_groups.form.name_placeholder"),
|
|
837
|
-
"helper-state":
|
|
838
|
-
"helper-text":
|
|
839
|
-
"onUpdate:modelValue":
|
|
840
|
-
var
|
|
841
|
-
return (
|
|
853
|
+
"helper-state": d.value.nameIssue ? "error" : "none",
|
|
854
|
+
"helper-text": d.value.nameIssue ? t(F)(d.value.nameIssue) : "",
|
|
855
|
+
"onUpdate:modelValue": a[5] || (a[5] = (s) => {
|
|
856
|
+
var x;
|
|
857
|
+
return (x = k.value) == null ? void 0 : x.setName(String(s ?? ""));
|
|
842
858
|
})
|
|
843
859
|
}, null, 8, ["model-value", "label", "placeholder", "helper-state", "helper-text"]),
|
|
844
|
-
|
|
845
|
-
"model-value":
|
|
860
|
+
u(ne, {
|
|
861
|
+
"model-value": d.value.description,
|
|
846
862
|
label: t(e)("menu.rule_groups.form.description"),
|
|
847
863
|
"label-mark": "optional",
|
|
848
864
|
placeholder: t(e)("menu.rule_groups.form.description_placeholder"),
|
|
849
|
-
"onUpdate:modelValue":
|
|
850
|
-
var
|
|
851
|
-
return (
|
|
865
|
+
"onUpdate:modelValue": a[6] || (a[6] = (s) => {
|
|
866
|
+
var x;
|
|
867
|
+
return (x = k.value) == null ? void 0 : x.setDescription(String(s ?? ""));
|
|
852
868
|
})
|
|
853
869
|
}, null, 8, ["model-value", "label", "placeholder"])
|
|
854
870
|
])
|
|
855
871
|
]),
|
|
856
872
|
_: 1
|
|
857
873
|
}, 8, ["title"]),
|
|
858
|
-
|
|
874
|
+
u(ee, {
|
|
859
875
|
title: t(e)("menu.rule_groups.form.rules"),
|
|
860
876
|
"sub-title": t(e)("menu.rule_groups.form.rules_description")
|
|
861
877
|
}, {
|
|
862
|
-
default:
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
"model-value":
|
|
878
|
+
default: v(() => [
|
|
879
|
+
Z.value.length > 0 ? (i(), y(O, { key: 0 }, [
|
|
880
|
+
u(t(We), {
|
|
881
|
+
"model-value": Z.value,
|
|
866
882
|
"item-key": "id",
|
|
867
883
|
handle: ".rule-drag-handle",
|
|
868
|
-
"onUpdate:modelValue":
|
|
884
|
+
"onUpdate:modelValue": Be
|
|
869
885
|
}, {
|
|
870
|
-
item:
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
886
|
+
item: v(({ element: s, index: x }) => [
|
|
887
|
+
n("div", Vt, [
|
|
888
|
+
n("div", Rt, [
|
|
889
|
+
u(o, {
|
|
874
890
|
class: "rule-drag-handle cursor-grab",
|
|
875
891
|
variant: "tertiary",
|
|
876
892
|
"prepend-icon": "drag_indicator",
|
|
877
893
|
"aria-label": t(e)("menu.menu_setting.rule_groups.reorder_rule")
|
|
878
894
|
}, null, 8, ["aria-label"]),
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
895
|
+
n("div", Tt, [
|
|
896
|
+
n("div", Ut, [
|
|
897
|
+
n("div", Mt, [
|
|
898
|
+
n("p", At, w(Le(x)), 1),
|
|
899
|
+
n("div", It, [
|
|
900
|
+
u(o, {
|
|
885
901
|
variant: "tertiary",
|
|
886
902
|
class: "cursor-pointer",
|
|
887
903
|
"prepend-icon": "edit",
|
|
888
904
|
"text-color": "primary",
|
|
889
905
|
"aria-label": t(e)("menu.link_product.rules.edit_rule"),
|
|
890
|
-
onClick:
|
|
906
|
+
onClick: T((_) => Y(s.rule), ["stop"])
|
|
891
907
|
}, null, 8, ["aria-label", "onClick"]),
|
|
892
|
-
|
|
908
|
+
u(o, {
|
|
893
909
|
variant: "tertiary",
|
|
894
910
|
class: "cursor-pointer",
|
|
895
911
|
"prepend-icon": "file_copy",
|
|
896
912
|
"text-color": "primary",
|
|
897
913
|
"aria-label": t(e)("menu.menu_setting.rule_groups.copy_rule"),
|
|
898
|
-
onClick:
|
|
914
|
+
onClick: T((_) => Pe(s.id), ["stop"])
|
|
899
915
|
}, null, 8, ["aria-label", "onClick"]),
|
|
900
|
-
|
|
916
|
+
u(o, {
|
|
901
917
|
variant: "tertiary",
|
|
902
918
|
class: "cursor-pointer",
|
|
903
919
|
"prepend-icon": "delete",
|
|
904
920
|
"text-color": "typo-error",
|
|
905
921
|
"aria-label": t(e)("menu.menu_setting.rule_groups.remove_rule"),
|
|
906
|
-
onClick:
|
|
922
|
+
onClick: T((_) => je(s.id), ["stop"])
|
|
907
923
|
}, null, 8, ["aria-label", "onClick"])
|
|
908
924
|
])
|
|
909
925
|
]),
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
(
|
|
913
|
-
key:
|
|
926
|
+
n("div", Lt, [
|
|
927
|
+
n("p", Bt, w(t(e)("menu.rule_groups.condition_view.when")), 1),
|
|
928
|
+
(i(!0), y(O, null, W(s.rule.conditions, (_, ge) => (i(), y("div", {
|
|
929
|
+
key: ge,
|
|
914
930
|
class: "flex w-full items-center space-x-8"
|
|
915
931
|
}, [
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
932
|
+
n("p", Pt, w(ge + 1) + ".", 1),
|
|
933
|
+
n("div", jt, [
|
|
934
|
+
n("p", Gt, w(t(e)(
|
|
935
|
+
_.attributeLabel,
|
|
936
|
+
_.attributeLabelParams ?? {}
|
|
937
|
+
)), 1),
|
|
938
|
+
n("p", Dt, w(Fe(_.operator)), 1),
|
|
939
|
+
u(Oe, {
|
|
921
940
|
trigger: "hover",
|
|
922
941
|
"close-on-mouse-leave": ""
|
|
923
942
|
}, {
|
|
924
|
-
"menu-button":
|
|
925
|
-
|
|
943
|
+
"menu-button": v(() => [
|
|
944
|
+
n("p", {
|
|
926
945
|
class: "text-fm-color-primary underline underline-offset-2 cursor-pointer truncate",
|
|
927
|
-
onClick:
|
|
928
|
-
},
|
|
946
|
+
onClick: T((ue) => Y(s.rule), ["stop"])
|
|
947
|
+
}, w(_.valueLabels.join(", ")), 9, zt)
|
|
929
948
|
]),
|
|
930
|
-
default:
|
|
931
|
-
(
|
|
932
|
-
key:
|
|
949
|
+
default: v(() => [
|
|
950
|
+
(i(!0), y(O, null, W(_.valueLabels, (ue) => (i(), y("div", {
|
|
951
|
+
key: ue,
|
|
933
952
|
class: "flex flex-col px-8 space-y-8"
|
|
934
953
|
}, [
|
|
935
|
-
|
|
954
|
+
n("p", null, w(ue), 1)
|
|
936
955
|
]))), 128))
|
|
937
956
|
]),
|
|
938
957
|
_: 2
|
|
@@ -943,99 +962,99 @@ const We = {
|
|
|
943
962
|
])
|
|
944
963
|
])
|
|
945
964
|
]),
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
])) :
|
|
965
|
+
Z.value.length > 1 && x < Z.value.length - 1 ? (i(), y("div", Ot, [
|
|
966
|
+
n("span", Nt, w(t(e)("menu.rule_groups.condition_view.or")), 1)
|
|
967
|
+
])) : A("", !0)
|
|
949
968
|
])
|
|
950
969
|
]),
|
|
951
970
|
_: 1
|
|
952
971
|
}, 8, ["model-value"]),
|
|
953
|
-
|
|
954
|
-
|
|
972
|
+
n("div", null, [
|
|
973
|
+
u(o, {
|
|
955
974
|
variant: "primary",
|
|
956
975
|
label: t(e)("menu.link_product.rules.add_rule"),
|
|
957
976
|
"prepend-icon": "add",
|
|
958
|
-
onClick:
|
|
977
|
+
onClick: a[7] || (a[7] = T((s) => Y(), ["stop"]))
|
|
959
978
|
}, null, 8, ["label"])
|
|
960
979
|
])
|
|
961
|
-
], 64)) : (
|
|
980
|
+
], 64)) : (i(), S(t(ke), {
|
|
962
981
|
key: 1,
|
|
963
982
|
title: "",
|
|
964
983
|
subtitle: t(e)("menu.rule_groups.condition_view.empty_data.no_rule_available"),
|
|
965
984
|
action: {
|
|
966
985
|
text: t(e)("menu.link_product.rules.add_rule"),
|
|
967
|
-
callback: () =>
|
|
986
|
+
callback: () => Y()
|
|
968
987
|
}
|
|
969
988
|
}, null, 8, ["subtitle", "action"])),
|
|
970
|
-
|
|
989
|
+
d.value.rulesIssue ? (i(), S(Ne, {
|
|
971
990
|
key: 2,
|
|
972
991
|
state: "error",
|
|
973
|
-
text: t(
|
|
974
|
-
}, null, 8, ["text"])) :
|
|
992
|
+
text: t(F)(d.value.rulesIssue)
|
|
993
|
+
}, null, 8, ["text"])) : A("", !0)
|
|
975
994
|
]),
|
|
976
995
|
_: 1
|
|
977
996
|
}, 8, ["title", "sub-title"])
|
|
978
997
|
])
|
|
979
998
|
]),
|
|
980
999
|
_: 1
|
|
981
|
-
}, 8, ["model-value"])) :
|
|
982
|
-
|
|
1000
|
+
}, 8, ["model-value"])) : A("", !0),
|
|
1001
|
+
M.value ? (i(), S(ve, {
|
|
983
1002
|
key: 3,
|
|
984
|
-
"model-value":
|
|
1003
|
+
"model-value": M.value,
|
|
985
1004
|
"max-width": 760,
|
|
986
1005
|
"close-button": !1,
|
|
987
|
-
"onOn:clickedAway":
|
|
1006
|
+
"onOn:clickedAway": a[15] || (a[15] = (s) => M.value = !1)
|
|
988
1007
|
}, {
|
|
989
|
-
"side-sheet-header":
|
|
990
|
-
|
|
991
|
-
|
|
1008
|
+
"side-sheet-header": v(() => [
|
|
1009
|
+
n("div", qt, [
|
|
1010
|
+
u(o, {
|
|
992
1011
|
variant: "tertiary",
|
|
993
1012
|
"prepend-icon": "arrow_back",
|
|
994
1013
|
"aria-label": t(e)("menu.common.actions.back"),
|
|
995
|
-
onClick:
|
|
1014
|
+
onClick: a[8] || (a[8] = T((s) => M.value = !1, ["stop"]))
|
|
996
1015
|
}, null, 8, ["aria-label"]),
|
|
997
|
-
|
|
1016
|
+
n("div", Kt, w(ce.value ? t(e)("menu.rule_groups.condition_view.edit_condition") : t(e)("menu.rule_groups.condition_view.add_condition")), 1)
|
|
998
1017
|
])
|
|
999
1018
|
]),
|
|
1000
|
-
"side-sheet-footer":
|
|
1001
|
-
|
|
1002
|
-
|
|
1019
|
+
"side-sheet-footer": v(() => [
|
|
1020
|
+
n("div", Zt, [
|
|
1021
|
+
u(o, {
|
|
1003
1022
|
variant: "primary",
|
|
1004
1023
|
label: t(e)("menu.common.actions.save"),
|
|
1005
|
-
onClick:
|
|
1024
|
+
onClick: Ie
|
|
1006
1025
|
}, null, 8, ["label"]),
|
|
1007
|
-
|
|
1026
|
+
u(o, {
|
|
1008
1027
|
variant: "secondary",
|
|
1009
1028
|
label: t(e)("menu.common.actions.cancel"),
|
|
1010
|
-
onClick:
|
|
1029
|
+
onClick: a[14] || (a[14] = T((s) => M.value = !1, ["stop"]))
|
|
1011
1030
|
}, null, 8, ["label"])
|
|
1012
1031
|
])
|
|
1013
1032
|
]),
|
|
1014
|
-
default:
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
(
|
|
1033
|
+
default: v(() => [
|
|
1034
|
+
n("div", Wt, [
|
|
1035
|
+
n("p", Ht, w(t(e)("menu.rule_groups.condition_view.condition")), 1),
|
|
1036
|
+
n("div", Jt, [
|
|
1037
|
+
(i(!0), y(O, null, W(D.value, (s, x) => (i(), y("div", {
|
|
1019
1038
|
key: s.key,
|
|
1020
1039
|
class: "flex justify-between gap-8"
|
|
1021
1040
|
}, [
|
|
1022
|
-
|
|
1023
|
-
|
|
1041
|
+
n("div", Qt, [
|
|
1042
|
+
u(se, {
|
|
1024
1043
|
class: "flex w-full",
|
|
1025
1044
|
"model-value": s.attribute,
|
|
1026
|
-
items:
|
|
1045
|
+
items: Se(s),
|
|
1027
1046
|
placeholder: t(e)("menu.rule_groups.condition_view.select_item"),
|
|
1028
1047
|
"aria-label": t(e)("menu.menu_setting.rule_groups.condition.attribute"),
|
|
1029
|
-
"onUpdate:modelValue": (
|
|
1048
|
+
"onUpdate:modelValue": (_) => Ue(s, _)
|
|
1030
1049
|
}, {
|
|
1031
|
-
"prepend-menu":
|
|
1032
|
-
|
|
1033
|
-
onClick:
|
|
1050
|
+
"prepend-menu": v(() => [
|
|
1051
|
+
n("div", {
|
|
1052
|
+
onClick: a[10] || (a[10] = T(() => {
|
|
1034
1053
|
}, ["stop"]))
|
|
1035
1054
|
}, [
|
|
1036
|
-
|
|
1037
|
-
modelValue:
|
|
1038
|
-
"onUpdate:modelValue":
|
|
1055
|
+
u(f, {
|
|
1056
|
+
modelValue: J.value,
|
|
1057
|
+
"onUpdate:modelValue": a[9] || (a[9] = (_) => J.value = _),
|
|
1039
1058
|
class: "px-8",
|
|
1040
1059
|
placeholder: t(e)("menu.menu_setting.rule_groups.filter_options")
|
|
1041
1060
|
}, null, 8, ["modelValue", "placeholder"])
|
|
@@ -1043,122 +1062,136 @@ const We = {
|
|
|
1043
1062
|
]),
|
|
1044
1063
|
_: 2
|
|
1045
1064
|
}, 1032, ["model-value", "items", "placeholder", "aria-label", "onUpdate:modelValue"]),
|
|
1046
|
-
|
|
1065
|
+
u(se, {
|
|
1047
1066
|
class: "flex w-full",
|
|
1048
1067
|
"model-value": s.operator,
|
|
1049
|
-
items:
|
|
1068
|
+
items: Ce.value,
|
|
1050
1069
|
placeholder: t(e)("menu.rule_groups.condition_view.select_item"),
|
|
1051
1070
|
"aria-label": t(e)("menu.menu_setting.rule_groups.condition.operator"),
|
|
1052
|
-
"helper-state":
|
|
1053
|
-
"helper-text":
|
|
1054
|
-
"onUpdate:modelValue": (
|
|
1071
|
+
"helper-state": G(x, "operator") ? "error" : "none",
|
|
1072
|
+
"helper-text": G(x, "operator") ? t(F)(G(x, "operator")) : "",
|
|
1073
|
+
"onUpdate:modelValue": (_) => Ae(s, _)
|
|
1055
1074
|
}, null, 8, ["model-value", "items", "placeholder", "aria-label", "helper-state", "helper-text", "onUpdate:modelValue"]),
|
|
1056
|
-
i(
|
|
1075
|
+
Me(s) ? qe((i(), y("div", Xt, [
|
|
1076
|
+
u(ne, {
|
|
1077
|
+
"model-value": String(s.values[0] ?? ""),
|
|
1078
|
+
placeholder: t(e)("menu.menu_setting.rule_groups.condition.value"),
|
|
1079
|
+
"helper-state": G(x, "values") ? "error" : "none",
|
|
1080
|
+
"helper-text": G(x, "values") ? t(F)(G(x, "values")) : "",
|
|
1081
|
+
"onUpdate:modelValue": (_) => s.values = _ === "" || _ == null ? [] : [String(_)]
|
|
1082
|
+
}, null, 8, ["model-value", "placeholder", "helper-state", "helper-text", "onUpdate:modelValue"])
|
|
1083
|
+
])), [
|
|
1084
|
+
[
|
|
1085
|
+
b,
|
|
1086
|
+
t(e)("menu.menu_setting.rule_groups.condition.value")
|
|
1087
|
+
]
|
|
1088
|
+
]) : (i(), S(se, {
|
|
1089
|
+
key: 1,
|
|
1057
1090
|
class: "flex w-full",
|
|
1058
|
-
"model-value": s.values,
|
|
1059
|
-
items:
|
|
1091
|
+
"model-value": s.values.map(t(fe)),
|
|
1092
|
+
items: $e(s),
|
|
1060
1093
|
multiselect: "",
|
|
1061
1094
|
"hide-chips": "",
|
|
1062
1095
|
placeholder: t(e)("menu.rule_groups.condition_view.select_item"),
|
|
1063
1096
|
"aria-label": t(e)("menu.menu_setting.rule_groups.condition.value"),
|
|
1064
|
-
"helper-state":
|
|
1065
|
-
"helper-text":
|
|
1066
|
-
"onUpdate:modelValue": (
|
|
1097
|
+
"helper-state": G(x, "values") ? "error" : "none",
|
|
1098
|
+
"helper-text": G(x, "values") ? t(F)(G(x, "values")) : "",
|
|
1099
|
+
"onUpdate:modelValue": (_) => s.values = _.map(t(Ye))
|
|
1067
1100
|
}, {
|
|
1068
|
-
default:
|
|
1069
|
-
|
|
1101
|
+
default: v(() => [
|
|
1102
|
+
n("div", Yt, w(Ve(s)), 1)
|
|
1070
1103
|
]),
|
|
1071
|
-
"prepend-menu":
|
|
1072
|
-
|
|
1104
|
+
"prepend-menu": v(() => [
|
|
1105
|
+
n("div", {
|
|
1073
1106
|
class: "flex",
|
|
1074
|
-
onClick:
|
|
1107
|
+
onClick: a[12] || (a[12] = T(() => {
|
|
1075
1108
|
}, ["stop"]))
|
|
1076
1109
|
}, [
|
|
1077
|
-
|
|
1078
|
-
modelValue:
|
|
1079
|
-
"onUpdate:modelValue":
|
|
1110
|
+
u(f, {
|
|
1111
|
+
modelValue: Q.value,
|
|
1112
|
+
"onUpdate:modelValue": a[11] || (a[11] = (_) => Q.value = _),
|
|
1080
1113
|
class: "px-8",
|
|
1081
1114
|
placeholder: t(e)("menu.menu_setting.rule_groups.filter_options")
|
|
1082
1115
|
}, null, 8, ["modelValue", "placeholder"])
|
|
1083
1116
|
])
|
|
1084
1117
|
]),
|
|
1085
1118
|
_: 2
|
|
1086
|
-
}, 1032, ["model-value", "items", "placeholder", "aria-label", "helper-state", "helper-text", "onUpdate:modelValue"])
|
|
1119
|
+
}, 1032, ["model-value", "items", "placeholder", "aria-label", "helper-state", "helper-text", "onUpdate:modelValue"]))
|
|
1087
1120
|
]),
|
|
1088
|
-
|
|
1121
|
+
u(o, {
|
|
1089
1122
|
variant: "tertiary",
|
|
1090
1123
|
"prepend-icon": "close",
|
|
1091
1124
|
"aria-label": t(e)("menu.menu_setting.rule_groups.remove_condition"),
|
|
1092
|
-
onClick:
|
|
1125
|
+
onClick: T((_) => Te(s.key), ["stop"])
|
|
1093
1126
|
}, null, 8, ["aria-label", "onClick"])
|
|
1094
1127
|
]))), 128)),
|
|
1095
|
-
|
|
1128
|
+
u(o, {
|
|
1096
1129
|
variant: "plain",
|
|
1097
1130
|
"prepend-icon": "add",
|
|
1098
1131
|
label: t(e)("menu.rule_groups.condition_view.add_condition"),
|
|
1099
|
-
onClick:
|
|
1132
|
+
onClick: a[13] || (a[13] = T((s) => Re(), ["stop"]))
|
|
1100
1133
|
}, null, 8, ["label"])
|
|
1101
1134
|
])
|
|
1102
1135
|
])
|
|
1103
1136
|
]),
|
|
1104
1137
|
_: 1
|
|
1105
|
-
}, 8, ["model-value"])) :
|
|
1106
|
-
])) :
|
|
1138
|
+
}, 8, ["model-value"])) : A("", !0)
|
|
1139
|
+
])) : A("", !0);
|
|
1107
1140
|
};
|
|
1108
1141
|
}
|
|
1109
|
-
}),
|
|
1142
|
+
}), tl = { class: "flex h-full min-h-[240px] flex-col items-center justify-center gap-8 p-24 text-center" }, ll = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, al = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ol = /* @__PURE__ */ E({
|
|
1110
1143
|
__name: "PlaceholderView",
|
|
1111
1144
|
props: {
|
|
1112
1145
|
module: {}
|
|
1113
1146
|
},
|
|
1114
|
-
setup(
|
|
1115
|
-
const { t:
|
|
1116
|
-
return (e,
|
|
1117
|
-
|
|
1118
|
-
|
|
1147
|
+
setup(L) {
|
|
1148
|
+
const { t: p } = q();
|
|
1149
|
+
return (e, b) => (i(), y("div", tl, [
|
|
1150
|
+
n("p", ll, w(e.module), 1),
|
|
1151
|
+
n("p", al, w(t(p)("menu.common.placeholder.not_migrated")), 1)
|
|
1119
1152
|
]));
|
|
1120
1153
|
}
|
|
1121
|
-
}),
|
|
1154
|
+
}), nl = { class: "py-16" }, fl = /* @__PURE__ */ E({
|
|
1122
1155
|
__name: "MenuSetting",
|
|
1123
|
-
setup(
|
|
1124
|
-
const
|
|
1156
|
+
setup(L) {
|
|
1157
|
+
const p = He(), { t: e } = q(), b = H(p.menuSetting.tabs), F = {
|
|
1125
1158
|
configuration: "menu.menu_setting.tabs.menu_configuration",
|
|
1126
1159
|
priceGroup: "menu.menu_setting.tabs.price_group",
|
|
1127
1160
|
memberPricing: "menu.menu_setting.tabs.member_pricing",
|
|
1128
1161
|
ruleGroups: "menu.menu_setting.tabs.link_product_rule_groups"
|
|
1129
|
-
},
|
|
1130
|
-
() => (
|
|
1131
|
-
label: e(
|
|
1132
|
-
value:
|
|
1162
|
+
}, g = U(
|
|
1163
|
+
() => (b.value.status === "ready" ? b.value.value.tabs : []).filter((m) => m.capability.state !== "hidden").map((m) => ({
|
|
1164
|
+
label: e(F[m.key]),
|
|
1165
|
+
value: m.key
|
|
1133
1166
|
}))
|
|
1134
|
-
), c =
|
|
1135
|
-
return (
|
|
1136
|
-
const
|
|
1137
|
-
return
|
|
1167
|
+
), c = P("configuration");
|
|
1168
|
+
return (m, I) => {
|
|
1169
|
+
const B = C("FmTabs");
|
|
1170
|
+
return i(), S(we, {
|
|
1138
1171
|
heading: t(e)("menu.menu_setting.title")
|
|
1139
1172
|
}, {
|
|
1140
|
-
default:
|
|
1141
|
-
|
|
1173
|
+
default: v(() => [
|
|
1174
|
+
u(B, {
|
|
1142
1175
|
"model-value": c.value,
|
|
1143
|
-
items:
|
|
1144
|
-
"onUpdate:modelValue":
|
|
1176
|
+
items: g.value,
|
|
1177
|
+
"onUpdate:modelValue": I[0] || (I[0] = (h) => c.value = h)
|
|
1145
1178
|
}, null, 8, ["model-value", "items"]),
|
|
1146
|
-
|
|
1147
|
-
c.value === "configuration" ? (
|
|
1179
|
+
n("div", nl, [
|
|
1180
|
+
c.value === "configuration" ? (i(), S(lt, {
|
|
1148
1181
|
key: 0,
|
|
1149
|
-
sdk: t(
|
|
1150
|
-
}, null, 8, ["sdk"])) : c.value === "priceGroup" ? (
|
|
1182
|
+
sdk: t(p)
|
|
1183
|
+
}, null, 8, ["sdk"])) : c.value === "priceGroup" ? (i(), S(rt, {
|
|
1151
1184
|
key: 1,
|
|
1152
|
-
sdk: t(
|
|
1153
|
-
}, null, 8, ["sdk"])) : c.value === "memberPricing" ? (
|
|
1185
|
+
sdk: t(p)
|
|
1186
|
+
}, null, 8, ["sdk"])) : c.value === "memberPricing" ? (i(), S(ot, {
|
|
1154
1187
|
key: 2,
|
|
1155
|
-
sdk: t(
|
|
1156
|
-
}, null, 8, ["sdk"])) : c.value === "ruleGroups" ? (
|
|
1188
|
+
sdk: t(p)
|
|
1189
|
+
}, null, 8, ["sdk"])) : c.value === "ruleGroups" ? (i(), S(el, {
|
|
1157
1190
|
key: 3,
|
|
1158
|
-
sdk: t(
|
|
1159
|
-
}, null, 8, ["sdk"])) : (
|
|
1191
|
+
sdk: t(p)
|
|
1192
|
+
}, null, 8, ["sdk"])) : (i(), S(ol, {
|
|
1160
1193
|
key: 4,
|
|
1161
|
-
module: t(e)(
|
|
1194
|
+
module: t(e)(F[c.value])
|
|
1162
1195
|
}, null, 8, ["module"]))
|
|
1163
1196
|
])
|
|
1164
1197
|
]),
|
|
@@ -1168,5 +1201,5 @@ const We = {
|
|
|
1168
1201
|
}
|
|
1169
1202
|
});
|
|
1170
1203
|
export {
|
|
1171
|
-
|
|
1204
|
+
fl as default
|
|
1172
1205
|
};
|