@fluentui/react-popover 9.8.10 → 9.8.12
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +113 -5
- package/CHANGELOG.md +37 -6
- package/lib/components/PopoverSurface/usePopoverSurface.js +5 -2
- package/lib/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js +4 -1
- package/lib-commonjs/components/PopoverSurface/usePopoverSurface.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,115 @@
|
|
2
2
|
"name": "@fluentui/react-popover",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Thu, 05 Oct 2023 15:17:58 GMT",
|
6
|
+
"tag": "@fluentui/react-popover_v9.8.12",
|
7
|
+
"version": "9.8.12",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "bernardo.sunderhus@gmail.com",
|
12
|
+
"package": "@fluentui/react-popover",
|
13
|
+
"commit": "86dd76990e3da5af1f2b6b04a3aec46141d5a653",
|
14
|
+
"comment": "chore: migrate from getNativeElementProps to getIntrinsicElementProps"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "beachball",
|
18
|
+
"package": "@fluentui/react-popover",
|
19
|
+
"comment": "Bump @fluentui/react-aria to v9.3.40",
|
20
|
+
"commit": "690590449dc3d65cd40b2b06a990fd920180919d"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-popover",
|
25
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.38",
|
26
|
+
"commit": "690590449dc3d65cd40b2b06a990fd920180919d"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"author": "beachball",
|
30
|
+
"package": "@fluentui/react-popover",
|
31
|
+
"comment": "Bump @fluentui/react-portal to v9.3.21",
|
32
|
+
"commit": "690590449dc3d65cd40b2b06a990fd920180919d"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"author": "beachball",
|
36
|
+
"package": "@fluentui/react-popover",
|
37
|
+
"comment": "Bump @fluentui/react-positioning to v9.9.18",
|
38
|
+
"commit": "690590449dc3d65cd40b2b06a990fd920180919d"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"author": "beachball",
|
42
|
+
"package": "@fluentui/react-popover",
|
43
|
+
"comment": "Bump @fluentui/react-tabster to v9.13.4",
|
44
|
+
"commit": "690590449dc3d65cd40b2b06a990fd920180919d"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"author": "beachball",
|
48
|
+
"package": "@fluentui/react-popover",
|
49
|
+
"comment": "Bump @fluentui/react-utilities to v9.14.1",
|
50
|
+
"commit": "690590449dc3d65cd40b2b06a990fd920180919d"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"author": "beachball",
|
54
|
+
"package": "@fluentui/react-popover",
|
55
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.14",
|
56
|
+
"commit": "690590449dc3d65cd40b2b06a990fd920180919d"
|
57
|
+
}
|
58
|
+
]
|
59
|
+
}
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"date": "Wed, 04 Oct 2023 08:45:47 GMT",
|
63
|
+
"tag": "@fluentui/react-popover_v9.8.11",
|
64
|
+
"version": "9.8.11",
|
65
|
+
"comments": {
|
66
|
+
"patch": [
|
67
|
+
{
|
68
|
+
"author": "beachball",
|
69
|
+
"package": "@fluentui/react-popover",
|
70
|
+
"comment": "Bump @fluentui/react-aria to v9.3.39",
|
71
|
+
"commit": "67b6cc6534e684ed32704dc6c0faee632bb840dc"
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"author": "beachball",
|
75
|
+
"package": "@fluentui/react-popover",
|
76
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.37",
|
77
|
+
"commit": "67b6cc6534e684ed32704dc6c0faee632bb840dc"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"author": "beachball",
|
81
|
+
"package": "@fluentui/react-popover",
|
82
|
+
"comment": "Bump @fluentui/react-portal to v9.3.20",
|
83
|
+
"commit": "67b6cc6534e684ed32704dc6c0faee632bb840dc"
|
84
|
+
},
|
85
|
+
{
|
86
|
+
"author": "beachball",
|
87
|
+
"package": "@fluentui/react-popover",
|
88
|
+
"comment": "Bump @fluentui/react-positioning to v9.9.17",
|
89
|
+
"commit": "67b6cc6534e684ed32704dc6c0faee632bb840dc"
|
90
|
+
},
|
91
|
+
{
|
92
|
+
"author": "beachball",
|
93
|
+
"package": "@fluentui/react-popover",
|
94
|
+
"comment": "Bump @fluentui/react-tabster to v9.13.3",
|
95
|
+
"commit": "67b6cc6534e684ed32704dc6c0faee632bb840dc"
|
96
|
+
},
|
97
|
+
{
|
98
|
+
"author": "beachball",
|
99
|
+
"package": "@fluentui/react-popover",
|
100
|
+
"comment": "Bump @fluentui/react-utilities to v9.14.0",
|
101
|
+
"commit": "67b6cc6534e684ed32704dc6c0faee632bb840dc"
|
102
|
+
},
|
103
|
+
{
|
104
|
+
"author": "beachball",
|
105
|
+
"package": "@fluentui/react-popover",
|
106
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.13",
|
107
|
+
"commit": "67b6cc6534e684ed32704dc6c0faee632bb840dc"
|
108
|
+
}
|
109
|
+
]
|
110
|
+
}
|
111
|
+
},
|
112
|
+
{
|
113
|
+
"date": "Mon, 02 Oct 2023 08:56:05 GMT",
|
6
114
|
"tag": "@fluentui/react-popover_v9.8.10",
|
7
115
|
"version": "9.8.10",
|
8
116
|
"comments": {
|
@@ -11,25 +119,25 @@
|
|
11
119
|
"author": "beachball",
|
12
120
|
"package": "@fluentui/react-popover",
|
13
121
|
"comment": "Bump @fluentui/react-portal to v9.3.19",
|
14
|
-
"commit": "
|
122
|
+
"commit": "da9a08817e5de95639e2dd7aa6d6709d47faa7f4"
|
15
123
|
},
|
16
124
|
{
|
17
125
|
"author": "beachball",
|
18
126
|
"package": "@fluentui/react-popover",
|
19
127
|
"comment": "Bump @fluentui/react-positioning to v9.9.16",
|
20
|
-
"commit": "
|
128
|
+
"commit": "da9a08817e5de95639e2dd7aa6d6709d47faa7f4"
|
21
129
|
},
|
22
130
|
{
|
23
131
|
"author": "beachball",
|
24
132
|
"package": "@fluentui/react-popover",
|
25
133
|
"comment": "Bump @fluentui/react-shared-contexts to v9.9.2",
|
26
|
-
"commit": "
|
134
|
+
"commit": "da9a08817e5de95639e2dd7aa6d6709d47faa7f4"
|
27
135
|
},
|
28
136
|
{
|
29
137
|
"author": "beachball",
|
30
138
|
"package": "@fluentui/react-popover",
|
31
139
|
"comment": "Bump @fluentui/react-tabster to v9.13.2",
|
32
|
-
"commit": "
|
140
|
+
"commit": "da9a08817e5de95639e2dd7aa6d6709d47faa7f4"
|
33
141
|
}
|
34
142
|
]
|
35
143
|
}
|
package/CHANGELOG.md
CHANGED
@@ -1,20 +1,51 @@
|
|
1
1
|
# Change Log - @fluentui/react-popover
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Thu, 05 Oct 2023 15:17:58 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.8.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.8.12)
|
8
|
+
|
9
|
+
Thu, 05 Oct 2023 15:17:58 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.8.11..@fluentui/react-popover_v9.8.12)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- chore: migrate from getNativeElementProps to getIntrinsicElementProps ([PR #29387](https://github.com/microsoft/fluentui/pull/29387) by bernardo.sunderhus@gmail.com)
|
15
|
+
- Bump @fluentui/react-aria to v9.3.40 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
|
16
|
+
- Bump @fluentui/react-context-selector to v9.1.38 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
|
17
|
+
- Bump @fluentui/react-portal to v9.3.21 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
|
18
|
+
- Bump @fluentui/react-positioning to v9.9.18 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
|
19
|
+
- Bump @fluentui/react-tabster to v9.13.4 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
|
20
|
+
- Bump @fluentui/react-utilities to v9.14.1 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
|
21
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.14 ([PR #29412](https://github.com/microsoft/fluentui/pull/29412) by beachball)
|
22
|
+
|
23
|
+
## [9.8.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.8.11)
|
24
|
+
|
25
|
+
Wed, 04 Oct 2023 08:45:47 GMT
|
26
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.8.10..@fluentui/react-popover_v9.8.11)
|
27
|
+
|
28
|
+
### Patches
|
29
|
+
|
30
|
+
- Bump @fluentui/react-aria to v9.3.39 ([commit](https://github.com/microsoft/fluentui/commit/67b6cc6534e684ed32704dc6c0faee632bb840dc) by beachball)
|
31
|
+
- Bump @fluentui/react-context-selector to v9.1.37 ([commit](https://github.com/microsoft/fluentui/commit/67b6cc6534e684ed32704dc6c0faee632bb840dc) by beachball)
|
32
|
+
- Bump @fluentui/react-portal to v9.3.20 ([commit](https://github.com/microsoft/fluentui/commit/67b6cc6534e684ed32704dc6c0faee632bb840dc) by beachball)
|
33
|
+
- Bump @fluentui/react-positioning to v9.9.17 ([commit](https://github.com/microsoft/fluentui/commit/67b6cc6534e684ed32704dc6c0faee632bb840dc) by beachball)
|
34
|
+
- Bump @fluentui/react-tabster to v9.13.3 ([commit](https://github.com/microsoft/fluentui/commit/67b6cc6534e684ed32704dc6c0faee632bb840dc) by beachball)
|
35
|
+
- Bump @fluentui/react-utilities to v9.14.0 ([commit](https://github.com/microsoft/fluentui/commit/67b6cc6534e684ed32704dc6c0faee632bb840dc) by beachball)
|
36
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.13 ([commit](https://github.com/microsoft/fluentui/commit/67b6cc6534e684ed32704dc6c0faee632bb840dc) by beachball)
|
37
|
+
|
7
38
|
## [9.8.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.8.10)
|
8
39
|
|
9
|
-
Mon, 02 Oct 2023 08:
|
40
|
+
Mon, 02 Oct 2023 08:56:05 GMT
|
10
41
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-popover_v9.8.9..@fluentui/react-popover_v9.8.10)
|
11
42
|
|
12
43
|
### Patches
|
13
44
|
|
14
|
-
- Bump @fluentui/react-portal to v9.3.19 ([PR #
|
15
|
-
- Bump @fluentui/react-positioning to v9.9.16 ([PR #
|
16
|
-
- Bump @fluentui/react-shared-contexts to v9.9.2 ([PR #
|
17
|
-
- Bump @fluentui/react-tabster to v9.13.2 ([PR #
|
45
|
+
- Bump @fluentui/react-portal to v9.3.19 ([PR #29301](https://github.com/microsoft/fluentui/pull/29301) by beachball)
|
46
|
+
- Bump @fluentui/react-positioning to v9.9.16 ([PR #29301](https://github.com/microsoft/fluentui/pull/29301) by beachball)
|
47
|
+
- Bump @fluentui/react-shared-contexts to v9.9.2 ([PR #29301](https://github.com/microsoft/fluentui/pull/29301) by beachball)
|
48
|
+
- Bump @fluentui/react-tabster to v9.13.2 ([PR #29301](https://github.com/microsoft/fluentui/pull/29301) by beachball)
|
18
49
|
|
19
50
|
## [9.8.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-popover_v9.8.9)
|
20
51
|
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
2
|
+
import { getIntrinsicElementProps, useMergedRefs, slot } from '@fluentui/react-utilities';
|
3
3
|
import { useModalAttributes } from '@fluentui/react-tabster';
|
4
4
|
import { usePopoverContext_unstable } from '../../popoverContext';
|
5
5
|
/**
|
@@ -37,7 +37,10 @@ import { usePopoverContext_unstable } from '../../popoverContext';
|
|
37
37
|
components: {
|
38
38
|
root: 'div'
|
39
39
|
},
|
40
|
-
root: slot.always(
|
40
|
+
root: slot.always(getIntrinsicElementProps('div', {
|
41
|
+
// FIXME:
|
42
|
+
// `contentRef` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
|
43
|
+
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
|
41
44
|
ref: useMergedRefs(ref, contentRef),
|
42
45
|
role: trapFocus ? 'dialog' : 'group',
|
43
46
|
'aria-modal': trapFocus ? true : undefined,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["usePopoverSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport {
|
1
|
+
{"version":3,"sources":["usePopoverSurface.ts"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\nimport type { PopoverSurfaceProps, PopoverSurfaceState } from './PopoverSurface.types';\n\n/**\n * Create the state required to render PopoverSurface.\n *\n * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,\n * before being passed to renderPopoverSurface_unstable.\n *\n * @param props - props from this instance of PopoverSurface\n * @param ref - reference to root HTMLDivElement of PopoverSurface\n */\nexport const usePopoverSurface_unstable = (\n props: PopoverSurfaceProps,\n ref: React.Ref<HTMLDivElement>,\n): PopoverSurfaceState => {\n const contentRef = usePopoverContext_unstable(context => context.contentRef);\n const openOnHover = usePopoverContext_unstable(context => context.openOnHover);\n const setOpen = usePopoverContext_unstable(context => context.setOpen);\n const mountNode = usePopoverContext_unstable(context => context.mountNode);\n const arrowRef = usePopoverContext_unstable(context => context.arrowRef);\n const size = usePopoverContext_unstable(context => context.size);\n const withArrow = usePopoverContext_unstable(context => context.withArrow);\n const appearance = usePopoverContext_unstable(context => context.appearance);\n const trapFocus = usePopoverContext_unstable(context => context.trapFocus);\n const inertTrapFocus = usePopoverContext_unstable(context => context.inertTrapFocus);\n const inline = usePopoverContext_unstable(context => context.inline);\n const { modalAttributes } = useModalAttributes({\n trapFocus,\n legacyTrapFocus: !inertTrapFocus,\n alwaysFocusable: !trapFocus,\n });\n\n const state: PopoverSurfaceState = {\n inline,\n appearance,\n withArrow,\n size,\n arrowRef,\n mountNode,\n components: {\n root: 'div',\n },\n root: slot.always(\n getIntrinsicElementProps('div', {\n // FIXME:\n // `contentRef` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, contentRef) as React.Ref<HTMLDivElement>,\n role: trapFocus ? 'dialog' : 'group',\n 'aria-modal': trapFocus ? true : undefined,\n ...modalAttributes,\n ...props,\n }),\n { elementType: 'div' },\n ),\n };\n\n const {\n onMouseEnter: onMouseEnterOriginal,\n onMouseLeave: onMouseLeaveOriginal,\n onKeyDown: onKeyDownOriginal,\n } = state.root;\n state.root.onMouseEnter = (e: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover) {\n setOpen(e, true);\n }\n\n onMouseEnterOriginal?.(e);\n };\n\n state.root.onMouseLeave = (e: React.MouseEvent<HTMLDivElement>) => {\n if (openOnHover) {\n setOpen(e, false);\n }\n\n onMouseLeaveOriginal?.(e);\n };\n\n state.root.onKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => {\n // only close if the event happened inside the current popover\n // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack\n if (e.key === 'Escape' && contentRef.current?.contains(e.target as HTMLDivElement)) {\n e.preventDefault();\n setOpen(e, false);\n }\n\n onKeyDownOriginal?.(e);\n };\n\n return state;\n};\n"],"names":["React","getIntrinsicElementProps","useMergedRefs","slot","useModalAttributes","usePopoverContext_unstable","usePopoverSurface_unstable","props","ref","contentRef","context","openOnHover","setOpen","mountNode","arrowRef","size","withArrow","appearance","trapFocus","inertTrapFocus","inline","modalAttributes","legacyTrapFocus","alwaysFocusable","state","components","root","always","role","undefined","elementType","onMouseEnter","onMouseEnterOriginal","onMouseLeave","onMouseLeaveOriginal","onKeyDown","onKeyDownOriginal","e","key","current","contains","target","preventDefault"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAC/B,SAASC,wBAAwB,EAAEC,aAAa,EAAEC,IAAI,QAAQ,4BAA4B;AAC1F,SAASC,kBAAkB,QAAQ,0BAA0B;AAC7D,SAASC,0BAA0B,QAAQ,uBAAuB;AAGlE;;;;;;;;CAQC,GACD,OAAO,MAAMC,6BAA6B,CACxCC,OACAC;IAEA,MAAMC,aAAaJ,2BAA2BK,CAAAA,UAAWA,QAAQD,UAAU;IAC3E,MAAME,cAAcN,2BAA2BK,CAAAA,UAAWA,QAAQC,WAAW;IAC7E,MAAMC,UAAUP,2BAA2BK,CAAAA,UAAWA,QAAQE,OAAO;IACrE,MAAMC,YAAYR,2BAA2BK,CAAAA,UAAWA,QAAQG,SAAS;IACzE,MAAMC,WAAWT,2BAA2BK,CAAAA,UAAWA,QAAQI,QAAQ;IACvE,MAAMC,OAAOV,2BAA2BK,CAAAA,UAAWA,QAAQK,IAAI;IAC/D,MAAMC,YAAYX,2BAA2BK,CAAAA,UAAWA,QAAQM,SAAS;IACzE,MAAMC,aAAaZ,2BAA2BK,CAAAA,UAAWA,QAAQO,UAAU;IAC3E,MAAMC,YAAYb,2BAA2BK,CAAAA,UAAWA,QAAQQ,SAAS;IACzE,MAAMC,iBAAiBd,2BAA2BK,CAAAA,UAAWA,QAAQS,cAAc;IACnF,MAAMC,SAASf,2BAA2BK,CAAAA,UAAWA,QAAQU,MAAM;IACnE,MAAM,EAAEC,eAAe,EAAE,GAAGjB,mBAAmB;QAC7Cc;QACAI,iBAAiB,CAACH;QAClBI,iBAAiB,CAACL;IACpB;IAEA,MAAMM,QAA6B;QACjCJ;QACAH;QACAD;QACAD;QACAD;QACAD;QACAY,YAAY;YACVC,MAAM;QACR;QACAA,MAAMvB,KAAKwB,MAAM,CACf1B,yBAAyB,OAAO;YAC9B,SAAS;YACT,mFAAmF;YACnF,4FAA4F;YAC5FO,KAAKN,cAAcM,KAAKC;YACxBmB,MAAMV,YAAY,WAAW;YAC7B,cAAcA,YAAY,OAAOW;YACjC,GAAGR,eAAe;YAClB,GAAGd,KAAK;QACV,IACA;YAAEuB,aAAa;QAAM;IAEzB;IAEA,MAAM,EACJC,cAAcC,oBAAoB,EAClCC,cAAcC,oBAAoB,EAClCC,WAAWC,iBAAiB,EAC7B,GAAGZ,MAAME,IAAI;IACdF,MAAME,IAAI,CAACK,YAAY,GAAG,CAACM;QACzB,IAAI1B,aAAa;YACfC,QAAQyB,GAAG;QACb;QAEAL,iCAAAA,2CAAAA,qBAAuBK;IACzB;IAEAb,MAAME,IAAI,CAACO,YAAY,GAAG,CAACI;QACzB,IAAI1B,aAAa;YACfC,QAAQyB,GAAG;QACb;QAEAH,iCAAAA,2CAAAA,qBAAuBG;IACzB;IAEAb,MAAME,IAAI,CAACS,SAAS,GAAG,CAACE;YAGI5B;QAF1B,8DAA8D;QAC9D,mHAAmH;QACnH,IAAI4B,EAAEC,GAAG,KAAK,cAAY7B,sBAAAA,WAAW8B,OAAO,cAAlB9B,0CAAAA,oBAAoB+B,QAAQ,CAACH,EAAEI,MAAM,IAAqB;YAClFJ,EAAEK,cAAc;YAChB9B,QAAQyB,GAAG;QACb;QAEAD,8BAAAA,wCAAAA,kBAAoBC;IACtB;IAEA,OAAOb;AACT,EAAE"}
|
@@ -40,7 +40,10 @@ const usePopoverSurface_unstable = (props, ref)=>{
|
|
40
40
|
components: {
|
41
41
|
root: 'div'
|
42
42
|
},
|
43
|
-
root: _reactutilities.slot.always((0, _reactutilities.
|
43
|
+
root: _reactutilities.slot.always((0, _reactutilities.getIntrinsicElementProps)('div', {
|
44
|
+
// FIXME:
|
45
|
+
// `contentRef` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`
|
46
|
+
// but since it would be a breaking change to fix it, we are casting ref to it's proper type
|
44
47
|
ref: (0, _reactutilities.useMergedRefs)(ref, contentRef),
|
45
48
|
role: trapFocus ? 'dialog' : 'group',
|
46
49
|
'aria-modal': trapFocus ? true : undefined,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["usePopoverSurface.js"],"sourcesContent":["import * as React from 'react';\nimport {
|
1
|
+
{"version":3,"sources":["usePopoverSurface.js"],"sourcesContent":["import * as React from 'react';\nimport { getIntrinsicElementProps, useMergedRefs, slot } from '@fluentui/react-utilities';\nimport { useModalAttributes } from '@fluentui/react-tabster';\nimport { usePopoverContext_unstable } from '../../popoverContext';\n/**\n * Create the state required to render PopoverSurface.\n *\n * The returned state can be modified with hooks such as usePopoverSurfaceStyles_unstable,\n * before being passed to renderPopoverSurface_unstable.\n *\n * @param props - props from this instance of PopoverSurface\n * @param ref - reference to root HTMLDivElement of PopoverSurface\n */ export const usePopoverSurface_unstable = (props, ref)=>{\n const contentRef = usePopoverContext_unstable((context)=>context.contentRef);\n const openOnHover = usePopoverContext_unstable((context)=>context.openOnHover);\n const setOpen = usePopoverContext_unstable((context)=>context.setOpen);\n const mountNode = usePopoverContext_unstable((context)=>context.mountNode);\n const arrowRef = usePopoverContext_unstable((context)=>context.arrowRef);\n const size = usePopoverContext_unstable((context)=>context.size);\n const withArrow = usePopoverContext_unstable((context)=>context.withArrow);\n const appearance = usePopoverContext_unstable((context)=>context.appearance);\n const trapFocus = usePopoverContext_unstable((context)=>context.trapFocus);\n const inertTrapFocus = usePopoverContext_unstable((context)=>context.inertTrapFocus);\n const inline = usePopoverContext_unstable((context)=>context.inline);\n const { modalAttributes } = useModalAttributes({\n trapFocus,\n legacyTrapFocus: !inertTrapFocus,\n alwaysFocusable: !trapFocus\n });\n const state = {\n inline,\n appearance,\n withArrow,\n size,\n arrowRef,\n mountNode,\n components: {\n root: 'div'\n },\n root: slot.always(getIntrinsicElementProps('div', {\n // FIXME:\n // `contentRef` is wrongly assigned to be `HTMLElement` instead of `HTMLDivElement`\n // but since it would be a breaking change to fix it, we are casting ref to it's proper type\n ref: useMergedRefs(ref, contentRef),\n role: trapFocus ? 'dialog' : 'group',\n 'aria-modal': trapFocus ? true : undefined,\n ...modalAttributes,\n ...props\n }), {\n elementType: 'div'\n })\n };\n const { onMouseEnter: onMouseEnterOriginal, onMouseLeave: onMouseLeaveOriginal, onKeyDown: onKeyDownOriginal } = state.root;\n state.root.onMouseEnter = (e)=>{\n if (openOnHover) {\n setOpen(e, true);\n }\n onMouseEnterOriginal === null || onMouseEnterOriginal === void 0 ? void 0 : onMouseEnterOriginal(e);\n };\n state.root.onMouseLeave = (e)=>{\n if (openOnHover) {\n setOpen(e, false);\n }\n onMouseLeaveOriginal === null || onMouseLeaveOriginal === void 0 ? void 0 : onMouseLeaveOriginal(e);\n };\n state.root.onKeyDown = (e)=>{\n var _contentRef_current;\n // only close if the event happened inside the current popover\n // If using a stack of inline popovers, the user should call `stopPropagation` to avoid dismissing the entire stack\n if (e.key === 'Escape' && ((_contentRef_current = contentRef.current) === null || _contentRef_current === void 0 ? void 0 : _contentRef_current.contains(e.target))) {\n e.preventDefault();\n setOpen(e, false);\n }\n onKeyDownOriginal === null || onKeyDownOriginal === void 0 ? void 0 : onKeyDownOriginal(e);\n };\n return state;\n};\n"],"names":["usePopoverSurface_unstable","props","ref","contentRef","usePopoverContext_unstable","context","openOnHover","setOpen","mountNode","arrowRef","size","withArrow","appearance","trapFocus","inertTrapFocus","inline","modalAttributes","useModalAttributes","legacyTrapFocus","alwaysFocusable","state","components","root","slot","always","getIntrinsicElementProps","useMergedRefs","role","undefined","elementType","onMouseEnter","onMouseEnterOriginal","onMouseLeave","onMouseLeaveOriginal","onKeyDown","onKeyDownOriginal","e","_contentRef_current","key","current","contains","target","preventDefault"],"mappings":";;;;+BAYiBA;;;eAAAA;;;;iEAZM;gCACuC;8BAC3B;gCACQ;AAShC,MAAMA,6BAA6B,CAACC,OAAOC;IAClD,MAAMC,aAAaC,IAAAA,0CAA0B,EAAC,CAACC,UAAUA,QAAQF,UAAU;IAC3E,MAAMG,cAAcF,IAAAA,0CAA0B,EAAC,CAACC,UAAUA,QAAQC,WAAW;IAC7E,MAAMC,UAAUH,IAAAA,0CAA0B,EAAC,CAACC,UAAUA,QAAQE,OAAO;IACrE,MAAMC,YAAYJ,IAAAA,0CAA0B,EAAC,CAACC,UAAUA,QAAQG,SAAS;IACzE,MAAMC,WAAWL,IAAAA,0CAA0B,EAAC,CAACC,UAAUA,QAAQI,QAAQ;IACvE,MAAMC,OAAON,IAAAA,0CAA0B,EAAC,CAACC,UAAUA,QAAQK,IAAI;IAC/D,MAAMC,YAAYP,IAAAA,0CAA0B,EAAC,CAACC,UAAUA,QAAQM,SAAS;IACzE,MAAMC,aAAaR,IAAAA,0CAA0B,EAAC,CAACC,UAAUA,QAAQO,UAAU;IAC3E,MAAMC,YAAYT,IAAAA,0CAA0B,EAAC,CAACC,UAAUA,QAAQQ,SAAS;IACzE,MAAMC,iBAAiBV,IAAAA,0CAA0B,EAAC,CAACC,UAAUA,QAAQS,cAAc;IACnF,MAAMC,SAASX,IAAAA,0CAA0B,EAAC,CAACC,UAAUA,QAAQU,MAAM;IACnE,MAAM,EAAEC,eAAe,EAAE,GAAGC,IAAAA,gCAAkB,EAAC;QAC3CJ;QACAK,iBAAiB,CAACJ;QAClBK,iBAAiB,CAACN;IACtB;IACA,MAAMO,QAAQ;QACVL;QACAH;QACAD;QACAD;QACAD;QACAD;QACAa,YAAY;YACRC,MAAM;QACV;QACAA,MAAMC,oBAAI,CAACC,MAAM,CAACC,IAAAA,wCAAwB,EAAC,OAAO;YAC9C,SAAS;YACT,mFAAmF;YACnF,4FAA4F;YAC5FvB,KAAKwB,IAAAA,6BAAa,EAACxB,KAAKC;YACxBwB,MAAMd,YAAY,WAAW;YAC7B,cAAcA,YAAY,OAAOe;YACjC,GAAGZ,eAAe;YAClB,GAAGf,KAAK;QACZ,IAAI;YACA4B,aAAa;QACjB;IACJ;IACA,MAAM,EAAEC,cAAcC,oBAAoB,EAAEC,cAAcC,oBAAoB,EAAEC,WAAWC,iBAAiB,EAAE,GAAGf,MAAME,IAAI;IAC3HF,MAAME,IAAI,CAACQ,YAAY,GAAG,CAACM;QACvB,IAAI9B,aAAa;YACbC,QAAQ6B,GAAG;QACf;QACAL,yBAAyB,QAAQA,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBK;IACrG;IACAhB,MAAME,IAAI,CAACU,YAAY,GAAG,CAACI;QACvB,IAAI9B,aAAa;YACbC,QAAQ6B,GAAG;QACf;QACAH,yBAAyB,QAAQA,yBAAyB,KAAK,IAAI,KAAK,IAAIA,qBAAqBG;IACrG;IACAhB,MAAME,IAAI,CAACY,SAAS,GAAG,CAACE;QACpB,IAAIC;QACJ,8DAA8D;QAC9D,mHAAmH;QACnH,IAAID,EAAEE,GAAG,KAAK,YAAa,CAAA,AAACD,CAAAA,sBAAsBlC,WAAWoC,OAAO,AAAD,MAAO,QAAQF,wBAAwB,KAAK,IAAI,KAAK,IAAIA,oBAAoBG,QAAQ,CAACJ,EAAEK,MAAM,CAAA,GAAI;YACjKL,EAAEM,cAAc;YAChBnC,QAAQ6B,GAAG;QACf;QACAD,sBAAsB,QAAQA,sBAAsB,KAAK,IAAI,KAAK,IAAIA,kBAAkBC;IAC5F;IACA,OAAOhB;AACX"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-popover",
|
3
|
-
"version": "9.8.
|
3
|
+
"version": "9.8.12",
|
4
4
|
"description": "Popover component for Fluent UI",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -37,15 +37,15 @@
|
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
39
|
"@fluentui/keyboard-keys": "^9.0.6",
|
40
|
-
"@fluentui/react-aria": "^9.3.
|
41
|
-
"@fluentui/react-context-selector": "^9.1.
|
42
|
-
"@fluentui/react-portal": "^9.3.
|
43
|
-
"@fluentui/react-positioning": "^9.9.
|
40
|
+
"@fluentui/react-aria": "^9.3.40",
|
41
|
+
"@fluentui/react-context-selector": "^9.1.38",
|
42
|
+
"@fluentui/react-portal": "^9.3.21",
|
43
|
+
"@fluentui/react-positioning": "^9.9.18",
|
44
44
|
"@fluentui/react-shared-contexts": "^9.9.2",
|
45
|
-
"@fluentui/react-tabster": "^9.13.
|
45
|
+
"@fluentui/react-tabster": "^9.13.4",
|
46
46
|
"@fluentui/react-theme": "^9.1.14",
|
47
|
-
"@fluentui/react-utilities": "^9.
|
48
|
-
"@fluentui/react-jsx-runtime": "^9.0.
|
47
|
+
"@fluentui/react-utilities": "^9.14.1",
|
48
|
+
"@fluentui/react-jsx-runtime": "^9.0.14",
|
49
49
|
"@griffel/react": "^1.5.14",
|
50
50
|
"@swc/helpers": "^0.5.1"
|
51
51
|
},
|