@feedmepos/mf-inventory-portal 0.0.25-dev.2 → 0.0.25-dev.21

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 (115) hide show
  1. package/dist/App-D6WBVERc.js +278 -0
  2. package/dist/ApprovalView-BIBoagE8.js +146 -0
  3. package/dist/{BindingsDialog-qeGh3ND8.js → BindingsDialog-DHRRkK1Z.js} +6 -6
  4. package/dist/{BindingsPicker-SfiA8fmD.js → BindingsPicker-DohvMDDF.js} +3 -3
  5. package/dist/{BindingsTable-BjW-eJr6.js → BindingsTable-C_JwU9ei.js} +6 -6
  6. package/dist/ClosingDraftView-BBebhUj-.js +1308 -0
  7. package/dist/ClosingTemplateView-CXRN19-D.js +1859 -0
  8. package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js +34 -0
  9. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BJufUQNE.js +215 -0
  10. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-5rldKjyh.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C5Xk19jY.js} +52 -52
  11. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-7HNI82u-.js +51 -0
  12. package/dist/{IngredientGroupView-CGyyFyvj.js → IngredientGroupView-l2bAc1Kj.js} +1 -1
  13. package/dist/{IngredientsView-BLKk-VxQ.js → IngredientsView-zDXt7KEx.js} +394 -382
  14. package/dist/{IntegrationView-C6gwvZ9b.js → IntegrationView-BYnlAPrP.js} +660 -623
  15. package/dist/{InventoryBindingForm-BB3ZN3Lx.js → InventoryBindingForm-BuweG4Vl.js} +1 -1
  16. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-PT7Quw7j.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DgxN0U4N.js} +99 -99
  17. package/dist/{InventoryBindingSummary-yr0oie3c.js → InventoryBindingSummary-BpEo0JsK.js} +1 -1
  18. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DjJGUE9a.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CcjzkzCt.js} +1 -1
  19. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-O1mYRa5W.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Ej20iSHA.js} +15 -15
  20. package/dist/PublishView-DCZ0zIaP.js +222 -0
  21. package/dist/{PurchaseOrderPrintPreview-Q_9-KVNj.js → PurchaseOrderPrintPreview-Cag7UEvz.js} +1 -1
  22. package/dist/ReceiveRequestView-ChIJGA98.js +2319 -0
  23. package/dist/{RecipeView-DBfugmRY.js → RecipeView-bBshe0eF.js} +32 -31
  24. package/dist/{index-CgspzSQi.js → StockView-D6-oKpAC.js} +3577 -1764
  25. package/dist/{SupplierView-BQViPyfj.js → SupplierView-dyIcGp9Q.js} +12 -11
  26. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-C_7wbQow.js +1771 -0
  27. package/dist/TransferTemplateView-D2rxV0k_.js +1660 -0
  28. package/dist/{UnitView-CrbFeWaB.js → UnitView-DVS5Az5c.js} +14 -14
  29. package/dist/{WarehouseView-Dy5GljxY.js → WarehouseView-CR03TpnA.js} +332 -314
  30. package/dist/api/closing-draft.d.ts +1 -0
  31. package/dist/api/inventory.d.ts +9 -6
  32. package/dist/api/purchase-order.d.ts +2 -1
  33. package/dist/{app-D0O4wr2X.js → app-oV9ISfFL.js} +28343 -28141
  34. package/dist/app.js +1 -1
  35. package/dist/components/FmAutocompleteTextField.vue.d.ts +31 -0
  36. package/dist/components/FmCustomAttribute.vue.d.ts +3 -8
  37. package/dist/components/FmLockableField.vue.d.ts +3 -0
  38. package/dist/components/FmMultiselectDialog.d.ts +46 -0
  39. package/dist/components/FmMultiselectDialog.vue.d.ts +20 -3
  40. package/dist/components/FmMultiselectDialogProps.d.ts +2 -0
  41. package/dist/components/MountListener.vue.d.ts +15 -0
  42. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +1 -1
  43. package/dist/components/shell/inventory/binding-ui.vue.d.ts +1 -1
  44. package/dist/{decimal-CPGmj9BT.js → decimal-C7zgfr5G.js} +1 -1
  45. package/dist/feature-CDQQ-mV9.js +1003 -0
  46. package/dist/{format-unit-display-CMM6DZJj.js → format-unit-display-CVBzrNQ4.js} +334 -327
  47. package/dist/helper/fuzzy.d.ts +10 -0
  48. package/dist/index-0VS4cuk3.js +35546 -0
  49. package/dist/{stock-9nTT4Amy.js → stock-BIP_NIK_.js} +3 -3
  50. package/dist/stores/feature.d.ts +4 -7
  51. package/dist/stores/integration/netsuite.d.ts +5 -0
  52. package/dist/stores/inventory.d.ts +135 -8
  53. package/dist/stores/location.d.ts +100 -0
  54. package/dist/stores/warehouse.d.ts +1 -0
  55. package/dist/style.css +1 -1
  56. package/dist/{supplier-CH4EwBZM.js → supplier-DUQ2VSMg.js} +1 -1
  57. package/dist/tsconfig.app.tsbuildinfo +1 -1
  58. package/dist/use-ingredient-select-dialog-VkU5_Aaj.js +51 -0
  59. package/dist/{use-inventory-binding-dialog-Dli3xtq4.js → use-inventory-binding-dialog-BXp0z3v_.js} +1 -1
  60. package/dist/views/adjustment-template/wastage-template/actions.d.ts +24 -0
  61. package/dist/views/adjustment-template/wastage-template/table.d.ts +24 -0
  62. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +8 -4
  63. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +4 -1
  64. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +48 -24
  65. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +1 -1
  66. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +1 -1
  67. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +36 -12
  68. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -12
  69. package/dist/views/dev/components/AutocompleteTextField.vue.d.ts +2 -0
  70. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +3 -3
  71. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +2 -2
  72. package/dist/views/ingredients/composables/use-ingredient-select-dialog.d.ts +16 -0
  73. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -1
  74. package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +2 -0
  75. package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +1387 -0
  76. package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +5 -1
  77. package/dist/views/receive-request/components/transfer-dialog/TransferDialogProps.d.ts +3 -0
  78. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +1 -2
  79. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +48 -2
  80. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +490 -2
  81. package/dist/views/receive-request/components/transfer-form/components/TransferSubItemTable.vue.d.ts +72 -0
  82. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +25 -2
  83. package/dist/views/receive-request/components/transfer-form/helpers/calculate-sub-item-total.helper.d.ts +4 -0
  84. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +693 -35
  85. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +684 -35
  86. package/dist/views/receive-request/helper/po-to-po-template.util.d.ts +1 -0
  87. package/dist/views/receive-request/helper/print-po.d.ts +9 -2
  88. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
  89. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItem.vue.d.ts +270 -2
  90. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +286 -0
  91. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateSubItem.vue.d.ts +74 -0
  92. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateSubItemTable.vue.d.ts +92 -0
  93. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations-2.d.ts +8 -0
  94. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +1 -0
  95. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +36 -2
  96. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +456 -12
  97. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +456 -12
  98. package/dist/views/transfer-template/helpers/location-to-po-supplier.util.d.ts +75 -0
  99. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +2 -0
  100. package/dist/{vue-i18n-BcYt8MNZ.js → vue-i18n-CCd5_SRR.js} +212 -212
  101. package/package.json +3 -3
  102. package/dist/App-oKNdl2la.js +0 -276
  103. package/dist/ApprovalView-hDGkcBDy.js +0 -138
  104. package/dist/ClosingDraftView-CEeeL7W4.js +0 -1225
  105. package/dist/ClosingTemplateView-CkS9e0MV.js +0 -1819
  106. package/dist/FmCustomAttribute.vue_vue_type_script_setup_true_lang-CIBSvY0s.js +0 -142
  107. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Dg_7ELeT.js +0 -286
  108. package/dist/PublishView-ByXdmuJL.js +0 -192
  109. package/dist/ReceiveRequestView-CApg7LGM.js +0 -1876
  110. package/dist/StockView-D6o_oUlz.js +0 -1817
  111. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-D2skLe2M.js +0 -1327
  112. package/dist/TransferTemplateView-DVesObTd.js +0 -1284
  113. package/dist/components/FmCustomAttribute2.vue.d.ts +0 -18
  114. package/dist/index-P5iEcRw3.js +0 -29202
  115. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +0 -2628
