@feedmepos/mf-inventory-portal 0.0.21-dev.4 → 0.0.21-dev.5

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 (32) hide show
  1. package/dist/ApprovalView-BHoJzHuo.js +129 -0
  2. package/dist/{BindingsDialog-BFLeun5L.js → BindingsDialog-sUZjZtSl.js} +1 -1
  3. package/dist/{BindingsPicker-CnjJZH9t.js → BindingsPicker-CqzSUVc_.js} +1 -1
  4. package/dist/{BindingsTable-C3VTa0YL.js → BindingsTable-C1o5EgLy.js} +1 -1
  5. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DYBTXD_J.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpN5Kn8b.js} +1 -1
  6. package/dist/{IngredientsView-CQYJfAze.js → IngredientsView-CrXPIQme.js} +99 -91
  7. package/dist/IntegrationView-BJT-KMVp.js +1141 -0
  8. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Wv8RvXJL.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DH0CcGmX.js} +1 -1
  9. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DsOGlAb7.js → PremiumBadge.vue_vue_type_script_setup_true_lang-kJKVCH40.js} +1 -1
  10. package/dist/{PurchaseOrderPrintPreview-B0hDduXB.js → PurchaseOrderPrintPreview-k26o__vy.js} +1 -1
  11. package/dist/ReceiveRequestView-ysOzzBTW.js +216 -0
  12. package/dist/{RecipeView-DYKhSgtw.js → RecipeView-DAH8YIzY.js} +182 -174
  13. package/dist/{StockView-BIGGG87A.js → StockView-BlCpuSLe.js} +547 -539
  14. package/dist/{SupplierView-DQzopnzt.js → SupplierView-Bwknjcke.js} +263 -255
  15. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D8-sMRGm.js → TransferDetails.vue_vue_type_script_setup_true_lang-LCNiBfi7.js} +3 -3
  16. package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-CSUnXAyq.js → TransferDialog.vue_vue_type_script_setup_true_lang-BDvtif2q.js} +4 -4
  17. package/dist/{TransferTemplateView-DWF54okN.js → TransferTemplateView-DcMdNiH6.js} +372 -364
  18. package/dist/{UnitView-Cdw8xxzV.js → UnitView-BVMr4KlR.js} +186 -178
  19. package/dist/{WarehouseView-DOelxuIh.js → WarehouseView-Dd-e-IlG.js} +388 -380
  20. package/dist/{app-SBnQEeEV.js → app-S6iG6Hux.js} +4 -4
  21. package/dist/app.js +1 -1
  22. package/dist/{decimal-BlEB2PrM.js → decimal-nOOdFIFP.js} +1 -1
  23. package/dist/{id-to-date-Y6berpHs.js → id-to-date-CKQ0n3Qi.js} +1 -1
  24. package/dist/{purchase-order-transaction-type-Dp0wsGal.js → purchase-order-transaction-type-CQ-RpJ0h.js} +2 -2
  25. package/dist/{supplier-I_rYvljH.js → supplier-DQsAfn3q.js} +1 -1
  26. package/dist/tsconfig.app.tsbuildinfo +1 -1
  27. package/dist/{xlsx-DGwG2ekM.js → xlsx-Dgjf-KvE.js} +1 -1
  28. package/dist/{xlsx.util-Dsf-EgrG.js → xlsx.util-CODYzgF8.js} +2 -2
  29. package/package.json +3 -3
  30. package/dist/ApprovalView-BS4jzhAR.js +0 -121
  31. package/dist/IntegrationView-9V2OcyP_.js +0 -1172
  32. package/dist/ReceiveRequestView-3boFHkOO.js +0 -208
