@bigbinary/neeto-payments-frontend 6.1.12 → 6.1.13

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 (221) hide show
  1. package/dist/AccountsDashboard.js +308 -333
  2. package/dist/AccountsDashboard.js.map +1 -1
  3. package/dist/AdminCancelRecurringPaymentButton.js +43 -54
  4. package/dist/AdminCancelRecurringPaymentButton.js.map +1 -1
  5. package/dist/CashPaymentButton.js +32 -34
  6. package/dist/CashPaymentButton.js.map +1 -1
  7. package/dist/ConfirmCashPaymentButton.js +77 -71
  8. package/dist/ConfirmCashPaymentButton.js.map +1 -1
  9. package/dist/{CopyButtonWrapper-rv-OaINx.js → CopyButtonWrapper-Bp5IVO76.js} +16 -14
  10. package/dist/CopyButtonWrapper-Bp5IVO76.js.map +1 -0
  11. package/dist/CustomerCancelRecurringPaymentForm.js +76 -75
  12. package/dist/CustomerCancelRecurringPaymentForm.js.map +1 -1
  13. package/dist/ExportModal-DyRGg_4o.js +120 -0
  14. package/dist/ExportModal-DyRGg_4o.js.map +1 -0
  15. package/dist/ManualUpiConnect.js +159 -178
  16. package/dist/ManualUpiConnect.js.map +1 -1
  17. package/dist/ManualUpiPayment.js +85 -89
  18. package/dist/ManualUpiPayment.js.map +1 -1
  19. package/dist/ManualUpiPaymentConfirmButton.js +119 -115
  20. package/dist/ManualUpiPaymentConfirmButton.js.map +1 -1
  21. package/dist/ManualUpiPaymentRejectButton.js +98 -92
  22. package/dist/ManualUpiPaymentRejectButton.js.map +1 -1
  23. package/dist/PaymentKindRestrictionAlert.js +14 -19
  24. package/dist/PaymentKindRestrictionAlert.js.map +1 -1
  25. package/dist/PaymentsDashboard.js +318 -349
  26. package/dist/PaymentsDashboard.js.map +1 -1
  27. package/dist/PayoutsDashboard.js +327 -350
  28. package/dist/PayoutsDashboard.js.map +1 -1
  29. package/dist/PayoutsPage.js +114 -92
  30. package/dist/PayoutsPage.js.map +1 -1
  31. package/dist/RazorpayConnect.js +71 -62
  32. package/dist/RazorpayConnect.js.map +1 -1
  33. package/dist/RazorpayLinkedAccountForm.js +145 -156
  34. package/dist/RazorpayLinkedAccountForm.js.map +1 -1
  35. package/dist/RazorpayPaymentButton.js +72 -100
  36. package/dist/RazorpayPaymentButton.js.map +1 -1
  37. package/dist/RecurringPaymentSettings.js +85 -85
  38. package/dist/RecurringPaymentSettings.js.map +1 -1
  39. package/dist/RefundsDashboard.js +363 -386
  40. package/dist/RefundsDashboard.js.map +1 -1
  41. package/dist/SplitTransfersDashboard.js +868 -829
  42. package/dist/SplitTransfersDashboard.js.map +1 -1
  43. package/dist/StripeCheckoutSetting.js +63 -75
  44. package/dist/StripeCheckoutSetting.js.map +1 -1
  45. package/dist/StripeConnect.js +257 -259
  46. package/dist/StripeConnect.js.map +1 -1
  47. package/dist/StripeManage.js +28 -25
  48. package/dist/StripeManage.js.map +1 -1
  49. package/dist/TaxesDashboard.js +284 -292
  50. package/dist/TaxesDashboard.js.map +1 -1
  51. package/dist/buildStripeTransactionLink.js +1 -1
  52. package/dist/cjs/AccountsDashboard.js +308 -333
  53. package/dist/cjs/AccountsDashboard.js.map +1 -1
  54. package/dist/cjs/AdminCancelRecurringPaymentButton.js +43 -54
  55. package/dist/cjs/AdminCancelRecurringPaymentButton.js.map +1 -1
  56. package/dist/cjs/CashPaymentButton.js +32 -34
  57. package/dist/cjs/CashPaymentButton.js.map +1 -1
  58. package/dist/cjs/ConfirmCashPaymentButton.js +77 -71
  59. package/dist/cjs/ConfirmCashPaymentButton.js.map +1 -1
  60. package/dist/cjs/{CopyButtonWrapper-BkpN0Wmd.js → CopyButtonWrapper-I-kdKiiB.js} +16 -14
  61. package/dist/cjs/CopyButtonWrapper-I-kdKiiB.js.map +1 -0
  62. package/dist/cjs/CustomerCancelRecurringPaymentForm.js +76 -75
  63. package/dist/cjs/CustomerCancelRecurringPaymentForm.js.map +1 -1
  64. package/dist/cjs/ExportModal-DE-VcN1X.js +122 -0
  65. package/dist/cjs/ExportModal-DE-VcN1X.js.map +1 -0
  66. package/dist/cjs/ManualUpiConnect.js +159 -178
  67. package/dist/cjs/ManualUpiConnect.js.map +1 -1
  68. package/dist/cjs/ManualUpiPayment.js +85 -89
  69. package/dist/cjs/ManualUpiPayment.js.map +1 -1
  70. package/dist/cjs/ManualUpiPaymentConfirmButton.js +118 -114
  71. package/dist/cjs/ManualUpiPaymentConfirmButton.js.map +1 -1
  72. package/dist/cjs/ManualUpiPaymentRejectButton.js +98 -92
  73. package/dist/cjs/ManualUpiPaymentRejectButton.js.map +1 -1
  74. package/dist/cjs/PaymentKindRestrictionAlert.js +14 -19
  75. package/dist/cjs/PaymentKindRestrictionAlert.js.map +1 -1
  76. package/dist/cjs/PaymentsDashboard.js +318 -349
  77. package/dist/cjs/PaymentsDashboard.js.map +1 -1
  78. package/dist/cjs/PayoutsDashboard.js +327 -350
  79. package/dist/cjs/PayoutsDashboard.js.map +1 -1
  80. package/dist/cjs/PayoutsPage.js +114 -92
  81. package/dist/cjs/PayoutsPage.js.map +1 -1
  82. package/dist/cjs/RazorpayConnect.js +71 -62
  83. package/dist/cjs/RazorpayConnect.js.map +1 -1
  84. package/dist/cjs/RazorpayLinkedAccountForm.js +145 -156
  85. package/dist/cjs/RazorpayLinkedAccountForm.js.map +1 -1
  86. package/dist/cjs/RazorpayPaymentButton.js +72 -100
  87. package/dist/cjs/RazorpayPaymentButton.js.map +1 -1
  88. package/dist/cjs/RecurringPaymentSettings.js +85 -85
  89. package/dist/cjs/RecurringPaymentSettings.js.map +1 -1
  90. package/dist/cjs/RefundsDashboard.js +363 -386
  91. package/dist/cjs/RefundsDashboard.js.map +1 -1
  92. package/dist/cjs/SplitTransfersDashboard.js +867 -828
  93. package/dist/cjs/SplitTransfersDashboard.js.map +1 -1
  94. package/dist/cjs/StripeCheckoutSetting.js +63 -75
  95. package/dist/cjs/StripeCheckoutSetting.js.map +1 -1
  96. package/dist/cjs/StripeConnect.js +257 -259
  97. package/dist/cjs/StripeConnect.js.map +1 -1
  98. package/dist/cjs/StripeManage.js +28 -25
  99. package/dist/cjs/StripeManage.js.map +1 -1
  100. package/dist/cjs/TaxesDashboard.js +284 -292
  101. package/dist/cjs/TaxesDashboard.js.map +1 -1
  102. package/dist/cjs/buildStripeTransactionLink.js +1 -1
  103. package/dist/cjs/constants.js +1 -1
  104. package/dist/cjs/dashboard-BiCB2A6S.js +96 -0
  105. package/dist/cjs/dashboard-BiCB2A6S.js.map +1 -0
  106. package/dist/cjs/{exportChannel-D1Wls92m.js → exportChannel-BL2RGGhP.js} +16 -18
  107. package/dist/cjs/{exportChannel-D1Wls92m.js.map → exportChannel-BL2RGGhP.js.map} +1 -1
  108. package/dist/cjs/getAddressElementOptions.js +1 -1
  109. package/dist/cjs/getAmountInLargestCurrencyUnit.js +1 -1
  110. package/dist/cjs/getAmountInSmallestCurrencyUnit.js +1 -1
  111. package/dist/cjs/getAmountWithAppliedTax.js +1 -1
  112. package/dist/cjs/getFormattedAmount.js +1 -1
  113. package/dist/cjs/getFormattedDiscountedAmount.js +1 -1
  114. package/dist/cjs/getFormattedDiscountedPercentage.js +1 -1
  115. package/dist/cjs/getFormattedTaxAmount.js +1 -1
  116. package/dist/cjs/getFormattedTipAmount.js +1 -1
  117. package/dist/cjs/getQrCodeValue.js +1 -1
  118. package/dist/cjs/getTaxAmount.js +1 -1
  119. package/dist/cjs/getTipAmount.js +1 -1
  120. package/dist/cjs/hasAmountToPay.js +1 -1
  121. package/dist/cjs/index-D6V3Vofs.js +855 -0
  122. package/dist/cjs/{index-CZ_VFGNj.js.map → index-D6V3Vofs.js.map} +1 -1
  123. package/dist/cjs/index.js +14 -20
  124. package/dist/cjs/index.js.map +1 -1
  125. package/dist/cjs/{queryConstants-Cka1X6GX.js → queryConstants-Dc6wh21D.js} +2 -2
  126. package/dist/cjs/{queryConstants-Cka1X6GX.js.map → queryConstants-Dc6wh21D.js.map} +1 -1
  127. package/dist/cjs/renderFunctions-DhCwlBWw.js +48 -0
  128. package/dist/cjs/renderFunctions-DhCwlBWw.js.map +1 -0
  129. package/dist/cjs/useAccountsApi-B2MZWHMY.js +42 -0
  130. package/dist/cjs/useAccountsApi-B2MZWHMY.js.map +1 -0
  131. package/dist/cjs/useIntegrationsApi-CVlTmLKc.js +20 -0
  132. package/dist/cjs/{useIntegrationsApi-BO9PhVVO.js.map → useIntegrationsApi-CVlTmLKc.js.map} +1 -1
  133. package/dist/cjs/usePaymentApi-BCE_Ql18.js +29 -0
  134. package/dist/cjs/usePaymentApi-BCE_Ql18.js.map +1 -0
  135. package/dist/cjs/usePaymentApi-Bl8jWvnG.js +44 -0
  136. package/dist/cjs/usePaymentApi-Bl8jWvnG.js.map +1 -0
  137. package/dist/cjs/usePaymentApi-CiwXBe90.js +29 -0
  138. package/dist/cjs/{usePaymentApi-BE8xfY-U.js.map → usePaymentApi-CiwXBe90.js.map} +1 -1
  139. package/dist/cjs/usePlatformApi-CcGVG4Qi.js +55 -0
  140. package/dist/cjs/{usePlatformApi-C7lXP6ev.js.map → usePlatformApi-CcGVG4Qi.js.map} +1 -1
  141. package/dist/cjs/useRazorpayPayment.js +48 -73
  142. package/dist/cjs/useRazorpayPayment.js.map +1 -1
  143. package/dist/cjs/useStripePromise.js +22 -48
  144. package/dist/cjs/useStripePromise.js.map +1 -1
  145. package/dist/constants.js +1 -1
  146. package/dist/dashboard-CwvqEeOl.js +90 -0
  147. package/dist/dashboard-CwvqEeOl.js.map +1 -0
  148. package/dist/{exportChannel-DAxJ44QB.js → exportChannel-Db0U5gc1.js} +16 -18
  149. package/dist/{exportChannel-DAxJ44QB.js.map → exportChannel-Db0U5gc1.js.map} +1 -1
  150. package/dist/getAddressElementOptions.js +1 -1
  151. package/dist/getAmountInLargestCurrencyUnit.js +1 -1
  152. package/dist/getAmountInSmallestCurrencyUnit.js +1 -1
  153. package/dist/getAmountWithAppliedTax.js +1 -1
  154. package/dist/getFormattedAmount.js +1 -1
  155. package/dist/getFormattedDiscountedAmount.js +1 -1
  156. package/dist/getFormattedDiscountedPercentage.js +1 -1
  157. package/dist/getFormattedTaxAmount.js +1 -1
  158. package/dist/getFormattedTipAmount.js +1 -1
  159. package/dist/getQrCodeValue.js +1 -1
  160. package/dist/getTaxAmount.js +1 -1
  161. package/dist/getTipAmount.js +1 -1
  162. package/dist/hasAmountToPay.js +1 -1
  163. package/dist/index-CNouM9_z.js +804 -0
  164. package/dist/{index-C7irWceQ.js.map → index-CNouM9_z.js.map} +1 -1
  165. package/dist/index.js +14 -20
  166. package/dist/index.js.map +1 -1
  167. package/dist/{queryConstants-DFKKEEo0.js → queryConstants-C7AqdemO.js} +2 -2
  168. package/dist/{queryConstants-DFKKEEo0.js.map → queryConstants-C7AqdemO.js.map} +1 -1
  169. package/dist/renderFunctions-Bx5nzyE_.js +44 -0
  170. package/dist/renderFunctions-Bx5nzyE_.js.map +1 -0
  171. package/dist/useAccountsApi-C9_eNmEZ.js +38 -0
  172. package/dist/useAccountsApi-C9_eNmEZ.js.map +1 -0
  173. package/dist/useIntegrationsApi-D9eA_FrB.js +18 -0
  174. package/dist/{useIntegrationsApi-D1bkKtoy.js.map → useIntegrationsApi-D9eA_FrB.js.map} +1 -1
  175. package/dist/usePaymentApi-B98qoM7U.js +26 -0
  176. package/dist/usePaymentApi-B98qoM7U.js.map +1 -0
  177. package/dist/usePaymentApi-DMHHdCK1.js +41 -0
  178. package/dist/usePaymentApi-DMHHdCK1.js.map +1 -0
  179. package/dist/usePaymentApi-DSlW_EBq.js +27 -0
  180. package/dist/{usePaymentApi-DcMNbOMk.js.map → usePaymentApi-DSlW_EBq.js.map} +1 -1
  181. package/dist/usePlatformApi-sJUY6wju.js +50 -0
  182. package/dist/{usePlatformApi-Di7Dg-Gn.js.map → usePlatformApi-sJUY6wju.js.map} +1 -1
  183. package/dist/useRazorpayPayment.js +48 -73
  184. package/dist/useRazorpayPayment.js.map +1 -1
  185. package/dist/useStripePromise.js +22 -48
  186. package/dist/useStripePromise.js.map +1 -1
  187. package/package.json +1 -1
  188. package/dist/CopyButtonWrapper-rv-OaINx.js.map +0 -1
  189. package/dist/ExportModal-CxKyrlwf.js +0 -120
  190. package/dist/ExportModal-CxKyrlwf.js.map +0 -1
  191. package/dist/cjs/CopyButtonWrapper-BkpN0Wmd.js.map +0 -1
  192. package/dist/cjs/ExportModal-DxCzPCh0.js +0 -122
  193. package/dist/cjs/ExportModal-DxCzPCh0.js.map +0 -1
  194. package/dist/cjs/dashboard-DKHencVn.js +0 -110
  195. package/dist/cjs/dashboard-DKHencVn.js.map +0 -1
  196. package/dist/cjs/index-CZ_VFGNj.js +0 -899
  197. package/dist/cjs/renderFunctions-CX_K4qf8.js +0 -51
  198. package/dist/cjs/renderFunctions-CX_K4qf8.js.map +0 -1
  199. package/dist/cjs/useAccountsApi-DC617yB4.js +0 -62
  200. package/dist/cjs/useAccountsApi-DC617yB4.js.map +0 -1
  201. package/dist/cjs/useIntegrationsApi-BO9PhVVO.js +0 -26
  202. package/dist/cjs/usePaymentApi-BE8xfY-U.js +0 -39
  203. package/dist/cjs/usePaymentApi-C9aQhuda.js +0 -56
  204. package/dist/cjs/usePaymentApi-C9aQhuda.js.map +0 -1
  205. package/dist/cjs/usePaymentApi-CrKom4eT.js +0 -41
  206. package/dist/cjs/usePaymentApi-CrKom4eT.js.map +0 -1
  207. package/dist/cjs/usePlatformApi-C7lXP6ev.js +0 -84
  208. package/dist/dashboard-ClEN2ygs.js +0 -104
  209. package/dist/dashboard-ClEN2ygs.js.map +0 -1
  210. package/dist/index-C7irWceQ.js +0 -848
  211. package/dist/renderFunctions-D9sAy3V_.js +0 -47
  212. package/dist/renderFunctions-D9sAy3V_.js.map +0 -1
  213. package/dist/useAccountsApi-DPem_UA-.js +0 -58
  214. package/dist/useAccountsApi-DPem_UA-.js.map +0 -1
  215. package/dist/useIntegrationsApi-D1bkKtoy.js +0 -24
  216. package/dist/usePaymentApi-BV0jXF-6.js +0 -38
  217. package/dist/usePaymentApi-BV0jXF-6.js.map +0 -1
  218. package/dist/usePaymentApi-DHARy-kC.js +0 -53
  219. package/dist/usePaymentApi-DHARy-kC.js.map +0 -1
  220. package/dist/usePaymentApi-DcMNbOMk.js +0 -37
  221. package/dist/usePlatformApi-Di7Dg-Gn.js +0 -79
