@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
|
@@ -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;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@prom-ui/core/useOutsideClick");function t(e){if(e&&"object"==typeof e&&"default"in e)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var n=t(e);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},i.apply(this,arguments)}function u(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},u=Object.keys(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function o(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,l=[],c=!0,a=!1;try{if(u=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;c=!1}else for(;!(c=(n=u.call(t)).done)&&(l.push(n.value),l.length!==r);c=!0);}catch(f){a=!0,i=f}finally{try{if(!c&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(a)throw i}}return l}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return l(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 l(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 l(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}var c=["children","isActive","onClick"];Object.defineProperty(exports,"useOutsideClick",{enumerable:!0,get:function(){return r.useOutsideClick}}),exports.OutsideClick=function(e){var t=e.children,l=e.isActive,a=void 0===l||l,f=e.onClick,s=u(e,c),y=o(r.useOutsideClick(f),1)[0];return a?n.createElement("div",i({},s,{ref:y}),t):n.createElement("div",null,t)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),r=require("@prom-ui/core/useOutsideClick");function t(e){if(e&&"object"==typeof e&&"default"in e)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var n=t(e);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},i.apply(this,arguments)}function u(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},u=Object.keys(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(e,r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(i[t]=e[t])}return i}function o(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,l=[],c=!0,a=!1;try{if(u=(t=t.call(e)).next,0===r){if(Object(t)!==t)return;c=!1}else for(;!(c=(n=u.call(t)).done)&&(l.push(n.value),l.length!==r);c=!0);}catch(f){a=!0,i=f}finally{try{if(!c&&null!=t.return&&(o=t.return(),Object(o)!==o))return}finally{if(a)throw i}}return l}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return l(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 l(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 l(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}var c=["children","isActive","onClick"];Object.defineProperty(exports,"useOutsideClick",{enumerable:!0,get:function(){return r.useOutsideClick}}),exports.OutsideClick=function(e){var t=e.children,l=e.isActive,a=void 0===l||l,f=e.onClick,s=u(e,c),y=o(r.useOutsideClick(f),1)[0];return a?n.createElement("div",i({},s,{ref:y}),t):n.createElement("div",null,t)};
|
package/OutsideClick/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { useOutsideClick } from '@prom-ui/core/useOutsideClick';
|
|
3
|
-
type OutsideClickProps = {
|
|
4
|
-
/** React children */
|
|
5
|
-
children?: React.ReactNode;
|
|
6
|
-
/** Если передать `false` компонент перестанет работать */
|
|
7
|
-
isActive?: boolean;
|
|
8
|
-
/** Срабатывает если клик произошел вне компонента */
|
|
9
|
-
onClick: () => void;
|
|
10
|
-
};
|
|
11
|
-
export declare const OutsideClick: React.FC<OutsideClickProps>;
|
|
12
|
-
export { useOutsideClick };
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { useOutsideClick } from '@prom-ui/core/useOutsideClick';
|
|
3
|
+
type OutsideClickProps = {
|
|
4
|
+
/** React children */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Если передать `false` компонент перестанет работать */
|
|
7
|
+
isActive?: boolean;
|
|
8
|
+
/** Срабатывает если клик произошел вне компонента */
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const OutsideClick: React.FC<OutsideClickProps>;
|
|
12
|
+
export { useOutsideClick };
|