@feedmepos/mf-inventory-portal 0.0.23-dev.38 → 0.0.23-dev.40

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/{App-DQgtWkQj.js → App-D8DXxTIq.js} +2 -2
  2. package/dist/{ApprovalView-CvSK9fGA.js → ApprovalView-BWGXkHV6.js} +2 -2
  3. package/dist/{BindingsDialog-BAC0_xCP.js → BindingsDialog-D7WypDot.js} +2 -2
  4. package/dist/{BindingsPicker-ecWMwsNp.js → BindingsPicker-DUlGwkwM.js} +1 -1
  5. package/dist/{BindingsTable-D5kQydOU.js → BindingsTable-BjeZYCaJ.js} +1 -1
  6. package/dist/{ClosingDraftView-CnHQ59rX.js → ClosingDraftView-o2LEUfo8.js} +2 -2
  7. package/dist/{ClosingTemplateView-vRTsVZ0c.js → ClosingTemplateView-Dt983Cg4.js} +1 -1
  8. package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-Dc_7IyBG.js +142 -0
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CpIzIvkU.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-wocPyZls.js} +3 -3
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CNzEHF-R.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DzoEp-Pg.js} +1 -1
  11. package/dist/{IngredientGroupView-BLsABZ3h.js → IngredientGroupView-CIPpIpv1.js} +1 -1
  12. package/dist/IngredientsView-CFV3kX7Q.js +1707 -0
  13. package/dist/{IntegrationView-BqAqngtM.js → IntegrationView-DkW32m-t.js} +1 -1
  14. package/dist/{InventoryBindingForm-D54V_qZQ.js → InventoryBindingForm-B4CBet9W.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-KIW9J7Xn.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DpdDVf6O.js} +3 -3
  16. package/dist/{InventoryBindingSummary-htT7GNto.js → InventoryBindingSummary-75ImZtqK.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BlEgALMj.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DfpG3Fy8.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DHbxXDGy.js → PremiumBadge.vue_vue_type_script_setup_true_lang-B4d0c3nk.js} +1 -1
  19. package/dist/{PurchaseOrderPrintPreview-hmzxKuIa.js → PurchaseOrderPrintPreview-BYO0JcQW.js} +1 -1
  20. package/dist/{ReceiveRequestView-_YioyWqU.js → ReceiveRequestView-cFLNExw9.js} +182 -182
  21. package/dist/RecipeView-CjfpaHaT.js +609 -0
  22. package/dist/{StockView-R4cnEbHQ.js → StockView-HMtD9qar.js} +8 -8
  23. package/dist/{SupplierView-CevGG507.js → SupplierView-Cidfe-Xm.js} +4 -4
  24. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CeWP9msS.js → TransferDetails.vue_vue_type_script_setup_true_lang-CdU3HPBC.js} +4 -4
  25. package/dist/{TransferTemplateView-QDniAq8o.js → TransferTemplateView-Doxr1fXP.js} +6 -6
  26. package/dist/{UnitView-SjwJ3lZ0.js → UnitView-C1af71aM.js} +228 -223
  27. package/dist/{WarehouseView-55LiPQXG.js → WarehouseView-CviOLXfX.js} +1 -1
  28. package/dist/{app-UTiudUUR.js → app-BE8SgDqI.js} +92 -93
  29. package/dist/app.js +1 -1
  30. package/dist/{decimal-tyBgHJ47.js → decimal-xj3kVOP6.js} +1 -1
  31. package/dist/{feature-z7inw9y6.js → feature-CWpNYcWJ.js} +1 -1
  32. package/dist/{format-unit-display-DN0KtCh2.js → format-unit-display-CZ835oaL.js} +2 -2
  33. package/dist/{index-Dj2Ccgp1.js → index-B8IWDKYv.js} +3 -3
  34. package/dist/{index-DlhdTaa8.js → index-C6SzYqK7.js} +1 -1
  35. package/dist/{stock-CxRxidDu.js → stock-C2xyYnS7.js} +1 -1
  36. package/dist/{supplier-BhyiTwSJ.js → supplier-B-7o9hg1.js} +1 -1
  37. package/dist/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/{use-inventory-binding-dialog-DwSvUvRl.js → use-inventory-binding-dialog-Dm8Ky1MH.js} +1 -1
  39. package/package.json +3 -3
  40. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-DBhBaRrd.js +0 -51
  41. package/dist/IngredientsView-Cs4TIf6V.js +0 -1794
  42. package/dist/RecipeView-88KJ0nvU.js +0 -591
