@vexip-ui/hooks
Advanced tools
Comparing version 1.11.3 to 1.11.4
@@ -0,2 +1,4 @@ | ||
import { BITree } from '../../common/src/utils'; | ||
import { ComputedRef } from 'vue'; | ||
import { MaybeRef as MaybeRef_2 } from 'vue'; | ||
import { noop } from '../../common/src/utils'; | ||
@@ -6,2 +8,3 @@ import type { Placement } from '@popperjs/core'; | ||
import { Ref } from 'vue'; | ||
import type { Slots } from 'vue'; | ||
import type { VirtualElement } from '@popperjs/core'; | ||
@@ -13,2 +16,6 @@ | ||
export declare function createSlotRender(slots: Slots, names: string[], fallback?: (params?: any) => any): ((params?: any) => any) | null; | ||
declare type Data = Record<string, any>; | ||
export declare type IntersectionHandler = (entry: IntersectionObserverEntry) => any; | ||
@@ -20,4 +27,8 @@ | ||
declare type MaybeRef<T> = Ref<T> | T; | ||
export declare type MaybeRef<T> = Ref<T> | T; | ||
export declare type MaybeRefRecord<T> = { | ||
[K in keyof T]: MaybeRef<T[K]>; | ||
}; | ||
export declare type ModifierState = Readonly<Omit<Record<string, boolean>, 'activeKeys'> & { | ||
@@ -310,11 +321,13 @@ activeKeys: Set<string>; | ||
export declare function useVirtual(options: VirtualOptions): { | ||
wrapper: Ref<HTMLElement | null | undefined>; | ||
export declare function useVirtual<T extends Data = Data>(options: VirtualOptions<T>): { | ||
wrapper: HTMLElement | Ref<HTMLElement | null | undefined> | null; | ||
indexMap: ComputedRef<Map<Key, number>>; | ||
heightTree: ComputedRef<BITree>; | ||
startIndex: ComputedRef<number>; | ||
scrollOffset: Ref<number>; | ||
indexMap: ComputedRef<Map<Key, number>>; | ||
visibleItems: ComputedRef<Record<string, any>[]>; | ||
visibleItems: ComputedRef<T[]>; | ||
listStyle: ComputedRef<{ | ||
height: string | undefined; | ||
minHeight: string | undefined; | ||
boxSizing: string; | ||
readonly height: string | undefined; | ||
readonly minHeight: string | undefined; | ||
readonly boxSizing: "content-box"; | ||
}>; | ||
@@ -337,19 +350,19 @@ itemsStyle: ComputedRef<{ | ||
export declare interface VirtualOptions { | ||
export declare interface VirtualOptions<T extends Data> { | ||
/** | ||
* 虚拟滚动的元素 | ||
*/ | ||
items: Ref<Array<Record<string, any>>>; | ||
items: MaybeRef_2<T[]>; | ||
/** | ||
* 设置元素的最小高度 | ||
*/ | ||
itemSize: Ref<number>; | ||
itemSize: MaybeRef_2<number>; | ||
/** | ||
* 设置元素是否为固定高度,固定高度时不处理 resize | ||
*/ | ||
itemFixed: Ref<boolean>; | ||
itemFixed: MaybeRef_2<boolean>; | ||
/** | ||
* 元素的主键 | ||
*/ | ||
idKey: Ref<string>; | ||
idKey: MaybeRef_2<keyof T>; | ||
/** | ||
@@ -362,7 +375,7 @@ * 默认停留在的元素的主键,未实现 | ||
*/ | ||
bufferSize?: Ref<number>; | ||
bufferSize?: MaybeRef_2<number>; | ||
/** | ||
* 虚拟滚动的包围元素 | ||
*/ | ||
wrapper?: Ref<HTMLElement | null | undefined>; | ||
wrapper?: MaybeRef_2<HTMLElement | null | undefined>; | ||
/** | ||
@@ -369,0 +382,0 @@ * 是否自动观察 wrapper 缩放 |
{ | ||
"name": "@vexip-ui/hooks", | ||
"version": "1.11.3", | ||
"version": "1.11.4", | ||
"license": "MIT", | ||
@@ -30,3 +30,3 @@ "author": "qmhc", | ||
"@popperjs/core": "^2.11.8", | ||
"@vexip-ui/utils": "1.16.0" | ||
"@vexip-ui/utils": "1.16.1" | ||
}, | ||
@@ -33,0 +33,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
653467
2719
+ Added@vexip-ui/utils@1.16.1(transitive)
- Removed@vexip-ui/utils@1.16.0(transitive)
Updated@vexip-ui/utils@1.16.1