Skip to content

Commit 9129c6e

Browse files
Merge branch '9.1.x' into ibarakov/fix-8604-9.1.x
2 parents b64bc86 + 957d034 commit 9129c6e

File tree

8 files changed

+94
-38
lines changed

8 files changed

+94
-38
lines changed

projects/igniteui-angular/src/lib/core/styles/components/button/_button-component.scss

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,38 @@
1111

1212
@extend %igx-button-display !optional;
1313

14+
@include m(cosy) {
15+
@extend %igx-button-display--cosy !optional;
16+
}
17+
18+
@include m(compact) {
19+
@extend %igx-button-display--compact !optional;
20+
}
21+
1422
// FLAT BUTTON
1523
@include m(flat) {
1624
@extend %igx-button-display !optional;
1725
@extend %igx-button--flat !optional;
1826
}
1927

28+
// RAISED BUTTON
29+
@include m(raised) {
30+
@extend %igx-button-display !optional;
31+
@extend %igx-button--raised !optional;
32+
}
33+
2034
// OUTLINED BUTTON
2135
@include m(outlined) {
2236
@extend %igx-button-display !optional;
2337
@extend %igx-button--outlined !optional;
2438
}
2539

26-
// RAISED BUTTON
27-
@include m(raised) {
28-
@extend %igx-button-display !optional;
29-
@extend %igx-button--raised !optional;
40+
@include mx(outlined-cosy, outlined) {
41+
@extend %igx-button--outlined-cosy !optional;
42+
}
43+
44+
@include mx(outlined-compact, outlined) {
45+
@extend %igx-button--outlined-compact !optional;
3046
}
3147

3248
// FAB BUTTON
@@ -53,12 +69,4 @@
5369
@include m(disabled) {
5470
@extend %igx-button--disabled !optional;
5571
}
56-
57-
@include m(cosy) {
58-
@extend %igx-button-display--cosy !optional;
59-
}
60-
61-
@include m(compact) {
62-
@extend %igx-button-display--compact !optional;
63-
}
6472
}

projects/igniteui-angular/src/lib/core/styles/components/button/_button-theme.scss

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,12 @@
461461
compact: rem(3px, 16px) rem(16px, 16px)
462462
);
463463

464+
$outlined-button-padding-material: (
465+
comfortable: rem(7px, 16px) rem(14px, 16px),
466+
cosy: rem(4px, 16px) rem(14px, 16px),
467+
compact: rem(1px, 16px) rem(14px, 16px)
468+
);
469+
464470
$button-padding-fluent: (
465471
comfortable: 0 rem(16px, 16px),
466472
cosy: 0 rem(16px, 16px),
@@ -473,6 +479,12 @@
473479
compact: rem(4px, 16px) rem(8px, 16px)
474480
);
475481

482+
$outlined-button-padding-indigo: (
483+
comfortable: rem(6px, 16px) rem(14px, 16px),
484+
cosy: rem(4px, 16px) rem(10px, 16px),
485+
compact: rem(2px, 16px) rem(6px, 16px)
486+
);
487+
476488
$variant: map-get($theme, variant);
477489

478490
$button-padding: map-get((
@@ -481,6 +493,13 @@
481493
bootstrap: $button-padding-bootstrap,
482494
), $variant);
483495

496+
$outlined-button-padding: map-get((
497+
material: $outlined-button-padding-material,
498+
fluent: $button-padding-fluent,
499+
bootstrap: $button-padding-bootstrap,
500+
indigo-design: $outlined-button-padding-indigo
501+
), $variant);
502+
484503
$button--size-material: (
485504
comfortable: rem(36px),
486505
cosy: rem(30px),
@@ -638,6 +657,7 @@
638657
background: --var($theme, 'outlined-background');
639658
color: --var($theme, 'outlined-text-color');
640659
border-radius: --var($theme, 'outlined-border-radius');
660+
padding: map-get($outlined-button-padding, 'comfortable');
641661

642662
%igx-icon-display {
643663
color: --var($theme, 'outlined-icon-color')
@@ -664,6 +684,16 @@
664684
}
665685
}
666686

