Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Data Grid] - Styling built into data grid, full screen mode #2230

Merged
merged 30 commits into from
Sep 5, 2019
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
9ab846f
style selector dropdown uses hooks, new icon added, full screen mode
snide Aug 15, 2019
5842787
snaps
snide Aug 15, 2019
9d28b8a
setState return
thompsongl Aug 15, 2019
73bd35c
Merge pull request #9 from thompsongl/design/toolbar
snide Aug 15, 2019
0afdb3f
full screen kinda. need to rework a lot of this. just playing with co…
snide Aug 16, 2019
95c48d1
cleaup. grid now works in small containers
snide Aug 28, 2019
a38dd47
only set column widths initially, not on resize
snide Aug 28, 2019
c6ee314
more cleanup, density controls now merge!
snide Aug 29, 2019
b75d97e
Merge remote-tracking branch 'upstream/feature/euidatagrid' into desi…
snide Aug 29, 2019
ae53136
cleanup of docs and sass
snide Aug 30, 2019
272729c
fixed focus trap issues
Sep 3, 2019
4575bd8
Performance fix to avoid re-processing rows unaffected by changing ce…
chandlerprall Sep 3, 2019
22346c5
fix hook problems in datagrid
chandlerprall Sep 3, 2019
e32fe28
Fixed EuiDataGrid tests
chandlerprall Sep 3, 2019
742730b
feedback
snide Sep 4, 2019
e1391a5
fix drag and drop focus issue / coloring
snide Sep 4, 2019
497ce23
Update position of aria-label[ledby] in EuiDataGrid's role=grid
chandlerprall Sep 4, 2019
87f423b
style selector i18n
snide Sep 4, 2019
82c49e4
euiDataGrid i18n
snide Sep 4, 2019
a98779a
column selector i18n
snide Sep 4, 2019
278510e
full screen check
snide Sep 4, 2019
ed66269
const for screen width
snide Sep 4, 2019
9f2dce1
sass lint, stupid vim
snide Sep 4, 2019
c47a4ed
ie11 fixes and some i18n stuffs
snide Sep 4, 2019
698956f
Fix/update datagrid tests' popover helper utils
chandlerprall Sep 5, 2019
1550e28
Update EuiI18n types around defaults & children callback to provide m…
chandlerprall Sep 5, 2019
9f5cd07
fix for focus trap styles. hat tip to chandler
snide Sep 5, 2019
d32c8e2
Update src/components/datagrid/column_selector.tsx
snide Sep 5, 2019
ad66a76
Update src/components/datagrid/column_selector.tsx
snide Sep 5, 2019
36a9be2
fix ci, update docs
snide Sep 5, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
"eslint-plugin-prefer-object-spread": "^1.2.1",
"eslint-plugin-prettier": "^3.1.0",
"eslint-plugin-react": "^7.13.0",
"faker": "^4.1.0",
"file-loader": "^1.1.11",
"findup": "^0.1.5",
"fork-ts-checker-webpack-plugin": "^0.4.4",
Expand Down
88 changes: 88 additions & 0 deletions src-docs/src/views/datagrid/container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
import React, { Component } from 'react';
import { fake } from 'faker';

import { EuiDataGrid, EuiPanel, EuiLink } from '../../../../src/components/';

const columns = [
{
id: 'name',
},
{
id: 'email',
},
{
id: 'city',
},
{
id: 'country',
},
{
id: 'account',
},
];

const data = [];

for (let i = 1; i < 100; i++) {
data.push({
name: fake('{{name.lastName}}, {{name.firstName}} {{name.suffix}}'),
email: fake('{{internet.email}}'),
city: (
<EuiLink href="http://google.com">{fake('{{address.city}}')}</EuiLink>
),
country: fake('{{address.country}}'),
account: fake('{{finance.account}}'),
});
}

export default class DataGridContainer extends Component {
constructor(props) {
super(props);

this.state = {
pagination: {
pageIndex: 0,
pageSize: 50,
},
};
}

setPageIndex = pageIndex =>
this.setState(({ pagination }) => ({
pagination: { ...pagination, pageIndex },
}));

setPageSize = pageSize =>
this.setState(({ pagination }) => ({
pagination: { ...pagination, pageSize },
}));

render() {
const { pagination } = this.state;

return (
<EuiPanel style={{ width: 300 }}>
<div style={{ height: 300 }}>
<EuiDataGrid
aria-label="Top EUI contributors"
columns={columns}
rowCount={data.length}
gridStyle={{
border: 'horizontal',
header: 'underline',
}}
renderCellValue={({ rowIndex, columnId }) =>
data[rowIndex][columnId]
}
pagination={{
...pagination,
pageSizeOptions: [5, 10, 25],
onChangeItemsPerPage: this.setPageSize,
onChangePage: this.setPageIndex,
}}
/>
</div>
</EuiPanel>
);
}
}
Loading