import { CdsTooltip } from '../../CdsTooltip'; import { NTable } from '../interface'; import { ComponentProps } from '../../../utils'; import { PropType, Ref } from 'vue'; export interface ITableProps { id?: string; data?: RecordType[]; columns?: NTable.NColumn.TColumns; rowKey?: string | NTable.NRow.TGetRowKey; rowClassName?: string | NTable.NRow.TClassName; tableLayout?: NTable.TLayout; showHeader?: boolean; sticky?: boolean | NTable.NSticky.ISticky; loading?: boolean; hovered?: boolean; bordered?: boolean; borderless?: boolean; header?: NTable.NRender.TPanelRender; footer?: NTable.NRender.TPanelRender; components?: NTable.NCustomize.TableComponents; customRow?: NTable.NCustomize.TGetComponentProps; customHeaderRow?: NTable.NCustomize.TGetComponentProps[]>; pagination?: false | NTable.NPagination.IProps; scroll?: NTable.TScroll; sortDirections?: NTable.TSortOrder[]; showSorterTooltip?: boolean | ComponentProps; expandFixed?: NTable.TFixed; expandColumnWidth?: number; expandedRowKeys?: NTable.TKey[]; expandIconColumnIndex?: number; rowSelection?: NTable.NRow.IRowSelection; defaultExpandedRowKeys?: NTable.TKey[]; defaultExpandAllRows?: boolean; canExpandable?: boolean; expandedRowRender?: NTable.NExpand.TExpandedRowRender; expandRowByClick?: boolean; expandIcon?: NTable.NExpand.TRenderExpandIcon; indentSize: number; showExpandColumn?: boolean; expandedRowClassName?: NTable.NRow.TClassName; childrenColumnName?: string; rowExpandable?: NTable.NExpand.IExpandable['rowExpandable']; transformCellText?: NTable.NCell.TTransformCellText; getPopupContainer?: NTable.NCustomize.TGetPopupContainer; onChange?: (pagination: NTable.NPagination.IProps, filters: Record, sorter: NTable.ISorterResult | NTable.ISorterResult[], extra: NTable.ICurrentData) => void; onExpand?: (expanded: boolean, record: RecordType) => void; onExpandedRowsChange?: (expandedKeys: NTable.TKey[]) => void; onResizeColumn?: (width: number, column: NTable.NColumn.IColumn) => void; /** * @private Internal usage, may remove by refactor. Should always use `columns` instead. * * !!! DO NOT USE IN PRODUCTION ENVIRONMENT !!! */ internalHooks?: string; /** * @private Internal usage, may remove by refactor. Should always use `columns` instead. * * !!! DO NOT USE IN PRODUCTION ENVIRONMENT !!! */ transformColumns?: (columns: NTable.NColumn.TColumns) => NTable.NColumn.TColumns; /** * @private Internal usage, may remove by refactor. * * !!! DO NOT USE IN PRODUCTION ENVIRONMENT !!! */ internalRefs?: { body: HTMLDivElement | null; }; /** * @private Internal usage, may remove by refactor. * * !!! DO NOT USE IN PRODUCTION ENVIRONMENT !!! */ onUpdateInternalRefs?: (refs: Record) => void; } export declare const makeTableProps: (defaults?: Defaults | undefined) => import('../../../utils').AppendDefault<{ /** * Идентификатор таблицы */ id: { type: PropType; default: undefined; }; /** * Массив данных для отображения в таблице */ data: { type: PropType; default: undefined; }; /** * Колонки таблицы */ columns: { type: PropType>; default: undefined; }; /** * Уникальный ключ строки может быть строкой или функцией возвращающей строку */ rowKey: { type: PropType>; default: string; }; /** * Классы строки */ rowClassName: { type: PropType>; default: undefined; }; /** * Фиксированный или авто лэйаут */ tableLayout: { type: PropType; default: undefined; }; /** * Показывать ли заголовок таблицы */ showHeader: { type: PropType; default: undefined; }; /** * Sticky для заголовка и скроллбара */ sticky: { type: PropType; default: undefined; }; /** * Загрузка таблицы */ loading: { type: PropType; default: boolean; }; /** * Подсвечивание строки при наведении */ hovered: { type: PropType; default: boolean; }; /** * Показывать все границы таблицы */ bordered: { type: PropType; default: boolean; }; /** * Убрать все границы таблицы */ borderless: { type: PropType; default: boolean; }; /** * Рендер заголовка таблицы */ header: { type: PropType>; default: undefined; }; /** * Рендер тулбара таблицы */ toolbar: { type: PropType>; default: undefined; }; /** * Рендер футера таблицы */ footer: { type: PropType>; default: undefined; }; /** * Переопределить компоненты таблицы по умолчанию */ components: { type: PropType>; default: undefined; }; /** * Устанавливает свойства для каждой строки */ customRow: { type: PropType>; default: undefined; }; /** * Устанавливает свойства для каждой строки заголовка */ customHeaderRow: { type: PropType[]>>; default: undefined; }; /** * Конфигурация пагинации таблицы */ pagination: { type: PropType; default: undefined; }; /** * Можно ли скроллить таблицу */ scroll: { type: PropType; default: undefined; }; /** * Сортировка данных в таблице. 'ascend' | 'descend' */ sortDirection: { type: PropType; default: undefined; }; /** * Показывать ли тултипы для сортировки в заголовке. Можно передать объект со свойствами для CdsTooltip. */ showSorterTooltip: { type: PropType>; default: boolean; }; /** * Сделать колонку с раскрытием фиксированной (left | right | boolean) */ expandFixed: { type: PropType; default: undefined; }; /** * Ширина колонки с раскрытием */ expandColumnWidth: { type: PropType; default: undefined; }; /** * Ключи текущих раскрытых строк (поддерживает v-model) */ expandedRowKeys: { type: PropType; default: ITableProps["expandedRowKeys"]; }; /** * Конфигурация для выбора строк */ rowSelection: { type: PropType>; default: undefined; }; /** * Ключи раскрытых строк по умолчанию */ defaultExpandedRowKeys: { type: PropType; default: ITableProps["defaultExpandedRowKeys"]; }; /** * По умолчанию все колонки раскрыты */ defaultExpandAllRows: { type: PropType; default: boolean; }; /** * Может раскрываться */ canExpandable: { type: PropType; default: boolean; }; /** * Рендер для каждой раскрытой строки */ expandedRowRender: { type: PropType>; default: undefined; }; /** * Раскрытие строки по клику в любое место этой строки */ expandRowByClick: { type: PropType; default: boolean; }; /** * Индекс колонки, в которой будет располагаться иконка раскрытия */ expandIconColumnIndex: { type: PropType; default: undefined; }; /** * Своя иконка раскрытия */ expandIcon: { type: PropType>; default: undefined; }; /** * Размер отступа в пикселях для каждого уровня вложенности */ indentSize: { type: PropType; default: number; }; /** * Показать раскрытую колонку */ showExpandColumn: { type: PropType; default: undefined; }; /** * Классы для строк в раскрытом состоянии */ expandedRowClassName: { type: PropType>; default: undefined; }; /** * Названия свойства для дочерних элементов */ childrenColumnName: { type: PropType; default: string; }; /** * Строку можно раскрыть */ rowExpandable: { type: PropType; default: undefined; }; /** * Трансформировать текст в ячейке */ transformCellText: { type: PropType>; default: undefined; }; /** * Контейнер рендеринга выпадающих списков */ getPopupContainer: { type: PropType; default: undefined; }; /** * Событие при изменении пагинации, фильтров, сортировки */ onChange: { type: PropType<(pagination: NTable.NPagination.IProps, filters: Record, sorters: NTable.ISorterResult | NTable.ISorterResult[], extra: NTable.ICurrentData) => void>; default: undefined; }; /** * Событие изменения размера колонки */ onResizeColumn: { type: PropType<(width: number, column: NTable.NColumn.IColumn) => void>; default: undefined; }; /** * Событие при раскрытии строки */ onExpand: { type: PropType<(expanded: boolean, record: NTable.TDefaultRecord) => void>; default: undefined; }; /** * Событие при изменении раскрытых строк */ onExpandedRowsChange: { type: PropType<(expandedKeys: NTable.TKey[]) => void>; default: undefined; }; }, Defaults>; export declare function useLazyKVMap(dataRef: Ref, childrenColumnNameRef: Ref, getRowKeyRef: Ref>): { getRecordByKey: (key: NTable.TKey) => NonNullable; };