@kronor/dtv 7.5.2 → 7.6.1
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/index.es.js +1984 -1980
- package/dist/types/App.d.ts +5 -1
- package/dist/types/components/ActionButtons.d.ts +3 -1
- package/dist/types/framework/actions.d.ts +18 -3
- package/package.json +1 -1
package/dist/types/App.d.ts
CHANGED
|
@@ -66,7 +66,11 @@ export interface AppProps {
|
|
|
66
66
|
};
|
|
67
67
|
}
|
|
68
68
|
export type DTVAPI = {
|
|
69
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Forces the table to fetch data for the current view + filters, staying on
|
|
71
|
+
* the page the user is on. Intended for refreshing after an out-of-band
|
|
72
|
+
* mutation such as a mass action.
|
|
73
|
+
*/
|
|
70
74
|
fetchData: () => void;
|
|
71
75
|
rowSelection: {
|
|
72
76
|
/** Resets any current row selection (no-op if row selection is disabled). */
|
|
@@ -2,6 +2,7 @@ import { ActionDefinition, ActionUserDataAPI } from '../framework/actions';
|
|
|
2
2
|
import { View } from '../framework/view';
|
|
3
3
|
import type { ShowToastFn } from '../framework/toast';
|
|
4
4
|
import { FilterState, PaginationState } from '../framework/state';
|
|
5
|
+
import type { DataOrdering } from '../framework/data-ordering';
|
|
5
6
|
export interface ActionButtonsProps {
|
|
6
7
|
actions: ActionDefinition[];
|
|
7
8
|
selectedView: View;
|
|
@@ -13,7 +14,8 @@ export interface ActionButtonsProps {
|
|
|
13
14
|
showToast: ShowToastFn;
|
|
14
15
|
paginationState: PaginationState;
|
|
15
16
|
rowsPerPage: number;
|
|
17
|
+
ordering: DataOrdering | null;
|
|
16
18
|
userData: ActionUserDataAPI;
|
|
17
19
|
}
|
|
18
|
-
export declare function ActionButtons({ actions, selectedView, filterState, selectedRows, setFilterState, refetch, applyFilters, showToast, paginationState, rowsPerPage, userData }: ActionButtonsProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
export declare function ActionButtons({ actions, selectedView, filterState, selectedRows, setFilterState, refetch, applyFilters, showToast, paginationState, rowsPerPage, ordering, userData }: ActionButtonsProps): import("react/jsx-runtime").JSX.Element;
|
|
19
21
|
export default ActionButtons;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { View } from './view';
|
|
2
2
|
import type { FilterState } from './state';
|
|
3
|
+
import type { DataOrdering } from './data-ordering';
|
|
3
4
|
import { generateGraphQLQueryAST, renderGraphQLQuery } from './graphql';
|
|
4
5
|
import { generateColumnAliasedGraphQLQueryAST } from './graphql/query';
|
|
5
6
|
import { buildGraphQLQueryVariables } from './data';
|
|
@@ -23,9 +24,10 @@ export interface ActionAPI {
|
|
|
23
24
|
*/
|
|
24
25
|
setFilterState: (next: FilterState) => void;
|
|
25
26
|
/**
|
|
26
|
-
* Refetch the current view using the *applied* filters
|
|
27
|
-
* changes made via `setFilterState` are
|
|
28
|
-
* those
|
|
27
|
+
* Refetch the current view using the *applied* filters, staying on the page
|
|
28
|
+
* the user is on. Any pending draft changes made via `setFilterState` are
|
|
29
|
+
* ignored — use `applyFilters` for those (which also returns to page one,
|
|
30
|
+
* since a new filter invalidates the cursor history).
|
|
29
31
|
*/
|
|
30
32
|
refetch: () => void;
|
|
31
33
|
/**
|
|
@@ -38,6 +40,19 @@ export interface ActionAPI {
|
|
|
38
40
|
showToast: ShowToastFn;
|
|
39
41
|
/** Current rows-per-page setting for pagination. */
|
|
40
42
|
rowsPerPage: number;
|
|
43
|
+
/**
|
|
44
|
+
* The ordering the table is currently showing: the ordering the user picked by
|
|
45
|
+
* sorting a column, or `null` when they have not sorted anything. `field` is the
|
|
46
|
+
* GraphQL field path the column sorts by — dotted for nested columns, e.g.
|
|
47
|
+
* `customer.profile.status` — not the column id.
|
|
48
|
+
*
|
|
49
|
+
* Always pass this value to `buildGraphQLQueryVariables` as its `ordering`
|
|
50
|
+
* argument, `null` included, to build variables that order and paginate exactly
|
|
51
|
+
* like the table on screen (`null` means "pagination key only", which is what an
|
|
52
|
+
* unsorted table queries). Omitting the argument is not the same thing: it
|
|
53
|
+
* selects the view's `staticOrdering`, which the table never queries by.
|
|
54
|
+
*/
|
|
55
|
+
ordering: DataOrdering | null;
|
|
41
56
|
/** Build a GraphQLQueryAST for an arbitrary rootField (usually the current view root field). */
|
|
42
57
|
generateGraphQLQueryAST: typeof generateGraphQLQueryAST;
|
|
43
58
|
/** Build a GraphQLQueryAST with top-level selections aliased to column ids. */
|