@fluentui/react-menu 0.0.0-nightly-20230424-0419.1 → 0.0.0-nightly-20230426-0420.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 +46 -25
- package/CHANGELOG.md +25 -15
- package/lib/components/Menu/useMenu.js +3 -1
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.js +2 -5
- package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.js +2 -5
- package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js +2 -5
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.js +2 -5
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +2 -5
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.js +2 -5
- package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib/components/MenuList/MenuList.js +2 -5
- package/lib/components/MenuList/MenuList.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.js +2 -5
- package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js +2 -5
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenu.js +2 -1
- package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.js +1 -2
- package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.js +1 -2
- package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +1 -2
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.js +1 -2
- package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +1 -2
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +1 -2
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.js +1 -2
- package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.js +1 -2
- package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +1 -2
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/package.json +12 -12
package/CHANGELOG.json
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
"name": "@fluentui/react-menu",
|
|
3
3
|
"entries": [
|
|
4
4
|
{
|
|
5
|
-
"date": "
|
|
6
|
-
"tag": "@fluentui/react-menu_v0.0.0-nightly-
|
|
7
|
-
"version": "0.0.0-nightly-
|
|
5
|
+
"date": "Wed, 26 Apr 2023 04:27:01 GMT",
|
|
6
|
+
"tag": "@fluentui/react-menu_v0.0.0-nightly-20230426-0420.1",
|
|
7
|
+
"version": "0.0.0-nightly-20230426-0420.1",
|
|
8
8
|
"comments": {
|
|
9
9
|
"prerelease": [
|
|
10
10
|
{
|
|
@@ -16,68 +16,89 @@
|
|
|
16
16
|
{
|
|
17
17
|
"author": "beachball",
|
|
18
18
|
"package": "@fluentui/react-menu",
|
|
19
|
-
"comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-
|
|
20
|
-
"commit": "
|
|
19
|
+
"comment": "Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230426-0420.1",
|
|
20
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
"author": "beachball",
|
|
24
24
|
"package": "@fluentui/react-menu",
|
|
25
|
-
"comment": "Bump @fluentui/react-aria to v0.0.0-nightly-
|
|
26
|
-
"commit": "
|
|
25
|
+
"comment": "Bump @fluentui/react-aria to v0.0.0-nightly-20230426-0420.1",
|
|
26
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
29
|
"author": "beachball",
|
|
30
30
|
"package": "@fluentui/react-menu",
|
|
31
|
-
"comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-
|
|
32
|
-
"commit": "
|
|
31
|
+
"comment": "Bump @fluentui/react-context-selector to v0.0.0-nightly-20230426-0420.1",
|
|
32
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
"author": "beachball",
|
|
36
36
|
"package": "@fluentui/react-menu",
|
|
37
|
-
"comment": "Bump @fluentui/react-portal to v0.0.0-nightly-
|
|
38
|
-
"commit": "
|
|
37
|
+
"comment": "Bump @fluentui/react-portal to v0.0.0-nightly-20230426-0420.1",
|
|
38
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
"author": "beachball",
|
|
42
42
|
"package": "@fluentui/react-menu",
|
|
43
|
-
"comment": "Bump @fluentui/react-positioning to v0.0.0-nightly-
|
|
44
|
-
"commit": "
|
|
43
|
+
"comment": "Bump @fluentui/react-positioning to v0.0.0-nightly-20230426-0420.1",
|
|
44
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"author": "beachball",
|
|
48
48
|
"package": "@fluentui/react-menu",
|
|
49
|
-
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
|
50
|
-
"commit": "
|
|
49
|
+
"comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230426-0420.1",
|
|
50
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
"author": "beachball",
|
|
54
54
|
"package": "@fluentui/react-menu",
|
|
55
|
-
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-
|
|
56
|
-
"commit": "
|
|
55
|
+
"comment": "Bump @fluentui/react-tabster to v0.0.0-nightly-20230426-0420.1",
|
|
56
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
"author": "beachball",
|
|
60
60
|
"package": "@fluentui/react-menu",
|
|
61
|
-
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-
|
|
62
|
-
"commit": "
|
|
61
|
+
"comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20230426-0420.1",
|
|
62
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"author": "beachball",
|
|
66
66
|
"package": "@fluentui/react-menu",
|
|
67
|
-
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-
|
|
68
|
-
"commit": "
|
|
67
|
+
"comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20230426-0420.1",
|
|
68
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
"author": "beachball",
|
|
72
72
|
"package": "@fluentui/react-menu",
|
|
73
|
-
"comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-
|
|
74
|
-
"commit": "
|
|
73
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230426-0420.1",
|
|
74
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
77
|
"author": "beachball",
|
|
78
78
|
"package": "@fluentui/react-menu",
|
|
79
|
-
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
|
80
|
-
"commit": "
|
|
79
|
+
"comment": "Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230426-0420.1",
|
|
80
|
+
"commit": "0bf57d44764cd2220ffb39eaa3256f208e17fc9c"
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"date": "Mon, 24 Apr 2023 08:12:38 GMT",
|
|
87
|
+
"tag": "@fluentui/react-menu_v9.7.10",
|
|
88
|
+
"version": "9.7.10",
|
|
89
|
+
"comments": {
|
|
90
|
+
"patch": [
|
|
91
|
+
{
|
|
92
|
+
"author": "bernardo.sunderhus@gmail.com",
|
|
93
|
+
"package": "@fluentui/react-menu",
|
|
94
|
+
"commit": "85c36e249b33b0bad79be4edd1a943dfc5233b11",
|
|
95
|
+
"comment": "bugfix: remove caret from react-jsx-runtime prerelease dependency"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"author": "beachball",
|
|
99
|
+
"package": "@fluentui/react-menu",
|
|
100
|
+
"comment": "Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2",
|
|
101
|
+
"commit": "505433ac64f144c9cca456097413d6af4582e5ee"
|
|
81
102
|
}
|
|
82
103
|
]
|
|
83
104
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,28 +1,38 @@
|
|
|
1
1
|
# Change Log - @fluentui/react-menu
|
|
2
2
|
|
|
3
|
-
This log was last generated on
|
|
3
|
+
This log was last generated on Wed, 26 Apr 2023 04:27:01 GMT and should not be manually modified.
|
|
4
4
|
|
|
5
5
|
<!-- Start content -->
|
|
6
6
|
|
|
7
|
-
## [0.0.0-nightly-
|
|
7
|
+
## [0.0.0-nightly-20230426-0420.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-menu_v0.0.0-nightly-20230426-0420.1)
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-menu_v9.7.
|
|
9
|
+
Wed, 26 Apr 2023 04:27:01 GMT
|
|
10
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-menu_v9.7.10..@fluentui/react-menu_v0.0.0-nightly-20230426-0420.1)
|
|
11
11
|
|
|
12
12
|
### Changes
|
|
13
13
|
|
|
14
14
|
- Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
|
|
15
|
-
- Bump @fluentui/keyboard-keys to v0.0.0-nightly-
|
|
16
|
-
- Bump @fluentui/react-aria to v0.0.0-nightly-
|
|
17
|
-
- Bump @fluentui/react-context-selector to v0.0.0-nightly-
|
|
18
|
-
- Bump @fluentui/react-portal to v0.0.0-nightly-
|
|
19
|
-
- Bump @fluentui/react-positioning to v0.0.0-nightly-
|
|
20
|
-
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-
|
|
21
|
-
- Bump @fluentui/react-tabster to v0.0.0-nightly-
|
|
22
|
-
- Bump @fluentui/react-theme to v0.0.0-nightly-
|
|
23
|
-
- Bump @fluentui/react-utilities to v0.0.0-nightly-
|
|
24
|
-
- Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-
|
|
25
|
-
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-
|
|
15
|
+
- Bump @fluentui/keyboard-keys to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
|
16
|
+
- Bump @fluentui/react-aria to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
|
17
|
+
- Bump @fluentui/react-context-selector to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
|
18
|
+
- Bump @fluentui/react-portal to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
|
19
|
+
- Bump @fluentui/react-positioning to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
|
20
|
+
- Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
|
21
|
+
- Bump @fluentui/react-tabster to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
|
22
|
+
- Bump @fluentui/react-theme to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
|
23
|
+
- Bump @fluentui/react-utilities to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
|
24
|
+
- Bump @fluentui/react-jsx-runtime to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
|
25
|
+
- Bump @fluentui/react-conformance-griffel to v0.0.0-nightly-20230426-0420.1 ([commit](https://github.com/microsoft/fluentui/commit/0bf57d44764cd2220ffb39eaa3256f208e17fc9c) by beachball)
|
|
26
|
+
|
|
27
|
+
## [9.7.10](https://github.com/microsoft/fluentui/tree/@fluentui/react-menu_v9.7.10)
|
|
28
|
+
|
|
29
|
+
Mon, 24 Apr 2023 08:12:38 GMT
|
|
30
|
+
[Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-menu_v9.7.9..@fluentui/react-menu_v9.7.10)
|
|
31
|
+
|
|
32
|
+
### Patches
|
|
33
|
+
|
|
34
|
+
- bugfix: remove caret from react-jsx-runtime prerelease dependency ([PR #27588](https://github.com/microsoft/fluentui/pull/27588) by bernardo.sunderhus@gmail.com)
|
|
35
|
+
- Bump @fluentui/react-jsx-runtime to v9.0.0-alpha.2 ([commit](https://github.com/microsoft/fluentui/commit/505433ac64f144c9cca456097413d6af4582e5ee) by beachball)
|
|
26
36
|
|
|
27
37
|
## [9.7.9](https://github.com/microsoft/fluentui/tree/@fluentui/react-menu_v9.7.9)
|
|
28
38
|
|
|
@@ -260,7 +260,9 @@ const useMenuOpenState = state => {
|
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
|
-
|
|
263
|
+
// firstMount change should not re-run this effect
|
|
264
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
265
|
+
}, [state.triggerRef, state.isSubmenu, open, focusFirst, targetDocument, state.menuPopoverRef]);
|
|
264
266
|
return [open, setOpen];
|
|
265
267
|
};
|
|
266
268
|
//# sourceMappingURL=useMenu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","usePositioningMouseTarget","usePositioning","resolvePositioningShorthand","useControllableState","useId","useOnClickOutside","useEventCallback","useOnScrollOutside","useFirstMount","useFluent_unstable","useFluent","elementContains","useFocusFinders","useMenuContext_unstable","MENU_ENTER_EVENT","useOnMenuMouseEnter","useIsSubmenu","submenuFallbackPositions","useMenu_unstable","props","isSubmenu","hoverDelay","inline","hasCheckmarks","hasIcons","closeOnScroll","openOnContext","persistOnItemClick","openOnHover","defaultCheckedValues","mountNode","triggerId","contextTarget","setContextTarget","positioningState","position","align","target","undefined","fallbackPositions","positioning","children","Children","toArray","process","env","NODE_ENV","length","console","warn","menuTrigger","menuPopover","targetRef","triggerRef","containerRef","menuPopoverRef","open","setOpen","useMenuOpenState","defaultOpen","onOpenChange","checkedValues","onCheckedValueChange","useMenuSelectableState","components","setCheckedValues","state","defaultState","initialState","e","name","checkedItems","_props_onCheckedValueChange","call","currentValue","targetDocument","parentSetOpen","context","data","_state_onOpenChange","setOpenTimeout","useRef","enteringTriggerRef","setOpenState","trySetOpen","event","CustomEvent","type","detail","nativeEvent","bubble","clearTimeout","current","Event","persist","_state_triggerRef_current","contains","setTimeout","disabled","element","refs","filter","Boolean","callback","useEffect","findFirstFocusable","focusFirst","useCallback","firstFocusable","focus","firstMount","activeElement","body"],"sources":["../../../src/components/Menu/useMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n usePositioningMouseTarget,\n usePositioning,\n resolvePositioningShorthand,\n PositioningShorthandValue,\n} from '@fluentui/react-positioning';\nimport {\n useControllableState,\n useId,\n useOnClickOutside,\n useEventCallback,\n useOnScrollOutside,\n useFirstMount,\n} from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { MENU_ENTER_EVENT, useOnMenuMouseEnter } from '../../utils/index';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport type { MenuOpenChangeData, MenuOpenEvent, MenuProps, MenuState } from './Menu.types';\n\n// If it's not possible to position the submenu in smaller viewports, try\n// and fallback to this order of positions\nconst submenuFallbackPositions: PositioningShorthandValue[] = [\n 'after',\n 'after-bottom',\n 'before-top',\n 'before',\n 'before-bottom',\n 'above',\n];\n\n/**\n * Create the state required to render Menu.\n *\n * The returned state can be modified with hooks such as useMenuStyles,\n * before being passed to renderMenu_unstable.\n *\n * @param props - props from this instance of Menu\n */\nexport const useMenu_unstable = (props: MenuProps): MenuState => {\n const isSubmenu = useIsSubmenu();\n const {\n hoverDelay = 500,\n inline = false,\n hasCheckmarks = false,\n hasIcons = false,\n closeOnScroll = false,\n openOnContext = false,\n persistOnItemClick = false,\n openOnHover = isSubmenu,\n defaultCheckedValues,\n mountNode = null,\n } = props;\n const triggerId = useId('menu');\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n\n const positioningState = {\n position: isSubmenu ? 'after' : 'below',\n align: isSubmenu ? 'top' : 'start',\n target: props.openOnContext ? contextTarget : undefined,\n fallbackPositions: isSubmenu ? submenuFallbackPositions : undefined,\n ...resolvePositioningShorthand(props.positioning),\n } as const;\n\n const children = React.Children.toArray(props.children) as React.ReactElement[];\n\n if (process.env.NODE_ENV !== 'production') {\n if (children.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at least one child');\n }\n\n if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at most two children');\n }\n }\n\n let menuTrigger: React.ReactElement | undefined = undefined;\n let menuPopover: React.ReactElement | undefined = undefined;\n if (children.length === 2) {\n menuTrigger = children[0];\n menuPopover = children[1];\n } else if (children.length === 1) {\n menuPopover = children[0];\n }\n\n const { targetRef: triggerRef, containerRef: menuPopoverRef } = usePositioning(positioningState);\n\n // TODO Better way to narrow types ?\n const [open, setOpen] = useMenuOpenState({\n hoverDelay,\n isSubmenu,\n setContextTarget,\n closeOnScroll,\n menuPopoverRef,\n triggerRef,\n open: props.open,\n defaultOpen: props.defaultOpen,\n onOpenChange: props.onOpenChange,\n openOnContext,\n });\n\n const [checkedValues, onCheckedValueChange] = useMenuSelectableState({\n checkedValues: props.checkedValues,\n defaultCheckedValues,\n onCheckedValueChange: props.onCheckedValueChange,\n });\n\n return {\n inline,\n hoverDelay,\n triggerId,\n isSubmenu,\n openOnHover,\n contextTarget,\n setContextTarget,\n hasCheckmarks,\n hasIcons,\n closeOnScroll,\n menuTrigger,\n menuPopover,\n mountNode,\n triggerRef,\n menuPopoverRef,\n components: {},\n openOnContext,\n open,\n setOpen,\n checkedValues,\n onCheckedValueChange,\n persistOnItemClick,\n };\n};\n\n/**\n * Adds appropriate state values and handlers for selectable items\n * i.e checkboxes and radios\n */\nconst useMenuSelectableState = (\n props: Pick<MenuProps, 'checkedValues' | 'defaultCheckedValues' | 'onCheckedValueChange'>,\n) => {\n const [checkedValues, setCheckedValues] = useControllableState({\n state: props.checkedValues,\n defaultState: props.defaultCheckedValues,\n initialState: {},\n });\n const onCheckedValueChange: MenuState['onCheckedValueChange'] = useEventCallback((e, { name, checkedItems }) => {\n props.onCheckedValueChange?.(e, { name, checkedItems });\n\n setCheckedValues(currentValue => ({\n ...currentValue,\n [name]: checkedItems,\n }));\n });\n\n return [checkedValues, onCheckedValueChange] as const;\n};\n\nconst useMenuOpenState = (\n state: Pick<\n MenuState,\n | 'isSubmenu'\n | 'menuPopoverRef'\n | 'setContextTarget'\n | 'triggerRef'\n | 'openOnContext'\n | 'closeOnScroll'\n | 'hoverDelay'\n > &\n Pick<MenuProps, 'open' | 'defaultOpen' | 'onOpenChange'>,\n) => {\n const { targetDocument } = useFluent();\n const parentSetOpen = useMenuContext_unstable(context => context.setOpen);\n const onOpenChange: MenuProps['onOpenChange'] = useEventCallback((e, data) => state.onOpenChange?.(e, data));\n\n const setOpenTimeout = React.useRef(0);\n const enteringTriggerRef = React.useRef(false);\n\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false,\n });\n\n const trySetOpen = useEventCallback((e: MenuOpenEvent, data: MenuOpenChangeData) => {\n const event = e instanceof CustomEvent && e.type === MENU_ENTER_EVENT ? e.detail.nativeEvent : e;\n onOpenChange?.(event, { ...data });\n if (data.open && e.type === 'contextmenu') {\n state.setContextTarget(e as React.MouseEvent);\n }\n\n if (!data.open) {\n state.setContextTarget(undefined);\n }\n\n if (data.bubble) {\n parentSetOpen(e, { ...data });\n }\n\n setOpenState(data.open);\n });\n\n const setOpen = useEventCallback((e: MenuOpenEvent, data: MenuOpenChangeData) => {\n clearTimeout(setOpenTimeout.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n\n if (e.type === 'mouseleave' || e.type === 'mouseenter' || e.type === 'mousemove' || e.type === MENU_ENTER_EVENT) {\n if (state.triggerRef.current?.contains(e.target as HTMLElement)) {\n enteringTriggerRef.current = e.type === 'mouseenter' || e.type === 'mousemove';\n }\n\n // FIXME leaking Node timeout type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n setOpenTimeout.current = setTimeout(() => trySetOpen(e, data), state.hoverDelay);\n } else {\n trySetOpen(e, data);\n }\n });\n\n useOnClickOutside({\n contains: elementContains,\n disabled: !open,\n element: targetDocument,\n refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(\n Boolean,\n ) as React.MutableRefObject<HTMLElement>[],\n callback: event => setOpen(event, { open: false, type: 'clickOutside', event }),\n });\n\n // only close on scroll for context, or when closeOnScroll is specified\n const closeOnScroll = state.openOnContext || state.closeOnScroll;\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: event => setOpen(event, { open: false, type: 'scrollOutside', event }),\n refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(\n Boolean,\n ) as React.MutableRefObject<HTMLElement>[],\n disabled: !open || !closeOnScroll,\n });\n\n useOnMenuMouseEnter({\n element: targetDocument,\n callback: event => {\n // When moving from a menu directly back to its trigger, this handler can close the menu\n // Explicitly check a flag to see if this situation happens\n if (!enteringTriggerRef.current) {\n setOpen(event, { open: false, type: 'menuMouseEnter', event });\n }\n },\n disabled: !open,\n refs: [state.menuPopoverRef],\n });\n\n // Clear timeout on unmount\n // Setting state after a component unmounts can cause memory leaks\n React.useEffect(() => {\n return () => {\n clearTimeout(setOpenTimeout.current);\n };\n }, []);\n\n // Manage focus for open state\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(state.menuPopoverRef.current);\n firstFocusable?.focus();\n }, [findFirstFocusable, state.menuPopoverRef]);\n\n const firstMount = useFirstMount();\n React.useEffect(() => {\n if (open) {\n focusFirst();\n } else {\n if (!firstMount) {\n if (targetDocument?.activeElement === targetDocument?.body) {\n // We know that React effects are sync so we focus the trigger here\n // after any event handler (event handlers will update state and re-render).\n // Since the browser only performs the default behaviour for the Tab key once\n // keyboard events have fully bubbled up the window, the browser will move\n // focus to the next tabbable element before/after the trigger if needed.\n // If the Tab key was not pressed, focus will remain on the trigger as expected.\n state.triggerRef.current?.focus();\n }\n }\n }\n }, [state.triggerRef, state.isSubmenu, open, focusFirst, firstMount, targetDocument, state.menuPopoverRef]);\n\n return [open, setOpen] as const;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SACEC,yBAAyB,EACzBC,cAAc,EACdC,2BAA2B,QAEtB;AACP,SACEC,oBAAoB,EACpBC,KAAK,EACLC,iBAAiB,EACjBC,gBAAgB,EAChBC,kBAAkB,EAClBC,aAAa,QACR;AACP,SAASC,kBAAA,IAAsBC,SAAS,QAAQ;AAChD,SAASC,eAAe,QAAQ;AAChC,SAASC,eAAe,QAAQ;AAChC,SAASC,uBAAuB,QAAQ;AACxC,SAASC,gBAAgB,EAAEC,mBAAmB,QAAQ;AACtD,SAASC,YAAY,QAAQ;AAG7B;AACA;AACA,MAAMC,wBAAA,GAAwD,CAC5D,SACA,gBACA,cACA,UACA,iBACA,QACD;AAED;;;;;;;;AAQA,OAAO,MAAMC,gBAAA,GAAoBC,KAAA,IAAgC;EAC/D,MAAMC,SAAA,GAAYJ,YAAA;EAClB,MAAM;IACJK,UAAA,GAAa;IACbC,MAAA,GAAS,KAAK;IACdC,aAAA,GAAgB,KAAK;IACrBC,QAAA,GAAW,KAAK;IAChBC,aAAA,GAAgB,KAAK;IACrBC,aAAA,GAAgB,KAAK;IACrBC,kBAAA,GAAqB,KAAK;IAC1BC,WAAA,GAAcR,SAAA;IACdS,oBAAA;IACAC,SAAA,GAAY;EAAI,CACjB,GAAGX,KAAA;EACJ,MAAMY,SAAA,GAAY3B,KAAA,CAAM;EACxB,MAAM,CAAC4B,aAA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cAAA,GAAiBH,kBAAA,CAAmBvC,KAAA,CAAMX,cAAc,CAACqC,OAAO;IACtEgB,cAAA,aAAAA,cAAA,uBAAAA,cAAA,CAAgBC,KAAK;EACvB,GAAG,CAACJ,kBAAA,EAAoBvC,KAAA,CAAMX,cAAc,CAAC;EAE7C,MAAMuD,UAAA,GAAatG,aAAA;EACnBT,KAAA,CAAMyG,SAAS,CAAC,MAAM;IACpB,IAAIhD,IAAA,EAAM;MACRkD,UAAA;IACF,OAAO;MACL,IAAI,CAACI,UAAA,EAAY;QACf,IAAI,CAAAnC,cAAA,aAAAA,cAAA,uBAAAA,cAAA,CAAgBoC,aAAa,OAAKpC,cAAA,aAAAA,cAAA,uBAAAA,cAAA,CAAgBqC,IAAI,CAAD,EAAG;;UAC1D;UACA;UACA;UACA;UACA;UACA;UACAjB,yBAAA;UAAA,CAAAA,yBAAA,GAAA7B,KAAA,CAAMb,UAAU,CAACuC,OAAO,cAAxBG,yBAAA,uBAAAA,yBAAA,CAA0Bc,KAAA;QAC5B;MACF;IACF;EACF,GAAG,CAAC3C,KAAA,CAAMb,UAAU,EAAEa,KAAA,CAAM9C,SAAS,EAAEoC,IAAA,EAAMkD,UAAA,EAAYI,UAAA,EAAYnC,cAAA,EAAgBT,KAAA,CAAMX,cAAc,CAAC;EAE1G,OAAO,CAACC,IAAA,EAAMC,OAAA,CAAQ;AACxB"}
|
|
1
|
+
{"version":3,"names":["React","usePositioningMouseTarget","usePositioning","resolvePositioningShorthand","useControllableState","useId","useOnClickOutside","useEventCallback","useOnScrollOutside","useFirstMount","useFluent_unstable","useFluent","elementContains","useFocusFinders","useMenuContext_unstable","MENU_ENTER_EVENT","useOnMenuMouseEnter","useIsSubmenu","submenuFallbackPositions","useMenu_unstable","props","isSubmenu","hoverDelay","inline","hasCheckmarks","hasIcons","closeOnScroll","openOnContext","persistOnItemClick","openOnHover","defaultCheckedValues","mountNode","triggerId","contextTarget","setContextTarget","positioningState","position","align","target","undefined","fallbackPositions","positioning","children","Children","toArray","process","env","NODE_ENV","length","console","warn","menuTrigger","menuPopover","targetRef","triggerRef","containerRef","menuPopoverRef","open","setOpen","useMenuOpenState","defaultOpen","onOpenChange","checkedValues","onCheckedValueChange","useMenuSelectableState","components","setCheckedValues","state","defaultState","initialState","e","name","checkedItems","_props_onCheckedValueChange","call","currentValue","targetDocument","parentSetOpen","context","data","_state_onOpenChange","setOpenTimeout","useRef","enteringTriggerRef","setOpenState","trySetOpen","event","CustomEvent","type","detail","nativeEvent","bubble","clearTimeout","current","Event","persist","_state_triggerRef_current","contains","setTimeout","disabled","element","refs","filter","Boolean","callback","useEffect","findFirstFocusable","focusFirst","useCallback","firstFocusable","focus","firstMount","activeElement","body"],"sources":["../../../src/components/Menu/useMenu.tsx"],"sourcesContent":["import * as React from 'react';\nimport {\n usePositioningMouseTarget,\n usePositioning,\n resolvePositioningShorthand,\n PositioningShorthandValue,\n} from '@fluentui/react-positioning';\nimport {\n useControllableState,\n useId,\n useOnClickOutside,\n useEventCallback,\n useOnScrollOutside,\n useFirstMount,\n} from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { MENU_ENTER_EVENT, useOnMenuMouseEnter } from '../../utils/index';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\nimport type { MenuOpenChangeData, MenuOpenEvent, MenuProps, MenuState } from './Menu.types';\n\n// If it's not possible to position the submenu in smaller viewports, try\n// and fallback to this order of positions\nconst submenuFallbackPositions: PositioningShorthandValue[] = [\n 'after',\n 'after-bottom',\n 'before-top',\n 'before',\n 'before-bottom',\n 'above',\n];\n\n/**\n * Create the state required to render Menu.\n *\n * The returned state can be modified with hooks such as useMenuStyles,\n * before being passed to renderMenu_unstable.\n *\n * @param props - props from this instance of Menu\n */\nexport const useMenu_unstable = (props: MenuProps): MenuState => {\n const isSubmenu = useIsSubmenu();\n const {\n hoverDelay = 500,\n inline = false,\n hasCheckmarks = false,\n hasIcons = false,\n closeOnScroll = false,\n openOnContext = false,\n persistOnItemClick = false,\n openOnHover = isSubmenu,\n defaultCheckedValues,\n mountNode = null,\n } = props;\n const triggerId = useId('menu');\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n\n const positioningState = {\n position: isSubmenu ? 'after' : 'below',\n align: isSubmenu ? 'top' : 'start',\n target: props.openOnContext ? contextTarget : undefined,\n fallbackPositions: isSubmenu ? submenuFallbackPositions : undefined,\n ...resolvePositioningShorthand(props.positioning),\n } as const;\n\n const children = React.Children.toArray(props.children) as React.ReactElement[];\n\n if (process.env.NODE_ENV !== 'production') {\n if (children.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at least one child');\n }\n\n if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at most two children');\n }\n }\n\n let menuTrigger: React.ReactElement | undefined = undefined;\n let menuPopover: React.ReactElement | undefined = undefined;\n if (children.length === 2) {\n menuTrigger = children[0];\n menuPopover = children[1];\n } else if (children.length === 1) {\n menuPopover = children[0];\n }\n\n const { targetRef: triggerRef, containerRef: menuPopoverRef } = usePositioning(positioningState);\n\n // TODO Better way to narrow types ?\n const [open, setOpen] = useMenuOpenState({\n hoverDelay,\n isSubmenu,\n setContextTarget,\n closeOnScroll,\n menuPopoverRef,\n triggerRef,\n open: props.open,\n defaultOpen: props.defaultOpen,\n onOpenChange: props.onOpenChange,\n openOnContext,\n });\n\n const [checkedValues, onCheckedValueChange] = useMenuSelectableState({\n checkedValues: props.checkedValues,\n defaultCheckedValues,\n onCheckedValueChange: props.onCheckedValueChange,\n });\n\n return {\n inline,\n hoverDelay,\n triggerId,\n isSubmenu,\n openOnHover,\n contextTarget,\n setContextTarget,\n hasCheckmarks,\n hasIcons,\n closeOnScroll,\n menuTrigger,\n menuPopover,\n mountNode,\n triggerRef,\n menuPopoverRef,\n components: {},\n openOnContext,\n open,\n setOpen,\n checkedValues,\n onCheckedValueChange,\n persistOnItemClick,\n };\n};\n\n/**\n * Adds appropriate state values and handlers for selectable items\n * i.e checkboxes and radios\n */\nconst useMenuSelectableState = (\n props: Pick<MenuProps, 'checkedValues' | 'defaultCheckedValues' | 'onCheckedValueChange'>,\n) => {\n const [checkedValues, setCheckedValues] = useControllableState({\n state: props.checkedValues,\n defaultState: props.defaultCheckedValues,\n initialState: {},\n });\n const onCheckedValueChange: MenuState['onCheckedValueChange'] = useEventCallback((e, { name, checkedItems }) => {\n props.onCheckedValueChange?.(e, { name, checkedItems });\n\n setCheckedValues(currentValue => ({\n ...currentValue,\n [name]: checkedItems,\n }));\n });\n\n return [checkedValues, onCheckedValueChange] as const;\n};\n\nconst useMenuOpenState = (\n state: Pick<\n MenuState,\n | 'isSubmenu'\n | 'menuPopoverRef'\n | 'setContextTarget'\n | 'triggerRef'\n | 'openOnContext'\n | 'closeOnScroll'\n | 'hoverDelay'\n > &\n Pick<MenuProps, 'open' | 'defaultOpen' | 'onOpenChange'>,\n) => {\n const { targetDocument } = useFluent();\n const parentSetOpen = useMenuContext_unstable(context => context.setOpen);\n const onOpenChange: MenuProps['onOpenChange'] = useEventCallback((e, data) => state.onOpenChange?.(e, data));\n\n const setOpenTimeout = React.useRef(0);\n const enteringTriggerRef = React.useRef(false);\n\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false,\n });\n\n const trySetOpen = useEventCallback((e: MenuOpenEvent, data: MenuOpenChangeData) => {\n const event = e instanceof CustomEvent && e.type === MENU_ENTER_EVENT ? e.detail.nativeEvent : e;\n onOpenChange?.(event, { ...data });\n if (data.open && e.type === 'contextmenu') {\n state.setContextTarget(e as React.MouseEvent);\n }\n\n if (!data.open) {\n state.setContextTarget(undefined);\n }\n\n if (data.bubble) {\n parentSetOpen(e, { ...data });\n }\n\n setOpenState(data.open);\n });\n\n const setOpen = useEventCallback((e: MenuOpenEvent, data: MenuOpenChangeData) => {\n clearTimeout(setOpenTimeout.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n\n if (e.type === 'mouseleave' || e.type === 'mouseenter' || e.type === 'mousemove' || e.type === MENU_ENTER_EVENT) {\n if (state.triggerRef.current?.contains(e.target as HTMLElement)) {\n enteringTriggerRef.current = e.type === 'mouseenter' || e.type === 'mousemove';\n }\n\n // FIXME leaking Node timeout type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n setOpenTimeout.current = setTimeout(() => trySetOpen(e, data), state.hoverDelay);\n } else {\n trySetOpen(e, data);\n }\n });\n\n useOnClickOutside({\n contains: elementContains,\n disabled: !open,\n element: targetDocument,\n refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(\n Boolean,\n ) as React.MutableRefObject<HTMLElement>[],\n callback: event => setOpen(event, { open: false, type: 'clickOutside', event }),\n });\n\n // only close on scroll for context, or when closeOnScroll is specified\n const closeOnScroll = state.openOnContext || state.closeOnScroll;\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: event => setOpen(event, { open: false, type: 'scrollOutside', event }),\n refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(\n Boolean,\n ) as React.MutableRefObject<HTMLElement>[],\n disabled: !open || !closeOnScroll,\n });\n\n useOnMenuMouseEnter({\n element: targetDocument,\n callback: event => {\n // When moving from a menu directly back to its trigger, this handler can close the menu\n // Explicitly check a flag to see if this situation happens\n if (!enteringTriggerRef.current) {\n setOpen(event, { open: false, type: 'menuMouseEnter', event });\n }\n },\n disabled: !open,\n refs: [state.menuPopoverRef],\n });\n\n // Clear timeout on unmount\n // Setting state after a component unmounts can cause memory leaks\n React.useEffect(() => {\n return () => {\n clearTimeout(setOpenTimeout.current);\n };\n }, []);\n\n // Manage focus for open state\n const { findFirstFocusable } = useFocusFinders();\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(state.menuPopoverRef.current);\n firstFocusable?.focus();\n }, [findFirstFocusable, state.menuPopoverRef]);\n\n const firstMount = useFirstMount();\n React.useEffect(() => {\n if (open) {\n focusFirst();\n } else {\n if (!firstMount) {\n if (targetDocument?.activeElement === targetDocument?.body) {\n // We know that React effects are sync so we focus the trigger here\n // after any event handler (event handlers will update state and re-render).\n // Since the browser only performs the default behaviour for the Tab key once\n // keyboard events have fully bubbled up the window, the browser will move\n // focus to the next tabbable element before/after the trigger if needed.\n // If the Tab key was not pressed, focus will remain on the trigger as expected.\n state.triggerRef.current?.focus();\n }\n }\n }\n // firstMount change should not re-run this effect\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [state.triggerRef, state.isSubmenu, open, focusFirst, targetDocument, state.menuPopoverRef]);\n\n return [open, setOpen] as const;\n};\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SACEC,yBAAyB,EACzBC,cAAc,EACdC,2BAA2B,QAEtB;AACP,SACEC,oBAAoB,EACpBC,KAAK,EACLC,iBAAiB,EACjBC,gBAAgB,EAChBC,kBAAkB,EAClBC,aAAa,QACR;AACP,SAASC,kBAAA,IAAsBC,SAAS,QAAQ;AAChD,SAASC,eAAe,QAAQ;AAChC,SAASC,eAAe,QAAQ;AAChC,SAASC,uBAAuB,QAAQ;AACxC,SAASC,gBAAgB,EAAEC,mBAAmB,QAAQ;AACtD,SAASC,YAAY,QAAQ;AAG7B;AACA;AACA,MAAMC,wBAAA,GAAwD,CAC5D,SACA,gBACA,cACA,UACA,iBACA,QACD;AAED;;;;;;;;AAQA,OAAO,MAAMC,gBAAA,GAAoBC,KAAA,IAAgC;EAC/D,MAAMC,SAAA,GAAYJ,YAAA;EAClB,MAAM;IACJK,UAAA,GAAa;IACbC,MAAA,GAAS,KAAK;IACdC,aAAA,GAAgB,KAAK;IACrBC,QAAA,GAAW,KAAK;IAChBC,aAAA,GAAgB,KAAK;IACrBC,aAAA,GAAgB,KAAK;IACrBC,kBAAA,GAAqB,KAAK;IAC1BC,WAAA,GAAc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;EAEL;EACA,MAAM;IAAEa;EAAkB,CAAE,GAAG7F,eAAA;EAC/B,MAAM8F,UAAA,GAAa3G,KAAA,CAAM4G,WAAW,CAAC,MAAM;IACzC,MAAMC,cAAA,GAAiBH,kBAAA,CAAmBvC,KAAA,CAAMX,cAAc,CAACqC,OAAO;IACtEgB,cAAA,aAAAA,cAAA,uBAAAA,cAAA,CAAgBC,KAAK;EACvB,GAAG,CAACJ,kBAAA,EAAoBvC,KAAA,CAAMX,cAAc,CAAC;EAE7C,MAAMuD,UAAA,GAAatG,aAAA;EACnBT,KAAA,CAAMyG,SAAS,CAAC,MAAM;IACpB,IAAIhD,IAAA,EAAM;MACRkD,UAAA;IACF,OAAO;MACL,IAAI,CAACI,UAAA,EAAY;QACf,IAAI,CAAAnC,cAAA,aAAAA,cAAA,uBAAAA,cAAA,CAAgBoC,aAAa,OAAKpC,cAAA,aAAAA,cAAA,uBAAAA,cAAA,CAAgBqC,IAAI,CAAD,EAAG;;UAC1D;UACA;UACA;UACA;UACA;UACA;UACAjB,yBAAA;UAAA,CAAAA,yBAAA,GAAA7B,KAAA,CAAMb,UAAU,CAACuC,OAAO,cAAxBG,yBAAA,uBAAAA,yBAAA,CAA0Bc,KAAA;QAC5B;MACF;IACF;IACA;IACA;EACF,GAAG,CAAC3C,KAAA,CAAMb,UAAU,EAAEa,KAAA,CAAM9C,SAAS,EAAEoC,IAAA,EAAMkD,UAAA,EAAY/B,cAAA,EAAgBT,KAAA,CAAMX,cAAc,CAAC;EAE9F,OAAO,CAACC,IAAA,EAAMC,OAAA,CAAQ;AACxB"}
|
|
@@ -2,17 +2,14 @@ import * as React from 'react';
|
|
|
2
2
|
import { useMenuDivider_unstable } from './useMenuDivider';
|
|
3
3
|
import { useMenuDividerStyles_unstable } from './useMenuDividerStyles';
|
|
4
4
|
import { renderMenuDivider_unstable } from './renderMenuDivider';
|
|
5
|
-
import {
|
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
6
6
|
/**
|
|
7
7
|
* Define a styled MenuDivider, using the `useMenuDivider_unstable` hook.
|
|
8
8
|
*/
|
|
9
9
|
export const MenuDivider = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
const state = useMenuDivider_unstable(props, ref);
|
|
11
11
|
useMenuDividerStyles_unstable(state);
|
|
12
|
-
|
|
13
|
-
useMenuDividerStyles_unstable: useCustomStyles
|
|
14
|
-
} = useCustomStyleHooks_unstable();
|
|
15
|
-
useCustomStyles(state);
|
|
12
|
+
useCustomStyleHook_unstable('useMenuDividerStyles_unstable')(state);
|
|
16
13
|
return renderMenuDivider_unstable(state);
|
|
17
14
|
});
|
|
18
15
|
MenuDivider.displayName = 'MenuDivider';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMenuDivider_unstable","useMenuDividerStyles_unstable","renderMenuDivider_unstable","
|
|
1
|
+
{"version":3,"names":["React","useMenuDivider_unstable","useMenuDividerStyles_unstable","renderMenuDivider_unstable","useCustomStyleHook_unstable","MenuDivider","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/MenuDivider/MenuDivider.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuDivider_unstable } from './useMenuDivider';\nimport { useMenuDividerStyles_unstable } from './useMenuDividerStyles';\nimport { renderMenuDivider_unstable } from './renderMenuDivider';\nimport type { MenuDividerProps } from './MenuDivider.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Define a styled MenuDivider, using the `useMenuDivider_unstable` hook.\n */\nexport const MenuDivider: ForwardRefComponent<MenuDividerProps> = React.forwardRef((props, ref) => {\n const state = useMenuDivider_unstable(props, ref);\n\n useMenuDividerStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuDividerStyles_unstable')(state);\n\n return renderMenuDivider_unstable(state);\n});\n\nMenuDivider.displayName = 'MenuDivider';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,uBAAuB,QAAQ;AACxC,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,0BAA0B,QAAQ;AAG3C,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,WAAA,gBAAqDL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACjG,MAAMC,KAAA,GAAQR,uBAAA,CAAwBM,KAAA,EAAOC,GAAA;EAE7CN,6BAAA,CAA8BO,KAAA;EAE9BL,2BAAA,CAA4B,iCAAiCK,KAAA;EAE7D,OAAON,0BAAA,CAA2BM,KAAA;AACpC;AAEAJ,WAAA,CAAYK,WAAW,GAAG"}
|
|
@@ -3,7 +3,7 @@ import { useMenuGroup_unstable } from './useMenuGroup';
|
|
|
3
3
|
import { renderMenuGroup_unstable } from './renderMenuGroup';
|
|
4
4
|
import { useMenuGroupContextValues_unstable } from './useMenuGroupContextValues';
|
|
5
5
|
import { useMenuGroupStyles_unstable } from './useMenuGroupStyles';
|
|
6
|
-
import {
|
|
6
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
7
7
|
/**
|
|
8
8
|
* Define a styled MenuGroup, using the `useMenuGroup_unstable` hook.
|
|
9
9
|
*/
|
|
@@ -11,10 +11,7 @@ export const MenuGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
11
11
|
const state = useMenuGroup_unstable(props, ref);
|
|
12
12
|
const contextValues = useMenuGroupContextValues_unstable(state);
|
|
13
13
|
useMenuGroupStyles_unstable(state);
|
|
14
|
-
|
|
15
|
-
useMenuGroupStyles_unstable: useCustomStyles
|
|
16
|
-
} = useCustomStyleHooks_unstable();
|
|
17
|
-
useCustomStyles(state);
|
|
14
|
+
useCustomStyleHook_unstable('useMenuGroupStyles_unstable')(state);
|
|
18
15
|
return renderMenuGroup_unstable(state, contextValues);
|
|
19
16
|
});
|
|
20
17
|
MenuGroup.displayName = 'MenuGroup';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMenuGroup_unstable","renderMenuGroup_unstable","useMenuGroupContextValues_unstable","useMenuGroupStyles_unstable","
|
|
1
|
+
{"version":3,"names":["React","useMenuGroup_unstable","renderMenuGroup_unstable","useMenuGroupContextValues_unstable","useMenuGroupStyles_unstable","useCustomStyleHook_unstable","MenuGroup","forwardRef","props","ref","state","contextValues","displayName"],"sources":["../../../src/components/MenuGroup/MenuGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuGroup_unstable } from './useMenuGroup';\nimport { renderMenuGroup_unstable } from './renderMenuGroup';\nimport { useMenuGroupContextValues_unstable } from './useMenuGroupContextValues';\nimport type { MenuGroupProps } from './MenuGroup.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useMenuGroupStyles_unstable } from './useMenuGroupStyles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Define a styled MenuGroup, using the `useMenuGroup_unstable` hook.\n */\nexport const MenuGroup: ForwardRefComponent<MenuGroupProps> = React.forwardRef((props, ref) => {\n const state = useMenuGroup_unstable(props, ref);\n const contextValues = useMenuGroupContextValues_unstable(state);\n\n useMenuGroupStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuGroupStyles_unstable')(state);\n\n return renderMenuGroup_unstable(state, contextValues);\n});\n\nMenuGroup.displayName = 'MenuGroup';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,wBAAwB,QAAQ;AACzC,SAASC,kCAAkC,QAAQ;AAGnD,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,SAAA,gBAAiDN,KAAA,CAAMO,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EAC7F,MAAMC,KAAA,GAAQT,qBAAA,CAAsBO,KAAA,EAAOC,GAAA;EAC3C,MAAME,aAAA,GAAgBR,kCAAA,CAAmCO,KAAA;EAEzDN,2BAAA,CAA4BM,KAAA;EAE5BL,2BAAA,CAA4B,+BAA+BK,KAAA;EAE3D,OAAOR,wBAAA,CAAyBQ,KAAA,EAAOC,aAAA;AACzC;AAEAL,SAAA,CAAUM,WAAW,GAAG"}
|
|
@@ -2,17 +2,14 @@ import * as React from 'react';
|
|
|
2
2
|
import { useMenuGroupHeader_unstable } from './useMenuGroupHeader';
|
|
3
3
|
import { useMenuGroupHeaderStyles_unstable } from './useMenuGroupHeaderStyles';
|
|
4
4
|
import { renderMenuGroupHeader_unstable } from './renderMenuGroupHeader';
|
|
5
|
-
import {
|
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
6
6
|
/**
|
|
7
7
|
* Define a styled MenuGroupHeader, using the `useMenuGroupHeader_unstable` hook.
|
|
8
8
|
*/
|
|
9
9
|
export const MenuGroupHeader = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
const state = useMenuGroupHeader_unstable(props, ref);
|
|
11
11
|
useMenuGroupHeaderStyles_unstable(state);
|
|
12
|
-
|
|
13
|
-
useMenuGroupHeaderStyles_unstable: useCustomStyles
|
|
14
|
-
} = useCustomStyleHooks_unstable();
|
|
15
|
-
useCustomStyles(state);
|
|
12
|
+
useCustomStyleHook_unstable('useMenuGroupHeaderStyles_unstable')(state);
|
|
16
13
|
return renderMenuGroupHeader_unstable(state);
|
|
17
14
|
});
|
|
18
15
|
MenuGroupHeader.displayName = 'MenuGroupHeader';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMenuGroupHeader_unstable","useMenuGroupHeaderStyles_unstable","renderMenuGroupHeader_unstable","
|
|
1
|
+
{"version":3,"names":["React","useMenuGroupHeader_unstable","useMenuGroupHeaderStyles_unstable","renderMenuGroupHeader_unstable","useCustomStyleHook_unstable","MenuGroupHeader","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/MenuGroupHeader/MenuGroupHeader.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuGroupHeader_unstable } from './useMenuGroupHeader';\nimport { useMenuGroupHeaderStyles_unstable } from './useMenuGroupHeaderStyles';\nimport { renderMenuGroupHeader_unstable } from './renderMenuGroupHeader';\nimport type { MenuGroupHeaderProps } from './MenuGroupHeader.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Define a styled MenuGroupHeader, using the `useMenuGroupHeader_unstable` hook.\n */\nexport const MenuGroupHeader: ForwardRefComponent<MenuGroupHeaderProps> = React.forwardRef((props, ref) => {\n const state = useMenuGroupHeader_unstable(props, ref);\n\n useMenuGroupHeaderStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuGroupHeaderStyles_unstable')(state);\n\n return renderMenuGroupHeader_unstable(state);\n});\n\nMenuGroupHeader.displayName = 'MenuGroupHeader';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,2BAA2B,QAAQ;AAC5C,SAASC,iCAAiC,QAAQ;AAClD,SAASC,8BAA8B,QAAQ;AAG/C,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,eAAA,gBAA6DL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACzG,MAAMC,KAAA,GAAQR,2BAAA,CAA4BM,KAAA,EAAOC,GAAA;EAEjDN,iCAAA,CAAkCO,KAAA;EAElCL,2BAAA,CAA4B,qCAAqCK,KAAA;EAEjE,OAAON,8BAAA,CAA+BM,KAAA;AACxC;AAEAJ,eAAA,CAAgBK,WAAW,GAAG"}
|
|
@@ -2,17 +2,14 @@ import * as React from 'react';
|
|
|
2
2
|
import { useMenuItem_unstable } from './useMenuItem';
|
|
3
3
|
import { renderMenuItem_unstable } from './renderMenuItem';
|
|
4
4
|
import { useMenuItemStyles_unstable } from './useMenuItemStyles';
|
|
5
|
-
import {
|
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
6
6
|
/**
|
|
7
7
|
* Define a styled MenuItem, using the `useMenuItem_unstable` and `useMenuItemStyles_unstable` hook.
|
|
8
8
|
*/
|
|
9
9
|
export const MenuItem = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
const state = useMenuItem_unstable(props, ref);
|
|
11
11
|
useMenuItemStyles_unstable(state);
|
|
12
|
-
|
|
13
|
-
useMenuItemStyles_unstable: useCustomStyles
|
|
14
|
-
} = useCustomStyleHooks_unstable();
|
|
15
|
-
useCustomStyles(state);
|
|
12
|
+
useCustomStyleHook_unstable('useMenuItemStyles_unstable')(state);
|
|
16
13
|
return renderMenuItem_unstable(state);
|
|
17
14
|
});
|
|
18
15
|
MenuItem.displayName = 'MenuItem';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMenuItem_unstable","renderMenuItem_unstable","useMenuItemStyles_unstable","
|
|
1
|
+
{"version":3,"names":["React","useMenuItem_unstable","renderMenuItem_unstable","useMenuItemStyles_unstable","useCustomStyleHook_unstable","MenuItem","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/MenuItem/MenuItem.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuItem_unstable } from './useMenuItem';\nimport { renderMenuItem_unstable } from './renderMenuItem';\nimport { useMenuItemStyles_unstable } from './useMenuItemStyles';\nimport type { MenuItemProps } from './MenuItem.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Define a styled MenuItem, using the `useMenuItem_unstable` and `useMenuItemStyles_unstable` hook.\n */\nexport const MenuItem: ForwardRefComponent<MenuItemProps> = React.forwardRef((props, ref) => {\n const state = useMenuItem_unstable(props, ref);\n\n useMenuItemStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuItemStyles_unstable')(state);\n\n return renderMenuItem_unstable(state);\n});\n\nMenuItem.displayName = 'MenuItem';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,oBAAoB,QAAQ;AACrC,SAASC,uBAAuB,QAAQ;AACxC,SAASC,0BAA0B,QAAQ;AAG3C,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,QAAA,gBAA+CL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EAC3F,MAAMC,KAAA,GAAQR,oBAAA,CAAqBM,KAAA,EAAOC,GAAA;EAE1CL,0BAAA,CAA2BM,KAAA;EAE3BL,2BAAA,CAA4B,8BAA8BK,KAAA;EAE1D,OAAOP,uBAAA,CAAwBO,KAAA;AACjC;AAEAJ,QAAA,CAASK,WAAW,GAAG"}
|
|
@@ -2,17 +2,14 @@ import * as React from 'react';
|
|
|
2
2
|
import { useMenuItemCheckbox_unstable } from './useMenuItemCheckbox';
|
|
3
3
|
import { renderMenuItemCheckbox_unstable } from './renderMenuItemCheckbox';
|
|
4
4
|
import { useMenuItemCheckboxStyles_unstable } from './useMenuItemCheckboxStyles';
|
|
5
|
-
import {
|
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
6
6
|
/**
|
|
7
7
|
* Define a styled MenuItemCheckbox, using the `useMenuItemCheckbox_unstable` hook.
|
|
8
8
|
*/
|
|
9
9
|
export const MenuItemCheckbox = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
const state = useMenuItemCheckbox_unstable(props, ref);
|
|
11
11
|
useMenuItemCheckboxStyles_unstable(state);
|
|
12
|
-
|
|
13
|
-
useMenuItemCheckboxStyles_unstable: useCustomStyles
|
|
14
|
-
} = useCustomStyleHooks_unstable();
|
|
15
|
-
useCustomStyles(state);
|
|
12
|
+
useCustomStyleHook_unstable('useMenuItemCheckboxStyles_unstable')(state);
|
|
16
13
|
return renderMenuItemCheckbox_unstable(state);
|
|
17
14
|
});
|
|
18
15
|
MenuItemCheckbox.displayName = 'MenuItemCheckbox';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMenuItemCheckbox_unstable","renderMenuItemCheckbox_unstable","useMenuItemCheckboxStyles_unstable","
|
|
1
|
+
{"version":3,"names":["React","useMenuItemCheckbox_unstable","renderMenuItemCheckbox_unstable","useMenuItemCheckboxStyles_unstable","useCustomStyleHook_unstable","MenuItemCheckbox","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/MenuItemCheckbox/MenuItemCheckbox.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuItemCheckbox_unstable } from './useMenuItemCheckbox';\nimport { renderMenuItemCheckbox_unstable } from './renderMenuItemCheckbox';\nimport { useMenuItemCheckboxStyles_unstable } from './useMenuItemCheckboxStyles';\nimport type { MenuItemCheckboxProps } from './MenuItemCheckbox.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Define a styled MenuItemCheckbox, using the `useMenuItemCheckbox_unstable` hook.\n */\nexport const MenuItemCheckbox: ForwardRefComponent<MenuItemCheckboxProps> = React.forwardRef((props, ref) => {\n const state = useMenuItemCheckbox_unstable(props, ref);\n\n useMenuItemCheckboxStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuItemCheckboxStyles_unstable')(state);\n\n return renderMenuItemCheckbox_unstable(state);\n});\n\nMenuItemCheckbox.displayName = 'MenuItemCheckbox';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,+BAA+B,QAAQ;AAChD,SAASC,kCAAkC,QAAQ;AAGnD,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,gBAAA,gBAA+DL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EAC3G,MAAMC,KAAA,GAAQR,4BAAA,CAA6BM,KAAA,EAAOC,GAAA;EAElDL,kCAAA,CAAmCM,KAAA;EAEnCL,2BAAA,CAA4B,sCAAsCK,KAAA;EAElE,OAAOP,+BAAA,CAAgCO,KAAA;AACzC;AAEAJ,gBAAA,CAAiBK,WAAW,GAAG"}
|
|
@@ -2,17 +2,14 @@ import * as React from 'react';
|
|
|
2
2
|
import { useMenuItemRadio_unstable } from './useMenuItemRadio';
|
|
3
3
|
import { renderMenuItemRadio_unstable } from './renderMenuItemRadio';
|
|
4
4
|
import { useMenuItemRadioStyles_unstable } from './useMenuItemRadioStyles';
|
|
5
|
-
import {
|
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
6
6
|
/**
|
|
7
7
|
* Define a styled MenuItemRadio, using the `useMenuItemRadio_unstable` hook.
|
|
8
8
|
*/
|
|
9
9
|
export const MenuItemRadio = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
const state = useMenuItemRadio_unstable(props, ref);
|
|
11
11
|
useMenuItemRadioStyles_unstable(state);
|
|
12
|
-
|
|
13
|
-
useMenuItemRadioStyles_unstable: useCustomStyles
|
|
14
|
-
} = useCustomStyleHooks_unstable();
|
|
15
|
-
useCustomStyles(state);
|
|
12
|
+
useCustomStyleHook_unstable('useMenuItemRadioStyles_unstable')(state);
|
|
16
13
|
return renderMenuItemRadio_unstable(state);
|
|
17
14
|
});
|
|
18
15
|
MenuItemRadio.displayName = 'MenuItemRadio';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMenuItemRadio_unstable","renderMenuItemRadio_unstable","useMenuItemRadioStyles_unstable","
|
|
1
|
+
{"version":3,"names":["React","useMenuItemRadio_unstable","renderMenuItemRadio_unstable","useMenuItemRadioStyles_unstable","useCustomStyleHook_unstable","MenuItemRadio","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/MenuItemRadio/MenuItemRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuItemRadio_unstable } from './useMenuItemRadio';\nimport { renderMenuItemRadio_unstable } from './renderMenuItemRadio';\nimport { useMenuItemRadioStyles_unstable } from './useMenuItemRadioStyles';\nimport type { MenuItemRadioProps } from './MenuItemRadio.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Define a styled MenuItemRadio, using the `useMenuItemRadio_unstable` hook.\n */\nexport const MenuItemRadio: ForwardRefComponent<MenuItemRadioProps> = React.forwardRef((props, ref) => {\n const state = useMenuItemRadio_unstable(props, ref);\n\n useMenuItemRadioStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuItemRadioStyles_unstable')(state);\n\n return renderMenuItemRadio_unstable(state);\n});\n\nMenuItemRadio.displayName = 'MenuItemRadio';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,+BAA+B,QAAQ;AAGhD,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,aAAA,gBAAyDL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACrG,MAAMC,KAAA,GAAQR,yBAAA,CAA0BM,KAAA,EAAOC,GAAA;EAE/CL,+BAAA,CAAgCM,KAAA;EAEhCL,2BAAA,CAA4B,mCAAmCK,KAAA;EAE/D,OAAOP,4BAAA,CAA6BO,KAAA;AACtC;AAEAJ,aAAA,CAAcK,WAAW,GAAG"}
|
|
@@ -3,7 +3,7 @@ import { useMenuList_unstable } from './useMenuList';
|
|
|
3
3
|
import { renderMenuList_unstable } from './renderMenuList';
|
|
4
4
|
import { useMenuListContextValues_unstable } from './useMenuListContextValues';
|
|
5
5
|
import { useMenuListStyles_unstable } from './useMenuListStyles';
|
|
6
|
-
import {
|
|
6
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
7
7
|
/**
|
|
8
8
|
* Define a styled MenuList, using the `useMenuList_unstable` hook.
|
|
9
9
|
*/
|
|
@@ -11,10 +11,7 @@ export const MenuList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
11
11
|
const state = useMenuList_unstable(props, ref);
|
|
12
12
|
const contextValues = useMenuListContextValues_unstable(state);
|
|
13
13
|
useMenuListStyles_unstable(state);
|
|
14
|
-
|
|
15
|
-
useMenuListStyles_unstable: useCustomStyles
|
|
16
|
-
} = useCustomStyleHooks_unstable();
|
|
17
|
-
useCustomStyles(state);
|
|
14
|
+
useCustomStyleHook_unstable('useMenuListStyles_unstable')(state);
|
|
18
15
|
return renderMenuList_unstable(state, contextValues);
|
|
19
16
|
});
|
|
20
17
|
MenuList.displayName = 'MenuList';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMenuList_unstable","renderMenuList_unstable","useMenuListContextValues_unstable","useMenuListStyles_unstable","
|
|
1
|
+
{"version":3,"names":["React","useMenuList_unstable","renderMenuList_unstable","useMenuListContextValues_unstable","useMenuListStyles_unstable","useCustomStyleHook_unstable","MenuList","forwardRef","props","ref","state","contextValues","displayName"],"sources":["../../../src/components/MenuList/MenuList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuList_unstable } from './useMenuList';\nimport { renderMenuList_unstable } from './renderMenuList';\nimport { useMenuListContextValues_unstable } from './useMenuListContextValues';\nimport { useMenuListStyles_unstable } from './useMenuListStyles';\nimport type { MenuListProps } from './MenuList.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Define a styled MenuList, using the `useMenuList_unstable` hook.\n */\nexport const MenuList: ForwardRefComponent<MenuListProps> = React.forwardRef((props, ref) => {\n const state = useMenuList_unstable(props, ref);\n const contextValues = useMenuListContextValues_unstable(state);\n\n useMenuListStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuListStyles_unstable')(state);\n\n return renderMenuList_unstable(state, contextValues);\n});\n\nMenuList.displayName = 'MenuList';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,oBAAoB,QAAQ;AACrC,SAASC,uBAAuB,QAAQ;AACxC,SAASC,iCAAiC,QAAQ;AAClD,SAASC,0BAA0B,QAAQ;AAG3C,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,QAAA,gBAA+CN,KAAA,CAAMO,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EAC3F,MAAMC,KAAA,GAAQT,oBAAA,CAAqBO,KAAA,EAAOC,GAAA;EAC1C,MAAME,aAAA,GAAgBR,iCAAA,CAAkCO,KAAA;EAExDN,0BAAA,CAA2BM,KAAA;EAE3BL,2BAAA,CAA4B,8BAA8BK,KAAA;EAE1D,OAAOR,uBAAA,CAAwBQ,KAAA,EAAOC,aAAA;AACxC;AAEAL,QAAA,CAASM,WAAW,GAAG"}
|
|
@@ -2,17 +2,14 @@ import * as React from 'react';
|
|
|
2
2
|
import { useMenuPopover_unstable } from './useMenuPopover';
|
|
3
3
|
import { useMenuPopoverStyles_unstable } from './useMenuPopoverStyles';
|
|
4
4
|
import { renderMenuPopover_unstable } from './renderMenuPopover';
|
|
5
|
-
import {
|
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
6
6
|
/**
|
|
7
7
|
* Popover intended to wrap `MenuList` and adds styling and interaction support specific to menus
|
|
8
8
|
*/
|
|
9
9
|
export const MenuPopover = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
const state = useMenuPopover_unstable(props, ref);
|
|
11
11
|
useMenuPopoverStyles_unstable(state);
|
|
12
|
-
|
|
13
|
-
useMenuPopoverStyles_unstable: useCustomStyles
|
|
14
|
-
} = useCustomStyleHooks_unstable();
|
|
15
|
-
useCustomStyles(state);
|
|
12
|
+
useCustomStyleHook_unstable('useMenuPopoverStyles_unstable')(state);
|
|
16
13
|
return renderMenuPopover_unstable(state);
|
|
17
14
|
});
|
|
18
15
|
MenuPopover.displayName = 'MenuPopover';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMenuPopover_unstable","useMenuPopoverStyles_unstable","renderMenuPopover_unstable","
|
|
1
|
+
{"version":3,"names":["React","useMenuPopover_unstable","useMenuPopoverStyles_unstable","renderMenuPopover_unstable","useCustomStyleHook_unstable","MenuPopover","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/MenuPopover/MenuPopover.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuPopover_unstable } from './useMenuPopover';\nimport { useMenuPopoverStyles_unstable } from './useMenuPopoverStyles';\nimport { renderMenuPopover_unstable } from './renderMenuPopover';\nimport type { MenuPopoverProps } from './MenuPopover.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Popover intended to wrap `MenuList` and adds styling and interaction support specific to menus\n */\nexport const MenuPopover: ForwardRefComponent<MenuPopoverProps> = React.forwardRef((props, ref) => {\n const state = useMenuPopover_unstable(props, ref);\n\n useMenuPopoverStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuPopoverStyles_unstable')(state);\n\n return renderMenuPopover_unstable(state);\n});\n\nMenuPopover.displayName = 'MenuPopover';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,uBAAuB,QAAQ;AACxC,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,0BAA0B,QAAQ;AAG3C,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,WAAA,gBAAqDL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACjG,MAAMC,KAAA,GAAQR,uBAAA,CAAwBM,KAAA,EAAOC,GAAA;EAE7CN,6BAAA,CAA8BO,KAAA;EAE9BL,2BAAA,CAA4B,iCAAiCK,KAAA;EAE7D,OAAON,0BAAA,CAA2BM,KAAA;AACpC;AAEAJ,WAAA,CAAYK,WAAW,GAAG"}
|
|
@@ -2,17 +2,14 @@ import * as React from 'react';
|
|
|
2
2
|
import { useMenuSplitGroup_unstable } from './useMenuSplitGroup';
|
|
3
3
|
import { renderMenuSplitGroup_unstable } from './renderMenuSplitGroup';
|
|
4
4
|
import { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles';
|
|
5
|
-
import {
|
|
5
|
+
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';
|
|
6
6
|
/**
|
|
7
7
|
* Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.
|
|
8
8
|
*/
|
|
9
9
|
export const MenuSplitGroup = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
10
10
|
const state = useMenuSplitGroup_unstable(props, ref);
|
|
11
11
|
useMenuSplitGroupStyles_unstable(state);
|
|
12
|
-
|
|
13
|
-
useMenuSplitGroupStyles_unstable: useCustomStyles
|
|
14
|
-
} = useCustomStyleHooks_unstable();
|
|
15
|
-
useCustomStyles(state);
|
|
12
|
+
useCustomStyleHook_unstable('useMenuSplitGroupStyles_unstable')(state);
|
|
16
13
|
return renderMenuSplitGroup_unstable(state);
|
|
17
14
|
});
|
|
18
15
|
MenuSplitGroup.displayName = 'MenuSplitGroup';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useMenuSplitGroup_unstable","renderMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","
|
|
1
|
+
{"version":3,"names":["React","useMenuSplitGroup_unstable","renderMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useCustomStyleHook_unstable","MenuSplitGroup","forwardRef","props","ref","state","displayName"],"sources":["../../../src/components/MenuSplitGroup/MenuSplitGroup.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useMenuSplitGroup_unstable } from './useMenuSplitGroup';\nimport { renderMenuSplitGroup_unstable } from './renderMenuSplitGroup';\nimport { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles';\nimport type { MenuSplitGroupProps } from './MenuSplitGroup.types';\nimport type { ForwardRefComponent } from '@fluentui/react-utilities';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n\n/**\n * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.\n */\nexport const MenuSplitGroup: ForwardRefComponent<MenuSplitGroupProps> = React.forwardRef((props, ref) => {\n const state = useMenuSplitGroup_unstable(props, ref);\n\n useMenuSplitGroupStyles_unstable(state);\n\n useCustomStyleHook_unstable('useMenuSplitGroupStyles_unstable')(state);\n\n return renderMenuSplitGroup_unstable(state);\n});\n\nMenuSplitGroup.displayName = 'MenuSplitGroup';\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,gCAAgC,QAAQ;AAGjD,SAASC,2BAA2B,QAAQ;AAE5C;;;AAGA,OAAO,MAAMC,cAAA,gBAA2DL,KAAA,CAAMM,UAAU,CAAC,CAACC,KAAA,EAAOC,GAAA,KAAQ;EACvG,MAAMC,KAAA,GAAQR,0BAAA,CAA2BM,KAAA,EAAOC,GAAA;EAEhDL,gCAAA,CAAiCM,KAAA;EAEjCL,2BAAA,CAA4B,oCAAoCK,KAAA;EAEhE,OAAOP,6BAAA,CAA8BO,KAAA;AACvC;AAEAJ,cAAA,CAAeK,WAAW,GAAG"}
|
|
@@ -259,12 +259,13 @@ const useMenuOpenState = (state)=>{
|
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
}
|
|
262
|
+
// firstMount change should not re-run this effect
|
|
263
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
262
264
|
}, [
|
|
263
265
|
state.triggerRef,
|
|
264
266
|
state.isSubmenu,
|
|
265
267
|
open,
|
|
266
268
|
focusFirst,
|
|
267
|
-
firstMount,
|
|
268
269
|
targetDocument,
|
|
269
270
|
state.menuPopoverRef
|
|
270
271
|
]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/Menu/useMenu.js"],"sourcesContent":["import * as React from 'react';\nimport { usePositioningMouseTarget, usePositioning, resolvePositioningShorthand } from '@fluentui/react-positioning';\nimport { useControllableState, useId, useOnClickOutside, useEventCallback, useOnScrollOutside, useFirstMount } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { MENU_ENTER_EVENT, useOnMenuMouseEnter } from '../../utils/index';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\n// If it's not possible to position the submenu in smaller viewports, try\n// and fallback to this order of positions\nconst submenuFallbackPositions = ['after', 'after-bottom', 'before-top', 'before', 'before-bottom', 'above'];\n/**\n * Create the state required to render Menu.\n *\n * The returned state can be modified with hooks such as useMenuStyles,\n * before being passed to renderMenu_unstable.\n *\n * @param props - props from this instance of Menu\n */\nexport const useMenu_unstable = props => {\n const isSubmenu = useIsSubmenu();\n const {\n hoverDelay = 500,\n inline = false,\n hasCheckmarks = false,\n hasIcons = false,\n closeOnScroll = false,\n openOnContext = false,\n persistOnItemClick = false,\n openOnHover = isSubmenu,\n defaultCheckedValues,\n mountNode = null\n } = props;\n const triggerId = useId('menu');\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n const positioningState = {\n position: isSubmenu ? 'after' : 'below',\n align: isSubmenu ? 'top' : 'start',\n target: props.openOnContext ? contextTarget : undefined,\n fallbackPositions: isSubmenu ? submenuFallbackPositions : undefined,\n ...resolvePositioningShorthand(props.positioning)\n };\n const children = React.Children.toArray(props.children);\n if (process.env.NODE_ENV !== 'production') {\n if (children.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at least one child');\n }\n if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at most two children');\n }\n }\n let menuTrigger = undefined;\n let menuPopover = undefined;\n if (children.length === 2) {\n menuTrigger = children[0];\n menuPopover = children[1];\n } else if (children.length === 1) {\n menuPopover = children[0];\n }\n const {\n targetRef: triggerRef,\n containerRef: menuPopoverRef\n } = usePositioning(positioningState);\n // TODO Better way to narrow types ?\n const [open, setOpen] = useMenuOpenState({\n hoverDelay,\n isSubmenu,\n setContextTarget,\n closeOnScroll,\n menuPopoverRef,\n triggerRef,\n open: props.open,\n defaultOpen: props.defaultOpen,\n onOpenChange: props.onOpenChange,\n openOnContext\n });\n const [checkedValues, onCheckedValueChange] = useMenuSelectableState({\n checkedValues: props.checkedValues,\n defaultCheckedValues,\n onCheckedValueChange: props.onCheckedValueChange\n });\n return {\n inline,\n hoverDelay,\n triggerId,\n isSubmenu,\n openOnHover,\n contextTarget,\n setContextTarget,\n hasCheckmarks,\n hasIcons,\n closeOnScroll,\n menuTrigger,\n menuPopover,\n mountNode,\n triggerRef,\n menuPopoverRef,\n components: {},\n openOnContext,\n open,\n setOpen,\n checkedValues,\n onCheckedValueChange,\n persistOnItemClick\n };\n};\n/**\n * Adds appropriate state values and handlers for selectable items\n * i.e checkboxes and radios\n */\nconst useMenuSelectableState = props => {\n const [checkedValues, setCheckedValues] = useControllableState({\n state: props.checkedValues,\n defaultState: props.defaultCheckedValues,\n initialState: {}\n });\n const onCheckedValueChange = useEventCallback((e, {\n name,\n checkedItems\n }) => {\n var _props_onCheckedValueChange;\n (_props_onCheckedValueChange = props.onCheckedValueChange) === null || _props_onCheckedValueChange === void 0 ? void 0 : _props_onCheckedValueChange.call(props, e, {\n name,\n checkedItems\n });\n setCheckedValues(currentValue => ({\n ...currentValue,\n [name]: checkedItems\n }));\n });\n return [checkedValues, onCheckedValueChange];\n};\nconst useMenuOpenState = state => {\n const {\n targetDocument\n } = useFluent();\n const parentSetOpen = useMenuContext_unstable(context => context.setOpen);\n const onOpenChange = useEventCallback((e, data) => {\n var _state_onOpenChange;\n return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, e, data);\n });\n const setOpenTimeout = React.useRef(0);\n const enteringTriggerRef = React.useRef(false);\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false\n });\n const trySetOpen = useEventCallback((e, data) => {\n const event = e instanceof CustomEvent && e.type === MENU_ENTER_EVENT ? e.detail.nativeEvent : e;\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(event, {\n ...data\n });\n if (data.open && e.type === 'contextmenu') {\n state.setContextTarget(e);\n }\n if (!data.open) {\n state.setContextTarget(undefined);\n }\n if (data.bubble) {\n parentSetOpen(e, {\n ...data\n });\n }\n setOpenState(data.open);\n });\n const setOpen = useEventCallback((e, data) => {\n clearTimeout(setOpenTimeout.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n if (e.type === 'mouseleave' || e.type === 'mouseenter' || e.type === 'mousemove' || e.type === MENU_ENTER_EVENT) {\n var _state_triggerRef_current;\n if ((_state_triggerRef_current = state.triggerRef.current) === null || _state_triggerRef_current === void 0 ? void 0 : _state_triggerRef_current.contains(e.target)) {\n enteringTriggerRef.current = e.type === 'mouseenter' || e.type === 'mousemove';\n }\n // FIXME leaking Node timeout type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n setOpenTimeout.current = setTimeout(() => trySetOpen(e, data), state.hoverDelay);\n } else {\n trySetOpen(e, data);\n }\n });\n useOnClickOutside({\n contains: elementContains,\n disabled: !open,\n element: targetDocument,\n refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(Boolean),\n callback: event => setOpen(event, {\n open: false,\n type: 'clickOutside',\n event\n })\n });\n // only close on scroll for context, or when closeOnScroll is specified\n const closeOnScroll = state.openOnContext || state.closeOnScroll;\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: event => setOpen(event, {\n open: false,\n type: 'scrollOutside',\n event\n }),\n refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(Boolean),\n disabled: !open || !closeOnScroll\n });\n useOnMenuMouseEnter({\n element: targetDocument,\n callback: event => {\n // When moving from a menu directly back to its trigger, this handler can close the menu\n // Explicitly check a flag to see if this situation happens\n if (!enteringTriggerRef.current) {\n setOpen(event, {\n open: false,\n type: 'menuMouseEnter',\n event\n });\n }\n },\n disabled: !open,\n refs: [state.menuPopoverRef]\n });\n // Clear timeout on unmount\n // Setting state after a component unmounts can cause memory leaks\n React.useEffect(() => {\n return () => {\n clearTimeout(setOpenTimeout.current);\n };\n }, []);\n // Manage focus for open state\n const {\n findFirstFocusable\n } = useFocusFinders();\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(state.menuPopoverRef.current);\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }, [findFirstFocusable, state.menuPopoverRef]);\n const firstMount = useFirstMount();\n React.useEffect(() => {\n if (open) {\n focusFirst();\n } else {\n if (!firstMount) {\n if ((targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement) === (targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.body)) {\n var\n // We know that React effects are sync so we focus the trigger here\n // after any event handler (event handlers will update state and re-render).\n // Since the browser only performs the default behaviour for the Tab key once\n // keyboard events have fully bubbled up the window, the browser will move\n // focus to the next tabbable element before/after the trigger if needed.\n // If the Tab key was not pressed, focus will remain on the trigger as expected.\n _state_triggerRef_current;\n (_state_triggerRef_current = state.triggerRef.current) === null || _state_triggerRef_current === void 0 ? void 0 : _state_triggerRef_current.focus();\n }\n }\n }\n }, [state.triggerRef, state.isSubmenu, open, focusFirst, firstMount, targetDocument, state.menuPopoverRef]);\n return [open, setOpen];\n};\n//# sourceMappingURL=useMenu.js.map"],"names":["useMenu_unstable","submenuFallbackPositions","props","isSubmenu","useIsSubmenu","hoverDelay","inline","hasCheckmarks","hasIcons","closeOnScroll","openOnContext","persistOnItemClick","openOnHover","defaultCheckedValues","mountNode","triggerId","useId","contextTarget","setContextTarget","usePositioningMouseTarget","positioningState","position","align","target","undefined","fallbackPositions","resolvePositioningShorthand","positioning","children","React","Children","toArray","process","env","NODE_ENV","length","console","warn","menuTrigger","menuPopover","targetRef","triggerRef","containerRef","menuPopoverRef","usePositioning","open","setOpen","useMenuOpenState","defaultOpen","onOpenChange","checkedValues","onCheckedValueChange","useMenuSelectableState","components","setCheckedValues","useControllableState","state","defaultState","initialState","useEventCallback","e","name","checkedItems","_props_onCheckedValueChange","call","currentValue","targetDocument","useFluent","parentSetOpen","useMenuContext_unstable","context","data","_state_onOpenChange","setOpenTimeout","useRef","enteringTriggerRef","setOpenState","trySetOpen","event","CustomEvent","type","MENU_ENTER_EVENT","detail","nativeEvent","bubble","clearTimeout","current","Event","persist","_state_triggerRef_current","contains","setTimeout","useOnClickOutside","elementContains","disabled","element","refs","filter","Boolean","callback","useOnScrollOutside","useOnMenuMouseEnter","useEffect","findFirstFocusable","useFocusFinders","focusFirst","useCallback","firstFocusable","focus","firstMount","useFirstMount","activeElement","body"],"mappings":";;;;+BAoBaA;;aAAAA;;;6DApBU;kCACgE;gCAC6B;qCACpE;6BAChB;8BACA;6BACQ;uBACc;8BACzB;AAC7B,yEAAyE;AACzE,0CAA0C;AAC1C,MAAMC,2BAA2B;IAAC;IAAS;IAAgB;IAAc;IAAU;IAAiB;CAAQ;AASrG,MAAMD,mBAAmBE,CAAAA,QAAS;IACvC,MAAMC,YAAYC,IAAAA,0BAAY;IAC9B,MAAM,EACJC,YAAa,IAAG,EAChBC,QAAS,KAAK,CAAA,EACdC,eAAgB,KAAK,CAAA,EACrBC,UAAW,KAAK,CAAA,EAChBC,eAAgB,KAAK,CAAA,EACrBC,eAAgB,KAAK,CAAA,EACrBC,oBAAqB,KAAK,CAAA,EAC1BC,aAAcT,UAAS,EACvBU,qBAAoB,EACpBC,WAAY,IAAI,CAAA,EACjB,GAAGZ;IACJ,MAAMa,YAAYC,IAAAA,qBAAK,EAAC;IACxB,MAAM,CAACC,eAAeC,iBAAiB,GAAGC,IAAAA,2CAAyB;IACnE,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b,cAAc;KAAC;IAC1G,OAAO;QAACE;QAAMC;KAAQ;AACxB,GACA,mCAAmC"}
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/Menu/useMenu.js"],"sourcesContent":["import * as React from 'react';\nimport { usePositioningMouseTarget, usePositioning, resolvePositioningShorthand } from '@fluentui/react-positioning';\nimport { useControllableState, useId, useOnClickOutside, useEventCallback, useOnScrollOutside, useFirstMount } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { elementContains } from '@fluentui/react-portal';\nimport { useFocusFinders } from '@fluentui/react-tabster';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport { MENU_ENTER_EVENT, useOnMenuMouseEnter } from '../../utils/index';\nimport { useIsSubmenu } from '../../utils/useIsSubmenu';\n// If it's not possible to position the submenu in smaller viewports, try\n// and fallback to this order of positions\nconst submenuFallbackPositions = ['after', 'after-bottom', 'before-top', 'before', 'before-bottom', 'above'];\n/**\n * Create the state required to render Menu.\n *\n * The returned state can be modified with hooks such as useMenuStyles,\n * before being passed to renderMenu_unstable.\n *\n * @param props - props from this instance of Menu\n */\nexport const useMenu_unstable = props => {\n const isSubmenu = useIsSubmenu();\n const {\n hoverDelay = 500,\n inline = false,\n hasCheckmarks = false,\n hasIcons = false,\n closeOnScroll = false,\n openOnContext = false,\n persistOnItemClick = false,\n openOnHover = isSubmenu,\n defaultCheckedValues,\n mountNode = null\n } = props;\n const triggerId = useId('menu');\n const [contextTarget, setContextTarget] = usePositioningMouseTarget();\n const positioningState = {\n position: isSubmenu ? 'after' : 'below',\n align: isSubmenu ? 'top' : 'start',\n target: props.openOnContext ? contextTarget : undefined,\n fallbackPositions: isSubmenu ? submenuFallbackPositions : undefined,\n ...resolvePositioningShorthand(props.positioning)\n };\n const children = React.Children.toArray(props.children);\n if (process.env.NODE_ENV !== 'production') {\n if (children.length === 0) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at least one child');\n }\n if (children.length > 2) {\n // eslint-disable-next-line no-console\n console.warn('Menu must contain at most two children');\n }\n }\n let menuTrigger = undefined;\n let menuPopover = undefined;\n if (children.length === 2) {\n menuTrigger = children[0];\n menuPopover = children[1];\n } else if (children.length === 1) {\n menuPopover = children[0];\n }\n const {\n targetRef: triggerRef,\n containerRef: menuPopoverRef\n } = usePositioning(positioningState);\n // TODO Better way to narrow types ?\n const [open, setOpen] = useMenuOpenState({\n hoverDelay,\n isSubmenu,\n setContextTarget,\n closeOnScroll,\n menuPopoverRef,\n triggerRef,\n open: props.open,\n defaultOpen: props.defaultOpen,\n onOpenChange: props.onOpenChange,\n openOnContext\n });\n const [checkedValues, onCheckedValueChange] = useMenuSelectableState({\n checkedValues: props.checkedValues,\n defaultCheckedValues,\n onCheckedValueChange: props.onCheckedValueChange\n });\n return {\n inline,\n hoverDelay,\n triggerId,\n isSubmenu,\n openOnHover,\n contextTarget,\n setContextTarget,\n hasCheckmarks,\n hasIcons,\n closeOnScroll,\n menuTrigger,\n menuPopover,\n mountNode,\n triggerRef,\n menuPopoverRef,\n components: {},\n openOnContext,\n open,\n setOpen,\n checkedValues,\n onCheckedValueChange,\n persistOnItemClick\n };\n};\n/**\n * Adds appropriate state values and handlers for selectable items\n * i.e checkboxes and radios\n */\nconst useMenuSelectableState = props => {\n const [checkedValues, setCheckedValues] = useControllableState({\n state: props.checkedValues,\n defaultState: props.defaultCheckedValues,\n initialState: {}\n });\n const onCheckedValueChange = useEventCallback((e, {\n name,\n checkedItems\n }) => {\n var _props_onCheckedValueChange;\n (_props_onCheckedValueChange = props.onCheckedValueChange) === null || _props_onCheckedValueChange === void 0 ? void 0 : _props_onCheckedValueChange.call(props, e, {\n name,\n checkedItems\n });\n setCheckedValues(currentValue => ({\n ...currentValue,\n [name]: checkedItems\n }));\n });\n return [checkedValues, onCheckedValueChange];\n};\nconst useMenuOpenState = state => {\n const {\n targetDocument\n } = useFluent();\n const parentSetOpen = useMenuContext_unstable(context => context.setOpen);\n const onOpenChange = useEventCallback((e, data) => {\n var _state_onOpenChange;\n return (_state_onOpenChange = state.onOpenChange) === null || _state_onOpenChange === void 0 ? void 0 : _state_onOpenChange.call(state, e, data);\n });\n const setOpenTimeout = React.useRef(0);\n const enteringTriggerRef = React.useRef(false);\n const [open, setOpenState] = useControllableState({\n state: state.open,\n defaultState: state.defaultOpen,\n initialState: false\n });\n const trySetOpen = useEventCallback((e, data) => {\n const event = e instanceof CustomEvent && e.type === MENU_ENTER_EVENT ? e.detail.nativeEvent : e;\n onOpenChange === null || onOpenChange === void 0 ? void 0 : onOpenChange(event, {\n ...data\n });\n if (data.open && e.type === 'contextmenu') {\n state.setContextTarget(e);\n }\n if (!data.open) {\n state.setContextTarget(undefined);\n }\n if (data.bubble) {\n parentSetOpen(e, {\n ...data\n });\n }\n setOpenState(data.open);\n });\n const setOpen = useEventCallback((e, data) => {\n clearTimeout(setOpenTimeout.current);\n if (!(e instanceof Event) && e.persist) {\n // < React 17 still uses pooled synthetic events\n e.persist();\n }\n if (e.type === 'mouseleave' || e.type === 'mouseenter' || e.type === 'mousemove' || e.type === MENU_ENTER_EVENT) {\n var _state_triggerRef_current;\n if ((_state_triggerRef_current = state.triggerRef.current) === null || _state_triggerRef_current === void 0 ? void 0 : _state_triggerRef_current.contains(e.target)) {\n enteringTriggerRef.current = e.type === 'mouseenter' || e.type === 'mousemove';\n }\n // FIXME leaking Node timeout type\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n setOpenTimeout.current = setTimeout(() => trySetOpen(e, data), state.hoverDelay);\n } else {\n trySetOpen(e, data);\n }\n });\n useOnClickOutside({\n contains: elementContains,\n disabled: !open,\n element: targetDocument,\n refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(Boolean),\n callback: event => setOpen(event, {\n open: false,\n type: 'clickOutside',\n event\n })\n });\n // only close on scroll for context, or when closeOnScroll is specified\n const closeOnScroll = state.openOnContext || state.closeOnScroll;\n useOnScrollOutside({\n contains: elementContains,\n element: targetDocument,\n callback: event => setOpen(event, {\n open: false,\n type: 'scrollOutside',\n event\n }),\n refs: [state.menuPopoverRef, !state.openOnContext && state.triggerRef].filter(Boolean),\n disabled: !open || !closeOnScroll\n });\n useOnMenuMouseEnter({\n element: targetDocument,\n callback: event => {\n // When moving from a menu directly back to its trigger, this handler can close the menu\n // Explicitly check a flag to see if this situation happens\n if (!enteringTriggerRef.current) {\n setOpen(event, {\n open: false,\n type: 'menuMouseEnter',\n event\n });\n }\n },\n disabled: !open,\n refs: [state.menuPopoverRef]\n });\n // Clear timeout on unmount\n // Setting state after a component unmounts can cause memory leaks\n React.useEffect(() => {\n return () => {\n clearTimeout(setOpenTimeout.current);\n };\n }, []);\n // Manage focus for open state\n const {\n findFirstFocusable\n } = useFocusFinders();\n const focusFirst = React.useCallback(() => {\n const firstFocusable = findFirstFocusable(state.menuPopoverRef.current);\n firstFocusable === null || firstFocusable === void 0 ? void 0 : firstFocusable.focus();\n }, [findFirstFocusable, state.menuPopoverRef]);\n const firstMount = useFirstMount();\n React.useEffect(() => {\n if (open) {\n focusFirst();\n } else {\n if (!firstMount) {\n if ((targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.activeElement) === (targetDocument === null || targetDocument === void 0 ? void 0 : targetDocument.body)) {\n var\n // We know that React effects are sync so we focus the trigger here\n // after any event handler (event handlers will update state and re-render).\n // Since the browser only performs the default behaviour for the Tab key once\n // keyboard events have fully bubbled up the window, the browser will move\n // focus to the next tabbable element before/after the trigger if needed.\n // If the Tab key was not pressed, focus will remain on the trigger as expected.\n _state_triggerRef_current;\n (_state_triggerRef_current = state.triggerRef.current) === null || _state_triggerRef_current === void 0 ? void 0 : _state_triggerRef_current.focus();\n }\n }\n }\n // firstMount change should not re-run this effect\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [state.triggerRef, state.isSubmenu, open, focusFirst, targetDocument, state.menuPopoverRef]);\n return [open, setOpen];\n};\n//# sourceMappingURL=useMenu.js.map"],"names":["useMenu_unstable","submenuFallbackPositions","props","isSubmenu","useIsSubmenu","hoverDelay","inline","hasCheckmarks","hasIcons","closeOnScroll","openOnContext","persistOnItemClick","openOnHover","defaultCheckedValues","mountNode","triggerId","useId","contextTarget","setContextTarget","usePositioningMouseTarget","positioningState","position","align","target","undefined","fallbackPositions","resolvePositioningShorthand","positioning","children","React","Children","toArray","process","env","NODE_ENV","length","console","warn","menuTrigger","menuPopover","targetRef","triggerRef","containerRef","menuPopoverRef","usePositioning","open","setOpen","useMenuOpenState","defaultOpen","onOpenChange","checkedValues","onCheckedValueChange","useMenuSelectableState","components","setCheckedValues","useControllableState","state","defaultState","initialState","useEventCallback","e","name","checkedItems","_props_onCheckedValueChange","call","currentValue","targetDocument","useFluent","parentSetOpen","useMenuContext_unstable","context","data","_state_onOpenChange","setOpenTimeout","useRef","enteringTriggerRef","setOpenState","trySetOpen","event","CustomEvent","type","MENU_ENTER_EVENT","detail","nativeEvent","bubble","clearTimeout","current","Event","persist","_state_triggerRef_current","contains","setTimeout","useOnClickOutside","elementContains","disabled","element","refs","filter","Boolean","callback","useOnScrollOutside","useOnMenuMouseEnter","useEffect","findFirstFocusable","useFocusFinders","focusFirst","useCallback","firstFocusable","focus","firstMount","useFirstMount","activeElement","body"],"mappings":";;;;+BAoBaA;;aAAAA;;;6DApBU;kCACgE;gCAC6B;qCACpE;6BAChB;8BACA;6BACQ;uBACc;8BACzB;AAC7B,yEAAyE;AACzE,0CAA0C;AAC1C,MAAMC,2BAA2B;IAAC;IAAS;IAAgB;IAAc;IAAU;IAAiB;CAAQ;AASrG,MAAMD,mBAAmBE,CAAAA,QAAS;IACvC,MAAMC,YAAYC,IAAAA,0BAAY;IAC9B,MAAM,EACJC,YAAa,IAAG,EAChBC,QAAS,KAAK,CAAA,EACdC,eAAgB,KAAK,CAAA,EACrBC,UAAW,KAAK,CAAA,EAChBC,eAAgB,KAAK,CAAA,EACrBC,eAAgB,KAAK,CAAA,EACrBC,oBAAqB,KAAK,CAAA,EAC1BC,aAAcT,UAAS,E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0BAA0BmB,KAAK,EAAE;gBACtJ,CAAC;YACH,CAAC;QACH,CAAC;IACD,kDAAkD;IAClD,uDAAuD;IACzD,GAAG;QAACpD,MAAMf,UAAU;QAAEe,MAAMrD,SAAS;QAAE0C;QAAM4D;QAAYvC;QAAgBV,MAAMb,cAAc;KAAC;IAC9F,OAAO;QAACE;QAAMC;KAAQ;AACxB,GACA,mCAAmC"}
|
|
@@ -15,8 +15,7 @@ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
|
15
15
|
const MenuDivider = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
16
16
|
const state = (0, _useMenuDivider.useMenuDivider_unstable)(props, ref);
|
|
17
17
|
(0, _useMenuDividerStyles.useMenuDividerStyles_unstable)(state);
|
|
18
|
-
|
|
19
|
-
useCustomStyles(state);
|
|
18
|
+
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useMenuDividerStyles_unstable')(state);
|
|
20
19
|
return (0, _renderMenuDivider.renderMenuDivider_unstable)(state);
|
|
21
20
|
});
|
|
22
21
|
MenuDivider.displayName = 'MenuDivider'; //# sourceMappingURL=MenuDivider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/MenuDivider/MenuDivider.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuDivider_unstable } from './useMenuDivider';\nimport { useMenuDividerStyles_unstable } from './useMenuDividerStyles';\nimport { renderMenuDivider_unstable } from './renderMenuDivider';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/MenuDivider/MenuDivider.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuDivider_unstable } from './useMenuDivider';\nimport { useMenuDividerStyles_unstable } from './useMenuDividerStyles';\nimport { renderMenuDivider_unstable } from './renderMenuDivider';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuDivider, using the `useMenuDivider_unstable` hook.\n */\nexport const MenuDivider = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useMenuDivider_unstable(props, ref);\n useMenuDividerStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuDividerStyles_unstable')(state);\n return renderMenuDivider_unstable(state);\n});\nMenuDivider.displayName = 'MenuDivider';\n//# sourceMappingURL=MenuDivider.js.map"],"names":["MenuDivider","React","forwardRef","props","ref","state","useMenuDivider_unstable","useMenuDividerStyles_unstable","useCustomStyleHook_unstable","renderMenuDivider_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;gCACiB;sCACM;mCACH;qCACC;AAIrC,MAAMA,cAAc,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACvE,MAAMC,QAAQC,IAAAA,uCAAuB,EAACH,OAAOC;IAC7CG,IAAAA,mDAA6B,EAACF;IAC9BG,IAAAA,gDAA2B,EAAC,iCAAiCH;IAC7D,OAAOI,IAAAA,6CAA0B,EAACJ;AACpC;AACAL,YAAYU,WAAW,GAAG,eAC1B,uCAAuC"}
|
|
@@ -17,8 +17,7 @@ const MenuGroup = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
17
17
|
const state = (0, _useMenuGroup.useMenuGroup_unstable)(props, ref);
|
|
18
18
|
const contextValues = (0, _useMenuGroupContextValues.useMenuGroupContextValues_unstable)(state);
|
|
19
19
|
(0, _useMenuGroupStyles.useMenuGroupStyles_unstable)(state);
|
|
20
|
-
|
|
21
|
-
useCustomStyles(state);
|
|
20
|
+
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useMenuGroupStyles_unstable')(state);
|
|
22
21
|
return (0, _renderMenuGroup.renderMenuGroup_unstable)(state, contextValues);
|
|
23
22
|
});
|
|
24
23
|
MenuGroup.displayName = 'MenuGroup'; //# sourceMappingURL=MenuGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/MenuGroup/MenuGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuGroup_unstable } from './useMenuGroup';\nimport { renderMenuGroup_unstable } from './renderMenuGroup';\nimport { useMenuGroupContextValues_unstable } from './useMenuGroupContextValues';\nimport { useMenuGroupStyles_unstable } from './useMenuGroupStyles';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/MenuGroup/MenuGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuGroup_unstable } from './useMenuGroup';\nimport { renderMenuGroup_unstable } from './renderMenuGroup';\nimport { useMenuGroupContextValues_unstable } from './useMenuGroupContextValues';\nimport { useMenuGroupStyles_unstable } from './useMenuGroupStyles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuGroup, using the `useMenuGroup_unstable` hook.\n */\nexport const MenuGroup = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useMenuGroup_unstable(props, ref);\n const contextValues = useMenuGroupContextValues_unstable(state);\n useMenuGroupStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuGroupStyles_unstable')(state);\n return renderMenuGroup_unstable(state, contextValues);\n});\nMenuGroup.displayName = 'MenuGroup';\n//# sourceMappingURL=MenuGroup.js.map"],"names":["MenuGroup","React","forwardRef","props","ref","state","useMenuGroup_unstable","contextValues","useMenuGroupContextValues_unstable","useMenuGroupStyles_unstable","useCustomStyleHook_unstable","renderMenuGroup_unstable","displayName"],"mappings":";;;;+BASaA;;aAAAA;;;6DATU;8BACe;iCACG;2CACU;oCACP;qCACA;AAIrC,MAAMA,YAAY,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACrE,MAAMC,QAAQC,IAAAA,mCAAqB,EAACH,OAAOC;IAC3C,MAAMG,gBAAgBC,IAAAA,6DAAkC,EAACH;IACzDI,IAAAA,+CAA2B,EAACJ;IAC5BK,IAAAA,gDAA2B,EAAC,+BAA+BL;IAC3D,OAAOM,IAAAA,yCAAwB,EAACN,OAAOE;AACzC;AACAP,UAAUY,WAAW,GAAG,aACxB,qCAAqC"}
|
|
@@ -15,8 +15,7 @@ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
|
15
15
|
const MenuGroupHeader = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
16
16
|
const state = (0, _useMenuGroupHeader.useMenuGroupHeader_unstable)(props, ref);
|
|
17
17
|
(0, _useMenuGroupHeaderStyles.useMenuGroupHeaderStyles_unstable)(state);
|
|
18
|
-
|
|
19
|
-
useCustomStyles(state);
|
|
18
|
+
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useMenuGroupHeaderStyles_unstable')(state);
|
|
20
19
|
return (0, _renderMenuGroupHeader.renderMenuGroupHeader_unstable)(state);
|
|
21
20
|
});
|
|
22
21
|
MenuGroupHeader.displayName = 'MenuGroupHeader'; //# sourceMappingURL=MenuGroupHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/MenuGroupHeader/MenuGroupHeader.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuGroupHeader_unstable } from './useMenuGroupHeader';\nimport { useMenuGroupHeaderStyles_unstable } from './useMenuGroupHeaderStyles';\nimport { renderMenuGroupHeader_unstable } from './renderMenuGroupHeader';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/MenuGroupHeader/MenuGroupHeader.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuGroupHeader_unstable } from './useMenuGroupHeader';\nimport { useMenuGroupHeaderStyles_unstable } from './useMenuGroupHeaderStyles';\nimport { renderMenuGroupHeader_unstable } from './renderMenuGroupHeader';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuGroupHeader, using the `useMenuGroupHeader_unstable` hook.\n */\nexport const MenuGroupHeader = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useMenuGroupHeader_unstable(props, ref);\n useMenuGroupHeaderStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuGroupHeaderStyles_unstable')(state);\n return renderMenuGroupHeader_unstable(state);\n});\nMenuGroupHeader.displayName = 'MenuGroupHeader';\n//# sourceMappingURL=MenuGroupHeader.js.map"],"names":["MenuGroupHeader","React","forwardRef","props","ref","state","useMenuGroupHeader_unstable","useMenuGroupHeaderStyles_unstable","useCustomStyleHook_unstable","renderMenuGroupHeader_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;oCACqB;0CACM;uCACH;qCACH;AAIrC,MAAMA,kBAAkB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAC3E,MAAMC,QAAQC,IAAAA,+CAA2B,EAACH,OAAOC;IACjDG,IAAAA,2DAAiC,EAACF;IAClCG,IAAAA,gDAA2B,EAAC,qCAAqCH;IACjE,OAAOI,IAAAA,qDAA8B,EAACJ;AACxC;AACAL,gBAAgBU,WAAW,GAAG,mBAC9B,2CAA2C"}
|
|
@@ -15,8 +15,7 @@ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
|
15
15
|
const MenuItem = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
16
16
|
const state = (0, _useMenuItem.useMenuItem_unstable)(props, ref);
|
|
17
17
|
(0, _useMenuItemStyles.useMenuItemStyles_unstable)(state);
|
|
18
|
-
|
|
19
|
-
useCustomStyles(state);
|
|
18
|
+
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useMenuItemStyles_unstable')(state);
|
|
20
19
|
return (0, _renderMenuItem.renderMenuItem_unstable)(state);
|
|
21
20
|
});
|
|
22
21
|
MenuItem.displayName = 'MenuItem'; //# sourceMappingURL=MenuItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/MenuItem/MenuItem.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuItem_unstable } from './useMenuItem';\nimport { renderMenuItem_unstable } from './renderMenuItem';\nimport { useMenuItemStyles_unstable } from './useMenuItemStyles';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/MenuItem/MenuItem.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuItem_unstable } from './useMenuItem';\nimport { renderMenuItem_unstable } from './renderMenuItem';\nimport { useMenuItemStyles_unstable } from './useMenuItemStyles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuItem, using the `useMenuItem_unstable` and `useMenuItemStyles_unstable` hook.\n */\nexport const MenuItem = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useMenuItem_unstable(props, ref);\n useMenuItemStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuItemStyles_unstable')(state);\n return renderMenuItem_unstable(state);\n});\nMenuItem.displayName = 'MenuItem';\n//# sourceMappingURL=MenuItem.js.map"],"names":["MenuItem","React","forwardRef","props","ref","state","useMenuItem_unstable","useMenuItemStyles_unstable","useCustomStyleHook_unstable","renderMenuItem_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;6BACc;gCACG;mCACG;qCACC;AAIrC,MAAMA,WAAW,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACpE,MAAMC,QAAQC,IAAAA,iCAAoB,EAACH,OAAOC;IAC1CG,IAAAA,6CAA0B,EAACF;IAC3BG,IAAAA,gDAA2B,EAAC,8BAA8BH;IAC1D,OAAOI,IAAAA,uCAAuB,EAACJ;AACjC;AACAL,SAASU,WAAW,GAAG,YACvB,oCAAoC"}
|
|
@@ -15,8 +15,7 @@ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
|
15
15
|
const MenuItemCheckbox = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
16
16
|
const state = (0, _useMenuItemCheckbox.useMenuItemCheckbox_unstable)(props, ref);
|
|
17
17
|
(0, _useMenuItemCheckboxStyles.useMenuItemCheckboxStyles_unstable)(state);
|
|
18
|
-
|
|
19
|
-
useCustomStyles(state);
|
|
18
|
+
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useMenuItemCheckboxStyles_unstable')(state);
|
|
20
19
|
return (0, _renderMenuItemCheckbox.renderMenuItemCheckbox_unstable)(state);
|
|
21
20
|
});
|
|
22
21
|
MenuItemCheckbox.displayName = 'MenuItemCheckbox'; //# sourceMappingURL=MenuItemCheckbox.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/MenuItemCheckbox/MenuItemCheckbox.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuItemCheckbox_unstable } from './useMenuItemCheckbox';\nimport { renderMenuItemCheckbox_unstable } from './renderMenuItemCheckbox';\nimport { useMenuItemCheckboxStyles_unstable } from './useMenuItemCheckboxStyles';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/MenuItemCheckbox/MenuItemCheckbox.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuItemCheckbox_unstable } from './useMenuItemCheckbox';\nimport { renderMenuItemCheckbox_unstable } from './renderMenuItemCheckbox';\nimport { useMenuItemCheckboxStyles_unstable } from './useMenuItemCheckboxStyles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuItemCheckbox, using the `useMenuItemCheckbox_unstable` hook.\n */\nexport const MenuItemCheckbox = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useMenuItemCheckbox_unstable(props, ref);\n useMenuItemCheckboxStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuItemCheckboxStyles_unstable')(state);\n return renderMenuItemCheckbox_unstable(state);\n});\nMenuItemCheckbox.displayName = 'MenuItemCheckbox';\n//# sourceMappingURL=MenuItemCheckbox.js.map"],"names":["MenuItemCheckbox","React","forwardRef","props","ref","state","useMenuItemCheckbox_unstable","useMenuItemCheckboxStyles_unstable","useCustomStyleHook_unstable","renderMenuItemCheckbox_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;qCACsB;wCACG;2CACG;qCACP;AAIrC,MAAMA,mBAAmB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAC5E,MAAMC,QAAQC,IAAAA,iDAA4B,EAACH,OAAOC;IAClDG,IAAAA,6DAAkC,EAACF;IACnCG,IAAAA,gDAA2B,EAAC,sCAAsCH;IAClE,OAAOI,IAAAA,uDAA+B,EAACJ;AACzC;AACAL,iBAAiBU,WAAW,GAAG,oBAC/B,4CAA4C"}
|
|
@@ -15,8 +15,7 @@ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
|
15
15
|
const MenuItemRadio = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
16
16
|
const state = (0, _useMenuItemRadio.useMenuItemRadio_unstable)(props, ref);
|
|
17
17
|
(0, _useMenuItemRadioStyles.useMenuItemRadioStyles_unstable)(state);
|
|
18
|
-
|
|
19
|
-
useCustomStyles(state);
|
|
18
|
+
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useMenuItemRadioStyles_unstable')(state);
|
|
20
19
|
return (0, _renderMenuItemRadio.renderMenuItemRadio_unstable)(state);
|
|
21
20
|
});
|
|
22
21
|
MenuItemRadio.displayName = 'MenuItemRadio'; //# sourceMappingURL=MenuItemRadio.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/MenuItemRadio/MenuItemRadio.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuItemRadio_unstable } from './useMenuItemRadio';\nimport { renderMenuItemRadio_unstable } from './renderMenuItemRadio';\nimport { useMenuItemRadioStyles_unstable } from './useMenuItemRadioStyles';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/MenuItemRadio/MenuItemRadio.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuItemRadio_unstable } from './useMenuItemRadio';\nimport { renderMenuItemRadio_unstable } from './renderMenuItemRadio';\nimport { useMenuItemRadioStyles_unstable } from './useMenuItemRadioStyles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuItemRadio, using the `useMenuItemRadio_unstable` hook.\n */\nexport const MenuItemRadio = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useMenuItemRadio_unstable(props, ref);\n useMenuItemRadioStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuItemRadioStyles_unstable')(state);\n return renderMenuItemRadio_unstable(state);\n});\nMenuItemRadio.displayName = 'MenuItemRadio';\n//# sourceMappingURL=MenuItemRadio.js.map"],"names":["MenuItemRadio","React","forwardRef","props","ref","state","useMenuItemRadio_unstable","useMenuItemRadioStyles_unstable","useCustomStyleHook_unstable","renderMenuItemRadio_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;kCACmB;qCACG;wCACG;qCACJ;AAIrC,MAAMA,gBAAgB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACzE,MAAMC,QAAQC,IAAAA,2CAAyB,EAACH,OAAOC;IAC/CG,IAAAA,uDAA+B,EAACF;IAChCG,IAAAA,gDAA2B,EAAC,mCAAmCH;IAC/D,OAAOI,IAAAA,iDAA4B,EAACJ;AACtC;AACAL,cAAcU,WAAW,GAAG,iBAC5B,yCAAyC"}
|
|
@@ -17,8 +17,7 @@ const MenuList = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
|
17
17
|
const state = (0, _useMenuList.useMenuList_unstable)(props, ref);
|
|
18
18
|
const contextValues = (0, _useMenuListContextValues.useMenuListContextValues_unstable)(state);
|
|
19
19
|
(0, _useMenuListStyles.useMenuListStyles_unstable)(state);
|
|
20
|
-
|
|
21
|
-
useCustomStyles(state);
|
|
20
|
+
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useMenuListStyles_unstable')(state);
|
|
22
21
|
return (0, _renderMenuList.renderMenuList_unstable)(state, contextValues);
|
|
23
22
|
});
|
|
24
23
|
MenuList.displayName = 'MenuList'; //# sourceMappingURL=MenuList.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/MenuList/MenuList.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuList_unstable } from './useMenuList';\nimport { renderMenuList_unstable } from './renderMenuList';\nimport { useMenuListContextValues_unstable } from './useMenuListContextValues';\nimport { useMenuListStyles_unstable } from './useMenuListStyles';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/MenuList/MenuList.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuList_unstable } from './useMenuList';\nimport { renderMenuList_unstable } from './renderMenuList';\nimport { useMenuListContextValues_unstable } from './useMenuListContextValues';\nimport { useMenuListStyles_unstable } from './useMenuListStyles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Define a styled MenuList, using the `useMenuList_unstable` hook.\n */\nexport const MenuList = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useMenuList_unstable(props, ref);\n const contextValues = useMenuListContextValues_unstable(state);\n useMenuListStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuListStyles_unstable')(state);\n return renderMenuList_unstable(state, contextValues);\n});\nMenuList.displayName = 'MenuList';\n//# sourceMappingURL=MenuList.js.map"],"names":["MenuList","React","forwardRef","props","ref","state","useMenuList_unstable","contextValues","useMenuListContextValues_unstable","useMenuListStyles_unstable","useCustomStyleHook_unstable","renderMenuList_unstable","displayName"],"mappings":";;;;+BASaA;;aAAAA;;;6DATU;6BACc;gCACG;0CACU;mCACP;qCACC;AAIrC,MAAMA,WAAW,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACpE,MAAMC,QAAQC,IAAAA,iCAAoB,EAACH,OAAOC;IAC1C,MAAMG,gBAAgBC,IAAAA,2DAAiC,EAACH;IACxDI,IAAAA,6CAA0B,EAACJ;IAC3BK,IAAAA,gDAA2B,EAAC,8BAA8BL;IAC1D,OAAOM,IAAAA,uCAAuB,EAACN,OAAOE;AACxC;AACAP,SAASY,WAAW,GAAG,YACvB,oCAAoC"}
|
|
@@ -15,8 +15,7 @@ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
|
15
15
|
const MenuPopover = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
16
16
|
const state = (0, _useMenuPopover.useMenuPopover_unstable)(props, ref);
|
|
17
17
|
(0, _useMenuPopoverStyles.useMenuPopoverStyles_unstable)(state);
|
|
18
|
-
|
|
19
|
-
useCustomStyles(state);
|
|
18
|
+
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useMenuPopoverStyles_unstable')(state);
|
|
20
19
|
return (0, _renderMenuPopover.renderMenuPopover_unstable)(state);
|
|
21
20
|
});
|
|
22
21
|
MenuPopover.displayName = 'MenuPopover'; //# sourceMappingURL=MenuPopover.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/MenuPopover/MenuPopover.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuPopover_unstable } from './useMenuPopover';\nimport { useMenuPopoverStyles_unstable } from './useMenuPopoverStyles';\nimport { renderMenuPopover_unstable } from './renderMenuPopover';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/MenuPopover/MenuPopover.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuPopover_unstable } from './useMenuPopover';\nimport { useMenuPopoverStyles_unstable } from './useMenuPopoverStyles';\nimport { renderMenuPopover_unstable } from './renderMenuPopover';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Popover intended to wrap `MenuList` and adds styling and interaction support specific to menus\n */\nexport const MenuPopover = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useMenuPopover_unstable(props, ref);\n useMenuPopoverStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuPopoverStyles_unstable')(state);\n return renderMenuPopover_unstable(state);\n});\nMenuPopover.displayName = 'MenuPopover';\n//# sourceMappingURL=MenuPopover.js.map"],"names":["MenuPopover","React","forwardRef","props","ref","state","useMenuPopover_unstable","useMenuPopoverStyles_unstable","useCustomStyleHook_unstable","renderMenuPopover_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;gCACiB;sCACM;mCACH;qCACC;AAIrC,MAAMA,cAAc,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IACvE,MAAMC,QAAQC,IAAAA,uCAAuB,EAACH,OAAOC;IAC7CG,IAAAA,mDAA6B,EAACF;IAC9BG,IAAAA,gDAA2B,EAAC,iCAAiCH;IAC7D,OAAOI,IAAAA,6CAA0B,EAACJ;AACpC;AACAL,YAAYU,WAAW,GAAG,eAC1B,uCAAuC"}
|
|
@@ -15,8 +15,7 @@ const _reactSharedContexts = require("@fluentui/react-shared-contexts");
|
|
|
15
15
|
const MenuSplitGroup = /*#__PURE__*/ _react.forwardRef((props, ref)=>{
|
|
16
16
|
const state = (0, _useMenuSplitGroup.useMenuSplitGroup_unstable)(props, ref);
|
|
17
17
|
(0, _useMenuSplitGroupStyles.useMenuSplitGroupStyles_unstable)(state);
|
|
18
|
-
|
|
19
|
-
useCustomStyles(state);
|
|
18
|
+
(0, _reactSharedContexts.useCustomStyleHook_unstable)('useMenuSplitGroupStyles_unstable')(state);
|
|
20
19
|
return (0, _renderMenuSplitGroup.renderMenuSplitGroup_unstable)(state);
|
|
21
20
|
});
|
|
22
21
|
MenuSplitGroup.displayName = 'MenuSplitGroup'; //# sourceMappingURL=MenuSplitGroup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../lib/components/MenuSplitGroup/MenuSplitGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuSplitGroup_unstable } from './useMenuSplitGroup';\nimport { renderMenuSplitGroup_unstable } from './renderMenuSplitGroup';\nimport { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles';\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../lib/components/MenuSplitGroup/MenuSplitGroup.js"],"sourcesContent":["import * as React from 'react';\nimport { useMenuSplitGroup_unstable } from './useMenuSplitGroup';\nimport { renderMenuSplitGroup_unstable } from './renderMenuSplitGroup';\nimport { useMenuSplitGroupStyles_unstable } from './useMenuSplitGroupStyles';\nimport { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';\n/**\n * Layout wrapper that provides extra keyboard navigation behavior for two `MenuItem` components.\n */\nexport const MenuSplitGroup = /*#__PURE__*/React.forwardRef((props, ref) => {\n const state = useMenuSplitGroup_unstable(props, ref);\n useMenuSplitGroupStyles_unstable(state);\n useCustomStyleHook_unstable('useMenuSplitGroupStyles_unstable')(state);\n return renderMenuSplitGroup_unstable(state);\n});\nMenuSplitGroup.displayName = 'MenuSplitGroup';\n//# sourceMappingURL=MenuSplitGroup.js.map"],"names":["MenuSplitGroup","React","forwardRef","props","ref","state","useMenuSplitGroup_unstable","useMenuSplitGroupStyles_unstable","useCustomStyleHook_unstable","renderMenuSplitGroup_unstable","displayName"],"mappings":";;;;+BAQaA;;aAAAA;;;6DARU;mCACoB;sCACG;yCACG;qCACL;AAIrC,MAAMA,iBAAiB,WAAW,GAAEC,OAAMC,UAAU,CAAC,CAACC,OAAOC,MAAQ;IAC1E,MAAMC,QAAQC,IAAAA,6CAA0B,EAACH,OAAOC;IAChDG,IAAAA,yDAAgC,EAACF;IACjCG,IAAAA,gDAA2B,EAAC,oCAAoCH;IAChE,OAAOI,IAAAA,mDAA6B,EAACJ;AACvC;AACAL,eAAeU,WAAW,GAAG,kBAC7B,0CAA0C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluentui/react-menu",
|
|
3
|
-
"version": "0.0.0-nightly-
|
|
3
|
+
"version": "0.0.0-nightly-20230426-0420.1",
|
|
4
4
|
"description": "Fluent UI menu component",
|
|
5
5
|
"main": "lib-commonjs/index.js",
|
|
6
6
|
"module": "lib/index.js",
|
|
@@ -29,23 +29,23 @@
|
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@fluentui/eslint-plugin": "*",
|
|
31
31
|
"@fluentui/react-conformance": "*",
|
|
32
|
-
"@fluentui/react-conformance-griffel": "0.0.0-nightly-
|
|
32
|
+
"@fluentui/react-conformance-griffel": "0.0.0-nightly-20230426-0420.1",
|
|
33
33
|
"@fluentui/scripts-api-extractor": "*",
|
|
34
34
|
"@fluentui/scripts-cypress": "*",
|
|
35
35
|
"@fluentui/scripts-tasks": "*"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@fluentui/keyboard-keys": "0.0.0-nightly-
|
|
39
|
-
"@fluentui/react-aria": "0.0.0-nightly-
|
|
40
|
-
"@fluentui/react-context-selector": "0.0.0-nightly-
|
|
38
|
+
"@fluentui/keyboard-keys": "0.0.0-nightly-20230426-0420.1",
|
|
39
|
+
"@fluentui/react-aria": "0.0.0-nightly-20230426-0420.1",
|
|
40
|
+
"@fluentui/react-context-selector": "0.0.0-nightly-20230426-0420.1",
|
|
41
41
|
"@fluentui/react-icons": "^2.0.196",
|
|
42
|
-
"@fluentui/react-portal": "0.0.0-nightly-
|
|
43
|
-
"@fluentui/react-positioning": "0.0.0-nightly-
|
|
44
|
-
"@fluentui/react-shared-contexts": "0.0.0-nightly-
|
|
45
|
-
"@fluentui/react-tabster": "0.0.0-nightly-
|
|
46
|
-
"@fluentui/react-theme": "0.0.0-nightly-
|
|
47
|
-
"@fluentui/react-utilities": "0.0.0-nightly-
|
|
48
|
-
"@fluentui/react-jsx-runtime": "0.0.0-nightly-
|
|
42
|
+
"@fluentui/react-portal": "0.0.0-nightly-20230426-0420.1",
|
|
43
|
+
"@fluentui/react-positioning": "0.0.0-nightly-20230426-0420.1",
|
|
44
|
+
"@fluentui/react-shared-contexts": "0.0.0-nightly-20230426-0420.1",
|
|
45
|
+
"@fluentui/react-tabster": "0.0.0-nightly-20230426-0420.1",
|
|
46
|
+
"@fluentui/react-theme": "0.0.0-nightly-20230426-0420.1",
|
|
47
|
+
"@fluentui/react-utilities": "0.0.0-nightly-20230426-0420.1",
|
|
48
|
+
"@fluentui/react-jsx-runtime": "0.0.0-nightly-20230426-0420.1",
|
|
49
49
|
"@griffel/react": "^1.5.2",
|
|
50
50
|
"@swc/helpers": "^0.4.14"
|
|
51
51
|
},
|