@fluentui/react-popover 9.5.8 → 9.5.10
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +91 -7
- package/CHANGELOG.md +35 -8
- package/lib/components/Popover/usePopover.js +3 -1
- package/lib/components/Popover/usePopover.js.map +1 -1
- package/lib/components/PopoverSurface/renderPopoverSurface.js +5 -5
- package/lib/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/lib-commonjs/components/Popover/usePopover.js +3 -1
- package/lib-commonjs/components/Popover/usePopover.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js +6 -7
- package/lib-commonjs/components/PopoverSurface/renderPopoverSurface.js.map +1 -1
- package/package.json +8 -7
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,91 @@
|
|
2
2
|
"name": "@fluentui/react-popover",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Mon, 24 Apr 2023 08:09:14 GMT",
|
6
|
+
"tag": "@fluentui/react-popover_v9.5.10",
|
7
|
+
"version": "9.5.10",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "bernardo.sunderhus@gmail.com",
|
12
|
+
"package": "@fluentui/react-popover",
|
13
|
+
"commit": "92f70e62b4c8256f81aae5d521477af851656f5d",
|
14
|
+
"comment": "bugfix: ensure legacyTrapFocus works properly"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "bernardo.sunderhus@gmail.com",
|
18
|
+
"package": "@fluentui/react-popover",
|
19
|
+
"commit": "85c36e249b33b0bad79be4edd1a943dfc5233b11",
|
20
|
+
"comment": "bugfix: remove caret from react-jsx-runtime prerelease dependency"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-popover",
|
25
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2",
|
26
|
+
"commit": "948b5bf9871303d1742f1b9a17a3bd4006ce2fea"
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"date": "Mon, 17 Apr 2023 17:53:52 GMT",
|
33
|
+
"tag": "@fluentui/react-popover_v9.5.9",
|
34
|
+
"version": "9.5.9",
|
35
|
+
"comments": {
|
36
|
+
"patch": [
|
37
|
+
{
|
38
|
+
"author": "bernardo.sunderhus@gmail.com",
|
39
|
+
"package": "@fluentui/react-popover",
|
40
|
+
"commit": "b415aefbc882a0e84a076df45c04f1efda26c34b",
|
41
|
+
"comment": "feat: adopt custom JSX pragma"
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"author": "beachball",
|
45
|
+
"package": "@fluentui/react-popover",
|
46
|
+
"comment": "Bump @fluentui/react-aria to v9.3.18",
|
47
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
48
|
+
},
|
49
|
+
{
|
50
|
+
"author": "beachball",
|
51
|
+
"package": "@fluentui/react-popover",
|
52
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.18",
|
53
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"author": "beachball",
|
57
|
+
"package": "@fluentui/react-popover",
|
58
|
+
"comment": "Bump @fluentui/react-portal to v9.2.6",
|
59
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"author": "beachball",
|
63
|
+
"package": "@fluentui/react-popover",
|
64
|
+
"comment": "Bump @fluentui/react-positioning to v9.5.10",
|
65
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"author": "beachball",
|
69
|
+
"package": "@fluentui/react-popover",
|
70
|
+
"comment": "Bump @fluentui/react-tabster to v9.6.5",
|
71
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"author": "beachball",
|
75
|
+
"package": "@fluentui/react-popover",
|
76
|
+
"comment": "Bump @fluentui/react-utilities to v9.8.0",
|
77
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"author": "beachball",
|
81
|
+
"package": "@fluentui/react-popover",
|
82
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.1",
|
83
|
+
"commit": "35d247e0b6a8c2b22e69942afbabe18043e59585"
|
84
|
+
}
|
85
|
+
]
|
86
|
+
}
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"date": "Wed, 12 Apr 2023 09:31:45 GMT",
|
6
90
|
"tag": "@fluentui/react-popover_v9.5.8",
|
7
91
|
"version": "9.5.8",
|
8
92
|
"comments": {
|
@@ -11,37 +95,37 @@
|
|
11
95
|
"author": "beachball",
|
12
96
|
"package": "@fluentui/react-popover",
|
13
97
|
"comment": "Bump @fluentui/react-aria to v9.3.17",
|
14
|
-
"commit": "
|
98
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
15
99
|
},
|
16
100
|
{
|
17
101
|
"author": "beachball",
|
18
102
|
"package": "@fluentui/react-popover",
|
19
103
|
"comment": "Bump @fluentui/react-context-selector to v9.1.17",
|
20
|
-
"commit": "
|
104
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
21
105
|
},
|
22
106
|
{
|
23
107
|
"author": "beachball",
|
24
108
|
"package": "@fluentui/react-popover",
|
25
109
|
"comment": "Bump @fluentui/react-portal to v9.2.5",
|
26
|
-
"commit": "
|
110
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
27
111
|
},
|
28
112
|
{
|
29
113
|
"author": "beachball",
|
30
114
|
"package": "@fluentui/react-popover",
|
31
115
|
"comment": "Bump @fluentui/react-positioning to v9.5.9",
|
32
|
-
"commit": "
|
116
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
33
117
|
},
|
34
118
|
{
|
35
119
|
"author": "beachball",
|
36
120
|
"package": "@fluentui/react-popover",
|
37
121
|
"comment": "Bump @fluentui/react-tabster to v9.6.4",
|
38
|
-
"commit": "
|
122
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
39
123
|
},
|
40
124
|
{
|
41
125
|
"author": "beachball",
|
42
126
|
"package": "@fluentui/react-popover",
|
43
127
|
"comment": "Bump @fluentui/react-utilities to v9.7.4",
|
44
|
-
"commit": "
|
128
|
+
"commit": "45cb6089b0f5f464ae0dd9e9cba7e199a9d67cd8"
|
45
129
|
}
|
46
130
|
]
|
47
131
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,22 +1,49 @@
|
|
1
1
|
# Change Log - @fluentui/react-popover
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Mon, 24 Apr 2023 08:09:14 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.5.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.5.10)
|
8
|
+
|
9
|
+
Mon, 24 Apr 2023 08:09:14 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.5.9..@fluentui/react-popover_v9.5.10)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- bugfix: ensure legacyTrapFocus works properly ([PR #27574](https://github.com/microsoft/fluentui/pull/27574) by bernardo.sunderhus@gmail.com)
|
15
|
+
- bugfix: remove caret from react-jsx-runtime prerelease dependency ([PR #27588](https://github.com/microsoft/fluentui/pull/27588) by bernardo.sunderhus@gmail.com)
|
16
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2 ([PR #27632](https://github.com/microsoft/fluentui/pull/27632) by beachball)
|
17
|
+
|
18
|
+
## [9.5.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.5.9)
|
19
|
+
|
20
|
+
Mon, 17 Apr 2023 17:53:52 GMT
|
21
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.5.8..@fluentui/react-popover_v9.5.9)
|
22
|
+
|
23
|
+
### Patches
|
24
|
+
|
25
|
+
- feat: adopt custom JSX pragma ([PR #27546](https://github.com/microsoft/fluentui/pull/27546) by bernardo.sunderhus@gmail.com)
|
26
|
+
- Bump @fluentui/react-aria to v9.3.18 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
27
|
+
- Bump @fluentui/react-context-selector to v9.1.18 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
28
|
+
- Bump @fluentui/react-portal to v9.2.6 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
29
|
+
- Bump @fluentui/react-positioning to v9.5.10 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
30
|
+
- Bump @fluentui/react-tabster to v9.6.5 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
31
|
+
- Bump @fluentui/react-utilities to v9.8.0 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
32
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.1 ([PR #27564](https://github.com/microsoft/fluentui/pull/27564) by beachball)
|
33
|
+
|
7
34
|
## [9.5.8](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.5.8)
|
8
35
|
|
9
|
-
Wed, 12 Apr 2023 09:
|
36
|
+
Wed, 12 Apr 2023 09:31:45 GMT
|
10
37
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.5.7..@fluentui/react-popover_v9.5.8)
|
11
38
|
|
12
39
|
### Patches
|
13
40
|
|
14
|
-
- Bump @fluentui/react-aria to v9.3.17 ([
|
15
|
-
- Bump @fluentui/react-context-selector to v9.1.17 ([
|
16
|
-
- Bump @fluentui/react-portal to v9.2.5 ([
|
17
|
-
- Bump @fluentui/react-positioning to v9.5.9 ([
|
18
|
-
- Bump @fluentui/react-tabster to v9.6.4 ([
|
19
|
-
- Bump @fluentui/react-utilities to v9.7.4 ([
|
41
|
+
- Bump @fluentui/react-aria to v9.3.17 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
42
|
+
- Bump @fluentui/react-context-selector to v9.1.17 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
43
|
+
- Bump @fluentui/react-portal to v9.2.5 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
44
|
+
- Bump @fluentui/react-positioning to v9.5.9 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
45
|
+
- Bump @fluentui/react-tabster to v9.6.4 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
46
|
+
- Bump @fluentui/react-utilities to v9.7.4 ([PR #27274](https://github.com/microsoft/fluentui/pull/27274) by beachball)
|
20
47
|
|
21
48
|
## [9.5.7](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.5.7)
|
22
49
|
|
@@ -105,10 +105,12 @@ export const usePopover_unstable = props => {
|
|
105
105
|
firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();
|
106
106
|
}
|
107
107
|
}, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);
|
108
|
-
var _props_inline;
|
108
|
+
var _props_inertTrapFocus, _props_inline;
|
109
109
|
return {
|
110
110
|
...initialState,
|
111
111
|
...positioningRefs,
|
112
|
+
// eslint-disable-next-line deprecation/deprecation
|
113
|
+
inertTrapFocus: (_props_inertTrapFocus = props.inertTrapFocus) !== null && _props_inertTrapFocus !== void 0 ? _props_inertTrapFocus : props.legacyTrapFocus === undefined ? false : !props.legacyTrapFocus,
|
112
114
|
popoverTrigger,
|
113
115
|
popoverSurface,
|
114
116
|
open,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["React","useControllableState","useEventCallback","useOnClickOutside","useOnScrollOutside","useFluent_unstable","useFluent","usePositioning","resolvePositioningShorthand","mergeArrowOffset","usePositioningMouseTarget","elementContains","useFocusFinders","arrowHeights","popoverSurfaceBorderRadius","usePopover_unstable","props","contextTarget","setContextTarget","initialState","size","children","Children","toArray","process","env","NODE_ENV","length","console","warn","popoverTrigger","undefined","popoverSurface","open","setOpenState","useOpenState","setOpenTimeoutRef","useRef","setOpen","e","shouldOpen","clearTimeout","current","Event","persist","type","_props_mouseLeaveDelay","setTimeout","mouseLeaveDelay","useEffect","toggleOpen","useCallback","positioningRefs","usePopoverRefs","targetDocument","contains","element","callback","ev","refs","triggerRef","contentRef","disabled","closeOnScroll","openOnContext","findFirstFocusable","unstable_disableAutoFocus","_positioningRefs_contentRef_current_getAttribute","containerTabIndex","getAttribute","firstFocusable","isNaN","focus","_props_inline","inline","state","onOpenChange","data","_state_onOpenChange","call","defaultState","defaultOpen","positioningOptions","position","align","arrowPadding","target","positioning","coverTarget","withArrow","offset","targetRef","containerRef","arrowRef"],"sources":["../../../src/components/Popover/usePopover.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n useControllableState,\n useEventCallback,\n useOnClickOutside,\n useOnScrollOutside,\n} from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n usePositioning,\n resolvePositioningShorthand,\n mergeArrowOffset,\n usePositioningMouseTarget,\n} from '@fluentui/react-positioning';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport type { OpenPopoverEvents, PopoverProps, PopoverState } from './Popover.types';\nimport { popoverSurfaceBorderRadius } from './constants';\n\n/**\n * Create the state required to render Popover.\n *\n * The returned state can be modified with hooks such as usePopoverStyles,\n * before being passed to renderPopover_unstable.\n *\n * @param props - props from this instance of Popover\n */\nexport const usePopover_unstable = (props: PopoverProps): PopoverState => {\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n const initialState = {\n size: 'medium',\n contextTarget,\n setContextTarget,\n ...props,\n } as const;\n\n const children = React.Children.toArray(props.children) as React.ReactElement[];\n\n if (process.env.NODE_ENV !== 'production') {\n if (children.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Popover must contain at least one child');\n }\n\n if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Popover must contain at most two children');\n }\n }\n\n let popoverTrigger: React.ReactElement | undefined = undefined;\n let popoverSurface: React.ReactElement | undefined = undefined;\n if (children.length === 2) {\n popoverTrigger = children[0];\n popoverSurface = children[1];\n } else if (children.length === 1) {\n popoverSurface = children[0];\n }\n\n const [open, setOpenState] = useOpenState(initialState);\n\n const setOpenTimeoutRef = React.useRef(0);\n\n const setOpen = useEventCallback((e: OpenPopoverEvents, shouldOpen: boolean) => {\n clearTimeout(setOpenTimeoutRef.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n\n if (e.type === 'mouseleave') {\n // FIXME leaking Node timeout type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n setOpenTimeoutRef.current = setTimeout(() => {\n setOpenState(e, shouldOpen);\n }, props.mouseLeaveDelay ?? 500);\n } else {\n setOpenState(e, shouldOpen);\n }\n });\n\n // Clear timeout on unmount\n // Setting state after a component unmounts can cause memory leaks\n React.useEffect(() => {\n return () => {\n clearTimeout(setOpenTimeoutRef.current);\n };\n }, []);\n\n const toggleOpen = React.useCallback<PopoverState['toggleOpen']>(\n e => {\n setOpen(e, !open);\n },\n [setOpen, open],\n );\n\n const positioningRefs = usePopoverRefs(initialState);\n\n const { targetDocument } = useFluent();\n useOnClickOutside({\n contains: elementContains,\n element: targetDocument,\n callback: ev => setOpen(ev, false),\n refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n disabled: !open,\n });\n\n // only close on scroll for context, or when closeOnScroll is specified\n const closeOnScroll = initialState.openOnContext || initialState.closeOnScroll;\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: ev => setOpen(ev, false),\n refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n disabled: !open || !closeOnScroll,\n });\n\n const { findFirstFocusable } = useFocusFinders();\n\n React.useEffect(() => {\n if (props.unstable_disableAutoFocus) {\n return;\n }\n\n if (open && positioningRefs.contentRef.current) {\n const containerTabIndex = positioningRefs.contentRef.current.getAttribute('tabIndex') ?? undefined;\n const firstFocusable = isNaN(containerTabIndex)\n ? findFirstFocusable(positioningRefs.contentRef.current)\n : positioningRefs.contentRef.current;\n firstFocusable?.focus();\n }\n }, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);\n\n return {\n ...initialState,\n ...positioningRefs,\n popoverTrigger,\n popoverSurface,\n open,\n setOpen,\n toggleOpen,\n setContextTarget,\n contextTarget,\n inline: props.inline ?? false,\n };\n};\n\n/**\n * Creates and manages the Popover open state\n */\nfunction useOpenState(\n state: Pick<PopoverState, 'setContextTarget' | 'onOpenChange'> & Pick<PopoverProps, 'open' | 'defaultOpen'>,\n) {\n const onOpenChange: PopoverState['onOpenChange'] = useEventCallback((e, data) => state.onOpenChange?.(e, data));\n\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false,\n });\n state.open = open !== undefined ? open : state.open;\n const setContextTarget = state.setContextTarget;\n\n const setOpen = React.useCallback(\n (e: OpenPopoverEvents, shouldOpen: boolean) => {\n if (shouldOpen && e.type === 'contextmenu') {\n setContextTarget(e as React.MouseEvent);\n }\n\n if (!shouldOpen) {\n setContextTarget(undefined);\n }\n\n setOpenState(shouldOpen);\n onOpenChange?.(e, { open: shouldOpen });\n },\n [setOpenState, onOpenChange, setContextTarget],\n );\n\n return [open, setOpen] as const;\n}\n\n/**\n * Creates and sets the necessary trigger, target and content refs used by Popover\n */\nfunction usePopoverRefs(\n state: Pick<PopoverState, 'size' | 'contextTarget'> &\n Pick<PopoverProps, 'positioning' | 'openOnContext' | 'withArrow'>,\n) {\n const positioningOptions = {\n position: 'above' as const,\n align: 'center' as const,\n arrowPadding: 2 * popoverSurfaceBorderRadius,\n target: state.openOnContext ? state.contextTarget : undefined,\n ...resolvePositioningShorthand(state.positioning),\n };\n\n // no reason to render arrow when covering the target\n if (positioningOptions.coverTarget) {\n state.withArrow = false;\n }\n\n if (state.withArrow) {\n positioningOptions.offset = mergeArrowOffset(positioningOptions.offset, arrowHeights[state.size]);\n }\n\n const { targetRef: triggerRef, containerRef: contentRef, arrowRef } = usePositioning(positioningOptions);\n\n return {\n triggerRef,\n contentRef,\n arrowRef,\n } as const;\n}\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SACEC,oBAAoB,EACpBC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,QACb;AACP,SAASC,kBAAA,IAAsBC,SAAS,QAAQ;AAChD,SACEC,cAAc,EACdC,2BAA2B,EAC3BC,gBAAgB,EAChBC,yBAAyB,QACpB;AACP,SAASC,eAAe,QAAQ;AAChC,SAASC,eAAe,QAAQ;AAChC,SAASC,YAAY,QAAQ;AAE7B,SAASC,0BAA0B,QAAQ;AAE3C;;;;;;;;AAQA,OAAO,MAAMC,mBAAA,GAAuBC,KAAA,IAAsC;EACxE,MAAM,CAACC,aAAA,EAAeC,gBAAA,CAAiB,GAAGR,yBAAA;EAC1C,MAAMS,YAAA,GAAe;IACnBC,IAAA,EAAM;IACNH,aAAA;IACAC,gBAAA;IACA,GAAGF;EACL;EAEA,MAAMK,QAAA,GAAWrB,KAAA,CAAMsB,QAAQ,CAACC,OAAO,CAACP,KAAA,CAAMK,QAAQ;EAEtD,IAAIG,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzC,IAAIL,QAAA,CAASM,MAAM,KAAK,GAAG;MACzB;MACAC,OAAA,CAAQC,IAAI,CAAC;IACf;IAEA,IAAIR,QAAA,CAASM,MAAM,GAAG,GAAG;MACvB;MACAC,OAAA,CAAQC,IAAI,CAAC;IACf;EACF;EAEA,IAAIC,cAAA,GAAiDC,SAAA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I,CAACC,UAAA,EAAY;MACftB,gBAAA,CAAiBa,SAAA;IACnB;IAEAG,YAAA,CAAaM,UAAA;IACboC,YAAA,aAAAA,YAAA,uBAAAA,YAAA,CAAerC,CAAA,EAAG;MAAEN,IAAA,EAAMO;IAAW;EACvC,GACA,CAACN,YAAA,EAAc0C,YAAA,EAAc1D,gBAAA,CAAiB;EAGhD,OAAO,CAACe,IAAA,EAAMK,OAAA,CAAQ;AACxB;AAEA;;;AAGA,SAASe,eACPsB,KACmE,EACnE;EACA,MAAMO,kBAAA,GAAqB;IACzBC,QAAA,EAAU;IACVC,KAAA,EAAO;IACPC,YAAA,EAAc,IAAIvE,0BAAA;IAClBwE,MAAA,EAAQX,KAAA,CAAMX,aAAa,GAAGW,KAAA,CAAM1D,aAAa,GAAGc,SAAS;IAC7D,GAAGvB,2BAAA,CAA4BmE,KAAA,CAAMY,WAAW;EAClD;EAEA;EACA,IAAIL,kBAAA,CAAmBM,WAAW,EAAE;IAClCb,KAAA,CAAMc,SAAS,GAAG,KAAK;EACzB;EAEA,IAAId,KAAA,CAAMc,SAAS,EAAE;IACnBP,kBAAA,CAAmBQ,MAAM,GAAGjF,gBAAA,CAAiByE,kBAAA,CAAmBQ,MAAM,EAAE7E,YAAY,CAAC8D,KAAA,CAAMvD,IAAI,CAAC;EAClG;EAEA,MAAM;IAAEuE,SAAA,EAAW/B,UAAA;IAAYgC,YAAA,EAAc/B,UAAA;IAAYgC;EAAQ,CAAE,GAAGtF,cAAA,CAAe2E,kBAAA;EAErF,OAAO;IACLtB,UAAA;IACAC,UAAA;IACAgC;EACF;AACF"}
|
1
|
+
{"version":3,"names":["React","useControllableState","useEventCallback","useOnClickOutside","useOnScrollOutside","useFluent_unstable","useFluent","usePositioning","resolvePositioningShorthand","mergeArrowOffset","usePositioningMouseTarget","elementContains","useFocusFinders","arrowHeights","popoverSurfaceBorderRadius","usePopover_unstable","props","contextTarget","setContextTarget","initialState","size","children","Children","toArray","process","env","NODE_ENV","length","console","warn","popoverTrigger","undefined","popoverSurface","open","setOpenState","useOpenState","setOpenTimeoutRef","useRef","setOpen","e","shouldOpen","clearTimeout","current","Event","persist","type","_props_mouseLeaveDelay","setTimeout","mouseLeaveDelay","useEffect","toggleOpen","useCallback","positioningRefs","usePopoverRefs","targetDocument","contains","element","callback","ev","refs","triggerRef","contentRef","disabled","closeOnScroll","openOnContext","findFirstFocusable","unstable_disableAutoFocus","_positioningRefs_contentRef_current_getAttribute","containerTabIndex","getAttribute","firstFocusable","isNaN","focus","_props_inertTrapFocus","_props_inline","inertTrapFocus","legacyTrapFocus","inline","state","onOpenChange","data","_state_onOpenChange","call","defaultState","defaultOpen","positioningOptions","position","align","arrowPadding","target","positioning","coverTarget","withArrow","offset","targetRef","containerRef","arrowRef"],"sources":["../../../src/components/Popover/usePopover.ts"],"sourcesContent":["import * as React from 'react';\nimport {\n useControllableState,\n useEventCallback,\n useOnClickOutside,\n useOnScrollOutside,\n} from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport {\n usePositioning,\n resolvePositioningShorthand,\n mergeArrowOffset,\n usePositioningMouseTarget,\n} from '@fluentui/react-positioning';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport type { OpenPopoverEvents, PopoverProps, PopoverState } from './Popover.types';\nimport { popoverSurfaceBorderRadius } from './constants';\n\n/**\n * Create the state required to render Popover.\n *\n * The returned state can be modified with hooks such as usePopoverStyles,\n * before being passed to renderPopover_unstable.\n *\n * @param props - props from this instance of Popover\n */\nexport const usePopover_unstable = (props: PopoverProps): PopoverState => {\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n const initialState = {\n size: 'medium',\n contextTarget,\n setContextTarget,\n ...props,\n } as const;\n\n const children = React.Children.toArray(props.children) as React.ReactElement[];\n\n if (process.env.NODE_ENV !== 'production') {\n if (children.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Popover must contain at least one child');\n }\n\n if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Popover must contain at most two children');\n }\n }\n\n let popoverTrigger: React.ReactElement | undefined = undefined;\n let popoverSurface: React.ReactElement | undefined = undefined;\n if (children.length === 2) {\n popoverTrigger = children[0];\n popoverSurface = children[1];\n } else if (children.length === 1) {\n popoverSurface = children[0];\n }\n\n const [open, setOpenState] = useOpenState(initialState);\n\n const setOpenTimeoutRef = React.useRef(0);\n\n const setOpen = useEventCallback((e: OpenPopoverEvents, shouldOpen: boolean) => {\n clearTimeout(setOpenTimeoutRef.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n\n if (e.type === 'mouseleave') {\n // FIXME leaking Node timeout type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n setOpenTimeoutRef.current = setTimeout(() => {\n setOpenState(e, shouldOpen);\n }, props.mouseLeaveDelay ?? 500);\n } else {\n setOpenState(e, shouldOpen);\n }\n });\n\n // Clear timeout on unmount\n // Setting state after a component unmounts can cause memory leaks\n React.useEffect(() => {\n return () => {\n clearTimeout(setOpenTimeoutRef.current);\n };\n }, []);\n\n const toggleOpen = React.useCallback<PopoverState['toggleOpen']>(\n e => {\n setOpen(e, !open);\n },\n [setOpen, open],\n );\n\n const positioningRefs = usePopoverRefs(initialState);\n\n const { targetDocument } = useFluent();\n useOnClickOutside({\n contains: elementContains,\n element: targetDocument,\n callback: ev => setOpen(ev, false),\n refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n disabled: !open,\n });\n\n // only close on scroll for context, or when closeOnScroll is specified\n const closeOnScroll = initialState.openOnContext || initialState.closeOnScroll;\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: ev => setOpen(ev, false),\n refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n disabled: !open || !closeOnScroll,\n });\n\n const { findFirstFocusable } = useFocusFinders();\n\n React.useEffect(() => {\n if (props.unstable_disableAutoFocus) {\n return;\n }\n\n if (open && positioningRefs.contentRef.current) {\n const containerTabIndex = positioningRefs.contentRef.current.getAttribute('tabIndex') ?? undefined;\n const firstFocusable = isNaN(containerTabIndex)\n ? findFirstFocusable(positioningRefs.contentRef.current)\n : positioningRefs.contentRef.current;\n firstFocusable?.focus();\n }\n }, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);\n\n return {\n ...initialState,\n ...positioningRefs,\n // eslint-disable-next-line deprecation/deprecation\n inertTrapFocus: props.inertTrapFocus ?? (props.legacyTrapFocus === undefined ? false : !props.legacyTrapFocus),\n popoverTrigger,\n popoverSurface,\n open,\n setOpen,\n toggleOpen,\n setContextTarget,\n contextTarget,\n inline: props.inline ?? false,\n };\n};\n\n/**\n * Creates and manages the Popover open state\n */\nfunction useOpenState(\n state: Pick<PopoverState, 'setContextTarget' | 'onOpenChange'> & Pick<PopoverProps, 'open' | 'defaultOpen'>,\n) {\n const onOpenChange: PopoverState['onOpenChange'] = useEventCallback((e, data) => state.onOpenChange?.(e, data));\n\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false,\n });\n state.open = open !== undefined ? open : state.open;\n const setContextTarget = state.setContextTarget;\n\n const setOpen = React.useCallback(\n (e: OpenPopoverEvents, shouldOpen: boolean) => {\n if (shouldOpen && e.type === 'contextmenu') {\n setContextTarget(e as React.MouseEvent);\n }\n\n if (!shouldOpen) {\n setContextTarget(undefined);\n }\n\n setOpenState(shouldOpen);\n onOpenChange?.(e, { open: shouldOpen });\n },\n [setOpenState, onOpenChange, setContextTarget],\n );\n\n return [open, setOpen] as const;\n}\n\n/**\n * Creates and sets the necessary trigger, target and content refs used by Popover\n */\nfunction usePopoverRefs(\n state: Pick<PopoverState, 'size' | 'contextTarget'> &\n Pick<PopoverProps, 'positioning' | 'openOnContext' | 'withArrow'>,\n) {\n const positioningOptions = {\n position: 'above' as const,\n align: 'center' as const,\n arrowPadding: 2 * popoverSurfaceBorderRadius,\n target: state.openOnContext ? state.contextTarget : undefined,\n ...resolvePositioningShorthand(state.positioning),\n };\n\n // no reason to render arrow when covering the target\n if (positioningOptions.coverTarget) {\n state.withArrow = false;\n }\n\n if (state.withArrow) {\n positioningOptions.offset = mergeArrowOffset(positioningOptions.offset, arrowHeights[state.size]);\n }\n\n const { targetRef: triggerRef, containerRef: contentRef, arrowRef } = usePositioning(positioningOptions);\n\n return {\n triggerRef,\n contentRef,\n arrowRef,\n } as const;\n}\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SACEC,oBAAoB,EACpBC,gBAAgB,EAChBC,iBAAiB,EACjBC,kBAAkB,QACb;AACP,SAASC,kBAAA,IAAsBC,SAAS,QAAQ;AAChD,SACEC,cAAc,EACdC,2BAA2B,EAC3BC,gBAAgB,EAChBC,yBAAyB,QACpB;AACP,SAASC,eAAe,QAAQ;AAChC,SAASC,eAAe,QAAQ;AAChC,SAASC,YAAY,QAAQ;AAE7B,SAASC,0BAA0B,QAAQ;AAE3C;;;;;;;;AAQA,OAAO,MAAMC,mBAAA,GAAuBC,KAAA,IAAsC;EACxE,MAAM,CAACC,aAAA,EAAeC,gBAAA,CAAiB,GAAGR,yBAAA;EAC1C,MAAMS,YAAA,GAAe;IACnBC,IAAA,EAAM;IACNH,aAAA;IACAC,gBAAA;IACA,GAAGF;EACL;EAEA,MAAMK,QAAA,GAAWrB,KAAA,CAAMsB,QAAQ,CAACC,OAAO,CAACP,KAAA,CAAMK,QAAQ;EAEtD,IAAIG,OAAA,CAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;IACzC,IAAIL,QAAA,CAASM,MAAM,KAAK,GAAG;MACzB;MACAC,OAAA,CAAQC,IAAI,CAAC;IACf;IAEA,IAAIR,QAAA,CAASM,MAAM,GAAG,GAAG;MACvB;MACAC,OAAA,CAAQC,IAAI,CAAC;IACf;EACF;EAEA,IAAIC,cAAA,GAAiDC,SAAA;EACrD,IAAIC,cAAA,GAAiDD,S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@jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';
|
2
|
+
import { getSlotsNext } from '@fluentui/react-utilities';
|
2
3
|
import { Portal } from '@fluentui/react-portal';
|
3
|
-
import { getSlots } from '@fluentui/react-utilities';
|
4
4
|
/**
|
5
5
|
* Render the final JSX of PopoverSurface
|
6
6
|
*/
|
@@ -8,15 +8,15 @@ export const renderPopoverSurface_unstable = state => {
|
|
8
8
|
const {
|
9
9
|
slots,
|
10
10
|
slotProps
|
11
|
-
} =
|
12
|
-
const surface = /*#__PURE__*/
|
11
|
+
} = getSlotsNext(state);
|
12
|
+
const surface = /*#__PURE__*/createElement(slots.root, slotProps.root, state.withArrow && /*#__PURE__*/createElement("div", {
|
13
13
|
ref: state.arrowRef,
|
14
14
|
className: state.arrowClassName
|
15
15
|
}), slotProps.root.children);
|
16
16
|
if (state.inline) {
|
17
17
|
return surface;
|
18
18
|
}
|
19
|
-
return /*#__PURE__*/
|
19
|
+
return /*#__PURE__*/createElement(Portal, {
|
20
20
|
mountNode: state.mountNode
|
21
21
|
}, surface);
|
22
22
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["createElement","getSlotsNext","Portal","renderPopoverSurface_unstable","state","slots","slotProps","surface","root","withArrow","ref","arrowRef","className","arrowClassName","children","inline","mountNode"],"sources":["../../../src/components/PopoverSurface/renderPopoverSurface.tsx"],"sourcesContent":["/** @jsxRuntime classic */\n/** @jsx createElement */\n\nimport { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\nimport type { PopoverSurfaceSlots, PopoverSurfaceState } from './PopoverSurface.types';\n\n/**\n * Render the final JSX of PopoverSurface\n */\nexport const renderPopoverSurface_unstable = (state: PopoverSurfaceState) => {\n const { slots, slotProps } = getSlotsNext<PopoverSurfaceSlots>(state);\n\n const surface = (\n <slots.root {...slotProps.root}>\n {state.withArrow && <div ref={state.arrowRef} className={state.arrowClassName} />}\n {slotProps.root.children}\n </slots.root>\n );\n\n if (state.inline) {\n return surface;\n }\n\n return <Portal mountNode={state.mountNode}>{surface}</Portal>;\n};\n"],"mappings":"AAAA,2BACA,yBAEA,SAASA,aAAa,QAAQ;AAC9B,SAASC,YAAY,QAAQ;AAC7B,SAASC,MAAM,QAAQ;AAGvB;;;AAGA,OAAO,MAAMC,6BAAA,GAAiCC,KAAA,IAA+B;EAC3E,MAAM;IAAEC,KAAA;IAAOC;EAAS,CAAE,GAAGL,YAAA,CAAkCG,KAAA;EAE/D,MAAMG,OAAA,gBACJP,aAdJ,CAcKK,KAAA,CAAMG,IAAI,EAAKF,SAAA,CAAUE,IAAI,EAC3BJ,KAAA,CAAMK,SAAS,iBAAIT,aAf1B,CAe2B;IAAIU,GAAA,EAAKN,KAAA,CAAMO,QAAQ;IAAEC,SAAA,EAAWR,KAAA,CAAMS;MAC9DP,SAAA,CAAUE,IAAI,CAACM,QAAQ;EAI5B,IAAIV,KAAA,CAAMW,MAAM,EAAE;IAChB,OAAOR,OAAA;EACT;EAEA,oBAAOP,aAxBT,CAwBUE,MAAA;IAAOc,SAAA,EAAWZ,KAAA,CAAMY;KAAYT,OAAA;AAC9C"}
|
@@ -116,10 +116,12 @@ const usePopover_unstable = (props)=>{
|
|
116
116
|
positioningRefs.contentRef,
|
117
117
|
props.unstable_disableAutoFocus
|
118
118
|
]);
|
119
|
-
var _props_inline;
|
119
|
+
var _props_inertTrapFocus, _props_inline;
|
120
120
|
return {
|
121
121
|
...initialState,
|
122
122
|
...positioningRefs,
|
123
|
+
// eslint-disable-next-line deprecation/deprecation
|
124
|
+
inertTrapFocus: (_props_inertTrapFocus = props.inertTrapFocus) !== null && _props_inertTrapFocus !== void 0 ? _props_inertTrapFocus : props.legacyTrapFocus === undefined ? false : !props.legacyTrapFocus,
|
123
125
|
popoverTrigger,
|
124
126
|
popoverSurface,
|
125
127
|
open,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Popover/usePopover.js"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState, useEventCallback, useOnClickOutside, useOnScrollOutside } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { usePositioning, resolvePositioningShorthand, mergeArrowOffset, usePositioningMouseTarget } from '@fluentui/react-positioning';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport { popoverSurfaceBorderRadius } from './constants';\n/**\n * Create the state required to render Popover.\n *\n * The returned state can be modified with hooks such as usePopoverStyles,\n * before being passed to renderPopover_unstable.\n *\n * @param props - props from this instance of Popover\n */\nexport const usePopover_unstable = props => {\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n const initialState = {\n size: 'medium',\n contextTarget,\n setContextTarget,\n ...props\n };\n const children = React.Children.toArray(props.children);\n if (process.env.NODE_ENV !== 'production') {\n if (children.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Popover must contain at least one child');\n }\n if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Popover must contain at most two children');\n }\n }\n let popoverTrigger = undefined;\n let popoverSurface = undefined;\n if (children.length === 2) {\n popoverTrigger = children[0];\n popoverSurface = children[1];\n } else if (children.length === 1) {\n popoverSurface = children[0];\n }\n const [open, setOpenState] = useOpenState(initialState);\n const setOpenTimeoutRef = React.useRef(0);\n const setOpen = useEventCallback((e, shouldOpen) => {\n clearTimeout(setOpenTimeoutRef.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n if (e.type === 'mouseleave') {\n var _props_mouseLeaveDelay;\n // FIXME leaking Node timeout type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n setOpenTimeoutRef.current = setTimeout(() => {\n setOpenState(e, shouldOpen);\n }, (_props_mouseLeaveDelay = props.mouseLeaveDelay) !== null && _props_mouseLeaveDelay !== void 0 ? _props_mouseLeaveDelay : 500);\n } else {\n setOpenState(e, shouldOpen);\n }\n });\n // Clear timeout on unmount\n // Setting state after a component unmounts can cause memory leaks\n React.useEffect(() => {\n return () => {\n clearTimeout(setOpenTimeoutRef.current);\n };\n }, []);\n const toggleOpen = React.useCallback(e => {\n setOpen(e, !open);\n }, [setOpen, open]);\n const positioningRefs = usePopoverRefs(initialState);\n const {\n targetDocument\n } = useFluent();\n useOnClickOutside({\n contains: elementContains,\n element: targetDocument,\n callback: ev => setOpen(ev, false),\n refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n disabled: !open\n });\n // only close on scroll for context, or when closeOnScroll is specified\n const closeOnScroll = initialState.openOnContext || initialState.closeOnScroll;\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: ev => setOpen(ev, false),\n refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n disabled: !open || !closeOnScroll\n });\n const {\n findFirstFocusable\n } = useFocusFinders();\n React.useEffect(() => {\n if (props.unstable_disableAutoFocus) {\n return;\n }\n if (open && positioningRefs.contentRef.current) {\n var _positioningRefs_contentRef_current_getAttribute;\n const containerTabIndex = (_positioningRefs_contentRef_current_getAttribute = positioningRefs.contentRef.current.getAttribute('tabIndex')) !== null && _positioningRefs_contentRef_current_getAttribute !== void 0 ? _positioningRefs_contentRef_current_getAttribute : undefined;\n const firstFocusable = isNaN(containerTabIndex) ? findFirstFocusable(positioningRefs.contentRef.current) : positioningRefs.contentRef.current;\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }\n }, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);\n var _props_inline;\n return {\n ...initialState,\n ...positioningRefs,\n popoverTrigger,\n popoverSurface,\n open,\n setOpen,\n toggleOpen,\n setContextTarget,\n contextTarget,\n inline: (_props_inline = props.inline) !== null && _props_inline !== void 0 ? _props_inline : false\n };\n};\n/**\n * Creates and manages the Popover open state\n */\nfunction useOpenState(state) {\n const onOpenChange = useEventCallback((e, data) => {\n var _state_onOpenChange;\n return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, e, data);\n });\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false\n });\n state.open = open !== undefined ? open : state.open;\n const setContextTarget = state.setContextTarget;\n const setOpen = React.useCallback((e, shouldOpen) => {\n if (shouldOpen && e.type === 'contextmenu') {\n setContextTarget(e);\n }\n if (!shouldOpen) {\n setContextTarget(undefined);\n }\n setOpenState(shouldOpen);\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(e, {\n open: shouldOpen\n });\n }, [setOpenState, onOpenChange, setContextTarget]);\n return [open, setOpen];\n}\n/**\n * Creates and sets the necessary trigger, target and content refs used by Popover\n */\nfunction usePopoverRefs(state) {\n const positioningOptions = {\n position: 'above',\n align: 'center',\n arrowPadding: 2 * popoverSurfaceBorderRadius,\n target: state.openOnContext ? state.contextTarget : undefined,\n ...resolvePositioningShorthand(state.positioning)\n };\n // no reason to render arrow when covering the target\n if (positioningOptions.coverTarget) {\n state.withArrow = false;\n }\n if (state.withArrow) {\n positioningOptions.offset = mergeArrowOffset(positioningOptions.offset, arrowHeights[state.size]);\n }\n const {\n targetRef: triggerRef,\n containerRef: contentRef,\n arrowRef\n } = usePositioning(positioningOptions);\n return {\n triggerRef,\n contentRef,\n arrowRef\n };\n}\n//# sourceMappingURL=usePopover.js.map"],"names":["usePopover_unstable","props","contextTarget","setContextTarget","usePositioningMouseTarget","initialState","size","children","React","Children","toArray","process","env","NODE_ENV","length","console","warn","popoverTrigger","undefined","popoverSurface","open","setOpenState","useOpenState","setOpenTimeoutRef","useRef","setOpen","useEventCallback","e","shouldOpen","clearTimeout","current","Event","persist","type","_props_mouseLeaveDelay","setTimeout","mouseLeaveDelay","useEffect","toggleOpen","useCallback","positioningRefs","usePopoverRefs","targetDocument","useFluent","useOnClickOutside","contains","elementContains","element","callback","ev","refs","triggerRef","contentRef","disabled","closeOnScroll","openOnContext","useOnScrollOutside","findFirstFocusable","useFocusFinders","unstable_disableAutoFocus","_positioningRefs_contentRef_current_getAttribute","containerTabIndex","getAttribute","firstFocusable","isNaN","focus","_props_inline","inline","state","onOpenChange","data","_state_onOpenChange","call","useControllableState","defaultState","defaultOpen","positioningOptions","position","align","arrowPadding","popoverSurfaceBorderRadius","target","resolvePositioningShorthand","positioning","coverTarget","withArrow","offset","mergeArrowOffset","arrowHeights","targetRef","containerRef","arrowRef","usePositioning"],"mappings":";;;;+BAgBaA;;aAAAA;;;6DAhBU;gCACuE;qCAC9C;kCACyD;6BACzE;8BACA;uBACH;2BACc;AASpC,MAAMA,sBAAsBC,CAAAA,QAAS;IAC1C,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,IAAAA,2CAAyB;IACnE,MAAMC,eAAe;QACnBC,MAAM;QACNJ;QACAC;QACA,GAAGF,KAAK;IACV;IACA,MAAMM,WAAWC,OAAMC,QAAQ,CAACC,OAAO,CAACT,MAAMM,QAAQ;IACtD,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIN,SAASO,MAAM,KAAK,GAAG;YACzB,sCAAsC;YACtCC,QAAQC,IAAI,CAAC;QACf,CAAC;QACD,IAAIT,SAASO,MAAM,GAAG,GAAG;YACvB,sCAAsC;YACtCC,QAAQC,IAAI,CAAC;QACf,CAAC;IACH,CAAC;IACD,IAAIC,iBAAiBC;IACrB,IAAIC,iBAAiBD;IACrB,IAAIX,SAASO,MAAM,KAAK,GAAG;QACzBG,iBAAiBV,QAAQ,CAAC,EAAE;QAC5BY,iBAAiBZ,QAAQ,CAAC,EAAE;IAC9B,OAAO,IAAIA,SAASO,MAAM,KAAK,GAAG;QAChCK,iBAAiBZ,QAAQ,CAAC,EAAE;IAC9B,CAAC;IACD,MAAM,CAACa,MAAMC,aAAa,GAAGC,aAAajB;IAC1C,MAAMkB,oBAAoBf,OAAMgB,MAAM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MAAM,EACJmF,WAAWtC,WAAU,EACrBuC,cAActC,WAAU,EACxBuC,SAAQ,EACT,GAAGC,IAAAA,gCAAc,EAAChB;IACnB,OAAO;QACLzB;QACAC;QACAuC;IACF;AACF,EACA,sCAAsC"}
|
1
|
+
{"version":3,"sources":["../../../lib/components/Popover/usePopover.js"],"sourcesContent":["import * as React from 'react';\nimport { useControllableState, useEventCallback, useOnClickOutside, useOnScrollOutside } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { usePositioning, resolvePositioningShorthand, mergeArrowOffset, usePositioningMouseTarget } from '@fluentui/react-positioning';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { arrowHeights } from '../PopoverSurface/index';\nimport { popoverSurfaceBorderRadius } from './constants';\n/**\n * Create the state required to render Popover.\n *\n * The returned state can be modified with hooks such as usePopoverStyles,\n * before being passed to renderPopover_unstable.\n *\n * @param props - props from this instance of Popover\n */\nexport const usePopover_unstable = props => {\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n const initialState = {\n size: 'medium',\n contextTarget,\n setContextTarget,\n ...props\n };\n const children = React.Children.toArray(props.children);\n if (process.env.NODE_ENV !== 'production') {\n if (children.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Popover must contain at least one child');\n }\n if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Popover must contain at most two children');\n }\n }\n let popoverTrigger = undefined;\n let popoverSurface = undefined;\n if (children.length === 2) {\n popoverTrigger = children[0];\n popoverSurface = children[1];\n } else if (children.length === 1) {\n popoverSurface = children[0];\n }\n const [open, setOpenState] = useOpenState(initialState);\n const setOpenTimeoutRef = React.useRef(0);\n const setOpen = useEventCallback((e, shouldOpen) => {\n clearTimeout(setOpenTimeoutRef.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n if (e.type === 'mouseleave') {\n var _props_mouseLeaveDelay;\n // FIXME leaking Node timeout type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n setOpenTimeoutRef.current = setTimeout(() => {\n setOpenState(e, shouldOpen);\n }, (_props_mouseLeaveDelay = props.mouseLeaveDelay) !== null && _props_mouseLeaveDelay !== void 0 ? _props_mouseLeaveDelay : 500);\n } else {\n setOpenState(e, shouldOpen);\n }\n });\n // Clear timeout on unmount\n // Setting state after a component unmounts can cause memory leaks\n React.useEffect(() => {\n return () => {\n clearTimeout(setOpenTimeoutRef.current);\n };\n }, []);\n const toggleOpen = React.useCallback(e => {\n setOpen(e, !open);\n }, [setOpen, open]);\n const positioningRefs = usePopoverRefs(initialState);\n const {\n targetDocument\n } = useFluent();\n useOnClickOutside({\n contains: elementContains,\n element: targetDocument,\n callback: ev => setOpen(ev, false),\n refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n disabled: !open\n });\n // only close on scroll for context, or when closeOnScroll is specified\n const closeOnScroll = initialState.openOnContext || initialState.closeOnScroll;\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: ev => setOpen(ev, false),\n refs: [positioningRefs.triggerRef, positioningRefs.contentRef],\n disabled: !open || !closeOnScroll\n });\n const {\n findFirstFocusable\n } = useFocusFinders();\n React.useEffect(() => {\n if (props.unstable_disableAutoFocus) {\n return;\n }\n if (open && positioningRefs.contentRef.current) {\n var _positioningRefs_contentRef_current_getAttribute;\n const containerTabIndex = (_positioningRefs_contentRef_current_getAttribute = positioningRefs.contentRef.current.getAttribute('tabIndex')) !== null && _positioningRefs_contentRef_current_getAttribute !== void 0 ? _positioningRefs_contentRef_current_getAttribute : undefined;\n const firstFocusable = isNaN(containerTabIndex) ? findFirstFocusable(positioningRefs.contentRef.current) : positioningRefs.contentRef.current;\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }\n }, [findFirstFocusable, open, positioningRefs.contentRef, props.unstable_disableAutoFocus]);\n var _props_inertTrapFocus, _props_inline;\n return {\n ...initialState,\n ...positioningRefs,\n // eslint-disable-next-line deprecation/deprecation\n inertTrapFocus: (_props_inertTrapFocus = props.inertTrapFocus) !== null && _props_inertTrapFocus !== void 0 ? _props_inertTrapFocus : props.legacyTrapFocus === undefined ? false : !props.legacyTrapFocus,\n popoverTrigger,\n popoverSurface,\n open,\n setOpen,\n toggleOpen,\n setContextTarget,\n contextTarget,\n inline: (_props_inline = props.inline) !== null && _props_inline !== void 0 ? _props_inline : false\n };\n};\n/**\n * Creates and manages the Popover open state\n */\nfunction useOpenState(state) {\n const onOpenChange = useEventCallback((e, data) => {\n var _state_onOpenChange;\n return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, e, data);\n });\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false\n });\n state.open = open !== undefined ? open : state.open;\n const setContextTarget = state.setContextTarget;\n const setOpen = React.useCallback((e, shouldOpen) => {\n if (shouldOpen && e.type === 'contextmenu') {\n setContextTarget(e);\n }\n if (!shouldOpen) {\n setContextTarget(undefined);\n }\n setOpenState(shouldOpen);\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(e, {\n open: shouldOpen\n });\n }, [setOpenState, onOpenChange, setContextTarget]);\n return [open, setOpen];\n}\n/**\n * Creates and sets the necessary trigger, target and content refs used by Popover\n */\nfunction usePopoverRefs(state) {\n const positioningOptions = {\n position: 'above',\n align: 'center',\n arrowPadding: 2 * popoverSurfaceBorderRadius,\n target: state.openOnContext ? state.contextTarget : undefined,\n ...resolvePositioningShorthand(state.positioning)\n };\n // no reason to render arrow when covering the target\n if (positioningOptions.coverTarget) {\n state.withArrow = false;\n }\n if (state.withArrow) {\n positioningOptions.offset = mergeArrowOffset(positioningOptions.offset, arrowHeights[state.size]);\n }\n const {\n targetRef: triggerRef,\n containerRef: contentRef,\n arrowRef\n } = usePositioning(positioningOptions);\n return {\n triggerRef,\n contentRef,\n arrowRef\n };\n}\n//# sourceMappingURL=usePopover.js.map"],"names":["usePopover_unstable","props","contextTarget","setContextTarget","usePositioningMouseTarget","initialState","size","children","React","Children","toArray","process","env","NODE_ENV","length","console","warn","popoverTrigger","undefined","popoverSurface","open","setOpenState","useOpenState","setOpenTimeoutRef","useRef","setOpen","useEventCallback","e","shouldOpen","clearTimeout","current","Event","persist","type","_props_mouseLeaveDelay","setTimeout","mouseLeaveDelay","useEffect","toggleOpen","useCallback","positioningRefs","usePopoverRefs","targetDocument","useFluent","useOnClickOutside","contains","elementContains","element","callback","ev","refs","triggerRef","contentRef","disabled","closeOnScroll","openOnContext","useOnScrollOutside","findFirstFocusable","useFocusFinders","unstable_disableAutoFocus","_positioningRefs_contentRef_current_getAttribute","containerTabIndex","getAttribute","firstFocusable","isNaN","focus","_props_inertTrapFocus","_props_inline","inertTrapFocus","legacyTrapFocus","inline","state","onOpenChange","data","_state_onOpenChange","call","useControllableState","defaultState","defaultOpen","positioningOptions","position","align","arrowPadding","popoverSurfaceBorderRadius","target","resolvePositioningShorthand","positioning","coverTarget","withArrow","offset","mergeArrowOffset","arrowHeights","targetRef","containerRef","arrowRef","usePositioning"],"mappings":";;;;+BAgBaA;;aAAAA;;;6DAhBU;gCACuE;qCAC9C;kCACyD;6BACzE;8BACA;uBACH;2BACc;AASpC,MAAMA,sBAAsBC,CAAAA,QAAS;IAC1C,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,IAAAA,2CAAyB;IACnE,MAAMC,eAAe;QACnBC,MAAM;QACNJ;QACAC;QACA,GAAGF,KAAK;IACV;IACA,MAAMM,WAAWC,OAAMC,QAAQ,CAACC,OAAO,CAACT,MAAMM,QAAQ;IACtD,IAAII,QAAQC,GAAG,CAACC,QAAQ,KAAK,cAAc;QACzC,IAAIN,SAASO,MAAM,KAAK,GAAG;YACzB,sCAAsC;YACtCC,QAAQC,IAAI,CAAC;QACf,CAAC;QACD,IAAIT,SAASO,MAAM,GAAG,GAAG;YACvB,sCAAsC;YACtCC,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AAG;QAACP;QAAcmD;QAAcrE;KAAiB;IACjD,OAAO;QAACiB;QAAMK;KAAQ;AACxB;AACA;;CAEC,GACD,SAASgB,eAAe8B,KAAK,EAAE;IAC7B,MAAMQ,qBAAqB;QACzBC,UAAU;QACVC,OAAO;QACPC,cAAc,IAAIC,qCAA0B;QAC5CC,QAAQb,MAAMhB,aAAa,GAAGgB,MAAMrE,aAAa,GAAGgB,SAAS;QAC7D,GAAGmE,IAAAA,6CAA2B,EAACd,MAAMe,WAAW,CAAC;IACnD;IACA,qDAAqD;IACrD,IAAIP,mBAAmBQ,WAAW,EAAE;QAClChB,MAAMiB,SAAS,GAAG,KAAK;IACzB,CAAC;IACD,IAAIjB,MAAMiB,SAAS,EAAE;QACnBT,mBAAmBU,MAAM,GAAGC,IAAAA,kCAAgB,EAACX,mBAAmBU,MAAM,EAAEE,mBAAY,CAACpB,MAAMjE,IAAI,CAAC;IAClG,CAAC;IACD,MAAM,EACJsF,WAAWzC,WAAU,EACrB0C,cAAczC,WAAU,EACxB0C,SAAQ,EACT,GAAGC,IAAAA,gCAAc,EAAChB;IACnB,OAAO;QACL5B;QACAC;QACA0C;IACF;AACF,EACA,sCAAsC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";
|
1
|
+
/** @jsxRuntime classic */ /** @jsx createElement */ "use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
3
3
|
value: true
|
4
4
|
});
|
@@ -6,20 +6,19 @@ Object.defineProperty(exports, "renderPopoverSurface_unstable", {
|
|
6
6
|
enumerable: true,
|
7
7
|
get: ()=>renderPopoverSurface_unstable
|
8
8
|
});
|
9
|
-
const
|
10
|
-
const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
11
|
-
const _reactPortal = require("@fluentui/react-portal");
|
9
|
+
const _reactJsxRuntime = require("@fluentui/react-jsx-runtime");
|
12
10
|
const _reactUtilities = require("@fluentui/react-utilities");
|
11
|
+
const _reactPortal = require("@fluentui/react-portal");
|
13
12
|
const renderPopoverSurface_unstable = (state)=>{
|
14
|
-
const { slots , slotProps } = (0, _reactUtilities.
|
15
|
-
const surface = /*#__PURE__*/
|
13
|
+
const { slots , slotProps } = (0, _reactUtilities.getSlotsNext)(state);
|
14
|
+
const surface = /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(slots.root, slotProps.root, state.withArrow && /*#__PURE__*/ (0, _reactJsxRuntime.createElement)("div", {
|
16
15
|
ref: state.arrowRef,
|
17
16
|
className: state.arrowClassName
|
18
17
|
}), slotProps.root.children);
|
19
18
|
if (state.inline) {
|
20
19
|
return surface;
|
21
20
|
}
|
22
|
-
return /*#__PURE__*/
|
21
|
+
return /*#__PURE__*/ (0, _reactJsxRuntime.createElement)(_reactPortal.Portal, {
|
23
22
|
mountNode: state.mountNode
|
24
23
|
}, surface);
|
25
24
|
}; //# sourceMappingURL=renderPopoverSurface.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/PopoverSurface/renderPopoverSurface.js"],"sourcesContent":["import
|
1
|
+
{"version":3,"sources":["../../../lib/components/PopoverSurface/renderPopoverSurface.js"],"sourcesContent":["/** @jsxRuntime classic */ /** @jsx createElement */import { createElement } from '@fluentui/react-jsx-runtime';\nimport { getSlotsNext } from '@fluentui/react-utilities';\nimport { Portal } from '@fluentui/react-portal';\n/**\n * Render the final JSX of PopoverSurface\n */\nexport const renderPopoverSurface_unstable = state => {\n const {\n slots,\n slotProps\n } = getSlotsNext(state);\n const surface = /*#__PURE__*/createElement(slots.root, slotProps.root, state.withArrow && /*#__PURE__*/createElement(\"div\", {\n ref: state.arrowRef,\n className: state.arrowClassName\n }), slotProps.root.children);\n if (state.inline) {\n return surface;\n }\n return /*#__PURE__*/createElement(Portal, {\n mountNode: state.mountNode\n }, surface);\n};\n//# sourceMappingURL=renderPopoverSurface.js.map"],"names":["renderPopoverSurface_unstable","state","slots","slotProps","getSlotsNext","surface","createElement","root","withArrow","ref","arrowRef","className","arrowClassName","children","inline","Portal","mountNode"],"mappings":"AAAA,wBAAwB,GAAG,uBAAuB;;;;+BAMrCA;;aAAAA;;iCANqE;gCACrD;6BACN;AAIhB,MAAMA,gCAAgCC,CAAAA,QAAS;IACpD,MAAM,EACJC,MAAK,EACLC,UAAS,EACV,GAAGC,IAAAA,4BAAY,EAACH;IACjB,MAAMI,UAAU,WAAW,GAAEC,IAAAA,8BAAa,EAACJ,MAAMK,IAAI,EAAEJ,UAAUI,IAAI,EAAEN,MAAMO,SAAS,IAAI,WAAW,GAAEF,IAAAA,8BAAa,EAAC,OAAO;QAC1HG,KAAKR,MAAMS,QAAQ;QACnBC,WAAWV,MAAMW,cAAc;IACjC,IAAIT,UAAUI,IAAI,CAACM,QAAQ;IAC3B,IAAIZ,MAAMa,MAAM,EAAE;QAChB,OAAOT;IACT,CAAC;IACD,OAAO,WAAW,GAAEC,IAAAA,8BAAa,EAACS,mBAAM,EAAE;QACxCC,WAAWf,MAAMe,SAAS;IAC5B,GAAGX;AACL,GACA,gDAAgD"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-popover",
|
3
|
-
"version": "9.5.
|
3
|
+
"version": "9.5.10",
|
4
4
|
"description": "Popover component for Fluent UI",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -36,14 +36,15 @@
|
|
36
36
|
},
|
37
37
|
"dependencies": {
|
38
38
|
"@fluentui/keyboard-keys": "^9.0.2",
|
39
|
-
"@fluentui/react-aria": "^9.3.
|
40
|
-
"@fluentui/react-context-selector": "^9.1.
|
41
|
-
"@fluentui/react-portal": "^9.2.
|
42
|
-
"@fluentui/react-positioning": "^9.5.
|
39
|
+
"@fluentui/react-aria": "^9.3.18",
|
40
|
+
"@fluentui/react-context-selector": "^9.1.18",
|
41
|
+
"@fluentui/react-portal": "^9.2.6",
|
42
|
+
"@fluentui/react-positioning": "^9.5.10",
|
43
43
|
"@fluentui/react-shared-contexts": "^9.3.3",
|
44
|
-
"@fluentui/react-tabster": "^9.6.
|
44
|
+
"@fluentui/react-tabster": "^9.6.5",
|
45
45
|
"@fluentui/react-theme": "^9.1.7",
|
46
|
-
"@fluentui/react-utilities": "^9.
|
46
|
+
"@fluentui/react-utilities": "^9.8.0",
|
47
|
+
"@fluentui/react-jsx-runtime": "9.0.0-alpha.2",
|
47
48
|
"@griffel/react": "^1.5.2",
|
48
49
|
"@swc/helpers": "^0.4.14"
|
49
50
|
},
|