@mercoa/react 0.0.43-rc2 → 0.0.44-rc1

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.
@@ -28,11 +28,14 @@ export declare function CounterpartySearch({ counterparty, disableCreation, onSe
28
28
  type: 'payee' | 'payor';
29
29
  network?: Mercoa.CounterpartyNetworkType[];
30
30
  }): import("react/jsx-runtime").JSX.Element;
31
- export declare function PayableCounterpartySearch({ counterparty, disableCreation, onSelect, network, }: {
31
+ export declare function PayableCounterpartySearch({ counterparty, disableCreation, onSelect, network, saveButton, }: {
32
32
  counterparty?: Mercoa.CounterpartyResponse;
33
33
  disableCreation?: boolean;
34
34
  onSelect?: (counterparty: Mercoa.CounterpartyResponse | undefined) => any;
35
35
  network?: Mercoa.CounterpartyNetworkType[];
36
+ saveButton?: ({ onClick }: {
37
+ onClick: () => void;
38
+ }) => JSX.Element;
36
39
  }): import("react/jsx-runtime").JSX.Element;
37
40
  export declare function AddCounterpartyModal({ type, show, setShow, }: {
38
41
  type: 'payor' | 'payee';
@@ -0,0 +1,16 @@
1
+ import { Mercoa } from '@mercoa/javascript';
2
+ export type PreviewType = 'pdf' | 'email' | 'paymentPage';
3
+ export default function InvoicePreview({ selectedPayer }: {
4
+ selectedPayer?: Mercoa.CounterpartyResponse;
5
+ }): import("react/jsx-runtime").JSX.Element;
6
+ export declare function InvoicePreviewPdf({ invoice, logo }: {
7
+ invoice: Mercoa.InvoiceResponse;
8
+ logo: string;
9
+ }): import("react/jsx-runtime").JSX.Element;
10
+ export declare function InvoicePreviewEmail({ invoice }: {
11
+ invoice: Mercoa.InvoiceResponse;
12
+ }): import("react/jsx-runtime").JSX.Element;
13
+ export declare function InvoicePreviewPaymentPage({ invoice, logo }: {
14
+ invoice: Mercoa.InvoiceResponse;
15
+ logo: string;
16
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,13 +1,21 @@
1
1
  /// <reference types="react" />
2
2
  import { Mercoa } from '@mercoa/javascript';
3
3
  import { FieldErrors, UseFormSetValue, UseFormWatch } from 'react-hook-form';
4
- export declare function PayableDetails({ invoiceId, invoice, onRedirect, heightOffset, admin, documentPosition, children, invoicePreSubmit, }: {
4
+ export declare function PayableDetails({ invoiceId, invoice, onRedirect, heightOffset, admin, documentPosition, documentCustomization, children, invoicePreSubmit, }: {
5
5
  invoiceId?: Mercoa.InvoiceId;
6
6
  invoice?: Mercoa.InvoiceResponse;
7
7
  onRedirect: (invoice: Mercoa.InvoiceResponse | undefined) => void;
8
8
  heightOffset?: number;
9
9
  admin?: boolean;
10
10
  documentPosition?: 'right' | 'left' | 'none';
11
+ documentCustomization?: {
12
+ downloadButton?: ({ onClick }: {
13
+ onClick: () => void;
14
+ }) => JSX.Element;
15
+ viewEmailButton?: ({ onClick }: {
16
+ onClick: () => void;
17
+ }) => JSX.Element;
18
+ };
11
19
  invoicePreSubmit?: (invoice: Mercoa.InvoiceCreationRequest) => Promise<Mercoa.InvoiceCreationRequest>;
12
20
  children?: ({ invoice, refreshInvoice, ocrResponse, uploadedDocument, setUploadedDocument, height, setSelectedVendor, selectedVendor, getVendorPaymentLink, setValue, watch, }: PayableFormChildrenProps) => JSX.Element;
13
21
  }): import("react/jsx-runtime").JSX.Element;
@@ -44,7 +52,7 @@ export declare function PayableFormHeader({ hideId }: {
44
52
  hideId?: boolean;
45
53
  }): import("react/jsx-runtime").JSX.Element;
46
54
  export declare function PayableFormErrors(): import("react/jsx-runtime").JSX.Element | null;
47
- export declare function PayableDocument({ onOCRComplete, onDocumentUpload, invoice, height, }: {
55
+ export declare function PayableDocument({ onOCRComplete, onDocumentUpload, invoice, height, downloadButton, viewEmailButton, }: {
48
56
  onOCRComplete?: (ocrResponse?: Mercoa.OcrResponse) => void;
49
57
  onDocumentUpload?: ({ fileReaderObj, mimeType }: {
50
58
  fileReaderObj: string;
@@ -52,8 +60,14 @@ export declare function PayableDocument({ onOCRComplete, onDocumentUpload, invoi
52
60
  }) => void;
53
61
  invoice?: Mercoa.InvoiceResponse;
54
62
  height: number;
63
+ downloadButton?: ({ onClick }: {
64
+ onClick: () => void;
65
+ }) => JSX.Element;
66
+ viewEmailButton?: ({ onClick }: {
67
+ onClick: () => void;
68
+ }) => JSX.Element;
55
69
  }): import("react/jsx-runtime").JSX.Element;
56
- export declare function PayableDocumentDisplay({ documents, invoice, height, showSourceEmail, }: {
70
+ export declare function PayableDocumentDisplay({ documents, invoice, height, showSourceEmail, downloadButton, viewEmailButton, }: {
57
71
  documents?: Array<{
58
72
  fileReaderObj: string;
59
73
  mimeType: string;
@@ -61,6 +75,12 @@ export declare function PayableDocumentDisplay({ documents, invoice, height, sho
61
75
  invoice?: Mercoa.InvoiceResponse;
62
76
  height: number;
63
77
  showSourceEmail?: boolean;
78
+ downloadButton?: ({ onClick }: {
79
+ onClick: () => void;
80
+ }) => JSX.Element;
81
+ viewEmailButton?: ({ onClick }: {
82
+ onClick: () => void;
83
+ }) => JSX.Element;
64
84
  }): import("react/jsx-runtime").JSX.Element;
65
85
  export declare function PayableActions({ approveButton, rejectButton, nonApproverButton, deleteButton, archiveButton, cancelButton, saveDraftButton, printCheckButton, createInvoiceButton, submitForApprovalButton, nextButton, markAsPaidButton, schedulePaymentButton, retryPaymentButton, admin, }: {
66
86
  approveButton?: ({ onClick }: {
@@ -111,10 +131,11 @@ export declare function PayableActions({ approveButton, rejectButton, nonApprove
111
131
  export declare function PayableOverview({ readOnly }: {
112
132
  readOnly?: boolean;
113
133
  }): import("react/jsx-runtime").JSX.Element;
114
- export declare function SelectPaymentMethod({ isSource, isDestination, disableCreation, readOnly, }: {
134
+ export declare function SelectPaymentMethod({ isSource, isDestination, disableCreation, disablePaymentTimingDisplay, readOnly, }: {
115
135
  isSource?: boolean;
116
136
  isDestination?: boolean;
117
137
  disableCreation?: boolean;
138
+ disablePaymentTimingDisplay?: boolean;
118
139
  readOnly?: boolean;
119
140
  }): import("react/jsx-runtime").JSX.Element;
120
141
  export declare function PayablePaymentSource({ readOnly }: {
@@ -123,6 +144,7 @@ export declare function PayablePaymentSource({ readOnly }: {
123
144
  export declare function PayablePaymentDestination({ readOnly }: {
124
145
  readOnly?: boolean;
125
146
  }): import("react/jsx-runtime").JSX.Element;
147
+ export declare function PaymentDestinationProcessingTime(): import("react/jsx-runtime").JSX.Element | null;
126
148
  export declare function PayableApprovers({ readOnly }: {
127
149
  readOnly?: boolean;
128
150
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,66 @@
1
+ /// <reference types="react" />
1
2
  import { Mercoa } from '@mercoa/javascript';
2
- export declare function ReceivableDetails({ invoiceId, invoice, onRedirect, admin, layout, }: {
3
+ import { FieldErrors, UseFormSetValue, UseFormWatch } from 'react-hook-form';
4
+ export type ReceivableFormValues = {
5
+ id?: string;
6
+ status?: Mercoa.InvoiceStatus;
7
+ invoiceNumber?: string;
8
+ amount?: number;
9
+ currency?: Mercoa.CurrencyCode;
10
+ payerId?: string;
11
+ payerName?: string;
12
+ invoiceDate?: Date;
13
+ dueDate?: Date;
14
+ deductionDate?: Date;
15
+ lineItems?: Mercoa.InvoiceLineItemResponse[];
16
+ paymentDestinationId?: string;
17
+ paymentDestinationType?: string;
18
+ paymentDestinationOptions?: Mercoa.PaymentDestinationOptions;
19
+ paymentSourceId?: string;
20
+ paymentSourceType?: string;
21
+ paymentSourceCheckEnabled?: boolean;
22
+ description?: string;
23
+ saveAsDraft?: boolean;
24
+ hasDocuments?: boolean;
25
+ saveAsStatus?: string;
26
+ saveAsAdmin?: boolean;
27
+ metadata?: Record<string, any>;
28
+ commentText?: string;
29
+ comments?: Array<any>;
30
+ creatorUser?: any;
31
+ };
32
+ export declare function ReceivableDetails({ invoiceId, invoice, onRedirect, admin, documentPosition, children, }: {
3
33
  invoiceId?: Mercoa.InvoiceId;
4
34
  invoice?: Mercoa.InvoiceResponse;
5
35
  onRedirect: (invoice: Mercoa.InvoiceResponse | undefined) => void;
6
36
  admin?: boolean;
7
- layout?: 'right' | 'left';
37
+ documentPosition?: 'right' | 'left' | 'none';
38
+ children?: ({ invoice, refreshInvoice, setSelectedPayer, selectedPayer, setValue, watch, }: ReceivableFormChildrenProps) => JSX.Element;
39
+ }): import("react/jsx-runtime").JSX.Element;
40
+ export type ReceivableFormChildrenProps = {
41
+ invoice?: Mercoa.InvoiceResponse;
42
+ refreshInvoice?: (invoiceId: Mercoa.InvoiceId) => void;
43
+ setSelectedPayer: (e?: Mercoa.CounterpartyResponse) => void;
44
+ selectedPayer?: Mercoa.CounterpartyResponse;
45
+ setValue: (name: UseFormSetValue<Mercoa.InvoiceCreationRequest>, value: any, options?: {
46
+ shouldValidate?: boolean;
47
+ shouldDirty?: boolean;
48
+ }) => void;
49
+ watch: (name: UseFormWatch<Mercoa.InvoiceCreationRequest>) => any;
50
+ errors: FieldErrors<Mercoa.InvoiceCreationRequest>;
51
+ };
52
+ export declare function ReceivableForm({ invoice, onRedirect, refreshInvoice, admin, supportedCurrencies, setSupportedCurrencies, setDestinationPaymentMethods, setSourcePaymentMethods, setPaymentMethodSchemas, selectedPayer, setSelectedPayer, children, }: {
53
+ invoice?: Mercoa.InvoiceResponse;
54
+ onRedirect: (invoice: Mercoa.InvoiceResponse | undefined) => void;
55
+ refreshInvoice: (invoice: Mercoa.InvoiceId) => void;
56
+ admin?: boolean;
57
+ supportedCurrencies: Mercoa.CurrencyCode[];
58
+ setSupportedCurrencies: (currencies: Mercoa.CurrencyCode[]) => void;
59
+ setDestinationPaymentMethods: (paymentMethods: Mercoa.PaymentMethodResponse.BankAccount[]) => void;
60
+ setSourcePaymentMethods: (paymentMethods: Mercoa.PaymentMethodResponse[]) => void;
61
+ setPaymentMethodSchemas: (paymentMethodSchemas: Mercoa.CustomPaymentMethodSchemaResponse[]) => void;
62
+ invoicePreSubmit?: (invoice: Mercoa.InvoiceCreationRequest) => Promise<Mercoa.InvoiceCreationRequest>;
63
+ selectedPayer: Mercoa.CounterpartyResponse | undefined;
64
+ setSelectedPayer: (payer: Mercoa.CounterpartyResponse | undefined) => void;
65
+ children?: ({ invoice, refreshInvoice, setSelectedPayer, selectedPayer, setValue, watch, }: ReceivableFormChildrenProps) => JSX.Element;
8
66
  }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { Mercoa } from '@mercoa/javascript';
2
+ export declare function ReceivablePaymentPortal({ logo, complete, invoice, supportEmail, totalDisplay, selectedPaymentType, updateInvoice, setSelectedPaymentType, }: {
3
+ logo: string;
4
+ complete?: boolean;
5
+ invoice: Mercoa.InvoiceResponse;
6
+ supportEmail?: string;
7
+ totalDisplay: string;
8
+ selectedPaymentType: Mercoa.PaymentMethodType | string;
9
+ updateInvoice: (invoice: Mercoa.PaymentMethodResponse) => void;
10
+ setSelectedPaymentType: (paymentMethodType: Mercoa.PaymentMethodType | string) => void;
11
+ }): import("react/jsx-runtime").JSX.Element;
12
+ export declare function ReceivablePaymentPdf({ invoice, logo }: {
13
+ invoice?: Mercoa.InvoiceResponse;
14
+ logo: string;
15
+ }): import("react/jsx-runtime").JSX.Element;
@@ -17,6 +17,7 @@ export * from './PayableDetails';
17
17
  export * from './Payables';
18
18
  export * from './PaymentMethods';
19
19
  export * from './ReceivableDetails';
20
+ export * from './ReceivablePayments';
20
21
  export * from './Receivables';
21
22
  export * from './generics';
22
23
  export type onCloseFunction = (value: boolean) => void;