@feedmepos/mf-inventory-portal 0.0.22-prod.1 → 0.0.23-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 (191) hide show
  1. package/dist/App-Y3Ez8Rjf.js +255 -0
  2. package/dist/App.vue.d.ts +2 -0
  3. package/dist/ApprovalView-BUU1G4Q2.js +141 -0
  4. package/dist/{BindingsDialog-BHh_8Rya.js → BindingsDialog-8wc4Q0JQ.js} +10 -10
  5. package/dist/{BindingsPicker-CQAtjxT5.js → BindingsPicker-DGWN1LQc.js} +10 -10
  6. package/dist/BindingsTable-7NJP2jT6.js +149 -0
  7. package/dist/ClosingTemplateView-9s7vmwaT.js +1833 -0
  8. package/dist/FmDroppableField-8RzKjEdL.js +154 -0
  9. package/dist/FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B4DDh9-a.js +267 -0
  10. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-5DINn0ZB.js +436 -0
  11. package/dist/FmMultiselectDialog-7hok9sJP.js +411 -0
  12. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-CxR1FCft.js +326 -0
  13. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-FQ0HjuL3.js +51 -0
  14. package/dist/IngredientGroupView-C3maHTCg.js +610 -0
  15. package/dist/IngredientsView-DCR3IBkR.js +1613 -0
  16. package/dist/IntegrationView-gO4h89Wj.js +1227 -0
  17. package/dist/{InventoryBindingForm-BYPX9YC5.js → InventoryBindingForm-dh3GeyG-.js} +1 -1
  18. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CJuo3i7W.js +278 -0
  19. package/dist/{InventoryBindingSummary-ChNN_sYB.js → InventoryBindingSummary-BPoPcEoe.js} +1 -1
  20. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CeKykySW.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-olm8sZKt.js} +1 -1
  21. package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-BezTV43V.js +116 -0
  22. package/dist/{PurchaseOrderPrintPreview-6MhvRIXQ.js → PurchaseOrderPrintPreview-Dix_fIoo.js} +11 -11
  23. package/dist/ReceiveRequestView-DdPiYb2P.js +4082 -0
  24. package/dist/RecipeView-C4-a4IEW.js +597 -0
  25. package/dist/Standalone.vue.d.ts +2 -0
  26. package/dist/StockView-Du2txrIP.js +7778 -0
  27. package/dist/SupplierView-D_09FbQh.js +1474 -0
  28. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-C9MOos--.js +1144 -0
  29. package/dist/TransferTemplateView-j3CRy6Lc.js +1262 -0
  30. package/dist/{UnitView-lY-nC3Rj.js → UnitView-BXw2Vwq1.js} +84 -85
  31. package/dist/WarehouseView-CKamiETC.js +1020 -0
  32. package/dist/api/bill.d.ts +84 -240
  33. package/dist/api/closing-template.d.ts +23 -0
  34. package/dist/api/inventory.d.ts +301 -11
  35. package/dist/api/netsuite.d.ts +71 -0
  36. package/dist/api/purchase-order-template.d.ts +4 -6
  37. package/dist/api/stock.d.ts +8 -0
  38. package/dist/api/supplier.d.ts +1 -0
  39. package/dist/app-GUbzqEtW.js +33456 -0
  40. package/dist/app.d.ts +135 -9
  41. package/dist/app.js +4 -4
  42. package/dist/array-hChJVZLE.js +43 -0
  43. package/dist/components/FmFilterableMenuOptions.vue.d.ts +54 -0
  44. package/dist/components/FmMinMaxInputRules.d.ts +2 -0
  45. package/dist/components/FmMultiselectDialog.vue.d.ts +3 -9
  46. package/dist/components/FmMultiselectDialogProps.d.ts +1 -2
  47. package/dist/components/FmUnitInputProps.d.ts +1 -0
  48. package/dist/components/FmUnitInputRules.d.ts +2 -0
  49. package/dist/components/VirtualScroll.vue.d.ts +47 -0
  50. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +6 -6
  51. package/dist/components/map/GoogleMap.vue.d.ts +4 -4
  52. package/dist/components/shell/inventory/binding-dialog.vue.d.ts +2 -2
  53. package/dist/components/shell/inventory/binding-ui.vue.d.ts +3 -3
  54. package/dist/date2-CLE9fB2R.js +117 -0
  55. package/dist/{dayjs.min-Cx-xZyRL.js → dayjs.min-CY1d38w7.js} +32 -32
  56. package/dist/{decimal-CZkLc7sG.js → decimal-SIjO6Mjw.js} +1 -1
  57. package/dist/defineDeepModel-l40rX7kr.js +13 -0
  58. package/dist/extensions/array.d.ts +1 -0
  59. package/dist/extensions/promises.d.ts +14 -0
  60. package/dist/{feature-DbRHbnRc.js → feature-BXruKUhX.js} +24 -29
  61. package/dist/format-time-from-id-CcFsBXmk.js +15 -0
  62. package/dist/format-unit-display-DEKg8cJm.js +1198 -0
  63. package/dist/{fuzzy-D75L7gtr.js → fuzzy-CVOV9zJc.js} +1 -1
  64. package/dist/helper/date2.d.ts +1 -0
  65. package/dist/helper/rules.d.ts +7 -0
  66. package/dist/helper/rules.spec.d.ts +1 -0
  67. package/dist/helper/xlsx.util.d.ts +7 -0
  68. package/dist/{index-Cx-j_s9Y.js → index-BX5KZXhI.js} +2047 -1283
  69. package/dist/{index-B_s-TuYE.js → index-CVsyOEb1.js} +4926 -6363
  70. package/dist/index-m9e9nYfl.js +45 -0
  71. package/dist/netsuite-DAKRv7zr.js +146 -0
  72. package/dist/normalizeArguments-DP7Hrren.js +1552 -0
  73. package/dist/router/name.d.ts +2 -0
  74. package/dist/rules-DlnN8IP3.js +198 -0
  75. package/dist/stores/api.d.ts +1 -0
  76. package/dist/stores/feature.d.ts +0 -1
  77. package/dist/stores/helper/core-store-proxy.d.ts +3 -0
  78. package/dist/stores/helper/generate-backend-urls.d.ts +1 -0
  79. package/dist/stores/integration/foodmarkethub.d.ts +391 -0
  80. package/dist/stores/integration/index.d.ts +7 -0
  81. package/dist/stores/integration/netsuite.d.ts +102 -0
  82. package/dist/stores/inventory.d.ts +304 -12
  83. package/dist/stores/location.d.ts +337 -1612
  84. package/dist/stores/route.d.ts +0 -5
  85. package/dist/stores/supplier.d.ts +124 -4
  86. package/dist/stores/warehouse.d.ts +7 -4
  87. package/dist/style.css +1 -1
  88. package/dist/supplier-B21WlSAM.js +77 -0
  89. package/dist/tsconfig.app.tsbuildinfo +1 -1
  90. package/dist/{use-inventory-binding-dialog-DteA3LAo.js → use-inventory-binding-dialog-D3x6xj2O.js} +29 -27
  91. package/dist/use-template-enabled-locations-2-z-b-UXef.js +86 -0
  92. package/dist/views/closing-template/closing-template-import/ClosingTemplateImport.vue.d.ts +2 -0
  93. package/dist/views/closing-template/closing-template-import/ClosingTemplateImportItem.vue.d.ts +12 -0
  94. package/dist/views/closing-template/closing-template-import/ClosingTemplateImportItemProps.d.ts +7 -0
  95. package/dist/views/closing-template/components/closing-template-details/ClosingTemplateDetails.vue.d.ts +2 -0
  96. package/dist/views/closing-template/components/closing-template-details/ClosingTemplateDetailsProps.d.ts +8 -0
  97. package/dist/views/closing-template/components/closing-template-dialog/ClosingTemplateDialog.vue.d.ts +22 -0
  98. package/dist/views/closing-template/components/closing-template-dialog/ClosingTemplateDialogProps.d.ts +10 -0
  99. package/dist/views/closing-template/components/closing-template-form/ClosingTemplateForm.vue.d.ts +16 -0
  100. package/dist/views/closing-template/components/closing-template-form/ClosingTemplateFormProps.d.ts +7 -0
  101. package/dist/views/closing-template/components/closing-template-form/components/ClosingTemplateItem.vue.d.ts +18 -0
  102. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +79 -0
  103. package/dist/views/closing-template/components/closing-template-publish/ClosingTemplatePublish.vue.d.ts +6 -0
  104. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +2232 -0
  105. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +2209 -0
  106. package/dist/views/closing-template/helpers/import-export.helper.d.ts +58 -0
  107. package/dist/views/ingredient-group/IngredientGroupView.vue.d.ts +3 -0
  108. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +31 -0
  109. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +12 -0
  110. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +20 -0
  111. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +12 -0
  112. package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +24 -0
  113. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +215 -0
  114. package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +2 -2
  115. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +4 -4
  116. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +5 -5
  117. package/dist/views/ingredients/composables/use-ingredient-form.d.ts +2 -2
  118. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +2 -2
  119. package/dist/views/integration/FoodMarketHub.vue.d.ts +2 -0
  120. package/dist/views/integration/NetSuite.vue.d.ts +2 -0
  121. package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +7 -7
  122. package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +7 -7
  123. package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +1 -0
  124. package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +49 -0
  125. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +1955 -81
  126. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +1 -0
  127. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +6 -6
  128. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +3 -3
  129. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +2389 -304
  130. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +2320 -235
  131. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +2 -2
  132. package/dist/views/recipe/composables/use-recipe-form.d.ts +2 -2
  133. package/dist/views/stock/components/StockRecalculateDialog.vue.d.ts +9 -0
  134. package/dist/views/stock/components/StockRecordCard.vue.d.ts +42 -120
  135. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +34 -4
  136. package/dist/views/stock/composables/use-stock-action.d.ts +2 -2
  137. package/dist/views/supplier/components/supplier-import/SupplierImport.vue.d.ts +2 -0
  138. package/dist/views/supplier/components/supplier-import/SupplierImportItem.vue.d.ts +12 -0
  139. package/dist/views/supplier/components/supplier-import/SupplierImportItemProps.d.ts +6 -0
  140. package/dist/views/supplier/composables/use-supplier-actions.d.ts +10 -0
  141. package/dist/views/supplier/helpers/import-export.helper.d.ts +50 -0
  142. package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetails.vue.d.ts +0 -2
  143. package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetailsProps.d.ts +0 -1
  144. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations-2.d.ts +13 -0
  145. package/dist/views/transfer-template/components/transfer-template-form/composables/use-template-enabled-locations.d.ts +95 -0
  146. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +39 -2
  147. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +4 -4
  148. package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImport.vue.d.ts +2 -0
  149. package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItem.vue.d.ts +12 -0
  150. package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItemProps.d.ts +9 -0
  151. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1099 -88
  152. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +1660 -61
  153. package/dist/views/transfer-template/helpers/import-export.helper.d.ts +76 -0
  154. package/dist/views/transfer-template/helpers/remove-deleted-skus.helper.d.ts +1 -0
  155. package/dist/views/transfer-template/helpers/template-item.error.helper.d.ts +1 -0
  156. package/dist/views/unit/composables/use-unit-form.d.ts +2 -2
  157. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +14 -8
  158. package/dist/{xlsx-B5nyVCBZ.js → xlsx-6mM1eNiL.js} +1525 -1525
  159. package/dist/xlsx.util-BLftcF4q.js +78 -0
  160. package/package.json +12 -9
  161. package/dist/App-Chx9o6Va.js +0 -383
  162. package/dist/ApprovalView-D_6agztT.js +0 -131
  163. package/dist/BindingsTable-D7SqbeSD.js +0 -124
  164. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CL82XV1M.js +0 -375
  165. package/dist/FmMultiselectDialog.vue_vue_type_script_setup_true_lang-C4vDSxdT.js +0 -264
  166. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-CoB4u_5N.js +0 -303
  167. package/dist/IngredientsView-CmG8_qlA.js +0 -1678
  168. package/dist/IntegrationView-C2jlyJJh.js +0 -1142
  169. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-wosJq6qg.js +0 -279
  170. package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-aeLGu0NJ.js +0 -88
  171. package/dist/ReceiveRequestView-F1ucVCwZ.js +0 -221
  172. package/dist/RecipeView-BtFx7hTj.js +0 -586
  173. package/dist/StockView-JjnXebzO.js +0 -1890
  174. package/dist/SupplierView-CHt02HFf.js +0 -831
  175. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DAF5C7DO.js +0 -733
  176. package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-B_zUvuo9.js +0 -1443
  177. package/dist/TransferTemplateView-CRqyPF4u.js +0 -1305
  178. package/dist/WarehouseView-Rsc19Sq8.js +0 -1060
  179. package/dist/_commonjsHelpers-BkfeUUK-.js +0 -28
  180. package/dist/app-B97SfZlQ.js +0 -2505
  181. package/dist/array-ClJzD_Lt.js +0 -30
  182. package/dist/date2-VAwM19e4.js +0 -95
  183. package/dist/format-unit-display-D7o8MVPE.js +0 -712
  184. package/dist/id-to-date-H4uJdm1u.js +0 -30
  185. package/dist/index-CeQm_NQ2.js +0 -30492
  186. package/dist/layout/layout-routes.d.ts +0 -7
  187. package/dist/number-C-MApU1B.js +0 -103
  188. package/dist/rules-B5GF5C30.js +0 -85
  189. package/dist/supplier-BbVNTTbS.js +0 -69
  190. package/dist/xlsx.util-CJ1P2jfK.js +0 -109
  191. /package/dist/{layout/InventoryLayout.vue.d.ts → views/closing-template/ClosingTemplateView.vue.d.ts} +0 -0
