carbon-react 119.4.0 → 119.4.2
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/esm/__spec_helper__/mock-resize-observer.js +20 -5
- package/esm/__spec_helper__/test-utils.d.ts +1 -1
- package/esm/components/flat-table/cell-sizes.style.d.ts +28 -0
- package/esm/components/flat-table/flat-table-body/flat-table-body.component.d.ts +7 -0
- package/esm/components/flat-table/flat-table-body/flat-table-body.component.js +3 -2
- package/esm/components/flat-table/flat-table-body/index.d.ts +2 -2
- package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.d.ts +9 -0
- package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.js +6 -16
- package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.d.ts +4 -0
- package/esm/components/flat-table/flat-table-body-draggable/index.d.ts +2 -2
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.component.d.ts +69 -0
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.component.js +7 -69
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.style.d.ts +10 -0
- package/esm/components/flat-table/flat-table-cell/index.d.ts +2 -2
- package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.d.ts +45 -0
- package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.js +1 -39
- package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.d.ts +6 -0
- package/esm/components/flat-table/flat-table-checkbox/index.d.ts +2 -2
- package/esm/components/flat-table/flat-table-head/flat-table-head.component.d.ts +7 -0
- package/esm/components/flat-table/flat-table-head/flat-table-head.component.js +8 -13
- package/esm/components/flat-table/flat-table-head/flat-table-head.style.d.ts +2 -0
- package/esm/components/flat-table/flat-table-head/index.d.ts +2 -2
- package/esm/components/flat-table/flat-table-header/flat-table-header-utils.d.ts +3 -0
- package/esm/components/flat-table/flat-table-header/flat-table-header.component.d.ts +55 -0
- package/esm/components/flat-table/flat-table-header/flat-table-header.component.js +7 -49
- package/esm/components/flat-table/flat-table-header/flat-table-header.style.d.ts +10 -0
- package/esm/components/flat-table/flat-table-header/index.d.ts +2 -2
- package/esm/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.component.d.ts +18 -0
- package/esm/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.component.js +13 -19
- package/esm/components/flat-table/flat-table-row/flat-table-row.component.d.ts +56 -0
- package/esm/components/flat-table/flat-table-row/flat-table-row.component.js +43 -67
- package/esm/components/flat-table/flat-table-row/flat-table-row.style.d.ts +18 -0
- package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +2 -3
- package/esm/components/flat-table/flat-table-row/index.d.ts +2 -2
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.component.d.ts +71 -0
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.component.js +9 -51
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.style.d.ts +6 -0
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +7 -7
- package/esm/components/flat-table/flat-table-row-header/index.d.ts +2 -2
- package/esm/components/flat-table/flat-table.component.d.ts +42 -0
- package/esm/components/flat-table/flat-table.component.js +51 -92
- package/esm/components/flat-table/flat-table.config.d.ts +2 -0
- package/esm/components/flat-table/flat-table.style.d.ts +15 -0
- package/esm/components/flat-table/flat-table.style.js +36 -59
- package/esm/components/flat-table/index.d.ts +22 -13
- package/esm/components/flat-table/sort/index.d.ts +2 -2
- package/esm/components/flat-table/sort/sort.component.d.ts +11 -0
- package/esm/components/flat-table/sort/sort.component.js +1 -10
- package/esm/components/flat-table/sort/sort.style.d.ts +4 -0
- package/esm/components/global-header/global-header.component.js +6 -29
- package/esm/components/menu/__internal__/submenu/submenu.component.js +6 -1
- package/esm/components/menu/__internal__/submenu/submenu.style.d.ts +1 -0
- package/esm/components/menu/__internal__/submenu/submenu.style.js +4 -1
- package/esm/components/navigation-bar/fixed-navigation-bar.context.d.ts +11 -0
- package/esm/components/navigation-bar/fixed-navigation-bar.context.js +31 -0
- package/esm/components/navigation-bar/navigation-bar.component.d.ts +3 -1
- package/esm/components/navigation-bar/navigation-bar.component.js +20 -8
- package/esm/components/navigation-bar/navigation-bar.style.d.ts +4 -0
- package/esm/components/navigation-bar/navigation-bar.style.js +3 -2
- package/lib/__spec_helper__/mock-resize-observer.js +20 -5
- package/lib/__spec_helper__/test-utils.d.ts +1 -1
- package/lib/components/flat-table/cell-sizes.style.d.ts +28 -0
- package/lib/components/flat-table/flat-table-body/flat-table-body.component.d.ts +7 -0
- package/lib/components/flat-table/flat-table-body/flat-table-body.component.js +4 -3
- package/lib/components/flat-table/flat-table-body/index.d.ts +2 -2
- package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.d.ts +9 -0
- package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.component.js +7 -16
- package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.d.ts +4 -0
- package/lib/components/flat-table/flat-table-body-draggable/index.d.ts +2 -2
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.component.d.ts +69 -0
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.component.js +8 -69
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.style.d.ts +10 -0
- package/lib/components/flat-table/flat-table-cell/index.d.ts +2 -2
- package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.d.ts +45 -0
- package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.component.js +2 -39
- package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.d.ts +6 -0
- package/lib/components/flat-table/flat-table-checkbox/index.d.ts +2 -2
- package/lib/components/flat-table/flat-table-head/flat-table-head.component.d.ts +7 -0
- package/lib/components/flat-table/flat-table-head/flat-table-head.component.js +8 -12
- package/lib/components/flat-table/flat-table-head/flat-table-head.style.d.ts +2 -0
- package/lib/components/flat-table/flat-table-head/index.d.ts +2 -2
- package/lib/components/flat-table/flat-table-header/flat-table-header-utils.d.ts +3 -0
- package/lib/components/flat-table/flat-table-header/flat-table-header.component.d.ts +55 -0
- package/lib/components/flat-table/flat-table-header/flat-table-header.component.js +8 -49
- package/lib/components/flat-table/flat-table-header/flat-table-header.style.d.ts +10 -0
- package/lib/components/flat-table/flat-table-header/index.d.ts +2 -2
- package/lib/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.component.d.ts +18 -0
- package/lib/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.component.js +14 -20
- package/lib/components/flat-table/flat-table-row/flat-table-row.component.d.ts +56 -0
- package/lib/components/flat-table/flat-table-row/flat-table-row.component.js +44 -68
- package/lib/components/flat-table/flat-table-row/flat-table-row.style.d.ts +18 -0
- package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +2 -3
- package/lib/components/flat-table/flat-table-row/index.d.ts +2 -2
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.component.d.ts +71 -0
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.component.js +10 -51
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.style.d.ts +6 -0
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +7 -7
- package/lib/components/flat-table/flat-table-row-header/index.d.ts +2 -2
- package/lib/components/flat-table/flat-table.component.d.ts +42 -0
- package/lib/components/flat-table/flat-table.component.js +51 -91
- package/lib/components/flat-table/flat-table.config.d.ts +2 -0
- package/lib/components/flat-table/flat-table.style.d.ts +15 -0
- package/lib/components/flat-table/flat-table.style.js +36 -59
- package/lib/components/flat-table/index.d.ts +22 -13
- package/lib/components/flat-table/sort/index.d.ts +2 -2
- package/lib/components/flat-table/sort/sort.component.d.ts +11 -0
- package/lib/components/flat-table/sort/sort.component.js +1 -10
- package/lib/components/flat-table/sort/sort.style.d.ts +4 -0
- package/lib/components/global-header/global-header.component.js +6 -31
- package/lib/components/menu/__internal__/submenu/submenu.component.js +6 -1
- package/lib/components/menu/__internal__/submenu/submenu.style.d.ts +1 -0
- package/lib/components/menu/__internal__/submenu/submenu.style.js +4 -1
- package/lib/components/navigation-bar/fixed-navigation-bar.context.d.ts +11 -0
- package/lib/components/navigation-bar/fixed-navigation-bar.context.js +42 -0
- package/lib/components/navigation-bar/navigation-bar.component.d.ts +3 -1
- package/lib/components/navigation-bar/navigation-bar.component.js +22 -8
- package/lib/components/navigation-bar/navigation-bar.style.d.ts +4 -0
- package/lib/components/navigation-bar/navigation-bar.style.js +3 -2
- package/package.json +1 -1
- package/esm/components/flat-table/flat-table-body/flat-table-body.d.ts +0 -10
- package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.d.ts +0 -14
- package/esm/components/flat-table/flat-table-cell/flat-table-cell.d.ts +0 -28
- package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.d.ts +0 -20
- package/esm/components/flat-table/flat-table-head/flat-table-head.d.ts +0 -10
- package/esm/components/flat-table/flat-table-header/flat-table-header.d.ts +0 -27
- package/esm/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.d.ts +0 -20
- package/esm/components/flat-table/flat-table-row/flat-table-row.d.ts +0 -31
- package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.d.ts +0 -28
- package/esm/components/flat-table/flat-table.d.ts +0 -37
- package/esm/components/flat-table/sort/sort.d.ts +0 -14
- package/lib/components/flat-table/flat-table-body/flat-table-body.d.ts +0 -10
- package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.d.ts +0 -14
- package/lib/components/flat-table/flat-table-cell/flat-table-cell.d.ts +0 -28
- package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.d.ts +0 -20
- package/lib/components/flat-table/flat-table-head/flat-table-head.d.ts +0 -10
- package/lib/components/flat-table/flat-table-header/flat-table-header.d.ts +0 -27
- package/lib/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.d.ts +0 -20
- package/lib/components/flat-table/flat-table-row/flat-table-row.d.ts +0 -31
- package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.d.ts +0 -28
- package/lib/components/flat-table/flat-table.d.ts +0 -37
- package/lib/components/flat-table/sort/sort.d.ts +0 -14
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
import React, { useLayoutEffect, useRef, useContext } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import styledSystemPropTypes from "@styled-system/prop-types";
|
|
5
4
|
import StyledFlatTableHeader from "./flat-table-header.style";
|
|
6
|
-
import { filterStyledSystemPaddingProps } from "../../../style/utils";
|
|
7
5
|
import { FlatTableThemeContext } from "../flat-table.component";
|
|
8
|
-
const
|
|
9
|
-
const FlatTableHeader = _ref => {
|
|
6
|
+
export const FlatTableHeader = _ref => {
|
|
10
7
|
let {
|
|
11
8
|
align,
|
|
12
9
|
children,
|
|
@@ -38,56 +35,17 @@ const FlatTableHeader = _ref => {
|
|
|
38
35
|
className: reportCellWidth ? "isSticky" : undefined,
|
|
39
36
|
align: align,
|
|
40
37
|
colorTheme: colorTheme,
|
|
41
|
-
"data-element": "flat-table-header"
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
"data-element": "flat-table-header"
|
|
39
|
+
}, colspan !== undefined && {
|
|
40
|
+
colSpan: Number(colspan)
|
|
41
|
+
}, rowspan !== undefined && {
|
|
42
|
+
rowSpan: Number(rowspan)
|
|
43
|
+
}, {
|
|
44
44
|
colWidth: width,
|
|
45
45
|
py: py,
|
|
46
46
|
px: px
|
|
47
47
|
}, rest), /*#__PURE__*/React.createElement("div", null, children));
|
|
48
48
|
};
|
|
49
|
-
FlatTableHeader.propTypes = {
|
|
50
|
-
/** Styled system padding props */
|
|
51
|
-
...paddingPropTypes,
|
|
52
|
-
/** Content alignment */
|
|
53
|
-
align: PropTypes.oneOf(["center", "left", "right"]),
|
|
54
|
-
/** Header content */
|
|
55
|
-
children: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
56
|
-
/** Number of columns that a header cell should span */
|
|
57
|
-
colspan: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
58
|
-
/** Number of rows that a header cell should span */
|
|
59
|
-
rowspan: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
60
|
-
/** Column width, pass a number to set a fixed width in pixels */
|
|
61
|
-
width: PropTypes.number,
|
|
62
|
-
/**
|
|
63
|
-
* @private
|
|
64
|
-
* @ignore
|
|
65
|
-
* Sets the left position when sticky column found
|
|
66
|
-
*/
|
|
67
|
-
leftPosition: PropTypes.number,
|
|
68
|
-
/**
|
|
69
|
-
* @private
|
|
70
|
-
* @ignore
|
|
71
|
-
* Sets the right position when sticky column found
|
|
72
|
-
*/
|
|
73
|
-
rightPosition: PropTypes.number,
|
|
74
|
-
/**
|
|
75
|
-
* @private
|
|
76
|
-
* @ignore
|
|
77
|
-
* Index of cell within row
|
|
78
|
-
*/
|
|
79
|
-
cellIndex: PropTypes.number,
|
|
80
|
-
/**
|
|
81
|
-
* @private
|
|
82
|
-
* @ignore
|
|
83
|
-
* Callback to report the offsetWidth
|
|
84
|
-
*/
|
|
85
|
-
reportCellWidth: PropTypes.func,
|
|
86
|
-
/** If true sets alternative background color */
|
|
87
|
-
alternativeBgColor: PropTypes.bool,
|
|
88
|
-
/** Sets a custom vertical right border */
|
|
89
|
-
verticalBorder: PropTypes.oneOf(["small", "medium", "large"])
|
|
90
|
-
};
|
|
91
49
|
FlatTableHeader.defaultProps = {
|
|
92
50
|
align: "left"
|
|
93
51
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PaddingProps } from "styled-system";
|
|
2
|
+
import { FlatTableHeaderProps } from "./flat-table-header.component";
|
|
3
|
+
import { FlatTableProps } from "..";
|
|
4
|
+
interface StyledFlatTableHeaderProps extends Pick<FlatTableHeaderProps, "align" | "leftPosition" | "rightPosition" | "verticalBorder" | "verticalBorderColor" | "alternativeBgColor">, PaddingProps {
|
|
5
|
+
makeCellSticky: boolean;
|
|
6
|
+
colWidth?: number;
|
|
7
|
+
colorTheme: FlatTableProps["colorTheme"];
|
|
8
|
+
}
|
|
9
|
+
declare const StyledFlatTableHeader: import("styled-components").StyledComponent<"th", any, StyledFlatTableHeaderProps, never>;
|
|
10
|
+
export default StyledFlatTableHeader;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from "./flat-table-header";
|
|
2
|
-
export
|
|
1
|
+
export { default } from "./flat-table-header.component";
|
|
2
|
+
export type { FlatTableHeaderProps } from "./flat-table-header.component";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface FlatTableRowDraggableProps {
|
|
3
|
+
/** Array of FlatTableRow. */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** ID for use in drag and drop functionality */
|
|
6
|
+
id?: number | string;
|
|
7
|
+
/** function to find an item in the list of draggable items */
|
|
8
|
+
findItem?: (id?: number | string) => Record<string, unknown>;
|
|
9
|
+
/** function to reposition an item in the list of draggable items */
|
|
10
|
+
moveItem?: (id?: number | string, index?: number) => void;
|
|
11
|
+
/** item is draggable */
|
|
12
|
+
draggable?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare const FlatTableRowDraggable: {
|
|
15
|
+
({ children, id, findItem, moveItem, }: FlatTableRowDraggableProps): React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
export default FlatTableRowDraggable;
|
package/esm/components/flat-table/flat-table-row/__internal__/flat-table-row-draggable.component.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { useDrop, useDrag } from "react-dnd";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
3
|
+
import { useDrop, useDrag } from "react-dnd";
|
|
4
4
|
const FlatTableRowDraggable = _ref => {
|
|
5
5
|
let {
|
|
6
6
|
children,
|
|
@@ -8,7 +8,7 @@ const FlatTableRowDraggable = _ref => {
|
|
|
8
8
|
findItem,
|
|
9
9
|
moveItem
|
|
10
10
|
} = _ref;
|
|
11
|
-
const originalIndex = findItem(id).index;
|
|
11
|
+
const originalIndex = Number(findItem?.(id).index);
|
|
12
12
|
const [{
|
|
13
13
|
isDragging
|
|
14
14
|
}, drag] = useDrag({
|
|
@@ -27,22 +27,19 @@ const FlatTableRowDraggable = _ref => {
|
|
|
27
27
|
} = monitor.getItem();
|
|
28
28
|
const didDrop = monitor.didDrop();
|
|
29
29
|
if (!didDrop) {
|
|
30
|
-
moveItem(droppedId, oIndex);
|
|
30
|
+
moveItem?.(droppedId, Number(oIndex));
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
const [, drop] = useDrop({
|
|
35
35
|
accept: "flatTableRow",
|
|
36
36
|
canDrop: () => false,
|
|
37
|
-
hover(
|
|
38
|
-
|
|
39
|
-
id: draggedId
|
|
40
|
-
} = _ref2;
|
|
41
|
-
if (draggedId !== id) {
|
|
37
|
+
hover(item) {
|
|
38
|
+
if (item?.id !== id && findItem) {
|
|
42
39
|
const {
|
|
43
40
|
index: overIndex
|
|
44
41
|
} = findItem(id);
|
|
45
|
-
moveItem(
|
|
42
|
+
moveItem?.(item?.id, Number(overIndex));
|
|
46
43
|
}
|
|
47
44
|
}
|
|
48
45
|
});
|
|
@@ -54,15 +51,12 @@ const FlatTableRowDraggable = _ref => {
|
|
|
54
51
|
});
|
|
55
52
|
};
|
|
56
53
|
FlatTableRowDraggable.propTypes = {
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
61
|
-
|
|
62
|
-
findItem: PropTypes.func.isRequired,
|
|
63
|
-
/** function to reposition an item in the list of draggable items */
|
|
64
|
-
moveItem: PropTypes.func.isRequired,
|
|
65
|
-
/** item is draggable */
|
|
66
|
-
draggable: PropTypes.bool
|
|
54
|
+
"children": PropTypes.node,
|
|
55
|
+
"draggable": PropTypes.bool,
|
|
56
|
+
"findItem": PropTypes.func,
|
|
57
|
+
"id": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
58
|
+
"moveItem": PropTypes.func
|
|
67
59
|
};
|
|
60
|
+
export { FlatTableRowDraggable };
|
|
61
|
+
FlatTableRowDraggable.displayName = "FlatTableRowDraggable";
|
|
68
62
|
export default FlatTableRowDraggable;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TableBorderSize } from "..";
|
|
3
|
+
import { FlatTableRowDraggableProps } from "./__internal__/flat-table-row-draggable.component";
|
|
4
|
+
export interface FlatTableRowProps {
|
|
5
|
+
/** Overrides default cell color, provide design token, any color from palette or any valid css color value. */
|
|
6
|
+
bgColor?: string;
|
|
7
|
+
/** Array of FlatTableHeader or FlatTableCell. FlatTableRowHeader could also be passed. */
|
|
8
|
+
children: React.ReactNode;
|
|
9
|
+
/** Allows the row to be expanded, must be used with the `subRows` prop. */
|
|
10
|
+
expandable?: boolean;
|
|
11
|
+
/** Sets an expandable row to be expanded on start */
|
|
12
|
+
expanded?: boolean;
|
|
13
|
+
/** Area to click to open sub rows when expandable. Default is `wholeRow` */
|
|
14
|
+
expandableArea?: "wholeRow" | "firstColumn";
|
|
15
|
+
/** Allows developers to manually control highlighted state for the row. */
|
|
16
|
+
highlighted?: boolean;
|
|
17
|
+
/** Sets the color of the bottom border in the row */
|
|
18
|
+
horizontalBorderColor?: string;
|
|
19
|
+
/** Sets the weight of the bottom border in the row */
|
|
20
|
+
horizontalBorderSize?: TableBorderSize;
|
|
21
|
+
/** Function to handle click event. If provided the Component could be focused with tab key. */
|
|
22
|
+
onClick?: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
23
|
+
/** Allows developers to manually control selected state for the row. */
|
|
24
|
+
selected?: boolean;
|
|
25
|
+
/** Sub rows to be shown when the row is expanded, must be used with the `expandable` prop. */
|
|
26
|
+
subRows?: React.ReactNode;
|
|
27
|
+
/** @ignore @private */
|
|
28
|
+
isSubRow?: boolean;
|
|
29
|
+
/** @ignore @private */
|
|
30
|
+
isFirstSubRow?: boolean;
|
|
31
|
+
/** @ignore @private position in header if multiple rows */
|
|
32
|
+
stickyOffset?: number;
|
|
33
|
+
/** @ignore @private applies a border-left to the first child */
|
|
34
|
+
applyBorderLeft?: boolean;
|
|
35
|
+
/** ID for use in drag and drop functionality
|
|
36
|
+
* @private
|
|
37
|
+
* @ignore
|
|
38
|
+
*/
|
|
39
|
+
id?: string | number;
|
|
40
|
+
/**
|
|
41
|
+
* @private
|
|
42
|
+
* @ignore
|
|
43
|
+
*/
|
|
44
|
+
findItem?: FlatTableRowDraggableProps["findItem"];
|
|
45
|
+
/**
|
|
46
|
+
* @private
|
|
47
|
+
* @ignore
|
|
48
|
+
*/
|
|
49
|
+
moveItem?: FlatTableRowDraggableProps["moveItem"];
|
|
50
|
+
/** @ignore @private position in header if multiple rows */
|
|
51
|
+
draggable?: boolean;
|
|
52
|
+
/** @ignore @private */
|
|
53
|
+
ref?: React.RefObject<HTMLTableRowElement>;
|
|
54
|
+
}
|
|
55
|
+
export declare const FlatTableRow: React.ForwardRefExoticComponent<Pick<FlatTableRowProps, "draggable" | "id" | "children" | "onClick" | "selected" | "bgColor" | "expanded" | "findItem" | "moveItem" | "highlighted" | "expandable" | "horizontalBorderColor" | "stickyOffset" | "isSubRow" | "isFirstSubRow" | "applyBorderLeft" | "horizontalBorderSize" | "expandableArea" | "subRows"> & React.RefAttributes<HTMLTableRowElement>>;
|
|
56
|
+
export default FlatTableRow;
|
|
@@ -35,16 +35,18 @@ const FlatTableRow = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
35
35
|
} = _ref;
|
|
36
36
|
const internalId = useRef(id ?? guid());
|
|
37
37
|
const [isExpanded, setIsExpanded] = useState(expanded);
|
|
38
|
-
let rowRef = useRef();
|
|
39
|
-
if (ref)
|
|
38
|
+
let rowRef = useRef(null);
|
|
39
|
+
if (ref) {
|
|
40
|
+
rowRef = ref;
|
|
41
|
+
}
|
|
40
42
|
const firstColumnExpandable = expandableArea === "firstColumn";
|
|
41
43
|
const [leftStickyCellWidths, setLeftStickyCellWidths] = useState([]);
|
|
42
44
|
const [rightStickyCellWidths, setRightStickyCellWidths] = useState([]);
|
|
43
45
|
const [leftPositions, setLeftPositions] = useState([]);
|
|
44
46
|
const [rightPositions, setRightPositions] = useState([]);
|
|
45
47
|
const childrenArray = useMemo(() => React.Children.toArray(children), [children]);
|
|
46
|
-
const lhsRowHeaderIndex = useMemo(() => childrenArray.findIndex(child => child.type.displayName === FlatTableRowHeader.displayName && child.props.stickyAlignment !== "right"), [childrenArray]);
|
|
47
|
-
const rhsRowHeaderIndex = useMemo(() => childrenArray.findIndex(child => child.type.displayName === FlatTableRowHeader.displayName && child.props.stickyAlignment === "right"), [childrenArray]);
|
|
48
|
+
const lhsRowHeaderIndex = useMemo(() => childrenArray.findIndex(child => /*#__PURE__*/React.isValidElement(child) && child.type.displayName === FlatTableRowHeader.displayName && child.props.stickyAlignment !== "right"), [childrenArray]);
|
|
49
|
+
const rhsRowHeaderIndex = useMemo(() => childrenArray.findIndex(child => /*#__PURE__*/React.isValidElement(child) && child.type.displayName === FlatTableRowHeader.displayName && child.props.stickyAlignment === "right"), [childrenArray]);
|
|
48
50
|
const [tabIndex, setTabIndex] = useState(-1);
|
|
49
51
|
const noStickyColumnsOverlap = useMemo(() => {
|
|
50
52
|
const hasLhsColumn = lhsRowHeaderIndex !== -1;
|
|
@@ -59,6 +61,9 @@ const FlatTableRow = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
59
61
|
setSelectedId,
|
|
60
62
|
selectedId
|
|
61
63
|
} = useContext(FlatTableThemeContext);
|
|
64
|
+
const {
|
|
65
|
+
isInSidebar
|
|
66
|
+
} = useContext(DrawerSidebarContext);
|
|
62
67
|
const reportCellWidth = useCallback((width, index) => {
|
|
63
68
|
const isLeftSticky = index < lhsRowHeaderIndex;
|
|
64
69
|
const copiedArray = isLeftSticky ? leftStickyCellWidths : rightStickyCellWidths;
|
|
@@ -74,7 +79,7 @@ const FlatTableRow = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
74
79
|
}
|
|
75
80
|
}, [lhsRowHeaderIndex, leftStickyCellWidths, rightStickyCellWidths]);
|
|
76
81
|
let interactiveRowProps = {};
|
|
77
|
-
const firstCellIndex = childrenArray[0].type === FlatTableCheckbox ? 1 : 0;
|
|
82
|
+
const firstCellIndex = /*#__PURE__*/React.isValidElement(childrenArray[0]) && childrenArray[0].type === FlatTableCheckbox ? 1 : 0;
|
|
78
83
|
const toggleExpanded = () => setIsExpanded(!isExpanded);
|
|
79
84
|
function onKeyDown(ev) {
|
|
80
85
|
const isEnterOrSpaceKey = Event.isEnterKey(ev) || Event.isSpaceKey(ev);
|
|
@@ -130,13 +135,13 @@ const FlatTableRow = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
130
135
|
}, [expanded]);
|
|
131
136
|
useEffect(() => {
|
|
132
137
|
if (highlighted || selected) {
|
|
133
|
-
setSelectedId(internalId.current);
|
|
138
|
+
setSelectedId(String(internalId.current));
|
|
134
139
|
}
|
|
135
140
|
}, [highlighted, selected, setSelectedId]);
|
|
136
141
|
useEffect(() => {
|
|
137
142
|
setTabIndex(selectedId === internalId.current ? 0 : -1);
|
|
138
143
|
}, [selectedId]);
|
|
139
|
-
const rowComponent =
|
|
144
|
+
const rowComponent = () => /*#__PURE__*/React.createElement(StyledFlatTableRow, _extends({
|
|
140
145
|
isInSidebar: isInSidebar,
|
|
141
146
|
expandable: expandable,
|
|
142
147
|
isSubRow: isSubRow,
|
|
@@ -158,9 +163,9 @@ const FlatTableRow = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
158
163
|
applyBorderLeft: applyBorderLeft,
|
|
159
164
|
draggable: draggable,
|
|
160
165
|
totalChildren: childrenArray.length,
|
|
161
|
-
id: internalId.current
|
|
166
|
+
id: String(internalId.current)
|
|
162
167
|
}, interactiveRowProps, rest), React.Children.map(children, (child, index) => {
|
|
163
|
-
return child && /*#__PURE__*/React.cloneElement(child, {
|
|
168
|
+
return /*#__PURE__*/React.isValidElement(child) && /*#__PURE__*/React.cloneElement(child, {
|
|
164
169
|
expandable: expandable && index === firstCellIndex,
|
|
165
170
|
onClick: expandable && index === firstCellIndex && firstColumnExpandable ? () => toggleExpanded() : undefined,
|
|
166
171
|
onKeyDown: expandable && index === firstCellIndex && firstColumnExpandable ? handleCellKeyDown : undefined,
|
|
@@ -171,69 +176,40 @@ const FlatTableRow = /*#__PURE__*/React.forwardRef((_ref, ref) => {
|
|
|
171
176
|
...child.props
|
|
172
177
|
});
|
|
173
178
|
}));
|
|
174
|
-
const draggableComponent =
|
|
179
|
+
const draggableComponent = () => /*#__PURE__*/React.createElement(FlatTableRowDraggable, {
|
|
175
180
|
id: internalId.current,
|
|
176
181
|
moveItem: moveItem,
|
|
177
182
|
findItem: findItem
|
|
178
|
-
}, rowComponent(
|
|
179
|
-
return /*#__PURE__*/React.createElement(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, draggable ? draggableComponent(isInSidebar) : rowComponent(isInSidebar), isExpanded && subRows && React.Children.map(subRows, (child, index) => child && /*#__PURE__*/React.cloneElement(child, {
|
|
184
|
-
isSubRow: true,
|
|
185
|
-
isFirstSubRow: index === 0,
|
|
183
|
+
}, rowComponent());
|
|
184
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, draggable ? draggableComponent() : rowComponent(), isExpanded && subRows && React.Children.map(subRows, (child, index) => child && /*#__PURE__*/React.cloneElement(child, {
|
|
185
|
+
isSubRow: true,
|
|
186
|
+
isFirstSubRow: index === 0,
|
|
187
|
+
...( /*#__PURE__*/React.isValidElement(child) && {
|
|
186
188
|
...child.props
|
|
187
|
-
})
|
|
188
|
-
});
|
|
189
|
+
})
|
|
190
|
+
})));
|
|
189
191
|
});
|
|
190
192
|
FlatTableRow.propTypes = {
|
|
191
|
-
|
|
192
|
-
bgColor: PropTypes.string,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
horizontalBorderColor: PropTypes.string,
|
|
211
|
-
/** Sets the weight of the bottom border in the row */
|
|
212
|
-
horizontalBorderSize: PropTypes.oneOf(["small", "medium", "large"]),
|
|
213
|
-
/** @ignore @private */
|
|
214
|
-
isSubRow: PropTypes.bool,
|
|
215
|
-
/** @ignore @private */
|
|
216
|
-
isFirstSubRow: PropTypes.bool,
|
|
217
|
-
/** @ignore @private position in header if multiple rows */
|
|
218
|
-
stickyOffset: PropTypes.number,
|
|
219
|
-
/** @ignore @private applies a border-left to the first child */
|
|
220
|
-
applyBorderLeft: PropTypes.bool,
|
|
221
|
-
/** ID for use in drag and drop functionality
|
|
222
|
-
* @private
|
|
223
|
-
* @ignore
|
|
224
|
-
*/
|
|
225
|
-
id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
226
|
-
/**
|
|
227
|
-
* @private
|
|
228
|
-
* @ignore
|
|
229
|
-
*/
|
|
230
|
-
findItem: PropTypes.func,
|
|
231
|
-
/**
|
|
232
|
-
* @private
|
|
233
|
-
* @ignore
|
|
234
|
-
*/
|
|
235
|
-
moveItem: PropTypes.func,
|
|
236
|
-
/** @ignore @private position in header if multiple rows */
|
|
237
|
-
draggable: PropTypes.bool
|
|
193
|
+
"applyBorderLeft": PropTypes.bool,
|
|
194
|
+
"bgColor": PropTypes.string,
|
|
195
|
+
"children": PropTypes.node,
|
|
196
|
+
"draggable": PropTypes.bool,
|
|
197
|
+
"expandable": PropTypes.bool,
|
|
198
|
+
"expandableArea": PropTypes.oneOf(["firstColumn", "wholeRow"]),
|
|
199
|
+
"expanded": PropTypes.bool,
|
|
200
|
+
"findItem": PropTypes.func,
|
|
201
|
+
"highlighted": PropTypes.bool,
|
|
202
|
+
"horizontalBorderColor": PropTypes.string,
|
|
203
|
+
"horizontalBorderSize": PropTypes.oneOf(["large", "medium", "small"]),
|
|
204
|
+
"id": PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
205
|
+
"isFirstSubRow": PropTypes.bool,
|
|
206
|
+
"isSubRow": PropTypes.bool,
|
|
207
|
+
"moveItem": PropTypes.func,
|
|
208
|
+
"onClick": PropTypes.func,
|
|
209
|
+
"selected": PropTypes.bool,
|
|
210
|
+
"stickyOffset": PropTypes.number,
|
|
211
|
+
"subRows": PropTypes.node
|
|
238
212
|
};
|
|
213
|
+
export { FlatTableRow };
|
|
214
|
+
FlatTableRow.displayName = "FlatTableRow";
|
|
239
215
|
export default FlatTableRow;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { FlatTableProps } from "..";
|
|
2
|
+
import { FlatTableRowProps } from "./flat-table-row.component";
|
|
3
|
+
interface StyledFlatTableRowProps extends Pick<FlatTableRowProps, "bgColor" | "horizontalBorderColor" | "stickyOffset" | "expandable" | "selected" | "highlighted" | "isSubRow" | "isFirstSubRow" | "applyBorderLeft" | "draggable"> {
|
|
4
|
+
isRowInteractive?: boolean;
|
|
5
|
+
isFirstColumnInteractive?: boolean;
|
|
6
|
+
lhsRowHeaderIndex: number;
|
|
7
|
+
rhsRowHeaderIndex: number;
|
|
8
|
+
totalChildren: number;
|
|
9
|
+
firstCellIndex: number;
|
|
10
|
+
colorTheme: FlatTableProps["colorTheme"];
|
|
11
|
+
isExpanded?: boolean;
|
|
12
|
+
isInSidebar?: boolean;
|
|
13
|
+
size: FlatTableProps["size"];
|
|
14
|
+
isDragging?: boolean;
|
|
15
|
+
horizontalBorderSize: NonNullable<FlatTableRowProps["horizontalBorderSize"]>;
|
|
16
|
+
}
|
|
17
|
+
declare const StyledFlatTableRow: import("styled-components").StyledComponent<"tr", any, StyledFlatTableRowProps, never>;
|
|
18
|
+
export default StyledFlatTableRow;
|
|
@@ -161,7 +161,7 @@ const StyledFlatTableRow = styled.tr`
|
|
|
161
161
|
`}
|
|
162
162
|
}
|
|
163
163
|
|
|
164
|
-
${stickyOffset > 0 && css`
|
|
164
|
+
${stickyOffset !== undefined && stickyOffset > 0 && css`
|
|
165
165
|
&& th {
|
|
166
166
|
top: ${stickyOffset}px;
|
|
167
167
|
}
|
|
@@ -379,7 +379,6 @@ const StyledFlatTableRow = styled.tr`
|
|
|
379
379
|
}}
|
|
380
380
|
`;
|
|
381
381
|
StyledFlatTableRow.defaultProps = {
|
|
382
|
-
theme: baseTheme
|
|
383
|
-
horizontalBorderSize: "small"
|
|
382
|
+
theme: baseTheme
|
|
384
383
|
};
|
|
385
384
|
export default StyledFlatTableRow;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from "./flat-table-row";
|
|
2
|
-
export
|
|
1
|
+
export { default } from "./flat-table-row.component";
|
|
2
|
+
export type { FlatTableRowProps } from "./flat-table-row.component";
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { PaddingProps } from "styled-system";
|
|
3
|
+
import { TableBorderSize, TableCellAlign } from "..";
|
|
4
|
+
export interface FlatTableRowHeaderProps extends PaddingProps {
|
|
5
|
+
/** Content alignment */
|
|
6
|
+
align?: TableCellAlign;
|
|
7
|
+
/** RowHeader content */
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
/** Column width, pass a number to set a fixed width in pixels */
|
|
10
|
+
width?: number;
|
|
11
|
+
/** Truncate cell content and add ellipsis to any text that overflows */
|
|
12
|
+
truncate?: boolean;
|
|
13
|
+
/** Title text to display if cell content truncates */
|
|
14
|
+
title?: string;
|
|
15
|
+
/** Sets a custom vertical right border */
|
|
16
|
+
verticalBorder?: TableBorderSize;
|
|
17
|
+
/** Sets the color of the right border */
|
|
18
|
+
verticalBorderColor?: string;
|
|
19
|
+
/** Defines whether the column should be sticky on the left or right hand side of the Table */
|
|
20
|
+
stickyAlignment?: "left" | "right";
|
|
21
|
+
/** Number of columns that a header cell should span */
|
|
22
|
+
colspan?: number | string;
|
|
23
|
+
/** Number of rows that a header cell should span */
|
|
24
|
+
rowspan?: number | string;
|
|
25
|
+
/** Sets an id string on the DOM element */
|
|
26
|
+
id?: string;
|
|
27
|
+
/**
|
|
28
|
+
* @private
|
|
29
|
+
* @ignore
|
|
30
|
+
*/
|
|
31
|
+
expandable?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @private
|
|
34
|
+
* @ignore
|
|
35
|
+
*/
|
|
36
|
+
onClick?: (ev: React.MouseEvent<HTMLElement>) => void;
|
|
37
|
+
/**
|
|
38
|
+
* @private
|
|
39
|
+
* @ignore
|
|
40
|
+
*/
|
|
41
|
+
onKeyDown?: (ev: React.KeyboardEvent<HTMLElement>) => void;
|
|
42
|
+
/**
|
|
43
|
+
* @private
|
|
44
|
+
* @ignore
|
|
45
|
+
* Sets the left position when sticky column found
|
|
46
|
+
*/
|
|
47
|
+
leftPosition?: number;
|
|
48
|
+
/**
|
|
49
|
+
* @private
|
|
50
|
+
* @ignore
|
|
51
|
+
* Sets the right position when sticky column found
|
|
52
|
+
*/
|
|
53
|
+
rightPosition?: number;
|
|
54
|
+
/**
|
|
55
|
+
* @private
|
|
56
|
+
* @ignore
|
|
57
|
+
* Index of cell within row
|
|
58
|
+
*/
|
|
59
|
+
cellIndex?: number;
|
|
60
|
+
/**
|
|
61
|
+
* @private
|
|
62
|
+
* @ignore
|
|
63
|
+
* Callback to report the offsetWidth
|
|
64
|
+
*/
|
|
65
|
+
reportCellWidth?: (offset: number, index?: number) => void;
|
|
66
|
+
}
|
|
67
|
+
export declare const FlatTableRowHeader: {
|
|
68
|
+
({ align, children, width, py, px, expandable, onClick, onKeyDown, leftPosition, rightPosition, truncate, title, stickyAlignment, colspan, rowspan, ...rest }: FlatTableRowHeaderProps): React.JSX.Element;
|
|
69
|
+
displayName: string;
|
|
70
|
+
};
|
|
71
|
+
export default FlatTableRowHeader;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
import React, { useCallback, useEffect, useContext, useState, useRef } from "react";
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
|
-
import styledSystemPropTypes from "@styled-system/prop-types";
|
|
5
|
-
import { filterStyledSystemPaddingProps } from "../../../style/utils";
|
|
6
4
|
import Icon from "../../icon";
|
|
7
5
|
import { StyledFlatTableRowHeader, StyledFlatTableRowHeaderContent } from "./flat-table-row-header.style";
|
|
8
6
|
import { FlatTableThemeContext } from "../flat-table.component";
|
|
9
7
|
import guid from "../../../__internal__/utils/helpers/guid";
|
|
10
|
-
const
|
|
11
|
-
const FlatTableRowHeader = _ref => {
|
|
8
|
+
export const FlatTableRowHeader = _ref => {
|
|
12
9
|
let {
|
|
13
10
|
align = "left",
|
|
14
11
|
children,
|
|
@@ -23,6 +20,8 @@ const FlatTableRowHeader = _ref => {
|
|
|
23
20
|
truncate,
|
|
24
21
|
title,
|
|
25
22
|
stickyAlignment = "left",
|
|
23
|
+
colspan,
|
|
24
|
+
rowspan,
|
|
26
25
|
...rest
|
|
27
26
|
} = _ref;
|
|
28
27
|
const id = useRef(guid());
|
|
@@ -44,16 +43,20 @@ const FlatTableRowHeader = _ref => {
|
|
|
44
43
|
rightPosition: stickyAlignment === "right" ? rightPosition || 0 : undefined,
|
|
45
44
|
align: align,
|
|
46
45
|
"data-element": "flat-table-row-header",
|
|
47
|
-
|
|
46
|
+
width: width,
|
|
48
47
|
py: py || "10px",
|
|
49
48
|
px: px || 3,
|
|
50
49
|
onClick: handleOnClick,
|
|
51
50
|
tabIndex: expandable && onClick ? tabIndex : undefined,
|
|
52
51
|
onKeyDown: handleOnKeyDown,
|
|
53
|
-
|
|
52
|
+
truncate: truncate,
|
|
54
53
|
expandable: expandable,
|
|
55
54
|
stickyAlignment: stickyAlignment,
|
|
56
55
|
id: id.current
|
|
56
|
+
}, colspan !== undefined && {
|
|
57
|
+
colSpan: Number(colspan)
|
|
58
|
+
}, rowspan !== undefined && {
|
|
59
|
+
rowSpan: Number(rowspan)
|
|
57
60
|
}, rest), /*#__PURE__*/React.createElement(StyledFlatTableRowHeaderContent, {
|
|
58
61
|
title: truncate && !title && typeof children === "string" ? children : title,
|
|
59
62
|
expandable: expandable
|
|
@@ -63,50 +66,5 @@ const FlatTableRowHeader = _ref => {
|
|
|
63
66
|
mr: "8px"
|
|
64
67
|
}), children));
|
|
65
68
|
};
|
|
66
|
-
FlatTableRowHeader.propTypes = {
|
|
67
|
-
/** Styled system padding props */
|
|
68
|
-
...paddingPropTypes,
|
|
69
|
-
/** Content alignment */
|
|
70
|
-
align: PropTypes.oneOf(["center", "left", "right"]),
|
|
71
|
-
/** RowHeader content */
|
|
72
|
-
children: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
73
|
-
/** Column width, pass a number to set a fixed width in pixels */
|
|
74
|
-
width: PropTypes.number,
|
|
75
|
-
/** Truncate cell content and add ellipsis to any text that overflows */
|
|
76
|
-
truncate: PropTypes.bool,
|
|
77
|
-
/** Title text to display if cell content truncates */
|
|
78
|
-
title: PropTypes.string,
|
|
79
|
-
/**
|
|
80
|
-
* @private
|
|
81
|
-
* @ignore
|
|
82
|
-
*/
|
|
83
|
-
expandable: PropTypes.bool,
|
|
84
|
-
/**
|
|
85
|
-
* @private
|
|
86
|
-
* @ignore
|
|
87
|
-
*/
|
|
88
|
-
onClick: PropTypes.func,
|
|
89
|
-
/**
|
|
90
|
-
* @private
|
|
91
|
-
* @ignore
|
|
92
|
-
*/
|
|
93
|
-
onKeyDown: PropTypes.func,
|
|
94
|
-
/** Sets a custom vertical right border */
|
|
95
|
-
verticalBorder: PropTypes.oneOf(["small", "medium", "large"]),
|
|
96
|
-
/** Sets a vertical right border color, provide design token, any color from palette or any valid css color value. */
|
|
97
|
-
verticalBorderColor: PropTypes.string,
|
|
98
|
-
/** Defines whether the column should be sticky on the left or right hand side of the Table */
|
|
99
|
-
stickyAlignment: PropTypes.oneOf(["left", "right"]),
|
|
100
|
-
/**
|
|
101
|
-
* @private
|
|
102
|
-
* @ignore
|
|
103
|
-
*/
|
|
104
|
-
leftPosition: PropTypes.number,
|
|
105
|
-
/**
|
|
106
|
-
* @private
|
|
107
|
-
* @ignore
|
|
108
|
-
*/
|
|
109
|
-
rightPosition: PropTypes.number
|
|
110
|
-
};
|
|
111
69
|
FlatTableRowHeader.displayName = "FlatTableRowHeader";
|
|
112
70
|
export default FlatTableRowHeader;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { FlatTableRowHeaderProps } from "./flat-table-row-header.component";
|
|
2
|
+
declare const StyledFlatTableRowHeader: import("styled-components").StyledComponent<"th", any, FlatTableRowHeaderProps, never>;
|
|
3
|
+
declare const StyledFlatTableRowHeaderContent: import("styled-components").StyledComponent<"div", any, {
|
|
4
|
+
expandable?: boolean | undefined;
|
|
5
|
+
}, never>;
|
|
6
|
+
export { StyledFlatTableRowHeader, StyledFlatTableRowHeaderContent };
|