@desynova-digital/components 9.0.26 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/_helpers/globals.js +9 -10
  2. package/_helpers/pagination.js +10 -15
  3. package/_helpers/story-example.js +16 -39
  4. package/_helpers/story-helpers.js +15 -14
  5. package/_helpers/story-stack.js +22 -43
  6. package/_helpers/uniqueId.js +2 -5
  7. package/_helpers/utils.js +28 -4
  8. package/atoms/avatar/avatar.js +19 -42
  9. package/atoms/avatar/avatar.story.js +25 -58
  10. package/atoms/avatar/index.js +13 -11
  11. package/atoms/badge/badge.js +14 -37
  12. package/atoms/badge/badge.story.js +45 -103
  13. package/atoms/badge/index.js +12 -10
  14. package/atoms/button/button.js +85 -161
  15. package/atoms/button/button.story.js +354 -508
  16. package/atoms/button/index.js +5 -9
  17. package/atoms/card/card.js +26 -55
  18. package/atoms/card/card.story.js +39 -88
  19. package/atoms/card/index.js +12 -10
  20. package/atoms/cardStack/cardStack.js +88 -147
  21. package/atoms/cardStack/cardStack.story.js +106 -210
  22. package/atoms/cardStack/index.js +12 -10
  23. package/atoms/cardV2/cardV2.js +57 -106
  24. package/atoms/cardV2/cardV2.story.js +184 -232
  25. package/atoms/cardV2/content.js +154 -256
  26. package/atoms/cardV2/index.js +4 -8
  27. package/atoms/cardV2/thumbnail.js +138 -208
  28. package/atoms/cardV2/timeline.js +167 -123
  29. package/atoms/checkbox/checkbox.js +85 -157
  30. package/atoms/checkbox/checkbox.story.js +237 -365
  31. package/atoms/checkbox/index.js +4 -9
  32. package/atoms/customSelect/customSelect.js +136 -215
  33. package/atoms/customSelect/customSelect.story.js +745 -851
  34. package/atoms/customSelect/index.js +4 -8
  35. package/atoms/datePicker/datePicker.js +299 -431
  36. package/atoms/datePicker/datePicker.story.js +453 -501
  37. package/atoms/datePicker/index.js +4 -8
  38. package/atoms/dateTime/dateTime.js +3 -6
  39. package/atoms/dateTime/dateTime.story.js +17 -63
  40. package/atoms/dateTime/index.js +5 -9
  41. package/atoms/draftInputText/draftInputText.js +121 -189
  42. package/atoms/draftInputText/draftInputText.story.js +200 -249
  43. package/atoms/draftInputText/index.js +5 -9
  44. package/atoms/dropdown/dropdown.js +38 -66
  45. package/atoms/dropdown/dropdown.story.js +102 -262
  46. package/atoms/dropdown/index.js +4 -8
  47. package/atoms/dropdownList/dropdownList.js +78 -108
  48. package/atoms/dropdownList/dropdownList.story.js +1546 -1621
  49. package/atoms/dropdownList/index.js +4 -8
  50. package/atoms/graphs/barGraph/barGraph.js +95 -146
  51. package/atoms/graphs/barGraph/barGraph.story.js +65 -87
  52. package/atoms/graphs/barGraph/index.js +4 -8
  53. package/atoms/graphs/circleDonut/circleDonut.js +177 -229
  54. package/atoms/graphs/circleDonut/circleDonut.story.js +328 -394
  55. package/atoms/graphs/circleDonut/index.js +5 -9
  56. package/atoms/graphs/circleGraph/circleGraph.js +60 -90
  57. package/atoms/graphs/circleGraph/circleGraph.story.js +36 -54
  58. package/atoms/graphs/circleGraph/index.js +4 -8
  59. package/atoms/graphs/circleNested/circleNested.js +216 -262
  60. package/atoms/graphs/circleNested/circleNested.story.js +91 -116
  61. package/atoms/graphs/circleNested/index.js +5 -9
  62. package/atoms/graphs/pieChart/index.js +4 -8
  63. package/atoms/graphs/pieChart/pieChart.js +162 -191
  64. package/atoms/graphs/pieChart/pieChart.story.js +147 -176
  65. package/atoms/graphs/verticalBarGraph/index.js +5 -9
  66. package/atoms/graphs/verticalBarGraph/verticalBarGraph.js +75 -98
  67. package/atoms/graphs/verticalBarGraph/verticalBarGraph.story.js +26 -45
  68. package/atoms/icon/icon.js +41 -72
  69. package/atoms/icon/icon.story.js +831 -260
  70. package/atoms/icon/index.js +19 -12
  71. package/atoms/image/image.js +18 -32
  72. package/atoms/image/image.story.js +10 -19
  73. package/atoms/image/index.js +4 -8
  74. package/atoms/inputText/index.js +4 -8
  75. package/atoms/inputText/inputText.js +86 -131
  76. package/atoms/inputText/inputText.story.js +191 -255
  77. package/atoms/label/index.js +4 -8
  78. package/atoms/label/label.js +25 -50
  79. package/atoms/label/label.story.js +42 -83
  80. package/atoms/loader/CircleLoader.js +29 -63
  81. package/atoms/loader/ShimmerComponent/CollabShimmerCard.js +39 -50
  82. package/atoms/loader/ShimmerComponent/CollabShimmerCardTray.js +41 -42
  83. package/atoms/loader/ShimmerComponent/FiltersShimmer.js +30 -30
  84. package/atoms/loader/ShimmerComponent/GraphDetailShimmer.js +21 -34
  85. package/atoms/loader/ShimmerComponent/GraphTitleShimmer.js +30 -34
  86. package/atoms/loader/ShimmerComponent/GraphsComponentShimmer.js +23 -32
  87. package/atoms/loader/ShimmerComponent/Shimmer.js +24 -32
  88. package/atoms/loader/ThreeDotLoader.js +14 -29
  89. package/atoms/loader/index.js +13 -11
  90. package/atoms/loader/loader.js +34 -58
  91. package/atoms/loader/loader.story.js +48 -52
  92. package/atoms/loader/spinningLoader.js +23 -34
  93. package/atoms/popup/index.js +5 -9
  94. package/atoms/popup/popup.js +123 -208
  95. package/atoms/popup/popup.story.js +97 -131
  96. package/atoms/radio/index.js +18 -11
  97. package/atoms/radio/radio.js +58 -112
  98. package/atoms/radio/radio.story.js +197 -420
  99. package/atoms/select/index.js +4 -8
  100. package/atoms/select/select.js +48 -86
  101. package/atoms/sideBar/index.js +5 -9
  102. package/atoms/sideBar/sidebar.js +89 -140
  103. package/atoms/switch/index.js +4 -8
  104. package/atoms/switch/switch.js +56 -86
  105. package/atoms/switch/switch.story.js +268 -415
  106. package/atoms/tag/index.js +12 -10
  107. package/atoms/tag/tag.js +29 -63
  108. package/atoms/tag/tag.story.js +135 -209
  109. package/atoms/textarea/index.js +5 -9
  110. package/atoms/textarea/textarea.js +55 -99
  111. package/atoms/textarea/textarea.story.js +48 -41
  112. package/atoms/thematicBreak/index.js +12 -10
  113. package/atoms/thematicBreak/thematicBreak.js +20 -38
  114. package/atoms/thematicBreak/thematicBreak.story.js +25 -37
  115. package/atoms/timeCodeInput/index.js +4 -8
  116. package/atoms/timeCodeInput/timCodeInput.story.js +21 -35
  117. package/atoms/timeCodeInput/timeCodeInput.js +33 -51
  118. package/atoms/timer/index.js +5 -9
  119. package/atoms/timer/timer.js +57 -108
  120. package/atoms/timer/timer.story.js +13 -26
  121. package/atoms/toast/index.js +5 -9
  122. package/atoms/toast/toast.js +81 -116
  123. package/atoms/toast/toast.story.js +50 -76
  124. package/atoms/videoCard/index.js +12 -10
  125. package/atoms/videoCard/videoCard.js +265 -447
  126. package/atoms/videoCard/videoCard.story.js +495 -710
  127. package/components.js +411 -294
  128. package/index.js +350 -61
  129. package/molecules/carousel/carousel.js +121 -207
  130. package/molecules/carousel/carousel.story.js +240 -223
  131. package/molecules/carousel/index.js +5 -9
  132. package/molecules/errorScreen/CollabErrorScreen.js +35 -66
  133. package/molecules/errorScreen/TableErrorScreen.js +109 -102
  134. package/molecules/errorScreen/TableErrorScreen.jsx +7 -6
  135. package/molecules/errorScreen/errorScreen.js +41 -94
  136. package/molecules/filter/constants.js +1 -0
  137. package/molecules/filter/filter.js +378 -562
  138. package/molecules/filter/filter.story.js +79 -104
  139. package/molecules/filter/index.js +5 -9
  140. package/molecules/graphCard/graphCard.js +97 -193
  141. package/molecules/graphCard/graphCard.story.js +159 -191
  142. package/molecules/graphCard/index.js +4 -8
  143. package/molecules/graphCard/loader.js +28 -68
  144. package/molecules/graphDetailCard/graphDetailCard.js +115 -183
  145. package/molecules/graphDetailCard/graphDetailCard.story.js +218 -254
  146. package/molecules/graphDetailCard/index.js +5 -9
  147. package/molecules/pageHeader/index.js +12 -10
  148. package/molecules/pageHeader/pageHeader.js +38 -79
  149. package/molecules/pageHeader/pageHeader.story.js +34 -55
  150. package/molecules/pagination/index.js +4 -8
  151. package/molecules/pagination/pagination.js +126 -202
  152. package/molecules/pagination/pagination.story.js +40 -52
  153. package/molecules/richTextInput/RichTextInput.js +354 -0
  154. package/molecules/richTextInput/RichTextInput.story.js +50 -0
  155. package/molecules/richTextInput/index.js +9 -0
  156. package/molecules/table/index.js +4 -8
  157. package/molecules/table/table-column.js +10 -16
  158. package/molecules/table/table-header.js +31 -72
  159. package/molecules/table/table.js +743 -1075
  160. package/molecules/table/table.story.js +274 -304
  161. package/molecules/tabs/index.js +4 -8
  162. package/molecules/tabs/tabs.js +112 -184
  163. package/molecules/tabs/tabs.story.js +66 -133
  164. package/molecules/videoCardList/index.js +4 -8
  165. package/molecules/videoCardList/videoCardList.js +24 -41
  166. package/molecules/videoCardList/videoCardList.story.js +449 -664
  167. package/molecules/videoPlayer/index.js +4 -8
  168. package/molecules/videoPlayer/videoPlayer.js +1019 -1097
  169. package/molecules/videoPlayer/videoPlayer.story.js +10 -21
  170. package/package.json +2 -2
