Skip to content

Commit 96d4528

Browse files
committed
chore(IgxColumnGroups): address the requested changes
1 parent 8327d97 commit 96d4528

File tree

6 files changed

+22
-22
lines changed

6 files changed

+22
-22
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ All notable changes for each version of this project will be documented in this
2525
- `sortingExpressionsChange` event emitter is added, which is fired whenever a change to the sorting expressions has occurred (prior to performing the actual sorting).
2626
- `filteringExpressionsTreeChange` event emitter is added, which is fired whenever a change to the filtering expressions has occurred (prior to performing the actual filtering).
2727
- `advancedFilteringExpressionsTreeChange` event emitter is added, which is fired whenever a change to the advanced filtering expressions has occurred (prior to performing the actual filtering).
28-
- `collapsible` and `expand` properties are added to the IgxColumnGroupComponent; `collapsible` property identifies that certain column group is collapsible; `expand` identifies whether the group is expanded or collapsed initially;
29-
- `collapsibleChange` and `expandChange` events are added to the IgxColumnGroupComponent which are emited whenever `collapsible` and `expand` properties are changed accordingly;
28+
- `collapsible` and `expanded` properties are added to the IgxColumnGroupComponent; `collapsible` property identifies that certain column group is collapsible; `expanded` identifies whether the group is expanded or collapsed initially;
29+
- `collapsibleChange` and `expandedChange` events are added to the IgxColumnGroupComponent which are emited whenever `collapsible` and `expanded` properties are changed accordingly;
3030
- `visibleWhenCollapse` property has been added to the IgxColumnComponent; Allows you to set whether the column stay visible when its parrent is collapsed.
3131
- `visibleWhenCollapseChange` events is added to the IgxColumnComponent which are emited whenever `visibleWhenCollapse` property is changed;
3232
- `collapsibleIndicatorTemplate` property is introduced to IgxColumnGroupComponent, which allows you to set a custom template for the expand collapse indicator;