@@ -1,8 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var _defineProperty = require('@babel/runtime/helpers/defineProperty');
4
- var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
5
- var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
6
3
  var react = require('react');
7
4
  var constants$1 = require('neetocommons/constants');
8
5
  var utils = require('neetocommons/utils');
@@ -10,23 +7,24 @@ var neetoFiltersFrontend = require('@bigbinary/neeto-filters-frontend');
10
7
  var neetoui = require('@bigbinary/neetoui');
11
8
  var ramda = require('ramda');
12
9
  var reactRouterDom = require('react-router-dom');
13
- var ExportModal = require('./ExportModal-DxCzPCh0.js');
10
+ var ExportModal = require('./ExportModal-DE-VcN1X.js');
14
11
  var reactQuery = require('@tanstack/react-query');
15
12
  var reactUtils = require('neetocommons/react-utils');
16
13
  var axios = require('axios');
17
- var constants = require('./index-CZ_VFGNj.js');
18
- var queryConstants = require('./queryConstants-Cka1X6GX.js');
14
+ var constants = require('./index-D6V3Vofs.js');
15
+ var queryConstants = require('./queryConstants-Dc6wh21D.js');
19
16
  var formik = require('@bigbinary/neetoui/formik');
20
17
  var reactI18next = require('react-i18next');
21
18
  var i18next = require('i18next');
22
19
  var yup = require('yup');
20
+ var jsxRuntime = require('react/jsx-runtime');
23
21
  var neetocist = require('neetocist');
24
22
  var Columns = require('@bigbinary/neeto-molecules/Columns');
25
23
  var TableWrapper = require('@bigbinary/neeto-molecules/TableWrapper');
26
- var exportChannel = require('./exportChannel-D1Wls92m.js');
24
+ var exportChannel = require('./exportChannel-BL2RGGhP.js');
27
25
  var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
28
26
  var DateFormat = require('@bigbinary/neeto-molecules/DateFormat');
29
- var CopyButtonWrapper = require('./CopyButtonWrapper-BkpN0Wmd.js');
27
+ var CopyButtonWrapper = require('./CopyButtonWrapper-I-kdKiiB.js');
30
28
  var Header = require('@bigbinary/neeto-molecules/Header');
31
29
  var SubHeader = require('@bigbinary/neeto-molecules/SubHeader');
32
30
  require('@bigbinary/neeto-icons');
@@ -52,63 +50,46 @@ function _interopNamespaceDefault(e) {
52
50
 
53
51
  var yup__namespace = /*#__PURE__*/_interopNamespaceDefault(yup);
54
52
 
55
- var list = function list(payload) {
56
- return axios.get("".concat(constants.BASE_URL, "/api/v1/split_transfers"), {
57
- params: payload
58
- });
59
- };
60
- var show = function show(id) {
61
- return axios.get("".concat(constants.BASE_URL, "/api/v1/split_transfers/").concat(id));
62
- };
63
- var bulkUpdate = function bulkUpdate(payload) {
64
- return axios.post("".concat(constants.BASE_URL, "/api/v1/split_transfers/bulk_update"), {
65
- splitTransfer: payload
66
- });
67
- };
68
- var splitTransfersApi = {
69
- list: list,
70
- show: show,
71
- bulkUpdate: bulkUpdate
53
+ const list = payload => axios.get(`${constants.BASE_URL}/api/v1/split_transfers`, {
54
+ params: payload
55
+ });
56
+ const show = id => axios.get(`${constants.BASE_URL}/api/v1/split_transfers/${id}`);
57
+ const bulkUpdate = payload => axios.post(`${constants.BASE_URL}/api/v1/split_transfers/bulk_update`, {
58
+ splitTransfer: payload
59
+ });
60
+ const splitTransfersApi = {
61
+ list,
62
+ show,
63
+ bulkUpdate
72
64
  };
73
65
 
74
- function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
75
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
76
- var useFetchSplitTransfers = function useFetchSplitTransfers() {
77
- var payload = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
78
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
79
- return reactQuery.useQuery(_objectSpread$2({
80
- queryKey: [queryConstants.QUERY_KEYS.SPLIT_TRANSFERS_LIST, payload],
81
- queryFn: function queryFn() {
82
- return splitTransfersApi.list(payload);
83
- }
84
- }, options));
85
- };
86
- var useShowSplitTransfers = function useShowSplitTransfers(id, options) {
87
- return reactQuery.useQuery(_objectSpread$2({
88
- queryKey: [queryConstants.QUERY_KEYS.SPLIT_TRANSFERS_DETAILS, id],
89
- queryFn: function queryFn() {
90
- return splitTransfersApi.show(id);
91
- }
92
- }, options));
93
- };
94
- var useBulkUpdateSplitTransfers = function useBulkUpdateSplitTransfers(options) {
95
- return reactUtils.useMutationWithInvalidation(splitTransfersApi.bulkUpdate, _objectSpread$2({
96
- keysToInvalidate: [queryConstants.QUERY_KEYS.SPLIT_TRANSFERS_LISTw]
97
- }, options));
98
- };
66
+ const useFetchSplitTransfers = (payload = {}, options = {}) => reactQuery.useQuery({
67
+ queryKey: [queryConstants.QUERY_KEYS.SPLIT_TRANSFERS_LIST, payload],
68
+ queryFn: () => splitTransfersApi.list(payload),
69
+ ...options
70
+ });
71
+ const useShowSplitTransfers = (id, options) => reactQuery.useQuery({
72
+ queryKey: [queryConstants.QUERY_KEYS.SPLIT_TRANSFERS_DETAILS, id],
73
+ queryFn: () => splitTransfersApi.show(id),
74
+ ...options
75
+ });
76
+ const useBulkUpdateSplitTransfers = options => reactUtils.useMutationWithInvalidation(splitTransfersApi.bulkUpdate, {
77
+ keysToInvalidate: [queryConstants.QUERY_KEYS.SPLIT_TRANSFERS_LISTw],
78
+ ...options
79
+ });
99
80
 
100
- var SPLIT_TRANSFERS_DASHBOARD_TAB = {
81
+ const SPLIT_TRANSFERS_DASHBOARD_TAB = {
101
82
  all: "all",
102
83
  successful: "successful",
103
84
  cancelled: "cancelled",
104
85
  pending: "pending"
105
86
  };
106
- var SEARCH_PROPS = {
87
+ const SEARCH_PROPS = {
107
88
  node: "identifier,",
108
89
  key: "search_term",
109
90
  model: "NeetoPaymentsEngine::Payments::Split,"
110
91
  };
111
- var FILTER_COLUMNS = [{
92
+ const FILTER_COLUMNS = [{
112
93
  key: "amount",
113
94
  label: i18next.t("neetoPayments.common.amount"),
114
95
  node: "amount",
@@ -119,905 +100,963 @@ var FILTER_COLUMNS = [{
119
100
  node: "payment_at",
120
101
  type: "date"
121
102
  }];
122
- var INITIAL_TRANSFER_DETAILS = {
103
+ const INITIAL_TRANSFER_DETAILS = {
123
104
  id: null,
124
105
  isPaneOpen: false
125
106
  };
126
- var VALIDATION_SCHEMA = yup__namespace.object().shape({
107
+ const VALIDATION_SCHEMA = yup__namespace.object().shape({
127
108
  reason: yup__namespace.string().required(i18next.t("neetoPayments.cancelSplitTransfers.reasonRequired"))
128
109
  });
129
110
 
130
- var CancelModal = function CancelModal(_ref) {
131
- var isOpen = _ref.isOpen,
132
- onClose = _ref.onClose,
133
- handleSplitTransfersUpdate = _ref.handleSplitTransfersUpdate;
134
- var _useTranslation = reactI18next.useTranslation(),
135
- t = _useTranslation.t;
136
- var handleSubmit = function handleSubmit(_ref2) {
137
- var reason = _ref2.reason;
111
+ const CancelModal = ({
112
+ isOpen,
113
+ onClose,
114
+ handleSplitTransfersUpdate
115
+ }) => {
116
+ const {
117
+ t
118
+ } = reactI18next.useTranslation();
119
+ const handleSubmit = ({
120
+ reason
121
+ }) => {
138
122
  handleSplitTransfersUpdate("cancelled", reason);
139
123
  };
140
- return /*#__PURE__*/React.createElement(neetoui.Modal, {
141
- isOpen: isOpen,
142
- onClose: onClose,
143
- size: "large"
144
- }, /*#__PURE__*/React.createElement(neetoui.Modal.Header, null, /*#__PURE__*/React.createElement(neetoui.Typography, {
145
- style: "h2",
146
- weight: "medium"
147
- }, t("neetoPayments.cancelSplitTransfers.modal.title"))), /*#__PURE__*/React.createElement(formik.Form, {
148
- formikProps: {
149
- initialValues: {
150
- reason: ""
124
+ return /*#__PURE__*/jsxRuntime.jsxs(neetoui.Modal, {
125
+ isOpen,
126
+ onClose,
127
+ size: "large",
128
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Modal.Header, {
129
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
130
+ style: "h2",
131
+ weight: "medium",
132
+ children: t("neetoPayments.cancelSplitTransfers.modal.title")
133
+ })
134
+ }), /*#__PURE__*/jsxRuntime.jsx(formik.Form, {
135
+ formikProps: {
136
+ initialValues: {
137
+ reason: ""
138
+ },
139
+ validationSchema: VALIDATION_SCHEMA,
140
+ onSubmit: handleSubmit
151
141
  },
152
- validationSchema: VALIDATION_SCHEMA,
153
- onSubmit: handleSubmit
154
- }
155
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(neetoui.Modal.Body, null, /*#__PURE__*/React.createElement("div", {
156
- className: "flex flex-col space-y-4"
157
- }, /*#__PURE__*/React.createElement(formik.Textarea, {
158
- required: true,
159
- label: t("neetoPayments.cancelSplitTransfers.modal.reason"),
160
- name: "reason"
161
- }))), /*#__PURE__*/React.createElement(neetoui.Modal.Footer, null, /*#__PURE__*/React.createElement(formik.ActionBlock, {
162
- position: "right",
163
- cancelButtonProps: {
164
- onClick: onClose,
165
- style: "tertiary"
166
- },
167
- submitButtonProps: {
168
- disabled: false,
169
- label: t("neetoPayments.common.submit")
170
- }
171
- })))));
142
+ children: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
143
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Modal.Body, {
144
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
145
+ className: "flex flex-col space-y-4",
146
+ children: /*#__PURE__*/jsxRuntime.jsx(formik.Textarea, {
147
+ required: true,
148
+ label: t("neetoPayments.cancelSplitTransfers.modal.reason"),
149
+ name: "reason"
150
+ })
151
+ })
152
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Modal.Footer, {
153
+ children: /*#__PURE__*/jsxRuntime.jsx(formik.ActionBlock, {
154
+ position: "right",
155
+ cancelButtonProps: {
156
+ onClick: onClose,
157
+ style: "tertiary"
158
+ },
159
+ submitButtonProps: {
160
+ disabled: false,
161
+ label: t("neetoPayments.common.submit")
162
+ }
163
+ })
164
+ })]
165
+ })
166
+ })]
167
+ });
172
168
  };
173
169
 
174
- var Status = function Status(_ref) {
175
- var type = _ref.type,
176
- _ref$status = _ref.status,
177
- status = _ref$status === void 0 ? "" : _ref$status;
178
- var _useTranslation = reactI18next.useTranslation(),
179
- t = _useTranslation.t;
180
- var processedStatus = constants.preProcessStatus(type, status);
170
+ const Status = ({
171
+ type,
172
+ status = ""
173
+ }) => {
174
+ const {
175
+ t
176
+ } = reactI18next.useTranslation();
177
+ const processedStatus = constants.preProcessStatus(type, status);
181
178
  if (neetocist.isNotPresent(status)) {
182
- return /*#__PURE__*/React.createElement(neetoui.Typography, {
183
- style: "body2"
184
- }, t("neetoPayments.common.notAvailable"));
179
+ return /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
180
+ style: "body2",
181
+ children: t("neetoPayments.common.notAvailable")
182
+ });
185
183
  }
186
- return /*#__PURE__*/React.createElement(neetoui.Tooltip, {
187
- content: t("neetoPayments.tooltipContent.".concat(type, ".").concat(processedStatus)),
188
- position: "top"
189
- }, /*#__PURE__*/React.createElement("div", {
190
- className: "w-fit"
191
- }, /*#__PURE__*/React.createElement(neetoui.Tag, {
192
- style: constants.getTagStyle(processedStatus),
193
- label: neetocist.humanize(t("neetoPayments.tagLabels.".concat(type, ".").concat(processedStatus)))
194
- })));
184
+ return /*#__PURE__*/jsxRuntime.jsx(neetoui.Tooltip, {
185
+ content: t(`neetoPayments.tooltipContent.${type}.${processedStatus}`),
186
+ position: "top",
187
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
188
+ className: "w-fit",
189
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Tag, {
190
+ style: constants.getTagStyle(processedStatus),
191
+ label: neetocist.humanize(t(`neetoPayments.tagLabels.${type}.${processedStatus}`))
192
+ })
193
+ })
194
+ });
195
195
  };
196
196
 
197
- var Date = function Date(_ref) {
198
- var date = _ref.date,
199
- _ref$isTimeVisible = _ref.isTimeVisible,
200
- isTimeVisible = _ref$isTimeVisible === void 0 ? false : _ref$isTimeVisible;
201
- var _useTranslation = reactI18next.useTranslation(),
202
- t = _useTranslation.t;
197
+ const Date = ({
198
+ date,
199
+ isTimeVisible = false
200
+ }) => {
201
+ const {
202
+ t
203
+ } = reactI18next.useTranslation();
203
204
  if (neetocist.isNotPresent(date)) {
204
- return /*#__PURE__*/React.createElement(neetoui.Typography, {
205
- style: "body2"
206
- }, t("neetoPayments.common.notAvailable"));
205
+ return /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
206
+ style: "body2",
207
+ children: t("neetoPayments.common.notAvailable")
208
+ });
207
209
  }
208
210
  if (isTimeVisible) {
209
- return /*#__PURE__*/React.createElement("div", {
210
- className: "flex items-center"
211
- }, /*#__PURE__*/React.createElement(DateFormat.DateTime, {
212
- date: date
213
- }));
211
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
212
+ className: "flex items-center",
213
+ children: /*#__PURE__*/jsxRuntime.jsx(DateFormat.DateTime, {
214
+ date
215
+ })
216
+ });
214
217
  }
