@prom-ui/core 1.3.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Avatar/cjs/index.development.js +99 -67
- package/Avatar/cjs/index.development.v2.js +99 -67
- package/Avatar/cjs/index.production.js +1 -1
- package/Avatar/cjs/index.production.v2.js +1 -1
- package/Avatar/index.d.ts +14 -14
- package/Avatar/package.json +1 -1
- package/Avatar/utils.d.ts +2 -2
- package/Backdrop/cjs/index.development.js +131 -77
- package/Backdrop/cjs/index.development.v2.js +131 -77
- package/Backdrop/cjs/index.production.js +1 -1
- package/Backdrop/cjs/index.production.v2.js +1 -1
- package/Backdrop/index.d.ts +25 -25
- package/Backdrop/package.json +1 -1
- package/Body/cjs/index.development.js +2 -0
- package/Body/cjs/index.development.v2.js +2 -0
- package/Body/index.d.ts +36 -36
- package/Body/package.json +1 -1
- package/BodyContext/cjs/index.development.js +6 -7
- package/BodyContext/cjs/index.development.v2.js +6 -7
- package/BodyContext/cjs/index.production.js +1 -1
- package/BodyContext/cjs/index.production.v2.js +1 -1
- package/BodyContext/index.d.ts +12 -12
- package/BodyContext/package.json +1 -1
- package/BodyProvider/cjs/index.development.js +7 -6
- package/BodyProvider/cjs/index.development.v2.js +7 -6
- package/BodyProvider/index.d.ts +10 -10
- package/BodyProvider/package.json +1 -1
- package/Box/cjs/index.development.js +4 -4
- package/Box/cjs/index.development.v2.js +4 -4
- package/Box/index.d.ts +106 -106
- package/Box/package.json +1 -1
- package/Button/cjs/index.development.js +67 -62
- package/Button/cjs/index.development.v2.js +67 -62
- package/Button/cjs/index.production.js +1 -1
- package/Button/cjs/index.production.v2.js +1 -1
- package/Button/index.d.ts +45 -45
- package/Button/package.json +1 -1
- package/ButtonPageUp/cjs/index.development.js +195 -85
- package/ButtonPageUp/cjs/index.development.v2.js +195 -85
- package/ButtonPageUp/cjs/index.production.js +1 -1
- package/ButtonPageUp/cjs/index.production.v2.js +1 -1
- package/ButtonPageUp/index.d.ts +18 -18
- package/ButtonPageUp/package.json +1 -1
- package/Checkbox/cjs/index.development.js +99 -67
- package/Checkbox/cjs/index.development.v2.js +99 -67
- package/Checkbox/cjs/index.production.js +1 -1
- package/Checkbox/cjs/index.production.v2.js +1 -1
- package/Checkbox/index.d.ts +8 -8
- package/Checkbox/package.json +1 -1
- package/Flex/index.d.ts +34 -34
- package/Flex/package.json +1 -1
- package/Grid/index.d.ts +46 -46
- package/Grid/package.json +1 -1
- package/Icon/index.d.ts +9 -9
- package/Icon/package.json +1 -1
- package/Image/index.d.ts +42 -42
- package/Image/package.json +1 -1
- package/ImageEmoji/cjs/index.development.js +70 -63
- package/ImageEmoji/cjs/index.development.v2.js +70 -63
- package/ImageEmoji/cjs/index.production.js +1 -1
- package/ImageEmoji/cjs/index.production.v2.js +1 -1
- package/ImageEmoji/index.d.ts +9 -9
- package/ImageEmoji/package.json +1 -1
- package/Input/index.d.ts +18 -18
- package/Input/package.json +1 -1
- package/InputField/addons/AfterClearValue.d.ts +3 -3
- package/InputField/addons/AfterCorrectValue.d.ts +2 -2
- package/InputField/addons/AfterLoading.d.ts +2 -2
- package/InputField/addons/AfterTogglePassword.d.ts +6 -6
- package/InputField/addons/ErrorText.d.ts +6 -6
- package/InputField/cjs/index.development.js +237 -173
- package/InputField/cjs/index.development.v2.js +237 -173
- package/InputField/cjs/index.production.js +1 -1
- package/InputField/cjs/index.production.v2.js +1 -1
- package/InputField/index.d.ts +18 -18
- package/InputField/package.json +1 -1
- package/InputField/utils.d.ts +10 -10
- package/KeyPress/cjs/index.development.js +13 -13
- package/KeyPress/cjs/index.development.v2.js +13 -13
- package/KeyPress/index.d.ts +14 -14
- package/KeyPress/package.json +1 -1
- package/Line/index.d.ts +13 -13
- package/Line/package.json +1 -1
- package/Link/cjs/index.development.js +5 -5
- package/Link/cjs/index.development.v2.js +5 -5
- package/Link/index.d.ts +28 -28
- package/Link/package.json +1 -1
- package/List/index.d.ts +23 -23
- package/List/package.json +1 -1
- package/Media/MediaProvider.d.ts +8 -8
- package/Media/cjs/index.development.js +70 -19
- package/Media/cjs/index.development.v2.js +70 -19
- package/Media/cjs/index.production.js +1 -1
- package/Media/cjs/index.production.v2.js +1 -1
- package/Media/index.d.ts +20 -20
- package/Media/package.json +1 -1
- package/OutsideClick/cjs/index.development.js +117 -61
- package/OutsideClick/cjs/index.development.v2.js +117 -61
- package/OutsideClick/cjs/index.production.js +1 -1
- package/OutsideClick/cjs/index.production.v2.js +1 -1
- package/OutsideClick/index.d.ts +12 -12
- package/OutsideClick/package.json +1 -1
- package/Overlay/cjs/index.development.js +197 -183
- package/Overlay/cjs/index.development.v2.js +197 -183
- package/Overlay/cjs/index.production.js +1 -1
- package/Overlay/cjs/index.production.v2.js +1 -1
- package/Overlay/components/OverlayHeader.d.ts +11 -11
- package/Overlay/components/SwipeClose.d.ts +11 -11
- package/Overlay/components/TouchScrollable.d.ts +8 -8
- package/Overlay/index.d.ts +76 -76
- package/Overlay/package.json +1 -1
- package/Overlay/utils.d.ts +10 -10
- package/Picture/index.d.ts +70 -70
- package/Picture/package.json +1 -1
- package/Portal/cjs/index.development.js +11 -11
- package/Portal/cjs/index.development.v2.js +11 -11
- package/Portal/index.d.ts +10 -10
- package/Portal/package.json +1 -1
- package/QRCode/cjs/index.development.js +11 -11
- package/QRCode/cjs/index.development.v2.js +11 -11
- package/QRCode/index.d.ts +17 -17
- package/QRCode/package.json +1 -1
- package/Rating/cjs/index.development.js +75 -69
- package/Rating/cjs/index.development.v2.js +75 -69
- package/Rating/cjs/index.production.js +1 -1
- package/Rating/cjs/index.production.v2.js +1 -1
- package/Rating/index.d.ts +17 -17
- package/Rating/package.json +1 -1
- package/RatingSelect/cjs/index.development.js +148 -68
- package/RatingSelect/cjs/index.development.v2.js +148 -68
- package/RatingSelect/cjs/index.production.js +1 -1
- package/RatingSelect/cjs/index.production.v2.js +1 -1
- package/RatingSelect/index.d.ts +22 -18
- package/RatingSelect/package.json +1 -1
- package/SafeQuery/cjs/index.development.js +158 -110
- package/SafeQuery/cjs/index.development.v2.js +158 -110
- package/SafeQuery/cjs/index.production.js +1 -1
- package/SafeQuery/cjs/index.production.v2.js +1 -1
- package/SafeQuery/components/Error.d.ts +7 -7
- package/SafeQuery/index.d.ts +10 -10
- package/SafeQuery/package.json +1 -1
- package/Scroll/index.d.ts +25 -25
- package/Scroll/package.json +1 -1
- package/ScrollControls/ScrollControlsButton.d.ts +11 -11
- package/ScrollControls/cjs/index.development.js +201 -113
- package/ScrollControls/cjs/index.development.v2.js +201 -113
- package/ScrollControls/cjs/index.production.js +1 -1
- package/ScrollControls/cjs/index.production.v2.js +1 -1
- package/ScrollControls/index.d.ts +16 -16
- package/ScrollControls/package.json +1 -1
- package/SimpleSlider/cjs/index.development.js +270 -158
- package/SimpleSlider/cjs/index.development.v2.js +270 -158
- package/SimpleSlider/cjs/index.production.js +1 -1
- package/SimpleSlider/cjs/index.production.v2.js +1 -1
- package/SimpleSlider/index.d.ts +41 -41
- package/SimpleSlider/package.json +1 -1
- package/SimpleSlider/useAutoPlay.d.ts +3 -3
- package/SimpleSlider/utils.d.ts +19 -19
- package/Skeleton/cjs/index.development.js +118 -64
- package/Skeleton/cjs/index.development.v2.js +118 -64
- package/Skeleton/cjs/index.production.js +1 -1
- package/Skeleton/cjs/index.production.v2.js +1 -1
- package/Skeleton/index.d.ts +37 -37
- package/Skeleton/package.json +1 -1
- package/Spinner/cjs/index.development.js +66 -61
- package/Spinner/cjs/index.development.v2.js +66 -61
- package/Spinner/cjs/index.production.js +1 -1
- package/Spinner/cjs/index.production.v2.js +1 -1
- package/Spinner/index.d.ts +29 -29
- package/Spinner/package.json +1 -1
- package/Text/index.d.ts +25 -25
- package/Text/package.json +1 -1
- package/TextEmoji/cjs/index.development.js +65 -60
- package/TextEmoji/cjs/index.development.v2.js +65 -60
- package/TextEmoji/cjs/index.production.js +1 -1
- package/TextEmoji/cjs/index.production.v2.js +1 -1
- package/TextEmoji/index.d.ts +9 -9
- package/TextEmoji/package.json +1 -1
- package/Tooltip/cjs/index.development.js +80 -91
- package/Tooltip/cjs/index.development.v2.js +80 -91
- package/Tooltip/cjs/index.production.js +1 -1
- package/Tooltip/cjs/index.production.v2.js +1 -1
- package/Tooltip/index.d.ts +87 -87
- package/Tooltip/package.json +1 -1
- package/Tumbler/cjs/index.development.js +98 -66
- package/Tumbler/cjs/index.development.v2.js +98 -66
- package/Tumbler/cjs/index.production.js +1 -1
- package/Tumbler/cjs/index.production.v2.js +1 -1
- package/Tumbler/index.d.ts +8 -8
- package/Tumbler/package.json +1 -1
- package/package.json +7 -5
- package/useBodyTTag/cjs/index.development.js +1 -1
- package/useBodyTTag/cjs/index.development.v2.js +1 -1
- package/useBodyTTag/index.d.ts +2 -2
- package/useBodyTTag/package.json +1 -1
- package/useDebounce/cjs/index.development.js +58 -6
- package/useDebounce/cjs/index.development.v2.js +58 -6
- package/useDebounce/cjs/index.production.js +1 -1
- package/useDebounce/cjs/index.production.v2.js +1 -1
- package/useDebounce/index.d.ts +4 -4
- package/useDebounce/package.json +1 -1
- package/useId/cjs/index.development.js +6 -7
- package/useId/cjs/index.development.v2.js +6 -7
- package/useId/cjs/index.production.js +1 -1
- package/useId/cjs/index.production.v2.js +1 -1
- package/useId/index.d.ts +4 -4
- package/useId/package.json +1 -1
- package/useIsMounted/cjs/index.development.js +3 -3
- package/useIsMounted/cjs/index.development.v2.js +3 -3
- package/useIsMounted/index.d.ts +4 -4
- package/useIsMounted/package.json +1 -1
- package/useKeyPress/cjs/index.development.js +76 -22
- package/useKeyPress/cjs/index.development.v2.js +76 -22
- package/useKeyPress/cjs/index.production.js +1 -1
- package/useKeyPress/cjs/index.production.v2.js +1 -1
- package/useKeyPress/index.d.ts +6 -6
- package/useKeyPress/package.json +1 -1
- package/useMedia/cjs/index.development.js +5 -5
- package/useMedia/cjs/index.development.v2.js +5 -5
- package/useMedia/index.d.ts +21 -21
- package/useMedia/package.json +1 -1
- package/useOutsideClick/cjs/index.development.js +2 -2
- package/useOutsideClick/cjs/index.development.v2.js +2 -2
- package/useOutsideClick/index.d.ts +5 -5
- package/useOutsideClick/package.json +1 -1
- package/usePortal/cjs/index.development.js +32 -27
- package/usePortal/cjs/index.development.v2.js +32 -27
- package/usePortal/index.d.ts +12 -12
- package/usePortal/package.json +1 -1
- package/useScrollPosition/cjs/index.development.js +2 -2
- package/useScrollPosition/cjs/index.development.v2.js +2 -2
- package/useScrollPosition/index.d.ts +5 -5
- package/useScrollPosition/package.json +1 -1
|
@@ -22,21 +22,21 @@ var Swipe = require('react-easy-swipe');
|
|
|
22
22
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
23
23
|
|
|
24
24
|
function _interopNamespaceCompat(e) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
}
|
|
25
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
26
|
+
var n = Object.create(null);
|
|
27
|
+
if (e) {
|
|
28
|
+
Object.keys(e).forEach(function (k) {
|
|
29
|
+
if (k !== 'default') {
|
|
30
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
31
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
32
|
+
enumerable: true,
|
|
33
|
+
get: function () { return e[k]; }
|
|
36
34
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
n.default = e;
|
|
39
|
+
return Object.freeze(n);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
@@ -44,141 +44,153 @@ var ScrollLock__default = /*#__PURE__*/_interopDefaultCompat(ScrollLock);
|
|
|
44
44
|
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
45
45
|
var Swipe__default = /*#__PURE__*/_interopDefaultCompat(Swipe);
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
function
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
47
|
+
function _extends() {
|
|
48
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
49
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
50
|
+
var source = arguments[i];
|
|
51
|
+
for (var key in source) {
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
53
|
+
target[key] = source[key];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return target;
|
|
58
|
+
};
|
|
59
|
+
return _extends.apply(this, arguments);
|
|
60
|
+
}
|
|
61
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
62
|
+
if (source == null) return {};
|
|
63
|
+
var target = {};
|
|
64
|
+
var sourceKeys = Object.keys(source);
|
|
65
|
+
var key, i;
|
|
66
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
67
|
+
key = sourceKeys[i];
|
|
68
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
69
|
+
target[key] = source[key];
|
|
70
|
+
}
|
|
71
|
+
return target;
|
|
72
|
+
}
|
|
73
|
+
function _objectWithoutProperties(source, excluded) {
|
|
74
|
+
if (source == null) return {};
|
|
75
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
76
|
+
var key, i;
|
|
77
|
+
if (Object.getOwnPropertySymbols) {
|
|
78
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
79
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
80
|
+
key = sourceSymbolKeys[i];
|
|
81
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
82
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
83
|
+
target[key] = source[key];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return target;
|
|
87
|
+
}
|
|
88
|
+
function _taggedTemplateLiteral(strings, raw) {
|
|
89
|
+
if (!raw) {
|
|
90
|
+
raw = strings.slice(0);
|
|
91
|
+
}
|
|
92
|
+
return Object.freeze(Object.defineProperties(strings, {
|
|
93
|
+
raw: {
|
|
94
|
+
value: Object.freeze(raw)
|
|
95
|
+
}
|
|
96
|
+
}));
|
|
88
97
|
}
|
|
89
98
|
|
|
90
99
|
var css = {"root":"Overlay__root___v0oYp","backdrop":"Overlay__backdrop___RvRWz","popup":"Overlay__popup___elIqJ","popup_placement_top":"Overlay__popup_placement_top___Llv4b","popup_placement_bottom":"Overlay__popup_placement_bottom___DJyNc","popup_placement_right":"Overlay__popup_placement_right___4DX3c","popup_placement_left":"Overlay__popup_placement_left___OwkR7","content":"Overlay__content___5qQ0k","header":"Overlay__header___LIk9z","header__grid":"Overlay__header__grid___SShy4","header__item":"Overlay__header__item___9fUzS","header__title":"Overlay__header__title___Vuilz Overlay__header__item___9fUzS","header__action":"Overlay__header__action___c-A8d Overlay__header__item___9fUzS","header__actionButton":"Overlay__header__actionButton___yYG24","header__actionIcon":"Overlay__header__actionIcon___La2ok","footer":"Overlay__footer___3Ca-G","enter":"Overlay__enter___OjeZp","exit":"Overlay__exit___HiHMU","enterActive":"Overlay__enterActive___Ne-Vn","exitActive":"Overlay__exitActive___6f7f1"};
|
|
91
100
|
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
+
var _templateObject, _templateObject2;
|
|
102
|
+
var OverlayHeader = function OverlayHeader(_ref) {
|
|
103
|
+
var isShowPrevButton = _ref.isShowPrevButton,
|
|
104
|
+
isShowCloseButton = _ref.isShowCloseButton,
|
|
105
|
+
children = _ref.children,
|
|
106
|
+
title = _ref.title,
|
|
107
|
+
onClose = _ref.onClose,
|
|
108
|
+
onPrev = _ref.onPrev;
|
|
109
|
+
var _useBodyTTag = useBodyTTag.useBodyTTag(),
|
|
110
|
+
t = _useBodyTTag.t;
|
|
111
|
+
return /*#__PURE__*/React__namespace.default.createElement("header", {
|
|
101
112
|
className: css.header
|
|
102
|
-
}, typeof children !== 'undefined' ? children : React__namespace.default.createElement("div", {
|
|
113
|
+
}, typeof children !== 'undefined' ? children : /*#__PURE__*/React__namespace.default.createElement("div", {
|
|
103
114
|
className: css.header__grid
|
|
104
|
-
}, React__namespace.default.createElement("div", {
|
|
115
|
+
}, /*#__PURE__*/React__namespace.default.createElement("div", {
|
|
105
116
|
className: css.header__action
|
|
106
|
-
}, isShowPrevButton && React__namespace.default.createElement(Button.Button, {
|
|
117
|
+
}, isShowPrevButton && /*#__PURE__*/React__namespace.default.createElement(Button.Button, {
|
|
107
118
|
className: css.header__actionButton,
|
|
108
|
-
"button-theme":
|
|
109
|
-
type:
|
|
119
|
+
"button-theme": "black-inherit",
|
|
120
|
+
type: "button",
|
|
110
121
|
onClick: onPrev,
|
|
111
|
-
"aria-label": t(
|
|
112
|
-
"data-qaid":
|
|
113
|
-
}, React__namespace.default.createElement(Icon.Icon, {
|
|
122
|
+
"aria-label": t(_templateObject || (_templateObject = _taggedTemplateLiteral(["\u041D\u0430\u0437\u0430\u0434"]))),
|
|
123
|
+
"data-qaid": "prev"
|
|
124
|
+
}, /*#__PURE__*/React__namespace.default.createElement(Icon.Icon, {
|
|
114
125
|
"icon-as": ArrowBack.ArrowBack,
|
|
115
126
|
className: css.header__actionIcon
|
|
116
|
-
}))), React__namespace.default.createElement("div", {
|
|
127
|
+
}))), /*#__PURE__*/React__namespace.default.createElement("div", {
|
|
117
128
|
className: css.header__title
|
|
118
|
-
}, typeof title === 'string' ? React__namespace.default.createElement(Text.Text, {
|
|
119
|
-
"text-align":
|
|
120
|
-
"text-size":
|
|
121
|
-
"text-wrap":
|
|
122
|
-
"text-weight":
|
|
123
|
-
"data-qaid":
|
|
124
|
-
}, title) : title), React__namespace.default.createElement("div", {
|
|
129
|
+
}, typeof title === 'string' ? /*#__PURE__*/React__namespace.default.createElement(Text.Text, {
|
|
130
|
+
"text-align": "center",
|
|
131
|
+
"text-size": "h4",
|
|
132
|
+
"text-wrap": "ellipsis",
|
|
133
|
+
"text-weight": "bold",
|
|
134
|
+
"data-qaid": "title"
|
|
135
|
+
}, title) : title), /*#__PURE__*/React__namespace.default.createElement("div", {
|
|
125
136
|
className: css.header__action
|
|
126
|
-
}, isShowCloseButton && onClose && React__namespace.default.createElement(Button.Button, {
|
|
137
|
+
}, isShowCloseButton && onClose && /*#__PURE__*/React__namespace.default.createElement(Button.Button, {
|
|
127
138
|
className: css.header__actionButton,
|
|
128
|
-
"button-theme":
|
|
129
|
-
type:
|
|
139
|
+
"button-theme": "black-inherit",
|
|
140
|
+
type: "button",
|
|
130
141
|
onClick: onClose,
|
|
131
|
-
"aria-label": t(
|
|
132
|
-
"data-qaid":
|
|
133
|
-
}, React__namespace.default.createElement(Icon.Icon, {
|
|
142
|
+
"aria-label": t(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\u0417\u0430\u043A\u0440\u044B\u0442\u044C"]))),
|
|
143
|
+
"data-qaid": "close"
|
|
144
|
+
}, /*#__PURE__*/React__namespace.default.createElement(Icon.Icon, {
|
|
134
145
|
"icon-as": Close.Close,
|
|
135
146
|
className: css.header__actionIcon
|
|
136
147
|
})))));
|
|
137
148
|
};
|
|
138
|
-
var templateObject_1, templateObject_2;
|
|
139
149
|
|
|
140
150
|
// FORK FROM https://github.com/jossmac/react-scrolllock/blob/master/src/TouchScrollable.js
|
|
151
|
+
|
|
141
152
|
var canUseDOM = !!(typeof window !== 'undefined' && window.document && window.document.createElement);
|
|
153
|
+
|
|
142
154
|
/* @ts-ignore */
|
|
143
155
|
var canUseEventListeners = canUseDOM && !!(window.addEventListener || window.attachEvent);
|
|
144
|
-
var TouchScrollable = function (
|
|
145
|
-
var
|
|
146
|
-
isActive =
|
|
147
|
-
scrollRef =
|
|
148
|
-
children =
|
|
156
|
+
var TouchScrollable = function TouchScrollable(_ref) {
|
|
157
|
+
var _ref$isActive = _ref.isActive,
|
|
158
|
+
isActive = _ref$isActive === void 0 ? false : _ref$isActive,
|
|
159
|
+
scrollRef = _ref.scrollRef,
|
|
160
|
+
children = _ref.children;
|
|
149
161
|
React__namespace.useEffect(function () {
|
|
150
|
-
if (!isActive || !canUseEventListeners || !(scrollRef
|
|
162
|
+
if (!isActive || !canUseEventListeners || !(scrollRef !== null && scrollRef !== void 0 && scrollRef.current)) return;
|
|
151
163
|
scrollRef.current.addEventListener('touchstart', utils.preventInertiaScroll, utils.listenerOptions);
|
|
152
164
|
scrollRef.current.addEventListener('touchmove', utils.allowTouchMove, utils.listenerOptions);
|
|
153
165
|
return function () {
|
|
154
|
-
if (!isActive || !canUseEventListeners || !(scrollRef
|
|
166
|
+
if (!isActive || !canUseEventListeners || !(scrollRef !== null && scrollRef !== void 0 && scrollRef.current)) return;
|
|
155
167
|
scrollRef.current.removeEventListener('touchstart', utils.preventInertiaScroll, utils.listenerOptions);
|
|
156
168
|
scrollRef.current.removeEventListener('touchmove', utils.allowTouchMove, utils.listenerOptions);
|
|
157
169
|
};
|
|
158
170
|
});
|
|
159
|
-
return React__namespace.createElement(React__namespace.Fragment, null, children);
|
|
171
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, children);
|
|
160
172
|
};
|
|
161
173
|
|
|
162
174
|
var VENDOR_PREFIX = ['-webkit', '-moz', '-ms', '-o'];
|
|
163
175
|
var PROPERTYES_VENDOR_PREFIX = ['transform', 'transition'];
|
|
164
|
-
var setStyle = function (element, style) {
|
|
176
|
+
var setStyle = function setStyle(element, style) {
|
|
165
177
|
if (!element) return;
|
|
166
178
|
for (var property in style) {
|
|
167
179
|
var isVendorPrefix = PROPERTYES_VENDOR_PREFIX.indexOf(property) !== -1;
|
|
168
180
|
if (!!!style[property]) {
|
|
169
181
|
element.style.removeProperty(property);
|
|
170
182
|
if (isVendorPrefix) {
|
|
171
|
-
for (var _i = 0,
|
|
172
|
-
var vendor =
|
|
183
|
+
for (var _i = 0, _VENDOR_PREFIX = VENDOR_PREFIX; _i < _VENDOR_PREFIX.length; _i++) {
|
|
184
|
+
var vendor = _VENDOR_PREFIX[_i];
|
|
173
185
|
element.style.removeProperty("".concat(vendor, "-").concat(property));
|
|
174
186
|
}
|
|
175
187
|
}
|
|
176
188
|
} else {
|
|
177
189
|
element.style.setProperty(property, style[property]);
|
|
178
190
|
if (isVendorPrefix) {
|
|
179
|
-
for (var
|
|
180
|
-
var
|
|
181
|
-
element.style.setProperty("".concat(
|
|
191
|
+
for (var _i2 = 0, _VENDOR_PREFIX2 = VENDOR_PREFIX; _i2 < _VENDOR_PREFIX2.length; _i2++) {
|
|
192
|
+
var _vendor = _VENDOR_PREFIX2[_i2];
|
|
193
|
+
element.style.setProperty("".concat(_vendor, "-").concat(property), style[property]);
|
|
182
194
|
}
|
|
183
195
|
}
|
|
184
196
|
}
|
|
@@ -187,27 +199,27 @@ var setStyle = function (element, style) {
|
|
|
187
199
|
var SWIPE_TIME_RATE = 250;
|
|
188
200
|
var SWIPE_MIN_POS = 70;
|
|
189
201
|
var SWIPE_TRANSITION_DURATION = 225;
|
|
190
|
-
var SwipeClose = function (
|
|
191
|
-
var
|
|
192
|
-
isActive =
|
|
193
|
-
children =
|
|
194
|
-
onClose =
|
|
195
|
-
placement =
|
|
196
|
-
rootRef =
|
|
197
|
-
contentRef =
|
|
202
|
+
var SwipeClose = function SwipeClose(_ref) {
|
|
203
|
+
var _ref$isActive = _ref.isActive,
|
|
204
|
+
isActive = _ref$isActive === void 0 ? true : _ref$isActive,
|
|
205
|
+
children = _ref.children,
|
|
206
|
+
onClose = _ref.onClose,
|
|
207
|
+
placement = _ref.placement,
|
|
208
|
+
rootRef = _ref.rootRef,
|
|
209
|
+
contentRef = _ref.contentRef;
|
|
198
210
|
var isAllowSwipe = React__namespace.useRef(null);
|
|
199
211
|
var isAllowClose = React__namespace.useRef(false);
|
|
200
212
|
var startTime = React__namespace.useRef(0);
|
|
201
213
|
if (!isActive) {
|
|
202
|
-
return React__namespace.createElement(React__namespace.Fragment, null, children);
|
|
214
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, children);
|
|
203
215
|
}
|
|
204
|
-
var onSwipeMove = function (
|
|
205
|
-
var
|
|
206
|
-
var x =
|
|
207
|
-
y =
|
|
208
|
-
var contentsScrollHeight = ((
|
|
209
|
-
var contentOffsetHeight = ((
|
|
210
|
-
var contentScrollTop = ((
|
|
216
|
+
var onSwipeMove = function onSwipeMove(_ref2) {
|
|
217
|
+
var _contentRef$current, _contentRef$current2, _contentRef$current3;
|
|
218
|
+
var x = _ref2.x,
|
|
219
|
+
y = _ref2.y;
|
|
220
|
+
var contentsScrollHeight = ((_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 ? void 0 : _contentRef$current.scrollHeight) || 0;
|
|
221
|
+
var contentOffsetHeight = ((_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 ? void 0 : _contentRef$current2.offsetHeight) || 0;
|
|
222
|
+
var contentScrollTop = ((_contentRef$current3 = contentRef.current) === null || _contentRef$current3 === void 0 ? void 0 : _contentRef$current3.scrollTop) || 0;
|
|
211
223
|
var contentScrollBottom = contentsScrollHeight - (contentScrollTop + contentOffsetHeight);
|
|
212
224
|
var transform = null;
|
|
213
225
|
var isAllowSwipeCords = false;
|
|
@@ -254,7 +266,7 @@ var SwipeClose = function (_a) {
|
|
|
254
266
|
});
|
|
255
267
|
}
|
|
256
268
|
};
|
|
257
|
-
var onSwipeEnd = function () {
|
|
269
|
+
var onSwipeEnd = function onSwipeEnd() {
|
|
258
270
|
if (isAllowSwipe.current) {
|
|
259
271
|
setStyle(rootRef.current, {
|
|
260
272
|
transition: "transform ".concat(SWIPE_TRANSITION_DURATION, "ms cubic-bezier(0, 0, 0.2, 1) 0ms"),
|
|
@@ -278,13 +290,13 @@ var SwipeClose = function (_a) {
|
|
|
278
290
|
isAllowSwipe.current = null;
|
|
279
291
|
isAllowClose.current = false;
|
|
280
292
|
};
|
|
281
|
-
return React__namespace.createElement(Swipe__default.default, {
|
|
293
|
+
return /*#__PURE__*/React__namespace.createElement(Swipe__default.default, {
|
|
282
294
|
onSwipeMove: onSwipeMove,
|
|
283
295
|
onSwipeEnd: onSwipeEnd
|
|
284
296
|
}, children);
|
|
285
297
|
};
|
|
286
298
|
|
|
287
|
-
var getPopupStyle = function (placement, size, maxSize) {
|
|
299
|
+
var getPopupStyle = function getPopupStyle(placement, size, maxSize) {
|
|
288
300
|
if (['top', 'bottom'].includes(placement)) {
|
|
289
301
|
return {
|
|
290
302
|
height: size,
|
|
@@ -297,53 +309,55 @@ var getPopupStyle = function (placement, size, maxSize) {
|
|
|
297
309
|
};
|
|
298
310
|
};
|
|
299
311
|
|
|
312
|
+
var _excluded = ["children", "onClose", "onOpen", "onPrev", "onOpened", "onClosed", "isOpen", "isShowCloseButton", "isShowPrevButton", "isCloseOnEscape", "isCloseOnSwipe", "isCloseOutsideClick", "isAnimated", "isRenderPortal", "isScrollLock", "isScrollLockTouch", "header", "footer", "padding", "title", "placement", "size", "maxSize", "zIndex", "contentRef", "dataQaId"];
|
|
300
313
|
var DEFAULT_SIZE = 400;
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
*
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Компонент используется для создания оверлея (накладывающегося слоя) на верху содержимого.
|
|
317
|
+
* Он может использоваться, например, для создания модальных окон, выпадающих списков и других элементов интерфейса.
|
|
304
318
|
*/
|
|
305
|
-
var Overlay = function (
|
|
306
|
-
var children =
|
|
307
|
-
onClose =
|
|
308
|
-
onOpen =
|
|
309
|
-
onPrev =
|
|
310
|
-
onOpened =
|
|
311
|
-
onClosed =
|
|
312
|
-
isOpen =
|
|
313
|
-
|
|
314
|
-
isShowCloseButton =
|
|
315
|
-
|
|
316
|
-
isShowPrevButton =
|
|
317
|
-
|
|
318
|
-
isCloseOnEscape =
|
|
319
|
-
|
|
320
|
-
isCloseOnSwipe =
|
|
321
|
-
|
|
322
|
-
isCloseOutsideClick =
|
|
323
|
-
|
|
324
|
-
isAnimated =
|
|
325
|
-
|
|
326
|
-
isRenderPortal =
|
|
327
|
-
|
|
328
|
-
isScrollLock =
|
|
329
|
-
|
|
330
|
-
isScrollLockTouch =
|
|
331
|
-
header =
|
|
332
|
-
footer =
|
|
333
|
-
|
|
334
|
-
padding =
|
|
335
|
-
title =
|
|
336
|
-
|
|
337
|
-
placement =
|
|
338
|
-
|
|
339
|
-
size =
|
|
340
|
-
|
|
341
|
-
maxSize =
|
|
342
|
-
|
|
343
|
-
zIndex =
|
|
344
|
-
contentRef =
|
|
345
|
-
dataQaId =
|
|
346
|
-
props =
|
|
319
|
+
var Overlay = function Overlay(_ref) {
|
|
320
|
+
var children = _ref.children,
|
|
321
|
+
onClose = _ref.onClose,
|
|
322
|
+
onOpen = _ref.onOpen,
|
|
323
|
+
onPrev = _ref.onPrev,
|
|
324
|
+
onOpened = _ref.onOpened,
|
|
325
|
+
onClosed = _ref.onClosed,
|
|
326
|
+
isOpen = _ref.isOpen,
|
|
327
|
+
_ref$isShowCloseButto = _ref.isShowCloseButton,
|
|
328
|
+
isShowCloseButton = _ref$isShowCloseButto === void 0 ? true : _ref$isShowCloseButto,
|
|
329
|
+
_ref$isShowPrevButton = _ref.isShowPrevButton,
|
|
330
|
+
isShowPrevButton = _ref$isShowPrevButton === void 0 ? false : _ref$isShowPrevButton,
|
|
331
|
+
_ref$isCloseOnEscape = _ref.isCloseOnEscape,
|
|
332
|
+
isCloseOnEscape = _ref$isCloseOnEscape === void 0 ? true : _ref$isCloseOnEscape,
|
|
333
|
+
_ref$isCloseOnSwipe = _ref.isCloseOnSwipe,
|
|
334
|
+
isCloseOnSwipe = _ref$isCloseOnSwipe === void 0 ? true : _ref$isCloseOnSwipe,
|
|
335
|
+
_ref$isCloseOutsideCl = _ref.isCloseOutsideClick,
|
|
336
|
+
isCloseOutsideClick = _ref$isCloseOutsideCl === void 0 ? true : _ref$isCloseOutsideCl,
|
|
337
|
+
_ref$isAnimated = _ref.isAnimated,
|
|
338
|
+
isAnimated = _ref$isAnimated === void 0 ? true : _ref$isAnimated,
|
|
339
|
+
_ref$isRenderPortal = _ref.isRenderPortal,
|
|
340
|
+
isRenderPortal = _ref$isRenderPortal === void 0 ? true : _ref$isRenderPortal,
|
|
341
|
+
_ref$isScrollLock = _ref.isScrollLock,
|
|
342
|
+
isScrollLock = _ref$isScrollLock === void 0 ? true : _ref$isScrollLock,
|
|
343
|
+
_ref$isScrollLockTouc = _ref.isScrollLockTouch,
|
|
344
|
+
isScrollLockTouch = _ref$isScrollLockTouc === void 0 ? true : _ref$isScrollLockTouc,
|
|
345
|
+
header = _ref.header,
|
|
346
|
+
footer = _ref.footer,
|
|
347
|
+
_ref$padding = _ref.padding,
|
|
348
|
+
padding = _ref$padding === void 0 ? '20px 20px 20px 20px' : _ref$padding,
|
|
349
|
+
title = _ref.title,
|
|
350
|
+
_ref$placement = _ref.placement,
|
|
351
|
+
placement = _ref$placement === void 0 ? 'adaptive' : _ref$placement,
|
|
352
|
+
_ref$size = _ref.size,
|
|
353
|
+
size = _ref$size === void 0 ? 'adaptive' : _ref$size,
|
|
354
|
+
_ref$maxSize = _ref.maxSize,
|
|
355
|
+
maxSize = _ref$maxSize === void 0 ? '90%' : _ref$maxSize,
|
|
356
|
+
_ref$zIndex = _ref.zIndex,
|
|
357
|
+
zIndex = _ref$zIndex === void 0 ? 5000 : _ref$zIndex,
|
|
358
|
+
contentRef = _ref.contentRef,
|
|
359
|
+
dataQaId = _ref.dataQaId,
|
|
360
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
347
361
|
var popupRef = React__namespace.useRef(null);
|
|
348
362
|
var currentContentRef = contentRef || React__namespace.useRef(null);
|
|
349
363
|
var isMinWidthMedium = Media.useMedia({
|
|
@@ -363,66 +377,66 @@ var Overlay = function (_a) {
|
|
|
363
377
|
if (placement === 'adaptive') {
|
|
364
378
|
currentPlacement = isMinWidthMedium ? 'right' : 'bottom';
|
|
365
379
|
}
|
|
366
|
-
return React__namespace.createElement(React__namespace.Fragment, null, React__namespace.createElement(Backdrop.Backdrop, {
|
|
380
|
+
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Backdrop.Backdrop, {
|
|
367
381
|
isOpen: isOpen,
|
|
368
382
|
isAnimated: isAnimated,
|
|
369
383
|
zIndex: zIndex,
|
|
370
384
|
isRenderPortal: isRenderPortal
|
|
371
|
-
}), React__namespace.createElement(reactTransitionGroup.CSSTransition, {
|
|
372
|
-
in: isOpen,
|
|
385
|
+
}), /*#__PURE__*/React__namespace.createElement(reactTransitionGroup.CSSTransition, {
|
|
386
|
+
"in": isOpen,
|
|
373
387
|
timeout: isAnimated ? 225 : 0,
|
|
374
388
|
classNames: css,
|
|
375
389
|
unmountOnExit: true,
|
|
376
390
|
onEnter: onOpen,
|
|
377
391
|
onEntered: onOpened,
|
|
378
392
|
onExited: onClosed
|
|
379
|
-
}, React__namespace.createElement(Portal.Portal, {
|
|
393
|
+
}, /*#__PURE__*/React__namespace.createElement(Portal.Portal, {
|
|
380
394
|
isActive: isRenderPortal
|
|
381
|
-
}, React__namespace.createElement(SwipeClose, {
|
|
395
|
+
}, /*#__PURE__*/React__namespace.createElement(SwipeClose, {
|
|
382
396
|
isActive: isScrollLock && isCloseOnSwipe,
|
|
383
397
|
rootRef: popupRef,
|
|
384
398
|
contentRef: currentContentRef,
|
|
385
399
|
placement: currentPlacement,
|
|
386
400
|
onClose: onClose
|
|
387
|
-
}, React__namespace.createElement("div",
|
|
401
|
+
}, /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
388
402
|
className: css.root,
|
|
389
|
-
role:
|
|
403
|
+
role: "presentation",
|
|
390
404
|
style: {
|
|
391
405
|
zIndex: zIndex
|
|
392
406
|
}
|
|
393
|
-
}, props), React__namespace.createElement(ScrollLock__default.default, {
|
|
407
|
+
}, props), /*#__PURE__*/React__namespace.createElement(ScrollLock__default.default, {
|
|
394
408
|
isActive: isScrollLock
|
|
395
|
-
}), React__namespace.createElement(KeyPress.KeyPress, {
|
|
409
|
+
}), /*#__PURE__*/React__namespace.createElement(KeyPress.KeyPress, {
|
|
396
410
|
isActive: isCloseOnEscape,
|
|
397
|
-
code:
|
|
411
|
+
code: "Escape",
|
|
398
412
|
onKeyDown: onClose
|
|
399
|
-
}), React__namespace.createElement("div", {
|
|
413
|
+
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
400
414
|
className: css.backdrop,
|
|
401
415
|
"aria-hidden": true,
|
|
402
|
-
onClick: function (e) {
|
|
416
|
+
onClick: function onClick(e) {
|
|
403
417
|
if (isCloseOutsideClick && onClose) {
|
|
404
418
|
onClose(e);
|
|
405
419
|
}
|
|
406
420
|
}
|
|
407
|
-
}), React__namespace.createElement("div", {
|
|
421
|
+
}), /*#__PURE__*/React__namespace.createElement("div", {
|
|
408
422
|
ref: popupRef,
|
|
409
423
|
className: classNames__default.default(css.popup, css["popup_placement_".concat(currentPlacement)]),
|
|
410
424
|
"aria-modal": true,
|
|
411
|
-
role:
|
|
425
|
+
role: "dialog",
|
|
412
426
|
style: getPopupStyle(currentPlacement, currentSize, maxSize),
|
|
413
427
|
"data-qaid": dataQaId
|
|
414
|
-
}, React__namespace.createElement(OverlayHeader, {
|
|
428
|
+
}, /*#__PURE__*/React__namespace.createElement(OverlayHeader, {
|
|
415
429
|
isShowCloseButton: isShowCloseButton,
|
|
416
430
|
isShowPrevButton: isShowPrevButton,
|
|
417
431
|
onClose: onClose,
|
|
418
432
|
onPrev: onPrev,
|
|
419
433
|
title: title
|
|
420
|
-
}, header), React__namespace.createElement("footer", {
|
|
434
|
+
}, header), /*#__PURE__*/React__namespace.createElement("footer", {
|
|
421
435
|
className: css.footer
|
|
422
|
-
}, footer), React__namespace.createElement(TouchScrollable, {
|
|
436
|
+
}, footer), /*#__PURE__*/React__namespace.createElement(TouchScrollable, {
|
|
423
437
|
isActive: isScrollLockTouch,
|
|
424
438
|
scrollRef: currentContentRef
|
|
425
|
-
}, React__namespace.createElement("div", {
|
|
439
|
+
}, /*#__PURE__*/React__namespace.createElement("div", {
|
|
426
440
|
className: css.content,
|
|
427
441
|
ref: currentContentRef,
|
|
428
442
|
style: {
|