@fluentui/react-menu 9.12.1 → 9.12.3
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +85 -1
- package/CHANGELOG.md +29 -2
- package/lib/components/MenuItem/useMenuItemStyles.styles.js +30 -9
- package/lib/components/MenuItem/useMenuItemStyles.styles.js.map +1 -1
- package/lib/components/MenuTrigger/useMenuTrigger.js +1 -1
- package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.js +94 -22
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.styles.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +1 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/package.json +10 -10
package/CHANGELOG.json
CHANGED
@@ -2,7 +2,91 @@
|
|
2
2
|
"name": "@fluentui/react-menu",
|
3
3
|
"entries": [
|
4
4
|
{
|
5
|
-
"date": "
|
5
|
+
"date": "Fri, 04 Aug 2023 08:48:22 GMT",
|
6
|
+
"tag": "@fluentui/react-menu_v9.12.3",
|
7
|
+
"version": "9.12.3",
|
8
|
+
"comments": {
|
9
|
+
"patch": [
|
10
|
+
{
|
11
|
+
"author": "bernardo.sunderhus@gmail.com",
|
12
|
+
"package": "@fluentui/react-menu",
|
13
|
+
"commit": "44b128284cf90386b75dfba7336e4950428820bf",
|
14
|
+
"comment": "bugfix: disable menu opening if contextmenu event is prevented"
|
15
|
+
},
|
16
|
+
{
|
17
|
+
"author": "beachball",
|
18
|
+
"package": "@fluentui/react-menu",
|
19
|
+
"comment": "Bump @fluentui/react-aria to v9.3.28",
|
20
|
+
"commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"author": "beachball",
|
24
|
+
"package": "@fluentui/react-menu",
|
25
|
+
"comment": "Bump @fluentui/react-context-selector to v9.1.27",
|
26
|
+
"commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"author": "beachball",
|
30
|
+
"package": "@fluentui/react-menu",
|
31
|
+
"comment": "Bump @fluentui/react-portal to v9.3.5",
|
32
|
+
"commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
|
33
|
+
},
|
34
|
+
{
|
35
|
+
"author": "beachball",
|
36
|
+
"package": "@fluentui/react-menu",
|
37
|
+
"comment": "Bump @fluentui/react-positioning to v9.9.2",
|
38
|
+
"commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"author": "beachball",
|
42
|
+
"package": "@fluentui/react-menu",
|
43
|
+
"comment": "Bump @fluentui/react-shared-contexts to v9.7.1",
|
44
|
+
"commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
|
45
|
+
},
|
46
|
+
{
|
47
|
+
"author": "beachball",
|
48
|
+
"package": "@fluentui/react-menu",
|
49
|
+
"comment": "Bump @fluentui/react-tabster to v9.12.0",
|
50
|
+
"commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"author": "beachball",
|
54
|
+
"package": "@fluentui/react-menu",
|
55
|
+
"comment": "Bump @fluentui/react-theme to v9.1.10",
|
56
|
+
"commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
|
57
|
+
},
|
58
|
+
{
|
59
|
+
"author": "beachball",
|
60
|
+
"package": "@fluentui/react-menu",
|
61
|
+
"comment": "Bump @fluentui/react-utilities to v9.11.0",
|
62
|
+
"commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"author": "beachball",
|
66
|
+
"package": "@fluentui/react-menu",
|
67
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.13",
|
68
|
+
"commit": "0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca"
|
69
|
+
}
|
70
|
+
]
|
71
|
+
}
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"date": "Tue, 01 Aug 2023 13:04:24 GMT",
|
75
|
+
"tag": "@fluentui/react-menu_v9.12.2",
|
76
|
+
"version": "9.12.2",
|
77
|
+
"comments": {
|
78
|
+
"patch": [
|
79
|
+
{
|
80
|
+
"author": "yuanboxue@microsoft.com",
|
81
|
+
"package": "@fluentui/react-menu",
|
82
|
+
"commit": "66117c3488dacab0baa7505a97edb308b8ec81b0",
|
83
|
+
"comment": "fix: revert menuItem focus ring back to border"
|
84
|
+
}
|
85
|
+
]
|
86
|
+
}
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"date": "Tue, 01 Aug 2023 10:17:19 GMT",
|
6
90
|
"tag": "@fluentui/react-menu_v9.12.1",
|
7
91
|
"version": "9.12.1",
|
8
92
|
"comments": {
|
package/CHANGELOG.md
CHANGED
@@ -1,12 +1,39 @@
|
|
1
1
|
# Change Log - @fluentui/react-menu
|
2
2
|
|
3
|
-
This log was last generated on
|
3
|
+
This log was last generated on Fri, 04 Aug 2023 08:48:22 GMT and should not be manually modified.
|
4
4
|
|
5
5
|
<!-- Start content -->
|
6
6
|
|
7
|
+
## [9.12.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-menu_v9.12.3)
|
8
|
+
|
9
|
+
Fri, 04 Aug 2023 08:48:22 GMT
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-menu_v9.12.2..@fluentui/react-menu_v9.12.3)
|
11
|
+
|
12
|
+
### Patches
|
13
|
+
|
14
|
+
- bugfix: disable menu opening if contextmenu event is prevented ([PR #28718](https://github.com/microsoft/fluentui/pull/28718) by bernardo.sunderhus@gmail.com)
|
15
|
+
- Bump @fluentui/react-aria to v9.3.28 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
|
16
|
+
- Bump @fluentui/react-context-selector to v9.1.27 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
|
17
|
+
- Bump @fluentui/react-portal to v9.3.5 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
|
18
|
+
- Bump @fluentui/react-positioning to v9.9.2 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
|
19
|
+
- Bump @fluentui/react-shared-contexts to v9.7.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
|
20
|
+
- Bump @fluentui/react-tabster to v9.12.0 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
|
21
|
+
- Bump @fluentui/react-theme to v9.1.10 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
|
22
|
+
- Bump @fluentui/react-utilities to v9.11.0 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
|
23
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.13 ([commit](https://github.com/microsoft/fluentui/commit/0bf7d9438c1d0ff90cd2b28bc4cceb4f807afbca) by beachball)
|
24
|
+
|
25
|
+
## [9.12.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-menu_v9.12.2)
|
26
|
+
|
27
|
+
Tue, 01 Aug 2023 13:04:24 GMT
|
28
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-menu_v9.12.1..@fluentui/react-menu_v9.12.2)
|
29
|
+
|
30
|
+
### Patches
|
31
|
+
|
32
|
+
- fix: revert menuItem focus ring back to border ([PR #28698](https://github.com/microsoft/fluentui/pull/28698) by yuanboxue@microsoft.com)
|
33
|
+
|
7
34
|
## [9.12.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-menu_v9.12.1)
|
8
35
|
|
9
|
-
Tue, 01 Aug 2023 10:
|
36
|
+
Tue, 01 Aug 2023 10:17:19 GMT
|
10
37
|
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-menu_v9.12.0..@fluentui/react-menu_v9.12.1)
|
11
38
|
|
12
39
|
### Patches
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { mergeClasses, __styles, shorthands } from '@griffel/react';
|
2
2
|
import { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';
|
3
|
-
import {
|
3
|
+
import { createFocusOutlineStyle } from '@fluentui/react-tabster';
|
4
4
|
import { tokens } from '@fluentui/react-theme';
|
5
5
|
import { useCheckmarkStyles_unstable } from '../../selectable/index';
|
6
6
|
export const menuItemClassNames = {
|
@@ -15,13 +15,34 @@ const useStyles = /*#__PURE__*/__styles({
|
|
15
15
|
focusIndicator: {
|
16
16
|
Brovlpu: "ftqa4ok",
|
17
17
|
B486eqv: "f2hkw1w",
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
B8q5s1w: "f8hki3x",
|
19
|
+
Bci5o5g: ["f1d2448m", "ffh67wi"],
|
20
|
+
n8qw10: "f1bjia2o",
|
21
|
+
Bdrgwmp: ["ffh67wi", "f1d2448m"],
|
22
|
+
Bm4h7ae: "f15bsgw9",
|
23
|
+
B7ys5i9: "f14e48fq",
|
24
|
+
Busjfv9: "f18yb2kv",
|
25
|
+
Bhk32uz: "fd6o370",
|
26
|
+
Bf4ptjt: "fh1cnn4",
|
27
|
+
kclons: ["fy7oxxb", "f184ne2d"],
|
28
|
+
Bhdgwq3: "fpukqih",
|
29
|
+
Blkhhs4: ["f184ne2d", "fy7oxxb"],
|
30
|
+
Bqtpl0w: "frrh606",
|
31
|
+
clg4pj: ["f1v5zibi", "fo2hd23"],
|
32
|
+
hgwjuy: "ful5kiu",
|
33
|
+
Bonggc9: ["fo2hd23", "f1v5zibi"],
|
34
|
+
B1tsrr9: ["f1jqcqds", "ftffrms"],
|
35
|
+
Dah5zi: ["ftffrms", "f1jqcqds"],
|
36
|
+
Bkh64rk: ["f2e7qr6", "fsr1zz6"],
|
37
|
+
qqdqy8: ["fsr1zz6", "f2e7qr6"],
|
38
|
+
B6dhp37: "f1dvezut",
|
39
|
+
i03rao: ["fd0oaoj", "f1cwg4i8"],
|
40
|
+
Boxcth7: "fjvm52t",
|
41
|
+
Bsom6fd: ["f1cwg4i8", "fd0oaoj"],
|
42
|
+
J0r882: "f57olzd",
|
43
|
+
Bule8hv: ["f4stah7", "fs1por5"],
|
44
|
+
Bjwuhne: "f480a47",
|
45
|
+
Ghsupd: ["fs1por5", "f4stah7"]
|
25
46
|
},
|
26
47
|
root: {
|
27
48
|
Bbmb7ep: ["f1aa9q02", "f16jpd5f"],
|
@@ -96,7 +117,7 @@ const useStyles = /*#__PURE__*/__styles({
|
|
96
117
|
}, {
|
97
118
|
f: [".ftqa4ok:focus{outline-style:none;}", ".fc1cou1:focus{color:var(--colorNeutralForeground3Hover);}", ".ft33916:focus{color:var(--colorNeutralForegroundDisabled);}"],
|
98
119
|
i: [".f2hkw1w:focus-visible{outline-style:none;}"],
|
99
|
-
d: [".
|
120
|
+
d: [".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}", ".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}", ".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}", ".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}", ".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}", ".f14e48fq[data-fui-focus-visible]::after{position:absolute;}", ".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}", ".fd6o370[data-fui-focus-visible]::after{z-index:1;}", ".fh1cnn4[data-fui-focus-visible]::after{border-top-style:solid;}", ".fy7oxxb[data-fui-focus-visible]::after{border-right-style:solid;}", ".f184ne2d[data-fui-focus-visible]::after{border-left-style:solid;}", ".fpukqih[data-fui-focus-visible]::after{border-bottom-style:solid;}", ".frrh606[data-fui-focus-visible]::after{border-top-width:2px;}", ".f1v5zibi[data-fui-focus-visible]::after{border-right-width:2px;}", ".fo2hd23[data-fui-focus-visible]::after{border-left-width:2px;}", ".ful5kiu[data-fui-focus-visible]::after{border-bottom-width:2px;}", ".f1jqcqds[data-fui-focus-visible]::after{border-bottom-right-radius:var(--borderRadiusMedium);}", ".ftffrms[data-fui-focus-visible]::after{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f2e7qr6[data-fui-focus-visible]::after{border-top-right-radius:var(--borderRadiusMedium);}", ".fsr1zz6[data-fui-focus-visible]::after{border-top-left-radius:var(--borderRadiusMedium);}", ".f1dvezut[data-fui-focus-visible]::after{border-top-color:var(--colorStrokeFocus2);}", ".fd0oaoj[data-fui-focus-visible]::after{border-right-color:var(--colorStrokeFocus2);}", ".f1cwg4i8[data-fui-focus-visible]::after{border-left-color:var(--colorStrokeFocus2);}", ".fjvm52t[data-fui-focus-visible]::after{border-bottom-color:var(--colorStrokeFocus2);}", ".f57olzd[data-fui-focus-visible]::after{top:calc(2px * -1);}", ".f4stah7[data-fui-focus-visible]::after{right:calc(2px * -1);}", ".fs1por5[data-fui-focus-visible]::after{left:calc(2px * -1);}", ".f480a47[data-fui-focus-visible]::after{bottom:calc(2px * -1);}", ".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}", ".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}", ".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}", ".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}", ".f10pi13n{position:relative;}", ".fkfq4zb{color:var(--colorNeutralForeground2);}", ".fxugw4r{background-color:var(--colorNeutralBackground1);}", ".f1sgzk6v{padding-right:6px;}", ".f1bg5zqg{padding-left:6px;}", ".f1d2rq10{height:32px;}", ".f1nxs5xn{min-height:32px;}", ".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}", ".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}", ".fkhj508{font-size:var(--fontSizeBase300);}", ".f1k6fduh{cursor:pointer;}", ".f1q8lukm{-webkit-column-gap:4px;column-gap:4px;}", ".f1ma2n7n{row-gap:4px;}", ".f1xqy1su{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}", ".f161knb0{padding-left:2px;}", ".f12huiiw{padding-right:2px;}", ".f3rmtva{background-color:transparent;}", ".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}", ".f11d4kpn{color:var(--colorNeutralForeground3);}", ".f64fuq3{width:20px;}", ".fjamq6b{height:20px;}", ".fe5j1ua{font-size:20px;}", ".fez10in{line-height:0;}", ".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}", ".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}", ".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}"],
|
100
121
|
h: [".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}", ".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}", ".ft1hn21:hover .fui-Icon-filled{display:inline;}", ".fuxngvv:hover .fui-Icon-regular{display:none;}", ".fp258yr:hover .fui-MenuItem__icon{color:var(--colorNeutralForeground2BrandSelected);}", ".f1jp5ecu:hover{color:var(--colorNeutralForeground3Hover);}", ".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}", ".f1ijtazh:hover{background-color:var(--colorNeutralBackground1);}", ".fphbwmw:hover{cursor:not-allowed;}", ".f19vpps7:hover .fui-Icon-filled{display:none;}", ".fv5swzo:hover .fui-Icon-regular{display:inline;}", ".f1q1x1ba:hover .fui-MenuItem__icon{color:var(--colorNeutralForegroundDisabled);}"],
|
101
122
|
m: [["@media (forced-colors: active){.f1dcs8yz{color:GrayText;}}", {
|
102
123
|
m: "(forced-colors: active)"
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["mergeClasses","__styles","shorthands","iconFilledClassName","iconRegularClassName","
|
1
|
+
{"version":3,"names":["mergeClasses","__styles","shorthands","iconFilledClassName","iconRegularClassName","createFocusOutlineStyle","tokens","useCheckmarkStyles_unstable","menuItemClassNames","root","icon","checkmark","submenuIndicator","content","secondaryContent","useStyles","focusIndicator","Brovlpu","B486eqv","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","Bm4h7ae","B7ys5i9","Busjfv9","Bhk32uz","Bf4ptjt","kclons","Bhdgwq3","Blkhhs4","Bqtpl0w","clg4pj","hgwjuy","Bonggc9","B1tsrr9","Dah5zi","Bkh64rk","qqdqy8","B6dhp37","i03rao","Boxcth7","Bsom6fd","J0r882","Bule8hv","Bjwuhne","Ghsupd","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","qhf8xq","sj55zd","De3pzq","z189sj","uwmqm3","Bqenvij","sshi5w","mc9l5x","Bt984gj","Be2twd7","Bceei9c","i8kkvl","Belr9w4","Jwef8y","Bi91k9c","Bk3fhr4","Bmfj8id","Bg7n49j","famaaq","Bh6795r","t0hwav","a9b677","Bg96gwp","Brf1p80","disabled","eoavqd","Bbusuzp","ze5xyy","Bctn1xl","Bh6z0a4","f","i","d","h","m","useMenuItemStyles_unstable","state","styles","className"],"sources":["useMenuItemStyles.styles.js"],"sourcesContent":["import { mergeClasses, makeStyles, shorthands } from '@griffel/react';\nimport { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { useCheckmarkStyles_unstable } from '../../selectable/index';\nexport const menuItemClassNames = {\n root: 'fui-MenuItem',\n icon: 'fui-MenuItem__icon',\n checkmark: 'fui-MenuItem__checkmark',\n submenuIndicator: 'fui-MenuItem__submenuIndicator',\n content: 'fui-MenuItem__content',\n secondaryContent: 'fui-MenuItem__secondaryContent'\n};\nconst useStyles = makeStyles({\n focusIndicator: createFocusOutlineStyle(),\n // TODO: this should be extracted to another package\n root: {\n ...shorthands.borderRadius(tokens.borderRadiusMedium),\n position: 'relative',\n color: tokens.colorNeutralForeground2,\n backgroundColor: tokens.colorNeutralBackground1,\n paddingRight: '6px',\n paddingLeft: '6px',\n height: '32px',\n minHeight: '32px',\n display: 'flex',\n alignItems: 'center',\n fontSize: tokens.fontSizeBase300,\n cursor: 'pointer',\n ...shorthands.gap('4px'),\n ':hover': {\n backgroundColor: tokens.colorNeutralBackground1Hover,\n color: tokens.colorNeutralForeground2Hover,\n [`& .${iconFilledClassName}`]: {\n display: 'inline'\n },\n [`& .${iconRegularClassName}`]: {\n display: 'none'\n },\n [`& .${menuItemClassNames.icon}`]: {\n color: tokens.colorNeutralForeground2BrandSelected\n }\n },\n userSelect: 'none'\n },\n content: {\n paddingLeft: '2px',\n paddingRight: '2px',\n backgroundColor: 'transparent',\n flexGrow: 1\n },\n secondaryContent: {\n paddingLeft: '2px',\n paddingRight: '2px',\n color: tokens.colorNeutralForeground3,\n ':hover': {\n color: tokens.colorNeutralForeground3Hover\n },\n ':focus': {\n color: tokens.colorNeutralForeground3Hover\n }\n },\n icon: {\n width: '20px',\n height: '20px',\n fontSize: '20px',\n lineHeight: 0,\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center'\n },\n submenuIndicator: {\n width: '20px',\n height: '20px',\n fontSize: '20px',\n lineHeight: 0,\n alignItems: 'center',\n display: 'inline-flex',\n justifyContent: 'center'\n },\n disabled: {\n color: tokens.colorNeutralForegroundDisabled,\n ':hover': {\n color: tokens.colorNeutralForegroundDisabled,\n backgroundColor: tokens.colorNeutralBackground1,\n cursor: 'not-allowed',\n [`& .${iconFilledClassName}`]: {\n display: 'none'\n },\n [`& .${iconRegularClassName}`]: {\n display: 'inline'\n },\n [`& .${menuItemClassNames.icon}`]: {\n color: tokens.colorNeutralForegroundDisabled\n }\n },\n ':focus': {\n color: tokens.colorNeutralForegroundDisabled\n },\n '@media (forced-colors: active)': {\n color: 'GrayText',\n ':hover': {\n color: 'GrayText',\n [`& .${menuItemClassNames.icon}`]: {\n color: 'GrayText'\n }\n },\n ':focus': {\n color: 'GrayText'\n }\n }\n }\n});\n/** Applies style classnames to slots */ export const useMenuItemStyles_unstable = (state)=>{\n const styles = useStyles();\n state.root.className = mergeClasses(menuItemClassNames.root, styles.root, styles.focusIndicator, state.disabled && styles.disabled, state.root.className);\n if (state.content) {\n state.content.className = mergeClasses(menuItemClassNames.content, styles.content, state.content.className);\n }\n if (state.checkmark) {\n state.checkmark.className = mergeClasses(menuItemClassNames.checkmark, state.checkmark.className);\n }\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(menuItemClassNames.secondaryContent, !state.disabled && styles.secondaryContent, state.secondaryContent.className);\n }\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemClassNames.icon, styles.icon, state.icon.className);\n }\n if (state.submenuIndicator) {\n state.submenuIndicator.className = mergeClasses(menuItemClassNames.submenuIndicator, styles.submenuIndicator, state.submenuIndicator.className);\n }\n useCheckmarkStyles_unstable(state);\n};\n"],"mappings":"AAAA,SAASA,YAAY,EAAAC,QAAA,EAAcC,UAAU,QAAQ,gBAAgB;AACrE,SAASC,mBAAmB,EAAEC,oBAAoB,QAAQ,uBAAuB;AACjF,SAASC,uBAAuB,QAAQ,yBAAyB;AACjE,SAASC,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,2BAA2B,QAAQ,wBAAwB;AACpE,OAAO,MAAMC,kBAAkB,GAAG;EAC9BC,IAAI,EAAE,cAAc;EACpBC,IAAI,EAAE,oBAAoB;EAC1BC,SAAS,EAAE,yBAAyB;EACpCC,gBAAgB,EAAE,gCAAgC;EAClDC,OAAO,EAAE,uBAAuB;EAChCC,gBAAgB,EAAE;AACtB,CAAC;AACD,MAAMC,SAAS,gBAAGd,QAAA;EAAAe,cAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,OAAA;IAAAC,MAAA;IA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SAAS,GAAGzF,YAAY,CAACQ,kBAAkB,CAACE,IAAI,EAAE8E,MAAM,CAAC9E,IAAI,EAAE6E,KAAK,CAAC7E,IAAI,CAAC+E,SAAS,CAAC;EACnG;EACA,IAAIF,KAAK,CAAC3E,gBAAgB,EAAE;IACxB2E,KAAK,CAAC3E,gBAAgB,CAAC6E,SAAS,GAAGzF,YAAY,CAACQ,kBAAkB,CAACI,gBAAgB,EAAE4E,MAAM,CAAC5E,gBAAgB,EAAE2E,KAAK,CAAC3E,gBAAgB,CAAC6E,SAAS,CAAC;EACnJ;EACAlF,2BAA2B,CAACgF,KAAK,CAAC;AACtC,CAAC"}
|
@@ -36,7 +36,7 @@ import { useARIAButtonProps } from '@fluentui/react-aria';
|
|
36
36
|
const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;
|
37
37
|
const child = getTriggerChild(children);
|
38
38
|
const onContextMenu = (event)=>{
|
39
|
-
if (isTargetDisabled(event)) {
|
39
|
+
if (isTargetDisabled(event) || event.isDefaultPrevented()) {
|
40
40
|
return;
|
41
41
|
}
|
42
42
|
if (openOnContext) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useMenuTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useFocusFinders, useRestoreFocusTarget } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n isHTMLElement,\n mergeCallbacks,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n\n/**\n * Create the state required to render MenuTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup menu\n *\n * @param props - props from this instance of MenuTrigger\n */\nexport const useMenuTrigger_unstable = (props: MenuTriggerProps): MenuTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n\n const triggerRef = useMenuContext_unstable(context => context.triggerRef);\n const menuPopoverRef = useMenuContext_unstable(context => context.menuPopoverRef);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n const open = useMenuContext_unstable(context => context.open);\n const triggerId = useMenuContext_unstable(context => context.triggerId);\n const openOnHover = useMenuContext_unstable(context => context.openOnHover);\n const openOnContext = useMenuContext_unstable(context => context.openOnContext);\n const restoreFocusTargetAttribute = useRestoreFocusTarget();\n\n const isSubmenu = useIsSubmenu();\n\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(menuPopoverRef.current);\n firstFocusable?.focus();\n }, [findFirstFocusable, menuPopoverRef]);\n\n const openedWithKeyboardRef = React.useRef(false);\n const hasMouseMoved = React.useRef(false);\n\n const { dir } = useFluent();\n const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;\n\n const child = getTriggerChild(children);\n\n const onContextMenu = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n if (openOnContext) {\n event.preventDefault();\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerContextMenu', event });\n }\n };\n\n const onClick = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n if (!openOnContext) {\n setOpen(event, { open: !open, keyboard: openedWithKeyboardRef.current, type: 'menuTriggerClick', event });\n openedWithKeyboardRef.current = false;\n }\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n const key = event.key;\n\n if (!openOnContext && ((isSubmenu && key === OpenArrowKey) || (!isSubmenu && key === ArrowDown))) {\n setOpen(event, { open: true, keyboard: true, type: 'menuTriggerKeyDown', event });\n }\n\n if (key === Escape && !isSubmenu) {\n setOpen(event, { open: false, keyboard: true, type: 'menuTriggerKeyDown', event });\n }\n\n // if menu is already open, can't rely on effects to focus\n if (open && key === OpenArrowKey && isSubmenu) {\n focusFirst();\n }\n };\n\n const onMouseEnter = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && hasMouseMoved.current) {\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerMouseEnter', event });\n }\n };\n\n // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience\n // First time open the mouse using mousemove and then continue with mouseenter\n // Only use once to determine that the user is using the mouse since it is an expensive event to handle\n const onMouseMove = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && !hasMouseMoved.current) {\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerMouseMove', event });\n hasMouseMoved.current = true;\n }\n };\n\n const onMouseLeave = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover) {\n setOpen(event, { open: false, keyboard: false, type: 'menuTriggerMouseLeave', event });\n }\n };\n\n const contextMenuProps = {\n id: triggerId,\n ...child?.props,\n ref: useMergedRefs(triggerRef, child?.ref),\n onMouseEnter: useEventCallback(mergeCallbacks(child?.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks(child?.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child?.props.onContextMenu, onContextMenu)),\n onMouseMove: useEventCallback(mergeCallbacks(child?.props.onMouseMove, onMouseMove)),\n };\n\n const triggerChildProps = {\n 'aria-haspopup': 'menu',\n 'aria-expanded': !open && !isSubmenu ? undefined : open,\n ...restoreFocusTargetAttribute,\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks(child?.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child?.props.onKeyDown, onKeyDown)),\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n triggerChildProps,\n );\n\n return {\n isSubmenu,\n children: applyTriggerPropsToChildren(\n children,\n openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n\nconst isTargetDisabled = (event: React.SyntheticEvent | Event) => {\n const isDisabled = (el: HTMLElement) =>\n el.hasAttribute('disabled') || (el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true');\n if (isHTMLElement(event.target) && isDisabled(event.target)) {\n return true;\n }\n\n return isHTMLElement(event.currentTarget) && isDisabled(event.currentTarget);\n};\n"],"names":["React","useMenuContext_unstable","useIsSubmenu","useFocusFinders","useRestoreFocusTarget","useFluent_unstable","useFluent","ArrowRight","ArrowLeft","Escape","ArrowDown","applyTriggerPropsToChildren","getTriggerChild","isHTMLElement","mergeCallbacks","useEventCallback","useMergedRefs","useARIAButtonProps","useMenuTrigger_unstable","props","children","disableButtonEnhancement","triggerRef","context","menuPopoverRef","setOpen","open","triggerId","openOnHover","openOnContext","restoreFocusTargetAttribute","isSubmenu","findFirstFocusable","focusFirst","useCallback","firstFocusable","current","focus","openedWithKeyboardRef","useRef","hasMouseMoved","dir","OpenArrowKey","child","onContextMenu","event","isTargetDisabled","preventDefault","keyboard","type","onClick","onKeyDown","key","onMouseEnter","onMouseMove","onMouseLeave","contextMenuProps","id","ref","triggerChildProps","undefined","ariaButtonTriggerChildProps","isDisabled","el","hasAttribute","getAttribute","target","currentTarget"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,6BAA6B;AACrE,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC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A,IAAAA,MAAOxB,KAAK,CAACmC,WAAW,EAAEA;IACzE;IAEA,MAAMK,oBAAoB;QACxB,iBAAiB;QACjB,iBAAiB,CAACjC,QAAQ,CAACK,YAAY6B,YAAYlC,IAAI;QACvD,GAAGI,2BAA2B;QAC9B,GAAG0B,gBAAgB;QACnBN,SAASnC,iBAAiBD,eAAe6B,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOxB,KAAK,CAAC+B,OAAO,EAAEA;QAC/DC,WAAWpC,iBAAiBD,eAAe6B,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOxB,KAAK,CAACgC,SAAS,EAAEA;IACrE;IAEA,MAAMU,8BAA8B5C,mBAClC0B,CAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOM,IAAI,AAAD,MAAM,YAAYN,CAAAA,kBAAAA,mBAAAA,KAAAA,IAAAA,MAAOM,IAAI,AAAD,MAAM,MAAMN,MAAMM,IAAI,GAAG,KAAK,EACpEU;IAGF,OAAO;QACL5B;QACAX,UAAUT,4BACRS,UACAS,gBAAgB2B,mBAAmBnC,2BAA2BsC,oBAAoBE,2BAA2B;IAEjH;AACF,EAAE;AAEF,MAAMf,mBAAmB,CAACD,QAAwC;IAChE,MAAMiB,aAAa,CAACC,KAClBA,GAAGC,YAAY,CAAC,eAAgBD,GAAGC,YAAY,CAAC,oBAAoBD,GAAGE,YAAY,CAAC,qBAAqB;IAC3G,IAAIpD,cAAcgC,MAAMqB,MAAM,KAAKJ,WAAWjB,MAAMqB,MAAM,GAAG;QAC3D,OAAO,IAAI;IACb,CAAC;IAED,OAAOrD,cAAcgC,MAAMsB,aAAa,KAAKL,WAAWjB,MAAMsB,aAAa;AAC7E"}
|
1
|
+
{"version":3,"sources":["useMenuTrigger.ts"],"sourcesContent":["import * as React from 'react';\nimport { MenuTriggerProps, MenuTriggerState } from './MenuTrigger.types';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useFocusFinders, useRestoreFocusTarget } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';\nimport {\n applyTriggerPropsToChildren,\n getTriggerChild,\n isHTMLElement,\n mergeCallbacks,\n useEventCallback,\n useMergedRefs,\n} from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n\n/**\n * Create the state required to render MenuTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup menu\n *\n * @param props - props from this instance of MenuTrigger\n */\nexport const useMenuTrigger_unstable = (props: MenuTriggerProps): MenuTriggerState => {\n const { children, disableButtonEnhancement = false } = props;\n\n const triggerRef = useMenuContext_unstable(context => context.triggerRef);\n const menuPopoverRef = useMenuContext_unstable(context => context.menuPopoverRef);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n const open = useMenuContext_unstable(context => context.open);\n const triggerId = useMenuContext_unstable(context => context.triggerId);\n const openOnHover = useMenuContext_unstable(context => context.openOnHover);\n const openOnContext = useMenuContext_unstable(context => context.openOnContext);\n const restoreFocusTargetAttribute = useRestoreFocusTarget();\n\n const isSubmenu = useIsSubmenu();\n\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(menuPopoverRef.current);\n firstFocusable?.focus();\n }, [findFirstFocusable, menuPopoverRef]);\n\n const openedWithKeyboardRef = React.useRef(false);\n const hasMouseMoved = React.useRef(false);\n\n const { dir } = useFluent();\n const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;\n\n const child = getTriggerChild(children);\n\n const onContextMenu = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event) || event.isDefaultPrevented()) {\n return;\n }\n\n if (openOnContext) {\n event.preventDefault();\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerContextMenu', event });\n }\n };\n\n const onClick = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n if (!openOnContext) {\n setOpen(event, { open: !open, keyboard: openedWithKeyboardRef.current, type: 'menuTriggerClick', event });\n openedWithKeyboardRef.current = false;\n }\n };\n\n const onKeyDown = (event: React.KeyboardEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n\n const key = event.key;\n\n if (!openOnContext && ((isSubmenu && key === OpenArrowKey) || (!isSubmenu && key === ArrowDown))) {\n setOpen(event, { open: true, keyboard: true, type: 'menuTriggerKeyDown', event });\n }\n\n if (key === Escape && !isSubmenu) {\n setOpen(event, { open: false, keyboard: true, type: 'menuTriggerKeyDown', event });\n }\n\n // if menu is already open, can't rely on effects to focus\n if (open && key === OpenArrowKey && isSubmenu) {\n focusFirst();\n }\n };\n\n const onMouseEnter = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && hasMouseMoved.current) {\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerMouseEnter', event });\n }\n };\n\n // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience\n // First time open the mouse using mousemove and then continue with mouseenter\n // Only use once to determine that the user is using the mouse since it is an expensive event to handle\n const onMouseMove = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && !hasMouseMoved.current) {\n setOpen(event, { open: true, keyboard: false, type: 'menuTriggerMouseMove', event });\n hasMouseMoved.current = true;\n }\n };\n\n const onMouseLeave = (event: React.MouseEvent<HTMLButtonElement & HTMLAnchorElement & HTMLDivElement>) => {\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover) {\n setOpen(event, { open: false, keyboard: false, type: 'menuTriggerMouseLeave', event });\n }\n };\n\n const contextMenuProps = {\n id: triggerId,\n ...child?.props,\n ref: useMergedRefs(triggerRef, child?.ref),\n onMouseEnter: useEventCallback(mergeCallbacks(child?.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks(child?.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child?.props.onContextMenu, onContextMenu)),\n onMouseMove: useEventCallback(mergeCallbacks(child?.props.onMouseMove, onMouseMove)),\n };\n\n const triggerChildProps = {\n 'aria-haspopup': 'menu',\n 'aria-expanded': !open && !isSubmenu ? undefined : open,\n ...restoreFocusTargetAttribute,\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks(child?.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child?.props.onKeyDown, onKeyDown)),\n } as const;\n\n const ariaButtonTriggerChildProps = useARIAButtonProps(\n child?.type === 'button' || child?.type === 'a' ? child.type : 'div',\n triggerChildProps,\n );\n\n return {\n isSubmenu,\n children: applyTriggerPropsToChildren(\n children,\n openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps,\n ),\n };\n};\n\nconst isTargetDisabled = (event: React.SyntheticEvent | Event) => {\n const isDisabled = (el: HTMLElement) =>\n el.hasAttribute('disabled') || (el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true');\n if (isHTMLElement(event.target) && isDisabled(event.target)) {\n return true;\n }\n\n return isHTMLElement(event.currentTarget) && isDisabled(event.currentTarget);\n};\n"],"names":["React","useMenuContext_unstable","useIsSubmenu","useFocusFinders","useRestoreFocusTarget","useFluent_unstable","useFluent","ArrowRight","ArrowLeft","Escape","ArrowDown","applyTriggerPropsToChildren","getTriggerChild","isHTMLElement","mergeCallbacks","useEventCallback","useMergedRefs","useARIAButtonProps","useMenuTrigger_unstable","props","children","disableButtonEnhancement","triggerRef","context","menuPopoverRef","setOpen","open","triggerId","openOnHover","openOnContext","restoreFocusTargetAttribute","isSubmenu","findFirstFocusable","focusFirst","useCallback","firstFocusable","current","focus","openedWithKeyboardRef","useRef","hasMouseMoved","dir","OpenArrowKey","child","onContextMenu","event","isTargetDisabled","isDefaultPrevented","preventDefault","keyboard","type","onClick","onKeyDown","key","onMouseEnter","onMouseMove","onMouseLeave","contextMenuProps","id","ref","triggerChildProps","undefined","ariaButtonTriggerChildProps","isDisabled","el","hasAttribute","getAttribute","target","currentTarget"],"mappings":"AAAA,YAAYA,WAAW,QAAQ;AAE/B,SAASC,uBAAuB,QAAQ,6BAA6B;AACrE,SAASC,YAAY,QAAQ,2BAA2B;AACxD,SAASC,eAAe,EAAEC,qBAAqB,QAAQ,0BAA0B;AACjF,SAASC,sBAAsBC,SAAS,QAAQ,kCAAkC;AAClF,SAASC,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,SAAS,QAAQ,0BAA0B;AACnF,SACEC,2BAA2B,EAC3BC,eAAe,EACfC,aAAa,EACbC,cAAc,EACdC,gBAAgB,EAChBC,aAAa,QACR,4BAA4B;AACnC,SAASC,kBAAkB,QAAQ,uBAAuB;AAE1D;;;;;CAKC,GACD,OAAO,MAAMC,0BAA0B,CAACC,QAA8C;IACpF,MAAM,EAAEC,SAAQ,EAAEC,0BAA2B,KAAK,CAAA,EAAE,GAAGF;IAEvD,MAAMG,aAAarB,wBAAwBsB,CAAAA,UAAWA,QAAQD,UAAU;IACxE,MAAME,iBAAiBvB,wBAAwBsB,CAAAA,UAAWA,QAAQC,cAAc;IAChF,MAAMC,UAAUxB,wBAAwBsB,CAAAA,UAAWA,QAAQE,OAAO;IAClE,MAAMC,OAAOzB,wBAAwBsB,CAAAA,UAAWA,QAAQG,IAAI;IAC5D,MAAMC,YAAY1B,wBAAwBsB,CAAAA,UAAWA,QAAQI,SAAS;IACtE,MAAMC,cAAc3B,wBAAwBsB,CAAAA,UAAWA,QAAQK,WAAW;IAC1E,MAAMC,gBAAgB5B,wBAAwBsB,CAAAA,UAAWA,QAAQM,aAAa;IAC9E,MAAMC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AAoBD,GAAGE,YAAY,CAAC,qBAAqB;IAC3G,IAAIrD,cAAcgC,MAAMsB,MAAM,KAAKJ,WAAWlB,MAAMsB,MAAM,GAAG;QAC3D,OAAO,IAAI;IACb,CAAC;IAED,OAAOtD,cAAcgC,MAAMuB,aAAa,KAAKL,WAAWlB,MAAMuB,aAAa;AAC7E"}
|
@@ -26,25 +26,76 @@ const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
26
26
|
focusIndicator: {
|
27
27
|
Brovlpu: "ftqa4ok",
|
28
28
|
B486eqv: "f2hkw1w",
|
29
|
-
|
30
|
-
|
31
|
-
"
|
29
|
+
B8q5s1w: "f8hki3x",
|
30
|
+
Bci5o5g: [
|
31
|
+
"f1d2448m",
|
32
|
+
"ffh67wi"
|
32
33
|
],
|
33
|
-
|
34
|
-
|
35
|
-
"
|
34
|
+
n8qw10: "f1bjia2o",
|
35
|
+
Bdrgwmp: [
|
36
|
+
"ffh67wi",
|
37
|
+
"f1d2448m"
|
36
38
|
],
|
37
|
-
|
38
|
-
|
39
|
-
|
39
|
+
Bm4h7ae: "f15bsgw9",
|
40
|
+
B7ys5i9: "f14e48fq",
|
41
|
+
Busjfv9: "f18yb2kv",
|
42
|
+
Bhk32uz: "fd6o370",
|
43
|
+
Bf4ptjt: "fh1cnn4",
|
44
|
+
kclons: [
|
45
|
+
"fy7oxxb",
|
46
|
+
"f184ne2d"
|
40
47
|
],
|
41
|
-
|
42
|
-
|
43
|
-
"
|
48
|
+
Bhdgwq3: "fpukqih",
|
49
|
+
Blkhhs4: [
|
50
|
+
"f184ne2d",
|
51
|
+
"fy7oxxb"
|
44
52
|
],
|
45
|
-
|
46
|
-
|
47
|
-
|
53
|
+
Bqtpl0w: "frrh606",
|
54
|
+
clg4pj: [
|
55
|
+
"f1v5zibi",
|
56
|
+
"fo2hd23"
|
57
|
+
],
|
58
|
+
hgwjuy: "ful5kiu",
|
59
|
+
Bonggc9: [
|
60
|
+
"fo2hd23",
|
61
|
+
"f1v5zibi"
|
62
|
+
],
|
63
|
+
B1tsrr9: [
|
64
|
+
"f1jqcqds",
|
65
|
+
"ftffrms"
|
66
|
+
],
|
67
|
+
Dah5zi: [
|
68
|
+
"ftffrms",
|
69
|
+
"f1jqcqds"
|
70
|
+
],
|
71
|
+
Bkh64rk: [
|
72
|
+
"f2e7qr6",
|
73
|
+
"fsr1zz6"
|
74
|
+
],
|
75
|
+
qqdqy8: [
|
76
|
+
"fsr1zz6",
|
77
|
+
"f2e7qr6"
|
78
|
+
],
|
79
|
+
B6dhp37: "f1dvezut",
|
80
|
+
i03rao: [
|
81
|
+
"fd0oaoj",
|
82
|
+
"f1cwg4i8"
|
83
|
+
],
|
84
|
+
Boxcth7: "fjvm52t",
|
85
|
+
Bsom6fd: [
|
86
|
+
"f1cwg4i8",
|
87
|
+
"fd0oaoj"
|
88
|
+
],
|
89
|
+
J0r882: "f57olzd",
|
90
|
+
Bule8hv: [
|
91
|
+
"f4stah7",
|
92
|
+
"fs1por5"
|
93
|
+
],
|
94
|
+
Bjwuhne: "f480a47",
|
95
|
+
Ghsupd: [
|
96
|
+
"fs1por5",
|
97
|
+
"f4stah7"
|
98
|
+
]
|
48
99
|
},
|
49
100
|
root: {
|
50
101
|
Bbmb7ep: [
|
@@ -156,13 +207,34 @@ const useStyles = /*#__PURE__*/ (0, _react["__styles"])({
|
|
156
207
|
".f2hkw1w:focus-visible{outline-style:none;}"
|
157
208
|
],
|
158
209
|
d: [
|
159
|
-
".
|
160
|
-
".
|
161
|
-
".
|
162
|
-
".
|
163
|
-
".
|
164
|
-
".
|
165
|
-
".
|
210
|
+
".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}",
|
211
|
+
".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}",
|
212
|
+
".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}",
|
213
|
+
".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}",
|
214
|
+
".f15bsgw9[data-fui-focus-visible]::after{content:\"\";}",
|
215
|
+
".f14e48fq[data-fui-focus-visible]::after{position:absolute;}",
|
216
|
+
".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}",
|
217
|
+
".fd6o370[data-fui-focus-visible]::after{z-index:1;}",
|
218
|
+
".fh1cnn4[data-fui-focus-visible]::after{border-top-style:solid;}",
|
219
|
+
".fy7oxxb[data-fui-focus-visible]::after{border-right-style:solid;}",
|
220
|
+
".f184ne2d[data-fui-focus-visible]::after{border-left-style:solid;}",
|
221
|
+
".fpukqih[data-fui-focus-visible]::after{border-bottom-style:solid;}",
|
222
|
+
".frrh606[data-fui-focus-visible]::after{border-top-width:2px;}",
|
223
|
+
".f1v5zibi[data-fui-focus-visible]::after{border-right-width:2px;}",
|
224
|
+
".fo2hd23[data-fui-focus-visible]::after{border-left-width:2px;}",
|
225
|
+
".ful5kiu[data-fui-focus-visible]::after{border-bottom-width:2px;}",
|
226
|
+
".f1jqcqds[data-fui-focus-visible]::after{border-bottom-right-radius:var(--borderRadiusMedium);}",
|
227
|
+
".ftffrms[data-fui-focus-visible]::after{border-bottom-left-radius:var(--borderRadiusMedium);}",
|
228
|
+
".f2e7qr6[data-fui-focus-visible]::after{border-top-right-radius:var(--borderRadiusMedium);}",
|
229
|
+
".fsr1zz6[data-fui-focus-visible]::after{border-top-left-radius:var(--borderRadiusMedium);}",
|
230
|
+
".f1dvezut[data-fui-focus-visible]::after{border-top-color:var(--colorStrokeFocus2);}",
|
231
|
+
".fd0oaoj[data-fui-focus-visible]::after{border-right-color:var(--colorStrokeFocus2);}",
|
232
|
+
".f1cwg4i8[data-fui-focus-visible]::after{border-left-color:var(--colorStrokeFocus2);}",
|
233
|
+
".fjvm52t[data-fui-focus-visible]::after{border-bottom-color:var(--colorStrokeFocus2);}",
|
234
|
+
".f57olzd[data-fui-focus-visible]::after{top:calc(2px * -1);}",
|
235
|
+
".f4stah7[data-fui-focus-visible]::after{right:calc(2px * -1);}",
|
236
|
+
".fs1por5[data-fui-focus-visible]::after{left:calc(2px * -1);}",
|
237
|
+
".f480a47[data-fui-focus-visible]::after{bottom:calc(2px * -1);}",
|
166
238
|
".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}",
|
167
239
|
".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}",
|
168
240
|
".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}",
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useMenuItemStyles.styles.js"],"sourcesContent":["import { mergeClasses, __styles, shorthands } from '@griffel/react';\nimport { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { createCustomFocusIndicatorStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { useCheckmarkStyles_unstable } from '../../selectable/index';\nexport const menuItemClassNames = {\n root: 'fui-MenuItem',\n icon: 'fui-MenuItem__icon',\n checkmark: 'fui-MenuItem__checkmark',\n submenuIndicator: 'fui-MenuItem__submenuIndicator',\n content: 'fui-MenuItem__content',\n secondaryContent: 'fui-MenuItem__secondaryContent'\n};\nconst useStyles = /*#__PURE__*/__styles({\n focusIndicator: {\n Brovlpu: \"ftqa4ok\",\n B486eqv: \"f2hkw1w\",\n kdpuga: [\"f1o2ludy\", \"f1kjnpwc\"],\n Bw81rd7: [\"f1kjnpwc\", \"f1o2ludy\"],\n B6xbmo0: [\"fxmnebo\", \"f1witrsb\"],\n dm238s: [\"f1witrsb\", \"fxmnebo\"],\n Bn4voq9: \"f1p7hgxw\",\n g9k6zt: \"f9znhxp\",\n Bfpq7zp: \"fqrak0z\"\n },\n root: {\n Bbmb7ep: [\"f1aa9q02\", \"f16jpd5f\"],\n Beyfa6y: [\"f16jpd5f\", \"f1aa9q02\"],\n B7oj6ja: [\"f1jar5jt\", \"fyu767a\"],\n Btl43ni: [\"fyu767a\", \"f1jar5jt\"],\n qhf8xq: \"f10pi13n\",\n sj55zd: \"fkfq4zb\",\n De3pzq: \"fxugw4r\",\n z189sj: [\"f1sgzk6v\", \"f1bg5zqg\"],\n uwmqm3: [\"f1bg5zqg\", \"f1sgzk6v\"],\n Bqenvij: \"f1d2rq10\",\n sshi5w: \"f1nxs5xn\",\n mc9l5x: \"f22iagw\",\n Bt984gj: \"f122n59\",\n Be2twd7: \"fkhj508\",\n Bceei9c: \"f1k6fduh\",\n i8kkvl: \"f1q8lukm\",\n Belr9w4: \"f1ma2n7n\",\n Jwef8y: \"f1knas48\",\n Bi91k9c: \"fnwyq0v\",\n Bk3fhr4: \"ft1hn21\",\n Bmfj8id: \"fuxngvv\",\n Bg7n49j: \"fp258yr\",\n famaaq: \"f1xqy1su\"\n },\n content: {\n uwmqm3: [\"f161knb0\", \"f12huiiw\"],\n z189sj: [\"f12huiiw\", \"f161knb0\"],\n De3pzq: \"f3rmtva\",\n Bh6795r: \"fqerorx\"\n },\n secondaryContent: {\n uwmqm3: [\"f161knb0\", \"f12huiiw\"],\n z189sj: [\"f12huiiw\", \"f161knb0\"],\n sj55zd: \"f11d4kpn\",\n Bi91k9c: \"f1jp5ecu\",\n t0hwav: \"fc1cou1\"\n },\n icon: {\n a9b677: \"f64fuq3\",\n Bqenvij: \"fjamq6b\",\n Be2twd7: \"fe5j1ua\",\n Bg96gwp: \"fez10in\",\n Bt984gj: \"f122n59\",\n mc9l5x: \"ftuwxu6\",\n Brf1p80: \"f4d9j23\"\n },\n submenuIndicator: {\n a9b677: \"f64fuq3\",\n Bqenvij: \"fjamq6b\",\n Be2twd7: \"fe5j1ua\",\n Bg96gwp: \"fez10in\",\n Bt984gj: \"f122n59\",\n mc9l5x: \"ftuwxu6\",\n Brf1p80: \"f4d9j23\"\n },\n disabled: {\n sj55zd: \"f1s2aq7o\",\n Bi91k9c: \"fvgxktp\",\n Jwef8y: \"f1ijtazh\",\n eoavqd: \"fphbwmw\",\n Bk3fhr4: \"f19vpps7\",\n Bmfj8id: \"fv5swzo\",\n Bg7n49j: \"f1q1x1ba\",\n t0hwav: \"ft33916\",\n Bbusuzp: \"f1dcs8yz\",\n ze5xyy: \"f1kc2mi9\",\n Bctn1xl: \"fk56vqo\",\n Bh6z0a4: \"f1ikwg0d\"\n }\n}, {\n f: [\".ftqa4ok:focus{outline-style:none;}\", \".fc1cou1:focus{color:var(--colorNeutralForeground3Hover);}\", \".ft33916:focus{color:var(--colorNeutralForegroundDisabled);}\"],\n i: [\".f2hkw1w:focus-visible{outline-style:none;}\"],\n d: [\".f1o2ludy[data-fui-focus-visible]{border-bottom-right-radius:var(--borderRadiusMedium);}\", \".f1kjnpwc[data-fui-focus-visible]{border-bottom-left-radius:var(--borderRadiusMedium);}\", \".fxmnebo[data-fui-focus-visible]{border-top-right-radius:var(--borderRadiusMedium);}\", \".f1witrsb[data-fui-focus-visible]{border-top-left-radius:var(--borderRadiusMedium);}\", \".f1p7hgxw[data-fui-focus-visible]{outline-width:var(--strokeWidthThick);}\", \".f9znhxp[data-fui-focus-visible]{outline-style:solid;}\", \".fqrak0z[data-fui-focus-visible]{outline-color:var(--colorStrokeFocus2);}\", \".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}\", \".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}\", \".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}\", \".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}\", \".f10pi13n{position:relative;}\", \".fkfq4zb{color:var(--colorNeutralForeground2);}\", \".fxugw4r{background-color:var(--colorNeutralBackground1);}\", \".f1sgzk6v{padding-right:6px;}\", \".f1bg5zqg{padding-left:6px;}\", \".f1d2rq10{height:32px;}\", \".f1nxs5xn{min-height:32px;}\", \".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}\", \".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}\", \".fkhj508{font-size:var(--fontSizeBase300);}\", \".f1k6fduh{cursor:pointer;}\", \".f1q8lukm{-webkit-column-gap:4px;column-gap:4px;}\", \".f1ma2n7n{row-gap:4px;}\", \".f1xqy1su{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}\", \".f161knb0{padding-left:2px;}\", \".f12huiiw{padding-right:2px;}\", \".f3rmtva{background-color:transparent;}\", \".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}\", \".f11d4kpn{color:var(--colorNeutralForeground3);}\", \".f64fuq3{width:20px;}\", \".fjamq6b{height:20px;}\", \".fe5j1ua{font-size:20px;}\", \".fez10in{line-height:0;}\", \".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}\", \".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}\", \".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}\"],\n h: [\".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}\", \".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}\", \".ft1hn21:hover .fui-Icon-filled{display:inline;}\", \".fuxngvv:hover .fui-Icon-regular{display:none;}\", \".fp258yr:hover .fui-MenuItem__icon{color:var(--colorNeutralForeground2BrandSelected);}\", \".f1jp5ecu:hover{color:var(--colorNeutralForeground3Hover);}\", \".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}\", \".f1ijtazh:hover{background-color:var(--colorNeutralBackground1);}\", \".fphbwmw:hover{cursor:not-allowed;}\", \".f19vpps7:hover .fui-Icon-filled{display:none;}\", \".fv5swzo:hover .fui-Icon-regular{display:inline;}\", \".f1q1x1ba:hover .fui-MenuItem__icon{color:var(--colorNeutralForegroundDisabled);}\"],\n m: [[\"@media (forced-colors: active){.f1dcs8yz{color:GrayText;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1kc2mi9:hover{color:GrayText;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fk56vqo:hover .fui-MenuItem__icon{color:GrayText;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1ikwg0d:focus{color:GrayText;}}\", {\n m: \"(forced-colors: active)\"\n }]]\n});\n/** Applies style classnames to slots */\nexport const useMenuItemStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuItemClassNames.root, styles.root, styles.focusIndicator, state.disabled && styles.disabled, state.root.className);\n if (state.content) {\n state.content.className = mergeClasses(menuItemClassNames.content, styles.content, state.content.className);\n }\n if (state.checkmark) {\n state.checkmark.className = mergeClasses(menuItemClassNames.checkmark, state.checkmark.className);\n }\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(menuItemClassNames.secondaryContent, !state.disabled && styles.secondaryContent, state.secondaryContent.className);\n }\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemClassNames.icon, styles.icon, state.icon.className);\n }\n if (state.submenuIndicator) {\n state.submenuIndicator.className = mergeClasses(menuItemClassNames.submenuIndicator, styles.submenuIndicator, state.submenuIndicator.className);\n }\n useCheckmarkStyles_unstable(state);\n};\n//# sourceMappingURL=useMenuItemStyles.styles.js.map"],"names":["menuItemClassNames","useMenuItemStyles_unstable","root","icon","checkmark","submenuIndicator","content","secondaryContent","useStyles","__styles","focusIndicator","Brovlpu","B486eqv","kdpuga","Bw81rd7","B6xbmo0","dm238s","Bn4voq9","g9k6zt","Bfpq7zp","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","qhf8xq","sj55zd","De3pzq","z189sj","uwmqm3","Bqenvij","sshi5w","mc9l5x","Bt984gj","Be2twd7","Bceei9c","i8kkvl","Belr9w4","Jwef8y","Bi91k9c","Bk3fhr4","Bmfj8id","Bg7n49j","famaaq","Bh6795r","t0hwav","a9b677","Bg96gwp","Brf1p80","disabled","eoavqd","Bbusuzp","ze5xyy","Bctn1xl","Bh6z0a4","f","i","d","h","m","state","styles","className","mergeClasses","useCheckmarkStyles_unstable"],"mappings":";;;;;;;;;;;IAKaA,kBAAkB,MAAlBA;IA0GAC,0BAA0B,MAA1BA;;uBA/GsC;uBAIP;AACrC,M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,OAAO,EAAEsD,OAAOtD,OAAO,EAAEqD,MAAMrD,OAAO,CAACuD,SAAS;IAC5G,CAAC;IACD,IAAIF,MAAMvD,SAAS,EAAE;QACnBuD,MAAMvD,SAAS,CAACyD,SAAS,GAAGC,IAAAA,mBAAY,EAAC9D,mBAAmBI,SAAS,EAAEuD,MAAMvD,SAAS,CAACyD,SAAS;IAClG,CAAC;IACD,IAAIF,MAAMpD,gBAAgB,EAAE;QAC1BoD,MAAMpD,gBAAgB,CAACsD,SAAS,GAAGC,IAAAA,mBAAY,EAAC9D,mBAAmBO,gBAAgB,EAAE,CAACoD,MAAMX,QAAQ,IAAIY,OAAOrD,gBAAgB,EAAEoD,MAAMpD,gBAAgB,CAACsD,SAAS;IACnK,CAAC;IACD,IAAIF,MAAMxD,IAAI,EAAE;QACdwD,MAAMxD,IAAI,CAAC0D,SAAS,GAAGC,IAAAA,mBAAY,EAAC9D,mBAAmBG,IAAI,EAAEyD,OAAOzD,IAAI,EAAEwD,MAAMxD,IAAI,CAAC0D,SAAS;IAChG,CAAC;IACD,IAAIF,MAAMtD,gBAAgB,EAAE;QAC1BsD,MAAMtD,gBAAgB,CAACwD,SAAS,GAAGC,IAAAA,mBAAY,EAAC9D,mBAAmBK,gBAAgB,EAAEuD,OAAOvD,gBAAgB,EAAEsD,MAAMtD,gBAAgB,CAACwD,SAAS;IAChJ,CAAC;IACDE,IAAAA,kCAA2B,EAACJ;AAC9B,GACA,oDAAoD"}
|
1
|
+
{"version":3,"sources":["useMenuItemStyles.styles.js"],"sourcesContent":["import { mergeClasses, __styles, shorthands } from '@griffel/react';\nimport { iconFilledClassName, iconRegularClassName } from '@fluentui/react-icons';\nimport { createFocusOutlineStyle } from '@fluentui/react-tabster';\nimport { tokens } from '@fluentui/react-theme';\nimport { useCheckmarkStyles_unstable } from '../../selectable/index';\nexport const menuItemClassNames = {\n root: 'fui-MenuItem',\n icon: 'fui-MenuItem__icon',\n checkmark: 'fui-MenuItem__checkmark',\n submenuIndicator: 'fui-MenuItem__submenuIndicator',\n content: 'fui-MenuItem__content',\n secondaryContent: 'fui-MenuItem__secondaryContent'\n};\nconst useStyles = /*#__PURE__*/__styles({\n focusIndicator: {\n Brovlpu: \"ftqa4ok\",\n B486eqv: \"f2hkw1w\",\n B8q5s1w: \"f8hki3x\",\n Bci5o5g: [\"f1d2448m\", \"ffh67wi\"],\n n8qw10: \"f1bjia2o\",\n Bdrgwmp: [\"ffh67wi\", \"f1d2448m\"],\n Bm4h7ae: \"f15bsgw9\",\n B7ys5i9: \"f14e48fq\",\n Busjfv9: \"f18yb2kv\",\n Bhk32uz: \"fd6o370\",\n Bf4ptjt: \"fh1cnn4\",\n kclons: [\"fy7oxxb\", \"f184ne2d\"],\n Bhdgwq3: \"fpukqih\",\n Blkhhs4: [\"f184ne2d\", \"fy7oxxb\"],\n Bqtpl0w: \"frrh606\",\n clg4pj: [\"f1v5zibi\", \"fo2hd23\"],\n hgwjuy: \"ful5kiu\",\n Bonggc9: [\"fo2hd23\", \"f1v5zibi\"],\n B1tsrr9: [\"f1jqcqds\", \"ftffrms\"],\n Dah5zi: [\"ftffrms\", \"f1jqcqds\"],\n Bkh64rk: [\"f2e7qr6\", \"fsr1zz6\"],\n qqdqy8: [\"fsr1zz6\", \"f2e7qr6\"],\n B6dhp37: \"f1dvezut\",\n i03rao: [\"fd0oaoj\", \"f1cwg4i8\"],\n Boxcth7: \"fjvm52t\",\n Bsom6fd: [\"f1cwg4i8\", \"fd0oaoj\"],\n J0r882: \"f57olzd\",\n Bule8hv: [\"f4stah7\", \"fs1por5\"],\n Bjwuhne: \"f480a47\",\n Ghsupd: [\"fs1por5\", \"f4stah7\"]\n },\n root: {\n Bbmb7ep: [\"f1aa9q02\", \"f16jpd5f\"],\n Beyfa6y: [\"f16jpd5f\", \"f1aa9q02\"],\n B7oj6ja: [\"f1jar5jt\", \"fyu767a\"],\n Btl43ni: [\"fyu767a\", \"f1jar5jt\"],\n qhf8xq: \"f10pi13n\",\n sj55zd: \"fkfq4zb\",\n De3pzq: \"fxugw4r\",\n z189sj: [\"f1sgzk6v\", \"f1bg5zqg\"],\n uwmqm3: [\"f1bg5zqg\", \"f1sgzk6v\"],\n Bqenvij: \"f1d2rq10\",\n sshi5w: \"f1nxs5xn\",\n mc9l5x: \"f22iagw\",\n Bt984gj: \"f122n59\",\n Be2twd7: \"fkhj508\",\n Bceei9c: \"f1k6fduh\",\n i8kkvl: \"f1q8lukm\",\n Belr9w4: \"f1ma2n7n\",\n Jwef8y: \"f1knas48\",\n Bi91k9c: \"fnwyq0v\",\n Bk3fhr4: \"ft1hn21\",\n Bmfj8id: \"fuxngvv\",\n Bg7n49j: \"fp258yr\",\n famaaq: \"f1xqy1su\"\n },\n content: {\n uwmqm3: [\"f161knb0\", \"f12huiiw\"],\n z189sj: [\"f12huiiw\", \"f161knb0\"],\n De3pzq: \"f3rmtva\",\n Bh6795r: \"fqerorx\"\n },\n secondaryContent: {\n uwmqm3: [\"f161knb0\", \"f12huiiw\"],\n z189sj: [\"f12huiiw\", \"f161knb0\"],\n sj55zd: \"f11d4kpn\",\n Bi91k9c: \"f1jp5ecu\",\n t0hwav: \"fc1cou1\"\n },\n icon: {\n a9b677: \"f64fuq3\",\n Bqenvij: \"fjamq6b\",\n Be2twd7: \"fe5j1ua\",\n Bg96gwp: \"fez10in\",\n Bt984gj: \"f122n59\",\n mc9l5x: \"ftuwxu6\",\n Brf1p80: \"f4d9j23\"\n },\n submenuIndicator: {\n a9b677: \"f64fuq3\",\n Bqenvij: \"fjamq6b\",\n Be2twd7: \"fe5j1ua\",\n Bg96gwp: \"fez10in\",\n Bt984gj: \"f122n59\",\n mc9l5x: \"ftuwxu6\",\n Brf1p80: \"f4d9j23\"\n },\n disabled: {\n sj55zd: \"f1s2aq7o\",\n Bi91k9c: \"fvgxktp\",\n Jwef8y: \"f1ijtazh\",\n eoavqd: \"fphbwmw\",\n Bk3fhr4: \"f19vpps7\",\n Bmfj8id: \"fv5swzo\",\n Bg7n49j: \"f1q1x1ba\",\n t0hwav: \"ft33916\",\n Bbusuzp: \"f1dcs8yz\",\n ze5xyy: \"f1kc2mi9\",\n Bctn1xl: \"fk56vqo\",\n Bh6z0a4: \"f1ikwg0d\"\n }\n}, {\n f: [\".ftqa4ok:focus{outline-style:none;}\", \".fc1cou1:focus{color:var(--colorNeutralForeground3Hover);}\", \".ft33916:focus{color:var(--colorNeutralForegroundDisabled);}\"],\n i: [\".f2hkw1w:focus-visible{outline-style:none;}\"],\n d: [\".f8hki3x[data-fui-focus-visible]{border-top-color:transparent;}\", \".f1d2448m[data-fui-focus-visible]{border-right-color:transparent;}\", \".ffh67wi[data-fui-focus-visible]{border-left-color:transparent;}\", \".f1bjia2o[data-fui-focus-visible]{border-bottom-color:transparent;}\", \".f15bsgw9[data-fui-focus-visible]::after{content:\\\"\\\";}\", \".f14e48fq[data-fui-focus-visible]::after{position:absolute;}\", \".f18yb2kv[data-fui-focus-visible]::after{pointer-events:none;}\", \".fd6o370[data-fui-focus-visible]::after{z-index:1;}\", \".fh1cnn4[data-fui-focus-visible]::after{border-top-style:solid;}\", \".fy7oxxb[data-fui-focus-visible]::after{border-right-style:solid;}\", \".f184ne2d[data-fui-focus-visible]::after{border-left-style:solid;}\", \".fpukqih[data-fui-focus-visible]::after{border-bottom-style:solid;}\", \".frrh606[data-fui-focus-visible]::after{border-top-width:2px;}\", \".f1v5zibi[data-fui-focus-visible]::after{border-right-width:2px;}\", \".fo2hd23[data-fui-focus-visible]::after{border-left-width:2px;}\", \".ful5kiu[data-fui-focus-visible]::after{border-bottom-width:2px;}\", \".f1jqcqds[data-fui-focus-visible]::after{border-bottom-right-radius:var(--borderRadiusMedium);}\", \".ftffrms[data-fui-focus-visible]::after{border-bottom-left-radius:var(--borderRadiusMedium);}\", \".f2e7qr6[data-fui-focus-visible]::after{border-top-right-radius:var(--borderRadiusMedium);}\", \".fsr1zz6[data-fui-focus-visible]::after{border-top-left-radius:var(--borderRadiusMedium);}\", \".f1dvezut[data-fui-focus-visible]::after{border-top-color:var(--colorStrokeFocus2);}\", \".fd0oaoj[data-fui-focus-visible]::after{border-right-color:var(--colorStrokeFocus2);}\", \".f1cwg4i8[data-fui-focus-visible]::after{border-left-color:var(--colorStrokeFocus2);}\", \".fjvm52t[data-fui-focus-visible]::after{border-bottom-color:var(--colorStrokeFocus2);}\", \".f57olzd[data-fui-focus-visible]::after{top:calc(2px * -1);}\", \".f4stah7[data-fui-focus-visible]::after{right:calc(2px * -1);}\", \".fs1por5[data-fui-focus-visible]::after{left:calc(2px * -1);}\", \".f480a47[data-fui-focus-visible]::after{bottom:calc(2px * -1);}\", \".f1aa9q02{border-bottom-right-radius:var(--borderRadiusMedium);}\", \".f16jpd5f{border-bottom-left-radius:var(--borderRadiusMedium);}\", \".f1jar5jt{border-top-right-radius:var(--borderRadiusMedium);}\", \".fyu767a{border-top-left-radius:var(--borderRadiusMedium);}\", \".f10pi13n{position:relative;}\", \".fkfq4zb{color:var(--colorNeutralForeground2);}\", \".fxugw4r{background-color:var(--colorNeutralBackground1);}\", \".f1sgzk6v{padding-right:6px;}\", \".f1bg5zqg{padding-left:6px;}\", \".f1d2rq10{height:32px;}\", \".f1nxs5xn{min-height:32px;}\", \".f22iagw{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;}\", \".f122n59{-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}\", \".fkhj508{font-size:var(--fontSizeBase300);}\", \".f1k6fduh{cursor:pointer;}\", \".f1q8lukm{-webkit-column-gap:4px;column-gap:4px;}\", \".f1ma2n7n{row-gap:4px;}\", \".f1xqy1su{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}\", \".f161knb0{padding-left:2px;}\", \".f12huiiw{padding-right:2px;}\", \".f3rmtva{background-color:transparent;}\", \".fqerorx{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1;}\", \".f11d4kpn{color:var(--colorNeutralForeground3);}\", \".f64fuq3{width:20px;}\", \".fjamq6b{height:20px;}\", \".fe5j1ua{font-size:20px;}\", \".fez10in{line-height:0;}\", \".ftuwxu6{display:-webkit-inline-box;display:-webkit-inline-flex;display:-ms-inline-flexbox;display:inline-flex;}\", \".f4d9j23{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-justify-content:center;justify-content:center;}\", \".f1s2aq7o{color:var(--colorNeutralForegroundDisabled);}\"],\n h: [\".f1knas48:hover{background-color:var(--colorNeutralBackground1Hover);}\", \".fnwyq0v:hover{color:var(--colorNeutralForeground2Hover);}\", \".ft1hn21:hover .fui-Icon-filled{display:inline;}\", \".fuxngvv:hover .fui-Icon-regular{display:none;}\", \".fp258yr:hover .fui-MenuItem__icon{color:var(--colorNeutralForeground2BrandSelected);}\", \".f1jp5ecu:hover{color:var(--colorNeutralForeground3Hover);}\", \".fvgxktp:hover{color:var(--colorNeutralForegroundDisabled);}\", \".f1ijtazh:hover{background-color:var(--colorNeutralBackground1);}\", \".fphbwmw:hover{cursor:not-allowed;}\", \".f19vpps7:hover .fui-Icon-filled{display:none;}\", \".fv5swzo:hover .fui-Icon-regular{display:inline;}\", \".f1q1x1ba:hover .fui-MenuItem__icon{color:var(--colorNeutralForegroundDisabled);}\"],\n m: [[\"@media (forced-colors: active){.f1dcs8yz{color:GrayText;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1kc2mi9:hover{color:GrayText;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.fk56vqo:hover .fui-MenuItem__icon{color:GrayText;}}\", {\n m: \"(forced-colors: active)\"\n }], [\"@media (forced-colors: active){.f1ikwg0d:focus{color:GrayText;}}\", {\n m: \"(forced-colors: active)\"\n }]]\n});\n/** Applies style classnames to slots */\nexport const useMenuItemStyles_unstable = state => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuItemClassNames.root, styles.root, styles.focusIndicator, state.disabled && styles.disabled, state.root.className);\n if (state.content) {\n state.content.className = mergeClasses(menuItemClassNames.content, styles.content, state.content.className);\n }\n if (state.checkmark) {\n state.checkmark.className = mergeClasses(menuItemClassNames.checkmark, state.checkmark.className);\n }\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(menuItemClassNames.secondaryContent, !state.disabled && styles.secondaryContent, state.secondaryContent.className);\n }\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemClassNames.icon, styles.icon, state.icon.className);\n }\n if (state.submenuIndicator) {\n state.submenuIndicator.className = mergeClasses(menuItemClassNames.submenuIndicator, styles.submenuIndicator, state.submenuIndicator.className);\n }\n useCheckmarkStyles_unstable(state);\n};\n//# sourceMappingURL=useMenuItemStyles.styles.js.map"],"names":["menuItemClassNames","useMenuItemStyles_unstable","root","icon","checkmark","submenuIndicator","content","secondaryContent","useStyles","__styles","focusIndicator","Brovlpu","B486eqv","B8q5s1w","Bci5o5g","n8qw10","Bdrgwmp","Bm4h7ae","B7ys5i9","Busjfv9","Bhk32uz","Bf4ptjt","kclons","Bhdgwq3","Blkhhs4","Bqtpl0w","clg4pj","hgwjuy","Bonggc9","B1tsrr9","Dah5zi","Bkh64rk","qqdqy8","B6dhp37","i03rao","Boxcth7","Bsom6fd","J0r882","Bule8hv","Bjwuhne","Ghsupd","Bbmb7ep","Beyfa6y","B7oj6ja","Btl43ni","qhf8xq","sj55zd","De3pzq","z189sj","uwmqm3","Bqenvij","sshi5w","mc9l5x","Bt984gj","Be2twd7","Bceei9c","i8kkvl","Belr9w4","Jwef8y","Bi91k9c","Bk3fhr4","Bmfj8id","Bg7n49j","famaaq","Bh6795r","t0hwav","a9b677","Bg96gwp","Brf1p80","disabled","eoavqd","Bbusuzp","ze5xyy","Bctn1xl","Bh6z0a4","f","i","d","h","m","state","styles","className","mergeClasses","useCheckmarkStyles_unstable"],"mappings":";;;;;;;;;;;IAKaA,kBAAkB,MAAlBA;IA+HAC,0BAA0B,MAA1BA;;uBApIsC;uBAIP;AACrC,MAAMD,qBAAqB;IAChCE,MAAM;IACNC,MAAM;IACNC,WA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AM3E,gBAAgB,EAAE;QAC1B2E,MAAM3E,gBAAgB,CAAC6E,SAAS,GAAGC,IAAAA,mBAAY,EAACnF,mBAAmBK,gBAAgB,EAAE4E,OAAO5E,gBAAgB,EAAE2E,MAAM3E,gBAAgB,CAAC6E,SAAS;IAChJ,CAAC;IACDE,IAAAA,kCAA2B,EAACJ;AAC9B,GACA,oDAAoD"}
|
@@ -40,7 +40,7 @@ const useMenuTrigger_unstable = (props)=>{
|
|
40
40
|
const OpenArrowKey = dir === 'ltr' ? _keyboardKeys.ArrowRight : _keyboardKeys.ArrowLeft;
|
41
41
|
const child = (0, _reactUtilities.getTriggerChild)(children);
|
42
42
|
const onContextMenu = (event)=>{
|
43
|
-
if (isTargetDisabled(event)) {
|
43
|
+
if (isTargetDisabled(event) || event.isDefaultPrevented()) {
|
44
44
|
return;
|
45
45
|
}
|
46
46
|
if (openOnContext) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["useMenuTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useFocusFinders, useRestoreFocusTarget } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';\nimport { applyTriggerPropsToChildren, getTriggerChild, isHTMLElement, mergeCallbacks, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n/**\n * Create the state required to render MenuTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup menu\n *\n * @param props - props from this instance of MenuTrigger\n */ export const useMenuTrigger_unstable = (props)=>{\n const { children , disableButtonEnhancement =false } = props;\n const triggerRef = useMenuContext_unstable((context)=>context.triggerRef);\n const menuPopoverRef = useMenuContext_unstable((context)=>context.menuPopoverRef);\n const setOpen = useMenuContext_unstable((context)=>context.setOpen);\n const open = useMenuContext_unstable((context)=>context.open);\n const triggerId = useMenuContext_unstable((context)=>context.triggerId);\n const openOnHover = useMenuContext_unstable((context)=>context.openOnHover);\n const openOnContext = useMenuContext_unstable((context)=>context.openOnContext);\n const restoreFocusTargetAttribute = useRestoreFocusTarget();\n const isSubmenu = useIsSubmenu();\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(()=>{\n const firstFocusable = findFirstFocusable(menuPopoverRef.current);\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }, [\n findFirstFocusable,\n menuPopoverRef\n ]);\n const openedWithKeyboardRef = React.useRef(false);\n const hasMouseMoved = React.useRef(false);\n const { dir } = useFluent();\n const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;\n const child = getTriggerChild(children);\n const onContextMenu = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnContext) {\n event.preventDefault();\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerContextMenu',\n event\n });\n }\n };\n const onClick = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (!openOnContext) {\n setOpen(event, {\n open: !open,\n keyboard: openedWithKeyboardRef.current,\n type: 'menuTriggerClick',\n event\n });\n openedWithKeyboardRef.current = false;\n }\n };\n const onKeyDown = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n const key = event.key;\n if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === ArrowDown)) {\n setOpen(event, {\n open: true,\n keyboard: true,\n type: 'menuTriggerKeyDown',\n event\n });\n }\n if (key === Escape && !isSubmenu) {\n setOpen(event, {\n open: false,\n keyboard: true,\n type: 'menuTriggerKeyDown',\n event\n });\n }\n // if menu is already open, can't rely on effects to focus\n if (open && key === OpenArrowKey && isSubmenu) {\n focusFirst();\n }\n };\n const onMouseEnter = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && hasMouseMoved.current) {\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerMouseEnter',\n event\n });\n }\n };\n // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience\n // First time open the mouse using mousemove and then continue with mouseenter\n // Only use once to determine that the user is using the mouse since it is an expensive event to handle\n const onMouseMove = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && !hasMouseMoved.current) {\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerMouseMove',\n event\n });\n hasMouseMoved.current = true;\n }\n };\n const onMouseLeave = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover) {\n setOpen(event, {\n open: false,\n keyboard: false,\n type: 'menuTriggerMouseLeave',\n event\n });\n }\n };\n const contextMenuProps = {\n id: triggerId,\n ...child === null || child === void 0 ? void 0 : child.props,\n ref: useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref),\n onMouseEnter: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onContextMenu, onContextMenu)),\n onMouseMove: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseMove, onMouseMove))\n };\n const triggerChildProps = {\n 'aria-haspopup': 'menu',\n 'aria-expanded': !open && !isSubmenu ? undefined : open,\n ...restoreFocusTargetAttribute,\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onKeyDown, onKeyDown))\n };\n const ariaButtonTriggerChildProps = useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', triggerChildProps);\n return {\n isSubmenu,\n children: applyTriggerPropsToChildren(children, openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)\n };\n};\nconst isTargetDisabled = (event)=>{\n const isDisabled = (el)=>el.hasAttribute('disabled') || el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true';\n if (isHTMLElement(event.target) && isDisabled(event.target)) {\n return true;\n }\n return isHTMLElement(event.currentTarget) && isDisabled(event.currentTarget);\n};\n"],"names":["useMenuTrigger_unstable","props","children","disableButtonEnhancement","triggerRef","useMenuContext_unstable","context","menuPopoverRef","setOpen","open","triggerId","openOnHover","openOnContext","restoreFocusTargetAttribute","useRestoreFocusTarget","isSubmenu","useIsSubmenu","findFirstFocusable","useFocusFinders","focusFirst","React","useCallback","firstFocusable","current","focus","openedWithKeyboardRef","useRef","hasMouseMoved","dir","useFluent","OpenArrowKey","ArrowRight","ArrowLeft","child","getTriggerChild","onContextMenu","event","isTargetDisabled","preventDefault","keyboard","type","onClick","onKeyDown","key","ArrowDown","Escape","onMouseEnter","onMouseMove","onMouseLeave","contextMenuProps","id","ref","useMergedRefs","useEventCallback","mergeCallbacks","triggerChildProps","undefined","ariaButtonTriggerChildProps","useARIAButtonProps","applyTriggerPropsToChildren","isDisabled","el","hasAttribute","getAttribute","isHTMLElement","target","currentTarget"],"mappings":";;;;+BAaiBA;;aAAAA;;;6DAbM;6BACiB;8BACX;8BAC0B;qCACP;8BACS;gCACoE;2BAC1F;AAMxB,MAAMA,0BAA0B,CAACC,QAAQ;IAChD,MAAM,EAAEC,SAAQ,EAAGC,0BAA0B,KAAK,CAAA,EAAG,GAAGF;IACxD,MAAMG,aAAaC,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQF,UAAU;IACxE,MAAMG,iBAAiBF,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQC,cAAc;IAChF,MAAMC,UAAUH,IAAAA,oCAAuB,EAAC,CAACC,UAAUA,QAAQE,OAAO;IAClE,MA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AK,IAAI,KAAK,IAAIA,MAAMhC,KAAK,CAACwC,OAAO,EAAEA;QAC5GC,WAAWW,IAAAA,gCAAgB,EAACC,IAAAA,8BAAc,EAACrB,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMhC,KAAK,CAACyC,SAAS,EAAEA;IACpH;IACA,MAAMe,8BAA8BC,IAAAA,6BAAkB,EAAC,AAACzB,CAAAA,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMO,IAAI,AAAD,MAAO,YAAY,AAACP,CAAAA,UAAU,IAAI,IAAIA,UAAU,KAAK,IAAI,KAAK,IAAIA,MAAMO,IAAI,AAAD,MAAO,MAAMP,MAAMO,IAAI,GAAG,KAAK,EAAEe;IAC3N,OAAO;QACHxC;QACAb,UAAUyD,IAAAA,2CAA2B,EAACzD,UAAUU,gBAAgBqC,mBAAmB9C,2BAA2BoD,oBAAoBE,2BAA2B;IACjK;AACJ;AACA,MAAMpB,mBAAmB,CAACD,QAAQ;IAC9B,MAAMwB,aAAa,CAACC,KAAKA,GAAGC,YAAY,CAAC,eAAeD,GAAGC,YAAY,CAAC,oBAAoBD,GAAGE,YAAY,CAAC,qBAAqB;IACjI,IAAIC,IAAAA,6BAAa,EAAC5B,MAAM6B,MAAM,KAAKL,WAAWxB,MAAM6B,MAAM,GAAG;QACzD,OAAO,IAAI;IACf,CAAC;IACD,OAAOD,IAAAA,6BAAa,EAAC5B,MAAM8B,aAAa,KAAKN,WAAWxB,MAAM8B,aAAa;AAC/E"}
|
1
|
+
{"version":3,"sources":["useMenuTrigger.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport { useFocusFinders, useRestoreFocusTarget } from '@fluentui/react-tabster';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { ArrowRight, ArrowLeft, Escape, ArrowDown } from '@fluentui/keyboard-keys';\nimport { applyTriggerPropsToChildren, getTriggerChild, isHTMLElement, mergeCallbacks, useEventCallback, useMergedRefs } from '@fluentui/react-utilities';\nimport { useARIAButtonProps } from '@fluentui/react-aria';\n/**\n * Create the state required to render MenuTrigger.\n * Clones the only child component and adds necessary event handling behaviours to open a popup menu\n *\n * @param props - props from this instance of MenuTrigger\n */ export const useMenuTrigger_unstable = (props)=>{\n const { children , disableButtonEnhancement =false } = props;\n const triggerRef = useMenuContext_unstable((context)=>context.triggerRef);\n const menuPopoverRef = useMenuContext_unstable((context)=>context.menuPopoverRef);\n const setOpen = useMenuContext_unstable((context)=>context.setOpen);\n const open = useMenuContext_unstable((context)=>context.open);\n const triggerId = useMenuContext_unstable((context)=>context.triggerId);\n const openOnHover = useMenuContext_unstable((context)=>context.openOnHover);\n const openOnContext = useMenuContext_unstable((context)=>context.openOnContext);\n const restoreFocusTargetAttribute = useRestoreFocusTarget();\n const isSubmenu = useIsSubmenu();\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(()=>{\n const firstFocusable = findFirstFocusable(menuPopoverRef.current);\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }, [\n findFirstFocusable,\n menuPopoverRef\n ]);\n const openedWithKeyboardRef = React.useRef(false);\n const hasMouseMoved = React.useRef(false);\n const { dir } = useFluent();\n const OpenArrowKey = dir === 'ltr' ? ArrowRight : ArrowLeft;\n const child = getTriggerChild(children);\n const onContextMenu = (event)=>{\n if (isTargetDisabled(event) || event.isDefaultPrevented()) {\n return;\n }\n if (openOnContext) {\n event.preventDefault();\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerContextMenu',\n event\n });\n }\n };\n const onClick = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (!openOnContext) {\n setOpen(event, {\n open: !open,\n keyboard: openedWithKeyboardRef.current,\n type: 'menuTriggerClick',\n event\n });\n openedWithKeyboardRef.current = false;\n }\n };\n const onKeyDown = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n const key = event.key;\n if (!openOnContext && (isSubmenu && key === OpenArrowKey || !isSubmenu && key === ArrowDown)) {\n setOpen(event, {\n open: true,\n keyboard: true,\n type: 'menuTriggerKeyDown',\n event\n });\n }\n if (key === Escape && !isSubmenu) {\n setOpen(event, {\n open: false,\n keyboard: true,\n type: 'menuTriggerKeyDown',\n event\n });\n }\n // if menu is already open, can't rely on effects to focus\n if (open && key === OpenArrowKey && isSubmenu) {\n focusFirst();\n }\n };\n const onMouseEnter = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && hasMouseMoved.current) {\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerMouseEnter',\n event\n });\n }\n };\n // Opening a menu when a mouse hasn't moved and just entering the trigger is a bad a11y experience\n // First time open the mouse using mousemove and then continue with mouseenter\n // Only use once to determine that the user is using the mouse since it is an expensive event to handle\n const onMouseMove = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover && !hasMouseMoved.current) {\n setOpen(event, {\n open: true,\n keyboard: false,\n type: 'menuTriggerMouseMove',\n event\n });\n hasMouseMoved.current = true;\n }\n };\n const onMouseLeave = (event)=>{\n if (isTargetDisabled(event)) {\n return;\n }\n if (openOnHover) {\n setOpen(event, {\n open: false,\n keyboard: false,\n type: 'menuTriggerMouseLeave',\n event\n });\n }\n };\n const contextMenuProps = {\n id: triggerId,\n ...child === null || child === void 0 ? void 0 : child.props,\n ref: useMergedRefs(triggerRef, child === null || child === void 0 ? void 0 : child.ref),\n onMouseEnter: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseEnter, onMouseEnter)),\n onMouseLeave: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseLeave, onMouseLeave)),\n onContextMenu: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onContextMenu, onContextMenu)),\n onMouseMove: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onMouseMove, onMouseMove))\n };\n const triggerChildProps = {\n 'aria-haspopup': 'menu',\n 'aria-expanded': !open && !isSubmenu ? undefined : open,\n ...restoreFocusTargetAttribute,\n ...contextMenuProps,\n onClick: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onClick, onClick)),\n onKeyDown: useEventCallback(mergeCallbacks(child === null || child === void 0 ? void 0 : child.props.onKeyDown, onKeyDown))\n };\n const ariaButtonTriggerChildProps = useARIAButtonProps((child === null || child === void 0 ? void 0 : child.type) === 'button' || (child === null || child === void 0 ? void 0 : child.type) === 'a' ? child.type : 'div', triggerChildProps);\n return {\n isSubmenu,\n children: applyTriggerPropsToChildren(children, openOnContext ? contextMenuProps : disableButtonEnhancement ? triggerChildProps : ariaButtonTriggerChildProps)\n };\n};\nconst isTargetDisabled = (event)=>{\n const isDisabled = (el)=>el.hasAttribute('disabled') || el.hasAttribute('aria-disabled') && el.getAttribute('aria-disabled') === 'true';\n if (isHTMLElement(event.target) && isDisabled(event.target)) {\n return true;\n }\n return isHTMLElement(event.currentTarget) && isDisabled(event.currentTarget);\n};\n"],"names":["useMenuTrigger_unstable","props","children","disableButtonEnhancement","triggerRef","useMenuContext_unstable","context","menuPopoverRef","setOpen","open","triggerId","openOnHover","openOnContext","restoreFocusTargetAttribute","useRestoreFocusTarget","isSubmenu","useIsSubmenu","findFirstFocusable","useFocusFinders","focusFirst","React","useCallback","firstFocusable","current","focus","openedWithKeyboardRef","useRef","hasMouseMoved","dir","useFluent","OpenArrowKey","ArrowRight","ArrowLeft","child","getTriggerChild","onContextMenu","event","isTargetDisabled","isDefaultPrevented","preventDefault","keyboard","type","onClick","onKeyDown","key","ArrowDown","Escape","onMouseEnter","onMouseMove","onMouseLeave","contextMenuProps","id","ref","useMergedRefs","useEventCallback","mergeCallbacks","triggerChildProps","undefined","ariaButtonTriggerChildProps","useARIAButtonProps","applyTriggerPropsToChildren","isDisabled","el","hasAttribute","getAttribute","isHTMLElement","target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MAAM8B,MAAM,KAAKL,WAAWzB,MAAM8B,MAAM,GAAG;QACzD,OAAO,IAAI;IACf,CAAC;IACD,OAAOD,IAAAA,6BAAa,EAAC7B,MAAM+B,aAAa,KAAKN,WAAWzB,MAAM+B,aAAa;AAC/E"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-menu",
|
3
|
-
"version": "9.12.
|
3
|
+
"version": "9.12.3",
|
4
4
|
"description": "Fluent UI menu component",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
@@ -37,16 +37,16 @@
|
|
37
37
|
},
|
38
38
|
"dependencies": {
|
39
39
|
"@fluentui/keyboard-keys": "^9.0.3",
|
40
|
-
"@fluentui/react-aria": "^9.3.
|
41
|
-
"@fluentui/react-context-selector": "^9.1.
|
40
|
+
"@fluentui/react-aria": "^9.3.28",
|
41
|
+
"@fluentui/react-context-selector": "^9.1.27",
|
42
42
|
"@fluentui/react-icons": "^2.0.207",
|
43
|
-
"@fluentui/react-portal": "^9.3.
|
44
|
-
"@fluentui/react-positioning": "^9.9.
|
45
|
-
"@fluentui/react-shared-contexts": "^9.7.
|
46
|
-
"@fluentui/react-tabster": "^9.
|
47
|
-
"@fluentui/react-theme": "^9.1.
|
48
|
-
"@fluentui/react-utilities": "^9.
|
49
|
-
"@fluentui/react-jsx-runtime": "9.0.0-alpha.
|
43
|
+
"@fluentui/react-portal": "^9.3.5",
|
44
|
+
"@fluentui/react-positioning": "^9.9.2",
|
45
|
+
"@fluentui/react-shared-contexts": "^9.7.1",
|
46
|
+
"@fluentui/react-tabster": "^9.12.0",
|
47
|
+
"@fluentui/react-theme": "^9.1.10",
|
48
|
+
"@fluentui/react-utilities": "^9.11.0",
|
49
|
+
"@fluentui/react-jsx-runtime": "9.0.0-alpha.13",
|
50
50
|
"@griffel/react": "^1.5.7",
|
51
51
|
"@swc/helpers": "^0.4.14"
|
52
52
|
},
|