@feedmepos/mf-inventory-portal 0.0.19-dev.1 → 0.0.19-dev.3

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.
Files changed (69) hide show
  1. package/dist/ApprovalView-CS7NtcBA.js +120 -0
  2. package/dist/{BindingsDialog-DpC48bqK.js → BindingsDialog-BA2w-qkY.js} +5 -6
  3. package/dist/{BindingsPicker-BU52g6zk.js → BindingsPicker-wf7b30Bk.js} +6 -7
  4. package/dist/{BindingsTable-aIuFdScv.js → BindingsTable-mqqSPDbO.js} +4 -6
  5. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CViUEhuw.js +272 -0
  6. package/dist/IngredientsView-BVX31o67.js +1750 -0
  7. package/dist/IntegrationView-DFdl_238.js +1172 -0
  8. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BuyM580N.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BENFVQkL.js} +1 -1
  9. package/dist/{PurchaseOrderPrintPreview-EeKhENYH.js → PurchaseOrderPrintPreview-06PokYt4.js} +13 -13
  10. package/dist/ReceiveRequestView-ck-05Ly7.js +1394 -0
  11. package/dist/RecipeView-CiOb2lvU.js +572 -0
  12. package/dist/StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js +59 -0
  13. package/dist/StockView-5LkTxYI2.js +1876 -0
  14. package/dist/SupplierView-BAfC5Wcw.js +801 -0
  15. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-qZDMkkIZ.js +1031 -0
  16. package/dist/UnitView-wsbXOcbf.js +638 -0
  17. package/dist/WarehouseView-DHhDNAk8.js +1050 -0
  18. package/dist/api/bill.d.ts +2 -2
  19. package/dist/app-DNCC20Aq.js +66729 -0
  20. package/dist/app.d.ts +1031 -0
  21. package/dist/app.js +5 -3
  22. package/dist/components/FmDroppableField.vue.d.ts +1 -1
  23. package/dist/{decimal-BAZuuTcd.js → decimal-DaXHxukU.js} +1 -1
  24. package/dist/{stock-estimate-CL4HShG8.js → id-to-date-XiomI6dP.js} +12 -13
  25. package/dist/{layout-BnTfCS_X.js → layout-DvgFrTEG.js} +14 -14
  26. package/dist/router/name.d.ts +1 -1
  27. package/dist/style.css +1 -1
  28. package/dist/{supplier-CjAH8O1y.js → supplier-BepZrUgL.js} +3 -3
  29. package/dist/tsconfig.app.tsbuildinfo +1 -1
  30. package/dist/views/ingredients/composables/use-ingredient-form.d.ts +14 -2
  31. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -2
  32. package/dist/views/receive-request/components/transfer-form/SparkIcon.vue.d.ts +1 -1
  33. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +12 -12
  34. package/dist/views/recipe/composables/use-recipe-form.d.ts +14 -2
  35. package/dist/views/recipe/composables/use-recipe-table.d.ts +1 -2
  36. package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
  37. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
  38. package/dist/views/stock/composables/use-stock-action.d.ts +26 -0
  39. package/dist/views/stock/composables/use-stock-table.d.ts +1 -8
  40. package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
  41. package/dist/views/unit/composables/use-unit-form.d.ts +14 -2
  42. package/dist/views/unit/composables/use-unit-table.d.ts +1 -2
  43. package/dist/{xlsx-vUzm_udV.js → xlsx-DaxqUL1h.js} +1 -1
  44. package/dist/xlsx.util-Dwiw0sTo.js +109 -0
  45. package/package.json +6 -5
  46. package/dist/ApprovalView-BTZwnKLf.js +0 -118
  47. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DjgmtvXU.js +0 -268
  48. package/dist/FmMultiselectDialog.vue_vue_type_script_setup_true_lang-n09XXJZK.js +0 -143
  49. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-B-19iYaK.js +0 -236
  50. package/dist/IngredientsView-DMyEGdik.js +0 -1767
  51. package/dist/IntegrationView-Dn_qL_vC.js +0 -1166
  52. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-DGTLUrb9.js +0 -276
  53. package/dist/ReceiveRequestView-BOdgbFFM.js +0 -1394
  54. package/dist/RecipeView-B1aNLDIK.js +0 -573
  55. package/dist/StockForecast.vue_vue_type_style_index_0_lang-B5EK101t.js +0 -58
  56. package/dist/StockView-C_Ur_jTg.js +0 -1862
  57. package/dist/SupplierView-CXfOoHTr.js +0 -796
  58. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-kjV5Eazv.js +0 -1028
  59. package/dist/UnitView-DHXfAsnq.js +0 -635
  60. package/dist/WarehouseView-DMwbxs1q.js +0 -1043
  61. package/dist/app-BkcO8oNJ.js +0 -66113
  62. package/dist/date2-Cvp5iJkI.js +0 -95
  63. package/dist/dayjs.min-D1_pOsO7.js +0 -282
  64. package/dist/fuzzy-0roCBvgC.js +0 -41
  65. package/dist/index-B_aEOJsR.js +0 -21515
  66. package/dist/number-DLj3W3RW.js +0 -97
  67. package/dist/rules-CCmXA0Yi.js +0 -85
  68. package/dist/use-inventory-binding-dialog-GkJOzE6V.js +0 -93
  69. package/dist/xlsx.util-B_bqymTM.js +0 -107
