Skip to content

Commit f93380a

Browse files
committed
chore(*): Merge upstream master
2 parents 809df0e + e36abe9 commit f93380a

22 files changed

+348
-63
lines changed

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

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class IgxCarouselComponent implements OnDestroy {
107107
* Sets the time `interval` in milliseconds before the slide changes.
108108
* If not set, the carousel will not change `slides` automatically.
109109
* ```html
110-
* <igx-carousel [interval] = "1000"></carousel>
110+
* <igx-carousel [interval] = "1000"></igx-carousel>
111111
* ```
112112
* @memberof IgxCarouselComponent
113113
*/
@@ -512,12 +512,12 @@ export class IgxCarouselComponent implements OnDestroy {
512512
})
513513

514514
export class IgxSlideComponent implements OnInit, OnDestroy {
515-
515+
private _active;
516516
/**
517517
* Gets/sets the `index` of the slide inside the carousel.
518518
* ```html
519519
* <igx-carousel>
520-
* <igx-slide index = "1"</igx-slide>
520+
* <igx-slide index = "1"></igx-slide>
521521
* <igx-carousel>
522522
* ```
523523
* @memberOf IgxSlideComponent
@@ -528,7 +528,7 @@ export class IgxSlideComponent implements OnInit, OnDestroy {
528528
* Gets/sets the target `direction` for the slide.
529529
* ```html
530530
* <igx-carousel>
531-
* <igx-slide direction="NEXT"</igx-slide>
531+
* <igx-slide direction="NEXT"></igx-slide>
532532
* <igx-carousel>
533533
* ```
534534
* @memberOf IgxSlideComponent
@@ -538,13 +538,31 @@ export class IgxSlideComponent implements OnInit, OnDestroy {
538538
* Gets/sets the `active` state of the slide.
539539
* ```html
540540
* <igx-carousel>
541-
* <igx-slide [active] ="false"</igx-slide>
541+
* <igx-slide [active] ="false"></igx-slide>
542+
* <igx-carousel>
543+
* ```
544+
*
545+
* Two-way data binding.
546+
* ```html
547+
* <igx-carousel>
548+
* <igx-slide [(active)] ="model.isActive"></igx-slide>
542549
* <igx-carousel>
543550
* ```
544551
* @memberof IgxSlideComponent
545552
*/
546553
@HostBinding('class.active')
547-
@Input() public active: boolean;
554+
@Input()
555+
public get active(): boolean {
556+
return this._active;
557+
}
558+
public set active(value) {
559+
this._active = value;
560+
this.activeChange.emit(this._active);
561+
}
562+
/**
563+
*@hidden
564+
*/
565+
@Output() public activeChange = new EventEmitter<boolean>();
548566

549567
constructor(private carousel: IgxCarouselComponent) { }
550568
/**

projects/igniteui-angular/src/lib/chips/chip.component.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,23 @@ export class IgxChipComponent extends DisplayDensityBase {
165165
* ```html
166166
* <igx-chip #myChip [id]="'igx-chip-1'" [selectable]="true" [selected]="true">
167167
* ```
168+
*
169+
* Two-way data binding:
170+
* ```html
171+
* <igx-chip #myChip [id]="'igx-chip-1'" [selectable]="true" [(selected)]="model.isSelected">
172+
* ```
168173
*/
169174
@Input()
170175
public set selected(newValue: boolean) {
171176
this.changeSelection(newValue);
172177
}
173178

179+
/**
180+
*@hidden
181+
*/
182+
@Output()
183+
public selectedChange = new EventEmitter<boolean>();
184+
174185
/**
175186
* Returns if the `IgxChipComponent` is selected.
176187
* ```typescript
@@ -438,13 +449,15 @@ export class IgxChipComponent extends DisplayDensityBase {
438449
if (!onSelectArgs.cancel) {
439450
this.renderer.addClass(this.chipArea.nativeElement, this._selectedItemClass);
440451
this._selected = newValue;
452+
this.selectedChange.emit(this._selected);
441453
}
442454
} else if (!newValue && this._selected) {
443455
this.onSelection.emit(onSelectArgs);
444456

445457
if (!onSelectArgs.cancel) {
446458
this.renderer.removeClass(this.chipArea.nativeElement, this._selectedItemClass);
447459
this._selected = newValue;
460+
this.selectedChange.emit(this._selected);
448461
}
449462
}
450463
}

projects/igniteui-angular/src/lib/drop-down/drop-down-item.base.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { IDropDownBase, IGX_DROPDOWN_BASE } from './drop-down.common';
2-
import { Input, HostBinding, HostListener, ElementRef, Optional, Inject, DoCheck, Directive } from '@angular/core';
2+
import { Directive, Input, HostBinding, HostListener, ElementRef, Optional, Inject, DoCheck, Output, EventEmitter } from '@angular/core';
33
import { IgxSelectionAPIService } from '../core/selection';
44
import { DeprecateProperty, showMessage } from '../core/deprecateDecorators';
55
import { IgxDropDownGroupComponent } from './drop-down-group.component';
@@ -125,6 +125,11 @@ export class IgxDropDownItemBase implements DoCheck {
125125
* let mySelectedItem = this.dropdown.selectedItem;
126126
* let isMyItemSelected = mySelectedItem.selected; // true
127127
* ```
128+
*
129+
* Two-way data binding
130+
* ```html
131+
* <igx-drop-down-item [(selected)]='model.isSelected'></igx-drop-down-item>
132+
* ```
128133
*/
129134
@Input()
130135
@HostBinding('attr.aria-selected')
@@ -138,8 +143,15 @@ export class IgxDropDownItemBase implements DoCheck {
138143
return;
139144
}
140145
this._selected = value;
146+
this.selectedChange.emit(this._selected);
141147
}
142148

