@react-md/menu
Advanced tools
Comparing version 2.0.0-alpha.11 to 2.0.0-alpha.12
@@ -24,3 +24,3 @@ var __assign = (this && this.__assign) || function () { | ||
import React, { forwardRef, Fragment } from "react"; | ||
import { FontIcon } from "@react-md/icon"; | ||
import { useIcon } from "@react-md/icon"; | ||
import defaultMenuItemRenderer from "./defaultMenuItemRenderer"; | ||
@@ -31,4 +31,5 @@ import defaultMenuRenderer from "./defaultMenuRenderer"; | ||
var DropdownMenu = function (providedProps) { | ||
var _a = providedProps, propOnClick = _a.onClick, propOnKeyDown = _a.onKeyDown, children = _a.children, forwardedRef = _a.forwardedRef, anchor = _a.anchor, menuLabel = _a.menuLabel, menuLabelledBy = _a.menuLabelledBy, menuRenderer = _a.menuRenderer, items = _a.items, itemRenderer = _a.itemRenderer, horizontal = _a.horizontal, onVisibilityChange = _a.onVisibilityChange, portal = _a.portal, portalInto = _a.portalInto, portalIntoId = _a.portalIntoId, positionOptions = _a.positionOptions, defaultVisible = _a.defaultVisible, disableCloseOnScroll = _a.disableCloseOnScroll, disableCloseOnResize = _a.disableCloseOnResize, props = __rest(_a, ["onClick", "onKeyDown", "children", "forwardedRef", "anchor", "menuLabel", "menuLabelledBy", "menuRenderer", "items", "itemRenderer", "horizontal", "onVisibilityChange", "portal", "portalInto", "portalIntoId", "positionOptions", "defaultVisible", "disableCloseOnScroll", "disableCloseOnResize"]); | ||
var _a = providedProps, propOnClick = _a.onClick, propOnKeyDown = _a.onKeyDown, children = _a.children, forwardedRef = _a.forwardedRef, anchor = _a.anchor, menuLabel = _a.menuLabel, menuLabelledBy = _a.menuLabelledBy, menuRenderer = _a.menuRenderer, items = _a.items, itemRenderer = _a.itemRenderer, horizontal = _a.horizontal, onVisibilityChange = _a.onVisibilityChange, portal = _a.portal, portalInto = _a.portalInto, portalIntoId = _a.portalIntoId, positionOptions = _a.positionOptions, defaultVisible = _a.defaultVisible, disableCloseOnScroll = _a.disableCloseOnScroll, disableCloseOnResize = _a.disableCloseOnResize, propDropdownIcon = _a.dropdownIcon, props = __rest(_a, ["onClick", "onKeyDown", "children", "forwardedRef", "anchor", "menuLabel", "menuLabelledBy", "menuRenderer", "items", "itemRenderer", "horizontal", "onVisibilityChange", "portal", "portalInto", "portalIntoId", "positionOptions", "defaultVisible", "disableCloseOnScroll", "disableCloseOnResize", "dropdownIcon"]); | ||
var id = props.id; | ||
var dropdownIcon = useIcon("dropdown", propDropdownIcon); | ||
var _b = useButtonVisibility({ | ||
@@ -45,3 +46,3 @@ onClick: propOnClick, | ||
return (React.createElement(Fragment, null, | ||
React.createElement(MenuButton, __assign({}, props, { "aria-haspopup": "menu", visible: visible, onClick: onClick, onKeyDown: onKeyDown, ref: forwardedRef }), children), | ||
React.createElement(MenuButton, __assign({}, props, { "aria-haspopup": "menu", visible: visible, onClick: onClick, onKeyDown: onKeyDown, ref: forwardedRef, dropdownIcon: dropdownIcon }), children), | ||
menuRenderer({ | ||
@@ -70,3 +71,2 @@ "aria-label": menuLabel, | ||
itemRenderer: defaultMenuItemRenderer, | ||
dropdownIcon: React.createElement(FontIcon, null, "arrow_drop_down"), | ||
disableDropdownIcon: false, | ||
@@ -73,0 +73,0 @@ }; |
@@ -24,3 +24,3 @@ var __assign = (this && this.__assign) || function () { | ||
import React, { Fragment } from "react"; | ||
import { FontIcon, IconRotator } from "@react-md/icon"; | ||
import { IconRotator, useIcon } from "@react-md/icon"; | ||
import defaultMenuItemRenderer from "./defaultMenuItemRenderer"; | ||
@@ -39,4 +39,5 @@ import defaultMenuRenderer from "./defaultMenuRenderer"; | ||
var DropdownMenuItem = function (providedProps) { | ||
var _a = providedProps, propOnClick = _a.onClick, propOnKeyDown = _a.onKeyDown, children = _a.children, forwardedRef = _a.forwardedRef, propAnchor = _a.anchor, menuLabel = _a.menuLabel, menuLabelledBy = _a.menuLabelledBy, menuRenderer = _a.menuRenderer, items = _a.items, itemRenderer = _a.itemRenderer, horizontal = _a.horizontal, onVisibilityChange = _a.onVisibilityChange, portal = _a.portal, portalInto = _a.portalInto, portalIntoId = _a.portalIntoId, positionOptions = _a.positionOptions, propRightIcon = _a.rightIcon, dropdownIcon = _a.dropdownIcon, disableEscapeCascade = _a.disableEscapeCascade, disableDropdownIcon = _a.disableDropdownIcon, disableCloseOnScroll = _a.disableCloseOnScroll, disableCloseOnResize = _a.disableCloseOnResize, props = __rest(_a, ["onClick", "onKeyDown", "children", "forwardedRef", "anchor", "menuLabel", "menuLabelledBy", "menuRenderer", "items", "itemRenderer", "horizontal", "onVisibilityChange", "portal", "portalInto", "portalIntoId", "positionOptions", "rightIcon", "dropdownIcon", "disableEscapeCascade", "disableDropdownIcon", "disableCloseOnScroll", "disableCloseOnResize"]); | ||
var _a = providedProps, propOnClick = _a.onClick, propOnKeyDown = _a.onKeyDown, children = _a.children, forwardedRef = _a.forwardedRef, propAnchor = _a.anchor, menuLabel = _a.menuLabel, menuLabelledBy = _a.menuLabelledBy, menuRenderer = _a.menuRenderer, items = _a.items, itemRenderer = _a.itemRenderer, horizontal = _a.horizontal, onVisibilityChange = _a.onVisibilityChange, portal = _a.portal, portalInto = _a.portalInto, portalIntoId = _a.portalIntoId, positionOptions = _a.positionOptions, propRightIcon = _a.rightIcon, propDropdownIcon = _a.dropdownIcon, disableEscapeCascade = _a.disableEscapeCascade, disableDropdownIcon = _a.disableDropdownIcon, disableCloseOnScroll = _a.disableCloseOnScroll, disableCloseOnResize = _a.disableCloseOnResize, props = __rest(_a, ["onClick", "onKeyDown", "children", "forwardedRef", "anchor", "menuLabel", "menuLabelledBy", "menuRenderer", "items", "itemRenderer", "horizontal", "onVisibilityChange", "portal", "portalInto", "portalIntoId", "positionOptions", "rightIcon", "dropdownIcon", "disableEscapeCascade", "disableDropdownIcon", "disableCloseOnScroll", "disableCloseOnResize"]); | ||
var id = props.id; | ||
var dropdownIcon = useIcon("forward", propDropdownIcon); | ||
var _b = useItemVisibility({ | ||
@@ -93,3 +94,2 @@ onClick: propOnClick, | ||
itemRenderer: defaultMenuItemRenderer, | ||
dropdownIcon: React.createElement(FontIcon, null, "keyboard_arrow_right"), | ||
disableDropdownIcon: false, | ||
@@ -96,0 +96,0 @@ disableEscapeCascade: false, |
@@ -27,3 +27,3 @@ var __assign = (this && this.__assign) || function () { | ||
import { Button } from "@react-md/button"; | ||
import { FontIcon } from "@react-md/icon"; | ||
import { useIcon } from "@react-md/icon"; | ||
import { bem } from "@react-md/utils"; | ||
@@ -39,4 +39,5 @@ import ToggleChildren from "./ToggleChildren"; | ||
var _b; | ||
var className = _a.className, visible = _a.visible, children = _a.children, forwardedRef = _a.forwardedRef, dropdownIcon = _a.dropdownIcon, disableDropdownIcon = _a.disableDropdownIcon, first = _a.first, last = _a.last, inheritColor = _a.inheritColor, asAppBarAction = _a.asAppBarAction, props = __rest(_a, ["className", "visible", "children", "forwardedRef", "dropdownIcon", "disableDropdownIcon", "first", "last", "inheritColor", "asAppBarAction"]); | ||
var className = _a.className, visible = _a.visible, children = _a.children, forwardedRef = _a.forwardedRef, propDropdownIcon = _a.dropdownIcon, disableDropdownIcon = _a.disableDropdownIcon, first = _a.first, last = _a.last, inheritColor = _a.inheritColor, asAppBarAction = _a.asAppBarAction, props = __rest(_a, ["className", "visible", "children", "forwardedRef", "dropdownIcon", "disableDropdownIcon", "first", "last", "inheritColor", "asAppBarAction"]); | ||
var buttonType = props.buttonType; | ||
var dropdownIcon = useIcon("dropdown", propDropdownIcon); | ||
var actionClassName = useActionClassName({ first: first, last: last, inheritColor: inheritColor }); | ||
@@ -50,3 +51,2 @@ return (React.createElement(Button, __assign({}, props, { "aria-expanded": visible ? "true" : undefined, ref: forwardedRef, className: cn(block(), (_b = {}, | ||
"aria-haspopup": "menu", | ||
dropdownIcon: React.createElement(FontIcon, null, "arrow_drop_down"), | ||
disableDropdownIcon: false, | ||
@@ -53,0 +53,0 @@ first: false, |
@@ -42,4 +42,5 @@ "use strict"; | ||
var DropdownMenu = function (providedProps) { | ||
var _a = providedProps, propOnClick = _a.onClick, propOnKeyDown = _a.onKeyDown, children = _a.children, forwardedRef = _a.forwardedRef, anchor = _a.anchor, menuLabel = _a.menuLabel, menuLabelledBy = _a.menuLabelledBy, menuRenderer = _a.menuRenderer, items = _a.items, itemRenderer = _a.itemRenderer, horizontal = _a.horizontal, onVisibilityChange = _a.onVisibilityChange, portal = _a.portal, portalInto = _a.portalInto, portalIntoId = _a.portalIntoId, positionOptions = _a.positionOptions, defaultVisible = _a.defaultVisible, disableCloseOnScroll = _a.disableCloseOnScroll, disableCloseOnResize = _a.disableCloseOnResize, props = __rest(_a, ["onClick", "onKeyDown", "children", "forwardedRef", "anchor", "menuLabel", "menuLabelledBy", "menuRenderer", "items", "itemRenderer", "horizontal", "onVisibilityChange", "portal", "portalInto", "portalIntoId", "positionOptions", "defaultVisible", "disableCloseOnScroll", "disableCloseOnResize"]); | ||
var _a = providedProps, propOnClick = _a.onClick, propOnKeyDown = _a.onKeyDown, children = _a.children, forwardedRef = _a.forwardedRef, anchor = _a.anchor, menuLabel = _a.menuLabel, menuLabelledBy = _a.menuLabelledBy, menuRenderer = _a.menuRenderer, items = _a.items, itemRenderer = _a.itemRenderer, horizontal = _a.horizontal, onVisibilityChange = _a.onVisibilityChange, portal = _a.portal, portalInto = _a.portalInto, portalIntoId = _a.portalIntoId, positionOptions = _a.positionOptions, defaultVisible = _a.defaultVisible, disableCloseOnScroll = _a.disableCloseOnScroll, disableCloseOnResize = _a.disableCloseOnResize, propDropdownIcon = _a.dropdownIcon, props = __rest(_a, ["onClick", "onKeyDown", "children", "forwardedRef", "anchor", "menuLabel", "menuLabelledBy", "menuRenderer", "items", "itemRenderer", "horizontal", "onVisibilityChange", "portal", "portalInto", "portalIntoId", "positionOptions", "defaultVisible", "disableCloseOnScroll", "disableCloseOnResize", "dropdownIcon"]); | ||
var id = props.id; | ||
var dropdownIcon = icon_1.useIcon("dropdown", propDropdownIcon); | ||
var _b = useButtonVisibility_1.default({ | ||
@@ -56,3 +57,3 @@ onClick: propOnClick, | ||
return (react_1.default.createElement(react_1.Fragment, null, | ||
react_1.default.createElement(MenuButton_1.default, __assign({}, props, { "aria-haspopup": "menu", visible: visible, onClick: onClick, onKeyDown: onKeyDown, ref: forwardedRef }), children), | ||
react_1.default.createElement(MenuButton_1.default, __assign({}, props, { "aria-haspopup": "menu", visible: visible, onClick: onClick, onKeyDown: onKeyDown, ref: forwardedRef, dropdownIcon: dropdownIcon }), children), | ||
menuRenderer({ | ||
@@ -81,3 +82,2 @@ "aria-label": menuLabel, | ||
itemRenderer: defaultMenuItemRenderer_1.default, | ||
dropdownIcon: react_1.default.createElement(icon_1.FontIcon, null, "arrow_drop_down"), | ||
disableDropdownIcon: false, | ||
@@ -84,0 +84,0 @@ }; |
@@ -50,4 +50,5 @@ "use strict"; | ||
var DropdownMenuItem = function (providedProps) { | ||
var _a = providedProps, propOnClick = _a.onClick, propOnKeyDown = _a.onKeyDown, children = _a.children, forwardedRef = _a.forwardedRef, propAnchor = _a.anchor, menuLabel = _a.menuLabel, menuLabelledBy = _a.menuLabelledBy, menuRenderer = _a.menuRenderer, items = _a.items, itemRenderer = _a.itemRenderer, horizontal = _a.horizontal, onVisibilityChange = _a.onVisibilityChange, portal = _a.portal, portalInto = _a.portalInto, portalIntoId = _a.portalIntoId, positionOptions = _a.positionOptions, propRightIcon = _a.rightIcon, dropdownIcon = _a.dropdownIcon, disableEscapeCascade = _a.disableEscapeCascade, disableDropdownIcon = _a.disableDropdownIcon, disableCloseOnScroll = _a.disableCloseOnScroll, disableCloseOnResize = _a.disableCloseOnResize, props = __rest(_a, ["onClick", "onKeyDown", "children", "forwardedRef", "anchor", "menuLabel", "menuLabelledBy", "menuRenderer", "items", "itemRenderer", "horizontal", "onVisibilityChange", "portal", "portalInto", "portalIntoId", "positionOptions", "rightIcon", "dropdownIcon", "disableEscapeCascade", "disableDropdownIcon", "disableCloseOnScroll", "disableCloseOnResize"]); | ||
var _a = providedProps, propOnClick = _a.onClick, propOnKeyDown = _a.onKeyDown, children = _a.children, forwardedRef = _a.forwardedRef, propAnchor = _a.anchor, menuLabel = _a.menuLabel, menuLabelledBy = _a.menuLabelledBy, menuRenderer = _a.menuRenderer, items = _a.items, itemRenderer = _a.itemRenderer, horizontal = _a.horizontal, onVisibilityChange = _a.onVisibilityChange, portal = _a.portal, portalInto = _a.portalInto, portalIntoId = _a.portalIntoId, positionOptions = _a.positionOptions, propRightIcon = _a.rightIcon, propDropdownIcon = _a.dropdownIcon, disableEscapeCascade = _a.disableEscapeCascade, disableDropdownIcon = _a.disableDropdownIcon, disableCloseOnScroll = _a.disableCloseOnScroll, disableCloseOnResize = _a.disableCloseOnResize, props = __rest(_a, ["onClick", "onKeyDown", "children", "forwardedRef", "anchor", "menuLabel", "menuLabelledBy", "menuRenderer", "items", "itemRenderer", "horizontal", "onVisibilityChange", "portal", "portalInto", "portalIntoId", "positionOptions", "rightIcon", "dropdownIcon", "disableEscapeCascade", "disableDropdownIcon", "disableCloseOnScroll", "disableCloseOnResize"]); | ||
var id = props.id; | ||
var dropdownIcon = icon_1.useIcon("forward", propDropdownIcon); | ||
var _b = useItemVisibility_1.default({ | ||
@@ -104,3 +105,2 @@ onClick: propOnClick, | ||
itemRenderer: defaultMenuItemRenderer_1.default, | ||
dropdownIcon: react_1.default.createElement(icon_1.FontIcon, null, "keyboard_arrow_right"), | ||
disableDropdownIcon: false, | ||
@@ -107,0 +107,0 @@ disableEscapeCascade: false, |
@@ -50,4 +50,5 @@ "use strict"; | ||
var _b; | ||
var className = _a.className, visible = _a.visible, children = _a.children, forwardedRef = _a.forwardedRef, dropdownIcon = _a.dropdownIcon, disableDropdownIcon = _a.disableDropdownIcon, first = _a.first, last = _a.last, inheritColor = _a.inheritColor, asAppBarAction = _a.asAppBarAction, props = __rest(_a, ["className", "visible", "children", "forwardedRef", "dropdownIcon", "disableDropdownIcon", "first", "last", "inheritColor", "asAppBarAction"]); | ||
var className = _a.className, visible = _a.visible, children = _a.children, forwardedRef = _a.forwardedRef, propDropdownIcon = _a.dropdownIcon, disableDropdownIcon = _a.disableDropdownIcon, first = _a.first, last = _a.last, inheritColor = _a.inheritColor, asAppBarAction = _a.asAppBarAction, props = __rest(_a, ["className", "visible", "children", "forwardedRef", "dropdownIcon", "disableDropdownIcon", "first", "last", "inheritColor", "asAppBarAction"]); | ||
var buttonType = props.buttonType; | ||
var dropdownIcon = icon_1.useIcon("dropdown", propDropdownIcon); | ||
var actionClassName = app_bar_1.useActionClassName({ first: first, last: last, inheritColor: inheritColor }); | ||
@@ -61,3 +62,2 @@ return (react_1.default.createElement(button_1.Button, __assign({}, props, { "aria-expanded": visible ? "true" : undefined, ref: forwardedRef, className: classnames_1.default(block(), (_b = {}, | ||
"aria-haspopup": "menu", | ||
dropdownIcon: react_1.default.createElement(icon_1.FontIcon, null, "arrow_drop_down"), | ||
disableDropdownIcon: false, | ||
@@ -64,0 +64,0 @@ first: false, |
{ | ||
"name": "@react-md/menu", | ||
"version": "2.0.0-alpha.11", | ||
"version": "2.0.0-alpha.12", | ||
"description": "Create menus that auto-position themselves within the viewport and adhere to the accessibility guidelines", | ||
@@ -41,12 +41,12 @@ "scripts": { | ||
"dependencies": { | ||
"@react-md/app-bar": "^2.0.0-alpha.11", | ||
"@react-md/button": "^2.0.0-alpha.11", | ||
"@react-md/divider": "^2.0.0-alpha.11", | ||
"@react-md/elevation": "^2.0.0-alpha.11", | ||
"@react-md/icon": "^2.0.0-alpha.11", | ||
"@react-md/list": "^2.0.0-alpha.11", | ||
"@react-md/states": "^2.0.0-alpha.11", | ||
"@react-md/theme": "^2.0.0-alpha.11", | ||
"@react-md/typography": "^2.0.0-alpha.11", | ||
"@react-md/utils": "^2.0.0-alpha.11", | ||
"@react-md/app-bar": "^2.0.0-alpha.12", | ||
"@react-md/button": "^2.0.0-alpha.12", | ||
"@react-md/divider": "^2.0.0-alpha.12", | ||
"@react-md/elevation": "^2.0.0-alpha.12", | ||
"@react-md/icon": "^2.0.0-alpha.12", | ||
"@react-md/list": "^2.0.0-alpha.12", | ||
"@react-md/states": "^2.0.0-alpha.12", | ||
"@react-md/theme": "^2.0.0-alpha.12", | ||
"@react-md/typography": "^2.0.0-alpha.12", | ||
"@react-md/utils": "^2.0.0-alpha.12", | ||
"classnames": "^2.2.6" | ||
@@ -63,3 +63,3 @@ }, | ||
}, | ||
"gitHead": "740017d534dece692a4520df98de74df4d2e55c7" | ||
"gitHead": "b31afe8dc076cf0647ac3e99dc0b61f8f4b7b0e2" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
676678
4871