@mercoa/react 0.0.39-rc5 → 0.0.41

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.
@@ -1,11 +1,44 @@
1
1
  /// <reference types="react" />
2
2
  import { Mercoa } from '@mercoa/javascript';
3
- export declare function CounterpartySearch({ counterparty, onSelect, type, network, }: {
4
- counterparty?: Mercoa.CounterpartyResponse | Mercoa.EntityResponse;
5
- onSelect?: (counterparty: Mercoa.CounterpartyResponse | Mercoa.EntityResponse | undefined) => any;
3
+ import * as yup from 'yup';
4
+ import { MercoaContext } from './index';
5
+ export declare function onSubmitCounterparty({ data, mercoaSession, type, setError, onSelect, }: {
6
+ data: any;
7
+ mercoaSession: MercoaContext;
6
8
  type: 'payee' | 'payor';
9
+ setError: any;
10
+ onSelect?: (counterparty: Mercoa.CounterpartyResponse | undefined) => any;
11
+ }): Promise<void>;
12
+ export declare const counterpartyYupValidation: {
13
+ id: yup.StringSchema<string | null | undefined, yup.AnyObject, undefined, "">;
14
+ name: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
15
+ email: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
16
+ accountType: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
17
+ firstName: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
18
+ lastName: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
19
+ middleName: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
20
+ suffix: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
21
+ website: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
22
+ description: yup.StringSchema<string | undefined, yup.AnyObject, undefined, "">;
23
+ };
24
+ export declare function CounterpartySearch({ counterparty, disableCreation, onSelect, type, network, }: {
25
+ counterparty?: Mercoa.CounterpartyResponse;
26
+ disableCreation?: boolean;
27
+ onSelect?: (counterparty: Mercoa.CounterpartyResponse | undefined) => any;
28
+ type: 'payee' | 'payor';
29
+ network?: Mercoa.CounterpartyNetworkType[];
30
+ }): import("react/jsx-runtime").JSX.Element;
31
+ export declare function PayableCounterpartySearch({ counterparty, disableCreation, onSelect, network, }: {
32
+ counterparty?: Mercoa.CounterpartyResponse;
33
+ disableCreation?: boolean;
34
+ onSelect?: (counterparty: Mercoa.CounterpartyResponse | undefined) => any;
7
35
  network?: Mercoa.CounterpartyNetworkType[];
8
36
  }): import("react/jsx-runtime").JSX.Element;
37
+ export declare function AddCounterpartyModal({ type, show, setShow, }: {
38
+ type: 'payor' | 'payee';
39
+ show: boolean;
40
+ setShow: (show: boolean) => void;
41
+ }): import("react/jsx-runtime").JSX.Element;
9
42
  export type CounterpartiesChildrenProps = {
10
43
  setSearch: (search: string) => void;
11
44
  dataLoaded: boolean;
@@ -22,11 +55,6 @@ export declare function Counterparties({ type, admin, children, }: {
22
55
  admin?: boolean;
23
56
  children?: ({ setSearch, dataLoaded, hasNext, getNext, hasPrevious, getPrevious, resultsPerPage, setResultsPerPage, counterparties, }: CounterpartiesChildrenProps) => JSX.Element;
24
57
  }): import("react/jsx-runtime").JSX.Element;
25
- export declare function AddCounterpartyModal({ type, show, setShow, }: {
26
- type: 'payor' | 'payee';
27
- show: boolean;
28
- setShow: (show: boolean) => void;
29
- }): import("react/jsx-runtime").JSX.Element;
30
58
  export declare function CounterpartyDetails({ counterparty, counterpartyId, admin, type, children, }: {
31
59
  counterparty?: Mercoa.CounterpartyResponse;
32
60
  counterpartyId?: Mercoa.EntityId;
@@ -1,13 +1,13 @@
1
1
  import { Mercoa } from '@mercoa/javascript';
2
2
  import { ReactNode } from 'react';
3
3
  import { UseFormRegister } from 'react-hook-form';
4
- export declare function CustomPaymentMethod({ children, onSelect, showEdit, schema, }: {
4
+ export declare function CustomPaymentMethods({ children, onSelect, showEdit, schema, }: {
5
5
  children?: Function;
6
6
  onSelect?: Function;
7
7
  showEdit?: boolean;
8
8
  schema?: Mercoa.CustomPaymentMethodSchemaResponse;
9
9
  }): any;
10
- export declare function CustomPaymentMethodComponent({ children, account, onSelect, selected, showEdit, schema, }: {
10
+ export declare function CustomPaymentMethod({ children, account, onSelect, selected, showEdit, schema, }: {
11
11
  children?: Function;
12
12
  account?: Mercoa.CustomPaymentMethodResponse;
13
13
  onSelect?: Function;
@@ -15,12 +15,12 @@ export declare function CustomPaymentMethodComponent({ children, account, onSele
15
15
  showEdit?: boolean;
16
16
  schema?: Mercoa.CustomPaymentMethodSchemaResponse;
17
17
  }): import("react/jsx-runtime").JSX.Element;
18
- export declare function AddCustomPaymentMethod({ onSubmit, title, actions, formOnlySubmit, custom, schema, }: {
19
- onSubmit?: Function;
18
+ export declare function AddCustomPaymentMethod({ onSubmit, title, actions, formOnlySubmit, entityId, schema, }: {
19
+ onSubmit?: (data: Mercoa.PaymentMethodResponse) => void;
20
20
  title?: ReactNode;
21
21
  actions?: ReactNode;
22
22
  formOnlySubmit?: Function;
23
- custom?: Mercoa.CustomPaymentMethodRequest;
23
+ entityId?: string;
24
24
  schema: Mercoa.CustomPaymentMethodSchemaResponse;
25
25
  }): import("react/jsx-runtime").JSX.Element;
26
26
  export declare function AddCustomPaymentMethodForm({ register, control, schema, }: {
@@ -32,3 +32,8 @@ export declare function findCustomPaymentMethodAccountNameAndNumber(account: Mer
32
32
  accountName: string;
33
33
  accountNumber: string | undefined;
34
34
  };
35
+ export declare function AddCustomPaymentMethodDialog({ entityId, schema, onSelect, }: {
36
+ entityId?: Mercoa.EntityId;
37
+ schema?: Mercoa.CustomPaymentMethodSchemaResponse;
38
+ onSelect?: Function;
39
+ }): import("react/jsx-runtime").JSX.Element;
@@ -6,8 +6,9 @@ export declare function EntityDetails({ children }: {
6
6
  export declare function EntityStatus({ entity }: {
7
7
  entity?: Mercoa.EntityResponse;
8
8
  }): import("react/jsx-runtime").JSX.Element;
9
- export declare function EntityInboxEmail({ entity }: {
9
+ export declare function EntityInboxEmail({ entity, layout }: {
10
10
  entity?: Mercoa.EntityResponse;
11
+ layout?: 'left' | 'right';
11
12
  }): import("react/jsx-runtime").JSX.Element;
12
13
  export declare function EntityEmailLogs({ entity, onClick, children, }: {
13
14
  entity?: Mercoa.EntityResponse;
@@ -1,4 +1,3 @@
1
- import { Mercoa } from '@mercoa/javascript';
2
- export declare function InvoiceComments({ invoice }: {
3
- invoice?: Mercoa.InvoiceResponse;
1
+ export declare function InvoiceComments({ readOnly }: {
2
+ readOnly?: boolean;
4
3
  }): import("react/jsx-runtime").JSX.Element;
@@ -8,6 +8,7 @@ export interface MercoaContext {
8
8
  entity: Mercoa.EntityResponse | undefined;
9
9
  user: Mercoa.EntityUserResponse | undefined;
10
10
  users: Mercoa.EntityUserResponse[];
11
+ customPaymentMethodSchemas: Mercoa.CustomPaymentMethodSchemaResponse[];
11
12
  selectedInvoice: Mercoa.InvoiceResponse | undefined;
12
13
  setSelectedInvoice: Function;
13
14
  client: MercoaClient | undefined;
@@ -1,22 +1,47 @@
1
+ /// <reference types="react" />
1
2
  import { Mercoa } from '@mercoa/javascript';
2
- export declare function PayableDetails({ invoiceId, invoice, onRedirect, heightOffset, admin, documentPosition, }: {
3
+ export declare function PayableDetails({ invoiceId, invoice, onRedirect, heightOffset, admin, documentPosition, children, invoicePreSubmit, }: {
3
4
  invoiceId?: Mercoa.InvoiceId;
4
5
  invoice?: Mercoa.InvoiceResponse;
5
6
  onRedirect: (invoice: Mercoa.InvoiceResponse | undefined) => void;
6
7
  heightOffset?: number;
7
8
  admin?: boolean;
8
9
  documentPosition?: 'right' | 'left' | 'none';
10
+ invoicePreSubmit?: (invoice: Mercoa.InvoiceCreationRequest) => Promise<Mercoa.InvoiceCreationRequest>;
11
+ children?: ({ invoice, refreshInvoice, ocrResponse, uploadedDocument, setUploadedDocument, height, setSelectedVendor, selectedVendor, getVendorPaymentLink, setValue, watch, }: PayableFormChildrenProps) => JSX.Element;
9
12
  }): import("react/jsx-runtime").JSX.Element;
10
- export declare function PayableForm({ invoice, ocrResponse, uploadedImage, setUploadedImage, onRedirect, refreshInvoice, height, admin, }: {
13
+ export type PayableFormChildrenProps = {
14
+ invoice?: Mercoa.InvoiceResponse;
15
+ refreshInvoice: (invoiceId: Mercoa.InvoiceId) => void;
16
+ ocrResponse?: Mercoa.OcrResponse;
17
+ uploadedDocument?: string;
18
+ setUploadedDocument: (e?: string) => void;
19
+ height: number;
20
+ setSelectedVendor: (e?: Mercoa.CounterpartyResponse) => void;
21
+ selectedVendor?: Mercoa.CounterpartyResponse;
22
+ getVendorPaymentLink: () => Promise<string | undefined>;
23
+ setValue: (name: any, value: any, options?: {
24
+ shouldValidate?: boolean;
25
+ shouldDirty?: boolean;
26
+ }) => void;
27
+ watch: (name: string, defaultValue?: any) => any;
28
+ };
29
+ export declare function PayableForm({ invoice, ocrResponse, uploadedDocument, setUploadedDocument, onRedirect, refreshInvoice, height, admin, invoicePreSubmit, children, }: {
11
30
  invoice?: Mercoa.InvoiceResponse;
12
31
  ocrResponse?: Mercoa.OcrResponse;
13
- uploadedImage?: string;
14
- setUploadedImage: (e?: string) => void;
32
+ uploadedDocument?: string;
33
+ setUploadedDocument: (e?: string) => void;
15
34
  onRedirect: (invoice: Mercoa.InvoiceResponse | undefined) => void;
16
35
  refreshInvoice: (invoiceId: Mercoa.InvoiceId) => void;
17
36
  height: number;
18
37
  admin?: boolean;
38
+ invoicePreSubmit?: (invoice: Mercoa.InvoiceCreationRequest) => Promise<Mercoa.InvoiceCreationRequest>;
39
+ children?: ({ invoice, refreshInvoice, ocrResponse, uploadedDocument, setUploadedDocument, height, setSelectedVendor, selectedVendor, getVendorPaymentLink, setValue, watch, }: PayableFormChildrenProps) => JSX.Element;
19
40
  }): import("react/jsx-runtime").JSX.Element;
41
+ export declare function PayableFormHeader({ hideId }: {
42
+ hideId?: boolean;
43
+ }): import("react/jsx-runtime").JSX.Element;
44
+ export declare function PayableFormErrors(): import("react/jsx-runtime").JSX.Element | null;
20
45
  export declare function PayableDocument({ onOCRComplete, onDocumentUpload, invoice, height, }: {
21
46
  onOCRComplete?: (ocrResponse?: Mercoa.OcrResponse) => void;
22
47
  onDocumentUpload?: ({ fileReaderObj, mimeType }: {
@@ -35,29 +60,76 @@ export declare function PayableDocumentDisplay({ documents, invoice, height, sho
35
60
  height: number;
36
61
  showSourceEmail?: boolean;
37
62
  }): import("react/jsx-runtime").JSX.Element;
38
- export declare function SelectPaymentMethod({ paymentMethods, paymentMethodSchemas, watch, setValue, isSource, isDestination, vendorId, payerId, currentPaymentMethodId, refreshVendorPaymentMethods, refreshPayerPaymentMethods, clearErrors, }: {
39
- paymentMethods: Array<Mercoa.PaymentMethodResponse>;
40
- paymentMethodSchemas: Array<Mercoa.CustomPaymentMethodSchemaResponse>;
41
- watch: Function;
42
- setValue: Function;
63
+ export declare function PayableActions({ approveButton, rejectButton, nonApproverButton, deleteButton, archiveButton, cancelButton, saveDraftButton, printCheckButton, createInvoiceButton, submitForApprovalButton, nextButton, markAsPaidButton, schedulePaymentButton, retryPaymentButton, admin, }: {
64
+ approveButton?: ({ onClick }: {
65
+ onClick: () => void;
66
+ }) => JSX.Element;
67
+ rejectButton?: ({ onClick }: {
68
+ onClick: () => void;
69
+ }) => JSX.Element;
70
+ nonApproverButton?: ({ onClick }: {
71
+ onClick: () => void;
72
+ }) => JSX.Element;
73
+ deleteButton?: ({ onClick }: {
74
+ onClick: () => void;
75
+ }) => JSX.Element;
76
+ archiveButton?: ({ onClick }: {
77
+ onClick: () => void;
78
+ }) => JSX.Element;
79
+ cancelButton?: ({ onClick }: {
80
+ onClick: () => void;
81
+ }) => JSX.Element;
82
+ saveDraftButton?: ({ onClick }: {
83
+ onClick: () => void;
84
+ }) => JSX.Element;
85
+ printCheckButton?: ({ onClick }: {
86
+ onClick: () => void;
87
+ }) => JSX.Element;
88
+ createInvoiceButton?: ({ onClick }: {
89
+ onClick: () => void;
90
+ }) => JSX.Element;
91
+ submitForApprovalButton?: ({ onClick, approversAssigned, }: {
92
+ onClick: () => void;
93
+ approversAssigned: boolean;
94
+ }) => JSX.Element;
95
+ nextButton?: ({ onClick }: {
96
+ onClick: () => void;
97
+ }) => JSX.Element;
98
+ markAsPaidButton?: ({ onClick }: {
99
+ onClick: () => void;
100
+ }) => JSX.Element;
101
+ schedulePaymentButton?: ({ onClick }: {
102
+ onClick: () => void;
103
+ }) => JSX.Element;
104
+ retryPaymentButton?: ({ onClick }: {
105
+ onClick: () => void;
106
+ }) => JSX.Element;
107
+ admin?: boolean;
108
+ }): import("react/jsx-runtime").JSX.Element;
109
+ export declare function PayableOverview({ readOnly }: {
110
+ readOnly?: boolean;
111
+ }): import("react/jsx-runtime").JSX.Element;
112
+ export declare function SelectPaymentMethod({ isSource, isDestination, disableCreation, readOnly, }: {
43
113
  isSource?: boolean;
44
114
  isDestination?: boolean;
45
- vendorId?: string;
46
- payerId?: string;
47
- currentPaymentMethodId?: string;
48
- refreshVendorPaymentMethods: Function;
49
- refreshPayerPaymentMethods: Function;
50
- clearErrors: Function;
115
+ disableCreation?: boolean;
116
+ readOnly?: boolean;
117
+ }): import("react/jsx-runtime").JSX.Element;
118
+ export declare function PayablePaymentSource({ readOnly }: {
119
+ readOnly?: boolean;
120
+ }): import("react/jsx-runtime").JSX.Element;
121
+ export declare function PayablePaymentDestination({ readOnly }: {
122
+ readOnly?: boolean;
123
+ }): import("react/jsx-runtime").JSX.Element;
124
+ export declare function PayableApprovers({ readOnly }: {
125
+ readOnly?: boolean;
51
126
  }): import("react/jsx-runtime").JSX.Element;
52
127
  export declare function filterApproverOptions({ approverSlotIndex, eligibleRoles, eligibleUserIds, users, selectedApprovers, }: {
53
128
  approverSlotIndex: number;
54
129
  eligibleRoles: string[];
55
130
  eligibleUserIds: Mercoa.EntityUserId[];
56
131
  users: Mercoa.EntityUserResponse[];
57
- selectedApprovers: ({
58
- approvalSlotId: string;
59
- assignedUserId: string | undefined;
60
- } | undefined)[];
132
+ selectedApprovers: Mercoa.ApprovalSlot[];
61
133
  }): {
62
134
  user: Mercoa.EntityUserResponse;
63
135
  disabled: boolean;
@@ -66,10 +138,7 @@ export declare function isUpstreamPolicyAssigned({ policyId, approvalPolicies, a
66
138
  policyId: string;
67
139
  approvalPolicies: Mercoa.ApprovalPolicyResponse[];
68
140
  approverSlots: Mercoa.ApprovalSlot[];
69
- selectedApprovers: ({
70
- approvalSlotId: string;
71
- assignedUserId: string | undefined;
72
- } | undefined)[];
141
+ selectedApprovers: Mercoa.ApprovalSlot[];
73
142
  }): boolean;
74
143
  export declare function propagateApprovalPolicy({ userId, policyId, approvalPolicies, approverSlots, setValue, users, selectedApprovers, }: {
75
144
  userId: string;
@@ -78,20 +147,21 @@ export declare function propagateApprovalPolicy({ userId, policyId, approvalPoli
78
147
  approverSlots: Mercoa.ApprovalSlot[];
79
148
  setValue: Function;
80
149
  users: Mercoa.EntityUserResponse[];
81
- selectedApprovers: ({
82
- approvalSlotId: string;
83
- assignedUserId: string | undefined;
84
- } | undefined)[];
150
+ selectedApprovers: Mercoa.ApprovalSlot[];
85
151
  }): void;
86
- export declare function MetadataSelection({ schema, value, entityMetadata, setValue, hasDocument, hasNoLineItems, paymentDestination, paymentSource, lineItem, skipValidation, }: {
152
+ export declare function PayableMetadata({ skipValidation, readOnly }: {
153
+ skipValidation?: boolean;
154
+ readOnly?: boolean;
155
+ }): import("react/jsx-runtime").JSX.Element;
156
+ export declare function MetadataSelection({ schema, value, setValue, skipValidation, readOnly, lineItem, hideLabel, }: {
87
157
  schema: Mercoa.MetadataSchema;
88
158
  value?: string;
89
- entityMetadata?: Mercoa.EntityMetadataResponse;
90
159
  setValue: (e: string) => void;
91
- hasDocument: boolean;
92
- hasNoLineItems: boolean;
93
- paymentDestination?: Mercoa.PaymentMethodResponse;
94
- paymentSource?: Mercoa.PaymentMethodResponse;
95
- lineItem?: boolean;
96
160
  skipValidation?: boolean;
161
+ readOnly?: boolean;
162
+ lineItem?: boolean;
163
+ hideLabel?: boolean;
164
+ }): import("react/jsx-runtime").JSX.Element | null;
165
+ export declare function PayableLineItems({ readOnly }: {
166
+ readOnly?: boolean;
97
167
  }): import("react/jsx-runtime").JSX.Element;
@@ -29,8 +29,14 @@ export declare function PayablesTable({ statuses, search, metadata, startDate, e
29
29
  columns?: InvoiceTableColumn[];
30
30
  children?: ({ dataLoaded, invoices, hasNext, getNext, hasPrevious, getPrevious, resultsPerPage, setResultsPerPage, selectedInvoiceStatuses, setSelectedInvoiceStatues, downloadCSV, }: PayablesTableChildrenProps) => ReactElement | null;
31
31
  }): import("react/jsx-runtime").JSX.Element | null;
32
- export declare function InvoiceStatusPill({ invoice, type, }: {
33
- invoice: Mercoa.InvoiceResponse;
32
+ export declare function InvoiceStatusPill({ status, amount, payerId, vendorId, dueDate, paymentSourceId, paymentDestinationId, type, }: {
33
+ status: Mercoa.InvoiceStatus;
34
+ amount?: number;
35
+ payerId?: string;
36
+ vendorId?: string;
37
+ dueDate?: Date;
38
+ paymentSourceId?: string;
39
+ paymentDestinationId?: string;
34
40
  type?: 'payable' | 'receivable';
35
41
  }): import("react/jsx-runtime").JSX.Element;
36
42
  export declare function InvoiceMetrics({ statuses, search, returnByDate, excludePayables, excludeReceivables, children, }: {
@@ -163,3 +163,4 @@ export declare function getAllUsers(client: MercoaClient, entityId: string): Pro
163
163
  export declare function NoSession({ componentName }: {
164
164
  componentName: string;
165
165
  }): import("react/jsx-runtime").JSX.Element;
166
+ export declare function removeThousands(_value: any, originalValue: string | number): number;