@@ -22,6 +22,8 @@ var _Card = require('../Card/Card');
2222
2323var _Card2 = _interopRequireDefault ( _Card ) ;
2424
25+ var _stringifyValues = require ( '../util/stringifyValues' ) ;
26+
2527function _interopRequireDefault ( obj ) { return obj && obj . __esModule ? obj : { default : obj } ; }
2628
2729function _classCallCheck ( instance , Constructor ) { if ( ! ( instance instanceof Constructor ) ) { throw new TypeError ( "Cannot call a class as a function" ) ; } }
@@ -66,9 +68,9 @@ var DashboardCardFooter = function DashboardCardFooter(_ref2) {
6668 return _react2 . default . createElement (
6769 'li' ,
6870 { key : key } ,
69- undefined . renderChild ( child )
71+ ( 0 , _react . cloneElement ) ( child )
7072 ) ;
71- } ) || undefined . renderChild ( children , 0 )
73+ } ) || ( 0 , _react . cloneElement ) ( children , { key : 0 } )
7274 )
7375 ) : null ;
7476} ;
@@ -84,6 +86,25 @@ DashboardCardFooter.defaultProps = {
8486 hover : false
8587} ;
8688
89+ var DashboardCardFilterData = function DashboardCardFilterData ( _ref3 ) {
90+ var role = _ref3 . role ,
91+ data = _ref3 . data ;
92+ return _react2 . default . createElement (
93+ 'span' ,
94+ { role : role , className : 'hide isotope-search' , 'aria-hidden' : 'true' , hidden : true } ,
95+ ( 0 , _stringifyValues . stringifyValues ) ( data )
96+ ) ;
97+ } ;
98+
99+ DashboardCardFilterData . propTypes = {
100+ role : _propTypes2 . default . string ,
101+ data : _propTypes2 . default . object
102+ } ;
103+
104+ DashboardCardFilterData . defaultProps = {
105+ role : 'filterData'
106+ } ;
107+
87108var BODY_ROLE = DashboardCardBody . defaultProps . role ;
88109var FOOTER_ROLE = DashboardCardFooter . defaultProps . role ;
89110
@@ -99,29 +120,28 @@ var DashboardCard = function (_React$Component) {
99120 _createClass ( DashboardCard , [ {
100121 key : 'render' ,
101122 value : function render ( ) {
102- var _this2 = this ;
103-
104123 var _props = this . props ,
105124 className = _props . className ,
106125 children = _props . children ,
107- cardStyle = _props . cardStyle ;
126+ data = _props . data ;
108127
109128
110129 return _react2 . default . createElement (
111130 _Card2 . default ,
112- { className : ( 0 , _classnames2 . default ) ( className , 'form-box' ) , cardStyle : cardStyle } ,
131+ { className : ( 0 , _classnames2 . default ) ( className , 'form-box-container' ) } ,
113132 _react2 . default . createElement (
114133 _Card2 . default . Body ,
115- null ,
134+ { className : 'form-box' } ,
116135 children && ( Array . isArray ( children ) && children . map ( function ( child , key ) {
117136 switch ( child . props . role ) {
118137 case BODY_ROLE :
119138 case FOOTER_ROLE :
120- return _this2 . renderChild ( child , key ) ;
139+ return ( 0 , _react . cloneElement ) ( child , { key : key } ) ;
121140 default :
122141 return child ;
123142 }
124- } ) || this . renderChild ( children , 0 ) )
143+ } ) || ( 0 , _react . cloneElement ) ( children ) ) ,
144+ data && _react2 . default . createElement ( DashboardCardFilterData , { data : data } )
125145 )
126146 ) ;
127147 }
@@ -133,7 +153,7 @@ var DashboardCard = function (_React$Component) {
133153DashboardCard . propTypes = {
134154 children : _propTypes2 . default . node ,
135155 className : _propTypes2 . default . string ,
136- cardStyle : _propTypes2 . default . object
156+ data : _propTypes2 . default . object
137157} ;
138158
139159DashboardCard . Body = DashboardCardBody ;
0 commit comments