@feedmepos/mf-inventory-portal 0.0.17-dev.9 → 0.0.18-dev.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/ApprovalView-DyazMoIY.js +118 -0
- package/dist/{BindingsDialog-Dw_DCOTY.js → BindingsDialog-D-p9eOMP.js} +2 -2
- package/dist/{BindingsPicker-BRLTF4Qs.js → BindingsPicker-C_kuxqQI.js} +2 -2
- package/dist/BindingsTable-jgL5-FZc.js +147 -0
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DLc1nCIY.js +268 -0
- package/dist/{FmMultiselectDialog.vue_vue_type_script_setup_true_lang-YzVhmNJc.js → FmMultiselectDialog.vue_vue_type_script_setup_true_lang-D2Cg0s16.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Dv01gy7k.js → FmUnitInput.vue_vue_type_script_setup_true_lang-FMI-Bp6y.js} +12 -12
- package/dist/IngredientsView-DnIHe3Gj.js +1672 -0
- package/dist/{IntegrationView-Xnl758CS.js → IntegrationView-CgYnK7JB.js} +260 -266
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CUj9Mnt6.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BObjqgU-.js} +6 -6
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CW0h41FP.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DClJGGeY.js} +1 -1
- package/dist/{PurchaseOrderPrintPreview-DzimxkGt.js → PurchaseOrderPrintPreview-Vbmche3y.js} +1 -1
- package/dist/ReceiveRequestView-CpRdJQuN.js +1394 -0
- package/dist/{RecipeView-B9NcEw7x.js → RecipeView-Do3LgdfI.js} +182 -190
- package/dist/StockView-C16AHdmT.js +1862 -0
- package/dist/SupplierView-DGQXU4Ha.js +796 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BSwsz8Xt.js → TransferDetails.vue_vue_type_script_setup_true_lang-DK5gzjwS.js} +21 -20
- package/dist/{UnitView-BvbaRHxG.js → UnitView-AfEMV9Qr.js} +129 -133
- package/dist/{WarehouseView-Cf5Bmfhn.js → WarehouseView-Cph8wrcF.js} +260 -264
- package/dist/app-UpgZo4xX.js +66113 -0
- package/dist/app.js +1 -1
- package/dist/array-AvWd53LI.js +30 -0
- package/dist/components/FmInventoryTableToolbar.vue.d.ts +53 -0
- package/dist/date2-BfOl_Gio.js +95 -0
- package/dist/dayjs.min-r5rPIQFX.js +282 -0
- package/dist/{decimal-S-jYTEL5.js → decimal-CTa5OWKK.js} +1 -1
- package/dist/extensions/array.d.ts +1 -0
- package/dist/{fuzzy-DW00BX8H.js → fuzzy-0FMA9raY.js} +1 -1
- package/dist/{dayjs.min-M4PEyOKN.js → index-D9a9wXgJ.js} +3594 -3356
- package/dist/{layout-DACHKQ9G.js → layout-DxcK0DGS.js} +1 -1
- package/dist/number-BSqhQaRy.js +97 -0
- package/dist/{rules-ldw61cGA.js → rules-7WxBNkDE.js} +16 -15
- package/dist/stock-estimate-hfECAKZK.js +122 -0
- package/dist/{supplier-DjKC4TaM.js → supplier-Dg3f6Ybw.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-D1M09VoX.js → use-inventory-binding-dialog-NLy01qAo.js} +2 -2
- package/dist/views/ingredients/IngredientsView.vue.d.ts +1 -0
- package/dist/{xlsx-BcM9fWkc.js → xlsx-qSY56eID.js} +1 -1
- package/dist/{xlsx.util-BNXjhkYU.js → xlsx.util-DL8p0Kzi.js} +2 -2
- package/package.json +4 -4
- package/dist/ApprovalView-BJ_SGOrx.js +0 -134
- package/dist/BindingsTable-BMIkL0Bk.js +0 -121
- package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-D9Qp3jke.js +0 -97
- package/dist/IngredientsView-DYFkUsHx.js +0 -1802
- package/dist/ReceiveRequestView-C_0jK6GY.js +0 -1435
- package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-Dov3Uq2z.js +0 -64
- package/dist/StockView-JPw1K8aU.js +0 -1960
- package/dist/SupplierView-CiQLFWmQ.js +0 -804
- package/dist/app-BbXzmbBO.js +0 -42892
- package/dist/components/FmTableToolbar.vue.d.ts +0 -49
- package/dist/date2-DFqSdEvG.js +0 -189
- package/dist/init-date-range-B_ha80e0.js +0 -21
- package/dist/stock-estimate-DOP1qO5w.js +0 -145
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { u as P, c as
|
|
3
|
-
import { useDialog as
|
|
4
|
-
import { i as
|
|
5
|
-
import { F as h, D as
|
|
6
|
-
import { _ as
|
|
7
|
-
import { c as
|
|
8
|
-
import { a as
|
|
9
|
-
import { _ as
|
|
10
|
-
import { R as
|
|
11
|
-
import { _ as
|
|
1
|
+
import { defineComponent as z, ref as R, onMounted as ne, resolveComponent as E, openBlock as w, createElementBlock as A, Fragment as ae, createElementVNode as b, toDisplayString as se, createVNode as f, createCommentVNode as Y, computed as k, watch as le, createBlock as T, withCtx as $, unref as g, isRef as Q, normalizeStyle as ie, Teleport as re, normalizeProps as ce, guardReactiveProps as ue } from "vue";
|
|
2
|
+
import { u as P, c as j, S as de, b as W, f as me } from "./app-UpgZo4xX.js";
|
|
3
|
+
import { useDialog as pe, useSnackbar as te, useProxiedModel as X, useBreakpoints as fe } from "@feedmepos/ui-library";
|
|
4
|
+
import { i as ve, _ as _e } from "./is-linked-ingredient-error-C6AghEwR.js";
|
|
5
|
+
import { F as h, D as Z, R as L } from "./row-action.enum-BwQbURNh.js";
|
|
6
|
+
import { _ as oe, t as ye, d as ge } from "./xlsx.util-DL8p0Kzi.js";
|
|
7
|
+
import { c as be, _ as he, F as ee, u as we } from "./layout-DxcK0DGS.js";
|
|
8
|
+
import { a as H } from "./number-BSqhQaRy.js";
|
|
9
|
+
import { _ as Re, a as Ce } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DLc1nCIY.js";
|
|
10
|
+
import { R as xe, U as Ee } from "./rules-7WxBNkDE.js";
|
|
11
|
+
import { _ as Fe } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-BObjqgU-.js";
|
|
12
|
+
import { f as Se } from "./date2-BfOl_Gio.js";
|
|
12
13
|
const Ve = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "flex flex-col items-center w-full h-full gap-24"
|
|
15
|
-
},
|
|
16
|
+
}, ke = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1), De = { key: 1 }, Ae = /* @__PURE__ */ b("br", null, null, -1), $e = { key: 0 }, Pe = /* @__PURE__ */ b("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1), Ie = /* @__PURE__ */ z({
|
|
16
17
|
__name: "DeleteDialog",
|
|
17
18
|
props: {
|
|
18
19
|
type: {},
|
|
@@ -20,42 +21,42 @@ const Ve = {
|
|
|
20
21
|
message: {},
|
|
21
22
|
bindedItems: {}
|
|
22
23
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
|
|
24
|
+
setup(_) {
|
|
25
|
+
const d = _, v = R(d.bindedItems || []), n = R(!1);
|
|
26
|
+
ne(() => {
|
|
26
27
|
l();
|
|
27
28
|
});
|
|
28
29
|
async function l() {
|
|
29
30
|
var a, m;
|
|
30
|
-
!n.value && ((a =
|
|
31
|
+
!n.value && ((a = d.data) != null && a._id) && (n.value = !0, v.value = await P().getAffectedMenu((m = d.data) == null ? void 0 : m._id), n.value = !1);
|
|
31
32
|
}
|
|
32
33
|
return (a, m) => {
|
|
33
|
-
const i =
|
|
34
|
-
return w(), A(
|
|
35
|
-
|
|
34
|
+
const i = E("FmSpacer"), u = E("FmCircularProgress");
|
|
35
|
+
return w(), A(ae, null, [
|
|
36
|
+
b("p", null, se(a.message), 1),
|
|
36
37
|
n.value ? (w(), A("div", Ve, [
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
f(i),
|
|
39
|
+
b("div", null, [
|
|
40
|
+
f(u, { size: "xl" })
|
|
40
41
|
]),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
])) : (w(), A("div",
|
|
44
|
-
|
|
45
|
-
v.value.length > 0 ? (w(), A("div",
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
ke,
|
|
43
|
+
f(i)
|
|
44
|
+
])) : (w(), A("div", De, [
|
|
45
|
+
Ae,
|
|
46
|
+
v.value.length > 0 ? (w(), A("div", $e, [
|
|
47
|
+
Pe,
|
|
48
|
+
f(oe, {
|
|
48
49
|
name: "Menu",
|
|
49
50
|
bindings: v.value
|
|
50
51
|
}, null, 8, ["bindings"])
|
|
51
|
-
])) :
|
|
52
|
+
])) : Y("", !0)
|
|
52
53
|
]))
|
|
53
54
|
], 64);
|
|
54
55
|
};
|
|
55
56
|
}
|
|
56
57
|
});
|
|
57
|
-
function
|
|
58
|
-
const
|
|
58
|
+
function Te() {
|
|
59
|
+
const _ = pe(), d = te(), v = P(), n = R(!1), l = R();
|
|
59
60
|
function a() {
|
|
60
61
|
const t = {
|
|
61
62
|
recipe: {},
|
|
@@ -69,11 +70,11 @@ function Me() {
|
|
|
69
70
|
}
|
|
70
71
|
async function m(t) {
|
|
71
72
|
const r = {
|
|
72
|
-
recipe:
|
|
73
|
+
recipe: j(t),
|
|
73
74
|
mode: h.UPDATE,
|
|
74
75
|
show: !0,
|
|
75
|
-
"onUpdate:show"(
|
|
76
|
-
l.value.show =
|
|
76
|
+
"onUpdate:show"(y) {
|
|
77
|
+
l.value.show = y;
|
|
77
78
|
}
|
|
78
79
|
};
|
|
79
80
|
l.value = r;
|
|
@@ -81,15 +82,15 @@ function Me() {
|
|
|
81
82
|
async function i(t) {
|
|
82
83
|
n.value = !0;
|
|
83
84
|
try {
|
|
84
|
-
await v.deleteRecipe(t),
|
|
85
|
+
await v.deleteRecipe(t), d.open({
|
|
85
86
|
title: "Success",
|
|
86
87
|
message: `Deleted ${t.name}`,
|
|
87
88
|
type: "success"
|
|
88
89
|
});
|
|
89
90
|
} catch (r) {
|
|
90
|
-
r instanceof
|
|
91
|
+
r instanceof de && ve(r) ? _.open({
|
|
91
92
|
title: "Cannot delete recipe",
|
|
92
|
-
contentComponent:
|
|
93
|
+
contentComponent: _e,
|
|
93
94
|
contentComponentProps: {
|
|
94
95
|
subject: (t == null ? void 0 : t.name) ?? "",
|
|
95
96
|
items: r.errorResponse.message
|
|
@@ -98,7 +99,7 @@ function Me() {
|
|
|
98
99
|
text: "Close",
|
|
99
100
|
close: !0
|
|
100
101
|
}
|
|
101
|
-
}) : console.log("unable to delete recipe", r),
|
|
102
|
+
}) : console.log("unable to delete recipe", r), d.open({
|
|
102
103
|
title: `Cannot delete ${t == null ? void 0 : t.name}`,
|
|
103
104
|
message: "Please try again.",
|
|
104
105
|
type: "error"
|
|
@@ -107,8 +108,8 @@ function Me() {
|
|
|
107
108
|
n.value = !1;
|
|
108
109
|
}
|
|
109
110
|
}
|
|
110
|
-
function
|
|
111
|
-
|
|
111
|
+
function u(t) {
|
|
112
|
+
_.open({
|
|
112
113
|
title: `Delete ${(t == null ? void 0 : t.name) ?? "recipe"}?`,
|
|
113
114
|
closeButton: !1,
|
|
114
115
|
primaryActions: {
|
|
@@ -120,7 +121,7 @@ function Me() {
|
|
|
120
121
|
text: "Cancel",
|
|
121
122
|
close: !0
|
|
122
123
|
},
|
|
123
|
-
contentComponent:
|
|
124
|
+
contentComponent: Ie,
|
|
124
125
|
contentComponentProps: {
|
|
125
126
|
type: "menu",
|
|
126
127
|
data: t,
|
|
@@ -131,23 +132,23 @@ function Me() {
|
|
|
131
132
|
return {
|
|
132
133
|
createRecipe: a,
|
|
133
134
|
updateRecipe: m,
|
|
134
|
-
deleteRecipe:
|
|
135
|
+
deleteRecipe: u,
|
|
135
136
|
recipeDialogProps: l,
|
|
136
137
|
recipeViewLoading: n
|
|
137
138
|
};
|
|
138
139
|
}
|
|
139
140
|
function Ue({
|
|
140
|
-
updateRecipe:
|
|
141
|
-
deleteRecipe:
|
|
141
|
+
updateRecipe: _,
|
|
142
|
+
deleteRecipe: d
|
|
142
143
|
}) {
|
|
143
144
|
async function v(a, m) {
|
|
144
|
-
const i =
|
|
145
|
-
if (a ===
|
|
146
|
-
await
|
|
145
|
+
const i = j(m);
|
|
146
|
+
if (a === L.Edit) {
|
|
147
|
+
await _(i);
|
|
147
148
|
return;
|
|
148
149
|
}
|
|
149
|
-
if (a ===
|
|
150
|
-
await
|
|
150
|
+
if (a === L.Delete) {
|
|
151
|
+
await d(i);
|
|
151
152
|
return;
|
|
152
153
|
}
|
|
153
154
|
}
|
|
@@ -166,8 +167,8 @@ function Ue({
|
|
|
166
167
|
id: "action",
|
|
167
168
|
header: "",
|
|
168
169
|
cell(a) {
|
|
169
|
-
return
|
|
170
|
-
[
|
|
170
|
+
return be(
|
|
171
|
+
[Z[L.Edit], Z[L.Delete]],
|
|
171
172
|
(m) => {
|
|
172
173
|
v(m, a.row.original.original);
|
|
173
174
|
}
|
|
@@ -185,23 +186,23 @@ function Ue({
|
|
|
185
186
|
const m = P();
|
|
186
187
|
return a.map((i) => ({
|
|
187
188
|
recipe: i.name,
|
|
188
|
-
ingredients: i.contains.map((
|
|
189
|
-
var r,
|
|
190
|
-
const t = m.skuById[
|
|
191
|
-
return t ? `${t.name} (${
|
|
192
|
-
}).filter((
|
|
189
|
+
ingredients: i.contains.map((u) => {
|
|
190
|
+
var r, y;
|
|
191
|
+
const t = m.skuById[u.id];
|
|
192
|
+
return t ? `${t.name} (${H(u.amount)}${((r = u.measurement) == null ? void 0 : r.abbrev) ?? ((y = t == null ? void 0 : t.unit) == null ? void 0 : y.abbrev)})` : null;
|
|
193
|
+
}).filter((u) => u).join(", "),
|
|
193
194
|
original: i
|
|
194
195
|
}));
|
|
195
196
|
}
|
|
196
197
|
return { columnDefs: n, formatRowData: l };
|
|
197
198
|
}
|
|
198
|
-
const
|
|
199
|
+
const Me = { class: "flex flex-col gap-40" }, Be = {
|
|
199
200
|
key: 0,
|
|
200
201
|
class: "col-span-2 mt-16 border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
|
|
201
|
-
},
|
|
202
|
+
}, Le = {
|
|
202
203
|
key: 0,
|
|
203
204
|
class: "flex flex-col items-center w-full h-full gap-24"
|
|
204
|
-
},
|
|
205
|
+
}, ze = /* @__PURE__ */ b("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1), Ne = { key: 1 }, Ye = /* @__PURE__ */ z({
|
|
205
206
|
__name: "RecipeForm",
|
|
206
207
|
props: {
|
|
207
208
|
mode: {},
|
|
@@ -209,9 +210,9 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
209
210
|
disabled: { type: Boolean }
|
|
210
211
|
},
|
|
211
212
|
emits: ["update:modelValue", "click:submit"],
|
|
212
|
-
setup(
|
|
213
|
-
var
|
|
214
|
-
const n =
|
|
213
|
+
setup(_, { expose: d, emit: v }) {
|
|
214
|
+
var F;
|
|
215
|
+
const n = _, l = v, a = k({
|
|
215
216
|
get() {
|
|
216
217
|
var e;
|
|
217
218
|
return ((e = n.modelValue) == null ? void 0 : e.name) ?? "";
|
|
@@ -233,101 +234,101 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
233
234
|
function i() {
|
|
234
235
|
l("click:submit");
|
|
235
236
|
}
|
|
236
|
-
const
|
|
237
|
-
|
|
237
|
+
const u = R();
|
|
238
|
+
d({
|
|
238
239
|
validateInputs: () => {
|
|
239
240
|
var e, o;
|
|
240
|
-
(o = (e =
|
|
241
|
+
(o = (e = u.value) == null ? void 0 : e.validateInputs) == null || o.call(e);
|
|
241
242
|
},
|
|
242
243
|
resetInputsValidation: () => {
|
|
243
244
|
var e, o;
|
|
244
|
-
(o = (e =
|
|
245
|
+
(o = (e = u.value) == null ? void 0 : e.resetInputsValidation) == null || o.call(e);
|
|
245
246
|
},
|
|
246
247
|
resetInputs: () => {
|
|
247
248
|
var e, o;
|
|
248
|
-
(o = (e =
|
|
249
|
+
(o = (e = u.value) == null ? void 0 : e.resetInputs) == null || o.call(e);
|
|
249
250
|
}
|
|
250
251
|
});
|
|
251
|
-
const t = P(), r = R([]),
|
|
252
|
-
|
|
252
|
+
const t = P(), r = R([]), y = R(!1), c = R(!1);
|
|
253
|
+
le(y, async (e) => {
|
|
253
254
|
C(e);
|
|
254
255
|
});
|
|
255
256
|
async function C(e) {
|
|
256
|
-
var o,
|
|
257
|
-
e && !c.value && ((o = n.modelValue) != null && o._id) && (c.value = !0, r.value = await t.getAffectedMenu((
|
|
257
|
+
var o, S;
|
|
258
|
+
e && !c.value && ((o = n.modelValue) != null && o._id) && (c.value = !0, r.value = await t.getAffectedMenu((S = n.modelValue) == null ? void 0 : S._id), c.value = !1);
|
|
258
259
|
}
|
|
259
260
|
const s = k(
|
|
260
261
|
() => t.recipes.map((e) => ({ label: e.name, value: e.name }))
|
|
261
|
-
),
|
|
262
|
+
), p = R((F = n.modelValue) == null ? void 0 : F.name);
|
|
262
263
|
return (e, o) => {
|
|
263
|
-
const
|
|
264
|
-
return w(), T(
|
|
264
|
+
const S = E("FmTextField"), N = E("FmCard"), D = E("FmSwitch"), V = E("FmSpacer"), U = E("FmCircularProgress"), M = E("FmForm");
|
|
265
|
+
return w(), T(M, {
|
|
265
266
|
ref_key: "formRef",
|
|
266
|
-
ref:
|
|
267
|
+
ref: u,
|
|
267
268
|
onValidationSuccess: i
|
|
268
269
|
}, {
|
|
269
270
|
default: $(() => [
|
|
270
|
-
|
|
271
|
-
|
|
271
|
+
b("div", Me, [
|
|
272
|
+
f(S, {
|
|
272
273
|
disabled: e.disabled,
|
|
273
274
|
label: "Name",
|
|
274
275
|
"model-value": a.value,
|
|
275
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
276
|
+
"onUpdate:modelValue": o[0] || (o[0] = (x) => a.value = x),
|
|
276
277
|
rules: [
|
|
277
|
-
|
|
278
|
-
|
|
278
|
+
g(xe)(),
|
|
279
|
+
g(Ee)(s.value, p.value, (x) => `[${x.value}] already exists`)
|
|
279
280
|
],
|
|
280
281
|
"label-mark": "required"
|
|
281
282
|
}, null, 8, ["disabled", "model-value", "rules"]),
|
|
282
|
-
|
|
283
|
+
f(N, {
|
|
283
284
|
variant: "outlined",
|
|
284
285
|
class: "p-16"
|
|
285
286
|
}, {
|
|
286
287
|
default: $(() => {
|
|
287
|
-
var
|
|
288
|
+
var x;
|
|
288
289
|
return [
|
|
289
|
-
|
|
290
|
-
id: (
|
|
290
|
+
f(Fe, {
|
|
291
|
+
id: (x = e.modelValue) == null ? void 0 : x._id,
|
|
291
292
|
disabled: e.disabled,
|
|
292
293
|
"model-value": m.value,
|
|
293
|
-
"onUpdate:modelValue": o[1] || (o[1] = (
|
|
294
|
+
"onUpdate:modelValue": o[1] || (o[1] = (I) => m.value = I)
|
|
294
295
|
}, null, 8, ["id", "disabled", "model-value"])
|
|
295
296
|
];
|
|
296
297
|
}),
|
|
297
298
|
_: 1
|
|
298
299
|
})
|
|
299
300
|
]),
|
|
300
|
-
e.mode !==
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
e.mode !== g(h).CREATE ? (w(), A("div", Be, [
|
|
302
|
+
b("div", null, [
|
|
303
|
+
f(D, {
|
|
303
304
|
label: "Show binded items",
|
|
304
|
-
modelValue:
|
|
305
|
-
"onUpdate:modelValue": o[2] || (o[2] = (
|
|
305
|
+
modelValue: y.value,
|
|
306
|
+
"onUpdate:modelValue": o[2] || (o[2] = (x) => y.value = x),
|
|
306
307
|
"label-placement": "right",
|
|
307
308
|
disabled: c.value
|
|
308
309
|
}, null, 8, ["modelValue", "disabled"])
|
|
309
310
|
]),
|
|
310
|
-
c.value ? (w(), A("div",
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
311
|
+
c.value ? (w(), A("div", Le, [
|
|
312
|
+
f(V),
|
|
313
|
+
b("div", null, [
|
|
314
|
+
f(U, { size: "xl" })
|
|
314
315
|
]),
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
])) : (w(), A("div",
|
|
318
|
-
|
|
316
|
+
ze,
|
|
317
|
+
f(V)
|
|
318
|
+
])) : (w(), A("div", Ne, [
|
|
319
|
+
y.value && r.value.length ? (w(), T(oe, {
|
|
319
320
|
key: 0,
|
|
320
321
|
name: "Menu",
|
|
321
322
|
bindings: r.value
|
|
322
|
-
}, null, 8, ["bindings"])) :
|
|
323
|
+
}, null, 8, ["bindings"])) : Y("", !0)
|
|
323
324
|
]))
|
|
324
|
-
])) :
|
|
325
|
+
])) : Y("", !0)
|
|
325
326
|
]),
|
|
326
327
|
_: 1
|
|
327
328
|
}, 512);
|
|
328
329
|
};
|
|
329
330
|
}
|
|
330
|
-
}),
|
|
331
|
+
}), He = { class: "flex gap-4" }, je = /* @__PURE__ */ z({
|
|
331
332
|
__name: "RecipeDialog",
|
|
332
333
|
props: {
|
|
333
334
|
show: { type: Boolean },
|
|
@@ -335,9 +336,9 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
335
336
|
mode: { default: h.READ }
|
|
336
337
|
},
|
|
337
338
|
emits: ["update:show"],
|
|
338
|
-
setup(
|
|
339
|
-
const
|
|
340
|
-
switch (
|
|
339
|
+
setup(_) {
|
|
340
|
+
const d = _, v = P(), n = te(), l = X(d, "show"), a = X(d, "recipe"), m = k(() => {
|
|
341
|
+
switch (d.mode) {
|
|
341
342
|
case h.READ:
|
|
342
343
|
return "View recipe";
|
|
343
344
|
case h.UPDATE:
|
|
@@ -347,7 +348,7 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
347
348
|
}
|
|
348
349
|
return "";
|
|
349
350
|
}), i = k(() => {
|
|
350
|
-
switch (
|
|
351
|
+
switch (d.mode) {
|
|
351
352
|
case h.READ:
|
|
352
353
|
return "";
|
|
353
354
|
case h.UPDATE:
|
|
@@ -356,18 +357,18 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
356
357
|
return "Add";
|
|
357
358
|
}
|
|
358
359
|
return "";
|
|
359
|
-
}),
|
|
360
|
+
}), u = R(), t = R(!1);
|
|
360
361
|
async function r() {
|
|
361
362
|
t.value = !0;
|
|
362
363
|
try {
|
|
363
|
-
const s =
|
|
364
|
+
const s = j(a.value);
|
|
364
365
|
s.precision ?? (s.precision = 0), s.measurements ?? (s.measurements = []), await v.createRecipe(s), l.value = !1, n.open({
|
|
365
366
|
title: "Success",
|
|
366
367
|
message: "Created " + a.value.name,
|
|
367
368
|
type: "success"
|
|
368
369
|
});
|
|
369
370
|
} catch (s) {
|
|
370
|
-
s instanceof
|
|
371
|
+
s instanceof W || n.open({
|
|
371
372
|
title: "Failed to create recipe",
|
|
372
373
|
message: "Please try again",
|
|
373
374
|
type: "error"
|
|
@@ -376,7 +377,7 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
376
377
|
t.value = !1;
|
|
377
378
|
}
|
|
378
379
|
}
|
|
379
|
-
async function
|
|
380
|
+
async function y() {
|
|
380
381
|
t.value = !0;
|
|
381
382
|
try {
|
|
382
383
|
await v.updateRecipe(a.value), l.value = !1, n.open({
|
|
@@ -385,7 +386,7 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
385
386
|
type: "success"
|
|
386
387
|
});
|
|
387
388
|
} catch (s) {
|
|
388
|
-
s instanceof
|
|
389
|
+
s instanceof W || n.open({
|
|
389
390
|
title: "Failed to update recipe",
|
|
390
391
|
message: "Please try again",
|
|
391
392
|
type: "error"
|
|
@@ -395,54 +396,54 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
395
396
|
}
|
|
396
397
|
}
|
|
397
398
|
function c() {
|
|
398
|
-
var s,
|
|
399
|
-
(
|
|
399
|
+
var s, p;
|
|
400
|
+
(p = (s = u.value) == null ? void 0 : s.validateInputs) == null || p.call(s);
|
|
400
401
|
}
|
|
401
402
|
function C() {
|
|
402
|
-
switch (
|
|
403
|
+
switch (d.mode) {
|
|
403
404
|
case h.READ:
|
|
404
405
|
return;
|
|
405
406
|
case h.UPDATE:
|
|
406
|
-
return
|
|
407
|
+
return y();
|
|
407
408
|
case h.CREATE:
|
|
408
409
|
return r();
|
|
409
410
|
}
|
|
410
411
|
}
|
|
411
|
-
return (s,
|
|
412
|
-
const
|
|
412
|
+
return (s, p) => {
|
|
413
|
+
const F = E("FmButton"), e = E("FmSideSheet");
|
|
413
414
|
return w(), T(e, {
|
|
414
|
-
"model-value":
|
|
415
|
-
"onUpdate:modelValue":
|
|
415
|
+
"model-value": g(l),
|
|
416
|
+
"onUpdate:modelValue": p[3] || (p[3] = (o) => Q(l) ? l.value = o : null),
|
|
416
417
|
header: m.value,
|
|
417
418
|
"close-button": "",
|
|
418
419
|
"dismiss-away": "",
|
|
419
420
|
"max-width": 500
|
|
420
421
|
}, {
|
|
421
422
|
"side-sheet-footer": $(() => [
|
|
422
|
-
|
|
423
|
-
|
|
423
|
+
b("div", He, [
|
|
424
|
+
f(F, {
|
|
424
425
|
loading: t.value,
|
|
425
426
|
label: i.value,
|
|
426
427
|
onClick: c
|
|
427
428
|
}, null, 8, ["loading", "label"]),
|
|
428
|
-
|
|
429
|
+
f(F, {
|
|
429
430
|
disabled: t.value,
|
|
430
431
|
label: "Close",
|
|
431
432
|
variant: "tertiary",
|
|
432
|
-
onClick:
|
|
433
|
+
onClick: p[2] || (p[2] = (o) => l.value = !1)
|
|
433
434
|
}, null, 8, ["disabled"])
|
|
434
435
|
])
|
|
435
436
|
]),
|
|
436
437
|
default: $(() => [
|
|
437
|
-
|
|
438
|
+
f(Ye, {
|
|
438
439
|
class: "w-full",
|
|
439
440
|
ref_key: "hasValidationExpose",
|
|
440
|
-
ref:
|
|
441
|
-
modelValue:
|
|
442
|
-
"onUpdate:modelValue":
|
|
441
|
+
ref: u,
|
|
442
|
+
modelValue: g(a),
|
|
443
|
+
"onUpdate:modelValue": p[0] || (p[0] = (o) => Q(a) ? a.value = o : null),
|
|
443
444
|
mode: s.mode,
|
|
444
445
|
disabled: t.value,
|
|
445
|
-
"onClick:submit":
|
|
446
|
+
"onClick:submit": p[1] || (p[1] = (o) => C())
|
|
446
447
|
}, null, 8, ["modelValue", "mode", "disabled"])
|
|
447
448
|
]),
|
|
448
449
|
_: 1
|
|
@@ -450,13 +451,13 @@ const Be = { class: "flex flex-col gap-40" }, Le = {
|
|
|
450
451
|
};
|
|
451
452
|
}
|
|
452
453
|
});
|
|
453
|
-
function
|
|
454
|
-
const
|
|
454
|
+
function qe() {
|
|
455
|
+
const _ = P(), d = _.recipes, v = _.recipeById, n = _.skuById, l = d.flatMap((i, u) => {
|
|
455
456
|
var t;
|
|
456
457
|
if ((t = i.contains) != null && t.length) {
|
|
457
|
-
const r = i.contains.filter((c) => c.type === "RECIPE"),
|
|
458
|
+
const r = i.contains.filter((c) => c.type === "RECIPE"), y = i.contains.filter((c) => c.type === "SKU");
|
|
458
459
|
return [
|
|
459
|
-
...
|
|
460
|
+
...u === 0 ? [] : [["", "", "", "", "", ""]],
|
|
460
461
|
...r.map(
|
|
461
462
|
(c, C) => {
|
|
462
463
|
var s;
|
|
@@ -465,97 +466,88 @@ function Ke() {
|
|
|
465
466
|
"RECIPE",
|
|
466
467
|
"",
|
|
467
468
|
(s = v[c.id]) == null ? void 0 : s.name,
|
|
468
|
-
|
|
469
|
+
H(c.amount),
|
|
469
470
|
"UNIT"
|
|
470
471
|
];
|
|
471
472
|
}
|
|
472
473
|
),
|
|
473
|
-
...
|
|
474
|
+
...y.map(
|
|
474
475
|
(c, C) => {
|
|
475
|
-
var s,
|
|
476
|
+
var s, p, F, e;
|
|
476
477
|
return [
|
|
477
478
|
!r.length && C === 0 ? i.name : "",
|
|
478
479
|
"INGREDIENT",
|
|
479
480
|
(s = n[c.id]) == null ? void 0 : s.code,
|
|
480
|
-
(
|
|
481
|
-
|
|
482
|
-
c.measurement ? c.measurement.abbrev : (e = (
|
|
481
|
+
(p = n[c.id]) == null ? void 0 : p.name,
|
|
482
|
+
H(c.amount),
|
|
483
|
+
c.measurement ? c.measurement.abbrev : (e = (F = n[c.id]) == null ? void 0 : F.unit) == null ? void 0 : e.abbrev
|
|
483
484
|
];
|
|
484
485
|
}
|
|
485
486
|
)
|
|
486
487
|
];
|
|
487
488
|
}
|
|
488
489
|
return [
|
|
489
|
-
...
|
|
490
|
+
...u === 0 ? [] : [["", "", "", "", "", ""]],
|
|
490
491
|
[i.name, "No bindings", "", "", "", ""]
|
|
491
492
|
];
|
|
492
|
-
}), m =
|
|
493
|
-
|
|
493
|
+
}), m = ye(l, ["Name", "Type", "Code", "Item", "Amount", "Unit"]);
|
|
494
|
+
ge(m, `RECIPE_${Se(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
|
|
494
495
|
}
|
|
495
|
-
const
|
|
496
|
+
const Ke = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, Ge = { class: "flex flex-col py-8" }, Je = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Oe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt = /* @__PURE__ */ z({
|
|
496
497
|
__name: "RecipeView",
|
|
497
|
-
setup(
|
|
498
|
-
const
|
|
498
|
+
setup(_) {
|
|
499
|
+
const d = P(), v = k(() => d.recipes), n = me(), { createRecipe: l, updateRecipe: a, deleteRecipe: m, recipeDialogProps: i, recipeViewLoading: u } = Te(), { columnDefs: t, formatRowData: r } = Ue({
|
|
499
500
|
updateRecipe: a,
|
|
500
501
|
deleteRecipe: m
|
|
501
|
-
}),
|
|
502
|
-
function c(
|
|
503
|
-
|
|
502
|
+
}), y = k(() => r(v.value));
|
|
503
|
+
function c(o) {
|
|
504
|
+
o === "add" && l();
|
|
504
505
|
}
|
|
505
|
-
const C = R(""), s = k(() =>
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
}, { breakpoints: E } = _e(), e = k(() => E.value.xs || E.value.sm ? 10 : 20), o = Re();
|
|
510
|
-
return (V, I) => {
|
|
511
|
-
const Y = x("FmTableToolbar"), M = x("FmTable");
|
|
512
|
-
return w(), T(Ee, {
|
|
506
|
+
const C = R(""), s = k(() => u.value), { breakpoints: p } = fe(), F = k(() => p.value.xs || p.value.sm ? 10 : 20), e = we();
|
|
507
|
+
return (o, S) => {
|
|
508
|
+
const N = E("FmTable");
|
|
509
|
+
return w(), T(Re, {
|
|
513
510
|
title: "Recipe",
|
|
514
511
|
actions: [{ label: "Add recipe", value: "add", isPrimary: !0, prependIcon: "add" }],
|
|
515
512
|
"onClick:action": c
|
|
516
513
|
}, {
|
|
517
514
|
default: $(() => [
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
]),
|
|
530
|
-
(w(), T(M, {
|
|
531
|
-
style: ce(b(o).tableHeight),
|
|
532
|
-
"column-defs": b(t),
|
|
533
|
-
"row-data": g.value,
|
|
515
|
+
b("div", Ke, [
|
|
516
|
+
f(Ce, {
|
|
517
|
+
searchable: "",
|
|
518
|
+
search: C.value,
|
|
519
|
+
"onUpdate:search": S[0] || (S[0] = (D) => C.value = D),
|
|
520
|
+
actions: [{ icon: "ios_share", onClick: g(qe) }]
|
|
521
|
+
}, null, 8, ["search", "actions"]),
|
|
522
|
+
(w(), T(N, {
|
|
523
|
+
style: ie(g(e).tableHeight),
|
|
524
|
+
"column-defs": g(t),
|
|
525
|
+
"row-data": y.value,
|
|
534
526
|
"search-value": C.value,
|
|
535
|
-
loading: !
|
|
536
|
-
onRowClick:
|
|
527
|
+
loading: !g(n)._currentLocation || s.value,
|
|
528
|
+
onRowClick: S[1] || (S[1] = (D) => g(a)(D.original.original)),
|
|
537
529
|
key: v.value.length,
|
|
538
|
-
"page-size":
|
|
530
|
+
"page-size": F.value
|
|
539
531
|
}, {
|
|
540
532
|
"list-row": $((D) => [
|
|
541
|
-
|
|
533
|
+
f(he, {
|
|
542
534
|
row: D,
|
|
543
|
-
onRowClick: (
|
|
535
|
+
onRowClick: (V) => g(a)(V.original)
|
|
544
536
|
}, {
|
|
545
|
-
default: $((
|
|
546
|
-
var
|
|
537
|
+
default: $((V) => {
|
|
538
|
+
var U, M, x, I, q, K, G, J, B, O;
|
|
547
539
|
return [
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
render: (
|
|
552
|
-
props: (
|
|
540
|
+
b("div", Ge, [
|
|
541
|
+
b("div", Je, [
|
|
542
|
+
f(g(ee), {
|
|
543
|
+
render: (x = (M = (U = V.recipe) == null ? void 0 : U.column) == null ? void 0 : M.columnDef) == null ? void 0 : x.cell,
|
|
544
|
+
props: (q = (I = V.recipe) == null ? void 0 : I.getContext) == null ? void 0 : q.call(I)
|
|
553
545
|
}, null, 8, ["render", "props"])
|
|
554
546
|
]),
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
render: (
|
|
558
|
-
props: (
|
|
547
|
+
b("div", Oe, [
|
|
548
|
+
f(g(ee), {
|
|
549
|
+
render: (J = (G = (K = V.ingredients) == null ? void 0 : K.column) == null ? void 0 : G.columnDef) == null ? void 0 : J.cell,
|
|
550
|
+
props: (O = (B = V.ingredients) == null ? void 0 : B.getContext) == null ? void 0 : O.call(B)
|
|
559
551
|
}, null, 8, ["render", "props"])
|
|
560
552
|
])
|
|
561
553
|
])
|
|
@@ -567,8 +559,8 @@ const Ge = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, Je =
|
|
|
567
559
|
_: 1
|
|
568
560
|
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
569
561
|
]),
|
|
570
|
-
(w(), T(
|
|
571
|
-
|
|
562
|
+
(w(), T(re, { to: "body" }, [
|
|
563
|
+
f(je, ce(ue(g(i))), null, 16)
|
|
572
564
|
]))
|
|
573
565
|
]),
|
|
574
566
|
_: 1
|
|
@@ -577,5 +569,5 @@ const Ge = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, Je =
|
|
|
577
569
|
}
|
|
578
570
|
});
|
|
579
571
|
export {
|
|
580
|
-
|
|
572
|
+
rt as default
|
|
581
573
|
};
|