Skip to content

Commit c9f9bfd

Browse files
authored
Merge pull request #128 from coreui/dev-vnext
v2.1.0
2 parents 3e8763a + 4e5d693 commit c9f9bfd

File tree

5 files changed

+80
-51
lines changed

5 files changed

+80
-51
lines changed

CHANGELOG.md

+30-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,35 @@
11
## [CoreUI](https://coreui.io/) for [react](./REACT.md) changelog
22

3+
##### `v2.1.0`
4+
- feat(SidebarNav): navLink `attributes` - optional JS object with valid JS API naming:
5+
- valid attributes: `rel`, `target`, `hidden`, `disabled`, etc...
6+
- starting with `@coreui/coreui`, `@coreui/react` version `2.1.0` and up
7+
- closes #106
8+
- item example(`./src/_nav.js`):
9+
```js
10+
{
11+
name: 'Disabled',
12+
url: '/disabled',
13+
icon: 'icon-ban',
14+
attributes: { disabled: true },
15+
},
16+
{
17+
name: 'Try CoreUI PRO',
18+
url: 'https://coreui.io/pro/react/',
19+
icon: 'cui-layers icons',
20+
variant: 'danger',
21+
attributes: { target: '_blank', rel: "noopener" },
22+
},
23+
```
24+
- fix(Cards): `card-header-actions` added to `CardHeader` for `rtl` support
25+
- feat(Dashboard): new `Suspense` example with Widget03
26+
- chore: update `@coreui/coreui` to `2.1.0`
27+
- chore: update `@coreui/react` to `2.1.0`
28+
- chore: update `node-sass` to `4.10.0`
29+
- chore: update `react` to `16.6.1`
30+
- chore: update `react-dom` to `16.6.1`
31+
- chore: update `react-test-renderer` to `16.6.1`
32+
333
##### `v2.0.14`
434
- chore: update `@coreui/coreui` to `2.0.25`
535
- chore: update `chart.js` to `2.7.3`
@@ -11,7 +41,6 @@
1141
- chore: update `react-test-renderer` to `16.6.0`
1242
- chore: update `react-scripts` to `2.1.1`
1343

14-
1544
##### `v2.0.13`
1645
- refactor: migration to [Create React App 2.0](https://reactjs.org/blog/2018/10/01/create-react-app-v2.html) cleanup
1746
- cleanup `package.json` scripts

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coreui/coreui-free-react-admin-template",
3-
"version": "2.0.14",
3+
"version": "2.1.0",
44
"description": "CoreUI React Open Source Bootstrap 4 Admin Template",
55
"author": "Łukasz Holeczek",
66
"homepage": "https://coreui.io",
@@ -12,10 +12,10 @@
1212
"url": "[email protected]:coreui/coreui-free-react-admin-template.git"
1313
},
1414
"dependencies": {
15-
"@coreui/coreui": "^2.0.25",
15+
"@coreui/coreui": "^2.1.0",
1616
"@coreui/coreui-plugin-chartjs-custom-tooltips": "^1.2.0",
1717
"@coreui/icons": "0.3.0",
18-
"@coreui/react": "^2.0.9",
18+
"@coreui/react": "^2.1.0",
1919
"bootstrap": "^4.1.3",
2020
"chart.js": "^2.7.3",
2121
"classnames": "^2.2.6",
@@ -24,16 +24,16 @@
2424
"enzyme-adapter-react-16": "^1.6.0",
2525
"flag-icon-css": "^3.2.1",
2626
"font-awesome": "^4.7.0",
27-
"node-sass": "^4.9.4",
27+
"node-sass": "^4.10.0",
2828
"prop-types": "^15.6.2",
29-
"react": "^16.6.0",
29+
"react": "^16.6.1",
3030
"react-app-polyfill": "^0.1.3",
3131
"react-chartjs-2": "^2.7.2",
32-
"react-dom": "^16.6.0",
32+
"react-dom": "^16.6.1",
3333
"react-loadable": "^5.5.0",
3434
"react-router-config": "^4.4.0-beta.6",
3535
"react-router-dom": "^4.3.1",
36-
"react-test-renderer": "^16.6.0",
36+
"react-test-renderer": "^16.6.1",
3737
"reactstrap": "^6.5.0",
3838
"simple-line-icons": "^2.4.1"
3939
},

src/_nav.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -255,18 +255,26 @@ export default {
255255
},
256256
],
257257
},
258+
{
259+
name: 'Disabled',
260+
url: '/dashboard',
261+
icon: 'icon-ban',
262+
attributes: { disabled: true },
263+
},
258264
{
259265
name: 'Download CoreUI',
260-
url: 'http://coreui.io/react/',
266+
url: 'https://coreui.io/react/',
261267
icon: 'icon-cloud-download',
262268
class: 'mt-auto',
263269
variant: 'success',
270+
attributes: { target: '_blank', rel: "noopener" },
264271
},
265272
{
266273
name: 'Try CoreUI PRO',
267-
url: 'http://coreui.io/pro/react/',
274+
url: 'https://coreui.io/pro/react/',
268275
icon: 'icon-layers',
269276
variant: 'danger',
277+
attributes: { target: '_blank', rel: "noopener" },
270278
},
271279
],
272280
};

src/views/Base/Cards/Cards.js

