@feedmepos/mf-menu 0.32.44 → 0.32.45
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-BXkiQoTM.js → App-CczmyQeJ.js} +1471 -1458
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BoSL4dm7.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BscsJpMV.js} +3 -3
- package/dist/{Catalog-CLFVLyor.js → Catalog-RU_6keJm.js} +6 -6
- package/dist/{Category-CNuVHuI3.js → Category-7Fg2kD0h.js} +79 -79
- package/dist/{Category-BdyouDU8.js → Category-CwEXbsDv.js} +4 -4
- package/dist/{CookingGuide-Bed7bUt1.js → CookingGuide-DFu5VStf.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-CZDL2xJC.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CeNfLbfq.js} +1 -1
- package/dist/{Group-TUqCPmO3.js → Group-C6vQeBnj.js} +1 -1
- package/dist/{Group-D4UTsIxI.js → Group-l-YpAi6B.js} +3 -3
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BJPT8flL.js → Group.vue_vue_type_script_setup_true_lang-1UdOBdv-.js} +165 -165
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D83liryu.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-C309DrLU.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CRIRinHB.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-C903fhuj.js} +6 -6
- package/dist/{Ingredient-CcxoeuDd.js → Ingredient-CHqDo-GY.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-58tyxdVh.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CXHHlrI0.js} +2 -2
- package/dist/{LinkProductSideSheet-DazOkwkd.js → LinkProductSideSheet-DY32g33Q.js} +3 -3
- package/dist/{MenuSetting-B3oLll4C.js → MenuSetting-DhbxlKuU.js} +5 -5
- package/dist/{PrintRoute-D878qPu8.js → PrintRoute-CToZ0ClG.js} +4 -4
- package/dist/{Product-DOC8y_mW.js → Product-Cpg32wpg.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-tZyBhWYT.js → Product.vue_vue_type_script_setup_true_lang-BC2KG1q4.js} +440 -438
- package/dist/{ProductInternalTools-9TgIc2bR.js → ProductInternalTools-wH9BN1NK.js} +5 -5
- package/dist/Products-CpINHaH6.js +291 -0
- package/dist/{Publish-BktK_PKq.js → Publish-CJS_836k.js} +3 -3
- package/dist/{Recipe-eA0xrGYk.js → Recipe-Cz7hivmM.js} +4 -4
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-t8M7z09s.js → RuleView.vue_vue_type_script_setup_true_lang-CRLzqgQe.js} +207 -207
- package/dist/{Scheduler-CKSqPZLQ.js → Scheduler-QuWCnEJw.js} +3 -3
- package/dist/{ServingSequence-Ea20baNj.js → ServingSequence-CqK5Sjmq.js} +3 -3
- package/dist/{Setting-u6lX_Dzg.js → Setting-C3tKUfsm.js} +5 -5
- package/dist/{Subcategory-C6s7OMOb.js → Subcategory-DCtTOPUj.js} +99 -100
- package/dist/{Takeaway-lWxS9oWe.js → Takeaway-BnB1OFnK.js} +1 -1
- package/dist/{Takeaway-B9kr-Nf4.js → Takeaway-Fi8SAH2t.js} +4 -4
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-oA0e9oI5.js → Takeaway.vue_vue_type_script_setup_true_lang-Cbz7Qt_g.js} +91 -91
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-T40ChY7j.js → Thumbnail.vue_vue_type_script_setup_true_lang-CPM_muXB.js} +4 -4
- package/dist/TranslationFieldSection.vue_vue_type_script_setup_true_lang-BpL8UrFY.js +278 -0
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-DtkzQeq4.js +140 -0
- package/dist/TranslationViewChip.vue_vue_type_script_setup_true_lang-CHT7Xozn.js +60 -0
- package/dist/{TreeEditorOpenner.vue_vue_type_script_setup_true_lang-B1e3d-uX.js → TreeEditorOpenner.vue_vue_type_script_setup_true_lang-DoIgiwHh.js} +13 -13
- package/dist/{Unit-DkQlUg2l.js → Unit-5yE2-y9D.js} +2 -2
- package/dist/Variant-C7lIdRID.js +248 -0
- package/dist/{_id_-_oqk-OhC.js → _id_-08ykp97a.js} +9 -9
- package/dist/{app-CfCYl2pO.js → app-CA4g3v2n.js} +26 -26
- package/dist/{app-DIYHNWEw.js → app-DPovSnb_.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/components/translation/LanguageChip.vue.d.ts +18 -0
- package/dist/apps/mf-menu/src/components/translation/LanguageSelector.vue.d.ts +33 -0
- package/dist/apps/mf-menu/src/components/translation/LocaleIconBadge.vue.d.ts +29 -0
- package/dist/apps/mf-menu/src/components/translation/TranslationFieldRow.vue.d.ts +39 -0
- package/dist/apps/mf-menu/src/components/translation/TranslationViewChip.vue.d.ts +15 -0
- package/dist/apps/mf-menu/src/composable/translationLanguages.d.ts +16 -0
- package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -0
- package/dist/apps/mf-menu/src/utils/translation.d.ts +1 -1
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-AoXjo9FF.js → linked-status-WT6deoPw.js} +2 -2
- package/dist/assets/{menu-export-BHcaWhM3.js → menu-export-DxtFXMED.js} +2 -2
- package/dist/assets/{override-menu-B9xQcjuJ.js → override-menu-BJGRdWWE.js} +2 -2
- package/dist/assets/{validate-menu-D-ezd4W8.js → validate-menu-B_tmkHe7.js} +2 -2
- package/dist/{catalog-CvN9Wu8V.js → catalog-D7Jjqj3-.js} +1 -1
- package/dist/{catalogSetting-qS5Np22q.js → catalogSetting-Bg_zMUrV.js} +1 -1
- package/dist/{currency-Nxod6uwl.js → currency-DDxFMjAI.js} +1 -1
- package/dist/{dayjs.min-B1AjAGva.js → dayjs.min-BVOO8wJG.js} +1 -1
- package/dist/{index-Cq-czJjU.js → index-BlLRjkMF.js} +8 -7
- package/dist/{index-nKlYiotY.js → index-CG7GFWlC.js} +1 -1
- package/dist/index-Cq2MVpMv.js +472 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-YXKayPEp.js → index.vue_vue_type_script_setup_true_lang-C6IVvAua.js} +169 -168
- package/dist/{item-CUZSonzT.js → item-Bq6SCc7D.js} +3250 -3386
- package/dist/{jszip.min-BnkZQ6lD.js → jszip.min-1MrCGuHF.js} +2 -2
- package/dist/{menu-BP_ArXCI.js → menu-CKA9uouu.js} +1 -1
- package/dist/{menuV2-BGEYgQ8-.js → menuV2-DBkrmeha.js} +71 -71
- package/dist/{priceTier-B-Qa0xaO.js → priceTier-Cxr9IcVP.js} +1 -1
- package/dist/{rules-Dchd_ilF.js → rules-DFWR7a3m.js} +4 -4
- package/dist/{scheduler-DN7ZGLk8.js → scheduler-HKff8Ty2.js} +4 -4
- package/dist/{toExcel-jHmkDqcm.js → toExcel-DopYrxBW.js} +2 -2
- package/dist/{unit-DgL56pkI.js → unit-5G600HMJ.js} +2 -2
- package/package.json +1 -1
- package/dist/Products-DfUGnHmD.js +0 -1568
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-CcIGCUwk.js +0 -194
- package/dist/Variant-BF5r2WLL.js +0 -247
- package/dist/index-C0Zw1cSS.js +0 -545
- package/dist/translation-Cdap0IVg.js +0 -79
- /package/dist/apps/mf-menu/src/components/{TranslationBadge.vue.d.ts → translation/TranslationBadge.vue.d.ts} +0 -0
- /package/dist/apps/mf-menu/src/components/{TranslationFieldSection.vue.d.ts → translation/TranslationFieldSection.vue.d.ts} +0 -0
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import { defineComponent as K, ref as y, watch as E, computed as F, unref as a, resolveComponent as _, createBlock as T, openBlock as i, withCtx as v, createElementVNode as t, toDisplayString as m, createElementBlock as p, createCommentVNode as B, Fragment as x, renderList as C, createVNode as r } from "vue";
|
|
2
|
-
import { J as D } from "./index.vue_vue_type_script_setup_true_lang-YXKayPEp.js";
|
|
3
|
-
import { useI18n as P, useLocale as Q } from "@feedmepos/mf-common";
|
|
4
|
-
import { u as R } from "./discardConfirm-BHni0LNu.js";
|
|
5
|
-
import { g as V, a as I, _ as W, b as X } from "./translation-Cdap0IVg.js";
|
|
6
|
-
const Y = { class: "fm-typo-en-title-md-600" }, Z = { class: "pt-8 space-y-24" }, ee = { class: "flex flex-col gap-8" }, oe = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, le = { class: "flex items-center gap-8 flex-wrap" }, te = { class: "w-24 h-24 rounded-full bg-fm-color-primary-oats text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600" }, ae = { class: "fm-typo-en-body-md-600" }, ne = ["onClick"], se = { class: "flex items-center gap-8" }, ce = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, me = { class: "fm-typo-en-body-md-400" }, ie = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, de = { class: "flex items-center gap-16" }, re = { class: "fm-typo-en-body-lg-600" }, ue = { class: "flex flex-col gap-32 pl-32" }, pe = {
|
|
7
|
-
key: 0,
|
|
8
|
-
class: "space-y-8"
|
|
9
|
-
}, fe = { class: "flex w-[100px] items-center gap-8" }, _e = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, ve = { class: "fm-typo-en-body-md-400" }, he = { class: "flex-1" }, ye = { class: "flex gap-8 items-center justify-start" }, ke = /* @__PURE__ */ K({
|
|
10
|
-
__name: "TranslationSideSheet",
|
|
11
|
-
props: {
|
|
12
|
-
modelValue: { type: Boolean },
|
|
13
|
-
title: {},
|
|
14
|
-
name: {},
|
|
15
|
-
nameLocale: {}
|
|
16
|
-
},
|
|
17
|
-
emits: ["update:modelValue", "update:name", "update:nameLocale"],
|
|
18
|
-
setup(O, { emit: S }) {
|
|
19
|
-
const s = O, f = S, { t: d } = P(), { localeList: h } = Q(), c = y([]), k = y([]), u = y(s.name), L = y(s.name);
|
|
20
|
-
E(
|
|
21
|
-
() => s.name,
|
|
22
|
-
(e) => {
|
|
23
|
-
u.value = e;
|
|
24
|
-
}
|
|
25
|
-
);
|
|
26
|
-
function U() {
|
|
27
|
-
return !s.nameLocale || Object.keys(s.nameLocale).length === 0 ? [] : Object.entries(s.nameLocale).map(([e, o]) => ({
|
|
28
|
-
localeCode: e,
|
|
29
|
-
value: o
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
E(
|
|
33
|
-
() => [s.modelValue, s.nameLocale],
|
|
34
|
-
([e]) => {
|
|
35
|
-
e && (c.value = U(), k.value = D.clone(c.value), u.value = s.name, L.value = s.name);
|
|
36
|
-
},
|
|
37
|
-
{ immediate: !0 }
|
|
38
|
-
);
|
|
39
|
-
const w = F(() => {
|
|
40
|
-
const e = new Set(c.value.map((n) => n.localeCode));
|
|
41
|
-
return a(h).filter((n) => !e.has(n.code)).map((n) => ({
|
|
42
|
-
code: n.code,
|
|
43
|
-
name: n.name,
|
|
44
|
-
icon: V(n.code)
|
|
45
|
-
}));
|
|
46
|
-
});
|
|
47
|
-
function $(e) {
|
|
48
|
-
const o = a(h).find((n) => n.code === e);
|
|
49
|
-
o && c.value.push({
|
|
50
|
-
localeCode: o.code,
|
|
51
|
-
value: ""
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function z(e) {
|
|
55
|
-
c.value = c.value.filter((o) => o.localeCode !== e);
|
|
56
|
-
}
|
|
57
|
-
function A() {
|
|
58
|
-
const e = u.value !== L.value, o = !D.isEqual(c.value, k.value);
|
|
59
|
-
return e || o;
|
|
60
|
-
}
|
|
61
|
-
function M() {
|
|
62
|
-
u.value !== s.name && f("update:name", u.value);
|
|
63
|
-
const e = c.value.filter((o) => o.value.trim());
|
|
64
|
-
if (e.length === 0)
|
|
65
|
-
f("update:nameLocale", void 0);
|
|
66
|
-
else {
|
|
67
|
-
const o = {};
|
|
68
|
-
e.forEach((n) => {
|
|
69
|
-
o[n.localeCode] = n.value.trim();
|
|
70
|
-
}), f("update:nameLocale", o);
|
|
71
|
-
}
|
|
72
|
-
f("update:modelValue", !1);
|
|
73
|
-
}
|
|
74
|
-
function q() {
|
|
75
|
-
f("update:modelValue", !1);
|
|
76
|
-
}
|
|
77
|
-
const N = R(A, q), j = F({
|
|
78
|
-
get: () => s.modelValue,
|
|
79
|
-
set: (e) => f("update:modelValue", e)
|
|
80
|
-
});
|
|
81
|
-
return (e, o) => {
|
|
82
|
-
const n = _("FmIcon"), g = _("fm-button"), J = _("FmMenu"), G = _("fm-text-field"), H = _("fm-side-sheet");
|
|
83
|
-
return i(), T(H, {
|
|
84
|
-
modelValue: j.value,
|
|
85
|
-
"onUpdate:modelValue": o[1] || (o[1] = (l) => j.value = l),
|
|
86
|
-
"max-width": 720,
|
|
87
|
-
"onOn:clickedAway": a(N)
|
|
88
|
-
}, {
|
|
89
|
-
"side-sheet-header": v(() => [
|
|
90
|
-
t("p", Y, m(e.title) + " " + m(a(d)("menu.common.translation.title_suffix")), 1)
|
|
91
|
-
]),
|
|
92
|
-
"side-sheet-footer": v(() => [
|
|
93
|
-
t("div", ye, [
|
|
94
|
-
r(g, {
|
|
95
|
-
label: a(d)("common.save"),
|
|
96
|
-
size: "lg",
|
|
97
|
-
variant: "primary",
|
|
98
|
-
onClick: M
|
|
99
|
-
}, null, 8, ["label"]),
|
|
100
|
-
r(g, {
|
|
101
|
-
label: a(d)("common.cancel"),
|
|
102
|
-
size: "lg",
|
|
103
|
-
variant: "tertiary",
|
|
104
|
-
onClick: a(N)
|
|
105
|
-
}, null, 8, ["label", "onClick"])
|
|
106
|
-
])
|
|
107
|
-
]),
|
|
108
|
-
default: v(() => [
|
|
109
|
-
t("div", Z, [
|
|
110
|
-
t("div", ee, [
|
|
111
|
-
t("p", oe, m(a(d)("menu.common.translation.language")), 1),
|
|
112
|
-
t("div", le, [
|
|
113
|
-
(i(!0), p(x, null, C(c.value, (l) => (i(), p("div", {
|
|
114
|
-
key: l.localeCode,
|
|
115
|
-
class: "flex items-center gap-8 p-8 border border-fm-color-primary text-fm-color-primary rounded-full"
|
|
116
|
-
}, [
|
|
117
|
-
t("div", te, m(a(V)(l.localeCode)), 1),
|
|
118
|
-
t("span", ae, m(a(I)(l.localeCode, a(h))), 1),
|
|
119
|
-
r(n, {
|
|
120
|
-
name: "close",
|
|
121
|
-
class: "cursor-pointer",
|
|
122
|
-
variant: "secondary",
|
|
123
|
-
onClick: (b) => z(l.localeCode)
|
|
124
|
-
}, null, 8, ["onClick"])
|
|
125
|
-
]))), 128)),
|
|
126
|
-
w.value.length > 0 ? (i(), T(J, { key: 0 }, {
|
|
127
|
-
"menu-button": v(() => [
|
|
128
|
-
r(g, {
|
|
129
|
-
variant: "secondary",
|
|
130
|
-
"border-color": "neutral-gray-300",
|
|
131
|
-
"text-color": "neutral-gray-400",
|
|
132
|
-
icon: "add"
|
|
133
|
-
})
|
|
134
|
-
]),
|
|
135
|
-
default: v(() => [
|
|
136
|
-
(i(!0), p(x, null, C(w.value, (l) => (i(), p("div", {
|
|
137
|
-
class: "p-12 cursor-pointer hover:bg-fm-color-opacity-md rounded-sm",
|
|
138
|
-
key: l.code,
|
|
139
|
-
onClick: (b) => $(l.code)
|
|
140
|
-
}, [
|
|
141
|
-
t("div", se, [
|
|
142
|
-
t("div", ce, m(l.icon), 1),
|
|
143
|
-
t("span", me, m(l.name), 1)
|
|
144
|
-
])
|
|
145
|
-
], 8, ne))), 128))
|
|
146
|
-
]),
|
|
147
|
-
_: 1
|
|
148
|
-
})) : B("", !0)
|
|
149
|
-
])
|
|
150
|
-
]),
|
|
151
|
-
t("div", ie, [
|
|
152
|
-
t("div", de, [
|
|
153
|
-
r(n, { name: "keyboard_arrow_down" }),
|
|
154
|
-
t("p", re, m(a(d)("menu.common.translation.name_section", { entity: e.title })), 1)
|
|
155
|
-
]),
|
|
156
|
-
t("div", ue, [
|
|
157
|
-
r(W, {
|
|
158
|
-
label: a(d)("menu.common.translation.default"),
|
|
159
|
-
modelValue: u.value,
|
|
160
|
-
"onUpdate:modelValue": o[0] || (o[0] = (l) => u.value = l)
|
|
161
|
-
}, null, 8, ["label", "modelValue"]),
|
|
162
|
-
c.value.length > 0 ? (i(), p("div", pe, [
|
|
163
|
-
r(X, {
|
|
164
|
-
label: a(d)("menu.common.translation.translation_label")
|
|
165
|
-
}, null, 8, ["label"]),
|
|
166
|
-
(i(!0), p(x, null, C(c.value, (l) => (i(), p("div", {
|
|
167
|
-
key: l.localeCode,
|
|
168
|
-
class: "flex items-center gap-16"
|
|
169
|
-
}, [
|
|
170
|
-
t("div", fe, [
|
|
171
|
-
t("div", _e, m(a(V)(l.localeCode)), 1),
|
|
172
|
-
t("span", ve, m(a(I)(l.localeCode, a(h))), 1)
|
|
173
|
-
]),
|
|
174
|
-
t("div", he, [
|
|
175
|
-
r(G, {
|
|
176
|
-
modelValue: l.value,
|
|
177
|
-
"onUpdate:modelValue": (b) => l.value = b,
|
|
178
|
-
placeholder: a(d)("menu.group.translation.placeholder")
|
|
179
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
180
|
-
])
|
|
181
|
-
]))), 128))
|
|
182
|
-
])) : B("", !0)
|
|
183
|
-
])
|
|
184
|
-
])
|
|
185
|
-
])
|
|
186
|
-
]),
|
|
187
|
-
_: 1
|
|
188
|
-
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
export {
|
|
193
|
-
ke as _
|
|
194
|
-
};
|
package/dist/Variant-BF5r2WLL.js
DELETED
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
import { getCurrentInstance as U, defineComponent as $, computed as x, onMounted as R, h as u, resolveComponent as w, createBlock as L, openBlock as p, unref as t, withCtx as _, createElementBlock as y, Fragment as M, createElementVNode as i, createVNode as c, isRef as z, normalizeClass as N, renderList as G, toDisplayString as S, withModifiers as j, createCommentVNode as Y } from "vue";
|
|
2
|
-
import { useI18n as O } from "@feedmepos/mf-common";
|
|
3
|
-
import { useDialog as Q, useSnackbar as A, FmButtonVariant as B, components as q, useBreakpoints as H } from "@feedmepos/ui-library";
|
|
4
|
-
import { _ as J } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
5
|
-
import { _ as W } from "./app-CfCYl2pO.js";
|
|
6
|
-
import { G as D, u as K, Q as P, M as X, A as Z, a4 as ee } from "./index.vue_vue_type_script_setup_true_lang-YXKayPEp.js";
|
|
7
|
-
import { V as E } from "./index-C0Zw1cSS.js";
|
|
8
|
-
import { _ as ae } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
|
|
9
|
-
import { u as oe } from "./search-BAPEUu1R.js";
|
|
10
|
-
import { defineStore as te } from "pinia";
|
|
11
|
-
import { c as ne } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
12
|
-
import { g as F } from "./translation-Cdap0IVg.js";
|
|
13
|
-
const le = te("variant-manager", () => {
|
|
14
|
-
const I = Q(), n = A(), g = D(n), k = P(g);
|
|
15
|
-
K();
|
|
16
|
-
const f = U(), { t: m } = O(), V = (r) => {
|
|
17
|
-
var h, o;
|
|
18
|
-
const { vNode: C } = ne(
|
|
19
|
-
E,
|
|
20
|
-
f,
|
|
21
|
-
r
|
|
22
|
-
);
|
|
23
|
-
(o = (h = C.component) == null ? void 0 : h.exposed) == null || o.trigger();
|
|
24
|
-
};
|
|
25
|
-
async function d(r) {
|
|
26
|
-
V({
|
|
27
|
-
initialValue: r
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
async function v(r) {
|
|
31
|
-
I.open({
|
|
32
|
-
title: m("menu.common.dialog.remove.variant.title"),
|
|
33
|
-
message: m("menu.common.dialog.remove.variant.message", { name: r.name }),
|
|
34
|
-
primaryActions: {
|
|
35
|
-
text: m("menu.common.actions.remove"),
|
|
36
|
-
close: !0,
|
|
37
|
-
variant: B.Destructive
|
|
38
|
-
},
|
|
39
|
-
secondaryActions: {
|
|
40
|
-
text: m("menu.common.actions.cancel"),
|
|
41
|
-
close: !0
|
|
42
|
-
}
|
|
43
|
-
}).onPrimary(async () => {
|
|
44
|
-
await k.updateMenu(
|
|
45
|
-
{
|
|
46
|
-
module: Z.F_MENU_MODULE_V4_KEY.enum.variant,
|
|
47
|
-
operation: X.F_OPERATION_TYPE.delete,
|
|
48
|
-
data: r._id
|
|
49
|
-
},
|
|
50
|
-
r.name,
|
|
51
|
-
!0
|
|
52
|
-
);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
deleteVariant: v,
|
|
57
|
-
updateVariant: d
|
|
58
|
-
};
|
|
59
|
-
}), se = {
|
|
60
|
-
key: 0,
|
|
61
|
-
class: "flex-1 flex flex-col overflow-hidden max-h-[calc(100vh-56px)] gap-8"
|
|
62
|
-
}, re = {
|
|
63
|
-
class: "flex justify-end"
|
|
64
|
-
}, ie = {
|
|
65
|
-
class: "w-[320px]"
|
|
66
|
-
}, ce = {
|
|
67
|
-
class: "px-16 py-8"
|
|
68
|
-
}, me = {
|
|
69
|
-
class: /* @__PURE__ */ N(["flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"])
|
|
70
|
-
}, de = ["onClick"], ue = {
|
|
71
|
-
class: "flex-1 space-y-4"
|
|
72
|
-
}, pe = {
|
|
73
|
-
class: "fm-typo-en-body-lg-600"
|
|
74
|
-
}, fe = {
|
|
75
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
76
|
-
}, _e = {
|
|
77
|
-
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
78
|
-
}, ye = {
|
|
79
|
-
key: 1,
|
|
80
|
-
class: "xs:pt-16"
|
|
81
|
-
}, Be = /* @__PURE__ */ $({
|
|
82
|
-
__name: "Variant",
|
|
83
|
-
setup(I) {
|
|
84
|
-
const {
|
|
85
|
-
t: n
|
|
86
|
-
} = O(), g = K(), k = P(D(A())), f = le(), m = x(() => g.variants.map((o) => ({
|
|
87
|
-
...o,
|
|
88
|
-
usedBy: g.items.filter((e) => {
|
|
89
|
-
var s;
|
|
90
|
-
return (s = e.variant) == null ? void 0 : s.variantGroupIds.includes(o._id);
|
|
91
|
-
}).map(({
|
|
92
|
-
_id: e
|
|
93
|
-
}) => ({
|
|
94
|
-
_id: e
|
|
95
|
-
}))
|
|
96
|
-
}))), {
|
|
97
|
-
filter: V,
|
|
98
|
-
searchKey: d
|
|
99
|
-
} = oe(), v = x(() => m.value.filter((o) => {
|
|
100
|
-
var e;
|
|
101
|
-
return V([o.name, ...((e = o.options) == null ? void 0 : e.map((s) => s.name)) ?? []]);
|
|
102
|
-
}));
|
|
103
|
-
R(() => g.selectCatalog(null));
|
|
104
|
-
const r = x(() => [{
|
|
105
|
-
accessorKey: "name",
|
|
106
|
-
header: () => n("menu.variant.columns.name"),
|
|
107
|
-
size: 360,
|
|
108
|
-
enableSorting: !1,
|
|
109
|
-
cell: (o) => {
|
|
110
|
-
const e = o.row.original, s = o.getValue(), l = Object.keys(e.name_locale ?? {}).map((a) => F(a));
|
|
111
|
-
return u("div", {
|
|
112
|
-
class: "flex items-center gap-8"
|
|
113
|
-
}, [u("span", {
|
|
114
|
-
class: "break-all"
|
|
115
|
-
}, s), ...l.map((a) => u("div", {
|
|
116
|
-
class: "rounded-lg border border-fm-color-primary text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600 px-8"
|
|
117
|
-
}, a))]);
|
|
118
|
-
}
|
|
119
|
-
}, {
|
|
120
|
-
accessorKey: "options",
|
|
121
|
-
header: () => n("menu.variant.columns.options"),
|
|
122
|
-
size: 560,
|
|
123
|
-
enableSorting: !1,
|
|
124
|
-
cell: (o) => {
|
|
125
|
-
const e = o.getValue() ?? [], s = e.some((l) => Object.keys(l.name_locale ?? {}).length > 0), b = Array.from(new Set(e.flatMap((l) => Object.keys(l.name_locale ?? {})))).map((l) => F(l));
|
|
126
|
-
return u("div", {
|
|
127
|
-
class: "flex items-center gap-8"
|
|
128
|
-
}, [u("span", {
|
|
129
|
-
class: "break-all"
|
|
130
|
-
}, e == null ? void 0 : e.map((l) => l.name).join(", ")), ...s ? b.map((l) => u("div", {
|
|
131
|
-
class: "rounded-lg border border-fm-color-primary text-fm-color-primary flex items-center justify-center fm-typo-en-body-sm-600 px-8"
|
|
132
|
-
}, l)) : []]);
|
|
133
|
-
}
|
|
134
|
-
}, {
|
|
135
|
-
accessorKey: "usedBy",
|
|
136
|
-
header: () => n("menu.variant.columns.applied_products"),
|
|
137
|
-
enableSorting: !1,
|
|
138
|
-
size: 180,
|
|
139
|
-
cell: (o) => n("menu.common.labels.items_linked", {
|
|
140
|
-
count: o.getValue().length
|
|
141
|
-
})
|
|
142
|
-
}, {
|
|
143
|
-
id: "action",
|
|
144
|
-
size: 52,
|
|
145
|
-
meta: {
|
|
146
|
-
cellClass: "pl-16",
|
|
147
|
-
headerContentClass: "-mx-16"
|
|
148
|
-
},
|
|
149
|
-
cell: (o) => u("div", {
|
|
150
|
-
class: "w-full flex justify-end items-center"
|
|
151
|
-
}, [u(q.FmButton, {
|
|
152
|
-
prependIcon: "delete",
|
|
153
|
-
variant: B.Tertiary,
|
|
154
|
-
textColor: "neutral-gray-400",
|
|
155
|
-
onClick: (e) => {
|
|
156
|
-
e.stopPropagation(), f.deleteVariant(o.row.original);
|
|
157
|
-
}
|
|
158
|
-
})])
|
|
159
|
-
}]), C = H(), h = x(() => C.breakpoints.value.xs);
|
|
160
|
-
return (o, e) => {
|
|
161
|
-
const s = w("fm-search"), b = w("fm-table"), l = w("fm-button");
|
|
162
|
-
return p(), L(ae, {
|
|
163
|
-
heading: t(n)("menu.variant.title")
|
|
164
|
-
}, {
|
|
165
|
-
"append-heading": _(() => [m.value.length ? (p(), L(t(E), {
|
|
166
|
-
key: 0
|
|
167
|
-
}, {
|
|
168
|
-
default: _(({
|
|
169
|
-
trigger: a
|
|
170
|
-
}) => [c(J, {
|
|
171
|
-
class: "ml-auto",
|
|
172
|
-
label: t(n)("menu.variant.add"),
|
|
173
|
-
"prepend-icon": "add",
|
|
174
|
-
onClick: j(a, ["stop"])
|
|
175
|
-
}, null, 8, ["label", "onClick"])]),
|
|
176
|
-
_: 1
|
|
177
|
-
})) : Y("", !0)]),
|
|
178
|
-
default: _(() => [m.value.length ? (p(), y(M, {
|
|
179
|
-
key: 0
|
|
180
|
-
}, [h.value ? (p(), y(M, {
|
|
181
|
-
key: 1
|
|
182
|
-
}, [i("div", ce, [c(s, {
|
|
183
|
-
autofocus: "",
|
|
184
|
-
modelValue: t(d),
|
|
185
|
-
"onUpdate:modelValue": e[2] || (e[2] = (a) => z(d) ? d.value = a : null),
|
|
186
|
-
placeholder: t(n)("menu.common.labels.search_placeholder", {
|
|
187
|
-
type: "variants"
|
|
188
|
-
})
|
|
189
|
-
}, null, 8, ["modelValue", "placeholder"])]), i("div", me, [(p(!0), y(M, null, G(v.value, (a) => (p(), y("div", {
|
|
190
|
-
key: a._id,
|
|
191
|
-
class: N(["py-12 px-16", "flex space-x-8", "items-center", "cursor-pointer"]),
|
|
192
|
-
onClick: () => t(f).updateVariant(a)
|
|
193
|
-
}, [i("div", ue, [i("p", pe, S(a.name), 1), i("div", null, [i("p", fe, S(t(n)("menu.common.labels.items_linked", {
|
|
194
|
-
count: a.usedBy.length
|
|
195
|
-
})), 1), i("p", _e, S(t(n)("menu.variant.mobile.value", {
|
|
196
|
-
values: a.options.map((T) => T.name).join(", ")
|
|
197
|
-
})), 1)])]), c(l, {
|
|
198
|
-
variant: t(B).Tertiary,
|
|
199
|
-
"prepend-icon": "delete",
|
|
200
|
-
"text-color": "neutral-gray-400",
|
|
201
|
-
onClick: j(() => t(f).deleteVariant(a), ["stop"])
|
|
202
|
-
}, null, 8, ["variant", "onClick"])], 8, de))), 128))])], 64)) : (p(), y("div", se, [i("div", re, [i("div", ie, [c(s, {
|
|
203
|
-
autofocus: "",
|
|
204
|
-
modelValue: t(d),
|
|
205
|
-
"onUpdate:modelValue": e[0] || (e[0] = (a) => z(d) ? d.value = a : null),
|
|
206
|
-
placeholder: t(n)("menu.common.labels.search_placeholder", {
|
|
207
|
-
type: "variants"
|
|
208
|
-
})
|
|
209
|
-
}, null, 8, ["modelValue", "placeholder"])])]), c(W, null, {
|
|
210
|
-
default: _(() => [c(b, {
|
|
211
|
-
"column-defs": r.value,
|
|
212
|
-
loading: t(k).checkMenuIsLoading(),
|
|
213
|
-
"page-size": v.value.length,
|
|
214
|
-
"row-data": v.value,
|
|
215
|
-
"shrink-at": !1,
|
|
216
|
-
class: "flex-1 overflow-hidden",
|
|
217
|
-
"hide-footer": "",
|
|
218
|
-
"pin-header-row": "",
|
|
219
|
-
onRowClick: e[1] || (e[1] = (a) => {
|
|
220
|
-
t(f).updateVariant(a.original);
|
|
221
|
-
})
|
|
222
|
-
}, null, 8, ["column-defs", "loading", "page-size", "row-data"])]),
|
|
223
|
-
_: 1
|
|
224
|
-
})]))], 64)) : (p(), y("div", ye, [c(ee, {
|
|
225
|
-
subtitle: t(n)("menu.variant.empty.subtitle"),
|
|
226
|
-
title: t(n)("menu.variant.empty.title")
|
|
227
|
-
}, {
|
|
228
|
-
action: _(() => [c(t(E), null, {
|
|
229
|
-
default: _(({
|
|
230
|
-
trigger: a
|
|
231
|
-
}) => [c(l, {
|
|
232
|
-
"prepend-icon": "add",
|
|
233
|
-
label: t(n)("menu.variant.add"),
|
|
234
|
-
onClick: j(a, ["stop"])
|
|
235
|
-
}, null, 8, ["label", "onClick"])]),
|
|
236
|
-
_: 1
|
|
237
|
-
})]),
|
|
238
|
-
_: 1
|
|
239
|
-
}, 8, ["subtitle", "title"])]))]),
|
|
240
|
-
_: 1
|
|
241
|
-
}, 8, ["heading"]);
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
export {
|
|
246
|
-
Be as default
|
|
247
|
-
};
|