@@ -1,42 +1,42 @@
1
- import { defineComponent as H, computed as V, openBlock as v, createElementBlock as k, createElementVNode as l, Fragment as N, renderList as q, toDisplayString as h, createCommentVNode as O, ref as R, resolveComponent as E, createBlock as T, withCtx as I, createVNode as y, unref as a, isRef as X, normalizeStyle as se, Teleport as ae, normalizeProps as re, guardReactiveProps as ie } from "vue";
2
- import { u as K, S as ue, c as ne, R as z, A as de, a as Y, l as me, m as ce, e as Z, j as pe } from "./app-SBnQEeEV.js";
3
- import { useDialog as fe, useSnackbar as oe, useProxiedModel as ee, useBreakpoints as ve } from "@feedmepos/ui-library";
4
- import { i as ye, _ as be } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
- import { F as w, D as te, R as j } from "./row-action.enum-PMKMRrZR.js";
6
- import { defineStore as ge, storeToRefs as xe } from "pinia";
7
- import { c as _e, _ as he, F as Ve } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
8
- import { useI18n as G } from "@feedmepos/mf-common";
9
- import { u as Ue, _ as we, a as Ce } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DYBTXD_J.js";
10
- import { F as ke } from "./decimal-BlEB2PrM.js";
11
- import { _ as Fe } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Wv8RvXJL.js";
12
- const Se = { class: "flex flex-col gap-8" }, $e = {
1
+ import { defineComponent as K, 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 { u as G, S as me, c as oe, R as j, A as ce, a as J, l as pe, m as fe, e as ee, j as ve } from "./app-S6iG6Hux.js";
3
+ import { useDialog as ye, useSnackbar as le, useProxiedModel as te, useBreakpoints as be } from "@feedmepos/ui-library";
4
+ import { i as ge, _ as xe } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
+ import { F as U, D as ne, R as N } from "./row-action.enum-PMKMRrZR.js";
6
+ import { defineStore as _e, storeToRefs as he } from "pinia";
7
+ import { c as Ve, _ as Ue, F as we } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
8
+ import { useI18n as O } from "@feedmepos/mf-common";
9
+ import { u as Ce, _ as ke, a as Fe } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpN5Kn8b.js";
10
+ import { F as Se } from "./decimal-nOOdFIFP.js";
11
+ import { _ as $e } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DH0CcGmX.js";
12
+ const Ee = { class: "flex flex-col gap-8" }, Ie = {
13
13
  key: 0,
14
14
  class: "flex flex-col"
15
- }, Ee = { class: "flex-1 py-8 px-16" }, Ie = {
15
+ }, De = { class: "flex-1 py-8 px-16" }, Ae = {
16
16
  class: "flex-0 py-8 px-16",
17
17
  style: { "flex-basis": "240px" }
18
- }, De = {
18
+ }, Re = {
19
19
  key: 1,
20
20
  class: "flex flex-col"
21
- }, Ae = { class: "flex-1 py-8 px-16" }, Re = {
21
+ }, Me = { class: "flex-1 py-8 px-16" }, Pe = {
22
22
  class: "flex-0 py-8 px-16",
23
23
  style: { "flex-basis": "240px" }
24
- }, Me = {
24
+ }, Te = {
25
25
  key: 2,
26
26
  class: "flex flex-col"
27
- }, Pe = { class: "flex-1 py-8 px-16" }, Te = {
27
+ }, Be = { class: "flex-1 py-8 px-16" }, ze = {
28
28
  class: "flex-0 py-8 px-16",
29
29
  style: { "flex-basis": "240px" }
30
- }, Be = /* @__PURE__ */ H({
30
+ }, Le = /* @__PURE__ */ K({
31
31
  __name: "UnitUsedBy",
32
32
  props: {
33
33
  unit: {}
34
34
  },
35
- setup(S) {
36
- const f = S, b = K(), i = V(() => b.validateUnitUsage(f.unit)), r = V(() => i.value.filter((c) => c.from === "INGREDIENT")), o = V(() => i.value.filter((c) => c.from === "RECIPE")), m = V(() => i.value.filter((c) => c.from === "MENU"));
37
- return (c, p) => (v(), k("div", Se, [
35
+ setup(k) {
36
+ const f = k, b = G(), 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"));
37
+ return (c, p) => (v(), w("div", Ee, [
38
38
  p[3] || (p[3] = l("div", { class: "fm-typo-en-body-md-400" }, "Sorry, this unit is used in the following modules:", -1)),
39
- r.value.length ? (v(), k("div", $e, [
39
+ r.value.length ? (v(), w("div", Ie, [
40
40
  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" }, [
41
41
  l("div", { class: "flex-1 py-8 px-16" }, "Ingredient"),
42
42
  l("div", {
@@ -44,18 +44,18 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
44
44
  style: { "flex-basis": "240px" }
45
45
  }, "Used in")
46
46
  ], -1)),
47
- (v(!0), k(N, null, q(r.value, (s) => {
47
+ (v(!0), w(q, null, H(r.value, (s) => {
48
48
  var n;
49
- return v(), k("div", {
49
+ return v(), w("div", {
50
50
  key: s.code,
51
51
  class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
52
52
  }, [
53
- l("div", Ee, h(s.code) + " " + h(s.name), 1),
54
- l("div", Ie, h((n = s.bindedIngredient) != null && n.length ? "Convert binding" : "Item unit"), 1)
53
+ l("div", De, V(s.code) + " " + V(s.name), 1),
54
+ l("div", Ae, V((n = s.bindedIngredient) != null && n.length ? "Convert binding" : "Item unit"), 1)
55
55
  ]);
56
56
  }), 128))
57
- ])) : O("", !0),
58
- o.value.length ? (v(), k("div", De, [
57
+ ])) : Y("", !0),
58
+ o.value.length ? (v(), w("div", Re, [
59
59
  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" }, [
60
60
  l("div", { class: "flex-1 py-8 px-16" }, "Recipe"),
61
61
  l("div", {
@@ -63,18 +63,18 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
63
63
  style: { "flex-basis": "240px" }
64
64
  }, "Used in")
65
65
  ], -1)),
66
- (v(!0), k(N, null, q(o.value, (s) => {
66
+ (v(!0), w(q, null, H(o.value, (s) => {
67
67
  var n, u, g;
68
- return v(), k("div", {
68
+ return v(), w("div", {
69
69
  key: s.code,
70
70
  class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
71
71
  }, [
72
- l("div", Ae, h(s.code) + " " + h(s.name), 1),
73
- l("div", Re, h((n = s.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((U) => U.code).join(", ")) + " " + h(s.bindedIngredient && ((u = s.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((g = s.bindedIngredient) == null ? void 0 : g.length) - 3} more` : ""), 1)
72
+ l("div", Me, V(s.code) + " " + V(s.name), 1),
73
+ 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)
74
74
  ]);
75
75
  }), 128))
76
- ])) : O("", !0),
77
- m.value.length ? (v(), k("div", Me, [
76
+ ])) : Y("", !0),
77
+ m.value.length ? (v(), w("div", Te, [
78
78
  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" }, [
79
79
  l("div", { class: "flex-1 py-8 px-16" }, "Menu"),
80
80
  l("div", {
@@ -82,25 +82,25 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
82
82
  style: { "flex-basis": "240px" }
83
83
  }, "Used in")
84
84
  ], -1)),
85
- (v(!0), k(N, null, q(m.value, (s) => {
85
+ (v(!0), w(q, null, H(m.value, (s) => {
86
86
  var n, u, g;
87
- return v(), k("div", {
87
+ return v(), w("div", {
88
88
  key: s.code,
89
89
  class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
90
90
  }, [
91
- l("div", Pe, h(s.code) + " " + h(s.name), 1),
92
- l("div", Te, h((n = s.bindedIngredient) == null ? void 0 : n.slice(0, 3).map((U) => U.code).join(", ")) + " " + h(s.bindedIngredient && ((u = s.bindedIngredient) == null ? void 0 : u.length) > 3 ? `and ${((g = s.bindedIngredient) == null ? void 0 : g.length) - 3} more` : ""), 1)
91
+ l("div", Be, V(s.code) + " " + V(s.name), 1),
92
+ 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)
93
93
  ]);
94
94
  }), 128))
95
- ])) : O("", !0)
95
+ ])) : Y("", !0)
96
96
  ]));
97
97
  }
98
- }), J = ge("unitForm", function() {
99
- const f = fe(), b = oe(), i = K(), r = R(!1), o = R();
98
+ }), Q = _e("unitForm", function() {
99
+ const f = ye(), b = le(), i = G(), r = M(!1), o = M();
100
100
  function m() {
101
101
  const n = {
102
102
  unit: {},
103
- mode: w.CREATE,
103
+ mode: U.CREATE,
104
104
  show: !0,
105
105
  "onUpdate:show"(u) {
106
106
  o.value.show = u;
@@ -111,7 +111,7 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
111
111
  async function c(n) {
112
112
  const u = {
113
113
  unit: n,
114
- mode: w.UPDATE,
114
+ mode: U.UPDATE,
115
115
  show: !0,
116
116
  "onUpdate:show"(g) {
117
117
  o.value.show = g;
@@ -128,9 +128,9 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
128
128
  type: "success"
129
129
  });
130
130
  } catch (u) {
131
- u instanceof ue && ye(u) ? f.open({
131
+ u instanceof me && ge(u) ? f.open({
132
132
  title: "Cannot delete unit",
133
- contentComponent: be,
133
+ contentComponent: xe,
134
134
  contentComponentProps: {
135
135
  subject: (n == null ? void 0 : n.name) ?? "",
136
136
  items: u.errorResponse.message
@@ -155,7 +155,7 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
155
155
  overlay: !0,
156
156
  dismissAway: !0,
157
157
  closeButton: !0,
158
- contentComponent: Be,
158
+ contentComponent: Le,
159
159
  contentComponentProps: {
160
160
  unit: n
161
161
  },
@@ -189,15 +189,15 @@ const Se = { class: "flex flex-col gap-8" }, $e = {
189
189
  unitViewLoading: r
190
190
  };
191
191
  });
192
- function Le() {
193
- const { updateUnit: S, deleteUnit: f } = J(), { t: b } = G();
192
+ function je() {
193
+ const { updateUnit: k, deleteUnit: f } = Q(), { t: b } = O();
194
194
  async function i(o, m) {
195
- const c = ne(m);
196
- if (o === j.Edit) {
197
- await S(c);
195
+ const c = oe(m);
196
+ if (o === N.Edit) {
197
+ await k(c);
198
198
  return;
199
199
  }
200
- if (o === j.Delete) {
200
+ if (o === N.Delete) {
201
201
  await f(c);
202
202
  return;
203
203
  }
@@ -219,8 +219,8 @@ function Le() {
219
219
  id: "action",
220
220
  header: "",
221
221
  cell(o) {
222
- return _e(
223
- [te[j.Edit], te[j.Delete]],
222
+ return Ve(
223
+ [ne[N.Edit], ne[N.Delete]],
224
224
  (m) => {
225
225
  i(m, o.row.original);
226
226
  }
@@ -235,7 +235,7 @@ function Le() {
235
235
  }
236
236
  ] };
237
237
  }
238
- const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne = { class: "flex-1" }, qe = { class: "flex-1" }, He = { class: "flex" }, Ke = { class: "flex items-center" }, Ge = { class: "fm-typo-en-body-lg-600 flex-grow" }, Oe = { class: "flex flex-col gap-24" }, Ye = { class: "flex gap-24" }, Je = { class: "flex-1" }, Qe = { class: "flex-1" }, We = /* @__PURE__ */ H({
238
+ const Ne = { class: "flex flex-col gap-24" }, qe = { class: "flex gap-24" }, He = { class: "flex-1" }, Ke = { class: "flex-1" }, Ge = { 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__ */ K({
239
239
  __name: "UnitForm",
240
240
  props: {
241
241
  mode: {},
@@ -243,12 +243,12 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
243
243
  disabled: { type: Boolean }
244
244
  },
245
245
  emits: ["update:modelValue", "click:submit"],
246
- setup(S, { expose: f, emit: b }) {
247
- const i = S, r = b, { t: o } = G();
246
+ setup(k, { expose: f, emit: b }) {
247
+ const i = k, r = b, { t: o } = O();
248
248
  function m() {
249
249
  r("click:submit");
250
250
  }
251
- const c = V({
251
+ const c = _({
252
252
  get() {
253
253
  var e;
254
254
  return ((e = i.modelValue) == null ? void 0 : e.name) ?? "";
@@ -257,7 +257,7 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
257
257
  const t = i.modelValue ?? {};
258
258
  t.name = e, r("update:modelValue", t);
259
259
  }
260
- }), p = V({
260
+ }), p = _({
261
261
  get() {
262
262
  var e;
263
263
  return ((e = i.modelValue) == null ? void 0 : e.abbrev) ?? "";
@@ -266,7 +266,7 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
266
266
  const t = i.modelValue ?? {};
267
267
  t.abbrev = e, r("update:modelValue", t);
268
268
  }
269
- }), s = V({
269
+ }), s = _({
270
270
  get() {
271
271
  var e;
272
272
  return ((e = i.modelValue) == null ? void 0 : e.precision) ?? 0;
@@ -275,7 +275,7 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
275
275
  const t = i.modelValue ?? {};
276
276
  t.precision = e, r("update:modelValue", t);
277
277
  }
278
- }), n = V({
278
+ }), n = _({
279
279
  get() {
280
280
  var e;
281
281
  return ((e = i.modelValue) == null ? void 0 : e.measurements) ?? [];
@@ -304,67 +304,67 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
304
304
  const t = i.modelValue ?? {}, d = t.measurements ?? [];
305
305
  d.splice(e, 1), t.measurements = d, r("update:modelValue", t);
306
306
  }
307
- const U = R();
307
+ const x = M();
308
308
  return f({
309
309
  validateInputs: () => {
310
310
  var e, t;
311
- (t = (e = U.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
311
+ (t = (e = x.value) == null ? void 0 : e.validateInputs) == null || t.call(e);
312
312
  },
313
313
  resetInputsValidation: () => {
314
314
  var e, t;
315
- (t = (e = U.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
315
+ (t = (e = x.value) == null ? void 0 : e.resetInputsValidation) == null || t.call(e);
316
316
  },
317
317
  resetInputs: () => {
318
318
  var e, t;
319
- (t = (e = U.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
319
+ (t = (e = x.value) == null ? void 0 : e.resetInputs) == null || t.call(e);
320
320
  }
321
321
  }), (e, t) => {
322
- const d = E("FmTextField"), $ = E("FmStepperField"), D = E("FmButton"), x = E("FmCard"), B = E("FmForm");
323
- return v(), T(B, {
322
+ const d = I("FmTextField"), D = I("FmStepperField"), F = I("FmButton"), S = I("FmCard"), E = I("FmForm");
323
+ return v(), T(E, {
324
324
  ref_key: "formRef",
325
- ref: U,
325
+ ref: x,
326
326
  class: "flex flex-col gap-40",
327
327
  onValidationSuccess: m
328
328
  }, {
329
- default: I(() => {
330
- var M;
329
+ default: R(() => {
330
+ var P;
331
331
  return [
332
- l("div", ze, [
333
- l("div", je, [
334
- l("div", Ne, [
332
+ l("div", Ne, [
333
+ l("div", qe, [
334
+ l("div", He, [
335
335
  y(d, {
336
336
  disabled: e.disabled,
337
337
  label: a(o)("inventory.unit.name"),
338
338
  modelValue: c.value,
339
- "onUpdate:modelValue": t[0] || (t[0] = (F) => c.value = F),
340
- rules: [a(z)()],
339
+ "onUpdate:modelValue": t[0] || (t[0] = (C) => c.value = C),
340
+ rules: [a(j)()],
341
341
  "label-mark": "required"
342
342
  }, null, 8, ["disabled", "label", "modelValue", "rules"])
343
343
  ]),
344
- l("div", qe, [
344
+ l("div", Ke, [
345
345
  y(d, {
346
346
  disabled: e.disabled,
347
347
  label: a(o)("inventory.unit.symbol"),
348
348
  modelValue: p.value,
349
- "onUpdate:modelValue": t[1] || (t[1] = (F) => p.value = F),
350
- rules: [a(z)()],
349
+ "onUpdate:modelValue": t[1] || (t[1] = (C) => p.value = C),
350
+ rules: [a(j)()],
351
351
  "label-mark": "required"
352
352
  }, null, 8, ["disabled", "label", "modelValue", "rules"])
353
353
  ])
354
354
  ]),
355
355
  l("div", null, [
356
- y($, {
356
+ y(D, {
357
357
  disabled: e.disabled,
358
358
  class: "col-span-3",
359
359
  label: a(o)("inventory.unit.precision"),
360
360
  modelValue: s.value,
361
- "onUpdate:modelValue": t[2] || (t[2] = (F) => s.value = F),
362
- rules: [a(de)(0)]
361
+ "onUpdate:modelValue": t[2] || (t[2] = (C) => s.value = C),
362
+ rules: [a(ce)(0)]
363
363
  }, null, 8, ["disabled", "label", "modelValue", "rules"])
364
364
  ])
365
365
  ]),
366
- l("div", He, [
367
- y(D, {
366
+ l("div", Ge, [
367
+ y(F, {
368
368
  disabled: e.disabled,
369
369
  type: "button",
370
370
  "prepend-icon": "add",
@@ -373,64 +373,64 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
373
373
  onClick: u
374
374
  }, null, 8, ["disabled", "label"])
375
375
  ]),
376
- (v(!0), k(N, null, q((M = e.modelValue) == null ? void 0 : M.measurements, (F, _) => (v(), T(x, {
376
+ (v(!0), w(q, null, H((P = e.modelValue) == null ? void 0 : P.measurements, (C, h) => (v(), T(S, {
377
377
  class: "flex flex-col gap-16 p-16",
378
378
  variant: "outlined",
379
- key: F.id
379
+ key: C.id
380
380
  }, {
381
- default: I(() => [
382
- l("div", Ke, [
383
- l("div", Ge, h(a(o)("inventory.unit.measurement.measurementDefault", [_ + 1])), 1),
384
- y(D, {
381
+ default: R(() => [
382
+ l("div", Oe, [
383
+ l("div", Ye, V(a(o)("inventory.unit.measurement.measurementDefault", [h + 1])), 1),
384
+ y(F, {
385
385
  disabled: e.disabled,
386
386
  variant: "tertiary",
387
387
  "prepend-icon": "delete",
388
- onClick: (C) => g(_)
388
+ onClick: ($) => g(h)
389
389
  }, null, 8, ["disabled", "onClick"])
390
390
  ]),
391
- l("div", Oe, [
392
- l("div", Ye, [
393
- l("div", Je, [
391
+ l("div", Je, [
392
+ l("div", Qe, [
393
+ l("div", We, [
394
394
  y(d, {
395
395
  disabled: e.disabled,
396
396
  class: "col-span-2",
397
397
  label: a(o)("inventory.unit.measurement.name"),
398
- modelValue: e.modelValue.measurements[_].name,
399
- "onUpdate:modelValue": (C) => e.modelValue.measurements[_].name = C,
400
- rules: [a(z)()],
398
+ modelValue: e.modelValue.measurements[h].name,
399
+ "onUpdate:modelValue": ($) => e.modelValue.measurements[h].name = $,
400
+ rules: [a(j)()],
401
401
  "label-mark": "required"
402
402
  }, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
403
403
  ]),
404
- l("div", Qe, [
404
+ l("div", Xe, [
405
405
  y(d, {
406
406
  disabled: e.disabled,
407
407
  label: a(o)("inventory.unit.measurement.symbol"),
408
- modelValue: e.modelValue.measurements[_].abbrev,
409
- "onUpdate:modelValue": (C) => e.modelValue.measurements[_].abbrev = C,
410
- rules: [a(z)()],
408
+ modelValue: e.modelValue.measurements[h].abbrev,
409
+ "onUpdate:modelValue": ($) => e.modelValue.measurements[h].abbrev = $,
410
+ rules: [a(j)()],
411
411
  "label-mark": "required"
412
412
  }, null, 8, ["disabled", "label", "modelValue", "onUpdate:modelValue", "rules"])
413
413
  ])
414
414
  ]),
415
- y(Fe, {
415
+ y($e, {
416
416
  disabled: e.disabled,
417
417
  class: "col-span-3",
418
418
  label: a(o)("inventory.unit.measurement.conversion"),
419
- "model-value": +a(Y)(e.modelValue.measurements[_].conversion),
420
- "onUpdate:modelValue": (C) => n.value = n.value.map(
421
- (P, A) => A === _ ? {
422
- ...P,
423
- conversion: a(ke).toPrecision(
424
- a(me)(C),
419
+ "model-value": +a(J)(e.modelValue.measurements[h].conversion),
420
+ "onUpdate:modelValue": ($) => n.value = n.value.map(
421
+ (A, B) => B === h ? {
422
+ ...A,
423
+ conversion: a(Se).toPrecision(
424
+ a(pe)($),
425
425
  s.value
426
426
  )
427
- } : P
427
+ } : A
428
428
  ),
429
- rules: [a(ce)(0)],
430
- step: +a(Y)({ amount: 1, precision: s.value }),
429
+ rules: [a(fe)(0)],
430
+ step: +a(J)({ amount: 1, precision: s.value }),
431
431
  "helper-text": a(o)("inventory.unit.measurement.conversionHelper", {
432
- measurementSymbol: e.modelValue.measurements[_].name || " measurement unit",
433
- conversion: +a(Y)(e.modelValue.measurements[_].conversion),
432
+ measurementSymbol: e.modelValue.measurements[h].name || " measurement unit",
433
+ conversion: +a(J)(e.modelValue.measurements[h].conversion),
434
434
  unitSymbol: p.value || "base unit"
435
435
  })
436
436
  }, null, 8, ["disabled", "label", "model-value", "onUpdate:modelValue", "rules", "step", "helper-text"])
@@ -444,47 +444,47 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
444
444
  }, 512);
445
445
  };
446
446
  }
447
- }), Xe = { class: "flex gap-4" }, Ze = /* @__PURE__ */ H({
447
+ }), et = { class: "flex gap-4" }, tt = /* @__PURE__ */ K({
448
448
  __name: "UnitDialog",
449
449
  props: {
450
450
  show: { type: Boolean },
451
451
  unit: {},
452
- mode: { default: w.READ }
452
+ mode: { default: U.READ }
453
453
  },
454
454
  emits: ["update:show"],
455
- setup(S) {
456
- const f = S, b = K(), i = oe(), { t: r } = G(), o = ee(f, "show"), m = ee(f, "unit"), c = V(() => {
455
+ setup(k) {
456
+ const f = k, b = G(), i = le(), { t: r } = O(), o = te(f, "show"), m = te(f, "unit"), c = _(() => {
457
457
  switch (f.mode) {
458
- case w.READ:
458
+ case U.READ:
459
459
  return "";
460
- case w.UPDATE:
460
+ case U.UPDATE:
461
461
  return r("inventory.unit.update.title");
462
- case w.CREATE:
462
+ case U.CREATE:
463
463
  return r("inventory.unit.create.title");
464
464
  }
465
465
  return "";
466
- }), p = V(() => {
466
+ }), p = _(() => {
467
467
  switch (f.mode) {
468
- case w.READ:
468
+ case U.READ:
469
469
  return "";
470
- case w.UPDATE:
470
+ case U.UPDATE:
471
471
  return r("common.save");
472
- case w.CREATE:
472
+ case U.CREATE:
473
473
  return r("common.add");
474
474
  }
475
475
  return "";
476
- }), s = R(), n = R(!1);
476
+ }), s = M(), n = M(!1);
477
477
  async function u() {
478
478
  n.value = !0;
479
479
  try {
480
- const t = ne(m.value);
480
+ const t = oe(m.value);
481
481
  t.precision ?? (t.precision = 0), t.measurements ?? (t.measurements = []), await b.createUnit(t), o.value = !1, i.open({
482
482
  title: r("common.success"),
483
483
  message: r("inventory.unit.create.success", { name: m.value.name }),
484
484
  type: "success"
485
485
  });
486
486
  } catch (t) {
487
- t instanceof Z || i.open({
487
+ t instanceof ee || i.open({
488
488
  title: r("inventory.unit.create.error.title"),
489
489
  message: r("inventory.unit.create.error.message"),
490
490
  type: "error"
@@ -502,7 +502,7 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
502
502
  type: "success"
503
503
  });
504
504
  } catch (t) {
505
- t instanceof Z || i.open({
505
+ t instanceof ee || i.open({
506
506
  title: r("inventory.unit.update.error.title"),
507
507
  message: r("inventory.unit.update.error.message"),
508
508
  type: "error"
@@ -511,110 +511,118 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
511
511
  n.value = !1;
512
512
  }
513
513
  }
514
- function U() {
514
+ function x() {
515
515
  var t, d;
516
516
  (d = (t = s.value) == null ? void 0 : t.validateInputs) == null || d.call(t);
517
517
  }
518
518
  function e() {
519
519
  switch (f.mode) {
520
- case w.READ:
520
+ case U.READ:
521
521
  return;
522
- case w.UPDATE:
522
+ case U.UPDATE:
523
523
  return g();
524
- case w.CREATE:
524
+ case U.CREATE:
525
525
  return u();
526
526
  }
527
527
  }
528
528
  return (t, d) => {
529
- const $ = E("FmButton"), D = E("FmSideSheet");
530
- return v(), T(D, {
529
+ const D = I("FmButton"), F = I("FmSideSheet");
530
+ return v(), T(F, {
531
531
  "model-value": a(o),
532
- "onUpdate:modelValue": d[3] || (d[3] = (x) => X(o) ? o.value = x : null),
532
+ "onUpdate:modelValue": d[3] || (d[3] = (S) => Z(o) ? o.value = S : null),
533
533
  header: c.value,
534
534
  "close-button": "",
535
535
  "dismiss-away": "",
536
536
  "max-width": 500
537
537
  }, {
538
- "side-sheet-footer": I(() => [
539
- l("div", Xe, [
540
- y($, {
538
+ "side-sheet-footer": R(() => [
539
+ l("div", et, [
540
+ y(D, {
541
541
  loading: n.value,
542
542
  label: p.value,
543
- onClick: U
543
+ onClick: x
544
544
  }, null, 8, ["loading", "label"]),
545
- y($, {
545
+ y(D, {
546
546
  disabled: n.value,
547
547
  label: a(r)("common.close"),
548
548
  variant: "tertiary",
549
- onClick: d[2] || (d[2] = (x) => o.value = !1)
549
+ onClick: d[2] || (d[2] = (S) => o.value = !1)
550
550
  }, null, 8, ["disabled", "label"])
551
551
  ])
552
552
  ]),
553
- default: I(() => [
554
- y(We, {
553
+ default: R(() => [
554
+ y(Ze, {
555
555
  class: "w-full",
556
556
  ref_key: "hasValidationExpose",
557
557
  ref: s,
558
558
  modelValue: a(m),
559
- "onUpdate:modelValue": d[0] || (d[0] = (x) => X(m) ? m.value = x : null),
559
+ "onUpdate:modelValue": d[0] || (d[0] = (S) => Z(m) ? m.value = S : null),
560
560
  mode: t.mode,
561
561
  disabled: n.value,
562
- "onClick:submit": d[1] || (d[1] = (x) => e())
562
+ "onClick:submit": d[1] || (d[1] = (S) => e())
563
563
  }, null, 8, ["modelValue", "mode", "disabled"])
564
564
  ]),
565
565
  _: 1
566
566
  }, 8, ["model-value", "header"]);
567
567
  };
568
568
  }
569
- }), et = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, tt = { class: "flex flex-col py-8" }, nt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, ot = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vt = /* @__PURE__ */ H({
569
+ }), 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" }, yt = /* @__PURE__ */ K({
570
570
  __name: "UnitView",
571
- setup(S) {
572
- const f = K(), b = pe(), i = V(() => f.units), { createUnit: r, updateUnit: o } = J(), { unitDialogProps: m, unitViewLoading: c } = xe(J()), { columnDefs: p } = Le();
573
- function s(d) {
574
- d === "add" && r();
571
+ setup(k) {
572
+ const f = G(), b = ve(), i = _(() => f.units), { createUnit: r, updateUnit: o } = Q(), { unitDialogProps: m, unitViewLoading: c } = he(Q()), { columnDefs: p } = je();
573
+ function s(D) {
574
+ D === "add" && r();
575
575
  }
576
- const n = R(""), u = V(() => c.value), { breakpoints: g } = ve(), U = V(() => g.value.xs || g.value.sm ? 10 : 20), e = Ue(), { t } = G();
577
- return (d, $) => {
578
- const D = E("FmTable");
579
- return v(), T(we, {
580
- title: a(t)("inventory.unit.title"),
576
+ const n = M(""), u = _(() => c.value), { breakpoints: g } = be(), x = _(() => g.value.xs || g.value.sm), e = _(() => x.value ? 10 : 20), t = Ce(), { t: d } = O();
577
+ return (D, F) => {
578
+ const S = I("FmTable");
579
+ return v(), T(ke, {
580
+ title: a(d)("inventory.unit.title"),
581
581
  actions: [
582
- { label: a(t)("inventory.unit.create.title"), value: "add", isPrimary: !0, prependIcon: "add" }
582
+ { label: a(d)("inventory.unit.create.title"), value: "add", isPrimary: !0, prependIcon: "add" }
583
583
  ],
584
584
  "onClick:action": s
585
585
  }, {
586
- default: I(() => [
587
- l("div", et, [
588
- y(Ce, {
586
+ default: R(() => [
587
+ l("div", {
588
+ class: ae([
589
+ "flex flex-col gap-8 max-h-full",
590
+ {
591
+ "p-0": x.value,
592
+ "px-24 ": !x.value
593
+ }
594
+ ])
595
+ }, [
596
+ y(Fe, {
589
597
  searchable: "",
590
598
  search: n.value,
591
- "onUpdate:search": $[0] || ($[0] = (x) => n.value = x)
599
+ "onUpdate:search": F[0] || (F[0] = (E) => n.value = E)
592
600
  }, null, 8, ["search"]),
593
- y(D, {
594
- style: se(a(e).tableHeight),
601
+ y(S, {
602
+ style: re(a(t).tableHeight),
595
603
  "column-defs": a(p),
596
604
  "row-data": i.value,
597
605
  "search-value": n.value,
598
606
  loading: !a(b)._currentLocation || u.value,
599
- onRowClick: $[1] || ($[1] = (x) => a(o)(x.original)),
600
- "page-size": U.value
607
+ onRowClick: F[1] || (F[1] = (E) => a(o)(E.original)),
608
+ "page-size": e.value
601
609
  }, {
602
- "list-row": I((x) => [
603
- y(he, {
604
- row: x,
610
+ "list-row": R((E) => [
611
+ y(Ue, {
612
+ row: E,
605
613
  onRowClick: a(o)
606
614
  }, {
607
- default: I((B) => {
608
- var M, F, _, C, P, A, Q, L, W;
615
+ default: R((P) => {
616
+ var C, h, $, A, B, z, W, L, X;
609
617
  return [
610
- l("div", tt, [
611
- l("div", nt, [
612
- y(a(Ve), {
613
- render: (_ = (F = (M = B.name) == null ? void 0 : M.column) == null ? void 0 : F.columnDef) == null ? void 0 : _.cell,
614
- props: (P = (C = B.name) == null ? void 0 : C.getContext) == null ? void 0 : P.call(C)
618
+ l("div", nt, [
619
+ l("div", ot, [
620
+ y(a(we), {
621
+ render: ($ = (h = (C = P.name) == null ? void 0 : C.column) == null ? void 0 : h.columnDef) == null ? void 0 : $.cell,
622
+ props: (B = (A = P.name) == null ? void 0 : A.getContext) == null ? void 0 : B.call(A)
615
623
  }, null, 8, ["render", "props"])
616
624
  ]),
617
- l("div", ot, h((W = (L = (Q = (A = x.original.measurements) == null ? void 0 : A.map) == null ? void 0 : Q.call(A, (le) => le.name)) == null ? void 0 : L.join) == null ? void 0 : W.call(L, ", ")), 1)
625
+ 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)
618
626
  ])
619
627
  ];
620
628
  }),
@@ -623,9 +631,9 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
623
631
  ]),
624
632
  _: 1
625
633
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
626
- ]),
627
- (v(), T(ae, { to: "body" }, [
628
- y(Ze, re(ie(a(m))), null, 16)
634
+ ], 2),
635
+ (v(), T(ie, { to: "body" }, [
636
+ y(tt, ue(de(a(m))), null, 16)
629
637
  ]))
630
638
  ]),
631
639
  _: 1
@@ -634,5 +642,5 @@ const ze = { class: "flex flex-col gap-24" }, je = { class: "flex gap-24" }, Ne
634
642
  }
635
643
  });
636
644
  export {
637
- vt as default
645
+ yt as default
638
646
  };