@fluentui/react-menu 0.0.0-nightlya21bfaceec20220202.1 → 0.0.0-nightlyb2b3ec1da320220209.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +50 -20
- package/CHANGELOG.md +17 -13
- package/dist/react-menu.d.ts +19 -18
- package/lib/components/MenuDivider/MenuDivider.types.d.ts +2 -2
- package/lib/components/MenuGroup/MenuGroup.types.d.ts +2 -2
- package/lib/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
- package/lib/components/MenuItem/MenuItem.types.d.ts +7 -7
- package/lib/components/MenuItem/renderMenuItem.js +5 -5
- package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +4 -4
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js +4 -4
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib/components/MenuList/MenuList.types.d.ts +2 -2
- package/lib/components/MenuPopover/MenuPopover.types.d.ts +2 -2
- package/lib/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +2 -2
- package/lib/components/MenuTrigger/MenuTrigger.d.ts +2 -1
- package/lib/components/MenuTrigger/MenuTrigger.js +4 -4
- package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/MenuTrigger.types.d.ts +2 -2
- package/lib/components/MenuTrigger/useMenuTrigger.d.ts +2 -3
- package/lib/components/MenuTrigger/useMenuTrigger.js +17 -27
- package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib/selectable/useCheckmarkStyles.d.ts +2 -2
- package/lib-commonjs/components/MenuDivider/MenuDivider.types.d.ts +2 -2
- package/lib-commonjs/components/MenuGroup/MenuGroup.types.d.ts +2 -2
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.d.ts +2 -2
- package/lib-commonjs/components/MenuItem/MenuItem.types.d.ts +7 -7
- package/lib-commonjs/components/MenuItem/renderMenuItem.js +5 -5
- package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +4 -4
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +4 -4
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.types.d.ts +2 -2
- package/lib-commonjs/components/MenuPopover/MenuPopover.types.d.ts +2 -2
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.d.ts +2 -2
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.d.ts +2 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +6 -5
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.d.ts +2 -2
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.d.ts +2 -3
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +16 -26
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib-commonjs/selectable/useCheckmarkStyles.d.ts +2 -2
- package/package.json +10 -10
package/CHANGELOG.json
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
"name": "@fluentui/react-menu",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "Wed,
|
|
6
|
-
"tag": "@fluentui/react-menu_v0.0.0-
|
|
7
|
-
"version": "0.0.0-
|
|
5
|
+
"date": "Wed, 09 Feb 2022 04:13:01 GMT",
|
|
6
|
+
"tag": "@fluentui/react-menu_v0.0.0-nightlyb2b3ec1da320220209.1",
|
|
7
|
+
"version": "0.0.0-nightlyb2b3ec1da320220209.1",
|
|
8
8
|
"comments": {
|
|
9
9
|
"prerelease": [
|
|
10
10
|
{
|
|
11
11
|
"author": "email not defined",
|
|
12
12
|
"package": "@fluentui/react-menu",
|
|
13
|
-
"commit": "
|
|
13
|
+
"commit": "066f84c7bef7f4df47448557396199d8b7f26480",
|
|
14
14
|
"comment": "Release nightly v9"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
@@ -31,12 +31,24 @@
|
|
|
31
31
|
"commit": "4f22b6dad04ea37eb53e4af23c73d2de4db512a2",
|
|
32
32
|
"comment": "fix: MenuTrigger should work correctly when `aria-disabled=\"true\"`"
|
|
33
33
|
},
|
|
34
|
+
{
|
|
35
|
+
"author": "olfedias@microsoft.com",
|
|
36
|
+
"package": "@fluentui/react-menu",
|
|
37
|
+
"commit": "b23239743c4f5518bcf7dcad496a36fc16bbd2e5",
|
|
38
|
+
"comment": "update @fluentui/react-icons package"
|
|
39
|
+
},
|
|
34
40
|
{
|
|
35
41
|
"author": "lingfangao@hotmail.com",
|
|
36
42
|
"package": "@fluentui/react-menu",
|
|
37
43
|
"commit": "d2eb57808a403b70845a732a62b55aa64d66b2a0",
|
|
38
44
|
"comment": "Allow `MenuTrigger` to be wrapped by another trigger"
|
|
39
45
|
},
|
|
46
|
+
{
|
|
47
|
+
"author": "olfedias@microsoft.com",
|
|
48
|
+
"package": "@fluentui/react-menu",
|
|
49
|
+
"commit": "aa6cfd8ac825b5a280206808101de549a91094fc",
|
|
50
|
+
"comment": "update types related to trigger (allow only React.ReactElement & null)"
|
|
51
|
+
},
|
|
40
52
|
{
|
|
41
53
|
"author": "behowell@microsoft.com",
|
|
42
54
|
"package": "@fluentui/react-menu",
|
|
@@ -61,6 +73,12 @@
|
|
|
61
73
|
"commit": "7e0933ed386742df28c416e6b3a6903a0c041f28",
|
|
62
74
|
"comment": "update styles to not use CSS shorthands"
|
|
63
75
|
},
|
|
76
|
+
{
|
|
77
|
+
"author": "behowell@microsoft.com",
|
|
78
|
+
"package": "@fluentui/react-menu",
|
|
79
|
+
"commit": "53b01d71e335715fda91b33e3d7bbd9d471d5ed3",
|
|
80
|
+
"comment": "Refactor component Slot typings"
|
|
81
|
+
},
|
|
64
82
|
{
|
|
65
83
|
"author": "lingfangao@hotmail.com",
|
|
66
84
|
"package": "@fluentui/react-menu",
|
|
@@ -79,6 +97,12 @@
|
|
|
79
97
|
"commit": "6c32d0180e89674a46daf795de69e5dc6ca71ef7",
|
|
80
98
|
"comment": "Updating based on removal of functions from makeStyles."
|
|
81
99
|
},
|
|
100
|
+
{
|
|
101
|
+
"author": "behowell@microsoft.com",
|
|
102
|
+
"package": "@fluentui/react-menu",
|
|
103
|
+
"commit": "f30e7585a8d2abd9db06c4076f39a779008b0eca",
|
|
104
|
+
"comment": "Update MenuTrigger and Tooltip to work together"
|
|
105
|
+
},
|
|
82
106
|
{
|
|
83
107
|
"author": "Humberto.Morimoto@microsoft.com",
|
|
84
108
|
"package": "@fluentui/react-menu",
|
|
@@ -130,50 +154,50 @@
|
|
|
130
154
|
{
|
|
131
155
|
"author": "beachball",
|
|
132
156
|
"package": "@fluentui/react-menu",
|
|
133
|
-
"comment": "Bump @fluentui/keyboard-keys to v0.0.0-
|
|
134
|
-
"commit": "
|
|
157
|
+
"comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightlyb2b3ec1da320220209.1",
|
|
158
|
+
"commit": "066f84c7bef7f4df47448557396199d8b7f26480"
|
|
135
159
|
},
|
|
136
160
|
{
|
|
137
161
|
"author": "beachball",
|
|
138
162
|
"package": "@fluentui/react-menu",
|
|
139
|
-
"comment": "Bump @fluentui/react-context-selector to v0.0.0-
|
|
140
|
-
"commit": "
|
|
163
|
+
"comment": "Bump @fluentui/react-context-selector to v0.0.0-nightlyb2b3ec1da320220209.1",
|
|
164
|
+
"commit": "066f84c7bef7f4df47448557396199d8b7f26480"
|
|
141
165
|
},
|
|
142
166
|
{
|
|
143
167
|
"author": "beachball",
|
|
144
168
|
"package": "@fluentui/react-menu",
|
|
145
|
-
"comment": "Bump @fluentui/react-portal to v0.0.0-
|
|
146
|
-
"commit": "
|
|
169
|
+
"comment": "Bump @fluentui/react-portal to v0.0.0-nightlyb2b3ec1da320220209.1",
|
|
170
|
+
"commit": "066f84c7bef7f4df47448557396199d8b7f26480"
|
|
147
171
|
},
|
|
148
172
|
{
|
|
149
173
|
"author": "beachball",
|
|
150
174
|
"package": "@fluentui/react-menu",
|
|
151
|
-
"comment": "Bump @fluentui/react-positioning to v0.0.0-
|
|
152
|
-
"commit": "
|
|
175
|
+
"comment": "Bump @fluentui/react-positioning to v0.0.0-nightlyb2b3ec1da320220209.1",
|
|
176
|
+
"commit": "066f84c7bef7f4df47448557396199d8b7f26480"
|
|
153
177
|
},
|
|
154
178
|
{
|
|
155
179
|
"author": "beachball",
|
|
156
180
|
"package": "@fluentui/react-menu",
|
|
157
|
-
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-
|
|
158
|
-
"commit": "
|
|
181
|
+
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightlyb2b3ec1da320220209.1",
|
|
182
|
+
"commit": "066f84c7bef7f4df47448557396199d8b7f26480"
|
|
159
183
|
},
|
|
160
184
|
{
|
|
161
185
|
"author": "beachball",
|
|
162
186
|
"package": "@fluentui/react-menu",
|
|
163
|
-
"comment": "Bump @fluentui/react-tabster to v0.0.0-
|
|
164
|
-
"commit": "
|
|
187
|
+
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightlyb2b3ec1da320220209.1",
|
|
188
|
+
"commit": "066f84c7bef7f4df47448557396199d8b7f26480"
|
|
165
189
|
},
|
|
166
190
|
{
|
|
167
191
|
"author": "beachball",
|
|
168
192
|
"package": "@fluentui/react-menu",
|
|
169
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-
|
|
170
|
-
"commit": "
|
|
193
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightlyb2b3ec1da320220209.1",
|
|
194
|
+
"commit": "066f84c7bef7f4df47448557396199d8b7f26480"
|
|
171
195
|
},
|
|
172
196
|
{
|
|
173
197
|
"author": "beachball",
|
|
174
198
|
"package": "@fluentui/react-menu",
|
|
175
|
-
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-
|
|
176
|
-
"commit": "
|
|
199
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightlyb2b3ec1da320220209.1",
|
|
200
|
+
"commit": "066f84c7bef7f4df47448557396199d8b7f26480"
|
|
177
201
|
}
|
|
178
202
|
],
|
|
179
203
|
"none": [
|
|
@@ -189,6 +213,12 @@
|
|
|
189
213
|
"commit": "c061e98be4b4a718c72a144a1f60bb5515824612",
|
|
190
214
|
"comment": "remove inline-style-expand-shorthand from tsconfigs"
|
|
191
215
|
},
|
|
216
|
+
{
|
|
217
|
+
"author": "bsunderhus@microsoft.com",
|
|
218
|
+
"package": "@fluentui/react-menu",
|
|
219
|
+
"commit": "c0d4e63ee58e60e2c6674efbacc0783cd520984e",
|
|
220
|
+
"comment": "Updates components with nullRender changes"
|
|
221
|
+
},
|
|
192
222
|
{
|
|
193
223
|
"author": "elcraig@microsoft.com",
|
|
194
224
|
"package": "@fluentui/react-menu",
|
package/CHANGELOG.md
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-menu
|
|
2
2
|
|
|
3
|
-
This log was last generated on Wed,
|
|
3
|
+
This log was last generated on Wed, 09 Feb 2022 04:13:01 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [0.0.0-
|
|
7
|
+
## [0.0.0-nightlyb2b3ec1da320220209.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-menu_v0.0.0-nightlyb2b3ec1da320220209.1)
|
|
8
8
|
|
|
9
|
-
Wed,
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-menu_v9.0.0-beta.5..@fluentui/react-menu_v0.0.0-
|
|
9
|
+
Wed, 09 Feb 2022 04:13:01 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-menu_v9.0.0-beta.5..@fluentui/react-menu_v0.0.0-nightlyb2b3ec1da320220209.1)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
|
-
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/
|
|
14
|
+
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/066f84c7bef7f4df47448557396199d8b7f26480) by email not defined)
|
|
15
15
|
- fix: set `aria-expanded` and `aria-haspopup` values correctly ([PR #20957](https://github.com/microsoft/fluentui/pull/20957) by lingfangao@hotmail.com)
|
|
16
16
|
- fix: Focus on first menu item on click ([PR #20955](https://github.com/microsoft/fluentui/pull/20955) by lingfangao@hotmail.com)
|
|
17
17
|
- fix: MenuTrigger should work correctly when `aria-disabled="true"` ([PR #21349](https://github.com/microsoft/fluentui/pull/21349) by lingfangao@hotmail.com)
|
|
18
|
+
- update @fluentui/react-icons package ([PR #21498](https://github.com/microsoft/fluentui/pull/21498) by olfedias@microsoft.com)
|
|
18
19
|
- Allow `MenuTrigger` to be wrapped by another trigger ([PR #21225](https://github.com/microsoft/fluentui/pull/21225) by lingfangao@hotmail.com)
|
|
20
|
+
- update types related to trigger (allow only React.ReactElement & null) ([PR #21609](https://github.com/microsoft/fluentui/pull/21609) by olfedias@microsoft.com)
|
|
19
21
|
- BREAKING: Rename component hooks add the suffix _unstable, as their API has not been finalized yet ([PR #21365](https://github.com/microsoft/fluentui/pull/21365) by behowell@microsoft.com)
|
|
20
22
|
- Updating packages based on changes to focusIndicator functions to remove functions from makeStyles in @fluentui/react-tabster. ([PR #21035](https://github.com/microsoft/fluentui/pull/21035) by Humberto.Morimoto@microsoft.com)
|
|
21
23
|
- Remove component's shorthandProps array ([PR #21134](https://github.com/microsoft/fluentui/pull/21134) by behowell@microsoft.com)
|
|
22
24
|
- update styles to not use CSS shorthands ([PR #20820](https://github.com/microsoft/fluentui/pull/20820) by olfedias@microsoft.com)
|
|
25
|
+
- Refactor component Slot typings ([PR #21518](https://github.com/microsoft/fluentui/pull/21518) by behowell@microsoft.com)
|
|
23
26
|
- fix: Call `useCheckmarkStyles` in `useMenuItemStyles` ([PR #20956](https://github.com/microsoft/fluentui/pull/20956) by lingfangao@hotmail.com)
|
|
24
27
|
- Updating based on changes to composition types. ([PR #20891](https://github.com/microsoft/fluentui/pull/20891) by Humberto.Morimoto@microsoft.com)
|
|
25
28
|
- Updating based on removal of functions from makeStyles. ([PR #21239](https://github.com/microsoft/fluentui/pull/21239) by Humberto.Morimoto@microsoft.com)
|
|
29
|
+
- Update MenuTrigger and Tooltip to work together ([PR #21495](https://github.com/microsoft/fluentui/pull/21495) by behowell@microsoft.com)
|
|
26
30
|
- Replacing use of functions in makeStyles with direct use of tokens. ([PR #21048](https://github.com/microsoft/fluentui/pull/21048) by Humberto.Morimoto@microsoft.com)
|
|
27
31
|
- use Griffel packages ([PR #21391](https://github.com/microsoft/fluentui/pull/21391) by olfedias@microsoft.com)
|
|
28
32
|
- Apply fontSize styling to icon slot ([PR #21222](https://github.com/microsoft/fluentui/pull/21222) by behowell@microsoft.com)
|
|
@@ -31,14 +35,14 @@ Wed, 02 Feb 2022 04:13:27 GMT
|
|
|
31
35
|
- Updating use of tokens.fontWeight now that we don't need to use casting. ([PR #21217](https://github.com/microsoft/fluentui/pull/21217) by Humberto.Morimoto@microsoft.com)
|
|
32
36
|
- (fix): Update react-icons dependency to latest version ([PR #20943](https://github.com/microsoft/fluentui/pull/20943) by ololubek@microsoft.com)
|
|
33
37
|
- breaking: MenuTrigger must be the first child of the `Menu` ([PR #21096](https://github.com/microsoft/fluentui/pull/21096) by lingfangao@hotmail.com)
|
|
34
|
-
- Bump @fluentui/keyboard-keys to v0.0.0-
|
|
35
|
-
- Bump @fluentui/react-context-selector to v0.0.0-
|
|
36
|
-
- Bump @fluentui/react-portal to v0.0.0-
|
|
37
|
-
- Bump @fluentui/react-positioning to v0.0.0-
|
|
38
|
-
- Bump @fluentui/react-shared-contexts to v0.0.0-
|
|
39
|
-
- Bump @fluentui/react-tabster to v0.0.0-
|
|
40
|
-
- Bump @fluentui/react-utilities to v0.0.0-
|
|
41
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-
|
|
38
|
+
- Bump @fluentui/keyboard-keys to v0.0.0-nightlyb2b3ec1da320220209.1 ([commit](https://github.com/microsoft/fluentui/commit/066f84c7bef7f4df47448557396199d8b7f26480) by beachball)
|
|
39
|
+
- Bump @fluentui/react-context-selector to v0.0.0-nightlyb2b3ec1da320220209.1 ([commit](https://github.com/microsoft/fluentui/commit/066f84c7bef7f4df47448557396199d8b7f26480) by beachball)
|
|
40
|
+
- Bump @fluentui/react-portal to v0.0.0-nightlyb2b3ec1da320220209.1 ([commit](https://github.com/microsoft/fluentui/commit/066f84c7bef7f4df47448557396199d8b7f26480) by beachball)
|
|
41
|
+
- Bump @fluentui/react-positioning to v0.0.0-nightlyb2b3ec1da320220209.1 ([commit](https://github.com/microsoft/fluentui/commit/066f84c7bef7f4df47448557396199d8b7f26480) by beachball)
|
|
42
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightlyb2b3ec1da320220209.1 ([commit](https://github.com/microsoft/fluentui/commit/066f84c7bef7f4df47448557396199d8b7f26480) by beachball)
|
|
43
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightlyb2b3ec1da320220209.1 ([commit](https://github.com/microsoft/fluentui/commit/066f84c7bef7f4df47448557396199d8b7f26480) by beachball)
|
|
44
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightlyb2b3ec1da320220209.1 ([commit](https://github.com/microsoft/fluentui/commit/066f84c7bef7f4df47448557396199d8b7f26480) by beachball)
|
|
45
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightlyb2b3ec1da320220209.1 ([commit](https://github.com/microsoft/fluentui/commit/066f84c7bef7f4df47448557396199d8b7f26480) by beachball)
|
|
42
46
|
|
|
43
47
|
## [9.0.0-beta.5](https://github.com/microsoft/fluentui/tree/@fluentui/react-menu_v9.0.0-beta.5)
|
|
44
48
|
|
package/dist/react-menu.d.ts
CHANGED
|
@@ -2,10 +2,11 @@ import { ComponentProps } from '@fluentui/react-utilities';
|
|
|
2
2
|
import { ComponentState } from '@fluentui/react-utilities';
|
|
3
3
|
import type { Context } from '@fluentui/react-context-selector';
|
|
4
4
|
import type { ContextSelector } from '@fluentui/react-context-selector';
|
|
5
|
+
import type { FluentTriggerComponent } from '@fluentui/react-utilities';
|
|
5
6
|
import type { ForwardRefComponent } from '@fluentui/react-utilities';
|
|
6
|
-
import type { IntrinsicSlotProps } from '@fluentui/react-utilities';
|
|
7
7
|
import { PositioningShorthand } from '@fluentui/react-positioning';
|
|
8
8
|
import * as React_2 from 'react';
|
|
9
|
+
import type { Slot } from '@fluentui/react-utilities';
|
|
9
10
|
import { usePopperMouseTarget } from '@fluentui/react-positioning';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -82,7 +83,7 @@ export declare const menuDividerClassName = "fui-MenuDivider";
|
|
|
82
83
|
export declare type MenuDividerProps = ComponentProps<MenuDividerSlots>;
|
|
83
84
|
|
|
84
85
|
export declare type MenuDividerSlots = {
|
|
85
|
-
root:
|
|
86
|
+
root: Slot<'div'>;
|
|
86
87
|
};
|
|
87
88
|
|
|
88
89
|
export declare type MenuDividerState = ComponentState<MenuDividerSlots>;
|
|
@@ -121,7 +122,7 @@ export declare const menuGroupHeaderClassName = "fui-MenuGroupHeader";
|
|
|
121
122
|
export declare type MenuGroupHeaderProps = ComponentProps<MenuGroupHeaderSlots>;
|
|
122
123
|
|
|
123
124
|
export declare type MenuGroupHeaderSlots = {
|
|
124
|
-
root:
|
|
125
|
+
root: Slot<'div'>;
|
|
125
126
|
};
|
|
126
127
|
|
|
127
128
|
export declare type MenuGroupHeaderState = ComponentState<MenuGroupHeaderSlots>;
|
|
@@ -129,7 +130,7 @@ export declare type MenuGroupHeaderState = ComponentState<MenuGroupHeaderSlots>;
|
|
|
129
130
|
export declare type MenuGroupProps = ComponentProps<MenuGroupSlots>;
|
|
130
131
|
|
|
131
132
|
export declare type MenuGroupSlots = {
|
|
132
|
-
root:
|
|
133
|
+
root: Slot<'div'>;
|
|
133
134
|
};
|
|
134
135
|
|
|
135
136
|
export declare type MenuGroupState = ComponentState<MenuGroupSlots> & {
|
|
@@ -220,29 +221,29 @@ export declare type MenuItemSelectableState = MenuItemSelectableProps & {
|
|
|
220
221
|
};
|
|
221
222
|
|
|
222
223
|
export declare type MenuItemSlots = {
|
|
223
|
-
root:
|
|
224
|
+
root: Slot<'div'>;
|
|
224
225
|
/**
|
|
225
226
|
* Icon slot rendered before children content
|
|
226
227
|
*/
|
|
227
|
-
icon?:
|
|
228
|
+
icon?: Slot<'span'>;
|
|
228
229
|
/**
|
|
229
230
|
* A helper slot for alignment when a menu item is used with selectable menuitems
|
|
230
231
|
* Avoid using this slot as a replacement for MenuItemCheckbox and MenuItemRadio components
|
|
231
232
|
*/
|
|
232
|
-
checkmark?:
|
|
233
|
+
checkmark?: Slot<'span'>;
|
|
233
234
|
/**
|
|
234
235
|
* Icon slot that shows the indicator for a submenu
|
|
235
236
|
*/
|
|
236
|
-
submenuIndicator?:
|
|
237
|
+
submenuIndicator?: Slot<'span'>;
|
|
237
238
|
/**
|
|
238
239
|
* Component children are placed in this slot
|
|
239
240
|
* Avoid using the `children` property in this slot in favour of Component children whenever possible
|
|
240
241
|
*/
|
|
241
|
-
content?:
|
|
242
|
+
content?: Slot<'span'>;
|
|
242
243
|
/**
|
|
243
244
|
* Secondary content rendered opposite the primary content (e.g Shortcut text)
|
|
244
245
|
*/
|
|
245
|
-
secondaryContent?:
|
|
246
|
+
secondaryContent?: Slot<'span'>;
|
|
246
247
|
};
|
|
247
248
|
|
|
248
249
|
export declare type MenuItemState = ComponentState<MenuItemSlots> & MenuItemCommons;
|
|
@@ -300,7 +301,7 @@ export declare type MenuListProps = ComponentProps<MenuListSlots> & Partial<Menu
|
|
|
300
301
|
export declare const MenuListProvider: React_2.Provider<MenuListContextValue> & React_2.FC<React_2.ProviderProps<MenuListContextValue>>;
|
|
301
302
|
|
|
302
303
|
export declare type MenuListSlots = {
|
|
303
|
-
root:
|
|
304
|
+
root: Slot<'div'>;
|
|
304
305
|
};
|
|
305
306
|
|
|
306
307
|
export declare type MenuListState = ComponentState<MenuListSlots> & MenuListCommons & {
|
|
@@ -348,7 +349,7 @@ export declare const menuPopoverClassName = "fui-MenuPopover";
|
|
|
348
349
|
export declare type MenuPopoverProps = ComponentProps<MenuPopoverSlots>;
|
|
349
350
|
|
|
350
351
|
export declare type MenuPopoverSlots = {
|
|
351
|
-
root:
|
|
352
|
+
root: Slot<'div'>;
|
|
352
353
|
};
|
|
353
354
|
|
|
354
355
|
/**
|
|
@@ -396,7 +397,7 @@ export declare type MenuSplitGroupCommons = {};
|
|
|
396
397
|
export declare type MenuSplitGroupProps = ComponentProps<MenuSplitGroupSlots> & MenuSplitGroupCommons;
|
|
397
398
|
|
|
398
399
|
export declare type MenuSplitGroupSlots = {
|
|
399
|
-
root:
|
|
400
|
+
root: Slot<'div'>;
|
|
400
401
|
};
|
|
401
402
|
|
|
402
403
|
/**
|
|
@@ -447,7 +448,7 @@ export declare type MenuState = MenuCommons & ComponentState<MenuSlots> & {
|
|
|
447
448
|
* Wraps a trigger element as an only child
|
|
448
449
|
* and adds the necessary event handling to open a popup menu
|
|
449
450
|
*/
|
|
450
|
-
export declare const MenuTrigger: React_2.
|
|
451
|
+
export declare const MenuTrigger: React_2.FC<MenuTriggerProps> & FluentTriggerComponent;
|
|
451
452
|
|
|
452
453
|
/**
|
|
453
454
|
* Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu
|
|
@@ -465,11 +466,11 @@ export declare type MenuTriggerProps = {
|
|
|
465
466
|
*/
|
|
466
467
|
children: (React_2.ReactElement & {
|
|
467
468
|
ref?: React_2.Ref<unknown>;
|
|
468
|
-
}) | ((props: MenuTriggerChildProps) => React_2.
|
|
469
|
+
}) | ((props: MenuTriggerChildProps) => React_2.ReactElement | null);
|
|
469
470
|
};
|
|
470
471
|
|
|
471
472
|
export declare type MenuTriggerState = {
|
|
472
|
-
children: React_2.
|
|
473
|
+
children: React_2.ReactElement | null;
|
|
473
474
|
};
|
|
474
475
|
|
|
475
476
|
/**
|
|
@@ -540,7 +541,7 @@ export declare type UninitializedMenuListState = Omit<MenuListState, 'setFocusBy
|
|
|
540
541
|
*
|
|
541
542
|
* @param state - should contain a `checkmark` slot
|
|
542
543
|
*/
|
|
543
|
-
export declare const useCheckmarkStyles_unstable: (state: MenuItemSelectableState & Pick<
|
|
544
|
+
export declare const useCheckmarkStyles_unstable: (state: MenuItemSelectableState & Pick<MenuItemState, 'checkmark'>) => void;
|
|
544
545
|
|
|
545
546
|
/**
|
|
546
547
|
* Create the state required to render Menu.
|
|
@@ -653,7 +654,7 @@ export declare const useMenuSplitGroupStyles_unstable: (state: MenuSplitGroupSta
|
|
|
653
654
|
*
|
|
654
655
|
* @param props - props from this instance of MenuTrigger
|
|
655
656
|
*/
|
|
656
|
-
export declare const useMenuTrigger_unstable: (props: MenuTriggerProps
|
|
657
|
+
export declare const useMenuTrigger_unstable: (props: MenuTriggerProps) => MenuTriggerState;
|
|
657
658
|
|
|
658
659
|
export declare const useMenuTriggerContext_unstable: () => boolean;
|
|
659
660
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
2
|
export declare type MenuDividerSlots = {
|
|
3
|
-
root:
|
|
3
|
+
root: Slot<'div'>;
|
|
4
4
|
};
|
|
5
5
|
export declare type MenuDividerProps = ComponentProps<MenuDividerSlots>;
|
|
6
6
|
export declare type MenuDividerState = ComponentState<MenuDividerSlots>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
2
|
import type { MenuGroupContextValue } from '../../contexts/menuGroupContext';
|
|
3
3
|
export declare type MenuGroupSlots = {
|
|
4
|
-
root:
|
|
4
|
+
root: Slot<'div'>;
|
|
5
5
|
};
|
|
6
6
|
export declare type MenuGroupProps = ComponentProps<MenuGroupSlots>;
|
|
7
7
|
export declare type MenuGroupState = ComponentState<MenuGroupSlots> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
2
|
export declare type MenuGroupHeaderSlots = {
|
|
3
|
-
root:
|
|
3
|
+
root: Slot<'div'>;
|
|
4
4
|
};
|
|
5
5
|
export declare type MenuGroupHeaderProps = ComponentProps<MenuGroupHeaderSlots>;
|
|
6
6
|
export declare type MenuGroupHeaderState = ComponentState<MenuGroupHeaderSlots>;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
2
|
export declare type MenuItemSlots = {
|
|
3
|
-
root:
|
|
3
|
+
root: Slot<'div'>;
|
|
4
4
|
/**
|
|
5
5
|
* Icon slot rendered before children content
|
|
6
6
|
*/
|
|
7
|
-
icon?:
|
|
7
|
+
icon?: Slot<'span'>;
|
|
8
8
|
/**
|
|
9
9
|
* A helper slot for alignment when a menu item is used with selectable menuitems
|
|
10
10
|
* Avoid using this slot as a replacement for MenuItemCheckbox and MenuItemRadio components
|
|
11
11
|
*/
|
|
12
|
-
checkmark?:
|
|
12
|
+
checkmark?: Slot<'span'>;
|
|
13
13
|
/**
|
|
14
14
|
* Icon slot that shows the indicator for a submenu
|
|
15
15
|
*/
|
|
16
|
-
submenuIndicator?:
|
|
16
|
+
submenuIndicator?: Slot<'span'>;
|
|
17
17
|
/**
|
|
18
18
|
* Component children are placed in this slot
|
|
19
19
|
* Avoid using the `children` property in this slot in favour of Component children whenever possible
|
|
20
20
|
*/
|
|
21
|
-
content?:
|
|
21
|
+
content?: Slot<'span'>;
|
|
22
22
|
/**
|
|
23
23
|
* Secondary content rendered opposite the primary content (e.g Shortcut text)
|
|
24
24
|
*/
|
|
25
|
-
secondaryContent?:
|
|
25
|
+
secondaryContent?: Slot<'span'>;
|
|
26
26
|
};
|
|
27
27
|
declare type MenuItemCommons = {
|
|
28
28
|
/**
|
|
@@ -10,11 +10,11 @@ export const renderMenuItem_unstable = state => {
|
|
|
10
10
|
slotProps
|
|
11
11
|
} = getSlots(state);
|
|
12
12
|
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
|
13
|
-
}, /*#__PURE__*/React.createElement(slots.checkmark, { ...slotProps.checkmark
|
|
14
|
-
}), /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
|
15
|
-
}), /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content
|
|
16
|
-
}), /*#__PURE__*/React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
|
17
|
-
}), /*#__PURE__*/React.createElement(slots.submenuIndicator, { ...slotProps.submenuIndicator
|
|
13
|
+
}, slots.checkmark && /*#__PURE__*/React.createElement(slots.checkmark, { ...slotProps.checkmark
|
|
14
|
+
}), slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
|
15
|
+
}), slots.content && /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content
|
|
16
|
+
}), slots.secondaryContent && /*#__PURE__*/React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
|
17
|
+
}), slots.submenuIndicator && /*#__PURE__*/React.createElement(slots.submenuIndicator, { ...slotProps.submenuIndicator
|
|
18
18
|
}));
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=renderMenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuItem/renderMenuItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;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EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAL7B,CADF;AASD,CAZM","sourceRoot":""}
|
|
@@ -8,10 +8,10 @@ export const renderMenuItemCheckbox_unstable = state => {
|
|
|
8
8
|
slotProps
|
|
9
9
|
} = getSlots(state);
|
|
10
10
|
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
|
11
|
-
}, /*#__PURE__*/React.createElement(slots.checkmark, { ...slotProps.checkmark
|
|
12
|
-
}), /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
|
13
|
-
}), /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content
|
|
14
|
-
}), /*#__PURE__*/React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
|
11
|
+
}, slots.checkmark && /*#__PURE__*/React.createElement(slots.checkmark, { ...slotProps.checkmark
|
|
12
|
+
}), slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
|
13
|
+
}), slots.content && /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content
|
|
14
|
+
}), slots.secondaryContent && /*#__PURE__*/React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
|
15
15
|
}));
|
|
16
16
|
};
|
|
17
17
|
//# sourceMappingURL=renderMenuItemCheckbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuItemCheckbox/renderMenuItemCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAIA;;AACA,OAAO,MAAM,+BAA+B,GAAI,KAAD,IAAiC;AAC9E,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAgB,KAAhB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuItemCheckbox/renderMenuItemCheckbox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAIA;;AACA,OAAO,MAAM,+BAA+B,GAAI,KAAD,IAAiC;AAC9E,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAgB,KAAhB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,SAAN,iBAAmB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,SAAP,EAAgB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAhB,CADtB,EAEG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAFjB,EAGG,KAAK,CAAC,OAAN,iBAAiB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC;AAAf,GAAd,CAHpB,EAIG,KAAK,CAAC,gBAAN,iBAA0B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAJ7B,CADF;AAQD,CAXM","sourceRoot":""}
|
|
@@ -11,10 +11,10 @@ export const renderMenuItemRadio_unstable = state => {
|
|
|
11
11
|
slotProps
|
|
12
12
|
} = getSlots(state);
|
|
13
13
|
return /*#__PURE__*/React.createElement(slots.root, { ...slotProps.root
|
|
14
|
-
}, /*#__PURE__*/React.createElement(slots.checkmark, { ...slotProps.checkmark
|
|
15
|
-
}), /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
|
16
|
-
}), /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content
|
|
17
|
-
}), /*#__PURE__*/React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
|
14
|
+
}, slots.checkmark && /*#__PURE__*/React.createElement(slots.checkmark, { ...slotProps.checkmark
|
|
15
|
+
}), slots.icon && /*#__PURE__*/React.createElement(slots.icon, { ...slotProps.icon
|
|
16
|
+
}), slots.content && /*#__PURE__*/React.createElement(slots.content, { ...slotProps.content
|
|
17
|
+
}), slots.secondaryContent && /*#__PURE__*/React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
|
18
18
|
}));
|
|
19
19
|
};
|
|
20
20
|
//# sourceMappingURL=renderMenuItemRadio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuItemRadio/renderMenuItemRadio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAIA;;;AAGG;;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA8B;AACxE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAgB,KAAhB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuItemRadio/renderMenuItemRadio.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AACA,SAAS,QAAT,QAAyB,2BAAzB;AAIA;;;AAGG;;AACH,OAAO,MAAM,4BAA4B,GAAI,KAAD,IAA8B;AACxE,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,QAAQ,CAAgB,KAAhB,CAArC;AAEA,sBACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,SAAN,iBAAmB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,SAAP,EAAgB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAhB,CADtB,EAEG,KAAK,CAAC,IAAN,iBAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAFjB,EAGG,KAAK,CAAC,OAAN,iBAAiB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC;AAAf,GAAd,CAHpB,EAIG,KAAK,CAAC,gBAAN,iBAA0B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAJ7B,CADF;AAQD,CAXM","sourceRoot":""}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import type { ComponentProps, ComponentState,
|
|
2
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
3
3
|
import type { MenuListContextValue } from '../../contexts/menuListContext';
|
|
4
4
|
import type { SelectableHandler } from '../../selectable/index';
|
|
5
5
|
export declare type MenuCheckedValueChangeEvent = React.MouseEvent | React.KeyboardEvent;
|
|
@@ -35,7 +35,7 @@ export declare type MenuListCommons = {
|
|
|
35
35
|
hasCheckmarks?: boolean;
|
|
36
36
|
};
|
|
37
37
|
export declare type MenuListSlots = {
|
|
38
|
-
root:
|
|
38
|
+
root: Slot<'div'>;
|
|
39
39
|
};
|
|
40
40
|
export declare type MenuListProps = ComponentProps<MenuListSlots> & Partial<MenuListCommons>;
|
|
41
41
|
export declare type MenuListState = ComponentState<MenuListSlots> & MenuListCommons & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
2
|
export declare type MenuPopoverSlots = {
|
|
3
|
-
root:
|
|
3
|
+
root: Slot<'div'>;
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
6
|
* MenuPopover Props
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
2
|
export declare type MenuSplitGroupSlots = {
|
|
3
|
-
root:
|
|
3
|
+
root: Slot<'div'>;
|
|
4
4
|
};
|
|
5
5
|
export declare type MenuSplitGroupCommons = {};
|
|
6
6
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { MenuTriggerProps } from './MenuTrigger.types';
|
|
3
|
+
import type { FluentTriggerComponent } from '@fluentui/react-utilities';
|
|
3
4
|
/**
|
|
4
5
|
* Wraps a trigger element as an only child
|
|
5
6
|
* and adds the necessary event handling to open a popup menu
|
|
6
7
|
*/
|
|
7
|
-
export declare const MenuTrigger: React.
|
|
8
|
+
export declare const MenuTrigger: React.FC<MenuTriggerProps> & FluentTriggerComponent;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { useMenuTrigger_unstable } from './useMenuTrigger';
|
|
3
2
|
import { renderMenuTrigger_unstable } from './renderMenuTrigger';
|
|
4
3
|
/**
|
|
@@ -6,9 +5,10 @@ import { renderMenuTrigger_unstable } from './renderMenuTrigger';
|
|
|
6
5
|
* and adds the necessary event handling to open a popup menu
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
|
-
export const MenuTrigger =
|
|
10
|
-
const state = useMenuTrigger_unstable(props
|
|
8
|
+
export const MenuTrigger = props => {
|
|
9
|
+
const state = useMenuTrigger_unstable(props);
|
|
11
10
|
return renderMenuTrigger_unstable(state);
|
|
12
|
-
}
|
|
11
|
+
};
|
|
13
12
|
MenuTrigger.displayName = 'MenuTrigger';
|
|
13
|
+
MenuTrigger.isFluentTriggerComponent = true;
|
|
14
14
|
//# sourceMappingURL=MenuTrigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":"AACA,SAAS,uBAAT,QAAwC,kBAAxC;AACA,SAAS,0BAAT,QAA2C,qBAA3C;AAIA;;;AAGG;;AACH,OAAO,MAAM,WAAW,GAAwD,KAAK,IAAG;AACtF,QAAM,KAAK,GAAG,uBAAuB,CAAC,KAAD,CAArC;AAEA,SAAO,0BAA0B,CAAC,KAAD,CAAjC;AACD,CAJM;AAMP,WAAW,CAAC,WAAZ,GAA0B,aAA1B;AACA,WAAW,CAAC,wBAAZ,GAAuC,IAAvC","sourceRoot":""}
|
|
@@ -5,7 +5,7 @@ export declare type MenuTriggerProps = {
|
|
|
5
5
|
*/
|
|
6
6
|
children: (React.ReactElement & {
|
|
7
7
|
ref?: React.Ref<unknown>;
|
|
8
|
-
}) | ((props: MenuTriggerChildProps) => React.
|
|
8
|
+
}) | ((props: MenuTriggerChildProps) => React.ReactElement | null);
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu
|
|
@@ -15,5 +15,5 @@ export declare type MenuTriggerChildProps = Required<Pick<React.HTMLAttributes<H
|
|
|
15
15
|
'aria-expanded': boolean | undefined;
|
|
16
16
|
};
|
|
17
17
|
export declare type MenuTriggerState = {
|
|
18
|
-
children: React.
|
|
18
|
+
children: React.ReactElement | null;
|
|
19
19
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';
|
|
1
|
+
import { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';
|
|
3
2
|
/**
|
|
4
3
|
* Create the state required to render MenuTrigger.
|
|
5
4
|
* Clones the only child component and adds necessary event handling behaviours to open a popup menu
|
|
6
5
|
*
|
|
7
6
|
* @param props - props from this instance of MenuTrigger
|
|
8
7
|
*/
|
|
9
|
-
export declare const useMenuTrigger_unstable: (props: MenuTriggerProps
|
|
8
|
+
export declare const useMenuTrigger_unstable: (props: MenuTriggerProps) => MenuTriggerState;
|
|
@@ -4,7 +4,7 @@ import { useIsSubmenu } from '../../utils/useIsSubmenu';
|
|
|
4
4
|
import { useFocusFinders } from '@fluentui/react-tabster';
|
|
5
5
|
import { useFluent } from '@fluentui/react-shared-contexts';
|
|
6
6
|
import { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';
|
|
7
|
-
import {
|
|
7
|
+
import { applyTriggerPropsToChildren, getTriggerChild, useMergedEventCallbacks, useMergedRefs } from '@fluentui/react-utilities';
|
|
8
8
|
import { shouldPreventDefaultOnKeyDown } from '@fluentui/react-utilities';
|
|
9
9
|
/**
|
|
10
10
|
* Create the state required to render MenuTrigger.
|
|
@@ -13,12 +13,11 @@ import { shouldPreventDefaultOnKeyDown } from '@fluentui/react-utilities';
|
|
|
13
13
|
* @param props - props from this instance of MenuTrigger
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
export const useMenuTrigger_unstable =
|
|
17
|
-
var _a;
|
|
16
|
+
export const useMenuTrigger_unstable = props => {
|
|
17
|
+
var _a, _b, _c, _d, _e, _f;
|
|
18
18
|
|
|
19
19
|
const {
|
|
20
|
-
children
|
|
21
|
-
...rest
|
|
20
|
+
children
|
|
22
21
|
} = props;
|
|
23
22
|
const triggerRef = useMenuContext_unstable(context => context.triggerRef);
|
|
24
23
|
const menuPopoverRef = useMenuContext_unstable(context => context.menuPopoverRef);
|
|
@@ -41,7 +40,7 @@ export const useMenuTrigger_unstable = (props, ref) => {
|
|
|
41
40
|
dir
|
|
42
41
|
} = useFluent();
|
|
43
42
|
const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;
|
|
44
|
-
const child = /*#__PURE__*/React.isValidElement(children) ?
|
|
43
|
+
const child = /*#__PURE__*/React.isValidElement(children) ? getTriggerChild(children) : undefined;
|
|
45
44
|
|
|
46
45
|
const onContextMenu = e => {
|
|
47
46
|
if (isTargetDisabled(e)) {
|
|
@@ -149,28 +148,19 @@ export const useMenuTrigger_unstable = (props, ref) => {
|
|
|
149
148
|
}
|
|
150
149
|
};
|
|
151
150
|
|
|
152
|
-
const overrideProps = {
|
|
153
|
-
'aria-haspopup': 'menu',
|
|
154
|
-
'aria-expanded': open,
|
|
155
|
-
id: ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.id) || triggerId,
|
|
156
|
-
onClick,
|
|
157
|
-
onMouseEnter,
|
|
158
|
-
onMouseLeave,
|
|
159
|
-
onKeyDown,
|
|
160
|
-
onContextMenu,
|
|
161
|
-
onMouseMove
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
if (!open && !isSubmenu) {
|
|
165
|
-
overrideProps['aria-expanded'] = undefined;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
151
|
return {
|
|
169
|
-
children:
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
152
|
+
children: applyTriggerPropsToChildren(children, {
|
|
153
|
+
'aria-haspopup': 'menu',
|
|
154
|
+
'aria-expanded': !open && !isSubmenu ? undefined : open,
|
|
155
|
+
id: triggerId,
|
|
156
|
+
...(child === null || child === void 0 ? void 0 : child.props),
|
|
157
|
+
ref: useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref),
|
|
158
|
+
onClick: useMergedEventCallbacks((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onClick, onClick),
|
|
159
|
+
onMouseEnter: useMergedEventCallbacks((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.onMouseEnter, onMouseEnter),
|
|
160
|
+
onMouseLeave: useMergedEventCallbacks((_c = child === null || child === void 0 ? void 0 : child.props) === null || _c === void 0 ? void 0 : _c.onMouseLeave, onMouseLeave),
|
|
161
|
+
onKeyDown: useMergedEventCallbacks((_d = child === null || child === void 0 ? void 0 : child.props) === null || _d === void 0 ? void 0 : _d.onKeyDown, onKeyDown),
|
|
162
|
+
onContextMenu: useMergedEventCallbacks((_e = child === null || child === void 0 ? void 0 : child.props) === null || _e === void 0 ? void 0 : _e.onContextMenu, onContextMenu),
|
|
163
|
+
onMouseMove: useMergedEventCallbacks((_f = child === null || child === void 0 ? void 0 : child.props) === null || _f === void 0 ? void 0 : _f.onMouseMove, onMouseMove)
|
|
174
164
|
})
|
|
175
165
|
};
|
|
176
166
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,uBAAT,QAAwC,4BAAxC;AACA,SAAS,YAAT,QAA6B,0BAA7B;AACA,SAAS,eAAT,QAAgC,yBAAhC;AACA,SAAS,SAAT,QAA0B,iCAA1B;AACA,SAAS,UAAT,EAAqB,SAArB,EAAgC,MAAhC,EAAwC,SAAxC,QAAyD,yBAAzD;AACA,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAZ,MAAuB,OAAvB;AAEA,SAAS,uBAAT,QAAwC,4BAAxC;AACA,SAAS,YAAT,QAA6B,0BAA7B;AACA,SAAS,eAAT,QAAgC,yBAAhC;AACA,SAAS,SAAT,QAA0B,iCAA1B;AACA,SAAS,UAAT,EAAqB,SAArB,EAAgC,MAAhC,EAAwC,SAAxC,QAAyD,yBAAzD;AACA,SACE,2BADF,EAEE,eAFF,EAGE,uBAHF,EAIE,aAJF,QAKO,2BALP;AAMA,SAAS,6BAAT,QAA8C,2BAA9C;AAEA;;;;;AAKG;;AACH,OAAO,MAAM,uBAAuB,GAAI,KAAD,IAA8C;;;AACnF,QAAM;AAAE,IAAA;AAAF,MAAe,KAArB;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ItemSelectableState } from './types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MenuItemState } from '../components/MenuItem/MenuItem.types';
|
|
3
3
|
/**
|
|
4
4
|
* Applies styles to a checkmark slot for selectable menu items
|
|
5
5
|
*
|
|
6
6
|
* @param state - should contain a `checkmark` slot
|
|
7
7
|
*/
|
|
8
|
-
export declare const useCheckmarkStyles_unstable: (state: MenuItemSelectableState & Pick<
|
|
8
|
+
export declare const useCheckmarkStyles_unstable: (state: MenuItemSelectableState & Pick<MenuItemState, 'checkmark'>) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
2
|
export declare type MenuDividerSlots = {
|
|
3
|
-
root:
|
|
3
|
+
root: Slot<'div'>;
|
|
4
4
|
};
|
|
5
5
|
export declare type MenuDividerProps = ComponentProps<MenuDividerSlots>;
|
|
6
6
|
export declare type MenuDividerState = ComponentState<MenuDividerSlots>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
2
|
import type { MenuGroupContextValue } from '../../contexts/menuGroupContext';
|
|
3
3
|
export declare type MenuGroupSlots = {
|
|
4
|
-
root:
|
|
4
|
+
root: Slot<'div'>;
|
|
5
5
|
};
|
|
6
6
|
export declare type MenuGroupProps = ComponentProps<MenuGroupSlots>;
|
|
7
7
|
export declare type MenuGroupState = ComponentState<MenuGroupSlots> & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
2
|
export declare type MenuGroupHeaderSlots = {
|
|
3
|
-
root:
|
|
3
|
+
root: Slot<'div'>;
|
|
4
4
|
};
|
|
5
5
|
export declare type MenuGroupHeaderProps = ComponentProps<MenuGroupHeaderSlots>;
|
|
6
6
|
export declare type MenuGroupHeaderState = ComponentState<MenuGroupHeaderSlots>;
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
2
|
export declare type MenuItemSlots = {
|
|
3
|
-
root:
|
|
3
|
+
root: Slot<'div'>;
|
|
4
4
|
/**
|
|
5
5
|
* Icon slot rendered before children content
|
|
6
6
|
*/
|
|
7
|
-
icon?:
|
|
7
|
+
icon?: Slot<'span'>;
|
|
8
8
|
/**
|
|
9
9
|
* A helper slot for alignment when a menu item is used with selectable menuitems
|
|
10
10
|
* Avoid using this slot as a replacement for MenuItemCheckbox and MenuItemRadio components
|
|
11
11
|
*/
|
|
12
|
-
checkmark?:
|
|
12
|
+
checkmark?: Slot<'span'>;
|
|
13
13
|
/**
|
|
14
14
|
* Icon slot that shows the indicator for a submenu
|
|
15
15
|
*/
|
|
16
|
-
submenuIndicator?:
|
|
16
|
+
submenuIndicator?: Slot<'span'>;
|
|
17
17
|
/**
|
|
18
18
|
* Component children are placed in this slot
|
|
19
19
|
* Avoid using the `children` property in this slot in favour of Component children whenever possible
|
|
20
20
|
*/
|
|
21
|
-
content?:
|
|
21
|
+
content?: Slot<'span'>;
|
|
22
22
|
/**
|
|
23
23
|
* Secondary content rendered opposite the primary content (e.g Shortcut text)
|
|
24
24
|
*/
|
|
25
|
-
secondaryContent?:
|
|
25
|
+
secondaryContent?: Slot<'span'>;
|
|
26
26
|
};
|
|
27
27
|
declare type MenuItemCommons = {
|
|
28
28
|
/**
|
|
@@ -19,11 +19,11 @@ const renderMenuItem_unstable = state => {
|
|
|
19
19
|
slotProps
|
|
20
20
|
} = react_utilities_1.getSlots(state);
|
|
21
21
|
return React.createElement(slots.root, { ...slotProps.root
|
|
22
|
-
}, React.createElement(slots.checkmark, { ...slotProps.checkmark
|
|
23
|
-
}), React.createElement(slots.icon, { ...slotProps.icon
|
|
24
|
-
}), React.createElement(slots.content, { ...slotProps.content
|
|
25
|
-
}), React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
|
26
|
-
}), React.createElement(slots.submenuIndicator, { ...slotProps.submenuIndicator
|
|
22
|
+
}, slots.checkmark && React.createElement(slots.checkmark, { ...slotProps.checkmark
|
|
23
|
+
}), slots.icon && React.createElement(slots.icon, { ...slotProps.icon
|
|
24
|
+
}), slots.content && React.createElement(slots.content, { ...slotProps.content
|
|
25
|
+
}), slots.secondaryContent && React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
|
26
|
+
}), slots.submenuIndicator && React.createElement(slots.submenuIndicator, { ...slotProps.submenuIndicator
|
|
27
27
|
}));
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuItem/renderMenuItem.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,uBAAuB,GAAI,KAAD,IAAyB;AAC9D,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAwB,KAAxB,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuItem/renderMenuItem.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAGA;;AAEG;;;AACI,MAAM,uBAAuB,GAAI,KAAD,IAAyB;AAC9D,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAwB,KAAxB,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,SAAN,IAAmB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,SAAP,EAAgB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAhB,CADtB,EAEG,KAAK,CAAC,IAAN,IAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAFjB,EAGG,KAAK,CAAC,OAAN,IAAiB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC;AAAf,GAAd,CAHpB,EAIG,KAAK,CAAC,gBAAN,IAA0B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAJ7B,EAKG,KAAK,CAAC,gBAAN,IAA0B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAL7B,CADF;AASD,CAZM;;AAAM,OAAA,CAAA,uBAAA,GAAuB,uBAAvB","sourceRoot":""}
|
|
@@ -17,10 +17,10 @@ const renderMenuItemCheckbox_unstable = state => {
|
|
|
17
17
|
slotProps
|
|
18
18
|
} = react_utilities_1.getSlots(state);
|
|
19
19
|
return React.createElement(slots.root, { ...slotProps.root
|
|
20
|
-
}, React.createElement(slots.checkmark, { ...slotProps.checkmark
|
|
21
|
-
}), React.createElement(slots.icon, { ...slotProps.icon
|
|
22
|
-
}), React.createElement(slots.content, { ...slotProps.content
|
|
23
|
-
}), React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
|
20
|
+
}, slots.checkmark && React.createElement(slots.checkmark, { ...slotProps.checkmark
|
|
21
|
+
}), slots.icon && React.createElement(slots.icon, { ...slotProps.icon
|
|
22
|
+
}), slots.content && React.createElement(slots.content, { ...slotProps.content
|
|
23
|
+
}), slots.secondaryContent && React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
|
24
24
|
}));
|
|
25
25
|
};
|
|
26
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuItemCheckbox/renderMenuItemCheckbox.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAIA;;;AACO,MAAM,+BAA+B,GAAI,KAAD,IAAiC;AAC9E,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAwB,KAAxB,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuItemCheckbox/renderMenuItemCheckbox.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAIA;;;AACO,MAAM,+BAA+B,GAAI,KAAD,IAAiC;AAC9E,QAAM;AAAE,IAAA,KAAF;AAAS,IAAA;AAAT,MAAuB,iBAAA,CAAA,QAAA,CAAwB,KAAxB,CAA7B;AAEA,SACE,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,EACG,KAAK,CAAC,SAAN,IAAmB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,SAAP,EAAgB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAhB,CADtB,EAEG,KAAK,CAAC,IAAN,IAAc,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,IAAP,EAAW,EAAA,GAAK,SAAS,CAAC;AAAf,GAAX,CAFjB,EAGG,KAAK,CAAC,OAAN,IAAiB,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,OAAP,EAAc,EAAA,GAAK,SAAS,CAAC;AAAf,GAAd,CAHpB,EAIG,KAAK,CAAC,gBAAN,IAA0B,KAAA,CAAA,aAAA,CAAC,KAAK,CAAC,gBAAP,EAAuB,EAAA,GAAK,SAAS,CAAC;AAAf,GAAvB,CAJ7B,CADF;AAQD,CAXM;;AAAM,OAAA,CAAA,+BAAA,GAA+B,+BAA/B","sourceRoot":""}
|
|
@@ -20,10 +20,10 @@ const renderMenuItemRadio_unstable = state => {
|
|
|
20
20
|
slotProps
|
|
21
21
|
} = react_utilities_1.getSlots(state);
|
|
22
22
|
return React.createElement(slots.root, { ...slotProps.root
|
|
23
|
-
}, React.createElement(slots.checkmark, { ...slotProps.checkmark
|
|
24
|
-
}), React.createElement(slots.icon, { ...slotProps.icon
|
|
25
|
-
}), React.createElement(slots.content, { ...slotProps.content
|
|
26
|
-
}), React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
|
23
|
+
}, slots.checkmark && React.createElement(slots.checkmark, { ...slotProps.checkmark
|
|
24
|
+
}), slots.icon && React.createElement(slots.icon, { ...slotProps.icon
|
|
25
|
+
}), slots.content && React.createElement(slots.content, { ...slotProps.content
|
|
26
|
+
}), slots.secondaryContent && React.createElement(slots.secondaryContent, { ...slotProps.secondaryContent
|
|
27
27
|
}));
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuItemRadio/renderMenuItemRadio.tsx"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,CAAA,OAAA,CAAA;;AACA,MAAA,iBAAA,gBAAA,OAAA,CAAA,2BAAA,CAAA;AAIA;;;AAGG;;;AACI,MAAM,4BAA4B,GAAI,KAAD,IAA8B;AACxE,QAAM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
|
2
|
-
import type { ComponentProps, ComponentState,
|
|
2
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
3
3
|
import type { MenuListContextValue } from '../../contexts/menuListContext';
|
|
4
4
|
import type { SelectableHandler } from '../../selectable/index';
|
|
5
5
|
export declare type MenuCheckedValueChangeEvent = React.MouseEvent | React.KeyboardEvent;
|
|
@@ -35,7 +35,7 @@ export declare type MenuListCommons = {
|
|
|
35
35
|
hasCheckmarks?: boolean;
|
|
36
36
|
};
|
|
37
37
|
export declare type MenuListSlots = {
|
|
38
|
-
root:
|
|
38
|
+
root: Slot<'div'>;
|
|
39
39
|
};
|
|
40
40
|
export declare type MenuListProps = ComponentProps<MenuListSlots> & Partial<MenuListCommons>;
|
|
41
41
|
export declare type MenuListState = ComponentState<MenuListSlots> & MenuListCommons & {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
2
|
export declare type MenuPopoverSlots = {
|
|
3
|
-
root:
|
|
3
|
+
root: Slot<'div'>;
|
|
4
4
|
};
|
|
5
5
|
/**
|
|
6
6
|
* MenuPopover Props
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ComponentProps, ComponentState,
|
|
1
|
+
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
|
2
2
|
export declare type MenuSplitGroupSlots = {
|
|
3
|
-
root:
|
|
3
|
+
root: Slot<'div'>;
|
|
4
4
|
};
|
|
5
5
|
export declare type MenuSplitGroupCommons = {};
|
|
6
6
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import type { MenuTriggerProps } from './MenuTrigger.types';
|
|
3
|
+
import type { FluentTriggerComponent } from '@fluentui/react-utilities';
|
|
3
4
|
/**
|
|
4
5
|
* Wraps a trigger element as an only child
|
|
5
6
|
* and adds the necessary event handling to open a popup menu
|
|
6
7
|
*/
|
|
7
|
-
export declare const MenuTrigger: React.
|
|
8
|
+
export declare const MenuTrigger: React.FC<MenuTriggerProps> & FluentTriggerComponent;
|
|
@@ -5,8 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.MenuTrigger = void 0;
|
|
7
7
|
|
|
8
|
-
const React = /*#__PURE__*/require("react");
|
|
9
|
-
|
|
10
8
|
const useMenuTrigger_1 = /*#__PURE__*/require("./useMenuTrigger");
|
|
11
9
|
|
|
12
10
|
const renderMenuTrigger_1 = /*#__PURE__*/require("./renderMenuTrigger");
|
|
@@ -16,9 +14,12 @@ const renderMenuTrigger_1 = /*#__PURE__*/require("./renderMenuTrigger");
|
|
|
16
14
|
*/
|
|
17
15
|
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
const state = useMenuTrigger_1.useMenuTrigger_unstable(props
|
|
17
|
+
const MenuTrigger = props => {
|
|
18
|
+
const state = useMenuTrigger_1.useMenuTrigger_unstable(props);
|
|
21
19
|
return renderMenuTrigger_1.renderMenuTrigger_unstable(state);
|
|
22
|
-
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.MenuTrigger = MenuTrigger;
|
|
23
23
|
exports.MenuTrigger.displayName = 'MenuTrigger';
|
|
24
|
+
exports.MenuTrigger.isFluentTriggerComponent = true;
|
|
24
25
|
//# sourceMappingURL=MenuTrigger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../src/components/MenuTrigger/MenuTrigger.tsx"],"names":[],"mappings":";;;;;;;AACA,MAAA,gBAAA,gBAAA,OAAA,CAAA,kBAAA,CAAA;;AACA,MAAA,mBAAA,gBAAA,OAAA,CAAA,qBAAA,CAAA;AAIA;;;AAGG;;;AACI,MAAM,WAAW,GAAwD,KAAK,IAAG;AACtF,QAAM,KAAK,GAAG,gBAAA,CAAA,uBAAA,CAAwB,KAAxB,CAAd;AAEA,SAAO,mBAAA,CAAA,0BAAA,CAA2B,KAA3B,CAAP;AACD,CAJM;;AAAM,OAAA,CAAA,WAAA,GAAW,WAAX;AAMb,OAAA,CAAA,WAAA,CAAY,WAAZ,GAA0B,aAA1B;AACA,OAAA,CAAA,WAAA,CAAY,wBAAZ,GAAuC,IAAvC","sourceRoot":""}
|
|
@@ -5,7 +5,7 @@ export declare type MenuTriggerProps = {
|
|
|
5
5
|
*/
|
|
6
6
|
children: (React.ReactElement & {
|
|
7
7
|
ref?: React.Ref<unknown>;
|
|
8
|
-
}) | ((props: MenuTriggerChildProps) => React.
|
|
8
|
+
}) | ((props: MenuTriggerChildProps) => React.ReactElement | null);
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
11
11
|
* Props that are passed to the child of the MenuTrigger when cloned to ensure correct behaviour for the Menu
|
|
@@ -15,5 +15,5 @@ export declare type MenuTriggerChildProps = Required<Pick<React.HTMLAttributes<H
|
|
|
15
15
|
'aria-expanded': boolean | undefined;
|
|
16
16
|
};
|
|
17
17
|
export declare type MenuTriggerState = {
|
|
18
|
-
children: React.
|
|
18
|
+
children: React.ReactElement | null;
|
|
19
19
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';
|
|
1
|
+
import { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';
|
|
3
2
|
/**
|
|
4
3
|
* Create the state required to render MenuTrigger.
|
|
5
4
|
* Clones the only child component and adds necessary event handling behaviours to open a popup menu
|
|
6
5
|
*
|
|
7
6
|
* @param props - props from this instance of MenuTrigger
|
|
8
7
|
*/
|
|
9
|
-
export declare const useMenuTrigger_unstable: (props: MenuTriggerProps
|
|
8
|
+
export declare const useMenuTrigger_unstable: (props: MenuTriggerProps) => MenuTriggerState;
|
|
@@ -28,12 +28,11 @@ const react_utilities_2 = /*#__PURE__*/require("@fluentui/react-utilities");
|
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
const useMenuTrigger_unstable =
|
|
32
|
-
var _a;
|
|
31
|
+
const useMenuTrigger_unstable = props => {
|
|
32
|
+
var _a, _b, _c, _d, _e, _f;
|
|
33
33
|
|
|
34
34
|
const {
|
|
35
|
-
children
|
|
36
|
-
...rest
|
|
35
|
+
children
|
|
37
36
|
} = props;
|
|
38
37
|
const triggerRef = menuContext_1.useMenuContext_unstable(context => context.triggerRef);
|
|
39
38
|
const menuPopoverRef = menuContext_1.useMenuContext_unstable(context => context.menuPopoverRef);
|
|
@@ -56,7 +55,7 @@ const useMenuTrigger_unstable = (props, ref) => {
|
|
|
56
55
|
dir
|
|
57
56
|
} = react_shared_contexts_1.useFluent();
|
|
58
57
|
const OpenArrowKey = dir === 'ltr' ? keyboard_keys_1.ArrowRight : keyboard_keys_1.ArrowLeft;
|
|
59
|
-
const child = React.isValidElement(children) ? react_utilities_1.
|
|
58
|
+
const child = React.isValidElement(children) ? react_utilities_1.getTriggerChild(children) : undefined;
|
|
60
59
|
|
|
61
60
|
const onContextMenu = e => {
|
|
62
61
|
if (isTargetDisabled(e)) {
|
|
@@ -164,28 +163,19 @@ const useMenuTrigger_unstable = (props, ref) => {
|
|
|
164
163
|
}
|
|
165
164
|
};
|
|
166
165
|
|
|
167
|
-
const overrideProps = {
|
|
168
|
-
'aria-haspopup': 'menu',
|
|
169
|
-
'aria-expanded': open,
|
|
170
|
-
id: ((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.id) || triggerId,
|
|
171
|
-
onClick,
|
|
172
|
-
onMouseEnter,
|
|
173
|
-
onMouseLeave,
|
|
174
|
-
onKeyDown,
|
|
175
|
-
onContextMenu,
|
|
176
|
-
onMouseMove
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
if (!open && !isSubmenu) {
|
|
180
|
-
overrideProps['aria-expanded'] = undefined;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
166
|
return {
|
|
184
|
-
children: react_utilities_1.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
167
|
+
children: react_utilities_1.applyTriggerPropsToChildren(children, {
|
|
168
|
+
'aria-haspopup': 'menu',
|
|
169
|
+
'aria-expanded': !open && !isSubmenu ? undefined : open,
|
|
170
|
+
id: triggerId,
|
|
171
|
+
...(child === null || child === void 0 ? void 0 : child.props),
|
|
172
|
+
ref: react_utilities_1.useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref),
|
|
173
|
+
onClick: react_utilities_1.useMergedEventCallbacks((_a = child === null || child === void 0 ? void 0 : child.props) === null || _a === void 0 ? void 0 : _a.onClick, onClick),
|
|
174
|
+
onMouseEnter: react_utilities_1.useMergedEventCallbacks((_b = child === null || child === void 0 ? void 0 : child.props) === null || _b === void 0 ? void 0 : _b.onMouseEnter, onMouseEnter),
|
|
175
|
+
onMouseLeave: react_utilities_1.useMergedEventCallbacks((_c = child === null || child === void 0 ? void 0 : child.props) === null || _c === void 0 ? void 0 : _c.onMouseLeave, onMouseLeave),
|
|
176
|
+
onKeyDown: react_utilities_1.useMergedEventCallbacks((_d = child === null || child === void 0 ? void 0 : child.props) === null || _d === void 0 ? void 0 : _d.onKeyDown, onKeyDown),
|
|
177
|
+
onContextMenu: react_utilities_1.useMergedEventCallbacks((_e = child === null || child === void 0 ? void 0 : child.props) === null || _e === void 0 ? void 0 : _e.onContextMenu, onContextMenu),
|
|
178
|
+
onMouseMove: react_utilities_1.useMergedEventCallbacks((_f = child === null || child === void 0 ? void 0 : child.props) === null || _f === void 0 ? void 0 : _f.onMouseMove, onMouseMove)
|
|
189
179
|
})
|
|
190
180
|
};
|
|
191
181
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/MenuTrigger/useMenuTrigger.ts"],"names":[],"mappings":";;;;;;;AAAA,MAAA,KAAA,gBAAA,OAAA,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
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { MenuItemSelectableState } from './types';
|
|
2
|
-
import type {
|
|
2
|
+
import type { MenuItemState } from '../components/MenuItem/MenuItem.types';
|
|
3
3
|
/**
|
|
4
4
|
* Applies styles to a checkmark slot for selectable menu items
|
|
5
5
|
*
|
|
6
6
|
* @param state - should contain a `checkmark` slot
|
|
7
7
|
*/
|
|
8
|
-
export declare const useCheckmarkStyles_unstable: (state: MenuItemSelectableState & Pick<
|
|
8
|
+
export declare const useCheckmarkStyles_unstable: (state: MenuItemSelectableState & Pick<MenuItemState, 'checkmark'>) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-menu",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-nightlyb2b3ec1da320220209.1",
|
|
4
4
|
"description": "Fluent UI menu component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@fluentui/eslint-plugin": "*",
|
|
31
31
|
"@fluentui/react-conformance": "*",
|
|
32
|
-
"@fluentui/react-conformance-griffel": "0.0.0-
|
|
32
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightlyb2b3ec1da320220209.1",
|
|
33
33
|
"@fluentui/scripts": "^1.0.0",
|
|
34
34
|
"@types/enzyme": "3.10.3",
|
|
35
35
|
"@types/enzyme-adapter-react-16": "1.0.3",
|
|
@@ -43,15 +43,15 @@
|
|
|
43
43
|
"react-test-renderer": "^16.3.0"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@fluentui/keyboard-keys": "0.0.0-
|
|
47
|
-
"@fluentui/react-context-selector": "0.0.0-
|
|
48
|
-
"@fluentui/react-icons": "^2.0.
|
|
46
|
+
"@fluentui/keyboard-keys": "0.0.0-nightlyb2b3ec1da320220209.1",
|
|
47
|
+
"@fluentui/react-context-selector": "0.0.0-nightlyb2b3ec1da320220209.1",
|
|
48
|
+
"@fluentui/react-icons": "^2.0.159-beta.10",
|
|
49
49
|
"@griffel/react": "1.0.0",
|
|
50
|
-
"@fluentui/react-portal": "0.0.0-
|
|
51
|
-
"@fluentui/react-positioning": "0.0.0-
|
|
52
|
-
"@fluentui/react-shared-contexts": "0.0.0-
|
|
53
|
-
"@fluentui/react-tabster": "0.0.0-
|
|
54
|
-
"@fluentui/react-utilities": "0.0.0-
|
|
50
|
+
"@fluentui/react-portal": "0.0.0-nightlyb2b3ec1da320220209.1",
|
|
51
|
+
"@fluentui/react-positioning": "0.0.0-nightlyb2b3ec1da320220209.1",
|
|
52
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightlyb2b3ec1da320220209.1",
|
|
53
|
+
"@fluentui/react-tabster": "0.0.0-nightlyb2b3ec1da320220209.1",
|
|
54
|
+
"@fluentui/react-utilities": "0.0.0-nightlyb2b3ec1da320220209.1",
|
|
55
55
|
"tslib": "^2.1.0"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|