215
- return /*#__PURE__*/React.createElement("div", {
216
- className: "flex items-center"
217
- }, /*#__PURE__*/React.createElement(DateFormat.Date, {
218
- date: date
219
- }));
218
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
219
+ className: "flex items-center",
220
+ children: /*#__PURE__*/jsxRuntime.jsx(DateFormat.Date, {
221
+ date
222
+ })
223
+ });
220
224
  };
221
225
 
222
- var DiscountCode = function DiscountCode(_ref) {
223
- var discountCode = _ref.discountCode,
224
- currency = _ref.currency;
225
- var _useTranslation = reactI18next.useTranslation(),
226
- t = _useTranslation.t;
227
- var code = discountCode.code,
228
- value = discountCode.value,
229
- kind = discountCode.kind;
230
- return /*#__PURE__*/React.createElement(neetoui.Typography, {
231
- style: "body2"
232
- }, kind === "percentage" ? t("neetoPayments.splitTransferDetails.discountCodeOfPercentageApplied", {
233
- code: code,
234
- percentage: value.toFixed(1)
235
- }) : t("neetoPayments.splitTransferDetails.discountCodeOfAmountApplied", {
236
- code: code,
237
- amount: utils.currencyFormat.withSymbol(value, currency.toUpperCase(), {
238
- maximumFractionDigits: 2,
239
- minimumFractionDigits: 2
226
+ const DiscountCode = ({
227
+ discountCode,
228
+ currency
229
+ }) => {
230
+ const {
231
+ t
232
+ } = reactI18next.useTranslation();
233
+ const {
234
+ code,
235
+ value,
236
+ kind
237
+ } = discountCode;
238
+ return /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
239
+ style: "body2",
240
+ children: kind === "percentage" ? t("neetoPayments.splitTransferDetails.discountCodeOfPercentageApplied", {
241
+ code,
242
+ percentage: value.toFixed(1)
243
+ }) : t("neetoPayments.splitTransferDetails.discountCodeOfAmountApplied", {
244
+ code,
245
+ amount: utils.currencyFormat.withSymbol(value, currency.toUpperCase(), {
246
+ maximumFractionDigits: 2,
247
+ minimumFractionDigits: 2
248
+ })
240
249
  })
241
- }));
250
+ });
242
251
  };
243
252
 
244
- var Details = function Details(_ref) {
245
- var _splitTransfer$source, _splitTransfer$curren, _splitTransfer$source2, _splitTransfer$curren2, _splitTransfer$curren3, _splitTransfer$curren4, _splitTransfer$destin, _splitTransfer$destin2, _splitTransfer$destin3;
246
- var selectedTransfer = _ref.selectedTransfer,
247
- setSelectedTransfer = _ref.setSelectedTransfer;
248
- var _useTranslation = reactI18next.useTranslation(),
249
- t = _useTranslation.t;
250
- var _useShowSplitTransfer = useShowSplitTransfers(selectedTransfer["id"], {
251
- enabled: neetocist.isPresent(selectedTransfer["id"])
252
- }),
253
- isPending = _useShowSplitTransfer.isPending,
254
- _useShowSplitTransfer2 = _useShowSplitTransfer.data,
255
- _useShowSplitTransfer3 = _useShowSplitTransfer2 === void 0 ? {} : _useShowSplitTransfer2,
256
- splitTransfer = _useShowSplitTransfer3.splitTransfer;
257
- return /*#__PURE__*/React.createElement(neetoui.Pane, {
253
+ const Details = ({
254
+ selectedTransfer,
255
+ setSelectedTransfer
256
+ }) => {
257
+ const {
258
+ t
259
+ } = reactI18next.useTranslation();
260
+ const {
261
+ isPending,
262
+ data: {
263
+ splitTransfer
264
+ } = {}
265
+ } = useShowSplitTransfers(selectedTransfer["id"], {
266
+ enabled: neetocist.isPresent(selectedTransfer["id"])
267
+ });
268
+ return /*#__PURE__*/jsxRuntime.jsxs(neetoui.Pane, {
258
269
  isOpen: selectedTransfer["isPaneOpen"],
259
270
  size: "large",
260
- onClose: function onClose() {
261
- return setSelectedTransfer(ramda.mergeLeft({
262
- isPaneOpen: false
263
- }, selectedTransfer));
264
- }
265
- }, /*#__PURE__*/React.createElement(neetoui.Pane.Header, null, /*#__PURE__*/React.createElement(neetoui.Typography, {
266
- style: "h2"
267
- }, t("neetoPayments.splitTransferDetails.title"))), /*#__PURE__*/React.createElement(neetoui.Pane.Body, null, isPending ? /*#__PURE__*/React.createElement("div", {
268
- className: "flex h-full w-full items-center justify-center"
269
- }, /*#__PURE__*/React.createElement(neetoui.Spinner, null)) : /*#__PURE__*/React.createElement("div", {
270
- className: "space-y-4 p-3"
271
- }, /*#__PURE__*/React.createElement("div", {
272
- className: "flex grid-cols-2 flex-col gap-3 lg:grid"
273
- }, /*#__PURE__*/React.createElement(neetoui.Typography, {
274
- style: "body1",
275
- weight: "medium"
276
- }, t("neetoPayments.common.identifier")), /*#__PURE__*/React.createElement(neetoui.Button, {
277
- href: splitTransfer.transferUrl,
278
- label: splitTransfer.identifier,
279
- size: "small",
280
- style: "link",
281
- target: "_blank"
282
- }), /*#__PURE__*/React.createElement(neetoui.Typography, {
283
- style: "body1",
284
- weight: "medium"
285
- }, t("neetoPayments.common.status")), /*#__PURE__*/React.createElement(Status, {
286
- status: splitTransfer.status,
287
- type: "splitTransfers"
288
- }), /*#__PURE__*/React.createElement(neetoui.Typography, {
289
- style: "body1",
290
- weight: "medium"
291
- }, t("neetoPayments.common.transferTime")), /*#__PURE__*/React.createElement(Date, {
292
- isTimeVisible: true,
293
- date: splitTransfer.paymentAt
294
- }), /*#__PURE__*/React.createElement(neetoui.Typography, {
295
- style: "body1",
296
- weight: "medium"
297
- }, t("neetoPayments.common.paymentAmount")), /*#__PURE__*/React.createElement(neetoui.Typography, {
298
- style: "body2"
299
- }, utils.currencyFormat.withCode((_splitTransfer$source = splitTransfer.sourcePayment) === null || _splitTransfer$source === void 0 ? void 0 : _splitTransfer$source.amount, (_splitTransfer$curren = splitTransfer.currency) === null || _splitTransfer$curren === void 0 ? void 0 : _splitTransfer$curren.toUpperCase())), neetocist.isPresent(splitTransfer.discountCode) && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(neetoui.Typography, {
300
- style: "body1",
301
- weight: "medium"
302
- }, t("neetoPayments.common.discountCode")), /*#__PURE__*/React.createElement(DiscountCode, {
303
- currency: splitTransfer.currency,
304
- discountCode: splitTransfer.discountCode
305
- })), /*#__PURE__*/React.createElement("div", {
306
- className: "flex items-center space-x-1"
307
- }, /*#__PURE__*/React.createElement(neetoui.Typography, {
308
- style: "body1",
309
- weight: "medium"
310
- }, t("neetoPayments.common.netAmount")), /*#__PURE__*/React.createElement(HelpPopover, {
311
- popoverProps: {
312
- position: "right"
313
- },
314
- description: t("neetoPayments.splitTransferDetails.netAmountDescription"),
315
- title: t("neetoPayments.splitTransferDetails.netAmountHelpTitle")
316
- })), /*#__PURE__*/React.createElement(neetoui.Typography, {
317
- style: "body2"
318
- }, utils.currencyFormat.withCode((_splitTransfer$source2 = splitTransfer.sourcePayment) === null || _splitTransfer$source2 === void 0 ? void 0 : _splitTransfer$source2.netAmount, (_splitTransfer$curren2 = splitTransfer.currency) === null || _splitTransfer$curren2 === void 0 ? void 0 : _splitTransfer$curren2.toUpperCase())), /*#__PURE__*/React.createElement("div", {
319
- className: "flex space-x-1"
320
- }, /*#__PURE__*/React.createElement(neetoui.Typography, {
321
- style: "body1",
322
- weight: "medium"
323
- }, t("neetoPayments.common.platformShare")), /*#__PURE__*/React.createElement(HelpPopover, {
324
- popoverProps: {
325
- position: "right"
326
- },
327
- description: t("neetoPayments.splitTransferDetails.platformShareDescription"),
328
- title: t("neetoPayments.splitTransferDetails.platformShareHelpTitle")
329
- })), /*#__PURE__*/React.createElement(neetoui.Typography, {
330
- style: "body2"
331
- }, utils.currencyFormat.withCode(splitTransfer.platformShare, (_splitTransfer$curren3 = splitTransfer.currency) === null || _splitTransfer$curren3 === void 0 ? void 0 : _splitTransfer$curren3.toUpperCase())), /*#__PURE__*/React.createElement(neetoui.Typography, {
332
- style: "body1",
333
- weight: "medium"
334
- }, t("neetoPayments.common.transferredAmount")), /*#__PURE__*/React.createElement(neetoui.Typography, {
335
- style: "body2"
336
- }, utils.currencyFormat.withCode(splitTransfer.amount, (_splitTransfer$curren4 = splitTransfer.currency) === null || _splitTransfer$curren4 === void 0 ? void 0 : _splitTransfer$curren4.toUpperCase()))), /*#__PURE__*/React.createElement(neetoui.Typography, {
337
- style: "h3"
338
- }, t("neetoPayments.splitTransferDetails.destinationDetails")), /*#__PURE__*/React.createElement("div", {
339
- className: "flex grid-cols-2 flex-col gap-3 lg:grid"
340
- }, /*#__PURE__*/React.createElement(neetoui.Typography, {
341
- style: "body1",
342
- weight: "medium"
343
- }, t("neetoPayments.common.destinationAccountIdentifier")), /*#__PURE__*/React.createElement(neetoui.Button, {
344
- href: splitTransfer.destinationAccount.dashboardUrl,
345
- label: splitTransfer.destinationAccount.identifier,
346
- size: "small",
347
- style: "link",
348
- target: "_blank"
349
- }), /*#__PURE__*/React.createElement(neetoui.Typography, {
350
- style: "body1",
351
- weight: "medium"
352
- }, t("neetoPayments.common.destinationAccountName")), /*#__PURE__*/React.createElement(neetoui.Typography, {
353
- style: "body2"
354
- }, splitTransfer.destinationAccount.userName), /*#__PURE__*/React.createElement(neetoui.Typography, {
355
- style: "body1",
356
- weight: "medium"
357
- }, t("neetoPayments.common.destinationAccountEmail")), /*#__PURE__*/React.createElement(neetoui.Typography, {
358
- style: "body2"
359
- }, splitTransfer.destinationAccount.userEmail), /*#__PURE__*/React.createElement(neetoui.Typography, {
360
- style: "body1",
361
- weight: "medium"
362
- }, t("neetoPayments.common.payoutStatus")), /*#__PURE__*/React.createElement(Status, {
363
- status: (_splitTransfer$destin = splitTransfer.destinationPayout) === null || _splitTransfer$destin === void 0 ? void 0 : _splitTransfer$destin.status,
364
- type: "payout"
365
- }), /*#__PURE__*/React.createElement(neetoui.Typography, {
366
- style: "body1",
367
- weight: "medium"
368
- }, t("neetoPayments.splitTransferDetails.payoutInitiatedDate")), /*#__PURE__*/React.createElement(Date, {
369
- date: (_splitTransfer$destin2 = splitTransfer.destinationPayout) === null || _splitTransfer$destin2 === void 0 ? void 0 : _splitTransfer$destin2.createdAt
370
- }), /*#__PURE__*/React.createElement(neetoui.Typography, {
371
- style: "body1",
372
- weight: "medium"
373
- }, t("neetoPayments.splitTransferDetails.payoutArrivalDate")), /*#__PURE__*/React.createElement(Date, {
374
- date: (_splitTransfer$destin3 = splitTransfer.destinationPayout) === null || _splitTransfer$destin3 === void 0 ? void 0 : _splitTransfer$destin3.arrivalDate
375
- }), /*#__PURE__*/React.createElement("div", null)))));
271
+ onClose: () => setSelectedTransfer(ramda.mergeLeft({
272
+ isPaneOpen: false
273
+ }, selectedTransfer)),
274
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Pane.Header, {
275
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
276
+ style: "h2",
277
+ children: t("neetoPayments.splitTransferDetails.title")
278
+ })
279
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Pane.Body, {
280
+ children: isPending ? /*#__PURE__*/jsxRuntime.jsx("div", {
281
+ className: "flex h-full w-full items-center justify-center",
282
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Spinner, {})
283
+ }) : /*#__PURE__*/jsxRuntime.jsxs("div", {
284
+ className: "space-y-4 p-3",
285
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
286
+ className: "flex grid-cols-2 flex-col gap-3 lg:grid",
287
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
288
+ style: "body1",
289
+ weight: "medium",
290
+ children: t("neetoPayments.common.identifier")
291
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Button, {
292
+ href: splitTransfer.transferUrl,
293
+ label: splitTransfer.identifier,
294
+ size: "small",
295
+ style: "link",
296
+ target: "_blank"
297
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
298
+ style: "body1",
299
+ weight: "medium",
300
+ children: t("neetoPayments.common.status")
301
+ }), /*#__PURE__*/jsxRuntime.jsx(Status, {
302
+ status: splitTransfer.status,
303
+ type: "splitTransfers"
304
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
305
+ style: "body1",
306
+ weight: "medium",
307
+ children: t("neetoPayments.common.transferTime")
308
+ }), /*#__PURE__*/jsxRuntime.jsx(Date, {
309
+ isTimeVisible: true,
310
+ date: splitTransfer.paymentAt
311
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
312
+ style: "body1",
313
+ weight: "medium",
314
+ children: t("neetoPayments.common.paymentAmount")
315
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
316
+ style: "body2",
317
+ children: utils.currencyFormat.withCode(splitTransfer.sourcePayment?.amount, splitTransfer.currency?.toUpperCase())
318
+ }), neetocist.isPresent(splitTransfer.discountCode) && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
319
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
320
+ style: "body1",
321
+ weight: "medium",
322
+ children: t("neetoPayments.common.discountCode")
323
+ }), /*#__PURE__*/jsxRuntime.jsx(DiscountCode, {
324
+ currency: splitTransfer.currency,
325
+ discountCode: splitTransfer.discountCode
326
+ })]
327
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
328
+ className: "flex items-center space-x-1",
329
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
330
+ style: "body1",
331
+ weight: "medium",
332
+ children: t("neetoPayments.common.netAmount")
333
+ }), /*#__PURE__*/jsxRuntime.jsx(HelpPopover, {
334
+ popoverProps: {
335
+ position: "right"
336
+ },
337
+ description: t("neetoPayments.splitTransferDetails.netAmountDescription"),
338
+ title: t("neetoPayments.splitTransferDetails.netAmountHelpTitle")
339
+ })]
340
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
341
+ style: "body2",
342
+ children: utils.currencyFormat.withCode(splitTransfer.sourcePayment?.netAmount, splitTransfer.currency?.toUpperCase())
343
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
344
+ className: "flex space-x-1",
345
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
346
+ style: "body1",
347
+ weight: "medium",
348
+ children: t("neetoPayments.common.platformShare")
349
+ }), /*#__PURE__*/jsxRuntime.jsx(HelpPopover, {
350
+ popoverProps: {
351
+ position: "right"
352
+ },
353
+ description: t("neetoPayments.splitTransferDetails.platformShareDescription"),
354
+ title: t("neetoPayments.splitTransferDetails.platformShareHelpTitle")
355
+ })]
356
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
357
+ style: "body2",
358
+ children: utils.currencyFormat.withCode(splitTransfer.platformShare, splitTransfer.currency?.toUpperCase())
359
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
360
+ style: "body1",
361
+ weight: "medium",
362
+ children: t("neetoPayments.common.transferredAmount")
363
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
364
+ style: "body2",
365
+ children: utils.currencyFormat.withCode(splitTransfer.amount, splitTransfer.currency?.toUpperCase())
366
+ })]
367
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
368
+ style: "h3",
369
+ children: t("neetoPayments.splitTransferDetails.destinationDetails")
370
+ }), /*#__PURE__*/jsxRuntime.jsxs("div", {
371
+ className: "flex grid-cols-2 flex-col gap-3 lg:grid",
372
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
373
+ style: "body1",
374
+ weight: "medium",
375
+ children: t("neetoPayments.common.destinationAccountIdentifier")
376
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Button, {
377
+ href: splitTransfer.destinationAccount.dashboardUrl,
378
+ label: splitTransfer.destinationAccount.identifier,
379
+ size: "small",
380
+ style: "link",
381
+ target: "_blank"
382
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
383
+ style: "body1",
384
+ weight: "medium",
385
+ children: t("neetoPayments.common.destinationAccountName")
386
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
387
+ style: "body2",
388
+ children: splitTransfer.destinationAccount.userName
389
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
390
+ style: "body1",
391
+ weight: "medium",
392
+ children: t("neetoPayments.common.destinationAccountEmail")
393
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
394
+ style: "body2",
395
+ children: splitTransfer.destinationAccount.userEmail
396
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
397
+ style: "body1",
398
+ weight: "medium",
399
+ children: t("neetoPayments.common.payoutStatus")
400
+ }), /*#__PURE__*/jsxRuntime.jsx(Status, {
401
+ status: splitTransfer.destinationPayout?.status,
402
+ type: "payout"
403
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
404
+ style: "body1",
405
+ weight: "medium",
406
+ children: t("neetoPayments.splitTransferDetails.payoutInitiatedDate")
407
+ }), /*#__PURE__*/jsxRuntime.jsx(Date, {
408
+ date: splitTransfer.destinationPayout?.createdAt
409
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
410
+ style: "body1",
411
+ weight: "medium",
412
+ children: t("neetoPayments.splitTransferDetails.payoutArrivalDate")
413
+ }), /*#__PURE__*/jsxRuntime.jsx(Date, {
414
+ date: splitTransfer.destinationPayout?.arrivalDate
415
+ }), /*#__PURE__*/jsxRuntime.jsx("div", {})]
416
+ })]
417
+ })
418
+ })]
419
+ });
376
420
  };
