import { OnInit, AfterContentInit, AfterViewInit, Renderer, DoCheck, EventEmitter, ElementRef, QueryList, IterableDiffers } from '@angular/core'; import { CfCoreComponent } from '../core/core.component'; import { CfDatatablePagerComponent } from '../datatable-pager/datatable-pager.component'; import { CfDatatableColumnComponent } from '../datatable-column/datatable-column.component'; import { CfDatatableFilterComponent } from '../datatable-filter/datatable-filter.component'; import { CfDatatableRowsExpanderComponent } from '../datatable-rows-expander/datatable-rows-expander.component'; import { IconModel } from '../../models/icon/icon.model'; import { DatatableModel } from '../../models/datatable/datatable.model'; import { DatatableStylingModel } from '../../models/datatable/datatable-styling.model'; import { TemplateService } from '../../services/template-service/template.service'; /** *

CfDatatable component is built using * ngx-datatable, CfIcon and CfInput.

*
 * 
 * import {{'{'}} DatatableModel {{'}'}} from 'cedrus-fusion'
 * import {{'{'}} DatatableStylingModel {{'}'}} from 'cedrus-fusion'
 * <cf-datatable></cf-datatable>
 * 
 * 
*/ export declare class CfDatatableComponent extends CfCoreComponent implements OnInit, AfterContentInit, AfterViewInit, DoCheck { private _renderer; elementRef: ElementRef; /** @hidden * List of datatable column components with column templates and names. */ tableColumns: QueryList; /** @hidden * Datatable row details template */ details: any; /**@hidden */ cfDatatablePager: CfDatatablePagerComponent; /**@hidden */ cfDatatableFilter: CfDatatableFilterComponent; /**@hidden */ cfDatatableRowsExpander: CfDatatableRowsExpanderComponent; /** @hidden * Component property for registering Datatable and for connection to ngx-datatable functionality */ datatableElement: any; /** @hidden */ cfDatatableViewColumns: QueryList; /** @hidden * Datatable original rows. * Needs to be to keep original rows available after iteracting with datatable functionality * (for exapmle after filtering). */ originalRows: any[]; /** @hidden * Working rows list which is changing by user iteraction with datatable functionality. */ clonedRows: any[]; /** *
{{'{'}}
     *	showTableFooter: boolean,
     *	showTableCount: boolean,
     *	showTablePager: boolean,
     *	headerHeight: any,
     *	footerHeight: any,
     *	rows: any[],
     *	rowHeight: any,
     *	columnMode: string,
     *	limit: number,
     *	expandable: boolean,
     *	rowExpand: string,
     *	detailsHeight: number,
     *	expandIcon: IconModel,
     *	collapseIcon: IconModel,
     *	selectable: boolean,
     *	sorted: any[],
     *	selected: any[],
     * {{'}'}}
*

showTableFooter: boolean

* If to show ngx-datatable footer *

showTableCount: boolean

* If to show ngx-datatable footer count text *

showTablePager: boolean

* If to show ngx-datatable footer pager *

headerHeight: any

* The height of the header in pixels. Type any. Pass a false for no header. Default: 42. *

footerHeight: any

* The height of the footer in pixels. Type any. Pass a false for no footer. Default: 42. *

rows: any[]

* It is array with rows json objects. *

rowHeight: any

* It is height of each row. Can be numeric (nember will be transformed to pixels) or 'auto'. Default: 50. *

columnMode: string

* The mode which the columns are distributed across the table. Type string. Can be: flex, force, standard. Default: force. *

limit: number

* It is rows quontity per page. Type number. Default: 3. To show all rows: -1. *

expandable: boolean

* It is boolean value to use or not row details section. Default: false. *

rowExpand: string

* Means how rows can be expanded at one time. Can be: multiple or single. Default: multiple. *

detailsHeight: number

* It is height of row in pixels. Type number. Default: 130. *

expandIcon: IconModel

* CfIcon component for the row expanding icon. *

collapseIcon: IconModel

* CfIcon component for the row collapsing icon. *

selectable: boolean

* It is boolean value to show or not rows section checkboxes. Default: false. *

sorted: any[]

* Array with sorting objects. Default: []. * Rows can sorted by multipe columns. Each sorting object is a json object with two properties: * prop(property name by which to sort rows) and dir(sort direction. Can be: asc or desc). *

selected: any[]

* Array for selected items. *

sorted: array

* Array with sorting objects. Default: []. * Rows can sorted by multipe columns. * Each sorting object is a json object with two properties: * prop(property name by which to sort rows) and dir(sort direction. Can be: asc or desc). *

selected: array

* Array for selected items. *

Example:

*
{{'{'}}
     *	showTableFooter: true,
     *	showTableCount: false,
     *	showTablePager: true,
     * 	rows: [
     *		{{'{'}} name: 'Austin', city: 'London' {{'}'}},
     *		{{'{'}} name: 'Molly', city: 'Tokyo' {{'}'}},
     *		{{'{'}} name: 'Austin', city: 'New York' {{'}'}},
     *		{{'{'}} name: 'Monica', city: 'Paris' {{'}'}},
     *		{{'{'}} name: 'Austin', city: 'Dubai'{{'}'}}
     *	],
     *	rowHeight: 'auto',
     *	columnMode: 'force',
     *	limit: 3,
     *	expandable: true,
     *	rowExpand: 'single',
     *	detailsHeight: 150,
     *	expandIcon: this.myRowExpandIcon,
     *	collapseIcon: this.myRowCollapseIcon,
     *	selectable: true,
     *	sorted: [{{'{'}}prop: 'name', dir: 'desc'{{'}'}}],
     *	selected: this.mySelected
     * {{'}'}}
*/ properties: DatatableModel; /** *

dynamicClass: function() -> string, // Function that returns name of the class

*

class: string // Name of the css class selector

*

themeColor: string // primary/accent/warn

*
     *{{'{'}}
     *	// Container surrounding the all datatable elelemnts
     *	container: {{'{'}}
     *		dynamicClass,
     *		class
     *	{{'}'}},
     *	// Header
     *	header: {{'{'}}
     *		dynamicClass,
     *		class
     *	{{'}'}},
     *	// Ngx-datatable elelemnt
     *	table: {{'{'}}
     *		dynamicClass,
     *		class
     *	{{'}'}},
     *	// Each cell container
     *	tableCell: {{'{'}}
     *		dynamicClass,
     *		class
     *	{{'}'}},
     *	// Each row details section
     *	tableRowDetails: {{'{'}}
     *		dynamicClass,
     *		class
     *	{{'}'}}
     *	// Row expanding icon styling
     *	expandIcon: IconStylingModel, //refer to icon component
     *	// Row collapsing icon styling
     *	collapseIcon: IconStylingModel, //refer to icon component
     *	// Footer
     *	footer: {{'{'}}
     *		dynamicClass,
     *		class
     *	{{'}'}},
     *{{'}'}}
     * 
*

Example:

*

     *	new DatatableStylingModel({{'{'}}
     *		container: {{'{'}}class: 'my-class-for-datatable-container'{{'}'}},
     *		header: {{'{'}}class: 'my-class-for-datatable-header'{{'}'}},
     *		table: {{'{'}}class: 'my-class-for-table'{{'}'}},
     *		tableCell: {{'{'}}class: 'my-class-for-table-cell'{{'}'}},
     *		tableRowDetails: {{'{'}}class: 'my-class-for-table-row-details'{{'}'}},
     *		expandIcon: new IconStylingModel({{'{'}} icon: {{'{'}}themeColor: "primary"{{'}'}} {{'}'}}),
     *		collapseIcon: new IconStylingModel({{'{'}} icon: {{'{'}}themeColor: "primary"{{'}'}} {{'}'}}),
     *		footer: {{'{'}}class: 'my-class-for-datatable-footer'{{'}'}},
     *	{{'}'}})
     * 
*/ styling: DatatableStylingModel; /** * If to show ngx-datatable footer */ showTableFooter: boolean; /** * If to show ngx-datatable footer count text */ showTableCount: boolean; /** * If to show ngx-datatable footer pager */ showTablePager: boolean; /** * The height of the header in pixels. Type any. Pass a false for no header. Default: 42. */ headerHeight: any; /** * The height of the footer in pixels. Type any. Pass a false for no footer. Default: 42. */ footerHeight: any; /** * It is array with rows json objects. */ rows: any[]; /** * It is height of each row. Can be numeric (nember will be transformed to pixels) or 'auto'. Default: 50. */ rowHeight: any; /** * The mode which the columns are distributed across the table. Type string. Can be: flex, force, standard. Default: force. */ columnMode: string; /** * It is rows quontity per page. Type number. Default: 3. To show all rows: -1. */ limit: number; /** * It is boolean value to use or not row details section. Default: false. */ expandable: boolean; /** * Means how rows can be expanded at one time. Default: multiple. Can be: multiple or single. */ rowExpand: string; /** * It is height of row in pixels. Type number. Default: 130. */ detailsHeight: number; /** * CfIcon component for the row expanding icon. */ expandIcon: IconModel; /** * CfIcon component for the row collapsing icon. */ collapseIcon: IconModel; /** * It is boolean value to show or not rows section checkboxes. Default: false. */ selectable: boolean; /** * Array with sorting objects. * Default: []. Rows can sorted by multipe columns. * Each sorting object is a json object with two properties: * prop(property name by which to sort rows) and dir(sort direction. Can be: asc or desc). */ sorted: any[]; /** * Array for selected items. */ selected: any[]; /** *

Output event with two properties: type and value.

*

Type can be: all or row

*

When type is all - value can be true(all details rows was expanded) or * false(all details rows was compressed).

*

When type is row - value is an row json object.

*/ onDetailsToggle: EventEmitter; /** *

Output event with selected items array

*/ onSelect: EventEmitter; /** *

Output event with two properties: value and rows.

*

Value is a search string.

*

Rows is an array with filtered rows.

*/ onFilter: EventEmitter; /** *

Output event with four properties: column, newValue, prevValue, sorts.

*

Column is data with ngx-datatable column properties.

*

NewValue can be: asc(ascending sorting), desc(descending sorting) or undefined(not sorted).

*

PrevValue can be: asc(ascending sorting), desc(descending sorting) or undefined(not sorted).

*

Sorts is an array with sorting object(s).

*/ onSort: EventEmitter; /**@hidden * Object to register element state and compute differences. */ differ: any; /**@hidden */ _viewCols: any; /** @hidden */ constructor(_renderer: Renderer, elementRef: ElementRef, /**@hidden */ templateService: TemplateService, differs: IterableDiffers); /** @hidden */ ngOnInit(): void; /**@hidden */ checkColProp(col: any): any; /**@hidden */ expandAllRows(): void; /**@hidden */ collapseAllRows(): void; /** @hidden * After content was initialized, will be created columns array definition * with names and templates and also will be created object for rows details templates. */ ngAfterContentInit(): void; /**@hidden */ setColHeaderClasses(align: any): string; /**@hidden */ setColCellClasses(align: any): string; /**@hidden */ ngAfterViewInit(): void; /**@hidden */ ngDoCheck(): void; /**@hidden */ ngOnDestroy(): void; /**@hidden */ onPageChange(event: any): void; /**@hidden */ updateRows(newRows: any): void; /** @hidden * Function for filtering Datatable. Goes to first page of Datatable after filtering. */ updateFilter(event: any): void; /** @hidden * Function for selection rows with rows checkboxes. */ onSelectRows({selected}: { selected: any; }): void; /** @hidden * Function for toggle each row details section. */ toggleExpandRow(row: any): void; /** @hidden * Function to emit toggle event * @param event object with type and value properties */ onDetailToggle(event: any): void; /** @hidden * Function to emit sorting event * @param event sort object */ onSortRows(event: any): void; /** @hidden * Function for updating Datatable when rows length was changed by user custom functions. */ checkFiltered(type: string, i: number, it: Object): void; }