index.d.ts 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. import { FocusOrigin } from '@angular/cdk/a11y';
  2. import * as i0 from '@angular/core';
  3. import { InjectionToken, AfterViewInit, OnDestroy, ElementRef, NgZone, OnInit } from '@angular/core';
  4. import { T as ThemePalette } from '../palette.d-BSSFKjO6.js';
  5. import { M as MatRippleLoader } from '../ripple-loader.d-C3HznB6v.js';
  6. import { M as MatCommonModule } from '../common-module.d-C8xzHJDr.js';
  7. import { M as MatRippleModule } from '../index.d-DG9eDM2-.js';
  8. import '@angular/cdk/bidi';
  9. import '../ripple.d-BxTUZJt7.js';
  10. import '@angular/cdk/platform';
  11. /** Object that can be used to configure the default options for the button component. */
  12. interface MatButtonConfig {
  13. /** Whether disabled buttons should be interactive. */
  14. disabledInteractive?: boolean;
  15. /** Default palette color to apply to buttons. */
  16. color?: ThemePalette;
  17. }
  18. /** Injection token that can be used to provide the default options the button component. */
  19. declare const MAT_BUTTON_CONFIG: InjectionToken<MatButtonConfig>;
  20. /** Base class for all buttons. */
  21. declare class MatButtonBase implements AfterViewInit, OnDestroy {
  22. _elementRef: ElementRef<any>;
  23. _ngZone: NgZone;
  24. _animationMode: "NoopAnimations" | "BrowserAnimations" | null;
  25. private readonly _focusMonitor;
  26. /**
  27. * Handles the lazy creation of the MatButton ripple.
  28. * Used to improve initial load time of large applications.
  29. */
  30. protected _rippleLoader: MatRippleLoader;
  31. /** Whether this button is a FAB. Used to apply the correct class on the ripple. */
  32. protected _isFab: boolean;
  33. /**
  34. * Theme color of the button. This API is supported in M2 themes only, it has
  35. * no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/button/styling.
  36. *
  37. * For information on applying color variants in M3, see
  38. * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
  39. */
  40. color?: string | null;
  41. /** Whether the ripple effect is disabled or not. */
  42. get disableRipple(): boolean;
  43. set disableRipple(value: any);
  44. private _disableRipple;
  45. /** Whether the button is disabled. */
  46. get disabled(): boolean;
  47. set disabled(value: any);
  48. private _disabled;
  49. /** `aria-disabled` value of the button. */
  50. ariaDisabled: boolean | undefined;
  51. /**
  52. * Natively disabled buttons prevent focus and any pointer events from reaching the button.
  53. * In some scenarios this might not be desirable, because it can prevent users from finding out
  54. * why the button is disabled (e.g. via tooltip). This is also useful for buttons that may
  55. * become disabled when activated, which would cause focus to be transferred to the document
  56. * body instead of remaining on the button.
  57. *
  58. * Enabling this input will change the button so that it is styled to be disabled and will be
  59. * marked as `aria-disabled`, but it will allow the button to receive events and focus.
  60. *
  61. * Note that by enabling this, you need to set the `tabindex` yourself if the button isn't
  62. * meant to be tabbable and you have to prevent the button action (e.g. form submissions).
  63. */
  64. disabledInteractive: boolean;
  65. constructor(...args: unknown[]);
  66. ngAfterViewInit(): void;
  67. ngOnDestroy(): void;
  68. /** Focuses the button. */
  69. focus(origin?: FocusOrigin, options?: FocusOptions): void;
  70. protected _getAriaDisabled(): boolean | null;
  71. protected _getDisabledAttribute(): true | null;
  72. private _updateRippleDisabled;
  73. static ɵfac: i0.ɵɵFactoryDeclaration<MatButtonBase, never>;
  74. static ɵdir: i0.ɵɵDirectiveDeclaration<MatButtonBase, never, never, { "color": { "alias": "color"; "required": false; }; "disableRipple": { "alias": "disableRipple"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "ariaDisabled": { "alias": "aria-disabled"; "required": false; }; "disabledInteractive": { "alias": "disabledInteractive"; "required": false; }; }, {}, never, never, true, never>;
  75. static ngAcceptInputType_disableRipple: unknown;
  76. static ngAcceptInputType_disabled: unknown;
  77. static ngAcceptInputType_ariaDisabled: unknown;
  78. static ngAcceptInputType_disabledInteractive: unknown;
  79. }
  80. /**
  81. * Anchor button base.
  82. */
  83. declare class MatAnchorBase extends MatButtonBase implements OnInit, OnDestroy {
  84. private _renderer;
  85. private _cleanupClick;
  86. tabIndex: number;
  87. ngOnInit(): void;
  88. ngOnDestroy(): void;
  89. _haltDisabledEvents: (event: Event) => void;
  90. protected _getAriaDisabled(): boolean | null;
  91. static ɵfac: i0.ɵɵFactoryDeclaration<MatAnchorBase, never>;
  92. static ɵdir: i0.ɵɵDirectiveDeclaration<MatAnchorBase, never, never, { "tabIndex": { "alias": "tabIndex"; "required": false; }; }, {}, never, never, true, never>;
  93. static ngAcceptInputType_tabIndex: unknown;
  94. }
  95. /**
  96. * Material Design button component. Users interact with a button to perform an action.
  97. * See https://material.io/components/buttons
  98. *
  99. * The `MatButton` class applies to native button elements and captures the appearances for
  100. * "text button", "outlined button", and "contained button" per the Material Design
  101. * specification. `MatButton` additionally captures an additional "flat" appearance, which matches
  102. * "contained" but without elevation.
  103. */
  104. declare class MatButton extends MatButtonBase {
  105. static ɵfac: i0.ɵɵFactoryDeclaration<MatButton, never>;
  106. static ɵcmp: i0.ɵɵComponentDeclaration<MatButton, " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", ["matButton"], {}, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
  107. }
  108. /**
  109. * Material Design button component for anchor elements. Anchor elements are used to provide
  110. * links for the user to navigate across different routes or pages.
  111. * See https://material.io/components/buttons
  112. *
  113. * The `MatAnchor` class applies to native anchor elements and captures the appearances for
  114. * "text button", "outlined button", and "contained button" per the Material Design
  115. * specification. `MatAnchor` additionally captures an additional "flat" appearance, which matches
  116. * "contained" but without elevation.
  117. */
  118. declare class MatAnchor extends MatAnchorBase {
  119. static ɵfac: i0.ɵɵFactoryDeclaration<MatAnchor, never>;
  120. static ɵcmp: i0.ɵɵComponentDeclaration<MatAnchor, "a[mat-button], a[mat-raised-button], a[mat-flat-button], a[mat-stroked-button]", ["matButton", "matAnchor"], {}, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
  121. }
  122. /** Default FAB options that can be overridden. */
  123. interface MatFabDefaultOptions {
  124. /**
  125. * Default theme color of the button. This API is supported in M2 themes
  126. * only, it has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/button/styling.
  127. *
  128. * For information on applying color variants in M3, see
  129. * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants.
  130. */
  131. color?: ThemePalette;
  132. }
  133. /** Injection token to be used to override the default options for FAB. */
  134. declare const MAT_FAB_DEFAULT_OPTIONS: InjectionToken<MatFabDefaultOptions>;
  135. /**
  136. * @docs-private
  137. * @deprecated No longer used, will be removed.
  138. * @breaking-change 21.0.0
  139. */
  140. declare function MAT_FAB_DEFAULT_OPTIONS_FACTORY(): MatFabDefaultOptions;
  141. /**
  142. * Material Design floating action button (FAB) component. These buttons represent the primary
  143. * or most common action for users to interact with.
  144. * See https://material.io/components/buttons-floating-action-button/
  145. *
  146. * The `MatFabButton` class has two appearances: normal and extended.
  147. */
  148. declare class MatFabButton extends MatButtonBase {
  149. private _options;
  150. _isFab: boolean;
  151. extended: boolean;
  152. constructor(...args: unknown[]);
  153. static ɵfac: i0.ɵɵFactoryDeclaration<MatFabButton, never>;
  154. static ɵcmp: i0.ɵɵComponentDeclaration<MatFabButton, "button[mat-fab]", ["matButton"], { "extended": { "alias": "extended"; "required": false; }; }, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
  155. static ngAcceptInputType_extended: unknown;
  156. }
  157. /**
  158. * Material Design mini floating action button (FAB) component. These buttons represent the primary
  159. * or most common action for users to interact with.
  160. * See https://material.io/components/buttons-floating-action-button/
  161. */
  162. declare class MatMiniFabButton extends MatButtonBase {
  163. private _options;
  164. _isFab: boolean;
  165. constructor(...args: unknown[]);
  166. static ɵfac: i0.ɵɵFactoryDeclaration<MatMiniFabButton, never>;
  167. static ɵcmp: i0.ɵɵComponentDeclaration<MatMiniFabButton, "button[mat-mini-fab]", ["matButton"], {}, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
  168. }
  169. /**
  170. * Material Design floating action button (FAB) component for anchor elements. Anchor elements
  171. * are used to provide links for the user to navigate across different routes or pages.
  172. * See https://material.io/components/buttons-floating-action-button/
  173. *
  174. * The `MatFabAnchor` class has two appearances: normal and extended.
  175. */
  176. declare class MatFabAnchor extends MatAnchor {
  177. private _options;
  178. _isFab: boolean;
  179. extended: boolean;
  180. constructor(...args: unknown[]);
  181. static ɵfac: i0.ɵɵFactoryDeclaration<MatFabAnchor, never>;
  182. static ɵcmp: i0.ɵɵComponentDeclaration<MatFabAnchor, "a[mat-fab]", ["matButton", "matAnchor"], { "extended": { "alias": "extended"; "required": false; }; }, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
  183. static ngAcceptInputType_extended: unknown;
  184. }
  185. /**
  186. * Material Design mini floating action button (FAB) component for anchor elements. Anchor elements
  187. * are used to provide links for the user to navigate across different routes or pages.
  188. * See https://material.io/components/buttons-floating-action-button/
  189. */
  190. declare class MatMiniFabAnchor extends MatAnchor {
  191. private _options;
  192. _isFab: boolean;
  193. constructor(...args: unknown[]);
  194. static ɵfac: i0.ɵɵFactoryDeclaration<MatMiniFabAnchor, never>;
  195. static ɵcmp: i0.ɵɵComponentDeclaration<MatMiniFabAnchor, "a[mat-mini-fab]", ["matButton", "matAnchor"], {}, {}, never, [".material-icons:not([iconPositionEnd]), mat-icon:not([iconPositionEnd]), [matButtonIcon]:not([iconPositionEnd])", "*", ".material-icons[iconPositionEnd], mat-icon[iconPositionEnd], [matButtonIcon][iconPositionEnd]"], true, never>;
  196. }
  197. /**
  198. * Material Design icon button component. This type of button displays a single interactive icon for
  199. * users to perform an action.
  200. * See https://material.io/develop/web/components/buttons/icon-buttons/
  201. */
  202. declare class MatIconButton extends MatButtonBase {
  203. constructor(...args: unknown[]);
  204. static ɵfac: i0.ɵɵFactoryDeclaration<MatIconButton, never>;
  205. static ɵcmp: i0.ɵɵComponentDeclaration<MatIconButton, "button[mat-icon-button]", ["matButton"], {}, {}, never, ["*"], true, never>;
  206. }
  207. /**
  208. * Material Design icon button component for anchor elements. This button displays a single
  209. * interaction icon that allows users to navigate across different routes or pages.
  210. * See https://material.io/develop/web/components/buttons/icon-buttons/
  211. */
  212. declare class MatIconAnchor extends MatAnchorBase {
  213. static ɵfac: i0.ɵɵFactoryDeclaration<MatIconAnchor, never>;
  214. static ɵcmp: i0.ɵɵComponentDeclaration<MatIconAnchor, "a[mat-icon-button]", ["matButton", "matAnchor"], {}, {}, never, ["*"], true, never>;
  215. }
  216. declare class MatButtonModule {
  217. static ɵfac: i0.ɵɵFactoryDeclaration<MatButtonModule, never>;
  218. static ɵmod: i0.ɵɵNgModuleDeclaration<MatButtonModule, never, [typeof MatCommonModule, typeof MatRippleModule, typeof MatAnchor, typeof MatButton, typeof MatIconAnchor, typeof MatMiniFabAnchor, typeof MatMiniFabButton, typeof MatIconButton, typeof MatFabAnchor, typeof MatFabButton], [typeof MatAnchor, typeof MatButton, typeof MatIconAnchor, typeof MatIconButton, typeof MatMiniFabAnchor, typeof MatMiniFabButton, typeof MatFabAnchor, typeof MatFabButton, typeof MatCommonModule]>;
  219. static ɵinj: i0.ɵɵInjectorDeclaration<MatButtonModule>;
  220. }
  221. export { MAT_BUTTON_CONFIG, MAT_FAB_DEFAULT_OPTIONS, MAT_FAB_DEFAULT_OPTIONS_FACTORY, MatAnchor, MatButton, MatButtonModule, MatFabAnchor, MatFabButton, MatIconAnchor, MatIconButton, MatMiniFabAnchor, MatMiniFabButton };
  222. export type { MatButtonConfig, MatFabDefaultOptions };