@material/ripple

  • Version 11.0.0
  • Published
  • 395 kB
  • 6 dependencies
  • MIT license

Install

npm i @material/ripple
yarn add @material/ripple
pnpm add @material/ripple

Overview

The Material Components for the web Ink Ripple effect for web element interactions

Index

Namespaces

namespace @material/ripple

module '@material/ripple' {}

    variable cssClasses

    const cssClasses: {
    BG_FOCUSED: string;
    FG_ACTIVATION: string;
    FG_DEACTIVATION: string;
    ROOT: string;
    UNBOUNDED: string;
    };
    • Copyright 2016 Google Inc.

      Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

      The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

      THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

    variable numbers

    const numbers: {
    DEACTIVATION_TIMEOUT_MS: number;
    FG_DEACTIVATION_MS: number;
    INITIAL_ORIGIN_SCALE: number;
    PADDING: number;
    TAP_DELAY_MS: number;
    };

      variable strings

      const strings: {
      VAR_FG_SCALE: string;
      VAR_FG_SIZE: string;
      VAR_FG_TRANSLATE_END: string;
      VAR_FG_TRANSLATE_START: string;
      VAR_LEFT: string;
      VAR_TOP: string;
      };

        class MDCRipple

        class MDCRipple
        extends MDCComponent<MDCRippleFoundation>
        implements MDCRippleCapableSurface {}

          property disabled

          disabled: boolean;

            property unbounded

            unbounded: boolean;

              method activate

              activate: () => void;

                method attachTo

                static attachTo: (root: Element, opts?: MDCRippleAttachOpts) => MDCRipple;

                  method createAdapter

                  static createAdapter: (instance: MDCRippleCapableSurface) => MDCRippleAdapter;

                    method deactivate

                    deactivate: () => void;

                      method getDefaultFoundation

                      getDefaultFoundation: () => MDCRippleFoundation;

                        method initialSyncWithDOM

                        initialSyncWithDOM: () => void;

                          method layout

                          layout: () => void;

                            class MDCRippleFoundation

                            class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {}

                              constructor

                              constructor(adapter?: Partial<MDCRippleAdapter>);

                                property cssClasses

                                static readonly cssClasses: {
                                BG_FOCUSED: string;
                                FG_ACTIVATION: string;
                                FG_DEACTIVATION: string;
                                ROOT: string;
                                UNBOUNDED: string;
                                };

                                  property defaultAdapter

                                  static readonly defaultAdapter: MDCRippleAdapter;

                                    property numbers

                                    static readonly numbers: {
                                    DEACTIVATION_TIMEOUT_MS: number;
                                    FG_DEACTIVATION_MS: number;
                                    INITIAL_ORIGIN_SCALE: number;
                                    PADDING: number;
                                    TAP_DELAY_MS: number;
                                    };

                                      property strings

                                      static readonly strings: {
                                      VAR_FG_SCALE: string;
                                      VAR_FG_SIZE: string;
                                      VAR_FG_TRANSLATE_END: string;
                                      VAR_FG_TRANSLATE_START: string;
                                      VAR_LEFT: string;
                                      VAR_TOP: string;
                                      };

                                        method activate

                                        activate: (evt?: Event) => void;
                                        • Parameter evt

                                          Optional event containing position information.

                                        method deactivate

                                        deactivate: () => void;

                                          method destroy

                                          destroy: () => void;

                                            method handleBlur

                                            handleBlur: () => void;

                                              method handleFocus

                                              handleFocus: () => void;

                                                method init

                                                init: () => void;

                                                  method layout

                                                  layout: () => void;

                                                    method setUnbounded

                                                    setUnbounded: (unbounded: boolean) => void;

                                                      interface MDCRippleAdapter

                                                      interface MDCRippleAdapter {}
                                                      • Defines the shape of the adapter expected by the foundation. Implement this adapter for your framework of choice to delegate updates to the component in your framework of choice. See architecture documentation for more details. https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md

                                                      method addClass

                                                      addClass: (className: string) => void;

                                                        method browserSupportsCssVars

                                                        browserSupportsCssVars: () => boolean;

                                                          method computeBoundingRect

                                                          computeBoundingRect: () => ClientRect;

                                                            method containsEventTarget

                                                            containsEventTarget: (target: EventTarget | null) => boolean;

                                                              method deregisterDocumentInteractionHandler

                                                              deregisterDocumentInteractionHandler: <K extends any>(
                                                              evtType: K,
                                                              handler: any
                                                              ) => void;

                                                                method deregisterInteractionHandler

                                                                deregisterInteractionHandler: <K extends any>(evtType: K, handler: any) => void;

                                                                  method deregisterResizeHandler

                                                                  deregisterResizeHandler: (handler: any) => void;

                                                                    method getWindowPageOffset

                                                                    getWindowPageOffset: () => MDCRipplePoint;

                                                                      method isSurfaceActive

                                                                      isSurfaceActive: () => boolean;

                                                                        method isSurfaceDisabled

                                                                        isSurfaceDisabled: () => boolean;

                                                                          method isUnbounded

                                                                          isUnbounded: () => boolean;

                                                                            method registerDocumentInteractionHandler

                                                                            registerDocumentInteractionHandler: <K extends any>(
                                                                            evtType: K,
                                                                            handler: any
                                                                            ) => void;

                                                                              method registerInteractionHandler

                                                                              registerInteractionHandler: <K extends any>(evtType: K, handler: any) => void;

                                                                                method registerResizeHandler

                                                                                registerResizeHandler: (handler: any) => void;

                                                                                  method removeClass

                                                                                  removeClass: (className: string) => void;

                                                                                    method updateCssVariable

                                                                                    updateCssVariable: (varName: string, value: string | null) => void;

                                                                                      interface MDCRippleAttachOpts

                                                                                      interface MDCRippleAttachOpts {}
                                                                                      • Options passed in when attaching a ripple to an object.

                                                                                      property isUnbounded

                                                                                      isUnbounded?: boolean;

                                                                                        interface MDCRippleCapableSurface

                                                                                        interface MDCRippleCapableSurface {}
                                                                                        • See Material Design spec for more details on when to use ripples. https://material.io/guidelines/motion/choreography.html#choreography-creation unbounded Whether or not the ripple bleeds out of the bounds of the element. disabled Whether or not the ripple is attached to a disabled component.

                                                                                        property disabled

                                                                                        disabled?: boolean;

                                                                                          property root

                                                                                          root: Element;

                                                                                            property unbounded

                                                                                            unbounded?: boolean;

                                                                                              interface MDCRipplePoint

                                                                                              interface MDCRipplePoint {}
                                                                                              • Copyright 2019 Google Inc.

                                                                                                Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

                                                                                                The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

                                                                                                THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

                                                                                              property x

                                                                                              x: number;

                                                                                                property y

                                                                                                y: number;

                                                                                                  type MDCRippleFactory

                                                                                                  type MDCRippleFactory = (el: Element, foundation?: MDCRippleFoundation) => MDCRipple;

                                                                                                    namespace @material/ripple.util

                                                                                                    namespace @material/ripple.util {}

                                                                                                      function getNormalizedEventCoords

                                                                                                      getNormalizedEventCoords: (
                                                                                                      evt: Event | undefined,
                                                                                                      pageOffset: MDCRipplePoint,
                                                                                                      clientRect: ClientRect
                                                                                                      ) => MDCRipplePoint;

                                                                                                        function supportsCssVariables

                                                                                                        supportsCssVariables: (
                                                                                                        windowObj: typeof globalThis,
                                                                                                        forceRefresh?: boolean
                                                                                                        ) => boolean;

                                                                                                          namespace @material/ripple/adapter

                                                                                                          module '@material/ripple/adapter' {}

                                                                                                            interface MDCRippleAdapter

                                                                                                            interface MDCRippleAdapter {}
                                                                                                            • Defines the shape of the adapter expected by the foundation. Implement this adapter for your framework of choice to delegate updates to the component in your framework of choice. See architecture documentation for more details. https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md

                                                                                                            method addClass

                                                                                                            addClass: (className: string) => void;

                                                                                                              method browserSupportsCssVars

                                                                                                              browserSupportsCssVars: () => boolean;

                                                                                                                method computeBoundingRect

                                                                                                                computeBoundingRect: () => ClientRect;

                                                                                                                  method containsEventTarget

                                                                                                                  containsEventTarget: (target: EventTarget | null) => boolean;

                                                                                                                    method deregisterDocumentInteractionHandler

                                                                                                                    deregisterDocumentInteractionHandler: <K extends any>(
                                                                                                                    evtType: K,
                                                                                                                    handler: any
                                                                                                                    ) => void;

                                                                                                                      method deregisterInteractionHandler

                                                                                                                      deregisterInteractionHandler: <K extends any>(evtType: K, handler: any) => void;

                                                                                                                        method deregisterResizeHandler

                                                                                                                        deregisterResizeHandler: (handler: any) => void;

                                                                                                                          method getWindowPageOffset

                                                                                                                          getWindowPageOffset: () => MDCRipplePoint;

                                                                                                                            method isSurfaceActive

                                                                                                                            isSurfaceActive: () => boolean;

                                                                                                                              method isSurfaceDisabled

                                                                                                                              isSurfaceDisabled: () => boolean;

                                                                                                                                method isUnbounded

                                                                                                                                isUnbounded: () => boolean;

                                                                                                                                  method registerDocumentInteractionHandler

                                                                                                                                  registerDocumentInteractionHandler: <K extends any>(
                                                                                                                                  evtType: K,
                                                                                                                                  handler: any
                                                                                                                                  ) => void;

                                                                                                                                    method registerInteractionHandler

                                                                                                                                    registerInteractionHandler: <K extends any>(evtType: K, handler: any) => void;

                                                                                                                                      method registerResizeHandler

                                                                                                                                      registerResizeHandler: (handler: any) => void;

                                                                                                                                        method removeClass

                                                                                                                                        removeClass: (className: string) => void;

                                                                                                                                          method updateCssVariable

                                                                                                                                          updateCssVariable: (varName: string, value: string | null) => void;

                                                                                                                                            namespace @material/ripple/component

                                                                                                                                            module '@material/ripple/component' {}

                                                                                                                                              class MDCRipple

                                                                                                                                              class MDCRipple
                                                                                                                                              extends MDCComponent<MDCRippleFoundation>
                                                                                                                                              implements MDCRippleCapableSurface {}

                                                                                                                                                property disabled

                                                                                                                                                disabled: boolean;

                                                                                                                                                  property unbounded

                                                                                                                                                  unbounded: boolean;

                                                                                                                                                    method activate

                                                                                                                                                    activate: () => void;

                                                                                                                                                      method attachTo

                                                                                                                                                      static attachTo: (root: Element, opts?: MDCRippleAttachOpts) => MDCRipple;

                                                                                                                                                        method createAdapter

                                                                                                                                                        static createAdapter: (instance: MDCRippleCapableSurface) => MDCRippleAdapter;

                                                                                                                                                          method deactivate

                                                                                                                                                          deactivate: () => void;

                                                                                                                                                            method getDefaultFoundation

                                                                                                                                                            getDefaultFoundation: () => MDCRippleFoundation;

                                                                                                                                                              method initialSyncWithDOM

                                                                                                                                                              initialSyncWithDOM: () => void;

                                                                                                                                                                method layout

                                                                                                                                                                layout: () => void;

                                                                                                                                                                  type MDCRippleFactory

                                                                                                                                                                  type MDCRippleFactory = (el: Element, foundation?: MDCRippleFoundation) => MDCRipple;

                                                                                                                                                                    namespace @material/ripple/constants

                                                                                                                                                                    module '@material/ripple/constants' {}

                                                                                                                                                                      variable cssClasses

                                                                                                                                                                      const cssClasses: {
                                                                                                                                                                      BG_FOCUSED: string;
                                                                                                                                                                      FG_ACTIVATION: string;
                                                                                                                                                                      FG_DEACTIVATION: string;
                                                                                                                                                                      ROOT: string;
                                                                                                                                                                      UNBOUNDED: string;
                                                                                                                                                                      };
                                                                                                                                                                      • Copyright 2016 Google Inc.

                                                                                                                                                                        Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

                                                                                                                                                                        The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

                                                                                                                                                                        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

                                                                                                                                                                      variable numbers

                                                                                                                                                                      const numbers: {
                                                                                                                                                                      DEACTIVATION_TIMEOUT_MS: number;
                                                                                                                                                                      FG_DEACTIVATION_MS: number;
                                                                                                                                                                      INITIAL_ORIGIN_SCALE: number;
                                                                                                                                                                      PADDING: number;
                                                                                                                                                                      TAP_DELAY_MS: number;
                                                                                                                                                                      };

                                                                                                                                                                        variable strings

                                                                                                                                                                        const strings: {
                                                                                                                                                                        VAR_FG_SCALE: string;
                                                                                                                                                                        VAR_FG_SIZE: string;
                                                                                                                                                                        VAR_FG_TRANSLATE_END: string;
                                                                                                                                                                        VAR_FG_TRANSLATE_START: string;
                                                                                                                                                                        VAR_LEFT: string;
                                                                                                                                                                        VAR_TOP: string;
                                                                                                                                                                        };

                                                                                                                                                                          namespace @material/ripple/foundation

                                                                                                                                                                          module '@material/ripple/foundation' {}

                                                                                                                                                                            class MDCRippleFoundation

                                                                                                                                                                            class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {}

                                                                                                                                                                              constructor

                                                                                                                                                                              constructor(adapter?: Partial<MDCRippleAdapter>);

                                                                                                                                                                                property cssClasses

                                                                                                                                                                                static readonly cssClasses: {
                                                                                                                                                                                BG_FOCUSED: string;
                                                                                                                                                                                FG_ACTIVATION: string;
                                                                                                                                                                                FG_DEACTIVATION: string;
                                                                                                                                                                                ROOT: string;
                                                                                                                                                                                UNBOUNDED: string;
                                                                                                                                                                                };

                                                                                                                                                                                  property defaultAdapter

                                                                                                                                                                                  static readonly defaultAdapter: MDCRippleAdapter;

                                                                                                                                                                                    property numbers

                                                                                                                                                                                    static readonly numbers: {
                                                                                                                                                                                    DEACTIVATION_TIMEOUT_MS: number;
                                                                                                                                                                                    FG_DEACTIVATION_MS: number;
                                                                                                                                                                                    INITIAL_ORIGIN_SCALE: number;
                                                                                                                                                                                    PADDING: number;
                                                                                                                                                                                    TAP_DELAY_MS: number;
                                                                                                                                                                                    };

                                                                                                                                                                                      property strings

                                                                                                                                                                                      static readonly strings: {
                                                                                                                                                                                      VAR_FG_SCALE: string;
                                                                                                                                                                                      VAR_FG_SIZE: string;
                                                                                                                                                                                      VAR_FG_TRANSLATE_END: string;
                                                                                                                                                                                      VAR_FG_TRANSLATE_START: string;
                                                                                                                                                                                      VAR_LEFT: string;
                                                                                                                                                                                      VAR_TOP: string;
                                                                                                                                                                                      };

                                                                                                                                                                                        method activate

                                                                                                                                                                                        activate: (evt?: Event) => void;
                                                                                                                                                                                        • Parameter evt

                                                                                                                                                                                          Optional event containing position information.

                                                                                                                                                                                        method deactivate

                                                                                                                                                                                        deactivate: () => void;

                                                                                                                                                                                          method destroy

                                                                                                                                                                                          destroy: () => void;

                                                                                                                                                                                            method handleBlur

                                                                                                                                                                                            handleBlur: () => void;

                                                                                                                                                                                              method handleFocus

                                                                                                                                                                                              handleFocus: () => void;

                                                                                                                                                                                                method init

                                                                                                                                                                                                init: () => void;

                                                                                                                                                                                                  method layout

                                                                                                                                                                                                  layout: () => void;

                                                                                                                                                                                                    method setUnbounded

                                                                                                                                                                                                    setUnbounded: (unbounded: boolean) => void;

                                                                                                                                                                                                      namespace @material/ripple/types

                                                                                                                                                                                                      module '@material/ripple/types' {}

                                                                                                                                                                                                        interface MDCRippleAttachOpts

                                                                                                                                                                                                        interface MDCRippleAttachOpts {}
                                                                                                                                                                                                        • Options passed in when attaching a ripple to an object.

                                                                                                                                                                                                        property isUnbounded

                                                                                                                                                                                                        isUnbounded?: boolean;

                                                                                                                                                                                                          interface MDCRippleCapableSurface

                                                                                                                                                                                                          interface MDCRippleCapableSurface {}
                                                                                                                                                                                                          • See Material Design spec for more details on when to use ripples. https://material.io/guidelines/motion/choreography.html#choreography-creation unbounded Whether or not the ripple bleeds out of the bounds of the element. disabled Whether or not the ripple is attached to a disabled component.

                                                                                                                                                                                                          property disabled

                                                                                                                                                                                                          disabled?: boolean;

                                                                                                                                                                                                            property root

                                                                                                                                                                                                            root: Element;

                                                                                                                                                                                                              property unbounded

                                                                                                                                                                                                              unbounded?: boolean;

                                                                                                                                                                                                                interface MDCRipplePoint

                                                                                                                                                                                                                interface MDCRipplePoint {}
                                                                                                                                                                                                                • Copyright 2019 Google Inc.

                                                                                                                                                                                                                  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

                                                                                                                                                                                                                  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

                                                                                                                                                                                                                  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

                                                                                                                                                                                                                property x

                                                                                                                                                                                                                x: number;

                                                                                                                                                                                                                  property y

                                                                                                                                                                                                                  y: number;

                                                                                                                                                                                                                    namespace @material/ripple/util

                                                                                                                                                                                                                    module '@material/ripple/util' {}

                                                                                                                                                                                                                      function getNormalizedEventCoords

                                                                                                                                                                                                                      getNormalizedEventCoords: (
                                                                                                                                                                                                                      evt: Event | undefined,
                                                                                                                                                                                                                      pageOffset: MDCRipplePoint,
                                                                                                                                                                                                                      clientRect: ClientRect
                                                                                                                                                                                                                      ) => MDCRipplePoint;

                                                                                                                                                                                                                        function supportsCssVariables

                                                                                                                                                                                                                        supportsCssVariables: (
                                                                                                                                                                                                                        windowObj: typeof globalThis,
                                                                                                                                                                                                                        forceRefresh?: boolean
                                                                                                                                                                                                                        ) => boolean;

                                                                                                                                                                                                                          Package Files (1)

                                                                                                                                                                                                                          Dependencies (6)

                                                                                                                                                                                                                          Dev Dependencies (0)

                                                                                                                                                                                                                          No dev dependencies.

                                                                                                                                                                                                                          Peer Dependencies (0)

                                                                                                                                                                                                                          No peer dependencies.

                                                                                                                                                                                                                          Badge

                                                                                                                                                                                                                          To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                                                                                                                                                                          You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@material/ripple.

                                                                                                                                                                                                                          • Markdown
                                                                                                                                                                                                                            [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@material/ripple)
                                                                                                                                                                                                                          • HTML
                                                                                                                                                                                                                            <a href="https://www.jsdocs.io/package/@material/ripple"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>