diff --git a/CHANGELOG.md b/CHANGELOG.md index d82928f6..0e102760 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,24 @@ All notable changes to this project will be documented in this file. Dates are displayed in UTC. +#### [3.1.0](https://github.com/coreui/coreui-react/compare/3.0.6...3.1.0) + +> 23 July 2020 + +- chore: modify library build [`62194bb`](https://github.com/coreui/coreui-react/commit/62194bb147e9327037778f951936663c14dc28e3) +- refactor: add full propTypes to className prop in components [`cd9c98a`](https://github.com/coreui/coreui-react/commit/cd9c98a890c9717db3a882e39ac3ccde9a711db6) +- chore: 3.1.0 release: update dependencies [`174370e`](https://github.com/coreui/coreui-react/commit/174370e754abf484bc47fba0641b7a3732e16de0) +- fix: delete disabled string type from 'innerRef' prop [`5c91a7f`](https://github.com/coreui/coreui-react/commit/5c91a7f3fe705738508c9c79cb7edfd0694444fd) +- chore: refactor typings [`7c584e4`](https://github.com/coreui/coreui-react/commit/7c584e4da250d7405080c59bc4721d0d4042bc16) +- fix: make components using Transition component use new API #127 [`eba59c2`](https://github.com/coreui/coreui-react/commit/eba59c22abf28c55dc433e5cf5e8715cba9d12e0) +- chore: add missing dependency [`0bb44f8`](https://github.com/coreui/coreui-react/commit/0bb44f8f9a406857c8652ce0fa548b458249a59e) +- chore: update changelog [`14b0c52`](https://github.com/coreui/coreui-react/commit/14b0c52cbc3562792df5b73d6b58e668971111d8) +- fix: CTabPane: fix passing innerRef [`7fa5601`](https://github.com/coreui/coreui-react/commit/7fa5601bd389078f7312b81c26962f2502dd6a87) +- fix: CAlert: add innerRef prop [`c1022a8`](https://github.com/coreui/coreui-react/commit/c1022a8cc83b1a898bd18e774751597210108177) +- feat: CSidebarNavItem: add possibility of passing icon as node [`520dc49`](https://github.com/coreui/coreui-react/commit/520dc49c2d1d1b39871ab864e64a8da18cef4273) +- fix: CModal: fix deprecation warning [`ad88025`](https://github.com/coreui/coreui-react/commit/ad8802576a22fa612883e3d928087f234c402d60) +- fix: CDropdownToggle: add role attribute in case of non-button tag [`4de6508`](https://github.com/coreui/coreui-react/commit/4de6508bbfdb128c07042b4c08e2bccc8b731988) + #### [3.0.6](https://github.com/coreui/coreui-react/compare/3.0.5...3.0.6) > 15 July 2020 @@ -9,6 +27,7 @@ All notable changes to this project will be documented in this file. Dates are d - chore: 3.0.6 release - update dependencies [`86cdba4`](https://github.com/coreui/coreui-react/commit/86cdba439efcc0eba1dc795579e0f7c32c8475fa) - chore: dependencies update [`b49a95d`](https://github.com/coreui/coreui-react/commit/b49a95d19584356ef69cc174c6ba01a2f9144ee2) - chore: CCol: add 'xxl' breakpoint, clean component #128 [`4dd4704`](https://github.com/coreui/coreui-react/commit/4dd4704433e8bb3ab875a9db52cc31f67c010d27) +- chore: Changelog update [`f1c00e8`](https://github.com/coreui/coreui-react/commit/f1c00e822644f9ea75fad7e11d014d9d78558fc6) #### [3.0.5](https://github.com/coreui/coreui-react/compare/3.0.4...3.0.5) @@ -31,6 +50,8 @@ All notable changes to this project will be documented in this file. Dates are d - chore: add auto-changelog [`dd56a22`](https://github.com/coreui/coreui-react/commit/dd56a22df2479371b33abc3802fb4f0406525fe1) - chore: 3.0.3 version release: update dependencies and changelog [`293c637`](https://github.com/coreui/coreui-react/commit/293c63726e1a477af657d6b13fa619cba3ecde2f) - fix: CModal: fix animations [`7740fce`](https://github.com/coreui/coreui-react/commit/7740fcee3583d0fd9324f23d1cd12f0c9914b19a) +- fix: CBreadcrumbRouter: add route parameters support #118 [`6d8b59b`](https://github.com/coreui/coreui-react/commit/6d8b59b9cfa145a30f4e54832941ce28ef514e29) +- feat: CDataTable: add footerSlot prop [`4d68dc8`](https://github.com/coreui/coreui-react/commit/4d68dc8f31ac724b79a003d2c6240b6f064e6cd4) #### [3.0.2](https://github.com/coreui/coreui-react/compare/3.0.1...3.0.2) @@ -53,6 +74,8 @@ All notable changes to this project will be documented in this file. Dates are d - fix: delete excessive components - CListGroupItemHeading/Text [`3681ad2`](https://github.com/coreui/coreui-react/commit/3681ad24225078f338d2b3d646ca71bf70de4095) - chore: 3.0.0 release [`aec0f09`](https://github.com/coreui/coreui-react/commit/aec0f093e08d92d38a3e633623e61971d7e93d67) - fix: prevent breaking change in CListGroupItemHeading/Text [`8299524`](https://github.com/coreui/coreui-react/commit/829952493cbd84ebc607ec748617fb9d666354d2) +- feat: CSidebarNavItem: add color prop [`12c2ba3`](https://github.com/coreui/coreui-react/commit/12c2ba3b26d8cdc3aa6e9937f9ad3333a13e7788) +- fix: CFade: assign nodeRef to Transition to prevent warning [`907e59a`](https://github.com/coreui/coreui-react/commit/907e59a6297a2221567aab5cba8548ec28e204e5) #### [3.0.0-rc.2](https://github.com/coreui/coreui-react/compare/v2.5.8...3.0.0-rc.2) @@ -63,3 +86,197 @@ All notable changes to this project will be documented in this file. Dates are d - CoreUI v3.0.0-alpha.0 for React - demo update WIP [`c8905a3`](https://github.com/coreui/coreui-react/commit/c8905a3d86731d2a494fba52abed062a400a0830) - chore: delete demo [`5ef9a37`](https://github.com/coreui/coreui-react/commit/5ef9a375a1ecdaf509c57a72fffe76054c1dd69f) - chore: update dependencies add package-lock.json to github [`d37cc9b`](https://github.com/coreui/coreui-react/commit/d37cc9bb61aa726b21bc645050bf78bf4bebb6fb) +- CoreUI v3.0.0-alpha.0 for React - initial commit [`9113dbd`](https://github.com/coreui/coreui-react/commit/9113dbd668d66556ddbf2c2154763fab388832e9) +- chore: 3.0.0-beta.3 release - update dependencies and clean docs [`7a71431`](https://github.com/coreui/coreui-react/commit/7a7143183efe0846fdaad5a49750f2fd5ac31968) +- chore: 3.0.0-beta.4 release [`f8c1a8b`](https://github.com/coreui/coreui-react/commit/f8c1a8b712316882855b5411847b2886bc551fab) +- chore: 3.0.0-beta.1 release [`99dd67f`](https://github.com/coreui/coreui-react/commit/99dd67f60ef5d46b150bb20bb4940f9c9ec9557a) +- chore: delete legacy components [`ab3aa58`](https://github.com/coreui/coreui-react/commit/ab3aa58f3cccf2a62f6035bb0fdc6b0fda8f1b40) +- feat: add typings [`54dc1c6`](https://github.com/coreui/coreui-react/commit/54dc1c6dc2f868b00e694f16c0a4245cc5bccf49) +- fix: CDataTable: many fixes and API changes [`a6085ce`](https://github.com/coreui/coreui-react/commit/a6085cef91fb9989a883e2771e35ace582e3f269) +- - update: merge with new tooltip/popover (based on tipy.js) [`11a09d1`](https://github.com/coreui/coreui-react/commit/11a09d1da26fb196fae3722b153af2be4717ed15) +- refactor: remove cssModules functionality [`df8c4c0`](https://github.com/coreui/coreui-react/commit/df8c4c0592de7a57f1c5f6844266eeaf378be1de) +- update: popper update try, error with ver. 2.1: [`ef92bac`](https://github.com/coreui/coreui-react/commit/ef92bac50a4fbf35319740b9eac9d69f539726f8) +- fix: CCarousel: rewrite components [`4e8ac70`](https://github.com/coreui/coreui-react/commit/4e8ac7086f266fb86ae9aff89a75f9401bef91d1) +- fix: form components refactor: [`a3b3ccc`](https://github.com/coreui/coreui-react/commit/a3b3ccc7e9ebd0f612bf57f9b834a82d56448ff7) +- refactor: extract CIcons, CCharts, minor changes [`a4c5e8c`](https://github.com/coreui/coreui-react/commit/a4c5e8c1a0865b9f5328818ace0a194f61515dda) +- chore: 3.0.0-beta.2 release [`f6160fc`](https://github.com/coreui/coreui-react/commit/f6160fcb82dd645e7e8b557987473dd923357dda) +- fix: Sidebar components rewrite: make them similar to Vue version [`8706cf0`](https://github.com/coreui/coreui-react/commit/8706cf077ccf6ac89fb0010d538c3babcd18607d) +- fix: leave one state of CCarousel definition [`db633c8`](https://github.com/coreui/coreui-react/commit/db633c8cbaa988ef1fa120e16a26fb957be0c6ea) +- fix: CModal component rewrite - simplify component [`55ceeef`](https://github.com/coreui/coreui-react/commit/55ceeef186fbe3f487d750e0e347728aa717e330) +- refactor: change project folder architecture [`dcb2fd8`](https://github.com/coreui/coreui-react/commit/dcb2fd88be9593b89930570753d5dc0faba73114) +- chore: cleanup [`4bbe3d3`](https://github.com/coreui/coreui-react/commit/4bbe3d3ac426902dc345e63c629a30470953c0c6) +- fix: CDropdown: component rewrite: [`14c2675`](https://github.com/coreui/coreui-react/commit/14c26757d0abf34675a5d1125cd8109c83f98888) +- fix: components cleanup [`f25cf59`](https://github.com/coreui/coreui-react/commit/f25cf590c24452e620b2e51c94164ea92c0fa1f6) +- fix: refactor CToast components: [`4741e67`](https://github.com/coreui/coreui-react/commit/4741e6707afd8f86d15e83f80f76e440b61898d6) +- fix: Breadcrumb components rewrite [`6d0e7fa`](https://github.com/coreui/coreui-react/commit/6d0e7fa293392f80dfb8a600f5f6f75d37d35e0b) +- fix: delete unneeded components [`99586ab`](https://github.com/coreui/coreui-react/commit/99586ab3e5fb409105ac6d4570605583ca53362d) +- fix: rewrite Brand components - make Brands simple wrappers [`ce4fdeb`](https://github.com/coreui/coreui-react/commit/ce4fdeb2ebbf90d9b36c16535800367927769c44) +- fix: CPagination: component rewrite according to Vue functionality [`097d359`](https://github.com/coreui/coreui-react/commit/097d359c4fd72480d211b83fc5188a82ca62133c) +- fix: merge CCollapse components, delete 'custom' and 'toggle' props [`63ba549`](https://github.com/coreui/coreui-react/commit/63ba54920d972ddd778216409f4134d3dd9fdcf0) +- - update: warnings removed [`aa50395`](https://github.com/coreui/coreui-react/commit/aa503958be9a290379f1561a042e1ece7c22062d) +- chore: delete dead code [`f6d2210`](https://github.com/coreui/coreui-react/commit/f6d2210586593a935c27f37daf36d442ae3b4d1c) +- docs: changelog cleanup [`c6c3b39`](https://github.com/coreui/coreui-react/commit/c6c3b39a6795169119c24e27ce1ef7216a04089d) +- fix: fix typings [`4631662`](https://github.com/coreui/coreui-react/commit/4631662660531fa847ec8211779027f215081a4a) +- fix: components cleanup [`7108882`](https://github.com/coreui/coreui-react/commit/71088829915be675fc66ea99345f47a44bfdb899) +- fix: CProgress: rewrite component similar to Vue version [`0781c4a`](https://github.com/coreui/coreui-react/commit/0781c4a939c4bf1a18ae17dd556022eb92e132dd) +- feat: improve Tab activation mechanism, fix bugs [`625c04b`](https://github.com/coreui/coreui-react/commit/625c04b256fccfa9428271b26bad4c57f2487c88) +- fix: CSidebar wrapper components fixes [`d17c8ff`](https://github.com/coreui/coreui-react/commit/d17c8ff8c55b8d367b55cbdd99fd4fa408dcb86c) +- refactor: clean components with fade functionality [`e23dd3f`](https://github.com/coreui/coreui-react/commit/e23dd3fc8b785ec7730ae072d21170a25af4bd4e) +- - fix: CSidebar - merge with Krzysiek [`a47bca1`](https://github.com/coreui/coreui-react/commit/a47bca1ec0a4fad34342229a2a44fbd0fb0b1cce) +- fix: CSwitch component fixes: [`4f7e74b`](https://github.com/coreui/coreui-react/commit/4f7e74b84ce2d5a37081ee3c8b1e6d15dda34669) +- - fix: CDropdownMenu: component rewrite [`9ce0f00`](https://github.com/coreui/coreui-react/commit/9ce0f00d8a0c054f557a46dbaede4ab409dbe956) +- fix: CDropdownToggle: component rewrite [`137965e`](https://github.com/coreui/coreui-react/commit/137965ed782b04e51d28e0803e98d96e78efacdf) +- chore: CListGroupItemHeading, CListGroupItemText - clean components [`118fa2a`](https://github.com/coreui/coreui-react/commit/118fa2a1f7e2e8926c2635bcbd27bcedb4a41925) +- fix: CEmbed refactor: [`ee82fa0`](https://github.com/coreui/coreui-react/commit/ee82fa0d63539eafa813876cf65d12e4a8a54bfe) +- fix: CDropdownItem, CDropdownHeader, CDropdownDivider: [`d0d000e`](https://github.com/coreui/coreui-react/commit/d0d000ec5ee88416365ec094f288afa86365fddc) +- fix: CMedia: reduce components to basic functionality [`d175ad5`](https://github.com/coreui/coreui-react/commit/d175ad590d84dfc627efbeb5270145357e148871) +- fix: CCardBody, CCardHeader, CCardFooter: add misiing props [`4171551`](https://github.com/coreui/coreui-react/commit/41715510539bd596e5550c4335f7ed54c1d1f98b) +- refactor: CCard: Reduce column, deck, group components to CCardGroup [`707b3f8`](https://github.com/coreui/coreui-react/commit/707b3f84c4909320ab19ad606b88778ce5f548c7) +- fix: turn CHeader sub-components to simple wrappers without props [`ddf287e`](https://github.com/coreui/coreui-react/commit/ddf287e3d86e7b34cdad5795dc8a15b4c4363858) +- - update: custom is true by default [`4827eb9`](https://github.com/coreui/coreui-react/commit/4827eb9a5ea5d947fde443e8c6b9d8afdf85b43d) +- fix: peerDependencies [`bd0903a`](https://github.com/coreui/coreui-react/commit/bd0903aa1e3939bda2863b015e140841b653a3b9) +- - update: react-popper v 2.1 added [`d043f6c`](https://github.com/coreui/coreui-react/commit/d043f6c7f0fc6fc5175cce4e1e33d558730cbca0) +- feat: add CElementCover component [`9a254db`](https://github.com/coreui/coreui-react/commit/9a254db32c82ec664db18394cdb10b0aa4a6573f) +- chore: delete CCustomInput component [`54f6aef`](https://github.com/coreui/coreui-react/commit/54f6aefe653842ffabbf099b7015a48ef5b78ec6) +- fix: CWidgetBrand: fix wrong texts diplay, clean the component [`3431017`](https://github.com/coreui/coreui-react/commit/343101714259843a8be8219f33b4bfed80c9ef45) +- fix: CLink: component refactor [`61859ed`](https://github.com/coreui/coreui-react/commit/61859ed4a72b3989d2cf64b8d6760fea6a426d94) +- fix: CWidgetIcon: component API fix [`ea43b6b`](https://github.com/coreui/coreui-react/commit/ea43b6ba002b90e4ab171f8d1508ef59baf3e375) +- feat: added internal CScrollbar component allowing menu animation [`50f8661`](https://github.com/coreui/coreui-react/commit/50f8661c1698302e70c55b96d541e83427287c32) +- fix: CButton: component refactor [`5770132`](https://github.com/coreui/coreui-react/commit/5770132be29a73f25b7fe36b9a0ae7ac920aceb6) +- chore: change Shared folder name to utils [`7cd4900`](https://github.com/coreui/coreui-react/commit/7cd4900406a1cbbff0d7590147064cb84e9ed0b2) +- chore: delete obsolete CPopoverBody and CPopoverHeader components [`775f0fa`](https://github.com/coreui/coreui-react/commit/775f0fa97ea36e992dafd45a11592decd8b154a7) +- fix: CListGroup, CListGroupItem fixes: [`950fab5`](https://github.com/coreui/coreui-react/commit/950fab53f15d1dbf9af4e2d4c793964ca733cf83) +- fix: rename CHeaderSubheader to CSubheader, clean component [`302dd82`](https://github.com/coreui/coreui-react/commit/302dd82dcda686a2bdba7ae5b546ded6c15f5983) +- fix: CWidgetSimple: component API fix [`abfb1d1`](https://github.com/coreui/coreui-react/commit/abfb1d1d023889bcc9685f95df0dd3c6fdadeee2) +- fix: CWidgetProgressIcon: component API fix [`2b17cd7`](https://github.com/coreui/coreui-react/commit/2b17cd7b5d6ea4bf49e7efa1dba8c6fea98fb2bc) +- fix: CWidgetProgress: component API fix [`a80ec4a`](https://github.com/coreui/coreui-react/commit/a80ec4a0d87bc2ac0b21943ff3107f4d7d6d8680) +- fix: remove possibility of inheriting advanced transition options [`97ea903`](https://github.com/coreui/coreui-react/commit/97ea903a309b6acc8e82a6b6d56a86cc3802490e) +- fix: CCollapse: fix component [`1aa4b69`](https://github.com/coreui/coreui-react/commit/1aa4b69e900c60f6eb00f6384a92e6735cf08f6f) +- chore: CPortal: disable using component until it is well tested [`98ad19d`](https://github.com/coreui/coreui-react/commit/98ad19d3f393a2d651dbd8516a7148c6610f362c) +- fix: CCard: delete 'custom' and corelating props [`e0f9c06`](https://github.com/coreui/coreui-react/commit/e0f9c0687f4f85d0ada02ffbf09c4b5bb0fea292) +- fix: CSidebarMinimizer: component refactor [`b933237`](https://github.com/coreui/coreui-react/commit/b9332372f8ab0e1dbb681f887e4c0dc4a7fe0e8e) +- fix: CModalHeader: simplify component: [`145fb7a`](https://github.com/coreui/coreui-react/commit/145fb7a8e7abb769ab28ad636ac367fd7a3308e9) +- fix: CTable: simplify to simple wrapper [`549d954`](https://github.com/coreui/coreui-react/commit/549d954db092496b45fb8d4605485153143dce98) +- - fix: CDataTable component - now with Vue Scoped Slots prop equivalent [`abd9ff1`](https://github.com/coreui/coreui-react/commit/abd9ff104f215350045b69479f7b68d9d241330e) +- fix: CWidgetDropdown: fix bugs: [`0aa4c8b`](https://github.com/coreui/coreui-react/commit/0aa4c8ba5f5bd746e9b52357bb55ba5ce66f1795) +- fix: CToggler: delete 'custom' and 'type' props, clear component [`de0e368`](https://github.com/coreui/coreui-react/commit/de0e368cbe56cdcc539e93d579f99584831188dd) +- fix: fix modal animation mechanism [`3165af9`](https://github.com/coreui/coreui-react/commit/3165af9228ffe4a50d6a34401530362be5a58c64) +- - update: innerRef value set [`6a01afc`](https://github.com/coreui/coreui-react/commit/6a01afc05488573c8ab2100f0d8ed10790be688e) +- refactor: CTooltip: limit main props to essential [`3d36c5c`](https://github.com/coreui/coreui-react/commit/3d36c5cfeca9eb8a61027261aa8eb516b96b40ac) +- fix: CSpinner: component refactor [`5066958`](https://github.com/coreui/coreui-react/commit/50669580ea8af68ed059790ba16bce00c1961783) +- fix: CNavItem: delete custom prop and correlated functionalities [`540e8c2`](https://github.com/coreui/coreui-react/commit/540e8c204c0c67139f3f54d8bd75048fc462dd5f) +- - fix: CDataTable sorting [`80d6e20`](https://github.com/coreui/coreui-react/commit/80d6e20e333285d8945109bc041fafc126e8b176) +- fix: CCardImg: Inherit CImg functionalities, change placemnt to variant [`fe1800e`](https://github.com/coreui/coreui-react/commit/fe1800e0850301cb01237487a8f4fbfbbccf0769) +- chore: CImg: clean component [`032fc29`](https://github.com/coreui/coreui-react/commit/032fc29aaf1db4393a5c8dd3a34a967e86d5006a) +- docs: README update [`18b1384`](https://github.com/coreui/coreui-react/commit/18b13848194550bd717eb5836f91ddd40829e7be) +- fix: CNav: delete 'horizontal' prop, clear component [`f5f4dd1`](https://github.com/coreui/coreui-react/commit/f5f4dd16bb86b3c35f5cd22b8a62afd465b0c7a5) +- refactor: CNavLink: concise component [`a4634fb`](https://github.com/coreui/coreui-react/commit/a4634fbac11df253fe7af8c7a437592834057f72) +- fix: fix memory leaks in components using timeouts [`129bb59`](https://github.com/coreui/coreui-react/commit/129bb59afb52e9425dd19a77b0d00181534e6af4) +- refactor: CCardLink: optimize definition [`8c65f88`](https://github.com/coreui/coreui-react/commit/8c65f882b54516b0441b99d160cc433f31618053) +- fix: CButtonClose: component refactor [`a24f91c`](https://github.com/coreui/coreui-react/commit/a24f91c8ab021b6e1514f57cbf29e0c8d45ded77) +- feat: add CModalTitle component [`c1c3033`](https://github.com/coreui/coreui-react/commit/c1c303319b2a47c60ddeef4a36824e5ff58360d2) +- fix: CBadge: allow inheriting CLink functionality, smaller fixes [`35c3df6`](https://github.com/coreui/coreui-react/commit/35c3df6537b22425b48272a6cb1d23c13684ae5e) +- fix: missing helper exports, minor fixes [`fb4d8e3`](https://github.com/coreui/coreui-react/commit/fb4d8e3c868a386fa34e04e83880facac31eb5e7) +- fix: CNavbar: change sticky prop to bool, small fixes, clean code [`c6fbff2`](https://github.com/coreui/coreui-react/commit/c6fbff22474ad8a6336b13a131e5cd8c4f83b8cf) +- fix: CButtonToolbar: component refactor: [`3bda5f7`](https://github.com/coreui/coreui-react/commit/3bda5f73ca43a1152fbce051243961eb6ad7a7b3) +- fix: CButtonGroup: delete 'tag', add default role attribute [`688eb3b`](https://github.com/coreui/coreui-react/commit/688eb3b7041535402658ddd2e63c24455f6f8c4e) +- fix: CLink: add 'disabled' prop: [`20db7d8`](https://github.com/coreui/coreui-react/commit/20db7d86c85e2f439aa6b61bd8bcdd8e10e3b318) +- feat: add CSelect component [`57468e7`](https://github.com/coreui/coreui-react/commit/57468e74b12c98ce1ed6f1d60ec8e818f683efe4) +- fix: move fade functionality from CTabs to CTabContent [`4f96e17`](https://github.com/coreui/coreui-react/commit/4f96e174bf8eb5706ec52fbdb20ad7fa5d7d8c7f) +- fix: CInput rename elementSize/size to size/sizeHtml [`95e3f29`](https://github.com/coreui/coreui-react/commit/95e3f294394035957717e6967485f93654982e96) +- feat: CCreateElement: add posibility of pasing component tag as string [`e294b4b`](https://github.com/coreui/coreui-react/commit/e294b4b6df619e75496676a41d3aeceb91e2cf42) +- fix: CCallout: delete tag prop, clean generating class [`5bacd2b`](https://github.com/coreui/coreui-react/commit/5bacd2b71c400f7c9af7d158ce77fbade1694d57) +- fix: CTabs: add fade prop inherited by CTabPane component [`33b78e7`](https://github.com/coreui/coreui-react/commit/33b78e7b8f2c1fa071bb40cb8b444cbef8a0b0bb) +- fix: CFooter: set fixed to false by default, clean component [`8e4e30c`](https://github.com/coreui/coreui-react/commit/8e4e30cd03604b6856d279cb6b9ed5ea184c22b3) +- fix: React.Fragment backward compatible [`9ee4493`](https://github.com/coreui/coreui-react/commit/9ee44938dfee86de9691d046897be15867b0ff54) +- refactor: minor refactors [`fc2af86`](https://github.com/coreui/coreui-react/commit/fc2af866478b486379eafa4ec4c7b982af6ae94c) +- fix: CSidebarNavDropdown: fix default closing mechanism [`c824fa7`](https://github.com/coreui/coreui-react/commit/c824fa799225494b811d85e833c379df2f7c9930) +- chore: clean code (linter warnings) [`79f2325`](https://github.com/coreui/coreui-react/commit/79f2325c14c91b4f3592d868336825fe555eb649) +- refactor: change trigger props names to on{...}Change [`8f910c1`](https://github.com/coreui/coreui-react/commit/8f910c16554d7f805569543e24130e51c84b89c3) +- refactor: CAlert: delete transition prop [`96e98fe`](https://github.com/coreui/coreui-react/commit/96e98fe28e6c21153d831a45e6494fb6949e6be1) +- fix: CNavbarText: change default tag to 'div', clean component [`9977be0`](https://github.com/coreui/coreui-react/commit/9977be0c00ed546ac20e4a01f752981e3d3d9728) +- feat: add CCreateElement component [`0cee7b0`](https://github.com/coreui/coreui-react/commit/0cee7b0b4d3e306813bd86bed4e1399eb50fa25c) +- refactor: delete checked and onCheckedChange props [`be2f00b`](https://github.com/coreui/coreui-react/commit/be2f00b8ae5be74d5f9baf552e2fd6d3a5e59a72) +- fix: CNavBarNav: delete wrong class 'nav', clean component [`9962cdd`](https://github.com/coreui/coreui-react/commit/9962cdd6547e9ab12338bc721c7e2adec4bf7b39) +- feat: CLink: add default rel attribute when target="_blank" [`79dad26`](https://github.com/coreui/coreui-react/commit/79dad26e4b8940304be904bc94c1cb66e58348f2) +- chore: clean components [`ef444f0`](https://github.com/coreui/coreui-react/commit/ef444f0166b395fe33217cc95eced48b5a28cb6b) +- fix: CSidebar, CSidebarNavDropdown: add default dropdown mode [`f677f5a`](https://github.com/coreui/coreui-react/commit/f677f5ae34026fb11696a90bb32900364b21d168) +- - update: ... [`2132022`](https://github.com/coreui/coreui-react/commit/2132022438b18b31cdb844439a0c54d577925d0e) +- fix: update CIcon imports [`16647ba`](https://github.com/coreui/coreui-react/commit/16647ba650c73a17e68423f9d07e69f157ff6e98) +- fix: CImg: delete 'active' and 'alt' props, smaller refactors [`78255d4`](https://github.com/coreui/coreui-react/commit/78255d4e7b4e50c2a37d3298ddeffe26b6cd25e6) +- Ship: 3.0.0-alpha.10 [`f77a972`](https://github.com/coreui/coreui-react/commit/f77a972af3b9cac1a5e19fb3056a660fba7c8c74) +- fix: minor cleanup [`4cd82cb`](https://github.com/coreui/coreui-react/commit/4cd82cb6a0474718909521675783ae8a0dc7c159) +- fix: demo cleanup [`7bd82c8`](https://github.com/coreui/coreui-react/commit/7bd82c8587f96d1ca81a69835311dda7885e06db) +- fix: CBreadcrumbRouter: generate path only if routes are passed [`79875db`](https://github.com/coreui/coreui-react/commit/79875dbd9595e36250255288d372d624031e0ad3) +- fix: CToast: correct behavior when fade is set to false [`1c73ce4`](https://github.com/coreui/coreui-react/commit/1c73ce48d2fadc8c851d7f32e3cab33532dc603d) +- chore: dependencies update [`09511b1`](https://github.com/coreui/coreui-react/commit/09511b156a83e2e60bed4de4d7e67825031cbe9b) +- Ship: 3.0.0-alpha.12 [`c440f29`](https://github.com/coreui/coreui-react/commit/c440f29454aff171b7eef40c7c52d893da96e717) +- chore: 3.0.0-rc.1 release [`6b7819e`](https://github.com/coreui/coreui-react/commit/6b7819e4ec69f91ed24bef2dfdd56ab71d58f2a3) +- - fix: default values for custom=true by default components set [`1c0a95e`](https://github.com/coreui/coreui-react/commit/1c0a95e2eeb4b28f9b681522d579c6d63dd5e67c) +- - fix: CSlot render now null instead of '' (in some cases generate warnings) [`f00913e`](https://github.com/coreui/coreui-react/commit/f00913e6da18eb412a57c5a1be3621515996438d) +- fix: CDataTable restore loading functionality: [`b8f2aaa`](https://github.com/coreui/coreui-react/commit/b8f2aaa3ba91e4c0e1c10cce633b097788e9c4fa) +- chore: change CIcon imports to CIconRaw imports [`0a18a61`](https://github.com/coreui/coreui-react/commit/0a18a61e9949b7e72e5749d9d0d0d22f6fab655c) +- refactor: CAlert: add CButtonClose component instead off html button [`91e7254`](https://github.com/coreui/coreui-react/commit/91e725437a42001ebda51addfdc570c2924f3599) +- fix: Attempted import error: '@coreui/icons-react' does not contain a default export (imported as 'CIcon') [`f107c35`](https://github.com/coreui/coreui-react/commit/f107c3506cbc31e1fad031d6d3c414e8a90b568f) +- fix: CDataTable: make recalculation mechanism 100% safe [`a6bc1df`](https://github.com/coreui/coreui-react/commit/a6bc1df75f1018e869150c59eb1106cd52178d94) +- Ship: 3.0.0-alpha.1 [`c17a4be`](https://github.com/coreui/coreui-react/commit/c17a4be596669e351d2f501bd5abf84b642bdfb0) +- chore: 3.0.0-beta.6 release [`ef24ff2`](https://github.com/coreui/coreui-react/commit/ef24ff2e7840497852ef52c0532d18e490fcc254) +- fix: CDataTable: fix bugs, protect against non-array 'items' prop [`c081868`](https://github.com/coreui/coreui-react/commit/c0818681f8766077f7fa6f445125d3856c258f1f) +- chore: dependencies update and module fix [`86c4295`](https://github.com/coreui/coreui-react/commit/86c429579caeba2dbd3c9174d5fc260050e20551) +- fix: fix passing refs to components [`2752af4`](https://github.com/coreui/coreui-react/commit/2752af44a5cc56749fc60c686576e2aa4c8ee1e1) +- fix(CSwitch): A component is changing an uncontrolled input of type checkbox to be controlled [`955370e`](https://github.com/coreui/coreui-react/commit/955370e600fd19ec25bdffaea4ca37be9ad981a2) +- fix: small fixes [`a00cc4f`](https://github.com/coreui/coreui-react/commit/a00cc4f7f3c597dfa3ad7a90ef34006c3b014967) +- - fix: link to Icon changed from dir to @ [`466c8f5`](https://github.com/coreui/coreui-react/commit/466c8f56439d082fdfe1a762b8e9d3d89d59d6f7) +- refactor: replace CFormFeedback with CValidFeedback and CInvalidFeedback [`1e9f0b1`](https://github.com/coreui/coreui-react/commit/1e9f0b161fb985f4d52f1ba81819fad2c13d5c8a) +- - link to navlink [`294d642`](https://github.com/coreui/coreui-react/commit/294d642a6aaa8a5b7af09c1ccfce775c6fa4c09c) +- refactor: CBadge: clean component [`b33d2a3`](https://github.com/coreui/coreui-react/commit/b33d2a35f887c437ea9622868a8535fa380e1b35) +- fix: CCreateElement: fix passing children [`51ad5f4`](https://github.com/coreui/coreui-react/commit/51ad5f41824f392710d523377271cfdedf0f8c0d) +- chore: dependencies update [`b22e1ae`](https://github.com/coreui/coreui-react/commit/b22e1ae40cd54d758b893c400d2792de11157fc2) +- - fix: CCard default custom value set to true [`5c86a3a`](https://github.com/coreui/coreui-react/commit/5c86a3afca48ac606ed8abcd9615aa48c759dc21) +- update: unused vars removed from CToastHeader [`2209f71`](https://github.com/coreui/coreui-react/commit/2209f71d2d9d139bf04e37201ce15aba8d5a7580) +- fix: CSidebarNavItem: add innerRef prop [`dde7f1c`](https://github.com/coreui/coreui-react/commit/dde7f1c5b319edc554cdd3602e7603987295c818) +- fix: CSidebar: fix updating sidebar state [`7217997`](https://github.com/coreui/coreui-react/commit/7217997d3b67a669e054b149a76ebccda2d7c3b0) +- chore: dependencies update and cleanup [`ea1736d`](https://github.com/coreui/coreui-react/commit/ea1736d554933ad67ceab6628a8d2127cf99567a) +- chore: 3.0.0-beta.7 release [`5c3b022`](https://github.com/coreui/coreui-react/commit/5c3b022b92122504f9d77025606500430862299d) +- chore: dependencies update [`0dec2d4`](https://github.com/coreui/coreui-react/commit/0dec2d48294d39795db98c1ef2c6af020e0f48d9) +- fix: CSidebarNavDropdown: place useLocation hook in try/catch block [`2365228`](https://github.com/coreui/coreui-react/commit/236522882f5a60c189c4f380fa7ac2a12627412a) +- fix: CMediaBody, CMediaFooter: minor fixes [`08b7460`](https://github.com/coreui/coreui-react/commit/08b74606fb6bf7eac834ca096e920f024979a2a3) +- fix: CSidebar: emit onShowChange only on close [`6be35c6`](https://github.com/coreui/coreui-react/commit/6be35c6918ef5465510fed0132b757c122224e2a) +- fix: restore footer slot to CWidgetIcon component [`5b18abd`](https://github.com/coreui/coreui-react/commit/5b18abd657639e7d29149d2475596f2021caaeb9) +- fix: CBreadcrumb: fix cssModules [`eb1623f`](https://github.com/coreui/coreui-react/commit/eb1623f6a16c15c60277bdca5a211a1c5d08a77d) +- fix: CScrollbar: fix rtl mode [`fa66112`](https://github.com/coreui/coreui-react/commit/fa66112b0d81e0c9610f1e2d846970cc8b4f45e3) +- Ship: 3.0.0-alpha.11 [`278d97b`](https://github.com/coreui/coreui-react/commit/278d97bd8f607fc191578a109abeb7b517d58f2c) +- Ship: 3.0.0-alpha.7 [`88f054c`](https://github.com/coreui/coreui-react/commit/88f054c84fcb23abffffe32909c5a33fda6c5e56) +- fix: CPagination: add disabled prop to inactive links [`af9a1c2`](https://github.com/coreui/coreui-react/commit/af9a1c25ffa93173529686421f1e2c622a960a3e) +- fix: CDropdown: add specific arrow class [`9c937b5`](https://github.com/coreui/coreui-react/commit/9c937b51885a94e8f29d845bec850320b416b0b5) +- chore: 3.0.0-beta.5 release [`bcec1de`](https://github.com/coreui/coreui-react/commit/bcec1deb5dce3d5070a87e769c10cfeae8b0fd90) +- refactor(CSidebarNavDroprdown): add console.warn on undefined pathname [`b127ecf`](https://github.com/coreui/coreui-react/commit/b127ecffb1d993b334e79e4cff57784522a2d081) +- fix: CTabPane: fix tab assignment [`3d9f041`](https://github.com/coreui/coreui-react/commit/3d9f0415128ea8890ec97bddde109377fb1a6f3d) +- chore: 3.0.0-rc.2 version release [`c30698c`](https://github.com/coreui/coreui-react/commit/c30698cfaed8282d045b2ee4d9dd51b72ea3b5fc) +- fix: CSidebarNavDropdown: fix default mode for nested dropdowns [`c5922ca`](https://github.com/coreui/coreui-react/commit/c5922ca941b7393a02ff31770ea0d9b2ba42fceb) +- chore: dependencies update [`080e634`](https://github.com/coreui/coreui-react/commit/080e6341afb00bae2e20d4db38cd0d5fd6d0f8d3) +- fix: isObject typo [`97bf646`](https://github.com/coreui/coreui-react/commit/97bf64695d18dda40b3c5c4ed0d1ce16ccde733f) +- fix: CSpinner: fix aria attributes [`7dd7aae`](https://github.com/coreui/coreui-react/commit/7dd7aaece47be51fa9c9d7cdd7759efc2a9ddd00) +- fix: CBreadcrumbRouter: add key to items [`bd0fbd4`](https://github.com/coreui/coreui-react/commit/bd0fbd4d60261e1fa5a9483d68c5839355d5adc4) +- - fix: custom by default true for CNavItem [`29e24cf`](https://github.com/coreui/coreui-react/commit/29e24cf5b7288fde16fd8e6a93713b748f09b042) +- fix: CDropdown: delete development console.log [`e64c1ef`](https://github.com/coreui/coreui-react/commit/e64c1ef025396cec530283ea431c13827754e0c9) +- fix: CDropdown: add missing 'show' and 'dropdown' classes [`71e9122`](https://github.com/coreui/coreui-react/commit/71e91225854acdf35d56aaae3c95e413cd8c2a6c) +- refactor: cleanup [`d88bcb3`](https://github.com/coreui/coreui-react/commit/d88bcb339f0e5564fb5439dd3c2d66eeb8fb1eec) +- chore: add CSelect component to exports [`4c25748`](https://github.com/coreui/coreui-react/commit/4c2574800e0c88a19cc00aaec693aa4d334f90b6) +- fix: CProgress: fix 'height' propType [`511c2a2`](https://github.com/coreui/coreui-react/commit/511c2a2fb351d9dea7afee34f1de93e26157c6bb) +- fix: CDropdownToggle: allow caret in link toggle [`c7f6eba`](https://github.com/coreui/coreui-react/commit/c7f6ebabc82b9c542e78d75f376755ed19651df7) +- - fix: CNavbar classes [`3e9994a`](https://github.com/coreui/coreui-react/commit/3e9994a4f2b214b7fd94b36770318717fea20c4d) +- Ship: 3.0.0-alpha.9 [`6d9a3f3`](https://github.com/coreui/coreui-react/commit/6d9a3f31abc2d4383711ee5caee796f4219944ee) +- fix(CSidebarNavItem): Invalid argument supplied to to oneOfType [`d7f38e1`](https://github.com/coreui/coreui-react/commit/d7f38e1b81fc9617430a2cc38b7941e3997a5bf7) +- Ship: 3.0.0-alpha.8 [`c408665`](https://github.com/coreui/coreui-react/commit/c408665ba4c787872526de1f961708169232112e) +- fix: CLink: stop passing false to rel attribute [`7b7d9c6`](https://github.com/coreui/coreui-react/commit/7b7d9c6022acfa8c8505d55044b851ab2575f0c8) +- chore: import from source instead of module [`d09a4b8`](https://github.com/coreui/coreui-react/commit/d09a4b86ea7b595d3f28f3632b2145c69530ac26) +- fix: es module [`5790081`](https://github.com/coreui/coreui-react/commit/5790081227b21ab79b85343a9eec1d6e2df7a4a3) +- Ship: 3.0.0-alpha.6 [`a64f06e`](https://github.com/coreui/coreui-react/commit/a64f06ec42e7f4dda9d9ccb21fba85f1cf57065b) +- - console.log removed [`5a0b08a`](https://github.com/coreui/coreui-react/commit/5a0b08a511e97012fd429bf0a8f1ac27e0448106) +- chore: enable library rapid development and installing from gh [`543dffd`](https://github.com/coreui/coreui-react/commit/543dffda4d492df82b42f6433b0734fb50ab5978) +- fix: CTabPane: fix error occuring when context is not passed [`ee952af`](https://github.com/coreui/coreui-react/commit/ee952af324f343bd923b90fb3f21e46d1841fdad) +- fix: change default 'fixed' value to true [`7c824c4`](https://github.com/coreui/coreui-react/commit/7c824c45e762eac6987688d50b2eb28514358ef6) +- fix: CProgressBar: fix striped state [`f1817f5`](https://github.com/coreui/coreui-react/commit/f1817f5d606fc1fdaf618b9974d700606be40a1e) +- fix: fix modules in package.json [`c7ad9a5`](https://github.com/coreui/coreui-react/commit/c7ad9a546f1fb8797838842a828b2b8fd891ecfe) +- fix: CSidebarNav: remove obsolete styles [`dbe7dc4`](https://github.com/coreui/coreui-react/commit/dbe7dc464941c5ff1b6e05c63d44dfc5a0ad12dc) diff --git a/npm-postinstall.js b/npm-postinstall.js new file mode 100644 index 00000000..f5dabcfa --- /dev/null +++ b/npm-postinstall.js @@ -0,0 +1,59 @@ +#!/usr/bin/env node + +const pkg = require(require('path').resolve('./package.json')) + +let packageJson = null +try { + packageJson = require(require('path').resolve('../../../package.json')) +} catch (e) { + +} + +const log = console.log + +const VERSIONS = { + '@coreui/coreui': { + url: 'https://coreui.io/pro/', + name: 'CoreUI CSS library' + }, + '@coreui/angular': { + url: 'https://coreui.io/pro/angular/', + name: 'CoreUI Angular components library', + docs: 'https://coreui.io/angular/docs/' + }, + '@coreui/react': { + url: 'https://coreui.io/pro/react/', + name: 'CoreUI React components library', + docs: 'https://coreui.io/react/docs/introduction' + }, + '@coreui/vue': { + url: 'https://coreui.io/pro/vue/', + name: 'CoreUI Vue components library', + docs: 'https://coreui.io/vue/docs/introduction/' + }, +} + +log('\x1b[32m') +log(`\x1b[1mThank you for using ${VERSIONS[pkg.name].name}! \x1b[22m`) +log(`${VERSIONS[pkg.name].name} is an MIT licensed open source project and ` + +`completely free to use. However, the amount of effort needed to maintain ` + +`and develop new features for the project is not sustainable without proper ` + +`financial backing. You can support development by buying Pro Version: ` + +`\x1b[4m${VERSIONS[pkg.name].url}\x1b[24m]`) +log('\x1b[39m') + +const isFramework = VERSIONS[pkg.name].name !== '@coreui/coreui' +const haveStyles = packageJson && + packageJson.dependencies && + ( + packageJson.dependencies['@coreui/coreui'] || + packageJson.dependencies['@coreui/coreui-pro'] + ) + +if (isFramework && !haveStyles) { + log(`\x1b[1m\x1b[31mError: You don't have '@coreui/coreui' CSS library installed in ` + + `package.json dependencies section. You need to import it in order to style ` + + `CoreUI components. Installation docs: ${VERSIONS[pkg.name].docs} \n \x1b[0m` + ) + // ` \x1b[33m` +} diff --git a/package-lock.json b/package-lock.json index e708e1ae..eea94cae 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "@coreui/react", - "version": "3.1.0", + "version": "3.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1218,9 +1218,9 @@ "integrity": "sha512-4BDmZYqcfGgoLRFgqJaOSsypoFykq8jFAmOHy9lyn2PB4lwrdAAuOMLLe6gjm6QFxZJLPXHcPRYZeEz7vsV4VQ==" }, "@coreui/icons-react": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@coreui/icons-react/-/icons-react-1.0.1.tgz", - "integrity": "sha512-oEEey/BUoT8KMx5K2TDgCDvjv0/QzNzFAiNSokSomPvY4u1dymXK0H+8X4KOa4fv17DUfE4aQ0W6pa+SyTLN9Q==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@coreui/icons-react/-/icons-react-1.0.2.tgz", + "integrity": "sha512-e0llVB8U850Wghkner9UjXkf9U1DlL771Rh5AFPwwIw+yptt1KjpJoCMyLw4FYSUSEAqH7tZaGbo0Iefm9+6jA==", "requires": { "classnames": "^2.2.6", "prop-types": "^15.7.2" @@ -3033,9 +3033,9 @@ } }, "eslint-plugin-react": { - "version": "7.20.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.20.3.tgz", - "integrity": "sha512-txbo090buDeyV0ugF3YMWrzLIUqpYTsWSDZV9xLSmExE1P/Kmgg9++PD931r+KEWS66O1c9R4srLVVHmeHpoAg==", + "version": "7.20.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.20.4.tgz", + "integrity": "sha512-y4DOQ0LrzuDQFEAnYFGjJMRHQQqfTco02qiWI00eGQYikHTzC15S5aRHGWSffnThv8sBpsmFBLky3K5keniAJg==", "dev": true, "requires": { "array-includes": "^3.1.1", @@ -5802,9 +5802,9 @@ } }, "rollup": { - "version": "2.22.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.22.2.tgz", - "integrity": "sha512-2a4Mch4f0W2lEvkPuxtz0GfrtfgLj9bdd/oC9L3LozGOCnmLqO7ivMfKbCJoRgqWIU2UqAcbxRFSwmIKx+uStA==", + "version": "2.23.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.23.0.tgz", + "integrity": "sha512-vLNmZFUGVwrnqNAJ/BvuLk1MtWzu4IuoqsH9UWK5AIdO3rt8/CSiJNvPvCIvfzrbNsqKbNzPAG1V2O4eTe2XZg==", "dev": true, "requires": { "fsevents": "~2.1.2" diff --git a/package.json b/package.json index 1f8cc0c9..0d7bc61e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@coreui/react", - "version": "3.1.0", + "version": "3.2.0", "description": "CoreUI React Bootstrap 4 components", "license": "MIT", "author": { @@ -26,7 +26,8 @@ "src/", "tests/", "umd/", - "README.md" + "README.md", + "npm-postinstall.js" ], "scripts": { "clean": "nwb clean-module && nwb clean-demo", @@ -35,15 +36,16 @@ "test:watch": "nwb test-react --server", "lint": "eslint src", "link": "npm link && link.sh", - "changelog": "auto-changelog --starting-version 3.0.0-rc.2 --hide-credit", + "changelog": "auto-changelog --starting-version 3.0.0-rc.2 --commit-limit false --hide-credit", "build": "npm run build:lib && npm run build:esm", "build:lib": "rollup --environment BUNDLE:false --c --sourcemap", - "build:esm": "cross-env BABEL_ENV=esm-dir babel src --out-dir es --copy-files" + "build:esm": "cross-env BABEL_ENV=esm-dir babel src --out-dir es --copy-files", + "postinstall": "node npm-postinstall" }, "dependencies": { "@babel/runtime": "^7.10.5", "@coreui/icons": "2.0.0-beta.4", - "@coreui/icons-react": "^1.0.1", + "@coreui/icons-react": "^1.0.2", "@coreui/utils": "~1.3.1", "@popperjs/core": "~2.4.4", "classnames": "~2.2.6", @@ -79,8 +81,8 @@ "enzyme-adapter-react-16": "^1.15.2", "eslint": "^7.5.0", "eslint-plugin-import": "^2.22.0", - "eslint-plugin-react": "^7.20.3", - "rollup": "^2.22.2", + "eslint-plugin-react": "^7.20.4", + "rollup": "^2.23.0", "rollup-plugin-peer-deps-external": "2.2.3", "rollup-plugin-postcss": "3.1.3", "sinon": "^9.0.2" diff --git a/src/breadcrumb/CBreadcrumbRouter.js b/src/breadcrumb/CBreadcrumbRouter.js index 1cd3332b..4f88e91c 100644 --- a/src/breadcrumb/CBreadcrumbRouter.js +++ b/src/breadcrumb/CBreadcrumbRouter.js @@ -47,7 +47,8 @@ const CBreadcrumbRouter = props => { exact: route.exact })) return { ...route, currPath } - }).filter(route => route) + }).filter(route => route && route.name) + items = currRoutes.map(route => { return CBreadcrumbRouteItem(route, currPath) }) diff --git a/src/dropdown/CDropdownMenu.js b/src/dropdown/CDropdownMenu.js index 240dec61..a3f7c43c 100644 --- a/src/dropdown/CDropdownMenu.js +++ b/src/dropdown/CDropdownMenu.js @@ -63,11 +63,17 @@ const CDropdownMenu = props => { } } + const onKeypress = e => e.keyCode == '27' && setIsOpen(false) + useEffect(() => { if (isOpen) { document.addEventListener('click', checkClose) + document.addEventListener('keydown', onKeypress) + } + return () => { + document.removeEventListener('click', checkClose) + document.removeEventListener('keydown', onKeypress) } - return () => document.removeEventListener('click', checkClose) }, [isOpen]) return ( diff --git a/src/index.d.ts b/src/index.d.ts index 79ef4916..b17c50ba 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -303,6 +303,7 @@ interface CDataTable { columnFilter?: boolean | object; tableFilterValue?: string; tableFilter?: boolean | object; + cleaner?: boolean | Function; addTableClasses?: string | Array | object; size?: string; dark?: boolean; diff --git a/src/modal/CModal.js b/src/modal/CModal.js index 7888f56f..40160fb1 100644 --- a/src/modal/CModal.js +++ b/src/modal/CModal.js @@ -33,21 +33,35 @@ const CModal = props => { } = props const [isOpen, setIsOpen] = useState(false) + const [modalTrigger, setModalTrigger] = useState(false) const modalClick = e => e.target.dataset.modal && closeOnBackdrop && close() useEffect(() => { setIsOpen(show) }, [show]) + const onKeypress = e => e.keyCode == '27' && close() + + useEffect(() => { + isOpen && document.addEventListener('keydown', onKeypress) + return () => document.removeEventListener('keydown', onKeypress) + }, [isOpen]) const close = () => { onClose && onClose() setIsOpen(false) } - const onEntered = () => onOpened && onOpened() + const onEntered = () => { + setModalTrigger(document.querySelector(':focus')) + nodeRef.current.focus() + onOpened && onOpened() + } - const onExited = () => onClosed && onClosed() + const onExited = () => { + modalTrigger && modalTrigger.focus() + onClosed && onClosed() + } const modalClasses = classNames( 'modal overflow-auto fade', { diff --git a/src/table/CDataTable.js b/src/table/CDataTable.js index 6493bb78..19f7b0dc 100644 --- a/src/table/CDataTable.js +++ b/src/table/CDataTable.js @@ -5,7 +5,7 @@ import CPagination from '../pagination/CPagination' import CElementCover from '../element-cover/CElementCover' import style from './CDataTable.module.css' import CIcon from '@coreui/icons-react' -import { cilArrowTop, cilBan } from '@coreui/icons' +import { cilArrowTop, cilBan, cilFilterX } from '@coreui/icons' //component - CoreUI / CTable const CDataTable = props => { @@ -37,6 +37,7 @@ const CDataTable = props => { columnFilter, tableFilterValue, tableFilter, + cleaner, addTableClasses, size, dark, @@ -95,7 +96,10 @@ const CDataTable = props => { const headerClass = i => fields && fields[i]._classes && fields[i]._classes - const isSortable = i => sorter && fields && fields[i].sorter !== false + const isSortable = i => { + const isDataColumn = itemsDataColumns.includes(rawColumnNames[i]) + return sorter && fields && fields[i].sorter !== false && isDataColumn + } const headerStyles = (index) => { let style = { verticalAlign: 'middle', overflow: 'hidden' } @@ -177,25 +181,29 @@ const CDataTable = props => { } } + const clean = () => { + setTableFilterState('') + setColumnFilterState({}) + setSorterState({ + column: "", + asc: true + }) + } + // computed - const generatedColumnNames = (() => { - return Object.keys(passedItems[0] || {}).filter(el => el.charAt(0) !== '_') - })() + const genCols = Object.keys(passedItems[0] || {}).filter(el => el.charAt(0) !== '_') - const rawColumnNames = (()=>{ - if (fields) { - return fields.map(el => el.key || el) - } - return generatedColumnNames - })() + const rawColumnNames = fields ? fields.map(el => el.key || el) : genCols + + const itemsDataColumns = rawColumnNames.filter(name => genCols.includes(name)) useMemo(() => { compData.columnFiltered++ }, [ JSON.stringify(columnFilter), JSON.stringify(columnFilterState), - rawColumnNames.join(''), + itemsDataColumns.join(''), compData.changeItems ]) @@ -206,7 +214,7 @@ const CDataTable = props => { } Object.entries(columnFilterState).forEach(([key, value]) => { const columnFilter = String(value).toLowerCase() - if (columnFilter && rawColumnNames.includes(key)) { + if (columnFilter && itemsDataColumns.includes(key)) { items = items.filter(item => { return String(item[key]).toLowerCase().includes(columnFilter) }) @@ -223,7 +231,7 @@ const CDataTable = props => { const filter = tableFilterState.toLowerCase() const hasFilter = (item) => String(item).toLowerCase().includes(filter) items = items.filter(item => { - return rawColumnNames.filter(key => hasFilter(item[key])).length + return itemsDataColumns.filter(key => hasFilter(item[key])).length }) return items }, [ @@ -234,7 +242,7 @@ const CDataTable = props => { const sortedItems = useMemo(() => { const col = sorterState.column - if (!col || !rawColumnNames.includes(col) || sorter.external) { + if (!col || !itemsDataColumns.includes(col) || sorter.external) { onFilteredItemsChange && onFilteredItemsChange(tableFiltered) return tableFiltered } @@ -319,6 +327,16 @@ const CDataTable = props => { return customValues.noItems || 'No items' })() + const isFiltered = tableFilterState || sorterState.column || + Object.values(columnFilterState).join('') + + const cleanerProps = { + content: cilFilterX, + className: `ml-2 ${isFiltered ? 'text-danger' : 'transparent'}`, + role: isFiltered ? 'button' : null, + tabIndex: isFiltered ? 0 : null, + } + // watch useMemo(() => setPerPageItems(itemsPerPage), [itemsPerPage]) @@ -381,30 +399,47 @@ const CDataTable = props => {
{ - (itemsPerPageSelect || tableFilter) && + (itemsPerPageSelect || tableFilter || cleaner) &&
{ - tableFilter && + (tableFilter || cleaner) &&
- - {tableFilterChange(e.target.value, 'input')}} - onChange={(e)=>{tableFilterChange(e.target.value, 'change')}} - value={tableFilterState || ''} - /> + { + tableFilter && + <> + + {tableFilterChange(e.target.value, 'input')}} + onChange={(e)=>{tableFilterChange(e.target.value, 'change')}} + value={tableFilterState || ''} + aria-label="table filter input" + /> + + } + { + cleaner && ( + typeof cleaner === 'function' ? cleaner(clean, isFiltered, cleanerProps) : + + ) + } +
} { itemsPerPageSelect && -
+
{columnFilterEvent(colName, e.target.value, 'input')}} - onChange={(e)=>{columnFilterEvent(colName, e.target.value, 'change')}} + onInput={e=>{columnFilterEvent(colName, e.target.value, 'input')}} + onChange={e=>{columnFilterEvent(colName, e.target.value, 'change')}} value={columnFilterState[colName] || ''} + aria-label={`column name: '${colName}' filter input`} />) } @@ -543,7 +579,7 @@ const CDataTable = props => { { pagination && 0 ? 'inline' : 'none'}} + style={{display: totalPages > 1 ? 'inline' : 'none'}} onActivePageChange={(page) => { setPage(page) }} pages={totalPages} activePage={page} @@ -579,6 +615,7 @@ CDataTable.propTypes = { columnFilter: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]), tableFilterValue: PropTypes.string, tableFilter: PropTypes.oneOfType([PropTypes.bool, PropTypes.object]), + cleaner: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]), addTableClasses: PropTypes.oneOfType([PropTypes.string, PropTypes.array, PropTypes.object]), size: PropTypes.string, dark: PropTypes.bool, diff --git a/src/template/CSidebarNavItem.js b/src/template/CSidebarNavItem.js index eed956ca..b7151944 100644 --- a/src/template/CSidebarNavItem.js +++ b/src/template/CSidebarNavItem.js @@ -44,7 +44,7 @@ const CSidebarNavItem = props => { {...routerLinkProps} {...rest} > - { icon && isValidElement(icon) ? icon : } + { icon && (isValidElement(icon) ? icon : ) } { fontIcon && } {name} { badge && {badge.text}}