@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.
- package/_helpers/globals.js +9 -10
- package/_helpers/pagination.js +10 -15
- package/_helpers/story-example.js +16 -39
- package/_helpers/story-helpers.js +15 -14
- package/_helpers/story-stack.js +22 -43
- package/_helpers/uniqueId.js +2 -5
- package/_helpers/utils.js +28 -4
- package/atoms/avatar/avatar.js +19 -42
- package/atoms/avatar/avatar.story.js +25 -58
- package/atoms/avatar/index.js +13 -11
- package/atoms/badge/badge.js +14 -37
- package/atoms/badge/badge.story.js +45 -103
- package/atoms/badge/index.js +12 -10
- package/atoms/button/button.js +85 -161
- package/atoms/button/button.story.js +354 -508
- package/atoms/button/index.js +5 -9
- package/atoms/card/card.js +26 -55
- package/atoms/card/card.story.js +39 -88
- package/atoms/card/index.js +12 -10
- package/atoms/cardStack/cardStack.js +88 -147
- package/atoms/cardStack/cardStack.story.js +106 -210
- package/atoms/cardStack/index.js +12 -10
- package/atoms/cardV2/cardV2.js +57 -106
- package/atoms/cardV2/cardV2.story.js +184 -232
- package/atoms/cardV2/content.js +154 -256
- package/atoms/cardV2/index.js +4 -8
- package/atoms/cardV2/thumbnail.js +138 -208
- package/atoms/cardV2/timeline.js +167 -123
- package/atoms/checkbox/checkbox.js +85 -157
- package/atoms/checkbox/checkbox.story.js +237 -365
- package/atoms/checkbox/index.js +4 -9
- package/atoms/customSelect/customSelect.js +136 -215
- package/atoms/customSelect/customSelect.story.js +745 -851
- package/atoms/customSelect/index.js +4 -8
- package/atoms/datePicker/datePicker.js +299 -431
- package/atoms/datePicker/datePicker.story.js +453 -501
- package/atoms/datePicker/index.js +4 -8
- package/atoms/dateTime/dateTime.js +3 -6
- package/atoms/dateTime/dateTime.story.js +17 -63
- package/atoms/dateTime/index.js +5 -9
- package/atoms/draftInputText/draftInputText.js +121 -189
- package/atoms/draftInputText/draftInputText.story.js +200 -249
- package/atoms/draftInputText/index.js +5 -9
- package/atoms/dropdown/dropdown.js +38 -66
- package/atoms/dropdown/dropdown.story.js +102 -262
- package/atoms/dropdown/index.js +4 -8
- package/atoms/dropdownList/dropdownList.js +78 -108
- package/atoms/dropdownList/dropdownList.story.js +1546 -1621
- package/atoms/dropdownList/index.js +4 -8
- package/atoms/graphs/barGraph/barGraph.js +95 -146
- package/atoms/graphs/barGraph/barGraph.story.js +65 -87
- package/atoms/graphs/barGraph/index.js +4 -8
- package/atoms/graphs/circleDonut/circleDonut.js +177 -229
- package/atoms/graphs/circleDonut/circleDonut.story.js +328 -394
- package/atoms/graphs/circleDonut/index.js +5 -9
- package/atoms/graphs/circleGraph/circleGraph.js +60 -90
- package/atoms/graphs/circleGraph/circleGraph.story.js +36 -54
- package/atoms/graphs/circleGraph/index.js +4 -8
- package/atoms/graphs/circleNested/circleNested.js +216 -262
- package/atoms/graphs/circleNested/circleNested.story.js +91 -116
- package/atoms/graphs/circleNested/index.js +5 -9
- package/atoms/graphs/pieChart/index.js +4 -8
- package/atoms/graphs/pieChart/pieChart.js +162 -191
- package/atoms/graphs/pieChart/pieChart.story.js +147 -176
- package/atoms/graphs/verticalBarGraph/index.js +5 -9
- package/atoms/graphs/verticalBarGraph/verticalBarGraph.js +75 -98
- package/atoms/graphs/verticalBarGraph/verticalBarGraph.story.js +26 -45
- package/atoms/icon/icon.js +41 -72
- package/atoms/icon/icon.story.js +831 -260
- package/atoms/icon/index.js +19 -12
- package/atoms/image/image.js +18 -32
- package/atoms/image/image.story.js +10 -19
- package/atoms/image/index.js +4 -8
- package/atoms/inputText/index.js +4 -8
- package/atoms/inputText/inputText.js +86 -131
- package/atoms/inputText/inputText.story.js +191 -255
- package/atoms/label/index.js +4 -8
- package/atoms/label/label.js +25 -50
- package/atoms/label/label.story.js +42 -83
- package/atoms/loader/CircleLoader.js +29 -63
- package/atoms/loader/ShimmerComponent/CollabShimmerCard.js +39 -50
- package/atoms/loader/ShimmerComponent/CollabShimmerCardTray.js +41 -42
- package/atoms/loader/ShimmerComponent/FiltersShimmer.js +30 -30
- package/atoms/loader/ShimmerComponent/GraphDetailShimmer.js +21 -34
- package/atoms/loader/ShimmerComponent/GraphTitleShimmer.js +30 -34
- package/atoms/loader/ShimmerComponent/GraphsComponentShimmer.js +23 -32
- package/atoms/loader/ShimmerComponent/Shimmer.js +24 -32
- package/atoms/loader/ThreeDotLoader.js +14 -29
- package/atoms/loader/index.js +13 -11
- package/atoms/loader/loader.js +34 -58
- package/atoms/loader/loader.story.js +48 -52
- package/atoms/loader/spinningLoader.js +23 -34
- package/atoms/popup/index.js +5 -9
- package/atoms/popup/popup.js +123 -208
- package/atoms/popup/popup.story.js +97 -131
- package/atoms/radio/index.js +18 -11
- package/atoms/radio/radio.js +58 -112
- package/atoms/radio/radio.story.js +197 -420
- package/atoms/select/index.js +4 -8
- package/atoms/select/select.js +48 -86
- package/atoms/sideBar/index.js +5 -9
- package/atoms/sideBar/sidebar.js +89 -140
- package/atoms/switch/index.js +4 -8
- package/atoms/switch/switch.js +56 -86
- package/atoms/switch/switch.story.js +268 -415
- package/atoms/tag/index.js +12 -10
- package/atoms/tag/tag.js +29 -63
- package/atoms/tag/tag.story.js +135 -209
- package/atoms/textarea/index.js +5 -9
- package/atoms/textarea/textarea.js +55 -99
- package/atoms/textarea/textarea.story.js +48 -41
- package/atoms/thematicBreak/index.js +12 -10
- package/atoms/thematicBreak/thematicBreak.js +20 -38
- package/atoms/thematicBreak/thematicBreak.story.js +25 -37
- package/atoms/timeCodeInput/index.js +4 -8
- package/atoms/timeCodeInput/timCodeInput.story.js +21 -35
- package/atoms/timeCodeInput/timeCodeInput.js +33 -51
- package/atoms/timer/index.js +5 -9
- package/atoms/timer/timer.js +57 -108
- package/atoms/timer/timer.story.js +13 -26
- package/atoms/toast/index.js +5 -9
- package/atoms/toast/toast.js +81 -116
- package/atoms/toast/toast.story.js +50 -76
- package/atoms/videoCard/index.js +12 -10
- package/atoms/videoCard/videoCard.js +265 -447
- package/atoms/videoCard/videoCard.story.js +495 -710
- package/components.js +411 -294
- package/index.js +350 -61
- package/molecules/carousel/carousel.js +121 -207
- package/molecules/carousel/carousel.story.js +240 -223
- package/molecules/carousel/index.js +5 -9
- package/molecules/errorScreen/CollabErrorScreen.js +35 -66
- package/molecules/errorScreen/TableErrorScreen.js +109 -102
- package/molecules/errorScreen/TableErrorScreen.jsx +7 -6
- package/molecules/errorScreen/errorScreen.js +41 -94
- package/molecules/filter/constants.js +1 -0
- package/molecules/filter/filter.js +378 -562
- package/molecules/filter/filter.story.js +79 -104
- package/molecules/filter/index.js +5 -9
- package/molecules/graphCard/graphCard.js +97 -193
- package/molecules/graphCard/graphCard.story.js +159 -191
- package/molecules/graphCard/index.js +4 -8
- package/molecules/graphCard/loader.js +28 -68
- package/molecules/graphDetailCard/graphDetailCard.js +115 -183
- package/molecules/graphDetailCard/graphDetailCard.story.js +218 -254
- package/molecules/graphDetailCard/index.js +5 -9
- package/molecules/pageHeader/index.js +12 -10
- package/molecules/pageHeader/pageHeader.js +38 -79
- package/molecules/pageHeader/pageHeader.story.js +34 -55
- package/molecules/pagination/index.js +4 -8
- package/molecules/pagination/pagination.js +126 -202
- package/molecules/pagination/pagination.story.js +40 -52
- package/molecules/richTextInput/RichTextInput.js +354 -0
- package/molecules/richTextInput/RichTextInput.story.js +50 -0
- package/molecules/richTextInput/index.js +9 -0
- package/molecules/table/index.js +4 -8
- package/molecules/table/table-column.js +10 -16
- package/molecules/table/table-header.js +31 -72
- package/molecules/table/table.js +743 -1075
- package/molecules/table/table.story.js +274 -304
- package/molecules/tabs/index.js +4 -8
- package/molecules/tabs/tabs.js +112 -184
- package/molecules/tabs/tabs.story.js +66 -133
- package/molecules/videoCardList/index.js +4 -8
- package/molecules/videoCardList/videoCardList.js +24 -41
- package/molecules/videoCardList/videoCardList.story.js +449 -664
- package/molecules/videoPlayer/index.js +4 -8
- package/molecules/videoPlayer/videoPlayer.js +1019 -1097
- package/molecules/videoPlayer/videoPlayer.story.js +10 -21
- package/package.json +2 -2
|
@@ -1,78 +1,46 @@
|
|
|
1
|
-
|
|
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
|
|
8
|
-
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
var
|
|
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:
|
|
45
|
-
headerTitle:
|
|
22
|
+
children: _propTypes["default"].arrayOf(_propTypes["default"].element),
|
|
23
|
+
headerTitle: _propTypes["default"].string,
|
|
46
24
|
// indicators: PropTypes.bool,
|
|
47
25
|
|
|
48
|
-
onChange:
|
|
49
|
-
totalEntries:
|
|
50
|
-
theme:
|
|
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
|
|
59
|
-
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
var
|
|
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
|
-
|
|
73
|
-
|
|
74
|
-
|
|
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
|
-
|
|
87
|
-
key:
|
|
53
|
+
(0, _inherits2["default"])(Carousel, _React$Component);
|
|
54
|
+
return (0, _createClass2["default"])(Carousel, [{
|
|
55
|
+
key: "componentDidMount",
|
|
88
56
|
value: function componentDidMount() {
|
|
89
|
-
var
|
|
90
|
-
|
|
91
|
-
|
|
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:
|
|
63
|
+
key: "componentDidUpdate",
|
|
97
64
|
value: function componentDidUpdate() {
|
|
98
65
|
this.styleCarousel();
|
|
99
66
|
}
|
|
100
67
|
}, {
|
|
101
|
-
key:
|
|
68
|
+
key: "setupCarousel",
|
|
102
69
|
value: function setupCarousel(items, theme) {
|
|
103
70
|
var carouselItems = [];
|
|
104
71
|
if (items && items.length) {
|
|
105
|
-
carouselItems =
|
|
106
|
-
return child ?
|
|
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:
|
|
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:
|
|
103
|
+
key: "carouselAction",
|
|
136
104
|
value: function carouselAction(action) {
|
|
137
105
|
var onChange = this.props.onChange;
|
|
138
|
-
var
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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:
|
|
154
|
+
key: "UNSAFE_componentWillReceiveProps",
|
|
191
155
|
value: function UNSAFE_componentWillReceiveProps(newProps) {
|
|
192
156
|
var children = newProps.children,
|
|
193
|
-
|
|
194
|
-
|
|
157
|
+
theme = newProps.theme;
|
|
195
158
|
this.setupCarousel(children, theme);
|
|
196
159
|
}
|
|
197
160
|
}, {
|
|
198
|
-
key:
|
|
161
|
+
key: "render",
|
|
199
162
|
value: function render() {
|
|
200
163
|
var _this2 = this;
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
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
|
-
|
|
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;
|