@@ -44,7 +44,6 @@ import {
4444 VerticalAlignment ,
4545 IgxOverlayService
4646} from '../services/index' ;
47- import { IgxCheckboxComponent } from './../checkbox/checkbox.component' ;
4847import { GridBaseAPIService } from './api.service' ;
4948import { IgxGridCellComponent } from './cell.component' ;
5049import { IColumnVisibilityChangedEventArgs } from './column-hiding-item.directive' ;
@@ -89,8 +88,9 @@ import {
8988import { IgxGridColumnResizerComponent } from './grid-column-resizer.component' ;
9089import { IgxGridFilteringRowComponent } from './filtering/grid-filtering-row.component' ;
9190import { IgxDragDirective } from '../directives/drag-drop/drag-drop.directive' ;
92- import { DeprecateProperty } from '../core/deprecateDecorators' ;
9391import { CharSeparatedValueData } from '../services/csv/char-separated-value-data' ;
92+ import { IgxHeadSelectorDirective , IgxRowSelectorDirective } from './igx-row-selectors.module' ;
93+ import { DeprecateProperty } from '../core/deprecateDecorators' ;
9494
9595const MINIMUM_COLUMN_WIDTH = 136 ;
9696const FILTER_ROW_HEIGHT = 50 ;
@@ -259,6 +259,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
259259 private _locale = null ;
260260 public _destroyed = false ;
261261 private overlayIDs = [ ] ;
262+
262263 private _hostWidth ;
263264 /**
264265 * An accessor that sets the resource strings.
@@ -1707,9 +1708,51 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
17071708 return this . toolbarCustomContentTemplates . first ;
17081709 }
17091710
1711+ /**
1712+ * @hidden
1713+ * @internal
1714+ */
17101715 @ContentChildren ( IgxGridToolbarCustomContentDirective , { read : IgxGridToolbarCustomContentDirective , descendants : false } )
17111716 public toolbarCustomContentTemplates : QueryList < IgxGridToolbarCustomContentDirective > ;
17121717
1718+ /**
1719+ * @hidden
1720+ * @internal
1721+ */
1722+ public get headSelectorTemplate ( ) : TemplateRef < IgxHeadSelectorDirective > {
1723+ if ( this . headSelectorsTemplates && this . headSelectorsTemplates . first ) {
1724+ return this . headSelectorsTemplates . first . templateRef ;
1725+ }
1726+
1727+ return null ;
1728+ }
1729+
1730+ /**
1731+ * @hidden
1732+ * @internal
1733+ */
1734+ @ContentChildren ( IgxHeadSelectorDirective , { read : IgxHeadSelectorDirective , descendants : false } )
1735+ public headSelectorsTemplates : QueryList < IgxHeadSelectorDirective > ;
1736+
1737+ /**
1738+ * @hidden
1739+ * @internal
1740+ */
1741+ public get rowSelectorTemplate ( ) : TemplateRef < IgxRowSelectorDirective > {
1742+ if ( this . rowSelectorsTemplates && this . rowSelectorsTemplates . first ) {
1743+ return this . rowSelectorsTemplates . first . templateRef ;
1744+ }
1745+
1746+ return null ;
1747+ }
1748+
1749+ /**
1750+ * @hidden
1751+ * @internal
1752+ */
1753+ @ContentChildren ( IgxRowSelectorDirective , { read : IgxRowSelectorDirective , descendants : false } )
1754+ public rowSelectorsTemplates : QueryList < IgxRowSelectorDirective > ;
1755+
17131756 /**
17141757 * @hidden
17151758 */
@@ -1743,8 +1786,8 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
17431786 /**
17441787 * @hidden
17451788 */
1746- @ViewChild ( 'headerCheckboxContainer ' , { static : false } )
1747- public headerCheckboxContainer : ElementRef ;
1789+ @ViewChild ( 'headerSelectorContainer ' , { static : false } )
1790+ public headerSelectorContainer : ElementRef ;
17481791
17491792 /**
17501793 * @hidden
@@ -1758,12 +1801,6 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
17581801 @ViewChild ( 'headerGroupContainer' , { static : false } )
17591802 public headerGroupContainer : ElementRef ;
17601803
1761- /**
1762- * @hidden
1763- */
1764- @ViewChild ( 'headerCheckbox' , { read : IgxCheckboxComponent , static : false } )
1765- public headerCheckbox : IgxCheckboxComponent ;
1766-
17671804 /**
17681805 * @hidden
17691806 */
@@ -1841,6 +1878,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
18411878 */
18421879 @ViewChild ( 'defaultRowEditTemplate' , { read : TemplateRef , static : true } )
18431880 private defaultRowEditTemplate : TemplateRef < any > ;
1881+
18441882 /**
18451883 * @hidden
18461884 */
@@ -3337,10 +3375,18 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
33373375 return totalWidth ;
33383376 }
33393377
3340- get showRowCheckboxes ( ) : boolean {
3378+ /**
3379+ * @hidden
3380+ * @internal
3381+ */
3382+ get showRowSelectors ( ) : boolean {
33413383 return this . isRowSelectable && this . hasVisibleColumns && ! this . hideRowSelectors ;
33423384 }
33433385
3386+ /**
3387+ * @hidden
3388+ * @internal
3389+ */
33443390 get showDragIcons ( ) : boolean {
33453391 return this . rowDraggable && this . columns . length > this . hiddenColumnsCount ;
33463392 }
@@ -4167,7 +4213,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
41674213 const pagingHeight = this . getPagingHeight ( ) ;
41684214 const groupAreaHeight = this . getGroupAreaHeight ( ) ;
41694215 const renderedHeight = toolbarHeight + this . theadRow . nativeElement . offsetHeight +
4170- footerHeight + pagingHeight + groupAreaHeight +
4216+ footerHeight + pagingHeight + groupAreaHeight +
41714217 this . scr . nativeElement . clientHeight ;
41724218
41734219 const computed = this . document . defaultView . getComputedStyle ( this . nativeElement ) . getPropertyValue ( 'height' ) ;
@@ -4476,7 +4522,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
44764522 let width = 0 ;
44774523
44784524 if ( this . isRowSelectable ) {
4479- width += this . headerCheckboxContainer ? this . headerCheckboxContainer . nativeElement . getBoundingClientRect ( ) . width : 0 ;
4525+ width += this . headerSelectorContainer ? this . headerSelectorContainer . nativeElement . getBoundingClientRect ( ) . width : 0 ;
44804526 }
44814527 if ( this . rowDraggable ) {
44824528 width += this . headerDragContainer ? this . headerDragContainer . nativeElement . getBoundingClientRect ( ) . width : 0 ;
@@ -4685,10 +4731,24 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
46854731 /**
46864732 * @hidden
46874733 */
4688- get headerCheckboxAriaLabel ( ) {
4689- return this . _filteringExpressionsTree . filteringOperands . length > 0 ?
4690- this . headerCheckbox && this . selectionService . areAllRowSelected ( ) ? 'Deselect all filtered' : 'Select all filtered' :
4691- this . headerCheckbox && this . selectionService . areAllRowSelected ( ) ? 'Deselect all' : 'Select all' ;
4734+ get headSelectorBaseAriaLabel ( ) {
4735+ if ( this . _filteringExpressionsTree . filteringOperands . length > 0 ) {
4736+ return this . selectionService . areAllRowSelected ( ) ? 'Deselect all filtered' : 'Select all filtered' ;
4737+ }
4738+
4739+ return this . selectionService . areAllRowSelected ( ) ? 'Deselect all' : 'Select all' ;
4740+ }
4741+
4742+ /**
4743+ * @hidden
4744+ * @internal
4745+ */
4746+ public get totalRowsCountAfterFilter ( ) {
4747+ if ( this . data ) {
4748+ return this . selectionService . allData . length ;
4749+ }
4750+
4751+ return 0 ;
46924752 }
46934753
46944754 /**
@@ -4875,7 +4935,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
48754935 if ( col ) {
48764936 const key = headers ? col . header || col . field : col . field ;
48774937 record [ key ] = formatters && col . formatter ? col . formatter ( source [ row ] [ col . field ] )
4878- : source [ row ] [ col . field ] ;
4938+ : source [ row ] [ col . field ] ;
48794939 }
48804940 } ) ;
48814941 }
@@ -4890,15 +4950,15 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
48904950 protected getSelectableColumnsAt ( index ) {
48914951 if ( this . hasColumnLayouts ) {
48924952 const visibleLayoutColumns = this . visibleColumns
4893- . filter ( col => col . columnLayout )
4894- . sort ( ( a , b ) => a . visibleIndex - b . visibleIndex ) ;
4953+ . filter ( col => col . columnLayout )
4954+ . sort ( ( a , b ) => a . visibleIndex - b . visibleIndex ) ;
48954955 const colLayout = visibleLayoutColumns [ index ] ;
48964956 return colLayout ? colLayout . children . toArray ( ) : [ ] ;
48974957 } else {
48984958 const visibleColumns = this . visibleColumns
4899- . filter ( col => ! col . columnGroup )
4900- . sort ( ( a , b ) => a . visibleIndex - b . visibleIndex ) ;
4901- return [ visibleColumns [ index ] ] ;
4959+ . filter ( col => ! col . columnGroup )
4960+ . sort ( ( a , b ) => a . visibleIndex - b . visibleIndex ) ;
4961+ return [ visibleColumns [ index ] ] ;
49024962 }
49034963 }
49044964
@@ -4913,7 +4973,6 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
49134973 return this . extractDataFromSelection ( source , formatters , headers ) ;
49144974 }
49154975
4916-
49174976 /**
49184977 * @hidden
49194978 */
@@ -4944,7 +5003,7 @@ export abstract class IgxGridBaseComponent extends DisplayDensityBase implements
49445003 this . onGridCopy . emit ( ev ) ;
49455004
49465005 if ( ev . cancel ) {
4947- return ;
5006+ return ;
49485007 }
49495008
49505009 const transformer = new CharSeparatedValueData ( ev . data , this . clipboardOptions . separator ) ;
0 commit comments