Skip to content

Commit c2f3146

Browse files
committed
feat(overlay): remove row editing outlet
1 parent 20cc250 commit c2f3146

File tree

6 files changed

+6
-44
lines changed

6 files changed

+6
-44
lines changed

projects/igniteui-angular/grids/grid/src/grid-base.directive.ts

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,6 @@ interface IMatchInfoCache {
131131
let FAKE_ROW_ID = -1;
132132
const DEFAULT_ITEMS_PER_PAGE = 15;
133133
const MINIMUM_COLUMN_WIDTH = 136;
134-
// By default row editing overlay outlet is inside grid body so that overlay is hidden below grid header when scrolling.
135-
// In cases when grid has 1-2 rows there isn't enough space in grid body and row editing overlay should be shown above header.
136-
// Default row editing overlay height is higher then row height that is why the case is valid also for row with 2 rows.
137-
// More accurate calculation is not possible, cause row editing overlay is still not shown and we don't know its height,
138-
// but in the same time we need to set row editing overlay outlet before opening the overlay itself.
139-
const MIN_ROW_EDITING_COUNT_THRESHOLD = 2;
140134

141135
/* blazorIndirectRender
142136
blazorComponent
@@ -1347,12 +1341,6 @@ export abstract class IgxGridBaseDirective implements GridType,
13471341
@ViewChild('tfoot', { static: true })
13481342
public tfoot: ElementRef<HTMLElement>;
13491343

1350-
/**
1351-
* @hidden @internal
1352-
*/
1353-
@ViewChild('igxRowEditingOverlayOutlet', { read: IgxOverlayOutletDirective, static: true })
1354-
public rowEditingOutletDirective: IgxOverlayOutletDirective;
1355-
13561344
/**
13571345
* @hidden @internal
13581346
*/
@@ -2683,20 +2671,6 @@ export abstract class IgxGridBaseDirective implements GridType,
26832671
this._rowSelectorTemplate = template;
26842672
}
26852673

2686-
/**
2687-
* @hidden @internal
2688-
*/
2689-
public get rowOutletDirective() {
2690-
return this.rowEditingOutletDirective;
2691-
}
2692-
2693-
/**
2694-
* @hidden @internal
2695-
*/
2696-
public get parentRowOutletDirective() {
2697-
return this.outlet;
2698-
}
2699-
27002674
/**
27012675
* @hidden @internal
27022676
*/
@@ -3323,7 +3297,6 @@ export abstract class IgxGridBaseDirective implements GridType,
33233297
scrollStrategy: new AbsoluteScrollStrategy(),
33243298
modal: false,
33253299
closeOnOutsideClick: false,
3326-
outlet: this.rowOutletDirective,
33273300
positionStrategy: this.rowEditPositioningStrategy
33283301
};
33293302

@@ -6377,7 +6350,7 @@ export abstract class IgxGridBaseDirective implements GridType,
63776350
* TODO: MOVE to CRUD
63786351
*/
63796352
public openRowOverlay(id) {
6380-
this.configureRowEditingOverlay(id, this.rowList.length <= MIN_ROW_EDITING_COUNT_THRESHOLD);
6353+
this.configureRowEditingOverlay(id);
63816354

63826355
this.rowEditingOverlay.open(this.rowEditSettings);
63836356
this.rowEditingOverlay.element.addEventListener('wheel', this.rowEditingWheelHandler);
@@ -8133,13 +8106,12 @@ export abstract class IgxGridBaseDirective implements GridType,
81338106
}
81348107

81358108
// TODO: About to Move to CRUD
8136-
private configureRowEditingOverlay(rowID: any, useOuter = false) {
8109+
private configureRowEditingOverlay(rowID: any) {
81378110
let settings = this.rowEditSettings;
81388111
const overlay = this.overlayService.getOverlayById(this.rowEditingOverlay.overlayId);
81398112
if (overlay) {
81408113
settings = overlay.settings;
81418114
}
8142-
settings.outlet = useOuter ? this.parentRowOutletDirective : this.rowOutletDirective;
81438115
this.rowEditPositioningStrategy.settings.container = this.tbody.nativeElement;
81448116
const pinned = this._pinnedRecordIDs.indexOf(rowID) !== -1;
81458117
const targetRow = !pinned ?

projects/igniteui-angular/grids/grid/src/grid.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@
157157
</ng-template>
158158

159159
<ng-container *ngTemplateOutlet="template; context: { $implicit: this }"></ng-container>
160-
<div class="igx-grid__row-editing-outlet" igxOverlayOutlet #igxRowEditingOverlayOutlet></div>
161160
<ng-container #bodyViewContainerRef></ng-container>
162161
<igc-trial-watermark></igc-trial-watermark>
163162
</div>

projects/igniteui-angular/grids/hierarchical-grid/src/hierarchical-grid.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@
124124
<span [igxColumnMovingDrop]="headerContainer" [attr.droppable]="true"
125125
id="right" class="igx-grid__scroll-on-drag-right"></span>
126126
}
127-
<div class="igx-grid__row-editing-outlet" igxOverlayOutlet #igxRowEditingOverlayOutlet></div>
128127
<ng-container #bodyViewContainerRef></ng-container>
129128
@if (!this.parent) {
130129
<igc-trial-watermark></igc-trial-watermark>

projects/igniteui-angular/grids/hierarchical-grid/src/hierarchical-grid.component.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -657,15 +657,6 @@ export class IgxHierarchicalGridComponent extends IgxHierarchicalGridBaseDirecti
657657
}
658658
}
659659

660-
/**
661-
* @hidden
662-
*/
663-
public override get parentRowOutletDirective() {
664-
// Targeting parent outlet in order to prevent hiding when outlet
665-
// is present at a child grid and is attached to a row.
666-
return this.parent ? this.parent.rowOutletDirective : this.outlet;
667-
}
668-
669660
/**
670661
* @hidden
671662
*/

projects/igniteui-angular/grids/tree-grid/src/tree-grid-integration.spec.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,8 +582,10 @@ describe('IgxTreeGrid - Integration #tGrid', () => {
582582
expect(idCell.editMode).toBeFalsy();
583583
expect(ageCell.editMode).toBeTruthy();
584584

585-
const cancelBtn = fix.debugElement.queryAll(By.css('.igx-button--flat'))[0] as DebugElement;
586-
const doneBtn = fix.debugElement.queryAll(By.css('.igx-button--flat'))[1];
585+
// the first button element is in the add row snackbar, so we need to get
586+
// the second and third one which are Cancel and Done buttons in the row edit banner
587+
const cancelBtn = fix.debugElement.queryAll(By.css('.igx-button--flat'))[1];
588+
const doneBtn = fix.debugElement.queryAll(By.css('.igx-button--flat'))[2];
587589
spyOn(cancelBtn.nativeElement, 'focus').and.callThrough();
588590
spyOn<any>(grid.rowEditTabs.first, 'move').and.callThrough();
589591
spyOn<any>(grid.rowEditTabs.last, 'move').and.callThrough();

projects/igniteui-angular/grids/tree-grid/src/tree-grid.component.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@
116116
</igx-grid-summary-row>
117117
</ng-template>
118118
<ng-container *ngTemplateOutlet="template; context: { $implicit: this }"></ng-container>
119-
<div class="igx-grid__row-editing-outlet" igxOverlayOutlet #igxRowEditingOverlayOutlet></div>
120119
<ng-container #bodyViewContainerRef></ng-container>
121120
<igc-trial-watermark></igc-trial-watermark>
122121
</div>

0 commit comments

Comments
 (0)