@kronor/dtv 7.6.0 → 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.
@@ -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';
@@ -39,6 +40,19 @@ export interface ActionAPI {
39
40
  showToast: ShowToastFn;
40
41
  /** Current rows-per-page setting for pagination. */
41
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;
42
56
  /** Build a GraphQLQueryAST for an arbitrary rootField (usually the current view root field). */
43
57
  generateGraphQLQueryAST: typeof generateGraphQLQueryAST;
44
58
  /** Build a GraphQLQueryAST with top-level selections aliased to column ids. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kronor/dtv",
3
- "version": "7.6.0",
3
+ "version": "7.6.1",
4
4
  "description": "Schema-driven, declarative table views with advanced filtering, data fetching and AI-assisted filter generation.",
5
5
  "repository": {
6
6
  "type": "git",