From 63dd5ffd05783a6e2949ec08fd41733e139ee2fd Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 8 Oct 2018 16:10:55 +1300 Subject: [PATCH 1/4] feature: adds badge on sidebar parent menus closes feature/sidebar-badge-on-parent-menus --- demo/src/scss/style.css | 4 ++++ src/SidebarNav.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/demo/src/scss/style.css b/demo/src/scss/style.css index 614b2d0c..05f30ac8 100644 --- a/demo/src/scss/style.css +++ b/demo/src/scss/style.css @@ -11656,6 +11656,10 @@ canvas { margin-top: 2px; } +.sidebar .nav-link.nav-dropdown-toggle .badge { + margin-right: 16px; +} + .sidebar .nav-link.active { color: #fff; background: #3a4248; diff --git a/src/SidebarNav.js b/src/SidebarNav.js index a18385c2..8b7e4d8a 100644 --- a/src/SidebarNav.js +++ b/src/SidebarNav.js @@ -111,7 +111,7 @@ class AppSidebarNav extends Component { const classIcon = classNames('nav-icon', item.icon); return (
  • - {item.name} + {item.name}{this.navBadge(item.badge)}
      {this.navList(item.children)}
    From 9692a0234e7f7cc3e7a6eea6ce08b0c59a240977 Mon Sep 17 00:00:00 2001 From: xidedix Date: Mon, 8 Oct 2018 15:30:00 +0200 Subject: [PATCH 2/4] fix(SidebarNav): handleClick currentTarget open --- src/SidebarNav.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SidebarNav.js b/src/SidebarNav.js index 8b7e4d8a..51b92e8a 100644 --- a/src/SidebarNav.js +++ b/src/SidebarNav.js @@ -41,7 +41,7 @@ class AppSidebarNav extends Component { handleClick(e) { e.preventDefault(); - e.target.parentElement.classList.toggle('open'); + e.currentTarget.parentElement.classList.toggle('open'); } activeRoute(routeName, props) { From 9a69297c513757da1c3269d925fb34aac555ab67 Mon Sep 17 00:00:00 2001 From: xidedix Date: Mon, 8 Oct 2018 15:44:59 +0200 Subject: [PATCH 3/4] chore(demo): style.css update to `@coreui/coreui v2.0.15` --- demo/src/scss/style.css | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/demo/src/scss/style.css b/demo/src/scss/style.css index 05f30ac8..db6c6ee2 100644 --- a/demo/src/scss/style.css +++ b/demo/src/scss/style.css @@ -1,7 +1,7 @@ @charset "UTF-8"; /*! * CoreUI - Open Source Dashboard UI Kit - * @version v2.0.14 + * @version v2.0.15 * @link https://coreui.io * Copyright (c) 2018 creativeLabs Ɓukasz Holeczek * Licensed under MIT (https://coreui.io/license) @@ -11656,10 +11656,6 @@ canvas { margin-top: 2px; } -.sidebar .nav-link.nav-dropdown-toggle .badge { - margin-right: 16px; -} - .sidebar .nav-link.active { color: #fff; background: #3a4248; @@ -11832,6 +11828,10 @@ canvas { transition: transform .3s, -webkit-transform .3s; } +.sidebar .nav-dropdown-toggle .badge { + margin-right: 16px; +} + .sidebar .nav-dropdown.open { background: rgba(0, 0, 0, 0.2); } @@ -12072,6 +12072,11 @@ canvas { margin-top: 2px; } +*[dir="rtl"] .sidebar .nav-link.nav-dropdown-toggle .badge { + margin-right: auto; + margin-left: 16px; +} + *[dir="rtl"] .sidebar-minimized .sidebar .nav { list-style-type: disc; } From 43d8fef5f80094b227980a5e2856afea12cfe876 Mon Sep 17 00:00:00 2001 From: xidedix Date: Mon, 8 Oct 2018 15:45:20 +0200 Subject: [PATCH 4/4] Ship: v2.0.9 --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc235d8e..f209a16f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ### [@coreui/react](https://coreui.io/) changelog +##### `v2.0.9` +- feat(Sidebar): badge on parent dropdown - thanks @jeff-nz +- fix(SidebarNav): handleClick() target->currentTarget open +- chore(demo): style.css update to `@coreui/coreui v2.0.15` + ##### `v2.0.8` - refactor(SidebarMinimizer): extract `togglePs` method - refactor(SidebarMinimizer): for use `togglePs` method diff --git a/package.json b/package.json index a1817cca..bdcff6ee 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/react", - "version": "2.0.8", + "version": "2.0.9", "description": "CoreUI React Bootstrap 4 components", "license": "MIT", "author": {