Skip to content

Commit 4f5ee1b

Browse files
authored
Merge branch 'master' into mkirova/fix-13583
2 parents 5c47280 + 42358f4 commit 4f5ee1b

File tree

102 files changed

+1545
-1473
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+1545
-1473
lines changed

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
import { AfterContentInit, AfterViewInit, ChangeDetectorRef, Component, ContentChildren, EventEmitter,
2-
HostBinding, Input, OnDestroy, Output, QueryList } from '@angular/core';
1+
import {
2+
AfterContentInit, AfterViewInit, ChangeDetectorRef, Component, ContentChildren, EventEmitter,
3+
HostBinding, Input, OnDestroy, Output, QueryList, booleanAttribute
4+
} from '@angular/core';
35
import { fromEvent, Subject } from 'rxjs';
46
import { takeUntil } from 'rxjs/operators';
57
import { ACCORDION_NAVIGATION_KEYS } from '../core/utils';
6-
import { IExpansionPanelCancelableEventArgs,
7-
IExpansionPanelEventArgs, IgxExpansionPanelBase } from '../expansion-panel/expansion-panel.common';
8+
import {
9+
IExpansionPanelCancelableEventArgs,
10+
IExpansionPanelEventArgs, IgxExpansionPanelBase
11+
} from '../expansion-panel/expansion-panel.common';
812
import { IgxExpansionPanelComponent } from '../expansion-panel/expansion-panel.component';
913
import { ToggleAnimationSettings } from '../expansion-panel/toggle-animation-component';
1014

@@ -113,7 +117,7 @@ export class IgxAccordionComponent implements AfterContentInit, AfterViewInit, O
113117
* this.accordion.singleBranchExpand = false;
114118
* ```
115119
*/
116-
@Input()
120+
@Input({ transform: booleanAttribute })
117121
public get singleBranchExpand(): boolean {
118122
return this._singleBranchExpand;
119123
}
@@ -249,7 +253,7 @@ export class IgxAccordionComponent implements AfterContentInit, AfterViewInit, O
249253
*/
250254
public expandAll(): void {
251255
if (this.singleBranchExpand) {
252-
for(let i = 0; i < this.panels.length - 1; i++) {
256+
for (let i = 0; i < this.panels.length - 1; i++) {
253257
this.panels[i].collapse();
254258
}
255259
this._panels.last.expand();
@@ -277,7 +281,7 @@ export class IgxAccordionComponent implements AfterContentInit, AfterViewInit, O
277281
p.collapsed = true;
278282
}
279283
});
280-
this.cdr.detectChanges();
284+
this.cdr.markForCheck();
281285
}
282286

283287
private handleKeydown(event: KeyboardEvent, panel: IgxExpansionPanelComponent): void {
@@ -325,7 +329,7 @@ export class IgxAccordionComponent implements AfterContentInit, AfterViewInit, O
325329
this._enabledPanels.forEach(p => p.collapse());
326330
} else {
327331
if (this.singleBranchExpand) {
328-
for(let i = 0; i < this._enabledPanels.length - 1; i++) {
332+
for (let i = 0; i < this._enabledPanels.length - 1; i++) {
329333
this._enabledPanels[i].collapse();
330334
}
331335
this._enabledPanels[this._enabledPanels.length - 1].expand();

projects/igniteui-angular/src/lib/action-strip/action-strip.component.ts

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import {
1414
AfterContentInit,
1515
ChangeDetectorRef,
1616
AfterViewInit,
17-
ElementRef
17+
ElementRef,
18+
booleanAttribute
1819
} from '@angular/core';
1920
import { DisplayDensityBase, DisplayDensityToken, IDisplayDensityOptions } from '../core/density';
2021
import { ActionStripResourceStringsEN, IActionStripResourceStrings } from '../core/i18n/action-strip-resources';
@@ -120,14 +121,9 @@ export class IgxActionStripComponent extends DisplayDensityBase implements After
120121
* <igx-action-strip [hidden]="false">
121122
* ```
122123
*/
123-
@Input()
124-
public set hidden(value) {
125-
this._hidden = value;
126-
}
124+
@Input({ transform: booleanAttribute })
125+
public hidden = false;
127126

128-
public get hidden() {
129-
return this._hidden;
130-
}
131127

