@material/mwc-base
Advanced tools
Comparing version 0.13.0 to 0.14.0-canary.f790f713.0
@@ -20,5 +20,5 @@ /** | ||
import { Constructor } from './utils.js'; | ||
export { CustomEventListener, EventType, SpecificEventListener } from '@material/base/types.js'; | ||
export { observer } from './observer.js'; | ||
export { addHasRemoveClass } from './utils.js'; | ||
export * from '@material/base/types.js'; | ||
export declare abstract class BaseElement extends LitElement { | ||
@@ -34,7 +34,7 @@ /** | ||
*/ | ||
protected abstract readonly mdcFoundationClass: Constructor<MDCFoundation>; | ||
protected abstract readonly mdcFoundationClass?: Constructor<MDCFoundation>; | ||
/** | ||
* An instance of the MDC Foundation class to attach to the root element | ||
*/ | ||
protected abstract mdcFoundation: MDCFoundation; | ||
protected abstract mdcFoundation?: MDCFoundation; | ||
/** | ||
@@ -41,0 +41,0 @@ * Create the adapter for the `mdcFoundation`. |
@@ -28,4 +28,6 @@ /** | ||
} | ||
this.mdcFoundation = new this.mdcFoundationClass(this.createAdapter()); | ||
this.mdcFoundation.init(); | ||
if (this.mdcFoundationClass) { | ||
this.mdcFoundation = new this.mdcFoundationClass(this.createAdapter()); | ||
this.mdcFoundation.init(); | ||
} | ||
} | ||
@@ -32,0 +34,0 @@ firstUpdated() { |
@@ -17,8 +17,13 @@ /** | ||
*/ | ||
import { MDCRippleFoundation } from '@material/ripple/foundation.js'; | ||
import { BaseElement } from './base-element'; | ||
export * from './base-element'; | ||
import { addHasRemoveClass, BaseElement, CustomEventListener, EventType, observer, SpecificEventListener } from './base-element'; | ||
export { addHasRemoveClass, BaseElement, CustomEventListener, EventType, observer, SpecificEventListener }; | ||
export interface HTMLElementWithRipple extends HTMLElement { | ||
ripple?: MDCRippleFoundation; | ||
ripple?: RippleInterface; | ||
} | ||
export interface RippleInterface { | ||
activate: (e?: Event) => void; | ||
deactivate: () => void; | ||
handleFocus: () => void; | ||
handleBlur: () => void; | ||
} | ||
export declare abstract class FormElement extends BaseElement { | ||
@@ -35,3 +40,3 @@ /** | ||
*/ | ||
readonly ripple?: MDCRippleFoundation; | ||
readonly ripple?: RippleInterface; | ||
click(): void; | ||
@@ -38,0 +43,0 @@ setAriaLabel(label: string): void; |
@@ -17,4 +17,4 @@ /** | ||
*/ | ||
import { BaseElement } from './base-element'; | ||
export * from './base-element'; | ||
import { addHasRemoveClass, BaseElement, observer } from './base-element'; | ||
export { addHasRemoveClass, BaseElement, observer }; | ||
export class FormElement extends BaseElement { | ||
@@ -21,0 +21,0 @@ createRenderRoot() { |
{ | ||
"name": "@material/mwc-base", | ||
"version": "0.13.0", | ||
"version": "0.14.0-canary.f790f713.0", | ||
"description": "", | ||
@@ -12,5 +12,5 @@ "repository": { | ||
"dependencies": { | ||
"@material/base": "=5.0.0-canary.a1a0deb3e.0", | ||
"@material/dom": "=5.0.0-canary.a1a0deb3e.0", | ||
"@material/ripple": "=5.0.0-canary.a1a0deb3e.0", | ||
"@material/base": "=6.0.0-canary.781434a92.0", | ||
"@material/dom": "=6.0.0-canary.781434a92.0", | ||
"@material/ripple": "=6.0.0-canary.781434a92.0", | ||
"lit-element": "^2.2.1", | ||
@@ -25,3 +25,3 @@ "tslib": "^1.10.0" | ||
}, | ||
"gitHead": "054d0d234704a274e8aaf7d8a8a0399f525914eb" | ||
"gitHead": "4ccf0f734c9b727a925e62b9999d4380351c7936" | ||
} |
@@ -22,5 +22,6 @@ /** | ||
import {Constructor} from './utils.js'; | ||
export {CustomEventListener, EventType, SpecificEventListener} from '@material/base/types.js'; | ||
export {observer} from './observer.js'; | ||
export {addHasRemoveClass} from './utils.js'; | ||
export * from '@material/base/types.js'; | ||
@@ -38,3 +39,3 @@ export abstract class BaseElement extends LitElement { | ||
*/ | ||
protected abstract readonly mdcFoundationClass: Constructor<MDCFoundation>; | ||
protected abstract readonly mdcFoundationClass?: Constructor<MDCFoundation>; | ||
@@ -44,3 +45,3 @@ /** | ||
*/ | ||
protected abstract mdcFoundation: MDCFoundation; | ||
protected abstract mdcFoundation?: MDCFoundation; | ||
@@ -67,4 +68,6 @@ /** | ||
} | ||
this.mdcFoundation = new this.mdcFoundationClass(this.createAdapter()); | ||
this.mdcFoundation.init(); | ||
if (this.mdcFoundationClass) { | ||
this.mdcFoundation = new this.mdcFoundationClass(this.createAdapter()); | ||
this.mdcFoundation.init(); | ||
} | ||
} | ||
@@ -71,0 +74,0 @@ |
@@ -18,12 +18,24 @@ /** | ||
import {MDCRippleFoundation} from '@material/ripple/foundation.js'; | ||
import {addHasRemoveClass, BaseElement, CustomEventListener, EventType, observer, SpecificEventListener} from './base-element'; | ||
import {BaseElement} from './base-element'; | ||
export { | ||
addHasRemoveClass, | ||
BaseElement, | ||
CustomEventListener, | ||
EventType, | ||
observer, | ||
SpecificEventListener | ||
}; | ||
export * from './base-element'; | ||
export interface HTMLElementWithRipple extends HTMLElement { | ||
ripple?: MDCRippleFoundation; | ||
ripple?: RippleInterface; | ||
} | ||
export interface RippleInterface { | ||
activate: (e?: Event) => void; | ||
deactivate: () => void; | ||
handleFocus: () => void; | ||
handleBlur: () => void; | ||
} | ||
export abstract class FormElement extends BaseElement { | ||
@@ -44,3 +56,3 @@ /** | ||
*/ | ||
readonly ripple?: MDCRippleFoundation; | ||
readonly ripple?: RippleInterface; | ||
@@ -47,0 +59,0 @@ click() { |
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
52822
617