Skip to content

Commit a40ad26

Browse files
rafaelss95jelbourn
authored andcommitted
core(expansion-panel): fix typos and extra whitespace (#5659)
1 parent 0eedb5f commit a40ad26

8 files changed

+29
-28
lines changed

src/lib/expansion/_expansion-theme.scss

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@
1414
border-top-color: mat-color($foreground, divider);
1515
}
1616

17-
.mat-expansion-panel-header:focus,
17+
.mat-expansion-panel-header:focus,
1818
.mat-expansion-panel-header:hover {
1919
background: mat-color($background, hover);
2020
}
21+
2122
.mat-expansion-panel-header-title {
2223
color: mat-color($foreground, text);
2324
}
@@ -29,4 +30,4 @@
2930
.mat-expansion-indicator::after {
3031
color: mat-color($foreground, secondary-text);
3132
}
32-
}
33+
}

src/lib/expansion/accordion-item.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ let nextId = 0;
2727
*/
2828
@Injectable()
2929
export class AccordionItem implements OnDestroy {
30-
/** Event emitted every time the MdAccordianChild is closed. */
30+
/** Event emitted every time the MdAccordionChild is closed. */
3131
@Output() closed = new EventEmitter<void>();
32-
/** Event emitted every time the MdAccordianChild is opened. */
32+
/** Event emitted every time the MdAccordionChild is opened. */
3333
@Output() opened = new EventEmitter<void>();
34-
/** Event emitted when the MdAccordianChild is destroyed. */
34+
/** Event emitted when the MdAccordionChild is destroyed. */
3535
@Output() destroyed = new EventEmitter<void>();
36-
/** The unique MdAccordianChild id. */
36+
/** The unique MdAccordionChild id. */
3737
readonly id = `cdk-accordion-child-${nextId++}`;
38-
/** Whether the MdAccordianChild is expanded. */
38+
/** Whether the MdAccordionChild is expanded. */
3939
@Input() get expanded(): boolean { return this._expanded; }
4040
set expanded(expanded: boolean) {
4141
// Only emit events and update the internal value if the value changes.
@@ -44,10 +44,10 @@ export class AccordionItem implements OnDestroy {
4444
if (expanded) {
4545
this.opened.emit();
4646
/**
47-
* In the unique selection dispatcher, the id parameter is the id of the CdkAccordonItem,
47+
* In the unique selection dispatcher, the id parameter is the id of the CdkAccordionItem,
4848
* the name value is the id of the accordion.
4949
*/
50-
let accordionId = this.accordion ? this.accordion.id : this.id;
50+
const accordionId = this.accordion ? this.accordion.id : this.id;
5151
this._expansionDispatcher.notify(this.id, accordionId);
5252
} else {
5353
this.closed.emit();
@@ -66,14 +66,14 @@ export class AccordionItem implements OnDestroy {
6666
constructor(@Optional() public accordion: CdkAccordion,
6767
private _changeDetectorRef: ChangeDetectorRef,
6868
protected _expansionDispatcher: UniqueSelectionDispatcher) {
69-
this._removeUniqueSelectionListener =
70-
_expansionDispatcher.listen((id: string, accordionId: string) => {
71-
if (this.accordion && !this.accordion.multi &&
72-
this.accordion.id === accordionId && this.id !== id) {
73-
this.expanded = false;
74-
}
75-
});
76-
}
69+
this._removeUniqueSelectionListener =
70+
_expansionDispatcher.listen((id: string, accordionId: string) => {
71+
if (this.accordion && !this.accordion.multi &&
72+
this.accordion.id === accordionId && this.id !== id) {
73+
this.expanded = false;
74+
}
75+
});
76+
}
7777

7878
/** Emits an event for the accordion item being destroyed. */
7979
ngOnDestroy() {

src/lib/expansion/accordion.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ describe('CdkAccordion', () => {
2020
}));
2121

2222
it('should ensure only one item is expanded at a time', () => {
23-
let fixture = TestBed.createComponent(SetOfItems);
24-
let items = fixture.debugElement.queryAll(By.css('.mat-expansion-panel'));
23+
const fixture = TestBed.createComponent(SetOfItems);
24+
const items = fixture.debugElement.queryAll(By.css('.mat-expansion-panel'));
2525

2626
fixture.componentInstance.firstPanelExpanded = true;
2727
fixture.detectChanges();
@@ -35,8 +35,8 @@ describe('CdkAccordion', () => {
3535
});
3636

3737
it('should allow multiple items to be expanded simultaneously', () => {
38-
let fixture = TestBed.createComponent(SetOfItems);
39-
let panels = fixture.debugElement.queryAll(By.css('.mat-expansion-panel'));
38+
const fixture = TestBed.createComponent(SetOfItems);
39+
const panels = fixture.debugElement.queryAll(By.css('.mat-expansion-panel'));
4040

4141
fixture.componentInstance.multi = true;
4242
fixture.componentInstance.firstPanelExpanded = true;

src/lib/expansion/expansion-panel-header.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
<ng-content select="md-panel-description, mat-panel-description"></ng-content>
44
<ng-content></ng-content>
55
</span>
6-
<span [@indicatorRotate]="_getExpandedState()" *ngIf="!_getHideToggle()"
7-
class="mat-expansion-indicator"></span>
6+
<span [@indicatorRotate]="_getExpandedState()" *ngIf="!_getHideToggle()"
7+
class="mat-expansion-indicator"></span>

src/lib/expansion/expansion-panel-header.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ $mat-expansion-panel-header-height-expanded: 64px;
1414
line-height: $mat-expansion-panel-header-height-expanded;
1515
}
1616

17-
&:focus,
17+
&:focus,
1818
&:hover {
1919
outline: none;
2020
}
@@ -46,7 +46,7 @@ $mat-expansion-panel-header-height-expanded: 64px;
4646
margin-right: 16px;
4747
}
4848

49-
/**
49+
/**
5050
* Creates the expansion indicator arrow. Done using ::after rather than having
5151
* additional nodes in the template.
5252
*/

src/lib/expansion/expansion-panel.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
<ng-content></ng-content>
66
</div>
77
<ng-content select="mat-action-row, md-action-row"></ng-content>
8-
</div>
8+
</div>

src/lib/expansion/expansion-panel.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
button.mat-button {
3131
margin-left: 8px;
3232
}
33-
}
33+
}

src/lib/expansion/expansion.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('MdExpansionPanel', () => {
1919
TestBed.compileComponents();
2020
}));
2121

22-
it('should expanded and collapse the panel', () => {
22+
it('should expand and collapse the panel', () => {
2323
const fixture = TestBed.createComponent(PanelWithContent);
2424
const contentEl = fixture.debugElement.query(By.css('.mat-expansion-panel-content'));
2525
const headerEl = fixture.debugElement.query(By.css('.mat-expansion-panel-header'));

0 commit comments

Comments
 (0)