@absreim/react-bootstrap-data-grid 4.0.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.
Files changed (91) hide show
  1. package/common/constants.d.ts +2 -0
  2. package/common/constants.js +2 -0
  3. package/common/editing/types.d.ts +30 -0
  4. package/common/export/types.d.ts +6 -0
  5. package/common/export/useExportFn.js +1 -1
  6. package/common/filtering/DateFilterRow.d.ts +1 -1
  7. package/common/filtering/DateFilterRow.js +1 -1
  8. package/common/filtering/FilterOptionsTable.d.ts +3 -2
  9. package/common/filtering/NumberFilterRow.d.ts +1 -1
  10. package/common/filtering/NumberFilterRow.js +1 -1
  11. package/common/filtering/StringFilterRow.js +1 -1
  12. package/common/filtering/constants.d.ts +19 -0
  13. package/common/filtering/constants.js +44 -0
  14. package/common/filtering/internalTypes.d.ts +77 -0
  15. package/common/filtering/types.d.ts +165 -22
  16. package/common/filtering/types.js +46 -17
  17. package/common/filtering/useFilterFormState.d.ts +1 -1
  18. package/common/index.d.ts +0 -3
  19. package/common/index.js +0 -3
  20. package/common/internalTypes.d.ts +10 -0
  21. package/common/pagination/Pagination.d.ts +1 -1
  22. package/common/pagination/internalTypes.d.ts +8 -0
  23. package/common/pagination/internalTypes.js +1 -0
  24. package/common/pagination/types.d.ts +105 -5
  25. package/common/pipeline/{types.d.ts → internalTypes.d.ts} +5 -0
  26. package/common/pipeline/internalTypes.js +1 -0
  27. package/common/pipeline/useAugFormattedRows.d.ts +3 -2
  28. package/common/pipeline/useColNameToWidth.d.ts +2 -1
  29. package/common/pipeline/useCombinedPipeline/index.d.ts +4 -3
  30. package/common/pipeline/useCombinedPipeline/useCurrentPageRows.d.ts +2 -1
  31. package/common/pipeline/useCombinedPipeline/useCurrentPageRows.js +3 -2
  32. package/common/pipeline/useCombinedPipeline/useFilterStateFromEditable.d.ts +2 -1
  33. package/common/pipeline/useCombinedPipeline/useFilterStateStore.d.ts +2 -1
  34. package/common/pipeline/useGridSelectionFns.d.ts +2 -1
  35. package/common/selection/internalTypes.d.ts +34 -0
  36. package/common/selection/internalTypes.js +1 -0
  37. package/common/selection/types.d.ts +91 -17
  38. package/common/selection/types.js +0 -3
  39. package/common/sorting/internalTypes.d.ts +10 -0
  40. package/common/sorting/internalTypes.js +1 -0
  41. package/common/sorting/types.d.ts +48 -4
  42. package/common/sorting/useSortHeaderStates.d.ts +1 -1
  43. package/common/styling/types.d.ts +57 -0
  44. package/common/toolbar/Toolbar.d.ts +1 -1
  45. package/common/toolbar/ToolbarContainer.d.ts +1 -1
  46. package/common/toolbar/{types.d.ts → internalTypes.d.ts} +27 -0
  47. package/common/toolbar/internalTypes.js +1 -0
  48. package/common/toolbar/useInterfaces.d.ts +1 -1
  49. package/common/types.d.ts +165 -18
  50. package/common/util/datetime.d.ts +17 -0
  51. package/common/util/datetime.js +17 -0
  52. package/common/util/getWidthStyle.d.ts +9 -0
  53. package/common/util/getWidthStyle.js +9 -0
  54. package/common/util/index.d.ts +0 -4
  55. package/common/util/index.js +0 -4
  56. package/common/util/isSubset.d.ts +12 -1
  57. package/common/util/isSubset.js +13 -2
  58. package/common/util/useControlledHover.d.ts +5 -0
  59. package/common/util/useControlledHover.js +5 -0
  60. package/grid/focus/types.d.ts +15 -0
  61. package/grid/focus/types.js +1 -0
  62. package/grid/focus/useGridFocus.d.ts +10 -0
  63. package/grid/focus/useGridFocus.js +130 -0
  64. package/grid/main/Grid.d.ts +5 -0
  65. package/grid/main/Grid.js +26 -8
  66. package/grid/main/GridBody.d.ts +1 -1
  67. package/grid/main/GridBody.js +20 -9
  68. package/grid/main/GridHeader.d.ts +1 -1
  69. package/grid/main/GridHeader.js +8 -4
  70. package/grid/main/internalTypes.d.ts +29 -0
  71. package/grid/main/internalTypes.js +1 -0
  72. package/grid/main/types.d.ts +114 -16
  73. package/grid.css +1 -1
  74. package/grid.scss +26 -14
  75. package/package.json +5 -5
  76. package/table/InternalTable.d.ts +1 -1
  77. package/table/Table.d.ts +5 -1
  78. package/table/Table.js +5 -0
  79. package/table/editing/EditableRow.d.ts +1 -1
  80. package/table/editing/EditableRow.js +1 -1
  81. package/table/internalTypes.d.ts +23 -0
  82. package/table/internalTypes.js +1 -0
  83. package/table/main/BodyRows.d.ts +4 -3
  84. package/table/main/ColHeaderCell/index.d.ts +1 -1
  85. package/table/selection/SelectAllHeaderCell.d.ts +1 -1
  86. package/table/styling/types.d.ts +122 -5
  87. package/table/types.d.ts +62 -15
  88. package/common/util/trueModulo.d.ts +0 -2
  89. package/common/util/trueModulo.js +0 -4
  90. /package/common/{pipeline/types.js → filtering/internalTypes.js} +0 -0
  91. /package/common/{toolbar/types.js → internalTypes.js} +0 -0
