@prom-ui/core 0.0.121 → 0.0.131
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 +9 -19
- package/Avatar/cjs/index.development.v2.js +9 -19
- package/Avatar/package.json +1 -1
- package/Body/package.json +1 -1
- package/BodyProvider/BodyContext.d.ts +5 -0
- package/BodyProvider/cjs/index.development.js +264 -0
- package/BodyProvider/cjs/index.development.v2.js +264 -0
- package/BodyProvider/cjs/index.production.js +1 -0
- package/BodyProvider/cjs/index.production.v2.js +1 -0
- package/BodyProvider/index.d.ts +9 -0
- package/BodyProvider/index.js +7 -0
- package/BodyProvider/index.v2.js +7 -0
- package/BodyProvider/package.json +12 -0
- package/BodyProvider/useBodyLocale.d.ts +2 -0
- package/Box/package.json +1 -1
- package/Button/cjs/index.development.js +3 -4
- package/Button/cjs/index.development.v2.js +3 -4
- package/Button/package.json +1 -1
- package/ButtonPageUp/cjs/index.development.js +16 -20
- package/ButtonPageUp/cjs/index.development.v2.js +16 -20
- package/ButtonPageUp/cjs/index.production.js +1 -1
- package/ButtonPageUp/cjs/index.production.v2.js +1 -1
- package/ButtonPageUp/package.json +2 -3
- package/Checkbox/cjs/index.development.js +5 -7
- package/Checkbox/cjs/index.development.v2.js +5 -7
- package/Checkbox/package.json +1 -1
- package/Flex/package.json +1 -1
- package/Grid/package.json +1 -1
- package/Icon/cjs/index.development.js +1 -1
- package/Icon/cjs/index.development.v2.js +1 -1
- package/Icon/cjs/index.production.js +1 -1
- package/Icon/cjs/index.production.v2.js +1 -1
- package/Icon/cjs/style.development.css +1 -1
- package/Icon/cjs/style.development.v2.css +1 -1
- package/Icon/cjs/style.production.css +1 -1
- package/Icon/cjs/style.production.v2.css +1 -1
- package/Icon/index.d.ts +1 -1
- package/Icon/package.json +1 -1
- package/Image/package.json +1 -1
- package/ImageEmoji/cjs/index.development.js +7 -8
- package/ImageEmoji/cjs/index.development.v2.js +7 -8
- package/ImageEmoji/package.json +1 -1
- package/Input/package.json +1 -1
- package/InputField/cjs/index.development.js +33 -44
- package/InputField/cjs/index.development.v2.js +33 -44
- package/InputField/cjs/index.production.js +1 -1
- package/InputField/cjs/index.production.v2.js +1 -1
- package/InputField/package.json +1 -1
- package/KeyPress/cjs/index.development.js +8 -11
- package/KeyPress/cjs/index.development.v2.js +8 -11
- package/KeyPress/package.json +1 -1
- package/Line/package.json +1 -1
- package/Link/cjs/index.development.js +0 -1
- package/Link/cjs/index.development.v2.js +0 -1
- package/Link/package.json +1 -1
- package/List/package.json +1 -1
- package/Media/cjs/index.development.js +12 -18
- package/Media/cjs/index.development.v2.js +12 -18
- package/Media/package.json +1 -1
- package/OutsideClick/cjs/index.development.js +4 -7
- package/OutsideClick/cjs/index.development.v2.js +4 -7
- package/OutsideClick/package.json +1 -1
- package/Overlay/cjs/index.development.js +67 -90
- package/Overlay/cjs/index.development.v2.js +67 -90
- package/Overlay/cjs/index.production.js +1 -1
- package/Overlay/cjs/index.production.v2.js +1 -1
- package/Overlay/package.json +2 -3
- package/Picture/package.json +1 -1
- package/PortableOverlay/cjs/index.development.js +19 -20
- package/PortableOverlay/cjs/index.development.v2.js +19 -20
- package/PortableOverlay/package.json +1 -1
- package/Portal/cjs/index.development.js +5 -10
- package/Portal/cjs/index.development.v2.js +5 -10
- package/Portal/package.json +1 -1
- package/QRCode/cjs/index.development.js +8 -8
- package/QRCode/cjs/index.development.v2.js +8 -8
- package/QRCode/package.json +1 -1
- package/Rating/cjs/index.development.js +8 -9
- package/Rating/cjs/index.development.v2.js +8 -9
- package/Rating/package.json +1 -1
- package/SafeQuery/cjs/index.development.js +19 -19
- package/SafeQuery/cjs/index.development.v2.js +19 -19
- package/SafeQuery/cjs/index.production.js +1 -1
- package/SafeQuery/cjs/index.production.v2.js +1 -1
- package/SafeQuery/package.json +1 -1
- package/Scroll/package.json +1 -1
- package/ScrollControls/cjs/index.development.js +37 -51
- package/ScrollControls/cjs/index.development.v2.js +37 -51
- package/ScrollControls/cjs/index.production.js +1 -1
- package/ScrollControls/cjs/index.production.v2.js +1 -1
- package/ScrollControls/package.json +2 -3
- package/SideOverlay/cjs/index.development.js +40 -41
- package/SideOverlay/cjs/index.development.v2.js +40 -41
- package/SideOverlay/cjs/index.production.js +1 -1
- package/SideOverlay/cjs/index.production.v2.js +1 -1
- package/SideOverlay/package.json +2 -3
- package/SimpleSlider/cjs/index.development.js +53 -89
- package/SimpleSlider/cjs/index.development.v2.js +53 -89
- package/SimpleSlider/cjs/index.production.js +1 -1
- package/SimpleSlider/cjs/index.production.v2.js +1 -1
- package/SimpleSlider/package.json +2 -3
- package/Skeleton/cjs/index.development.js +10 -11
- package/Skeleton/cjs/index.development.v2.js +10 -11
- package/Skeleton/package.json +1 -1
- package/Spinner/package.json +1 -1
- package/Text/package.json +1 -1
- package/TextEmoji/cjs/index.development.js +5 -6
- package/TextEmoji/cjs/index.development.v2.js +5 -6
- package/TextEmoji/package.json +1 -1
- package/Tooltip/cjs/index.development.js +53 -55
- package/Tooltip/cjs/index.development.v2.js +53 -55
- package/Tooltip/package.json +1 -1
- package/Tumbler/cjs/index.development.js +5 -7
- package/Tumbler/cjs/index.development.v2.js +5 -7
- package/Tumbler/package.json +1 -1
- package/package.json +6 -3
|
@@ -29,14 +29,14 @@ var css = {"root":"QRCode__root___ZFxvt"};
|
|
|
29
29
|
|
|
30
30
|
var QRCode = function (_a) {
|
|
31
31
|
var value = _a.value,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
_b = _a.size,
|
|
33
|
+
size = _b === void 0 ? 100 : _b,
|
|
34
|
+
_c = _a.bgColor,
|
|
35
|
+
bgColor = _c === void 0 ? 'var(--white)' : _c,
|
|
36
|
+
_d = _a.fgColor,
|
|
37
|
+
fgColor = _d === void 0 ? 'var(--black-900)' : _d,
|
|
38
|
+
_e = _a.level,
|
|
39
|
+
level = _e === void 0 ? 'L' : _e;
|
|
40
40
|
return React__namespace.createElement(qrcode_react.QRCodeSVG, {
|
|
41
41
|
value: value,
|
|
42
42
|
size: size,
|
|
@@ -29,14 +29,14 @@ var css = {"root":"QRCode__root___8QnCu"};
|
|
|
29
29
|
|
|
30
30
|
var QRCode = function (_a) {
|
|
31
31
|
var value = _a.value,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
_b = _a.size,
|
|
33
|
+
size = _b === void 0 ? 100 : _b,
|
|
34
|
+
_c = _a.bgColor,
|
|
35
|
+
bgColor = _c === void 0 ? 'var(--white)' : _c,
|
|
36
|
+
_d = _a.fgColor,
|
|
37
|
+
fgColor = _d === void 0 ? 'var(--black-900)' : _d,
|
|
38
|
+
_e = _a.level,
|
|
39
|
+
level = _e === void 0 ? 'L' : _e;
|
|
40
40
|
return React__namespace.createElement(qrcode_react.QRCodeSVG, {
|
|
41
41
|
value: value,
|
|
42
42
|
size: size,
|
package/QRCode/package.json
CHANGED
|
@@ -70,15 +70,14 @@ var RatingBlock = evokit.createBlock('svg', 'rating', ['size'], {
|
|
|
70
70
|
});
|
|
71
71
|
var Rating = React__namespace.forwardRef(function (_a, ref) {
|
|
72
72
|
var _b = _a.value,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
value = _b === void 0 ? 0 : _b,
|
|
74
|
+
_c = _a.percent,
|
|
75
|
+
percent = _c === void 0 ? 0 : _c,
|
|
76
|
+
_d = _a.size,
|
|
77
|
+
size = _d === void 0 ? 'default' : _d,
|
|
78
|
+
_e = _a.theme,
|
|
79
|
+
theme = _e === void 0 ? 'violet-500' : _e,
|
|
80
|
+
props = __rest(_a, ["value", "percent", "size", "theme"]);
|
|
82
81
|
var gradientOffset = Math.round(percent > 0 ? percent : value / 5 * 100);
|
|
83
82
|
var gradientId = "pds-rating-gradient-".concat(gradientOffset, "-").concat(theme);
|
|
84
83
|
return React__namespace.createElement(RatingBlock, __assign({}, props, {
|
|
@@ -70,15 +70,14 @@ var RatingBlock = evokit.createBlock('svg', 'rating', ['size'], {
|
|
|
70
70
|
});
|
|
71
71
|
var Rating = React__namespace.forwardRef(function (_a, ref) {
|
|
72
72
|
var _b = _a.value,
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
73
|
+
value = _b === void 0 ? 0 : _b,
|
|
74
|
+
_c = _a.percent,
|
|
75
|
+
percent = _c === void 0 ? 0 : _c,
|
|
76
|
+
_d = _a.size,
|
|
77
|
+
size = _d === void 0 ? 'default' : _d,
|
|
78
|
+
_e = _a.theme,
|
|
79
|
+
theme = _e === void 0 ? 'violet-500' : _e,
|
|
80
|
+
props = __rest(_a, ["value", "percent", "size", "theme"]);
|
|
82
81
|
var gradientOffset = Math.round(percent > 0 ? percent : value / 5 * 100);
|
|
83
82
|
var gradientId = "pds-rating-gradient-".concat(gradientOffset, "-").concat(theme);
|
|
84
83
|
return React__namespace.createElement(RatingBlock, __assign({}, props, {
|
package/Rating/package.json
CHANGED
|
@@ -8,6 +8,7 @@ var errcatch = require('@evo/errcatch');
|
|
|
8
8
|
var Box = require('@prom-ui/core/Box');
|
|
9
9
|
var Button = require('@prom-ui/core/Button');
|
|
10
10
|
var Text = require('@prom-ui/core/Text');
|
|
11
|
+
var BodyProvider = require('@prom-ui/core/BodyProvider');
|
|
11
12
|
|
|
12
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
14
|
|
|
@@ -68,22 +69,25 @@ function __rest(s, e) {
|
|
|
68
69
|
t[p[i]] = s[p[i]];
|
|
69
70
|
}
|
|
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;
|
|
71
77
|
}
|
|
72
78
|
|
|
73
79
|
var css = {"root":"SafeQuery__root___RWb3q"};
|
|
74
80
|
|
|
75
81
|
var SafeQueryError = function (_a) {
|
|
76
82
|
var componentErrorName = _a.componentErrorName,
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
onReload = _a.onReload;
|
|
84
|
+
var t = BodyProvider.useBodyLocale().t;
|
|
79
85
|
var _b = React.useState(false),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
isHidden = _b[0],
|
|
87
|
+
setHidden = _b[1];
|
|
83
88
|
if (isHidden) {
|
|
84
89
|
return null;
|
|
85
90
|
}
|
|
86
|
-
|
|
87
91
|
if (process.env.NODE_ENV !== 'production') {
|
|
88
92
|
if (typeof window === 'undefined') return null;
|
|
89
93
|
return React__default["default"].createElement(Box.Box, {
|
|
@@ -97,7 +101,7 @@ var SafeQueryError = function (_a) {
|
|
|
97
101
|
"box-margin-right": '5xl'
|
|
98
102
|
}, React__default["default"].createElement(Text.Text, {
|
|
99
103
|
"text-color": 'white'
|
|
100
|
-
}, "\u0412\u043E\u0437\u043D\u0438\u043A\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430:", ' ', React__default["default"].createElement(Text.Text, {
|
|
104
|
+
}, t(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\u0412\u043E\u0437\u043D\u0438\u043A\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430:"], ["\u0412\u043E\u0437\u043D\u0438\u043A\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430:"]))), ' ', React__default["default"].createElement(Text.Text, {
|
|
101
105
|
"text-weight": 'bold',
|
|
102
106
|
style: {
|
|
103
107
|
fontFamily: 'Consolas, "Liberation Mono", Menlo, monospace',
|
|
@@ -110,7 +114,7 @@ var SafeQueryError = function (_a) {
|
|
|
110
114
|
"button-padding": 'xxs',
|
|
111
115
|
"button-theme": 'white-inherit',
|
|
112
116
|
onClick: onReload,
|
|
113
|
-
title:
|
|
117
|
+
title: t(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C"], ["\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C"])))
|
|
114
118
|
}, React__default["default"].createElement("svg", {
|
|
115
119
|
xmlns: 'http://www.w3.org/2000/svg',
|
|
116
120
|
viewBox: '0 0 18 18',
|
|
@@ -125,7 +129,7 @@ var SafeQueryError = function (_a) {
|
|
|
125
129
|
onClick: function () {
|
|
126
130
|
return setHidden(true);
|
|
127
131
|
},
|
|
128
|
-
title:
|
|
132
|
+
title: t(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\u0421\u043A\u0440\u044B\u0442\u044C"], ["\u0421\u043A\u0440\u044B\u0442\u044C"])))
|
|
129
133
|
}, React__default["default"].createElement("svg", {
|
|
130
134
|
xmlns: 'http://www.w3.org/2000/svg',
|
|
131
135
|
viewBox: '0 0 24 24',
|
|
@@ -136,30 +140,26 @@ var SafeQueryError = function (_a) {
|
|
|
136
140
|
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'
|
|
137
141
|
})))));
|
|
138
142
|
}
|
|
139
|
-
|
|
140
143
|
return null;
|
|
141
144
|
};
|
|
145
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
142
146
|
|
|
143
147
|
var SafeQuery = function (_a) {
|
|
144
148
|
var _b = _a.componentErrorName,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
componentErrorName = _b === void 0 ? 'SafeQuery' : _b,
|
|
150
|
+
children = _a.children,
|
|
151
|
+
props = __rest(_a, ["componentErrorName", "children"]);
|
|
149
152
|
var _c = React__namespace.useState(false),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
isReload = _c[0],
|
|
154
|
+
setReload = _c[1];
|
|
153
155
|
React__namespace.useEffect(function () {
|
|
154
156
|
if (isReload) {
|
|
155
157
|
setReload(false);
|
|
156
158
|
}
|
|
157
159
|
}, [isReload]);
|
|
158
|
-
|
|
159
160
|
if (isReload) {
|
|
160
161
|
return null;
|
|
161
162
|
}
|
|
162
|
-
|
|
163
163
|
var errorComponent = React__namespace.createElement(SafeQueryError, {
|
|
164
164
|
componentErrorName: componentErrorName,
|
|
165
165
|
onReload: function () {
|
|
@@ -8,6 +8,7 @@ var errcatch = require('@evo/errcatch');
|
|
|
8
8
|
var Box = require('@prom-ui/core/Box');
|
|
9
9
|
var Button = require('@prom-ui/core/Button');
|
|
10
10
|
var Text = require('@prom-ui/core/Text');
|
|
11
|
+
var BodyProvider = require('@prom-ui/core/BodyProvider');
|
|
11
12
|
|
|
12
13
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
14
|
|
|
@@ -68,22 +69,25 @@ function __rest(s, e) {
|
|
|
68
69
|
t[p[i]] = s[p[i]];
|
|
69
70
|
}
|
|
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;
|
|
71
77
|
}
|
|
72
78
|
|
|
73
79
|
var css = {"root":"SafeQuery__root___IHinP"};
|
|
74
80
|
|
|
75
81
|
var SafeQueryError = function (_a) {
|
|
76
82
|
var componentErrorName = _a.componentErrorName,
|
|
77
|
-
|
|
78
|
-
|
|
83
|
+
onReload = _a.onReload;
|
|
84
|
+
var t = BodyProvider.useBodyLocale().t;
|
|
79
85
|
var _b = React.useState(false),
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
86
|
+
isHidden = _b[0],
|
|
87
|
+
setHidden = _b[1];
|
|
83
88
|
if (isHidden) {
|
|
84
89
|
return null;
|
|
85
90
|
}
|
|
86
|
-
|
|
87
91
|
if (process.env.NODE_ENV !== 'production') {
|
|
88
92
|
if (typeof window === 'undefined') return null;
|
|
89
93
|
return React__default["default"].createElement(Box.Box, {
|
|
@@ -97,7 +101,7 @@ var SafeQueryError = function (_a) {
|
|
|
97
101
|
"box-margin-right": '5xl'
|
|
98
102
|
}, React__default["default"].createElement(Text.Text, {
|
|
99
103
|
"text-color": 'white'
|
|
100
|
-
}, "\u0412\u043E\u0437\u043D\u0438\u043A\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430:", ' ', React__default["default"].createElement(Text.Text, {
|
|
104
|
+
}, t(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\u0412\u043E\u0437\u043D\u0438\u043A\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430:"], ["\u0412\u043E\u0437\u043D\u0438\u043A\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430:"]))), ' ', React__default["default"].createElement(Text.Text, {
|
|
101
105
|
"text-weight": 'bold',
|
|
102
106
|
style: {
|
|
103
107
|
fontFamily: 'Consolas, "Liberation Mono", Menlo, monospace',
|
|
@@ -110,7 +114,7 @@ var SafeQueryError = function (_a) {
|
|
|
110
114
|
"button-padding": 'xxs',
|
|
111
115
|
"button-theme": 'white-inherit',
|
|
112
116
|
onClick: onReload,
|
|
113
|
-
title:
|
|
117
|
+
title: t(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C"], ["\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C"])))
|
|
114
118
|
}, React__default["default"].createElement("svg", {
|
|
115
119
|
xmlns: 'http://www.w3.org/2000/svg',
|
|
116
120
|
viewBox: '0 0 18 18',
|
|
@@ -125,7 +129,7 @@ var SafeQueryError = function (_a) {
|
|
|
125
129
|
onClick: function () {
|
|
126
130
|
return setHidden(true);
|
|
127
131
|
},
|
|
128
|
-
title:
|
|
132
|
+
title: t(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\u0421\u043A\u0440\u044B\u0442\u044C"], ["\u0421\u043A\u0440\u044B\u0442\u044C"])))
|
|
129
133
|
}, React__default["default"].createElement("svg", {
|
|
130
134
|
xmlns: 'http://www.w3.org/2000/svg',
|
|
131
135
|
viewBox: '0 0 24 24',
|
|
@@ -136,30 +140,26 @@ var SafeQueryError = function (_a) {
|
|
|
136
140
|
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'
|
|
137
141
|
})))));
|
|
138
142
|
}
|
|
139
|
-
|
|
140
143
|
return null;
|
|
141
144
|
};
|
|
145
|
+
var templateObject_1, templateObject_2, templateObject_3;
|
|
142
146
|
|
|
143
147
|
var SafeQuery = function (_a) {
|
|
144
148
|
var _b = _a.componentErrorName,
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
+
componentErrorName = _b === void 0 ? 'SafeQuery' : _b,
|
|
150
|
+
children = _a.children,
|
|
151
|
+
props = __rest(_a, ["componentErrorName", "children"]);
|
|
149
152
|
var _c = React__namespace.useState(false),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
+
isReload = _c[0],
|
|
154
|
+
setReload = _c[1];
|
|
153
155
|
React__namespace.useEffect(function () {
|
|
154
156
|
if (isReload) {
|
|
155
157
|
setReload(false);
|
|
156
158
|
}
|
|
157
159
|
}, [isReload]);
|
|
158
|
-
|
|
159
160
|
if (isReload) {
|
|
160
161
|
return null;
|
|
161
162
|
}
|
|
162
|
-
|
|
163
163
|
var errorComponent = React__namespace.createElement(SafeQueryError, {
|
|
164
164
|
componentErrorName: componentErrorName,
|
|
165
165
|
onReload: function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@apollo/client/react/components"),r=require("@evo/errcatch"),n=require("@prom-ui/core/Box"),o=require("@prom-ui/core/Button"),a=require("@prom-ui/core/Text");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@apollo/client/react/components"),r=require("@evo/errcatch"),n=require("@prom-ui/core/Box"),o=require("@prom-ui/core/Button"),a=require("@prom-ui/core/Text"),l=require("@prom-ui/core/BodyProvider");function i(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 c=i(e),f=u(e),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 p(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var s,m,b,h="RWb3q",x=function(t){var r=t.componentErrorName,i=t.onReload,u=l.useBodyLocale().t,f=e.useState(!1),d=f[0],x=f[1];return d?null:"production"!==process.env.NODE_ENV?"undefined"==typeof window?null:c.default.createElement(n.Box,{className:h,"box-background":"red-500","box-padding":["s m","m@large l@large"],"box-position":"relative","box-round":"m","data-qaid":"err_catch_trace"},c.default.createElement(n.Box,{"box-margin-right":"5xl"},c.default.createElement(a.Text,{"text-color":"white"},u(s||(s=p(["Возникла ошибка:"],["Возникла ошибка:"])))," ",c.default.createElement(a.Text,{"text-weight":"bold",style:{fontFamily:'Consolas, "Liberation Mono", Menlo, monospace',userSelect:"all"}},r))),c.default.createElement(n.Box,{"box-position":"absolute center-right","box-margin-right":"s"},c.default.createElement(o.Button,{"button-padding":"xxs","button-theme":"white-inherit",onClick:i,title:u(m||(m=p(["Обновить"],["Обновить"])))},c.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",width:18,height:18},c.default.createElement("path",{fill:"#fff",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"}))),c.default.createElement(o.Button,{"button-padding":"xxs","button-theme":"white-inherit",onClick:function(){return x(!0)},title:u(b||(b=p(["Скрыть"],["Скрыть"])))},c.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:18,height:18},c.default.createElement("path",{fill:"#fff",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"}))))):null};exports.SafeQuery=function(e){var n=e.componentErrorName,o=void 0===n?"SafeQuery":n,a=e.children,l=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,["componentErrorName","children"]),i=f.useState(!1),u=i[0],c=i[1];if(f.useEffect((function(){u&&c(!1)}),[u]),u)return null;var p=f.createElement(x,{componentErrorName:o,onReload:function(){return c(!0)}});return f.createElement(r.ErrCatch,{name:o,errorComponent:p},f.createElement(t.Query,d({},l),(function(e){var t=e.error;if(t)throw t;return a(e)})))},require("./style.production.css");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@apollo/client/react/components"),r=require("@evo/errcatch"),n=require("@prom-ui/core/Box"),o=require("@prom-ui/core/Button"),a=require("@prom-ui/core/Text");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@apollo/client/react/components"),r=require("@evo/errcatch"),n=require("@prom-ui/core/Box"),o=require("@prom-ui/core/Button"),a=require("@prom-ui/core/Text"),l=require("@prom-ui/core/BodyProvider");function i(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 c=i(e),f=u(e),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 p(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var s,m,h,b="IHinP",x=function(t){var r=t.componentErrorName,i=t.onReload,u=l.useBodyLocale().t,f=e.useState(!1),d=f[0],x=f[1];return d?null:"production"!==process.env.NODE_ENV?"undefined"==typeof window?null:c.default.createElement(n.Box,{className:b,"box-background":"red-500","box-padding":["s m","m@large l@large"],"box-position":"relative","box-round":"m","data-qaid":"err_catch_trace"},c.default.createElement(n.Box,{"box-margin-right":"5xl"},c.default.createElement(a.Text,{"text-color":"white"},u(s||(s=p(["Возникла ошибка:"],["Возникла ошибка:"])))," ",c.default.createElement(a.Text,{"text-weight":"bold",style:{fontFamily:'Consolas, "Liberation Mono", Menlo, monospace',userSelect:"all"}},r))),c.default.createElement(n.Box,{"box-position":"absolute center-right","box-margin-right":"s"},c.default.createElement(o.Button,{"button-padding":"xxs","button-theme":"white-inherit",onClick:i,title:u(m||(m=p(["Обновить"],["Обновить"])))},c.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 18 18",width:18,height:18},c.default.createElement("path",{fill:"#fff",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"}))),c.default.createElement(o.Button,{"button-padding":"xxs","button-theme":"white-inherit",onClick:function(){return x(!0)},title:u(h||(h=p(["Скрыть"],["Скрыть"])))},c.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:18,height:18},c.default.createElement("path",{fill:"#fff",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"}))))):null};exports.SafeQuery=function(e){var n=e.componentErrorName,o=void 0===n?"SafeQuery":n,a=e.children,l=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,["componentErrorName","children"]),i=f.useState(!1),u=i[0],c=i[1];if(f.useEffect((function(){u&&c(!1)}),[u]),u)return null;var p=f.createElement(x,{componentErrorName:o,onReload:function(){return c(!0)}});return f.createElement(r.ErrCatch,{name:o,errorComponent:p},f.createElement(t.Query,d({},l),(function(e){var t=e.error;if(t)throw t;return a(e)})))},require("./style.production.v2.css");
|
package/SafeQuery/package.json
CHANGED
package/Scroll/package.json
CHANGED
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var classNames = require('classnames');
|
|
7
|
-
var ttag = require('ttag');
|
|
8
7
|
var Button = require('@prom-ui/core/Button');
|
|
9
8
|
var Icon = require('@prom-ui/core/Icon');
|
|
9
|
+
var BodyProvider = require('@prom-ui/core/BodyProvider');
|
|
10
10
|
var Left = require('@prom-ui/icons/Left');
|
|
11
11
|
var Right = require('@prom-ui/icons/Right');
|
|
12
12
|
|
|
@@ -84,43 +84,40 @@ var DIRECTION_PREV = -1;
|
|
|
84
84
|
var CONTROLS_UPDATE_DELAY = 100;
|
|
85
85
|
var ScrollControlsButton = function (_a) {
|
|
86
86
|
var _b, _c;
|
|
87
|
-
|
|
88
87
|
var scrollRef = _a.scrollRef,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
_d = _a.hideOnDisabled,
|
|
89
|
+
hideOnDisabled = _d === void 0 ? false : _d,
|
|
90
|
+
_e = _a.isActive,
|
|
91
|
+
isActive = _e === void 0 ? true : _e,
|
|
92
|
+
onClickNext = _a.onClickNext,
|
|
93
|
+
onClickPrev = _a.onClickPrev,
|
|
94
|
+
zIndex = _a.zIndex,
|
|
95
|
+
_f = _a.theme,
|
|
96
|
+
theme = _f === void 0 ? 'white' : _f,
|
|
97
|
+
children = _a.children;
|
|
98
|
+
var t = BodyProvider.useBodyLocale().t;
|
|
99
99
|
var updateControlsTimer = React.useRef(null);
|
|
100
|
-
|
|
101
100
|
var _g = React.useState({
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
101
|
+
prev: false,
|
|
102
|
+
next: false
|
|
103
|
+
}),
|
|
104
|
+
controlsVisible = _g[0],
|
|
105
|
+
setControlsVisible = _g[1];
|
|
108
106
|
var updateControlsVisible = function (nextScrollLeft) {
|
|
109
107
|
var _a = scrollRef.current,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
108
|
+
scrollLeft = _a.scrollLeft,
|
|
109
|
+
scrollWidth = _a.scrollWidth,
|
|
110
|
+
clientWidth = _a.clientWidth;
|
|
113
111
|
var currentScrollLeft = (Number.isInteger(nextScrollLeft) ? nextScrollLeft : scrollLeft) || 0;
|
|
114
112
|
setControlsVisible({
|
|
115
113
|
prev: currentScrollLeft > 1,
|
|
116
114
|
next: currentScrollLeft < scrollWidth - clientWidth
|
|
117
115
|
});
|
|
118
116
|
};
|
|
119
|
-
|
|
120
117
|
var updateScrollLeft = function (direction) {
|
|
121
118
|
var _a = scrollRef.current,
|
|
122
|
-
|
|
123
|
-
|
|
119
|
+
scrollLeft = _a.scrollLeft,
|
|
120
|
+
clientWidth = _a.clientWidth;
|
|
124
121
|
var offset = clientWidth * direction;
|
|
125
122
|
updateControlsVisible(scrollLeft + offset);
|
|
126
123
|
requestAnimationFrame(function () {
|
|
@@ -132,41 +129,33 @@ var ScrollControlsButton = function (_a) {
|
|
|
132
129
|
}
|
|
133
130
|
});
|
|
134
131
|
};
|
|
135
|
-
|
|
136
132
|
var handleOnClickPrev = function () {
|
|
137
133
|
if (typeof onClickPrev === 'function') {
|
|
138
134
|
onClickPrev();
|
|
139
135
|
}
|
|
140
|
-
|
|
141
136
|
updateScrollLeft(DIRECTION_PREV);
|
|
142
137
|
};
|
|
143
|
-
|
|
144
138
|
var handleOnClickNext = function () {
|
|
145
139
|
if (typeof onClickNext === 'function') {
|
|
146
140
|
onClickNext();
|
|
147
141
|
}
|
|
148
|
-
|
|
149
142
|
updateScrollLeft(DIRECTION_NEXT);
|
|
150
143
|
};
|
|
151
|
-
|
|
152
144
|
var handleOnScroll = function () {
|
|
153
145
|
clearTimeout(updateControlsTimer.current || 0);
|
|
154
146
|
updateControlsTimer.current = setTimeout(updateControlsVisible, CONTROLS_UPDATE_DELAY);
|
|
155
147
|
};
|
|
156
|
-
|
|
157
148
|
React.useEffect(function () {
|
|
158
149
|
if (scrollRef.current && isActive) {
|
|
159
150
|
updateControlsVisible();
|
|
160
151
|
scrollRef.current.addEventListener('scroll', handleOnScroll);
|
|
161
152
|
}
|
|
162
|
-
|
|
163
153
|
return function () {
|
|
164
154
|
if (scrollRef.current && isActive) {
|
|
165
155
|
scrollRef.current.removeEventListener('scroll', handleOnScroll);
|
|
166
156
|
}
|
|
167
157
|
};
|
|
168
158
|
}, [isActive, children]);
|
|
169
|
-
|
|
170
159
|
if (isActive && (controlsVisible.prev || controlsVisible.next)) {
|
|
171
160
|
return React__default["default"].createElement(React__default["default"].Fragment, null, React__default["default"].createElement(Button.Button, {
|
|
172
161
|
"button-theme": theme,
|
|
@@ -179,7 +168,7 @@ var ScrollControlsButton = function (_a) {
|
|
|
179
168
|
zIndex: zIndex
|
|
180
169
|
},
|
|
181
170
|
disabled: !controlsVisible.prev,
|
|
182
|
-
title:
|
|
171
|
+
title: t(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\u041D\u0430\u0437\u0430\u0434"], ["\u041D\u0430\u0437\u0430\u0434"])))
|
|
183
172
|
}, React__default["default"].createElement(Icon.Icon, {
|
|
184
173
|
className: css.icon,
|
|
185
174
|
"icon-as": Left.Left
|
|
@@ -194,35 +183,32 @@ var ScrollControlsButton = function (_a) {
|
|
|
194
183
|
zIndex: zIndex
|
|
195
184
|
},
|
|
196
185
|
disabled: !controlsVisible.next,
|
|
197
|
-
title:
|
|
186
|
+
title: t(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\u0414\u0430\u043B\u0435\u0435"], ["\u0414\u0430\u043B\u0435\u0435"])))
|
|
198
187
|
}, React__default["default"].createElement(Icon.Icon, {
|
|
199
188
|
className: css.icon,
|
|
200
189
|
"icon-as": Right.Right
|
|
201
190
|
})));
|
|
202
191
|
}
|
|
203
|
-
|
|
204
192
|
return null;
|
|
205
193
|
};
|
|
206
194
|
var templateObject_1, templateObject_2;
|
|
207
195
|
|
|
208
196
|
var ScrollControls = React__namespace.forwardRef(function (_a, ref) {
|
|
209
197
|
var _b;
|
|
210
|
-
|
|
211
198
|
var children = _a.children,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
199
|
+
className = _a.className,
|
|
200
|
+
_c = _a.hideOnDisabled,
|
|
201
|
+
hideOnDisabled = _c === void 0 ? false : _c,
|
|
202
|
+
_d = _a.isActive,
|
|
203
|
+
isActive = _d === void 0 ? true : _d,
|
|
204
|
+
onClickNext = _a.onClickNext,
|
|
205
|
+
onClickPrev = _a.onClickPrev,
|
|
206
|
+
_e = _a.showOnHover,
|
|
207
|
+
showOnHover = _e === void 0 ? false : _e,
|
|
208
|
+
zIndex = _a.zIndex,
|
|
209
|
+
_f = _a.theme,
|
|
210
|
+
theme = _f === void 0 ? 'white' : _f,
|
|
211
|
+
props = __rest(_a, ["children", "className", "hideOnDisabled", "isActive", "onClickNext", "onClickPrev", "showOnHover", "zIndex", "theme"]);
|
|
226
212
|
var scrollRef = React__namespace.useRef(null);
|
|
227
213
|
return React__namespace.createElement("div", __assign({
|
|
228
214
|
ref: ref,
|