UNPKG

mat-ripple

Version:
95 lines (94 loc) 4.2 kB
import { RippleRef } from './ripple-ref'; import { RippleAnimationConfig, RippleGlobalOptions, RippleTarget } from './Interfaces'; import { RippleConfig } from './Types'; export declare class Ripple extends HTMLElement implements RippleTarget { /** * Return an array containing the names of the attributes to be observed. */ static readonly observedAttributes: string[]; /** Set custom color for all ripples. */ /** Get custom color for all ripples. */ color: string; /** Set whether the ripples should be visible outside the component's bounds. */ /** Get whether the ripples should be visible outside the component's bounds. */ unbounded: boolean; /** * Set whether the ripple always originates from the center of the host element's bounds, rather * than originating from the location of the click event. */ /** * Get whether the ripple always originates from the center of the host element's bounds, rather * than originating from the location of the click event. */ centered: boolean; /** * If set, the radius in pixels of foreground ripples when fully expanded. If unset, the radius * will be the distance from the center of the ripple to the furthest corner of the host element's * bounding rectangle. */ radius: number; /** * Configuration for the ripple animation. Allows modifying the enter and exit animation * duration of the ripples. */ /** Returns the enter and exit animation duration of the ripples. */ animation: RippleAnimationConfig; /** Set whether click events will not trigger the ripple. */ /** Get whether click events will not trigger the ripple. */ disabled: boolean; /** The element that triggers the ripple when click events are received. */ trigger: HTMLElement; /** * Ripple configuration values. * Implemented as part of RippleTarget */ readonly rippleConfig: RippleConfig; /** * Whether ripples on pointer-down are disabled or not. * Implemented as part of RippleTarget */ readonly rippleDisabled: boolean; constructor(globalOptions?: RippleGlobalOptions); private _color; private _unbounded; private _centered; private _radius; private _animation; private _disabled; private _trigger; /** Renderer for the ripple DOM manipulations. */ private _rippleRenderer; /** Options that are set globally for all ripples. */ private _globalOptions; /** Whether ripple directive is initialized and the input bindings are set. */ private _isInitialized; /** The element that triggers the ripple when click events are received. */ private _elementRef; /** Callback to fire when an attribute changes. */ attributeChangedCallback(name: string, oldValue: any, newValue: any): void; /** Function invoked each time the custom element is appended into a document-connected element */ connectedCallback(): void; /** Function is invoked each time the custom element is disconnected from the document's DOM. */ disconnectedCallback(): void; /** Fades out all currently showing ripple elements. */ fadeOutAll(): void; /** * Launches a manual ripple using the specified ripple configuration. * @param config Configuration for the manual ripple. */ launch(config: RippleConfig): RippleRef; /** * Launches a manual ripple at the specified coordinates within the element. * @param x Coordinate within the element, along the X axis at which to fade-in the ripple. * @param y Coordinate within the element, along the Y axis at which to fade-in the ripple. * @param config Optional ripple configuration for the manual ripple. */ launch(x: number, y: number, config?: RippleConfig): RippleRef; /** Sets up the trigger event listeners if ripples are enabled. */ private _setupTriggerEventsIfEnabled; /** * Function to creat the `template` for the Ripple and * attaching the shadow DOM to the root */ private _setup; }