fb564b18f19c56e9589f11a0d8294f39ff1f5b23f0d14b6894e6b3d0777c819fc71dcb2e837a282a00524c76376812eee7da45fec4b0b91e50ef6f78dfd9dd 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import { type ElTooltipProps } from 'element-plus/es/components/tooltip';
  2. import type { DefaultRow, Table, TreeProps } from './table/defaults';
  3. import type { TableColumnCtx } from './table-column/defaults';
  4. import type { CSSProperties, VNode } from 'vue';
  5. export type TableOverflowTooltipOptions = Partial<Pick<ElTooltipProps, 'appendTo' | 'effect' | 'enterable' | 'hideAfter' | 'offset' | 'placement' | 'popperClass' | 'popperOptions' | 'showAfter' | 'showArrow' | 'transition'>>;
  6. export type TableOverflowTooltipFormatter<T extends DefaultRow> = (data: {
  7. row: T;
  8. column: TableColumnCtx<T>;
  9. cellValue: any;
  10. }) => VNode | string;
  11. type RemovePopperFn = (() => void) & {
  12. trigger?: HTMLElement;
  13. vm?: VNode;
  14. };
  15. export declare const getCell: (event: Event) => HTMLTableCellElement | null;
  16. export declare const orderBy: <T extends DefaultRow>(array: T[], sortKey: string | null, reverse: string | number | null, sortMethod: TableColumnCtx<T>["sortMethod"] | null, sortBy: string | string[] | ((a: T, index: number, array?: T[]) => string)) => T[];
  17. export declare const getColumnById: <T extends DefaultRow>(table: {
  18. columns: TableColumnCtx<T>[];
  19. }, columnId: string) => null | TableColumnCtx<T>;
  20. export declare const getColumnByKey: <T extends DefaultRow>(table: {
  21. columns: TableColumnCtx<T>[];
  22. }, columnKey: string) => TableColumnCtx<T>;
  23. export declare const getColumnByCell: <T extends DefaultRow>(table: {
  24. columns: TableColumnCtx<T>[];
  25. }, cell: HTMLElement, namespace: string) => null | TableColumnCtx<T>;
  26. export declare const getRowIdentity: <T extends DefaultRow>(row: T, rowKey: string | ((row: T) => string) | null) => string;
  27. export declare const getKeysMap: <T extends DefaultRow>(array: T[], rowKey: string | null, flatten?: boolean, childrenKey?: string) => Record<PropertyKey, {
  28. row: T;
  29. index: number;
  30. }>;
  31. export declare function mergeOptions<T extends DefaultRow, K extends DefaultRow>(defaults: T, config: K): T & K;
  32. export declare function parseWidth(width?: number | string): number | string;
  33. export declare function parseMinWidth(minWidth: number | string): number | string;
  34. export declare function parseHeight(height: number | string | null): string | number | null;
  35. export declare function compose(...funcs: ((...args: any[]) => void)[]): (...args: any[]) => void;
  36. export declare function toggleRowStatus<T extends DefaultRow>(statusArr: T[], row: T, newVal?: boolean, tableTreeProps?: TreeProps, selectable?: ((row: T, index: number) => boolean) | null, rowIndex?: number, rowKey?: string | null): boolean;
  37. export declare function walkTreeNode<T extends DefaultRow>(root: T[], cb: (parent: any, children: T | T[] | null, level: number) => void, childrenKey?: string, lazyKey?: string, lazy?: boolean): void;
  38. export declare let removePopper: RemovePopperFn | null;
  39. export declare function createTablePopper<T extends DefaultRow>(props: TableOverflowTooltipOptions, popperContent: string, row: T, column: TableColumnCtx<T> | null, trigger: HTMLElement | null, table: Table<DefaultRow>): void;
  40. export declare const isFixedColumn: <T extends DefaultRow>(index: number, fixed: string | boolean | undefined, store: any, realColumns?: TableColumnCtx<T>[]) => {
  41. direction: string;
  42. start: number;
  43. after: number;
  44. } | {
  45. direction?: undefined;
  46. start?: undefined;
  47. after?: undefined;
  48. };
  49. export declare const getFixedColumnsClass: <T extends DefaultRow>(namespace: string, index: number, fixed: string | boolean | undefined, store: any, realColumns?: TableColumnCtx<T>[], offset?: number) => string[];
  50. export declare const getFixedColumnOffset: <T extends DefaultRow>(index: number, fixed: string | boolean | undefined, store: any, realColumns?: TableColumnCtx<T>[]) => CSSProperties | undefined;
  51. export declare const ensurePosition: (style: CSSProperties | undefined, key: keyof CSSProperties) => void;
  52. export {};