@fluentui/react-positioning
Advanced tools
Comparing version 9.0.0-alpha.16 to 9.0.0-alpha.17
@@ -5,3 +5,18 @@ { | ||
{ | ||
"date": "Mon, 03 May 2021 07:43:20 GMT", | ||
"date": "Tue, 04 May 2021 07:34:33 GMT", | ||
"tag": "@fluentui/react-positioning_v9.0.0-alpha.17", | ||
"version": "9.0.0-alpha.17", | ||
"comments": { | ||
"prerelease": [ | ||
{ | ||
"comment": "Support popper target override", | ||
"author": "lingfan.gao@microsoft.com", | ||
"commit": "2aa0cde53c7bfda08651bc9e5bbe9a31d3a40b4f", | ||
"package": "@fluentui/react-positioning" | ||
} | ||
] | ||
} | ||
}, | ||
{ | ||
"date": "Mon, 03 May 2021 07:45:19 GMT", | ||
"tag": "@fluentui/react-positioning_v9.0.0-alpha.16", | ||
@@ -8,0 +23,0 @@ "version": "9.0.0-alpha.16", |
# Change Log - @fluentui/react-positioning | ||
This log was last generated on Mon, 03 May 2021 07:43:20 GMT and should not be manually modified. | ||
This log was last generated on Tue, 04 May 2021 07:34:33 GMT and should not be manually modified. | ||
<!-- Start content --> | ||
## [9.0.0-alpha.17](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0-alpha.17) | ||
Tue, 04 May 2021 07:34:33 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-alpha.16..@fluentui/react-positioning_v9.0.0-alpha.17) | ||
### Changes | ||
- Support popper target override ([PR #18015](https://github.com/microsoft/fluentui/pull/18015) by lingfan.gao@microsoft.com) | ||
## [9.0.0-alpha.16](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0-alpha.16) | ||
Mon, 03 May 2021 07:43:20 GMT | ||
Mon, 03 May 2021 07:45:19 GMT | ||
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-alpha.15..@fluentui/react-positioning_v9.0.0-alpha.16) | ||
@@ -11,0 +20,0 @@ |
@@ -91,2 +91,6 @@ import * as PopperJs from '@popperjs/core'; | ||
autoSize?: AutoSize; | ||
/** | ||
* Manual override for popper target. Useful for scenarios where a component accepts user prop to override target | ||
*/ | ||
target?: HTMLElement | null; | ||
} | ||
@@ -93,0 +97,0 @@ |
@@ -59,2 +59,3 @@ ## API Report File for "@fluentui/react-positioning" | ||
positionFixed?: boolean; | ||
target?: HTMLElement | null; | ||
unstable_disableTether?: boolean | 'all'; | ||
@@ -61,0 +62,0 @@ unstable_pinned?: boolean; |
@@ -69,2 +69,6 @@ import * as PopperJs from '@popperjs/core'; | ||
autoSize?: AutoSize; | ||
/** | ||
* Manual override for popper target. Useful for scenarios where a component accepts user prop to override target | ||
*/ | ||
target?: HTMLElement | null; | ||
} | ||
@@ -71,0 +75,0 @@ export interface PopperOptions extends PositioningProps { |
@@ -216,6 +216,7 @@ define(["require", "exports", "@fluentui/react-utilities", "@fluentui/react-shared-contexts", "./utils/index", "@popperjs/core", "react"], function (require, exports, react_utilities_1, react_shared_contexts_1, index_1, PopperJs, React) { | ||
popperInstanceRef.current = null; | ||
var target = options.target || targetRef.current; | ||
var popperInstance = null; | ||
if (index_1.isBrowser() && enabled) { | ||
if (targetRef.current && containerRef.current) { | ||
popperInstance = PopperJs.createPopper(targetRef.current, containerRef.current, resolvePopperOptions(targetRef.current, containerRef.current, arrowRef.current)); | ||
if (react_utilities_1.canUseDOM() && enabled) { | ||
if (target && containerRef.current) { | ||
popperInstance = PopperJs.createPopper(target, containerRef.current, resolvePopperOptions(target, containerRef.current, arrowRef.current)); | ||
} | ||
@@ -276,7 +277,7 @@ } | ||
}; | ||
}, [options.enabled]); | ||
}, [options.enabled, options.target]); | ||
react_utilities_1.useIsomorphicLayoutEffect(function () { | ||
var _a; | ||
if (!isFirstMount) { | ||
(_a = popperInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setOptions(resolvePopperOptions(targetRef.current, containerRef.current, arrowRef.current)); | ||
(_a = popperInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setOptions(resolvePopperOptions(options.target || targetRef.current, containerRef.current, arrowRef.current)); | ||
} | ||
@@ -283,0 +284,0 @@ }, [resolvePopperOptions]); |
@@ -1,2 +0,1 @@ | ||
export * from './isBrowser'; | ||
export * from './positioningHelper'; | ||
@@ -3,0 +2,0 @@ export * from './getBoundary'; |
@@ -1,5 +0,4 @@ | ||
define(["require", "exports", "tslib", "./isBrowser", "./positioningHelper", "./getBoundary", "./getScrollParent", "./getReactFiberFromNode", "./useCallbackRef"], function (require, exports, tslib_1, isBrowser_1, positioningHelper_1, getBoundary_1, getScrollParent_1, getReactFiberFromNode_1, useCallbackRef_1) { | ||
define(["require", "exports", "tslib", "./positioningHelper", "./getBoundary", "./getScrollParent", "./getReactFiberFromNode", "./useCallbackRef"], function (require, exports, tslib_1, positioningHelper_1, getBoundary_1, getScrollParent_1, getReactFiberFromNode_1, useCallbackRef_1) { | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
tslib_1.__exportStar(isBrowser_1, exports); | ||
tslib_1.__exportStar(positioningHelper_1, exports); | ||
@@ -6,0 +5,0 @@ tslib_1.__exportStar(getBoundary_1, exports); |
@@ -69,2 +69,6 @@ import * as PopperJs from '@popperjs/core'; | ||
autoSize?: AutoSize; | ||
/** | ||
* Manual override for popper target. Useful for scenarios where a component accepts user prop to override target | ||
*/ | ||
target?: HTMLElement | null; | ||
} | ||
@@ -71,0 +75,0 @@ export interface PopperOptions extends PositioningProps { |
@@ -220,6 +220,7 @@ "use strict"; | ||
popperInstanceRef.current = null; | ||
var target = options.target || targetRef.current; | ||
var popperInstance = null; | ||
if (index_1.isBrowser() && enabled) { | ||
if (targetRef.current && containerRef.current) { | ||
popperInstance = PopperJs.createPopper(targetRef.current, containerRef.current, resolvePopperOptions(targetRef.current, containerRef.current, arrowRef.current)); | ||
if (react_utilities_1.canUseDOM() && enabled) { | ||
if (target && containerRef.current) { | ||
popperInstance = PopperJs.createPopper(target, containerRef.current, resolvePopperOptions(target, containerRef.current, arrowRef.current)); | ||
} | ||
@@ -280,7 +281,7 @@ } | ||
}; | ||
}, [options.enabled]); | ||
}, [options.enabled, options.target]); | ||
react_utilities_1.useIsomorphicLayoutEffect(function () { | ||
var _a; | ||
if (!isFirstMount) { | ||
(_a = popperInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setOptions(resolvePopperOptions(targetRef.current, containerRef.current, arrowRef.current)); | ||
(_a = popperInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setOptions(resolvePopperOptions(options.target || targetRef.current, containerRef.current, arrowRef.current)); | ||
} | ||
@@ -287,0 +288,0 @@ }, [resolvePopperOptions]); |
@@ -1,2 +0,1 @@ | ||
export * from './isBrowser'; | ||
export * from './positioningHelper'; | ||
@@ -3,0 +2,0 @@ export * from './getBoundary'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var tslib_1 = require("tslib"); | ||
tslib_1.__exportStar(require("./isBrowser"), exports); | ||
tslib_1.__exportStar(require("./positioningHelper"), exports); | ||
@@ -6,0 +5,0 @@ tslib_1.__exportStar(require("./getBoundary"), exports); |
@@ -69,2 +69,6 @@ import * as PopperJs from '@popperjs/core'; | ||
autoSize?: AutoSize; | ||
/** | ||
* Manual override for popper target. Useful for scenarios where a component accepts user prop to override target | ||
*/ | ||
target?: HTMLElement | null; | ||
} | ||
@@ -71,0 +75,0 @@ export interface PopperOptions extends PositioningProps { |
@@ -1,4 +0,4 @@ | ||
import { useEventCallback, useIsomorphicLayoutEffect, useFirstMount } from '@fluentui/react-utilities'; | ||
import { useEventCallback, useIsomorphicLayoutEffect, useFirstMount, canUseDOM } from '@fluentui/react-utilities'; | ||
import { useFluent } from '@fluentui/react-shared-contexts'; | ||
import { isBrowser, getScrollParent, applyRtlToOffset, getPlacement, getReactFiberFromNode, getBoundary, useCallbackRef, } from './utils/index'; | ||
import { getScrollParent, applyRtlToOffset, getPlacement, getReactFiberFromNode, getBoundary, useCallbackRef, } from './utils/index'; | ||
import * as PopperJs from '@popperjs/core'; | ||
@@ -217,6 +217,7 @@ import * as React from 'react'; | ||
popperInstanceRef.current = null; | ||
var target = options.target || targetRef.current; | ||
var popperInstance = null; | ||
if (isBrowser() && enabled) { | ||
if (targetRef.current && containerRef.current) { | ||
popperInstance = PopperJs.createPopper(targetRef.current, containerRef.current, resolvePopperOptions(targetRef.current, containerRef.current, arrowRef.current)); | ||
if (canUseDOM() && enabled) { | ||
if (target && containerRef.current) { | ||
popperInstance = PopperJs.createPopper(target, containerRef.current, resolvePopperOptions(target, containerRef.current, arrowRef.current)); | ||
} | ||
@@ -277,7 +278,7 @@ } | ||
}; | ||
}, [options.enabled]); | ||
}, [options.enabled, options.target]); | ||
useIsomorphicLayoutEffect(function () { | ||
var _a; | ||
if (!isFirstMount) { | ||
(_a = popperInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setOptions(resolvePopperOptions(targetRef.current, containerRef.current, arrowRef.current)); | ||
(_a = popperInstanceRef.current) === null || _a === void 0 ? void 0 : _a.setOptions(resolvePopperOptions(options.target || targetRef.current, containerRef.current, arrowRef.current)); | ||
} | ||
@@ -284,0 +285,0 @@ }, [resolvePopperOptions]); |
@@ -1,2 +0,1 @@ | ||
export * from './isBrowser'; | ||
export * from './positioningHelper'; | ||
@@ -3,0 +2,0 @@ export * from './getBoundary'; |
@@ -1,2 +0,1 @@ | ||
export * from './isBrowser'; | ||
export * from './positioningHelper'; | ||
@@ -3,0 +2,0 @@ export * from './getBoundary'; |
{ | ||
"name": "@fluentui/react-positioning", | ||
"version": "9.0.0-alpha.16", | ||
"version": "9.0.0-alpha.17", | ||
"description": "A react wrapper around Popper.js for Fluent UI", | ||
@@ -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
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
2846
294783
91