@@ -4,9 +4,13 @@ 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
6
  var GridHeader = function (_a) {
7
- var cols = _a.cols, vertScrollable = _a.vertScrollable, rowVariant = _a.rowVariant, cellVariant = _a.cellVariant;
8
- 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) { return (_jsx("div", { className: classNames("rbdg-grid-cell", "fw-bold", cellVariant &&
9
- cellVariant(col, index) &&
10
- "".concat(CSS_PREFIX, "-").concat(cellVariant(col, index))), role: "columnheader", "aria-colindex": index + 1, style: getWidthStyles(col.width || DEFAULT_COL_WIDTH), children: col.label }, col.name)); }) }) }));
7
+ var cols = _a.cols, vertScrollable = _a.vertScrollable, rowVariant = _a.rowVariant, cellVariant = _a.cellVariant, focusColIndex = _a.focusColIndex, cellFocusVariant = _a.cellFocusVariant;
8
+ 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
+ var ariaColIndex = index + 1;
10
+ var isFocused = focusColIndex === ariaColIndex;
11
+ var cellVariantVal = cellVariant && cellVariant(col, index);
12
+ var cellFocusVariantVal = cellFocusVariant && cellFocusVariant(col, index);
13
+ return (_jsx("div", { tabIndex: isFocused ? 0 : -1, className: classNames("rbdg-grid-cell", "fw-bold", cellVariantVal && "".concat(CSS_PREFIX, "-").concat(cellVariantVal), cellFocusVariantVal && "focus-ring-".concat(cellFocusVariantVal), { "z-2": isFocused, "rbdg-focusable-cell": isFocused }), role: "columnheader", "aria-colindex": ariaColIndex, style: getWidthStyles(col.width || DEFAULT_COL_WIDTH), children: col.label }, col.name));
14
+ }) }) }));
11
15
  };
12
16
  export default GridHeader;
