@feedmepos/mf-menu 0.32.17 → 0.32.18-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-Cfl37TTw.js +152661 -0
- package/dist/{Catalog-ChlP8Cid.js → Catalog-Yxsb-D33.js} +47 -52
- package/dist/{Category-CHs96ibF.js → Category-0vJH8Ct0.js} +86 -92
- package/dist/{Category-B1tAJpNd.js → Category-qp0wI14I.js} +25 -26
- package/dist/{CookingGuide-mEvca-0v.js → CookingGuide-EpAr5F5U.js} +139 -143
- package/dist/{CustomAttributeChip.vue_vue_type_script_setup_true_lang-Bk26jQI7.js → CustomAttributeChip.vue_vue_type_script_setup_true_lang-CkyD0sdI.js} +14 -16
- package/dist/{Group-Ye2IIY52.js → Group-B3W9iSbO.js} +5 -5
- package/dist/{Group-Co2Vf4Lw.js → Group-DLCh0fDU.js} +1 -1
- package/dist/{Group.vue_vue_type_script_setup_true_lang-BcxSbvJS.js → Group.vue_vue_type_script_setup_true_lang-Bzy_hXDv.js} +176 -186
- package/dist/{GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-D1f8VG-n.js → GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BFaAXp7r.js} +81 -88
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Jv6iJlg9.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-CxP8lDD0.js} +2502 -2508
- package/dist/{Ingredient-BgnW8sWo.js → Ingredient-CVLMr_YB.js} +102 -105
- package/dist/{InventoryBinding.vue_vue_type_script_setup_true_lang-8ziHcUiK.js → InventoryBinding.vue_vue_type_script_setup_true_lang-CdTC5ykI.js} +1058 -1059
- package/dist/{MenuSetting-GEngjeC8.js → MenuSetting-Blpi1vSd.js} +58 -61
- package/dist/{PrintRoute-BSlUQT7g.js → PrintRoute-BS7PPPkE.js} +49 -52
- package/dist/{Product-DNg_BUuV.js → Product-DDeNKQ7u.js} +1 -1
- package/dist/{Product.vue_vue_type_script_setup_true_lang-Cehy2oy-.js → Product.vue_vue_type_script_setup_true_lang-rmv8m4_D.js} +286 -298
- package/dist/{ProductInternalTools-B5A67yxH.js → ProductInternalTools-CVuothk9.js} +45 -46
- package/dist/{Products-DCsxmTPB.js → Products-BIvsHKEt.js} +111 -116
- package/dist/{Publish-Cst0Ll6T.js → Publish-CDADU3Pp.js} +154 -159
- package/dist/{Recipe-DupS3SQT.js → Recipe-CMhW7e_z.js} +40 -43
- package/dist/{Scheduler-BcThU1M6.js → Scheduler-BpxunKBV.js} +7 -7
- package/dist/{ServingSequence-CT3THBH6.js → ServingSequence-BQVuYyAB.js} +54 -58
- package/dist/{Setting-Dxh8E3no.js → Setting-Dj0yyP37.js} +63 -66
- package/dist/{Subcategory-DhJEzofz.js → Subcategory-BH4DDZM4.js} +72 -76
- package/dist/{Takeaway-DSC7U4Jk.js → Takeaway-CGJBZ_sJ.js} +1 -1
- package/dist/{Takeaway-B8BSSKNj.js → Takeaway-DifOudVE.js} +20 -21
- package/dist/{Takeaway.vue_vue_type_script_setup_true_lang-BLpiJlk2.js → Takeaway.vue_vue_type_script_setup_true_lang-D-R5_S5G.js} +59 -64
- package/dist/{Unit-joU7vZZu.js → Unit-DXDox2Ut.js} +8 -8
- package/dist/{Variant-D8YjRJ6N.js → Variant-DbJVwgm5.js} +75 -78
- package/dist/{_id_-Bd9uo1WW.js → _id_-RFYwWjbM.js} +34 -38
- package/dist/{app-BNrAos5Z.js → app-Z0KWH9-d.js} +74 -335
- package/dist/app.js +4 -5
- package/dist/apps/mf-menu/src/app.d.ts +1 -2
- package/dist/apps/mf-menu/src/helper/import-export-utils.d.ts +1 -0
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-DbjzbFTw.js → linked-status-CkmoJAm-.js} +2 -2
- package/dist/assets/{menu-export-D_oNY_wi.js → menu-export-DcINiK28.js} +3 -3
- package/dist/assets/{override-menu-CIU7U1_4.js → override-menu-PUKiu-df.js} +2 -2
- package/dist/assets/{validate-menu-kuOxuwG9.js → validate-menu-CcqiRhNT.js} +2 -2
- package/dist/{catalogSetting-BHgsBDTl.js → catalogSetting-Bf66H-j7.js} +1 -1
- package/dist/dayjs.min-DNPTnUFp.js +6 -0
- package/dist/{jszip.min-7SsHzD5O.js → jszip.min-CO2_Gf69.js} +545 -545
- package/dist/{menu-Cd4NbFVq.js → menu-Brxar171.js} +1 -1
- package/dist/mf-menu.css +1 -1
- package/dist/{scheduler-B6OokVIA.js → scheduler-CqdIiE8G.js} +56 -60
- package/dist/{toExcel-BZkbXlHv.js → toExcel-CRJIU0NC.js} +2 -2
- package/dist/{unit-D6QOkMoM.js → unit-wYPYkm33.js} +98 -105
- package/package.json +1 -1
- package/dist/App-BiSEuDkd.js +0 -13484
- package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-C_SjdLpO.js +0 -161
- package/dist/FormItem.vue_vue_type_script_setup_true_lang-BmPAVphe.js +0 -26
- package/dist/LinkProductSideSheet-DFDYEUBh.js +0 -687
- package/dist/MenuSelector.vue_vue_type_script_setup_true_lang-K6Z0QJBl.js +0 -69
- package/dist/RuleView.vue_vue_type_script_setup_true_lang-BeesK2ym.js +0 -3285
- package/dist/TextChip.vue_vue_type_script_setup_true_lang-8frWuZFL.js +0 -20
- package/dist/Thumbnail.vue_vue_type_script_setup_true_lang-C3qXnZlz.js +0 -399
- package/dist/TreeEditorOpenner.vue_vue_type_script_setup_true_lang-CMe76XvZ.js +0 -6011
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +0 -9
- package/dist/app-5fxKLAzS.js +0 -8163
- package/dist/app-nTzkERJW.js +0 -68
- package/dist/catalog-BO2nXwe5.js +0 -199
- package/dist/category-CuG3DsGL.js +0 -156
- package/dist/check-C9mY6LiX.js +0 -9
- package/dist/createComponentProgrammatically-Bt2rn1IQ.js +0 -11
- package/dist/currency-DxC5zyZB.js +0 -7
- package/dist/dayjs.min-BvFUSPWD.js +0 -6
- package/dist/discardConfirm-BHni0LNu.js +0 -28
- package/dist/index-B0nhvuxR.js +0 -273
- package/dist/index-C2zPvt64.js +0 -239
- package/dist/index-C36JQix-.js +0 -246
- package/dist/index-CisutoS9.js +0 -156
- package/dist/index.vue_vue_type_script_setup_true_lang-DCBYExNb.js +0 -109064
- package/dist/item-K01xd1Z0.js +0 -6868
- package/dist/menuV2-DKE-xanq.js +0 -1052
- package/dist/object-DVUNCr7w.js +0 -16
- package/dist/priceTier-Beavb91W.js +0 -87
- package/dist/search-BAPEUu1R.js +0 -15
- package/dist/string-DpfFixWH.js +0 -4
- package/dist/subcategory-DnslmmRD.js +0 -148
- package/dist/tooltip-B5BiPMx9.js +0 -32
- package/dist/vuedraggable-CK8z7qA8.js +0 -1728
|
@@ -1,114 +1,111 @@
|
|
|
1
|
-
import { defineComponent as ie, computed as b, ref as $, reactive as Ve, watch as Ce, resolveComponent as d, createElementBlock as y, openBlock as m, Fragment as V, renderSlot as Me, createVNode as s, unref as e, withCtx as k, createBlock as
|
|
1
|
+
import { defineComponent as ie, computed as b, ref as $, reactive as Ve, watch as Ce, resolveComponent as d, createElementBlock as y, openBlock as m, Fragment as V, renderSlot as Me, createVNode as s, unref as e, withCtx as k, createBlock as B, createCommentVNode as j, createElementVNode as v, renderList as q, normalizeClass as J, createTextVNode as we, toDisplayString as U, getCurrentInstance as Ee, h as te, withModifiers as le } from "vue";
|
|
2
2
|
import { useI18n as Q } from "@feedmepos/mf-common";
|
|
3
3
|
import { useSnackbar as W, components as se, useDialog as $e, FmButtonVariant as ue, useBreakpoints as Ue } from "@feedmepos/ui-library";
|
|
4
4
|
import { _ as Ne } from "./ResponsiveFabButton.vue_vue_type_script_setup_true_lang-Cn-3MRBO.js";
|
|
5
|
-
import {
|
|
6
|
-
import { _ as
|
|
7
|
-
import { defineStore as
|
|
8
|
-
import { _ as ae, g as
|
|
9
|
-
import { u as
|
|
10
|
-
import { c as Pe } from "./check-C9mY6LiX.js";
|
|
11
|
-
import { u as Re } from "./unit-D6QOkMoM.js";
|
|
12
|
-
import { c as Ae } from "./createComponentProgrammatically-Bt2rn1IQ.js";
|
|
5
|
+
import { d as re, a as X, u as Z, c as Oe, l as K, F as Te, n as Be, _ as ce, j as oe, b as Ie, m as G, e as H, h as Le } from "./App-Cfl37TTw.js";
|
|
6
|
+
import { _ as Pe } from "./PageLayout.vue_vue_type_script_setup_true_lang-2f0QfweQ.js";
|
|
7
|
+
import { defineStore as Re } from "pinia";
|
|
8
|
+
import { _ as ae, g as De } from "./InventoryBinding.vue_vue_type_script_setup_true_lang-CdTC5ykI.js";
|
|
9
|
+
import { u as Ae } from "./unit-wYPYkm33.js";
|
|
13
10
|
const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
14
11
|
key: 0,
|
|
15
12
|
class: "pt-8 flex flex-col gap-8"
|
|
16
13
|
}, Ke = {
|
|
17
14
|
key: 1,
|
|
18
15
|
class: "pt-8 space-y-40"
|
|
19
|
-
},
|
|
16
|
+
}, je = { class: "flex flex-row gap-16" }, qe = { class: "overflow-x-hidden overflow-y-auto max-h-[300px]" }, Ge = { class: "flex gap-8 items-center justify-start" }, He = /* @__PURE__ */ ie({
|
|
20
17
|
__name: "Form",
|
|
21
18
|
props: {
|
|
22
19
|
initialValue: { default: void 0 },
|
|
23
20
|
usedCodes: { default: () => [] },
|
|
24
21
|
invalidSkuAndRecipe: {}
|
|
25
22
|
},
|
|
26
|
-
setup(
|
|
27
|
-
const { t:
|
|
28
|
-
() => r.initialValue ?
|
|
23
|
+
setup(I, { expose: N }) {
|
|
24
|
+
const { t: o } = Q(), r = I, u = re(X(W())), S = Ae(), h = b(() => r.initialValue ? o("menu.sku.update") : o("menu.sku.add")), x = b(
|
|
25
|
+
() => r.initialValue ? o("menu.common.actions.update") : o("menu.common.actions.add")
|
|
29
26
|
), C = $(!1), f = $(!1), M = (t) => {
|
|
30
|
-
|
|
31
|
-
},
|
|
27
|
+
Ie.isBoolean(t) ? f.value = t : f.value = !f.value;
|
|
28
|
+
}, O = Z(), a = b(() => O.units), i = b(() => a.value.map(({ name: t, _id: l, abbrev: g, measurements: T }) => ({
|
|
32
29
|
label: t,
|
|
33
|
-
value:
|
|
30
|
+
value: l,
|
|
34
31
|
options: [
|
|
35
32
|
{
|
|
36
33
|
label: `${t} (${g})`,
|
|
37
34
|
value: null
|
|
38
35
|
},
|
|
39
|
-
...
|
|
36
|
+
...T.map(({ name: A, id: Y, abbrev: z }) => ({
|
|
40
37
|
label: `${A} (${z})`,
|
|
41
38
|
value: Y
|
|
42
39
|
}))
|
|
43
40
|
]
|
|
44
41
|
}))), c = b(() => a.value.length > 0), n = Ve(
|
|
45
|
-
r.initialValue ?
|
|
42
|
+
r.initialValue ? Oe(r.initialValue) : {
|
|
46
43
|
...K.generator.initSku(),
|
|
47
44
|
unit: a.value[0] || K.generator.initUnit()
|
|
48
45
|
}
|
|
49
46
|
), F = $(!!n.convert), L = b(() => {
|
|
50
|
-
var
|
|
47
|
+
var l;
|
|
51
48
|
const t = i.value.find((g) => g.value === n.unit._id);
|
|
52
|
-
return ((
|
|
53
|
-
}),
|
|
54
|
-
function _(t,
|
|
55
|
-
const g =
|
|
56
|
-
n.unit._id === t && n.trackingMeasurement === g || (n.unit = a.value.find((
|
|
49
|
+
return ((l = ((t == null ? void 0 : t.options) || []).find((g) => g.value === (n.trackingMeasurement || null))) == null ? void 0 : l.label) || "";
|
|
50
|
+
}), P = (t) => n.unit._id === t.value && n.trackingMeasurement === (t.value || null);
|
|
51
|
+
function _(t, l) {
|
|
52
|
+
const g = l || void 0;
|
|
53
|
+
n.unit._id === t && n.trackingMeasurement === g || (n.unit = a.value.find((T) => T._id === t), n.trackingMeasurement = g, n.convert && (n.convert.measurement = g));
|
|
57
54
|
}
|
|
58
55
|
const de = b(() => {
|
|
59
|
-
const t = i.value.find((
|
|
60
|
-
return ((t == null ? void 0 : t.options) || []).map((
|
|
61
|
-
...
|
|
62
|
-
label: `1 ${
|
|
56
|
+
const t = i.value.find((l) => l.value === n.unit._id);
|
|
57
|
+
return ((t == null ? void 0 : t.options) || []).map((l) => ({
|
|
58
|
+
...l,
|
|
59
|
+
label: `1 ${l.label}`
|
|
63
60
|
}));
|
|
64
61
|
});
|
|
65
62
|
function me(t) {
|
|
66
|
-
var
|
|
63
|
+
var l;
|
|
67
64
|
F.value && (n.convert = {
|
|
68
65
|
...n.convert,
|
|
69
66
|
measurement: t || void 0,
|
|
70
|
-
inventoryBindings: ((
|
|
67
|
+
inventoryBindings: ((l = n.convert) == null ? void 0 : l.inventoryBindings) || []
|
|
71
68
|
});
|
|
72
69
|
}
|
|
73
70
|
function ee(t) {
|
|
74
71
|
F.value && (n.convert = {
|
|
75
72
|
...n.convert,
|
|
76
73
|
inventoryBindings: t
|
|
77
|
-
}),
|
|
74
|
+
}), D.value = !1;
|
|
78
75
|
}
|
|
79
76
|
const pe = b(() => r.invalidSkuAndRecipe.skus), ve = b(() => r.invalidSkuAndRecipe.recipes);
|
|
80
|
-
|
|
81
|
-
const
|
|
77
|
+
o("menu.sku.errors.select_recipe_ingredient");
|
|
78
|
+
const D = $(!1);
|
|
82
79
|
function _e() {
|
|
83
80
|
var t;
|
|
84
|
-
return
|
|
81
|
+
return D.value = (((t = n.convert) == null ? void 0 : t.inventoryBindings) || []).length === 0, !D.value;
|
|
85
82
|
}
|
|
86
|
-
const fe =
|
|
87
|
-
() => !
|
|
83
|
+
const fe = Te(
|
|
84
|
+
() => !Be.isEqual(n, r.initialValue || K.generator.initSku()),
|
|
88
85
|
() => {
|
|
89
86
|
f.value = !1;
|
|
90
87
|
}
|
|
91
88
|
), be = async () => {
|
|
92
89
|
try {
|
|
93
90
|
if (!(F.value ? _e() : !0)) return;
|
|
94
|
-
const
|
|
91
|
+
const l = {
|
|
95
92
|
...n,
|
|
96
93
|
convert: F.value ? n.convert : void 0
|
|
97
94
|
};
|
|
98
95
|
r.initialValue ? await u.updateMenu(
|
|
99
96
|
{
|
|
100
97
|
module: H.F_MENU_MODULE_V4_KEY.enum.sku,
|
|
101
|
-
operation:
|
|
102
|
-
data:
|
|
98
|
+
operation: G.F_OPERATION_TYPE.update,
|
|
99
|
+
data: l
|
|
103
100
|
},
|
|
104
|
-
|
|
101
|
+
l.name
|
|
105
102
|
) : await u.updateMenu(
|
|
106
103
|
{
|
|
107
104
|
module: H.F_MENU_MODULE_V4_KEY.enum.sku,
|
|
108
|
-
operation:
|
|
109
|
-
data:
|
|
105
|
+
operation: G.F_OPERATION_TYPE.create,
|
|
106
|
+
data: l
|
|
110
107
|
},
|
|
111
|
-
|
|
108
|
+
l.name
|
|
112
109
|
), M(!1);
|
|
113
110
|
} finally {
|
|
114
111
|
C.value = !1;
|
|
@@ -121,14 +118,14 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
121
118
|
), N({
|
|
122
119
|
show: f,
|
|
123
120
|
trigger: M
|
|
124
|
-
}), (t,
|
|
125
|
-
const g = d("FmTextField"),
|
|
121
|
+
}), (t, l) => {
|
|
122
|
+
const g = d("FmTextField"), T = d("FmLabel"), A = d("FmField"), Y = d("FmMenuHeader"), z = d("FmMenuDivider"), ge = d("FmMenuItem"), ye = d("FmMenu"), ke = d("FmFormGroup"), he = d("FmSwitch"), xe = d("FmSelect"), Fe = d("FmCard"), ne = d("fm-button"), Se = d("fm-side-sheet");
|
|
126
123
|
return m(), y(V, null, [
|
|
127
124
|
Me(t.$slots, "default", { trigger: M }),
|
|
128
125
|
s(Se, {
|
|
129
126
|
id: "unit-form",
|
|
130
127
|
modelValue: f.value,
|
|
131
|
-
"onUpdate:modelValue":
|
|
128
|
+
"onUpdate:modelValue": l[4] || (l[4] = (p) => f.value = p),
|
|
132
129
|
"is-container": e(se).FmForm,
|
|
133
130
|
"is-container-props": {
|
|
134
131
|
onValidationSuccess: be,
|
|
@@ -141,7 +138,7 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
141
138
|
v("p", Ye, U(h.value), 1)
|
|
142
139
|
]),
|
|
143
140
|
"side-sheet-footer": k(() => [
|
|
144
|
-
v("div",
|
|
141
|
+
v("div", Ge, [
|
|
145
142
|
s(ne, {
|
|
146
143
|
label: x.value,
|
|
147
144
|
loading: C.value,
|
|
@@ -150,36 +147,36 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
150
147
|
variant: "primary"
|
|
151
148
|
}, null, 8, ["label", "loading"]),
|
|
152
149
|
s(ne, {
|
|
153
|
-
label: e(
|
|
150
|
+
label: e(o)("menu.common.actions.cancel"),
|
|
154
151
|
size: "lg",
|
|
155
152
|
variant: "tertiary",
|
|
156
|
-
onClick:
|
|
153
|
+
onClick: l[3] || (l[3] = () => f.value = !1)
|
|
157
154
|
}, null, 8, ["label"])
|
|
158
155
|
])
|
|
159
156
|
]),
|
|
160
157
|
default: k(() => [
|
|
161
158
|
c.value ? (m(), y("div", Ke, [
|
|
162
|
-
v("div",
|
|
159
|
+
v("div", je, [
|
|
163
160
|
s(g, {
|
|
164
161
|
class: "flex-2",
|
|
165
|
-
label: e(
|
|
162
|
+
label: e(o)("menu.sku.columns.code"),
|
|
166
163
|
modelValue: n.code,
|
|
167
|
-
"onUpdate:modelValue":
|
|
164
|
+
"onUpdate:modelValue": l[0] || (l[0] = (p) => n.code = p),
|
|
168
165
|
rules: [
|
|
169
|
-
(p) => !!p || e(
|
|
170
|
-
field: e(
|
|
166
|
+
(p) => !!p || e(o)("menu.common.validation.required", {
|
|
167
|
+
field: e(o)("menu.sku.columns.code").toLowerCase()
|
|
171
168
|
}),
|
|
172
|
-
(p) => !t.usedCodes.includes(p.trim()) || e(
|
|
169
|
+
(p) => !t.usedCodes.includes(p.trim()) || e(o)("menu.sku.validation.code_used")
|
|
173
170
|
]
|
|
174
171
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
175
172
|
s(g, {
|
|
176
173
|
class: "flex-1",
|
|
177
|
-
label: e(
|
|
174
|
+
label: e(o)("menu.sku.columns.name"),
|
|
178
175
|
modelValue: n.name,
|
|
179
|
-
"onUpdate:modelValue":
|
|
176
|
+
"onUpdate:modelValue": l[1] || (l[1] = (p) => n.name = p),
|
|
180
177
|
rules: [
|
|
181
|
-
(p) => p ? !0 : e(
|
|
182
|
-
field: e(
|
|
178
|
+
(p) => p ? !0 : e(o)("menu.common.validation.required", {
|
|
179
|
+
field: e(o)("menu.sku.columns.name").toLowerCase()
|
|
183
180
|
})
|
|
184
181
|
]
|
|
185
182
|
}, null, 8, ["label", "modelValue", "rules"])
|
|
@@ -190,8 +187,8 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
190
187
|
"model-value": L.value
|
|
191
188
|
}, {
|
|
192
189
|
label: k(() => [
|
|
193
|
-
s(
|
|
194
|
-
label: e(
|
|
190
|
+
s(T, {
|
|
191
|
+
label: e(o)("menu.sku.columns.unit")
|
|
195
192
|
}, null, 8, ["label"])
|
|
196
193
|
]),
|
|
197
194
|
default: k(({ invalid: p }) => [
|
|
@@ -214,17 +211,17 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
214
211
|
}, 1032, ["invalid"])
|
|
215
212
|
]),
|
|
216
213
|
default: k(() => [
|
|
217
|
-
v("div",
|
|
218
|
-
(m(!0), y(V, null,
|
|
214
|
+
v("div", qe, [
|
|
215
|
+
(m(!0), y(V, null, q(i.value, (w, R) => (m(), y(V, { key: R }, [
|
|
219
216
|
s(Y, {
|
|
220
217
|
label: w.label
|
|
221
218
|
}, null, 8, ["label"]),
|
|
222
219
|
s(z),
|
|
223
|
-
(m(!0), y(V, null,
|
|
220
|
+
(m(!0), y(V, null, q(w.options, (E, dn) => (m(), B(ge, {
|
|
224
221
|
label: E.label,
|
|
225
|
-
"model-value":
|
|
222
|
+
"model-value": P(E),
|
|
226
223
|
onClick: (mn) => _(w.value, E.value),
|
|
227
|
-
"x-should-scroll-into": `${
|
|
224
|
+
"x-should-scroll-into": `${P(E)}`
|
|
228
225
|
}, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))), 256))
|
|
229
226
|
], 64))), 128))
|
|
230
227
|
])
|
|
@@ -239,20 +236,20 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
239
236
|
class: "p-16 flex flex-col gap-16"
|
|
240
237
|
}, {
|
|
241
238
|
default: k(() => {
|
|
242
|
-
var p, w,
|
|
239
|
+
var p, w, R;
|
|
243
240
|
return [
|
|
244
241
|
s(he, {
|
|
245
242
|
value: "",
|
|
246
243
|
"model-value": F.value,
|
|
247
|
-
"onUpdate:modelValue":
|
|
248
|
-
label: e(
|
|
249
|
-
sublabel: e(
|
|
244
|
+
"onUpdate:modelValue": l[2] || (l[2] = (E) => F.value = E),
|
|
245
|
+
label: e(o)("menu.sku.convertible.label"),
|
|
246
|
+
sublabel: e(o)("menu.sku.convertible.sublabel"),
|
|
250
247
|
labelPlacement: "right"
|
|
251
248
|
}, null, 8, ["model-value", "label", "sublabel"]),
|
|
252
249
|
F.value ? (m(), y(V, { key: 0 }, [
|
|
253
250
|
v("div", null, [
|
|
254
251
|
s(xe, {
|
|
255
|
-
label: e(
|
|
252
|
+
label: e(o)("menu.sku.convertible.convert_to"),
|
|
256
253
|
modelValue: ((p = n.convert) == null ? void 0 : p.measurement) || null,
|
|
257
254
|
"onUpdate:modelValue": me,
|
|
258
255
|
items: de.value
|
|
@@ -260,33 +257,33 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
260
257
|
]),
|
|
261
258
|
s(ae, {
|
|
262
259
|
"model-value": ((w = n.convert) == null ? void 0 : w.inventoryBindings) || [],
|
|
263
|
-
type: e(
|
|
260
|
+
type: e(oe.F_INVENTORY_BINDING_TYPE).enum.RECIPE,
|
|
264
261
|
"filter-option-ids": ve.value,
|
|
265
262
|
"onUpdate:modelValue": ee
|
|
266
263
|
}, null, 8, ["model-value", "type", "filter-option-ids"]),
|
|
267
264
|
s(ae, {
|
|
268
|
-
"model-value": ((
|
|
269
|
-
type: e(
|
|
265
|
+
"model-value": ((R = n.convert) == null ? void 0 : R.inventoryBindings) || [],
|
|
266
|
+
type: e(oe.F_INVENTORY_BINDING_TYPE).enum.SKU,
|
|
270
267
|
"filter-option-ids": pe.value,
|
|
271
268
|
"onUpdate:modelValue": ee
|
|
272
269
|
}, null, 8, ["model-value", "type", "filter-option-ids"])
|
|
273
|
-
], 64)) :
|
|
270
|
+
], 64)) : j("", !0)
|
|
274
271
|
];
|
|
275
272
|
}),
|
|
276
273
|
_: 1
|
|
277
274
|
})
|
|
278
275
|
])) : (m(), y("div", ze, [
|
|
279
|
-
a.value.length === 0 ? (m(),
|
|
276
|
+
a.value.length === 0 ? (m(), B(e(ce), {
|
|
280
277
|
key: 0,
|
|
281
278
|
action: {
|
|
282
|
-
text: e(
|
|
279
|
+
text: e(o)("menu.unit.add"),
|
|
283
280
|
callback() {
|
|
284
281
|
e(S).createUnit();
|
|
285
282
|
}
|
|
286
283
|
},
|
|
287
|
-
subtitle: e(
|
|
288
|
-
title: e(
|
|
289
|
-
}, null, 8, ["action", "subtitle", "title"])) :
|
|
284
|
+
subtitle: e(o)("menu.sku.empty.subtitle"),
|
|
285
|
+
title: e(o)("menu.sku.empty.no_unit")
|
|
286
|
+
}, null, 8, ["action", "subtitle", "title"])) : j("", !0)
|
|
290
287
|
]))
|
|
291
288
|
]),
|
|
292
289
|
_: 1
|
|
@@ -294,10 +291,10 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
294
291
|
], 64);
|
|
295
292
|
};
|
|
296
293
|
}
|
|
297
|
-
}), Je = He, Qe =
|
|
298
|
-
const
|
|
294
|
+
}), Je = He, Qe = Re("sku-manager", () => {
|
|
295
|
+
const I = $e(), N = W(), o = X(N), r = re(o), u = Z(), S = Ee(), { t: h } = Q(), x = (a) => {
|
|
299
296
|
var c, n;
|
|
300
|
-
const { vNode: i } =
|
|
297
|
+
const { vNode: i } = Le(
|
|
301
298
|
Je,
|
|
302
299
|
S,
|
|
303
300
|
a
|
|
@@ -308,7 +305,7 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
308
305
|
x({
|
|
309
306
|
initialValue: a,
|
|
310
307
|
usedCodes: u.skus.filter(({ _id: i }) => i !== (a == null ? void 0 : a._id)).map((i) => i.code),
|
|
311
|
-
invalidSkuAndRecipe: a ?
|
|
308
|
+
invalidSkuAndRecipe: a ? De({
|
|
312
309
|
id: a._id,
|
|
313
310
|
skus: u.skus,
|
|
314
311
|
recipes: u.state.menu.modules.recipe
|
|
@@ -321,8 +318,8 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
321
318
|
async function M(a) {
|
|
322
319
|
C(a);
|
|
323
320
|
}
|
|
324
|
-
async function
|
|
325
|
-
|
|
321
|
+
async function O(a) {
|
|
322
|
+
I.open({
|
|
326
323
|
title: h("menu.common.dialog.remove.ingredient.title"),
|
|
327
324
|
message: h("menu.common.dialog.remove.ingredient.message", { name: a.name }),
|
|
328
325
|
primaryActions: {
|
|
@@ -338,7 +335,7 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
338
335
|
await r.updateMenu(
|
|
339
336
|
{
|
|
340
337
|
module: H.F_MENU_MODULE_V4_KEY.enum.sku,
|
|
341
|
-
operation:
|
|
338
|
+
operation: G.F_OPERATION_TYPE.delete,
|
|
342
339
|
data: a._id
|
|
343
340
|
},
|
|
344
341
|
a.name,
|
|
@@ -349,7 +346,7 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
349
346
|
return {
|
|
350
347
|
createSku: f,
|
|
351
348
|
updateSku: M,
|
|
352
|
-
deleteSku:
|
|
349
|
+
deleteSku: O
|
|
353
350
|
};
|
|
354
351
|
}), We = {
|
|
355
352
|
key: 0,
|
|
@@ -362,9 +359,9 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
362
359
|
class: /* @__PURE__ */ J(["flex-1", "overflow-scroll", "divide-y divide-fm-color-neutral-gray-100", "pb-64"])
|
|
363
360
|
}, nn = ["onClick"], tn = {
|
|
364
361
|
class: "flex-1"
|
|
365
|
-
}, on = {
|
|
366
|
-
class: "fm-typo-en-body-lg-600 mb-4"
|
|
367
362
|
}, ln = {
|
|
363
|
+
class: "fm-typo-en-body-lg-600 mb-4"
|
|
364
|
+
}, on = {
|
|
368
365
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
369
366
|
}, an = {
|
|
370
367
|
class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
|
|
@@ -376,14 +373,14 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
376
373
|
class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4"
|
|
377
374
|
}, cn = {
|
|
378
375
|
class: "fm-typo-en-body-md-600 font-semibold"
|
|
379
|
-
},
|
|
376
|
+
}, xn = /* @__PURE__ */ ie({
|
|
380
377
|
__name: "Ingredient",
|
|
381
|
-
setup(
|
|
378
|
+
setup(I) {
|
|
382
379
|
const N = W();
|
|
383
380
|
X(N);
|
|
384
|
-
const
|
|
381
|
+
const o = Z(), r = Qe(), {
|
|
385
382
|
t: u
|
|
386
|
-
} = Q(), S = b(() =>
|
|
383
|
+
} = Q(), S = b(() => o.skus), h = b(() => S.value.filter((i) => `${i.name} ${i.code} ${i._unit} (${i._abbrev})`.toLowerCase().includes(x.value.toLowerCase()))), x = $(""), C = $([{
|
|
387
384
|
accessorKey: "code",
|
|
388
385
|
header: () => u("menu.ingredient.table.columns.code"),
|
|
389
386
|
enableSorting: !1
|
|
@@ -415,7 +412,7 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
415
412
|
icon: "delete",
|
|
416
413
|
textColor: "neutral-gray-400",
|
|
417
414
|
variant: "tertiary",
|
|
418
|
-
onClick:
|
|
415
|
+
onClick: le(async () => {
|
|
419
416
|
r.deleteSku(c);
|
|
420
417
|
}, ["stop", "prevent"])
|
|
421
418
|
})]);
|
|
@@ -424,13 +421,13 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
424
421
|
function f(i) {
|
|
425
422
|
r.updateSku(i);
|
|
426
423
|
}
|
|
427
|
-
const M = b(() => S.value.length),
|
|
424
|
+
const M = b(() => S.value.length), O = Ue(), a = b(() => O.breakpoints.value.xs);
|
|
428
425
|
return (i, c) => {
|
|
429
|
-
const n = d("FmSearch"), F = d("FmTable"), L = d("fm-button"),
|
|
430
|
-
return m(),
|
|
426
|
+
const n = d("FmSearch"), F = d("FmTable"), L = d("fm-button"), P = d("FmSpacer");
|
|
427
|
+
return m(), B(Pe, {
|
|
431
428
|
heading: e(u)("menu.ingredient.title")
|
|
432
429
|
}, {
|
|
433
|
-
default: k(() => [S.value.length === 0 ? (m(),
|
|
430
|
+
default: k(() => [S.value.length === 0 ? (m(), B(e(ce), {
|
|
434
431
|
key: 0,
|
|
435
432
|
action: {
|
|
436
433
|
text: e(u)("menu.ingredient.empty.action"),
|
|
@@ -450,11 +447,11 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
450
447
|
"onUpdate:modelValue": c[2] || (c[2] = (_) => x.value = _),
|
|
451
448
|
placeholder: e(u)("menu.ingredient.table.search.placeholder"),
|
|
452
449
|
class: "w-full"
|
|
453
|
-
}, null, 8, ["modelValue", "placeholder"])]), v("div", en, [(m(!0), y(V, null,
|
|
450
|
+
}, null, 8, ["modelValue", "placeholder"])]), v("div", en, [(m(!0), y(V, null, q(h.value, (_) => (m(), y("div", {
|
|
454
451
|
key: _._id,
|
|
455
452
|
class: J(["py-12 px-16", "flex space-x-8", "items-center"]),
|
|
456
453
|
onClick: () => e(r).updateSku(_)
|
|
457
|
-
}, [v("div", tn, [v("p",
|
|
454
|
+
}, [v("div", tn, [v("p", ln, U(_.name), 1), v("p", on, U(e(u)("menu.ingredient.table.mobile.code", {
|
|
458
455
|
code: _.code
|
|
459
456
|
})), 1), v("p", an, U(e(u)("menu.ingredient.table.mobile.unit", {
|
|
460
457
|
unit: `${_._unit} (${_._abbrev})`
|
|
@@ -462,7 +459,7 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
462
459
|
variant: e(ue).Tertiary,
|
|
463
460
|
"prepend-icon": "delete",
|
|
464
461
|
"text-color": "neutral-gray-400",
|
|
465
|
-
onClick:
|
|
462
|
+
onClick: le(() => e(r).deleteSku(_), ["stop"])
|
|
466
463
|
}, null, 8, ["variant", "onClick"])], 8, nn))), 128))])], 64)) : (m(), y("div", We, [v("div", Xe, [s(n, {
|
|
467
464
|
autofocus: "",
|
|
468
465
|
modelValue: x.value,
|
|
@@ -478,17 +475,17 @@ const Ye = { class: "fm-typo-en-title-md-600" }, ze = {
|
|
|
478
475
|
"pin-header-row": "",
|
|
479
476
|
onRowClick: c[1] || (c[1] = (_) => f(_.original))
|
|
480
477
|
}, null, 8, ["column-defs", "row-data", "page-size"])]))], 64))]),
|
|
481
|
-
"append-heading": k(() => [v("div", sn, [v("div", un, [v("div", rn, [v("p", cn, U(M.value), 1)])]), s(
|
|
478
|
+
"append-heading": k(() => [v("div", sn, [v("div", un, [v("div", rn, [v("p", cn, U(M.value), 1)])]), s(P), S.value.length > 0 ? (m(), B(Ne, {
|
|
482
479
|
key: 0,
|
|
483
480
|
label: e(u)("menu.ingredient.actions.add"),
|
|
484
481
|
"prepend-icon": "add",
|
|
485
482
|
onClick: e(r).createSku
|
|
486
|
-
}, null, 8, ["label", "onClick"])) :
|
|
483
|
+
}, null, 8, ["label", "onClick"])) : j("", !0)])]),
|
|
487
484
|
_: 1
|
|
488
485
|
}, 8, ["heading"]);
|
|
489
486
|
};
|
|
490
487
|
}
|
|
491
488
|
});
|
|
492
489
|
export {
|
|
493
|
-
|
|
490
|
+
xn as default
|
|
494
491
|
};
|