@prom-ui/core 0.0.101 → 0.0.103-alpha.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/Avatar/cjs/index.development.js +0 -2
- package/Avatar/cjs/index.development.v2.js +151 -0
- package/Avatar/cjs/index.production.js +1 -1
- package/Avatar/cjs/index.production.v2.js +1 -0
- package/Avatar/cjs/style.development.v2.css +1 -0
- package/Avatar/cjs/style.production.v2.css +1 -0
- package/Avatar/index.js +14 -2
- package/Avatar/package.json +1 -1
- package/Body/cjs/index.development.js +0 -2
- package/Body/cjs/index.development.v2.js +12 -0
- package/Body/cjs/index.production.js +1 -1
- package/Body/cjs/index.production.v2.js +1 -0
- package/Body/cjs/style.development.v2.css +1 -0
- package/Body/cjs/style.production.v2.css +1 -0
- package/Body/index.js +14 -2
- package/Body/package.json +1 -1
- package/Box/cjs/index.development.js +0 -2
- package/Box/cjs/index.development.v2.js +18 -0
- package/Box/cjs/index.production.js +1 -1
- package/Box/cjs/index.production.v2.js +1 -0
- package/Box/cjs/style.development.v2.css +1 -0
- package/Box/cjs/style.production.v2.css +1 -0
- package/Box/index.js +14 -2
- package/Box/package.json +1 -1
- package/Button/cjs/index.development.js +0 -2
- package/Button/cjs/index.development.v2.js +93 -0
- package/Button/cjs/index.production.js +1 -1
- package/Button/cjs/index.production.v2.js +1 -0
- package/Button/cjs/style.development.v2.css +1 -0
- package/Button/cjs/style.production.v2.css +1 -0
- package/Button/index.js +14 -2
- package/Button/package.json +1 -1
- package/ButtonPageUp/cjs/index.development.v2.js +174 -0
- package/ButtonPageUp/cjs/index.production.v2.js +1 -0
- package/ButtonPageUp/index.js +2 -2
- package/ButtonPageUp/package.json +1 -1
- package/Checkbox/cjs/index.development.js +0 -2
- package/Checkbox/cjs/index.development.v2.js +109 -0
- package/Checkbox/cjs/index.production.js +1 -1
- package/Checkbox/cjs/index.production.v2.js +1 -0
- package/Checkbox/cjs/style.development.v2.css +1 -0
- package/Checkbox/cjs/style.production.v2.css +1 -0
- package/Checkbox/index.js +14 -2
- package/Checkbox/package.json +1 -1
- package/Flex/cjs/index.development.js +0 -2
- package/Flex/cjs/index.development.v2.js +23 -0
- package/Flex/cjs/index.production.js +1 -1
- package/Flex/cjs/index.production.v2.js +1 -0
- package/Flex/cjs/style.development.v2.css +1 -0
- package/Flex/cjs/style.production.v2.css +1 -0
- package/Flex/index.js +14 -2
- package/Flex/package.json +1 -1
- package/Grid/cjs/index.development.js +0 -2
- package/Grid/cjs/index.development.v2.js +23 -0
- package/Grid/cjs/index.production.js +1 -1
- package/Grid/cjs/index.production.v2.js +1 -0
- package/Grid/cjs/style.development.v2.css +1 -0
- package/Grid/cjs/style.production.v2.css +1 -0
- package/Grid/index.js +14 -2
- package/Grid/package.json +1 -1
- package/Icon/cjs/index.development.js +0 -2
- package/Icon/cjs/index.development.v2.js +39 -0
- package/Icon/cjs/index.production.js +1 -1
- package/Icon/cjs/index.production.v2.js +1 -0
- package/Icon/cjs/style.development.v2.css +1 -0
- package/Icon/cjs/style.production.v2.css +1 -0
- package/Icon/index.js +14 -2
- package/Icon/package.json +1 -1
- package/Image/cjs/index.development.js +0 -2
- package/Image/cjs/index.development.v2.js +18 -0
- package/Image/cjs/index.production.js +1 -1
- package/Image/cjs/index.production.v2.js +1 -0
- package/Image/cjs/style.development.v2.css +1 -0
- package/Image/cjs/style.production.v2.css +1 -0
- package/Image/index.js +14 -2
- package/Image/package.json +1 -1
- package/ImageEmoji/cjs/index.development.v2.js +90 -0
- package/ImageEmoji/cjs/index.production.v2.js +1 -0
- package/ImageEmoji/index.js +2 -2
- package/ImageEmoji/package.json +1 -1
- package/Input/cjs/index.development.js +0 -2
- package/Input/cjs/index.development.v2.js +37 -0
- package/Input/cjs/index.production.js +1 -1
- package/Input/cjs/index.production.v2.js +1 -0
- package/Input/cjs/style.development.v2.css +1 -0
- package/Input/cjs/style.production.v2.css +1 -0
- package/Input/index.js +14 -2
- package/Input/package.json +1 -1
- package/KeyPress/cjs/index.development.v2.js +56 -0
- package/KeyPress/cjs/index.production.v2.js +1 -0
- package/KeyPress/index.js +2 -2
- package/KeyPress/package.json +1 -1
- package/Line/cjs/index.development.js +0 -2
- package/Line/cjs/index.development.v2.js +18 -0
- package/Line/cjs/index.production.js +1 -1
- package/Line/cjs/index.production.v2.js +1 -0
- package/Line/cjs/style.development.v2.css +1 -0
- package/Line/cjs/style.production.v2.css +1 -0
- package/Line/index.js +14 -2
- package/Line/package.json +1 -1
- package/Link/cjs/index.development.js +0 -2
- package/Link/cjs/index.development.v2.js +20 -0
- package/Link/cjs/index.production.js +1 -1
- package/Link/cjs/index.production.v2.js +1 -0
- package/Link/cjs/style.development.v2.css +1 -0
- package/Link/cjs/style.production.v2.css +1 -0
- package/Link/index.js +14 -2
- package/Link/package.json +1 -1
- package/List/cjs/index.development.js +0 -2
- package/List/cjs/index.development.v2.js +23 -0
- package/List/cjs/index.production.js +1 -1
- package/List/cjs/index.production.v2.js +1 -0
- package/List/cjs/style.development.v2.css +1 -0
- package/List/cjs/style.production.v2.css +1 -0
- package/List/index.js +14 -2
- package/List/package.json +1 -1
- package/Media/cjs/index.development.v2.js +98 -0
- package/Media/cjs/index.production.v2.js +1 -0
- package/Media/index.js +2 -2
- package/Media/package.json +1 -1
- package/OutsideClick/cjs/index.development.v2.js +84 -0
- package/OutsideClick/cjs/index.production.v2.js +1 -0
- package/OutsideClick/index.js +2 -2
- package/OutsideClick/package.json +1 -1
- package/Overlay/cjs/index.development.js +0 -2
- package/Overlay/cjs/index.development.v2.js +473 -0
- package/Overlay/cjs/index.production.js +1 -1
- package/Overlay/cjs/index.production.v2.js +1 -0
- package/Overlay/cjs/style.development.v2.css +1 -0
- package/Overlay/cjs/style.production.v2.css +1 -0
- package/Overlay/index.js +14 -2
- package/Overlay/package.json +1 -1
- package/Picture/cjs/index.development.js +0 -2
- package/Picture/cjs/index.development.v2.js +23 -0
- package/Picture/cjs/index.production.js +1 -1
- package/Picture/cjs/index.production.v2.js +1 -0
- package/Picture/cjs/style.development.v2.css +1 -0
- package/Picture/cjs/style.production.v2.css +1 -0
- package/Picture/index.js +14 -2
- package/Picture/package.json +1 -1
- package/PortableOverlay/cjs/index.development.js +0 -2
- package/PortableOverlay/cjs/index.development.v2.js +109 -0
- package/PortableOverlay/cjs/index.production.js +1 -1
- package/PortableOverlay/cjs/index.production.v2.js +1 -0
- package/PortableOverlay/cjs/style.development.v2.css +1 -0
- package/PortableOverlay/cjs/style.production.v2.css +1 -0
- package/PortableOverlay/index.js +14 -2
- package/PortableOverlay/package.json +1 -1
- package/Portal/cjs/index.development.v2.js +57 -0
- package/Portal/cjs/index.production.v2.js +1 -0
- package/Portal/index.js +2 -2
- package/Portal/package.json +1 -1
- package/QRCode/cjs/index.development.js +0 -2
- package/QRCode/cjs/index.development.v2.js +50 -0
- package/QRCode/cjs/index.production.js +1 -1
- package/QRCode/cjs/index.production.v2.js +1 -0
- package/QRCode/cjs/style.development.v2.css +1 -0
- package/QRCode/cjs/style.production.v2.css +1 -0
- package/QRCode/index.js +14 -2
- package/QRCode/package.json +1 -1
- package/Rating/cjs/index.development.js +0 -2
- package/Rating/cjs/index.development.v2.js +105 -0
- package/Rating/cjs/index.production.js +1 -1
- package/Rating/cjs/index.production.v2.js +1 -0
- package/Rating/cjs/style.development.v2.css +1 -0
- package/Rating/cjs/style.production.v2.css +1 -0
- package/Rating/index.js +14 -2
- package/Rating/package.json +1 -1
- package/SafeQuery/cjs/index.development.js +0 -2
- package/SafeQuery/cjs/index.development.v2.js +179 -0
- package/SafeQuery/cjs/index.production.js +1 -1
- package/SafeQuery/cjs/index.production.v2.js +1 -0
- package/SafeQuery/cjs/style.development.v2.css +1 -0
- package/SafeQuery/cjs/style.production.v2.css +1 -0
- package/SafeQuery/index.js +14 -2
- package/SafeQuery/package.json +1 -1
- package/Scroll/cjs/index.development.js +0 -2
- package/Scroll/cjs/index.development.v2.js +38 -0
- package/Scroll/cjs/index.production.js +1 -1
- package/Scroll/cjs/index.production.v2.js +1 -0
- package/Scroll/cjs/style.development.v2.css +1 -0
- package/Scroll/cjs/style.production.v2.css +1 -0
- package/Scroll/index.js +14 -2
- package/Scroll/package.json +1 -1
- package/ScrollControls/cjs/index.development.js +0 -2
- package/ScrollControls/cjs/index.development.v2.js +241 -0
- package/ScrollControls/cjs/index.production.js +1 -1
- package/ScrollControls/cjs/index.production.v2.js +1 -0
- package/ScrollControls/cjs/style.development.v2.css +1 -0
- package/ScrollControls/cjs/style.production.v2.css +1 -0
- package/ScrollControls/index.js +14 -2
- package/ScrollControls/package.json +1 -1
- package/SideOverlay/cjs/index.development.js +0 -2
- package/SideOverlay/cjs/index.development.v2.js +208 -0
- package/SideOverlay/cjs/index.production.js +1 -1
- package/SideOverlay/cjs/index.production.v2.js +1 -0
- package/SideOverlay/cjs/style.development.v2.css +1 -0
- package/SideOverlay/cjs/style.production.v2.css +1 -0
- package/SideOverlay/index.js +14 -2
- package/SideOverlay/package.json +1 -1
- package/SimpleSlider/cjs/index.development.js +0 -2
- package/SimpleSlider/cjs/index.development.v2.js +433 -0
- package/SimpleSlider/cjs/index.production.js +1 -1
- package/SimpleSlider/cjs/index.production.v2.js +1 -0
- package/SimpleSlider/cjs/style.development.v2.css +1 -0
- package/SimpleSlider/cjs/style.production.v2.css +1 -0
- package/SimpleSlider/index.js +14 -2
- package/SimpleSlider/package.json +1 -1
- package/Skeleton/cjs/index.development.js +0 -2
- package/Skeleton/cjs/index.development.v2.js +101 -0
- package/Skeleton/cjs/index.production.js +1 -1
- package/Skeleton/cjs/index.production.v2.js +1 -0
- package/Skeleton/cjs/style.development.v2.css +1 -0
- package/Skeleton/cjs/style.production.v2.css +1 -0
- package/Skeleton/index.js +14 -2
- package/Skeleton/package.json +1 -1
- package/Spinner/cjs/index.development.js +0 -2
- package/Spinner/cjs/index.development.v2.js +83 -0
- package/Spinner/cjs/index.production.js +1 -1
- package/Spinner/cjs/index.production.v2.js +1 -0
- package/Spinner/cjs/style.development.v2.css +1 -0
- package/Spinner/cjs/style.production.v2.css +1 -0
- package/Spinner/index.js +14 -2
- package/Spinner/package.json +1 -1
- package/Text/cjs/index.development.js +0 -2
- package/Text/cjs/index.development.v2.js +18 -0
- package/Text/cjs/index.production.js +1 -1
- package/Text/cjs/index.production.v2.js +1 -0
- package/Text/cjs/style.development.v2.css +1 -0
- package/Text/cjs/style.production.v2.css +1 -0
- package/Text/index.js +14 -2
- package/Text/package.json +1 -1
- package/TextEmoji/cjs/index.development.v2.js +94 -0
- package/TextEmoji/cjs/index.production.v2.js +1 -0
- package/TextEmoji/index.js +2 -2
- package/TextEmoji/package.json +1 -1
- package/Tooltip/cjs/index.development.js +0 -2
- package/Tooltip/cjs/index.development.v2.js +149 -0
- package/Tooltip/cjs/index.production.js +1 -1
- package/Tooltip/cjs/index.production.v2.js +1 -0
- package/Tooltip/cjs/style.development.v2.css +1 -0
- package/Tooltip/cjs/style.production.v2.css +1 -0
- package/Tooltip/index.js +14 -2
- package/Tooltip/package.json +1 -1
- package/Tumbler/cjs/index.development.js +0 -2
- package/Tumbler/cjs/index.development.v2.js +108 -0
- package/Tumbler/cjs/index.production.js +1 -1
- package/Tumbler/cjs/index.production.v2.js +1 -0
- package/Tumbler/cjs/style.development.v2.css +1 -0
- package/Tumbler/cjs/style.production.v2.css +1 -0
- package/Tumbler/index.js +14 -2
- package/Tumbler/package.json +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var ttag = require('ttag');
|
|
7
|
+
var Swipe = require('react-easy-swipe');
|
|
8
|
+
var classNames = require('classnames');
|
|
9
|
+
require('intersection-observer');
|
|
10
|
+
var Button = require('@prom-ui/core/Button');
|
|
11
|
+
|
|
12
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
+
|
|
14
|
+
function _interopNamespace(e) {
|
|
15
|
+
if (e && e.__esModule) return e;
|
|
16
|
+
var n = Object.create(null);
|
|
17
|
+
if (e) {
|
|
18
|
+
Object.keys(e).forEach(function (k) {
|
|
19
|
+
if (k !== 'default') {
|
|
20
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
21
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () { return e[k]; }
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
n["default"] = e;
|
|
29
|
+
return Object.freeze(n);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
33
|
+
var Swipe__default = /*#__PURE__*/_interopDefaultLegacy(Swipe);
|
|
34
|
+
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
35
|
+
|
|
36
|
+
/******************************************************************************
|
|
37
|
+
Copyright (c) Microsoft Corporation.
|
|
38
|
+
|
|
39
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
40
|
+
purpose with or without fee is hereby granted.
|
|
41
|
+
|
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
43
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
44
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
45
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
46
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
47
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
48
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
49
|
+
***************************************************************************** */
|
|
50
|
+
|
|
51
|
+
var __assign = function() {
|
|
52
|
+
__assign = Object.assign || function __assign(t) {
|
|
53
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
54
|
+
s = arguments[i];
|
|
55
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
56
|
+
}
|
|
57
|
+
return t;
|
|
58
|
+
};
|
|
59
|
+
return __assign.apply(this, arguments);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
function __rest(s, e) {
|
|
63
|
+
var t = {};
|
|
64
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
65
|
+
t[p] = s[p];
|
|
66
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
67
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
68
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
69
|
+
t[p[i]] = s[p[i]];
|
|
70
|
+
}
|
|
71
|
+
return t;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function __makeTemplateObject(cooked, raw) {
|
|
75
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
76
|
+
return cooked;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
var useAutoPlay = function (callback, delay) {
|
|
80
|
+
var timeout = React.useRef(null);
|
|
81
|
+
|
|
82
|
+
var stop = function () {
|
|
83
|
+
clearTimeout(timeout.current);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
var start = function () {
|
|
87
|
+
stop();
|
|
88
|
+
timeout.current = setTimeout(callback, delay);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
return [start, stop];
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
var isValidRatio = function (ratio) {
|
|
95
|
+
return !!ratio && /\d\/\d/.test(ratio);
|
|
96
|
+
};
|
|
97
|
+
var getInfiniteIndex = function (index, count) {
|
|
98
|
+
return Math.abs((index % count + count) % count);
|
|
99
|
+
};
|
|
100
|
+
var getRatioHolderStyle = function (ratio) {
|
|
101
|
+
return {
|
|
102
|
+
paddingTop: "calc(".concat(ratio.split('/').reverse().join('/'), " * 100%)")
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
var getRootStyle = function (_a) {
|
|
106
|
+
var width = _a.width,
|
|
107
|
+
height = _a.height,
|
|
108
|
+
ratio = _a.ratio,
|
|
109
|
+
style = _a.style;
|
|
110
|
+
var hasRatio = isValidRatio(ratio);
|
|
111
|
+
return __assign({
|
|
112
|
+
width: width,
|
|
113
|
+
height: hasRatio ? 'auto' : height,
|
|
114
|
+
maxWidth: hasRatio ? '100%' : 'none',
|
|
115
|
+
aspectRatio: hasRatio ? ratio : undefined
|
|
116
|
+
}, style);
|
|
117
|
+
};
|
|
118
|
+
var getTrackStyle = function (_a) {
|
|
119
|
+
var index = _a.index,
|
|
120
|
+
childrenCount = _a.childrenCount,
|
|
121
|
+
duration = _a.duration,
|
|
122
|
+
offset = _a.offset;
|
|
123
|
+
var hasOffset = typeof offset === 'number';
|
|
124
|
+
var currentOffset = hasOffset ? offset : 0;
|
|
125
|
+
return {
|
|
126
|
+
transform: "translateX(calc(".concat(index * (100 / childrenCount) * -1, "% + ").concat(currentOffset, "px))"),
|
|
127
|
+
transition: hasOffset ? undefined : "transform ".concat(duration, "ms ease"),
|
|
128
|
+
width: "".concat(childrenCount * 100, "%") // willChange: 'transform',
|
|
129
|
+
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
var css = {"root":"SimpleSlider__root___bXdCd","track":"SimpleSlider__track___igqgQ","trackItem":"SimpleSlider__trackItem___7TgGX","buttonCommon":"SimpleSlider__buttonCommon___cQvz3","buttonPrev":"SimpleSlider__buttonPrev___543BF SimpleSlider__buttonCommon___cQvz3","buttonNext":"SimpleSlider__buttonNext___uU4Gw SimpleSlider__buttonCommon___cQvz3","buttonIcon":"SimpleSlider__buttonIcon___LD9ov","showOnHoverButtons":"SimpleSlider__showOnHoverButtons___0cn-k","dots":"SimpleSlider__dots___GA591","dotsTransparent":"SimpleSlider__dotsTransparent___fybKk","dotsItem":"SimpleSlider__dotsItem___d4JnV","dotsButton":"SimpleSlider__dotsButton___UPQSI","showOnHoverDots":"SimpleSlider__showOnHoverDots___q4PLm"};
|
|
134
|
+
|
|
135
|
+
var SimpleSlider = React__namespace.forwardRef(function (_a, ref) {
|
|
136
|
+
var _b, _c;
|
|
137
|
+
|
|
138
|
+
var _d = _a.autoPlay,
|
|
139
|
+
autoPlay = _d === void 0 ? 0 : _d,
|
|
140
|
+
children = _a.children,
|
|
141
|
+
className = _a.className,
|
|
142
|
+
_e = _a.duration,
|
|
143
|
+
duration = _e === void 0 ? 500 : _e,
|
|
144
|
+
height = _a.height,
|
|
145
|
+
_f = _a.infinite,
|
|
146
|
+
infinite = _f === void 0 ? false : _f,
|
|
147
|
+
ratio = _a.ratio,
|
|
148
|
+
style = _a.style,
|
|
149
|
+
width = _a.width,
|
|
150
|
+
onChangeIndex = _a.onChangeIndex,
|
|
151
|
+
onClickDot = _a.onClickDot,
|
|
152
|
+
onClickItem = _a.onClickItem,
|
|
153
|
+
onClickButtonNext = _a.onClickButtonNext,
|
|
154
|
+
onClickButtonPrev = _a.onClickButtonPrev,
|
|
155
|
+
onSwipeNext = _a.onSwipeNext,
|
|
156
|
+
onSwipePrev = _a.onSwipePrev,
|
|
157
|
+
_g = _a.showOnHoverButtons,
|
|
158
|
+
showOnHoverButtons = _g === void 0 ? false : _g,
|
|
159
|
+
_h = _a.showOnHoverDots,
|
|
160
|
+
showOnHoverDots = _h === void 0 ? false : _h,
|
|
161
|
+
_j = _a.isDotsTransparent,
|
|
162
|
+
isDotsTransparent = _j === void 0 ? false : _j,
|
|
163
|
+
props = __rest(_a, ["autoPlay", "children", "className", "duration", "height", "infinite", "ratio", "style", "width", "onChangeIndex", "onClickDot", "onClickItem", "onClickButtonNext", "onClickButtonPrev", "onSwipeNext", "onSwipePrev", "showOnHoverButtons", "showOnHoverDots", "isDotsTransparent"]);
|
|
164
|
+
|
|
165
|
+
var refTrack = React__namespace.useRef(null);
|
|
166
|
+
var transitionRunning = React__namespace.useRef(false);
|
|
167
|
+
|
|
168
|
+
var _k = React__namespace.useState(false),
|
|
169
|
+
disableAutoPlay = _k[0],
|
|
170
|
+
setDisableAutoPlay = _k[1];
|
|
171
|
+
|
|
172
|
+
var _l = React__namespace.useState({
|
|
173
|
+
index: 0,
|
|
174
|
+
offset: undefined
|
|
175
|
+
}),
|
|
176
|
+
position = _l[0],
|
|
177
|
+
setPosition = _l[1];
|
|
178
|
+
|
|
179
|
+
var childrenCount = React__namespace.Children.count(children);
|
|
180
|
+
var childrenArray = React__namespace.Children.toArray(children);
|
|
181
|
+
var isDisablePrev = !infinite && position.index === 0;
|
|
182
|
+
var isDisableNext = !infinite && position.index === childrenCount - 1;
|
|
183
|
+
var isShowNavi = childrenCount > 1;
|
|
184
|
+
var isShowDots = childrenCount > 1;
|
|
185
|
+
var isAutoPlay = !disableAutoPlay && autoPlay > 0;
|
|
186
|
+
var prevIndex = position.index - 1;
|
|
187
|
+
var nextIndex = position.index + 1;
|
|
188
|
+
var infiniteIndex = getInfiniteIndex(position.index, childrenCount);
|
|
189
|
+
var infinitePrevIndex = getInfiniteIndex(prevIndex, childrenCount);
|
|
190
|
+
var infiniteNextIndex = getInfiniteIndex(nextIndex, childrenCount);
|
|
191
|
+
|
|
192
|
+
var handleClickButtonNext = function () {
|
|
193
|
+
if (transitionRunning.current || isDisableNext) return;
|
|
194
|
+
|
|
195
|
+
if (typeof onClickButtonNext === 'function') {
|
|
196
|
+
onClickButtonNext(infiniteNextIndex);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
setPosition({
|
|
200
|
+
index: nextIndex,
|
|
201
|
+
offset: undefined
|
|
202
|
+
});
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
var handleClickButtonPrev = function () {
|
|
206
|
+
if (transitionRunning.current || isDisablePrev) return;
|
|
207
|
+
|
|
208
|
+
if (typeof onClickButtonPrev === 'function') {
|
|
209
|
+
onClickButtonPrev(infinitePrevIndex);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
setPosition({
|
|
213
|
+
index: prevIndex,
|
|
214
|
+
offset: undefined
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
var handleClickDot = function (i) {
|
|
219
|
+
if (transitionRunning.current) return;
|
|
220
|
+
|
|
221
|
+
if (typeof onClickDot === 'function') {
|
|
222
|
+
onClickDot(i);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
setPosition({
|
|
226
|
+
index: i,
|
|
227
|
+
offset: undefined
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
var handleSwipeNext = function () {
|
|
232
|
+
if (transitionRunning.current || isDisableNext) return;
|
|
233
|
+
|
|
234
|
+
if (typeof onSwipeNext === 'function') {
|
|
235
|
+
onSwipeNext(infiniteNextIndex);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
setPosition({
|
|
239
|
+
index: nextIndex,
|
|
240
|
+
offset: undefined
|
|
241
|
+
});
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
var handleSwipePrev = function () {
|
|
245
|
+
if (transitionRunning.current || isDisablePrev) return;
|
|
246
|
+
|
|
247
|
+
if (typeof onSwipePrev === 'function') {
|
|
248
|
+
onSwipePrev(infinitePrevIndex);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
setPosition({
|
|
252
|
+
index: prevIndex,
|
|
253
|
+
offset: undefined
|
|
254
|
+
});
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
var handleSwipeMove = function (_a, event) {
|
|
258
|
+
var x = _a.x;
|
|
259
|
+
if (transitionRunning.current || event.touches && event.touches.length > 1) return;
|
|
260
|
+
var offset = x;
|
|
261
|
+
|
|
262
|
+
if (isDisablePrev && x > 0 || isDisableNext && x < 0) {
|
|
263
|
+
offset = 0;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
setPosition({
|
|
267
|
+
index: position.index,
|
|
268
|
+
offset: offset
|
|
269
|
+
});
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
var _m = useAutoPlay(function () {
|
|
273
|
+
if (transitionRunning.current || isDisableNext) return;
|
|
274
|
+
setPosition({
|
|
275
|
+
index: nextIndex,
|
|
276
|
+
offset: undefined
|
|
277
|
+
});
|
|
278
|
+
}, autoPlay),
|
|
279
|
+
startAutoPlay = _m[0],
|
|
280
|
+
stopAutoPlay = _m[1];
|
|
281
|
+
|
|
282
|
+
var handleTransitionStart = function () {
|
|
283
|
+
transitionRunning.current = true;
|
|
284
|
+
stopAutoPlay();
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
var handleTransitionEnd = function () {
|
|
288
|
+
transitionRunning.current = false;
|
|
289
|
+
|
|
290
|
+
if (isAutoPlay) {
|
|
291
|
+
startAutoPlay();
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if (!(position.index in childrenArray)) {
|
|
295
|
+
setPosition({
|
|
296
|
+
index: infiniteIndex,
|
|
297
|
+
offset: 0
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if (typeof onChangeIndex === 'function') {
|
|
302
|
+
onChangeIndex(infiniteIndex);
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
React__namespace.useEffect(function () {
|
|
307
|
+
var _a, _b;
|
|
308
|
+
|
|
309
|
+
var autoPlayObserver = new IntersectionObserver(function (entries) {
|
|
310
|
+
if (entries[0].isIntersecting) {
|
|
311
|
+
startAutoPlay();
|
|
312
|
+
} else {
|
|
313
|
+
stopAutoPlay();
|
|
314
|
+
}
|
|
315
|
+
});
|
|
316
|
+
(_a = refTrack.current) === null || _a === void 0 ? void 0 : _a.addEventListener('transitionstart', handleTransitionStart);
|
|
317
|
+
(_b = refTrack.current) === null || _b === void 0 ? void 0 : _b.addEventListener('transitionend', handleTransitionEnd);
|
|
318
|
+
|
|
319
|
+
if (isAutoPlay && refTrack.current) {
|
|
320
|
+
autoPlayObserver.observe(refTrack.current);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return function () {
|
|
324
|
+
var _a, _b;
|
|
325
|
+
|
|
326
|
+
(_a = refTrack.current) === null || _a === void 0 ? void 0 : _a.removeEventListener('transitionstart', handleTransitionStart);
|
|
327
|
+
(_b = refTrack.current) === null || _b === void 0 ? void 0 : _b.removeEventListener('transitionend', handleTransitionEnd);
|
|
328
|
+
stopAutoPlay();
|
|
329
|
+
autoPlayObserver.disconnect();
|
|
330
|
+
};
|
|
331
|
+
}, [position.index, isAutoPlay]);
|
|
332
|
+
return React__namespace.createElement(Swipe__default["default"], __assign({
|
|
333
|
+
ref: ref,
|
|
334
|
+
onSwipeLeft: handleSwipeNext,
|
|
335
|
+
onSwipeRight: handleSwipePrev,
|
|
336
|
+
onSwipeMove: handleSwipeMove,
|
|
337
|
+
className: classNames__default["default"](css.root, className, (_b = {}, _b[css.showOnHoverButtons] = showOnHoverButtons, _b[css.showOnHoverDots] = showOnHoverDots, _b)),
|
|
338
|
+
style: getRootStyle({
|
|
339
|
+
width: width,
|
|
340
|
+
height: height,
|
|
341
|
+
ratio: ratio,
|
|
342
|
+
style: style
|
|
343
|
+
}),
|
|
344
|
+
onSwipeStart: function () {
|
|
345
|
+
return setDisableAutoPlay(true);
|
|
346
|
+
},
|
|
347
|
+
onSwipeEnd: function () {
|
|
348
|
+
return setDisableAutoPlay(false);
|
|
349
|
+
},
|
|
350
|
+
onMouseEnter: function () {
|
|
351
|
+
return setDisableAutoPlay(true);
|
|
352
|
+
},
|
|
353
|
+
onMouseLeave: function () {
|
|
354
|
+
return setDisableAutoPlay(false);
|
|
355
|
+
}
|
|
356
|
+
}, props), isValidRatio(ratio) && React__namespace.createElement("div", {
|
|
357
|
+
style: getRatioHolderStyle(ratio)
|
|
358
|
+
}), React__namespace.createElement("ul", {
|
|
359
|
+
ref: refTrack,
|
|
360
|
+
className: css.track,
|
|
361
|
+
style: getTrackStyle({
|
|
362
|
+
index: infinite ? position.index + 1 : position.index,
|
|
363
|
+
childrenCount: infinite ? childrenCount + 2 : childrenCount,
|
|
364
|
+
duration: duration,
|
|
365
|
+
offset: position.offset
|
|
366
|
+
})
|
|
367
|
+
}, infinite && React__namespace.createElement("li", {
|
|
368
|
+
className: css.trackItem
|
|
369
|
+
}, childrenArray[childrenArray.length - 1]), childrenArray.map(function (child, index) {
|
|
370
|
+
return React__namespace.createElement("li", {
|
|
371
|
+
key: child.key,
|
|
372
|
+
className: css.trackItem,
|
|
373
|
+
onClick: function () {
|
|
374
|
+
if (typeof onClickItem === 'function') {
|
|
375
|
+
onClickItem(index);
|
|
376
|
+
}
|
|
377
|
+
},
|
|
378
|
+
"data-qaid": "image_slider_".concat(index)
|
|
379
|
+
}, child);
|
|
380
|
+
}), infinite && React__namespace.createElement("li", {
|
|
381
|
+
className: css.trackItem
|
|
382
|
+
}, childrenArray[0])), isShowNavi && React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement(Button.Button, {
|
|
383
|
+
type: 'button',
|
|
384
|
+
className: css.buttonPrev,
|
|
385
|
+
onClick: handleClickButtonPrev,
|
|
386
|
+
disabled: isDisablePrev,
|
|
387
|
+
"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"]))),
|
|
388
|
+
"data-qaid": 'prev_image'
|
|
389
|
+
}, React__namespace.createElement("svg", {
|
|
390
|
+
className: css.buttonIcon,
|
|
391
|
+
width: 18,
|
|
392
|
+
height: 18,
|
|
393
|
+
viewBox: '0 0 64 64',
|
|
394
|
+
xmlns: 'http://www.w3.org/2000/svg'
|
|
395
|
+
}, React__namespace.createElement("path", {
|
|
396
|
+
d: 'M41.625 60.375L16 32 41.625 3.625 48.5 10 28.375 32 48.5 54z'
|
|
397
|
+
}))), React__namespace.createElement(Button.Button, {
|
|
398
|
+
type: 'button',
|
|
399
|
+
className: css.buttonNext,
|
|
400
|
+
onClick: handleClickButtonNext,
|
|
401
|
+
disabled: isDisableNext,
|
|
402
|
+
"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"]))),
|
|
403
|
+
"data-qaid": 'next_image'
|
|
404
|
+
}, React__namespace.createElement("svg", {
|
|
405
|
+
className: css.buttonIcon,
|
|
406
|
+
width: 18,
|
|
407
|
+
height: 18,
|
|
408
|
+
viewBox: '0 0 64 64',
|
|
409
|
+
xmlns: 'http://www.w3.org/2000/svg'
|
|
410
|
+
}, React__namespace.createElement("path", {
|
|
411
|
+
d: 'M22.875 60.375L16 54l20.125-22L16 10l6.875-6.375L48.5 32z'
|
|
412
|
+
})))), isShowDots && React__namespace.createElement("ul", {
|
|
413
|
+
className: classNames__default["default"](css.dots, (_c = {}, _c[css.dotsTransparent] = isDotsTransparent, _c))
|
|
414
|
+
}, childrenArray.map(function (child, index) {
|
|
415
|
+
var viewIndex = index + 1;
|
|
416
|
+
return React__namespace.createElement("li", {
|
|
417
|
+
className: css.dotsItem,
|
|
418
|
+
key: child.key
|
|
419
|
+
}, React__namespace.createElement(Button.Button, {
|
|
420
|
+
className: css.dotsButton,
|
|
421
|
+
type: 'button',
|
|
422
|
+
onClick: function () {
|
|
423
|
+
return handleClickDot(index);
|
|
424
|
+
},
|
|
425
|
+
disabled: index === infiniteIndex,
|
|
426
|
+
"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),
|
|
427
|
+
"data-qaid": "view_image_".concat(viewIndex)
|
|
428
|
+
}, viewIndex));
|
|
429
|
+
})));
|
|
430
|
+
});
|
|
431
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
432
|
+
|
|
433
|
+
exports.SimpleSlider = SimpleSlider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("ttag"),n=require("react-easy-swipe"),r=require("classnames");require("intersection-observer");var i=require("@prom-ui/core/Button");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=a(e),u=o(n),s=o(r),l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)};function f(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var d,v,p,m=function(e){return!!e&&/\d\/\d/.test(e)},h=function(e,t){return Math.abs((e%t+t)%t)},y=function(e){return{paddingTop:"calc(".concat(e.split("/").reverse().join("/")," * 100%)")}},w=function(e){var t=e.width,n=e.height,r=e.ratio,i=e.style,o=m(r);return l({width:t,height:o?"auto":n,maxWidth:o?"100%":"none",aspectRatio:o?r:void 0},i)},x=function(e){var t=e.index,n=e.childrenCount,r=e.duration,i=e.offset,o="number"==typeof i,a=o?i:0;return{transform:"translateX(calc(".concat(t*(100/n)*-1,"% + ").concat(a,"px))"),transition:o?void 0:"transform ".concat(r,"ms ease"),width:"".concat(100*n,"%")}},b="WuTIM",g="G8BYu",E="_94Eq7",O="UqTOk I5yQD",N="BbLNv I5yQD",k="_89h6n",C="yssoj",j="E7g4J",S="v-ZWk",P="cbWCu",B="_7N4yb",
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("ttag"),n=require("react-easy-swipe"),r=require("classnames");require("intersection-observer");var i=require("@prom-ui/core/Button");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=a(e),u=o(n),s=o(r),l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)};function f(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var d,v,p,m=function(e){return!!e&&/\d\/\d/.test(e)},h=function(e,t){return Math.abs((e%t+t)%t)},y=function(e){return{paddingTop:"calc(".concat(e.split("/").reverse().join("/")," * 100%)")}},w=function(e){var t=e.width,n=e.height,r=e.ratio,i=e.style,o=m(r);return l({width:t,height:o?"auto":n,maxWidth:o?"100%":"none",aspectRatio:o?r:void 0},i)},x=function(e){var t=e.index,n=e.childrenCount,r=e.duration,i=e.offset,o="number"==typeof i,a=o?i:0;return{transform:"translateX(calc(".concat(t*(100/n)*-1,"% + ").concat(a,"px))"),transition:o?void 0:"transform ".concat(r,"ms ease"),width:"".concat(100*n,"%")}},b="WuTIM",g="G8BYu",E="_94Eq7",O="UqTOk I5yQD",N="BbLNv I5yQD",k="_89h6n",C="yssoj",j="E7g4J",S="v-ZWk",P="cbWCu",B="_7N4yb",_="ig5DV",q=c.forwardRef((function(n,r){var o,a,q,L,D,I,M=n.autoPlay,T=void 0===M?0:M,R=n.children,H=n.className,W=n.duration,z=void 0===W?500:W,Q=n.height,A=n.infinite,F=void 0!==A&&A,G=n.ratio,J=n.style,U=n.width,V=n.onChangeIndex,X=n.onClickDot,Y=n.onClickItem,Z=n.onClickButtonNext,K=n.onClickButtonPrev,$=n.onSwipeNext,ee=n.onSwipePrev,te=n.showOnHoverButtons,ne=void 0!==te&&te,re=n.showOnHoverDots,ie=void 0!==re&&re,oe=n.isDotsTransparent,ae=void 0!==oe&&oe,ce=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(n,["autoPlay","children","className","duration","height","infinite","ratio","style","width","onChangeIndex","onClickDot","onClickItem","onClickButtonNext","onClickButtonPrev","onSwipeNext","onSwipePrev","showOnHoverButtons","showOnHoverDots","isDotsTransparent"]),ue=c.useRef(null),se=c.useRef(!1),le=c.useState(!1),fe=le[0],de=le[1],ve=c.useState({index:0,offset:void 0}),pe=ve[0],me=ve[1],he=c.Children.count(R),ye=c.Children.toArray(R),we=!F&&0===pe.index,xe=!F&&pe.index===he-1,be=he>1,ge=he>1,Ee=!fe&&T>0,Oe=pe.index-1,Ne=pe.index+1,ke=h(pe.index,he),Ce=h(Oe,he),je=h(Ne,he),Se=(q=function(){se.current||xe||me({index:Ne,offset:void 0})},L=T,D=e.useRef(null),[function(){I(),D.current=setTimeout(q,L)},I=function(){clearTimeout(D.current)}]),Pe=Se[0],Be=Se[1],_e=function(){se.current=!0,Be()},qe=function(){se.current=!1,Ee&&Pe(),pe.index in ye||me({index:ke,offset:0}),"function"==typeof V&&V(ke)};return c.useEffect((function(){var e,t,n=new IntersectionObserver((function(e){e[0].isIntersecting?Pe():Be()}));return null===(e=ue.current)||void 0===e||e.addEventListener("transitionstart",_e),null===(t=ue.current)||void 0===t||t.addEventListener("transitionend",qe),Ee&&ue.current&&n.observe(ue.current),function(){var e,t;null===(e=ue.current)||void 0===e||e.removeEventListener("transitionstart",_e),null===(t=ue.current)||void 0===t||t.removeEventListener("transitionend",qe),Be(),n.disconnect()}}),[pe.index,Ee]),c.createElement(u.default,l({ref:r,onSwipeLeft:function(){se.current||xe||("function"==typeof $&&$(je),me({index:Ne,offset:void 0}))},onSwipeRight:function(){se.current||we||("function"==typeof ee&&ee(Ce),me({index:Oe,offset:void 0}))},onSwipeMove:function(e,t){var n=e.x;if(!(se.current||t.touches&&t.touches.length>1)){var r=n;(we&&n>0||xe&&n<0)&&(r=0),me({index:pe.index,offset:r})}},className:s.default(b,H,(o={},o[C]=ne,o[_]=ie,o)),style:w({width:U,height:Q,ratio:G,style:J}),onSwipeStart:function(){return de(!0)},onSwipeEnd:function(){return de(!1)},onMouseEnter:function(){return de(!0)},onMouseLeave:function(){return de(!1)}},ce),m(G)&&c.createElement("div",{style:y(G)}),c.createElement("ul",{ref:ue,className:g,style:x({index:F?pe.index+1:pe.index,childrenCount:F?he+2:he,duration:z,offset:pe.offset})},F&&c.createElement("li",{className:E},ye[ye.length-1]),ye.map((function(e,t){return c.createElement("li",{key:e.key,className:E,onClick:function(){"function"==typeof Y&&Y(t)},"data-qaid":"image_slider_".concat(t)},e)})),F&&c.createElement("li",{className:E},ye[0])),be&&c.createElement(c.Fragment,null,c.createElement(i.Button,{type:"button",className:O,onClick:function(){se.current||we||("function"==typeof K&&K(Ce),me({index:Oe,offset:void 0}))},disabled:we,"aria-label":t.t(d||(d=f(["Показать предыдущий баннер"],["Показать предыдущий баннер"]))),"data-qaid":"prev_image"},c.createElement("svg",{className:k,width:18,height:18,viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg"},c.createElement("path",{d:"M41.625 60.375L16 32 41.625 3.625 48.5 10 28.375 32 48.5 54z"}))),c.createElement(i.Button,{type:"button",className:N,onClick:function(){se.current||xe||("function"==typeof Z&&Z(je),me({index:Ne,offset:void 0}))},disabled:xe,"aria-label":t.t(v||(v=f(["Показать следующий баннер"],["Показать следующий баннер"]))),"data-qaid":"next_image"},c.createElement("svg",{className:k,width:18,height:18,viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg"},c.createElement("path",{d:"M22.875 60.375L16 54l20.125-22L16 10l6.875-6.375L48.5 32z"})))),ge&&c.createElement("ul",{className:s.default(j,(a={},a[S]=ae,a))},ye.map((function(e,n){var r=n+1;return c.createElement("li",{className:P,key:e.key},c.createElement(i.Button,{className:B,type:"button",onClick:function(){return e=n,void(se.current||("function"==typeof X&&X(e),me({index:e,offset:void 0})));var e},disabled:n===ke,"aria-label":t.t(p||(p=f(["Показать баннер номер ",""],["Показать баннер номер ",""])),r),"data-qaid":"view_image_".concat(r)},r))}))))}));exports.SimpleSlider=q;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("ttag"),n=require("react-easy-swipe"),r=require("classnames");require("intersection-observer");var i=require("@prom-ui/core/Button");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function a(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var c=a(e),u=o(n),s=o(r),l=function(){return l=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},l.apply(this,arguments)};function f(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var d,v,p,m=function(e){return!!e&&/\d\/\d/.test(e)},h=function(e,t){return Math.abs((e%t+t)%t)},y=function(e){return{paddingTop:"calc(".concat(e.split("/").reverse().join("/")," * 100%)")}},w=function(e){var t=e.width,n=e.height,r=e.ratio,i=e.style,o=m(r);return l({width:t,height:o?"auto":n,maxWidth:o?"100%":"none",aspectRatio:o?r:void 0},i)},x=function(e){var t=e.index,n=e.childrenCount,r=e.duration,i=e.offset,o="number"==typeof i,a=o?i:0;return{transform:"translateX(calc(".concat(t*(100/n)*-1,"% + ").concat(a,"px))"),transition:o?void 0:"transform ".concat(r,"ms ease"),width:"".concat(100*n,"%")}},g="bXdCd",b="igqgQ",O="_7TgGX",E="_543BF cQvz3",k="uU4Gw cQvz3",C="LD9ov",N="_0cn-k",P="GA591",S="fybKk",j="d4JnV",B="UPQSI",_="q4PLm",q=c.forwardRef((function(n,r){var o,a,q,L,D,I,M=n.autoPlay,R=void 0===M?0:M,T=n.children,z=n.className,H=n.duration,Q=void 0===H?500:H,G=n.height,X=n.infinite,A=void 0!==X&&X,F=n.ratio,U=n.style,J=n.width,K=n.onChangeIndex,V=n.onClickDot,W=n.onClickItem,Y=n.onClickButtonNext,Z=n.onClickButtonPrev,$=n.onSwipeNext,ee=n.onSwipePrev,te=n.showOnHoverButtons,ne=void 0!==te&&te,re=n.showOnHoverDots,ie=void 0!==re&&re,oe=n.isDotsTransparent,ae=void 0!==oe&&oe,ce=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(n,["autoPlay","children","className","duration","height","infinite","ratio","style","width","onChangeIndex","onClickDot","onClickItem","onClickButtonNext","onClickButtonPrev","onSwipeNext","onSwipePrev","showOnHoverButtons","showOnHoverDots","isDotsTransparent"]),ue=c.useRef(null),se=c.useRef(!1),le=c.useState(!1),fe=le[0],de=le[1],ve=c.useState({index:0,offset:void 0}),pe=ve[0],me=ve[1],he=c.Children.count(T),ye=c.Children.toArray(T),we=!A&&0===pe.index,xe=!A&&pe.index===he-1,ge=he>1,be=he>1,Oe=!fe&&R>0,Ee=pe.index-1,ke=pe.index+1,Ce=h(pe.index,he),Ne=h(Ee,he),Pe=h(ke,he),Se=(q=function(){se.current||xe||me({index:ke,offset:void 0})},L=R,D=e.useRef(null),[function(){I(),D.current=setTimeout(q,L)},I=function(){clearTimeout(D.current)}]),je=Se[0],Be=Se[1],_e=function(){se.current=!0,Be()},qe=function(){se.current=!1,Oe&&je(),pe.index in ye||me({index:Ce,offset:0}),"function"==typeof K&&K(Ce)};return c.useEffect((function(){var e,t,n=new IntersectionObserver((function(e){e[0].isIntersecting?je():Be()}));return null===(e=ue.current)||void 0===e||e.addEventListener("transitionstart",_e),null===(t=ue.current)||void 0===t||t.addEventListener("transitionend",qe),Oe&&ue.current&&n.observe(ue.current),function(){var e,t;null===(e=ue.current)||void 0===e||e.removeEventListener("transitionstart",_e),null===(t=ue.current)||void 0===t||t.removeEventListener("transitionend",qe),Be(),n.disconnect()}}),[pe.index,Oe]),c.createElement(u.default,l({ref:r,onSwipeLeft:function(){se.current||xe||("function"==typeof $&&$(Pe),me({index:ke,offset:void 0}))},onSwipeRight:function(){se.current||we||("function"==typeof ee&&ee(Ne),me({index:Ee,offset:void 0}))},onSwipeMove:function(e,t){var n=e.x;if(!(se.current||t.touches&&t.touches.length>1)){var r=n;(we&&n>0||xe&&n<0)&&(r=0),me({index:pe.index,offset:r})}},className:s.default(g,z,(o={},o[N]=ne,o[_]=ie,o)),style:w({width:J,height:G,ratio:F,style:U}),onSwipeStart:function(){return de(!0)},onSwipeEnd:function(){return de(!1)},onMouseEnter:function(){return de(!0)},onMouseLeave:function(){return de(!1)}},ce),m(F)&&c.createElement("div",{style:y(F)}),c.createElement("ul",{ref:ue,className:b,style:x({index:A?pe.index+1:pe.index,childrenCount:A?he+2:he,duration:Q,offset:pe.offset})},A&&c.createElement("li",{className:O},ye[ye.length-1]),ye.map((function(e,t){return c.createElement("li",{key:e.key,className:O,onClick:function(){"function"==typeof W&&W(t)},"data-qaid":"image_slider_".concat(t)},e)})),A&&c.createElement("li",{className:O},ye[0])),ge&&c.createElement(c.Fragment,null,c.createElement(i.Button,{type:"button",className:E,onClick:function(){se.current||we||("function"==typeof Z&&Z(Ne),me({index:Ee,offset:void 0}))},disabled:we,"aria-label":t.t(d||(d=f(["Показать предыдущий баннер"],["Показать предыдущий баннер"]))),"data-qaid":"prev_image"},c.createElement("svg",{className:C,width:18,height:18,viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg"},c.createElement("path",{d:"M41.625 60.375L16 32 41.625 3.625 48.5 10 28.375 32 48.5 54z"}))),c.createElement(i.Button,{type:"button",className:k,onClick:function(){se.current||xe||("function"==typeof Y&&Y(Pe),me({index:ke,offset:void 0}))},disabled:xe,"aria-label":t.t(v||(v=f(["Показать следующий баннер"],["Показать следующий баннер"]))),"data-qaid":"next_image"},c.createElement("svg",{className:C,width:18,height:18,viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg"},c.createElement("path",{d:"M22.875 60.375L16 54l20.125-22L16 10l6.875-6.375L48.5 32z"})))),be&&c.createElement("ul",{className:s.default(P,(a={},a[S]=ae,a))},ye.map((function(e,n){var r=n+1;return c.createElement("li",{className:j,key:e.key},c.createElement(i.Button,{className:B,type:"button",onClick:function(){return e=n,void(se.current||("function"==typeof V&&V(e),me({index:e,offset:void 0})));var e},disabled:n===Ce,"aria-label":t.t(p||(p=f(["Показать баннер номер ",""],["Показать баннер номер ",""])),r),"data-qaid":"view_image_".concat(r)},r))}))))}));exports.SimpleSlider=q;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.SimpleSlider__root___bXdCd{position:relative;overflow:hidden;height:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.SimpleSlider__track___igqgQ{position:absolute;left:0;top:0;height:100%;list-style:none;padding:0;margin:0;width:100%;display:flex;flex-wrap:nowrap}.SimpleSlider__trackItem___7TgGX{position:relative;display:block;flex:1;min-width:0}.SimpleSlider__buttonCommon___cQvz3{position:absolute;top:50%;transform:translateY(-50%);font-weight:400;border:0;border-radius:4px;background:var(--white);box-shadow:0 0 10px rgba(0,0,0,.08);padding:0;width:30px;height:66px;max-height:70%}.SimpleSlider__buttonCommon___cQvz3:disabled{opacity:.3;pointer-events:auto}.SimpleSlider__buttonCommon___cQvz3:active{background:var(--black-200)}.SimpleSlider__buttonPrev___543BF{left:0;margin-left:8px}.SimpleSlider__buttonNext___uU4Gw{right:0;margin-right:8px}.SimpleSlider__buttonIcon___LD9ov{fill:currentColor}.SimpleSlider__showOnHoverButtons___0cn-k .SimpleSlider__buttonNext___uU4Gw{right:-40px}.SimpleSlider__showOnHoverButtons___0cn-k .SimpleSlider__buttonPrev___543BF{left:-40px}.SimpleSlider__dots___GA591{position:absolute;left:50%;bottom:0;transform:translateX(-50%);display:flex;align-items:center;list-style:none;padding:4px 8px;margin:0 0 8px;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.08);transition:bottom 150ms ease-in-out}.SimpleSlider__dots___GA591:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:inherit;background:var(--white)}.SimpleSlider__dotsTransparent___fybKk:before{opacity:.5}.SimpleSlider__dotsItem___d4JnV{display:block;position:relative}.SimpleSlider__dotsItem___d4JnV+.SimpleSlider__dotsItem___d4JnV{margin-left:6px}.SimpleSlider__dotsButton___UPQSI{display:block;padding:0;width:6px;height:6px;border-radius:50%;font-size:0;background:var(--black-400);transition:none}.SimpleSlider__dotsButton___UPQSI:hover{background:var(--black-500)}.SimpleSlider__dotsButton___UPQSI:disabled{background:var(--yellow-500)}.SimpleSlider__showOnHoverDots___q4PLm .SimpleSlider__dots___GA591{bottom:-24px}@media (hover:hover){.SimpleSlider__showOnHoverButtons___0cn-k:hover .SimpleSlider__buttonNext___uU4Gw{right:0}.SimpleSlider__showOnHoverButtons___0cn-k:hover .SimpleSlider__buttonPrev___543BF{left:0}.SimpleSlider__showOnHoverDots___q4PLm:hover .SimpleSlider__dots___GA591{bottom:0}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.bXdCd{position:relative;overflow:hidden;height:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none}.igqgQ{position:absolute;left:0;top:0;height:100%;list-style:none;padding:0;margin:0;width:100%;display:flex;flex-wrap:nowrap}._7TgGX{position:relative;display:block;flex:1;min-width:0}.cQvz3{position:absolute;top:50%;transform:translateY(-50%);font-weight:400;border:0;border-radius:4px;background:var(--white);box-shadow:0 0 10px rgba(0,0,0,.08);padding:0;width:30px;height:66px;max-height:70%}.cQvz3:disabled{opacity:.3;pointer-events:auto}.cQvz3:active{background:var(--black-200)}._543BF{left:0;margin-left:8px}.uU4Gw{right:0;margin-right:8px}.LD9ov{fill:currentColor}._0cn-k .uU4Gw{right:-40px}._0cn-k ._543BF{left:-40px}.GA591{position:absolute;left:50%;bottom:0;transform:translateX(-50%);display:flex;align-items:center;list-style:none;padding:4px 8px;margin:0 0 8px;border-radius:8px;box-shadow:0 0 10px rgba(0,0,0,.08);transition:bottom 150ms ease-in-out}.GA591:before{content:"";position:absolute;top:0;left:0;width:100%;height:100%;border-radius:inherit;background:var(--white)}.fybKk:before{opacity:.5}.d4JnV{display:block;position:relative}.d4JnV+.d4JnV{margin-left:6px}.UPQSI{display:block;padding:0;width:6px;height:6px;border-radius:50%;font-size:0;background:var(--black-400);transition:none}.UPQSI:hover{background:var(--black-500)}.UPQSI:disabled{background:var(--yellow-500)}.q4PLm .GA591{bottom:-24px}@media (hover:hover){._0cn-k:hover .uU4Gw{right:0}._0cn-k:hover ._543BF{left:0}.q4PLm:hover .GA591{bottom:0}}
|
package/SimpleSlider/index.js
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
if (process.env.NODE_ENV === 'production') {
|
|
4
|
-
|
|
4
|
+
if (process.env.PROM_UI_CSS_HASH === 'v2') {
|
|
5
|
+
module.exports = require('./cjs/index.production.v2.js');
|
|
6
|
+
require('./cjs/style.production.v2.css');
|
|
7
|
+
} else {
|
|
8
|
+
module.exports = require('./cjs/index.production.js');
|
|
9
|
+
require('./cjs/style.production.css');
|
|
10
|
+
}
|
|
5
11
|
} else {
|
|
6
|
-
|
|
12
|
+
if (process.env.PROM_UI_CSS_HASH === 'v2') {
|
|
13
|
+
module.exports = require('./cjs/index.development.v2.js');
|
|
14
|
+
require('./cjs/style.development.v2.css');
|
|
15
|
+
} else {
|
|
16
|
+
module.exports = require('./cjs/index.development.js');
|
|
17
|
+
require('./cjs/style.development.css');
|
|
18
|
+
}
|
|
7
19
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
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___k6rop","ek-skeleton_theme_grey":"Skeleton__ek-skeleton_theme_grey___vl5ae","skeleton-keyframes-wave":"Skeleton__skeleton-keyframes-wave___kzrO0","ek-skeleton_theme_black-100":"Skeleton__ek-skeleton_theme_black-100___eJWcz","ek-skeleton_theme_white":"Skeleton__ek-skeleton_theme_white___PCwFG","ek-skeleton_variant_text":"Skeleton__ek-skeleton_variant_text___NbT89","ek-skeleton_variant_circle":"Skeleton__ek-skeleton_variant_circle___SlAh0","ek-skeleton_variant_square":"Skeleton__ek-skeleton_variant_square___7p339","ek-skeleton_variant_rect":"Skeleton__ek-skeleton_variant_rect___BP9h-","ek-skeleton_align_left":"Skeleton__ek-skeleton_align_left___TbAuG","ek-skeleton_align_center":"Skeleton__ek-skeleton_align_center___De09W","ek-skeleton_align_right":"Skeleton__ek-skeleton_align_right___C-QUn","ek-skeleton_opacity_0":"Skeleton__ek-skeleton_opacity_0___BV48x","ek-skeleton_opacity_10":"Skeleton__ek-skeleton_opacity_10___oVBvx","ek-skeleton_opacity_20":"Skeleton__ek-skeleton_opacity_20___F--5F","ek-skeleton_opacity_30":"Skeleton__ek-skeleton_opacity_30___rwtgY","ek-skeleton_opacity_40":"Skeleton__ek-skeleton_opacity_40___iR-d8","ek-skeleton_opacity_50":"Skeleton__ek-skeleton_opacity_50___r6goB","ek-skeleton_opacity_60":"Skeleton__ek-skeleton_opacity_60___-DW2y","ek-skeleton_opacity_70":"Skeleton__ek-skeleton_opacity_70___zqdBc","ek-skeleton_opacity_80":"Skeleton__ek-skeleton_opacity_80___Vc9gU","ek-skeleton_opacity_90":"Skeleton__ek-skeleton_opacity_90___t9rT-","ek-skeleton_opacity_100":"Skeleton__ek-skeleton_opacity_100___lw65w"};
|
|
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;
|
|
@@ -1 +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,
|
|
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,k=e.opacity,c=e.style,s=e.theme,_=void 0===s?"grey":s,y=e.variant,f=void 0===y?"text":y,p=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:p},c)}),[l,p,c]);return o.createElement(a,r({"skeleton-align":i,"skeleton-theme":_,"skeleton-variant":f,"skeleton-opacity":k,style:h},u,{ref:t}))}));exports.Skeleton=i;
|