132128
/**
133129
* Gets/Sets the resource strings.
@@ -150,13 +146,13 @@ export class IgxActionStripComponent extends DisplayDensityBase implements After
150146
* @hidden
151147
* @internal
152148
*/
153-
public get hideOnRowLeave(): boolean{
154-
if(this.menu.items.length === 0){
149+
public get hideOnRowLeave(): boolean {
150+
if (this.menu.items.length === 0) {
155151
return true;
156-
}else if(this.menu.items.length > 0){
157-
if(this.menu.collapsed){
152+
} else if (this.menu.items.length > 0) {
153+
if (this.menu.collapsed) {
158154
return true;
159-
}else{
155+
} else {
160156
return false;
161157
}
162158
}
@@ -215,14 +211,14 @@ export class IgxActionStripComponent extends DisplayDensityBase implements After
215211
/**
216212
* Getter for the 'display' property of the current `IgxActionStrip`
217213
*/
218-
@HostBinding('style.display')
219-
private get display(): string {
220-
return this._hidden ? 'none' : 'flex';
221-
}
214+
@HostBinding('style.display')
215+
private get display(): string {
216+
return this.hidden ? 'none' : 'flex';
217+
}
222218

223-
/**
224-
* Host `attr.class` binding.
225-
*/
219+
/**
220+
* Host `attr.class` binding.
221+
*/
226222
@HostBinding('class.igx-action-strip')
227223
protected hostClass = 'igx-action-strip';
228224

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-action-button.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, Input, TemplateRef, ViewChild, Output, EventEmitter, ElementRef } from '@angular/core';
1+
import { Component, Input, TemplateRef, ViewChild, Output, EventEmitter, ElementRef, booleanAttribute } from '@angular/core';
22
import { IgxIconComponent } from '../../icon/icon.component';
33
import { IgxRippleDirective } from '../../directives/ripple/ripple.directive';
44
import { IgxButtonDirective } from '../../directives/button/button.directive';
@@ -38,7 +38,7 @@ export class IgxGridActionButtonComponent {
3838
/**
3939
* Whether button action is rendered in menu and should container text label.
4040
*/
41-
@Input()
41+
@Input({ transform: booleanAttribute })
4242
public asMenuItem = false;
4343

4444
/**
@@ -75,7 +75,7 @@ export class IgxGridActionButtonComponent {
7575
* @internal
7676
*/
7777
public handleClick(event) {
78-
this.actionClick.emit(event);
78+
this.actionClick.emit(event);
7979
}
8080

8181
/**

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-actions-base.directive.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { IgxGridActionButtonComponent } from './grid-action-button.component';
2-
import { Directive, Input, AfterViewInit, QueryList, ViewChildren, IterableDiffers } from '@angular/core';
2+
import { Directive, Input, AfterViewInit, QueryList, ViewChildren, IterableDiffers, booleanAttribute } from '@angular/core';
33
import { IgxActionStripComponent } from '../action-strip.component';
44
import { IgxRowDirective } from '../../grids/row.directive';
55
import { IgxIconService } from '../../icon/icon.service';
@@ -22,7 +22,7 @@ export class IgxGridActionsBaseDirective implements AfterViewInit {
2222
* <igx-grid-editing-actions [asMenuItems]='true'></igx-grid-editing-actions>
2323
* ```
2424
*/
25-
@Input()
25+
@Input({ transform: booleanAttribute })
2626
public asMenuItems = false;
2727

2828
/** @hidden @internal **/

projects/igniteui-angular/src/lib/action-strip/grid-actions/grid-editing-actions.component.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { Component, HostBinding, Input } from '@angular/core';
1+
import { Component, HostBinding, Input, booleanAttribute } from '@angular/core';
22
import { IgxGridActionsBaseDirective } from './grid-actions-base.directive';
33
import { showMessage } from '../../core/utils';
4-
import { addRow, addChild } from '@igniteui/material-icons-extended';
4+
import { addRow, addChild } from '@igniteui/material-icons-extended';
55
import { IgxGridActionButtonComponent } from './grid-action-button.component';
66
import { NgIf } from '@angular/common';
77

@@ -27,7 +27,7 @@ export class IgxGridEditingActionsComponent extends IgxGridActionsBaseDirective
2727
/**
2828
* An input to enable/disable action strip row adding button
2929
*/
30-
@Input()
30+
@Input({ transform: booleanAttribute })
3131
public set addRow(value: boolean) {
3232
this._addRow = value;
3333
}
@@ -42,13 +42,13 @@ export class IgxGridEditingActionsComponent extends IgxGridActionsBaseDirective
4242
/**
4343
* An input to enable/disable action strip row editing button
4444
*/
45-
@Input()
45+
@Input({ transform: booleanAttribute })
4646
public editRow = true;
4747

4848
/**
4949
* An input to enable/disable action strip row deleting button
5050
*/
51-
@Input()
51+
@Input({ transform: booleanAttribute })
5252
public deleteRow = true;
5353

5454
/**
@@ -87,7 +87,7 @@ export class IgxGridEditingActionsComponent extends IgxGridActionsBaseDirective
8787
/**
8888
* An input to enable/disable action strip child row adding button
8989
*/
90-
@Input()
90+
@Input({ transform: booleanAttribute })
9191
public addChild = false;
9292

9393
private isMessageShown = false;
@@ -116,12 +116,12 @@ export class IgxGridEditingActionsComponent extends IgxGridActionsBaseDirective
116116
this.isMessageShown = showMessage(
117117
'The grid should be editable in order to use IgxGridEditingActionsComponent',
118118
this.isMessageShown);
119-
return;
119+
return;
120120
}
121121
// be sure row is in view
122122
if (grid.rowList.filter(r => r === row).length !== 0) {
123123
grid.gridAPI.crudService.enterEditMode(firstEditable, event);
124-
if (!grid.gridAPI.crudService.nonEditable){
124+
if (!grid.gridAPI.crudService.nonEditable) {
125125
firstEditable.activate(event);
126126
}
127127
}

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import {
1515
Renderer2,
1616
ViewChildren,
1717
OnDestroy,
18-
ElementRef
18+
ElementRef,
19+
booleanAttribute
1920
} from '@angular/core';
2021
import { Subject } from 'rxjs';
2122
import { IgxButtonDirective } from '../directives/button/button.directive';
@@ -194,7 +195,7 @@ export class IgxButtonGroupComponent extends DisplayDensityBase implements After
194195
* <igx-buttongroup [disabled]="true" [selectionMode]="'multi'" [values]="fontOptions"></igx-buttongroup>
195196
* ```
196197
*/
197-
@Input()
198+
@Input({ transform: booleanAttribute })
198199
public get disabled(): boolean {
199200
return this._disabled;
200201
}
@@ -493,13 +494,13 @@ export class IgxButtonGroupComponent extends DisplayDensityBase implements After
493494

494495
if (this.selectedIndexes.indexOf(index) === -1) {
495496
this.selected.emit(args);
496-
if(!args.cancel){
497+
if (!args.cancel) {
497498
this.selectButton(index);
498499
}
499500
} else {
500501
if (this.selectionMode !== 'singleRequired') {
501502
this.deselected.emit(args);
502-
if(!args.cancel){
503+
if (!args.cancel) {
503504
this.deselectButton(index);
504505
}
505506
}

projects/igniteui-angular/src/lib/calendar/calendar-base.ts

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Input, Output, EventEmitter, Directive, Inject, LOCALE_ID, HostListener } from '@angular/core';
1+
import { Input, Output, EventEmitter, Directive, Inject, LOCALE_ID, HostListener, booleanAttribute } from '@angular/core';
22
import { WEEKDAYS, Calendar, isDateInRanges, IFormattingOptions, IFormattingViews, IViewDateChangeEventArgs, ScrollMonth, IgxCalendarView, CalendarSelection } from './calendar';
33
import { ControlValueAccessor } from '@angular/forms';
44
import { DateRangeDescriptor } from '../core/dates';
@@ -26,7 +26,7 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor {
2626
* ```
2727
*/
2828

29-
@Input()
29+
@Input({ transform: booleanAttribute })
3030
public hideOutsideDays = false;
3131

3232
/**
@@ -62,7 +62,7 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor {
6262
* ```
6363
*/
6464
@Output()
65-
public activeViewChanged = new EventEmitter<IgxCalendarView>();
65+
public activeViewChanged = new EventEmitter<IgxCalendarView>();
6666

6767
/**
6868
* @hidden
@@ -99,9 +99,9 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor {
9999
*/
100100
public shiftKey = false;
101101

102-
/**
103-
* @hidden
104-
*/
102+
/**
103+
* @hidden
104+
*/
105105
public lastSelectedDate: Date;
106106

107107
/**
@@ -483,10 +483,7 @@ export class IgxCalendarBaseDirective implements ControlValueAccessor {
483483
public deselectMultipleInMonth(value: Date) {
484484
// deselect multiple dates from last clicked to shift clicked date (excluding)
485485
if (this.shiftKey) {
486-
let start: Date;
487-
let end: Date;
488-
489-
[start, end] = this.lastSelectedDate.getTime() < value.getTime()
486+
const [start, end] = this.lastSelectedDate.getTime() < value.getTime()
490487
? [this.lastSelectedDate, value]
491488
: [value, this.lastSelectedDate];
492489

0 commit comments

Comments
 (0)