r-dropdown-button
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -109,2 +109,3 @@ "use strict"; | ||
var iconClass = this.getValue(this.props.iconClass); | ||
var iconStyle = this.getValue(this.props.iconStyle); | ||
var className = this.getValue(this.props.className); | ||
@@ -138,3 +139,4 @@ var badge = this.getValue(this.props.badge); | ||
style: { | ||
margin: text === undefined ? 0 : undefined | ||
margin: text === undefined ? 0 : undefined, | ||
...iconStyle | ||
} | ||
@@ -326,3 +328,2 @@ }), text !== undefined && text, open && Array.isArray(items) && items.length > 0 && /*#__PURE__*/_react.default.createElement(Popup, null), open && typeof items === 'function' && /*#__PURE__*/_react.default.createElement(Popup, null))); | ||
var _this$context3 = this.context, | ||
checkable = _this$context3.checkable, | ||
rtl = _this$context3.rtl, | ||
@@ -329,0 +330,0 @@ getValue = _this$context3.getValue; |
{ | ||
"name": "r-dropdown-button", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -30,2 +30,3 @@ import React,{Component,Fragment,createRef,createContext} from 'react'; | ||
var iconClass = this.getValue(this.props.iconClass); | ||
var iconStyle = this.getValue(this.props.iconStyle); | ||
var className = this.getValue(this.props.className); | ||
@@ -51,3 +52,3 @@ var badge = this.getValue(this.props.badge); | ||
{parseInt(badge) > 0 && <div className='badge' style={badgeStyle}>{badge> 99 ?'+99':badge}</div>} | ||
{iconClass && <div className={'icon ' + iconClass} style={{margin:text === undefined?0:undefined}}></div>} | ||
{iconClass && <div className={'icon ' + iconClass} style={{margin:text === undefined?0:undefined,...iconStyle}}></div>} | ||
{text !== undefined && text} | ||
@@ -148,3 +149,3 @@ {open && Array.isArray(items) && items.length > 0 && <Popup />} | ||
var {item} = this.props; | ||
var {checkable,rtl,getValue} = this.context; | ||
var {rtl,getValue} = this.context; | ||
var disabled = getValue(item.disabled); | ||
@@ -151,0 +152,0 @@ var iconClass = getValue(item.iconClass); |
25917
681