@absreim/react-bootstrap-data-grid 4.1.0 → 4.3.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/icons/CaretDownFill.d.ts +4 -0
- package/common/icons/CaretDownFill.js +6 -0
- package/common/icons/CaretUp.d.ts +4 -0
- package/common/icons/CaretUp.js +6 -0
- package/common/icons/CaretUpFill.d.ts +4 -0
- package/common/icons/CaretUpFill.js +6 -0
- package/common/icons/internalTypes.d.ts +3 -0
- package/common/index.d.ts +0 -3
- package/common/index.js +0 -3
- package/common/internalTypes.d.ts +10 -0
- package/common/internalTypes.js +1 -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/ArrowPlaceholder.d.ts +3 -0
- package/common/sorting/ArrowPlaceholder.js +3 -0
- package/common/sorting/DownArrow.d.ts +6 -0
- package/common/sorting/DownArrow.js +6 -0
- package/common/sorting/UpArrow.d.ts +6 -0
- package/common/sorting/UpArrow.js +6 -0
- 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/sorting/useSortHeaderStates.js +8 -7
- 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 +169 -16
- 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/focus/useGridFocus.d.ts +1 -1
- package/grid/focus/useGridFocus.js +20 -5
- package/grid/main/Grid.d.ts +5 -0
- package/grid/main/Grid.js +14 -7
- package/grid/main/GridBody.d.ts +1 -1
- package/grid/main/GridHeader.d.ts +1 -1
- package/grid/main/GridHeader.js +29 -2
- package/grid/main/internalTypes.d.ts +31 -0
- package/grid/main/internalTypes.js +1 -0
- package/grid/main/types.d.ts +120 -19
- package/grid/sort/HeaderToggleButton.d.ts +11 -0
- package/grid/sort/HeaderToggleButton.js +30 -0
- package/grid.css +1 -1
- package/grid.scss +95 -33
- 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 +57 -15
- package/common/sorting/arrowPlaceholder.d.ts +0 -2
- package/common/sorting/arrowPlaceholder.js +0 -7
- package/common/sorting/downArrow.d.ts +0 -2
- package/common/sorting/downArrow.js +0 -3
- package/common/sorting/upArrow.d.ts +0 -2
- package/common/sorting/upArrow.js +0 -13
- 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 → icons/internalTypes.js} +0 -0
package/grid/main/GridHeader.js
CHANGED
|
@@ -3,14 +3,41 @@ import getWidthStyles from "./getWidthStyles";
|
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { CSS_PREFIX, DEFAULT_COL_WIDTH } from "../../common/constants";
|
|
5
5
|
import { GRID_HEADER_DATA_TEST_ID } from "../constants";
|
|
6
|
+
import HeaderToggleButton from "../sort/HeaderToggleButton";
|
|
7
|
+
import sortOrderToAriaSort from "../../common/sorting/sortOrderToAriaSort";
|
|
6
8
|
var GridHeader = function (_a) {
|
|
7
|
-
var cols = _a.cols, vertScrollable = _a.vertScrollable, rowVariant = _a.rowVariant, cellVariant = _a.cellVariant, focusColIndex = _a.focusColIndex, cellFocusVariant = _a.cellFocusVariant;
|
|
9
|
+
var cols = _a.cols, vertScrollable = _a.vertScrollable, rowVariant = _a.rowVariant, cellVariant = _a.cellVariant, focusColIndex = _a.focusColIndex, cellFocusVariant = _a.cellFocusVariant, sortInfo = _a.sortInfo;
|
|
10
|
+
var sortingEnabled = sortInfo.sortingEnabled, sortColDef = sortInfo.sortColDef, setSortColDef = sortInfo.setSortColDef;
|
|
11
|
+
var getSortButtonListener = function (colName) { return function () {
|
|
12
|
+
if ((sortColDef === null || sortColDef === void 0 ? void 0 : sortColDef.name) !== colName) {
|
|
13
|
+
setSortColDef({
|
|
14
|
+
name: colName,
|
|
15
|
+
order: "asc",
|
|
16
|
+
});
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
if (sortColDef.order === "asc") {
|
|
20
|
+
setSortColDef({
|
|
21
|
+
name: colName,
|
|
22
|
+
order: "desc",
|
|
23
|
+
});
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
setSortColDef(null);
|
|
27
|
+
}; };
|
|
8
28
|
return (_jsx("div", { "data-testid": GRID_HEADER_DATA_TEST_ID, role: "rowgroup", className: classNames(vertScrollable ? ["position-sticky", "z-1", "top-0"] : []), children: _jsx("div", { role: "row", className: classNames("d-flex", "flex-row", rowVariant && "".concat(CSS_PREFIX, "-").concat(rowVariant)), "aria-rowindex": 1, children: cols.map(function (col, index) {
|
|
9
29
|
var ariaColIndex = index + 1;
|
|
10
30
|
var isFocused = focusColIndex === ariaColIndex;
|
|
11
31
|
var cellVariantVal = cellVariant && cellVariant(col, index);
|
|
12
32
|
var cellFocusVariantVal = cellFocusVariant && cellFocusVariant(col, index);
|
|
13
|
-
|
|
33
|
+
var currentColSortingEnabled = sortingEnabled && col.sortable;
|
|
34
|
+
return (_jsx("div", { tabIndex: isFocused && !currentColSortingEnabled ? 0 : -1, className: classNames("rbdg-grid-cell", "fw-bold", cellVariantVal && "".concat(CSS_PREFIX, "-").concat(cellVariantVal), cellFocusVariantVal && "focus-ring-".concat(cellFocusVariantVal), {
|
|
35
|
+
"z-2": isFocused,
|
|
36
|
+
"rbdg-focusable-cell": isFocused && !currentColSortingEnabled,
|
|
37
|
+
"rbdg-sortable-header-cell": currentColSortingEnabled,
|
|
38
|
+
}), role: "columnheader", "aria-colindex": ariaColIndex, "aria-sort": currentColSortingEnabled && (sortColDef === null || sortColDef === void 0 ? void 0 : sortColDef.name) === col.name
|
|
39
|
+
? sortOrderToAriaSort(sortColDef.order)
|
|
40
|
+
: undefined, style: getWidthStyles(col.width || DEFAULT_COL_WIDTH), children: currentColSortingEnabled ? (_jsx(HeaderToggleButton, { tabIndex: isFocused ? 0 : -1, colLabel: col.label, sortOrder: (sortColDef === null || sortColDef === void 0 ? void 0 : sortColDef.name) === col.name ? sortColDef.order : null, onClick: getSortButtonListener(col.name) })) : (col.label) }, col.name));
|
|
14
41
|
}) }) }));
|
|
15
42
|
};
|
|
16
43
|
export default GridHeader;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AugFormattedRow } from "../../common/internalTypes";
|
|
2
|
+
import { FocusCoordinates } from "../focus/types";
|
|
3
|
+
import { GridProps } from "./types";
|
|
4
|
+
import { SortedRowsOutput } from "../../common/pipeline/useCombinedPipeline/useSortedRows";
|
|
5
|
+
/**
|
|
6
|
+
* Props interface for the GridHeader component
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export interface GridHeaderProps {
|
|
11
|
+
cols: GridProps["cols"];
|
|
12
|
+
vertScrollable: boolean;
|
|
13
|
+
rowVariant?: GridProps["headerRowVariant"];
|
|
14
|
+
cellVariant?: GridProps["headerCellVariant"];
|
|
15
|
+
focusColIndex: number | null;
|
|
16
|
+
cellFocusVariant?: GridProps["headerCellFocusVariant"];
|
|
17
|
+
sortInfo: Omit<SortedRowsOutput, "sortedRows">;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Props interface for the GridBody component
|
|
21
|
+
*
|
|
22
|
+
* @internal
|
|
23
|
+
*/
|
|
24
|
+
export type GridBodyProps = {
|
|
25
|
+
augFormattedRows: AugFormattedRow[];
|
|
26
|
+
cols: GridProps["cols"];
|
|
27
|
+
rowVariant?: GridProps["bodyRowVariant"];
|
|
28
|
+
cellVariant?: GridProps["bodyCellVariant"];
|
|
29
|
+
focusCoords: FocusCoordinates;
|
|
30
|
+
cellFocusVariant?: GridProps["bodyCellFocusVariant"];
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/grid/main/types.d.ts
CHANGED
|
@@ -1,41 +1,142 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { CellData, ColDef, FormattedRow, MainComponentSharedProps } from "../../common";
|
|
2
|
+
/**
|
|
3
|
+
* The type of the function used to specify color variants on a grid body on a
|
|
4
|
+
* per-cell level of granularity.
|
|
5
|
+
*
|
|
6
|
+
* @param cell - details the current cell
|
|
7
|
+
* @param row - details of the entire row that the current cell is in
|
|
8
|
+
* @param colIndex - zero-based column index of the current cell
|
|
9
|
+
* @param displayIndex - the zero-based index of the row that the cell is in.
|
|
10
|
+
* The index is based on how the cell is actually displayed after pagination,
|
|
11
|
+
* filtering, and sorting are applied.
|
|
12
|
+
*
|
|
13
|
+
* @returns - a string that is name of the color variant or null for no color
|
|
14
|
+
* variant
|
|
15
|
+
*
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
3
18
|
export type BodyCellVariantFn = (cell: CellData, row: FormattedRow, colIndex: number, displayIndex: number) => string | null;
|
|
19
|
+
/**
|
|
20
|
+
* The type of the function used to specify color variants on a grid header on a
|
|
21
|
+
* per-cell level of granularity.
|
|
22
|
+
*
|
|
23
|
+
* @param col - details of the column associated with the cell
|
|
24
|
+
* @param colIndex - the zero-based column index of the cell
|
|
25
|
+
*
|
|
26
|
+
* @returns - a string that is name of the color variant or null for no color
|
|
27
|
+
* variant
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
4
31
|
export type HeaderCellVariantFn = (col: ColDef, colIndex: number) => string | null;
|
|
5
|
-
|
|
32
|
+
/**
|
|
33
|
+
* The type of the props passed to the {@link Grid} component.
|
|
34
|
+
*
|
|
35
|
+
* @public
|
|
36
|
+
*/
|
|
37
|
+
export type GridProps = MainComponentSharedProps & GridSpecificProps;
|
|
38
|
+
/**
|
|
39
|
+
* Props specific to the {@link Grid} and not the {@link Table}.
|
|
40
|
+
*
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
export interface GridSpecificProps {
|
|
44
|
+
/**
|
|
45
|
+
* The height setting of the grid
|
|
46
|
+
*
|
|
47
|
+
* @defaultValue `auto`
|
|
48
|
+
*/
|
|
6
49
|
height?: GridHeightSetting;
|
|
50
|
+
/**
|
|
51
|
+
* The width setting of the grid
|
|
52
|
+
*
|
|
53
|
+
* @defaultValue `auto`
|
|
54
|
+
*/
|
|
7
55
|
width?: GridWidthSetting;
|
|
56
|
+
/**
|
|
57
|
+
* The grid-wide color variant
|
|
58
|
+
*/
|
|
8
59
|
variant?: string;
|
|
60
|
+
/**
|
|
61
|
+
* The stripe setting of the grid
|
|
62
|
+
*/
|
|
9
63
|
stripes?: GridStripeSetting;
|
|
64
|
+
/**
|
|
65
|
+
* Toggles hover styles for the grid
|
|
66
|
+
*/
|
|
10
67
|
hover?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* The border setting of the grid
|
|
70
|
+
*/
|
|
11
71
|
borders?: GridBorderSetting;
|
|
72
|
+
/**
|
|
73
|
+
* The border color variant of the grid
|
|
74
|
+
*/
|
|
12
75
|
borderVariant?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Toggles a denser grid style
|
|
78
|
+
*/
|
|
13
79
|
small?: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* Toggles a horizontal divider between the grid header and body
|
|
82
|
+
*/
|
|
14
83
|
divider?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Sets the color variant of the header row
|
|
86
|
+
*/
|
|
15
87
|
headerRowVariant?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Function to set the color variant of header cells. Overrides the row-wide
|
|
90
|
+
* setting when this function returns a non-null value.
|
|
91
|
+
*/
|
|
16
92
|
headerCellVariant?: HeaderCellVariantFn;
|
|
93
|
+
/**
|
|
94
|
+
* Function to set the color variant of body rows
|
|
95
|
+
*/
|
|
17
96
|
bodyRowVariant?: (row: FormattedRow, displayIndex: number) => string | null;
|
|
97
|
+
/**
|
|
98
|
+
* Function to set the color variant of body cells on a per-cell basis.
|
|
99
|
+
* Overrides the row-wide setting when this function returns a non-null value.
|
|
100
|
+
*/
|
|
18
101
|
bodyCellVariant?: BodyCellVariantFn;
|
|
102
|
+
/**
|
|
103
|
+
* Function to set the color variant of header cell focus rings
|
|
104
|
+
*/
|
|
19
105
|
headerCellFocusVariant?: HeaderCellVariantFn;
|
|
106
|
+
/**
|
|
107
|
+
* Function to set the color variant of body cell focus rings
|
|
108
|
+
*/
|
|
20
109
|
bodyCellFocusVariant?: BodyCellVariantFn;
|
|
21
|
-
};
|
|
22
|
-
export interface GridHeaderProps {
|
|
23
|
-
cols: GridProps["cols"];
|
|
24
|
-
vertScrollable: boolean;
|
|
25
|
-
rowVariant?: GridProps["headerRowVariant"];
|
|
26
|
-
cellVariant?: GridProps["headerCellVariant"];
|
|
27
|
-
focusColIndex: number | null;
|
|
28
|
-
cellFocusVariant?: GridProps["headerCellFocusVariant"];
|
|
29
110
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
111
|
+
/**
|
|
112
|
+
* The type of the prop to set grid height behavior
|
|
113
|
+
*
|
|
114
|
+
* - number: fixed height of grid in pixels
|
|
115
|
+
* - `auto`: takes on the intrinsic height of the contents
|
|
116
|
+
* - `parent`: takes on 100% of the parent height
|
|
117
|
+
*
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
38
120
|
export type GridHeightSetting = number | "auto" | "parent";
|
|
121
|
+
/**
|
|
122
|
+
* The type of the prop to set grid width behavior
|
|
123
|
+
*
|
|
124
|
+
* - number: fixed width of grid in pixels
|
|
125
|
+
* - `auto`: takes on the intrinsic width of the contents
|
|
126
|
+
* - `parent`: takes on 100% of the parent width
|
|
127
|
+
*
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
39
130
|
export type GridWidthSetting = number | "auto" | "parent";
|
|
131
|
+
/**
|
|
132
|
+
* The type of the prop to set the grid stripe style
|
|
133
|
+
*
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
40
136
|
export type GridStripeSetting = "rows" | "columns" | "none";
|
|
137
|
+
/**
|
|
138
|
+
* The type of the prop to set the grid border style
|
|
139
|
+
*
|
|
140
|
+
* @public
|
|
141
|
+
*/
|
|
41
142
|
export type GridBorderSetting = "horizontal" | "full" | "none";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { SortOrder } from "../../common";
|
|
2
|
+
import { FC, MouseEventHandler } from "react";
|
|
3
|
+
export interface HeaderToggleButtonProps {
|
|
4
|
+
colLabel: string;
|
|
5
|
+
sortOrder: SortOrder | null;
|
|
6
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
7
|
+
tabIndex: number;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
declare const HeaderToggleButton: FC<HeaderToggleButtonProps>;
|
|
11
|
+
export default HeaderToggleButton;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import CaretUp from "../../common/icons/CaretUp";
|
|
3
|
+
import CaretDownFill from "../../common/icons/CaretDownFill";
|
|
4
|
+
import CaretUpFill from "../../common/icons/CaretUpFill";
|
|
5
|
+
import classNames from "classnames";
|
|
6
|
+
var HeaderToggleButton = function (_a) {
|
|
7
|
+
var colLabel = _a.colLabel, sortOrder = _a.sortOrder, onClick = _a.onClick, tabIndex = _a.tabIndex, className = _a.className;
|
|
8
|
+
function getIcon() {
|
|
9
|
+
switch (sortOrder) {
|
|
10
|
+
case "asc":
|
|
11
|
+
return _jsx(CaretUpFill, { className: "rbdg-grid-header-button-icon" });
|
|
12
|
+
case "desc":
|
|
13
|
+
return _jsx(CaretDownFill, { className: "rbdg-grid-header-button-icon" });
|
|
14
|
+
default:
|
|
15
|
+
return (_jsx(CaretUp, { className: "rbdg-grid-header-button-icon rbdg-grid-header-button-hover-only-icon" }));
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function getAriaLabelSuffix() {
|
|
19
|
+
switch (sortOrder) {
|
|
20
|
+
case "asc":
|
|
21
|
+
return "(Sorted ascending. Click to sort descending.)";
|
|
22
|
+
case "desc":
|
|
23
|
+
return "(Sorted descending. Click to stop sorting.)";
|
|
24
|
+
default:
|
|
25
|
+
return "(Not sorted. Click to sort ascending.)";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return (_jsxs("button", { "aria-label": colLabel + " " + getAriaLabelSuffix(), onClick: onClick, className: classNames("rbdg-grid-header-button", className), tabIndex: tabIndex, children: [_jsx("span", { className: "rbdg-grid-header-button-label", children: colLabel }), getIcon()] }));
|
|
29
|
+
};
|
|
30
|
+
export default HeaderToggleButton;
|
package/grid.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.rbdg-grid>div,.rbdg-grid>div>div,.rbdg-grid>div>div>div{border-color:inherit;border-style:solid;border-width:0}.rbdg-grid{--rbdg-grid-color: var(--bs-emphasis-color);--rbdg-grid-bg: var(--bs-body-bg);--rbdg-grid-border-color: var(--bs-border-color);--rbdg-grid-accent-bg: transparent;--rbdg-grid-striped-color: var(--bs-emphasis-color);--rbdg-grid-striped-bg: rgba(var(--bs-emphasis-color-rgb), 0.05);--rbdg-grid-active-color: var(--bs-emphasis-color);--rbdg-grid-active-bg: rgba(var(--bs-emphasis-color-rgb), 0.1);--rbdg-grid-hover-color: var(--bs-emphasis-color);--rbdg-grid-hover-bg: rgba(var(--bs-emphasis-color-rgb), 0.075);border-color:var(--rbdg-grid-border-color)}.rbdg-grid>div{width:min-content}.rbdg-grid>div>div>div{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding:.5rem .5rem;color:var(--rbdg-grid-color-state, var(--rbdg-grid-color-type, var(--rbdg-grid-color)));background-color:var(--rbdg-grid-bg);border-bottom-width:var(--bs-border-width);box-shadow:inset 0 0 0 9999px var(--rbdg-grid-bg-state, var(--rbdg-grid-bg-type, var(--rbdg-grid-accent-bg)))}.rbdg-grid>div>div>div.rbdg-focusable-cell:focus{outline:0;box-shadow:inset 0 0 0 9999px var(--rbdg-grid-bg-state, var(--rbdg-grid-bg-type, var(--rbdg-grid-accent-bg))),var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.rbdg-grid>div:first-child>div>div{border-bottom-width:var(--rbdg-grid-divider-border-width, var(--rbdg-grid-divider-borderless-width, var(--bs-border-width)));border-bottom-style:var(--rbdg-grid-divider-border-style, inherit);border-bottom-color:var(--rbdg-grid-divider-border-color, inherit)}.rbdg-grid-group-divider{--rbdg-grid-divider-border-width: calc(var(--bs-border-width) * 2);--rbdg-grid-divider-border-style: solid;--rbdg-grid-divider-border-color: currentcolor}.rbdg-grid-sm>div>div>div{padding:.25rem .25rem}.rbdg-grid-bordered{border-width:var(--bs-border-width);border-style:solid}.rbdg-grid-bordered>div>div>div:not(:last-child){border-width:0 var(--bs-border-width) 0 0}.rbdg-grid-bordered>div>div>div:last-child{border-width:0}.rbdg-grid-bordered>div:first-child>div{border-top-width:0;border-right-width:0;border-left-width:0;border-bottom-width:var(--rbdg-grid-divider-border-width, var(--rbdg-grid-divider-borderless-width, var(--bs-border-width)));border-bottom-style:var(--rbdg-grid-divider-border-style, inherit);border-bottom-color:var(--rbdg-grid-divider-border-color, inherit)}.rbdg-grid-bordered>div:last-child>div:not(:last-child){border-width:0 0 var(--bs-border-width) 0}.rbdg-grid-borderless{--rbdg-grid-divider-borderless-width: 0}.rbdg-grid-borderless>div>div>div{border-bottom-width:0}.rbdg-grid-borderless>:not(:first-child){border-top-width:0}.rbdg-grid-striped>div:nth-of-type(2)>div:nth-of-type(odd)>div{--rbdg-grid-color-type: var(--rbdg-grid-striped-color);--rbdg-grid-bg-type: var(--rbdg-grid-striped-bg)}.rbdg-grid-striped-columns>div>div>:nth-child(even){--rbdg-grid-color-type: var(--rbdg-grid-striped-color);--rbdg-grid-bg-type: var(--rbdg-grid-striped-bg)}.rbdg-grid-active{--rbdg-grid-color-state: var(--bs-grid-active-color);--rbdg-grid-bg-state: var(--rbdg-grid-active-bg)}.rbdg-grid-hover>div:nth-of-type(2)>div:hover>div{--rbdg-grid-color-state: var(--rbdg-grid-hover-color);--rbdg-grid-bg-state: var(--rbdg-grid-hover-bg)}.rbdg-grid-primary{--rbdg-grid-color: #000;--rbdg-grid-bg: rgb(206.6, 226, 254.6);--rbdg-grid-border-color: rgb(165.28, 180.8, 203.68);--rbdg-grid-striped-bg: rgb(196.27, 214.7, 241.87);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(185.94, 203.4, 229.14);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(191.105, 209.05, 235.505);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-secondary{--rbdg-grid-color: #000;--rbdg-grid-bg: rgb(225.6, 227.4, 229);--rbdg-grid-border-color: rgb(180.48, 181.92, 183.2);--rbdg-grid-striped-bg: rgb(214.32, 216.03, 217.55);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(203.04, 204.66, 206.1);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(208.68, 210.345, 211.825);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-success{--rbdg-grid-color: #000;--rbdg-grid-bg: rgb(209, 231, 220.8);--rbdg-grid-border-color: rgb(167.2, 184.8, 176.64);--rbdg-grid-striped-bg: rgb(198.55, 219.45, 209.76);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(188.1, 207.9, 198.72);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(193.325, 213.675, 204.24);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-info{--rbdg-grid-color: #000;--rbdg-grid-bg: rgb(206.6, 244.4, 252);--rbdg-grid-border-color: rgb(165.28, 195.52, 201.6);--rbdg-grid-striped-bg: rgb(196.27, 232.18, 239.4);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(185.94, 219.96, 226.8);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(191.105, 226.07, 233.1);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-warning{--rbdg-grid-color: #000;--rbdg-grid-bg: rgb(255, 242.6, 205.4);--rbdg-grid-border-color: rgb(204, 194.08, 164.32);--rbdg-grid-striped-bg: rgb(242.25, 230.47, 195.13);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(229.5, 218.34, 184.86);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(235.875, 224.405, 189.995);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-danger{--rbdg-grid-color: #000;--rbdg-grid-bg: rgb(248, 214.6, 217.8);--rbdg-grid-border-color: rgb(198.4, 171.68, 174.24);--rbdg-grid-striped-bg: rgb(235.6, 203.87, 206.91);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(223.2, 193.14, 196.02);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(229.4, 198.505, 201.465);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-light{--rbdg-grid-color: #000;--rbdg-grid-bg: #f8f9fa;--rbdg-grid-border-color: rgb(198.4, 199.2, 200);--rbdg-grid-striped-bg: rgb(235.6, 236.55, 237.5);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(223.2, 224.1, 225);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(229.4, 230.325, 231.25);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-dark{--rbdg-grid-color: #fff;--rbdg-grid-bg: #212529;--rbdg-grid-border-color: rgb(77.4, 80.6, 83.8);--rbdg-grid-striped-bg: rgb(44.1, 47.9, 51.7);--rbdg-grid-striped-color: #fff;--rbdg-grid-active-bg: rgb(55.2, 58.8, 62.4);--rbdg-grid-active-color: #fff;--rbdg-grid-hover-bg: rgb(49.65, 53.35, 57.05);--rbdg-grid-hover-color: #fff;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}
|
|
1
|
+
.rbdg-grid>div,.rbdg-grid>div>div,.rbdg-grid>div>div>div{border-color:inherit;border-style:solid;border-width:0}.rbdg-grid{--rbdg-grid-color: var(--bs-emphasis-color);--rbdg-grid-bg: var(--bs-body-bg);--rbdg-grid-border-color: var(--bs-border-color);--rbdg-grid-accent-bg: transparent;--rbdg-grid-striped-color: var(--bs-emphasis-color);--rbdg-grid-striped-bg: rgba(var(--bs-emphasis-color-rgb), 0.05);--rbdg-grid-active-color: var(--bs-emphasis-color);--rbdg-grid-active-bg: rgba(var(--bs-emphasis-color-rgb), 0.1);--rbdg-grid-hover-color: var(--bs-emphasis-color);--rbdg-grid-hover-bg: rgba(var(--bs-emphasis-color-rgb), 0.075);border-color:var(--rbdg-grid-border-color)}.rbdg-grid>div{width:min-content}.rbdg-grid>div>div>div{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;padding:.5rem .5rem;color:var(--rbdg-grid-color-state, var(--rbdg-grid-color-type, var(--rbdg-grid-color)));background-color:var(--rbdg-grid-bg);border-bottom-width:var(--bs-border-width);box-shadow:inset 0 0 0 9999px var(--rbdg-grid-bg-state, var(--rbdg-grid-bg-type, var(--rbdg-grid-accent-bg)))}.rbdg-grid>div>div>div.rbdg-sortable-header-cell{padding:0;overflow:visible}.rbdg-grid>div>div>div.rbdg-focusable-cell:focus{outline:0;box-shadow:inset 0 0 0 9999px var(--rbdg-grid-bg-state, var(--rbdg-grid-bg-type, var(--rbdg-grid-accent-bg))),var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.rbdg-grid>div:first-child>div>div{border-bottom-width:var(--rbdg-grid-divider-border-width, var(--rbdg-grid-divider-borderless-width, var(--bs-border-width)));border-bottom-style:var(--rbdg-grid-divider-border-style, inherit);border-bottom-color:var(--rbdg-grid-divider-border-color, inherit)}.rbdg-grid-group-divider{--rbdg-grid-divider-border-width: calc(var(--bs-border-width) * 2);--rbdg-grid-divider-border-style: solid;--rbdg-grid-divider-border-color: currentcolor}.rbdg-grid-sm>div>div>div{padding:.25rem .25rem}.rbdg-grid-bordered{border-width:var(--bs-border-width);border-style:solid}.rbdg-grid-bordered>div>div>div:not(:last-child){border-width:0 var(--bs-border-width) 0 0}.rbdg-grid-bordered>div>div>div:last-child{border-width:0}.rbdg-grid-bordered>div:first-child>div{border-top-width:0;border-right-width:0;border-left-width:0;border-bottom-width:var(--rbdg-grid-divider-border-width, var(--rbdg-grid-divider-borderless-width, var(--bs-border-width)));border-bottom-style:var(--rbdg-grid-divider-border-style, inherit);border-bottom-color:var(--rbdg-grid-divider-border-color, inherit)}.rbdg-grid-bordered>div:last-child>div:not(:last-child){border-width:0 0 var(--bs-border-width) 0}.rbdg-grid-borderless{--rbdg-grid-divider-borderless-width: 0}.rbdg-grid-borderless>div>div>div{border-bottom-width:0}.rbdg-grid-borderless>:not(:first-child){border-top-width:0}.rbdg-grid-striped>div:nth-of-type(2)>div:nth-of-type(odd)>div{--rbdg-grid-color-type: var(--rbdg-grid-striped-color);--rbdg-grid-bg-type: var(--rbdg-grid-striped-bg)}.rbdg-grid-striped-columns>div>div>:nth-child(even){--rbdg-grid-color-type: var(--rbdg-grid-striped-color);--rbdg-grid-bg-type: var(--rbdg-grid-striped-bg)}.rbdg-grid-active{--rbdg-grid-color-state: var(--bs-grid-active-color);--rbdg-grid-bg-state: var(--rbdg-grid-active-bg)}.rbdg-grid-hover>div:nth-of-type(2)>div:hover>div{--rbdg-grid-color-state: var(--rbdg-grid-hover-color);--rbdg-grid-bg-state: var(--rbdg-grid-hover-bg)}.rbdg-grid-primary{--rbdg-grid-color: #000;--rbdg-grid-bg: rgb(206.6, 226, 254.6);--rbdg-grid-border-color: rgb(165.28, 180.8, 203.68);--rbdg-grid-striped-bg: rgb(196.27, 214.7, 241.87);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(185.94, 203.4, 229.14);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(191.105, 209.05, 235.505);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-secondary{--rbdg-grid-color: #000;--rbdg-grid-bg: rgb(225.6, 227.4, 229);--rbdg-grid-border-color: rgb(180.48, 181.92, 183.2);--rbdg-grid-striped-bg: rgb(214.32, 216.03, 217.55);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(203.04, 204.66, 206.1);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(208.68, 210.345, 211.825);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-success{--rbdg-grid-color: #000;--rbdg-grid-bg: rgb(209, 231, 220.8);--rbdg-grid-border-color: rgb(167.2, 184.8, 176.64);--rbdg-grid-striped-bg: rgb(198.55, 219.45, 209.76);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(188.1, 207.9, 198.72);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(193.325, 213.675, 204.24);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-info{--rbdg-grid-color: #000;--rbdg-grid-bg: rgb(206.6, 244.4, 252);--rbdg-grid-border-color: rgb(165.28, 195.52, 201.6);--rbdg-grid-striped-bg: rgb(196.27, 232.18, 239.4);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(185.94, 219.96, 226.8);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(191.105, 226.07, 233.1);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-warning{--rbdg-grid-color: #000;--rbdg-grid-bg: rgb(255, 242.6, 205.4);--rbdg-grid-border-color: rgb(204, 194.08, 164.32);--rbdg-grid-striped-bg: rgb(242.25, 230.47, 195.13);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(229.5, 218.34, 184.86);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(235.875, 224.405, 189.995);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-danger{--rbdg-grid-color: #000;--rbdg-grid-bg: rgb(248, 214.6, 217.8);--rbdg-grid-border-color: rgb(198.4, 171.68, 174.24);--rbdg-grid-striped-bg: rgb(235.6, 203.87, 206.91);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(223.2, 193.14, 196.02);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(229.4, 198.505, 201.465);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-light{--rbdg-grid-color: #000;--rbdg-grid-bg: #f8f9fa;--rbdg-grid-border-color: rgb(198.4, 199.2, 200);--rbdg-grid-striped-bg: rgb(235.6, 236.55, 237.5);--rbdg-grid-striped-color: #000;--rbdg-grid-active-bg: rgb(223.2, 224.1, 225);--rbdg-grid-active-color: #000;--rbdg-grid-hover-bg: rgb(229.4, 230.325, 231.25);--rbdg-grid-hover-color: #000;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-dark{--rbdg-grid-color: #fff;--rbdg-grid-bg: #212529;--rbdg-grid-border-color: rgb(77.4, 80.6, 83.8);--rbdg-grid-striped-bg: rgb(44.1, 47.9, 51.7);--rbdg-grid-striped-color: #fff;--rbdg-grid-active-bg: rgb(55.2, 58.8, 62.4);--rbdg-grid-active-color: #fff;--rbdg-grid-hover-bg: rgb(49.65, 53.35, 57.05);--rbdg-grid-hover-color: #fff;color:var(--rbdg-grid-color);border-color:var(--rbdg-grid-border-color)}.rbdg-grid-header-button{display:flex;align-items:center;appearance:none;background:rgba(0,0,0,0);border:none;padding:.5rem .5rem;width:100%;height:100%;cursor:pointer;color:inherit;font-weight:inherit;text-align:inherit}.rbdg-grid-header-button .rbdg-grid-header-button-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0;flex-shrink:1}.rbdg-grid-header-button .rbdg-grid-header-button-hover-only-icon{visibility:hidden}.rbdg-grid-header-button:hover{color:var(--rbdg-grid-hover-color);background:var(--rbdg-grid-hover-bg)}.rbdg-grid-header-button:hover .rbdg-grid-header-button-hover-only-icon{visibility:visible}.rbdg-grid-header-button:focus{outline:0;box-shadow:inset 0 0 0 9999px var(--rbdg-grid-bg-state, var(--rbdg-grid-bg-type, var(--rbdg-grid-accent-bg))),var(--bs-focus-ring-x, 0) var(--bs-focus-ring-y, 0) var(--bs-focus-ring-blur, 0) var(--bs-focus-ring-width) var(--bs-focus-ring-color)}.rbdg-grid-header-button-icon{height:1em;flex-shrink:0}
|
package/grid.scss
CHANGED
|
@@ -11,6 +11,19 @@ $rbdg-prefix: "rbdg-";
|
|
|
11
11
|
border-width: 0;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
@mixin rbdg-focusable-element {
|
|
15
|
+
outline: 0;
|
|
16
|
+
box-shadow:
|
|
17
|
+
inset 0 0 0 9999px
|
|
18
|
+
var(
|
|
19
|
+
--#{$rbdg-prefix}grid-bg-state,
|
|
20
|
+
var(--#{$rbdg-prefix}grid-bg-type, var(--#{$rbdg-prefix}grid-accent-bg))
|
|
21
|
+
),
|
|
22
|
+
var(--#{$prefix}focus-ring-x, 0) var(--#{$prefix}focus-ring-y, 0)
|
|
23
|
+
var(--#{$prefix}focus-ring-blur, 0) var(--#{$prefix}focus-ring-width)
|
|
24
|
+
var(--#{$prefix}focus-ring-color);
|
|
25
|
+
}
|
|
26
|
+
|
|
14
27
|
// While these rules seem to work, the way that the three border modes, default; bordered; and borderless override each
|
|
15
28
|
// other is quite hard to understand.
|
|
16
29
|
// Consider refactoring so that each type mode, including default, has a separate class that contains rules for just
|
|
@@ -47,28 +60,30 @@ $rbdg-prefix: "rbdg-";
|
|
|
47
60
|
padding: $table-cell-padding-y $table-cell-padding-x;
|
|
48
61
|
color: var(
|
|
49
62
|
--#{$rbdg-prefix}grid-color-state,
|
|
50
|
-
var(
|
|
63
|
+
var(
|
|
64
|
+
--#{$rbdg-prefix}grid-color-type,
|
|
65
|
+
var(--#{$rbdg-prefix}grid-color)
|
|
66
|
+
)
|
|
51
67
|
);
|
|
52
68
|
background-color: var(--#{$rbdg-prefix}grid-bg);
|
|
53
69
|
border-bottom-width: $table-border-width;
|
|
54
|
-
box-shadow: inset 0 0 0 9999px
|
|
55
|
-
--#{$rbdg-prefix}grid-bg-state,
|
|
70
|
+
box-shadow: inset 0 0 0 9999px
|
|
56
71
|
var(
|
|
57
|
-
--#{$rbdg-prefix}grid-bg-
|
|
58
|
-
var(
|
|
59
|
-
|
|
60
|
-
|
|
72
|
+
--#{$rbdg-prefix}grid-bg-state,
|
|
73
|
+
var(
|
|
74
|
+
--#{$rbdg-prefix}grid-bg-type,
|
|
75
|
+
var(--#{$rbdg-prefix}grid-accent-bg)
|
|
76
|
+
)
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
> div.rbdg-sortable-header-cell {
|
|
81
|
+
padding: 0;
|
|
82
|
+
overflow: visible;
|
|
61
83
|
}
|
|
62
84
|
|
|
63
85
|
> div.rbdg-focusable-cell:focus {
|
|
64
|
-
|
|
65
|
-
box-shadow: inset 0 0 0 9999px var(
|
|
66
|
-
--#{$rbdg-prefix}grid-bg-state,
|
|
67
|
-
var(
|
|
68
|
-
--#{$rbdg-prefix}grid-bg-type,
|
|
69
|
-
var(--#{$rbdg-prefix}grid-accent-bg)
|
|
70
|
-
)
|
|
71
|
-
), var(--#{$prefix}focus-ring-x, 0) var(--#{$prefix}focus-ring-y, 0) var(--#{$prefix}focus-ring-blur, 0) var(--#{$prefix}focus-ring-width) var(--#{$prefix}focus-ring-color);
|
|
86
|
+
@include rbdg-focusable-element;
|
|
72
87
|
}
|
|
73
88
|
}
|
|
74
89
|
}
|
|
@@ -223,21 +238,68 @@ $rbdg-prefix: "rbdg-";
|
|
|
223
238
|
@include rbdg-grid-variant($color, $value);
|
|
224
239
|
}
|
|
225
240
|
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
/*
|
|
242
|
+
A Note About Responsive Tables
|
|
243
|
+
|
|
244
|
+
The Bootstrap _tables.scss file contains a series of classes to apply responsive tables at various breakpoints.
|
|
245
|
+
There is no such equivalent for RBDG flex grid for the following reason.
|
|
246
|
+
|
|
247
|
+
The RBDG flex grid is a div of type "block," so the concept of "responsive" scrollable breakpoints doesn't apply.
|
|
248
|
+
It appears that for a table, even if the width is to 100%, the browser sometimes disobeys this setting causing
|
|
249
|
+
the width to be more than the parent, hence the need for responsive tables. Divs do not appear to have this problem.
|
|
250
|
+
|
|
251
|
+
The RBDG flex grid provides other options to achieving a horizontally scrollable grid. They are as follows.
|
|
252
|
+
|
|
253
|
+
When using the default or "auto" setting for the RBDG grid's "width," the intrinsic width of the grid columns is
|
|
254
|
+
used. In such circumstances, if one wants to make the grid scrollable horizontally, they can enclose the grid in a
|
|
255
|
+
horizontally-scrollable div.
|
|
256
|
+
|
|
257
|
+
When the grid's width is to set to "parent", the grid takes on the width of the parent (width 100% CSS value) just
|
|
258
|
+
like the Bootstrap table does. In this case, the grid div itself is horizontally scrollable. In contrast, for
|
|
259
|
+
responsive Bootstrap tables, it is a div that encloses the table element that is scrollable.
|
|
260
|
+
*/
|
|
261
|
+
|
|
262
|
+
.rbdg-grid-header-button {
|
|
263
|
+
display: flex;
|
|
264
|
+
align-items: center;
|
|
265
|
+
appearance: none;
|
|
266
|
+
background: transparent;
|
|
267
|
+
border: none;
|
|
268
|
+
padding: $table-cell-padding-y $table-cell-padding-x;
|
|
269
|
+
width: 100%;
|
|
270
|
+
height: 100%;
|
|
271
|
+
cursor: pointer;
|
|
272
|
+
color: inherit;
|
|
273
|
+
font-weight: inherit;
|
|
274
|
+
text-align: inherit;
|
|
275
|
+
|
|
276
|
+
.rbdg-grid-header-button-label {
|
|
277
|
+
overflow: hidden;
|
|
278
|
+
text-overflow: ellipsis;
|
|
279
|
+
white-space: nowrap;
|
|
280
|
+
min-width: 0;
|
|
281
|
+
flex-shrink: 1;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.rbdg-grid-header-button-hover-only-icon {
|
|
285
|
+
visibility: hidden;
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
&:hover {
|
|
289
|
+
color: var(--#{$rbdg-prefix}grid-hover-color);
|
|
290
|
+
background: var(--#{$rbdg-prefix}grid-hover-bg);
|
|
291
|
+
|
|
292
|
+
.rbdg-grid-header-button-hover-only-icon {
|
|
293
|
+
visibility: visible;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
&:focus {
|
|
298
|
+
@include rbdg-focusable-element;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.rbdg-grid-header-button-icon {
|
|
303
|
+
height: 1em;
|
|
304
|
+
flex-shrink: 0;
|
|
305
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absreim/react-bootstrap-data-grid",
|
|
3
3
|
"description": "Data grid UI component for use with web apps using React and Bootstrap",
|
|
4
|
-
"version": "4.
|
|
4
|
+
"version": "4.3.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Brook Li",
|
|
7
7
|
"homepage": "https://react-bootstrap-data-grid.vercel.app/",
|
|
@@ -23,12 +23,12 @@
|
|
|
23
23
|
"react": "^19",
|
|
24
24
|
"react-dom": "^19"
|
|
25
25
|
},
|
|
26
|
-
"main": "./index.js",
|
|
27
|
-
"module": "./index.js",
|
|
28
|
-
"types": "./index.d.ts",
|
|
26
|
+
"main": "./community/index.js",
|
|
27
|
+
"module": "./community/index.js",
|
|
28
|
+
"types": "./community/index.d.ts",
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "git",
|
|
31
31
|
"url": "git+https://github.com/absreim/react-bootstrap-data-grid.git",
|
|
32
|
-
"directory": "src/
|
|
32
|
+
"directory": "src/community"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/table/InternalTable.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FC, ReactNode } from "react";
|
|
2
|
-
import { BaseTableProps } from "./types";
|
|
3
2
|
import { UseCombinedPipelineHook } from "../common/pipeline/useCombinedPipeline";
|
|
4
3
|
import { UseGridSelectionFnsHook } from "../common/pipeline/useGridSelectionFns";
|
|
4
|
+
import { BaseTableProps } from "./internalTypes";
|
|
5
5
|
export interface InternalGridProps {
|
|
6
6
|
gridProps: BaseTableProps;
|
|
7
7
|
hooks: {
|
package/table/Table.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { TableProps } from "./types";
|
|
3
|
+
/**
|
|
4
|
+
* The main component of the table feature of react-bootstrap-data-grid.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
3
8
|
declare const Table: FC<TableProps>;
|
|
4
9
|
export default Table;
|
|
5
|
-
export type { TableProps } from "./types";
|
package/table/Table.js
CHANGED
|
@@ -8,6 +8,11 @@ import useGetInputStrSubmitCallback from "../common/pipeline/useGetInputStrSubmi
|
|
|
8
8
|
import useAugFormattedRows from "../common/pipeline/useAugFormattedRows";
|
|
9
9
|
import BodyRows from "./main/BodyRows";
|
|
10
10
|
import useColNameToWidth from "../common/pipeline/useColNameToWidth";
|
|
11
|
+
/**
|
|
12
|
+
* The main component of the table feature of react-bootstrap-data-grid.
|
|
13
|
+
*
|
|
14
|
+
* @public
|
|
15
|
+
*/
|
|
11
16
|
var Table = function (props) {
|
|
12
17
|
var rows = props.rows, cols = props.cols, filterModel = props.filterModel, sortModel = props.sortModel, pagination = props.pagination, selectModel = props.selectModel, styleModel = props.styleModel, editModel = props.editModel;
|
|
13
18
|
var combinedPipelineOutput = useCombinedPipeline({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, FC, ReactNode } from "react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { CellData, RowId } from "../../common
|
|
3
|
+
import { CellData, RowId } from "../../common";
|
|
4
4
|
export type EditableRowProps = Pick<React.ComponentProps<"tr">, "onClick" | "className" | "aria-rowindex" | "aria-selected"> & {
|
|
5
5
|
ariaColIndexOffset: number;
|
|
6
6
|
dataRowId: RowId;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useRef, useState } from "react";
|
|
4
|
-
import { dateToDatetimeInputStr, dateToInputStr
|
|
4
|
+
import { dateToDatetimeInputStr, dateToInputStr } from "../../common";
|
|
5
5
|
import EditControlsCell from "./EditControlsCell";
|
|
6
6
|
import classNames from "classnames";
|
|
7
7
|
import getWidthStyle from "../../common/util/getWidthStyle";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ColSortModel } from "../common/sorting/internalTypes";
|
|
2
|
+
import { ColDefBase } from "../common";
|
|
3
|
+
import { TableProps } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* All props that community and pro versions of the table have in common.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export type BaseTableProps = Omit<TableProps, "cols"> & {
|
|
10
|
+
cols: ColDefBase[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Props for the ColHeaderCell component.
|
|
14
|
+
*
|
|
15
|
+
* @internal
|
|
16
|
+
*/
|
|
17
|
+
export interface ColHeaderCellProps {
|
|
18
|
+
label: string;
|
|
19
|
+
sortModel?: ColSortModel;
|
|
20
|
+
ariaColIndex: number;
|
|
21
|
+
additionalClasses?: string[] | null;
|
|
22
|
+
width?: number;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/table/main/BodyRows.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { FC, ReactNode } from "react";
|
|
2
2
|
import { UseGridSelectionFnsHook } from "../../common/pipeline/useGridSelectionFns";
|
|
3
3
|
import { UseCombinedPipelineHook } from "../../common/pipeline/useCombinedPipeline";
|
|
4
|
-
import { SelectModel } from "../../common
|
|
4
|
+
import { SelectModel } from "../../common";
|
|
5
5
|
import { UseGetInputStrSubmitCallbackHook } from "../../common/pipeline/useGetInputStrSubmitCallback";
|
|
6
6
|
import { TableStyleModel } from "../styling/types";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { FormattedRow, RowId } from "../../common";
|
|
8
|
+
import { AugFormattedRow } from "../../common/internalTypes";
|
|
9
|
+
import { EditModel } from "../../common";
|
|
9
10
|
interface BodyRowsProps {
|
|
10
11
|
augFormattedRows: AugFormattedRow[];
|
|
11
12
|
gridSelectionFns: UseGridSelectionFnsHook;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CSSProperties, FC } from "react";
|
|
2
|
-
import { SelectionInfo } from "../../common/selection/
|
|
2
|
+
import { SelectionInfo } from "../../common/selection/internalTypes";
|
|
3
3
|
interface SelectAllHeaderCellProps {
|
|
4
4
|
onClick: () => void;
|
|
5
5
|
selectionInfo: SelectionInfo;
|