@patternfly/react-table 6.3.0-prerelease.9 → 6.3.1-prerelease.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +126 -0
- package/components/package.json +1 -1
- package/deprecated/package.json +1 -1
- package/dist/dynamic/components/Table/package.json +1 -1
- package/dist/dynamic/components/Table/utils/decorators/package.json +1 -1
- package/dist/dynamic/components/Table/utils/package.json +1 -1
- package/dist/dynamic/deprecated/components/Table/base/package.json +1 -1
- package/dist/dynamic/deprecated/components/Table/package.json +1 -1
- package/dist/dynamic/deprecated/components/package.json +1 -1
- package/dist/esm/components/Table/ExpandableRowContent.d.ts +5 -0
- package/dist/esm/components/Table/ExpandableRowContent.d.ts.map +1 -1
- package/dist/esm/components/Table/ExpandableRowContent.js +2 -2
- package/dist/esm/components/Table/ExpandableRowContent.js.map +1 -1
- package/dist/esm/components/Table/Table.d.ts +6 -1
- package/dist/esm/components/Table/Table.d.ts.map +1 -1
- package/dist/esm/components/Table/Table.js +5 -4
- package/dist/esm/components/Table/Table.js.map +1 -1
- package/dist/esm/components/Table/Td.d.ts +2 -0
- package/dist/esm/components/Table/Td.d.ts.map +1 -1
- package/dist/esm/components/Table/Td.js +25 -4
- package/dist/esm/components/Table/Td.js.map +1 -1
- package/dist/esm/components/Table/Tr.d.ts +5 -1
- package/dist/esm/components/Table/Tr.d.ts.map +1 -1
- package/dist/esm/components/Table/Tr.js +3 -3
- package/dist/esm/components/Table/Tr.js.map +1 -1
- package/dist/esm/demos/DashboardHeader.d.ts.map +1 -1
- package/dist/esm/demos/DashboardHeader.js +1 -2
- package/dist/esm/demos/DashboardHeader.js.map +1 -1
- package/dist/esm/demos/sampleData.d.ts.map +1 -1
- package/dist/esm/demos/sampleData.js +359 -360
- package/dist/esm/demos/sampleData.js.map +1 -1
- package/dist/js/components/Table/ExpandableRowContent.d.ts +5 -0
- package/dist/js/components/Table/ExpandableRowContent.d.ts.map +1 -1
- package/dist/js/components/Table/ExpandableRowContent.js +2 -2
- package/dist/js/components/Table/ExpandableRowContent.js.map +1 -1
- package/dist/js/components/Table/Table.d.ts +6 -1
- package/dist/js/components/Table/Table.d.ts.map +1 -1
- package/dist/js/components/Table/Table.js +5 -4
- package/dist/js/components/Table/Table.js.map +1 -1
- package/dist/js/components/Table/Td.d.ts +2 -0
- package/dist/js/components/Table/Td.d.ts.map +1 -1
- package/dist/js/components/Table/Td.js +24 -3
- package/dist/js/components/Table/Td.js.map +1 -1
- package/dist/js/components/Table/Tr.d.ts +5 -1
- package/dist/js/components/Table/Tr.d.ts.map +1 -1
- package/dist/js/components/Table/Tr.js +3 -3
- package/dist/js/components/Table/Tr.js.map +1 -1
- package/dist/js/demos/DashboardHeader.d.ts.map +1 -1
- package/dist/js/demos/DashboardHeader.js +1 -2
- package/dist/js/demos/DashboardHeader.js.map +1 -1
- package/dist/js/demos/sampleData.d.ts.map +1 -1
- package/dist/js/demos/sampleData.js +359 -360
- package/dist/js/demos/sampleData.js.map +1 -1
- package/dist/umd/assets/{output-PMQiOdP-.css → output-CKjCu3-7.css} +3852 -3434
- package/dist/umd/react-table.min.js +2 -2
- package/package.json +6 -6
- package/src/components/Table/ExpandableRowContent.tsx +7 -1
- package/src/components/Table/Table.tsx +12 -4
- package/src/components/Table/Td.tsx +41 -2
- package/src/components/Table/Tr.tsx +9 -3
- package/src/components/Table/__tests__/ExpandableRowContent.test.tsx +39 -0
- package/src/components/Table/__tests__/Table.test.tsx +62 -0
- package/src/components/Table/__tests__/Td.test.tsx +87 -0
- package/src/components/Table/__tests__/Tr.test.tsx +79 -0
- package/src/components/Table/__tests__/__snapshots__/ExpandableRowContent.test.tsx.snap +11 -0
- package/src/components/Table/__tests__/__snapshots__/Table.test.tsx.snap +13 -0
- package/src/components/Table/__tests__/__snapshots__/Td.test.tsx.snap +33 -0
- package/src/components/Table/__tests__/__snapshots__/Tr.test.tsx.snap +35 -0
- package/src/components/Table/examples/Table.md +12 -6
- package/src/components/Table/examples/TableActions.tsx +1 -1
- package/src/components/Table/examples/TableCompoundExpandable.tsx +23 -21
- package/src/components/Table/examples/TableExpandable.tsx +7 -2
- package/src/components/Table/examples/TableMisc.tsx +0 -1
- package/src/components/Table/examples/TableNestedExpandable.tsx +2 -2
- package/src/components/Table/examples/TableNestedTableExpandable.tsx +2 -2
- package/src/components/Table/examples/TableStripedExpandable.tsx +8 -2
- package/src/demos/DashboardHeader.tsx +2 -5
- package/src/demos/examples/TableCompoundExpansion.tsx +87 -84
- package/src/demos/examples/TableExpandCollapseAll.tsx +2 -2
- package/src/demos/examples/TableSortableResponsive.tsx +5 -5
- package/src/demos/sampleData.tsx +359 -361
- package/src/deprecated/components/Table/examples/LegacyTableMisc.tsx +0 -1
|
@@ -4,7 +4,6 @@ import { Table, Thead, Tr, Th, Tbody, Td, TdProps, ExpandableRowContent } from '
|
|
|
4
4
|
import CodeBranchIcon from '@patternfly/react-icons/dist/esm/icons/code-branch-icon';
|
|
5
5
|
import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
6
6
|
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
7
|
-
import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
|
|
8
7
|
|
|
9
8
|
interface Repository {
|
|
10
9
|
name: string;
|
|
@@ -59,7 +58,7 @@ export const TableCompoundExpandable: React.FunctionComponent = () => {
|
|
|
59
58
|
});
|
|
60
59
|
|
|
61
60
|
return (
|
|
62
|
-
<Table aria-label="Compound expandable table">
|
|
61
|
+
<Table aria-label="Compound expandable table" isExpandable hasAnimations>
|
|
63
62
|
<Thead>
|
|
64
63
|
<Tr>
|
|
65
64
|
<Th>{columnNames.name}</Th>
|
|
@@ -75,7 +74,7 @@ export const TableCompoundExpandable: React.FunctionComponent = () => {
|
|
|
75
74
|
const isRowExpanded = !!expandedCellKey;
|
|
76
75
|
return (
|
|
77
76
|
<Tbody key={repo.name} isExpanded={isRowExpanded}>
|
|
78
|
-
<Tr isControlRow>
|
|
77
|
+
<Tr isContentExpanded={isRowExpanded} isControlRow>
|
|
79
78
|
<Td width={25} dataLabel={columnNames.name} component="th">
|
|
80
79
|
<a href="#">{repo.name}</a>
|
|
81
80
|
</Td>
|
|
@@ -107,24 +106,27 @@ export const TableCompoundExpandable: React.FunctionComponent = () => {
|
|
|
107
106
|
<a href="#">Open in GitHub</a>
|
|
108
107
|
</Td>
|
|
109
108
|
</Tr>
|
|
110
|
-
{
|
|
111
|
-
<
|
|
112
|
-
<
|
|
113
|
-
<
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
109
|
+
<Tr isExpanded={columnNames[expandedCellKey] === columnNames.branches}>
|
|
110
|
+
<Td dataLabel={columnNames[expandedCellKey]} colSpan={6}>
|
|
111
|
+
<ExpandableRowContent>
|
|
112
|
+
<div>Expanded content for {repo.name}: branches goes here!</div>
|
|
113
|
+
</ExpandableRowContent>
|
|
114
|
+
</Td>
|
|
115
|
+
</Tr>
|
|
116
|
+
<Tr isExpanded={columnNames[expandedCellKey] === columnNames.prs}>
|
|
117
|
+
<Td dataLabel={columnNames[expandedCellKey]} colSpan={6}>
|
|
118
|
+
<ExpandableRowContent>
|
|
119
|
+
<div>Expanded content for {repo.name}: prs goes here!</div>
|
|
120
|
+
</ExpandableRowContent>
|
|
121
|
+
</Td>
|
|
122
|
+
</Tr>
|
|
123
|
+
<Tr isExpanded={columnNames[expandedCellKey] === columnNames.workspaces}>
|
|
124
|
+
<Td dataLabel={columnNames[expandedCellKey]} colSpan={6}>
|
|
125
|
+
<ExpandableRowContent>
|
|
126
|
+
<div>Expanded content for {repo.name}: workspaces goes here!</div>
|
|
127
|
+
</ExpandableRowContent>
|
|
128
|
+
</Td>
|
|
129
|
+
</Tr>
|
|
128
130
|
</Tbody>
|
|
129
131
|
);
|
|
130
132
|
})}
|
|
@@ -116,7 +116,12 @@ export const TableExpandable: React.FunctionComponent = () => {
|
|
|
116
116
|
id="toggle-compact"
|
|
117
117
|
name="toggle-compact"
|
|
118
118
|
/>
|
|
119
|
-
<Table
|
|
119
|
+
<Table
|
|
120
|
+
isExpandable
|
|
121
|
+
hasAnimations
|
|
122
|
+
aria-label="Expandable table"
|
|
123
|
+
variant={isExampleCompact ? 'compact' : undefined}
|
|
124
|
+
>
|
|
120
125
|
<Thead>
|
|
121
126
|
<Tr>
|
|
122
127
|
<Th screenReaderText="Row expansion" />
|
|
@@ -152,7 +157,7 @@ export const TableExpandable: React.FunctionComponent = () => {
|
|
|
152
157
|
}
|
|
153
158
|
return (
|
|
154
159
|
<Tbody key={repo.name} isExpanded={isRepoExpanded(repo)}>
|
|
155
|
-
<Tr>
|
|
160
|
+
<Tr isContentExpanded={isRepoExpanded(repo)}>
|
|
156
161
|
<Td
|
|
157
162
|
expand={
|
|
158
163
|
repo.details
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Table, Thead, Tr, Th, Tbody, Td } from '@patternfly/react-table';
|
|
2
|
-
/* eslint-disable camelcase */
|
|
3
2
|
import t_global_background_color_secondary_default from '@patternfly/react-tokens/dist/esm/t_global_background_color_secondary_default';
|
|
4
3
|
|
|
5
4
|
interface Repository {
|
|
@@ -61,7 +61,7 @@ export const TableNestedExpandable: React.FunctionComponent = () => {
|
|
|
61
61
|
|
|
62
62
|
return (
|
|
63
63
|
<InnerScrollContainer>
|
|
64
|
-
<Table aria-label="Nested column headers with expandable rows table" gridBreakPoint="">
|
|
64
|
+
<Table isExpandable hasAnimations aria-label="Nested column headers with expandable rows table" gridBreakPoint="">
|
|
65
65
|
<Thead hasNestedHeader>
|
|
66
66
|
<Tr>
|
|
67
67
|
<Th screenReaderText="Row expansion" rowSpan={2} />
|
|
@@ -85,7 +85,7 @@ export const TableNestedExpandable: React.FunctionComponent = () => {
|
|
|
85
85
|
</Thead>
|
|
86
86
|
{teams.map((team, rowIndex) => (
|
|
87
87
|
<Tbody key={team.name} isExpanded={isTeamExpanded(team)}>
|
|
88
|
-
<Tr>
|
|
88
|
+
<Tr isContentExpanded={isTeamExpanded(team)}>
|
|
89
89
|
<Td
|
|
90
90
|
expand={{
|
|
91
91
|
rowIndex,
|
|
@@ -128,7 +128,7 @@ export const TableExpandable: React.FunctionComponent = () => {
|
|
|
128
128
|
];
|
|
129
129
|
|
|
130
130
|
return (
|
|
131
|
-
<Table aria-label="Simple table">
|
|
131
|
+
<Table isExpandable hasAnimations aria-label="Simple table">
|
|
132
132
|
<Thead>
|
|
133
133
|
<Tr>
|
|
134
134
|
<Th screenReaderText="Row expansion" />
|
|
@@ -141,7 +141,7 @@ export const TableExpandable: React.FunctionComponent = () => {
|
|
|
141
141
|
</Thead>
|
|
142
142
|
{repositories.map((repo, rowIndex) => (
|
|
143
143
|
<Tbody key={repo.name} isExpanded={isRepoExpanded(repo)}>
|
|
144
|
-
<Tr>
|
|
144
|
+
<Tr isContentExpanded={isRepoExpanded(repo)}>
|
|
145
145
|
<Td
|
|
146
146
|
expand={
|
|
147
147
|
repo.nestedComponent
|
|
@@ -112,7 +112,13 @@ export const TableStripedExpandable: React.FunctionComponent = () => {
|
|
|
112
112
|
id="toggle-compact-striped"
|
|
113
113
|
name="toggle-compact-striped"
|
|
114
114
|
/>
|
|
115
|
-
<Table
|
|
115
|
+
<Table
|
|
116
|
+
aria-label="Expandable table"
|
|
117
|
+
variant={isExampleCompact ? 'compact' : undefined}
|
|
118
|
+
isStriped
|
|
119
|
+
isExpandable
|
|
120
|
+
hasAnimations
|
|
121
|
+
>
|
|
116
122
|
<Thead>
|
|
117
123
|
<Tr>
|
|
118
124
|
<Th screenReaderText="Row expansion" />
|
|
@@ -148,7 +154,7 @@ export const TableStripedExpandable: React.FunctionComponent = () => {
|
|
|
148
154
|
}
|
|
149
155
|
return (
|
|
150
156
|
<Tbody key={repo.name} isExpanded={isRepoExpanded(repo)}>
|
|
151
|
-
<Tr>
|
|
157
|
+
<Tr isContentExpanded={isRepoExpanded(repo)}>
|
|
152
158
|
<Td
|
|
153
159
|
expand={
|
|
154
160
|
repo.details
|
|
@@ -23,7 +23,6 @@ import {
|
|
|
23
23
|
ToolbarItem,
|
|
24
24
|
PageToggleButton
|
|
25
25
|
} from '@patternfly/react-core';
|
|
26
|
-
import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
27
26
|
import CogIcon from '@patternfly/react-icons/dist/esm/icons/cog-icon';
|
|
28
27
|
import HelpIcon from '@patternfly/react-icons/dist/esm/icons/help-icon';
|
|
29
28
|
import QuestionCircleIcon from '@patternfly/react-icons/dist/esm/icons/question-circle-icon';
|
|
@@ -132,9 +131,7 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
|
|
|
132
131
|
<Masthead>
|
|
133
132
|
<MastheadMain>
|
|
134
133
|
<MastheadToggle>
|
|
135
|
-
<PageToggleButton
|
|
136
|
-
<BarsIcon />
|
|
137
|
-
</PageToggleButton>
|
|
134
|
+
<PageToggleButton isHamburgerButton aria-label="Global navigation" />
|
|
138
135
|
</MastheadToggle>
|
|
139
136
|
<MastheadBrand>
|
|
140
137
|
<MastheadLogo>{patternflyLogo}</MastheadLogo>
|
|
@@ -159,7 +156,7 @@ export const DashboardHeader: React.FC<DashboardHeaderProps> = ({ notificationBa
|
|
|
159
156
|
)}
|
|
160
157
|
<ToolbarGroup variant="action-group-plain" visibility={{ default: 'hidden', lg: 'visible' }}>
|
|
161
158
|
<ToolbarItem>
|
|
162
|
-
<Button aria-label="Settings" variant=
|
|
159
|
+
<Button aria-label="Settings" isSettings variant="plain" />
|
|
163
160
|
</ToolbarItem>
|
|
164
161
|
<ToolbarItem>
|
|
165
162
|
<Button aria-label="Help" variant={ButtonVariant.plain} icon={<QuestionCircleIcon />} />
|
|
@@ -2,7 +2,6 @@ import { useState } from 'react';
|
|
|
2
2
|
import { ActionsColumn, Table, Thead, Tr, Th, Tbody, Td, ExpandableRowContent } from '@patternfly/react-table';
|
|
3
3
|
import {
|
|
4
4
|
Button,
|
|
5
|
-
Card,
|
|
6
5
|
Flex,
|
|
7
6
|
FlexItem,
|
|
8
7
|
MenuToggle,
|
|
@@ -22,7 +21,6 @@ import CodeIcon from '@patternfly/react-icons/dist/esm/icons/code-icon';
|
|
|
22
21
|
import CubeIcon from '@patternfly/react-icons/dist/esm/icons/cube-icon';
|
|
23
22
|
import { DashboardWrapper } from '@patternfly/react-table/dist/esm/demos/DashboardWrapper';
|
|
24
23
|
import FilterIcon from '@patternfly/react-icons/dist/esm/icons/filter-icon';
|
|
25
|
-
import spacing from '@patternfly/react-styles/css/utilities/Spacing/spacing';
|
|
26
24
|
|
|
27
25
|
export const TableCompoundExpansion: React.FunctionComponent = () => {
|
|
28
26
|
// In real usage, this data would come from some external source like an API via props.
|
|
@@ -200,88 +198,93 @@ export const TableCompoundExpansion: React.FunctionComponent = () => {
|
|
|
200
198
|
return (
|
|
201
199
|
<DashboardWrapper hasPageTemplateTitle>
|
|
202
200
|
<PageSection padding={{ default: 'noPadding', xl: 'padding' }} aria-label="Compound expandable table data ">
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
<
|
|
206
|
-
<
|
|
207
|
-
<
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
<
|
|
222
|
-
<
|
|
223
|
-
<
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
>
|
|
230
|
-
<
|
|
231
|
-
<
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
<
|
|
238
|
-
<
|
|
239
|
-
<
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
>
|
|
249
|
-
<
|
|
250
|
-
<
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
<
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
<
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
201
|
+
{tableToolbar}
|
|
202
|
+
<Table isExpandable hasAnimations aria-label="Compound expandable table">
|
|
203
|
+
<Thead>
|
|
204
|
+
<Tr>
|
|
205
|
+
<Th>{columnNames.name}</Th>
|
|
206
|
+
<Th>{columnNames.branches}</Th>
|
|
207
|
+
<Th>{columnNames.prs}</Th>
|
|
208
|
+
<Th>{columnNames.workspaces}</Th>
|
|
209
|
+
<Th>{columnNames.lastCommit}</Th>
|
|
210
|
+
<Th screenReaderText="URL" />
|
|
211
|
+
<Th screenReaderText="Actions" />
|
|
212
|
+
</Tr>
|
|
213
|
+
</Thead>
|
|
214
|
+
{repositories.map((repo, rowIndex) => {
|
|
215
|
+
const expandedCellKey = expandedCells[repo.name];
|
|
216
|
+
const isRowExpanded = !!expandedCellKey;
|
|
217
|
+
return (
|
|
218
|
+
<Tbody key={repo.name} isExpanded={isRowExpanded}>
|
|
219
|
+
<Tr isContentExpanded={isRowExpanded} isControlRow>
|
|
220
|
+
<Td dataLabel={columnNames.name} component="th">
|
|
221
|
+
<a href="#">{repo.name}</a>
|
|
222
|
+
</Td>
|
|
223
|
+
<Td
|
|
224
|
+
dataLabel={columnNames.branches}
|
|
225
|
+
compoundExpand={compoundExpandParams(repo, 'branches', rowIndex, 1)}
|
|
226
|
+
>
|
|
227
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
228
|
+
<FlexItem>
|
|
229
|
+
<CodeBranchIcon key="icon" />
|
|
230
|
+
</FlexItem>
|
|
231
|
+
<FlexItem>{repo.branches}</FlexItem>
|
|
232
|
+
</Flex>
|
|
233
|
+
</Td>
|
|
234
|
+
<Td dataLabel={columnNames.prs} compoundExpand={compoundExpandParams(repo, 'prs', rowIndex, 2)}>
|
|
235
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
236
|
+
<FlexItem>
|
|
237
|
+
<CodeIcon key="icon" />
|
|
238
|
+
</FlexItem>
|
|
239
|
+
<FlexItem>{repo.prs}</FlexItem>
|
|
240
|
+
</Flex>{' '}
|
|
241
|
+
</Td>
|
|
242
|
+
<Td
|
|
243
|
+
dataLabel={columnNames.workspaces}
|
|
244
|
+
compoundExpand={compoundExpandParams(repo, 'workspaces', rowIndex, 3)}
|
|
245
|
+
>
|
|
246
|
+
<Flex spaceItems={{ default: 'spaceItemsSm' }}>
|
|
247
|
+
<FlexItem>
|
|
248
|
+
<CubeIcon key="icon" />
|
|
249
|
+
</FlexItem>
|
|
250
|
+
<FlexItem>{repo.workspaces}</FlexItem>
|
|
251
|
+
</Flex>
|
|
252
|
+
</Td>
|
|
253
|
+
<Td dataLabel={columnNames.lastCommit}>{repo.lastCommit}</Td>
|
|
254
|
+
<Td>
|
|
255
|
+
<a href="#">Open in GitHub</a>
|
|
256
|
+
</Td>
|
|
257
|
+
<Td isActionCell>
|
|
258
|
+
<ActionsColumn items={defaultActions()} />
|
|
259
|
+
</Td>
|
|
260
|
+
</Tr>
|
|
261
|
+
|
|
262
|
+
<Tr isExpanded={isRowExpanded && columnNames[expandedCellKey] === columnNames.branches}>
|
|
263
|
+
<Td dataLabel={columnNames[expandedCellKey]} noPadding colSpan={7}>
|
|
264
|
+
<ExpandableRowContent hasNoBackground>
|
|
265
|
+
<NestedItemsTable />
|
|
266
|
+
</ExpandableRowContent>
|
|
267
|
+
</Td>
|
|
268
|
+
</Tr>
|
|
269
|
+
<Tr isExpanded={isRowExpanded && columnNames[expandedCellKey] === columnNames.prs}>
|
|
270
|
+
<Td dataLabel={columnNames[expandedCellKey]} colSpan={7}>
|
|
271
|
+
<ExpandableRowContent>
|
|
272
|
+
<div>Expanded content for {repo.name}: prs goes here!</div>
|
|
273
|
+
</ExpandableRowContent>
|
|
274
|
+
</Td>
|
|
275
|
+
</Tr>
|
|
276
|
+
<Tr isExpanded={isRowExpanded && columnNames[expandedCellKey] === columnNames.workspaces}>
|
|
277
|
+
<Td dataLabel={columnNames[expandedCellKey]} colSpan={7}>
|
|
278
|
+
<ExpandableRowContent>
|
|
279
|
+
<div>Expanded content for {repo.name}: workspaces goes here!</div>
|
|
280
|
+
</ExpandableRowContent>
|
|
281
|
+
</Td>
|
|
282
|
+
</Tr>
|
|
283
|
+
</Tbody>
|
|
284
|
+
);
|
|
285
|
+
})}
|
|
286
|
+
</Table>
|
|
287
|
+
{renderPagination('bottom', false)}
|
|
285
288
|
</PageSection>
|
|
286
289
|
</DashboardWrapper>
|
|
287
290
|
);
|
|
@@ -156,7 +156,7 @@ export const TableExpandCollapseAll: React.FunctionComponent = () => {
|
|
|
156
156
|
aria-label="Collapsible table data"
|
|
157
157
|
>
|
|
158
158
|
<Card component="div">
|
|
159
|
-
<Table aria-label="Collapsible table">
|
|
159
|
+
<Table isExpandable hasAnimations aria-label="Collapsible table">
|
|
160
160
|
<Thead>
|
|
161
161
|
<Tr>
|
|
162
162
|
<Th
|
|
@@ -175,7 +175,7 @@ export const TableExpandCollapseAll: React.FunctionComponent = () => {
|
|
|
175
175
|
|
|
176
176
|
{serverData.map((server, serverIndex) => (
|
|
177
177
|
<Tbody key={server.name} isExpanded={isServerExpanded(server)}>
|
|
178
|
-
<Tr>
|
|
178
|
+
<Tr isContentExpanded={isServerExpanded(server)}>
|
|
179
179
|
<Td
|
|
180
180
|
expand={
|
|
181
181
|
server.details
|
|
@@ -49,14 +49,14 @@ export const TableSortableResponsive: React.FunctionComponent = () => {
|
|
|
49
49
|
const sortRows = (rows: SampleDataRow[], sortIndex: number, sortDirection: Direction) =>
|
|
50
50
|
[...rows].sort((a, b) => {
|
|
51
51
|
let returnValue = 0;
|
|
52
|
-
if (
|
|
53
|
-
returnValue = 1;
|
|
54
|
-
} else if (typeof Object.values(a)[sortIndex] === 'number') {
|
|
52
|
+
if (typeof Object.values(a)[sortIndex] === 'number') {
|
|
55
53
|
// numeric sort
|
|
56
54
|
returnValue = Object.values(a)[sortIndex] - Object.values(b)[sortIndex];
|
|
57
55
|
} else {
|
|
58
|
-
// string sort
|
|
59
|
-
returnValue = Object.values(a)[sortIndex].localeCompare(Object.values(b)[sortIndex]
|
|
56
|
+
// string sort using natural sort
|
|
57
|
+
returnValue = Object.values(a)[sortIndex].localeCompare(Object.values(b)[sortIndex], undefined, {
|
|
58
|
+
numeric: true
|
|
59
|
+
});
|
|
60
60
|
}
|
|
61
61
|
if (sortDirection === 'desc') {
|
|
62
62
|
return returnValue * -1;
|