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\", \"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;"],"mappings":"AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAOC,aAAa,MAAM,0CAA0C;AACpE,OAAOC,wBAAwB,MAAM,oDAAoD;AACzF,IAAIC,SAAS,GAAG,CAAC,WAAW,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,cAAc,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,CAAC;AACnM,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,OAAOC,UAAU,MAAM,YAAY;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