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

feat(react-grid-bootstrap4): support the bootstrap4 theme #681

Merged
merged 92 commits into from Mar 2, 2018
Merged
Show file tree
Hide file tree
Changes from 89 commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
a26bf1e
Initial commit
MaximKudriavtsev Jan 17, 2018
b644907
Add the Grid component
MaximKudriavtsev Jan 17, 2018
890df34
Add basic demo
MaximKudriavtsev Jan 17, 2018
990af09
Add table-cell-template and table-row-template demos
MaximKudriavtsev Jan 17, 2018
1e99a7b
Add sorting demos
MaximKudriavtsev Jan 18, 2018
c4b7fa6
Add all plugins and templates
MaximKudriavtsev Jan 18, 2018
f49145c
Add all demos
MaximKudriavtsev Jan 18, 2018
d52d994
Add Grouping plugins
MaximKudriavtsev Jan 18, 2018
773ffad
Merge branch 'master' into bs4-support
MaximKudriavtsev Jan 18, 2018
8e12556
Add Pagination
MaximKudriavtsev Jan 18, 2018
4e6db34
Add Pagination
MaximKudriavtsev Jan 19, 2018
0a86a53
Add Editing
MaximKudriavtsev Jan 19, 2018
0c458f5
Add ColumnChooser
MaximKudriavtsev Jan 19, 2018
2b367ca
Add data-types demos
MaximKudriavtsev Jan 19, 2018
469b4fc
Add featured domos
MaximKudriavtsev Jan 19, 2018
9dbc22f
Add column-resizing
MaximKudriavtsev Jan 19, 2018
f250c19
Applay styles to Demos
MaximKudriavtsev Jan 22, 2018
ad5d5b6
Fix keyboard navigation in column chooser
MaximKudriavtsev Jan 22, 2018
75dbda5
Add .card instead .breadcrumb
MaximKudriavtsev Jan 22, 2018
66e5a57
Add keyboard navigation to pager
MaximKudriavtsev Jan 22, 2018
10278fe
Remove border from eye-button
MaximKudriavtsev Jan 22, 2018
04e61e3
Add progress-bar-cell
MaximKudriavtsev Jan 22, 2018
2149fdd
Get rid broken templates tests
MaximKudriavtsev Jan 23, 2018
14c8468
Get rid IDs from ColumnChooser
MaximKudriavtsev Jan 23, 2018
1f1333f
Get rid broken tests
MaximKudriavtsev Jan 23, 2018
0a91b8f
Review all templates
MaximKudriavtsev Jan 23, 2018
653e6c9
Update dependencies
MaximKudriavtsev Jan 23, 2018
cc000de
Add icons to featured controlled demo
MaximKudriavtsev Jan 24, 2018
948397f
Remove excess border top from some templates
MaximKudriavtsev Jan 24, 2018
fd746bf
Merge master into bs4
MaximKudriavtsev Jan 26, 2018
57b2669
Resolve conflicts after merge
MaximKudriavtsev Jan 26, 2018
0551cf1
Remove forggoten file
MaximKudriavtsev Jan 26, 2018
12e86f5
Add theme switch to bs4
MaximKudriavtsev Jan 26, 2018
7852c8b
Add margin to ColumnChooser item
MaximKudriavtsev Jan 26, 2018
82a552d
Change ColumnChooser styles
MaximKudriavtsev Jan 31, 2018
22f8987
Change ColumnChooser styles
MaximKudriavtsev Jan 31, 2018
72d3de9
Add border top to the TableHeaderRow
MaximKudriavtsev Feb 1, 2018
3b3e22b
Add arrows to pagination
MaximKudriavtsev Feb 1, 2018
bcf7a4c
Remove border from a table
MaximKudriavtsev Feb 1, 2018
f553310
Add custom filter row demo
MaximKudriavtsev Feb 1, 2018
0115e29
Merge branch 'master' into bs4-support
MaximKudriavtsev Feb 1, 2018
266f57d
Resolve conflicts
MaximKudriavtsev Feb 2, 2018
1749d3f
Update deps
MaximKudriavtsev Feb 2, 2018
0d91a1f
Add card-header and card-footer styles
MaximKudriavtsev Feb 5, 2018
2d5c05c
Merge branch 'master' into bs4-support
MaximKudriavtsev Feb 5, 2018
f77309d
Rework the ColumnChooser
MaximKudriavtsev Feb 5, 2018
a31c2f2
Add the card class to the root demo element
MaximKudriavtsev Feb 5, 2018
2da627e
Fix lint
MaximKudriavtsev Feb 5, 2018
373904f
Hide outline when mouse click
MaximKudriavtsev Feb 5, 2018
a1f592d
Fix blinks when paging
MaximKudriavtsev Feb 5, 2018
e80e992
Refactor
MaximKudriavtsev Feb 7, 2018
84c5223
Refactor
MaximKudriavtsev Feb 7, 2018
5bcbb4b
Remove inlise styles from group panel
MaximKudriavtsev Feb 9, 2018
b643e10
Change wrapper tag from div to the Card component
MaximKudriavtsev Feb 9, 2018
96403a2
Remove inline styles from pager
MaximKudriavtsev Feb 9, 2018
43a93bf
Remove inline styles
MaximKudriavtsev Feb 9, 2018
d95281e
Merge branch 'master' into bs4-support
MaximKudriavtsev Feb 9, 2018
ada8277
Use wildcard import with react packages
MaximKudriavtsev Feb 9, 2018
933e45d
Resolve conflicts
MaximKudriavtsev Feb 9, 2018
c0c9c08
Correct PropTypes for the ColumnChooser.Container
MaximKudriavtsev Feb 12, 2018
b370adc
Change mount -> shallow
MaximKudriavtsev Feb 12, 2018
832e8bc
Create default configuration for PageSizeSelector tests
MaximKudriavtsev Feb 12, 2018
cd6e268
Styles spike
MaximKudriavtsev Feb 13, 2018
5956be5
Style spike
MaximKudriavtsev Feb 13, 2018
f39c332
Fix tests
MaximKudriavtsev Feb 14, 2018
e08d003
Refactor tests
MaximKudriavtsev Feb 14, 2018
c94be5b
Add style prefix 'dx-rg'
MaximKudriavtsev Feb 15, 2018
8274b20
Fix after review
MaximKudriavtsev Feb 16, 2018
93dfc00
Add README files and doc
MaximKudriavtsev Feb 19, 2018
22a6727
Add dx-rg-bs4 prefix
MaximKudriavtsev Feb 19, 2018
a105be8
Resolve conflicts
MaximKudriavtsev Feb 19, 2018
188cced
Fix broken link
MaximKudriavtsev Feb 19, 2018
8b340d6
Fix misspelling
MaximKudriavtsev Feb 19, 2018
dcfc3d3
Update docs
MaximKudriavtsev Feb 19, 2018
8d267e9
Refactor
MaximKudriavtsev Feb 19, 2018
8c0ead2
Refactor
MaximKudriavtsev Feb 20, 2018
bd7f945
Fix after review
MaximKudriavtsev Feb 21, 2018
e098a5a
Fix test
MaximKudriavtsev Feb 21, 2018
bb6a3ba
Merge branch 'master' into bs4-support
MaximKudriavtsev Feb 21, 2018
5468d42
Resolve conflicts
MaximKudriavtsev Feb 21, 2018
a5fd1f4
Merge branch 'master' into bs4-support
MaximKudriavtsev Feb 21, 2018
3cba8be
Fix after merge
MaximKudriavtsev Feb 21, 2018
e621d6a
Merge branch 'bs4-support' of https://github.com/MaximKudriavtsev/dev…
MaximKudriavtsev Feb 21, 2018
5ef06a9
Rename class from opacity tp inactive
MaximKudriavtsev Feb 21, 2018
e54330a
Update README.md
viterobk Feb 27, 2018
64080c0
Update README.md
dirk-pieterse Mar 1, 2018
667aac9
Update README.md
dirk-pieterse Mar 1, 2018
7a01f51
Update README.md
dirk-pieterse Mar 1, 2018
b98f05a
Update getting-started.md
dirk-pieterse Mar 1, 2018
55d7a6e
Resolve conflicts
MaximKudriavtsev Mar 1, 2018
1c10d29
Fix problem with reactstrap version
MaximKudriavtsev Mar 2, 2018
97ade7e
Fix dnd styles
MaximKudriavtsev Mar 2, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/dx-react-demos/package.json
Expand Up @@ -39,6 +39,7 @@
"@devexpress/dx-react-core": "1.0.0",
"@devexpress/dx-react-grid": "1.0.0",
"@devexpress/dx-react-grid-bootstrap3": "1.0.0",
"@devexpress/dx-react-grid-bootstrap4": "1.1.0-beta.1",
"@devexpress/dx-react-grid-material-ui": "1.0.0",
"@types/react": "^16.0.37",
"@types/react-dom": "^16.0.4",
Expand All @@ -49,6 +50,7 @@
"prop-types": "^15.6.0",
"react": "^16.2.0",
"react-bootstrap": "^0.32.1",
"reactstrap": "^5.0.0-beta",
"react-dom": "^16.2.0",
"react-frame-component": "^2.0.2",
"react-redux": "^5.0.6",
Expand Down
@@ -1,4 +1,4 @@
import React from 'react';<%&additionalImports%>
import * as React from 'react';<%&additionalImports%>
import {
Grid,
Table,
Expand Down
@@ -0,0 +1,112 @@
import * as React from 'react';
import {
DataTypeProvider,
EditingState,
} from '@devexpress/dx-react-grid';
import {
Grid,
Table,
TableHeaderRow,
TableEditRow,
TableEditColumn,
} from '@devexpress/dx-react-grid-bootstrap4';

import {
generateRows,
globalSalesValues,
} from '../../../demo-data/generator';

const getRowId = row => row.id;

const BooleanFormatter = ({ value }) =>
<span className="badge badge-secondary">{value ? 'Yes' : 'No'}</span>;

const BooleanEditor = ({ value, onValueChange }) => (
<select
className="form-control"
value={value}
onChange={e => onValueChange(e.target.value === 'true')}
>
<option value={false}>No</option>
<option value>Yes</option>
</select>
);

const BooleanTypeProvider = props => (
<DataTypeProvider
formatterComponent={BooleanFormatter}
editorComponent={BooleanEditor}
{...props}
/>
);

export default class Demo extends React.PureComponent {
constructor(props) {
super(props);

this.state = {
columns: [
{ name: 'customer', title: 'Customer' },
{ name: 'product', title: 'Product' },
{ name: 'units', title: 'Units' },
{ name: 'shipped', title: 'Shipped' },
],
booleanColumns: ['shipped'],
rows: generateRows({
columnValues: { id: ({ index }) => index, ...globalSalesValues },
length: 8,
}),
};

this.commitChanges = ({ added, changed, deleted }) => {
let { rows } = this.state;
if (added) {
const startingAddedId = (rows.length - 1) > 0 ? rows[rows.length - 1].id + 1 : 0;
rows = [
...rows,
...added.map((row, index) => ({
id: startingAddedId + index,
...row,
})),
];
}
if (changed) {
rows = rows.map(row => (changed[row.id] ? { ...row, ...changed[row.id] } : row));
}
if (deleted) {
const deletedSet = new Set(deleted);
rows = rows.filter(row => !deletedSet.has(row.id));
}
this.setState({ rows });
};
}
render() {
const { rows, columns, booleanColumns } = this.state;

return (
<div className="card">
<Grid
rows={rows}
columns={columns}
getRowId={getRowId}
>
<BooleanTypeProvider
for={booleanColumns}
/>
<EditingState
onCommitChanges={this.commitChanges}
defaultEditingRowIds={[0]}
/>
<Table />
<TableHeaderRow />
<TableEditRow />
<TableEditColumn
showAddCommand
showEditCommand
showDeleteCommand
/>
</Grid>
</div>
);
}
}