@feedmepos/mf-menu 0.18.17 → 0.19.0-beta.2
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/ApplyProduct.vue_vue_type_script_setup_true_lang-DFJJHptK.js +158 -0
- package/dist/{ApplyProducts.vue_vue_type_script_setup_true_lang-BJ0b_uKf.js → ApplyProducts.vue_vue_type_script_setup_true_lang-CXoRwrTi.js} +2 -2
- package/dist/Catalog-CXzqtCF8.js +551 -0
- package/dist/Category-DKbtLbq8.js +387 -0
- package/dist/CookingGuide-BKon8TdH.js +862 -0
- package/dist/Group-D1UDksBG.js +46 -0
- package/dist/{Group-jEtbECLb.js → Group-izOWb_Bh.js} +1 -1
- package/dist/Group.vue_vue_type_script_setup_true_lang-DAlQcgYp.js +558 -0
- package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-Q7es2wmt.js +237 -0
- package/dist/{ImportProductDialog.vue_vue_type_script_setup_true_lang-Bw4uxqAp.js → ImportProductDialog.vue_vue_type_script_setup_true_lang-Db0uYw5O.js} +11723 -11723
- package/dist/Ingredient-BIJu9P_9.js +484 -0
- package/dist/LinkProductSideSheet-BNdFZThd.js +104 -0
- package/dist/PrintRoute--fYPFcy7.js +417 -0
- package/dist/{Product-Bnr9oFr2.js → Product-vLtISbkD.js} +1 -1
- package/dist/Product.vue_vue_type_script_setup_true_lang-BHCihe6o.js +826 -0
- package/dist/Products-JaCNtcHS.js +236 -0
- package/dist/Publish-jpmiyB-b.js +525 -0
- package/dist/Recipe-B6y-oLPG.js +320 -0
- package/dist/Scheduler-Dj1rlr-U.js +222 -0
- package/dist/SchedulerSelector.vue_vue_type_script_setup_true_lang-BVAkohGJ.js +48 -0
- package/dist/ServingSequence-BhIfCyXl.js +4 -0
- package/dist/{Setting-DN8TQdIR.js → Setting-B5R1JfaL.js} +1 -1
- package/dist/Setting.vue_vue_type_script_setup_true_lang-xXtg0JOn.js +253 -0
- package/dist/Takeaway-BSFSz_JL.js +63 -0
- package/dist/{Takeaway-y0Nk0JAb.js → Takeaway-DjFTtbw6.js} +1 -1
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-BUGL0wfZ.js +302 -0
- package/dist/TaxSetting-D9Q8XNgJ.js +25 -0
- package/dist/Unit-Cr_8O3zB.js +142 -0
- package/dist/Variant-loUMfNRB.js +222 -0
- package/dist/_id_-0w7KjYyQ.js +189 -0
- package/dist/{app-D7e31gIv.js → app-t9ONnc0s.js} +31701 -26207
- package/dist/app.js +7 -6
- package/dist/apps/mf-menu/src/app.d.ts +2784 -0
- package/dist/apps/mf-menu/src/components/feature/Fields/OrderFrom.vue.d.ts +2 -2
- package/dist/apps/mf-menu/src/components/feature/LinkProduct/LinkProductSideSheet.vue.d.ts +2 -2
- package/dist/apps/mf-menu/src/manager/menu/catalog.d.ts +1 -0
- package/dist/apps/mf-menu/src/stores/manager/item.d.ts +1 -1
- package/dist/apps/mf-menu/src/stores/menu.d.ts +16 -16
- package/dist/apps/mf-menu/src/views/Publish/UpdateCatalogDialog.vue.d.ts +12 -12
- package/dist/apps/mf-menu/src/views/Scheduler/FilterForm.vue.d.ts +4 -4
- package/dist/apps/mf-menu/src/views/Scheduler/SchedulerDialog.vue.d.ts +4 -4
- package/dist/apps/mf-menu/tsconfig.app.tsbuildinfo +1 -1
- package/dist/assets/{linked-status-D5tq3eE2.js → linked-status-DLL4aRiX.js} +8 -8
- package/dist/assets/{validate-menu-AcCpPyQZ.js → validate-menu-CoXc16jh.js} +8 -8
- package/dist/{catalog-Ck7lLTN2.js → catalog-4OmC0JA3.js} +66 -62
- package/dist/category-BE33DRqp.js +155 -0
- package/dist/{currency-CclA5a-2.js → currency-JHgYNbTQ.js} +1 -1
- package/dist/{index-DDd9B_ur.js → index-CE3zjhyh.js} +732 -740
- package/dist/index-pSg9p-28.js +238 -0
- package/dist/item-CEPx51U1.js +6371 -0
- package/dist/{lodash-BIQx_fko.js → lodash-VivR_BQ2.js} +1 -1
- package/dist/{menu-CYzbNubv.js → menu-ETQrtbbU.js} +1 -1
- package/dist/{object-DUtbNpoS.js → object-DEM5FMTB.js} +4 -4
- package/dist/scheduler-SRT_5Nio.js +491 -0
- package/dist/string-DpfFixWH.js +4 -0
- package/dist/style.css +1 -1
- package/dist/takeaway-RcvqKigG.js +267 -0
- package/dist/{toExcel-BXPcj8Gp.js → toExcel-BcgskY3F.js} +2 -2
- package/dist/unit-DLL7xIF1.js +350 -0
- package/package.json +4 -2
- package/dist/ApplyProduct.vue_vue_type_script_setup_true_lang-D9QsJ4vO.js +0 -155
- package/dist/Catalog-CZW54QJU.js +0 -570
- package/dist/Category-DvsP_L7d.js +0 -405
- package/dist/CookingGuide-DC3uXetk.js +0 -848
- package/dist/Group-DK5xqeYX.js +0 -44
- package/dist/Group.vue_vue_type_script_setup_true_lang-DGZ9hnPg.js +0 -538
- package/dist/GroupMarkupPriceDialog.vue_vue_type_script_setup_true_lang-BQXqlXw4.js +0 -234
- package/dist/Ingredient-354LLwdX.js +0 -498
- package/dist/LinkProductSideSheet-anxSsu0z.js +0 -102
- package/dist/PrintRoute-DrSvtNLX.js +0 -425
- package/dist/Product.vue_vue_type_script_setup_true_lang-bBY54Q_1.js +0 -815
- package/dist/Products-CZyueqSO.js +0 -234
- package/dist/Publish-kRM1UuPk.js +0 -518
- package/dist/Recipe-nKpLIJs8.js +0 -345
- package/dist/Scheduler-DmZ8atXG.js +0 -233
- package/dist/SchedulerSelector.vue_vue_type_script_setup_true_lang-CdsxA-p0.js +0 -48
- package/dist/ServingSequence-j00_ko5R.js +0 -4
- package/dist/Setting.vue_vue_type_script_setup_true_lang-Cx06MCJs.js +0 -247
- package/dist/Takeaway-BXZXCAaM.js +0 -61
- package/dist/Takeaway.vue_vue_type_script_setup_true_lang-9WVkdLZF.js +0 -316
- package/dist/TaxSetting-DdHx7ACN.js +0 -21
- package/dist/Unit-biPvleyL.js +0 -161
- package/dist/Variant-BP1IRNQx.js +0 -231
- package/dist/_id_-BiaNDI2N.js +0 -188
- package/dist/category-KiA5-36F.js +0 -154
- package/dist/index-BFeZlU8X.js +0 -232
- package/dist/item-Bcg7SiYv.js +0 -6325
- package/dist/scheduler-D1tgE0_9.js +0 -480
- package/dist/takeaway-BKsoD4EL.js +0 -264
- package/dist/unit-CswFvAyc.js +0 -346
|
@@ -1,498 +0,0 @@
|
|
|
1
|
-
import { defineComponent as oe, computed as p, ref as U, reactive as Fe, watch as Se, resolveComponent as s, openBlock as r, createElementBlock as _, Fragment as F, renderSlot as Ce, createVNode as l, unref as g, withCtx as b, createElementVNode as d, toDisplayString as $, createBlock as I, createCommentVNode as j, normalizeClass as H, createTextVNode as Ve, renderList as q, getCurrentInstance as Me, h as ee, withModifiers as ne } from "vue";
|
|
2
|
-
import { i as le, a as J, u as Q, d as we, m as z, k as ie, e as te, g as Ue, b as K, h as G, l as $e, _ as Ee, f as Ne } from "./app-D7e31gIv.js";
|
|
3
|
-
import { useSnackbar as W, components as se, useDialog as Ae, FmButtonVariant as re, useBreakpoints as Ie } from "@feedmepos/ui-library";
|
|
4
|
-
import "@feedmepos/mf-common";
|
|
5
|
-
import "vue-router";
|
|
6
|
-
import { defineStore as Oe } from "pinia";
|
|
7
|
-
import { u as Re } from "./unit-CswFvAyc.js";
|
|
8
|
-
import { _ as ae, j as Te } from "./index-DDd9B_ur.js";
|
|
9
|
-
import { u as Be, l as De } from "./lodash-BIQx_fko.js";
|
|
10
|
-
const Pe = { class: "fm-typo-en-title-md-600" }, Le = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "pt-8 flex flex-col gap-8"
|
|
13
|
-
}, Ye = {
|
|
14
|
-
key: 1,
|
|
15
|
-
class: "pt-8 space-y-40"
|
|
16
|
-
}, ze = { class: "flex flex-row gap-16" }, je = { class: "overflow-x-hidden overflow-y-auto max-h-[300px]" }, qe = { class: "flex gap-8 items-center justify-start" }, Ke = /* @__PURE__ */ oe({
|
|
17
|
-
__name: "Form",
|
|
18
|
-
props: {
|
|
19
|
-
initialValue: { default: void 0 },
|
|
20
|
-
usedCodes: { default: () => [] },
|
|
21
|
-
invalidSkuAndRecipe: {}
|
|
22
|
-
},
|
|
23
|
-
setup(O, { expose: E }) {
|
|
24
|
-
const v = O, y = le(J(W())), k = Re(), S = p(() => v.initialValue ? "Update ingredient" : "Add ingredient"), h = p(() => v.initialValue ? "Update" : "Add"), C = U(!1), m = U(!1), V = (n) => {
|
|
25
|
-
Ue.isBoolean(n) ? m.value = n : m.value = !m.value;
|
|
26
|
-
}, N = Q(), a = p(() => N.units), o = p(() => a.value.map(({ name: n, _id: t, abbrev: f, measurements: A }) => ({
|
|
27
|
-
label: n,
|
|
28
|
-
value: t,
|
|
29
|
-
options: [
|
|
30
|
-
{
|
|
31
|
-
label: `${n} (${f})`,
|
|
32
|
-
value: null
|
|
33
|
-
},
|
|
34
|
-
...A.map(({ name: P, id: L, abbrev: Y }) => ({
|
|
35
|
-
label: `${P} (${Y})`,
|
|
36
|
-
value: L
|
|
37
|
-
}))
|
|
38
|
-
]
|
|
39
|
-
}))), i = p(() => a.value.length > 0), e = Fe(
|
|
40
|
-
v.initialValue ? we(v.initialValue) : {
|
|
41
|
-
...z.generator.initSku(),
|
|
42
|
-
unit: a.value[0] || z.generator.initUnit()
|
|
43
|
-
}
|
|
44
|
-
), x = U(!!e.convert), R = p(() => {
|
|
45
|
-
var t;
|
|
46
|
-
const n = o.value.find((f) => f.value === e.unit._id);
|
|
47
|
-
return ((t = ((n == null ? void 0 : n.options) || []).find((f) => f.value === (e.trackingMeasurement || null))) == null ? void 0 : t.label) || "";
|
|
48
|
-
}), T = (n) => e.unit._id === n.value && e.trackingMeasurement === (n.value || null);
|
|
49
|
-
function c(n, t) {
|
|
50
|
-
const f = t || void 0;
|
|
51
|
-
e.unit._id === n && e.trackingMeasurement === f || (e.unit = a.value.find((A) => A._id === n), e.trackingMeasurement = f, e.convert && (e.convert.measurement = f));
|
|
52
|
-
}
|
|
53
|
-
const ue = p(() => {
|
|
54
|
-
const n = o.value.find((t) => t.value === e.unit._id);
|
|
55
|
-
return ((n == null ? void 0 : n.options) || []).map((t) => ({
|
|
56
|
-
...t,
|
|
57
|
-
label: `1 ${t.label}`
|
|
58
|
-
}));
|
|
59
|
-
});
|
|
60
|
-
function de(n) {
|
|
61
|
-
var t;
|
|
62
|
-
x.value && (e.convert = {
|
|
63
|
-
...e.convert,
|
|
64
|
-
measurement: n || void 0,
|
|
65
|
-
inventoryBindings: ((t = e.convert) == null ? void 0 : t.inventoryBindings) || []
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
function X(n) {
|
|
69
|
-
x.value && (e.convert = {
|
|
70
|
-
...e.convert,
|
|
71
|
-
inventoryBindings: n
|
|
72
|
-
}), D.value = !1;
|
|
73
|
-
}
|
|
74
|
-
const ce = p(() => v.invalidSkuAndRecipe.skus), me = p(() => v.invalidSkuAndRecipe.recipes), D = U(!1);
|
|
75
|
-
function pe() {
|
|
76
|
-
var n;
|
|
77
|
-
return D.value = (((n = e.convert) == null ? void 0 : n.inventoryBindings) || []).length === 0, !D.value;
|
|
78
|
-
}
|
|
79
|
-
const ve = Be(
|
|
80
|
-
() => !De.isEqual(e, v.initialValue || z.generator.initSku()),
|
|
81
|
-
() => {
|
|
82
|
-
m.value = !1;
|
|
83
|
-
}
|
|
84
|
-
), fe = async () => {
|
|
85
|
-
try {
|
|
86
|
-
if (!(x.value ? pe() : !0)) return;
|
|
87
|
-
const t = {
|
|
88
|
-
...e,
|
|
89
|
-
convert: x.value ? e.convert : void 0
|
|
90
|
-
};
|
|
91
|
-
v.initialValue ? await y.updateMenu(
|
|
92
|
-
{
|
|
93
|
-
module: K.F_MENU_MODULE_V4_KEY.enum.sku,
|
|
94
|
-
operation: G.F_OPERATION_TYPE.update,
|
|
95
|
-
data: t
|
|
96
|
-
},
|
|
97
|
-
t.name
|
|
98
|
-
) : await y.updateMenu(
|
|
99
|
-
{
|
|
100
|
-
module: K.F_MENU_MODULE_V4_KEY.enum.sku,
|
|
101
|
-
operation: G.F_OPERATION_TYPE.create,
|
|
102
|
-
data: t
|
|
103
|
-
},
|
|
104
|
-
t.name
|
|
105
|
-
), V(!1);
|
|
106
|
-
} finally {
|
|
107
|
-
C.value = !1;
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
return Se(
|
|
111
|
-
() => m.value,
|
|
112
|
-
(n) => {
|
|
113
|
-
}
|
|
114
|
-
), E({
|
|
115
|
-
show: m,
|
|
116
|
-
trigger: V
|
|
117
|
-
}), (n, t) => {
|
|
118
|
-
const f = s("FmTextField"), A = s("FmLabel"), P = s("FmField"), L = s("FmMenuHeader"), Y = s("FmMenuDivider"), _e = s("FmMenuItem"), ge = s("FmMenu"), ye = s("FmFormGroup"), be = s("FmSwitch"), ke = s("FmSelect"), he = s("FmCard"), Z = s("fm-button"), xe = s("fm-side-sheet");
|
|
119
|
-
return r(), _(F, null, [
|
|
120
|
-
Ce(n.$slots, "default", { trigger: V }),
|
|
121
|
-
l(xe, {
|
|
122
|
-
id: "unit-form",
|
|
123
|
-
modelValue: m.value,
|
|
124
|
-
"onUpdate:modelValue": t[4] || (t[4] = (u) => m.value = u),
|
|
125
|
-
"is-container": g(se).FmForm,
|
|
126
|
-
"is-container-props": {
|
|
127
|
-
onValidationSuccess: fe,
|
|
128
|
-
blameFormChildOnValidationFailed: !0
|
|
129
|
-
},
|
|
130
|
-
"max-width": 560,
|
|
131
|
-
"z-index": 100,
|
|
132
|
-
"onOn:clickedAway": g(ve)
|
|
133
|
-
}, {
|
|
134
|
-
"side-sheet-header": b(() => [
|
|
135
|
-
d("p", Pe, $(S.value), 1)
|
|
136
|
-
]),
|
|
137
|
-
"side-sheet-footer": b(() => [
|
|
138
|
-
d("div", qe, [
|
|
139
|
-
l(Z, {
|
|
140
|
-
label: h.value,
|
|
141
|
-
loading: C.value,
|
|
142
|
-
size: "lg",
|
|
143
|
-
type: "submit",
|
|
144
|
-
variant: "primary"
|
|
145
|
-
}, null, 8, ["label", "loading"]),
|
|
146
|
-
l(Z, {
|
|
147
|
-
label: "Cancel",
|
|
148
|
-
size: "lg",
|
|
149
|
-
variant: "tertiary",
|
|
150
|
-
onClick: t[3] || (t[3] = () => m.value = !1)
|
|
151
|
-
})
|
|
152
|
-
])
|
|
153
|
-
]),
|
|
154
|
-
default: b(() => [
|
|
155
|
-
i.value ? (r(), _("div", Ye, [
|
|
156
|
-
d("div", ze, [
|
|
157
|
-
l(f, {
|
|
158
|
-
class: "flex-2",
|
|
159
|
-
label: "Code",
|
|
160
|
-
modelValue: e.code,
|
|
161
|
-
"onUpdate:modelValue": t[0] || (t[0] = (u) => e.code = u),
|
|
162
|
-
rules: [
|
|
163
|
-
(u) => !!u || "Code is required",
|
|
164
|
-
(u) => !n.usedCodes.includes(u.trim()) || "Code used by other ingredient"
|
|
165
|
-
]
|
|
166
|
-
}, null, 8, ["modelValue", "rules"]),
|
|
167
|
-
l(f, {
|
|
168
|
-
class: "flex-1",
|
|
169
|
-
label: "Name",
|
|
170
|
-
modelValue: e.name,
|
|
171
|
-
"onUpdate:modelValue": t[1] || (t[1] = (u) => e.name = u),
|
|
172
|
-
rules: [(u) => u ? !0 : "Ingredient name is required"]
|
|
173
|
-
}, null, 8, ["modelValue", "rules"])
|
|
174
|
-
]),
|
|
175
|
-
l(ye, {
|
|
176
|
-
class: "col-span-2",
|
|
177
|
-
"label-mark": "required",
|
|
178
|
-
"model-value": R.value
|
|
179
|
-
}, {
|
|
180
|
-
label: b(() => [
|
|
181
|
-
l(A, { label: "Unit" })
|
|
182
|
-
]),
|
|
183
|
-
default: b(({ invalid: u }) => [
|
|
184
|
-
l(ge, { "z-index": 101 }, {
|
|
185
|
-
"menu-button": b(() => [
|
|
186
|
-
l(P, {
|
|
187
|
-
class: H([
|
|
188
|
-
"fm-typo-en-body-lg-400",
|
|
189
|
-
{
|
|
190
|
-
"text-fm-color-typo-primary": !0
|
|
191
|
-
}
|
|
192
|
-
]),
|
|
193
|
-
invalid: u,
|
|
194
|
-
"append-icon": "expand_more"
|
|
195
|
-
}, {
|
|
196
|
-
default: b(() => [
|
|
197
|
-
Ve($(R.value), 1)
|
|
198
|
-
]),
|
|
199
|
-
_: 2
|
|
200
|
-
}, 1032, ["invalid"])
|
|
201
|
-
]),
|
|
202
|
-
default: b(() => [
|
|
203
|
-
d("div", je, [
|
|
204
|
-
(r(!0), _(F, null, q(o.value, (M, B) => (r(), _(F, { key: B }, [
|
|
205
|
-
l(L, {
|
|
206
|
-
label: M.label
|
|
207
|
-
}, null, 8, ["label"]),
|
|
208
|
-
l(Y),
|
|
209
|
-
(r(!0), _(F, null, q(M.options, (w, un) => (r(), I(_e, {
|
|
210
|
-
label: w.label,
|
|
211
|
-
"model-value": T(w),
|
|
212
|
-
onClick: (dn) => c(M.value, w.value),
|
|
213
|
-
"x-should-scroll-into": `${T(w)}`
|
|
214
|
-
}, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))), 256))
|
|
215
|
-
], 64))), 128))
|
|
216
|
-
])
|
|
217
|
-
]),
|
|
218
|
-
_: 2
|
|
219
|
-
}, 1024)
|
|
220
|
-
]),
|
|
221
|
-
_: 1
|
|
222
|
-
}, 8, ["model-value"]),
|
|
223
|
-
l(he, {
|
|
224
|
-
variant: "outlined",
|
|
225
|
-
class: "p-16 flex flex-col gap-16"
|
|
226
|
-
}, {
|
|
227
|
-
default: b(() => {
|
|
228
|
-
var u, M, B;
|
|
229
|
-
return [
|
|
230
|
-
l(be, {
|
|
231
|
-
value: "",
|
|
232
|
-
"model-value": x.value,
|
|
233
|
-
"onUpdate:modelValue": t[2] || (t[2] = (w) => x.value = w),
|
|
234
|
-
label: "Convertible",
|
|
235
|
-
sublabel: "Convertible from other recipe or ingredients",
|
|
236
|
-
labelPlacement: "right"
|
|
237
|
-
}, null, 8, ["model-value"]),
|
|
238
|
-
x.value ? (r(), _(F, { key: 0 }, [
|
|
239
|
-
d("div", null, [
|
|
240
|
-
l(ke, {
|
|
241
|
-
label: "Recipes and ingredients convert to",
|
|
242
|
-
modelValue: ((u = e.convert) == null ? void 0 : u.measurement) || null,
|
|
243
|
-
"onUpdate:modelValue": de,
|
|
244
|
-
items: ue.value
|
|
245
|
-
}, null, 8, ["modelValue", "items"])
|
|
246
|
-
]),
|
|
247
|
-
l(ae, {
|
|
248
|
-
"model-value": ((M = e.convert) == null ? void 0 : M.inventoryBindings) || [],
|
|
249
|
-
type: g(te.F_INVENTORY_BINDING_TYPE).enum.RECIPE,
|
|
250
|
-
"filter-option-ids": me.value,
|
|
251
|
-
"onUpdate:modelValue": X
|
|
252
|
-
}, null, 8, ["model-value", "type", "filter-option-ids"]),
|
|
253
|
-
l(ae, {
|
|
254
|
-
"model-value": ((B = e.convert) == null ? void 0 : B.inventoryBindings) || [],
|
|
255
|
-
type: g(te.F_INVENTORY_BINDING_TYPE).enum.SKU,
|
|
256
|
-
"filter-option-ids": ce.value,
|
|
257
|
-
"onUpdate:modelValue": X
|
|
258
|
-
}, null, 8, ["model-value", "type", "filter-option-ids"])
|
|
259
|
-
], 64)) : j("", !0)
|
|
260
|
-
];
|
|
261
|
-
}),
|
|
262
|
-
_: 1
|
|
263
|
-
})
|
|
264
|
-
])) : (r(), _("div", Le, [
|
|
265
|
-
a.value.length === 0 ? (r(), I(g(ie), {
|
|
266
|
-
key: 0,
|
|
267
|
-
action: {
|
|
268
|
-
text: "Add unit",
|
|
269
|
-
callback() {
|
|
270
|
-
g(k).createUnit();
|
|
271
|
-
}
|
|
272
|
-
},
|
|
273
|
-
subtitle: "Add a unit to start adding your ingredient.",
|
|
274
|
-
title: "No unit found"
|
|
275
|
-
}, null, 8, ["action"])) : j("", !0)
|
|
276
|
-
]))
|
|
277
|
-
]),
|
|
278
|
-
_: 1
|
|
279
|
-
}, 8, ["modelValue", "is-container", "is-container-props", "onOn:clickedAway"])
|
|
280
|
-
], 64);
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
}), Ge = Ke, He = Oe("sku-manager", () => {
|
|
284
|
-
const O = Ae(), E = W(), v = J(E), y = le(v), k = Q(), S = Me(), h = (a) => {
|
|
285
|
-
var i, e;
|
|
286
|
-
const { vNode: o } = $e(
|
|
287
|
-
Ge,
|
|
288
|
-
S,
|
|
289
|
-
a
|
|
290
|
-
);
|
|
291
|
-
(e = (i = o.component) == null ? void 0 : i.exposed) == null || e.trigger();
|
|
292
|
-
};
|
|
293
|
-
async function C(a) {
|
|
294
|
-
h({
|
|
295
|
-
initialValue: a,
|
|
296
|
-
usedCodes: k.skus.filter(({ _id: o }) => o !== (a == null ? void 0 : a._id)).map((o) => o.code),
|
|
297
|
-
invalidSkuAndRecipe: a ? Te.getInvalidSkuAndRecipe({
|
|
298
|
-
id: a._id,
|
|
299
|
-
skus: k.skus,
|
|
300
|
-
recipes: k.state.menu.modules.recipe
|
|
301
|
-
}) : { skus: [], recipes: [] }
|
|
302
|
-
});
|
|
303
|
-
}
|
|
304
|
-
async function m() {
|
|
305
|
-
C();
|
|
306
|
-
}
|
|
307
|
-
async function V(a) {
|
|
308
|
-
C(a);
|
|
309
|
-
}
|
|
310
|
-
async function N(a) {
|
|
311
|
-
O.open({
|
|
312
|
-
title: "Remove ingredient",
|
|
313
|
-
message: `Do you want to remove ingredient ${a.name}?`,
|
|
314
|
-
primaryActions: {
|
|
315
|
-
text: "Remove",
|
|
316
|
-
close: !0,
|
|
317
|
-
variant: re.Destructive
|
|
318
|
-
},
|
|
319
|
-
secondaryActions: {
|
|
320
|
-
text: "Cancel",
|
|
321
|
-
close: !0
|
|
322
|
-
}
|
|
323
|
-
}).onPrimary(async () => {
|
|
324
|
-
await y.updateMenu(
|
|
325
|
-
{
|
|
326
|
-
module: K.F_MENU_MODULE_V4_KEY.enum.sku,
|
|
327
|
-
operation: G.F_OPERATION_TYPE.delete,
|
|
328
|
-
data: a._id
|
|
329
|
-
},
|
|
330
|
-
a.name,
|
|
331
|
-
!0
|
|
332
|
-
);
|
|
333
|
-
});
|
|
334
|
-
}
|
|
335
|
-
return {
|
|
336
|
-
createSku: m,
|
|
337
|
-
updateSku: V,
|
|
338
|
-
deleteSku: N
|
|
339
|
-
};
|
|
340
|
-
}), Je = {
|
|
341
|
-
key: 0,
|
|
342
|
-
class: "h-[600px]"
|
|
343
|
-
}, Qe = { class: "flex justify-end items-center" }, We = { class: "flex items-center my-8 px-16" }, Xe = {
|
|
344
|
-
class: /* @__PURE__ */ H([
|
|
345
|
-
"flex-1",
|
|
346
|
-
"overflow-scroll",
|
|
347
|
-
"divide-y divide-fm-color-neutral-gray-100",
|
|
348
|
-
"pb-64"
|
|
349
|
-
])
|
|
350
|
-
}, Ze = ["onClick"], en = { class: "flex-1" }, nn = { class: "fm-typo-en-body-lg-600 mb-4" }, tn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, an = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, on = { class: "flex-1 flex justify-between gap-8 pl-8" }, ln = { class: "flex items-center" }, sn = { class: "bg-fm-color-neutral-gray-100 rounded-md px-8 py-4" }, rn = { class: "fm-typo-en-body-md-600 font-semibold" }, kn = /* @__PURE__ */ oe({
|
|
351
|
-
__name: "Ingredient",
|
|
352
|
-
setup(O) {
|
|
353
|
-
const E = W();
|
|
354
|
-
J(E);
|
|
355
|
-
const v = Q(), y = He(), k = p(() => v.skus), S = p(
|
|
356
|
-
() => k.value.filter((o) => `${o.name} ${o.code} ${o._unit} (${o._abbrev})`.toLowerCase().includes(h.value.toLowerCase()))
|
|
357
|
-
), h = U(""), C = U([
|
|
358
|
-
{
|
|
359
|
-
accessorKey: "code",
|
|
360
|
-
header: "Code",
|
|
361
|
-
enableSorting: !1
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
accessorKey: "name",
|
|
365
|
-
header: "Name",
|
|
366
|
-
enableSorting: !1
|
|
367
|
-
},
|
|
368
|
-
{
|
|
369
|
-
header: "Unit",
|
|
370
|
-
enableSorting: !1,
|
|
371
|
-
cell: (o) => {
|
|
372
|
-
const i = o.row.original;
|
|
373
|
-
return `${i._unit} (${i._abbrev})`;
|
|
374
|
-
}
|
|
375
|
-
},
|
|
376
|
-
{
|
|
377
|
-
id: "actions",
|
|
378
|
-
size: 52,
|
|
379
|
-
meta: {
|
|
380
|
-
cellClass: "pl-16",
|
|
381
|
-
headerContentClass: "-mx-16"
|
|
382
|
-
},
|
|
383
|
-
header: "",
|
|
384
|
-
cell: (o) => {
|
|
385
|
-
const i = o.row.original;
|
|
386
|
-
return ee(
|
|
387
|
-
"div",
|
|
388
|
-
{
|
|
389
|
-
class: "flex justify-end"
|
|
390
|
-
},
|
|
391
|
-
[
|
|
392
|
-
ee(se.FmButton, {
|
|
393
|
-
icon: "delete",
|
|
394
|
-
textColor: "neutral-gray-400",
|
|
395
|
-
variant: "tertiary",
|
|
396
|
-
onClick: ne(async () => {
|
|
397
|
-
y.deleteSku(i);
|
|
398
|
-
}, ["stop", "prevent"])
|
|
399
|
-
})
|
|
400
|
-
]
|
|
401
|
-
);
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
]);
|
|
405
|
-
function m(o) {
|
|
406
|
-
y.updateSku(o);
|
|
407
|
-
}
|
|
408
|
-
const V = p(() => k.value.length), N = Ie(), a = p(() => N.breakpoints.value.xs);
|
|
409
|
-
return (o, i) => {
|
|
410
|
-
const e = s("FmSearch"), x = s("FmTable"), R = s("fm-button"), T = s("FmSpacer");
|
|
411
|
-
return r(), I(Ee, { heading: "Ingredient" }, {
|
|
412
|
-
default: b(() => [
|
|
413
|
-
k.value.length === 0 ? (r(), I(g(ie), {
|
|
414
|
-
key: 0,
|
|
415
|
-
action: {
|
|
416
|
-
text: "Add ingredient",
|
|
417
|
-
callback() {
|
|
418
|
-
g(y).createSku();
|
|
419
|
-
}
|
|
420
|
-
},
|
|
421
|
-
subtitle: "Ingredients are crucial components in food and beverages. Managing them involves sourcing quality products, ensuring storage compliance, and maintaining safety standards, as they significantly impact flavor and quality.",
|
|
422
|
-
title: "Add your first ingredient"
|
|
423
|
-
}, null, 8, ["action"])) : (r(), _(F, { key: 1 }, [
|
|
424
|
-
a.value ? (r(), _(F, { key: 1 }, [
|
|
425
|
-
d("div", We, [
|
|
426
|
-
l(e, {
|
|
427
|
-
autofocus: "",
|
|
428
|
-
modelValue: h.value,
|
|
429
|
-
"onUpdate:modelValue": i[2] || (i[2] = (c) => h.value = c),
|
|
430
|
-
placeholder: "Search ingredients",
|
|
431
|
-
class: "w-full"
|
|
432
|
-
}, null, 8, ["modelValue"])
|
|
433
|
-
]),
|
|
434
|
-
d("div", Xe, [
|
|
435
|
-
(r(!0), _(F, null, q(S.value, (c) => (r(), _("div", {
|
|
436
|
-
key: c._id,
|
|
437
|
-
class: H(["py-12 px-16", "flex space-x-8", "items-center"]),
|
|
438
|
-
onClick: () => g(y).updateSku(c)
|
|
439
|
-
}, [
|
|
440
|
-
d("div", en, [
|
|
441
|
-
d("p", nn, $(c.name), 1),
|
|
442
|
-
d("p", tn, " Code: " + $(c.code), 1),
|
|
443
|
-
d("p", an, " Unit: " + $(`${c._unit} (${c._abbrev})`), 1)
|
|
444
|
-
]),
|
|
445
|
-
l(R, {
|
|
446
|
-
variant: g(re).Tertiary,
|
|
447
|
-
"prepend-icon": "delete",
|
|
448
|
-
"text-color": "neutral-gray-400",
|
|
449
|
-
onClick: ne(() => g(y).deleteSku(c), ["stop"])
|
|
450
|
-
}, null, 8, ["variant", "onClick"])
|
|
451
|
-
], 8, Ze))), 128))
|
|
452
|
-
])
|
|
453
|
-
], 64)) : (r(), _("div", Je, [
|
|
454
|
-
d("div", Qe, [
|
|
455
|
-
l(e, {
|
|
456
|
-
autofocus: "",
|
|
457
|
-
modelValue: h.value,
|
|
458
|
-
"onUpdate:modelValue": i[0] || (i[0] = (c) => h.value = c),
|
|
459
|
-
class: "mb-8 w-[320px]",
|
|
460
|
-
placeholder: "Search ingredients"
|
|
461
|
-
}, null, 8, ["modelValue"])
|
|
462
|
-
]),
|
|
463
|
-
l(x, {
|
|
464
|
-
"column-defs": C.value,
|
|
465
|
-
"row-data": S.value,
|
|
466
|
-
"page-size": S.value.length,
|
|
467
|
-
"shrink-at": !1,
|
|
468
|
-
"hide-footer": "",
|
|
469
|
-
"pin-header-row": "",
|
|
470
|
-
onRowClick: i[1] || (i[1] = (c) => m(c.original))
|
|
471
|
-
}, null, 8, ["column-defs", "row-data", "page-size"])
|
|
472
|
-
]))
|
|
473
|
-
], 64))
|
|
474
|
-
]),
|
|
475
|
-
"append-heading": b(() => [
|
|
476
|
-
d("div", on, [
|
|
477
|
-
d("div", ln, [
|
|
478
|
-
d("div", sn, [
|
|
479
|
-
d("p", rn, $(V.value), 1)
|
|
480
|
-
])
|
|
481
|
-
]),
|
|
482
|
-
l(T),
|
|
483
|
-
k.value.length > 0 ? (r(), I(Ne, {
|
|
484
|
-
key: 0,
|
|
485
|
-
label: "Add ingredient",
|
|
486
|
-
"prepend-icon": "add",
|
|
487
|
-
onClick: g(y).createSku
|
|
488
|
-
}, null, 8, ["onClick"])) : j("", !0)
|
|
489
|
-
])
|
|
490
|
-
]),
|
|
491
|
-
_: 1
|
|
492
|
-
});
|
|
493
|
-
};
|
|
494
|
-
}
|
|
495
|
-
});
|
|
496
|
-
export {
|
|
497
|
-
kn as default
|
|
498
|
-
};
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { defineComponent as B, ref as f, computed as z, watch as S, resolveComponent as v, openBlock as V, createElementBlock as F, Fragment as D, renderSlot as E, createVNode as n, unref as r, withCtx as u, createBlock as I, createCommentVNode as N, createElementVNode as h, toDisplayString as O } from "vue";
|
|
2
|
-
import { components as A, FmButtonVariant as L } from "@feedmepos/ui-library";
|
|
3
|
-
import { d as y, W as j, g as P, N as U } from "./app-D7e31gIv.js";
|
|
4
|
-
import "@feedmepos/mf-common";
|
|
5
|
-
import { u as $, l as q } from "./lodash-BIQx_fko.js";
|
|
6
|
-
/* empty css */
|
|
7
|
-
const x = { class: "fm-typo-en-title-md-600 mr-auto" }, M = { class: "flex gap-8 items-center justify-start" }, T = /* @__PURE__ */ B({
|
|
8
|
-
__name: "LinkProductSideSheet",
|
|
9
|
-
props: {
|
|
10
|
-
initialValue: { default: () => [] },
|
|
11
|
-
categorizedItems: { default: () => [] },
|
|
12
|
-
selectVariant: { type: Boolean, default: !1 },
|
|
13
|
-
showVariant: { type: Boolean, default: !1 },
|
|
14
|
-
title: { default: "Apply products" },
|
|
15
|
-
useCloseBtn: { type: Boolean }
|
|
16
|
-
},
|
|
17
|
-
emits: ["submit"],
|
|
18
|
-
setup(_, { emit: b }) {
|
|
19
|
-
const d = _, g = b, a = f(!1), c = (e) => {
|
|
20
|
-
P.isBoolean(e) ? a.value = e : a.value = !a.value;
|
|
21
|
-
};
|
|
22
|
-
function i(e) {
|
|
23
|
-
return e.reduce((t, o) => (t[o._id] = [...t[o._id] ?? [], o], t), {});
|
|
24
|
-
}
|
|
25
|
-
const m = d.initialValue, s = f(i(y(m))), p = z(() => Object.values(s.value).flatMap((e) => e)), C = $(
|
|
26
|
-
() => !q.isEqual(i(m), s.value),
|
|
27
|
-
() => {
|
|
28
|
-
a.value = !1;
|
|
29
|
-
}
|
|
30
|
-
);
|
|
31
|
-
function k() {
|
|
32
|
-
g("submit", p.value), a.value = !1;
|
|
33
|
-
}
|
|
34
|
-
return S(
|
|
35
|
-
() => a.value,
|
|
36
|
-
() => {
|
|
37
|
-
s.value = i(y(d.initialValue));
|
|
38
|
-
}
|
|
39
|
-
), (e, t) => {
|
|
40
|
-
const o = v("fm-button"), w = v("fm-side-sheet");
|
|
41
|
-
return V(), F(D, null, [
|
|
42
|
-
E(e.$slots, "default", { trigger: c }, void 0, !0),
|
|
43
|
-
n(w, {
|
|
44
|
-
id: "group-form",
|
|
45
|
-
modelValue: a.value,
|
|
46
|
-
"onUpdate:modelValue": t[2] || (t[2] = (l) => a.value = l),
|
|
47
|
-
"close-button": e.useCloseBtn,
|
|
48
|
-
"is-container": r(A).FmForm,
|
|
49
|
-
"is-container-props": {
|
|
50
|
-
onValidationSuccess: k,
|
|
51
|
-
blameFormChildOnValidationFailed: !0
|
|
52
|
-
},
|
|
53
|
-
"max-width": 560,
|
|
54
|
-
"z-index": 103,
|
|
55
|
-
"onOn:clickedAway": r(C)
|
|
56
|
-
}, {
|
|
57
|
-
"side-sheet-header": u(() => [
|
|
58
|
-
e.useCloseBtn ? N("", !0) : (V(), I(o, {
|
|
59
|
-
key: 0,
|
|
60
|
-
variant: r(L).Tertiary,
|
|
61
|
-
class: "cursor-pointer mr-4",
|
|
62
|
-
"prepend-icon": "arrow_back",
|
|
63
|
-
onClick: c
|
|
64
|
-
}, null, 8, ["variant"])),
|
|
65
|
-
h("p", x, O(e.title), 1)
|
|
66
|
-
]),
|
|
67
|
-
"side-sheet-footer": u(() => [
|
|
68
|
-
h("div", M, [
|
|
69
|
-
n(o, {
|
|
70
|
-
label: "Confirm",
|
|
71
|
-
size: "lg",
|
|
72
|
-
type: "submit",
|
|
73
|
-
variant: "primary"
|
|
74
|
-
}),
|
|
75
|
-
n(o, {
|
|
76
|
-
label: "Cancel",
|
|
77
|
-
size: "lg",
|
|
78
|
-
variant: "tertiary",
|
|
79
|
-
onClick: t[1] || (t[1] = () => a.value = !1)
|
|
80
|
-
})
|
|
81
|
-
])
|
|
82
|
-
]),
|
|
83
|
-
default: u(() => [
|
|
84
|
-
n(j, {
|
|
85
|
-
"auto-focus-search": !0,
|
|
86
|
-
"categorized-items": e.categorizedItems,
|
|
87
|
-
data: s.value,
|
|
88
|
-
"select-variant": e.selectVariant,
|
|
89
|
-
"selected-items": p.value,
|
|
90
|
-
"show-variant": e.showVariant,
|
|
91
|
-
"onUpdate:data": t[0] || (t[0] = (l) => s.value = l)
|
|
92
|
-
}, null, 8, ["categorized-items", "data", "select-variant", "selected-items", "show-variant"])
|
|
93
|
-
]),
|
|
94
|
-
_: 1
|
|
95
|
-
}, 8, ["modelValue", "close-button", "is-container", "is-container-props", "onOn:clickedAway"])
|
|
96
|
-
], 64);
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
}), R = /* @__PURE__ */ U(T, [["__scopeId", "data-v-bda46926"]]);
|
|
100
|
-
export {
|
|
101
|
-
R as L
|
|
102
|
-
};
|