form-field-control.d-QxD-9xJ3.d.ts 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. import { Observable } from 'rxjs';
  2. import { NgControl, AbstractControlDirective } from '@angular/forms';
  3. import * as i0 from '@angular/core';
  4. /** An interface which allows a control to work inside of a `MatFormField`. */
  5. declare abstract class MatFormFieldControl<T> {
  6. /** The value of the control. */
  7. value: T | null;
  8. /**
  9. * Stream that emits whenever the state of the control changes such that the parent `MatFormField`
  10. * needs to run change detection.
  11. */
  12. readonly stateChanges: Observable<void>;
  13. /** The element ID for this control. */
  14. readonly id: string;
  15. /** The placeholder for this control. */
  16. readonly placeholder: string;
  17. /** Gets the AbstractControlDirective for this control. */
  18. readonly ngControl: NgControl | AbstractControlDirective | null;
  19. /** Whether the control is focused. */
  20. readonly focused: boolean;
  21. /** Whether the control is empty. */
  22. readonly empty: boolean;
  23. /** Whether the `MatFormField` label should try to float. */
  24. readonly shouldLabelFloat: boolean;
  25. /** Whether the control is required. */
  26. readonly required: boolean;
  27. /** Whether the control is disabled. */
  28. readonly disabled: boolean;
  29. /** Whether the control is in an error state. */
  30. readonly errorState: boolean;
  31. /**
  32. * An optional name for the control type that can be used to distinguish `mat-form-field` elements
  33. * based on their control type. The form field will add a class,
  34. * `mat-form-field-type-{{controlType}}` to its root element.
  35. */
  36. readonly controlType?: string;
  37. /**
  38. * Whether the input is currently in an autofilled state. If property is not present on the
  39. * control it is assumed to be false.
  40. */
  41. readonly autofilled?: boolean;
  42. /**
  43. * Value of `aria-describedby` that should be merged with the described-by ids
  44. * which are set by the form-field.
  45. */
  46. readonly userAriaDescribedBy?: string;
  47. /**
  48. * Whether to automatically assign the ID of the form field as the `for` attribute
  49. * on the `<label>` inside the form field. Set this to true to prevent the form
  50. * field from associating the label with non-native elements.
  51. */
  52. readonly disableAutomaticLabeling?: boolean;
  53. /** Sets the list of element IDs that currently describe this control. */
  54. abstract setDescribedByIds(ids: string[]): void;
  55. /** Handles a click on the control's container. */
  56. abstract onContainerClick(event: MouseEvent): void;
  57. static ɵfac: i0.ɵɵFactoryDeclaration<MatFormFieldControl<any>, never>;
  58. static ɵdir: i0.ɵɵDirectiveDeclaration<MatFormFieldControl<any>, never, never, {}, {}, never, never, true, never>;
  59. }
  60. export { MatFormFieldControl as M };