@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
package/dist/index-C0Zw1cSS.js
DELETED
|
@@ -1,545 +0,0 @@
|
|
|
1
|
-
import { defineComponent as re, ref as _, computed as z, watch as ae, unref as t, resolveComponent as U, createBlock as J, openBlock as f, withCtx as k, createElementVNode as o, toDisplayString as x, createElementBlock as y, createCommentVNode as D, Fragment as A, renderList as B, createVNode as u, normalizeClass as te, renderSlot as me, createSlots as ve } from "vue";
|
|
2
|
-
import { J as w, Q as fe, G as pe, I as q, D as le, M as ne, A as oe } from "./index.vue_vue_type_script_setup_true_lang-YXKayPEp.js";
|
|
3
|
-
import { d as _e } from "./vuedraggable-CK8z7qA8.js";
|
|
4
|
-
import { useI18n as ce, useLocale as ye } from "@feedmepos/mf-common";
|
|
5
|
-
import { useSnackbar as he, components as be } from "@feedmepos/ui-library";
|
|
6
|
-
import { _ as ge } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
|
|
7
|
-
import { _ as xe } from "./RuleView.vue_vue_type_script_setup_true_lang-t8M7z09s.js";
|
|
8
|
-
import { u as de } from "./discardConfirm-BHni0LNu.js";
|
|
9
|
-
import { _ as Ve } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-BoSL4dm7.js";
|
|
10
|
-
import { g as K, a as ee, _ as se, b as ie } from "./translation-Cdap0IVg.js";
|
|
11
|
-
import { c as ke } from "./check-C9mY6LiX.js";
|
|
12
|
-
const Ce = { class: "fm-typo-en-title-md-600" }, Ee = { class: "pt-8 space-y-24" }, we = { class: "flex flex-col gap-8" }, Oe = { class: "text-fm-color-typo-primary fm-typo-en-body-lg-600" }, Ue = { class: "flex items-center gap-8 flex-wrap" }, $e = { 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" }, Ne = { class: "fm-typo-en-body-md-600" }, je = ["onClick"], Le = { class: "flex items-center gap-8" }, Se = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, Te = { class: "fm-typo-en-body-md-400" }, De = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, Fe = { class: "fm-typo-en-body-lg-600" }, Me = {
|
|
13
|
-
key: 0,
|
|
14
|
-
class: "flex flex-col gap-32 pl-32"
|
|
15
|
-
}, Ie = {
|
|
16
|
-
key: 0,
|
|
17
|
-
class: "space-y-8"
|
|
18
|
-
}, Ae = { class: "flex w-[100px] items-center gap-8" }, Be = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, qe = { class: "fm-typo-en-body-md-400" }, ze = { class: "flex-1" }, Pe = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, Ye = { class: "fm-typo-en-body-lg-600" }, Ge = {
|
|
19
|
-
key: 0,
|
|
20
|
-
class: "flex flex-col gap-32 pl-32"
|
|
21
|
-
}, Re = { class: "fm-typo-en-body-md-600 text-fm-color-primary border border-fm-color-primary inline-block rounded-md px-8 py-4" }, Ke = { class: "space-y-32" }, Je = {
|
|
22
|
-
key: 0,
|
|
23
|
-
class: "space-y-8"
|
|
24
|
-
}, Qe = { class: "flex w-[100px] items-center gap-8" }, He = { class: "w-24 h-24 rounded-full bg-fm-color-opacity-sm flex items-center justify-center fm-typo-en-body-sm-600" }, We = { class: "fm-typo-en-body-md-400" }, Xe = { class: "flex-1" }, Ze = { class: "flex gap-8 items-center justify-start" }, ea = /* @__PURE__ */ re({
|
|
25
|
-
__name: "ProductVariantTranslation",
|
|
26
|
-
props: {
|
|
27
|
-
modelValue: { type: Boolean },
|
|
28
|
-
variant: {},
|
|
29
|
-
expandSection: { default: "variant" }
|
|
30
|
-
},
|
|
31
|
-
emits: ["update:modelValue", "update:variant"],
|
|
32
|
-
setup(Q, { emit: H }) {
|
|
33
|
-
const m = Q, S = H, { t: r } = ce(), { localeList: $ } = ye(), N = _(!1), O = _(!1), a = _([]), F = _([]), p = _({}), M = _({}), E = _(""), I = _(""), h = _({}), P = _({}), j = _({}), Y = _({}), G = z(() => m.variant.options.map((s, e) => ({
|
|
34
|
-
...s,
|
|
35
|
-
optionIndex: e + 1
|
|
36
|
-
})).filter((s) => s.name.trim() !== ""));
|
|
37
|
-
function W() {
|
|
38
|
-
const s = /* @__PURE__ */ new Set();
|
|
39
|
-
m.variant.name_locale && Object.keys(m.variant.name_locale).forEach((d) => s.add(d)), m.variant.options.forEach((d) => {
|
|
40
|
-
d.name_locale && Object.keys(d.name_locale).forEach((V) => s.add(V));
|
|
41
|
-
});
|
|
42
|
-
const e = Array.from(s).map((d) => {
|
|
43
|
-
const V = t($).find((n) => n.code === d);
|
|
44
|
-
return {
|
|
45
|
-
localeCode: d,
|
|
46
|
-
localeName: (V == null ? void 0 : V.name) || d,
|
|
47
|
-
value: ""
|
|
48
|
-
// Not used for language selection
|
|
49
|
-
};
|
|
50
|
-
});
|
|
51
|
-
a.value = e;
|
|
52
|
-
const i = {};
|
|
53
|
-
m.variant.name_locale && Object.entries(m.variant.name_locale).forEach(([d, V]) => {
|
|
54
|
-
i[d] = V;
|
|
55
|
-
}), p.value = i, E.value = m.variant.name;
|
|
56
|
-
const v = {}, g = {};
|
|
57
|
-
m.variant.options.forEach((d) => {
|
|
58
|
-
v[d._id] = {}, d.name_locale && Object.entries(d.name_locale).forEach(([V, n]) => {
|
|
59
|
-
v[d._id][V] = n;
|
|
60
|
-
}), g[d._id] = d.name;
|
|
61
|
-
}), h.value = v, j.value = g;
|
|
62
|
-
}
|
|
63
|
-
ae(
|
|
64
|
-
() => [m.modelValue, m.variant, m.expandSection],
|
|
65
|
-
([s, , e]) => {
|
|
66
|
-
s && (W(), F.value = w.clone(a.value), M.value = w.clone(p.value), I.value = E.value, P.value = w.clone(h.value), Y.value = w.clone(j.value), e === "variant" ? (N.value = !0, O.value = !1) : (N.value = !1, O.value = !0));
|
|
67
|
-
},
|
|
68
|
-
{ immediate: !0, deep: !0 }
|
|
69
|
-
);
|
|
70
|
-
const R = z(() => {
|
|
71
|
-
const s = new Set(a.value.map((e) => e.localeCode));
|
|
72
|
-
return t($).filter((e) => !s.has(e.code)).map((e) => ({
|
|
73
|
-
code: e.code,
|
|
74
|
-
name: e.name,
|
|
75
|
-
icon: K(e.code)
|
|
76
|
-
}));
|
|
77
|
-
});
|
|
78
|
-
function X(s) {
|
|
79
|
-
const e = t($).find((i) => i.code === s);
|
|
80
|
-
e && (a.value.push({
|
|
81
|
-
localeCode: e.code,
|
|
82
|
-
localeName: e.name,
|
|
83
|
-
value: ""
|
|
84
|
-
}), p.value[e.code] || (p.value[e.code] = ""), Object.keys(h.value).forEach((i) => {
|
|
85
|
-
h.value[i][e.code] || (h.value[i][e.code] = "");
|
|
86
|
-
}));
|
|
87
|
-
}
|
|
88
|
-
function Z(s) {
|
|
89
|
-
a.value = a.value.filter((e) => e.localeCode !== s), delete p.value[s], Object.keys(h.value).forEach((e) => {
|
|
90
|
-
delete h.value[e][s];
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
function l() {
|
|
94
|
-
return !w.isEqual(a.value, F.value) || !w.isEqual(p.value, M.value) || E.value !== I.value || !w.isEqual(h.value, P.value) || !w.isEqual(j.value, Y.value);
|
|
95
|
-
}
|
|
96
|
-
function c() {
|
|
97
|
-
const s = w.clone(m.variant);
|
|
98
|
-
E.value !== void 0 && (s.name = E.value);
|
|
99
|
-
const e = {};
|
|
100
|
-
Object.entries(p.value).forEach(([i, v]) => {
|
|
101
|
-
v && v.trim() && (e[i] = v.trim());
|
|
102
|
-
}), Object.keys(e).length > 0 ? s.name_locale = e : delete s.name_locale, s.options.forEach((i) => {
|
|
103
|
-
const v = j.value[i._id];
|
|
104
|
-
v !== void 0 && (i.name = v);
|
|
105
|
-
const g = h.value[i._id];
|
|
106
|
-
if (g && Object.keys(g).length > 0) {
|
|
107
|
-
const d = {};
|
|
108
|
-
Object.entries(g).forEach(([V, n]) => {
|
|
109
|
-
n && n.trim() && (d[V] = n.trim());
|
|
110
|
-
}), Object.keys(d).length > 0 ? i.name_locale = d : delete i.name_locale;
|
|
111
|
-
} else
|
|
112
|
-
delete i.name_locale;
|
|
113
|
-
}), S("update:variant", s), S("update:modelValue", !1);
|
|
114
|
-
}
|
|
115
|
-
function b() {
|
|
116
|
-
S("update:modelValue", !1);
|
|
117
|
-
}
|
|
118
|
-
const L = de(l, b), T = z({
|
|
119
|
-
get: () => m.modelValue,
|
|
120
|
-
set: (s) => S("update:modelValue", s)
|
|
121
|
-
});
|
|
122
|
-
return (s, e) => {
|
|
123
|
-
const i = U("FmIcon"), v = U("fm-button"), g = U("FmMenu"), d = U("fm-text-field"), V = U("fm-side-sheet");
|
|
124
|
-
return f(), J(V, {
|
|
125
|
-
modelValue: T.value,
|
|
126
|
-
"onUpdate:modelValue": e[3] || (e[3] = (n) => T.value = n),
|
|
127
|
-
"max-width": 720,
|
|
128
|
-
"onOn:clickedAway": t(L)
|
|
129
|
-
}, {
|
|
130
|
-
"side-sheet-header": k(() => [
|
|
131
|
-
o("p", Ce, x(t(r)("menu.variant.form.translation.title")), 1)
|
|
132
|
-
]),
|
|
133
|
-
"side-sheet-footer": k(() => [
|
|
134
|
-
o("div", Ze, [
|
|
135
|
-
u(v, {
|
|
136
|
-
label: t(r)("common.save"),
|
|
137
|
-
size: "lg",
|
|
138
|
-
variant: "primary",
|
|
139
|
-
onClick: c
|
|
140
|
-
}, null, 8, ["label"]),
|
|
141
|
-
u(v, {
|
|
142
|
-
label: t(r)("common.cancel"),
|
|
143
|
-
size: "lg",
|
|
144
|
-
variant: "tertiary",
|
|
145
|
-
onClick: t(L)
|
|
146
|
-
}, null, 8, ["label", "onClick"])
|
|
147
|
-
])
|
|
148
|
-
]),
|
|
149
|
-
default: k(() => [
|
|
150
|
-
o("div", Ee, [
|
|
151
|
-
o("div", we, [
|
|
152
|
-
o("p", Oe, x(t(r)("menu.variant.form.translation.language")), 1),
|
|
153
|
-
o("div", Ue, [
|
|
154
|
-
(f(!0), y(A, null, B(a.value, (n) => (f(), y("div", {
|
|
155
|
-
key: n.localeCode,
|
|
156
|
-
class: "flex items-center gap-8 p-8 border border-fm-color-primary text-fm-color-primary rounded-full"
|
|
157
|
-
}, [
|
|
158
|
-
o("div", $e, x(t(K)(n.localeCode)), 1),
|
|
159
|
-
o("span", Ne, x(t(ee)(n.localeCode, t($))), 1),
|
|
160
|
-
u(i, {
|
|
161
|
-
name: "close",
|
|
162
|
-
class: "cursor-pointer",
|
|
163
|
-
variant: "secondary",
|
|
164
|
-
onClick: (C) => Z(n.localeCode)
|
|
165
|
-
}, null, 8, ["onClick"])
|
|
166
|
-
]))), 128)),
|
|
167
|
-
R.value.length > 0 ? (f(), J(g, { key: 0 }, {
|
|
168
|
-
"menu-button": k(() => [
|
|
169
|
-
u(v, {
|
|
170
|
-
variant: "secondary",
|
|
171
|
-
"border-color": "neutral-gray-300",
|
|
172
|
-
"text-color": "neutral-gray-400",
|
|
173
|
-
icon: "add"
|
|
174
|
-
})
|
|
175
|
-
]),
|
|
176
|
-
default: k(() => [
|
|
177
|
-
(f(!0), y(A, null, B(R.value, (n) => (f(), y("div", {
|
|
178
|
-
key: n.code,
|
|
179
|
-
class: "p-12 cursor-pointer hover:bg-fm-color-opacity-md rounded-sm",
|
|
180
|
-
onClick: (C) => X(n.code)
|
|
181
|
-
}, [
|
|
182
|
-
o("div", Le, [
|
|
183
|
-
o("div", Se, x(n.icon), 1),
|
|
184
|
-
o("span", Te, x(n.name), 1)
|
|
185
|
-
])
|
|
186
|
-
], 8, je))), 128))
|
|
187
|
-
]),
|
|
188
|
-
_: 1
|
|
189
|
-
})) : D("", !0)
|
|
190
|
-
])
|
|
191
|
-
]),
|
|
192
|
-
o("div", De, [
|
|
193
|
-
o("div", {
|
|
194
|
-
class: "flex items-center gap-16 cursor-pointer",
|
|
195
|
-
onClick: e[0] || (e[0] = (n) => N.value = !N.value)
|
|
196
|
-
}, [
|
|
197
|
-
u(i, {
|
|
198
|
-
name: "keyboard_arrow_down",
|
|
199
|
-
class: te(["transition-transform", N.value ? "transform rotate-180" : ""])
|
|
200
|
-
}, null, 8, ["class"]),
|
|
201
|
-
o("p", Fe, x(t(r)("menu.variant.form.translation.variant_name")), 1)
|
|
202
|
-
]),
|
|
203
|
-
N.value ? (f(), y("div", Me, [
|
|
204
|
-
u(se, {
|
|
205
|
-
label: t(r)("menu.variant.form.translation.default"),
|
|
206
|
-
modelValue: E.value,
|
|
207
|
-
"onUpdate:modelValue": e[1] || (e[1] = (n) => E.value = n)
|
|
208
|
-
}, null, 8, ["label", "modelValue"]),
|
|
209
|
-
a.value.length > 0 ? (f(), y("div", Ie, [
|
|
210
|
-
u(ie, {
|
|
211
|
-
label: t(r)("menu.variant.form.translation.translation")
|
|
212
|
-
}, null, 8, ["label"]),
|
|
213
|
-
(f(!0), y(A, null, B(a.value, (n) => (f(), y("div", {
|
|
214
|
-
key: n.localeCode,
|
|
215
|
-
class: "flex items-center gap-16"
|
|
216
|
-
}, [
|
|
217
|
-
o("div", Ae, [
|
|
218
|
-
o("div", Be, x(t(K)(n.localeCode)), 1),
|
|
219
|
-
o("span", qe, x(t(ee)(n.localeCode, t($))), 1)
|
|
220
|
-
]),
|
|
221
|
-
o("div", ze, [
|
|
222
|
-
u(d, {
|
|
223
|
-
modelValue: p.value[n.localeCode],
|
|
224
|
-
"onUpdate:modelValue": (C) => p.value[n.localeCode] = C,
|
|
225
|
-
placeholder: s.variant.name
|
|
226
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
227
|
-
])
|
|
228
|
-
]))), 128))
|
|
229
|
-
])) : D("", !0)
|
|
230
|
-
])) : D("", !0)
|
|
231
|
-
]),
|
|
232
|
-
o("div", Pe, [
|
|
233
|
-
o("div", {
|
|
234
|
-
class: "flex items-center gap-16 cursor-pointer",
|
|
235
|
-
onClick: e[2] || (e[2] = (n) => O.value = !O.value)
|
|
236
|
-
}, [
|
|
237
|
-
u(i, {
|
|
238
|
-
name: "keyboard_arrow_down",
|
|
239
|
-
class: te(["transition-transform", O.value ? "transform rotate-180" : ""])
|
|
240
|
-
}, null, 8, ["class"]),
|
|
241
|
-
o("p", Ye, x(t(r)("menu.variant.form.translation.option_value")), 1)
|
|
242
|
-
]),
|
|
243
|
-
O.value ? (f(), y("div", Ge, [
|
|
244
|
-
(f(!0), y(A, null, B(G.value, (n) => (f(), y("div", {
|
|
245
|
-
key: n._id,
|
|
246
|
-
class: "space-y-8"
|
|
247
|
-
}, [
|
|
248
|
-
o("p", Re, x(t(r)("menu.variant.form.translation.option", { number: n.optionIndex })), 1),
|
|
249
|
-
o("div", Ke, [
|
|
250
|
-
u(se, {
|
|
251
|
-
label: t(r)("menu.variant.form.translation.default"),
|
|
252
|
-
modelValue: j.value[n._id],
|
|
253
|
-
"onUpdate:modelValue": (C) => j.value[n._id] = C,
|
|
254
|
-
spacing: "sm"
|
|
255
|
-
}, null, 8, ["label", "modelValue", "onUpdate:modelValue"]),
|
|
256
|
-
a.value.length > 0 ? (f(), y("div", Je, [
|
|
257
|
-
u(ie, {
|
|
258
|
-
label: t(r)("menu.variant.form.translation.translation"),
|
|
259
|
-
spacing: "sm"
|
|
260
|
-
}, null, 8, ["label"]),
|
|
261
|
-
(f(!0), y(A, null, B(a.value, (C) => (f(), y("div", {
|
|
262
|
-
key: C.localeCode,
|
|
263
|
-
class: "flex items-center gap-16"
|
|
264
|
-
}, [
|
|
265
|
-
o("div", Qe, [
|
|
266
|
-
o("div", He, x(t(K)(C.localeCode)), 1),
|
|
267
|
-
o("span", We, x(t(ee)(C.localeCode, t($))), 1)
|
|
268
|
-
]),
|
|
269
|
-
o("div", Xe, [
|
|
270
|
-
u(d, {
|
|
271
|
-
modelValue: h.value[n._id][C.localeCode],
|
|
272
|
-
"onUpdate:modelValue": (ue) => h.value[n._id][C.localeCode] = ue,
|
|
273
|
-
placeholder: n.name
|
|
274
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
275
|
-
])
|
|
276
|
-
]))), 128))
|
|
277
|
-
])) : D("", !0)
|
|
278
|
-
])
|
|
279
|
-
]))), 128))
|
|
280
|
-
])) : D("", !0)
|
|
281
|
-
])
|
|
282
|
-
])
|
|
283
|
-
]),
|
|
284
|
-
_: 1
|
|
285
|
-
}, 8, ["modelValue", "onOn:clickedAway"]);
|
|
286
|
-
};
|
|
287
|
-
}
|
|
288
|
-
}), aa = { class: "fm-typo-en-title-md-600" }, ta = { class: "py-16 space-y-32" }, la = ["data-not-allow-sort"], na = {
|
|
289
|
-
key: 1,
|
|
290
|
-
class: "w-24"
|
|
291
|
-
}, oa = { class: "flex-1" }, sa = { class: "flex items-center gap-8" }, ia = { class: "flex gap-8 items-center justify-start" }, ra = /* @__PURE__ */ re({
|
|
292
|
-
__name: "Form",
|
|
293
|
-
props: {
|
|
294
|
-
initialValue: {}
|
|
295
|
-
},
|
|
296
|
-
setup(Q, { expose: H }) {
|
|
297
|
-
const m = Q, S = fe(pe(he())), { t: r } = ce(), $ = z(
|
|
298
|
-
() => m.initialValue ? r("menu.variant.form.title.edit") : r("menu.variant.form.title.add")
|
|
299
|
-
), N = z(() => m.initialValue ? "Update" : "Add"), O = () => {
|
|
300
|
-
if (m.initialValue) {
|
|
301
|
-
const l = q(m.initialValue);
|
|
302
|
-
return l.options.push({
|
|
303
|
-
_id: (/* @__PURE__ */ new Date()).toISOString(),
|
|
304
|
-
name: ""
|
|
305
|
-
}), l;
|
|
306
|
-
} else
|
|
307
|
-
return { ...le.generator.initMenuV4VariantGroup(), usedBy: [] };
|
|
308
|
-
}, a = _(O()), F = _(!1), p = _(!1), M = _(!1), E = _("variant"), I = (l) => {
|
|
309
|
-
ke.isBoolean(l) ? p.value = l : p.value = !p.value;
|
|
310
|
-
};
|
|
311
|
-
function h(l) {
|
|
312
|
-
E.value = l, M.value = !0;
|
|
313
|
-
}
|
|
314
|
-
function P(l) {
|
|
315
|
-
a.value = l;
|
|
316
|
-
}
|
|
317
|
-
function j(l) {
|
|
318
|
-
a.value.options = l;
|
|
319
|
-
}
|
|
320
|
-
function Y(l, c) {
|
|
321
|
-
const b = q(a.value.options), L = b.findIndex((T) => T._id == l);
|
|
322
|
-
b[L].name = c, a.value.options = b, L === a.value.options.length - 1 && G();
|
|
323
|
-
}
|
|
324
|
-
function G() {
|
|
325
|
-
const l = q(a.value.options);
|
|
326
|
-
a.value.options = [
|
|
327
|
-
...l,
|
|
328
|
-
{
|
|
329
|
-
_id: (/* @__PURE__ */ new Date()).toISOString(),
|
|
330
|
-
name: ""
|
|
331
|
-
}
|
|
332
|
-
];
|
|
333
|
-
}
|
|
334
|
-
function W(l) {
|
|
335
|
-
const c = q(a.value.options);
|
|
336
|
-
a.value.options = c.filter((b) => b._id !== l);
|
|
337
|
-
}
|
|
338
|
-
ae(
|
|
339
|
-
() => a.value.options,
|
|
340
|
-
(l) => {
|
|
341
|
-
l.length <= 0 && G();
|
|
342
|
-
},
|
|
343
|
-
{
|
|
344
|
-
immediate: !0
|
|
345
|
-
}
|
|
346
|
-
);
|
|
347
|
-
function R(l) {
|
|
348
|
-
const c = l.draggedContext.futureIndex, b = l.relatedContext.list;
|
|
349
|
-
return c !== b.length - 1;
|
|
350
|
-
}
|
|
351
|
-
const X = de(
|
|
352
|
-
() => {
|
|
353
|
-
if (m.initialValue) {
|
|
354
|
-
const l = a.value.options.filter((c) => !!c.name.trim());
|
|
355
|
-
return !w.isEqual({ ...a.value, options: l }, m.initialValue);
|
|
356
|
-
} else
|
|
357
|
-
return !!(a.value.options.length > 1 || a.value.name.trim());
|
|
358
|
-
},
|
|
359
|
-
() => {
|
|
360
|
-
p.value = !1;
|
|
361
|
-
}
|
|
362
|
-
), Z = async () => {
|
|
363
|
-
try {
|
|
364
|
-
F.value = !0;
|
|
365
|
-
const l = q(a.value);
|
|
366
|
-
l.options = l.options.filter((c) => !!c.name.trim()), m.initialValue ? await S.updateMenu(
|
|
367
|
-
{
|
|
368
|
-
module: oe.F_MENU_MODULE_V4_KEY.enum.variant,
|
|
369
|
-
operation: ne.F_OPERATION_TYPE.update,
|
|
370
|
-
data: l
|
|
371
|
-
},
|
|
372
|
-
l.name
|
|
373
|
-
) : await S.updateMenu(
|
|
374
|
-
{
|
|
375
|
-
module: oe.F_MENU_MODULE_V4_KEY.enum.variant,
|
|
376
|
-
operation: ne.F_OPERATION_TYPE.create,
|
|
377
|
-
data: l
|
|
378
|
-
},
|
|
379
|
-
l.name
|
|
380
|
-
), I(!1), a.value = { ...le.generator.initMenuV4VariantGroup(), usedBy: [] };
|
|
381
|
-
} finally {
|
|
382
|
-
F.value = !1;
|
|
383
|
-
}
|
|
384
|
-
};
|
|
385
|
-
return ae(
|
|
386
|
-
() => p.value,
|
|
387
|
-
(l) => {
|
|
388
|
-
l && (a.value = O());
|
|
389
|
-
}
|
|
390
|
-
), H({
|
|
391
|
-
show: p,
|
|
392
|
-
trigger: I
|
|
393
|
-
}), (l, c) => {
|
|
394
|
-
const b = U("fm-icon"), L = U("fm-text-field"), T = U("fm-button"), s = U("fm-side-sheet");
|
|
395
|
-
return f(), y(A, null, [
|
|
396
|
-
me(l.$slots, "default", { trigger: I }),
|
|
397
|
-
u(s, {
|
|
398
|
-
id: "variant-form",
|
|
399
|
-
modelValue: p.value,
|
|
400
|
-
"onUpdate:modelValue": c[4] || (c[4] = (e) => p.value = e),
|
|
401
|
-
"is-container": t(be).FmForm,
|
|
402
|
-
"is-container-props": {
|
|
403
|
-
onValidationSuccess: Z,
|
|
404
|
-
blameFormChildOnValidationFailed: !0
|
|
405
|
-
},
|
|
406
|
-
"max-width": 560,
|
|
407
|
-
"onOn:clickedAway": t(X)
|
|
408
|
-
}, {
|
|
409
|
-
"side-sheet-header": k(() => [
|
|
410
|
-
o("p", aa, x($.value), 1)
|
|
411
|
-
]),
|
|
412
|
-
"side-sheet-footer": k(() => [
|
|
413
|
-
o("div", ia, [
|
|
414
|
-
u(T, {
|
|
415
|
-
label: N.value,
|
|
416
|
-
loading: F.value,
|
|
417
|
-
size: "lg",
|
|
418
|
-
type: "submit",
|
|
419
|
-
variant: "primary"
|
|
420
|
-
}, null, 8, ["label", "loading"]),
|
|
421
|
-
u(T, {
|
|
422
|
-
label: t(r)("menu.common.actions.cancel"),
|
|
423
|
-
size: "lg",
|
|
424
|
-
variant: "tertiary",
|
|
425
|
-
onClick: c[3] || (c[3] = () => p.value = !1)
|
|
426
|
-
}, null, 8, ["label"])
|
|
427
|
-
])
|
|
428
|
-
]),
|
|
429
|
-
default: k(() => {
|
|
430
|
-
var e;
|
|
431
|
-
return [
|
|
432
|
-
o("div", ta, [
|
|
433
|
-
u(xe, {
|
|
434
|
-
title: t(r)("menu.variant.form.detail")
|
|
435
|
-
}, {
|
|
436
|
-
default: k(() => [
|
|
437
|
-
u(L, {
|
|
438
|
-
autofocus: "",
|
|
439
|
-
label: t(r)("menu.variant.form.name.label"),
|
|
440
|
-
"helper-text": t(r)("menu.variant.form.name.helper"),
|
|
441
|
-
modelValue: a.value.name,
|
|
442
|
-
"onUpdate:modelValue": c[1] || (c[1] = (i) => a.value.name = i),
|
|
443
|
-
rules: [(i) => !!i || t(r)("menu.variant.form.name.required")],
|
|
444
|
-
placeholder: t(r)("menu.variant.form.name.placeholder")
|
|
445
|
-
}, {
|
|
446
|
-
append: k(() => [
|
|
447
|
-
u(b, {
|
|
448
|
-
name: "g_translate",
|
|
449
|
-
class: "cursor-pointer",
|
|
450
|
-
onClick: c[0] || (c[0] = (i) => h("variant"))
|
|
451
|
-
})
|
|
452
|
-
]),
|
|
453
|
-
_: 1
|
|
454
|
-
}, 8, ["label", "helper-text", "modelValue", "rules", "placeholder"]),
|
|
455
|
-
u(ge, {
|
|
456
|
-
label: t(r)("menu.variant.form.options.title")
|
|
457
|
-
}, {
|
|
458
|
-
default: k(() => [
|
|
459
|
-
o("div", null, [
|
|
460
|
-
u(t(_e), {
|
|
461
|
-
"model-value": a.value.options,
|
|
462
|
-
move: R,
|
|
463
|
-
class: "space-y-16",
|
|
464
|
-
group: "categories",
|
|
465
|
-
handle: ".handle",
|
|
466
|
-
"item-key": "_id",
|
|
467
|
-
"onUpdate:modelValue": j
|
|
468
|
-
}, {
|
|
469
|
-
item: k(({ element: i, index: v }) => [
|
|
470
|
-
o("div", {
|
|
471
|
-
class: te(["flex items-center", "space-x-8"]),
|
|
472
|
-
"data-not-allow-sort": v === a.value.options.length - 1
|
|
473
|
-
}, [
|
|
474
|
-
v !== a.value.options.length - 1 ? (f(), J(b, {
|
|
475
|
-
key: 0,
|
|
476
|
-
class: "handle",
|
|
477
|
-
name: "drag_handle"
|
|
478
|
-
})) : v > 0 ? (f(), y("div", na)) : D("", !0),
|
|
479
|
-
o("div", oa, [
|
|
480
|
-
u(L, {
|
|
481
|
-
"model-value": i.name,
|
|
482
|
-
rules: [
|
|
483
|
-
() => !!a.value.options.length || t(r)("menu.variant.form.options.min_required"),
|
|
484
|
-
(g) => v === a.value.options.length - 1 || g ? !0 : t(r)("menu.variant.form.options.name_required")
|
|
485
|
-
],
|
|
486
|
-
class: "flex-1",
|
|
487
|
-
placeholder: t(r)("menu.variant.form.options.placeholder"),
|
|
488
|
-
"onUpdate:modelValue": (g) => Y(i._id, g)
|
|
489
|
-
}, ve({ _: 2 }, [
|
|
490
|
-
v !== a.value.options.length - 1 ? {
|
|
491
|
-
name: "append",
|
|
492
|
-
fn: k(() => [
|
|
493
|
-
o("div", sa, [
|
|
494
|
-
u(b, {
|
|
495
|
-
name: "g_translate",
|
|
496
|
-
class: "cursor-pointer",
|
|
497
|
-
onClick: c[2] || (c[2] = (g) => h("options"))
|
|
498
|
-
}),
|
|
499
|
-
u(b, {
|
|
500
|
-
name: "close",
|
|
501
|
-
onClick: (g) => W(i._id)
|
|
502
|
-
}, null, 8, ["onClick"])
|
|
503
|
-
])
|
|
504
|
-
]),
|
|
505
|
-
key: "0"
|
|
506
|
-
} : void 0
|
|
507
|
-
]), 1032, ["model-value", "rules", "placeholder", "onUpdate:modelValue"])
|
|
508
|
-
])
|
|
509
|
-
], 8, la)
|
|
510
|
-
]),
|
|
511
|
-
_: 1
|
|
512
|
-
}, 8, ["model-value"])
|
|
513
|
-
])
|
|
514
|
-
]),
|
|
515
|
-
_: 1
|
|
516
|
-
}, 8, ["label"])
|
|
517
|
-
]),
|
|
518
|
-
_: 1
|
|
519
|
-
}, 8, ["title"]),
|
|
520
|
-
(e = a.value.usedBy) != null && e.length ? (f(), J(Ve, {
|
|
521
|
-
key: 0,
|
|
522
|
-
editable: !1,
|
|
523
|
-
overrides: a.value.usedBy || [],
|
|
524
|
-
"select-variant": !1,
|
|
525
|
-
title: t(r)("menu.variant.form.applied_product")
|
|
526
|
-
}, null, 8, ["overrides", "title"])) : D("", !0)
|
|
527
|
-
])
|
|
528
|
-
];
|
|
529
|
-
}),
|
|
530
|
-
_: 1
|
|
531
|
-
}, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"]),
|
|
532
|
-
u(ea, {
|
|
533
|
-
modelValue: M.value,
|
|
534
|
-
"onUpdate:modelValue": c[5] || (c[5] = (e) => M.value = e),
|
|
535
|
-
variant: a.value,
|
|
536
|
-
"expand-section": E.value,
|
|
537
|
-
"onUpdate:variant": P
|
|
538
|
-
}, null, 8, ["modelValue", "variant", "expand-section"])
|
|
539
|
-
], 64);
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
}), ga = ra;
|
|
543
|
-
export {
|
|
544
|
-
ga as V
|
|
545
|
-
};
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { defineComponent as p, createElementBlock as u, openBlock as t, normalizeClass as f, unref as m, toDisplayString as y, resolveComponent as d, createVNode as b, createBlock as s } from "vue";
|
|
2
|
-
const g = /* @__PURE__ */ p({
|
|
3
|
-
__name: "TranslationBadge",
|
|
4
|
-
props: {
|
|
5
|
-
label: {},
|
|
6
|
-
spacing: { default: "md" }
|
|
7
|
-
},
|
|
8
|
-
setup(a) {
|
|
9
|
-
const l = a.spacing === "sm" ? "mb-4" : "mb-8";
|
|
10
|
-
return (e, n) => (t(), u("p", {
|
|
11
|
-
class: f([
|
|
12
|
-
"fm-typo-en-body-sm-600 text-fm-color-typo-secondary border inline-block rounded-full px-8 py-4",
|
|
13
|
-
m(l)
|
|
14
|
-
])
|
|
15
|
-
}, y(e.label), 3));
|
|
16
|
-
}
|
|
17
|
-
}), V = /* @__PURE__ */ p({
|
|
18
|
-
__name: "TranslationFieldSection",
|
|
19
|
-
props: {
|
|
20
|
-
label: {},
|
|
21
|
-
modelValue: {},
|
|
22
|
-
type: { default: "text" },
|
|
23
|
-
spacing: { default: "md" },
|
|
24
|
-
placeholder: {},
|
|
25
|
-
readonly: { type: Boolean, default: !1 }
|
|
26
|
-
},
|
|
27
|
-
emits: ["update:modelValue"],
|
|
28
|
-
setup(a, { emit: o }) {
|
|
29
|
-
const l = o;
|
|
30
|
-
return (e, n) => {
|
|
31
|
-
const c = d("FmTextField"), i = d("fm-textarea");
|
|
32
|
-
return t(), u("div", null, [
|
|
33
|
-
b(g, {
|
|
34
|
-
label: e.label,
|
|
35
|
-
spacing: e.spacing
|
|
36
|
-
}, null, 8, ["label", "spacing"]),
|
|
37
|
-
e.type === "text" ? (t(), s(c, {
|
|
38
|
-
key: 0,
|
|
39
|
-
"model-value": e.modelValue,
|
|
40
|
-
placeholder: e.placeholder,
|
|
41
|
-
readonly: e.readonly,
|
|
42
|
-
"onUpdate:modelValue": n[0] || (n[0] = (r) => l("update:modelValue", r))
|
|
43
|
-
}, null, 8, ["model-value", "placeholder", "readonly"])) : (t(), s(i, {
|
|
44
|
-
key: 1,
|
|
45
|
-
"model-value": e.modelValue,
|
|
46
|
-
placeholder: e.placeholder,
|
|
47
|
-
readonly: e.readonly,
|
|
48
|
-
"onUpdate:modelValue": n[1] || (n[1] = (r) => l("update:modelValue", r))
|
|
49
|
-
}, null, 8, ["model-value", "placeholder", "readonly"]))
|
|
50
|
-
]);
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
function k(a) {
|
|
55
|
-
switch (a) {
|
|
56
|
-
case "en-US":
|
|
57
|
-
return "EN";
|
|
58
|
-
case "zh-CN":
|
|
59
|
-
return "简";
|
|
60
|
-
case "th-TH":
|
|
61
|
-
return "TH";
|
|
62
|
-
case "ja-JP":
|
|
63
|
-
return "JP";
|
|
64
|
-
case "zh-Hant":
|
|
65
|
-
return "繁";
|
|
66
|
-
default:
|
|
67
|
-
return "";
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
function v(a, o) {
|
|
71
|
-
const l = m(o).find((e) => e.code === a);
|
|
72
|
-
return (l == null ? void 0 : l.name) || a;
|
|
73
|
-
}
|
|
74
|
-
export {
|
|
75
|
-
V as _,
|
|
76
|
-
v as a,
|
|
77
|
-
g as b,
|
|
78
|
-
k as g
|
|
79
|
-
};
|
|
File without changes
|