Skip to content

Grids templates refactoring #9256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 93 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
e0f5733
refactor(grid): Header row and group by components
rkaraivanov Apr 1, 2021
5e070a7
refactor(grid): Clean header components
rkaraivanov Apr 1, 2021
b1dcb0f
refactor(grids): Grids use new components
rkaraivanov Apr 1, 2021
0a2b53a
refactor(grids): Column moving and drag selection
rkaraivanov Apr 1, 2021
42e163c
refactor(grid): Adjust tests to new API
rkaraivanov Apr 1, 2021
0ec4385
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 1, 2021
76b8570
refactor(grid): Cleaned group area implementation
rkaraivanov Apr 2, 2021
5c760e9
refactor(tests): Adjusted chip tests to new API
rkaraivanov Apr 2, 2021
1d7e214
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 2, 2021
90b91f6
refactor(grid): Cleared grid templates
rkaraivanov Apr 2, 2021
c343241
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 2, 2021
4051139
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 6, 2021
e59e446
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 6, 2021
54bc6ee
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 6, 2021
74685a4
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 7, 2021
be30130
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 7, 2021
211319f
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 7, 2021
68ff564
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 7, 2021
300bf1f
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 8, 2021
b036756
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 8, 2021
67ffacc
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 9, 2021
3b60875
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 9, 2021
0b47e6d
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 13, 2021
aeb5baf
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 13, 2021
668dd9c
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 13, 2021
66ce732
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 14, 2021
23004c8
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 15, 2021
3a29594
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 15, 2021
944207d
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 16, 2021
0e1f586
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 16, 2021
d06811e
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 16, 2021
c379538
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 26, 2021
5413de9
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Apr 27, 2021
f346336
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 10, 2021
4d1a512
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 10, 2021
9e61fed
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 10, 2021
ed6e445
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 11, 2021
b82ecf1
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 11, 2021
3cfcaf3
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 11, 2021
968a5f7
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 11, 2021
7d3790a
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 11, 2021
a3eab5d
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 12, 2021
21f81b4
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 12, 2021
41e3570
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 13, 2021
b924683
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 14, 2021
7821e9e
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 14, 2021
07cfb82
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 17, 2021
540e930
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 19, 2021
d80d014
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 20, 2021
b3c930c
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 25, 2021
f200cca
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 25, 2021
10fce30
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov May 31, 2021
3f425f3
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 1, 2021
cf0fbdb
refactor(grid-theme): split theme according to the grid refactoring (…
SisIvanova Jun 1, 2021
443ef15
fix(group-area): Sorting direction of chips
rkaraivanov Jun 1, 2021
6ffb9e4
Merge branch 'rkaraivanov/grids-spa-and-wellbeing' of https://github.…
rkaraivanov Jun 1, 2021
fd16034
fix(headers): Bind through a getter
rkaraivanov Jun 2, 2021
2a3ed6d
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 3, 2021
7be7795
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 4, 2021
80a08c1
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 7, 2021
f5256f0
fix(grid-header-row): Restrucuted the DOM
rkaraivanov Jun 7, 2021
5d3f36c
fix(grid-filtering): Correctly apply density
rkaraivanov Jun 7, 2021
988ab5e
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 7, 2021
cf79374
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 8, 2021
c9405f0
refactor(group-area): Use platform service
rkaraivanov Jun 8, 2021
677bfee
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 10, 2021
7af8733
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 14, 2021
0fdef51
Adjusted moving/pinning tests
rkaraivanov Jun 14, 2021
b347b1e
More unit tests adjustments
rkaraivanov Jun 14, 2021
cbe4783
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 14, 2021
cf1ed59
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 15, 2021
16e5635
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 17, 2021
31c96f3
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 18, 2021
2712943
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 22, 2021
fb576df
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 23, 2021
abd64f2
fix(filtering): Keyboard combo for XL filtering
rkaraivanov Jun 23, 2021
e9228c3
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 23, 2021
1fdaa7e
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 24, 2021
15cadc8
Merge branch 'master' into rkaraivanov/grids-spa-and-wellbeing
kdinev Jun 24, 2021
5e82d27
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 25, 2021
ac2d7de
Merge branch 'master' into rkaraivanov/grids-spa-and-wellbeing
kdinev Jun 25, 2021
f4df135
Merge branch 'master' into rkaraivanov/grids-spa-and-wellbeing
kdinev Jun 25, 2021
cc021c6
Merge branch 'master' into rkaraivanov/grids-spa-and-wellbeing
kdinev Jun 25, 2021
6b117bb
refactor(grid): Magic numbers to consts
rkaraivanov Jun 25, 2021
c28004e
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jun 25, 2021
7b8be0a
Merge branch 'rkaraivanov/grids-spa-and-wellbeing' of https://github.…
rkaraivanov Jun 25, 2021
bc42564
fix(paginator): Removed circular deps
rkaraivanov Jun 28, 2021
aeb1c99
Merge branch 'master' into rkaraivanov/grids-spa-and-wellbeing
ddincheva Jun 29, 2021
2f4aecf
Merge branch 'master' into rkaraivanov/grids-spa-and-wellbeing
simeonoff Jun 29, 2021
f7bf723
Merge branch 'master' into rkaraivanov/grids-spa-and-wellbeing
ddincheva Jun 30, 2021
99352a2
Merge branch 'master' of https://github.com/IgniteUI/igniteui-angular…
rkaraivanov Jul 5, 2021
328f28d
chore(*): Post-merge fixes
rkaraivanov Jul 5, 2021
b2fdc1a
Merge branch 'master' into rkaraivanov/grids-spa-and-wellbeing
kdinev Jul 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion projects/igniteui-angular/src/lib/chips/chip.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,11 @@ export class IgxChipComponent extends DisplayDensityBase {
return this.getComponentDensityClass('igx-chip__ghost');
}

/** @hidden @internal */
public get nativeElement() {
return this.ref.nativeElement;
}

/**
* @hidden
* @internal
Expand All @@ -525,7 +530,7 @@ export class IgxChipComponent extends DisplayDensityBase {
protected _movedWhileRemoving = false;
private _resourceStrings = CurrentResourceStrings.ChipResStrings;

constructor(public cdr: ChangeDetectorRef, public elementRef: ElementRef, private renderer: Renderer2,
constructor(public cdr: ChangeDetectorRef, private ref: ElementRef<HTMLElement>, private renderer: Renderer2,
@Optional() @Inject(DisplayDensityToken) protected _displayDensityOptions: IDisplayDensityOptions) {
super(_displayDensityOptions);
}
Expand Down
2 changes: 1 addition & 1 deletion projects/igniteui-angular/src/lib/chips/chip.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ describe('IgxChip', () => {

spyOn(firstChipComp.selectedChanging, 'emit');
spyOn(firstChipComp.selectedChanged, 'emit');
firstChipComp.elementRef.nativeElement.focus();
firstChipComp.nativeElement.focus();

UIInteractions.triggerKeyDownEvtUponElem(' ', firstChipComp.chipArea.nativeElement, true);
fix.detectChanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,18 @@ export class IgxChipsAreaComponent implements DoCheck, AfterViewInit, OnDestroy
orderChanged = this.positionChipAtIndex(dragChipIndex, dragChipIndex - 1, false, event.originalEvent);
if (orderChanged) {
setTimeout(() => {
this.chipsList.toArray()[dragChipIndex - 1].elementRef.nativeElement.focus();
this.chipsList.get(dragChipIndex - 1).nativeElement.focus();
});
}
} else if (event.originalEvent.key === 'ArrowRight' || event.originalEvent.key === 'Right') {
orderChanged = this.positionChipAtIndex(dragChipIndex, dragChipIndex + 1, true, event.originalEvent);
}
} else {
if ((event.originalEvent.key === 'ArrowLeft' || event.originalEvent.key === 'Left') && dragChipIndex > 0) {
chipsArray[dragChipIndex - 1].elementRef.nativeElement.focus();
chipsArray[dragChipIndex - 1].nativeElement.focus();
} else if ((event.originalEvent.key === 'ArrowRight' || event.originalEvent.key === 'Right') &&
dragChipIndex < chipsArray.length - 1) {
chipsArray[dragChipIndex + 1].elementRef.nativeElement.focus();
chipsArray[dragChipIndex + 1].nativeElement.focus();
}
}
}
Expand Down
47 changes: 23 additions & 24 deletions projects/igniteui-angular/src/lib/chips/chips-area.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,18 @@ import { wait, UIInteractions } from '../test-utils/ui-interactions.spec';
`
})
class TestChipComponent {
@ViewChild('chipsArea', { read: IgxChipsAreaComponent, static: true })
@ViewChild('chipsArea', { read: IgxChipsAreaComponent, static: true })
public chipsArea: IgxChipsAreaComponent;

@ViewChildren('chipElem', { read: IgxChipComponent})
@ViewChildren('chipElem', { read: IgxChipComponent })
public chips: QueryList<IgxChipComponent>;

public chipList = [
{ id: 'Country', text: 'Country', removable: false, selectable: false, draggable: false },
{ id: 'City', text: 'City', removable: true, selectable: true, draggable: true }
];

constructor(public cdr: ChangeDetectorRef) {}
constructor(public cdr: ChangeDetectorRef) { }
}

@Component({
Expand All @@ -56,8 +56,7 @@ class TestChipSelectComponent extends TestChipComponent {
}

@Component({
template:
`
template: `
<igx-chips-area #chipsArea (reorder)="chipsOrderChanged($event)">
<igx-chip #chipElem *ngFor="let chip of chipList" [id]="chip.id" [draggable]="true"
[removable]="true" [selectable]="true" (remove)="chipRemoved($event)">
Expand All @@ -68,10 +67,10 @@ class TestChipSelectComponent extends TestChipComponent {
`
})
class TestChipReorderComponent {
@ViewChild('chipsArea', { read: IgxChipsAreaComponent, static: true })
@ViewChild('chipsArea', { read: IgxChipsAreaComponent, static: true })
public chipsArea: IgxChipsAreaComponent;

@ViewChildren('chipElem', { read: IgxChipComponent})
@ViewChildren('chipElem', { read: IgxChipComponent })
public chips: QueryList<IgxChipComponent>;

public chipList = [
Expand All @@ -81,7 +80,7 @@ class TestChipReorderComponent {
{ id: 'FirstName', text: 'First Name' },
];

constructor(public cdr: ChangeDetectorRef) {}
constructor(public cdr: ChangeDetectorRef) { }

public chipsOrderChanged(event) {
const newChipList = [];
Expand Down Expand Up @@ -197,11 +196,11 @@ describe('IgxChipsArea ', () => {
const firstChipComp = fix.componentInstance.chips.toArray()[0];
const secondChipComp = fix.componentInstance.chips.toArray()[1];

firstChipComp.elementRef.nativeElement.focus();
expect(document.activeElement).toBe(firstChipComp.elementRef.nativeElement);
firstChipComp.nativeElement.focus();
expect(document.activeElement).toBe(firstChipComp.nativeElement);

secondChipComp.elementRef.nativeElement.focus();
expect(document.activeElement).toBe(secondChipComp.elementRef.nativeElement);
secondChipComp.nativeElement.focus();
expect(document.activeElement).toBe(secondChipComp.nativeElement);
});

it('should focus on previous and next chips after arrows are pressed', () => {
Expand All @@ -211,22 +210,22 @@ describe('IgxChipsArea ', () => {
const firstChipComp = fix.componentInstance.chips.toArray()[0];
const secondChipComp = fix.componentInstance.chips.toArray()[1];

firstChipComp.elementRef.nativeElement.focus();
firstChipComp.nativeElement.focus();
fix.detectChanges();

expect(document.activeElement).toBe(firstChipComp.elementRef.nativeElement);
expect(document.activeElement).toBe(firstChipComp.nativeElement);

const rightKey = new KeyboardEvent('keydown', { key: 'ArrowRight' });
firstChipComp.onChipKeyDown(rightKey);
fix.detectChanges();

expect(document.activeElement).toBe(secondChipComp.elementRef.nativeElement);
expect(document.activeElement).toBe(secondChipComp.nativeElement);

const leftKey = new KeyboardEvent('keydown', { key: 'ArrowLeft' });
secondChipComp.onChipKeyDown(leftKey);
fix.detectChanges();

expect(document.activeElement).toBe(firstChipComp.elementRef.nativeElement);
expect(document.activeElement).toBe(firstChipComp.nativeElement);
});

it('should fire selectionChange event', () => {
Expand Down Expand Up @@ -328,17 +327,17 @@ describe('IgxChipsArea ', () => {
selectedChip.selected = true;
fix.detectChanges();

const selectedChipIconContainer = selectedChip.elementRef.nativeElement.children[0].children[0];
const unselectedChipIconContainer = unselectedChip.elementRef.nativeElement.children[0].children[0];
const selectedChipIconContainer = selectedChip.nativeElement.children[0].children[0];
const unselectedChipIconContainer = unselectedChip.nativeElement.children[0].children[0];
expect(selectedChip.selected).toBe(true);
expect(selectedChipIconContainer.children.length).toEqual(1);
expect(selectedChipIconContainer.children[0].tagName).toEqual('IGX-ICON');
// expect(selectedChip.elementRef.nativeElement.children[0].children[0].offsetWidth).not.toEqual(0);
expect(selectedChip.elementRef.nativeElement.children[0].children[0].className).toEqual(CHIP_SELECT_ICON);
expect(selectedChip.elementRef.nativeElement.children[0].children[0].className).not.toEqual(CHIP_SELECT_ICON_HIDDEN);
expect(selectedChip.nativeElement.children[0].children[0].className).toEqual(CHIP_SELECT_ICON);
expect(selectedChip.nativeElement.children[0].children[0].className).not.toEqual(CHIP_SELECT_ICON_HIDDEN);
expect(unselectedChipIconContainer.children.length).toEqual(1);
expect(unselectedChipIconContainer.children[0].tagName).toEqual('IGX-ICON');
expect(unselectedChip.elementRef.nativeElement.children[0].children[0].offsetWidth).toEqual(0);
expect(unselectedChip.nativeElement.children[0].children[0].offsetWidth).toEqual(0);
});

it('should fire only onSelection event for chip area when selecting a chip using spacebar', () => {
Expand Down Expand Up @@ -423,8 +422,8 @@ describe('IgxChipsArea ', () => {

it('should reorder chips when shift + leftarrow and shift + rightarrow is pressed', () => {
const chipComponents = fix.debugElement.queryAll(By.directive(IgxChipComponent));
const firstChipAreaElem = chipComponents[0].componentInstance.elementRef.nativeElement;
const secondChipAreaElem = chipComponents[1].componentInstance.elementRef.nativeElement;
const firstChipAreaElem = chipComponents[0].componentInstance.nativeElement;
const secondChipAreaElem = chipComponents[1].componentInstance.nativeElement;
const firstChipLeft = firstChipAreaElem.getBoundingClientRect().left;
const secondChipLeft = secondChipAreaElem.getBoundingClientRect().left;

Expand All @@ -451,7 +450,7 @@ describe('IgxChipsArea ', () => {
chipArea = fix.componentInstance.chipsArea;
const chipComponents = fix.debugElement.queryAll(By.directive(IgxChipComponent));
const targetChip = chipComponents[2].componentInstance;
const targetChipElem = targetChip.elementRef.nativeElement;
const targetChipElem = targetChip.nativeElement;

targetChipElem.focus();
fix.detectChanges();
Expand Down
Loading