PromoCursed/node_modules/.cache/babel-loader/3312fc2fa63bec0b240479321234acb0a5d0cf7aa308eb46f38e60217f624dad.json

1 line
15 KiB
JSON
Raw Normal View History

2024-08-20 23:25:37 +04:00
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"children\", \"label\", \"key\", \"collapsible\", \"onItemClick\", \"destroyInactivePanel\"];\nimport toArray from \"rc-util/es/Children/toArray\";\nimport React from 'react';\nimport CollapsePanel from \"../Panel\";\nvar convertItemsToNodes = function convertItemsToNodes(items, props) {\n var prefixCls = props.prefixCls,\n accordion = props.accordion,\n collapsible = props.collapsible,\n destroyInactivePanel = props.destroyInactivePanel,\n onItemClick = props.onItemClick,\n activeKey = props.activeKey,\n openMotion = props.openMotion,\n expandIcon = props.expandIcon;\n return items.map(function (item, index) {\n var children = item.children,\n label = item.label,\n rawKey = item.key,\n rawCollapsible = item.collapsible,\n rawOnItemClick = item.onItemClick,\n rawDestroyInactivePanel = item.destroyInactivePanel,\n restProps = _objectWithoutProperties(item, _excluded);\n\n // You may be puzzled why you want to convert them all into strings, me too.\n // Maybe: https://github.com/react-component/collapse/blob/aac303a8b6ff30e35060b4f8fecde6f4556fcbe2/src/Collapse.tsx#L15\n var key = String(rawKey !== null && rawKey !== void 0 ? rawKey : index);\n var mergeCollapsible = rawCollapsible !== null && rawCollapsible !== void 0 ? rawCollapsible : collapsible;\n var mergeDestroyInactivePanel = rawDestroyInactivePanel !== null && rawDestroyInactivePanel !== void 0 ? rawDestroyInactivePanel : destroyInactivePanel;\n var handleItemClick = function handleItemClick(value) {\n if (mergeCollapsible === 'disabled') return;\n onItemClick(value);\n rawOnItemClick === null || rawOnItemClick === void 0 || rawOnItemClick(value);\n };\n var isActive = false;\n if (accordion) {\n isActive = activeKey[0] === key;\n } else {\n isActive = activeKey.indexOf(key) > -1;\n }\n return /*#__PURE__*/React.createElement(CollapsePanel, _extends({}, restProps, {\n prefixCls: prefixCls,\n key: key,\n panelKey: key,\n isActive: isActive,\n accordion: accordion,\n openMotion: openMotion,\n expandIcon: expandIcon,\n header: label,\n collapsible: mergeCollapsible,\n onItemClick: handleItemClick,\n destroyInactivePanel: mergeDestroyInactivePanel\n }), children);\n });\n};\n\n/**\n * @deprecated The next major version will be removed\n */\nvar getNewChild = function getNewChild(child, index, props) {\n if (!child) return null;\n var prefixCls = props.prefixCls,\n accordion = props.accordion,\n collapsible = props.collapsible,\n destroyInactivePanel = props.destroyInactivePanel,\n onItemClick = props.onItemClick,\n activeKey = props.activeKey,\n openMotion = props.openMotion,\n expandIcon = props.expandIcon;\n var key = child.key || String(index);\n var _child$props = child.props,\n header = _child$props.header,\n headerClass = _child$props.headerClass,\n childDestroyInactivePanel = _child$props.destroyInactivePanel,\n childCollapsible = _child$props.collapsible,\n childOnItemClick = _child$props.onItemClick;\n var isActive = false;\n if (accordion) {\n isActive = activeKey[0] === key;\n } else {\n isActive = activeKey.indexOf(key) > -1;\n }\n var mergeCollapsible = childCollapsible !== null && childCollapsible !== void 0 ? childCollapsible : collapsible;\n var handleItemClick = function handleItemClick(value) {\n if (mergeCollapsible === 'disabled') return;\n onItemClick(value);\n childOnItemClick === null || childOnItemClick === void 0 || childOnItemClick(value);\n };\n var childProps = {\n key: key,\n panelKey: key,\n header: header,\n headerClass: headerClass,\n isActive: isActive,\n prefixCls: prefixCls,\n destroyInactivePanel: childDestroyInactivePanel !== null && childDestroyInactivePanel !== void 0 ? childDestroyI