@prom-ui/core 0.0.22 → 0.0.30
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/Body/cjs/index.development.js +14 -0
- package/Body/cjs/index.production.js +1 -0
- package/Body/cjs/style.development.css +1 -0
- package/Body/cjs/style.production.css +1 -0
- package/Body/index.js +5 -12
- package/Body/package.json +1 -1
- package/Box/cjs/index.development.js +20 -0
- package/Box/cjs/index.production.js +1 -0
- package/Box/cjs/style.development.css +1 -0
- package/Box/cjs/style.production.css +1 -0
- package/Box/index.js +5 -18
- package/Box/package.json +1 -1
- package/Button/cjs/index.development.js +95 -0
- package/Button/cjs/index.production.js +1 -0
- package/Button/cjs/style.development.css +1 -0
- package/Button/cjs/style.production.css +1 -0
- package/Button/index.d.ts +5 -4
- package/Button/index.js +4 -81
- package/Button/package.json +1 -1
- package/ButtonPageUp/cjs/index.development.js +170 -0
- package/ButtonPageUp/cjs/index.production.js +1 -0
- package/ButtonPageUp/index.d.ts +12 -5
- package/ButtonPageUp/index.js +4 -169
- package/ButtonPageUp/package.json +1 -2
- package/Checkbox/cjs/index.development.js +111 -0
- package/Checkbox/cjs/index.production.js +1 -0
- package/Checkbox/cjs/style.development.css +1 -0
- package/Checkbox/cjs/style.production.css +1 -0
- package/Checkbox/index.d.ts +4 -4
- package/Checkbox/index.js +4 -96
- package/Checkbox/package.json +1 -1
- package/Flex/cjs/index.development.js +25 -0
- package/Flex/cjs/index.production.js +1 -0
- package/Flex/cjs/style.development.css +1 -0
- package/Flex/cjs/style.production.css +1 -0
- package/Flex/index.js +5 -23
- package/Flex/package.json +1 -1
- package/Grid/cjs/index.development.js +25 -0
- package/Grid/cjs/index.production.js +1 -0
- package/Grid/cjs/style.development.css +1 -0
- package/Grid/cjs/style.production.css +1 -0
- package/Grid/index.js +5 -23
- package/Grid/package.json +1 -1
- package/Icon/cjs/index.development.js +41 -0
- package/Icon/cjs/index.production.js +1 -0
- package/Icon/cjs/style.development.css +1 -0
- package/Icon/cjs/style.production.css +1 -0
- package/Icon/index.d.ts +7 -12
- package/Icon/index.js +4 -76
- package/Icon/package.json +1 -1
- package/Image/cjs/index.development.js +20 -0
- package/Image/cjs/index.production.js +1 -0
- package/Image/cjs/style.development.css +1 -0
- package/Image/cjs/style.production.css +1 -0
- package/Image/index.js +5 -18
- package/Image/package.json +1 -1
- package/ImageEmoji/cjs/index.development.js +90 -0
- package/ImageEmoji/cjs/index.production.js +1 -0
- package/ImageEmoji/index.d.ts +6 -4
- package/ImageEmoji/index.js +4 -86
- package/ImageEmoji/package.json +1 -1
- package/Input/cjs/index.development.js +39 -0
- package/Input/cjs/index.production.js +1 -0
- package/Input/cjs/style.development.css +1 -0
- package/Input/cjs/style.production.css +1 -0
- package/Input/index.d.ts +23 -23
- package/Input/index.js +4 -81
- package/Input/package.json +1 -1
- package/KeyPress/cjs/index.development.js +56 -0
- package/KeyPress/cjs/index.production.js +1 -0
- package/KeyPress/index.d.ts +8 -7
- package/KeyPress/index.js +5 -53
- package/KeyPress/package.json +2 -5
- package/Line/cjs/index.development.js +20 -0
- package/Line/cjs/index.production.js +1 -0
- package/Line/cjs/style.development.css +1 -0
- package/Line/cjs/style.production.css +1 -0
- package/Line/index.js +5 -18
- package/Line/package.json +1 -1
- package/Link/cjs/index.development.js +22 -0
- package/Link/cjs/index.production.js +1 -0
- package/Link/cjs/style.development.css +1 -0
- package/Link/cjs/style.production.css +1 -0
- package/Link/index.js +5 -20
- package/Link/package.json +1 -1
- package/List/cjs/index.development.js +25 -0
- package/List/cjs/index.production.js +1 -0
- package/List/cjs/style.development.css +1 -0
- package/List/cjs/style.production.css +1 -0
- package/List/index.js +5 -23
- package/List/package.json +1 -1
- package/Media/breakpoints.d.ts +17 -0
- package/Media/cjs/index.development.js +60 -0
- package/Media/cjs/index.production.js +1 -0
- package/Media/index.d.ts +11 -0
- package/Media/index.js +7 -0
- package/{Tooltip → Media}/package.json +3 -3
- package/Media/useMedia.d.ts +7 -0
- package/{Tooltip/Trigger/index.js → OutsideClick/cjs/index.development.js} +32 -24
- package/OutsideClick/cjs/index.production.js +1 -0
- package/OutsideClick/index.d.ts +6 -3
- package/OutsideClick/index.js +4 -74
- package/OutsideClick/package.json +2 -5
- package/Picture/cjs/index.development.js +25 -0
- package/Picture/cjs/index.production.js +1 -0
- package/Picture/cjs/style.development.css +1 -0
- package/Picture/cjs/style.production.css +1 -0
- package/Picture/index.js +5 -23
- package/Picture/package.json +1 -1
- package/PortableOverlay/cjs/index.development.js +111 -0
- package/PortableOverlay/cjs/index.production.js +1 -0
- package/PortableOverlay/cjs/style.development.css +1 -0
- package/PortableOverlay/cjs/style.production.css +1 -0
- package/PortableOverlay/index.d.ts +6 -4
- package/PortableOverlay/index.js +5 -112
- package/PortableOverlay/package.json +1 -2
- package/Portal/cjs/index.development.js +57 -0
- package/Portal/cjs/index.production.js +1 -0
- package/Portal/index.d.ts +6 -4
- package/Portal/index.js +5 -52
- package/Portal/package.json +2 -5
- package/Rating/cjs/index.development.js +105 -0
- package/Rating/cjs/index.production.js +1 -0
- package/Rating/cjs/style.development.css +1 -0
- package/Rating/cjs/style.production.css +1 -0
- package/Rating/index.d.ts +6 -5
- package/Rating/index.js +4 -98
- package/Rating/package.json +1 -1
- package/SafeQuery/cjs/index.development.js +181 -0
- package/SafeQuery/cjs/index.production.js +1 -0
- package/SafeQuery/cjs/style.development.css +1 -0
- package/SafeQuery/cjs/style.production.css +1 -0
- package/SafeQuery/components/Error.d.ts +7 -0
- package/SafeQuery/index.d.ts +10 -0
- package/SafeQuery/index.js +7 -0
- package/SafeQuery/package.json +12 -0
- package/Scroll/cjs/index.development.js +40 -0
- package/Scroll/cjs/index.production.js +1 -0
- package/Scroll/cjs/style.development.css +1 -0
- package/Scroll/cjs/style.production.css +1 -0
- package/Scroll/index.d.ts +18 -16
- package/Scroll/index.js +4 -76
- package/Scroll/package.json +1 -1
- package/ScrollControls/cjs/index.development.js +243 -0
- package/ScrollControls/cjs/index.production.js +1 -0
- package/ScrollControls/cjs/style.development.css +1 -0
- package/ScrollControls/cjs/style.production.css +1 -0
- package/ScrollControls/index.d.ts +16 -6
- package/ScrollControls/index.js +4 -244
- package/ScrollControls/package.json +1 -2
- package/SideOverlay/cjs/index.development.js +210 -0
- package/SideOverlay/cjs/index.production.js +1 -0
- package/SideOverlay/cjs/style.development.css +1 -0
- package/SideOverlay/cjs/style.production.css +1 -0
- package/SideOverlay/index.d.ts +28 -13
- package/SideOverlay/index.js +4 -251
- package/SideOverlay/package.json +1 -1
- package/SimpleSlider/cjs/index.development.js +433 -0
- package/SimpleSlider/cjs/index.production.js +1 -0
- package/SimpleSlider/cjs/style.development.css +1 -0
- package/SimpleSlider/cjs/style.production.css +1 -0
- package/SimpleSlider/index.d.ts +17 -3
- package/SimpleSlider/index.js +4 -477
- package/SimpleSlider/package.json +1 -1
- package/Skeleton/cjs/index.development.js +103 -0
- package/Skeleton/cjs/index.production.js +1 -0
- package/Skeleton/cjs/style.development.css +1 -0
- package/Skeleton/cjs/style.production.css +1 -0
- package/Skeleton/index.d.ts +9 -5
- package/Skeleton/index.js +4 -110
- package/Skeleton/package.json +1 -1
- package/Spinner/cjs/index.development.js +85 -0
- package/Spinner/cjs/index.production.js +1 -0
- package/Spinner/cjs/style.development.css +1 -0
- package/Spinner/cjs/style.production.css +1 -0
- package/Spinner/index.d.ts +7 -6
- package/Spinner/index.js +5 -76
- package/Spinner/package.json +1 -1
- package/Text/cjs/index.development.js +20 -0
- package/Text/cjs/index.production.js +1 -0
- package/Text/cjs/style.development.css +1 -0
- package/Text/cjs/style.production.css +1 -0
- package/Text/index.js +5 -18
- package/Text/package.json +1 -1
- package/TextEmoji/cjs/index.development.js +94 -0
- package/TextEmoji/cjs/index.production.js +1 -0
- package/TextEmoji/index.d.ts +4 -4
- package/TextEmoji/index.js +4 -84
- package/TextEmoji/package.json +1 -1
- package/Tumbler/cjs/index.development.js +110 -0
- package/Tumbler/cjs/index.production.js +1 -0
- package/Tumbler/cjs/style.development.css +1 -0
- package/Tumbler/cjs/style.production.css +1 -0
- package/Tumbler/index.d.ts +4 -4
- package/Tumbler/index.js +4 -95
- package/Tumbler/package.json +1 -1
- package/package.json +15 -9
- package/Body/style.css +0 -741
- package/Box/style.css +0 -9676
- package/Button/style.css +0 -3393
- package/Checkbox/style.css +0 -133
- package/Flex/style.css +0 -786
- package/Grid/style.css +0 -7350
- package/Icon/style.css +0 -46
- package/Image/style.css +0 -664
- package/Input/style.css +0 -345
- package/Line/style.css +0 -138
- package/Link/style.css +0 -259
- package/List/style.css +0 -312
- package/Picture/style.css +0 -1426
- package/PortableOverlay/style.css +0 -44
- package/Rating/style.css +0 -26
- package/Scroll/style.css +0 -169
- package/ScrollControls/style.css +0 -67
- package/SideOverlay/style.css +0 -208
- package/SimpleSlider/style.css +0 -134
- package/Skeleton/style.css +0 -145
- package/Spinner/style.css +0 -80
- package/Text/style.css +0 -840
- package/Tooltip/Popper/index.d.ts +0 -12
- package/Tooltip/Popper/index.js +0 -88
- package/Tooltip/Popper/package.json +0 -9
- package/Tooltip/Popper/style.css +0 -133
- package/Tooltip/Trigger/index.d.ts +0 -5
- package/Tooltip/Trigger/package.json +0 -9
- package/Tooltip/Trigger/style.css +0 -36
- package/Tooltip/index.d.ts +0 -24
- package/Tooltip/index.js +0 -284
- package/Tooltip/style.css +0 -170
- package/Tooltip/utils.d.ts +0 -1
- package/Tumbler/style.css +0 -118
package/SimpleSlider/index.js
CHANGED
|
@@ -1,480 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var ttag = require('ttag');
|
|
8
|
-
var Swipe = require('react-easy-swipe');
|
|
9
|
-
var classNames = require('classnames');
|
|
10
|
-
require('intersection-observer');
|
|
11
|
-
var Button = require('@prom-ui/core/Button');
|
|
12
|
-
|
|
13
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
-
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
16
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
17
|
-
var Swipe__default = /*#__PURE__*/_interopDefaultLegacy(Swipe);
|
|
18
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
19
|
-
|
|
20
|
-
/******************************************************************************
|
|
21
|
-
Copyright (c) Microsoft Corporation.
|
|
22
|
-
|
|
23
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
24
|
-
purpose with or without fee is hereby granted.
|
|
25
|
-
|
|
26
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
27
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
28
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
29
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
30
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
31
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
32
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
33
|
-
***************************************************************************** */
|
|
34
|
-
|
|
35
|
-
var __assign = function() {
|
|
36
|
-
__assign = Object.assign || function __assign(t) {
|
|
37
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
38
|
-
s = arguments[i];
|
|
39
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
40
|
-
}
|
|
41
|
-
return t;
|
|
42
|
-
};
|
|
43
|
-
return __assign.apply(this, arguments);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
function __rest(s, e) {
|
|
47
|
-
var t = {};
|
|
48
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
49
|
-
t[p] = s[p];
|
|
50
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
51
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
52
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
53
|
-
t[p[i]] = s[p[i]];
|
|
54
|
-
}
|
|
55
|
-
return t;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function __makeTemplateObject(cooked, raw) {
|
|
59
|
-
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
60
|
-
return cooked;
|
|
3
|
+
if (process.env.NODE_ENV === 'production') {
|
|
4
|
+
module.exports = require('./cjs/index.production.js');
|
|
5
|
+
} else {
|
|
6
|
+
module.exports = require('./cjs/index.development.js');
|
|
61
7
|
}
|
|
62
|
-
|
|
63
|
-
var useAutoPlay = function (callback, delay) {
|
|
64
|
-
var timeout = React.useRef(null);
|
|
65
|
-
|
|
66
|
-
var stop = function () {
|
|
67
|
-
clearTimeout(timeout.current);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
var start = function () {
|
|
71
|
-
stop();
|
|
72
|
-
timeout.current = setTimeout(callback, delay);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return [start, stop];
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
var isValidRatio = function (ratio) {
|
|
79
|
-
return !!ratio && /\d\/\d/.test(ratio);
|
|
80
|
-
};
|
|
81
|
-
var getInfiniteIndex = function (index, count) {
|
|
82
|
-
return Math.abs((index % count + count) % count);
|
|
83
|
-
};
|
|
84
|
-
var getRatioHolderStyle = function (ratio) {
|
|
85
|
-
return {
|
|
86
|
-
paddingTop: "calc(".concat(ratio.split('/').reverse().join('/'), " * 100%)")
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
var getRootStyle = function (_a) {
|
|
90
|
-
var width = _a.width,
|
|
91
|
-
height = _a.height,
|
|
92
|
-
ratio = _a.ratio,
|
|
93
|
-
style = _a.style;
|
|
94
|
-
var hasRatio = isValidRatio(ratio);
|
|
95
|
-
return __assign({
|
|
96
|
-
width: width,
|
|
97
|
-
height: hasRatio ? 'auto' : height,
|
|
98
|
-
maxWidth: hasRatio ? '100%' : 'none',
|
|
99
|
-
aspectRatio: hasRatio ? ratio : undefined
|
|
100
|
-
}, style);
|
|
101
|
-
};
|
|
102
|
-
var getTrackStyle = function (_a) {
|
|
103
|
-
var index = _a.index,
|
|
104
|
-
childrenCount = _a.childrenCount,
|
|
105
|
-
duration = _a.duration,
|
|
106
|
-
offset = _a.offset;
|
|
107
|
-
var hasOffset = typeof offset === 'number';
|
|
108
|
-
var currentOffset = hasOffset ? offset : 0;
|
|
109
|
-
return {
|
|
110
|
-
transform: "translateX(calc(".concat(index * (100 / childrenCount) * -1, "% + ").concat(currentOffset, "px))"),
|
|
111
|
-
transition: hasOffset ? undefined : "transform ".concat(duration, "ms ease"),
|
|
112
|
-
width: "".concat(childrenCount * 100, "%") // willChange: 'transform',
|
|
113
|
-
|
|
114
|
-
};
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
var css = {"root":"SimpleSlider__root___WuTIM","track":"SimpleSlider__track___G8BYu","trackItem":"SimpleSlider__trackItem___94Eq7","buttonCommon":"SimpleSlider__buttonCommon___I5yQD","buttonPrev":"SimpleSlider__buttonPrev___UqTOk SimpleSlider__buttonCommon___I5yQD","buttonNext":"SimpleSlider__buttonNext___BbLNv SimpleSlider__buttonCommon___I5yQD","buttonIcon":"SimpleSlider__buttonIcon___89h6n","showOnHoverButtons":"SimpleSlider__showOnHoverButtons___yssoj","dots":"SimpleSlider__dots___E7g4J","dotsItem":"SimpleSlider__dotsItem___cbWCu","dotsButton":"SimpleSlider__dotsButton___7N4yb","showOnHoverDots":"SimpleSlider__showOnHoverDots___ig5DV"};
|
|
118
|
-
|
|
119
|
-
var SimpleSlider = React.forwardRef(function (_a, ref) {
|
|
120
|
-
var _b;
|
|
121
|
-
|
|
122
|
-
var _c = _a.autoPlay,
|
|
123
|
-
autoPlay = _c === void 0 ? 0 : _c,
|
|
124
|
-
children = _a.children,
|
|
125
|
-
className = _a.className,
|
|
126
|
-
_d = _a.duration,
|
|
127
|
-
duration = _d === void 0 ? 500 : _d,
|
|
128
|
-
height = _a.height,
|
|
129
|
-
_e = _a.infinite,
|
|
130
|
-
infinite = _e === void 0 ? false : _e,
|
|
131
|
-
ratio = _a.ratio,
|
|
132
|
-
style = _a.style,
|
|
133
|
-
width = _a.width,
|
|
134
|
-
onChangeIndex = _a.onChangeIndex,
|
|
135
|
-
onClickDot = _a.onClickDot,
|
|
136
|
-
onClickItem = _a.onClickItem,
|
|
137
|
-
onClickButtonNext = _a.onClickButtonNext,
|
|
138
|
-
onClickButtonPrev = _a.onClickButtonPrev,
|
|
139
|
-
onSwipeNext = _a.onSwipeNext,
|
|
140
|
-
onSwipePrev = _a.onSwipePrev,
|
|
141
|
-
_f = _a.showOnHoverButtons,
|
|
142
|
-
showOnHoverButtons = _f === void 0 ? false : _f,
|
|
143
|
-
_g = _a.showOnHoverDots,
|
|
144
|
-
showOnHoverDots = _g === void 0 ? false : _g,
|
|
145
|
-
props = __rest(_a, ["autoPlay", "children", "className", "duration", "height", "infinite", "ratio", "style", "width", "onChangeIndex", "onClickDot", "onClickItem", "onClickButtonNext", "onClickButtonPrev", "onSwipeNext", "onSwipePrev", "showOnHoverButtons", "showOnHoverDots"]);
|
|
146
|
-
|
|
147
|
-
var refTrack = React.useRef(null);
|
|
148
|
-
var transitionRunning = React.useRef(false);
|
|
149
|
-
|
|
150
|
-
var _h = React.useState(false),
|
|
151
|
-
disableAutoPlay = _h[0],
|
|
152
|
-
setDisableAutoPlay = _h[1];
|
|
153
|
-
|
|
154
|
-
var _j = React.useState({
|
|
155
|
-
index: 0,
|
|
156
|
-
offset: undefined
|
|
157
|
-
}),
|
|
158
|
-
position = _j[0],
|
|
159
|
-
setPosition = _j[1];
|
|
160
|
-
|
|
161
|
-
var childrenCount = React.Children.count(children);
|
|
162
|
-
var childrenArray = React.Children.toArray(children);
|
|
163
|
-
var isDisablePrev = !infinite && position.index === 0;
|
|
164
|
-
var isDisableNext = !infinite && position.index === childrenCount - 1;
|
|
165
|
-
var isShowNavi = childrenCount > 1;
|
|
166
|
-
var isShowDots = childrenCount > 1;
|
|
167
|
-
var isAutoPlay = !disableAutoPlay && autoPlay > 0;
|
|
168
|
-
var prevIndex = position.index - 1;
|
|
169
|
-
var nextIndex = position.index + 1;
|
|
170
|
-
var infiniteIndex = getInfiniteIndex(position.index, childrenCount);
|
|
171
|
-
var infinitePrevIndex = getInfiniteIndex(prevIndex, childrenCount);
|
|
172
|
-
var infiniteNextIndex = getInfiniteIndex(nextIndex, childrenCount);
|
|
173
|
-
|
|
174
|
-
var handleClickButtonNext = function () {
|
|
175
|
-
if (transitionRunning.current || isDisableNext) return;
|
|
176
|
-
|
|
177
|
-
if (typeof onClickButtonNext === 'function') {
|
|
178
|
-
onClickButtonNext(infiniteNextIndex);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
setPosition({
|
|
182
|
-
index: nextIndex,
|
|
183
|
-
offset: undefined
|
|
184
|
-
});
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
var handleClickButtonPrev = function () {
|
|
188
|
-
if (transitionRunning.current || isDisablePrev) return;
|
|
189
|
-
|
|
190
|
-
if (typeof onClickButtonPrev === 'function') {
|
|
191
|
-
onClickButtonPrev(infinitePrevIndex);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
setPosition({
|
|
195
|
-
index: prevIndex,
|
|
196
|
-
offset: undefined
|
|
197
|
-
});
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
var handleClickDot = function (i) {
|
|
201
|
-
if (transitionRunning.current) return;
|
|
202
|
-
|
|
203
|
-
if (typeof onClickDot === 'function') {
|
|
204
|
-
onClickDot(i);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
setPosition({
|
|
208
|
-
index: i,
|
|
209
|
-
offset: undefined
|
|
210
|
-
});
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
var handleSwipeNext = function () {
|
|
214
|
-
if (transitionRunning.current || isDisableNext) return;
|
|
215
|
-
|
|
216
|
-
if (typeof onSwipeNext === 'function') {
|
|
217
|
-
onSwipeNext(infiniteNextIndex);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
setPosition({
|
|
221
|
-
index: nextIndex,
|
|
222
|
-
offset: undefined
|
|
223
|
-
});
|
|
224
|
-
};
|
|
225
|
-
|
|
226
|
-
var handleSwipePrev = function () {
|
|
227
|
-
if (transitionRunning.current || isDisablePrev) return;
|
|
228
|
-
|
|
229
|
-
if (typeof onSwipePrev === 'function') {
|
|
230
|
-
onSwipePrev(infinitePrevIndex);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
setPosition({
|
|
234
|
-
index: prevIndex,
|
|
235
|
-
offset: undefined
|
|
236
|
-
});
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
var handleSwipeMove = function (_a, event) {
|
|
240
|
-
var x = _a.x;
|
|
241
|
-
if (transitionRunning.current || event.touches && event.touches.length > 1) return;
|
|
242
|
-
var offset = x;
|
|
243
|
-
|
|
244
|
-
if (isDisablePrev && x > 0 || isDisableNext && x < 0) {
|
|
245
|
-
offset = 0;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
setPosition({
|
|
249
|
-
index: position.index,
|
|
250
|
-
offset: offset
|
|
251
|
-
});
|
|
252
|
-
};
|
|
253
|
-
|
|
254
|
-
var _k = useAutoPlay(function () {
|
|
255
|
-
if (transitionRunning.current || isDisableNext) return;
|
|
256
|
-
setPosition({
|
|
257
|
-
index: nextIndex,
|
|
258
|
-
offset: undefined
|
|
259
|
-
});
|
|
260
|
-
}, autoPlay),
|
|
261
|
-
startAutoPlay = _k[0],
|
|
262
|
-
stopAutoPlay = _k[1];
|
|
263
|
-
|
|
264
|
-
var handleTransitionStart = function () {
|
|
265
|
-
transitionRunning.current = true;
|
|
266
|
-
stopAutoPlay();
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
var handleTransitionEnd = function () {
|
|
270
|
-
transitionRunning.current = false;
|
|
271
|
-
|
|
272
|
-
if (isAutoPlay) {
|
|
273
|
-
startAutoPlay();
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
if (!(position.index in childrenArray)) {
|
|
277
|
-
setPosition({
|
|
278
|
-
index: infiniteIndex,
|
|
279
|
-
offset: 0
|
|
280
|
-
});
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
if (typeof onChangeIndex === 'function') {
|
|
284
|
-
onChangeIndex(infiniteIndex);
|
|
285
|
-
}
|
|
286
|
-
};
|
|
287
|
-
|
|
288
|
-
React.useEffect(function () {
|
|
289
|
-
var _a, _b;
|
|
290
|
-
|
|
291
|
-
var autoPlayObserver = new IntersectionObserver(function (entries) {
|
|
292
|
-
if (entries[0].isIntersecting) {
|
|
293
|
-
startAutoPlay();
|
|
294
|
-
} else {
|
|
295
|
-
stopAutoPlay();
|
|
296
|
-
}
|
|
297
|
-
});
|
|
298
|
-
(_a = refTrack.current) === null || _a === void 0 ? void 0 : _a.addEventListener('transitionstart', handleTransitionStart);
|
|
299
|
-
(_b = refTrack.current) === null || _b === void 0 ? void 0 : _b.addEventListener('transitionend', handleTransitionEnd);
|
|
300
|
-
|
|
301
|
-
if (isAutoPlay && refTrack.current) {
|
|
302
|
-
autoPlayObserver.observe(refTrack.current);
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
return function () {
|
|
306
|
-
var _a, _b;
|
|
307
|
-
|
|
308
|
-
(_a = refTrack.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('transitionstart', handleTransitionStart);
|
|
309
|
-
(_b = refTrack.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('transitionend', handleTransitionEnd);
|
|
310
|
-
stopAutoPlay();
|
|
311
|
-
autoPlayObserver.disconnect();
|
|
312
|
-
};
|
|
313
|
-
}, [position.index, isAutoPlay]);
|
|
314
|
-
return React__default["default"].createElement(Swipe__default["default"], __assign({
|
|
315
|
-
ref: ref,
|
|
316
|
-
onSwipeLeft: handleSwipeNext,
|
|
317
|
-
onSwipeRight: handleSwipePrev,
|
|
318
|
-
onSwipeMove: handleSwipeMove,
|
|
319
|
-
className: classNames__default["default"](css.root, className, (_b = {}, _b[css.showOnHoverButtons] = showOnHoverButtons, _b[css.showOnHoverDots] = showOnHoverDots, _b)),
|
|
320
|
-
style: getRootStyle({
|
|
321
|
-
width: width,
|
|
322
|
-
height: height,
|
|
323
|
-
ratio: ratio,
|
|
324
|
-
style: style
|
|
325
|
-
}),
|
|
326
|
-
onSwipeStart: function () {
|
|
327
|
-
return setDisableAutoPlay(true);
|
|
328
|
-
},
|
|
329
|
-
onSwipeEnd: function () {
|
|
330
|
-
return setDisableAutoPlay(false);
|
|
331
|
-
},
|
|
332
|
-
onMouseEnter: function () {
|
|
333
|
-
return setDisableAutoPlay(true);
|
|
334
|
-
},
|
|
335
|
-
onMouseLeave: function () {
|
|
336
|
-
return setDisableAutoPlay(false);
|
|
337
|
-
}
|
|
338
|
-
}, props), isValidRatio(ratio) && React__default["default"].createElement("div", {
|
|
339
|
-
style: getRatioHolderStyle(ratio)
|
|
340
|
-
}), React__default["default"].createElement("ul", {
|
|
341
|
-
ref: refTrack,
|
|
342
|
-
className: css.track,
|
|
343
|
-
style: getTrackStyle({
|
|
344
|
-
index: infinite ? position.index + 1 : position.index,
|
|
345
|
-
childrenCount: infinite ? childrenCount + 2 : childrenCount,
|
|
346
|
-
duration: duration,
|
|
347
|
-
offset: position.offset
|
|
348
|
-
})
|
|
349
|
-
}, infinite && React__default["default"].createElement("li", {
|
|
350
|
-
className: css.trackItem
|
|
351
|
-
}, childrenArray[childrenArray.length - 1]), childrenArray.map(function (child, index) {
|
|
352
|
-
return React__default["default"].createElement("li", {
|
|
353
|
-
key: child.key,
|
|
354
|
-
className: css.trackItem,
|
|
355
|
-
onClick: function () {
|
|
356
|
-
if (typeof onClickItem === 'function') {
|
|
357
|
-
onClickItem(index);
|
|
358
|
-
}
|
|
359
|
-
},
|
|
360
|
-
"data-qaid": "image_slider_".concat(index)
|
|
361
|
-
}, child);
|
|
362
|
-
}), infinite && React__default["default"].createElement("li", {
|
|
363
|
-
className: css.trackItem
|
|
364
|
-
}, childrenArray[0])), isShowNavi && React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement(Button.Button, {
|
|
365
|
-
type: 'button',
|
|
366
|
-
className: css.buttonPrev,
|
|
367
|
-
onClick: handleClickButtonPrev,
|
|
368
|
-
disabled: isDisablePrev,
|
|
369
|
-
"aria-label": ttag.t(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"], ["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u0440\u0435\u0434\u044B\u0434\u0443\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"]))),
|
|
370
|
-
"data-qaid": 'prev_image'
|
|
371
|
-
}, React__default["default"].createElement("svg", {
|
|
372
|
-
className: css.buttonIcon,
|
|
373
|
-
width: 18,
|
|
374
|
-
height: 18,
|
|
375
|
-
viewBox: '0 0 64 64',
|
|
376
|
-
xmlns: 'http://www.w3.org/2000/svg'
|
|
377
|
-
}, React__default["default"].createElement("path", {
|
|
378
|
-
d: 'M41.625 60.375L16 32 41.625 3.625 48.5 10 28.375 32 48.5 54z'
|
|
379
|
-
}))), React__default["default"].createElement(Button.Button, {
|
|
380
|
-
type: 'button',
|
|
381
|
-
className: css.buttonNext,
|
|
382
|
-
onClick: handleClickButtonNext,
|
|
383
|
-
disabled: isDisableNext,
|
|
384
|
-
"aria-label": ttag.t(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"], ["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0441\u043B\u0435\u0434\u0443\u044E\u0449\u0438\u0439 \u0431\u0430\u043D\u043D\u0435\u0440"]))),
|
|
385
|
-
"data-qaid": 'next_image'
|
|
386
|
-
}, React__default["default"].createElement("svg", {
|
|
387
|
-
className: css.buttonIcon,
|
|
388
|
-
width: 18,
|
|
389
|
-
height: 18,
|
|
390
|
-
viewBox: '0 0 64 64',
|
|
391
|
-
xmlns: 'http://www.w3.org/2000/svg'
|
|
392
|
-
}, React__default["default"].createElement("path", {
|
|
393
|
-
d: 'M22.875 60.375L16 54l20.125-22L16 10l6.875-6.375L48.5 32z'
|
|
394
|
-
})))), isShowDots && React__default["default"].createElement("ul", {
|
|
395
|
-
className: css.dots
|
|
396
|
-
}, childrenArray.map(function (child, index) {
|
|
397
|
-
var viewIndex = index + 1;
|
|
398
|
-
return React__default["default"].createElement("li", {
|
|
399
|
-
className: css.dotsItem,
|
|
400
|
-
key: child.key
|
|
401
|
-
}, React__default["default"].createElement(Button.Button, {
|
|
402
|
-
className: css.dotsButton,
|
|
403
|
-
type: 'button',
|
|
404
|
-
onClick: function () {
|
|
405
|
-
return handleClickDot(index);
|
|
406
|
-
},
|
|
407
|
-
disabled: index === infiniteIndex,
|
|
408
|
-
"aria-label": ttag.t(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0431\u0430\u043D\u043D\u0435\u0440 \u043D\u043E\u043C\u0435\u0440 ", ""], ["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u0431\u0430\u043D\u043D\u0435\u0440 \u043D\u043E\u043C\u0435\u0440 ", ""])), viewIndex),
|
|
409
|
-
"data-qaid": "view_image_".concat(viewIndex)
|
|
410
|
-
}, viewIndex));
|
|
411
|
-
})));
|
|
412
|
-
}); // SimpleSlider.defaultProps = {
|
|
413
|
-
// autoPlay: 0,
|
|
414
|
-
// className: undefined,
|
|
415
|
-
// duration: 500,
|
|
416
|
-
// infinite: false,
|
|
417
|
-
// onClickButtonNext: undefined,
|
|
418
|
-
// onClickButtonPrev: undefined,
|
|
419
|
-
// onClickDot: undefined,
|
|
420
|
-
// onClickItem: undefined,
|
|
421
|
-
// onSwipeNext: undefined,
|
|
422
|
-
// onSwipePrev: undefined,
|
|
423
|
-
// onChangeIndex: undefined,
|
|
424
|
-
// ratio: undefined,
|
|
425
|
-
// style: undefined,
|
|
426
|
-
// showOnHoverButtons: false,
|
|
427
|
-
// showOnHoverDots: false,
|
|
428
|
-
// };
|
|
429
|
-
|
|
430
|
-
SimpleSlider.propTypes = {
|
|
431
|
-
height: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]).isRequired,
|
|
432
|
-
|
|
433
|
-
/** Бесконечное листание */
|
|
434
|
-
infinite: PropTypes__default["default"].bool,
|
|
435
|
-
|
|
436
|
-
/** Скорость анимации листания в `ms` */
|
|
437
|
-
duration: PropTypes__default["default"].number,
|
|
438
|
-
|
|
439
|
-
/** Соотношение сторон `16/9`, `4/3`, `1/1` или нестандартное `900/400` */
|
|
440
|
-
// ratio: PropTypes.string,
|
|
441
|
-
width: PropTypes__default["default"].oneOfType([PropTypes__default["default"].number, PropTypes__default["default"].string]).isRequired,
|
|
442
|
-
// children: PropTypes.node.isRequired,
|
|
443
|
-
className: PropTypes__default["default"].string,
|
|
444
|
-
style: PropTypes__default["default"].object,
|
|
445
|
-
|
|
446
|
-
/** Обратный вызов изменения `(index) =>` */
|
|
447
|
-
onClickButtonNext: PropTypes__default["default"].func,
|
|
448
|
-
|
|
449
|
-
/** Обратный вызов изменения `(index) =>` */
|
|
450
|
-
onClickButtonPrev: PropTypes__default["default"].func,
|
|
451
|
-
|
|
452
|
-
/** Обратный вызов изменения `(index) =>` */
|
|
453
|
-
onClickDot: PropTypes__default["default"].func,
|
|
454
|
-
|
|
455
|
-
/** Обратный вызов изменения `(index) =>` */
|
|
456
|
-
onClickItem: PropTypes__default["default"].func,
|
|
457
|
-
|
|
458
|
-
/** Обратный вызов изменения `(index) =>` */
|
|
459
|
-
onSwipeNext: PropTypes__default["default"].func,
|
|
460
|
-
|
|
461
|
-
/** Обратный вызов изменения `(index) =>` */
|
|
462
|
-
onSwipePrev: PropTypes__default["default"].func,
|
|
463
|
-
|
|
464
|
-
/** Обратный вызов изменения `index` в конце анимации `(index) =>` */
|
|
465
|
-
onChangeIndex: PropTypes__default["default"].func,
|
|
466
|
-
|
|
467
|
-
/** Автоматические листание в `ms`, по умолчанию `0` - выключено */
|
|
468
|
-
autoPlay: PropTypes__default["default"].number,
|
|
469
|
-
|
|
470
|
-
/** Показывать при наведении кнопки по бокам Вперед и Назад */
|
|
471
|
-
showOnHoverButtons: PropTypes__default["default"].bool,
|
|
472
|
-
|
|
473
|
-
/** Показывать при наведении точки снизу */
|
|
474
|
-
showOnHoverDots: PropTypes__default["default"].bool
|
|
475
|
-
};
|
|
476
|
-
var templateObject_1, templateObject_2, templateObject_3;
|
|
477
|
-
|
|
478
|
-
exports.SimpleSlider = SimpleSlider;
|
|
479
|
-
|
|
480
|
-
require('./style.css');
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var evokit = require('evokit');
|
|
7
|
+
|
|
8
|
+
function _interopNamespace(e) {
|
|
9
|
+
if (e && e.__esModule) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n["default"] = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
27
|
+
|
|
28
|
+
/******************************************************************************
|
|
29
|
+
Copyright (c) Microsoft Corporation.
|
|
30
|
+
|
|
31
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
32
|
+
purpose with or without fee is hereby granted.
|
|
33
|
+
|
|
34
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
35
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
36
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
37
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
38
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
39
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
40
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
41
|
+
***************************************************************************** */
|
|
42
|
+
|
|
43
|
+
var __assign = function() {
|
|
44
|
+
__assign = Object.assign || function __assign(t) {
|
|
45
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
46
|
+
s = arguments[i];
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
48
|
+
}
|
|
49
|
+
return t;
|
|
50
|
+
};
|
|
51
|
+
return __assign.apply(this, arguments);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
function __rest(s, e) {
|
|
55
|
+
var t = {};
|
|
56
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
57
|
+
t[p] = s[p];
|
|
58
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
59
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
60
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
61
|
+
t[p[i]] = s[p[i]];
|
|
62
|
+
}
|
|
63
|
+
return t;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
var css = {"ek-skeleton":"Skeleton__ek-skeleton___YQ77B","ek-skeleton_theme_grey":"Skeleton__ek-skeleton_theme_grey___fLU-I","skeleton-keyframes-wave":"Skeleton__skeleton-keyframes-wave___tx4t3","ek-skeleton_theme_black-100":"Skeleton__ek-skeleton_theme_black-100___7Lfmq","ek-skeleton_theme_white":"Skeleton__ek-skeleton_theme_white___HJ4sO","ek-skeleton_variant_text":"Skeleton__ek-skeleton_variant_text___8cqBE","ek-skeleton_variant_circle":"Skeleton__ek-skeleton_variant_circle___-y8Ac","ek-skeleton_variant_square":"Skeleton__ek-skeleton_variant_square___ER7Aa","ek-skeleton_variant_rect":"Skeleton__ek-skeleton_variant_rect___PqK20","ek-skeleton_align_left":"Skeleton__ek-skeleton_align_left___vFpty","ek-skeleton_align_center":"Skeleton__ek-skeleton_align_center___xLcUn","ek-skeleton_align_right":"Skeleton__ek-skeleton_align_right___YXQvi","ek-skeleton_opacity_0":"Skeleton__ek-skeleton_opacity_0___hV3fo","ek-skeleton_opacity_10":"Skeleton__ek-skeleton_opacity_10___SWeYg","ek-skeleton_opacity_20":"Skeleton__ek-skeleton_opacity_20___uh-KW","ek-skeleton_opacity_30":"Skeleton__ek-skeleton_opacity_30___o-fsf","ek-skeleton_opacity_40":"Skeleton__ek-skeleton_opacity_40___yQNnj","ek-skeleton_opacity_50":"Skeleton__ek-skeleton_opacity_50___8ChyF","ek-skeleton_opacity_60":"Skeleton__ek-skeleton_opacity_60___jPfCj","ek-skeleton_opacity_70":"Skeleton__ek-skeleton_opacity_70___yi2qY","ek-skeleton_opacity_80":"Skeleton__ek-skeleton_opacity_80___kUBbU","ek-skeleton_opacity_90":"Skeleton__ek-skeleton_opacity_90___C0qIh","ek-skeleton_opacity_100":"Skeleton__ek-skeleton_opacity_100___PYOu-"};
|
|
67
|
+
|
|
68
|
+
var SkeletonBlock = evokit.createBlock('div', 'skeleton', ['align', 'theme', 'variant', 'opacity'], {
|
|
69
|
+
css: css
|
|
70
|
+
});
|
|
71
|
+
var Skeleton = React__namespace.forwardRef(function (_a, ref) {
|
|
72
|
+
var _b = _a.align,
|
|
73
|
+
align = _b === void 0 ? 'left' : _b,
|
|
74
|
+
height = _a.height,
|
|
75
|
+
opacity = _a.opacity,
|
|
76
|
+
style = _a.style,
|
|
77
|
+
_c = _a.theme,
|
|
78
|
+
theme = _c === void 0 ? 'grey' : _c,
|
|
79
|
+
_d = _a.variant,
|
|
80
|
+
variant = _d === void 0 ? 'text' : _d,
|
|
81
|
+
width = _a.width,
|
|
82
|
+
props = __rest(_a, ["align", "height", "opacity", "style", "theme", "variant", "width"]);
|
|
83
|
+
|
|
84
|
+
var blockStyle = React__namespace.useMemo(function () {
|
|
85
|
+
return __assign({
|
|
86
|
+
height: height,
|
|
87
|
+
width: width
|
|
88
|
+
}, style);
|
|
89
|
+
}, [height, width, style]);
|
|
90
|
+
return React__namespace.createElement(SkeletonBlock, __assign({
|
|
91
|
+
"skeleton-align": align,
|
|
92
|
+
"skeleton-theme": theme,
|
|
93
|
+
"skeleton-variant": variant,
|
|
94
|
+
"skeleton-opacity": opacity,
|
|
95
|
+
style: blockStyle
|
|
96
|
+
}, props, {
|
|
97
|
+
ref: ref
|
|
98
|
+
}));
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
exports.Skeleton = Skeleton;
|
|
102
|
+
|
|
103
|
+
require('./style.development.css');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("evokit");function n(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var o=n(e),r=function(){return r=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},r.apply(this,arguments)};var a=t.createBlock("div","skeleton",["align","theme","variant","opacity"],{css:{"ek-skeleton":"YQ77B","ek-skeleton_theme_grey":"fLU-I","skeleton-keyframes-wave":"tx4t3","ek-skeleton_theme_black-100":"_7Lfmq","ek-skeleton_theme_white":"HJ4sO","ek-skeleton_variant_text":"_8cqBE","ek-skeleton_variant_circle":"-y8Ac","ek-skeleton_variant_square":"ER7Aa","ek-skeleton_variant_rect":"PqK20","ek-skeleton_align_left":"vFpty","ek-skeleton_align_center":"xLcUn","ek-skeleton_align_right":"YXQvi","ek-skeleton_opacity_0":"hV3fo","ek-skeleton_opacity_10":"SWeYg","ek-skeleton_opacity_20":"uh-KW","ek-skeleton_opacity_30":"o-fsf","ek-skeleton_opacity_40":"yQNnj","ek-skeleton_opacity_50":"_8ChyF","ek-skeleton_opacity_60":"jPfCj","ek-skeleton_opacity_70":"yi2qY","ek-skeleton_opacity_80":"kUBbU","ek-skeleton_opacity_90":"C0qIh","ek-skeleton_opacity_100":"PYOu-"}}),i=o.forwardRef((function(e,t){var n=e.align,i=void 0===n?"left":n,l=e.height,c=e.opacity,k=e.style,s=e.theme,_=void 0===s?"grey":s,y=e.variant,p=void 0===y?"text":y,f=e.width,u=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n}(e,["align","height","opacity","style","theme","variant","width"]),h=o.useMemo((function(){return r({height:l,width:f},k)}),[l,f,k]);return o.createElement(a,r({"skeleton-align":i,"skeleton-theme":_,"skeleton-variant":p,"skeleton-opacity":c,style:h},u,{ref:t}))}));exports.Skeleton=i,require("./style.production.css");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@-webkit-keyframes Skeleton__skeleton-keyframes-wave___tx4t3{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}@keyframes Skeleton__skeleton-keyframes-wave___tx4t3{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}.Skeleton__ek-skeleton___YQ77B{display:block;clear:both;line-height:100%;border-radius:var(--pds-round-m);overflow:hidden;pointer-events:none;position:relative}.Skeleton__ek-skeleton___YQ77B+.Skeleton__ek-skeleton___YQ77B{margin-top:var(--pds-spacing-s)}.Skeleton__ek-skeleton___YQ77B::after{position:absolute;left:0;top:0;width:100%;height:100%}.Skeleton__ek-skeleton_theme_grey___fLU-I{background-color:var(--black-100)}.Skeleton__ek-skeleton_theme_grey___fLU-I::after{content:"";transform:translateX(-100%);will-change:transform;background-image:linear-gradient(to right,var(--black-100) 0%,var(--black-100) 20%,var(--black-50) 50%,var(--black-100) 80%,var(--black-100) 100%);-webkit-animation:Skeleton__skeleton-keyframes-wave___tx4t3 1350ms linear infinite;animation:Skeleton__skeleton-keyframes-wave___tx4t3 1350ms linear infinite}.Skeleton__ek-skeleton_theme_black-100___7Lfmq{background:var(--black-100)}.Skeleton__ek-skeleton_theme_white___HJ4sO{background:var(--white)}.Skeleton__ek-skeleton_variant_text___8cqBE::before{content:" "}.Skeleton__ek-skeleton_variant_circle___-y8Ac{border-radius:50%}.Skeleton__ek-skeleton_variant_circle___-y8Ac::before,.Skeleton__ek-skeleton_variant_square___ER7Aa::before{content:"";display:block;padding-bottom:100%}.Skeleton__ek-skeleton_variant_rect___PqK20{border-radius:0}.Skeleton__ek-skeleton_align_left___vFpty{margin-right:auto}.Skeleton__ek-skeleton_align_center___xLcUn{margin-left:auto;margin-right:auto}.Skeleton__ek-skeleton_align_right___YXQvi{margin-left:auto}.Skeleton__ek-skeleton_opacity_0___hV3fo{opacity:0}.Skeleton__ek-skeleton_opacity_10___SWeYg{opacity:.1}.Skeleton__ek-skeleton_opacity_20___uh-KW{opacity:.2}.Skeleton__ek-skeleton_opacity_30___o-fsf{opacity:.3}.Skeleton__ek-skeleton_opacity_40___yQNnj{opacity:.4}.Skeleton__ek-skeleton_opacity_50___8ChyF{opacity:.5}.Skeleton__ek-skeleton_opacity_60___jPfCj{opacity:.6}.Skeleton__ek-skeleton_opacity_70___yi2qY{opacity:.7}.Skeleton__ek-skeleton_opacity_80___kUBbU{opacity:.8}.Skeleton__ek-skeleton_opacity_90___C0qIh{opacity:.9}.Skeleton__ek-skeleton_opacity_100___PYOu-{opacity:1}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@-webkit-keyframes tx4t3{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}@keyframes tx4t3{0%{transform:translateX(-100%)}to{transform:translateX(100%)}}.YQ77B{display:block;clear:both;line-height:100%;border-radius:var(--pds-round-m);overflow:hidden;pointer-events:none;position:relative}.YQ77B+.YQ77B{margin-top:var(--pds-spacing-s)}.YQ77B::after{position:absolute;left:0;top:0;width:100%;height:100%}.fLU-I{background-color:var(--black-100)}.fLU-I::after{content:"";transform:translateX(-100%);will-change:transform;background-image:linear-gradient(to right,var(--black-100) 0%,var(--black-100) 20%,var(--black-50) 50%,var(--black-100) 80%,var(--black-100) 100%);-webkit-animation:tx4t3 1350ms linear infinite;animation:tx4t3 1350ms linear infinite}._7Lfmq{background:var(--black-100)}.HJ4sO{background:var(--white)}._8cqBE::before{content:" "}.-y8Ac{border-radius:50%}.-y8Ac::before,.ER7Aa::before{content:"";display:block;padding-bottom:100%}.PqK20{border-radius:0}.vFpty{margin-right:auto}.xLcUn{margin-left:auto;margin-right:auto}.YXQvi{margin-left:auto}.hV3fo{opacity:0}.SWeYg{opacity:.1}.uh-KW{opacity:.2}.o-fsf{opacity:.3}.yQNnj{opacity:.4}._8ChyF{opacity:.5}.jPfCj{opacity:.6}.yi2qY{opacity:.7}.kUBbU{opacity:.8}.C0qIh{opacity:.9}.PYOu-{opacity:1}
|
package/Skeleton/index.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare type
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare type SkeletonProps = React.ComponentPropsWithRef<"div"> & {
|
|
3
|
+
/** Выравнивание */
|
|
3
4
|
align?: string;
|
|
5
|
+
/** Устанавливает высоту */
|
|
4
6
|
height?: string | number | null;
|
|
7
|
+
/** Устанавливает ширину */
|
|
5
8
|
width?: string | number | null;
|
|
9
|
+
/** Устанавливает прозрачность в % */
|
|
6
10
|
opacity?: 0 | 10 | 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | null;
|
|
11
|
+
/** Устанавливает тему */
|
|
7
12
|
theme?: 'black-100' | 'grey' | 'white';
|
|
13
|
+
/** Вариант отображения */
|
|
8
14
|
variant?: 'text' | 'circle' | 'square';
|
|
9
15
|
};
|
|
10
|
-
declare
|
|
11
|
-
export declare const Skeleton: React.FC<SkeletonProps>;
|
|
12
|
-
export {};
|
|
16
|
+
export declare const Skeleton: React.ForwardRefExoticComponent<Pick<SkeletonProps, "align" | "theme" | "variant" | "opacity" | "key" | keyof React.HTMLAttributes<HTMLDivElement> | "height" | "width"> & React.RefAttributes<HTMLDivElement>>;
|