@bunnyapp/components 1.8.0-beta.44 → 1.8.0-beta.45
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 +41 -41
- package/dist/cjs/types/src/components/index.d.ts +5 -2
- package/dist/cjs/types/src/components/tables/InfiniteTable/InfiniteResourceTable.d.ts +41 -0
- package/dist/cjs/types/src/components/tables/InfiniteTable/InfiniteTable.d.ts +29 -0
- package/dist/cjs/types/src/components/tables/InfiniteTable/InfiniteTableFooter.d.ts +9 -0
- package/dist/cjs/types/src/components/tables/InfiniteTable/InfiniteTableGridCell.d.ts +2 -0
- package/dist/cjs/types/src/components/tables/InfiniteTable/InfiniteTableHeader.d.ts +5 -0
- package/dist/cjs/types/src/components/tables/InfiniteTable/hooks/useAutoRowsPerPage.d.ts +11 -0
- package/dist/cjs/types/src/components/tables/InfiniteTable/hooks/useContainerWidth.d.ts +1 -0
- package/dist/cjs/types/src/components/tables/InfiniteTable/index.d.ts +4 -0
- package/dist/cjs/types/src/components/tables/InfiniteTable/types.d.ts +54 -0
- package/dist/cjs/types/src/components/tables/Invoices/Invoices.d.ts +25 -0
- package/dist/cjs/types/src/components/tables/Invoices/index.d.ts +1 -0
- package/dist/cjs/types/src/components/tables/Invoices/invoicesList/InvoiceMobileRow.d.ts +10 -0
- package/dist/cjs/types/src/components/tables/Invoices/invoicesList/getInvoiceColumns.d.ts +22 -0
- package/dist/cjs/types/src/components/tables/Quotes/Quotes.d.ts +20 -0
- package/dist/cjs/types/src/components/tables/Quotes/quotesList/QuoteMobileRow.d.ts +9 -0
- package/dist/cjs/types/src/components/tables/Quotes/quotesList/getQuoteColumns.d.ts +22 -0
- package/dist/cjs/types/src/components/tables/Transactions/Transactions.d.ts +26 -0
- package/dist/cjs/types/src/components/{Transactions → tables/Transactions}/Transactions.stories.d.ts +0 -3
- package/dist/cjs/types/src/components/tables/Transactions/transactionsList/TransactionDetail.d.ts +7 -0
- package/dist/cjs/types/src/components/tables/Transactions/transactionsList/TransactionMobileRow.d.ts +11 -0
- package/dist/cjs/types/src/components/tables/Transactions/transactionsList/getTransactionColumns.d.ts +16 -0
- package/dist/cjs/types/src/components/{Transactions → tables/Transactions}/transactionsList/utils.d.ts +1 -1
- package/dist/cjs/types/src/components/tables/Transactions/types.d.ts +1 -0
- package/dist/cjs/types/src/graphql/queries/getInvoices.d.ts +11 -0
- package/dist/cjs/types/src/graphql/queries/getQuotes.d.ts +8 -3
- package/dist/cjs/types/src/graphql/queries/getTransactions.d.ts +9 -1
- package/dist/cjs/types/src/graphql/queries/paginatedQuery.d.ts +22 -0
- package/dist/cjs/types/src/utils/QueryKeyFactory.d.ts +14 -2
- package/dist/esm/index.js +41 -41
- package/dist/esm/types/src/components/index.d.ts +5 -2
- package/dist/esm/types/src/components/tables/InfiniteTable/InfiniteResourceTable.d.ts +41 -0
- package/dist/esm/types/src/components/tables/InfiniteTable/InfiniteTable.d.ts +29 -0
- package/dist/esm/types/src/components/tables/InfiniteTable/InfiniteTableFooter.d.ts +9 -0
- package/dist/esm/types/src/components/tables/InfiniteTable/InfiniteTableGridCell.d.ts +2 -0
- package/dist/esm/types/src/components/tables/InfiniteTable/InfiniteTableHeader.d.ts +5 -0
- package/dist/esm/types/src/components/tables/InfiniteTable/hooks/useAutoRowsPerPage.d.ts +11 -0
- package/dist/esm/types/src/components/tables/InfiniteTable/hooks/useContainerWidth.d.ts +1 -0
- package/dist/esm/types/src/components/tables/InfiniteTable/index.d.ts +4 -0
- package/dist/esm/types/src/components/tables/InfiniteTable/types.d.ts +54 -0
- package/dist/esm/types/src/components/tables/Invoices/Invoices.d.ts +25 -0
- package/dist/esm/types/src/components/tables/Invoices/index.d.ts +1 -0
- package/dist/esm/types/src/components/tables/Invoices/invoicesList/InvoiceMobileRow.d.ts +10 -0
- package/dist/esm/types/src/components/tables/Invoices/invoicesList/getInvoiceColumns.d.ts +22 -0
- package/dist/esm/types/src/components/tables/Quotes/Quotes.d.ts +20 -0
- package/dist/esm/types/src/components/tables/Quotes/quotesList/QuoteMobileRow.d.ts +9 -0
- package/dist/esm/types/src/components/tables/Quotes/quotesList/getQuoteColumns.d.ts +22 -0
- package/dist/esm/types/src/components/tables/Transactions/Transactions.d.ts +26 -0
- package/dist/esm/types/src/components/{Transactions → tables/Transactions}/Transactions.stories.d.ts +0 -3
- package/dist/esm/types/src/components/tables/Transactions/transactionsList/TransactionDetail.d.ts +7 -0
- package/dist/esm/types/src/components/tables/Transactions/transactionsList/TransactionMobileRow.d.ts +11 -0
- package/dist/esm/types/src/components/tables/Transactions/transactionsList/getTransactionColumns.d.ts +16 -0
- package/dist/esm/types/src/components/{Transactions → tables/Transactions}/transactionsList/utils.d.ts +1 -1
- package/dist/esm/types/src/components/tables/Transactions/types.d.ts +1 -0
- package/dist/esm/types/src/graphql/queries/getInvoices.d.ts +11 -0
- package/dist/esm/types/src/graphql/queries/getQuotes.d.ts +8 -3
- package/dist/esm/types/src/graphql/queries/getTransactions.d.ts +9 -1
- package/dist/esm/types/src/graphql/queries/paginatedQuery.d.ts +22 -0
- package/dist/esm/types/src/utils/QueryKeyFactory.d.ts +14 -2
- package/dist/index.d.ts +147 -72
- package/package.json +1 -1
- package/dist/cjs/types/src/components/Quotes/Quotes.d.ts +0 -38
- package/dist/cjs/types/src/components/Transactions/Transactions.d.ts +0 -56
- package/dist/cjs/types/src/components/Transactions/transactionsList/TransactionGridCell.d.ts +0 -2
- package/dist/cjs/types/src/components/Transactions/transactionsList/TransactionsEmptyState.d.ts +0 -2
- package/dist/cjs/types/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +0 -7
- package/dist/cjs/types/src/components/Transactions/transactionsList/TransactionsListMobile.d.ts +0 -6
- package/dist/cjs/types/src/contexts/TransactionsListContext.d.ts +0 -30
- package/dist/esm/types/src/components/Quotes/Quotes.d.ts +0 -38
- package/dist/esm/types/src/components/Transactions/Transactions.d.ts +0 -56
- package/dist/esm/types/src/components/Transactions/transactionsList/TransactionGridCell.d.ts +0 -2
- package/dist/esm/types/src/components/Transactions/transactionsList/TransactionsEmptyState.d.ts +0 -2
- package/dist/esm/types/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts +0 -7
- package/dist/esm/types/src/components/Transactions/transactionsList/TransactionsListMobile.d.ts +0 -6
- package/dist/esm/types/src/contexts/TransactionsListContext.d.ts +0 -30
- /package/dist/cjs/types/src/components/{Quotes → tables/Quotes}/Quotes.stories.d.ts +0 -0
- /package/dist/cjs/types/src/components/{Quotes → tables/Quotes}/index.d.ts +0 -0
- /package/dist/cjs/types/src/components/{Transactions → tables/Transactions}/index.d.ts +0 -0
- /package/dist/cjs/types/src/components/{Transactions → tables/Transactions}/transactionsList/TransactionDate.d.ts +0 -0
- /package/dist/cjs/types/src/components/{Transactions → tables/Transactions}/transactionsList/TransactionDownload.d.ts +0 -0
- /package/dist/cjs/types/src/components/{Transactions → tables/Transactions}/transactionsList/TransactionTitle.d.ts +0 -0
- /package/dist/esm/types/src/components/{Quotes → tables/Quotes}/Quotes.stories.d.ts +0 -0
- /package/dist/esm/types/src/components/{Quotes → tables/Quotes}/index.d.ts +0 -0
- /package/dist/esm/types/src/components/{Transactions → tables/Transactions}/index.d.ts +0 -0
- /package/dist/esm/types/src/components/{Transactions → tables/Transactions}/transactionsList/TransactionDate.d.ts +0 -0
- /package/dist/esm/types/src/components/{Transactions → tables/Transactions}/transactionsList/TransactionDownload.d.ts +0 -0
- /package/dist/esm/types/src/components/{Transactions → tables/Transactions}/transactionsList/TransactionTitle.d.ts +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,103 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { ReactNode, ComponentProps } from 'react';
|
|
3
|
+
import Invoice$1 from '@/types/Invoice';
|
|
3
4
|
import * as gql_tada from 'gql.tada';
|
|
4
5
|
import { ResultOf, FragmentOf } from 'gql.tada';
|
|
5
6
|
import FormattedInvoice from '@/types/FormattedInvoice';
|
|
6
|
-
import {
|
|
7
|
+
import { Quote as Quote$1 } from '@/types/Quote';
|
|
7
8
|
import { QueryClient } from '@tanstack/react-query';
|
|
8
9
|
import { ThemeConfig } from 'antd';
|
|
10
|
+
import { Transaction } from '@/types/Transaction';
|
|
9
11
|
|
|
10
12
|
type ShadowType = "shadow-none" | "shadow-sm" | "shadow-md" | "shadow-lg" | "shadow-xl";
|
|
11
13
|
|
|
14
|
+
type CursorPage<T> = {
|
|
15
|
+
pageInfo: {
|
|
16
|
+
endCursor?: string | null;
|
|
17
|
+
hasNextPage: boolean;
|
|
18
|
+
};
|
|
19
|
+
totalCount?: number;
|
|
20
|
+
nodes: T[];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type ColumnAlign = 'left' | 'right';
|
|
24
|
+
type Column<T> = {
|
|
25
|
+
/** Unique identifier for the column; also used as the React key. */
|
|
26
|
+
key: string;
|
|
27
|
+
/** Bold header text. Pass an empty string to render no label. */
|
|
28
|
+
label: string;
|
|
29
|
+
/** Cell renderer for each row. */
|
|
30
|
+
render: (row: T) => ReactNode;
|
|
31
|
+
/** Cell + header alignment. Defaults to 'left'. */
|
|
32
|
+
align?: ColumnAlign;
|
|
33
|
+
/** Explicit `grid-template-columns` segment (e.g. `'120px'`, `'auto'`). Ignored when `flex` is true. */
|
|
34
|
+
width?: string;
|
|
35
|
+
/** When true, this column takes the remaining space (`3fr`). At most one column should set this. */
|
|
36
|
+
flex?: boolean;
|
|
37
|
+
};
|
|
38
|
+
type InfiniteTableQueryArgs = {
|
|
39
|
+
first: number;
|
|
40
|
+
after?: string;
|
|
41
|
+
};
|
|
42
|
+
/** Shared display options for the resource table wrappers (Invoices, Quotes, Transactions, ...). */
|
|
43
|
+
type TableDisplayOptions<ColumnKey extends string> = {
|
|
44
|
+
/** Whether to show the search bar */
|
|
45
|
+
showSearchBar?: boolean;
|
|
46
|
+
/** Whether to show the title */
|
|
47
|
+
showTitle?: boolean;
|
|
48
|
+
/** The title to display above the list */
|
|
49
|
+
title?: string;
|
|
50
|
+
/** The columns to display */
|
|
51
|
+
columns?: ColumnKey[];
|
|
52
|
+
/** A custom class name to apply to the component */
|
|
53
|
+
className?: string;
|
|
54
|
+
/** A custom style to apply to the component */
|
|
55
|
+
style?: React.CSSProperties;
|
|
56
|
+
/** Card shadow class */
|
|
57
|
+
shadow?: ShadowType;
|
|
58
|
+
/** Whether to open the row detail in a modal instead of a drawer */
|
|
59
|
+
useModal?: boolean;
|
|
60
|
+
/** A custom class name to apply to the search bar */
|
|
61
|
+
searchBarClassName?: string;
|
|
62
|
+
/** Message to display when the list is empty */
|
|
63
|
+
emptyMessage?: string;
|
|
64
|
+
};
|
|
65
|
+
/** Shared behavior options for the resource table wrappers. */
|
|
66
|
+
type TableBehaviorOptions = {
|
|
67
|
+
/** Whether to suppress the row detail drawer/modal on row click */
|
|
68
|
+
suppressDetail?: boolean;
|
|
69
|
+
/** Force a specific number of rows per page. When omitted the table
|
|
70
|
+
* auto-sizes based on the available viewport height. Must be between
|
|
71
|
+
* 1 and 100 (the API's per-request cap). */
|
|
72
|
+
rowsPerPage?: number;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
type Props$1<T> = {
|
|
76
|
+
/** Base cache key. `rowsPerPage` is appended automatically. */
|
|
77
|
+
queryKey: readonly unknown[];
|
|
78
|
+
/** Fetches a single page. Must return a Relay-shaped `CursorPage`. */
|
|
79
|
+
queryFn: (args: InfiniteTableQueryArgs) => Promise<CursorPage<T>>;
|
|
80
|
+
/** Extracts a stable React key from each row. */
|
|
81
|
+
getRowKey: (row: T) => string | number;
|
|
82
|
+
/** Declarative column configuration. */
|
|
83
|
+
columns: Column<T>[];
|
|
84
|
+
/** Invoked when a row is clicked. Presence enables the row-hover cursor. */
|
|
85
|
+
onRowClick?: (row: T) => void;
|
|
86
|
+
/** Fallback text shown when the current page has no rows. */
|
|
87
|
+
emptyMessage?: string;
|
|
88
|
+
/** Fully custom empty-state renderer; overrides `emptyMessage`. */
|
|
89
|
+
renderEmpty?: () => ReactNode;
|
|
90
|
+
/** Force a page size. When omitted the table auto-sizes to the viewport. Must be 1-100. */
|
|
91
|
+
rowsPerPage?: number;
|
|
92
|
+
/** Card shadow class. */
|
|
93
|
+
shadow?: ShadowType;
|
|
94
|
+
className?: string;
|
|
95
|
+
style?: React.CSSProperties;
|
|
96
|
+
/** Escape hatch: on mobile, render each row with this callback instead of the columns grid. */
|
|
97
|
+
renderMobileRow?: (row: T) => ReactNode;
|
|
98
|
+
};
|
|
99
|
+
declare function InfiniteTable<T>({ queryKey, queryFn, getRowKey, columns, onRowClick, emptyMessage, renderEmpty, rowsPerPage, shadow, className, style, renderMobileRow, }: Props$1<T>): react.JSX.Element;
|
|
100
|
+
|
|
12
101
|
type InvoiceQuoteContextProps = {
|
|
13
102
|
id?: string | null | undefined;
|
|
14
103
|
invoiceQuoteViewComponent?: React.ReactNode;
|
|
@@ -38,6 +127,31 @@ declare global {
|
|
|
38
127
|
}
|
|
39
128
|
}
|
|
40
129
|
|
|
130
|
+
type InvoiceColumnKey = 'date' | 'title' | 'state' | 'amount' | 'download' | 'accountName';
|
|
131
|
+
type InvoiceDateType = 'createdAt' | 'issuedAt' | 'dueAt';
|
|
132
|
+
|
|
133
|
+
type InvoicesDisplayOptions = TableDisplayOptions<InvoiceColumnKey>;
|
|
134
|
+
type InvoicesBehaviorOptions = TableBehaviorOptions & {
|
|
135
|
+
/** The type of date to display for invoices. */
|
|
136
|
+
invoiceDateType?: InvoiceDateType;
|
|
137
|
+
/** Whether to hide the payment form on invoices */
|
|
138
|
+
hidePaymentForm?: boolean;
|
|
139
|
+
};
|
|
140
|
+
declare function Invoices({ invoiceComponent, onInvoiceClick, filter, sort, displayOptions, behaviorOptions, }: {
|
|
141
|
+
/** A custom component to render instead of the default invoice component */
|
|
142
|
+
invoiceComponent?: react__default.ReactNode;
|
|
143
|
+
/** A function to call when an invoice is clicked */
|
|
144
|
+
onInvoiceClick?: (invoice: Invoice$1) => void;
|
|
145
|
+
/** Filter expression applied server-side, e.g. `"invoice.amount is 100"`.
|
|
146
|
+
* Docs: https://docs.bunny.com/developer/getting-started/using-filters-in-queries
|
|
147
|
+
*/
|
|
148
|
+
filter?: string;
|
|
149
|
+
/** Sort clause applied server-side, e.g. `"createdAt DESC"` or `"amount ASC"`. */
|
|
150
|
+
sort?: string;
|
|
151
|
+
displayOptions?: InvoicesDisplayOptions;
|
|
152
|
+
behaviorOptions?: InvoicesBehaviorOptions;
|
|
153
|
+
}): react__default.JSX.Element;
|
|
154
|
+
|
|
41
155
|
declare const OnQuoteLoadedFragment: gql_tada.TadaDocumentNode<{
|
|
42
156
|
vendorName: string | null;
|
|
43
157
|
quote: {
|
|
@@ -56,41 +170,23 @@ type QuoteProps = InvoiceQuoteContextProps & {
|
|
|
56
170
|
};
|
|
57
171
|
declare function Quote({ id, invoiceQuoteViewComponent, onInvoiceDownloadError, onPaymentSuccess, shadow, className, hideDownloadButton, onQuoteLoaded, onQuoteAccepted, onQuoteUnavailableError, suppressQuoteUnavailableErrorNotification, }: QuoteProps): react.JSX.Element;
|
|
58
172
|
|
|
59
|
-
type
|
|
173
|
+
type QuoteColumnKey = 'date' | 'title' | 'state' | 'amount' | 'download' | 'accountName';
|
|
60
174
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
|
|
66
|
-
/** Whether to show the title */
|
|
67
|
-
showTitle?: boolean;
|
|
68
|
-
/** The title to display in the quotes list */
|
|
69
|
-
title?: string;
|
|
70
|
-
/** The columns to display in the quotes list */
|
|
71
|
-
columns?: TransactionListColumnType[];
|
|
72
|
-
/** A custom class name to apply to the component */
|
|
73
|
-
className?: string;
|
|
74
|
-
/** Whether to use a modal for the invoice drawer */
|
|
75
|
-
useModal?: boolean;
|
|
76
|
-
/** Whether to show a shadow around the transactions list */
|
|
77
|
-
shadow?: ShadowType;
|
|
78
|
-
/** A custom class name to apply to the search bar */
|
|
79
|
-
searchBarClassName?: string;
|
|
175
|
+
type QuotesDisplayOptions = TableDisplayOptions<QuoteColumnKey>;
|
|
176
|
+
type QuotesBehaviorOptions = TableBehaviorOptions;
|
|
177
|
+
declare function Quotes({ renderQuote, onQuoteClick, filter, sort, displayOptions, behaviorOptions, }: {
|
|
178
|
+
/** Render a custom quote component. Receives the quote as a parameter. */
|
|
179
|
+
renderQuote?: (quote: Quote$1) => React.ReactNode;
|
|
80
180
|
/** A function to call when a quote is clicked */
|
|
81
|
-
onQuoteClick?: (quote:
|
|
82
|
-
/**
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
style?: React.CSSProperties;
|
|
86
|
-
/** A filter to apply to the quotes. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries */
|
|
181
|
+
onQuoteClick?: (quote: Quote$1) => void;
|
|
182
|
+
/** Filter expression applied server-side, e.g. `"quote.amount is 100"`.
|
|
183
|
+
* Docs: https://docs.bunny.com/developer/getting-started/using-filters-in-queries
|
|
184
|
+
*/
|
|
87
185
|
filter?: string;
|
|
88
|
-
/**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
/** Message to display when there are no quotes */
|
|
93
|
-
noQuotesMessage?: string;
|
|
186
|
+
/** Sort clause applied server-side, e.g. `"createdAt DESC"` or `"amount ASC"`. */
|
|
187
|
+
sort?: string;
|
|
188
|
+
displayOptions?: QuotesDisplayOptions;
|
|
189
|
+
behaviorOptions?: QuotesBehaviorOptions;
|
|
94
190
|
}): react.JSX.Element;
|
|
95
191
|
|
|
96
192
|
type Props = {
|
|
@@ -270,50 +366,28 @@ declare function BunnyProvider({ children, darkMode, queryClient, apiHost, token
|
|
|
270
366
|
|
|
271
367
|
type TransactionDateType = 'createdAt' | 'issuedAt' | 'dueAt';
|
|
272
368
|
|
|
273
|
-
|
|
369
|
+
type TransactionListColumnType = 'date' | 'title' | 'state' | 'amount' | 'download' | 'accountName';
|
|
370
|
+
|
|
371
|
+
type TransactionsDisplayOptions = TableDisplayOptions<TransactionListColumnType>;
|
|
372
|
+
type TransactionsBehaviorOptions = TableBehaviorOptions & {
|
|
373
|
+
/** The type of date to display for transactions if applicable. Payments will always only show createdAt date. */
|
|
374
|
+
transactionDateType?: TransactionDateType;
|
|
375
|
+
/** Whether to hide the payment form on invoices */
|
|
376
|
+
hidePaymentForm?: boolean;
|
|
377
|
+
};
|
|
378
|
+
declare function Transactions({ transactionComponent, onTransactionClick, filter, sort, displayOptions, behaviorOptions, }: {
|
|
274
379
|
/** A custom component to render instead of the default invoice component */
|
|
275
380
|
transactionComponent?: react__default.ReactNode;
|
|
276
|
-
/** Whether to show the search bar */
|
|
277
|
-
showSearchBar?: boolean;
|
|
278
|
-
/** Whether to show the title */
|
|
279
|
-
showTitle?: boolean;
|
|
280
|
-
/** The title to display in the transactions list */
|
|
281
|
-
title?: string;
|
|
282
|
-
/** The columns to display in the transactions list */
|
|
283
|
-
columns?: TransactionListColumnType[];
|
|
284
|
-
/** A custom class name to apply to the component */
|
|
285
|
-
className?: string;
|
|
286
|
-
/** Whether to use a modal for the invoice drawer */
|
|
287
|
-
useModal?: boolean;
|
|
288
|
-
/** Whether to show a shadow around the transactions list */
|
|
289
|
-
shadow?: ShadowType;
|
|
290
|
-
/** A custom class name to apply to the search bar */
|
|
291
|
-
searchBarClassName?: string;
|
|
292
381
|
/** A function to call when a transaction is clicked */
|
|
293
382
|
onTransactionClick?: (transaction: Transaction) => void;
|
|
294
|
-
/**
|
|
295
|
-
|
|
296
|
-
/** The kinds of transactions to show */
|
|
297
|
-
kindsToShow?: TransactionKind[];
|
|
298
|
-
/** A custom style to apply to the component */
|
|
299
|
-
style?: react__default.CSSProperties;
|
|
300
|
-
/** A filter to apply to the transactions. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries
|
|
301
|
-
* Filtering is applied on the api side, potentially speeding up the transactions query
|
|
383
|
+
/** Filter expression applied server-side, e.g. `"transaction.amount is 100"`.
|
|
384
|
+
* Docs: https://docs.bunny.com/developer/getting-started/using-filters-in-queries
|
|
302
385
|
*/
|
|
303
386
|
filter?: string;
|
|
304
|
-
/**
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
* This is useful to have more control over the filtering logic.
|
|
309
|
-
*/
|
|
310
|
-
filterTransactions?: (transaction: Transaction) => boolean;
|
|
311
|
-
/** A function to sort the transactions. Runs on the client side. */
|
|
312
|
-
sortTransactions?: (transactionA: Transaction, transactionB: Transaction) => number;
|
|
313
|
-
/** The type of date to display for transactions if applicable. Payments will always only show createdAt date. */
|
|
314
|
-
transactionDateType?: TransactionDateType;
|
|
315
|
-
/** Whether to hide the payment form on invoices */
|
|
316
|
-
hidePaymentForm?: boolean;
|
|
387
|
+
/** Sort clause applied server-side, e.g. `"createdAt DESC"` or `"amount ASC"`. */
|
|
388
|
+
sort?: string;
|
|
389
|
+
displayOptions?: TransactionsDisplayOptions;
|
|
390
|
+
behaviorOptions?: TransactionsBehaviorOptions;
|
|
317
391
|
}): react__default.JSX.Element;
|
|
318
392
|
|
|
319
393
|
declare const SubscriptionsWrapper: ({ handlePortalErrors, companyName, isInPreviewMode, productId, className, styles: userStyles, noSubscriptionsComponent, showInactiveSubscriptions, showInactiveSubscriptionsToggle, onPaymentMethodSaved, onPaymentMethodRemoved, onSubscriptionUpgradeClick, }: {
|
|
@@ -397,4 +471,5 @@ declare function MiniCreditCard({ className, buttons, hideDropdownMenu, hideDefa
|
|
|
397
471
|
id?: string;
|
|
398
472
|
}): react.JSX.Element;
|
|
399
473
|
|
|
400
|
-
export { BillingDetails, BunnyProvider, Footer, Invoice, MiniCreditCard, PaymentForm, Quote, Quotes, Signup, SubscriptionsWrapper as Subscriptions, Transactions, UpgradeWrapper as Upgrade };
|
|
474
|
+
export { BillingDetails, BunnyProvider, Footer, InfiniteTable, Invoice, Invoices, MiniCreditCard, PaymentForm, Quote, Quotes, Signup, SubscriptionsWrapper as Subscriptions, Transactions, UpgradeWrapper as Upgrade };
|
|
475
|
+
export type { Column, ColumnAlign, CursorPage, InfiniteTableQueryArgs };
|
package/package.json
CHANGED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@/types/Transaction';
|
|
2
|
-
import { ShadowType } from '../../types/shadowType';
|
|
3
|
-
import { TransactionListColumnType } from '../Transactions/transactionsList/TransactionsListDesktop';
|
|
4
|
-
declare function Quotes({ className, columns, filter, filterQuotes, sort, noQuotesMessage, onQuoteClick, renderQuote, searchBarClassName, shadow, showSearchBar, showTitle, title, style, suppressQuoteDisplay, useModal, }: {
|
|
5
|
-
/** Render a custom quote component. Receives the quoteId as a parameter. */
|
|
6
|
-
renderQuote?: (quote: Transaction) => React.ReactNode;
|
|
7
|
-
/** Whether to show the search bar */
|
|
8
|
-
showSearchBar?: boolean;
|
|
9
|
-
/** Whether to show the title */
|
|
10
|
-
showTitle?: boolean;
|
|
11
|
-
/** The title to display in the quotes list */
|
|
12
|
-
title?: string;
|
|
13
|
-
/** The columns to display in the quotes list */
|
|
14
|
-
columns?: TransactionListColumnType[];
|
|
15
|
-
/** A custom class name to apply to the component */
|
|
16
|
-
className?: string;
|
|
17
|
-
/** Whether to use a modal for the invoice drawer */
|
|
18
|
-
useModal?: boolean;
|
|
19
|
-
/** Whether to show a shadow around the transactions list */
|
|
20
|
-
shadow?: ShadowType;
|
|
21
|
-
/** A custom class name to apply to the search bar */
|
|
22
|
-
searchBarClassName?: string;
|
|
23
|
-
/** A function to call when a quote is clicked */
|
|
24
|
-
onQuoteClick?: (quote: Transaction) => void;
|
|
25
|
-
/** Whether to hide the display showing the quote */
|
|
26
|
-
suppressQuoteDisplay?: boolean;
|
|
27
|
-
/** A custom style to apply to the component */
|
|
28
|
-
style?: React.CSSProperties;
|
|
29
|
-
/** A filter to apply to the quotes. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries */
|
|
30
|
-
filter?: string;
|
|
31
|
-
/** A function to filter the quotes. Runs on the client side. */
|
|
32
|
-
filterQuotes?: (quote: Transaction) => boolean;
|
|
33
|
-
/** A function to sort the quotes. Runs on the client side. */
|
|
34
|
-
sort?: (a: Transaction, b: Transaction) => number;
|
|
35
|
-
/** Message to display when there are no quotes */
|
|
36
|
-
noQuotesMessage?: string;
|
|
37
|
-
}): import("react").JSX.Element;
|
|
38
|
-
export default Quotes;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Transaction } from '@/types/Transaction';
|
|
3
|
-
import { TransactionKind } from '@/types/Transaction';
|
|
4
|
-
import { TransactionDateType } from '../../contexts/TransactionsListContext';
|
|
5
|
-
import { ShadowType } from '../../types/shadowType';
|
|
6
|
-
import { TransactionListColumnType } from './transactionsList/TransactionsListDesktop';
|
|
7
|
-
export default function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, filterTransactions, sortTransactions, transactionDateType, hidePaymentForm, }: {
|
|
8
|
-
/** A custom component to render instead of the default invoice component */
|
|
9
|
-
transactionComponent?: React.ReactNode;
|
|
10
|
-
/** Whether to show the search bar */
|
|
11
|
-
showSearchBar?: boolean;
|
|
12
|
-
/** Whether to show the title */
|
|
13
|
-
showTitle?: boolean;
|
|
14
|
-
/** The title to display in the transactions list */
|
|
15
|
-
title?: string;
|
|
16
|
-
/** The columns to display in the transactions list */
|
|
17
|
-
columns?: TransactionListColumnType[];
|
|
18
|
-
/** A custom class name to apply to the component */
|
|
19
|
-
className?: string;
|
|
20
|
-
/** Whether to use a modal for the invoice drawer */
|
|
21
|
-
useModal?: boolean;
|
|
22
|
-
/** Whether to show a shadow around the transactions list */
|
|
23
|
-
shadow?: ShadowType;
|
|
24
|
-
/** A custom class name to apply to the search bar */
|
|
25
|
-
searchBarClassName?: string;
|
|
26
|
-
/** A function to call when a transaction is clicked */
|
|
27
|
-
onTransactionClick?: (transaction: Transaction) => void;
|
|
28
|
-
/** Whether to hide the display showing the transaction */
|
|
29
|
-
suppressTransactionDisplay?: boolean;
|
|
30
|
-
/** The kinds of transactions to show */
|
|
31
|
-
kindsToShow?: TransactionKind[];
|
|
32
|
-
/** A custom style to apply to the component */
|
|
33
|
-
style?: React.CSSProperties;
|
|
34
|
-
/** A filter to apply to the transactions. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries
|
|
35
|
-
* Filtering is applied on the api side, potentially speeding up the transactions query
|
|
36
|
-
*/
|
|
37
|
-
filter?: string;
|
|
38
|
-
/** Message to display when there are no transactions */
|
|
39
|
-
noTransactionsMessage?: string;
|
|
40
|
-
/** A function to filter the transactions
|
|
41
|
-
* Filtering is applied on the client side.
|
|
42
|
-
* This is useful to have more control over the filtering logic.
|
|
43
|
-
*/
|
|
44
|
-
filterTransactions?: (transaction: Transaction) => boolean;
|
|
45
|
-
/** A function to sort the transactions. Runs on the client side. */
|
|
46
|
-
sortTransactions?: (transactionA: Transaction, transactionB: Transaction) => number;
|
|
47
|
-
/** The type of date to display for transactions if applicable. Payments will always only show createdAt date. */
|
|
48
|
-
transactionDateType?: TransactionDateType;
|
|
49
|
-
/** Whether to hide the payment form on invoices */
|
|
50
|
-
hidePaymentForm?: boolean;
|
|
51
|
-
}): React.JSX.Element;
|
|
52
|
-
export declare function TransactionsDisplay({ transactions, onSearchValueChanged, search, }: {
|
|
53
|
-
transactions: Transaction[] | undefined;
|
|
54
|
-
onSearchValueChanged: (value: string) => void;
|
|
55
|
-
search: string;
|
|
56
|
-
}): React.JSX.Element;
|
package/dist/cjs/types/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@/types/Transaction';
|
|
2
|
-
export type TransactionListColumnType = 'date' | 'title' | 'state' | 'amount' | 'download' | 'accountName';
|
|
3
|
-
declare const TransactionsListDesktop: ({ transactions, onTransactionClick, }: {
|
|
4
|
-
transactions: Transaction[] | undefined;
|
|
5
|
-
onTransactionClick?: (transaction: Transaction) => void;
|
|
6
|
-
}) => import("react").JSX.Element;
|
|
7
|
-
export default TransactionsListDesktop;
|
package/dist/cjs/types/src/components/Transactions/transactionsList/TransactionsListMobile.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@/types/Transaction';
|
|
2
|
-
declare const TransactionsListMobile: ({ transactions, onTransactionClick, }: {
|
|
3
|
-
transactions: Transaction[] | undefined;
|
|
4
|
-
onTransactionClick: (transaction: Transaction) => void;
|
|
5
|
-
}) => import("react").JSX.Element;
|
|
6
|
-
export default TransactionsListMobile;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@/types/Transaction';
|
|
2
|
-
import { TransactionKind } from '@/types/Transaction';
|
|
3
|
-
import { ShadowType } from '../types/shadowType';
|
|
4
|
-
import { TransactionListColumnType } from '../components/Transactions/transactionsList/TransactionsListDesktop';
|
|
5
|
-
export type TransactionsContextValues = {
|
|
6
|
-
showSearchBar?: boolean;
|
|
7
|
-
showTitle?: boolean;
|
|
8
|
-
title?: string;
|
|
9
|
-
transactionComponent?: React.ReactNode;
|
|
10
|
-
transactionStateRenderer?: (state: string) => React.ReactNode;
|
|
11
|
-
columns: TransactionListColumnType[];
|
|
12
|
-
className?: string;
|
|
13
|
-
shadow?: ShadowType;
|
|
14
|
-
searchBarClassName?: string;
|
|
15
|
-
useModal?: boolean;
|
|
16
|
-
onTransactionClick?: (transaction: Transaction) => void;
|
|
17
|
-
onTransactionDisplayClose?: (transaction: Transaction | null) => void;
|
|
18
|
-
suppressTransactionDisplay?: boolean;
|
|
19
|
-
kindsToShow?: TransactionKind[];
|
|
20
|
-
style?: React.CSSProperties;
|
|
21
|
-
filter?: string;
|
|
22
|
-
noTransactionsMessage?: string;
|
|
23
|
-
downloadTransactionLink?: (id: string) => string;
|
|
24
|
-
filterTransactions?: (transaction: Transaction) => boolean;
|
|
25
|
-
sortTransactions?: (transactionA: Transaction, transactionB: Transaction) => number;
|
|
26
|
-
transactionDateType: TransactionDateType;
|
|
27
|
-
hidePaymentForm?: boolean;
|
|
28
|
-
};
|
|
29
|
-
export type TransactionDateType = 'createdAt' | 'issuedAt' | 'dueAt';
|
|
30
|
-
export declare const TransactionsListContext: import("react").Context<TransactionsContextValues>;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@/types/Transaction';
|
|
2
|
-
import { ShadowType } from '../../types/shadowType';
|
|
3
|
-
import { TransactionListColumnType } from '../Transactions/transactionsList/TransactionsListDesktop';
|
|
4
|
-
declare function Quotes({ className, columns, filter, filterQuotes, sort, noQuotesMessage, onQuoteClick, renderQuote, searchBarClassName, shadow, showSearchBar, showTitle, title, style, suppressQuoteDisplay, useModal, }: {
|
|
5
|
-
/** Render a custom quote component. Receives the quoteId as a parameter. */
|
|
6
|
-
renderQuote?: (quote: Transaction) => React.ReactNode;
|
|
7
|
-
/** Whether to show the search bar */
|
|
8
|
-
showSearchBar?: boolean;
|
|
9
|
-
/** Whether to show the title */
|
|
10
|
-
showTitle?: boolean;
|
|
11
|
-
/** The title to display in the quotes list */
|
|
12
|
-
title?: string;
|
|
13
|
-
/** The columns to display in the quotes list */
|
|
14
|
-
columns?: TransactionListColumnType[];
|
|
15
|
-
/** A custom class name to apply to the component */
|
|
16
|
-
className?: string;
|
|
17
|
-
/** Whether to use a modal for the invoice drawer */
|
|
18
|
-
useModal?: boolean;
|
|
19
|
-
/** Whether to show a shadow around the transactions list */
|
|
20
|
-
shadow?: ShadowType;
|
|
21
|
-
/** A custom class name to apply to the search bar */
|
|
22
|
-
searchBarClassName?: string;
|
|
23
|
-
/** A function to call when a quote is clicked */
|
|
24
|
-
onQuoteClick?: (quote: Transaction) => void;
|
|
25
|
-
/** Whether to hide the display showing the quote */
|
|
26
|
-
suppressQuoteDisplay?: boolean;
|
|
27
|
-
/** A custom style to apply to the component */
|
|
28
|
-
style?: React.CSSProperties;
|
|
29
|
-
/** A filter to apply to the quotes. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries */
|
|
30
|
-
filter?: string;
|
|
31
|
-
/** A function to filter the quotes. Runs on the client side. */
|
|
32
|
-
filterQuotes?: (quote: Transaction) => boolean;
|
|
33
|
-
/** A function to sort the quotes. Runs on the client side. */
|
|
34
|
-
sort?: (a: Transaction, b: Transaction) => number;
|
|
35
|
-
/** Message to display when there are no quotes */
|
|
36
|
-
noQuotesMessage?: string;
|
|
37
|
-
}): import("react").JSX.Element;
|
|
38
|
-
export default Quotes;
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Transaction } from '@/types/Transaction';
|
|
3
|
-
import { TransactionKind } from '@/types/Transaction';
|
|
4
|
-
import { TransactionDateType } from '../../contexts/TransactionsListContext';
|
|
5
|
-
import { ShadowType } from '../../types/shadowType';
|
|
6
|
-
import { TransactionListColumnType } from './transactionsList/TransactionsListDesktop';
|
|
7
|
-
export default function Transactions({ transactionComponent, showSearchBar, showTitle, title, columns, className, shadow, searchBarClassName, useModal, onTransactionClick, suppressTransactionDisplay, kindsToShow, style, filter, noTransactionsMessage, filterTransactions, sortTransactions, transactionDateType, hidePaymentForm, }: {
|
|
8
|
-
/** A custom component to render instead of the default invoice component */
|
|
9
|
-
transactionComponent?: React.ReactNode;
|
|
10
|
-
/** Whether to show the search bar */
|
|
11
|
-
showSearchBar?: boolean;
|
|
12
|
-
/** Whether to show the title */
|
|
13
|
-
showTitle?: boolean;
|
|
14
|
-
/** The title to display in the transactions list */
|
|
15
|
-
title?: string;
|
|
16
|
-
/** The columns to display in the transactions list */
|
|
17
|
-
columns?: TransactionListColumnType[];
|
|
18
|
-
/** A custom class name to apply to the component */
|
|
19
|
-
className?: string;
|
|
20
|
-
/** Whether to use a modal for the invoice drawer */
|
|
21
|
-
useModal?: boolean;
|
|
22
|
-
/** Whether to show a shadow around the transactions list */
|
|
23
|
-
shadow?: ShadowType;
|
|
24
|
-
/** A custom class name to apply to the search bar */
|
|
25
|
-
searchBarClassName?: string;
|
|
26
|
-
/** A function to call when a transaction is clicked */
|
|
27
|
-
onTransactionClick?: (transaction: Transaction) => void;
|
|
28
|
-
/** Whether to hide the display showing the transaction */
|
|
29
|
-
suppressTransactionDisplay?: boolean;
|
|
30
|
-
/** The kinds of transactions to show */
|
|
31
|
-
kindsToShow?: TransactionKind[];
|
|
32
|
-
/** A custom style to apply to the component */
|
|
33
|
-
style?: React.CSSProperties;
|
|
34
|
-
/** A filter to apply to the transactions. Docs on filter: https://docs.bunny.com/developer/getting-started/using-filters-in-queries
|
|
35
|
-
* Filtering is applied on the api side, potentially speeding up the transactions query
|
|
36
|
-
*/
|
|
37
|
-
filter?: string;
|
|
38
|
-
/** Message to display when there are no transactions */
|
|
39
|
-
noTransactionsMessage?: string;
|
|
40
|
-
/** A function to filter the transactions
|
|
41
|
-
* Filtering is applied on the client side.
|
|
42
|
-
* This is useful to have more control over the filtering logic.
|
|
43
|
-
*/
|
|
44
|
-
filterTransactions?: (transaction: Transaction) => boolean;
|
|
45
|
-
/** A function to sort the transactions. Runs on the client side. */
|
|
46
|
-
sortTransactions?: (transactionA: Transaction, transactionB: Transaction) => number;
|
|
47
|
-
/** The type of date to display for transactions if applicable. Payments will always only show createdAt date. */
|
|
48
|
-
transactionDateType?: TransactionDateType;
|
|
49
|
-
/** Whether to hide the payment form on invoices */
|
|
50
|
-
hidePaymentForm?: boolean;
|
|
51
|
-
}): React.JSX.Element;
|
|
52
|
-
export declare function TransactionsDisplay({ transactions, onSearchValueChanged, search, }: {
|
|
53
|
-
transactions: Transaction[] | undefined;
|
|
54
|
-
onSearchValueChanged: (value: string) => void;
|
|
55
|
-
search: string;
|
|
56
|
-
}): React.JSX.Element;
|
package/dist/esm/types/src/components/Transactions/transactionsList/TransactionsListDesktop.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@/types/Transaction';
|
|
2
|
-
export type TransactionListColumnType = 'date' | 'title' | 'state' | 'amount' | 'download' | 'accountName';
|
|
3
|
-
declare const TransactionsListDesktop: ({ transactions, onTransactionClick, }: {
|
|
4
|
-
transactions: Transaction[] | undefined;
|
|
5
|
-
onTransactionClick?: (transaction: Transaction) => void;
|
|
6
|
-
}) => import("react").JSX.Element;
|
|
7
|
-
export default TransactionsListDesktop;
|
package/dist/esm/types/src/components/Transactions/transactionsList/TransactionsListMobile.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@/types/Transaction';
|
|
2
|
-
declare const TransactionsListMobile: ({ transactions, onTransactionClick, }: {
|
|
3
|
-
transactions: Transaction[] | undefined;
|
|
4
|
-
onTransactionClick: (transaction: Transaction) => void;
|
|
5
|
-
}) => import("react").JSX.Element;
|
|
6
|
-
export default TransactionsListMobile;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Transaction } from '@/types/Transaction';
|
|
2
|
-
import { TransactionKind } from '@/types/Transaction';
|
|
3
|
-
import { ShadowType } from '../types/shadowType';
|
|
4
|
-
import { TransactionListColumnType } from '../components/Transactions/transactionsList/TransactionsListDesktop';
|
|
5
|
-
export type TransactionsContextValues = {
|
|
6
|
-
showSearchBar?: boolean;
|
|
7
|
-
showTitle?: boolean;
|
|
8
|
-
title?: string;
|
|
9
|
-
transactionComponent?: React.ReactNode;
|
|
10
|
-
transactionStateRenderer?: (state: string) => React.ReactNode;
|
|
11
|
-
columns: TransactionListColumnType[];
|
|
12
|
-
className?: string;
|
|
13
|
-
shadow?: ShadowType;
|
|
14
|
-
searchBarClassName?: string;
|
|
15
|
-
useModal?: boolean;
|
|
16
|
-
onTransactionClick?: (transaction: Transaction) => void;
|
|
17
|
-
onTransactionDisplayClose?: (transaction: Transaction | null) => void;
|
|
18
|
-
suppressTransactionDisplay?: boolean;
|
|
19
|
-
kindsToShow?: TransactionKind[];
|
|
20
|
-
style?: React.CSSProperties;
|
|
21
|
-
filter?: string;
|
|
22
|
-
noTransactionsMessage?: string;
|
|
23
|
-
downloadTransactionLink?: (id: string) => string;
|
|
24
|
-
filterTransactions?: (transaction: Transaction) => boolean;
|
|
25
|
-
sortTransactions?: (transactionA: Transaction, transactionB: Transaction) => number;
|
|
26
|
-
transactionDateType: TransactionDateType;
|
|
27
|
-
hidePaymentForm?: boolean;
|
|
28
|
-
};
|
|
29
|
-
export type TransactionDateType = 'createdAt' | 'issuedAt' | 'dueAt';
|
|
30
|
-
export declare const TransactionsListContext: import("react").Context<TransactionsContextValues>;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|