@prom-ui/core 1.18.0 → 1.19.1
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/package.json +1 -1
- package/Backdrop/package.json +1 -1
- package/Badge/package.json +1 -1
- package/Body/package.json +1 -1
- package/BodyContext/package.json +1 -1
- package/BodyProvider/cjs/index.development.js +18 -18
- package/BodyProvider/cjs/index.development.v2.js +18 -18
- package/BodyProvider/cjs/index.production.js +1 -1
- package/BodyProvider/cjs/index.production.v2.js +1 -1
- package/BodyProvider/package.json +1 -1
- package/BodyScrollLock/package.json +1 -1
- package/Box/cjs/index.development.js +1 -1
- package/Box/cjs/index.development.v2.js +1 -1
- package/Box/cjs/index.production.js +1 -1
- package/Box/cjs/index.production.v2.js +1 -1
- package/Box/cjs/style.development.css +1 -1
- package/Box/cjs/style.development.v2.css +1 -1
- package/Box/cjs/style.production.css +1 -1
- package/Box/cjs/style.production.v2.css +1 -1
- package/Box/index.d.ts +2 -2
- package/Box/package.json +1 -1
- package/Button/package.json +1 -1
- package/ButtonPageUp/package.json +1 -1
- package/Checkbox/cjs/index.development.js +9 -4
- package/Checkbox/cjs/index.development.v2.js +9 -4
- package/Checkbox/cjs/index.production.js +1 -1
- package/Checkbox/cjs/index.production.v2.js +1 -1
- package/Checkbox/cjs/style.development.css +1 -1
- package/Checkbox/cjs/style.development.v2.css +1 -1
- package/Checkbox/cjs/style.production.css +1 -1
- package/Checkbox/cjs/style.production.v2.css +1 -1
- package/Checkbox/index.d.ts +1 -0
- package/Checkbox/package.json +1 -1
- package/ContextMenu/cjs/index.development.js +262 -0
- package/ContextMenu/cjs/index.development.v2.js +262 -0
- package/ContextMenu/cjs/index.production.js +1 -0
- package/ContextMenu/cjs/index.production.v2.js +1 -0
- package/ContextMenu/cjs/style.development.css +1 -0
- package/ContextMenu/cjs/style.development.v2.css +1 -0
- package/ContextMenu/cjs/style.production.css +1 -0
- package/ContextMenu/cjs/style.production.v2.css +1 -0
- package/ContextMenu/index.d.ts +25 -0
- package/ContextMenu/index.js +7 -0
- package/ContextMenu/index.v2.js +7 -0
- package/ContextMenu/package.json +12 -0
- package/ErrorCatch/ErrorCatch.d.ts +30 -0
- package/ErrorCatch/cjs/index.development.js +367 -0
- package/ErrorCatch/cjs/index.development.v2.js +367 -0
- package/ErrorCatch/cjs/index.production.js +1 -0
- package/ErrorCatch/cjs/index.production.v2.js +1 -0
- package/ErrorCatch/cjs/style.development.css +1 -0
- package/ErrorCatch/cjs/style.development.v2.css +1 -0
- package/ErrorCatch/cjs/style.production.css +1 -0
- package/ErrorCatch/cjs/style.production.v2.css +1 -0
- package/ErrorCatch/components/ErrorView.d.ts +7 -0
- package/ErrorCatch/index.d.ts +4 -0
- package/ErrorCatch/index.js +7 -0
- package/ErrorCatch/index.v2.js +7 -0
- package/ErrorCatch/package.json +9 -0
- package/ErrorCatch/utils.d.ts +4 -0
- package/ErrorCatch/withErrorCatch.d.ts +3 -0
- package/Flex/package.json +1 -1
- package/Grid/package.json +1 -1
- package/Icon/package.json +1 -1
- package/Image/package.json +1 -1
- package/ImageEmoji/package.json +1 -1
- package/Input/cjs/style.development.css +1 -1
- package/Input/cjs/style.development.v2.css +1 -1
- package/Input/cjs/style.production.css +1 -1
- package/Input/cjs/style.production.v2.css +1 -1
- package/Input/package.json +1 -1
- package/InputField/package.json +1 -1
- package/KeyPress/package.json +1 -1
- package/Label/package.json +1 -1
- package/Line/package.json +1 -1
- package/Link/package.json +1 -1
- package/List/package.json +1 -1
- package/Media/package.json +1 -1
- package/Modal/cjs/index.development.js +2 -2
- package/Modal/cjs/index.development.v2.js +2 -2
- package/Modal/cjs/index.production.js +1 -1
- package/Modal/cjs/index.production.v2.js +1 -1
- package/Modal/package.json +1 -1
- package/OutsideClick/package.json +1 -1
- package/Overlay/cjs/index.development.js +6 -6
- package/Overlay/cjs/index.development.v2.js +6 -6
- package/Overlay/cjs/index.production.js +1 -1
- package/Overlay/cjs/index.production.v2.js +1 -1
- package/Overlay/package.json +1 -2
- package/PhotoGallery/cjs/index.development.js +4 -1
- package/PhotoGallery/cjs/index.development.v2.js +4 -1
- package/PhotoGallery/cjs/index.production.js +1 -1
- package/PhotoGallery/cjs/index.production.v2.js +1 -1
- package/PhotoGallery/cjs/style.development.css +1 -1
- package/PhotoGallery/cjs/style.development.v2.css +1 -1
- package/PhotoGallery/cjs/style.production.css +1 -1
- package/PhotoGallery/cjs/style.production.v2.css +1 -1
- package/PhotoGallery/index.d.ts +1 -1
- package/PhotoGallery/package.json +1 -1
- package/Picture/cjs/index.development.js +1 -1
- package/Picture/cjs/index.development.v2.js +1 -1
- package/Picture/cjs/index.production.js +1 -1
- package/Picture/cjs/index.production.v2.js +1 -1
- package/Picture/cjs/style.development.css +1 -1
- package/Picture/cjs/style.development.v2.css +1 -1
- package/Picture/cjs/style.production.css +1 -1
- package/Picture/cjs/style.production.v2.css +1 -1
- package/Picture/index.d.ts +1 -1
- package/Picture/package.json +1 -1
- package/Portal/package.json +1 -1
- package/Progress/cjs/index.development.js +3 -9
- package/Progress/cjs/index.development.v2.js +3 -9
- package/Progress/cjs/index.production.js +1 -1
- package/Progress/cjs/index.production.v2.js +1 -1
- package/Progress/package.json +1 -1
- package/QRCode/package.json +1 -1
- package/Rating/package.json +1 -1
- package/RatingSelect/package.json +1 -1
- package/SafeQuery/cjs/index.development.js +3 -157
- package/SafeQuery/cjs/index.development.v2.js +3 -157
- package/SafeQuery/cjs/index.production.js +1 -1
- package/SafeQuery/cjs/index.production.v2.js +1 -1
- package/SafeQuery/package.json +2 -5
- package/Scroll/package.json +1 -1
- package/ScrollControls/ScrollControlsButton.d.ts +2 -2
- package/ScrollControls/cjs/index.development.js +4 -4
- package/ScrollControls/cjs/index.development.v2.js +4 -4
- package/ScrollControls/cjs/index.production.js +1 -1
- package/ScrollControls/cjs/index.production.v2.js +1 -1
- package/ScrollControls/index.d.ts +5 -4
- package/ScrollControls/package.json +1 -1
- package/SimpleSlider/cjs/style.development.css +1 -1
- package/SimpleSlider/cjs/style.development.v2.css +1 -1
- package/SimpleSlider/cjs/style.production.css +1 -1
- package/SimpleSlider/cjs/style.production.v2.css +1 -1
- package/SimpleSlider/package.json +1 -1
- package/Skeleton/package.json +1 -1
- package/SnackBar/package.json +1 -1
- package/SnackBarManager/package.json +1 -1
- package/Spinner/package.json +1 -1
- package/Text/package.json +1 -1
- package/TextEmoji/package.json +1 -1
- package/Tooltip/cjs/index.development.js +1 -1
- package/Tooltip/cjs/index.development.v2.js +1 -1
- package/Tooltip/cjs/index.production.js +1 -1
- package/Tooltip/cjs/index.production.v2.js +1 -1
- package/Tooltip/package.json +1 -1
- package/Tumbler/cjs/style.development.css +1 -1
- package/Tumbler/cjs/style.development.v2.css +1 -1
- package/Tumbler/cjs/style.production.css +1 -1
- package/Tumbler/cjs/style.production.v2.css +1 -1
- package/Tumbler/package.json +1 -1
- package/Viewport/cjs/index.development.js +113 -0
- package/Viewport/cjs/index.development.v2.js +113 -0
- package/Viewport/cjs/index.production.js +1 -0
- package/Viewport/cjs/index.production.v2.js +1 -0
- package/Viewport/index.d.ts +15 -0
- package/Viewport/index.js +7 -0
- package/Viewport/index.v2.js +7 -0
- package/Viewport/package.json +9 -0
- package/package.json +3 -3
- package/useBodyTTag/package.json +1 -1
- package/useBrowserLayoutEffect/package.json +1 -1
- package/useDebounce/package.json +1 -1
- package/useForwardRef/package.json +1 -1
- package/useId/package.json +1 -1
- package/useInView/cjs/index.development.js +15 -0
- package/useInView/cjs/index.development.v2.js +15 -0
- package/useInView/cjs/index.production.js +1 -0
- package/useInView/cjs/index.production.v2.js +1 -0
- package/useInView/index.d.ts +9 -0
- package/useInView/index.js +7 -0
- package/useInView/index.v2.js +7 -0
- package/useInView/package.json +13 -0
- package/useIsMounted/package.json +1 -1
- package/useKeyPress/package.json +1 -1
- package/useMedia/package.json +1 -1
- package/useOutsideClick/package.json +1 -1
- package/usePortal/package.json +1 -1
- package/useScrollPosition/package.json +1 -1
- package/useSnackBar/package.json +1 -1
- package/SafeQuery/cjs/style.development.css +0 -1
- package/SafeQuery/cjs/style.development.v2.css +0 -1
- package/SafeQuery/cjs/style.production.css +0 -1
- package/SafeQuery/cjs/style.production.v2.css +0 -1
- package/SafeQuery/components/Error.d.ts +0 -7
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var React = require('react');
|
|
6
|
+
var Button = require('@prom-ui/core/Button');
|
|
7
|
+
var useBodyTTag = require('@prom-ui/core/useBodyTTag');
|
|
8
|
+
var Reload = require('@prom-ui/icons/Reload');
|
|
9
|
+
var Close = require('@prom-ui/icons/Close');
|
|
10
|
+
|
|
11
|
+
function _interopNamespaceCompat(e) {
|
|
12
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
13
|
+
var n = Object.create(null);
|
|
14
|
+
if (e) {
|
|
15
|
+
Object.keys(e).forEach(function (k) {
|
|
16
|
+
if (k !== 'default') {
|
|
17
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return e[k]; }
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
n.default = e;
|
|
26
|
+
return Object.freeze(n);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
30
|
+
|
|
31
|
+
var logError = function logError(msg, error, info) {
|
|
32
|
+
console.error(msg, error, info);
|
|
33
|
+
};
|
|
34
|
+
var setErrorCatchLog = function setErrorCatchLog(fn) {
|
|
35
|
+
logError = fn;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
function _iterableToArrayLimit(arr, i) {
|
|
39
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
40
|
+
if (null != _i) {
|
|
41
|
+
var _s,
|
|
42
|
+
_e,
|
|
43
|
+
_x,
|
|
44
|
+
_r,
|
|
45
|
+
_arr = [],
|
|
46
|
+
_n = !0,
|
|
47
|
+
_d = !1;
|
|
48
|
+
try {
|
|
49
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
50
|
+
if (Object(_i) !== _i) return;
|
|
51
|
+
_n = !1;
|
|
52
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
53
|
+
} catch (err) {
|
|
54
|
+
_d = !0, _e = err;
|
|
55
|
+
} finally {
|
|
56
|
+
try {
|
|
57
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
58
|
+
} finally {
|
|
59
|
+
if (_d) throw _e;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return _arr;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
function _classCallCheck(instance, Constructor) {
|
|
66
|
+
if (!(instance instanceof Constructor)) {
|
|
67
|
+
throw new TypeError("Cannot call a class as a function");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function _defineProperties(target, props) {
|
|
71
|
+
for (var i = 0; i < props.length; i++) {
|
|
72
|
+
var descriptor = props[i];
|
|
73
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
|
74
|
+
descriptor.configurable = true;
|
|
75
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
76
|
+
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
|
80
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
81
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
82
|
+
Object.defineProperty(Constructor, "prototype", {
|
|
83
|
+
writable: false
|
|
84
|
+
});
|
|
85
|
+
return Constructor;
|
|
86
|
+
}
|
|
87
|
+
function _defineProperty(obj, key, value) {
|
|
88
|
+
key = _toPropertyKey(key);
|
|
89
|
+
if (key in obj) {
|
|
90
|
+
Object.defineProperty(obj, key, {
|
|
91
|
+
value: value,
|
|
92
|
+
enumerable: true,
|
|
93
|
+
configurable: true,
|
|
94
|
+
writable: true
|
|
95
|
+
});
|
|
96
|
+
} else {
|
|
97
|
+
obj[key] = value;
|
|
98
|
+
}
|
|
99
|
+
return obj;
|
|
100
|
+
}
|
|
101
|
+
function _inherits(subClass, superClass) {
|
|
102
|
+
if (typeof superClass !== "function" && superClass !== null) {
|
|
103
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
104
|
+
}
|
|
105
|
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
|
106
|
+
constructor: {
|
|
107
|
+
value: subClass,
|
|
108
|
+
writable: true,
|
|
109
|
+
configurable: true
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
Object.defineProperty(subClass, "prototype", {
|
|
113
|
+
writable: false
|
|
114
|
+
});
|
|
115
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
116
|
+
}
|
|
117
|
+
function _getPrototypeOf(o) {
|
|
118
|
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
|
|
119
|
+
return o.__proto__ || Object.getPrototypeOf(o);
|
|
120
|
+
};
|
|
121
|
+
return _getPrototypeOf(o);
|
|
122
|
+
}
|
|
123
|
+
function _setPrototypeOf(o, p) {
|
|
124
|
+
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
125
|
+
o.__proto__ = p;
|
|
126
|
+
return o;
|
|
127
|
+
};
|
|
128
|
+
return _setPrototypeOf(o, p);
|
|
129
|
+
}
|
|
130
|
+
function _isNativeReflectConstruct() {
|
|
131
|
+
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
132
|
+
if (Reflect.construct.sham) return false;
|
|
133
|
+
if (typeof Proxy === "function") return true;
|
|
134
|
+
try {
|
|
135
|
+
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
136
|
+
return true;
|
|
137
|
+
} catch (e) {
|
|
138
|
+
return false;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
function _assertThisInitialized(self) {
|
|
142
|
+
if (self === void 0) {
|
|
143
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
144
|
+
}
|
|
145
|
+
return self;
|
|
146
|
+
}
|
|
147
|
+
function _possibleConstructorReturn(self, call) {
|
|
148
|
+
if (call && (typeof call === "object" || typeof call === "function")) {
|
|
149
|
+
return call;
|
|
150
|
+
} else if (call !== void 0) {
|
|
151
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
152
|
+
}
|
|
153
|
+
return _assertThisInitialized(self);
|
|
154
|
+
}
|
|
155
|
+
function _createSuper(Derived) {
|
|
156
|
+
var hasNativeReflectConstruct = _isNativeReflectConstruct();
|
|
157
|
+
return function _createSuperInternal() {
|
|
158
|
+
var Super = _getPrototypeOf(Derived),
|
|
159
|
+
result;
|
|
160
|
+
if (hasNativeReflectConstruct) {
|
|
161
|
+
var NewTarget = _getPrototypeOf(this).constructor;
|
|
162
|
+
result = Reflect.construct(Super, arguments, NewTarget);
|
|
163
|
+
} else {
|
|
164
|
+
result = Super.apply(this, arguments);
|
|
165
|
+
}
|
|
166
|
+
return _possibleConstructorReturn(this, result);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
function _taggedTemplateLiteral(strings, raw) {
|
|
170
|
+
if (!raw) {
|
|
171
|
+
raw = strings.slice(0);
|
|
172
|
+
}
|
|
173
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
174
|
+
raw: {
|
|
175
|
+
value: Object.freeze(raw)
|
|
176
|
+
}
|
|
177
|
+
}));
|
|
178
|
+
}
|
|
179
|
+
function _slicedToArray(arr, i) {
|
|
180
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
181
|
+
}
|
|
182
|
+
function _arrayWithHoles(arr) {
|
|
183
|
+
if (Array.isArray(arr)) return arr;
|
|
184
|
+
}
|
|
185
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
186
|
+
if (!o) return;
|
|
187
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
188
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
189
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
190
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
191
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
192
|
+
}
|
|
193
|
+
function _arrayLikeToArray(arr, len) {
|
|
194
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
195
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
196
|
+
return arr2;
|
|
197
|
+
}
|
|
198
|
+
function _nonIterableRest() {
|
|
199
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
200
|
+
}
|
|
201
|
+
function _toPrimitive(input, hint) {
|
|
202
|
+
if (typeof input !== "object" || input === null) return input;
|
|
203
|
+
var prim = input[Symbol.toPrimitive];
|
|
204
|
+
if (prim !== undefined) {
|
|
205
|
+
var res = prim.call(input, hint || "default");
|
|
206
|
+
if (typeof res !== "object") return res;
|
|
207
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
208
|
+
}
|
|
209
|
+
return (hint === "string" ? String : Number)(input);
|
|
210
|
+
}
|
|
211
|
+
function _toPropertyKey(arg) {
|
|
212
|
+
var key = _toPrimitive(arg, "string");
|
|
213
|
+
return typeof key === "symbol" ? key : String(key);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
var css = {"root":"ErrorCatch__root___MgWkO","text":"ErrorCatch__text___mFI5O","name":"ErrorCatch__name___-bzUk","button":"ErrorCatch__button___9tlvu"};
|
|
217
|
+
|
|
218
|
+
var _templateObject, _templateObject2, _templateObject3;
|
|
219
|
+
var ErrorView = function ErrorView(_ref) {
|
|
220
|
+
var name = _ref.name,
|
|
221
|
+
onClose = _ref.onClose,
|
|
222
|
+
onReload = _ref.onReload;
|
|
223
|
+
var _React$useState = React__namespace.useState(false),
|
|
224
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
225
|
+
isLoading = _React$useState2[0],
|
|
226
|
+
setLoading = _React$useState2[1];
|
|
227
|
+
var _useBodyTTag = useBodyTTag.useBodyTTag(),
|
|
228
|
+
t = _useBodyTTag.t;
|
|
229
|
+
var handleOnReload = function handleOnReload() {
|
|
230
|
+
setLoading(true);
|
|
231
|
+
setTimeout(function () {
|
|
232
|
+
setLoading(false);
|
|
233
|
+
if (onReload) {
|
|
234
|
+
onReload();
|
|
235
|
+
}
|
|
236
|
+
}, 500);
|
|
237
|
+
};
|
|
238
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
239
|
+
return /*#__PURE__*/React__namespace.createElement("div", {
|
|
240
|
+
className: css.root,
|
|
241
|
+
"data-qaid": "error_catch",
|
|
242
|
+
"data-testid": "error_catch"
|
|
243
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
244
|
+
className: css.text,
|
|
245
|
+
"data-qaid": "error_catch_text",
|
|
246
|
+
"data-testid": "error_catch_text"
|
|
247
|
+
}, t(_templateObject || (_templateObject = _taggedTemplateLiteral(["\u041E\u0448\u0438\u0431\u043A\u0430:"]))), !!name && /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, ' ', /*#__PURE__*/React__namespace.createElement("span", {
|
|
248
|
+
className: css.name,
|
|
249
|
+
"data-qaid": "error_catch_component_name",
|
|
250
|
+
"data-testid": "error_catch_component_name"
|
|
251
|
+
}, name))), onReload && /*#__PURE__*/React__namespace.createElement(Button.Button, {
|
|
252
|
+
"button-theme": "white-inherit",
|
|
253
|
+
"button-padding": "xxs",
|
|
254
|
+
type: "button",
|
|
255
|
+
className: css.button,
|
|
256
|
+
onClick: handleOnReload,
|
|
257
|
+
title: t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\u041E\u0431\u043D\u043E\u0432\u0438\u0442\u044C"]))),
|
|
258
|
+
loading: isLoading,
|
|
259
|
+
"data-qaid": "error_catch_button_reload",
|
|
260
|
+
"data-testid": "error_catch_button_reload"
|
|
261
|
+
}, /*#__PURE__*/React__namespace.createElement(Reload.SvgReload, {
|
|
262
|
+
width: 18,
|
|
263
|
+
height: 18
|
|
264
|
+
})), onClose && /*#__PURE__*/React__namespace.createElement(Button.Button, {
|
|
265
|
+
"button-theme": "white-inherit",
|
|
266
|
+
"button-padding": "xxs",
|
|
267
|
+
type: "button",
|
|
268
|
+
disabled: isLoading,
|
|
269
|
+
className: css.button,
|
|
270
|
+
onClick: onClose,
|
|
271
|
+
title: t(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\u0421\u043A\u0440\u044B\u0442\u044C"]))),
|
|
272
|
+
"data-qaid": "error_catch_button_close",
|
|
273
|
+
"data-testid": "error_catch_button_close"
|
|
274
|
+
}, /*#__PURE__*/React__namespace.createElement(Close.SvgClose, {
|
|
275
|
+
width: 18,
|
|
276
|
+
height: 18
|
|
277
|
+
})));
|
|
278
|
+
}
|
|
279
|
+
return null;
|
|
280
|
+
};
|
|
281
|
+
ErrorView.displayName = 'ErrorView';
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* React-компонент, що перехоплює помилки JavaScript у будь-якому місці свого дочірнього дерева компонентів, реєструє ці помилки та відображає резервний користувацький інтерфейс.
|
|
285
|
+
*/
|
|
286
|
+
var ErrorCatch = /*#__PURE__*/function (_React$Component) {
|
|
287
|
+
_inherits(ErrorCatch, _React$Component);
|
|
288
|
+
var _super = _createSuper(ErrorCatch);
|
|
289
|
+
function ErrorCatch(props) {
|
|
290
|
+
var _this;
|
|
291
|
+
_classCallCheck(this, ErrorCatch);
|
|
292
|
+
_this = _super.call(this, props);
|
|
293
|
+
_defineProperty(_assertThisInitialized(_this), "onClose", function () {
|
|
294
|
+
_this.setState({
|
|
295
|
+
isHidden: true
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
_defineProperty(_assertThisInitialized(_this), "onReload", function () {
|
|
299
|
+
_this.setState({
|
|
300
|
+
isError: false
|
|
301
|
+
});
|
|
302
|
+
});
|
|
303
|
+
_this.state = {
|
|
304
|
+
isError: false,
|
|
305
|
+
isHidden: false
|
|
306
|
+
};
|
|
307
|
+
return _this;
|
|
308
|
+
}
|
|
309
|
+
_createClass(ErrorCatch, [{
|
|
310
|
+
key: "componentDidCatch",
|
|
311
|
+
value: function componentDidCatch(error, info) {
|
|
312
|
+
var name = this.props.name;
|
|
313
|
+
logError("".concat(name, ": Failed to render component"), error, info);
|
|
314
|
+
}
|
|
315
|
+
}, {
|
|
316
|
+
key: "render",
|
|
317
|
+
value: function render() {
|
|
318
|
+
var _this$props = this.props,
|
|
319
|
+
name = _this$props.name,
|
|
320
|
+
errorView = _this$props.errorView,
|
|
321
|
+
children = _this$props.children;
|
|
322
|
+
var _this$state = this.state,
|
|
323
|
+
isError = _this$state.isError,
|
|
324
|
+
isHidden = _this$state.isHidden;
|
|
325
|
+
if (isHidden) {
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
if (isError) {
|
|
329
|
+
if (typeof window === 'undefined') return null;
|
|
330
|
+
if (errorView && /*#__PURE__*/React__namespace.isValidElement(errorView)) {
|
|
331
|
+
return /*#__PURE__*/React__namespace.cloneElement(errorView, {
|
|
332
|
+
name: name,
|
|
333
|
+
onReload: this.onReload,
|
|
334
|
+
onClose: this.onClose
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
return null;
|
|
338
|
+
}
|
|
339
|
+
return children;
|
|
340
|
+
}
|
|
341
|
+
}], [{
|
|
342
|
+
key: "getDerivedStateFromError",
|
|
343
|
+
value: function getDerivedStateFromError() {
|
|
344
|
+
return {
|
|
345
|
+
isError: true
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
}]);
|
|
349
|
+
return ErrorCatch;
|
|
350
|
+
}(React__namespace.Component);
|
|
351
|
+
_defineProperty(ErrorCatch, "defaultProps", {
|
|
352
|
+
errorView: /*#__PURE__*/React__namespace.createElement(ErrorView, null)
|
|
353
|
+
});
|
|
354
|
+
|
|
355
|
+
var withErrorCatch = function withErrorCatch(Component, errorCatchProps) {
|
|
356
|
+
var WithErrorCatch = function WithErrorCatch(props) {
|
|
357
|
+
return /*#__PURE__*/React__namespace.createElement(ErrorCatch, errorCatchProps, /*#__PURE__*/React__namespace.createElement(Component, props));
|
|
358
|
+
};
|
|
359
|
+
WithErrorCatch.displayName = 'WithErrorCatch';
|
|
360
|
+
return WithErrorCatch;
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
exports.ErrorCatch = ErrorCatch;
|
|
364
|
+
exports.setErrorCatchLog = setErrorCatchLog;
|
|
365
|
+
exports.withErrorCatch = withErrorCatch;
|
|
366
|
+
|
|
367
|
+
require('./style.development.css');
|