@mercoa/react 0.0.39-rc5 → 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,22 +1,41 @@
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, }: 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
+ };
23
+ export declare function PayableForm({ invoice, ocrResponse, uploadedDocument, setUploadedDocument, onRedirect, refreshInvoice, height, admin, invoicePreSubmit, children, }: {
11
24
  invoice?: Mercoa.InvoiceResponse;
12
25
  ocrResponse?: Mercoa.OcrResponse;
13
- uploadedImage?: string;
14
- setUploadedImage: (e?: string) => void;
26
+ uploadedDocument?: string;
27
+ setUploadedDocument: (e?: string) => void;
15
28
  onRedirect: (invoice: Mercoa.InvoiceResponse | undefined) => void;
16
29
  refreshInvoice: (invoiceId: Mercoa.InvoiceId) => void;
17
30
  height: number;
18
31
  admin?: boolean;
32
+ invoicePreSubmit?: (invoice: Mercoa.InvoiceCreationRequest) => Promise<Mercoa.InvoiceCreationRequest>;
33
+ children?: ({ invoice, refreshInvoice, ocrResponse, uploadedDocument, setUploadedDocument, height, setSelectedVendor, selectedVendor, }: PayableFormChildrenProps) => JSX.Element;
19
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;
20
39
  export declare function PayableDocument({ onOCRComplete, onDocumentUpload, invoice, height, }: {
21
40
  onOCRComplete?: (ocrResponse?: Mercoa.OcrResponse) => void;
22
41
  onDocumentUpload?: ({ fileReaderObj, mimeType }: {
@@ -35,29 +54,34 @@ export declare function PayableDocumentDisplay({ documents, invoice, height, sho
35
54
  height: number;
36
55
  showSourceEmail?: boolean;
37
56
  }): 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;
57
+ export declare function PayableActions({ admin }: {
58
+ admin?: boolean;
59
+ }): import("react/jsx-runtime").JSX.Element;
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, }: {
43
64
  isSource?: boolean;
44
65
  isDestination?: boolean;
45
- vendorId?: string;
46
- payerId?: string;
66
+ disableCreation?: boolean;
47
67
  currentPaymentMethodId?: string;
48
- refreshVendorPaymentMethods: Function;
49
- refreshPayerPaymentMethods: Function;
50
- clearErrors: Function;
68
+ readOnly?: boolean;
69
+ }): import("react/jsx-runtime").JSX.Element;
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;
51
78
  }): import("react/jsx-runtime").JSX.Element;
52
79
  export declare function filterApproverOptions({ approverSlotIndex, eligibleRoles, eligibleUserIds, users, selectedApprovers, }: {
53
80
  approverSlotIndex: number;
54
81
  eligibleRoles: string[];
55
82
  eligibleUserIds: Mercoa.EntityUserId[];
56
83
  users: Mercoa.EntityUserResponse[];
57
- selectedApprovers: ({
58
- approvalSlotId: string;
59
- assignedUserId: string | undefined;
60
- } | undefined)[];
84
+ selectedApprovers: Mercoa.ApprovalSlot[];
61
85
  }): {
62
86
  user: Mercoa.EntityUserResponse;
63
87
  disabled: boolean;
@@ -66,10 +90,7 @@ export declare function isUpstreamPolicyAssigned({ policyId, approvalPolicies, a
66
90
  policyId: string;
67
91
  approvalPolicies: Mercoa.ApprovalPolicyResponse[];
68
92
  approverSlots: Mercoa.ApprovalSlot[];
69
- selectedApprovers: ({
70
- approvalSlotId: string;
71
- assignedUserId: string | undefined;
72
- } | undefined)[];
93
+ selectedApprovers: Mercoa.ApprovalSlot[];
73
94
  }): boolean;
74
95
  export declare function propagateApprovalPolicy({ userId, policyId, approvalPolicies, approverSlots, setValue, users, selectedApprovers, }: {
75
96
  userId: string;
@@ -78,20 +99,19 @@ export declare function propagateApprovalPolicy({ userId, policyId, approvalPoli
78
99
  approverSlots: Mercoa.ApprovalSlot[];
79
100
  setValue: Function;
80
101
  users: Mercoa.EntityUserResponse[];
81
- selectedApprovers: ({
82
- approvalSlotId: string;
83
- assignedUserId: string | undefined;
84
- } | undefined)[];
102
+ selectedApprovers: Mercoa.ApprovalSlot[];
85
103
  }): void;
86
- export declare function MetadataSelection({ schema, value, entityMetadata, setValue, hasDocument, hasNoLineItems, paymentDestination, paymentSource, lineItem, skipValidation, }: {
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, }: {
87
109
  schema: Mercoa.MetadataSchema;
88
110
  value?: string;
89
- entityMetadata?: Mercoa.EntityMetadataResponse;
90
111
  setValue: (e: string) => void;
91
- hasDocument: boolean;
92
- hasNoLineItems: boolean;
93
- paymentDestination?: Mercoa.PaymentMethodResponse;
94
- paymentSource?: Mercoa.PaymentMethodResponse;
95
- lineItem?: boolean;
96
112
  skipValidation?: boolean;
113
+ readOnly?: boolean;
114
+ }): import("react/jsx-runtime").JSX.Element;
115
+ export declare function PayableLineItems({ readOnly }: {
116
+ readOnly?: boolean;
97
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, }: {
@@ -160,6 +160,9 @@ export declare function CountPill({ count, selected }: {
160
160
  selected: boolean;
161
161
  }): import("react/jsx-runtime").JSX.Element;
162
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[]>;
163
165
  export declare function NoSession({ componentName }: {
164
166
  componentName: string;
165
167
  }): import("react/jsx-runtime").JSX.Element;
168
+ export declare function removeThousands(_value: any, originalValue: string | number): number;