@@ -0,0 +1,572 @@
1
+ import { defineComponent as Y, ref as E, onMounted as se, resolveComponent as k, openBlock as x, createElementBlock as $, Fragment as le, createElementVNode as g, toDisplayString as ie, createVNode as v, createCommentVNode as H, computed as V, watch as re, createBlock as T, withCtx as A, unref as _, isRef as X, normalizeStyle as ce, Teleport as ue, normalizeProps as de, guardReactiveProps as me } from "vue";
2
+ import { u as I, c as G, S as pe, a as q, R as fe, U as ve, _ as ye, e as Z, f as _e, j as ge } from "./app-DNCC20Aq.js";
3
+ import { useDialog as be, useSnackbar as ne, useProxiedModel as ee, useBreakpoints as he } from "@feedmepos/ui-library";
4
+ import { i as we, _ as Re } from "./is-linked-ingredient-error-C6AghEwR.js";
5
+ import { F as R, D as te, R as N } from "./row-action.enum-BwQbURNh.js";
6
+ import { _ as ae, t as xe, d as Ce } from "./xlsx.util-Dwiw0sTo.js";
7
+ import { defineStore as Ee, storeToRefs as Fe } from "pinia";
8
+ import { c as ke, _ as Ve, F as oe, u as Se } from "./layout-DvgFrTEG.js";
9
+ import { useI18n as j } from "@feedmepos/mf-common";
10
+ import { _ as De, a as $e } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CViUEhuw.js";
11
+ const Ae = {
12
+ key: 0,
13
+ class: "flex flex-col items-center w-full h-full gap-24"
14
+ }, Ie = /* @__PURE__ */ g("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1), Pe = { key: 1 }, Te = /* @__PURE__ */ g("br", null, null, -1), Me = { key: 0 }, Ue = /* @__PURE__ */ g("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1), Be = /* @__PURE__ */ Y({
15
+ __name: "DeleteDialog",
16
+ props: {
17
+ type: {},
18
+ data: {},
19
+ message: {},
20
+ bindedItems: {}
21
+ },
22
+ setup(b) {
23
+ const d = b, p = E(d.bindedItems || []), s = E(!1);
24
+ se(() => {
25
+ n();
26
+ });
27
+ async function n() {
28
+ var i, l;
29
+ !s.value && ((i = d.data) != null && i._id) && (s.value = !0, p.value = await I().getAffectedMenu((l = d.data) == null ? void 0 : l._id), s.value = !1);
30
+ }
31
+ return (i, l) => {
32
+ const c = k("FmSpacer"), f = k("FmCircularProgress");
33
+ return x(), $(le, null, [
34
+ g("p", null, ie(i.message), 1),
35
+ s.value ? (x(), $("div", Ae, [
36
+ v(c),
37
+ g("div", null, [
38
+ v(f, { size: "xl" })
39
+ ]),
40
+ Ie,
41
+ v(c)
42
+ ])) : (x(), $("div", Pe, [
43
+ Te,
44
+ p.value.length > 0 ? (x(), $("div", Me, [
45
+ Ue,
46
+ v(ae, {
47
+ name: "Menu",
48
+ bindings: p.value
49
+ }, null, 8, ["bindings"])
50
+ ])) : H("", !0)
51
+ ]))
52
+ ], 64);
53
+ };
54
+ }
55
+ }), K = Ee("recipeForm", function() {
56
+ const d = be(), p = ne(), s = I(), n = E(!1), i = E();
57
+ function l() {
58
+ const t = {
59
+ recipe: {},
60
+ mode: R.CREATE,
61
+ show: !0,
62
+ "onUpdate:show"(u) {
63
+ i.value.show = u;
64
+ }
65
+ };
66
+ i.value = t;
67
+ }
68
+ async function c(t) {
69
+ const u = {
70
+ recipe: G(t),
71
+ mode: R.UPDATE,
72
+ show: !0,
73
+ "onUpdate:show"(a) {
74
+ i.value.show = a;
75
+ }
76
+ };
77
+ i.value = u;
78
+ }
79
+ async function f(t) {
80
+ n.value = !0;
81
+ try {
82
+ await s.deleteRecipe(t), p.open({
83
+ title: "Success",
84
+ message: `Deleted ${t.name}`,
85
+ type: "success"
86
+ });
87
+ } catch (u) {
88
+ u instanceof pe && we(u) ? d.open({
89
+ title: "Cannot delete recipe",
90
+ contentComponent: Re,
91
+ contentComponentProps: {
92
+ subject: (t == null ? void 0 : t.name) ?? "",
93
+ items: u.errorResponse.message
94
+ },
95
+ secondaryActions: {
96
+ text: "Close",
97
+ close: !0
98
+ }
99
+ }) : console.log("unable to delete recipe", u), p.open({
100
+ title: `Cannot delete ${t == null ? void 0 : t.name}`,
101
+ message: "Please try again.",
102
+ type: "error"
103
+ }), console.error("failed to delete recipe", u);
104
+ } finally {
105
+ n.value = !1;
106
+ }
107
+ }
108
+ function m(t) {
109
+ d.open({
110
+ title: `Delete ${(t == null ? void 0 : t.name) ?? "recipe"}?`,
111
+ closeButton: !1,
112
+ primaryActions: {
113
+ text: "Delete",
114
+ close: !0,
115
+ variant: "destructive"
116
+ },
117
+ secondaryActions: {
118
+ text: "Cancel",
119
+ close: !0
120
+ },
121
+ contentComponent: Be,
122
+ contentComponentProps: {
123
+ type: "menu",
124
+ data: t,
125
+ message: "You may not be able to delete this recipe if it is linked in any of the inventory modules."
126
+ }
127
+ }).onPrimary(() => f(t));
128
+ }
129
+ return {
130
+ createRecipe: l,
131
+ updateRecipe: c,
132
+ deleteRecipe: m,
133
+ recipeDialogProps: i,
134
+ recipeViewLoading: n
135
+ };
136
+ });
137
+ function Le() {
138
+ const { updateRecipe: b, deleteRecipe: d } = K(), { t: p } = j();
139
+ async function s(l, c) {
140
+ const f = G(c);
141
+ if (l === N.Edit) {
142
+ await b(f);
143
+ return;
144
+ }
145
+ if (l === N.Delete) {
146
+ await d(f);
147
+ return;
148
+ }
149
+ }
150
+ const n = [
151
+ {
152
+ accessorKey: "recipe",
153
+ header: () => p("inventory.recipe.name"),
154
+ size: 400
155
+ },
156
+ {
157
+ accessorKey: "ingredients",
158
+ header: () => p("inventory.recipe.ingredients"),
159
+ size: "auto"
160
+ },
161
+ {
162
+ id: "action",
163
+ header: "",
164
+ cell(l) {
165
+ return ke(
166
+ [te[N.Edit], te[N.Delete]],
167
+ (c) => {
168
+ s(c, l.row.original.original);
169
+ }
170
+ );
171
+ },
172
+ enableSorting: !1,
173
+ size: 40,
174
+ meta: {
175
+ cellClass: "",
176
+ headerClass: ""
177
+ }
178
+ }
179
+ ];
180
+ function i(l) {
181
+ const c = I();
182
+ return l.map((f) => ({
183
+ recipe: f.name,
184
+ ingredients: f.contains.map((m) => {
185
+ var u, a;
186
+ const t = c.skuById[m.id];
187
+ return t ? `${t.name} (${q(m.amount)}${((u = m.measurement) == null ? void 0 : u.abbrev) ?? ((a = t == null ? void 0 : t.unit) == null ? void 0 : a.abbrev)})` : null;
188
+ }).filter((m) => m).join(", "),
189
+ original: f
190
+ }));
191
+ }
192
+ return { columnDefs: n, formatRowData: i };
193
+ }
194
+ const ze = { class: "flex flex-col gap-40" }, Ne = {
195
+ key: 0,
196
+ 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"
197
+ }, Ye = {
198
+ key: 0,
199
+ class: "flex flex-col items-center w-full h-full gap-24"
200
+ }, je = /* @__PURE__ */ g("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1), He = { key: 1 }, qe = /* @__PURE__ */ Y({
201
+ __name: "RecipeForm",
202
+ props: {
203
+ mode: {},
204
+ modelValue: {},
205
+ disabled: { type: Boolean }
206
+ },
207
+ emits: ["update:modelValue", "click:submit"],
208
+ setup(b, { expose: d, emit: p }) {
209
+ var F;
210
+ const s = b, n = p, { t: i } = j(), l = V({
211
+ get() {
212
+ var e;
213
+ return ((e = s.modelValue) == null ? void 0 : e.name) ?? "";
214
+ },
215
+ set(e) {
216
+ const o = s.modelValue ?? {};
217
+ o.name = e, n("update:modelValue", o);
218
+ }
219
+ }), c = V({
220
+ get() {
221
+ var e;
222
+ return ((e = s.modelValue) == null ? void 0 : e.contains) ?? [];
223
+ },
224
+ set(e) {
225
+ const o = s.modelValue ?? {};
226
+ o.contains = e, n("update:modelValue", o);
227
+ }
228
+ });
229
+ function f() {
230
+ n("click:submit");
231
+ }
232
+ const m = E();
233
+ d({
234
+ validateInputs: () => {
235
+ var e, o;
236
+ (o = (e = m.value) == null ? void 0 : e.validateInputs) == null || o.call(e);
237
+ },
238
+ resetInputsValidation: () => {
239
+ var e, o;
240
+ (o = (e = m.value) == null ? void 0 : e.resetInputsValidation) == null || o.call(e);
241
+ },
242
+ resetInputs: () => {
243
+ var e, o;
244
+ (o = (e = m.value) == null ? void 0 : e.resetInputs) == null || o.call(e);
245
+ }
246
+ });
247
+ const t = I(), u = E([]), a = E(!1), h = E(!1);
248
+ re(a, async (e) => {
249
+ C(e);
250
+ });
251
+ async function C(e) {
252
+ var o, P;
253
+ e && !h.value && ((o = s.modelValue) != null && o._id) && (h.value = !0, u.value = await t.getAffectedMenu((P = s.modelValue) == null ? void 0 : P._id), h.value = !1);
254
+ }
255
+ const r = V(
256
+ () => t.recipes.map((e) => ({ label: e.name, value: e.name }))
257
+ ), y = E((F = s.modelValue) == null ? void 0 : F.name);
258
+ return (e, o) => {
259
+ const P = k("FmTextField"), D = k("FmCard"), S = k("FmSwitch"), M = k("FmSpacer"), U = k("FmCircularProgress"), B = k("FmForm");
260
+ return x(), T(B, {
261
+ ref_key: "formRef",
262
+ ref: m,
263
+ onValidationSuccess: f
264
+ }, {
265
+ default: A(() => [
266
+ g("div", ze, [
267
+ v(P, {
268
+ disabled: e.disabled,
269
+ label: _(i)("inventory.recipe.name"),
270
+ "model-value": l.value,
271
+ "onUpdate:modelValue": o[0] || (o[0] = (w) => l.value = w),
272
+ rules: [
273
+ _(fe)(),
274
+ _(ve)(r.value, y.value, (w) => `[${w.value}] already exists`)
275
+ ],
276
+ "label-mark": "required"
277
+ }, null, 8, ["disabled", "label", "model-value", "rules"]),
278
+ v(D, {
279
+ variant: "outlined",
280
+ class: "p-16"
281
+ }, {
282
+ default: A(() => {
283
+ var w;
284
+ return [
285
+ v(ye, {
286
+ id: (w = e.modelValue) == null ? void 0 : w._id,
287
+ disabled: e.disabled,
288
+ "model-value": c.value,
289
+ "onUpdate:modelValue": o[1] || (o[1] = (L) => c.value = L)
290
+ }, null, 8, ["id", "disabled", "model-value"])
291
+ ];
292
+ }),
293
+ _: 1
294
+ })
295
+ ]),
296
+ e.mode !== _(R).CREATE ? (x(), $("div", Ne, [
297
+ g("div", null, [
298
+ v(S, {
299
+ label: "Show binded items",
300
+ modelValue: a.value,
301
+ "onUpdate:modelValue": o[2] || (o[2] = (w) => a.value = w),
302
+ "label-placement": "right",
303
+ disabled: h.value
304
+ }, null, 8, ["modelValue", "disabled"])
305
+ ]),
306
+ h.value ? (x(), $("div", Ye, [
307
+ v(M),
308
+ g("div", null, [
309
+ v(U, { size: "xl" })
310
+ ]),
311
+ je,
312
+ v(M)
313
+ ])) : (x(), $("div", He, [
314
+ a.value && u.value.length ? (x(), T(ae, {
315
+ key: 0,
316
+ name: "Menu",
317
+ bindings: u.value
318
+ }, null, 8, ["bindings"])) : H("", !0)
319
+ ]))
320
+ ])) : H("", !0)
321
+ ]),
322
+ _: 1
323
+ }, 512);
324
+ };
325
+ }
326
+ }), Ke = { class: "flex gap-4" }, Ge = /* @__PURE__ */ Y({
327
+ __name: "RecipeDialog",
328
+ props: {
329
+ show: { type: Boolean },
330
+ recipe: {},
331
+ mode: { default: R.READ }
332
+ },
333
+ emits: ["update:show"],
334
+ setup(b) {
335
+ const d = b, p = I(), s = ne(), { t: n } = j(), i = ee(d, "show"), l = ee(d, "recipe"), c = V(() => {
336
+ switch (d.mode) {
337
+ case R.READ:
338
+ return "";
339
+ case R.UPDATE:
340
+ return n("inventory.recipe.update.title");
341
+ case R.CREATE:
342
+ return n("inventory.recipe.create.title");
343
+ }
344
+ return "";
345
+ }), f = V(() => {
346
+ switch (d.mode) {
347
+ case R.READ:
348
+ return "";
349
+ case R.UPDATE:
350
+ return n("common.save");
351
+ case R.CREATE:
352
+ return n("common.add");
353
+ }
354
+ return "";
355
+ }), m = E(), t = E(!1);
356
+ async function u() {
357
+ t.value = !0;
358
+ try {
359
+ const r = G(l.value);
360
+ r.precision ?? (r.precision = 0), r.measurements ?? (r.measurements = []), await p.createRecipe(r), i.value = !1, s.open({
361
+ title: n("common.success"),
362
+ message: n("inventory.recipe.create.success", { name: l.value.name }),
363
+ type: "success"
364
+ });
365
+ } catch (r) {
366
+ r instanceof Z || s.open({
367
+ title: n("inventory.recipe.create.error.title"),
368
+ message: n("inventory.recipe.create.error.message"),
369
+ type: "error"
370
+ });
371
+ } finally {
372
+ t.value = !1;
373
+ }
374
+ }
375
+ async function a() {
376
+ t.value = !0;
377
+ try {
378
+ await p.updateRecipe(l.value), i.value = !1, s.open({
379
+ title: n("common.success"),
380
+ message: n("inventory.recipe.update.success", { name: l.value.name }),
381
+ type: "success"
382
+ });
383
+ } catch (r) {
384
+ r instanceof Z || s.open({
385
+ title: n("inventory.recipe.update.error.title"),
386
+ message: n("inventory.recipe.update.error.message"),
387
+ type: "error"
388
+ });
389
+ } finally {
390
+ t.value = !1;
391
+ }
392
+ }
393
+ function h() {
394
+ var r, y;
395
+ (y = (r = m.value) == null ? void 0 : r.validateInputs) == null || y.call(r);
396
+ }
397
+ function C() {
398
+ switch (d.mode) {
399
+ case R.READ:
400
+ return;
401
+ case R.UPDATE:
402
+ return a();
403
+ case R.CREATE:
404
+ return u();
405
+ }
406
+ }
407
+ return (r, y) => {
408
+ const F = k("FmButton"), e = k("FmSideSheet");
409
+ return x(), T(e, {
410
+ "model-value": _(i),
411
+ "onUpdate:modelValue": y[3] || (y[3] = (o) => X(i) ? i.value = o : null),
412
+ header: c.value,
413
+ "close-button": "",
414
+ "dismiss-away": "",
415
+ "max-width": 500
416
+ }, {
417
+ "side-sheet-footer": A(() => [
418
+ g("div", Ke, [
419
+ v(F, {
420
+ loading: t.value,
421
+ label: f.value,
422
+ onClick: h
423
+ }, null, 8, ["loading", "label"]),
424
+ v(F, {
425
+ disabled: t.value,
426
+ label: _(n)("common.close"),
427
+ variant: "tertiary",
428
+ onClick: y[2] || (y[2] = (o) => i.value = !1)
429
+ }, null, 8, ["disabled", "label"])
430
+ ])
431
+ ]),
432
+ default: A(() => [
433
+ v(qe, {
434
+ class: "w-full",
435
+ ref_key: "hasValidationExpose",
436
+ ref: m,
437
+ modelValue: _(l),
438
+ "onUpdate:modelValue": y[0] || (y[0] = (o) => X(l) ? l.value = o : null),
439
+ mode: r.mode,
440
+ disabled: t.value,
441
+ "onClick:submit": y[1] || (y[1] = (o) => C())
442
+ }, null, 8, ["modelValue", "mode", "disabled"])
443
+ ]),
444
+ _: 1
445
+ }, 8, ["model-value", "header"]);
446
+ };
447
+ }
448
+ });
449
+ function Je() {
450
+ const b = I(), d = b.recipes, p = b.recipeById, s = b.skuById, n = d.flatMap((c, f) => {
451
+ var m;
452
+ if ((m = c.contains) != null && m.length) {
453
+ const t = c.contains.filter((a) => a.type === "RECIPE"), u = c.contains.filter((a) => a.type === "SKU");
454
+ return [
455
+ ...f === 0 ? [] : [["", "", "", "", "", ""]],
456
+ ...t.map(
457
+ (a, h) => {
458
+ var C;
459
+ return [
460
+ h === 0 ? c.name : "",
461
+ "RECIPE",
462
+ "",
463
+ (C = p[a.id]) == null ? void 0 : C.name,
464
+ q(a.amount),
465
+ "UNIT"
466
+ ];
467
+ }
468
+ ),
469
+ ...u.map(
470
+ (a, h) => {
471
+ var C, r, y, F;
472
+ return [
473
+ !t.length && h === 0 ? c.name : "",
474
+ "INGREDIENT",
475
+ (C = s[a.id]) == null ? void 0 : C.code,
476
+ (r = s[a.id]) == null ? void 0 : r.name,
477
+ q(a.amount),
478
+ a.measurement ? a.measurement.abbrev : (F = (y = s[a.id]) == null ? void 0 : y.unit) == null ? void 0 : F.abbrev
479
+ ];
480
+ }
481
+ )
482
+ ];
483
+ }
484
+ return [
485
+ ...f === 0 ? [] : [["", "", "", "", "", ""]],
486
+ [c.name, "No bindings", "", "", "", ""]
487
+ ];
488
+ }), l = xe(n, ["Name", "Type", "Code", "Item", "Amount", "Unit"]);
489
+ Ce(l, `RECIPE_${_e(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
490
+ }
491
+ const Oe = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, Qe = { class: "flex flex-col py-8" }, We = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Xe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ct = /* @__PURE__ */ Y({
492
+ __name: "RecipeView",
493
+ setup(b) {
494
+ const d = I(), p = V(() => d.recipes), s = ge(), { createRecipe: n, updateRecipe: i } = K(), { recipeDialogProps: l, recipeViewLoading: c } = Fe(K()), { columnDefs: f, formatRowData: m } = Le(), t = V(() => m(p.value));
495
+ function u(e) {
496
+ e === "add" && n();
497
+ }
498
+ const a = E(""), h = V(() => c), { breakpoints: C } = he(), r = V(() => C.value.xs || C.value.sm ? 10 : 20), y = Se(), { t: F } = j();
499
+ return (e, o) => {
500
+ const P = k("FmTable");
501
+ return x(), T(De, {
502
+ title: _(F)("inventory.recipe.title"),
503
+ actions: [
504
+ {
505
+ label: _(F)("inventory.recipe.create.title"),
506
+ value: "add",
507
+ isPrimary: !0,
508
+ prependIcon: "add"
509
+ }
510
+ ],
511
+ "onClick:action": u
512
+ }, {
513
+ default: A(() => [
514
+ g("div", Oe, [
515
+ v($e, {
516
+ searchable: "",
517
+ search: a.value,
518
+ "onUpdate:search": o[0] || (o[0] = (D) => a.value = D),
519
+ actions: [{ icon: "ios_share", onClick: _(Je) }]
520
+ }, null, 8, ["search", "actions"]),
521
+ (x(), T(P, {
522
+ style: ce(_(y).tableHeight),
523
+ "column-defs": _(f),
524
+ "row-data": t.value,
525
+ "search-value": a.value,
526
+ loading: !_(s)._currentLocation || h.value,
527
+ onRowClick: o[1] || (o[1] = (D) => _(i)(D.original.original)),
528
+ key: p.value.length,
529
+ "page-size": r.value
530
+ }, {
531
+ "list-row": A((D) => [
532
+ v(Ve, {
533
+ row: D,
534
+ onRowClick: (S) => _(i)(S.original)
535
+ }, {
536
+ default: A((S) => {
537
+ var M, U, B, w, L, J, O, Q, z, W;
538
+ return [
539
+ g("div", Qe, [
540
+ g("div", We, [
541
+ v(_(oe), {
542
+ render: (B = (U = (M = S.recipe) == null ? void 0 : M.column) == null ? void 0 : U.columnDef) == null ? void 0 : B.cell,
543
+ props: (L = (w = S.recipe) == null ? void 0 : w.getContext) == null ? void 0 : L.call(w)
544
+ }, null, 8, ["render", "props"])
545
+ ]),
546
+ g("div", Xe, [
547
+ v(_(oe), {
548
+ render: (Q = (O = (J = S.ingredients) == null ? void 0 : J.column) == null ? void 0 : O.columnDef) == null ? void 0 : Q.cell,
549
+ props: (W = (z = S.ingredients) == null ? void 0 : z.getContext) == null ? void 0 : W.call(z)
550
+ }, null, 8, ["render", "props"])
551
+ ])
552
+ ])
553
+ ];
554
+ }),
555
+ _: 2
556
+ }, 1032, ["row", "onRowClick"])
557
+ ]),
558
+ _: 1
559
+ }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
560
+ ]),
561
+ (x(), T(ue, { to: "body" }, [
562
+ v(Ge, de(me(_(l))), null, 16)
563
+ ]))
564
+ ]),
565
+ _: 1
566
+ }, 8, ["title", "actions"]);
567
+ };
568
+ }
569
+ });
570
+ export {
571
+ ct as default
572
+ };
@@ -0,0 +1,59 @@
1
+ import { defineComponent as m, computed as p, openBlock as i, createElementBlock as l, createElementVNode as r, normalizeClass as c, toDisplayString as d, unref as f } from "vue";
2
+ import { useI18n as y } from "@feedmepos/mf-common";
3
+ function $(e, o = !1) {
4
+ var t;
5
+ return e ? [
6
+ {
7
+ label: o ? e.abbrev : `1 ${e.name} (${e.abbrev})`,
8
+ abbrev: e.abbrev,
9
+ value: null
10
+ },
11
+ ...((t = e.measurements) == null ? void 0 : t.map((n) => ({
12
+ label: o ? n.abbrev : `1 ${n.name} (${n.abbrev})`,
13
+ abbrev: n.abbrev,
14
+ value: n.id
15
+ }))) ?? []
16
+ ] : [];
17
+ }
18
+ var a = /* @__PURE__ */ ((e) => (e.noInfo = "no-info", e.low = "low", e.mid = "mid", e.high = "high", e))(a || {});
19
+ const u = {
20
+ key: 0,
21
+ class: "flex"
22
+ }, b = {
23
+ key: 1,
24
+ class: "flex"
25
+ }, v = { class: "flex px-8 py-4 bg-fm-color-neutral-gray-100 fm-corner-radius-md gap-8" }, _ = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, k = /* @__PURE__ */ m({
26
+ __name: "StockForecast",
27
+ props: {
28
+ days: {},
29
+ level: {}
30
+ },
31
+ setup(e) {
32
+ const o = e, { t: s } = y(), t = p(() => o.level ? o.level : typeof o.days != "number" ? a.noInfo : o.days > 14 ? a.high : o.days >= 7 && o.days <= 14 ? a.mid : a.low);
33
+ return (n, g) => typeof o.days == "number" ? (i(), l("div", u, [
34
+ r("div", {
35
+ class: c([
36
+ `fm-forecast-notification-${t.value}`,
37
+ "flex items-center gap-8 p-4 fm-corner-radius-md fm-typo-en-body-md-600"
38
+ ])
39
+ }, [
40
+ r("div", {
41
+ class: c([
42
+ "fm-forecast-notification-indicator",
43
+ `fm-forecast-notification-indicator-${t.value}`
44
+ ])
45
+ }, null, 2),
46
+ r("div", null, d(f(s)("inventory.stock.prediction.days", [o.days])), 1)
47
+ ], 2)
48
+ ])) : (i(), l("div", b, [
49
+ r("div", v, [
50
+ r("p", _, d(f(s)("inventory.stock.prediction.noData")), 1)
51
+ ])
52
+ ]));
53
+ }
54
+ });
55
+ export {
56
+ a as S,
57
+ k as _,
58
+ $ as g
59
+ };