badge.d-mlaO4g0J.d.ts 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import * as i0 from '@angular/core';
  2. import { OnInit, OnDestroy } from '@angular/core';
  3. import { T as ThemePalette } from './palette.d-BSSFKjO6.js';
  4. /** Allowed position options for matBadgePosition */
  5. type MatBadgePosition = 'above after' | 'above before' | 'below before' | 'below after' | 'before' | 'after' | 'above' | 'below';
  6. /** Allowed size options for matBadgeSize */
  7. type MatBadgeSize = 'small' | 'medium' | 'large';
  8. /**
  9. * Component used to load the structural styles of the badge.
  10. * @docs-private
  11. */
  12. declare class _MatBadgeStyleLoader {
  13. static ɵfac: i0.ɵɵFactoryDeclaration<_MatBadgeStyleLoader, never>;
  14. static ɵcmp: i0.ɵɵComponentDeclaration<_MatBadgeStyleLoader, "ng-component", never, {}, {}, never, never, true, never>;
  15. }
  16. /** Directive to display a text badge. */
  17. declare class MatBadge implements OnInit, OnDestroy {
  18. private _ngZone;
  19. private _elementRef;
  20. private _ariaDescriber;
  21. private _renderer;
  22. private _animationMode;
  23. private _idGenerator;
  24. /**
  25. * Theme color of the badge. This API is supported in M2 themes only, it
  26. * has no effect in M3 themes. For color customization in M3, see https://material.angular.dev/components/badge/styling.
  27. *
  28. * For information on applying color variants in M3, see
  29. * https://material.angular.dev/guide/material-2-theming#optional-add-backwards-compatibility-styles-for-color-variants
  30. */
  31. get color(): ThemePalette;
  32. set color(value: ThemePalette);
  33. private _color;
  34. /** Whether the badge should overlap its contents or not */
  35. overlap: boolean;
  36. /** Whether the badge is disabled. */
  37. disabled: boolean;
  38. /**
  39. * Position the badge should reside.
  40. * Accepts any combination of 'above'|'below' and 'before'|'after'
  41. */
  42. position: MatBadgePosition;
  43. /** The content for the badge */
  44. get content(): string | number | undefined | null;
  45. set content(newContent: string | number | undefined | null);
  46. private _content;
  47. /** Message used to describe the decorated element via aria-describedby */
  48. get description(): string;
  49. set description(newDescription: string);
  50. private _description;
  51. /** Size of the badge. Can be 'small', 'medium', or 'large'. */
  52. size: MatBadgeSize;
  53. /** Whether the badge is hidden. */
  54. hidden: boolean;
  55. /** Visible badge element. */
  56. private _badgeElement;
  57. /** Inline badge description. Used when the badge is applied to non-interactive host elements. */
  58. private _inlineBadgeDescription;
  59. /** Whether the OnInit lifecycle hook has run yet */
  60. private _isInitialized;
  61. /** InteractivityChecker to determine if the badge host is focusable. */
  62. private _interactivityChecker;
  63. private _document;
  64. constructor(...args: unknown[]);
  65. /** Whether the badge is above the host or not */
  66. isAbove(): boolean;
  67. /** Whether the badge is after the host or not */
  68. isAfter(): boolean;
  69. /**
  70. * Gets the element into which the badge's content is being rendered. Undefined if the element
  71. * hasn't been created (e.g. if the badge doesn't have content).
  72. */
  73. getBadgeElement(): HTMLElement | undefined;
  74. ngOnInit(): void;
  75. ngOnDestroy(): void;
  76. /** Gets whether the badge's host element is interactive. */
  77. private _isHostInteractive;
  78. /** Creates the badge element */
  79. private _createBadgeElement;
  80. /** Update the text content of the badge element in the DOM, creating the element if necessary. */
  81. private _updateRenderedContent;
  82. /** Updates the host element's aria description via AriaDescriber. */
  83. private _updateDescription;
  84. private _updateInlineDescription;
  85. private _removeInlineDescription;
  86. /** Adds css theme class given the color to the component host */
  87. private _setColor;
  88. /** Clears any existing badges that might be left over from server-side rendering. */
  89. private _clearExistingBadges;
  90. static ɵfac: i0.ɵɵFactoryDeclaration<MatBadge, never>;
  91. static ɵdir: i0.ɵɵDirectiveDeclaration<MatBadge, "[matBadge]", never, { "color": { "alias": "matBadgeColor"; "required": false; }; "overlap": { "alias": "matBadgeOverlap"; "required": false; }; "disabled": { "alias": "matBadgeDisabled"; "required": false; }; "position": { "alias": "matBadgePosition"; "required": false; }; "content": { "alias": "matBadge"; "required": false; }; "description": { "alias": "matBadgeDescription"; "required": false; }; "size": { "alias": "matBadgeSize"; "required": false; }; "hidden": { "alias": "matBadgeHidden"; "required": false; }; }, {}, never, never, true, never>;
  92. static ngAcceptInputType_overlap: unknown;
  93. static ngAcceptInputType_disabled: unknown;
  94. static ngAcceptInputType_hidden: unknown;
  95. }
  96. export { MatBadge as M, _MatBadgeStyleLoader as _ };
  97. export type { MatBadgePosition as a, MatBadgeSize as b };