rc-collapse
Advanced tools
Comparing version 3.1.3 to 3.1.4
@@ -80,4 +80,3 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
var disabled = collapsible === 'disabled'; | ||
var collapsibleHeader = collapsible === 'header'; | ||
var headerCls = classNames("".concat(prefixCls, "-header"), (_classNames = {}, _defineProperty(_classNames, headerClass, headerClass), _defineProperty(_classNames, "".concat(prefixCls, "-header-collapsible-only"), collapsibleHeader), _classNames)); | ||
var headerCls = classNames("".concat(prefixCls, "-header"), (_classNames = {}, _defineProperty(_classNames, headerClass, headerClass), _defineProperty(_classNames, "".concat(prefixCls, "-header-collapsible-only"), collapsible === 'header'), _classNames)); | ||
var itemCls = classNames((_classNames2 = {}, _defineProperty(_classNames2, "".concat(prefixCls, "-item"), true), _defineProperty(_classNames2, "".concat(prefixCls, "-item-active"), isActive), _defineProperty(_classNames2, "".concat(prefixCls, "-item-disabled"), disabled), _classNames2), className); | ||
@@ -87,10 +86,3 @@ var icon = /*#__PURE__*/React.createElement("i", { | ||
}); | ||
/** header 节点属性 */ | ||
var headerProps = { | ||
className: headerCls, | ||
'aria-expanded': isActive, | ||
onKeyPress: this.handleKeyPress | ||
}; | ||
if (showArrow && typeof expandIcon === 'function') { | ||
@@ -100,17 +92,2 @@ icon = expandIcon(this.props); | ||
if (collapsibleHeader) { | ||
icon = /*#__PURE__*/React.createElement("span", { | ||
style: { | ||
cursor: 'pointer' | ||
}, | ||
onClick: function onClick() { | ||
return _this2.handleItemClick(); | ||
} | ||
}, icon); | ||
} else { | ||
headerProps.onClick = this.handleItemClick; | ||
headerProps.role = accordion ? 'tab' : 'button'; | ||
headerProps.tabIndex = disabled ? -1 : 0; | ||
} | ||
var ifExtraExist = extra !== null && extra !== undefined && typeof extra !== 'boolean'; | ||
@@ -121,3 +98,12 @@ return /*#__PURE__*/React.createElement("div", { | ||
id: id | ||
}, /*#__PURE__*/React.createElement("div", headerProps, showArrow && icon, collapsibleHeader ? /*#__PURE__*/React.createElement("span", { | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: headerCls, | ||
onClick: function onClick() { | ||
return collapsible !== 'header' && _this2.handleItemClick(); | ||
}, | ||
role: accordion ? 'tab' : 'button', | ||
tabIndex: disabled ? -1 : 0, | ||
"aria-expanded": isActive, | ||
onKeyPress: this.handleKeyPress | ||
}, showArrow && icon, collapsible === 'header' ? /*#__PURE__*/React.createElement("span", { | ||
onClick: this.handleItemClick, | ||
@@ -124,0 +110,0 @@ className: "".concat(prefixCls, "-header-text") |
@@ -100,4 +100,3 @@ "use strict"; | ||
var disabled = collapsible === 'disabled'; | ||
var collapsibleHeader = collapsible === 'header'; | ||
var headerCls = (0, _classnames.default)("".concat(prefixCls, "-header"), (_classNames = {}, (0, _defineProperty2.default)(_classNames, headerClass, headerClass), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-header-collapsible-only"), collapsibleHeader), _classNames)); | ||
var headerCls = (0, _classnames.default)("".concat(prefixCls, "-header"), (_classNames = {}, (0, _defineProperty2.default)(_classNames, headerClass, headerClass), (0, _defineProperty2.default)(_classNames, "".concat(prefixCls, "-header-collapsible-only"), collapsible === 'header'), _classNames)); | ||
var itemCls = (0, _classnames.default)((_classNames2 = {}, (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-item"), true), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-item-active"), isActive), (0, _defineProperty2.default)(_classNames2, "".concat(prefixCls, "-item-disabled"), disabled), _classNames2), className); | ||
@@ -107,10 +106,3 @@ var icon = /*#__PURE__*/React.createElement("i", { | ||
}); | ||
/** header 节点属性 */ | ||
var headerProps = { | ||
className: headerCls, | ||
'aria-expanded': isActive, | ||
onKeyPress: this.handleKeyPress | ||
}; | ||
if (showArrow && typeof expandIcon === 'function') { | ||
@@ -120,17 +112,2 @@ icon = expandIcon(this.props); | ||
if (collapsibleHeader) { | ||
icon = /*#__PURE__*/React.createElement("span", { | ||
style: { | ||
cursor: 'pointer' | ||
}, | ||
onClick: function onClick() { | ||
return _this2.handleItemClick(); | ||
} | ||
}, icon); | ||
} else { | ||
headerProps.onClick = this.handleItemClick; | ||
headerProps.role = accordion ? 'tab' : 'button'; | ||
headerProps.tabIndex = disabled ? -1 : 0; | ||
} | ||
var ifExtraExist = extra !== null && extra !== undefined && typeof extra !== 'boolean'; | ||
@@ -141,3 +118,12 @@ return /*#__PURE__*/React.createElement("div", { | ||
id: id | ||
}, /*#__PURE__*/React.createElement("div", headerProps, showArrow && icon, collapsibleHeader ? /*#__PURE__*/React.createElement("span", { | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: headerCls, | ||
onClick: function onClick() { | ||
return collapsible !== 'header' && _this2.handleItemClick(); | ||
}, | ||
role: accordion ? 'tab' : 'button', | ||
tabIndex: disabled ? -1 : 0, | ||
"aria-expanded": isActive, | ||
onKeyPress: this.handleKeyPress | ||
}, showArrow && icon, collapsible === 'header' ? /*#__PURE__*/React.createElement("span", { | ||
onClick: this.handleItemClick, | ||
@@ -144,0 +130,0 @@ className: "".concat(prefixCls, "-header-text") |
{ | ||
"name": "rc-collapse", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "rc-collapse ui component for react", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45713
24
917
1