@commonsku/styles 1.16.4 → 1.16.5
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/dist/index.d.ts +48 -2
- package/dist/index.es.js +17 -4
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +23 -2
- package/dist/index.js.map +1 -1
- package/dist/styles/hooks/useClickOutside.d.ts.map +1 -1
- package/dist/styles/index.d.ts +1 -0
- package/dist/styles/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3429,9 +3429,7 @@ var useClickOutside = function (props) {
|
|
|
3429
3429
|
var ref = props.ref, _a = props.eventType, eventType = _a === void 0 ? 'mousedown' : _a, onClick = props.onClick, onCleanup = props.onCleanup;
|
|
3430
3430
|
React.useEffect(function () {
|
|
3431
3431
|
function handleClickOutside(e) {
|
|
3432
|
-
console.log('handleClickOutside');
|
|
3433
3432
|
if (ref.current && !ref.current.contains(e.target)) {
|
|
3434
|
-
console.log('click outside');
|
|
3435
3433
|
onClick && onClick(e);
|
|
3436
3434
|
}
|
|
3437
3435
|
}
|
|
@@ -3443,6 +3441,21 @@ var useClickOutside = function (props) {
|
|
|
3443
3441
|
}, []);
|
|
3444
3442
|
};
|
|
3445
3443
|
|
|
3444
|
+
function useDelayUnmount(isMounted, delayTime) {
|
|
3445
|
+
var _a = React__default.useState(false), shouldRender = _a[0], setShouldRender = _a[1];
|
|
3446
|
+
React__default.useEffect(function () {
|
|
3447
|
+
var timeoutId;
|
|
3448
|
+
if (isMounted && !shouldRender) {
|
|
3449
|
+
setShouldRender(true);
|
|
3450
|
+
}
|
|
3451
|
+
else if (!isMounted && shouldRender) {
|
|
3452
|
+
timeoutId = setTimeout(function () { return setShouldRender(false); }, delayTime);
|
|
3453
|
+
}
|
|
3454
|
+
return function () { return clearTimeout(timeoutId); };
|
|
3455
|
+
}, [isMounted, delayTime, shouldRender]);
|
|
3456
|
+
return shouldRender;
|
|
3457
|
+
}
|
|
3458
|
+
|
|
3446
3459
|
var QUERY = '(prefers-reduced-motion: no-preference)';
|
|
3447
3460
|
var isRenderingOnServer = typeof window$1 === 'undefined';
|
|
3448
3461
|
var getInitialState = function () {
|
|
@@ -7402,4 +7415,12 @@ exports.parseCskuStyles = parseCskuStyles;
|
|
|
7402
7415
|
exports.sizes = sizes$1;
|
|
7403
7416
|
exports.themeOptions = themeOptions;
|
|
7404
7417
|
exports.toggleSizes = toggleSizes;
|
|
7418
|
+
exports.useCalendar = useCalendar;
|
|
7419
|
+
exports.useClickOutside = useClickOutside;
|
|
7420
|
+
exports.useDelayUnmount = useDelayUnmount;
|
|
7421
|
+
exports.useFallbackRef = useFallbackRef;
|
|
7422
|
+
exports.useLongPress = useLongPress;
|
|
7423
|
+
exports.usePrefersReducedMotion = usePrefersReducedMotion;
|
|
7424
|
+
exports.useRandomInterval = useRandomInterval;
|
|
7425
|
+
exports.useWindowSize = useWindowSize;
|
|
7405
7426
|
//# sourceMappingURL=index.js.map
|