@@ -17,7 +17,7 @@ import {
1717import { FormsModule , ReactiveFormsModule , ControlValueAccessor , NG_VALUE_ACCESSOR , NgControl } from '@angular/forms' ;
1818import { IgxCheckboxModule } from '../checkbox/checkbox.component' ;
1919import { IgxSelectionAPIService } from '../core/selection' ;
20- import { cloneArray , CancelableEventArgs , CancelableBrowserEventArgs } from '../core/utils' ;
20+ import { cloneArray , CancelableEventArgs , CancelableBrowserEventArgs , diffInSets } from '../core/utils' ;
2121import { IgxStringFilteringOperand , IgxBooleanFilteringOperand } from '../data-operations/filtering-condition' ;
2222import { FilteringLogic , IFilteringExpression } from '../data-operations/filtering-expression.interface' ;
2323import { SortingDirection , ISortingExpression } from '../data-operations/sorting-expression.interface' ;
@@ -86,6 +86,8 @@ export enum IgxComboState {
8686export interface IComboSelectionChangeEventArgs extends CancelableEventArgs {
8787 oldSelection : any [ ] ;
8888 newSelection : any [ ] ;
89+ added : any [ ] ;
90+ removed : any [ ] ;
8991 event ?: Event ;
9092}
9193
@@ -327,7 +329,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
327329 * <igx-combo #combo>
328330 * ...
329331 * <ng-template igxComboEmpty>
330- * <div class="combo--emtpy ">
332+ * <div class="combo--empty ">
331333 * There are no items to display
332334 * </div>
333335 * </ng-template>
@@ -703,7 +705,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
703705 }
704706
705707 /**
706- * Combo value data source propery .
708+ * Combo value data source property .
707709 *
708710 * ```typescript
709711 * // get
@@ -724,7 +726,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
724726 }
725727
726728 /**
727- * Combo text data source propery .
729+ * Combo text data source property .
728730 *
729731 * ```typescript
730732 * // get
@@ -737,7 +739,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
737739 *
738740 * ```html
739741 * <!--set-->
740- * <igx-combo [displayKey]='mydisplayKey '></igx-combo>
742+ * <igx-combo [displayKey]='myDisplayKey '></igx-combo>
741743 * ```
742744 */
743745 get displayKey ( ) {
@@ -1472,7 +1474,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
14721474 /**
14731475 * Selects/Deselects an item using it's valueKey value
14741476 * @param itemID the valueKey of the specified item
1475- * @param select If the item should be selected (true) or deselcted (false)
1477+ * @param select If the item should be selected (true) or deselected (false)
14761478 *
14771479 * ```typescript
14781480 * items: { field: string, region: string}[] = data;
@@ -1496,11 +1498,15 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
14961498 }
14971499
14981500 protected setSelection ( newSelection : Set < any > , event ?: Event ) : void {
1501+ const removed = Array . from ( diffInSets ( this . selection . get ( this . id ) , newSelection ) ) ;
1502+ const added = Array . from ( diffInSets ( newSelection , this . selection . get ( this . id ) ) ) ;
14991503 const oldSelectionEmit = Array . from ( this . selection . get ( this . id ) || [ ] ) ;
15001504 const newSelectionEmit = Array . from ( newSelection || [ ] ) ;
15011505 const args : IComboSelectionChangeEventArgs = {
15021506 newSelection : newSelectionEmit ,
15031507 oldSelection : oldSelectionEmit ,
1508+ added,
1509+ removed,
15041510 event,
15051511 cancel : false
15061512 } ;
0 commit comments