Skip to content

Commit

Permalink
fix(grid): fix unnecessary empty div #8978
Browse files Browse the repository at this point in the history
  • Loading branch information
Volen99 committed Sep 27, 2021
1 parent 66876e7 commit 2e6abdc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 22 deletions.
12 changes: 4 additions & 8 deletions projects/igniteui-angular/src/lib/grids/cell.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>
</ng-template>
<ng-template #defaultCell>
<div
<div *ngIf="column.dataType !== 'boolean' || (column.dataType === 'boolean' && this.formatter)"
igxTextHighlight
class="igx-grid__td-text"
style="pointer-events: none;"
Expand All @@ -26,8 +26,6 @@
? (value | currency:currencyCode:column.pipeArgs.display:column.pipeArgs.digitsInfo:grid.locale)
: column.dataType === 'percent'
? (value | percent:column.pipeArgs.digitsInfo:grid.locale)
: column.dataType === 'boolean'
? ''
: value
"
[row]="rowData"
Expand All @@ -45,8 +43,6 @@
? (value | currency:currencyCode:column.pipeArgs.display:column.pipeArgs.digitsInfo:grid.locale)
: column.dataType === 'percent'
? (value | percent:column.pipeArgs.digitsInfo:grid.locale)
: column.dataType === 'boolean'
? ''
: value
}}</div>
<igx-icon
Expand All @@ -56,16 +52,16 @@
>
</ng-template>
<ng-template #addRowCell let-cell="cell">
<div igxTextHighlight class="igx-grid__td-text" style="pointer-events: none"
<div *ngIf="column.dataType !== 'boolean' || (column.dataType === 'boolean' && this.formatter)"
igxTextHighlight class="igx-grid__td-text" style="pointer-events: none"
[cssClass]="highlightClass"
[activeCssClass]="activeHighlightClass"
[groupName]="gridID"
[value]="formatter ? (value | columnFormatter:formatter:rowData) : column.dataType === 'number' ?
(value | number:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === 'date' ?
(value | date:column.pipeArgs.format:column.pipeArgs.timezone:grid.locale) : column.dataType === 'currency' ?
(value | currency:currencyCode:column.pipeArgs.display:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === 'percent' ?
(value | percent:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === 'boolean' ?
'' : value"
(value | percent:column.pipeArgs.digitsInfo:grid.locale) : value"
[row]="rowData"
[column]="this.column.field"
[containerClass]="'igx-grid__td-text'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<igx-chip *ngIf="displayPinnedChip" class="igx-grid__td--pinned-chip" [disabled]="true" [displayDensity]="'compact'">{{ grid.resourceStrings.igx_grid_pinned_row_indicator }}</igx-chip>
</ng-template>
<ng-template #defaultCell>
<div igxTextHighlight class="igx-grid__td-text" style="pointer-events: none"
<div *ngIf="column.dataType !== 'boolean' || (column.dataType === 'boolean' && this.formatter)"
igxTextHighlight class="igx-grid__td-text" style="pointer-events: none"
[cssClass]="highlightClass"
[activeCssClass]="activeHighlightClass"
[groupName]="gridID"
Expand All @@ -15,8 +16,6 @@
? (value | currency:currencyCode:column.pipeArgs.display:column.pipeArgs.digitsInfo:grid.locale)
: column.dataType === 'percent'
? (value | percent:column.pipeArgs.digitsInfo:grid.locale)
: column.dataType === 'boolean'
? ''
: value"
[row]="rowData"
[column]="this.column.field"
Expand All @@ -25,8 +24,7 @@
? (value | number:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === "date"
? (value | date:column.pipeArgs.format:column.pipeArgs.timezone:grid.locale) : column.dataType === 'currency'
? (value | currency:currencyCode:column.pipeArgs.display:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === 'percent'
? (value | percent:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === 'boolean'
? '' : value}}</div>
? (value | percent:column.pipeArgs.digitsInfo:grid.locale) : value}}</div>

<igx-icon
*ngIf="column.dataType === 'boolean' && !this.formatter"
Expand All @@ -35,16 +33,16 @@
>
</ng-template>
<ng-template #addRowCell let-cell="cell">
<div igxTextHighlight class="igx-grid__td-text" style="pointer-events: none"
<div *ngIf="column.dataType !== 'boolean' || (column.dataType === 'boolean' && this.formatter)"
igxTextHighlight class="igx-grid__td-text" style="pointer-events: none"
[cssClass]="highlightClass"
[activeCssClass]="activeHighlightClass"
[groupName]="gridID"
[value]="formatter ? (value | columnFormatter:formatter:rowData) : column.dataType === 'number' ?
(value | number:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === 'date' ?
(value | date:column.pipeArgs.format:column.pipeArgs.timezone:grid.locale) : column.dataType === 'currency'?
(value | currency:currencyCode:column.pipeArgs.display:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === 'percent' ?
(value | percent:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === 'boolean' ?
'' : value"
(value | percent:column.pipeArgs.digitsInfo:grid.locale) : value"
[row]="rowData"
[column]="this.column.field"
[containerClass]="'igx-grid__td-text'"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
>
</ng-template>
<ng-template #defaultCell>
<div
<div *ngIf="column.dataType !== 'boolean' || (column.dataType === 'boolean' && this.formatter)"
igxTextHighlight
class="igx-grid__td-text"
style="pointer-events: none;"
Expand Down Expand Up @@ -43,8 +43,6 @@
? (value | currency:currencyCode:column.pipeArgs.display:column.pipeArgs.digitsInfo:grid.locale)
: column.dataType === 'percent'
? (value | percent:column.pipeArgs.digitsInfo:grid.locale)
: column.dataType === 'boolean'
? ''
: value
}}</div>
<igx-icon
Expand All @@ -54,16 +52,17 @@
>
</ng-template>
<ng-template #addRowCell let-cell="cell">
<div igxTextHighlight class="igx-grid__td-text" style="pointer-events: none"
<div *ngIf="column.dataType !== 'boolean' || (column.dataType === 'boolean' && this.formatter)"
igxTextHighlight class="igx-grid__td-text"
style="pointer-events: none"
[cssClass]="highlightClass"
[activeCssClass]="activeHighlightClass"
[groupName]="gridID"
[value]="formatter ? (value | columnFormatter:formatter:rowData) : column.dataType === 'number' ?
(value | number:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === 'date' ?
(value | date:column.pipeArgs.format:column.pipeArgs.timezone:grid.locale) : column.dataType === 'currency'?
(value | currency:currencyCode:column.pipeArgs.display:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === 'percent' ?
(value | percent:column.pipeArgs.digitsInfo:grid.locale) : column.dataType === 'boolean' ?
'' : value"
(value | percent:column.pipeArgs.digitsInfo:grid.locale) : value"
[row]="rowData"
[column]="this.column.field"
[containerClass]="'igx-grid__td-text'"
Expand Down

0 comments on commit 2e6abdc

Please sign in to comment.