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