@socotra/ec-react-components 2.7.0 → 2.8.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
@@ -3,6 +3,7 @@ import { AccountRequest } from '@socotra/ec-react-schemas';
3
3
  import { AccountResponse } from '@socotra/ec-react-schemas';
4
4
  import { ConstraintEvaluationResponse } from '@socotra/ec-react-schemas';
5
5
  import { CoverageTermsConfigRecord } from '@socotra/ec-react-schemas';
6
+ import { CurrencyType } from '@socotra/ec-react-schemas';
6
7
  import { DataModel } from '@socotra/ec-react-schemas';
7
8
  import { DataTypeConfigRecord } from '@socotra/ec-react-schemas';
8
9
  import { ElementConfig } from '@socotra/ec-react-schemas';
@@ -14,12 +15,15 @@ import { ModifyChangeInstructionCreateRequest } from '@socotra/ec-react-schemas'
14
15
  import { ModifyChangeInstructionResponse } from '@socotra/ec-react-schemas';
15
16
  import { ParamsChangeInstructionCreateRequest } from '@socotra/ec-react-schemas';
16
17
  import { ParamsChangeInstructionResponse } from '@socotra/ec-react-schemas';
18
+ import { PaymentConfigRecord } from '@socotra/ec-react-schemas';
19
+ import { PaymentRequest as PaymentRequest_2 } from '@socotra/ec-react-schemas';
17
20
  import { PolicyResponse } from '@socotra/ec-react-schemas';
18
21
  import { ProductConfig } from '@socotra/ec-react-schemas';
19
22
  import { QuoteDependencyMapResponse } from '@socotra/ec-react-schemas';
20
23
  import { QuoteRequest } from '@socotra/ec-react-schemas';
21
24
  import { QuoteResponse } from '@socotra/ec-react-schemas';
22
25
  import { SegmentResponse } from '@socotra/ec-react-schemas';
26
+ import { TransactionMethodEnum } from '@socotra/ec-react-schemas';
23
27
  import { TransactionSnapshotResponse } from '@socotra/ec-react-schemas';
24
28
 
25
29
  /**
@@ -34,7 +38,7 @@ export declare const AccountForm: {
34
38
  * `DraftTransactionForm` is a form for updating a transaction on an issued policy. It requires a transaction in a `draft` state, a `transactionSnapshot`, `paramsChangeInstruction` (created when the transaction is created), and data types / product model / coverage terms from the tenant data model.
35
39
  */
36
40
  export declare const DraftTransactionForm: {
37
- ({ transactionSnapshot, handleSubmit, paramsChangeInstruction, modifyChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms, titles, }: Props_6): JSX_2.Element;
41
+ ({ transactionSnapshot, handleSubmit, paramsChangeInstruction, modifyChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms, titles, }: Props_7): JSX_2.Element;
38
42
  displayName: string;
39
43
  };
40
44
 
@@ -46,11 +50,36 @@ export declare const ElementForm: {
46
50
  displayName: string;
47
51
  };
48
52
 
53
+ export declare const ExistingPaymentForm: {
54
+ (): JSX_2.Element;
55
+ displayName: string;
56
+ };
57
+
58
+ declare type GetPaymentFormDefaultFieldsProps = {
59
+ payments: PaymentConfigRecord;
60
+ currency: CurrencyType;
61
+ titles?: {
62
+ amount?: string;
63
+ type?: string;
64
+ transactionMethod?: string;
65
+ transactionMethods?: Record<TransactionMethodEnum, string>;
66
+ transactionNumber?: string;
67
+ };
68
+ };
69
+
49
70
  /**
50
71
  * `InitializedTransactionForm` is a form for updating a transaction on an issued policy. It requires a transaction in an `initialized` state, the current `segment`, and data types / product model / coverage terms from the tenant data model.
51
72
  */
52
73
  export declare const InitializedTransactionForm: {
53
- ({ elementResponse, handleSubmit, paramsChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms, titles, }: Props_5): JSX_2.Element;
74
+ ({ elementResponse, handleSubmit, paramsChangeInstruction, preventFormResetOnDisabled, disabled, hideSubmitButton, validateOnSubmit, isSubmitting, submitButtonText, id, dataTypes, productModel, coverageTerms, titles, }: Props_6): JSX_2.Element;
75
+ displayName: string;
76
+ };
77
+
78
+ /**
79
+ * PaymentForm is a form for making a payment.
80
+ */
81
+ export declare const NewPaymentForm: {
82
+ ({ accountLocator, invoiceLocator, currency, validateOnSubmit, hideSubmitButton, submitButtonText, handleSubmit, isSubmitting, disabled, dataModel, id, titles, }: Props_5): JSX_2.Element;
54
83
  displayName: string;
55
84
  };
56
85
 
@@ -338,6 +367,59 @@ declare type Props_4 = {
338
367
  };
339
368
 
340
369
  declare type Props_5 = {
370
+ /**
371
+ * Account locator
372
+ */
373
+ accountLocator: string;
374
+ /**
375
+ * Invoice locator
376
+ */
377
+ invoiceLocator: string;
378
+ /**
379
+ * The currency of the invoice
380
+ */
381
+ currency: CurrencyType;
382
+ /**
383
+ * The resolved data model retrieved from data model response
384
+ */
385
+ dataModel: DataModel;
386
+ /**
387
+ * The function to call when the form is submitted. It will create an PaymentRequest from the form data.
388
+ */
389
+ handleSubmit: (data: PaymentRequest_2) => void;
390
+ /**
391
+ * Set to true when the form is submitting to set fields to readonly and disable the submit button
392
+ */
393
+ isSubmitting?: boolean;
394
+ /**
395
+ * Disables the form
396
+ */
397
+ disabled?: boolean;
398
+ /**
399
+ * Hides the submit button
400
+ */
401
+ hideSubmitButton?: boolean;
402
+ /**
403
+ * Whether to validate the form on submit
404
+ */
405
+ validateOnSubmit?: boolean;
406
+ /**
407
+ * The text to display on the submit button
408
+ */
409
+ submitButtonText?: string;
410
+ /**
411
+ * ID for the form wrapper
412
+ * */
413
+ id?: string;
414
+ /**
415
+ * Titles
416
+ */
417
+ titles?: {
418
+ formTitle?: string;
419
+ } & Partial<GetPaymentFormDefaultFieldsProps['titles']>;
420
+ };
421
+
422
+ declare type Props_6 = {
341
423
  /**
342
424
  * The transaction snapshot object
343
425
  */
@@ -404,7 +486,7 @@ declare type Props_5 = {
404
486
  };
405
487
  };
406
488
 
407
- declare type Props_6 = {
489
+ declare type Props_7 = {
408
490
  /**
409
491
  * The transaction snapshot object
410
492
  */