@feedmepos/mf-inventory-portal 0.0.7-dev.2 → 0.0.7-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.
Files changed (42) hide show
  1. package/dist/{ApprovalView-PgJmPjWr.js → ApprovalView-D1CshEiL.js} +6 -6
  2. package/dist/{BindingsDialog-Ch42kY-Z.js → BindingsDialog-Box9e9MU.js} +2 -2
  3. package/dist/{BindingsPicker-CjKJb9Iu.js → BindingsPicker-BMU_18fI.js} +2 -2
  4. package/dist/{BindingsTable-PvwPN2Vu.js → BindingsTable-CEmUUzD9.js} +3 -3
  5. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Dyl7UXMT.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BfmFBfLR.js} +1 -1
  6. package/dist/{FmMultiselectDialog.vue_vue_type_script_setup_true_lang-BCUjOxSy.js → FmMultiselectDialog.vue_vue_type_script_setup_true_lang-izsN_Y6x.js} +2 -2
  7. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CDi5O9gb.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-cNMSS0Ji.js} +1 -1
  8. package/dist/{IngredientsView--902oYCN.js → IngredientsView-Cx189ZUR.js} +202 -185
  9. package/dist/{IntegrationView-DzfSwX2I.js → IntegrationView-eJmquyFT.js} +3 -3
  10. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-jBbeI4Xr.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CN1SVuzj.js} +5 -5
  11. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-VIcbJgay.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Dyo5rWdy.js} +1 -1
  12. package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-BvadeWUz.js +35 -0
  13. package/dist/{PurchaseOrderPrintPreview-sr4WLbNL.js → PurchaseOrderPrintPreview-8aVgWGlY.js} +1 -1
  14. package/dist/{ReceiveRequestView-B3n0s9JC.js → ReceiveRequestView-DosAbeBl.js} +520 -495
  15. package/dist/{RecipeView-DjHRoOJv.js → RecipeView-_A-EOMMi.js} +7 -7
  16. package/dist/StockView-CpVv9gnP.js +1938 -0
  17. package/dist/{SupplierView-DXn13XBW.js → SupplierView-CZmv0Zch.js} +208 -195
  18. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BdTcFpfV.js → TransferDetails.vue_vue_type_script_setup_true_lang-DnMxN-Zl.js} +5 -5
  19. package/dist/{UnitView-DVrscPTQ.js → UnitView-CF48QegO.js} +6 -6
  20. package/dist/{WarehouseView-B1n-2vW4.js → WarehouseView-Pq4tKlGH.js} +3 -3
  21. package/dist/api/stock.d.ts +8 -0
  22. package/dist/{app-D-4-R23d.js → app-kk-I7El6.js} +187 -187
  23. package/dist/app.js +1 -1
  24. package/dist/components/PremiumBadge.vue.d.ts +24 -0
  25. package/dist/components/PreviewBadge.vue.d.ts +24 -0
  26. package/dist/{date2-B0vvvXGT.js → date2-C_MxkBzJ.js} +8 -8
  27. package/dist/{dayjs.min-BJNynOI_.js → dayjs.min-B0-vxxmd.js} +2251 -2009
  28. package/dist/{decimal-MudMBQgK.js → decimal-CwL8K3v-.js} +1 -1
  29. package/dist/{fuzzy-CToOYwhA.js → fuzzy-CdBRA2rL.js} +1 -1
  30. package/dist/{init-date-range-D5SkV2p4.js → init-date-range-BkRJwJWl.js} +1 -1
  31. package/dist/{layout-C7Dvo6EU.js → layout-Uo3EuS0G.js} +1 -1
  32. package/dist/{rules-D4pouPya.js → rules-DMCipsmW.js} +1 -1
  33. package/dist/stock-estimate-BRvddt7k.js +122 -0
  34. package/dist/{supplier-lu9adAbr.js → supplier-Ba-xLeGl.js} +1 -1
  35. package/dist/tsconfig.app.tsbuildinfo +1 -1
  36. package/dist/{use-inventory-binding-dialog-C-4l8D01.js → use-inventory-binding-dialog-Bn0GdfHQ.js} +2 -2
  37. package/dist/views/stock/components/StockHeaderPreview.vue.d.ts +2 -0
  38. package/dist/views/stock/components/StockRecalculateDialog.vue.d.ts +9 -0
  39. package/dist/{xlsx-BIvEkCPF.js → xlsx-DqXzQH_V.js} +628 -628
  40. package/package.json +3 -3
  41. package/dist/StockView-CtJ1iGfy.js +0 -1807
  42. package/dist/stock-estimate-Cpumo92_.js +0 -90
@@ -1,18 +1,19 @@
1
- import { ref as L, defineComponent as te, computed as m, resolveComponent as y, openBlock as k, createBlock as P, withCtx as w, createVNode as d, createElementBlock as J, Fragment as ne, createElementVNode as I, createCommentVNode as G, onMounted as Ie, watch as xe, unref as i, normalizeClass as pe, createTextVNode as Ae, toDisplayString as ae, renderList as Ue, isRef as ve, normalizeStyle as Ee, Teleport as Re, normalizeProps as De, guardReactiveProps as $e } from "vue";
2
- import { u as le, c as Fe, S as Pe, g as fe, F as N, d as ge, a as Te, C as ue, b as be, e as Be } from "./app-D-4-R23d.js";
3
- import { useDialog as Le, useSnackbar as Ce, useProxiedModel as Ve, useBreakpoints as Oe } from "@feedmepos/ui-library";
4
- import { i as Ne, _ as ze } from "./is-linked-ingredient-error-C6AghEwR.js";
1
+ import { ref as L, defineComponent as te, computed as m, resolveComponent as _, openBlock as w, createBlock as P, withCtx as y, createVNode as r, createElementBlock as J, Fragment as ne, createElementVNode as x, createCommentVNode as G, onMounted as Ie, watch as Ae, unref as d, normalizeClass as pe, createTextVNode as Ue, toDisplayString as ae, renderList as Ee, isRef as ve, normalizeStyle as Re, Teleport as De, normalizeProps as $e, guardReactiveProps as Pe } from "vue";
2
+ import { u as le, c as Ce, S as Te, g as fe, F as N, d as ge, a as Be, C as ue, b as be, e as Le } from "./app-kk-I7El6.js";
3
+ import { useDialog as Oe, useSnackbar as he, useProxiedModel as Ve, useBreakpoints as Ne } from "@feedmepos/ui-library";
4
+ import { i as ze, _ as Ge } from "./is-linked-ingredient-error-C6AghEwR.js";
5
5
  import { F as M, D as ye, R as ee } from "./row-action.enum-BwQbURNh.js";