149+
/**
150+
*@hidden
151+
*/
152+
@Output()
153+
public selectedChange = new EventEmitter<boolean>();
154+
143155
/**
144156
* @hidden @internal
145157
*/

projects/igniteui-angular/src/lib/drop-down/drop-down-item.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ export class IgxDropDownItemComponent extends IgxDropDownItemBase implements DoC
5353
return;
5454
}
5555
this._selected = value;
56+
this.selectedChange.emit(this._selected);
5657
}
5758
/**
5859
* @hidden @internal

projects/igniteui-angular/src/lib/expansion-panel/expansion-panel.component.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export interface AnimationSettings {
2727
providers: [{ provide: IGX_EXPANSION_PANEL_COMPONENT, useExisting: IgxExpansionPanelComponent }]
2828
})
2929
export class IgxExpansionPanelComponent implements IgxExpansionPanelBase, AfterContentInit {
30+
private _collapsed = true;
3031
/**
3132
* Sets/gets the animation settings of the expansion panel component
3233
* Open and Close animation should be passed
@@ -95,9 +96,26 @@ export class IgxExpansionPanelComponent implements IgxExpansionPanelBase, AfterC
9596
* ```html
9697
* this.panel.collapsed = true;
9798
* ```
99+
*
100+
* Two-way data binding:
101+
* ```html
102+
* <igx-expansion-panel [(collapsed)]="model.isCollapsed"></igx-expansion-panel>
103+
* ```
98104
*/
99105
@Input()
100-
public collapsed = true;
106+
public get collapsed(): boolean {
107+
return this._collapsed;
108+
}
109+
public set collapsed(value) {
110+
this._collapsed = value;
111+
this.collapsedChange.emit(this._collapsed);
112+
}
113+
114+
/**
115+
*@hidden
116+
*/
117+
@Output()
118+
public collapsedChange = new EventEmitter<boolean>();
101119

102120
/**
103121
* Emitted when the expansion panel finishes collapsing

projects/igniteui-angular/src/lib/grids/columns/column-group.component.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import {
66
Input,
77
forwardRef,
88
QueryList,
9-
TemplateRef
9+
TemplateRef,
10+
Output,
11+
EventEmitter
1012
} from '@angular/core';
1113

1214
import { IgxColumnComponent } from './column.component';
@@ -128,15 +130,28 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
128130
}
129131
/**
130132
* Sets the column group hidden property.
131-
* ```typescript
133+
* ```html
132134
* <igx-column [hidden] = "true"></igx-column>
133135
* ```
136+
*
137+
* Two-way data binding
138+
* ```html
139+
* <igx-column [(hidden)] = "model.columns[0].isHidden"></igx-column>
140+
* ```
134141
* @memberof IgxColumnGroupComponent
135142
*/
136143
set hidden(value: boolean) {
137144
this._hidden = value;
145+
this.hiddenChange.emit(this._hidden);
138146
this.children.forEach(child => child.hidden = value);
139147
}
148+
149+
/**
150+
*@hidden
151+
*/
152+
@Output()
153+
public hiddenChange = new EventEmitter<boolean>();
154+
140155
/**
141156
*@hidden
142157
*/
@@ -206,7 +221,7 @@ export class IgxColumnGroupComponent extends IgxColumnComponent implements After
206221

207222
set width(val) { }
208223

