foundation.d.ts 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /**
  2. * @license
  3. * Copyright 2016 Google Inc.
  4. *
  5. * Permission is hereby granted, free of charge, to any person obtaining a copy
  6. * of this software and associated documentation files (the "Software"), to deal
  7. * in the Software without restriction, including without limitation the rights
  8. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. * copies of the Software, and to permit persons to whom the Software is
  10. * furnished to do so, subject to the following conditions:
  11. *
  12. * The above copyright notice and this permission notice shall be included in
  13. * all copies or substantial portions of the Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  21. * THE SOFTWARE.
  22. */
  23. import { MDCFoundation } from '@material/base/foundation';
  24. import { MDCRippleAdapter } from './adapter';
  25. /** MDC Ripple Foundation */
  26. export declare class MDCRippleFoundation extends MDCFoundation<MDCRippleAdapter> {
  27. static get cssClasses(): {
  28. BG_FOCUSED: string;
  29. FG_ACTIVATION: string;
  30. FG_DEACTIVATION: string;
  31. ROOT: string;
  32. UNBOUNDED: string;
  33. };
  34. static get strings(): {
  35. VAR_FG_SCALE: string;
  36. VAR_FG_SIZE: string;
  37. VAR_FG_TRANSLATE_END: string;
  38. VAR_FG_TRANSLATE_START: string;
  39. VAR_LEFT: string;
  40. VAR_TOP: string;
  41. };
  42. static get numbers(): {
  43. DEACTIVATION_TIMEOUT_MS: number;
  44. FG_DEACTIVATION_MS: number;
  45. INITIAL_ORIGIN_SCALE: number;
  46. PADDING: number;
  47. TAP_DELAY_MS: number;
  48. };
  49. static get defaultAdapter(): MDCRippleAdapter;
  50. private activationAnimationHasEnded;
  51. private activationState;
  52. private activationTimer;
  53. private fgDeactivationRemovalTimer;
  54. private fgScale;
  55. private frame;
  56. private initialSize;
  57. private layoutFrame;
  58. private maxRadius;
  59. private unboundedCoords;
  60. private readonly activationTimerCallback;
  61. private readonly activateHandler;
  62. private readonly deactivateHandler;
  63. private readonly focusHandler;
  64. private readonly blurHandler;
  65. private readonly resizeHandler;
  66. private previousActivationEvent?;
  67. constructor(adapter?: Partial<MDCRippleAdapter>);
  68. init(): void;
  69. destroy(): void;
  70. /**
  71. * @param evt Optional event containing position information.
  72. */
  73. activate(evt?: Event): void;
  74. deactivate(): void;
  75. layout(): void;
  76. setUnbounded(unbounded: boolean): void;
  77. handleFocus(): void;
  78. handleBlur(): void;
  79. /**
  80. * We compute this property so that we are not querying information about the
  81. * client until the point in time where the foundation requests it. This
  82. * prevents scenarios where client-side feature-detection may happen too
  83. * early, such as when components are rendered on the server and then
  84. * initialized at mount time on the client.
  85. */
  86. private supportsPressRipple;
  87. private defaultActivationState;
  88. /**
  89. * supportsPressRipple Passed from init to save a redundant function call
  90. */
  91. private registerRootHandlers;
  92. private registerDeactivationHandlers;
  93. private deregisterRootHandlers;
  94. private deregisterDeactivationHandlers;
  95. private removeCssVars;
  96. private activateImpl;
  97. private checkElementMadeActive;
  98. private animateActivation;
  99. private getFgTranslationCoordinates;
  100. private runDeactivationUXLogicIfReady;
  101. private rmBoundedActivationClasses;
  102. private resetActivationState;
  103. private deactivateImpl;
  104. private animateDeactivation;
  105. private layoutInternal;
  106. private updateLayoutCssVars;
  107. }
  108. export default MDCRippleFoundation;