@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.
Files changed (80) hide show
  1. package/dist/{App-BXkiQoTM.js → App-CczmyQeJ.js} +1471 -1458
  2. package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BoSL4dm7.js → ApplyProduct.vue_vue_type_script_setup_true_lang-BscsJpMV.js} +3 -3
  3. package/dist/{Catalog-CLFVLyor.js → Catalog-RU_6keJm.js} +6 -6
  4. package/dist/{Category-CNuVHuI3.js → Category-7Fg2kD0h.js} +79 -79
  5. package/dist/{Category-BdyouDU8.js → Category-CwEXbsDv.js} +4 -4
  6. package/dist/{CookingGuide-Bed7bUt1.js → CookingGuide-DFu5VStf.js} +4 -4
  7. package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-CZDL2xJC.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CeNfLbfq.js} +1 -1
  8. package/dist/{Group-TUqCPmO3.js → Group-C6vQeBnj.js} +1 -1
  9. package/dist/{Group-D4UTsIxI.js → Group-l-YpAi6B.js} +3 -3
  10. package/dist/{Group.vue_vue_type_script_setup_true_lang-BJPT8flL.js → Group.vue_vue_type_script_setup_true_lang-1UdOBdv-.js} +165 -165
  11. package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D83liryu.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-C309DrLU.js} +5 -5
  12. package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-CRIRinHB.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-C903fhuj.js} +6 -6
  13. package/dist/{Ingredient-CcxoeuDd.js → Ingredient-CHqDo-GY.js} +3 -3
  14. package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-58tyxdVh.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CXHHlrI0.js} +2 -2
  15. package/dist/{LinkProductSideSheet-DazOkwkd.js → LinkProductSideSheet-DY32g33Q.js} +3 -3
  16. package/dist/{MenuSetting-B3oLll4C.js → MenuSetting-DhbxlKuU.js} +5 -5
  17. package/dist/{PrintRoute-D878qPu8.js → PrintRoute-CToZ0ClG.js} +4 -4
  18. package/dist/{Product-DOC8y_mW.js → Product-Cpg32wpg.js} +1 -1
  19. package/dist/{Product.vue_vue_type_script_setup_true_lang-tZyBhWYT.js → Product.vue_vue_type_script_setup_true_lang-BC2KG1q4.js} +440 -438
  20. package/dist/{ProductInternalTools-9TgIc2bR.js → ProductInternalTools-wH9BN1NK.js} +5 -5
  21. package/dist/Products-CpINHaH6.js +291 -0
  22. package/dist/{Publish-BktK_PKq.js → Publish-CJS_836k.js} +3 -3
  23. package/dist/{Recipe-eA0xrGYk.js → Recipe-Cz7hivmM.js} +4 -4
  24. package/dist/{RuleView.vue_vue_type_script_setup_true_lang-t8M7z09s.js → RuleView.vue_vue_type_script_setup_true_lang-CRLzqgQe.js} +207 -207
  25. package/dist/{Scheduler-CKSqPZLQ.js → Scheduler-QuWCnEJw.js} +3 -3
  26. package/dist/{ServingSequence-Ea20baNj.js → ServingSequence-CqK5Sjmq.js} +3 -3
  27. package/dist/{Setting-u6lX_Dzg.js → Setting-C3tKUfsm.js} +5 -5
  28. package/dist/{Subcategory-C6s7OMOb.js → Subcategory-DCtTOPUj.js} +99 -100
  29. package/dist/{Takeaway-lWxS9oWe.js → Takeaway-BnB1OFnK.js} +1 -1
  30. package/dist/{Takeaway-B9kr-Nf4.js → Takeaway-Fi8SAH2t.js} +4 -4
  31. 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
  32. 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
  33. package/dist/TranslationFieldSection.vue_vue_type_script_setup_true_lang-BpL8UrFY.js +278 -0
  34. package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-DtkzQeq4.js +140 -0
  35. package/dist/TranslationViewChip.vue_vue_type_script_setup_true_lang-CHT7Xozn.js +60 -0
  36. 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
  37. package/dist/{Unit-DkQlUg2l.js → Unit-5yE2-y9D.js} +2 -2
  38. package/dist/Variant-C7lIdRID.js +248 -0
  39. package/dist/{_id_-_oqk-OhC.js → _id_-08ykp97a.js} +9 -9
  40. package/dist/{app-CfCYl2pO.js → app-CA4g3v2n.js} +26 -26
  41. package/dist/{app-DIYHNWEw.js → app-DPovSnb_.js} +1 -1
  42. package/dist/app.js +1 -1
  43. package/dist/apps/mf-menu/src/components/translation/LanguageChip.vue.d.ts +18 -0
  44. package/dist/apps/mf-menu/src/components/translation/LanguageSelector.vue.d.ts +33 -0
  45. package/dist/apps/mf-menu/src/components/translation/LocaleIconBadge.vue.d.ts +29 -0
  46. package/dist/apps/mf-menu/src/components/translation/TranslationFieldRow.vue.d.ts +39 -0
  47. package/dist/apps/mf-menu/src/components/translation/TranslationViewChip.vue.d.ts +15 -0
  48. package/dist/apps/mf-menu/src/composable/translationLanguages.d.ts +16 -0
  49. package/dist/apps/mf-menu/src/stores/menu.d.ts +1 -0
  50. package/dist/apps/mf-menu/src/utils/translation.d.ts +1 -1
  51. package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
  52. package/dist/assets/{linked-status-AoXjo9FF.js → linked-status-WT6deoPw.js} +2 -2
  53. package/dist/assets/{menu-export-BHcaWhM3.js → menu-export-DxtFXMED.js} +2 -2
  54. package/dist/assets/{override-menu-B9xQcjuJ.js → override-menu-BJGRdWWE.js} +2 -2
  55. package/dist/assets/{validate-menu-D-ezd4W8.js → validate-menu-B_tmkHe7.js} +2 -2
  56. package/dist/{catalog-CvN9Wu8V.js → catalog-D7Jjqj3-.js} +1 -1
  57. package/dist/{catalogSetting-qS5Np22q.js → catalogSetting-Bg_zMUrV.js} +1 -1
  58. package/dist/{currency-Nxod6uwl.js → currency-DDxFMjAI.js} +1 -1
  59. package/dist/{dayjs.min-B1AjAGva.js → dayjs.min-BVOO8wJG.js} +1 -1
  60. package/dist/{index-Cq-czJjU.js → index-BlLRjkMF.js} +8 -7
  61. package/dist/{index-nKlYiotY.js → index-CG7GFWlC.js} +1 -1
  62. package/dist/index-Cq2MVpMv.js +472 -0
  63. package/dist/{index.vue_vue_type_script_setup_true_lang-YXKayPEp.js → index.vue_vue_type_script_setup_true_lang-C6IVvAua.js} +169 -168
  64. package/dist/{item-CUZSonzT.js → item-Bq6SCc7D.js} +3250 -3386
  65. package/dist/{jszip.min-BnkZQ6lD.js → jszip.min-1MrCGuHF.js} +2 -2
  66. package/dist/{menu-BP_ArXCI.js → menu-CKA9uouu.js} +1 -1
  67. package/dist/{menuV2-BGEYgQ8-.js → menuV2-DBkrmeha.js} +71 -71
  68. package/dist/{priceTier-B-Qa0xaO.js → priceTier-Cxr9IcVP.js} +1 -1
  69. package/dist/{rules-Dchd_ilF.js → rules-DFWR7a3m.js} +4 -4
  70. package/dist/{scheduler-DN7ZGLk8.js → scheduler-HKff8Ty2.js} +4 -4
  71. package/dist/{toExcel-jHmkDqcm.js → toExcel-DopYrxBW.js} +2 -2
  72. package/dist/{unit-DgL56pkI.js → unit-5G600HMJ.js} +2 -2
  73. package/package.json +1 -1
  74. package/dist/Products-DfUGnHmD.js +0 -1568
  75. package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-CcIGCUwk.js +0 -194
  76. package/dist/Variant-BF5r2WLL.js +0 -247
  77. package/dist/index-C0Zw1cSS.js +0 -545
  78. package/dist/translation-Cdap0IVg.js +0 -79
  79. /package/dist/apps/mf-menu/src/components/{TranslationBadge.vue.d.ts → translation/TranslationBadge.vue.d.ts} +0 -0
  80. /package/dist/apps/mf-menu/src/components/{TranslationFieldSection.vue.d.ts → translation/TranslationFieldSection.vue.d.ts} +0 -0
