Skip to content

Commit a4a92d7

Browse files
Andrei CaleniucAndrei Caleniuc
authored andcommitted
fix: ui-grid styles
1 parent 7a1ea63 commit a4a92d7

File tree

13 files changed

+122
-109
lines changed

13 files changed

+122
-109
lines changed

projects/angular/components/ui-grid/src/components/ui-grid-custom-paginator/ui-grid-custom-paginator.component.html

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
<div class="mat-paginator-outer-container">
2-
<div class="mat-paginator-container">
3-
<div class="mat-paginator-range-label">
1+
<div class="mat-mdc-paginator-outer-container">
2+
<div class="mat-mdc-paginator-container">
3+
<div class="mat-mdc-paginator-range-label">
44
<ng-container *ngIf="!hideTotalCount">
55
{{_intl.getRangeLabel(pageIndex, pageSize, length)}}
66
</ng-container>
@@ -9,7 +9,7 @@
99
</ng-container>
1010
</div>
1111

12-
<div class="mat-paginator-range-actions">
12+
<div class="mat-mdc-paginator-range-actions">
1313
<button *ngIf="showFirstLastButtons"
1414
[attr.aria-label]="_intl.firstPageLabel"
1515
[matTooltip]="_intl.firstPageLabel"
@@ -19,8 +19,8 @@
1919
(click)="firstPage()"
2020
mat-icon-button
2121
type="button"
22-
class="mat-paginator-navigation-first">
23-
<svg class="mat-paginator-icon"
22+
class="mat-mdc-paginator-navigation-first">
23+
<svg class="mat-mdc-paginator-icon"
2424
viewBox="0 0 24 24"
2525
focusable="false">
2626
<path d="M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z" />
@@ -34,14 +34,14 @@
3434
(click)="previousPage()"
3535
mat-icon-button
3636
type="button"
37-
class="mat-paginator-navigation-previous">
38-
<svg class="mat-paginator-icon"
37+
class="mat-mdc-paginator-navigation-previous">
38+
<svg class="mat-mdc-paginator-icon"
3939
viewBox="0 0 24 24"
4040
focusable="false">
4141
<path d="M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z" />
4242
</svg>
4343
</button>
44-
<div class="mat-paginator-page-label">
44+
<div class="mat-mdc-paginator-page-label">
4545
<ng-container *ngIf="!hideTotalCount">
4646
{{_intl.getPageLabel(pageIndex+1, pageCount)}}
4747
</ng-container>
@@ -57,8 +57,8 @@
5757
(click)="nextPage()"
5858
mat-icon-button
5959
type="button"
60-
class="mat-paginator-navigation-next">
61-
<svg class="mat-paginator-icon"
60+
class="mat-mdc-paginator-navigation-next">
61+
<svg class="mat-mdc-paginator-icon"
6262
viewBox="0 0 24 24"
6363
focusable="false">
6464
<path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" />
@@ -73,8 +73,8 @@
7373
(click)="lastPage()"
7474
mat-icon-button
7575
type="button"
76-
class="mat-paginator-navigation-last">
77-
<svg class="mat-paginator-icon"
76+
class="mat-mdc-paginator-navigation-last">
77+
<svg class="mat-mdc-paginator-icon"
7878
viewBox="0 0 24 24"
7979
focusable="false">
8080
<path d="M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z" />
@@ -83,15 +83,15 @@
8383
</div>
8484

8585
<div *ngIf="!hidePageSize"
86-
class="mat-paginator-page-size">
87-
<div class="mat-paginator-page-size-label">
86+
class="mat-mdc-paginator-page-size">
87+
<div class="mat-mdc-paginator-page-size-label">
8888
{{_intl.itemsPerPageLabel}}
8989
</div>
9090

9191
<mat-form-field *ngIf="_displayedPageSizeOptions.length > 1"
9292
[appearance]="_formFieldAppearance!"
93-
[color]="color"
94-
class="mat-paginator-page-size-select">
93+
[color]="color ?? 'primary'"
94+
class="mat-mdc-paginator-page-size-select">
9595
<mat-select (selectionChange)="_changePageSize($event.value)"
9696
[value]="pageSize"
9797
[disabled]="disabled"
@@ -104,7 +104,7 @@
104104
</mat-form-field>
105105