@@ -1,78 +1,46 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
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 _templateObject = _taggedTemplateLiteral(['\n height: 100%;\n width: 100%;\n overflow: hidden;\n padding: 20px 0;\n position: relative;\n'], ['\n height: 100%;\n width: 100%;\n overflow: hidden;\n padding: 20px 0;\n position: relative;\n']),
10
- _templateObject2 = _taggedTemplateLiteral(['\n height: 100%;\n width: 100%;\n overflow: hidden;\n padding: 0 20px;\n position: relative;\n .carousel-arrow {\n position: absolute;\n width: 40px;\n opacity: 0.5;\n height: 100%;\n top: 0;\n background: #000000;\n z-index: 3;\n cursor: pointer;\n &:hover {\n opacity: 0.8;\n }\n &.carousel-left {\n left: 0;\n }\n &.carousel-right {\n right: 0;\n }\n ', ' {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n'], ['\n height: 100%;\n width: 100%;\n overflow: hidden;\n padding: 0 20px;\n position: relative;\n .carousel-arrow {\n position: absolute;\n width: 40px;\n opacity: 0.5;\n height: 100%;\n top: 0;\n background: #000000;\n z-index: 3;\n cursor: pointer;\n &:hover {\n opacity: 0.8;\n }\n &.carousel-left {\n left: 0;\n }\n &.carousel-right {\n right: 0;\n }\n ', ' {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n']),
11
- _templateObject3 = _taggedTemplateLiteral(['\n width: 100%;\n margin-bottom: 20px;\n padding: 0 20px;\n .title {\n font-family: SFUIText-Medium;\n font-size: 16px;\n line-height: 1;\n vertical-align: middle;\n color: #fff;\n display: inline-block;\n }\n .child-count {\n display: inline-block;\n font-size: 10px;\n color: #afb2ba;\n font-family: SFUIText-Medium;\n border: 1px solid #303f51;\n border-radius: 2px;\n vertical-align: middle;\n margin-left: 15px;\n padding: 3px;\n min-width: 25px;\n height: 18px;\n text-align: center;\n }\n'], ['\n width: 100%;\n margin-bottom: 20px;\n padding: 0 20px;\n .title {\n font-family: SFUIText-Medium;\n font-size: 16px;\n line-height: 1;\n vertical-align: middle;\n color: #fff;\n display: inline-block;\n }\n .child-count {\n display: inline-block;\n font-size: 10px;\n color: #afb2ba;\n font-family: SFUIText-Medium;\n border: 1px solid #303f51;\n border-radius: 2px;\n vertical-align: middle;\n margin-left: 15px;\n padding: 3px;\n min-width: 25px;\n height: 18px;\n text-align: center;\n }\n']),
12
- _templateObject4 = _taggedTemplateLiteral(['\n display: inline-flex;\n position: relative;\n left: 0px;\n transition: all 550ms cubic-bezier(0.02, 0.01, 0.47, 1);\n'], ['\n display: inline-flex;\n position: relative;\n left: 0px;\n transition: all 550ms cubic-bezier(0.02, 0.01, 0.47, 1);\n']),
13
- _templateObject5 = _taggedTemplateLiteral(['\n display: inline-block;\n margin-right: 10px;\n'], ['\n display: inline-block;\n margin-right: 10px;\n']);
14
-
15
- var _react = require('react');
16
-
17
- var _react2 = _interopRequireDefault(_react);
18
-
19
- var _propTypes = require('prop-types');
20
-
21
- var _propTypes2 = _interopRequireDefault(_propTypes);
22
-
23
- var _styledComponents = require('styled-components');
24
-
25
- var _styledComponents2 = _interopRequireDefault(_styledComponents);
26
-
27
- var _icon = require('../../atoms/icon');
28
-
29
- var _icon2 = _interopRequireDefault(_icon);
30
-
31
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32
-
33
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
34
-
35
- 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; }
36
-
37
- 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; }
38
-
39
- function _taggedTemplateLiteral(strings, raw) { return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
40
- // import { colors } from '@ubaid-desynova/tokens';
41
-
42
-
7
+ exports["default"] = void 0;
8
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
11
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
13
+ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
14
+ var _react = _interopRequireDefault(require("react"));
15
+ var _propTypes = _interopRequireDefault(require("prop-types"));
16
+ var _styledComponents = _interopRequireDefault(require("styled-components"));
17
+ var _icon = _interopRequireDefault(require("../../atoms/icon"));
18
+ var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5; // import { colors } from '@ubaid-desynova/tokens';
19
+ function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2["default"])(o), (0, _possibleConstructorReturn2["default"])(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2["default"])(t).constructor) : o.apply(t, e)); }
20
+ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
43
21
  var propTypes = {
44
- children: _propTypes2.default.arrayOf(_propTypes2.default.element),
45
- headerTitle: _propTypes2.default.string,
22
+ children: _propTypes["default"].arrayOf(_propTypes["default"].element),
23
+ headerTitle: _propTypes["default"].string,
46
24
  // indicators: PropTypes.bool,
47
25
 
48
- onChange: _propTypes2.default.func,
49
- totalEntries: _propTypes2.default.number,
50
- theme: _propTypes2.default.oneOf(['light', 'dark', 'nexc'])
26
+ onChange: _propTypes["default"].func,
27
+ totalEntries: _propTypes["default"].number,
28
+ theme: _propTypes["default"].oneOf(['light', 'dark', 'nexc'])
51
29
  };
