@feedmepos/mf-menu 0.32.37-dev.1 → 0.32.38-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-Bb-3_ZSx.js → App-DGdS9nht.js} +5 -5
- package/dist/{ApplyProduct.vue_vue_type_script_setup_true_lang-BARmH5Kv.js → ApplyProduct.vue_vue_type_script_setup_true_lang-CBy3XScH.js} +3 -3
- package/dist/{Catalog-yRIPAnDC.js → Catalog-BuI0IVpf.js} +6 -6
- package/dist/{Category-Ca9K5MhL.js → Category-DSTt-Sl6.js} +9 -9
- package/dist/Category-DbL3CS-5.js +224 -0
- package/dist/{CookingGuide-B8BEcGEe.js → CookingGuide-Baw7iMDl.js} +4 -4
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-DIpsCALu.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-BDZDojOt.js} +1 -1
- package/dist/{Group-BT99kxFT.js → Group-BnzmEllK.js} +1 -1
- package/dist/{Group-th2sIKMq.js → Group-D158_Fr0.js} +7 -7
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BBucri8m.js → Group.vue_vue_type_script_setup_true_lang-C3H6xvlY.js} +227 -216
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-RBYXZiHI.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D2G40Yc6.js} +5 -5
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-DrPwZuUE.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-D-JOSWUn.js} +6 -6
- package/dist/{Ingredient-BEcfdvoj.js → Ingredient-C-gP75uQ.js} +3 -3
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-CXWw_gWA.js → InventoryBinding.vue_vue_type_script_setup_true_lang-BpuYVaKl.js} +2 -2
- package/dist/{LinkProductSideSheet-5r07FaSs.js → LinkProductSideSheet-DN5fbJVw.js} +3 -3
- package/dist/{MenuSetting-HhVipfSP.js → MenuSetting-CjQ6_Ti_.js} +5 -5
- package/dist/{PrintRoute-xkZf95vB.js → PrintRoute-DK25vS8X.js} +4 -4
- package/dist/{Product-Bn_h8_wa.js → Product-DCEMAuw3.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-3mmMzUVq.js → Product.vue_vue_type_script_setup_true_lang-DCutU0Ny.js} +348 -337
- package/dist/{ProductInternalTools-BRsD97bC.js → ProductInternalTools-CiDa1V3D.js} +22 -22
- package/dist/{Products-CpDyGrq_.js → Products-DUxtMLiy.js} +50 -50
- package/dist/{Publish-Ce67sfIi.js → Publish-Bs5zVwDw.js} +3 -3
- package/dist/{Recipe-6pn-8XJc.js → Recipe-_WCpFOU6.js} +4 -4
- package/dist/{RuleView.vue_vue_type_script_setup_true_lang-o8JUN34b.js → RuleView.vue_vue_type_script_setup_true_lang-3AVOVYpW.js} +2 -2
- package/dist/{Scheduler-DVIqTWNo.js → Scheduler-BqFwfRlm.js} +3 -3
- package/dist/{ServingSequence-yaPOAqwr.js → ServingSequence-ByNsE8ha.js} +3 -3
- package/dist/{Setting-DCpmd6aM.js → Setting-widqJGfT.js} +5 -5
- package/dist/Subcategory-DXaz2g4-.js +345 -0
- package/dist/{Takeaway-B8yW3jnm.js → Takeaway-Ce_y1_UW.js} +1 -1
- package/dist/{Takeaway-fjsxTI9x.js → Takeaway-DVBJn6re.js} +4 -4
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-DK2Cp2Dg.js +316 -0
- package/dist/{Thumbnail.vue_vue_type_script_setup_true_lang-c0N8J2_E.js → Thumbnail.vue_vue_type_script_setup_true_lang-CAiNaQMP.js} +4 -4
- package/dist/TranslationSideSheet.vue_vue_type_script_setup_true_lang-BPs9D7Pq.js +185 -0
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-nFLEeipN.js +6120 -0
- package/dist/{Unit-CB7huz6v.js → Unit-XJLHLSYf.js} +2 -2
- package/dist/Variant-BA1AQl9-.js +247 -0
- package/dist/{_id_-C6pbjMX7.js → _id_-CA2rV7Eb.js} +9 -9
- package/dist/app-C9zsFCoJ.js +363 -0
- package/dist/{app-C2AxZIV0.js → app-D2Sxejos.js} +1 -1
- package/dist/app.js +1 -1
- package/dist/apps/mf-menu/src/app.d.ts +264 -0
- package/dist/apps/mf-menu/src/components/ProductTranslationDialog.vue.d.ts +41 -0
- package/dist/apps/mf-menu/src/components/TranslationBadge.vue.d.ts +29 -0
- package/dist/apps/mf-menu/src/components/TranslationFieldSection.vue.d.ts +39 -0
- package/dist/apps/mf-menu/src/components/TranslationSideSheet.vue.d.ts +23 -0
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/ApplyProduct.vue.d.ts +12 -0
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/ApplyProductDialog.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/feature/ApplyProduct/index.d.ts +54 -0
- package/dist/apps/mf-menu/src/components/feature/CategoryManager/Form.vue.d.ts +1 -0
- package/dist/apps/mf-menu/src/components/feature/Fields/ImageDropField.vue.d.ts +1 -0
- package/dist/apps/mf-menu/src/components/feature/GroupManager/OptionTable.vue.d.ts +16 -0
- package/dist/apps/mf-menu/src/components/feature/GroupManager/ProductOverrideTranslation.vue.d.ts +22 -0
- package/dist/apps/mf-menu/src/components/feature/GroupManager/UpdateForm.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierButton.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/components/feature/PriceTier/PriceTierForm.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/category.d.ts +8 -2
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/item.d.ts +24 -1
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/scheduler.d.ts +16 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/composable/useItemFormManagement.d.ts +10 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/OptionTable.vue.d.ts +16 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/UpdateForm.vue.d.ts +6 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/form/GroupManager/index.d.ts +24 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/item/ItemForm.vue.d.ts +30 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/menuUtils.d.ts +10 -0
- package/dist/apps/mf-menu/src/components/feature/TreeEditor/store/menuV2.d.ts +125 -1
- package/dist/apps/mf-menu/src/components/feature/VariantManager/ProductVariantTranslation.vue.d.ts +37 -0
- package/dist/apps/mf-menu/src/components/import/PreviewAddonContent.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/composable/linkProducts.d.ts +16 -0
- package/dist/apps/mf-menu/src/helper/item.d.ts +1 -0
- package/dist/apps/mf-menu/src/helper/itemCategories.d.ts +10 -0
- package/dist/apps/mf-menu/src/helper/menu.d.ts +11 -0
- package/dist/apps/mf-menu/src/helper/menuImport.d.ts +125 -1
- package/dist/apps/mf-menu/src/helper/menuSanitizer.d.ts +125 -1
- package/dist/apps/mf-menu/src/manager/menu/category.d.ts +8 -2
- package/dist/apps/mf-menu/src/manager/menu/group.d.ts +1 -0
- package/dist/apps/mf-menu/src/manager/menu/item.d.ts +125 -1
- package/dist/apps/mf-menu/src/manager/menu/subcategory.d.ts +6 -0
- package/dist/apps/mf-menu/src/stores/manager/item.d.ts +31 -1
- package/dist/apps/mf-menu/src/stores/manager/scheduler.d.ts +16 -0
- package/dist/apps/mf-menu/src/stores/manager/takeaway.d.ts +9 -0
- package/dist/apps/mf-menu/src/stores/menu.d.ts +125 -1
- package/dist/apps/mf-menu/src/utils/translation.d.ts +2 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddCategoryDialogContentComponent.vue.d.ts +1 -0
- package/dist/apps/mf-menu/src/views/Catalog/Edit/AddProductPopup/Form.vue.d.ts +20 -0
- package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +46 -0
- package/dist/apps/mf-menu/src/views/Scheduler/FilterForm.vue.d.ts +10 -0
- package/dist/apps/mf-menu/src/views/Scheduler/SchedulerDialog.vue.d.ts +10 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/linked-status-BrleJSCp.js +13 -0
- package/dist/assets/menu-export-Da3-wtnw.js +107 -0
- package/dist/assets/override-menu-ChjeVe4O.js +13 -0
- package/dist/assets/validate-menu-YVTxOfeq.js +13 -0
- package/dist/{catalog-CExooVeT.js → catalog-YvUT-JIh.js} +1 -1
- package/dist/{catalogSetting-DdEejp3Q.js → catalogSetting-CXOYJZO3.js} +1 -1
- package/dist/{currency-Prr2X-1u.js → currency-np4zdWW1.js} +1 -1
- package/dist/dayjs.min-CSuLNurY.js +6 -0
- package/dist/{index-D3Vh13iX.js → index-3wQe-6lg.js} +1 -1
- package/dist/index-CFbB7bM3.js +335 -0
- package/dist/index-Cek4Z9eM.js +539 -0
- package/dist/{index.vue_vue_type_script_setup_true_lang-BF1UnZ5l.js → index.vue_vue_type_script_setup_true_lang-HZXySVXs.js} +18035 -17833
- package/dist/item-DR9qrNf6.js +8117 -0
- package/dist/{jszip.min-BQ_xBh4o.js → jszip.min-Bz8ZTO2s.js} +2 -2
- package/dist/{menu-B0qJanmj.js → menu-BWsDRctK.js} +1 -1
- package/dist/{menuV2-DdCaRGqL.js → menuV2-CfsbyMis.js} +74 -74
- package/dist/mf-menu.css +1 -1
- package/dist/{priceTier-B-XJVQDe.js → priceTier-BNCJtFVM.js} +1 -1
- package/dist/rules-DU-MRKWH.js +212 -0
- package/dist/{scheduler-DyVdWsn7.js → scheduler-BizSj8q8.js} +4 -4
- package/dist/{toExcel-D0rRKbjh.js → toExcel-DhRigI9c.js} +2 -2
- package/dist/translation-BeqjfyEb.js +75 -0
- package/dist/{unit-DcHsbLOz.js → unit-CaOym7HP.js} +2 -2
- package/package.json +3 -3
- package/dist/Category-DJriqKNV.js +0 -392
- package/dist/Subcategory-Dsf5NLIa.js +0 -280
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-Bk2edy2M.js +0 -305
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CgF9dq-t.js +0 -6024
- package/dist/Variant-DSOF9uPl.js +0 -230
- package/dist/app-DPNctjt-.js +0 -363
- package/dist/assets/linked-status-DVG3fmWg.js +0 -13
- package/dist/assets/menu-export-CVc1O3S8.js +0 -107
- package/dist/assets/override-menu-ClMYkz3D.js +0 -13
- package/dist/assets/validate-menu-CWDyO0w0.js +0 -13
- package/dist/category-3SQRILcp.js +0 -156
- package/dist/dayjs.min-BOYFHQRS.js +0 -6
- package/dist/index-DBRFZboy.js +0 -273
- package/dist/index-TgR8MNiA.js +0 -239
- package/dist/item-C2wRl41j.js +0 -6950
- package/dist/rules-CIWTZQfh.js +0 -6
- package/dist/subcategory-DMfXewrZ.js +0 -148
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as h, A as n, M as d,
|
|
1
|
+
import { u as h, A as n, M as d, al as _ } from "./index.vue_vue_type_script_setup_true_lang-HZXySVXs.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-
|
|
1
|
+
import { A as u, I as i } from "./index.vue_vue_type_script_setup_true_lang-HZXySVXs.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,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-
|
|
4
|
+
import { d as X, _ as k } from "./RuleView.vue_vue_type_script_setup_true_lang-3AVOVYpW.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,335 @@
|
|
|
1
|
+
import { B as $, A as Y, u as Z, I as G, D as A, J as Q } from "./index.vue_vue_type_script_setup_true_lang-HZXySVXs.js";
|
|
2
|
+
import { defineComponent as R, ref as h, computed as _, watch as j, onMounted as X, onBeforeUnmount as ee, 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 M, createCommentVNode as ae, renderList as te, toDisplayString as O } from "vue";
|
|
3
|
+
import { useI18n as W } from "@feedmepos/mf-common";
|
|
4
|
+
import { components as le } from "@feedmepos/ui-library";
|
|
5
|
+
import { _ as ne } from "./RuleView.vue_vue_type_script_setup_true_lang-3AVOVYpW.js";
|
|
6
|
+
import { u as oe } from "./discardConfirm-BHni0LNu.js";
|
|
7
|
+
import { _ as ie } from "./ApplyProduct.vue_vue_type_script_setup_true_lang-CBy3XScH.js";
|
|
8
|
+
import { _ as re } from "./TranslationSideSheet.vue_vue_type_script_setup_true_lang-BPs9D7Pq.js";
|
|
9
|
+
import { c as ue } from "./check-C9mY6LiX.js";
|
|
10
|
+
import { f as se } from "./currency-np4zdWW1.js";
|
|
11
|
+
import { c as me } from "./string-DpfFixWH.js";
|
|
12
|
+
import { g as z } from "./translation-BeqjfyEb.js";
|
|
13
|
+
const de = /* @__PURE__ */ R({
|
|
14
|
+
__name: "CurrencyInput",
|
|
15
|
+
props: {
|
|
16
|
+
modelValue: {},
|
|
17
|
+
label: {},
|
|
18
|
+
placeholder: {},
|
|
19
|
+
nullable: { type: Boolean },
|
|
20
|
+
showCurrency: { type: Boolean },
|
|
21
|
+
min: {},
|
|
22
|
+
max: {},
|
|
23
|
+
required: { type: [Boolean, String] },
|
|
24
|
+
rules: {},
|
|
25
|
+
disable: { type: Boolean },
|
|
26
|
+
minLength: {},
|
|
27
|
+
maxLength: {},
|
|
28
|
+
inputmode: {},
|
|
29
|
+
type: {},
|
|
30
|
+
readonly: { type: Boolean },
|
|
31
|
+
labelMark: {},
|
|
32
|
+
prependIcon: {},
|
|
33
|
+
appendIcon: {},
|
|
34
|
+
showValidBorder: { type: Boolean },
|
|
35
|
+
labelInfo: {},
|
|
36
|
+
showWordCount: { type: Boolean },
|
|
37
|
+
invalid: { type: Boolean },
|
|
38
|
+
autofocus: { type: Boolean },
|
|
39
|
+
formatter: { type: Function },
|
|
40
|
+
decimal: {},
|
|
41
|
+
datalist: {},
|
|
42
|
+
shiftDatalist: { type: Boolean },
|
|
43
|
+
datalistMaxHeight: {},
|
|
44
|
+
datalistMinHeight: {},
|
|
45
|
+
offsetDatalist: {},
|
|
46
|
+
datalistPlacement: {},
|
|
47
|
+
datalistZIndex: {},
|
|
48
|
+
datalistWidth: {},
|
|
49
|
+
disabled: { type: Boolean },
|
|
50
|
+
focused: { type: Boolean },
|
|
51
|
+
helperText: {},
|
|
52
|
+
helperState: {}
|
|
53
|
+
},
|
|
54
|
+
emits: ["update:model-value"],
|
|
55
|
+
setup(B, { emit: g }) {
|
|
56
|
+
const l = B, { t: o } = W(), m = h(!1), E = h(!1), r = h(), U = _(() => l.modelValue ? (E.value && !m.value && (m.value = !0), $.Dinero.fromFdoDinero(l.modelValue).toUnit().toFixed(2)) : "");
|
|
57
|
+
j(
|
|
58
|
+
() => E.value,
|
|
59
|
+
(e) => {
|
|
60
|
+
var n, c, f, T, N;
|
|
61
|
+
e ? (c = (n = r.value) == null ? void 0 : n.inputEl) == null || c.select() : (m.value = !1, (f = r.value) != null && f.inputEl && s((N = (T = r.value) == null ? void 0 : T.inputEl) == null ? void 0 : N.value));
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
const S = g, u = _(() => typeof l.required == "string" ? l.required : o("menu.common.validation.field_required", {
|
|
65
|
+
field: l.label ?? o("menu.currency.input.field")
|
|
66
|
+
})), C = [
|
|
67
|
+
(e) => l.required ? !!e || u.value : !0,
|
|
68
|
+
(e) => l.min !== void 0 && e && parseFloat(e.toString()) < l.min ? o("menu.common.validation.min_value", { value: l.min }) : !0,
|
|
69
|
+
(e) => l.max !== void 0 && e && parseFloat(e.toString()) > l.max ? o("menu.common.validation.max_value", { value: l.max }) : !0,
|
|
70
|
+
...l.rules ?? []
|
|
71
|
+
];
|
|
72
|
+
function s(e) {
|
|
73
|
+
if (typeof e != "number" && !e && l.nullable)
|
|
74
|
+
S("update:model-value", void 0);
|
|
75
|
+
else {
|
|
76
|
+
if (typeof e == "string" && e === "-")
|
|
77
|
+
return;
|
|
78
|
+
let n = parseFloat((e || "").toString());
|
|
79
|
+
n = Number.isNaN(n) ? 0 : n, S("update:model-value", $.Dinero.fromNumber({ number: n }).toObject());
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const D = _(() => typeof l.min == "number" && l.min >= 0), F = (e) => {
|
|
83
|
+
var n, c, f;
|
|
84
|
+
if (!(e.ctrlKey || e.metaKey)) {
|
|
85
|
+
if (e.key === "Enter") {
|
|
86
|
+
(n = r.value) != null && n.inputEl && s((f = (c = r.value) == null ? void 0 : c.inputEl) == null ? void 0 : f.value);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (e.key === "-" && D.value) {
|
|
90
|
+
e.preventDefault();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
e.key >= "0" && e.key <= "9" || e.key === "." || e.key === "," || e.key === "-" || e.key === "Backspace" || e.key === "ArrowLeft" || e.key === "ArrowRight" || e.key === "Tab" || e.preventDefault();
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
return X(() => {
|
|
97
|
+
var e;
|
|
98
|
+
r.value && ((e = r.value.inputEl) == null || e.addEventListener("keydown", F));
|
|
99
|
+
}), ee(() => {
|
|
100
|
+
var e;
|
|
101
|
+
r.value && ((e = r.value.inputEl) == null || e.removeEventListener("keydown", F));
|
|
102
|
+
}), (e, n) => {
|
|
103
|
+
const c = x("fm-text-field");
|
|
104
|
+
return L(), J(c, {
|
|
105
|
+
ref_key: "inputRef",
|
|
106
|
+
ref: r,
|
|
107
|
+
autofocus: l.autofocus,
|
|
108
|
+
disabled: l.disable,
|
|
109
|
+
label: e.label,
|
|
110
|
+
"model-value": U.value,
|
|
111
|
+
placeholder: l.placeholder,
|
|
112
|
+
"prepend-icon": e.showCurrency ? "attach_money" : void 0,
|
|
113
|
+
rules: C,
|
|
114
|
+
inputmode: "decimal",
|
|
115
|
+
onFocusChanged: n[0] || (n[0] = (f) => E.value = f),
|
|
116
|
+
onWheel: n[1] || (n[1] = q(() => {
|
|
117
|
+
}, ["prevent"])),
|
|
118
|
+
onTouchmove: n[2] || (n[2] = q(() => {
|
|
119
|
+
}, ["prevent"])),
|
|
120
|
+
onScroll: n[3] || (n[3] = q(() => {
|
|
121
|
+
}, ["prevent"]))
|
|
122
|
+
}, {
|
|
123
|
+
append: k(() => [
|
|
124
|
+
P(e.$slots, "append")
|
|
125
|
+
]),
|
|
126
|
+
_: 3
|
|
127
|
+
}, 8, ["autofocus", "disabled", "label", "model-value", "placeholder", "prepend-icon"]);
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
function xe(B) {
|
|
132
|
+
return B.map((g) => ({
|
|
133
|
+
module: Y.F_MENU_MODULE_V4_KEY.enum.item,
|
|
134
|
+
id: g._id,
|
|
135
|
+
discriminator: g.combinationKey,
|
|
136
|
+
data: void 0
|
|
137
|
+
}));
|
|
138
|
+
}
|
|
139
|
+
const pe = { class: "fm-typo-en-title-md-600" }, ce = { class: "space-y-32" }, fe = { class: "py-12 px-16 space-y-4" }, ve = { class: "flex gap-8 items-center justify-start" }, ye = /* @__PURE__ */ R({
|
|
140
|
+
__name: "Form",
|
|
141
|
+
props: {
|
|
142
|
+
action: {},
|
|
143
|
+
initialValue: {},
|
|
144
|
+
fallback: {},
|
|
145
|
+
applyProduct: { type: Boolean },
|
|
146
|
+
bindToVariant: { type: Boolean }
|
|
147
|
+
},
|
|
148
|
+
emits: ["update:takeaway"],
|
|
149
|
+
setup(B, { expose: g, emit: l }) {
|
|
150
|
+
const { t: o } = W(), m = B, E = l, r = Z(), U = _(() => r.rules.takeaway), S = h(!1), u = h(!1), C = h(!1), s = h(void 0), D = (a) => {
|
|
151
|
+
ue.isBoolean(a) ? u.value = a : u.value = !u.value;
|
|
152
|
+
};
|
|
153
|
+
function F() {
|
|
154
|
+
var t;
|
|
155
|
+
const a = {
|
|
156
|
+
...A.generator.initMenuV4Takeaway(),
|
|
157
|
+
usedBy: [],
|
|
158
|
+
...G(m.initialValue ?? {})
|
|
159
|
+
};
|
|
160
|
+
return (t = m.fallback) != null && t.price && (a.price = null), a;
|
|
161
|
+
}
|
|
162
|
+
const e = h(F()), n = _(() => m.action === "add" ? o("menu.takeaway.add") : o("menu.takeaway.update")), c = _(() => !!e.value.name), f = _(() => {
|
|
163
|
+
var V;
|
|
164
|
+
const a = [], t = "en-US", w = (V = s.value) == null ? void 0 : V[t];
|
|
165
|
+
return e.value.name && !w && a.push({
|
|
166
|
+
locale: t,
|
|
167
|
+
name: e.value.name,
|
|
168
|
+
localeDisplay: z(t)
|
|
169
|
+
}), s.value && Object.entries(s.value).filter(([d, y]) => y && y.trim()).sort(([d], [y]) => d.localeCompare(y)).forEach(([d, y]) => {
|
|
170
|
+
a.push({
|
|
171
|
+
locale: d,
|
|
172
|
+
name: y,
|
|
173
|
+
localeDisplay: z(d)
|
|
174
|
+
});
|
|
175
|
+
}), a;
|
|
176
|
+
});
|
|
177
|
+
function T(a) {
|
|
178
|
+
s.value = a;
|
|
179
|
+
}
|
|
180
|
+
const N = oe(
|
|
181
|
+
() => {
|
|
182
|
+
var d;
|
|
183
|
+
const a = !Q.isEqual(
|
|
184
|
+
e.value,
|
|
185
|
+
m.initialValue || {
|
|
186
|
+
...A.generator.initMenuV4Takeaway(),
|
|
187
|
+
usedBy: []
|
|
188
|
+
}
|
|
189
|
+
), t = ((d = m.initialValue) == null ? void 0 : d.name_locale) || {}, w = s.value || {}, V = JSON.stringify(t) !== JSON.stringify(w);
|
|
190
|
+
return a || V;
|
|
191
|
+
},
|
|
192
|
+
() => u.value = !1
|
|
193
|
+
);
|
|
194
|
+
function H() {
|
|
195
|
+
E("update:takeaway", {
|
|
196
|
+
...e.value,
|
|
197
|
+
...s.value && { name_locale: s.value }
|
|
198
|
+
}), D(!1);
|
|
199
|
+
}
|
|
200
|
+
return j(
|
|
201
|
+
() => u.value,
|
|
202
|
+
() => {
|
|
203
|
+
var a;
|
|
204
|
+
u.value && (e.value = F(), s.value = (a = m.initialValue) == null ? void 0 : a.name_locale);
|
|
205
|
+
}
|
|
206
|
+
), g({
|
|
207
|
+
trigger: D,
|
|
208
|
+
show: u
|
|
209
|
+
}), (a, t) => {
|
|
210
|
+
const w = x("fm-button"), V = x("FmTooltip"), d = x("fm-text-field"), y = x("fm-side-sheet");
|
|
211
|
+
return L(), I(K, null, [
|
|
212
|
+
P(a.$slots, "default", { trigger: D }),
|
|
213
|
+
v(y, {
|
|
214
|
+
id: "group-form",
|
|
215
|
+
modelValue: u.value,
|
|
216
|
+
"onUpdate:modelValue": t[5] || (t[5] = (b) => u.value = b),
|
|
217
|
+
"is-container": i(le).FmForm,
|
|
218
|
+
"is-container-props": {
|
|
219
|
+
onValidationSuccess: H,
|
|
220
|
+
blameFormChildOnValidationFailed: !0
|
|
221
|
+
},
|
|
222
|
+
"max-width": 560,
|
|
223
|
+
"onOn:clickedAway": i(N)
|
|
224
|
+
}, {
|
|
225
|
+
"side-sheet-header": k(() => [
|
|
226
|
+
M("p", pe, O(n.value), 1)
|
|
227
|
+
]),
|
|
228
|
+
"side-sheet-footer": k(() => [
|
|
229
|
+
M("div", ve, [
|
|
230
|
+
v(w, {
|
|
231
|
+
label: i(me)(i(o)(`menu.common.actions.${a.action}`)),
|
|
232
|
+
loading: S.value,
|
|
233
|
+
size: "lg",
|
|
234
|
+
type: "submit",
|
|
235
|
+
variant: "primary"
|
|
236
|
+
}, null, 8, ["label", "loading"]),
|
|
237
|
+
v(w, {
|
|
238
|
+
label: i(o)("menu.common.actions.cancel"),
|
|
239
|
+
size: "lg",
|
|
240
|
+
variant: "tertiary",
|
|
241
|
+
onClick: t[4] || (t[4] = () => u.value = !1)
|
|
242
|
+
}, null, 8, ["label"])
|
|
243
|
+
])
|
|
244
|
+
]),
|
|
245
|
+
default: k(() => [
|
|
246
|
+
M("div", ce, [
|
|
247
|
+
v(ne, null, {
|
|
248
|
+
default: k(() => {
|
|
249
|
+
var b;
|
|
250
|
+
return [
|
|
251
|
+
v(d, {
|
|
252
|
+
modelValue: e.value.name,
|
|
253
|
+
"onUpdate:modelValue": t[1] || (t[1] = (p) => e.value.name = p),
|
|
254
|
+
disabled: !U.value.name,
|
|
255
|
+
rules: [
|
|
256
|
+
(p) => !!p || i(o)("menu.common.validation.required", {
|
|
257
|
+
field: i(o)("menu.takeaway.columns.title").toLowerCase()
|
|
258
|
+
})
|
|
259
|
+
],
|
|
260
|
+
autofocus: "",
|
|
261
|
+
label: i(o)("menu.takeaway.columns.title"),
|
|
262
|
+
placeholder: i(o)("menu.takeaway.placeholders.title"),
|
|
263
|
+
required: "",
|
|
264
|
+
title: i(o)("menu.takeaway.columns.title")
|
|
265
|
+
}, {
|
|
266
|
+
append: k(() => [
|
|
267
|
+
v(V, {
|
|
268
|
+
variant: "plain",
|
|
269
|
+
placement: "top",
|
|
270
|
+
"z-index": 999
|
|
271
|
+
}, {
|
|
272
|
+
content: k(() => [
|
|
273
|
+
M("div", fe, [
|
|
274
|
+
(L(!0), I(K, null, te(f.value, (p) => (L(), I("div", {
|
|
275
|
+
key: p.locale
|
|
276
|
+
}, O(p.name) + " (" + O(p.localeDisplay) + ") ", 1))), 128))
|
|
277
|
+
])
|
|
278
|
+
]),
|
|
279
|
+
default: k(() => [
|
|
280
|
+
v(w, {
|
|
281
|
+
variant: "tertiary",
|
|
282
|
+
icon: "g_translate",
|
|
283
|
+
onClick: t[0] || (t[0] = (p) => C.value = !0),
|
|
284
|
+
disabled: !c.value
|
|
285
|
+
}, null, 8, ["disabled"])
|
|
286
|
+
]),
|
|
287
|
+
_: 1
|
|
288
|
+
})
|
|
289
|
+
]),
|
|
290
|
+
_: 1
|
|
291
|
+
}, 8, ["modelValue", "disabled", "rules", "label", "placeholder", "title"]),
|
|
292
|
+
v(de, {
|
|
293
|
+
modelValue: e.value.price,
|
|
294
|
+
"onUpdate:modelValue": t[2] || (t[2] = (p) => e.value.price = p),
|
|
295
|
+
min: 0,
|
|
296
|
+
nullable: !!a.fallback,
|
|
297
|
+
placeholder: (b = a.fallback) != null && b.price ? i(se)(a.fallback.price, !1) : void 0,
|
|
298
|
+
label: i(o)("menu.takeaway.columns.price"),
|
|
299
|
+
"show-currency": "",
|
|
300
|
+
title: i(o)("menu.takeaway.columns.price")
|
|
301
|
+
}, null, 8, ["modelValue", "nullable", "placeholder", "label", "title"])
|
|
302
|
+
];
|
|
303
|
+
}),
|
|
304
|
+
_: 1
|
|
305
|
+
}),
|
|
306
|
+
a.applyProduct ? (L(), J(ie, {
|
|
307
|
+
key: 0,
|
|
308
|
+
overrides: e.value.usedBy,
|
|
309
|
+
"onUpdate:overrides": t[3] || (t[3] = (b) => e.value.usedBy = b),
|
|
310
|
+
"select-variant": a.bindToVariant,
|
|
311
|
+
editable: "",
|
|
312
|
+
title: i(o)("menu.common.labels.product")
|
|
313
|
+
}, null, 8, ["overrides", "select-variant", "title"])) : ae("", !0)
|
|
314
|
+
])
|
|
315
|
+
]),
|
|
316
|
+
_: 1
|
|
317
|
+
}, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"]),
|
|
318
|
+
v(re, {
|
|
319
|
+
modelValue: C.value,
|
|
320
|
+
"onUpdate:modelValue": t[6] || (t[6] = (b) => C.value = b),
|
|
321
|
+
title: i(o)("menu.takeaway.title"),
|
|
322
|
+
name: e.value.name,
|
|
323
|
+
"name-locale": s.value,
|
|
324
|
+
"onUpdate:nameLocale": T
|
|
325
|
+
}, null, 8, ["modelValue", "title", "name", "name-locale"])
|
|
326
|
+
], 64);
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
}), Le = ye;
|
|
330
|
+
export {
|
|
331
|
+
Le as T,
|
|
332
|
+
de as _,
|
|
333
|
+
ye as a,
|
|
334
|
+
xe as l
|
|
335
|
+
};
|