+13-4
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ class Cards extends Component {
5252
<Col xs="12" sm="6" md="4">
5353
<Card>
5454
<CardHeader>
55-
<i className="fa fa-check float-right"></i>Card with icon
55+
Card with icon
56+
<div className="card-header-actions">
57+
<i className="fa fa-check float-right"></i>
58+
</div>
5659
</CardHeader>
5760
<CardBody>
5861
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut
@@ -65,7 +68,9 @@ class Cards extends Component {
6568
<Card>
6669
<CardHeader>
6770
Card with switch
68-
<AppSwitch className={'float-right mb-0'} label color={'info'} defaultChecked size={'sm'}/>
71+
<div className="card-header-actions">
72+
<AppSwitch className={'float-right mb-0'} label color={'info'} defaultChecked size={'sm'}/>
73+
</div>
6974
</CardHeader>
7075
<CardBody>
7176
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut
@@ -78,7 +83,9 @@ class Cards extends Component {
7883
<Card>
7984
<CardHeader>
8085
Card with label
81-
<Badge color="success" className="float-right">Success</Badge>
86+
<div className="card-header-actions">
87+
<Badge color="success" className="float-right">Success</Badge>
88+
</div>
8289
</CardHeader>
8390
<CardBody>
8491
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut
@@ -91,7 +98,9 @@ class Cards extends Component {
9198
<Card>
9299
<CardHeader>
93100
Card with label
94-
<Badge pill color="danger" className="float-right">42</Badge>
101+
<div className="card-header-actions">
102+
<Badge pill color="danger" className="float-right">42</Badge>
103+
</div>
95104
</CardHeader>
96105
<CardBody>
97106
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut

src/views/Dashboard/Dashboard.js

+20-37
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Component } from 'react';
1+
import React, { Component, lazy, Suspense } from 'react';
22
import { Bar, Line } from 'react-chartjs-2';
33
import {
44
Badge,
@@ -20,10 +20,13 @@ import {
2020
Row,
2121
Table,
2222
} from 'reactstrap';
23-
import Widget03 from '../../views/Widgets/Widget03'
2423
import { CustomTooltips } from '@coreui/coreui-plugin-chartjs-custom-tooltips';
2524
import { getStyle, hexToRgba } from '@coreui/coreui/dist/js/coreui-utilities'
2625

26+
// import Widget03 from '../../views/Widgets/Widget03'
27+
const Widget03 = lazy(() => import('../../views/Widgets/Widget03'));
28+
const Loading = () => <div>Loading...</div>
29+
2730
const brandPrimary = getStyle('--primary')
2831
const brandSuccess = getStyle('--success')
2932
const brandInfo = getStyle('--info')
@@ -637,53 +640,33 @@ class Dashboard extends Component {
637640

638641
<Row>
639642
<Col xs="6" sm="6" lg="3">
640-
<Widget03 dataBox={() => ({ variant: 'facebook', friends: '89k', feeds: '459' })} >
641-
<div className="chart-wrapper">
642-
<Line data={makeSocialBoxData(0)} options={socialChartOpts} height={90} />
643-
</div>
644-
</Widget03>
643+
<Suspense fallback={Loading()}>
644+
<Widget03 dataBox={() => ({ variant: 'facebook', friends: '89k', feeds: '459' })} >
645+
<div className="chart-wrapper">
646+
<Line data={makeSocialBoxData(0)} options={socialChartOpts} height={90} />
647+
</div>
648+
</Widget03>
649+
</Suspense>
645650
</Col>
646651

647652
<Col xs="6" sm="6" lg="3">
648-
<div className="brand-card">
649-
<div className="brand-card-header bg-twitter">
650-
<i className="fa fa-twitter"></i>
653+
<Suspense fallback={Loading()}>
654+
<Widget03 dataBox={() => ({ variant: 'twitter', followers: '973k', tweets: '1.792' })} >
651655
<div className="chart-wrapper">
652656
<Line data={makeSocialBoxData(1)} options={socialChartOpts} height={90} />
653657
</div>
654-
</div>
655-
<div className="brand-card-body">
656-
<div>
657-
<div className="text-value">973k</div>
658-
<div className="text-uppercase text-muted small">followers</div>
659-
</div>
660-
<div>
661-
<div className="text-value">1.792</div>
662-
<div className="text-uppercase text-muted small">tweets</div>
663-
</div>
664-
</div>
665-
</div>
658+
</Widget03>
659+
</Suspense>
666660
</Col>
667661

668662
<Col xs="6" sm="6" lg="3">
669-
<div className="brand-card">
670-
<div className="brand-card-header bg-linkedin">
671-
<i className="fa fa-linkedin"></i>
663+
<Suspense fallback={Loading()}>
664+
<Widget03 dataBox={() => ({ variant: 'linkedin', contacts: '500+', feeds: '292' })} >
672665
<div className="chart-wrapper">
673666
<Line data={makeSocialBoxData(2)} options={socialChartOpts} height={90} />
674667
</div>
675-
</div>
676-
<div className="brand-card-body">
677-
<div>
678-
<div className="text-value">500+</div>
679-
<div className="text-uppercase text-muted small">contacts</div>
680-
</div>
681-
<div>
682-
<div className="text-value">292</div>
683-
<div className="text-uppercase text-muted small">feeds</div>
684-
</div>
685-
</div>
686-
</div>
668+
</Widget03>
669+
</Suspense>
687670
</Col>
688671

689672
<Col xs="6" sm="6" lg="3">

0 commit comments

Comments
 (0)