@fluentui/react-utilities
Advanced tools
Comparing version 9.0.0-alpha.25 to 9.0.0-alpha.26
@@ -5,3 +5,26 @@ { | ||
{ | ||
"date": "Wed, 26 May 2021 07:32:22 GMT", | ||
"date": "Fri, 28 May 2021 07:33:18 GMT", | ||
"tag": "@fluentui/react-utilities_v9.0.0-alpha.26", | ||
"version": "9.0.0-alpha.26", | ||
"comments": { | ||
"prerelease": [ | ||
{ | ||
"comment": "useOnScrollOutside hook to detect scroll outside a component", | ||
"author": "lingfan.gao@microsoft.com", | ||
"commit": "53145c8f329f92f25d1ce2cd132e6dc4ee4ce43a", | ||
"package": "@fluentui/react-utilities" | ||
} | ||
], | ||
"none": [ | ||
{ | ||
"comment": "enable Jest aliases", | ||
"author": "olfedias@microsoft.com", | ||
"commit": "5379823a6f53bd36a936806153d228b9a0ef0543", | ||
"package": "@fluentui/react-utilities" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Wed, 26 May 2021 07:35:43 GMT", | ||
"tag": "@fluentui/react-utilities_v9.0.0-alpha.25", | ||
@@ -8,0 +31,0 @@ "version": "9.0.0-alpha.25", |
# Change Log - @fluentui/react-utilities | ||
This log was last generated on Wed, 26 May 2021 07:32:22 GMT and should not be manually modified. | ||
This log was last generated on Fri, 28 May 2021 07:33:18 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## [9.0.0-alpha.26](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.0.0-alpha.26) | ||
Fri, 28 May 2021 07:33:18 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.0.0-alpha.25..@fluentui/react-utilities_v9.0.0-alpha.26) | ||
### Changes | ||
- useOnScrollOutside hook to detect scroll outside a component ([PR #18312](https://github.com/microsoft/fluentui/pull/18312) by lingfan.gao@microsoft.com) | ||
## [9.0.0-alpha.25](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.0.0-alpha.25) | ||
Wed, 26 May 2021 07:32:22 GMT | ||
Wed, 26 May 2021 07:35:43 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.0.0-alpha.24..@fluentui/react-utilities_v9.0.0-alpha.25) | ||
@@ -11,0 +20,0 @@ |
@@ -558,8 +558,3 @@ import * as React_2 from 'react'; | ||
/** | ||
* Utility to perform checks where a click/touch event was made outside a compoent | ||
*/ | ||
export declare const useOnClickOutside: (options: UseOnClickOutsideOptions) => void; | ||
export declare type UseOnClickOutsideOptions = { | ||
export declare interface UseOnClickOrScrollOutsideOptions { | ||
/** | ||
@@ -574,6 +569,2 @@ * The element to listen for the click event | ||
/** | ||
* Called if the click is outside the element refs | ||
*/ | ||
callback: (ev: MouseEvent | TouchEvent) => void; | ||
/** | ||
* By default uses element.contains, but custom contain function can be provided | ||
@@ -588,4 +579,18 @@ * @param parentRef - provided parent ref | ||
disabled?: boolean; | ||
}; | ||
/** | ||
* Called if the click is outside the element refs | ||
*/ | ||
callback: (ev: MouseEvent | TouchEvent) => void; | ||
} | ||
/** | ||
* Utility to perform checks where a click/touch event was made outside a compoent | ||
*/ | ||
export declare const useOnClickOutside: (options: UseOnClickOrScrollOutsideOptions) => void; | ||
/** | ||
* Utility to perform checks where a click/touch event was made outside a compoent | ||
*/ | ||
export declare const useOnScrollOutside: (options: UseOnClickOrScrollOutsideOptions) => void; | ||
export declare const usePrevious: <ValueType = unknown>(value: ValueType) => ValueType | null; | ||
@@ -592,0 +597,0 @@ |
@@ -294,14 +294,17 @@ ## API Report File for "@fluentui/react-utilities" | ||
// @public | ||
export const useOnClickOutside: (options: UseOnClickOutsideOptions) => void; | ||
// @public (undocumented) | ||
export type UseOnClickOutsideOptions = { | ||
element: Document | undefined; | ||
refs: React_2.MutableRefObject<HTMLElement | undefined | null>[]; | ||
export interface UseOnClickOrScrollOutsideOptions { | ||
callback: (ev: MouseEvent | TouchEvent) => void; | ||
contains?(parent: HTMLElement | null, child: HTMLElement): boolean; | ||
disabled?: boolean; | ||
}; | ||
element: Document | undefined; | ||
refs: React_2.MutableRefObject<HTMLElement | undefined | null>[]; | ||
} | ||
// @public | ||
export const useOnClickOutside: (options: UseOnClickOrScrollOutsideOptions) => void; | ||
// @public | ||
export const useOnScrollOutside: (options: UseOnClickOrScrollOutsideOptions) => void; | ||
// @public (undocumented) | ||
@@ -308,0 +311,0 @@ export const usePrevious: <ValueType = unknown>(value: ValueType) => ValueType | null; |
@@ -10,2 +10,3 @@ export * from './useBoolean'; | ||
export * from './useOnClickOutside'; | ||
export * from './useOnScrollOutside'; | ||
export * from './usePrevious'; |
@@ -1,2 +0,2 @@ | ||
define(["require", "exports", "tslib", "./useBoolean", "./useConst", "./useControllableValue", "./useEventCallback", "./useFirstMount", "./useId", "./useIsomorphicLayoutEffect", "./useMergedRefs", "./useOnClickOutside", "./usePrevious"], function (require, exports, tslib_1, useBoolean_1, useConst_1, useControllableValue_1, useEventCallback_1, useFirstMount_1, useId_1, useIsomorphicLayoutEffect_1, useMergedRefs_1, useOnClickOutside_1, usePrevious_1) { | ||
define(["require", "exports", "tslib", "./useBoolean", "./useConst", "./useControllableValue", "./useEventCallback", "./useFirstMount", "./useId", "./useIsomorphicLayoutEffect", "./useMergedRefs", "./useOnClickOutside", "./useOnScrollOutside", "./usePrevious"], function (require, exports, tslib_1, useBoolean_1, useConst_1, useControllableValue_1, useEventCallback_1, useFirstMount_1, useId_1, useIsomorphicLayoutEffect_1, useMergedRefs_1, useOnClickOutside_1, useOnScrollOutside_1, usePrevious_1) { | ||
"use strict"; | ||
@@ -13,4 +13,5 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
tslib_1.__exportStar(useOnClickOutside_1, exports); | ||
tslib_1.__exportStar(useOnScrollOutside_1, exports); | ||
tslib_1.__exportStar(usePrevious_1, exports); | ||
}); | ||
//# sourceMappingURL=index.js.map |
import * as React from 'react'; | ||
export declare type UseOnClickOutsideOptions = { | ||
export interface UseOnClickOrScrollOutsideOptions { | ||
/** | ||
@@ -12,6 +12,2 @@ * The element to listen for the click event | ||
/** | ||
* Called if the click is outside the element refs | ||
*/ | ||
callback: (ev: MouseEvent | TouchEvent) => void; | ||
/** | ||
* By default uses element.contains, but custom contain function can be provided | ||
@@ -26,6 +22,10 @@ * @param parentRef - provided parent ref | ||
disabled?: boolean; | ||
}; | ||
/** | ||
* Called if the click is outside the element refs | ||
*/ | ||
callback: (ev: MouseEvent | TouchEvent) => void; | ||
} | ||
/** | ||
* Utility to perform checks where a click/touch event was made outside a compoent | ||
*/ | ||
export declare const useOnClickOutside: (options: UseOnClickOutsideOptions) => void; | ||
export declare const useOnClickOutside: (options: UseOnClickOrScrollOutsideOptions) => void; |
@@ -10,2 +10,3 @@ export * from './useBoolean'; | ||
export * from './useOnClickOutside'; | ||
export * from './useOnScrollOutside'; | ||
export * from './usePrevious'; |
@@ -27,3 +27,5 @@ "use strict"; | ||
tslib_1.__exportStar(require("./useOnScrollOutside"), exports); | ||
tslib_1.__exportStar(require("./usePrevious"), exports); | ||
//# sourceMappingURL=index.js.map |
import * as React from 'react'; | ||
export declare type UseOnClickOutsideOptions = { | ||
export interface UseOnClickOrScrollOutsideOptions { | ||
/** | ||
@@ -12,6 +12,2 @@ * The element to listen for the click event | ||
/** | ||
* Called if the click is outside the element refs | ||
*/ | ||
callback: (ev: MouseEvent | TouchEvent) => void; | ||
/** | ||
* By default uses element.contains, but custom contain function can be provided | ||
@@ -26,6 +22,10 @@ * @param parentRef - provided parent ref | ||
disabled?: boolean; | ||
}; | ||
/** | ||
* Called if the click is outside the element refs | ||
*/ | ||
callback: (ev: MouseEvent | TouchEvent) => void; | ||
} | ||
/** | ||
* Utility to perform checks where a click/touch event was made outside a compoent | ||
*/ | ||
export declare const useOnClickOutside: (options: UseOnClickOutsideOptions) => void; | ||
export declare const useOnClickOutside: (options: UseOnClickOrScrollOutsideOptions) => void; |
@@ -10,2 +10,3 @@ export * from './useBoolean'; | ||
export * from './useOnClickOutside'; | ||
export * from './useOnScrollOutside'; | ||
export * from './usePrevious'; |
@@ -10,3 +10,4 @@ export * from './useBoolean'; | ||
export * from './useOnClickOutside'; | ||
export * from './useOnScrollOutside'; | ||
export * from './usePrevious'; | ||
//# sourceMappingURL=index.js.map |
import * as React from 'react'; | ||
export declare type UseOnClickOutsideOptions = { | ||
export interface UseOnClickOrScrollOutsideOptions { | ||
/** | ||
@@ -12,6 +12,2 @@ * The element to listen for the click event | ||
/** | ||
* Called if the click is outside the element refs | ||
*/ | ||
callback: (ev: MouseEvent | TouchEvent) => void; | ||
/** | ||
* By default uses element.contains, but custom contain function can be provided | ||
@@ -26,6 +22,10 @@ * @param parentRef - provided parent ref | ||
disabled?: boolean; | ||
}; | ||
/** | ||
* Called if the click is outside the element refs | ||
*/ | ||
callback: (ev: MouseEvent | TouchEvent) => void; | ||
} | ||
/** | ||
* Utility to perform checks where a click/touch event was made outside a compoent | ||
*/ | ||
export declare const useOnClickOutside: (options: UseOnClickOutsideOptions) => void; | ||
export declare const useOnClickOutside: (options: UseOnClickOrScrollOutsideOptions) => void; |
{ | ||
"name": "@fluentui/react-utilities", | ||
"version": "9.0.0-alpha.25", | ||
"version": "9.0.0-alpha.26", | ||
"description": "A set of general React-specific utilities.", | ||
@@ -5,0 +5,0 @@ "main": "lib-commonjs/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
644538
292
7401