foundation.d.ts 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 { MDCCheckboxAdapter } from './adapter';
  25. /** MDC Checkbox Foundation */
  26. export declare class MDCCheckboxFoundation extends MDCFoundation<MDCCheckboxAdapter> {
  27. static get cssClasses(): {
  28. ANIM_CHECKED_INDETERMINATE: string;
  29. ANIM_CHECKED_UNCHECKED: string;
  30. ANIM_INDETERMINATE_CHECKED: string;
  31. ANIM_INDETERMINATE_UNCHECKED: string;
  32. ANIM_UNCHECKED_CHECKED: string;
  33. ANIM_UNCHECKED_INDETERMINATE: string;
  34. BACKGROUND: string;
  35. CHECKED: string;
  36. CHECKMARK: string;
  37. CHECKMARK_PATH: string;
  38. DISABLED: string;
  39. INDETERMINATE: string;
  40. MIXEDMARK: string;
  41. NATIVE_CONTROL: string;
  42. ROOT: string;
  43. SELECTED: string;
  44. UPGRADED: string;
  45. };
  46. static get strings(): {
  47. ARIA_CHECKED_ATTR: string;
  48. ARIA_CHECKED_INDETERMINATE_VALUE: string;
  49. DATA_INDETERMINATE_ATTR: string;
  50. NATIVE_CONTROL_SELECTOR: string;
  51. TRANSITION_STATE_CHECKED: string;
  52. TRANSITION_STATE_INDETERMINATE: string;
  53. TRANSITION_STATE_INIT: string;
  54. TRANSITION_STATE_UNCHECKED: string;
  55. };
  56. static get numbers(): {
  57. ANIM_END_LATCH_MS: number;
  58. };
  59. static get defaultAdapter(): MDCCheckboxAdapter;
  60. private currentCheckState;
  61. private currentAnimationClass;
  62. private animEndLatchTimer;
  63. private enableAnimationEndHandler;
  64. constructor(adapter?: Partial<MDCCheckboxAdapter>);
  65. init(): void;
  66. destroy(): void;
  67. setDisabled(disabled: boolean): void;
  68. /**
  69. * Handles the animationend event for the checkbox
  70. */
  71. handleAnimationEnd(): void;
  72. /**
  73. * Handles the change event for the checkbox
  74. */
  75. handleChange(): void;
  76. private transitionCheckState;
  77. private determineCheckState;
  78. private getTransitionAnimationClass;
  79. private updateAriaChecked;
  80. }
  81. export default MDCCheckboxFoundation;