7665326939a781324f7ca6a191c11b146b11be957abe0b96f751fc0470b81f154f3e73bed2193ea545e1b283bd5c0eaa47362dae15f28adb2eff307ad934f0 1.1 KB

12345678910111213141516171819202122232425262728
  1. import type { Ref } from 'vue';
  2. import type { Alignment as ScrollStrategy } from 'element-plus/es/components/virtual-list';
  3. import type { TableV2Props } from '../table';
  4. import type { TableGridInstance } from '../table-grid';
  5. export type ScrollPos = {
  6. scrollLeft: number;
  7. scrollTop: number;
  8. };
  9. type GridInstanceRef = Ref<TableGridInstance | undefined>;
  10. type UseScrollBarProps = {
  11. mainTableRef: GridInstanceRef;
  12. leftTableRef: GridInstanceRef;
  13. rightTableRef: GridInstanceRef;
  14. onMaybeEndReached: () => void;
  15. };
  16. export type { ScrollStrategy };
  17. export declare const useScrollbar: (props: TableV2Props, { mainTableRef, leftTableRef, rightTableRef, onMaybeEndReached, }: UseScrollBarProps) => {
  18. scrollPos: Ref<{
  19. scrollLeft: number;
  20. scrollTop: number;
  21. }>;
  22. scrollTo: (params: ScrollPos) => void;
  23. scrollToLeft: (scrollLeft: number) => void;
  24. scrollToTop: (scrollTop: number) => void;
  25. scrollToRow: (row: number, strategy?: ScrollStrategy) => void;
  26. onScroll: (params: ScrollPos) => void;
  27. onVerticalScroll: ({ scrollTop }: ScrollPos) => void;
  28. };