util.d.ts 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. import type { IPopperOptions } from 'element-plus/es/components/popper';
  2. import type { Nullable } from 'element-plus/es/utils';
  3. import type { TableColumnCtx } from './table-column/defaults';
  4. export declare const getCell: (event: Event) => HTMLTableCellElement | null;
  5. export declare const orderBy: <T>(array: T[], sortKey: string, reverse: string | number, sortMethod: any, sortBy: string | (string | ((a: T, b: T, array?: T[] | undefined) => number))[]) => T[];
  6. export declare const getColumnById: <T>(table: {
  7. columns: TableColumnCtx<T>[];
  8. }, columnId: string) => TableColumnCtx<T> | null;
  9. export declare const getColumnByKey: <T>(table: {
  10. columns: TableColumnCtx<T>[];
  11. }, columnKey: string) => TableColumnCtx<T>;
  12. export declare const getColumnByCell: <T>(table: {
  13. columns: TableColumnCtx<T>[];
  14. }, cell: HTMLElement, namespace: string) => TableColumnCtx<T> | null;
  15. export declare const getRowIdentity: <T>(row: T, rowKey: string | ((row: T) => any)) => string;
  16. export declare const getKeysMap: <T>(array: T[], rowKey: string) => Record<string, {
  17. row: T;
  18. index: number;
  19. }>;
  20. export declare function mergeOptions<T, K>(defaults: T, config: K): T & K;
  21. export declare function parseWidth(width: number | string): number | string;
  22. export declare function parseMinWidth(minWidth: number | string): number | string;
  23. export declare function parseHeight(height: number | string): string | number | null;
  24. export declare function compose(...funcs: any[]): any;
  25. export declare function toggleRowStatus<T>(statusArr: T[], row: T, newVal: boolean): boolean;
  26. export declare function walkTreeNode(root: any, cb: any, childrenKey?: string, lazyKey?: string): void;
  27. export declare let removePopper: any;
  28. export declare function createTablePopper(parentNode: HTMLElement | undefined, trigger: HTMLElement, popperContent: string, popperOptions: Partial<IPopperOptions>, tooltipEffect: string): Nullable<{
  29. $: import("vue").ComponentInternalInstance;
  30. $data: {};
  31. $props: Partial<{
  32. readonly role: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "group" | "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "navigation" | "tree", unknown>;
  33. }> & Omit<Readonly<import("vue").ExtractPropTypes<{
  34. readonly role: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "group" | "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "navigation" | "tree", unknown, "tooltip", boolean>;
  35. }>> & import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, "role">;
  36. $attrs: {
  37. [x: string]: unknown;
  38. };
  39. $refs: {
  40. [x: string]: unknown;
  41. };
  42. $slots: Readonly<{
  43. [name: string]: import("vue").Slot | undefined;
  44. }>;
  45. $root: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
  46. $parent: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null;
  47. $emit: (event: string, ...args: any[]) => void;
  48. $el: any;
  49. $options: import("vue").ComponentOptionsBase<Readonly<import("vue").ExtractPropTypes<{
  50. readonly role: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "group" | "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "navigation" | "tree", unknown, "tooltip", boolean>;
  51. }>>, {
  52. props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
  53. readonly role: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "group" | "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "navigation" | "tree", unknown, "tooltip", boolean>;
  54. }>> & {
  55. [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
  56. }>>;
  57. triggerRef: import("vue").Ref<HTMLElement | undefined>;
  58. popperInstanceRef: import("vue").Ref<import("@popperjs/core").Instance | undefined>;
  59. contentRef: import("vue").Ref<HTMLElement | undefined>;
  60. referenceRef: import("vue").Ref<HTMLElement | undefined>;
  61. role: import("vue").ComputedRef<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "group" | "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "navigation" | "tree", unknown>>;
  62. popperProvides: import("../../..").ElPopperInjectionContext;
  63. }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, {
  64. readonly role: import("element-plus/es/utils").EpPropMergeType<StringConstructor, "group" | "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "navigation" | "tree", unknown>;
  65. }> & {
  66. beforeCreate?: ((() => void) | (() => void)[]) | undefined;
  67. created?: ((() => void) | (() => void)[]) | undefined;
  68. beforeMount?: ((() => void) | (() => void)[]) | undefined;
  69. mounted?: ((() => void) | (() => void)[]) | undefined;
  70. beforeUpdate?: ((() => void) | (() => void)[]) | undefined;
  71. updated?: ((() => void) | (() => void)[]) | undefined;
  72. activated?: ((() => void) | (() => void)[]) | undefined;
  73. deactivated?: ((() => void) | (() => void)[]) | undefined;
  74. beforeDestroy?: ((() => void) | (() => void)[]) | undefined;
  75. beforeUnmount?: ((() => void) | (() => void)[]) | undefined;
  76. destroyed?: ((() => void) | (() => void)[]) | undefined;
  77. unmounted?: ((() => void) | (() => void)[]) | undefined;
  78. renderTracked?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
  79. renderTriggered?: (((e: import("vue").DebuggerEvent) => void) | ((e: import("vue").DebuggerEvent) => void)[]) | undefined;
  80. errorCaptured?: (((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void) | ((err: unknown, instance: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}>> | null, info: string) => boolean | void)[]) | undefined;
  81. };
  82. $forceUpdate: () => void;
  83. $nextTick: typeof import("vue").nextTick;
  84. $watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
  85. } & Readonly<import("vue").ExtractPropTypes<{
  86. readonly role: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "group" | "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "navigation" | "tree", unknown, "tooltip", boolean>;
  87. }>> & import("vue").ShallowUnwrapRef<{
  88. props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
  89. readonly role: import("element-plus/es/utils").EpPropFinalized<StringConstructor, "group" | "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "navigation" | "tree", unknown, "tooltip", boolean>;
  90. }>> & {
  91. [x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any) | undefined;
  92. }>>;
  93. triggerRef: import("vue").Ref<HTMLElement | undefined>;
  94. popperInstanceRef: import("vue").Ref<import("@popperjs/core").Instance | undefined>;
  95. contentRef: import("vue").Ref<HTMLElement | undefined>;
  96. referenceRef: import("vue").Ref<HTMLElement | undefined>;
  97. role: import("vue").ComputedRef<import("element-plus/es/utils").EpPropMergeType<StringConstructor, "group" | "listbox" | "grid" | "menu" | "tooltip" | "dialog" | "navigation" | "tree", unknown>>;
  98. popperProvides: import("../../..").ElPopperInjectionContext;
  99. }> & {} & import("vue").ComponentCustomProperties>;
  100. export declare const isFixedColumn: <T>(index: number, fixed: string | boolean, store: any, realColumns?: TableColumnCtx<T>[] | undefined) => {
  101. direction: any;
  102. start: number;
  103. after: number;
  104. } | {
  105. direction?: undefined;
  106. start?: undefined;
  107. after?: undefined;
  108. };
  109. export declare const getFixedColumnsClass: <T>(namespace: string, index: number, fixed: string | boolean, store: any, realColumns?: TableColumnCtx<T>[] | undefined, offset?: number) => string[];
  110. export declare const getFixedColumnOffset: <T>(index: number, fixed: string | boolean, store: any, realColumns?: TableColumnCtx<T>[] | undefined) => any;
  111. export declare const ensurePosition: (style: any, key: string) => void;