@feedmepos/mf-inventory-portal 0.0.5

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 (284) hide show
  1. package/README.md +31 -0
  2. package/dist/App.vue.d.ts +2 -0
  3. package/dist/ApprovalView-CTQdDgGH.js +119 -0
  4. package/dist/BindingsDialog-DvX_DRsO.js +82 -0
  5. package/dist/BindingsPicker-CQIGhTCR.js +124 -0
  6. package/dist/BindingsTable-Da4BLkvc.js +122 -0
  7. package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DcixBOcX.js +97 -0
  8. package/dist/Entry.vue.d.ts +2 -0
  9. package/dist/FmMultiselectDialog.vue_vue_type_script_setup_true_lang-BXU7x6di.js +144 -0
  10. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-CD89qCIa.js +49 -0
  11. package/dist/IngredientsView-2ZKdzsgI.js +739 -0
  12. package/dist/IntegrationView-BRWYO3VE.js +1172 -0
  13. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CnsDmPTe.js +240 -0
  14. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DBK7mpQS.js +66 -0
  15. package/dist/PurchaseOrderPrintPreview-CH9gVYDg.js +152 -0
  16. package/dist/ReceiveRequestView-DQBqc3GF.js +1298 -0
  17. package/dist/RecipeView-DFG9Wkx-.js +594 -0
  18. package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-CFjO4TPG.js +53 -0
  19. package/dist/Standalone.vue.d.ts +2 -0
  20. package/dist/StockView-DLWMp_I5.js +1733 -0
  21. package/dist/SupplierView-CZhM2ie3.js +607 -0
  22. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-Ffe9bhq8.js +1027 -0
  23. package/dist/UnitView-C3XVSbJY.js +626 -0
  24. package/dist/WarehouseView-BntzAdz3.js +1139 -0
  25. package/dist/api/bill.d.ts +1364 -0
  26. package/dist/api/closing.d.ts +3 -0
  27. package/dist/api/error.d.ts +31 -0
  28. package/dist/api/food-market-hub.d.ts +38 -0
  29. package/dist/api/inventory.d.ts +176 -0
  30. package/dist/api/purchase-order.d.ts +13 -0
  31. package/dist/api/stock.d.ts +9 -0
  32. package/dist/api/supplier.d.ts +7 -0
  33. package/dist/api/type.d.ts +12 -0
  34. package/dist/api/warehouse.d.ts +7 -0
  35. package/dist/app-BzDhmCVx.js +36639 -0
  36. package/dist/app.d.ts +2 -0
  37. package/dist/app.js +5 -0
  38. package/dist/components/ChangeLocationComponent.vue.d.ts +2 -0
  39. package/dist/components/DeferableLoading.vue.d.ts +19 -0
  40. package/dist/components/DeferableLoadingProps.d.ts +4 -0
  41. package/dist/components/DeleteDialog.vue.d.ts +18 -0
  42. package/dist/components/FmCoordinateInput.vue.d.ts +24 -0
  43. package/dist/components/FmCoordinateInputProps.d.ts +23 -0
  44. package/dist/components/FmFilterableSelect.vue.d.ts +25 -0
  45. package/dist/components/FmFilterableSelectProps.d.ts +28 -0
  46. package/dist/components/FmMultiselectDialog.vue.d.ts +30 -0
  47. package/dist/components/FmMultiselectDialogProps.d.ts +16 -0
  48. package/dist/components/FmTableToolbar.vue.d.ts +49 -0
  49. package/dist/components/MultiSelectDialog.vue.d.ts +12 -0
  50. package/dist/components/MultiSelectDialogProps.d.ts +7 -0
  51. package/dist/components/NavigationTab.vue.d.ts +2 -0
  52. package/dist/components/NumberPrecisionInput.vue.d.ts +16 -0
  53. package/dist/components/NumberPrecisionInputProps.d.ts +12 -0
  54. package/dist/components/TableActionableRow.vue.d.ts +40 -0
  55. package/dist/components/UnitDisplayControl.vue.d.ts +12 -0
  56. package/dist/components/UnitDisplayControlProp.d.ts +7 -0
  57. package/dist/components/fm-components.type.d.ts +8 -0
  58. package/dist/components/form/form-mode.enum.d.ts +5 -0
  59. package/dist/components/icons/IconCommunity.vue.d.ts +2 -0
  60. package/dist/components/icons/IconDocumentation.vue.d.ts +2 -0
  61. package/dist/components/icons/IconEcosystem.vue.d.ts +2 -0
  62. package/dist/components/icons/IconSupport.vue.d.ts +2 -0
  63. package/dist/components/icons/IconTooling.vue.d.ts +2 -0
  64. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +145 -0
  65. package/dist/components/inventory-binding/InventoryBindingProps.d.ts +11 -0
  66. package/dist/components/map/CoordinateDialog.vue.d.ts +24 -0
  67. package/dist/components/map/GoogleMap.vue.d.ts +79 -0
  68. package/dist/components/map/coordinates.d.ts +6 -0
  69. package/dist/components/map/helper/coords-to-latlong.d.ts +8 -0
  70. package/dist/components/map/type.d.ts +27 -0
  71. package/dist/components/nested-multiselect/FmNestedMultiselectDialog.vue.d.ts +7 -0
  72. package/dist/components/nested-multiselect/FmNestedMultiselectDialogProps.d.ts +22 -0
  73. package/dist/components/nested-multiselect/helper/multiselect-utils.d.ts +2 -0
  74. package/dist/components/row-action.enum.d.ts +13 -0
  75. package/dist/components/shell/inventory/binding-dialog.vue.d.ts +84 -0
  76. package/dist/components/shell/inventory/binding-ui.test.d.ts +1 -0
  77. package/dist/components/shell/inventory/binding-ui.vue.d.ts +110 -0
  78. package/dist/components/shell/inventory/utils.d.ts +5 -0
  79. package/dist/components/ui-library/FmDateRangePickerChip.vue.d.ts +36 -0
  80. package/dist/components/ui-library/FmSpecialChip.vue.d.ts +79 -0
  81. package/dist/composable/defineApi.d.ts +18 -0
  82. package/dist/composable/useBreakpoints.d.ts +7 -0
  83. package/dist/composable/useIframe.d.ts +37 -0
  84. package/dist/composable/useSearch.d.ts +5 -0
  85. package/dist/composable/useTabStorage.d.ts +2 -0
  86. package/dist/composable/useToast.d.ts +36 -0
  87. package/dist/core.d.ts +12 -0
  88. package/dist/cypress/component/FmFilterableSelect.cy.d.ts +1 -0
  89. package/dist/cypress/component/FmNestedMultiselectDialog.cy.d.ts +1 -0
  90. package/dist/cypress/component/UnitDisplayControl.cy.d.ts +1 -0
  91. package/dist/cypress/component/receive-request/KDI-15-total-price-currency.cy.d.ts +2 -0
  92. package/dist/cypress/e2e/views/MenuV3.spec.cy.d.ts +0 -0
  93. package/dist/cypress/e2e/views/MenuV4.spec.cy.d.ts +0 -0
  94. package/dist/cypress/e2e/views/Root.spec.cy.d.ts +0 -0
  95. package/dist/cypress/e2e/views/StockView.spec.cy.d.ts +0 -0
  96. package/dist/cypress/support/commands.d.ts +0 -0
  97. package/dist/cypress/support/component.d.ts +10 -0
  98. package/dist/cypress/support/e2e.d.ts +1 -0
  99. package/dist/date2-C7HiAWQG.js +209 -0
  100. package/dist/dayjs.min-Db57WhI9.js +282 -0
  101. package/dist/decimal-D3a0BwVj.js +98 -0
  102. package/dist/empty-placeholder-wf6-BWE8.js +4 -0
  103. package/dist/extensions/array.d.ts +15 -0
  104. package/dist/favicon.ico +0 -0
  105. package/dist/fuzzy-BW8ZYsDG.js +41 -0
  106. package/dist/helper/address.d.ts +2 -0
  107. package/dist/helper/component.d.ts +4 -0
  108. package/dist/helper/core/country/codes.d.ts +255 -0
  109. package/dist/helper/core/country/utils.d.ts +8 -0
  110. package/dist/helper/core/id-to-date.d.ts +1 -0
  111. package/dist/helper/core/store/type.d.ts +2 -0
  112. package/dist/helper/country.d.ts +260 -0
  113. package/dist/helper/date.spec.d.ts +1 -0
  114. package/dist/helper/date2.d.ts +20 -0
  115. package/dist/helper/decimal.d.ts +15 -0
  116. package/dist/helper/decimal.spec.d.ts +1 -0
  117. package/dist/helper/export.d.ts +12 -0
  118. package/dist/helper/form.d.ts +5 -0
  119. package/dist/helper/inventory.d.ts +1 -0
  120. package/dist/helper/iteration.d.ts +15 -0
  121. package/dist/helper/number.d.ts +27 -0
  122. package/dist/helper/number.spec.d.ts +1 -0
  123. package/dist/helper/object.d.ts +36 -0
  124. package/dist/helper/object.spec.d.ts +1 -0
  125. package/dist/helper/rules.d.ts +22 -0
  126. package/dist/helper/search.d.ts +21 -0
  127. package/dist/helper/semver.d.ts +20 -0
  128. package/dist/helper/semver.spec.d.ts +1 -0
  129. package/dist/helper/type.d.ts +8 -0
  130. package/dist/helper/url.d.ts +7 -0
  131. package/dist/helper/validate.d.ts +70 -0
  132. package/dist/helper/xlsx.util.d.ts +8 -0
  133. package/dist/helper/zod.d.ts +21 -0
  134. package/dist/id-to-date-ReZIpUDw.js +30 -0
  135. package/dist/index-D46it8Rk.js +12956 -0
  136. package/dist/init-date-range-M3Q03-Fd.js +21 -0
  137. package/dist/is-linked-ingredient-error-C6AghEwR.js +37 -0
  138. package/dist/layout/InventoryLayout.vue.d.ts +2 -0
  139. package/dist/layout/SingleColumnLayout.vue.d.ts +55 -0
  140. package/dist/layout/components/NavigationButton.vue.d.ts +22 -0
  141. package/dist/layout/layout-routes.d.ts +7 -0
  142. package/dist/layout/type.d.ts +17 -0
  143. package/dist/layout-BvUjg6JS.js +151 -0
  144. package/dist/locales/en/common.json +7 -0
  145. package/dist/main.d.ts +2 -0
  146. package/dist/router/index.d.ts +5 -0
  147. package/dist/router/name.d.ts +17 -0
  148. package/dist/router/shared.d.ts +11 -0
  149. package/dist/row-action.enum-BwQbURNh.js +28 -0
  150. package/dist/rules-DHfAMDW3.js +86 -0
  151. package/dist/stores/api.d.ts +10 -0
  152. package/dist/stores/env.d.ts +5 -0
  153. package/dist/stores/feature.d.ts +9 -0
  154. package/dist/stores/googlemap.d.ts +37 -0
  155. package/dist/stores/helper/generate-backend-urls.d.ts +8 -0
  156. package/dist/stores/inventory.d.ts +1983 -0
  157. package/dist/stores/layout.d.ts +5 -0
  158. package/dist/stores/location.d.ts +1898 -0
  159. package/dist/stores/route.d.ts +12 -0
  160. package/dist/stores/stock.d.ts +58 -0
  161. package/dist/stores/supplier.d.ts +30 -0
  162. package/dist/stores/warehouse.d.ts +88 -0
  163. package/dist/style.css +1 -0
  164. package/dist/supplier-DTiiOLtg.js +65 -0
  165. package/dist/tsconfig.app.tsbuildinfo +1 -0
  166. package/dist/use-inventory-binding-dialog-B6JO7050.js +109 -0
  167. package/dist/views/InventoryView.vue.d.ts +2 -0
  168. package/dist/views/SelectBussinessDialog.vue.d.ts +2 -0
  169. package/dist/views/approval/ApprovalView.vue.d.ts +2 -0
  170. package/dist/views/dev/ComponentPreview.vue.d.ts +2 -0
  171. package/dist/views/dev/components/CoordinateTest.vue.d.ts +2 -0
  172. package/dist/views/dev/components/DateRange.vue.d.ts +2 -0
  173. package/dist/views/dev/components/FmSelectTest.vue.d.ts +2 -0
  174. package/dist/views/dev/components/InventoryIframe.vue.d.ts +2 -0
  175. package/dist/views/dev/components/LayoutDev.vue.d.ts +2 -0
  176. package/dist/views/dev/components/MfCommontTest.vue.d.ts +2 -0
  177. package/dist/views/dev/components/NestedSelection.vue.d.ts +2 -0
  178. package/dist/views/dev/components/NumberStepper.vue.d.ts +2 -0
  179. package/dist/views/dev/components/TabStorageTest.vue.d.ts +2 -0
  180. package/dist/views/dev/helpers/debug.d.ts +22 -0
  181. package/dist/views/dev/helpers/nested-options.d.ts +60 -0
  182. package/dist/views/dev/helpers/pinia-test.d.ts +9 -0
  183. package/dist/views/home/HomeView.vue.d.ts +2 -0
  184. package/dist/views/iframe/inventory-bindings/bindings-dialog/BindingsDialog.vue.d.ts +2 -0
  185. package/dist/views/iframe/inventory-bindings/bindings-picker/BindingsPicker.vue.d.ts +2 -0
  186. package/dist/views/iframe/inventory-bindings/bindings-table/BindingsTable.vue.d.ts +2 -0
  187. package/dist/views/ingredients/IngredientsView.vue.d.ts +2 -0
  188. package/dist/views/ingredients/components/cannot-delete/CannotDelete.vue.d.ts +30 -0
  189. package/dist/views/ingredients/components/convert/ConvertForm.vue.d.ts +54 -0
  190. package/dist/views/ingredients/components/convert/ConvertFormProps.d.ts +8 -0
  191. package/dist/views/ingredients/components/ingredient-binded-item/IngredientBindedItem.vue.d.ts +12 -0
  192. package/dist/views/ingredients/components/ingredient-binded-item/IngredientBindedItemProps.d.ts +5 -0
  193. package/dist/views/ingredients/components/ingredient-dialog/IngredientDialog.vue.d.ts +31 -0
  194. package/dist/views/ingredients/components/ingredient-dialog/IngredientDialogProps.d.ts +9 -0
  195. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +104 -0
  196. package/dist/views/ingredients/components/ingredient-form/IngredientFormProps.d.ts +10 -0
  197. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +88 -0
  198. package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +4 -0
  199. package/dist/views/ingredients/components/inventory-binding/util.d.ts +7 -0
  200. package/dist/views/ingredients/composables/use-ingredient-form.d.ts +8 -0
  201. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +46 -0
  202. package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +7 -0
  203. package/dist/views/integration/IntegrationView.vue.d.ts +2 -0
  204. package/dist/views/integration/components/ApplyAddon.vue.d.ts +379 -0
  205. package/dist/views/integration/components/ApplyProduct.vue.d.ts +303 -0
  206. package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +277 -0
  207. package/dist/views/integration/components/ApplyProductDialogProps.d.ts +17 -0
  208. package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +277 -0
  209. package/dist/views/integration/helper/menu.d.ts +36 -0
  210. package/dist/views/receive-request/ReceiveRequestView.vue.d.ts +2 -0
  211. package/dist/views/receive-request/components/supplier-price-history/SupplierPriceHistory.vue.d.ts +12 -0
  212. package/dist/views/receive-request/components/supplier-price-history/SupplierPriceHistoryProps.d.ts +11 -0
  213. package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +18 -0
  214. package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +12 -0
  215. package/dist/views/receive-request/components/transfer-dialog/TransferDialog.vue.d.ts +22 -0
  216. package/dist/views/receive-request/components/transfer-dialog/TransferDialogProps.d.ts +11 -0
  217. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +450 -0
  218. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +10 -0
  219. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +369 -0
  220. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +1202 -0
  221. package/dist/views/receive-request/constants/dialog-templates.d.ts +8 -0
  222. package/dist/views/receive-request/constants/purchase-order-transaction-type.d.ts +4 -0
  223. package/dist/views/receive-request/constants/purchase-row-actions.d.ts +2 -0
  224. package/dist/views/receive-request/helper/format-time-from-id.d.ts +2 -0
  225. package/dist/views/receive-request/helper/format-unit-display.d.ts +6 -0
  226. package/dist/views/receive-request/helper/get-received-amount.d.ts +2 -0
  227. package/dist/views/receive-request/helper/init-date-range.d.ts +8 -0
  228. package/dist/views/receive-request/helper/print-po.d.ts +2 -0
  229. package/dist/views/receive-request/helper/status-to-background.d.ts +2 -0
  230. package/dist/views/receive-request/print-preview/PurchaseOrderPrintPreview.vue.d.ts +47 -0
  231. package/dist/views/recipe/RecipeView.vue.d.ts +2 -0
  232. package/dist/views/recipe/components/recipe-dialog/RecipeDialog.vue.d.ts +31 -0
  233. package/dist/views/recipe/components/recipe-dialog/RecipeDialogProps.d.ts +9 -0
  234. package/dist/views/recipe/components/recipe-form/RecipeForm.vue.d.ts +62 -0
  235. package/dist/views/recipe/components/recipe-form/RecipeFormProps.d.ts +10 -0
  236. package/dist/views/recipe/composables/use-recipe-form.d.ts +9 -0
  237. package/dist/views/recipe/composables/use-recipe-table.d.ts +11 -0
  238. package/dist/views/recipe/helper/export-recipe.d.ts +1 -0
  239. package/dist/views/stock/StockView.vue.d.ts +2 -0
  240. package/dist/views/stock/components/StockHistory.vue.d.ts +17 -0
  241. package/dist/views/stock/components/StockHistoryProps.d.ts +7 -0
  242. package/dist/views/stock/components/StockRecordCard.vue.d.ts +712 -0
  243. package/dist/views/stock/components/dialog/AdjustSkuDialog.vue.d.ts +22 -0
  244. package/dist/views/stock/components/dialog/AdjustSkuDialogProps.d.ts +8 -0
  245. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +164 -0
  246. package/dist/views/stock/components/dialog/AdjustedItemFormProps.d.ts +8 -0
  247. package/dist/views/stock/components/dialog/ConvertSkuDialog.vue.d.ts +22 -0
  248. package/dist/views/stock/components/dialog/ConvertSkuDialogProps.d.ts +9 -0
  249. package/dist/views/stock/components/dialog/constant/adjustment-type-options.d.ts +7 -0
  250. package/dist/views/stock/components/dialog/helper/adjust.d.ts +3 -0
  251. package/dist/views/stock/components/dialog/helper/form-adjust.d.ts +10 -0
  252. package/dist/views/stock/composables/use-stock-table.d.ts +12 -0
  253. package/dist/views/stock/helper/compute-summary-total-test.d.ts +1 -0
  254. package/dist/views/stock/helper/compute-summary-total.d.ts +1 -0
  255. package/dist/views/stock/helper/compute-summary-total.spec.d.ts +1 -0
  256. package/dist/views/stock/helper/format-date-from-id.d.ts +2 -0
  257. package/dist/views/stock/helper/on-click-export-excel.d.ts +9 -0
  258. package/dist/views/stock/helper/stock-row-action.d.ts +13 -0
  259. package/dist/views/stock/type.d.ts +9 -0
  260. package/dist/views/supplier/SupplierView.vue.d.ts +2 -0
  261. package/dist/views/supplier/components/SupplierDialog.vue.d.ts +22 -0
  262. package/dist/views/supplier/components/SupplierDialogProps.d.ts +10 -0
  263. package/dist/views/supplier/components/SupplierForm.vue.d.ts +58 -0
  264. package/dist/views/supplier/components/SupplierFormProps.d.ts +8 -0
  265. package/dist/views/supplier/composables/use-supplier-table.d.ts +22 -0
  266. package/dist/views/unit/UnitView.vue.d.ts +2 -0
  267. package/dist/views/unit/components/unit-dialog/UnitDialog.vue.d.ts +31 -0
  268. package/dist/views/unit/components/unit-dialog/UnitDialogProps.d.ts +9 -0
  269. package/dist/views/unit/components/unit-form/UnitForm.vue.d.ts +50 -0
  270. package/dist/views/unit/components/unit-form/UnitFormProps.d.ts +10 -0
  271. package/dist/views/unit/components/unit-summary/UnitSummary.vue.d.ts +43 -0
  272. package/dist/views/unit/components/unit-used-by/UnitUsedBy.vue.d.ts +12 -0
  273. package/dist/views/unit/components/unit-used-by/UnitUsedByProps.d.ts +3 -0
  274. package/dist/views/unit/composables/use-unit-form.d.ts +8 -0
  275. package/dist/views/unit/composables/use-unit-table.d.ts +19 -0
  276. package/dist/views/unit/type.d.ts +2 -0
  277. package/dist/views/warehouse/WarehouseView.vue.d.ts +2 -0
  278. package/dist/views/warehouse/components/WarehouseDialog.vue.d.ts +22 -0
  279. package/dist/views/warehouse/components/WarehouseDialogProps.d.ts +10 -0
  280. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +174 -0
  281. package/dist/views/warehouse/components/WarehouseFormProps.d.ts +8 -0
  282. package/dist/views/warehouse/composables/use-warehouse-table.d.ts +12 -0
  283. package/dist/xlsx-BljO4Lx2.js +15510 -0
  284. package/package.json +93 -0
