@bunnyapp/components 1.8.0-beta.5 → 1.8.0-beta.7
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.
- package/dist/cjs/index.js +435 -381
- package/dist/cjs/types/src/ajax.d.ts +1 -1
- package/dist/cjs/types/src/components/PandadocPollingModal.d.ts +1 -1
- package/dist/cjs/types/src/components/Quote/Quote.d.ts +28 -1
- package/dist/cjs/types/src/components/Quote/components/PaymentHoldDisplay.d.ts +18 -0
- package/dist/cjs/types/src/components/Quote/components/QuoteButtons.d.ts +12 -4
- package/dist/cjs/types/src/components/Quote/hooks/{useSendAcceptQuote.d.ts → useAcceptQuote.d.ts} +6 -3
- package/dist/cjs/types/src/components/Quote/hooks/useQuotePaymentHold.d.ts +20 -0
- package/dist/cjs/types/src/{graphql → components/Quote}/queries/getFormattedQuote.d.ts +6 -1
- package/dist/cjs/types/src/components/Quote/queries/quoteAccept.d.ts +14 -0
- package/dist/cjs/types/src/contexts/InvoiceQuoteContext.d.ts +1 -3
- package/dist/cjs/types/src/graphql/queries/getFormattedInvoice.d.ts +1 -1
- package/dist/cjs/types/src/utils/QueryKeyFactory.d.ts +4 -4
- package/dist/esm/index.js +435 -381
- package/dist/esm/types/src/ajax.d.ts +1 -1
- package/dist/esm/types/src/components/PandadocPollingModal.d.ts +1 -1
- package/dist/esm/types/src/components/Quote/Quote.d.ts +28 -1
- package/dist/esm/types/src/components/Quote/components/PaymentHoldDisplay.d.ts +18 -0
- package/dist/esm/types/src/components/Quote/components/QuoteButtons.d.ts +12 -4
- package/dist/esm/types/src/components/Quote/hooks/{useSendAcceptQuote.d.ts → useAcceptQuote.d.ts} +6 -3
- package/dist/esm/types/src/components/Quote/hooks/useQuotePaymentHold.d.ts +20 -0
- package/dist/esm/types/src/{graphql → components/Quote}/queries/getFormattedQuote.d.ts +6 -1
- package/dist/esm/types/src/components/Quote/queries/quoteAccept.d.ts +14 -0
- package/dist/esm/types/src/contexts/InvoiceQuoteContext.d.ts +1 -3
- package/dist/esm/types/src/graphql/queries/getFormattedInvoice.d.ts +1 -1
- package/dist/esm/types/src/utils/QueryKeyFactory.d.ts +4 -4
- package/dist/index.d.ts +14 -5
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const useDownloadFile: (id?: string, onError?: (error: any) => void) => (url: string, token?: string) => Promise<any>;
|
|
1
|
+
export declare const useDownloadFile: (id?: string | null | undefined, onError?: (error: any) => void) => (url: string, token?: string) => Promise<any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface PandadocPollingModalProps {
|
|
2
2
|
isVisible: boolean;
|
|
3
3
|
setVisible: (visible: boolean) => void;
|
|
4
|
-
id?: string;
|
|
4
|
+
id?: string | null | undefined;
|
|
5
5
|
}
|
|
6
6
|
declare const PandadocPollingModal: ({ isVisible, setVisible, id }: PandadocPollingModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default PandadocPollingModal;
|
|
@@ -1,9 +1,36 @@
|
|
|
1
|
+
import { ResultOf } from 'gql.tada';
|
|
1
2
|
import { InvoiceQuoteContextProps } from '../../contexts/InvoiceQuoteContext';
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const Quote_PaymentHoldFragment: import("gql.tada").TadaDocumentNode<{
|
|
4
|
+
quote: {
|
|
5
|
+
currentPaymentHold: {
|
|
6
|
+
[$tada.fragmentRefs]: {
|
|
7
|
+
PaymentHoldDisplay_QuoteButtonsFragment: "PaymentHold";
|
|
8
|
+
};
|
|
9
|
+
} | null;
|
|
10
|
+
firstInvoice: {
|
|
11
|
+
id: string | null;
|
|
12
|
+
} | null;
|
|
13
|
+
};
|
|
14
|
+
}, {}, {
|
|
15
|
+
fragment: "Quote_PaymentHoldFragment";
|
|
16
|
+
on: "FormattedQuote";
|
|
17
|
+
masked: true;
|
|
18
|
+
}>;
|
|
19
|
+
declare const OnQuoteLoadedFragment: import("gql.tada").TadaDocumentNode<{
|
|
20
|
+
vendorName: string | null;
|
|
21
|
+
quote: {
|
|
22
|
+
id: string | null;
|
|
23
|
+
};
|
|
24
|
+
}, {}, {
|
|
25
|
+
fragment: "OnQuoteLoadedFragment";
|
|
26
|
+
on: "FormattedQuote";
|
|
27
|
+
masked: true;
|
|
28
|
+
}>;
|
|
3
29
|
type QuoteProps = InvoiceQuoteContextProps & {
|
|
4
30
|
onQuoteAccepted?: () => void;
|
|
5
31
|
onQuoteUnavailableError?: () => void;
|
|
6
32
|
suppressQuoteUnavailableErrorNotification?: boolean;
|
|
33
|
+
onQuoteLoaded?: (formattedQuote: ResultOf<typeof OnQuoteLoadedFragment>) => void;
|
|
7
34
|
};
|
|
8
35
|
export default function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, onQuoteLoaded, onQuoteAccepted, onQuoteUnavailableError, suppressQuoteUnavailableErrorNotification, }: QuoteProps): import("react/jsx-runtime").JSX.Element;
|
|
9
36
|
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FragmentOf } from 'gql.tada';
|
|
2
|
+
export declare const PaymentHoldDisplay_PaymentHoldFragment: import("gql.tada").TadaDocumentNode<{
|
|
3
|
+
expiresAt: unknown;
|
|
4
|
+
paymentMethod: {
|
|
5
|
+
metadata: {
|
|
6
|
+
identifier: string | null;
|
|
7
|
+
} | null;
|
|
8
|
+
} | null;
|
|
9
|
+
}, {}, {
|
|
10
|
+
fragment: "PaymentHoldDisplay_PaymentHoldFragment";
|
|
11
|
+
on: "PaymentHold";
|
|
12
|
+
masked: true;
|
|
13
|
+
}>;
|
|
14
|
+
export declare function PaymentHoldDisplay({ paymentHold: maskedPaymentHold, currency, amount, }: {
|
|
15
|
+
paymentHold: FragmentOf<typeof PaymentHoldDisplay_PaymentHoldFragment>;
|
|
16
|
+
currency: string | null;
|
|
17
|
+
amount: number;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import PaymentHold from '@/types/PaymentHold';
|
|
2
1
|
import { FragmentOf } from 'gql.tada';
|
|
3
2
|
export declare const QuoteButtons_FormattedQuoteFragment: import("gql.tada").TadaDocumentNode<{
|
|
4
3
|
acceptedAt: unknown;
|
|
@@ -11,17 +10,26 @@ export declare const QuoteButtons_FormattedQuoteFragment: import("gql.tada").Tad
|
|
|
11
10
|
on: "FormattedQuote";
|
|
12
11
|
masked: true;
|
|
13
12
|
}>;
|
|
14
|
-
export declare
|
|
13
|
+
export declare const PaymentHoldDisplay_QuoteButtonsFragment: import("gql.tada").TadaDocumentNode<{
|
|
14
|
+
[$tada.fragmentRefs]: {
|
|
15
|
+
PaymentHoldDisplay_PaymentHoldFragment: "PaymentHold";
|
|
16
|
+
};
|
|
17
|
+
}, {}, {
|
|
18
|
+
fragment: "PaymentHoldDisplay_QuoteButtonsFragment";
|
|
19
|
+
on: "PaymentHold";
|
|
20
|
+
masked: true;
|
|
21
|
+
}>;
|
|
22
|
+
export declare function QuoteButtons({ isAccepted, formattedQuote: maskedFormattedQuote, isMobile, hideDownloadButton, id, isAccepting, handleClickAccept, setPaymentHoldModalVisible, shouldDoPaymentHold, paymentHoldCompleted, paymentHold: maskedPaymentHold, isSendAcceptPending, }: {
|
|
15
23
|
isAccepted: boolean;
|
|
16
24
|
formattedQuote: FragmentOf<typeof QuoteButtons_FormattedQuoteFragment>;
|
|
17
25
|
isMobile: boolean;
|
|
18
26
|
hideDownloadButton?: boolean;
|
|
19
|
-
id?: string;
|
|
27
|
+
id?: string | null | undefined;
|
|
20
28
|
isAccepting: boolean;
|
|
21
29
|
handleClickAccept: () => void;
|
|
22
30
|
setPaymentHoldModalVisible: (visible: boolean) => void;
|
|
23
31
|
shouldDoPaymentHold: boolean;
|
|
24
32
|
paymentHoldCompleted: boolean;
|
|
25
|
-
paymentHold:
|
|
33
|
+
paymentHold: FragmentOf<typeof PaymentHoldDisplay_QuoteButtonsFragment> | undefined | null;
|
|
26
34
|
isSendAcceptPending: boolean;
|
|
27
35
|
}): import("react/jsx-runtime").JSX.Element;
|
package/dist/cjs/types/src/components/Quote/hooks/{useSendAcceptQuote.d.ts → useAcceptQuote.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const
|
|
1
|
+
export declare const useAcceptQuote: ({ quoteId, apiHost, token, onQuoteAccepted, }: {
|
|
2
2
|
quoteId?: string;
|
|
3
3
|
apiHost: string;
|
|
4
4
|
token?: string;
|
|
@@ -6,7 +6,11 @@ declare const useSendAcceptQuote: ({ quoteId, apiHost, token, onQuoteAccepted, }
|
|
|
6
6
|
}) => {
|
|
7
7
|
acceptBoxVisible: boolean;
|
|
8
8
|
isAccepting: boolean;
|
|
9
|
-
sendAccept: import("@tanstack/react-query").UseMutateFunction<
|
|
9
|
+
sendAccept: import("@tanstack/react-query").UseMutateFunction<{
|
|
10
|
+
quoteAccept: {
|
|
11
|
+
errors: string | null;
|
|
12
|
+
} | null;
|
|
13
|
+
}, Error, {
|
|
10
14
|
[key: string]: string;
|
|
11
15
|
}, unknown>;
|
|
12
16
|
setAcceptBoxVisible: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
@@ -16,4 +20,3 @@ declare const useSendAcceptQuote: ({ quoteId, apiHost, token, onQuoteAccepted, }
|
|
|
16
20
|
setPandadocPollingModalVisible: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
17
21
|
isSendAcceptPending: boolean;
|
|
18
22
|
};
|
|
19
|
-
export default useSendAcceptQuote;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FragmentOf } from 'gql.tada';
|
|
2
|
+
export declare const useQuotePaymentHold_FormattedQuoteFragment: import("gql.tada").TadaDocumentNode<{
|
|
3
|
+
quote: {
|
|
4
|
+
payToAccept: boolean | null;
|
|
5
|
+
currentPaymentHold: {
|
|
6
|
+
id: string | null;
|
|
7
|
+
} | null;
|
|
8
|
+
};
|
|
9
|
+
}, {}, {
|
|
10
|
+
fragment: "useQuotePaymentHold_FormattedQuoteFragment";
|
|
11
|
+
on: "FormattedQuote";
|
|
12
|
+
masked: true;
|
|
13
|
+
}>;
|
|
14
|
+
declare const useQuotePaymentHold: (maskedFormattedQuote?: FragmentOf<typeof useQuotePaymentHold_FormattedQuoteFragment>) => {
|
|
15
|
+
paymentHoldModalVisible: boolean;
|
|
16
|
+
setPaymentHoldModalVisible: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
17
|
+
shouldDoPaymentHold: boolean;
|
|
18
|
+
paymentHoldCompleted: boolean;
|
|
19
|
+
};
|
|
20
|
+
export default useQuotePaymentHold;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const getFormattedQuote: ({ token, apiHost, id, }: {
|
|
2
2
|
apiHost: string;
|
|
3
3
|
token?: string;
|
|
4
|
-
id?: string;
|
|
4
|
+
id?: string | null | undefined;
|
|
5
5
|
}) => Promise<{
|
|
6
6
|
quote: {
|
|
7
7
|
documentTemplateId: string | null;
|
|
@@ -45,6 +45,9 @@ declare const getFormattedQuote: ({ token, apiHost, id, }: {
|
|
|
45
45
|
kind: string | null;
|
|
46
46
|
} | null;
|
|
47
47
|
} | null;
|
|
48
|
+
[$tada.fragmentRefs]: {
|
|
49
|
+
PaymentHoldDisplay_QuoteButtonsFragment: "PaymentHold";
|
|
50
|
+
};
|
|
48
51
|
} | null;
|
|
49
52
|
};
|
|
50
53
|
payableId: string | null;
|
|
@@ -141,6 +144,8 @@ declare const getFormattedQuote: ({ token, apiHost, id, }: {
|
|
|
141
144
|
taxNumberRequired: boolean | null;
|
|
142
145
|
vendorName: string | null;
|
|
143
146
|
[$tada.fragmentRefs]: {
|
|
147
|
+
useQuotePaymentHold_FormattedQuoteFragment: "FormattedQuote";
|
|
148
|
+
} & {
|
|
144
149
|
PaymentHoldModal_FormattedQuoteFragment: "FormattedQuote";
|
|
145
150
|
} & {
|
|
146
151
|
AcceptQuoteModal_FormattedQuoteFragment: "FormattedQuote";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type QuoteAcceptProps = {
|
|
2
|
+
apiHost: string;
|
|
3
|
+
changedFormItems: {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
};
|
|
6
|
+
quoteId?: string;
|
|
7
|
+
token?: string;
|
|
8
|
+
};
|
|
9
|
+
declare const quoteAccept: ({ quoteId, apiHost, token, changedFormItems }: QuoteAcceptProps) => Promise<{
|
|
10
|
+
quoteAccept: {
|
|
11
|
+
errors: string | null;
|
|
12
|
+
} | null;
|
|
13
|
+
}>;
|
|
14
|
+
export default quoteAccept;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { ShadowType } from '../types/shadowType';
|
|
2
2
|
import FormattedInvoice from '@/types/FormattedInvoice';
|
|
3
|
-
import { FormattedQuote } from '@/types/FormattedQuote';
|
|
4
3
|
export type InvoiceQuoteContextProps = {
|
|
5
|
-
id?: string;
|
|
4
|
+
id?: string | null | undefined;
|
|
6
5
|
invoiceQuoteViewComponent?: React.ReactNode;
|
|
7
6
|
backButtonName?: string;
|
|
8
7
|
onBackButtonClick?: () => void;
|
|
@@ -12,7 +11,6 @@ export type InvoiceQuoteContextProps = {
|
|
|
12
11
|
className?: string;
|
|
13
12
|
hideDownloadButton?: boolean;
|
|
14
13
|
onInvoiceLoaded?: (formattedInvoice: FormattedInvoice) => void;
|
|
15
|
-
onQuoteLoaded?: (formattedQuote: FormattedQuote) => void;
|
|
16
14
|
onQuoteUnavailableError?: () => void;
|
|
17
15
|
suppressQuoteUnavailableErrorNotification?: boolean;
|
|
18
16
|
};
|
|
@@ -38,7 +38,7 @@ interface TableKeyParams {
|
|
|
38
38
|
token?: string;
|
|
39
39
|
}
|
|
40
40
|
interface FormattedInvoiceKeyParams {
|
|
41
|
-
id?: string;
|
|
41
|
+
id?: string | null | undefined;
|
|
42
42
|
token?: string;
|
|
43
43
|
}
|
|
44
44
|
interface InvoiceKeyParams {
|
|
@@ -55,7 +55,7 @@ interface PortalPreviewDataKeyParams {
|
|
|
55
55
|
token?: string;
|
|
56
56
|
}
|
|
57
57
|
interface QuoteKeyParams {
|
|
58
|
-
id?: string;
|
|
58
|
+
id?: string | null | undefined;
|
|
59
59
|
token?: string;
|
|
60
60
|
}
|
|
61
61
|
interface QuoteTaxCalculateKeyParams {
|
|
@@ -78,10 +78,10 @@ declare const QueryKeyFactory: {
|
|
|
78
78
|
brandingKey: (token?: string) => string[];
|
|
79
79
|
calculatedPricesKey: ({ priceListId, quantity, token }: CalculatedPricesKeyParams) => (string | number)[];
|
|
80
80
|
createEventsKey: ({ entityId, pluralType, token }: EventsKeyParams) => string[];
|
|
81
|
-
createFormattedInvoiceKey: ({ id, token }: FormattedInvoiceKeyParams) => (string | undefined)[];
|
|
81
|
+
createFormattedInvoiceKey: ({ id, token }: FormattedInvoiceKeyParams) => (string | null | undefined)[];
|
|
82
82
|
createInvoiceKey: ({ id, token }: InvoiceKeyParams) => (string | undefined)[];
|
|
83
83
|
createObjectKey: ({ id, objectName, token }: ObjectKeyParams) => string[];
|
|
84
|
-
createQuoteKey: ({ id, token }: QuoteKeyParams) => (string | undefined)[];
|
|
84
|
+
createQuoteKey: ({ id, token }: QuoteKeyParams) => (string | null | undefined)[];
|
|
85
85
|
createQuoteTaxCalculateKey: ({ id, token }: QuoteTaxCalculateKeyParams) => string[];
|
|
86
86
|
createTableKey: ({ filterString, pluralType, token }: TableKeyParams) => (string | undefined)[];
|
|
87
87
|
currentUserKey: (token?: string) => string[];
|