106106
<div *ngIf="_displayedPageSizeOptions.length <= 1"
107-
class="mat-paginator-page-size-value">{{pageSize}}</div>
107+
class="mat-mdc-paginator-page-size-value">{{pageSize}}</div>
108108
</div>
109109
</div>
110110
</div>

projects/angular/components/ui-grid/src/components/ui-grid-custom-paginator/ui-grid-custom-paginator.component.scss

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ ui-grid-custom-paginator {
5252
.mat-mdc-paginator-page-size-label {
5353
margin: $mat-paginator-items-per-page-label-margin;
5454
}
55-
/* TODO(mdc-migration): The following rule targets internal classes of paginator that may no longer apply for the MDC version.*/
56-
.mat-paginator-page-size-select {
55+
.mat-mdc-paginator-page-size-select {
5756
margin: $mat-paginator-selector-margin;
5857
width: $mat-paginator-selector-trigger-width;
5958

@@ -65,8 +64,7 @@ ui-grid-custom-paginator {
6564
width: $mat-paginator-selector-trigger-fill-width;
6665
}
6766
}
68-
/* TODO(mdc-migration): The following rule targets internal classes of paginator that may no longer apply for the MDC version.*/
69-
.mat-mdc-paginator-range-actions .mat-paginator-page-label {
67+
.mat-mdc-paginator-range-actions .mat-mdc-paginator-page-label {
7068
margin: $mat-paginator-page-label-margin;
7169
min-width: 7em;
7270
text-align: center;

projects/angular/components/ui-grid/src/components/ui-grid-custom-paginator/ui-grid-custom-paginator.component.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ describe('Component: UiGrid', () => {
6666
});
6767

6868
it('should display correct page label', () => {
69-
const label = fixture.debugElement.query(By.css('.mat-paginator-page-label'));
69+
const label = fixture.debugElement.query(By.css('.mat-mdc-paginator-page-label'));
7070
expect(label.nativeElement.innerText).toEqual(intl.getPageLabel(1, 12));
7171
});
7272

7373
it('should update page label on page change', () => {
74-
const nextButton = fixture.debugElement.query(By.css('.mat-paginator-navigation-next'));
75-
const label = fixture.debugElement.query(By.css('.mat-paginator-page-label'));
74+
const nextButton = fixture.debugElement.query(By.css('.mat-mdc-paginator-navigation-next'));
75+
const label = fixture.debugElement.query(By.css('.mat-mdc-paginator-page-label'));
7676

7777
component.pageIndex = 0;
7878
nextButton.nativeElement.dispatchEvent(EventGenerator.click);

projects/angular/components/ui-grid/src/components/ui-grid-custom-paginator/ui-grid-custom-paginator.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export class UiGridCustomPaginatorComponent extends _MatPaginatorBase<MatPaginat
5050
hideTotalCount = false;
5151

5252
@HostBinding('class')
53-
hostClass = 'mat-paginator';
53+
hostClass = 'mat-mdc-paginator';
5454

5555
get pageCount(): number {
5656
return Math.ceil(this.length / this.pageSize);

projects/angular/components/ui-grid/src/components/ui-grid-search/ui-grid-search.component.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
ui-grid-search {
22
mat-form-field {
33
width: 140px;
4-
/* TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version. */
5-
.mat-form-field-flex {
6-
align-items: flex-end;
4+
.mat-mdc-form-field-flex {
5+
.mat-mdc-form-field-infix {
6+
display: flex;
7+
}
78
}
89
}
910

projects/angular/components/ui-grid/src/components/ui-grid-toggle-columns/ui-grid-toggle-columns.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
mat-button>
77
<mat-icon class="material-icons-outlined">table_chart</mat-icon>
88
<span>{{togglePlaceholderTitle}}</span>
9-
<mat-icon class="material-icons-outlined">keyboard_arrow_down</mat-icon>
9+
<mat-icon class="material-icons-outlined" iconPositionEnd>keyboard_arrow_down</mat-icon>
1010
</button>
1111

1212
<mat-select [value]="selected"

projects/angular/components/ui-grid/src/components/ui-grid-toggle-columns/ui-grid-toggle-columns.component.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ $toggle-col-width: 10em;
1010
height: 32px;
1111
align-self: center;
1212
}
13-
/* TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.*/
1413
mat-select {
1514
overflow: hidden;
1615
width: 0;
16+
min-width: 0;
1717
// adjustments in order to match trigger icon with optgroup-label icon
1818
position: relative;
1919
top: -10px;

projects/angular/components/ui-grid/src/ui-grid.component.html

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,7 @@
337337
<ng-container *ngLet="disableSelectionByEntry(row) as disabledReason">
338338
<div *ngIf="selectable && !singleSelectable"
339339
class="ui-grid-mobile-feature-container ui-grid-mobile-refresh-container">
340-
<mat-checkbox (click)="checkShift($event)"
341-
(keyup.shift.space)="checkShift($event)"
342-
(keyup.space)="checkShift($event)"
343-
(change)="handleSelection(index, row)"
340+
<mat-checkbox (change)="handleSelection(index, row)"
344341
[checked]="selectionManager.isSelected(row)"
345342
[indeterminate]="selectionManager.isIndeterminate(row)"
346343
[matTooltip]="disabledReason || checkboxTooltip(row)"
@@ -385,10 +382,7 @@
385382
(change)="rowSelected(row)"></mat-radio-button>
386383
</mat-radio-group>
387384
<ng-template #multiSelectable>
388-
<mat-checkbox (click)="checkShift($event)"
389-
(keyup.shift.space)="checkShift($event)"
390-
(keyup.space)="checkShift($event)"
391-
(change)="handleSelection(index, row)"
385+
<mat-checkbox (change)="handleSelection(index, row)"
392386
[checked]="selectionManager.isSelected(row)"
393387
[indeterminate]="selectionManager.isIndeterminate(row)"
394388
[matTooltip]="disabledReason || checkboxTooltip(row)"
@@ -646,7 +640,7 @@
646640
class="ui-grid-collapsible-filters-toggle">
647641
<mat-icon>filter_list</mat-icon>
648642
<span>{{ intl.filters(filterManager.activeCount$ | async) }}</span>
649-
<mat-icon>{{ showFilters ? 'expand_less' : 'expand_more' }}</mat-icon>
643+
<mat-icon iconPositionEnd>{{ showFilters ? 'expand_less' : 'expand_more' }}</mat-icon>
650644
</button>
651645
</ng-container>
652646
</ng-template>
@@ -670,7 +664,7 @@
670664
{{ !!column.dropdown?.value ? intl.translateDropdownOption(column.dropdown!.value!) :
671665
intl.noFilterPlaceholder }}
672666
</span>
673-
<mat-icon>keyboard_arrow_down</mat-icon>
667+
<mat-icon iconPositionEnd>keyboard_arrow_down</mat-icon>
674668
</button>
675669
<mat-menu #filterOptions="matMenu"
676670
[overlapTrigger]="true">

projects/angular/components/ui-grid/src/ui-grid.component.scss

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,16 +208,13 @@ ui-grid {
208208
&-container {
209209
min-height: $ui-grid-header-row-height - 1;
210210
}
211-
/* TODO(mdc-migration): The following rule targets internal classes of select that may no longer apply for the MDC version.*/
212211
.mat-mdc-paginator-page-size-label,
213212
.mat-mdc-paginator-range-label,
214-
.mat-select-value {
213+
.mat-mdc-select-value {
215214
font-size: $ui-grid-secondary-font-size;
216215
line-height: $ui-grid-secondary-font-size;
217216
}
218-
/* TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.*/
219-
/* TODO(mdc-migration): The following rule targets internal classes of form-field that may no longer apply for the MDC version.*/
220-
.mat-form-field-infix {
217+
.mat-mdc-form-field-infix {
221218
padding: 0;
222219

223220
.mat-mdc-select {
@@ -252,8 +249,7 @@ ui-grid {
252249
}
253250

254251
ui-grid-custom-paginator {
255-
/* TODO(mdc-migration): The following rule targets internal classes of paginator that may no longer apply for the MDC version.*/
256-
.mat-paginator-page-label {
252+
.mat-mdc-paginator-page-label {
257253
font-size: $ui-grid-secondary-font-size;
258254
}
259255
.mat-mdc-paginator-page-size .mat-mdc-form-field {
@@ -398,7 +394,6 @@ ui-grid {
398394
}
399395

400396
.ui-grid-header {
401-
/* TODO(mdc-migration): The following rule targets internal classes of progress-bar that may no longer apply for the MDC version.*/
402397
mat-progress-bar {
403398
position: absolute;
404399
right: 0;

0 commit comments

Comments
 (0)