Skip to content

Commit

Permalink
Upgrade dependencies
Browse files Browse the repository at this point in the history
React 16
React Router 4

Use a single page for docs/examples/home page instead of using separate html files
  • Loading branch information
amanmahajan7 committed Feb 6, 2018
1 parent 82a0020 commit 656f3cb
Show file tree
Hide file tree
Showing 12 changed files with 315 additions and 197 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
@@ -0,0 +1,20 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# http://editorconfig.org

root = true

[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 0 additions & 1 deletion config/webpack.config.prod.js
Expand Up @@ -6,7 +6,6 @@ const config = {
'react-data-grid-addons/dist/react-data-grid-addons': ['./packages/react-data-grid-addons/src'],
'react-data-grid/dist/react-data-grid.min': ['./packages/react-data-grid/src'],
'react-data-grid-addons/dist/react-data-grid-addons.min': ['./packages/react-data-grid-addons/src'],
'react-data-grid-examples/dist/shared': './packages/react-data-grid-examples/src/shared.js',
'react-data-grid-examples/dist/examples': './packages/react-data-grid-examples/src/examples.js',
'react-data-grid-examples/dist/index': './packages/react-data-grid-examples/src/index.js',
'react-data-grid-examples/dist/documentation': './packages/react-data-grid-examples/src/documentation.js'
Expand Down
15 changes: 7 additions & 8 deletions package.json
Expand Up @@ -23,15 +23,14 @@
"react-component"
],
"peerDependencies": {
"react": "^15.6.2",
"react-dom": "^15.6.2"
"react": "^15.0.0-0 || ^16.0.0-0",
"react-dom": "^15.0.0-0 || ^16.0.0-0"
},
"dependencies": {
"classnames": "^1.2.0",
"classnames": "^2.2.5",
"es5-shim": "^4.0.3",
"fbjs": "^0.6.1",
"fs-extra": "^0.30.0",
"object-assign": "^2.0.0",
"prop-types": "^15.5.10",
"react-contextmenu": "^2.9.2",
"react-dnd": "^2.1.4",
Expand Down Expand Up @@ -88,14 +87,14 @@
"mkdirp": "^0.5.1",
"moment": "^2.10.6",
"node-dir": "^0.1.12",
"object-assign": "^2.1.1",
"object-assign": "^4.1.1",
"open": "0.0.5",
"react": "^15.6.2",
"react": "^16.2.0",
"react-addons-perf": "^15.4.2",
"react-dnd-test-backend": "^1.0.2",
"react-docgen": "^2.8.2",
"react-dom": "^15.6.2",
"react-test-renderer": "^15.6.2",
"react-dom": "^16.2.0",
"react-test-renderer": "^16.2.0",
"rewire": "^2.1.3",
"rewire-webpack": "^1.0.0",
"run-sequence": "^1.2.2",
Expand Down
7 changes: 4 additions & 3 deletions packages/react-data-grid-examples/package.json
Expand Up @@ -19,14 +19,15 @@
"dependencies": {
"immutability-helper": "^2.4.0",
"react-data-grid": "^3.0.11",
"react-data-grid-addons": "^3.0.11"
"react-data-grid-addons": "^3.0.11",
"react-router-dom": "^4.2.2"
},
"devDependencies": {
"bootstrap": "^3.2.0",
"jquery": "^2.1.1",
"lodash": "^4.13.1",
"lodash.groupby": "^4.5.1",
"react-router": "^0.13.3",
"markdown": "^0.5.0"
"markdown": "^0.5.0",
"react-router": "^4.2.0"
}
}
23 changes: 23 additions & 0 deletions packages/react-data-grid-examples/src/components/App.js
@@ -0,0 +1,23 @@
import React from 'react';
import { Route } from 'react-router-dom';

import ExampleScripts from '../scripts';
import Navbar from './Navbar';
import Home from './Home';
import Examples from './Examples';
import Documentation from './Documentation';

class App extends React.Component {
render() {
return (
<div>
<Navbar exampleLinks={ExampleScripts} />
<Route exact path="/" component={Home} />
<Route path="/examples" component={Examples} />
<Route path="/documentation" component={Documentation} />
</div >
);
}
}

export default App;
32 changes: 32 additions & 0 deletions packages/react-data-grid-examples/src/components/Documentation.js
@@ -0,0 +1,32 @@
import React from 'react';
import { Link, Route, Redirect } from 'react-router-dom';

import GettingStarted from '../scripts/documentation01-gettingstarted';
import ApiReference from '../scripts/documentation02-apireference';
import ComponentsDocs from '../scripts/documentation03-components';

function Documentation() {
return (
<div className="container-fluid top-space">
<div className="row">
<div className="col-md-2 top-space" role="complementary">
<nav id="sidebar" className="bs-docs-sidebar hidden-print hidden-xs hidden-sm" data-spy="affix" data-offset-top="0" data-offset-bottom="200">
<ul className="nav bs-docs-sidenav">
<li><Link to="/documentation/gettingstarted">Getting Started</Link></li>
<li><Link to="/documentation/apireference">API Reference</Link></li>
<li><Link to="/documentation/componentsdocs">Component Docs</Link></li>
</ul>
</nav>
</div>
<div className="col-md-10">
<Route path="/documentation/gettingstarted" component={GettingStarted} />
<Route path="/documentation/apireference" component={ApiReference} />
<Route path="/documentation/componentsDocs" component={ComponentsDocs} />
<Route exact path="/documentation" render={() => <Redirect to="/documentation/gettingstarted" />} />
</div>
</div>
</div>
);
}

export default Documentation;
@@ -1,11 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';

class ExampleList extends React.Component {
render() {
let links = this.props.links.map(l => {
return <li key={l.hashLocation}><a href={`examples.html#/${l.hashLocation}`}>{l.name}</a></li>;
});
const links = this.props.links.map(s => <li key={`/examples/${s.hashLocation}`}><Link to={`/examples/${s.hashLocation}`}>{s.name}</Link></li>);
return (
<ul {...this.props}>
{links}
Expand Down
32 changes: 32 additions & 0 deletions packages/react-data-grid-examples/src/components/Examples.js
@@ -0,0 +1,32 @@
import React from 'react';
import { Route, Redirect } from 'react-router-dom';

import ExampleScripts from '../scripts';
import ExampleList from './ExampleList';

function Examples() {
const routes = ExampleScripts.map(s => <Route path={`/examples/${s.hashLocation}`} component={s.module} />);
routes.push(<Route exact path="/examples" render={() => <Redirect to="/examples/all-features" />} />);

return (
<div className="container-fluid top-space">
<div className="row">
<div className="col-md-2 top-space" role="complementary">
<nav id="sidebar" className="bs-docs-sidebar hidden-print hidden-xs hidden-sm" data-spy="affix" data-offset-top="0" data-offset-bottom="200">
<div id="grid-examples-div">
<ExampleList className="nav bs-docs-sidenav" links={ExampleScripts} />
</div>
</nav>
</div>
<div className="col-md-10">
<div>
<h1 className="page-header">React Data Grid Examples</h1>
{routes}
</div>
</div>
</div>
</div>
);
}

export default Examples;
138 changes: 138 additions & 0 deletions packages/react-data-grid-examples/src/components/Home.js
@@ -0,0 +1,138 @@
import React from 'react';
import { Link } from 'react-router-dom';

function Home() {
return (
<div>
<header id="head">
<div className="container">
<div className="row">
<div className="main-logo"></div>
<h1 className="lead">React Data Grid </h1>
<p className="tagline">Excel-like grid component built with React</p>
<p>
<Link className="btn btn-default btn-lg" to="/examples">DEMO</Link>
<a className="btn btn-action btn-lg" href="https://github.com/adazzle/react-data-grid">DOWNLOAD NOW</a>
</p>
</div>
</div>
</header>

<div className="jumbotron">
<div className="container">
<div className="row" id="demo">
<div className="col-md-3 col-sm-6 highlight">
<div className="h-caption"><h4><i className="fa fa-flash fa-5"></i>Lightning Fast Rendering</h4></div>
<div className="h-body text-center">
<p>Combines the performance power of React as well as partial rendering techniques in order to smoothly scroll though hundreds of thousands of rows.</p>
</div>
</div>
<div className="col-md-3 col-sm-6 highlight">
<div className="h-caption"><h4><i className="fa fa-edit fa-5"></i>Rich Editing and Formatting</h4></div>
<div className="h-body text-center">
<p>View and edit cells using a wide range of formatters and editors. If these don't suit your needs, you can easily create and plugin your own</p>
</div>
</div>
<div className="col-md-3 col-sm-6 highlight">
<div className="h-caption"><h4><i className="fa fa-cogs fa-5"></i>Configurable & Customizable</h4></div>
<div className="h-body text-center">
<p>Quickly configure and customise features such as grid and column properties, row and cell renderers. As the Grid is a React component it is easy to extend and add custom functionality.</p>
</div>
</div>
<div className="col-md-3 col-sm-6 highlight">
<div className="h-caption"><h4><i className="fa fa-file-excel-o fa-5"></i>Packed full of Excel Features</h4></div>
<div className="h-body text-center">
<p>Full keyboard navigation, cell copy & paste, cell drag down, frozen columns, column resizing, sorting, filtering and many more features on the way.</p>
</div>
</div>
</div>
</div>
</div>

<div className="container-fluid">
<div className="row">
<div className="main-grid">
<div className="grid-examples">
<h3>Check out these examples</h3>
<div id="grid-examples-div">
</div>
</div>
</div>
</div>
</div>

<div className="container">
<div className="row">
<div className="jumbotron top-space">
<div className="docs-section">
<h2>Quick Start </h2>
<h3 id="js-installation">Installation</h3>
<h4>Using Common JS</h4>
<p>React Data Grid is available in the npm repository. You can install it from the command line using the following commands</p>
<p><kbd>npm install react --save</kbd></p>
<p><kbd>npm install react-data-grid --save</kbd></p>
<p>Once downloaded, require both React and React Data Grid and you should be good to go</p>
<div className="code-block js">
<pre>import React from 'react'; <br />import ReactDataGrid from 'react-data-grid';</pre>
</div>
<p>If you want to use extra features such as built in editors, formatters, toolbars and other plugins, you need to require the addons module as well</p>
<div className="code-block js">
<pre>import ReactDataGridPlugins from 'react-data-grid/addons';</pre>
</div>
<br />
<h4>Using Distribution Scripts</h4>
<p>If you prefer not to use a module system, you can reference the distribution scripts directly in your html pages. First you need to download the scripts. This can be done in 3 ways, either download directly from github source, using npm as above</p>
<div className="code-block js">
<pre>&lt;script src="//fb.me/react-0.14.6.js"&gt;&lt;/script&gt;<br />&lt;script type="text/javascript" src="react-data-grid/dist/react-data-grid.js"&gt;&lt;/script&gt;</pre>
</div>

And include react-data-grid.ui-plugins.js to use advanced features. Plugins will be availble on the ReactDataGridPlugins namespace
<div className="code-block js">
<pre>&lt;script type="text/javascript" src="react-data-grid/dist/react-data-grid.ui-plugins.js"&gt;&lt;/script&gt;"</pre>
</div>

</div>
</div>
</div>
</div>

<footer id="footer" className="top-space">

<div className="footer1">
<div className="container">
<div className="row">


</div>
</div>
</div>

<div className="footer2">
<div className="container">
<div className="row">

<div className="col-md-6 widget">
<div className="widget-body">
<p className="simplenav">

</p>
</div>
</div>

<div className="col-md-6 widget">
<div className="widget-body">

</div>
</div>

</div>
</div>
</div>

</footer>

</div>
);
}

export default Home;
19 changes: 14 additions & 5 deletions packages/react-data-grid-examples/src/components/Navbar.js
@@ -1,5 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router-dom';

import ExampleList from './ExampleList';

class Navbar extends React.Component {
Expand All @@ -8,20 +10,27 @@ class Navbar extends React.Component {
<div className="navbar navbar-fixed-top headroom" >
<div className="container">
<div className="navbar-header">
<a href="https://github.com/adazzle/react-data-grid/fork"><img className="github-ribbon" src="http://aral.github.com/fork-me-on-github-retina-ribbons/right-green@2x.png" alt="Fork me on GitHub"></img></a>
<a href="https://github.com/adazzle/react-data-grid/fork">
<img className="github-ribbon"
src="http://aral.github.com/fork-me-on-github-retina-ribbons/right-green@2x.png"
alt="Fork me on GitHub">
</img>
</a>

<button type="button" className="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"><span className="icon-bar"></span> <span className="icon-bar"></span> <span className="icon-bar"></span> </button>
<a className="navbar-brand" href="https://www.adazzle.com"><img className="header-logo" src="assets/images/AdazzleHeaderLogo.png" /></a> <a className="navbar-brand" href="index.html#">React Data Grid</a>
</div>
<div className="navbar-collapse collapse">
<ul className="nav navbar-nav pull-right">
<li className="active"><a href="index.html">Home</a></li>
<li className="active">
<Link to="/">Home</Link>
</li>
<li className="dropdown">
<a href="#" className="dropdown-toggle" data-toggle="dropdown">Documentation <b className="caret"></b></a>
<ul className="dropdown-menu">
<li><a href="documentation.html#/gettingstarted">Getting Started</a></li>
<li><a href="documentation.html#/apireference">API Reference</a></li>
<li><a href="documentation.html#/componentsDocs">Component Documentation</a></li>
<li><Link to="/documentation/gettingstarted">Getting Started</Link></li>
<li><Link to="/documentation/apireference">API Reference</Link></li>
<li><Link to="/documentation/componentsdocs">Component Docs</Link></li>
</ul>
</li>

Expand Down

0 comments on commit 656f3cb

Please sign in to comment.