@@ -0,0 +1,34 @@
1
+ import { defineComponent as m, computed as a, openBlock as p, createElementBlock as d, createElementVNode as c, createVNode as f, unref as l, isRef as v, createCommentVNode as y } from "vue";
2
+ import { useProxiedModel as V } from "@feedmepos/ui-library";
3
+ import { useCoreStore as g, CustomAttributesForm as C } from "@feedmepos/mf-common";
4
+ const S = {
5
+ key: 0,
6
+ class: "flex flex-col gap-16"
7
+ }, x = /* @__PURE__ */ m({
8
+ __name: "FmCustomAttribute",
9
+ props: {
10
+ entity: {},
11
+ modelValue: {},
12
+ valueOptions: {}
13
+ },
14
+ setup(s) {
15
+ const r = s, o = V(r, "modelValue"), u = g(), i = a(() => {
16
+ var t, e;
17
+ return ((e = (t = u.currentBusiness.value) == null ? void 0 : t.attributeSettings) == null ? void 0 : e.filter(
18
+ (n) => String(n.entity) === String(r.entity)
19
+ )) || [];
20
+ });
21
+ return (t, e) => i.value.length ? (p(), d("div", S, [
22
+ e[1] || (e[1] = c("div", { class: "fm-typo-en-title-sm-600" }, "Custom attributes", -1)),
23
+ f(l(C), {
24
+ entity: t.entity,
25
+ modelValue: l(o),
26
+ "onUpdate:modelValue": e[0] || (e[0] = (n) => v(o) ? o.value = n : null),
27
+ "value-options": t.valueOptions
28
+ }, null, 8, ["entity", "modelValue", "value-options"])
29
+ ])) : y("", !0);
30
+ }
31
+ });
32
+ export {
33
+ x as _
34
+ };
@@ -0,0 +1,215 @@
1
+ import { i as k, t as E, as as w, aG as B, u as H, ax as z, aH as D, aI as V } from "./app-oV9ISfFL.js";
2
+ import { u as x } from "./supplier-DUQ2VSMg.js";
3
+ import { P as F } from "./format-unit-display-CVBzrNQ4.js";
4
+ import { computed as d, defineComponent as j, mergeModels as q, useModel as W, ref as $, resolveComponent as g, openBlock as L, createElementBlock as N, normalizeStyle as J, createElementVNode as A, createVNode as K, withCtx as Q, createBlock as M, createCommentVNode as I, Fragment as X, renderList as Y, unref as R } from "vue";
5
+ function Z(e, l, a) {
6
+ var n;
7
+ if (!!l.measurement === !!a && ((n = l.measurement) == null ? void 0 : n.id) === a)
8
+ return l;
9
+ if (!a)
10
+ return {
11
+ costPerUnit: l.costPerUnit
12
+ };
13
+ const s = e.measurements.find((c) => c.id === a);
14
+ return s ? {
15
+ costPerUnit: l.costPerUnit,
16
+ measurement: s
17
+ } : {
18
+ costPerUnit: l.costPerUnit
19
+ };
20
+ }
21
+ function se(e, l, a, r) {
22
+ var _, P, T;
23
+ if (r != null && r.manualTotalCost)
24
+ return r == null ? void 0 : r.manualTotalCost;
25
+ const u = (T = (P = (_ = r == null ? void 0 : r.supplier) == null ? void 0 : _.supplyItems) == null ? void 0 : P.find(
26
+ (o) => o.skuId === e._id
27
+ )) == null ? void 0 : T.defaultCost, s = e.defaultCost ? Z(e.unit, e.defaultCost, e.trackingMeasurement) : void 0, n = u ?? s, c = n == null ? void 0 : n.costPerUnit, h = c ? n != null && n.measurement ? +k(c) / +k(n == null ? void 0 : n.measurement.conversion) : +k(c) : void 0, v = h ? a ? h * +k(a.conversion) : h : void 0, y = v ? +k(l) * v : void 0;
28
+ return y ? {
29
+ ...E(y ?? 0, 2),
30
+ currency: w()
31
+ } : {
32
+ amount: 0,
33
+ precision: 0,
34
+ currency: w()
35
+ };
36
+ }
37
+ function C(e) {
38
+ return B.parse(e);
39
+ }
40
+ function S(e) {
41
+ return {
42
+ _id: e.doc._id,
43
+ internal: e.type,
44
+ contactName: e.doc.profile.name,
45
+ name: e.doc.profile.name ?? "",
46
+ email: e.doc.profile.email,
47
+ phoneNumber: e.doc.profile.phoneNo,
48
+ registrationNumber: e.doc.profile.regNo,
49
+ address: e.doc.profile.address ?? {
50
+ line1: "",
51
+ state: "",
52
+ city: "",
53
+ postcode: "",
54
+ country: ""
55
+ }
56
+ };
57
+ }
58
+ function ae(e, l, a = !1, r = !1) {
59
+ const u = x(), s = H(), n = d(() => e().isReturnPo ?? !1);
60
+ s.watchLocation(async () => {
61
+ var b;
62
+ if (n.value) return;
63
+ await u.readSuppliers();
64
+ const o = e();
65
+ if ((b = o.supplier) != null && b._id) return;
66
+ const t = r ? u.suppliers[0] : u.businessSuppliers[0], i = (a ? s.locations.filter((m) => m.doc._id !== s.currentLocation.doc._id) : s.locations)[0];
67
+ l({
68
+ ...o,
69
+ supplier: t ? C(t) : i ? S(i) : o.supplier
70
+ });
71
+ });
72
+ const c = d(() => {
73
+ var o, t;
74
+ return n.value ? F.TRANSFER : typeof ((t = (o = e()) == null ? void 0 : o.supplier) == null ? void 0 : t.internal) == "string" ? F.TRANSFER : F.PURCHASE;
75
+ }), h = d({
76
+ get() {
77
+ var o, t;
78
+ return (t = (o = e()) == null ? void 0 : o.supplier) == null ? void 0 : t._id;
79
+ },
80
+ set(o) {
81
+ const t = e() ?? {};
82
+ if (c.value === F.PURCHASE) {
83
+ const U = (r ? u.suppliers : u.businessSuppliers).find((O) => O._id === o);
84
+ l({
85
+ ...t,
86
+ supplier: U ? C(U) : t.supplier
87
+ });
88
+ return;
89
+ }
90
+ const b = (a ? s.locations.filter((m) => m.doc._id !== s.currentLocation.doc._id) : s.locations).find((m) => m.doc._id === o);
91
+ l({
92
+ ...t,
93
+ supplier: b ? S(b) : t.supplier
94
+ });
95
+ }
96
+ }), v = d(() => u.locationSuppliers.map(C)), y = d(() => u.businessSuppliers.map(C)), p = d(() => {
97
+ if (n.value) return [];
98
+ const o = [...v.value], t = [...y.value];
99
+ return r ? [...t, ...o] : t;
100
+ }), _ = d(() => {
101
+ var f;
102
+ if (n.value) return [S(s.currentLocation)];
103
+ const o = ((f = s._currentLocation) == null ? void 0 : f.type) === z.enum.warehouse;
104
+ return (a ? s.locations.filter((i) => i.doc._id !== s.currentLocation.doc._id) : s.locations).filter((i) => o || i.acceptRequest).map(S);
105
+ }), P = d(() => {
106
+ if (c.value === F.PURCHASE) {
107
+ const t = v.value.map((i) => ({
108
+ label: i.name,
109
+ value: i._id
110
+ })), f = y.value.map((i) => ({
111
+ label: i.name,
112
+ sublabel: "Business supplier",
113
+ value: i._id
114
+ }));
115
+ return r ? [...t, ...f] : f;
116
+ }
117
+ return _.value.map((t) => ({
118
+ label: t.name,
119
+ sublabel: t.internal ? `${t.internal}` : void 0,
120
+ value: t._id
121
+ }));
122
+ }), T = d(() => {
123
+ var i, b;
124
+ if (n.value)
125
+ return S(s.currentLocation);
126
+ const o = (b = (i = e()) == null ? void 0 : i.supplier) == null ? void 0 : b._id;
127
+ if (c.value === F.PURCHASE) {
128
+ const m = u.suppliers.find((U) => U._id === o);
129
+ return m ? C(m) : null;
130
+ }
131
+ const f = s.locations.find((m) => m.doc._id);
132
+ return f ? S(f) : null;
133
+ });
134
+ return {
135
+ transferLocationModel: h,
136
+ transferLocationOptions: P,
137
+ locationOptionsTypePurchase: p,
138
+ locationOptionsTypePurchaseLocationLevel: v,
139
+ locationOptionsTypeTransfer: _,
140
+ selectedLocation: T
141
+ };
142
+ }
143
+ const G = { class: "overflow-y-auto h-full pb-8" }, re = /* @__PURE__ */ j({
144
+ __name: "FmFilterableMenuOptions",
145
+ props: /* @__PURE__ */ q({
146
+ modelValue: {},
147
+ maxHeight: {},
148
+ width: {},
149
+ handleItemChange: { type: Function },
150
+ items: {},
151
+ options: {}
152
+ }, {
153
+ search: {},
154
+ searchModifiers: {}
155
+ }),
156
+ emits: ["update:search"],
157
+ setup(e) {
158
+ const l = e, a = W(e, "search"), r = d(
159
+ () => new D(l.items, ["label", "sublabel"], l.options)
160
+ ), u = d(() => r.value.search(a.value)), s = $();
161
+ return console.log({ stickyRef: s }), (n, c) => {
162
+ const h = g("FmButton"), v = g("FmTextField"), y = g("FmMenuItem");
163
+ return L(), N("div", {
164
+ class: "relative",
165
+ style: J({ width: n.width })
166
+ }, [
167
+ A("div", {
168
+ class: "sticky top-0 bg-white mb-8",
169
+ ref_key: "stickyRef",
170
+ ref: s
171
+ }, [
172
+ K(v, {
173
+ modelValue: a.value,
174
+ "onUpdate:modelValue": c[1] || (c[1] = (p) => a.value = p),
175
+ placeholder: "Filter options"
176
+ }, {
177
+ append: Q(() => [
178
+ a.value ? (L(), M(h, {
179
+ key: 0,
180
+ variant: "tertiary",
181
+ "prepend-icon": "close",
182
+ onClick: c[0] || (c[0] = (p) => a.value = "")
183
+ })) : I("", !0)
184
+ ]),
185
+ _: 1
186
+ }, 8, ["modelValue"])
187
+ ], 512),
188
+ A("div", G, [
189
+ (L(!0), N(X, null, Y(u.value, (p, _) => (L(), M(y, {
190
+ key: _,
191
+ label: p.label,
192
+ sublabel: p.sublabel,
193
+ "model-value": R(V)(n.modelValue, p.value),
194
+ onClick: () => n.handleItemChange(R(V)(n.modelValue, p.value), p),
195
+ onVnodeMounted: (P) => {
196
+ var T, o;
197
+ return R(V)(n.modelValue, p.value) && ((T = P.el) == null || T.scrollIntoView({ behavior: "instant", block: "end" }), (o = P.el) == null || o.scrollIntoView({ behavior: "smooth", block: "center" })), void 0;
198
+ }
199
+ }, null, 8, ["label", "sublabel", "model-value", "onClick", "onVnodeMounted"]))), 128)),
200
+ u.value.length ? I("", !0) : (L(), M(y, {
201
+ key: 0,
202
+ disabled: "",
203
+ label: "No options available"
204
+ }))
205
+ ])
206
+ ], 4);
207
+ };
208
+ }
209
+ });
210
+ export {
211
+ re as _,
212
+ se as c,
213
+ S as l,
214
+ ae as u
215
+ };
@@ -1,5 +1,5 @@
1
- import { defineComponent as oe, mergeModels as z, useModel as se, computed as v, ref as P, watch as O, inject as ie, resolveComponent as b, openBlock as f, createElementBlock as y, createElementVNode as u, createVNode as h, withCtx as g, renderSlot as T, normalizeClass as V, toDisplayString as x, withDirectives as le, vModelText as ae, createCommentVNode as q, createTextVNode as ue, createBlock as W, Fragment as re, renderList as me } from "vue";
2
- import { $ as I, I as k, P as L, L as ce, j as M, aB as de, t as pe, K as fe, ah as ve, az as be, ay as ye } from "./app-D0O4wr2X.js";
1
+ import { defineComponent as oe, mergeModels as j, useModel as se, computed as v, ref as P, watch as z, inject as ie, resolveComponent as b, openBlock as f, createElementBlock as y, createElementVNode as u, createVNode as M, withCtx as g, renderSlot as T, normalizeClass as V, toDisplayString as F, withDirectives as le, vModelText as ae, createCommentVNode as q, createTextVNode as ue, createBlock as W, Fragment as re, renderList as me } from "vue";
2
+ import { Z as I, I as k, O as L, K as ce, i as h, aF as de, t as pe, J as fe, al as ve, aD as be, aC as ye } from "./app-oV9ISfFL.js";
3
3
  import "@feedmepos/ui-library";