687+
%igx-button--outlined-cosy {
688+
padding: map-get($outlined-button-padding, 'cosy');
689+
min-height: map-get($button-size, 'cosy');
690+
}
691+
692+
%igx-button--outlined-compact {
693+
padding: map-get($outlined-button-padding, 'compact');
694+
min-height: map-get($button-size, 'compact');
695+
}
696+
667697
%igx-button--raised {
668698
color: --var($theme, 'raised-text-color');
669699
background: --var($theme, 'raised-background');

projects/igniteui-angular/src/lib/directives/button/button.directive.spec.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ import { configureTestSuite } from '../../test-utils/configure-suite';
1010
import { IgxIconComponent, IgxIconService } from '../../icon/public_api';
1111
import { DisplayDensity } from '../../core/density';
1212

13-
const FLAT_RAISED_OUTLINED_BUTTON_COMPACT = 'igx-button--compact';
14-
const FLAT_RAISED_OUTLINED_BUTTON_COSY = 'igx-button--cosy';
13+
const FLAT_RAISED_BUTTON_COMPACT = 'igx-button--compact';
14+
const FLAT_RAISED_BUTTON_COSY = 'igx-button--cosy';
15+
const OUTLINED_BUTTON_COMPACT = 'igx-button--outlined-compact';
16+
const OUTLINED_BUTTON_COSY = 'igx-button--outlined-cosy';
1517
const FAB_BUTTON_COMPACT = 'igx-button--fab-compact';
1618
const FAB_BUTTON_COSY = 'igx-button--fab-cosy';
1719

@@ -210,15 +212,19 @@ function verifyDisplayDensity(buttonDirective, buttonDebugEl, buttonType, expect
210212

211213
switch (expectedDisplayDensity) {
212214
case DisplayDensity.compact: {
213-
if (buttonType === 'flat' || buttonType === 'raised' || buttonType === 'outlined') {
214-
expectedButtonDensityClass = FLAT_RAISED_OUTLINED_BUTTON_COMPACT;
215+
if (buttonType === 'flat' || buttonType === 'raised') {
216+
expectedButtonDensityClass = FLAT_RAISED_BUTTON_COMPACT;
217+
} else if (buttonType === 'outlined') {
218+
expectedButtonDensityClass = OUTLINED_BUTTON_COMPACT;
215219
} else if (buttonType === 'fab') {
216220
expectedButtonDensityClass = FAB_BUTTON_COMPACT;
217221
}
218222
} break;
219223
case DisplayDensity.cosy: {
220-
if (buttonType === 'flat' || buttonType === 'raised' || buttonType === 'outlined') {
221-
expectedButtonDensityClass = FLAT_RAISED_OUTLINED_BUTTON_COSY;
224+
if (buttonType === 'flat' || buttonType === 'raised') {
225+
expectedButtonDensityClass = FLAT_RAISED_BUTTON_COSY;
226+
} else if (buttonType === 'outlined') {
227+
expectedButtonDensityClass = OUTLINED_BUTTON_COSY;
222228
} else if (buttonType === 'fab') {
223229
expectedButtonDensityClass = FAB_BUTTON_COSY;
224230
}

projects/igniteui-angular/src/lib/directives/button/button.directive.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ export class IgxButtonDirective extends DisplayDensityBase {
190190
*/
191191
@HostBinding('class.igx-button--cosy')
192192
public get cssClassCosy(): boolean {
193-
return (this._type === 'flat' || this._type === 'raised' || this._type === 'outlined') &&
193+
return (this._type === 'flat' || this._type === 'raised') &&
194194
this.displayDensity === DisplayDensity.cosy;
195195
}
196196

@@ -200,10 +200,28 @@ export class IgxButtonDirective extends DisplayDensityBase {
200200
*/
201201
@HostBinding('class.igx-button--compact')
202202
public get cssClassCompact(): boolean {
203-
return (this._type === 'flat' || this._type === 'raised' || this._type === 'outlined') &&
203+
return (this._type === 'flat' || this._type === 'raised') &&
204204
this.displayDensity === DisplayDensity.compact;
205205
}
206206

207+
/**
208+
* @hidden
209+
* @internal
210+
*/
211+
@HostBinding('class.igx-button--outlined-cosy')
212+
public get cssClassCosyOutlined(): boolean {
213+
return this._type === 'outlined' && this.displayDensity === DisplayDensity.cosy;
214+
}
215+
216+
/**
217+
* @hidden
218+
* @internal
219+
*/
220+
@HostBinding('class.igx-button--outlined-compact')
221+
public get cssClassCompactOutlined(): boolean {
222+
return this._type === 'outlined' && this.displayDensity === DisplayDensity.compact;
223+
}
224+
207225
/**
208226
* @hidden
209227
* @internal

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

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,8 +1447,8 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
14471447
/**
14481448
* @hidden @internal
14491449
*/
1450-
@ViewChild('loadingOverlay', { static: true })
1451-
public loadingOverlay: ElementRef;
1450+
@ViewChild('loadingOverlay', { read: IgxToggleDirective, static: true })
1451+
public loadingOverlay: IgxToggleDirective;
14521452

14531453
/**
14541454
* @hidden @internal
@@ -1959,7 +1959,7 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
19591959
/**
19601960
* @hidden @internal
19611961
*/
1962-
@ViewChild(IgxToggleDirective)
1962+
@ViewChild('rowEditingOverlay', { read: IgxToggleDirective })
19631963
public rowEditingOverlay: IgxToggleDirective;
19641964

19651965
/**
@@ -2596,7 +2596,6 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
25962596
protected _baseFontSize: number;
25972597
private _horizontalForOfs: Array<IgxGridForOfDirective<any>> = [];
25982598
private _multiRowLayoutRowSize = 1;
2599-
protected _loadingId;
26002599
protected _expansionStates: Map<any, boolean> = new Map<any, boolean>();
26012600
protected _defaultExpandState = false;
26022601
// Caches
@@ -6205,15 +6204,10 @@ export class IgxGridBaseDirective extends DisplayDensityBase implements
62056204
closeOnOutsideClick: false,
62066205
positionStrategy: new ContainerPositionStrategy()
62076206
};
6208-
if (!this._loadingId) {
6209-
this._loadingId = this.overlayService.attach(this.loadingOverlay, overlaySettings);
6210-
this.overlayService.show(this._loadingId, overlaySettings);
6211-
}
6207+
6208+
this.loadingOverlay.open(overlaySettings);
62126209
} else {
6213-
if (this._loadingId) {
6214-
this.overlayService.hide(this._loadingId);
6215-
this._loadingId = null;
6216-
}
6210+
this.loadingOverlay.close();
62176211
}
62186212
}
62196213

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
<div class="igx-grid__row-editing-outlet" igxOverlayOutlet #igxRowEditingOverlayOutlet></div>
196196
<igc-trial-watermark></igc-trial-watermark>
197197
</div>
198-
<div #loadingOverlay>
198+
<div igxToggle #loadingOverlay>
199199
<igx-circular-bar [indeterminate]="true" *ngIf='shouldOverlayLoading'>
200200
</igx-circular-bar>
201201
</div>
@@ -279,7 +279,7 @@
279279
}">unfold_more</igx-icon>
280280
</ng-template>
281281

282-
<div *ngIf="rowEditable" igxToggle>
282+
<div *ngIf="rowEditable" igxToggle #rowEditingOverlay>
283283
<div [className]="bannerClass">
284284
<ng-container
285285
*ngTemplateOutlet="rowEditContainer; context: { rowChangesCount: rowChangesCount, endEdit: endEdit.bind(this) }">

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<igx-grid-filtering-row #filteringRow [style.width.px]='calcWidth' *ngIf="filteringService.isFilterRowVisible"
7474
[column]="filteringService.filteredColumn"></igx-grid-filtering-row>
7575
</div>
76-
<div #loadingOverlay>
76+
<div igxToggle #loadingOverlay>
7777
<igx-circular-bar [indeterminate]="true" *ngIf='shouldOverlayLoading'>
7878
</igx-circular-bar>
7979
</div>
@@ -227,7 +227,7 @@
227227
<igx-icon role="button" [isActive]='hasExpandedRecords() && hasExpandableChildren' fontSet="material">unfold_less</igx-icon>
228228
</ng-template>
229229

230-
<div *ngIf="rowEditable" igxToggle>
230+
<div *ngIf="rowEditable" igxToggle #rowEditingOverlay>
231231
<div [className]="bannerClass">
232232
<ng-container
233233
*ngTemplateOutlet="rowEditContainer; context: { rowChangesCount: rowChangesCount, endEdit: endEdit.bind(this) }">

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
[column]="filteringService.filteredColumn"></igx-grid-filtering-row>
5757
</div>
5858
<div class="igx-grid__thead-thumb" [hidden]='!hasVerticalScroll()' [style.width.px]="scrollSize"></div>
59-
<div #loadingOverlay>
59+
<div igxToggle #loadingOverlay>
6060
<igx-circular-bar [indeterminate]="true" *ngIf='shouldOverlayLoading'>
6161
</igx-circular-bar>
6262
</div>
@@ -194,7 +194,7 @@
194194
</div>
195195
</ng-template>
196196

197-
<div *ngIf="rowEditable" igxToggle>
197+
<div *ngIf="rowEditable" igxToggle #rowEditingOverlay>
198198
<div [className]="bannerClass">
199199
<ng-container
200200
*ngTemplateOutlet="rowEditContainer; context: { rowChangesCount: rowChangesCount, endEdit: endEdit.bind(this) }">

0 commit comments

Comments
 (0)