@feedmepos/mf-inventory-portal 0.0.24-dev.1 → 0.0.24-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/{App-D3sNH2MR.js → App-BB4XENeM.js} +1 -1
  2. package/dist/{ApprovalView-DHnRx0hJ.js → ApprovalView-DZAePC0L.js} +2 -2
  3. package/dist/{BindingsDialog-oTeg2Dai.js → BindingsDialog-D9I7xJPr.js} +2 -2
  4. package/dist/{BindingsPicker-CWdjmMJ3.js → BindingsPicker-D298qOIo.js} +1 -1
  5. package/dist/{BindingsTable-bKLR1OKX.js → BindingsTable-icsoROx_.js} +1 -1
  6. package/dist/{ClosingDraftView-CIQVz7lY.js → ClosingDraftView-CDIFl55J.js} +2 -2
  7. package/dist/{ClosingTemplateView-D5pLzQwU.js → ClosingTemplateView-B3sgGCgw.js} +1 -1
  8. package/dist/{FmCustomAttribute.vue_vue_type_script_setup_true_lang-ClLDcchC.js → FmCustomAttribute.vue_vue_type_script_setup_true_lang-Sgq1OQAe.js} +1 -1
  9. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C_boDzZI.js +286 -0
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DhpHOaRH.js → FmUnitInput.vue_vue_type_script_setup_true_lang-ByHVBLHt.js} +1 -1
  11. package/dist/{IngredientGroupView-4C437mso.js → IngredientGroupView-DrULhOXc.js} +1 -1
  12. package/dist/{IngredientsView-DoiGgjre.js → IngredientsView-CmVHwti-.js} +3 -3
  13. package/dist/{IntegrationView-8ZKE7MAM.js → IntegrationView-qFUn-4zs.js} +1 -1
  14. package/dist/{InventoryBindingForm-CcnfliYQ.js → InventoryBindingForm-C1xPd0CB.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-B_J-6C9x.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DQJHeGE9.js} +3 -3
  16. package/dist/{InventoryBindingSummary-CRdHCzNE.js → InventoryBindingSummary-0tdJMFOQ.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B2-TypU0.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-mdzrbF5Z.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BuQde75S.js → PremiumBadge.vue_vue_type_script_setup_true_lang-yLcNia4J.js} +1 -1
  19. package/dist/{PublishView-t5gjGmK_.js → PublishView-Cn1oAbmz.js} +2 -2
  20. package/dist/{PurchaseOrderPrintPreview-6i53Y-v1.js → PurchaseOrderPrintPreview-gZrApRzK.js} +1 -1
  21. package/dist/{ReceiveRequestView-uOeSh0Mr.js → ReceiveRequestView-D9YOnAog.js} +184 -174
  22. package/dist/{RecipeView-BTWywckD.js → RecipeView-CI4HwNjC.js} +3 -3
  23. package/dist/{StockView-DN2xk8ei.js → StockView-B6iv7SOV.js} +7 -7
  24. package/dist/{SupplierView-l0XUg3J4.js → SupplierView-CkaayHMA.js} +3 -3
  25. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CWMn6fFf.js → TransferDetails.vue_vue_type_script_setup_true_lang-BFPjBpwI.js} +3 -3
  26. package/dist/{TransferTemplateView-wDKXpCWZ.js → TransferTemplateView-CcdoKSZ2.js} +425 -404
  27. package/dist/{UnitView-CUI-k-tS.js → UnitView-DIU3UAdi.js} +3 -3
  28. package/dist/{WarehouseView-WsI_eG5r.js → WarehouseView-Bs95hEIK.js} +1 -1
  29. package/dist/{app-DntcWR3_.js → app-wfVkfux5.js} +89 -89
  30. package/dist/app.js +1 -1
  31. package/dist/{decimal-DTCTnMwO.js → decimal-EaJS2tkh.js} +1 -1
  32. package/dist/{format-unit-display-Hy48Iw5j.js → format-unit-display-BoJgjxR6.js} +2 -2
  33. package/dist/{index-Bv9RYyTZ.js → index-Ccyg4vxa.js} +3 -3
  34. package/dist/{index-D4yJP9I2.js → index-DuxMFNzG.js} +1 -1
  35. package/dist/{stock-BsdmfT-b.js → stock-BzPWMuAI.js} +1 -1
  36. package/dist/{supplier-CXhkgC4M.js → supplier-rNvX0bxV.js} +1 -1
  37. package/dist/tsconfig.app.tsbuildinfo +1 -1
  38. package/dist/{use-inventory-binding-dialog-DPMJmBCr.js → use-inventory-binding-dialog-Dq6yszq-.js} +1 -1
  39. package/dist/{vue-i18n-ByVzHsI7.js → vue-i18n-Bca6LQ7c.js} +209 -209
  40. package/package.json +3 -3
  41. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B_c6Vn6P.js +0 -282
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feedmepos/mf-inventory-portal",
3
- "version": "0.0.24-dev.1",
3
+ "version": "0.0.24-dev.2",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"
@@ -42,9 +42,9 @@
42
42
  "vue-router": "^4.4.0",
