@stenajs-webui/grid 17.30.7 → 17.31.0
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/CHANGELOG.md +12 -0
- package/dist/features/standard-table/components/StandardTable.d.ts +8 -3
- package/dist/features/standard-table/config/StandardTableConfig.d.ts +5 -0
- package/dist/features/standard-table/context/OnKeyDownContext.d.ts +2 -2
- package/dist/features/standard-table/context/OnSortOrderChangeContext.d.ts +4 -0
- package/dist/features/standard-table/types/{StandardTableOnKeyDown.d.ts → StandardTableEvents.d.ts} +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.es.js +670 -662
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
# v17.31.0 (Wed Feb 01 2023)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- External sorting and `onSortOrderChange` prop in StandardTable [#554](https://github.com/StenaIT/stenajs-webui/pull/554) ([@mattias800](https://github.com/mattias800))
|
|
6
|
+
|
|
7
|
+
#### Authors: 1
|
|
8
|
+
|
|
9
|
+
- Mattias Andersson ([@mattias800](https://github.com/mattias800))
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
1
13
|
# v17.29.0 (Mon Dec 12 2022)
|
|
2
14
|
|
|
3
15
|
#### 🐛 Bug Fix
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { ResultListBannerState } from "@stenajs-webui/elements";
|
|
1
2
|
import { ReactNode } from "react";
|
|
2
3
|
import { StandardTableConfig } from "../config/StandardTableConfig";
|
|
3
4
|
import { TableContext } from "../context/StandardTableStateContext";
|
|
4
|
-
import { StandardTableOnKeyDown } from "../types/
|
|
5
|
-
import { ResultListBannerState } from "@stenajs-webui/elements";
|
|
5
|
+
import { StandardTableOnKeyDown, StandardTableOnSortOrderChange } from "../types/StandardTableEvents";
|
|
6
6
|
export interface StandardTableProps<TItem, TColumnKey extends string, TColumnGroupKey extends string> {
|
|
7
7
|
/**
|
|
8
8
|
* Variant of table
|
|
@@ -77,6 +77,11 @@ export interface StandardTableProps<TItem, TColumnKey extends string, TColumnGro
|
|
|
77
77
|
* an object that contains columnId and item for the focused cell.
|
|
78
78
|
*/
|
|
79
79
|
onKeyDown?: StandardTableOnKeyDown<TItem, TColumnKey>;
|
|
80
|
+
/**
|
|
81
|
+
* Event listener for when user changes the sort order.
|
|
82
|
+
* This is triggered when user clicks on the table headers, even if using external sorting.
|
|
83
|
+
*/
|
|
84
|
+
onSortOrderChange?: StandardTableOnSortOrderChange<TColumnKey>;
|
|
80
85
|
}
|
|
81
86
|
export declare type StandardTableVariant = "relaxed" | "standard" | "condensed" | "compact";
|
|
82
|
-
export declare const StandardTable: <TItem, TColumnKey extends string, TColumnGroupKey extends string>({ tableContext, config, columnOrder, columnGroupOrder, tableId, variant, onKeyDown, ...props }: StandardTableProps<TItem, TColumnKey, TColumnGroupKey>) => JSX.Element;
|
|
87
|
+
export declare const StandardTable: <TItem, TColumnKey extends string, TColumnGroupKey extends string>({ tableContext, config, columnOrder, columnGroupOrder, tableId, variant, onKeyDown, onSortOrderChange, ...props }: StandardTableProps<TItem, TColumnKey, TColumnGroupKey>) => JSX.Element;
|
|
@@ -47,6 +47,11 @@ export interface StandardTableConfigBase<TItem, TColumnKey extends string> {
|
|
|
47
47
|
* If true, click on table headers does not change sort order.
|
|
48
48
|
*/
|
|
49
49
|
disableSorting?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* If true, click on table headers works as usual, but no sorting is applied.
|
|
52
|
+
* Sort must be applied outside of StandardTable, in client or in backend.
|
|
53
|
+
*/
|
|
54
|
+
enableExternalSorting?: boolean;
|
|
50
55
|
/**
|
|
51
56
|
* Table will be sorted by specified column key as default.
|
|
52
57
|
* Only used when using internal reducer. If redux is used, this setting is ignored.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { StandardTableOnKeyDown } from "../types/
|
|
2
|
+
import { StandardTableOnKeyDown } from "../types/StandardTableEvents";
|
|
3
3
|
export declare const OnKeyDownContext: import("react").Context<StandardTableOnKeyDown<any, any> | undefined>;
|
|
4
|
-
export declare const useOnKeyDownContext: <TItem, TColumnKey extends string>() => StandardTableOnKeyDown<TItem, TColumnKey
|
|
4
|
+
export declare const useOnKeyDownContext: <TItem, TColumnKey extends string>() => StandardTableOnKeyDown<TItem, TColumnKey> | undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { StandardTableOnSortOrderChange } from "../types/StandardTableEvents";
|
|
3
|
+
export declare const OnSortOrderChangeContext: import("react").Context<StandardTableOnSortOrderChange<any> | undefined>;
|
|
4
|
+
export declare const useOnSortOrderChangeContext: <TColumnKey extends string>() => StandardTableOnSortOrderChange<TColumnKey> | undefined;
|
package/dist/features/standard-table/types/{StandardTableOnKeyDown.d.ts → StandardTableEvents.d.ts}
RENAMED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { StandardTableOnKeyDownArgs } from "../config/StandardTableConfig";
|
|
3
3
|
export declare type StandardTableOnKeyDown<TItem, TColumnKey extends string> = (ev: React.KeyboardEvent<HTMLDivElement>, args: StandardTableOnKeyDownArgs<TItem, TColumnKey>) => void;
|
|
4
|
+
export declare type StandardTableOnSortOrderChange<TColumnKey extends string> = (sortOrder: TColumnKey, desc: boolean) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export * from "./features/standard-table/features/checkboxes/StandardTableRowChe
|
|
|
30
30
|
export * from "./features/standard-table/features/sorting/UseTableSortHeader";
|
|
31
31
|
export * from "./features/standard-table/features/sorting/MultitypeComparator";
|
|
32
32
|
export * from "./features/standard-table/features/column-groups/ColumnGroupFactory";
|
|
33
|
-
export * from "./features/standard-table/types/
|
|
33
|
+
export * from "./features/standard-table/types/StandardTableEvents";
|
|
34
34
|
export * from "./features/standard-table/helpers/cell-renderers/editable-text-cell/EditableTextCell";
|
|
35
35
|
export * from "./features/standard-table/helpers/cell-renderers/editable-text-cell/EditableTextCellWithStatus";
|
|
36
36
|
export * from "./features/standard-table/hooks/UseCellBackground";
|