@feedmepos/mf-inventory-portal 1.2.1 → 1.2.2-5.dev-1

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 (147) hide show
  1. package/dist/App-DMkUg806.js +297 -0
  2. package/dist/{ApprovalView-DwRrbVDo.js → ApprovalView-DWJh2K6W.js} +65 -64
  3. package/dist/{BindingsDialog-DUVKv10-.js → BindingsDialog-EmHCvqJI.js} +2 -2
  4. package/dist/{BindingsPicker-Daib_iq4.js → BindingsPicker-h_9jm1s0.js} +3 -3
  5. package/dist/{BindingsTable-Bv9UmcJP.js → BindingsTable-BAVWGUoa.js} +1 -1
  6. package/dist/ClosingDraftView-Du4kOwIg.js +1899 -0
  7. package/dist/ClosingHistoryView-DuW2Vtrs.js +355 -0
  8. package/dist/ClosingTemplateView-CfPY8R5M.js +2001 -0
  9. package/dist/{DeliveryOrderPrintPreview-DZPcRAja.js → DeliveryOrderPrintPreview-C6Cj8mOp.js} +9 -9
  10. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-WWIrybw_.js +230 -0
  11. package/dist/{FmMultiselectDialog-CZmwOkrb.js → FmMultiselectDialog-BzWrQOS4.js} +1 -1
  12. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C-2V2bGc.js → FmUnitInput.vue_vue_type_script_setup_true_lang-DwqVRUFz.js} +36 -36
  13. package/dist/ImportView-lKlYeLay.js +1291 -0
  14. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-BGnoF1Zz.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-_2WZMZU2.js} +5 -5
  15. package/dist/{IngredientGroupView-CAVYpEj3.js → IngredientGroupView-CrmwR2Xt.js} +34 -35
  16. package/dist/IngredientsView-1bAsyz-b.js +2254 -0
  17. package/dist/{IntegrationView-DdLFyZ4H.js → IntegrationView-D16qeEc_.js} +1773 -1635
  18. package/dist/{InventoryBindingForm-C7BdEDtM.js → InventoryBindingForm-BRwOXV_P.js} +1 -1
  19. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-B7DND2dQ.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-NDbtbtqK.js} +28 -28
  20. package/dist/{InventoryBindingSummary-IZ7F-Lti.js → InventoryBindingSummary-DKM2gX8_.js} +1 -1
  21. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-sgqVSlUB.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CdaiYTdf.js} +4 -4
  22. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DeF32bHu.js → PremiumBadge.vue_vue_type_script_setup_true_lang-B0OKeK5O.js} +7 -7
  23. package/dist/{PublishView-DkgfYneI.js → PublishView-D0NnU22l.js} +73 -63
  24. package/dist/{PurchaseOrderPrintPreview-CltLC4o4.js → PurchaseOrderPrintPreview-BmuwNbeL.js} +4 -4
  25. package/dist/{ReceiveRequestView-Dj7ji0DY.js → ReceiveRequestView-j79m7TKk.js} +343 -333
  26. package/dist/RecipeView-D_fNQQ-C.js +636 -0
  27. package/dist/StockView-DX_xeFBT.js +2385 -0
  28. package/dist/SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Bg49isUy.js +172 -0
  29. package/dist/{SupplierView-DE_M_9kd.js → SupplierView-DuFTqbOg.js} +1193 -1073
  30. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-c428GXwc.js +3233 -0
  31. package/dist/{TransferTemplateView-gWGBCF3u.js → TransferTemplateView-Ccsfcetz.js} +104 -103
  32. package/dist/UnitView-BklpNsFN.js +674 -0
  33. package/dist/WarehouseView-BrURbU67.js +1066 -0
  34. package/dist/api/adjustment-template.d.ts +1 -0
  35. package/dist/api/bill.d.ts +140 -2
  36. package/dist/api/closing-template.d.ts +1 -0
  37. package/dist/api/closing.d.ts +1 -0
  38. package/dist/api/inventory.d.ts +405 -0
  39. package/dist/api/netsuite.d.ts +5 -1
  40. package/dist/api/purchase-order-template.d.ts +1 -0
  41. package/dist/api/purchase-order.d.ts +3 -0
  42. package/dist/api/shipment.d.ts +11 -0
  43. package/dist/api/stock.d.ts +2 -44
  44. package/dist/api/warehouse.d.ts +3 -1
  45. package/dist/{app-CruHLH1e.js → app-a9r50k3U.js} +68551 -67573
  46. package/dist/app.d.ts +643 -15
  47. package/dist/app.js +6 -6
  48. package/dist/components/FmAdminBadge.vue.d.ts +1 -4
  49. package/dist/components/FmEnhancedSelect.vue.d.ts +30 -0
  50. package/dist/components/FmInventoryTableToolbar.vue.d.ts +16 -2
  51. package/dist/components/FmLockableField.vue.d.ts +3 -0
  52. package/dist/components/netsuite/ItemSubsidiaryTreeDialog.vue.d.ts +16 -0
  53. package/dist/components/netsuite/SubsidiaryTreeDialog.vue.d.ts +2 -0
  54. package/dist/composable/defineApi.d.ts +1 -1
  55. package/dist/composable/useIframe.d.ts +2 -2
  56. package/dist/{decimal-izbvCC1j.js → decimal-AusUnA1W.js} +1 -1
  57. package/dist/{format-unit-display-4SAdfyZB.js → format-unit-display-BqkHL-ph.js} +397 -429
  58. package/dist/helper/array.d.ts +1 -0
  59. package/dist/helper/core/country/utils.d.ts +3 -4
  60. package/dist/helper/country.d.ts +6 -255
  61. package/dist/helper/number.d.ts +1 -0
  62. package/dist/import-export.helper-PIyNeHfa.js +238 -0
  63. package/dist/{index-B6GGthLw.js → index-CjxirPvn.js} +283 -268
  64. package/dist/{index-CnQloOEo.js → index-Dj9-pdT9.js} +1 -1
  65. package/dist/layout/SingleColumnLayout.vue.d.ts +6 -3
  66. package/dist/purchase-order-template-CQikvY1p.js +41 -0
  67. package/dist/router/name.d.ts +2 -0
  68. package/dist/stock-CDZ2uWSF.js +83 -0
  69. package/dist/stock-Dw908dIC.js +74 -0
  70. package/dist/stores/feature.d.ts +12 -0
  71. package/dist/stores/integration/netsuite.d.ts +42 -0
  72. package/dist/stores/inventory.d.ts +28 -199
  73. package/dist/stores/location.d.ts +331 -1
  74. package/dist/stores/supplier.d.ts +96 -0
  75. package/dist/stores/warehouse.d.ts +4 -0
  76. package/dist/style.css +1 -1
  77. package/dist/{supplier-CTVE1lHO.js → supplier-BPPBUudN.js} +1 -1
  78. package/dist/tsconfig.app.tsbuildinfo +1 -1
  79. package/dist/{use-ingredient-select-dialog-CM80TfX0.js → use-ingredient-select-dialog-C_fSKN3_.js} +5 -5
  80. package/dist/{use-inventory-binding-dialog-D_omdhgn.js → use-inventory-binding-dialog-ClAkJ864.js} +8 -8
  81. package/dist/views/adjustment-template/wastage-template/actions.d.ts +60 -0
  82. package/dist/views/adjustment-template/wastage-template/table.d.ts +60 -0
  83. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +56 -0
  84. package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +3 -3
  85. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +468 -0
  86. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +9 -2
  87. package/dist/views/closing-history/ClosingHistoryView.vue.d.ts +2 -0
  88. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +4 -1
  89. package/dist/views/closing-template/helpers/import-export.helper.d.ts +5 -0
  90. package/dist/views/import/ImportView.vue.d.ts +3 -0
  91. package/dist/views/import/components/ImportDialog.vue.d.ts +2 -0
  92. package/dist/views/import/helper/import-export.helper.d.ts +4 -0
  93. package/dist/views/ingredients/components/ingredient-dialog/IngredientDialogProps.d.ts +1 -1
  94. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +181 -12
  95. package/dist/views/ingredients/components/ingredient-form/IngredientFormProps.d.ts +6 -0
  96. package/dist/views/ingredients/helper/import-export.helper.d.ts +4 -1
  97. package/dist/views/integration/components/netsuite/business/BusinessNetSuiteSideSheet.vue.d.ts +2 -0
  98. package/dist/views/receive-request/components/delivery-order-form/CreateForm.vue.d.ts +16 -0
  99. package/dist/views/receive-request/components/delivery-order-form/CreateFormProps.d.ts +4 -0
  100. package/dist/views/receive-request/components/delivery-order-form/EditForm.vue.d.ts +16 -0
  101. package/dist/views/receive-request/components/delivery-order-form/EditFormProps.d.ts +4 -0
  102. package/dist/views/receive-request/components/delivery-order-form/SystemTrailDialog.vue.d.ts +21 -0
  103. package/dist/views/receive-request/components/netsuite/NetSuiteTransactionChangeLog.vue.d.ts +15 -0
  104. package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +1 -0
  105. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +420 -2
  106. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +99 -0
  107. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +644 -13
  108. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +711 -14
  109. package/dist/views/recipe/RecipeView.vue.d.ts +1 -0
  110. package/dist/views/recipe/components/import-recipes/ImportRecipeItem.vue.d.ts +16 -0
  111. package/dist/views/recipe/components/import-recipes/ImportRecipes.vue.d.ts +2 -0
  112. package/dist/views/recipe/helper/import-recipe.d.ts +48 -0
  113. package/dist/views/stock/components/StockRecordCard.vue.d.ts +70 -1
  114. package/dist/views/stock/components/dialog/RecalculationDialog.vue.d.ts +11 -0
  115. package/dist/views/stock/components/dialog/RecalculationDialogProps.d.ts +3 -0
  116. package/dist/views/stock/components/dialog/StockAdjustmentSideSheet.vue.d.ts +20 -0
  117. package/dist/views/supplier/components/SupplierForm.vue.d.ts +8 -0
  118. package/dist/views/supplier/components/SupplierSupplyItemField.vue.d.ts +3 -0
  119. package/dist/views/supplier/composables/use-supplier-table.d.ts +4 -0
  120. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -0
  121. package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +2 -0
  122. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +16 -0
  123. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -0
  124. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -0
  125. package/dist/views/unit/UnitView.vue.d.ts +1 -0
  126. package/dist/views/unit/components/import-units/ImportUnitItem.vue.d.ts +12 -0
  127. package/dist/views/unit/components/import-units/ImportUnitItemProps.d.ts +6 -0
  128. package/dist/views/unit/components/import-units/ImportUnits.vue.d.ts +9 -0
  129. package/dist/views/unit/components/import-units/ImportUnitsProps.d.ts +5 -0
  130. package/dist/views/unit/helper/import-export.helper.d.ts +40 -0
  131. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +8 -0
  132. package/package.json +3 -3
  133. package/dist/App-BqaRC0Sb.js +0 -276
  134. package/dist/ClosingDraftView-sJ_zRPeo.js +0 -1687
  135. package/dist/ClosingTemplateView-cNgXHq1r.js +0 -1908
  136. package/dist/FmAdminBadge-oCnz8SW6.js +0 -34
  137. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BKR8C4p_.js +0 -224
  138. package/dist/IngredientsView-CHHeAJH_.js +0 -1858
  139. package/dist/RecipeView-BukmKdVG.js +0 -621
  140. package/dist/StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js +0 -59
  141. package/dist/StockView-wxRCw_w-.js +0 -2087
  142. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-eqUOnJoM.js +0 -2336
  143. package/dist/UnitView-BgwDmGZo.js +0 -667
  144. package/dist/WarehouseView-BdccenhO.js +0 -1034
  145. package/dist/array-Ca8T3f_G.js +0 -44
  146. package/dist/helper/core/country/codes.d.ts +0 -255
  147. package/dist/stock-BJP5BB5b.js +0 -146
