@patternfly/react-data-view 6.1.0-prerelease.1 → 7.0.0-prerelease.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/dist/cjs/DataView/DataView.d.ts +12 -0
- package/dist/cjs/DataView/DataView.js +14 -3
- package/dist/cjs/DataViewEventsContext/DataViewEventsContext.d.ts +16 -0
- package/dist/cjs/DataViewEventsContext/DataViewEventsContext.js +62 -0
- package/dist/cjs/DataViewEventsContext/DataViewEventsContext.test.d.ts +1 -0
- package/dist/cjs/DataViewEventsContext/DataViewEventsContext.test.js +72 -0
- package/dist/cjs/DataViewEventsContext/index.d.ts +2 -0
- package/dist/cjs/DataViewEventsContext/index.js +23 -0
- package/dist/cjs/DataViewTable/DataViewTable.d.ts +41 -0
- package/dist/cjs/DataViewTable/DataViewTable.js +18 -0
- package/dist/cjs/DataViewTable/DataViewTable.test.d.ts +1 -0
- package/dist/cjs/DataViewTable/DataViewTable.test.js +57 -0
- package/dist/cjs/DataViewTable/index.d.ts +2 -0
- package/dist/cjs/DataViewTable/index.js +23 -0
- package/dist/cjs/DataViewTableBasic/DataViewTableBasic.d.ts +18 -0
- package/dist/cjs/DataViewTableBasic/DataViewTableBasic.js +71 -0
- package/dist/cjs/DataViewTableBasic/DataViewTableBasic.test.d.ts +1 -0
- package/dist/cjs/DataViewTableBasic/DataViewTableBasic.test.js +43 -0
- package/dist/cjs/DataViewTableBasic/index.d.ts +2 -0
- package/dist/cjs/DataViewTableBasic/index.js +23 -0
- package/dist/cjs/DataViewTableHead/DataViewTableHead.d.ts +13 -0
- package/dist/cjs/DataViewTableHead/DataViewTableHead.js +57 -0
- package/dist/cjs/DataViewTableHead/DataViewTableHead.test.d.ts +1 -0
- package/dist/cjs/DataViewTableHead/DataViewTableHead.test.js +36 -0
- package/dist/cjs/DataViewTableHead/index.d.ts +2 -0
- package/dist/cjs/DataViewTableHead/index.js +23 -0
- package/dist/cjs/DataViewTableTree/DataViewTableTree.d.ts +24 -0
- package/dist/cjs/DataViewTableTree/DataViewTableTree.js +132 -0
- package/dist/cjs/DataViewTableTree/DataViewTableTree.test.d.ts +1 -0
- package/dist/cjs/DataViewTableTree/DataViewTableTree.test.js +90 -0
- package/dist/cjs/DataViewTableTree/index.d.ts +2 -0
- package/dist/cjs/DataViewTableTree/index.js +23 -0
- package/dist/cjs/DataViewToolbar/DataViewToolbar.d.ts +2 -0
- package/dist/cjs/DataViewToolbar/DataViewToolbar.js +2 -1
- package/dist/cjs/Hooks/pagination.d.ts +13 -1
- package/dist/cjs/Hooks/pagination.js +36 -4
- package/dist/cjs/Hooks/pagination.test.js +1 -1
- package/dist/cjs/Hooks/selection.d.ts +3 -3
- package/dist/cjs/Hooks/selection.js +4 -6
- package/dist/cjs/Hooks/selection.test.js +4 -4
- package/dist/cjs/InternalContext/InternalContext.d.ts +25 -0
- package/dist/cjs/InternalContext/InternalContext.js +40 -0
- package/dist/cjs/InternalContext/InternalContext.test.d.ts +1 -0
- package/dist/cjs/InternalContext/InternalContext.test.js +56 -0
- package/dist/cjs/InternalContext/index.d.ts +2 -0
- package/dist/cjs/InternalContext/index.js +23 -0
- package/dist/cjs/index.d.ts +12 -0
- package/dist/cjs/index.js +20 -2
- package/dist/dynamic/DataViewEventsContext/package.json +1 -0
- package/dist/dynamic/DataViewTable/package.json +1 -0
- package/dist/dynamic/DataViewTableBasic/package.json +1 -0
- package/dist/dynamic/DataViewTableHead/package.json +1 -0
- package/dist/dynamic/DataViewTableTree/package.json +1 -0
- package/dist/dynamic/InternalContext/package.json +1 -0
- package/dist/esm/DataView/DataView.d.ts +12 -0
- package/dist/esm/DataView/DataView.js +13 -2
- package/dist/esm/DataViewEventsContext/DataViewEventsContext.d.ts +16 -0
- package/dist/esm/DataViewEventsContext/DataViewEventsContext.js +34 -0
- package/dist/esm/DataViewEventsContext/DataViewEventsContext.test.d.ts +1 -0
- package/dist/esm/DataViewEventsContext/DataViewEventsContext.test.js +67 -0
- package/dist/esm/DataViewEventsContext/index.d.ts +2 -0
- package/dist/esm/DataViewEventsContext/index.js +2 -0
- package/dist/esm/DataViewTable/DataViewTable.d.ts +41 -0
- package/dist/esm/DataViewTable/DataViewTable.js +8 -0
- package/dist/esm/DataViewTable/DataViewTable.test.d.ts +1 -0
- package/dist/esm/DataViewTable/DataViewTable.test.js +52 -0
- package/dist/esm/DataViewTable/index.d.ts +2 -0
- package/dist/esm/DataViewTable/index.js +2 -0
- package/dist/esm/DataViewTableBasic/DataViewTableBasic.d.ts +18 -0
- package/dist/esm/DataViewTableBasic/DataViewTableBasic.js +44 -0
- package/dist/esm/DataViewTableBasic/DataViewTableBasic.test.d.ts +1 -0
- package/dist/esm/DataViewTableBasic/DataViewTableBasic.test.js +38 -0
- package/dist/esm/DataViewTableBasic/index.d.ts +2 -0
- package/dist/esm/DataViewTableBasic/index.js +2 -0
- package/dist/esm/DataViewTableHead/DataViewTableHead.d.ts +13 -0
- package/dist/esm/DataViewTableHead/DataViewTableHead.js +30 -0
- package/dist/esm/DataViewTableHead/DataViewTableHead.test.d.ts +1 -0
- package/dist/esm/DataViewTableHead/DataViewTableHead.test.js +31 -0
- package/dist/esm/DataViewTableHead/index.d.ts +2 -0
- package/dist/esm/DataViewTableHead/index.js +2 -0
- package/dist/esm/DataViewTableTree/DataViewTableTree.d.ts +24 -0
- package/dist/esm/DataViewTableTree/DataViewTableTree.js +105 -0
- package/dist/esm/DataViewTableTree/DataViewTableTree.test.d.ts +1 -0
- package/dist/esm/DataViewTableTree/DataViewTableTree.test.js +85 -0
- package/dist/esm/DataViewTableTree/index.d.ts +2 -0
- package/dist/esm/DataViewTableTree/index.js +2 -0
- package/dist/esm/DataViewToolbar/DataViewToolbar.d.ts +2 -0
- package/dist/esm/DataViewToolbar/DataViewToolbar.js +2 -1
- package/dist/esm/Hooks/pagination.d.ts +13 -1
- package/dist/esm/Hooks/pagination.js +36 -4
- package/dist/esm/Hooks/pagination.test.js +1 -1
- package/dist/esm/Hooks/selection.d.ts +3 -3
- package/dist/esm/Hooks/selection.js +4 -6
- package/dist/esm/Hooks/selection.test.js +4 -4
- package/dist/esm/InternalContext/InternalContext.d.ts +25 -0
- package/dist/esm/InternalContext/InternalContext.js +12 -0
- package/dist/esm/InternalContext/InternalContext.test.d.ts +1 -0
- package/dist/esm/InternalContext/InternalContext.test.js +51 -0
- package/dist/esm/InternalContext/index.d.ts +2 -0
- package/dist/esm/InternalContext/index.js +2 -0
- package/dist/esm/index.d.ts +12 -0
- package/dist/esm/index.js +12 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +9 -9
- package/patternfly-docs/content/extensions/data-view/examples/Components/Components.md +80 -5
- package/patternfly-docs/content/extensions/data-view/examples/Components/DataViewTableEmptyExample.tsx +57 -0
- package/patternfly-docs/content/extensions/data-view/examples/Components/DataViewTableErrorExample.tsx +45 -0
- package/patternfly-docs/content/extensions/data-view/examples/Components/DataViewTableExample.tsx +67 -0
- package/patternfly-docs/content/extensions/data-view/examples/Components/DataViewTableLoadingExample.tsx +27 -0
- package/patternfly-docs/content/extensions/data-view/examples/Components/DataViewTableTreeExample.tsx +71 -0
- package/patternfly-docs/content/extensions/data-view/examples/Components/DataViewToolbarActionsExample.tsx +27 -0
- package/patternfly-docs/content/extensions/data-view/examples/Components/DataViewToolbarExample.tsx +4 -4
- package/patternfly-docs/content/extensions/data-view/examples/EventsContext/EventsContext.md +32 -0
- package/patternfly-docs/content/extensions/data-view/examples/EventsContext/EventsExample.tsx +108 -0
- package/patternfly-docs/content/extensions/data-view/examples/Functionality/Functionality.md +14 -6
- package/patternfly-docs/content/extensions/data-view/examples/Functionality/PaginationExample.tsx +28 -37
- package/patternfly-docs/content/extensions/data-view/examples/Functionality/SelectionExample.tsx +15 -46
- package/patternfly-docs/content/extensions/data-view/examples/Layout/Layout.md +2 -1
- package/patternfly-docs/content/extensions/data-view/examples/Layout/PredefinedLayoutExample.tsx +20 -51
- package/patternfly-docs/pages/index.js +1 -1
- package/src/DataView/DataView.tsx +25 -3
- package/src/DataView/__snapshots__/DataView.test.tsx.snap +2 -2
- package/src/DataViewEventsContext/DataViewEventsContext.test.tsx +105 -0
- package/src/DataViewEventsContext/DataViewEventsContext.tsx +70 -0
- package/src/DataViewEventsContext/index.ts +2 -0
- package/src/DataViewTable/DataViewTable.test.tsx +80 -0
- package/src/DataViewTable/DataViewTable.tsx +37 -0
- package/src/DataViewTable/__snapshots__/DataViewTable.test.tsx.snap +1042 -0
- package/src/DataViewTable/index.ts +2 -0
- package/src/DataViewTableBasic/DataViewTableBasic.test.tsx +65 -0
- package/src/DataViewTableBasic/DataViewTableBasic.tsx +82 -0
- package/src/DataViewTableBasic/__snapshots__/DataViewTableBasic.test.tsx.snap +555 -0
- package/src/DataViewTableBasic/index.ts +2 -0
- package/src/DataViewTableHead/DataViewTableHead.test.tsx +50 -0
- package/src/DataViewTableHead/DataViewTableHead.tsx +53 -0
- package/src/DataViewTableHead/__snapshots__/DataViewTableHead.test.tsx.snap +227 -0
- package/src/DataViewTableHead/index.ts +2 -0
- package/src/DataViewTableTree/DataViewTableTree.test.tsx +113 -0
- package/src/DataViewTableTree/DataViewTableTree.tsx +164 -0
- package/src/DataViewTableTree/__snapshots__/DataViewTableTree.test.tsx.snap +1200 -0
- package/src/DataViewTableTree/index.ts +2 -0
- package/src/DataViewToolbar/DataViewToolbar.tsx +9 -2
- package/src/DataViewToolbar/__snapshots__/DataViewToolbar.test.tsx.snap +8 -8
- package/src/Hooks/pagination.test.tsx +1 -1
- package/src/Hooks/pagination.ts +68 -12
- package/src/Hooks/selection.test.tsx +5 -5
- package/src/Hooks/selection.ts +6 -7
- package/src/InternalContext/InternalContext.test.tsx +89 -0
- package/src/InternalContext/InternalContext.tsx +51 -0
- package/src/InternalContext/index.ts +2 -0
- package/src/index.ts +18 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render } from '@testing-library/react';
|
|
3
|
+
import { DataView } from '../DataView';
|
|
4
|
+
import { DataViewTableBasic } from './DataViewTableBasic';
|
|
5
|
+
|
|
6
|
+
interface Repository {
|
|
7
|
+
name: string;
|
|
8
|
+
branches: string | null;
|
|
9
|
+
prs: string | null;
|
|
10
|
+
workspaces: string;
|
|
11
|
+
lastCommit: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const repositories: Repository[] = [
|
|
15
|
+
{ name: 'Repository one', branches: 'Branch one', prs: 'Pull request one', workspaces: 'Workspace one', lastCommit: 'Timestamp one' },
|
|
16
|
+
{ name: 'Repository two', branches: 'Branch two', prs: 'Pull request two', workspaces: 'Workspace two', lastCommit: 'Timestamp two' },
|
|
17
|
+
{ name: 'Repository three', branches: 'Branch three', prs: 'Pull request three', workspaces: 'Workspace three', lastCommit: 'Timestamp three' },
|
|
18
|
+
{ name: 'Repository four', branches: 'Branch four', prs: 'Pull request four', workspaces: 'Workspace four', lastCommit: 'Timestamp four' },
|
|
19
|
+
{ name: 'Repository five', branches: 'Branch five', prs: 'Pull request five', workspaces: 'Workspace five', lastCommit: 'Timestamp five' },
|
|
20
|
+
{ name: 'Repository six', branches: 'Branch six', prs: 'Pull request six', workspaces: 'Workspace six', lastCommit: 'Timestamp six' }
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
const rows = repositories.map(repo => ({
|
|
24
|
+
row: Object.values(repo),
|
|
25
|
+
}));
|
|
26
|
+
|
|
27
|
+
const columns = [ 'Repositories', 'Branches', 'Pull requests', 'Workspaces', 'Last commit' ];
|
|
28
|
+
|
|
29
|
+
const ouiaId = 'TableExample';
|
|
30
|
+
|
|
31
|
+
describe('DataViewTable component', () => {
|
|
32
|
+
test('should render correctly', () => {
|
|
33
|
+
const { container } = render(
|
|
34
|
+
<DataViewTableBasic aria-label='Repositories table' ouiaId={ouiaId} columns={columns} rows={rows} />
|
|
35
|
+
);
|
|
36
|
+
expect(container).toMatchSnapshot();
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('should render with an empty state', () => {
|
|
40
|
+
const { container } = render(
|
|
41
|
+
<DataView activeState="empty">
|
|
42
|
+
<DataViewTableBasic aria-label='Repositories table' ouiaId={ouiaId} columns={columns} bodyStates={{ empty: "No data found" }} rows={[]} />
|
|
43
|
+
</DataView>
|
|
44
|
+
);
|
|
45
|
+
expect(container).toMatchSnapshot();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
test('should render with an error state', () => {
|
|
49
|
+
const { container } = render(
|
|
50
|
+
<DataView activeState="error">
|
|
51
|
+
<DataViewTableBasic aria-label='Repositories table' ouiaId={ouiaId} columns={columns} bodyStates={{ error: "Some error" }} rows={[]} />
|
|
52
|
+
</DataView>
|
|
53
|
+
);
|
|
54
|
+
expect(container).toMatchSnapshot();
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test('should render with a loading state', () => {
|
|
58
|
+
const { container } = render(
|
|
59
|
+
<DataView activeState="loading">
|
|
60
|
+
<DataViewTableBasic aria-label='Repositories table' ouiaId={ouiaId} columns={columns} bodyStates={{ loading: "Data is loading" }} rows={[]} />
|
|
61
|
+
</DataView>
|
|
62
|
+
);
|
|
63
|
+
expect(container).toMatchSnapshot();
|
|
64
|
+
});
|
|
65
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Table,
|
|
4
|
+
TableProps,
|
|
5
|
+
Tbody,
|
|
6
|
+
Td,
|
|
7
|
+
Tr,
|
|
8
|
+
} from '@patternfly/react-table';
|
|
9
|
+
import { useInternalContext } from '../InternalContext';
|
|
10
|
+
import { DataViewTableHead } from '../DataViewTableHead';
|
|
11
|
+
import { DataViewTh, DataViewTr, isDataViewTdObject, isDataViewTrObject } from '../DataViewTable';
|
|
12
|
+
import { DataViewState } from '../DataView/DataView';
|
|
13
|
+
|
|
14
|
+
export interface DataViewTableBasicProps extends Omit<TableProps, 'onSelect' | 'rows'> {
|
|
15
|
+
/** Columns definition */
|
|
16
|
+
columns: DataViewTh[];
|
|
17
|
+
/** Current page rows */
|
|
18
|
+
rows: DataViewTr[];
|
|
19
|
+
/** Table head states to be displayed when active */
|
|
20
|
+
headStates?: Partial<Record<DataViewState | string, React.ReactNode>>
|
|
21
|
+
/** Table body states to be displayed when active */
|
|
22
|
+
bodyStates?: Partial<Record<DataViewState | string, React.ReactNode>>
|
|
23
|
+
/** Custom OUIA ID */
|
|
24
|
+
ouiaId?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const DataViewTableBasic: React.FC<DataViewTableBasicProps> = ({
|
|
28
|
+
columns,
|
|
29
|
+
rows,
|
|
30
|
+
ouiaId = 'DataViewTableBasic',
|
|
31
|
+
headStates,
|
|
32
|
+
bodyStates,
|
|
33
|
+
...props
|
|
34
|
+
}: DataViewTableBasicProps) => {
|
|
35
|
+
const { selection, activeState, isSelectable } = useInternalContext();
|
|
36
|
+
const { onSelect, isSelected, isSelectDisabled } = selection ?? {};
|
|
37
|
+
|
|
38
|
+
const activeHeadState = useMemo(() => activeState ? headStates?.[activeState] : undefined, [ activeState, headStates ]);
|
|
39
|
+
const activeBodyState = useMemo(() => activeState ? bodyStates?.[activeState] : undefined, [ activeState, bodyStates ]);
|
|
40
|
+
|
|
41
|
+
const renderedRows = useMemo(() => rows.map((row, rowIndex) => {
|
|
42
|
+
const rowIsObject = isDataViewTrObject(row);
|
|
43
|
+
return (
|
|
44
|
+
<Tr key={rowIndex} ouiaId={`${ouiaId}-tr-${rowIndex}`} {...(rowIsObject && row?.props)}>
|
|
45
|
+
{isSelectable && (
|
|
46
|
+
<Td
|
|
47
|
+
key={`select-${rowIndex}`}
|
|
48
|
+
select={{
|
|
49
|
+
rowIndex,
|
|
50
|
+
onSelect: (_event, isSelecting) => {
|
|
51
|
+
onSelect?.(isSelecting, rowIsObject ? row : [ row ]);
|
|
52
|
+
},
|
|
53
|
+
isSelected: isSelected?.(row) || false,
|
|
54
|
+
isDisabled: isSelectDisabled?.(row) || false,
|
|
55
|
+
}}
|
|
56
|
+
/>
|
|
57
|
+
)}
|
|
58
|
+
{(rowIsObject ? row.row : row).map((cell, colIndex) => {
|
|
59
|
+
const cellIsObject = isDataViewTdObject(cell);
|
|
60
|
+
return (
|
|
61
|
+
<Td
|
|
62
|
+
key={colIndex}
|
|
63
|
+
{...(cellIsObject && (cell?.props ?? {}))}
|
|
64
|
+
data-ouia-component-id={`${ouiaId}-td-${rowIndex}-${colIndex}`}
|
|
65
|
+
>
|
|
66
|
+
{cellIsObject ? cell.cell : cell}
|
|
67
|
+
</Td>
|
|
68
|
+
);
|
|
69
|
+
})}
|
|
70
|
+
</Tr>
|
|
71
|
+
);
|
|
72
|
+
}), [ rows, isSelectable, isSelected, isSelectDisabled, onSelect, ouiaId ]);
|
|
73
|
+
|
|
74
|
+
return (
|
|
75
|
+
<Table aria-label="Data table" ouiaId={ouiaId} {...props}>
|
|
76
|
+
{ activeHeadState || <DataViewTableHead columns={columns} ouiaId={ouiaId} /> }
|
|
77
|
+
{ activeBodyState || <Tbody>{renderedRows}</Tbody> }
|
|
78
|
+
</Table>
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export default DataViewTableBasic;
|
|
@@ -0,0 +1,555 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`DataViewTable component should render correctly 1`] = `
|
|
4
|
+
<div>
|
|
5
|
+
<table
|
|
6
|
+
aria-label="Repositories table"
|
|
7
|
+
class="pf-v6-c-table pf-m-grid-md"
|
|
8
|
+
data-ouia-component-id="TableExample"
|
|
9
|
+
data-ouia-component-type="PF6/Table"
|
|
10
|
+
data-ouia-safe="true"
|
|
11
|
+
role="grid"
|
|
12
|
+
>
|
|
13
|
+
<thead
|
|
14
|
+
class="pf-v6-c-table__thead"
|
|
15
|
+
data-ouia-component-id="TableExample-thead"
|
|
16
|
+
>
|
|
17
|
+
<tr
|
|
18
|
+
class="pf-v6-c-table__tr"
|
|
19
|
+
data-ouia-component-id="TableExample-tr-head"
|
|
20
|
+
data-ouia-component-type="PF6/TableRow"
|
|
21
|
+
data-ouia-safe="true"
|
|
22
|
+
>
|
|
23
|
+
<th
|
|
24
|
+
class="pf-v6-c-table__th"
|
|
25
|
+
data-ouia-component-id="TableExample-th-0"
|
|
26
|
+
scope="col"
|
|
27
|
+
tabindex="-1"
|
|
28
|
+
>
|
|
29
|
+
Repositories
|
|
30
|
+
</th>
|
|
31
|
+
<th
|
|
32
|
+
class="pf-v6-c-table__th"
|
|
33
|
+
data-ouia-component-id="TableExample-th-1"
|
|
34
|
+
scope="col"
|
|
35
|
+
tabindex="-1"
|
|
36
|
+
>
|
|
37
|
+
Branches
|
|
38
|
+
</th>
|
|
39
|
+
<th
|
|
40
|
+
class="pf-v6-c-table__th"
|
|
41
|
+
data-ouia-component-id="TableExample-th-2"
|
|
42
|
+
scope="col"
|
|
43
|
+
tabindex="-1"
|
|
44
|
+
>
|
|
45
|
+
Pull requests
|
|
46
|
+
</th>
|
|
47
|
+
<th
|
|
48
|
+
class="pf-v6-c-table__th"
|
|
49
|
+
data-ouia-component-id="TableExample-th-3"
|
|
50
|
+
scope="col"
|
|
51
|
+
tabindex="-1"
|
|
52
|
+
>
|
|
53
|
+
Workspaces
|
|
54
|
+
</th>
|
|
55
|
+
<th
|
|
56
|
+
class="pf-v6-c-table__th"
|
|
57
|
+
data-ouia-component-id="TableExample-th-4"
|
|
58
|
+
scope="col"
|
|
59
|
+
tabindex="-1"
|
|
60
|
+
>
|
|
61
|
+
Last commit
|
|
62
|
+
</th>
|
|
63
|
+
</tr>
|
|
64
|
+
</thead>
|
|
65
|
+
<tbody
|
|
66
|
+
class="pf-v6-c-table__tbody"
|
|
67
|
+
role="rowgroup"
|
|
68
|
+
>
|
|
69
|
+
<tr
|
|
70
|
+
class="pf-v6-c-table__tr"
|
|
71
|
+
data-ouia-component-id="TableExample-tr-0"
|
|
72
|
+
data-ouia-component-type="PF6/TableRow"
|
|
73
|
+
data-ouia-safe="true"
|
|
74
|
+
>
|
|
75
|
+
<td
|
|
76
|
+
class="pf-v6-c-table__td"
|
|
77
|
+
data-ouia-component-id="TableExample-td-0-0"
|
|
78
|
+
tabindex="-1"
|
|
79
|
+
>
|
|
80
|
+
Repository one
|
|
81
|
+
</td>
|
|
82
|
+
<td
|
|
83
|
+
class="pf-v6-c-table__td"
|
|
84
|
+
data-ouia-component-id="TableExample-td-0-1"
|
|
85
|
+
tabindex="-1"
|
|
86
|
+
>
|
|
87
|
+
Branch one
|
|
88
|
+
</td>
|
|
89
|
+
<td
|
|
90
|
+
class="pf-v6-c-table__td"
|
|
91
|
+
data-ouia-component-id="TableExample-td-0-2"
|
|
92
|
+
tabindex="-1"
|
|
93
|
+
>
|
|
94
|
+
Pull request one
|
|
95
|
+
</td>
|
|
96
|
+
<td
|
|
97
|
+
class="pf-v6-c-table__td"
|
|
98
|
+
data-ouia-component-id="TableExample-td-0-3"
|
|
99
|
+
tabindex="-1"
|
|
100
|
+
>
|
|
101
|
+
Workspace one
|
|
102
|
+
</td>
|
|
103
|
+
<td
|
|
104
|
+
class="pf-v6-c-table__td"
|
|
105
|
+
data-ouia-component-id="TableExample-td-0-4"
|
|
106
|
+
tabindex="-1"
|
|
107
|
+
>
|
|
108
|
+
Timestamp one
|
|
109
|
+
</td>
|
|
110
|
+
</tr>
|
|
111
|
+
<tr
|
|
112
|
+
class="pf-v6-c-table__tr"
|
|
113
|
+
data-ouia-component-id="TableExample-tr-1"
|
|
114
|
+
data-ouia-component-type="PF6/TableRow"
|
|
115
|
+
data-ouia-safe="true"
|
|
116
|
+
>
|
|
117
|
+
<td
|
|
118
|
+
class="pf-v6-c-table__td"
|
|
119
|
+
data-ouia-component-id="TableExample-td-1-0"
|
|
120
|
+
tabindex="-1"
|
|
121
|
+
>
|
|
122
|
+
Repository two
|
|
123
|
+
</td>
|
|
124
|
+
<td
|
|
125
|
+
class="pf-v6-c-table__td"
|
|
126
|
+
data-ouia-component-id="TableExample-td-1-1"
|
|
127
|
+
tabindex="-1"
|
|
128
|
+
>
|
|
129
|
+
Branch two
|
|
130
|
+
</td>
|
|
131
|
+
<td
|
|
132
|
+
class="pf-v6-c-table__td"
|
|
133
|
+
data-ouia-component-id="TableExample-td-1-2"
|
|
134
|
+
tabindex="-1"
|
|
135
|
+
>
|
|
136
|
+
Pull request two
|
|
137
|
+
</td>
|
|
138
|
+
<td
|
|
139
|
+
class="pf-v6-c-table__td"
|
|
140
|
+
data-ouia-component-id="TableExample-td-1-3"
|
|
141
|
+
tabindex="-1"
|
|
142
|
+
>
|
|
143
|
+
Workspace two
|
|
144
|
+
</td>
|
|
145
|
+
<td
|
|
146
|
+
class="pf-v6-c-table__td"
|
|
147
|
+
data-ouia-component-id="TableExample-td-1-4"
|
|
148
|
+
tabindex="-1"
|
|
149
|
+
>
|
|
150
|
+
Timestamp two
|
|
151
|
+
</td>
|
|
152
|
+
</tr>
|
|
153
|
+
<tr
|
|
154
|
+
class="pf-v6-c-table__tr"
|
|
155
|
+
data-ouia-component-id="TableExample-tr-2"
|
|
156
|
+
data-ouia-component-type="PF6/TableRow"
|
|
157
|
+
data-ouia-safe="true"
|
|
158
|
+
>
|
|
159
|
+
<td
|
|
160
|
+
class="pf-v6-c-table__td"
|
|
161
|
+
data-ouia-component-id="TableExample-td-2-0"
|
|
162
|
+
tabindex="-1"
|
|
163
|
+
>
|
|
164
|
+
Repository three
|
|
165
|
+
</td>
|
|
166
|
+
<td
|
|
167
|
+
class="pf-v6-c-table__td"
|
|
168
|
+
data-ouia-component-id="TableExample-td-2-1"
|
|
169
|
+
tabindex="-1"
|
|
170
|
+
>
|
|
171
|
+
Branch three
|
|
172
|
+
</td>
|
|
173
|
+
<td
|
|
174
|
+
class="pf-v6-c-table__td"
|
|
175
|
+
data-ouia-component-id="TableExample-td-2-2"
|
|
176
|
+
tabindex="-1"
|
|
177
|
+
>
|
|
178
|
+
Pull request three
|
|
179
|
+
</td>
|
|
180
|
+
<td
|
|
181
|
+
class="pf-v6-c-table__td"
|
|
182
|
+
data-ouia-component-id="TableExample-td-2-3"
|
|
183
|
+
tabindex="-1"
|
|
184
|
+
>
|
|
185
|
+
Workspace three
|
|
186
|
+
</td>
|
|
187
|
+
<td
|
|
188
|
+
class="pf-v6-c-table__td"
|
|
189
|
+
data-ouia-component-id="TableExample-td-2-4"
|
|
190
|
+
tabindex="-1"
|
|
191
|
+
>
|
|
192
|
+
Timestamp three
|
|
193
|
+
</td>
|
|
194
|
+
</tr>
|
|
195
|
+
<tr
|
|
196
|
+
class="pf-v6-c-table__tr"
|
|
197
|
+
data-ouia-component-id="TableExample-tr-3"
|
|
198
|
+
data-ouia-component-type="PF6/TableRow"
|
|
199
|
+
data-ouia-safe="true"
|
|
200
|
+
>
|
|
201
|
+
<td
|
|
202
|
+
class="pf-v6-c-table__td"
|
|
203
|
+
data-ouia-component-id="TableExample-td-3-0"
|
|
204
|
+
tabindex="-1"
|
|
205
|
+
>
|
|
206
|
+
Repository four
|
|
207
|
+
</td>
|
|
208
|
+
<td
|
|
209
|
+
class="pf-v6-c-table__td"
|
|
210
|
+
data-ouia-component-id="TableExample-td-3-1"
|
|
211
|
+
tabindex="-1"
|
|
212
|
+
>
|
|
213
|
+
Branch four
|
|
214
|
+
</td>
|
|
215
|
+
<td
|
|
216
|
+
class="pf-v6-c-table__td"
|
|
217
|
+
data-ouia-component-id="TableExample-td-3-2"
|
|
218
|
+
tabindex="-1"
|
|
219
|
+
>
|
|
220
|
+
Pull request four
|
|
221
|
+
</td>
|
|
222
|
+
<td
|
|
223
|
+
class="pf-v6-c-table__td"
|
|
224
|
+
data-ouia-component-id="TableExample-td-3-3"
|
|
225
|
+
tabindex="-1"
|
|
226
|
+
>
|
|
227
|
+
Workspace four
|
|
228
|
+
</td>
|
|
229
|
+
<td
|
|
230
|
+
class="pf-v6-c-table__td"
|
|
231
|
+
data-ouia-component-id="TableExample-td-3-4"
|
|
232
|
+
tabindex="-1"
|
|
233
|
+
>
|
|
234
|
+
Timestamp four
|
|
235
|
+
</td>
|
|
236
|
+
</tr>
|
|
237
|
+
<tr
|
|
238
|
+
class="pf-v6-c-table__tr"
|
|
239
|
+
data-ouia-component-id="TableExample-tr-4"
|
|
240
|
+
data-ouia-component-type="PF6/TableRow"
|
|
241
|
+
data-ouia-safe="true"
|
|
242
|
+
>
|
|
243
|
+
<td
|
|
244
|
+
class="pf-v6-c-table__td"
|
|
245
|
+
data-ouia-component-id="TableExample-td-4-0"
|
|
246
|
+
tabindex="-1"
|
|
247
|
+
>
|
|
248
|
+
Repository five
|
|
249
|
+
</td>
|
|
250
|
+
<td
|
|
251
|
+
class="pf-v6-c-table__td"
|
|
252
|
+
data-ouia-component-id="TableExample-td-4-1"
|
|
253
|
+
tabindex="-1"
|
|
254
|
+
>
|
|
255
|
+
Branch five
|
|
256
|
+
</td>
|
|
257
|
+
<td
|
|
258
|
+
class="pf-v6-c-table__td"
|
|
259
|
+
data-ouia-component-id="TableExample-td-4-2"
|
|
260
|
+
tabindex="-1"
|
|
261
|
+
>
|
|
262
|
+
Pull request five
|
|
263
|
+
</td>
|
|
264
|
+
<td
|
|
265
|
+
class="pf-v6-c-table__td"
|
|
266
|
+
data-ouia-component-id="TableExample-td-4-3"
|
|
267
|
+
tabindex="-1"
|
|
268
|
+
>
|
|
269
|
+
Workspace five
|
|
270
|
+
</td>
|
|
271
|
+
<td
|
|
272
|
+
class="pf-v6-c-table__td"
|
|
273
|
+
data-ouia-component-id="TableExample-td-4-4"
|
|
274
|
+
tabindex="-1"
|
|
275
|
+
>
|
|
276
|
+
Timestamp five
|
|
277
|
+
</td>
|
|
278
|
+
</tr>
|
|
279
|
+
<tr
|
|
280
|
+
class="pf-v6-c-table__tr"
|
|
281
|
+
data-ouia-component-id="TableExample-tr-5"
|
|
282
|
+
data-ouia-component-type="PF6/TableRow"
|
|
283
|
+
data-ouia-safe="true"
|
|
284
|
+
>
|
|
285
|
+
<td
|
|
286
|
+
class="pf-v6-c-table__td"
|
|
287
|
+
data-ouia-component-id="TableExample-td-5-0"
|
|
288
|
+
tabindex="-1"
|
|
289
|
+
>
|
|
290
|
+
Repository six
|
|
291
|
+
</td>
|
|
292
|
+
<td
|
|
293
|
+
class="pf-v6-c-table__td"
|
|
294
|
+
data-ouia-component-id="TableExample-td-5-1"
|
|
295
|
+
tabindex="-1"
|
|
296
|
+
>
|
|
297
|
+
Branch six
|
|
298
|
+
</td>
|
|
299
|
+
<td
|
|
300
|
+
class="pf-v6-c-table__td"
|
|
301
|
+
data-ouia-component-id="TableExample-td-5-2"
|
|
302
|
+
tabindex="-1"
|
|
303
|
+
>
|
|
304
|
+
Pull request six
|
|
305
|
+
</td>
|
|
306
|
+
<td
|
|
307
|
+
class="pf-v6-c-table__td"
|
|
308
|
+
data-ouia-component-id="TableExample-td-5-3"
|
|
309
|
+
tabindex="-1"
|
|
310
|
+
>
|
|
311
|
+
Workspace six
|
|
312
|
+
</td>
|
|
313
|
+
<td
|
|
314
|
+
class="pf-v6-c-table__td"
|
|
315
|
+
data-ouia-component-id="TableExample-td-5-4"
|
|
316
|
+
tabindex="-1"
|
|
317
|
+
>
|
|
318
|
+
Timestamp six
|
|
319
|
+
</td>
|
|
320
|
+
</tr>
|
|
321
|
+
</tbody>
|
|
322
|
+
</table>
|
|
323
|
+
</div>
|
|
324
|
+
`;
|
|
325
|
+
|
|
326
|
+
exports[`DataViewTable component should render with a loading state 1`] = `
|
|
327
|
+
<div>
|
|
328
|
+
<div
|
|
329
|
+
class="pf-v6-l-stack"
|
|
330
|
+
data-ouia-component-id="DataView-stack"
|
|
331
|
+
>
|
|
332
|
+
<div
|
|
333
|
+
class="pf-v6-l-stack__item"
|
|
334
|
+
data-ouia-component-id="DataView-stack-item-0"
|
|
335
|
+
>
|
|
336
|
+
<table
|
|
337
|
+
aria-label="Repositories table"
|
|
338
|
+
class="pf-v6-c-table pf-m-grid-md"
|
|
339
|
+
data-ouia-component-id="TableExample"
|
|
340
|
+
data-ouia-component-type="PF6/Table"
|
|
341
|
+
data-ouia-safe="true"
|
|
342
|
+
role="grid"
|
|
343
|
+
>
|
|
344
|
+
<thead
|
|
345
|
+
class="pf-v6-c-table__thead"
|
|
346
|
+
data-ouia-component-id="TableExample-thead"
|
|
347
|
+
>
|
|
348
|
+
<tr
|
|
349
|
+
class="pf-v6-c-table__tr"
|
|
350
|
+
data-ouia-component-id="TableExample-tr-head"
|
|
351
|
+
data-ouia-component-type="PF6/TableRow"
|
|
352
|
+
data-ouia-safe="true"
|
|
353
|
+
>
|
|
354
|
+
<th
|
|
355
|
+
class="pf-v6-c-table__th"
|
|
356
|
+
data-ouia-component-id="TableExample-th-0"
|
|
357
|
+
scope="col"
|
|
358
|
+
tabindex="-1"
|
|
359
|
+
>
|
|
360
|
+
Repositories
|
|
361
|
+
</th>
|
|
362
|
+
<th
|
|
363
|
+
class="pf-v6-c-table__th"
|
|
364
|
+
data-ouia-component-id="TableExample-th-1"
|
|
365
|
+
scope="col"
|
|
366
|
+
tabindex="-1"
|
|
367
|
+
>
|
|
368
|
+
Branches
|
|
369
|
+
</th>
|
|
370
|
+
<th
|
|
371
|
+
class="pf-v6-c-table__th"
|
|
372
|
+
data-ouia-component-id="TableExample-th-2"
|
|
373
|
+
scope="col"
|
|
374
|
+
tabindex="-1"
|
|
375
|
+
>
|
|
376
|
+
Pull requests
|
|
377
|
+
</th>
|
|
378
|
+
<th
|
|
379
|
+
class="pf-v6-c-table__th"
|
|
380
|
+
data-ouia-component-id="TableExample-th-3"
|
|
381
|
+
scope="col"
|
|
382
|
+
tabindex="-1"
|
|
383
|
+
>
|
|
384
|
+
Workspaces
|
|
385
|
+
</th>
|
|
386
|
+
<th
|
|
387
|
+
class="pf-v6-c-table__th"
|
|
388
|
+
data-ouia-component-id="TableExample-th-4"
|
|
389
|
+
scope="col"
|
|
390
|
+
tabindex="-1"
|
|
391
|
+
>
|
|
392
|
+
Last commit
|
|
393
|
+
</th>
|
|
394
|
+
</tr>
|
|
395
|
+
</thead>
|
|
396
|
+
Data is loading
|
|
397
|
+
</table>
|
|
398
|
+
</div>
|
|
399
|
+
</div>
|
|
400
|
+
</div>
|
|
401
|
+
`;
|
|
402
|
+
|
|
403
|
+
exports[`DataViewTable component should render with an empty state 1`] = `
|
|
404
|
+
<div>
|
|
405
|
+
<div
|
|
406
|
+
class="pf-v6-l-stack"
|
|
407
|
+
data-ouia-component-id="DataView-stack"
|
|
408
|
+
>
|
|
409
|
+
<div
|
|
410
|
+
class="pf-v6-l-stack__item"
|
|
411
|
+
data-ouia-component-id="DataView-stack-item-0"
|
|
412
|
+
>
|
|
413
|
+
<table
|
|
414
|
+
aria-label="Repositories table"
|
|
415
|
+
class="pf-v6-c-table pf-m-grid-md"
|
|
416
|
+
data-ouia-component-id="TableExample"
|
|
417
|
+
data-ouia-component-type="PF6/Table"
|
|
418
|
+
data-ouia-safe="true"
|
|
419
|
+
role="grid"
|
|
420
|
+
>
|
|
421
|
+
<thead
|
|
422
|
+
class="pf-v6-c-table__thead"
|
|
423
|
+
data-ouia-component-id="TableExample-thead"
|
|
424
|
+
>
|
|
425
|
+
<tr
|
|
426
|
+
class="pf-v6-c-table__tr"
|
|
427
|
+
data-ouia-component-id="TableExample-tr-head"
|
|
428
|
+
data-ouia-component-type="PF6/TableRow"
|
|
429
|
+
data-ouia-safe="true"
|
|
430
|
+
>
|
|
431
|
+
<th
|
|
432
|
+
class="pf-v6-c-table__th"
|
|
433
|
+
data-ouia-component-id="TableExample-th-0"
|
|
434
|
+
scope="col"
|
|
435
|
+
tabindex="-1"
|
|
436
|
+
>
|
|
437
|
+
Repositories
|
|
438
|
+
</th>
|
|
439
|
+
<th
|
|
440
|
+
class="pf-v6-c-table__th"
|
|
441
|
+
data-ouia-component-id="TableExample-th-1"
|
|
442
|
+
scope="col"
|
|
443
|
+
tabindex="-1"
|
|
444
|
+
>
|
|
445
|
+
Branches
|
|
446
|
+
</th>
|
|
447
|
+
<th
|
|
448
|
+
class="pf-v6-c-table__th"
|
|
449
|
+
data-ouia-component-id="TableExample-th-2"
|
|
450
|
+
scope="col"
|
|
451
|
+
tabindex="-1"
|
|
452
|
+
>
|
|
453
|
+
Pull requests
|
|
454
|
+
</th>
|
|
455
|
+
<th
|
|
456
|
+
class="pf-v6-c-table__th"
|
|
457
|
+
data-ouia-component-id="TableExample-th-3"
|
|
458
|
+
scope="col"
|
|
459
|
+
tabindex="-1"
|
|
460
|
+
>
|
|
461
|
+
Workspaces
|
|
462
|
+
</th>
|
|
463
|
+
<th
|
|
464
|
+
class="pf-v6-c-table__th"
|
|
465
|
+
data-ouia-component-id="TableExample-th-4"
|
|
466
|
+
scope="col"
|
|
467
|
+
tabindex="-1"
|
|
468
|
+
>
|
|
469
|
+
Last commit
|
|
470
|
+
</th>
|
|
471
|
+
</tr>
|
|
472
|
+
</thead>
|
|
473
|
+
No data found
|
|
474
|
+
</table>
|
|
475
|
+
</div>
|
|
476
|
+
</div>
|
|
477
|
+
</div>
|
|
478
|
+
`;
|
|
479
|
+
|
|
480
|
+
exports[`DataViewTable component should render with an error state 1`] = `
|
|
481
|
+
<div>
|
|
482
|
+
<div
|
|
483
|
+
class="pf-v6-l-stack"
|
|
484
|
+
data-ouia-component-id="DataView-stack"
|
|
485
|
+
>
|
|
486
|
+
<div
|
|
487
|
+
class="pf-v6-l-stack__item"
|
|
488
|
+
data-ouia-component-id="DataView-stack-item-0"
|
|
489
|
+
>
|
|
490
|
+
<table
|
|
491
|
+
aria-label="Repositories table"
|
|
492
|
+
class="pf-v6-c-table pf-m-grid-md"
|
|
493
|
+
data-ouia-component-id="TableExample"
|
|
494
|
+
data-ouia-component-type="PF6/Table"
|
|
495
|
+
data-ouia-safe="true"
|
|
496
|
+
role="grid"
|
|
497
|
+
>
|
|
498
|
+
<thead
|
|
499
|
+
class="pf-v6-c-table__thead"
|
|
500
|
+
data-ouia-component-id="TableExample-thead"
|
|
501
|
+
>
|
|
502
|
+
<tr
|
|
503
|
+
class="pf-v6-c-table__tr"
|
|
504
|
+
data-ouia-component-id="TableExample-tr-head"
|
|
505
|
+
data-ouia-component-type="PF6/TableRow"
|
|
506
|
+
data-ouia-safe="true"
|
|
507
|
+
>
|
|
508
|
+
<th
|
|
509
|
+
class="pf-v6-c-table__th"
|
|
510
|
+
data-ouia-component-id="TableExample-th-0"
|
|
511
|
+
scope="col"
|
|
512
|
+
tabindex="-1"
|
|
513
|
+
>
|
|
514
|
+
Repositories
|
|
515
|
+
</th>
|
|
516
|
+
<th
|
|
517
|
+
class="pf-v6-c-table__th"
|
|
518
|
+
data-ouia-component-id="TableExample-th-1"
|
|
519
|
+
scope="col"
|
|
520
|
+
tabindex="-1"
|
|
521
|
+
>
|
|
522
|
+
Branches
|
|
523
|
+
</th>
|
|
524
|
+
<th
|
|
525
|
+
class="pf-v6-c-table__th"
|
|
526
|
+
data-ouia-component-id="TableExample-th-2"
|
|
527
|
+
scope="col"
|
|
528
|
+
tabindex="-1"
|
|
529
|
+
>
|
|
530
|
+
Pull requests
|
|
531
|
+
</th>
|
|
532
|
+
<th
|
|
533
|
+
class="pf-v6-c-table__th"
|
|
534
|
+
data-ouia-component-id="TableExample-th-3"
|
|
535
|
+
scope="col"
|
|
536
|
+
tabindex="-1"
|
|
537
|
+
>
|
|
538
|
+
Workspaces
|
|
539
|
+
</th>
|
|
540
|
+
<th
|
|
541
|
+
class="pf-v6-c-table__th"
|
|
542
|
+
data-ouia-component-id="TableExample-th-4"
|
|
543
|
+
scope="col"
|
|
544
|
+
tabindex="-1"
|
|
545
|
+
>
|
|
546
|
+
Last commit
|
|
547
|
+
</th>
|
|
548
|
+
</tr>
|
|
549
|
+
</thead>
|
|
550
|
+
Some error
|
|
551
|
+
</table>
|
|
552
|
+
</div>
|
|
553
|
+
</div>
|
|
554
|
+
</div>
|
|
555
|
+
`;
|