43
43
  "xlsx": "^0.18.5",
44
44
  "zod": "3.17.9",
45
- "@feedmepos/inventory-core": "^0.2.18",
46
45
  "@feedmepos/inventory-core-js": "^1.0.1",
47
- "@feedmepos/zod-inventory": "^1.0.10"
46
+ "@feedmepos/zod-inventory": "^1.0.10",
47
+ "@feedmepos/inventory-core": "^0.2.18"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@rushstack/eslint-patch": "^1.10.3",
@@ -1,282 +0,0 @@
1
- import { j as k, t as B, ao as w, u as H, at as I, aD as R, aE as M } from "./app-DntcWR3_.js";
2
- import { u as j } from "./supplier-CXhkgC4M.js";
3
- import { P as S } from "./format-unit-display-Hy48Iw5j.js";
4
- import { computed as y, defineComponent as $, mergeModels as W, useModel as J, resolveComponent as U, openBlock as T, createElementBlock as A, normalizeStyle as K, createElementVNode as D, createVNode as Q, withCtx as X, createBlock as x, createCommentVNode as E, Fragment as Y, renderList as Z, unref as V } from "vue";
5
- function z(l, r, e) {
6
- var s;
7
- if (!!r.measurement === !!e && ((s = r.measurement) == null ? void 0 : s.id) === e)
8
- return r;
9
- if (!e)
10
- return {
11
- costPerUnit: r.costPerUnit
12
- };
13
- const o = l.measurements.find((i) => i.id === e);
14
- return o ? {
15
- costPerUnit: r.costPerUnit,
16
- measurement: o
17
- } : {
18
- costPerUnit: r.costPerUnit
19
- };
20
- }
21
- function oe(l, r, e, n) {
22
- var b, g, u;
23
- if (n != null && n.manualTotalCost)
24
- return n == null ? void 0 : n.manualTotalCost;
25
- const t = (u = (g = (b = n == null ? void 0 : n.supplier) == null ? void 0 : b.supplyItems) == null ? void 0 : g.find(
26
- (a) => a.skuId === l._id
27
- )) == null ? void 0 : u.defaultCost, o = l.defaultCost ? z(l.unit, l.defaultCost, l.trackingMeasurement) : void 0, s = t ?? o, i = s == null ? void 0 : s.costPerUnit, c = i ? s != null && s.measurement ? +k(i) / +k(s == null ? void 0 : s.measurement.conversion) : +k(i) : void 0, p = c ? e ? c * +k(e.conversion) : c : void 0, f = p ? +k(r) * p : void 0;
28
- return f ? {
29
- ...B(f ?? 0, 2),
30
- currency: w()
31
- } : {
32
- amount: 0,
33
- precision: 0,
34
- currency: w()
35
- };
36
- }
37
- function F(l) {
38
- return R.parse(l);
39
- }
40
- function C(l) {
41
- return {
42
- _id: l.doc._id,
43
- internal: l.type,
44
- contactName: l.doc.profile.name,
45
- name: l.doc.profile.name ?? "",
46
- email: l.doc.profile.email,
47
- phoneNumber: l.doc.profile.phoneNo,
48
- registrationNumber: l.doc.profile.regNo,
49
- address: l.doc.profile.address ?? {
50
- line1: "",
51
- state: "",
52
- city: "",
53
- postcode: "",
54
- country: ""
55
- }
56
- };
57
- }
58
- function re(l, r, e = !1, n = !1) {
59
- const t = j(), o = H();
60
- o.watchLocation(async () => {
61
- var v;
62
- await t.readSuppliers();
63
- const u = l();
64
- if ((v = u.supplier) != null && v._id) return;
65
- const a = n ? t.suppliers[0] : t.businessSuppliers[0], d = (e ? o.locations.filter((m) => m.doc._id !== o.currentLocation.doc._id) : o.locations)[0];
66
- r({
67
- ...u,
68
- supplier: a ? F(a) : d ? C(d) : u.supplier
69
- });
70
- });
71
- const s = y(
72
- () => {
73
- var u, a;
74
- return typeof ((a = (u = l()) == null ? void 0 : u.supplier) == null ? void 0 : a.internal) == "string" ? S.TRANSFER : S.PURCHASE;
75
- }
76
- ), i = y({
77
- get() {
78
- var u, a;
79
- return (a = (u = l()) == null ? void 0 : u.supplier) == null ? void 0 : a._id;
80
- },
81
- set(u) {
82
- const a = l() ?? {};
83
- if (s.value === S.PURCHASE) {
84
- const _ = (n ? t.suppliers : t.businessSuppliers).find((N) => N._id === u);
85
- r({
86
- ...a,
87
- supplier: _ ? F(_) : a.supplier
88
- });
89
- return;
90
- }
91
- const v = (e ? o.locations.filter((m) => m.doc._id !== o.currentLocation.doc._id) : o.locations).find((m) => m.doc._id === u);
92
- r({
93
- ...a,
94
- supplier: v ? C(v) : a.supplier
95
- });
96
- }
97
- }), c = y(() => t.locationSuppliers.map(F)), p = y(() => t.businessSuppliers.map(F)), f = y(() => {
98
- const u = [...c.value], a = [...p.value];
99
- return n ? [...a, ...u] : a;
100
- }), L = y(() => {
101
- var h;
102
- const u = ((h = o._currentLocation) == null ? void 0 : h.type) === I.warehouse;
103
- return (e ? o.locations.filter((d) => d.doc._id !== o.currentLocation.doc._id) : o.locations).filter((d) => u || d.acceptRequest).map(C);
104
- }), b = y(() => {
105
- if (s.value === S.PURCHASE) {
106
- const a = c.value.map((d) => ({
107
- label: d.name,
108
- value: d._id
109
- })), h = p.value.map((d) => ({
110
- label: d.name,
111
- sublabel: "Business supplier",
112
- value: d._id
113
- }));
114
- return n ? [...a, ...h] : h;
115
- }
116
- return L.value.map((a) => ({
117
- label: a.name,
118
- sublabel: a.internal ? `${a.internal}` : void 0,
119
- value: a._id
120
- }));
121
- }), g = y(() => {
122
- var d, v;
123
- const u = (v = (d = l()) == null ? void 0 : d.supplier) == null ? void 0 : v._id;
124
- if (s.value === S.PURCHASE) {
125
- const m = t.suppliers.find((_) => _._id === u);
126
- return m ? F(m) : null;
127
- }
128
- const h = o.locations.find((m) => m.doc._id);
129
- return h ? C(h) : null;
130
- });
131
- return {
132
- transferLocationModel: i,
133
- transferLocationOptions: b,
134
- locationOptionsTypePurchase: f,
135
- locationOptionsTypePurchaseLocationLevel: c,
136
- locationOptionsTypeTransfer: L,
137
- selectedLocation: g
138
- };
139
- }
140
- class O {
141
- static getDescendantProperty(r, e, n = []) {
142
- let t, o, s, i, c, p;
143
- if (e) {
144
- if (s = e.indexOf("."), s === -1 ? t = e : (t = e.slice(0, s), o = e.slice(s + 1)), i = r[t], i !== null && typeof i < "u")
145
- if (!o && (typeof i == "string" || typeof i == "number"))
146
- n.push(i);
147
- else if (Object.prototype.toString.call(i) === "[object Array]")
148
- for (c = 0, p = i.length; c < p; c++)
149
- O.getDescendantProperty(i[c], o, n);
150
- else o && O.getDescendantProperty(i, o, n);
151
- } else
152
- n.push(r);
153
- return n;
154
- }
155
- }
156
- class P {
157
- constructor(r = [], e = [], n = {}) {
158
- Array.isArray(e) || (n = e, e = []), this.haystack = r, this.keys = e, this.options = Object.assign({
159
- caseSensitive: !1,
160
- sort: !1
161
- }, n);
162
- }
163
- search(r = "") {
164
- if (r === "")
165
- return this.haystack;
166
- const e = [];
167
- for (let n = 0; n < this.haystack.length; n++) {
168
- const t = this.haystack[n];
169
- if (this.keys.length === 0) {
170
- const o = P.isMatch(t, r, this.options.caseSensitive);
171
- o && e.push({ item: t, score: o });
172
- } else
173
- for (let o = 0; o < this.keys.length; o++) {
174
- const s = O.getDescendantProperty(t, this.keys[o]);
175
- let i = !1;
176
- for (let c = 0; c < s.length; c++) {
177
- const p = P.isMatch(s[c], r, this.options.caseSensitive);
178
- if (p) {
179
- i = !0, e.push({ item: t, score: p });
180
- break;
181
- }
182
- }
183
- if (i)
184
- break;
185
- }
186
- }
187
- return this.options.sort && e.sort((n, t) => n.score - t.score), e.map((n) => n.item);
188
- }
189
- static isMatch(r, e, n) {
190
- r = String(r), e = String(e), n || (r = r.toLocaleLowerCase(), e = e.toLocaleLowerCase());
191
- const t = P.nearestIndexesFor(r, e);
192
- return t ? r === e ? 1 : t.length > 1 ? 2 + (t[t.length - 1] - t[0]) : 2 + t[0] : !1;
193
- }
194
- static nearestIndexesFor(r, e) {
195
- const n = e.split("");
196
- let t = [];
197
- return P.indexesOfFirstLetter(r, e).forEach((s, i) => {
198
- let c = s + 1;
199
- t[i] = [s];
200
- for (let p = 1; p < n.length; p++) {
201
- const f = n[p];
202
- if (c = r.indexOf(f, c), c === -1) {
203
- t[i] = !1;
204
- break;
205
- }
206
- t[i].push(c), c++;
207
- }
208
- }), t = t.filter((s) => s !== !1), t.length ? t.sort((s, i) => s.length === 1 ? s[0] - i[0] : (s = s[s.length - 1] - s[0], i = i[i.length - 1] - i[0], s - i))[0] : !1;
209
- }
210
- static indexesOfFirstLetter(r, e) {
211
- const n = e[0];
212
- return r.split("").map((t, o) => t !== n ? !1 : o).filter((t) => t !== !1);
213
- }
214
- }
215
- const G = { class: "sticky top-0 bg-white mb-8" }, q = { class: "overflow-y-auto pb-8" }, ie = /* @__PURE__ */ $({
216
- __name: "FmFilterableMenuOptions",
217
- props: /* @__PURE__ */ W({
218
- modelValue: {},
219
- maxHeight: {},
220
- width: {},
221
- handleItemChange: { type: Function },
222
- items: {},
223
- options: {}
224
- }, {
225
- search: {},
226
- searchModifiers: {}
227
- }),
228
- emits: ["update:search"],
229
- setup(l) {
230
- const r = l, e = J(l, "search"), n = y(
231
- () => new P(r.items, ["label", "sublabel"], r.options)
232
- ), t = y(() => n.value.search(e.value));
233
- return (o, s) => {
234
- const i = U("FmButton"), c = U("FmTextField"), p = U("FmMenuItem");
235
- return T(), A("div", {
236
- class: "relative",
237
- style: K({ maxHeight: `${o.maxHeight}px`, width: o.width })
238
- }, [
239
- D("div", G, [
240
- Q(c, {
241
- modelValue: e.value,
242
- "onUpdate:modelValue": s[1] || (s[1] = (f) => e.value = f),
243
- placeholder: "Filter options"
244
- }, {
245
- append: X(() => [
246
- e.value ? (T(), x(i, {
247
- key: 0,
248
- variant: "tertiary",
249
- "prepend-icon": "close",
250
- onClick: s[0] || (s[0] = (f) => e.value = "")
251
- })) : E("", !0)
252
- ]),
253
- _: 1
254
- }, 8, ["modelValue"])
255
- ]),
256
- D("div", q, [
257
- (T(!0), A(Y, null, Z(t.value, (f, L) => (T(), x(p, {
258
- key: L,
259
- label: f.label,
260
- sublabel: f.sublabel,
261
- "model-value": V(M)(o.modelValue, f.value),
262
- onClick: () => o.handleItemChange(V(M)(o.modelValue, f.value), f),
263
- onVnodeMounted: (b) => {
264
- var g;
265
- return V(M)(o.modelValue, f.value) && ((g = b.el) == null || g.scrollIntoView({ behavior: "smooth", block: "center" }), console.log("scrollTo", b.el)), void 0;
266
- }
267
- }, null, 8, ["label", "sublabel", "model-value", "onClick", "onVnodeMounted"]))), 128)),
268
- t.value.length ? E("", !0) : (T(), x(p, {
269
- key: 0,
270
- disabled: "",
271
- label: "No options available"
272
- }))
273
- ])
274
- ], 4);
275
- };
276
- }
277
- });
278
- export {
279
- ie as _,
280
- oe as c,
281
- re as u
282
- };