1 line
14 KiB
JSON
1 line
14 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"showArrow\", \"headerClass\", \"isActive\", \"onItemClick\", \"forceRender\", \"className\", \"prefixCls\", \"collapsible\", \"accordion\", \"panelKey\", \"extra\", \"header\", \"expandIcon\", \"openMotion\", \"destroyInactivePanel\", \"children\"];\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport React from 'react';\nimport PanelContent from \"./PanelContent\";\nvar CollapsePanel = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _props$showArrow = props.showArrow,\n showArrow = _props$showArrow === void 0 ? true : _props$showArrow,\n headerClass = props.headerClass,\n isActive = props.isActive,\n onItemClick = props.onItemClick,\n forceRender = props.forceRender,\n className = props.className,\n prefixCls = props.prefixCls,\n collapsible = props.collapsible,\n accordion = props.accordion,\n panelKey = props.panelKey,\n extra = props.extra,\n header = props.header,\n expandIcon = props.expandIcon,\n openMotion = props.openMotion,\n destroyInactivePanel = props.destroyInactivePanel,\n children = props.children,\n resetProps = _objectWithoutProperties(props, _excluded);\n var disabled = collapsible === 'disabled';\n var collapsibleHeader = collapsible === 'header';\n var collapsibleIcon = collapsible === 'icon';\n var ifExtraExist = extra !== null && extra !== undefined && typeof extra !== 'boolean';\n var handleItemClick = function handleItemClick() {\n onItemClick === null || onItemClick === void 0 || onItemClick(panelKey);\n };\n var handleKeyDown = function handleKeyDown(e) {\n if (e.key === 'Enter' || e.keyCode === KeyCode.ENTER || e.which === KeyCode.ENTER) {\n handleItemClick();\n }\n };\n\n // ======================== Icon ========================\n var iconNode = typeof expandIcon === 'function' ? expandIcon(props) : /*#__PURE__*/React.createElement(\"i\", {\n className: \"arrow\"\n });\n if (iconNode) {\n iconNode = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-expand-icon\"),\n onClick: ['header', 'icon'].includes(collapsible) ? handleItemClick : undefined\n }, iconNode);\n }\n var collapsePanelClassNames = classNames(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-item\"), true), \"\".concat(prefixCls, \"-item-active\"), isActive), \"\".concat(prefixCls, \"-item-disabled\"), disabled), className);\n var headerClassName = classNames(headerClass, _defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-header\"), true), \"\".concat(prefixCls, \"-header-collapsible-only\"), collapsibleHeader), \"\".concat(prefixCls, \"-icon-collapsible-only\"), collapsibleIcon));\n\n // ======================== HeaderProps ========================\n var headerProps = {\n className: headerClassName,\n 'aria-expanded': isActive,\n 'aria-disabled': disabled,\n onKeyDown: handleKeyDown\n };\n if (!collapsibleHeader && !collapsibleIcon) {\n headerProps.onClick = handleItemClick;\n headerProps.role = accordion ? 'tab' : 'button';\n headerProps.tabIndex = disabled ? -1 : 0;\n }\n\n // ======================== Render ========================\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, resetProps, {\n ref: ref,\n className: collapsePanelClassNames\n }), /*#__PURE__*/React.createElement(\"div\", headerProps, showArrow && iconNode, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-header-text\"),\n onClick: collapsible === 'header' ? handleItemClick : undefined\n }, header), ifExtraExist && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra\")\n }, extra)), /*#__PURE__*/React.createElement(CSSMotion, _extends({\n visible: isActive,\n leavedClassName: \"\".concat(prefixCls, \"-content-hidden\")\n }, openMotion, {\n forceRender: forceRender,\n removeOnLeave: destroyInactivePanel\n }), function (_ref, motionRef) {\n var motionClassName = _ref.className,\n motionStyle = _ref.style;\n return /*#__PURE__*/React.createElement(PanelContent, {\n ref: motionRef,\n prefixCls: prefixCls,\n className: motionClassName,\n style: motionStyle,\n isActive: isActive,\n forceRender: forceRender,\n role: accordion ? 'tabpanel' : void 0\n }, children);\n }));\n});\nexport default CollapsePanel;","map":{"version":3,"names":["_extends","_defineProperty","_objectWithoutProperties","_excluded","classNames","CSSMotion","KeyCode","React","PanelContent","CollapsePanel","forwardRef","props","ref","_props$showArrow","showArrow","headerClass","isActive","onItemClick","forceRender","className","prefixCls","collapsible","accordion","panelKey","extra","header","expandIcon","openMotion","destroyInactivePanel","children","resetProps","disabled","collapsibleHeader","collapsibleIcon","ifExtraExist","undefined","handleItemClick","handleKeyDown","e","key","keyCode","ENTER","which","iconNode","createElement","concat","onClick","includes","collapsePanelClassNames","headerClassName","headerProps","onKeyDown","role","tabIndex","visible","leavedClassName","removeOnLeave","_ref","motionRef","motionClassName","motionStyle","style"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/rc-collapse/es/Panel.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"showArrow\", \"headerClass\", \"isActive\", \"onItemClick\", \"forceRender\", \"className\", \"prefixCls\", \"collapsible\", \"accordion\", \"panelKey\", \"extra\", \"header\", \"expandIcon\", \"openMotion\", \"destroyInactivePanel\", \"children\"];\nimport classNames from 'classnames';\nimport CSSMotion from 'rc-motion';\nimport KeyCode from \"rc-util/es/KeyCode\";\nimport React from 'react';\nimport PanelContent from \"./PanelContent\";\nvar CollapsePanel = /*#__PURE__*/React.forwardRef(function (props, ref) {\n var _props$showArrow = props.showArrow,\n showArrow = _props$showArrow === void 0 ? true : _props$showArrow,\n headerClass = props.headerClass,\n isActive = props.isActive,\n onItemClick = props.onItemClick,\n forceRender = props.forceRender,\n className = props.className,\n prefixCls = props.prefixCls,\n collapsible = props.collapsible,\n accordion = props.accordion,\n panelKey = props.panelKey,\n extra = props.extra,\n header = props.header,\n expandIcon = props.expandIcon,\n openMotion = props.openMotion,\n destroyInactivePanel = props.destroyInactivePanel,\n children = props.children,\n resetProps = _objectWithoutProperties(props, _excluded);\n var disabled = collapsible === 'disabled';\n var collapsibleHeader = collapsible === 'header';\n var collapsibleIcon = collapsible === 'icon';\n var ifExtraExist = extra !== null && extra !== undefined && typeof extra !== 'boolean';\n var handleItemClick = function handleItemClick() {\n onItemClick === null || onItemClick === void 0 || onItemClick(panelKey);\n };\n var handleKeyDown = function handleKeyDown(e) {\n if (e.key === 'Enter' || e.keyCode === KeyCode.ENTER || e.which === KeyCode.ENTER) {\n handleItemClick();\n }\n };\n\n // ======================== Icon ========================\n var iconNode = typeof expandIcon === 'function' ? expandIcon(props) : /*#__PURE__*/React.createElement(\"i\", {\n className: \"arrow\"\n });\n if (iconNode) {\n iconNode = /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-expand-icon\"),\n onClick: ['header', 'icon'].includes(collapsible) ? handleItemClick : undefined\n }, iconNode);\n }\n var collapsePanelClassNames = classNames(_defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-item\"), true), \"\".concat(prefixCls, \"-item-active\"), isActive), \"\".concat(prefixCls, \"-item-disabled\"), disabled), className);\n var headerClassName = classNames(headerClass, _defineProperty(_defineProperty(_defineProperty({}, \"\".concat(prefixCls, \"-header\"), true), \"\".concat(prefixCls, \"-header-collapsible-only\"), collapsibleHeader), \"\".concat(prefixCls, \"-icon-collapsible-only\"), collapsibleIcon));\n\n // ======================== HeaderProps ========================\n var headerProps = {\n className: headerClassName,\n 'aria-expanded': isActive,\n 'aria-disabled': disabled,\n onKeyDown: handleKeyDown\n };\n if (!collapsibleHeader && !collapsibleIcon) {\n headerProps.onClick = handleItemClick;\n headerProps.role = accordion ? 'tab' : 'button';\n headerProps.tabIndex = disabled ? -1 : 0;\n }\n\n // ======================== Render ========================\n return /*#__PURE__*/React.createElement(\"div\", _extends({}, resetProps, {\n ref: ref,\n className: collapsePanelClassNames\n }), /*#__PURE__*/React.createElement(\"div\", headerProps, showArrow && iconNode, /*#__PURE__*/React.createElement(\"span\", {\n className: \"\".concat(prefixCls, \"-header-text\"),\n onClick: collapsible === 'header' ? handleItemClick : undefined\n }, header), ifExtraExist && /*#__PURE__*/React.createElement(\"div\", {\n className: \"\".concat(prefixCls, \"-extra\")\n }, extra)), /*#__PURE__*/React.createElement(CSSMotion, _extends({\n visible: isActive,\n leavedClassName: \"\".concat(prefixCls, \"-content-hidden\")\n }, openMotion, {\n forceRender: forceRender,\n removeOnLeave: destroyInactivePanel\n }), function (_ref, motionRef) {\n var motionClassName = _ref.className,\n motionStyle = _ref.style;\n return /*#__PURE__*/React.createElement(PanelContent, {\n ref: motionRef,\n prefixCls: prefixCls,\n className: motionClassName,\n style: motionStyle,\n isActive: isActive,\n forceRender: forceRender,\n role: accordion ? 'tabpanel' : void 0\n }, children);\n }));\n});\nexport default CollapsePanel;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,eAAe,MAAM,2CAA2C;AACvE,OAAOC,wBAAwB,MAAM,oDAAoD;AACzF,IAAIC,SAAS,GAAG,CAAC,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,sBAAsB,EAAE,UAAU,CAAC;AAC3O,OAAOC,UAAU,MAAM,YAAY;AACnC,OAAOC,SAAS,MAAM,WAAW;AACjC,OAAOC,OAAO,MAAM,oBAAoB;AACxC,OAAOC,KAAK,MAAM,OAAO;AACzB,OAAOC,YAAY,MAAM,gBAAgB;AACzC,IAAIC,aAAa,GAAG,aAAaF,KAAK,CAACG,UAAU,CAAC,UAAUC,KAAK,EAAEC,GAAG,EAAE;EACtE,IAAIC,gBAAgB,GAAGF,KAAK,CAACG,SAAS;IACpCA,SAAS,GAAGD,gBAAgB,KAAK,KAAK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