import * as i0 from '@angular/core'; import { TemplateRef, EventEmitter, InjectionToken, OnInit, OnChanges, AfterViewInit, OnDestroy, ElementRef, QueryList, SimpleChanges, PipeTransform } from '@angular/core'; import { SafeAny, Dictionary } from 'ngx-tethys/types'; import * as i10 from '@angular/cdk/drag-drop'; import { CdkDragStart, CdkDragEnd, CdkDrag, CdkDropList, CdkDragDrop } from '@angular/cdk/drag-drop'; import * as i1 from 'ngx-tethys/util'; import * as i1$1 from '@angular/common'; import * as i2 from '@angular/forms'; import * as i3 from 'ngx-tethys/pagination'; import * as i4 from 'ngx-tethys/switch'; import * as i5 from 'ngx-tethys/loading'; import * as i6 from 'ngx-tethys/empty'; import * as i7 from 'ngx-tethys/shared'; import * as i8 from 'ngx-tethys/skeleton'; import * as i9 from 'ngx-tethys/icon'; import * as i11 from '@angular/cdk/scrolling'; declare enum ThyTableColumnSkeletonType { title = "title", member = "member", default = "default", checkbox = "checkbox" } declare enum ThyTableSortDirection { default = "", asc = "asc", desc = "desc" } interface ThyTableColumn { key: string; model: string; title: string; type: string; selections: any; width: string | number; className: string; headerClassName: string; disabled: boolean; defaultText: string; expand: boolean; templateRef: TemplateRef; headerTemplateRef: TemplateRef; fixed?: 'left' | 'right'; left?: number; right?: number; sortable?: boolean; operational?: boolean; secondary?: boolean; sortDirection?: ThyTableSortDirection; sortChange?: EventEmitter; } interface ThyPage { index?: number; size?: number; total?: number; sizeOptions?: number[]; } interface ThyTableEmptyOptions { message?: string; iconName?: string; size?: string; marginTop?: string; topAuto?: string; container?: TemplateRef; } type PageChangedEvent = ThyPageChangedEvent; interface ThyPageChangedEvent { itemsPerPage: number; page: number; } interface ThyTableEvent { event: Event; row: any; } interface ThyMultiSelectEvent extends ThyTableEvent { rows: any[]; } interface ThyRadioSelectEvent { event: Event; row: any; } interface ThySwitchEvent extends ThyTableEvent { refresh?: Function; } interface ThyTableDraggableEvent { oldIndex?: number; newIndex?: number; model?: any; models?: Array; [key: string]: any; } interface ThyTableSortEvent { event: Event; key: string; direction: ThyTableSortDirection; } interface ThyTableRowEvent { event: Event; row: any; } interface ThyTableSkeletonColumn { width: number | string; type: ThyTableColumnSkeletonType; } type ThyTableAppearance = 'default' | 'bordered' | 'boxed'; /** @deprecated use ThyTableAppearance, will be removed in v23 */ type ThyTableTheme = ThyTableAppearance; type ThyTableSize = 'md' | 'sm' | 'xs' | 'lg' | 'xlg' | 'default'; type ThyTableVariant = 'list' | 'group' | 'tree'; /** @deprecated use ThyTableVariant, will be removed in v23 */ type ThyTableMode = ThyTableVariant; interface IThyTableColumnParentComponent { rowKey: string; updateColumnSelections(key: string, selections: any): void; } /** * Injection token used to provide the parent component to options. */ declare const THY_TABLE_COLUMN_PARENT_COMPONENT: InjectionToken; type FixedDirection = 'left' | 'right'; /** * 表格列组件 * @name thy-table-column * @order 20 */ declare class ThyTableColumnComponent implements OnInit { private el; parent: IThyTableColumnParentComponent; /** * 设置数据属性 Key,读取数组中对象的当前 Key 值 * @type string */ model: string; /** * 设置列名,显示在表头 * @type string */ title: string; /** * 设置列的特殊类型,序列号、选择框、单选框、切换按钮 * @type string */ type: string; /** * 设置列的宽度 */ readonly thyWidth: i0.InputSignalWithTransform; private readonly widthValue; get width(): string; set width(value: string); minWidth: string; /** * 设置列的最小宽度 */ set thyMinWidth(value: string | number); /** * 设置列的样式 */ className: string; /** * 设置列头部的 Class,即 th 元素上的样式 * @type string */ headerClassName: string; /** * 设置自定义类型的禁用状态 * @type boolean */ disabled: boolean; /** * thyType 为 checkbox 或者 radio 类型时选中的数据 ,支持单个对象,单个 Id,同时支持多个 Id,多个对象 */ set selections(value: any); get selections(): any; /** * 设置数据为空的时候显示的文本 * @type string */ defaultText: string; /** * 设置 Tree 模式下折叠展开按钮展示列,不传默认第一列 */ expand: boolean; sortable: boolean; /** * 是否开启列排序功能(开启时 thyModelKey 为 必传) * @default false */ set thySortable(value: boolean); /** * 默认列排序顺序 * @type 'asc' | 'desc' | '' */ sortDirection: ThyTableSortDirection; /** * 设置固定列 */ fixed?: FixedDirection; /** * 当前列是否是操作列,设置为 true 时会追加 thy-operation-links 样式类,文字居中 * @default false */ operational?: boolean; /** * 当前列是否是次要列,设置为 true 时会追加 thy-table-column-secondary 样式类,文字颜色为 $gray-600 * @default false */ secondary?: boolean; /** * 列排序修改事件 */ readonly sortChange: EventEmitter; readonly headerTemplateRef: i0.Signal | undefined>; private readonly cellTemplate; private readonly firstTemplateRef; readonly cellTemplateRef: i0.Signal | undefined>; key: string; left?: number; right?: number; private _selections; private _firstChange; ngOnInit(): void; private _generateKey; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_disabled: i1.ThyBooleanInput; static ngAcceptInputType_expand: i1.ThyBooleanInput; static ngAcceptInputType_thySortable: i1.ThyBooleanInput; static ngAcceptInputType_operational: i1.ThyBooleanInput; static ngAcceptInputType_secondary: i1.ThyBooleanInput; } declare enum ThyFixedDirection { left = "left", right = "right" } interface ThyTableGroup { id?: string; expand?: boolean; children?: object[]; origin?: T; } /** * 表格组件 * @name thy-table * @order 10 */ declare class ThyTable implements OnInit, OnChanges, AfterViewInit, OnDestroy, IThyTableColumnParentComponent { elementRef: ElementRef; private _differs; private viewportRuler; private updateHostClassService; private document; private platformId; private ngZone; private renderer; private cdr; private readonly destroyRef; customType: { index: string; checkbox: string; radio: string; switch: string; }; model: object[]; groups: ThyTableGroup[]; rowKey: string; groupBy: string; private _variant?; private _mode?; get variant(): ThyTableVariant; className: string; size: ThyTableSize; rowClassName: string | Function; loadingDone: boolean; emptyOptions: ThyTableEmptyOptions; draggable: boolean; selectedRadioRow: SafeAny; pagination: ThyPage; trackByFn: SafeAny; wholeRowSelect: boolean; fixedDirection: typeof ThyFixedDirection; hasFixed: boolean; columns: ThyTableColumnComponent[]; private _diff; private initialized; private _oldThyClassName; private scrollClassName; private get tableScrollElement(); private get scroll$(); /** * 设置数据为空时展示的模板 * @type TemplateRef */ readonly emptyTemplate: i0.Signal | undefined>; tableElementRef: ElementRef; rows: QueryList>; /** * 表格展示形态,列表/分组/树 * @type list | group | tree * @default list */ set thyVariant(value: ThyTableVariant); /** * 表格展示方式(已废弃,将在 v23 彻底删除),请使用 thyVariant * @deprecated please use thyVariant, will be removed in v23 * @type list | group | tree * @default list */ set thyMode(value: ThyTableMode); /** * thyVariant 的值为 `group` 时分组的 Key */ set thyGroupBy(value: string); /** * 设置每行数据的唯一标识属性名 * @default _id */ set thyRowKey(value: SafeAny); /** * 分组数据源 */ set thyGroups(value: SafeAny); /** * 数据源 */ set thyModel(value: SafeAny); /** * 表格的外观,`bordered` 时头部有背景色且分割线区别明显 * @type default | bordered | boxed * @default default */ thyAppearance?: ThyTableAppearance; /** * 表格的显示风格(已废弃,将在 v23 彻底删除),请使用 thyAppearance * @deprecated please use thyAppearance, will be removed in v23 * @type default | bordered | boxed * @default default */ thyTheme: ThyTableTheme; get theme(): ThyTableAppearance; /** * 表格的大小 * @type xs | sm | md | lg | xlg | default * @default md */ set thySize(value: ThyTableSize); /** * 设置表格最小宽度,一般是适用于设置列宽为百分之或auto时限制表格最小宽度' */ thyMinWidth: string | number; /** * 设置为 fixed 布局表格,设置 fixed 后,列宽将严格按照设置宽度展示,列宽将不会根据表格内容自动调整 * @default false */ thyLayoutFixed: boolean; /** * 是否表头固定,若设置为 true, 需要同步设置 thyHeight * @default false */ thyHeaderFixed: boolean; /** * 表格的高度 */ thyHeight: string; /** * 设置表格的样式 */ set thyClassName(value: string); /** * 设置表格行的样式,传入函数,支持 row、index * @type string | (row, index) => string */ set thyRowClassName(value: string | Function); /** * 设置加载状态 * @default true */ set thyLoadingDone(value: boolean); /** * 配置空状态组件 */ set thyEmptyOptions(value: ThyTableEmptyOptions); /** * 是否开启行拖拽 * @default false */ set thyDraggable(value: boolean); /** * 设置当前页码 * @default 1 */ set thyPageIndex(value: number); /** * 设置每页显示数量 * @default 20 */ set thyPageSize(value: number); /** * 设置总页数 */ set thyPageTotal(value: number); /** * 选中当前行是否自动选中 Checkbox,不开启时只有点击 Checkbox 列时才会触发选中 * @default false */ set thyWholeRowSelect(value: boolean); /** * 是否显示表格头 * @default false */ thyHeadless: boolean; /** * 是否显示左侧 Total */ showTotal: boolean; /** * 是否显示调整每页显示条数下拉框 */ showSizeChanger: boolean; /** * 每页显示条数下拉框可选项 * @type number[] */ set pageSizeOptions(value: number[]); /** * thyVariant 为 tree 时,设置 Tree 树状数据展示时的缩进 */ thyIndent: number; /** * thyVariant 为 tree 时,设置 Tree 树状数据对象中的子节点 Key * @type string */ thyChildrenKey: string; /** * 开启 Hover 后显示操作,默认不显示操作区内容,鼠标 Hover 时展示 * @default false */ thyHoverDisplayOperation: boolean; thyDragDisabledPredicate: (item: SafeAny) => boolean; /** * 表格列的骨架类型 * @type ThyTableColumnSkeletonType[] */ readonly thyColumnSkeletonTypes: i0.InputSignal; /** * 切换组件回调事件 */ readonly thyOnSwitchChange: EventEmitter; /** * 表格分页回调事件 */ readonly thyOnPageChange: EventEmitter; /** * 表格分页当前页改变回调事件 */ readonly thyOnPageIndexChange: EventEmitter; readonly thyOnPageSizeChange: EventEmitter; /** * 多选回调事件 */ readonly thyOnMultiSelectChange: EventEmitter; /** * 单选回调事件 */ readonly thyOnRadioSelectChange: EventEmitter; /** * 拖动修改事件 */ readonly thyOnDraggableChange: EventEmitter; /** * 表格行点击触发事件 */ readonly thyOnRowClick: EventEmitter; /** * 列排序修改事件 */ readonly thySortChange: EventEmitter; readonly thyOnRowContextMenu: EventEmitter; readonly groupTemplate: i0.Signal | undefined>; readonly listOfColumnComponents: i0.Signal; expandStatusMap: Dictionary; expandStatusMapOfGroup: Dictionary; private expandStatusMapOfGroupBeforeDrag; dragPreviewClass: string; /** * 列宽和骨架类型可能在列创建之后才绑定(如动态生成的列),随两者变化重新计算 */ readonly skeletonColumns: i0.Signal; constructor(); private _initializeColumns; private _initializeColumnFixedPositions; private _initializeDataModel; private _initialSelections; private _initialCustomModelValue; private _refreshCustomModelValue; private _applyDiffChanges; private _bindTrackFn; private _destroyInvalidAttribute; private _setClass; updateColumnSelections(key: string, selections: SafeAny): void; isTemplateRef(ref: SafeAny): ref is TemplateRef; getModelValue(row: SafeAny, path: string): any; renderRowClassName(row: SafeAny, index: number): any; onModelChange(row: SafeAny, column: ThyTableColumnComponent): void; onStopPropagation(event: Event): void; onPageChange(event: PageChangedEvent): void; onPageIndexChange(event: number): void; onPageSizeChange(event: number): void; onCheckboxChange(row: SafeAny, column: ThyTableColumnComponent): void; onMultiSelectChange(event: Event, row: SafeAny, column: ThyTableColumnComponent): void; onRadioSelectChange(event: Event, row: SafeAny): void; onSwitchChange(event: Event, row: SafeAny, column: SafeAny): void; showExpand(row: SafeAny): any; isExpanded(row: SafeAny): boolean; iconIndentComputed(level: number): number | undefined; tdIndentComputed(level: number, column: SafeAny): { left: string; right: string; position: string; paddingLeft: string; }; expandChildren(row: SafeAny): void; onDragGroupStarted(event: CdkDragStart): void; onDragGroupEnd(event: CdkDragEnd): void; private onDragGroupDropped; onDragStarted(event: CdkDragStart): void; dropListEnterPredicate: (index: number, drag: CdkDrag, drop: CdkDropList) => boolean; private onDragModelDropped; onDragDropped(event: CdkDragDrop): void; onColumnHeaderClick(event: Event, column: ThyTableColumnComponent): void; onRowClick(event: Event, row: SafeAny): void; private onRowClickPropagationEventHandler; onRowContextMenu(event: Event, row: SafeAny): void; private _refreshColumns; private buildGroups; private buildModel; expandGroup(group: ThyTableGroup): void; private expandGroups; private foldGroups; private updateScrollClass; ngOnInit(): void; ngAfterViewInit(): void; ngOnChanges(simpleChanges: SimpleChanges): void; ngOnDestroy(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_thyLayoutFixed: i1.ThyBooleanInput; static ngAcceptInputType_thyHeaderFixed: i1.ThyBooleanInput; static ngAcceptInputType_thyLoadingDone: i1.ThyBooleanInput; static ngAcceptInputType_thyDraggable: i1.ThyBooleanInput; static ngAcceptInputType_thyPageIndex: unknown; static ngAcceptInputType_thyPageSize: unknown; static ngAcceptInputType_thyPageTotal: unknown; static ngAcceptInputType_thyWholeRowSelect: i1.ThyBooleanInput; static ngAcceptInputType_thyHeadless: i1.ThyBooleanInput; static ngAcceptInputType_showTotal: i1.ThyBooleanInput; static ngAcceptInputType_showSizeChanger: i1.ThyBooleanInput; static ngAcceptInputType_thyIndent: unknown; static ngAcceptInputType_thyHoverDisplayOperation: i1.ThyBooleanInput; } /** * @private */ declare class TableIsValidModelValuePipe implements PipeTransform { transform(value: any): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * @private */ declare class TableRowDragDisabledPipe implements PipeTransform { transform(item: SafeAny, dragDisabledPredicate: (item: SafeAny) => boolean): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵpipe: i0.ɵɵPipeDeclaration; } /** * 表格的骨架屏组件 * @name thy-table-skeleton */ declare class ThyTableSkeleton implements AfterViewInit { private cdr; titleTemplate: ElementRef; memberTemplate: ElementRef; defaultTemplate: ElementRef; checkboxTemplate: ElementRef; /** * 骨架边框圆角 */ thyBorderRadius: string | number; /** * 表格内容骨架高度 */ thyRowHeight: string | number; /** * 是否开启动画 * @default true */ thyAnimated: boolean; /** * 动画速度 */ thyAnimatedInterval?: string; /** * 骨架主色 */ thyPrimaryColor?: string; /** * 骨架次色 */ thySecondaryColor?: string; rowCount: number[]; /** * 行数 */ set thyRowCount(value: number | string); /** * 是否展示骨架头 * @default false */ thyHeadless: boolean; /** * 骨架屏的外观 * @type default | bordered | boxed */ thyAppearance?: ThyTableAppearance; /** * 骨架屏的风格(已废弃,将在 v23 彻底删除),请使用 thyAppearance * @deprecated please use thyAppearance, will be removed in v23 * @type default | bordered | boxed */ thyTheme: ThyTableTheme; get appearance(): ThyTableAppearance; /** * 骨架屏的大小 * @type xs | sm | md | lg | xlg | default * @default md */ thySize: ThyTableSize; /** * 设置表格最小宽度 */ thyMinWidth: string | number; /** * 表格列骨架的配置项,支持配置列宽、骨架类型 * @type ThyTableSkeletonColumn[] */ set thyColumns(columns: ThyTableSkeletonColumn[]); titleHeight: string; titleWidth: string; checkboxWidth: string; avatarSize: string; columnType: typeof ThyTableColumnSkeletonType; skeletonColumnsMap: { [key: string]: ElementRef; }; get tableClassMap(): { [x: string]: boolean; table: boolean; 'table-bordered': boolean; 'table-boxed': boolean; }; private defaultColumns; columns: ThyTableSkeletonColumn[]; ngAfterViewInit(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_thyAnimated: i1.ThyBooleanInput; static ngAcceptInputType_thyHeadless: i1.ThyBooleanInput; } declare class ThyTableModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { THY_TABLE_COLUMN_PARENT_COMPONENT, TableIsValidModelValuePipe, TableRowDragDisabledPipe, ThyFixedDirection, ThyTable, ThyTableColumnComponent, ThyTableColumnSkeletonType, ThyTableModule, ThyTableSkeleton, ThyTableSortDirection }; export type { FixedDirection, IThyTableColumnParentComponent, PageChangedEvent, ThyMultiSelectEvent, ThyPage, ThyPageChangedEvent, ThyRadioSelectEvent, ThySwitchEvent, ThyTableAppearance, ThyTableColumn, ThyTableDraggableEvent, ThyTableEmptyOptions, ThyTableEvent, ThyTableMode, ThyTableRowEvent, ThyTableSize, ThyTableSkeletonColumn, ThyTableSortEvent, ThyTableTheme, ThyTableVariant };