d33f840e943b31be620a409ddcfd259c.json
14.2 KB
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport debounce from 'lodash/debounce';\nimport SlickCarousel from '@ant-design/react-slick';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider';\nvar Carousel = /*#__PURE__*/React.forwardRef(function (_a, ref) {\n var _classNames;\n\n var _a$dots = _a.dots,\n dots = _a$dots === void 0 ? true : _a$dots,\n _a$arrows = _a.arrows,\n arrows = _a$arrows === void 0 ? false : _a$arrows,\n _a$draggable = _a.draggable,\n draggable = _a$draggable === void 0 ? false : _a$draggable,\n _a$dotPosition = _a.dotPosition,\n dotPosition = _a$dotPosition === void 0 ? 'bottom' : _a$dotPosition,\n props = __rest(_a, [\"dots\", \"arrows\", \"draggable\", \"dotPosition\"]);\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var slickRef = React.useRef();\n\n var goTo = function goTo(slide) {\n var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n slickRef.current.slickGoTo(slide, dontAnimate);\n };\n\n React.useImperativeHandle(ref, function () {\n return {\n goTo: goTo,\n autoPlay: slickRef.current.innerSlider.autoPlay,\n innerSlider: slickRef.current.innerSlider,\n prev: slickRef.current.slickPrev,\n next: slickRef.current.slickNext\n };\n }, [slickRef.current]);\n React.useEffect(function () {\n var func = function func() {\n // Fix https://github.com/ant-design/ant-design/issues/2550\n var autoplay = props.autoplay;\n\n if (autoplay && slickRef.current && slickRef.current.innerSlider && slickRef.current.innerSlider.autoPlay) {\n slickRef.current.innerSlider.autoPlay();\n }\n };\n\n var onWindowResized = debounce(func, 500, {\n leading: false\n });\n\n if (props.autoplay) {\n window.addEventListener('resize', onWindowResized);\n }\n\n return function () {\n if (props.autoplay) {\n window.removeEventListener('resize', onWindowResized);\n onWindowResized.cancel();\n }\n };\n }, [slickRef.current, props.autoplay]);\n var prevCount = React.useRef(React.Children.count(props.children));\n React.useEffect(function () {\n if (prevCount.current !== React.Children.count(props.children)) {\n goTo(props.initialSlide || 0, false);\n prevCount.current = React.Children.count(props.children);\n }\n }, [props.children]);\n\n var newProps = _extends({}, props);\n\n if (newProps.effect === 'fade') {\n newProps.fade = true;\n }\n\n var prefixCls = getPrefixCls('carousel', newProps.prefixCls);\n var dotsClass = 'slick-dots';\n newProps.vertical = dotPosition === 'left' || dotPosition === 'right';\n var enableDots = !!dots;\n var dsClass = classNames(dotsClass, \"\".concat(dotsClass, \"-\").concat(dotPosition), typeof dots === 'boolean' ? false : dots === null || dots === void 0 ? void 0 : dots.className);\n var className = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-vertical\"), newProps.vertical), _classNames));\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className\n }, /*#__PURE__*/React.createElement(SlickCarousel, _extends({\n ref: slickRef\n }, newProps, {\n dots: enableDots,\n dotsClass: dsClass,\n arrows: arrows,\n draggable: draggable\n })));\n});\nexport default Carousel;","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/carousel/index.js"],"names":["_defineProperty","_extends","__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","React","debounce","SlickCarousel","classNames","ConfigContext","Carousel","forwardRef","_a","ref","_classNames","_a$dots","dots","_a$arrows","arrows","_a$draggable","draggable","_a$dotPosition","dotPosition","props","_React$useContext","useContext","getPrefixCls","direction","slickRef","useRef","goTo","slide","dontAnimate","arguments","undefined","current","slickGoTo","useImperativeHandle","autoPlay","innerSlider","prev","slickPrev","next","slickNext","useEffect","func","autoplay","onWindowResized","leading","window","addEventListener","removeEventListener","cancel","prevCount","Children","count","children","initialSlide","newProps","effect","fade","prefixCls","dotsClass","vertical","enableDots","dsClass","concat","className","createElement"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,uCAA5B;AACA,OAAOC,QAAP,MAAqB,gCAArB;;AAEA,IAAIC,MAAM,GAAG,QAAQ,KAAKA,MAAb,IAAuB,UAAUC,CAAV,EAAaC,CAAb,EAAgB;AAClD,MAAIC,CAAC,GAAG,EAAR;;AAEA,OAAK,IAAIC,CAAT,IAAcH,CAAd,EAAiB;AACf,QAAII,MAAM,CAACC,SAAP,CAAiBC,cAAjB,CAAgCC,IAAhC,CAAqCP,CAArC,EAAwCG,CAAxC,KAA8CF,CAAC,CAACO,OAAF,CAAUL,CAAV,IAAe,CAAjE,EAAoED,CAAC,CAACC,CAAD,CAAD,GAAOH,CAAC,CAACG,CAAD,CAAR;AACrE;;AAED,MAAIH,CAAC,IAAI,IAAL,IAAa,OAAOI,MAAM,CAACK,qBAAd,KAAwC,UAAzD,EAAqE,KAAK,IAAIC,CAAC,GAAG,CAAR,EAAWP,CAAC,GAAGC,MAAM,CAACK,qBAAP,CAA6BT,CAA7B,CAApB,EAAqDU,CAAC,GAAGP,CAAC,CAACQ,MAA3D,EAAmED,CAAC,EAApE,EAAwE;AAC3I,QAAIT,CAAC,CAACO,OAAF,CAAUL,CAAC,CAACO,CAAD,CAAX,IAAkB,CAAlB,IAAuBN,MAAM,CAACC,SAAP,CAAiBO,oBAAjB,CAAsCL,IAAtC,CAA2CP,CAA3C,EAA8CG,CAAC,CAACO,CAAD,CAA/C,CAA3B,EAA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Content":["import _defineProperty from \"@babel/runtime/helpers/defineProperty\";\nimport _extends from \"@babel/runtime/helpers/extends\";\n\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\nimport * as React from 'react';\nimport debounce from 'lodash/debounce';\nimport SlickCarousel from '@ant-design/react-slick';\nimport classNames from 'classnames';\nimport { ConfigContext } from '../config-provider';\nvar Carousel = /*#__PURE__*/React.forwardRef(function (_a, ref) {\n var _classNames;\n\n var _a$dots = _a.dots,\n dots = _a$dots === void 0 ? true : _a$dots,\n _a$arrows = _a.arrows,\n arrows = _a$arrows === void 0 ? false : _a$arrows,\n _a$draggable = _a.draggable,\n draggable = _a$draggable === void 0 ? false : _a$draggable,\n _a$dotPosition = _a.dotPosition,\n dotPosition = _a$dotPosition === void 0 ? 'bottom' : _a$dotPosition,\n props = __rest(_a, [\"dots\", \"arrows\", \"draggable\", \"dotPosition\"]);\n\n var _React$useContext = React.useContext(ConfigContext),\n getPrefixCls = _React$useContext.getPrefixCls,\n direction = _React$useContext.direction;\n\n var slickRef = React.useRef();\n\n var goTo = function goTo(slide) {\n var dontAnimate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n slickRef.current.slickGoTo(slide, dontAnimate);\n };\n\n React.useImperativeHandle(ref, function () {\n return {\n goTo: goTo,\n autoPlay: slickRef.current.innerSlider.autoPlay,\n innerSlider: slickRef.current.innerSlider,\n prev: slickRef.current.slickPrev,\n next: slickRef.current.slickNext\n };\n }, [slickRef.current]);\n React.useEffect(function () {\n var func = function func() {\n // Fix https://github.com/ant-design/ant-design/issues/2550\n var autoplay = props.autoplay;\n\n if (autoplay && slickRef.current && slickRef.current.innerSlider && slickRef.current.innerSlider.autoPlay) {\n slickRef.current.innerSlider.autoPlay();\n }\n };\n\n var onWindowResized = debounce(func, 500, {\n leading: false\n });\n\n if (props.autoplay) {\n window.addEventListener('resize', onWindowResized);\n }\n\n return function () {\n if (props.autoplay) {\n window.removeEventListener('resize', onWindowResized);\n onWindowResized.cancel();\n }\n };\n }, [slickRef.current, props.autoplay]);\n var prevCount = React.useRef(React.Children.count(props.children));\n React.useEffect(function () {\n if (prevCount.current !== React.Children.count(props.children)) {\n goTo(props.initialSlide || 0, false);\n prevCount.current = React.Children.count(props.children);\n }\n }, [props.children]);\n\n var newProps = _extends({}, props);\n\n if (newProps.effect === 'fade') {\n newProps.fade = true;\n }\n\n var prefixCls = getPrefixCls('carousel', newProps.prefixCls);\n var dotsClass = 'slick-dots';\n newProps.vertical = dotPosition === 'left' || dotPosition === 'right';\n var enableDots = !!dots;\n var dsClass = classNames(dotsClass, \"\".concat(dotsClass, \"-\").concat(dotPosition), typeof dots === 'boolean' ? false : dots === null || dots === void 0 ? void 0 : dots.className);\n var className = classNames(prefixCls, (_classNames = {}, _defineProperty(_classNames, \"\".concat(prefixCls, \"-rtl\"), direction === 'rtl'), _defineProperty(_classNames, \"\".concat(prefixCls, \"-vertical\"), newProps.vertical), _classNames));\n return /*#__PURE__*/React.createElement(\"div\", {\n className: className\n }, /*#__PURE__*/React.createElement(SlickCarousel, _extends({\n ref: slickRef\n }, newProps, {\n dots: enableDots,\n dotsClass: dsClass,\n arrows: arrows,\n draggable: draggable\n })));\n});\nexport default Carousel;"]},"metadata":{},"sourceType":"module"}