@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.
Files changed (53) hide show
  1. package/dist/ApprovalView-DyazMoIY.js +118 -0
  2. package/dist/{BindingsDialog-Dw_DCOTY.js → BindingsDialog-D-p9eOMP.js} +2 -2
  3. package/dist/{BindingsPicker-BRLTF4Qs.js → BindingsPicker-C_kuxqQI.js} +2 -2
  4. package/dist/BindingsTable-jgL5-FZc.js +147 -0
  5. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DLc1nCIY.js +268 -0
  6. package/dist/{FmMultiselectDialog.vue_vue_type_script_setup_true_lang-YzVhmNJc.js → FmMultiselectDialog.vue_vue_type_script_setup_true_lang-D2Cg0s16.js} +2 -2
  7. 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
  8. package/dist/IngredientsView-DnIHe3Gj.js +1672 -0
  9. package/dist/{IntegrationView-Xnl758CS.js → IntegrationView-CgYnK7JB.js} +260 -266
  10. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CUj9Mnt6.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BObjqgU-.js} +6 -6
  11. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CW0h41FP.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DClJGGeY.js} +1 -1
  12. package/dist/{PurchaseOrderPrintPreview-DzimxkGt.js → PurchaseOrderPrintPreview-Vbmche3y.js} +1 -1
  13. package/dist/ReceiveRequestView-CpRdJQuN.js +1394 -0
  14. package/dist/{RecipeView-B9NcEw7x.js → RecipeView-Do3LgdfI.js} +182 -190
  15. package/dist/StockView-C16AHdmT.js +1862 -0
  16. package/dist/SupplierView-DGQXU4Ha.js +796 -0
  17. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BSwsz8Xt.js → TransferDetails.vue_vue_type_script_setup_true_lang-DK5gzjwS.js} +21 -20
  18. package/dist/{UnitView-BvbaRHxG.js → UnitView-AfEMV9Qr.js} +129 -133
  19. package/dist/{WarehouseView-Cf5Bmfhn.js → WarehouseView-Cph8wrcF.js} +260 -264
  20. package/dist/app-UpgZo4xX.js +66113 -0
  21. package/dist/app.js +1 -1
  22. package/dist/array-AvWd53LI.js +30 -0
  23. package/dist/components/FmInventoryTableToolbar.vue.d.ts +53 -0
  24. package/dist/date2-BfOl_Gio.js +95 -0
  25. package/dist/dayjs.min-r5rPIQFX.js +282 -0
  26. package/dist/{decimal-S-jYTEL5.js → decimal-CTa5OWKK.js} +1 -1
  27. package/dist/extensions/array.d.ts +1 -0
  28. package/dist/{fuzzy-DW00BX8H.js → fuzzy-0FMA9raY.js} +1 -1
  29. package/dist/{dayjs.min-M4PEyOKN.js → index-D9a9wXgJ.js} +3594 -3356
  30. package/dist/{layout-DACHKQ9G.js → layout-DxcK0DGS.js} +1 -1
  31. package/dist/number-BSqhQaRy.js +97 -0
  32. package/dist/{rules-ldw61cGA.js → rules-7WxBNkDE.js} +16 -15
  33. package/dist/stock-estimate-hfECAKZK.js +122 -0
  34. package/dist/{supplier-DjKC4TaM.js → supplier-Dg3f6Ybw.js} +1 -1
  35. package/dist/tsconfig.app.tsbuildinfo +1 -1
  36. package/dist/{use-inventory-binding-dialog-D1M09VoX.js → use-inventory-binding-dialog-NLy01qAo.js} +2 -2
  37. package/dist/views/ingredients/IngredientsView.vue.d.ts +1 -0
  38. package/dist/{xlsx-BcM9fWkc.js → xlsx-qSY56eID.js} +1 -1
  39. package/dist/{xlsx.util-BNXjhkYU.js → xlsx.util-DL8p0Kzi.js} +2 -2
  40. package/package.json +4 -4
  41. package/dist/ApprovalView-BJ_SGOrx.js +0 -134
  42. package/dist/BindingsTable-BMIkL0Bk.js +0 -121
  43. package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-D9Qp3jke.js +0 -97
  44. package/dist/IngredientsView-DYFkUsHx.js +0 -1802
  45. package/dist/ReceiveRequestView-C_0jK6GY.js +0 -1435
  46. package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-Dov3Uq2z.js +0 -64
  47. package/dist/StockView-JPw1K8aU.js +0 -1960
  48. package/dist/SupplierView-CiQLFWmQ.js +0 -804
  49. package/dist/app-BbXzmbBO.js +0 -42892
  50. package/dist/components/FmTableToolbar.vue.d.ts +0 -49
  51. package/dist/date2-DFqSdEvG.js +0 -189
  52. package/dist/init-date-range-B_ha80e0.js +0 -21
  53. package/dist/stock-estimate-DOP1qO5w.js +0 -145