377
421
 
378
- var renderIdentifier = ramda.curry(function (setSelectedTransfer, identifier, _ref) {
379
- var id = _ref.id;
422
+ const renderIdentifier = ramda.curry((setSelectedTransfer, identifier, {
423
+ id
424
+ }) => {
380
425
  if (neetocist.isNotPresent(identifier)) {
381
- return /*#__PURE__*/React.createElement(neetoui.Tooltip, {
426
+ return /*#__PURE__*/jsxRuntime.jsx(neetoui.Tooltip, {
382
427
  content: i18next.t("neetoPayments.tooltipContent.identifierUnavailable"),
383
- position: "top"
384
- }, /*#__PURE__*/React.createElement("div", {
385
- className: "text-center"
386
- }, /*#__PURE__*/React.createElement(neetoui.Typography, {
387
- style: "body2"
388
- }, i18next.t("neetoPayments.common.notAvailable"))));
428
+ position: "top",
429
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
430
+ className: "text-center",
431
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
432
+ style: "body2",
433
+ children: i18next.t("neetoPayments.common.notAvailable")
434
+ })
435
+ })
436
+ });
389
437
  }
390
- return /*#__PURE__*/React.createElement(CopyButtonWrapper.CopyButtonWrapper, {
391
- content: identifier
392
- }, /*#__PURE__*/React.createElement(neetoui.Button, {
393
- label: identifier,
394
- size: "small",
395
- style: "link",
396
- onClick: function onClick() {
397
- return setSelectedTransfer({
398
- id: id,
438
+ return /*#__PURE__*/jsxRuntime.jsx(CopyButtonWrapper.CopyButtonWrapper, {
439
+ content: identifier,
440
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Button, {
441
+ label: identifier,
442
+ size: "small",
443
+ style: "link",
444
+ onClick: () => setSelectedTransfer({
445
+ id,
399
446
  isPaneOpen: true
400
- });
401
- }
402
- }));
447
+ })
448
+ })
449
+ });
403
450
  });
