@fluentui/react-menu 9.4.1 → 9.5.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +119 -1
- package/CHANGELOG.md +32 -2
- package/dist/index.d.ts +102 -14
- package/lib/components/Menu/Menu.types.js.map +1 -1
- package/lib/components/Menu/useMenu.js +23 -26
- package/lib/components/Menu/useMenu.js.map +1 -1
- package/lib/components/Menu/useMenuContextValues.js +0 -2
- package/lib/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib/components/MenuDivider/useMenuDividerStyles.js +2 -2
- package/lib/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib/components/MenuGroup/useMenuGroup.js +1 -1
- package/lib/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib/components/MenuItem/useMenuItem.js +3 -1
- package/lib/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib/components/MenuList/MenuList.types.js.map +1 -1
- package/lib/components/MenuList/useMenuList.js +20 -29
- package/lib/components/MenuList/useMenuList.js.map +1 -1
- package/lib/components/MenuList/useMenuListContextValues.js +0 -2
- package/lib/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib/components/MenuPopover/useMenuPopover.js +20 -14
- package/lib/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib/components/MenuTrigger/useMenuTrigger.js +42 -28
- package/lib/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib/contexts/menuContext.js +0 -1
- package/lib/contexts/menuContext.js.map +1 -1
- package/lib/contexts/menuListContext.js +0 -1
- package/lib/contexts/menuListContext.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-amd/Menu.js +6 -0
- package/lib-amd/Menu.js.map +1 -0
- package/lib-amd/MenuDivider.js +6 -0
- package/lib-amd/MenuDivider.js.map +1 -0
- package/lib-amd/MenuGroup.js +6 -0
- package/lib-amd/MenuGroup.js.map +1 -0
- package/lib-amd/MenuGroupHeader.js +6 -0
- package/lib-amd/MenuGroupHeader.js.map +1 -0
- package/lib-amd/MenuItem.js +6 -0
- package/lib-amd/MenuItem.js.map +1 -0
- package/lib-amd/MenuItemCheckbox.js +6 -0
- package/lib-amd/MenuItemCheckbox.js.map +1 -0
- package/lib-amd/MenuItemRadio.js +6 -0
- package/lib-amd/MenuItemRadio.js.map +1 -0
- package/lib-amd/MenuList.js +6 -0
- package/lib-amd/MenuList.js.map +1 -0
- package/lib-amd/MenuPopover.js +6 -0
- package/lib-amd/MenuPopover.js.map +1 -0
- package/lib-amd/MenuSplitGroup.js +6 -0
- package/lib-amd/MenuSplitGroup.js.map +1 -0
- package/lib-amd/MenuTrigger.js +6 -0
- package/lib-amd/MenuTrigger.js.map +1 -0
- package/lib-amd/components/Menu/Menu.js +16 -0
- package/lib-amd/components/Menu/Menu.js.map +1 -0
- package/lib-amd/components/Menu/Menu.types.js +5 -0
- package/lib-amd/components/Menu/Menu.types.js.map +1 -0
- package/lib-amd/components/Menu/index.js +10 -0
- package/lib-amd/components/Menu/index.js.map +1 -0
- package/lib-amd/components/Menu/renderMenu.js +15 -0
- package/lib-amd/components/Menu/renderMenu.js.map +1 -0
- package/lib-amd/components/Menu/useMenu.js +230 -0
- package/lib-amd/components/Menu/useMenu.js.map +1 -0
- package/lib-amd/components/Menu/useMenuContextValues.js +28 -0
- package/lib-amd/components/Menu/useMenuContextValues.js.map +1 -0
- package/lib-amd/components/MenuDivider/MenuDivider.js +15 -0
- package/lib-amd/components/MenuDivider/MenuDivider.js.map +1 -0
- package/lib-amd/components/MenuDivider/MenuDivider.types.js +5 -0
- package/lib-amd/components/MenuDivider/MenuDivider.types.js.map +1 -0
- package/lib-amd/components/MenuDivider/index.js +10 -0
- package/lib-amd/components/MenuDivider/index.js.map +1 -0
- package/lib-amd/components/MenuDivider/renderMenuDivider.js +15 -0
- package/lib-amd/components/MenuDivider/renderMenuDivider.js.map +1 -0
- package/lib-amd/components/MenuDivider/useMenuDivider.js +18 -0
- package/lib-amd/components/MenuDivider/useMenuDivider.js.map +1 -0
- package/lib-amd/components/MenuDivider/useMenuDividerStyles.js +18 -0
- package/lib-amd/components/MenuDivider/useMenuDividerStyles.js.map +1 -0
- package/lib-amd/components/MenuGroup/MenuGroup.js +16 -0
- package/lib-amd/components/MenuGroup/MenuGroup.js.map +1 -0
- package/lib-amd/components/MenuGroup/MenuGroup.types.js +5 -0
- package/lib-amd/components/MenuGroup/MenuGroup.types.js.map +1 -0
- package/lib-amd/components/MenuGroup/index.js +11 -0
- package/lib-amd/components/MenuGroup/index.js.map +1 -0
- package/lib-amd/components/MenuGroup/renderMenuGroup.js +16 -0
- package/lib-amd/components/MenuGroup/renderMenuGroup.js.map +1 -0
- package/lib-amd/components/MenuGroup/useMenuGroup.js +20 -0
- package/lib-amd/components/MenuGroup/useMenuGroup.js.map +1 -0
- package/lib-amd/components/MenuGroup/useMenuGroupContextValues.js +12 -0
- package/lib-amd/components/MenuGroup/useMenuGroupContextValues.js.map +1 -0
- package/lib-amd/components/MenuGroup/useMenuGroupStyles.js +14 -0
- package/lib-amd/components/MenuGroup/useMenuGroupStyles.js.map +1 -0
- package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.js +15 -0
- package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.js.map +1 -0
- package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.types.js +5 -0
- package/lib-amd/components/MenuGroupHeader/MenuGroupHeader.types.js.map +1 -0
- package/lib-amd/components/MenuGroupHeader/index.js +10 -0
- package/lib-amd/components/MenuGroupHeader/index.js.map +1 -0
- package/lib-amd/components/MenuGroupHeader/renderMenuGroupHeader.js +15 -0
- package/lib-amd/components/MenuGroupHeader/renderMenuGroupHeader.js.map +1 -0
- package/lib-amd/components/MenuGroupHeader/useMenuGroupHeader.js +19 -0
- package/lib-amd/components/MenuGroupHeader/useMenuGroupHeader.js.map +1 -0
- package/lib-amd/components/MenuGroupHeader/useMenuGroupHeaderStyles.js +27 -0
- package/lib-amd/components/MenuGroupHeader/useMenuGroupHeaderStyles.js.map +1 -0
- package/lib-amd/components/MenuItem/MenuItem.js +15 -0
- package/lib-amd/components/MenuItem/MenuItem.js.map +1 -0
- package/lib-amd/components/MenuItem/MenuItem.types.js +5 -0
- package/lib-amd/components/MenuItem/MenuItem.types.js.map +1 -0
- package/lib-amd/components/MenuItem/index.js +10 -0
- package/lib-amd/components/MenuItem/index.js.map +1 -0
- package/lib-amd/components/MenuItem/renderMenuItem.js +19 -0
- package/lib-amd/components/MenuItem/renderMenuItem.js.map +1 -0
- package/lib-amd/components/MenuItem/useCharacterSearch.js +22 -0
- package/lib-amd/components/MenuItem/useCharacterSearch.js.map +1 -0
- package/lib-amd/components/MenuItem/useMenuItem.js +80 -0
- package/lib-amd/components/MenuItem/useMenuItem.js.map +1 -0
- package/lib-amd/components/MenuItem/useMenuItemStyles.js +100 -0
- package/lib-amd/components/MenuItem/useMenuItemStyles.js.map +1 -0
- package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.js +15 -0
- package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.js.map +1 -0
- package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.types.js +5 -0
- package/lib-amd/components/MenuItemCheckbox/MenuItemCheckbox.types.js.map +1 -0
- package/lib-amd/components/MenuItemCheckbox/index.js +10 -0
- package/lib-amd/components/MenuItemCheckbox/index.js.map +1 -0
- package/lib-amd/components/MenuItemCheckbox/renderMenuItemCheckbox.js +16 -0
- package/lib-amd/components/MenuItemCheckbox/renderMenuItemCheckbox.js.map +1 -0
- package/lib-amd/components/MenuItemCheckbox/useMenuItemCheckbox.js +26 -0
- package/lib-amd/components/MenuItemCheckbox/useMenuItemCheckbox.js.map +1 -0
- package/lib-amd/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js +31 -0
- package/lib-amd/components/MenuItemCheckbox/useMenuItemCheckboxStyles.js.map +1 -0
- package/lib-amd/components/MenuItemRadio/MenuItemRadio.js +15 -0
- package/lib-amd/components/MenuItemRadio/MenuItemRadio.js.map +1 -0
- package/lib-amd/components/MenuItemRadio/MenuItemRadio.types.js +5 -0
- package/lib-amd/components/MenuItemRadio/MenuItemRadio.types.js.map +1 -0
- package/lib-amd/components/MenuItemRadio/index.js +10 -0
- package/lib-amd/components/MenuItemRadio/index.js.map +1 -0
- package/lib-amd/components/MenuItemRadio/renderMenuItemRadio.js +19 -0
- package/lib-amd/components/MenuItemRadio/renderMenuItemRadio.js.map +1 -0
- package/lib-amd/components/MenuItemRadio/useMenuItemRadio.js +27 -0
- package/lib-amd/components/MenuItemRadio/useMenuItemRadio.js.map +1 -0
- package/lib-amd/components/MenuItemRadio/useMenuItemRadioStyles.js +31 -0
- package/lib-amd/components/MenuItemRadio/useMenuItemRadioStyles.js.map +1 -0
- package/lib-amd/components/MenuList/MenuList.js +16 -0
- package/lib-amd/components/MenuList/MenuList.js.map +1 -0
- package/lib-amd/components/MenuList/MenuList.types.js +5 -0
- package/lib-amd/components/MenuList/MenuList.types.js.map +1 -0
- package/lib-amd/components/MenuList/index.js +11 -0
- package/lib-amd/components/MenuList/index.js.map +1 -0
- package/lib-amd/components/MenuList/renderMenuList.js +15 -0
- package/lib-amd/components/MenuList/renderMenuList.js.map +1 -0
- package/lib-amd/components/MenuList/useMenuList.js +124 -0
- package/lib-amd/components/MenuList/useMenuList.js.map +1 -0
- package/lib-amd/components/MenuList/useMenuListContextValues.js +20 -0
- package/lib-amd/components/MenuList/useMenuListContextValues.js.map +1 -0
- package/lib-amd/components/MenuList/useMenuListStyles.js +21 -0
- package/lib-amd/components/MenuList/useMenuListStyles.js.map +1 -0
- package/lib-amd/components/MenuPopover/MenuPopover.js +15 -0
- package/lib-amd/components/MenuPopover/MenuPopover.js.map +1 -0
- package/lib-amd/components/MenuPopover/MenuPopover.types.js +5 -0
- package/lib-amd/components/MenuPopover/MenuPopover.types.js.map +1 -0
- package/lib-amd/components/MenuPopover/index.js +10 -0
- package/lib-amd/components/MenuPopover/index.js.map +1 -0
- package/lib-amd/components/MenuPopover/renderMenuPopover.js +18 -0
- package/lib-amd/components/MenuPopover/renderMenuPopover.js.map +1 -0
- package/lib-amd/components/MenuPopover/useMenuPopover.js +82 -0
- package/lib-amd/components/MenuPopover/useMenuPopover.js.map +1 -0
- package/lib-amd/components/MenuPopover/useMenuPopoverStyles.js +21 -0
- package/lib-amd/components/MenuPopover/useMenuPopoverStyles.js.map +1 -0
- package/lib-amd/components/MenuSplitGroup/MenuSplitGroup.js +15 -0
- package/lib-amd/components/MenuSplitGroup/MenuSplitGroup.js.map +1 -0
- package/lib-amd/components/MenuSplitGroup/MenuSplitGroup.types.js +5 -0
- package/lib-amd/components/MenuSplitGroup/MenuSplitGroup.types.js.map +1 -0
- package/lib-amd/components/MenuSplitGroup/index.js +10 -0
- package/lib-amd/components/MenuSplitGroup/index.js.map +1 -0
- package/lib-amd/components/MenuSplitGroup/renderMenuSplitGroup.js +14 -0
- package/lib-amd/components/MenuSplitGroup/renderMenuSplitGroup.js.map +1 -0
- package/lib-amd/components/MenuSplitGroup/useMenuSplitGroup.js +47 -0
- package/lib-amd/components/MenuSplitGroup/useMenuSplitGroup.js.map +1 -0
- package/lib-amd/components/MenuSplitGroup/useMenuSplitGroupStyles.js +43 -0
- package/lib-amd/components/MenuSplitGroup/useMenuSplitGroupStyles.js.map +1 -0
- package/lib-amd/components/MenuTrigger/MenuTrigger.js +18 -0
- package/lib-amd/components/MenuTrigger/MenuTrigger.js.map +1 -0
- package/lib-amd/components/MenuTrigger/MenuTrigger.types.js +5 -0
- package/lib-amd/components/MenuTrigger/MenuTrigger.types.js.map +1 -0
- package/lib-amd/components/MenuTrigger/index.js +9 -0
- package/lib-amd/components/MenuTrigger/index.js.map +1 -0
- package/lib-amd/components/MenuTrigger/renderMenuTrigger.js +15 -0
- package/lib-amd/components/MenuTrigger/renderMenuTrigger.js.map +1 -0
- package/lib-amd/components/MenuTrigger/useMenuTrigger.js +112 -0
- package/lib-amd/components/MenuTrigger/useMenuTrigger.js.map +1 -0
- package/lib-amd/components/index.js +7 -0
- package/lib-amd/components/index.js.map +1 -0
- package/lib-amd/contexts/menuContext.js +31 -0
- package/lib-amd/contexts/menuContext.js.map +1 -0
- package/lib-amd/contexts/menuGroupContext.js +13 -0
- package/lib-amd/contexts/menuGroupContext.js.map +1 -0
- package/lib-amd/contexts/menuListContext.js +23 -0
- package/lib-amd/contexts/menuListContext.js.map +1 -0
- package/lib-amd/contexts/menuTriggerContext.js +14 -0
- package/lib-amd/contexts/menuTriggerContext.js.map +1 -0
- package/lib-amd/index.js +69 -0
- package/lib-amd/index.js.map +1 -0
- package/lib-amd/selectable/index.js +7 -0
- package/lib-amd/selectable/index.js.map +1 -0
- package/lib-amd/selectable/types.js +5 -0
- package/lib-amd/selectable/types.js.map +1 -0
- package/lib-amd/selectable/useCheckmarkStyles.js +28 -0
- package/lib-amd/selectable/useCheckmarkStyles.js.map +1 -0
- package/lib-amd/utils/index.js +6 -0
- package/lib-amd/utils/index.js.map +1 -0
- package/lib-amd/utils/useIsSubmenu.js +20 -0
- package/lib-amd/utils/useIsSubmenu.js.map +1 -0
- package/lib-amd/utils/useOnMenuEnter.js +59 -0
- package/lib-amd/utils/useOnMenuEnter.js.map +1 -0
- package/lib-commonjs/components/Menu/useMenu.js +23 -26
- package/lib-commonjs/components/Menu/useMenu.js.map +1 -1
- package/lib-commonjs/components/Menu/useMenuContextValues.js +0 -2
- package/lib-commonjs/components/Menu/useMenuContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js +2 -2
- package/lib-commonjs/components/MenuDivider/useMenuDividerStyles.js.map +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js +1 -1
- package/lib-commonjs/components/MenuGroup/useMenuGroup.js.map +1 -1
- package/lib-commonjs/components/MenuItem/useMenuItem.js +3 -1
- package/lib-commonjs/components/MenuItem/useMenuItem.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuList.js +20 -29
- package/lib-commonjs/components/MenuList/useMenuList.js.map +1 -1
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js +0 -2
- package/lib-commonjs/components/MenuList/useMenuListContextValues.js.map +1 -1
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js +20 -14
- package/lib-commonjs/components/MenuPopover/useMenuPopover.js.map +1 -1
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js +42 -28
- package/lib-commonjs/components/MenuTrigger/useMenuTrigger.js.map +1 -1
- package/lib-commonjs/contexts/menuContext.js +0 -1
- package/lib-commonjs/contexts/menuContext.js.map +1 -1
- package/lib-commonjs/contexts/menuListContext.js +0 -1
- package/lib-commonjs/contexts/menuListContext.js.map +1 -1
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +9 -9
@@ -0,0 +1,10 @@
|
|
1
|
+
define(["require", "exports", "tslib", "./MenuDivider.types", "./MenuDivider", "./renderMenuDivider", "./useMenuDivider", "./useMenuDividerStyles"], function (require, exports, tslib_1, MenuDivider_types_1, MenuDivider_1, renderMenuDivider_1, useMenuDivider_1, useMenuDividerStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
tslib_1.__exportStar(MenuDivider_types_1, exports);
|
5
|
+
tslib_1.__exportStar(MenuDivider_1, exports);
|
6
|
+
tslib_1.__exportStar(renderMenuDivider_1, exports);
|
7
|
+
tslib_1.__exportStar(useMenuDivider_1, exports);
|
8
|
+
tslib_1.__exportStar(useMenuDividerStyles_1, exports);
|
9
|
+
});
|
10
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuDivider/index.ts"],"names":[],"mappings":";;;IAAA,mDAAoC;IACpC,6CAA8B;IAC9B,mDAAoC;IACpC,gDAAiC;IACjC,sDAAuC","sourcesContent":["export * from './MenuDivider.types';\nexport * from './MenuDivider';\nexport * from './renderMenuDivider';\nexport * from './useMenuDivider';\nexport * from './useMenuDividerStyles';\n"]}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.renderMenuDivider_unstable = void 0;
|
5
|
+
/**
|
6
|
+
* Redefine the render function to add slots. Reuse the menudivider structure but add
|
7
|
+
* slots to children.
|
8
|
+
*/
|
9
|
+
var renderMenuDivider_unstable = function (state) {
|
10
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
11
|
+
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root));
|
12
|
+
};
|
13
|
+
exports.renderMenuDivider_unstable = renderMenuDivider_unstable;
|
14
|
+
});
|
15
|
+
//# sourceMappingURL=renderMenuDivider.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"renderMenuDivider.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuDivider/renderMenuDivider.tsx"],"names":[],"mappings":";;;;IAIA;;;OAGG;IACI,IAAM,0BAA0B,GAAG,UAAC,KAAuB;QAC1D,IAAA,KAAuB,0BAAQ,CAAmB,KAAK,CAAC,EAAtD,KAAK,WAAA,EAAE,SAAS,eAAsC,CAAC;QAE/D,OAAO,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CAAC;IAC5C,CAAC,CAAC;IAJW,QAAA,0BAA0B,8BAIrC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { MenuDividerSlots, MenuDividerState } from './MenuDivider.types';\n\n/**\n * Redefine the render function to add slots. Reuse the menudivider structure but add\n * slots to children.\n */\nexport const renderMenuDivider_unstable = (state: MenuDividerState) => {\n const { slots, slotProps } = getSlots<MenuDividerSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"]}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useMenuDivider_unstable = void 0;
|
5
|
+
/**
|
6
|
+
* Given user props, returns state and render function for a MenuDivider.
|
7
|
+
*/
|
8
|
+
var useMenuDivider_unstable = function (props, ref) {
|
9
|
+
return {
|
10
|
+
components: {
|
11
|
+
root: 'div',
|
12
|
+
},
|
13
|
+
root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign(tslib_1.__assign({ role: 'presentation', 'aria-hidden': true }, props), { ref: ref })),
|
14
|
+
};
|
15
|
+
};
|
16
|
+
exports.useMenuDivider_unstable = useMenuDivider_unstable;
|
17
|
+
});
|
18
|
+
//# sourceMappingURL=useMenuDivider.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useMenuDivider.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuDivider/useMenuDivider.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,uBAAuB,GAAG,UAAC,KAAuB,EAAE,GAA2B;QAC1F,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;aACZ;YACD,IAAI,EAAE,uCAAqB,CAAC,KAAK,sCAC/B,IAAI,EAAE,cAAc,EACpB,aAAa,EAAE,IAAI,IAChB,KAAK,KACR,GAAG,KAAA,IACH;SACH,CAAC;IACJ,CAAC,CAAC;IAZW,QAAA,uBAAuB,2BAYlC","sourcesContent":["import { getNativeElementProps } from '@fluentui/react-utilities';\nimport * as React from 'react';\nimport type { MenuDividerProps, MenuDividerState } from './MenuDivider.types';\n\n/**\n * Given user props, returns state and render function for a MenuDivider.\n */\nexport const useMenuDivider_unstable = (props: MenuDividerProps, ref: React.Ref<HTMLElement>): MenuDividerState => {\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n role: 'presentation',\n 'aria-hidden': true,\n ...props,\n ref,\n }),\n };\n};\n"]}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
define(["require", "exports", "tslib", "@griffel/react", "@fluentui/react-theme"], function (require, exports, tslib_1, react_1, react_theme_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useMenuDividerStyles_unstable = exports.menuDividerClassNames = void 0;
|
5
|
+
exports.menuDividerClassNames = {
|
6
|
+
root: 'fui-MenuDivider',
|
7
|
+
};
|
8
|
+
var useStyles = react_1.makeStyles({
|
9
|
+
root: tslib_1.__assign(tslib_1.__assign(tslib_1.__assign({}, react_1.shorthands.margin('4px', '-5px', '4px', '-5px')), { width: 'auto' }), react_1.shorthands.borderBottom(react_theme_1.tokens.strokeWidthThin, 'solid', react_theme_1.tokens.colorNeutralStroke2)),
|
10
|
+
});
|
11
|
+
var useMenuDividerStyles_unstable = function (state) {
|
12
|
+
var styles = useStyles();
|
13
|
+
state.root.className = react_1.mergeClasses(exports.menuDividerClassNames.root, styles.root, state.root.className);
|
14
|
+
return state;
|
15
|
+
};
|
16
|
+
exports.useMenuDividerStyles_unstable = useMenuDividerStyles_unstable;
|
17
|
+
});
|
18
|
+
//# sourceMappingURL=useMenuDividerStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useMenuDividerStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuDivider/useMenuDividerStyles.ts"],"names":[],"mappings":";;;;IAKa,QAAA,qBAAqB,GAAqC;QACrE,IAAI,EAAE,iBAAiB;KACxB,CAAC;IAEF,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,yDACC,kBAAU,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,KAClD,KAAK,EAAE,MAAM,KACV,kBAAU,CAAC,YAAY,CAAC,oBAAM,CAAC,eAAe,EAAE,OAAO,EAAE,oBAAM,CAAC,mBAAmB,CAAC,CACxF;KACF,CAAC,CAAC;IAEI,IAAM,6BAA6B,GAAG,UAAC,KAAuB;QACnE,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CAAC,6BAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEnG,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IALW,QAAA,6BAA6B,iCAKxC","sourcesContent":["import { shorthands, mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { MenuDividerSlots, MenuDividerState } from './MenuDivider.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const menuDividerClassNames: SlotClassNames<MenuDividerSlots> = {\n root: 'fui-MenuDivider',\n};\n\nconst useStyles = makeStyles({\n root: {\n ...shorthands.margin('4px', '-5px', '4px', '-5px'),\n width: 'auto',\n ...shorthands.borderBottom(tokens.strokeWidthThin, 'solid', tokens.colorNeutralStroke2),\n },\n});\n\nexport const useMenuDividerStyles_unstable = (state: MenuDividerState) => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuDividerClassNames.root, styles.root, state.root.className);\n\n return state;\n};\n"]}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
define(["require", "exports", "react", "./useMenuGroup", "./renderMenuGroup", "./useMenuGroupContextValues", "./useMenuGroupStyles"], function (require, exports, React, useMenuGroup_1, renderMenuGroup_1, useMenuGroupContextValues_1, useMenuGroupStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.MenuGroup = void 0;
|
5
|
+
/**
|
6
|
+
* Define a styled MenuGroup, using the `useMenuGroup_unstable` hook.
|
7
|
+
*/
|
8
|
+
exports.MenuGroup = React.forwardRef(function (props, ref) {
|
9
|
+
var state = useMenuGroup_1.useMenuGroup_unstable(props, ref);
|
10
|
+
var contextValues = useMenuGroupContextValues_1.useMenuGroupContextValues_unstable(state);
|
11
|
+
useMenuGroupStyles_1.useMenuGroupStyles_unstable(state);
|
12
|
+
return renderMenuGroup_1.renderMenuGroup_unstable(state, contextValues);
|
13
|
+
});
|
14
|
+
exports.MenuGroup.displayName = 'MenuGroup';
|
15
|
+
});
|
16
|
+
//# sourceMappingURL=MenuGroup.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuGroup.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroup/MenuGroup.tsx"],"names":[],"mappings":";;;;IAQA;;OAEG;IACU,QAAA,SAAS,GAAwC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QACxF,IAAM,KAAK,GAAG,oCAAqB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAChD,IAAM,aAAa,GAAG,8DAAkC,CAAC,KAAK,CAAC,CAAC;QAEhE,gDAA2B,CAAC,KAAK,CAAC,CAAC;QAEnC,OAAO,0CAAwB,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACxD,CAAC,CAAC,CAAC;IAEH,iBAAS,CAAC,WAAW,GAAG,WAAW,CAAC","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';\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 return renderMenuGroup_unstable(state, contextValues);\n});\n\nMenuGroup.displayName = 'MenuGroup';\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuGroup.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroup/MenuGroup.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\nimport type { MenuGroupContextValue } from '../../contexts/menuGroupContext';\n\nexport type MenuGroupSlots = {\n root: Slot<'div'>;\n};\n\nexport type MenuGroupProps = ComponentProps<MenuGroupSlots>;\n\nexport type MenuGroupState = ComponentState<MenuGroupSlots> & {\n /**\n * id applied to the DOM element of `MenuGroupHeader`\n */\n headerId: string;\n};\n\nexport type MenuGroupContextValues = {\n menuGroup: MenuGroupContextValue;\n};\n"]}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
define(["require", "exports", "tslib", "./MenuGroup.types", "./MenuGroup", "./renderMenuGroup", "./useMenuGroup", "./useMenuGroupContextValues", "./useMenuGroupStyles"], function (require, exports, tslib_1, MenuGroup_types_1, MenuGroup_1, renderMenuGroup_1, useMenuGroup_1, useMenuGroupContextValues_1, useMenuGroupStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
tslib_1.__exportStar(MenuGroup_types_1, exports);
|
5
|
+
tslib_1.__exportStar(MenuGroup_1, exports);
|
6
|
+
tslib_1.__exportStar(renderMenuGroup_1, exports);
|
7
|
+
tslib_1.__exportStar(useMenuGroup_1, exports);
|
8
|
+
tslib_1.__exportStar(useMenuGroupContextValues_1, exports);
|
9
|
+
tslib_1.__exportStar(useMenuGroupStyles_1, exports);
|
10
|
+
});
|
11
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroup/index.ts"],"names":[],"mappings":";;;IAAA,iDAAkC;IAClC,2CAA4B;IAC5B,iDAAkC;IAClC,8CAA+B;IAC/B,2DAA4C;IAC5C,oDAAqC","sourcesContent":["export * from './MenuGroup.types';\nexport * from './MenuGroup';\nexport * from './renderMenuGroup';\nexport * from './useMenuGroup';\nexport * from './useMenuGroupContextValues';\nexport * from './useMenuGroupStyles';\n"]}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "../../contexts/menuGroupContext"], function (require, exports, tslib_1, React, react_utilities_1, menuGroupContext_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.renderMenuGroup_unstable = void 0;
|
5
|
+
/**
|
6
|
+
* Redefine the render function to add slots. Reuse the menugroup structure but add
|
7
|
+
* slots to children.
|
8
|
+
*/
|
9
|
+
var renderMenuGroup_unstable = function (state, contextValues) {
|
10
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
11
|
+
return (React.createElement(menuGroupContext_1.MenuGroupContextProvider, { value: contextValues.menuGroup },
|
12
|
+
React.createElement(slots.root, tslib_1.__assign({}, slotProps.root))));
|
13
|
+
};
|
14
|
+
exports.renderMenuGroup_unstable = renderMenuGroup_unstable;
|
15
|
+
});
|
16
|
+
//# sourceMappingURL=renderMenuGroup.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"renderMenuGroup.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroup/renderMenuGroup.tsx"],"names":[],"mappings":";;;;IAKA;;;OAGG;IACI,IAAM,wBAAwB,GAAG,UAAC,KAAqB,EAAE,aAAqC;QAC7F,IAAA,KAAuB,0BAAQ,CAAiB,KAAK,CAAC,EAApD,KAAK,WAAA,EAAE,SAAS,eAAoC,CAAC;QAE7D,OAAO,CACL,oBAAC,2CAAwB,IAAC,KAAK,EAAE,aAAa,CAAC,SAAS;YACtD,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CACT,CAC5B,CAAC;IACJ,CAAC,CAAC;IARW,QAAA,wBAAwB,4BAQnC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { MenuGroupContextValues, MenuGroupSlots, MenuGroupState } from './MenuGroup.types';\nimport { MenuGroupContextProvider } from '../../contexts/menuGroupContext';\n\n/**\n * Redefine the render function to add slots. Reuse the menugroup structure but add\n * slots to children.\n */\nexport const renderMenuGroup_unstable = (state: MenuGroupState, contextValues: MenuGroupContextValues) => {\n const { slots, slotProps } = getSlots<MenuGroupSlots>(state);\n\n return (\n <MenuGroupContextProvider value={contextValues.menuGroup}>\n <slots.root {...slotProps.root} />\n </MenuGroupContextProvider>\n );\n};\n"]}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
define(["require", "exports", "tslib", "@fluentui/react-utilities"], function (require, exports, tslib_1, react_utilities_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useMenuGroup_unstable = void 0;
|
5
|
+
/**
|
6
|
+
* Given user props, returns state and render function for a MenuGroup.
|
7
|
+
*/
|
8
|
+
function useMenuGroup_unstable(props, ref) {
|
9
|
+
var headerId = react_utilities_1.useId('menu-group');
|
10
|
+
return {
|
11
|
+
components: {
|
12
|
+
root: 'div',
|
13
|
+
},
|
14
|
+
root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({ ref: ref, 'aria-labelledby': headerId, role: 'group' }, props)),
|
15
|
+
headerId: headerId,
|
16
|
+
};
|
17
|
+
}
|
18
|
+
exports.useMenuGroup_unstable = useMenuGroup_unstable;
|
19
|
+
});
|
20
|
+
//# sourceMappingURL=useMenuGroup.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useMenuGroup.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroup/useMenuGroup.ts"],"names":[],"mappings":";;;;IAIA;;OAEG;IACH,SAAgB,qBAAqB,CAAC,KAAqB,EAAE,GAA2B;QACtF,IAAM,QAAQ,GAAG,uBAAK,CAAC,YAAY,CAAC,CAAC;QAErC,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;aACZ;YACD,IAAI,EAAE,uCAAqB,CAAC,KAAK,qBAC/B,GAAG,KAAA,EACH,iBAAiB,EAAE,QAAQ,EAC3B,IAAI,EAAE,OAAO,IACV,KAAK,EACR;YACF,QAAQ,UAAA;SACT,CAAC;IACJ,CAAC;IAfD,sDAeC","sourcesContent":["import * as React from 'react';\nimport { getNativeElementProps, useId } from '@fluentui/react-utilities';\nimport { MenuGroupProps, MenuGroupState } from './MenuGroup.types';\n\n/**\n * Given user props, returns state and render function for a MenuGroup.\n */\nexport function useMenuGroup_unstable(props: MenuGroupProps, ref: React.Ref<HTMLElement>): MenuGroupState {\n const headerId = useId('menu-group');\n\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n 'aria-labelledby': headerId,\n role: 'group',\n ...props,\n }),\n headerId,\n };\n}\n"]}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
define(["require", "exports", "react"], function (require, exports, React) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useMenuGroupContextValues_unstable = void 0;
|
5
|
+
function useMenuGroupContextValues_unstable(state) {
|
6
|
+
var headerId = state.headerId;
|
7
|
+
var menuGroup = React.useMemo(function () { return ({ headerId: headerId }); }, [headerId]);
|
8
|
+
return { menuGroup: menuGroup };
|
9
|
+
}
|
10
|
+
exports.useMenuGroupContextValues_unstable = useMenuGroupContextValues_unstable;
|
11
|
+
});
|
12
|
+
//# sourceMappingURL=useMenuGroupContextValues.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useMenuGroupContextValues.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroup/useMenuGroupContextValues.ts"],"names":[],"mappings":";;;;IAGA,SAAgB,kCAAkC,CAAC,KAAqB;QAC9D,IAAA,QAAQ,GAAK,KAAK,SAAV,CAAW;QAC3B,IAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,cAAM,OAAA,CAAC,EAAE,QAAQ,UAAA,EAAE,CAAC,EAAd,CAAc,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;QAElE,OAAO,EAAE,SAAS,WAAA,EAAE,CAAC;IACvB,CAAC;IALD,gFAKC","sourcesContent":["import * as React from 'react';\nimport type { MenuGroupContextValues, MenuGroupState } from './MenuGroup.types';\n\nexport function useMenuGroupContextValues_unstable(state: MenuGroupState): MenuGroupContextValues {\n const { headerId } = state;\n const menuGroup = React.useMemo(() => ({ headerId }), [headerId]);\n\n return { menuGroup };\n}\n"]}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
define(["require", "exports", "@griffel/react"], function (require, exports, react_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useMenuGroupStyles_unstable = exports.menuGroupClassNames = void 0;
|
5
|
+
exports.menuGroupClassNames = {
|
6
|
+
root: 'fui-MenuGroup',
|
7
|
+
};
|
8
|
+
var useMenuGroupStyles_unstable = function (state) {
|
9
|
+
state.root.className = react_1.mergeClasses(exports.menuGroupClassNames.root, state.root.className);
|
10
|
+
return state;
|
11
|
+
};
|
12
|
+
exports.useMenuGroupStyles_unstable = useMenuGroupStyles_unstable;
|
13
|
+
});
|
14
|
+
//# sourceMappingURL=useMenuGroupStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useMenuGroupStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroup/useMenuGroupStyles.ts"],"names":[],"mappings":";;;;IAIa,QAAA,mBAAmB,GAAmC;QACjE,IAAI,EAAE,eAAe;KACtB,CAAC;IAEK,IAAM,2BAA2B,GAAG,UAAC,KAAqB;QAC/D,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CAAC,2BAAmB,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEpF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAJW,QAAA,2BAA2B,+BAItC","sourcesContent":["import type { SlotClassNames } from '@fluentui/react-utilities';\nimport { mergeClasses } from '@griffel/react';\nimport type { MenuGroupSlots, MenuGroupState } from './MenuGroup.types';\n\nexport const menuGroupClassNames: SlotClassNames<MenuGroupSlots> = {\n root: 'fui-MenuGroup',\n};\n\nexport const useMenuGroupStyles_unstable = (state: MenuGroupState): MenuGroupState => {\n state.root.className = mergeClasses(menuGroupClassNames.root, state.root.className);\n\n return state;\n};\n"]}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
define(["require", "exports", "react", "./useMenuGroupHeader", "./useMenuGroupHeaderStyles", "./renderMenuGroupHeader"], function (require, exports, React, useMenuGroupHeader_1, useMenuGroupHeaderStyles_1, renderMenuGroupHeader_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.MenuGroupHeader = void 0;
|
5
|
+
/**
|
6
|
+
* Define a styled MenuGroupHeader, using the `useMenuGroupHeader_unstable` hook.
|
7
|
+
*/
|
8
|
+
exports.MenuGroupHeader = React.forwardRef(function (props, ref) {
|
9
|
+
var state = useMenuGroupHeader_1.useMenuGroupHeader_unstable(props, ref);
|
10
|
+
useMenuGroupHeaderStyles_1.useMenuGroupHeaderStyles_unstable(state);
|
11
|
+
return renderMenuGroupHeader_1.renderMenuGroupHeader_unstable(state);
|
12
|
+
});
|
13
|
+
exports.MenuGroupHeader.displayName = 'MenuGroupHeader';
|
14
|
+
});
|
15
|
+
//# sourceMappingURL=MenuGroupHeader.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuGroupHeader.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroupHeader/MenuGroupHeader.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACU,QAAA,eAAe,GAA8C,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QACpG,IAAM,KAAK,GAAG,gDAA2B,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QACtD,4DAAiC,CAAC,KAAK,CAAC,CAAC;QAEzC,OAAO,sDAA8B,CAAC,KAAK,CAAC,CAAC;IAC/C,CAAC,CAAC,CAAC;IAEH,uBAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC","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';\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 useMenuGroupHeaderStyles_unstable(state);\n\n return renderMenuGroupHeader_unstable(state);\n});\n\nMenuGroupHeader.displayName = 'MenuGroupHeader';\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuGroupHeader.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroupHeader/MenuGroupHeader.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type MenuGroupHeaderSlots = {\n root: Slot<'div'>;\n};\n\nexport type MenuGroupHeaderProps = ComponentProps<MenuGroupHeaderSlots>;\n\nexport type MenuGroupHeaderState = ComponentState<MenuGroupHeaderSlots>;\n"]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
define(["require", "exports", "tslib", "./MenuGroupHeader.types", "./MenuGroupHeader", "./renderMenuGroupHeader", "./useMenuGroupHeader", "./useMenuGroupHeaderStyles"], function (require, exports, tslib_1, MenuGroupHeader_types_1, MenuGroupHeader_1, renderMenuGroupHeader_1, useMenuGroupHeader_1, useMenuGroupHeaderStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
tslib_1.__exportStar(MenuGroupHeader_types_1, exports);
|
5
|
+
tslib_1.__exportStar(MenuGroupHeader_1, exports);
|
6
|
+
tslib_1.__exportStar(renderMenuGroupHeader_1, exports);
|
7
|
+
tslib_1.__exportStar(useMenuGroupHeader_1, exports);
|
8
|
+
tslib_1.__exportStar(useMenuGroupHeaderStyles_1, exports);
|
9
|
+
});
|
10
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroupHeader/index.ts"],"names":[],"mappings":";;;IAAA,uDAAwC;IACxC,iDAAkC;IAClC,uDAAwC;IACxC,oDAAqC;IACrC,0DAA2C","sourcesContent":["export * from './MenuGroupHeader.types';\nexport * from './MenuGroupHeader';\nexport * from './renderMenuGroupHeader';\nexport * from './useMenuGroupHeader';\nexport * from './useMenuGroupHeaderStyles';\n"]}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.renderMenuGroupHeader_unstable = void 0;
|
5
|
+
/**
|
6
|
+
* Redefine the render function to add slots. Reuse the menugroupheader structure but add
|
7
|
+
* slots to children.
|
8
|
+
*/
|
9
|
+
var renderMenuGroupHeader_unstable = function (state) {
|
10
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
11
|
+
return React.createElement(slots.root, tslib_1.__assign({}, slotProps.root));
|
12
|
+
};
|
13
|
+
exports.renderMenuGroupHeader_unstable = renderMenuGroupHeader_unstable;
|
14
|
+
});
|
15
|
+
//# sourceMappingURL=renderMenuGroupHeader.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"renderMenuGroupHeader.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroupHeader/renderMenuGroupHeader.tsx"],"names":[],"mappings":";;;;IAIA;;;OAGG;IACI,IAAM,8BAA8B,GAAG,UAAC,KAA2B;QAClE,IAAA,KAAuB,0BAAQ,CAAuB,KAAK,CAAC,EAA1D,KAAK,WAAA,EAAE,SAAS,eAA0C,CAAC;QAEnE,OAAO,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI,CAAC;IAC5C,CAAC,CAAC;IAJW,QAAA,8BAA8B,kCAIzC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport { MenuGroupHeaderSlots, MenuGroupHeaderState } from './MenuGroupHeader.types';\n\n/**\n * Redefine the render function to add slots. Reuse the menugroupheader structure but add\n * slots to children.\n */\nexport const renderMenuGroupHeader_unstable = (state: MenuGroupHeaderState) => {\n const { slots, slotProps } = getSlots<MenuGroupHeaderSlots>(state);\n\n return <slots.root {...slotProps.root} />;\n};\n"]}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
define(["require", "exports", "tslib", "../../contexts/menuGroupContext", "@fluentui/react-utilities"], function (require, exports, tslib_1, menuGroupContext_1, react_utilities_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useMenuGroupHeader_unstable = void 0;
|
5
|
+
/**
|
6
|
+
* Given user props, returns state and render function for a MenuGroupHeader.
|
7
|
+
*/
|
8
|
+
function useMenuGroupHeader_unstable(props, ref) {
|
9
|
+
var id = menuGroupContext_1.useMenuGroupContext_unstable().headerId;
|
10
|
+
return {
|
11
|
+
components: {
|
12
|
+
root: 'div',
|
13
|
+
},
|
14
|
+
root: react_utilities_1.getNativeElementProps('div', tslib_1.__assign({ ref: ref, id: id }, props)),
|
15
|
+
};
|
16
|
+
}
|
17
|
+
exports.useMenuGroupHeader_unstable = useMenuGroupHeader_unstable;
|
18
|
+
});
|
19
|
+
//# sourceMappingURL=useMenuGroupHeader.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useMenuGroupHeader.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroupHeader/useMenuGroupHeader.ts"],"names":[],"mappings":";;;;IAKA;;OAEG;IACH,SAAgB,2BAA2B,CACzC,KAA2B,EAC3B,GAA2B;QAEnB,IAAU,EAAE,GAAK,+CAA4B,EAAE,SAAnC,CAAoC;QAExD,OAAO;YACL,UAAU,EAAE;gBACV,IAAI,EAAE,KAAK;aACZ;YACD,IAAI,EAAE,uCAAqB,CAAC,KAAK,qBAC/B,GAAG,KAAA,EACH,EAAE,IAAA,IACC,KAAK,EACR;SACH,CAAC;IACJ,CAAC;IAhBD,kEAgBC","sourcesContent":["import * as React from 'react';\nimport { useMenuGroupContext_unstable } from '../../contexts/menuGroupContext';\nimport { getNativeElementProps } from '@fluentui/react-utilities';\nimport { MenuGroupHeaderProps, MenuGroupHeaderState } from './MenuGroupHeader.types';\n\n/**\n * Given user props, returns state and render function for a MenuGroupHeader.\n */\nexport function useMenuGroupHeader_unstable(\n props: MenuGroupHeaderProps,\n ref: React.Ref<HTMLElement>,\n): MenuGroupHeaderState {\n const { headerId: id } = useMenuGroupContext_unstable();\n\n return {\n components: {\n root: 'div',\n },\n root: getNativeElementProps('div', {\n ref,\n id,\n ...props,\n }),\n };\n}\n"]}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
define(["require", "exports", "@griffel/react", "@fluentui/react-theme"], function (require, exports, react_1, react_theme_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useMenuGroupHeaderStyles_unstable = exports.menuGroupHeaderClassNames = void 0;
|
5
|
+
exports.menuGroupHeaderClassNames = {
|
6
|
+
root: 'fui-MenuGroupHeader',
|
7
|
+
};
|
8
|
+
var useStyles = react_1.makeStyles({
|
9
|
+
root: {
|
10
|
+
fontSize: react_theme_1.tokens.fontSizeBase200,
|
11
|
+
color: react_theme_1.tokens.colorNeutralForeground3,
|
12
|
+
paddingLeft: '12px',
|
13
|
+
paddingRight: '12px',
|
14
|
+
fontWeight: react_theme_1.tokens.fontWeightSemibold,
|
15
|
+
height: '32px',
|
16
|
+
display: 'flex',
|
17
|
+
alignItems: 'center',
|
18
|
+
},
|
19
|
+
});
|
20
|
+
var useMenuGroupHeaderStyles_unstable = function (state) {
|
21
|
+
var styles = useStyles();
|
22
|
+
state.root.className = react_1.mergeClasses(exports.menuGroupHeaderClassNames.root, styles.root, state.root.className);
|
23
|
+
return state;
|
24
|
+
};
|
25
|
+
exports.useMenuGroupHeaderStyles_unstable = useMenuGroupHeaderStyles_unstable;
|
26
|
+
});
|
27
|
+
//# sourceMappingURL=useMenuGroupHeaderStyles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useMenuGroupHeaderStyles.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuGroupHeader/useMenuGroupHeaderStyles.ts"],"names":[],"mappings":";;;;IAKa,QAAA,yBAAyB,GAAyC;QAC7E,IAAI,EAAE,qBAAqB;KAC5B,CAAC;IAEF,IAAM,SAAS,GAAG,kBAAU,CAAC;QAC3B,IAAI,EAAE;YACJ,QAAQ,EAAE,oBAAM,CAAC,eAAe;YAChC,KAAK,EAAE,oBAAM,CAAC,uBAAuB;YACrC,WAAW,EAAE,MAAM;YACnB,YAAY,EAAE,MAAM;YACpB,UAAU,EAAE,oBAAM,CAAC,kBAAkB;YACrC,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,MAAM;YACf,UAAU,EAAE,QAAQ;SACrB;KACF,CAAC,CAAC;IAEI,IAAM,iCAAiC,GAAG,UAAC,KAA2B;QAC3E,IAAM,MAAM,GAAG,SAAS,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,oBAAY,CAAC,iCAAyB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEvG,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IALW,QAAA,iCAAiC,qCAK5C","sourcesContent":["import { mergeClasses, makeStyles } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { MenuGroupHeaderSlots, MenuGroupHeaderState } from './MenuGroupHeader.types';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\n\nexport const menuGroupHeaderClassNames: SlotClassNames<MenuGroupHeaderSlots> = {\n root: 'fui-MenuGroupHeader',\n};\n\nconst useStyles = makeStyles({\n root: {\n fontSize: tokens.fontSizeBase200,\n color: tokens.colorNeutralForeground3,\n paddingLeft: '12px',\n paddingRight: '12px',\n fontWeight: tokens.fontWeightSemibold,\n height: '32px',\n display: 'flex',\n alignItems: 'center',\n },\n});\n\nexport const useMenuGroupHeaderStyles_unstable = (state: MenuGroupHeaderState) => {\n const styles = useStyles();\n state.root.className = mergeClasses(menuGroupHeaderClassNames.root, styles.root, state.root.className);\n\n return state;\n};\n"]}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
define(["require", "exports", "react", "./useMenuItem", "./renderMenuItem", "./useMenuItemStyles"], function (require, exports, React, useMenuItem_1, renderMenuItem_1, useMenuItemStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.MenuItem = void 0;
|
5
|
+
/**
|
6
|
+
* Define a styled MenuItem, using the `useMenuItem_unstable` and `useMenuItemStyles_unstable` hook.
|
7
|
+
*/
|
8
|
+
exports.MenuItem = React.forwardRef(function (props, ref) {
|
9
|
+
var state = useMenuItem_1.useMenuItem_unstable(props, ref);
|
10
|
+
useMenuItemStyles_1.useMenuItemStyles_unstable(state);
|
11
|
+
return renderMenuItem_1.renderMenuItem_unstable(state);
|
12
|
+
});
|
13
|
+
exports.MenuItem.displayName = 'MenuItem';
|
14
|
+
});
|
15
|
+
//# sourceMappingURL=MenuItem.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuItem/MenuItem.tsx"],"names":[],"mappings":";;;;IAOA;;OAEG;IACU,QAAA,QAAQ,GAAuC,KAAK,CAAC,UAAU,CAAC,UAAC,KAAK,EAAE,GAAG;QACtF,IAAM,KAAK,GAAG,kCAAoB,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAE/C,8CAA0B,CAAC,KAAK,CAAC,CAAC;QAClC,OAAO,wCAAuB,CAAC,KAAK,CAAC,CAAC;IACxC,CAAC,CAAC,CAAC;IAEH,gBAAQ,CAAC,WAAW,GAAG,UAAU,CAAC","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';\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 return renderMenuItem_unstable(state);\n});\n\nMenuItem.displayName = 'MenuItem';\n"]}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MenuItem.types.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuItem/MenuItem.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';\n\nexport type MenuItemSlots = {\n root: Slot<ARIAButtonSlotProps<'div'>>;\n\n /**\n * Icon slot rendered before children content\n */\n icon?: Slot<'span'>;\n\n /**\n * A helper slot for alignment when a menu item is used with selectable menuitems\n * Avoid using this slot as a replacement for MenuItemCheckbox and MenuItemRadio components\n */\n checkmark?: Slot<'span'>;\n\n /**\n * Icon slot that shows the indicator for a submenu\n */\n submenuIndicator?: Slot<'span'>;\n\n /**\n * Component children are placed in this slot\n * Avoid using the `children` property in this slot in favour of Component children whenever possible\n */\n content?: Slot<'span'>;\n\n /**\n * Secondary content rendered opposite the primary content (e.g Shortcut text)\n */\n secondaryContent?: Slot<'span'>;\n};\n\nexport type MenuItemProps = ComponentProps<Partial<MenuItemSlots>> & {\n /**\n * If the menu item is a trigger for a submenu\n *\n * @default false\n */\n hasSubmenu?: boolean;\n\n /**\n * Clicking on the menu item will not dismiss an open menu\n *\n * @default false\n */\n persistOnClick?: boolean;\n};\n\nexport type MenuItemState = ComponentState<MenuItemSlots> &\n Required<Pick<MenuItemProps, 'disabled' | 'hasSubmenu' | 'persistOnClick'>> & {\n isNativeButton: boolean;\n };\n"]}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
define(["require", "exports", "tslib", "./MenuItem", "./MenuItem.types", "./renderMenuItem", "./useMenuItem", "./useMenuItemStyles"], function (require, exports, tslib_1, MenuItem_1, MenuItem_types_1, renderMenuItem_1, useMenuItem_1, useMenuItemStyles_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
tslib_1.__exportStar(MenuItem_1, exports);
|
5
|
+
tslib_1.__exportStar(MenuItem_types_1, exports);
|
6
|
+
tslib_1.__exportStar(renderMenuItem_1, exports);
|
7
|
+
tslib_1.__exportStar(useMenuItem_1, exports);
|
8
|
+
tslib_1.__exportStar(useMenuItemStyles_1, exports);
|
9
|
+
});
|
10
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuItem/index.ts"],"names":[],"mappings":";;;IAAA,0CAA2B;IAC3B,gDAAiC;IACjC,gDAAiC;IACjC,6CAA8B;IAC9B,mDAAoC","sourcesContent":["export * from './MenuItem';\nexport * from './MenuItem.types';\nexport * from './renderMenuItem';\nexport * from './useMenuItem';\nexport * from './useMenuItemStyles';\n"]}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities"], function (require, exports, tslib_1, React, react_utilities_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.renderMenuItem_unstable = void 0;
|
5
|
+
/**
|
6
|
+
* Function that renders the final JSX of the component
|
7
|
+
*/
|
8
|
+
var renderMenuItem_unstable = function (state) {
|
9
|
+
var _a = react_utilities_1.getSlots(state), slots = _a.slots, slotProps = _a.slotProps;
|
10
|
+
return (React.createElement(slots.root, tslib_1.__assign({}, slotProps.root),
|
11
|
+
slots.checkmark && React.createElement(slots.checkmark, tslib_1.__assign({}, slotProps.checkmark)),
|
12
|
+
slots.icon && React.createElement(slots.icon, tslib_1.__assign({}, slotProps.icon)),
|
13
|
+
slots.content && React.createElement(slots.content, tslib_1.__assign({}, slotProps.content)),
|
14
|
+
slots.secondaryContent && React.createElement(slots.secondaryContent, tslib_1.__assign({}, slotProps.secondaryContent)),
|
15
|
+
slots.submenuIndicator && React.createElement(slots.submenuIndicator, tslib_1.__assign({}, slotProps.submenuIndicator))));
|
16
|
+
};
|
17
|
+
exports.renderMenuItem_unstable = renderMenuItem_unstable;
|
18
|
+
});
|
19
|
+
//# sourceMappingURL=renderMenuItem.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"renderMenuItem.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuItem/renderMenuItem.tsx"],"names":[],"mappings":";;;;IAIA;;OAEG;IACI,IAAM,uBAAuB,GAAG,UAAC,KAAoB;QACpD,IAAA,KAAuB,0BAAQ,CAAgB,KAAK,CAAC,EAAnD,KAAK,WAAA,EAAE,SAAS,eAAmC,CAAC;QAE5D,OAAO,CACL,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI;YAC3B,KAAK,CAAC,SAAS,IAAI,oBAAC,KAAK,CAAC,SAAS,uBAAK,SAAS,CAAC,SAAS,EAAI;YAC/D,KAAK,CAAC,IAAI,IAAI,oBAAC,KAAK,CAAC,IAAI,uBAAK,SAAS,CAAC,IAAI,EAAI;YAChD,KAAK,CAAC,OAAO,IAAI,oBAAC,KAAK,CAAC,OAAO,uBAAK,SAAS,CAAC,OAAO,EAAI;YACzD,KAAK,CAAC,gBAAgB,IAAI,oBAAC,KAAK,CAAC,gBAAgB,uBAAK,SAAS,CAAC,gBAAgB,EAAI;YACpF,KAAK,CAAC,gBAAgB,IAAI,oBAAC,KAAK,CAAC,gBAAgB,uBAAK,SAAS,CAAC,gBAAgB,EAAI,CAC1E,CACd,CAAC;IACJ,CAAC,CAAC;IAZW,QAAA,uBAAuB,2BAYlC","sourcesContent":["import * as React from 'react';\nimport { getSlots } from '@fluentui/react-utilities';\nimport type { MenuItemSlots, MenuItemState } from './MenuItem.types';\n\n/**\n * Function that renders the final JSX of the component\n */\nexport const renderMenuItem_unstable = (state: MenuItemState) => {\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.submenuIndicator && <slots.submenuIndicator {...slotProps.submenuIndicator} />}\n </slots.root>\n );\n};\n"]}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
define(["require", "exports", "../../contexts/menuListContext"], function (require, exports, menuListContext_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useCharacterSearch = void 0;
|
5
|
+
var useCharacterSearch = function (state, ref) {
|
6
|
+
var setFocusByFirstCharacter = menuListContext_1.useMenuListContext_unstable(function (context) { return context.setFocusByFirstCharacter; });
|
7
|
+
var originalOnKeyDown = state.root.onKeyDown;
|
8
|
+
state.root.onKeyDown = function (e) {
|
9
|
+
var _a;
|
10
|
+
originalOnKeyDown === null || originalOnKeyDown === void 0 ? void 0 : originalOnKeyDown(e);
|
11
|
+
if (((_a = e.key) === null || _a === void 0 ? void 0 : _a.length) > 1) {
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
if (ref.current) {
|
15
|
+
setFocusByFirstCharacter === null || setFocusByFirstCharacter === void 0 ? void 0 : setFocusByFirstCharacter(e, ref.current);
|
16
|
+
}
|
17
|
+
};
|
18
|
+
return state;
|
19
|
+
};
|
20
|
+
exports.useCharacterSearch = useCharacterSearch;
|
21
|
+
});
|
22
|
+
//# sourceMappingURL=useCharacterSearch.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useCharacterSearch.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuItem/useCharacterSearch.ts"],"names":[],"mappings":";;;;IAKO,IAAM,kBAAkB,GAAG,UAAC,KAAoB,EAAE,GAAiC;QACxF,IAAM,wBAAwB,GAAG,6CAA2B,CAAC,UAAA,OAAO,IAAI,OAAA,OAAO,CAAC,wBAAwB,EAAhC,CAAgC,CAAC,CAAC;QAElG,IAAW,iBAAiB,GAAK,KAAK,CAAC,IAAI,UAAf,CAAgB;QAEpD,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,UAAC,CAAqD;;YAC3E,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAG,CAAC,CAAC,CAAC;YAEvB,IAAI,CAAA,MAAA,CAAC,CAAC,GAAG,0CAAE,MAAM,IAAG,CAAC,EAAE;gBACrB,OAAO;aACR;YAED,IAAI,GAAG,CAAC,OAAO,EAAE;gBACf,wBAAwB,aAAxB,wBAAwB,uBAAxB,wBAAwB,CAAG,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;aAC5C;QACH,CAAC,CAAC;QAEF,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAlBW,QAAA,kBAAkB,sBAkB7B","sourcesContent":["import * as React from 'react';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport type { MenuItemState } from '../../components/index';\nimport type { ARIAButtonElementIntersection } from '@fluentui/react-aria';\n\nexport const useCharacterSearch = (state: MenuItemState, ref: React.RefObject<HTMLElement>) => {\n const setFocusByFirstCharacter = useMenuListContext_unstable(context => context.setFocusByFirstCharacter);\n\n const { onKeyDown: originalOnKeyDown } = state.root;\n\n state.root.onKeyDown = (e: React.KeyboardEvent<ARIAButtonElementIntersection>) => {\n originalOnKeyDown?.(e);\n\n if (e.key?.length > 1) {\n return;\n }\n\n if (ref.current) {\n setFocusByFirstCharacter?.(e, ref.current);\n }\n };\n\n return state;\n};\n"]}
|
@@ -0,0 +1,80 @@
|
|
1
|
+
define(["require", "exports", "tslib", "react", "@fluentui/react-utilities", "@fluentui/react-shared-contexts", "./useCharacterSearch", "../../contexts/menuTriggerContext", "@fluentui/react-icons", "../../contexts/menuListContext", "../../contexts/menuContext", "@fluentui/react-aria", "@fluentui/keyboard-keys"], function (require, exports, tslib_1, React, react_utilities_1, react_shared_contexts_1, useCharacterSearch_1, menuTriggerContext_1, react_icons_1, menuListContext_1, menuContext_1, react_aria_1, keyboard_keys_1) {
|
2
|
+
"use strict";
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.useMenuItem_unstable = void 0;
|
5
|
+
var ChevronRightIcon = react_icons_1.bundleIcon(react_icons_1.ChevronRightFilled, react_icons_1.ChevronRightRegular);
|
6
|
+
var ChevronLeftIcon = react_icons_1.bundleIcon(react_icons_1.ChevronLeftFilled, react_icons_1.ChevronLeftRegular);
|
7
|
+
/**
|
8
|
+
* Returns the props and state required to render the component
|
9
|
+
*/
|
10
|
+
var useMenuItem_unstable = function (props, ref) {
|
11
|
+
var isSubmenuTrigger = menuTriggerContext_1.useMenuTriggerContext_unstable();
|
12
|
+
var persistOnClickContext = menuContext_1.useMenuContext_unstable(function (context) { return context.persistOnItemClick; });
|
13
|
+
var _a = props.as, as = _a === void 0 ? 'div' : _a, disabled = props.disabled, disabledFocusable = props.disabledFocusable, _b = props.hasSubmenu, hasSubmenu = _b === void 0 ? isSubmenuTrigger : _b, _c = props.persistOnClick, persistOnClick = _c === void 0 ? persistOnClickContext : _c;
|
14
|
+
var hasIcons = menuListContext_1.useMenuListContext_unstable(function (context) { return context.hasIcons; });
|
15
|
+
var hasCheckmarks = menuListContext_1.useMenuListContext_unstable(function (context) { return context.hasCheckmarks; });
|
16
|
+
var setOpen = menuContext_1.useMenuContext_unstable(function (context) { return context.setOpen; });
|
17
|
+
var dir = react_shared_contexts_1.useFluent_unstable().dir;
|
18
|
+
var innerRef = React.useRef(null);
|
19
|
+
var dismissedWithKeyboardRef = React.useRef(false);
|
20
|
+
var isDisabled = Boolean(disabled || disabledFocusable);
|
21
|
+
var state = {
|
22
|
+
hasSubmenu: hasSubmenu,
|
23
|
+
disabled: isDisabled,
|
24
|
+
persistOnClick: persistOnClick,
|
25
|
+
components: {
|
26
|
+
root: 'div',
|
27
|
+
icon: 'span',
|
28
|
+
checkmark: 'span',
|
29
|
+
submenuIndicator: 'span',
|
30
|
+
content: 'span',
|
31
|
+
secondaryContent: 'span',
|
32
|
+
},
|
33
|
+
isNativeButton: as === 'button',
|
34
|
+
root: react_utilities_1.getNativeElementProps(as, react_aria_1.useARIAButtonShorthand({ disabled: false, disabledFocusable: isDisabled, as: as }, {
|
35
|
+
required: true,
|
36
|
+
defaultProps: tslib_1.__assign(tslib_1.__assign({ role: 'menuitem' }, props), { ref: react_utilities_1.useMergedRefs(ref, innerRef), onKeyDown: react_utilities_1.useEventCallback(function (event) {
|
37
|
+
var _a;
|
38
|
+
(_a = props.onKeyDown) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
39
|
+
if (!event.isDefaultPrevented() && (event.key === keyboard_keys_1.Space || event.key === keyboard_keys_1.Enter)) {
|
40
|
+
dismissedWithKeyboardRef.current = true;
|
41
|
+
}
|
42
|
+
}), onMouseEnter: react_utilities_1.useEventCallback(function (event) {
|
43
|
+
var _a, _b;
|
44
|
+
(_a = innerRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
45
|
+
(_b = props.onMouseEnter) === null || _b === void 0 ? void 0 : _b.call(props, event);
|
46
|
+
}), onClick: react_utilities_1.useEventCallback(function (event) {
|
47
|
+
var _a;
|
48
|
+
if (!hasSubmenu && !persistOnClick) {
|
49
|
+
setOpen(event, {
|
50
|
+
open: false,
|
51
|
+
keyboard: dismissedWithKeyboardRef.current,
|
52
|
+
bubble: true,
|
53
|
+
type: 'menuItemClick',
|
54
|
+
event: event,
|
55
|
+
});
|
56
|
+
dismissedWithKeyboardRef.current = false;
|
57
|
+
}
|
58
|
+
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, event);
|
59
|
+
}) }),
|
60
|
+
})),
|
61
|
+
icon: react_utilities_1.resolveShorthand(props.icon, { required: hasIcons }),
|
62
|
+
checkmark: react_utilities_1.resolveShorthand(props.checkmark, { required: hasCheckmarks }),
|
63
|
+
submenuIndicator: react_utilities_1.resolveShorthand(props.submenuIndicator, {
|
64
|
+
required: hasSubmenu,
|
65
|
+
defaultProps: {
|
66
|
+
children: dir === 'ltr' ? React.createElement(ChevronRightIcon, null) : React.createElement(ChevronLeftIcon, null),
|
67
|
+
},
|
68
|
+
}),
|
69
|
+
content: react_utilities_1.resolveShorthand(props.content, {
|
70
|
+
required: !!props.children,
|
71
|
+
defaultProps: { children: props.children },
|
72
|
+
}),
|
73
|
+
secondaryContent: react_utilities_1.resolveShorthand(props.secondaryContent),
|
74
|
+
};
|
75
|
+
useCharacterSearch_1.useCharacterSearch(state, innerRef);
|
76
|
+
return state;
|
77
|
+
};
|
78
|
+
exports.useMenuItem_unstable = useMenuItem_unstable;
|
79
|
+
});
|
80
|
+
//# sourceMappingURL=useMenuItem.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"useMenuItem.js","sourceRoot":"","sources":["../../../../../../../../../packages/react-components/react-menu/src/components/MenuItem/useMenuItem.tsx"],"names":[],"mappings":"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","sourcesContent":["import * as React from 'react';\nimport { useEventCallback, resolveShorthand, useMergedRefs, getNativeElementProps } from '@fluentui/react-utilities';\nimport { useFluent_unstable as useFluent } from '@fluentui/react-shared-contexts';\nimport { useCharacterSearch } from './useCharacterSearch';\nimport { useMenuTriggerContext_unstable } from '../../contexts/menuTriggerContext';\nimport {\n ChevronRightFilled,\n ChevronRightRegular,\n ChevronLeftFilled,\n ChevronLeftRegular,\n bundleIcon,\n} from '@fluentui/react-icons';\nimport { useMenuListContext_unstable } from '../../contexts/menuListContext';\nimport { useMenuContext_unstable } from '../../contexts/menuContext';\nimport type { MenuItemProps, MenuItemState } from './MenuItem.types';\nimport type { ARIAButtonElement, ARIAButtonElementIntersection, ARIAButtonSlotProps } from '@fluentui/react-aria';\nimport { useARIAButtonShorthand } from '@fluentui/react-aria';\nimport { Enter, Space } from '@fluentui/keyboard-keys';\n\nconst ChevronRightIcon = bundleIcon(ChevronRightFilled, ChevronRightRegular);\nconst ChevronLeftIcon = bundleIcon(ChevronLeftFilled, ChevronLeftRegular);\n\n/**\n * Returns the props and state required to render the component\n */\nexport const useMenuItem_unstable = (props: MenuItemProps, ref: React.Ref<ARIAButtonElement<'div'>>): MenuItemState => {\n const isSubmenuTrigger = useMenuTriggerContext_unstable();\n const persistOnClickContext = useMenuContext_unstable(context => context.persistOnItemClick);\n const {\n as = 'div',\n disabled,\n disabledFocusable,\n hasSubmenu = isSubmenuTrigger,\n persistOnClick = persistOnClickContext,\n } = props;\n const hasIcons = useMenuListContext_unstable(context => context.hasIcons);\n const hasCheckmarks = useMenuListContext_unstable(context => context.hasCheckmarks);\n const setOpen = useMenuContext_unstable(context => context.setOpen);\n\n const { dir } = useFluent();\n const innerRef = React.useRef<ARIAButtonElementIntersection<'div'>>(null);\n const dismissedWithKeyboardRef = React.useRef(false);\n\n const isDisabled = Boolean(disabled || disabledFocusable);\n\n const state: MenuItemState = {\n hasSubmenu,\n disabled: isDisabled,\n persistOnClick,\n components: {\n root: 'div',\n icon: 'span',\n checkmark: 'span',\n submenuIndicator: 'span',\n content: 'span',\n secondaryContent: 'span',\n },\n isNativeButton: as === 'button',\n root: getNativeElementProps(\n as,\n useARIAButtonShorthand<ARIAButtonSlotProps<'div'>>(\n { disabled: false, disabledFocusable: isDisabled, as },\n {\n required: true,\n defaultProps: {\n role: 'menuitem',\n ...props,\n ref: useMergedRefs(ref, innerRef) as React.Ref<ARIAButtonElementIntersection<'div'>>,\n onKeyDown: useEventCallback(event => {\n props.onKeyDown?.(event);\n if (!event.isDefaultPrevented() && (event.key === Space || event.key === Enter)) {\n dismissedWithKeyboardRef.current = true;\n }\n }),\n onMouseEnter: useEventCallback(event => {\n innerRef.current?.focus();\n\n props.onMouseEnter?.(event);\n }),\n onClick: useEventCallback(event => {\n if (!hasSubmenu && !persistOnClick) {\n setOpen(event, {\n open: false,\n keyboard: dismissedWithKeyboardRef.current,\n bubble: true,\n type: 'menuItemClick',\n event,\n });\n dismissedWithKeyboardRef.current = false;\n }\n\n props.onClick?.(event);\n }),\n },\n },\n ),\n ),\n icon: resolveShorthand(props.icon, { required: hasIcons }),\n checkmark: resolveShorthand(props.checkmark, { required: hasCheckmarks }),\n submenuIndicator: resolveShorthand(props.submenuIndicator, {\n required: hasSubmenu,\n defaultProps: {\n children: dir === 'ltr' ? <ChevronRightIcon /> : <ChevronLeftIcon />,\n },\n }),\n content: resolveShorthand(props.content, {\n required: !!props.children,\n defaultProps: { children: props.children },\n }),\n secondaryContent: resolveShorthand(props.secondaryContent),\n };\n useCharacterSearch(state, innerRef);\n return state;\n};\n"]}
|