@absreim/react-bootstrap-data-grid-pro 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/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/trueModulo.d.ts +8 -0
- package/common/util/trueModulo.js +8 -0
- 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/table-pro/ColHeaderCellPro.d.ts +1 -1
- package/table-pro/TablePro.d.ts +5 -0
- package/table-pro/TablePro.js +5 -0
- package/table-pro/index.d.ts +0 -1
- package/table-pro/index.js +0 -1
- package/table-pro/internalTypes.d.ts +11 -0
- package/table-pro/internalTypes.js +1 -0
- package/table-pro/reorder/ReorderHandleCell.d.ts +2 -1
- package/table-pro/reorder/internalTypes.d.ts +53 -0
- package/table-pro/reorder/internalTypes.js +1 -0
- package/table-pro/reorder/types.d.ts +36 -15
- package/table-pro/reorder/useKeyboardReorder.d.ts +1 -1
- package/table-pro/reorder/useKeyboardReorderListener.d.ts +2 -1
- package/table-pro/reorder/useReorderStyles.d.ts +2 -1
- package/table-pro/resize/internalType.d.ts +20 -0
- package/table-pro/resize/internalType.js +1 -0
- package/table-pro/resize/useResizeModel.d.ts +1 -1
- package/table-pro/types.d.ts +91 -8
- package/table-pro/util/reorderRows.d.ts +13 -0
- package/table-pro/util/reorderRows.js +13 -0
- package/table-pro/resize/types.d.ts +0 -5
- /package/common/{pipeline/types.js → filtering/internalTypes.js} +0 -0
- /package/common/{toolbar/types.js → internalTypes.js} +0 -0
- /package/{table-pro/resize/types.js → common/pagination/internalTypes.js} +0 -0
package/table-pro/types.d.ts
CHANGED
|
@@ -1,25 +1,108 @@
|
|
|
1
|
-
import { ColDef, ColDefBase,
|
|
1
|
+
import { ColDef, ColDefBase, StyleModel, TableProps } from "../table";
|
|
2
2
|
import { ReorderModel, ReorderStyleModel } from "./reorder/types";
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Fields specific to {@link ProColDef}.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface ProColDefSpecificFields {
|
|
9
|
+
/**
|
|
10
|
+
* Configures whether the column is resizable.
|
|
11
|
+
*
|
|
12
|
+
* @defaultValue false
|
|
13
|
+
*/
|
|
4
14
|
resizeable?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Configures the width of the column. The value can be a number in pixels or
|
|
17
|
+
* a state setter/getter object of type {@link WidthModel}.
|
|
18
|
+
*
|
|
19
|
+
* @defaultValue 100
|
|
20
|
+
*/
|
|
5
21
|
width?: ColDef["width"] | WidthModel;
|
|
22
|
+
/**
|
|
23
|
+
* When the column is resizable, configures the minimum width to which the
|
|
24
|
+
* column can be resized.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue 64 if the column is sortable, 32 if not
|
|
27
|
+
*/
|
|
6
28
|
minResizeWidth?: number;
|
|
29
|
+
/**
|
|
30
|
+
* When the column is resizable, configures the maximum width to which the
|
|
31
|
+
* column can be resized.
|
|
32
|
+
*
|
|
33
|
+
* @defaultValue {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_VALUE | Number.MAX_VALUE}
|
|
34
|
+
*/
|
|
7
35
|
maxResizeWidth?: number;
|
|
36
|
+
/**
|
|
37
|
+
* Configures the number of pixels to change the width per keypress when
|
|
38
|
+
* resizing.
|
|
39
|
+
*
|
|
40
|
+
* @defaultValue 10
|
|
41
|
+
*/
|
|
8
42
|
keyboardResizeStep?: number;
|
|
9
|
-
}
|
|
10
|
-
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Type of the column definition object for the pro edition of the table
|
|
46
|
+
* feature.
|
|
47
|
+
*
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
export type ProColDef<ValueType = any> = ColDefBase<ValueType> & ProColDefSpecificFields;
|
|
51
|
+
/**
|
|
52
|
+
* Props that are specific to the pro edition of the table component.
|
|
53
|
+
*
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
export interface TableProSpecificProps {
|
|
57
|
+
/**
|
|
58
|
+
* Column definitions for the table.
|
|
59
|
+
*/
|
|
11
60
|
cols: ProColDef[];
|
|
61
|
+
/**
|
|
62
|
+
* Enables and configures the row reordering feature.
|
|
63
|
+
*/
|
|
12
64
|
reorder?: ReorderModel;
|
|
65
|
+
/**
|
|
66
|
+
* Applies custom CSS styles for elements specific to the pro edition of the
|
|
67
|
+
* table.
|
|
68
|
+
*/
|
|
13
69
|
styleModel?: ProStyleModel;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Props object for the pro edition of the table component, {@link TablePro}.
|
|
73
|
+
*
|
|
74
|
+
* @public
|
|
75
|
+
*/
|
|
76
|
+
export type TableProProps = Omit<TableProps, "cols" | "styleModel"> & TableProSpecificProps;
|
|
77
|
+
/**
|
|
78
|
+
* State object with getter and setter that represents the width of a column.
|
|
79
|
+
* Used as part of {@link ProColDefSpecificFields} to specify the width of a
|
|
80
|
+
* column in a way that can be changed externally.
|
|
81
|
+
*
|
|
82
|
+
* @public
|
|
83
|
+
*/
|
|
18
84
|
export interface WidthModel {
|
|
85
|
+
/**
|
|
86
|
+
* The current width value stored by the object.
|
|
87
|
+
*/
|
|
19
88
|
width: number;
|
|
89
|
+
/**
|
|
90
|
+
* Setter function to update the width value.
|
|
91
|
+
*/
|
|
20
92
|
setWidth: (width: number) => void;
|
|
21
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* Style models specific the pro edition of the table component.
|
|
96
|
+
*
|
|
97
|
+
* @public
|
|
98
|
+
*/
|
|
22
99
|
export interface ProStyleSubmodels {
|
|
23
100
|
reorderModel?: ReorderStyleModel;
|
|
24
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Type of the combined style model object for the pro edition of the table
|
|
104
|
+
* component.
|
|
105
|
+
*
|
|
106
|
+
* @public
|
|
107
|
+
*/
|
|
25
108
|
export type ProStyleModel = ProStyleSubmodels & StyleModel;
|
|
@@ -1,3 +1,16 @@
|
|
|
1
1
|
import { RowDef, RowId, ValidRowData } from "../";
|
|
2
|
+
/**
|
|
3
|
+
* Utility function for implementing the reorder callback function for the
|
|
4
|
+
* row reordering feature.
|
|
5
|
+
*
|
|
6
|
+
* @param rows - an array of row data of the type {@link RowDef}.
|
|
7
|
+
* @param id - the id of the row to move.
|
|
8
|
+
* @param destIndex - the destination index of the row to move.
|
|
9
|
+
*
|
|
10
|
+
* @returns A new array where row to move is inserted into the destination
|
|
11
|
+
* index.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
2
15
|
declare const reorderRows: <Data extends ValidRowData>(rows: RowDef<Data>[], id: RowId, destIndex: number) => RowDef<Data>[];
|
|
3
16
|
export default reorderRows;
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility function for implementing the reorder callback function for the
|
|
3
|
+
* row reordering feature.
|
|
4
|
+
*
|
|
5
|
+
* @param rows - an array of row data of the type {@link RowDef}.
|
|
6
|
+
* @param id - the id of the row to move.
|
|
7
|
+
* @param destIndex - the destination index of the row to move.
|
|
8
|
+
*
|
|
9
|
+
* @returns A new array where row to move is inserted into the destination
|
|
10
|
+
* index.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
1
14
|
const reorderRows = (rows, id, destIndex) => {
|
|
2
15
|
const rowsCopy = rows.slice();
|
|
3
16
|
const srcIndex = rowsCopy.findIndex((rowsCopy) => rowsCopy.id === id);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|