404
- var renderPlatformPaymentIdentifier = function renderPlatformPaymentIdentifier(_ref2) {
405
- var identifier = _ref2.identifier,
406
- receiptUrl = _ref2.receiptUrl,
407
- kind = _ref2.kind;
451
+ const renderPlatformPaymentIdentifier = ({
452
+ identifier,
453
+ receiptUrl,
454
+ kind
455
+ }) => {
408
456
  if (kind === constants.PAYMENT_KIND.temporary) {
409
- return /*#__PURE__*/React.createElement(CopyButtonWrapper.CopyButtonWrapper, {
410
- content: identifier
411
- }, identifier);
457
+ return /*#__PURE__*/jsxRuntime.jsx(CopyButtonWrapper.CopyButtonWrapper, {
458
+ content: identifier,
459
+ children: identifier
460
+ });
412
461
  }
413
- return /*#__PURE__*/React.createElement(CopyButtonWrapper.CopyButtonWrapper, {
414
- content: identifier
415
- }, /*#__PURE__*/React.createElement(neetoui.Button, {
416
- href: receiptUrl,
417
- label: identifier,
418
- size: "small",
419
- style: "link",
420
- target: "_blank"
421
- }));
462
+ return /*#__PURE__*/jsxRuntime.jsx(CopyButtonWrapper.CopyButtonWrapper, {
463
+ content: identifier,
464
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Button, {
465
+ href: receiptUrl,
466
+ label: identifier,
467
+ size: "small",
468
+ style: "link",
469
+ target: "_blank"
470
+ })
471
+ });
422
472
  };
423
- var renderDestinationAccountIdentifier = function renderDestinationAccountIdentifier(_ref3) {
424
- var identifier = _ref3.identifier,
425
- dashboardUrl = _ref3.dashboardUrl;
426
- return /*#__PURE__*/React.createElement(CopyButtonWrapper.CopyButtonWrapper, {
427
- content: identifier
428
- }, /*#__PURE__*/React.createElement(neetoui.Button, {
473
+ const renderDestinationAccountIdentifier = ({
474
+ identifier,
475
+ dashboardUrl
476
+ }) => /*#__PURE__*/jsxRuntime.jsx(CopyButtonWrapper.CopyButtonWrapper, {
477
+ content: identifier,
478
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Button, {
429
479
  href: dashboardUrl,
430
480
  label: identifier,
431
481
  size: "small",
432
482
  style: "link",
433
483
  target: "_blank"
434
- }));
435
- };
436
- var renderStatus = ramda.curry(function (type, status) {
437
- return /*#__PURE__*/React.createElement(Status, {
438
- status: status,
439
- type: type
440
- });
484
+ })
441
485
  });
442
- var renderDate = function renderDate(date) {
486
+ const renderStatus = ramda.curry((type, status) => /*#__PURE__*/jsxRuntime.jsx(Status, {
487
+ status,
488
+ type
489
+ }));
490
+ const renderDate = date => {
443
491
  if (neetocist.isNotPresent(date)) {
444
- return /*#__PURE__*/React.createElement(neetoui.Tooltip, {
492
+ return /*#__PURE__*/jsxRuntime.jsx(neetoui.Tooltip, {
445
493
  content: i18next.t("neetoPayments.tooltipContent.dateUnavailable"),
446
- position: "top"
447
- }, /*#__PURE__*/React.createElement("div", {
448
- className: "text-center"
449
- }, /*#__PURE__*/React.createElement(neetoui.Typography, {
450
- style: "body2"
451
- }, i18next.t("neetoPayments.common.notAvailable"))));
494
+ position: "top",
495
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
496
+ className: "text-center",
497
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
498
+ style: "body2",
499
+ children: i18next.t("neetoPayments.common.notAvailable")
500
+ })
501
+ })
502
+ });
452
503
  }
453
- return /*#__PURE__*/React.createElement(DateFormat.DateTime, {
454
- date: date
504
+ return /*#__PURE__*/jsxRuntime.jsx(DateFormat.DateTime, {
505
+ date
455
506
  });
456
507
  };
457
- var renderPlatformShare = function renderPlatformShare(amount) {
508
+ const renderPlatformShare = amount => {
458
509
  if (neetocist.isNotPresent(amount)) {
459
- return /*#__PURE__*/React.createElement(neetoui.Tooltip, {
510
+ return /*#__PURE__*/jsxRuntime.jsx(neetoui.Tooltip, {
460
511
  content: i18next.t("neetoPayments.tooltipContent.platformShareUnavailable"),
461
- position: "top"
462
- }, /*#__PURE__*/React.createElement(neetoui.Typography, {
463
- style: "body2"
464
- }, i18next.t("neetoPayments.common.notCalculated")));
512
+ position: "top",
513
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
514
+ style: "body2",
515
+ children: i18next.t("neetoPayments.common.notCalculated")
516
+ })
517
+ });
465
518
  }
466
519
  return constants.formatAmount(amount);
467
520
  };
468
- var getDefaultColumns = function getDefaultColumns(setSelectedTransfer) {
469
- return [{
470
- title: i18next.t("neetoPayments.common.id"),
471
- dataIndex: "rowId",
472
- key: "rowId",
473
- width: 85,
474
- position: 0,
475
- isHidable: false
476
- }, {
477
- title: i18next.t("neetoPayments.common.identifier"),
478
- dataIndex: "identifier",
479
- key: "identifier",
480
- width: 300,
481
- render: renderIdentifier(setSelectedTransfer),
482
- position: 1,
483
- isHidable: false
484
- }, {
485
- title: i18next.t("neetoPayments.common.status"),
486
- dataIndex: "status",
487
- key: "status",
488
- width: 150,
489
- render: renderStatus("splitTransfers"),
490
- sorter: true,
491
- position: 2,
492
- isHidable: false
493
- }, {
494
- title: i18next.t("neetoPayments.common.amount"),
495
- dataIndex: "amount",
496
- key: "amount",
497
- width: 150,
498
- sorter: true,
499
- render: constants.formatAmount,
500
- position: 3
501
- }, {
502
- title: i18next.t("neetoPayments.common.currency"),
503
- dataIndex: "currency",
504
- key: "currency",
505
- width: 160,
506
- sorter: true,
507
- render: constants.formatCurrency,
508
- position: 3
509
- }, {
510
- title: i18next.t("neetoPayments.common.platformShare"),
511
- dataIndex: "platformShare",
512
- key: "platformShare",
513
- width: 205,
514
- render: renderPlatformShare,
515
- sorter: true,
516
- position: 3
517
- }, {
518
- title: i18next.t("neetoPayments.common.transferTime"),
519
- dataIndex: "paymentAt",
520
- key: "paymentAt",
521
- width: 190,
522
- render: renderDate,
523
- sorter: true,
524
- position: 10
525
- }, {
526
- title: i18next.t("neetoPayments.common.platformPayment"),
527
- dataIndex: "sourcePayment",
528
- key: "sourcePayment",
529
- render: renderPlatformPaymentIdentifier,
530
- width: 300,
531
- position: 19
532
- }, {
533
- title: i18next.t("neetoPayments.common.accountIdentifier"),
534
- dataIndex: "destinationAccount",
535
- key: "destinationAccount",
536
- render: renderDestinationAccountIdentifier,
537
- width: 320,
538
- position: 20
539
- }];
540
- };
521
+ const getDefaultColumns = setSelectedTransfer => [{
522
+ title: i18next.t("neetoPayments.common.id"),
523
+ dataIndex: "rowId",
524
+ key: "rowId",
525
+ width: 85,
526
+ position: 0,
527
+ isHidable: false
528
+ }, {
529
+ title: i18next.t("neetoPayments.common.identifier"),
530
+ dataIndex: "identifier",
531
+ key: "identifier",
532
+ width: 300,
533
+ render: renderIdentifier(setSelectedTransfer),
534
+ position: 1,
535
+ isHidable: false
536
+ }, {
537
+ title: i18next.t("neetoPayments.common.status"),
538
+ dataIndex: "status",
539
+ key: "status",
540
+ width: 150,
541
+ render: renderStatus("splitTransfers"),
542
+ sorter: true,
543
+ position: 2,
544
+ isHidable: false
545
+ }, {
546
+ title: i18next.t("neetoPayments.common.amount"),
547
+ dataIndex: "amount",
548
+ key: "amount",
549
+ width: 150,
550
+ sorter: true,
551
+ render: constants.formatAmount,
552
+ position: 3
553
+ }, {
554
+ title: i18next.t("neetoPayments.common.currency"),
555
+ dataIndex: "currency",
556
+ key: "currency",
557
+ width: 160,
558
+ sorter: true,
559
+ render: constants.formatCurrency,
560
+ position: 3
561
+ }, {
562
+ title: i18next.t("neetoPayments.common.platformShare"),
563
+ dataIndex: "platformShare",
564
+ key: "platformShare",
565
+ width: 205,
566
+ render: renderPlatformShare,
567
+ sorter: true,
568
+ position: 3
569
+ }, {
570
+ title: i18next.t("neetoPayments.common.transferTime"),
571
+ dataIndex: "paymentAt",
572
+ key: "paymentAt",
573
+ width: 190,
574
+ render: renderDate,
575
+ sorter: true,
576
+ position: 10
577
+ }, {
578
+ title: i18next.t("neetoPayments.common.platformPayment"),
579
+ dataIndex: "sourcePayment",
580
+ key: "sourcePayment",
581
+ render: renderPlatformPaymentIdentifier,
582
+ width: 300,
583
+ position: 19
584
+ }, {
585
+ title: i18next.t("neetoPayments.common.accountIdentifier"),
586
+ dataIndex: "destinationAccount",
587
+ key: "destinationAccount",
588
+ render: renderDestinationAccountIdentifier,
589
+ width: 320,
590
+ position: 20
591
+ }];
541
592
 
