@mercoa/react 0.0.40 → 0.0.42

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.
@@ -8,7 +8,6 @@ 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
11
  customPaymentMethodSchemas: Mercoa.CustomPaymentMethodSchemaResponse[];
13
12
  selectedInvoice: Mercoa.InvoiceResponse | undefined;
14
13
  setSelectedInvoice: Function;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { Mercoa } from '@mercoa/javascript';
3
+ import { FieldErrors, UseFormSetValue, UseFormWatch } from 'react-hook-form';
3
4
  export declare function PayableDetails({ invoiceId, invoice, onRedirect, heightOffset, admin, documentPosition, children, invoicePreSubmit, }: {
4
5
  invoiceId?: Mercoa.InvoiceId;
5
6
  invoice?: Mercoa.InvoiceResponse;
@@ -8,7 +9,7 @@ export declare function PayableDetails({ invoiceId, invoice, onRedirect, heightO
8
9
  admin?: boolean;
9
10
  documentPosition?: 'right' | 'left' | 'none';
10
11
  invoicePreSubmit?: (invoice: Mercoa.InvoiceCreationRequest) => Promise<Mercoa.InvoiceCreationRequest>;
11
- children?: ({ invoice, refreshInvoice, ocrResponse, uploadedDocument, setUploadedDocument, height, }: PayableFormChildrenProps) => JSX.Element;
12
+ children?: ({ invoice, refreshInvoice, ocrResponse, uploadedDocument, setUploadedDocument, height, setSelectedVendor, selectedVendor, getVendorPaymentLink, setValue, watch, }: PayableFormChildrenProps) => JSX.Element;
12
13
  }): import("react/jsx-runtime").JSX.Element;
13
14
  export type PayableFormChildrenProps = {
14
15
  invoice?: Mercoa.InvoiceResponse;
@@ -19,6 +20,13 @@ export type PayableFormChildrenProps = {
19
20
  height: number;
20
21
  setSelectedVendor: (e?: Mercoa.CounterpartyResponse) => void;
21
22
  selectedVendor?: Mercoa.CounterpartyResponse;
23
+ getVendorPaymentLink: () => Promise<string | undefined>;
24
+ setValue: (name: UseFormSetValue<Mercoa.InvoiceCreationRequest>, value: any, options?: {
25
+ shouldValidate?: boolean;
26
+ shouldDirty?: boolean;
27
+ }) => void;
28
+ watch: (name: UseFormWatch<Mercoa.InvoiceCreationRequest>) => any;
29
+ errors: FieldErrors<Mercoa.InvoiceCreationRequest>;
22
30
  };
23
31
  export declare function PayableForm({ invoice, ocrResponse, uploadedDocument, setUploadedDocument, onRedirect, refreshInvoice, height, admin, invoicePreSubmit, children, }: {
24
32
  invoice?: Mercoa.InvoiceResponse;
@@ -30,7 +38,7 @@ export declare function PayableForm({ invoice, ocrResponse, uploadedDocument, se
30
38
  height: number;
31
39
  admin?: boolean;
32
40
  invoicePreSubmit?: (invoice: Mercoa.InvoiceCreationRequest) => Promise<Mercoa.InvoiceCreationRequest>;
33
- children?: ({ invoice, refreshInvoice, ocrResponse, uploadedDocument, setUploadedDocument, height, setSelectedVendor, selectedVendor, }: PayableFormChildrenProps) => JSX.Element;
41
+ children?: ({ invoice, refreshInvoice, ocrResponse, uploadedDocument, setUploadedDocument, height, setSelectedVendor, selectedVendor, getVendorPaymentLink, setValue, watch, }: PayableFormChildrenProps) => JSX.Element;
34
42
  }): import("react/jsx-runtime").JSX.Element;
35
43
  export declare function PayableFormHeader({ hideId }: {
36
44
  hideId?: boolean;
@@ -54,17 +62,59 @@ export declare function PayableDocumentDisplay({ documents, invoice, height, sho
54
62
  height: number;
55
63
  showSourceEmail?: boolean;
56
64
  }): import("react/jsx-runtime").JSX.Element;
57
- export declare function PayableActions({ admin }: {
65
+ export declare function PayableActions({ approveButton, rejectButton, nonApproverButton, deleteButton, archiveButton, cancelButton, saveDraftButton, printCheckButton, createInvoiceButton, submitForApprovalButton, nextButton, markAsPaidButton, schedulePaymentButton, retryPaymentButton, admin, }: {
66
+ approveButton?: ({ onClick }: {
67
+ onClick: () => void;
68
+ }) => JSX.Element;
69
+ rejectButton?: ({ onClick }: {
70
+ onClick: () => void;
71
+ }) => JSX.Element;
72
+ nonApproverButton?: ({ onClick }: {
73
+ onClick: () => void;
74
+ }) => JSX.Element;
75
+ deleteButton?: ({ onClick }: {
76
+ onClick: () => void;
77
+ }) => JSX.Element;
78
+ archiveButton?: ({ onClick }: {
79
+ onClick: () => void;
80
+ }) => JSX.Element;
81
+ cancelButton?: ({ onClick }: {
82
+ onClick: () => void;
83
+ }) => JSX.Element;
84
+ saveDraftButton?: ({ onClick }: {
85
+ onClick: () => void;
86
+ }) => JSX.Element;
87
+ printCheckButton?: ({ onClick }: {
88
+ onClick: () => void;
89
+ }) => JSX.Element;
90
+ createInvoiceButton?: ({ onClick }: {
91
+ onClick: () => void;
92
+ }) => JSX.Element;
93
+ submitForApprovalButton?: ({ onClick, approversAssigned, }: {
94
+ onClick: () => void;
95
+ approversAssigned: boolean;
96
+ }) => JSX.Element;
97
+ nextButton?: ({ onClick }: {
98
+ onClick: () => void;
99
+ }) => JSX.Element;
100
+ markAsPaidButton?: ({ onClick }: {
101
+ onClick: () => void;
102
+ }) => JSX.Element;
103
+ schedulePaymentButton?: ({ onClick }: {
104
+ onClick: () => void;
105
+ }) => JSX.Element;
106
+ retryPaymentButton?: ({ onClick }: {
107
+ onClick: () => void;
108
+ }) => JSX.Element;
58
109
  admin?: boolean;
59
110
  }): import("react/jsx-runtime").JSX.Element;
60
111
  export declare function PayableOverview({ readOnly }: {
61
112
  readOnly?: boolean;
62
113
  }): import("react/jsx-runtime").JSX.Element;
63
- export declare function SelectPaymentMethod({ isSource, isDestination, disableCreation, currentPaymentMethodId, readOnly, }: {
114
+ export declare function SelectPaymentMethod({ isSource, isDestination, disableCreation, readOnly, }: {
64
115
  isSource?: boolean;
65
116
  isDestination?: boolean;
66
117
  disableCreation?: boolean;
67
- currentPaymentMethodId?: string;
68
118
  readOnly?: boolean;
69
119
  }): import("react/jsx-runtime").JSX.Element;
70
120
  export declare function PayablePaymentSource({ readOnly }: {
@@ -104,14 +154,16 @@ export declare function propagateApprovalPolicy({ userId, policyId, approvalPoli
104
154
  export declare function PayableMetadata({ skipValidation, readOnly }: {
105
155
  skipValidation?: boolean;
106
156
  readOnly?: boolean;
107
- }): import("react/jsx-runtime").JSX.Element | null;
108
- export declare function MetadataSelection({ schema, value, setValue, skipValidation, readOnly, }: {
157
+ }): import("react/jsx-runtime").JSX.Element;
158
+ export declare function MetadataSelection({ schema, value, setValue, skipValidation, readOnly, lineItem, hideLabel, }: {
109
159
  schema: Mercoa.MetadataSchema;
110
160
  value?: string;
111
161
  setValue: (e: string) => void;
112
162
  skipValidation?: boolean;
113
163
  readOnly?: boolean;
114
- }): import("react/jsx-runtime").JSX.Element;
164
+ lineItem?: boolean;
165
+ hideLabel?: boolean;
166
+ }): import("react/jsx-runtime").JSX.Element | null;
115
167
  export declare function PayableLineItems({ readOnly }: {
116
168
  readOnly?: boolean;
117
169
  }): import("react/jsx-runtime").JSX.Element;
@@ -160,8 +160,6 @@ 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[]>;
165
163
  export declare function NoSession({ componentName }: {
166
164
  componentName: string;
167
165
  }): import("react/jsx-runtime").JSX.Element;