@material/menu-surface
Advanced tools
Comparing version 1.0.0-0 to 1.0.0-1
@@ -32,3 +32,2 @@ /** | ||
var _this = _super !== null && _super.apply(this, arguments) || this; | ||
_this.anchorElement = null; | ||
_this.previousFocus_ = null; | ||
@@ -45,5 +44,3 @@ _this.firstFocusableElement_ = null; | ||
var parentEl = this.root_.parentElement; | ||
if (parentEl && parentEl.classList.contains(cssClasses.ANCHOR)) { | ||
this.anchorElement = parentEl; | ||
} | ||
this.anchorElement = parentEl && parentEl.classList.contains(cssClasses.ANCHOR) ? parentEl : null; | ||
if (this.root_.classList.contains(cssClasses.FIXED)) { | ||
@@ -50,0 +47,0 @@ this.setFixedPosition(true); |
@@ -6,3 +6,3 @@ // Generated by dts-bundle v0.7.3 | ||
declare module 'mdc-menu-surface' { | ||
declare module '@material/menu-surface' { | ||
/** | ||
@@ -30,12 +30,12 @@ * @license | ||
*/ | ||
import * as util from 'mdc-menu-surface/util'; | ||
export { Corner, CornerBit } from 'mdc-menu-surface/constants'; | ||
import * as util from '@material/menu-surface/util'; | ||
export { Corner, CornerBit } from '@material/menu-surface/constants'; | ||
export { util }; | ||
export * from 'mdc-menu-surface/adapter'; | ||
export * from 'mdc-menu-surface/component'; | ||
export * from 'mdc-menu-surface/foundation'; | ||
export * from 'mdc-menu-surface/types'; | ||
export * from '@material/menu-surface/adapter'; | ||
export * from '@material/menu-surface/component'; | ||
export * from '@material/menu-surface/foundation'; | ||
export * from '@material/menu-surface/types'; | ||
} | ||
declare module 'mdc-menu-surface/util' { | ||
declare module '@material/menu-surface/util' { | ||
/** | ||
@@ -71,3 +71,3 @@ * @license | ||
declare module 'mdc-menu-surface/constants' { | ||
declare module '@material/menu-surface/constants' { | ||
/** | ||
@@ -147,3 +147,3 @@ * @license | ||
declare module 'mdc-menu-surface/adapter' { | ||
declare module '@material/menu-surface/adapter' { | ||
/** | ||
@@ -171,3 +171,3 @@ * @license | ||
*/ | ||
import { MDCMenuDimensions, MDCMenuDistance, MDCMenuPoint } from 'mdc-menu-surface/types'; | ||
import { MDCMenuDimensions, MDCMenuDistance, MDCMenuPoint } from '@material/menu-surface/types'; | ||
/** | ||
@@ -213,3 +213,3 @@ * Defines the shape of the adapter expected by the foundation. | ||
declare module 'mdc-menu-surface/component' { | ||
declare module '@material/menu-surface/component' { | ||
/** | ||
@@ -238,5 +238,5 @@ * @license | ||
import { MDCComponent } from '@material/base/component'; | ||
import { Corner } from 'mdc-menu-surface/constants'; | ||
import { MDCMenuSurfaceFoundation } from 'mdc-menu-surface/foundation'; | ||
import { MDCMenuDistance } from 'mdc-menu-surface/types'; | ||
import { Corner } from '@material/menu-surface/constants'; | ||
import { MDCMenuSurfaceFoundation } from '@material/menu-surface/foundation'; | ||
import { MDCMenuDistance } from '@material/menu-surface/types'; | ||
export type MDCMenuSurfaceFactory = (el: Element, foundation?: MDCMenuSurfaceFoundation) => MDCMenuSurface; | ||
@@ -273,3 +273,3 @@ export class MDCMenuSurface extends MDCComponent<MDCMenuSurfaceFoundation> { | ||
declare module 'mdc-menu-surface/foundation' { | ||
declare module '@material/menu-surface/foundation' { | ||
/** | ||
@@ -298,5 +298,5 @@ * @license | ||
import { MDCFoundation } from '@material/base/foundation'; | ||
import { MDCMenuSurfaceAdapter } from 'mdc-menu-surface/adapter'; | ||
import { Corner } from 'mdc-menu-surface/constants'; | ||
import { MDCMenuDistance } from 'mdc-menu-surface/types'; | ||
import { MDCMenuSurfaceAdapter } from '@material/menu-surface/adapter'; | ||
import { Corner } from '@material/menu-surface/constants'; | ||
import { MDCMenuDistance } from '@material/menu-surface/types'; | ||
export class MDCMenuSurfaceFoundation extends MDCFoundation<MDCMenuSurfaceAdapter> { | ||
@@ -362,3 +362,3 @@ static readonly cssClasses: { | ||
declare module 'mdc-menu-surface/types' { | ||
declare module '@material/menu-surface/types' { | ||
/** | ||
@@ -365,0 +365,0 @@ * @license |
@@ -188,3 +188,3 @@ /*! | ||
*/ | ||
Object.defineProperty(e,"__esModule",{value:!0});var o=n(24),r=n(1),i=n(13),s=n(19),a=n(29),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.anchorElement=null,e.previousFocus_=null,e.firstFocusableElement_=null,e.lastFocusableElement_=null,e}return o.__extends(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this,e=this.root_.parentElement;e&&e.classList.contains(i.cssClasses.ANCHOR)&&(this.anchorElement=e),this.root_.classList.contains(i.cssClasses.FIXED)&&this.setFixedPosition(!0),this.handleKeydown_=function(e){return t.foundation_.handleKeydown(e)},this.handleBodyClick_=function(e){return t.foundation_.handleBodyClick(e)},this.registerBodyClickListener_=function(){return document.body.addEventListener("click",t.handleBodyClick_)},this.deregisterBodyClickListener_=function(){return document.body.removeEventListener("click",t.handleBodyClick_)},this.listen("keydown",this.handleKeydown_),this.listen(i.strings.OPENED_EVENT,this.registerBodyClickListener_),this.listen(i.strings.CLOSED_EVENT,this.deregisterBodyClickListener_)},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten(i.strings.OPENED_EVENT,this.registerBodyClickListener_),this.unlisten(i.strings.CLOSED_EVENT,this.deregisterBodyClickListener_),t.prototype.destroy.call(this)},Object.defineProperty(e.prototype,"open",{get:function(){return this.foundation_.isOpen()},set:function(t){if(t){var e=this.root_.querySelectorAll(i.strings.FOCUSABLE_ELEMENTS);this.firstFocusableElement_=e[0]||null,this.lastFocusableElement_=e[e.length-1]||null,this.foundation_.open()}else this.foundation_.close()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.foundation_.setQuickOpen(t)},enumerable:!0,configurable:!0}),e.prototype.hoistMenuToBody=function(){document.body.appendChild(this.root_),this.setIsHoisted(!0)},e.prototype.setIsHoisted=function(t){this.foundation_.setIsHoisted(t)},e.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},e.prototype.setFixedPosition=function(t){t?this.root_.classList.add(i.cssClasses.FIXED):this.root_.classList.remove(i.cssClasses.FIXED),this.foundation_.setFixedPosition(t)},e.prototype.setAbsolutePosition=function(t,e){this.foundation_.setAbsolutePosition(t,e),this.setIsHoisted(!0)},e.prototype.setAnchorCorner=function(t){this.foundation_.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.foundation_.setAnchorMargin(t)},e.prototype.getDefaultFoundation=function(){var t=this,e={addClass:function(e){return t.root_.classList.add(e)},removeClass:function(e){return t.root_.classList.remove(e)},hasClass:function(e){return t.root_.classList.contains(e)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit(s.MDCMenuSurfaceFoundation.strings.CLOSED_EVENT,{})},notifyOpen:function(){return t.emit(s.MDCMenuSurfaceFoundation.strings.OPENED_EVENT,{})},isElementInContainer:function(e){return t.root_.contains(e)},isRtl:function(){return"rtl"===getComputedStyle(t.root_).getPropertyValue("direction")},setTransformOrigin:function(e){var n=a.getTransformPropertyName(window)+"-origin";t.root_.style.setProperty(n,e)},isFocused:function(){return document.activeElement===t.root_},saveFocus:function(){t.previousFocus_=document.activeElement},restoreFocus:function(){t.root_.contains(document.activeElement)&&t.previousFocus_&&t.previousFocus_.focus&&t.previousFocus_.focus()},isFirstElementFocused:function(){return!!t.firstFocusableElement_&&t.firstFocusableElement_===document.activeElement},isLastElementFocused:function(){return!!t.lastFocusableElement_&&t.lastFocusableElement_===document.activeElement},focusFirstElement:function(){return t.firstFocusableElement_&&t.firstFocusableElement_.focus&&t.firstFocusableElement_.focus()},focusLastElement:function(){return t.lastFocusableElement_&&t.lastFocusableElement_.focus&&t.lastFocusableElement_.focus()},getInnerDimensions:function(){return{width:t.root_.offsetWidth,height:t.root_.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(e){t.root_.style.left="left"in e?e.left+"px":"",t.root_.style.right="right"in e?e.right+"px":"",t.root_.style.top="top"in e?e.top+"px":"",t.root_.style.bottom="bottom"in e?e.bottom+"px":""},setMaxHeight:function(e){t.root_.style.maxHeight=e}};return new s.MDCMenuSurfaceFoundation(e)},e}(r.MDCComponent);e.MDCMenuSurface=u}})}); | ||
Object.defineProperty(e,"__esModule",{value:!0});var o=n(24),r=n(1),i=n(13),s=n(19),a=n(29),u=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.previousFocus_=null,e.firstFocusableElement_=null,e.lastFocusableElement_=null,e}return o.__extends(e,t),e.attachTo=function(t){return new e(t)},e.prototype.initialSyncWithDOM=function(){var t=this,e=this.root_.parentElement;this.anchorElement=e&&e.classList.contains(i.cssClasses.ANCHOR)?e:null,this.root_.classList.contains(i.cssClasses.FIXED)&&this.setFixedPosition(!0),this.handleKeydown_=function(e){return t.foundation_.handleKeydown(e)},this.handleBodyClick_=function(e){return t.foundation_.handleBodyClick(e)},this.registerBodyClickListener_=function(){return document.body.addEventListener("click",t.handleBodyClick_)},this.deregisterBodyClickListener_=function(){return document.body.removeEventListener("click",t.handleBodyClick_)},this.listen("keydown",this.handleKeydown_),this.listen(i.strings.OPENED_EVENT,this.registerBodyClickListener_),this.listen(i.strings.CLOSED_EVENT,this.deregisterBodyClickListener_)},e.prototype.destroy=function(){this.unlisten("keydown",this.handleKeydown_),this.unlisten(i.strings.OPENED_EVENT,this.registerBodyClickListener_),this.unlisten(i.strings.CLOSED_EVENT,this.deregisterBodyClickListener_),t.prototype.destroy.call(this)},Object.defineProperty(e.prototype,"open",{get:function(){return this.foundation_.isOpen()},set:function(t){if(t){var e=this.root_.querySelectorAll(i.strings.FOCUSABLE_ELEMENTS);this.firstFocusableElement_=e[0]||null,this.lastFocusableElement_=e[e.length-1]||null,this.foundation_.open()}else this.foundation_.close()},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"quickOpen",{set:function(t){this.foundation_.setQuickOpen(t)},enumerable:!0,configurable:!0}),e.prototype.hoistMenuToBody=function(){document.body.appendChild(this.root_),this.setIsHoisted(!0)},e.prototype.setIsHoisted=function(t){this.foundation_.setIsHoisted(t)},e.prototype.setMenuSurfaceAnchorElement=function(t){this.anchorElement=t},e.prototype.setFixedPosition=function(t){t?this.root_.classList.add(i.cssClasses.FIXED):this.root_.classList.remove(i.cssClasses.FIXED),this.foundation_.setFixedPosition(t)},e.prototype.setAbsolutePosition=function(t,e){this.foundation_.setAbsolutePosition(t,e),this.setIsHoisted(!0)},e.prototype.setAnchorCorner=function(t){this.foundation_.setAnchorCorner(t)},e.prototype.setAnchorMargin=function(t){this.foundation_.setAnchorMargin(t)},e.prototype.getDefaultFoundation=function(){var t=this,e={addClass:function(e){return t.root_.classList.add(e)},removeClass:function(e){return t.root_.classList.remove(e)},hasClass:function(e){return t.root_.classList.contains(e)},hasAnchor:function(){return!!t.anchorElement},notifyClose:function(){return t.emit(s.MDCMenuSurfaceFoundation.strings.CLOSED_EVENT,{})},notifyOpen:function(){return t.emit(s.MDCMenuSurfaceFoundation.strings.OPENED_EVENT,{})},isElementInContainer:function(e){return t.root_.contains(e)},isRtl:function(){return"rtl"===getComputedStyle(t.root_).getPropertyValue("direction")},setTransformOrigin:function(e){var n=a.getTransformPropertyName(window)+"-origin";t.root_.style.setProperty(n,e)},isFocused:function(){return document.activeElement===t.root_},saveFocus:function(){t.previousFocus_=document.activeElement},restoreFocus:function(){t.root_.contains(document.activeElement)&&t.previousFocus_&&t.previousFocus_.focus&&t.previousFocus_.focus()},isFirstElementFocused:function(){return!!t.firstFocusableElement_&&t.firstFocusableElement_===document.activeElement},isLastElementFocused:function(){return!!t.lastFocusableElement_&&t.lastFocusableElement_===document.activeElement},focusFirstElement:function(){return t.firstFocusableElement_&&t.firstFocusableElement_.focus&&t.firstFocusableElement_.focus()},focusLastElement:function(){return t.lastFocusableElement_&&t.lastFocusableElement_.focus&&t.lastFocusableElement_.focus()},getInnerDimensions:function(){return{width:t.root_.offsetWidth,height:t.root_.offsetHeight}},getAnchorDimensions:function(){return t.anchorElement?t.anchorElement.getBoundingClientRect():null},getWindowDimensions:function(){return{width:window.innerWidth,height:window.innerHeight}},getBodyDimensions:function(){return{width:document.body.clientWidth,height:document.body.clientHeight}},getWindowScroll:function(){return{x:window.pageXOffset,y:window.pageYOffset}},setPosition:function(e){t.root_.style.left="left"in e?e.left+"px":"",t.root_.style.right="right"in e?e.right+"px":"",t.root_.style.top="top"in e?e.top+"px":"",t.root_.style.bottom="bottom"in e?e.bottom+"px":""},setMaxHeight:function(e){t.root_.style.maxHeight=e}};return new s.MDCMenuSurfaceFoundation(e)},e}(r.MDCComponent);e.MDCMenuSurface=u}})}); | ||
//# sourceMappingURL=mdc.menuSurface.min.js.map |
{ | ||
"name": "@material/menu-surface", | ||
"version": "1.0.0-0", | ||
"version": "1.0.0-1", | ||
"description": "The Material Components for the web menu surface component", | ||
@@ -20,9 +20,9 @@ "license": "MIT", | ||
"dependencies": { | ||
"@material/animation": "^1.0.0-0", | ||
"@material/base": "^1.0.0-0", | ||
"@material/elevation": "^1.0.0-0", | ||
"@material/animation": "^1.0.0-1", | ||
"@material/base": "^1.0.0-1", | ||
"@material/elevation": "^1.0.0-1", | ||
"@material/feature-targeting": "^0.44.1", | ||
"@material/rtl": "^0.42.0", | ||
"@material/shape": "^1.0.0-0", | ||
"@material/theme": "^1.0.0-0", | ||
"@material/shape": "^1.0.0-1", | ||
"@material/theme": "^1.0.0-1", | ||
"tslib": "^1.9.3" | ||
@@ -29,0 +29,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
546110
3551
Updated@material/animation@^1.0.0-1
Updated@material/base@^1.0.0-1
Updated@material/elevation@^1.0.0-1
Updated@material/shape@^1.0.0-1
Updated@material/theme@^1.0.0-1