52
-
53
30
  var defaultProps = {
54
31
  theme: 'light',
55
32
  children: []
56
33
  };
57
-
58
- var CarouselWrapper = _styledComponents2.default.div(_templateObject);
59
-
60
- var CarouselBlock = _styledComponents2.default.div(_templateObject2, _icon2.default.Element);
61
-
62
- var CarouselHeader = _styledComponents2.default.div(_templateObject3);
63
-
64
- var CarouselContainer = (0, _styledComponents2.default)('div')(_templateObject4);
65
-
66
- var CarouselItem = _styledComponents2.default.div(_templateObject5);
67
-
68
- var Carousel = function (_React$Component) {
69
- _inherits(Carousel, _React$Component);
70
-
34
+ var CarouselWrapper = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n height: 100%;\n width: 100%;\n overflow: hidden;\n padding: 20px 0;\n position: relative;\n"])));
35
+ var CarouselBlock = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n height: 100%;\n width: 100%;\n overflow: hidden;\n padding: 0 20px;\n position: relative;\n .carousel-arrow {\n position: absolute;\n width: 40px;\n opacity: 0.5;\n height: 100%;\n top: 0;\n background: #000000;\n z-index: 3;\n cursor: pointer;\n &:hover {\n opacity: 0.8;\n }\n &.carousel-left {\n left: 0;\n }\n &.carousel-right {\n right: 0;\n }\n ", " {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n }\n"])), _icon["default"].Element);
36
+ var CarouselHeader = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n width: 100%;\n margin-bottom: 20px;\n padding: 0 20px;\n .title {\n font-family: SFUIText-Medium;\n font-size: 16px;\n line-height: 1;\n vertical-align: middle;\n color: #fff;\n display: inline-block;\n }\n .child-count {\n display: inline-block;\n font-size: 10px;\n color: #afb2ba;\n font-family: SFUIText-Medium;\n border: 1px solid #303f51;\n border-radius: 2px;\n vertical-align: middle;\n margin-left: 15px;\n padding: 3px;\n min-width: 25px;\n height: 18px;\n text-align: center;\n }\n"])));
37
+ var CarouselContainer = (0, _styledComponents["default"])('div')(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-flex;\n position: relative;\n left: 0px;\n transition: all 550ms cubic-bezier(0.02, 0.01, 0.47, 1);\n"])));
38
+ var CarouselItem = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: inline-block;\n margin-right: 10px;\n"])));
39
+ var Carousel = exports["default"] = /*#__PURE__*/function (_React$Component) {
71
40
  function Carousel(props) {
72
- _classCallCheck(this, Carousel);
73
-
74
- var _this = _possibleConstructorReturn(this, (Carousel.__proto__ || Object.getPrototypeOf(Carousel)).call(this, props));
75
-
41
+ var _this;
42
+ (0, _classCallCheck2["default"])(this, Carousel);
43
+ _this = _callSuper(this, Carousel, [props]);
76
44
  _this.setupCarousel = _this.setupCarousel.bind(_this);
77
45
  _this.state = {
78
46
  carouselItems: [],
@@ -82,28 +50,29 @@ var Carousel = function (_React$Component) {
82
50
  };
83
51
  return _this;
84
52
  }
85
-
86
- _createClass(Carousel, [{
87
- key: 'componentDidMount',
53
+ (0, _inherits2["default"])(Carousel, _React$Component);
54
+ return (0, _createClass2["default"])(Carousel, [{
55
+ key: "componentDidMount",
88
56
  value: function componentDidMount() {
89
- var _props = this.props,
90
- children = _props.children,
91
- theme = _props.theme;
92
-
57
+ var _this$props = this.props,
58
+ children = _this$props.children,
59
+ theme = _this$props.theme;
93
60
  this.setupCarousel(children, theme);
94
61
  }
95
62
  }, {
96
- key: 'componentDidUpdate',
63
+ key: "componentDidUpdate",
97
64
  value: function componentDidUpdate() {
98
65
  this.styleCarousel();
99
66
  }
100
67
  }, {
101
- key: 'setupCarousel',
68
+ key: "setupCarousel",
102
69
  value: function setupCarousel(items, theme) {
103
70
  var carouselItems = [];
104
71
  if (items && items.length) {
105
- carouselItems = _react2.default.Children.map(items, function (child) {
106
- return child ? _react2.default.cloneElement(child, { theme: theme }) : null;
72
+ carouselItems = _react["default"].Children.map(items, function (child) {
73
+ return child ? /*#__PURE__*/_react["default"].cloneElement(child, {
74
+ theme: theme
75
+ }) : null;
107
76
  });
108
77
  }
109
78
  this.setState({
@@ -111,10 +80,9 @@ var Carousel = function (_React$Component) {
111
80
  });
112
81
  }
113
82
  }, {
114
- key: 'styleCarousel',
83
+ key: "styleCarousel",
115
84
  value: function styleCarousel() {
116
85
  var totalSlides = this.state.totalSlides;
117
-
118
86
  var wrapperWidth = this._carouselWrapper.offsetWidth;
119
87
  var containerWidth = this._carouselContainer.offsetWidth;
120
88
  var childCount = this._carouselContainer.childElementCount;
@@ -132,14 +100,13 @@ var Carousel = function (_React$Component) {
132
100
  }
133
101
  }
134
102
  }, {
135
- key: 'carouselAction',
103
+ key: "carouselAction",
136
104
  value: function carouselAction(action) {
137
105
  var onChange = this.props.onChange;
138
- var _state = this.state,
139
- viewWidth = _state.viewWidth,
140
- currentSlide = _state.currentSlide,
141
- totalSlides = _state.totalSlides;
142
-
106
+ var _this$state = this.state,
107
+ viewWidth = _this$state.viewWidth,
108
+ currentSlide = _this$state.currentSlide,
109
+ totalSlides = _this$state.totalSlides;
143
110
  var containerLeft = parseInt(this._carouselContainer.style.left);
144
111
  switch (action) {
145
112
  case 'left':
@@ -150,7 +117,6 @@ var Carousel = function (_React$Component) {
150
117
  left = containerLeft;
151
118
  }
152
119
  left = left + viewWidth;
153
-
154
120
  this._carouselContainer.style.left = left + 'px';
155
121
  this.setState(function (state) {
156
122
  return {
@@ -169,7 +135,6 @@ var Carousel = function (_React$Component) {
169
135
  _left = containerLeft;
170
136
  }
171
137
  _left = _left - viewWidth;
172
-
173
138
  this._carouselContainer.style.left = _left + 'px';
174
139
  this.setState(function (state) {
175
140
  return {
@@ -181,145 +146,94 @@ var Carousel = function (_React$Component) {
181
146
  }
182
147
  break;
183
148
  }
184
-
185
149
  if (onChange) {
186
150
  onChange(action, totalSlides, currentSlide);
187
151
  }
188
152
  }
189
153
  }, {
190
- key: 'UNSAFE_componentWillReceiveProps',
154
+ key: "UNSAFE_componentWillReceiveProps",
191
155
  value: function UNSAFE_componentWillReceiveProps(newProps) {
192
156
  var children = newProps.children,
193
- theme = newProps.theme;
194
-
157
+ theme = newProps.theme;
195
158
  this.setupCarousel(children, theme);
196
159
  }
197
160
  }, {
198
- key: 'render',
161
+ key: "render",
199
162
  value: function render() {
200
163
  var _this2 = this;
201
-
202
- var _props2 = this.props,
203
- headerTitle = _props2.headerTitle,
204
- addNew = _props2.addNew,
205
- totalEntries = _props2.totalEntries;
206
- var _state2 = this.state,
207
- carouselItems = _state2.carouselItems,
208
- currentSlide = _state2.currentSlide,
209
- totalSlides = _state2.totalSlides;
210
-
211
- return _react2.default.createElement(
212
- CarouselWrapper,
213
- {
214
- className: 'carousel-wrapper ' + this.props.className,
215
- ref: function ref(carouselWrapper) {
216
- _this2._carouselWrapper = carouselWrapper;
164
+ var _this$props2 = this.props,
165
+ headerTitle = _this$props2.headerTitle,
166
+ addNew = _this$props2.addNew,
167
+ totalEntries = _this$props2.totalEntries;
168
+ var _this$state2 = this.state,
169
+ carouselItems = _this$state2.carouselItems,
170
+ currentSlide = _this$state2.currentSlide,
171
+ totalSlides = _this$state2.totalSlides;
172
+ return /*#__PURE__*/_react["default"].createElement(CarouselWrapper, {
173
+ className: 'carousel-wrapper ' + this.props.className,
174
+ ref: function ref(carouselWrapper) {
175
+ _this2._carouselWrapper = carouselWrapper;
176
+ }
177
+ }, /*#__PURE__*/_react["default"].createElement(CarouselHeader, {
178
+ className: "carousel-header"
179
+ }, this.props.rightPart ? /*#__PURE__*/_react["default"].createElement("div", {
180
+ style: {
181
+ display: 'flex',
182
+ justifyContent: 'space-between'
183
+ }
184
+ }, ' ', /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
185
+ className: "title"
186
+ }, headerTitle), /*#__PURE__*/_react["default"].createElement("p", {
187
+ className: "child-count"
188
+ }, addNew ? totalEntries - 1 : totalEntries)), /*#__PURE__*/_react["default"].createElement("div", {
189
+ className: "carousel-header-right"
190
+ }, this.props.rightPart)) : addNew || totalEntries || headerTitle ? /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("p", {
191
+ className: "title"
192
+ }, headerTitle), /*#__PURE__*/_react["default"].createElement("p", {
193
+ className: "child-count"
194
+ }, addNew ? totalEntries - 1 : totalEntries)) : null), /*#__PURE__*/_react["default"].createElement(CarouselBlock, {
195
+ className: "carousel-block"
196
+ }, currentSlide > 1 ? /*#__PURE__*/_react["default"].createElement("div", {
197
+ className: "carousel-arrow carousel-left",
198
+ role: "presentation",
199
+ onClick: function onClick() {
200
+ _this2.carouselAction('left');
201
+ }
202
+ }, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
203
+ width: 14,
204
+ height: 30,
205
+ name: "angle-left",
206
+ color: "none",
207
+ stroke: "#fff"
208
+ })) : null, currentSlide < totalSlides ? /*#__PURE__*/_react["default"].createElement("div", {
209
+ className: "carousel-arrow carousel-right",
210
+ role: "presentation",
211
+ onClick: function onClick() {
212
+ _this2.carouselAction('right');
213
+ }
214
+ }, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
215
+ width: 14,
216
+ height: 30,
217
+ name: "angle-right",
218
+ color: "none",
219
+ stroke: "#fff"
220
+ })) : null, /*#__PURE__*/_react["default"].createElement(CarouselContainer, {
221
+ className: "carousel-container",
222
+ ref: function ref(carouselContainer) {
223
+ _this2._carouselContainer = carouselContainer;
224
+ }
225
+ }, carouselItems.map(function (item) {
226
+ return /*#__PURE__*/_react["default"].createElement(CarouselItem, {
227
+ className: "carousel-item",
228
+ key: item.key || item.props.id,
229
+ ref: function ref(carouselItem) {
230
+ _this2._carouselItem = carouselItem;
217
231
  }
218
- },
219
- _react2.default.createElement(
220
- CarouselHeader,
221
- { className: 'carousel-header' },
222
- this.props.rightPart ? _react2.default.createElement(
223
- 'div',
224
- {
225
- style: {
226
- display: 'flex',
227
- justifyContent: 'space-between'
228
- }
229
- },
230
- ' ',
231
- _react2.default.createElement(
232
- 'div',
233
- null,
234
- _react2.default.createElement(
235
- 'p',
236
- { className: 'title' },
237
- headerTitle
238
- ),
239
- _react2.default.createElement(
240
- 'p',
241
- { className: 'child-count' },
242
- addNew ? totalEntries - 1 : totalEntries
243
- )
244
- ),
245
- _react2.default.createElement(
246
- 'div',
247
- { className: 'carousel-header-right' },
248
- this.props.rightPart
249
- )
250
- ) : addNew || totalEntries || headerTitle ? _react2.default.createElement(
251
- 'div',
252
- null,
253
- _react2.default.createElement(
254
- 'p',
255
- { className: 'title' },
256
- headerTitle
257
- ),
258
- _react2.default.createElement(
259
- 'p',
260
- { className: 'child-count' },
261
- addNew ? totalEntries - 1 : totalEntries
262
- )
263
- ) : null
264
- ),
265
- _react2.default.createElement(
266
- CarouselBlock,
267
- { className: 'carousel-block' },
268
- currentSlide > 1 ? _react2.default.createElement(
269
- 'div',
270
- {
271
- className: 'carousel-arrow carousel-left',
272
- role: 'presentation',
273
- onClick: function onClick() {
274
- _this2.carouselAction('left');
275
- }
276
- },
277
- _react2.default.createElement(_icon2.default, { width: 14, height: 30, name: 'angle-left', color: 'none', stroke: '#fff' })
278
- ) : null,
279
- currentSlide < totalSlides ? _react2.default.createElement(
280
- 'div',
281
- {
282
- className: 'carousel-arrow carousel-right',
283
- role: 'presentation',
284
- onClick: function onClick() {
285
- _this2.carouselAction('right');
286
- }
287
- },
288
- _react2.default.createElement(_icon2.default, { width: 14, height: 30, name: 'angle-right', color: 'none', stroke: '#fff' })
289
- ) : null,
290
- _react2.default.createElement(
291
- CarouselContainer,
292
- {
293
- className: 'carousel-container',
294
- ref: function ref(carouselContainer) {
295
- _this2._carouselContainer = carouselContainer;
296
- }
297
- },
298
- carouselItems.map(function (item) {
299
- return _react2.default.createElement(
300
- CarouselItem,
301
- {
302
- className: 'carousel-item',
303
- key: item.key || item.props.id,
304
- ref: function ref(carouselItem) {
305
- _this2._carouselItem = carouselItem;
306
- }
307
- },
308
- item
309
- );
310
- })
311
- )
312
- )
313
- );
232
+ }, item);
233
+ }))));
314
234
  }
315
235
  }]);
316
-
317
- return Carousel;
318
- }(_react2.default.Component);
319
-
320
- exports.default = Carousel;
321
-
322
-
236
+ }(_react["default"].Component);
323
237
  Carousel.Item = CarouselItem;
324
238
  Carousel.Header = CarouselHeader;
325
239
  Carousel.propTypes = propTypes;