@fluentui/react-utilities
Advanced tools
Comparing version 9.0.0-alpha.8 to 9.0.0-alpha.9
@@ -5,6 +5,36 @@ { | ||
{ | ||
"date": "Mon, 15 Mar 2021 07:33:50 GMT", | ||
"date": "Thu, 18 Mar 2021 20:11:49 GMT", | ||
"tag": "@fluentui/react-utilities_v9.0.0-alpha.9", | ||
"version": "9.0.0-alpha.9", | ||
"comments": { | ||
"prerelease": [ | ||
{ | ||
"comment": "Add onUseClickOutside hook", | ||
"author": "lingfan.gao@microsoft.com", | ||
"commit": "165259181dd79866dc7ae5fa57c10a0f209d668f", | ||
"package": "@fluentui/react-utilities" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Wed, 17 Mar 2021 07:35:44 GMT", | ||
"tag": "@fluentui/react-utilities_v9.0.0-alpha.8", | ||
"version": "9.0.0-alpha.8", | ||
"comments": { | ||
"none": [ | ||
{ | ||
"comment": "restore README for compose utils", | ||
"author": "olfedias@microsoft.com", | ||
"commit": "51902da6d01f0e9a790ca686e32eb94b31ecf733", | ||
"package": "@fluentui/react-utilities" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Mon, 15 Mar 2021 07:36:20 GMT", | ||
"tag": "@fluentui/react-utilities_v9.0.0-alpha.8", | ||
"version": "9.0.0-alpha.8", | ||
"comments": { | ||
"prerelease": [ | ||
@@ -11,0 +41,0 @@ { |
# Change Log - @fluentui/react-utilities | ||
This log was last generated on Mon, 15 Mar 2021 07:33:50 GMT and should not be manually modified. | ||
This log was last generated on Thu, 18 Mar 2021 20:11:49 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## [9.0.0-alpha.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.0.0-alpha.9) | ||
Thu, 18 Mar 2021 20:11:49 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.0.0-alpha.8..@fluentui/react-utilities_v9.0.0-alpha.9) | ||
### Changes | ||
- Add onUseClickOutside hook ([PR #17387](https://github.com/microsoft/fluentui/pull/17387) by lingfan.gao@microsoft.com) | ||
## [9.0.0-alpha.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-utilities_v9.0.0-alpha.8) | ||
Mon, 15 Mar 2021 07:33:50 GMT | ||
Mon, 15 Mar 2021 07:36:20 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-utilities_v9.0.0-alpha.7..@fluentui/react-utilities_v9.0.0-alpha.8) | ||
@@ -11,0 +20,0 @@ |
@@ -376,2 +376,22 @@ import * as React 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 = { | ||
/** | ||
* The element to listen for the click event | ||
*/ | ||
element?: Document; | ||
/** | ||
* Refs to elements that check if the click is outside | ||
*/ | ||
refs: React.MutableRefObject<HTMLElement | undefined | null>[]; | ||
/** | ||
* Called if the click is outside the element refs | ||
*/ | ||
callback: (ev: MouseEvent | TouchEvent) => void; | ||
}; | ||
/** | ||
* An array of VIDEO tag properties and events. | ||
@@ -378,0 +398,0 @@ * |
@@ -192,2 +192,12 @@ ## API Report File for "@fluentui/react-utilities" | ||
// @public | ||
export const useOnClickOutside: (options: UseOnClickOutsideOptions) => void; | ||
// @public (undocumented) | ||
export type UseOnClickOutsideOptions = { | ||
element?: Document; | ||
refs: React.MutableRefObject<HTMLElement | undefined | null>[]; | ||
callback: (ev: MouseEvent | TouchEvent) => void; | ||
}; | ||
// @public | ||
export const videoProperties: Record<string, number>; | ||
@@ -194,0 +204,0 @@ |
@@ -8,1 +8,2 @@ export * from './useBoolean'; | ||
export * from './useMergedRefs'; | ||
export * from './useOnClickOutside'; |
@@ -1,2 +0,2 @@ | ||
define(["require", "exports", "tslib", "./useBoolean", "./useConst", "./useControllableValue", "./useEventCallback", "./useId", "./useIsomorphicLayoutEffect", "./useMergedRefs"], function (require, exports, tslib_1, useBoolean_1, useConst_1, useControllableValue_1, useEventCallback_1, useId_1, useIsomorphicLayoutEffect_1, useMergedRefs_1) { | ||
define(["require", "exports", "tslib", "./useBoolean", "./useConst", "./useControllableValue", "./useEventCallback", "./useId", "./useIsomorphicLayoutEffect", "./useMergedRefs", "./useOnClickOutside"], function (require, exports, tslib_1, useBoolean_1, useConst_1, useControllableValue_1, useEventCallback_1, useId_1, useIsomorphicLayoutEffect_1, useMergedRefs_1, useOnClickOutside_1) { | ||
"use strict"; | ||
@@ -11,3 +11,4 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
tslib_1.__exportStar(useMergedRefs_1, exports); | ||
tslib_1.__exportStar(useOnClickOutside_1, exports); | ||
}); | ||
//# sourceMappingURL=index.js.map |
@@ -8,1 +8,2 @@ export * from './useBoolean'; | ||
export * from './useMergedRefs'; | ||
export * from './useOnClickOutside'; |
@@ -12,2 +12,3 @@ "use strict"; | ||
tslib_1.__exportStar(require("./useMergedRefs"), exports); | ||
tslib_1.__exportStar(require("./useOnClickOutside"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -8,1 +8,2 @@ export * from './useBoolean'; | ||
export * from './useMergedRefs'; | ||
export * from './useOnClickOutside'; |
@@ -8,2 +8,3 @@ export * from './useBoolean'; | ||
export * from './useMergedRefs'; | ||
export * from './useOnClickOutside'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@fluentui/react-utilities", | ||
"version": "9.0.0-alpha.8", | ||
"version": "9.0.0-alpha.9", | ||
"description": "A set of general React-specific utilities.", | ||
@@ -5,0 +5,0 @@ "main": "lib-commonjs/index.js", |
@@ -5,14 +5,2 @@ # @fluentui/react-utilities | ||
## API | ||
### childrenExist(children) | ||
Tests if children are nil in React and Preact. React `children` can be one many types. See the [tests](./src/childrenExist.test.tsx) for all the covered cases. | ||
Example: | ||
```jsx | ||
if (childrenExist(props.children)) { | ||
// render children. | ||
} | ||
``` | ||
These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release. |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
371787
193
4767
6