/** * @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, ElementRef, Inject, Optional } from '@angular/core'; import { LIST_OPTION } from './list-option-types'; import * as i0 from "@angular/core"; /** * Directive capturing the title of a list item. A list item usually consists of a * title and optional secondary or tertiary lines. * * Text content for the title never wraps. There can only be a single title per list item. */ export class MatListItemTitle { constructor(_elementRef) { this._elementRef = _elementRef; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatListItemTitle, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: MatListItemTitle, selector: "[matListItemTitle]", host: { classAttribute: "mat-mdc-list-item-title mdc-list-item__primary-text" }, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatListItemTitle, decorators: [{ type: Directive, args: [{ selector: '[matListItemTitle]', host: { 'class': 'mat-mdc-list-item-title mdc-list-item__primary-text' }, }] }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } }); /** * Directive capturing a line in a list item. A list item usually consists of a * title and optional secondary or tertiary lines. * * Text content inside a line never wraps. There can be at maximum two lines per list item. */ export class MatListItemLine { constructor(_elementRef) { this._elementRef = _elementRef; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatListItemLine, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: MatListItemLine, selector: "[matListItemLine]", host: { classAttribute: "mat-mdc-list-item-line mdc-list-item__secondary-text" }, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatListItemLine, decorators: [{ type: Directive, args: [{ selector: '[matListItemLine]', host: { 'class': 'mat-mdc-list-item-line mdc-list-item__secondary-text' }, }] }], ctorParameters: function () { return [{ type: i0.ElementRef }]; } }); /** * Directive matching an optional meta section for list items. * * List items can reserve space at the end of an item to display a control, * button or additional text content. */ export class MatListItemMeta { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatListItemMeta, deps: [], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: MatListItemMeta, selector: "[matListItemMeta]", host: { classAttribute: "mat-mdc-list-item-meta mdc-list-item__end" }, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatListItemMeta, decorators: [{ type: Directive, args: [{ selector: '[matListItemMeta]', host: { 'class': 'mat-mdc-list-item-meta mdc-list-item__end' }, }] }] }); /** * @docs-private * * MDC uses the very intuitively named classes `.mdc-list-item__start` and `.mat-list-item__end` to * position content such as icons or checkboxes/radios that comes either before or after the text * content respectively. This directive detects the placement of the checkbox/radio and applies the * correct MDC class to position the icon/avatar on the opposite side. */ export class _MatListItemGraphicBase { constructor(_listOption) { this._listOption = _listOption; } _isAlignedAtStart() { // By default, in all list items the graphic is aligned at start. In list options, // the graphic is only aligned at start if the checkbox/radio is at the end. return !this._listOption || this._listOption?._getTogglePosition() === 'after'; } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: _MatListItemGraphicBase, deps: [{ token: LIST_OPTION, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: _MatListItemGraphicBase, host: { properties: { "class.mdc-list-item__start": "_isAlignedAtStart()", "class.mdc-list-item__end": "!_isAlignedAtStart()" } }, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: _MatListItemGraphicBase, decorators: [{ type: Directive, args: [{ host: { // MDC uses intuitively named classes `.mdc-list-item__start` and `.mat-list-item__end` to // position content such as icons or checkboxes/radios that comes either before or after the // text content respectively. This directive detects the placement of the checkbox/radio and // applies the correct MDC class to position the icon/avatar on the opposite side. '[class.mdc-list-item__start]': '_isAlignedAtStart()', '[class.mdc-list-item__end]': '!_isAlignedAtStart()', }, }] }], ctorParameters: function () { return [{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [LIST_OPTION] }] }]; } }); /** * Directive matching an optional avatar within a list item. * * List items can reserve space at the beginning of an item to display an avatar. */ export class MatListItemAvatar extends _MatListItemGraphicBase { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatListItemAvatar, deps: null, target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: MatListItemAvatar, selector: "[matListItemAvatar]", host: { classAttribute: "mat-mdc-list-item-avatar" }, usesInheritance: true, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatListItemAvatar, decorators: [{ type: Directive, args: [{ selector: '[matListItemAvatar]', host: { 'class': 'mat-mdc-list-item-avatar' }, }] }] }); /** * Directive matching an optional icon within a list item. * * List items can reserve space at the beginning of an item to display an icon. */ export class MatListItemIcon extends _MatListItemGraphicBase { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatListItemIcon, deps: null, target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: MatListItemIcon, selector: "[matListItemIcon]", host: { classAttribute: "mat-mdc-list-item-icon" }, usesInheritance: true, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatListItemIcon, decorators: [{ type: Directive, args: [{ selector: '[matListItemIcon]', host: { 'class': 'mat-mdc-list-item-icon' }, }] }] }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlzdC1pdGVtLXNlY3Rpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL2xpc3QvbGlzdC1pdGVtLXNlY3Rpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRztBQUVILE9BQU8sRUFBQyxTQUFTLEVBQUUsVUFBVSxFQUFFLE1BQU0sRUFBRSxRQUFRLEVBQUMsTUFBTSxlQUFlLENBQUM7QUFDdEUsT0FBTyxFQUFDLFdBQVcsRUFBYSxNQUFNLHFCQUFxQixDQUFDOztBQUU1RDs7Ozs7R0FLRztBQUtILE1BQU0sT0FBTyxnQkFBZ0I7SUFDM0IsWUFBbUIsV0FBb0M7UUFBcEMsZ0JBQVcsR0FBWCxXQUFXLENBQXlCO0lBQUcsQ0FBQzs4R0FEaEQsZ0JBQWdCO2tHQUFoQixnQkFBZ0I7OzJGQUFoQixnQkFBZ0I7a0JBSjVCLFNBQVM7bUJBQUM7b0JBQ1QsUUFBUSxFQUFFLG9CQUFvQjtvQkFDOUIsSUFBSSxFQUFFLEVBQUMsT0FBTyxFQUFFLHFEQUFxRCxFQUFDO2lCQUN2RTs7QUFLRDs7Ozs7R0FLRztBQUtILE1BQU0sT0FBTyxlQUFlO0lBQzFCLFlBQW1CLFdBQW9DO1FBQXBDLGdCQUFXLEdBQVgsV0FBVyxDQUF5QjtJQUFHLENBQUM7OEdBRGhELGVBQWU7a0dBQWYsZUFBZTs7MkZBQWYsZUFBZTtrQkFKM0IsU0FBUzttQkFBQztvQkFDVCxR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