@@ -1,621 +0,0 @@
1
- import { defineComponent as K, ref as E, onMounted as re, resolveComponent as $, openBlock as F, createElementBlock as B, Fragment as ie, createElementVNode as h, toDisplayString as ue, createVNode as g, createCommentVNode as O, computed as k, watch as ce, createBlock as N, withCtx as P, unref as b, isRef as ee, normalizeClass as de, normalizeStyle as me, Teleport as pe, normalizeProps as fe, guardReactiveProps as ve } from "vue";
2
- import { a as A, e as V, f as Q, S as ye, h as ge, D as te, i as Y, j as U, F as H, m as be, U as _e, A as we, c as Re, q as ne, r as he, v as xe, s as Se, u as Ve, B as Ce, _ as Ee, C as Fe, E as $e, G as oe } from "./app-CruHLH1e.js";
3
- import { useDialog as ke, useSnackbar as se, useProxiedModel as ae, useBreakpoints as Ie } from "@feedmepos/ui-library";
4
- import { i as De, _ as Ae } from "./is-linked-ingredient-error-fJ2TJb3z.js";
5
- import { _ as le } from "./IngredientBindedItem.vue_vue_type_script_setup_true_lang-BGnoF1Zz.js";
6
- import { defineStore as Be, storeToRefs as Pe } from "pinia";
7
- import { useI18n as q } from "@feedmepos/mf-common";
8
- import { _ as Te } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-B7DND2dQ.js";
9
- import { _ as Ue } from "./FmCustomAttribute.vue_vue_type_script_setup_true_lang-D-IWRjRD.js";
10
- const Me = {
11
- key: 0,
12
- class: "flex flex-col items-center w-full h-full gap-24"
13
- }, Ne = { key: 1 }, Le = { key: 0 }, ze = /* @__PURE__ */ K({
14
- __name: "DeleteDialog",
15
- props: {
16
- type: {},
17
- data: {},
18
- message: {},
19
- bindedItems: {}
20
- },
21
- setup(w) {
22
- const p = w, f = E(p.bindedItems || []), l = E(!1);
23
- re(() => {
24
- r();
25
- });
26
- async function r() {
27
- var c, i;
28
- !l.value && ((c = p.data) != null && c._id) && (l.value = !0, f.value = await A().getAffectedMenu((i = p.data) == null ? void 0 : i._id), l.value = !1);
29
- }
30
- return (c, i) => {
31
- const v = $("FmSpacer"), d = $("FmCircularProgress");
32
- return F(), B(ie, null, [
33
- h("p", null, ue(c.message), 1),
34
- l.value ? (F(), B("div", Me, [
35
- g(v),
36
- h("div", null, [
37
- g(d, { size: "xl" })
38
- ]),
39
- i[0] || (i[0] = h("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
40
- g(v)
41
- ])) : (F(), B("div", Ne, [
42
- i[2] || (i[2] = h("br", null, null, -1)),
43
- f.value.length > 0 ? (F(), B("div", Le, [
44
- i[1] || (i[1] = h("p", { class: "fm-typo-en-body-lg-600" }, "Affected menu items:", -1)),
45
- g(le, {
46
- name: "Menu",
47
- bindings: f.value
48
- }, null, 8, ["bindings"])
49
- ])) : O("", !0)
50
- ]))
51
- ], 64);
52
- };
53
- }
54
- }), J = Be("recipeForm", function() {
55
- const p = ke(), f = se(), l = A(), r = E(!1), c = E();
56
- function i() {
57
- const t = {
58
- recipe: {},
59
- mode: V.CREATE,
60
- show: !0,
61
- "onUpdate:show"(n) {
62
- c.value.show = n;
63
- }
64
- };
65
- c.value = t;
66
- }
67
- async function v(t) {
68
- const n = {
69
- recipe: Q(t),
70
- mode: V.UPDATE,
71
- show: !0,
72
- "onUpdate:show"(m) {
73
- c.value.show = m;
74
- }
75
- };
76
- c.value = n;
77
- }
78
- async function d(t) {
79
- r.value = !0;
80
- try {
81
- await l.deleteRecipe(t), f.open({
82
- title: "Success",
83
- message: `Deleted ${t.name}`,
84
- type: "success"
85
- });
86
- } catch (n) {
87
- n instanceof ye && De(n) ? p.open({
88
- title: "Cannot delete recipe",
89
- contentComponent: Ae,
90
- contentComponentProps: {
91
- subject: (t == null ? void 0 : t.name) ?? "",
92
- items: n.errorResponse.message
93
- },
94
- secondaryActions: {
95
- text: "Close",
96
- close: !0
97
- }
98
- }) : console.log("unable to delete recipe", n), f.open({
99
- title: `Cannot delete ${t == null ? void 0 : t.name}`,
100
- message: "Please try again.",
101
- type: "error"
102
- }), console.error("failed to delete recipe", n);
103
- } finally {
104
- r.value = !1;
105
- }
106
- }
107
- function u(t) {
108
- p.open({
109
- title: `Delete ${(t == null ? void 0 : t.name) ?? "recipe"}?`,
110
- closeButton: !1,
111
- primaryActions: {
112
- text: "Delete",
113
- close: !0,
114
- variant: "destructive"
115
- },
116
- secondaryActions: {
117
- text: "Cancel",
118
- close: !0
119
- },
120
- contentComponent: ze,
121
- contentComponentProps: {
122
- type: "menu",
123
- data: t,
124
- message: "You may not be able to delete this recipe if it is linked in any of the inventory modules."
125
- }
126
- }).onPrimary(() => d(t));
127
- }
128
- return {
129
- createRecipe: i,
130
- updateRecipe: v,
131
- deleteRecipe: u,
132
- recipeDialogProps: c,
133
- recipeViewLoading: r
134
- };
135
- });
136
- function Ge() {
137
- const { updateRecipe: w, deleteRecipe: p } = J(), f = A(), { t: l } = q();
138
- async function r(d, u) {
139
- const t = Q(u);
140
- if (d === Y.Edit) {
141
- await w(t);
142
- return;
143
- }
144
- if (d === Y.Delete) {
145
- await p(t);
146
- return;
147
- }
148
- }
149
- function c(d, u) {
150
- const t = d.filter((o) => o.type === H.enum.SKU), n = d.filter(
151
- (o) => o.type === H.enum.SKU_GROUP
152
- ), m = d.filter((o) => o.type === H.enum.RECIPE);
153
- return [
154
- ...t.map((o) => ({ ...o, recipeIds: [...u] })),
155
- ...n.map((o) => ({ ...o, isGroup: !0, recipeIds: [...u] })),
156
- ...m.filter((o) => f.recipeById[o.id] && !u.has(o.id)).flatMap(
157
- (o) => c(f.recipeById[o.id].contains, /* @__PURE__ */ new Set([...u, o.id]))
158
- )
159
- ];
160
- }
161
- const i = [
162
- {
163
- accessorKey: "recipe",
164
- header: () => l("inventory.recipe.name"),
165
- size: 400
166
- },
167
- {
168
- accessorKey: "ingredients",
169
- header: () => l("inventory.recipe.ingredients"),
170
- size: "auto"
171
- },
172
- {
173
- id: "action",
174
- header: "",
175
- cell(d) {
176
- return ge(
177
- [te[Y.Edit], te[Y.Delete]],
178
- (u) => {
179
- r(u, d.row.original.original);
180
- }
181
- );
182
- },
183
- enableSorting: !1,
184
- size: 40,
185
- meta: {
186
- cellClass: "",
187
- headerClass: ""
188
- }
189
- }
190
- ];
191
- function v(d) {
192
- const u = A();
193
- return d.map((t) => ({
194
- recipe: t.name,
195
- ingredients: c(t.contains, /* @__PURE__ */ new Set([t._id])).map((n) => {
196
- var o, _, a, y, C, x;
197
- if (n.isGroup) {
198
- const R = u.skuGroupById[n.id];
199
- return n.recipeIds.slice(1).length ? `(${(o = u.recipeById[n.recipeIds.at(-1) ?? ""]) == null ? void 0 : o.name}) ${R.name} (x ${U(n.amount)})` : `${R.name} (x${U(n.amount)})`;
200
- }
201
- const m = u.skuById[n.id];
202
- return m ? n.recipeIds.slice(1).length ? `(${(_ = u.recipeById[n.recipeIds.at(-1) ?? ""]) == null ? void 0 : _.name}) ${m.name} (${U(n.amount)}${((a = n.measurement) == null ? void 0 : a.abbrev) ?? ((y = m == null ? void 0 : m.unit) == null ? void 0 : y.abbrev)})` : `${m.name} (${U(n.amount)}${((C = n.measurement) == null ? void 0 : C.abbrev) ?? ((x = m == null ? void 0 : m.unit) == null ? void 0 : x.abbrev)})` : null;
203
- }).filter((n) => n).join(", "),
204
- original: t
205
- }));
206
- }
207
- return { columnDefs: i, formatRowData: v };
208
- }
209
- const je = { class: "flex flex-col gap-40" }, Ye = {
210
- key: 0,
211
- class: "col-span-2 mt-16 border-1 border-fm-color-neutral-gray-200 fm-corner-radius-lg flex flex-col p-16 gap-16"
212
- }, Ke = {
213
- key: 0,
214
- class: "flex flex-col items-center w-full h-full gap-24"
215
- }, qe = { key: 1 }, He = { class: "mt-32" }, Oe = /* @__PURE__ */ K({
216
- __name: "RecipeForm",
217
- props: {
218
- mode: {},
219
- modelValue: {},
220
- disabled: { type: Boolean }
221
- },
222
- emits: ["update:modelValue", "click:submit"],
223
- setup(w, { expose: p, emit: f }) {
224
- var R;
225
- const l = w, r = f, c = Re(), { t: i } = q(), v = k({
226
- get() {
227
- var e;
228
- return ((e = l.modelValue) == null ? void 0 : e.name) ?? "";
229
- },
230
- set(e) {
231
- const s = l.modelValue ?? {};
232
- s.name = e, r("update:modelValue", s);
233
- }
234
- }), d = k({
235
- get() {
236
- var e;
237
- return ((e = l.modelValue) == null ? void 0 : e.contains) ?? [];
238
- },
239
- set(e) {
240
- const s = l.modelValue ?? {};
241
- s.contains = e, r("update:modelValue", s);
242
- }
243
- }), u = k({
244
- get() {
245
- var e;
246
- return ((e = l.modelValue) == null ? void 0 : e.customAttributes) ?? {};
247
- },
248
- set(e) {
249
- const s = l.modelValue ? {
250
- ...l.modelValue
251
- } : {};
252
- s.customAttributes = e, r("update:modelValue", s);
253
- }
254
- });
255
- function t() {
256
- r("click:submit");
257
- }
258
- const n = E();
259
- p({
260
- validateInputs: () => {
261
- var e, s;
262
- (s = (e = n.value) == null ? void 0 : e.validateInputs) == null || s.call(e);
263
- },
264
- resetInputsValidation: () => {
265
- var e, s;
266
- (s = (e = n.value) == null ? void 0 : e.resetInputsValidation) == null || s.call(e);
267
- },
268
- resetInputs: () => {
269
- var e, s;
270
- (s = (e = n.value) == null ? void 0 : e.resetInputs) == null || s.call(e);
271
- }
272
- });
273
- const m = A(), o = E([]), _ = E(!1), a = E(!1);
274
- ce(_, async (e) => {
275
- y(e);
276
- });
277
- async function y(e) {
278
- var s, I;
279
- e && !a.value && ((s = l.modelValue) != null && s._id) && (a.value = !0, o.value = await m.getAffectedMenu((I = l.modelValue) == null ? void 0 : I._id).delayed(500), a.value = !1);
280
- }
281
- const C = k(
282
- () => m.recipes.map((e) => ({ label: e.name, value: e.name }))
283
- ), x = E((R = l.modelValue) == null ? void 0 : R.name);
284
- return (e, s) => {
285
- const I = $("FmTextField"), D = $("FmCard"), L = $("FmSwitch"), M = $("FmSpacer"), z = $("FmCircularProgress"), T = $("FmForm");
286
- return F(), N(T, {
287
- ref_key: "formRef",
288
- ref: n,
289
- onValidationSuccess: t
290
- }, {
291
- default: P(() => [
292
- h("div", je, [
293
- g(I, {
294
- disabled: e.disabled,
295
- label: b(i)("inventory.recipe.name"),
296
- "model-value": v.value,
297
- "onUpdate:modelValue": s[0] || (s[0] = (S) => v.value = S),
298
- rules: [
299
- b(be)(),
300
- b(_e)(C.value, x.value, (S) => `[${S.value}] already exists`)
301
- ],
302
- "label-mark": "required"
303
- }, null, 8, ["disabled", "label", "model-value", "rules"]),
304
- g(D, {
305
- variant: "outlined",
306
- class: "p-16"
307
- }, {
308
- default: P(() => {
309
- var S;
310
- return [
311
- g(Te, {
312
- id: (S = e.modelValue) == null ? void 0 : S._id,
313
- disabled: e.disabled,
314
- "model-value": d.value,
315
- "onUpdate:modelValue": s[1] || (s[1] = (G) => d.value = G),
316
- rules: [b(we)(1)],
317
- "enable-ingredient-group": b(c).enableIngredientGroup
318
- }, null, 8, ["id", "disabled", "model-value", "rules", "enable-ingredient-group"])
319
- ];
320
- }),
321
- _: 1
322
- })
323
- ]),
324
- e.mode !== b(V).CREATE ? (F(), B("div", Ye, [
325
- g(L, {
326
- label: "Show binded items",
327
- modelValue: _.value,
328
- "onUpdate:modelValue": s[2] || (s[2] = (S) => _.value = S),
329
- "label-placement": "right",
330
- disabled: a.value
331
- }, null, 8, ["modelValue", "disabled"]),
332
- a.value ? (F(), B("div", Ke, [
333
- g(M),
334
- h("div", null, [
335
- g(z, { size: "xl" })
336
- ]),
337
- s[4] || (s[4] = h("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading...", -1)),
338
- g(M)
339
- ])) : _.value && o.value.length ? (F(), B("div", qe, [
340
- g(le, {
341
- name: "Menu",
342
- bindings: o.value
343
- }, null, 8, ["bindings"])
344
- ])) : O("", !0)
345
- ])) : O("", !0),
346
- h("div", He, [
347
- g(Ue, {
348
- entity: "inventoryRecipe",
349
- modelValue: u.value,
350
- "onUpdate:modelValue": s[3] || (s[3] = (S) => u.value = S)
351
- }, null, 8, ["modelValue"])
352
- ])
353
- ]),
354
- _: 1
355
- }, 512);
356
- };
357
- }
358
- }), Je = { class: "flex gap-4" }, Qe = /* @__PURE__ */ K({
359
- __name: "RecipeDialog",
360
- props: {
361
- show: { type: Boolean },
362
- recipe: {},
363
- mode: { default: V.READ }
364
- },
365
- emits: ["update:show"],
366
- setup(w) {
367
- const p = w, f = A(), l = se(), { t: r } = q(), c = ae(p, "show"), i = ae(p, "recipe"), v = k(() => {
368
- switch (p.mode) {
369
- case V.READ:
370
- return "";
371
- case V.UPDATE:
372
- return r("inventory.recipe.update.title");
373
- case V.CREATE:
374
- return r("inventory.recipe.create.title");
375
- }
376
- return "";
377
- }), d = k(() => {
378
- switch (p.mode) {
379
- case V.READ:
380
- return "";
381
- case V.UPDATE:
382
- return r("common.save");
383
- case V.CREATE:
384
- return r("common.add");
385
- }
386
- return "";
387
- }), u = E(), t = E(!1);
388
- async function n() {
389
- t.value = !0;
390
- try {
391
- const a = Q(i.value);
392
- a.precision ?? (a.precision = 0), a.measurements ?? (a.measurements = []), await f.createRecipe(a), c.value = !1, l.open({
393
- title: r("inventory.common.success"),
394
- message: r("inventory.recipe.create.success", { name: i.value.name }),
395
- type: "success"
396
- });
397
- } catch (a) {
398
- a instanceof ne || l.open({
399
- title: r("inventory.recipe.create.error.title"),
400
- message: r("inventory.recipe.create.error.message"),
401
- type: "error"
402
- });
403
- } finally {
404
- t.value = !1;
405
- }
406
- }
407
- async function m() {
408
- t.value = !0;
409
- try {
410
- await f.updateRecipe(i.value), c.value = !1, l.open({
411
- title: r("inventory.common.success"),
412
- message: r("inventory.recipe.update.success", { name: i.value.name }),
413
- type: "success"
414
- });
415
- } catch (a) {
416
- a instanceof ne || l.open({
417
- title: r("inventory.recipe.update.error.title"),
418
- message: r("inventory.recipe.update.error.message"),
419
- type: "error"
420
- });
421
- } finally {
422
- t.value = !1;
423
- }
424
- }
425
- function o() {
426
- var a, y;
427
- (y = (a = u.value) == null ? void 0 : a.validateInputs) == null || y.call(a);
428
- }
429
- function _() {
430
- switch (p.mode) {
431
- case V.READ:
432
- return;
433
- case V.UPDATE:
434
- return m();
435
- case V.CREATE:
436
- return n();
437
- }
438
- }
439
- return (a, y) => {
440
- const C = $("FmButton"), x = $("FmSideSheet");
441
- return F(), N(x, {
442
- "model-value": b(c),
443
- "onUpdate:modelValue": y[3] || (y[3] = (R) => ee(c) ? c.value = R : null),
444
- header: v.value,
445
- "close-button": "",
446
- "dismiss-away": "",
447
- "max-width": 500
448
- }, {
449
- "side-sheet-footer": P(() => [
450
- h("div", Je, [
451
- g(C, {
452
- loading: t.value,
453
- label: d.value,
454
- onClick: o
455
- }, null, 8, ["loading", "label"]),
456
- g(C, {
457
- disabled: t.value,
458
- label: b(r)("common.close"),
459
- variant: "tertiary",
460
- onClick: y[2] || (y[2] = (R) => c.value = !1)
461
- }, null, 8, ["disabled", "label"])
462
- ])
463
- ]),
464
- default: P(() => [
465
- g(Oe, {
466
- class: "w-full",
467
- ref_key: "hasValidationExpose",
468
- ref: u,
469
- modelValue: b(i),
470
- "onUpdate:modelValue": y[0] || (y[0] = (R) => ee(i) ? i.value = R : null),
471
- mode: a.mode,
472
- disabled: t.value,
473
- "onClick:submit": y[1] || (y[1] = (R) => _())
474
- }, null, 8, ["modelValue", "mode", "disabled"])
475
- ]),
476
- _: 1
477
- }, 8, ["model-value", "header"]);
478
- };
479
- }
480
- });
481
- function We(w) {
482
- return !w || Object.keys(w).length === 0 ? "" : Object.entries(w).map(([p, f]) => `${p}: ${f}`).join(", ");
483
- }
484
- function Xe() {
485
- const w = A(), p = w.recipes, f = w.recipeById, l = w.skuById, r = p.flatMap((v, d) => {
486
- var t;
487
- const u = We(v.customAttributes);
488
- if ((t = v.contains) != null && t.length) {
489
- const n = v.contains.filter((o) => o.type === "RECIPE"), m = v.contains.filter((o) => o.type === "SKU");
490
- return [
491
- ...d === 0 ? [] : [["", "", "", "", "", "", ""]],
492
- ...n.map(
493
- (o, _) => {
494
- var a;
495
- return [
496
- _ === 0 ? v.name : "",
497
- "RECIPE",
498
- "",
499
- (a = f[o.id]) == null ? void 0 : a.name,
500
- U(o.amount),
501
- "UNIT",
502
- _ === 0 ? u : ""
503
- ];
504
- }
505
- ),
506
- ...m.map(
507
- (o, _) => {
508
- var a, y, C, x;
509
- return [
510
- !n.length && _ === 0 ? v.name : "",
511
- "INGREDIENT",
512
- (a = l[o.id]) == null ? void 0 : a.code,
513
- (y = l[o.id]) == null ? void 0 : y.name,
514
- U(o.amount),
515
- o.measurement ? o.measurement.abbrev : (x = (C = l[o.id]) == null ? void 0 : C.unit) == null ? void 0 : x.abbrev,
516
- !n.length && _ === 0 ? u : ""
517
- ];
518
- }
519
- )
520
- ];
521
- }
522
- return [
523
- ...d === 0 ? [] : [["", "", "", "", "", "", ""]],
524
- [v.name, "No bindings", "", "", "", "", u]
525
- ];
526
- }), i = he(r, ["Name", "Type", "Code", "Item", "Amount", "Unit", "Custom Attributes"]);
527
- xe(i, `RECIPE_${Se(/* @__PURE__ */ new Date(), "-", "-")}.xlsx`);
528
- }
529
- const Ze = { class: "flex flex-col py-8" }, et = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, tt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, dt = /* @__PURE__ */ K({
530
- __name: "RecipeView",
531
- setup(w) {
532
- const p = A(), f = k(() => p.recipes), l = Ve(), { createRecipe: r, updateRecipe: c } = J(), { recipeDialogProps: i, recipeViewLoading: v } = Pe(J()), { columnDefs: d, formatRowData: u } = Ge(), t = k(() => u(f.value));
533
- function n(R) {
534
- if (R === "add")
535
- return r();
536
- if (R === "export")
537
- return Xe();
538
- }
539
- const m = E(""), o = k(() => v.value), { breakpoints: _ } = Ie(), a = k(() => _.value.xs || _.value.sm), y = k(() => a.value ? 10 : 20), C = Ce(), { t: x } = q();
540
- return (R, e) => {
541
- const s = $("FmTable");
542
- return F(), N(Ee, {
543
- title: b(x)("inventory.recipe.title"),
544
- actions: [
545
- {
546
- label: b(x)("inventory.recipe.create.title"),
547
- value: "add",
548
- isPrimary: !0,
549
- prependIcon: "add"
550
- },
551
- { label: b(x)("common.export"), value: "export", isPrimary: !1 }
552
- ],
553
- "onClick:action": n
554
- }, {
555
- default: P(() => [
556
- h("div", {
557
- class: de([
558
- "flex flex-col gap-8 max-h-full",
559
- {
560
- "p-0": a.value,
561
- "px-24 ": !a.value
562
- }
563
- ])
564
- }, [
565
- g(Fe, {
566
- searchable: "",
567
- search: m.value,
568
- "onUpdate:search": e[0] || (e[0] = (I) => m.value = I)
569
- }, null, 8, ["search"]),
570
- (F(), N(s, {
571
- style: me(b(C).tableHeight),
572
- "column-defs": b(d),
573
- "row-data": t.value,
574
- "search-value": m.value,
575
- loading: !b(l)._currentLocation || o.value,
576
- onRowClick: e[1] || (e[1] = (I) => b(c)(I.original.original)),
577
- key: f.value.length,
578
- "page-size": y.value
579
- }, {
580
- "list-row": P((I) => [
581
- g($e, {
582
- row: I,
583
- onRowClick: (D) => b(c)(D.original)
584
- }, {
585
- default: P((D) => {
586
- var L, M, z, T, S, G, W, X, j, Z;
587
- return [
588
- h("div", Ze, [
589
- h("div", et, [
590
- g(b(oe), {
591
- render: (z = (M = (L = D.recipe) == null ? void 0 : L.column) == null ? void 0 : M.columnDef) == null ? void 0 : z.cell,
592
- props: (S = (T = D.recipe) == null ? void 0 : T.getContext) == null ? void 0 : S.call(T)
593
- }, null, 8, ["render", "props"])
594
- ]),
595
- h("div", tt, [
596
- g(b(oe), {
597
- render: (X = (W = (G = D.ingredients) == null ? void 0 : G.column) == null ? void 0 : W.columnDef) == null ? void 0 : X.cell,
598
- props: (Z = (j = D.ingredients) == null ? void 0 : j.getContext) == null ? void 0 : Z.call(j)
599
- }, null, 8, ["render", "props"])
600
- ])
601
- ])
602
- ];
603
- }),
604
- _: 2
605
- }, 1032, ["row", "onRowClick"])
606
- ]),
607
- _: 1
608
- }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
609
- ], 2),
610
- (F(), N(pe, { to: "body" }, [
611
- g(Qe, fe(ve(b(i))), null, 16)
612
- ]))
613
- ]),
614
- _: 1
615
- }, 8, ["title", "actions"]);
616
- };
617
- }
618
- });
619
- export {
620
- dt as default
621
- };
@@ -1,59 +0,0 @@
1
- import { defineComponent as m, computed as p, openBlock as i, createElementBlock as l, createElementVNode as r, normalizeClass as c, toDisplayString as d, unref as f } from "vue";
2
- import { useI18n as y } from "@feedmepos/mf-common";
3
- function $(e, o = !1) {
4
- var t;
5
- return e ? [
6
- {
7
- label: o ? e.abbrev : `1 ${e.name} (${e.abbrev})`,
8
- abbrev: e.abbrev,
9
- value: null
10
- },
11
- ...((t = e.measurements) == null ? void 0 : t.map((n) => ({
12
- label: o ? n.abbrev : `1 ${n.name} (${n.abbrev})`,
13
- abbrev: n.abbrev,
14
- value: n.id
15
- }))) ?? []
16
- ] : [];
17
- }
18
- var a = /* @__PURE__ */ ((e) => (e.noInfo = "no-info", e.low = "low", e.mid = "mid", e.high = "high", e))(a || {});
19
- const u = {
20
- key: 0,
21
- class: "flex"
22
- }, b = {
23
- key: 1,
24
- class: "flex"
25
- }, v = { class: "flex px-8 py-4 bg-fm-color-neutral-gray-100 fm-corner-radius-md gap-8" }, _ = { class: "fm-typo-en-body-md-600 text-fm-color-typo-secondary" }, k = /* @__PURE__ */ m({
26
- __name: "StockForecast",
27
- props: {
28
- days: {},
29
- level: {}
30
- },
31
- setup(e) {
32
- const o = e, { t: s } = y(), t = p(() => o.level ? o.level : typeof o.days != "number" ? a.noInfo : o.days > 14 ? a.high : o.days >= 7 && o.days <= 14 ? a.mid : a.low);
33
- return (n, g) => typeof o.days == "number" ? (i(), l("div", u, [
34
- r("div", {
35
- class: c([
36
- `fm-forecast-notification-${t.value}`,
37
- "flex items-center gap-8 p-4 fm-corner-radius-md fm-typo-en-body-md-600"
38
- ])
39
- }, [
40
- r("div", {
41
- class: c([
42
- "fm-forecast-notification-indicator",
43
- `fm-forecast-notification-indicator-${t.value}`
44
- ])
45
- }, null, 2),
46
- r("div", null, d(f(s)("inventory.stock.prediction.days", [o.days])), 1)
47
- ], 2)
48
- ])) : (i(), l("div", b, [
49
- r("div", v, [
50
- r("p", _, d(f(s)("inventory.stock.prediction.noData")), 1)
51
- ])
52
- ]));
53
- }
54
- });
55
- export {
56
- a as S,
57
- k as _,
58
- $ as g
59
- };