@fluentui/react-positioning 9.0.0-rc.9 → 9.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +177 -1
- package/CHANGELOG.md +73 -2
- package/dist/index.d.ts +80 -48
- package/lib/createArrowStyles.js +3 -1
- package/lib/createArrowStyles.js.map +1 -1
- package/lib/createVirtualElementFromClick.js +2 -0
- package/lib/createVirtualElementFromClick.js.map +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/isIntersectingModifier.js.map +1 -1
- package/lib/types.js.map +1 -1
- package/lib/{usePopper.js → usePositioning.js} +10 -8
- package/lib/usePositioning.js.map +1 -0
- package/lib/{usePopperMouseTarget.js → usePositioningMouseTarget.js} +4 -3
- package/lib/usePositioningMouseTarget.js.map +1 -0
- package/lib/utils/fromPopperPlacement.js +40 -0
- package/lib/utils/fromPopperPlacement.js.map +1 -0
- package/lib/utils/getBoundary.js +1 -1
- package/lib/utils/getBoundary.js.map +1 -1
- package/lib/utils/getPopperOffset.js +44 -0
- package/lib/utils/getPopperOffset.js.map +1 -0
- package/lib/utils/getReactFiberFromNode.js.map +1 -1
- package/lib/utils/getScrollParent.js.map +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/mergeArrowOffset.js +24 -22
- package/lib/utils/mergeArrowOffset.js.map +1 -1
- package/lib/utils/parsePopperPlacement.js +14 -0
- package/lib/utils/parsePopperPlacement.js.map +1 -0
- package/lib/utils/positioningHelper.js.map +1 -1
- package/lib/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib/utils/useCallbackRef.js.map +1 -1
- package/lib-commonjs/createArrowStyles.js +3 -1
- package/lib-commonjs/createArrowStyles.js.map +1 -1
- package/lib-commonjs/createVirtualElementFromClick.js +2 -0
- package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
- package/lib-commonjs/index.js +7 -7
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/isIntersectingModifier.js.map +1 -1
- package/lib-commonjs/{usePopper.js → usePositioning.js} +13 -10
- package/lib-commonjs/usePositioning.js.map +1 -0
- package/lib-commonjs/{usePopperMouseTarget.js → usePositioningMouseTarget.js} +6 -5
- package/lib-commonjs/usePositioningMouseTarget.js.map +1 -0
- package/lib-commonjs/utils/fromPopperPlacement.js +50 -0
- package/lib-commonjs/utils/fromPopperPlacement.js.map +1 -0
- package/lib-commonjs/utils/getBoundary.js +1 -1
- package/lib-commonjs/utils/getBoundary.js.map +1 -1
- package/lib-commonjs/utils/getPopperOffset.js +54 -0
- package/lib-commonjs/utils/getPopperOffset.js.map +1 -0
- package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
- package/lib-commonjs/utils/getScrollParent.js.map +1 -1
- package/lib-commonjs/utils/index.js +2 -2
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/mergeArrowOffset.js +24 -22
- package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
- package/lib-commonjs/utils/parsePopperPlacement.js +23 -0
- package/lib-commonjs/utils/parsePopperPlacement.js.map +1 -0
- package/lib-commonjs/utils/positioningHelper.js.map +1 -1
- package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
- package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
- package/package.json +6 -8
- package/lib/usePopper.js.map +0 -1
- package/lib/usePopperMouseTarget.js.map +0 -1
- package/lib/utils/getBasePlacement.js +0 -10
- package/lib/utils/getBasePlacement.js.map +0 -1
- package/lib-commonjs/usePopper.js.map +0 -1
- package/lib-commonjs/usePopperMouseTarget.js.map +0 -1
- package/lib-commonjs/utils/getBasePlacement.js +0 -19
- package/lib-commonjs/utils/getBasePlacement.js.map +0 -1
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,183 @@
|
|
2
2
|
"name": "@fluentui/react-positioning",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Thu, 14 Jul 2022 17:03:30 GMT",
|
6
|
+
"tag": "@fluentui/react-positioning_v9.1.0",
|
7
|
+
"version": "9.1.0",
|
8
|
+
"comments": {
|
9
|
+
"minor": [
|
10
|
+
{
|
11
|
+
"author": "lingfangao@hotmail.com",
|
12
|
+
"package": "@fluentui/react-positioning",
|
13
|
+
"commit": "ebfd9b68601cf350cc2eacab25d9d0c580b793ed",
|
14
|
+
"comment": "feat: boundary postitioning options can accept `null`"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "beachball",
|
18
|
+
"package": "@fluentui/react-positioning",
|
19
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.1-0",
|
20
|
+
"commit": "fd9308f35ec9b2c7f7fdbfce62f9a94ca00d6536"
|
21
|
+
}
|
22
|
+
]
|
23
|
+
}
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"date": "Tue, 28 Jun 2022 17:39:51 GMT",
|
27
|
+
"tag": "@fluentui/react-positioning_v9.0.1",
|
28
|
+
"version": "9.0.1",
|
29
|
+
"comments": {
|
30
|
+
"patch": [
|
31
|
+
{
|
32
|
+
"author": "lingfangao@hotmail.com",
|
33
|
+
"package": "@fluentui/react-positioning",
|
34
|
+
"commit": "3deda1fbbfb6ac2b1ad150d4dc6343f1f7fda85b",
|
35
|
+
"comment": "fix: Use caret dependency range for Griffel"
|
36
|
+
}
|
37
|
+
]
|
38
|
+
}
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"date": "Tue, 28 Jun 2022 15:13:51 GMT",
|
42
|
+
"tag": "@fluentui/react-positioning_v9.0.0",
|
43
|
+
"version": "9.0.0",
|
44
|
+
"comments": {
|
45
|
+
"prerelease": [
|
46
|
+
{
|
47
|
+
"author": "lingfangao@hotmail.com",
|
48
|
+
"package": "@fluentui/react-positioning",
|
49
|
+
"commit": "e0aabd850b15adf9c151ebd4e332f7c50ad6cfdf",
|
50
|
+
"comment": "Update 9.0.0-rc dependencies to use caret range"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"author": "lingfangao@hotmail.com",
|
54
|
+
"package": "@fluentui/react-positioning",
|
55
|
+
"commit": "2da4428ae7d6e464c538b7ed10e425ce0e531144",
|
56
|
+
"comment": "chore: Mark teams-prg owned APIs with @internal"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"author": "Humberto.Morimoto@microsoft.com",
|
60
|
+
"package": "@fluentui/react-positioning",
|
61
|
+
"commit": "09f58dcbef2306875046261dc0b7821283ccc287",
|
62
|
+
"comment": "chore: Using ::before and ::after instead of :before and :after."
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"author": "lingfangao@hotmail.com",
|
66
|
+
"package": "@fluentui/react-positioning",
|
67
|
+
"commit": "675acea49c97f10837ddee9b8c4350ca27750125",
|
68
|
+
"comment": "Bump Griffel dependencies"
|
69
|
+
}
|
70
|
+
],
|
71
|
+
"patch": [
|
72
|
+
{
|
73
|
+
"author": "lingfangao@hotmail.com",
|
74
|
+
"package": "@fluentui/react-positioning",
|
75
|
+
"commit": "c7b1348bdad7aa883c29bfbc96ef2a32e6ebc7dd",
|
76
|
+
"comment": "feat: Initial 9.0.0 release"
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"author": "beachball",
|
80
|
+
"package": "@fluentui/react-positioning",
|
81
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.0.0",
|
82
|
+
"commit": "ba6c5d651559b91c815429c9a9357c4d5a390f3e"
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"author": "beachball",
|
86
|
+
"package": "@fluentui/react-positioning",
|
87
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0",
|
88
|
+
"commit": "ba6c5d651559b91c815429c9a9357c4d5a390f3e"
|
89
|
+
},
|
90
|
+
{
|
91
|
+
"author": "beachball",
|
92
|
+
"package": "@fluentui/react-positioning",
|
93
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0",
|
94
|
+
"commit": "ba6c5d651559b91c815429c9a9357c4d5a390f3e"
|
95
|
+
}
|
96
|
+
]
|
97
|
+
}
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"date": "Thu, 23 Jun 2022 14:25:31 GMT",
|
101
|
+
"tag": "@fluentui/react-positioning_v9.0.0-rc.12",
|
102
|
+
"version": "9.0.0-rc.12",
|
103
|
+
"comments": {
|
104
|
+
"prerelease": [
|
105
|
+
{
|
106
|
+
"author": "beachball",
|
107
|
+
"package": "@fluentui/react-positioning",
|
108
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.11",
|
109
|
+
"commit": "b00790b7a0ea1473d8c3cc49c7ca0088002957ed"
|
110
|
+
},
|
111
|
+
{
|
112
|
+
"author": "beachball",
|
113
|
+
"package": "@fluentui/react-positioning",
|
114
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-rc.10",
|
115
|
+
"commit": "b00790b7a0ea1473d8c3cc49c7ca0088002957ed"
|
116
|
+
}
|
117
|
+
]
|
118
|
+
}
|
119
|
+
},
|
120
|
+
{
|
121
|
+
"date": "Tue, 31 May 2022 21:28:42 GMT",
|
122
|
+
"tag": "@fluentui/react-positioning_v9.0.0-rc.11",
|
123
|
+
"version": "9.0.0-rc.11",
|
124
|
+
"comments": {
|
125
|
+
"prerelease": [
|
126
|
+
{
|
127
|
+
"author": "bernardo.sunderhus@gmail.com",
|
128
|
+
"package": "@fluentui/react-positioning",
|
129
|
+
"commit": "335ebfcfd47005003901b5e319782bfe9ccd89fd",
|
130
|
+
"comment": "updates import to react-shared-components"
|
131
|
+
},
|
132
|
+
{
|
133
|
+
"author": "olfedias@microsoft.com",
|
134
|
+
"package": "@fluentui/react-positioning",
|
135
|
+
"commit": "0a5e9fa77a72eecafdd07034ccdc0b95fd49877c",
|
136
|
+
"comment": "chore: Update Griffel to latest version"
|
137
|
+
},
|
138
|
+
{
|
139
|
+
"author": "beachball",
|
140
|
+
"package": "@fluentui/react-positioning",
|
141
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.10",
|
142
|
+
"commit": "335ebfcfd47005003901b5e319782bfe9ccd89fd"
|
143
|
+
},
|
144
|
+
{
|
145
|
+
"author": "beachball",
|
146
|
+
"package": "@fluentui/react-positioning",
|
147
|
+
"comment": "Bump @fluentui/react-utilities to v9.0.0-rc.10",
|
148
|
+
"commit": "335ebfcfd47005003901b5e319782bfe9ccd89fd"
|
149
|
+
}
|
150
|
+
]
|
151
|
+
}
|
152
|
+
},
|
153
|
+
{
|
154
|
+
"date": "Mon, 23 May 2022 18:56:47 GMT",
|
155
|
+
"tag": "@fluentui/react-positioning_v9.0.0-rc.10",
|
156
|
+
"version": "9.0.0-rc.10",
|
157
|
+
"comments": {
|
158
|
+
"prerelease": [
|
159
|
+
{
|
160
|
+
"author": "lingfangao@hotmail.com",
|
161
|
+
"package": "@fluentui/react-positioning",
|
162
|
+
"commit": "5ed22515a7542b432ed694f22606ac3718d501cb",
|
163
|
+
"comment": "BREAKING CHANGE: Encapsulate Popper API"
|
164
|
+
},
|
165
|
+
{
|
166
|
+
"author": "beachball",
|
167
|
+
"package": "@fluentui/react-positioning",
|
168
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.9",
|
169
|
+
"commit": "d4f80b17690e962d6a24e68959608d1ffe84aef6"
|
170
|
+
},
|
171
|
+
{
|
172
|
+
"author": "beachball",
|
173
|
+
"package": "@fluentui/react-positioning",
|
174
|
+
"comment": "Bump @fluentui/react-theme to v9.0.0-rc.9",
|
175
|
+
"commit": "d4f80b17690e962d6a24e68959608d1ffe84aef6"
|
176
|
+
}
|
177
|
+
]
|
178
|
+
}
|
179
|
+
},
|
180
|
+
{
|
181
|
+
"date": "Mon, 23 May 2022 12:13:34 GMT",
|
6
182
|
"tag": "@fluentui/react-positioning_v9.0.0-rc.9",
|
7
183
|
"version": "9.0.0-rc.9",
|
8
184
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,83 @@
|
|
1
1
|
# Change Log - @fluentui/react-positioning
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Thu, 14 Jul 2022 17:03:30 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.1.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.1.0)
|
8
|
+
|
9
|
+
Thu, 14 Jul 2022 17:03:30 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.1..@fluentui/react-positioning_v9.1.0)
|
11
|
+
|
12
|
+
### Minor changes
|
13
|
+
|
14
|
+
- feat: boundary postitioning options can accept `null` ([PR #23839](https://github.com/microsoft/fluentui/pull/23839) by lingfangao@hotmail.com)
|
15
|
+
- Bump @fluentui/react-utilities to v9.0.1-0 ([PR #23909](https://github.com/microsoft/fluentui/pull/23909) by beachball)
|
16
|
+
|
17
|
+
## [9.0.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.1)
|
18
|
+
|
19
|
+
Tue, 28 Jun 2022 17:39:51 GMT
|
20
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0..@fluentui/react-positioning_v9.0.1)
|
21
|
+
|
22
|
+
### Patches
|
23
|
+
|
24
|
+
- fix: Use caret dependency range for Griffel ([PR #23754](https://github.com/microsoft/fluentui/pull/23754) by lingfangao@hotmail.com)
|
25
|
+
|
26
|
+
## [9.0.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0)
|
27
|
+
|
28
|
+
Tue, 28 Jun 2022 15:13:51 GMT
|
29
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-rc.12..@fluentui/react-positioning_v9.0.0)
|
30
|
+
|
31
|
+
### Patches
|
32
|
+
|
33
|
+
- feat: Initial 9.0.0 release ([PR #23733](https://github.com/microsoft/fluentui/pull/23733) by lingfangao@hotmail.com)
|
34
|
+
- Bump @fluentui/react-shared-contexts to v9.0.0 ([commit](https://github.com/microsoft/fluentui/commit/ba6c5d651559b91c815429c9a9357c4d5a390f3e) by beachball)
|
35
|
+
- Bump @fluentui/react-theme to v9.0.0 ([commit](https://github.com/microsoft/fluentui/commit/ba6c5d651559b91c815429c9a9357c4d5a390f3e) by beachball)
|
36
|
+
- Bump @fluentui/react-utilities to v9.0.0 ([commit](https://github.com/microsoft/fluentui/commit/ba6c5d651559b91c815429c9a9357c4d5a390f3e) by beachball)
|
37
|
+
|
38
|
+
### Changes
|
39
|
+
|
40
|
+
- Update 9.0.0-rc dependencies to use caret range ([PR #23732](https://github.com/microsoft/fluentui/pull/23732) by lingfangao@hotmail.com)
|
41
|
+
- chore: Mark teams-prg owned APIs with @internal ([PR #23689](https://github.com/microsoft/fluentui/pull/23689) by lingfangao@hotmail.com)
|
42
|
+
- chore: Using ::before and ::after instead of :before and :after. ([PR #23469](https://github.com/microsoft/fluentui/pull/23469) by Humberto.Morimoto@microsoft.com)
|
43
|
+
- Bump Griffel dependencies ([PR #23688](https://github.com/microsoft/fluentui/pull/23688) by lingfangao@hotmail.com)
|
44
|
+
|
45
|
+
## [9.0.0-rc.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0-rc.12)
|
46
|
+
|
47
|
+
Thu, 23 Jun 2022 14:25:31 GMT
|
48
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-rc.11..@fluentui/react-positioning_v9.0.0-rc.12)
|
49
|
+
|
50
|
+
### Changes
|
51
|
+
|
52
|
+
- Bump @fluentui/react-shared-contexts to v9.0.0-rc.11 ([PR #23608](https://github.com/microsoft/fluentui/pull/23608) by beachball)
|
53
|
+
- Bump @fluentui/react-theme to v9.0.0-rc.10 ([PR #23608](https://github.com/microsoft/fluentui/pull/23608) by beachball)
|
54
|
+
|
55
|
+
## [9.0.0-rc.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0-rc.11)
|
56
|
+
|
57
|
+
Tue, 31 May 2022 21:28:42 GMT
|
58
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-rc.10..@fluentui/react-positioning_v9.0.0-rc.11)
|
59
|
+
|
60
|
+
### Changes
|
61
|
+
|
62
|
+
- updates import to react-shared-components ([PR #23325](https://github.com/microsoft/fluentui/pull/23325) by bernardo.sunderhus@gmail.com)
|
63
|
+
- chore: Update Griffel to latest version ([PR #23275](https://github.com/microsoft/fluentui/pull/23275) by olfedias@microsoft.com)
|
64
|
+
- Bump @fluentui/react-shared-contexts to v9.0.0-rc.10 ([PR #23325](https://github.com/microsoft/fluentui/pull/23325) by beachball)
|
65
|
+
- Bump @fluentui/react-utilities to v9.0.0-rc.10 ([PR #23325](https://github.com/microsoft/fluentui/pull/23325) by beachball)
|
66
|
+
|
67
|
+
## [9.0.0-rc.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0-rc.10)
|
68
|
+
|
69
|
+
Mon, 23 May 2022 18:56:47 GMT
|
70
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-rc.9..@fluentui/react-positioning_v9.0.0-rc.10)
|
71
|
+
|
72
|
+
### Changes
|
73
|
+
|
74
|
+
- BREAKING CHANGE: Encapsulate Popper API ([PR #23092](https://github.com/microsoft/fluentui/pull/23092) by lingfangao@hotmail.com)
|
75
|
+
- Bump @fluentui/react-shared-contexts to v9.0.0-rc.9 ([PR #23146](https://github.com/microsoft/fluentui/pull/23146) by beachball)
|
76
|
+
- Bump @fluentui/react-theme to v9.0.0-rc.9 ([PR #23146](https://github.com/microsoft/fluentui/pull/23146) by beachball)
|
77
|
+
|
7
78
|
## [9.0.0-rc.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0-rc.9)
|
8
79
|
|
9
|
-
Mon, 23 May 2022 12:
|
80
|
+
Mon, 23 May 2022 12:13:34 GMT
|
10
81
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-rc.8..@fluentui/react-positioning_v9.0.0-rc.9)
|
11
82
|
|
12
83
|
### Changes
|
package/dist/index.d.ts
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
import type { GriffelStyle } from '@griffel/react';
|
2
|
-
import * as PopperJs from '@popperjs/core';
|
3
2
|
import * as React_2 from 'react';
|
4
3
|
|
5
4
|
export declare type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';
|
6
5
|
|
7
6
|
export declare type AutoSize = 'height' | 'height-always' | 'width' | 'width-always' | 'always' | boolean;
|
8
7
|
|
9
|
-
export declare type Boundary =
|
8
|
+
export declare type Boundary = HTMLElement | Array<HTMLElement> | 'clippingParents' | 'scrollParent' | 'window';
|
10
9
|
|
11
10
|
/**
|
11
|
+
* @internal
|
12
12
|
* Creates CSS styles to size the arrow created by createArrowStyles to the given height.
|
13
13
|
*
|
14
14
|
* Use this when you need to create classes for several different arrow sizes. If you only need a
|
@@ -20,6 +20,7 @@ export declare function createArrowHeightStyles(arrowHeight: number): {
|
|
20
20
|
};
|
21
21
|
|
22
22
|
/**
|
23
|
+
* @internal
|
23
24
|
* Helper that creates a makeStyles rule for an arrow element.
|
24
25
|
* For runtime arrow size toggling simply create extra classnames to apply to the arrow element
|
25
26
|
*
|
@@ -44,6 +45,7 @@ export declare function createArrowHeightStyles(arrowHeight: number): {
|
|
44
45
|
export declare function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle;
|
45
46
|
|
46
47
|
/**
|
48
|
+
* @internal
|
47
49
|
* Options parameter for the createArrowStyles function
|
48
50
|
*/
|
49
51
|
export declare type CreateArrowStylesOptions = {
|
@@ -78,9 +80,10 @@ export declare type CreateArrowStylesOptions = {
|
|
78
80
|
* Creates a virtual element based on the position of a click event
|
79
81
|
* Can be used as a target for popper in scenarios such as context menus
|
80
82
|
*/
|
81
|
-
export declare function createVirtualElementFromClick(nativeEvent: MouseEvent):
|
83
|
+
export declare function createVirtualElementFromClick(nativeEvent: MouseEvent): PositioningVirtualElement;
|
82
84
|
|
83
85
|
/**
|
86
|
+
* @internal
|
84
87
|
* Generally when adding an arrow to popper, it's necessary to offset the position of the popper by the
|
85
88
|
* height of the arrow. A simple utility to merge a provided offset with an arrow height to return the final offset
|
86
89
|
*
|
@@ -90,23 +93,46 @@ export declare function createVirtualElementFromClick(nativeEvent: MouseEvent):
|
|
90
93
|
*/
|
91
94
|
export declare function mergeArrowOffset(userOffset: Offset | undefined | null, arrowHeight: number): Offset;
|
92
95
|
|
93
|
-
export declare type Offset = OffsetFunction |
|
96
|
+
export declare type Offset = OffsetFunction | OffsetObject | OffsetShorthand;
|
94
97
|
|
95
|
-
export declare type OffsetFunction = (param: OffsetFunctionParam) =>
|
98
|
+
export declare type OffsetFunction = (param: OffsetFunctionParam) => OffsetObject | OffsetShorthand;
|
96
99
|
|
97
100
|
export declare type OffsetFunctionParam = {
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
+
positionedRect: Rect;
|
102
|
+
targetRect: Rect;
|
103
|
+
position: Position;
|
104
|
+
alignment?: Alignment;
|
101
105
|
};
|
102
106
|
|
103
|
-
export declare
|
107
|
+
export declare type OffsetObject = {
|
108
|
+
crossAxis?: number;
|
109
|
+
mainAxis: number;
|
110
|
+
};
|
111
|
+
|
112
|
+
export declare type OffsetShorthand = number;
|
113
|
+
|
114
|
+
export declare type Position = 'above' | 'below' | 'before' | 'after';
|
115
|
+
|
116
|
+
export declare type PositioningImperativeRef = {
|
117
|
+
/**
|
118
|
+
* Updates the position imperatively.
|
119
|
+
* Useful when the position of the target changes from other factors than scrolling of window resize.
|
120
|
+
*/
|
121
|
+
updatePosition: () => void;
|
122
|
+
/**
|
123
|
+
* Sets the target and updates positioning imperatively.
|
124
|
+
* Useful for avoiding double renders with the target option.
|
125
|
+
*/
|
126
|
+
setTarget: (target: HTMLElement | PositioningVirtualElement) => void;
|
127
|
+
};
|
128
|
+
|
129
|
+
declare interface PositioningOptions {
|
104
130
|
/** Alignment for the component. Only has an effect if used with the @see position option */
|
105
131
|
align?: Alignment;
|
106
|
-
/** The element which will define the boundaries of the
|
107
|
-
flipBoundary?: Boundary;
|
108
|
-
/** The element which will define the boundaries of the
|
109
|
-
overflowBoundary?: Boundary;
|
132
|
+
/** The element which will define the boundaries of the positioned element for the flip behavior. */
|
133
|
+
flipBoundary?: Boundary | null;
|
134
|
+
/** The element which will define the boundaries of the positioned element for the overflow behavior. */
|
135
|
+
overflowBoundary?: Boundary | null;
|
110
136
|
/**
|
111
137
|
* Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')
|
112
138
|
* and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'
|
@@ -115,12 +141,12 @@ export declare interface PopperOptions {
|
|
115
141
|
*/
|
116
142
|
position?: Position;
|
117
143
|
/**
|
118
|
-
* Enables the
|
144
|
+
* Enables the position element to be positioned with 'fixed' (default value is position: 'absolute')
|
119
145
|
* @default false
|
120
146
|
*/
|
121
147
|
positionFixed?: boolean;
|
122
148
|
/**
|
123
|
-
* Lets you displace a
|
149
|
+
* Lets you displace a positioned element from its reference element.
|
124
150
|
* This can be useful if you need to apply some margin between them or if you need to fine tune the
|
125
151
|
* position according to some custom logic.
|
126
152
|
*/
|
@@ -131,7 +157,7 @@ export declare interface PopperOptions {
|
|
131
157
|
*/
|
132
158
|
arrowPadding?: number;
|
133
159
|
/**
|
134
|
-
* Applies max-height and max-width on
|
160
|
+
* Applies max-height and max-width on the positioned element to fit it within the available space in viewport.
|
135
161
|
* true enables this for both width and height when overflow happens.
|
136
162
|
* 'always' applies `max-height`/`max-width` regardless of overflow.
|
137
163
|
* 'height' applies `max-height` when overflow happens, and 'width' for `max-width`
|
@@ -148,45 +174,58 @@ export declare interface PopperOptions {
|
|
148
174
|
*/
|
149
175
|
pinned?: boolean;
|
150
176
|
/**
|
151
|
-
* When the reference element or the viewport is outside viewport allows a
|
177
|
+
* When the reference element or the viewport is outside viewport allows a positioned element to be fully in viewport.
|
152
178
|
* "all" enables this behavior for all axis.
|
153
179
|
*/
|
154
180
|
unstable_disableTether?: boolean | 'all';
|
155
181
|
}
|
156
182
|
|
157
|
-
export declare
|
158
|
-
/**
|
159
|
-
* Updates the position of the popper imperatively.
|
160
|
-
* Useful when the position of the target changes from other factors than scrolling of window resize.
|
161
|
-
*/
|
162
|
-
updatePosition: () => void;
|
163
|
-
/**
|
164
|
-
* Sets the target and updates positioning imperatively.
|
165
|
-
* Useful for avoiding double renders with the target option.
|
166
|
-
*/
|
167
|
-
setTarget: (target: HTMLElement | PopperVirtualElement) => void;
|
168
|
-
};
|
169
|
-
|
170
|
-
export declare type PopperVirtualElement = PopperJs.VirtualElement;
|
171
|
-
|
172
|
-
export declare type Position = 'above' | 'below' | 'before' | 'after';
|
173
|
-
|
174
|
-
export declare interface PositioningProps extends Omit<PopperOptions, 'positionFixed' | 'unstable_disableTether'> {
|
183
|
+
export declare interface PositioningProps extends Omit<PositioningOptions, 'positionFixed' | 'unstable_disableTether'> {
|
175
184
|
/** An imperative handle to Popper methods. */
|
176
|
-
|
185
|
+
positioningRef?: React_2.Ref<PositioningImperativeRef>;
|
177
186
|
/**
|
178
|
-
* Manual override for
|
187
|
+
* Manual override for the target element. Useful for scenarios where a component accepts user prop to override target
|
179
188
|
*/
|
180
|
-
target?: HTMLElement |
|
189
|
+
target?: HTMLElement | PositioningVirtualElement | null;
|
181
190
|
}
|
182
191
|
|
183
192
|
export declare type PositioningShorthand = PositioningProps | PositioningShorthandValue;
|
184
193
|
|
185
194
|
export declare type PositioningShorthandValue = 'above' | 'above-start' | 'above-end' | 'below' | 'below-start' | 'below-end' | 'before' | 'before-top' | 'before-bottom' | 'after' | 'after-top' | 'after-bottom';
|
186
195
|
|
196
|
+
export declare type PositioningVirtualElement = {
|
197
|
+
getBoundingClientRect: () => {
|
198
|
+
x: number;
|
199
|
+
y: number;
|
200
|
+
top: number;
|
201
|
+
left: number;
|
202
|
+
bottom: number;
|
203
|
+
right: number;
|
204
|
+
width: number;
|
205
|
+
height: number;
|
206
|
+
};
|
207
|
+
contextElement?: Element;
|
208
|
+
};
|
209
|
+
|
210
|
+
declare type Rect = {
|
211
|
+
width: number;
|
212
|
+
height: number;
|
213
|
+
x: number;
|
214
|
+
y: number;
|
215
|
+
};
|
216
|
+
|
187
217
|
export declare function resolvePositioningShorthand(shorthand: PositioningShorthand | undefined | null): Readonly<PositioningProps>;
|
188
218
|
|
219
|
+
declare interface UsePopperOptions extends PositioningProps {
|
220
|
+
/**
|
221
|
+
* If false, delays Popper's creation.
|
222
|
+
* @default true
|
223
|
+
*/
|
224
|
+
enabled?: boolean;
|
225
|
+
}
|
226
|
+
|
189
227
|
/**
|
228
|
+
* @internal
|
190
229
|
* Exposes Popper positioning API via React hook. Contains few important differences between an official "react-popper"
|
191
230
|
* package:
|
192
231
|
* - style attributes are applied directly on DOM to avoid re-renders
|
@@ -194,13 +233,14 @@ export declare function resolvePositioningShorthand(shorthand: PositioningShorth
|
|
194
233
|
* - contains a specific to React fix related to initial positioning when containers have components with managed focus
|
195
234
|
* to avoid focus jumps
|
196
235
|
*/
|
197
|
-
export declare function
|
236
|
+
export declare function usePositioning(options?: UsePopperOptions): {
|
198
237
|
targetRef: React_2.MutableRefObject<any>;
|
199
238
|
containerRef: React_2.MutableRefObject<any>;
|
200
239
|
arrowRef: React_2.MutableRefObject<any>;
|
201
240
|
};
|
202
241
|
|
203
242
|
/**
|
243
|
+
* @internal
|
204
244
|
* A state hook that manages a popper virtual element from mouseevents.
|
205
245
|
* Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)
|
206
246
|
* React synthetic events are not persisted by this hook
|
@@ -208,14 +248,6 @@ export declare function usePopper(options?: UsePopperOptions): {
|
|
208
248
|
* @param initialState - initializes a user provided state similare to useState
|
209
249
|
* @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events
|
210
250
|
*/
|
211
|
-
export declare const
|
212
|
-
|
213
|
-
declare interface UsePopperOptions extends PositioningProps {
|
214
|
-
/**
|
215
|
-
* If false, delays Popper's creation.
|
216
|
-
* @default true
|
217
|
-
*/
|
218
|
-
enabled?: boolean;
|
219
|
-
}
|
251
|
+
export declare const usePositioningMouseTarget: (initialState?: PositioningVirtualElement | (() => PositioningVirtualElement) | undefined) => readonly [PositioningVirtualElement | undefined, (event: React_2.MouseEvent | MouseEvent | undefined | null) => void];
|
220
252
|
|
221
253
|
export { }
|
package/lib/createArrowStyles.js
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import { shorthands } from '@griffel/react';
|
2
2
|
import { tokens } from '@fluentui/react-theme';
|
3
3
|
/**
|
4
|
+
* @internal
|
4
5
|
* Helper that creates a makeStyles rule for an arrow element.
|
5
6
|
* For runtime arrow size toggling simply create extra classnames to apply to the arrow element
|
6
7
|
*
|
@@ -36,7 +37,7 @@ export function createArrowStyles(options) {
|
|
36
37
|
visibility: 'hidden',
|
37
38
|
zIndex: -1,
|
38
39
|
...(arrowHeight && createArrowHeightStyles(arrowHeight)),
|
39
|
-
'
|
40
|
+
'::before': {
|
40
41
|
content: '""',
|
41
42
|
visibility: 'visible',
|
42
43
|
position: 'absolute',
|
@@ -69,6 +70,7 @@ export function createArrowStyles(options) {
|
|
69
70
|
};
|
70
71
|
}
|
71
72
|
/**
|
73
|
+
* @internal
|
72
74
|
* Creates CSS styles to size the arrow created by createArrowStyles to the given height.
|
73
75
|
*
|
74
76
|
* Use this when you need to create classes for several different arrow sizes. If you only need a
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["createArrowStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,QAA2B,gBAA3B;AACA,SAAS,MAAT,QAAuB,uBAAvB;
|
1
|
+
{"version":3,"sources":["createArrowStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,QAA2B,gBAA3B;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAsCA;;;;;;;;;;;;;;;;;;;;;;AAsBG;;AACH,OAAM,SAAU,iBAAV,CAA4B,OAA5B,EAA6D;EACjE,MAAM;IACJ,WADI;IAEJ,WAAW,GAAG,KAFV;IAGJ,WAAW,GAAG,OAHV;IAIJ,WAAW,GAAG,MAAM,CAAC;EAJjB,IAKF,OALJ;EAOA,OAAO;IACL,QAAQ,EAAE,UADL;IAEL,eAAe,EAAE,SAFZ;IAGL,UAAU,EAAE,QAHP;IAIL,MAAM,EAAE,CAAC,CAJJ;IAML,IAAI,WAAW,IAAI,uBAAuB,CAAC,WAAD,CAA1C,CANK;IAQL,YAAY;MACV,OAAO,EAAE,IADC;MAEV,UAAU,EAAE,SAFF;MAGV,QAAQ,EAAE,UAHA;MAIV,SAAS,EAAE,YAJD;MAKV,KAAK,EAAE,SALG;MAMV,MAAM,EAAE,SANE;MAOV,eAAe,EAAE,SAPP;MAQV,GAAG,UAAU,CAAC,WAAX,CACD,GAAG,WAAW,gBADb,EAED,GAAG,WAAW,gBAFb,EAGD,GAAG,WAAW,gBAHb,CARO;MAaV,GAAG,UAAU,CAAC,YAAX,CAAwB,WAAxB,EAAqC,WAArC,EAAkD,WAAlD,CAbO;MAcV,uBAAuB,EAAE,MAAM,CAAC,iBAdtB;MAeV,SAAS,EAAE;IAfD,CARP;IA0BL;IACA,2CAA2C;MACzC,MAAM,EAAE,IAAI,WAAW,EADkB;MAEzC,WAAW;IAF8B,CA3BtC;IA+BL,6CAA6C;MAC3C,IAAI,EAAE,IAAI,WAAW,gBADsB;MAE3C,WAAW;IAFgC,CA/BxC;IAmCL,8CAA8C;MAC5C,GAAG,EAAE,IAAI,WAAW,EADwB;MAE5C,WAAW;IAFiC,CAnCzC;IAuCL,4CAA4C;MAC1C,KAAK,EAAE,IAAI,WAAW,gBADoB;MAE1C,WAAW;IAF+B;EAvCvC,CAAP;AA4CD;AAED;;;;;;AAMG;;AACH,OAAM,SAAU,uBAAV,CAAkC,WAAlC,EAAqD;EACzD;EACA;EACA,MAAM,UAAU,GAAG,GAAG,QAAQ,WAAW,IAAzC;EACA,OAAO;IAAE,KAAK,EAAE,UAAT;IAAqB,MAAM,EAAE;EAA7B,CAAP;AACD","sourcesContent":["import { shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { GriffelStyle } from '@griffel/react';\n\n/**\n * @internal\n * Options parameter for the createArrowStyles function\n */\nexport type CreateArrowStylesOptions = {\n /**\n * The height of the arrow from the base to the tip, in px. The base width of the arrow is always twice its height.\n *\n * This can be undefined to leave out the arrow size styles. You must then add styles created by\n * createArrowHeightStyles to set the arrow's size correctly. This can be useful if the arrow can be different sizes.\n */\n arrowHeight: number | undefined;\n\n /**\n * The borderWidth of the arrow. Should be the same borderWidth as the parent element.\n *\n * @defaultvalue 1px\n */\n borderWidth?: GriffelStyle['borderBottomWidth'];\n\n /**\n * The borderStyle for the arrow. Should be the same borderStyle as the parent element.\n *\n * @defaultvalue solid\n */\n borderStyle?: GriffelStyle['borderBottomStyle'];\n\n /**\n * The borderColor of the arrow. Should be the same borderColor as the parent element.\n *\n * @defaultvalue tokens.colorTransparentStroke\n */\n borderColor?: GriffelStyle['borderBottomColor'];\n};\n\n/**\n * @internal\n * Helper that creates a makeStyles rule for an arrow element.\n * For runtime arrow size toggling simply create extra classnames to apply to the arrow element\n *\n * ```ts\n * makeStyles({\n * arrowWithSize: createArrowStyles({ arrowHeight: 6 }),\n *\n * arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),\n * mediumArrow: createArrowHeightStyles(4),\n * smallArrow: createArrowHeightStyles(2),\n * })\n * ...\n *\n * state.arrowWithSize.className = styles.arrowWithSize;\n * state.arrowWithoutSize.className = mergeClasses(\n * styles.arrowWithoutSize,\n * state.smallArrow && styles.smallArrow,\n * state.mediumArrow && styles.mediumArrow,\n * )\n * ```\n */\nexport function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle {\n const {\n arrowHeight,\n borderWidth = '1px',\n borderStyle = 'solid',\n borderColor = tokens.colorTransparentStroke,\n } = options;\n\n return {\n position: 'absolute',\n backgroundColor: 'inherit',\n visibility: 'hidden',\n zIndex: -1,\n\n ...(arrowHeight && createArrowHeightStyles(arrowHeight)),\n\n '::before': {\n content: '\"\"',\n visibility: 'visible',\n position: 'absolute',\n boxSizing: 'border-box',\n width: 'inherit',\n height: 'inherit',\n backgroundColor: 'inherit',\n ...shorthands.borderRight(\n `${borderWidth} /* @noflip */`,\n `${borderStyle} /* @noflip */`,\n `${borderColor} /* @noflip */`,\n ),\n ...shorthands.borderBottom(borderWidth, borderStyle, borderColor),\n borderBottomRightRadius: tokens.borderRadiusSmall,\n transform: 'rotate(var(--angle)) translate(0, 50%) rotate(45deg)',\n },\n\n // Popper sets data-popper-placement on the root element, which is used to align the arrow\n ':global([data-popper-placement^=\"top\"])': {\n bottom: `-${borderWidth}`,\n '--angle': '0',\n },\n ':global([data-popper-placement^=\"right\"])': {\n left: `-${borderWidth} /* @noflip */`,\n '--angle': '90deg',\n },\n ':global([data-popper-placement^=\"bottom\"])': {\n top: `-${borderWidth}`,\n '--angle': '180deg',\n },\n ':global([data-popper-placement^=\"left\"])': {\n right: `-${borderWidth} /* @noflip */`,\n '--angle': '270deg',\n },\n };\n}\n\n/**\n * @internal\n * Creates CSS styles to size the arrow created by createArrowStyles to the given height.\n *\n * Use this when you need to create classes for several different arrow sizes. If you only need a\n * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.\n */\nexport function createArrowHeightStyles(arrowHeight: number) {\n // The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.\n // Multiply the triangle's height by sqrt(2) to get length of its edges.\n const edgeLength = `${1.414 * arrowHeight}px`;\n return { width: edgeLength, height: edgeLength };\n}\n"],"sourceRoot":"../src/"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["createVirtualElementFromClick.ts"],"names":[],"mappings":"AAEA;;;AAGG;AACH,OAAM,SAAU,6BAAV,CAAwC,WAAxC,EAA+D;
|
1
|
+
{"version":3,"sources":["createVirtualElementFromClick.ts"],"names":[],"mappings":"AAEA;;;AAGG;AACH,OAAM,SAAU,6BAAV,CAAwC,WAAxC,EAA+D;EACnE,MAAM,IAAI,GAAG,WAAW,CAAC,OAAzB;EACA,MAAM,GAAG,GAAG,WAAW,CAAC,OAAxB;EACA,MAAM,KAAK,GAAG,IAAI,GAAG,CAArB;EACA,MAAM,MAAM,GAAG,GAAG,GAAG,CAArB;;EAEA,SAAS,qBAAT,GAA8B;IAC5B,OAAO;MACL,IADK;MAEL,GAFK;MAGL,KAHK;MAIL,MAJK;MAKL,CAAC,EAAE,IALE;MAML,CAAC,EAAE,GANE;MAOL,MAAM,EAAE,CAPH;MAQL,KAAK,EAAE;IARF,CAAP;EAUD;;EAED,OAAO;IACL;EADK,CAAP;AAGD","sourcesContent":["import type { PositioningVirtualElement } from './types';\n\n/**\n * Creates a virtual element based on the position of a click event\n * Can be used as a target for popper in scenarios such as context menus\n */\nexport function createVirtualElementFromClick(nativeEvent: MouseEvent): PositioningVirtualElement {\n const left = nativeEvent.clientX;\n const top = nativeEvent.clientY;\n const right = left + 1;\n const bottom = top + 1;\n\n function getBoundingClientRect() {\n return {\n left,\n top,\n right,\n bottom,\n x: left,\n y: top,\n height: 1,\n width: 1,\n };\n }\n\n return {\n getBoundingClientRect,\n };\n}\n"],"sourceRoot":"../src/"}
|
package/lib/index.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
export { createVirtualElementFromClick } from './createVirtualElementFromClick';
|
2
2
|
export { createArrowHeightStyles, createArrowStyles } from './createArrowStyles';
|
3
|
-
export {
|
4
|
-
export {
|
3
|
+
export { usePositioning } from './usePositioning';
|
4
|
+
export { usePositioningMouseTarget } from './usePositioningMouseTarget';
|
5
5
|
export { resolvePositioningShorthand, mergeArrowOffset } from './utils/index';
|
6
6
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEjF,OAAO,EAAE,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEjF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { createVirtualElementFromClick } from './createVirtualElementFromClick';\nexport { createArrowHeightStyles, createArrowStyles } from './createArrowStyles';\nexport type { CreateArrowStylesOptions } from './createArrowStyles';\nexport { usePositioning } from './usePositioning';\nexport { usePositioningMouseTarget } from './usePositioningMouseTarget';\nexport { resolvePositioningShorthand, mergeArrowOffset } from './utils/index';\nexport type {\n Alignment,\n AutoSize,\n Boundary,\n Offset,\n OffsetFunction,\n OffsetFunctionParam,\n OffsetObject,\n OffsetShorthand,\n Position,\n PositioningImperativeRef,\n PositioningProps,\n PositioningShorthand,\n PositioningShorthandValue,\n PositioningVirtualElement,\n} from './types';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["isIntersectingModifier.ts"],"names":[],"mappings":"AAAA,SAAS,cAAT,QAAyC,gBAAzC;AAEA,OAAO,MAAM,sBAAsB,GAA2B;
|
1
|
+
{"version":3,"sources":["isIntersectingModifier.ts"],"names":[],"mappings":"AAAA,SAAS,cAAT,QAAyC,gBAAzC;AAEA,OAAO,MAAM,sBAAsB,GAA2B;EAC5D,IAAI,EAAE,0BADsD;EAE5D,OAAO,EAAE,IAFmD;EAG5D,KAAK,EAAE,MAHqD;EAI5D,QAAQ,EAAE,CAAC,iBAAD,CAJkD;EAK5D,EAAE,EAAE,CAAC;IAAE,KAAF;IAAS;EAAT,CAAD,KAAoB;IACtB,MAAM,UAAU,GAAG,KAAK,CAAC,KAAN,CAAY,MAA/B;IACA,MAAM,iBAAiB,GAAG,cAAc,CAAC,KAAD,EAAQ;MAAE,WAAW,EAAE;IAAf,CAAR,CAAxC;IAEA,MAAM,iBAAiB,GAAG,iBAAiB,CAAC,GAAlB,GAAwB,UAAU,CAAC,MAAnC,IAA6C,iBAAiB,CAAC,GAAlB,GAAwB,CAA/F;IACA,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,MAAlB,GAA2B,UAAU,CAAC,MAAtC,IAAgD,iBAAiB,CAAC,MAAlB,GAA2B,CAAxG;IAEA,MAAM,cAAc,GAAG,iBAAiB,IAAI,oBAA5C;IAEA,KAAK,CAAC,aAAN,CAAoB,IAApB,IAA4B;MAC1B;IAD0B,CAA5B;IAGA,KAAK,CAAC,UAAN,CAAiB,MAAjB,GAA0B,EACxB,GAAG,KAAK,CAAC,UAAN,CAAiB,MADI;MAExB,+BAA+B;IAFP,CAA1B;EAID;AArB2D,CAAvD","sourcesContent":["import { detectOverflow, Modifier } from '@popperjs/core';\n\nexport const isIntersectingModifier: IsIntersectingModifier = {\n name: 'is-intersecting-modifier',\n enabled: true,\n phase: 'main',\n requires: ['preventOverflow'],\n fn: ({ state, name }) => {\n const popperRect = state.rects.popper;\n const popperAltOverflow = detectOverflow(state, { altBoundary: true });\n\n const isIntersectingTop = popperAltOverflow.top < popperRect.height && popperAltOverflow.top > 0;\n const isIntersectingBottom = popperAltOverflow.bottom < popperRect.height && popperAltOverflow.bottom > 0;\n\n const isIntersecting = isIntersectingTop || isIntersectingBottom;\n\n state.modifiersData[name] = {\n isIntersecting,\n };\n state.attributes.popper = {\n ...state.attributes.popper,\n 'data-popper-is-intersecting': isIntersecting,\n };\n },\n};\n\ntype IsIntersectingModifier = Modifier<'is-intersecting-modifier', never>;\n"],"sourceRoot":"../src/"}
|