@mercoa/react 0.0.47-rc1 → 0.0.48-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.
@@ -217,7 +217,7 @@ export declare function AcceptToSButton({ className, buttonText, title, onClose,
217
217
  }): import("react/jsx-runtime").JSX.Element;
218
218
  export declare function AcceptTosForm({ entity, onComplete, }: {
219
219
  entity: Mercoa.EntityResponse;
220
- onComplete?: (val: boolean) => void;
220
+ onComplete: () => Promise<void>;
221
221
  }): import("react/jsx-runtime").JSX.Element;
222
222
  export declare function EntityOnboardingForm({ entity, type, onOnboardingSubmit, onCancel, admin, }: {
223
223
  entity: Mercoa.EntityResponse;
@@ -1,3 +1,10 @@
1
- export declare function InvoiceComments({ readOnly }: {
1
+ /// <reference types="react" />
2
+ import { Mercoa } from '@mercoa/javascript';
3
+ export type InvoiceCommentsChildrenProps = {
4
+ comments: Mercoa.CommentResponse[];
5
+ addComment: (comment: string) => void;
6
+ };
7
+ export declare function InvoiceComments({ readOnly, children, }: {
2
8
  readOnly?: boolean;
3
- }): import("react/jsx-runtime").JSX.Element;
9
+ children?: (props: InvoiceCommentsChildrenProps) => JSX.Element;
10
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,23 +1,26 @@
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, documentCustomization, children, invoicePreSubmit, }: {
4
+ export type PayableDetailsChildrenProps = {
5
+ invoice?: Mercoa.InvoiceResponse;
6
+ ocrResponse?: Mercoa.OcrResponse;
7
+ uploadedDocument?: string;
8
+ onRedirect: (invoice: Mercoa.InvoiceResponse | undefined) => void;
9
+ setUploadedDocument: (e?: string) => void;
10
+ height: number;
11
+ refreshInvoice: (invoiceId: Mercoa.InvoiceId) => void;
12
+ invoicePreSubmit?: (invoice: Mercoa.InvoiceCreationRequest) => Promise<Mercoa.InvoiceCreationRequest>;
13
+ onOcrComplete: (ocrResponse?: Mercoa.OcrResponse) => void;
14
+ };
15
+ export declare function PayableDetails({ invoiceId, invoice, onRedirect, heightOffset, admin, documentPosition, invoicePreSubmit, children, }: {
5
16
  invoiceId?: Mercoa.InvoiceId;
6
17
  invoice?: Mercoa.InvoiceResponse;
7
18
  onRedirect: (invoice: Mercoa.InvoiceResponse | undefined) => void;
8
19
  heightOffset?: number;
9
20
  admin?: boolean;
10
21
  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
- };
19
22
  invoicePreSubmit?: (invoice: Mercoa.InvoiceCreationRequest) => Promise<Mercoa.InvoiceCreationRequest>;
20
- children?: ({ invoice, refreshInvoice, ocrResponse, uploadedDocument, setUploadedDocument, height, setSelectedVendor, selectedVendor, getVendorPaymentLink, setValue, watch, }: PayableFormChildrenProps) => JSX.Element;
23
+ children?: (props: PayableDetailsChildrenProps) => JSX.Element[];
21
24
  }): import("react/jsx-runtime").JSX.Element;
22
25
  export type PayableFormChildrenProps = {
23
26
  invoice?: Mercoa.InvoiceResponse;
@@ -47,15 +50,33 @@ export declare function PayableForm({ invoice, ocrResponse, uploadedDocument, se
47
50
  height: number;
48
51
  admin?: boolean;
49
52
  invoicePreSubmit?: (invoice: Mercoa.InvoiceCreationRequest) => Promise<Mercoa.InvoiceCreationRequest>;
50
- children?: ({ invoice, refreshInvoice, ocrResponse, uploadedDocument, setUploadedDocument, height, setSelectedVendor, selectedVendor, getVendorPaymentLink, setValue, watch, }: PayableFormChildrenProps) => JSX.Element;
53
+ children?: (props: PayableFormChildrenProps) => JSX.Element;
51
54
  }): import("react/jsx-runtime").JSX.Element;
52
55
  export declare function PayableFormHeader({ hideId }: {
53
56
  hideId?: boolean;
54
57
  }): import("react/jsx-runtime").JSX.Element;
55
58
  export declare function PayableFormErrors(): import("react/jsx-runtime").JSX.Element | null;
56
- export declare function PayableDocument({ onOCRComplete, onDocumentUpload, invoice, height, downloadButton, viewEmailButton, theme, }: {
57
- onOCRComplete?: (ocrResponse?: Mercoa.OcrResponse) => void;
58
- onDocumentUpload?: ({ fileReaderObj, mimeType }: {
59
+ export type PayableDocumentChildrenProps = {
60
+ documents?: Array<{
61
+ fileReaderObj: string;
62
+ mimeType: string;
63
+ }>;
64
+ sourceEmails?: Mercoa.EmailLog[];
65
+ ocrProcessing: boolean;
66
+ invoice?: Mercoa.InvoiceResponse;
67
+ height: number;
68
+ downloadButton?: ({ onClick }: {
69
+ onClick: () => void;
70
+ }) => JSX.Element;
71
+ viewEmailButton?: ({ onClick }: {
72
+ onClick: () => void;
73
+ }) => JSX.Element;
74
+ theme?: 'light' | 'dark';
75
+ onFileUpload: (fileReaderObj: string, mimeType: string) => void;
76
+ };
77
+ export declare function PayableDocument({ onOcrComplete, onDocumentUpload, invoice, height, downloadButton, viewEmailButton, theme, children, }: {
78
+ onOcrComplete?: (ocrResponse?: Mercoa.OcrResponse) => void;
79
+ onDocumentUpload?: (document: {
59
80
  fileReaderObj: string;
60
81
  mimeType: string;
61
82
  }) => void;
@@ -68,8 +89,13 @@ export declare function PayableDocument({ onOCRComplete, onDocumentUpload, invoi
68
89
  onClick: () => void;
69
90
  }) => JSX.Element;
70
91
  theme?: 'light' | 'dark';
92
+ children?: (props: PayableDocumentChildrenProps) => JSX.Element;
71
93
  }): import("react/jsx-runtime").JSX.Element;
72
- export declare function PayableDocumentDisplay({ documents, invoice, height, showSourceEmail, downloadButton, viewEmailButton, }: {
94
+ export declare function DocumentUploadBox({ onFileUpload, theme, }: {
95
+ onFileUpload: (fileReaderObj: string, mimeType: string) => void;
96
+ theme?: 'light' | 'dark';
97
+ }): import("react/jsx-runtime").JSX.Element;
98
+ export declare function PayableDocumentDisplay({ documents, invoice, height, showSourceEmail, sourceEmails, downloadButton, viewEmailButton, }: {
73
99
  documents?: Array<{
74
100
  fileReaderObj: string;
75
101
  mimeType: string;
@@ -77,6 +103,7 @@ export declare function PayableDocumentDisplay({ documents, invoice, height, sho
77
103
  invoice?: Mercoa.InvoiceResponse;
78
104
  height: number;
79
105
  showSourceEmail?: boolean;
106
+ sourceEmails?: Mercoa.EmailLog[];
80
107
  downloadButton?: ({ onClick }: {
81
108
  onClick: () => void;
82
109
  }) => JSX.Element;
@@ -84,7 +111,10 @@ export declare function PayableDocumentDisplay({ documents, invoice, height, sho
84
111
  onClick: () => void;
85
112
  }) => JSX.Element;
86
113
  }): import("react/jsx-runtime").JSX.Element;
87
- export declare function PayableActions({ approveButton, rejectButton, nonApproverButton, deleteButton, archiveButton, cancelButton, saveDraftButton, printCheckButton, createInvoiceButton, submitForApprovalButton, nextButton, markAsPaidButton, schedulePaymentButton, retryPaymentButton, admin, }: {
114
+ export declare function OcrProgressBar({ ocrProcessing }: {
115
+ ocrProcessing: boolean;
116
+ }): import("react/jsx-runtime").JSX.Element;
117
+ export declare function PayableActions({ approveButton, rejectButton, nonApproverButton, deleteButton, archiveButton, cancelButton, saveDraftButton, printCheckButton, createInvoiceButton, submitForApprovalButton, nextButton, markAsPaidButton, schedulePaymentButton, retryPaymentButton, admin, children, }: {
88
118
  approveButton?: ({ onClick }: {
89
119
  onClick: () => void;
90
120
  }) => JSX.Element;
@@ -129,9 +159,32 @@ export declare function PayableActions({ approveButton, rejectButton, nonApprove
129
159
  onClick: () => void;
130
160
  }) => JSX.Element;
131
161
  admin?: boolean;
162
+ children?: ({ isSaving, buttons }: {
163
+ isSaving: boolean;
164
+ buttons: JSX.Element[];
165
+ }) => JSX.Element;
132
166
  }): import("react/jsx-runtime").JSX.Element;
133
- export declare function PayableOverview({ readOnly }: {
167
+ export type PayableOverviewChildrenProps = {
134
168
  readOnly?: boolean;
169
+ amount?: number;
170
+ setAmount?: (amount: number) => void;
171
+ supportedCurrencies?: Array<Mercoa.CurrencyCode>;
172
+ currency?: Mercoa.CurrencyCode;
173
+ setCurrency?: (currency: Mercoa.CurrencyCode) => void;
174
+ dueDate?: Date;
175
+ setDueDate?: (dueDate: Date) => void;
176
+ invoiceDate?: Date;
177
+ setInvoiceDate?: (invoiceDate: Date) => void;
178
+ schedulePaymentDate?: Date;
179
+ setSchedulePaymentDate?: (schedulePaymentDate: Date) => void;
180
+ invoiceNumber?: string;
181
+ setInvoiceNumber?: (invoiceNumber: string) => void;
182
+ description?: string;
183
+ setDescription?: (description: string) => void;
184
+ };
185
+ export declare function PayableOverview({ readOnly, children, }: {
186
+ readOnly?: boolean;
187
+ children?: (props: PayableOverviewChildrenProps) => JSX.Element;
135
188
  }): import("react/jsx-runtime").JSX.Element;
136
189
  export declare function PayableSelectPaymentMethod({ isSource, isDestination, disableCreation, readOnly, }: {
137
190
  isSource?: boolean;
@@ -190,8 +243,16 @@ export declare function MetadataSelection({ schema, field, skipValidation, readO
190
243
  lineItem?: boolean;
191
244
  hideLabel?: boolean;
192
245
  }): import("react/jsx-runtime").JSX.Element | null;
193
- export declare function PayableLineItems({ readOnly }: {
246
+ export type PayableLineItemChildrenProps = {
247
+ readOnly?: boolean;
248
+ items: Mercoa.InvoiceLineItemRequest[];
249
+ addItem: () => void;
250
+ updateItem: (index: number, item: Mercoa.InvoiceLineItemRequest) => void;
251
+ removeItem: (index: number) => void;
252
+ };
253
+ export declare function PayableLineItems({ readOnly, children, }: {
194
254
  readOnly?: boolean;
255
+ children?: (props: PayableLineItemChildrenProps) => JSX.Element;
195
256
  }): import("react/jsx-runtime").JSX.Element;
196
257
  export declare function PayableFees({ children, }: {
197
258
  children?: ({ fees }: {