542
- function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
543
- function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
544
- var buildSearchProps = function buildSearchProps(searchProps, searchTerm) {
545
- return ramda.mergeDeepWith(ramda.concat, SEARCH_PROPS, ramda.mergeLeft({
546
- value: searchTerm.trim()
547
- }, searchProps));
548
- };
549
- var buildFilterColumns = function buildFilterColumns() {
550
- var payableEntityColumns = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
551
- return ramda.reject(ramda.isNil, ramda.concat(FILTER_COLUMNS, ramda.map(ramda.prop("filterProps"), payableEntityColumns)));
552
- };
553
- var buildTableColumns = function buildTableColumns(_ref) {
554
- var tab = _ref.tab,
555
- _ref$payableEntityCol = _ref.payableEntityColumns,
556
- payableEntityColumns = _ref$payableEntityCol === void 0 ? [] : _ref$payableEntityCol,
557
- setSelectedTransfer = _ref.setSelectedTransfer;
558
- var filteredColumns = ramda.sortBy(ramda.prop("position"), ramda.concat(getDefaultColumns(setSelectedTransfer), payableEntityColumns));
593
+ const buildSearchProps = (searchProps, searchTerm) => ramda.mergeDeepWith(ramda.concat, SEARCH_PROPS, ramda.mergeLeft({
594
+ value: searchTerm.trim()
595
+ }, searchProps));
596
+ const buildFilterColumns = (payableEntityColumns = []) => ramda.reject(ramda.isNil, ramda.concat(FILTER_COLUMNS, ramda.map(ramda.prop("filterProps"), payableEntityColumns)));
597
+ const buildTableColumns = ({
598
+ tab,
599
+ payableEntityColumns = [],
600
+ setSelectedTransfer
601
+ }) => {
602
+ const filteredColumns = ramda.sortBy(ramda.prop("position"), ramda.concat(getDefaultColumns(setSelectedTransfer), payableEntityColumns));
559
603
  if (tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all) return filteredColumns;
560
604
  return neetocist.removeBy({
561
605
  key: "status"
562
606
  }, filteredColumns);
563
607
  };
564
- var buildRowData = function buildRowData(_ref2) {
565
- var splitTransfers = _ref2.splitTransfers,
566
- _ref2$pageProperties = _ref2.pageProperties,
567
- pageProperties = _ref2$pageProperties === void 0 ? {} : _ref2$pageProperties;
568
- return splitTransfers === null || splitTransfers === void 0 ? void 0 : splitTransfers.map(function (element, index) {
569
- return _objectSpread$1(_objectSpread$1({}, element), {}, {
570
- rowId: ramda.isEmpty(pageProperties) ? index + 1 : pageProperties.pageSize * (pageProperties.page - 1) + index + 1
571
- });
572
- });
573
- };
608
+ const buildRowData = ({
609
+ splitTransfers,
610
+ pageProperties = {}
611
+ }) => splitTransfers?.map((element, index) => ({
612
+ ...element,
613
+ rowId: ramda.isEmpty(pageProperties) ? index + 1 : pageProperties.pageSize * (pageProperties.page - 1) + index + 1
614
+ }));
574
615
 
575
- var List = function List(_ref) {
576
- var isFetching = _ref.isFetching,
577
- splitTransfers = _ref.splitTransfers,
578
- selectedRows = _ref.selectedRows,
579
- views = _ref.views,
580
- payableEntityColumns = _ref.payableEntityColumns,
581
- pageProperties = _ref.pageProperties,
582
- onRowSelect = _ref.onRowSelect,
583
- setSortProperties = _ref.setSortProperties,
584
- handleTablePagination = _ref.handleTablePagination,
585
- setHasBulkSelectedAllRows = _ref.setHasBulkSelectedAllRows;
586
- var _useState = react.useState(INITIAL_TRANSFER_DETAILS),
587
- _useState2 = _slicedToArray(_useState, 2),
588
- selectedTransfer = _useState2[0],
589
- setSelectedTransfer = _useState2[1];
590
- var _useTranslation = reactI18next.useTranslation(),
591
- t = _useTranslation.t;
592
- var _getQueryParams = utils.getQueryParams(),
593
- _getQueryParams$tab = _getQueryParams.tab,
594
- tab = _getQueryParams$tab === void 0 ? SPLIT_TRANSFERS_DASHBOARD_TAB.all : _getQueryParams$tab;
595
- var splitTransfersCount = views[tab];
596
- var getRowSelection = function getRowSelection() {
616
+ const List = ({
617
+ isFetching,
618
+ splitTransfers,
619
+ selectedRows,
620
+ views,
621
+ payableEntityColumns,
622
+ pageProperties,
623
+ onRowSelect,
624
+ setSortProperties,
625
+ handleTablePagination,
626
+ setHasBulkSelectedAllRows
627
+ }) => {
628
+ const [selectedTransfer, setSelectedTransfer] = react.useState(INITIAL_TRANSFER_DETAILS);
629
+ const {
630
+ t
631
+ } = reactI18next.useTranslation();
632
+ const {
633
+ tab = SPLIT_TRANSFERS_DASHBOARD_TAB.all
634
+ } = utils.getQueryParams();
635
+ const splitTransfersCount = views[tab];
636
+ const getRowSelection = () => {
597
637
  if (tab === SPLIT_TRANSFERS_DASHBOARD_TAB.successful) return false;
598
638
  if (tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all) {
599
639
  return {
600
- getCheckboxProps: function getCheckboxProps(record) {
601
- return {
602
- disabled: record.status === SPLIT_TRANSFERS_DASHBOARD_TAB.successful
603
- };
604
- }
640
+ getCheckboxProps: record => ({
641
+ disabled: record.status === SPLIT_TRANSFERS_DASHBOARD_TAB.successful
642
+ })
605
643
  };
606
644
  }
607
645
  return true;
608
646
  };
609
- var allColumns = buildTableColumns({
610
- tab: tab,
611
- payableEntityColumns: payableEntityColumns,
612
- setSelectedTransfer: setSelectedTransfer
647
+ const allColumns = buildTableColumns({
648
+ tab,
649
+ payableEntityColumns,
650
+ setSelectedTransfer
613
651
  });
614
- var _useTableConfiguratio = Columns.useTableConfigurations("".concat(exportChannel.TABLE_KEYS.SPLIT_TRANSFERS_TABLE, "-").concat(tab), allColumns),
615
- isTableConfigurationLoading = _useTableConfiguratio.isTableConfigurationLoading,
616
- customizedColumns = _useTableConfiguratio.customizedColumns,
617
- hideColumn = _useTableConfiguratio.hideColumn;
618
- var handleTableChange = function handleTableChange(_, __, sorter) {
619
- setSortProperties(neetocist.isPresent(sorter === null || sorter === void 0 ? void 0 : sorter.column) ? {
652
+ const {
653
+ isTableConfigurationLoading,
654
+ customizedColumns,
655
+ hideColumn
656
+ } = Columns.useTableConfigurations(`${exportChannel.TABLE_KEYS.SPLIT_TRANSFERS_TABLE}-${tab}`, allColumns);
657
+ const handleTableChange = (_, __, sorter) => {
658
+ setSortProperties(neetocist.isPresent(sorter?.column) ? {
620
659
  sortBy: neetocist.camelToSnakeCase(constants.processDataIndex(sorter.field)),
621
660
  orderBy: sorter.order === "ascend" ? "ASC" : "DESC"
622
661
  } : constants.DEFAULT_SORT_PROPERTIES);
623
662
  };
624
663
  if (neetocist.isNotPresent(splitTransfers)) {
625
- return /*#__PURE__*/React.createElement("div", {
626
- className: "flex h-full w-full items-center justify-center"
627
- }, /*#__PURE__*/React.createElement(neetoui.NoData, {
628
- title: tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all ? t("neetoPayments.emptyState.splitTransfers") : t("neetoPayments.emptyState.splitTransfersWithStatus", {
629
- status: tab
664
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
665
+ className: "flex h-full w-full items-center justify-center",
666
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.NoData, {
667
+ title: tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all ? t("neetoPayments.emptyState.splitTransfers") : t("neetoPayments.emptyState.splitTransfersWithStatus", {
668
+ status: tab
669
+ })
630
670
  })
631
- }));
671
+ });
632
672
  }
633
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TableWrapper, {
634
- hasPagination: splitTransfersCount > (pageProperties === null || pageProperties === void 0 ? void 0 : pageProperties.pageSize)
635
- }, /*#__PURE__*/React.createElement(neetoui.Table, {
636
- onRowSelect: onRowSelect,
637
- fixedHeight: true,
638
- allowRowClick: false,
639
- columnData: customizedColumns,
640
- currentPageNumber: pageProperties === null || pageProperties === void 0 ? void 0 : pageProperties.page,
641
- handlePageChange: handleTablePagination,
642
- loading: isFetching || isTableConfigurationLoading,
643
- rowData: buildRowData({
644
- splitTransfers: splitTransfers,
645
- pageProperties: pageProperties,
646
- tab: tab
647
- }),
648
- rowSelection: getRowSelection(),
649
- selectedRowKeys: selectedRows,
650
- sortDirections: constants.SORT_DIRECTIONS,
651
- totalCount: splitTransfersCount,
652
- bulkSelectAllRowsProps: {
653
- selectAllRowMessage: t("neetoPayments.splitTransferDetails.selectedSplitTransfers", {
654
- count: selectedRows.length
655
- }),
656
- selectAllRowButtonLabel: t("neetoPayments.splitTransferDetails.selectAll", {
657
- count: views[SPLIT_TRANSFERS_DASHBOARD_TAB.pending]
658
- }),
659
- setBulkSelectedAllRows: setHasBulkSelectedAllRows
660
- },
661
- paginationProps: {
662
- showSizeChanger: true,
663
- hideOnSinglePage: true,
664
- pageSize: pageProperties === null || pageProperties === void 0 ? void 0 : pageProperties.pageSize,
665
- total: splitTransfersCount
666
- },
667
- onChange: handleTableChange,
668
- onColumnHide: function onColumnHide(_ref2) {
669
- var key = _ref2.key;
670
- return hideColumn(key);
671
- }
672
- })), /*#__PURE__*/React.createElement(Details, {
673
- selectedTransfer: selectedTransfer,
674
- setSelectedTransfer: setSelectedTransfer
675
- }));
673
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
674
+ children: [/*#__PURE__*/jsxRuntime.jsx(TableWrapper, {
675
+ hasPagination: splitTransfersCount > pageProperties?.pageSize,
676
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Table, {
677
+ onRowSelect,
678
+ fixedHeight: true,
679
+ allowRowClick: false,
680
+ columnData: customizedColumns,
681
+ currentPageNumber: pageProperties?.page,
682
+ handlePageChange: handleTablePagination,
683
+ loading: isFetching || isTableConfigurationLoading,
684
+ rowData: buildRowData({
685
+ splitTransfers,
686
+ pageProperties,
687
+ tab
688
+ }),
689
+ rowSelection: getRowSelection(),
690
+ selectedRowKeys: selectedRows,
691
+ sortDirections: constants.SORT_DIRECTIONS,
692
+ totalCount: splitTransfersCount,
693
+ bulkSelectAllRowsProps: {
694
+ selectAllRowMessage: t("neetoPayments.splitTransferDetails.selectedSplitTransfers", {
695
+ count: selectedRows.length
696
+ }),
697
+ selectAllRowButtonLabel: t("neetoPayments.splitTransferDetails.selectAll", {
698
+ count: views[SPLIT_TRANSFERS_DASHBOARD_TAB.pending]
699
+ }),
700
+ setBulkSelectedAllRows: setHasBulkSelectedAllRows
701
+ },
702
+ paginationProps: {
703
+ showSizeChanger: true,
704
+ hideOnSinglePage: true,
705
+ pageSize: pageProperties?.pageSize,
706
+ total: splitTransfersCount
707
+ },
708
+ onChange: handleTableChange,
709
+ onColumnHide: ({
710
+ key
711
+ }) => hideColumn(key)
712
+ })
713
+ }), /*#__PURE__*/jsxRuntime.jsx(Details, {
714
+ selectedTransfer,
715
+ setSelectedTransfer
716
+ })]
717
+ });
676
718
  };
677
719
 
678
- var ResumeModal = function ResumeModal(_ref) {
679
- var isOpen = _ref.isOpen,
680
- onClose = _ref.onClose,
681
- handleSplitTransfersUpdate = _ref.handleSplitTransfersUpdate;
682
- var _useTranslation = reactI18next.useTranslation(),
683
- t = _useTranslation.t;
684
- var handleSubmit = function handleSubmit(_ref2) {
685
- var reason = _ref2.reason;
720
+ const ResumeModal = ({
721
+ isOpen,
722
+ onClose,
723
+ handleSplitTransfersUpdate
724
+ }) => {
725
+ const {
726
+ t
727
+ } = reactI18next.useTranslation();
728
+ const handleSubmit = ({
729
+ reason
730
+ }) => {
686
731
  handleSplitTransfersUpdate("pending", reason);
687
732
  };
688
- return /*#__PURE__*/React.createElement(neetoui.Modal, {
689
- isOpen: isOpen,
690
- onClose: onClose,
691
- size: "large"
692
- }, /*#__PURE__*/React.createElement(neetoui.Modal.Header, null, /*#__PURE__*/React.createElement(neetoui.Typography, {
693
- style: "h2",
694
- weight: "medium"
695
- }, t("neetoPayments.resumeSplitTransfers.modal.title"))), /*#__PURE__*/React.createElement(formik.Form, {
696
- formikProps: {
697
- initialValues: {
698
- reason: ""
733
+ return /*#__PURE__*/jsxRuntime.jsxs(neetoui.Modal, {
734
+ isOpen,
735
+ onClose,
736
+ size: "large",
737
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Modal.Header, {
738
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
739
+ style: "h2",
740
+ weight: "medium",
741
+ children: t("neetoPayments.resumeSplitTransfers.modal.title")
742
+ })
743
+ }), /*#__PURE__*/jsxRuntime.jsx(formik.Form, {
744
+ formikProps: {
745
+ initialValues: {
746
+ reason: ""
747
+ },
748
+ validationSchema: VALIDATION_SCHEMA,
749
+ onSubmit: handleSubmit
699
750
  },
700
- validationSchema: VALIDATION_SCHEMA,
701
- onSubmit: handleSubmit
702
- }
703
- }, /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(neetoui.Modal.Body, null, /*#__PURE__*/React.createElement("div", {
704
- className: "flex flex-col space-y-4"
705
- }, /*#__PURE__*/React.createElement(formik.Textarea, {
706
- required: true,
707
- label: t("neetoPayments.resumeSplitTransfers.modal.reason"),
708
- name: "reason"
709
- }))), /*#__PURE__*/React.createElement(neetoui.Modal.Footer, null, /*#__PURE__*/React.createElement(formik.ActionBlock, {
710
- position: "right",
711
- cancelButtonProps: {
712
- onClick: onClose,
713
- style: "tertiary"
714
- },
715
- submitButtonProps: {
716
- disabled: false,
717
- label: t("neetoPayments.common.submit")
718
- }
719
- })))));
751
+ children: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
752
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Modal.Body, {
753
+ children: /*#__PURE__*/jsxRuntime.jsx("div", {
754
+ className: "flex flex-col space-y-4",
755
+ children: /*#__PURE__*/jsxRuntime.jsx(formik.Textarea, {
756
+ required: true,
757
+ label: t("neetoPayments.resumeSplitTransfers.modal.reason"),
758
+ name: "reason"
759
+ })
760
+ })
761
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoui.Modal.Footer, {
762
+ children: /*#__PURE__*/jsxRuntime.jsx(formik.ActionBlock, {
763
+ position: "right",
764
+ cancelButtonProps: {
765
+ onClick: onClose,
766
+ style: "tertiary"
767
+ },
768
+ submitButtonProps: {
769
+ disabled: false,
770
+ label: t("neetoPayments.common.submit")
771
+ }
772
+ })
773
+ })]
774
+ })
775
+ })]
776
+ });
720
777
  };
721
778
 
