1 line
9.1 KiB
JSON
1 line
9.1 KiB
JSON
|
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"invalidate\", \"item\", \"renderItem\", \"responsive\", \"responsiveDisabled\", \"registerSize\", \"itemKey\", \"className\", \"style\", \"children\", \"display\", \"order\", \"component\"];\nimport * as React from 'react';\nimport classNames from 'classnames';\nimport ResizeObserver from 'rc-resize-observer';\n// Use shared variable to save bundle size\nvar UNDEFINED = undefined;\nfunction InternalItem(props, ref) {\n var prefixCls = props.prefixCls,\n invalidate = props.invalidate,\n item = props.item,\n renderItem = props.renderItem,\n responsive = props.responsive,\n responsiveDisabled = props.responsiveDisabled,\n registerSize = props.registerSize,\n itemKey = props.itemKey,\n className = props.className,\n style = props.style,\n children = props.children,\n display = props.display,\n order = props.order,\n _props$component = props.component,\n Component = _props$component === void 0 ? 'div' : _props$component,\n restProps = _objectWithoutProperties(props, _excluded);\n var mergedHidden = responsive && !display;\n // ================================ Effect ================================\n function internalRegisterSize(width) {\n registerSize(itemKey, width);\n }\n React.useEffect(function () {\n return function () {\n internalRegisterSize(null);\n };\n }, []);\n // ================================ Render ================================\n var childNode = renderItem && item !== UNDEFINED ? renderItem(item) : children;\n var overflowStyle;\n if (!invalidate) {\n overflowStyle = {\n opacity: mergedHidden ? 0 : 1,\n height: mergedHidden ? 0 : UNDEFINED,\n overflowY: mergedHidden ? 'hidden' : UNDEFINED,\n order: responsive ? order : UNDEFINED,\n pointerEvents: mergedHidden ? 'none' : UNDEFINED,\n position: mergedHidden ? 'absolute' : UNDEFINED\n };\n }\n var overflowProps = {};\n if (mergedHidden) {\n overflowProps['aria-hidden'] = true;\n }\n var itemNode = /*#__PURE__*/React.createElement(Component, _extends({\n className: classNames(!invalidate && prefixCls, className),\n style: _objectSpread(_objectSpread({}, overflowStyle), style)\n }, overflowProps, restProps, {\n ref: ref\n }), childNode);\n if (responsive) {\n itemNode = /*#__PURE__*/React.createElement(ResizeObserver, {\n onResize: function onResize(_ref) {\n var offsetWidth = _ref.offsetWidth;\n internalRegisterSize(offsetWidth);\n },\n disabled: responsiveDisabled\n }, itemNode);\n }\n return itemNode;\n}\nvar Item = /*#__PURE__*/React.forwardRef(InternalItem);\nItem.displayName = 'Item';\nexport default Item;","map":{"version":3,"names":["_extends","_objectSpread","_objectWithoutProperties","_excluded","React","classNames","ResizeObserver","UNDEFINED","undefined","InternalItem","props","ref","prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","_props$component","component","Component","restProps","mergedHidden","internalRegisterSize","width","useEffect","childNode","overflowStyle","opacity","height","overflowY","pointerEvents","position","overflowProps","itemNode","createElement","onResize","_ref","offsetWidth","disabled","Item","forwardRef","displayName"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-overflow/es/Item.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectSpread from \"@babel/runtime/helpers/esm/objectSpread2\";\nimport _objectWithoutProperties from \"@babel/runtime/helpers/esm/objectWithoutProperties\";\nvar _excluded = [\"prefixCls\", \"invalidate\", \"item\", \"renderItem\", \"responsive\", \"responsiveDisabled\", \"registerSize\", \"i
|