projects/igniteui-angular/src/lib/grids/columns/column-group.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,16 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
6262
* @memberof IgxColumnGroupComponent
6363
*/
6464
@Input()
65-
public set expand(value: boolean) {
65+
public set expanded(value: boolean) {
6666
if (!this.collapsible) { return; }
67-
this._expand = value;
68-
this.expandChange.emit(this._expand);
67+
this._expanded = value;
68+
this.expandedChange.emit(this._expanded);
6969
if (!this.hidden && this.children) {
7070
this.setExpandCollapseState();
7171
}
7272
}
73-
public get expand() {
74-
return this._expand;
73+
public get expanded() {
74+
return this._expanded;
7575
}
7676

7777
/**
@@ -208,7 +208,7 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
208208
} else {
209209
this.children.forEach(c => {
210210
if (c.visibleWhenCollapse === undefined) {c.hidden = false; return; }
211-
c.hidden = this.expand ? c.visibleWhenCollapse : !c.visibleWhenCollapse;
211+
c.hidden = this.expanded ? c.visibleWhenCollapse : !c.visibleWhenCollapse;
212212
});
213213
}
214214
}

projects/igniteui-angular/src/lib/grids/columns/column.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ export class IgxColumnComponent implements AfterContentInit {
253253

254254
/** @hidden */
255255
@Output()
256-
public expandChange = new EventEmitter<boolean>();
256+
public expandedChange = new EventEmitter<boolean>();
257257

258258
/** @hidden */
259259
@Output()
@@ -1050,7 +1050,7 @@ export class IgxColumnComponent implements AfterContentInit {
10501050
* @hidden
10511051
* @internal
10521052
*/
1053-
public expand = true;
1053+
public expanded = true;
10541054

10551055
/**
10561056
* hidden
@@ -1178,7 +1178,7 @@ export class IgxColumnComponent implements AfterContentInit {
11781178
/**
11791179
* @hidden
11801180
*/
1181-
protected _expand = true;
1181+
protected _expanded = true;
11821182
/**
11831183
* @hidden
11841184
*/
@@ -1769,7 +1769,7 @@ export class IgxColumnComponent implements AfterContentInit {
17691769
*/
17701770
protected setExpandCollapseState() {
17711771
this.children.filter(col => (col.visibleWhenCollapse !== undefined)).forEach(c => {
1772-
c.hidden = this._expand ? c.visibleWhenCollapse : !c.visibleWhenCollapse;
1772+
c.hidden = this._expanded ? c.visibleWhenCollapse : !c.visibleWhenCollapse;
17731773
});
17741774
}
17751775

projects/igniteui-angular/src/lib/grids/headers/grid-header-group.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@
2626

2727
<ng-template #defaultCollapseIndicator>
2828
<igx-icon [attr.draggable]="false" >
29-
{{column.expand ? 'expand_more' : 'chevron_right'}} </igx-icon>
29+
{{column.expanded ? 'expand_more' : 'chevron_right'}} </igx-icon>
3030
</ng-template>
3131

3232
<ng-container *ngIf="!grid.hasColumnLayouts && column.columnGroup">
3333
<span *ngIf="grid.hasMovableColumns" class="igx-grid__th-drop-indicator-left"></span>
3434
<div class="igx-grid__thead-title"
3535
role="columnheader"
3636
[attr.aria-label]="column.header || column.field"
37-
[attr.aria-expanded]="column.expand"
37+
[attr.aria-expanded]="column.expanded"
3838
tabindex="0"
3939
[ngClass]="{'igx-grid__th--pinned-last': hasLastPinnedChildColumn, 'igx-grid__th--collapsible': column.collapsible}"
4040
[igxColumnMovingDrag]="column"
4141
[ghostHost]="grid.outletDirective.nativeElement"
4242
[attr.droppable]="true"
4343
[igxColumnMovingDrop]="column">
4444
<ng-container *ngIf="column.collapsible">
45-
<div (click)="column.expand = !column.expand">
45+
<div (click)="column.expanded = !column.expanded">
4646
<ng-container
4747
*ngTemplateOutlet="column.collapsibleIndicatorTemplate ? column.collapsibleIndicatorTemplate : defaultCollapseIndicator; context: {$implicit: column, column: column}">
4848
</ng-container>

src/app/grid-column-groups/grid-column-groups.sample.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
<app-page-header title="Grid Column Groups"></app-page-header>
33
<section style="height: 800px" class="sample-content">
44
<ng-template igxCollapsibleIndicator let-column="column" #ind >
5-
<igx-icon [attr.draggable]="false">{{column.expand ? 'remove' : 'add'}} </igx-icon>
5+
<igx-icon [attr.draggable]="false">{{column.expanded ? 'remove' : 'add'}} </igx-icon>
66
</ng-template>
77
<igx-grid [allowFiltering]="true" [rowSelectable]="false" #grid [data]="data" displayDensity="compact" [showToolbar]="true" [allowAdvancedFiltering]="true" [columnHiding]="true">
88
<igx-column [movable]="true" [resizable]="true" [pinned]="true" field="Missing"></igx-column>
9-
<igx-column-group [movable]="true" header="General Information" [collapsible]="true" [expand]="true" [hidden]="true">
9+
<igx-column-group [movable]="true" header="General Information" [collapsible]="true" [expanded]="true" [hidden]="true">
1010
<igx-column [movable]="true" [filterable]="false" [hidden]="true" sortable="true" resizable="true" field="CompanyName" width="200px" [visibleWhenCollapse]="false"></igx-column>
1111
<igx-column field="Missing"></igx-column>
12-
<igx-column-group [movable]="true" header="Person Details" [collapsible]="true" [expand]="false" [visibleWhenCollapse]="true">
12+
<igx-column-group [movable]="true" header="Person Details" [collapsible]="true" [expanded]="false" [visibleWhenCollapse]="true">
1313
<igx-column [movable]="true" [visibleWhenCollapse]="false" [hidden]="true" filterable="true" sortable="true" resizable="true" field="ContactName"></igx-column>
1414
<igx-column [movable]="true" [visibleWhenCollapse]="false" [pinned]="true" filterable="true" sortable="true" resizable="true" field="ContactTitle"></igx-column>
1515
</igx-column-group>
1616
<ng-template igxCollapsibleIndicator let-column="column" #ind >
17-
<igx-icon [attr.draggable]="false">{{column.expand ? 'remove' : 'add'}} </igx-icon>
17+
<igx-icon [attr.draggable]="false">{{column.expanded ? 'remove' : 'add'}} </igx-icon>
1818
</ng-template>
1919
</igx-column-group>
2020
<igx-column [movable]="true" [hidden]="s" [resizable]="true" field="ID" editable="true"></igx-column>
21-
<igx-column-group [movable]="true" header="Address Information" [(collapsible)]='s' [expand]='true'>
21+
<igx-column-group [movable]="true" header="Address Information" [(collapsible)]='s' [expanded]='true'>
2222
<igx-column [movable]="true" filterable="true" sortable="true" resizable="true" field="Country" [visibleWhenCollapse]= 'false'></igx-column>
2323
<igx-column [movable]="true" filterable="true" sortable="true" resizable="true" field="Region" [visibleWhenCollapse]= 'false'></igx-column>
2424
<igx-column [movable]="true" filterable="true" sortable="true" resizable="true" field="City" [visibleWhenCollapse]= 'false'></igx-column>

src/app/grid-column-groups/grid-column-groups.sample.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ export class GridColumnGroupsSampleComponent implements AfterViewInit {
6868
col.hidden = !col.hidden;
6969
this.grid.getColumnByName('CompanyName').hidden = true;
7070
console.log(this.grid.getColumnByName('CompanyName').parent); */
71-
(this.grid.columnList.filter(c => c.header === 'Address Information')[0] as any).expand =
72-
!(this.grid.columnList.filter(c => c.header === 'Address Information')[0] as any).expand;
71+
(this.grid.columnList.filter(c => c.header === 'Address Information')[0] as any).expanded =
72+
!(this.grid.columnList.filter(c => c.header === 'Address Information')[0] as any).expanded;
7373

7474
}
7575

0 commit comments

Comments
 (0)