@material/drawer
Advanced tools
Comparing version 15.0.0-canary.c0a11ef0d.0 to 15.0.0-canary.c0d21ecc9.0
@@ -6,4 +6,4 @@ # Change Log | ||
# [15.0.0-canary.c0a11ef0d.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.c0a11ef0d.0) (2022-05-18) | ||
# [15.0.0-canary.c0d21ecc9.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.c0d21ecc9.0) (2023-10-09) | ||
**Note:** Version bump only for package @material/drawer |
@@ -32,3 +32,3 @@ /** | ||
export declare class MDCDrawer extends MDCComponent<MDCDismissibleDrawerFoundation> { | ||
static attachTo(root: Element): MDCDrawer; | ||
static attachTo(root: HTMLElement): MDCDrawer; | ||
/** | ||
@@ -35,0 +35,0 @@ * @return boolean Proxies to the foundation's `open`/`close` methods. |
@@ -91,12 +91,13 @@ /** | ||
this.handleScrimClick = function () { | ||
return _this.foundation.handleScrimClick(); | ||
_this.foundation.handleScrimClick(); | ||
}; | ||
this.scrim.addEventListener('click', this.handleScrimClick); | ||
this.focusTrap = util.createFocusTrapInstance(this.root, this.focusTrapFactory); | ||
this.focusTrap = | ||
util.createFocusTrapInstance(this.root, this.focusTrapFactory); | ||
} | ||
this.handleKeydown = function (evt) { | ||
_this.foundation.handleKeydown(evt); | ||
this.handleKeydown = function (event) { | ||
_this.foundation.handleKeydown(event); | ||
}; | ||
this.handleTransitionEnd = function (evt) { | ||
_this.foundation.handleTransitionEnd(evt); | ||
this.handleTransitionEnd = function (event) { | ||
_this.foundation.handleTransitionEnd(event); | ||
}; | ||
@@ -103,0 +104,0 @@ this.listen('keydown', this.handleKeydown); |
@@ -25,2 +25,3 @@ /** | ||
import { MDCDrawerAdapter } from '../adapter'; | ||
/** MDC Dismissible Drawer Foundation */ | ||
export declare class MDCDismissibleDrawerFoundation extends MDCFoundation<MDCDrawerAdapter> { | ||
@@ -75,7 +76,7 @@ static get strings(): { | ||
*/ | ||
handleKeydown(evt: KeyboardEvent): void; | ||
handleKeydown(event: KeyboardEvent): void; | ||
/** | ||
* Handles the `transitionend` event when the drawer finishes opening/closing. | ||
*/ | ||
handleTransitionEnd(evt: TransitionEvent): void; | ||
handleTransitionEnd(event: TransitionEvent): void; | ||
/** | ||
@@ -90,3 +91,4 @@ * Extension point for when drawer finishes open animation. | ||
/** | ||
* Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior. | ||
* Runs the given logic on the next animation frame, using setTimeout to | ||
* factor in Firefox reflow behavior. | ||
*/ | ||
@@ -93,0 +95,0 @@ private runNextAnimationFrame; |
@@ -26,2 +26,3 @@ /** | ||
import { cssClasses, strings } from '../constants'; | ||
/** MDC Dismissible Drawer Foundation */ | ||
var MDCDismissibleDrawerFoundation = /** @class */ (function (_super) { | ||
@@ -88,3 +89,4 @@ __extends(MDCDismissibleDrawerFoundation, _super); | ||
this.adapter.addClass(cssClasses.ANIMATE); | ||
// Wait a frame once display is no longer "none", to establish basis for animation | ||
// Wait a frame once display is no longer "none", to establish basis for | ||
// animation | ||
this.runNextAnimationFrame(function () { | ||
@@ -129,4 +131,4 @@ _this.adapter.addClass(cssClasses.OPENING); | ||
*/ | ||
MDCDismissibleDrawerFoundation.prototype.handleKeydown = function (evt) { | ||
var keyCode = evt.keyCode, key = evt.key; | ||
MDCDismissibleDrawerFoundation.prototype.handleKeydown = function (event) { | ||
var keyCode = event.keyCode, key = event.key; | ||
var isEscape = key === 'Escape' || keyCode === 27; | ||
@@ -140,7 +142,8 @@ if (isEscape) { | ||
*/ | ||
MDCDismissibleDrawerFoundation.prototype.handleTransitionEnd = function (evt) { | ||
MDCDismissibleDrawerFoundation.prototype.handleTransitionEnd = function (event) { | ||
var OPENING = cssClasses.OPENING, CLOSING = cssClasses.CLOSING, OPEN = cssClasses.OPEN, ANIMATE = cssClasses.ANIMATE, ROOT = cssClasses.ROOT; | ||
// In Edge, transitionend on ripple pseudo-elements yields a target without classList, so check for Element first. | ||
var isRootElement = this.isElement(evt.target) && | ||
this.adapter.elementHasClass(evt.target, ROOT); | ||
// In Edge, transitionend on ripple pseudo-elements yields a target without | ||
// classList, so check for Element first. | ||
var isRootElement = this.isElement(event.target) && | ||
this.adapter.elementHasClass(event.target, ROOT); | ||
if (!isRootElement) { | ||
@@ -173,3 +176,4 @@ return; | ||
/** | ||
* Runs the given logic on the next animation frame, using setTimeout to factor in Firefox reflow behavior. | ||
* Runs the given logic on the next animation frame, using setTimeout to | ||
* factor in Firefox reflow behavior. | ||
*/ | ||
@@ -186,3 +190,4 @@ MDCDismissibleDrawerFoundation.prototype.runNextAnimationFrame = function (callback) { | ||
MDCDismissibleDrawerFoundation.prototype.isElement = function (element) { | ||
// In Edge, transitionend on ripple pseudo-elements yields a target without classList. | ||
// In Edge, transitionend on ripple pseudo-elements yields a target without | ||
// classList. | ||
return Boolean(element.classList); | ||
@@ -189,0 +194,0 @@ }; |
{ | ||
"name": "@material/drawer", | ||
"version": "15.0.0-canary.c0a11ef0d.0", | ||
"version": "15.0.0-canary.c0d21ecc9.0", | ||
"description": "The Material Components Web drawer component", | ||
@@ -21,16 +21,16 @@ "license": "MIT", | ||
"dependencies": { | ||
"@material/animation": "15.0.0-canary.c0a11ef0d.0", | ||
"@material/base": "15.0.0-canary.c0a11ef0d.0", | ||
"@material/dom": "15.0.0-canary.c0a11ef0d.0", | ||
"@material/elevation": "15.0.0-canary.c0a11ef0d.0", | ||
"@material/feature-targeting": "15.0.0-canary.c0a11ef0d.0", | ||
"@material/list": "15.0.0-canary.c0a11ef0d.0", | ||
"@material/ripple": "15.0.0-canary.c0a11ef0d.0", | ||
"@material/rtl": "15.0.0-canary.c0a11ef0d.0", | ||
"@material/shape": "15.0.0-canary.c0a11ef0d.0", | ||
"@material/theme": "15.0.0-canary.c0a11ef0d.0", | ||
"@material/typography": "15.0.0-canary.c0a11ef0d.0", | ||
"@material/animation": "15.0.0-canary.c0d21ecc9.0", | ||
"@material/base": "15.0.0-canary.c0d21ecc9.0", | ||
"@material/dom": "15.0.0-canary.c0d21ecc9.0", | ||
"@material/elevation": "15.0.0-canary.c0d21ecc9.0", | ||
"@material/feature-targeting": "15.0.0-canary.c0d21ecc9.0", | ||
"@material/list": "15.0.0-canary.c0d21ecc9.0", | ||
"@material/ripple": "15.0.0-canary.c0d21ecc9.0", | ||
"@material/rtl": "15.0.0-canary.c0d21ecc9.0", | ||
"@material/shape": "15.0.0-canary.c0d21ecc9.0", | ||
"@material/theme": "15.0.0-canary.c0d21ecc9.0", | ||
"@material/typography": "15.0.0-canary.c0d21ecc9.0", | ||
"tslib": "^2.1.0" | ||
}, | ||
"gitHead": "a97df68c1dadba0530f5fcda79fb8bc3082d963a" | ||
"gitHead": "0a932ea790a12d359ce4ec7c5c4c7aec7edf565d" | ||
} |
@@ -66,3 +66,3 @@ <!--docs: | ||
import {MDCList} from "@material/list"; | ||
const list = MDCList.attachTo(document.querySelector('.mdc-deprecated-list')); | ||
const list = MDCList.attachTo(document.querySelector<HTMLElement>('.mdc-deprecated-list')); | ||
list.wrapFocus = true; | ||
@@ -75,3 +75,3 @@ ``` | ||
import {MDCDrawer} from "@material/drawer"; | ||
const drawer = MDCDrawer.attachTo(document.querySelector('.mdc-drawer')); | ||
const drawer = MDCDrawer.attachTo(document.querySelector<HTMLElement>('.mdc-drawer')); | ||
``` | ||
@@ -102,11 +102,11 @@ | ||
```js | ||
const listEl = document.querySelector('.mdc-drawer .mdc-deprecated-list'); | ||
const mainContentEl = document.querySelector('.main-content'); | ||
const listEl = document.querySelector<HTMLElement>('.mdc-drawer .mdc-deprecated-list'); | ||
const mainContentEl = document.querySelector<HTMLElement>('.main-content'); | ||
listEl.addEventListener('click', (event) => { | ||
mainContentEl.querySelector('input, button').focus(); | ||
mainContentEl.querySelector<HTMLElement>('input, button').focus(); | ||
}); | ||
document.body.addEventListener('MDCDrawer:closed', () => { | ||
mainContentEl.querySelector('input, button').focus(); | ||
mainContentEl.querySelector<HTMLElement>('input, button').focus(); | ||
}); | ||
@@ -120,4 +120,4 @@ ``` | ||
```js | ||
const listEl = document.querySelector('.mdc-drawer .mdc-deprecated-list'); | ||
const mainContentEl = document.querySelector('.main-content'); | ||
const listEl = document.querySelector<HTMLElement>('.mdc-drawer .mdc-deprecated-list'); | ||
const mainContentEl = document.querySelector<HTMLElement>('.main-content'); | ||
@@ -129,3 +129,3 @@ listEl.addEventListener('click', (event) => { | ||
document.body.addEventListener('MDCDrawer:closed', () => { | ||
mainContentEl.querySelector('input, button').focus(); | ||
mainContentEl.querySelector<HTMLElement>('input, button').focus(); | ||
}); | ||
@@ -512,5 +512,5 @@ ``` | ||
--- | --- | ||
`emit(evtType: string, evtData: T, shouldBubble?: boolean) => void` | Fires a cross-browser-compatible custom event from the component root of the given type, with the given data. | ||
`listen(evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions \| boolean) => void` | Wrapper method to add an event listener to the component's root element. This is most useful when listening for custom events. | ||
`unlisten(evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions \| boolean) => void` | Wrapper method to remove an event listener to the component's root element. This is most useful when unlistening for custom events. | ||
`emit(eventType: string, eventData: T, shouldBubble?: boolean) => void` | Fires a cross-browser-compatible custom event from the component root of the given type, with the given data. | ||
`listen(eventType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions \| boolean) => void` | Wrapper method to add an event listener to the component's root element. This is most useful when listening for custom events. | ||
`unlisten(eventType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions \| boolean) => void` | Wrapper method to remove an event listener to the component's root element. This is most useful when unlistening for custom events. | ||
@@ -557,4 +557,4 @@ #### Properties | ||
`close() => void` | Closes the drawer from the open state. | ||
`handleKeydown(evt: KeyboardEvent) => void` | Keydown handler to close drawer when key is escape. | ||
`handleTransitionEnd(evt: TransitionEvent) => void` | Handles the `transitionend` event when the drawer finishes opening/closing. | ||
`handleKeydown(event: KeyboardEvent) => void` | Keydown handler to close drawer when key is escape. | ||
`handleTransitionEnd(event: TransitionEvent) => void` | Handles the `transitionend` event when the drawer finishes opening/closing. | ||
`closed_() => void` | Extension point for when drawer finishes close animation. | ||
@@ -574,5 +574,5 @@ `isClosing() => boolean` | Returns true if the drawer is animating closed. | ||
`close() => void` | Closes the drawer from the open state. | ||
`handleKeydown(evt: KeyboardEvent) => void` | Keydown handler to close drawer when key is escape. | ||
`handleKeydown(event: KeyboardEvent) => void` | Keydown handler to close drawer when key is escape. | ||
`handleScrimClick() => void` | Handles click event on scrim. | ||
`handleTransitionEnd(evt: TransitionEvent) => void` | Handles the `transitionend` event when the drawer finishes opening/closing. | ||
`handleTransitionEnd(event: TransitionEvent) => void` | Handles the `transitionend` event when the drawer finishes opening/closing. | ||
`closed_() => void` | Called when drawer finishes close animation. | ||
@@ -579,0 +579,0 @@ `isClosing() => boolean` | Returns true if the drawer is animating closed. |
@@ -24,3 +24,4 @@ /** | ||
import { FocusOptions, FocusTrap } from '@material/dom/focus-trap'; | ||
/** MDC Drawer Focus Trap Factory */ | ||
export declare type MDCDrawerFocusTrapFactory = (element: HTMLElement, options: FocusOptions) => FocusTrap; | ||
export declare function createFocusTrapInstance(surfaceEl: HTMLElement, focusTrapFactory: MDCDrawerFocusTrapFactory): FocusTrap; |
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 too big to display
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 too big to display
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
1326698
8131
+ Added@material/animation@15.0.0-canary.c0d21ecc9.0(transitive)
+ Added@material/base@15.0.0-canary.c0d21ecc9.0(transitive)
+ Added@material/density@15.0.0-canary.c0d21ecc9.0(transitive)
+ Added@material/dom@15.0.0-canary.c0d21ecc9.0(transitive)
+ Added@material/elevation@15.0.0-canary.c0d21ecc9.0(transitive)
+ Added@material/feature-targeting@15.0.0-canary.c0d21ecc9.0(transitive)
+ Added@material/list@15.0.0-canary.c0d21ecc9.0(transitive)
+ Added@material/ripple@15.0.0-canary.c0d21ecc9.0(transitive)
+ Added@material/rtl@15.0.0-canary.c0d21ecc9.0(transitive)
+ Added@material/shape@15.0.0-canary.c0d21ecc9.0(transitive)
+ Added@material/theme@15.0.0-canary.c0d21ecc9.0(transitive)
+ Added@material/tokens@15.0.0-canary.c0d21ecc9.0(transitive)
+ Added@material/typography@15.0.0-canary.c0d21ecc9.0(transitive)
- Removed@material/animation@15.0.0-canary.c0a11ef0d.0(transitive)
- Removed@material/base@15.0.0-canary.c0a11ef0d.0(transitive)
- Removed@material/density@15.0.0-canary.c0a11ef0d.0(transitive)
- Removed@material/dom@15.0.0-canary.c0a11ef0d.0(transitive)
- Removed@material/elevation@15.0.0-canary.c0a11ef0d.0(transitive)
- Removed@material/feature-targeting@15.0.0-canary.c0a11ef0d.0(transitive)
- Removed@material/list@15.0.0-canary.c0a11ef0d.0(transitive)
- Removed@material/ripple@15.0.0-canary.c0a11ef0d.0(transitive)
- Removed@material/rtl@15.0.0-canary.c0a11ef0d.0(transitive)
- Removed@material/shape@15.0.0-canary.c0a11ef0d.0(transitive)
- Removed@material/theme@15.0.0-canary.c0a11ef0d.0(transitive)
- Removed@material/typography@15.0.0-canary.c0a11ef0d.0(transitive)
Updated@material/feature-targeting@15.0.0-canary.c0d21ecc9.0