@mercoa/react 0.0.39-rc4 → 0.0.40

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,8 @@ export interface MercoaContext {
8
8
  entity: Mercoa.EntityResponse | undefined;
9
9
  user: Mercoa.EntityUserResponse | undefined;
10
10
  users: Mercoa.EntityUserResponse[];
11
+ metadata: Mercoa.EntityMetadataResponse[];
12
+ customPaymentMethodSchemas: Mercoa.CustomPaymentMethodSchemaResponse[];
11
13
  selectedInvoice: Mercoa.InvoiceResponse | undefined;
12
14
  setSelectedInvoice: Function;
13
15
  client: MercoaClient | undefined;
@@ -1,13 +1,51 @@
1
+ /// <reference types="react" />
1
2
  import { Mercoa } from '@mercoa/javascript';
2
- export declare function PayableDetails({ invoiceId, invoice, onRedirect, heightOffset, admin, layout, }: {
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
- layout?: 'right' | 'left';
9
+ documentPosition?: 'right' | 'left' | 'none';
10
+ invoicePreSubmit?: (invoice: Mercoa.InvoiceCreationRequest) => Promise<Mercoa.InvoiceCreationRequest>;
11
+ children?: ({ invoice, refreshInvoice, ocrResponse, uploadedDocument, setUploadedDocument, height, }: PayableFormChildrenProps) => JSX.Element;
9
12
  }): import("react/jsx-runtime").JSX.Element;
10
- export declare function InvoiceDocuments({ documents, invoice, height, showSourceEmail, }: {
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
+ };
23
+ export declare function PayableForm({ invoice, ocrResponse, uploadedDocument, setUploadedDocument, onRedirect, refreshInvoice, height, admin, invoicePreSubmit, children, }: {
24
+ invoice?: Mercoa.InvoiceResponse;
25
+ ocrResponse?: Mercoa.OcrResponse;
26
+ uploadedDocument?: string;
27
+ setUploadedDocument: (e?: string) => void;
28
+ onRedirect: (invoice: Mercoa.InvoiceResponse | undefined) => void;
29
+ refreshInvoice: (invoiceId: Mercoa.InvoiceId) => void;
30
+ height: number;
31
+ admin?: boolean;
32
+ invoicePreSubmit?: (invoice: Mercoa.InvoiceCreationRequest) => Promise<Mercoa.InvoiceCreationRequest>;
33
+ children?: ({ invoice, refreshInvoice, ocrResponse, uploadedDocument, setUploadedDocument, height, setSelectedVendor, selectedVendor, }: PayableFormChildrenProps) => JSX.Element;
34
+ }): import("react/jsx-runtime").JSX.Element;
35
+ export declare function PayableFormHeader({ hideId }: {
36
+ hideId?: boolean;
37
+ }): import("react/jsx-runtime").JSX.Element;
38
+ export declare function PayableFormErrors(): import("react/jsx-runtime").JSX.Element | null;
39
+ export declare function PayableDocument({ onOCRComplete, onDocumentUpload, invoice, height, }: {
40
+ onOCRComplete?: (ocrResponse?: Mercoa.OcrResponse) => void;
41
+ onDocumentUpload?: ({ fileReaderObj, mimeType }: {
42
+ fileReaderObj: string;
43
+ mimeType: string;
44
+ }) => void;
45
+ invoice?: Mercoa.InvoiceResponse;
46
+ height: number;
47
+ }): import("react/jsx-runtime").JSX.Element;
48
+ export declare function PayableDocumentDisplay({ documents, invoice, height, showSourceEmail, }: {
11
49
  documents?: Array<{
12
50
  fileReaderObj: string;
13
51
  mimeType: string;
@@ -16,51 +54,34 @@ export declare function InvoiceDocuments({ documents, invoice, height, showSourc
16
54
  height: number;
17
55
  showSourceEmail?: boolean;
18
56
  }): import("react/jsx-runtime").JSX.Element;
19
- export declare function EditPayableForm({ invoice, ocrResponse, uploadedImage, setUploadedImage, onRedirect, refreshInvoice, height, admin, }: {
20
- invoice?: Mercoa.InvoiceResponse;
21
- ocrResponse?: Mercoa.OcrResponse;
22
- uploadedImage?: string;
23
- setUploadedImage: (e?: string) => void;
24
- onRedirect: (invoice: Mercoa.InvoiceResponse | undefined) => void;
25
- refreshInvoice: (invoiceId: Mercoa.InvoiceId) => void;
26
- height: number;
57
+ export declare function PayableActions({ admin }: {
27
58
  admin?: boolean;
28
59
  }): import("react/jsx-runtime").JSX.Element;
29
- export declare function SelectPaymentMethod({ paymentMethods, paymentMethodSchemas, watch, setValue, isSource, isDestination, vendorId, payerId, currentPaymentMethodId, refreshVendorPaymentMethods, refreshPayerPaymentMethods, clearErrors, }: {
30
- paymentMethods: Array<Mercoa.PaymentMethodResponse>;
31
- paymentMethodSchemas: Array<Mercoa.CustomPaymentMethodSchemaResponse>;
32
- watch: Function;
33
- setValue: Function;
60
+ export declare function PayableOverview({ readOnly }: {
61
+ readOnly?: boolean;
62
+ }): import("react/jsx-runtime").JSX.Element;
63
+ export declare function SelectPaymentMethod({ isSource, isDestination, disableCreation, currentPaymentMethodId, readOnly, }: {
34
64
  isSource?: boolean;
35
65
  isDestination?: boolean;
36
- vendorId?: string;
37
- payerId?: string;
66
+ disableCreation?: boolean;
38
67
  currentPaymentMethodId?: string;
39
- refreshVendorPaymentMethods: Function;
40
- refreshPayerPaymentMethods: Function;
41
- clearErrors: Function;
68
+ readOnly?: boolean;
42
69
  }): import("react/jsx-runtime").JSX.Element;
43
- export declare function MetadataSelection({ schema, value, entityMetadata, setValue, hasDocument, hasNoLineItems, paymentDestination, paymentSource, lineItem, skipValidation, }: {
44
- schema: Mercoa.MetadataSchema;
45
- value?: string;
46
- entityMetadata?: Mercoa.EntityMetadataResponse;
47
- setValue: (e: string) => void;
48
- hasDocument: boolean;
49
- hasNoLineItems: boolean;
50
- paymentDestination?: Mercoa.PaymentMethodResponse;
51
- paymentSource?: Mercoa.PaymentMethodResponse;
52
- lineItem?: boolean;
53
- skipValidation?: boolean;
70
+ export declare function PayablePaymentSource({ readOnly }: {
71
+ readOnly?: boolean;
72
+ }): import("react/jsx-runtime").JSX.Element;
73
+ export declare function PayablePaymentDestination({ readOnly }: {
74
+ readOnly?: boolean;
75
+ }): import("react/jsx-runtime").JSX.Element;
76
+ export declare function PayableApprovers({ readOnly }: {
77
+ readOnly?: boolean;
54
78
  }): import("react/jsx-runtime").JSX.Element;
55
79
  export declare function filterApproverOptions({ approverSlotIndex, eligibleRoles, eligibleUserIds, users, selectedApprovers, }: {
56
80
  approverSlotIndex: number;
57
81
  eligibleRoles: string[];
58
82
  eligibleUserIds: Mercoa.EntityUserId[];
59
83
  users: Mercoa.EntityUserResponse[];
60
- selectedApprovers: ({
61
- approvalSlotId: string;
62
- assignedUserId: string | undefined;
63
- } | undefined)[];
84
+ selectedApprovers: Mercoa.ApprovalSlot[];
64
85
  }): {
65
86
  user: Mercoa.EntityUserResponse;
66
87
  disabled: boolean;
@@ -69,10 +90,7 @@ export declare function isUpstreamPolicyAssigned({ policyId, approvalPolicies, a
69
90
  policyId: string;
70
91
  approvalPolicies: Mercoa.ApprovalPolicyResponse[];
71
92
  approverSlots: Mercoa.ApprovalSlot[];
72
- selectedApprovers: ({
73
- approvalSlotId: string;
74
- assignedUserId: string | undefined;
75
- } | undefined)[];
93
+ selectedApprovers: Mercoa.ApprovalSlot[];
76
94
  }): boolean;
77
95
  export declare function propagateApprovalPolicy({ userId, policyId, approvalPolicies, approverSlots, setValue, users, selectedApprovers, }: {
78
96
  userId: string;
@@ -81,8 +99,19 @@ export declare function propagateApprovalPolicy({ userId, policyId, approvalPoli
81
99
  approverSlots: Mercoa.ApprovalSlot[];
82
100
  setValue: Function;
83
101
  users: Mercoa.EntityUserResponse[];
84
- selectedApprovers: ({
85
- approvalSlotId: string;
86
- assignedUserId: string | undefined;
87
- } | undefined)[];
102
+ selectedApprovers: Mercoa.ApprovalSlot[];
88
103
  }): void;
104
+ export declare function PayableMetadata({ skipValidation, readOnly }: {
105
+ skipValidation?: boolean;
106
+ readOnly?: boolean;
107
+ }): import("react/jsx-runtime").JSX.Element | null;
108
+ export declare function MetadataSelection({ schema, value, setValue, skipValidation, readOnly, }: {
109
+ schema: Mercoa.MetadataSchema;
110
+ value?: string;
111
+ setValue: (e: string) => void;
112
+ skipValidation?: boolean;
113
+ readOnly?: boolean;
114
+ }): import("react/jsx-runtime").JSX.Element;
115
+ export declare function PayableLineItems({ readOnly }: {
116
+ readOnly?: boolean;
117
+ }): 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, }: {
@@ -49,10 +49,11 @@ export declare function DefaultPaymentMethodIndicator({ paymentMethod, }: {
49
49
  isDefaultSource: boolean;
50
50
  };
51
51
  }): import("react/jsx-runtime").JSX.Element;
52
- export declare function PaymentMethodList({ accounts, showEdit, children, }: {
52
+ export declare function PaymentMethodList({ accounts, showEdit, addAccount, formatAccount, }: {
53
53
  accounts?: Mercoa.PaymentMethodResponse[];
54
54
  showEdit?: boolean;
55
- children: Function;
55
+ addAccount?: JSX.Element;
56
+ formatAccount: (account: any) => JSX.Element | JSX.Element[] | null;
56
57
  }): import("react/jsx-runtime").JSX.Element;
57
58
  export declare function Switch({ register, name, label, disabled, }: {
58
59
  register: Function;
@@ -159,6 +160,9 @@ export declare function CountPill({ count, selected }: {
159
160
  selected: boolean;
160
161
  }): import("react/jsx-runtime").JSX.Element;
161
162
  export declare function getAllUsers(client: MercoaClient, entityId: string): Promise<Mercoa.EntityUserResponse[]>;
163
+ export declare function getEntityMetadata(client: MercoaClient, entityId: string): Promise<Mercoa.EntityMetadataResponse[]>;
164
+ export declare function getPaymentMethodSchemas(client: MercoaClient): Promise<Mercoa.CustomPaymentMethodSchemaResponse[]>;
162
165
  export declare function NoSession({ componentName }: {
163
166
  componentName: string;
164
167
  }): import("react/jsx-runtime").JSX.Element;
168
+ export declare function removeThousands(_value: any, originalValue: string | number): number;