@salutejs/plasma-core 1.214.0-next-insol.0 → 1.214.1-canary.2462.21631235501.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/.swc/plugins/{v7_linux_x86_64_14.0.0/cce279a62b5dde357ee7b421711ef357c3f0a29cd3cb6e86336f7345fd604d8e → linux_x86_64_24.0.0/202f6e4cef5244f7c5860be71bf49ba7448c1085420582e8bfccb5598d99b9c4.wasmer-v7} +0 -0
- package/.swc/plugins/{v7_linux_x86_64_14.0.0/358fecaab1701de64a7bceee21e5f3a204d1107aa33eb372d1dab77a43118622 → linux_x86_64_24.0.0/671036687e3bc3a68b2957b14f0890c0b5825f19e8049d9af5daf3537b9160fd.wasmer-v7} +0 -0
- package/collectPackageInfo.js +1 -1
- package/components/Badge/Badge.js +19 -10
- package/components/Button/Button.mixins.js +1 -1
- package/components/Button/createButton.js +76 -12
- package/components/Card/Card.js +75 -11
- package/components/Card/CardMedia.js +19 -10
- package/components/Card/CardPrice.js +19 -10
- package/components/Card/CardTypography.js +2 -2
- package/components/Carousel/CarouselItem.js +21 -12
- package/components/Carousel/hooks.js +2 -2
- package/components/Carousel/utils.js +14 -14
- package/components/Image/Image.js +19 -10
- package/components/Input/Input.mixins.js +1 -1
- package/components/ModalBase/ModalBase.js +19 -10
- package/components/ModalBase/ModalBaseContext.js +3 -3
- package/components/ModalBase/ModalOverlay.js +19 -10
- package/components/ModalBase/hooks.js +1 -1
- package/components/PaginationDots/usePaginationDots.js +1 -1
- package/components/Popup/Popup.js +77 -13
- package/components/PopupBase/PopupBase.js +31 -13
- package/components/PopupBase/PopupBaseContext.js +4 -4
- package/components/PopupBase/PopupBaseRoot.js +75 -11
- package/components/PopupBase/hooks.js +2 -2
- package/components/PopupBase/utils.js +1 -1
- package/components/Price/Price.js +19 -10
- package/components/RadioGroup/RadioGroup.js +75 -11
- package/components/SSRProvider/SSRProvider.js +1 -1
- package/components/Skeleton/LineSkeleton.js +19 -10
- package/components/Skeleton/RectSkeleton.js +19 -10
- package/components/Skeleton/TextSkeleton.js +19 -10
- package/components/Slider/Double.js +19 -10
- package/components/Slider/Handle.js +29 -11
- package/components/Slider/Single.js +19 -10
- package/components/Slider/Slider.js +2 -2
- package/components/Slider/SliderBase.js +2 -2
- package/components/Slider/ThumbBase.js +19 -10
- package/components/Spinner/Spinner.js +19 -10
- package/components/Spinner/SpinnerSvg.js +19 -10
- package/components/Switch/Switch.js +76 -12
- package/components/Tabs/TabItem.js +75 -11
- package/components/Tabs/Tabs.js +75 -11
- package/components/Tabs/createTabsController.js +75 -11
- package/components/TextArea/TextArea.js +1 -1
- package/components/Toast/Toast.js +1 -1
- package/components/Toast/ToastContext.js +2 -2
- package/components/Toast/ToastController.js +3 -3
- package/components/Toast/ToastProvider.js +3 -3
- package/components/Toast/useToast.js +1 -1
- package/es/collectPackageInfo.js +1 -1
- package/es/components/Badge/Badge.js +19 -10
- package/es/components/Button/Button.mixins.js +1 -1
- package/es/components/Button/createButton.js +76 -12
- package/es/components/Card/Card.js +75 -11
- package/es/components/Card/CardMedia.js +19 -10
- package/es/components/Card/CardPrice.js +19 -10
- package/es/components/Card/CardTypography.js +2 -2
- package/es/components/Carousel/CarouselItem.js +21 -12
- package/es/components/Carousel/hooks.js +4 -4
- package/es/components/Carousel/utils.js +14 -14
- package/es/components/Image/Image.js +19 -10
- package/es/components/Input/Input.mixins.js +1 -1
- package/es/components/ModalBase/ModalBase.js +19 -10
- package/es/components/ModalBase/ModalBaseContext.js +3 -3
- package/es/components/ModalBase/ModalOverlay.js +19 -10
- package/es/components/ModalBase/hooks.js +1 -1
- package/es/components/PaginationDots/usePaginationDots.js +1 -1
- package/es/components/Popup/Popup.js +77 -13
- package/es/components/PopupBase/PopupBase.js +31 -13
- package/es/components/PopupBase/PopupBaseContext.js +4 -4
- package/es/components/PopupBase/PopupBaseRoot.js +75 -11
- package/es/components/PopupBase/hooks.js +2 -2
- package/es/components/PopupBase/utils.js +1 -1
- package/es/components/Price/Price.js +19 -10
- package/es/components/RadioGroup/RadioGroup.js +75 -11
- package/es/components/SSRProvider/SSRProvider.js +1 -1
- package/es/components/Skeleton/LineSkeleton.js +19 -10
- package/es/components/Skeleton/RectSkeleton.js +19 -10
- package/es/components/Skeleton/TextSkeleton.js +19 -10
- package/es/components/Slider/Double.js +19 -10
- package/es/components/Slider/Handle.js +29 -11
- package/es/components/Slider/Single.js +19 -10
- package/es/components/Slider/Slider.js +2 -2
- package/es/components/Slider/SliderBase.js +2 -2
- package/es/components/Slider/ThumbBase.js +19 -10
- package/es/components/Spinner/Spinner.js +19 -10
- package/es/components/Spinner/SpinnerSvg.js +19 -10
- package/es/components/Switch/Switch.js +76 -12
- package/es/components/Tabs/TabItem.js +75 -11
- package/es/components/Tabs/Tabs.js +75 -11
- package/es/components/Tabs/createTabsController.js +75 -11
- package/es/components/TextArea/TextArea.js +1 -1
- package/es/components/Toast/Toast.js +1 -1
- package/es/components/Toast/ToastContext.js +2 -2
- package/es/components/Toast/ToastController.js +3 -3
- package/es/components/Toast/ToastProvider.js +3 -3
- package/es/components/Toast/useToast.js +1 -1
- package/es/hocs/withAutoFocus.js +20 -11
- package/es/hocs/withSkeleton.js +1 -1
- package/es/hooks/useFocusTrap.js +4 -4
- package/es/hooks/useForkRef.js +1 -1
- package/es/hooks/useResizeObserver.js +1 -1
- package/es/mixins/addFocus.js +2 -2
- package/es/mixins/applyDisabled.js +1 -1
- package/es/mixins/applyEllipsis.js +1 -1
- package/es/mixins/applyMaxLines.js +1 -1
- package/es/mixins/applyNoSelect.js +1 -1
- package/es/mixins/applyOutline.js +1 -1
- package/es/mixins/applyRoundness.js +1 -1
- package/es/mixins/applyScrollSnap.js +1 -1
- package/es/mixins/applySkeletonGradient.js +1 -1
- package/es/mixins/applyView.js +1 -1
- package/es/mixins/blur.js +1 -1
- package/es/utils/animatedScrollTo.js +8 -8
- package/es/utils/extractTextFrom.js +1 -1
- package/es/utils/formatCurrency.js +1 -1
- package/es/utils/formatters.js +5 -5
- package/es/utils/roundness.js +1 -1
- package/es/utils/scopeTab.js +1 -1
- package/es/utils/setRef.js +1 -1
- package/es/utils/tabbable.js +6 -6
- package/es/utils/toCssSize.js +1 -1
- package/es/utils/transformStyles.js +3 -3
- package/hocs/withAutoFocus.js +20 -11
- package/hocs/withSkeleton.js +1 -1
- package/hooks/useFocusTrap.js +4 -4
- package/hooks/useForkRef.js +1 -1
- package/hooks/useResizeObserver.js +1 -1
- package/mixins/addFocus.js +2 -2
- package/mixins/applyDisabled.js +1 -1
- package/mixins/applyEllipsis.js +1 -1
- package/mixins/applyMaxLines.js +1 -1
- package/mixins/applyNoSelect.js +1 -1
- package/mixins/applyOutline.js +1 -1
- package/mixins/applyRoundness.js +1 -1
- package/mixins/applyScrollSnap.js +1 -1
- package/mixins/applySkeletonGradient.js +1 -1
- package/mixins/applyView.js +1 -1
- package/mixins/blur.js +1 -1
- package/package.json +2 -2
- package/utils/animatedScrollTo.js +8 -8
- package/utils/extractTextFrom.js +1 -1
- package/utils/formatCurrency.js +1 -1
- package/utils/formatters.js +5 -5
- package/utils/roundness.js +1 -1
- package/utils/scopeTab.js +1 -1
- package/utils/setRef.js +1 -1
- package/utils/tabbable.js +6 -6
- package/utils/toCssSize.js +1 -1
- package/utils/transformStyles.js +3 -3
|
@@ -13,10 +13,10 @@ var ToastContext = /*#__PURE__*/ (0, _react.createContext)({
|
|
|
13
13
|
text: null,
|
|
14
14
|
position: null,
|
|
15
15
|
timeout: null,
|
|
16
|
-
showToast: function() {
|
|
16
|
+
showToast: function showToast() {
|
|
17
17
|
return undefined;
|
|
18
18
|
},
|
|
19
|
-
hideToast: function() {
|
|
19
|
+
hideToast: function hideToast() {
|
|
20
20
|
return undefined;
|
|
21
21
|
}
|
|
22
22
|
});
|
|
@@ -101,13 +101,13 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
101
101
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
102
102
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
103
103
|
}
|
|
104
|
-
var showAnimation = function(position) {
|
|
104
|
+
var showAnimation = function showAnimation(position) {
|
|
105
105
|
return (0, _styledcomponents.keyframes)([
|
|
106
106
|
"0%{transform:translate(-50%,",
|
|
107
107
|
"5rem);opacity:0;}80%{transform:translate(-50%,0);opacity:0.7;}100%{opacity:1;}"
|
|
108
108
|
], position === 'top' && '-');
|
|
109
109
|
};
|
|
110
|
-
var hideAnimation = function(position) {
|
|
110
|
+
var hideAnimation = function hideAnimation(position) {
|
|
111
111
|
return (0, _styledcomponents.keyframes)([
|
|
112
112
|
"0%{opacity:1;}20%{transform:translate(-50%,0);opacity:0.7;}100%{transform:translate(-50%,",
|
|
113
113
|
"5rem);opacity:0;}"
|
|
@@ -148,7 +148,7 @@ var StyledRoot = _styledcomponents.default.div.withConfig({
|
|
|
148
148
|
";"
|
|
149
149
|
], $position, $offset + 5, isVisible ? showAnimation($position) : hideAnimation($position));
|
|
150
150
|
}, _Toast.StyledRoot);
|
|
151
|
-
var ToastController = function(param) {
|
|
151
|
+
var ToastController = function ToastController(param) {
|
|
152
152
|
var role = param.role, text = param.text, contentLeft = param.contentLeft, position = param.position, timeout = param.timeout, fade = param.fade, offset = param.offset;
|
|
153
153
|
var hideToast = (0, _useToast.useToast)().hideToast;
|
|
154
154
|
var _useState = _sliced_to_array((0, _react.useState)(true), 2), isVisible = _useState[0], setIsVisible = _useState[1];
|
|
@@ -157,7 +157,7 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
157
157
|
var DEFAULT_POSITION = 'bottom';
|
|
158
158
|
var DEFAULT_TIMEOUT = 3000;
|
|
159
159
|
var DEFAULT_FADE = true;
|
|
160
|
-
var getShowToastCallSignature = function(args) {
|
|
160
|
+
var getShowToastCallSignature = function getShowToastCallSignature(args) {
|
|
161
161
|
if (_type_of(args[0]) === 'object' && 'text' in args[0]) {
|
|
162
162
|
return args[0];
|
|
163
163
|
}
|
|
@@ -172,14 +172,14 @@ var getShowToastCallSignature = function(args) {
|
|
|
172
172
|
role: role
|
|
173
173
|
};
|
|
174
174
|
};
|
|
175
|
-
var ToastProvider = function(param) {
|
|
175
|
+
var ToastProvider = function ToastProvider(param) {
|
|
176
176
|
var children = param.children;
|
|
177
177
|
var _useState = _sliced_to_array((0, _react.useState)({
|
|
178
178
|
text: null,
|
|
179
179
|
position: null,
|
|
180
180
|
timeout: null
|
|
181
181
|
}), 2), value = _useState[0], setValue = _useState[1];
|
|
182
|
-
var showToastCallback = function() {
|
|
182
|
+
var showToastCallback = function showToastCallback() {
|
|
183
183
|
for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
|
|
184
184
|
args[_key] = arguments[_key];
|
|
185
185
|
}
|
|
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "useToast", {
|
|
|
10
10
|
});
|
|
11
11
|
var _react = require("react");
|
|
12
12
|
var _ToastContext = require("./ToastContext");
|
|
13
|
-
var useToast = function() {
|
|
13
|
+
var useToast = function useToast() {
|
|
14
14
|
var _useContext = (0, _react.useContext)(_ToastContext.ToastContext), showToast = _useContext.showToast, hideToast = _useContext.hideToast;
|
|
15
15
|
return {
|
|
16
16
|
showToast: showToast,
|
package/es/collectPackageInfo.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/ban-ts-comment, no-underscore-dangle */ // @ts-ignore
|
|
2
2
|
import _package from '@pkg';
|
|
3
|
-
export var collectPackageInfo = function(entityName) {
|
|
3
|
+
export var collectPackageInfo = function collectPackageInfo(entityName) {
|
|
4
4
|
if (typeof window === 'undefined') {
|
|
5
5
|
return;
|
|
6
6
|
}
|
|
@@ -28,12 +28,22 @@ function _object_spread(target) {
|
|
|
28
28
|
}
|
|
29
29
|
function _object_without_properties(source, excluded) {
|
|
30
30
|
if (source == null) return {};
|
|
31
|
-
var target =
|
|
32
|
-
|
|
31
|
+
var target = {}, sourceKeys, key, i;
|
|
32
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
33
|
+
sourceKeys = Reflect.ownKeys(source);
|
|
34
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
35
|
+
key = sourceKeys[i];
|
|
36
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
37
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
38
|
+
target[key] = source[key];
|
|
39
|
+
}
|
|
40
|
+
return target;
|
|
41
|
+
}
|
|
42
|
+
target = _object_without_properties_loose(source, excluded);
|
|
33
43
|
if (Object.getOwnPropertySymbols) {
|
|
34
|
-
|
|
35
|
-
for(i = 0; i <
|
|
36
|
-
key =
|
|
44
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
45
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
46
|
+
key = sourceKeys[i];
|
|
37
47
|
if (excluded.indexOf(key) >= 0) continue;
|
|
38
48
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
39
49
|
target[key] = source[key];
|
|
@@ -43,12 +53,11 @@ function _object_without_properties(source, excluded) {
|
|
|
43
53
|
}
|
|
44
54
|
function _object_without_properties_loose(source, excluded) {
|
|
45
55
|
if (source == null) return {};
|
|
46
|
-
var target = {};
|
|
47
|
-
var sourceKeys = Object.keys(source);
|
|
48
|
-
var key, i;
|
|
56
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
49
57
|
for(i = 0; i < sourceKeys.length; i++){
|
|
50
58
|
key = sourceKeys[i];
|
|
51
59
|
if (excluded.indexOf(key) >= 0) continue;
|
|
60
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
52
61
|
target[key] = source[key];
|
|
53
62
|
}
|
|
54
63
|
return target;
|
|
@@ -123,8 +132,8 @@ var StyledBadge = styled.div.withConfig({
|
|
|
123
132
|
/**
|
|
124
133
|
* Небольшая бирка для ячеек и карточек.
|
|
125
134
|
* Компонент может отображаться в нескольких размерах и цветах, может содержать текст и/или иконку.
|
|
126
|
-
*/ export var Badge = function(
|
|
127
|
-
var
|
|
135
|
+
*/ export var Badge = function Badge(_0) {
|
|
136
|
+
var _0_size = _0.size, size = _0_size === void 0 ? 'l' : _0_size, text = _0.text, contentLeft = _0.contentLeft, rest = _object_without_properties(_0, [
|
|
128
137
|
"size",
|
|
129
138
|
"text",
|
|
130
139
|
"contentLeft"
|
|
@@ -57,7 +57,7 @@ import { convertRoundnessMatrix } from '../../utils';
|
|
|
57
57
|
* Создание специализированного миксина со своими размерами и типографикой.
|
|
58
58
|
* @param {Record<string, object>} sizes
|
|
59
59
|
* @param {Record<string, object>} typos
|
|
60
|
-
*/ export var getButtonSizesMixin = function(sizes, typos) {
|
|
60
|
+
*/ export var getButtonSizesMixin = function getButtonSizesMixin(sizes, typos) {
|
|
61
61
|
return function(param) {
|
|
62
62
|
var size = param.size, pin = param.pin, outlined = param.outlined, focused = param.focused, isContentLeft = param.$isContentLeft, isContentRight = param.$isContentRight, shiftLeft = param.shiftLeft, shiftRight = param.shiftRight, square = param.square, stretch = param.stretch, theme = param.theme;
|
|
63
63
|
var paddingX = sizes[size].paddingX;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
1
9
|
function _define_property(obj, key, value) {
|
|
2
10
|
if (key in obj) {
|
|
3
11
|
Object.defineProperty(obj, key, {
|
|
@@ -11,6 +19,36 @@ function _define_property(obj, key, value) {
|
|
|
11
19
|
}
|
|
12
20
|
return obj;
|
|
13
21
|
}
|
|
22
|
+
function _iterable_to_array(iter) {
|
|
23
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
24
|
+
}
|
|
25
|
+
function _iterable_to_array_limit(arr, i) {
|
|
26
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
27
|
+
if (_i == null) return;
|
|
28
|
+
var _arr = [];
|
|
29
|
+
var _n = true;
|
|
30
|
+
var _d = false;
|
|
31
|
+
var _s, _e;
|
|
32
|
+
try {
|
|
33
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
34
|
+
_arr.push(_s.value);
|
|
35
|
+
if (i && _arr.length === i) break;
|
|
36
|
+
}
|
|
37
|
+
} catch (err) {
|
|
38
|
+
_d = true;
|
|
39
|
+
_e = err;
|
|
40
|
+
} finally{
|
|
41
|
+
try {
|
|
42
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
43
|
+
} finally{
|
|
44
|
+
if (_d) throw _e;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return _arr;
|
|
48
|
+
}
|
|
49
|
+
function _non_iterable_rest() {
|
|
50
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
51
|
+
}
|
|
14
52
|
function _object_spread(target) {
|
|
15
53
|
for(var i = 1; i < arguments.length; i++){
|
|
16
54
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -28,12 +66,22 @@ function _object_spread(target) {
|
|
|
28
66
|
}
|
|
29
67
|
function _object_without_properties(source, excluded) {
|
|
30
68
|
if (source == null) return {};
|
|
31
|
-
var target =
|
|
32
|
-
|
|
69
|
+
var target = {}, sourceKeys, key, i;
|
|
70
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
71
|
+
sourceKeys = Reflect.ownKeys(source);
|
|
72
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
73
|
+
key = sourceKeys[i];
|
|
74
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
75
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
76
|
+
target[key] = source[key];
|
|
77
|
+
}
|
|
78
|
+
return target;
|
|
79
|
+
}
|
|
80
|
+
target = _object_without_properties_loose(source, excluded);
|
|
33
81
|
if (Object.getOwnPropertySymbols) {
|
|
34
|
-
|
|
35
|
-
for(i = 0; i <
|
|
36
|
-
key =
|
|
82
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
83
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
84
|
+
key = sourceKeys[i];
|
|
37
85
|
if (excluded.indexOf(key) >= 0) continue;
|
|
38
86
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
39
87
|
target[key] = source[key];
|
|
@@ -43,16 +91,29 @@ function _object_without_properties(source, excluded) {
|
|
|
43
91
|
}
|
|
44
92
|
function _object_without_properties_loose(source, excluded) {
|
|
45
93
|
if (source == null) return {};
|
|
46
|
-
var target = {};
|
|
47
|
-
var sourceKeys = Object.keys(source);
|
|
48
|
-
var key, i;
|
|
94
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
49
95
|
for(i = 0; i < sourceKeys.length; i++){
|
|
50
96
|
key = sourceKeys[i];
|
|
51
97
|
if (excluded.indexOf(key) >= 0) continue;
|
|
98
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
52
99
|
target[key] = source[key];
|
|
53
100
|
}
|
|
54
101
|
return target;
|
|
55
102
|
}
|
|
103
|
+
function _sliced_to_array(arr, i) {
|
|
104
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
105
|
+
}
|
|
106
|
+
function _to_array(arr) {
|
|
107
|
+
return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
|
|
108
|
+
}
|
|
109
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
110
|
+
if (!o) return;
|
|
111
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
112
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
113
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
114
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
115
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
116
|
+
}
|
|
56
117
|
import React, { forwardRef } from 'react';
|
|
57
118
|
import { ButtonContentWrapper, ButtonLoader, ButtonRoot, ButtonText, StyledSpinner } from './Button';
|
|
58
119
|
/**
|
|
@@ -62,12 +123,15 @@ import { ButtonContentWrapper, ButtonLoader, ButtonRoot, ButtonText, StyledSpinn
|
|
|
62
123
|
*/ export function createButton() {
|
|
63
124
|
var Root = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ButtonRoot;
|
|
64
125
|
// eslint-disable-next-line prefer-arrow-callback
|
|
65
|
-
return /*#__PURE__*/ forwardRef(function Button(
|
|
66
|
-
var
|
|
126
|
+
return /*#__PURE__*/ forwardRef(function Button(_0, _1) {
|
|
127
|
+
var _ref = [
|
|
128
|
+
_0,
|
|
129
|
+
_1
|
|
130
|
+
], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), children = _ref2.children, text = _ref2.text, contentLeft = _ref2.contentLeft, contentRight = _ref2.contentRight, square = _ref2.square, deviceScale = _ref2.deviceScale, _ref_loader = _ref2.loader, loader = _ref_loader === void 0 ? /*#__PURE__*/ React.createElement(StyledSpinner, {
|
|
67
131
|
color: "currentColor",
|
|
68
132
|
size: 56,
|
|
69
133
|
deviceScale: deviceScale
|
|
70
|
-
}) :
|
|
134
|
+
}) : _ref_loader, disabled = _ref2.disabled, isLoading = _ref2.isLoading, _ref_type = _ref2.type, type = _ref_type === void 0 ? 'button' : _ref_type, rest = _object_without_properties(_ref2, [
|
|
71
135
|
"children",
|
|
72
136
|
"text",
|
|
73
137
|
"contentLeft",
|
|
@@ -78,7 +142,7 @@ import { ButtonContentWrapper, ButtonLoader, ButtonRoot, ButtonText, StyledSpinn
|
|
|
78
142
|
"disabled",
|
|
79
143
|
"isLoading",
|
|
80
144
|
"type"
|
|
81
|
-
]);
|
|
145
|
+
]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
|
|
82
146
|
var isContentLeft = Boolean(contentLeft);
|
|
83
147
|
var isContentRight = Boolean(contentRight);
|
|
84
148
|
return /*#__PURE__*/ React.createElement(Root, _object_spread({
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
3
|
+
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
|
+
return arr2;
|
|
5
|
+
}
|
|
6
|
+
function _array_with_holes(arr) {
|
|
7
|
+
if (Array.isArray(arr)) return arr;
|
|
8
|
+
}
|
|
1
9
|
function _define_property(obj, key, value) {
|
|
2
10
|
if (key in obj) {
|
|
3
11
|
Object.defineProperty(obj, key, {
|
|
@@ -11,6 +19,36 @@ function _define_property(obj, key, value) {
|
|
|
11
19
|
}
|
|
12
20
|
return obj;
|
|
13
21
|
}
|
|
22
|
+
function _iterable_to_array(iter) {
|
|
23
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
|
24
|
+
}
|
|
25
|
+
function _iterable_to_array_limit(arr, i) {
|
|
26
|
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
|
27
|
+
if (_i == null) return;
|
|
28
|
+
var _arr = [];
|
|
29
|
+
var _n = true;
|
|
30
|
+
var _d = false;
|
|
31
|
+
var _s, _e;
|
|
32
|
+
try {
|
|
33
|
+
for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
|
|
34
|
+
_arr.push(_s.value);
|
|
35
|
+
if (i && _arr.length === i) break;
|
|
36
|
+
}
|
|
37
|
+
} catch (err) {
|
|
38
|
+
_d = true;
|
|
39
|
+
_e = err;
|
|
40
|
+
} finally{
|
|
41
|
+
try {
|
|
42
|
+
if (!_n && _i["return"] != null) _i["return"]();
|
|
43
|
+
} finally{
|
|
44
|
+
if (_d) throw _e;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return _arr;
|
|
48
|
+
}
|
|
49
|
+
function _non_iterable_rest() {
|
|
50
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
51
|
+
}
|
|
14
52
|
function _object_spread(target) {
|
|
15
53
|
for(var i = 1; i < arguments.length; i++){
|
|
16
54
|
var source = arguments[i] != null ? arguments[i] : {};
|
|
@@ -28,12 +66,22 @@ function _object_spread(target) {
|
|
|
28
66
|
}
|
|
29
67
|
function _object_without_properties(source, excluded) {
|
|
30
68
|
if (source == null) return {};
|
|
31
|
-
var target =
|
|
32
|
-
|
|
69
|
+
var target = {}, sourceKeys, key, i;
|
|
70
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
71
|
+
sourceKeys = Reflect.ownKeys(source);
|
|
72
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
73
|
+
key = sourceKeys[i];
|
|
74
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
75
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
76
|
+
target[key] = source[key];
|
|
77
|
+
}
|
|
78
|
+
return target;
|
|
79
|
+
}
|
|
80
|
+
target = _object_without_properties_loose(source, excluded);
|
|
33
81
|
if (Object.getOwnPropertySymbols) {
|
|
34
|
-
|
|
35
|
-
for(i = 0; i <
|
|
36
|
-
key =
|
|
82
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
83
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
84
|
+
key = sourceKeys[i];
|
|
37
85
|
if (excluded.indexOf(key) >= 0) continue;
|
|
38
86
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
39
87
|
target[key] = source[key];
|
|
@@ -43,16 +91,29 @@ function _object_without_properties(source, excluded) {
|
|
|
43
91
|
}
|
|
44
92
|
function _object_without_properties_loose(source, excluded) {
|
|
45
93
|
if (source == null) return {};
|
|
46
|
-
var target = {};
|
|
47
|
-
var sourceKeys = Object.keys(source);
|
|
48
|
-
var key, i;
|
|
94
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
49
95
|
for(i = 0; i < sourceKeys.length; i++){
|
|
50
96
|
key = sourceKeys[i];
|
|
51
97
|
if (excluded.indexOf(key) >= 0) continue;
|
|
98
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
52
99
|
target[key] = source[key];
|
|
53
100
|
}
|
|
54
101
|
return target;
|
|
55
102
|
}
|
|
103
|
+
function _sliced_to_array(arr, i) {
|
|
104
|
+
return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
|
|
105
|
+
}
|
|
106
|
+
function _to_array(arr) {
|
|
107
|
+
return _array_with_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_rest();
|
|
108
|
+
}
|
|
109
|
+
function _unsupported_iterable_to_array(o, minLen) {
|
|
110
|
+
if (!o) return;
|
|
111
|
+
if (typeof o === "string") return _array_like_to_array(o, minLen);
|
|
112
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
113
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
114
|
+
if (n === "Map" || n === "Set") return Array.from(n);
|
|
115
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
116
|
+
}
|
|
56
117
|
import React from 'react';
|
|
57
118
|
import styled, { css } from 'styled-components';
|
|
58
119
|
import { surfaceCard } from '../../tokens';
|
|
@@ -99,11 +160,14 @@ export var StyledCard = styled(Body1).withConfig({
|
|
|
99
160
|
/**
|
|
100
161
|
* Контейнер со скругленными углами с возможностью фокусировки на нем.
|
|
101
162
|
*/ // eslint-disable-next-line prefer-arrow-callback
|
|
102
|
-
export var Card = /*#__PURE__*/ React.forwardRef(function Card(
|
|
103
|
-
var
|
|
163
|
+
export var Card = /*#__PURE__*/ React.forwardRef(function Card(_0, _1) {
|
|
164
|
+
var _ref = [
|
|
165
|
+
_0,
|
|
166
|
+
_1
|
|
167
|
+
], _ref1 = _to_array(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), _ref_roundness = _ref2.roundness, roundness = _ref_roundness === void 0 ? DEFAULT_ROUNDNESS : _ref_roundness, children = _ref2.children, rest = _object_without_properties(_ref2, [
|
|
104
168
|
"roundness",
|
|
105
169
|
"children"
|
|
106
|
-
]);
|
|
170
|
+
]), _rest1 = _sliced_to_array(_rest, 1), ref = _rest1[0];
|
|
107
171
|
return /*#__PURE__*/ React.createElement(StyledCard, _object_spread({
|
|
108
172
|
ref: ref,
|
|
109
173
|
roundness: roundness
|
|
@@ -28,12 +28,22 @@ function _object_spread(target) {
|
|
|
28
28
|
}
|
|
29
29
|
function _object_without_properties(source, excluded) {
|
|
30
30
|
if (source == null) return {};
|
|
31
|
-
var target =
|
|
32
|
-
|
|
31
|
+
var target = {}, sourceKeys, key, i;
|
|
32
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
33
|
+
sourceKeys = Reflect.ownKeys(source);
|
|
34
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
35
|
+
key = sourceKeys[i];
|
|
36
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
37
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
38
|
+
target[key] = source[key];
|
|
39
|
+
}
|
|
40
|
+
return target;
|
|
41
|
+
}
|
|
42
|
+
target = _object_without_properties_loose(source, excluded);
|
|
33
43
|
if (Object.getOwnPropertySymbols) {
|
|
34
|
-
|
|
35
|
-
for(i = 0; i <
|
|
36
|
-
key =
|
|
44
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
45
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
46
|
+
key = sourceKeys[i];
|
|
37
47
|
if (excluded.indexOf(key) >= 0) continue;
|
|
38
48
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
39
49
|
target[key] = source[key];
|
|
@@ -43,12 +53,11 @@ function _object_without_properties(source, excluded) {
|
|
|
43
53
|
}
|
|
44
54
|
function _object_without_properties_loose(source, excluded) {
|
|
45
55
|
if (source == null) return {};
|
|
46
|
-
var target = {};
|
|
47
|
-
var sourceKeys = Object.keys(source);
|
|
48
|
-
var key, i;
|
|
56
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
49
57
|
for(i = 0; i < sourceKeys.length; i++){
|
|
50
58
|
key = sourceKeys[i];
|
|
51
59
|
if (excluded.indexOf(key) >= 0) continue;
|
|
60
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
52
61
|
target[key] = source[key];
|
|
53
62
|
}
|
|
54
63
|
return target;
|
|
@@ -76,8 +85,8 @@ var StyledRoot = styled.div.withConfig({
|
|
|
76
85
|
]);
|
|
77
86
|
/**
|
|
78
87
|
* Компонент для отображения картинок.
|
|
79
|
-
*/ export var CardMedia = function(
|
|
80
|
-
var disabled =
|
|
88
|
+
*/ export var CardMedia = function CardMedia(_0) {
|
|
89
|
+
var disabled = _0.disabled, placeholder = _0.placeholder, style = _0.style, children = _0.children, className = _0.className, props = _object_without_properties(_0, [
|
|
81
90
|
"disabled",
|
|
82
91
|
"placeholder",
|
|
83
92
|
"style",
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
function _object_without_properties(source, excluded) {
|
|
2
2
|
if (source == null) return {};
|
|
3
|
-
var target =
|
|
4
|
-
|
|
3
|
+
var target = {}, sourceKeys, key, i;
|
|
4
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
5
|
+
sourceKeys = Reflect.ownKeys(source);
|
|
6
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
7
|
+
key = sourceKeys[i];
|
|
8
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
9
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
10
|
+
target[key] = source[key];
|
|
11
|
+
}
|
|
12
|
+
return target;
|
|
13
|
+
}
|
|
14
|
+
target = _object_without_properties_loose(source, excluded);
|
|
5
15
|
if (Object.getOwnPropertySymbols) {
|
|
6
|
-
|
|
7
|
-
for(i = 0; i <
|
|
8
|
-
key =
|
|
16
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
17
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
18
|
+
key = sourceKeys[i];
|
|
9
19
|
if (excluded.indexOf(key) >= 0) continue;
|
|
10
20
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
11
21
|
target[key] = source[key];
|
|
@@ -15,12 +25,11 @@ function _object_without_properties(source, excluded) {
|
|
|
15
25
|
}
|
|
16
26
|
function _object_without_properties_loose(source, excluded) {
|
|
17
27
|
if (source == null) return {};
|
|
18
|
-
var target = {};
|
|
19
|
-
var sourceKeys = Object.keys(source);
|
|
20
|
-
var key, i;
|
|
28
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
21
29
|
for(i = 0; i < sourceKeys.length; i++){
|
|
22
30
|
key = sourceKeys[i];
|
|
23
31
|
if (excluded.indexOf(key) >= 0) continue;
|
|
32
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
24
33
|
target[key] = source[key];
|
|
25
34
|
}
|
|
26
35
|
return target;
|
|
@@ -57,8 +66,8 @@ var StyledCount = styled(Body2).withConfig({
|
|
|
57
66
|
"box-sizing:border-box;height:2.5rem;margin-left:0.5rem;color:",
|
|
58
67
|
";"
|
|
59
68
|
], buttonAccent);
|
|
60
|
-
export var CardPrice = function(
|
|
61
|
-
var count =
|
|
69
|
+
export var CardPrice = function CardPrice(_0) {
|
|
70
|
+
var count = _0.count, currency = _0.currency, oldPrice = _0.oldPrice, price = _0.price, rest = _object_without_properties(_0, [
|
|
62
71
|
"count",
|
|
63
72
|
"currency",
|
|
64
73
|
"oldPrice",
|
|
@@ -7,14 +7,14 @@ var views = {
|
|
|
7
7
|
secondary: secondary,
|
|
8
8
|
tertiary: tertiary
|
|
9
9
|
};
|
|
10
|
-
var linesMixin = function(param) {
|
|
10
|
+
var linesMixin = function linesMixin(param) {
|
|
11
11
|
var _param_lines = param.lines, lines = _param_lines === void 0 ? 2 : _param_lines;
|
|
12
12
|
return css([
|
|
13
13
|
"display:-webkit-box;overflow:hidden;box-sizing:border-box;white-space:normal;-webkit-box-orient:vertical;-webkit-line-clamp:",
|
|
14
14
|
";"
|
|
15
15
|
], lines);
|
|
16
16
|
};
|
|
17
|
-
var viewMixin = function(param) {
|
|
17
|
+
var viewMixin = function viewMixin(param) {
|
|
18
18
|
var _param_view = param.view, view = _param_view === void 0 ? 'primary' : _param_view;
|
|
19
19
|
return css([
|
|
20
20
|
"transition:",
|
|
@@ -28,12 +28,22 @@ function _object_spread(target) {
|
|
|
28
28
|
}
|
|
29
29
|
function _object_without_properties(source, excluded) {
|
|
30
30
|
if (source == null) return {};
|
|
31
|
-
var target =
|
|
32
|
-
|
|
31
|
+
var target = {}, sourceKeys, key, i;
|
|
32
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
33
|
+
sourceKeys = Reflect.ownKeys(source);
|
|
34
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
35
|
+
key = sourceKeys[i];
|
|
36
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
37
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
38
|
+
target[key] = source[key];
|
|
39
|
+
}
|
|
40
|
+
return target;
|
|
41
|
+
}
|
|
42
|
+
target = _object_without_properties_loose(source, excluded);
|
|
33
43
|
if (Object.getOwnPropertySymbols) {
|
|
34
|
-
|
|
35
|
-
for(i = 0; i <
|
|
36
|
-
key =
|
|
44
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
45
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
46
|
+
key = sourceKeys[i];
|
|
37
47
|
if (excluded.indexOf(key) >= 0) continue;
|
|
38
48
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
39
49
|
target[key] = source[key];
|
|
@@ -43,12 +53,11 @@ function _object_without_properties(source, excluded) {
|
|
|
43
53
|
}
|
|
44
54
|
function _object_without_properties_loose(source, excluded) {
|
|
45
55
|
if (source == null) return {};
|
|
46
|
-
var target = {};
|
|
47
|
-
var sourceKeys = Object.keys(source);
|
|
48
|
-
var key, i;
|
|
56
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
49
57
|
for(i = 0; i < sourceKeys.length; i++){
|
|
50
58
|
key = sourceKeys[i];
|
|
51
59
|
if (excluded.indexOf(key) >= 0) continue;
|
|
60
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
52
61
|
target[key] = source[key];
|
|
53
62
|
}
|
|
54
63
|
return target;
|
|
@@ -69,8 +78,8 @@ var StyledItemVirtual = styled.div.withConfig({
|
|
|
69
78
|
})([
|
|
70
79
|
"position:absolute;"
|
|
71
80
|
]);
|
|
72
|
-
export var CarouselItem = function(
|
|
73
|
-
var
|
|
81
|
+
export var CarouselItem = function CarouselItem(_0) {
|
|
82
|
+
var _0_scrollSnapAlign = _0.scrollSnapAlign, scrollSnapAlign = _0_scrollSnapAlign === void 0 ? 'center' : _0_scrollSnapAlign, _0_scrollSnapStop = _0.scrollSnapStop, scrollSnapStop = _0_scrollSnapStop === void 0 ? 'always' : _0_scrollSnapStop, children = _0.children, rest = _object_without_properties(_0, [
|
|
74
83
|
"scrollSnapAlign",
|
|
75
84
|
"scrollSnapStop",
|
|
76
85
|
"children"
|
|
@@ -88,8 +97,8 @@ export var CarouselItem = function(_param) {
|
|
|
88
97
|
* ```
|
|
89
98
|
* import { useVirtual } from '@salutejs/use-virtual';
|
|
90
99
|
* ```
|
|
91
|
-
*/ export var CarouselItemVirtual = function(
|
|
92
|
-
var left =
|
|
100
|
+
*/ export var CarouselItemVirtual = function CarouselItemVirtual(_0) {
|
|
101
|
+
var left = _0.left, top = _0.top, children = _0.children, style = _0.style, rest = _object_without_properties(_0, [
|
|
93
102
|
"left",
|
|
94
103
|
"top",
|
|
95
104
|
"children",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
function _array_like_to_array(arr, len) {
|
|
2
2
|
if (len == null || len > arr.length) len = arr.length;
|
|
3
3
|
for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
|
|
4
4
|
return arr2;
|
|
@@ -44,13 +44,13 @@ function _unsupported_iterable_to_array(o, minLen) {
|
|
|
44
44
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
45
45
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
|
|
46
46
|
}
|
|
47
|
-
import throttle from 'lodash.throttle';
|
|
47
|
+
/* eslint-disable no-continue */ import throttle from 'lodash.throttle';
|
|
48
48
|
import { useRef, useEffect, useCallback, useMemo, useLayoutEffect, useState } from 'react';
|
|
49
49
|
import { useDebouncedFunction } from '../../hooks';
|
|
50
50
|
import { scrollToPos, getCalculatedPos, getCalculatedOffset, getItemSlot, getCarouselItems, translateToIndex } from './utils';
|
|
51
51
|
var THROTTLE_DEFAULT_MS = 100;
|
|
52
52
|
var DEBOUNCE_DEFAULT_MS = 150;
|
|
53
|
-
export var useCarousel = function(param) {
|
|
53
|
+
export var useCarousel = function useCarousel(param) {
|
|
54
54
|
var index = param.index, axis = param.axis, _param_detectActive = param.detectActive, detectActive = _param_detectActive === void 0 ? false : _param_detectActive, _param_detectThreshold = param.detectThreshold, detectThreshold = _param_detectThreshold === void 0 ? 0.5 : _param_detectThreshold, _param_scrollAlign = param.scrollAlign, scrollAlign = _param_scrollAlign === void 0 ? 'center' : _param_scrollAlign, scaleCallback = param.scaleCallback, scaleResetCallback = param.scaleResetCallback, onIndexChange = param.onIndexChange, onDetectActiveItem = param.onDetectActiveItem, _param_animatedScrollByIndex = param.animatedScrollByIndex, animatedScrollByIndex = _param_animatedScrollByIndex === void 0 ? false : _param_animatedScrollByIndex, _param_throttleMs = param.throttleMs, throttleMs = _param_throttleMs === void 0 ? THROTTLE_DEFAULT_MS : _param_throttleMs, _param_debounceMs = param.debounceMs, debounceMs = _param_debounceMs === void 0 ? DEBOUNCE_DEFAULT_MS : _param_debounceMs;
|
|
55
55
|
var prevIndex = useRef(null);
|
|
56
56
|
var direction = useRef(null);
|
|
@@ -96,6 +96,7 @@ export var useCarousel = function(param) {
|
|
|
96
96
|
* Проходим по всему списку, суммируя ширины элементов,
|
|
97
97
|
* пока не найдем один элемент, чей центр будет в центре карусели.
|
|
98
98
|
*/ for(var itemIndex = 0; itemIndex < items.length; itemIndex++){
|
|
99
|
+
var _prevIndex_current;
|
|
99
100
|
var item = items.item(itemIndex);
|
|
100
101
|
if (item === null) {
|
|
101
102
|
continue;
|
|
@@ -124,7 +125,6 @@ export var useCarousel = function(param) {
|
|
|
124
125
|
}
|
|
125
126
|
continue;
|
|
126
127
|
}
|
|
127
|
-
var _prevIndex_current;
|
|
128
128
|
var itemSlot = getItemSlot(itemIndex, itemEdge, itemSize, scrollPos, scrollSize, scrollAlign, (_prevIndex_current = prevIndex.current) !== null && _prevIndex_current !== void 0 ? _prevIndex_current : 0, offset.current);
|
|
129
129
|
if (itemSlot !== null) {
|
|
130
130
|
if (detectThreshold && Math.abs(itemSlot) <= detectThreshold) {
|