@@ -0,0 +1,255 @@
1
+ import { ref as L, onUnmounted as k, defineComponent as h, watch as b, onMounted as U, computed as R, resolveComponent as T, openBlock as S, createElementBlock as I, unref as v, createVNode as E, createElementVNode as p, toDisplayString as w, createBlock as B, createCommentVNode as F } from "vue";
2
+ import { u as M, a as D, R as e, g as s, b as H } from "./app-GUbzqEtW.js";
3
+ import { useCoreStore as x, useI18n as G } from "@feedmepos/mf-common";
4
+ import { useRouter as A, useRoute as K } from "vue-router";
5
+ import { u as V } from "./feature-BXruKUhX.js";
6
+ import { u as $ } from "./netsuite-DAKRv7zr.js";
7
+ import { u as Q } from "./useTabStorage-BkIVScW_.js";
8
+ import { _ as W } from "./_plugin-vue_export-helper-CHgC5LLL.js";
9
+ import { u as j } from "./googlemap-Dm8ERVai.js";
10
+ import "./array-hChJVZLE.js";
11
+ function z() {
12
+ return {
13
+ loadingHookInstalled: !1,
14
+ isLoading: !1
15
+ };
16
+ }
17
+ const _ = L(z());
18
+ function q() {
19
+ const l = A();
20
+ if (!_.value.loadingHookInstalled) {
21
+ _.value.loadingHookInstalled = !0;
22
+ const n = l.beforeEach(() => {
23
+ _.value.isLoading = !0;
24
+ }), i = l.afterEach(() => {
25
+ _.value.isLoading = !1;
26
+ });
27
+ k(() => {
28
+ _.value.loadingHookInstalled = !1, n(), i();
29
+ });
30
+ }
31
+ return {
32
+ get isLoading() {
33
+ return _.value.isLoading;
34
+ }
35
+ };
36
+ }
37
+ const J = {
38
+ key: 0,
39
+ class: "flex flex-col items-center w-full h-full gap-24"
40
+ }, X = {
41
+ key: 1,
42
+ class: "flex flex-col pt-[200px] gap-32 items-center"
43
+ }, Y = { class: "flex flex-col gap-12 items-center text-center px-24 max-w-[1000px]" }, Z = { class: "fm-typo-en-title-lg-600" }, ee = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, te = { class: "flex gap-16" }, oe = { href: "https://feedme.ai/product/inventory/features?tab=plans_%26_prices" }, ne = { href: "https://feedme.ai/form" }, re = /* @__PURE__ */ h({
44
+ __name: "InventoryView",
45
+ setup(l) {
46
+ const n = M(), i = D(), u = $(), a = x(), c = A(), o = q(), y = V(), { t: f } = G();
47
+ b(
48
+ [() => a.sessionUser.value, () => a.currentBusiness.value],
49
+ ([t, r]) => {
50
+ d(t, r);
51
+ }
52
+ ), U(() => {
53
+ const t = a.sessionUser.value, r = a.currentBusiness.value;
54
+ d(t, r);
55
+ });
56
+ function d(t, r) {
57
+ !t || !r || g();
58
+ }
59
+ async function g() {
60
+ return await n.init(), await u.readSetting().catch((t) => {
61
+ console.error("error on reading netsuite store", t);
62
+ }), await i.init();
63
+ }
64
+ const N = R(() => c.currentRoute.value.name === e.TRANSFER_TEMPLATE ? y.enablePoTemplate : !0);
65
+ return (t, r) => {
66
+ const m = T("FmSpacer"), P = T("FmCircularProgress"), C = T("FmButton"), O = T("RouterView");
67
+ return S(), I("div", null, [
68
+ v(o).isLoading ? (S(), I("div", J, [
69
+ E(m),
70
+ p("div", null, [
71
+ E(P, { size: "xl" })
72
+ ]),
73
+ r[0] || (r[0] = p("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary pl-8" }, "Loading page...", -1)),
74
+ E(m)
75
+ ])) : N.value ? v(a).sessionUser.value ? (S(), B(O, { key: 2 })) : F("", !0) : (S(), I("div", X, [
76
+ p("div", Y, [
77
+ p("div", Z, w(v(f)("inventory.common.proPlan.title")), 1),
78
+ p("div", ee, w(v(f)("inventory.common.proPlan.subtitle")), 1)
79
+ ]),
80
+ p("div", te, [
81
+ p("a", oe, [
82
+ E(C, {
83
+ label: v(f)("inventory.common.proPlan.comparePlans"),
84
+ variant: "secondary"
85
+ }, null, 8, ["label"])
86
+ ]),
87
+ p("a", ne, [
88
+ E(C, {
89
+ label: v(f)("inventory.common.proPlan.callUs"),
90
+ "prepend-icon": "call"
91
+ }, null, 8, ["label"])
92
+ ])
93
+ ])
94
+ ]))
95
+ ]);
96
+ };
97
+ }
98
+ }), se = { class: "h-full flex flex-col overflow-auto py-16" }, ae = /* @__PURE__ */ h({
99
+ __name: "NavigationTab",
100
+ setup(l) {
101
+ const n = K(), i = A(), u = x(), a = V(), c = Q(), { t: o } = G();
102
+ b([() => u.currentBusiness.value, () => n.name], ([t, r]) => {
103
+ (t == null ? void 0 : t.menuVersion) === "v3" && (r === e.INGREDIENTS || r === e.RECIPE || r === e.UNIT) && i.push({ name: e.STOCK });
104
+ });
105
+ const y = R(() => {
106
+ var r;
107
+ const t = [
108
+ {
109
+ label: s(e.STOCK, o),
110
+ // icon: 'inventory_2',
111
+ children: [
112
+ {
113
+ label: "Stock balance",
114
+ value: e.STOCK
115
+ },
116
+ {
117
+ label: s(e.CLOSING_TEMPLATE, o),
118
+ value: e.CLOSING_TEMPLATE
119
+ }
120
+ ]
121
+ },
122
+ {
123
+ label: s(e.INGREDIENTS, o),
124
+ // icon: 'grocery',
125
+ value: e.INGREDIENTS
126
+ },
127
+ {
128
+ label: s(e.INGREDIENT_GROUP, o),
129
+ // icon: 'grocery',
130
+ value: e.INGREDIENT_GROUP
131
+ },
132
+ {
133
+ label: s(e.RECIPE, o),
134
+ // icon: 'weight',
135
+ value: e.RECIPE
136
+ },
137
+ {
138
+ label: s(e.UNIT, o),
139
+ // icon: 'fastfood',
140
+ value: e.UNIT
141
+ },
142
+ {
143
+ label: o("inventory.transfer.title"),
144
+ // icon: 'swap_horiz',
145
+ children: [
146
+ {
147
+ label: s(e.RECEIVE_REQUEST, o),
148
+ value: e.RECEIVE_REQUEST
149
+ },
150
+ {
151
+ label: s(e.APPROVAL, o),
152
+ value: e.APPROVAL
153
+ },
154
+ ...a.enablePoTemplate ? [
155
+ {
156
+ label: s(e.TRANSFER_TEMPLATE, o),
157
+ value: e.TRANSFER_TEMPLATE
158
+ }
159
+ ] : []
160
+ ]
161
+ },
162
+ {
163
+ label: s(e.SUPPLIER, o),
164
+ // icon: 'group',
165
+ value: e.SUPPLIER
166
+ },
167
+ {
168
+ label: s(e.WAREHOUSE, o),
169
+ // icon: 'warehouse',
170
+ value: e.WAREHOUSE
171
+ },
172
+ {
173
+ label: s(e.INTEGRATION, o),
174
+ // icon: 'integration_instructions',
175
+ value: e.INTEGRATION
176
+ }
177
+ ];
178
+ return ((r = u.currentBusiness.value) == null ? void 0 : r.menuVersion) === "v3" ? t.filter(
179
+ (m) => m.value !== e.INGREDIENTS && m.value !== e.RECIPE && m.value !== e.UNIT
180
+ ) : t;
181
+ }), f = R({
182
+ get() {
183
+ if (n.name)
184
+ return String(n.name);
185
+ },
186
+ set(t) {
187
+ t && i.push({ name: t });
188
+ }
189
+ }), d = R(
190
+ () => {
191
+ var t;
192
+ return `NavigationTab.${(t = u.currentBusiness.value) == null ? void 0 : t._id}`;
193
+ }
194
+ ), g = L(!1), N = R({
195
+ get() {
196
+ return g.value;
197
+ },
198
+ set(t) {
199
+ g.value = t, t || c.setItem(d.value, "true");
200
+ }
201
+ });
202
+ return b([() => d.value], () => {
203
+ g.value = !1, setTimeout(() => {
204
+ N.value = !c.getItem(d.value);
205
+ }, 2e3);
206
+ }), (t, r) => {
207
+ const m = T("FmCollapsibleTabs");
208
+ return S(), I("div", se, [
209
+ E(m, {
210
+ modelValue: f.value,
211
+ "onUpdate:modelValue": r[0] || (r[0] = (P) => f.value = P),
212
+ items: y.value
213
+ }, null, 8, ["modelValue", "items"])
214
+ ]);
215
+ };
216
+ }
217
+ }), le = /* @__PURE__ */ W(ae, [["__scopeId", "data-v-0fe980e2"]]);
218
+ typeof Promise.withResolvers > "u" && (Promise.withResolvers = () => {
219
+ let l, n;
220
+ return { promise: new Promise((u, a) => {
221
+ l = u, n = a;
222
+ }), resolve: l, reject: n };
223
+ });
224
+ typeof Promise.prototype.delayed > "u" && (Promise.prototype.delayed = async function(l) {
225
+ return await new Promise((n) => setTimeout(n, l)), Promise.resolve(this);
226
+ });
227
+ const Se = /* @__PURE__ */ h({
228
+ __name: "App",
229
+ setup(l) {
230
+ const n = x(), i = j(), u = H();
231
+ U(() => {
232
+ if (window.location.href.includes("print-preview")) {
233
+ n.setEmbedded(!0);
234
+ return;
235
+ }
236
+ n.registerSidebarComponent(le), i.initGoogleMap(u.appApi.googleMap).catch(() => {
237
+ console.error("Google map cannot be loaded");
238
+ });
239
+ }), b([() => n.currentCountry.value], () => {
240
+ a();
241
+ });
242
+ async function a() {
243
+ var c;
244
+ try {
245
+ await n.readBusinesses(), n.currentBusiness.value = (c = n.businesses.value) == null ? void 0 : c.find((o) => o);
246
+ } catch (o) {
247
+ console.error("error when trying to reset businesses:", o);
248
+ }
249
+ }
250
+ return (c, o) => (S(), B(re));
251
+ }
252
+ });
253
+ export {
254
+ Se as default
255
+ };
package/dist/App.vue.d.ts CHANGED
@@ -1,2 +1,4 @@
1
+ import '@/extensions/array';
2
+ import '@/extensions/promises';
1
3
  declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
