index.d.ts 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. import { BooleanInput } from '@angular/cdk/coercion';
  2. import { Platform } from '@angular/cdk/platform';
  3. import * as i0 from '@angular/core';
  4. import { InjectionToken, OnChanges, OnDestroy, AfterViewInit, DoCheck, ElementRef, WritableSignal } from '@angular/core';
  5. import { NgControl } from '@angular/forms';
  6. import { Subject } from 'rxjs';
  7. import { E as ErrorStateMatcher } from '../error-options.d-CGdTZUYk.js';
  8. import { M as MatFormField } from '../form-field.d-CMA_QQ0R.js';
  9. export { b as MatError, a as MatHint, c as MatPrefix, d as MatSuffix } from '../form-field.d-CMA_QQ0R.js';
  10. import { M as MatFormFieldControl } from '../form-field-control.d-QxD-9xJ3.js';
  11. import { M as MatCommonModule } from '../common-module.d-C8xzHJDr.js';
  12. import { a as MatFormFieldModule } from '../module.d-1ZCYe5BH.js';
  13. export { M as MatLabel } from '../module.d-1ZCYe5BH.js';
  14. import * as i4 from '@angular/cdk/text-field';
  15. import '../palette.d-BSSFKjO6.js';
  16. import '@angular/cdk/bidi';
  17. import '@angular/cdk/observers';
  18. /** Object that can be used to configure the default options for the input. */
  19. interface MatInputConfig {
  20. /** Whether disabled inputs should be interactive. */
  21. disabledInteractive?: boolean;
  22. }
  23. /** Injection token that can be used to provide the default options for the input. */
  24. declare const MAT_INPUT_CONFIG: InjectionToken<MatInputConfig>;
  25. declare class MatInput implements MatFormFieldControl<any>, OnChanges, OnDestroy, AfterViewInit, DoCheck {
  26. protected _elementRef: ElementRef<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>;
  27. protected _platform: Platform;
  28. ngControl: NgControl;
  29. private _autofillMonitor;
  30. private _ngZone;
  31. protected _formField?: MatFormField | null | undefined;
  32. private _renderer;
  33. protected _uid: string;
  34. protected _previousNativeValue: any;
  35. private _inputValueAccessor;
  36. private _signalBasedValueAccessor?;
  37. private _previousPlaceholder;
  38. private _errorStateTracker;
  39. private _config;
  40. private _cleanupIosKeyup;
  41. private _cleanupWebkitWheel;
  42. /** `aria-describedby` IDs assigned by the form field. */
  43. private _formFieldDescribedBy;
  44. /** Whether the component is being rendered on the server. */
  45. readonly _isServer: boolean;
  46. /** Whether the component is a native html select. */
  47. readonly _isNativeSelect: boolean;
  48. /** Whether the component is a textarea. */
  49. readonly _isTextarea: boolean;
  50. /** Whether the input is inside of a form field. */
  51. readonly _isInFormField: boolean;
  52. /**
  53. * Implemented as part of MatFormFieldControl.
  54. * @docs-private
  55. */
  56. focused: boolean;
  57. /**
  58. * Implemented as part of MatFormFieldControl.
  59. * @docs-private
  60. */
  61. readonly stateChanges: Subject<void>;
  62. /**
  63. * Implemented as part of MatFormFieldControl.
  64. * @docs-private
  65. */
  66. controlType: string;
  67. /**
  68. * Implemented as part of MatFormFieldControl.
  69. * @docs-private
  70. */
  71. autofilled: boolean;
  72. /**
  73. * Implemented as part of MatFormFieldControl.
  74. * @docs-private
  75. */
  76. get disabled(): boolean;
  77. set disabled(value: BooleanInput);
  78. protected _disabled: boolean;
  79. /**
  80. * Implemented as part of MatFormFieldControl.
  81. * @docs-private
  82. */
  83. get id(): string;
  84. set id(value: string);
  85. protected _id: string;
  86. /**
  87. * Implemented as part of MatFormFieldControl.
  88. * @docs-private
  89. */
  90. placeholder: string;
  91. /**
  92. * Name of the input.
  93. * @docs-private
  94. */
  95. name: string;
  96. /**
  97. * Implemented as part of MatFormFieldControl.
  98. * @docs-private
  99. */
  100. get required(): boolean;
  101. set required(value: BooleanInput);
  102. protected _required: boolean | undefined;
  103. /** Input type of the element. */
  104. get type(): string;
  105. set type(value: string);
  106. protected _type: string;
  107. /** An object used to control when error messages are shown. */
  108. get errorStateMatcher(): ErrorStateMatcher;
  109. set errorStateMatcher(value: ErrorStateMatcher);
  110. /**
  111. * Implemented as part of MatFormFieldControl.
  112. * @docs-private
  113. */
  114. userAriaDescribedBy: string;
  115. /**
  116. * Implemented as part of MatFormFieldControl.
  117. * @docs-private
  118. */
  119. get value(): string;
  120. set value(value: any);
  121. /** Whether the element is readonly. */
  122. get readonly(): boolean;
  123. set readonly(value: BooleanInput);
  124. private _readonly;
  125. /** Whether the input should remain interactive when it is disabled. */
  126. disabledInteractive: boolean;
  127. /** Whether the input is in an error state. */
  128. get errorState(): boolean;
  129. set errorState(value: boolean);
  130. protected _neverEmptyInputTypes: string[];
  131. constructor(...args: unknown[]);
  132. ngAfterViewInit(): void;
  133. ngOnChanges(): void;
  134. ngOnDestroy(): void;
  135. ngDoCheck(): void;
  136. /** Focuses the input. */
  137. focus(options?: FocusOptions): void;
  138. /** Refreshes the error state of the input. */
  139. updateErrorState(): void;
  140. /** Callback for the cases where the focused state of the input changes. */
  141. _focusChanged(isFocused: boolean): void;
  142. _onInput(): void;
  143. /** Does some manual dirty checking on the native input `value` property. */
  144. protected _dirtyCheckNativeValue(): void;
  145. /** Does some manual dirty checking on the native input `placeholder` attribute. */
  146. private _dirtyCheckPlaceholder;
  147. /** Gets the current placeholder of the form field. */
  148. protected _getPlaceholder(): string | null;
  149. /** Make sure the input is a supported type. */
  150. protected _validateType(): void;
  151. /** Checks whether the input type is one of the types that are never empty. */
  152. protected _isNeverEmpty(): boolean;
  153. /** Checks whether the input is invalid based on the native validation. */
  154. protected _isBadInput(): boolean;
  155. /**
  156. * Implemented as part of MatFormFieldControl.
  157. * @docs-private
  158. */
  159. get empty(): boolean;
  160. /**
  161. * Implemented as part of MatFormFieldControl.
  162. * @docs-private
  163. */
  164. get shouldLabelFloat(): boolean;
  165. /**
  166. * Implemented as part of MatFormFieldControl.
  167. * @docs-private
  168. */
  169. setDescribedByIds(ids: string[]): void;
  170. /**
  171. * Implemented as part of MatFormFieldControl.
  172. * @docs-private
  173. */
  174. onContainerClick(): void;
  175. /** Whether the form control is a native select that is displayed inline. */
  176. _isInlineSelect(): boolean;
  177. private _iOSKeyupListener;
  178. private _webkitBlinkWheelListener;
  179. /**
  180. * In blink and webkit browsers a focused number input does not increment or decrement its value
  181. * on mouse wheel interaction unless a wheel event listener is attached to it or one of its
  182. * ancestors or a passive wheel listener is attached somewhere in the DOM. For example: Hitting
  183. * a tooltip once enables the mouse wheel input for all number inputs as long as it exists. In
  184. * order to get reliable and intuitive behavior we apply a wheel event on our own thus making
  185. * sure increment and decrement by mouse wheel works every time.
  186. * @docs-private
  187. */
  188. private _ensureWheelDefaultBehavior;
  189. /** Gets the value to set on the `readonly` attribute. */
  190. protected _getReadonlyAttribute(): string | null;
  191. static ɵfac: i0.ɵɵFactoryDeclaration<MatInput, never>;
  192. static ɵdir: i0.ɵɵDirectiveDeclaration<MatInput, "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", ["matInput"], { "disabled": { "alias": "disabled"; "required": false; }; "id": { "alias": "id"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "name": { "alias": "name"; "required": false; }; "required": { "alias": "required"; "required": false; }; "type": { "alias": "type"; "required": false; }; "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; }; "userAriaDescribedBy": { "alias": "aria-describedby"; "required": false; }; "value": { "alias": "value"; "required": false; }; "readonly": { "alias": "readonly"; "required": false; }; "disabledInteractive": { "alias": "disabledInteractive"; "required": false; }; }, {}, never, never, true, never>;
  193. static ngAcceptInputType_disabledInteractive: unknown;
  194. }
  195. declare class MatInputModule {
  196. static ɵfac: i0.ɵɵFactoryDeclaration<MatInputModule, never>;
  197. static ɵmod: i0.ɵɵNgModuleDeclaration<MatInputModule, never, [typeof MatCommonModule, typeof MatFormFieldModule, typeof MatInput], [typeof MatInput, typeof MatFormFieldModule, typeof i4.TextFieldModule, typeof MatCommonModule]>;
  198. static ɵinj: i0.ɵɵInjectorDeclaration<MatInputModule>;
  199. }
  200. /**
  201. * This token is used to inject the object whose value should be set into `MatInput`. If none is
  202. * provided, the native `HTMLInputElement` is used. Directives like `MatDatepickerInput` can provide
  203. * themselves for this token, in order to make `MatInput` delegate the getting and setting of the
  204. * value to them.
  205. */
  206. declare const MAT_INPUT_VALUE_ACCESSOR: InjectionToken<{
  207. value: any | WritableSignal<any>;
  208. }>;
  209. /** @docs-private */
  210. declare function getMatInputUnsupportedTypeError(type: string): Error;
  211. export { MAT_INPUT_CONFIG, MAT_INPUT_VALUE_ACCESSOR, MatFormField, MatInput, MatInputModule, getMatInputUnsupportedTypeError };
  212. export type { MatInputConfig };