6
- import { c as Ge, _ as Ye, F as _e, u as qe } from "./layout-C7Dvo6EU.js";
7
- import { _ as We } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CFjO4TPG.js";
8
- import { R as se, U as He, A as je, M as Ke } from "./rules-D4pouPya.js";
9
- import { g as Je } from "./use-inventory-binding-dialog-C-4l8D01.js";
10
- import { _ as Qe } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-jBbeI4Xr.js";
11
- import { _ as re } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-CDi5O9gb.js";
12
- import { a as Xe, t as Ze } from "./date2-B0vvvXGT.js";
13
- import { useCoreStore as en } from "@feedmepos/mf-common";
14
- function nn() {
15
- const A = Le(), F = Ce(), g = le(), t = L(!1), l = L();
6
+ import { c as Ye, _ as qe, F as _e, u as We } from "./layout-Uo3EuS0G.js";
7
+ import { _ as He } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CFjO4TPG.js";
8
+ import { R as se, U as je, A as Ke, M as Je } from "./rules-DMCipsmW.js";
9
+ import { g as Qe } from "./use-inventory-binding-dialog-Bn0GdfHQ.js";
10
+ import { _ as Xe } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CN1SVuzj.js";
11
+ import { _ as re } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-cNMSS0Ji.js";
12
+ import { a as Ze, t as en } from "./date2-C_MxkBzJ.js";
13
+ import { useCoreStore as nn } from "@feedmepos/mf-common";
14
+ import { _ as Fe } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-BvadeWUz.js";
15
+ function tn() {
16
+ const A = Oe(), C = he(), g = le(), t = L(!1), l = L();
16
17
  function a() {
17
18
  const u = {
18
19
  unit: {},
@@ -26,7 +27,7 @@ function nn() {
26
27
  }
27
28
  async function c(u) {
28
29
  const b = {
29
- unit: Fe(u),
30
+ unit: Ce(u),
30
31
  mode: M.UPDATE,
31
32
  show: !0,
32
33
  "onUpdate:show"(s) {
@@ -35,18 +36,18 @@ function nn() {
35
36
  };
36
37
  l.value = b;
37
38
  }
38
- async function S(u) {
39
+ async function k(u) {
39
40
  t.value = !0;
40
41
  try {
41
- await g.deleteSku(u), F.open({
42
+ await g.deleteSku(u), C.open({
42
43
  title: "Success",
43
44
  message: `Deleted ${u.name}`,
44
45
  type: "success"
45
46
  });
46
47
  } catch (b) {
47
- b instanceof Pe && Ne(b) ? A.open({
48
+ b instanceof Te && ze(b) ? A.open({
48
49
  title: "Cannot delete ingredient",
49
- contentComponent: ze,
50
+ contentComponent: Ge,
50
51
  contentComponentProps: {
51
52
  subject: (u == null ? void 0 : u.name) ?? "",
52
53
  items: b.errorResponse.message
@@ -55,7 +56,7 @@ function nn() {
55
56
  text: "Close",
56
57
  close: !0
57
58
  }
58
- }) : console.log("unable to delete ingredient", b), F.open({
59
+ }) : console.log("unable to delete ingredient", b), C.open({
59
60
  title: `Cannot delete ${u.name}`,
60
61
  message: "Please try again.",
61
62
  type: "error"
@@ -78,7 +79,7 @@ function nn() {
78
79
  text: "Cancel",
79
80
  close: !0
80
81
  }
81
- }).onPrimary(() => S(u));
82
+ }).onPrimary(() => k(u));
82
83
  }
83
84
  return {
84
85
  createIngredient: a,
@@ -88,18 +89,18 @@ function nn() {
88
89
  ingredientViewLoading: t
89
90
  };
90
91
  }
91
- function tn({
92
+ function ln({
92
93
  updateIngredient: A,
93
- deleteIngredient: F
94
+ deleteIngredient: C
94
95
  }) {
95
96
  async function g(l, a) {
96
- const c = Fe(a);
97
+ const c = Ce(a);
97
98
  if (l === ee.Edit) {
98
99
  await A(c);
99
100
  return;
100
101
  }
101
102
  if (l === ee.Delete) {
102
- await F(c);
103
+ await C(c);
103
104
  return;
104
105
  }
105
106
  }
@@ -121,7 +122,7 @@ function tn({
121
122
  var a;
122
123
  if (l.trackingMeasurement) {
123
124
  const c = (a = l.unit.measurements) == null ? void 0 : a.find(
124
- (S) => S.id === l.trackingMeasurement
125
+ (k) => k.id === l.trackingMeasurement
125
126
  );
126
127
  if (c)
127
128
  return `${c.name} (${c.abbrev})`;
@@ -136,7 +137,7 @@ function tn({
136
137
  id: "action",
137
138
  header: "",
138
139
  cell(l) {
139
- return Ge(
140
+ return Ye(
140
141
  [ye[ee.Edit], ye[ee.Delete]],
141
142
  (a) => {
142
143
  g(a, l.row.original);
@@ -152,7 +153,7 @@ function tn({
152
153
  }
153
154
  ] };
154
155
  }
155
- const ln = /* @__PURE__ */ te({
156
+ const on = /* @__PURE__ */ te({
156
157
  __name: "ConvertForm",
157
158
  props: {
158
159
  modelValue: {},
@@ -160,14 +161,14 @@ const ln = /* @__PURE__ */ te({
160
161
  disabled: { type: Boolean }
161
162
  },
162
163
  emits: ["update:modelValue"],
163
- setup(A, { emit: F }) {
164
+ setup(A, { emit: C }) {
164
165
  const g = A, t = m(() => {
165
166
  var s;
166
167
  return (s = g.rootValue) == null ? void 0 : s.unit;
167
168
  }), l = m(() => {
168
169
  var s;
169
170
  return (s = g.rootValue) == null ? void 0 : s._id;
170
- }), a = F, c = m({
171
+ }), a = C, c = m({
171
172
  get() {
172
173
  return !!g.modelValue;
173
174
  },
@@ -177,7 +178,7 @@ const ln = /* @__PURE__ */ te({
177
178
  inventoryBindings: []
178
179
  }) : a("update:modelValue", null);
179
180
  }
180
- }), S = m(() => Je(t.value));
181
+ }), k = m(() => Qe(t.value));
181
182
  function U(s) {
182
183
  const v = g.modelValue ?? {};
183
184
  v.measurement = s ? `${s}` : null, a("update:modelValue", v);
@@ -189,18 +190,18 @@ const ln = /* @__PURE__ */ te({
189
190
  const b = m(() => {
190
191
  if (!g.modelValue) return null;
191
192
  const s = g.modelValue;
192
- return s.measurement ? S.value.find((v) => v.value === s.measurement) ?? null : S.value.find((v) => v.value === null) ?? null;
193
+ return s.measurement ? k.value.find((v) => v.value === s.measurement) ?? null : k.value.find((v) => v.value === null) ?? null;
193
194
  });
194
195
  return (s, v) => {
195
- const T = y("FmSwitch"), C = y("FmSelect"), V = y("FmCard");
196
- return k(), P(V, {
196
+ const T = _("FmSwitch"), h = _("FmSelect"), V = _("FmCard");
197
+ return w(), P(V, {
197
198
  variant: "outlined",
198
199
  class: "p-16 flex flex-col gap-16"
199
200
  }, {
200
- default: w(() => {
201
- var R, x;
201
+ default: y(() => {
202
+ var R, I;
202
203
  return [
203
- d(T, {
204
+ r(T, {
204
205
  value: "",
205
206
  "model-value": c.value,
206
207
  "onUpdate:modelValue": v[0] || (v[0] = (E) => c.value = E),
@@ -208,18 +209,18 @@ const ln = /* @__PURE__ */ te({
208
209
  sublabel: "Convertible from other recipe or ingredients",
209
210
  labelPlacement: "right"
210
211
  }, null, 8, ["model-value"]),
211
- c.value ? (k(), J(ne, { key: 0 }, [
212
- I("div", null, [
213
- d(C, {
212
+ c.value ? (w(), J(ne, { key: 0 }, [
213
+ x("div", null, [
214
+ r(h, {
214
215
  label: "Recipes and ingredients convert to",
215
216
  modelValue: (R = b.value) == null ? void 0 : R.value,
216
217
  "onUpdate:modelValue": U,
217
- items: S.value
218
+ items: k.value
218
219
  }, null, 8, ["modelValue", "items"])
219
220
  ]),
220
- d(Qe, {
221
+ r(Xe, {
221
222
  id: l.value,
222
- "model-value": ((x = s.modelValue) == null ? void 0 : x.inventoryBindings) ?? [],
223
+ "model-value": ((I = s.modelValue) == null ? void 0 : I.inventoryBindings) ?? [],
223
224
  "onUpdate:modelValue": u,
224
225
  "exclude-binding-id": l.value
225
226
  }, null, 8, ["id", "model-value", "exclude-binding-id"])
@@ -230,10 +231,10 @@ const ln = /* @__PURE__ */ te({
230
231
  });
231
232
  };
232
233
  }
233
- }), on = { class: "text-fm-color-typo-secondary" }, an = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, un = { class: "col-span-2 mt-16" }, sn = {
234
+ }), an = { class: "text-fm-color-typo-secondary" }, un = { class: "text-fm-color-typo-secondary whitespace-nowrap" }, sn = { class: "col-span-2 mt-16" }, rn = {
234
235
  key: 1,
235
236
  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"
236
- }, rn = /* @__PURE__ */ te({
237
+ }, dn = /* @__PURE__ */ te({
237
238
  __name: "IngredientForm",
238
239
  props: {
239
240
  mode: {},
@@ -241,19 +242,19 @@ const ln = /* @__PURE__ */ te({
241
242
  disabled: { type: Boolean }
242
243
  },
243
244
  emits: ["update:modelValue", "click:submit"],
244
- setup(A, { expose: F, emit: g }) {
245
+ setup(A, { expose: C, emit: g }) {
245
246
  var j;
246
- const t = A, l = g, a = le(), c = en(), S = Te();
247
+ const t = A, l = g, a = le(), c = nn(), k = Be();
247
248
  function U(e) {
248
249
  if (e.length === 0) return;
249
250
  const n = e[0], o = t.modelValue ?? {
250
- unit: a.units.find((r) => r)
251
+ unit: a.units.find((i) => i)
251
252
  };
252
253
  o.unit || (o.unit = n, l("update:modelValue", o));
253
254
  }
254
255
  Ie(() => {
255
256
  U(a.units);
256
- }), xe([() => a.units], ([e]) => {
257
+ }), Ae([() => a.units], ([e]) => {
257
258
  U(e);
258
259
  });
259
260
  function u() {
@@ -285,10 +286,10 @@ const ln = /* @__PURE__ */ te({
285
286
  get() {
286
287
  var n, o;
287
288
  const e = (o = (n = t.modelValue) == null ? void 0 : n.defaultCost) == null ? void 0 : o.costPerUnit;
288
- return e ? +Xe(e) : 0;
289
+ return e ? +Ze(e) : 0;
289
290
  },
290
291
  set(e) {
291
- var o, r, _, p;
292
+ var o, i, F, p;
292
293
  const n = t.modelValue ? {
293
294
  ...t.modelValue
294
295
  } : {};
@@ -298,7 +299,7 @@ const ln = /* @__PURE__ */ te({
298
299
  precision: 2,
299
300
  currency: ((o = fe(c.currentCountry.value)) == null ? void 0 : o.currency) ?? "MYR"
300
301
  },
301
- measurement: (p = (_ = (r = t.modelValue) == null ? void 0 : r.unit) == null ? void 0 : _.measurements) == null ? void 0 : p.find(
302
+ measurement: (p = (F = (i = t.modelValue) == null ? void 0 : i.unit) == null ? void 0 : F.measurements) == null ? void 0 : p.find(
302
303
  (B) => {
303
304
  var O;
304
305
  return B.id === ((O = t.modelValue) == null ? void 0 : O.trackingMeasurement);
@@ -306,22 +307,22 @@ const ln = /* @__PURE__ */ te({
306
307
  )
307
308
  }), n.defaultCost.costPerUnit = {
308
309
  ...n.defaultCost.costPerUnit,
309
- ...Ze(+e, 4)
310
+ ...en(+e, 4)
310
311
  }, l("update:modelValue", n);
311
312
  }
312
313
  }), T = m(() => {
313
- var n, o, r;
314
- const e = ((n = t.modelValue) == null ? void 0 : n.unit) ?? a.units.find((_) => _);
314
+ var n, o, i;
315
+ const e = ((n = t.modelValue) == null ? void 0 : n.unit) ?? a.units.find((F) => F);
315
316
  return e ? {
316
317
  _id: e._id,
317
318
  measurement: (o = t.modelValue) == null ? void 0 : o.trackingMeasurement,
318
- name: ((r = e.measurements.find((_) => {
319
+ name: ((i = e.measurements.find((F) => {
319
320
  var p;
320
- return _.id === ((p = t.modelValue) == null ? void 0 : p.trackingMeasurement);
321
- })) == null ? void 0 : r.name) ?? e.name
321
+ return F.id === ((p = t.modelValue) == null ? void 0 : p.trackingMeasurement);
322
+ })) == null ? void 0 : i.name) ?? e.name
322
323
  } : null;
323
- }), C = m(
324
- () => a.units.flatMap(({ name: e, _id: n, abbrev: o, measurements: r }) => [
324
+ }), h = m(
325
+ () => a.units.flatMap(({ name: e, _id: n, abbrev: o, measurements: i }) => [
325
326
  {
326
327
  label: `${e}`,
327
328
  value: null,
@@ -332,26 +333,26 @@ const ln = /* @__PURE__ */ te({
332
333
  value: { _id: n },
333
334
  displayAsSection: !1
334
335
  },
335
- ...r.map(({ id: _, name: p, abbrev: B }) => ({
336
+ ...i.map(({ id: F, name: p, abbrev: B }) => ({
336
337
  label: `${p} (${B})`,
337
- value: { _id: n, measurement: _ },
338
+ value: { _id: n, measurement: F },
338
339
  displayAsSection: !1
339
340
  }))
340
341
  ])
341
342
  );
342
343
  function V(e) {
343
- var n, o, r, _, p;
344
- return ((o = (n = t.modelValue) == null ? void 0 : n.unit) == null ? void 0 : o._id) === ((r = e.value) == null ? void 0 : r._id) && ((_ = t.modelValue) == null ? void 0 : _.trackingMeasurement) === ((p = e.value) == null ? void 0 : p.measurement);
344
+ var n, o, i, F, p;
345
+ return ((o = (n = t.modelValue) == null ? void 0 : n.unit) == null ? void 0 : o._id) === ((i = e.value) == null ? void 0 : i._id) && ((F = t.modelValue) == null ? void 0 : F.trackingMeasurement) === ((p = e.value) == null ? void 0 : p.measurement);
345
346
  }
346
347
  function R(e) {
347
348
  var B, O;
348
349
  if (!e) return;
349
- const { _id: n, measurement: o } = e, r = o || void 0, _ = a.units.find((K) => K._id === n);
350
- if (!_)
350
+ const { _id: n, measurement: o } = e, i = o || void 0, F = a.units.find((K) => K._id === n);
351
+ if (!F)
351
352
  return;
352
353
  const p = t.modelValue ?? {};
353
- p.unit = _, p.trackingMeasurement = r, p.convert && (p.convert.measurement = r || null), S.enableTotalCost && (p.defaultCost = {
354
- measurement: _.measurements.find((K) => K.id === r),
354
+ p.unit = F, p.trackingMeasurement = i, p.convert && (p.convert.measurement = i || null), k.enableTotalCost && (p.defaultCost = {
355
+ measurement: F.measurements.find((K) => K.id === i),
355
356
  costPerUnit: {
356
357
  ...((B = p.defaultCost) == null ? void 0 : B.costPerUnit) ?? {
357
358
  amount: 0,
@@ -361,7 +362,7 @@ const ln = /* @__PURE__ */ te({
361
362
  }
362
363
  }), l("update:modelValue", p);
363
364
  }
364
- const x = m({
365
+ const I = m({
365
366
  get() {
366
367
  var e;
367
368
  return ((e = t.modelValue) == null ? void 0 : e.convert) ?? null;
@@ -404,7 +405,7 @@ const ln = /* @__PURE__ */ te({
404
405
  n.valuation = e, l("update:modelValue", n);
405
406
  }
406
407
  }), D = L();
407
- F({
408
+ C({
408
409
  validateInputs: () => {
409
410
  var e, n;
410
411
  (n = (e = D.value) == null ? void 0 : e.validateInputs) == null || n.call(e);
@@ -422,20 +423,20 @@ const ln = /* @__PURE__ */ te({
422
423
  () => {
423
424
  var e, n, o;
424
425
  return (e = t.modelValue) != null && e._id ? ((o = a.menu.bindedBySkuId[(n = t.modelValue) == null ? void 0 : n._id]) == null ? void 0 : o.filter(
425
- (r) => r.from === "INGREDIENT"
426
+ (i) => i.from === "INGREDIENT"
426
427
  )) ?? [] : [];
427
428
  }
428
429
  ), q = m(
429
430
  () => {
430
431
  var e, n, o;
431
432
  return (e = t.modelValue) != null && e._id ? ((o = a.menu.bindedBySkuId[(n = t.modelValue) == null ? void 0 : n._id]) == null ? void 0 : o.filter(
432
- (r) => r.from === "RECIPE"
433
+ (i) => i.from === "RECIPE"
433
434
  )) ?? [] : [];
434
435
  }
435
436
  ), W = m(
436
437
  () => {
437
438
  var e, n, o;
438
- return (e = t.modelValue) != null && e._id ? ((o = a.menu.bindedBySkuId[(n = t.modelValue) == null ? void 0 : n._id]) == null ? void 0 : o.filter((r) => r.from === "MENU")) ?? [] : [];
439
+ return (e = t.modelValue) != null && e._id ? ((o = a.menu.bindedBySkuId[(n = t.modelValue) == null ? void 0 : n._id]) == null ? void 0 : o.filter((i) => i.from === "MENU")) ?? [] : [];
439
440
  }
440
441
  ), z = m(
441
442
  () => a.skus.map((e) => ({ label: e.name, value: e.code }))
@@ -458,49 +459,58 @@ const ln = /* @__PURE__ */ te({
458
459
  }
459
460
  }
460
461
  return (e, n) => {
461
- const o = y("FmTextField"), r = y("FmSelect"), _ = y("FmLabel"), p = y("FmField"), B = y("FmMenuHeader"), O = y("FmMenuDivider"), K = y("FmMenuItem"), he = y("FmMenu"), Se = y("FmFormGroup"), ke = y("FmSwitch"), we = y("FmForm");
462
- return k(), P(we, {
462
+ const o = _("FmTextField"), i = _("FmLabel"), F = _("FmSelect"), p = _("FmField"), B = _("FmMenuHeader"), O = _("FmMenuDivider"), K = _("FmMenuItem"), Se = _("FmMenu"), ke = _("FmFormGroup"), we = _("FmSwitch"), Me = _("FmForm");
463
+ return w(), P(Me, {
463
464
  disabled: e.disabled,
464
465
  ref_key: "formRef",
465
466
  ref: D,
466
467
  class: "grid grid-cols-2 gap-24",
467
468
  onValidationSuccess: u
468
469
  }, {
469
- default: w(() => [
470
- d(o, {
470
+ default: y(() => [
471
+ r(o, {
471
472
  label: "Code",
472
473
  "model-value": b.value,
473
474
  "onUpdate:modelValue": n[0] || (n[0] = (f) => b.value = f),
474
- rules: [i(se)(), i(He)(z.value, X.value)],
475
+ rules: [d(se)(), d(je)(z.value, X.value)],
475
476
  "label-mark": "required"
476
477
  }, null, 8, ["model-value", "rules"]),
477
- d(o, {
478
+ r(o, {
478
479
  label: "Name",
479
480
  "model-value": s.value,
480
481
  "onUpdate:modelValue": n[1] || (n[1] = (f) => s.value = f),
481
- rules: [i(se)()],
482
+ rules: [d(se)()],
482
483
  "label-mark": "required"
483
484
  }, null, 8, ["model-value", "rules"]),
484
- d(r, {
485
+ r(F, {
485
486
  class: "col-span-2",
486
487
  "model-value": Q.value,
487
488
  "onUpdate:modelValue": n[2] || (n[2] = (f) => Q.value = f),
488
- label: "Valuation Method",
489
489
  items: E.value
490
- }, null, 8, ["model-value", "items"]),
491
- d(Se, {
492
- class: pe([i(S).enableTotalCost ? "col-span-1" : "col-span-2"]),
490
+ }, {
491
+ label: y(() => [
492
+ r(Fe, { "z-index": 50 }, {
493
+ default: y(() => [
494
+ r(i, { label: "Valuation Method" })
495
+ ]),
496
+ _: 1
497
+ })
498
+ ]),
499
+ _: 1
500
+ }, 8, ["model-value", "items"]),
501
+ r(ke, {
502
+ class: pe([d(k).enableTotalCost ? "col-span-1" : "col-span-2"]),
493
503
  "model-value": T.value,
494
- rules: [i(se)()],
504
+ rules: [d(se)()],
495
505
  "label-mark": "required"
496
506
  }, {
497
- label: w(() => [
498
- d(_, { label: "Unit" })
507
+ label: y(() => [
508
+ r(i, { label: "Unit" })
499
509
  ]),
500
- default: w(({ invalid: f }) => [
501
- d(he, null, {
502
- "menu-button": w(() => [
503
- d(p, {
510
+ default: y(({ invalid: f }) => [
511
+ r(Se, null, {
512
+ "menu-button": y(() => [
513
+ r(p, {
504
514
  class: pe([
505
515
  "fm-typo-en-body-lg-400",
506
516
  {
@@ -511,34 +521,34 @@ const ln = /* @__PURE__ */ te({
511
521
  invalid: f,
512
522
  "append-icon": "expand_more"
513
523
  }, {
514
- default: w(() => {
515
- var h;
524
+ default: y(() => {
525
+ var S;
516
526
  return [
517
- Ae(ae((h = T.value) == null ? void 0 : h.name), 1)
527
+ Ue(ae((S = T.value) == null ? void 0 : S.name), 1)
518
528
  ];
519
529
  }),
520
530
  _: 2
521
531
  }, 1032, ["class", "invalid"])
522
532
  ]),
523
- default: w(() => [
524
- I("div", {
533
+ default: y(() => [
534
+ x("div", {
525
535
  class: "overflow-x-hidden overflow-y-auto max-h-[300px]",
526
536
  onVnodeMounted: Z
527
537
  }, [
528
- (k(!0), J(ne, null, Ue(C.value, (h) => (k(), J(ne, {
529
- key: h.label
538
+ (w(!0), J(ne, null, Ee(h.value, (S) => (w(), J(ne, {
539
+ key: S.label
530
540
  }, [
531
- h.displayAsSection ? (k(), J(ne, { key: 0 }, [
532
- d(B, {
533
- label: h.label
541
+ S.displayAsSection ? (w(), J(ne, { key: 0 }, [
542
+ r(B, {
543
+ label: S.label
534
544
  }, null, 8, ["label"]),
535
- d(O)
536
- ], 64)) : (k(), P(K, {
545
+ r(O)
546
+ ], 64)) : (w(), P(K, {
537
547
  key: 1,
538
- label: h.label,
539
- "model-value": V(h),
540
- onClick: (oe) => R(h.value),
541
- "x-should-scroll-into": `${V(h)}`
548
+ label: S.label,
549
+ "model-value": V(S),
550
+ onClick: (oe) => R(S.value),
551
+ "x-should-scroll-into": `${V(S)}`
542
552
  }, null, 8, ["label", "model-value", "onClick", "x-should-scroll-into"]))
543
553
  ], 64))), 128))
544
554
  ], 512)
@@ -548,57 +558,64 @@ const ln = /* @__PURE__ */ te({
548
558
  ]),
549
559
  _: 1
550
560
  }, 8, ["class", "model-value", "rules"]),
551
- i(S).enableTotalCost ? (k(), P(o, {
561
+ d(k).enableTotalCost ? (w(), P(o, {
552
562
  key: 0,
553
- label: "Price per unit",
554
563
  "model-value": v.value,
555
564
  "onUpdate:modelValue": n[3] || (n[3] = (f) => v.value = f),
556
- rules: [i(je)(0), i(Ke)(2)]
565
+ rules: [d(Ke)(0), d(Je)(2)]
557
566
  }, {
558
- prepend: w(() => {
559
- var f, h;
567
+ label: y(() => [
568
+ r(Fe, { "z-index": 50 }, {
569
+ default: y(() => [
570
+ r(i, { label: "Price per unit" })
571
+ ]),
572
+ _: 1
573
+ })
574
+ ]),
575
+ prepend: y(() => {
576
+ var f, S;
560
577
  return [
561
- I("div", on, ae(H(((f = i(c).currentCountry) == null ? void 0 : f.value) ?? i(ge)) === "MYR" ? "RM" : H(((h = i(c).currentCountry) == null ? void 0 : h.value) ?? i(ge))), 1)
578
+ x("div", an, ae(H(((f = d(c).currentCountry) == null ? void 0 : f.value) ?? d(ge)) === "MYR" ? "RM" : H(((S = d(c).currentCountry) == null ? void 0 : S.value) ?? d(ge))), 1)
562
579
  ];
563
580
  }),
564
- append: w(() => {
565
- var f, h, oe, ie, de, me;
581
+ append: y(() => {
582
+ var f, S, oe, ie, de, me;
566
583
  return [
567
- I("div", an, " / " + ae(((ie = (oe = (h = (f = e.modelValue) == null ? void 0 : f.unit) == null ? void 0 : h.measurements) == null ? void 0 : oe.find((Me) => {
584
+ x("div", un, " / " + ae(((ie = (oe = (S = (f = e.modelValue) == null ? void 0 : f.unit) == null ? void 0 : S.measurements) == null ? void 0 : oe.find((xe) => {
568
585
  var ce;
569
- return Me.id === ((ce = e.modelValue) == null ? void 0 : ce.trackingMeasurement);
586
+ return xe.id === ((ce = e.modelValue) == null ? void 0 : ce.trackingMeasurement);
570
587
  })) == null ? void 0 : ie.abbrev) ?? ((me = (de = e.modelValue) == null ? void 0 : de.unit) == null ? void 0 : me.abbrev)), 1)
571
588
  ];
572
589
  }),
573
590
  _: 1
574
591
  }, 8, ["model-value", "rules"])) : G("", !0),
575
- I("div", un, [
576
- d(ln, {
577
- "model-value": x.value,
578
- "onUpdate:modelValue": n[4] || (n[4] = (f) => x.value = f),
592
+ x("div", sn, [
593
+ r(on, {
594
+ "model-value": I.value,
595
+ "onUpdate:modelValue": n[4] || (n[4] = (f) => I.value = f),
579
596
  "root-value": e.modelValue
580
597
  }, null, 8, ["model-value", "root-value"])
581
598
  ]),
582
- e.mode !== i(M).CREATE ? (k(), J("div", sn, [
583
- I("div", null, [
584
- d(ke, {
599
+ e.mode !== d(M).CREATE ? (w(), J("div", rn, [
600
+ x("div", null, [
601
+ r(we, {
585
602
  label: "Show binded items",
586
603
  modelValue: $.value,
587
604
  "onUpdate:modelValue": n[5] || (n[5] = (f) => $.value = f),
588
605
  "label-placement": "right"
589
606
  }, null, 8, ["modelValue"])
590
607
  ]),
591
- $.value && Y.value.length ? (k(), P(re, {
608
+ $.value && Y.value.length ? (w(), P(re, {
592
609
  key: 0,
593
610
  name: "Ingredient",
594
611
  bindings: Y.value
595
612
  }, null, 8, ["bindings"])) : G("", !0),
596
- $.value && q.value.length ? (k(), P(re, {
613
+ $.value && q.value.length ? (w(), P(re, {
597
614
  key: 1,
598
615
  name: "Recipe",
599
616
  bindings: q.value
600
617
  }, null, 8, ["bindings"])) : G("", !0),
601
- $.value && W.value.length ? (k(), P(re, {
618
+ $.value && W.value.length ? (w(), P(re, {
602
619
  key: 2,
603
620
  name: "Menu",
604
621
  bindings: W.value
@@ -609,7 +626,7 @@ const ln = /* @__PURE__ */ te({
609
626
  }, 8, ["disabled"]);
610
627
  };
611
628
  }
612
- }), dn = { class: "flex gap-4" }, mn = /* @__PURE__ */ te({
629
+ }), mn = { class: "flex gap-4" }, cn = /* @__PURE__ */ te({
613
630
  __name: "IngredientDialog",
614
631
  props: {
615
632
  show: { type: Boolean },
@@ -618,8 +635,8 @@ const ln = /* @__PURE__ */ te({
618
635
  },
619
636
  emits: ["update:show"],
620
637
  setup(A) {
621
- const F = A, g = le(), t = Ce(), l = Ve(F, "show"), a = Ve(F, "unit"), c = m(() => {
622
- switch (F.mode) {
638
+ const C = A, g = le(), t = he(), l = Ve(C, "show"), a = Ve(C, "unit"), c = m(() => {
639
+ switch (C.mode) {
623
640
  case M.READ:
624
641
  return "View ingredient";
625
642
  case M.UPDATE:
@@ -628,8 +645,8 @@ const ln = /* @__PURE__ */ te({
628
645
  return "Add ingredient";
629
646
  }
630
647
  return "";
631
- }), S = m(() => {
632
- switch (F.mode) {
648
+ }), k = m(() => {
649
+ switch (C.mode) {
633
650
  case M.READ:
634
651
  return "";
635
652
  case M.UPDATE:
@@ -647,8 +664,8 @@ const ln = /* @__PURE__ */ te({
647
664
  message: "Created " + a.value.name,
648
665
  type: "success"
649
666
  });
650
- } catch (C) {
651
- C instanceof be || t.open({
667
+ } catch (h) {
668
+ h instanceof be || t.open({
652
669
  title: "Failed to create ingredient",
653
670
  message: "Please try again",
654
671
  type: "error"
@@ -665,8 +682,8 @@ const ln = /* @__PURE__ */ te({
665
682
  message: "Updated " + a.value.name,
666
683
  type: "success"
667
684
  });
668
- } catch (C) {
669
- C instanceof be || t.open({
685
+ } catch (h) {
686
+ h instanceof be || t.open({
670
687
  title: "Failed to update ingredient",
671
688
  message: "Please try again",
672
689
  type: "error"
@@ -676,11 +693,11 @@ const ln = /* @__PURE__ */ te({
676
693
  }
677
694
  }
678
695
  function v() {
679
- var C, V;
680
- (V = (C = U.value) == null ? void 0 : C.validateInputs) == null || V.call(C);
696
+ var h, V;
697
+ (V = (h = U.value) == null ? void 0 : h.validateInputs) == null || V.call(h);
681
698
  }
682
699
  function T() {
683
- switch (F.mode) {
700
+ switch (C.mode) {
684
701
  case M.READ:
685
702
  return;
686
703
  case M.UPDATE:
@@ -689,24 +706,24 @@ const ln = /* @__PURE__ */ te({
689
706
  return b();
690
707
  }
691
708
  }
692
- return (C, V) => {
693
- const R = y("FmButton"), x = y("FmSideSheet");
694
- return k(), P(x, {
695
- "model-value": i(l),
709
+ return (h, V) => {
710
+ const R = _("FmButton"), I = _("FmSideSheet");
711
+ return w(), P(I, {
712
+ "model-value": d(l),
696
713
  "onUpdate:modelValue": V[3] || (V[3] = (E) => ve(l) ? l.value = E : null),
697
714
  header: c.value,
698
715
  "close-button": "",
699
716
  "dismiss-away": "",
700
717
  "max-width": 500
701
718
  }, {
702
- "side-sheet-footer": w(() => [
703
- I("div", dn, [
704
- d(R, {
719
+ "side-sheet-footer": y(() => [
720
+ x("div", mn, [
721
+ r(R, {
705
722
  loading: u.value,
706
- label: S.value,
723
+ label: k.value,
707
724
  onClick: v
708
725
  }, null, 8, ["loading", "label"]),
709
- d(R, {
726
+ r(R, {
710
727
  disabled: u.value,
711
728
  label: "Close",
712
729
  variant: "tertiary",
@@ -714,14 +731,14 @@ const ln = /* @__PURE__ */ te({
714
731
  }, null, 8, ["disabled"])
715
732
  ])
716
733
  ]),
717
- default: w(() => [
718
- d(rn, {
734
+ default: y(() => [
735
+ r(dn, {
719
736
  class: "w-full",
720
737
  ref_key: "hasValidationExpose",
721
738
  ref: U,
722
- modelValue: i(a),
739
+ modelValue: d(a),
723
740
  "onUpdate:modelValue": V[0] || (V[0] = (E) => ve(a) ? a.value = E : null),
724
- mode: C.mode,
741
+ mode: h.mode,
725
742
  disabled: u.value,
726
743
  "onClick:submit": V[1] || (V[1] = (E) => T())
727
744
  }, null, 8, ["modelValue", "mode", "disabled"])
@@ -730,64 +747,64 @@ const ln = /* @__PURE__ */ te({
730
747
  }, 8, ["model-value", "header"]);
731
748
  };
732
749
  }
733
- }), cn = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, pn = { class: "px-8 flex items-center xs:gap-0 xs:flex-col-reverse sm:gap-0 sm:flex-col-reverse" }, vn = { class: "flex-1 w-full" }, fn = { class: "flex flex-col py-8" }, gn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, bn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Un = /* @__PURE__ */ te({
750
+ }), pn = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, vn = { class: "px-8 flex items-center xs:gap-0 xs:flex-col-reverse sm:gap-0 sm:flex-col-reverse" }, fn = { class: "flex-1 w-full" }, gn = { class: "flex flex-col py-8" }, bn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Rn = /* @__PURE__ */ te({
734
751
  __name: "IngredientsView",
735
752
  setup(A) {
736
- const F = le(), g = m(() => F.skus), t = Be(), {
753
+ const C = le(), g = m(() => C.skus), t = Le(), {
737
754
  createIngredient: l,
738
755
  updateIngredient: a,
739
756
  deleteIngredient: c,
740
- ingredientDialogProps: S,
757
+ ingredientDialogProps: k,
741
758
  ingredientViewLoading: U
742
- } = nn(), { columnDefs: u } = tn({ updateIngredient: a, deleteIngredient: c });
759
+ } = tn(), { columnDefs: u } = ln({ updateIngredient: a, deleteIngredient: c });
743
760
  function b(R) {
744
761
  R === "add" && l();
745
762
  }
746
- const s = L(""), v = m(() => U.value), { breakpoints: T } = Oe(), C = m(() => T.value.xs || T.value.sm ? 10 : 20), V = qe();
747
- return (R, x) => {
748
- const E = y("FmTableToolbar"), Q = y("FmTable");
749
- return k(), P(We, {
763
+ const s = L(""), v = m(() => U.value), { breakpoints: T } = Ne(), h = m(() => T.value.xs || T.value.sm ? 10 : 20), V = We();
764
+ return (R, I) => {
765
+ const E = _("FmTableToolbar"), Q = _("FmTable");
766
+ return w(), P(He, {
750
767
  title: "Ingredient",
751
768
  actions: [{ label: "Add ingredient", value: "add", isPrimary: !0, prependIcon: "add" }],
752
769
  "onClick:action": b
753
770
  }, {
754
- default: w(() => [
755
- I("div", cn, [
756
- I("div", pn, [
757
- I("div", vn, [
758
- d(E, {
771
+ default: y(() => [
772
+ x("div", pn, [
773
+ x("div", vn, [
774
+ x("div", fn, [
775
+ r(E, {
759
776
  searchable: "",
760
777
  "search-model": s.value,
761
- "onUpdate:searchModel": x[0] || (x[0] = (D) => s.value = D)
778
+ "onUpdate:searchModel": I[0] || (I[0] = (D) => s.value = D)
762
779
  }, null, 8, ["search-model"])
763
780
  ])
764
781
  ]),
765
- d(Q, {
766
- style: Ee(i(V).tableHeight),
767
- "column-defs": i(u),
782
+ r(Q, {
783
+ style: Re(d(V).tableHeight),
784
+ "column-defs": d(u),
768
785
  "row-data": g.value,
769
786
  "search-value": s.value,
770
- loading: !i(t)._currentLocation || v.value,
771
- onRowClick: x[1] || (x[1] = (D) => i(a)(D.original)),
772
- "page-size": C.value
787
+ loading: !d(t)._currentLocation || v.value,
788
+ onRowClick: I[1] || (I[1] = (D) => d(a)(D.original)),
789
+ "page-size": h.value
773
790
  }, {
774
- "list-row": w((D) => [
775
- d(Ye, {
791
+ "list-row": y((D) => [
792
+ r(qe, {
776
793
  row: D,
777
- onRowClick: i(a)
794
+ onRowClick: d(a)
778
795
  }, {
779
- default: w(($) => {
796
+ default: y(($) => {
780
797
  var Y, q, W, z, X, Z, H, j, e, n;
781
798
  return [
782
- I("div", fn, [
783
- I("div", gn, [
784
- d(i(_e), {
799
+ x("div", gn, [
800
+ x("div", bn, [
801
+ r(d(_e), {
785
802
  render: (W = (q = (Y = $.code) == null ? void 0 : Y.column) == null ? void 0 : q.columnDef) == null ? void 0 : W.cell,
786
803
  props: (X = (z = $.code) == null ? void 0 : z.getContext) == null ? void 0 : X.call(z)
787
804
  }, null, 8, ["render", "props"])
788
805
  ]),
789
- I("div", bn, [
790
- d(i(_e), {
806
+ x("div", Vn, [
807
+ r(d(_e), {
791
808
  render: (j = (H = (Z = $.name) == null ? void 0 : Z.column) == null ? void 0 : H.columnDef) == null ? void 0 : j.cell,
792
809
  props: (n = (e = $.name) == null ? void 0 : e.getContext) == null ? void 0 : n.call(e)
793
810
  }, null, 8, ["render", "props"])
@@ -801,8 +818,8 @@ const ln = /* @__PURE__ */ te({
801
818
  _: 1
802
819
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
803
820
  ]),
804
- (k(), P(Re, { to: "body" }, [
805
- d(mn, De($e(i(S))), null, 16)
821
+ (w(), P(De, { to: "body" }, [
822
+ r(cn, $e(Pe(d(k))), null, 16)
806
823
  ]))
807
824
  ]),
808
825
  _: 1
@@ -811,5 +828,5 @@ const ln = /* @__PURE__ */ te({
811
828
  }
812
829
  });
813
830
  export {
814
- Un as default
831
+ Rn as default
815
832
  };