2
4
  export default _default;
@@ -0,0 +1,141 @@
1
+ import { defineComponent as ae, ref as g, watch as oe, computed as b, resolveComponent as re, openBlock as x, createBlock as J, unref as e, withCtx as y, createElementVNode as s, normalizeClass as ne, createVNode as n, normalizeStyle as se, toDisplayString as le, createElementBlock as ce, createCommentVNode as ie, Teleport as pe, mergeProps as ue } from "vue";
2
+ import { u as me, w as v } from "./app-GUbzqEtW.js";
3
+ import { b as de, u as fe, _ as ve, a as _e } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-5DINn0ZB.js";
4
+ import { a as he, b as De, _ as ge } from "./TransferDetails.vue_vue_type_script_setup_true_lang-C9MOos--.js";
5
+ import { c as K } from "./date2-CLE9fB2R.js";
6
+ import { _ as be, F as _ } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
7
+ import { useBreakpoints as xe } from "@feedmepos/ui-library";
8
+ import { useI18n as ye } from "@feedmepos/mf-common";
9
+ const we = { class: "flex flex-col py-8" }, Re = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ke = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Oe = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Se = {
10
+ key: 0,
11
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
12
+ }, Te = { class: "pt-8" }, Ne = /* @__PURE__ */ ae({
13
+ __name: "ApprovalView",
14
+ setup(Ce) {
15
+ const o = he("approval"), { columnDefs: Q } = De("approval", o), W = me();
16
+ v.object({
17
+ name: v.string().optional().nullable(),
18
+ start: v.date().optional().nullable(),
19
+ end: v.date().optional().nullable()
20
+ });
21
+ const w = g({
22
+ name: "",
23
+ ...de()
24
+ }), a = g({
25
+ startDate: K(w.value.start ?? /* @__PURE__ */ new Date()),
26
+ endDate: K(w.value.end ?? /* @__PURE__ */ new Date())
27
+ });
28
+ oe([() => a.value.startDate], () => {
29
+ if (!a.value.startDate)
30
+ return;
31
+ if (!a.value.endDate) {
32
+ a.value.endDate = a.value.startDate;
33
+ return;
34
+ }
35
+ const c = new Date(a.value.startDate);
36
+ if (new Date(a.value.endDate).getTime() < c.getTime()) {
37
+ a.value.endDate = a.value.startDate;
38
+ return;
39
+ }
40
+ });
41
+ const h = g(""), { breakpoints: R } = xe(), D = b(() => R.value.xs || R.value.sm), X = b(() => D.value ? 10 : 20), Z = fe(), { t: k } = ye(), B = b(() => [
42
+ {
43
+ label: k("common.refresh"),
44
+ value: "refresh"
45
+ }
46
+ ]);
47
+ function I(c) {
48
+ switch (c) {
49
+ case "refresh":
50
+ return o.fetchData();
51
+ }
52
+ }
53
+ return (c, l) => {
54
+ const ee = re("FmTable");
55
+ return x(), J(ve, {
56
+ title: e(k)("inventory.transfer.approval.title"),
57
+ actions: B.value,
58
+ "onClick:action": I
59
+ }, {
60
+ default: y(() => [
61
+ s("div", {
62
+ class: ne([
63
+ "flex flex-col gap-8 max-h-full",
64
+ {
65
+ "p-0": D.value,
66
+ "px-24 ": !D.value
67
+ }
68
+ ])
69
+ }, [
70
+ n(_e, {
71
+ searchable: "",
72
+ "change-location": "",
73
+ search: h.value,
74
+ "onUpdate:search": l[0] || (l[0] = (r) => h.value = r)
75
+ }, null, 8, ["search"]),
76
+ n(ee, {
77
+ style: se(e(Z).tableHeight),
78
+ "column-defs": e(Q),
79
+ "row-data": e(o).purchaseRequests.value,
80
+ "search-value": h.value,
81
+ loading: !e(W)._currentLocation || e(o).loading.value,
82
+ onRowClick: l[1] || (l[1] = (r) => e(o).promptShowTransferDetails(r.original.purchaseOrder, r.original)),
83
+ "page-size": X.value
84
+ }, {
85
+ "list-row": y((r) => [
86
+ n(be, {
87
+ row: r,
88
+ onRowClick: (t) => e(o).promptShowTransferDetails(t.purchaseOrder, t)
89
+ }, {
90
+ default: y((t) => {
91
+ var O, S, T, i, C, z, F, M, p, $, V, u, Y, m, q, L, N, P, j, d, A, E, H, U, f, G;
92
+ return [
93
+ s("div", we, [
94
+ s("div", Re, [
95
+ n(e(_), {
96
+ render: (T = (S = (O = t.purchaseOrder__id) == null ? void 0 : O.column) == null ? void 0 : S.columnDef) == null ? void 0 : T.cell,
97
+ props: (C = (i = t.purchaseOrder__id) == null ? void 0 : i.getContext) == null ? void 0 : C.call(i)
98
+ }, null, 8, ["render", "props"])
99
+ ]),
100
+ s("div", ke, [
101
+ n(e(_), {
102
+ render: (M = (F = (z = t.to_name) == null ? void 0 : z.column) == null ? void 0 : F.columnDef) == null ? void 0 : M.cell,
103
+ props: ($ = (p = t.to_name) == null ? void 0 : p.getContext) == null ? void 0 : $.call(p)
104
+ }, null, 8, ["render", "props"])
105
+ ]),
106
+ s("div", Oe, le((q = (m = (Y = (u = (V = r.original.purchaseOrder) == null ? void 0 : V.items) == null ? void 0 : u.map) == null ? void 0 : Y.call(u, (te) => `${te.name}`)) == null ? void 0 : m.join) == null ? void 0 : q.call(m, ", ")), 1),
107
+ (L = r.original.purchaseOrder) != null && L.ref ? (x(), ce("div", Se, [
108
+ n(e(_), {
109
+ render: (j = (P = (N = t.purchaseOrder_ref) == null ? void 0 : N.column) == null ? void 0 : P.columnDef) == null ? void 0 : j.cell,
110
+ props: (A = (d = t.purchaseOrder_ref) == null ? void 0 : d.getContext) == null ? void 0 : A.call(d)
111
+ }, null, 8, ["render", "props"])
112
+ ])) : ie("", !0),
113
+ s("div", Te, [
114
+ n(e(_), {
115
+ render: (U = (H = (E = t.purchaseOrder_status) == null ? void 0 : E.column) == null ? void 0 : H.columnDef) == null ? void 0 : U.cell,
116
+ props: (G = (f = t.purchaseOrder_status) == null ? void 0 : f.getContext) == null ? void 0 : G.call(f)
117
+ }, null, 8, ["render", "props"])
118
+ ])
119
+ ])
120
+ ];
121
+ }),
122
+ _: 2
123
+ }, 1032, ["row", "onRowClick"])
124
+ ]),
125
+ _: 1
126
+ }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
127
+ ], 2),
128
+ (x(), J(pe, { to: "body" }, [
129
+ n(ge, ue(e(o).transferDetailsProps.value, {
130
+ onSubmitted: e(o).fetchData
131
+ }), null, 16, ["onSubmitted"])
132
+ ]))
133
+ ]),
134
+ _: 1
135
+ }, 8, ["title", "actions"]);
136
+ };
137
+ }
138
+ });
139
+ export {
140
+ Ne as default
141
+ };
@@ -1,6 +1,6 @@
1
- import { defineComponent as C, ref as o, onMounted as M, onUnmounted as F, watch as x, resolveComponent as l, openBlock as i, createElementBlock as d, createBlock as I, withCtx as R, createVNode as a, createCommentVNode as z, createElementVNode as P } from "vue";
2
- import { _ as V } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-wosJq6qg.js";
3
- import { u as L, r as S } from "./app-B97SfZlQ.js";
1
+ import { defineComponent as C, ref as o, onMounted as M, onUnmounted as F, watch as x, resolveComponent as l, openBlock as i, createElementBlock as c, createBlock as I, withCtx as R, createVNode as a, createCommentVNode as z, createElementVNode as P } from "vue";
2
+ import { _ as V } from "./InventoryBindingForm.vue_vue_type_script_setup_true_lang-CJuo3i7W.js";
3
+ import { a as L, G as S } from "./app-GUbzqEtW.js";
4
4
  const U = {
5
5
  key: 0,
6
6
  class: "flex justify-end gap-8 items-center"
@@ -10,10 +10,10 @@ const U = {
10
10
  }, D = /* @__PURE__ */ C({
11
11
  __name: "BindingsDialog",
12
12
  setup(N) {
13
- const p = L(), u = o(!0), s = o(new Array()), c = o(), t = S(y);
13
+ const p = L(), d = o(!0), s = o(new Array()), u = o(), t = S(y);
14
14
  async function y() {
15
- await p.readInventory(), c.value = t.onMessage("props:inventory-bindings", (e) => {
16
- u.value = !1, s.value = e;
15
+ await p.readInventory(), u.value = t.onMessage("props:inventory-bindings", (e) => {
16
+ d.value = !1, s.value = e;
17
17
  }).onMessage("props:inventory-bindings:validate", () => {
18
18
  var e;
19
19
  (e = f.value) == null || e.validateInputs();
@@ -37,7 +37,7 @@ const U = {
37
37
  }).observe(e);
38
38
  }), F(() => {
39
39
  var e, n;
40
- (n = (e = c.value) == null ? void 0 : e.removeEventListener) == null || n.call(e);
40
+ (n = (e = u.value) == null ? void 0 : e.removeEventListener) == null || n.call(e);
41
41
  }), x([() => s.value], ([e]) => {
42
42
  t.sendMessage("@update:inventory-bindings", e);
43
43
  });
@@ -48,12 +48,12 @@ const U = {
48
48
  const f = o();
49
49
  return (e, n) => {
50
50
  const g = l("FmButton"), B = l("FmForm"), h = l("FmCircularProgress");
51
- return i(), d("div", {
51
+ return i(), c("div", {
52
52
  class: "bg-white",
53
53
  ref_key: "resizeableRef",
54
54
  ref: m
55
55
  }, [
56
- u.value ? (i(), d("div", E, [
56
+ d.value ? (i(), c("div", E, [
57
57
  a(h, { size: "md" }),
58
58
  n[2] || (n[2] = P("div", null, "Loading bindings dialog...", -1))
59
59
  ])) : (i(), I(B, {
@@ -70,7 +70,7 @@ const U = {
70
70
  "iframe-mode": "",
71
71
  "onClick:pickInventoryBindings": k
72
72
  }, null, 8, ["model-value"]),
73
- r.value ? z("", !0) : (i(), d("div", U, [
73
+ r.value ? z("", !0) : (i(), c("div", U, [
74
74
  a(g, {
75
75
  type: "button",
76
76
  variant: "tertiary",
@@ -1,16 +1,16 @@
1
1
  import { defineComponent as S, computed as r, ref as l, onMounted as U, onUnmounted as V, resolveComponent as E, openBlock as p, createElementBlock as f, createVNode as u, createElementVNode as k } from "vue";
2
- import { _ as x } from "./FmMultiselectDialog.vue_vue_type_script_setup_true_lang-C4vDSxdT.js";
3
- import { u as M, r as z } from "./app-B97SfZlQ.js";
4
- const K = {
2
+ import { F as M } from "./FmMultiselectDialog-7hok9sJP.js";
3
+ import { a as x, G as F } from "./app-GUbzqEtW.js";
4
+ const z = {
5
5
  key: 0,
6
6
  class: "flex flex-col gap-16"
7
- }, w = { class: "flex justify-end gap-8 items-center" }, F = {
7
+ }, K = { class: "flex justify-end gap-8 items-center" }, w = {
8
8
  key: 1,
9
9
  class: "p-24 flex items-center justify-center gap-16"
10
10
  }, A = /* @__PURE__ */ S({
11
11
  __name: "BindingsPicker",
12
12
  setup(L) {
13
- const d = M(), C = r(() => d.recipes), I = r(() => d.skus), g = l(!0), i = l(new Array()), a = l("RECIPE"), c = r(() => a.value === "SKU" ? I.value.map((s) => ({
13
+ const d = x(), C = r(() => d.recipes), I = r(() => d.skus), g = l(!0), i = l(new Array()), a = l("RECIPE"), c = r(() => a.value === "SKU" ? I.value.map((s) => ({
14
14
  label: s.name,
15
15
  sublabel: s.code,
16
16
  value: s
@@ -63,7 +63,7 @@ const K = {
63
63
  ];
64
64
  }
65
65
  }
66
- }), _ = l(), o = z(B);
66
+ }), _ = l(), o = F(B);
67
67
  async function B() {
68
68
  await d.readInventory(), _.value = o.onMessage(
69
69
  "props:binding-items",
@@ -94,16 +94,16 @@ const K = {
94
94
  ref_key: "resizeableRef",
95
95
  ref: y
96
96
  }, [
97
- g.value ? (p(), f("div", F, [
97
+ g.value ? (p(), f("div", w, [
98
98
  u(t, { size: "md" }),
99
99
  s[1] || (s[1] = k("div", null, "Loading bindings dialog...", -1))
100
- ])) : (p(), f("div", K, [
101
- u(x, {
100
+ ])) : (p(), f("div", z, [
101
+ u(M, {
102
102
  "model-value": b.value,
103
103
  "onUpdate:modelValue": s[0] || (s[0] = (m) => b.value = m),
104
104
  items: c.value
105
105
  }, null, 8, ["model-value", "items"]),
106
- k("div", w, [
106
+ k("div", K, [
107
107
  u(n, {
108
108
  variant: "tertiary",
109
109
  label: "Close",
@@ -0,0 +1,149 @@
1
+ import { defineComponent as _, ref as c, provide as C, computed as f, resolveComponent as b, openBlock as p, createBlock as h, h as z, onMounted as B, onUnmounted as I, createElementBlock as y, createVNode as N, createElementVNode as x } from "vue";
2
+ import { F as v, a as E, G as F } from "./app-GUbzqEtW.js";
3
+ import "./index-BX5KZXhI.js";
4
+ import { components as L } from "@feedmepos/ui-library";
5
+ import "./fuzzy-CVOV9zJc.js";
6
+ /* empty css */
7
+ import "@feedmepos/mf-common";
8
+ import "./dayjs.min-CY1d38w7.js";
9
+ const P = /* @__PURE__ */ _({
10
+ __name: "binding-ui",
11
+ props: {
12
+ items: { default: () => [] },
13
+ recipes: { default: () => [] },
14
+ skus: { default: () => [] },
15
+ type: { default: "Product" },
16
+ editable: { type: Boolean, default: !1 }
17
+ },
18
+ emits: ["click:open-binding-dialog"],
19
+ setup(k, { emit: d }) {
20
+ const u = c({
21
+ isOpen: !1,
22
+ initialValue: [],
23
+ context: "",
24
+ name: ""
25
+ });
26
+ C("closeDialog", () => {
27
+ u.value.isOpen = !u.value.isOpen;
28
+ });
29
+ const s = k, m = d, a = f(() => s.items.map((e) => ({
30
+ key: e.key,
31
+ name: e.name,
32
+ _skuLinked: e.bindings.filter(
33
+ ({ type: n, id: o }) => n === v.enum.SKU && s.skus.some((l) => l._id === o)
34
+ ).length,
35
+ _recipeLinked: e.bindings.filter(
36
+ ({ type: n, id: o }) => n === v.enum.RECIPE && s.recipes.some((l) => l._id === o)
37
+ ).length,
38
+ onUpdate: async () => {
39
+ s.editable && m("click:open-binding-dialog", s.type, e);
40
+ }
41
+ }))), g = [
42
+ {
43
+ accessorKey: "name",
44
+ header: "Name",
45
+ size: "auto"
46
+ },
47
+ {
48
+ id: "ingredient",
49
+ header: "Ingredient",
50
+ size: 200,
51
+ cell(i) {
52
+ const e = a.value.find((o) => o.key === i.row.original.key), n = e == null ? void 0 : e._skuLinked;
53
+ return n === 1 ? "1 item" : n ? `${n} items` : "Not set";
54
+ }
55
+ },
56
+ {
57
+ id: "recipe",
58
+ header: "Recipe",
59
+ size: 200,
60
+ cell(i) {
61
+ const e = a.value.find((o) => o.key === i.row.original.key), n = e == null ? void 0 : e._recipeLinked;
62
+ return n === 1 ? "1 item" : n ? `${n} items` : "Not set";
63
+ }
64
+ },
65
+ {
66
+ id: "action",
67
+ header: "",
68
+ size: 24,
69
+ cell(i) {
70
+ const e = a.value.find((n) => n.key === i.row.original.key);
71
+ return z(L.FmButton, {
72
+ icon: "edit",
73
+ bgColor: "white",
74
+ textColor: "neutral-grey-400",
75
+ iconColor: "neutral-grey-400",
76
+ class: "text-fm-color-neutral-gray-400",
77
+ onClick() {
78
+ e == null || e.onUpdate();
79
+ }
80
+ });
81
+ }
82
+ }
83
+ ];
84
+ return (i, e) => {
85
+ const n = b("FmTable");
86
+ return p(), h(n, {
87
+ "column-defs": g,
88
+ "row-data": a.value,
89
+ "hide-footer": "",
90
+ "shrink-at": 99999
91
+ }, null, 8, ["row-data"]);
92
+ };
93
+ }
94
+ }), R = {
95
+ key: 1,
96
+ class: "p-24 flex items-center justify-center gap-16"
97
+ }, K = /* @__PURE__ */ _({
98
+ __name: "BindingsTable",
99
+ setup(k) {
100
+ const d = E(), u = c(!0), s = c(new Array()), m = f(() => d.recipes), a = f(() => d.skus), g = c(""), i = F(n), e = c();
101
+ async function n() {
102
+ await d.readInventory(), e.value = i.onMessage(
103
+ "props:grouped-bindings",
104
+ (t) => {
105
+ u.value = !1, s.value = t;
106
+ }
107
+ ), i.sendMessage("props:grouped-bindings");
108
+ }
109
+ async function o(t, r) {
110
+ i.sendMessage("@click:open-binding-dialog", {
111
+ key: t,
112
+ binding: r
113
+ });
114
+ }
115
+ const l = c();
116
+ return B(() => {
117
+ const t = l.value;
118
+ t && new ResizeObserver(() => {
119
+ i.sendMessage("resize", t.scrollHeight);
120
+ }).observe(t);
121
+ }), I(() => {
122
+ var t, r;
123
+ (r = (t = e.value) == null ? void 0 : t.removeEventListener) == null || r.call(t);
124
+ }), (t, r) => {
125
+ const w = b("FmCircularProgress");
126
+ return p(), y("div", {
127
+ class: "bg-white",
128
+ ref_key: "resizeableRef",
129
+ ref: l
130
+ }, [
131
+ u.value ? (p(), y("div", R, [
132
+ N(w, { size: "md" }),
133
+ r[0] || (r[0] = x("div", null, "Loading bindings table...", -1))
134
+ ])) : (p(), h(P, {
135
+ key: 0,
136
+ items: s.value,
137
+ recipes: m.value,
138
+ skus: a.value,
139
+ type: g.value,
140
+ editable: "",
141
+ "onClick:openBindingDialog": o
142
+ }, null, 8, ["items", "recipes", "skus", "type"]))
143
+ ], 512);
144
+ };
145
+ }
146
+ });
147
+ export {
148
+ K as default
149
+ };