@eccenca/gui-elements 23.1.0-rc.1 → 23.1.0-rc.3
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/CHANGELOG.md +54 -10
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +6 -4
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js +33 -8
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/cjs/cmem/ConfidenceValue/ConfidenceValue.js +52 -0
- package/dist/cjs/cmem/ConfidenceValue/ConfidenceValue.js.map +1 -0
- package/dist/cjs/cmem/ConfidenceValue/index.js +14 -0
- package/dist/cjs/cmem/ConfidenceValue/index.js.map +1 -0
- package/dist/cjs/cmem/index.js +11 -0
- package/dist/cjs/cmem/index.js.map +1 -1
- package/dist/cjs/cmem/markdown/Markdown.js +8 -4
- package/dist/cjs/cmem/markdown/Markdown.js.map +1 -1
- package/dist/cjs/common/Intent/index.js +1 -0
- package/dist/cjs/common/Intent/index.js.map +1 -1
- package/dist/cjs/common/utils/CssCustomProperties.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +10 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js +8 -10
- package/dist/cjs/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
- package/dist/cjs/components/Card/Card.js +7 -6
- package/dist/cjs/components/Card/Card.js.map +1 -1
- package/dist/cjs/components/Card/CardContent.js +4 -2
- package/dist/cjs/components/Card/CardContent.js.map +1 -1
- package/dist/cjs/components/Card/CardHeader.js.map +1 -1
- package/dist/cjs/components/Depiction/Depiction.js +13 -13
- package/dist/cjs/components/Depiction/Depiction.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +6 -0
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/Pagination/Pagination.js +24 -9
- package/dist/cjs/components/Pagination/Pagination.js.map +1 -1
- package/dist/cjs/components/ProgressBar/index.js +14 -0
- package/dist/cjs/components/ProgressBar/index.js.map +1 -0
- package/dist/cjs/components/Separation/Divider.js +20 -2
- package/dist/cjs/components/Separation/Divider.js.map +1 -1
- package/dist/cjs/components/Switch/Switch.js +2 -2
- package/dist/cjs/components/Switch/Switch.js.map +1 -1
- package/dist/cjs/components/Table/Table.js +46 -0
- package/dist/cjs/components/Table/Table.js.map +1 -0
- package/dist/cjs/components/Table/TableCell.js +29 -0
- package/dist/cjs/components/Table/TableCell.js.map +1 -0
- package/dist/cjs/components/Table/TableContainer.js +32 -0
- package/dist/cjs/components/Table/TableContainer.js.map +1 -0
- package/dist/cjs/components/Table/TableExpandHeader.js +36 -0
- package/dist/cjs/components/Table/TableExpandHeader.js.map +1 -0
- package/dist/cjs/components/Table/TableExpandRow.js +45 -0
- package/dist/cjs/components/Table/TableExpandRow.js.map +1 -0
- package/dist/cjs/components/{SimpleTable/TableContainer.js → Table/TableRow.js} +9 -11
- package/dist/cjs/components/Table/TableRow.js.map +1 -0
- package/dist/cjs/components/Table/index.js +26 -0
- package/dist/cjs/components/Table/index.js.map +1 -0
- package/dist/cjs/components/Tag/TagList.js.map +1 -1
- package/dist/cjs/components/Tag/index.js +11 -0
- package/dist/cjs/components/Tag/index.js.map +1 -0
- package/dist/cjs/components/TextField/TextField.js +25 -9
- package/dist/cjs/components/TextField/TextField.js.map +1 -1
- package/dist/cjs/components/index.js +4 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js +20 -5
- package/dist/cjs/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js +74 -0
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js.map +1 -0
- package/dist/cjs/extensions/react-flow/edges/edgeTypes.js +10 -9
- package/dist/cjs/extensions/react-flow/edges/edgeTypes.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +14 -3
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/index.js +13 -3
- package/dist/cjs/extensions/react-flow/index.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +113 -33
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js +5 -2
- package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/versionsupport.js +20 -0
- package/dist/cjs/extensions/react-flow/versionsupport.js.map +1 -0
- package/dist/cjs/index.js +3 -19
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +6 -4
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/SilkActivityControl.js +35 -10
- package/dist/esm/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/esm/cmem/ConfidenceValue/ConfidenceValue.js +56 -0
- package/dist/esm/cmem/ConfidenceValue/ConfidenceValue.js.map +1 -0
- package/dist/esm/cmem/ConfidenceValue/index.js +2 -0
- package/dist/esm/cmem/ConfidenceValue/index.js.map +1 -0
- package/dist/esm/cmem/index.js +1 -0
- package/dist/esm/cmem/index.js.map +1 -1
- package/dist/esm/cmem/markdown/Markdown.js +8 -4
- package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
- package/dist/esm/common/Intent/index.js +1 -0
- package/dist/esm/common/Intent/index.js.map +1 -1
- package/dist/esm/common/utils/CssCustomProperties.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +10 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js +8 -10
- package/dist/esm/components/AutoSuggestion/SingleLineCodeEditor.js.map +1 -1
- package/dist/esm/components/Card/Card.js +7 -6
- package/dist/esm/components/Card/Card.js.map +1 -1
- package/dist/esm/components/Card/CardContent.js +4 -2
- package/dist/esm/components/Card/CardContent.js.map +1 -1
- package/dist/esm/components/Card/CardHeader.js.map +1 -1
- package/dist/esm/components/Depiction/Depiction.js +15 -14
- package/dist/esm/components/Depiction/Depiction.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +6 -0
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/Pagination/Pagination.js +25 -10
- package/dist/esm/components/Pagination/Pagination.js.map +1 -1
- package/dist/esm/components/ProgressBar/index.js +2 -0
- package/dist/esm/components/ProgressBar/index.js.map +1 -0
- package/dist/esm/components/Separation/Divider.js +29 -3
- package/dist/esm/components/Separation/Divider.js.map +1 -1
- package/dist/esm/components/Switch/Switch.js +2 -2
- package/dist/esm/components/Switch/Switch.js.map +1 -1
- package/dist/esm/components/Table/Table.js +50 -0
- package/dist/esm/components/Table/Table.js.map +1 -0
- package/dist/esm/components/{SimpleTable/TableContainer.js → Table/TableCell.js} +8 -12
- package/dist/esm/components/Table/TableCell.js.map +1 -0
- package/dist/esm/components/Table/TableContainer.js +36 -0
- package/dist/esm/components/Table/TableContainer.js.map +1 -0
- package/dist/esm/components/Table/TableExpandHeader.js +40 -0
- package/dist/esm/components/Table/TableExpandHeader.js.map +1 -0
- package/dist/esm/components/Table/TableExpandRow.js +49 -0
- package/dist/esm/components/Table/TableExpandRow.js.map +1 -0
- package/dist/esm/components/Table/TableRow.js +33 -0
- package/dist/esm/components/Table/TableRow.js.map +1 -0
- package/dist/esm/components/Table/index.js +9 -0
- package/dist/esm/components/Table/index.js.map +1 -0
- package/dist/esm/components/Tag/TagList.js.map +1 -1
- package/dist/esm/components/Tag/index.js +4 -0
- package/dist/esm/components/Tag/index.js.map +1 -0
- package/dist/esm/components/TextField/TextField.js +26 -10
- package/dist/esm/components/TextField/TextField.js.map +1 -1
- package/dist/esm/components/index.js +4 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeDefault.js +20 -4
- package/dist/esm/extensions/react-flow/edges/EdgeDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js +63 -0
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js.map +1 -0
- package/dist/esm/extensions/react-flow/edges/edgeTypes.js +10 -9
- package/dist/esm/extensions/react-flow/edges/edgeTypes.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +15 -4
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/index.js +2 -1
- package/dist/esm/extensions/react-flow/index.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js +121 -38
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeDefault.js +5 -2
- package/dist/esm/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/versionsupport.js +32 -0
- package/dist/esm/extensions/react-flow/versionsupport.js.map +1 -0
- package/dist/esm/index.js +3 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +1 -1
- package/dist/types/cmem/ActivityControl/SilkActivityControl.d.ts +6 -2
- package/dist/types/cmem/ConfidenceValue/ConfidenceValue.d.ts +46 -0
- package/dist/types/cmem/ConfidenceValue/index.d.ts +1 -0
- package/dist/types/cmem/index.d.ts +1 -0
- package/dist/types/cmem/markdown/Markdown.d.ts +6 -1
- package/dist/types/common/Intent/index.d.ts +1 -1
- package/dist/types/common/utils/CssCustomProperties.d.ts +1 -1
- package/dist/types/components/Card/Card.d.ts +5 -1
- package/dist/types/components/Card/CardContent.d.ts +7 -1
- package/dist/types/components/Card/CardHeader.d.ts +9 -1
- package/dist/types/components/Grid/Grid.d.ts +1 -1
- package/dist/types/components/Grid/GridColumn.d.ts +1 -1
- package/dist/types/components/Grid/GridRow.d.ts +1 -1
- package/dist/types/components/Icon/IconButton.d.ts +1 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +1 -1
- package/dist/types/components/Pagination/Pagination.d.ts +5 -1
- package/dist/types/components/ProgressBar/index.d.ts +1 -0
- package/dist/types/components/Separation/Divider.d.ts +18 -2
- package/dist/types/components/Separation/Spacing.d.ts +1 -1
- package/dist/types/components/Switch/Switch.d.ts +5 -1
- package/dist/types/components/Table/Table.d.ts +32 -0
- package/dist/types/components/Table/TableCell.d.ts +11 -0
- package/dist/types/components/Table/TableContainer.d.ts +13 -0
- package/dist/types/components/Table/TableExpandHeader.d.ts +13 -0
- package/dist/types/components/Table/TableExpandRow.d.ts +17 -0
- package/dist/types/components/Table/TableRow.d.ts +10 -0
- package/dist/types/components/Table/index.d.ts +7 -0
- package/dist/types/components/Tag/Tag.d.ts +1 -1
- package/dist/types/components/Tag/TagList.d.ts +5 -2
- package/dist/types/components/Tag/index.d.ts +4 -0
- package/dist/types/components/TextField/TextField.d.ts +9 -0
- package/dist/types/components/index.d.ts +4 -0
- package/dist/types/extensions/react-flow/edges/EdgeDefault.d.ts +16 -1
- package/dist/types/extensions/react-flow/edges/EdgeLabel.d.ts +44 -0
- package/dist/types/extensions/react-flow/edges/edgeTypes.d.ts +10 -9
- package/dist/types/extensions/react-flow/handles/HandleDefault.d.ts +11 -3
- package/dist/types/extensions/react-flow/index.d.ts +2 -2
- package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +55 -8
- package/dist/types/extensions/react-flow/nodes/NodeDefault.d.ts +2 -1
- package/dist/types/extensions/react-flow/versionsupport.d.ts +7 -0
- package/dist/types/index.d.ts +1 -6
- package/package.json +2 -1
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +5 -5
- package/src/cmem/ActivityControl/SilkActivityControl.tsx +44 -17
- package/src/cmem/ConfidenceValue/ConfidenceValue.stories.tsx +22 -0
- package/src/cmem/ConfidenceValue/ConfidenceValue.tsx +116 -0
- package/src/cmem/ConfidenceValue/confidencevalue.scss +49 -0
- package/src/cmem/ConfidenceValue/index.ts +1 -0
- package/src/cmem/_index.scss +1 -0
- package/src/cmem/index.ts +2 -0
- package/src/cmem/markdown/Markdown.stories.tsx +3 -1
- package/src/cmem/markdown/Markdown.tsx +22 -10
- package/src/cmem/react-flow/ReactFlow/ReactFlow.stories.tsx +2 -2
- package/src/cmem/react-flow/_edges.scss +3 -2
- package/src/cmem/react-flow/configuration/_colors-workflow.scss +3 -0
- package/src/common/Intent/index.ts +2 -1
- package/src/common/utils/CssCustomProperties.ts +1 -1
- package/src/components/AutoSuggestion/AutoSuggestion.scss +1 -0
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +10 -1
- package/src/components/AutoSuggestion/SingleLineCodeEditor.tsx +8 -10
- package/src/components/AutoSuggestion/tests/SingleLineCodeEditor.test.tsx +5 -0
- package/src/components/Badge/badge.scss +2 -5
- package/src/components/Card/Card.tsx +11 -5
- package/src/components/Card/CardContent.tsx +12 -1
- package/src/components/Card/CardHeader.tsx +9 -1
- package/src/components/Card/card.scss +108 -3
- package/src/components/Checkbox/checkbox.scss +6 -2
- package/src/components/Depiction/Depiction.tsx +11 -10
- package/src/components/Grid/Grid.tsx +1 -1
- package/src/components/Grid/GridColumn.tsx +1 -1
- package/src/components/Grid/GridRow.tsx +1 -1
- package/src/components/Grid/grid.scss +6 -2
- package/src/components/Icon/IconButton.tsx +1 -1
- package/src/components/Icon/canonicalIconNames.tsx +13 -0
- package/src/components/Menu/menu.scss +4 -0
- package/src/components/OverviewItem/overviewitem.scss +2 -2
- package/src/components/Pagination/Pagination.tsx +29 -9
- package/src/components/Pagination/pagination.scss +16 -0
- package/src/components/ProgressBar/index.ts +1 -0
- package/src/components/Separation/Divider.tsx +36 -2
- package/src/components/Separation/Spacing.tsx +1 -1
- package/src/components/Separation/Stories/Divider.stories.tsx +22 -0
- package/src/components/Separation/separation.scss +31 -5
- package/src/components/Switch/Switch.tsx +6 -2
- package/src/components/Table/Table.tsx +88 -0
- package/src/components/Table/TableCell.tsx +37 -0
- package/src/components/Table/TableContainer.tsx +49 -0
- package/src/components/Table/TableExpandHeader.tsx +51 -0
- package/src/components/Table/TableExpandRow.tsx +70 -0
- package/src/components/Table/TableRow.tsx +36 -0
- package/src/components/Table/index.tsx +14 -0
- package/src/components/Table/table.scss +323 -0
- package/src/components/Tag/Tag.tsx +1 -1
- package/src/components/Tag/TagList.tsx +5 -3
- package/src/components/Tag/index.ts +5 -0
- package/src/components/Tag/{Tag.stories.tsx → stories/Tag.stories.tsx} +3 -2
- package/src/components/Tag/stories/TagList.stories.tsx +28 -0
- package/src/components/Tag/tag.scss +1 -0
- package/src/components/TextField/TextField.tsx +43 -12
- package/src/components/TextField/stories/TextField.stories.tsx +3 -0
- package/src/components/TextField/textfield.scss +23 -1
- package/src/components/Tree/tree.scss +4 -0
- package/src/components/Typography/typography.scss +2 -2
- package/src/components/index.scss +1 -0
- package/src/components/index.ts +5 -0
- package/src/extensions/react-flow/_config.scss +8 -4
- package/src/extensions/react-flow/edges/EdgeDefault.tsx +60 -5
- package/src/extensions/react-flow/edges/EdgeLabel.tsx +127 -0
- package/src/extensions/react-flow/edges/_edges.scss +214 -38
- package/src/extensions/react-flow/edges/edgeTypes.ts +13 -9
- package/src/extensions/react-flow/edges/stories/EdgeDefault.stories.tsx +34 -13
- package/src/extensions/react-flow/edges/stories/EdgeLabel.stories.tsx +40 -0
- package/src/extensions/react-flow/handles/HandleDefault.tsx +41 -10
- package/src/extensions/react-flow/index.ts +3 -2
- package/src/extensions/react-flow/nodes/NodeContent.tsx +233 -60
- package/src/extensions/react-flow/nodes/NodeDefault.tsx +7 -2
- package/src/extensions/react-flow/nodes/_nodes.scss +232 -67
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +67 -1
- package/src/extensions/react-flow/versionsupport.ts +22 -0
- package/src/index.scss +0 -1
- package/src/index.ts +5 -38
- package/dist/cjs/components/SimpleTable/TableContainer.js.map +0 -1
- package/dist/cjs/components/SimpleTable/index.js +0 -16
- package/dist/cjs/components/SimpleTable/index.js.map +0 -1
- package/dist/esm/components/SimpleTable/TableContainer.js.map +0 -1
- package/dist/esm/components/SimpleTable/index.js +0 -4
- package/dist/esm/components/SimpleTable/index.js.map +0 -1
- package/dist/types/components/SimpleTable/TableContainer.d.ts +0 -3
- package/dist/types/components/SimpleTable/index.d.ts +0 -3
- package/src/components/SimpleTable/TableContainer.tsx +0 -20
- package/src/components/SimpleTable/index.tsx +0 -4
- package/src/components/SimpleTable/simpletable.scss +0 -180
|
@@ -26,6 +26,10 @@ export interface PaginationProps extends CarbonPaginationProps {
|
|
|
26
26
|
* Hide prev/next arrows to navigate through the pages.
|
|
27
27
|
*/
|
|
28
28
|
hideNavigationArrows?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Element is displayed with dividing borders.
|
|
31
|
+
*/
|
|
32
|
+
hideBorders?: boolean;
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
function Pagination({
|
|
@@ -34,6 +38,7 @@ function Pagination({
|
|
|
34
38
|
hideInfoText = false,
|
|
35
39
|
hidePageSelect = false,
|
|
36
40
|
hideNavigationArrows = false,
|
|
41
|
+
hideBorders = false,
|
|
37
42
|
...otherProps
|
|
38
43
|
}: PaginationProps) {
|
|
39
44
|
return (
|
|
@@ -45,7 +50,8 @@ function Pagination({
|
|
|
45
50
|
(hidePageSizeConfiguration ? ` ${eccgui}-pagination--hidepagesize` : "") +
|
|
46
51
|
(hideInfoText ? ` ${eccgui}-pagination--hideinfotext` : "") +
|
|
47
52
|
(hidePageSelect ? ` ${eccgui}-pagination--hidepageselect` : "") +
|
|
48
|
-
(hideNavigationArrows ? ` ${eccgui}-pagination--hidenavigation` : "")
|
|
53
|
+
(hideNavigationArrows ? ` ${eccgui}-pagination--hidenavigation` : "") +
|
|
54
|
+
(hideBorders ? ` ${eccgui}-pagination--hideborders` : "")
|
|
49
55
|
}
|
|
50
56
|
/>
|
|
51
57
|
);
|
|
@@ -74,19 +80,33 @@ export const usePagination = ({
|
|
|
74
80
|
initialPageSize,
|
|
75
81
|
}: IPaginationOptions) => {
|
|
76
82
|
const minSize = Math.min(...pageSizes);
|
|
77
|
-
const
|
|
83
|
+
const _pagination = React.useRef<IPaginationDetails>({
|
|
78
84
|
total: 0,
|
|
79
85
|
current: 1,
|
|
80
86
|
limit: initialPageSize ? initialPageSize : minSize,
|
|
81
87
|
minPageSize: minSize,
|
|
82
|
-
})
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
88
|
+
})
|
|
89
|
+
const [pagination, _setPagination] = useState<IPaginationDetails>(_pagination.current);
|
|
90
|
+
const setPagination = React.useCallback((newPagination: IPaginationDetails) => {
|
|
91
|
+
// Check if pagination has actually changed
|
|
92
|
+
const current = _pagination.current
|
|
93
|
+
if (newPagination.current !== current.current ||
|
|
94
|
+
newPagination.minPageSize !== current.minPageSize ||
|
|
95
|
+
newPagination.limit !== current.limit ||
|
|
96
|
+
newPagination.total !== current.total) {
|
|
97
|
+
_pagination.current = newPagination
|
|
98
|
+
_setPagination(newPagination)
|
|
99
|
+
}
|
|
100
|
+
}, [])
|
|
101
|
+
const onPaginationChange = React.useCallback(({ page, pageSize }: {page: any, pageSize: any}) => {
|
|
102
|
+
setPagination({ ..._pagination.current, current: page, limit: pageSize });
|
|
103
|
+
}, [setPagination]);
|
|
86
104
|
// When the total number of pageable items changes, this function must be called
|
|
87
|
-
const onTotalChange = (total: number): void => {
|
|
88
|
-
|
|
89
|
-
|
|
105
|
+
const onTotalChange = React.useCallback((total: number): void => {
|
|
106
|
+
if(_pagination.current.total !== total) {
|
|
107
|
+
setPagination({ ..._pagination.current, total: total, current: 1 });
|
|
108
|
+
}
|
|
109
|
+
}, [setPagination]);
|
|
90
110
|
const paginationElement = (
|
|
91
111
|
<Pagination
|
|
92
112
|
onChange={onPaginationChange}
|
|
@@ -46,3 +46,19 @@ span.#{$prefix}--pagination__text {
|
|
|
46
46
|
display: none;
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
+
|
|
50
|
+
.#{$eccgui}-pagination--hideborders {
|
|
51
|
+
border-top: none;
|
|
52
|
+
|
|
53
|
+
.#{$prefix}--select__item-count .#{$prefix}--select-input {
|
|
54
|
+
border-right: none;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.#{$prefix}--select__page-number .#{$prefix}--select-input {
|
|
58
|
+
border-left: none;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.#{$prefix}--pagination__button {
|
|
62
|
+
border-left: none;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./ProgressBar";
|
|
@@ -1,8 +1,42 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
3
|
+
import { SpacingProps } from "./Spacing";
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
export interface DividerProps extends React.HTMLAttributes<HTMLHRElement> {
|
|
6
|
+
/**
|
|
7
|
+
* Add whitespace arount the horizontal rule.
|
|
8
|
+
*/
|
|
9
|
+
addSpacing?: "none" | SpacingProps["size"];
|
|
10
|
+
/**
|
|
11
|
+
* Set the width of the horizontal rule.
|
|
12
|
+
*/
|
|
13
|
+
width?: "short" | "half" | "medium" | "full";
|
|
14
|
+
/**
|
|
15
|
+
* Set the horizontal alignment of the horizontal rule.
|
|
16
|
+
* This is only visible for widths that are not set to `full`.
|
|
17
|
+
*/
|
|
18
|
+
alignment?: "left" | "center" | "right";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function Divider({
|
|
22
|
+
className,
|
|
23
|
+
addSpacing = "none",
|
|
24
|
+
width = "full",
|
|
25
|
+
alignment = "left",
|
|
26
|
+
...otherHrProps
|
|
27
|
+
}: DividerProps) {
|
|
28
|
+
return (
|
|
29
|
+
<hr
|
|
30
|
+
className={
|
|
31
|
+
`${eccgui}-separation__divider-horizontal` +
|
|
32
|
+
(addSpacing !== "none" ? ` ${eccgui}-separation__spacing--${addSpacing}` : "") +
|
|
33
|
+
(width !== "full" ? ` ${eccgui}-separation__divider-horizontal--${width}` : "") +
|
|
34
|
+
(alignment !== "left" ? ` ${eccgui}-separation__divider-horizontal--${alignment}` : "") +
|
|
35
|
+
(!!className ? ` ${className}` : "")
|
|
36
|
+
}
|
|
37
|
+
{...otherHrProps}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
6
40
|
}
|
|
7
41
|
|
|
8
42
|
export default Divider;
|
|
@@ -5,7 +5,7 @@ export interface SpacingProps {
|
|
|
5
5
|
/**
|
|
6
6
|
* Set the amount of white space that separates two elements.
|
|
7
7
|
*/
|
|
8
|
-
size?: "tiny" | "small" | "medium" | "large"
|
|
8
|
+
size?: "tiny" | "small" | "medium" | "large" | "xlarge"
|
|
9
9
|
/**
|
|
10
10
|
* If set then is a ruler displayed in the middle of the spacing area.
|
|
11
11
|
* The direction of the ruler is used from the spacing.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
import { Button, Divider } from "./../../../../index";
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/Separation/Divider",
|
|
6
|
+
component: Divider,
|
|
7
|
+
argTypes: {
|
|
8
|
+
}
|
|
9
|
+
} as ComponentMeta<typeof Divider>
|
|
10
|
+
|
|
11
|
+
// buttons used for only showing space with elements
|
|
12
|
+
const DividerExample: ComponentStory<typeof Divider> = (args) => (
|
|
13
|
+
<>
|
|
14
|
+
<Button children="Example element"/>
|
|
15
|
+
<Divider {...args}/>
|
|
16
|
+
<Button children="Another element"/>
|
|
17
|
+
</>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
export const Default = DividerExample.bind({});
|
|
21
|
+
Default.args = {
|
|
22
|
+
};
|
|
@@ -25,26 +25,52 @@ $eccgui-color-separation-divider: $pt-divider-black !default;
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
&.#{$eccgui}-separation__spacing--tiny {
|
|
28
|
-
margin: $eccgui-size-separation-spacing-medium * 0.125
|
|
28
|
+
margin-top: $eccgui-size-separation-spacing-medium * 0.125;
|
|
29
|
+
margin-bottom: $eccgui-size-separation-spacing-medium * 0.125;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
&.#{$eccgui}-separation__spacing--small {
|
|
32
|
-
margin: $eccgui-size-separation-spacing-medium * 0.25
|
|
33
|
+
margin-top: $eccgui-size-separation-spacing-medium * 0.25;
|
|
34
|
+
margin-bottom: $eccgui-size-separation-spacing-medium * 0.25;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
&.#{$eccgui}-separation__spacing--medium {
|
|
36
|
-
margin: $eccgui-size-separation-spacing-medium * 0.5
|
|
38
|
+
margin-top: $eccgui-size-separation-spacing-medium * 0.5;
|
|
39
|
+
margin-bottom: $eccgui-size-separation-spacing-medium * 0.5;
|
|
37
40
|
}
|
|
38
41
|
|
|
39
42
|
&.#{$eccgui}-separation__spacing--large {
|
|
40
|
-
margin: $eccgui-size-separation-spacing-medium * 0.75
|
|
43
|
+
margin-top: $eccgui-size-separation-spacing-medium * 0.75;
|
|
44
|
+
margin-bottom: $eccgui-size-separation-spacing-medium * 0.75;
|
|
41
45
|
}
|
|
42
46
|
|
|
43
47
|
&.#{$eccgui}-separation__spacing--xlarge {
|
|
44
|
-
margin: $eccgui-size-separation-spacing-medium
|
|
48
|
+
margin-top: $eccgui-size-separation-spacing-medium;
|
|
49
|
+
margin-bottom: $eccgui-size-separation-spacing-medium;
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
52
|
|
|
53
|
+
.#{$eccgui}-separation__divider-horizontal--short {
|
|
54
|
+
width: 39%;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.#{$eccgui}-separation__divider-horizontal--half {
|
|
58
|
+
width: 50%;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.#{$eccgui}-separation__divider-horizontal--medium {
|
|
62
|
+
width: 61%;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.#{$eccgui}-separation__divider-horizontal--center {
|
|
66
|
+
margin-left: auto;
|
|
67
|
+
margin-right: auto;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.#{$eccgui}-separation__divider-horizontal--right {
|
|
71
|
+
margin-left: auto;
|
|
72
|
+
}
|
|
73
|
+
|
|
48
74
|
.#{$eccgui}-separation__spacing-vertical {
|
|
49
75
|
display: inline-block;
|
|
50
76
|
height: 1em * $eccgui-size-typo-base-lineheight;
|
|
@@ -10,16 +10,20 @@ export interface SwitchProps extends Omit<BlueprintSwitchProps, "onChange"> {
|
|
|
10
10
|
* Event handler for changed state.
|
|
11
11
|
*/
|
|
12
12
|
onChange?: (value: boolean) => any
|
|
13
|
+
/**
|
|
14
|
+
* class names
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
13
17
|
}
|
|
14
18
|
|
|
15
|
-
function Switch({onChange, ...otherProps}: SwitchProps) {
|
|
19
|
+
function Switch({onChange, className, ...otherProps}: SwitchProps) {
|
|
16
20
|
const handleChange = (e: SyntheticEvent<HTMLInputElement>) => {
|
|
17
21
|
const checked = !!(e as any).target?.checked
|
|
18
22
|
onChange && onChange(checked);
|
|
19
23
|
};
|
|
20
24
|
|
|
21
25
|
return <BlueprintSwitch
|
|
22
|
-
className={`${eccgui}-switch`}
|
|
26
|
+
className={`${eccgui}-switch ${className}`}
|
|
23
27
|
{...otherProps}
|
|
24
28
|
onChange={handleChange}
|
|
25
29
|
/>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
Table as CarbonTable,
|
|
4
|
+
TableProps as CarbonTableProps,
|
|
5
|
+
DataTableSize as CarbonDataTableSize,
|
|
6
|
+
} from "carbon-components-react";
|
|
7
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
8
|
+
|
|
9
|
+
type TableRowHeightSizeDepracted = "compact" | "tall"; // @deprecated
|
|
10
|
+
export type TableRowHeightSize = "small" | "medium" | "large" | TableRowHeightSizeDepracted;
|
|
11
|
+
|
|
12
|
+
export interface TableProps extends Omit<
|
|
13
|
+
CarbonTableProps,
|
|
14
|
+
"size" | "overflowMenuOnHover" | "stickyHeader" | "useStaticWidth"
|
|
15
|
+
>, React.TableHTMLAttributes<HTMLTableElement> {
|
|
16
|
+
/**
|
|
17
|
+
* Sets basically the height of a row inside the table.
|
|
18
|
+
* Please use only `small`, `medium` and `large`.
|
|
19
|
+
* `compact` and `tall` are deprecated.
|
|
20
|
+
*/
|
|
21
|
+
size?: TableRowHeightSize;
|
|
22
|
+
/**
|
|
23
|
+
* All rows are divided by horizontal borders.
|
|
24
|
+
*/
|
|
25
|
+
hasDivider?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* This will lead to a `colgroup` element within the `table` setting `with` styles for each column.
|
|
28
|
+
* The table is then displayed `fixed`.
|
|
29
|
+
* All values need to be valid CSS width expression, e.g. `30px`, `5rem`, `40%`.
|
|
30
|
+
* If you need to add more attributes to the `col` elements, e.g. class names, then you need to control `colgroup` and `fixed` table by yourself.
|
|
31
|
+
*/
|
|
32
|
+
columnWidths?: string[];
|
|
33
|
+
/**
|
|
34
|
+
* Table is displayed without any own coloring.
|
|
35
|
+
* For example this can be used for sub tables inside other elements with already set background colors.
|
|
36
|
+
* Zebra styles won't work if this option is enabled!
|
|
37
|
+
*/
|
|
38
|
+
colorless?: boolean;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const tableRowHeightSizes: Record<string, CarbonDataTableSize> = {
|
|
42
|
+
// current values
|
|
43
|
+
"small": "xs",
|
|
44
|
+
"medium": "sm",
|
|
45
|
+
"large": "md",
|
|
46
|
+
// deprecated values
|
|
47
|
+
"compact": "xs",
|
|
48
|
+
"tall": "md",
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function Table({
|
|
52
|
+
className = "",
|
|
53
|
+
size = "medium",
|
|
54
|
+
hasDivider = true,
|
|
55
|
+
columnWidths,
|
|
56
|
+
colorless,
|
|
57
|
+
children,
|
|
58
|
+
...otherCarbonTableProps
|
|
59
|
+
}: TableProps) {
|
|
60
|
+
|
|
61
|
+
let colLayout : boolean | JSX.Element = false;
|
|
62
|
+
if (!!columnWidths && columnWidths.length > 0) {
|
|
63
|
+
colLayout = (
|
|
64
|
+
<colgroup className={`${eccgui}-simpletable__layout`}>
|
|
65
|
+
{columnWidths.map((width,i) => <col key={i} style={{ width }}/>)}
|
|
66
|
+
</colgroup>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return (
|
|
71
|
+
<CarbonTable
|
|
72
|
+
className={
|
|
73
|
+
`${eccgui}-simpletable ${eccgui}-simpletable--${size}` +
|
|
74
|
+
(hasDivider ? ` ${eccgui}-simpletable--rowdivider` : "") +
|
|
75
|
+
(colLayout ? ` ${eccgui}-simpletable--haslayout` : "") +
|
|
76
|
+
(colorless ? ` ${eccgui}-simpletable--colorless` : "") +
|
|
77
|
+
(className ? ` ${className}` : "")
|
|
78
|
+
}
|
|
79
|
+
{...otherCarbonTableProps}
|
|
80
|
+
size={tableRowHeightSizes[size]}
|
|
81
|
+
>
|
|
82
|
+
{!!colLayout && colLayout}
|
|
83
|
+
{children}
|
|
84
|
+
</CarbonTable>
|
|
85
|
+
) ;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export default Table;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
TableCell as CarbonTableCell,
|
|
4
|
+
TableCellProps as CarbonTableCellProps,
|
|
5
|
+
} from "carbon-components-react";
|
|
6
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
7
|
+
|
|
8
|
+
export interface TableCellProps extends CarbonTableCellProps, React.TdHTMLAttributes<HTMLTableCellElement> {
|
|
9
|
+
/**
|
|
10
|
+
* By default all table cell content is aligned to the top of the cell.
|
|
11
|
+
* Use this property to change the vertical alignment.
|
|
12
|
+
*/
|
|
13
|
+
alignVertical?: "middle";
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function TableCell({
|
|
17
|
+
className = "",
|
|
18
|
+
children,
|
|
19
|
+
alignVertical,
|
|
20
|
+
...otherTableCellProps
|
|
21
|
+
}: TableCellProps) {
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<CarbonTableCell
|
|
25
|
+
className={
|
|
26
|
+
`${eccgui}-simpletable__cell` +
|
|
27
|
+
(!!alignVertical ? ` ${eccgui}-simpletable__cell--${alignVertical}` : "") +
|
|
28
|
+
(className ? ` ${className}` : "")
|
|
29
|
+
}
|
|
30
|
+
{...otherTableCellProps}
|
|
31
|
+
>
|
|
32
|
+
{children}
|
|
33
|
+
</CarbonTableCell>
|
|
34
|
+
) ;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export default TableCell;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
DataTable as CarbonDataTable,
|
|
4
|
+
DataTableProps as CarbonDataTableProps,
|
|
5
|
+
TableContainerProps as CarbonTableContainerProps
|
|
6
|
+
} from "carbon-components-react";
|
|
7
|
+
import { TableRowHeightSize, tableRowHeightSizes } from "./Table";
|
|
8
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
9
|
+
|
|
10
|
+
interface TableDataContainerProps extends Omit<
|
|
11
|
+
CarbonDataTableProps,
|
|
12
|
+
"size" | "overflowMenuOnHover" | "stickyHeader" | "useStaticWidth"
|
|
13
|
+
>, React.TableHTMLAttributes<HTMLTableElement> {
|
|
14
|
+
children(signature: any): JSX.Element;
|
|
15
|
+
size?: TableRowHeightSize;
|
|
16
|
+
}
|
|
17
|
+
interface TableSimpleContainerProps extends Omit<
|
|
18
|
+
CarbonTableContainerProps,
|
|
19
|
+
"description" | "stickyHeader" | "title" | "useStaticWidth"
|
|
20
|
+
>, React.HTMLAttributes<HTMLDivElement> {
|
|
21
|
+
children?: JSX.Element;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type TableContainerProps = TableDataContainerProps | TableSimpleContainerProps;
|
|
25
|
+
|
|
26
|
+
export function TableContainer({
|
|
27
|
+
className = "",
|
|
28
|
+
...otherProps
|
|
29
|
+
}: TableContainerProps) {
|
|
30
|
+
|
|
31
|
+
const otherDataTableProps = otherProps as TableDataContainerProps;
|
|
32
|
+
|
|
33
|
+
return !!otherDataTableProps.headers || !!otherDataTableProps.rows ? (
|
|
34
|
+
<CarbonDataTable.TableContainer className={`${eccgui}-simpletable__container ` + className}>
|
|
35
|
+
<CarbonDataTable
|
|
36
|
+
{...otherDataTableProps}
|
|
37
|
+
size={
|
|
38
|
+
otherDataTableProps.size
|
|
39
|
+
? tableRowHeightSizes[otherDataTableProps.size]
|
|
40
|
+
: tableRowHeightSizes.medium
|
|
41
|
+
}
|
|
42
|
+
/>
|
|
43
|
+
</CarbonDataTable.TableContainer>
|
|
44
|
+
) : (
|
|
45
|
+
<CarbonDataTable.TableContainer {...otherProps} className={`${eccgui}-simpletable__container ` + className} />
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default TableContainer;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
TableExpandHeader as CarbonTableExpandHeader,
|
|
4
|
+
TableExpandHeaderProps as CarbonTableExpandHeaderProps,
|
|
5
|
+
} from "carbon-components-react";
|
|
6
|
+
import IconButton from "./../Icon/IconButton";
|
|
7
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
8
|
+
|
|
9
|
+
export interface TableExpandHeaderProps extends Omit<
|
|
10
|
+
CarbonTableExpandHeaderProps,
|
|
11
|
+
"children" | "ariaLabel" | "enableExpando" | "expandIconDescription"
|
|
12
|
+
>, React.ThHTMLAttributes<HTMLTableCellElement> {
|
|
13
|
+
/**
|
|
14
|
+
* This text is displayed as tooltip for the button that toggles the expanded/collapsed state.
|
|
15
|
+
*/
|
|
16
|
+
togglerText: string;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Adds a button to the table header that can trigger a function to expand/collapse all rows of the table.
|
|
21
|
+
*/
|
|
22
|
+
export function TableExpandHeader ({
|
|
23
|
+
togglerText,
|
|
24
|
+
isExpanded,
|
|
25
|
+
onExpand,
|
|
26
|
+
className,
|
|
27
|
+
enableToggle,
|
|
28
|
+
...otherCarbonTableExpandHeaderProps
|
|
29
|
+
}: TableExpandHeaderProps) {
|
|
30
|
+
|
|
31
|
+
const toggleButton = isExpanded ?
|
|
32
|
+
React.cloneElement(<IconButton name="toggler-rowcollapse" text={togglerText} />, {onClick: onExpand}) :
|
|
33
|
+
React.cloneElement(<IconButton name="toggler-rowexpand" text={togglerText} />, {onClick: onExpand});
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<CarbonTableExpandHeader
|
|
37
|
+
className={
|
|
38
|
+
`${eccgui}-simpletable__headexpander` +
|
|
39
|
+
(!!className ? ` ${className}` : "")
|
|
40
|
+
}
|
|
41
|
+
isExpanded={isExpanded}
|
|
42
|
+
onExpand={onExpand}
|
|
43
|
+
enableToggle={false}
|
|
44
|
+
{...otherCarbonTableExpandHeaderProps}
|
|
45
|
+
>
|
|
46
|
+
{ enableToggle && toggleButton }
|
|
47
|
+
</CarbonTableExpandHeader>
|
|
48
|
+
)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export default TableExpandHeader;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
TableExpandRowProps as CarbonTableExpandRowProps,
|
|
4
|
+
} from "carbon-components-react";
|
|
5
|
+
import {usePrefix as carbonPrefix} from "carbon-components-react/es/index"
|
|
6
|
+
import IconButton from "./../Icon/IconButton";
|
|
7
|
+
import { TableCell } from "./index";
|
|
8
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
9
|
+
|
|
10
|
+
export interface TableExpandRowProps extends Omit<
|
|
11
|
+
CarbonTableExpandRowProps,
|
|
12
|
+
"ariaLabel" | "expandIconDescription"
|
|
13
|
+
>, React.HTMLAttributes<HTMLTableRowElement> {
|
|
14
|
+
/**
|
|
15
|
+
* This text is displayed as tooltip for the button that toggles the expanded/collapsed state.
|
|
16
|
+
*/
|
|
17
|
+
togglerText: string;
|
|
18
|
+
/**
|
|
19
|
+
* Display this row with the styles from a zebra style-enabled table.
|
|
20
|
+
*/
|
|
21
|
+
useZebraStyle?: boolean;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Table row that is suffixed by a cell containing a button to expand/collapse this row.
|
|
26
|
+
*/
|
|
27
|
+
export function TableExpandRow ({
|
|
28
|
+
togglerText,
|
|
29
|
+
isExpanded,
|
|
30
|
+
isSelected,
|
|
31
|
+
useZebraStyle,
|
|
32
|
+
onExpand,
|
|
33
|
+
className,
|
|
34
|
+
children,
|
|
35
|
+
...otherCarbonTableExpandRowProps
|
|
36
|
+
}: TableExpandRowProps) {
|
|
37
|
+
|
|
38
|
+
const carbonClassPrefix = carbonPrefix();
|
|
39
|
+
|
|
40
|
+
const toggleButton = isExpanded ?
|
|
41
|
+
React.cloneElement(<IconButton name="toggler-showless" text={togglerText} />, {onClick: onExpand}) :
|
|
42
|
+
React.cloneElement(<IconButton name="toggler-showmore" text={togglerText} />, {onClick: onExpand});
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<tr
|
|
46
|
+
className={
|
|
47
|
+
`${eccgui}-simpletable__row` +
|
|
48
|
+
` ${carbonClassPrefix}--parent-row` +
|
|
49
|
+
(isExpanded ? ` ${carbonClassPrefix}--expandable-row` : "") +
|
|
50
|
+
(isSelected ? ` ${carbonClassPrefix}--data-table--selected` : "") +
|
|
51
|
+
(useZebraStyle ? ` ${eccgui}-simpletable__row--zebra` : "") +
|
|
52
|
+
(!!className ? ` ${className}` : "")
|
|
53
|
+
}
|
|
54
|
+
data-parent-row={true}
|
|
55
|
+
{...otherCarbonTableExpandRowProps}
|
|
56
|
+
>
|
|
57
|
+
<TableCell
|
|
58
|
+
className={
|
|
59
|
+
`${eccgui}-simpletable__rowexpander` +
|
|
60
|
+
` ${carbonClassPrefix}--table-expand`
|
|
61
|
+
}
|
|
62
|
+
>
|
|
63
|
+
{ toggleButton }
|
|
64
|
+
</TableCell>
|
|
65
|
+
{ children }
|
|
66
|
+
</tr>
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export default TableExpandRow;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import {
|
|
3
|
+
TableRow as CarbonTableRow,
|
|
4
|
+
TableRowProps as CarbonTableRowProps,
|
|
5
|
+
} from "carbon-components-react";
|
|
6
|
+
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
7
|
+
|
|
8
|
+
export interface TableRowProps extends CarbonTableRowProps, React.TdHTMLAttributes<HTMLTableRowElement> {
|
|
9
|
+
/**
|
|
10
|
+
* Display this row with the styles from a zebra style-enabled table.
|
|
11
|
+
*/
|
|
12
|
+
useZebraStyle?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function TableRow({
|
|
16
|
+
className = "",
|
|
17
|
+
children,
|
|
18
|
+
useZebraStyle,
|
|
19
|
+
...otherTableRowProps
|
|
20
|
+
}: TableRowProps) {
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<CarbonTableRow
|
|
24
|
+
className={
|
|
25
|
+
`${eccgui}-simpletable__row` +
|
|
26
|
+
(useZebraStyle ? ` ${eccgui}-simpletable__row--zebra` : "") +
|
|
27
|
+
(className ? ` ${className}` : "")
|
|
28
|
+
}
|
|
29
|
+
{...otherTableRowProps}
|
|
30
|
+
>
|
|
31
|
+
{children}
|
|
32
|
+
</CarbonTableRow>
|
|
33
|
+
) ;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export default TableRow;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from "./TableContainer";
|
|
2
|
+
export * from "./Table";
|
|
3
|
+
export * from "./TableRow";
|
|
4
|
+
export * from "./TableExpandRow";
|
|
5
|
+
export * from "./TableExpandHeader";
|
|
6
|
+
export * from "./TableCell";
|
|
7
|
+
|
|
8
|
+
// TODO, we may wrap to add own classes (currently not necessary)
|
|
9
|
+
export {
|
|
10
|
+
TableHead,
|
|
11
|
+
TableBody,
|
|
12
|
+
TableExpandedRow,
|
|
13
|
+
TableHeader,
|
|
14
|
+
} from "carbon-components-react";
|