-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
igxGrid - refactor header and filter cell components 6.2.x #3017
Conversation
# Conflicts: # projects/igniteui-angular/src/lib/grids/column.component.ts # projects/igniteui-angular/src/lib/grids/grid-header.component.ts # projects/igniteui-angular/src/lib/grids/grid/grid.component.html # projects/igniteui-angular/src/lib/grids/grid/grid.component.ts # projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.html
# Conflicts: # projects/igniteui-angular/src/lib/grids/column.component.ts # projects/igniteui-angular/src/lib/grids/grid-base.component.ts # projects/igniteui-angular/src/lib/grids/grid-header-group.component.html # projects/igniteui-angular/src/lib/grids/grid-header-group.component.ts # projects/igniteui-angular/src/lib/grids/grid/grid.component.html # projects/igniteui-angular/src/lib/grids/grid/grid.component.ts # projects/igniteui-angular/src/lib/grids/tree-grid/tree-grid.component.html
import { DefaultSortingStrategy, ISortingStrategy } from '../data-operations/sorting-strategy'; | ||
import { valToPxlsUsingRange, flatten } from '../core/utils'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
valToPxlsUsingRange
name sounds weird. Could we change it to something like getNodeSizeViaRange
?
@@ -575,8 +575,8 @@ export class IgxDragDirective implements OnInit, OnDestroy { | |||
* Create dragGhost element - copy of the base element. Bind all needed events. | |||
* @param event Pointer event required when the dragGhost is being initialized. | |||
*/ | |||
protected createDragGhost(event) { | |||
this._dragGhost = this.element.nativeElement.cloneNode(true); | |||
protected createDragGhost(event, node = null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might define the type of the node so if someone needs to use this method to be aware of the type.
/** | ||
* @hidden | ||
*/ | ||
get headerCheckboxWidth() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not all paths return value.
public resizeEndTimeout = isFirefox() ? 200 : 0; | ||
public column: IgxColumnComponent; | ||
|
||
private pinnedMaxWidth; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put private members before the public ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add type to this member.
|
||
public startResizePos: number; | ||
public isColumnResizing: boolean; | ||
public resizeCursor: any = null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose this could be 'string' instead of 'any'.
} | ||
} | ||
|
||
public autosizeColumnOnDblClick() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might document the public members (methods, properties) even though this service is for internal use only.
} | ||
} | ||
|
||
public resizeColumn(event) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put a type on the argument.
selector: 'igx-grid-header-group', | ||
templateUrl: './grid-header-group.component.html' | ||
}) | ||
export class IgxGridHeaderGroupComponent implements DoCheck { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might document all public members even thought this class is excluded from typedoc generation.
'igx-grid__th--filtering': this.isFiltered | ||
}; | ||
|
||
Object.entries(classList).forEach(([klass, value]) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
klass
should be class
.
if (!this.column.pinned) { | ||
return null; | ||
} | ||
return 9999 - this.grid.pinnedColumns.indexOf(this.column); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The magic number (9999) should be defined as constant in the class.
|
||
if (this.moreIcon) { | ||
this.filteringService.columnToMoreIconHidden.set(this.column.field, true); | ||
} | ||
this.cdr.detectChanges(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need this extra change detection cycle here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The idea is to initially show all chips, measure them and hide the ones which don't fit.
Closes #2972, Closes #2926, Closes #2923, Closes #2917, Closes #2783, Closes #3027, Closes #2938.
This PR introduces the following changes that are with high regression potential: