@fluentui/react-portal 9.0.0-rc.7 → 9.0.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/CHANGELOG.json +265 -1
- package/CHANGELOG.md +170 -74
- package/dist/{react-portal.d.ts → index.d.ts} +6 -7
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Portal/Portal.js.map +1 -1
- package/lib/components/Portal/Portal.types.js.map +1 -1
- package/lib/components/Portal/renderPortal.js.map +1 -1
- package/lib/components/Portal/usePortal.js.map +1 -1
- package/lib/components/Portal/usePortalMountNode.js +28 -6
- package/lib/components/Portal/usePortalMountNode.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/virtualParent/elementContains.js.map +1 -1
- package/lib/virtualParent/getParent.js.map +1 -1
- package/lib/virtualParent/getVirtualParent.js.map +1 -1
- package/lib/virtualParent/isVirtualElement.js.map +1 -1
- package/lib/virtualParent/setVirtualParent.js.map +1 -1
- package/lib-commonjs/components/Portal/Portal.js.map +1 -1
- package/lib-commonjs/components/Portal/renderPortal.js.map +1 -1
- package/lib-commonjs/components/Portal/usePortal.js.map +1 -1
- package/lib-commonjs/components/Portal/usePortalMountNode.js +28 -6
- package/lib-commonjs/components/Portal/usePortalMountNode.js.map +1 -1
- package/lib-commonjs/index.js +23 -6
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/virtualParent/elementContains.js.map +1 -1
- package/lib-commonjs/virtualParent/getParent.js.map +1 -1
- package/lib-commonjs/virtualParent/getVirtualParent.js.map +1 -1
- package/lib-commonjs/virtualParent/isVirtualElement.js.map +1 -1
- package/lib-commonjs/virtualParent/setVirtualParent.js.map +1 -1
- package/package.json +9 -10
- package/lib/Portal.d.ts +0 -1
- package/lib/components/Portal/Portal.d.ts +0 -7
- package/lib/components/Portal/Portal.types.d.ts +0 -22
- package/lib/components/Portal/index.d.ts +0 -4
- package/lib/components/Portal/renderPortal.d.ts +0 -6
- package/lib/components/Portal/usePortal.d.ts +0 -9
- package/lib/components/Portal/usePortalMountNode.d.ts +0 -10
- package/lib/index.d.ts +0 -2
- package/lib/virtualParent/elementContains.d.ts +0 -7
- package/lib/virtualParent/getParent.d.ts +0 -5
- package/lib/virtualParent/getVirtualParent.d.ts +0 -4
- package/lib/virtualParent/index.d.ts +0 -5
- package/lib/virtualParent/isVirtualElement.d.ts +0 -5
- package/lib/virtualParent/setVirtualParent.d.ts +0 -7
- package/lib/virtualParent/types.d.ts +0 -5
- package/lib-commonjs/Portal.d.ts +0 -1
- package/lib-commonjs/components/Portal/Portal.d.ts +0 -7
- package/lib-commonjs/components/Portal/Portal.types.d.ts +0 -22
- package/lib-commonjs/components/Portal/index.d.ts +0 -4
- package/lib-commonjs/components/Portal/renderPortal.d.ts +0 -6
- package/lib-commonjs/components/Portal/usePortal.d.ts +0 -9
- package/lib-commonjs/components/Portal/usePortalMountNode.d.ts +0 -10
- package/lib-commonjs/index.d.ts +0 -2
- package/lib-commonjs/virtualParent/elementContains.d.ts +0 -7
- package/lib-commonjs/virtualParent/getParent.d.ts +0 -5
- package/lib-commonjs/virtualParent/getVirtualParent.d.ts +0 -4
- package/lib-commonjs/virtualParent/index.d.ts +0 -5
- package/lib-commonjs/virtualParent/isVirtualElement.d.ts +0 -5
- package/lib-commonjs/virtualParent/setVirtualParent.d.ts +0 -7
- package/lib-commonjs/virtualParent/types.d.ts +0 -5
@@ -1,7 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { PortalProps } from './Portal.types';
|
3
|
-
/**
|
4
|
-
* A portal provides a way to render children into a DOM node
|
5
|
-
* that exists outside the DOM hierarchy of the parent component.
|
6
|
-
*/
|
7
|
-
export declare const Portal: React.FC<PortalProps>;
|
@@ -1,22 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
declare type PortalCommons = {
|
3
|
-
/**
|
4
|
-
* React children
|
5
|
-
*/
|
6
|
-
children: React.ReactNode;
|
7
|
-
/**
|
8
|
-
* Where the portal children are mounted on DOM
|
9
|
-
* @defaultValue a new element on document.body without any styling
|
10
|
-
*/
|
11
|
-
mountNode: HTMLElement | null;
|
12
|
-
};
|
13
|
-
export declare type PortalProps = Partial<PortalCommons>;
|
14
|
-
export declare type PortalState = PortalCommons & {
|
15
|
-
/** Indicates if a Portal should be rendered. */
|
16
|
-
shouldRender: boolean;
|
17
|
-
/**
|
18
|
-
* Ref to the root span element as virtual parent
|
19
|
-
*/
|
20
|
-
virtualParentRootRef: React.MutableRefObject<HTMLSpanElement | null>;
|
21
|
-
};
|
22
|
-
export {};
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import type { PortalProps, PortalState } from './Portal.types';
|
2
|
-
/**
|
3
|
-
* Create the state required to render Portal.
|
4
|
-
*
|
5
|
-
* The returned state can be modified with hooks such as usePortalStyles, before being passed to renderPortal_unstable.
|
6
|
-
*
|
7
|
-
* @param props - props from this instance of Portal
|
8
|
-
*/
|
9
|
-
export declare const usePortal_unstable: (props: PortalProps) => PortalState;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
export declare type UsePortalMountNodeOptions = {
|
2
|
-
/**
|
3
|
-
* Since hooks cannot be called conditionally use this flag to disable creating the node
|
4
|
-
*/
|
5
|
-
disabled?: boolean;
|
6
|
-
};
|
7
|
-
/**
|
8
|
-
* Creates a new element on a document.body to mount portals
|
9
|
-
*/
|
10
|
-
export declare const usePortalMountNode: (options: UsePortalMountNodeOptions) => HTMLElement | null;
|
package/lib-commonjs/index.d.ts
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Similar functionality to `element.contains` DOM API for use with out of order DOM elements that
|
3
|
-
* checks the virtual parent hierarchy. If a virtual parents exists, it is chosen over the actual parent
|
4
|
-
*
|
5
|
-
* @returns true if the child can find the parent in its virtual hierarchy
|
6
|
-
*/
|
7
|
-
export declare function elementContains(parent: HTMLElement | null, child: HTMLElement | null): boolean;
|
@@ -1,7 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Sets the virtual parent of an element.
|
3
|
-
*
|
4
|
-
* @param child - Theme element to set the virtual parent
|
5
|
-
* @param parent - The virtual parent, use `undefined` to remove a virtual parent relationship
|
6
|
-
*/
|
7
|
-
export declare function setVirtualParent(child: HTMLElement, parent?: HTMLElement): void;
|