Skip to content

Commit 72f8ff3

Browse files
authored
Merge branch '7.3.x' into select-cust-overlay-settings-mousedown
2 parents 773cbd6 + 78e9fe3 commit 72f8ff3

File tree

16 files changed

+258
-63
lines changed

16 files changed

+258
-63
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ All notable changes for each version of this project will be documented in this
3939
- **Feature** The `IgxListComponent` now provides the ability to choose a display density from a predefined set of options: **compact**, **cosy** and **comfortable** (default one). It can be set by using the `displayDensity` input of the list.
4040
- `igxButton`
4141
- **Feature** The `igxButton` now provides the ability to choose a display density from a predefined set of options: **compact**, **cosy** and **comfortable** (default one). It can be set by using the `displayDensity` input of the button directive.
42+
- `igxButtonGroup`
43+
- **Feature** The `igxButtonGroup` now provides the ability to choose a display density from a predefined set of options: **compact**, **cosy** and **comfortable** (default one). It can be set by using the `displayDensity` input of the button group. The buttons within the group will have the same density as the button group. If a button has the `displayDensity` set in the template, it is not changed by the density of the group where the button is placed.
44+
- `igxGrid`, `igxTreeGrid`, `igxHierarchicalGrid`
45+
- **Feature** The Excel Style Filter dialog and its sub-dialogs now have a display density based on the `displayDensity` input of their respective grid.
4246
- `IgxDropDown`
4347
- now supports virtualized items. Use in conjunction with `IgxForOf` directive, with the following syntax, to display very large list of data:
4448
```html

extras/docs/themes/sassdoc/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ const theme = themeleon(__dirname, function (t) {
124124
return config ? config.versions : '';
125125
},
126126
getLang: () => {
127-
return process.env.SASSDOC_LANG;
127+
return process.env.SASSDOC_LANG.trim();
128128
},
129129
ifCond: (v1, operator, v2, options) => {
130130
switch (operator) {

extras/docs/themes/sassdoc/views/index.hbs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
<!DOCTYPE html>
2-
<html lang="{{getLang}}">
2+
<html lang="{{lang}}">
33
<head>
44
<meta charset="utf-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
77
<title>Ignite UI for Angular | Sass Documentation</title>
88

9-
<link rel="canonical" href="{{baseURl 'sassdoc_default_url' 'en'}}" />
10-
<link rel="canonical" href="{{baseURl 'sassdoc_default_url' 'jp'}}" />
9+
{{#ifCond lang '==' 'en'}}
10+
<link rel="canonical" href="{{baseURl 'sassdoc_default_url' 'en'}}" />
11+
<link rel="alternate" href="{{baseURl 'sassdoc_default_url' 'en'}}" hreflang="en" />
12+
<link rel="alternate" href="{{baseURl 'sassdoc_default_url' 'en'}}" hreflang="en-us" />
13+
{{else}}
14+
<link rel="canonical" href="{{baseURl 'sassdoc_default_url' 'jp'}}" />
15+
<link rel="alternate" href="{{baseURl 'sassdoc_default_url' 'jp'}}" hreflang="ja" />
16+
<link rel="alternate" href="{{baseURl 'sassdoc_default_url' 'jp'}}" hreflang="ja-jp" />
17+
{{/ifCond}}
1118

12-
<link rel="alternate" href="{{baseURl 'sassdoc_default_url' 'en'}}" hreflang="en" />
13-
<link rel="alternate" href="{{baseURl 'sassdoc_default_url' 'en'}}" hreflang="en-us" />
14-
<link rel="alternate" href="{{baseURl 'sassdoc_default_url' 'jp'}}" hreflang="ja" />
15-
<link rel="alternate" href="{{baseURl 'sassdoc_default_url' 'jp'}}" hreflang="ja-jp" />
1619

1720
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
1821
<link rel="stylesheet" href="https://infragistics.com/assets/modern/css/layout.css">
@@ -54,6 +57,7 @@
5457
<!-- End Google Tag Manager (noscript) -->
5558

5659
{{> header}}
60+
<div>{{getLang}}</div>
5761

5862
<script src="assets/js/versioning/tag-versions.req.js"></script>
5963
{{!

extras/docs/themes/typedoc/src/layouts/default.hbs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
<meta name="description" content="">
88
<meta name="viewport" content="width=device-width, initial-scale=1">
99

10-
<link rel="canonical" href="{{getConfigData 'typedoc_default_url' 'en'}}{{url}}" />
11-
<link rel="canonical" href="{{getConfigData 'typedoc_default_url' 'jp'}}{{url}}" />
12-
13-
<link rel="alternate" href="{{getConfigData 'typedoc_default_url' 'en'}}{{url}}" hreflang="en" />
14-
<link rel="alternate" href="{{getConfigData 'typedoc_default_url' 'en'}}{{url}}" hreflang="en-us" />
15-
<link rel="alternate" href="{{getConfigData 'typedoc_default_url' 'jp'}}{{url}}" hreflang="ja" />
16-
<link rel="alternate" href="{{getConfigData 'typedoc_default_url' 'jp'}}{{url}}" hreflang="ja-jp" />
10+
{{#ifCond settings.localize '===' 'en'}}
11+
<link rel="canonical" href="{{getConfigData 'typedoc_default_url' 'en'}}{{url}}" />
12+
<link rel="alternate" href="{{getConfigData 'typedoc_default_url' 'en'}}{{url}}" hreflang="en" />
13+
<link rel="alternate" href="{{getConfigData 'typedoc_default_url' 'en'}}{{url}}" hreflang="en-us" />
14+
{{else}}
15+
<link rel="canonical" href="{{getConfigData 'typedoc_default_url' 'jp'}}{{url}}" />
16+
<link rel="alternate" href="{{getConfigData 'typedoc_default_url' 'jp'}}{{url}}" hreflang="ja-jp" />
17+
<link rel="alternate" href="{{getConfigData 'typedoc_default_url' 'jp'}}{{url}}" hreflang="ja" />
18+
{{/ifCond}}
1719

1820
<link rel="stylesheet" href="https://infragistics.com/assets/modern/css/layout.css">
1921
<link rel="stylesheet" href="https://infragistics.com/assets/modern/css/animate-custom.css">

projects/igniteui-angular/src/lib/buttonGroup/README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# igx-ButtonGroup
22

3-
The **igx-ButtonGroup** component aims at providing a button group functionality to developers that also allow horizontal/vertical alignment, single/multiple selection with toggling. The igx-ButtounGroup component makes use of the igxButton directive.
3+
The **igx-ButtonGroup** component aims at providing a button group functionality to developers that also allow horizontal/vertical alignment, single/multiple selection with toggling. The igx-ButtounGroup component makes use of the igxButton directive.
44
A walkthrough of how to get started can be found [here](https://www.infragistics.com/products/ignite-ui-angular/angular/components/buttongroup.html)
55

66
# Usage
@@ -16,6 +16,7 @@ A walkthrough of how to get started can be found [here](https://www.infragistics
1616
| `multiSelection` | boolean | Enables selecting multiple buttons. Value by default is false. |
1717
| `alignment` | enum | Set the button group alignment. Available enum members are ButtonGroupAlignment.horizontal (default) or ButtonGroupAlignment.vertical. |
1818
| `disabled` | boolean | Disables the igxButtounGroup component. False by default. |
19+
| `displayDensity` | string | Set the display density from a predefined set of options: compact, cosy and comfortable. Value by default is comfortable.|
1920

2021
# API Methods
2122
| Name | Description |
@@ -33,8 +34,8 @@ A walkthrough of how to get started can be found [here](https://www.infragistics
3334

3435
# Examples
3536

36-
Using `igx-ButtonGroup` to organize buttons into an for Angular styled button group.
37+
Using `igx-ButtonGroup` to organize buttons into an Angular styled button group.
3738
```html
38-
<igx-buttongroup multiSelection="false" [values]="buttons" [alignment]="alignment">
39+
<igx-buttongroup multiSelection="false" [values]="buttons" [alignment]="alignment" displayDensity="compact">
3940
</igx-buttongroup>
4041
```

projects/igniteui-angular/src/lib/buttonGroup/buttonGroup.component.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import { CommonModule } from '@angular/common';
22
import {
3+
AfterContentInit,
34
AfterViewInit,
45
Component,
56
ContentChildren,
67
ChangeDetectorRef,
78
EventEmitter,
89
HostBinding,
10+
Inject,
911
Input,
1012
NgModule,
1113
Output,
14+
Optional,
1215
QueryList,
1316
Renderer2,
1417
ViewChildren,
@@ -19,6 +22,7 @@ import { IgxButtonDirective, IgxButtonModule } from '../directives/button/button
1922
import { IgxRippleModule } from '../directives/ripple/ripple.directive';
2023
import { IgxIconModule } from '../icon/index';
2124
import { takeUntil } from 'rxjs/operators';
25+
import { DisplayDensityBase, DisplayDensityToken, IDisplayDensityOptions, DisplayDensity } from '../core/density';
2226

2327
export enum ButtonGroupAlignment { horizontal, vertical }
2428
let NEXT_ID = 0;
@@ -48,7 +52,8 @@ let NEXT_ID = 0;
4852
templateUrl: 'buttongroup-content.component.html'
4953
})
5054

51-
export class IgxButtonGroupComponent implements AfterViewInit, OnDestroy {
55+
export class IgxButtonGroupComponent extends DisplayDensityBase implements AfterContentInit, AfterViewInit, OnDestroy {
56+
5257
private _disabled = false;
5358
protected buttonClickNotifier$ = new Subject<boolean>();
5459
protected queryListNotifier$ = new Subject<boolean>();
@@ -244,7 +249,9 @@ export class IgxButtonGroupComponent implements AfterViewInit, OnDestroy {
244249
private _isVertical: boolean;
245250
private _itemContentCssClass: string;
246251

247-
constructor(private _cdr: ChangeDetectorRef, private _renderer: Renderer2) {
252+
constructor(private _cdr: ChangeDetectorRef, private _renderer: Renderer2,
253+
@Optional() @Inject(DisplayDensityToken) protected _displayDensityOptions: IDisplayDensityOptions) {
254+
super(_displayDensityOptions);
248255
}
249256

250257
/**
@@ -349,6 +356,17 @@ export class IgxButtonGroupComponent implements AfterViewInit, OnDestroy {
349356
}
350357
}
351358

359+
/**
360+
* @hidden
361+
*/
362+
public ngAfterContentInit() {
363+
this.templateButtons.forEach( (button) => {
364+
if (!button.initialDensity) {
365+
button.displayDensity = this.displayDensity;
366+
}
367+
});
368+
}
369+
352370
/**
353371
* @hidden
354372
*/

projects/igniteui-angular/src/lib/buttonGroup/buttongroup-content.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div class="igx-button-group" role="group" [class.igx-button-group--vertical]="isVertical">
2-
<span *ngFor="let button of values; let i = 'index'" type="button" igxButton="flat" [selected]="button.selected"
2+
<span *ngFor="let button of values; let i = 'index'" type="button" igxButton="flat" [displayDensity]="displayDensity" [selected]="button.selected"
33
[attr.data-togglable]="button.togglable" [disabled]="disabled || button.disabled" [igxButtonColor]="button.color"
44
[igxButtonBackground]="button.bgcolor" [igxLabel]="button.label" [igxRipple]="button.ripple">
55
<div class="igx-button-group__item-content {{ itemContentCssClass }}">

projects/igniteui-angular/src/lib/buttonGroup/buttongroup.component.spec.ts

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ describe('IgxButtonGroup', () => {
5252
declarations: [
5353
InitButtonGroupComponent,
5454
InitButtonGroupWithValuesComponent,
55-
TemplatedButtonGroupComponent
55+
TemplatedButtonGroupComponent,
56+
TemplatedButtonGroupDesplayDensityComponent
5657
],
5758
imports: [
5859
IgxButtonGroupModule,
@@ -201,6 +202,36 @@ describe('IgxButtonGroup', () => {
201202
expect(error).toBe('');
202203
});
203204

205+
it('Button Group - DisplayDensity property is applied', () => {
206+
const fixture = TestBed.createComponent(InitButtonGroupComponent);
207+
fixture.detectChanges();
208+
209+
const buttongroup = fixture.componentInstance.buttonGroup;
210+
211+
expect(buttongroup.displayDensity).toBe('comfortable');
212+
213+
buttongroup.displayDensity = 'compact';
214+
fixture.detectChanges();
215+
216+
expect(buttongroup.displayDensity).toBe('compact', 'DisplayDensity not set!');
217+
expect(buttongroup.buttons[1].element.nativeElement.classList.contains('igx-button--compact')).toBe(true, 'Missing density class!');
218+
});
219+
220+
it('Button Group - DisplayDensity property is applied to templated buttons', () => {
221+
const fixture = TestBed.createComponent(TemplatedButtonGroupDesplayDensityComponent);
222+
fixture.detectChanges();
223+
224+
const buttongroup = fixture.componentInstance.buttonGroup;
225+
226+
expect(buttongroup.displayDensity).toBe('cosy');
227+
228+
const groupChildren = buttongroup.buttons;
229+
// The density class should be applied only to buttons with no DisplayDensity set
230+
expect(groupChildren[0].displayDensity).toBe('compact');
231+
expect(groupChildren[0].element.nativeElement.classList.contains('igx-button--compact')).toBe(true, 'Missing density class!');
232+
expect(groupChildren[1].element.nativeElement.classList.contains('igx-button--cosy')).toBe(true, 'Missing density class!');
233+
});
234+
204235
});
205236

206237
@Component({ template: `<igx-buttongroup [values]="buttons"></igx-buttongroup>` })
@@ -318,3 +349,11 @@ class TemplatedButtonGroupComponent {
318349
private alignment = ButtonGroupAlignment.vertical;
319350
public multiselection = true;
320351
}
352+
353+
@Component({ template: `<igx-buttongroup [multiSelection]="multiselection" displayDensity="cosy">
354+
<button igxButton displayDensity="compact">Sofia</button>
355+
<button igxButton>London</button>
356+
</igx-buttongroup>` })
357+
class TemplatedButtonGroupDesplayDensityComponent {
358+
@ViewChild(IgxButtonGroupComponent) public buttonGroup: IgxButtonGroupComponent;
359+
}

projects/igniteui-angular/src/lib/core/displayDensity.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { InjectionToken, Input, Output, EventEmitter, DoCheck } from '@angular/core';
1+
import { InjectionToken, Input, Output, EventEmitter, DoCheck, OnInit } from '@angular/core';
22

33

44
/**
@@ -30,9 +30,14 @@ export const DisplayDensityToken = new InjectionToken<IDisplayDensityOptions>('D
3030
/**
3131
* Base class containing all logic required for implementing DisplayDensity.
3232
*/
33-
export class DisplayDensityBase implements DoCheck {
33+
export class DisplayDensityBase implements DoCheck, OnInit {
3434
protected _displayDensity: DisplayDensity;
3535

36+
/**
37+
* @hidden
38+
*/
39+
public initialDensity: DisplayDensity;
40+
3641
/**
3742
* Returns the theme of the component.
3843
* The default theme is `comfortable`.
@@ -74,6 +79,13 @@ export class DisplayDensityBase implements DoCheck {
7479
Object.assign(this.oldDisplayDensityOptions, displayDensityOptions);
7580
}
7681

82+
/**
83+
* @hidden
84+
*/
85+
public ngOnInit(): void {
86+
this.initialDensity = this._displayDensity;
87+
}
88+
7789
public ngDoCheck() {
7890
if (!this._displayDensity && this.displayDensityOptions &&
7991
this.oldDisplayDensityOptions.displayDensity !== this.displayDensityOptions.displayDensity) {

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@
147147
@mixin igx-button-group($theme) {
148148
@include igx-root-css-vars($theme);
149149
$group-item-min-width: 24px;
150-
$group-item-min-height: 36px;
151150
$group-item-border-thickness: 1px;
152151
$group-items-margin: rem(10px, 16px);
153152

@@ -167,7 +166,6 @@
167166
color: --var($theme, 'item-text-color');
168167
background: --var($theme, 'item-background');
169168
min-width: $group-item-min-width;
170-
min-height: $group-item-min-height;
171169
display: flex;
172170
flex: 1 0 0%;
173171
justify-content: center;

0 commit comments

Comments
 (0)