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