722
- var Menu = neetoui.Dropdown.Menu,
723
- MenuItem = neetoui.Dropdown.MenuItem;
724
- var TopSection = function TopSection(_ref) {
725
- var views = _ref.views,
726
- filters = _ref.filters,
727
- setIsCancelModalOpen = _ref.setIsCancelModalOpen,
728
- setIsResumeModalOpen = _ref.setIsResumeModalOpen,
729
- selectedRows = _ref.selectedRows,
730
- selectedRowData = _ref.selectedRowData,
731
- setFilters = _ref.setFilters,
732
- hasBulkSelectedAllRows = _ref.hasBulkSelectedAllRows,
733
- filterableColumns = _ref.filterableColumns,
734
- searchKeywordProps = _ref.searchKeywordProps,
735
- payableEntityColumns = _ref.payableEntityColumns,
736
- setIsExportModalOpen = _ref.setIsExportModalOpen;
737
- var _useState = react.useState(false),
738
- _useState2 = _slicedToArray(_useState, 2),
739
- isFilterPaneOpen = _useState2[0],
740
- setIsFilterPaneOpen = _useState2[1];
741
- var _useTranslation = reactI18next.useTranslation(),
742
- t = _useTranslation.t;
743
- var history = reactRouterDom.useHistory();
744
- var _getQueryParams = utils.getQueryParams(),
745
- _getQueryParams$tab = _getQueryParams.tab,
746
- tab = _getQueryParams$tab === void 0 ? SPLIT_TRANSFERS_DASHBOARD_TAB.all : _getQueryParams$tab;
747
- var splitTransfersCount = views === null || views === void 0 ? void 0 : views[tab];
748
- var splitTransfersCountVisible = splitTransfersCount > 0 || splitTransfersCount === 0 && neetocist.isPresent(filters);
749
- var isFilterButtonVisible = splitTransfersCount || neetocist.isPresent(filters);
750
- var isDropdownVisible = neetocist.isNotEmpty(selectedRows);
751
- var isCancelButtonDisabled = neetocist.existsBy({
779
+ const {
780
+ Menu,
781
+ MenuItem
782
+ } = neetoui.Dropdown;
783
+ const TopSection = ({
784
+ views,
785
+ filters,
786
+ setIsCancelModalOpen,
787
+ setIsResumeModalOpen,
788
+ selectedRows,
789
+ selectedRowData,
790
+ setFilters,
791
+ hasBulkSelectedAllRows,
792
+ filterableColumns,
793
+ searchKeywordProps,
794
+ payableEntityColumns,
795
+ setIsExportModalOpen
796
+ }) => {
797
+ const [isFilterPaneOpen, setIsFilterPaneOpen] = react.useState(false);
798
+ const {
799
+ t
800
+ } = reactI18next.useTranslation();
801
+ const history = reactRouterDom.useHistory();
802
+ const {
803
+ tab = SPLIT_TRANSFERS_DASHBOARD_TAB.all
804
+ } = utils.getQueryParams();
805
+ const splitTransfersCount = views?.[tab];
806
+ const splitTransfersCountVisible = splitTransfersCount > 0 || splitTransfersCount === 0 && neetocist.isPresent(filters);
807
+ const isFilterButtonVisible = splitTransfersCount || neetocist.isPresent(filters);
808
+ const isDropdownVisible = neetocist.isNotEmpty(selectedRows);
809
+ const isCancelButtonDisabled = neetocist.existsBy({
752
810
  status: SPLIT_TRANSFERS_DASHBOARD_TAB.cancelled
753
811
  }, selectedRowData);
754
- var isResumeButtonDisabled = neetocist.existsBy({
812
+ const isResumeButtonDisabled = neetocist.existsBy({
755
813
  status: SPLIT_TRANSFERS_DASHBOARD_TAB.pending
756
814
  }, selectedRowData);
757
- var selectedRecordsCount = hasBulkSelectedAllRows ? splitTransfersCount : selectedRows.length;
758
- var handleFiltersChange = function handleFiltersChange(filters) {
759
- react.startTransition(function () {
815
+ const selectedRecordsCount = hasBulkSelectedAllRows ? splitTransfersCount : selectedRows.length;
816
+ const handleFiltersChange = filters => {
817
+ react.startTransition(() => {
760
818
  setFilters(filters);
761
819
  });
762
820
  };
763
- var handleTabChange = function handleTabChange(tab) {
764
- var queryParams = utils.getQueryParams({
821
+ const handleTabChange = tab => {
822
+ const queryParams = utils.getQueryParams({
765
823
  toCamelCase: false
766
824
  });
767
- var newParams = {
768
- tab: tab,
825
+ const newParams = {
826
+ tab,
769
827
  page: constants$1.DEFAULT_PAGE_INDEX,
770
828
  page_size: constants$1.DEFAULT_PAGE_SIZE
771
829
  };
772
830
  history.push(utils.buildUrl(window.location.pathname, ramda.mergeLeft(newParams, queryParams)));
773
831
  };
774
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Header, {
775
- title: t("neetoPayments.title.splitTransfers"),
776
- searchProps: isFilterButtonVisible && {
777
- placeholder: searchKeywordProps.placeholder,
778
- className: "w-96"
779
- }
780
- }), constants.shouldTabsVisible(views) && /*#__PURE__*/React.createElement(neetoui.Tab, null, Object.keys(SPLIT_TRANSFERS_DASHBOARD_TAB).map(function (item) {
781
- return /*#__PURE__*/React.createElement(neetoui.Tab.Item, {
782
- active: tab === item,
783
- key: item,
784
- onClick: function onClick() {
785
- return handleTabChange(item);
832
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
833
+ children: [/*#__PURE__*/jsxRuntime.jsx(Header, {
834
+ title: t("neetoPayments.title.splitTransfers"),
835
+ searchProps: isFilterButtonVisible && {
836
+ placeholder: searchKeywordProps.placeholder,
837
+ className: "w-96"
786
838
  }
787
- }, t("neetoPayments.common.".concat(item)));
788
- })), /*#__PURE__*/React.createElement(SubHeader, {
789
- className: "my-4",
790
- leftActionBlock: splitTransfersCountVisible && /*#__PURE__*/React.createElement("div", {
791
- className: "w-100 flex items-center space-x-3"
792
- }, isDropdownVisible ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(neetoui.Typography, {
793
- className: "neeto-ui-gray-800 me-2 font-semibold",
794
- component: "h4"
795
- }, /*#__PURE__*/React.createElement(reactI18next.Trans, {
796
- count: selectedRecordsCount,
797
- i18nKey: "neetoPayments.splitTransferDetails.recordWithCount",
798
- components: {
799
- span: /*#__PURE__*/React.createElement("span", {
800
- className: "neeto-ui-text-gray-600"
839
+ }), constants.shouldTabsVisible(views) && /*#__PURE__*/jsxRuntime.jsx(neetoui.Tab, {
840
+ children: Object.keys(SPLIT_TRANSFERS_DASHBOARD_TAB).map(item => /*#__PURE__*/jsxRuntime.jsx(neetoui.Tab.Item, {
841
+ active: tab === item,
842
+ onClick: () => handleTabChange(item),
843
+ children: t(`neetoPayments.common.${item}`)
844
+ }, item))
845
+ }), /*#__PURE__*/jsxRuntime.jsx(SubHeader, {
846
+ className: "my-4",
847
+ leftActionBlock: splitTransfersCountVisible && /*#__PURE__*/jsxRuntime.jsx("div", {
848
+ className: "w-100 flex items-center space-x-3",
849
+ children: isDropdownVisible ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
850
+ children: [/*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
851
+ className: "neeto-ui-gray-800 me-2 font-semibold",
852
+ component: "h4",
853
+ children: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, {
854
+ count: selectedRecordsCount,
855
+ i18nKey: "neetoPayments.splitTransferDetails.recordWithCount",
856
+ components: {
857
+ span: /*#__PURE__*/jsxRuntime.jsx("span", {
858
+ className: "neeto-ui-text-gray-600"
859
+ })
860
+ },
861
+ values: {
862
+ count: selectedRecordsCount,
863
+ recordsCount: splitTransfersCount
864
+ }
865
+ })
866
+ }), /*#__PURE__*/jsxRuntime.jsxs(neetoui.Dropdown, {
867
+ buttonStyle: "secondary",
868
+ label: t("neetoPayments.common.takeAction"),
869
+ children: [/*#__PURE__*/jsxRuntime.jsx(Menu, {
870
+ children: /*#__PURE__*/jsxRuntime.jsx(MenuItem.Button, {
871
+ isDisabled: isCancelButtonDisabled,
872
+ tooltipProps: isCancelButtonDisabled ? {
873
+ content: t("neetoPayments.tooltipContent.splitTransfers.cancelledRecordsSelected")
874
+ } : "",
875
+ onClick: () => setIsCancelModalOpen(true),
876
+ children: t("neetoPayments.common.cancel")
877
+ })
878
+ }), /*#__PURE__*/jsxRuntime.jsx(Menu, {
879
+ children: /*#__PURE__*/jsxRuntime.jsx(MenuItem.Button, {
880
+ isDisabled: isResumeButtonDisabled,
881
+ tooltipProps: isResumeButtonDisabled ? {
882
+ content: t("neetoPayments.tooltipContent.splitTransfers.pendingRecordsSelected")
883
+ } : "",
884
+ onClick: () => setIsResumeModalOpen(true),
885
+ children: t("neetoPayments.common.resume")
886
+ })
887
+ })]
888
+ })]
889
+ }) : /*#__PURE__*/jsxRuntime.jsx(neetoui.Typography, {
890
+ className: "neeto-ui-gray-800 me-2 font-semibold",
891
+ component: "h4",
892
+ children: tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all ? t("neetoPayments.countOf.splitTransfer", {
893
+ count: splitTransfersCount
894
+ }) : t("neetoPayments.countOf.splitTransferWithStatus", {
895
+ count: splitTransfersCount,
896
+ status: tab
897
+ })
801
898
  })
802
- },
803
- values: {
804
- count: selectedRecordsCount,
805
- recordsCount: splitTransfersCount
806
- }
807
- })), /*#__PURE__*/React.createElement(neetoui.Dropdown, {
808
- buttonStyle: "secondary",
809
- label: t("neetoPayments.common.takeAction")
810
- }, /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(MenuItem.Button, {
811
- isDisabled: isCancelButtonDisabled,
812
- tooltipProps: isCancelButtonDisabled ? {
813
- content: t("neetoPayments.tooltipContent.splitTransfers.cancelledRecordsSelected")
814
- } : "",
815
- onClick: function onClick() {
816
- return setIsCancelModalOpen(true);
817
- }
818
- }, t("neetoPayments.common.cancel"))), /*#__PURE__*/React.createElement(Menu, null, /*#__PURE__*/React.createElement(MenuItem.Button, {
819
- isDisabled: isResumeButtonDisabled,
820
- tooltipProps: isResumeButtonDisabled ? {
821
- content: t("neetoPayments.tooltipContent.splitTransfers.pendingRecordsSelected")
822
- } : "",
823
- onClick: function onClick() {
824
- return setIsResumeModalOpen(true);
825
- }
826
- }, t("neetoPayments.common.resume"))))) : /*#__PURE__*/React.createElement(neetoui.Typography, {
827
- className: "neeto-ui-gray-800 me-2 font-semibold",
828
- component: "h4"
829
- }, tab === SPLIT_TRANSFERS_DASHBOARD_TAB.all ? t("neetoPayments.countOf.splitTransfer", {
830
- count: splitTransfersCount
831
- }) : t("neetoPayments.countOf.splitTransferWithStatus", {
832
- count: splitTransfersCount,
833
- status: tab
834
- }))),
835
- rightActionBlock: isFilterButtonVisible && /*#__PURE__*/React.createElement(SubHeader.RightBlock, {
836
- columnsButtonProps: {
837
- columnData: buildTableColumns({
838
- tab: tab,
839
- payableEntityColumns: payableEntityColumns,
840
- setSelectedTransfer: function setSelectedTransfer() {}
841
- }).map(ramda.modify("dataIndex", constants.processDataIndex)),
842
- fixedColumns: constants.UN_HIDEABLE_COLUMNS,
843
- tableKey: "".concat(exportChannel.TABLE_KEYS.SPLIT_TRANSFERS_TABLE, "-").concat(tab)
844
- },
845
- downloadButtonProps: {
846
- onClick: function onClick() {
847
- return setIsExportModalOpen(true);
899
+ }),
900
+ rightActionBlock: isFilterButtonVisible && /*#__PURE__*/jsxRuntime.jsx(SubHeader.RightBlock, {
901
+ columnsButtonProps: {
902
+ columnData: buildTableColumns({
903
+ tab,
904
+ payableEntityColumns,
905
+ setSelectedTransfer: () => {}
906
+ }).map(ramda.modify("dataIndex", constants.processDataIndex)),
907
+ fixedColumns: constants.UN_HIDEABLE_COLUMNS,
908
+ tableKey: `${exportChannel.TABLE_KEYS.SPLIT_TRANSFERS_TABLE}-${tab}`
909
+ },
910
+ downloadButtonProps: {
911
+ onClick: () => setIsExportModalOpen(true)
912
+ },
913
+ filterProps: {
914
+ columns: filterableColumns,
915
+ isOpen: isFilterPaneOpen,
916
+ keyword: searchKeywordProps,
917
+ setIsOpen: setIsFilterPaneOpen,
918
+ onChange: handleFiltersChange
848
919
  }
849
- },
850
- filterProps: {
851
- columns: filterableColumns,
852
- isOpen: isFilterPaneOpen,
853
- keyword: searchKeywordProps,
854
- setIsOpen: setIsFilterPaneOpen,
855
- onChange: handleFiltersChange
856
- }
857
- })
858
- }), /*#__PURE__*/React.createElement(neetoFiltersFrontend.Bar, {
859
- columns: filterableColumns,
860
- keyword: searchKeywordProps,
861
- setIsPaneOpen: setIsFilterPaneOpen,
862
- onChange: handleFiltersChange
863
- }));
920
+ })
921
+ }), /*#__PURE__*/jsxRuntime.jsx(neetoFiltersFrontend.Bar, {
922
+ columns: filterableColumns,
923
+ keyword: searchKeywordProps,
924
+ setIsPaneOpen: setIsFilterPaneOpen,
925
+ onChange: handleFiltersChange
926
+ })]
927
+ });
864
928
  };
865
929
 
866
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
867
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
868
- var SplitTransfersDashboard = function SplitTransfersDashboard(_ref) {
869
- var searchProps = _ref.searchProps,
870
- payableEntityColumns = _ref.payableEntityColumns;
871
- var _getQueryParams = utils.getQueryParams(),
872
- _getQueryParams$searc = _getQueryParams.searchTerm,
873
- searchTerm = _getQueryParams$searc === void 0 ? "" : _getQueryParams$searc;
874
- var filterableColumns = buildFilterColumns(payableEntityColumns);
875
- var searchKeywordProps = buildSearchProps(searchProps, searchTerm);
876
- var _useState = react.useState([]),
877
- _useState2 = _slicedToArray(_useState, 2),
878
- selectedRows = _useState2[0],
879
- setSelectedRows = _useState2[1];
880
- var _useState3 = react.useState([]),
881
- _useState4 = _slicedToArray(_useState3, 2),
882
- selectedRowData = _useState4[0],
883
- setSelectedRowData = _useState4[1];
884
- var _useState5 = react.useState(false),
885
- _useState6 = _slicedToArray(_useState5, 2),
886
- isExportModalOpen = _useState6[0],
887
- setIsExportModalOpen = _useState6[1];
888
- var _useState7 = react.useState(false),
889
- _useState8 = _slicedToArray(_useState7, 2),
890
- isCancelModalOpen = _useState8[0],
891
- setIsCancelModalOpen = _useState8[1];
892
- var _useState9 = react.useState(false),
893
- _useState10 = _slicedToArray(_useState9, 2),
894
- isResumeModalOpen = _useState10[0],
895
- setIsResumeModalOpen = _useState10[1];
896
- var _useState11 = react.useState(false),
897
- _useState12 = _slicedToArray(_useState11, 2),
898
- hasBulkSelectedAllRows = _useState12[0],
899
- setHasBulkSelectedAllRows = _useState12[1];
900
- var _useState13 = react.useState(constants.DEFAULT_SORT_PROPERTIES),
901
- _useState14 = _slicedToArray(_useState13, 2),
902
- sortProperties = _useState14[0],
903
- setSortProperties = _useState14[1];
904
- var _useState15 = react.useState(constants.DEFAULT_PAGE_VALUES),
905
- _useState16 = _slicedToArray(_useState15, 2),
906
- pageProperties = _useState16[0],
907
- setPageProperties = _useState16[1];
908
- var _useState17 = react.useState(neetoFiltersFrontend.buildFiltersFromURL([].concat(_toConsumableArray(filterableColumns), [searchKeywordProps]))),
909
- _useState18 = _slicedToArray(_useState17, 2),
910
- filters = _useState18[0],
911
- setFilters = _useState18[1];
912
- var history = reactRouterDom.useHistory();
913
- var _getQueryParams2 = utils.getQueryParams(),
914
- _getQueryParams2$tab = _getQueryParams2.tab,
915
- tab = _getQueryParams2$tab === void 0 ? SPLIT_TRANSFERS_DASHBOARD_TAB.all : _getQueryParams2$tab;
916
- var payload = _objectSpread(_objectSpread({
917
- tab: tab,
918
- filters: filters
919
- }, pageProperties), sortProperties);
920
- var _useFetchSplitTransfe = useFetchSplitTransfers(payload),
921
- _useFetchSplitTransfe2 = _useFetchSplitTransfe.data,
922
- _useFetchSplitTransfe3 = _useFetchSplitTransfe2 === void 0 ? {} : _useFetchSplitTransfe2,
923
- splitTransfers = _useFetchSplitTransfe3.splitTransfers,
924
- views = _useFetchSplitTransfe3.views,
925
- isFetching = _useFetchSplitTransfe.isFetching,
926
- isSplitTransfersLoading = _useFetchSplitTransfe.isPending;
927
- var _useBulkUpdateSplitTr = useBulkUpdateSplitTransfers({
928
- onSuccess: function onSuccess() {
929
- setSelectedRowData([]);
930
- setSelectedRows([]);
931
- }
932
- }),
933
- updateSplitTransfers = _useBulkUpdateSplitTr.mutate,
934
- isCancelling = _useBulkUpdateSplitTr.isPending;
935
- var handleSplitTransfersUpdate = function handleSplitTransfersUpdate(status, reason) {
936
- var ids = ramda.pluck("id", selectedRowData);
930
+ const SplitTransfersDashboard = ({
931
+ searchProps,
932
+ payableEntityColumns
933
+ }) => {
934
+ const {
935
+ searchTerm = ""
936
+ } = utils.getQueryParams();
937
+ const filterableColumns = buildFilterColumns(payableEntityColumns);
938
+ const searchKeywordProps = buildSearchProps(searchProps, searchTerm);
939
+ const [selectedRows, setSelectedRows] = react.useState([]);
940
+ const [selectedRowData, setSelectedRowData] = react.useState([]);
941
+ const [isExportModalOpen, setIsExportModalOpen] = react.useState(false);
942
+ const [isCancelModalOpen, setIsCancelModalOpen] = react.useState(false);
943
+ const [isResumeModalOpen, setIsResumeModalOpen] = react.useState(false);
944
+ const [hasBulkSelectedAllRows, setHasBulkSelectedAllRows] = react.useState(false);
945
+ const [sortProperties, setSortProperties] = react.useState(constants.DEFAULT_SORT_PROPERTIES);
946
+ const [pageProperties, setPageProperties] = react.useState(constants.DEFAULT_PAGE_VALUES);
947
+ const [filters, setFilters] = react.useState(neetoFiltersFrontend.buildFiltersFromURL([...filterableColumns, searchKeywordProps]));
948
+ const history = reactRouterDom.useHistory();
949
+ const {
950
+ tab = SPLIT_TRANSFERS_DASHBOARD_TAB.all
951
+ } = utils.getQueryParams();
952
+ const payload = {
953
+ tab,
954
+ filters,
955
+ ...pageProperties,
956
+ ...sortProperties
957
+ };
958
+ const {
959
+ data: {
960
+ splitTransfers,
961
+ views
962
+ } = {},
963
+ isFetching,
964
+ isPending: isSplitTransfersLoading
965
+ } = useFetchSplitTransfers(payload);
966
+ const {
967
+ mutate: updateSplitTransfers,
968
+ isPending: isCancelling
969
+ } = useBulkUpdateSplitTransfers({
970
+ onSuccess: () => {
971
+ setSelectedRowData([]);
972
+ setSelectedRows([]);
973
+ }
974
+ });
975
+ const handleSplitTransfersUpdate = (status, reason) => {
976
+ const ids = ramda.pluck("id", selectedRowData);
937
977
  updateSplitTransfers({
938
- ids: ids,
939
- status: status,
940
- reason: reason,
978
+ ids,
979
+ status,
980
+ reason,
941
981
  isApplyChangesToAllRequired: hasBulkSelectedAllRows
942
982
  });
943
983
  setIsCancelModalOpen(false);
944
984
  setIsResumeModalOpen(false);
945
985
  };
946
- var handleTablePagination = function handleTablePagination(page, pageSize) {
947
- var queryParams = utils.getQueryParams({
986
+ const handleTablePagination = (page, pageSize) => {
987
+ const queryParams = utils.getQueryParams({
948
988
  toCamelCase: false
949
989
  });
950
990
  history.push(utils.buildUrl(window.location.pathname, ramda.mergeLeft({
951
- page: page,
991
+ page,
952
992
  page_size: pageSize
953
993
  }, queryParams)));
954
994
  setPageProperties({
955
- page: page,
956
- pageSize: pageSize
995
+ page,
996
+ pageSize
957
997
  });
958
998
  };
959
- var handleRowSelect = function handleRowSelect(keys, rowData) {
999
+ const handleRowSelect = (keys, rowData) => {
960
1000
  setSelectedRows(keys);
961
1001
  setSelectedRowData(rowData);
962
1002
  };
963
- react.useEffect(function () {
1003
+ react.useEffect(() => {
964
1004
  handleTablePagination(constants$1.DEFAULT_PAGE_INDEX, constants$1.DEFAULT_PAGE_SIZE);
965
1005
  setSortProperties(constants.DEFAULT_SORT_PROPERTIES);
966
1006
  setSelectedRowData([]);
967
1007
  setSelectedRows([]);
968
1008
  }, [filters, tab]);
969
1009
  if (isSplitTransfersLoading || isCancelling) {
970
- return /*#__PURE__*/React.createElement("div", {
971
- className: "flex h-full w-full items-center justify-center"
972
- }, /*#__PURE__*/React.createElement(neetoui.Spinner, null));
1010
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
1011
+ className: "flex h-full w-full items-center justify-center",
1012
+ children: /*#__PURE__*/jsxRuntime.jsx(neetoui.Spinner, {})
1013
+ });
973
1014
  }
974
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TopSection, {
975
- filterableColumns: filterableColumns,
976
- filters: filters,
977
- hasBulkSelectedAllRows: hasBulkSelectedAllRows,
978
- pageProperties: pageProperties,
979
- payableEntityColumns: payableEntityColumns,
980
- searchKeywordProps: searchKeywordProps,
981
- selectedRowData: selectedRowData,
982
- selectedRows: selectedRows,
983
- setFilters: setFilters,
984
- setIsCancelModalOpen: setIsCancelModalOpen,
985
- setIsExportModalOpen: setIsExportModalOpen,
986
- setIsResumeModalOpen: setIsResumeModalOpen,
987
- setPageProperties: setPageProperties,
988
- setSortProperties: setSortProperties,
989
- views: views
990
- }), /*#__PURE__*/React.createElement(List, {
991
- handleTablePagination: handleTablePagination,
992
- isFetching: isFetching,
993
- pageProperties: pageProperties,
994
- payableEntityColumns: payableEntityColumns,
995
- selectedRows: selectedRows,
996
- setHasBulkSelectedAllRows: setHasBulkSelectedAllRows,
997
- setSelectedRows: setSelectedRows,
998
- setSortProperties: setSortProperties,
999
- splitTransfers: splitTransfers,
1000
- views: views,
1001
- onRowSelect: handleRowSelect
1002
- }), /*#__PURE__*/React.createElement(ExportModal.ExportModal, {
1003
- filters: filters,
1004
- isExportModalOpen: isExportModalOpen,
1005
- setIsExportModalOpen: setIsExportModalOpen,
1006
- sortProperties: sortProperties,
1007
- dashboardKind: constants.DASHBOARD_KIND.splitTransfers
1008
- }), /*#__PURE__*/React.createElement(CancelModal, {
1009
- handleSplitTransfersUpdate: handleSplitTransfersUpdate,
1010
- isOpen: isCancelModalOpen,
1011
- onClose: function onClose() {
1012
- return setIsCancelModalOpen(false);
1013
- }
1014
- }), /*#__PURE__*/React.createElement(ResumeModal, {
1015
- handleSplitTransfersUpdate: handleSplitTransfersUpdate,
1016
- isOpen: isResumeModalOpen,
1017
- onClose: function onClose() {
1018
- return setIsResumeModalOpen(false);
1019
- }
1020
- }));
1015
+ return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
1016
+ children: [/*#__PURE__*/jsxRuntime.jsx(TopSection, {
1017
+ filterableColumns,
1018
+ filters,
1019
+ hasBulkSelectedAllRows,
1020
+ pageProperties,
1021
+ payableEntityColumns,
1022
+ searchKeywordProps,
1023
+ selectedRowData,
1024
+ selectedRows,
1025
+ setFilters,
1026
+ setIsCancelModalOpen,
1027
+ setIsExportModalOpen,
1028
+ setIsResumeModalOpen,
1029
+ setPageProperties,
1030
+ setSortProperties,
1031
+ views
1032
+ }), /*#__PURE__*/jsxRuntime.jsx(List, {
1033
+ handleTablePagination,
1034
+ isFetching,
1035
+ pageProperties,
1036
+ payableEntityColumns,
1037
+ selectedRows,
1038
+ setHasBulkSelectedAllRows,
1039
+ setSelectedRows,
1040
+ setSortProperties,
1041
+ splitTransfers,
1042
+ views,
1043
+ onRowSelect: handleRowSelect
1044
+ }), /*#__PURE__*/jsxRuntime.jsx(ExportModal.ExportModal, {
1045
+ filters,
1046
+ isExportModalOpen,
1047
+ setIsExportModalOpen,
1048
+ sortProperties,
1049
+ dashboardKind: constants.DASHBOARD_KIND.splitTransfers
1050
+ }), /*#__PURE__*/jsxRuntime.jsx(CancelModal, {
1051
+ handleSplitTransfersUpdate,
1052
+ isOpen: isCancelModalOpen,
1053
+ onClose: () => setIsCancelModalOpen(false)
1054
+ }), /*#__PURE__*/jsxRuntime.jsx(ResumeModal, {
1055
+ handleSplitTransfersUpdate,
1056
+ isOpen: isResumeModalOpen,
1057
+ onClose: () => setIsResumeModalOpen(false)
1058
+ })]
1059
+ });
1021
1060
  };
1022
1061
 
1023
1062
  module.exports = SplitTransfersDashboard;