@@ -1,18 +1,19 @@
1
- import { defineComponent as N, ref as R, onMounted as se, resolveComponent as x, openBlock as w, createElementBlock as A, Fragment as le, createElementVNode as _, toDisplayString as ie, createVNode as p, createCommentVNode as H, computed as k, watch as re, createBlock as T, withCtx as $, unref as b, isRef as X, normalizeStyle as ce, Teleport as de, normalizeProps as ue, guardReactiveProps as me } from "vue";
2
- import { u as P, c as q, S as pe, b as Z, f as fe } from "./app-BbXzmbBO.js";
3
- import { useDialog as ve, useSnackbar as ne, useProxiedModel as ee, useBreakpoints as _e } from "@feedmepos/ui-library";
4
- import { i as ye, _ as ge } from "./is-linked-ingredient-error-C6AghEwR.js";
5
- import { F as h, D as te, R as z } from "./row-action.enum-BwQbURNh.js";
6
- import { _ as ae, t as be, d as he } from "./xlsx.util-BNXjhkYU.js";
7
- import { c as we, _ as xe, F as oe, u as Re } from "./layout-DACHKQ9G.js";
8
- import { a as j, f as Ce } from "./date2-DFqSdEvG.js";
9
- import { _ as Ee } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-Dov3Uq2z.js";
10
- import { R as Fe, U as ke } from "./rules-ldw61cGA.js";
11
- import { _ as Se } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CUj9Mnt6.js";
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
- }, De = /* @__PURE__ */ _("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1), Ae = { key: 1 }, $e = /* @__PURE__ */ _("br", null, null, -1), Pe = { key: 0 }, Ie = /* @__PURE__ */ _("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1), Te = /* @__PURE__ */ N({
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(y) {
24
- const u = y, v = R(u.bindedItems || []), n = R(!1);
25
- se(() => {
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 = u.data) != null && a._id) && (n.value = !0, v.value = await P().getAffectedMenu((m = u.data) == null ? void 0 : m._id), n.value = !1);
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 = x("FmSpacer"), d = x("FmCircularProgress");
34
- return w(), A(le, null, [
35
- _("p", null, ie(a.message), 1),
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
- p(i),
38
- _("div", null, [
39
- p(d, { size: "xl" })
38
+ f(i),
39
+ b("div", null, [
40
+ f(u, { size: "xl" })
40
41
  ]),
41
- De,
42
- p(i)
43
- ])) : (w(), A("div", Ae, [
44
- $e,
45
- v.value.length > 0 ? (w(), A("div", Pe, [
46
- Ie,
47
- p(ae, {
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
- ])) : H("", !0)
52
+ ])) : Y("", !0)
52
53
  ]))
53
54
  ], 64);
54
55
  };
55
56
  }
56
57
  });
