conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
UnderlayContainer.modifyVisualizationArea(this.areaVisualization, s => s.visible = true)
G.infoEntityPanel.updateVisualization(this.m_Entity)
=======
UnderlayContainer.modifyVisualizationArea(this.areaVisualization, s => {
s.visible = true
})
>>>>>>>
G.infoEntityPanel.updateVisualization(this.m_Entity)
UnderlayContainer.modifyVisualizationArea(this.areaVisualization, s => {
s.visible = true
})
<<<<<<<
UnderlayContainer.modifyVisualizationArea(this.areaVisualization, s => s.visible = false)
G.infoEntityPanel.updateVisualization(undefined)
=======
UnderlayContainer.modifyVisualizationArea(this.areaVisualization, s => {
s.visible = false
})
>>>>>>>
G.infoEntityPanel.updateVisualization(undefined)
UnderlayContainer.modifyVisualizationArea(this.areaVisualization, s => {
s.visible = false
}) |
<<<<<<<
=======
/** Clear currently set filter */
public clearSlot(index: number = 0) {
this.m_Filters[index].name = undefined
this.m_Entity.filters = this.m_Filters
this.m_UpdateSlots()
this.emit('changed', false)
if (this.m_Amount) this.emit('selected', -1, 0)
}
/**
* Update filter count
* @param index - Index of filter
* @param count - New count
*/
public updateFilter(index: number, count: number) {
if (this.m_Filters[index].count === count) return
this.m_Filters[index].count = count
this.m_Entity.filters = this.m_Filters
this.emit('changed', false)
this.m_UpdateSlots()
}
/**
* Return filter count of specific filter
* @param index Index of filter
*/
public getFilterCount(index: number) {
return this.m_Filters[index].count
}
>>>>>>>
/**
* Update filter count
* @param index - Index of filter
* @param count - New count
*/
public updateFilter(index: number, count: number) {
if (this.m_Filters[index].count === count) return
this.m_Filters[index].count = count
this.m_Entity.filters = this.m_Filters
this.m_UpdateSlots()
}
/**
* Return filter count of specific filter
* @param index Index of filter
*/
public getFilterCount(index: number) {
return this.m_Filters[index].count
}
<<<<<<<
this.m_Filters[slotIndex] === undefined
? { index: slotIndex + 1, name: undefined }
: this.m_Filters[slotIndex]
=======
this.m_Filters[slotIndex] === undefined ?
{ index: slotIndex + 1, name: undefined, count: undefined } :
this.m_Filters[slotIndex]
>>>>>>>
this.m_Filters[slotIndex] === undefined
? { index: slotIndex + 1, name: undefined }
: this.m_Filters[slotIndex]
<<<<<<<
new InventoryContainer('Set the Filter', this.m_Entity.acceptedFilters, name => {
this.m_Filters[index].name = name
this.m_Entity.filters = this.m_Filters
})
.show()
=======
if (!this.m_Amount || this.m_Filters[index].name === undefined) {
const inventory: InventoryContainer = new InventoryContainer('Set the Filter', this.m_Entity.acceptedFilters, name => {
inventory.close()
this.m_Filters[index].name = name
if (this.m_Amount) this.m_Filters[index].count = FD.items[name].stack_size
this.m_Entity.filters = this.m_Filters
this.m_UpdateSlots()
this.emit('changed', true)
if (this.m_Amount) this.emit('selected', index, this.m_Filters[index].count)
})
inventory.show()
} else {
if (this.m_Amount) this.emit('selected', index, this.m_Filters[index].count)
}
>>>>>>>
if (!this.m_Amount || this.m_Filters[index].name === undefined) {
new InventoryContainer('Set the Filter', this.m_Entity.acceptedFilters, name => {
this.m_Filters[index].name = name
if (this.m_Amount) this.m_Filters[index].count = FD.items[name].stack_size
this.m_Entity.filters = this.m_Filters
if (this.m_Amount) this.emit('selected', index, this.m_Filters[index].count)
})
.show()
} else {
if (this.m_Amount) this.emit('selected', index, this.m_Filters[index].count)
}
<<<<<<<
this.m_Filters[index].name = undefined
this.m_Entity.filters = this.m_Filters
=======
this.clearSlot(index)
if (this.m_Amount) this.emit('selected', -1, 0)
>>>>>>>
this.m_Filters[index].name = undefined
this.m_Entity.filters = this.m_Filters
if (this.m_Amount) this.emit('selected', -1, 0) |
<<<<<<<
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keyup', { key: 'p' });
=======
for (let index = 0; index < filteredItemsInxs.length; index++) {
inputElement.triggerEventHandler('keydown', { key: 'p' });
>>>>>>>
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keydown', { key: 'p' });
<<<<<<<
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keyup', { key: 'l' });
=======
for (let index = 0; index < filteredItemsInxs.length; index++) {
inputElement.triggerEventHandler('keydown', { key: 'l' });
>>>>>>>
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keydown', { key: 'l' });
<<<<<<<
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keyup', { key: 'ü' });
=======
for (let index = 0; index < filteredItemsInxs.length; index++) {
inputElement.triggerEventHandler('keydown', { key: 'ü' });
>>>>>>>
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keydown', { key: 'ü' });
<<<<<<<
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keyup', { key: 'с' });
=======
for (let index = 0; index < filteredItemsInxs.length; index++) {
inputElement.triggerEventHandler('keydown', { key: 'с' });
>>>>>>>
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keydown', { key: 'с' });
<<<<<<<
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keyup', { key: 'p' });
=======
for (let index = 0; index < filteredItemsInxs.length; index++) {
inputElement.triggerEventHandler('keydown', { key: 'p' });
>>>>>>>
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keydown', { key: 'p' });
<<<<<<<
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keyup', { key: 'l' });
=======
for (let index = 0; index < filteredItemsInxs.length; index++) {
inputElement.triggerEventHandler('keydown', { key: 'l' });
>>>>>>>
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keydown', { key: 'l' });
<<<<<<<
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keyup', { key: 'ü' });
=======
for (let index = 0; index < filteredItemsInxs.length; index++) {
inputElement.triggerEventHandler('keydown', { key: 'ü' });
>>>>>>>
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keydown', { key: 'ü' });
<<<<<<<
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keyup', { key: 'с' });
=======
for (let index = 0; index < filteredItemsInxs.length; index++) {
inputElement.triggerEventHandler('keydown', { key: 'с' });
>>>>>>>
for (const item of filteredItemsInxs) {
inputElement.triggerEventHandler('keydown', { key: 'с' }); |
<<<<<<<
this.grid.nativeElement.focus({preventScroll: true});
firstCell = rowElement.querySelector(cellSelector);
firstCell.focus();
=======
this.grid.nativeElement.focus({ preventScroll: true });
firstCell = rowElement.querySelector(`${cellTag}`);
firstCell.focus({ preventScroll: true });
>>>>>>>
this.grid.nativeElement.focus({ preventScroll: true });
firstCell = rowElement.querySelector(cellSelector);
firstCell.focus({ preventScroll: true });
<<<<<<<
const allCells = rowElement.querySelectorAll(this.getCellSelector(-1, isSummary));
const lastCell = allCells[allCells.length - 1];
=======
>>>>>>>
<<<<<<<
const cellSelector = this.getCellSelector(visibleColumnIndex);
if (verticalScroll.scrollTop === verticalScroll.scrollHeight - this.grid.verticalScrollContainer.igxForContainerSize) {
=======
const cellSelector = this.isTreeGrid && visibleColumnIndex === 0 ? 'igx-tree-grid-cell' : 'igx-grid-cell';
if (verticalScroll.scrollHeight === 0 ||
verticalScroll.scrollTop === verticalScroll.scrollHeight - this.grid.verticalScrollContainer.igxForContainerSize) {
>>>>>>>
const cellSelector = this.getCellSelector(visibleColumnIndex);
if (verticalScroll.scrollHeight === 0 ||
verticalScroll.scrollTop === verticalScroll.scrollHeight - this.grid.verticalScrollContainer.igxForContainerSize) { |
<<<<<<<
IgxColumnHidingModule,
=======
IgxDragDropModule,
>>>>>>>
IgxColumnHidingModule,
IgxDragDropModule, |
<<<<<<<
link: "/gridGroupBy",
icon: "view_column",
name: "Grid GroupBy"
},
{
=======
link: "/gridColumnResizing",
icon: "view_column",
name: "Grid Column Resizing"
},
{
>>>>>>>
link: "/gridGroupBy",
icon: "view_column",
name: "Grid GroupBy"
},
{
link: "/gridColumnResizing",
icon: "view_column",
name: "Grid Column Resizing"
},
{ |
<<<<<<<
export class IgxNavbar {
private static NEXT_ID: number = 1;
=======
export class IgxNavbarComponent implements AfterContentChecked {
private static NEXT_ID = 1;
>>>>>>>
export class IgxNavbarComponent {
private static NEXT_ID = 1;
<<<<<<<
=======
private _titleId: string;
public ngAfterContentChecked(): void {
this._titleId = `igx-navbar-${IgxNavbarComponent.NEXT_ID++}`;
}
>>>>>>> |
<<<<<<<
export const ROW_ADD_KEYS = new Set(['+', 'add', '≠', '±', '=']);
export const SUPPORTED_KEYS = new Set([...Array.from(NAVIGATION_KEYS), ...Array.from(ROW_ADD_KEYS), 'enter', 'f2', 'escape', 'esc', 'pagedown', 'pageup']);
export const HEADER_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'escape', 'esc', 'l']);
=======
export const SUPPORTED_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'enter', 'f2', 'escape', 'esc', 'pagedown', 'pageup', '+', 'add']);
export const HEADER_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'escape', 'esc' , 'l',
/** This symbol corresponds to the Alt + L combination under MAC. */
'¬']);
>>>>>>>
export const ROW_ADD_KEYS = new Set(['+', 'add', '≠', '±', '=']);
export const SUPPORTED_KEYS = new Set([...Array.from(NAVIGATION_KEYS), ...Array.from(ROW_ADD_KEYS), 'enter', 'f2', 'escape', 'esc', 'pagedown', 'pageup']);
export const HEADER_KEYS = new Set([...Array.from(NAVIGATION_KEYS), 'escape', 'esc' , 'l',
/** This symbol corresponds to the Alt + L combination under MAC. */
'¬']); |
<<<<<<<
},
{
path: "grid",
component: GridSampleComponent
=======
},
{
path: "card",
component: IgxCardSampleComponent
},
{
path: "range",
component: IgxRangeSampleComponent
},
{
path: "data-operations",
component: DataOperationsSampleComponent
>>>>>>>
},
{
path: "grid",
component: GridSampleComponent
},
{
path: "card",
component: IgxCardSampleComponent
},
{
path: "range",
component: IgxRangeSampleComponent
},
{
path: "data-operations",
component: DataOperationsSampleComponent |
<<<<<<<
import { wait, UIInteractions } from '../../test-utils/ui-interactions.spec';
=======
import { wait } from '../../test-utils/ui-interactions.spec';
import { SortingDirection } from '../../data-operations/sorting-expression.interface';
import { DefaultSortingStrategy } from '../../data-operations/sorting-strategy';
>>>>>>>
import { wait, UIInteractions } from '../../test-utils/ui-interactions.spec';
import { SortingDirection } from '../../data-operations/sorting-expression.interface';
import { DefaultSortingStrategy } from '../../data-operations/sorting-strategy';
<<<<<<<
ColumnLayouHidingTestComponent,
ColumnLayoutResizingTestComponent
=======
ColumnLayouHidingTestComponent,
ColumnLayoutGroupingTestComponent
>>>>>>>
ColumnLayouHidingTestComponent,
ColumnLayoutGroupingTestComponent,
ColumnLayoutResizingTestComponent
<<<<<<<
=======
describe('GroupBy ', () => {
beforeEach(async(() => {
fixture = TestBed.createComponent(ColumnLayoutGroupingTestComponent);
fixture.detectChanges();
grid = fixture.componentInstance.grid;
colGroups = fixture.componentInstance.colGroups;
}));
it('should render rows correctly when grouped by a column and scrolling to bottom should not leave empty space.', async() => {
grid.height = '600px';
grid.groupBy({
dir: SortingDirection.Desc,
fieldName: 'Country',
ignoreCase: false,
strategy: DefaultSortingStrategy.instance()
});
fixture.detectChanges();
expect(grid.rowList.length).toEqual(8);
expect(grid.verticalScrollContainer.getVerticalScroll().children[0].offsetHeight -
grid.verticalScrollContainer.getVerticalScroll().offsetHeight).toBeGreaterThan(0);
const lastIndex = grid.data.length + grid.groupsRecords.length - 1;
grid.verticalScrollContainer.scrollTo(lastIndex);
await wait(100);
fixture.detectChanges();
const scrollTop = grid.verticalScrollContainer.getVerticalScroll().scrollTop;
const scrollHeight = grid.verticalScrollContainer.getVerticalScroll().scrollHeight;
const tbody = fixture.debugElement.query(By.css('.igx-grid__tbody')).nativeElement;
const scrolledToBottom = Math.round(scrollTop + tbody.scrollHeight) === scrollHeight;
expect(grid.rowList.length).toEqual(8);
expect(scrolledToBottom).toBeTruthy();
const lastRowOffset = grid.rowList.last.element.nativeElement.offsetTop +
grid.rowList.last.element.nativeElement.offsetHeight + parseInt(tbody.children[0].children[0].style.top, 10);
expect(lastRowOffset).toEqual(tbody.scrollHeight);
});
it('should render rows correctly and collapsing all should render all groups and there should be no scrollbar.', async() => {
grid.height = '600px';
grid.groupBy({
dir: SortingDirection.Desc,
fieldName: 'Country',
ignoreCase: false,
strategy: DefaultSortingStrategy.instance()
});
fixture.detectChanges();
expect(grid.rowList.length).toEqual(8);
expect(grid.verticalScrollContainer.getVerticalScroll().children[0].offsetHeight -
grid.verticalScrollContainer.getVerticalScroll().offsetHeight).toBeGreaterThan(0);
grid.toggleAllGroupRows();
await wait(100);
fixture.detectChanges();
expect(grid.rowList.length).toEqual(12);
expect(grid.verticalScrollContainer.getVerticalScroll().children[0].offsetHeight -
grid.verticalScrollContainer.getVerticalScroll().offsetHeight).toBeLessThanOrEqual(0);
});
});
});
>>>>>>>
describe('GroupBy ', () => {
beforeEach(async(() => {
fixture = TestBed.createComponent(ColumnLayoutGroupingTestComponent);
fixture.detectChanges();
grid = fixture.componentInstance.grid;
colGroups = fixture.componentInstance.colGroups;
}));
it('should render rows correctly when grouped by a column and scrolling to bottom should not leave empty space.', async() => {
grid.height = '600px';
grid.groupBy({
dir: SortingDirection.Desc,
fieldName: 'Country',
ignoreCase: false,
strategy: DefaultSortingStrategy.instance()
});
fixture.detectChanges();
expect(grid.rowList.length).toEqual(8);
expect(grid.verticalScrollContainer.getVerticalScroll().children[0].offsetHeight -
grid.verticalScrollContainer.getVerticalScroll().offsetHeight).toBeGreaterThan(0);
const lastIndex = grid.data.length + grid.groupsRecords.length - 1;
grid.verticalScrollContainer.scrollTo(lastIndex);
await wait(100);
fixture.detectChanges();
const scrollTop = grid.verticalScrollContainer.getVerticalScroll().scrollTop;
const scrollHeight = grid.verticalScrollContainer.getVerticalScroll().scrollHeight;
const tbody = fixture.debugElement.query(By.css('.igx-grid__tbody')).nativeElement;
const scrolledToBottom = Math.round(scrollTop + tbody.scrollHeight) === scrollHeight;
expect(grid.rowList.length).toEqual(8);
expect(scrolledToBottom).toBeTruthy();
const lastRowOffset = grid.rowList.last.element.nativeElement.offsetTop +
grid.rowList.last.element.nativeElement.offsetHeight + parseInt(tbody.children[0].children[0].style.top, 10);
expect(lastRowOffset).toEqual(tbody.scrollHeight);
});
it('should render rows correctly and collapsing all should render all groups and there should be no scrollbar.', async() => {
grid.height = '600px';
grid.groupBy({
dir: SortingDirection.Desc,
fieldName: 'Country',
ignoreCase: false,
strategy: DefaultSortingStrategy.instance()
});
fixture.detectChanges();
expect(grid.rowList.length).toEqual(8);
expect(grid.verticalScrollContainer.getVerticalScroll().children[0].offsetHeight -
grid.verticalScrollContainer.getVerticalScroll().offsetHeight).toBeGreaterThan(0);
grid.toggleAllGroupRows();
await wait(100);
fixture.detectChanges();
expect(grid.rowList.length).toEqual(12);
expect(grid.verticalScrollContainer.getVerticalScroll().children[0].offsetHeight -
grid.verticalScrollContainer.getVerticalScroll().offsetHeight).toBeLessThanOrEqual(0);
});
});
<<<<<<<
}
@Component({
template: `
<igx-grid #grid [data]="data" height="500px">
<igx-column-layout *ngFor='let group of colGroups'>
<igx-column *ngFor='let col of group.columns' [field]='col.field' [width]='col.width' [resizable]='col.resizable'
[rowStart]="col.rowStart" [colStart]="col.colStart" [colEnd]="col.colEnd" [rowEnd]="col.rowEnd">
</igx-column>
</igx-column-layout>
</igx-grid>
`
})
export class ColumnLayoutResizingTestComponent {
@ViewChild(IgxGridComponent, { read: IgxGridComponent })
grid: IgxGridComponent;
cols: Array<any> = [
{ field: 'ID', rowStart: 1, colStart: 1, resizable: true },
{ field: 'CompanyName', rowStart: 1, colStart: 2, resizable: true },
{ field: 'ContactName', rowStart: 1, colStart: 3, resizable: true },
{ field: 'ContactTitle', rowStart: 2, colStart: 1, rowEnd: 4, colEnd: 4, resizable: true },
];
colGroups = [
{
group: 'group1',
columns: this.cols
}
];
data = SampleTestData.contactInfoDataFull();
=======
}
@Component({
template: `
<igx-grid #grid [data]="data" height="500px" displayDensity="compact">
<igx-column-layout *ngFor='let group of colGroups' [field]='group.group' [pinned]='group.pinned'>
<igx-column *ngFor='let col of group.columns'
[rowStart]="col.rowStart" [colStart]="col.colStart" [width]='col.width'
[colEnd]="col.colEnd" [rowEnd]="col.rowEnd" [field]='col.field' [groupable]="col.groupable"></igx-column>
</igx-column-layout>
</igx-grid>
`
})
export class ColumnLayoutGroupingTestComponent extends ColumnLayoutPinningTestComponent {
cols1: Array<any> = [
{ field: 'ID', rowStart: 1, colStart: 1},
{ field: 'CompanyName', rowStart: 1, colStart: 2, groupable: true},
{ field: 'ContactName', rowStart: 1, colStart: 3, groupable: true},
{ field: 'ContactTitle', rowStart: 2, colStart: 1, rowEnd: 4, colEnd : 4, groupable: true},
];
cols2: Array<any> = [
{ field: 'PostalCode', rowStart: 1, colStart: 1, colEnd: 3 },
{ field: 'City', rowStart: 2, colStart: 1, groupable: true},
{ field: 'Country', rowStart: 2, colStart: 2, groupable: true},
{ field: 'Address', rowStart: 3, colStart: 1, colEnd: 3}
];
>>>>>>>
}
@Component({
template: `
<igx-grid #grid [data]="data" height="500px" displayDensity="compact">
<igx-column-layout *ngFor='let group of colGroups' [field]='group.group' [pinned]='group.pinned'>
<igx-column *ngFor='let col of group.columns'
[rowStart]="col.rowStart" [colStart]="col.colStart" [width]='col.width'
[colEnd]="col.colEnd" [rowEnd]="col.rowEnd" [field]='col.field' [groupable]="col.groupable"></igx-column>
</igx-column-layout>
</igx-grid>
`
})
export class ColumnLayoutGroupingTestComponent extends ColumnLayoutPinningTestComponent {
cols1: Array<any> = [
{ field: 'ID', rowStart: 1, colStart: 1},
{ field: 'CompanyName', rowStart: 1, colStart: 2, groupable: true},
{ field: 'ContactName', rowStart: 1, colStart: 3, groupable: true},
{ field: 'ContactTitle', rowStart: 2, colStart: 1, rowEnd: 4, colEnd : 4, groupable: true},
];
cols2: Array<any> = [
{ field: 'PostalCode', rowStart: 1, colStart: 1, colEnd: 3 },
{ field: 'City', rowStart: 2, colStart: 1, groupable: true},
{ field: 'Country', rowStart: 2, colStart: 2, groupable: true},
{ field: 'Address', rowStart: 3, colStart: 1, colEnd: 3}
];
}
@Component({
template: `
<igx-grid #grid [data]="data" height="500px">
<igx-column-layout *ngFor='let group of colGroups'>
<igx-column *ngFor='let col of group.columns' [field]='col.field' [width]='col.width' [resizable]='col.resizable'
[rowStart]="col.rowStart" [colStart]="col.colStart" [colEnd]="col.colEnd" [rowEnd]="col.rowEnd">
</igx-column>
</igx-column-layout>
</igx-grid>
`
})
export class ColumnLayoutResizingTestComponent {
@ViewChild(IgxGridComponent, { read: IgxGridComponent })
grid: IgxGridComponent;
cols: Array<any> = [
{ field: 'ID', rowStart: 1, colStart: 1, resizable: true },
{ field: 'CompanyName', rowStart: 1, colStart: 2, resizable: true },
{ field: 'ContactName', rowStart: 1, colStart: 3, resizable: true },
{ field: 'ContactTitle', rowStart: 2, colStart: 1, rowEnd: 4, colEnd: 4, resizable: true },
];
colGroups = [
{
group: 'group1',
columns: this.cols
}
];
data = SampleTestData.contactInfoDataFull(); |
<<<<<<<
import { Subject } from 'rxjs';
import { isEdge } from '../../core/utils';
=======
>>>>>>>
import { Subject } from 'rxjs';
<<<<<<<
this.grid.transactions.getAggregatedValue(this.id, true) : this.grid.gridAPI.getRowData(this.id);
=======
this.grid.transactions.getAggregatedValue(this.id, true) : this.grid.gridAPI.getRowData(this.id);
const rowData = updatedData === null ? this.grid.gridAPI.getRowData(this.id) : updatedData;
>>>>>>>
this.grid.transactions.getAggregatedValue(this.id, true) : this.grid.gridAPI.getRowData(this.id);
const rowData = updatedData === null ? this.grid.gridAPI.getRowData(this.id) : updatedData; |
<<<<<<<
import { UIInteractions, wait } from '../test-utils/ui-interactions.spec';
=======
import { UIInteractions} from '../test-utils/ui-interactions.spec';
>>>>>>>
import { UIInteractions, wait } from '../test-utils/ui-interactions.spec';
<<<<<<<
=======
>>>>>>>
<<<<<<<
fix.detectChanges();
expect(targetCell.focused).toEqual(true);
const targetCellDebugElement = fix.debugElement.query(By.css('.igx-grid__td--selected'));
UIInteractions.triggerKeyDownEvtUponElem('arrowdown', targetCellElement, true);
await wait(30);
fix.detectChanges();
const newLastRow = grid.rowList.last.rowID;
expect(grid.getCellByColumn(newLastRow, 'Column1').value === initialValue).toBeFalsy();
expect(grid.getCellByColumn(newLastRow, 'Column1').focused).toEqual(true);
expect(grid.getCellByColumn(newLastRow, 'Column1').selected).toEqual(true);
expect(grid.getCellByColumn(newLastRow, 'Column1').nativeElement.class).toContain('igx-grid__td--selected');
expect(grid.getCellByColumn(targetCellPrimaryKey, 'Column1').focused).toEqual(false);
expect(grid.selectedCells.length).toEqual(1);
=======
fix.whenStable().then(() => {
fix.detectChanges();
expect(targetCell.focused).toEqual(true);
const targetCellDebugElement = fix.debugElement.query(By.css('.igx-grid__td--selected'));
UIInteractions.simulateKeyDownEvent(targetCellElement, 'ArrowDown').then(() => {
setTimeout(() => {
fix.whenStable().then(() => {
fix.detectChanges();
const newLastRow = grid.rowList.last.rowID;
expect(grid.getCellByColumn(newLastRow, 'Column1').value === initialValue).toBeFalsy();
expect(grid.getCellByColumn(newLastRow, 'Column1').focused).toEqual(true);
expect(grid.getCellByColumn(newLastRow, 'Column1').selected).toEqual(true);
expect(grid.getCellByColumn(newLastRow, 'Column1').nativeElement.class).toContain('igx-grid__td--selected');
expect(grid.getCellByColumn(targetCellPrimaryKey, 'Column1').focused).toEqual(false);
expect(grid.selectedCells.length).toEqual(1);
});
}, 100);
});
});
>>>>>>>
fix.detectChanges();
expect(targetCell.focused).toEqual(true);
const targetCellDebugElement = fix.debugElement.query(By.css('.igx-grid__td--selected'));
UIInteractions.triggerKeyDownEvtUponElem('arrowdown', targetCellElement, true);
await wait(30);
fix.detectChanges();
const newLastRow = grid.rowList.last.rowID;
expect(grid.getCellByColumn(newLastRow, 'Column1').value === initialValue).toBeFalsy();
expect(grid.getCellByColumn(newLastRow, 'Column1').focused).toEqual(true);
expect(grid.getCellByColumn(newLastRow, 'Column1').selected).toEqual(true);
expect(grid.getCellByColumn(newLastRow, 'Column1').nativeElement.class).toContain('igx-grid__td--selected');
expect(grid.getCellByColumn(targetCellPrimaryKey, 'Column1').focused).toEqual(false);
expect(grid.selectedCells.length).toEqual(1); |
<<<<<<<
startTime = new Date()
const numOfIteration = this.looper.loopCount === -1 ? '' : `of ${this.looper.loopCount}`
console.log(`${chalk.bold('\u25CC')} ${iterationName} ${numOfIteration}`)
=======
>>>>>>> |
<<<<<<<
@HostListener('keydown.pagedown', ['$event'])
public onKeydownPageDown(event) {
event.preventDefault();
this.verticalScrollContainer.scrollNextPage();
this.nativeElement.focus();
}
@HostListener('keydown.pageup', ['$event'])
public onKeydownPageUp(event) {
event.preventDefault();
this.verticalScrollContainer.scrollPrevPage();
this.nativeElement.focus();
}
@HostListener('keydown.arrowdown', ['$event'])
public onKeydownArrowDown(event) {
event.preventDefault();
this.verticalScrollContainer.scrollNext();
}
@HostListener('keydown.arrowup', ['$event'])
public onKeydownArrowUp(event) {
event.preventDefault();
this.verticalScrollContainer.scrollPrev();
}
@HostListener('keydown.arrowleft', ['$event'])
public onKeydownArrowLeft(event) {
event.preventDefault();
const horVirtScroll = this.parentVirtDir.getHorizontalScroll();
horVirtScroll.scrollLeft -= MINIMUM_COLUMN_WIDTH;
}
@HostListener('keydown.arrowright', ['$event'])
public onKeydownArrowRight(event) {
event.preventDefault();
const horVirtScroll = this.parentVirtDir.getHorizontalScroll();
horVirtScroll.scrollLeft += MINIMUM_COLUMN_WIDTH;
}
=======
public onChipRemoved(event) {
this.clearGrouping(event.owner.id);
}
public chipsOrderChanged(event) {
const newGrouping = [];
for (let i = 0; i < event.chipsArray.length; i++) {
const expr = this.groupingExpressions.filter((item) => {
return item.fieldName === event.chipsArray[i].id;
})[0];
if (!this.getColumnByName(expr.fieldName).groupable) {
// disallow changing order if there are columns with groupable: false
event.isValid = false;
return;
}
newGrouping.push(expr);
}
this.groupingExpansionState = [];
this.chipsGoupingExpressions = newGrouping;
event.isValid = true;
this.markForCheck();
}
public chipsMovingEnded() {
this.groupingExpressions = this.chipsGoupingExpressions;
this.markForCheck();
}
public onChipClicked(event) {
const sortingExpr = this.sortingExpressions;
const columnExpr = sortingExpr.find((expr) => expr.fieldName === event.owner.id);
columnExpr.dir = 3 - columnExpr.dir;
this.sort(columnExpr);
this.markForCheck();
}
public onChipKeyDown(event) {
if (event.key === ' ' || event.key === 'Spacebar' || event.key === 'Enter') {
const sortingExpr = this.sortingExpressions;
const columnExpr = sortingExpr.find((expr) => expr.fieldName === event.owner.id);
columnExpr.dir = 3 - columnExpr.dir;
this.sort(columnExpr);
this.markForCheck();
}
}
>>>>>>>
@HostListener('keydown.pagedown', ['$event'])
public onKeydownPageDown(event) {
event.preventDefault();
this.verticalScrollContainer.scrollNextPage();
this.nativeElement.focus();
}
@HostListener('keydown.pageup', ['$event'])
public onKeydownPageUp(event) {
event.preventDefault();
this.verticalScrollContainer.scrollPrevPage();
this.nativeElement.focus();
}
@HostListener('keydown.arrowdown', ['$event'])
public onKeydownArrowDown(event) {
event.preventDefault();
this.verticalScrollContainer.scrollNext();
}
@HostListener('keydown.arrowup', ['$event'])
public onKeydownArrowUp(event) {
event.preventDefault();
this.verticalScrollContainer.scrollPrev();
}
@HostListener('keydown.arrowleft', ['$event'])
public onKeydownArrowLeft(event) {
event.preventDefault();
const horVirtScroll = this.parentVirtDir.getHorizontalScroll();
horVirtScroll.scrollLeft -= MINIMUM_COLUMN_WIDTH;
}
@HostListener('keydown.arrowright', ['$event'])
public onKeydownArrowRight(event) {
event.preventDefault();
const horVirtScroll = this.parentVirtDir.getHorizontalScroll();
horVirtScroll.scrollLeft += MINIMUM_COLUMN_WIDTH;
}
public onChipRemoved(event) {
this.clearGrouping(event.owner.id);
}
public chipsOrderChanged(event) {
const newGrouping = [];
for (let i = 0; i < event.chipsArray.length; i++) {
const expr = this.groupingExpressions.filter((item) => {
return item.fieldName === event.chipsArray[i].id;
})[0];
if (!this.getColumnByName(expr.fieldName).groupable) {
// disallow changing order if there are columns with groupable: false
event.isValid = false;
return;
}
newGrouping.push(expr);
}
this.groupingExpansionState = [];
this.chipsGoupingExpressions = newGrouping;
event.isValid = true;
this.markForCheck();
}
public chipsMovingEnded() {
this.groupingExpressions = this.chipsGoupingExpressions;
this.markForCheck();
}
public onChipClicked(event) {
const sortingExpr = this.sortingExpressions;
const columnExpr = sortingExpr.find((expr) => expr.fieldName === event.owner.id);
columnExpr.dir = 3 - columnExpr.dir;
this.sort(columnExpr);
this.markForCheck();
}
public onChipKeyDown(event) {
if (event.key === ' ' || event.key === 'Spacebar' || event.key === 'Enter') {
const sortingExpr = this.sortingExpressions;
const columnExpr = sortingExpr.find((expr) => expr.fieldName === event.owner.id);
columnExpr.dir = 3 - columnExpr.dir;
this.sort(columnExpr);
this.markForCheck();
}
} |
<<<<<<<
public static restoreGroups(groupData: IGroupByResult, state: IGroupingState): any[] {
=======
public static restoreGroups<T>(data: T[], state: IGroupingState, groupsRecords: any[] = []): T[] {
>>>>>>>
public static restoreGroups(groupData: IGroupByResult, state: IGroupingState, groupsRecords: any[] = []): any[] {
<<<<<<<
return this.restoreGroupsRecursive(groupData, 1, state.expressions.length, state.expansion, state.defaultExpanded);
=======
return this.restoreGroupsRecursive(data, 1, state.expressions.length, state.expansion, state.defaultExpanded, groupsRecords);
>>>>>>>
return this.restoreGroupsRecursive(groupData, 1, state.expressions.length, state.expansion, state.defaultExpanded, groupsRecords);
<<<<<<<
groupData: IGroupByResult, level: number, depth: number,
expansion: IGroupByExpandState[], defaultExpanded: boolean): any[] {
=======
data: any[], level: number, depth: number,
expansion: IGroupByExpandState[], defaultExpanded: boolean, groupsRecords): any[] {
>>>>>>>
groupData: IGroupByResult, level: number, depth: number,
expansion: IGroupByExpandState[], defaultExpanded: boolean, groupsRecords): any[] {
<<<<<<<
groupData.data = this.restoreGroupsRecursive(groupData, level + 1, depth, expansion, defaultExpanded);
}
while (i < groupData.data.length) {
const g = level === depth ? groupData.metadata[i] :
groupData.data[i].groupParent;
for (j = i + 1; j < groupData.data.length; j++) {
const h = level === depth ? groupData.metadata[j] :
groupData.data[j].groupParent;
if (h && g !== h && g.level === h.level) {
=======
data = this.restoreGroupsRecursive(data, level + 1, depth, expansion, defaultExpanded, groupsRecords);
}
while (i < data.length) {
const g = data[i]['__groupParent'];
for (j = i + 1; j < data.length; j++) {
const h = data[j]['__groupParent'];
if (g !== h && g.level === h.level) {
>>>>>>>
groupData.data = this.restoreGroupsRecursive(groupData, level + 1, depth, expansion, defaultExpanded, groupsRecords);
}
while (i < groupData.data.length) {
const g = level === depth ? groupData.metadata[i] :
groupData.data[i].groupParent;
for (j = i + 1; j < groupData.data.length; j++) {
const h = level === depth ? groupData.metadata[j] :
groupData.data[j].groupParent;
if (h && g !== h && g.level === h.level) { |
<<<<<<<
import { CancelableEventArgs } from '../core/utils';
=======
import { configureTestSuite } from '../test-utils/configure-suite';
>>>>>>>
import { CancelableEventArgs } from '../core/utils';
import { configureTestSuite } from '../test-utils/configure-suite'; |
<<<<<<<
@Input()
public remoteVirtualization: boolean;
=======
@Input()
public primaryKey;
>>>>>>>
@Input()
public remoteVirtualization: boolean;
public primaryKey; |
<<<<<<<
export * from './lib/grids/hierarchical-grid/hierarchical-grid.pipes';
export * from './lib/icon/index';
export * from './lib/input-group/index';
export * from './lib/list/index';
export * from './lib/expansion-panel/index';
=======
export * from './lib/icon/public_api';
export * from './lib/input-group/public_api';
export * from './lib/list/public_api';
export * from './lib/expansion-panel/public_api';
>>>>>>>
export * from './lib/grids/hierarchical-grid/hierarchical-grid.pipes';
export * from './lib/icon/public_api';
export * from './lib/input-group/public_api';
export * from './lib/list/public_api';
export * from './lib/expansion-panel/public_api'; |
<<<<<<<
=======
OnChanges,
SimpleChanges,
HostListener
>>>>>>>
HostListener |
<<<<<<<
import { IgxTreeGridComponent, IgxHierarchicalTransactionService, IgxGridTransaction } from 'igniteui-angular';
=======
import { IgxTreeGridComponent, IgxExcelExporterService, IgxCsvExporterService,
IgxExcelExporterOptions, IgxCsvExporterOptions, CsvFileTypes } from 'igniteui-angular';
>>>>>>>
import {
CsvFileTypes,
IgxCsvExporterOptions,
IgxCsvExporterService,
IgxExcelExporterOptions,
IgxExcelExporterService,
IgxGridTransaction,
IgxHierarchicalTransactionService,
IgxTreeGridComponent,
} from 'igniteui-angular';
<<<<<<<
public undo() {
this.grid1.transactions.undo();
}
public redo() {
this.grid1.transactions.redo();
}
public commit() {
this.grid1.transactions.commit(this.data);
}
=======
public exportToExcel() {
this.excelExporterService.export(this.grid1, new IgxExcelExporterOptions('TreeGrid'));
}
public exportToCSV() {
this.csvExporterService.export(this.grid1, new IgxCsvExporterOptions('TreeGrid', CsvFileTypes.CSV));
}
>>>>>>>
public undo() {
this.grid1.transactions.undo();
}
public redo() {
this.grid1.transactions.redo();
}
public commit() {
this.grid1.transactions.commit(this.data);
}
public exportToExcel() {
this.excelExporterService.export(this.grid1, new IgxExcelExporterOptions('TreeGrid'));
}
public exportToCSV() {
this.csvExporterService.export(this.grid1, new IgxCsvExporterOptions('TreeGrid', CsvFileTypes.CSV));
} |
<<<<<<<
it('Should clear search criteria when selecting clear column filters option.', fakeAsync(() => {
GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'ProductName');
let checkboxes = GridFunctions.getExcelStyleFilteringCheckboxes(fix);
fix.detectChanges();
checkboxes[0].click();
tick();
fix.detectChanges();
checkboxes[2].click();
tick();
fix.detectChanges();
GridFunctions.clickApplyExcelStyleFiltering(fix);
tick();
fix.detectChanges();
expect(grid.filteredData.length).toEqual(1);
GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'ProductName');
flush();
let inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
UIInteractions.clickAndSendInputElementValue(inputNativeElement, 'Net', fix);
const listItems = GridFunctions.getExcelStyleSearchComponentListItems(fix);
expect(listItems.length).toBe(3, 'incorrect rendered list items count');
GridFunctions.clickClearFilterInExcelStyleFiltering(fix);
flush();
expect(grid.filteredData).toBeNull();
inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
expect(inputNativeElement.value).toBe('', 'search criteria is not cleared');
checkboxes = GridFunctions.getExcelStyleFilteringCheckboxes(fix);
const listItemsCheckboxes = checkboxes.slice(1, checkboxes.length);
for (const checkbox of listItemsCheckboxes) {
ControlsFunction.verifyCheckboxState(checkbox.parentElement);
}
}));
});
=======
it('Should clear input if there is text and \'Escape\' is pressed.', fakeAsync(() => {
// Open excel style filtering dialog.
GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'Downloads');
let inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
let excelMenu = GridFunctions.getExcelStyleFilteringComponent(fix);
// Verify ESF is visible.
expect(excelMenu).not.toBeNull();
// Verify that the dialog is closed on pressing Escape.
inputNativeElement.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
excelMenu = GridFunctions.getExcelStyleFilteringComponent(fix);
expect(excelMenu).toBeNull();
// Open excel style filtering dialog again and type in the input.
GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'Downloads');
inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
UIInteractions.clickAndSendInputElementValue(inputNativeElement, '2', fix);
// Press Escape again and verify that ESF menu is still visible and the input is empty
inputNativeElement.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
fix.detectChanges();
flush();
excelMenu = GridFunctions.getExcelStyleFilteringComponent(fix);
expect(excelMenu).not.toBeNull();
expect(inputNativeElement.value).toBe('', 'input isn\'t cleared correctly');
}));
});
>>>>>>>
it('Should clear input if there is text and \'Escape\' is pressed.', fakeAsync(() => {
// Open excel style filtering dialog.
GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'Downloads');
let inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
let excelMenu = GridFunctions.getExcelStyleFilteringComponent(fix);
// Verify ESF is visible.
expect(excelMenu).not.toBeNull();
// Verify that the dialog is closed on pressing Escape.
inputNativeElement.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
excelMenu = GridFunctions.getExcelStyleFilteringComponent(fix);
expect(excelMenu).toBeNull();
// Open excel style filtering dialog again and type in the input.
GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'Downloads');
inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
UIInteractions.clickAndSendInputElementValue(inputNativeElement, '2', fix);
// Press Escape again and verify that ESF menu is still visible and the input is empty
inputNativeElement.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true }));
inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
fix.detectChanges();
flush();
excelMenu = GridFunctions.getExcelStyleFilteringComponent(fix);
expect(excelMenu).not.toBeNull();
expect(inputNativeElement.value).toBe('', 'input isn\'t cleared correctly');
}));
it('Should clear search criteria when selecting clear column filters option.', fakeAsync(() => {
GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'ProductName');
let checkboxes = GridFunctions.getExcelStyleFilteringCheckboxes(fix);
fix.detectChanges();
checkboxes[0].click();
tick();
fix.detectChanges();
checkboxes[2].click();
tick();
fix.detectChanges();
GridFunctions.clickApplyExcelStyleFiltering(fix);
tick();
fix.detectChanges();
expect(grid.filteredData.length).toEqual(1);
GridFunctions.clickExcelFilterIconFromCode(fix, grid, 'ProductName');
flush();
let inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
UIInteractions.clickAndSendInputElementValue(inputNativeElement, 'Net', fix);
const listItems = GridFunctions.getExcelStyleSearchComponentListItems(fix);
expect(listItems.length).toBe(3, 'incorrect rendered list items count');
GridFunctions.clickClearFilterInExcelStyleFiltering(fix);
flush();
expect(grid.filteredData).toBeNull();
inputNativeElement = GridFunctions.getExcelStyleSearchComponentInput(fix);
expect(inputNativeElement.value).toBe('', 'search criteria is not cleared');
checkboxes = GridFunctions.getExcelStyleFilteringCheckboxes(fix);
const listItemsCheckboxes = checkboxes.slice(1, checkboxes.length);
for (const checkbox of listItemsCheckboxes) {
ControlsFunction.verifyCheckboxState(checkbox.parentElement);
}
}));
}); |
<<<<<<<
import { IgxTreeGridNavigationService } from './tree-grid-navigation.service';
=======
import { IgxSummaryResult } from '../summaries/grid-summary';
import { IgxGridSummaryService } from '../summaries/grid-summary.service';
>>>>>>>
import { IgxTreeGridNavigationService } from './tree-grid-navigation.service';
import { IgxSummaryResult } from '../summaries/grid-summary';
import { IgxGridSummaryService } from '../summaries/grid-summary.service';
<<<<<<<
providers: [ IgxTreeGridNavigationService, { provide: GridBaseAPIService, useClass: IgxTreeGridAPIService },
=======
providers: [IgxGridNavigationService, IgxGridSummaryService, { provide: GridBaseAPIService, useClass: IgxTreeGridAPIService },
>>>>>>>
providers: [ IgxTreeGridNavigationService, IgxGridSummaryService, { provide: GridBaseAPIService, useClass: IgxTreeGridAPIService },
<<<<<<<
public ngOnInit() {
this._gridAPI.register(this);
super.ngOnInit();
}
/**
* @hidden
* Returns if the `IgxTreeGridComponent` has summarized columns.
* ```typescript
* const summarizedGrid = this.grid.hasSummarizedColumns;
* ```
* @memberof IgxTreeGridComponent
*/
get hasSummarizedColumns(): boolean {
return false;
}
=======
>>>>>>>
<<<<<<<
/**
* @hidden
*/
protected calcMaxSummaryHeight() {
return 0;
}
=======
/** @hidden */
protected deleteRowFromData(rowID: any, index: number) {
if (this.primaryKey && this.foreignKey) {
super.deleteRowFromData(rowID, index);
if (this.cascadeOnDelete) {
const treeRecord = this.records.get(rowID);
if (treeRecord && treeRecord.children && treeRecord.children.length > 0) {
for (let i = 0; i < treeRecord.children.length; i++) {
const child = treeRecord.children[i];
super.deleteRowById(child.rowID);
}
}
}
} else {
const record = this.records.get(rowID);
const collection = record.parent ? record.parent.data[this.childDataKey] : this.data;
index = this.primaryKey ?
collection.map(c => c[this.primaryKey]).indexOf(rowID) :
collection.indexOf(rowID);
const selectedChildren = [];
this._gridAPI.get_selected_children(this.id, record, selectedChildren);
if (selectedChildren.length > 0) {
this.deselectRows(selectedChildren);
}
if (this.transactions.enabled) {
const path = this.generateRowPath(rowID);
this.transactions.add({
id: rowID,
type: TransactionType.DELETE,
newValue: null,
path: path
},
collection[index]
);
} else {
collection.splice(index, 1);
}
}
}
/** @hidden */
public generateRowPath(rowId: any): any[] {
const path: any[] = [];
let record = this.records.get(rowId);
>>>>>>>
/**
* @hidden
*/
protected calcMaxSummaryHeight() {
return 0;
}
/** @hidden */
public generateRowPath(rowId: any): any[] {
const path: any[] = [];
let record = this.records.get(rowId);
<<<<<<<
/**
* @hidden
*/
public get template(): TemplateRef<any> {
if (this.filteredData && this.filteredData.length === 0) {
return this.emptyGridTemplate ? this.emptyGridTemplate : this.emptyFilteredGridTemplate;
}
if (this.dataLength === 0) {
return this.emptyGridTemplate ? this.emptyGridTemplate : this.emptyGridDefaultTemplate;
}
}
protected writeToData(rowIndex: number, value: any) {
mergeObjects(this.flatData[rowIndex], value);
}
=======
>>>>>>>
/**
* @hidden
*/
public get template(): TemplateRef<any> {
if (this.filteredData && this.filteredData.length === 0) {
return this.emptyGridTemplate ? this.emptyGridTemplate : this.emptyFilteredGridTemplate;
}
if (this.dataLength === 0) {
return this.emptyGridTemplate ? this.emptyGridTemplate : this.emptyGridDefaultTemplate;
}
}
protected writeToData(rowIndex: number, value: any) {
mergeObjects(this.flatData[rowIndex], value);
} |
<<<<<<<
[removable]="true" [selectable]="true" (remove)="chipRemoved($event)">
<igx-icon igxPrefix fontSet="material">drag_indicator</igx-icon>
=======
[removable]="true" [selectable]="true" (onRemove)="chipRemoved($event)">
<igx-icon igxPrefix>drag_indicator</igx-icon>
>>>>>>>
[removable]="true" [selectable]="true" (remove)="chipRemoved($event)">
<igx-icon igxPrefix>drag_indicator</igx-icon> |
<<<<<<<
private _render(camera: Camera, renderTarget: BaseRenderTarget | null, material: Material | null) {
=======
private _render(camera: Camera, renderTarget: BaseRenderTexture | null, material?: Material) {
>>>>>>>
private _render(camera: Camera, renderTarget: BaseRenderTexture | null, material: Material | null) { |
<<<<<<<
=======
grid.onFilteringDone.emit(this.column.filteringExpressionsTree);
>>>>>>>
grid.onFilteringDone.emit(this.column.filteringExpressionsTree);
<<<<<<<
grid.onFilteringDone.emit({
fieldName: this.column.field,
condition: filterExpression.expression.condition,
ignoreCase: this.column.filteringIgnoreCase,
searchVal: filterExpression.expression.searchVal
});
=======
grid.onFilteringDone.emit(this.column.filteringExpressionsTree);
>>>>>>>
grid.onFilteringDone.emit(this.column.filteringExpressionsTree); |
<<<<<<<
/**
* @hidden
*/
@Input()
@HostBinding('class.igx-grid__td--active')
public active: boolean;
=======
@HostBinding('attr.aria-selected')
get ariaSelected() {
return this.selected || this.column.selected || this.row.selected;
}
>>>>>>>
/**
* @hidden
*/
@Input()
@HostBinding('class.igx-grid__td--active')
public active: boolean;
@HostBinding('attr.aria-selected')
get ariaSelected() {
return this.selected || this.column.selected || this.row.selected;
} |
<<<<<<<
/**
* Sets/gets the highlight class of the cell.
* Default value is `"igx-highlight"`.
* ```typescript
* let highlightClass = this.cell.highlightClass;
* ```
* ```typescript
* this.cell.highlightClass = 'igx-cell-highlight';
* ```
* @memberof IgxGridCellComponent
*/
=======
private get isFirstCell(): boolean {
return this.columnIndex === 0 || (this.isPinned && this.visibleColumnIndex === 0);
}
private get isLastCell(): boolean {
return this.columnIndex === this.grid.columns.length - 1;
}
>>>>>>>
private get isFirstCell(): boolean {
return this.columnIndex === 0 || (this.isPinned && this.visibleColumnIndex === 0);
}
private get isLastCell(): boolean {
return this.columnIndex === this.grid.columns.length - 1;
}
/**
* Sets/gets the highlight class of the cell.
* Default value is `"igx-highlight"`.
* ```typescript
* let highlightClass = this.cell.highlightClass;
* ```
* ```typescript
* this.cell.highlightClass = 'igx-cell-highlight';
* ```
* @memberof IgxGridCellComponent
*/ |
<<<<<<<
public highlight(text: string, caseSensitive?: boolean, exactMatch?: boolean): number {
=======
/**
* Clears the existing highlight and highlights the searched text.
* Returns how many times the element contains the searched text.
*/
public highlight(text: string, caseSensitive?: boolean): number {
>>>>>>>
/**
* Clears the existing highlight and highlights the searched text.
* Returns how many times the element contains the searched text.
*/
public highlight(text: string, caseSensitive?: boolean, exactMatch?: boolean): number { |
<<<<<<<
export * from "./view/containerView";
export * from "./view/deploymentView";
export * from "./view/elementView";
export * from "./view/relationshipView";
export * from "./view/staticView";
export * from "./view/styles";
export * from "./view/systemContextView";
export * from "./view/view";
export * from "./view/viewConfiguration";
export * from "./view/viewSet";
export * from "./documentation/documentation";
export * from "./documentation/format";
export * from "./documentation/section";
export * from "./documentation/decision";
export * from "./documentation/decisionStatus";
=======
export * from './view/containerView';
export * from './view/deploymentView';
export * from './view/elementView';
export * from './view/relationshipView';
export * from './view/staticView';
export * from './view/styles';
export * from './view/systemContextView';
export * from './view/view';
export * from './view/viewConfiguration';
export * from './view/viewSet';
export * from "./view/automaticLayout";
export * from "./view/rankDirection";
>>>>>>>
export * from "./view/automaticLayout";
export * from "./view/containerView";
export * from "./view/deploymentView";
export * from "./view/elementView";
export * from "./view/rankDirection";
export * from "./view/relationshipView";
export * from "./view/staticView";
export * from "./view/styles";
export * from "./view/systemContextView";
export * from "./view/view";
export * from "./view/viewConfiguration";
export * from "./view/viewSet";
export * from "./documentation/documentation";
export * from "./documentation/format";
export * from "./documentation/section";
export * from "./documentation/decision";
export * from "./documentation/decisionStatus"; |
<<<<<<<
import * as PgPromise from 'pg-promise'
import { mapValues } from 'lodash'
const pgp = PgPromise()
export class Database {
private db
constructor(connectionString: string) {
this.db = pgp(connectionString)
}
public async getDBSchema(tableName: string) {
let schema = {}
await this.db.each(
`SELECT column_name, udt_name
FROM information_schema.columns
WHERE table_name = $1`,
[tableName],
schemaItem => {
schema[schemaItem.column_name] = schemaItem.udt_name
})
return schema
}
public async getTableTypes(tableName: string) {
return this.mapDBSchemaToType(await this.getDBSchema(tableName))
}
public async getDBSchemaTables(schemaName: string): Promise<{table_name: string}[]> {
return await this.db.each(
`SELECT table_name
FROM information_schema.columns
WHERE table_schema = $1
GROUP BY table_name`,
[schemaName],
schemaItem => schemaItem.table_name
)
}
private mapDBSchemaToType(schema: Object) {
return mapValues(schema, udtName => {
switch (udtName) {
case 'varchar':
case 'text':
return 'string'
case 'int2':
case 'int4':
case 'int8':
case 'float8':
return 'number'
case 'bool':
return 'boolean'
case 'json':
return 'Object'
case 'date':
case 'timestamp':
return 'Date'
case '_float8':
return 'Array<number>'
case '_text':
return 'Array<string>'
default:
throw new TypeError(`do not know how to convert type [${udtName}]`)
}
})
}
}
=======
import * as PgPromise from 'pg-promise'
import { mapValues } from 'lodash'
const pgp = PgPromise()
export class Database {
private db
constructor(connectionString: string) {
this.db = pgp(connectionString)
}
public async getDBSchema(tableName: string) {
let schema = {}
await this.db.each(
`SELECT column_name, udt_name
FROM information_schema.columns
WHERE table_name = $1`,
tableName, schemaItem => {
schema[schemaItem.column_name] = schemaItem.udt_name
})
return schema
}
public async getTableTypes(tableName: string) {
return this.mapDBSchemaToType(await this.getDBSchema(tableName))
}
private mapDBSchemaToType(schema: Object) {
return mapValues(schema, udtName => {
switch (udtName) {
case 'varchar':
case 'text':
case 'uuid':
return 'string'
case 'int2':
case 'int4':
case 'int8':
case 'float8':
return 'number'
case 'bool':
return 'boolean'
case 'json':
return 'Object'
case 'date':
case 'timestamp':
return 'Date'
case '_float8':
return 'Array<number>'
case '_text':
return 'Array<string>'
default:
throw new TypeError(`do not know how to convert type [${udtName}]`)
}
})
}
}
>>>>>>>
import * as PgPromise from 'pg-promise'
import { mapValues } from 'lodash'
const pgp = PgPromise()
export class Database {
private db
constructor(connectionString: string) {
this.db = pgp(connectionString)
}
public async getDBSchema(tableName: string) {
let schema = {}
await this.db.each(
`SELECT column_name, udt_name
FROM information_schema.columns
WHERE table_name = $1`,
[tableName],
schemaItem => {
schema[schemaItem.column_name] = schemaItem.udt_name
})
return schema
}
public async getTableTypes(tableName: string) {
return this.mapDBSchemaToType(await this.getDBSchema(tableName))
}
public async getDBSchemaTables(schemaName: string): Promise<{table_name: string}[]> {
return await this.db.each(
`SELECT table_name
FROM information_schema.columns
WHERE table_schema = $1
GROUP BY table_name`,
[schemaName],
schemaItem => schemaItem.table_name
)
}
private mapDBSchemaToType(schema: Object) {
return mapValues(schema, udtName => {
switch (udtName) {
case 'varchar':
case 'text':
case 'uuid':
return 'string'
case 'int2':
case 'int4':
case 'int8':
case 'float8':
return 'number'
case 'bool':
return 'boolean'
case 'json':
return 'Object'
case 'date':
case 'timestamp':
return 'Date'
case '_float8':
return 'Array<number>'
case '_text':
return 'Array<string>'
default:
throw new TypeError(`do not know how to convert type [${udtName}]`)
}
})
}
} |
<<<<<<<
=======
link: '/gridToolbarCustom',
icon: 'view_column',
name: 'Grid Toolbar Custom Content'
},
{
link: '/treeGrid',
icon: 'view_column',
name: 'Tree Grid'
},
{
link: '/treeGridFlatData',
icon: 'view_column',
name: 'Tree Grid Flat Data'
},
{
>>>>>>>
link: '/gridToolbarCustom',
icon: 'view_column',
name: 'Grid Toolbar Custom Content'
},
{ |
<<<<<<<
import { GridMasterDetailSampleComponent } from './grid-master-detail/grid-master-detail.sample';
=======
import { GridExternalFilteringComponent } from './grid-external-filtering/grid-external-filtering.sample';
>>>>>>>
import { GridExternalFilteringComponent } from './grid-external-filtering/grid-external-filtering.sample';
import { GridMasterDetailSampleComponent } from './grid-master-detail/grid-master-detail.sample'; |
<<<<<<<
* An @Input property that sets the value of the `id` attribute.
* @example
* ```html
* <igx-icon id="igx-icon-1" family="material">settings</igx-icon>
* ```
*/
@HostBinding('attr.id')
@Input()
public id = `igx-icon-${NEXT_ID++}`;
/**
* An @Input property that sets the value of the `family`. By default it's "material".
=======
* An @Input property that sets the value of the `fontSet`. By default it's "material".
*
>>>>>>>
* An @Input property that sets the value of the `id` attribute.
* @example
* ```html
* <igx-icon id="igx-icon-1" family="material">settings</igx-icon>
* ```
*/
@HostBinding('attr.id')
@Input()
public id = `igx-icon-${NEXT_ID++}`;
/**
* An @Input property that sets the value of the `family`. By default it's "material".
<<<<<<<
* An @Input property that allows you to change the `color` of the icon.
*
* * @deprecated
*
=======
* An @Input property that allows you to change the `iconColor` of the icon.
*
>>>>>>>
* An @Input property that allows you to change the `color` of the icon.
*
* * @deprecated
*
<<<<<<<
* An @Input property that allows you to set the `name` of the icon.
=======
* An @Input property that allows you to set the `iconName` of the icon.
*
>>>>>>>
* An @Input property that allows you to set the `name` of the icon.
<<<<<<<
constructor(
private _el: ElementRef,
private iconService: IgxIconService,
private ref: ChangeDetectorRef) {
this.el = _el;
this.family = this.iconService.defaultFamily;
this.iconService.registerFamilyAlias('material', 'material-icons');
=======
@ViewChild('explicitLigature', { read: TemplateRef, static: true })
private explicitLigature: TemplateRef<HTMLElement>;
@ViewChild('svgImage', { read: TemplateRef, static: true })
private svgImage: TemplateRef<HTMLElement>;
private destroy$ = new Subject<void>();
constructor(public el: ElementRef,
private iconService: IgxIconService,
private ref: ChangeDetectorRef) {
this.font = this.iconService.defaultFontSet;
this.iconService.registerFontSetAlias('material', 'material-icons');
>>>>>>>
@ViewChild('explicitLigature', { read: TemplateRef, static: true })
private explicitLigature: TemplateRef<HTMLElement>;
@ViewChild('svgImage', { read: TemplateRef, static: true })
private svgImage: TemplateRef<HTMLElement>;
private destroy$ = new Subject<void>();
constructor(public el: ElementRef,
private iconService: IgxIconService,
private ref: ChangeDetectorRef) {
this.family = this.iconService.defaultFamily;
this.iconService.registerFamilyAlias('material', 'material-icons');
<<<<<<<
* An accessor that returns the value of the family property.
=======
* An accessor that returns the value of the font property.
*
>>>>>>>
* An accessor that returns the value of the family property.
<<<<<<<
* An accessor that returns the opposite value of the `color` property.
=======
* An accessor that returns the opposite value of the `iconColor` property.
*
>>>>>>>
* An accessor that returns the opposite value of the `color` property.
<<<<<<<
* The key consists of the font-family and the name separated by underscore.
=======
* The key consists of the fontSet and the iconName separated by underscore.
*
>>>>>>>
* The key consists of the font-family and the name separated by underscore. |
<<<<<<<
private _columnList: any[];
private flatRecords: IExportRecord[] = [];
private _columnWidthList: number[];
protected _indexOfLastPinnedColumn = -1;
protected _sort = null;
=======
>>>>>>>
private flatRecords: IExportRecord[] = [];
<<<<<<<
protected abstract exportDataImplementation(data: IExportRecord[], options: IgxExporterOptionsBase): void;
=======
private exportRow(data: any[], rowData: any, index: number, isSpecialData: boolean) {
let row;
>>>>>>>
<<<<<<<
for (let i = 0; i < records.length; i++) {
const hierarchicalRecord: IExportRecord = {
data: records[i].data,
level: records[i].level,
hidden: !parentExpanded,
type: ExportRecordType.TreeGridRecord
};
=======
for (const hierarchicalRecord of records) {
>>>>>>>
for (let i = 0; i < records.length; i++) {
const hierarchicalRecord: IExportRecord = {
data: records[i].data,
level: records[i].level,
hidden: !parentExpanded,
type: ExportRecordType.TreeGridRecord
}; |
<<<<<<<
get maxLevelHeaderDepth() {
if (this._maxLevelHeaderDepth === null) {
this._maxLevelHeaderDepth = this.columnList.reduce((acc, col) => Math.max(acc, col.level), 0);
}
return this._maxLevelHeaderDepth;
}
=======
/* Toolbar related definitions */
private _showToolbar = false;
private _exportExcel = false;
private _exportCsv = false;
private _toolbarTitle: string = null;
private _exportText: string = null;
private _exportExcelText: string = null;
private _exportCsvText: string = null;
@ViewChild('toolbar', { read: IgxGridToolbarComponent })
public toolbar: IgxGridToolbarComponent = null;
@ViewChild('toolbar', { read: ElementRef })
private toolbarHtml: ElementRef = null;
@Input()
public get showToolbar(): boolean {
return this._showToolbar;
}
public set showToolbar(newValue: boolean) {
if (this._showToolbar !== newValue) {
this._showToolbar = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Input()
public get toolbarTitle(): string {
return this._toolbarTitle;
}
public set toolbarTitle(newValue: string) {
if (this._toolbarTitle !== newValue) {
this._toolbarTitle = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Input()
public get exportExcel(): boolean {
return this._exportExcel;
}
public set exportExcel(newValue: boolean) {
if (this._exportExcel !== newValue) {
this._exportExcel = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Input()
public get exportCsv(): boolean {
return this._exportCsv;
}
public set exportCsv(newValue: boolean) {
if (this._exportCsv !== newValue) {
this._exportCsv = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Input()
public get exportText(): string {
return this._exportText;
}
public set exportText(newValue: string) {
if (this._exportText !== newValue) {
this._exportText = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Input()
public get exportExcelText(): string {
return this._exportExcelText;
}
public set exportExcelText(newValue: string) {
if (this._exportExcelText !== newValue) {
this._exportExcelText = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Input()
public get exportCsvText(): string {
return this._exportCsvText;
}
public set exportCsvText(newValue: string) {
if (this._exportCsvText !== newValue) {
this._exportCsvText = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Output()
public onToolbarExporting = new EventEmitter<IGridToolbarExportEventArgs>();
/* End of toolbar related definitions */
>>>>>>>
get maxLevelHeaderDepth() {
if (this._maxLevelHeaderDepth === null) {
this._maxLevelHeaderDepth = this.columnList.reduce((acc, col) => Math.max(acc, col.level), 0);
}
return this._maxLevelHeaderDepth;
}
/* Toolbar related definitions */
private _showToolbar = false;
private _exportExcel = false;
private _exportCsv = false;
private _toolbarTitle: string = null;
private _exportText: string = null;
private _exportExcelText: string = null;
private _exportCsvText: string = null;
@ViewChild('toolbar', { read: IgxGridToolbarComponent })
public toolbar: IgxGridToolbarComponent = null;
@ViewChild('toolbar', { read: ElementRef })
private toolbarHtml: ElementRef = null;
@Input()
public get showToolbar(): boolean {
return this._showToolbar;
}
public set showToolbar(newValue: boolean) {
if (this._showToolbar !== newValue) {
this._showToolbar = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Input()
public get toolbarTitle(): string {
return this._toolbarTitle;
}
public set toolbarTitle(newValue: string) {
if (this._toolbarTitle !== newValue) {
this._toolbarTitle = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Input()
public get exportExcel(): boolean {
return this._exportExcel;
}
public set exportExcel(newValue: boolean) {
if (this._exportExcel !== newValue) {
this._exportExcel = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Input()
public get exportCsv(): boolean {
return this._exportCsv;
}
public set exportCsv(newValue: boolean) {
if (this._exportCsv !== newValue) {
this._exportCsv = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Input()
public get exportText(): string {
return this._exportText;
}
public set exportText(newValue: string) {
if (this._exportText !== newValue) {
this._exportText = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Input()
public get exportExcelText(): string {
return this._exportExcelText;
}
public set exportExcelText(newValue: string) {
if (this._exportExcelText !== newValue) {
this._exportExcelText = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Input()
public get exportCsvText(): string {
return this._exportCsvText;
}
public set exportCsvText(newValue: string) {
if (this._exportCsvText !== newValue) {
this._exportCsvText = newValue;
this.cdr.markForCheck();
if (this._ngAfterViewInitPaassed) {
this.calculateGridSizes();
}
}
}
@Output()
public onToolbarExporting = new EventEmitter<IGridToolbarExportEventArgs>();
/* End of toolbar related definitions */ |
<<<<<<<
if (!this.column.pinned) {
this.row.virtDirRow.scrollPrev();
} else {
this.row.virtDirRow.scrollTo(this.grid.unpinnedColumns.length - 1);
}
this.row.virtDirRow.onChunkLoad.first().subscribe({
=======
this.row.virtDirRow.scrollPrev();
this.row.virtDirRow.onChunkLoad.pipe(take(1)).subscribe({
>>>>>>>
if (!this.column.pinned) {
this.row.virtDirRow.scrollPrev();
} else {
this.row.virtDirRow.scrollTo(this.grid.unpinnedColumns.length - 1);
}
this.row.virtDirRow.onChunkLoad.pipe(take(1)).subscribe({
<<<<<<<
if (!this.column.pinned) {
this.row.virtDirRow.scrollNext();
} else {
this.row.virtDirRow.scrollTo(0);
}
this.row.virtDirRow.onChunkLoad.first().subscribe({
=======
this.row.virtDirRow.scrollNext();
this.row.virtDirRow.onChunkLoad.pipe(take(1)).subscribe({
>>>>>>>
if (!this.column.pinned) {
this.row.virtDirRow.scrollNext();
} else {
this.row.virtDirRow.scrollTo(0);
}
this.row.virtDirRow.onChunkLoad.pipe(take(1)).subscribe({ |
<<<<<<<
import { UIInteractions } from '../../test-utils/ui-interactions.spec';
import { IgxGridRowComponent } from './grid-row.component';
=======
import { UIInteractions, wait } from '../../test-utils/ui-interactions.spec';
>>>>>>>
import { UIInteractions, wait } from '../../test-utils/ui-interactions.spec';
import { IgxGridRowComponent } from './grid-row.component';
<<<<<<<
it('Should allow adding row from pinned row.', () => {
let row = grid.getRowByIndex(0);
row.pin();
fixture.detectChanges();
expect(grid.pinnedRecords.length).toBe(1);
row = grid.getRowByIndex(0);
row.beginAddRow();
fixture.detectChanges();
// add row should be pinned
const addRow = grid.getRowByIndex(1) as IgxGridRowComponent;
expect(addRow.addRow).toBe(true);
expect(grid.pinnedRows[1]).toBe(addRow);
grid.endEdit(true);
fixture.detectChanges();
// added record should be pinned.
expect(grid.pinnedRecords.length).toBe(2);
expect(grid.pinnedRecords[1]).toBe(grid.data[grid.data.length - 1]);
});
it('Should allow adding row from ghost row.', () => {
const row = grid.getRowByIndex(0);
row.pin();
fixture.detectChanges();
expect(grid.pinnedRecords.length).toBe(1);
const ghostRow = grid.getRowByIndex(1);
ghostRow.beginAddRow();
fixture.detectChanges();
// add row should be unpinned
const addRow = grid.getRowByIndex(2);
expect(addRow.addRow).toBe(true);
expect(grid.pinnedRows.length).toBe(1);
grid.endEdit(true);
fixture.detectChanges();
// added record should be unpinned.
expect(grid.pinnedRecords.length).toBe(1);
expect(grid.unpinnedRecords[grid.unpinnedRecords.length - 1]).toBe(grid.data[grid.data.length - 1]);
});
=======
it('should navigate to added row on snackbar button click.', async() => {
const rows = grid.rowList.toArray();
const dataCount = grid.data.length;
rows[0].beginAddRow();
fixture.detectChanges();
grid.endEdit(true);
fixture.detectChanges();
// check row is in data
expect(grid.data.length).toBe(dataCount + 1);
const addedRec = grid.data[grid.data.length - 1];
grid.addRowSnackbar.triggerAction();
fixture.detectChanges();
await wait(100);
fixture.detectChanges();
// check added row is rendered and is in view
const row = grid.getRowByKey(addedRec[grid.primaryKey]);
expect(row).not.toBeNull();
const gridOffsets = grid.tbody.nativeElement.getBoundingClientRect();
const rowOffsets = row.nativeElement.getBoundingClientRect();
expect(rowOffsets.top >= gridOffsets.top && rowOffsets.bottom <= gridOffsets.bottom).toBeTruthy();
});
it('should navigate to added row on snackbar button click when row is not in current view.', async() => {
grid.paging = true;
grid.perPage = 5;
fixture.detectChanges();
const rows = grid.rowList.toArray();
const dataCount = grid.data.length;
rows[0].beginAddRow();
fixture.detectChanges();
grid.endEdit(true);
fixture.detectChanges();
// check row is in data
expect(grid.data.length).toBe(dataCount + 1);
const addedRec = grid.data[grid.data.length - 1];
grid.addRowSnackbar.triggerAction();
fixture.detectChanges();
await wait(100);
fixture.detectChanges();
// check page is correct
expect(grid.page).toBe(5);
// check added row is rendered and is in view
const row = grid.getRowByKey(addedRec[grid.primaryKey]);
expect(row).not.toBeNull();
const gridOffsets = grid.tbody.nativeElement.getBoundingClientRect();
const rowOffsets = row.nativeElement.getBoundingClientRect();
expect(rowOffsets.top >= gridOffsets.top && rowOffsets.bottom <= gridOffsets.bottom).toBeTruthy();
});
>>>>>>>
it('Should allow adding row from pinned row.', () => {
let row = grid.getRowByIndex(0);
row.pin();
fixture.detectChanges();
expect(grid.pinnedRecords.length).toBe(1);
row = grid.getRowByIndex(0);
row.beginAddRow();
fixture.detectChanges();
// add row should be pinned
const addRow = grid.getRowByIndex(1) as IgxGridRowComponent;
expect(addRow.addRow).toBe(true);
expect(grid.pinnedRows[1]).toBe(addRow);
grid.endEdit(true);
fixture.detectChanges();
// added record should be pinned.
expect(grid.pinnedRecords.length).toBe(2);
expect(grid.pinnedRecords[1]).toBe(grid.data[grid.data.length - 1]);
});
it('Should allow adding row from ghost row.', () => {
const row = grid.getRowByIndex(0);
row.pin();
fixture.detectChanges();
expect(grid.pinnedRecords.length).toBe(1);
const ghostRow = grid.getRowByIndex(1);
ghostRow.beginAddRow();
fixture.detectChanges();
// add row should be unpinned
const addRow = grid.getRowByIndex(2);
expect(addRow.addRow).toBe(true);
expect(grid.pinnedRows.length).toBe(1);
grid.endEdit(true);
fixture.detectChanges();
// added record should be unpinned.
expect(grid.pinnedRecords.length).toBe(1);
expect(grid.unpinnedRecords[grid.unpinnedRecords.length - 1]).toBe(grid.data[grid.data.length - 1]);
});
it('should navigate to added row on snackbar button click.', async() => {
const rows = grid.rowList.toArray();
const dataCount = grid.data.length;
rows[0].beginAddRow();
fixture.detectChanges();
grid.endEdit(true);
fixture.detectChanges();
// check row is in data
expect(grid.data.length).toBe(dataCount + 1);
const addedRec = grid.data[grid.data.length - 1];
grid.addRowSnackbar.triggerAction();
fixture.detectChanges();
await wait(100);
fixture.detectChanges();
// check added row is rendered and is in view
const row = grid.getRowByKey(addedRec[grid.primaryKey]);
expect(row).not.toBeNull();
const gridOffsets = grid.tbody.nativeElement.getBoundingClientRect();
const rowOffsets = row.nativeElement.getBoundingClientRect();
expect(rowOffsets.top >= gridOffsets.top && rowOffsets.bottom <= gridOffsets.bottom).toBeTruthy();
});
it('should navigate to added row on snackbar button click when row is not in current view.', async() => {
grid.paging = true;
grid.perPage = 5;
fixture.detectChanges();
const rows = grid.rowList.toArray();
const dataCount = grid.data.length;
rows[0].beginAddRow();
fixture.detectChanges();
grid.endEdit(true);
fixture.detectChanges();
// check row is in data
expect(grid.data.length).toBe(dataCount + 1);
const addedRec = grid.data[grid.data.length - 1];
grid.addRowSnackbar.triggerAction();
fixture.detectChanges();
await wait(100);
fixture.detectChanges();
// check page is correct
expect(grid.page).toBe(5);
// check added row is rendered and is in view
const row = grid.getRowByKey(addedRec[grid.primaryKey]);
expect(row).not.toBeNull();
const gridOffsets = grid.tbody.nativeElement.getBoundingClientRect();
const rowOffsets = row.nativeElement.getBoundingClientRect();
expect(rowOffsets.top >= gridOffsets.top && rowOffsets.bottom <= gridOffsets.bottom).toBeTruthy();
}); |
<<<<<<<
export * from "./navigation/nav-service";
export * from "./navigation/IToggleView";
=======
export * from "./navigation/nav.service";
export * from "./navigation/toggle";
>>>>>>>
export * from "./navigation/IToggleView";
export * from "./navigation/nav.service"; |
<<<<<<<
import { Subject } from 'rxjs';
=======
import { CancelableEventArgs } from '../core/utils';
>>>>>>>
import { Subject } from 'rxjs';
import { CancelableEventArgs } from '../core/utils'; |
<<<<<<<
public static triggerInputEvent(inputElement: DebugElement, inputValue: string) {
inputElement.nativeElement.value = inputValue;
inputElement.triggerEventHandler('input', { target: inputElement.nativeElement });
}
=======
public static sendInputElementValue(element: HTMLInputElement, text, fix?) {
element.value = text;
element.dispatchEvent(new Event('keydown'));
element.dispatchEvent(new Event('input'));
element.dispatchEvent(new Event('keyup'));
if (fix) {
fix.detectChanges();
}
}
>>>>>>>
public static triggerInputEvent(inputElement: DebugElement, inputValue: string) {
inputElement.nativeElement.value = inputValue;
inputElement.triggerEventHandler('input', { target: inputElement.nativeElement });
}
public static sendInputElementValue(element: HTMLInputElement, text, fix?) {
element.value = text;
element.dispatchEvent(new Event('keydown'));
element.dispatchEvent(new Event('input'));
element.dispatchEvent(new Event('keyup'));
if (fix) {
fix.detectChanges();
}
} |
<<<<<<<
import { HammerGestureConfig } from '@angular/platform-browser';
import { scaleInVerBottom, scaleInVerTop } from '../animations/main';
=======
>>>>>>>
import { scaleInVerBottom, scaleInVerTop } from '../animations/main'; |
<<<<<<<
import { JSZipWrapper } from './jszip-verification-wrapper.spec';
import { FileContentData } from './test-data.service.spec';
=======
import { JSZipWrapper } from './jszip-verification-wrapper.spec';
import { ExportTestDataService, FileContentData } from './test-data.service.spec';
>>>>>>>
import { JSZipWrapper } from './jszip-verification-wrapper.spec';
import { FileContentData } from './test-data.service.spec';
<<<<<<<
const grid = fix.componentInstance.grid;
grid.sort('Name', SortingDirection.Asc, true);
=======
const grid = fix.componentInstance.grid1;
grid.sort({fieldName: 'Name', dir: SortingDirection.Asc, ignoreCase: true});
>>>>>>>
const grid = fix.componentInstance.grid;
grid.sort({fieldName: 'Name', dir: SortingDirection.Asc, ignoreCase: true});
<<<<<<<
const grid = fix.componentInstance.grid;
grid.sort('Name', SortingDirection.Asc, true);
=======
const grid = fix.componentInstance.grid1;
grid.sort({fieldName: 'Name', dir: SortingDirection.Asc, ignoreCase: true});
>>>>>>>
const grid = fix.componentInstance.grid;
grid.sort({fieldName: 'Name', dir: SortingDirection.Asc, ignoreCase: true}); |
<<<<<<<
experiments: Map<string, Experiment>;
=======
userSweepTask?: NodeJS.Timeout;
>>>>>>>
experiments: Map<string, Experiment>;
userSweepTask?: NodeJS.Timeout;
<<<<<<<
async loadExperiments() {
this.experiments = new Map();
const experiments = await this.db.query("SELECT * FROM experiments;");
for await (const experiment of experiments) {
const data: Experiment = {
id: experiment.get("id") as string,
kind: experiment.get("kind") as "user" | "guild",
label: experiment.get("label") as string,
defaultConfig: experiment.get("defaultConfig") as {
[key: string]: any;
},
treatments: (experiment.get("treatments") as unknown) as Treatment[],
};
this.experiments.set(data.id, data);
}
}
public getCommand(id: string) {
=======
sweepUsers() {
this.guilds.cache.forEach((guild) =>
guild.members.cache.sweep((member) => member.presence.status == "offline")
);
this.users.cache.sweep((user) =>
this.guilds.cache.every((guild) => !guild.members.cache.has(user.id))
);
}
getCommand(id: string) {
>>>>>>>
async loadExperiments() {
this.experiments = new Map();
const experiments = await this.db.query("SELECT * FROM experiments;");
for await (const experiment of experiments) {
const data: Experiment = {
id: experiment.get("id") as string,
kind: experiment.get("kind") as "user" | "guild",
label: experiment.get("label") as string,
defaultConfig: experiment.get("defaultConfig") as {
[key: string]: any;
},
treatments: (experiment.get("treatments") as unknown) as Treatment[],
};
this.experiments.set(data.id, data);
}
}
sweepUsers() {
this.guilds.cache.forEach((guild) =>
guild.members.cache.sweep((member) => member.presence.status == "offline")
);
this.users.cache.sweep((user) =>
this.guilds.cache.every((guild) => !guild.members.cache.has(user.id))
);
}
getCommand(id: string) { |
<<<<<<<
ViewChild
=======
TemplateRef,
ViewChild,
ViewEncapsulation
>>>>>>>
TemplateRef,
ViewChild |
<<<<<<<
const groupingExpr = grid.groupingExpressions.find((expr) => expr.fieldName === this.column.field);
const sortDir = groupingExpr ?
this.sortDirection + 1 > SortingDirection.Desc ? SortingDirection.Asc : SortingDirection.Desc
: this.sortDirection + 1 > SortingDirection.Desc ? SortingDirection.None : this.sortDirection + 1;
this.sortDirection = sortDir;
=======
const editableCell = this.gridAPI.get_cell_inEditMode(this.gridID);
if (editableCell) {
this.gridAPI.escape_editMode(this.gridID, editableCell.cellID);
}
this.sortDirection = ++this.sortDirection > SortingDirection.Desc ? SortingDirection.None
: this.sortDirection;
>>>>>>>
const editableCell = this.gridAPI.get_cell_inEditMode(this.gridID);
if (editableCell) {
this.gridAPI.escape_editMode(this.gridID, editableCell.cellID);
}
const groupingExpr = grid.groupingExpressions.find((expr) => expr.fieldName === this.column.field);
const sortDir = groupingExpr ?
this.sortDirection + 1 > SortingDirection.Desc ? SortingDirection.Asc : SortingDirection.Desc
: this.sortDirection + 1 > SortingDirection.Desc ? SortingDirection.None : this.sortDirection + 1;
this.sortDirection = sortDir; |
<<<<<<<
import { IColumnMovingEventArgs } from './grid.component';
=======
import { SortingDirection } from '../data-operations/sorting-expression.interface';
>>>>>>>
import { IColumnMovingEventArgs } from './grid.component';
import { SortingDirection } from '../data-operations/sorting-expression.interface';
<<<<<<<
if (!this.draggable || event.target.getAttribute('draggable') === 'false') {
=======
const resizeArea = document.elementFromPoint(event.pageX, event.pageY);
if (!this.draggable ||
(this.element.nativeElement.children[3] && this.element.nativeElement.children[3].isEqualNode(resizeArea))) {
>>>>>>>
if (!this.draggable || event.target.getAttribute('draggable') === 'false') {
<<<<<<<
=======
const drag = event.detail.owner;
if (!(drag instanceof IgxColumnMovingDragDirective)) {
return;
}
if (this.isDropTarget && this.cms.column !== this.column) {
const args = {
source: this.cms.column,
target: this.column,
cancel: false
};
this.column.grid.onColumnMoving.emit(args);
>>>>>>>
const drag = event.detail.owner;
if (!(drag instanceof IgxColumnMovingDragDirective)) {
return;
}
<<<<<<<
event.preventDefault();
=======
const drag = event.detail.owner;
if (!(drag instanceof IgxColumnMovingDragDirective)) {
return;
}
>>>>>>>
event.preventDefault();
const drag = event.detail.owner;
if (!(drag instanceof IgxColumnMovingDragDirective)) {
return;
} |
<<<<<<<
import { Subject } from 'rxjs';
import { takeUntil, first, filter } from 'rxjs/operators';
=======
import ResizeObserver from 'resize-observer-polyfill';
import { Subject, combineLatest, pipe } from 'rxjs';
import { takeUntil, first, filter, throttleTime, map } from 'rxjs/operators';
import { IgxSelectionAPIService } from '../core/selection';
>>>>>>>
import ResizeObserver from 'resize-observer-polyfill';
import { Subject, combineLatest, pipe } from 'rxjs';
import { takeUntil, first, filter, throttleTime, map } from 'rxjs/operators';
<<<<<<<
this.transactions.onStateUpdate.pipe(takeUntil(this.destroy$)).subscribe(() => {
this.selectionService.clearHeaderCBState();
=======
this.transactions.onStateUpdate.pipe(destructor).subscribe(() => {
>>>>>>>
this.transactions.onStateUpdate.pipe(destructor).subscribe(() => {
this.selectionService.clearHeaderCBState();
<<<<<<<
this.verticalScrollContainer.onDataChanging.pipe(takeUntil(this.destroy$)).subscribe(($event) => {
this.calculateGridHeight();
$event.containerSize = this.calcHeight;
});
this.verticalScrollContainer.onDataChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {
requestAnimationFrame(() => {
if (!this._destroyed) {
this.selectionService.clearHeaderCBState();
this.reflow();
}
});
});
this._init = false;
this.cdr.reattach();
}
=======
if (this._cdrRequestRepaint) {
this.resetNotifyChanges();
this.calculateGridSizes();
this.refreshSearch(true);
return;
}
>>>>>>>
if (this._cdrRequestRepaint) {
this.resetNotifyChanges();
this.calculateGridSizes();
this.refreshSearch(true);
return;
}
<<<<<<<
=======
* @hidden
*/
public checkHeaderCheckboxStatus(headerStatus?: boolean) {
if (headerStatus === undefined) {
const filteredData = this.filteringService.filteredData;
const dataLength = filteredData ? filteredData.length : this.dataLength;
this.allRowsSelected = this.selection.are_all_selected(this.id, dataLength);
if (this.headerCheckbox) {
this.headerCheckbox.indeterminate = !this.allRowsSelected && !this.selection.are_none_selected(this.id);
if (!this.headerCheckbox.indeterminate) {
this.headerCheckbox.checked =
this.allRowsSelected;
}
}
this.notifyChanges();
} else if (this.headerCheckbox) {
this.headerCheckbox.checked = headerStatus !== undefined ? headerStatus : false;
}
}
/**
* @hidden
*/
public filteredItemsStatus(componentID: string, filteredData: any[], primaryKey?) {
const currSelection = this.selection.get(componentID);
let atLeastOneSelected = false;
let notAllSelected = false;
if (currSelection) {
for (const key of Object.keys(filteredData)) {
const dataItem = primaryKey ? filteredData[key][primaryKey] : filteredData[key];
if (currSelection.has(dataItem)) {
atLeastOneSelected = true;
if (notAllSelected) {
return 'indeterminate';
}
} else {
notAllSelected = true;
if (atLeastOneSelected) {
return 'indeterminate';
}
}
}
}
return atLeastOneSelected ? 'allSelected' : 'noneSelected';
}
/**
* @hidden
*/
public updateHeaderCheckboxStatusOnFilter(data) {
if (!data || !this.hasVisibleColumns || !this.headerCheckbox) {
this.checkHeaderCheckboxStatus();
return;
}
switch (this.filteredItemsStatus(this.id, data, this.primaryKey)) {
case 'allSelected': {
if (!this.allRowsSelected) {
this.allRowsSelected = true;
}
if (this.headerCheckbox.indeterminate) {
this.headerCheckbox.indeterminate = false;
}
break;
}
case 'noneSelected': {
if (this.allRowsSelected) {
this.allRowsSelected = false;
}
if (this.headerCheckbox.indeterminate) {
this.headerCheckbox.indeterminate = false;
}
break;
}
default: {
if (!this.headerCheckbox.indeterminate) {
this.headerCheckbox.indeterminate = true;
}
if (this.allRowsSelected) {
this.allRowsSelected = false;
}
break;
}
}
}
/**
>>>>>>>
<<<<<<<
this.selectionService.clear(true);
this.cdr.markForCheck();
=======
this.selectionService.clear();
this.selectionService.activeElement = null;
this.notifyChanges();
>>>>>>>
this.selectionService.clear(true);
this.notifyChanges();
<<<<<<<
/**
* @hidden
*/
protected get isAttachedToDom(): boolean {
return this.document.body.contains(this.nativeElement);
}
/**
* @hidden
*/
public get isMultiRowSelectionEnabled(): boolean {
return this.rowSelection === GridSelectionMode.multiple;
}
/**
* @hidden
*/
public get isRowSelectable(): boolean {
return this.rowSelection !== GridSelectionMode.none;
}
=======
>>>>>>>
/**
* @hidden
*/
public get isMultiRowSelectionEnabled(): boolean {
return this.rowSelection === GridSelectionMode.multiple;
}
/**
* @hidden
*/
public get isRowSelectable(): boolean {
return this.rowSelection !== GridSelectionMode.none;
} |
<<<<<<<
IFilteringExpression, IFilteringState,
IGroupByRecord, IGroupingState,
IPagingState,
ISortingExpression, ISortingState,
PagingError, SortingDirection
=======
IFilteringExpression, IFilteringState, IPagingState, ISortingExpression, ISortingState,
PagingError, SortingDirection, IgxStringFilteringOperand, IgxNumberFilteringOperand,
IgxDateFilteringOperand, IgxBooleanFilteringOperand
>>>>>>>
IFilteringExpression, IFilteringState, IGroupByRecord, IGroupingState,
IPagingState, ISortingExpression, ISortingState, PagingError, SortingDirection,
IgxStringFilteringOperand, IgxNumberFilteringOperand,
IgxDateFilteringOperand, IgxBooleanFilteringOperand
<<<<<<<
// test helper function getFilteringConditionsByDataType
it('tests getFilteringConditionsByDataType', () => {
const dataGenerator = new DataGenerator();
const stringCond = Object.keys(FilteringCondition.string);
const numberCond = Object.keys(FilteringCondition.number);
const booleanCond = Object.keys(FilteringCondition.boolean);
const dateCond = Object.keys(FilteringCondition.date);
expect(
dataGenerator.isSuperset(DataUtil.getListOfFilteringConditionsForDataType(DataType.String), stringCond))
.toBeTruthy('string filtering conditions');
expect(
dataGenerator.isSuperset(DataUtil.getListOfFilteringConditionsForDataType(DataType.Number), numberCond))
.toBeTruthy('number filtering conditions');
expect(
dataGenerator.isSuperset(DataUtil.getListOfFilteringConditionsForDataType(DataType.Boolean), booleanCond))
.toBeTruthy('boolean filtering conditions');
expect(
dataGenerator.isSuperset(DataUtil.getListOfFilteringConditionsForDataType(DataType.Date), dateCond))
.toBeTruthy('date filtering conditions');
});
=======
>>>>>>> |
<<<<<<<
}
@Component({
template: `
<igx-tree-grid #treeGrid [data]="data" childDataKey="Employees" width="900px" height="600px">
<igx-column [field]="'ID'" dataType="number" [sortable]="true"></igx-column>
<igx-column [field]="'Name'" dataType="string" [sortable]="true"></igx-column>
<igx-column [field]="'HireDate'" dataType="date" [sortable]="true"></igx-column>
<igx-column [field]="'Age'" dataType="number" [sortable]="true"></igx-column>
<ng-template igxRowExpandedIndicator>
<span>EXPANDED</span>
</ng-template>
<ng-template igxRowCollapsedIndicator>
<span>COLLAPSED</span>
</ng-template>
</igx-tree-grid>
`
})
export class IgxTreeGridCustomExpandersTemplateComponent {
@ViewChild(IgxTreeGridComponent, { static: true }) public treeGrid: IgxTreeGridComponent;
public data = SampleTestData.employeeTreeData();
=======
}
@Component({
template: `
<igx-tree-grid #treeGridCustomSelectors
[data]="data" primaryKey="ID" foreignKey="ParentID"
[paging]="true" [perPage]="5" [rowSelection]="'multiple'" width="900px" height="600px">
<igx-column [field]="'ID'" dataType="number"></igx-column>
<igx-column [field]="'Name'" dataType="string"></igx-column>
<igx-column [field]="'Age'" dataType="number"></igx-column>
<igx-column [field]="'OnPTO'" dataType="boolean"></igx-column>
<igx-column [field]="'HireDate'" dataType="date"></igx-column>
<ng-template igxRowSelector let-rowContext>
<span class="rowNumber">{{ rowContext.index }}</span>
<igx-checkbox [checked]="rowContext.selected" (click)="onRowCheckboxClick($event, rowContext)"></igx-checkbox>
</ng-template>
<ng-template igxHeadSelector let-headContext>
<igx-checkbox
[checked]="headContext.totalCount === headContext.selectedCount"
[indeterminate]="headContext.totalCount !== headContext.selectedCount && headContext.selectedCount !== 0"
(click)="onHeaderCheckboxClick($event, headContext)">
</igx-checkbox>
</ng-template>
</igx-tree-grid>`
})
export class IgxTreeGridCustomRowSelectorsComponent implements OnInit {
@ViewChild(IgxTreeGridComponent, { static: true })
public treeGrid: IgxTreeGridComponent;
public data = [];
public ngOnInit(): void {
this.data = SampleTestData.employeePrimaryForeignKeyTreeData();
}
public onRowCheckboxClick(event, rowContext) {
event.stopPropagation();
event.preventDefault();
rowContext.selected ? this.treeGrid.deselectRows([rowContext.rowID]) : this.treeGrid.selectRows([rowContext.rowID]);
}
public onHeaderCheckboxClick(event, headContext) {
event.stopPropagation();
event.preventDefault();
headContext.selected ? this.treeGrid.deselectAllRows() : this.treeGrid.selectAllRows();
}
>>>>>>>
}
@Component({
template: `
<igx-tree-grid #treeGridCustomSelectors
[data]="data" primaryKey="ID" foreignKey="ParentID"
[paging]="true" [perPage]="5" [rowSelection]="'multiple'" width="900px" height="600px">
<igx-column [field]="'ID'" dataType="number"></igx-column>
<igx-column [field]="'Name'" dataType="string"></igx-column>
<igx-column [field]="'Age'" dataType="number"></igx-column>
<igx-column [field]="'OnPTO'" dataType="boolean"></igx-column>
<igx-column [field]="'HireDate'" dataType="date"></igx-column>
<ng-template igxRowSelector let-rowContext>
<span class="rowNumber">{{ rowContext.index }}</span>
<igx-checkbox [checked]="rowContext.selected" (click)="onRowCheckboxClick($event, rowContext)"></igx-checkbox>
</ng-template>
<ng-template igxHeadSelector let-headContext>
<igx-checkbox
[checked]="headContext.totalCount === headContext.selectedCount"
[indeterminate]="headContext.totalCount !== headContext.selectedCount && headContext.selectedCount !== 0"
(click)="onHeaderCheckboxClick($event, headContext)">
</igx-checkbox>
</ng-template>
</igx-tree-grid>`
})
export class IgxTreeGridCustomRowSelectorsComponent implements OnInit {
@ViewChild(IgxTreeGridComponent, { static: true })
public treeGrid: IgxTreeGridComponent;
public data = [];
public ngOnInit(): void {
this.data = SampleTestData.employeePrimaryForeignKeyTreeData();
}
public onRowCheckboxClick(event, rowContext) {
event.stopPropagation();
event.preventDefault();
rowContext.selected ? this.treeGrid.deselectRows([rowContext.rowID]) : this.treeGrid.selectRows([rowContext.rowID]);
}
public onHeaderCheckboxClick(event, headContext) {
event.stopPropagation();
event.preventDefault();
headContext.selected ? this.treeGrid.deselectAllRows() : this.treeGrid.selectAllRows();
}
}
@Component({
template: `
<igx-tree-grid #treeGrid [data]="data" childDataKey="Employees" width="900px" height="600px">
<igx-column [field]="'ID'" dataType="number" [sortable]="true"></igx-column>
<igx-column [field]="'Name'" dataType="string" [sortable]="true"></igx-column>
<igx-column [field]="'HireDate'" dataType="date" [sortable]="true"></igx-column>
<igx-column [field]="'Age'" dataType="number" [sortable]="true"></igx-column>
<ng-template igxRowExpandedIndicator>
<span>EXPANDED</span>
</ng-template>
<ng-template igxRowCollapsedIndicator>
<span>COLLAPSED</span>
</ng-template>
</igx-tree-grid>
`
})
export class IgxTreeGridCustomExpandersTemplateComponent {
@ViewChild(IgxTreeGridComponent, { static: true }) public treeGrid: IgxTreeGridComponent;
public data = SampleTestData.employeeTreeData(); |
<<<<<<<
super(selectionService, crudService, gridAPI, cdr, helement, zone, touchManager);
=======
super(selectionService, crudService, gridAPI, cdr, helement, zone, touchManager, platformUtil);
// this.hSelection = <IgxHierarchicalSelectionAPIService>selection;
>>>>>>>
super(selectionService, crudService, gridAPI, cdr, helement, zone, touchManager, platformUtil); |
<<<<<<<
import { Component, OnInit, ViewChild, Input, Inject } from '@angular/core';
import {
IgxGridComponent,
ColumnPinningPosition,
RowPinningPosition,
IgxGridRowComponent,
IgxTransactionService,
IgxGridTransaction,
IgxHierarchicalGridComponent,
DisplayDensityToken,
DisplayDensity,
IDisplayDensityOptions } from 'igniteui-angular';
=======
import { Component, OnInit, ViewChild } from '@angular/core';
import {
IgxGridComponent,
ColumnPinningPosition,
RowPinningPosition, IgxGridRowComponent,
IgxTransactionService,
IgxGridTransaction,
IgxGridStateDirective,
IgxExcelExporterService,
IgxExcelExporterOptions
} from 'igniteui-angular';
>>>>>>>
import { Component, OnInit, ViewChild, Inject } from '@angular/core';
import {
IgxGridComponent,
ColumnPinningPosition,
RowPinningPosition, IgxGridRowComponent,
IgxTransactionService,
IgxGridTransaction,
IgxGridStateDirective,
IgxExcelExporterService,
IgxExcelExporterOptions,
DisplayDensityToken,
DisplayDensity,
IgxHierarchicalGridComponent,
IDisplayDensityOptions
} from 'igniteui-angular';
<<<<<<<
@ViewChild('hGrid', { static: true })
hGrid: IgxHierarchicalGridComponent;
constructor(@Inject(DisplayDensityToken) public displayDensityOptions: IDisplayDensityOptions) {}
=======
@ViewChild(IgxGridStateDirective, { static: true }) public state: IgxGridStateDirective;
constructor(private excelExportService: IgxExcelExporterService) {
}
>>>>>>>
@ViewChild('hGrid', { static: true })
hGrid: IgxHierarchicalGridComponent;
@ViewChild(IgxGridStateDirective, { static: true }) public state: IgxGridStateDirective;
constructor(@Inject(DisplayDensityToken) public displayDensityOptions: IDisplayDensityOptions, private excelExportService: IgxExcelExporterService) {
}
<<<<<<<
clickUnpin() {
this.grid1.unpinRow('aaaa');
}
generateDataUneven(count: number, level: number, parendID: string = null) {
const prods = [];
const currLevel = level;
let children;
for (let i = 0; i < count; i++) {
const rowID = parendID ? parendID + i : i.toString();
if (level > 0) {
// Have child grids for row with even id less rows by not multiplying by 2
children = this.generateDataUneven(((i % 2) + 1) * Math.round(count / 3), currLevel - 1, rowID);
}
prods.push({
ID: rowID,
ChildLevels: currLevel,
ProductName: 'Product: A' + i,
Col1: i,
Col2: i,
Col3: i,
childData: children,
childData2: children,
hasChild: true
});
}
return prods;
}
public isPinned(cell) {
console.log(cell);
return true;
}
toggleDensity() {
switch (this.displayDensityOptions.displayDensity ) {
case DisplayDensity.comfortable: this.displayDensityOptions.displayDensity = DisplayDensity.compact; break;
case DisplayDensity.compact: this.displayDensityOptions.displayDensity = DisplayDensity.cosy; break;
case DisplayDensity.cosy: this.displayDensityOptions.displayDensity = DisplayDensity.comfortable; break;
}
}
=======
public exportButtonHandler() {
this.excelExportService.export(this.grid1, new IgxExcelExporterOptions("ExportFileFromGrid"));
}
public saveGridState() {
const state = this.state.getState() as string;
window.localStorage.setItem("grid1-state", state);
}
public restoreGridState() {
const state = window.localStorage.getItem("grid1-state");
this.state.setState(state);
}
>>>>>>>
clickUnpin() {
this.grid1.unpinRow('aaaa');
}
generateDataUneven(count: number, level: number, parendID: string = null) {
const prods = [];
const currLevel = level;
let children;
for (let i = 0; i < count; i++) {
const rowID = parendID ? parendID + i : i.toString();
if (level > 0) {
// Have child grids for row with even id less rows by not multiplying by 2
children = this.generateDataUneven(((i % 2) + 1) * Math.round(count / 3), currLevel - 1, rowID);
}
prods.push({
ID: rowID,
ChildLevels: currLevel,
ProductName: 'Product: A' + i,
Col1: i,
Col2: i,
Col3: i,
childData: children,
childData2: children,
hasChild: true
});
}
return prods;
}
public isPinned(cell) {
console.log(cell);
return true;
}
public exportButtonHandler() {
this.excelExportService.export(this.grid1, new IgxExcelExporterOptions("ExportFileFromGrid"));
}
public saveGridState() {
const state = this.state.getState() as string;
window.localStorage.setItem("grid1-state", state);
}
public restoreGridState() {
const state = window.localStorage.getItem("grid1-state");
this.state.setState(state);
}
toggleDensity() {
switch (this.displayDensityOptions.displayDensity ) {
case DisplayDensity.comfortable: this.displayDensityOptions.displayDensity = DisplayDensity.compact; break;
case DisplayDensity.compact: this.displayDensityOptions.displayDensity = DisplayDensity.cosy; break;
case DisplayDensity.cosy: this.displayDensityOptions.displayDensity = DisplayDensity.comfortable; break;
}
} |
<<<<<<<
protected _groupBy(name: string, direction = SortingDirection.Asc, ignoreCase = true) {
this.gridAPI.groupBy(this.id, name, direction, ignoreCase);
}
protected _groupByMultiple(expressions: ISortingExpression[]) {
this.gridAPI.groupBy_multiple(this.id, expressions);
}
protected _getStateForGroupRow(groupRow: IGroupByRecord): IGroupByExpandState {
return this.gridAPI.groupBy_get_expanded_for_group(this.id, groupRow);
}
protected _toggleGroup(groupRow: IGroupByRecord) {
this.gridAPI.groupBy_toggle_group(this.id, groupRow);
}
protected _applyGrouping() {
this.gridAPI.sort_multiple(this.id, this._groupingExpressions);
}
protected _filter(name: string, value: any, condition?, ignoreCase?) {
=======
protected _filter(name: string, value: any, condition?: IFilteringOperation, ignoreCase?: boolean) {
>>>>>>>
protected _groupBy(name: string, direction = SortingDirection.Asc, ignoreCase = true) {
this.gridAPI.groupBy(this.id, name, direction, ignoreCase);
}
protected _groupByMultiple(expressions: ISortingExpression[]) {
this.gridAPI.groupBy_multiple(this.id, expressions);
}
protected _getStateForGroupRow(groupRow: IGroupByRecord): IGroupByExpandState {
return this.gridAPI.groupBy_get_expanded_for_group(this.id, groupRow);
}
protected _toggleGroup(groupRow: IGroupByRecord) {
this.gridAPI.groupBy_toggle_group(this.id, groupRow);
}
protected _applyGrouping() {
this.gridAPI.sort_multiple(this.id, this._groupingExpressions);
}
protected _filter(name: string, value: any, condition?: IFilteringOperation, ignoreCase?: boolean) { |
<<<<<<<
import { GridGroupBySampleModule } from "./grid-groupby/sample.module";
=======
import { GridPerformanceSampleModule } from "./grid-performance/sample.module";
import { GridSummarySampleModule } from "./grid-summaries/sample.module";
import { GridSampleModule } from "./grid/sample.module";
>>>>>>>
import { GridGroupBySampleModule } from "./grid-groupby/sample.module";
import { GridPerformanceSampleModule } from "./grid-performance/sample.module";
import { GridSummarySampleModule } from "./grid-summaries/sample.module";
import { GridSampleModule } from "./grid/sample.module";
<<<<<<<
GridGroupBySampleModule,
=======
GridSummarySampleModule,
>>>>>>>
GridGroupBySampleModule,
GridSummarySampleModule, |
<<<<<<<
import { IgxGridSelectionService, IgxGridCRUDService } from '../selection/selection.service';
import { IgxForOfSyncService } from '../../directives/for-of/for_of.sync.service';
=======
import { IgxGridSelectionService, IgxGridCRUDService } from '../../core/grid-selection';
import { IgxForOfSyncService, IgxForOfScrollSyncService } from '../../directives/for-of/for_of.sync.service';
>>>>>>>
import { IgxGridSelectionService, IgxGridCRUDService } from '../selection/selection.service';
import { IgxForOfSyncService, IgxForOfScrollSyncService } from '../../directives/for-of/for_of.sync.service'; |
<<<<<<<
import { WatchChanges } from './watch-changes';
=======
import { IgxGridHeaderGroupComponent } from './grid-header-group.component';
import { IgxGridToolbarCustomContentDirective } from './grid-toolbar.component';
import { IGridResourceStrings } from '../core/i18n/grid-resources';
import { CurrentResourceStrings } from '../core/i18n/resources';
import { IgxGridSummaryService } from './summaries/grid-summary.service';
import { IgxSummaryRowComponent } from './summaries/summary-row.component';
import { DeprecateMethod } from '../core/deprecateDecorators';
>>>>>>>
import { WatchChanges } from './watch-changes';
import { IgxGridHeaderGroupComponent } from './grid-header-group.component';
import { IgxGridToolbarCustomContentDirective } from './grid-toolbar.component';
import { IGridResourceStrings } from '../core/i18n/grid-resources';
import { CurrentResourceStrings } from '../core/i18n/resources';
import { IgxGridSummaryService } from './summaries/grid-summary.service';
import { IgxSummaryRowComponent } from './summaries/summary-row.component';
import { DeprecateMethod } from '../core/deprecateDecorators';
<<<<<<<
export interface IGridDataBindable {
data: any[];
filteredData: any[];
}
=======
export enum GridSummaryPosition {
top = 'top',
bottom = 'bottom'
}
export enum GridSummaryCalculationMode {
rootLevelOnly = 'rootLevelOnly',
childLevelsOnly = 'childLevelsOnly',
rootAndChildLevels = 'rootAndChildLevels'
}
export abstract class IgxGridBaseComponent extends DisplayDensityBase implements OnInit, OnDestroy, AfterContentInit, AfterViewInit {
private _data: any[];
/**
* An @Input property that lets you fill the `IgxGridComponent` with an array of data.
* ```html
* <igx-grid [data]="Data" [autoGenerate]="true"></igx-grid>
* ```
* @memberof IgxGridBaseComponent
*/
@Input()
public get data(): any[] {
return this._data;
}
public set data(value: any[]) {
this._data = value;
this.summaryService.clearSummaryCache();
}
private _resourceStrings = CurrentResourceStrings.GridResStrings;
private _emptyGridMessage = null;
private _emptyFilteredGridMessage = null;
/**
* An accessor that sets the resource strings.
* By default it uses EN resources.
*/
@Input()
set resourceStrings(value: IGridResourceStrings) {
this._resourceStrings = Object.assign({}, this._resourceStrings, value);
}
/**
* An accessor that returns the resource strings.
*/
get resourceStrings(): IGridResourceStrings {
return this._resourceStrings;
}
>>>>>>>
export interface IGridDataBindable {
data: any[];
filteredData: any[];
}
export enum GridSummaryPosition {
top = 'top',
bottom = 'bottom'
}
export enum GridSummaryCalculationMode {
rootLevelOnly = 'rootLevelOnly',
childLevelsOnly = 'childLevelsOnly',
rootAndChildLevels = 'rootAndChildLevels'
}
<<<<<<<
private changeRowEditingOverlayStateOnScroll(row: IgxRowComponent<IgxGridBaseComponent & IGridDataBindable>) {
if (!this.rowEditable || this.rowEditingOverlay.collapsed) {
return;
}
if (!row) {
this.toggleRowEditingOverlay(false);
} else {
this.repositionRowEditingOverlay(row);
}
=======
private changeRowEditingOverlayStateOnScroll(row: IgxRowComponent<IgxGridBaseComponent>) {
if (!this.rowEditable || this.rowEditingOverlay.collapsed) {
return;
>>>>>>>
private changeRowEditingOverlayStateOnScroll(row: IgxRowComponent<IgxGridBaseComponent & IGridDataBindable>) {
if (!this.rowEditable || this.rowEditingOverlay.collapsed) {
return;
<<<<<<<
protected writeToData(rowIndex: number, value: any) {
mergeObjects(this.gridAPI.get_all_data(this.id)[rowIndex], value);
}
=======
>>>>>>>
protected writeToData(rowIndex: number, value: any) {
mergeObjects(this.gridAPI.get_all_data(this.id)[rowIndex], value);
}
<<<<<<<
}
=======
/**
* @hidden
*/
public isSummaryRow(rowData): boolean {
return rowData.summaries && (rowData.summaries instanceof Map);
}
}
>>>>>>>
/**
* @hidden
*/
public isSummaryRow(rowData): boolean {
return rowData.summaries && (rowData.summaries instanceof Map);
}
} |
<<<<<<<
protected _groupKey: string | number;
protected _textKey = '';
=======
protected _groupKey: string | number = '';
public customValueFlag = true;
>>>>>>>
protected _groupKey: string | number = '';
protected _textKey: string | number = '';
<<<<<<<
private _searchInput: ElementRef;
private _comboInput: ElementRef;
private _onChangeCallback: (_: any) => void = noop;
=======
protected _textKey: string | number = '';
private _searchInput: ElementRef = null;
public id = '';
private _comboInput: ElementRef = null;
>>>>>>>
private _searchInput: ElementRef = null;
private _comboInput: ElementRef = null;
private _onChangeCallback: (_: any) => void = noop; |
<<<<<<<
it("Filtering and row selection", async(() => {
const fix = TestBed.createComponent(GridWithSelectionFilteringComponent);
fix.detectChanges();
const grid = fix.componentInstance.gridSelection4;
const headerRow: HTMLElement = fix.nativeElement.querySelector(".igx-grid__thead");
const headerCheckbox: HTMLInputElement = headerRow.querySelector(".igx-checkbox__input");
const secondRow = grid.getRowByIndex(1);
expect(secondRow).toBeDefined();
const targetCheckbox: HTMLElement = secondRow.nativeElement.querySelector(".igx-checkbox__input");
expect(secondRow.isSelected).toBeFalsy();
targetCheckbox.click();
fix.detectChanges();
expect(secondRow.isSelected).toBeTruthy();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeTruthy();
expect(secondRow.isSelected).toBeTruthy();
grid.filter("ProductName", "Ignite", STRING_FILTERS.contains, true);
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeFalsy();
headerCheckbox.click();
fix.detectChanges();
expect(headerCheckbox.checked).toBeTruthy();
expect(headerCheckbox.indeterminate).toBeFalsy();
grid.clearFilter("ProductName");
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeTruthy();
expect(grid.getRowByIndex(0).isSelected).toBeTruthy();
expect(grid.getRowByIndex(1).isSelected).toBeTruthy();
expect(grid.getRowByIndex(2).isSelected).toBeTruthy();
grid.filter("ProductName", "Ignite", STRING_FILTERS.contains, true);
fix.detectChanges();
expect(headerCheckbox.checked).toBeTruthy();
expect(headerCheckbox.indeterminate).toBeFalsy();
headerCheckbox.click();
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeFalsy();
grid.clearFilter("ProductName");
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeTruthy();
expect(grid.getRowByIndex(0).isSelected).toBeFalsy();
expect(grid.getRowByIndex(1).isSelected).toBeTruthy();
expect(grid.getRowByIndex(2).isSelected).toBeFalsy();
grid.getRowByIndex(0).nativeElement.querySelector(".igx-checkbox__input").click();
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeTruthy();
grid.filter("ProductName", "Ignite", STRING_FILTERS.contains, true);
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeTruthy();
headerCheckbox.click();
fix.detectChanges();
headerCheckbox.click();
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeFalsy();
grid.clearFilter("ProductName");
fix.detectChanges();
expect(grid.getRowByIndex(0).isSelected).toBeFalsy();
expect(grid.getRowByIndex(1).isSelected).toBeTruthy();
}));
=======
// API Methods
it("Should be able to select/deselect rows programatically", async(() => {
const fix = TestBed.createComponent(GridWithSelectionComponent);
fix.detectChanges();
const grid = fix.componentInstance.gridSelection3;
let rowsCollection = [];
const firstRow = grid.getRowByKey("0_0");
const secondRow = grid.getRowByKey("0_1");
const thirdRow = grid.getRowByKey("0_2");
rowsCollection = grid.selectedRows();
expect(rowsCollection).toBeUndefined();
expect(firstRow.isSelected).toBeFalsy();
expect(secondRow.isSelected).toBeFalsy();
expect(thirdRow.isSelected).toBeFalsy();
grid.selectRows(["0_0", "0_1", "0_2"], false);
fix.whenStable().then(() => {
fix.detectChanges();
expect(firstRow.isSelected).toBeTruthy();
expect(secondRow.isSelected).toBeTruthy();
expect(thirdRow.isSelected).toBeTruthy();
rowsCollection = grid.selectedRows();
expect(rowsCollection.length).toEqual(3);
grid.deselectRows(["0_0", "0_1", "0_2"]);
return fix.whenStable();
}).then(() => {
fix.detectChanges();
expect(firstRow.isSelected).toBeFalsy();
expect(secondRow.isSelected).toBeFalsy();
expect(thirdRow.isSelected).toBeFalsy();
rowsCollection = grid.selectedRows();
expect(rowsCollection.length).toEqual(0);
});
}));
it("Should be able to select/deselect ALL rows programatically", async(() => {
const fix = TestBed.createComponent(GridWithSelectionComponent);
fix.detectChanges();
const grid = fix.componentInstance.gridSelection3;
let rowsCollection = [];
const firstRow = grid.getRowByKey("0_0");
rowsCollection = grid.selectedRows();
expect(rowsCollection).toBeUndefined();
expect(firstRow.isSelected).toBeFalsy();
grid.selectAllRows();
fix.whenStable().then(() => {
fix.detectChanges();
expect(firstRow.isSelected).toBeTruthy();
rowsCollection = grid.selectedRows();
expect(rowsCollection.length).toEqual(500);
grid.deselectAllRows();
return fix.whenStable();
}).then(() => {
fix.detectChanges();
expect(firstRow.isSelected).toBeFalsy();
rowsCollection = grid.selectedRows();
expect(rowsCollection.length).toEqual(0);
});
}));
>>>>>>>
// API Methods
it("Should be able to select/deselect rows programatically", async(() => {
const fix = TestBed.createComponent(GridWithSelectionComponent);
fix.detectChanges();
const grid = fix.componentInstance.gridSelection3;
let rowsCollection = [];
const firstRow = grid.getRowByKey("0_0");
const secondRow = grid.getRowByKey("0_1");
const thirdRow = grid.getRowByKey("0_2");
rowsCollection = grid.selectedRows();
expect(rowsCollection).toBeUndefined();
expect(firstRow.isSelected).toBeFalsy();
expect(secondRow.isSelected).toBeFalsy();
expect(thirdRow.isSelected).toBeFalsy();
grid.selectRows(["0_0", "0_1", "0_2"], false);
fix.whenStable().then(() => {
fix.detectChanges();
expect(firstRow.isSelected).toBeTruthy();
expect(secondRow.isSelected).toBeTruthy();
expect(thirdRow.isSelected).toBeTruthy();
rowsCollection = grid.selectedRows();
expect(rowsCollection.length).toEqual(3);
grid.deselectRows(["0_0", "0_1", "0_2"]);
return fix.whenStable();
}).then(() => {
fix.detectChanges();
expect(firstRow.isSelected).toBeFalsy();
expect(secondRow.isSelected).toBeFalsy();
expect(thirdRow.isSelected).toBeFalsy();
rowsCollection = grid.selectedRows();
expect(rowsCollection.length).toEqual(0);
});
}));
it("Should be able to select/deselect ALL rows programatically", async(() => {
const fix = TestBed.createComponent(GridWithSelectionComponent);
fix.detectChanges();
const grid = fix.componentInstance.gridSelection3;
let rowsCollection = [];
const firstRow = grid.getRowByKey("0_0");
rowsCollection = grid.selectedRows();
expect(rowsCollection).toBeUndefined();
expect(firstRow.isSelected).toBeFalsy();
grid.selectAllRows();
fix.whenStable().then(() => {
fix.detectChanges();
expect(firstRow.isSelected).toBeTruthy();
rowsCollection = grid.selectedRows();
expect(rowsCollection.length).toEqual(500);
grid.deselectAllRows();
return fix.whenStable();
}).then(() => {
fix.detectChanges();
expect(firstRow.isSelected).toBeFalsy();
rowsCollection = grid.selectedRows();
expect(rowsCollection.length).toEqual(0);
});
}));
it("Filtering and row selection", async(() => {
const fix = TestBed.createComponent(GridWithSelectionFilteringComponent);
fix.detectChanges();
const grid = fix.componentInstance.gridSelection4;
const headerRow: HTMLElement = fix.nativeElement.querySelector(".igx-grid__thead");
const headerCheckbox: HTMLInputElement = headerRow.querySelector(".igx-checkbox__input");
const secondRow = grid.getRowByIndex(1);
expect(secondRow).toBeDefined();
const targetCheckbox: HTMLElement = secondRow.nativeElement.querySelector(".igx-checkbox__input");
expect(secondRow.isSelected).toBeFalsy();
targetCheckbox.click();
fix.detectChanges();
expect(secondRow.isSelected).toBeTruthy();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeTruthy();
expect(secondRow.isSelected).toBeTruthy();
grid.filter("ProductName", "Ignite", STRING_FILTERS.contains, true);
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeFalsy();
headerCheckbox.click();
fix.detectChanges();
expect(headerCheckbox.checked).toBeTruthy();
expect(headerCheckbox.indeterminate).toBeFalsy();
grid.clearFilter("ProductName");
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeTruthy();
expect(grid.getRowByIndex(0).isSelected).toBeTruthy();
expect(grid.getRowByIndex(1).isSelected).toBeTruthy();
expect(grid.getRowByIndex(2).isSelected).toBeTruthy();
grid.filter("ProductName", "Ignite", STRING_FILTERS.contains, true);
fix.detectChanges();
expect(headerCheckbox.checked).toBeTruthy();
expect(headerCheckbox.indeterminate).toBeFalsy();
headerCheckbox.click();
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeFalsy();
grid.clearFilter("ProductName");
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeTruthy();
expect(grid.getRowByIndex(0).isSelected).toBeFalsy();
expect(grid.getRowByIndex(1).isSelected).toBeTruthy();
expect(grid.getRowByIndex(2).isSelected).toBeFalsy();
grid.getRowByIndex(0).nativeElement.querySelector(".igx-checkbox__input").click();
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeTruthy();
grid.filter("ProductName", "Ignite", STRING_FILTERS.contains, true);
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeTruthy();
headerCheckbox.click();
fix.detectChanges();
headerCheckbox.click();
fix.detectChanges();
expect(headerCheckbox.checked).toBeFalsy();
expect(headerCheckbox.indeterminate).toBeFalsy();
grid.clearFilter("ProductName");
fix.detectChanges();
expect(grid.getRowByIndex(0).isSelected).toBeFalsy();
expect(grid.getRowByIndex(1).isSelected).toBeTruthy();
})); |
<<<<<<<
export class IgxGridSummaryComponent implements IGridBus, AfterContentInit, OnInit, DoCheck {
=======
export class IgxGridSummaryComponent implements IGridBus, OnInit, DoCheck {
>>>>>>>
export class IgxGridSummaryComponent implements IGridBus, OnInit, DoCheck, AfterContentInit {
<<<<<<<
public summaryItemHeight;
=======
>>>>>>>
public summaryItemHeight;
<<<<<<<
ngAfterContentInit() {
this.displayDensity = this.gridAPI.get(this.gridID).displayDensity;
this.summaryItemHeight = this.gridAPI.get(this.gridID).defaultRowHeight;
}
=======
>>>>>>>
ngAfterContentInit() {
this.displayDensity = this.gridAPI.get(this.gridID).displayDensity;
this.summaryItemHeight = this.gridAPI.get(this.gridID).defaultRowHeight;
} |
<<<<<<<
import { GridSelectionMode } from '../types';
=======
import { GridFunctions } from '../../test-utils/grid-functions.spec';
>>>>>>>
import { GridSelectionMode } from '../types';
import { GridFunctions } from '../../test-utils/grid-functions.spec'; |
<<<<<<<
import { IgxAdvancedFilteringDialogComponent } from './filtering/advanced-filtering/advanced-filtering-dialog.component';
import { FilterMode, GridKeydownTargetType, GridSelectionMode, GridSummaryPosition, GridSummaryCalculationMode } from './types';
=======
>>>>>>>
import { IgxAdvancedFilteringDialogComponent } from './filtering/advanced-filtering/advanced-filtering-dialog.component';
<<<<<<<
private _advancedFilteringOverlayId: string;
private _advancedFilteringPositionSettings: PositionSettings = {
verticalDirection: VerticalAlignment.Middle,
horizontalDirection: HorizontalAlignment.Center,
horizontalStartPoint: HorizontalAlignment.Center,
verticalStartPoint: VerticalAlignment.Middle
};
private _advancedFilteringOverlaySettings: OverlaySettings = {
closeOnOutsideClick: false,
modal: false,
positionStrategy: new ConnectedPositioningStrategy(this._advancedFilteringPositionSettings),
};
=======
/**
* @hidden
*/
@ViewChild('defaultExpandedTemplate', { read: TemplateRef, static: true })
protected defaultExpandedTemplate: TemplateRef<any>;
/**
* @hidden
*/
@ViewChild('defaultCollapsedTemplate', { read: TemplateRef, static: true })
protected defaultCollapsedTemplate: TemplateRef<any>;
>>>>>>>
private _advancedFilteringOverlayId: string;
private _advancedFilteringPositionSettings: PositionSettings = {
verticalDirection: VerticalAlignment.Middle,
horizontalDirection: HorizontalAlignment.Center,
horizontalStartPoint: HorizontalAlignment.Center,
verticalStartPoint: VerticalAlignment.Middle
};
private _advancedFilteringOverlaySettings: OverlaySettings = {
closeOnOutsideClick: false,
modal: false,
positionStrategy: new ConnectedPositioningStrategy(this._advancedFilteringPositionSettings),
};
/**
* @hidden
*/
@ViewChild('defaultExpandedTemplate', { read: TemplateRef, static: true })
protected defaultExpandedTemplate: TemplateRef<any>;
/**
* @hidden
*/
@ViewChild('defaultCollapsedTemplate', { read: TemplateRef, static: true })
protected defaultCollapsedTemplate: TemplateRef<any>; |
<<<<<<<
set rowSelection(selectionMode: GridSelectionMode) {
=======
set rowSelection(selectionMode: GridSelectionMode) {
>>>>>>>
set rowSelection(selectionMode: GridSelectionMode) {
<<<<<<<
=======
/**
* Pin the row by its id.
* @remarks
* ID is either the primaryKey value or the data record instance.
* @example
* ```typescript
* this.grid.pinRow(rowID);
* ```
* @param rowID The row id - primaryKey value or the data record instance.
* @param index The index at which to insert the row in the pinned collection.
*/
public pinRow(rowID: any, index?: number): boolean {
const rec = this.gridAPI.get_rec_by_id(rowID);
if (!rec || this.pinnedRecords.indexOf(rec) !== -1 || this.data.indexOf(rec) === -1) {
return false;
}
const row = this.gridAPI.get_row_by_key(rowID);
const eventArgs: IPinRowEventArgs = {
insertAtIndex: index,
isPinned: true,
rowID: rowID,
row: row
};
this.onRowPinning.emit(eventArgs);
this.pinnedRecords.splice(eventArgs.insertAtIndex || this.pinnedRecords.length, 0, rec);
this._pipeTrigger++;
if (this.gridAPI.grid) {
this.notifyChanges(true);
}
}
/**
* Unpin the row by its id.
* @remarks
* ID is either the primaryKey value or the data record instance.
* @example
* ```typescript
* this.grid.unpinRow(rowID);
* ```
* @param rowID The row id - primaryKey value or the data record instance.
*/
public unpinRow(rowID: any) {
const rec = this.gridAPI.get_rec_by_id(rowID);
const index = this.pinnedRecords.indexOf(rec);
if (index === -1 || !rec) {
return false;
}
const row = this.gridAPI.get_row_by_key(rowID);
const eventArgs: IPinRowEventArgs = {
isPinned: false,
rowID: rowID,
row: row
};
this.onRowPinning.emit(eventArgs);
this.pinnedRecords.splice(index, 1);
this._pipeTrigger++;
if (this.gridAPI.grid) {
this.cdr.detectChanges();
this.notifyChanges(true);
}
return true;
}
get pinnedRowHeight() {
const containerHeight = this.pinContainer ? this.pinContainer.nativeElement.offsetHeight : 0;
return this.pinnedRecords.length > 0 ? containerHeight : 0;
}
get totalHeight() {
return this.calcHeight ? this.calcHeight + this.pinnedRowHeight : this.calcHeight;
}
get pinnedBottom() {
const start = this.verticalScrollContainer.state.startIndex;
const end = this.verticalScrollContainer.state.startIndex + this.verticalScrollContainer.state.chunkSize - 1;
const bottom = this.verticalScrollContainer.getScrollForIndex(end, true) - this.verticalScrollContainer.getScrollForIndex(start);
return bottom;
}
>>>>>>>
/**
* Pin the row by its id.
* @remarks
* ID is either the primaryKey value or the data record instance.
* @example
* ```typescript
* this.grid.pinRow(rowID);
* ```
* @param rowID The row id - primaryKey value or the data record instance.
* @param index The index at which to insert the row in the pinned collection.
*/
public pinRow(rowID: any, index?: number): boolean {
const rec = this.gridAPI.get_rec_by_id(rowID);
if (!rec || this.pinnedRecords.indexOf(rec) !== -1 || this.data.indexOf(rec) === -1) {
return false;
}
const row = this.gridAPI.get_row_by_key(rowID);
const eventArgs: IPinRowEventArgs = {
insertAtIndex: index,
isPinned: true,
rowID: rowID,
row: row
};
this.onRowPinning.emit(eventArgs);
this.pinnedRecords.splice(eventArgs.insertAtIndex || this.pinnedRecords.length, 0, rec);
this._pipeTrigger++;
if (this.gridAPI.grid) {
this.notifyChanges(true);
}
}
/**
* Unpin the row by its id.
* @remarks
* ID is either the primaryKey value or the data record instance.
* @example
* ```typescript
* this.grid.unpinRow(rowID);
* ```
* @param rowID The row id - primaryKey value or the data record instance.
*/
public unpinRow(rowID: any) {
const rec = this.gridAPI.get_rec_by_id(rowID);
const index = this.pinnedRecords.indexOf(rec);
if (index === -1 || !rec) {
return false;
}
const row = this.gridAPI.get_row_by_key(rowID);
const eventArgs: IPinRowEventArgs = {
isPinned: false,
rowID: rowID,
row: row
};
this.onRowPinning.emit(eventArgs);
this.pinnedRecords.splice(index, 1);
this._pipeTrigger++;
if (this.gridAPI.grid) {
this.cdr.detectChanges();
this.notifyChanges(true);
}
return true;
}
get pinnedRowHeight() {
const containerHeight = this.pinContainer ? this.pinContainer.nativeElement.offsetHeight : 0;
return this.pinnedRecords.length > 0 ? containerHeight : 0;
}
get totalHeight() {
return this.calcHeight ? this.calcHeight + this.pinnedRowHeight : this.calcHeight;
}
get pinnedBottom() {
const start = this.verticalScrollContainer.state.startIndex;
const end = this.verticalScrollContainer.state.startIndex + this.verticalScrollContainer.state.chunkSize - 1;
const bottom = this.verticalScrollContainer.getScrollForIndex(end, true) - this.verticalScrollContainer.getScrollForIndex(start);
return bottom;
}
<<<<<<<
this.navigation.performHorizontalScrollToCell(visibleColIndex, () => { this.navigateTo(rowIndex, visibleColIndex, cb); });
=======
this.navigation.performHorizontalScrollToCell(rowIndex, visibleColIndex, false,
() => { this.navigateTo(rowIndex, visibleColIndex, cb); });
>>>>>>>
this.navigation.performHorizontalScrollToCell(visibleColIndex, () => { this.navigateTo(rowIndex, visibleColIndex, cb); });
<<<<<<<
=======
public wheelHandler = (isScroll = false) => {
if (this.document.activeElement &&
// tslint:disable-next-line:no-bitwise
(this.document.activeElement.compareDocumentPosition(this.tbody.nativeElement) & Node.DOCUMENT_POSITION_CONTAINS ||
// tslint:disable-next-line:no-bitwise
(this.document.activeElement.
compareDocumentPosition(this.tfoot.nativeElement) & Node.DOCUMENT_POSITION_CONTAINS && isScroll))) {
(this.document.activeElement as HTMLElement).blur();
}
}
/**
* @hidden @internal
*/
>>>>>>> |
<<<<<<<
GridColumnsWidthComponent,
GridAutogeneratedColumnsComponent
=======
GridAutogeneratedColumnsComponent,
GridRemoteVirtualizationComponent
>>>>>>>
GridColumnsWidthComponent,
GridAutogeneratedColumnsComponent,
GridRemoteVirtualizationComponent
<<<<<<<
it("should initialize a grid without scrollbar container", () => {
const fix = TestBed.createComponent(GridColumnsWidthComponent);
fix.detectChanges();
const grid = fix.componentInstance.instance;
const hScrollContainer = fix.debugElement.query(By.css(".igx-grid__scroll"));
expect(hScrollContainer.nativeElement.hidden).toBeTruthy();
grid.columns[2].hidden = false;
grid.columns[3].hidden = false;
fix.detectChanges();
expect(hScrollContainer.nativeElement.hidden).toBeFalsy();
});
=======
it("should initialize grid with remove virtualization", (done) => {
const fix = TestBed.createComponent(GridRemoteVirtualizationComponent);
fix.detectChanges();
let rows = fix.componentInstance.instance.rowList.toArray();
expect(rows.length).toEqual(10);
const verticalScroll = fix.componentInstance.instance.verticalScrollContainer;
const elem = verticalScroll["vh"].instance.elementRef.nativeElement;
// scroll down
expect(() => {
elem.scrollTop = 1000;
fix.detectChanges();
fix.componentRef.hostView.detectChanges();
}).not.toThrow();
setTimeout(() => {
fix.detectChanges();
fix.componentInstance.cdr.detectChanges();
rows = fix.componentInstance.instance.rowList.toArray();
const data = fix.componentInstance.data.source.getValue();
for (let i = fix.componentInstance.instance.virtualizationState.startIndex; i < rows.length; i++) {
expect(rows[i].rowData["Col1"])
.toBe(data[i]["Col1"]);
}
done();
}, 500);
});
>>>>>>>
it("should initialize a grid without scrollbar container", () => {
const fix = TestBed.createComponent(GridColumnsWidthComponent);
fix.detectChanges();
const grid = fix.componentInstance.instance;
const hScrollContainer = fix.debugElement.query(By.css(".igx-grid__scroll"));
expect(hScrollContainer.nativeElement.hidden).toBeTruthy();
grid.columns[2].hidden = false;
grid.columns[3].hidden = false;
fix.detectChanges();
expect(hScrollContainer.nativeElement.hidden).toBeFalsy();
});
it("should initialize grid with remove virtualization", (done) => {
const fix = TestBed.createComponent(GridRemoteVirtualizationComponent);
fix.detectChanges();
let rows = fix.componentInstance.instance.rowList.toArray();
expect(rows.length).toEqual(10);
const verticalScroll = fix.componentInstance.instance.verticalScrollContainer;
const elem = verticalScroll["vh"].instance.elementRef.nativeElement;
// scroll down
expect(() => {
elem.scrollTop = 1000;
fix.detectChanges();
fix.componentRef.hostView.detectChanges();
}).not.toThrow();
setTimeout(() => {
fix.detectChanges();
fix.componentInstance.cdr.detectChanges();
rows = fix.componentInstance.instance.rowList.toArray();
const data = fix.componentInstance.data.source.getValue();
for (let i = fix.componentInstance.instance.virtualizationState.startIndex; i < rows.length; i++) {
expect(rows[i].rowData["Col1"])
.toBe(data[i]["Col1"]);
}
done();
}, 500);
});
<<<<<<<
}
@Component({
template: `
<igx-grid [data]="data" width="600px">
<igx-column field="ID"></igx-column>
<igx-column field="Name" width="200px"></igx-column>
<igx-column field="Value2" width="200px" [hidden]="true"></igx-column>
<igx-column field="Value3" width="200px" [hidden]="true"></igx-column>
<igx-column field="Value3" width="200px" [pinned]=true></igx-column>
</igx-grid>
`
})
export class GridColumnsWidthComponent {
public data = [
{ ID: 1, Name: "Johny", Value2: 1, Value3: 1, Value4: 1 },
{ ID: 2, Name: "Sally", Value2: 1, Value3: 1, Value4: 1 },
{ ID: 3, Name: "Tim", Value2: 1, Value3: 1, Value4: 1 }
];
@ViewChild(IgxGridComponent, { read: IgxGridComponent })
public instance: IgxGridComponent;
=======
}
@Injectable()
export class LocalService {
public records: Observable<any[]>;
private _records: BehaviorSubject<any[]>;
private dataStore: any[];
constructor() {
this.dataStore = [];
this._records = new BehaviorSubject([]);
this.records = this._records.asObservable();
}
public getData(data?: IForOfState, cb?: (any) => void): any {
const size = data.chunkSize === 0 ? 10 : data.chunkSize;
this.dataStore = this.generateData(data.startIndex, data.startIndex + size);
this._records.next(this.dataStore);
const count = 1000;
if (cb) {
cb(count);
}
}
public generateData(start, end) {
const dummyData = [];
for (let i = start; i < end; i++) {
dummyData.push({ Col1: 10 * i});
}
return dummyData;
}
}
@Component({
template: `
<igx-grid [data]="data | async" (onDataPreLoad)="dataLoading($event)" [height]="'600px'">
<igx-column [sortable]="true" [filterable]="true" [field]="'Col1'" [header]="'Col1'">
</igx-column>
</igx-grid>
`,
providers: [LocalService]
})
export class GridRemoteVirtualizationComponent implements OnInit, AfterViewInit {
public data;
@ViewChild(IgxGridComponent, { read: IgxGridComponent })
public instance: IgxGridComponent;
constructor(private localService: LocalService, public cdr: ChangeDetectorRef) { }
public ngOnInit(): void {
this.data = this.localService.records;
}
public ngAfterViewInit() {
this.localService.getData(this.instance.virtualizationState, (count) => {
this.instance.totalItemCount = count;
this.cdr.detectChanges();
});
}
dataLoading(evt) {
this.localService.getData(evt, () => {
this.cdr.detectChanges();
});
}
>>>>>>>
}
const dummyData = [];
for (let i = start; i < end; i++) {
dummyData.push({ Col1: 10 * i});
}
return dummyData;
}
}
@Component({
template: `
<igx-grid [data]="data | async" (onDataPreLoad)="dataLoading($event)" [height]="'600px'">
<igx-column [sortable]="true" [filterable]="true" [field]="'Col1'" [header]="'Col1'">
</igx-column>
</igx-grid>
`,
providers: [LocalService]
})
export class GridRemoteVirtualizationComponent implements OnInit, AfterViewInit {
public data;
@ViewChild(IgxGridComponent, { read: IgxGridComponent })
public instance: IgxGridComponent;
constructor(private localService: LocalService, public cdr: ChangeDetectorRef) { }
public ngOnInit(): void {
this.data = this.localService.records;
}
public ngAfterViewInit() {
this.localService.getData(this.instance.virtualizationState, (count) => {
this.instance.totalItemCount = count;
this.cdr.detectChanges();
});
}
dataLoading(evt) {
this.localService.getData(evt, () => {
this.cdr.detectChanges();
});
}
}
@Component({
template: `
<igx-grid [data]="data" width="600px">
<igx-column field="ID"></igx-column>
<igx-column field="Name" width="200px"></igx-column>
<igx-column field="Value2" width="200px" [hidden]="true"></igx-column>
<igx-column field="Value3" width="200px" [hidden]="true"></igx-column>
<igx-column field="Value3" width="200px" [pinned]=true></igx-column>
</igx-grid>
`
})
export class GridColumnsWidthComponent {
public data = [
{ ID: 1, Name: "Johny", Value2: 1, Value3: 1, Value4: 1 },
{ ID: 2, Name: "Sally", Value2: 1, Value3: 1, Value4: 1 },
{ ID: 3, Name: "Tim", Value2: 1, Value3: 1, Value4: 1 }
];
@ViewChild(IgxGridComponent, { read: IgxGridComponent })
public instance: IgxGridComponent; |
<<<<<<<
=======
private _data: any[];
private _scrollWidth: number;
/**
* An @Input property that lets you fill the `IgxGridComponent` with an array of data.
* ```html
* <igx-grid [data]="Data" [autoGenerate]="true"></igx-grid>
* ```
* @memberof IgxGridBaseComponent
*/
@Input()
public get data(): any[] {
return this._data;
}
public set data(value: any[]) {
this._data = value;
this.summaryService.clearSummaryCache();
}
>>>>>>>
private _scrollWidth: number;
<<<<<<<
this.verticalScrollContainer.onDataChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {
if (this.lastSearchInfo.searchText) {
this.cdr.detectChanges();
this.restoreHighlight(true);
}
});
=======
this.verticalScrollContainer.onDataChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {
this.reflow();
});
>>>>>>>
this.verticalScrollContainer.onDataChanged.pipe(takeUntil(this.destroy$)).subscribe(() => {
if (this.lastSearchInfo.searchText) {
this.restoreHighlight(true);
}
this.reflow();
});
<<<<<<<
public getPossibleColumnWidth(baseWidth: number = null) {
let computedWidth;
if (baseWidth !== null) {
computedWidth = baseWidth;
} else {
computedWidth = parseInt(this.document.defaultView.getComputedStyle(this.nativeElement).getPropertyValue('width'), 10);
}
=======
public getPossibleColumnWidth() {
let computedWidth = this.calcWidth || parseInt(
this.document.defaultView.getComputedStyle(this.nativeElement).getPropertyValue('width'), 10);
>>>>>>>
public getPossibleColumnWidth(baseWidth: number = null) {
let computedWidth;
if (baseWidth !== null) {
computedWidth = baseWidth;
} else {
computedWidth = this.calcWidth ||
parseInt(this.document.defaultView.getComputedStyle(this.nativeElement).getPropertyValue('width'), 10);
} |
<<<<<<<
IgxGridSharedModules,
IgxColumnActionsModule
=======
IgxColumnActionsModule,
IgxColumnHidingModule,
IgxColumnPinningModule,
IgxGridSharedModules
>>>>>>>
IgxColumnActionsModule,
IgxGridSharedModules |
<<<<<<<
import { takeUntil } from 'rxjs/operators';
=======
import { IgxColumnComponent } from '../column.component';
>>>>>>>
import { IgxColumnComponent } from '../column.component';
import { takeUntil } from 'rxjs/operators'; |
<<<<<<<
import { HierarchicalGridRemoteVirtualizationComponent } from './hierarchical-grid-remote-virtualization/hierarchical-grid-remote-virtualization';
=======
import { GridVirtualizationScrollSampleComponent } from './grid-remote-virtualization-with-scroll/grid-remote-virtualization-scroll.sample';
>>>>>>>
import { HierarchicalGridRemoteVirtualizationComponent } from './hierarchical-grid-remote-virtualization/hierarchical-grid-remote-virtualization';
import { GridVirtualizationScrollSampleComponent } from './grid-remote-virtualization-with-scroll/grid-remote-virtualization-scroll.sample'; |
<<<<<<<
import { IForOfState, IgxForOfDirective } from '../directives/for-of/for_of.directive';
import { IgxTextHighlightDirective } from '../directives/text-highlight/text-highlight.directive';
import { IgxBaseExporter } from '../services/index';
=======
import { IgxForOfDirective } from '../directives/for-of/for_of.directive';
import { IForOfState } from '../directives/for-of/IForOfState';
import { IgxTextHighlightDirective } from '../directives/text-highlight/text-highlight.directive';
import { IgxBaseExporter, IgxExporterOptionsBase } from '../services/index';
>>>>>>>
import { IForOfState, IgxForOfDirective } from '../directives/for-of/for_of.directive';
import { IgxTextHighlightDirective } from '../directives/text-highlight/text-highlight.directive';
import { IgxBaseExporter, IgxExporterOptionsBase } from '../services/index'; |
<<<<<<<
import {ViewportAction, ViewportCommand} from "../../../src/features/viewport/viewport"
import {MouseTool} from "../../../src/base/view/mouse-tool"
import {SelectMouseListener} from "../../../src/features/select/select"
import {MoveMouseListener} from "../../../src/features/move"
import {ScrollMouseListener} from "../../../src/features/viewport/scroll"
import {ZoomMouseListener} from "../../../src/features/viewport/zoom"
import {KeyTool} from "../../../src/base/view/key-tool"
import { UndoRedoKeyListener } from "../../../src/features/undo-redo/undo-redo"
import { WebSocketDiagramServer } from "../../../src/remote"
=======
>>>>>>> |
<<<<<<<
public cellInEditMode: IgxGridCellComponent;
public draggedColumn: IgxColumnComponent;
=======
public isColumnMoving: boolean;
>>>>>>>
public draggedColumn: IgxColumnComponent; |
<<<<<<<
@Input()
public primaryKey;
=======
@Input()
public columnWidth: string = null;
>>>>>>>
@Input()
public columnWidth: string = null;
@Input()
public primaryKey;
<<<<<<<
public onRowSelection = new EventEmitter<any>();
@Output()
public onColumnPinning = new EventEmitter<any>();
=======
public onColumnPinning = new EventEmitter<IPinColumnEventArgs>();
>>>>>>>
public onRowSelection = new EventEmitter<any>();
@Output()
public onColumnPinning = new EventEmitter<IPinColumnEventArgs>(); |
<<<<<<<
const FOCUSED_DETAILS_ROW_CLASS = 'igx-grid__tr-container--active';
=======
export const PAGER_CLASS = '.igx-paginator__pager';
>>>>>>>
const FOCUSED_DETAILS_ROW_CLASS = 'igx-grid__tr-container--active';
export const PAGER_CLASS = '.igx-paginator__pager';
<<<<<<<
*/
public static getFilterRow(fix: ComponentFixture<any>): DebugElement {
=======
*/
public static getFilterRow(fix: ComponentFixture<any>): DebugElement {
>>>>>>>
*/
public static getFilterRow(fix: ComponentFixture<any>): DebugElement { |
<<<<<<<
import { cloneArray, KEYS } from '../../../core/utils';
=======
import { FilteringLogic, IFilteringExpression } from '../../../data-operations/filtering-expression.interface';
import { cloneArray, KEYS, resolveNestedPath } from '../../../core/utils';
>>>>>>>
import { cloneArray, KEYS, resolveNestedPath } from '../../../core/utils'; |
<<<<<<<
public static calcMaxSummaryHeight(columnList, summaries: DebugElement[], defaultRowHeight) {
let maxSummaryLength = 0;
let index = 0;
columnList.filter((col) => col.hasSummary).forEach((column) => {
const currentLength = summaries[index].queryAll(By.css(SUMMARY_LABEL_CLASS)).length;
if (maxSummaryLength < currentLength) {
maxSummaryLength = currentLength;
}
index++;
});
const expectedLength = maxSummaryLength * defaultRowHeight;
return expectedLength;
}
=======
public static getRootPinnedSummaryCells(fix): DebugElement[] {
const rootSummaryRow = GridSummaryFunctions.getRootSummaryRow(fix);
return rootSummaryRow.queryAll(By.css(`${SUMMARY_CELL}.${PINNED_SUMMARY}`));
}
>>>>>>>
public static calcMaxSummaryHeight(columnList, summaries: DebugElement[], defaultRowHeight) {
let maxSummaryLength = 0;
let index = 0;
columnList.filter((col) => col.hasSummary).forEach((column) => {
const currentLength = summaries[index].queryAll(By.css(SUMMARY_LABEL_CLASS)).length;
if (maxSummaryLength < currentLength) {
maxSummaryLength = currentLength;
}
index++;
});
const expectedLength = maxSummaryLength * defaultRowHeight;
return expectedLength;
}
public static getRootPinnedSummaryCells(fix): DebugElement[] {
const rootSummaryRow = GridSummaryFunctions.getRootSummaryRow(fix);
return rootSummaryRow.queryAll(By.css(`${SUMMARY_CELL}.${PINNED_SUMMARY}`));
} |
<<<<<<<
protected subscriptionOnEdit$;
protected subscriptionOnAdd$;
protected subscriptionOnDelete$;
protected subscriptionOnFilter$;
public summaryItemHeight;
=======
>>>>>>>
public summaryItemHeight;
<<<<<<<
ngAfterContentInit() {
if (this.column.hasSummary) {
this.subscriptionOnEdit$ = this.gridAPI.get(this.gridID).onEditDone.subscribe((editCell) => {
if (editCell.cell) {
this.fieldName = editCell.cell.column.field;
this.clearCache(editCell.cell.column.field);
} else {
this.clearAll();
}
});
this.subscriptionOnFilter$ = this.gridAPI.get(this.gridID).onFilteringDone.subscribe((data) => {
this.fieldName = data.fieldName;
this.clearAll();
});
this.subscriptionOnAdd$ = this.gridAPI.get(this.gridID).onRowAdded.subscribe(() => this.clearAll());
this.subscriptionOnDelete$ = this.gridAPI.get(this.gridID).onRowDeleted.subscribe(() => this.clearAll());
}
this.displayDensity = this.gridAPI.get(this.gridID).displayDensity;
this.summaryItemHeight = this.gridAPI.get(this.gridID).defaultRowHeight;
}
@autoWire(true)
clearCache(field) {
this.gridAPI.remove_summary(this.gridID, field);
}
@autoWire(true)
clearAll() {
this.gridAPI.remove_summary(this.gridID);
this.gridAPI.get(this.gridID).markForCheck();
this.cdr.detectChanges();
}
=======
>>>>>>>
ngAfterContentInit() {
this.displayDensity = this.gridAPI.get(this.gridID).displayDensity;
this.summaryItemHeight = this.gridAPI.get(this.gridID).defaultRowHeight;
} |
<<<<<<<
GridFunctions.focusCell(fixture, fChildCell);
await wait(100);
fixture.detectChanges();
=======
firstChildCell.nativeElement.focus();
tick();
>>>>>>>
GridFunctions.focusCell(fixture, fChildCell);
await wait(100);
fixture.detectChanges();
<<<<<<<
firstRow = hierarchicalGrid.dataRowList.toArray()[0] as IgxHierarchicalRowComponent;
fCell = firstRow.cells.toArray()[0];
GridFunctions.focusCell(fixture, fCell);
await wait(100);
fixture.detectChanges();
expect(fChildCell.selected).toBeFalsy();
expect(fCell.selected).toBeTruthy();
=======
firstRow = hierarchicalGrid.dataRowList.first as IgxHierarchicalRowComponent;
firstCell = firstRow.cells.first;
firstCell.nativeElement.focus();
tick();
expect(firstChildCell.selected).toBeFalsy();
expect(firstCell.selected).toBeTruthy();
>>>>>>>
firstRow = hierarchicalGrid.dataRowList.toArray()[0] as IgxHierarchicalRowComponent;
fCell = firstRow.cells.toArray()[0];
GridFunctions.focusCell(fixture, fCell);
await wait(100);
fixture.detectChanges();
expect(fChildCell.selected).toBeFalsy();
expect(fCell.selected).toBeTruthy();
<<<<<<<
UIInteractions.triggerEventHandlerKeyDown('arrowdown', baseHGridContent, true, false, false);
fixture.detectChanges();
childRows = fixture.debugElement.queryAll(By.directive(IgxChildGridRowComponent));
expect(childRows.length).toEqual(0);
=======
>>>>>>>
<<<<<<<
UIInteractions.triggerEventHandlerKeyDown('arrowdown', baseHGridContent, true, false, false);
fixture.detectChanges();
=======
hierarchicalGrid.expandRow(dataRows.last.rowID);
>>>>>>>
hierarchicalGrid.expandRow(dataRows.last.rowID);
<<<<<<<
let fChildCell = childGrid.dataRowList.toArray()[0].cells.toArray()[0];
GridFunctions.focusCell(fixture, fChildCell);
fixture.detectChanges();
expect(fChildCell.selected).toBe(true);
=======
let firstChildCell = childGrid.dataRowList.first.cells.first;
UIInteractions.simulateClickAndSelectCellEvent(firstChildCell);
expect(firstChildCell.selected).toBe(true);
// apply some filter
>>>>>>>
let fChildCell = childGrid.dataRowList.toArray()[0].cells.toArray()[0];
GridFunctions.focusCell(fixture, fChildCell);
fixture.detectChanges();
expect(fChildCell.selected).toBe(true); |
<<<<<<<
=======
* The default aria role attribute for the component.
*
* @hidden
* @internal
*/
@HostBinding('attr.role')
public role = 'grid';
/**
* The default aria lebelled by attribute for the component.
*
* @hidden
* @internal
*/
@HostBinding('attr.aria-labelledby')
public ariaLabelledBy = 'calendar';
/**
>>>>>>>
<<<<<<<
public getPrevMonth(date): Date {
return this.calendarModel.getPrevMonth(date)
}
/**
* @hidden
* @internal
*/
public getNextMonth(date, viewIndex): Date {
return this.calendarModel.getDateByView(date, 'Month', viewIndex)
}
/**
* @hidden
* @internal
*/
public activeDate = new Date().toLocaleDateString();
/**
* @hidden
* @internal
*/
=======
public activeDate = new Date().toLocaleDateString();
/**
* @hidden
* @internal
*/
>>>>>>>
public getPrevMonth(date): Date {
return this.calendarModel.getPrevMonth(date)
}
/**
* @hidden
* @internal
*/
public getNextMonth(date, viewIndex): Date {
return this.calendarModel.getDateByView(date, 'Month', viewIndex)
}
/**
* @hidden
* @internal
*/
public activeDate = new Date().toLocaleDateString();
/**
* @hidden
* @internal
*/ |
<<<<<<<
AfterViewInit,
Renderer2,
Directive,
HostListener,
TemplateRef
=======
Renderer2
>>>>>>>
Renderer2,
TemplateRef |
<<<<<<<
const grid = fix.componentInstance.grid;
grid.sort('Name', SortingDirection.Asc, true);
=======
const grid = fix.componentInstance.grid1;
grid.sort({fieldName: 'Name', dir: SortingDirection.Asc, ignoreCase: true});
>>>>>>>
const grid = fix.componentInstance.grid;
grid.sort({fieldName: 'Name', dir: SortingDirection.Asc, ignoreCase: true});
<<<<<<<
const grid = fix.componentInstance.grid;
grid.sort('Name', SortingDirection.Asc, true);
=======
const grid = fix.componentInstance.grid1;
grid.sort({fieldName: 'Name', dir: SortingDirection.Asc, ignoreCase: true});
>>>>>>>
const grid = fix.componentInstance.grid;
grid.sort({fieldName: 'Name', dir: SortingDirection.Asc, ignoreCase: true}); |
<<<<<<<
import { IgxGridCellComponent, IGridCellEventArgs } from '../grid';
=======
import { IgxSummaryCellComponent } from '../summaries/summary-cell.component';
const DEBOUNCE_TIME = 60;
const CHIP_ITEM_CLASS = '.igx-chip__item';
const FILTER_CELL_CLASS = '.igx-grid__filtering-cell';
>>>>>>>
import { IgxGridCellComponent, IGridCellEventArgs } from '../grid';
const DEBOUNCE_TIME = 60;
<<<<<<<
const childFirstCell = childGrid.dataRowList.toArray()[0].cells.toArray()[0];
GridFunctions.focusCell(fixture, childFirstCell);
fixture.detectChanges();
=======
const childFirstCell = childGrid.getCellByKey(0, 'ID');
childFirstCell.onFocus(null);
>>>>>>>
const childFirstCell = childGrid.dataRowList.toArray()[0].cells.toArray()[0];
GridFunctions.focusCell(fixture, childFirstCell);
fixture.detectChanges();
<<<<<<<
const selectedCell = fixture.componentInstance.selectedCell;
const gridOffsets = hierarchicalGrid.tbody.nativeElement.getBoundingClientRect();
const rowOffsets = selectedCell.row.nativeElement.getBoundingClientRect();
expect(rowOffsets.top >= gridOffsets.top && rowOffsets.bottom <= gridOffsets.bottom).toBeTruthy();
=======
expect(getScrollTop(hierarchicalGrid)).toBeGreaterThanOrEqual(childGrid.rowHeight);
>>>>>>>
const selectedCell = fixture.componentInstance.selectedCell;
const gridOffsets = hierarchicalGrid.tbody.nativeElement.getBoundingClientRect();
const rowOffsets = selectedCell.row.nativeElement.getBoundingClientRect();
expect(rowOffsets.top >= gridOffsets.top && rowOffsets.bottom <= gridOffsets.bottom).toBeTruthy();
<<<<<<<
const childCell = childGrid.dataRowList.toArray()[4].cells.toArray()[0];
GridFunctions.focusCell(fixture, childCell);
await wait(100);
=======
const childCell = childGrid.getCellByKey(2, 'ID');
childCell.onFocus(null);
>>>>>>>
const childCell = childGrid.dataRowList.toArray()[4].cells.toArray()[0];
GridFunctions.focusCell(fixture, childCell);
await wait(DEBOUNCE_TIME);
<<<<<<<
=======
it('should allow navigation with Tab from parent into child.', (async () => {
// scroll to last column
const horizontalScrDir = hierarchicalGrid.dataRowList.toArray()[0].virtDirRow;
horizontalScrDir.scrollTo(6);
await wait(DEBOUNCE_TIME);
fixture.detectChanges();
const lastCell = hierarchicalGrid.getCellByKey(0, 'childData2');
// lastCell.onFocus(null);
fixture.detectChanges();
GridFunctions.simulateCellKeydown(lastCell, 'Tab');
fixture.detectChanges();
const childGrid = hierarchicalGrid.hgridAPI.getChildGrids(false)[0];
const childFirstCell = childGrid.getCellByKey(0, 'ID');
expect(childFirstCell.selected).toBe(true);
expect(childFirstCell.focused).toBe(true);
}));
it('should allow navigation with Shift+Tab from child into parent grid.', (async () => {
const childGrid = hierarchicalGrid.hgridAPI.getChildGrids(false)[0];
const childFirstCell = childGrid.getCellByKey(0, 'ID');
childFirstCell.onFocus(null);
fixture.detectChanges();
GridFunctions.simulateCellKeydown(childFirstCell, 'Tab', false, true);
await wait(DEBOUNCE_TIME);
fixture.detectChanges();
const lastCell = hierarchicalGrid.getCellByKey(0, 'childData2');
expect(lastCell.selected).toBe(true);
expect(lastCell.focused).toBe(true);
}));
it('should allow navigation with Tab from child into parent row.', (async () => {
hierarchicalGrid.verticalScrollContainer.scrollTo(2);
await wait(DEBOUNCE_TIME);
fixture.detectChanges();
const childGrid = hierarchicalGrid.hgridAPI.getChildGrids(false)[0];
const horizontalScrDir = childGrid.dataRowList.toArray()[0].virtDirRow;
horizontalScrDir.scrollTo(6);
await wait(DEBOUNCE_TIME);
fixture.detectChanges();
const childLastCell = childGrid.getCellByColumn(9, 'childData2');
childLastCell.onFocus(null);
fixture.detectChanges();
GridFunctions.simulateCellKeydown(childLastCell, 'Tab');
fixture.detectChanges();
const nextCell = hierarchicalGrid.getCellByKey(1, 'ID');
expect(nextCell.selected).toBe(true);
expect(nextCell.focused).toBe(true);
}));
it('should allow navigation with Shift+Tab from parent into child grid.', (async () => {
hierarchicalGrid.verticalScrollContainer.scrollTo(2);
await wait(DEBOUNCE_TIME);
fixture.detectChanges();
const parentCell = hierarchicalGrid.getCellByKey(1, 'ID');
// parentCell.onFocus(null);
fixture.detectChanges();
GridFunctions.simulateCellKeydown(parentCell, 'Tab', false, true);
await wait(DEBOUNCE_TIME);
fixture.detectChanges();
// last cell in child should be focused
const childGrid = hierarchicalGrid.hgridAPI.getChildGrids(false)[0];
const childLastCell = childGrid.getCellByColumn(9, 'childData2');
expect(childLastCell.selected).toBe(true);
expect(childLastCell.focused).toBe(true);
}));
it('should include summary rows in tab sequence.', (async () => {
const childGrid = hierarchicalGrid.hgridAPI.getChildGrids(false)[0];
childGrid.getColumnByName('ID').hasSummary = true;
fixture.detectChanges();
await wait(DEBOUNCE_TIME);
hierarchicalGrid.verticalScrollContainer.scrollTo(2);
await wait(DEBOUNCE_TIME);
fixture.detectChanges();
const parentCell = hierarchicalGrid.getCellByKey(1, 'ID');
GridFunctions.simulateCellKeydown(parentCell, 'Tab', false, true);
await wait(DEBOUNCE_TIME);
fixture.detectChanges();
const summaryCells = fixture.debugElement.queryAll(By.directive(IgxSummaryCellComponent));
const lastSummaryCell = summaryCells[summaryCells.length - 1];
expect(document.activeElement).toBe(lastSummaryCell.nativeElement);
// UIInteractions.triggerEventHandlerKeyDownWithBlur('Tab', lastSummaryCell);
fixture.detectChanges();
expect(parentCell.selected).toBe(true);
expect(parentCell.focused).toBe(true);
}));
>>>>>>>
<<<<<<<
GridFunctions.focusCell(fixture, parentCell);
=======
// parentCell.onFocus(null);
>>>>>>>
GridFunctions.focusCell(fixture, parentCell);
<<<<<<<
UIInteractions.triggerEventHandlerKeyDown('arrowdown', baseHGridContent, true, false, false);
=======
GridFunctions.simulateCellKeydown(parentCell, 'ArrowDown', true);
>>>>>>>
UIInteractions.triggerEventHandlerKeyDown('arrowdown', baseHGridContent, true, false, false);
<<<<<<<
UIInteractions.triggerEventHandlerKeyDown('arrowup', baseHGridContent, false, false, false);
await wait(100);
=======
GridFunctions.simulateCellKeydown(parentCell2, 'ArrowUp');
await wait(DEBOUNCE_TIME);
>>>>>>>
UIInteractions.triggerEventHandlerKeyDown('arrowup', baseHGridContent, false, false, false);
await wait(DEBOUNCE_TIME);
<<<<<<<
=======
expect(parentCell.focused).toBeTruthy();
>>>>>>>
<<<<<<<
GridFunctions.focusCell(fixture, fchildRowCell);
fixture.detectChanges();
const childGridContent = fixture.debugElement.queryAll(By.css(GRID_CONTENT_CLASS))[1];
UIInteractions.triggerEventHandlerKeyDown('arrowdown', childGridContent, false, false, false);
await wait(100);
=======
GridFunctions.simulateCellKeydown(fchildRowCell, 'ArrowDown');
await wait(DEBOUNCE_TIME);
>>>>>>>
GridFunctions.focusCell(fixture, fchildRowCell);
fixture.detectChanges();
const childGridContent = fixture.debugElement.queryAll(By.css(GRID_CONTENT_CLASS))[1];
UIInteractions.triggerEventHandlerKeyDown('arrowdown', childGridContent, false, false, false);
await wait(DEBOUNCE_TIME);
<<<<<<<
UIInteractions.triggerEventHandlerKeyDown('arrowleft', footerContent, false, false, true);
await wait(100);
=======
GridFunctions.simulateCellKeydown(lastCell, 'ArrowLeft', false, false, true);
await wait(DEBOUNCE_TIME);
>>>>>>>
UIInteractions.triggerEventHandlerKeyDown('arrowleft', footerContent, false, false, true);
await wait(DEBOUNCE_TIME);
<<<<<<<
GridFunctions.focusCell(fixture, cellID);
fixture.detectChanges();
UIInteractions.triggerEventHandlerKeyDown('end', baseHGridContent, false, false, false);
await wait(100);
=======
GridFunctions.simulateCellKeydown(cellID, 'End');
await wait(DEBOUNCE_TIME);
>>>>>>>
GridFunctions.focusCell(fixture, cellID);
fixture.detectChanges();
UIInteractions.triggerEventHandlerKeyDown('end', baseHGridContent, false, false, false);
await wait(DEBOUNCE_TIME);
<<<<<<<
UIInteractions.triggerEventHandlerKeyDown('arrowup', nestedChildGridContent, false, false, false);
fixture.detectChanges();
await wait(100);
=======
GridFunctions.simulateCellKeydown(nextCell, 'ArrowUp');
await wait(DEBOUNCE_TIME);
>>>>>>>
UIInteractions.triggerEventHandlerKeyDown('arrowup', nestedChildGridContent, false, false, false);
fixture.detectChanges();
await wait(DEBOUNCE_TIME);
<<<<<<<
expect(child.verticalScrollContainer.getScroll().scrollTop).toBe(nestedChildCell.row.nativeElement.clientHeight);
const nextCell = nestedChild.dataRowList.toArray()[2].cells.toArray()[0];
=======
expect(getScrollTop(child)).toBe(nestedChildCell.row.nativeElement.offsetHeight);
const nextCell = nestedChild.getCellByKey(2, 'ID');
>>>>>>>
expect(child.verticalScrollContainer.getScroll().scrollTop).toBe(nestedChildCell.row.nativeElement.clientHeight);
const nextCell = nestedChild.dataRowList.toArray()[2].cells.toArray()[0];
<<<<<<<
const child2 = hierarchicalGrid.hgridAPI.getChildGrids(false)[5];
=======
>>>>>>>
const child2 = hierarchicalGrid.hgridAPI.getChildGrids(false)[5];
<<<<<<<
const parentCell = hierarchicalGrid.dataRowList.toArray()[1].cells.toArray()[0];
GridFunctions.focusCell(fixture, parentCell);
await wait(100);
=======
const parentCell = hierarchicalGrid.getCellByKey(1, 'ID');
// parentCell.onFocus(null);
>>>>>>>
const parentCell = hierarchicalGrid.dataRowList.toArray()[1].cells.toArray()[0];
GridFunctions.focusCell(fixture, parentCell);
await wait(DEBOUNCE_TIME);
<<<<<<<
const parentCell = hierarchicalGrid.dataRowList.toArray()[0].cells.toArray()[0];
GridFunctions.focusCell(fixture, parentCell);
await wait(100);
=======
const parentCell = hierarchicalGrid.getCellByKey(0, 'ID');
// parentCell.onFocus(null);
>>>>>>>
const parentCell = hierarchicalGrid.dataRowList.toArray()[0].cells.toArray()[0];
GridFunctions.focusCell(fixture, parentCell);
await wait(DEBOUNCE_TIME);
<<<<<<<
UIInteractions.triggerEventHandlerKeyDown('arrowdown', baseHGridContent, false, false, false);
await wait(100);
=======
GridFunctions.simulateCellKeydown(parentCell, 'ArrowDown');
await wait(DEBOUNCE_TIME);
>>>>>>>
UIInteractions.triggerEventHandlerKeyDown('arrowdown', baseHGridContent, false, false, false);
await wait(DEBOUNCE_TIME);
<<<<<<<
const childGrid2 = hierarchicalGrid.hgridAPI.getChildGrids(false)[5];
=======
const childGrid2 = hierarchicalGrid.hgridAPI.getChildGrids(false)[4];
>>>>>>>
const childGrid2 = hierarchicalGrid.hgridAPI.getChildGrids(false)[5];
<<<<<<<
<igx-hierarchical-grid #grid1 [data]="data" (onSelection)='onSelection($event)'
[autoGenerate]="true" [height]="'400px'" [width]="'500px'" #hierarchicalGrid primaryKey="ID" [expandChildren]='true'>
<igx-row-island (onSelection)='onSelection($event)' [key]="'childData'" [autoGenerate]="true" [height]="null" #rowIsland>
<igx-row-island (onSelection)='onSelection($event)' [key]="'childData'" [autoGenerate]="true" [height]="null" #rowIsland2 >
=======
<igx-hierarchical-grid #grid1 [data]="data"
[autoGenerate]="true" [height]="'600px'" [width]="'800px'" #hierarchicalGrid primaryKey="ID" [expandChildren]='true'>
<igx-row-island [key]="'childData'" [autoGenerate]="true" [height]="null" primaryKey="ID" #rowIsland>
<igx-row-island [key]="'childData'" [autoGenerate]="true" [height]="null"primaryKey="ID" >
>>>>>>>
<igx-hierarchical-grid #grid1 [data]="data" (onSelection)='onSelection($event)'
[autoGenerate]="true" [height]="'400px'" [width]="'500px'" #hierarchicalGrid primaryKey="ID" [expandChildren]='true'>
<igx-row-island (onSelection)='onSelection($event)' [key]="'childData'" [autoGenerate]="true" [height]="null" #rowIsland>
<igx-row-island (onSelection)='onSelection($event)' [key]="'childData'" [autoGenerate]="true" [height]="null" #rowIsland2 > |
<<<<<<<
=======
private d$ = new Subject<boolean>();
>>>>>>>
<<<<<<<
*
* @memberof IgxToastComponent
=======
* @memberof IgxGridCellComponent
>>>>>>>
*
* @memberof IgxToastComponent
<<<<<<<
* Wraps @hide() method due @IToggleView interface implementation.
*
* @hidden
=======
* Hides the toast.
* ```typescript
* this.toast.close();
* ```
>>>>>>>
* Hides the toast.
*
* ```typescript
* this.toast.close();
* ``` |
<<<<<<<
=======
import {selectConfig} from '../selectors';
import {ExpandedType} from 'compassql/build/src/query/expandedtype';
>>>>>>> |
<<<<<<<
import { IgxStringFilteringOperand } from '../../data-operations/filtering-condition';
=======
import { IgxGridTransaction } from '../tree-grid';
import { IgxTransactionService } from '../../services';
>>>>>>>
import { IgxGridTransaction } from '../tree-grid';
import { IgxTransactionService } from '../../services';
import { IgxStringFilteringOperand } from '../../data-operations/filtering-condition'; |
<<<<<<<
/**
* @hidden
*/
protected setEventBusSubscription() {
this.eventBus.pipe(
debounceTime(DEBOUNCE_TIME),
takeUntil(this.destroy$)
).subscribe(() => this.cdr.detectChanges());
}
/**
* @hidden
*/
protected setVerticalScrollSubscription() {
/*
Until the grid component is destroyed,
Take the first event and unsubscribe
then merge with an empty observable after DEBOUNCE_TIME,
re-subscribe and repeat the process
*/
this.verticalScrollContainer.onChunkLoad.pipe(
takeUntil(this.destroy$),
take(1),
merge(of({})),
delay(DEBOUNCE_TIME),
repeat()
).subscribe(() => {
this.eventBus.next();
});
}
/**
* @hidden
*/
=======
>>>>>>>
/**
* @hidden
*/
protected setEventBusSubscription() {
this.eventBus.pipe(
debounceTime(DEBOUNCE_TIME),
takeUntil(this.destroy$)
).subscribe(() => this.cdr.detectChanges());
}
/**
* @hidden
*/
protected setVerticalScrollSubscription() {
/*
Until the grid component is destroyed,
Take the first event and unsubscribe
then merge with an empty observable after DEBOUNCE_TIME,
re-subscribe and repeat the process
*/
this.verticalScrollContainer.onChunkLoad.pipe(
takeUntil(this.destroy$),
take(1),
merge(of({})),
delay(DEBOUNCE_TIME),
repeat()
).subscribe(() => {
this.eventBus.next();
});
}
/**
* @hidden
*/ |
<<<<<<<
export interface IGridDataBindable {
data: any[];
filteredData: any[];
}
/**
* @hidden
* @internal
*/
export interface GridType extends IGridDataBindable {
=======
export interface GridType {
id: string;
>>>>>>>
export interface IGridDataBindable {
data: any[];
filteredData: any[];
}
/**
* @hidden
* @internal
*/
export interface GridType extends IGridDataBindable {
id: string; |
<<<<<<<
=======
});
}));
// Rendering
it('All appropriate classes should be applied on combo initialization', () => {
const defaultComboWidth = '250px';
const defaultComboDDWidth = '100%';
const fix = TestBed.createComponent(IgxComboScrollTestComponent);
fix.detectChanges();
const comboWrapper = fix.nativeElement.querySelector(CSS_CLASS_COMBO);
expect(comboWrapper).not.toBeNull();
expect(comboWrapper.style.width).toEqual(defaultComboWidth);
expect(comboWrapper.attributes.getNamedItem('ng-reflect-placeholder').nodeValue).toEqual('Items');
expect(comboWrapper.attributes.getNamedItem('ng-reflect-data').nodeValue).toEqual('Item 1,Item 2,Item 3');
expect(comboWrapper.attributes.getNamedItem('ng-reflect-filterable')).toBeTruthy();
expect(comboWrapper.childElementCount).toEqual(1);
const comboElement = comboWrapper.children[0];
expect(comboElement.attributes.getNamedItem('class').nodeValue).toEqual(CSS_CLASS_COMBO);
expect(comboElement.attributes.getNamedItem('role').nodeValue).toEqual('combobox');
expect(comboElement.style.width).toEqual(defaultComboWidth);
expect(comboElement.attributes.getNamedItem('aria-haspopup').nodeValue).toEqual('listbox');
expect(comboElement.attributes.getNamedItem('aria-expanded').nodeValue).toEqual('false');
expect(comboElement.attributes.getNamedItem('aria-owns').nodeValue).toEqual('DropDown_0');
expect(comboElement.childElementCount).toEqual(2);
const inputGroupElement = comboElement.children[0];
expect(inputGroupElement.attributes.getNamedItem('ng-reflect-type').nodeValue).toEqual('box');
expect(inputGroupElement.classList.contains(CSS_CLASS_INPUTGROUP)).toBeTruthy();
expect(inputGroupElement.classList.contains('igx-input-group--box')).toBeTruthy();
expect(inputGroupElement.classList.contains('igx-input-group--placeholder')).toBeTruthy();
expect(inputGroupElement.childElementCount).toEqual(1);
const inputGroupWrapper = inputGroupElement.children[0];
expect(inputGroupWrapper.classList.contains(CSS_CLASS_INPUTGROUP_WRAPPER)).toBeTruthy();
expect(inputGroupWrapper.childElementCount).toEqual(2);
const inputGroupBundle = inputGroupWrapper.children[0];
expect(inputGroupBundle.classList.contains(CSS_CLASS_INPUTGROUP_BUNDLE)).toBeTruthy();
expect(inputGroupBundle.childElementCount).toEqual(2);
const mainInputGroupBundle = inputGroupBundle.children[0];
expect(mainInputGroupBundle.classList.contains(CSS_CLASS_INPUTGROUP_MAINBUNDLE)).toBeTruthy();
expect(mainInputGroupBundle.childElementCount).toEqual(1);
const inputElement = mainInputGroupBundle.children[0];
expect(inputElement.classList.contains('igx-input-group__input')).toBeTruthy();
expect(inputElement.classList.contains('ng-untouched')).toBeTruthy();
expect(inputElement.classList.contains('ng-pristine')).toBeTruthy();
expect(inputElement.classList.contains('ng-valid')).toBeTruthy();
expect(inputElement.attributes.getNamedItem('type').nodeValue).toEqual('text');
expect(inputElement.attributes.getNamedItem('width').nodeValue).toEqual('90%');
const dropDownButton = inputGroupBundle.children[1];
expect(dropDownButton.classList.contains(CSS_CLASS_DROPDOWNBUTTON)).toBeTruthy();
expect(dropDownButton.classList.contains(CSS_CLASS_INPUTGROUP_BUNDLESUFFIX)).toBeTruthy();
expect(dropDownButton.childElementCount).toEqual(1);
const inputGroupBorder = inputGroupWrapper.children[1];
expect(inputGroupBorder.classList.contains(CSS_CLASS_INPUTGROUP_BORDER)).toBeTruthy();
expect(inputGroupBorder.childElementCount).toEqual(0);
const dropDownWrapper = comboElement.children[1];
expect(dropDownWrapper.classList.contains(CSS_CLASS_COMBO_DROPDOWN)).toBeTruthy();
expect(dropDownWrapper.attributes.getNamedItem('ng-reflect-width').nodeValue).toEqual(defaultComboDDWidth);
expect(dropDownWrapper.childElementCount).toEqual(1);
const dropDownElement = dropDownWrapper.children[0];
expect(dropDownElement.classList.contains(CSS_CLASS_DROPDOWN)).toBeTruthy();
expect(dropDownElement.childElementCount).toEqual(1);
const dropDownList = dropDownElement.children[0];
expect(dropDownList.classList.contains(CSS_CLASS_DROPDOWNLIST)).toBeTruthy();
expect(dropDownList.classList.contains('igx-toggle--hidden')).toBeTruthy();
expect(dropDownList.style.width).toEqual(defaultComboDDWidth);
expect(dropDownList.childElementCount).toEqual(0);
});
it('Should properly render grouped items', fakeAsync(() => {
const fix = TestBed.createComponent(IgxComboInputTestComponent);
fix.detectChanges();
const combo = fix.componentInstance.combo;
combo.dropdown.toggle();
tick();
fix.whenStable().then(() => {
fix.detectChanges();
const dropdownContainer = fix.debugElement.query(By.css('.' + CSS_CLASS_CONTAINER)).nativeElement;
checkGroupedItemsClass(0, 5, dropdownContainer);
checkGroupedItemsClass(6, 10, dropdownContainer);
// combo.dropdown.navigateLast();
// fix.detectChanges();
// return fix.whenStable();
// }).then(() => {
// TO DO
// Navigate down and check the rest of the items
});
>>>>>>>
<<<<<<<
=======
const item_3 = dropdownItems[1];
checkbox_3 = item_3.querySelector('.' + CSS_CLASS_CHECKBOX) as HTMLElement;
checkbox_3.click();
fixture.detectChanges();
return fixture.whenStable();
}).then(() => {
expect(inputElement.value).toEqual('Paris, Oslo, Sofia');
checkbox_2.click();
fixture.detectChanges();
return fixture.whenStable();
}).then(() => {
expect(inputElement.value).toEqual('Paris, Sofia');
const item_4 = dropdownItems[8];
checkbox_4 = item_4.querySelector('.' + CSS_CLASS_CHECKBOX) as HTMLElement;
checkbox_4.click();
fixture.detectChanges();
return fixture.whenStable();
}).then(() => {
expect(inputElement.value).toEqual('Paris, Sofia, Los Angeles');
checkbox_3.click();
fixture.detectChanges();
return fixture.whenStable();
}).then(() => {
expect(inputElement.value).toEqual('Paris, Los Angeles');
checkbox_1.click();
fixture.detectChanges();
return fixture.whenStable();
}).then(() => {
expect(inputElement.value).toEqual('Los Angeles');
checkbox_4.click();
fixture.detectChanges();
return fixture.whenStable();
}).then(() => {
expect(inputElement.value).toEqual('');
});
}));
it('Clear button should dismiss all selected items', fakeAsync(() => {
const expectedOutput = 'Paris, Oslo, Sofia';
const fixture = TestBed.createComponent(IgxComboTestComponent);
fixture.detectChanges();
const combo = fixture.componentInstance.combo;
const input = fixture.debugElement.query(By.css('input[name=\'comboInput\']'));
const inputElement = input.nativeElement;
let checkbox_1: HTMLElement;
let checkbox_2: HTMLElement;
let checkbox_3: HTMLElement;
let dropdownItem_1;
let dropdownItem_2;
let dropdownItem_3;
combo.dropdown.toggle();
tick();
fixture.whenStable().then(() => {
fixture.detectChanges();
const dropdownList = fixture.debugElement.query(By.css('.' + CSS_CLASS_DROPDOWNLIST)).nativeElement;
const dropdownItems = dropdownList.querySelectorAll('.' + CSS_CLASS_DROPDOWNLISTITEM);
const item_1 = dropdownItems[3];
dropdownItem_1 = combo.data[3];
checkbox_1 = item_1.querySelector('.' + CSS_CLASS_CHECKBOX) as HTMLElement;
checkbox_1.click();
fixture.detectChanges();
expect(checkbox_1.classList.contains(CSS_CLASS_CHECKED)).toBeTruthy();
expect(combo.isItemSelected(combo.data[3])).toBeTruthy();
expect(combo.selectedItems()[0]).toEqual('Paris');
const item_2 = dropdownItems[7];
dropdownItem_2 = combo.data[7];
checkbox_2 = item_2.querySelector('.' + CSS_CLASS_CHECKBOX) as HTMLElement;
checkbox_2.click();
fixture.detectChanges();
expect(checkbox_2.classList.contains(CSS_CLASS_CHECKED)).toBeTruthy();
expect(combo.isItemSelected(dropdownItem_2)).toBeTruthy();
expect(combo.selectedItems()[1]).toEqual('Oslo');
const item_3 = dropdownItems[1];
dropdownItem_3 = combo.data[1];
checkbox_3 = item_3.querySelector('.' + CSS_CLASS_CHECKBOX) as HTMLElement;
checkbox_3.click();
fixture.detectChanges();
expect(checkbox_3.classList.contains(CSS_CLASS_CHECKED)).toBeTruthy();
expect(combo.isItemSelected(dropdownItem_3)).toBeTruthy();
expect(combo.selectedItems()[2]).toEqual('Sofia');
return fixture.whenStable();
}).then(() => {
expect(inputElement.value).toEqual(expectedOutput);
const clearButton = fixture.debugElement.query(By.css('.' + CSS_CLASS_CLEARBUTTON)).nativeElement;
clearButton.click();
fixture.detectChanges();
return fixture.whenStable();
}).then(() => {
expect(inputElement.value).toEqual('');
expect(checkbox_1.classList.contains(CSS_CLASS_CHECKED)).toBeFalsy();
expect(combo.isItemSelected(dropdownItem_1)).toBeFalsy();
expect(checkbox_2.classList.contains(CSS_CLASS_CHECKED)).toBeFalsy();
expect(combo.isItemSelected(dropdownItem_2)).toBeFalsy();
expect(checkbox_3.classList.contains(CSS_CLASS_CHECKED)).toBeFalsy();
expect(combo.isItemSelected(dropdownItem_3)).toBeFalsy();
expect(combo.selectedItems().length).toEqual(0);
});
}));
it('Clear button should not throw exception when no items are selected', () => {
const fixture = TestBed.createComponent(IgxComboTestComponent);
fixture.detectChanges();
const clearButton = fixture.debugElement.query(By.css('.' + CSS_CLASS_CLEARBUTTON));
expect(clearButton).toBeNull();
});
it('Item selection - checkbox', fakeAsync(() => {
const expectedOutput = 'Paris, Oslo, Sofia';
const fixture = TestBed.createComponent(IgxComboTestComponent);
fixture.detectChanges();
const combo = fixture.componentInstance.combo;
let checkbox_1: HTMLElement;
let checkbox_2: HTMLElement;
let checkbox_3: HTMLElement;
let dropdownItem_2;
let dropdownItem_3;
combo.dropdown.toggle();
tick();
fixture.whenStable().then(() => {
fixture.detectChanges();
>>>>>>>
<<<<<<<
let addItem;
const combo = fix.componentInstance.combo;
combo.dropdown.toggle();
tick();
fix.whenStable().then(() => {
fix.detectChanges();
addItem = fix.debugElement.query(By.css('.igx-combo__add'));
expect(addItem).toEqual(null);
expect(combo.children.length).toBeTruthy();
combo.searchInput.nativeElement.value = 'New';
combo.searchInput.nativeElement.dispatchEvent(new Event('input', {}));
tick();
return fix.whenStable();
}).then(() => {
fix.detectChanges();
expect(combo.searchValue).toEqual('New');
addItem = fix.debugElement.query(By.css('.igx-combo__add'));
expect(addItem === null).toBeFalsy();
expect(combo.children.length).toBeTruthy();
combo.searchInput.nativeElement.value = 'New York';
combo.searchInput.nativeElement.dispatchEvent(new Event('input', {}));
tick();
return fix.whenStable();
}).then(() => {
fix.detectChanges();
expect(combo.searchValue).toEqual('New York');
return fix.whenStable();
}).then(() => {
fix.detectChanges();
addItem = fix.debugElement.query(By.css('.igx-combo__add'));
expect(addItem).toEqual(null);
expect(combo.children.length).toBeTruthy();
});
}));
});
=======
addItem = fix.debugElement.query(By.css('.igx-combo__add'));
expect(addItem).toEqual(null);
expect(combo.children.length).toBeTruthy();
});
}));
// Form control
it('Should properly initialize when used as a form control', fakeAsync(() => {
const fix = TestBed.createComponent(IgxComboFormComponent);
fix.detectChanges();
const combo = fix.componentInstance.combo;
expect(combo).toBeDefined();
const comboFormReference = fix.componentInstance.reactiveForm.controls.townCombo;
expect(comboFormReference).toBeDefined();
expect(combo.selectedItems()).toEqual(comboFormReference.value);
expect(combo.selectedItems().length).toEqual(1);
expect(combo.selectedItems()[0].field).toEqual('Connecticut');
expect(combo.valid).toEqual(IgxComboState.INITIAL);
const clearButton = fix.debugElement.query(By.css('.' + CSS_CLASS_CLEARBUTTON)).nativeElement;
clearButton.click();
fix.detectChanges();
fix.whenStable().then(() => {
fix.detectChanges();
expect(combo.valid).toEqual(IgxComboState.INVALID);
combo.selectItems([combo.dropdown.items[0], combo.dropdown.items[1]]);
expect(combo.valid).toEqual(IgxComboState.VALID);
});
}));
>>>>>>>
let addItem;
const combo = fix.componentInstance.combo;
combo.dropdown.toggle();
tick();
fix.whenStable().then(() => {
fix.detectChanges();
addItem = fix.debugElement.query(By.css('.igx-combo__add'));
expect(addItem).toEqual(null);
expect(combo.children.length).toBeTruthy();
combo.searchInput.nativeElement.value = 'New';
combo.searchInput.nativeElement.dispatchEvent(new Event('input', {}));
tick();
return fix.whenStable();
}).then(() => {
fix.detectChanges();
expect(combo.searchValue).toEqual('New');
addItem = fix.debugElement.query(By.css('.igx-combo__add'));
expect(addItem === null).toBeFalsy();
expect(combo.children.length).toBeTruthy();
combo.searchInput.nativeElement.value = 'New York';
combo.searchInput.nativeElement.dispatchEvent(new Event('input', {}));
tick();
return fix.whenStable();
}).then(() => {
fix.detectChanges();
expect(combo.searchValue).toEqual('New York');
return fix.whenStable();
}).then(() => {
fix.detectChanges();
addItem = fix.debugElement.query(By.css('.igx-combo__add'));
expect(addItem).toEqual(null);
expect(combo.children.length).toBeTruthy();
});
}));
}); |
<<<<<<<
import { IgxDropDownItemComponent, IgxDropDownItemBase } from './drop-down-item.component';
=======
import { IgxDropDownItemComponent } from './drop-down-item.component';
import { IPositionStrategy } from '../services/overlay/position/IPositionStrategy';
import { OverlaySettings } from '../services';
>>>>>>>
import { IgxDropDownItemComponent, IgxDropDownItemBase } from './drop-down-item.component';
import { IPositionStrategy } from '../services/overlay/position/IPositionStrategy';
import { OverlaySettings } from '../services';
<<<<<<<
export class IgxDropDownBase implements IToggleView, OnInit {
=======
@Component({
selector: 'igx-drop-down',
templateUrl: './drop-down.component.html'
})
export class IgxDropDownComponent implements OnInit {
>>>>>>>
export class IgxDropDownBase implements OnInit { |
<<<<<<<
IgxGridFilteringESFTemplatesComponent,
IgxGridFilteringESFLoadOnDemandComponent
=======
IgxGridFilteringESFTemplatesComponent,
IgxGridFilteringMCHComponent
>>>>>>>
IgxGridFilteringESFTemplatesComponent,
IgxGridFilteringESFLoadOnDemandComponent,
IgxGridFilteringMCHComponent
<<<<<<<
describe('Load values on demand', () => {
let fix, grid;
beforeEach(fakeAsync(() => {
fix = TestBed.createComponent(IgxGridFilteringESFLoadOnDemandComponent);
grid = fix.componentInstance.grid;
fix.detectChanges();
}));
it('Verify unique values are loaded correctly in ESF search component.', fakeAsync(() => {
// Open excel style custom filtering dialog and wait a bit.
GridFunctions.clickExcelFilterIcon(fix, 'ProductName');
fix.detectChanges();
tick(400);
// Verify items in search have not loaded yet and that the loading indicator is visible.
const searchComponent = GridFunctions.getExcelStyleSearchComponent(fix);
let listItems = searchComponent.querySelectorAll('igx-list-item');
expect(listItems.length).toBe(0, 'incorrect rendered list items count');
let loadingIndicator = GridFunctions.getExcelFilteringLoadingIndicator(fix);
expect(loadingIndicator).not.toBeNull('esf loading indicator is not visible');
// Wait for items to load.
tick(650);
// Verify items in search have loaded and that the loading indicator is not visible.
listItems = searchComponent.querySelectorAll('igx-list-item');
expect(listItems.length).toBe(6, 'incorrect rendered list items count');
loadingIndicator = GridFunctions.getExcelFilteringLoadingIndicator(fix);
expect(loadingIndicator).toBeNull('esf loading indicator is visible');
}));
});
=======
describe(null, () => {
let fix, grid;
beforeEach(fakeAsync(() => {
fix = TestBed.createComponent(IgxGridFilteringMCHComponent);
grid = fix.componentInstance.grid;
grid.filterMode = FilterMode.excelStyleFilter;
fix.detectChanges();
}));
it('Should not pin column when its parent group cannot be pinned.', fakeAsync(() => {
// Test prerequisites
grid.width = '1000px';
fix.detectChanges();
tick(100);
// Pin the 'AnotherField' column.
GridFunctions.clickExcelFilterIcon(fix, 'AnotherField');
fix.detectChanges();
GridFunctions.clickPinIconInExcelStyleFiltering(fix, false);
tick(200);
fix.detectChanges();
// Verify that the 'ProductName' pin button is disabled, because its parent column cannot be pinned.
GridFunctions.clickExcelFilterIcon(fix, 'ProductName');
fix.detectChanges();
const pinButton = GridFunctions.getExcelFilteringPinContainer(fix);
expect(pinButton.classList.contains('igx-excel-filter__actions-pin--disabled')).toBe(true,
'pinButton should be disabled');
}));
});
>>>>>>>
describe('Load values on demand', () => {
let fix, grid;
beforeEach(fakeAsync(() => {
fix = TestBed.createComponent(IgxGridFilteringESFLoadOnDemandComponent);
grid = fix.componentInstance.grid;
fix.detectChanges();
}));
it('Verify unique values are loaded correctly in ESF search component.', fakeAsync(() => {
// Open excel style custom filtering dialog and wait a bit.
GridFunctions.clickExcelFilterIcon(fix, 'ProductName');
fix.detectChanges();
tick(400);
// Verify items in search have not loaded yet and that the loading indicator is visible.
const searchComponent = GridFunctions.getExcelStyleSearchComponent(fix);
let listItems = searchComponent.querySelectorAll('igx-list-item');
expect(listItems.length).toBe(0, 'incorrect rendered list items count');
let loadingIndicator = GridFunctions.getExcelFilteringLoadingIndicator(fix);
expect(loadingIndicator).not.toBeNull('esf loading indicator is not visible');
// Wait for items to load.
tick(650);
// Verify items in search have loaded and that the loading indicator is not visible.
listItems = searchComponent.querySelectorAll('igx-list-item');
expect(listItems.length).toBe(6, 'incorrect rendered list items count');
loadingIndicator = GridFunctions.getExcelFilteringLoadingIndicator(fix);
expect(loadingIndicator).toBeNull('esf loading indicator is visible');
}));
});
describe(null, () => {
let fix, grid;
beforeEach(fakeAsync(() => {
fix = TestBed.createComponent(IgxGridFilteringMCHComponent);
grid = fix.componentInstance.grid;
grid.filterMode = FilterMode.excelStyleFilter;
fix.detectChanges();
}));
it('Should not pin column when its parent group cannot be pinned.', fakeAsync(() => {
// Test prerequisites
grid.width = '1000px';
fix.detectChanges();
tick(100);
// Pin the 'AnotherField' column.
GridFunctions.clickExcelFilterIcon(fix, 'AnotherField');
fix.detectChanges();
GridFunctions.clickPinIconInExcelStyleFiltering(fix, false);
tick(200);
fix.detectChanges();
// Verify that the 'ProductName' pin button is disabled, because its parent column cannot be pinned.
GridFunctions.clickExcelFilterIcon(fix, 'ProductName');
fix.detectChanges();
const pinButton = GridFunctions.getExcelFilteringPinContainer(fix);
expect(pinButton.classList.contains('igx-excel-filter__actions-pin--disabled')).toBe(true,
'pinButton should be disabled');
}));
}); |
<<<<<<<
import { Component, DebugElement, OnInit, ViewChild } from "@angular/core";
=======
import { Component, DebugElement, ViewChild, OnInit } from "@angular/core";
>>>>>>>
import { Component, DebugElement, OnInit, ViewChild } from "@angular/core";
<<<<<<<
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 4) {
if (width >= minWidth) {
=======
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 4) {
if (width === minWidth || width > minWidth) {
>>>>>>>
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 4) {
if (width >= minWidth) {
<<<<<<<
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 4) {
if (width >= minWidth) {
=======
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 4) {
if (width === minWidth || width > minWidth) {
>>>>>>>
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 4) {
if (width >= minWidth) {
<<<<<<<
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 4) {
if (width >= minWidth) {
=======
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 4) {
if (width === minWidth || width > minWidth) {
>>>>>>>
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 4) {
if (width >= minWidth) {
<<<<<<<
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 3 && column.index !== 5 &&
column.index !== 10 && column.index !== 25) {
if (width >= minWidth) {
expect(true);
} else {
expect(false);
}
=======
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 3 && column.index !== 5 &&
column.index !== 10 && column.index !== 25) {
if (width === minWidth || width > minWidth) {
expect(true);
} else {
expect(false);
}
>>>>>>>
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 3 && column.index !== 5 &&
column.index !== 10 && column.index !== 25) {
if (width >= minWidth) {
expect(true);
} else {
expect(false);
}
<<<<<<<
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 3 && column.index !== 5 &&
column.index !== 10 && column.index !== 25) {
if (width >= minWidth) {
expect(true);
} else {
expect(false);
}
=======
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 3 && column.index !== 5 &&
column.index !== 10 && column.index !== 25) {
if (width === minWidth || width > minWidth) {
expect(true);
} else {
expect(false);
}
>>>>>>>
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 3 && column.index !== 5 &&
column.index !== 10 && column.index !== 25) {
if (width >= minWidth) {
expect(true);
} else {
expect(false);
}
<<<<<<<
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 3 && column.index !== 5 &&
column.index !== 10 && column.index !== 50) {
if (width >= minWidth) {
expect(true);
} else {
expect(false);
}
=======
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 3 && column.index !== 5 &&
column.index !== 10 && column.index !== 50) {
if (width === minWidth || width > minWidth) {
expect(true);
} else {
expect(false);
}
>>>>>>>
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 3 && column.index !== 5 &&
column.index !== 10 && column.index !== 50) {
if (width >= minWidth) {
expect(true);
} else {
expect(false);
}
<<<<<<<
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 3 && column.index !== 5 &&
column.index !== 10 && column.index !== 50) {
if (width >= minWidth) {
expect(true);
} else {
expect(false);
}
=======
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 3 && column.index !== 5 &&
column.index !== 10 && column.index !== 50) {
if (width === minWidth || width > minWidth) {
expect(true);
} else {
expect(false);
}
>>>>>>>
const width = parseInt(column.width, 10);
const minWidth = parseInt(MIN_COL_WIDTH, 10);
if (column.index !== 0 && column.index !== 3 && column.index !== 5 &&
column.index !== 10 && column.index !== 50) {
if (width >= minWidth) {
expect(true);
} else {
expect(false);
}
<<<<<<<
ngOnInit() {
=======
ngOnInit() {
>>>>>>>
ngOnInit() {
<<<<<<<
}
=======
}
>>>>>>>
}
<<<<<<<
const data = [];
const cols = [];
=======
>>>>>>>
const data = [];
const cols = [];
<<<<<<<
=======
>>>>>>> |
<<<<<<<
set filteringExpressions(value) {
this._filteringExpressions = cloneArray(value);
this.cdr.markForCheck();
=======
set filteringExpressionsTree(value) {
if (value) {
this._filteringExpressionsTree = value;
this.clearSummaryCache();
this._pipeTrigger++;
this.cdr.markForCheck();
}
>>>>>>>
set filteringExpressionsTree(value) {
if (value) {
this._filteringExpressionsTree = value;
this.clearSummaryCache();
this._pipeTrigger++;
this.cdr.markForCheck();
}
<<<<<<<
protected _groupBy(expression: ISortingExpression) {
this.gridAPI.groupBy(this.id, expression.fieldName, expression.dir, expression.ignoreCase);
}
protected _groupByMultiple(expressions: ISortingExpression[]) {
this.gridAPI.groupBy_multiple(this.id, expressions);
}
protected _getStateForGroupRow(groupRow: IGroupByRecord): IGroupByExpandState {
return this.gridAPI.groupBy_get_expanded_for_group(this.id, groupRow);
}
protected _toggleGroup(groupRow: IGroupByRecord) {
this.gridAPI.groupBy_toggle_group(this.id, groupRow);
}
protected _applyGrouping() {
this.gridAPI.sort_multiple(this.id, this._groupingExpressions);
}
protected _filter(name: string, value: any, condition?: IFilteringOperation, ignoreCase?: boolean) {
const col = this.gridAPI.get_column_by_name(this.id, name);
if (col) {
this.gridAPI
.filter(this.id, name, value,
condition || col.filteringCondition, ignoreCase || col.filteringIgnoreCase);
} else {
this.gridAPI.filter(this.id, name, value, condition, ignoreCase);
}
}
protected _filterMultiple(expressions: IFilteringExpression[]) {
this.gridAPI.filter_multiple(this.id, expressions);
}
=======
>>>>>>>
protected _groupBy(expression: ISortingExpression) {
this.gridAPI.groupBy(this.id, expression.fieldName, expression.dir, expression.ignoreCase);
}
protected _groupByMultiple(expressions: ISortingExpression[]) {
this.gridAPI.groupBy_multiple(this.id, expressions);
}
protected _getStateForGroupRow(groupRow: IGroupByRecord): IGroupByExpandState {
return this.gridAPI.groupBy_get_expanded_for_group(this.id, groupRow);
}
protected _toggleGroup(groupRow: IGroupByRecord) {
this.gridAPI.groupBy_toggle_group(this.id, groupRow);
}
protected _applyGrouping() {
this.gridAPI.sort_multiple(this.id, this._groupingExpressions);
} |
<<<<<<<
import { cloneArray } from '../../core/utils';
import { DataUtil } from '../../data-operations/data-util';
=======
import { IgxColumnComponent, IgxColumnGroupComponent } from '../grid';
>>>>>>>
import { cloneArray } from '../../core/utils';
import { DataUtil } from '../../data-operations/data-util';
import { IgxColumnComponent, IgxColumnGroupComponent } from '../grid';
<<<<<<<
public get grid(): IgxGridBaseComponent & IGridDataBindable {
=======
public get displayContainerWidth() {
return parseInt(this.grid.parentVirtDir.dc.instance._viewContainer.element.nativeElement.offsetWidth, 10);
}
public get displayContainerScrollLeft() {
return parseInt(this.grid.parentVirtDir.getHorizontalScroll().scrollLeft, 10);
}
public get unpinnedFilterableColumns() {
return this.grid.unpinnedColumns.filter(col => !(col instanceof IgxColumnGroupComponent) && col.filterable);
}
public get unpinnedColumns() {
return this.grid.unpinnedColumns.filter(col => !(col instanceof IgxColumnGroupComponent));
}
public get grid(): IgxGridBaseComponent {
>>>>>>>
public get displayContainerWidth() {
return parseInt(this.grid.parentVirtDir.dc.instance._viewContainer.element.nativeElement.offsetWidth, 10);
}
public get displayContainerScrollLeft() {
return parseInt(this.grid.parentVirtDir.getHorizontalScroll().scrollLeft, 10);
}
public get unpinnedFilterableColumns() {
return this.grid.unpinnedColumns.filter(col => !(col instanceof IgxColumnGroupComponent) && col.filterable);
}
public get unpinnedColumns() {
return this.grid.unpinnedColumns.filter(col => !(col instanceof IgxColumnGroupComponent));
}
public get grid(): IgxGridBaseComponent & IGridDataBindable {
<<<<<<<
public resolveFilteredSortedData(): any[] {
let data: any[] = this.filteredData ? this.filteredData : this.grid.data;
if (!this.filteredData && this.grid.transactions.enabled) {
data = DataUtil.mergeTransactions(
cloneArray(data),
this.grid.transactions.getAggregatedChanges(true),
this.grid.primaryKey
);
}
return data;
}
public get filteredData() {
return this.grid.filteredData;
}
=======
/**
* Scrolls to a filterCell.
*/
public scrollToFilterCell(column: IgxColumnComponent, shouldFocusNext: boolean) {
this.grid.nativeElement.focus({preventScroll: true});
this.columnToFocus = column;
this.shouldFocusNext = shouldFocusNext;
let currentColumnRight = 0;
let currentColumnLeft = 0;
for (let index = 0; index < this.unpinnedColumns.length; index++) {
currentColumnRight += parseInt(this.unpinnedColumns[index].width, 10);
if (this.unpinnedColumns[index] === column) {
currentColumnLeft = currentColumnRight - parseInt(this.unpinnedColumns[index].width, 10);
break;
}
}
const forOfDir = this.grid.headerContainer;
const width = this.displayContainerWidth + this.displayContainerScrollLeft;
if (shouldFocusNext) {
forOfDir.getHorizontalScroll().scrollLeft += currentColumnRight - width;
} else {
forOfDir.getHorizontalScroll().scrollLeft = currentColumnLeft;
}
}
>>>>>>>
public resolveFilteredSortedData(): any[] {
let data: any[] = this.filteredData ? this.filteredData : this.grid.data;
if (!this.filteredData && this.grid.transactions.enabled) {
data = DataUtil.mergeTransactions(
cloneArray(data),
this.grid.transactions.getAggregatedChanges(true),
this.grid.primaryKey
);
}
return data;
}
public get filteredData() {
return this.grid.filteredData;
}
/**
* Scrolls to a filterCell.
*/
public scrollToFilterCell(column: IgxColumnComponent, shouldFocusNext: boolean) {
this.grid.nativeElement.focus({preventScroll: true});
this.columnToFocus = column;
this.shouldFocusNext = shouldFocusNext;
let currentColumnRight = 0;
let currentColumnLeft = 0;
for (let index = 0; index < this.unpinnedColumns.length; index++) {
currentColumnRight += parseInt(this.unpinnedColumns[index].width, 10);
if (this.unpinnedColumns[index] === column) {
currentColumnLeft = currentColumnRight - parseInt(this.unpinnedColumns[index].width, 10);
break;
}
}
const forOfDir = this.grid.headerContainer;
const width = this.displayContainerWidth + this.displayContainerScrollLeft;
if (shouldFocusNext) {
forOfDir.getHorizontalScroll().scrollLeft += currentColumnRight - width;
} else {
forOfDir.getHorizontalScroll().scrollLeft = currentColumnLeft;
}
} |
<<<<<<<
@Output()
public onGroupingDone = new EventEmitter<any>();
=======
@Output()
public onDataPreLoad = new EventEmitter<any>();
@Output()
public onColumnResized = new EventEmitter<IColumnResizeEventArgs>();
@Output()
public onContextMenu = new EventEmitter<IGridCellEventArgs>();
>>>>>>>
@Output()
public onGroupingDone = new EventEmitter<any>();
@Output()
public onDataPreLoad = new EventEmitter<any>();
@Output()
public onColumnResized = new EventEmitter<IColumnResizeEventArgs>();
@Output()
public onContextMenu = new EventEmitter<IGridCellEventArgs>();
<<<<<<<
=======
@Input()
get sortingExpressions() {
return this._sortingExpressions;
}
set sortingExpressions(value) {
this._sortingExpressions = cloneArray(value);
this.cdr.markForCheck();
}
get virtualizationState() {
return this.verticalScrollContainer.state;
}
set virtualizationState(state) {
this.verticalScrollContainer.state = state;
}
get totalItemCount() {
return this.verticalScrollContainer.totalItemCount;
}
set totalItemCount(count) {
this.verticalScrollContainer.totalItemCount = count;
this.cdr.detectChanges();
}
>>>>>>>
get virtualizationState() {
return this.verticalScrollContainer.state;
}
set virtualizationState(state) {
this.verticalScrollContainer.state = state;
}
get totalItemCount() {
return this.verticalScrollContainer.totalItemCount;
}
set totalItemCount(count) {
this.verticalScrollContainer.totalItemCount = count;
this.cdr.detectChanges();
}
<<<<<<<
protected _groupingExpressions = [];
protected _groupingExpandState: IGroupByExpandState[] = [];
=======
private _filteredData = null;
>>>>>>>
protected _groupingExpressions = [];
protected _groupingExpandState: IGroupByExpandState[] = [];
private _filteredData = null; |
<<<<<<<
export * from './navbar/navbar.component';
export * from './directives/filter.directive';
export * from './directives/ripple.directive';
export * from './badge/badge.component';
=======
export * from './navbar/navbar';
export * from './directives/filter';
export * from './directives/ripple';
export * from './badge/badge';
export * from './snackbar/snackbar.component';
>>>>>>>
export * from './navbar/navbar.component';
export * from './directives/filter.directive';
export * from './directives/ripple.directive';
export * from './badge/badge.component';
export * from './snackbar/snackbar.component'; |
<<<<<<<
protected getPossibleColumnWidth(baseWidth: number = null) {
let computedWidth;
if (baseWidth !== null) {
computedWidth = baseWidth;
} else {
computedWidth = parseInt(this.document.defaultView.getComputedStyle(this.nativeElement).getPropertyValue('width'), 10);
}
=======
public getPossibleColumnWidth() {
let computedWidth = parseInt(
this.document.defaultView.getComputedStyle(this.nativeElement).getPropertyValue('width'), 10);
>>>>>>>
public getPossibleColumnWidth(baseWidth: number = null) {
let computedWidth;
if (baseWidth !== null) {
computedWidth = baseWidth;
} else {
computedWidth = parseInt(this.document.defaultView.getComputedStyle(this.nativeElement).getPropertyValue('width'), 10);
} |
<<<<<<<
it("should use default column width for cells with width in %.", () => {
const fix = TestBed.createComponent(VirtualtGridComponent);
fix.componentInstance.defaultWidth = "25%";
fix.detectChanges();
const rows = fix.componentInstance.instance.rowList;
rows.forEach((item) => {
expect(item.cells.last.width).toEqual("25%");
});
});
=======
it("should fit last cell in the available display container when there is vertical and horizontal scroll.", async(() => {
const fix = TestBed.createComponent(VirtualtGridComponent);
fix.componentInstance.cols = fix.componentInstance.generateCols(100);
fix.componentInstance.data = fix.componentInstance.generateData(1000);
fix.detectChanges();
const grid = fix.componentInstance.instance;
const rows = fix.nativeElement.querySelectorAll("igx-grid-row");
const firsCell = rows[1].querySelectorAll("igx-grid-cell")[0];
expect(firsCell.textContent.trim()).toEqual("0");
fix.componentInstance.scrollLeft(999999);
fix.whenStable().then(() => {
// This won't work always in debugging mode due to the angular native events behavior, so errors are expected
fix.detectChanges();
const lastCell = rows[1].querySelectorAll("igx-grid-cell")[3];
const verticalScroll = grid.verticalScrollContainer.getVerticalScroll();
expect(lastCell.textContent.trim()).toEqual("990");
// Calculate where the end of the cell is. Relative left position should equal the grid calculated width
expect(lastCell.getBoundingClientRect().left +
lastCell.offsetWidth +
verticalScroll.offsetWidth).toEqual(grid.calcWidth);
});
}));
>>>>>>>
it("should use default column width for cells with width in %.", () => {
const fix = TestBed.createComponent(VirtualtGridComponent);
fix.componentInstance.defaultWidth = "25%";
fix.detectChanges();
const rows = fix.componentInstance.instance.rowList;
rows.forEach((item) => {
expect(item.cells.last.width).toEqual("25%");
});
});
it("should fit last cell in the available display container when there is vertical and horizontal scroll.", async(() => {
const fix = TestBed.createComponent(VirtualtGridComponent);
fix.componentInstance.cols = fix.componentInstance.generateCols(100);
fix.componentInstance.data = fix.componentInstance.generateData(1000);
fix.detectChanges();
const grid = fix.componentInstance.instance;
const rows = fix.nativeElement.querySelectorAll("igx-grid-row");
const firsCell = rows[1].querySelectorAll("igx-grid-cell")[0];
expect(firsCell.textContent.trim()).toEqual("0");
fix.componentInstance.scrollLeft(999999);
fix.whenStable().then(() => {
// This won't work always in debugging mode due to the angular native events behavior, so errors are expected
fix.detectChanges();
const lastCell = rows[1].querySelectorAll("igx-grid-cell")[3];
const verticalScroll = grid.verticalScrollContainer.getVerticalScroll();
expect(lastCell.textContent.trim()).toEqual("990");
// Calculate where the end of the cell is. Relative left position should equal the grid calculated width
expect(lastCell.getBoundingClientRect().left +
lastCell.offsetWidth +
verticalScroll.offsetWidth).toEqual(grid.calcWidth);
});
}));
<<<<<<<
<igx-grid [height]="'300px'" [width]="'800px'" [columnWidth]="defaultWidth" [data]="data" [autoGenerate]="true"
(onSelection)="cellSelected($event)">
=======
<igx-grid [height]="gridHeight" [width]="gridWidth" [data]="data" (onSelection)="cellSelected($event)">
<igx-column *ngFor="let c of cols" [field]="c.field" [header]="c.field" [width]="c.width">
</igx-column>
>>>>>>>
<igx-grid [height]="'300px'" [width]="'800px'" [columnWidth]="defaultWidth" [data]="data" [autoGenerate]="true"
(onSelection)="cellSelected($event)">
<<<<<<<
public cols = [{ field: "index" }, { field: "value" }, { field: "other" }, { field: "another"}];
public defaultWidth = "200px";
=======
public cols = [
{ field: "index", width: "200px" },
{ field: "value", width: "200px" },
{ field: "other", width: "200px" },
{ field: "another", width: "200px" }
];
>>>>>>>
public cols = [{ field: "index" }, { field: "value" }, { field: "other" }, { field: "another"}];
public defaultWidth = "200px"; |
<<<<<<<
const collection = record.parent ? record.parent.data[this.childDataKey] : this.data;
index = this.primaryKey ?
collection.map(c => c[this.primaryKey]).indexOf(rowID) :
collection.indexOf(rowID);
=======
const childData = record.parent ? record.parent.data[this.childDataKey] : this.data;
index = this.primaryKey ? childData.map(c => c[this.primaryKey]).indexOf(rowID) :
childData.indexOf(rowID);
const selectedChildren = [];
this._gridAPI.get_selected_children(this.id, record, selectedChildren);
if (selectedChildren.length > 0) {
this.deselectRows(selectedChildren);
}
>>>>>>>
const collection = record.parent ? record.parent.data[this.childDataKey] : this.data;
index = this.primaryKey ?
collection.map(c => c[this.primaryKey]).indexOf(rowID) :
collection.indexOf(rowID);
const selectedChildren = [];
this._gridAPI.get_selected_children(this.id, record, selectedChildren);
if (selectedChildren.length > 0) {
this.deselectRows(selectedChildren);
} |
<<<<<<<
collectionViewModel(collectionRep: CollectionMember, routeData: PaneRouteData): CollectionViewModel;
listPlaceholderViewModel(routeData : PaneRouteData): CollectionPlaceholderViewModel;
=======
collectionViewModel(collection: CollectionMember, routeData: PaneRouteData): CollectionViewModel;
listViewModel($scope: ng.IScope, collection: ListRepresentation, routeData: PaneRouteData, recreate: (scope: INakedObjectsScope, page: number, newPageSize: number, newState?: CollectionViewState) => void): CollectionViewModel;
collectionPlaceholderViewModel(scope: INakedObjectsScope, page: number, reload: (scope: INakedObjectsScope) => void): CollectionPlaceholderViewModel;
>>>>>>>
collectionViewModel(collectionRep: CollectionMember, routeData: PaneRouteData): CollectionViewModel;
listPlaceholderViewModel(routeData : PaneRouteData): CollectionPlaceholderViewModel;
<<<<<<<
itemViewModel(linkRep: Link, paneId: number, selected: boolean): ItemViewModel;
linkViewModel(linkRep: Link, paneId: number): LinkViewModel;
=======
>>>>>>>
itemViewModel(linkRep: Link, paneId: number, selected: boolean): ItemViewModel;
linkViewModel(linkRep: Link, paneId: number): LinkViewModel;
<<<<<<<
=======
const currentLvms: CollectionViewModel[] = [];
function getCollectionViewModel(scope: INakedObjectsScope, obj: ListRepresentation, routeData: PaneRouteData) {
const paneId = routeData.paneId;
const currentLvm = currentLvms[paneId];
if (currentLvm && currentLvm.isSame(paneId, collectionId(routeData))) {
currentLvm.refreshState(scope, routeData);
return { collectionViewModel: currentLvm, ret: true };
}
const lvm = new CollectionViewModel();
currentLvms[paneId] = lvm;
return { collectionViewModel: lvm, ret: false };
}
>>>>>>>
<<<<<<<
=======
>>>>>>> |
<<<<<<<
it('should pin an unpinned column when drag/drop it among pinned columns.', (async() => {
const fix = TestBed.createComponent(GridRightPinningComponent);
fix.detectChanges();
const grid = fix.componentInstance.instance;
grid.pinning = { columns: ColumnPinningPosition.End };
fix.detectChanges();
await wait();
fix.detectChanges();
// move 'ID' column to the pinned area
grid.moveColumn(grid.getColumnByName('ID'), grid.getColumnByName('ContactName'));
fix.detectChanges();
// verify column is pinned at the correct place
expect(grid.pinnedColumns[0].field).toEqual('CompanyName');
expect(grid.pinnedColumns[1].field).toEqual('ID');
expect(grid.pinnedColumns[2].field).toEqual('ContactName');
expect(grid.getColumnByName('ID').pinned).toBeTruthy();
}));
});
=======
>>>>>>>
it('should pin an unpinned column when drag/drop it among pinned columns.', (async() => {
const fix = TestBed.createComponent(GridRightPinningComponent);
fix.detectChanges();
const grid = fix.componentInstance.instance;
grid.pinning = { columns: ColumnPinningPosition.End };
fix.detectChanges();
await wait();
fix.detectChanges();
// move 'ID' column to the pinned area
grid.moveColumn(grid.getColumnByName('ID'), grid.getColumnByName('ContactName'));
fix.detectChanges();
// verify column is pinned at the correct place
expect(grid.pinnedColumns[0].field).toEqual('CompanyName');
expect(grid.pinnedColumns[1].field).toEqual('ID');
expect(grid.pinnedColumns[2].field).toEqual('ContactName');
expect(grid.getColumnByName('ID').pinned).toBeTruthy();
})); |
<<<<<<<
public onChipRemoveMove() {
// We don't remove chip if user starting touch interacting on the remove button moves the chip
this._movedWhileRemoving = true;
}
public onChipRemoveEnd() {
if (!this._movedWhileRemoving) {
this.onChipRemove();
}
this._movedWhileRemoving = false;
}
=======
/**
* @hidden
*/
>>>>>>>
/**
* @hidden
*/
public onChipRemoveMove() {
// We don't remove chip if user starting touch interacting on the remove button moves the chip
this._movedWhileRemoving = true;
}
/**
* @hidden
*/
public onChipRemoveEnd() {
if (!this._movedWhileRemoving) {
this.onChipRemove();
}
this._movedWhileRemoving = false;
}
/**
* @hidden
*/ |
<<<<<<<
=======
get columnHiding() {
return this._columnHiding;
}
set columnHiding(value) {
this._columnHiding = value;
if (this.gridAPI.get(this.id)) {
this.markForCheck();
}
}
public get displayDensity(): DisplayDensity | string {
return this._displayDensity;
}
public set displayDensity(val: DisplayDensity | string) {
switch (val) {
case 'compact':
this._displayDensity = DisplayDensity.compact;
break;
case 'cosy':
this._displayDensity = DisplayDensity.cosy;
break;
case 'comfortable':
default:
this._displayDensity = DisplayDensity.comfortable;
}
}
@Input()
>>>>>>>
get columnHiding() {
return this._columnHiding;
}
set columnHiding(value) {
this._columnHiding = value;
if (this.gridAPI.get(this.id)) {
this.markForCheck();
}
}
@Input() |
<<<<<<<
igx_grid_watermark_placeholder?: string;
=======
igx_grid_pinned_row_indicator?: string;
>>>>>>>
igx_grid_watermark_placeholder?: string;
igx_grid_pinned_row_indicator?: string;
<<<<<<<
igx_grid_advanced_filter_value_placeholder: 'Value',
igx_grid_watermark_placeholder: 'Text Message'
=======
igx_grid_advanced_filter_value_placeholder: 'Value',
igx_grid_pinned_row_indicator: 'Pinned'
>>>>>>>
igx_grid_advanced_filter_value_placeholder: 'Value',
igx_grid_watermark_placeholder: 'Text Message',
igx_grid_pinned_row_indicator: 'Pinned' |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.