import { AfterContentChecked, ChangeDetectorRef, EmbeddedViewRef, IterableDiffers, OnDestroy, OnInit, QueryList, TrackByFunction } from '@angular/core'; import { ThemePalette } from '@ngx-simple/core/common-behaviors'; import { BehaviorSubject } from 'rxjs'; import { SimColumnDefDirective } from './cell'; import { SimCellOutletMultiRowContext, SimCellOutletRowContext, SimFooterRowDefDirective, SimHeaderRowDefDirective, SimRowDefDirective } from './row'; import { RowOutlet, SimFooterRowOutletDirective, SimHeaderRowOutletDirective, SimRowOutletDirective } from './table.directive'; export interface RenderRow { data: T; dataIndex: number; rowDef: SimRowDefDirective; } export interface RowContext extends SimCellOutletMultiRowContext, SimCellOutletRowContext { } export declare abstract class RowViewRef extends EmbeddedViewRef> { } export declare class SimTableComponent implements OnInit, AfterContentChecked, OnDestroy { private _differs; private _changeDetectorRef; color: ThemePalette; /** 表格和其中的每个单元格增加边框 */ bordered: boolean; /** 给 之内的每一行增加斑马条纹样式 */ striped: boolean; /** 用于查找数据源提供的数据中的更改 */ private _dataDiffer; get dataSource(): any; set dataSource(value: any); private _dataSource; get trackBy(): TrackByFunction; set trackBy(fn: TrackByFunction); private _trackByFn; get multiTemplateDataRows(): boolean; set multiTemplateDataRows(v: boolean); _multiTemplateDataRows: boolean; _rowOutlet: SimRowOutletDirective; _headerRowOutlet: SimHeaderRowOutletDirective; _footerRowOutlet: SimFooterRowOutletDirective; _presetColumnDefs: QueryList; /** 获取 */ _contentColumnDefs: QueryList; /** 获取 */ _contentRowDefs: QueryList>; /** 获取 */ _contentHeaderRowDefs: QueryList>; /** 获取 */ _contentFooterRowDefs: QueryList>; viewChange: BehaviorSubject<{ start: number; end: number; }>; /** table._data的引用,提供给column组件扩展 我们不允许直接改写 不提供`set data` */ get data(): T[] | readonly T[]; private _columnDefsByName; private _cachedRenderRowsMap; /** 此表可使用的所有行定义的集合。由使用'ContentChildren'收集的行以及添加到'_customRowDefs'中的自定义行填充 */ private _rowDefs; private _headerRowDefs; private _footerRowDefs; /** 存储没有when谓词的行定义 */ private _defaultRowDef; /** 数据源提供的最新数据 */ private _data; private _renderRows; /** 侦听数据源提供的数据的订阅 */ private _renderChangeSubscription; /** 当组件被销毁时发送的主题 */ private _destroyed$; /** * Column definitions that were defined outside of the direct content children of the table. * These will be defined when, e.g., creating a wrapper around the cdkTable that has * column definitions as *its* content child. */ private _customColumnDefs; /** * Data row definitions that were defined outside of the direct content children of the table. * These will be defined when, e.g., creating a wrapper around the cdkTable that has * built-in data rows as *its* content child. */ private _customRowDefs; /** * Header row definitions that were defined outside of the direct content children of the table. * These will be defined when, e.g., creating a wrapper around the cdkTable that has * built-in header rows as *its* content child. */ private _customHeaderRowDefs; /** * Footer row definitions that were defined outside of the direct content children of the table. * These will be defined when, e.g., creating a wrapper around the cdkTable that has a * built-in footer row as *its* content child. */ private _customFooterRowDefs; /** * 标题行定义是否已更改。在检查内容后触发对标题行的更新。初始化为true,以便表呈现初始的行集。 */ private _headerRowDefChanged; /** * 页脚行定义是否已更改。在检查内容后触发对页脚行的更新。初始化为true,以便表呈现初始的行集。 */ private _footerRowDefChanged; constructor(_differs: IterableDiffers, _changeDetectorRef: ChangeDetectorRef); ngOnInit(): void; ngAfterContentChecked(): void; ngOnDestroy(): void; /** * Checks if there has been a change in sticky states since last check and applies the correct * sticky styles. Since checking resets the "dirty" state, this should only be performed once * during a change detection and after the inputs are settled (after content check). */ private _checkStickyStates; /** Adds a column definition that was not included as part of the content children. */ addColumnDef(columnDef: SimColumnDefDirective): void; /** Removes a column definition that was not included as part of the content children. */ removeColumnDef(columnDef: SimColumnDefDirective): void; /** Adds a row definition that was not included as part of the content children. */ addRowDef(rowDef: SimRowDefDirective): void; /** Removes a row definition that was not included as part of the content children. */ removeRowDef(rowDef: SimRowDefDirective): void; /** 添加未作为内容子元素的一部分包含的标题行定义 */ addHeaderRowDef(headerRowDef: SimHeaderRowDefDirective): void; /** 删除未作为内容子元素包含的标题行定义 */ removeHeaderRowDef(headerRowDef: SimHeaderRowDefDirective): void; /** Adds a footer row definition that was not included as part of the content children. */ addFooterRowDef(footerRowDef: SimFooterRowDefDirective): void; /** Removes a footer row definition that was not included as part of the content children. */ removeFooterRowDef(footerRowDef: SimFooterRowDefDirective): void; renderRows(): void; /** 获取已在行出口中呈现的行列表 */ _getRenderedRows(rowOutlet: RowOutlet): HTMLElement[]; _getRowDefs(data: T, dataIndex: number): SimRowDefDirective[]; private _forceRenderHeaderRows; private _forceRenderFooterRows; private _updateRowIndexContext; private _getAllRenderRows; private _getRenderRowsForData; private _cacheRowDefs; /** 更新包含内容列定义的映射 */ private _cacheColumnDefs; private _switchDataSource; /** 为数据源提供的数据设置订阅 */ private _observeRenderChanges; /** 为数据行模板创建嵌入视图,并将其放在数据行视图容器中的正确索引位置。 */ private _insertRow; private _renderRow; /** 获取所提供的行定义的列定义 */ private _getCellTemplates; /** 从QueryList中筛选属于此表的定义 */ private _getOwnDefs; }