57
- function Me() {
58
- const y = ve(), u = ne(), v = P(), n = R(!1), l = R();
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: q(t),
73
+ recipe: j(t),
73
74
  mode: h.UPDATE,
74
75
  show: !0,
75
- "onUpdate:show"(g) {
76
- l.value.show = g;
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), u.open({
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 pe && ye(r) ? y.open({
91
+ r instanceof de && ve(r) ? _.open({
91
92
  title: "Cannot delete recipe",
92
- contentComponent: ge,
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), u.open({
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 d(t) {
111
- y.open({
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: Te,
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: d,
135
+ deleteRecipe: u,
135
136
  recipeDialogProps: l,
136
137
  recipeViewLoading: n
137
138
  };
138
139
  }
139
140
  function Ue({
140
- updateRecipe: y,
141
- deleteRecipe: u
141
+ updateRecipe: _,
142
+ deleteRecipe: d
142
143
  }) {
143
144
  async function v(a, m) {
144
- const i = q(m);
145
- if (a === z.Edit) {
146
- await y(i);
145
+ const i = j(m);
146
+ if (a === L.Edit) {
147
+ await _(i);
147
148
  return;
148
149
  }
149
- if (a === z.Delete) {
150
- await u(i);
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 we(
170
- [te[z.Edit], te[z.Delete]],
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((d) => {
189
- var r, g;
190
- const t = m.skuById[d.id];
191
- return t ? `${t.name} (${j(d.amount)}${((r = d.measurement) == null ? void 0 : r.abbrev) ?? ((g = t == null ? void 0 : t.unit) == null ? void 0 : g.abbrev)})` : null;
192
- }).filter((d) => d).join(", "),
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 Be = { class: "flex flex-col gap-40" }, Le = {
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
- }, ze = {
202
+ }, Le = {
202
203
  key: 0,
203
204
  class: "flex flex-col items-center w-full h-full gap-24"
204
- }, Ne = /* @__PURE__ */ _("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1), Ye = { key: 1 }, He = /* @__PURE__ */ N({
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(y, { expose: u, emit: v }) {
213
- var E;
214
- const n = y, l = v, a = k({
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 d = R();
237
- u({
237
+ const u = R();
238
+ d({
238
239
  validateInputs: () => {
239
240
  var e, o;
240
- (o = (e = d.value) == null ? void 0 : e.validateInputs) == null || o.call(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 = d.value) == null ? void 0 : e.resetInputsValidation) == null || o.call(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 = d.value) == null ? void 0 : e.resetInputs) == null || o.call(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([]), g = R(!1), c = R(!1);
252
- re(g, async (e) => {
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, V;
257
- e && !c.value && ((o = n.modelValue) != null && o._id) && (c.value = !0, r.value = await t.getAffectedMenu((V = n.modelValue) == null ? void 0 : V._id), c.value = !1);
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
- ), f = R((E = n.modelValue) == null ? void 0 : E.name);
262
+ ), p = R((F = n.modelValue) == null ? void 0 : F.name);
262
263
  return (e, o) => {
263
- const V = x("FmTextField"), I = x("FmCard"), Y = x("FmSwitch"), M = x("FmSpacer"), D = x("FmCircularProgress"), S = x("FmForm");
264
- return w(), T(S, {
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: d,
267
+ ref: u,
267
268
  onValidationSuccess: i
268
269
  }, {
269
270
  default: $(() => [
270
- _("div", Be, [
271
- p(V, {
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] = (F) => a.value = F),
276
+ "onUpdate:modelValue": o[0] || (o[0] = (x) => a.value = x),
276
277
  rules: [
277
- b(Fe)(),
278
- b(ke)(s.value, f.value, (F) => `[${F.value}] already exists`)
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
- p(I, {
283
+ f(N, {
283
284
  variant: "outlined",
284
285
  class: "p-16"
285
286
  }, {
286
287
  default: $(() => {
287
- var F;
288
+ var x;
288
289
  return [
289
- p(Se, {
290
- id: (F = e.modelValue) == null ? void 0 : F._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] = (U) => m.value = U)
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 !== b(h).CREATE ? (w(), A("div", Le, [
301
- _("div", null, [
302
- p(Y, {
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: g.value,
305
- "onUpdate:modelValue": o[2] || (o[2] = (F) => g.value = F),
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", ze, [
311
- p(M),
312
- _("div", null, [
313
- p(D, { size: "xl" })
311
+ c.value ? (w(), A("div", Le, [
312
+ f(V),
313
+ b("div", null, [
314
+ f(U, { size: "xl" })
314
315
  ]),
315
- Ne,
316
- p(M)
317
- ])) : (w(), A("div", Ye, [
318
- g.value && r.value.length ? (w(), T(ae, {
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"])) : H("", !0)
323
+ }, null, 8, ["bindings"])) : Y("", !0)
323
324
  ]))
324
- ])) : H("", !0)
325
+ ])) : Y("", !0)
325
326
  ]),
326
327
  _: 1
327
328
  }, 512);
328
329
  };
329
330
  }
330
- }), je = { class: "flex gap-4" }, qe = /* @__PURE__ */ N({
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(y) {
339
- const u = y, v = P(), n = ne(), l = ee(u, "show"), a = ee(u, "recipe"), m = k(() => {
340
- switch (u.mode) {
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 (u.mode) {
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
- }), d = R(), t = R(!1);
360
+ }), u = R(), t = R(!1);
360
361
  async function r() {
361
362
  t.value = !0;
362
363
  try {
363
- const s = q(a.value);
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 Z || n.open({
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 g() {
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 Z || n.open({
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, f;
399
- (f = (s = d.value) == null ? void 0 : s.validateInputs) == null || f.call(s);
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 (u.mode) {
403
+ switch (d.mode) {
403
404
  case h.READ:
404
405
  return;
405
406
  case h.UPDATE:
406
- return g();
407
+ return y();
407
408
  case h.CREATE:
408
409
  return r();
409
410
  }
410
411
  }
411
- return (s, f) => {
412
- const E = x("FmButton"), e = x("FmSideSheet");
412
+ return (s, p) => {
413
+ const F = E("FmButton"), e = E("FmSideSheet");
413
414
  return w(), T(e, {
414
- "model-value": b(l),
415
- "onUpdate:modelValue": f[3] || (f[3] = (o) => X(l) ? l.value = o : null),
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
- _("div", je, [
423
- p(E, {
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
- p(E, {
429
+ f(F, {
429
430
  disabled: t.value,
430
431
  label: "Close",
431
432
  variant: "tertiary",
432
- onClick: f[2] || (f[2] = (o) => l.value = !1)
433
+ onClick: p[2] || (p[2] = (o) => l.value = !1)
433
434
  }, null, 8, ["disabled"])
434
435
  ])
435
436
  ]),
436
437
  default: $(() => [
437
- p(He, {
438
+ f(Ye, {
438
439
  class: "w-full",
439
440
  ref_key: "hasValidationExpose",
440
- ref: d,
441
- modelValue: b(a),
442
- "onUpdate:modelValue": f[0] || (f[0] = (o) => X(a) ? a.value = o : null),
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": f[1] || (f[1] = (o) => C())
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 Ke() {
454
- const y = P(), u = y.recipes, v = y.recipeById, n = y.skuById, l = u.flatMap((i, d) => {
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"), g = i.contains.filter((c) => c.type === "SKU");
458
+ const r = i.contains.filter((c) => c.type === "RECIPE"), y = i.contains.filter((c) => c.type === "SKU");
458
459
  return [
459
- ...d === 0 ? [] : [["", "", "", "", "", ""]],
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
- j(c.amount),
469
+ H(c.amount),
469
470
  "UNIT"
470
471
  ];
471
472
  }
472
473
  ),
473
- ...g.map(
474
+ ...y.map(
474
475
  (c, C) => {
475
- var s, f, E, e;
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
- (f = n[c.id]) == null ? void 0 : f.name,
481
- j(c.amount),
482
- c.measurement ? c.measurement.abbrev : (e = (E = n[c.id]) == null ? void 0 : E.unit) == null ? void 0 : e.abbrev
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
- ...d === 0 ? [] : [["", "", "", "", "", ""]],
490
+ ...u === 0 ? [] : [["", "", "", "", "", ""]],
490
491
  [i.name, "No bindings", "", "", "", ""]
491
492
  ];
492
- }), m = be(l, ["Name", "Type", "Code", "Item", "Amount", "Unit"]);
493
- he(m, `RECIPE_${Ce(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
493
+ }), m = ye(l, ["Name", "Type", "Code", "Item", "Amount", "Unit"]);
494
+ ge(m, `RECIPE_${Se(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
494
495
  }
495
- const Ge = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, Je = { class: "px-8 flex items-center xs:gap-0 xs:flex-col-reverse sm:gap-0 sm:flex-col-reverse" }, Oe = { class: "flex-1 w-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" }, dt = /* @__PURE__ */ N({
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(y) {
498
- const u = P(), v = k(() => u.recipes), n = fe(), { createRecipe: l, updateRecipe: a, deleteRecipe: m, recipeDialogProps: i, recipeViewLoading: d } = Me(), { columnDefs: t, formatRowData: r } = Ue({
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
- }), g = k(() => r(v.value));
502
- function c(V) {
503
- V === "add" && l();
502
+ }), y = k(() => r(v.value));
503
+ function c(o) {
504
+ o === "add" && l();
504
505
  }
505
- const C = R(""), s = k(() => d.value), f = {
506
- label: "Export",
507
- icon: "ios_share",
508
- key: "export"
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
- _("div", Ge, [
519
- _("div", Je, [
520
- _("div", Oe, [
521
- p(Y, {
522
- searchable: "",
523
- "search-model": C.value,
524
- "onUpdate:searchModel": I[0] || (I[0] = (D) => C.value = D),
525
- actions: [f],
526
- "onClick:actionExport": b(Ke)
527
- }, null, 8, ["search-model", "actions", "onClick:actionExport"])
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: !b(n)._currentLocation || s.value,
536
- onRowClick: I[1] || (I[1] = (D) => b(a)(D.original.original)),
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": e.value
530
+ "page-size": F.value
539
531
  }, {
540
532
  "list-row": $((D) => [
541
- p(xe, {
533
+ f(he, {
542
534
  row: D,
543
- onRowClick: (S) => b(a)(S.original)
535
+ onRowClick: (V) => g(a)(V.original)
544
536
  }, {
545
- default: $((S) => {
546
- var F, U, K, B, G, J, O, Q, L, W;
537
+ default: $((V) => {
538
+ var U, M, x, I, q, K, G, J, B, O;
547
539
  return [
548
- _("div", Qe, [
549
- _("div", We, [
550
- p(b(oe), {
551
- render: (K = (U = (F = S.recipe) == null ? void 0 : F.column) == null ? void 0 : U.columnDef) == null ? void 0 : K.cell,
552
- props: (G = (B = S.recipe) == null ? void 0 : B.getContext) == null ? void 0 : G.call(B)
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
- _("div", Xe, [
556
- p(b(oe), {
557
- render: (Q = (O = (J = S.ingredients) == null ? void 0 : J.column) == null ? void 0 : O.columnDef) == null ? void 0 : Q.cell,
558
- props: (W = (L = S.ingredients) == null ? void 0 : L.getContext) == null ? void 0 : W.call(L)
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(de, { to: "body" }, [
571
- p(qe, ue(me(b(i))), null, 16)
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
- dt as default
572
+ rt as default
581
573
  };