@material/base
Advanced tools
Comparing version 15.0.0-canary.23073a303.0 to 15.0.0-canary.2528c1c3b.0
@@ -6,3 +6,3 @@ # Change Log | ||
# [15.0.0-canary.23073a303.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.23073a303.0) (2023-03-10) | ||
# [15.0.0-canary.2528c1c3b.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.2528c1c3b.0) (2023-09-20) | ||
@@ -9,0 +9,0 @@ |
@@ -39,4 +39,4 @@ /** | ||
*/ | ||
listen<K extends EventType>(evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void; | ||
listen<E extends Event>(evtType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void; | ||
listen<K extends EventType>(eventType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void; | ||
listen<E extends Event>(eventType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void; | ||
/** | ||
@@ -46,4 +46,4 @@ * Wrapper method to remove an event listener to the component's root element. | ||
*/ | ||
unlisten<K extends EventType>(evtType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void; | ||
unlisten<E extends Event>(evtType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void; | ||
unlisten<K extends EventType>(eventType: K, handler: SpecificEventListener<K>, options?: AddEventListenerOptions | boolean): void; | ||
unlisten<E extends Event>(eventType: string, handler: CustomEventListener<E>, options?: AddEventListenerOptions | boolean): void; | ||
/** | ||
@@ -53,3 +53,3 @@ * Fires a cross-browser-compatible custom event from the component root of | ||
*/ | ||
emit<T extends object>(evtType: string, evtData: T, shouldBubble?: boolean): void; | ||
emit<T extends object>(eventType: string, eventData: T, shouldBubble?: boolean): void; | ||
/** | ||
@@ -56,0 +56,0 @@ * This is a intermediate fix to allow components to use safevalues. This |
@@ -89,7 +89,7 @@ /** | ||
}; | ||
MDCComponent.prototype.listen = function (evtType, handler, options) { | ||
this.root.addEventListener(evtType, handler, options); | ||
MDCComponent.prototype.listen = function (eventType, handler, options) { | ||
this.root.addEventListener(eventType, handler, options); | ||
}; | ||
MDCComponent.prototype.unlisten = function (evtType, handler, options) { | ||
this.root.removeEventListener(evtType, handler, options); | ||
MDCComponent.prototype.unlisten = function (eventType, handler, options) { | ||
this.root.removeEventListener(eventType, handler, options); | ||
}; | ||
@@ -100,16 +100,16 @@ /** | ||
*/ | ||
MDCComponent.prototype.emit = function (evtType, evtData, shouldBubble) { | ||
MDCComponent.prototype.emit = function (eventType, eventData, shouldBubble) { | ||
if (shouldBubble === void 0) { shouldBubble = false; } | ||
var evt; | ||
var event; | ||
if (typeof CustomEvent === 'function') { | ||
evt = new CustomEvent(evtType, { | ||
event = new CustomEvent(eventType, { | ||
bubbles: shouldBubble, | ||
detail: evtData, | ||
detail: eventData, | ||
}); | ||
} | ||
else { | ||
evt = document.createEvent('CustomEvent'); | ||
evt.initCustomEvent(evtType, shouldBubble, false, evtData); | ||
event = document.createEvent('CustomEvent'); | ||
event.initCustomEvent(eventType, shouldBubble, false, eventData); | ||
} | ||
this.root.dispatchEvent(evt); | ||
this.root.dispatchEvent(event); | ||
}; | ||
@@ -116,0 +116,0 @@ /** |
{ | ||
"name": "@material/base", | ||
"description": "The set of base classes for Material Components for the web", | ||
"version": "15.0.0-canary.23073a303.0", | ||
"version": "15.0.0-canary.2528c1c3b.0", | ||
"license": "MIT", | ||
@@ -17,3 +17,3 @@ "main": "dist/mdc.base.js", | ||
}, | ||
"gitHead": "2d7826e2ebf1c1fde12f47b603e66ec0df229a8f" | ||
"gitHead": "98b5b57bd5356f48610a254e8c4acff388d5fb7b" | ||
} |
@@ -24,6 +24,6 @@ /** | ||
export declare type EventType = keyof GlobalEventHandlersEventMap; | ||
export declare type SpecificEventListener<K extends EventType> = (evt: GlobalEventHandlersEventMap[K]) => void; | ||
export declare type CustomEventListener<E extends Event> = (evt: E) => void; | ||
export declare type SpecificEventListener<K extends EventType> = (event: GlobalEventHandlersEventMap[K]) => void; | ||
export declare type CustomEventListener<E extends Event> = (event: E) => void; | ||
export declare type WindowEventType = keyof WindowEventMap; | ||
export declare type SpecificWindowEventListener<K extends WindowEventType> = (evt: WindowEventMap[K]) => void; | ||
export declare type SpecificWindowEventListener<K extends WindowEventType> = (event: WindowEventMap[K]) => void; | ||
/** | ||
@@ -30,0 +30,0 @@ * A generic type for the constructor of an instance type. Note that this type |
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
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
472589