Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3cf45b3

Browse filesBrowse files
authored
Merge pull request coreui#53 from coreui/dev-vnext
v.2.1.2
2 parents ebaf844 + d43f49a commit 3cf45b3
Copy full SHA for 3cf45b3

File tree

Expand file treeCollapse file tree

6 files changed

+86
-30
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+86
-30
lines changed

‎CHANGELOG.md

Copy file name to clipboardExpand all lines: CHANGELOG.md
+22-13Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
### [@coreui/react](https://coreui.io/) changelog
22

3+
##### `v2.1.2`
4+
- refactor: remove `element-closest` dependency issue #37 #50
5+
- chore: update `core-js` to `2.6.1`
6+
- chore: update `enzyme` to `3.8.0`
7+
- chore: update `enzyme-adapter-react-16` to `1.7.1`
8+
- chore: update `eslint` to `5.10.0`
9+
- chore: update `react` to `16.7.0`
10+
- chore: update `react-dom` to `16.7.0`
11+
312
##### `v2.1.1`
4-
chore: update `enzyme-adapter-react-16` to `1.7.0`
5-
chore: update `eslint` to `5.9.0`
6-
chore: update `react-dom` to `16.6.3`
7-
chore: update `react` to `16.6.3`
13+
- chore: update `enzyme-adapter-react-16` to `1.7.0`
14+
- chore: update `eslint` to `5.9.0`
15+
- chore: update `react-dom` to `16.6.3`
16+
- chore: update `react` to `16.6.3`
817

918
##### `v2.1.0`
1019
- feat(SidebarNav): navLink `attributes` - optional JS object with valid JS API naming:
1120
- valid attributes: `rel`, `target`, `hidden`, `disabled`, etc...
1221
- item example:
13-
```js
14-
{
15-
name: 'Try CoreUI PRO',
16-
url: 'https://coreui.io/pro/react/',
17-
icon: 'cui-layers icons',
18-
variant: 'danger',
19-
attributes: { target: '_blank', rel: "noopener" },
20-
},
21-
```
22+
```
23+
{
24+
name: 'Try CoreUI PRO',
25+
url: 'https://coreui.io/pro/react/',
26+
icon: 'cui-layers icons',
27+
variant: 'danger',
28+
attributes: { target: '_blank', rel: "noopener" },
29+
},
30+
```
2231
- update `@coreui/coreui` to `2.1.0` - sidebar-nav-link-disabled-*
2332
- chore: update `react-perfect-scrollbar` to `1.4.2`
2433
- chore: update `eslint` to `5.8.0`

‎demo/src/polyfill.js

Copy file name to clipboardExpand all lines: demo/src/polyfill.js
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import 'core-js/es7/object'
2626
// Used for reflect-metadata in JIT. If you use AOT (and only Angular decorators), you can remove.
2727
// import 'core-js/es7/reflect'
2828

