@prom-ui/core 0.0.24 → 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/cjs/index.development.js +60 -0
- package/Media/cjs/index.production.js +1 -0
- package/Media/index.d.ts +8 -11
- package/Media/index.js +5 -73
- package/Media/package.json +1 -1
- package/Media/useMedia.d.ts +7 -0
- package/OutsideClick/cjs/index.development.js +84 -0
- 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 +2 -2
- package/SafeQuery/index.d.ts +7 -4
- package/SafeQuery/index.js +4 -173
- package/SafeQuery/package.json +1 -1
- 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 +7 -10
- 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/Media/context.d.ts +0 -8
- package/Picture/style.css +0 -1426
- package/PortableOverlay/style.css +0 -44
- package/Rating/style.css +0 -26
- package/SafeQuery/style.css +0 -4
- 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/Tumbler/style.css +0 -118
package/SafeQuery/index.js
CHANGED
|
@@ -1,176 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var components = require('@apollo/client/react/components');
|
|
8
|
-
var errcatch = require('@evo/errcatch');
|
|
9
|
-
var Box = require('@prom-ui/core/Box');
|
|
10
|
-
var Button = require('@prom-ui/core/Button');
|
|
11
|
-
var Text = require('@prom-ui/core/Text');
|
|
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
|
-
|
|
18
|
-
/******************************************************************************
|
|
19
|
-
Copyright (c) Microsoft Corporation.
|
|
20
|
-
|
|
21
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
22
|
-
purpose with or without fee is hereby granted.
|
|
23
|
-
|
|
24
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
25
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
26
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
27
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
28
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
29
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
30
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
31
|
-
***************************************************************************** */
|
|
32
|
-
|
|
33
|
-
var __assign = function() {
|
|
34
|
-
__assign = Object.assign || function __assign(t) {
|
|
35
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
36
|
-
s = arguments[i];
|
|
37
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
38
|
-
}
|
|
39
|
-
return t;
|
|
40
|
-
};
|
|
41
|
-
return __assign.apply(this, arguments);
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
function __rest(s, e) {
|
|
45
|
-
var t = {};
|
|
46
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
47
|
-
t[p] = s[p];
|
|
48
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
49
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
50
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
51
|
-
t[p[i]] = s[p[i]];
|
|
52
|
-
}
|
|
53
|
-
return t;
|
|
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');
|
|
54
7
|
}
|
|
55
|
-
|
|
56
|
-
var css = {"root":"SafeQuery__root___RWb3q"};
|
|
57
|
-
|
|
58
|
-
var SafeQueryError = function (_a) {
|
|
59
|
-
var componentErrorName = _a.componentErrorName,
|
|
60
|
-
onReload = _a.onReload;
|
|
61
|
-
|
|
62
|
-
var _b = React.useState(false),
|
|
63
|
-
isHidden = _b[0],
|
|
64
|
-
setHidden = _b[1];
|
|
65
|
-
|
|
66
|
-
if (isHidden) {
|
|
67
|
-
return null;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
71
|
-
if (typeof window === 'undefined') return null;
|
|
72
|
-
return React__default["default"].createElement(Box.Box, {
|
|
73
|
-
className: css.root,
|
|
74
|
-
"box-background": 'red-500',
|
|
75
|
-
"box-padding": ['s m', 'm@large l@large'],
|
|
76
|
-
"box-position": 'relative',
|
|
77
|
-
"box-round": 'm',
|
|
78
|
-
"data-qaid": 'err_catch_trace'
|
|
79
|
-
}, React__default["default"].createElement(Box.Box, {
|
|
80
|
-
"box-margin-right": '5xl'
|
|
81
|
-
}, React__default["default"].createElement(Text.Text, {
|
|
82
|
-
"text-color": 'white'
|
|
83
|
-
}, "\u0412\u043E\u0437\u043D\u0438\u043A\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430:", ' ', React__default["default"].createElement(Text.Text, {
|
|
84
|
-
"text-weight": 'bold',
|
|
85
|
-
style: {
|
|
86
|
-
fontFamily: 'Consolas, "Liberation Mono", Menlo, monospace',
|
|
87
|
-
userSelect: 'all'
|
|
88
|
-
}
|
|
89
|
-
}, componentErrorName))), React__default["default"].createElement(Box.Box, {
|
|
90
|
-
"box-position": 'absolute center-right',
|
|
91
|
-
"box-margin-right": 's'
|
|
92
|
-
}, React__default["default"].createElement(Button.Button, {
|
|
93
|
-
"button-padding": 'xxs',
|
|
94
|
-
"button-theme": 'white-inherit',
|
|
95
|
-
onClick: onReload,
|
|
96
|
-
title: '\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C'
|
|
97
|
-
}, React__default["default"].createElement("svg", {
|
|
98
|
-
xmlns: 'http://www.w3.org/2000/svg',
|
|
99
|
-
viewBox: '0 0 18 18',
|
|
100
|
-
width: 18,
|
|
101
|
-
height: 18
|
|
102
|
-
}, React__default["default"].createElement("path", {
|
|
103
|
-
fill: '#fff',
|
|
104
|
-
d: 'M9 13.5c-2.49 0-4.5-2.01-4.5-4.5S6.51 4.5 9 4.5c1.24\n 0 2.36.52 3.17 1.33L10 8h5V3l-1.76 1.76C12.15 3.68 10.66\n 3 9 3 5.69 3 3.01 5.69 3.01 9S5.69 15 9 15c2.97 0\n 5.43-2.16 5.9-5h-1.52c-.46 2-2.24 3.5-4.38 3.5z'
|
|
105
|
-
}))), React__default["default"].createElement(Button.Button, {
|
|
106
|
-
"button-padding": 'xxs',
|
|
107
|
-
"button-theme": 'white-inherit',
|
|
108
|
-
onClick: function () {
|
|
109
|
-
return setHidden(true);
|
|
110
|
-
},
|
|
111
|
-
title: '\u0421\u043A\u0440\u044B\u0442\u044C'
|
|
112
|
-
}, React__default["default"].createElement("svg", {
|
|
113
|
-
xmlns: 'http://www.w3.org/2000/svg',
|
|
114
|
-
viewBox: '0 0 24 24',
|
|
115
|
-
width: 18,
|
|
116
|
-
height: 18
|
|
117
|
-
}, React__default["default"].createElement("path", {
|
|
118
|
-
fill: '#fff',
|
|
119
|
-
d: 'M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5\n 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z'
|
|
120
|
-
})))));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return null;
|
|
124
|
-
};
|
|
125
|
-
SafeQueryError.propTypes = {
|
|
126
|
-
componentErrorName: PropTypes__default["default"].string.isRequired,
|
|
127
|
-
onReload: PropTypes__default["default"].func.isRequired
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
var SafeQuery = function (_a) {
|
|
131
|
-
var _b = _a.componentErrorName,
|
|
132
|
-
componentErrorName = _b === void 0 ? 'SafeQuery' : _b,
|
|
133
|
-
children = _a.children,
|
|
134
|
-
props = __rest(_a, ["componentErrorName", "children"]);
|
|
135
|
-
|
|
136
|
-
var _c = React.useState(false),
|
|
137
|
-
isReload = _c[0],
|
|
138
|
-
setReload = _c[1];
|
|
139
|
-
|
|
140
|
-
React.useEffect(function () {
|
|
141
|
-
if (isReload) {
|
|
142
|
-
setReload(false);
|
|
143
|
-
}
|
|
144
|
-
}, [isReload]);
|
|
145
|
-
|
|
146
|
-
if (isReload) {
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
var errorComponent = React__default["default"].createElement(SafeQueryError, {
|
|
151
|
-
componentErrorName: componentErrorName,
|
|
152
|
-
onReload: function () {
|
|
153
|
-
return setReload(true);
|
|
154
|
-
}
|
|
155
|
-
});
|
|
156
|
-
return React__default["default"].createElement(errcatch.ErrCatch, {
|
|
157
|
-
name: componentErrorName,
|
|
158
|
-
errorComponent: errorComponent
|
|
159
|
-
}, React__default["default"].createElement(components.Query, __assign({}, props), function (queryResult) {
|
|
160
|
-
var error = queryResult.error;
|
|
161
|
-
if (error) throw error;
|
|
162
|
-
return children(queryResult);
|
|
163
|
-
}));
|
|
164
|
-
}; // SafeQuery.defaultProps = {
|
|
165
|
-
// componentErrorName: 'SafeQuery',
|
|
166
|
-
// };
|
|
167
|
-
|
|
168
|
-
SafeQuery.propTypes = {
|
|
169
|
-
/** Название компонента в тексте с ошибкой */
|
|
170
|
-
componentErrorName: PropTypes__default["default"].string // children: PropTypes.func.isRequired,
|
|
171
|
-
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
exports.SafeQuery = SafeQuery;
|
|
175
|
-
|
|
176
|
-
require('./style.css');
|
package/SafeQuery/package.json
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var evokit = require('evokit');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var evokit__namespace = /*#__PURE__*/_interopNamespace(evokit);
|
|
26
|
+
|
|
27
|
+
var css = {"ek-scroll":"Scroll__ek-scroll___m6Vr5","ek-scroll__item":"Scroll__ek-scroll__item___bfetG","ek-scroll__item_blackhole_width-fit-content":"Scroll__ek-scroll__item_blackhole_width-fit-content___k-fNo","ek-scroll__item_blackhole_width-max-content":"Scroll__ek-scroll__item_blackhole_width-max-content___s8gGl","ek-scroll_padding_xxs":"Scroll__ek-scroll_padding_xxs___9vZpV","ek-scroll_padding_xs":"Scroll__ek-scroll_padding_xs___L5kMA","ek-scroll_padding_s":"Scroll__ek-scroll_padding_s___Nr3Ig","ek-scroll_padding_m":"Scroll__ek-scroll_padding_m___hcRCz","ek-scroll_padding_l":"Scroll__ek-scroll_padding_l___SKeiS","ek-scroll_padding_xl":"Scroll__ek-scroll_padding_xl___MG4J-","ek-scroll_padding_xxl":"Scroll__ek-scroll_padding_xxl___m8ou2","ek-scroll_padding_3xl":"Scroll__ek-scroll_padding_3xl___xy72W","ek-scroll_padding_4xl":"Scroll__ek-scroll_padding_4xl___gzW-I","ek-scroll_padding_5xl":"Scroll__ek-scroll_padding_5xl___JErmt","ek-scroll_column_1":"Scroll__ek-scroll_column_1___n5mTi","ek-scroll_column_2":"Scroll__ek-scroll_column_2___GqdmF","ek-scroll_column_3":"Scroll__ek-scroll_column_3___DKZCp","ek-scroll_column_4":"Scroll__ek-scroll_column_4___-Nf-L","ek-scroll_column_5":"Scroll__ek-scroll_column_5___OxDq-","ek-scroll_column_6":"Scroll__ek-scroll_column_6___wP8Pu","ek-scroll_column_7":"Scroll__ek-scroll_column_7___-ZDSB","ek-scroll_column_8":"Scroll__ek-scroll_column_8___PnnsU","ek-scroll_column_9":"Scroll__ek-scroll_column_9___DDqgb","ek-scroll_column_10":"Scroll__ek-scroll_column_10___Hh-uZ","ek-scroll_gap_xxs":"Scroll__ek-scroll_gap_xxs___15vfK","ek-scroll_gap_xs":"Scroll__ek-scroll_gap_xs___Kvr2J","ek-scroll_gap_s":"Scroll__ek-scroll_gap_s___71-or","ek-scroll_gap_m":"Scroll__ek-scroll_gap_m___glUvB","ek-scroll_gap_l":"Scroll__ek-scroll_gap_l___pQC7Z","ek-scroll_gap_xl":"Scroll__ek-scroll_gap_xl___L1iAD","ek-scroll_gap_xxl":"Scroll__ek-scroll_gap_xxl___wVNm-","ek-scroll_gap_3xl":"Scroll__ek-scroll_gap_3xl___4tQXK","ek-scroll_gap_4xl":"Scroll__ek-scroll_gap_4xl___1-5dw","ek-scroll_gap_5xl":"Scroll__ek-scroll_gap_5xl___ym2qM","ek-scroll_bar_none":"Scroll__ek-scroll_bar_none___c1gVV","ek-scroll_bar_auto":"Scroll__ek-scroll_bar_auto___-TbaH","ek-scroll_align_normal":"Scroll__ek-scroll_align_normal___zoDjM","ek-scroll_align_start":"Scroll__ek-scroll_align_start___4mACC","ek-scroll_align_center":"Scroll__ek-scroll_align_center___3PWHW","ek-scroll_align_end":"Scroll__ek-scroll_align_end___AwLLA"};
|
|
28
|
+
|
|
29
|
+
var Scroll = evokit__namespace.createBlock('ul', 'scroll', ['align', 'bar', 'column', 'gap', 'padding'], {
|
|
30
|
+
css: css
|
|
31
|
+
});
|
|
32
|
+
var ScrollItem = evokit__namespace.createBlock('li', 'scroll__item', [], {
|
|
33
|
+
css: css
|
|
34
|
+
});
|
|
35
|
+
Scroll.Item = ScrollItem;
|
|
36
|
+
|
|
37
|
+
exports.Scroll = Scroll;
|
|
38
|
+
exports.ScrollItem = ScrollItem;
|
|
39
|
+
|
|
40
|
+
require('./style.development.css');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function l(l){if(l&&l.__esModule)return l;var e=Object.create(null);return l&&Object.keys(l).forEach((function(_){if("default"!==_){var r=Object.getOwnPropertyDescriptor(l,_);Object.defineProperty(e,_,r.get?r:{enumerable:!0,get:function(){return l[_]}})}})),e.default=l,Object.freeze(e)}Object.defineProperty(exports,"__esModule",{value:!0});var e=l(require("evokit")),_={"ek-scroll":"m6Vr5","ek-scroll__item":"bfetG","ek-scroll__item_blackhole_width-fit-content":"k-fNo","ek-scroll__item_blackhole_width-max-content":"s8gGl","ek-scroll_padding_xxs":"_9vZpV","ek-scroll_padding_xs":"L5kMA","ek-scroll_padding_s":"Nr3Ig","ek-scroll_padding_m":"hcRCz","ek-scroll_padding_l":"SKeiS","ek-scroll_padding_xl":"MG4J-","ek-scroll_padding_xxl":"m8ou2","ek-scroll_padding_3xl":"xy72W","ek-scroll_padding_4xl":"gzW-I","ek-scroll_padding_5xl":"JErmt","ek-scroll_column_1":"n5mTi","ek-scroll_column_2":"GqdmF","ek-scroll_column_3":"DKZCp","ek-scroll_column_4":"-Nf-L","ek-scroll_column_5":"OxDq-","ek-scroll_column_6":"wP8Pu","ek-scroll_column_7":"-ZDSB","ek-scroll_column_8":"PnnsU","ek-scroll_column_9":"DDqgb","ek-scroll_column_10":"Hh-uZ","ek-scroll_gap_xxs":"_15vfK","ek-scroll_gap_xs":"Kvr2J","ek-scroll_gap_s":"_71-or","ek-scroll_gap_m":"glUvB","ek-scroll_gap_l":"pQC7Z","ek-scroll_gap_xl":"L1iAD","ek-scroll_gap_xxl":"wVNm-","ek-scroll_gap_3xl":"_4tQXK","ek-scroll_gap_4xl":"_1-5dw","ek-scroll_gap_5xl":"ym2qM","ek-scroll_bar_none":"c1gVV","ek-scroll_bar_auto":"-TbaH","ek-scroll_align_normal":"zoDjM","ek-scroll_align_start":"_4mACC","ek-scroll_align_center":"_3PWHW","ek-scroll_align_end":"AwLLA"},r=e.createBlock("ul","scroll",["align","bar","column","gap","padding"],{css:_}),o=e.createBlock("li","scroll__item",[],{css:_});r.Item=o,exports.Scroll=r,exports.ScrollItem=o,require("./style.production.css");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.Scroll__ek-scroll___m6Vr5{display:flex;flex-wrap:nowrap;flex-direction:row;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;list-style:none;padding:0;margin:0;box-sizing:border-box}.Scroll__ek-scroll___m6Vr5::after,.Scroll__ek-scroll___m6Vr5::before{content:"";align-self:normal}.Scroll__ek-scroll__item___bfetG{margin:0;padding:0;flex:0 0 auto;box-sizing:border-box}.Scroll__ek-scroll__item_blackhole_width-fit-content___k-fNo{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.Scroll__ek-scroll__item_blackhole_width-max-content___s8gGl{width:-webkit-max-content;width:-moz-max-content;width:max-content}.Scroll__ek-scroll_padding_xxs___9vZpV::after,.Scroll__ek-scroll_padding_xxs___9vZpV::before{flex:0 0 var(--pds-spacing-xxs)}.Scroll__ek-scroll_padding_xs___L5kMA::after,.Scroll__ek-scroll_padding_xs___L5kMA::before{flex:0 0 var(--pds-spacing-xs)}.Scroll__ek-scroll_padding_s___Nr3Ig::after,.Scroll__ek-scroll_padding_s___Nr3Ig::before{flex:0 0 var(--pds-spacing-s)}.Scroll__ek-scroll_padding_m___hcRCz::after,.Scroll__ek-scroll_padding_m___hcRCz::before{flex:0 0 var(--pds-spacing-m)}.Scroll__ek-scroll_padding_l___SKeiS::after,.Scroll__ek-scroll_padding_l___SKeiS::before{flex:0 0 var(--pds-spacing-l)}.Scroll__ek-scroll_padding_xl___MG4J-::after,.Scroll__ek-scroll_padding_xl___MG4J-::before{flex:0 0 var(--pds-spacing-xl)}.Scroll__ek-scroll_padding_xxl___m8ou2::after,.Scroll__ek-scroll_padding_xxl___m8ou2::before{flex:0 0 var(--pds-spacing-xxl)}.Scroll__ek-scroll_padding_3xl___xy72W::after,.Scroll__ek-scroll_padding_3xl___xy72W::before{flex:0 0 var(--pds-spacing-3xl)}.Scroll__ek-scroll_padding_4xl___gzW-I::after,.Scroll__ek-scroll_padding_4xl___gzW-I::before{flex:0 0 var(--pds-spacing-4xl)}.Scroll__ek-scroll_padding_5xl___JErmt::after,.Scroll__ek-scroll_padding_5xl___JErmt::before{flex:0 0 var(--pds-spacing-5xl)}.Scroll__ek-scroll_column_1___n5mTi>.Scroll__ek-scroll__item___bfetG{flex-basis:calc(100%/1);min-width:0}.Scroll__ek-scroll_column_2___GqdmF>.Scroll__ek-scroll__item___bfetG{flex-basis:calc(100%/2);min-width:0}.Scroll__ek-scroll_column_3___DKZCp>.Scroll__ek-scroll__item___bfetG{flex-basis:calc(100%/3);min-width:0}.Scroll__ek-scroll_column_4___-Nf-L>.Scroll__ek-scroll__item___bfetG{flex-basis:calc(100%/4);min-width:0}.Scroll__ek-scroll_column_5___OxDq->.Scroll__ek-scroll__item___bfetG{flex-basis:calc(100%/5);min-width:0}.Scroll__ek-scroll_column_6___wP8Pu>.Scroll__ek-scroll__item___bfetG{flex-basis:calc(100%/6);min-width:0}.Scroll__ek-scroll_column_7___-ZDSB>.Scroll__ek-scroll__item___bfetG{flex-basis:calc(100%/7);min-width:0}.Scroll__ek-scroll_column_8___PnnsU>.Scroll__ek-scroll__item___bfetG{flex-basis:calc(100%/8);min-width:0}.Scroll__ek-scroll_column_9___DDqgb>.Scroll__ek-scroll__item___bfetG{flex-basis:calc(100%/9);min-width:0}.Scroll__ek-scroll_column_10___Hh-uZ>.Scroll__ek-scroll__item___bfetG{flex-basis:calc(100%/10);min-width:0}.Scroll__ek-scroll_gap_xxs___15vfK>.Scroll__ek-scroll__item___bfetG+.Scroll__ek-scroll__item___bfetG{margin-left:var(--pds-spacing-xxs)}.Scroll__ek-scroll_gap_xs___Kvr2J>.Scroll__ek-scroll__item___bfetG+.Scroll__ek-scroll__item___bfetG{margin-left:var(--pds-spacing-xs)}.Scroll__ek-scroll_gap_s___71-or>.Scroll__ek-scroll__item___bfetG+.Scroll__ek-scroll__item___bfetG{margin-left:var(--pds-spacing-s)}.Scroll__ek-scroll_gap_m___glUvB>.Scroll__ek-scroll__item___bfetG+.Scroll__ek-scroll__item___bfetG{margin-left:var(--pds-spacing-m)}.Scroll__ek-scroll_gap_l___pQC7Z>.Scroll__ek-scroll__item___bfetG+.Scroll__ek-scroll__item___bfetG{margin-left:var(--pds-spacing-l)}.Scroll__ek-scroll_gap_xl___L1iAD>.Scroll__ek-scroll__item___bfetG+.Scroll__ek-scroll__item___bfetG{margin-left:var(--pds-spacing-xl)}.Scroll__ek-scroll_gap_xxl___wVNm->.Scroll__ek-scroll__item___bfetG+.Scroll__ek-scroll__item___bfetG{margin-left:var(--pds-spacing-xxl)}.Scroll__ek-scroll_gap_3xl___4tQXK>.Scroll__ek-scroll__item___bfetG+.Scroll__ek-scroll__item___bfetG{margin-left:var(--pds-spacing-3xl)}.Scroll__ek-scroll_gap_4xl___1-5dw>.Scroll__ek-scroll__item___bfetG+.Scroll__ek-scroll__item___bfetG{margin-left:var(--pds-spacing-4xl)}.Scroll__ek-scroll_gap_5xl___ym2qM>.Scroll__ek-scroll__item___bfetG+.Scroll__ek-scroll__item___bfetG{margin-left:var(--pds-spacing-5xl)}.Scroll__ek-scroll_bar_none___c1gVV{-ms-overflow-style:none;scrollbar-width:none}.Scroll__ek-scroll_bar_none___c1gVV::-webkit-scrollbar{display:none}.Scroll__ek-scroll_bar_auto___-TbaH{-ms-overflow-style:auto;scrollbar-width:auto}.Scroll__ek-scroll_bar_auto___-TbaH::-webkit-scrollbar{display:auto}.Scroll__ek-scroll_align_normal___zoDjM{align-items:normal}.Scroll__ek-scroll_align_start___4mACC{align-items:flex-start}.Scroll__ek-scroll_align_center___3PWHW{align-items:center}.Scroll__ek-scroll_align_end___AwLLA{align-items:flex-end}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.m6Vr5{display:flex;flex-wrap:nowrap;flex-direction:row;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;list-style:none;padding:0;margin:0;box-sizing:border-box}.m6Vr5::after,.m6Vr5::before{content:"";align-self:normal}.bfetG{margin:0;padding:0;flex:0 0 auto;box-sizing:border-box}.k-fNo{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.s8gGl{width:-webkit-max-content;width:-moz-max-content;width:max-content}._9vZpV::after,._9vZpV::before{flex:0 0 var(--pds-spacing-xxs)}.L5kMA::after,.L5kMA::before{flex:0 0 var(--pds-spacing-xs)}.Nr3Ig::after,.Nr3Ig::before{flex:0 0 var(--pds-spacing-s)}.hcRCz::after,.hcRCz::before{flex:0 0 var(--pds-spacing-m)}.SKeiS::after,.SKeiS::before{flex:0 0 var(--pds-spacing-l)}.MG4J-::after,.MG4J-::before{flex:0 0 var(--pds-spacing-xl)}.m8ou2::after,.m8ou2::before{flex:0 0 var(--pds-spacing-xxl)}.xy72W::after,.xy72W::before{flex:0 0 var(--pds-spacing-3xl)}.gzW-I::after,.gzW-I::before{flex:0 0 var(--pds-spacing-4xl)}.JErmt::after,.JErmt::before{flex:0 0 var(--pds-spacing-5xl)}.n5mTi>.bfetG{flex-basis:calc(100%/1);min-width:0}.GqdmF>.bfetG{flex-basis:calc(100%/2);min-width:0}.DKZCp>.bfetG{flex-basis:calc(100%/3);min-width:0}.-Nf-L>.bfetG{flex-basis:calc(100%/4);min-width:0}.OxDq->.bfetG{flex-basis:calc(100%/5);min-width:0}.wP8Pu>.bfetG{flex-basis:calc(100%/6);min-width:0}.-ZDSB>.bfetG{flex-basis:calc(100%/7);min-width:0}.PnnsU>.bfetG{flex-basis:calc(100%/8);min-width:0}.DDqgb>.bfetG{flex-basis:calc(100%/9);min-width:0}.Hh-uZ>.bfetG{flex-basis:calc(100%/10);min-width:0}._15vfK>.bfetG+.bfetG{margin-left:var(--pds-spacing-xxs)}.Kvr2J>.bfetG+.bfetG{margin-left:var(--pds-spacing-xs)}._71-or>.bfetG+.bfetG{margin-left:var(--pds-spacing-s)}.glUvB>.bfetG+.bfetG{margin-left:var(--pds-spacing-m)}.pQC7Z>.bfetG+.bfetG{margin-left:var(--pds-spacing-l)}.L1iAD>.bfetG+.bfetG{margin-left:var(--pds-spacing-xl)}.wVNm->.bfetG+.bfetG{margin-left:var(--pds-spacing-xxl)}._4tQXK>.bfetG+.bfetG{margin-left:var(--pds-spacing-3xl)}._1-5dw>.bfetG+.bfetG{margin-left:var(--pds-spacing-4xl)}.ym2qM>.bfetG+.bfetG{margin-left:var(--pds-spacing-5xl)}.c1gVV{-ms-overflow-style:none;scrollbar-width:none}.c1gVV::-webkit-scrollbar{display:none}.-TbaH{-ms-overflow-style:auto;scrollbar-width:auto}.-TbaH::-webkit-scrollbar{display:auto}.zoDjM{align-items:normal}._4mACC{align-items:flex-start}._3PWHW{align-items:center}.AwLLA{align-items:flex-end}
|
package/Scroll/index.d.ts
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare type ScrollProps = React.ComponentProps<"ul"> & {
|
|
3
|
+
/** Скрыть/показать полосу прокрутки */
|
|
4
|
+
'scroll-bar'?: 'none' | 'auto';
|
|
5
|
+
/** Выравнивание ячеек по горизонтальной оси */
|
|
6
|
+
'scroll-align'?: 'start' | 'center' | 'end' | 'normal';
|
|
7
|
+
/** Количество видимых ячеек */
|
|
8
|
+
'scroll-column'?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' | '10';
|
|
9
|
+
/** Отступ между ячейками */
|
|
10
|
+
'scroll-gap'?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | '3xl' | '4xl' | '5xl';
|
|
11
|
+
/** Внутренний отступ контейнера по бокам */
|
|
12
|
+
'scroll-padding'?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | '3xl' | '4xl' | '5xl';
|
|
13
|
+
};
|
|
14
|
+
export declare type ScrollItemProps = React.ComponentProps<"li">;
|
|
15
|
+
export declare const Scroll: React.FC<ScrollProps> & {
|
|
16
|
+
Item: any;
|
|
17
|
+
};
|
|
18
|
+
export declare const ScrollItem: React.FC<ScrollItemProps>;
|
package/Scroll/index.js
CHANGED
|
@@ -1,79 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var evokit = require('evokit');
|
|
8
|
-
|
|
9
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
-
|
|
11
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
12
|
-
|
|
13
|
-
/******************************************************************************
|
|
14
|
-
Copyright (c) Microsoft Corporation.
|
|
15
|
-
|
|
16
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
17
|
-
purpose with or without fee is hereby granted.
|
|
18
|
-
|
|
19
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
20
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
21
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
22
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
23
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
24
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
25
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
26
|
-
***************************************************************************** */
|
|
27
|
-
/* global Reflect, Promise */
|
|
28
|
-
|
|
29
|
-
var extendStatics = function(d, b) {
|
|
30
|
-
extendStatics = Object.setPrototypeOf ||
|
|
31
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
32
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
33
|
-
return extendStatics(d, b);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
function __extends(d, b) {
|
|
37
|
-
if (typeof b !== "function" && b !== null)
|
|
38
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
39
|
-
extendStatics(d, b);
|
|
40
|
-
function __() { this.constructor = d; }
|
|
41
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
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');
|
|
42
7
|
}
|
|
43
|
-
|
|
44
|
-
var css = {"ek-scroll":"Scroll__ek-scroll___m6Vr5","ek-scroll__item":"Scroll__ek-scroll__item___bfetG","ek-scroll__item_blackhole_width-fit-content":"Scroll__ek-scroll__item_blackhole_width-fit-content___k-fNo","ek-scroll__item_blackhole_width-max-content":"Scroll__ek-scroll__item_blackhole_width-max-content___s8gGl","ek-scroll_padding_xxs":"Scroll__ek-scroll_padding_xxs___9vZpV","ek-scroll_padding_xs":"Scroll__ek-scroll_padding_xs___L5kMA","ek-scroll_padding_s":"Scroll__ek-scroll_padding_s___Nr3Ig","ek-scroll_padding_m":"Scroll__ek-scroll_padding_m___hcRCz","ek-scroll_padding_l":"Scroll__ek-scroll_padding_l___SKeiS","ek-scroll_padding_xl":"Scroll__ek-scroll_padding_xl___MG4J-","ek-scroll_padding_xxl":"Scroll__ek-scroll_padding_xxl___m8ou2","ek-scroll_padding_3xl":"Scroll__ek-scroll_padding_3xl___xy72W","ek-scroll_padding_4xl":"Scroll__ek-scroll_padding_4xl___gzW-I","ek-scroll_padding_5xl":"Scroll__ek-scroll_padding_5xl___JErmt","ek-scroll_column_1":"Scroll__ek-scroll_column_1___n5mTi","ek-scroll_column_2":"Scroll__ek-scroll_column_2___GqdmF","ek-scroll_column_3":"Scroll__ek-scroll_column_3___DKZCp","ek-scroll_column_4":"Scroll__ek-scroll_column_4___-Nf-L","ek-scroll_column_5":"Scroll__ek-scroll_column_5___OxDq-","ek-scroll_column_6":"Scroll__ek-scroll_column_6___wP8Pu","ek-scroll_column_7":"Scroll__ek-scroll_column_7___-ZDSB","ek-scroll_column_8":"Scroll__ek-scroll_column_8___PnnsU","ek-scroll_column_9":"Scroll__ek-scroll_column_9___DDqgb","ek-scroll_column_10":"Scroll__ek-scroll_column_10___Hh-uZ","ek-scroll_gap_xxs":"Scroll__ek-scroll_gap_xxs___15vfK","ek-scroll_gap_xs":"Scroll__ek-scroll_gap_xs___Kvr2J","ek-scroll_gap_s":"Scroll__ek-scroll_gap_s___71-or","ek-scroll_gap_m":"Scroll__ek-scroll_gap_m___glUvB","ek-scroll_gap_l":"Scroll__ek-scroll_gap_l___pQC7Z","ek-scroll_gap_xl":"Scroll__ek-scroll_gap_xl___L1iAD","ek-scroll_gap_xxl":"Scroll__ek-scroll_gap_xxl___wVNm-","ek-scroll_gap_3xl":"Scroll__ek-scroll_gap_3xl___4tQXK","ek-scroll_gap_4xl":"Scroll__ek-scroll_gap_4xl___1-5dw","ek-scroll_gap_5xl":"Scroll__ek-scroll_gap_5xl___ym2qM","ek-scroll_bar_none":"Scroll__ek-scroll_bar_none___c1gVV","ek-scroll_bar_auto":"Scroll__ek-scroll_bar_auto___-TbaH","ek-scroll_align_normal":"Scroll__ek-scroll_align_normal___zoDjM","ek-scroll_align_start":"Scroll__ek-scroll_align_start___4mACC","ek-scroll_align_center":"Scroll__ek-scroll_align_center___3PWHW","ek-scroll_align_end":"Scroll__ek-scroll_align_end___AwLLA"};
|
|
45
|
-
|
|
46
|
-
var _a;
|
|
47
|
-
var Scroll = evokit.createBlock('ul', 'scroll', ['align', 'bar', 'column', 'gap', 'padding'], {
|
|
48
|
-
css: css
|
|
49
|
-
});
|
|
50
|
-
Scroll.Item = evokit.createBlock('li', 'scroll__item', [], {
|
|
51
|
-
css: css
|
|
52
|
-
}); // Only for StyleGuide
|
|
53
|
-
|
|
54
|
-
var StyleGuide =
|
|
55
|
-
/** @class */
|
|
56
|
-
function (_super) {
|
|
57
|
-
__extends(StyleGuide, _super);
|
|
58
|
-
|
|
59
|
-
function StyleGuide() {
|
|
60
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
StyleGuide.prototype.render = function () {
|
|
64
|
-
return null;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
StyleGuide.displayName = 'Scroll';
|
|
68
|
-
StyleGuide.propTypes = (_a = {},
|
|
69
|
-
/** Скрыть/показать полосу прокрутки */
|
|
70
|
-
_a['scroll-bar'] = PropTypes__default["default"].oneOf(['none', 'auto']),
|
|
71
|
-
/** Выравнивание ячеек по горизонтальной оси */
|
|
72
|
-
_a['scroll-align'] = PropTypes__default["default"].oneOf(['start', 'center', 'end', 'normal']), _a['scroll-column'] = PropTypes__default["default"].oneOf(['1', '2', '3', '4', '5', '6', '7', '8', '9', '10']), _a['scroll-gap'] = PropTypes__default["default"].oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', '3xl', '4xl', '5xl']), _a['scroll-padding'] = PropTypes__default["default"].oneOf(['xxs', 'xs', 's', 'm', 'l', 'xl', 'xxl', '3xl', '4xl', '5xl']), _a);
|
|
73
|
-
return StyleGuide;
|
|
74
|
-
}(react.Component);
|
|
75
|
-
|
|
76
|
-
exports.Scroll = Scroll;
|
|
77
|
-
exports.StyleGuide = StyleGuide;
|
|
78
|
-
|
|
79
|
-
require('./style.css');
|
package/Scroll/package.json
CHANGED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var classNames = require('classnames');
|
|
7
|
+
var ttag = require('ttag');
|
|
8
|
+
var Button = require('@prom-ui/core/Button');
|
|
9
|
+
var Icon = require('@prom-ui/core/Icon');
|
|
10
|
+
var Left = require('@prom-ui/icons/Left');
|
|
11
|
+
var Right = require('@prom-ui/icons/Right');
|
|
12
|
+
|
|
13
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
14
|
+
|
|
15
|
+
function _interopNamespace(e) {
|
|
16
|
+
if (e && e.__esModule) return e;
|
|
17
|
+
var n = Object.create(null);
|
|
18
|
+
if (e) {
|
|
19
|
+
Object.keys(e).forEach(function (k) {
|
|
20
|
+
if (k !== 'default') {
|
|
21
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
22
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return e[k]; }
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
n["default"] = e;
|
|
30
|
+
return Object.freeze(n);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
34
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
35
|
+
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
36
|
+
|
|
37
|
+
/******************************************************************************
|
|
38
|
+
Copyright (c) Microsoft Corporation.
|
|
39
|
+
|
|
40
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
41
|
+
purpose with or without fee is hereby granted.
|
|
42
|
+
|
|
43
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
44
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
45
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
46
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
47
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
48
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
49
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
50
|
+
***************************************************************************** */
|
|
51
|
+
|
|
52
|
+
var __assign = function() {
|
|
53
|
+
__assign = Object.assign || function __assign(t) {
|
|
54
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
55
|
+
s = arguments[i];
|
|
56
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
57
|
+
}
|
|
58
|
+
return t;
|
|
59
|
+
};
|
|
60
|
+
return __assign.apply(this, arguments);
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
function __rest(s, e) {
|
|
64
|
+
var t = {};
|
|
65
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
66
|
+
t[p] = s[p];
|
|
67
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
68
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
69
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
70
|
+
t[p[i]] = s[p[i]];
|
|
71
|
+
}
|
|
72
|
+
return t;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function __makeTemplateObject(cooked, raw) {
|
|
76
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
77
|
+
return cooked;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
var css = {"root":"ScrollControls__root___mOlOq","buttonCommon":"ScrollControls__buttonCommon___rZcyK","prev":"ScrollControls__prev___cF2KB ScrollControls__buttonCommon___rZcyK","next":"ScrollControls__next___9B-9g ScrollControls__buttonCommon___rZcyK","icon":"ScrollControls__icon___lzBzL","showOnHover":"ScrollControls__showOnHover___StbVV","hideOnDisabled":"ScrollControls__hideOnDisabled___IONkE"};
|
|
81
|
+
|
|
82
|
+
var DIRECTION_NEXT = 1;
|
|
83
|
+
var DIRECTION_PREV = -1;
|
|
84
|
+
var CONTROLS_UPDATE_DELAY = 100;
|
|
85
|
+
var ScrollControlsButton = function (_a) {
|
|
86
|
+
var _b, _c;
|
|
87
|
+
|
|
88
|
+
var scrollRef = _a.scrollRef,
|
|
89
|
+
_d = _a.hideOnDisabled,
|
|
90
|
+
hideOnDisabled = _d === void 0 ? false : _d,
|
|
91
|
+
_e = _a.isActive,
|
|
92
|
+
isActive = _e === void 0 ? true : _e,
|
|
93
|
+
onClickNext = _a.onClickNext,
|
|
94
|
+
onClickPrev = _a.onClickPrev,
|
|
95
|
+
zIndex = _a.zIndex,
|
|
96
|
+
_f = _a.theme,
|
|
97
|
+
theme = _f === void 0 ? 'white' : _f,
|
|
98
|
+
children = _a.children;
|
|
99
|
+
var updateControlsTimer = React.useRef(null);
|
|
100
|
+
|
|
101
|
+
var _g = React.useState({
|
|
102
|
+
prev: false,
|
|
103
|
+
next: false
|
|
104
|
+
}),
|
|
105
|
+
controlsVisible = _g[0],
|
|
106
|
+
setControlsVisible = _g[1];
|
|
107
|
+
|
|
108
|
+
var updateControlsVisible = function (nextScrollLeft) {
|
|
109
|
+
var _a = scrollRef.current,
|
|
110
|
+
scrollLeft = _a.scrollLeft,
|
|
111
|
+
scrollWidth = _a.scrollWidth,
|
|
112
|
+
clientWidth = _a.clientWidth;
|
|
113
|
+
var currentScrollLeft = (Number.isInteger(nextScrollLeft) ? nextScrollLeft : scrollLeft) || 0;
|
|
114
|
+
setControlsVisible({
|
|
115
|
+
prev: currentScrollLeft > 1,
|
|
116
|
+
next: currentScrollLeft < scrollWidth - clientWidth
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
var updateScrollLeft = function (direction) {
|
|
121
|
+
var _a = scrollRef.current,
|
|
122
|
+
scrollLeft = _a.scrollLeft,
|
|
123
|
+
clientWidth = _a.clientWidth;
|
|
124
|
+
var offset = clientWidth * direction;
|
|
125
|
+
updateControlsVisible(scrollLeft + offset);
|
|
126
|
+
requestAnimationFrame(function () {
|
|
127
|
+
if (scrollRef.current) {
|
|
128
|
+
scrollRef.current.scrollBy({
|
|
129
|
+
left: offset,
|
|
130
|
+
behavior: 'smooth'
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
var handleOnClickPrev = function () {
|
|
137
|
+
if (typeof onClickPrev === 'function') {
|
|
138
|
+
onClickPrev();
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
updateScrollLeft(DIRECTION_PREV);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
var handleOnClickNext = function () {
|
|
145
|
+
if (typeof onClickNext === 'function') {
|
|
146
|
+
onClickNext();
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
updateScrollLeft(DIRECTION_NEXT);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
var handleOnScroll = function () {
|
|
153
|
+
clearTimeout(updateControlsTimer.current || 0);
|
|
154
|
+
updateControlsTimer.current = setTimeout(updateControlsVisible, CONTROLS_UPDATE_DELAY);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
React.useEffect(function () {
|
|
158
|
+
if (scrollRef.current && isActive) {
|
|
159
|
+
updateControlsVisible();
|
|
160
|
+
scrollRef.current.addEventListener('scroll', handleOnScroll);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return function () {
|
|
164
|
+
if (scrollRef.current && isActive) {
|
|
165
|
+
scrollRef.current.removeEventListener('scroll', handleOnScroll);
|
|
166
|
+
}
|
|
167
|
+
};
|
|
168
|
+
}, [isActive, children]);
|
|
169
|
+
|
|
170
|
+
if (isActive && (controlsVisible.prev || controlsVisible.next)) {
|
|
171
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement(Button.Button, {
|
|
172
|
+
"button-theme": theme,
|
|
173
|
+
"button-round": 'xs',
|
|
174
|
+
"button-weight": 'normal',
|
|
175
|
+
"button-padding": 'none xxs',
|
|
176
|
+
className: classNames__default["default"](css.prev, (_b = {}, _b[css.hideOnDisabled] = hideOnDisabled, _b)),
|
|
177
|
+
onClick: handleOnClickPrev,
|
|
178
|
+
style: {
|
|
179
|
+
zIndex: zIndex
|
|
180
|
+
},
|
|
181
|
+
disabled: !controlsVisible.prev,
|
|
182
|
+
title: ttag.t(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\u041D\u0430\u0437\u0430\u0434"], ["\u041D\u0430\u0437\u0430\u0434"])))
|
|
183
|
+
}, React__default["default"].createElement(Icon.Icon, {
|
|
184
|
+
className: css.icon,
|
|
185
|
+
"icon-as": Left.Left
|
|
186
|
+
})), React__default["default"].createElement(Button.Button, {
|
|
187
|
+
"button-theme": theme,
|
|
188
|
+
"button-round": 'xs',
|
|
189
|
+
"button-weight": 'normal',
|
|
190
|
+
"button-padding": 'none xxs',
|
|
191
|
+
className: classNames__default["default"](css.next, (_c = {}, _c[css.hideOnDisabled] = hideOnDisabled, _c)),
|
|
192
|
+
onClick: handleOnClickNext,
|
|
193
|
+
style: {
|
|
194
|
+
zIndex: zIndex
|
|
195
|
+
},
|
|
196
|
+
disabled: !controlsVisible.next,
|
|
197
|
+
title: ttag.t(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\u0414\u0430\u043B\u0435\u0435"], ["\u0414\u0430\u043B\u0435\u0435"])))
|
|
198
|
+
}, React__default["default"].createElement(Icon.Icon, {
|
|
199
|
+
className: css.icon,
|
|
200
|
+
"icon-as": Right.Right
|
|
201
|
+
})));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return null;
|
|
205
|
+
};
|
|
206
|
+
var templateObject_1, templateObject_2;
|
|
207
|
+
|
|
208
|
+
var ScrollControls = React__namespace.forwardRef(function (_a, ref) {
|
|
209
|
+
var _b;
|
|
210
|
+
|
|
211
|
+
var children = _a.children,
|
|
212
|
+
className = _a.className,
|
|
213
|
+
_c = _a.hideOnDisabled,
|
|
214
|
+
hideOnDisabled = _c === void 0 ? false : _c,
|
|
215
|
+
_d = _a.isActive,
|
|
216
|
+
isActive = _d === void 0 ? true : _d,
|
|
217
|
+
onClickNext = _a.onClickNext,
|
|
218
|
+
onClickPrev = _a.onClickPrev,
|
|
219
|
+
_e = _a.showOnHover,
|
|
220
|
+
showOnHover = _e === void 0 ? false : _e,
|
|
221
|
+
zIndex = _a.zIndex,
|
|
222
|
+
_f = _a.theme,
|
|
223
|
+
theme = _f === void 0 ? 'white' : _f,
|
|
224
|
+
props = __rest(_a, ["children", "className", "hideOnDisabled", "isActive", "onClickNext", "onClickPrev", "showOnHover", "zIndex", "theme"]);
|
|
225
|
+
|
|
226
|
+
var scrollRef = React__namespace.useRef(null);
|
|
227
|
+
return React__namespace.createElement("div", __assign({
|
|
228
|
+
ref: ref,
|
|
229
|
+
className: classNames__default["default"](css.root, className, (_b = {}, _b[css.showOnHover] = showOnHover, _b))
|
|
230
|
+
}, props), children(scrollRef), React__namespace.createElement(ScrollControlsButton, {
|
|
231
|
+
scrollRef: scrollRef,
|
|
232
|
+
hideOnDisabled: hideOnDisabled,
|
|
233
|
+
isActive: isActive,
|
|
234
|
+
onClickNext: onClickNext,
|
|
235
|
+
onClickPrev: onClickPrev,
|
|
236
|
+
zIndex: zIndex,
|
|
237
|
+
theme: theme
|
|
238
|
+
}, children));
|
|
239
|
+
});
|
|
240
|
+
|
|
241
|
+
exports.ScrollControls = ScrollControls;
|
|
242
|
+
|
|
243
|
+
require('./style.development.css');
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("ttag"),n=require("@prom-ui/core/Button"),o=require("@prom-ui/core/Icon"),i=require("@prom-ui/icons/Left"),c=require("@prom-ui/icons/Right");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function u(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=l(e),s=u(e),f=l(t),d=function(){return d=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},d.apply(this,arguments)};function v(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var m,p,b="mOlOq",h="cF2KB rZcyK",O="_9B-9g rZcyK",y="lzBzL",x="StbVV",g="IONkE",j=function(t){var l,u,s=t.scrollRef,d=t.hideOnDisabled,b=void 0!==d&&d,x=t.isActive,j=void 0===x||x,w=t.onClickNext,E=t.onClickPrev,N=t.zIndex,P=t.theme,k=void 0===P?"white":P,I=t.children,C=e.useRef(null),q=e.useState({prev:!1,next:!1}),z=q[0],B=q[1],L=function(e){var t=s.current,r=t.scrollLeft,n=t.scrollWidth,o=t.clientWidth,i=(Number.isInteger(e)?e:r)||0;B({prev:i>1,next:i<n-o})},R=function(e){var t=s.current,r=t.scrollLeft,n=t.clientWidth*e;L(r+n),requestAnimationFrame((function(){s.current&&s.current.scrollBy({left:n,behavior:"smooth"})}))},A=function(){clearTimeout(C.current||0),C.current=setTimeout(L,100)};return e.useEffect((function(){return s.current&&j&&(L(),s.current.addEventListener("scroll",A)),function(){s.current&&j&&s.current.removeEventListener("scroll",A)}}),[j,I]),j&&(z.prev||z.next)?a.default.createElement(a.default.Fragment,null,a.default.createElement(n.Button,{"button-theme":k,"button-round":"xs","button-weight":"normal","button-padding":"none xxs",className:f.default(h,(l={},l[g]=b,l)),onClick:function(){"function"==typeof E&&E(),R(-1)},style:{zIndex:N},disabled:!z.prev,title:r.t(m||(m=v(["Назад"],["Назад"])))},a.default.createElement(o.Icon,{className:y,"icon-as":i.Left})),a.default.createElement(n.Button,{"button-theme":k,"button-round":"xs","button-weight":"normal","button-padding":"none xxs",className:f.default(O,(u={},u[g]=b,u)),onClick:function(){"function"==typeof w&&w(),R(1)},style:{zIndex:N},disabled:!z.next,title:r.t(p||(p=v(["Далее"],["Далее"])))},a.default.createElement(o.Icon,{className:y,"icon-as":c.Right}))):null},w=s.forwardRef((function(e,t){var r,n=e.children,o=e.className,i=e.hideOnDisabled,c=void 0!==i&&i,l=e.isActive,u=void 0===l||l,a=e.onClickNext,v=e.onClickPrev,m=e.showOnHover,p=void 0!==m&&m,h=e.zIndex,O=e.theme,y=void 0===O?"white":O,g=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["children","className","hideOnDisabled","isActive","onClickNext","onClickPrev","showOnHover","zIndex","theme"]),w=s.useRef(null);return s.createElement("div",d({ref:t,className:f.default(b,o,(r={},r[x]=p,r))},g),n(w),s.createElement(j,{scrollRef:w,hideOnDisabled:c,isActive:u,onClickNext:a,onClickPrev:v,zIndex:h,theme:y},n))}));exports.ScrollControls=w,require("./style.production.css");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ScrollControls__root___mOlOq{position:relative;overflow:hidden}.ScrollControls__buttonCommon___rZcyK{position:absolute;top:50%;transform:translateY(-50%);border:0;box-shadow:0 0 10px rgba(0,0,0,.08);height:66px;max-width:30px;max-height:50%;min-height:24px}.ScrollControls__buttonCommon___rZcyK:disabled{opacity:.3;pointer-events:auto}.ScrollControls__buttonCommon___rZcyK:active{background:var(--black-200)}.ScrollControls__prev___cF2KB{left:0;margin-left:var(--pds-spacing-xs)}.ScrollControls__next___9B-9g{right:0;margin-right:var(--pds-spacing-xs)}.ScrollControls__icon___lzBzL{display:block;width:auto;height:24px;fill:currentColor;max-height:80%}.ScrollControls__showOnHover___StbVV .ScrollControls__next___9B-9g{right:-40px}.ScrollControls__showOnHover___StbVV .ScrollControls__prev___cF2KB{left:-40px}.ScrollControls__hideOnDisabled___IONkE:disabled{opacity:0;pointer-events:none;visibility:hidden}@media (hover:hover){.ScrollControls__showOnHover___StbVV:hover .ScrollControls__next___9B-9g{right:0}.ScrollControls__showOnHover___StbVV:hover .ScrollControls__prev___cF2KB{left:0}}
|