rc-collapse
Advanced tools
Comparing version 3.1.0 to 3.1.1
@@ -19,4 +19,4 @@ import * as React from 'react'; | ||
static getDerivedStateFromProps(nextProps: CollapseProps): Partial<CollapseState>; | ||
getNewChild: (child: React.ReactElement, index: number) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>; | ||
getItems: () => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>[]; | ||
getNewChild: (child: React.ReactElement, index: number) => React.ReactElement<any, string | React.JSXElementConstructor<any>>; | ||
getItems: () => React.ReactElement<any, string | React.JSXElementConstructor<any>>[]; | ||
setActiveKey: (activeKey: React.Key[]) => void; | ||
@@ -23,0 +23,0 @@ render(): JSX.Element; |
@@ -7,2 +7,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import _createSuper from "@babel/runtime/helpers/esm/createSuper"; | ||
import _typeof from "@babel/runtime/helpers/esm/typeof"; | ||
@@ -20,3 +21,5 @@ /* eslint-disable react/prop-types */ | ||
if (!Array.isArray(currentActiveKey)) { | ||
currentActiveKey = currentActiveKey ? [currentActiveKey] : []; | ||
var activeKeyType = _typeof(currentActiveKey); | ||
currentActiveKey = activeKeyType === 'number' || activeKeyType === 'string' ? [currentActiveKey] : []; | ||
} | ||
@@ -108,3 +111,3 @@ | ||
return React.cloneElement(child, props); | ||
return /*#__PURE__*/React.cloneElement(child, props); | ||
}; | ||
@@ -157,3 +160,3 @@ | ||
var collapseClassName = classNames((_classNames = {}, _defineProperty(_classNames, prefixCls, true), _defineProperty(_classNames, className, !!className), _classNames)); | ||
return React.createElement("div", { | ||
return /*#__PURE__*/React.createElement("div", { | ||
className: collapseClassName, | ||
@@ -160,0 +163,0 @@ style: style, |
@@ -0,1 +1,2 @@ | ||
import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
@@ -77,3 +78,3 @@ import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck"; | ||
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); | ||
var icon = React.createElement("i", { | ||
var icon = /*#__PURE__*/React.createElement("i", { | ||
className: "arrow" | ||
@@ -86,7 +87,7 @@ }); | ||
return React.createElement("div", { | ||
return /*#__PURE__*/React.createElement("div", { | ||
className: itemCls, | ||
style: style, | ||
id: id | ||
}, React.createElement("div", { | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: headerCls, | ||
@@ -100,8 +101,8 @@ onClick: function onClick() { | ||
onKeyPress: this.handleKeyPress | ||
}, showArrow && icon, collapsible === 'header' ? React.createElement("span", { | ||
}, showArrow && icon, collapsible === 'header' ? /*#__PURE__*/React.createElement("span", { | ||
onClick: this.handleItemClick, | ||
className: "".concat(prefixCls, "-header-text") | ||
}, header) : header, extra && React.createElement("div", { | ||
}, header) : header, extra && /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-extra") | ||
}, extra)), React.createElement(CSSMotion, Object.assign({ | ||
}, extra)), /*#__PURE__*/React.createElement(CSSMotion, _extends({ | ||
visible: isActive, | ||
@@ -115,3 +116,3 @@ leavedClassName: "".concat(prefixCls, "-content-hidden") | ||
motionStyle = _ref.style; | ||
return React.createElement(PanelContent, { | ||
return /*#__PURE__*/React.createElement(PanelContent, { | ||
ref: ref, | ||
@@ -118,0 +119,0 @@ prefixCls: prefixCls, |
@@ -9,3 +9,3 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
import classnames from 'classnames'; | ||
var PanelContent = React.forwardRef(function (props, ref) { | ||
var PanelContent = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
var _classnames; | ||
@@ -36,3 +36,3 @@ | ||
return React.createElement("div", { | ||
return /*#__PURE__*/React.createElement("div", { | ||
ref: ref, | ||
@@ -42,3 +42,3 @@ className: classnames("".concat(prefixCls, "-content"), (_classnames = {}, _defineProperty(_classnames, "".concat(prefixCls, "-content-active"), isActive), _defineProperty(_classnames, "".concat(prefixCls, "-content-inactive"), !isActive), _classnames), className), | ||
role: role | ||
}, React.createElement("div", { | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-content-box") | ||
@@ -45,0 +45,0 @@ }, children)); |
@@ -19,4 +19,4 @@ import * as React from 'react'; | ||
static getDerivedStateFromProps(nextProps: CollapseProps): Partial<CollapseState>; | ||
getNewChild: (child: React.ReactElement, index: number) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>; | ||
getItems: () => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>[]; | ||
getNewChild: (child: React.ReactElement, index: number) => React.ReactElement<any, string | React.JSXElementConstructor<any>>; | ||
getItems: () => React.ReactElement<any, string | React.JSXElementConstructor<any>>[]; | ||
setActiveKey: (activeKey: React.Key[]) => void; | ||
@@ -23,0 +23,0 @@ render(): JSX.Element; |
@@ -24,2 +24,4 @@ "use strict"; | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
var React = _interopRequireWildcard(require("react")); | ||
@@ -40,3 +42,4 @@ | ||
if (!Array.isArray(currentActiveKey)) { | ||
currentActiveKey = currentActiveKey ? [currentActiveKey] : []; | ||
var activeKeyType = (0, _typeof2.default)(currentActiveKey); | ||
currentActiveKey = activeKeyType === 'number' || activeKeyType === 'string' ? [currentActiveKey] : []; | ||
} | ||
@@ -127,3 +130,3 @@ | ||
return React.cloneElement(child, props); | ||
return /*#__PURE__*/React.cloneElement(child, props); | ||
}; | ||
@@ -176,3 +179,3 @@ | ||
var collapseClassName = (0, _classnames.default)((_classNames = {}, (0, _defineProperty2.default)(_classNames, prefixCls, true), (0, _defineProperty2.default)(_classNames, className, !!className), _classNames)); | ||
return React.createElement("div", { | ||
return /*#__PURE__*/React.createElement("div", { | ||
className: collapseClassName, | ||
@@ -179,0 +182,0 @@ style: style, |
@@ -1,1 +0,5 @@ | ||
"use strict"; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); |
@@ -12,2 +12,4 @@ "use strict"; | ||
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); | ||
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty")); | ||
@@ -96,3 +98,3 @@ | ||
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); | ||
var icon = React.createElement("i", { | ||
var icon = /*#__PURE__*/React.createElement("i", { | ||
className: "arrow" | ||
@@ -105,7 +107,7 @@ }); | ||
return React.createElement("div", { | ||
return /*#__PURE__*/React.createElement("div", { | ||
className: itemCls, | ||
style: style, | ||
id: id | ||
}, React.createElement("div", { | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: headerCls, | ||
@@ -119,8 +121,8 @@ onClick: function onClick() { | ||
onKeyPress: this.handleKeyPress | ||
}, showArrow && icon, collapsible === 'header' ? React.createElement("span", { | ||
}, showArrow && icon, collapsible === 'header' ? /*#__PURE__*/React.createElement("span", { | ||
onClick: this.handleItemClick, | ||
className: "".concat(prefixCls, "-header-text") | ||
}, header) : header, extra && React.createElement("div", { | ||
}, header) : header, extra && /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-extra") | ||
}, extra)), React.createElement(_rcMotion.default, Object.assign({ | ||
}, extra)), /*#__PURE__*/React.createElement(_rcMotion.default, (0, _extends2.default)({ | ||
visible: isActive, | ||
@@ -134,3 +136,3 @@ leavedClassName: "".concat(prefixCls, "-content-hidden") | ||
motionStyle = _ref.style; | ||
return React.createElement(_PanelContent.default, { | ||
return /*#__PURE__*/React.createElement(_PanelContent.default, { | ||
ref: ref, | ||
@@ -137,0 +139,0 @@ prefixCls: prefixCls, |
@@ -23,3 +23,3 @@ "use strict"; | ||
/* eslint-disable react/prop-types */ | ||
var PanelContent = React.forwardRef(function (props, ref) { | ||
var PanelContent = /*#__PURE__*/React.forwardRef(function (props, ref) { | ||
var _classnames; | ||
@@ -50,3 +50,3 @@ | ||
return React.createElement("div", { | ||
return /*#__PURE__*/React.createElement("div", { | ||
ref: ref, | ||
@@ -56,3 +56,3 @@ className: (0, _classnames2.default)("".concat(prefixCls, "-content"), (_classnames = {}, (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-content-active"), isActive), (0, _defineProperty2.default)(_classnames, "".concat(prefixCls, "-content-inactive"), !isActive), _classnames), className), | ||
role: role | ||
}, React.createElement("div", { | ||
}, /*#__PURE__*/React.createElement("div", { | ||
className: "".concat(prefixCls, "-content-box") | ||
@@ -59,0 +59,0 @@ }, children)); |
{ | ||
"name": "rc-collapse", | ||
"version": "3.1.0", | ||
"version": "3.1.1", | ||
"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
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
46863
905
0