@@ -25,9 +25,7 @@ import {
25
25
InjectionToken ,
26
26
Optional ,
27
27
DoCheck ,
28
- Directive ,
29
- OnChanges ,
30
- SimpleChanges
28
+ Directive
31
29
} from '@angular/core' ;
32
30
import ResizeObserver from 'resize-observer-polyfill' ;
33
31
import 'igniteui-trial-watermark' ;
@@ -143,7 +141,6 @@ import { GridType } from './common/grid.interface';
143
141
import { IgxDecimalPipeComponent , IgxDatePipeComponent } from './common/pipes' ;
144
142
import { DropPosition } from './moving/moving.service' ;
145
143
import { IgxHeadSelectorDirective , IgxRowSelectorDirective } from './selection/row-selectors' ;
146
- import { IgxGridToolbarCustomContentDirective } from './toolbar/toolbar.directive' ;
147
144
import { IgxColumnComponent } from './columns/column.component' ;
148
145
import { IgxColumnGroupComponent } from './columns/column-group.component' ;
149
146
import { IGridSortingStrategy } from '../data-operations/sorting-strategy' ;
@@ -1703,16 +1700,16 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
1703
1700
* let customContentTemplate = this.grid.toolbarCustomContentTemplate;
1704
1701
* ```
1705
1702
*/
1706
- public get toolbarCustomContentTemplate ( ) : IgxGridToolbarCustomContentDirective {
1707
- return this . toolbarCustomContentTemplates . first ;
1708
- }
1703
+ // public get toolbarCustomContentTemplate(): IgxGridToolbarCustomContentDirective {
1704
+ // return this.toolbarCustomContentTemplates.first;
1705
+ // }
1709
1706
1710
- /**
1711
- * @hidden
1712
- * @internal
1713
- */
1714
- @ContentChildren ( IgxGridToolbarCustomContentDirective , { read : IgxGridToolbarCustomContentDirective , descendants : false } )
1715
- public toolbarCustomContentTemplates : QueryList < IgxGridToolbarCustomContentDirective > ;
1707
+ // / **
1708
+ // * @hidden
1709
+ // * @internal
1710
+ // */
1711
+ // @ContentChildren (IgxGridToolbarCustomContentDirective, { read: IgxGridToolbarCustomContentDirective, descendants: false })
1712
+ // public toolbarCustomContentTemplates: QueryList<IgxGridToolbarCustomContentDirective>;
1716
1713
1717
1714
/**
1718
1715
* @hidden
@@ -2132,6 +2129,13 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
2132
2129
return this . columnList . filter ( ( col ) => col . columnGroup === false && col . hidden === true ) . length ;
2133
2130
}
2134
2131
2132
+ /**
2133
+ * Gets the number of pinned columns.
2134
+ */
2135
+ get pinnedColumnsCount ( ) {
2136
+ return this . pinnedColumns . filter ( col => ! col . columnLayout ) . length ;
2137
+ }
2138
+
2135
2139
/**
2136
2140
* Gets/Sets the text to be displayed inside the toggle button.
2137
2141
* @remarks
@@ -2200,18 +2204,21 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
2200
2204
return this . _currentRowState ;
2201
2205
}
2202
2206
2203
- /**
2204
- * Provides access to the `IgxToolbarComponent`.
2205
- * @example
2206
- * ```typescript
2207
- * const gridToolbar = this.grid.toolbar;
2208
- * ```
2209
- */
2210
- @ViewChild ( 'toolbar' , { read : IgxGridToolbarComponent } )
2211
- public toolbar : IgxGridToolbarComponent = null ;
2207
+ // /**
2208
+ // * Provides access to the `IgxToolbarComponent`.
2209
+ // * @example
2210
+ // * ```typescript
2211
+ // * const gridToolbar = this.grid.toolbar;
2212
+ // * ```
2213
+ // */
2214
+ // @ViewChild ('toolbar', { read: IgxGridToolbarComponent })
2215
+ // public toolbar: IgxGridToolbarComponent = null;
2216
+
2217
+ // @ViewChild ('toolbar', { read: ElementRef })
2218
+ // private toolbarHtml: ElementRef = null;
2219
+ @ContentChildren ( IgxGridToolbarComponent )
2220
+ public toolbar : QueryList < IgxGridToolbarComponent > ;
2212
2221
2213
- @ViewChild ( 'toolbar' , { read : ElementRef } )
2214
- private toolbarHtml : ElementRef = null ;
2215
2222
2216
2223
/**
2217
2224
* Gets/Sets whether the toolbar is shown.
@@ -3140,6 +3147,7 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
3140
3147
*/
3141
3148
public ngAfterContentInit ( ) {
3142
3149
this . setupColumns ( ) ;
3150
+ this . toolbar . changes . pipe ( takeUntil ( this . destroy$ ) , filter ( ( ) => ! this . _init ) ) . subscribe ( ( ) => this . notifyChanges ( true ) ) ;
3143
3151
}
3144
3152
3145
3153
/**
@@ -4724,11 +4732,14 @@ export abstract class IgxGridBaseDirective extends DisplayDensityBase implements
4724
4732
*/
4725
4733
protected getToolbarHeight ( ) : number {
4726
4734
let toolbarHeight = 0 ;
4727
- if ( this . showToolbar && this . toolbarHtml != null ) {
4728
- const height = this . getComputedHeight ( this . toolbarHtml . nativeElement ) ;
4729
- toolbarHeight = this . toolbarHtml . nativeElement . firstElementChild ?
4730
- height : 0 ;
4731
- }
4735
+ if ( this . toolbar . first ) {
4736
+ toolbarHeight = this . getComputedHeight ( this . toolbar . first . nativeElement ) ;
4737
+ }
4738
+ // if (this.showToolbar && this.toolbarHtml != null) {
4739
+ // const height = this.getComputedHeight(this.toolbarHtml.nativeElement);
4740
+ // toolbarHeight = this.toolbarHtml.nativeElement.firstElementChild ?
4741
+ // height : 0;
4742
+ // }
4732
4743
return toolbarHeight ;
4733
4744
}
4734
4745
0 commit comments