@@ -0,0 +1,29 @@
1
+ import { AugFormattedRow } from "../../common/internalTypes";
2
+ import { FocusCoordinates } from "../focus/types";
3
+ import { GridProps } from "./types";
4
+ /**
5
+ * Props interface for the GridHeader component
6
+ *
7
+ * @internal
8
+ */
9
+ export interface GridHeaderProps {
10
+ cols: GridProps["cols"];
11
+ vertScrollable: boolean;
12
+ rowVariant?: GridProps["headerRowVariant"];
13
+ cellVariant?: GridProps["headerCellVariant"];
14
+ focusColIndex: number | null;
15
+ cellFocusVariant?: GridProps["headerCellFocusVariant"];
16
+ }
17
+ /**
18
+ * Props interface for the GridBody component
19
+ *
20
+ * @internal
21
+ */
22
+ export type GridBodyProps = {
23
+ augFormattedRows: AugFormattedRow[];
24
+ cols: GridProps["cols"];
25
+ rowVariant?: GridProps["bodyRowVariant"];
26
+ cellVariant?: GridProps["bodyCellVariant"];
27
+ focusCoords: FocusCoordinates;
28
+ cellFocusVariant?: GridProps["bodyCellFocusVariant"];
29
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,32 +1,130 @@
1
- import { AugFormattedRow, CellData, ColDef, FormattedRow, MainComponentSharedProps } from "../../common";
2
- export type GridProps = MainComponentSharedProps & {
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. The
10
+ * 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
+ */
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
+ */
31
+ export type HeaderCellVariantFn = (col: ColDef, colIndex: number) => string | null;
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
+ */
3
47
  height?: GridHeightSetting;
48
+ /**
49
+ * The width setting of the grid
50
+ */
4
51
  width?: GridWidthSetting;
52
+ /**
53
+ * The grid-wide color variant
54
+ */
5
55
  variant?: string;
56
+ /**
57
+ * The stripe setting of the grid
58
+ */
6
59
  stripes?: GridStripeSetting;
60
+ /**
61
+ * Toggles hover styles for the grid
62
+ */
7
63
  hover?: boolean;
64
+ /**
65
+ * The border setting of the grid
66
+ */
8
67
  borders?: GridBorderSetting;
68
+ /**
69
+ * The border color variant of the grid
70
+ */
9
71
  borderVariant?: string;
72
+ /**
73
+ * Toggles a denser grid style
74
+ */
10
75
  small?: boolean;
76
+ /**
77
+ * Toggles a horizontal divider between the grid header and body
78
+ */
11
79
  divider?: boolean;
80
+ /**
81
+ * Sets the color variant of the header row
82
+ */
12
83
  headerRowVariant?: string;
13
- headerCellVariant?: (col: ColDef, colIndex: number) => string | null;
84
+ /**
85
+ * Function to set the color variant of header cells. Overrides the row-wide
86
+ * setting when this function returns a non-null value.
87
+ */
88
+ headerCellVariant?: HeaderCellVariantFn;
89
+ /**
90
+ * Function to set the color variant of body rows
91
+ */
14
92
  bodyRowVariant?: (row: FormattedRow, displayIndex: number) => string | null;
15
- bodyCellVariant?: (cell: CellData, row: FormattedRow, colIndex: number, displayIndex: number) => string | null;
16
- };
17
- export interface GridHeaderProps {
18
- cols: GridProps["cols"];
19
- vertScrollable: boolean;
20
- rowVariant?: GridProps["headerRowVariant"];
21
- cellVariant?: GridProps["headerCellVariant"];
93
+ /**
94
+ * Function to set the color variant of body cells on a per-cell basis.
95
+ * Overrides the row-wide setting when this function returns a non-null value.
96
+ */
97
+ bodyCellVariant?: BodyCellVariantFn;
98
+ /**
99
+ * Function to set the color variant of header cell focus rings
100
+ */
101
+ headerCellFocusVariant?: HeaderCellVariantFn;
102
+ /**
103
+ * Function to set the color variant of body cell focus rings
104
+ */
105
+ bodyCellFocusVariant?: BodyCellVariantFn;
22
106
  }
23
- export type GridBodyProps = {
24
- augFormattedRows: AugFormattedRow[];
25
- cols: GridProps["cols"];
26
- rowVariant?: GridProps["bodyRowVariant"];
27
- cellVariant?: GridProps["bodyCellVariant"];
28
- };
107
+ /**
108
+ * The type of the prop to set grid height behavior
109
+ *
110
+ * @public
111
+ */
29
112
  export type GridHeightSetting = number | "auto" | "parent";
113
+ /**
114
+ * The type of the prop to set grid width behavior
115
+ *
116
+ * @public
117
+ */
30
118
  export type GridWidthSetting = number | "auto" | "parent";
119
+ /**
120
+ * The type of the prop to set the grid stripe style
121
+ *
122
+ * @public
123
+ */
31
124
  export type GridStripeSetting = "rows" | "columns" | "none";
125
+ /**
126
+ * The type of the prop to set the grid border style
127
+ *
128
+ * @public
129
+ */
32
130
  export type GridBorderSetting = "horizontal" | "full" | "none";
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: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-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)}
package/grid.scss CHANGED
@@ -39,25 +39,37 @@ $rbdg-prefix: "rbdg-";
39
39
  > div {
40
40
  width: min-content;
41
41
 
42
- > div > div {
43
- text-overflow: ellipsis;
44
- white-space: nowrap;
45
- overflow: hidden;
46
- padding: $table-cell-padding-y $table-cell-padding-x;
47
- color: var(
48
- --#{$rbdg-prefix}grid-color-state,
49
- var(--#{$rbdg-prefix}grid-color-type, var(--#{$rbdg-prefix}grid-color))
50
- );
51
- background-color: var(--#{$rbdg-prefix}grid-bg);
52
- border-bottom-width: $table-border-width;
53
- box-shadow: inset 0 0 0 9999px
54
- var(
42
+ > div {
43
+ > div {
44
+ text-overflow: ellipsis;
45
+ white-space: nowrap;
46
+ overflow: hidden;
47
+ padding: $table-cell-padding-y $table-cell-padding-x;
48
+ color: var(
49
+ --#{$rbdg-prefix}grid-color-state,
50
+ var(--#{$rbdg-prefix}grid-color-type, var(--#{$rbdg-prefix}grid-color))
51
+ );
52
+ background-color: var(--#{$rbdg-prefix}grid-bg);
53
+ border-bottom-width: $table-border-width;
54
+ box-shadow: inset 0 0 0 9999px var(
55
55
  --#{$rbdg-prefix}grid-bg-state,
56
56
  var(
57
57
  --#{$rbdg-prefix}grid-bg-type,
58
58
  var(--#{$rbdg-prefix}grid-accent-bg)
59
59
  )
60
60
  );
61
+ }
62
+
63
+ > div.rbdg-focusable-cell:focus {
64
+ outline: 0;
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);
72
+ }
61
73
  }
62
74
  }
63
75
 
@@ -211,7 +223,7 @@ $rbdg-prefix: "rbdg-";
211
223
  @include rbdg-grid-variant($color, $value);
212
224
  }
213
225
 
214
- // Note about Responsive Tables
226
+ // A note about Responsive Tables
215
227
  //
216
228
  // The Bootstrap _tables.scss file contains a series of classes to apply responsive tables at various breakpoints.
217
229
  // There is no such equivalent for RBDG flex grid for the following reason.
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.0.0",
4
+ "version": "4.2.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/grid"
32
+ "directory": "src/community"
33
33
  }
34
34
  }
@@ -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/types";
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, } from "../../common/util/datetime";
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 {};
@@ -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/selection/types";
4
+ import { SelectModel } from "../../common";
5
5
  import { UseGetInputStrSubmitCallbackHook } from "../../common/pipeline/useGetInputStrSubmitCallback";
6
6
  import { TableStyleModel } from "../styling/types";
7
- import { AugFormattedRow, FormattedRow, RowId } from "../../common/types";
8
- import { EditModel } from "../../common/editing/types";
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,4 +1,4 @@
1
1
  import { FC } from "react";
2
- import { ColHeaderCellProps } from "../../types";
2
+ import { ColHeaderCellProps } from "../../internalTypes";
3
3
  declare const ColHeaderCell: FC<ColHeaderCellProps>;
4
4
  export default ColHeaderCell;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, FC } from "react";
2
- import { SelectionInfo } from "../../common/selection/types";
2
+ import { SelectionInfo } from "../../common/selection/internalTypes";
3
3
  interface SelectAllHeaderCellProps {
4
4
  onClick: () => void;
5
5
  selectionInfo: SelectionInfo;
@@ -1,38 +1,155 @@
1
- import { RowId } from "../../common/types";
1
+ import { RowId } from "../../common";
2
+ /**
3
+ * Style model properties shared between the main table and the filter
4
+ * options table.
5
+ *
6
+ * @public
7
+ */
2
8
  export interface SharedTableStyleModel {
9
+ /**
10
+ * Classes for the table element.
11
+ */
3
12
  table?: string[];
13
+ /**
14
+ * Classes for the tbody element.
15
+ */
4
16
  tbody?: string[];
17
+ /**
18
+ * Classes for the thead element.
19
+ */
5
20
  thead?: string[];
21
+ /**
22
+ * Classes for the sole tr element inside the thead element.
23
+ */
6
24
  theadTr?: string[];
25
+ /**
26
+ * Classes for the th elements within the thead element.
27
+ */
7
28
  theadTh?: (colIndex: number) => string[] | null;
29
+ /**
30
+ * Classes for the caption element.
31
+ */
8
32
  caption?: string[];
9
33
  }
10
- export type TableStyleModel = SharedTableStyleModel & {
34
+ /**
35
+ * Style model properties specific to the main table.
36
+ *
37
+ * @public
38
+ */
39
+ export interface MainTableSpecificStyleModel {
40
+ /**
41
+ * Classes for tr elements within the tbody element.
42
+ */
11
43
  tbodyTr?: (rowId: RowId, displayIndex: number) => string[] | null;
44
+ /**
45
+ * Classes for td elements within the tbody element.
46
+ */
12
47
  tbodyTd?: (rowId: RowId, displayRowIndex: number, colIndex: number) => string[] | null;
48
+ /**
49
+ * Classes for input elements within the tbody element.
50
+ */
13
51
  tbodyTdInput?: (rowId: RowId, displayRowIndex: number, colIndex: number) => string[] | null;
52
+ /**
53
+ * Classes for th element in the edit column.
54
+ */
14
55
  editColTh?: string[];
56
+ /**
57
+ * Classes for the td elements in the edit column.
58
+ */
15
59
  editColTd?: (rowId: RowId, displayIndex: number) => string[] | null;
60
+ /**
61
+ * Classes for the start button in the edit column.
62
+ */
16
63
  editStartButton?: (rowId: RowId, displayIndex: number) => string[] | null;
64
+ /**
65
+ * Classes for the delete button in the edit column.
66
+ */
17
67
  editDeleteButton?: (rowId: RowId, displayIndex: number) => string[] | null;
68
+ /**
69
+ * Classes for the save button in the edit column.
70
+ */
18
71
  editSaveButton?: (rowId: RowId, displayIndex: number) => string[] | null;
72
+ /**
73
+ * Classes for the cancel button in the edit column.
74
+ */
19
75
  editCancelButton?: (rowId: RowId, displayIndex: number) => string[] | null;
76
+ /**
77
+ * Classes for the th element of the row selection column.
78
+ */
20
79
  rowSelectColTh?: string[];
80
+ /**
81
+ * Classes for the td elements of the row selection column.
82
+ */
21
83
  rowSelectColTd?: (rowId: RowId, displayIndex: number) => string[] | null;
84
+ /**
85
+ * Classes for the input elements of the row selection column.
86
+ */
22
87
  rowSelectInput?: (rowId: RowId, displayIndex: number) => string[] | null;
23
- };
24
- export type FilterInputTableStyleModel = SharedTableStyleModel & {
88
+ }
89
+ /**
90
+ * Style model for the main table.
91
+ *
92
+ * @public
93
+ */
94
+ export type TableStyleModel = SharedTableStyleModel & MainTableSpecificStyleModel;
95
+ /**
96
+ * Style model properties specific to the filter inputs table.
97
+ *
98
+ * @public
99
+ */
100
+ export interface FilterTableSpecificStyleModel {
101
+ /**
102
+ * Classes for the tr elements in the tbody element.
103
+ */
25
104
  tbodyTr?: (rowIndex: number) => string[] | null;
105
+ /**
106
+ * Classes for the td elements in the tbody element.
107
+ */
26
108
  tbodyTd?: (rowIndex: number, colIndex: number) => string[] | null;
109
+ /**
110
+ * Classes for the checkboxes that enable filtering for columns.
111
+ */
27
112
  enablementInput?: (rowIndex: number) => string[] | null;
113
+ /**
114
+ * Classes for the dropdowns for selecting filter schemes.
115
+ */
28
116
  schemeSelectionInput?: (rowIndex: number) => string[] | null;
117
+ /**
118
+ * Classes for text search string input elements.
119
+ */
29
120
  searchStringInput?: (rowIndex: number) => string[] | null;
121
+ /**
122
+ * Classes for numerical input elements.
123
+ */
30
124
  numberInput?: (rowIndex: number) => string[] | null;
125
+ /**
126
+ * Classes for the state date inputs.
127
+ */
31
128
  startDateInput?: (rowIndex: number) => string[] | null;
129
+ /**
130
+ * Classes for the end date inputs.
131
+ */
32
132
  endDateInput?: (rowIndex: number) => string[] | null;
133
+ /**
134
+ * Classes for the form submit button.
135
+ */
33
136
  submitButton?: string[];
137
+ /**
138
+ * Classes for the form element.
139
+ */
34
140
  form?: string[];
35
- };
141
+ }
142
+ /**
143
+ * Style model for the filter inputs table.
144
+ *
145
+ * @public
146
+ */
147
+ export type FilterInputTableStyleModel = SharedTableStyleModel & FilterTableSpecificStyleModel;
148
+ /**
149
+ * Style model for components that are not included in other categories.
150
+ *
151
+ * @public
152
+ */
36
153
  export interface AdditionalComponentsStyleModel {
37
154
  topLevelDiv?: string[];
38
155
  tableAndPaginationDiv?: string[];