Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rc-collapse

Package Overview
Dependencies
Maintainers
6
Versions
83
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rc-collapse - npm Package Compare versions

Comparing version 3.1.4 to 3.2.0

36

es/Panel.js

@@ -80,3 +80,4 @@ import _extends from "@babel/runtime/helpers/esm/extends";

var disabled = collapsible === 'disabled';
var headerCls = classNames("".concat(prefixCls, "-header"), (_classNames = {}, _defineProperty(_classNames, headerClass, headerClass), _defineProperty(_classNames, "".concat(prefixCls, "-header-collapsible-only"), collapsible === 'header'), _classNames));
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 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);

@@ -86,3 +87,10 @@ var icon = /*#__PURE__*/React.createElement("i", {

});
/** header 节点属性 */
var headerProps = {
className: headerCls,
'aria-expanded': isActive,
onKeyPress: this.handleKeyPress
};
if (showArrow && typeof expandIcon === 'function') {

@@ -92,2 +100,17 @@ 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';

@@ -98,12 +121,3 @@ return /*#__PURE__*/React.createElement("div", {

id: id
}, /*#__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", {
}, /*#__PURE__*/React.createElement("div", headerProps, showArrow && icon, collapsibleHeader ? /*#__PURE__*/React.createElement("span", {
onClick: this.handleItemClick,

@@ -110,0 +124,0 @@ className: "".concat(prefixCls, "-header-text")

@@ -100,3 +100,4 @@ "use strict";

var disabled = collapsible === 'disabled';
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 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 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);

@@ -106,3 +107,10 @@ var icon = /*#__PURE__*/React.createElement("i", {

});
/** header 节点属性 */
var headerProps = {
className: headerCls,
'aria-expanded': isActive,
onKeyPress: this.handleKeyPress
};
if (showArrow && typeof expandIcon === 'function') {

@@ -112,2 +120,17 @@ 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';

@@ -118,12 +141,3 @@ return /*#__PURE__*/React.createElement("div", {

id: id
}, /*#__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", {
}, /*#__PURE__*/React.createElement("div", headerProps, showArrow && icon, collapsibleHeader ? /*#__PURE__*/React.createElement("span", {
onClick: this.handleItemClick,

@@ -130,0 +144,0 @@ className: "".concat(prefixCls, "-header-text")

{
"name": "rc-collapse",
"version": "3.1.4",
"version": "3.2.0",
"description": "rc-collapse ui component for react",

@@ -5,0 +5,0 @@ "keywords": [

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc