@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
|
@@ -10,34 +10,85 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
function _iterableToArrayLimit(arr, i) {
|
|
14
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
15
|
+
if (null != _i) {
|
|
16
|
+
var _s,
|
|
17
|
+
_e,
|
|
18
|
+
_x,
|
|
19
|
+
_r,
|
|
20
|
+
_arr = [],
|
|
21
|
+
_n = !0,
|
|
22
|
+
_d = !1;
|
|
23
|
+
try {
|
|
24
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
25
|
+
if (Object(_i) !== _i) return;
|
|
26
|
+
_n = !1;
|
|
27
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
28
|
+
} catch (err) {
|
|
29
|
+
_d = !0, _e = err;
|
|
30
|
+
} finally {
|
|
31
|
+
try {
|
|
32
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
33
|
+
} finally {
|
|
34
|
+
if (_d) throw _e;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return _arr;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function _slicedToArray(arr, i) {
|
|
41
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
42
|
+
}
|
|
43
|
+
function _arrayWithHoles(arr) {
|
|
44
|
+
if (Array.isArray(arr)) return arr;
|
|
45
|
+
}
|
|
46
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
47
|
+
if (!o) return;
|
|
48
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
49
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
50
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
51
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
52
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
53
|
+
}
|
|
54
|
+
function _arrayLikeToArray(arr, len) {
|
|
55
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
56
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
57
|
+
return arr2;
|
|
58
|
+
}
|
|
59
|
+
function _nonIterableRest() {
|
|
60
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
var MediaProvider = function MediaProvider(_ref) {
|
|
64
|
+
var _ref$resetOnMount = _ref.resetOnMount,
|
|
65
|
+
resetOnMount = _ref$resetOnMount === void 0 ? false : _ref$resetOnMount,
|
|
66
|
+
width = _ref.width,
|
|
67
|
+
children = _ref.children;
|
|
68
|
+
var _useState = React.useState({
|
|
19
69
|
width: width ? useMedia.SCREEN_BREAKPOINTS[width] : 1
|
|
20
70
|
}),
|
|
21
|
-
|
|
22
|
-
|
|
71
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
72
|
+
value = _useState2[0],
|
|
73
|
+
setValue = _useState2[1];
|
|
23
74
|
React.useEffect(function () {
|
|
24
75
|
if (resetOnMount) {
|
|
25
76
|
setValue(undefined);
|
|
26
77
|
}
|
|
27
78
|
}, []);
|
|
28
|
-
return React__default.default.createElement(reactResponsive.Context.Provider, {
|
|
79
|
+
return /*#__PURE__*/React__default.default.createElement(reactResponsive.Context.Provider, {
|
|
29
80
|
value: value
|
|
30
81
|
}, children);
|
|
31
82
|
};
|
|
32
83
|
|
|
33
84
|
// PDS core
|
|
34
|
-
/**
|
|
35
|
-
* Компонент отображает соответствующий контент от состояние медиа-запроса и обновляет его при изменении размера окна браузера.
|
|
85
|
+
/**
|
|
86
|
+
* Компонент отображает соответствующий контент от состояние медиа-запроса и обновляет его при изменении размера окна браузера.
|
|
36
87
|
*/
|
|
37
|
-
var Media = function (
|
|
38
|
-
var minWidth =
|
|
39
|
-
maxWidth =
|
|
40
|
-
children =
|
|
88
|
+
var Media = function Media(_ref) {
|
|
89
|
+
var minWidth = _ref.minWidth,
|
|
90
|
+
maxWidth = _ref.maxWidth,
|
|
91
|
+
children = _ref.children;
|
|
41
92
|
var matchMedia = useMedia.useMedia({
|
|
42
93
|
minWidth: minWidth,
|
|
43
94
|
maxWidth: maxWidth
|
|
@@ -49,12 +100,12 @@ var Media = function (_a) {
|
|
|
49
100
|
};
|
|
50
101
|
|
|
51
102
|
Object.defineProperty(exports, 'SCREEN_BREAKPOINTS', {
|
|
52
|
-
|
|
53
|
-
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () { return useMedia.SCREEN_BREAKPOINTS; }
|
|
54
105
|
});
|
|
55
106
|
Object.defineProperty(exports, 'useMedia', {
|
|
56
|
-
|
|
57
|
-
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () { return useMedia.useMedia; }
|
|
58
109
|
});
|
|
59
110
|
exports.Media = Media;
|
|
60
111
|
exports.MediaProvider = MediaProvider;
|
|
@@ -10,34 +10,85 @@ function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'defau
|
|
|
10
10
|
|
|
11
11
|
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
var
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
function _iterableToArrayLimit(arr, i) {
|
|
14
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
15
|
+
if (null != _i) {
|
|
16
|
+
var _s,
|
|
17
|
+
_e,
|
|
18
|
+
_x,
|
|
19
|
+
_r,
|
|
20
|
+
_arr = [],
|
|
21
|
+
_n = !0,
|
|
22
|
+
_d = !1;
|
|
23
|
+
try {
|
|
24
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
25
|
+
if (Object(_i) !== _i) return;
|
|
26
|
+
_n = !1;
|
|
27
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
28
|
+
} catch (err) {
|
|
29
|
+
_d = !0, _e = err;
|
|
30
|
+
} finally {
|
|
31
|
+
try {
|
|
32
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
33
|
+
} finally {
|
|
34
|
+
if (_d) throw _e;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return _arr;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function _slicedToArray(arr, i) {
|
|
41
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
42
|
+
}
|
|
43
|
+
function _arrayWithHoles(arr) {
|
|
44
|
+
if (Array.isArray(arr)) return arr;
|
|
45
|
+
}
|
|
46
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
47
|
+
if (!o) return;
|
|
48
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
49
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
50
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
51
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
52
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
53
|
+
}
|
|
54
|
+
function _arrayLikeToArray(arr, len) {
|
|
55
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
56
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
57
|
+
return arr2;
|
|
58
|
+
}
|
|
59
|
+
function _nonIterableRest() {
|
|
60
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
var MediaProvider = function MediaProvider(_ref) {
|
|
64
|
+
var _ref$resetOnMount = _ref.resetOnMount,
|
|
65
|
+
resetOnMount = _ref$resetOnMount === void 0 ? false : _ref$resetOnMount,
|
|
66
|
+
width = _ref.width,
|
|
67
|
+
children = _ref.children;
|
|
68
|
+
var _useState = React.useState({
|
|
19
69
|
width: width ? useMedia.SCREEN_BREAKPOINTS[width] : 1
|
|
20
70
|
}),
|
|
21
|
-
|
|
22
|
-
|
|
71
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
72
|
+
value = _useState2[0],
|
|
73
|
+
setValue = _useState2[1];
|
|
23
74
|
React.useEffect(function () {
|
|
24
75
|
if (resetOnMount) {
|
|
25
76
|
setValue(undefined);
|
|
26
77
|
}
|
|
27
78
|
}, []);
|
|
28
|
-
return React__default.default.createElement(reactResponsive.Context.Provider, {
|
|
79
|
+
return /*#__PURE__*/React__default.default.createElement(reactResponsive.Context.Provider, {
|
|
29
80
|
value: value
|
|
30
81
|
}, children);
|
|
31
82
|
};
|
|
32
83
|
|
|
33
84
|
// PDS core
|
|
34
|
-
/**
|
|
35
|
-
* Компонент отображает соответствующий контент от состояние медиа-запроса и обновляет его при изменении размера окна браузера.
|
|
85
|
+
/**
|
|
86
|
+
* Компонент отображает соответствующий контент от состояние медиа-запроса и обновляет его при изменении размера окна браузера.
|
|
36
87
|
*/
|
|
37
|
-
var Media = function (
|
|
38
|
-
var minWidth =
|
|
39
|
-
maxWidth =
|
|
40
|
-
children =
|
|
88
|
+
var Media = function Media(_ref) {
|
|
89
|
+
var minWidth = _ref.minWidth,
|
|
90
|
+
maxWidth = _ref.maxWidth,
|
|
91
|
+
children = _ref.children;
|
|
41
92
|
var matchMedia = useMedia.useMedia({
|
|
42
93
|
minWidth: minWidth,
|
|
43
94
|
maxWidth: maxWidth
|
|
@@ -49,12 +100,12 @@ var Media = function (_a) {
|
|
|
49
100
|
};
|
|
50
101
|
|
|
51
102
|
Object.defineProperty(exports, 'SCREEN_BREAKPOINTS', {
|
|
52
|
-
|
|
53
|
-
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () { return useMedia.SCREEN_BREAKPOINTS; }
|
|
54
105
|
});
|
|
55
106
|
Object.defineProperty(exports, 'useMedia', {
|
|
56
|
-
|
|
57
|
-
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () { return useMedia.useMedia; }
|
|
58
109
|
});
|
|
59
110
|
exports.Media = Media;
|
|
60
111
|
exports.MediaProvider = MediaProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@prom-ui/core/useMedia"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@prom-ui/core/useMedia"),r=require("react"),t=require("react-responsive");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(r);function u(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,i,u,o,a=[],l=!0,c=!1;try{if(u=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=u.call(t)).done)&&(a.push(n.value),a.length!==r);l=!0);}catch(f){c=!0,i=f}finally{try{if(!l&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return o(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}Object.defineProperty(exports,"SCREEN_BREAKPOINTS",{enumerable:!0,get:function(){return e.SCREEN_BREAKPOINTS}}),Object.defineProperty(exports,"useMedia",{enumerable:!0,get:function(){return e.useMedia}}),exports.Media=function(r){var t=r.minWidth,n=r.maxWidth,i=r.children;return e.useMedia({minWidth:t,maxWidth:n})?i:null},exports.MediaProvider=function(n){var o=n.resetOnMount,a=void 0!==o&&o,l=n.width,c=n.children,f=u(r.useState({width:l?e.SCREEN_BREAKPOINTS[l]:1}),2),d=f[0],s=f[1];return r.useEffect((function(){a&&s(void 0)}),[]),i.default.createElement(t.Context.Provider,{value:d},c)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@prom-ui/core/useMedia"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@prom-ui/core/useMedia"),r=require("react"),t=require("react-responsive");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=n(r);function u(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,i,u,o,a=[],l=!0,c=!1;try{if(u=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;l=!1}else for(;!(l=(n=u.call(t)).done)&&(a.push(n.value),a.length!==r);l=!0);}catch(f){c=!0,i=f}finally{try{if(!l&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(c)throw i}}return a}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return o(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return o(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}Object.defineProperty(exports,"SCREEN_BREAKPOINTS",{enumerable:!0,get:function(){return e.SCREEN_BREAKPOINTS}}),Object.defineProperty(exports,"useMedia",{enumerable:!0,get:function(){return e.useMedia}}),exports.Media=function(r){var t=r.minWidth,n=r.maxWidth,i=r.children;return e.useMedia({minWidth:t,maxWidth:n})?i:null},exports.MediaProvider=function(n){var o=n.resetOnMount,a=void 0!==o&&o,l=n.width,c=n.children,f=u(r.useState({width:l?e.SCREEN_BREAKPOINTS[l]:1}),2),d=f[0],s=f[1];return r.useEffect((function(){a&&s(void 0)}),[]),i.default.createElement(t.Context.Provider,{value:d},c)};
|
package/Media/index.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useMedia, SCREEN_BREAKPOINTS } from '@prom-ui/core/useMedia';
|
|
3
|
-
export { MediaProvider } from './MediaProvider';
|
|
4
|
-
export type MediaProps = {
|
|
5
|
-
/**
|
|
6
|
-
* Аналог CSS медиа правила `@media (min-width: ...)`
|
|
7
|
-
*/
|
|
8
|
-
minWidth?: keyof typeof SCREEN_BREAKPOINTS;
|
|
9
|
-
/**
|
|
10
|
-
* Аналог CSS медиа правила `@media (max-width: ...)`
|
|
11
|
-
*/
|
|
12
|
-
maxWidth?: keyof typeof SCREEN_BREAKPOINTS;
|
|
13
|
-
/** @ignore */
|
|
14
|
-
children?: any;
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* Компонент отображает соответствующий контент от состояние медиа-запроса и обновляет его при изменении размера окна браузера.
|
|
18
|
-
*/
|
|
19
|
-
export declare const Media: React.FC<MediaProps>;
|
|
20
|
-
export { useMedia, SCREEN_BREAKPOINTS };
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useMedia, SCREEN_BREAKPOINTS } from '@prom-ui/core/useMedia';
|
|
3
|
+
export { MediaProvider } from './MediaProvider';
|
|
4
|
+
export type MediaProps = {
|
|
5
|
+
/**
|
|
6
|
+
* Аналог CSS медиа правила `@media (min-width: ...)`
|
|
7
|
+
*/
|
|
8
|
+
minWidth?: keyof typeof SCREEN_BREAKPOINTS;
|
|
9
|
+
/**
|
|
10
|
+
* Аналог CSS медиа правила `@media (max-width: ...)`
|
|
11
|
+
*/
|
|
12
|
+
maxWidth?: keyof typeof SCREEN_BREAKPOINTS;
|
|
13
|
+
/** @ignore */
|
|
14
|
+
children?: any;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Компонент отображает соответствующий контент от состояние медиа-запроса и обновляет его при изменении размера окна браузера.
|
|
18
|
+
*/
|
|
19
|
+
export declare const Media: React.FC<MediaProps>;
|
|
20
|
+
export { useMedia, SCREEN_BREAKPOINTS };
|
package/Media/package.json
CHANGED
|
@@ -6,80 +6,136 @@ var React = require('react');
|
|
|
6
6
|
var useOutsideClick = require('@prom-ui/core/useOutsideClick');
|
|
7
7
|
|
|
8
8
|
function _interopNamespaceCompat(e) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
}
|
|
9
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
10
|
+
var n = Object.create(null);
|
|
11
|
+
if (e) {
|
|
12
|
+
Object.keys(e).forEach(function (k) {
|
|
13
|
+
if (k !== 'default') {
|
|
14
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
15
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
get: function () { return e[k]; }
|
|
20
18
|
});
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
n.default = e;
|
|
23
|
+
return Object.freeze(n);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
|
|
28
|
+
function _iterableToArrayLimit(arr, i) {
|
|
29
|
+
var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
|
|
30
|
+
if (null != _i) {
|
|
31
|
+
var _s,
|
|
32
|
+
_e,
|
|
33
|
+
_x,
|
|
34
|
+
_r,
|
|
35
|
+
_arr = [],
|
|
36
|
+
_n = !0,
|
|
37
|
+
_d = !1;
|
|
38
|
+
try {
|
|
39
|
+
if (_x = (_i = _i.call(arr)).next, 0 === i) {
|
|
40
|
+
if (Object(_i) !== _i) return;
|
|
41
|
+
_n = !1;
|
|
42
|
+
} else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
|
|
43
|
+
} catch (err) {
|
|
44
|
+
_d = !0, _e = err;
|
|
45
|
+
} finally {
|
|
46
|
+
try {
|
|
47
|
+
if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return;
|
|
48
|
+
} finally {
|
|
49
|
+
if (_d) throw _e;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return _arr;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function _extends() {
|
|
56
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
57
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
58
|
+
var source = arguments[i];
|
|
59
|
+
for (var key in source) {
|
|
60
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
61
|
+
target[key] = source[key];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return target;
|
|
66
|
+
};
|
|
67
|
+
return _extends.apply(this, arguments);
|
|
68
|
+
}
|
|
69
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
70
|
+
if (source == null) return {};
|
|
71
|
+
var target = {};
|
|
72
|
+
var sourceKeys = Object.keys(source);
|
|
73
|
+
var key, i;
|
|
74
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
75
|
+
key = sourceKeys[i];
|
|
76
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
77
|
+
target[key] = source[key];
|
|
78
|
+
}
|
|
79
|
+
return target;
|
|
80
|
+
}
|
|
81
|
+
function _objectWithoutProperties(source, excluded) {
|
|
82
|
+
if (source == null) return {};
|
|
83
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
84
|
+
var key, i;
|
|
85
|
+
if (Object.getOwnPropertySymbols) {
|
|
86
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
87
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
88
|
+
key = sourceSymbolKeys[i];
|
|
89
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
90
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
91
|
+
target[key] = source[key];
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return target;
|
|
95
|
+
}
|
|
96
|
+
function _slicedToArray(arr, i) {
|
|
97
|
+
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
98
|
+
}
|
|
99
|
+
function _arrayWithHoles(arr) {
|
|
100
|
+
if (Array.isArray(arr)) return arr;
|
|
101
|
+
}
|
|
102
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
103
|
+
if (!o) return;
|
|
104
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
105
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
106
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
107
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
108
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
109
|
+
}
|
|
110
|
+
function _arrayLikeToArray(arr, len) {
|
|
111
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
112
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
113
|
+
return arr2;
|
|
114
|
+
}
|
|
115
|
+
function _nonIterableRest() {
|
|
116
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
64
117
|
}
|
|
65
118
|
|
|
66
|
-
var
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
isActive =
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
119
|
+
var _excluded = ["children", "isActive", "onClick"];
|
|
120
|
+
var OutsideClick = function OutsideClick(_ref) {
|
|
121
|
+
var children = _ref.children,
|
|
122
|
+
_ref$isActive = _ref.isActive,
|
|
123
|
+
isActive = _ref$isActive === void 0 ? true : _ref$isActive,
|
|
124
|
+
onClick = _ref.onClick,
|
|
125
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
126
|
+
var _useOutsideClick = useOutsideClick.useOutsideClick(onClick),
|
|
127
|
+
_useOutsideClick2 = _slicedToArray(_useOutsideClick, 1),
|
|
128
|
+
ref = _useOutsideClick2[0];
|
|
73
129
|
if (!isActive) {
|
|
74
|
-
return React__namespace.createElement("div", null, children);
|
|
130
|
+
return /*#__PURE__*/React__namespace.createElement("div", null, children);
|
|
75
131
|
}
|
|
76
|
-
return React__namespace.createElement("div",
|
|
132
|
+
return /*#__PURE__*/React__namespace.createElement("div", _extends({}, props, {
|
|
77
133
|
ref: ref
|
|
78
134
|
}), children);
|
|
79
135
|
};
|
|
80
136
|
|
|
81
137
|
Object.defineProperty(exports, 'useOutsideClick', {
|
|
82
|
-
|
|
83
|
-
|
|
138
|
+
enumerable: true,
|
|
139
|
+
get: function () { return useOutsideClick.useOutsideClick; }
|
|
84
140
|
});
|
|
85
141
|
exports.OutsideClick = OutsideClick;
|