Skip to content

Commit 8720d2a

Browse files
committed
refactor(toolbar): Export toolbar to pulic api
Minor fix with progress indicator. Add warning comment for migrations. Update changelog.
1 parent cc2a2b4 commit 8720d2a

File tree

6 files changed

+23
-5
lines changed

6 files changed

+23
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ All notable changes for each version of this project will be documented in this
66
### General
77
- `IgxGrid`, `IgxTreeGrid`, `IgxHierarchicalGrid`
88
- Added a new directive for re-templating the Excel style filtering header icon - `IgxExcelStyleHeaderIconDirective`.
9+
- **Breaking Change**
10+
11+
Changed the how the grid toolbar is instantiated in the grids. The
12+
toolbar is now templated rather than being activated through a property on the parent grid. The toolbar features are also exposed as templatable
13+
components and the old properties are deprecated.
14+
15+
Refer to the official documentation for more information.
916

1017
## 10.2.0
1118

@@ -82,7 +89,7 @@ All notable changes for each version of this project will be documented in this
8289
return result;
8390
}
8491
}
85-
```
92+
```
8693
- A new `pipeArgs` input property is exposed by the `IgxColumnComponent`, which is used to pass arguments to the Angular `DatePipe` and `DecimalPipe`, to format the display for date and numeric columns.
8794
```typescript
8895
- ` IGX_INPUT_GROUP_TYPE` injection token

projects/igniteui-angular/migrations/update-11_0_0/index.spec.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ describe('Update to 11.0.0', () => {
2323
},
2424
};
2525
const migrationName = 'migration-18';
26+
const warnMsg = `\n<!-- Auto migrated template content. Please, check your bindings! -->\n`;
2627
const stripWhitespaceRe = /\s/g;
2728

2829
const makeTemplate = (name: string) => `/testSrc/appPrefix/component/${name}.component.html`;
@@ -102,6 +103,7 @@ describe('Update to 11.0.0', () => {
102103
).toEqual(`
103104
<igx-grid>
104105
<igx-grid-toolbar>
106+
${warnMsg}
105107
<div></div>
106108
<button></button>
107109
</igx-grid-toolbar>
@@ -147,6 +149,7 @@ describe('Update to 11.0.0', () => {
147149
<igx-column></igx-column>
148150
<igx-row-island>
149151
<igx-grid-toolbar [grid]="sampleGrid" *igxGridToolbar="let sampleGrid" *ngIf="showChildToolbar">
152+
${warnMsg}
150153
<div igxLabel></div>
151154
<button></button>
152155
</igx-grid-toolbar>

projects/igniteui-angular/migrations/update-11_0_0/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export default function (): Rule {
1515

1616
const TAGS = ['igx-grid', 'igx-tree-grid', 'igx-hierarchical-grid'];
1717
const prop = ['[showToolbar]', 'showToolbar'];
18+
const warnMsg = `\n<!-- Auto migrated template content. Please, check your bindings! -->\n`;
1819
const changes = new Map<string, FileChange[]>();
1920

2021
const applyChanges = () => {
@@ -53,7 +54,7 @@ export default function (): Rule {
5354
const ngTemplates = findElementNodes([grid], ['ng-template']);
5455
const toolbarTemplate = ngTemplates.filter(template => hasAttribute(template as Element, 'igxToolbarCustomContent'))[0];
5556
if (toolbarTemplate) {
56-
return `\n${serializeNodes((toolbarTemplate as Element).children).join('')}\n`;
57+
return `${warnMsg}\n${serializeNodes((toolbarTemplate as Element).children).join('')}\n`;
5758
}
5859
return '';
5960
};

projects/igniteui-angular/src/lib/grids/public_api.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,10 @@ export * from './grid-common.module';
1111
export { IColumnVisibilityChangedEventArgs } from './hiding/column-hiding-item.directive';
1212
export * from './hiding/column-hiding.component';
1313
export * from './pinning/column-pinning.component';
14-
export * from './column-actions/column-actions.module';
14+
export * from './toolbar/grid-toolbar.component';
15+
export * from './toolbar/common';
16+
export * from './toolbar/grid-toolbar-advanced-filtering.component';
17+
export * from './toolbar/grid-toolbar-exporter.component';
18+
export * from './toolbar/grid-toolbar-hiding.component';
19+
export * from './toolbar/grid-toolbar-pinning.component';
1520
export * from './state.directive';

projects/igniteui-angular/src/lib/grids/toolbar/grid-toolbar-exporter.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,17 @@ export class IgxGridToolbarExporterComponent extends BaseToolbarDirective {
134134

135135
this.exportStarted.emit(args);
136136
this.grid.onToolbarExporting.emit(args);
137+
this.isExporting = true;
138+
this.toolbar.showProgress = true;
137139

138140
if (args.cancel) {
139141
return;
140142
}
141143

142-
this.isExporting = true;
143-
144144
exporter.onExportEnded.pipe(first()).subscribe(() => {
145145
this.exportEnded.emit();
146146
this.isExporting = false;
147+
this.toolbar.showProgress = false;
147148
});
148149

149150
exporter.export(this.grid, options);

projects/igniteui-angular/src/lib/grids/toolbar/grid-toolbar.base.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export abstract class BaseToolbarDirective {
4747

4848
constructor(@Host() protected toolbar: IgxGridToolbarComponent) { }
4949

50+
/** @hidden @internal */
5051
public toggle(anchorElement: HTMLElement, toggleRef: IgxToggleDirective, actions?: IgxColumnActionsComponent): void {
5152
if (actions) {
5253
const setHeight = () => actions.columnsAreaMaxHeight = this.columnListHeight ?? `${Math.max(this.grid.calcHeight, 200)}px`;

0 commit comments

Comments
 (0)