From 645281aa8536ae939de59f849ef1fa071aa523b5 Mon Sep 17 00:00:00 2001 From: Rafael Santana Date: Wed, 12 Aug 2020 19:57:37 -0300 Subject: [PATCH] docs(expansion-panel): fix duplicate selectors and add missing documentation --- .../expansion/expansion-panel-header.ts | 30 ++++++++----------- src/material/expansion/expansion-panel.ts | 23 +++++++------- 2 files changed, 24 insertions(+), 29 deletions(-) diff --git a/src/material/expansion/expansion-panel-header.ts b/src/material/expansion/expansion-panel-header.ts index bbf15d789100..5c795f99a4ab 100644 --- a/src/material/expansion/expansion-panel-header.ts +++ b/src/material/expansion/expansion-panel-header.ts @@ -6,43 +6,41 @@ * found in the LICENSE file at https://angular.io/license */ -import {FocusMonitor, FocusableOption, FocusOrigin} from '@angular/cdk/a11y'; -import {ENTER, SPACE, hasModifierKey} from '@angular/cdk/keycodes'; +import {FocusableOption, FocusMonitor, FocusOrigin} from '@angular/cdk/a11y'; +import {ENTER, hasModifierKey, SPACE} from '@angular/cdk/keycodes'; import { + AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, Directive, ElementRef, Host, + Inject, Input, OnDestroy, - ViewEncapsulation, Optional, - Inject, - AfterViewInit, + ViewEncapsulation, } from '@angular/core'; import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations'; -import {merge, Subscription, EMPTY} from 'rxjs'; +import {EMPTY, merge, Subscription} from 'rxjs'; import {filter} from 'rxjs/operators'; +import {MatAccordionTogglePosition} from './accordion-base'; import {matExpansionAnimations} from './expansion-animations'; import { MatExpansionPanel, MatExpansionPanelDefaultOptions, MAT_EXPANSION_PANEL_DEFAULT_OPTIONS, } from './expansion-panel'; -import {MatAccordionTogglePosition} from './accordion-base'; /** - * `` - * - * This component corresponds to the header element of an ``. + * Header element of a ``. */ @Component({ selector: 'mat-expansion-panel-header', - styleUrls: ['./expansion-panel-header.css'], - templateUrl: './expansion-panel-header.html', + styleUrls: ['expansion-panel-header.css'], + templateUrl: 'expansion-panel-header.html', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, animations: [ @@ -211,9 +209,7 @@ export class MatExpansionPanelHeader implements AfterViewInit, OnDestroy, Focusa } /** - * `` - * - * This directive is to be used inside of the MatExpansionPanelHeader component. + * Description element of a ``. */ @Directive({ selector: 'mat-panel-description', @@ -224,9 +220,7 @@ export class MatExpansionPanelHeader implements AfterViewInit, OnDestroy, Focusa export class MatExpansionPanelDescription {} /** - * `` - * - * This directive is to be used inside of the MatExpansionPanelHeader component. + * Title element of a ``. */ @Directive({ selector: 'mat-panel-title', diff --git a/src/material/expansion/expansion-panel.ts b/src/material/expansion/expansion-panel.ts index 948db239293e..b32ff578ee78 100644 --- a/src/material/expansion/expansion-panel.ts +++ b/src/material/expansion/expansion-panel.ts @@ -11,6 +11,7 @@ import {CdkAccordionItem} from '@angular/cdk/accordion'; import {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion'; import {UniqueSelectionDispatcher} from '@angular/cdk/collections'; import {TemplatePortal} from '@angular/cdk/portal'; +import {DOCUMENT} from '@angular/common'; import { AfterContentInit, ChangeDetectionStrategy, @@ -18,28 +19,27 @@ import { Component, ContentChild, Directive, - EventEmitter, ElementRef, - Input, + EventEmitter, Inject, + InjectionToken, + Input, OnChanges, OnDestroy, Optional, Output, SimpleChanges, SkipSelf, + ViewChild, ViewContainerRef, ViewEncapsulation, - ViewChild, - InjectionToken, } from '@angular/core'; -import {DOCUMENT} from '@angular/common'; import {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations'; import {Subject} from 'rxjs'; -import {filter, startWith, take, distinctUntilChanged} from 'rxjs/operators'; +import {distinctUntilChanged, filter, startWith, take} from 'rxjs/operators'; +import {MatAccordionBase, MatAccordionTogglePosition, MAT_ACCORDION} from './accordion-base'; import {matExpansionAnimations} from './expansion-animations'; import {MatExpansionPanelContent} from './expansion-panel-content'; -import {MAT_ACCORDION, MatAccordionBase, MatAccordionTogglePosition} from './accordion-base'; /** MatExpansionPanel's states. */ export type MatExpansionPanelState = 'expanded' | 'collapsed'; @@ -70,16 +70,14 @@ export const MAT_EXPANSION_PANEL_DEFAULT_OPTIONS = new InjectionToken('MAT_EXPANSION_PANEL_DEFAULT_OPTIONS'); /** - * `` - * * This component can be used as a single element to show expandable content, or as one of * multiple children of an element with the MatAccordion directive attached. */ @Component({ - styleUrls: ['./expansion-panel.css'], + styleUrls: ['expansion-panel.css'], selector: 'mat-expansion-panel', exportAs: 'matExpansionPanel', - templateUrl: './expansion-panel.html', + templateUrl: 'expansion-panel.html', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['disabled', 'expanded'], @@ -246,6 +244,9 @@ export class MatExpansionPanel extends CdkAccordionItem implements AfterContentI static ngAcceptInputType_disabled: BooleanInput; } +/** + * Actions of a ``. + */ @Directive({ selector: 'mat-action-row', host: {