@feedmepos/mf-inventory-portal 1.0.9-dev.3 → 1.0.9-dev.4
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-C6gg2tff.js → App-BOKGVcoO.js} +2 -2
- package/dist/{ApprovalView-DZifohZp.js → ApprovalView-Bo-4fnEU.js} +2 -2
- package/dist/{BindingsDialog-D-NE4sbz.js → BindingsDialog-DM2b4GN4.js} +2 -2
- package/dist/{BindingsPicker-BP5HkQhe.js → BindingsPicker-CJKBXA0c.js} +3 -3
- package/dist/{BindingsTable-DCLu2260.js → BindingsTable-BxCEEJfb.js} +1 -1
- package/dist/{ClosingDraftView-CF1WvxPK.js → ClosingDraftView-bQxPF18V.js} +2 -2
- package/dist/{ClosingTemplateView-BTAwwKIK.js → ClosingTemplateView-DLkp9Qt8.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-C0ornFrS.js → DeliveryOrderPrintPreview-CK3HdYVb.js} +1 -1
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C5aDXHfX.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DvCBsPdI.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DMHC_WQn.js → FmUnitInput.vue_vue_type_script_setup_true_lang-R8f-Q9Nk.js} +20 -20
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CDB7BLGo.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BOyqgaik.js} +1 -1
- package/dist/{IngredientsView-Cw9hWci5.js → IngredientsView-DmKCy_JQ.js} +4 -4
- package/dist/{IntegrationView-Af4yE6YN.js → IntegrationView-B1dzt8WK.js} +4 -4
- package/dist/{InventoryBindingForm-CKNE-9XF.js → InventoryBindingForm-CeTlH0U1.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DXGno3jm.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DsM2bCNe.js} +92 -87
- package/dist/{InventoryBindingSummary-DeNGAysn.js → InventoryBindingSummary-QVSD87YL.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BiB8cZwH.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C-lgLo2e.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CriwQBvl.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CEMRfo1C.js} +1 -1
- package/dist/{PublishView-CXRCoNai.js → PublishView-BYGKLC9D.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-C02inqk2.js → PurchaseOrderPrintPreview-CEVjGeom.js} +1 -1
- package/dist/{ReceiveRequestView-B7S4pKgp.js → ReceiveRequestView-D5PcGCLv.js} +42 -42
- package/dist/RecipeView-DmTDCsvk.js +8493 -0
- package/dist/{StockView-C7X97PgJ.js → StockView-EmTqUcP1.js} +7 -7
- package/dist/{SupplierView-DSD56NEd.js → SupplierView-BaLnW761.js} +4 -4
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-COa-ENT_.js → TransferDetails.vue_vue_type_script_setup_true_lang-B3ew6mc5.js} +36 -36
- package/dist/{TransferTemplateView-D76GtJPP.js → TransferTemplateView-DoeLAFmJ.js} +114 -114
- package/dist/{UnitView-DjrfCvNG.js → UnitView-6Kobe5di.js} +18 -18
- package/dist/{WarehouseView-BenlwQj0.js → WarehouseView-BBMS14jU.js} +1 -1
- package/dist/api/inventory.d.ts +66 -207
- package/dist/{app-Cn649AKe.js → app-CUTIQqG_.js} +7318 -7360
- package/dist/app.js +1 -1
- package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +22 -0
- package/dist/components/shell/inventory/binding-ui.vue.d.ts +22 -0
- package/dist/{decimal-B_2tpC5T.js → decimal-Bb7Chjpr.js} +1 -1
- package/dist/{feature-C3tkzv_R.js → feature-D5GLIW5h.js} +143 -148
- package/dist/{format-unit-display-CUjVAExM.js → format-unit-display-CqqBiewI.js} +29 -29
- package/dist/{index-WEO-tzBF.js → index-B7QMXzGe.js} +2739 -2823
- package/dist/{index-C8N0qnaj.js → index-DiEdX1Bs.js} +2 -2
- package/dist/main.d.ts +1 -0
- package/dist/{stock-D5ctHplB.js → stock-CO0XWh8j.js} +1 -1
- package/dist/stores/feature.d.ts +0 -2
- package/dist/stores/inventory.d.ts +89 -211
- package/dist/{supplier-CnlrJD2z.js → supplier-C877x7mU.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-DnG7HGSX.js → use-ingredient-select-dialog-ClufUFeU.js} +1 -1
- package/dist/{use-inventory-binding-dialog-sALJ--xH.js → use-inventory-binding-dialog-BuRe6QNp.js} +1 -1
- package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +44 -0
- package/dist/views/recipe/components/recipe-override-form-field/RecipeOverrideFormField.vue.d.ts +61 -0
- package/dist/views/recipe/composables/use-recipe-overrides-form-field.d.ts +10 -0
- package/dist/{vue-i18n-B_Hl3d6o.js → vue-i18n-CxuQa0ds.js} +401 -401
- package/package.json +6 -5
- package/dist/IngredientGroupView-DwUeV_bZ.js +0 -604
- package/dist/RecipeView-dUKMM9iC.js +0 -616
- package/dist/views/ingredient-group/IngredientGroupView.vue.d.ts +0 -3
- package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +0 -31
- package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +0 -12
- package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +0 -20
- package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +0 -12
- package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +0 -24
- package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +0 -218
|
@@ -1,616 +0,0 @@
|
|
|
1
|
-
import { defineComponent as q, ref as E, onMounted as re, resolveComponent as F, openBlock as x, createElementBlock as I, Fragment as ie, createElementVNode as h, toDisplayString as ue, createVNode as g, createCommentVNode as K, computed as k, watch as ce, createBlock as T, withCtx as P, unref as _, isRef as Z, normalizeClass as de, normalizeStyle as me, Teleport as pe, normalizeProps as fe, guardReactiveProps as ve } from "vue";
|
|
2
|
-
import { a as A, d as V, e as G, S as ye, f as ge, D as ee, h as Y, i as j, F as te, l as be, U as _e, A as we, p as ne, q as Re, s as he, r as Ve, u as xe, z as Ce, _ as Ee, B as Se, C as Fe, E as oe } from "./app-Cn649AKe.js";
|
|
3
|
-
import { useDialog as ke, useSnackbar as se, useProxiedModel as ae, useBreakpoints as De } from "@feedmepos/ui-library";
|
|
4
|
-
import { i as Ae, _ as $e } from "./is-linked-ingredient-error-fJ2TJb3z.js";
|
|
5
|
-
import { _ as le } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-CDB7BLGo.js";
|
|
6
|
-
import { defineStore as Ie, storeToRefs as Pe } from "pinia";
|
|
7
|
-
import { useI18n as H } from "@feedmepos/mf-common";
|
|
8
|
-
import { _ as Be } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-DXGno3jm.js";
|
|
9
|
-
import { _ as Te } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
|
|
10
|
-
const Me = {
|
|
11
|
-
key: 0,
|
|
12
|
-
class: "flex flex-col items-center w-full h-full gap-24"
|
|
13
|
-
}, Ue = { key: 1 }, Ne = { key: 0 }, ze = /* @__PURE__ */ q({
|
|
14
|
-
__name: "DeleteDialog",
|
|
15
|
-
props: {
|
|
16
|
-
type: {},
|
|
17
|
-
data: {},
|
|
18
|
-
message: {},
|
|
19
|
-
bindedItems: {}
|
|
20
|
-
},
|
|
21
|
-
setup(w) {
|
|
22
|
-
const p = w, f = E(p.bindedItems || []), l = E(!1);
|
|
23
|
-
re(() => {
|
|
24
|
-
r();
|
|
25
|
-
});
|
|
26
|
-
async function r() {
|
|
27
|
-
var u, i;
|
|
28
|
-
!l.value && ((u = p.data) != null && u._id) && (l.value = !0, f.value = await A().getAffectedMenu((i = p.data) == null ? void 0 : i._id), l.value = !1);
|
|
29
|
-
}
|
|
30
|
-
return (u, i) => {
|
|
31
|
-
const v = F("FmSpacer"), d = F("FmCircularProgress");
|
|
32
|
-
return x(), I(ie, null, [
|
|
33
|
-
h("p", null, ue(u.message), 1),
|
|
34
|
-
l.value ? (x(), I("div", Me, [
|
|
35
|
-
g(v),
|
|
36
|
-
h("div", null, [
|
|
37
|
-
g(d, { size: "xl" })
|
|
38
|
-
]),
|
|
39
|
-
i[0] || (i[0] = h("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
|
|
40
|
-
g(v)
|
|
41
|
-
])) : (x(), I("div", Ue, [
|
|
42
|
-
i[2] || (i[2] = h("br", null, null, -1)),
|
|
43
|
-
f.value.length > 0 ? (x(), I("div", Ne, [
|
|
44
|
-
i[1] || (i[1] = h("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
|
|
45
|
-
g(le, {
|
|
46
|
-
name: "Menu",
|
|
47
|
-
bindings: f.value
|
|
48
|
-
}, null, 8, ["bindings"])
|
|
49
|
-
])) : K("", !0)
|
|
50
|
-
]))
|
|
51
|
-
], 64);
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
}), O = Ie("recipeForm", function() {
|
|
55
|
-
const p = ke(), f = se(), l = A(), r = E(!1), u = E();
|
|
56
|
-
function i() {
|
|
57
|
-
const t = {
|
|
58
|
-
recipe: {},
|
|
59
|
-
mode: V.CREATE,
|
|
60
|
-
show: !0,
|
|
61
|
-
"onUpdate:show"(s) {
|
|
62
|
-
u.value.show = s;
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
u.value = t;
|
|
66
|
-
}
|
|
67
|
-
async function v(t) {
|
|
68
|
-
const s = {
|
|
69
|
-
recipe: G(t),
|
|
70
|
-
mode: V.UPDATE,
|
|
71
|
-
show: !0,
|
|
72
|
-
"onUpdate:show"(o) {
|
|
73
|
-
u.value.show = o;
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
u.value = s;
|
|
77
|
-
}
|
|
78
|
-
async function d(t) {
|
|
79
|
-
r.value = !0;
|
|
80
|
-
try {
|
|
81
|
-
await l.deleteRecipe(t), f.open({
|
|
82
|
-
title: "Success",
|
|
83
|
-
message: `Deleted ${t.name}`,
|
|
84
|
-
type: "success"
|
|
85
|
-
});
|
|
86
|
-
} catch (s) {
|
|
87
|
-
s instanceof ye && Ae(s) ? p.open({
|
|
88
|
-
title: "Cannot delete recipe",
|
|
89
|
-
contentComponent: $e,
|
|
90
|
-
contentComponentProps: {
|
|
91
|
-
subject: (t == null ? void 0 : t.name) ?? "",
|
|
92
|
-
items: s.errorResponse.message
|
|
93
|
-
},
|
|
94
|
-
secondaryActions: {
|
|
95
|
-
text: "Close",
|
|
96
|
-
close: !0
|
|
97
|
-
}
|
|
98
|
-
}) : console.log("unable to delete recipe", s), f.open({
|
|
99
|
-
title: `Cannot delete ${t == null ? void 0 : t.name}`,
|
|
100
|
-
message: "Please try again.",
|
|
101
|
-
type: "error"
|
|
102
|
-
}), console.error("failed to delete recipe", s);
|
|
103
|
-
} finally {
|
|
104
|
-
r.value = !1;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
function m(t) {
|
|
108
|
-
p.open({
|
|
109
|
-
title: `Delete ${(t == null ? void 0 : t.name) ?? "recipe"}?`,
|
|
110
|
-
closeButton: !1,
|
|
111
|
-
primaryActions: {
|
|
112
|
-
text: "Delete",
|
|
113
|
-
close: !0,
|
|
114
|
-
variant: "destructive"
|
|
115
|
-
},
|
|
116
|
-
secondaryActions: {
|
|
117
|
-
text: "Cancel",
|
|
118
|
-
close: !0
|
|
119
|
-
},
|
|
120
|
-
contentComponent: ze,
|
|
121
|
-
contentComponentProps: {
|
|
122
|
-
type: "menu",
|
|
123
|
-
data: t,
|
|
124
|
-
message: "You may not be able to delete this recipe if it is linked in any of the inventory modules."
|
|
125
|
-
}
|
|
126
|
-
}).onPrimary(() => d(t));
|
|
127
|
-
}
|
|
128
|
-
return {
|
|
129
|
-
createRecipe: i,
|
|
130
|
-
updateRecipe: v,
|
|
131
|
-
deleteRecipe: m,
|
|
132
|
-
recipeDialogProps: u,
|
|
133
|
-
recipeViewLoading: r
|
|
134
|
-
};
|
|
135
|
-
});
|
|
136
|
-
function Le() {
|
|
137
|
-
const { updateRecipe: w, deleteRecipe: p } = O(), f = A(), { t: l } = H();
|
|
138
|
-
async function r(d, m) {
|
|
139
|
-
const t = G(m);
|
|
140
|
-
if (d === Y.Edit) {
|
|
141
|
-
await w(t);
|
|
142
|
-
return;
|
|
143
|
-
}
|
|
144
|
-
if (d === Y.Delete) {
|
|
145
|
-
await p(t);
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
function u(d, m) {
|
|
150
|
-
const t = d.filter((o) => o.type === te.enum.SKU), s = d.filter((o) => o.type === te.enum.RECIPE);
|
|
151
|
-
return [
|
|
152
|
-
...t.map((o) => ({ ...o, recipeIds: [...m] })),
|
|
153
|
-
...s.filter((o) => f.recipeById[o.id] && !m.has(o.id)).flatMap(
|
|
154
|
-
(o) => u(f.recipeById[o.id].contains, /* @__PURE__ */ new Set([...m, o.id]))
|
|
155
|
-
)
|
|
156
|
-
];
|
|
157
|
-
}
|
|
158
|
-
const i = [
|
|
159
|
-
{
|
|
160
|
-
accessorKey: "recipe",
|
|
161
|
-
header: () => l("inventory.recipe.name"),
|
|
162
|
-
size: 400
|
|
163
|
-
},
|
|
164
|
-
{
|
|
165
|
-
accessorKey: "ingredients",
|
|
166
|
-
header: () => l("inventory.recipe.ingredients"),
|
|
167
|
-
size: "auto"
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
id: "action",
|
|
171
|
-
header: "",
|
|
172
|
-
cell(d) {
|
|
173
|
-
return ge(
|
|
174
|
-
[ee[Y.Edit], ee[Y.Delete]],
|
|
175
|
-
(m) => {
|
|
176
|
-
r(m, d.row.original.original);
|
|
177
|
-
}
|
|
178
|
-
);
|
|
179
|
-
},
|
|
180
|
-
enableSorting: !1,
|
|
181
|
-
size: 40,
|
|
182
|
-
meta: {
|
|
183
|
-
cellClass: "",
|
|
184
|
-
headerClass: ""
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
];
|
|
188
|
-
function v(d) {
|
|
189
|
-
const m = A();
|
|
190
|
-
return d.map((t) => ({
|
|
191
|
-
recipe: t.name,
|
|
192
|
-
ingredients: u(t.contains, /* @__PURE__ */ new Set([t._id])).map((s) => {
|
|
193
|
-
var c, b, a, y, C;
|
|
194
|
-
const o = m.skuById[s.id];
|
|
195
|
-
return o ? s.recipeIds.slice(1).length ? `(linked recipe ${(c = m.recipeById[s.recipeIds.at(-1) ?? ""]) == null ? void 0 : c.name}) ${o.name} (${j(s.amount)}${((b = s.measurement) == null ? void 0 : b.abbrev) ?? ((a = o == null ? void 0 : o.unit) == null ? void 0 : a.abbrev)})` : `${o.name} (${j(s.amount)}${((y = s.measurement) == null ? void 0 : y.abbrev) ?? ((C = o == null ? void 0 : o.unit) == null ? void 0 : C.abbrev)})` : null;
|
|
196
|
-
}).filter((s) => s).join(", "),
|
|
197
|
-
original: t
|
|
198
|
-
}));
|
|
199
|
-
}
|
|
200
|
-
return { columnDefs: i, formatRowData: v };
|
|
201
|
-
}
|
|
202
|
-
const Ye = { class: "flex flex-col gap-40" }, je = {
|
|
203
|
-
key: 0,
|
|
204
|
-
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"
|
|
205
|
-
}, qe = {
|
|
206
|
-
key: 0,
|
|
207
|
-
class: "flex flex-col items-center w-full h-full gap-24"
|
|
208
|
-
}, He = { key: 1 }, Ke = { class: "mt-32" }, Oe = /* @__PURE__ */ q({
|
|
209
|
-
__name: "RecipeForm",
|
|
210
|
-
props: {
|
|
211
|
-
mode: {},
|
|
212
|
-
modelValue: {},
|
|
213
|
-
disabled: { type: Boolean }
|
|
214
|
-
},
|
|
215
|
-
emits: ["update:modelValue", "click:submit"],
|
|
216
|
-
setup(w, { expose: p, emit: f }) {
|
|
217
|
-
var S;
|
|
218
|
-
const l = w, r = f, { t: u } = H(), i = k({
|
|
219
|
-
get() {
|
|
220
|
-
var e;
|
|
221
|
-
return ((e = l.modelValue) == null ? void 0 : e.name) ?? "";
|
|
222
|
-
},
|
|
223
|
-
set(e) {
|
|
224
|
-
const n = l.modelValue ?? {};
|
|
225
|
-
n.name = e, r("update:modelValue", n);
|
|
226
|
-
}
|
|
227
|
-
}), v = k({
|
|
228
|
-
get() {
|
|
229
|
-
var e;
|
|
230
|
-
return ((e = l.modelValue) == null ? void 0 : e.contains) ?? [];
|
|
231
|
-
},
|
|
232
|
-
set(e) {
|
|
233
|
-
const n = l.modelValue ?? {};
|
|
234
|
-
n.contains = e, r("update:modelValue", n);
|
|
235
|
-
}
|
|
236
|
-
}), d = k({
|
|
237
|
-
get() {
|
|
238
|
-
var e;
|
|
239
|
-
return ((e = l.modelValue) == null ? void 0 : e.customAttributes) ?? {};
|
|
240
|
-
},
|
|
241
|
-
set(e) {
|
|
242
|
-
const n = l.modelValue ? {
|
|
243
|
-
...l.modelValue
|
|
244
|
-
} : {};
|
|
245
|
-
n.customAttributes = e, r("update:modelValue", n);
|
|
246
|
-
}
|
|
247
|
-
});
|
|
248
|
-
function m() {
|
|
249
|
-
r("click:submit");
|
|
250
|
-
}
|
|
251
|
-
const t = E();
|
|
252
|
-
p({
|
|
253
|
-
validateInputs: () => {
|
|
254
|
-
var e, n;
|
|
255
|
-
(n = (e = t.value) == null ? void 0 : e.validateInputs) == null || n.call(e);
|
|
256
|
-
},
|
|
257
|
-
resetInputsValidation: () => {
|
|
258
|
-
var e, n;
|
|
259
|
-
(n = (e = t.value) == null ? void 0 : e.resetInputsValidation) == null || n.call(e);
|
|
260
|
-
},
|
|
261
|
-
resetInputs: () => {
|
|
262
|
-
var e, n;
|
|
263
|
-
(n = (e = t.value) == null ? void 0 : e.resetInputs) == null || n.call(e);
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
const s = A(), o = E([]), c = E(!1), b = E(!1);
|
|
267
|
-
ce(c, async (e) => {
|
|
268
|
-
a(e);
|
|
269
|
-
});
|
|
270
|
-
async function a(e) {
|
|
271
|
-
var n, B;
|
|
272
|
-
e && !b.value && ((n = l.modelValue) != null && n._id) && (b.value = !0, o.value = await s.getAffectedMenu((B = l.modelValue) == null ? void 0 : B._id), b.value = !1);
|
|
273
|
-
}
|
|
274
|
-
const y = k(
|
|
275
|
-
() => s.recipes.map((e) => ({ label: e.name, value: e.name }))
|
|
276
|
-
), C = E((S = l.modelValue) == null ? void 0 : S.name);
|
|
277
|
-
return (e, n) => {
|
|
278
|
-
const B = F("FmTextField"), $ = F("FmCard"), D = F("FmSwitch"), M = F("FmSpacer"), U = F("FmCircularProgress"), N = F("FmForm");
|
|
279
|
-
return x(), T(N, {
|
|
280
|
-
ref_key: "formRef",
|
|
281
|
-
ref: t,
|
|
282
|
-
onValidationSuccess: m
|
|
283
|
-
}, {
|
|
284
|
-
default: P(() => [
|
|
285
|
-
h("div", Ye, [
|
|
286
|
-
g(B, {
|
|
287
|
-
disabled: e.disabled,
|
|
288
|
-
label: _(u)("inventory.recipe.name"),
|
|
289
|
-
"model-value": i.value,
|
|
290
|
-
"onUpdate:modelValue": n[0] || (n[0] = (R) => i.value = R),
|
|
291
|
-
rules: [
|
|
292
|
-
_(be)(),
|
|
293
|
-
_(_e)(y.value, C.value, (R) => `[${R.value}] already exists`)
|
|
294
|
-
],
|
|
295
|
-
"label-mark": "required"
|
|
296
|
-
}, null, 8, ["disabled", "label", "model-value", "rules"]),
|
|
297
|
-
g($, {
|
|
298
|
-
variant: "outlined",
|
|
299
|
-
class: "p-16"
|
|
300
|
-
}, {
|
|
301
|
-
default: P(() => {
|
|
302
|
-
var R;
|
|
303
|
-
return [
|
|
304
|
-
g(Be, {
|
|
305
|
-
id: (R = e.modelValue) == null ? void 0 : R._id,
|
|
306
|
-
disabled: e.disabled,
|
|
307
|
-
"model-value": v.value,
|
|
308
|
-
"onUpdate:modelValue": n[1] || (n[1] = (z) => v.value = z),
|
|
309
|
-
rules: [_(we)(1)]
|
|
310
|
-
}, null, 8, ["id", "disabled", "model-value", "rules"])
|
|
311
|
-
];
|
|
312
|
-
}),
|
|
313
|
-
_: 1
|
|
314
|
-
})
|
|
315
|
-
]),
|
|
316
|
-
e.mode !== _(V).CREATE ? (x(), I("div", je, [
|
|
317
|
-
h("div", null, [
|
|
318
|
-
g(D, {
|
|
319
|
-
label: "Show binded items",
|
|
320
|
-
modelValue: c.value,
|
|
321
|
-
"onUpdate:modelValue": n[2] || (n[2] = (R) => c.value = R),
|
|
322
|
-
"label-placement": "right",
|
|
323
|
-
disabled: b.value
|
|
324
|
-
}, null, 8, ["modelValue", "disabled"])
|
|
325
|
-
]),
|
|
326
|
-
b.value ? (x(), I("div", qe, [
|
|
327
|
-
g(M),
|
|
328
|
-
h("div", null, [
|
|
329
|
-
g(U, { size: "xl" })
|
|
330
|
-
]),
|
|
331
|
-
n[4] || (n[4] = h("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
|
|
332
|
-
g(M)
|
|
333
|
-
])) : (x(), I("div", He, [
|
|
334
|
-
c.value && o.value.length ? (x(), T(le, {
|
|
335
|
-
key: 0,
|
|
336
|
-
name: "Menu",
|
|
337
|
-
bindings: o.value
|
|
338
|
-
}, null, 8, ["bindings"])) : K("", !0)
|
|
339
|
-
]))
|
|
340
|
-
])) : K("", !0),
|
|
341
|
-
h("div", Ke, [
|
|
342
|
-
g(Te, {
|
|
343
|
-
entity: "inventoryRecipe",
|
|
344
|
-
modelValue: d.value,
|
|
345
|
-
"onUpdate:modelValue": n[3] || (n[3] = (R) => d.value = R)
|
|
346
|
-
}, null, 8, ["modelValue"])
|
|
347
|
-
])
|
|
348
|
-
]),
|
|
349
|
-
_: 1
|
|
350
|
-
}, 512);
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
}), Ge = { class: "flex gap-4" }, Je = /* @__PURE__ */ q({
|
|
354
|
-
__name: "RecipeDialog",
|
|
355
|
-
props: {
|
|
356
|
-
show: { type: Boolean },
|
|
357
|
-
recipe: {},
|
|
358
|
-
mode: { default: V.READ }
|
|
359
|
-
},
|
|
360
|
-
emits: ["update:show"],
|
|
361
|
-
setup(w) {
|
|
362
|
-
const p = w, f = A(), l = se(), { t: r } = H(), u = ae(p, "show"), i = ae(p, "recipe"), v = k(() => {
|
|
363
|
-
switch (p.mode) {
|
|
364
|
-
case V.READ:
|
|
365
|
-
return "";
|
|
366
|
-
case V.UPDATE:
|
|
367
|
-
return r("inventory.recipe.update.title");
|
|
368
|
-
case V.CREATE:
|
|
369
|
-
return r("inventory.recipe.create.title");
|
|
370
|
-
}
|
|
371
|
-
return "";
|
|
372
|
-
}), d = k(() => {
|
|
373
|
-
switch (p.mode) {
|
|
374
|
-
case V.READ:
|
|
375
|
-
return "";
|
|
376
|
-
case V.UPDATE:
|
|
377
|
-
return r("common.save");
|
|
378
|
-
case V.CREATE:
|
|
379
|
-
return r("common.add");
|
|
380
|
-
}
|
|
381
|
-
return "";
|
|
382
|
-
}), m = E(), t = E(!1);
|
|
383
|
-
async function s() {
|
|
384
|
-
t.value = !0;
|
|
385
|
-
try {
|
|
386
|
-
const a = G(i.value);
|
|
387
|
-
a.precision ?? (a.precision = 0), a.measurements ?? (a.measurements = []), await f.createRecipe(a), u.value = !1, l.open({
|
|
388
|
-
title: r("inventory.common.success"),
|
|
389
|
-
message: r("inventory.recipe.create.success", { name: i.value.name }),
|
|
390
|
-
type: "success"
|
|
391
|
-
});
|
|
392
|
-
} catch (a) {
|
|
393
|
-
a instanceof ne || l.open({
|
|
394
|
-
title: r("inventory.recipe.create.error.title"),
|
|
395
|
-
message: r("inventory.recipe.create.error.message"),
|
|
396
|
-
type: "error"
|
|
397
|
-
});
|
|
398
|
-
} finally {
|
|
399
|
-
t.value = !1;
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
async function o() {
|
|
403
|
-
t.value = !0;
|
|
404
|
-
try {
|
|
405
|
-
await f.updateRecipe(i.value), u.value = !1, l.open({
|
|
406
|
-
title: r("inventory.common.success"),
|
|
407
|
-
message: r("inventory.recipe.update.success", { name: i.value.name }),
|
|
408
|
-
type: "success"
|
|
409
|
-
});
|
|
410
|
-
} catch (a) {
|
|
411
|
-
a instanceof ne || l.open({
|
|
412
|
-
title: r("inventory.recipe.update.error.title"),
|
|
413
|
-
message: r("inventory.recipe.update.error.message"),
|
|
414
|
-
type: "error"
|
|
415
|
-
});
|
|
416
|
-
} finally {
|
|
417
|
-
t.value = !1;
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
function c() {
|
|
421
|
-
var a, y;
|
|
422
|
-
(y = (a = m.value) == null ? void 0 : a.validateInputs) == null || y.call(a);
|
|
423
|
-
}
|
|
424
|
-
function b() {
|
|
425
|
-
switch (p.mode) {
|
|
426
|
-
case V.READ:
|
|
427
|
-
return;
|
|
428
|
-
case V.UPDATE:
|
|
429
|
-
return o();
|
|
430
|
-
case V.CREATE:
|
|
431
|
-
return s();
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
return (a, y) => {
|
|
435
|
-
const C = F("FmButton"), S = F("FmSideSheet");
|
|
436
|
-
return x(), T(S, {
|
|
437
|
-
"model-value": _(u),
|
|
438
|
-
"onUpdate:modelValue": y[3] || (y[3] = (e) => Z(u) ? u.value = e : null),
|
|
439
|
-
header: v.value,
|
|
440
|
-
"close-button": "",
|
|
441
|
-
"dismiss-away": "",
|
|
442
|
-
"max-width": 500
|
|
443
|
-
}, {
|
|
444
|
-
"side-sheet-footer": P(() => [
|
|
445
|
-
h("div", Ge, [
|
|
446
|
-
g(C, {
|
|
447
|
-
loading: t.value,
|
|
448
|
-
label: d.value,
|
|
449
|
-
onClick: c
|
|
450
|
-
}, null, 8, ["loading", "label"]),
|
|
451
|
-
g(C, {
|
|
452
|
-
disabled: t.value,
|
|
453
|
-
label: _(r)("common.close"),
|
|
454
|
-
variant: "tertiary",
|
|
455
|
-
onClick: y[2] || (y[2] = (e) => u.value = !1)
|
|
456
|
-
}, null, 8, ["disabled", "label"])
|
|
457
|
-
])
|
|
458
|
-
]),
|
|
459
|
-
default: P(() => [
|
|
460
|
-
g(Oe, {
|
|
461
|
-
class: "w-full",
|
|
462
|
-
ref_key: "hasValidationExpose",
|
|
463
|
-
ref: m,
|
|
464
|
-
modelValue: _(i),
|
|
465
|
-
"onUpdate:modelValue": y[0] || (y[0] = (e) => Z(i) ? i.value = e : null),
|
|
466
|
-
mode: a.mode,
|
|
467
|
-
disabled: t.value,
|
|
468
|
-
"onClick:submit": y[1] || (y[1] = (e) => b())
|
|
469
|
-
}, null, 8, ["modelValue", "mode", "disabled"])
|
|
470
|
-
]),
|
|
471
|
-
_: 1
|
|
472
|
-
}, 8, ["model-value", "header"]);
|
|
473
|
-
};
|
|
474
|
-
}
|
|
475
|
-
});
|
|
476
|
-
function Qe(w) {
|
|
477
|
-
return !w || Object.keys(w).length === 0 ? "" : Object.entries(w).map(([p, f]) => `${p}: ${f}`).join(", ");
|
|
478
|
-
}
|
|
479
|
-
function We() {
|
|
480
|
-
const w = A(), p = w.recipes, f = w.recipeById, l = w.skuById, r = p.flatMap((v, d) => {
|
|
481
|
-
var t;
|
|
482
|
-
const m = Qe(v.customAttributes);
|
|
483
|
-
if ((t = v.contains) != null && t.length) {
|
|
484
|
-
const s = v.contains.filter((c) => c.type === "RECIPE"), o = v.contains.filter((c) => c.type === "SKU");
|
|
485
|
-
return [
|
|
486
|
-
...d === 0 ? [] : [["", "", "", "", "", "", ""]],
|
|
487
|
-
...s.map(
|
|
488
|
-
(c, b) => {
|
|
489
|
-
var a;
|
|
490
|
-
return [
|
|
491
|
-
b === 0 ? v.name : "",
|
|
492
|
-
"RECIPE",
|
|
493
|
-
"",
|
|
494
|
-
(a = f[c.id]) == null ? void 0 : a.name,
|
|
495
|
-
j(c.amount),
|
|
496
|
-
"UNIT",
|
|
497
|
-
b === 0 ? m : ""
|
|
498
|
-
];
|
|
499
|
-
}
|
|
500
|
-
),
|
|
501
|
-
...o.map(
|
|
502
|
-
(c, b) => {
|
|
503
|
-
var a, y, C, S;
|
|
504
|
-
return [
|
|
505
|
-
!s.length && b === 0 ? v.name : "",
|
|
506
|
-
"INGREDIENT",
|
|
507
|
-
(a = l[c.id]) == null ? void 0 : a.code,
|
|
508
|
-
(y = l[c.id]) == null ? void 0 : y.name,
|
|
509
|
-
j(c.amount),
|
|
510
|
-
c.measurement ? c.measurement.abbrev : (S = (C = l[c.id]) == null ? void 0 : C.unit) == null ? void 0 : S.abbrev,
|
|
511
|
-
!s.length && b === 0 ? m : ""
|
|
512
|
-
];
|
|
513
|
-
}
|
|
514
|
-
)
|
|
515
|
-
];
|
|
516
|
-
}
|
|
517
|
-
return [
|
|
518
|
-
...d === 0 ? [] : [["", "", "", "", "", "", ""]],
|
|
519
|
-
[v.name, "No bindings", "", "", "", "", m]
|
|
520
|
-
];
|
|
521
|
-
}), i = Re(r, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
|
|
522
|
-
he(i, `RECIPE_${Ve(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
|
|
523
|
-
}
|
|
524
|
-
const Xe = { class: "flex flex-col py-8" }, Ze = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, et = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ct = /* @__PURE__ */ q({
|
|
525
|
-
__name: "RecipeView",
|
|
526
|
-
setup(w) {
|
|
527
|
-
const p = A(), f = k(() => p.recipes), l = xe(), { createRecipe: r, updateRecipe: u } = O(), { recipeDialogProps: i, recipeViewLoading: v } = Pe(O()), { columnDefs: d, formatRowData: m } = Le(), t = k(() => m(f.value));
|
|
528
|
-
function s(e) {
|
|
529
|
-
if (e === "add")
|
|
530
|
-
return r();
|
|
531
|
-
if (e === "export")
|
|
532
|
-
return We();
|
|
533
|
-
}
|
|
534
|
-
const o = E(""), c = k(() => v.value), { breakpoints: b } = De(), a = k(() => b.value.xs || b.value.sm), y = k(() => a.value ? 10 : 20), C = Ce(), { t: S } = H();
|
|
535
|
-
return (e, n) => {
|
|
536
|
-
const B = F("FmTable");
|
|
537
|
-
return x(), T(Ee, {
|
|
538
|
-
title: _(S)("inventory.recipe.title"),
|
|
539
|
-
actions: [
|
|
540
|
-
{
|
|
541
|
-
label: _(S)("inventory.recipe.create.title"),
|
|
542
|
-
value: "add",
|
|
543
|
-
isPrimary: !0,
|
|
544
|
-
prependIcon: "add"
|
|
545
|
-
},
|
|
546
|
-
{ label: _(S)("common.export"), value: "export", isPrimary: !1 }
|
|
547
|
-
],
|
|
548
|
-
"onClick:action": s
|
|
549
|
-
}, {
|
|
550
|
-
default: P(() => [
|
|
551
|
-
h("div", {
|
|
552
|
-
class: de([
|
|
553
|
-
"flex flex-col gap-8 max-h-full",
|
|
554
|
-
{
|
|
555
|
-
"p-0": a.value,
|
|
556
|
-
"px-24 ": !a.value
|
|
557
|
-
}
|
|
558
|
-
])
|
|
559
|
-
}, [
|
|
560
|
-
g(Se, {
|
|
561
|
-
searchable: "",
|
|
562
|
-
search: o.value,
|
|
563
|
-
"onUpdate:search": n[0] || (n[0] = ($) => o.value = $)
|
|
564
|
-
}, null, 8, ["search"]),
|
|
565
|
-
(x(), T(B, {
|
|
566
|
-
style: me(_(C).tableHeight),
|
|
567
|
-
"column-defs": _(d),
|
|
568
|
-
"row-data": t.value,
|
|
569
|
-
"search-value": o.value,
|
|
570
|
-
loading: !_(l)._currentLocation || c.value,
|
|
571
|
-
onRowClick: n[1] || (n[1] = ($) => _(u)($.original.original)),
|
|
572
|
-
key: f.value.length,
|
|
573
|
-
"page-size": y.value
|
|
574
|
-
}, {
|
|
575
|
-
"list-row": P(($) => [
|
|
576
|
-
g(Fe, {
|
|
577
|
-
row: $,
|
|
578
|
-
onRowClick: (D) => _(u)(D.original)
|
|
579
|
-
}, {
|
|
580
|
-
default: P((D) => {
|
|
581
|
-
var M, U, N, R, z, J, Q, W, L, X;
|
|
582
|
-
return [
|
|
583
|
-
h("div", Xe, [
|
|
584
|
-
h("div", Ze, [
|
|
585
|
-
g(_(oe), {
|
|
586
|
-
render: (N = (U = (M = D.recipe) == null ? void 0 : M.column) == null ? void 0 : U.columnDef) == null ? void 0 : N.cell,
|
|
587
|
-
props: (z = (R = D.recipe) == null ? void 0 : R.getContext) == null ? void 0 : z.call(R)
|
|
588
|
-
}, null, 8, ["render", "props"])
|
|
589
|
-
]),
|
|
590
|
-
h("div", et, [
|
|
591
|
-
g(_(oe), {
|
|
592
|
-
render: (W = (Q = (J = D.ingredients) == null ? void 0 : J.column) == null ? void 0 : Q.columnDef) == null ? void 0 : W.cell,
|
|
593
|
-
props: (X = (L = D.ingredients) == null ? void 0 : L.getContext) == null ? void 0 : X.call(L)
|
|
594
|
-
}, null, 8, ["render", "props"])
|
|
595
|
-
])
|
|
596
|
-
])
|
|
597
|
-
];
|
|
598
|
-
}),
|
|
599
|
-
_: 2
|
|
600
|
-
}, 1032, ["row", "onRowClick"])
|
|
601
|
-
]),
|
|
602
|
-
_: 1
|
|
603
|
-
}, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
|
|
604
|
-
], 2),
|
|
605
|
-
(x(), T(pe, { to: "body" }, [
|
|
606
|
-
g(Je, fe(ve(_(i))), null, 16)
|
|
607
|
-
]))
|
|
608
|
-
]),
|
|
609
|
-
_: 1
|
|
610
|
-
}, 8, ["title", "actions"]);
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
|
-
});
|
|
614
|
-
export {
|
|
615
|
-
ct as default
|
|
616
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import '@/extensions/array';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
3
|
-
export default _default;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { IngredientGroupDialogProps } from './IngredientGroupDialogProps';
|
|
2
|
-
import { FormMode } from '@/components/form/form-mode.enum';
|
|
3
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<IngredientGroupDialogProps>, {
|
|
4
|
-
mode: FormMode;
|
|
5
|
-
}>>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
6
|
-
"update:show": (show: boolean) => void;
|
|
7
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<IngredientGroupDialogProps>, {
|
|
8
|
-
mode: FormMode;
|
|
9
|
-
}>>> & Readonly<{
|
|
10
|
-
"onUpdate:show"?: ((show: boolean) => any) | undefined;
|
|
11
|
-
}>, {
|
|
12
|
-
mode: FormMode;
|
|
13
|
-
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
14
|
-
export default _default;
|
|
15
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
16
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
17
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
18
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
19
|
-
} : {
|
|
20
|
-
type: import('vue').PropType<T[K]>;
|
|
21
|
-
required: true;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
type __VLS_WithDefaults<P, D> = {
|
|
25
|
-
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
26
|
-
default: D[K];
|
|
27
|
-
}> : P[K];
|
|
28
|
-
};
|
|
29
|
-
type __VLS_Prettify<T> = {
|
|
30
|
-
[K in keyof T]: T[K];
|
|
31
|
-
} & {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FormMode } from '@/components/form/form-mode.enum';
|
|
2
|
-
import type { _DeepPartial } from 'pinia';
|
|
3
|
-
export interface IngredientGroupDialogModelValue extends _DeepPartial<FdoInventorySkuGroup> {
|
|
4
|
-
}
|
|
5
|
-
export interface IngredientGroupDialogProps {
|
|
6
|
-
show?: boolean;
|
|
7
|
-
mode?: FormMode;
|
|
8
|
-
modelValue?: IngredientGroupDialogModelValue;
|
|
9
|
-
}
|
|
10
|
-
export interface IngredientGroupDialogEvents {
|
|
11
|
-
(event: 'update:show', show: boolean): void;
|
|
12
|
-
}
|
package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { IngredientGroupFormProps } from './IngredientGroupFormProps';
|
|
2
|
-
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IngredientGroupFormProps>>, {
|
|
3
|
-
validateInputs: () => void;
|
|
4
|
-
resetInputsValidation: () => void;
|
|
5
|
-
resetInputs: () => void;
|
|
6
|
-
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
7
|
-
"validation-success": () => void;
|
|
8
|
-
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_TypePropsToRuntimeProps<IngredientGroupFormProps>>> & Readonly<{
|
|
9
|
-
"onValidation-success"?: (() => any) | undefined;
|
|
10
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
11
|
-
export default _default;
|
|
12
|
-
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
-
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
14
|
-
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
-
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
-
} : {
|
|
17
|
-
type: import('vue').PropType<T[K]>;
|
|
18
|
-
required: true;
|
|
19
|
-
};
|
|
20
|
-
};
|
package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { FormMode } from '@/components/form/form-mode.enum';
|
|
2
|
-
import type { _DeepPartial } from 'pinia';
|
|
3
|
-
export interface IngredientGroupFormProps {
|
|
4
|
-
mode?: FormMode;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
modelValue?: IngredientGroupFormModelValue;
|
|
7
|
-
}
|
|
8
|
-
export interface IngredientGroupFormModelValue extends _DeepPartial<FdoInventorySkuGroup> {
|
|
9
|
-
}
|
|
10
|
-
export interface IngredientGroupFormEvents {
|
|
11
|
-
(event: 'validation-success'): void;
|
|
12
|
-
}
|