Skip to content

Commit 76f2747

Browse files
committed
chore(*): moving hostbindings to template for ivy
1 parent cb0721d commit 76f2747

15 files changed

+59
-53
lines changed

projects/igniteui-angular/src/lib/grids/cell.component.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,6 @@ export class IgxGridCellComponent implements OnInit, OnChanges, OnDestroy {
417417
* ```
418418
* @memberof IgxGridCellComponent
419419
*/
420-
@HostBinding('style.min-width')
421-
@HostBinding('style.max-width')
422-
@HostBinding('style.flex-basis')
423420
@Input()
424421
width = '';
425422

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ export class IgxColumnComponent implements AfterContentInit {
313313
this._calcWidth = null;
314314
this.calcPixelWidth = NaN;
315315
this.widthSetByUser = true;
316-
this._width = value;
316+
this._width = typeof(value) === 'number' ? value + 'px' : value;
317317
if (this.grid) {
318318
this.cacheCalcWidth();
319319
}

projects/igniteui-angular/src/lib/grids/grid-base.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4278,7 +4278,7 @@ export class IgxGridBaseComponent extends DisplayDensityBase implements
42784278
const columnWidthCombined = parseInt(this._columnWidth, 10) * (column.colEnd ? column.colEnd - column.colStart : 1);
42794279
column.defaultWidth = columnWidthCombined + 'px';
42804280
} else {
4281-
column.defaultWidth = this._columnWidth;
4281+
column.defaultWidth = this._columnWidth + 'px';
42824282
column.resetCaches();
42834283
}
42844284
});

projects/igniteui-angular/src/lib/grids/grid/grid-row.component.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@
3131
[lastPinned]="col.isLastPinned"
3232
[style.min-height.px]="grid.rowHeight || 32"
3333
[rowData]="rowData"
34-
[style.min-width.px]="col.width"
35-
[style.flex-basis.px]="col.width"
34+
[style.min-width]="col.width"
35+
[style.max-width]="col.width"
36+
[style.flex-basis]="col.width"
3637
[width]="col.getCellWidth()"
3738
[visibleColumnIndex]="col.visibleIndex"
3839
[value]="rowData[col.field]"
@@ -51,8 +52,9 @@
5152
[row]="this"
5253
[style.min-height.px]="grid.rowHeight || 32"
5354
[rowData]="rowData"
54-
[style.min-width.px]="col.width"
55-
[style.flex-basis.px]="col.width"
55+
[style.min-width]="col.width"
56+
[style.max-width]="col.width"
57+
[style.flex-basis]="col.width"
5658
[width]="col.getCellWidth()"
5759
[visibleColumnIndex]="col.visibleIndex"
5860
[value]="rowData[col.field]"

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,16 @@
7373
</ng-container>
7474
<ng-container *ngIf="pinnedColumns.length > 0">
7575
<ng-template ngFor let-col [ngForOf]="pinnedColumns | igxTopLevel">
76-
<igx-grid-header-group [column]="col" [gridID]="id" [style.min-width.px]="getHeaderGroupWidth(col)"
77-
[style.flex-basis.px]="getHeaderGroupWidth(col)"></igx-grid-header-group>
76+
<igx-grid-header-group [column]="col" [gridID]="id" [style.min-width]="getHeaderGroupWidth(col)"
77+
[style.flex-basis]="getHeaderGroupWidth(col)"></igx-grid-header-group>
7878
</ng-template>
7979
</ng-container>
8080
<ng-template igxGridFor let-col [igxGridForOf]="unpinnedColumns | igxTopLevel"
8181
[igxForScrollOrientation]="'horizontal'" [igxForScrollContainer]="parentVirtDir"
8282
[igxForContainerSize]='unpinnedWidth' [igxForTrackBy]='trackColumnChanges'
8383
[igxForSizePropName]='"calcPixelWidth"' #headerContainer>
84-
<igx-grid-header-group [column]="col" [gridID]="id" [style.min-width.px]="getHeaderGroupWidth(col)"
85-
[style.flex-basis.px]="getHeaderGroupWidth(col)"></igx-grid-header-group>
84+
<igx-grid-header-group [column]="col" [gridID]="id" [style.min-width]="getHeaderGroupWidth(col)"
85+
[style.flex-basis]="getHeaderGroupWidth(col)"></igx-grid-header-group>
8686
</ng-template>
8787
</div>
8888
<igx-grid-filtering-row #filteringRow [style.width.px]='calcWidth' *ngIf="filteringService.isFilterRowVisible"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838
<igx-grid-header-group *ngIf="!child.hidden" class="igx-grid__thead-subgroup"
3939
[column]="child"
4040
[gridID]="child.grid.id"
41-
[style.min-width.px]="grid.getHeaderGroupWidth(child)"
42-
[style.flex-basis.px]="grid.getHeaderGroupWidth(child)">
41+
[style.min-width]="grid.getHeaderGroupWidth(child)"
42+
[style.flex-basis]="grid.getHeaderGroupWidth(child)">
4343
</igx-grid-header-group>
4444
</ng-container>
4545
</div>

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ export class IgxGridHeaderGroupComponent implements DoCheck {
105105
* Gets the width of the header group.
106106
* @memberof IgxGridHeaderGroupComponent
107107
*/
108-
@HostBinding('style.min-width')
109-
@HostBinding('style.flex-basis')
110108
get width() {
111109
return this.grid.getHeaderGroupWidth(this.column);
112110
}

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-grid.component.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@
4646
</ng-container>
4747
<ng-container *ngIf="pinnedColumns.length > 0">
4848
<ng-template ngFor let-col [ngForOf]="pinnedColumns | igxTopLevel">
49-
<igx-grid-header-group [column]="col" [gridID]="id" [style.min-width.px]="getHeaderGroupWidth(col)"
50-
[style.flex-basis.px]="getHeaderGroupWidth(col)"></igx-grid-header-group>
49+
<igx-grid-header-group [column]="col" [gridID]="id" [style.min-width]="getHeaderGroupWidth(col)"
50+
[style.flex-basis]="getHeaderGroupWidth(col)"></igx-grid-header-group>
5151
</ng-template>
5252
</ng-container>
5353
<ng-template igxGridFor let-col [igxGridForOf]="unpinnedColumns | igxTopLevel"
5454
[igxForScrollOrientation]="'horizontal'" [igxForScrollContainer]="parentVirtDir"
5555
[igxForContainerSize]='unpinnedWidth' [igxForTrackBy]='trackColumnChanges'
5656
[igxForSizePropName]='"calcPixelWidth"' #headerContainer>
57-
<igx-grid-header-group [column]="col" [gridID]="id" [style.min-width.px]="getHeaderGroupWidth(col)"
58-
[style.flex-basis.px]="getHeaderGroupWidth(col)"></igx-grid-header-group>
57+
<igx-grid-header-group [column]="col" [gridID]="id" [style.min-width]="getHeaderGroupWidth(col)"
58+
[style.flex-basis]="getHeaderGroupWidth(col)"></igx-grid-header-group>
5959
</ng-template>
6060
</div>
6161
<igx-grid-filtering-row #filteringRow [style.width.px]='calcWidth' *ngIf="filteringService.isFilterRowVisible"

projects/igniteui-angular/src/lib/grids/hierarchical-grid/hierarchical-row.component.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545
[lastPinned]="col.isLastPinned"
4646
[style.min-height.px]="grid.rowHeight || 32"
4747
[rowData]="rowData"
48-
[style.min-width.px]="col.width"
49-
[style.flex-basis.px]="col.width"
48+
[style.min-width]="col.width"
49+
[style.max-width]="col.width"
50+
[style.flex-basis]="col.width"
5051
[width]="col.getCellWidth()"
5152
[visibleColumnIndex]="col.visibleIndex"
5253
[value]="rowData[col.field]"
@@ -66,8 +67,9 @@
6667
[row]="this"
6768
[style.min-height.px]="grid.rowHeight || 32"
6869
[rowData]="rowData"
69-
[style.min-width.px]="col.width"
70-
[style.flex-basis.px]="col.width"
70+
[style.min-width]="col.width"
71+
[style.max-width]="col.width"
72+
[style.flex-basis]="col.width"
7173
[width]="col.getCellWidth()"
7274
[visibleColumnIndex]="col.visibleIndex"
7375
[value]="rowData[col.field]"

projects/igniteui-angular/src/lib/grids/summaries/summary-cell.component.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,6 @@ export class IgxSummaryCellComponent {
128128
}
129129
}
130130

131-
@HostBinding('style.min-width')
132-
@HostBinding('style.max-width')
133-
@HostBinding('style.flex-basis')
134131
get width() {
135132
return this.column.getCellWidth();
136133
}

0 commit comments

Comments
 (0)