@feedmepos/mf-inventory-portal 0.0.7-dev.3 → 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 (39) hide show
  1. package/dist/{ApprovalView-DbvyMW1R.js → ApprovalView-D1CshEiL.js} +6 -6
  2. package/dist/{BindingsDialog-CyqLp0Mq.js → BindingsDialog-Box9e9MU.js} +2 -2
  3. package/dist/{BindingsPicker-XRdmN_Zn.js → BindingsPicker-BMU_18fI.js} +2 -2
  4. package/dist/{BindingsTable-ktdc9eb0.js → BindingsTable-CEmUUzD9.js} +3 -3
  5. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Bvc3EyUZ.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BfmFBfLR.js} +1 -1
  6. package/dist/{FmMultiselectDialog.vue_vue_type_script_setup_true_lang-YEAz0S0C.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-Bn3w9SMf.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-cNMSS0Ji.js} +1 -1
  8. package/dist/{IngredientsView-D8NwGu57.js → IngredientsView-Cx189ZUR.js} +202 -185
  9. package/dist/{IntegrationView-w0TXPcxZ.js → IntegrationView-eJmquyFT.js} +3 -3
  10. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BuP2g613.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CN1SVuzj.js} +5 -5
  11. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BRjAsTYp.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-B78Jnkqg.js → PurchaseOrderPrintPreview-8aVgWGlY.js} +1 -1
  14. package/dist/{ReceiveRequestView-BHKghS0r.js → ReceiveRequestView-DosAbeBl.js} +520 -495
  15. package/dist/{RecipeView-M7bw_AGS.js → RecipeView-_A-EOMMi.js} +7 -7
  16. package/dist/StockView-CpVv9gnP.js +1938 -0
  17. package/dist/{SupplierView-DgFjga62.js → SupplierView-CZmv0Zch.js} +208 -195
  18. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Djn88uN3.js → TransferDetails.vue_vue_type_script_setup_true_lang-DnMxN-Zl.js} +5 -5
  19. package/dist/{UnitView-Cjed2i4A.js → UnitView-CF48QegO.js} +6 -6
  20. package/dist/{WarehouseView-BbRXA9_p.js → WarehouseView-Pq4tKlGH.js} +3 -3
  21. package/dist/{app-C2kiRXHk.js → app-kk-I7El6.js} +187 -187
  22. package/dist/app.js +1 -1
  23. package/dist/components/PremiumBadge.vue.d.ts +11 -2
  24. package/dist/components/PreviewBadge.vue.d.ts +24 -0
  25. package/dist/{date2-1aCkDJKL.js → date2-C_MxkBzJ.js} +1 -1
  26. package/dist/{dayjs.min-BMCGIZaB.js → dayjs.min-B0-vxxmd.js} +2251 -2009
  27. package/dist/{decimal-76iBoy3n.js → decimal-CwL8K3v-.js} +1 -1
  28. package/dist/{fuzzy-CMzsp7th.js → fuzzy-CdBRA2rL.js} +1 -1
  29. package/dist/{init-date-range-CL5wzuE9.js → init-date-range-BkRJwJWl.js} +1 -1
  30. package/dist/{layout-BUVfQNxR.js → layout-Uo3EuS0G.js} +1 -1
  31. package/dist/{rules-C-XEHjZO.js → rules-DMCipsmW.js} +1 -1
  32. package/dist/stock-estimate-BRvddt7k.js +122 -0
  33. package/dist/{supplier-xM9dK1Aa.js → supplier-Ba-xLeGl.js} +1 -1
  34. package/dist/tsconfig.app.tsbuildinfo +1 -1
  35. package/dist/{use-inventory-binding-dialog-wlCHTAwl.js → use-inventory-binding-dialog-Bn0GdfHQ.js} +2 -2
  36. package/dist/{xlsx-DXl3cDnf.js → xlsx-DqXzQH_V.js} +628 -628
  37. package/package.json +3 -3
  38. package/dist/StockView-DL1LSMJR.js +0 -1953
  39. package/dist/stock-estimate-DvI651uK.js +0 -90
@@ -1,22 +1,23 @@
1
- import { defineComponent as K, mergeModels as Ve, useModel as ge, resolveComponent as w, openBlock as F, createElementBlock as R, createElementVNode as u, createVNode as i, Fragment as _e, renderList as Se, toDisplayString as ue, unref as m, withCtx as D, computed as V, ref as T, createBlock as E, createCommentVNode as fe, isRef as de, normalizeStyle as xe, Teleport as Ce } from "vue";
2
- import { u as ve } from "./supplier-xM9dK1Aa.js";
3
- import { D as ie, R as z, F as h } from "./row-action.enum-BwQbURNh.js";
4
- import { c as he, _ as we, F as Y, u as ke } from "./layout-BUVfQNxR.js";
5
- import { c as me, u as Fe, d as ce, g as Ie, C as j, a as Ae, e as Ue } from "./app-C2kiRXHk.js";
6
- import { useDialog as be, useSnackbar as ye, useProxiedModel as pe, useBreakpoints as $e } from "@feedmepos/ui-library";
1
+ import { defineComponent as K, mergeModels as Ve, useModel as ge, resolveComponent as w, openBlock as F, createElementBlock as R, createElementVNode as r, createVNode as d, withCtx as D, Fragment as _e, renderList as xe, toDisplayString as ue, unref as m, computed as V, ref as T, createBlock as E, createCommentVNode as fe, isRef as de, normalizeStyle as Se, Teleport as Ce } from "vue";
2
+ import { u as ve } from "./supplier-Ba-xLeGl.js";
3
+ import { D as ie, R as B, F as h } from "./row-action.enum-BwQbURNh.js";
4
+ import { c as he, _ as we, F as Y, u as ke } from "./layout-Uo3EuS0G.js";
5
+ import { c as me, u as Fe, d as ce, g as Ie, C as j, a as $e, e as Ae } from "./app-kk-I7El6.js";
6
+ import { useDialog as be, useSnackbar as ye, useProxiedModel as pe, useBreakpoints as Ue } from "@feedmepos/ui-library";
7
7
  import { _ as Pe } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CFjO4TPG.js";