4
4
  function E() {
5
5
  return {
@@ -26,10 +26,10 @@ function G(l, d = !1) {
26
26
  const s = H()(r);
27
27
  if (s != !0)
28
28
  return d ? s : !0;
29
- const F = typeof l == "number" ? l : L(l, r.modelValue.measurement);
30
- return ce(+r.amountAsString).precision > F ? `Cannot exceed precision more than ${M({
29
+ const x = typeof l == "number" ? l : L(l, r.modelValue.measurement);
30
+ return ce(+r.amountAsString).precision > x ? `Cannot exceed precision more than ${h({
31
31
  amount: 1,
32
- precision: F
32
+ precision: x
33
33
  })}` : !0;
34
34
  };
35
35
  }
@@ -39,24 +39,24 @@ function Le(l) {
39
39
  return d(r.modelValue.amount);
40
40
  };
41
41
  }
42
- const he = { class: "flex flex-col" }, Me = { class: "flex flex-col" }, ge = { class: "flex-1" }, xe = { class: "flex items-center gap-4" }, Fe = { class: "flex-1 flex gap-4" }, Ae = { class: "shrink-0 grow basis-2/5" }, _e = {
42
+ const Me = { class: "flex flex-col" }, he = { class: "flex flex-col" }, ge = { class: "flex-1" }, Fe = { class: "flex items-center gap-4" }, xe = { class: "flex-1 flex gap-4" }, Ae = { class: "shrink-0 grow basis-2/5" }, _e = {
43
43
  key: 0,
44
44
  class: "text-fm-color-typo-secondary"
45
45
  }, Pe = {
46
46
  key: 0,
47
47
  class: "line-clamp-1 text-ellipsis break-all"
48
- }, Ie = { class: "flex items-center gap-4" }, ke = { class: "line-clamp-1 text-ellipsis break-all" }, Be = { class: "max-w-[200px] flex flex-col gap-[1px]" }, De = {
48
+ }, Ie = { class: "flex items-center gap-4" }, ke = { class: "line-clamp-1 text-ellipsis break-all" }, De = { class: "max-w-[200px] flex flex-col gap-[1px]" }, Be = {
49
49
  key: 1,
50
50
  class: "flex flex-col gap-4 pl-8 shrink-0"
51
51
  }, Re = {
52
52
  class: "flex items-center",
53
53
  style: { "pointer-events": "none" }
54
- }, Ue = {
54
+ }, Ce = {
55
55
  class: "flex items-center",
56
56
  style: { "pointer-events": "none" }
57
- }, $e = /* @__PURE__ */ oe({
57
+ }, Oe = /* @__PURE__ */ oe({
58
58
  __name: "FmUnitInput",
59
- props: /* @__PURE__ */ z({
59
+ props: /* @__PURE__ */ j({
60
60
  modelValue: {},
61
61
  unit: {},
62
62
  rules: {},
@@ -103,27 +103,27 @@ const he = { class: "flex flex-col" }, Me = { class: "flex flex-col" }, ge = { c
103
103
  modelValue: {},
104
104
  modelModifiers: {}
105
105
  }),
106
- emits: /* @__PURE__ */ z(["update:amount", "update:measurement"], ["update:modelValue"]),
106
+ emits: /* @__PURE__ */ j(["update:amount", "update:measurement"], ["update:modelValue"]),
107
107
  setup(l, { emit: d }) {
108
- const t = l, r = d, s = se(l, "modelValue"), F = k(), B = v(() => {
108
+ const t = l, r = d, s = se(l, "modelValue"), x = k(), D = v(() => {
109
109
  var n;
110
110
  return L(t.unit, (n = s.value) == null ? void 0 : n.measurement);
111
111
  }), c = P((() => {
112
112
  var o;
113
113
  const e = ((o = s.value) == null ? void 0 : o.amount) ?? I.reset(), n = be(e), i = t.formatMinimumPrecision ?? n.precision, a = ye(n, i);
114
- return M(a);
114
+ return h(a);
115
115
  })());
116
- O(c, (e) => {
117
- const n = F(e), i = t.precision ?? B.value, o = typeof t.formatMinimumPrecision == "number" && t.formatMinimumPrecision > i ? t.formatMinimumPrecision : i;
116
+ z(c, (e) => {
117
+ const n = x(e), i = t.precision ?? D.value, o = typeof t.formatMinimumPrecision == "number" && t.formatMinimumPrecision > i ? t.formatMinimumPrecision : i;
118
118
  n == !0 && (s.value = {
119
119
  ...s.value,
120
120
  amount: pe(+e, o)
121
121
  }), r("update:amount", e);
122
122
  });
123
- const Z = Symbol.for("fm:form-state"), D = ie(Z, null), A = v(() => t.disabled ?? (D == null ? void 0 : D.getDisabled()) ?? !1), J = P(), R = P(!1), $ = P(!1), Q = v(() => R.value || $.value), X = v(() => {
123
+ const J = Symbol.for("fm:form-state"), B = ie(J, null), A = v(() => t.disabled ?? (B == null ? void 0 : B.getDisabled()) ?? !1), K = P(), R = P(!1), O = P(!1), Q = v(() => R.value || O.value), X = v(() => {
124
124
  var a;
125
- const i = [...t.unit.measurements.filter((o) => !o.name.toLocaleLowerCase().includes("inactive")).filter((o) => o.abbrev !== t.unit.abbrev || +M(o.conversion) != 1).groupBy(
126
- (o) => `${o.abbrev}${M(o.conversion)}`
125
+ const i = [...t.unit.measurements.filter((o) => !o.name.toLocaleLowerCase().includes("inactive")).filter((o) => o.abbrev !== t.unit.abbrev || +h(o.conversion) != 1).groupBy(
126
+ (o) => `${o.abbrev}${h(o.conversion)}`
127
127
  ).values()].map((o) => o[0]).flat();
128
128
  return [
129
129
  {
@@ -135,7 +135,7 @@ const he = { class: "flex flex-col" }, Me = { class: "flex flex-col" }, ge = { c
135
135
  value: o.id
136
136
  }))
137
137
  ];
138
- }), U = v({
138
+ }), C = v({
139
139
  get() {
140
140
  var e, n;
141
141
  return ((n = (e = s.value) == null ? void 0 : e.measurement) == null ? void 0 : n.id) ?? null;
@@ -155,7 +155,7 @@ const he = { class: "flex flex-col" }, Me = { class: "flex flex-col" }, ge = { c
155
155
  }
156
156
  }
157
157
  });
158
- O(U, (e, n) => {
158
+ z(C, (e, n) => {
159
159
  var m;
160
160
  if (!t.convertAmountOnChangeUnit)
161
161
  return;
@@ -163,9 +163,9 @@ const he = { class: "flex flex-col" }, Me = { class: "flex flex-col" }, ge = { c
163
163
  value: w,
164
164
  precision: N
165
165
  });
166
- c.value = M(S);
166
+ c.value = h(S);
167
167
  });
168
- const C = v(() => {
168
+ const U = v(() => {
169
169
  var e, n;
170
170
  return ((n = (e = s.value) == null ? void 0 : e.measurement) == null ? void 0 : n.abbrev) ?? t.unit.abbrev;
171
171
  }), Y = v(
@@ -179,39 +179,39 @@ const he = { class: "flex flex-col" }, Me = { class: "flex flex-col" }, ge = { c
179
179
  H(),
180
180
  typeof t.precision == "number" ? G(t.precision) : G(t.unit)
181
181
  ] : [], ...Y.value]);
182
- function j(e) {
183
- const n = t.precision ?? B.value, a = typeof t.formatMinimumPrecision == "number" && t.formatMinimumPrecision > n ? t.formatMinimumPrecision : n, o = e.toFixed(a), p = o.includes(".") ? o.replace(/0+$/, "") : o;
182
+ function $(e) {
183
+ const n = t.precision ?? D.value, a = typeof t.formatMinimumPrecision == "number" && t.formatMinimumPrecision > n ? t.formatMinimumPrecision : n, o = e.toFixed(a), p = o.includes(".") ? o.replace(/0+$/, "") : o;
184
184
  return p.endsWith(".") ? p.slice(0, p.length - 1) : p;
185
185
  }
186
186
  function te() {
187
187
  if (!t.stepper)
188
188
  return;
189
- const e = +c.value + +M(t.stepper);
190
- c.value = j(e);
189
+ const e = +c.value + +h(t.stepper);
190
+ c.value = $(e);
191
191
  }
192
192
  function ne() {
193
193
  if (!t.stepper)
194
194
  return;
195
- const e = +c.value - +M(t.stepper);
196
- c.value = j(e);
195
+ const e = +c.value - +h(t.stepper);
196
+ c.value = $(e);
197
197
  }
198
198
  return (e, n) => {
199
199
  const i = b("FmLabel"), a = b("FmIcon"), o = b("FmMenuItem"), p = b("FmMenu"), w = b("FmTooltip"), N = b("FmField"), S = b("FmFormGroup");
200
- return f(), y("div", he, [
201
- u("div", Me, [
200
+ return f(), y("div", Me, [
201
+ u("div", he, [
202
202
  u("div", ge, [
203
- h(i, {
203
+ M(i, {
204
204
  label: e.label,
205
205
  disabled: e.disabled,
206
206
  required: e.labelMark === "required",
207
207
  optional: e.labelMark === "optional"
208
208
  }, null, 8, ["label", "disabled", "required", "optional"])
209
209
  ]),
210
- h(N, { focused: Q.value }, {
210
+ M(N, { focused: Q.value }, {
211
211
  default: g(() => [
212
- u("div", xe, [
212
+ u("div", Fe, [
213
213
  T(e.$slots, "prepend"),
214
- u("div", Fe, [
214
+ u("div", xe, [
215
215
  u("div", Ae, [
216
216
  e.stepperOnly ? (f(), y("span", {
217
217
  key: 0,
@@ -220,11 +220,11 @@ const he = { class: "flex flex-col" }, Me = { class: "flex flex-col" }, ge = { c
220
220
  "text-fm-color-typo-primary": !A.value,
221
221
  "text-fm-color-typo-disabled": A.value
222
222
  })
223
- }, x(c.value), 3)) : le((f(), y("input", {
223
+ }, F(c.value), 3)) : le((f(), y("input", {
224
224
  key: 1,
225
225
  type: "text",
226
226
  ref_key: "inputRef",
227
- ref: J,
227
+ ref: K,
228
228
  onFocus: n[0] || (n[0] = () => R.value = !0),
229
229
  onBlur: n[1] || (n[1] = () => R.value = !1),
230
230
  "onUpdate:modelValue": n[2] || (n[2] = (m) => c.value = m),
@@ -237,35 +237,35 @@ const he = { class: "flex flex-col" }, Me = { class: "flex flex-col" }, ge = { c
237
237
  [ae, c.value]
238
238
  ])
239
239
  ]),
240
- e.separator ? (f(), y("div", _e, x(e.separator), 1)) : q("", !0),
240
+ e.separator ? (f(), y("div", _e, F(e.separator), 1)) : q("", !0),
241
241
  u("div", {
242
242
  class: V([e.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"])
243
243
  }, [
244
- h(w, { "z-index": 51 }, {
244
+ M(w, { "z-index": 51 }, {
245
245
  content: g(() => [
246
- ue(x(C.value), 1)
246
+ ue(F(U.value), 1)
247
247
  ]),
248
248
  default: g(() => [
249
- e.disableUnit ? (f(), y("div", Pe, x(C.value), 1)) : (f(), W(p, {
249
+ e.disableUnit ? (f(), y("div", Pe, F(U.value), 1)) : (f(), W(p, {
250
250
  key: 1,
251
- onMenuChanged: n[3] || (n[3] = (m) => $.value = m),
251
+ onMenuChanged: n[3] || (n[3] = (m) => O.value = m),
252
252
  "z-index": 500,
253
253
  placement: e.placement,
254
254
  disabled: e.disabled
255
255
  }, {
256
256
  "menu-button": g(() => [
257
257
  u("div", Ie, [
258
- u("div", ke, x(C.value), 1),
259
- h(a, { name: "keyboard_arrow_down" })
258
+ u("div", ke, F(U.value), 1),
259
+ M(a, { name: "keyboard_arrow_down" })
260
260
  ])
261
261
  ]),
262
262
  default: g(() => [
263
- u("div", Be, [
263
+ u("div", De, [
264
264
  (f(!0), y(re, null, me(X.value, (m) => (f(), W(o, {
265
265
  key: m.value ?? void 0,
266
266
  label: m.label,
267
- "model-value": m.value == U.value,
268
- onClick: (_) => U.value = m.value
267
+ "model-value": m.value == C.value,
268
+ onClick: (_) => C.value = m.value
269
269
  }, null, 8, ["label", "model-value", "onClick"]))), 128))
270
270
  ])
271
271
  ]),
@@ -275,13 +275,13 @@ const he = { class: "flex flex-col" }, Me = { class: "flex flex-col" }, ge = { c
275
275
  _: 1
276
276
  })
277
277
  ], 2),
278
- e.stepper ? (f(), y("div", De, [
278
+ e.stepper ? (f(), y("div", Be, [
279
279
  u("div", {
280
280
  class: "w-24 h-12 flex items-center justify-center fm-corner-radius-sm bg-fm-color-neutral-gray-100 hover:bg-fm-color-neutral-gray-200",
281
281
  onClick: te
282
282
  }, [
283
283
  u("div", Re, [
284
- h(a, {
284
+ M(a, {
285
285
  name: "expand_less",
286
286
  size: "md"
287
287
  })
@@ -291,8 +291,8 @@ const he = { class: "flex flex-col" }, Me = { class: "flex flex-col" }, ge = { c
291
291
  class: "w-24 h-12 flex items-center justify-center fm-corner-radius-sm bg-fm-color-neutral-gray-100 hover:bg-fm-color-neutral-gray-200",
292
292
  onClick: ne
293
293
  }, [
294
- u("div", Ue, [
295
- h(a, {
294
+ u("div", Ce, [
295
+ M(a, {
296
296
  name: "expand_more",
297
297
  size: "md"
298
298
  })
@@ -306,7 +306,7 @@ const he = { class: "flex flex-col" }, Me = { class: "flex flex-col" }, ge = { c
306
306
  _: 3
307
307
  }, 8, ["focused"])
308
308
  ]),
309
- h(S, {
309
+ M(S, {
310
310
  class: "flex-1",
311
311
  "model-value": { modelValue: s.value, amountAsString: String(c.value) },
312
312
  info: e.labelInfo,
@@ -320,7 +320,7 @@ const he = { class: "flex flex-col" }, Me = { class: "flex flex-col" }, ge = { c
320
320
  });
321
321
  export {
322
322
  Se as F,
323
- $e as _,
323
+ Oe as _,
324
324
  Ve as a,
325
325
  Le as b,
326
326
  H as c,
@@ -0,0 +1,51 @@
1
+ import { defineComponent as p, openBlock as s, createElementBlock as n, createElementVNode as r, toDisplayString as o, unref as l, Fragment as d, renderList as x } from "vue";
2
+ import { i as a, J as y } from "./app-oV9ISfFL.js";
3
+ import { useI18n as _ } from "@feedmepos/mf-common";
4
+ const v = { class: "flex flex-col" }, g = { 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" }, h = { class: "flex-1 py-8 px-16" }, b = {
5
+ class: "flex-0 py-8 px-16",
6
+ style: { "flex-basis": "120px" }
7
+ }, k = { class: "flex-1 py-8 px-16" }, B = {
8
+ key: 0,
9
+ class: "flex-0 py-8 px-16",
10
+ style: { "flex-basis": "120px" }
11
+ }, I = {
12
+ key: 1,
13
+ class: "flex-0 py-8 px-16",
14
+ style: { "flex-basis": "120px" }
15
+ }, A = /* @__PURE__ */ p({
16
+ __name: "IngredientBindedItem",
17
+ props: {
18
+ name: {},
19
+ bindings: {}
20
+ },
21
+ setup($) {
22
+ const { t: m } = _();
23
+ function c(e, i) {
24
+ var t;
25
+ if (e.measurement) {
26
+ const u = y(e.amount, e.measurement.conversion);
27
+ return `${a(u, !1)} ${(t = e.measurement) == null ? void 0 : t.abbrev}`;
28
+ }
29
+ return `${a(e.amount, !1)} ${i.abbrev}`;
30
+ }
31
+ function f(e) {
32
+ return e.unit !== void 0;
33
+ }
34
+ return (e, i) => (s(), n("div", v, [
35
+ r("div", g, [
36
+ r("div", h, o(e.name), 1),
37
+ r("div", b, o(l(m)("inventory.ingredient.bindedItems.amount")), 1)
38
+ ]),
39
+ (s(!0), n(d, null, x(e.bindings, (t) => (s(), n("div", {
40
+ key: t.id,
41
+ class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
42
+ }, [
43
+ r("div", k, o(t.name), 1),
44
+ f(t) ? (s(), n("div", B, o(c(t, t.unit)), 1)) : (s(), n("div", I, o(l(a)(t.amount, !1)), 1))
45
+ ]))), 128))
46
+ ]));
47
+ }
48
+ });
49
+ export {
50
+ A as _
51
+ };
@@ -1,5 +1,5 @@
1
1
  import { ref as C, computed as F, defineComponent as Y, resolveComponent as S, openBlock as M, createBlock as O, withCtx as R, createElementVNode as x, createVNode as g, unref as l, createElementBlock as ee, toDisplayString as j, createTextVNode as te, watch as ue, isRef as ce, normalizeClass as de, normalizeStyle as me, createSlots as pe, Teleport as fe, normalizeProps as ve, guardReactiveProps as ge } from "vue";
2
- import { a as J, e as h, f as B, h as ye, D as oe, i as Q, H as be, m as _e, A as xe, J as ne, p as se, u as ke, z as he, _ as we, B as Se, E as Ie, G as ae } from "./app-D0O4wr2X.js";
2
+ import { a as J, d as h, e as B, f as ye, D as oe, h as Q, G as be, l as _e, A as xe, H as ne, o as se, u as ke, y as he, _ as we, z as Se, B as Ie, E as ae } from "./app-oV9ISfFL.js";
3
3
  import { useDialog as le, useSnackbar as Z, useProxiedModel as Fe, useBreakpoints as Ce } from "@feedmepos/ui-library";
4
4
  import { useI18n as W } from "@feedmepos/mf-common";
5
5
  import { defineStore as ie, storeToRefs as re } from "pinia";