1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 | var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
8 |
|
9 | var _react = require('react');
|
10 |
|
11 | var _react2 = _interopRequireDefault(_react);
|
12 |
|
13 | var _reactSlidySlider = require('./react-slidy-slider');
|
14 |
|
15 | var _reactSlidySlider2 = _interopRequireDefault(_reactSlidySlider);
|
16 |
|
17 | var _suiSpinner = require('@schibstedspain/sui-spinner');
|
18 |
|
19 | var _suiSpinner2 = _interopRequireDefault(_suiSpinner);
|
20 |
|
21 | var _reactLazyLoad = require('react-lazy-load');
|
22 |
|
23 | var _reactLazyLoad2 = _interopRequireDefault(_reactLazyLoad);
|
24 |
|
25 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
26 |
|
27 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
28 |
|
29 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
30 |
|
31 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
32 |
|
33 | var spinnerConfig = {
|
34 | size: 20,
|
35 | thickness: 2,
|
36 | type: 'circle'
|
37 | };
|
38 |
|
39 | var lazyLoadOffsetVerical = 500;
|
40 |
|
41 | var ReactSlidy = function (_Component) {
|
42 | _inherits(ReactSlidy, _Component);
|
43 |
|
44 | function ReactSlidy() {
|
45 | _classCallCheck(this, ReactSlidy);
|
46 |
|
47 | return _possibleConstructorReturn(this, (ReactSlidy.__proto__ || Object.getPrototypeOf(ReactSlidy)).apply(this, arguments));
|
48 | }
|
49 |
|
50 | _createClass(ReactSlidy, [{
|
51 | key: 'shouldComponentUpdate',
|
52 |
|
53 |
|
54 |
|
55 | value: function shouldComponentUpdate() {
|
56 | return false;
|
57 | }
|
58 | }, {
|
59 | key: 'render',
|
60 | value: function render() {
|
61 | return _react2.default.createElement(
|
62 | 'div',
|
63 | { className: this.props.classNameBase },
|
64 | _react2.default.createElement(_suiSpinner2.default, spinnerConfig),
|
65 | _react2.default.createElement(
|
66 | _reactLazyLoad2.default,
|
67 | { offsetVertical: lazyLoadOffsetVerical },
|
68 | _react2.default.createElement(
|
69 | _reactSlidySlider2.default,
|
70 | this.props,
|
71 | this.props.children
|
72 | )
|
73 | )
|
74 | );
|
75 | }
|
76 | }]);
|
77 |
|
78 | return ReactSlidy;
|
79 | }(_react.Component);
|
80 |
|
81 | exports.default = ReactSlidy;
|
82 |
|
83 |
|
84 | ReactSlidy.propTypes = {
|
85 | children: _react.PropTypes.oneOfType([_react.PropTypes.array, _react.PropTypes.object]).isRequired,
|
86 | classNameBase: _react.PropTypes.string
|
87 | };
|
88 |
|
89 | ReactSlidy.defaultProps = {
|
90 | classNameBase: 'react-Slidy'
|
91 | }; |
\ | No newline at end of file |