Skip to content

Commit 246782e

Browse files
authored
Merge pull request #5950 from IgniteUI/8.2.x
Merging 8.2.x into master
2 parents 367b7a6 + ce9218c commit 246782e

File tree

77 files changed

+816
-426
lines changed

Some content is hidden

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

77 files changed

+816
-426
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
# Ignite UI for Angular Change Log
1+
# Ignite UI for Angular Change Log
22

33
All notable changes for each version of this project will be documented in this file.
44

5+
## 8.2.3
6+
- `IgxTextHighlightDirective` - The default highlight directive styles have been moved to a Sass theme - `igx-highlight-theme`; You can modify the resting and active background and text color styles of the directive by passing the respective properties to the Sass theme. You can still pass your own CSS classes to the highlight directive via the cssClass and activeCssClass inputs.
7+
8+
- `IgxChip`
9+
- **Breaking Change** The `originalEvent` property for the events `onMoveStart`, `onMoveEnd`, `onClick` and `onSelection` now provides the events, passed from the `igxDrag` directive. The passed original events are in other words the previous events that triggered the `igxChip` ones. They also have original events until a browser event is reached.
10+
511
## 8.2.0
612
### New theme
713
Ignite UI for angular now have a new theme that mimics Microsoft "Fluent" design system.
@@ -75,6 +81,7 @@ For more information about the theming please read our [documentation](https://w
7581
- `isCellSelected` method has been deprecated. Now you can use `selected` property.
7682
- `rowSelectable` property has been deprecated. Now you can use `rowSelection` property to enable row selection and also you can show and hide the row selectors by setting `hideRowSelectors` property to true or false (which is the default value).
7783
- Removed deprecated event `OnFocusChange`
84+
- `IgxGridBaseComponent` exposes a new property, `dataView` that returns the currently transformed paged/filtered/sorted/grouped data, displayed in the grid
7885
- **Breaking Change** `igxExcelStyleSortingTemplate` directive is renamed to `igxExcelStyleSorting`.
7986
- **Breaking Change** `igxExcelStyleMovingTemplate` directive is renamed to `igxExcelStyleMoving`.
8087
- **Breaking Change** `igxExcelStyleHidingTemplate` directive is renamed to `igxExcelStyleHiding`.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
(dragStart)="onChipDragStart($event)"
88
(dragEnd)="onChipDragEnd()"
99
(transitioned)="onChipMoveEnd($event)"
10-
(click)="onChipDragClicked($event)"
10+
(dragClick)="onChipDragClicked($event)"
1111
igxDrop
1212
(enter)="onChipDragEnterHandler($event)"
1313
(dropped)="onChipDrop($event)">

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { IBaseEventArgs } from '../core/utils';
2424

2525

2626
export interface IBaseChipEventArgs extends IBaseEventArgs {
27-
originalEvent: PointerEvent | MouseEvent | TouchEvent | KeyboardEvent | IDropBaseEventArgs;
27+
originalEvent: IDragBaseEventArgs | IDropBaseEventArgs | KeyboardEvent | MouseEvent | TouchEvent;
2828
owner: IgxChipComponent;
2929
}
3030

@@ -557,7 +557,7 @@ export class IgxChipComponent extends DisplayDensityBase {
557557
// Start chip igxDrag behavior
558558
public onChipDragStart(event: IDragStartEventArgs) {
559559
this.onMoveStart.emit({
560-
originalEvent: event.originalEvent,
560+
originalEvent: event,
561561
owner: this
562562
});
563563
event.cancel = !this.draggable || this.disabled;
@@ -578,7 +578,7 @@ export class IgxChipComponent extends DisplayDensityBase {
578578
public onChipMoveEnd(event: IDragBaseEventArgs) {
579579
// moveEnd is triggered after return animation has finished. This happen when we drag and release the chip.
580580
this.onMoveEnd.emit({
581-
originalEvent: event.originalEvent,
581+
originalEvent: event,
582582
owner: this
583583
});
584584

@@ -592,14 +592,14 @@ export class IgxChipComponent extends DisplayDensityBase {
592592
*/
593593
public onChipDragClicked(event: IDragBaseEventArgs) {
594594
const clickEventArgs: IChipClickEventArgs = {
595-
originalEvent: event.originalEvent,
595+
originalEvent: event,
596596
owner: this,
597597
cancel: false
598598
};
599599
this.onClick.emit(clickEventArgs);
600600

601601
if (!clickEventArgs.cancel && this.selectable && !this.disabled) {
602-
this.changeSelection(!this.selected, event.originalEvent);
602+
this.changeSelection(!this.selected, event);
603603
}
604604
}
605605
// End chip igxDrag behavior

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,9 +415,19 @@ describe('IgxChip', () => {
415415
fix.detectChanges();
416416
expect(secondChipComp.onSelection.emit).toHaveBeenCalled();
417417
expect(secondChipComp.onSelectionDone.emit).not.toHaveBeenCalled();
418+
expect(secondChipComp.onSelection.emit).not.toHaveBeenCalledWith({
419+
originalEvent: null,
420+
owner: secondChipComp,
421+
cancel: false,
422+
selected: true
423+
});
418424

419425
await wait(400);
420426
expect(secondChipComp.onSelectionDone.emit).toHaveBeenCalled();
427+
expect(secondChipComp.onSelectionDone.emit).not.toHaveBeenCalledWith({
428+
originalEvent: null,
429+
owner: secondChipComp
430+
});
421431
}));
422432

423433
it('should not fire onSelection event when selectable is false', () => {

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ import {
2121
IChipEnterDragAreaEventArgs,
2222
IBaseChipEventArgs
2323
} from './chip.component';
24-
import { IDropBaseEventArgs } from '../directives/drag-drop/drag-drop.directive';
24+
import { IDropBaseEventArgs, IDragBaseEventArgs } from '../directives/drag-drop/drag-drop.directive';
2525
import { takeUntil } from 'rxjs/operators';
2626
import { Subject } from 'rxjs';
2727

2828
export interface IBaseChipsAreaEventArgs {
29-
originalEvent: PointerEvent | MouseEvent | TouchEvent | KeyboardEvent | IDropBaseEventArgs;
29+
originalEvent: IDragBaseEventArgs | IDropBaseEventArgs | KeyboardEvent | MouseEvent | TouchEvent;
3030
owner: IgxChipsAreaComponent;
3131
}
3232

@@ -152,7 +152,6 @@ export class IgxChipsAreaComponent implements DoCheck, AfterViewInit, OnDestroy
152152

153153
private modifiedChipsArray: IgxChipComponent[];
154154
private _differ: IterableDiffer<IgxChipComponent> | null = null;
155-
private selectedChips: IgxChipComponent[] = [];
156155
protected destroy$ = new Subject<boolean>();
157156

158157
constructor(public cdr: ChangeDetectorRef, public element: ElementRef,
@@ -166,11 +165,11 @@ export class IgxChipsAreaComponent implements DoCheck, AfterViewInit, OnDestroy
166165
public ngAfterViewInit() {
167166
// If we have initially selected chips through their inputs, we need to get them, because we cannot listen to their events yet.
168167
if (this.chipsList.length) {
169-
this.selectedChips = this.chipsList.filter((item: IgxChipComponent) => item.selected);
170-
if (this.selectedChips.length) {
168+
const selectedChips = this.chipsList.filter((item: IgxChipComponent) => item.selected);
169+
if (selectedChips.length) {
171170
this.onSelection.emit({
172171
originalEvent: null,
173-
newSelection: this.selectedChips,
172+
newSelection: selectedChips,
174173
owner: this
175174
});
176175
}
@@ -324,16 +323,17 @@ export class IgxChipsAreaComponent implements DoCheck, AfterViewInit, OnDestroy
324323
* @hidden
325324
*/
326325
protected onChipSelectionChange(event: IChipSelectEventArgs) {
327-
if (event.selected) {
328-
this.selectedChips.push(event.owner);
329-
} else if (!event.selected) {
330-
this.selectedChips = this.selectedChips.filter((chip) => {
326+
let selectedChips = this.chipsList.filter((chip) => chip.selected);
327+
if (event.selected && !selectedChips.includes(event.owner)) {
328+
selectedChips.push(event.owner);
329+
} else if (!event.selected && selectedChips.includes(event.owner)) {
330+
selectedChips = selectedChips.filter((chip) => {
331331
return chip.id !== event.owner.id;
332332
});
333333
}
334334
this.onSelection.emit({
335335
originalEvent: event.originalEvent,
336-
newSelection: this.selectedChips,
336+
newSelection: selectedChips,
337337
owner: this
338338
});
339339
}

projects/igniteui-angular/src/lib/chips/chips-area.spec.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@ describe('IgxChipsArea', () => {
386386
const firstChipComp = fix.componentInstance.chips.toArray()[1];
387387
spyOn(firstChipComp.onClick, 'emit');
388388

389-
firstChipComp.chipArea.nativeElement.click();
389+
firstChipComp.chipArea.nativeElement.dispatchEvent(new PointerEvent('pointerdown', { pointerId: 1}));
390+
firstChipComp.chipArea.nativeElement.dispatchEvent(new PointerEvent('pointerup'));
390391

391392
fix.detectChanges();
392393
expect(firstChipComp.onClick.emit).toHaveBeenCalled();
@@ -857,26 +858,22 @@ describe('IgxChipsArea', () => {
857858

858859
const chipAreaComp = fix.componentInstance.chipsArea;
859860
const secondChipComp = fix.componentInstance.chips.toArray()[1];
861+
const pointerDownEvt = new PointerEvent('pointerdown', { pointerId: 1 });
862+
const pointerUpEvt = new PointerEvent('pointerup', { pointerId: 1 });
860863

861864
spyOn(chipAreaComp.onSelection, 'emit');
862865
fix.detectChanges();
863866

864-
secondChipComp.chipArea.nativeElement.click();
867+
secondChipComp.chipArea.nativeElement.dispatchEvent(pointerDownEvt);
865868
fix.detectChanges();
866-
867-
expect(chipAreaComp.onSelection.emit).toHaveBeenCalledWith({
868-
originalEvent: null,
869-
owner: chipAreaComp,
870-
newSelection: [secondChipComp]
871-
});
872-
873-
secondChipComp.chipArea.nativeElement.click();
869+
secondChipComp.chipArea.nativeElement.dispatchEvent(pointerUpEvt);
874870
fix.detectChanges();
875871

876-
expect(chipAreaComp.onSelection.emit).toHaveBeenCalledWith({
872+
expect(chipAreaComp.onSelection.emit).toHaveBeenCalled();
873+
expect(chipAreaComp.onSelection.emit).not.toHaveBeenCalledWith({
877874
originalEvent: null,
878875
owner: chipAreaComp,
879-
newSelection: []
876+
newSelection: [secondChipComp]
880877
});
881878
});
882879

@@ -889,8 +886,6 @@ describe('IgxChipsArea', () => {
889886
fix.detectChanges();
890887

891888
const secondChipComp = fix.componentInstance.chips.toArray();
892-
893-
expect(chipAreaComp['selectedChips']).toEqual([secondChipComp[0], secondChipComp[1]]);
894889
expect(chipAreaComp.onSelection.emit).toHaveBeenCalledWith({
895890
originalEvent: null,
896891
owner: chipAreaComp,

projects/igniteui-angular/src/lib/combo/combo.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<ng-container ngProjectAs="igx-hint, [igxHint]">
2525
<ng-content select="igx-hint, [igxHint]"></ng-content>
2626
</ng-container>
27-
<input igxInput #comboInput name="comboInput" type="text" [value]="value" readonly [placeholder]="placeholder"
27+
<input igxInput #comboInput name="comboInput" type="text" [value]="value" readonly [attr.placeholder]="placeholder"
2828
[disabled]="disabled" (blur)="onBlur()" />
2929
<ng-container ngProjectAs="igx-suffix">
3030
<ng-content select="igx-suffix"></ng-content>
@@ -47,7 +47,7 @@
4747
<igx-input-group *ngIf="displaySearchInput" [displayDensity]="displayDensity" class="igx-combo__search">
4848
<input class="igx-combo-input" igxInput #searchInput name="searchInput" autocomplete="off" type="text"
4949
[(ngModel)]="searchValue" (ngModelChange)="handleInputChange($event)" (keyup)="handleKeyUp($event)"
50-
(keydown)="handleKeyDown($event)" (focus)="dropdown.onBlur($event)" [placeholder]="searchPlaceholder"
50+
(keydown)="handleKeyDown($event)" (focus)="dropdown.onBlur($event)" [attr.placeholder]="searchPlaceholder"
5151
aria-autocomplete="both" [attr.aria-owns]="dropdown.id" [attr.aria-labelledby]="ariaLabelledBy" />
5252
</igx-input-group>
5353
<ng-container *ngTemplateOutlet="headerTemplate">

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ export class IgxComboComponent extends DisplayDensityBase implements IgxComboBas
670670
* ```
671671
*/
672672
@Input()
673-
public placeholder = '';
673+
public placeholder;
674674

675675
/**
676676
* @hidden @internal

projects/igniteui-angular/src/lib/core/styles/components/chip/_chip-component.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
@extend %igx-chip__item--hover !optional;
2424
}
2525

26-
&:focus,
27-
&:focus-within {
26+
&:focus {
2827
@extend %igx-chip__item--focus !optional;
2928
}
3029
}

projects/igniteui-angular/src/lib/core/styles/components/chip/_chip-theme.scss

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,9 +402,20 @@
402402
display: none;
403403
}
404404

405-
&:focus-within {
405+
// FIX IE11 and Edge focus styles.
406+
// [focus-within] is not supported by IE & Edge.
407+
&:focus {
406408
outline-style: none;
407-
color: igx-color(map-get($theme, 'palette'), error);
409+
410+
igx-icon {
411+
color: igx-color(map-get($theme, 'palette'), error);
412+
}
413+
}
414+
415+
igx-icon {
416+
&:focus{
417+
outline-style: none;
418+
}
408419
}
409420

410421
[dir='rtl'] & {

0 commit comments

Comments
 (0)