@@ -0,0 +1,607 @@
1
+ import { defineComponent as K, computed as c, ref as P, resolveComponent as k, openBlock as R, createBlock as N, withCtx as U, createElementVNode as u, createVNode as n, unref as d, isRef as se, normalizeStyle as pe, createElementBlock as ce, createCommentVNode as fe, Teleport as be } from "vue";
2
+ import { u as ue } from "./supplier-DTiiOLtg.js";
3
+ import { D as ne, R as I, F as v } from "./row-action.enum-BwQbURNh.js";
4
+ import { c as ve, _ as Ve, F as L, u as ge } from "./layout-BvUjg6JS.js";
5
+ import { c as re, b as ye } from "./app-BzDhmCVx.js";
6
+ import { useSnackbar as ie, useProxiedModel as de, useDialog as we, useBreakpoints as Se } from "@feedmepos/ui-library";
7
+ import { _ as he } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CFjO4TPG.js";
8
+ import { _ as _e } from "./ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DcixBOcX.js";
9
+ import { R as S } from "./rules-DHfAMDW3.js";
10
+ function xe(A, g) {
11
+ function V(t, r) {
12
+ if (t === I.Edit) {
13
+ A(re(r));
14
+ return;
15
+ }
16
+ if (t === I.Delete) {
17
+ g(re(r));
18
+ return;
19
+ }
20
+ }
21
+ return { columnDefs: [
22
+ {
23
+ accessorKey: "name",
24
+ header: "Supplier",
25
+ enableSorting: !0,
26
+ size: 200
27
+ },
28
+ {
29
+ accessorKey: "contactName",
30
+ header: "PIC",
31
+ enableSorting: !1,
32
+ size: 250
33
+ },
34
+ {
35
+ accessorKey: "phoneNumber",
36
+ header: "Contact",
37
+ enableSorting: !1,
38
+ size: 200
39
+ },
40
+ {
41
+ accessorKey: "email",
42
+ header: "Email",
43
+ enableSorting: !1,
44
+ size: "auto"
45
+ },
46
+ {
47
+ id: "action",
48
+ header: "",
49
+ cell(t) {
50
+ return ve(
51
+ [ne[I.Edit], ne[I.Delete]],
52
+ (r) => {
53
+ V(r, t.row.original);
54
+ }
55
+ );
56
+ },
57
+ size: 40,
58
+ meta: {
59
+ cellClass: "",
60
+ headerClass: ""
61
+ }
62
+ }
63
+ ] };
64
+ }
65
+ const Ce = { class: "flex flex-col gap-40" }, ke = { class: "flex flex-col gap-16" }, De = { class: "flex flex-col gap-8" }, Ae = /* @__PURE__ */ u("div", { class: "fm-typo-en-title-sm-800" }, "Address", -1), Fe = { class: "grid grid-cols-2 gap-24" }, Ee = { class: "flex flex-col gap-8" }, $e = /* @__PURE__ */ u("div", { class: "fm-typo-en-title-sm-800" }, "Contact", -1), Pe = { class: "flex flex-col gap-16" }, Re = /* @__PURE__ */ K({
66
+ __name: "SupplierForm",
67
+ props: {
68
+ modelValue: {},
69
+ disabled: { type: Boolean }
70
+ },
71
+ emits: ["update:modelValue", "validation-success"],
72
+ setup(A, { expose: g, emit: V }) {
73
+ const a = A, t = V, r = c({
74
+ get() {
75
+ var l;
76
+ return ((l = a.modelValue) == null ? void 0 : l.name) ?? "";
77
+ },
78
+ set(l) {
79
+ const e = a.modelValue ?? {};
80
+ e.name = l, t("update:modelValue", e);
81
+ }
82
+ }), f = c({
83
+ get() {
84
+ var l;
85
+ return ((l = a.modelValue) == null ? void 0 : l.registrationNumber) ?? "";
86
+ },
87
+ set(l) {
88
+ const e = a.modelValue ?? {};
89
+ e.registrationNumber = l, t("update:modelValue", e);
90
+ }
91
+ }), D = c({
92
+ get() {
93
+ var l, e;
94
+ return ((e = (l = a.modelValue) == null ? void 0 : l.address) == null ? void 0 : e.line1) ?? "";
95
+ },
96
+ set(l) {
97
+ const e = a.modelValue ?? {};
98
+ e.address ?? (e.address = {}), e.address.line1 = l, t("update:modelValue", e);
99
+ }
100
+ }), i = c({
101
+ get() {
102
+ var l, e;
103
+ return ((e = (l = a.modelValue) == null ? void 0 : l.address) == null ? void 0 : e.line2) ?? "";
104
+ },
105
+ set(l) {
106
+ const e = a.modelValue ?? {};
107
+ e.address ?? (e.address = {}), e.address.line2 = l, t("update:modelValue", e);
108
+ }
109
+ }), F = c({
110
+ get() {
111
+ var l, e;
112
+ return ((e = (l = a.modelValue) == null ? void 0 : l.address) == null ? void 0 : e.city) ?? "";
113
+ },
114
+ set(l) {
115
+ const e = a.modelValue ?? {};
116
+ e.address ?? (e.address = {}), e.address.city = l, t("update:modelValue", e);
117
+ }
118
+ }), b = c({
119
+ get() {
120
+ var l, e;
121
+ return ((e = (l = a.modelValue) == null ? void 0 : l.address) == null ? void 0 : e.postcode) ?? "";
122
+ },
123
+ set(l) {
124
+ const e = a.modelValue ?? {};
125
+ e.address ?? (e.address = {}), e.address.postcode = l, t("update:modelValue", e);
126
+ }
127
+ }), h = c({
128
+ get() {
129
+ var l, e;
130
+ return ((e = (l = a.modelValue) == null ? void 0 : l.address) == null ? void 0 : e.state) ?? "";
131
+ },
132
+ set(l) {
133
+ const e = a.modelValue ?? {};
134
+ e.address ?? (e.address = {}), e.address.state = l, t("update:modelValue", e);
135
+ }
136
+ }), m = c({
137
+ get() {
138
+ var l, e;
139
+ return ((e = (l = a.modelValue) == null ? void 0 : l.address) == null ? void 0 : e.country) ?? "";
140
+ },
141
+ set(l) {
142
+ const e = a.modelValue ?? {};
143
+ e.address ?? (e.address = {}), e.address.country = l, t("update:modelValue", e);
144
+ }
145
+ }), E = c({
146
+ get() {
147
+ var l;
148
+ return ((l = a.modelValue) == null ? void 0 : l.contactName) ?? "";
149
+ },
150
+ set(l) {
151
+ const e = a.modelValue ?? {};
152
+ e.contactName = l, t("update:modelValue", e);
153
+ }
154
+ }), $ = c({
155
+ get() {
156
+ var l;
157
+ return ((l = a.modelValue) == null ? void 0 : l.phoneNumber) ?? "";
158
+ },
159
+ set(l) {
160
+ const e = a.modelValue ?? {};
161
+ e.phoneNumber = l, t("update:modelValue", e);
162
+ }
163
+ }), _ = c({
164
+ get() {
165
+ var l;
166
+ return ((l = a.modelValue) == null ? void 0 : l.email) ?? "";
167
+ },
168
+ set(l) {
169
+ const e = a.modelValue ?? {};
170
+ e.email = l, t("update:modelValue", e);
171
+ }
172
+ }), y = P();
173
+ return g({
174
+ validateInputs: () => {
175
+ var l, e;
176
+ (e = (l = y.value) == null ? void 0 : l.validateInputs) == null || e.call(l);
177
+ },
178
+ resetInputsValidation: () => {
179
+ var l, e;
180
+ (e = (l = y.value) == null ? void 0 : l.resetInputsValidation) == null || e.call(l);
181
+ },
182
+ resetInputs: () => {
183
+ var l, e;
184
+ (e = (l = y.value) == null ? void 0 : l.resetInputs) == null || e.call(l);
185
+ }
186
+ }), (l, e) => {
187
+ const o = k("FmTextField"), p = k("FmPhoneNumber"), x = k("FmForm");
188
+ return R(), N(x, {
189
+ ref_key: "formRef",
190
+ ref: y,
191
+ onValidationSuccess: e[11] || (e[11] = (s) => t("validation-success"))
192
+ }, {
193
+ default: U(() => [
194
+ u("div", Ce, [
195
+ u("div", ke, [
196
+ n(o, {
197
+ disabled: l.disabled,
198
+ rules: [d(S)()],
199
+ "label-mark": "required",
200
+ label: "Company name",
201
+ modelValue: r.value,
202
+ "onUpdate:modelValue": e[0] || (e[0] = (s) => r.value = s)
203
+ }, null, 8, ["disabled", "rules", "modelValue"]),
204
+ n(o, {
205
+ disabled: l.disabled,
206
+ rules: [d(S)()],
207
+ "label-mark": "required",
208
+ label: "Registration no.",
209
+ modelValue: f.value,
210
+ "onUpdate:modelValue": e[1] || (e[1] = (s) => f.value = s)
211
+ }, null, 8, ["disabled", "rules", "modelValue"])
212
+ ]),
213
+ u("div", De, [
214
+ Ae,
215
+ u("div", Fe, [
216
+ n(o, {
217
+ disabled: l.disabled,
218
+ rules: [d(S)()],
219
+ "label-mark": "required",
220
+ label: "Line 1",
221
+ modelValue: D.value,
222
+ "onUpdate:modelValue": e[2] || (e[2] = (s) => D.value = s)
223
+ }, null, 8, ["disabled", "rules", "modelValue"]),
224
+ n(o, {
225
+ disabled: l.disabled,
226
+ "label-mark": "optional",
227
+ label: "Line 2",
228
+ modelValue: i.value,
229
+ "onUpdate:modelValue": e[3] || (e[3] = (s) => i.value = s)
230
+ }, null, 8, ["disabled", "modelValue"]),
231
+ n(o, {
232
+ disabled: l.disabled,
233
+ rules: [d(S)()],
234
+ "label-mark": "required",
235
+ label: "City",
236
+ modelValue: F.value,
237
+ "onUpdate:modelValue": e[4] || (e[4] = (s) => F.value = s)
238
+ }, null, 8, ["disabled", "rules", "modelValue"]),
239
+ n(o, {
240
+ disabled: l.disabled,
241
+ rules: [d(S)()],
242
+ "label-mark": "required",
243
+ label: "Postal code",
244
+ modelValue: b.value,
245
+ "onUpdate:modelValue": e[5] || (e[5] = (s) => b.value = s)
246
+ }, null, 8, ["disabled", "rules", "modelValue"]),
247
+ n(o, {
248
+ disabled: l.disabled,
249
+ rules: [d(S)()],
250
+ "label-mark": "required",
251
+ label: "State",
252
+ modelValue: h.value,
253
+ "onUpdate:modelValue": e[6] || (e[6] = (s) => h.value = s)
254
+ }, null, 8, ["disabled", "rules", "modelValue"]),
255
+ n(o, {
256
+ disabled: l.disabled,
257
+ rules: [d(S)()],
258
+ "label-mark": "required",
259
+ label: "Country",
260
+ modelValue: m.value,
261
+ "onUpdate:modelValue": e[7] || (e[7] = (s) => m.value = s)
262
+ }, null, 8, ["disabled", "rules", "modelValue"])
263
+ ])
264
+ ]),
265
+ u("div", Ee, [
266
+ $e,
267
+ u("div", Pe, [
268
+ n(o, {
269
+ disabled: l.disabled,
270
+ rules: [d(S)()],
271
+ "label-mark": "required",
272
+ label: "PIC",
273
+ modelValue: E.value,
274
+ "onUpdate:modelValue": e[8] || (e[8] = (s) => E.value = s)
275
+ }, null, 8, ["disabled", "rules", "modelValue"]),
276
+ n(p, {
277
+ disabled: l.disabled,
278
+ rules: [d(S)()],
279
+ "label-mark": "required",
280
+ label: "Phone number",
281
+ modelValue: $.value,
282
+ "onUpdate:modelValue": e[9] || (e[9] = (s) => $.value = s)
283
+ }, null, 8, ["disabled", "rules", "modelValue"]),
284
+ n(o, {
285
+ disabled: l.disabled,
286
+ "label-mark": "optional",
287
+ label: "Email",
288
+ modelValue: _.value,
289
+ "onUpdate:modelValue": e[10] || (e[10] = (s) => _.value = s)
290
+ }, null, 8, ["disabled", "modelValue"])
291
+ ])
292
+ ])
293
+ ])
294
+ ]),
295
+ _: 1
296
+ }, 512);
297
+ };
298
+ }
299
+ }), Ue = { class: "flex gap-4" }, Ne = /* @__PURE__ */ K({
300
+ __name: "SupplierDialog",
301
+ props: {
302
+ mode: {},
303
+ supplier: {},
304
+ show: { type: Boolean }
305
+ },
306
+ emits: ["update:show", "submitted"],
307
+ setup(A, { expose: g, emit: V }) {
308
+ const a = A, t = V, r = P(!1), f = ie(), D = ue(), i = c(() => {
309
+ switch (a.mode) {
310
+ case v.CREATE:
311
+ return "Add supplier";
312
+ case v.READ:
313
+ return "View";
314
+ case v.UPDATE:
315
+ return "Edit supplier";
316
+ }
317
+ return "";
318
+ }), F = c(() => {
319
+ switch (a.mode) {
320
+ case v.READ:
321
+ return "";
322
+ case v.UPDATE:
323
+ return "Save";
324
+ case v.CREATE:
325
+ return "Add";
326
+ }
327
+ return "";
328
+ }), b = P();
329
+ g({
330
+ validateInputs: () => {
331
+ var l, e;
332
+ (e = (l = b.value) == null ? void 0 : l.validateInputs) == null || e.call(l);
333
+ },
334
+ resetInputsValidation: () => {
335
+ var l, e;
336
+ (e = (l = b.value) == null ? void 0 : l.resetInputsValidation) == null || e.call(l);
337
+ },
338
+ resetInputs: () => {
339
+ var l, e;
340
+ (e = (l = b.value) == null ? void 0 : l.resetInputs) == null || e.call(l);
341
+ }
342
+ });
343
+ const h = de(a, "show"), m = de(a, "supplier");
344
+ function E() {
345
+ var l, e;
346
+ (e = (l = b.value) == null ? void 0 : l.validateInputs) == null || e.call(l);
347
+ }
348
+ function $() {
349
+ switch (a.mode) {
350
+ case v.READ:
351
+ return;
352
+ case v.UPDATE:
353
+ return y();
354
+ case v.CREATE:
355
+ return _();
356
+ }
357
+ }
358
+ async function _() {
359
+ r.value = !0;
360
+ try {
361
+ await Promise.all([
362
+ D.createSupplier(m.value),
363
+ new Promise((l) => setTimeout(l, 1e3))
364
+ ]), f.open({
365
+ title: "Success",
366
+ message: `Created ${m.value.name} supplier`,
367
+ type: "success"
368
+ }), t("update:show", !1), t("submitted");
369
+ } catch (l) {
370
+ f.open({
371
+ title: "Something went wrong",
372
+ message: `Cannot create ${m.value.name} supplier. Please try again`,
373
+ type: "error"
374
+ }), console.error("cannot create supplier", l);
375
+ } finally {
376
+ r.value = !1;
377
+ }
378
+ }
379
+ async function y() {
380
+ if (m.value === null) {
381
+ f.open({
382
+ title: "Something went wrong",
383
+ message: "Cannot update empty supplier info",
384
+ type: "error"
385
+ });
386
+ return;
387
+ }
388
+ r.value = !0;
389
+ try {
390
+ await Promise.all([
391
+ D.updateSupplier(m.value),
392
+ new Promise((l) => setTimeout(l, 1e3))
393
+ ]), f.open({
394
+ title: "Success",
395
+ message: `Updated ${m.value.name} supplier`,
396
+ type: "success"
397
+ }), t("update:show", !1), t("submitted");
398
+ } catch (l) {
399
+ f.open({
400
+ title: "Something went wrong",
401
+ message: `Cannot update ${m.value.name} supplier. Please try again`,
402
+ type: "error"
403
+ }), console.error("cannot update supplier", l);
404
+ } finally {
405
+ r.value = !1;
406
+ }
407
+ }
408
+ return (l, e) => {
409
+ const o = k("FmButton"), p = k("FmSideSheet");
410
+ return R(), N(p, {
411
+ header: i.value,
412
+ modelValue: d(h),
413
+ "onUpdate:modelValue": e[1] || (e[1] = (x) => se(h) ? h.value = x : null),
414
+ "dismiss-away": !r.value,
415
+ "close-button": "",
416
+ "max-width": 500
417
+ }, {
418
+ default: U(() => {
419
+ var x;
420
+ return [
421
+ (R(), N(Re, {
422
+ class: "w-full",
423
+ ref_key: "formRef",
424
+ ref: b,
425
+ modelValue: d(m),
426
+ "onUpdate:modelValue": e[0] || (e[0] = (s) => se(m) ? m.value = s : null),
427
+ onValidationSuccess: $,
428
+ key: ((x = l.supplier) == null ? void 0 : x._id) ?? "",
429
+ disabled: r.value
430
+ }, null, 8, ["modelValue", "disabled"]))
431
+ ];
432
+ }),
433
+ "side-sheet-footer": U(() => [
434
+ u("div", Ue, [
435
+ n(o, {
436
+ loading: r.value,
437
+ label: F.value,
438
+ onClick: E
439
+ }, null, 8, ["loading", "label"])
440
+ ])
441
+ ]),
442
+ _: 1
443
+ }, 8, ["header", "modelValue", "dismiss-away"]);
444
+ };
445
+ }
446
+ }), Te = { class: "px-24 xs:p-0 sm:p-0 flex flex-col gap-8 max-h-full" }, Me = { class: "px-8 flex gap-8 items-center xs:gap-0 xs:flex-col-reverse sm:gap-0 sm:flex-col-reverse" }, qe = { class: "xs:w-full sm:w-full flex gap-8 items-center overflow-x-auto no-scrollbar py-8" }, ze = { class: "flex-grow xs:w-full" }, Ie = { class: "flex flex-col py-8" }, Le = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ke = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Be = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, He = {
447
+ key: 0,
448
+ class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
449
+ }, el = /* @__PURE__ */ K({
450
+ __name: "SupplierView",
451
+ setup(A) {
452
+ const g = ue(), V = ye(), a = P(!1), t = we(), r = ie();
453
+ V.watchLocation(f);
454
+ async function f(o) {
455
+ if (o) {
456
+ a.value = !0;
457
+ try {
458
+ await g.readSuppliers();
459
+ } catch {
460
+ r.open({
461
+ title: "Cannot fetch supplier list",
462
+ type: "error"
463
+ });
464
+ } finally {
465
+ a.value = !1;
466
+ }
467
+ }
468
+ }
469
+ const D = c(() => g.suppliers), i = P({});
470
+ function F() {
471
+ i.value.mode = v.CREATE, i.value.supplier = {}, i.value.show = !0;
472
+ }
473
+ function b(o) {
474
+ i.value.mode = v.UPDATE, i.value.supplier = o, i.value.show = !0;
475
+ }
476
+ async function h(o) {
477
+ t.open({
478
+ title: "Delete supplier?",
479
+ message: `Confirm deleting ${o.name}?`,
480
+ primaryActions: {
481
+ text: "Delete",
482
+ close: !0,
483
+ variant: "destructive"
484
+ },
485
+ secondaryActions: {
486
+ text: "Cancel",
487
+ close: !0
488
+ }
489
+ }).onPrimary(() => m(o));
490
+ }
491
+ async function m(o) {
492
+ t.open({
493
+ title: "Deleting supplier...",
494
+ closeButton: !1
495
+ });
496
+ try {
497
+ await g.deleteSupplier(o), r.open({
498
+ title: "Success",
499
+ message: `Deleted ${o == null ? void 0 : o.name}.`,
500
+ type: "success"
501
+ }), f(V.currentLocation);
502
+ } catch (p) {
503
+ r.open({
504
+ title: "Something went wrong",
505
+ message: `Cannot delete ${o == null ? void 0 : o.name}. Please try again.`,
506
+ type: "error"
507
+ }), console.error("failed to delete supplier", p);
508
+ } finally {
509
+ t.close();
510
+ }
511
+ }
512
+ const { columnDefs: E } = xe(b, h);
513
+ function $(o) {
514
+ o === "create" && F();
515
+ }
516
+ const _ = P(""), { breakpoints: y } = Se(), l = c(() => y.value.xs || y.value.sm ? 10 : 20), e = ge();
517
+ return (o, p) => {
518
+ const x = k("FmTableToolbar"), s = k("FmMenuDivider"), me = k("FmTable");
519
+ return R(), N(he, {
520
+ title: "Supplier",
521
+ actions: [{ label: "Create supplier", value: "create", isPrimary: !0, prependIcon: "add" }],
522
+ "onClick:action": $
523
+ }, {
524
+ default: U(() => [
525
+ u("div", Te, [
526
+ u("div", Me, [
527
+ u("div", qe, [
528
+ n(_e)
529
+ ]),
530
+ u("div", ze, [
531
+ n(x, {
532
+ searchable: "",
533
+ "search-model": _.value,
534
+ "onUpdate:searchModel": p[0] || (p[0] = (w) => _.value = w)
535
+ }, null, 8, ["search-model"]),
536
+ n(s, { class: "hidden xs:block" })
537
+ ])
538
+ ]),
539
+ n(me, {
540
+ style: pe(d(e).tableHeight),
541
+ "column-defs": d(E),
542
+ "row-data": D.value,
543
+ "search-value": _.value,
544
+ loading: !d(V)._currentLocation || a.value,
545
+ onRowClick: p[1] || (p[1] = (w) => b(w.original)),
546
+ "page-size": l.value
547
+ }, {
548
+ "list-row": U((w) => [
549
+ n(Ve, {
550
+ row: w,
551
+ onRowClick: b
552
+ }, {
553
+ default: U((C) => {
554
+ var B, H, j, T, G, J, O, Q, M, W, X, Y, Z, q, ee, le, ae, oe, z, te;
555
+ return [
556
+ u("div", Ie, [
557
+ u("div", Le, [
558
+ n(d(L), {
559
+ render: (j = (H = (B = C.name) == null ? void 0 : B.column) == null ? void 0 : H.columnDef) == null ? void 0 : j.cell,
560
+ props: (G = (T = C.name) == null ? void 0 : T.getContext) == null ? void 0 : G.call(T)
561
+ }, null, 8, ["render", "props"])
562
+ ]),
563
+ u("div", Ke, [
564
+ n(d(L), {
565
+ render: (Q = (O = (J = C.contactName) == null ? void 0 : J.column) == null ? void 0 : O.columnDef) == null ? void 0 : Q.cell,
566
+ props: (W = (M = C.contactName) == null ? void 0 : M.getContext) == null ? void 0 : W.call(M)
567
+ }, null, 8, ["render", "props"])
568
+ ]),
569
+ u("div", Be, [
570
+ n(d(L), {
571
+ render: (Z = (Y = (X = C.phoneNumber) == null ? void 0 : X.column) == null ? void 0 : Y.columnDef) == null ? void 0 : Z.cell,
572
+ props: (ee = (q = C.phoneNumber) == null ? void 0 : q.getContext) == null ? void 0 : ee.call(q)
573
+ }, null, 8, ["render", "props"])
574
+ ]),
575
+ w.original.email ? (R(), ce("div", He, [
576
+ n(d(L), {
577
+ render: (oe = (ae = (le = C.email) == null ? void 0 : le.column) == null ? void 0 : ae.columnDef) == null ? void 0 : oe.cell,
578
+ props: (te = (z = C.email) == null ? void 0 : z.getContext) == null ? void 0 : te.call(z)
579
+ }, null, 8, ["render", "props"])
580
+ ])) : fe("", !0)
581
+ ])
582
+ ];
583
+ }),
584
+ _: 2
585
+ }, 1032, ["row"])
586
+ ]),
587
+ _: 1
588
+ }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"])
589
+ ]),
590
+ (R(), N(be, { to: "body" }, [
591
+ n(Ne, {
592
+ show: i.value.show,
593
+ "onUpdate:show": p[2] || (p[2] = (w) => i.value.show = w),
594
+ supplier: i.value.supplier,
595
+ mode: i.value.mode,
596
+ onSubmitted: p[3] || (p[3] = (w) => f(d(V).currentLocation))
597
+ }, null, 8, ["show", "supplier", "mode"])
598
+ ]))
599
+ ]),
600
+ _: 1
601
+ });
602
+ };
603
+ }
604
+ });
605
+ export {
606
+ el as default
607
+ };