@@ -1,39 +1,39 @@
1
- import { defineComponent as G, computed as _, openBlock as v, createElementBlock as w, createElementVNode as l, Fragment as q, renderList as H, toDisplayString as V, createCommentVNode as Y, ref as M, resolveComponent as I, createBlock as T, withCtx as R, createVNode as y, unref as a, isRef as Z, normalizeClass as ae, normalizeStyle as re, Teleport as ie, normalizeProps as ue, guardReactiveProps as de } from "vue";
2
- import { a as K, d as U, S as me, f as ce, D as ee, h as N, e as oe, l as j, A as pe, i as J, L as fe, N as ve, o as te, u as ye, y as be, z as ge, B as xe, E as _e, G as he } from "./app-UTiudUUR.js";
3
- import { useDialog as Ve, useSnackbar as le, useProxiedModel as ne, useBreakpoints as Ue } from "@feedmepos/ui-library";
4
- import { i as we, _ as Ce } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
- import { defineStore as ke, storeToRefs as Se } from "pinia";
6
- import { useI18n as O } from "@feedmepos/mf-common";
7
- import { F as Fe } from "./decimal-tyBgHJ47.js";
8
- import { _ as $e } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BlEgALMj.js";
9
- const Ee = { class: "flex flex-col gap-8" }, Ie = {
1
+ import { defineComponent as H, computed as g, openBlock as v, createElementBlock as C, createElementVNode as l, Fragment as j, renderList as q, toDisplayString as V, createCommentVNode as Y, ref as M, resolveComponent as $, createBlock as T, withCtx as A, createVNode as y, unref as o, isRef as ee, normalizeClass as re, normalizeStyle as ie, Teleport as ue, normalizeProps as de, guardReactiveProps as me } from "vue";
2
+ import { a as G, d as w, S as ce, f as pe, D as te, h as L, e as le, l as N, A as fe, i as J, L as ve, N as ye, o as ne, u as be, b as ge, y as xe, z as _e, B as he, E as Ve, G as Ue } from "./app-BE8SgDqI.js";
3
+ import { useDialog as we, useSnackbar as se, useProxiedModel as oe, useBreakpoints as Ce } from "@feedmepos/ui-library";
4
+ import { i as Se, _ as ke } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
+ import { defineStore as Ee, storeToRefs as Fe } from "pinia";
6
+ import { useI18n as K } from "@feedmepos/mf-common";
7
+ import { F as $e } from "./decimal-xj3kVOP6.js";
8
+ import { _ as Ie } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DfpG3Fy8.js";
9
+ const De = { class: "flex flex-col gap-8" }, Ae = {
10
10
  key: 0,
11
11
  class: "flex flex-col"
12
- }, De = { class: "flex-1 py-8 px-16" }, Ae = {
12
+ }, Re = { class: "flex-1 py-8 px-16" }, Me = {
13
13
  class: "flex-0 py-8 px-16",
14
14
  style: { "flex-basis": "240px" }
15
- }, Re = {
15
+ }, Pe = {
16
16
  key: 1,
17
17
  class: "flex flex-col"
18
- }, Me = { class: "flex-1 py-8 px-16" }, Pe = {
18
+ }, Te = { class: "flex-1 py-8 px-16" }, Be = {
19
19
  class: "flex-0 py-8 px-16",
20
20
  style: { "flex-basis": "240px" }
21
- }, Te = {
21
+ }, ze = {
22
22
  key: 2,
23
23
  class: "flex flex-col"
24
- }, Be = { class: "flex-1 py-8 px-16" }, ze = {
24
+ }, Le = { class: "flex-1 py-8 px-16" }, Ne = {
25
25
  class: "flex-0 py-8 px-16",
26
26
  style: { "flex-basis": "240px" }
27
- }, Le = /* @__PURE__ */ G({
27
+ }, je = /* @__PURE__ */ H({
28
28
  __name: "UnitUsedBy",
29
29
  props: {
30
30
  unit: {}
31
31
  },
32
32
  setup(k) {
33
- const f = k, b = K(), i = _(() => b.validateUnitUsage(f.unit)), r = _(() => i.value.filter((c) => c.from === "INGREDIENT")), o = _(() => i.value.filter((c) => c.from === "RECIPE")), m = _(() => i.value.filter((c) => c.from === "MENU"));
34
- return (c, p) => (v(), w("div", Ee, [
33
+ const f = k, b = G(), i = g(() => b.validateUnitUsage(f.unit)), r = g(() => i.value.filter((c) => c.from === "INGREDIENT")), s = g(() => i.value.filter((c) => c.from === "RECIPE")), d = g(() => i.value.filter((c) => c.from === "MENU"));
34
+ return (c, p) => (v(), C("div", De, [
35
35
  p[3] || (p[3] = l("div", { class: "fm-typo-en-body-md-400" }, "Sorry, this unit is used in the following modules:", -1)),
36
- r.value.length ? (v(), w("div", Ie, [
36
+ r.value.length ? (v(), C("div", Ae, [
37
37
  p[0] || (p[0] = l("div", { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, [
38
38
  l("div", { class: "flex-1 py-8 px-16" }, "Ingredient"),
39
39
  l("div", {
@@ -41,18 +41,18 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
41
41
  style: { "flex-basis": "240px" }
42
42
  }, "Used in")
43
43
  ], -1)),
44
- (v(!0), w(q, null, H(r.value, (s) => {
44
+ (v(!0), C(j, null, q(r.value, (a) => {
45
45
  var n;
46
- return v(), w("div", {
47
- key: s.code,
46
+ return v(), C("div", {
47
+ key: a.code,
48
48
  class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
49
49
  }, [
50
- l("div", De, V(s.code) + " " + V(s.name), 1),
51
- l("div", Ae, V((n = s.bindedIngredient) != null && n.length ? "Convert binding" : "Item unit"), 1)
50
+ l("div", Re, V(a.code) + " " + V(a.name), 1),
51
+ l("div", Me, V((n = a.bindedIngredient) != null && n.length ? "Convert binding" : "Item unit"), 1)
52
52
  ]);
53
53
  }), 128))
54
54
  ])) : Y("", !0),
55
- o.value.length ? (v(), w("div", Re, [
55
+ s.value.length ? (v(), C("div", Pe, [
56
56
  p[1] || (p[1] = l("div", { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, [
57
57
  l("div", { class: "flex-1 py-8 px-16" }, "Recipe"),
58
58
  l("div", {
@@ -60,18 +60,18 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
60
60
  style: { "flex-basis": "240px" }
61
61
  }, "Used in")
62
62
  ], -1)),
63
- (v(!0), w(q, null, H(o.value, (s) => {
64
- var n, u, g;
65
- return v(), w("div", {
66
- key: s.code,
63
+ (v(!0), C(j, null, q(s.value, (a) => {
64
+ var n, u, x;
65
+ return v(), C("div", {
66
+ key: a.code,
67
67
  class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
68
68
  }, [
69
- l("div", Me, V(s.code) + " " + V(s.name), 1),
70
- l("div", Pe, V((n = s.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((x) => x.code).join(", ")) + " " + V(s.bindedIngredient && ((u = s.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((g = s.bindedIngredient) == null ? void 0 : g.length) - 3} more` : ""), 1)
69
+ l("div", Te, V(a.code) + " " + V(a.name), 1),
70
+ l("div", Be, V((n = a.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((_) => _.code).join(", ")) + " " + V(a.bindedIngredient && ((u = a.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((x = a.bindedIngredient) == null ? void 0 : x.length) - 3} more` : ""), 1)
71
71
  ]);
72
72
  }), 128))
73
73
  ])) : Y("", !0),
74
- m.value.length ? (v(), w("div", Te, [
74
+ d.value.length ? (v(), C("div", ze, [
75
75
  p[2] || (p[2] = l("div", { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, [
76
76
  l("div", { class: "flex-1 py-8 px-16" }, "Menu"),
77
77
  l("div", {
@@ -79,42 +79,42 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
79
79
  style: { "flex-basis": "240px" }
80
80
  }, "Used in")
81
81
  ], -1)),
82
- (v(!0), w(q, null, H(m.value, (s) => {
83
- var n, u, g;
84
- return v(), w("div", {
85
- key: s.code,
82
+ (v(!0), C(j, null, q(d.value, (a) => {
83
+ var n, u, x;
84
+ return v(), C("div", {
85
+ key: a.code,
86
86
  class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
87
87
  }, [
88
- l("div", Be, V(s.code) + " " + V(s.name), 1),
89
- l("div", ze, V((n = s.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((x) => x.code).join(", ")) + " " + V(s.bindedIngredient && ((u = s.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((g = s.bindedIngredient) == null ? void 0 : g.length) - 3} more` : ""), 1)
88
+ l("div", Le, V(a.code) + " " + V(a.name), 1),
89
+ l("div", Ne, V((n = a.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((_) => _.code).join(", ")) + " " + V(a.bindedIngredient && ((u = a.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((x = a.bindedIngredient) == null ? void 0 : x.length) - 3} more` : ""), 1)
90
90
  ]);
91
91
  }), 128))
92
92
  ])) : Y("", !0)
93
93
  ]));
94
94
  }
95
- }), Q = ke("unitForm", function() {
96
- const f = Ve(), b = le(), i = K(), r = M(!1), o = M();
97
- function m() {
95
+ }), Q = Ee("unitForm", function() {
96
+ const f = we(), b = se(), i = G(), r = M(!1), s = M();
97
+ function d() {
98
98
  const n = {
99
99
  unit: {},
100
- mode: U.CREATE,
100
+ mode: w.CREATE,
101
101
  show: !0,
102
102
  "onUpdate:show"(u) {
103
- o.value.show = u;
103
+ s.value.show = u;
104
104
  }
105
105
  };
106
- o.value = n;
106
+ s.value = n;
107
107
  }
108
108
  async function c(n) {
109
109
  const u = {
110
110
  unit: n,
111
- mode: U.UPDATE,
111
+ mode: w.UPDATE,
112
112
  show: !0,
113
- "onUpdate:show"(g) {
114
- o.value.show = g;
113
+ "onUpdate:show"(x) {
114
+ s.value.show = x;
115
115
  }
116
116
  };
117
- o.value = u;
117
+ s.value = u;
118
118
  }
119
119
  async function p(n) {
120
120
  r.value = !0;
@@ -125,9 +125,9 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
125
125
  type: "success"
126
126
  });
127
127
  } catch (u) {
128
- u instanceof me && we(u) ? f.open({
128
+ u instanceof ce && Se(u) ? f.open({
129
129
  title: "Cannot delete unit",
130
- contentComponent: Ce,
130
+ contentComponent: ke,
131
131
  contentComponentProps: {
132
132
  subject: (n == null ? void 0 : n.name) ?? "",
133
133
  items: u.errorResponse.message
@@ -145,14 +145,14 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
145
145
  r.value = !1;
146
146
  }
147
147
  }
148
- function s(n) {
148
+ function a(n) {
149
149
  if (i.validateUnitUsage(n).length) {
150
150
  f.open({
151
151
  title: `Cannot delete ${(n == null ? void 0 : n.name) ?? "unit"}`,
152
152
  overlay: !0,
153
153
  dismissAway: !0,
154
154
  closeButton: !0,
155
- contentComponent: Le,
155
+ contentComponent: je,
156
156
  contentComponentProps: {
157
157
  unit: n
158
158
  },
@@ -179,22 +179,22 @@ const Ee = { class: "flex flex-col gap-8" }, Ie = {
179
179
  }).onPrimary(() => p(n));
180
180
  }
181
181
  return {
182
- createUnit: m,
182
+ createUnit: d,
183
183
  updateUnit: c,
184
- deleteUnit: s,
185
- unitDialogProps: o,
184
+ deleteUnit: a,
185
+ unitDialogProps: s,
186
186
  unitViewLoading: r
187
187
  };
188
188
  });
189
- function Ne() {
190
- const { updateUnit: k, deleteUnit: f } = Q(), { t: b } = O();
191
- async function i(o, m) {
192
- const c = oe(m);
193
- if (o === N.Edit) {
189
+ function qe() {
190
+ const { updateUnit: k, deleteUnit: f } = Q(), { t: b } = K();
191
+ async function i(s, d) {
192
+ const c = le(d);
193
+ if (s === L.Edit) {
194
194
  await k(c);
195
195
  return;
196
196
  }
197
- if (o === N.Delete) {
197
+ if (s === L.Delete) {
198
198
  await f(c);
199
199
  return;
200
200
  }
@@ -215,11 +215,11 @@ function Ne() {
215
215
  {
216
216
  id: "action",
217
217
  header: "",
218
- cell(o) {
219
- return ce(
220
- [ee[N.Edit], ee[N.Delete]],
221
- (m) => {
222
- i(m, o.row.original);
218
+ cell(s) {
219
+ return pe(
220
+ [te[L.Edit], te[L.Delete]],
221
+ (d) => {
222
+ i(d, s.row.original);
223
223
  }
224
224
  );
225
225
  },
@@ -232,7 +232,7 @@ function Ne() {
232
232
  }
233
233
  ] };
234
234
  }
235
- const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He = { class: "flex-1" }, Ge = { class: "flex-1" }, Ke = { class: "flex" }, Oe = { class: "flex items-center" }, Ye = { class: "fm-typo-en-body-lg-600 flex-grow" }, Je = { class: "flex flex-col gap-24" }, Qe = { class: "flex gap-24" }, We = { class: "flex-1" }, Xe = { class: "flex-1" }, Ze = /* @__PURE__ */ G({
235
+ const He = { class: "flex flex-col gap-24" }, Ge = { class: "flex gap-24" }, Ke = { class: "flex-1" }, Oe = { class: "flex-1" }, Ye = { class: "flex" }, Je = { class: "flex items-center" }, Qe = { class: "fm-typo-en-body-lg-600 flex-grow" }, We = { class: "flex flex-col gap-24" }, Xe = { class: "flex gap-24" }, Ze = { class: "flex-1" }, et = { class: "flex-1" }, tt = /* @__PURE__ */ H({
236
236
  __name: "UnitForm",
237
237
  props: {
238
238
  mode: {},
@@ -241,11 +241,11 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
241
241
  },
242
242
  emits: ["update:modelValue", "click:submit"],
243
243
  setup(k, { expose: f, emit: b }) {
244
- const i = k, r = b, { t: o } = O();
245
- function m() {
244
+ const i = k, r = b, { t: s } = K();
245
+ function d() {
246
246
  r("click:submit");
247
247
  }
248
- const c = _({
248
+ const c = g({
249
249
  get() {
250
250
  var e;
251
251
  return ((e = i.modelValue) == null ? void 0 : e.name) ?? "";
@@ -254,7 +254,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
254
254
  const t = i.modelValue ?? {};
255
255
  t.name = e, r("update:modelValue", t);
256
256
  }
257
- }), p = _({
257
+ }), p = g({
258
258
  get() {
259
259
  var e;
260
260
  return ((e = i.modelValue) == null ? void 0 : e.abbrev) ?? "";
@@ -263,7 +263,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
263
263
  const t = i.modelValue ?? {};
264
264
  t.abbrev = e, r("update:modelValue", t);
265
265
  }
266
- }), s = _({
266
+ }), a = g({
267
267
  get() {
268
268
  var e;
269
269
  return ((e = i.modelValue) == null ? void 0 : e.precision) ?? 0;
@@ -272,7 +272,7 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
272
272
  const t = i.modelValue ?? {};
273
273
  t.precision = e, r("update:modelValue", t);
274
274
  }
275
- }), n = _({
275
+ }), n = g({
276
276
  get() {
277
277
  var e;
278
278
  return ((e = i.modelValue) == null ? void 0 : e.measurements) ?? [];
@@ -297,137 +297,137 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
297
297
  }
298
298
  ], r("update:modelValue", e);
299
299
  }
300
- function g(e) {
301
- const t = i.modelValue ?? {}, d = t.measurements ?? [];
302
- d.splice(e, 1), t.measurements = d, r("update:modelValue", t);
300
+ function x(e) {
301
+ const t = i.modelValue ?? {}, m = t.measurements ?? [];
302
+ m.splice(e, 1), t.measurements = m, r("update:modelValue", t);
303
303
  }
304
- const x = M();
304
+ const _ = M();
305
305
  return f({
306
306
  validateInputs: () => {
307
307
  var e, t;
308
- (t = (e = x.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
308
+ (t = (e = _.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
309
309
  },
310
310
  resetInputsValidation: () => {
311
311
  var e, t;
312
- (t = (e = x.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
312
+ (t = (e = _.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
313
313
  },
314
314
  resetInputs: () => {
315
315
  var e, t;
316
- (t = (e = x.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
316
+ (t = (e = _.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
317
317
  }
318
318
  }), (e, t) => {
319
- const d = I("FmTextField"), D = I("FmStepperField"), S = I("FmButton"), F = I("FmCard"), E = I("FmForm");
320
- return v(), T(E, {
319
+ const m = $("FmTextField"), I = $("FmStepperField"), D = $("FmButton"), U = $("FmCard"), O = $("FmForm");
320
+ return v(), T(O, {
321
321
  ref_key: "formRef",
322
- ref: x,
322
+ ref: _,
323
323
  class: "flex flex-col gap-40",
324
- onValidationSuccess: m
324
+ onValidationSuccess: d
325
325
  }, {
326
- default: R(() => {
327
- var P;
326
+ default: A(() => {
327
+ var E;
328
328
  return [
329
- l("div", je, [
330
- l("div", qe, [
331
- l("div", He, [
332
- y(d, {
329
+ l("div", He, [
330
+ l("div", Ge, [
331
+ l("div", Ke, [
332
+ y(m, {
333
333
  disabled: e.disabled,
334
- label: a(o)("inventory.unit.name"),
334
+ label: o(s)("inventory.unit.name"),
335
335
  modelValue: c.value,
336
- "onUpdate:modelValue": t[0] || (t[0] = (C) => c.value = C),
337
- rules: [a(j)()],
336
+ "onUpdate:modelValue": t[0] || (t[0] = (S) => c.value = S),
337
+ rules: [o(N)()],
338
338
  "label-mark": "required"
339
339
  }, null, 8, ["disabled", "label", "modelValue", "rules"])
340
340
  ]),
341
- l("div", Ge, [
342
- y(d, {
341
+ l("div", Oe, [
342
+ y(m, {
343
343
  disabled: e.disabled,
344
- label: a(o)("inventory.unit.symbol"),
344
+ label: o(s)("inventory.unit.symbol"),
345
345
  modelValue: p.value,
346
- "onUpdate:modelValue": t[1] || (t[1] = (C) => p.value = C),
347
- rules: [a(j)()],
346
+ "onUpdate:modelValue": t[1] || (t[1] = (S) => p.value = S),
347
+ rules: [o(N)()],
348
348
  "label-mark": "required"
349
349
  }, null, 8, ["disabled", "label", "modelValue", "rules"])
350
350
  ])
351
351
  ]),
352
352
  l("div", null, [
353
- y(D, {
353
+ y(I, {
354
354
  disabled: e.disabled,
355
355
  class: "col-span-3",
356
- label: a(o)("inventory.unit.precision"),
357
- modelValue: s.value,
358
- "onUpdate:modelValue": t[2] || (t[2] = (C) => s.value = C),
359
- rules: [a(pe)(0)]
356
+ label: o(s)("inventory.unit.precision"),
357
+ modelValue: a.value,
358
+ "onUpdate:modelValue": t[2] || (t[2] = (S) => a.value = S),
359
+ rules: [o(fe)(0)]
360
360
  }, null, 8, ["disabled", "label", "modelValue", "rules"])
361
361
  ])
362
362
  ]),
363
- l("div", Ke, [
364
- y(S, {
363
+ l("div", Ye, [
364
+ y(D, {
365
365
  disabled: e.disabled,
366
366
  type: "button",
367
367
  "prepend-icon": "add",
368
- label: a(o)("inventory.unit.measurement.addMeasurement"),
368
+ label: o(s)("inventory.unit.measurement.addMeasurement"),
369
369
  variant: "plain",
370
370
  onClick: u
371
371
  }, null, 8, ["disabled", "label"])
372
372
  ]),
373
- (v(!0), w(q, null, H((P = e.modelValue) == null ? void 0 : P.measurements, (C, h) => (v(), T(F, {
373
+ (v(!0), C(j, null, q((E = e.modelValue) == null ? void 0 : E.measurements, (S, h) => (v(), T(U, {
374
374
  class: "flex flex-col gap-16 p-16",
375
375
  variant: "outlined",
376
- key: C.id
376
+ key: S.id
377
377
  }, {
378
- default: R(() => [
379
- l("div", Oe, [
380
- l("div", Ye, V(a(o)("inventory.unit.measurement.measurementDefault", [h + 1])), 1),
381
- y(S, {
378
+ default: A(() => [
379
+ l("div", Je, [
380
+ l("div", Qe, V(o(s)("inventory.unit.measurement.measurementDefault", [h + 1])), 1),
381
+ y(D, {
382
382
  disabled: e.disabled,
383
383
  variant: "tertiary",
384
384
  "prepend-icon": "delete",
385
- onClick: ($) => g(h)
385
+ onClick: (F) => x(h)
386
386
  }, null, 8, ["disabled", "onClick"])
387
387
  ]),
388
- l("div", Je, [
389
- l("div", Qe, [
390
- l("div", We, [
391
- y(d, {
388
+ l("div", We, [
389
+ l("div", Xe, [
390
+ l("div", Ze, [
391
+ y(m, {
392
392
  disabled: e.disabled,
393
393
  class: "col-span-2",
394
- label: a(o)("inventory.unit.measurement.name"),
394
+ label: o(s)("inventory.unit.measurement.name"),
395
395
  modelValue: e.modelValue.measurements[h].name,
396
- "onUpdate:modelValue": ($) => e.modelValue.measurements[h].name = $,
397
- rules: [a(j)()],
396
+ "onUpdate:modelValue": (F) => e.modelValue.measurements[h].name = F,
397
+ rules: [o(N)()],
398
398
  "label-mark": "required"
399
399
  }, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
400
400
  ]),
401
- l("div", Xe, [
402
- y(d, {
401
+ l("div", et, [
402
+ y(m, {
403
403
  disabled: e.disabled,
404
- label: a(o)("inventory.unit.measurement.symbol"),
404
+ label: o(s)("inventory.unit.measurement.symbol"),
405
405
  modelValue: e.modelValue.measurements[h].abbrev,
406
- "onUpdate:modelValue": ($) => e.modelValue.measurements[h].abbrev = $,
407
- rules: [a(j)()],
406
+ "onUpdate:modelValue": (F) => e.modelValue.measurements[h].abbrev = F,
407
+ rules: [o(N)()],
408
408
  "label-mark": "required"
409
409
  }, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
410
410
  ])
411
411
  ]),
412
- y($e, {
412
+ y(Ie, {
413
413
  disabled: e.disabled,
414
414
  class: "col-span-3",
415
- label: a(o)("inventory.unit.measurement.conversion"),
416
- "model-value": +a(J)(e.modelValue.measurements[h].conversion),
417
- "onUpdate:modelValue": ($) => n.value = n.value.map(
418
- (A, B) => B === h ? {
419
- ...A,
420
- conversion: a(Fe).toPrecision(
421
- a(fe)($),
422
- s.value
415
+ label: o(s)("inventory.unit.measurement.conversion"),
416
+ "model-value": +o(J)(e.modelValue.measurements[h].conversion),
417
+ "onUpdate:modelValue": (F) => n.value = n.value.map(
418
+ (P, R) => R === h ? {
419
+ ...P,
420
+ conversion: o($e).toPrecision(
421
+ o(ve)(F),
422
+ a.value
423
423
  )
424
- } : A
424
+ } : P
425
425
  ),
426
- rules: [a(ve)(0)],
427
- step: +a(J)({ amount: 1, precision: s.value }),
428
- "helper-text": a(o)("inventory.unit.measurement.conversionHelper", {
426
+ rules: [o(ye)(0)],
427
+ step: +o(J)({ amount: 1, precision: a.value }),
428
+ "helper-text": o(s)("inventory.unit.measurement.conversionHelper", {
429
429
  measurementSymbol: e.modelValue.measurements[h].name || " measurement unit",
430
- conversion: +a(J)(e.modelValue.measurements[h].conversion),
430
+ conversion: +o(J)(e.modelValue.measurements[h].conversion),
431
431
  unitSymbol: p.value || "base unit"
432
432
  })
433
433
  }, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue", "rules", "step", "helper-text"])
@@ -441,47 +441,47 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
441
441
  }, 512);
442
442
  };
443
443
  }
444
- }), et = { class: "flex gap-4" }, tt = /* @__PURE__ */ G({
444
+ }), nt = { class: "flex gap-4" }, ot = /* @__PURE__ */ H({
445
445
  __name: "UnitDialog",
446
446
  props: {
447
447
  show: { type: Boolean },
448
448
  unit: {},
449
- mode: { default: U.READ }
449
+ mode: { default: w.READ }
450
450
  },
451
451
  emits: ["update:show"],
452
452
  setup(k) {
453
- const f = k, b = K(), i = le(), { t: r } = O(), o = ne(f, "show"), m = ne(f, "unit"), c = _(() => {
453
+ const f = k, b = G(), i = se(), { t: r } = K(), s = oe(f, "show"), d = oe(f, "unit"), c = g(() => {
454
454
  switch (f.mode) {
455
- case U.READ:
455
+ case w.READ:
456
456
  return "";
457
- case U.UPDATE:
457
+ case w.UPDATE:
458
458
  return r("inventory.unit.update.title");
459
- case U.CREATE:
459
+ case w.CREATE:
460
460
  return r("inventory.unit.create.title");
461
461
  }
462
462
  return "";
463
- }), p = _(() => {
463
+ }), p = g(() => {
464
464
  switch (f.mode) {
465
- case U.READ:
465
+ case w.READ:
466
466
  return "";
467
- case U.UPDATE:
467
+ case w.UPDATE:
468
468
  return r("common.save");
469
- case U.CREATE:
469
+ case w.CREATE:
470
470
  return r("common.add");
471
471
  }
472
472
  return "";
473
- }), s = M(), n = M(!1);
473
+ }), a = M(), n = M(!1);
474
474
  async function u() {
475
475
  n.value = !0;
476
476
  try {
477
- const t = oe(m.value);
478
- t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await b.createUnit(t), o.value = !1, i.open({
477
+ const t = le(d.value);
478
+ t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await b.createUnit(t), s.value = !1, i.open({
479
479
  title: r("inventory.common.success"),
480
- message: r("inventory.unit.create.success", { name: m.value.name }),
480
+ message: r("inventory.unit.create.success", { name: d.value.name }),
481
481
  type: "success"
482
482
  });
483
483
  } catch (t) {
484
- t instanceof te || i.open({
484
+ t instanceof ne || i.open({
485
485
  title: r("inventory.unit.create.error.title"),
486
486
  message: r("inventory.unit.create.error.message"),
487
487
  type: "error"
@@ -490,16 +490,16 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
490
490
  n.value = !1;
491
491
  }
492
492
  }
493
- async function g() {
493
+ async function x() {
494
494
  n.value = !0;
495
495
  try {
496
- await b.updateUnit(m.value), o.value = !1, i.open({
496
+ await b.updateUnit(d.value), s.value = !1, i.open({
497
497
  title: r("inventory.common.success"),
498
- message: r("inventory.unit.update.success", { name: m.value.name }),
498
+ message: r("inventory.unit.update.success", { name: d.value.name }),
499
499
  type: "success"
500
500
  });
501
501
  } catch (t) {
502
- t instanceof te || i.open({
502
+ t instanceof ne || i.open({
503
503
  title: r("inventory.unit.update.error.title"),
504
504
  message: r("inventory.unit.update.error.message"),
505
505
  type: "error"
@@ -508,118 +508,123 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
508
508
  n.value = !1;
509
509
  }
510
510
  }
511
- function x() {
512
- var t, d;
513
- (d = (t = s.value) == null ? void 0 : t.validateInputs) == null || d.call(t);
511
+ function _() {
512
+ var t, m;
513
+ (m = (t = a.value) == null ? void 0 : t.validateInputs) == null || m.call(t);
514
514
  }
515
515
  function e() {
516
516
  switch (f.mode) {
517
- case U.READ:
517
+ case w.READ:
518
518
  return;
519
- case U.UPDATE:
520
- return g();
521
- case U.CREATE:
519
+ case w.UPDATE:
520
+ return x();
521
+ case w.CREATE:
522
522
  return u();
523
523
  }
524
524
  }
525
- return (t, d) => {
526
- const D = I("FmButton"), S = I("FmSideSheet");
527
- return v(), T(S, {
528
- "model-value": a(o),
529
- "onUpdate:modelValue": d[3] || (d[3] = (F) => Z(o) ? o.value = F : null),
525
+ return (t, m) => {
526
+ const I = $("FmButton"), D = $("FmSideSheet");
527
+ return v(), T(D, {
528
+ "model-value": o(s),
529
+ "onUpdate:modelValue": m[3] || (m[3] = (U) => ee(s) ? s.value = U : null),
530
530
  header: c.value,
531
531
  "close-button": "",
532
532
  "dismiss-away": "",
533
533
  "max-width": 500
534
534
  }, {
535
- "side-sheet-footer": R(() => [
536
- l("div", et, [
537
- y(D, {
535
+ "side-sheet-footer": A(() => [
536
+ l("div", nt, [
537
+ y(I, {
538
538
  loading: n.value,
539
539
  label: p.value,
540
- onClick: x
540
+ onClick: _
541
541
  }, null, 8, ["loading", "label"]),
542
- y(D, {
542
+ y(I, {
543
543
  disabled: n.value,
544
- label: a(r)("common.close"),
544
+ label: o(r)("common.close"),
545
545
  variant: "tertiary",
546
- onClick: d[2] || (d[2] = (F) => o.value = !1)
546
+ onClick: m[2] || (m[2] = (U) => s.value = !1)
547
547
  }, null, 8, ["disabled", "label"])
548
548
  ])
549
549
  ]),
550
- default: R(() => [
551
- y(Ze, {
550
+ default: A(() => [
551
+ y(tt, {
552
552
  class: "w-full",
553
553
  ref_key: "hasValidationExpose",
554
- ref: s,
555
- modelValue: a(m),
556
- "onUpdate:modelValue": d[0] || (d[0] = (F) => Z(m) ? m.value = F : null),
554
+ ref: a,
555
+ modelValue: o(d),
556
+ "onUpdate:modelValue": m[0] || (m[0] = (U) => ee(d) ? d.value = U : null),
557
557
  mode: t.mode,
558
558
  disabled: n.value,
559
- "onClick:submit": d[1] || (d[1] = (F) => e())
559
+ "onClick:submit": m[1] || (m[1] = (U) => e())
560
560
  }, null, 8, ["modelValue", "mode", "disabled"])
561
561
  ]),
562
562
  _: 1
563
563
  }, 8, ["model-value", "header"]);
564
564
  };
565
565
  }
566
- }), nt = { class: "flex flex-col py-8" }, ot = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, lt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pt = /* @__PURE__ */ G({
566
+ }), lt = { class: "flex flex-col py-8" }, st = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vt = /* @__PURE__ */ H({
567
567
  __name: "UnitView",
568
568
  setup(k) {
569
- const f = K(), b = ye(), i = _(() => f.units), { createUnit: r, updateUnit: o } = Q(), { unitDialogProps: m, unitViewLoading: c } = Se(Q()), { columnDefs: p } = Ne();
570
- function s(D) {
571
- D === "add" && r();
569
+ const f = G(), b = be(), i = ge(), r = g(() => f.units), { createUnit: s, updateUnit: d } = Q(), { unitDialogProps: c, unitViewLoading: p } = Fe(Q()), { columnDefs: a } = qe();
570
+ function n(D) {
571
+ D === "add" && s();
572
572
  }
573
- const n = M(""), u = _(() => c.value), { breakpoints: g } = Ue(), x = _(() => g.value.xs || g.value.sm), e = _(() => x.value ? 10 : 20), t = be(), { t: d } = O();
574
- return (D, S) => {
575
- const F = I("FmTable");
576
- return v(), T(ge, {
577
- title: a(d)("inventory.unit.title"),
578
- actions: [
579
- { label: a(d)("inventory.unit.create.title"), value: "add", isPrimary: !0, prependIcon: "add" }
573
+ const u = M(""), x = g(() => p.value), { breakpoints: _ } = Ce(), e = g(() => _.value.xs || _.value.sm), t = g(() => e.value ? 10 : 20), m = xe(), { t: I } = K();
574
+ return (D, U) => {
575
+ const O = $("FmTable");
576
+ return v(), T(_e, {
577
+ title: o(I)("inventory.unit.title"),
578
+ actions: o(i).isEnabled ? [] : [
579
+ {
580
+ label: o(I)("inventory.unit.create.title"),
581
+ value: "add",
582
+ isPrimary: !0,
583
+ prependIcon: "add"
584
+ }
580
585
  ],
581
- "onClick:action": s
586
+ "onClick:action": n
582
587
  }, {
583
- default: R(() => [
588
+ default: A(() => [
584
589
  l("div", {
585
- class: ae([
590
+ class: re([
586
591
  "flex flex-col gap-8 max-h-full",
587
592
  {
588
- "p-0": x.value,
589
- "px-24 ": !x.value
593
+ "p-0": e.value,
594
+ "px-24 ": !e.value
590
595
  }
591
596
  ])
592
597
  }, [
593
- y(xe, {
598
+ y(he, {
594
599
  searchable: "",
595
- search: n.value,
596
- "onUpdate:search": S[0] || (S[0] = (E) => n.value = E)
600
+ search: u.value,
601
+ "onUpdate:search": U[0] || (U[0] = (E) => u.value = E)
597
602
  }, null, 8, ["search"]),
598
- y(F, {
599
- style: re(a(t).tableHeight),
600
- "column-defs": a(p),
601
- "row-data": i.value,
602
- "search-value": n.value,
603
- loading: !a(b)._currentLocation || u.value,
604
- onRowClick: S[1] || (S[1] = (E) => a(o)(E.original)),
605
- "page-size": e.value
603
+ y(O, {
604
+ style: ie(o(m).tableHeight),
605
+ "column-defs": o(a),
606
+ "row-data": r.value,
607
+ "search-value": u.value,
608
+ loading: !o(b)._currentLocation || x.value,
609
+ onRowClick: U[1] || (U[1] = (E) => o(d)(E.original)),
610
+ "page-size": t.value
606
611
  }, {
607
- "list-row": R((E) => [
608
- y(_e, {
612
+ "list-row": A((E) => [
613
+ y(Ve, {
609
614
  row: E,
610
- onRowClick: a(o)
615
+ onRowClick: o(d)
611
616
  }, {
612
- default: R((P) => {
613
- var C, h, $, A, B, z, W, L, X;
617
+ default: A((S) => {
618
+ var h, F, P, R, W, B, X, z, Z;
614
619
  return [
615
- l("div", nt, [
616
- l("div", ot, [
617
- y(a(he), {
618
- render: ($ = (h = (C = P.name) == null ? void 0 : C.column) == null ? void 0 : h.columnDef) == null ? void 0 : $.cell,
619
- props: (B = (A = P.name) == null ? void 0 : A.getContext) == null ? void 0 : B.call(A)
620
+ l("div", lt, [
621
+ l("div", st, [
622
+ y(o(Ue), {
623
+ render: (P = (F = (h = S.name) == null ? void 0 : h.column) == null ? void 0 : F.columnDef) == null ? void 0 : P.cell,
624
+ props: (W = (R = S.name) == null ? void 0 : R.getContext) == null ? void 0 : W.call(R)
620
625
  }, null, 8, ["render", "props"])
621
626
  ]),
622
- l("div", lt, V((X = (L = (W = (z = E.original.measurements) == null ? void 0 : z.map) == null ? void 0 : W.call(z, (se) => se.name)) == null ? void 0 : L.join) == null ? void 0 : X.call(L, ", ")), 1)
627
+ l("div", at, V((Z = (z = (X = (B = E.original.measurements) == null ? void 0 : B.map) == null ? void 0 : X.call(B, (ae) => ae.name)) == null ? void 0 : z.join) == null ? void 0 : Z.call(z, ", ")), 1)
623
628
  ])
624
629
  ];
625
630
  }),
@@ -629,8 +634,8 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
629
634
  _: 1
630
635
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
631
636
  ], 2),
632
- (v(), T(ie, { to: "body" }, [
633
- y(tt, ue(de(a(m))), null, 16)
637
+ (v(), T(ue, { to: "body" }, [
638
+ y(ot, de(me(o(c))), null, 16)
634
639
  ]))
635
640
  ]),
636
641
  _: 1
@@ -639,5 +644,5 @@ const je = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He
639
644
  }
640
645
  });
641
646
  export {
642
- pt as default
647
+ vt as default
643
648
  };