/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import { Directive, InjectionToken, Input } from '@angular/core'; import * as i0 from "@angular/core"; let nextUniqueId = 0; /** * Injection token that can be used to reference instances of `MatHint`. It serves as * alternative token to the actual `MatHint` class which could cause unnecessary * retention of the class and its directive metadata. * * *Note*: This is not part of the public API as the MDC-based form-field will not * need a lightweight token for `MatHint` and we want to reduce breaking changes. * * @deprecated Use `_MAT_HINT` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. * @breaking-change 17.0.0 */ export const _MAT_LEGACY_HINT = new InjectionToken('MatHint'); /** * Hint text to be shown underneath the form field control. * @deprecated Use `MatHint` from `@angular/material/form-field` instead. See https://material.angular.io/guide/mdc-migration for information about migrating. * @breaking-change 17.0.0 */ export class MatLegacyHint { constructor() { /** Whether to align the hint label at the start or end of the line. */ this.align = 'start'; /** Unique ID for the hint. Used for the aria-describedby on the form field control. */ this.id = `mat-hint-${nextUniqueId++}`; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatLegacyHint, deps: [], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: MatLegacyHint, selector: "mat-hint", inputs: { align: "align", id: "id" }, host: { properties: { "class.mat-form-field-hint-end": "align === \"end\"", "attr.id": "id", "attr.align": "null" }, classAttribute: "mat-hint" }, providers: [{ provide: _MAT_LEGACY_HINT, useExisting: MatLegacyHint }], ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatLegacyHint, decorators: [{ type: Directive, args: [{ selector: 'mat-hint', host: { 'class': 'mat-hint', '[class.mat-form-field-hint-end]': 'align === "end"', '[attr.id]': 'id', // Remove align attribute to prevent it from interfering with layout. '[attr.align]': 'null', }, providers: [{ provide: _MAT_LEGACY_HINT, useExisting: MatLegacyHint }], }] }], propDecorators: { align: [{ type: Input }], id: [{ type: Input }] } }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGludC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tYXRlcmlhbC9sZWdhY3ktZm9ybS1maWVsZC9oaW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBQyxTQUFTLEVBQUUsY0FBYyxFQUFFLEtBQUssRUFBQyxNQUFNLGVBQWUsQ0FBQzs7QUFFL0QsSUFBSSxZQUFZLEdBQUcsQ0FBQyxDQUFDO0FBRXJCOzs7Ozs7Ozs7O0dBVUc7QUFDSCxNQUFNLENBQUMsTUFBTSxnQkFBZ0IsR0FBRyxJQUFJLGNBQWMsQ0FBZ0IsU0FBUyxDQUFDLENBQUM7QUFFN0U7Ozs7R0FJRztBQVlILE1BQU0sT0FBTyxhQUFhO0lBWDFCO1FBWUUsdUVBQXVFO1FBQzlELFVBQUssR0FBb0IsT0FBTyxDQUFDO1FBRTFDLHVGQUF1RjtRQUM5RSxPQUFFLEdBQVcsWUFBWSxZQUFZLEVBQUUsRUFBRSxDQUFDO0tBQ3BEOzhHQU5ZLGFBQWE7a0dBQWIsYUFBYSw0TkFGYixDQUFDLEVBQUMsT0FBTyxFQUFFLGdCQUFnQixFQUFFLFdBQVcsRUFBRSxhQUFhLEVBQUMsQ0FBQzs7MkZBRXpELGFBQWE7a0JBWHpCLFNBQVM7bUJBQUM7b0JBQ1QsUUFBUSxFQUFFLFVBQVU7b0JBQ3BCLElBQUksRUFBRTt3QkFDSixPQUFPLEVBQUUsVUFBVTt3QkFDbkIsaUNBQWlDLEVBQUUsaUJBQWlCO3dCQUNwRCxXQUFXLEVBQUUsSUFBSTt3QkFDakIscUVBQXFFO3dC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