209-
// constructor(public gridAPI: GridBaseAPIService<IgxGridBaseComponent & GridType>, public cdr: ChangeDetectorRef) {
224+
// constructor(public gridAPI: GridBaseAPIService<IgxGridBaseComponent & IGridDataBindable>, public cdr: ChangeDetectorRef) {
210225
// // D.P. constructor duplication due to es6 compilation, might be obsolete in the future
211226
// super(gridAPI, cdr);
212227
// }

projects/igniteui-angular/src/lib/grids/columns/column.component.ts

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import {
88
Input,
99
QueryList,
1010
TemplateRef,
11+
Output,
12+
EventEmitter,
1113
} from '@angular/core';
1214
import { notifyChanges } from '../watch-changes';
1315
import { DataType } from '../../data-operations/data-util';
@@ -215,14 +217,20 @@ export class IgxColumnComponent implements AfterContentInit {
215217
/**
216218
* Sets the column hidden property.
217219
* Default value is `false`.
218-
* ```typescript
220+
* ```html
219221
* <igx-column [hidden] = "true"></igx-column>
220222
* ```
223+
*
224+
* Two-way data binding.
225+
* ```html
226+
* <igx-column [(hidden)] = "model.isHidden"></igx-column>
227+
* ```
221228
* @memberof IgxColumnComponent
222229
*/
223230
set hidden(value: boolean) {
224231
if (this._hidden !== value) {
225232
this._hidden = value;
233+
this.hiddenChange.emit(this._hidden);
226234
if (this.columnLayoutChild && this.parent.hidden !== value) {
227235
this.parent.hidden = value;
228236
return;
@@ -236,6 +244,12 @@ export class IgxColumnComponent implements AfterContentInit {
236244
}
237245
}
238246
}
247+
248+
/**
249+
*@hidden
250+
*/
251+
@Output()
252+
public hiddenChange = new EventEmitter<boolean>();
239253
/**
240254
* Gets whether the hiding is disabled.
241255
* ```typescript
@@ -287,6 +301,11 @@ export class IgxColumnComponent implements AfterContentInit {
287301
* ```html
288302
* <igx-column [width] = "'25%'"></igx-column>
289303
* ```
304+
*
305+
* Two-way data binding.
306+
* ```html
307+
* <igx-column [(width)]="model.columns[0].width"></igx-column>
308+
* ```
290309
* @memberof IgxColumnComponent
291310
*/
292311
public set width(value: string) {
@@ -298,9 +317,16 @@ export class IgxColumnComponent implements AfterContentInit {
298317
if (this.grid) {
299318
this.cacheCalcWidth();
300319
}
320+
this.widthChange.emit(this._width);
301321
}
302322
}
303323

324+
/**
325+
*@hidden
326+
*/
327+
@Output()
328+
public widthChange = new EventEmitter<string>();
329+
304330
/**
305331
* @hidden
306332
*/
@@ -480,6 +506,11 @@ export class IgxColumnComponent implements AfterContentInit {
480506
* ```html
481507
* <igx-column [pinned] = "true"></igx-column>
482508
* ```
509+
*
510+
* Two-way data binding.
511+
* ```html
512+
* <igx-column [(pinned)] = "model.columns[0].isPinned"></igx-column>
513+
* ```
483514
* @memberof IgxColumnComponent
484515
*/
485516
public set pinned(value: boolean) {
@@ -492,8 +523,16 @@ export class IgxColumnComponent implements AfterContentInit {
492523
will re-init the group (if present)
493524
*/
494525
this._pinned = value;
526+
this.pinnedChange.emit(this._pinned);
495527
}
496528
}
529+
530+
/**
531+
*@hidden
532+
*/
533+
@Output()
534+
public pinnedChange = new EventEmitter<boolean>();
535+
497536
/**
498537
* @deprecated
499538
* Gets/Sets the `id` of the `igx-grid`.
@@ -1348,6 +1387,7 @@ export class IgxColumnComponent implements AfterContentInit {
13481387
}
13491388

13501389
this._pinned = true;
1390+
this.pinnedChange.emit(this._pinned);
13511391
this._unpinnedIndex = grid._unpinnedColumns.indexOf(this);
13521392
index = index !== undefined ? index : grid._pinnedColumns.length;
13531393
const targetColumn = grid._pinnedColumns[index];
@@ -1412,6 +1452,7 @@ export class IgxColumnComponent implements AfterContentInit {
14121452
index = (index !== undefined ? index :
14131453
this._unpinnedIndex !== undefined ? this._unpinnedIndex : this.index);
14141454
this._pinned = false;
1455+
this.pinnedChange.emit(this._pinned);
14151456

14161457
const targetColumn = grid._unpinnedColumns[index];
14171458

0 commit comments

Comments
 (0)