-
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
refactor(*): switch to control flow blocks #14864
Changes from all commits
690b17f
aba7962
56c942c
45dbbc9
0d4fbc7
9f24348
a8aa75c
45b6a9d
68f9715
7de744a
24bfb23
6c8bf62
c196502
353434a
70141ce
e83b780
c97725a
e9b7856
c9a9866
73b51f3
ed2beed
4a23ee4
399df5a
43787e2
34ce36e
2c05694
b1b4a21
9351053
60eefe1
43c0c70
b0d0ec9
285610f
bf7ac78
1e7eecd
ca2b21a
39659fc
a372537
6397e10
d3d516f
9d85432
211fd9b
50b5771
f3ea343
8849797
70b72f9
1ca916f
4deaf78
9f659fb
81ff65e
acfcedf
0ef21a0
033d24a
1231a94
f1345b8
ba73d0d
eb19749
0ab1049
3627e92
21f6328
3fa058c
ecfca96
3f706d3
d7a0b29
ee85518
3926076
c2dc715
e6435f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
<ng-template *ngFor="let templateFunc of templateFunctions" let-context="context"> | ||
<div #container style="display: contents;"></div> | ||
{{ litRender(container, templateFunc, context) }} | ||
</ng-template> | ||
@for (templateFunc of templateFunctions; track templateFunc) { | ||
<ng-template let-context="context"> | ||
<div #container style="display: contents;"></div> | ||
{{ litRender(container, templateFunc, context) }} | ||
</ng-template> | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
<ng-container *ngIf="!asMenuItem"> | ||
@if (!asMenuItem) { | ||
<button type="button" [title]="labelText" igxIconButton="flat" igxRipple (click)="handleClick($event)" (mousedown)="preventEvent($event)"> | ||
<igx-icon *ngIf="iconSet" [family]="iconSet" [name]="iconName">{{iconName}}</igx-icon> | ||
<igx-icon *ngIf="!iconSet" >{{iconName}}</igx-icon> | ||
@if (iconSet) { | ||
<igx-icon [family]="iconSet" [name]="iconName">{{iconName}}</igx-icon> | ||
} | ||
@if (!iconSet) { | ||
<igx-icon>{{iconName}}</igx-icon> | ||
} | ||
</button> | ||
</ng-container> | ||
} | ||
|
||
<ng-template #menuItemTemplate> | ||
<ng-container *ngIf="asMenuItem"> | ||
@if (asMenuItem) { | ||
<div #container [className]="containerClass"> | ||
<igx-icon *ngIf="iconSet" [family]="iconSet" [name]="iconName">{{iconName}}</igx-icon> | ||
<igx-icon *ngIf="!iconSet" >{{iconName}}</igx-icon> | ||
@if (iconSet) { | ||
<igx-icon [family]="iconSet" [name]="iconName">{{iconName}}</igx-icon> | ||
} | ||
@if (!iconSet) { | ||
<igx-icon>{{iconName}}</igx-icon> | ||
} | ||
<label igxLabel>{{labelText}}</label> | ||
</div> | ||
</ng-container> | ||
} | ||
</ng-template> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,16 @@ | ||
|
||
<ng-container *ngIf="isRowContext"> | ||
<igx-grid-action-button *ngIf="!disabled && editRow" [asMenuItem]="asMenuItems" iconName="edit" [labelText]="grid.resourceStrings.igx_grid_actions_edit_label" (actionClick)="startEdit($event)"></igx-grid-action-button> | ||
<igx-grid-action-button *ngIf="addRow && isRootRow" [asMenuItem]="asMenuItems" iconName="add_row" iconSet="default" [labelText]="grid.resourceStrings.igx_grid_actions_add_label" (actionClick)="addRowHandler($event)"></igx-grid-action-button> | ||
<igx-grid-action-button *ngIf="addChild && hasChildren" [asMenuItem]="asMenuItems" iconName="add_child" iconSet="default" [labelText]="grid.resourceStrings.igx_grid_actions_add_child_label" (actionClick)="addRowHandler($event, true)"></igx-grid-action-button> | ||
<igx-grid-action-button *ngIf="!disabled && deleteRow" class="igx-action-strip__delete" classNames='igx-action-strip__menu-item--danger' [asMenuItem]="asMenuItems" iconName="delete" [labelText]="grid.resourceStrings.igx_grid_actions_delete_label" (actionClick)="deleteRowHandler($event)"></igx-grid-action-button> | ||
</ng-container> | ||
@if (isRowContext) { | ||
@if (!disabled && editRow) { | ||
<igx-grid-action-button [asMenuItem]="asMenuItems" iconName="edit" [labelText]="grid.resourceStrings.igx_grid_actions_edit_label" (actionClick)="startEdit($event)"></igx-grid-action-button> | ||
} | ||
@if (addRow && isRootRow) { | ||
<igx-grid-action-button [asMenuItem]="asMenuItems" iconName="add_row" iconSet="default" [labelText]="grid.resourceStrings.igx_grid_actions_add_label" (actionClick)="addRowHandler($event)"></igx-grid-action-button> | ||
} | ||
@if (addChild && hasChildren) { | ||
<igx-grid-action-button [asMenuItem]="asMenuItems" iconName="add_child" iconSet="default" [labelText]="grid.resourceStrings.igx_grid_actions_add_child_label" (actionClick)="addRowHandler($event, true)"></igx-grid-action-button> | ||
} | ||
@if (!disabled && deleteRow) { | ||
<igx-grid-action-button class="igx-action-strip__delete" classNames='igx-action-strip__menu-item--danger' [asMenuItem]="asMenuItems" iconName="delete" [labelText]="grid.resourceStrings.igx_grid_actions_delete_label" (actionClick)="deleteRowHandler($event)"></igx-grid-action-button> | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,6 @@ | ||||||
import { Component, ViewChild, OnInit } from '@angular/core'; | ||||||
import { TestBed, waitForAsync } from '@angular/core/testing'; | ||||||
import { By } from '@angular/platform-browser'; | ||||||
import { NgFor } from '@angular/common'; | ||||||
import { NoopAnimationsModule } from '@angular/platform-browser/animations'; | ||||||
|
||||||
import { configureTestSuite } from '../../test-utils/configure-suite'; | ||||||
|
@@ -391,16 +390,18 @@ describe('igxGridEditingActions #grid ', () => { | |||||
template: ` | ||||||
<igx-grid #grid [data]="data" [width]="'800px'" [height]="'500px'" | ||||||
[rowEditable]="true" [primaryKey]="'ID'"> | ||||||
<igx-column *ngFor="let c of columns" [sortable]="true" [field]="c.field" [header]="c.field" | ||||||
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'> | ||||||
</igx-column> | ||||||
@for (c of columns; track c) { | ||||||
<igx-column [sortable]="true" [field]="c.field" [header]="c.field" | ||||||
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'> | ||||||
</igx-column> | ||||||
} | ||||||
|
||||||
<igx-action-strip #actionStrip> | ||||||
<igx-grid-editing-actions></igx-grid-editing-actions> | ||||||
</igx-action-strip> | ||||||
</igx-grid> | ||||||
`, | ||||||
imports: [IgxGridComponent, IgxColumnComponent, IgxActionStripComponent, IgxGridEditingActionsComponent, NgFor] | ||||||
imports: [IgxGridComponent, IgxColumnComponent, IgxActionStripComponent, IgxGridEditingActionsComponent] | ||||||
}) | ||||||
class IgxActionStripTestingComponent implements OnInit { | ||||||
@ViewChild('actionStrip', { read: IgxActionStripComponent, static: true }) | ||||||
|
@@ -468,9 +469,11 @@ class IgxActionStripTestingComponent implements OnInit { | |||||
template: ` | ||||||
<igx-grid #grid [data]="data" [width]="'800px'" [height]="'500px'" | ||||||
[rowEditable]="true" [primaryKey]="'ID'"> | ||||||
<igx-column *ngFor="let c of columns" [sortable]="true" [field]="c.field" [header]="c.field" | ||||||
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'> | ||||||
</igx-column> | ||||||
@for (c of columns; track c) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<igx-column [sortable]="true" [field]="c.field" [header]="c.field" | ||||||
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'> | ||||||
</igx-column> | ||||||
} | ||||||
|
||||||
<igx-action-strip #actionStrip> | ||||||
<igx-grid-pinning-actions></igx-grid-pinning-actions> | ||||||
|
@@ -479,7 +482,7 @@ class IgxActionStripTestingComponent implements OnInit { | |||||
</igx-grid> | ||||||
`, | ||||||
selector: 'igx-action-strip-pin-edit-component', | ||||||
imports: [IgxGridComponent, IgxColumnComponent, IgxActionStripComponent, IgxGridPinningActionsComponent, IgxGridEditingActionsComponent, NgFor] | ||||||
imports: [IgxGridComponent, IgxColumnComponent, IgxActionStripComponent, IgxGridPinningActionsComponent, IgxGridEditingActionsComponent] | ||||||
}) | ||||||
class IgxActionStripPinEditComponent extends IgxActionStripTestingComponent { | ||||||
} | ||||||
|
@@ -488,17 +491,19 @@ class IgxActionStripPinEditComponent extends IgxActionStripTestingComponent { | |||||
template: ` | ||||||
<igx-grid #grid [data]="data" [width]="'800px'" [height]="'500px'" | ||||||
[rowEditable]="true" [primaryKey]="'ID'"> | ||||||
<igx-column *ngFor="let c of columns" [sortable]="true" [field]="c.field" [header]="c.field" | ||||||
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'> | ||||||
</igx-column> | ||||||
@for (c of columns; track c) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<igx-column [sortable]="true" [field]="c.field" [header]="c.field" | ||||||
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'> | ||||||
</igx-column> | ||||||
} | ||||||
|
||||||
<igx-action-strip #actionStrip> | ||||||
<igx-grid-editing-actions [asMenuItems]='true'></igx-grid-editing-actions> | ||||||
</igx-action-strip> | ||||||
</igx-grid> | ||||||
`, | ||||||
selector: 'igx-action-strip-edit-menu-component', | ||||||
imports: [IgxGridComponent, IgxColumnComponent, IgxActionStripComponent, IgxGridEditingActionsComponent, NgFor] | ||||||
imports: [IgxGridComponent, IgxColumnComponent, IgxActionStripComponent, IgxGridEditingActionsComponent] | ||||||
}) | ||||||
class IgxActionStripEditMenuComponent extends IgxActionStripTestingComponent { | ||||||
} | ||||||
|
@@ -507,9 +512,11 @@ class IgxActionStripEditMenuComponent extends IgxActionStripTestingComponent { | |||||
template: ` | ||||||
<igx-grid #grid [data]="dataOneRow" [width]="'800px'" [height]="'500px'" | ||||||
[rowEditable]="true" [primaryKey]="'ID'"> | ||||||
<igx-column *ngFor="let c of columns" [sortable]="true" [field]="c.field" [header]="c.field" | ||||||
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'> | ||||||
</igx-column> | ||||||
@for (c of columns; track c) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<igx-column [sortable]="true" [field]="c.field" [header]="c.field" | ||||||
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'> | ||||||
</igx-column> | ||||||
} | ||||||
|
||||||
<igx-action-strip #actionStrip> | ||||||
<igx-grid-pinning-actions></igx-grid-pinning-actions> | ||||||
|
@@ -518,7 +525,7 @@ class IgxActionStripEditMenuComponent extends IgxActionStripTestingComponent { | |||||
</igx-grid> | ||||||
`, | ||||||
selector: 'igx-action-strip-one-row-component', | ||||||
imports: [IgxGridComponent, IgxColumnComponent, IgxActionStripComponent, IgxGridEditingActionsComponent, IgxGridPinningActionsComponent, NgFor] | ||||||
imports: [IgxGridComponent, IgxColumnComponent, IgxActionStripComponent, IgxGridEditingActionsComponent, IgxGridPinningActionsComponent] | ||||||
}) | ||||||
class IgxActionStripOneRowComponent extends IgxActionStripTestingComponent { | ||||||
} | ||||||
|
@@ -527,17 +534,19 @@ class IgxActionStripOneRowComponent extends IgxActionStripTestingComponent { | |||||
template: ` | ||||||
<igx-grid #grid [data]="dataOneRow" [width]="'800px'" [height]="'500px'" | ||||||
[rowEditable]="true" [primaryKey]="'ID'"> | ||||||
<igx-column *ngFor="let c of columns" [sortable]="true" [field]="c.field" [header]="c.field" | ||||||
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'> | ||||||
</igx-column> | ||||||
@for (c of columns; track c) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<igx-column [sortable]="true" [field]="c.field" [header]="c.field" | ||||||
[width]="c.width" [pinned]='c.pinned' [hidden]='c.hidden'> | ||||||
</igx-column> | ||||||
} | ||||||
|
||||||
<igx-action-strip #actionStrip> | ||||||
<igx-grid-editing-actions [asMenuItems]='true'></igx-grid-editing-actions> | ||||||
</igx-action-strip> | ||||||
</igx-grid> | ||||||
`, | ||||||
selector: 'igx-action-strip-menu-one-row-component', | ||||||
imports: [IgxGridComponent, IgxColumnComponent, IgxActionStripComponent, IgxGridEditingActionsComponent, NgFor] | ||||||
imports: [IgxGridComponent, IgxColumnComponent, IgxActionStripComponent, IgxGridEditingActionsComponent] | ||||||
}) | ||||||
class IgxActionStripMenuOneRowComponent extends IgxActionStripTestingComponent { | ||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,14 @@ | ||
<ng-container *ngIf="isRowContext"> | ||
<igx-grid-action-button *ngIf="inPinnedArea && pinnedTop" [asMenuItem]="asMenuItems" iconSet="default" iconName="jump_down" [labelText]="grid.resourceStrings.igx_grid_actions_jumpDown_label" (actionClick)="scrollToRow($event)"></igx-grid-action-button> | ||
<igx-grid-action-button *ngIf="inPinnedArea && !pinnedTop" [asMenuItem]="asMenuItems" iconSet="default" iconName="jump_up" [labelText]="grid.resourceStrings.igx_grid_actions_jumpUp_label" (actionClick)="scrollToRow($event)"></igx-grid-action-button> | ||
<igx-grid-action-button *ngIf="!pinned" [asMenuItem]="asMenuItems" iconSet="default" iconName="pin" [labelText]="grid.resourceStrings.igx_grid_actions_pin_label" (actionClick)="pin($event)"></igx-grid-action-button> | ||
<igx-grid-action-button *ngIf="pinned" [asMenuItem]="asMenuItems" iconSet="default" iconName="unpin" [labelText]="grid.resourceStrings.igx_grid_actions_unpin_label" (actionClick)="unpin($event)"></igx-grid-action-button> | ||
</ng-container> | ||
@if (isRowContext) { | ||
@if (inPinnedArea && pinnedTop) { | ||
<igx-grid-action-button [asMenuItem]="asMenuItems" iconSet="default" iconName="jump_down" [labelText]="grid.resourceStrings.igx_grid_actions_jumpDown_label" (actionClick)="scrollToRow($event)"></igx-grid-action-button> | ||
} | ||
@if (inPinnedArea && !pinnedTop) { | ||
<igx-grid-action-button [asMenuItem]="asMenuItems" iconSet="default" iconName="jump_up" [labelText]="grid.resourceStrings.igx_grid_actions_jumpUp_label" (actionClick)="scrollToRow($event)"></igx-grid-action-button> | ||
} | ||
@if (!pinned) { | ||
<igx-grid-action-button [asMenuItem]="asMenuItems" iconSet="default" iconName="pin" [labelText]="grid.resourceStrings.igx_grid_actions_pin_label" (actionClick)="pin($event)"></igx-grid-action-button> | ||
} | ||
@if (pinned) { | ||
<igx-grid-action-button [asMenuItem]="asMenuItems" iconSet="default" iconName="unpin" [labelText]="grid.resourceStrings.igx_grid_actions_unpin_label" (actionClick)="unpin($event)"></igx-grid-action-button> | ||
} | ||
} |
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.