29-
import 'element-closest'
30-
3129
// CustomEvent() constructor functionality in IE9, IE10, IE11
3230
(function () {
3331

‎demo/src/scss/style.css

Copy file name to clipboardExpand all lines: demo/src/scss/style.css
+19-3Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@charset "UTF-8";
22
/*!
33
* CoreUI - Open Source Dashboard UI Kit
4-
* @version v2.1.1
4+
* @version v2.1.4
55
* @link https://coreui.io
66
* Copyright (c) 2018 creativeLabs Łukasz Holeczek
77
* Licensed under MIT (https://coreui.io/license)
@@ -12,6 +12,7 @@
1212
* Copyright 2011-2018 Twitter, Inc.
1313
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
1414
*/
15+
1516
:root {
1617
--blue: #20a8d8;
1718
--indigo: #6610f2;
@@ -12054,12 +12055,19 @@ canvas {
1205412055
.sidebar-minimized .sidebar .nav-item:hover > .nav-link .nav-icon {
1205512056
color: #fff;
1205612057
}
12057-
.sidebar-minimized .sidebar .nav-item:hover > .nav-link.disabled {
12058+
.sidebar-minimized .sidebar .nav-item:hover .nav-link.disabled,
12059+
.sidebar-minimized .sidebar .nav-item:hover .nav-link :disabled {
1205812060
background: #2f353a;
1205912061
}
12060-
.sidebar-minimized .sidebar .nav-item:hover > .nav-link.disabled .nav-icon {
12062+
.sidebar-minimized .sidebar .nav-item:hover .nav-link.disabled .nav-icon,
12063+
.sidebar-minimized .sidebar .nav-item:hover .nav-link :disabled .nav-icon {
1206112064
color: #73818f;
1206212065
}
12066+
.sidebar-minimized .sidebar section :not(.nav-dropdown-items) > .nav-item:last-child::after {
12067+
display: block;
12068+
margin-bottom: 50px;
12069+
content: "";
12070+
}
1206312071
.sidebar-minimized .sidebar .nav-link {
1206412072
position: relative;
1206512073
padding-left: 0;
@@ -14168,3 +14176,11 @@ body {
1416814176
breakpoint-xl: 1200px;
1416914177
}
1417014178
/*# sourceMappingURL=coreui.css.map */
14179+
14180+
/* ie11 floating footer temp fix, react only */
14181+
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
14182+
#demo {
14183+
display: flex;
14184+
flex-direction: column;
14185+
}
14186+
}

‎package.json

Copy file name to clipboardExpand all lines: package.json
+7-8Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@coreui/react",
3-
"version": "2.1.1",
3+
"version": "2.1.2",
44
"description": "CoreUI React Bootstrap 4 components",
55
"license": "MIT",
66
"author": {
@@ -37,8 +37,7 @@
3737
"dependencies": {
3838
"@coreui/icons": "0.3.0",
3939
"classnames": "^2.2.6",
40-
"core-js": "^2.5.7",
41-
"element-closest": "^2.0.2",
40+
"core-js": "^2.6.1",
4241
"prop-types": "^15.6.2",
4342
"react-onclickout": "^2.0.8",
4443
"react-perfect-scrollbar": "^1.4.2",
@@ -51,14 +50,14 @@
5150
},
5251
"devDependencies": {
5352
"babel-eslint": "^10.0.1",
54-
"enzyme": "^3.7.0",
55-
"enzyme-adapter-react-16": "^1.7.0",
56-
"eslint": "^5.9.0",
53+
"enzyme": "^3.8.0",
54+
"enzyme-adapter-react-16": "^1.7.1",
55+
"eslint": "^5.10.0",
5756
"eslint-plugin-import": "^2.14.0",
5857
"eslint-plugin-react": "^7.11.1",
5958
"nwb": "^0.23.0",
60-
"react": "^16.6.3",
61-
"react-dom": "^16.6.3",
59+
"react": "^16.7.0",
60+
"react-dom": "^16.7.0",
6261
"sinon": "^5.1.1"
6362
},
6463
"repository": {

‎src/Shared/element-closest.js

Copy file name to clipboard
+33Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
(function (ElementProto) {
2+
if (!ElementProto) {
3+
return;
4+
}
5+
if (typeof ElementProto.matches !== 'function') {
6+
ElementProto.matches = ElementProto.msMatchesSelector || ElementProto.mozMatchesSelector || ElementProto.webkitMatchesSelector || function matches(selector) {
7+
const element = this;
8+
const elements = (element.document || element.ownerDocument).querySelectorAll(selector);
9+
let index = 0;
10+
11+
while (elements[index] && elements[index] !== element) {
12+
++index;
13+
}
14+
15+
return Boolean(elements[index]);
16+
};
17+
}
18+
19+
if (typeof ElementProto.closest !== 'function') {
20+
ElementProto.closest = function closest(selector) {
21+
let element = this;
22+
23+
while (element && element.nodeType === 1) {
24+
if (element.matches(selector)) {
25+
return element;
26+
}
27+
element = element.parentNode;
28+
}
29+
30+
return null;
31+
};
32+
}
33+
})(typeof window !== 'undefined' && window.Element.prototype);

‎src/Sidebar.js

Copy file name to clipboardExpand all lines: src/Sidebar.js
+5-4Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import classNames from 'classnames';
33
import PropTypes from 'prop-types';
44
import { sidebarCssClasses } from './Shared';
55
import ClickOutHandler from 'react-onclickout'
6-
import 'element-closest'
6+
import './Shared/element-closest'
77

88
const propTypes = {
99
children: PropTypes.node,
@@ -80,10 +80,11 @@ class AppSidebar extends Component {
8080
}
8181

8282
onClickOut(e) {
83-
if (!e.target.closest('[data-sidebar-toggler]')) {
84-
this.hideMobile();
83+
if (typeof window !== 'undefined' && document.body.classList.contains('sidebar-show')) {
84+
if (!e.target.closest('[data-sidebar-toggler]')) {
85+
this.hideMobile();
86+
}
8587
}
86-
8788
}
8889

8990
render() {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.