Skip to content

Commit

Permalink
chore(table): 规范代码结构(#3044)
Browse files Browse the repository at this point in the history
  • Loading branch information
wanjinping committed Nov 18, 2024
1 parent cd3041a commit 44f90cf
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .changeset/moody-bikes-raise.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
"@hi-ui/table": patch
"@hi-ui/hiui": patch
"@hi-ui/table": minor
"@hi-ui/hiui": minor
---

feat(table): 设置滚动位置(#3044)
19 changes: 17 additions & 2 deletions packages/ui/table/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react'
import { PaginationProps } from '@hi-ui/pagination'
import { PopperOverlayProps } from '@hi-ui/popper'
import { TreeHelper } from '@hi-ui/tree'

export type TableColumnItemAlignEnum = 'left' | 'right' | 'center'

Expand Down Expand Up @@ -306,4 +305,20 @@ export interface TableRowRequiredProps {

export type TableRowRecord = Record<string, any>

export type TableHelper = TreeHelper
export type ScrollAlign = 'top' | 'bottom' | 'auto'

export type ScrollConfig =
| {
index: number
align?: ScrollAlign
offset?: number
}
| {
key: React.Key
align?: ScrollAlign
offset?: number
}

export interface TableHelper {
scrollTo?: (arg: number | ScrollConfig) => void
}

0 comments on commit 44f90cf

Please sign in to comment.