Skip to content

Commit 462dc04

Browse files
authored
Merge branch '7.3.x' into mvenkov/update-row-drag-ghost-z-index-7.3.x
2 parents bfdbfc8 + 9834a77 commit 462dc04

File tree

6 files changed

+65
-16
lines changed

6 files changed

+65
-16
lines changed

.travis.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
sudo: required
2-
dist: trusty
2+
dist: xenial
3+
addons:
4+
apt:
5+
sources:
6+
- google-chrome
7+
packages:
8+
- google-chrome-stable
9+
services:
10+
- xvfb
311
language: node_js
412
node_js:
513
- '10.12.0'
614
before_install:
7-
- export CHROME_BIN=/usr/bin/google-chrome
815
- export DISPLAY=:99.0
9-
- sh -e /etc/init.d/xvfb start
10-
- sudo apt-get -qq update
11-
- sudo apt-get install -y libappindicator1 fonts-liberation
12-
- wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
13-
- sudo dpkg -i google-chrome*.deb
14-
- sleep 3
1516
before_script:
1617
# more heap mem per https://github.com/angular/angular-cli/issues/12645, https://github.com/npm/npm/issues/12238#issuecomment-367147962
1718
- export NODE_OPTIONS="--max_old_space_size=4096"

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ export class IgxButtonGroupComponent extends DisplayDensityBase implements After
7878
@Input()
7979
public id = `igx-buttongroup-${NEXT_ID++}`;
8080

81+
/**
82+
* @hidden
83+
*/
84+
@HostBinding('style.zIndex')
85+
public zIndex = 0;
86+
8187
/**
8288
* Allows you to set a style using the `itemContentCssClass` input.
8389
* The value should be the CSS class name that will be applied to the button group.
@@ -251,7 +257,7 @@ export class IgxButtonGroupComponent extends DisplayDensityBase implements After
251257

252258
constructor(private _cdr: ChangeDetectorRef, private _renderer: Renderer2,
253259
@Optional() @Inject(DisplayDensityToken) protected _displayDensityOptions: IDisplayDensityOptions) {
254-
super(_displayDensityOptions);
260+
super(_displayDensityOptions);
255261
}
256262

257263
/**
@@ -360,7 +366,7 @@ export class IgxButtonGroupComponent extends DisplayDensityBase implements After
360366
* @hidden
361367
*/
362368
public ngAfterContentInit() {
363-
this.templateButtons.forEach( (button) => {
369+
this.templateButtons.forEach((button) => {
364370
if (!button.initialDensity) {
365371
button.displayDensity = this.displayDensity;
366372
}
Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
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" [displayDensity]="displayDensity" [selected]="button.selected"
3-
[attr.data-togglable]="button.togglable" [disabled]="disabled || button.disabled" [igxButtonColor]="button.color"
4-
[igxButtonBackground]="button.bgcolor" [igxLabel]="button.label" [igxRipple]="button.ripple">
2+
<button *ngFor="let button of values; let i = 'index'"
3+
type="button"
4+
igxButton="flat"
5+
[displayDensity]="displayDensity"
6+
[selected]="button.selected"
7+
[attr.data-togglable]="button.togglable"
8+
[disabled]="disabled || button.disabled"
9+
[igxButtonColor]="button.color"
10+
[igxButtonBackground]="button.bgcolor"
11+
[igxLabel]="button.label"
12+
[igxRipple]="button.ripple"
13+
>
514
<div class="igx-button-group__item-content {{ itemContentCssClass }}">
615
<igx-icon *ngIf="button.icon" fontSet="material">{{button.icon}}</igx-icon>
716
<span *ngIf="button.label">{{button.label}}</span>
817
</div>
9-
</span>
18+
</button>
1019
<ng-content></ng-content>
1120
</div>

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,25 @@ describe('IgxButtonGroup', () => {
232232
expect(groupChildren[1].element.nativeElement.classList.contains('igx-button--cosy')).toBe(true, 'Missing density class!');
233233
});
234234

235+
it('Button Group - should support tab navigation', () => {
236+
const fixture = TestBed.createComponent(InitButtonGroupWithValuesComponent);
237+
fixture.detectChanges();
238+
239+
const buttongroup = fixture.componentInstance.buttonGroup;
240+
const groupChildren = buttongroup.buttons;
241+
242+
for (let i = 0; i < groupChildren.length; i++) {
243+
const button = groupChildren[i];
244+
expect(button.nativeElement.tagName).toBe('BUTTON');
245+
246+
if (i < groupChildren.length - 1) {
247+
expect(button.nativeElement.disabled).toBe(false);
248+
} else {
249+
expect(button.nativeElement.disabled).toBe(true);
250+
}
251+
}
252+
});
253+
235254
});
236255

237256
@Component({ template: `<igx-buttongroup [values]="buttons"></igx-buttongroup>` })

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

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,11 @@ export class IgxButtonDirective extends DisplayDensityBase {
4848
*/
4949
private _backgroundColor: string;
5050

51+
/**
52+
*@hidden
53+
*/
54+
private _disabled: boolean;
55+
5156
constructor(public element: ElementRef, private _renderer: Renderer2,
5257
@Optional() @Inject(DisplayDensityToken) protected _displayDensityOptions: IDisplayDensityOptions) {
5358
super(_displayDensityOptions);
@@ -141,6 +146,7 @@ export class IgxButtonDirective extends DisplayDensityBase {
141146
*/
142147
@Input() set disabled(val) {
143148
val = !!val;
149+
this._disabled = val;
144150
if (val) {
145151
this._renderer.addClass(this.nativeElement, `${this._cssClassPrefix}--disabled`);
146152
} else {
@@ -182,6 +188,14 @@ export class IgxButtonDirective extends DisplayDensityBase {
182188
return this._type === 'fab' && this.displayDensity === DisplayDensity.compact;
183189
}
184190

191+
/**
192+
* @hidden
193+
*/
194+
@HostBinding('attr.disabled')
195+
public get disabledAttribute() {
196+
return this._disabled ? this._disabled : null;
197+
}
198+
185199
/**
186200
* Gets or sets whether the button is selected.
187201
* Mainly used in the IgxButtonGroup component and it will have no effect if set separately.
@@ -195,7 +209,7 @@ export class IgxButtonDirective extends DisplayDensityBase {
195209
/**
196210
*@hidden
197211
*/
198-
@HostListener('click', ['$event'])
212+
@HostListener('click', ['$event'])
199213
public onClick(ev) {
200214
this.buttonClick.emit(ev);
201215
}

src/app/dialog/dialog.sample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { useAnimation } from '@angular/animations';
1010
})
1111
export class DialogSampleComponent implements OnInit {
1212

13-
@ViewChild('alert', { static: true }) public alert: IgxDialogComponent;
13+
@ViewChild('alert') public alert: IgxDialogComponent;
1414

1515
public positionSettings: PositionSettings = {
1616
openAnimation: useAnimation(slideInTop, { params: { duration: '2000ms' } }),

0 commit comments

Comments
 (0)