@fluentui/react-popover 9.0.0-nightly.46b9ea7036.0 → 9.0.0-rc.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +368 -29
- package/CHANGELOG.md +89 -21
- package/dist/react-popover.d.ts +31 -20
- package/lib/components/Popover/Popover.js +5 -5
- package/lib/components/Popover/Popover.js.map +1 -1
- package/lib/components/Popover/Popover.types.d.ts +2 -1
- package/lib/components/Popover/renderPopover.d.ts +1 -1
- package/lib/components/Popover/renderPopover.js +27 -25
- package/lib/components/Popover/renderPopover.js.map +1 -1
- package/lib/components/Popover/usePopover.d.ts +2 -2
- package/lib/components/Popover/usePopover.js +42 -53
- package/lib/components/Popover/usePopover.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.js +7 -7
- package/lib/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/PopoverSurface.types.d.ts +2 -2
- package/lib/components/PopoverSurface/renderPopoverSurface.d.ts +1 -1
- package/lib/components/PopoverSurface/renderPopoverSurface.js +7 -8
- package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurface.d.ts +4 -5
- package/lib/components/PopoverSurface/usePopoverSurface.js +44 -58
- package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +2 -1
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js +34 -22
- package/lib/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.d.ts +2 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.js +6 -5
- package/lib/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/PopoverTrigger.types.d.ts +9 -2
- package/lib/components/PopoverTrigger/renderPopoverTrigger.d.ts +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js +1 -1
- package/lib/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib/components/PopoverTrigger/usePopoverTrigger.d.ts +2 -2
- package/lib/components/PopoverTrigger/usePopoverTrigger.js +39 -54
- package/lib/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib/popoverContext.d.ts +1 -1
- package/lib/popoverContext.js +3 -7
- package/lib/popoverContext.js.map +1 -1
- package/lib-commonjs/Popover.js +1 -1
- package/lib-commonjs/PopoverSurface.js +1 -1
- package/lib-commonjs/PopoverTrigger.js +1 -1
- package/lib-commonjs/components/Popover/Popover.js +5 -5
- package/lib-commonjs/components/Popover/Popover.js.map +1 -1
- package/lib-commonjs/components/Popover/Popover.types.d.ts +2 -1
- package/lib-commonjs/components/Popover/index.js +1 -1
- package/lib-commonjs/components/Popover/renderPopover.d.ts +1 -1
- package/lib-commonjs/components/Popover/renderPopover.js +31 -29
- package/lib-commonjs/components/Popover/renderPopover.js.map +1 -1
- package/lib-commonjs/components/Popover/usePopover.d.ts +2 -2
- package/lib-commonjs/components/Popover/usePopover.js +50 -62
- package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js +8 -8
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/PopoverSurface.types.d.ts +2 -2
- package/lib-commonjs/components/PopoverSurface/index.js +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.d.ts +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +12 -15
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.d.ts +4 -5
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +50 -65
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.d.ts +2 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js +38 -24
- package/lib-commonjs/components/PopoverSurface/usePopoverSurfaceStyles.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.d.ts +2 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js +6 -5
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/PopoverTrigger.types.d.ts +9 -2
- package/lib-commonjs/components/PopoverTrigger/index.js +1 -1
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.d.ts +1 -1
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js +3 -3
- package/lib-commonjs/components/PopoverTrigger/renderPopoverTrigger.js.map +1 -1
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.d.ts +2 -2
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js +44 -60
- package/lib-commonjs/components/PopoverTrigger/usePopoverTrigger.js.map +1 -1
- package/lib-commonjs/index.js +1 -1
- package/lib-commonjs/popoverContext.d.ts +1 -1
- package/lib-commonjs/popoverContext.js +5 -9
- package/lib-commonjs/popoverContext.js.map +1 -1
- package/package.json +13 -15
- package/lib/common/isConformant.d.ts +0 -4
- package/lib/common/isConformant.js +0 -13
- package/lib/common/isConformant.js.map +0 -1
- package/lib/common/mockUsePopoverContext.d.ts +0 -7
- package/lib/common/mockUsePopoverContext.js +0 -38
- package/lib/common/mockUsePopoverContext.js.map +0 -1
- package/lib-commonjs/common/isConformant.d.ts +0 -4
- package/lib-commonjs/common/isConformant.js +0 -24
- package/lib-commonjs/common/isConformant.js.map +0 -1
- package/lib-commonjs/common/mockUsePopoverContext.d.ts +0 -7
- package/lib-commonjs/common/mockUsePopoverContext.js +0 -49
- package/lib-commonjs/common/mockUsePopoverContext.js.map +0 -1
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
|
7
|
-
|
7
|
+
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
8
|
|
9
9
|
tslib_1.__exportStar(require("./components/PopoverTrigger/index"), exports);
|
10
10
|
//# sourceMappingURL=PopoverTrigger.js.map
|
@@ -5,17 +5,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.Popover = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const usePopover_1 = /*#__PURE__*/require("./usePopover");
|
9
9
|
|
10
|
-
|
10
|
+
const renderPopover_1 = /*#__PURE__*/require("./renderPopover");
|
11
11
|
/**
|
12
12
|
* Wrapper component that manages state for a PopoverTrigger and a PopoverSurface components.
|
13
13
|
*/
|
14
14
|
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
return renderPopover_1.
|
16
|
+
const Popover = props => {
|
17
|
+
const state = usePopover_1.usePopover_unstable(props);
|
18
|
+
return renderPopover_1.renderPopover_unstable(state);
|
19
19
|
};
|
20
20
|
|
21
21
|
exports.Popover = Popover;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":";;;;;;;AACA,
|
1
|
+
{"version":3,"sources":["../../../src/components/Popover/Popover.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,YAAA,gBAAA,OAAA,CAAA,cAAA,CAAA;;AACA,MAAA,eAAA,gBAAA,OAAA,CAAA,iBAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,OAAO,GAA2B,KAAK,IAAG;AACrD,QAAM,KAAK,GAAG,YAAA,CAAA,mBAAA,CAAoB,KAApB,CAAd;AAEA,SAAO,eAAA,CAAA,sBAAA,CAAuB,KAAvB,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,OAAA,GAAO,OAAP;AAMb,OAAA,CAAA,OAAA,CAAQ,WAAR,GAAsB,SAAtB","sourceRoot":""}
|
@@ -5,7 +5,7 @@ import type { PortalProps } from '@fluentui/react-portal';
|
|
5
5
|
* Determines popover padding and arrow size
|
6
6
|
*/
|
7
7
|
export declare type PopoverSize = 'small' | 'medium' | 'large';
|
8
|
-
|
8
|
+
declare type PopoverCommons = Pick<PortalProps, 'mountNode'> & {
|
9
9
|
/**
|
10
10
|
* Controls the opening of the Popover
|
11
11
|
*/
|
@@ -100,3 +100,4 @@ export declare type OnOpenChangeData = {
|
|
100
100
|
* The supported events that will trigger open/close of the menu
|
101
101
|
*/
|
102
102
|
export declare type OpenPopoverEvents = MouseEvent | TouchEvent | React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement> | React.FocusEvent<HTMLElement>;
|
103
|
+
export {};
|
@@ -3,46 +3,48 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.renderPopover_unstable = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const popoverContext_1 = /*#__PURE__*/require("../../popoverContext");
|
11
11
|
/**
|
12
12
|
* Render the final JSX of Popover
|
13
13
|
*/
|
14
14
|
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
16
|
+
const renderPopover_unstable = state => {
|
17
|
+
const {
|
18
|
+
open,
|
19
|
+
setOpen,
|
20
|
+
triggerRef,
|
21
|
+
contentRef,
|
22
|
+
openOnContext,
|
23
|
+
openOnHover,
|
24
|
+
mountNode,
|
25
|
+
arrowRef,
|
26
|
+
size,
|
27
|
+
noArrow,
|
28
|
+
appearance,
|
29
|
+
trapFocus
|
30
|
+
} = state;
|
29
31
|
return React.createElement(popoverContext_1.PopoverContext.Provider, {
|
30
32
|
value: {
|
31
|
-
open
|
32
|
-
setOpen
|
33
|
-
triggerRef
|
34
|
-
contentRef
|
35
|
-
openOnHover
|
36
|
-
openOnContext
|
37
|
-
mountNode
|
38
|
-
arrowRef
|
39
|
-
size
|
40
|
-
noArrow
|
41
|
-
appearance
|
42
|
-
trapFocus
|
33
|
+
open,
|
34
|
+
setOpen,
|
35
|
+
triggerRef,
|
36
|
+
contentRef,
|
37
|
+
openOnHover,
|
38
|
+
openOnContext,
|
39
|
+
mountNode,
|
40
|
+
arrowRef,
|
41
|
+
size,
|
42
|
+
noArrow,
|
43
|
+
appearance,
|
44
|
+
trapFocus
|
43
45
|
}
|
44
46
|
}, state.children);
|
45
47
|
};
|
46
48
|
|
47
|
-
exports.
|
49
|
+
exports.renderPopover_unstable = renderPopover_unstable;
|
48
50
|
//# sourceMappingURL=renderPopover.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Popover/renderPopover.tsx"],"names":[],"mappings":";;;;;;;AAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/Popover/renderPopover.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,sBAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,sBAAsB,GAAI,KAAD,IAAwB;AAC5D,QAAM;AACJ,IAAA,IADI;AAEJ,IAAA,OAFI;AAGJ,IAAA,UAHI;AAIJ,IAAA,UAJI;AAKJ,IAAA,aALI;AAMJ,IAAA,WANI;AAOJ,IAAA,SAPI;AAQJ,IAAA,QARI;AASJ,IAAA,IATI;AAUJ,IAAA,OAVI;AAWJ,IAAA,UAXI;AAYJ,IAAA;AAZI,MAaF,KAbJ;AAeA,SACE,KAAA,CAAA,aAAA,CAAC,gBAAA,CAAA,cAAA,CAAe,QAAhB,EAAwB;AACtB,IAAA,KAAK,EAAE;AACL,MAAA,IADK;AAEL,MAAA,OAFK;AAGL,MAAA,UAHK;AAIL,MAAA,UAJK;AAKL,MAAA,WALK;AAML,MAAA,aANK;AAOL,MAAA,SAPK;AAQL,MAAA,QARK;AASL,MAAA,IATK;AAUL,MAAA,OAVK;AAWL,MAAA,UAXK;AAYL,MAAA;AAZK;AADe,GAAxB,EAgBG,KAAK,CAAC,QAhBT,CADF;AAoBD,CApCM;;AAAM,OAAA,CAAA,sBAAA,GAAsB,sBAAtB","sourceRoot":""}
|
@@ -3,8 +3,8 @@ import type { PopoverProps, PopoverState } from './Popover.types';
|
|
3
3
|
* Create the state required to render Popover.
|
4
4
|
*
|
5
5
|
* The returned state can be modified with hooks such as usePopoverStyles,
|
6
|
-
* before being passed to
|
6
|
+
* before being passed to renderPopover_unstable.
|
7
7
|
*
|
8
8
|
* @param props - props from this instance of Popover
|
9
9
|
*/
|
10
|
-
export declare const
|
10
|
+
export declare const usePopover_unstable: (props: PopoverProps) => PopoverState;
|
@@ -3,97 +3,85 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.usePopover_unstable = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
11
|
|
12
|
-
|
12
|
+
const react_shared_contexts_1 = /*#__PURE__*/require("@fluentui/react-shared-contexts");
|
13
13
|
|
14
|
-
|
14
|
+
const react_positioning_1 = /*#__PURE__*/require("@fluentui/react-positioning");
|
15
15
|
|
16
|
-
|
16
|
+
const react_portal_1 = /*#__PURE__*/require("@fluentui/react-portal");
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
var index_1 = /*#__PURE__*/require("../PopoverSurface/index");
|
18
|
+
const index_1 = /*#__PURE__*/require("../PopoverSurface/index");
|
21
19
|
/**
|
22
20
|
* Create the state required to render Popover.
|
23
21
|
*
|
24
22
|
* The returned state can be modified with hooks such as usePopoverStyles,
|
25
|
-
* before being passed to
|
23
|
+
* before being passed to renderPopover_unstable.
|
26
24
|
*
|
27
25
|
* @param props - props from this instance of Popover
|
28
26
|
*/
|
29
27
|
|
30
28
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
setContextTarget = _a[1];
|
35
|
-
|
36
|
-
var initialState = tslib_1.__assign({
|
29
|
+
const usePopover_unstable = props => {
|
30
|
+
const [contextTarget, setContextTarget] = react_positioning_1.usePopperMouseTarget();
|
31
|
+
const initialState = {
|
37
32
|
size: 'medium',
|
38
|
-
contextTarget
|
39
|
-
setContextTarget
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
var targetDocument = react_shared_contexts_1.useFluent().targetDocument;
|
33
|
+
contextTarget,
|
34
|
+
setContextTarget,
|
35
|
+
...props
|
36
|
+
};
|
37
|
+
const [open, setOpen] = useOpenState(initialState);
|
38
|
+
const popperRefs = usePopoverRefs(initialState);
|
39
|
+
const {
|
40
|
+
targetDocument
|
41
|
+
} = react_shared_contexts_1.useFluent();
|
48
42
|
react_utilities_1.useOnClickOutside({
|
49
43
|
contains: react_portal_1.elementContains,
|
50
44
|
element: targetDocument,
|
51
|
-
callback:
|
52
|
-
return setOpen(ev, false);
|
53
|
-
},
|
45
|
+
callback: ev => setOpen(ev, false),
|
54
46
|
refs: [popperRefs.triggerRef, popperRefs.contentRef],
|
55
47
|
disabled: !open
|
56
48
|
});
|
57
49
|
react_utilities_1.useOnScrollOutside({
|
58
50
|
contains: react_portal_1.elementContains,
|
59
51
|
element: targetDocument,
|
60
|
-
callback:
|
61
|
-
return setOpen(ev, false);
|
62
|
-
},
|
52
|
+
callback: ev => setOpen(ev, false),
|
63
53
|
refs: [popperRefs.triggerRef, popperRefs.contentRef],
|
64
|
-
disabled: !open || !initialState.openOnContext
|
65
|
-
|
66
|
-
return tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, initialState), popperRefs), {
|
67
|
-
open: open,
|
68
|
-
setOpen: setOpen,
|
69
|
-
setContextTarget: setContextTarget,
|
70
|
-
contextTarget: contextTarget
|
54
|
+
disabled: !open || !initialState.openOnContext // only close on scroll for context
|
55
|
+
|
71
56
|
});
|
57
|
+
return { ...initialState,
|
58
|
+
...popperRefs,
|
59
|
+
open,
|
60
|
+
setOpen,
|
61
|
+
setContextTarget,
|
62
|
+
contextTarget
|
63
|
+
};
|
72
64
|
};
|
73
65
|
|
74
|
-
exports.
|
66
|
+
exports.usePopover_unstable = usePopover_unstable;
|
75
67
|
/**
|
76
68
|
* Creates and manages the Popover open state
|
77
69
|
*/
|
78
70
|
|
79
71
|
function useOpenState(state) {
|
80
|
-
|
72
|
+
const onOpenChange = react_utilities_1.useEventCallback((e, data) => {
|
81
73
|
var _a;
|
82
74
|
|
83
75
|
return (_a = state.onOpenChange) === null || _a === void 0 ? void 0 : _a.call(state, e, data);
|
84
76
|
});
|
85
|
-
|
86
|
-
var _a = react_utilities_1.useControllableState({
|
77
|
+
const [open, setOpenState] = react_utilities_1.useControllableState({
|
87
78
|
state: state.open,
|
88
79
|
defaultState: state.defaultOpen,
|
89
80
|
initialState: false
|
90
|
-
})
|
91
|
-
open = _a[0],
|
92
|
-
setOpenState = _a[1];
|
93
|
-
|
81
|
+
});
|
94
82
|
state.open = open !== undefined ? open : state.open;
|
95
|
-
|
96
|
-
|
83
|
+
const setContextTarget = state.setContextTarget;
|
84
|
+
const setOpen = React.useCallback((e, shouldOpen) => {
|
97
85
|
if (shouldOpen && e.type === 'contextmenu') {
|
98
86
|
setContextTarget(e);
|
99
87
|
}
|
@@ -102,7 +90,7 @@ function useOpenState(state) {
|
|
102
90
|
setContextTarget(undefined);
|
103
91
|
}
|
104
92
|
|
105
|
-
setOpenState(
|
93
|
+
setOpenState(prevOpen => {
|
106
94
|
// More than one event (mouse, focus, keyboard) can request the Popover to close
|
107
95
|
// We assume the first event is the correct one
|
108
96
|
if (prevOpen !== shouldOpen) {
|
@@ -122,12 +110,12 @@ function useOpenState(state) {
|
|
122
110
|
|
123
111
|
|
124
112
|
function usePopoverRefs(state) {
|
125
|
-
|
113
|
+
const popperOptions = {
|
126
114
|
position: 'above',
|
127
115
|
align: 'center',
|
128
|
-
target: state.openOnContext ? state.contextTarget : undefined
|
129
|
-
|
130
|
-
|
116
|
+
target: state.openOnContext ? state.contextTarget : undefined,
|
117
|
+
...react_positioning_1.resolvePositioningShorthand(state.positioning)
|
118
|
+
}; // no reason to render arrow when covering the target
|
131
119
|
|
132
120
|
if (popperOptions.coverTarget) {
|
133
121
|
state.noArrow = true;
|
@@ -137,15 +125,15 @@ function usePopoverRefs(state) {
|
|
137
125
|
popperOptions.offset = react_positioning_1.mergeArrowOffset(popperOptions.offset, index_1.arrowHeights[state.size]);
|
138
126
|
}
|
139
127
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
128
|
+
const {
|
129
|
+
targetRef: triggerRef,
|
130
|
+
containerRef: contentRef,
|
131
|
+
arrowRef
|
132
|
+
} = react_positioning_1.usePopper(popperOptions);
|
145
133
|
return {
|
146
|
-
triggerRef
|
147
|
-
contentRef
|
148
|
-
arrowRef
|
134
|
+
triggerRef,
|
135
|
+
contentRef,
|
136
|
+
arrowRef
|
149
137
|
};
|
150
138
|
}
|
151
139
|
//# sourceMappingURL=usePopover.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/Popover/usePopover.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/Popover/usePopover.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;;AAMA,MAAA,uBAAA,gBAAA,OAAA,CAAA,iCAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,6BAAA,CAAA;;AAMA,MAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,OAAA,gBAAA,OAAA,CAAA,yBAAA,CAAA;AAGA;;;;;;;AAOG;;;AACI,MAAM,mBAAmB,GAAI,KAAD,IAAsC;AAC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KARW,CAAZ;AASD,GAnBa,EAoBd,CAAC,YAAD,EAAe,YAAf,EAA6B,gBAA7B,CApBc,CAAhB;AAuBA,SAAO,CAAC,IAAD,EAAO,OAAP,CAAP;AACD;AAED;;AAEG;;;AACH,SAAS,cAAT,CACE,KADF,EACuH;AAErH,QAAM,aAAa,GAAG;AACpB,IAAA,QAAQ,EAAE,OADU;AAEpB,IAAA,KAAK,EAAE,QAFa;AAGpB,IAAA,MAAM,EAAE,KAAK,CAAC,aAAN,GAAsB,KAAK,CAAC,aAA5B,GAA4C,SAHhC;AAIpB,OAAG,mBAAA,CAAA,2BAAA,CAA4B,KAAK,CAAC,WAAlC;AAJiB,GAAtB,CAFqH,CASrH;;AACA,MAAI,aAAa,CAAC,WAAlB,EAA+B;AAC7B,IAAA,KAAK,CAAC,OAAN,GAAgB,IAAhB;AACD;;AAED,MAAI,CAAC,KAAK,CAAC,OAAX,EAAoB;AAClB,IAAA,aAAa,CAAC,MAAd,GAAuB,mBAAA,CAAA,gBAAA,CAAiB,aAAa,CAAC,MAA/B,EAAuC,OAAA,CAAA,YAAA,CAAa,KAAK,CAAC,IAAnB,CAAvC,CAAvB;AACD;;AAED,QAAM;AAAE,IAAA,SAAS,EAAE,UAAb;AAAyB,IAAA,YAAY,EAAE,UAAvC;AAAmD,IAAA;AAAnD,MAAgE,mBAAA,CAAA,SAAA,CAAU,aAAV,CAAtE;AAEA,SAAO;AACL,IAAA,UADK;AAEL,IAAA,UAFK;AAGL,IAAA;AAHK,GAAP;AAKD","sourceRoot":""}
|
@@ -5,22 +5,22 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.PopoverSurface = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const usePopoverSurface_1 = /*#__PURE__*/require("./usePopoverSurface");
|
11
11
|
|
12
|
-
|
12
|
+
const renderPopoverSurface_1 = /*#__PURE__*/require("./renderPopoverSurface");
|
13
13
|
|
14
|
-
|
14
|
+
const usePopoverSurfaceStyles_1 = /*#__PURE__*/require("./usePopoverSurfaceStyles");
|
15
15
|
/**
|
16
16
|
* PopoverSurface component renders react children in a positioned box
|
17
17
|
*/
|
18
18
|
|
19
19
|
|
20
|
-
exports.PopoverSurface = /*#__PURE__*/React.forwardRef(
|
21
|
-
|
22
|
-
usePopoverSurfaceStyles_1.
|
23
|
-
return renderPopoverSurface_1.
|
20
|
+
exports.PopoverSurface = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
|
+
const state = usePopoverSurface_1.usePopoverSurface_unstable(props, ref);
|
22
|
+
usePopoverSurfaceStyles_1.usePopoverSurfaceStyles_unstable(state);
|
23
|
+
return renderPopoverSurface_1.renderPopoverSurface_unstable(state);
|
24
24
|
});
|
25
25
|
exports.PopoverSurface.displayName = 'PopoverSurface';
|
26
26
|
//# sourceMappingURL=PopoverSurface.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PopoverSurface/PopoverSurface.tsx"],"names":[],"mappings":";;;;;;;AAAA,
|
1
|
+
{"version":3,"sources":["../../../src/components/PopoverSurface/PopoverSurface.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;;AACA,MAAA,sBAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,yBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAIA;;AAEG;;;AACU,OAAA,CAAA,cAAA,gBAA2D,KAAK,CAAC,UAAN,CAAiB,CAAC,KAAD,EAAQ,GAAR,KAAe;AACtG,QAAM,KAAK,GAAG,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,EAAkC,GAAlC,CAAd;AAEA,EAAA,yBAAA,CAAA,gCAAA,CAAiC,KAAjC;AACA,SAAO,sBAAA,CAAA,6BAAA,CAA8B,KAA9B,CAAP;AACD,CALuE,CAA3D;AAOb,OAAA,CAAA,cAAA,CAAe,WAAf,GAA6B,gBAA7B","sourceRoot":""}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
2
2
|
import type { PopoverContextValue } from '../../popoverContext';
|
3
3
|
/**
|
4
4
|
* PopoverSurface Props
|
@@ -8,7 +8,7 @@ export declare type PopoverSurfaceProps = ComponentProps<PopoverSurfaceSlots>;
|
|
8
8
|
* Names of the slots in PopoverSurfaceProps
|
9
9
|
*/
|
10
10
|
export declare type PopoverSurfaceSlots = {
|
11
|
-
root:
|
11
|
+
root: Slot<'div'>;
|
12
12
|
};
|
13
13
|
/**
|
14
14
|
* PopoverSurface State
|
@@ -2,4 +2,4 @@ import type { PopoverSurfaceState } from './PopoverSurface.types';
|
|
2
2
|
/**
|
3
3
|
* Render the final JSX of PopoverSurface
|
4
4
|
*/
|
5
|
-
export declare const
|
5
|
+
export declare const renderPopoverSurface_unstable: (state: PopoverSurfaceState) => JSX.Element | null;
|
@@ -3,27 +3,23 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.renderPopoverSurface_unstable = void 0;
|
7
7
|
|
8
|
-
|
8
|
+
const React = /*#__PURE__*/require("react");
|
9
9
|
|
10
|
-
|
10
|
+
const react_portal_1 = /*#__PURE__*/require("@fluentui/react-portal");
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
var react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
15
|
-
|
16
|
-
var usePopoverSurface_1 = /*#__PURE__*/require("./usePopoverSurface");
|
12
|
+
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
17
13
|
/**
|
18
14
|
* Render the final JSX of PopoverSurface
|
19
15
|
*/
|
20
16
|
|
21
17
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
18
|
+
const renderPopoverSurface_unstable = state => {
|
19
|
+
const {
|
20
|
+
slots,
|
21
|
+
slotProps
|
22
|
+
} = react_utilities_1.getSlots(state); // TODO should hidden Popovers be supported ?
|
27
23
|
|
28
24
|
if (!state.open) {
|
29
25
|
return null;
|
@@ -31,11 +27,12 @@ var renderPopoverSurface = function (state) {
|
|
31
27
|
|
32
28
|
return React.createElement(react_portal_1.Portal, {
|
33
29
|
mountNode: state.mountNode
|
34
|
-
}, React.createElement(slots.root,
|
30
|
+
}, React.createElement(slots.root, { ...slotProps.root
|
31
|
+
}, !state.noArrow && React.createElement("div", {
|
35
32
|
ref: state.arrowRef,
|
36
33
|
className: state.arrowClassName
|
37
34
|
}), slotProps.root.children));
|
38
35
|
};
|
39
36
|
|
40
|
-
exports.
|
37
|
+
exports.renderPopoverSurface_unstable = renderPopoverSurface_unstable;
|
41
38
|
//# sourceMappingURL=renderPopoverSurface.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/components/PopoverSurface/renderPopoverSurface.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"sources":["../../../src/components/PopoverSurface/renderPopoverSurface.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,cAAA,gBAAA,OAAA,CAAA,wBAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,6BAA6B,GAAI,KAAD,IAA+B;AAC1E,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAA8B,KAA9B,CAA7B,CAD0E,CAG1E;;AACA,MAAI,CAAC,KAAK,CAAC,IAAX,EAAiB;AACf,WAAO,IAAP;AACD;;AAED,SACE,KAAA,CAAA,aAAA,CAAC,cAAA,CAAA,MAAD,EAAO;AAAC,IAAA,SAAS,EAAE,KAAK,CAAC;AAAlB,GAAP,EACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,CAAC,KAAK,CAAC,OAAP,IAAkB,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAK,IAAA,GAAG,EAAE,KAAK,CAAC,QAAhB;AAA0B,IAAA,SAAS,EAAE,KAAK,CAAC;AAA3C,GAAA,CADrB,EAEG,SAAS,CAAC,IAAV,CAAe,QAFlB,CADF,CADF;AAQD,CAhBM;;AAAM,OAAA,CAAA,6BAAA,GAA6B,6BAA7B","sourceRoot":""}
|
@@ -1,13 +1,12 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import type { PopoverSurfaceProps,
|
3
|
-
export declare const popoverSurfaceSlots: Array<keyof PopoverSurfaceSlots>;
|
2
|
+
import type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';
|
4
3
|
/**
|
5
4
|
* Create the state required to render PopoverSurface.
|
6
5
|
*
|
7
|
-
* The returned state can be modified with hooks such as
|
8
|
-
* before being passed to
|
6
|
+
* The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,
|
7
|
+
* before being passed to renderPopoverSurface_unstable.
|
9
8
|
*
|
10
9
|
* @param props - props from this instance of PopoverSurface
|
11
10
|
* @param ref - reference to root HTMLDivElement of PopoverSurface
|
12
11
|
*/
|
13
|
-
export declare const
|
12
|
+
export declare const usePopoverSurface_unstable: (props: PopoverSurfaceProps, ref: React.Ref<HTMLDivElement>) => PopoverSurfaceState;
|