@fluentui/react-menu 9.5.3 → 9.5.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +72 -1
- package/CHANGELOG.md +18 -2
- package/lib/components/Menu/Menu.js +0 -1
- package/lib/components/Menu/Menu.js.map +1 -1
- package/lib/components/Menu/renderMenu.js +0 -1
- package/lib/components/Menu/renderMenu.js.map +1 -1
- package/lib/components/Menu/useMenu.js +16 -34
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/Menu/useMenuContextValues.js +2 -2
- package/lib/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib/components/MenuDivider/MenuDivider.js +0 -1
- package/lib/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/renderMenuDivider.js +2 -2
- package/lib/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDivider.js +0 -1
- package/lib/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.js +10 -12
- package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib/components/MenuGroup/MenuGroup.js +0 -1
- package/lib/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/renderMenuGroup.js +2 -2
- package/lib/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroup.js +0 -1
- package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js +0 -1
- package/lib/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -2
- package/lib/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js +0 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +10 -12
- package/lib/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib/components/MenuItem/MenuItem.js +0 -1
- package/lib/components/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/MenuItem/renderMenuItem.js +12 -7
- package/lib/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useCharacterSearch.js +0 -5
- package/lib/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib/components/MenuItem/useMenuItem.js +0 -6
- package/lib/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib/components/MenuItem/useMenuItemStyles.js +108 -117
- package/lib/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js +0 -1
- package/lib/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js +10 -6
- package/lib/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js +2 -4
- package/lib/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +0 -5
- package/lib/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.js +0 -1
- package/lib/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js +10 -6
- package/lib/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadio.js +3 -4
- package/lib/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js +0 -5
- package/lib/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib/components/MenuList/MenuList.js +0 -1
- package/lib/components/MenuList/MenuList.js.map +1 -1
- package/lib/components/MenuList/renderMenuList.js +2 -2
- package/lib/components/MenuList/renderMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuList.js +10 -27
- package/lib/components/MenuList/useMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js +2 -2
- package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib/components/MenuList/useMenuListStyles.js +6 -9
- package/lib/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib/components/MenuPopover/MenuPopover.js +0 -1
- package/lib/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/renderMenuPopover.js +4 -5
- package/lib/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopover.js +6 -13
- package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopoverStyles.js +32 -35
- package/lib/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js +0 -1
- package/lib/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js +2 -2
- package/lib/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js +0 -6
- package/lib/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js +12 -15
- package/lib/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
- package/lib/components/MenuTrigger/MenuTrigger.js +2 -3
- package/lib/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js +0 -1
- package/lib/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib/components/MenuTrigger/useMenuTrigger.js +4 -24
- package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib/contexts/menuContext.js.map +1 -1
- package/lib/contexts/menuGroupContext.js +0 -1
- package/lib/contexts/menuGroupContext.js.map +1 -1
- package/lib/contexts/menuListContext.js.map +1 -1
- package/lib/contexts/menuTriggerContext.js +0 -2
- package/lib/contexts/menuTriggerContext.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/selectable/useCheckmarkStyles.js +7 -11
- package/lib/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib/utils/useIsSubmenu.js +0 -1
- package/lib/utils/useIsSubmenu.js.map +1 -1
- package/lib/utils/useOnMenuEnter.js +4 -11
- package/lib/utils/useOnMenuEnter.js.map +1 -1
- package/lib-commonjs/Menu.js +0 -2
- package/lib-commonjs/Menu.js.map +1 -1
- package/lib-commonjs/MenuDivider.js +0 -2
- package/lib-commonjs/MenuDivider.js.map +1 -1
- package/lib-commonjs/MenuGroup.js +0 -2
- package/lib-commonjs/MenuGroup.js.map +1 -1
- package/lib-commonjs/MenuGroupHeader.js +0 -2
- package/lib-commonjs/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/MenuItem.js +0 -2
- package/lib-commonjs/MenuItem.js.map +1 -1
- package/lib-commonjs/MenuItemCheckbox.js +0 -2
- package/lib-commonjs/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/MenuItemRadio.js +0 -2
- package/lib-commonjs/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/MenuList.js +0 -2
- package/lib-commonjs/MenuList.js.map +1 -1
- package/lib-commonjs/MenuPopover.js +0 -2
- package/lib-commonjs/MenuPopover.js.map +1 -1
- package/lib-commonjs/MenuSplitGroup.js +0 -2
- package/lib-commonjs/MenuSplitGroup.js.map +1 -1
- package/lib-commonjs/MenuTrigger.js +0 -2
- package/lib-commonjs/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.js +0 -6
- package/lib-commonjs/components/Menu/Menu.js.map +1 -1
- package/lib-commonjs/components/Menu/Menu.types.js.map +1 -1
- package/lib-commonjs/components/Menu/index.js +0 -6
- package/lib-commonjs/components/Menu/index.js.map +1 -1
- package/lib-commonjs/components/Menu/renderMenu.js +0 -5
- package/lib-commonjs/components/Menu/renderMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenu.js +16 -46
- package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenuContextValues.js +2 -4
- package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.js +0 -6
- package/lib-commonjs/components/MenuDivider/MenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/MenuDivider.types.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/index.js +0 -6
- package/lib-commonjs/components/MenuDivider/index.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js +2 -6
- package/lib-commonjs/components/MenuDivider/renderMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js +0 -4
- package/lib-commonjs/components/MenuDivider/useMenuDivider.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +10 -16
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.js +0 -7
- package/lib-commonjs/components/MenuGroup/MenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/MenuGroup.types.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/index.js +0 -7
- package/lib-commonjs/components/MenuGroup/index.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js +2 -7
- package/lib-commonjs/components/MenuGroup/renderMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js +0 -4
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js +0 -3
- package/lib-commonjs/components/MenuGroup/useMenuGroupContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js +0 -4
- package/lib-commonjs/components/MenuGroup/useMenuGroupStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js +0 -6
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/index.js +0 -6
- package/lib-commonjs/components/MenuGroupHeader/index.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js +2 -6
- package/lib-commonjs/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js +0 -5
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -1
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +10 -16
- package/lib-commonjs/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.js +0 -6
- package/lib-commonjs/components/MenuItem/MenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/MenuItem.types.js.map +1 -1
- package/lib-commonjs/components/MenuItem/index.js +0 -6
- package/lib-commonjs/components/MenuItem/index.js.map +1 -1
- package/lib-commonjs/components/MenuItem/renderMenuItem.js +12 -11
- package/lib-commonjs/components/MenuItem/renderMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js +0 -8
- package/lib-commonjs/components/MenuItem/useCharacterSearch.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItem.js +0 -18
- package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js +108 -124
- package/lib-commonjs/components/MenuItem/useMenuItemStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js +0 -6
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/index.js +0 -6
- package/lib-commonjs/components/MenuItemCheckbox/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js +10 -10
- package/lib-commonjs/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js +2 -11
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -1
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +0 -11
- package/lib-commonjs/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js +0 -6
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/index.js +0 -6
- package/lib-commonjs/components/MenuItemRadio/index.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js +10 -10
- package/lib-commonjs/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js +3 -11
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadio.js.map +1 -1
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js +0 -11
- package/lib-commonjs/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.js +0 -7
- package/lib-commonjs/components/MenuList/MenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/MenuList.types.js.map +1 -1
- package/lib-commonjs/components/MenuList/index.js +0 -7
- package/lib-commonjs/components/MenuList/index.js.map +1 -1
- package/lib-commonjs/components/MenuList/renderMenuList.js +2 -7
- package/lib-commonjs/components/MenuList/renderMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuList.js +10 -35
- package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js +2 -4
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListStyles.js +6 -12
- package/lib-commonjs/components/MenuList/useMenuListStyles.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.js +0 -6
- package/lib-commonjs/components/MenuPopover/MenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/MenuPopover.types.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/index.js +0 -6
- package/lib-commonjs/components/MenuPopover/index.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js +4 -10
- package/lib-commonjs/components/MenuPopover/renderMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js +6 -22
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js +32 -39
- package/lib-commonjs/components/MenuPopover/useMenuPopoverStyles.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js +0 -6
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/index.js +0 -6
- package/lib-commonjs/components/MenuSplitGroup/index.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js +2 -6
- package/lib-commonjs/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js +0 -13
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -1
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js +12 -20
- package/lib-commonjs/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js +2 -7
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/MenuTrigger.types.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/index.js +0 -5
- package/lib-commonjs/components/MenuTrigger/index.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js +0 -5
- package/lib-commonjs/components/MenuTrigger/renderMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +4 -34
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib-commonjs/components/index.js +0 -3
- package/lib-commonjs/components/index.js.map +1 -1
- package/lib-commonjs/contexts/menuContext.js +0 -4
- package/lib-commonjs/contexts/menuContext.js.map +1 -1
- package/lib-commonjs/contexts/menuGroupContext.js +0 -5
- package/lib-commonjs/contexts/menuGroupContext.js.map +1 -1
- package/lib-commonjs/contexts/menuListContext.js +0 -4
- package/lib-commonjs/contexts/menuListContext.js.map +1 -1
- package/lib-commonjs/contexts/menuTriggerContext.js +0 -6
- package/lib-commonjs/contexts/menuTriggerContext.js.map +1 -1
- package/lib-commonjs/index.js +0 -32
- package/lib-commonjs/index.js.map +1 -1
- package/lib-commonjs/selectable/index.js +0 -3
- package/lib-commonjs/selectable/index.js.map +1 -1
- package/lib-commonjs/selectable/types.js.map +1 -1
- package/lib-commonjs/selectable/useCheckmarkStyles.js +7 -13
- package/lib-commonjs/selectable/useCheckmarkStyles.js.map +1 -1
- package/lib-commonjs/utils/index.js +0 -2
- package/lib-commonjs/utils/index.js.map +1 -1
- package/lib-commonjs/utils/useIsSubmenu.js +0 -6
- package/lib-commonjs/utils/useIsSubmenu.js.map +1 -1
- package/lib-commonjs/utils/useOnMenuEnter.js +4 -17
- package/lib-commonjs/utils/useOnMenuEnter.js.map +1 -1
- package/package.json +10 -10
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useMenuItemCheckboxStyles_unstable = exports.menuItemCheckboxClassNames = void 0;
|
7
|
-
|
8
7
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
-
|
10
8
|
const index_1 = /*#__PURE__*/require("../../selectable/index");
|
11
|
-
|
12
9
|
const useMenuItemStyles_1 = /*#__PURE__*/require("../MenuItem/useMenuItemStyles");
|
13
|
-
|
14
10
|
exports.menuItemCheckboxClassNames = {
|
15
11
|
root: 'fui-MenuItemCheckbox',
|
16
12
|
icon: 'fui-MenuItemCheckbox__icon',
|
@@ -18,29 +14,22 @@ exports.menuItemCheckboxClassNames = {
|
|
18
14
|
content: 'fui-MenuItemCheckbox__content',
|
19
15
|
secondaryContent: 'fui-MenuItemCheckbox__secondaryContent'
|
20
16
|
};
|
21
|
-
|
22
17
|
const useMenuItemCheckboxStyles_unstable = state => {
|
23
18
|
state.root.className = react_1.mergeClasses(exports.menuItemCheckboxClassNames.root, state.root.className);
|
24
|
-
|
25
19
|
if (state.content) {
|
26
20
|
state.content.className = react_1.mergeClasses(exports.menuItemCheckboxClassNames.content, state.content.className);
|
27
21
|
}
|
28
|
-
|
29
22
|
if (state.secondaryContent) {
|
30
23
|
state.secondaryContent.className = react_1.mergeClasses(exports.menuItemCheckboxClassNames.secondaryContent, state.secondaryContent.className);
|
31
24
|
}
|
32
|
-
|
33
25
|
if (state.icon) {
|
34
26
|
state.icon.className = react_1.mergeClasses(exports.menuItemCheckboxClassNames.icon, state.icon.className);
|
35
27
|
}
|
36
|
-
|
37
28
|
if (state.checkmark) {
|
38
29
|
state.checkmark.className = react_1.mergeClasses(exports.menuItemCheckboxClassNames.checkmark, state.checkmark.className);
|
39
30
|
}
|
40
|
-
|
41
31
|
useMenuItemStyles_1.useMenuItemStyles_unstable(state);
|
42
32
|
index_1.useCheckmarkStyles_unstable(state);
|
43
33
|
};
|
44
|
-
|
45
34
|
exports.useMenuItemCheckboxStyles_unstable = useMenuItemCheckboxStyles_unstable;
|
46
35
|
//# sourceMappingURL=useMenuItemCheckboxStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AAKaA,kCAA0B,GAA4D;EACjGC,IAAI,EAAE,sBAAsB;EAC5BC,IAAI,EAAE,4BAA4B;EAClCC,SAAS,EAAE,iCAAiC;EAC5CC,OAAO,EAAE,+BAA+B;EACxCC,gBAAgB,EAAE;CACnB;AAEM,MAAMC,kCAAkC,GAAIC,KAA4B,IAAI;EACjFA,KAAK,CAACN,IAAI,CAACO,SAAS,GAAGC,oBAAY,CAACT,kCAA0B,CAACC,IAAI,EAAEM,KAAK,CAACN,IAAI,CAACO,SAAS,CAAC;EAE1F,IAAID,KAAK,CAACH,OAAO,EAAE;IACjBG,KAAK,CAACH,OAAO,CAACI,SAAS,GAAGC,oBAAY,CAACT,kCAA0B,CAACI,OAAO,EAAEG,KAAK,CAACH,OAAO,CAACI,SAAS,CAAC;;EAGrG,IAAID,KAAK,CAACF,gBAAgB,EAAE;IAC1BE,KAAK,CAACF,gBAAgB,CAACG,SAAS,GAAGC,oBAAY,CAC7CT,kCAA0B,CAACK,gBAAgB,EAC3CE,KAAK,CAACF,gBAAgB,CAACG,SAAS,CACjC;;EAGH,IAAID,KAAK,CAACL,IAAI,EAAE;IACdK,KAAK,CAACL,IAAI,CAACM,SAAS,GAAGC,oBAAY,CAACT,kCAA0B,CAACE,IAAI,EAAEK,KAAK,CAACL,IAAI,CAACM,SAAS,CAAC;;EAG5F,IAAID,KAAK,CAACJ,SAAS,EAAE;IACnBI,KAAK,CAACJ,SAAS,CAACK,SAAS,GAAGC,oBAAY,CAACT,kCAA0B,CAACG,SAAS,EAAEI,KAAK,CAACJ,SAAS,CAACK,SAAS,CAAC;;EAG3GE,8CAA0B,CAACH,KAAK,CAAC;EACjCI,mCAA2B,CAACJ,KAAK,CAAC;AACpC,CAAC;AAxBYP,0CAAkC","names":["exports","root","icon","checkmark","content","secondaryContent","useMenuItemCheckboxStyles_unstable","state","className","react_1","useMenuItemStyles_1","index_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItemCheckbox/useMenuItemCheckboxStyles.ts"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport { useCheckmarkStyles_unstable } from '../../selectable/index';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuItemSlots } from '../index';\nimport type { MenuItemCheckboxState } from './MenuItemCheckbox.types';\n\nexport const menuItemCheckboxClassNames: SlotClassNames<Omit<MenuItemSlots, 'submenuIndicator'>> = {\n root: 'fui-MenuItemCheckbox',\n icon: 'fui-MenuItemCheckbox__icon',\n checkmark: 'fui-MenuItemCheckbox__checkmark',\n content: 'fui-MenuItemCheckbox__content',\n secondaryContent: 'fui-MenuItemCheckbox__secondaryContent',\n};\n\nexport const useMenuItemCheckboxStyles_unstable = (state: MenuItemCheckboxState) => {\n state.root.className = mergeClasses(menuItemCheckboxClassNames.root, state.root.className);\n\n if (state.content) {\n state.content.className = mergeClasses(menuItemCheckboxClassNames.content, state.content.className);\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n menuItemCheckboxClassNames.secondaryContent,\n state.secondaryContent.className,\n );\n }\n\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemCheckboxClassNames.icon, state.icon.className);\n }\n\n if (state.checkmark) {\n state.checkmark.className = mergeClasses(menuItemCheckboxClassNames.checkmark, state.checkmark.className);\n }\n\n useMenuItemStyles_unstable(state);\n useCheckmarkStyles_unstable(state);\n};\n"]}
|
@@ -4,19 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.MenuItemRadio = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const useMenuItemRadio_1 = /*#__PURE__*/require("./useMenuItemRadio");
|
11
|
-
|
12
9
|
const renderMenuItemRadio_1 = /*#__PURE__*/require("./renderMenuItemRadio");
|
13
|
-
|
14
10
|
const useMenuItemRadioStyles_1 = /*#__PURE__*/require("./useMenuItemRadioStyles");
|
15
11
|
/**
|
16
12
|
* Define a styled MenuItemRadio, using the `useMenuItemRadio_unstable` hook.
|
17
13
|
*/
|
18
|
-
|
19
|
-
|
20
14
|
exports.MenuItemRadio = /*#__PURE__*/React.forwardRef((props, ref) => {
|
21
15
|
const state = useMenuItemRadio_1.useMenuItemRadio_unstable(props, ref);
|
22
16
|
useMenuItemRadioStyles_1.useMenuItemRadioStyles_unstable(state);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAIA;;;AAGaA,qBAAa,gBAA4CC,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EACpG,MAAMC,KAAK,GAAGC,4CAAyB,CAACH,KAAK,EAAEC,GAAG,CAAC;EACnDG,wDAA+B,CAACF,KAAK,CAAC;EAEtC,OAAOG,kDAA4B,CAACH,KAAK,CAAC;AAC5C,CAAC,CAAC;AAEFL,qBAAa,CAACS,WAAW,GAAG,eAAe","names":["exports","React","forwardRef","props","ref","state","useMenuItemRadio_1","useMenuItemRadioStyles_1","renderMenuItemRadio_1","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/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';\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 useMenuItemRadioStyles_unstable(state);\n\n return renderMenuItemRadio_unstable(state);\n});\n\nMenuItemRadio.displayName = 'MenuItemRadio';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
|
@@ -3,16 +3,10 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
|
7
6
|
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
|
-
|
9
7
|
tslib_1.__exportStar(require("./MenuItemRadio.types"), exports);
|
10
|
-
|
11
8
|
tslib_1.__exportStar(require("./MenuItemRadio"), exports);
|
12
|
-
|
13
9
|
tslib_1.__exportStar(require("./renderMenuItemRadio"), exports);
|
14
|
-
|
15
10
|
tslib_1.__exportStar(require("./useMenuItemRadio"), exports);
|
16
|
-
|
17
11
|
tslib_1.__exportStar(require("./useMenuItemRadioStyles"), exports);
|
18
12
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-menu/src/components/MenuItemRadio/index.ts"],"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItemRadio/index.ts"],"sourcesContent":["export * from './MenuItemRadio.types';\nexport * from './MenuItemRadio';\nexport * from './renderMenuItemRadio';\nexport * from './useMenuItemRadio';\nexport * from './useMenuItemRadioStyles';\n"]}
|
@@ -4,28 +4,28 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.renderMenuItemRadio_unstable = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
9
|
/**
|
12
10
|
* Redefine the render function to add slots. Reuse the menuitemradio structure but add
|
13
11
|
* slots to children.
|
14
12
|
*/
|
15
|
-
|
16
|
-
|
17
13
|
const renderMenuItemRadio_unstable = state => {
|
18
14
|
const {
|
19
15
|
slots,
|
20
16
|
slotProps
|
21
17
|
} = react_utilities_1.getSlots(state);
|
22
|
-
return React.createElement(slots.root, {
|
23
|
-
|
24
|
-
}
|
25
|
-
|
26
|
-
}), slots.
|
18
|
+
return React.createElement(slots.root, {
|
19
|
+
...slotProps.root
|
20
|
+
}, slots.checkmark && React.createElement(slots.checkmark, {
|
21
|
+
...slotProps.checkmark
|
22
|
+
}), slots.icon && React.createElement(slots.icon, {
|
23
|
+
...slotProps.icon
|
24
|
+
}), slots.content && React.createElement(slots.content, {
|
25
|
+
...slotProps.content
|
26
|
+
}), slots.secondaryContent && React.createElement(slots.secondaryContent, {
|
27
|
+
...slotProps.secondaryContent
|
27
28
|
}));
|
28
29
|
};
|
29
|
-
|
30
30
|
exports.renderMenuItemRadio_unstable = renderMenuItemRadio_unstable;
|
31
31
|
//# sourceMappingURL=renderMenuItemRadio.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAIA;;;;AAIO,MAAMA,4BAA4B,GAAIC,KAAyB,IAAI;EACxE,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAgBH,KAAK,CAAC;EAE3D,OACEI,oBAACH,KAAK,CAACI,IAAI;IAAA,GAAKH,SAAS,CAACG;EAAI,GAC3BJ,KAAK,CAACK,SAAS,IAAIF,oBAACH,KAAK,CAACK,SAAS;IAAA,GAAKJ,SAAS,CAACI;EAAS,EAAI,EAC/DL,KAAK,CAACM,IAAI,IAAIH,oBAACH,KAAK,CAACM,IAAI;IAAA,GAAKL,SAAS,CAACK;EAAI,EAAI,EAChDN,KAAK,CAACO,OAAO,IAAIJ,oBAACH,KAAK,CAACO,OAAO;IAAA,GAAKN,SAAS,CAACM;EAAO,EAAI,EACzDP,KAAK,CAACQ,gBAAgB,IAAIL,oBAACH,KAAK,CAACQ,gBAAgB;IAAA,GAAKP,SAAS,CAACO;EAAgB,EAAI,CAC1E;AAEjB,CAAC;AAXYC,oCAA4B","names":["renderMenuItemRadio_unstable","state","slots","slotProps","react_utilities_1","React","root","checkmark","icon","content","secondaryContent","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItemRadio/renderMenuItemRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { MenuItemRadioState } from './MenuItemRadio.types';\nimport type { MenuItemSlots } from '../MenuItem/MenuItem.types';\n\n/**\n * Redefine the render function to add slots. Reuse the menuitemradio structure but add\n * slots to children.\n */\nexport const renderMenuItemRadio_unstable = (state: MenuItemRadioState) => {\n const { slots, slotProps } = getSlots<MenuItemSlots>(state);\n\n return (\n <slots.root {...slotProps.root}>\n {slots.checkmark && <slots.checkmark {...slotProps.checkmark} />}\n {slots.icon && <slots.icon {...slotProps.icon} />}\n {slots.content && <slots.content {...slotProps.content} />}\n {slots.secondaryContent && <slots.secondaryContent {...slotProps.secondaryContent} />}\n </slots.root>\n );\n};\n"]}
|
@@ -4,21 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useMenuItemRadio_unstable = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
-
|
12
9
|
const react_icons_1 = /*#__PURE__*/require("@fluentui/react-icons");
|
13
|
-
|
14
10
|
const menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
|
15
|
-
|
16
11
|
const useMenuItem_1 = /*#__PURE__*/require("../MenuItem/useMenuItem");
|
17
12
|
/**
|
18
13
|
* Given user props, returns state and render function for a MenuItemRadio.
|
19
14
|
*/
|
20
|
-
|
21
|
-
|
22
15
|
const useMenuItemRadio_unstable = (props, ref) => {
|
23
16
|
const {
|
24
17
|
name,
|
@@ -26,12 +19,13 @@ const useMenuItemRadio_unstable = (props, ref) => {
|
|
26
19
|
} = props;
|
27
20
|
const checked = menuListContext_1.useMenuListContext_unstable(context => {
|
28
21
|
var _a;
|
29
|
-
|
30
22
|
const checkedItems = ((_a = context.checkedValues) === null || _a === void 0 ? void 0 : _a[name]) || [];
|
31
23
|
return checkedItems.indexOf(value) !== -1;
|
32
24
|
});
|
33
25
|
const selectRadio = menuListContext_1.useMenuListContext_unstable(context => context.selectRadio);
|
34
|
-
return {
|
26
|
+
return {
|
27
|
+
...useMenuItem_1.useMenuItem_unstable({
|
28
|
+
...props,
|
35
29
|
role: 'menuitemradio',
|
36
30
|
'aria-checked': checked,
|
37
31
|
checkmark: react_utilities_1.resolveShorthand(props.checkmark, {
|
@@ -42,7 +36,6 @@ const useMenuItemRadio_unstable = (props, ref) => {
|
|
42
36
|
}),
|
43
37
|
onClick: e => {
|
44
38
|
var _a;
|
45
|
-
|
46
39
|
selectRadio === null || selectRadio === void 0 ? void 0 : selectRadio(e, name, value, checked);
|
47
40
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, e);
|
48
41
|
}
|
@@ -52,6 +45,5 @@ const useMenuItemRadio_unstable = (props, ref) => {
|
|
52
45
|
value
|
53
46
|
};
|
54
47
|
};
|
55
|
-
|
56
48
|
exports.useMenuItemRadio_unstable = useMenuItemRadio_unstable;
|
57
49
|
//# sourceMappingURL=useMenuItemRadio.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAIA;;;AAGO,MAAMA,yBAAyB,GAAG,CACvCC,KAAyB,EACzBC,GAAwC,KAClB;EACtB,MAAM;IAAEC,IAAI;IAAEC;EAAK,CAAE,GAAGH,KAAK;EAE7B,MAAMI,OAAO,GAAGC,6CAA2B,CAACC,OAAO,IAAG;;IACpD,MAAMC,YAAY,GAAG,cAAO,CAACC,aAAa,0CAAGN,IAAI,CAAC,KAAI,EAAE;IACxD,OAAOK,YAAY,CAACE,OAAO,CAACN,KAAK,CAAC,KAAK,CAAC,CAAC;EAC3C,CAAC,CAAC;EAEF,MAAMO,WAAW,GAAGL,6CAA2B,CAACC,OAAO,IAAIA,OAAO,CAACI,WAAW,CAAC;EAE/E,OAAO;IACL,GAAGC,kCAAoB,CACrB;MACE,GAAGX,KAAK;MACRY,IAAI,EAAE,eAAe;MACrB,cAAc,EAAER,OAAO;MACvBS,SAAS,EAAEC,kCAAgB,CAACd,KAAK,CAACa,SAAS,EAAE;QAC3CE,YAAY,EAAE;UAAEC,QAAQ,EAAEC,oBAACC,+BAAiB;QAAG,CAAE;QACjDC,QAAQ,EAAE;OACX,CAAC;MACFC,OAAO,EAAGC,CAAyD,IAAI;;QACrEX,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAGW,CAAC,EAAEnB,IAAI,EAAEC,KAAK,EAAEC,OAAO,CAAC;QACtC,WAAK,CAACgB,OAAO,+CAAbpB,KAAK,EAAWqB,CAAC,CAAC;MACpB;KACD,EACDpB,GAAG,CACJ;IACDG,OAAO;IACPF,IAAI;IACJC;GACD;AACH,CAAC;AAlCYmB,iCAAyB","names":["useMenuItemRadio_unstable","props","ref","name","value","checked","menuListContext_1","context","checkedItems","checkedValues","indexOf","selectRadio","useMenuItem_1","role","checkmark","react_utilities_1","defaultProps","children","React","react_icons_1","required","onClick","e","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItemRadio/useMenuItemRadio.tsx"],"sourcesContent":["import * as React from 'react';\nimport { resolveShorthand } from '@fluentui/react-utilities';\nimport { Checkmark16Filled } from '@fluentui/react-icons';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport { useMenuItem_unstable } from '../MenuItem/useMenuItem';\nimport type { MenuItemRadioProps, MenuItemRadioState } from './MenuItemRadio.types';\nimport type { ARIAButtonElement, ARIAButtonElementIntersection } from '@fluentui/react-aria';\n\n/**\n * Given user props, returns state and render function for a MenuItemRadio.\n */\nexport const useMenuItemRadio_unstable = (\n props: MenuItemRadioProps,\n ref: React.Ref<ARIAButtonElement<'div'>>,\n): MenuItemRadioState => {\n const { name, value } = props;\n\n const checked = useMenuListContext_unstable(context => {\n const checkedItems = context.checkedValues?.[name] || [];\n return checkedItems.indexOf(value) !== -1;\n });\n\n const selectRadio = useMenuListContext_unstable(context => context.selectRadio);\n\n return {\n ...useMenuItem_unstable(\n {\n ...props,\n role: 'menuitemradio',\n 'aria-checked': checked,\n checkmark: resolveShorthand(props.checkmark, {\n defaultProps: { children: <Checkmark16Filled /> },\n required: true,\n }),\n onClick: (e: React.MouseEvent<ARIAButtonElementIntersection<'div'>>) => {\n selectRadio?.(e, name, value, checked);\n props.onClick?.(e);\n },\n },\n ref,\n ),\n checked,\n name,\n value,\n };\n};\n"]}
|
@@ -4,13 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useMenuItemRadioStyles_unstable = exports.menuItemRadioClassNames = void 0;
|
7
|
-
|
8
7
|
const react_1 = /*#__PURE__*/require("@griffel/react");
|
9
|
-
|
10
8
|
const index_1 = /*#__PURE__*/require("../../selectable/index");
|
11
|
-
|
12
9
|
const useMenuItemStyles_1 = /*#__PURE__*/require("../MenuItem/useMenuItemStyles");
|
13
|
-
|
14
10
|
exports.menuItemRadioClassNames = {
|
15
11
|
root: 'fui-MenuItemRadio',
|
16
12
|
icon: 'fui-MenuItemRadio__icon',
|
@@ -18,29 +14,22 @@ exports.menuItemRadioClassNames = {
|
|
18
14
|
content: 'fui-MenuItemRadio__content',
|
19
15
|
secondaryContent: 'fui-MenuItemRadio__secondaryContent'
|
20
16
|
};
|
21
|
-
|
22
17
|
const useMenuItemRadioStyles_unstable = state => {
|
23
18
|
state.root.className = react_1.mergeClasses(exports.menuItemRadioClassNames.root, state.root.className);
|
24
|
-
|
25
19
|
if (state.content) {
|
26
20
|
state.content.className = react_1.mergeClasses(exports.menuItemRadioClassNames.content, state.content.className);
|
27
21
|
}
|
28
|
-
|
29
22
|
if (state.secondaryContent) {
|
30
23
|
state.secondaryContent.className = react_1.mergeClasses(exports.menuItemRadioClassNames.secondaryContent, state.secondaryContent.className);
|
31
24
|
}
|
32
|
-
|
33
25
|
if (state.icon) {
|
34
26
|
state.icon.className = react_1.mergeClasses(exports.menuItemRadioClassNames.icon, state.icon.className);
|
35
27
|
}
|
36
|
-
|
37
28
|
if (state.checkmark) {
|
38
29
|
state.checkmark.className = react_1.mergeClasses(exports.menuItemRadioClassNames.checkmark, state.checkmark.className);
|
39
30
|
}
|
40
|
-
|
41
31
|
useMenuItemStyles_1.useMenuItemStyles_unstable(state);
|
42
32
|
index_1.useCheckmarkStyles_unstable(state);
|
43
33
|
};
|
44
|
-
|
45
34
|
exports.useMenuItemRadioStyles_unstable = useMenuItemRadioStyles_unstable;
|
46
35
|
//# sourceMappingURL=useMenuItemRadioStyles.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AAKaA,+BAAuB,GAA4D;EAC9FC,IAAI,EAAE,mBAAmB;EACzBC,IAAI,EAAE,yBAAyB;EAC/BC,SAAS,EAAE,8BAA8B;EACzCC,OAAO,EAAE,4BAA4B;EACrCC,gBAAgB,EAAE;CACnB;AAEM,MAAMC,+BAA+B,GAAIC,KAAyB,IAAI;EAC3EA,KAAK,CAACN,IAAI,CAACO,SAAS,GAAGC,oBAAY,CAACT,+BAAuB,CAACC,IAAI,EAAEM,KAAK,CAACN,IAAI,CAACO,SAAS,CAAC;EAEvF,IAAID,KAAK,CAACH,OAAO,EAAE;IACjBG,KAAK,CAACH,OAAO,CAACI,SAAS,GAAGC,oBAAY,CAACT,+BAAuB,CAACI,OAAO,EAAEG,KAAK,CAACH,OAAO,CAACI,SAAS,CAAC;;EAGlG,IAAID,KAAK,CAACF,gBAAgB,EAAE;IAC1BE,KAAK,CAACF,gBAAgB,CAACG,SAAS,GAAGC,oBAAY,CAC7CT,+BAAuB,CAACK,gBAAgB,EACxCE,KAAK,CAACF,gBAAgB,CAACG,SAAS,CACjC;;EAGH,IAAID,KAAK,CAACL,IAAI,EAAE;IACdK,KAAK,CAACL,IAAI,CAACM,SAAS,GAAGC,oBAAY,CAACT,+BAAuB,CAACE,IAAI,EAAEK,KAAK,CAACL,IAAI,CAACM,SAAS,CAAC;;EAGzF,IAAID,KAAK,CAACJ,SAAS,EAAE;IACnBI,KAAK,CAACJ,SAAS,CAACK,SAAS,GAAGC,oBAAY,CAACT,+BAAuB,CAACG,SAAS,EAAEI,KAAK,CAACJ,SAAS,CAACK,SAAS,CAAC;;EAGxGE,8CAA0B,CAACH,KAAK,CAAC;EACjCI,mCAA2B,CAACJ,KAAK,CAAC;AACpC,CAAC;AAxBYP,uCAA+B","names":["exports","root","icon","checkmark","content","secondaryContent","useMenuItemRadioStyles_unstable","state","className","react_1","useMenuItemStyles_1","index_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuItemRadio/useMenuItemRadioStyles.ts"],"sourcesContent":["import { mergeClasses } from '@griffel/react';\nimport { useCheckmarkStyles_unstable } from '../../selectable/index';\nimport { useMenuItemStyles_unstable } from '../MenuItem/useMenuItemStyles';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { MenuItemSlots } from '../index';\nimport type { MenuItemRadioState } from './MenuItemRadio.types';\n\nexport const menuItemRadioClassNames: SlotClassNames<Omit<MenuItemSlots, 'submenuIndicator'>> = {\n root: 'fui-MenuItemRadio',\n icon: 'fui-MenuItemRadio__icon',\n checkmark: 'fui-MenuItemRadio__checkmark',\n content: 'fui-MenuItemRadio__content',\n secondaryContent: 'fui-MenuItemRadio__secondaryContent',\n};\n\nexport const useMenuItemRadioStyles_unstable = (state: MenuItemRadioState) => {\n state.root.className = mergeClasses(menuItemRadioClassNames.root, state.root.className);\n\n if (state.content) {\n state.content.className = mergeClasses(menuItemRadioClassNames.content, state.content.className);\n }\n\n if (state.secondaryContent) {\n state.secondaryContent.className = mergeClasses(\n menuItemRadioClassNames.secondaryContent,\n state.secondaryContent.className,\n );\n }\n\n if (state.icon) {\n state.icon.className = mergeClasses(menuItemRadioClassNames.icon, state.icon.className);\n }\n\n if (state.checkmark) {\n state.checkmark.className = mergeClasses(menuItemRadioClassNames.checkmark, state.checkmark.className);\n }\n\n useMenuItemStyles_unstable(state);\n useCheckmarkStyles_unstable(state);\n};\n"]}
|
@@ -4,21 +4,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.MenuList = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const useMenuList_1 = /*#__PURE__*/require("./useMenuList");
|
11
|
-
|
12
9
|
const renderMenuList_1 = /*#__PURE__*/require("./renderMenuList");
|
13
|
-
|
14
10
|
const useMenuListContextValues_1 = /*#__PURE__*/require("./useMenuListContextValues");
|
15
|
-
|
16
11
|
const useMenuListStyles_1 = /*#__PURE__*/require("./useMenuListStyles");
|
17
12
|
/**
|
18
13
|
* Define a styled MenuList, using the `useMenuList_unstable` hook.
|
19
14
|
*/
|
20
|
-
|
21
|
-
|
22
15
|
exports.MenuList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
23
16
|
const state = useMenuList_1.useMenuList_unstable(props, ref);
|
24
17
|
const contextValues = useMenuListContextValues_1.useMenuListContextValues_unstable(state);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AAIA;;;AAGaA,gBAAQ,gBAAuCC,KAAK,CAACC,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAI;EAC1F,MAAMC,KAAK,GAAGC,kCAAoB,CAACH,KAAK,EAAEC,GAAG,CAAC;EAC9C,MAAMG,aAAa,GAAGC,4DAAiC,CAACH,KAAK,CAAC;EAC9DI,8CAA0B,CAACJ,KAAK,CAAC;EAEjC,OAAOK,wCAAuB,CAACL,KAAK,EAAEE,aAAa,CAAC;AACtD,CAAC,CAAC;AAEFP,gBAAQ,CAACW,WAAW,GAAG,UAAU","names":["exports","React","forwardRef","props","ref","state","useMenuList_1","contextValues","useMenuListContextValues_1","useMenuListStyles_1","renderMenuList_1","displayName"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/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';\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 useMenuListStyles_unstable(state);\n\n return renderMenuList_unstable(state, contextValues);\n});\n\nMenuList.displayName = 'MenuList';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":"","names":[],"sourceRoot":"../src/","sources":[],"sourcesContent":[]}
|
@@ -3,18 +3,11 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
|
7
6
|
const tslib_1 = /*#__PURE__*/require("tslib");
|
8
|
-
|
9
7
|
tslib_1.__exportStar(require("./MenuList"), exports);
|
10
|
-
|
11
8
|
tslib_1.__exportStar(require("./MenuList.types"), exports);
|
12
|
-
|
13
9
|
tslib_1.__exportStar(require("./renderMenuList"), exports);
|
14
|
-
|
15
10
|
tslib_1.__exportStar(require("./useMenuList"), exports);
|
16
|
-
|
17
11
|
tslib_1.__exportStar(require("./useMenuListStyles"), exports);
|
18
|
-
|
19
12
|
tslib_1.__exportStar(require("./useMenuListContextValues"), exports);
|
20
13
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["packages/react-components/react-menu/src/components/MenuList/index.ts"],"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAAA;AACAA;AACAA;AACAA;AACAA;AACAA","names":["tslib_1"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuList/index.ts"],"sourcesContent":["export * from './MenuList';\nexport * from './MenuList.types';\nexport * from './renderMenuList';\nexport * from './useMenuList';\nexport * from './useMenuListStyles';\nexport * from './useMenuListContextValues';\n"]}
|
@@ -4,17 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.renderMenuList_unstable = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
-
|
12
9
|
const menuListContext_1 = /*#__PURE__*/require("../../contexts/menuListContext");
|
13
10
|
/**
|
14
11
|
* Function that renders the final JSX of the component
|
15
12
|
*/
|
16
|
-
|
17
|
-
|
18
13
|
const renderMenuList_unstable = (state, contextValues) => {
|
19
14
|
const {
|
20
15
|
slots,
|
@@ -22,9 +17,9 @@ const renderMenuList_unstable = (state, contextValues) => {
|
|
22
17
|
} = react_utilities_1.getSlots(state);
|
23
18
|
return React.createElement(menuListContext_1.MenuListProvider, {
|
24
19
|
value: contextValues.menuList
|
25
|
-
}, React.createElement(slots.root, {
|
20
|
+
}, React.createElement(slots.root, {
|
21
|
+
...slotProps.root
|
26
22
|
}));
|
27
23
|
};
|
28
|
-
|
29
24
|
exports.renderMenuList_unstable = renderMenuList_unstable;
|
30
25
|
//# sourceMappingURL=renderMenuList.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"
|
1
|
+
{"version":3,"mappings":";;;;;;AAAA;AACA;AAEA;AAEA;;;AAGO,MAAMA,uBAAuB,GAAG,CAACC,KAAoB,EAAEC,aAAoC,KAAI;EACpG,MAAM;IAAEC,KAAK;IAAEC;EAAS,CAAE,GAAGC,0BAAQ,CAAgBJ,KAAK,CAAC;EAE3D,OACEK,oBAACC,kCAAgB;IAACC,KAAK,EAAEN,aAAa,CAACO;EAAQ,GAC7CH,oBAACH,KAAK,CAACO,IAAI;IAAA,GAAKN,SAAS,CAACM;EAAI,EAAI,CACjB;AAEvB,CAAC;AARYC,+BAAuB","names":["renderMenuList_unstable","state","contextValues","slots","slotProps","react_utilities_1","React","menuListContext_1","value","menuList","root","exports"],"sourceRoot":"../src/","sources":["packages/react-components/react-menu/src/components/MenuList/renderMenuList.tsx"],"sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { MenuListContextValues, MenuListSlots, MenuListState } from './MenuList.types';\nimport { MenuListProvider } from '../../contexts/menuListContext';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderMenuList_unstable = (state: MenuListState, contextValues: MenuListContextValues) => {\n const { slots, slotProps } = getSlots<MenuListSlots>(state);\n\n return (\n <MenuListProvider value={contextValues.menuList}>\n <slots.root {...slotProps.root} />\n </MenuListProvider>\n );\n};\n"]}
|
@@ -4,23 +4,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
5
5
|
});
|
6
6
|
exports.useMenuList_unstable = void 0;
|
7
|
-
|
8
7
|
const React = /*#__PURE__*/require("react");
|
9
|
-
|
10
8
|
const react_utilities_1 = /*#__PURE__*/require("@fluentui/react-utilities");
|
11
|
-
|
12
9
|
const react_tabster_1 = /*#__PURE__*/require("@fluentui/react-tabster");
|
13
|
-
|
14
10
|
const react_context_selector_1 = /*#__PURE__*/require("@fluentui/react-context-selector");
|
15
|
-
|
16
11
|
const menuContext_1 = /*#__PURE__*/require("../../contexts/menuContext");
|
17
|
-
|
18
12
|
const menuContext_2 = /*#__PURE__*/require("../../contexts/menuContext");
|
19
13
|
/**
|
20
14
|
* Returns the props and state required to render the component
|
21
15
|
*/
|
22
|
-
|
23
|
-
|
24
16
|
const useMenuList_unstable = (props, ref) => {
|
25
17
|
const focusAttributes = react_tabster_1.useArrowNavigationGroup({
|
26
18
|
circular: true,
|
@@ -33,54 +25,43 @@ const useMenuList_unstable = (props, ref) => {
|
|
33
25
|
} = react_tabster_1.useFocusFinders();
|
34
26
|
const menuContext = useMenuContextSelectors();
|
35
27
|
const hasMenuContext = react_context_selector_1.useHasParentContext(menuContext_2.MenuContext);
|
36
|
-
|
37
28
|
if (usingPropsAndMenuContext(props, menuContext, hasMenuContext)) {
|
38
29
|
// TODO throw warnings in development safely
|
39
30
|
// eslint-disable-next-line no-console
|
40
31
|
console.warn('You are using both MenuList and Menu props, we recommend you to use Menu props when available');
|
41
32
|
}
|
42
|
-
|
43
33
|
const innerRef = React.useRef(null);
|
44
34
|
const setFocusByFirstCharacter = React.useCallback((e, itemEl) => {
|
45
35
|
// TODO use some kind of children registration to reduce dependency on DOM roles
|
46
36
|
const acceptedRoles = ['menuitem', 'menuitemcheckbox', 'menuitemradio'];
|
47
|
-
|
48
37
|
if (!innerRef.current) {
|
49
38
|
return;
|
50
39
|
}
|
51
|
-
|
52
40
|
const menuItems = findAllFocusable(innerRef.current, el => el.hasAttribute('role') && acceptedRoles.indexOf(el.getAttribute('role')) !== -1);
|
53
41
|
let startIndex = menuItems.indexOf(itemEl) + 1;
|
54
|
-
|
55
42
|
if (startIndex === menuItems.length) {
|
56
43
|
startIndex = 0;
|
57
44
|
}
|
58
|
-
|
59
45
|
const firstChars = menuItems.map(menuItem => {
|
60
46
|
var _a;
|
61
|
-
|
62
47
|
return (_a = menuItem.textContent) === null || _a === void 0 ? void 0 : _a.charAt(0).toLowerCase();
|
63
48
|
});
|
64
49
|
const char = e.key.toLowerCase();
|
65
|
-
|
66
50
|
const getIndexFirstChars = (start, firstChar) => {
|
67
51
|
for (let i = start; i < firstChars.length; i++) {
|
68
52
|
if (char === firstChars[i]) {
|
69
53
|
return i;
|
70
54
|
}
|
71
55
|
}
|
72
|
-
|
73
56
|
return -1;
|
74
|
-
};
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
57
|
+
};
|
58
|
+
// Check remaining slots in the menu
|
59
|
+
let index = getIndexFirstChars(startIndex, char);
|
60
|
+
// If not found in remaining slots, check from beginning
|
79
61
|
if (index === -1) {
|
80
62
|
index = getIndexFirstChars(0, char);
|
81
|
-
}
|
82
|
-
|
83
|
-
|
63
|
+
}
|
64
|
+
// If match was found...
|
84
65
|
if (index > -1) {
|
85
66
|
menuItems[index].focus();
|
86
67
|
}
|
@@ -94,24 +75,24 @@ const useMenuList_unstable = (props, ref) => {
|
|
94
75
|
const toggleCheckbox = react_utilities_1.useEventCallback((e, name, value, checked) => {
|
95
76
|
const checkedItems = (checkedValues === null || checkedValues === void 0 ? void 0 : checkedValues[name]) || [];
|
96
77
|
const newCheckedItems = [...checkedItems];
|
97
|
-
|
98
78
|
if (checked) {
|
99
79
|
newCheckedItems.splice(newCheckedItems.indexOf(value), 1);
|
100
80
|
} else {
|
101
81
|
newCheckedItems.push(value);
|
102
82
|
}
|
103
|
-
|
104
83
|
handleCheckedValueChange === null || handleCheckedValueChange === void 0 ? void 0 : handleCheckedValueChange(e, {
|
105
84
|
name,
|
106
85
|
checkedItems: newCheckedItems
|
107
86
|
});
|
108
|
-
setCheckedValues(s => ({
|
87
|
+
setCheckedValues(s => ({
|
88
|
+
...s,
|
109
89
|
[name]: newCheckedItems
|
110
90
|
}));
|
111
91
|
});
|
112
92
|
const selectRadio = react_utilities_1.useEventCallback((e, name, value) => {
|
113
93
|
const newCheckedItems = [value];
|
114
|
-
setCheckedValues(s => ({
|
94
|
+
setCheckedValues(s => ({
|
95
|
+
...s,
|
115
96
|
[name]: newCheckedItems
|
116
97
|
}));
|
117
98
|
handleCheckedValueChange === null || handleCheckedValueChange === void 0 ? void 0 : handleCheckedValueChange(e, {
|
@@ -138,12 +119,10 @@ const useMenuList_unstable = (props, ref) => {
|
|
138
119
|
toggleCheckbox
|
139
120
|
};
|
140
121
|
};
|
141
|
-
|
142
122
|
exports.useMenuList_unstable = useMenuList_unstable;
|
143
123
|
/**
|
144
124
|
* Adds some sugar to fetching multiple context selector values
|
145
125
|
*/
|
146
|
-
|
147
126
|
const useMenuContextSelectors = () => {
|
148
127
|
const checkedValues = menuContext_1.useMenuContext_unstable(context => context.checkedValues);
|
149
128
|
const onCheckedValueChange = menuContext_1.useMenuContext_unstable(context => context.onCheckedValueChange);
|
@@ -161,17 +140,13 @@ const useMenuContextSelectors = () => {
|
|
161
140
|
/**
|
162
141
|
* Helper function to detect if props and MenuContext values are both used
|
163
142
|
*/
|
164
|
-
|
165
|
-
|
166
143
|
const usingPropsAndMenuContext = (props, contextValue, hasMenuContext) => {
|
167
144
|
let isUsingPropsAndContext = false;
|
168
|
-
|
169
145
|
for (const val in contextValue) {
|
170
146
|
if (props[val]) {
|
171
147
|
isUsingPropsAndContext = true;
|
172
148
|
}
|
173
149
|
}
|
174
|
-
|
175
150
|
return hasMenuContext && isUsingPropsAndContext;
|
176
151
|
};
|
177
152
|
//# sourceMappingURL=useMenuList.js.map
|