@socotra/ec-react-components 2.10.0 → 2.11.0-next.0

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.
package/dist/index.d.ts CHANGED
@@ -8,6 +8,8 @@ import { CreditDistributionReverseRequest } from '@socotra/ec-react-schemas';
8
8
  import { CurrencyType } from '@socotra/ec-react-schemas';
9
9
  import { DataModel } from '@socotra/ec-react-schemas';
10
10
  import { DataTypeConfigRecord } from '@socotra/ec-react-schemas';
11
+ import { DisbursementCreateRequest } from '@socotra/ec-react-schemas';
12
+ import { DisbursementRefRecord } from '@socotra/ec-react-schemas';
11
13
  import { ElementConfig } from '@socotra/ec-react-schemas';
12
14
  import { ElementRequest } from '@socotra/ec-react-schemas';
13
15
  import { ElementResponse } from '@socotra/ec-react-schemas';
@@ -61,6 +63,19 @@ export declare const ExistingPaymentForm: {
61
63
  displayName: string;
62
64
  };
63
65
 
66
+ declare type GetDisbursementFormDefaultFieldsProps = {
67
+ disbursements: DisbursementRefRecord;
68
+ accountBalance: number;
69
+ currency: CurrencyType;
70
+ titles?: {
71
+ amount?: string;
72
+ type?: string;
73
+ transactionMethod?: string;
74
+ transactionMethods?: Record<TransactionMethodEnum, string>;
75
+ transactionNumber?: string;
76
+ };
77
+ };
78
+
64
79
  declare type GetPaymentFormDefaultFieldsProps = {
65
80
  payments: PaymentConfigRecord;
66
81
  currency: CurrencyType;
@@ -82,6 +97,14 @@ export declare const InitializedTransactionForm: {
82
97
  displayName: string;
83
98
  };
84
99
 
100
+ /**
101
+ * DisbursementForm is a form for creating a disbursement.
102
+ */
103
+ export declare const NewDisbursementForm: {
104
+ ({ accountLocator, accountBalance, currency, validateOnSubmit, hideSubmitButton, submitButtonText, handleSubmit, isSubmitting, disabled, dataModel, id, titles, }: Props_10): JSX_2.Element;
105
+ displayName: string;
106
+ };
107
+
85
108
  /**
86
109
  * PaymentForm is a form for making a payment.
87
110
  */
@@ -181,6 +204,59 @@ declare type Props = {
181
204
  };
182
205
  };
183
206
 
207
+ declare type Props_10 = {
208
+ /**
209
+ * Account locator
210
+ */
211
+ accountLocator: string;
212
+ /**
213
+ * Account balance
214
+ */
215
+ accountBalance: number;
216
+ /**
217
+ * The currency of the invoice
218
+ */
219
+ currency: CurrencyType;
220
+ /**
221
+ * The resolved data model retrieved from data model response
222
+ */
223
+ dataModel: DataModel;
224
+ /**
225
+ * The function to call when the form is submitted. It will create an PaymentRequest from the form data.
226
+ */
227
+ handleSubmit: (data: DisbursementCreateRequest) => void;
228
+ /**
229
+ * Set to true when the form is submitting to set fields to readonly and disable the submit button
230
+ */
231
+ isSubmitting?: boolean;
232
+ /**
233
+ * Disables the form
234
+ */
235
+ disabled?: boolean;
236
+ /**
237
+ * Hides the submit button
238
+ */
239
+ hideSubmitButton?: boolean;
240
+ /**
241
+ * Whether to validate the form on submit
242
+ */
243
+ validateOnSubmit?: boolean;
244
+ /**
245
+ * The text to display on the submit button
246
+ */
247
+ submitButtonText?: string;
248
+ /**
249
+ * ID for the form wrapper
250
+ * */
251
+ id?: string;
252
+ /**
253
+ * Titles
254
+ */
255
+ titles?: {
256
+ formTitle?: string;
257
+ } & Partial<GetDisbursementFormDefaultFieldsProps['titles']>;
258
+ };
259
+
184
260
  declare type Props_2 = {
185
261
  /**
186
262
  * The quote object