@@ -1,4 +1,4 @@
1
- import { u as h, A as n, M as d, al as _ } from "./index.vue_vue_type_script_setup_true_lang-YXKayPEp.js";
1
+ import { u as h, A as n, M as d, al as _ } from "./index.vue_vue_type_script_setup_true_lang-C6IVvAua.js";
2
2
  import "@feedmepos/ui-library";
3
3
  class u {
4
4
  constructor(t, e, r, a) {
@@ -1,4 +1,4 @@
1
- import { A as u, I as i } from "./index.vue_vue_type_script_setup_true_lang-YXKayPEp.js";
1
+ import { A as u, I as i } from "./index.vue_vue_type_script_setup_true_lang-C6IVvAua.js";
2
2
  var a = /* @__PURE__ */ ((e) => (e.AUTO = "auto", e.MANUAL = "manual", e))(a || {}), m = /* @__PURE__ */ ((e) => (e[e.Normal = 0] = "Normal", e[e.Rules = 1] = "Rules", e))(m || {});
3
3
  class s {
4
4
  static fromCatalog(r, n) {
@@ -1,4 +1,4 @@
1
- import { B as e } from "./index.vue_vue_type_script_setup_true_lang-YXKayPEp.js";
1
+ import { B as e } from "./index.vue_vue_type_script_setup_true_lang-C6IVvAua.js";
2
2
  function n(r, o = !0) {
3
3
  return e.Dinero.fromFdoDinero(r).toFormat(o).replaceAll(" ", "");
4
4
  }
@@ -1,4 +1,4 @@
1
- import { g as a, am as r } from "./index.vue_vue_type_script_setup_true_lang-YXKayPEp.js";
1
+ import { g as a, am as r } from "./index.vue_vue_type_script_setup_true_lang-C6IVvAua.js";
2
2
  var s = r();
3
3
  const t = /* @__PURE__ */ a(s);
4
4
  export {
@@ -1,15 +1,15 @@
1
- import { B as $, A as Z, u as G, I as Q, D as A, J as X } from "./index.vue_vue_type_script_setup_true_lang-YXKayPEp.js";
1
+ import { B as $, A as Z, u as G, I as Q, D as A, J as X } from "./index.vue_vue_type_script_setup_true_lang-C6IVvAua.js";
2
2
  import { defineComponent as R, ref as h, computed as _, watch as j, onMounted as ee, onBeforeUnmount as ae, resolveComponent as x, createBlock as J, openBlock as L, withModifiers as q, withCtx as k, renderSlot as P, createElementBlock as I, Fragment as K, createVNode as v, unref as i, createElementVNode as U, createCommentVNode as te, renderList as le, toDisplayString as O } from "vue";
3
3
  import { useI18n as W } from "@feedmepos/mf-common";
4
4
  import { components as ne } from "@feedmepos/ui-library";
5
- import { _ as oe } from "./RuleView.vue_vue_type_script_setup_true_lang-t8M7z09s.js";
5
+ import { _ as oe } from "./RuleView.vue_vue_type_script_setup_true_lang-CRLzqgQe.js";
6
6
  import { u as ie } from "./discardConfirm-BHni0LNu.js";
7
- import { _ as re } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-BoSL4dm7.js";
8
- import { _ as ue } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-CcIGCUwk.js";
7
+ import { _ as re } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-BscsJpMV.js";
8
+ import { _ as ue } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-DtkzQeq4.js";
9
9
  import { c as se } from "./check-C9mY6LiX.js";
10
- import { f as me } from "./currency-Nxod6uwl.js";
10
+ import { f as me } from "./currency-DDxFMjAI.js";
11
11
  import { c as de } from "./string-DpfFixWH.js";
12
- import { g as z } from "./translation-Cdap0IVg.js";
12
+ import { g as z } from "./TranslationFieldSection.vue_vue_type_script_setup_true_lang-BpL8UrFY.js";
13
13
  const pe = /* @__PURE__ */ R({
14
14
  __name: "CurrencyInput",
15
15
  props: {
@@ -195,9 +195,10 @@ const ce = { class: "fm-typo-en-title-md-600" }, fe = { class: "space-y-32" }, v
195
195
  () => u.value = !1
196
196
  );
197
197
  function Y() {
198
+ const a = s.value;
198
199
  E("update:takeaway", {
199
200
  ...e.value,
200
- ...s.value && { name_locale: s.value }
201
+ name_locale: a
201
202
  }), D(!1);
202
203
  }
203
204
  return j(
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as W, ref as A, resolveComponent as v, createElementBlock as E, openBlock as I, Fragment as B, createElementVNode as g, createVNode as c, normalizeClass as T, withCtx as _, toDisplayString as S, unref as i, h as G, watch as O, onMounted as K, nextTick as M, readonly as N, getCurrentInstance as U, getCurrentScope as L, onScopeDispose as $ } from "vue";
2
2
  import { useI18n as q, useCustomAttributes as H, useCoreStore as J } from "@feedmepos/mf-common";
3
3
  import { components as Q } from "@feedmepos/ui-library";
4
- import { d as X, _ as k } from "./RuleView.vue_vue_type_script_setup_true_lang-t8M7z09s.js";
4
+ import { d as X, _ as k } from "./RuleView.vue_vue_type_script_setup_true_lang-CRLzqgQe.js";
5
5
  const Y = {
6
6
  class: /* @__PURE__ */ T(["fm-typo-en-body-md-600 select-none text-ellipsis overflow-hidden whitespace-nowrap", "text-fm-color-neutral-gray-400"])
7
7
  }, Z = {
@@ -0,0 +1,472 @@
1
+ import { defineComponent as te, ref as f, computed as B, watch as Q, resolveComponent as C, createBlock as I, openBlock as h, unref as o, withCtx as k, createElementVNode as p, createVNode as m, createElementBlock as O, createCommentVNode as N, normalizeClass as H, toDisplayString as F, Fragment as A, renderList as J, renderSlot as se, createSlots as ie } from "vue";
2
+ import { J as E, Q as re, G as ue, I as j, D as W, M as X, A as Z } from "./index.vue_vue_type_script_setup_true_lang-C6IVvAua.js";
3
+ import { d as de } from "./vuedraggable-CK8z7qA8.js";
4
+ import { useI18n as ne } from "@feedmepos/mf-common";
5
+ import { useSnackbar as ce, components as me } from "@feedmepos/ui-library";
6
+ import { _ as ve } from "./FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js";
7
+ import { _ as pe } from "./RuleView.vue_vue_type_script_setup_true_lang-CRLzqgQe.js";
8
+ import { u as oe } from "./discardConfirm-BHni0LNu.js";
9
+ import { _ as fe } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-BscsJpMV.js";
10
+ import { _ as _e, a as ee, b as ae, c as le } from "./TranslationFieldSection.vue_vue_type_script_setup_true_lang-BpL8UrFY.js";
11
+ import { c as he } from "./check-C9mY6LiX.js";
12
+ const ge = { class: "fm-typo-en-title-md-600" }, ye = { class: "pt-8 space-y-24" }, Ve = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, be = { class: "fm-typo-en-body-lg-600" }, xe = {
13
+ key: 0,
14
+ class: "flex flex-col gap-32 pl-32"
15
+ }, ke = {
16
+ key: 0,
17
+ class: "space-y-8"
18
+ }, Ee = { class: "flex flex-col gap-16 border p-16 rounded-lg" }, Oe = { class: "fm-typo-en-body-lg-600" }, we = {
19
+ key: 0,
20
+ class: "flex flex-col gap-32 pl-32"
21
+ }, Ue = { class: "fm-typo-en-body-md-600 text-fm-color-primary border border-fm-color-primary inline-block rounded-md px-8 py-4" }, $e = { class: "space-y-32" }, Se = {
22
+ key: 0,
23
+ class: "space-y-8"
24
+ }, Ce = { class: "flex gap-8 items-center justify-start" }, Ne = /* @__PURE__ */ te({
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: z }) {
33
+ const d = q, S = z, { t: s } = ne(), w = f(!1), U = f(!1), g = f([]), t = f([]), y = f({}), b = f({}), x = f(""), T = f(""), _ = f({}), D = f({}), $ = f({}), L = f({}), P = B(() => d.variant.options.map((l, n) => ({
34
+ ...l,
35
+ optionIndex: n + 1
36
+ })).filter((l) => l.name.trim() !== ""));
37
+ function M() {
38
+ const l = /* @__PURE__ */ new Set();
39
+ d.variant.name_locale && Object.keys(d.variant.name_locale).forEach((e) => l.add(e)), d.variant.options.forEach((e) => {
40
+ e.name_locale && Object.keys(e.name_locale).forEach((u) => l.add(u));
41
+ });
42
+ const n = Array.from(l);
43
+ g.value = n;
44
+ const c = {};
45
+ d.variant.name_locale && Object.entries(d.variant.name_locale).forEach(([e, u]) => {
46
+ c[e] = u;
47
+ }), y.value = c, x.value = d.variant.name;
48
+ const r = {}, v = {};
49
+ d.variant.options.forEach((e) => {
50
+ r[e._id] = {}, e.name_locale && Object.entries(e.name_locale).forEach(([u, V]) => {
51
+ r[e._id][u] = V;
52
+ }), v[e._id] = e.name;
53
+ }), _.value = r, $.value = v;
54
+ }
55
+ Q(
56
+ () => [d.modelValue, d.variant, d.expandSection],
57
+ ([l, , n]) => {
58
+ l && (M(), t.value = E.clone(g.value), b.value = E.clone(y.value), T.value = x.value, D.value = E.clone(_.value), L.value = E.clone($.value), n === "variant" ? (w.value = !0, U.value = !1) : (w.value = !1, U.value = !0));
59
+ },
60
+ { immediate: !0, deep: !0 }
61
+ );
62
+ function Y(l) {
63
+ const n = new Set(g.value), c = new Set(l);
64
+ for (const r of l)
65
+ n.has(r) || (y.value[r] || (y.value[r] = ""), Object.keys(_.value).forEach((v) => {
66
+ _.value[v][r] || (_.value[v][r] = "");
67
+ }));
68
+ for (const r of n)
69
+ c.has(r) || (delete y.value[r], Object.keys(_.value).forEach((v) => {
70
+ delete _.value[v][r];
71
+ }));
72
+ g.value = l;
73
+ }
74
+ function G() {
75
+ return !E.isEqual(g.value, t.value) || !E.isEqual(y.value, b.value) || x.value !== T.value || !E.isEqual(_.value, D.value) || !E.isEqual($.value, L.value);
76
+ }
77
+ function R() {
78
+ const l = E.clone(d.variant);
79
+ x.value !== void 0 && (l.name = x.value);
80
+ const n = {};
81
+ Object.entries(y.value).forEach(([c, r]) => {
82
+ r && r.trim() && (n[c] = r.trim());
83
+ }), Object.keys(n).length > 0 ? l.name_locale = n : delete l.name_locale, l.options.forEach((c) => {
84
+ const r = $.value[c._id];
85
+ r !== void 0 && (c.name = r);
86
+ const v = _.value[c._id];
87
+ if (v && Object.keys(v).length > 0) {
88
+ const e = {};
89
+ Object.entries(v).forEach(([u, V]) => {
90
+ V && V.trim() && (e[u] = V.trim());
91
+ }), Object.keys(e).length > 0 ? c.name_locale = e : delete c.name_locale;
92
+ } else
93
+ delete c.name_locale;
94
+ }), S("update:variant", l), S("update:modelValue", !1);
95
+ }
96
+ function K() {
97
+ S("update:modelValue", !1);
98
+ }
99
+ const a = oe(G, K), i = B({
100
+ get: () => d.modelValue,
101
+ set: (l) => S("update:modelValue", l)
102
+ });
103
+ return (l, n) => {
104
+ const c = C("FmIcon"), r = C("fm-button"), v = C("fm-side-sheet");
105
+ return h(), I(v, {
106
+ modelValue: i.value,
107
+ "onUpdate:modelValue": n[3] || (n[3] = (e) => i.value = e),
108
+ "max-width": 720,
109
+ "onOn:clickedAway": o(a)
110
+ }, {
111
+ "side-sheet-header": k(() => [
112
+ p("p", ge, F(o(s)("menu.variant.form.translation.title")), 1)
113
+ ]),
114
+ "side-sheet-footer": k(() => [
115
+ p("div", Ce, [
116
+ m(r, {
117
+ label: o(s)("common.save"),
118
+ size: "lg",
119
+ variant: "primary",
120
+ onClick: R
121
+ }, null, 8, ["label"]),
122
+ m(r, {
123
+ label: o(s)("common.cancel"),
124
+ size: "lg",
125
+ variant: "tertiary",
126
+ onClick: o(a)
127
+ }, null, 8, ["label", "onClick"])
128
+ ])
129
+ ]),
130
+ default: k(() => [
131
+ p("div", ye, [
132
+ m(_e, {
133
+ "selected-locales": g.value,
134
+ label: o(s)("menu.variant.form.translation.language"),
135
+ "onUpdate:selectedLocales": Y
136
+ }, null, 8, ["selected-locales", "label"]),
137
+ p("div", Ve, [
138
+ p("div", {
139
+ class: "flex items-center gap-16 cursor-pointer",
140
+ onClick: n[0] || (n[0] = (e) => w.value = !w.value)
141
+ }, [
142
+ m(c, {
143
+ name: "keyboard_arrow_down",
144
+ class: H(["transition-transform", w.value ? "transform rotate-180" : ""])
145
+ }, null, 8, ["class"]),
146
+ p("p", be, F(o(s)("menu.variant.form.translation.variant_name")), 1)
147
+ ]),
148
+ w.value ? (h(), O("div", xe, [
149
+ m(ee, {
150
+ label: o(s)("menu.variant.form.translation.default"),
151
+ modelValue: x.value,
152
+ "onUpdate:modelValue": n[1] || (n[1] = (e) => x.value = e)
153
+ }, null, 8, ["label", "modelValue"]),
154
+ g.value.length > 0 ? (h(), O("div", ke, [
155
+ m(ae, {
156
+ label: o(s)("menu.variant.form.translation.translation")
157
+ }, null, 8, ["label"]),
158
+ (h(!0), O(A, null, J(g.value, (e) => (h(), I(le, {
159
+ key: e,
160
+ "locale-code": e,
161
+ modelValue: y.value[e],
162
+ "onUpdate:modelValue": (u) => y.value[e] = u,
163
+ placeholder: l.variant.name
164
+ }, null, 8, ["locale-code", "modelValue", "onUpdate:modelValue", "placeholder"]))), 128))
165
+ ])) : N("", !0)
166
+ ])) : N("", !0)
167
+ ]),
168
+ p("div", Ee, [
169
+ p("div", {
170
+ class: "flex items-center gap-16 cursor-pointer",
171
+ onClick: n[2] || (n[2] = (e) => U.value = !U.value)
172
+ }, [
173
+ m(c, {
174
+ name: "keyboard_arrow_down",
175
+ class: H(["transition-transform", U.value ? "transform rotate-180" : ""])
176
+ }, null, 8, ["class"]),
177
+ p("p", Oe, F(o(s)("menu.variant.form.translation.option_value")), 1)
178
+ ]),
179
+ U.value ? (h(), O("div", we, [
180
+ (h(!0), O(A, null, J(P.value, (e) => (h(), O("div", {
181
+ key: e._id,
182
+ class: "space-y-8"
183
+ }, [
184
+ p("p", Ue, F(o(s)("menu.variant.form.translation.option", { number: e.optionIndex })), 1),
185
+ p("div", $e, [
186
+ m(ee, {
187
+ label: o(s)("menu.variant.form.translation.default"),
188
+ modelValue: $.value[e._id],
189
+ "onUpdate:modelValue": (u) => $.value[e._id] = u,
190
+ spacing: "sm"
191
+ }, null, 8, ["label", "modelValue", "onUpdate:modelValue"]),
192
+ g.value.length > 0 ? (h(), O("div", Se, [
193
+ m(ae, {
194
+ label: o(s)("menu.variant.form.translation.translation"),
195
+ spacing: "sm"
196
+ }, null, 8, ["label"]),
197
+ (h(!0), O(A, null, J(g.value, (u) => (h(), I(le, {
198
+ key: u,
199
+ "locale-code": u,
200
+ modelValue: _.value[e._id][u],
201
+ "onUpdate:modelValue": (V) => _.value[e._id][u] = V,
202
+ placeholder: e.name
203
+ }, null, 8, ["locale-code", "modelValue", "onUpdate:modelValue", "placeholder"]))), 128))
204
+ ])) : N("", !0)
205
+ ])
206
+ ]))), 128))
207
+ ])) : N("", !0)
208
+ ])
209
+ ])
210
+ ]),
211
+ _: 1
212
+ }, 8, ["modelValue", "onOn:clickedAway"]);
213
+ };
214
+ }
215
+ }), Te = { class: "fm-typo-en-title-md-600" }, De = { class: "py-16 space-y-32" }, je = ["data-not-allow-sort"], Fe = {
216
+ key: 1,
217
+ class: "w-24"
218
+ }, Ie = { class: "flex-1" }, Le = { class: "flex items-center gap-8" }, Me = { class: "flex gap-8 items-center justify-start" }, Ae = /* @__PURE__ */ te({
219
+ __name: "Form",
220
+ props: {
221
+ initialValue: {}
222
+ },
223
+ setup(q, { expose: z }) {
224
+ const d = q, S = re(ue(ce())), { t: s } = ne(), w = B(
225
+ () => d.initialValue ? s("menu.variant.form.title.edit") : s("menu.variant.form.title.add")
226
+ ), U = B(() => d.initialValue ? "Update" : "Add"), g = () => {
227
+ if (d.initialValue) {
228
+ const a = j(d.initialValue);
229
+ return a.options.push({
230
+ _id: (/* @__PURE__ */ new Date()).toISOString(),
231
+ name: ""
232
+ }), a;
233
+ } else
234
+ return { ...W.generator.initMenuV4VariantGroup(), usedBy: [] };
235
+ }, t = f(g()), y = f(!1), b = f(!1), x = f(!1), T = f("variant"), _ = (a) => {
236
+ he.isBoolean(a) ? b.value = a : b.value = !b.value;
237
+ };
238
+ function D(a) {
239
+ T.value = a, x.value = !0;
240
+ }
241
+ function $(a) {
242
+ t.value = a;
243
+ }
244
+ function L(a) {
245
+ t.value.options = a;
246
+ }
247
+ function P(a, i) {
248
+ const l = j(t.value.options), n = l.findIndex((c) => c._id == a);
249
+ l[n].name = i, t.value.options = l, n === t.value.options.length - 1 && M();
250
+ }
251
+ function M() {
252
+ const a = j(t.value.options);
253
+ t.value.options = [
254
+ ...a,
255
+ {
256
+ _id: (/* @__PURE__ */ new Date()).toISOString(),
257
+ name: ""
258
+ }
259
+ ];
260
+ }
261
+ function Y(a) {
262
+ const i = j(t.value.options);
263
+ t.value.options = i.filter((l) => l._id !== a);
264
+ }
265
+ Q(
266
+ () => t.value.options,
267
+ (a) => {
268
+ a.length <= 0 && M();
269
+ },
270
+ {
271
+ immediate: !0
272
+ }
273
+ );
274
+ function G(a) {
275
+ const i = a.draggedContext.futureIndex, l = a.relatedContext.list;
276
+ return i !== l.length - 1;
277
+ }
278
+ const R = oe(
279
+ () => {
280
+ if (d.initialValue) {
281
+ const a = t.value.options.filter((i) => !!i.name.trim());
282
+ return !E.isEqual({ ...t.value, options: a }, d.initialValue);
283
+ } else
284
+ return !!(t.value.options.length > 1 || t.value.name.trim());
285
+ },
286
+ () => {
287
+ b.value = !1;
288
+ }
289
+ ), K = async () => {
290
+ try {
291
+ y.value = !0;
292
+ const a = j(t.value);
293
+ a.options = a.options.filter((i) => !!i.name.trim()), d.initialValue ? await S.updateMenu(
294
+ {
295
+ module: Z.F_MENU_MODULE_V4_KEY.enum.variant,
296
+ operation: X.F_OPERATION_TYPE.update,
297
+ data: a
298
+ },
299
+ a.name
300
+ ) : await S.updateMenu(
301
+ {
302
+ module: Z.F_MENU_MODULE_V4_KEY.enum.variant,
303
+ operation: X.F_OPERATION_TYPE.create,
304
+ data: a
305
+ },
306
+ a.name
307
+ ), _(!1), t.value = { ...W.generator.initMenuV4VariantGroup(), usedBy: [] };
308
+ } finally {
309
+ y.value = !1;
310
+ }
311
+ };
312
+ return Q(
313
+ () => b.value,
314
+ (a) => {
315
+ a && (t.value = g());
316
+ }
317
+ ), z({
318
+ show: b,
319
+ trigger: _
320
+ }), (a, i) => {
321
+ const l = C("fm-icon"), n = C("fm-text-field"), c = C("fm-button"), r = C("fm-side-sheet");
322
+ return h(), O(A, null, [
323
+ se(a.$slots, "default", { trigger: _ }),
324
+ m(r, {
325
+ id: "variant-form",
326
+ modelValue: b.value,
327
+ "onUpdate:modelValue": i[4] || (i[4] = (v) => b.value = v),
328
+ "is-container": o(me).FmForm,
329
+ "is-container-props": {
330
+ onValidationSuccess: K,
331
+ blameFormChildOnValidationFailed: !0
332
+ },
333
+ "max-width": 560,
334
+ "onOn:clickedAway": o(R)
335
+ }, {
336
+ "side-sheet-header": k(() => [
337
+ p("p", Te, F(w.value), 1)
338
+ ]),
339
+ "side-sheet-footer": k(() => [
340
+ p("div", Me, [
341
+ m(c, {
342
+ label: U.value,
343
+ loading: y.value,
344
+ size: "lg",
345
+ type: "submit",
346
+ variant: "primary"
347
+ }, null, 8, ["label", "loading"]),
348
+ m(c, {
349
+ label: o(s)("menu.common.actions.cancel"),
350
+ size: "lg",
351
+ variant: "tertiary",
352
+ onClick: i[3] || (i[3] = () => b.value = !1)
353
+ }, null, 8, ["label"])
354
+ ])
355
+ ]),
356
+ default: k(() => {
357
+ var v;
358
+ return [
359
+ p("div", De, [
360
+ m(pe, {
361
+ title: o(s)("menu.variant.form.detail")
362
+ }, {
363
+ default: k(() => [
364
+ m(n, {
365
+ autofocus: "",
366
+ label: o(s)("menu.variant.form.name.label"),
367
+ "helper-text": o(s)("menu.variant.form.name.helper"),
368
+ modelValue: t.value.name,
369
+ "onUpdate:modelValue": i[1] || (i[1] = (e) => t.value.name = e),
370
+ rules: [(e) => !!e || o(s)("menu.variant.form.name.required")],
371
+ placeholder: o(s)("menu.variant.form.name.placeholder")
372
+ }, {
373
+ append: k(() => [
374
+ m(l, {
375
+ name: "g_translate",
376
+ class: "cursor-pointer",
377
+ onClick: i[0] || (i[0] = (e) => D("variant"))
378
+ })
379
+ ]),
380
+ _: 1
381
+ }, 8, ["label", "helper-text", "modelValue", "rules", "placeholder"]),
382
+ m(ve, {
383
+ label: o(s)("menu.variant.form.options.title")
384
+ }, {
385
+ default: k(() => [
386
+ p("div", null, [
387
+ m(o(de), {
388
+ "model-value": t.value.options,
389
+ move: G,
390
+ class: "space-y-16",
391
+ group: "categories",
392
+ handle: ".handle",
393
+ "item-key": "_id",
394
+ "onUpdate:modelValue": L
395
+ }, {
396
+ item: k(({ element: e, index: u }) => [
397
+ p("div", {
398
+ class: H(["flex items-center", "space-x-8"]),
399
+ "data-not-allow-sort": u === t.value.options.length - 1
400
+ }, [
401
+ u !== t.value.options.length - 1 ? (h(), I(l, {
402
+ key: 0,
403
+ class: "handle",
404
+ name: "drag_handle"
405
+ })) : u > 0 ? (h(), O("div", Fe)) : N("", !0),
406
+ p("div", Ie, [
407
+ m(n, {
408
+ "model-value": e.name,
409
+ rules: [
410
+ () => !!t.value.options.length || o(s)("menu.variant.form.options.min_required"),
411
+ (V) => u === t.value.options.length - 1 || V ? !0 : o(s)("menu.variant.form.options.name_required")
412
+ ],
413
+ class: "flex-1",
414
+ placeholder: o(s)("menu.variant.form.options.placeholder"),
415
+ "onUpdate:modelValue": (V) => P(e._id, V)
416
+ }, ie({ _: 2 }, [
417
+ u !== t.value.options.length - 1 ? {
418
+ name: "append",
419
+ fn: k(() => [
420
+ p("div", Le, [
421
+ m(l, {
422
+ name: "g_translate",
423
+ class: "cursor-pointer",
424
+ onClick: i[2] || (i[2] = (V) => D("options"))
425
+ }),
426
+ m(l, {
427
+ name: "close",
428
+ onClick: (V) => Y(e._id)
429
+ }, null, 8, ["onClick"])
430
+ ])
431
+ ]),
432
+ key: "0"
433
+ } : void 0
434
+ ]), 1032, ["model-value", "rules", "placeholder", "onUpdate:modelValue"])
435
+ ])
436
+ ], 8, je)
437
+ ]),
438
+ _: 1
439
+ }, 8, ["model-value"])
440
+ ])
441
+ ]),
442
+ _: 1
443
+ }, 8, ["label"])
444
+ ]),
445
+ _: 1
446
+ }, 8, ["title"]),
447
+ (v = t.value.usedBy) != null && v.length ? (h(), I(fe, {
448
+ key: 0,
449
+ editable: !1,
450
+ overrides: t.value.usedBy || [],
451
+ "select-variant": !1,
452
+ title: o(s)("menu.variant.form.applied_product")
453
+ }, null, 8, ["overrides", "title"])) : N("", !0)
454
+ ])
455
+ ];
456
+ }),
457
+ _: 1
458
+ }, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"]),
459
+ m(Ne, {
460
+ modelValue: x.value,
461
+ "onUpdate:modelValue": i[5] || (i[5] = (v) => x.value = v),
462
+ variant: t.value,
463
+ "expand-section": T.value,
464
+ "onUpdate:variant": $
465
+ }, null, 8, ["modelValue", "variant", "expand-section"])
466
+ ], 64);
467
+ };
468
+ }
469
+ }), We = Ae;
470
+ export {
471
+ We as V
472
+ };