8
- import { _ as Me } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Bvc3EyUZ.js";
9
- import { A as De, M as Te, R as $ } from "./rules-C-XEHjZO.js";
10
- import { _ as Re } from "./FmMultiselectDialog.vue_vue_type_script_setup_true_lang-YEAz0S0C.js";
8
+ import { _ as Me } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BfmFBfLR.js";
9
+ import { A as De, M as Te, R as U } from "./rules-DMCipsmW.js";
10
+ import { _ as Re } from "./FmMultiselectDialog.vue_vue_type_script_setup_true_lang-izsN_Y6x.js";
11
11
  import { useCoreStore as Ee } from "@feedmepos/mf-common";
12
- import { a as Ne, t as qe } from "./date2-1aCkDJKL.js";
13
- function Le(P, C) {
12
+ import { a as Ne, t as qe } from "./date2-C_MxkBzJ.js";
13
+ import { _ as Le } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-BvadeWUz.js";
14
+ function ze(P, C) {
14
15
  function g(o, v) {
15
- if (o === z.Edit) {
16
+ if (o === B.Edit) {
16
17
  P(me(v));
17
18
  return;
18
19
  }
19
- if (o === z.Delete) {
20
+ if (o === B.Delete) {
20
21
  C(me(v));
21
22
  return;
22
23
  }
@@ -51,7 +52,7 @@ function Le(P, C) {
51
52
  header: "",
52
53
  cell(o) {
53
54
  return he(
54
- [ie[z.Edit], ie[z.Delete]],
55
+ [ie[B.Edit], ie[B.Delete]],
55
56
  (v) => {
56
57
  g(v, o.row.original);
57
58
  }
@@ -65,7 +66,7 @@ function Le(P, C) {
65
66
  }
66
67
  ] };
67
68
  }
68
- const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center gap-8 py-8" }, Ye = /* @__PURE__ */ u("div", { class: "fm-typo-en-title-sm-800 flex-1" }, "Supply items", -1), Ke = { class: "fm-typo-en-body-lg-400 flex-1" }, je = { class: "flex-1" }, Ge = { class: "flex items-center gap-4" }, He = { class: "flex-1" }, Oe = { class: "text-fm-color-typo-secondary" }, We = /* @__PURE__ */ u("div", { class: "text-fm-color-typo-secondary" }, "/", -1), Je = { class: "flex-1" }, Qe = /* @__PURE__ */ K({
69
+ const Be = { class: "flex flex-col gap-12" }, Ye = { class: "flex flex-col" }, Ke = { class: "flex items-center gap-8 py-8" }, je = { class: "flex-1" }, Ge = /* @__PURE__ */ r("div", { class: "fm-typo-en-title-sm-800" }, "Supply items", -1), He = /* @__PURE__ */ r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Overrides price per unit in ingredient. ", -1), Oe = { class: "flex flex-col gap-4" }, We = { class: "fm-typo-en-body-lg-400 flex-1" }, Je = { class: "flex-1" }, Qe = { class: "flex items-center gap-4" }, Xe = { class: "flex-1" }, Ze = { class: "text-fm-color-typo-secondary" }, et = /* @__PURE__ */ r("div", { class: "text-fm-color-typo-secondary" }, "/", -1), tt = { class: "flex-1" }, lt = /* @__PURE__ */ K({
69
70
  __name: "SupplierSupplyItemField",
70
71
  props: /* @__PURE__ */ Ve({
71
72
  modelValue: {}
@@ -77,12 +78,12 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
77
78
  setup(P) {
78
79
  const C = Ee(), g = Fe(), a = be(), o = ge(P, "modelValue");
79
80
  function v() {
80
- var r;
81
+ var u;
81
82
  const c = g.skus.map((l) => ({
82
83
  label: l.name,
83
84
  sublabel: l.code,
84
85
  value: l._id
85
- })), f = ((r = o.value) == null ? void 0 : r.map((l) => l.skuId)) ?? [], d = V(
86
+ })), f = ((u = o.value) == null ? void 0 : u.map((l) => l.skuId)) ?? [], i = V(
86
87
  () => {
87
88
  var l;
88
89
  return ((l = Ie(C.currentCountry.value)) == null ? void 0 : l.currency) ?? "MYR";
@@ -109,13 +110,13 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
109
110
  const s = l.map((e) => g.skuById[e]).filter((e) => e);
110
111
  s.sort((e, p) => e.code.localeCompare(p.code));
111
112
  const t = s.map((e) => {
112
- var U;
113
- const p = (U = o.value) == null ? void 0 : U.find((n) => n.skuId === e._id);
113
+ var A;
114
+ const p = (A = o.value) == null ? void 0 : A.find((n) => n.skuId === e._id);
114
115
  return p || {
115
116
  skuId: e._id,
116
117
  defaultCost: e.defaultCost ?? {
117
118
  costPerUnit: {
118
- currency: d.value,
119
+ currency: i.value,
119
120
  amount: 0,
120
121
  precision: 2
121
122
  }
@@ -126,18 +127,18 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
126
127
  });
127
128
  }
128
129
  function _(c) {
129
- var r, l;
130
- const d = (l = (r = (o.value ?? []).at(c)) == null ? void 0 : r.defaultCost) == null ? void 0 : l.costPerUnit;
131
- return d ? +Ne(d) : 0;
130
+ var u, l;
131
+ const i = (l = (u = (o.value ?? []).at(c)) == null ? void 0 : u.defaultCost) == null ? void 0 : l.costPerUnit;
132
+ return i ? +Ne(i) : 0;
132
133
  }
133
134
  function I(c, f) {
134
- var d;
135
- o.value = (d = o.value) == null ? void 0 : d.map((r, l) => l !== c ? r : {
136
- ...r,
135
+ var i;
136
+ o.value = (i = o.value) == null ? void 0 : i.map((u, l) => l !== c ? u : {
137
+ ...u,
137
138
  defaultCost: {
138
- ...r.defaultCost,
139
+ ...u.defaultCost,
139
140
  costPerUnit: {
140
- ...r.defaultCost.costPerUnit,
141
+ ...u.defaultCost.costPerUnit,
141
142
  ...qe(+f, 4)
142
143
  }
143
144
  }
@@ -155,37 +156,37 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
155
156
  return "MYR";
156
157
  }
157
158
  }
158
- function A(c) {
159
+ function $(c) {
159
160
  const f = g.skuById[c];
160
161
  if (!f)
161
162
  return [];
162
- const d = f.unit.measurements ?? [];
163
+ const i = f.unit.measurements ?? [];
163
164
  return [
164
165
  {
165
166
  label: f.unit.abbrev,
166
167
  value: null
167
168
  },
168
- ...d.map((l) => ({
169
+ ...i.map((l) => ({
169
170
  label: l.abbrev,
170
171
  value: l
171
172
  }))
172
173
  ];
173
174
  }
174
- function S(c) {
175
- const d = (o.value ?? []).find((s) => s.skuId === c), r = g.skuById[c];
176
- if (!d || !r) return null;
177
- const l = A(c);
178
- return d.defaultCost.measurement ? l.find((s) => {
175
+ function x(c) {
176
+ const i = (o.value ?? []).find((s) => s.skuId === c), u = g.skuById[c];
177
+ if (!i || !u) return null;
178
+ const l = $(c);
179
+ return i.defaultCost.measurement ? l.find((s) => {
179
180
  var t, e;
180
- return ((t = s.value) == null ? void 0 : t.id) === ((e = d.defaultCost.measurement) == null ? void 0 : e.id);
181
+ return ((t = s.value) == null ? void 0 : t.id) === ((e = i.defaultCost.measurement) == null ? void 0 : e.id);
181
182
  }) : l.find((s) => s.value === null);
182
183
  }
183
184
  function k(c, f) {
184
- const d = o.value ?? [];
185
- o.value = d.map((r) => r.skuId !== c ? r : f ? (r.defaultCost.measurement = f, r) : {
186
- ...r,
185
+ const i = o.value ?? [];
186
+ o.value = i.map((u) => u.skuId !== c ? u : f ? (u.defaultCost.measurement = f, u) : {
187
+ ...u,
187
188
  defaultCost: {
188
- ...r.defaultCost,
189
+ ...u.defaultCost,
189
190
  measurement: null
190
191
  }
191
192
  });
@@ -195,70 +196,82 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
195
196
  f.splice(c, 1), o.value = f;
196
197
  }
197
198
  return (c, f) => {
198
- const d = w("FmButton"), r = w("FmTextField"), l = w("FmSelect");
199
+ const i = w("FmButton"), u = w("FmTextField"), l = w("FmSelect");
199
200
  return F(), R("div", Be, [
200
- u("div", ze, [
201
- Ye,
202
- u("div", null, [
203
- i(d, {
204
- "prepend-icon": "link",
205
- label: "Add items",
206
- variant: "plain",
207
- onClick: v
208
- })
209
- ])
210
- ]),
211
- (F(!0), R(_e, null, Se(o.value, (s, t) => {
212
- var e, p;
213
- return F(), R("div", {
214
- key: s.skuId,
215
- class: "flex items-center"
216
- }, [
217
- u("div", Ke, ue((e = m(g).skuById[s.skuId]) == null ? void 0 : e.name), 1),
218
- u("div", je, [
219
- u("div", Ge, [
220
- u("div", He, [
221
- i(r, {
222
- "model-value": _(t),
223
- "onUpdate:modelValue": (x) => I(t, x),
224
- rules: [m(De)(0), m(Te)(2)],
225
- "label-mark": "required"
226
- }, {
227
- prepend: D(() => {
228
- var x, U;
229
- return [
230
- u("div", Oe, ue(b(((x = m(C).currentCountry) == null ? void 0 : x.value) ?? m(ce)) === "MYR" ? "RM" : b(((U = m(C).currentCountry) == null ? void 0 : U.value) ?? m(ce))), 1)
231
- ];
232
- }),
233
- _: 2
234
- }, 1032, ["model-value", "onUpdate:modelValue", "rules"])
201
+ r("div", Ye, [
202
+ r("div", Ke, [
203
+ r("div", je, [
204
+ d(Le, { "z-index": 50 }, {
205
+ default: D(() => [
206
+ Ge
235
207
  ]),
236
- We,
237
- u("div", Je, [
238
- i(l, {
239
- items: A(s.skuId),
240
- "model-value": (p = S(s.skuId)) == null ? void 0 : p.value,
241
- "onUpdate:modelValue": (x) => k(s.skuId, x)
242
- }, null, 8, ["items", "model-value", "onUpdate:modelValue"])
243
- ]),
244
- u("div", null, [
245
- i(d, {
246
- "prepend-icon": "close",
247
- variant: "tertiary",
248
- onClick: (x) => y(t)
249
- }, null, 8, ["onClick"])
208
+ _: 1
209
+ })
210
+ ]),
211
+ r("div", null, [
212
+ d(i, {
213
+ "prepend-icon": "link",
214
+ label: "Add items",
215
+ variant: "plain",
216
+ onClick: v
217
+ })
218
+ ])
219
+ ]),
220
+ He
221
+ ]),
222
+ r("div", Oe, [
223
+ (F(!0), R(_e, null, xe(o.value, (s, t) => {
224
+ var e, p;
225
+ return F(), R("div", {
226
+ key: s.skuId,
227
+ class: "flex items-center"
228
+ }, [
229
+ r("div", We, ue((e = m(g).skuById[s.skuId]) == null ? void 0 : e.name), 1),
230
+ r("div", Je, [
231
+ r("div", Qe, [
232
+ r("div", Xe, [
233
+ d(u, {
234
+ "model-value": _(t),
235
+ "onUpdate:modelValue": (S) => I(t, S),
236
+ rules: [m(De)(0), m(Te)(2)],
237
+ "label-mark": "required"
238
+ }, {
239
+ prepend: D(() => {
240
+ var S, A;
241
+ return [
242
+ r("div", Ze, ue(b(((S = m(C).currentCountry) == null ? void 0 : S.value) ?? m(ce)) === "MYR" ? "RM" : b(((A = m(C).currentCountry) == null ? void 0 : A.value) ?? m(ce))), 1)
243
+ ];
244
+ }),
245
+ _: 2
246
+ }, 1032, ["model-value", "onUpdate:modelValue", "rules"])
247
+ ]),
248
+ et,
249
+ r("div", tt, [
250
+ d(l, {
251
+ items: $(s.skuId),
252
+ "model-value": (p = x(s.skuId)) == null ? void 0 : p.value,
253
+ "onUpdate:modelValue": (S) => k(s.skuId, S)
254
+ }, null, 8, ["items", "model-value", "onUpdate:modelValue"])
255
+ ]),
256
+ r("div", null, [
257
+ d(i, {
258
+ "prepend-icon": "close",
259
+ variant: "tertiary",
260
+ onClick: (S) => y(t)
261
+ }, null, 8, ["onClick"])
262
+ ])
250
263
  ])
251
264
  ])
252
- ])
253
- ]);
254
- }), 128))
265
+ ]);
266
+ }), 128))
267
+ ])
255
268
  ]);
256
269
  };
257
270
  }
258
- }), Xe = { class: "flex flex-col gap-40" }, Ze = { class: "flex flex-col gap-16" }, et = { class: "flex flex-col gap-8" }, tt = /* @__PURE__ */ u("div", { class: "fm-typo-en-title-sm-800" }, "Address", -1), lt = { class: "grid grid-cols-2 gap-24" }, ot = { class: "flex flex-col gap-8" }, st = /* @__PURE__ */ u("div", { class: "fm-typo-en-title-sm-800" }, "Contact", -1), at = { class: "flex flex-col gap-16" }, nt = {
271
+ }), ot = { class: "flex flex-col gap-40" }, st = { class: "flex flex-col gap-16" }, at = { class: "flex flex-col gap-8" }, nt = /* @__PURE__ */ r("div", { class: "fm-typo-en-title-sm-800" }, "Address", -1), rt = { class: "grid grid-cols-2 gap-24" }, ut = { class: "flex flex-col gap-8" }, dt = /* @__PURE__ */ r("div", { class: "fm-typo-en-title-sm-800" }, "Contact", -1), it = { class: "flex flex-col gap-16" }, mt = {
259
272
  key: 0,
260
273
  class: "flex flex-col gap-8"
261
- }, rt = /* @__PURE__ */ K({
274
+ }, ct = /* @__PURE__ */ K({
262
275
  __name: "SupplierForm",
263
276
  props: {
264
277
  modelValue: {},
@@ -266,7 +279,7 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
266
279
  },
267
280
  emits: ["update:modelValue", "validation-success"],
268
281
  setup(P, { expose: C, emit: g }) {
269
- const a = P, o = g, v = Ae(), _ = V({
282
+ const a = P, o = g, v = $e(), _ = V({
270
283
  get() {
271
284
  var t;
272
285
  return ((t = a.modelValue) == null ? void 0 : t.name) ?? "";
@@ -293,7 +306,7 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
293
306
  const e = a.modelValue ?? {};
294
307
  e.address ?? (e.address = {}), e.address.line1 = t, o("update:modelValue", e);
295
308
  }
296
- }), A = V({
309
+ }), $ = V({
297
310
  get() {
298
311
  var t, e;
299
312
  return ((e = (t = a.modelValue) == null ? void 0 : t.address) == null ? void 0 : e.line2) ?? "";
@@ -302,7 +315,7 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
302
315
  const e = a.modelValue ?? {};
303
316
  e.address ?? (e.address = {}), e.address.line2 = t, o("update:modelValue", e);
304
317
  }
305
- }), S = V({
318
+ }), x = V({
306
319
  get() {
307
320
  var t, e;
308
321
  return ((e = (t = a.modelValue) == null ? void 0 : t.address) == null ? void 0 : e.city) ?? "";
@@ -347,7 +360,7 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
347
360
  const e = a.modelValue ?? {};
348
361
  e.contactName = t, o("update:modelValue", e);
349
362
  }
350
- }), d = V({
363
+ }), i = V({
351
364
  get() {
352
365
  var t;
353
366
  return ((t = a.modelValue) == null ? void 0 : t.phoneNumber) ?? "";
@@ -356,7 +369,7 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
356
369
  const e = a.modelValue ?? {};
357
370
  e.phoneNumber = t, o("update:modelValue", e);
358
371
  }
359
- }), r = V({
372
+ }), u = V({
360
373
  get() {
361
374
  var t;
362
375
  return ((t = a.modelValue) == null ? void 0 : t.email) ?? "";
@@ -389,77 +402,77 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
389
402
  (e = (t = s.value) == null ? void 0 : t.resetInputs) == null || e.call(t);
390
403
  }
391
404
  }), (t, e) => {
392
- const p = w("FmTextField"), x = w("FmPhoneNumber"), U = w("FmForm");
393
- return F(), E(U, {
405
+ const p = w("FmTextField"), S = w("FmPhoneNumber"), A = w("FmForm");
406
+ return F(), E(A, {
394
407
  ref_key: "formRef",
395
408
  ref: s,
396
409
  onValidationSuccess: e[12] || (e[12] = (n) => o("validation-success"))
397
410
  }, {
398
411
  default: D(() => [
399
- u("div", Xe, [
400
- u("div", Ze, [
401
- i(p, {
412
+ r("div", ot, [
413
+ r("div", st, [
414
+ d(p, {
402
415
  disabled: t.disabled,
403
- rules: [m($)()],
416
+ rules: [m(U)()],
404
417
  "label-mark": "required",
405
418
  label: "Company name",
406
419
  modelValue: _.value,
407
420
  "onUpdate:modelValue": e[0] || (e[0] = (n) => _.value = n)
408
421
  }, null, 8, ["disabled", "rules", "modelValue"]),
409
- i(p, {
422
+ d(p, {
410
423
  disabled: t.disabled,
411
- rules: [m($)()],
424
+ rules: [m(U)()],
412
425
  "label-mark": "required",
413
426
  label: "Registration no.",
414
427
  modelValue: I.value,
415
428
  "onUpdate:modelValue": e[1] || (e[1] = (n) => I.value = n)
416
429
  }, null, 8, ["disabled", "rules", "modelValue"])
417
430
  ]),
418
- u("div", et, [
419
- tt,
420
- u("div", lt, [
421
- i(p, {
431
+ r("div", at, [
432
+ nt,
433
+ r("div", rt, [
434
+ d(p, {
422
435
  disabled: t.disabled,
423
- rules: [m($)()],
436
+ rules: [m(U)()],
424
437
  "label-mark": "required",
425
438
  label: "Line 1",
426
439
  modelValue: b.value,
427
440
  "onUpdate:modelValue": e[2] || (e[2] = (n) => b.value = n)
428
441
  }, null, 8, ["disabled", "rules", "modelValue"]),
429
- i(p, {
442
+ d(p, {
430
443
  disabled: t.disabled,
431
444
  "label-mark": "optional",
432
445
  label: "Line 2",
433
- modelValue: A.value,
434
- "onUpdate:modelValue": e[3] || (e[3] = (n) => A.value = n)
446
+ modelValue: $.value,
447
+ "onUpdate:modelValue": e[3] || (e[3] = (n) => $.value = n)
435
448
  }, null, 8, ["disabled", "modelValue"]),
436
- i(p, {
449
+ d(p, {
437
450
  disabled: t.disabled,
438
- rules: [m($)()],
451
+ rules: [m(U)()],
439
452
  "label-mark": "required",
440
453
  label: "City",
441
- modelValue: S.value,
442
- "onUpdate:modelValue": e[4] || (e[4] = (n) => S.value = n)
454
+ modelValue: x.value,
455
+ "onUpdate:modelValue": e[4] || (e[4] = (n) => x.value = n)
443
456
  }, null, 8, ["disabled", "rules", "modelValue"]),
444
- i(p, {
457
+ d(p, {
445
458
  disabled: t.disabled,
446
- rules: [m($)()],
459
+ rules: [m(U)()],
447
460
  "label-mark": "required",
448
461
  label: "Postal code",
449
462
  modelValue: k.value,
450
463
  "onUpdate:modelValue": e[5] || (e[5] = (n) => k.value = n)
451
464
  }, null, 8, ["disabled", "rules", "modelValue"]),
452
- i(p, {
465
+ d(p, {
453
466
  disabled: t.disabled,
454
- rules: [m($)()],
467
+ rules: [m(U)()],
455
468
  "label-mark": "required",
456
469
  label: "State",
457
470
  modelValue: y.value,
458
471
  "onUpdate:modelValue": e[6] || (e[6] = (n) => y.value = n)
459
472
  }, null, 8, ["disabled", "rules", "modelValue"]),
460
- i(p, {
473
+ d(p, {
461
474
  disabled: t.disabled,
462
- rules: [m($)()],
475
+ rules: [m(U)()],
463
476
  "label-mark": "required",
464
477
  label: "Country",
465
478
  modelValue: c.value,
@@ -467,36 +480,36 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
467
480
  }, null, 8, ["disabled", "rules", "modelValue"])
468
481
  ])
469
482
  ]),
470
- u("div", ot, [
471
- st,
472
- u("div", at, [
473
- i(p, {
483
+ r("div", ut, [
484
+ dt,
485
+ r("div", it, [
486
+ d(p, {
474
487
  disabled: t.disabled,
475
- rules: [m($)()],
488
+ rules: [m(U)()],
476
489
  "label-mark": "required",
477
490
  label: "PIC",
478
491
  modelValue: f.value,
479
492
  "onUpdate:modelValue": e[8] || (e[8] = (n) => f.value = n)
480
493
  }, null, 8, ["disabled", "rules", "modelValue"]),
481
- i(x, {
494
+ d(S, {
482
495
  disabled: t.disabled,
483
- rules: [m($)()],
496
+ rules: [m(U)()],
484
497
  "label-mark": "required",
485
498
  label: "Phone number",
486
- modelValue: d.value,
487
- "onUpdate:modelValue": e[9] || (e[9] = (n) => d.value = n)
499
+ modelValue: i.value,
500
+ "onUpdate:modelValue": e[9] || (e[9] = (n) => i.value = n)
488
501
  }, null, 8, ["disabled", "rules", "modelValue"]),
489
- i(p, {
502
+ d(p, {
490
503
  disabled: t.disabled,
491
504
  "label-mark": "optional",
492
505
  label: "Email",
493
- modelValue: r.value,
494
- "onUpdate:modelValue": e[10] || (e[10] = (n) => r.value = n)
506
+ modelValue: u.value,
507
+ "onUpdate:modelValue": e[10] || (e[10] = (n) => u.value = n)
495
508
  }, null, 8, ["disabled", "modelValue"])
496
509
  ])
497
510
  ]),
498
- m(v).enableTotalCost ? (F(), R("div", nt, [
499
- i(Qe, {
511
+ m(v).enableTotalCost ? (F(), R("div", mt, [
512
+ d(lt, {
500
513
  modelValue: l.value,
501
514
  "onUpdate:modelValue": e[11] || (e[11] = (n) => l.value = n)
502
515
  }, null, 8, ["modelValue"])
@@ -507,7 +520,7 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
507
520
  }, 512);
508
521
  };
509
522
  }
510
- }), ut = { class: "flex gap-4" }, dt = /* @__PURE__ */ K({
523
+ }), pt = { class: "flex gap-4" }, ft = /* @__PURE__ */ K({
511
524
  __name: "SupplierDialog",
512
525
  props: {
513
526
  mode: {},
@@ -526,7 +539,7 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
526
539
  return "Edit supplier";
527
540
  }
528
541
  return "";
529
- }), A = V(() => {
542
+ }), $ = V(() => {
530
543
  switch (a.mode) {
531
544
  case h.READ:
532
545
  return "";
@@ -536,37 +549,37 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
536
549
  return "Add";
537
550
  }
538
551
  return "";
539
- }), S = T();
552
+ }), x = T();
540
553
  C({
541
554
  validateInputs: () => {
542
555
  var l, s;
543
- (s = (l = S.value) == null ? void 0 : l.validateInputs) == null || s.call(l);
556
+ (s = (l = x.value) == null ? void 0 : l.validateInputs) == null || s.call(l);
544
557
  },
545
558
  resetInputsValidation: () => {
546
559
  var l, s;
547
- (s = (l = S.value) == null ? void 0 : l.resetInputsValidation) == null || s.call(l);
560
+ (s = (l = x.value) == null ? void 0 : l.resetInputsValidation) == null || s.call(l);
548
561
  },
549
562
  resetInputs: () => {
550
563
  var l, s;
551
- (s = (l = S.value) == null ? void 0 : l.resetInputs) == null || s.call(l);
564
+ (s = (l = x.value) == null ? void 0 : l.resetInputs) == null || s.call(l);
552
565
  }
553
566
  });
554
567
  const k = pe(a, "show"), y = pe(a, "supplier");
555
568
  function c() {
556
569
  var l, s;
557
- (s = (l = S.value) == null ? void 0 : l.validateInputs) == null || s.call(l);
570
+ (s = (l = x.value) == null ? void 0 : l.validateInputs) == null || s.call(l);
558
571
  }
559
572
  function f() {
560
573
  switch (a.mode) {
561
574
  case h.READ:
562
575
  return;
563
576
  case h.UPDATE:
564
- return r();
577
+ return u();
565
578
  case h.CREATE:
566
- return d();
579
+ return i();
567
580
  }
568
581
  }
569
- async function d() {
582
+ async function i() {
570
583
  v.value = !0;
571
584
  try {
572
585
  await Promise.all([
@@ -587,7 +600,7 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
587
600
  v.value = !1;
588
601
  }
589
602
  }
590
- async function r() {
603
+ async function u() {
591
604
  if (y.value === null) {
592
605
  _.open({
593
606
  title: "Something went wrong",
@@ -629,12 +642,12 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
629
642
  default: D(() => {
630
643
  var p;
631
644
  return [
632
- (F(), E(rt, {
645
+ (F(), E(ct, {
633
646
  class: "w-full",
634
647
  ref_key: "formRef",
635
- ref: S,
648
+ ref: x,
636
649
  modelValue: m(y),
637
- "onUpdate:modelValue": s[0] || (s[0] = (x) => de(y) ? y.value = x : null),
650
+ "onUpdate:modelValue": s[0] || (s[0] = (S) => de(y) ? y.value = S : null),
638
651
  onValidationSuccess: f,
639
652
  key: ((p = l.supplier) == null ? void 0 : p._id) ?? "",
640
653
  disabled: v.value
@@ -642,10 +655,10 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
642
655
  ];
643
656
  }),
644
657
  "side-sheet-footer": D(() => [
645
- u("div", ut, [
646
- i(t, {
658
+ r("div", pt, [
659
+ d(t, {
647
660
  loading: v.value,
648
- label: A.value,
661
+ label: $.value,
649
662
  onClick: c
650
663
  }, null, 8, ["loading", "label"])
651
664
  ])
@@ -654,13 +667,13 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
654
667
  }, 8, ["header", "modelValue", "dismiss-away"]);
655
668
  };
656
669
  }
657
- }), it = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, mt = { class: "px-8 flex gap-8 items-center xs:gap-0 xs:flex-col-reverse sm:gap-0 sm:flex-col-reverse" }, ct = { class: "xs:w-full sm:w-full flex gap-8 items-center overflow-x-auto no-scrollbar py-8" }, pt = { class: "flex-grow xs:w-full" }, ft = { class: "flex flex-col py-8" }, vt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, yt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vt = {
670
+ }), vt = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, bt = { class: "px-8 flex gap-8 items-center xs:gap-0 xs:flex-col-reverse sm:gap-0 sm:flex-col-reverse" }, yt = { class: "xs:w-full sm:w-full flex gap-8 items-center overflow-x-auto no-scrollbar py-8" }, Vt = { class: "flex-grow xs:w-full" }, gt = { class: "flex flex-col py-8" }, _t = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, xt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, St = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ct = {
658
671
  key: 0,
659
672
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
660
- }, $t = /* @__PURE__ */ K({
673
+ }, Et = /* @__PURE__ */ K({
661
674
  __name: "SupplierView",
662
675
  setup(P) {
663
- const C = ve(), g = Ue(), a = T(!1), o = be(), v = ye();
676
+ const C = ve(), g = Ae(), a = T(!1), o = be(), v = ye();
664
677
  g.watchLocation(_);
665
678
  async function _(t) {
666
679
  if (t) {
@@ -678,10 +691,10 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
678
691
  }
679
692
  }
680
693
  const I = V(() => C.suppliers), b = T({});
681
- function A() {
694
+ function $() {
682
695
  b.value.mode = h.CREATE, b.value.supplier = {}, b.value.show = !0;
683
696
  }
684
- function S(t) {
697
+ function x(t) {
685
698
  b.value.mode = h.UPDATE, b.value.supplier = t, b.value.show = !0;
686
699
  }
687
700
  async function k(t) {
@@ -720,73 +733,73 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
720
733
  o.close();
721
734
  }
722
735
  }
723
- const { columnDefs: c } = Le(S, k);
736
+ const { columnDefs: c } = ze(x, k);
724
737
  function f(t) {
725
- t === "create" && A();
738
+ t === "create" && $();
726
739
  }
727
- const d = T(""), { breakpoints: r } = $e(), l = V(() => r.value.xs || r.value.sm ? 10 : 20), s = ke();
740
+ const i = T(""), { breakpoints: u } = Ue(), l = V(() => u.value.xs || u.value.sm ? 10 : 20), s = ke();
728
741
  return (t, e) => {
729
- const p = w("FmTableToolbar"), x = w("FmMenuDivider"), U = w("FmTable");
742
+ const p = w("FmTableToolbar"), S = w("FmMenuDivider"), A = w("FmTable");
730
743
  return F(), E(Pe, {
731
744
  title: "Supplier",
732
745
  actions: [{ label: "Create supplier", value: "create", isPrimary: !0, prependIcon: "add" }],
733
746
  "onClick:action": f
734
747
  }, {
735
748
  default: D(() => [
736
- u("div", it, [
737
- u("div", mt, [
738
- u("div", ct, [
739
- i(Me)
749
+ r("div", vt, [
750
+ r("div", bt, [
751
+ r("div", yt, [
752
+ d(Me)
740
753
  ]),
741
- u("div", pt, [
742
- i(p, {
754
+ r("div", Vt, [
755
+ d(p, {
743
756
  searchable: "",
744
- "search-model": d.value,
745
- "onUpdate:searchModel": e[0] || (e[0] = (n) => d.value = n)
757
+ "search-model": i.value,
758
+ "onUpdate:searchModel": e[0] || (e[0] = (n) => i.value = n)
746
759
  }, null, 8, ["search-model"]),
747
- i(x, { class: "hidden xs:block" })
760
+ d(S, { class: "hidden xs:block" })
748
761
  ])
749
762
  ]),
750
- i(U, {
751
- style: xe(m(s).tableHeight),
763
+ d(A, {
764
+ style: Se(m(s).tableHeight),
752
765
  "column-defs": m(c),
753
766
  "row-data": I.value,
754
- "search-value": d.value,
767
+ "search-value": i.value,
755
768
  loading: !m(g)._currentLocation || a.value,
756
- onRowClick: e[1] || (e[1] = (n) => S(n.original)),
769
+ onRowClick: e[1] || (e[1] = (n) => x(n.original)),
757
770
  "page-size": l.value
758
771
  }, {
759
772
  "list-row": D((n) => [
760
- i(we, {
773
+ d(we, {
761
774
  row: n,
762
- onRowClick: S
775
+ onRowClick: x
763
776
  }, {
764
777
  default: D((M) => {
765
- var G, H, O, N, W, J, Q, X, q, Z, ee, te, le, L, oe, se, ae, ne, B, re;
778
+ var G, H, O, N, W, J, Q, X, q, Z, ee, te, le, L, oe, se, ae, ne, z, re;
766
779
  return [
767
- u("div", ft, [
768
- u("div", vt, [
769
- i(m(Y), {
780
+ r("div", gt, [
781
+ r("div", _t, [
782
+ d(m(Y), {
770
783
  render: (O = (H = (G = M.name) == null ? void 0 : G.column) == null ? void 0 : H.columnDef) == null ? void 0 : O.cell,
771
784
  props: (W = (N = M.name) == null ? void 0 : N.getContext) == null ? void 0 : W.call(N)
772
785
  }, null, 8, ["render", "props"])
773
786
  ]),
774
- u("div", bt, [
775
- i(m(Y), {
787
+ r("div", xt, [
788
+ d(m(Y), {
776
789
  render: (X = (Q = (J = M.contactName) == null ? void 0 : J.column) == null ? void 0 : Q.columnDef) == null ? void 0 : X.cell,
777
790
  props: (Z = (q = M.contactName) == null ? void 0 : q.getContext) == null ? void 0 : Z.call(q)
778
791
  }, null, 8, ["render", "props"])
779
792
  ]),
780
- u("div", yt, [
781
- i(m(Y), {
793
+ r("div", St, [
794
+ d(m(Y), {
782
795
  render: (le = (te = (ee = M.phoneNumber) == null ? void 0 : ee.column) == null ? void 0 : te.columnDef) == null ? void 0 : le.cell,
783
796
  props: (oe = (L = M.phoneNumber) == null ? void 0 : L.getContext) == null ? void 0 : oe.call(L)
784
797
  }, null, 8, ["render", "props"])
785
798
  ]),
786
- n.original.email ? (F(), R("div", Vt, [
787
- i(m(Y), {
799
+ n.original.email ? (F(), R("div", Ct, [
800
+ d(m(Y), {
788
801
  render: (ne = (ae = (se = M.email) == null ? void 0 : se.column) == null ? void 0 : ae.columnDef) == null ? void 0 : ne.cell,
789
- props: (re = (B = M.email) == null ? void 0 : B.getContext) == null ? void 0 : re.call(B)
802
+ props: (re = (z = M.email) == null ? void 0 : z.getContext) == null ? void 0 : re.call(z)
790
803
  }, null, 8, ["render", "props"])
791
804
  ])) : fe("", !0)
792
805
  ])
@@ -799,7 +812,7 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
799
812
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
800
813
  ]),
801
814
  (F(), E(Ce, { to: "body" }, [
802
- i(dt, {
815
+ d(ft, {
803
816
  show: b.value.show,
804
817
  "onUpdate:show": e[2] || (e[2] = (n) => b.value.show = n),
805
818
  supplier: b.value.supplier,
@@ -814,5 +827,5 @@ const Be = { class: "flex flex-col gap-4" }, ze = { class: "flex items-center ga
814
827
  }
815
828
  });
816
829
  export {
817
- $t as default
830
+ Et as default
818
831
  };