How to use the @material/line-ripple.MDCLineRippleFoundation function in @material/line-ripple

To help you get started, we’ve selected a few @material/line-ripple examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jamesmfriedman / rmwc / src / line-ripple / index.tsx View on Github external
getDefaultFoundation() {
    return new MDCLineRippleFoundation({
      addClass: (className: string) => this.root.addClass(className),
      removeClass: (className: string) => this.root.removeClass(className),
      hasClass: (className: string) => this.root.hasClass(className),
      setStyle: (propertyName: any, value: any) =>
        this.root.setStyle(propertyName, value),
      registerEventHandler: (
        evtType: K,
        handler: SpecificEventListener
      ) => this.root.addEventListener(evtType, handler),
      deregisterEventHandler: (
        evtType: K,
        handler: SpecificEventListener
      ) => this.root.removeEventListener(evtType, handler)
    });
  }
github src-zone / material / bundle / src / components / select / mdc.select.directive.ts View on Github external
private _bottomLineElm: HTMLElement = null;
    private _lineRippleAdapter: MdcLineRippleAdapter = {
        addClass: (className: string) => this._rndr.addClass(this._bottomLineElm, className),
        removeClass: (className: string) => this._rndr.removeClass(this._bottomLineElm, className),
        hasClass: (className) => this._bottomLineElm.classList.contains(className),
        setStyle: (name: string, value: string) => this._rndr.setStyle(this._bottomLineElm, name, value),
        registerEventHandler: (evtType: string, handler: EventListener) => this._registry.listenElm(this._rndr, evtType, handler, this._bottomLineElm),
        deregisterEventHandler: (evtType: string, handler: EventListener) => this._registry.unlisten(evtType, handler)
    };
    private _lineRippleFoundation: {
        init: Function,
        destroy: Function,
        activate: Function,
        deactivate: Function,
        setRippleCenter: (x: number) => void
    } = new MDCLineRippleFoundation(this._lineRippleAdapter);
    private adapter: MdcSelectAdapter = {
        addClass: (className: string) => this._rndr.addClass(this._elm.nativeElement, className),
        removeClass: (className: string) => this._rndr.removeClass(this._elm.nativeElement, className),
        floatLabel: (value: boolean) => {
            if (this._label) this._label._foundation.float(value);
        },
        activateBottomLine: () => {
            if (this._bottomLineElm) this._lineRippleFoundation.activate();
        },
        deactivateBottomLine: () => {
            if (this._bottomLineElm) this._lineRippleFoundation.deactivate();
        },
        registerInteractionHandler: (type, handler) => this._control._registry.listen(this._rndr, type, handler, this._control._elm),
        deregisterInteractionHandler: (type, handler) => this._control._registry.unlisten(type, handler),
        getSelectedIndex: () => this._control._elm.nativeElement.selectedIndex,
        setSelectedIndex: (index: number) => this._control._elm.nativeElement.selectedIndex = index,
github trimox / angular-mdc-web / packages / line-ripple / line-ripple.ts View on Github external
getDefaultFoundation() {
    const adapter: MDCLineRippleAdapter = {
      addClass: (className: string) => this._getHostElement().classList.add(className),
      removeClass: (className: string) => this._getHostElement().classList.remove(className),
      hasClass: (className: string) => this._getHostElement().classList.contains(className),
      setStyle: (propertyName: string, value: string) => this._getHostElement().style.setProperty(propertyName, value),
      registerEventHandler: () => { },
      deregisterEventHandler: () => { }
    };
    return new MDCLineRippleFoundation(adapter);
  }