@semcore/carousel 3.50.0-prerelease.0 → 3.50.0-prerelease.1
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/lib/cjs/Carousel.js +178 -165
- package/lib/cjs/Carousel.js.map +1 -1
- package/lib/cjs/Carousel.types.js.map +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/carousel.shadow.css +46 -44
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +5 -4
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/translations/de.json +1 -3
- package/lib/cjs/translations/en.json +1 -3
- package/lib/cjs/translations/es.json +1 -3
- package/lib/cjs/translations/fr.json +1 -3
- package/lib/cjs/translations/it.json +1 -3
- package/lib/cjs/translations/ja.json +1 -3
- package/lib/cjs/translations/ko.json +1 -3
- package/lib/cjs/translations/nl.json +1 -3
- package/lib/cjs/translations/pl.json +1 -3
- package/lib/cjs/translations/pt.json +1 -3
- package/lib/cjs/translations/sv.json +1 -3
- package/lib/cjs/translations/tr.json +1 -3
- package/lib/cjs/translations/vi.json +1 -3
- package/lib/cjs/translations/zh.json +1 -3
- package/lib/es6/Carousel.js +162 -152
- package/lib/es6/Carousel.js.map +1 -1
- package/lib/es6/Carousel.types.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/carousel.shadow.css +46 -44
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/translations/de.json +1 -3
- package/lib/es6/translations/en.json +1 -3
- package/lib/es6/translations/es.json +1 -3
- package/lib/es6/translations/fr.json +1 -3
- package/lib/es6/translations/it.json +1 -3
- package/lib/es6/translations/ja.json +1 -3
- package/lib/es6/translations/ko.json +1 -3
- package/lib/es6/translations/nl.json +1 -3
- package/lib/es6/translations/pl.json +1 -3
- package/lib/es6/translations/pt.json +1 -3
- package/lib/es6/translations/sv.json +1 -3
- package/lib/es6/translations/tr.json +1 -3
- package/lib/es6/translations/vi.json +1 -3
- package/lib/es6/translations/zh.json +1 -3
- package/lib/esm/Carousel.mjs +160 -148
- package/lib/esm/index.mjs +0 -1
- package/lib/esm/style/carousel.shadow.css +46 -44
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/translations/de.json.mjs +1 -3
- package/lib/esm/translations/en.json.mjs +1 -3
- package/lib/esm/translations/es.json.mjs +1 -3
- package/lib/esm/translations/fr.json.mjs +1 -3
- package/lib/esm/translations/it.json.mjs +1 -3
- package/lib/esm/translations/ja.json.mjs +1 -3
- package/lib/esm/translations/ko.json.mjs +1 -3
- package/lib/esm/translations/nl.json.mjs +1 -3
- package/lib/esm/translations/pl.json.mjs +1 -3
- package/lib/esm/translations/pt.json.mjs +1 -3
- package/lib/esm/translations/sv.json.mjs +1 -3
- package/lib/esm/translations/tr.json.mjs +1 -3
- package/lib/esm/translations/vi.json.mjs +1 -3
- package/lib/esm/translations/zh.json.mjs +1 -3
- package/lib/types/Carousel.d.ts +1 -1
- package/lib/types/Carousel.types.d.ts +12 -4
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +0 -28
- package/package.json +8 -8
- package/src/style/carousel.shadow.css +11 -11
- package/lib/esm/Carousel.types.mjs +0 -1
package/lib/cjs/Carousel.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
5
|
Object.defineProperty(exports, "__esModule", {
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
@@ -10,45 +11,49 @@ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/obje
|
|
|
10
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
12
13
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
var
|
|
14
|
+
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
14
15
|
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
16
|
+
var _createSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/createSuper"));
|
|
15
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
+
var _index2 = require("@semcore/utils/lib/core/index");
|
|
19
|
+
var _core = _interopRequireWildcard(require("@semcore/core"));
|
|
20
|
+
var _react = _interopRequireDefault(require("react"));
|
|
18
21
|
var _button = _interopRequireDefault(require("@semcore/button"));
|
|
19
|
-
var _i18nEnhance = _interopRequireDefault(require("@semcore/core/lib/utils/enhances/i18nEnhance"));
|
|
20
|
-
var _findComponent = require("@semcore/core/lib/utils/findComponent");
|
|
21
|
-
var _logger = _interopRequireDefault(require("@semcore/core/lib/utils/logger"));
|
|
22
|
-
var _uniqueID = _interopRequireDefault(require("@semcore/core/lib/utils/uniqueID"));
|
|
23
|
-
var _l = _interopRequireDefault(require("@semcore/icon/ChevronLeft/l"));
|
|
24
|
-
var _l2 = _interopRequireDefault(require("@semcore/icon/ChevronRight/l"));
|
|
25
22
|
var _modal = _interopRequireDefault(require("@semcore/modal"));
|
|
26
|
-
var
|
|
23
|
+
var _flexBox = require("@semcore/flex-box");
|
|
24
|
+
var _l = _interopRequireDefault(require("@semcore/icon/ChevronRight/l"));
|
|
25
|
+
var _l2 = _interopRequireDefault(require("@semcore/icon/ChevronLeft/l"));
|
|
26
|
+
var _uniqueID = _interopRequireDefault(require("@semcore/utils/lib/uniqueID"));
|
|
27
|
+
var _i18nEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/i18nEnhance"));
|
|
27
28
|
var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
|
|
29
|
+
var _logger = _interopRequireDefault(require("@semcore/utils/lib/logger"));
|
|
30
|
+
var _findComponent = require("@semcore/utils/lib/findComponent");
|
|
31
|
+
var _breakpoints = require("@semcore/breakpoints");
|
|
32
|
+
var _keyboardFocusEnhance = _interopRequireDefault(require("@semcore/utils/lib/enhances/keyboardFocusEnhance"));
|
|
28
33
|
/*!__reshadow-styles__:"./style/carousel.shadow.css"*/
|
|
29
|
-
var style = (/*__reshadow_css_start__*/
|
|
34
|
+
var style = ( /*__reshadow_css_start__*/_index2.sstyled.insert( /*__inner_css_start__*/".___SCarousel_8zwws_gg_{overflow:hidden;outline:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SContainer_8zwws_gg_{display:flex;transition:transform var(--duration_8zwws) ease-in-out}.___SContentBox_8zwws_gg_,.___SModalBox_8zwws_gg_{position:relative;overflow:hidden;border-radius:var(--intergalactic-surface-rounded, calc(6px + 2px))}.___SContentBox_8zwws_gg_:has(.___SItem_8zwws_gg_.__keyboardFocused_8zwws_gg_):after,.___SModalBox_8zwws_gg_:has(.___SItem_8zwws_gg_.__keyboardFocused_8zwws_gg_):after{content:\"\";display:block;position:absolute;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 18, 193, 0.441));z-index:1;width:calc(100% - 3px*2);height:calc(100% - 3px*2);top:3px;left:3px}.___SModalContainer_8zwws_gg_{display:flex;transition:transform var(--duration_8zwws) ease-in-out}.___SItem_8zwws_gg_{flex:0 0 100%;max-width:100%;box-sizing:border-box;transform:var(--transform_8zwws);border-radius:var(--intergalactic-surface-rounded, calc(6px + 2px));overflow:hidden;outline:0}.___SItem_8zwws_gg_.__zoomIn_8zwws_gg_{cursor:zoom-in}.___SItem_8zwws_gg_.__zoomOut_8zwws_gg_{cursor:zoom-out}.___SIndicators_8zwws_gg_{display:flex;justify-content:center;margin-top:var(--intergalactic-spacing-4x, 16px);outline:0;position:relative}.___SIndicators_8zwws_gg_.__keyboardFocused_8zwws_gg_:after{content:\"\";display:block;position:absolute;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 18, 193, 0.441));z-index:1;width:calc(100% - 3px*2);height:calc(100% - 3px);top:0;left:3px}.___SIndicator_8zwws_gg_{margin:0 calc(.5*var(--intergalactic-spacing-3x, 12px));cursor:pointer;display:block;width:12px;height:12px;border-radius:var(--intergalactic-control-rounded, 6px);background-color:var(--intergalactic-icon-secondary-neutral, rgba(0, 5, 2, 0.385));opacity:var(--intergalactic-disabled-opacity, 0.4);-o-object-fit:cover;object-fit:cover;transition:ease-in-out opacity .1s}@supports (color:color(display-p3 0 0 0)){.___SIndicator_8zwws_gg_{background-color:var(--intergalactic-icon-secondary-neutral, rgba(0, 5, 2, 0.385))}@media (color-gamut:p3){.___SIndicator_8zwws_gg_{background-color:var(--intergalactic-icon-secondary-neutral, color(display-p3 0.0036 0.02041 0.00996 / 0.385))}}}@media (hover:hover){.___SIndicator_8zwws_gg_:hover{opacity:calc(2*var(--intergalactic-disabled-opacity, 0.4))}}.___SIndicator_8zwws_gg_.__active_8zwws_gg_{opacity:1}.___SIndicator_8zwws_gg_.__inverted_8zwws_gg_{background-color:var(--intergalactic-icon-primary-invert, rgba(253, 255, 254, 0.808))}@supports (color:color(display-p3 0 0 0)){.___SIndicator_8zwws_gg_.__inverted_8zwws_gg_{background-color:var(--intergalactic-icon-primary-invert, rgba(253, 255, 254, 0.808))}@media (color-gamut:p3){.___SIndicator_8zwws_gg_.__inverted_8zwws_gg_{background-color:var(--intergalactic-icon-primary-invert, color(display-p3 0.99189 0.99995 0.99683 / 0.808))}}}.___SNext_8zwws_gg_,.___SPrev_8zwws_gg_{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--intergalactic-icon-primary-neutral, rgba(0, 4, 1, 0.526))}.___SNext_8zwws_gg_ .___SNextButton_8zwws_gg_ span:has(>svg:only-child),.___SNext_8zwws_gg_ .___SPrevButton_8zwws_gg_ span:has(>svg:only-child),.___SPrev_8zwws_gg_ .___SNextButton_8zwws_gg_ span:has(>svg:only-child),.___SPrev_8zwws_gg_ .___SPrevButton_8zwws_gg_ span:has(>svg:only-child){margin-left:calc(2*var(--intergalactic-spacing-1x, 4px) - 1px);margin-right:calc(2*var(--intergalactic-spacing-1x, 4px) - 1px)}.___SNextButton_8zwws_gg_:focus-visible,.___SPrevButton_8zwws_gg_:focus-visible{box-shadow:none}.___SNextButton_8zwws_gg_:focus-visible:after,.___SPrevButton_8zwws_gg_:focus-visible:after{content:\"\";display:block;position:absolute;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 18, 193, 0.441));z-index:1;width:calc(100% - 3px*2);height:calc(100% - 3px*2);top:3px;left:3px;border-radius:var(--intergalactic-control-rounded, 6px)}.___SPrev_8zwws_gg_{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SNext_8zwws_gg_{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SNext_8zwws_gg_.__disabled_8zwws_gg_,.___SPrev_8zwws_gg_.__disabled_8zwws_gg_{opacity:var(--intergalactic-disabled-opacity, 0.4);cursor:default;pointer-events:none}@media (prefers-reduced-motion){.___SContainer_8zwws_gg_{transition:none}}", /*__inner_css_end__*/"8zwws_gg_"),
|
|
30
35
|
/*__reshadow_css_end__*/
|
|
31
36
|
{
|
|
32
|
-
"__SCarousel": "
|
|
33
|
-
"__SContainer": "
|
|
34
|
-
"--duration": "--
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"_active": "
|
|
44
|
-
"_inverted": "
|
|
45
|
-
"__SPrev": "
|
|
46
|
-
"__SNext": "
|
|
47
|
-
"_disabled": "
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"__SPrevButton": "
|
|
51
|
-
"__SNextButton": "
|
|
37
|
+
"__SCarousel": "___SCarousel_8zwws_gg_",
|
|
38
|
+
"__SContainer": "___SContainer_8zwws_gg_",
|
|
39
|
+
"--duration": "--duration_8zwws",
|
|
40
|
+
"__SModalContainer": "___SModalContainer_8zwws_gg_",
|
|
41
|
+
"__SItem": "___SItem_8zwws_gg_",
|
|
42
|
+
"--transform": "--transform_8zwws",
|
|
43
|
+
"_zoomIn": "__zoomIn_8zwws_gg_",
|
|
44
|
+
"_zoomOut": "__zoomOut_8zwws_gg_",
|
|
45
|
+
"__SIndicators": "___SIndicators_8zwws_gg_",
|
|
46
|
+
"_keyboardFocused": "__keyboardFocused_8zwws_gg_",
|
|
47
|
+
"__SIndicator": "___SIndicator_8zwws_gg_",
|
|
48
|
+
"_active": "__active_8zwws_gg_",
|
|
49
|
+
"_inverted": "__inverted_8zwws_gg_",
|
|
50
|
+
"__SPrev": "___SPrev_8zwws_gg_",
|
|
51
|
+
"__SNext": "___SNext_8zwws_gg_",
|
|
52
|
+
"_disabled": "__disabled_8zwws_gg_",
|
|
53
|
+
"__SContentBox": "___SContentBox_8zwws_gg_",
|
|
54
|
+
"__SModalBox": "___SModalBox_8zwws_gg_",
|
|
55
|
+
"__SPrevButton": "___SPrevButton_8zwws_gg_",
|
|
56
|
+
"__SNextButton": "___SNextButton_8zwws_gg_"
|
|
52
57
|
});
|
|
53
58
|
var MAP_TRANSFORM = {
|
|
54
59
|
ArrowLeft: 'left',
|
|
@@ -56,22 +61,24 @@ var MAP_TRANSFORM = {
|
|
|
56
61
|
};
|
|
57
62
|
var enhance = [(0, _uniqueID["default"])(), (0, _i18nEnhance["default"])(_intergalacticDynamicLocales.localizedMessages)];
|
|
58
63
|
var media = ['(min-width: 481px)', '(max-width: 480px)'];
|
|
59
|
-
var BreakPoints = (0,
|
|
64
|
+
var BreakPoints = (0, _breakpoints.createBreakpoints)(media);
|
|
60
65
|
var isSmallScreen = function isSmallScreen(index) {
|
|
61
66
|
return index === 1;
|
|
62
67
|
};
|
|
63
68
|
var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
69
|
+
(0, _inherits2["default"])(CarouselRoot, _Component);
|
|
70
|
+
var _super = (0, _createSuper2["default"])(CarouselRoot);
|
|
64
71
|
function CarouselRoot(props) {
|
|
65
|
-
var
|
|
72
|
+
var _ref20, _props$index;
|
|
66
73
|
var _this;
|
|
67
74
|
(0, _classCallCheck2["default"])(this, CarouselRoot);
|
|
68
|
-
_this = (
|
|
69
|
-
(0, _defineProperty2["default"])(_this, "defaultItemsCount", 0);
|
|
70
|
-
(0, _defineProperty2["default"])(_this, "refCarousel", /*#__PURE__*/_react["default"].createRef());
|
|
71
|
-
(0, _defineProperty2["default"])(_this, "refContainer", /*#__PURE__*/_react["default"].createRef());
|
|
72
|
-
(0, _defineProperty2["default"])(_this, "refModalContainer", /*#__PURE__*/_react["default"].createRef());
|
|
73
|
-
(0, _defineProperty2["default"])(_this, "_touchStartCoord", -1);
|
|
74
|
-
(0, _defineProperty2["default"])(_this, "handlerKeyDown", function (e) {
|
|
75
|
+
_this = _super.call(this, props);
|
|
76
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "defaultItemsCount", 0);
|
|
77
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "refCarousel", /*#__PURE__*/_react["default"].createRef());
|
|
78
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "refContainer", /*#__PURE__*/_react["default"].createRef());
|
|
79
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "refModalContainer", /*#__PURE__*/_react["default"].createRef());
|
|
80
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "_touchStartCoord", -1);
|
|
81
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handlerKeyDown", function (e) {
|
|
75
82
|
var firstSlide = 1;
|
|
76
83
|
var lastSlide = _this.state.items.length + 1;
|
|
77
84
|
switch (e.key) {
|
|
@@ -109,7 +116,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
109
116
|
_this.handleToggleZoomModal();
|
|
110
117
|
}
|
|
111
118
|
});
|
|
112
|
-
(0, _defineProperty2["default"])(_this, "toggleItem", function (item) {
|
|
119
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "toggleItem", function (item) {
|
|
113
120
|
var removeItem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
114
121
|
_this.setState(function (prevState) {
|
|
115
122
|
var newItems = removeItem ? prevState.items.filter(function (element) {
|
|
@@ -123,7 +130,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
123
130
|
_this.defaultItemsCount++;
|
|
124
131
|
}
|
|
125
132
|
});
|
|
126
|
-
(0, _defineProperty2["default"])(_this, "transformContainer", function () {
|
|
133
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "transformContainer", function () {
|
|
127
134
|
var transform = _this.state.selectedIndex * -1 * 100;
|
|
128
135
|
if (_this.refContainer.current) {
|
|
129
136
|
_this.refContainer.current.style.transform = "translateX(".concat(transform, "%)");
|
|
@@ -132,7 +139,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
132
139
|
_this.refModalContainer.current.style.transform = "translateX(".concat(transform, "%)");
|
|
133
140
|
}
|
|
134
141
|
});
|
|
135
|
-
(0, _defineProperty2["default"])(_this, "getDirection", function (currentIndex, nextIndex) {
|
|
142
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "getDirection", function (currentIndex, nextIndex) {
|
|
136
143
|
var bounded = _this.asProps.bounded;
|
|
137
144
|
if (bounded) {
|
|
138
145
|
return currentIndex < nextIndex ? 'right' : 'left';
|
|
@@ -159,7 +166,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
159
166
|
var left = tmpArr.indexOf(nextIndex);
|
|
160
167
|
return left - tmpCurrentIndex < 0 ? 'left' : 'right';
|
|
161
168
|
});
|
|
162
|
-
(0, _defineProperty2["default"])(_this, "slideToValue", function (nextIndex) {
|
|
169
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "slideToValue", function (nextIndex) {
|
|
163
170
|
var selectedIndex = _this.state.selectedIndex;
|
|
164
171
|
var direction = selectedIndex < nextIndex ? 'right' : 'left';
|
|
165
172
|
var diff = Math.abs(selectedIndex - nextIndex);
|
|
@@ -168,7 +175,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
168
175
|
diff--;
|
|
169
176
|
}
|
|
170
177
|
});
|
|
171
|
-
(0, _defineProperty2["default"])(_this, "transformItem", function (direction) {
|
|
178
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "transformItem", function (direction) {
|
|
172
179
|
var bounded = _this.asProps.bounded;
|
|
173
180
|
var _this$state = _this.state,
|
|
174
181
|
items = _this$state.items,
|
|
@@ -213,12 +220,12 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
213
220
|
return;
|
|
214
221
|
}
|
|
215
222
|
});
|
|
216
|
-
(0, _defineProperty2["default"])(_this, "bindHandlerClick", function (direction) {
|
|
223
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "bindHandlerClick", function (direction) {
|
|
217
224
|
return function () {
|
|
218
225
|
_this.transformItem(direction);
|
|
219
226
|
};
|
|
220
227
|
});
|
|
221
|
-
(0, _defineProperty2["default"])(_this, "bindHandlerClickIndicator", function (value) {
|
|
228
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "bindHandlerClickIndicator", function (value) {
|
|
222
229
|
return function () {
|
|
223
230
|
var _this$state2 = _this.state,
|
|
224
231
|
selectedIndex = _this$state2.selectedIndex,
|
|
@@ -230,10 +237,10 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
230
237
|
_this.handlers.index(value);
|
|
231
238
|
};
|
|
232
239
|
});
|
|
233
|
-
(0, _defineProperty2["default"])(_this, "handlerTouchStart", function (e) {
|
|
240
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handlerTouchStart", function (e) {
|
|
234
241
|
_this._touchStartCoord = e.changedTouches[0].clientX;
|
|
235
242
|
});
|
|
236
|
-
(0, _defineProperty2["default"])(_this, "handlerTouchEnd", function (e) {
|
|
243
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handlerTouchEnd", function (e) {
|
|
237
244
|
var touchEndCoord = e.changedTouches[0].clientX;
|
|
238
245
|
var delta = touchEndCoord - _this._touchStartCoord;
|
|
239
246
|
if (delta > 50) {
|
|
@@ -242,18 +249,16 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
242
249
|
_this.transformItem('right');
|
|
243
250
|
}
|
|
244
251
|
});
|
|
245
|
-
(0, _defineProperty2["default"])(_this, "handleToggleZoomModal", function () {
|
|
252
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "handleToggleZoomModal", function () {
|
|
246
253
|
_this.setState(function (prevState) {
|
|
247
254
|
return {
|
|
248
255
|
isOpenZoom: !prevState.isOpenZoom
|
|
249
256
|
};
|
|
250
257
|
}, function () {
|
|
251
|
-
|
|
252
|
-
_this.transformContainer();
|
|
253
|
-
}
|
|
258
|
+
_this.state.isOpenZoom && _this.transformContainer();
|
|
254
259
|
});
|
|
255
260
|
});
|
|
256
|
-
(0, _defineProperty2["default"])(_this, "bindHandlerKeydownControl", function (direction) {
|
|
261
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this), "bindHandlerKeydownControl", function (direction) {
|
|
257
262
|
return function (e) {
|
|
258
263
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
259
264
|
e.preventDefault();
|
|
@@ -265,22 +270,21 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
265
270
|
_this.state = {
|
|
266
271
|
items: [],
|
|
267
272
|
isOpenZoom: false,
|
|
268
|
-
selectedIndex: (
|
|
273
|
+
selectedIndex: (_ref20 = (_props$index = props.index) !== null && _props$index !== void 0 ? _props$index : props.defaultIndex) !== null && _ref20 !== void 0 ? _ref20 : 0
|
|
269
274
|
};
|
|
270
275
|
return _this;
|
|
271
276
|
}
|
|
272
|
-
(0,
|
|
273
|
-
return (0, _createClass2["default"])(CarouselRoot, [{
|
|
277
|
+
(0, _createClass2["default"])(CarouselRoot, [{
|
|
274
278
|
key: "uncontrolledProps",
|
|
275
279
|
value: function uncontrolledProps() {
|
|
276
280
|
var _this2 = this;
|
|
277
281
|
return {
|
|
278
282
|
index: [null, function (_index) {
|
|
279
283
|
var _this2$refCarousel$cu;
|
|
280
|
-
(_this2$refCarousel$cu = _this2.refCarousel.current) === null || _this2$refCarousel$cu === void 0
|
|
284
|
+
(_this2$refCarousel$cu = _this2.refCarousel.current) === null || _this2$refCarousel$cu === void 0 ? void 0 : _this2$refCarousel$cu.blur();
|
|
281
285
|
setTimeout(function () {
|
|
282
286
|
var _this2$refCarousel$cu2;
|
|
283
|
-
(_this2$refCarousel$cu2 = _this2.refCarousel.current) === null || _this2$refCarousel$cu2 === void 0
|
|
287
|
+
(_this2$refCarousel$cu2 = _this2.refCarousel.current) === null || _this2$refCarousel$cu2 === void 0 ? void 0 : _this2$refCarousel$cu2.focus();
|
|
284
288
|
}, 0);
|
|
285
289
|
}]
|
|
286
290
|
};
|
|
@@ -326,7 +330,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
326
330
|
}
|
|
327
331
|
}, {
|
|
328
332
|
key: "getItemProps",
|
|
329
|
-
value: function getItemProps(
|
|
333
|
+
value: function getItemProps(props, index) {
|
|
330
334
|
var zoom = this.asProps.zoom;
|
|
331
335
|
var isCurrent = this.isSelected(index);
|
|
332
336
|
return {
|
|
@@ -355,10 +359,10 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
355
359
|
disabled = selectedIndex === 0;
|
|
356
360
|
}
|
|
357
361
|
return {
|
|
358
|
-
|
|
359
|
-
|
|
362
|
+
onClick: this.bindHandlerClick('left'),
|
|
363
|
+
onKeyDown: this.bindHandlerKeydownControl('left'),
|
|
360
364
|
disabled: disabled,
|
|
361
|
-
|
|
365
|
+
label: getI18nText('prev'),
|
|
362
366
|
'aria-controls': "igc-".concat(uid, "-carousel")
|
|
363
367
|
};
|
|
364
368
|
}
|
|
@@ -377,10 +381,10 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
377
381
|
disabled = selectedIndex === items.length - 1;
|
|
378
382
|
}
|
|
379
383
|
return {
|
|
380
|
-
|
|
381
|
-
|
|
384
|
+
onClick: this.bindHandlerClick('right'),
|
|
385
|
+
onKeyDown: this.bindHandlerKeydownControl('right'),
|
|
382
386
|
disabled: disabled,
|
|
383
|
-
|
|
387
|
+
label: getI18nText('next'),
|
|
384
388
|
'aria-controls': "igc-".concat(uid, "-carousel")
|
|
385
389
|
};
|
|
386
390
|
}
|
|
@@ -391,15 +395,14 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
391
395
|
var items = this.state.items;
|
|
392
396
|
var getI18nText = this.asProps.getI18nText;
|
|
393
397
|
return {
|
|
394
|
-
|
|
398
|
+
items: items.map(function (item, key) {
|
|
395
399
|
return {
|
|
396
400
|
active: _this4.isSelected(key),
|
|
397
401
|
onClick: _this4.bindHandlerClickIndicator(key),
|
|
398
402
|
key: key
|
|
399
403
|
};
|
|
400
404
|
}),
|
|
401
|
-
|
|
402
|
-
'tabIndex': 0,
|
|
405
|
+
role: 'tablist',
|
|
403
406
|
'aria-label': getI18nText('slides')
|
|
404
407
|
};
|
|
405
408
|
}
|
|
@@ -409,7 +412,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
409
412
|
var isCurrent = this.isSelected(index);
|
|
410
413
|
var getI18nText = this.asProps.getI18nText;
|
|
411
414
|
return {
|
|
412
|
-
|
|
415
|
+
role: 'tab',
|
|
413
416
|
'aria-selected': isCurrent,
|
|
414
417
|
'aria-controls': "igc-".concat(this.asProps.uid, "-carousel-item-").concat(index),
|
|
415
418
|
'aria-label': getI18nText('slide', {
|
|
@@ -455,27 +458,26 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
455
458
|
key: "renderModal",
|
|
456
459
|
value: function renderModal(isSmall, ComponentItems) {
|
|
457
460
|
var _ref = this.asProps,
|
|
458
|
-
|
|
461
|
+
_ref10,
|
|
459
462
|
_this5 = this;
|
|
460
|
-
var SModalContainer =
|
|
461
|
-
var SModalBox =
|
|
462
|
-
var SImageBoxContainer = _baseComponents.Box;
|
|
463
|
+
var SModalContainer = _flexBox.Box;
|
|
464
|
+
var SModalBox = _flexBox.Box;
|
|
463
465
|
var _this$asProps3 = this.asProps,
|
|
464
466
|
styles = _this$asProps3.styles,
|
|
465
467
|
uid = _this$asProps3.uid,
|
|
466
468
|
duration = _this$asProps3.duration,
|
|
467
469
|
zoomWidth = _this$asProps3.zoomWidth;
|
|
468
470
|
var isOpenZoom = this.state.isOpenZoom;
|
|
469
|
-
return
|
|
471
|
+
return _ref10 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_modal["default"], _ref10.cn("Modal", {
|
|
470
472
|
"visible": isOpenZoom,
|
|
471
473
|
"onClose": this.handleToggleZoomModal,
|
|
472
474
|
"ghost": true,
|
|
473
475
|
"closable": !isSmall
|
|
474
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
|
476
|
+
}), /*#__PURE__*/_react["default"].createElement(_flexBox.Flex, _ref10.cn("Flex", {
|
|
475
477
|
"direction": isSmall ? 'column' : 'row'
|
|
476
478
|
}), !isSmall && /*#__PURE__*/_react["default"].createElement(Carousel.Prev, {
|
|
477
479
|
inverted: true
|
|
478
|
-
}), /*#__PURE__*/_react["default"].createElement(
|
|
480
|
+
}), /*#__PURE__*/_react["default"].createElement(SModalBox, _ref10.cn("SModalBox", {}), /*#__PURE__*/_react["default"].createElement(SModalContainer, _ref10.cn("SModalContainer", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
479
481
|
"aria-live": 'polite',
|
|
480
482
|
"use:duration": "".concat(duration, "ms"),
|
|
481
483
|
"ref": this.refModalContainer,
|
|
@@ -492,7 +494,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
492
494
|
zoomOut: true,
|
|
493
495
|
transform: _this5.isSelected(i) ? _this5.getTransform() : undefined
|
|
494
496
|
}));
|
|
495
|
-
})))
|
|
497
|
+
}))), isSmall ? /*#__PURE__*/_react["default"].createElement(_flexBox.Flex, _ref10.cn("Flex", {
|
|
496
498
|
"justifyContent": 'center',
|
|
497
499
|
"mt": 2
|
|
498
500
|
}), /*#__PURE__*/_react["default"].createElement(Carousel.Prev, {
|
|
@@ -509,44 +511,47 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
509
511
|
key: "render",
|
|
510
512
|
value: function render() {
|
|
511
513
|
var _ref2 = this.asProps,
|
|
512
|
-
|
|
514
|
+
_ref11,
|
|
513
515
|
_this6 = this;
|
|
514
|
-
var SCarousel =
|
|
516
|
+
var SCarousel = _flexBox.Box;
|
|
515
517
|
var _this$asProps4 = this.asProps,
|
|
516
518
|
styles = _this$asProps4.styles,
|
|
517
519
|
Children = _this$asProps4.Children,
|
|
518
520
|
uid = _this$asProps4.uid,
|
|
519
521
|
hasZoom = _this$asProps4.zoom,
|
|
520
522
|
ariaLabel = _this$asProps4['aria-label'],
|
|
521
|
-
|
|
522
|
-
|
|
523
|
+
ariaRoledescription = _this$asProps4['aria-roledescription'],
|
|
524
|
+
indicators = _this$asProps4.indicators;
|
|
523
525
|
var ComponentItems = (0, _findComponent.findAllComponents)(Children, ['Carousel.Item']);
|
|
524
526
|
var Controls = (0, _findComponent.findAllComponents)(Children, ['Carousel.Prev', 'Carousel.Next', 'Carousel.Indicators']);
|
|
525
|
-
return
|
|
527
|
+
return _ref11 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SCarousel, _ref11.cn("SCarousel", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
526
528
|
"role": 'region',
|
|
527
|
-
"
|
|
529
|
+
"roledescription": 'carousel',
|
|
528
530
|
"onKeyDown": this.handlerKeyDown,
|
|
529
531
|
"onTouchStart": this.handlerTouchStart,
|
|
530
532
|
"onTouchEnd": this.handlerTouchEnd,
|
|
531
533
|
"ref": this.refCarousel,
|
|
532
|
-
"id": "igc-".concat(uid, "-carousel")
|
|
533
|
-
|
|
534
|
+
"id": "igc-".concat(uid, "-carousel"),
|
|
535
|
+
"aria-roledescription": ariaRoledescription
|
|
536
|
+
}, _ref2))), Controls.length === 0 ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_flexBox.Flex, _ref11.cn("Flex", {}), /*#__PURE__*/_react["default"].createElement(Carousel.Prev, null), /*#__PURE__*/_react["default"].createElement(Carousel.ContentBox, null, /*#__PURE__*/_react["default"].createElement(Carousel.Container, {
|
|
534
537
|
"aria-label": ariaLabel
|
|
535
|
-
}, /*#__PURE__*/_react["default"].createElement(Children,
|
|
538
|
+
}, /*#__PURE__*/_react["default"].createElement(Children, _ref11.cn("Children", {})))), /*#__PURE__*/_react["default"].createElement(Carousel.Next, null)), indicators === 'default' && /*#__PURE__*/_react["default"].createElement(Carousel.Indicators, null), indicators === 'preview' && /*#__PURE__*/_react["default"].createElement(Carousel.Indicators, null, function () {
|
|
536
539
|
return ComponentItems.map(function (item, index) {
|
|
537
540
|
return /*#__PURE__*/_react["default"].createElement(Carousel.Indicator, (0, _extends2["default"])({}, item.props, {
|
|
538
541
|
key: item.key,
|
|
539
|
-
w:
|
|
540
|
-
|
|
542
|
+
w: 100,
|
|
543
|
+
h: 100,
|
|
544
|
+
"aria-roledescription": "slide",
|
|
541
545
|
active: _this6.isSelected(index),
|
|
542
546
|
onClick: _this6.bindHandlerClickIndicator(index)
|
|
543
547
|
}));
|
|
544
548
|
});
|
|
545
|
-
})) : /*#__PURE__*/_react["default"].createElement(Children,
|
|
549
|
+
})) : /*#__PURE__*/_react["default"].createElement(Children, _ref11.cn("Children", {})), hasZoom && /*#__PURE__*/_react["default"].createElement(BreakPoints, _ref11.cn("BreakPoints", {}), /*#__PURE__*/_react["default"].createElement(BreakPoints.Context.Consumer, null, function (mediaIndex) {
|
|
546
550
|
return _this6.renderModal(isSmallScreen(mediaIndex), ComponentItems);
|
|
547
551
|
})));
|
|
548
552
|
}
|
|
549
553
|
}]);
|
|
554
|
+
return CarouselRoot;
|
|
550
555
|
}(_core.Component);
|
|
551
556
|
(0, _defineProperty2["default"])(CarouselRoot, "displayName", 'Carousel');
|
|
552
557
|
(0, _defineProperty2["default"])(CarouselRoot, "defaultProps", {
|
|
@@ -560,48 +565,48 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
560
565
|
});
|
|
561
566
|
(0, _defineProperty2["default"])(CarouselRoot, "style", style);
|
|
562
567
|
(0, _defineProperty2["default"])(CarouselRoot, "enhance", enhance);
|
|
563
|
-
function Container(props) {
|
|
568
|
+
var Container = function Container(props) {
|
|
564
569
|
var _ref3 = arguments[0],
|
|
565
|
-
|
|
566
|
-
var SContainer =
|
|
570
|
+
_ref12;
|
|
571
|
+
var SContainer = _flexBox.Box;
|
|
567
572
|
var styles = props.styles,
|
|
568
573
|
duration = props.duration;
|
|
569
|
-
return
|
|
574
|
+
return _ref12 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SContainer, _ref12.cn("SContainer", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
570
575
|
"use:duration": "".concat(duration, "ms"),
|
|
571
576
|
"aria-live": 'polite'
|
|
572
577
|
}, _ref3))));
|
|
573
|
-
}
|
|
574
|
-
function ContentBox(props) {
|
|
578
|
+
};
|
|
579
|
+
var ContentBox = function ContentBox(props) {
|
|
575
580
|
var _ref4 = arguments[0],
|
|
576
|
-
|
|
577
|
-
var SContentBox =
|
|
581
|
+
_ref13;
|
|
582
|
+
var SContentBox = _flexBox.Box;
|
|
578
583
|
var styles = props.styles;
|
|
579
|
-
return
|
|
580
|
-
}
|
|
584
|
+
return _ref13 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SContentBox, _ref13.cn("SContentBox", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({}, _ref4))));
|
|
585
|
+
};
|
|
581
586
|
var Item = /*#__PURE__*/function (_Component2) {
|
|
587
|
+
(0, _inherits2["default"])(Item, _Component2);
|
|
588
|
+
var _super2 = (0, _createSuper2["default"])(Item);
|
|
582
589
|
function Item() {
|
|
583
590
|
var _this7;
|
|
584
591
|
(0, _classCallCheck2["default"])(this, Item);
|
|
585
592
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
586
593
|
args[_key] = arguments[_key];
|
|
587
594
|
}
|
|
588
|
-
_this7 = (
|
|
589
|
-
(0, _defineProperty2["default"])(_this7, "refItem", /*#__PURE__*/_react["default"].createRef());
|
|
595
|
+
_this7 = _super2.call.apply(_super2, [this].concat(args));
|
|
596
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this7), "refItem", /*#__PURE__*/_react["default"].createRef());
|
|
597
|
+
(0, _defineProperty2["default"])((0, _assertThisInitialized2["default"])(_this7), "keepFocusTimeout", void 0);
|
|
590
598
|
return _this7;
|
|
591
599
|
}
|
|
592
|
-
(0,
|
|
593
|
-
return (0, _createClass2["default"])(Item, [{
|
|
600
|
+
(0, _createClass2["default"])(Item, [{
|
|
594
601
|
key: "componentDidMount",
|
|
595
602
|
value: function componentDidMount() {
|
|
596
603
|
var _this$props = this.props,
|
|
597
604
|
toggleItem = _this$props.toggleItem,
|
|
598
605
|
transform = _this$props.transform;
|
|
599
606
|
var refItem = this.refItem.current;
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
});
|
|
604
|
-
}
|
|
607
|
+
toggleItem && refItem && toggleItem({
|
|
608
|
+
node: refItem
|
|
609
|
+
});
|
|
605
610
|
if (transform && refItem) {
|
|
606
611
|
refItem.style.transform = "translateX(".concat(transform, "%)");
|
|
607
612
|
}
|
|
@@ -611,26 +616,41 @@ var Item = /*#__PURE__*/function (_Component2) {
|
|
|
611
616
|
value: function componentWillUnmount() {
|
|
612
617
|
var toggleItem = this.props.toggleItem;
|
|
613
618
|
var refItem = this.refItem.current;
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
}
|
|
619
|
+
toggleItem && refItem && toggleItem({
|
|
620
|
+
node: refItem
|
|
621
|
+
}, true);
|
|
622
|
+
clearTimeout(this.keepFocusTimeout);
|
|
619
623
|
}
|
|
620
624
|
}, {
|
|
621
625
|
key: "componentDidUpdate",
|
|
622
626
|
value: function componentDidUpdate(prevProps) {
|
|
627
|
+
var _this8 = this;
|
|
628
|
+
clearTimeout(this.keepFocusTimeout);
|
|
623
629
|
var transform = this.props.transform;
|
|
624
630
|
var refItem = this.refItem.current;
|
|
625
631
|
if (prevProps.transform !== transform && refItem) {
|
|
626
632
|
refItem.style.transform = "translateX(".concat(transform, "%)");
|
|
627
633
|
}
|
|
634
|
+
if (this.props.current) {
|
|
635
|
+
this.keepFocusTimeout = setTimeout(function () {
|
|
636
|
+
var _document$activeEleme;
|
|
637
|
+
if (document.activeElement !== refItem && ((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.dataset.carousel) === (refItem === null || refItem === void 0 ? void 0 : refItem.dataset.carousel)) {
|
|
638
|
+
refItem === null || refItem === void 0 ? void 0 : refItem.focus();
|
|
639
|
+
}
|
|
640
|
+
}, 100);
|
|
641
|
+
}
|
|
642
|
+
if (prevProps.isOpenZoom === true && this.props.isOpenZoom === false && this.props.current && !this.props.zoomOut) {
|
|
643
|
+
this.keepFocusTimeout = setTimeout(function () {
|
|
644
|
+
var _this8$refItem$curren;
|
|
645
|
+
(_this8$refItem$curren = _this8.refItem.current) === null || _this8$refItem$curren === void 0 ? void 0 : _this8$refItem$curren.focus();
|
|
646
|
+
}, 200);
|
|
647
|
+
}
|
|
628
648
|
}
|
|
629
649
|
}, {
|
|
630
650
|
key: "render",
|
|
631
651
|
value: function render() {
|
|
632
652
|
var _ref5 = this.asProps,
|
|
633
|
-
|
|
653
|
+
_ref14;
|
|
634
654
|
var _this$props2 = this.props,
|
|
635
655
|
styles = _this$props2.styles,
|
|
636
656
|
index = _this$props2.index,
|
|
@@ -638,8 +658,8 @@ var Item = /*#__PURE__*/function (_Component2) {
|
|
|
638
658
|
current = _this$props2.current,
|
|
639
659
|
zoomIn = _this$props2.zoomIn,
|
|
640
660
|
onToggleZoomModal = _this$props2.onToggleZoomModal;
|
|
641
|
-
var SItem =
|
|
642
|
-
return
|
|
661
|
+
var SItem = _flexBox.Box;
|
|
662
|
+
return _ref14 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SItem, _ref14.cn("SItem", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
643
663
|
"ref": this.refItem,
|
|
644
664
|
"role": 'tabpanel',
|
|
645
665
|
"data-carousel": "igc-".concat(uid, "-carousel"),
|
|
@@ -651,10 +671,12 @@ var Item = /*#__PURE__*/function (_Component2) {
|
|
|
651
671
|
}, _ref5))));
|
|
652
672
|
}
|
|
653
673
|
}]);
|
|
674
|
+
return Item;
|
|
654
675
|
}(_core.Component);
|
|
655
|
-
|
|
676
|
+
(0, _defineProperty2["default"])(Item, "enhance", [(0, _keyboardFocusEnhance["default"])(false)]);
|
|
677
|
+
var Prev = function Prev(props) {
|
|
656
678
|
var _ref6 = arguments[0],
|
|
657
|
-
|
|
679
|
+
_ref15;
|
|
658
680
|
var styles = props.styles,
|
|
659
681
|
children = props.children,
|
|
660
682
|
Children = props.Children,
|
|
@@ -662,23 +684,21 @@ function Prev(props) {
|
|
|
662
684
|
_props$top = props.top,
|
|
663
685
|
top = _props$top === void 0 ? 0 : _props$top,
|
|
664
686
|
inverted = props.inverted;
|
|
665
|
-
var SPrev =
|
|
687
|
+
var SPrev = _flexBox.Box;
|
|
666
688
|
var SPrevButton = _button["default"];
|
|
667
|
-
return
|
|
689
|
+
return _ref15 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SPrev, _ref15.cn("SPrev", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
668
690
|
"top": top
|
|
669
|
-
}, _ref6))), children ? /*#__PURE__*/_react["default"].createElement(Children,
|
|
670
|
-
"addonLeft":
|
|
691
|
+
}, _ref6))), children ? /*#__PURE__*/_react["default"].createElement(Children, _ref15.cn("Children", {})) : /*#__PURE__*/_react["default"].createElement(SPrevButton, _ref15.cn("SPrevButton", {
|
|
692
|
+
"addonLeft": _l2["default"],
|
|
671
693
|
"aria-label": label,
|
|
672
694
|
"theme": inverted ? 'invert' : 'muted',
|
|
673
695
|
"use": 'tertiary',
|
|
674
|
-
"size": 'l'
|
|
675
|
-
"innerOutline": true
|
|
696
|
+
"size": 'l'
|
|
676
697
|
})));
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
function Next(props) {
|
|
698
|
+
};
|
|
699
|
+
var Next = function Next(props) {
|
|
680
700
|
var _ref7 = arguments[0],
|
|
681
|
-
|
|
701
|
+
_ref16;
|
|
682
702
|
var styles = props.styles,
|
|
683
703
|
children = props.children,
|
|
684
704
|
Children = props.Children,
|
|
@@ -686,56 +706,48 @@ function Next(props) {
|
|
|
686
706
|
_props$top2 = props.top,
|
|
687
707
|
top = _props$top2 === void 0 ? 0 : _props$top2,
|
|
688
708
|
inverted = props.inverted;
|
|
689
|
-
var SNext =
|
|
709
|
+
var SNext = _flexBox.Box;
|
|
690
710
|
var SNextButton = _button["default"];
|
|
691
|
-
return
|
|
711
|
+
return _ref16 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SNext, _ref16.cn("SNext", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
|
692
712
|
"top": top
|
|
693
|
-
}, _ref7))), children ? /*#__PURE__*/_react["default"].createElement(Children,
|
|
694
|
-
"addonLeft":
|
|
713
|
+
}, _ref7))), children ? /*#__PURE__*/_react["default"].createElement(Children, _ref16.cn("Children", {})) : /*#__PURE__*/_react["default"].createElement(SNextButton, _ref16.cn("SNextButton", {
|
|
714
|
+
"addonLeft": _l["default"],
|
|
695
715
|
"aria-label": label,
|
|
696
716
|
"theme": inverted ? 'invert' : 'muted',
|
|
697
717
|
"use": 'tertiary',
|
|
698
|
-
"size": 'l'
|
|
699
|
-
"innerOutline": true
|
|
718
|
+
"size": 'l'
|
|
700
719
|
})));
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
function Indicators(_ref19) {
|
|
720
|
+
};
|
|
721
|
+
var Indicators = function Indicators(_ref21) {
|
|
704
722
|
var _ref8 = arguments[0],
|
|
705
|
-
|
|
706
|
-
var items =
|
|
707
|
-
styles =
|
|
708
|
-
Children =
|
|
709
|
-
inverted =
|
|
710
|
-
var SIndicators =
|
|
723
|
+
_ref18;
|
|
724
|
+
var items = _ref21.items,
|
|
725
|
+
styles = _ref21.styles,
|
|
726
|
+
Children = _ref21.Children,
|
|
727
|
+
inverted = _ref21.inverted;
|
|
728
|
+
var SIndicators = _flexBox.Box;
|
|
711
729
|
if (Children.origin) {
|
|
712
|
-
var
|
|
713
|
-
return
|
|
714
|
-
"innerOffset": true
|
|
715
|
-
}, _ref8))), /*#__PURE__*/_react["default"].createElement(Children, _ref15.cn("Children", {})));
|
|
730
|
+
var _ref17;
|
|
731
|
+
return _ref17 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SIndicators, _ref17.cn("SIndicators", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({}, _ref8))), /*#__PURE__*/_react["default"].createElement(Children, _ref17.cn("Children", {})));
|
|
716
732
|
}
|
|
717
|
-
return
|
|
718
|
-
"invertOutline": inverted
|
|
719
|
-
}, _ref8))), items === null || items === void 0 ? void 0 : items.map(function (item, index) {
|
|
733
|
+
return _ref18 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SIndicators, _ref18.cn("SIndicators", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({}, _ref8))), items === null || items === void 0 ? void 0 : items.map(function (item, index) {
|
|
720
734
|
return /*#__PURE__*/_react["default"].createElement(Carousel.Indicator, (0, _extends2["default"])({
|
|
721
735
|
key: index
|
|
722
736
|
}, item, {
|
|
723
737
|
inverted: inverted
|
|
724
738
|
}));
|
|
725
739
|
}));
|
|
726
|
-
}
|
|
727
|
-
;
|
|
728
|
-
function Indicator(
|
|
740
|
+
};
|
|
741
|
+
Indicators.enhance = [(0, _keyboardFocusEnhance["default"])()];
|
|
742
|
+
var Indicator = function Indicator(_ref22) {
|
|
729
743
|
var _ref9 = arguments[0],
|
|
730
|
-
|
|
731
|
-
var styles =
|
|
732
|
-
Children =
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
;
|
|
738
|
-
var Carousel = (0, _core.createComponent)(CarouselRoot, {
|
|
744
|
+
_ref19;
|
|
745
|
+
var styles = _ref22.styles,
|
|
746
|
+
Children = _ref22.Children;
|
|
747
|
+
var SIndicator = _flexBox.Box;
|
|
748
|
+
return _ref19 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SIndicator, _ref19.cn("SIndicator", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({}, _ref9))), /*#__PURE__*/_react["default"].createElement(Children, _ref19.cn("Children", {})));
|
|
749
|
+
};
|
|
750
|
+
var Carousel = (0, _core["default"])(CarouselRoot, {
|
|
739
751
|
Container: Container,
|
|
740
752
|
ContentBox: ContentBox,
|
|
741
753
|
Indicators: Indicators,
|
|
@@ -744,5 +756,6 @@ var Carousel = (0, _core.createComponent)(CarouselRoot, {
|
|
|
744
756
|
Prev: Prev,
|
|
745
757
|
Next: Next
|
|
746
758
|
});
|
|
747
|
-
var _default =
|
|
759
|
+
var _default = Carousel;
|
|
760
|
+
exports["default"] = _default;
|
|
748
761
|
//# sourceMappingURL=Carousel.js.map
|