@absreim/react-bootstrap-data-grid 4.1.0 → 4.2.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/common/constants.d.ts +2 -0
- package/common/constants.js +2 -0
- package/common/editing/types.d.ts +30 -0
- package/common/export/types.d.ts +6 -0
- package/common/export/useExportFn.js +1 -1
- package/common/filtering/DateFilterRow.d.ts +1 -1
- package/common/filtering/DateFilterRow.js +1 -1
- package/common/filtering/FilterOptionsTable.d.ts +3 -2
- package/common/filtering/NumberFilterRow.d.ts +1 -1
- package/common/filtering/NumberFilterRow.js +1 -1
- package/common/filtering/StringFilterRow.js +1 -1
- package/common/filtering/constants.d.ts +19 -0
- package/common/filtering/constants.js +44 -0
- package/common/filtering/internalTypes.d.ts +77 -0
- package/common/filtering/types.d.ts +165 -22
- package/common/filtering/types.js +46 -17
- package/common/filtering/useFilterFormState.d.ts +1 -1
- package/common/index.d.ts +0 -3
- package/common/index.js +0 -3
- package/common/internalTypes.d.ts +10 -0
- package/common/pagination/Pagination.d.ts +1 -1
- package/common/pagination/internalTypes.d.ts +8 -0
- package/common/pagination/internalTypes.js +1 -0
- package/common/pagination/types.d.ts +105 -5
- package/common/pipeline/{types.d.ts → internalTypes.d.ts} +5 -0
- package/common/pipeline/internalTypes.js +1 -0
- package/common/pipeline/useAugFormattedRows.d.ts +3 -2
- package/common/pipeline/useColNameToWidth.d.ts +2 -1
- package/common/pipeline/useCombinedPipeline/index.d.ts +4 -3
- package/common/pipeline/useCombinedPipeline/useCurrentPageRows.d.ts +2 -1
- package/common/pipeline/useCombinedPipeline/useCurrentPageRows.js +3 -2
- package/common/pipeline/useCombinedPipeline/useFilterStateFromEditable.d.ts +2 -1
- package/common/pipeline/useCombinedPipeline/useFilterStateStore.d.ts +2 -1
- package/common/pipeline/useGridSelectionFns.d.ts +2 -1
- package/common/selection/internalTypes.d.ts +34 -0
- package/common/selection/internalTypes.js +1 -0
- package/common/selection/types.d.ts +91 -17
- package/common/selection/types.js +0 -3
- package/common/sorting/internalTypes.d.ts +10 -0
- package/common/sorting/internalTypes.js +1 -0
- package/common/sorting/types.d.ts +48 -4
- package/common/sorting/useSortHeaderStates.d.ts +1 -1
- package/common/styling/types.d.ts +57 -0
- package/common/toolbar/Toolbar.d.ts +1 -1
- package/common/toolbar/ToolbarContainer.d.ts +1 -1
- package/common/toolbar/{types.d.ts → internalTypes.d.ts} +27 -0
- package/common/toolbar/internalTypes.js +1 -0
- package/common/toolbar/useInterfaces.d.ts +1 -1
- package/common/types.d.ts +165 -18
- package/common/util/datetime.d.ts +17 -0
- package/common/util/datetime.js +17 -0
- package/common/util/getWidthStyle.d.ts +9 -0
- package/common/util/getWidthStyle.js +9 -0
- package/common/util/index.d.ts +0 -4
- package/common/util/index.js +0 -4
- package/common/util/isSubset.d.ts +12 -1
- package/common/util/isSubset.js +13 -2
- package/common/util/useControlledHover.d.ts +5 -0
- package/common/util/useControlledHover.js +5 -0
- package/grid/focus/types.d.ts +11 -0
- package/grid/main/Grid.d.ts +5 -0
- package/grid/main/Grid.js +6 -5
- package/grid/main/GridBody.d.ts +1 -1
- package/grid/main/GridHeader.d.ts +1 -1
- package/grid/main/internalTypes.d.ts +29 -0
- package/grid/main/internalTypes.js +1 -0
- package/grid/main/types.d.ts +108 -19
- package/package.json +5 -5
- package/table/InternalTable.d.ts +1 -1
- package/table/Table.d.ts +5 -1
- package/table/Table.js +5 -0
- package/table/editing/EditableRow.d.ts +1 -1
- package/table/editing/EditableRow.js +1 -1
- package/table/internalTypes.d.ts +23 -0
- package/table/internalTypes.js +1 -0
- package/table/main/BodyRows.d.ts +4 -3
- package/table/main/ColHeaderCell/index.d.ts +1 -1
- package/table/selection/SelectAllHeaderCell.d.ts +1 -1
- package/table/styling/types.d.ts +122 -5
- package/table/types.d.ts +62 -15
- package/common/util/trueModulo.d.ts +0 -2
- package/common/util/trueModulo.js +0 -4
- /package/common/{pipeline/types.js → filtering/internalTypes.js} +0 -0
- /package/common/{toolbar/types.js → internalTypes.js} +0 -0
|
@@ -1,23 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strings representing different possible values of the
|
|
3
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/justify-content | justify-content CSS property}.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
1
7
|
export type JustifyContentSetting = "start" | "end" | "center" | "between" | "around" | "evenly";
|
|
8
|
+
/**
|
|
9
|
+
* Strings representing the different
|
|
10
|
+
* {@link https://getbootstrap.com/docs/5.3/components/pagination/#sizing | possible sizes of the Bootstrap pagination component}.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
2
14
|
export type Size = "small" | "medium" | "large";
|
|
15
|
+
/**
|
|
16
|
+
* Options for the pagination feature.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
3
20
|
export interface PaginationOptions {
|
|
21
|
+
/**
|
|
22
|
+
* An array of page sizes that can be selected by the user.
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue [10, 25, 100]
|
|
25
|
+
*/
|
|
4
26
|
pageSizeOptions?: number[];
|
|
27
|
+
/**
|
|
28
|
+
* Maximum number of buttons pointing to numerically-indexed pages that can
|
|
29
|
+
* be displayed at once.
|
|
30
|
+
*
|
|
31
|
+
* @defaultValue 5
|
|
32
|
+
*/
|
|
5
33
|
maxPageButtons?: number;
|
|
34
|
+
/**
|
|
35
|
+
* The size of the pagination component. Set via CSS classes provided with
|
|
36
|
+
* Bootstrap.
|
|
37
|
+
*
|
|
38
|
+
* @defaultValue "medium" - corresponds to not specifying a CSS class for
|
|
39
|
+
* pagination component size
|
|
40
|
+
*/
|
|
6
41
|
componentSize?: Size;
|
|
42
|
+
/**
|
|
43
|
+
* The ARIA label for the nav element that represents the pagination
|
|
44
|
+
* component.
|
|
45
|
+
*
|
|
46
|
+
* @defaultValue undefined - no ARIA label
|
|
47
|
+
*/
|
|
7
48
|
pageSelectorAriaLabel?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Justify-content CSS property for the ul element of the pagination
|
|
51
|
+
* component.
|
|
52
|
+
*
|
|
53
|
+
* @defaultValue undefined - no justify-content property is specified, which
|
|
54
|
+
* acts like "start" based on CSS standards. See
|
|
55
|
+
* {@link https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/justify-content#syntax}.
|
|
56
|
+
*/
|
|
8
57
|
pageSelectorJustifyContent?: JustifyContentSetting;
|
|
9
58
|
}
|
|
10
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Properties specific to configuring pagination in a controlled manner.
|
|
61
|
+
*
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
export interface ControlledPaginationState {
|
|
65
|
+
/**
|
|
66
|
+
* A type discriminator.
|
|
67
|
+
*/
|
|
11
68
|
type?: "controlled";
|
|
69
|
+
/**
|
|
70
|
+
* The index of current page size setting in the array of settings.
|
|
71
|
+
*/
|
|
12
72
|
pageSizeIndex: number;
|
|
73
|
+
/**
|
|
74
|
+
* Setter function for the page size index.
|
|
75
|
+
*/
|
|
13
76
|
setPageSizeIndex: (pageSizeIndex: number) => void;
|
|
77
|
+
/**
|
|
78
|
+
* The 1-based index of the currently displayed page.
|
|
79
|
+
*/
|
|
14
80
|
currentPage: number;
|
|
81
|
+
/**
|
|
82
|
+
* Sets the current page index.
|
|
83
|
+
*/
|
|
15
84
|
setCurrentPage: (pageNum: number) => void;
|
|
16
|
-
}
|
|
17
|
-
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Object that enables and configures the pagination feature for a table or
|
|
88
|
+
* grid in an externally-controllable manner.
|
|
89
|
+
*
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
export type ControlledPaginationModel = PaginationOptions & ControlledPaginationState;
|
|
93
|
+
/**
|
|
94
|
+
* Initial values for pagination in uncontrolled mode.
|
|
95
|
+
*
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
export interface UncontrolledPaginationInitState {
|
|
99
|
+
/**
|
|
100
|
+
* A type discriminator.
|
|
101
|
+
*/
|
|
18
102
|
type: "uncontrolled";
|
|
103
|
+
/**
|
|
104
|
+
* Starting page size setting index of pageSizeOptions array.
|
|
105
|
+
*/
|
|
19
106
|
startingPageSizeIndex?: number;
|
|
107
|
+
/**
|
|
108
|
+
* Starting 1-based current page number.
|
|
109
|
+
*/
|
|
20
110
|
startingCurrentPage?: number;
|
|
21
|
-
}
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Object that enables and configures pagination in an uncontrolled manner.
|
|
114
|
+
*
|
|
115
|
+
* @public
|
|
116
|
+
*/
|
|
117
|
+
export type UncontrolledPaginationModel = PaginationOptions & UncontrolledPaginationInitState;
|
|
118
|
+
/**
|
|
119
|
+
* Object that enables and configures pagination for a grid or table.
|
|
120
|
+
*
|
|
121
|
+
* @public
|
|
122
|
+
*/
|
|
22
123
|
export type PaginationModel = ControlledPaginationModel | UncontrolledPaginationModel;
|
|
23
|
-
export type NormalizedPaginationModel = Required<Omit<ControlledPaginationModel, "type" | "pageSelectorAriaLabel" | "pageSelectorJustifyContent">> & Pick<ControlledPaginationModel, "pageSelectorAriaLabel" | "pageSelectorJustifyContent">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ColNameToWidth } from "./
|
|
2
|
-
import {
|
|
1
|
+
import { ColNameToWidth } from "./internalTypes";
|
|
2
|
+
import { FormattedRow } from "../";
|
|
3
|
+
import { AugFormattedRow } from "../internalTypes";
|
|
3
4
|
declare const useAugFormattedRows: (colNameToWidth: ColNameToWidth, rows: FormattedRow[]) => AugFormattedRow[];
|
|
4
5
|
export default useAugFormattedRows;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SortedRowsOutput } from "./useSortedRows";
|
|
2
2
|
import { CurrentPageRowsOutput } from "./useCurrentPageRows";
|
|
3
|
-
import { NormalizedTableFilterModel, FilterState } from "../../";
|
|
4
|
-
import { ColDefBase, FormattedRow,
|
|
5
|
-
|
|
3
|
+
import { NormalizedTableFilterModel, FilterState } from "../../filtering/internalTypes";
|
|
4
|
+
import { ColDefBase, FormattedRow, RowDef } from "../../types";
|
|
5
|
+
import { TableProps } from "../../../table";
|
|
6
|
+
export type CombinedPipelineParams = Pick<TableProps, "rows" | "filterModel" | "sortModel" | "pagination" | "selectModel"> & {
|
|
6
7
|
cols: ColDefBase[];
|
|
7
8
|
};
|
|
8
9
|
export interface UseCombinedPipelineHook {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PaginationModel } from "../../pagination/types";
|
|
2
2
|
import { AugRowDef, PostPaginationRowDef } from "../../";
|
|
3
|
+
import { NormalizedPaginationModel } from "../../pagination/internalTypes";
|
|
3
4
|
export interface CurrentPageRowsOutput {
|
|
4
5
|
paginatedRows: PostPaginationRowDef[];
|
|
5
6
|
normalizedModel: NormalizedPaginationModel | null;
|
|
@@ -10,6 +10,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
12
|
import { useMemo, useState } from "react";
|
|
13
|
+
import { DEFAULT_MAX_PAGE_BUTTONS, DEFAULT_PAGE_SIZES } from "../../constants";
|
|
13
14
|
var useCurrentPageRows = function (sortedRows, paginationModel) {
|
|
14
15
|
var componentSize = (paginationModel === null || paginationModel === void 0 ? void 0 : paginationModel.componentSize) || "medium";
|
|
15
16
|
var isControlled = (paginationModel === null || paginationModel === void 0 ? void 0 : paginationModel.type) !== "uncontrolled";
|
|
@@ -27,7 +28,7 @@ var useCurrentPageRows = function (sortedRows, paginationModel) {
|
|
|
27
28
|
var setCurrentPage = isControlled
|
|
28
29
|
? paginationModel === null || paginationModel === void 0 ? void 0 : paginationModel.setCurrentPage
|
|
29
30
|
: setInternalPageNum;
|
|
30
|
-
var maxPageButtons = (paginationModel === null || paginationModel === void 0 ? void 0 : paginationModel.maxPageButtons) ||
|
|
31
|
+
var maxPageButtons = (paginationModel === null || paginationModel === void 0 ? void 0 : paginationModel.maxPageButtons) || DEFAULT_MAX_PAGE_BUTTONS;
|
|
31
32
|
return useMemo(function () {
|
|
32
33
|
if (paginationModel === undefined) {
|
|
33
34
|
return {
|
|
@@ -35,7 +36,7 @@ var useCurrentPageRows = function (sortedRows, paginationModel) {
|
|
|
35
36
|
normalizedModel: null,
|
|
36
37
|
};
|
|
37
38
|
}
|
|
38
|
-
var pageSizeOptions = (paginationModel === null || paginationModel === void 0 ? void 0 : paginationModel.pageSizeOptions) ||
|
|
39
|
+
var pageSizeOptions = (paginationModel === null || paginationModel === void 0 ? void 0 : paginationModel.pageSizeOptions) || DEFAULT_PAGE_SIZES;
|
|
39
40
|
var normalizedModel = {
|
|
40
41
|
pageSizeIndex: pageSizeIndex,
|
|
41
42
|
setPageSizeIndex: setPageSizeIndex,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { EditableFilterState
|
|
1
|
+
import { EditableFilterState } from "../../filtering/types";
|
|
2
2
|
import { ColDef } from "../../types";
|
|
3
|
+
import { FilterState } from "../../filtering/internalTypes";
|
|
3
4
|
declare const useFilterStateFromEditable: (colDefs: ColDef[], editableFilterState: EditableFilterState | null) => FilterState | null;
|
|
4
5
|
export default useFilterStateFromEditable;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { FilterModel
|
|
1
|
+
import { FilterModel } from "../../filtering/types";
|
|
2
2
|
import { ColDefBase } from "../../types";
|
|
3
|
+
import { NormalizedTableFilterModel } from "../../filtering/internalTypes";
|
|
3
4
|
declare const useFilterStateStore: (filterModel: FilterModel | undefined, cols: ColDefBase[]) => NormalizedTableFilterModel | null;
|
|
4
5
|
export default useFilterStateStore;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { MouseEventHandler } from "react";
|
|
2
|
-
import {
|
|
2
|
+
import { SelectModel } from "../selection/types";
|
|
3
3
|
import { SelectionInputModel } from "../../table/selection/SelectionInput";
|
|
4
4
|
import { RowDef, RowId } from "../types";
|
|
5
|
+
import { SelectionInfo } from "../selection/internalTypes";
|
|
5
6
|
export interface UseGridSelectionFnsHook {
|
|
6
7
|
selectedSet: Set<RowId>;
|
|
7
8
|
rowsAreSelectable: boolean | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Indicates whether a grid or table has all, some, or now rows selected when
|
|
3
|
+
* in multiselect mode.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export type MultiExistingSelection = "full" | "partial" | "none";
|
|
8
|
+
/**
|
|
9
|
+
* Indicates the selection mode of a grid or table is in single selection mode.
|
|
10
|
+
* Also whether a selection exists.
|
|
11
|
+
*
|
|
12
|
+
* @internal
|
|
13
|
+
*/
|
|
14
|
+
export interface SingleSelectionInfo {
|
|
15
|
+
selectType: "single";
|
|
16
|
+
existingSelection: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Indicates the selection mode of a grid or table is in multiselect mode.
|
|
20
|
+
* Also indicates whether a full, partial, or no selection exists.
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export interface MultiSelectionInfo {
|
|
25
|
+
selectType: "multi";
|
|
26
|
+
existingSelection: "full" | "partial" | "none";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Indicates the selection mode of a grid or table and contains metadata
|
|
30
|
+
* on whether selections exist.
|
|
31
|
+
*
|
|
32
|
+
* @internal
|
|
33
|
+
*/
|
|
34
|
+
export type SelectionInfo = SingleSelectionInfo | MultiSelectionInfo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,30 +1,104 @@
|
|
|
1
1
|
import { RowId } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Specifies whether the user can select rows by clicking on a control in a
|
|
4
|
+
* special column, by clicking on the row, or via either method.
|
|
5
|
+
*
|
|
6
|
+
* - column -- can only select by clicking on radio or checkbox input in special
|
|
7
|
+
* column
|
|
8
|
+
* - row -- selection column is hidden and selection can be done by clicking
|
|
9
|
+
* anywhere in a row
|
|
10
|
+
* - both -- selection can be done by either clicking on the input or row
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
2
14
|
export type SelectMode = "column" | "row" | "both";
|
|
3
|
-
|
|
4
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Properties shared between {@link SingleSelectModel} and
|
|
17
|
+
* {@link MultiSelectModel}.
|
|
18
|
+
*
|
|
19
|
+
* @public
|
|
20
|
+
*/
|
|
21
|
+
export interface BaseSelectModel {
|
|
22
|
+
/**
|
|
23
|
+
* The means of selecting rows available to the user.
|
|
24
|
+
*/
|
|
5
25
|
mode: SelectMode;
|
|
26
|
+
/**
|
|
27
|
+
* The width of the select column. Set via CSS min-width and max-width
|
|
28
|
+
* properties. The column is only shown if mode is set to "column".
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue undefined - no CSS properties will be set
|
|
31
|
+
*/
|
|
6
32
|
selectColWidth?: number;
|
|
7
33
|
}
|
|
8
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Properties specific to the {@link MultiSelectModel}.
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
*/
|
|
39
|
+
export interface MultiSelectState {
|
|
40
|
+
/**
|
|
41
|
+
* A type discriminator.
|
|
42
|
+
*/
|
|
9
43
|
type: "multi";
|
|
44
|
+
/**
|
|
45
|
+
* The ids of the currently selected rows.
|
|
46
|
+
*/
|
|
10
47
|
selected: RowId[];
|
|
48
|
+
/**
|
|
49
|
+
* Setter function for the selected ids.
|
|
50
|
+
*/
|
|
11
51
|
setSelected: (selected: RowId[]) => void;
|
|
12
|
-
}
|
|
13
|
-
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Object to enable and configure the selection feature for a grid or table in
|
|
55
|
+
* the multiselect mode.
|
|
56
|
+
*
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
export type MultiSelectModel = BaseSelectModel & MultiSelectState;
|
|
60
|
+
/**
|
|
61
|
+
* Properties specific to the {@link SingleSelectModel}.
|
|
62
|
+
*
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export interface SingleSelectState {
|
|
66
|
+
/**
|
|
67
|
+
* A type discriminator.
|
|
68
|
+
*/
|
|
14
69
|
type: "single";
|
|
70
|
+
/**
|
|
71
|
+
* The id of the currently selected row, or null if none is selected.
|
|
72
|
+
*/
|
|
15
73
|
selected: RowId | null;
|
|
74
|
+
/**
|
|
75
|
+
* Setter function for the "selected" property.
|
|
76
|
+
*/
|
|
16
77
|
setSelected: (selected: RowId | null) => void;
|
|
78
|
+
/**
|
|
79
|
+
* String to uniquely identify the group of radio buttons.
|
|
80
|
+
*
|
|
81
|
+
* @remarks
|
|
82
|
+
*
|
|
83
|
+
* If specified, must be unique across all radio button groups on the web
|
|
84
|
+
* page. Now optional because the
|
|
85
|
+
* {@link https://react.dev/reference/react/useId | useId hook}
|
|
86
|
+
* can be used to generate an ID.
|
|
87
|
+
*
|
|
88
|
+
* @defaultValue undefined - an id generated by the useId hook will be used
|
|
89
|
+
*/
|
|
17
90
|
groupName?: string;
|
|
18
|
-
};
|
|
19
|
-
export type SelectModel = SingleSelectModel | MultiSelectModel;
|
|
20
|
-
export type MultiExistingSelection = "full" | "partial" | "none";
|
|
21
|
-
export interface SingleSelectionInfo {
|
|
22
|
-
selectType: "single";
|
|
23
|
-
existingSelection: boolean;
|
|
24
91
|
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
92
|
+
/**
|
|
93
|
+
* Object to enable and configure the selection feature for a grid or table in
|
|
94
|
+
* the single select mode.
|
|
95
|
+
*
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
export type SingleSelectModel = BaseSelectModel & SingleSelectState;
|
|
99
|
+
/**
|
|
100
|
+
* Object to enable and configure the selection feature for a grid or table.
|
|
101
|
+
*
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
export type SelectModel = SingleSelectModel | MultiSelectModel;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,19 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sort order setting for the sort feature.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
1
6
|
export type SortOrder = "asc" | "desc";
|
|
7
|
+
/**
|
|
8
|
+
* Specifies the column to sort on and order with which to sort.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
2
12
|
export interface SortColDef {
|
|
13
|
+
/**
|
|
14
|
+
* The name of the column. Corresponds to the name in the {@link ColDef}
|
|
15
|
+
* type.
|
|
16
|
+
*/
|
|
3
17
|
name: string;
|
|
18
|
+
/**
|
|
19
|
+
* Order with which sorting should be done.
|
|
20
|
+
*/
|
|
4
21
|
order: SortOrder;
|
|
5
22
|
}
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Externally-controllable variant of the {@link SortModel}.
|
|
25
|
+
*
|
|
26
|
+
* @public
|
|
27
|
+
*/
|
|
10
28
|
export interface ControlledSortModel {
|
|
29
|
+
/**
|
|
30
|
+
* A type discriminator.
|
|
31
|
+
*/
|
|
11
32
|
type?: "controlled";
|
|
33
|
+
/**
|
|
34
|
+
* Information on the column to sort on. Null means no column is being sorted
|
|
35
|
+
* and the rows shown be shown in their original order.
|
|
36
|
+
*/
|
|
12
37
|
sortColDef: SortColDef | null;
|
|
38
|
+
/**
|
|
39
|
+
* Setter function for sortColDef.
|
|
40
|
+
*/
|
|
13
41
|
setSortColDef: (sortColDef: SortColDef | null) => void;
|
|
14
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Uncontrolled variant of the {@link SortModel}.
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
15
48
|
export interface UncontrolledSortModel {
|
|
49
|
+
/**
|
|
50
|
+
* A type discriminator.
|
|
51
|
+
*/
|
|
16
52
|
type: "uncontrolled";
|
|
53
|
+
/**
|
|
54
|
+
* Initial column to sort on, if any.
|
|
55
|
+
*/
|
|
17
56
|
initialSortColDef: SortColDef | null;
|
|
18
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Prop that enables and configures sorting on a grid or table.
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
19
63
|
export type SortModel = ControlledSortModel | UncontrolledSortModel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseControlledHoverHook } from "../util/useControlledHover";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
|
-
import { ColSortModel } from "./
|
|
3
|
+
import { ColSortModel } from "./internalTypes";
|
|
4
4
|
export type UseSortHeaderStatesHook = UseControlledHoverHook<HTMLTableCellElement> & {
|
|
5
5
|
handleClick: () => void;
|
|
6
6
|
sortSymbol: ReactNode;
|
|
@@ -1,21 +1,78 @@
|
|
|
1
1
|
import { AdditionalComponentsStyleModel, FilterInputTableStyleModel, TableStyleModel } from "../../table";
|
|
2
|
+
/**
|
|
3
|
+
* CSS styles for the toolbar.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
2
7
|
export interface ToolbarStyleModel {
|
|
8
|
+
/**
|
|
9
|
+
* Styles for the button of the currently selected tool.
|
|
10
|
+
*/
|
|
3
11
|
activeButton?: string[];
|
|
12
|
+
/**
|
|
13
|
+
* Styles for the buttons of tools that are not currently selected.
|
|
14
|
+
*/
|
|
4
15
|
inactiveButton?: string[];
|
|
16
|
+
/**
|
|
17
|
+
* Styles for the div element that contains the other elements of the toolbar.
|
|
18
|
+
*/
|
|
5
19
|
toolbar?: string[];
|
|
20
|
+
/**
|
|
21
|
+
* Styles for the div element that contains the interface for each tool.
|
|
22
|
+
*/
|
|
6
23
|
interfaceContainer?: string[];
|
|
7
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* CSS styles for the UI for exporting data.
|
|
27
|
+
*
|
|
28
|
+
* @public
|
|
29
|
+
*/
|
|
8
30
|
export interface ExportFormStyleModel {
|
|
31
|
+
/**
|
|
32
|
+
* Styles for fieldset legend elements.
|
|
33
|
+
*/
|
|
9
34
|
legend?: string[];
|
|
35
|
+
/**
|
|
36
|
+
* Styles for the div elements that contain radio buttons.
|
|
37
|
+
*/
|
|
10
38
|
radioContainer?: string[];
|
|
39
|
+
/**
|
|
40
|
+
* Styles for the radio button input elements.
|
|
41
|
+
*/
|
|
11
42
|
radioInput?: string[];
|
|
43
|
+
/**
|
|
44
|
+
* Styles for the label elements for radio button input elements.
|
|
45
|
+
*/
|
|
12
46
|
radioLabel?: string[];
|
|
47
|
+
/**
|
|
48
|
+
* Styles for the submit button.
|
|
49
|
+
*/
|
|
13
50
|
submitButton?: string[];
|
|
14
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Top level object that is passed as a prop to a table to enable custom styles.
|
|
54
|
+
*
|
|
55
|
+
* @public
|
|
56
|
+
*/
|
|
15
57
|
export interface StyleModel {
|
|
58
|
+
/**
|
|
59
|
+
* Styles for the main table (as opposed to the filter options table).
|
|
60
|
+
*/
|
|
16
61
|
mainTableStyleModel?: TableStyleModel;
|
|
62
|
+
/**
|
|
63
|
+
* Styles for the filter options table.
|
|
64
|
+
*/
|
|
17
65
|
filterInputTableStyleModel?: FilterInputTableStyleModel;
|
|
66
|
+
/**
|
|
67
|
+
* Styles for components that don't fit into other categories.
|
|
68
|
+
*/
|
|
18
69
|
additionalComponentsStyleModel?: AdditionalComponentsStyleModel;
|
|
70
|
+
/**
|
|
71
|
+
* Styles for the toolbar.
|
|
72
|
+
*/
|
|
19
73
|
toolbarStyleModel?: ToolbarStyleModel;
|
|
74
|
+
/**
|
|
75
|
+
* Styles for the data export UI.
|
|
76
|
+
*/
|
|
20
77
|
exportFormStyleModel?: ExportFormStyleModel;
|
|
21
78
|
}
|
|
@@ -1,11 +1,38 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import { FilterOptionsTableProps } from "../filtering/FilterOptionsTable";
|
|
3
3
|
import { ExportFormProps } from "../export/ExportForm";
|
|
4
|
+
/**
|
|
5
|
+
* Strings representing different tools on the toolbar.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
4
9
|
export type ToolbarOption = "filtering" | "exporting";
|
|
10
|
+
/**
|
|
11
|
+
* A mapping React elements for different toolbar tools.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
5
15
|
export type ToolbarInterfaces = Partial<Record<ToolbarOption, ReactNode>>;
|
|
16
|
+
/**
|
|
17
|
+
* Props to pass to the components that implement different tools.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
6
21
|
export interface InterfaceParams {
|
|
7
22
|
filtering?: FilterOptionsTableProps;
|
|
8
23
|
exporting?: ExportFormProps;
|
|
9
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Defines props for toolbar tool UI React components while allowing the
|
|
27
|
+
* callback to close the tool UI to be supplied later.
|
|
28
|
+
*
|
|
29
|
+
* @internal
|
|
30
|
+
*/
|
|
10
31
|
export type InterfacePropGenerator = (closeUiCallback: () => void) => InterfaceParams;
|
|
32
|
+
/**
|
|
33
|
+
* Defines toolbar tool UI React elements while allowing the callback
|
|
34
|
+
* to close the tool UI to be supplied later.
|
|
35
|
+
*
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
11
38
|
export type InterfaceNodeGenerator = (closeUiCallback: () => void) => ToolbarInterfaces;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { InterfacePropGenerator, ToolbarInterfaces } from "./
|
|
1
|
+
import { InterfacePropGenerator, ToolbarInterfaces } from "./internalTypes";
|
|
2
2
|
declare const useInterfaces: (gen: InterfacePropGenerator) => (closeCallback: () => void) => ToolbarInterfaces;
|
|
3
3
|
export default useInterfaces;
|