@veltra/compositions 1.7.12 → 1.7.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/use-component-props/index.d.ts +1 -2
- package/dist/use-config/index.d.ts +2 -3
- package/dist/use-dnd/index.d.ts +4 -4
- package/dist/use-drag/index.d.ts +1 -2
- package/dist/use-fallback-props/index.d.ts +3 -4
- package/dist/use-focus/index.d.ts +1 -2
- package/dist/use-model/index.d.ts +1 -2
- package/dist/use-pop/index.d.ts +1 -2
- package/dist/use-reactive-size/index.d.ts +2 -3
- package/dist/use-resize-observer/index.d.ts +4 -5
- package/dist/use-transition/index.d.ts +2 -3
- package/dist/use-transition/type.d.ts +4 -5
- package/dist/use-user-action/index.d.ts +3 -4
- package/dist/use-virtualizer/index.d.ts +3 -4
- package/package.json +2 -2
|
@@ -5,7 +5,6 @@ import { Component, MaybeRef } from "vue";
|
|
|
5
5
|
* @param props 组件通用的属性
|
|
6
6
|
* @returns
|
|
7
7
|
*/
|
|
8
|
-
declare function useComponentProps<T extends Record<string, any>>(props: MaybeRef<T & Record<string, any>>): Component;
|
|
8
|
+
export declare function useComponentProps<T extends Record<string, any>>(props: MaybeRef<T & Record<string, any>>): Component;
|
|
9
9
|
//#endregion
|
|
10
|
-
export { useComponentProps };
|
|
11
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -15,11 +15,10 @@ interface State {
|
|
|
15
15
|
pageSizeOptions: number[];
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
declare function setDocumentSize(size: ComponentSize, oldSize?: ComponentSize): void;
|
|
19
|
-
declare function useConfig(): {
|
|
18
|
+
export declare function setDocumentSize(size: ComponentSize, oldSize?: ComponentSize): void;
|
|
19
|
+
export declare function useConfig(): {
|
|
20
20
|
config: Readonly<State>;
|
|
21
21
|
setConfig: (conf: Partial<State>) => void;
|
|
22
22
|
};
|
|
23
23
|
//#endregion
|
|
24
|
-
export { setDocumentSize, useConfig };
|
|
25
24
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/use-dnd/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { MaybeRefOrGetter, Ref } from "vue";
|
|
|
2
2
|
import { BaseDragState, DNDPlugin, DNDPluginData, DragState, DragendEvent, DragendEventData, DragstartEvent, DragstartEventData, DropSwapConfig, InsertConfig, InsertEvent, NativeDragEffects, Node, NodeData, NodeDragEventData, NodeEventData, NodePointerEventData, NodeRecord, NodeTargetData, ParentConfig, ParentData, ParentDragEventData, ParentEventData, ParentRecord, ParentTargetData, PointeroverNodeEvent, PointeroverParentEvent, SetupNode, SetupNodeData, ShouldSwapData, SortEvent, SortEventData, SynthDragState, TearDownNode, TearDownNodeData, TransferEvent, TransferEventData, animations, dragValues, dropOrSwap, insert, isBrowser, isDragState, isSynthDragState, parentValues, performSort, performTransfer, remapNodes, setParentValues, tearDown as tearDown$1, updateConfig } from "@formkit/drag-and-drop";
|
|
3
3
|
import { VueDragAndDropData, VueElement, VueParentConfig, VueParentConfig as VueParentConfig$1, dragAndDrop as dragAndDrop$1, useDragAndDrop } from "@formkit/drag-and-drop/vue";
|
|
4
4
|
//#region src/use-dnd/index.d.ts
|
|
5
|
-
interface UseDnDOptions<T> extends VueParentConfig<T> {
|
|
5
|
+
export interface UseDnDOptions<T> extends VueParentConfig<T> {
|
|
6
6
|
/**
|
|
7
7
|
* 列表数据。排序/跨容器转移后自动写回:
|
|
8
8
|
* - `Ref`:直接替换 `.value`
|
|
@@ -29,7 +29,7 @@ interface UseDnDOptions<T> extends VueParentConfig<T> {
|
|
|
29
29
|
*/
|
|
30
30
|
onReorder?: (values: T[]) => void;
|
|
31
31
|
}
|
|
32
|
-
interface UseDnDResult<T> {
|
|
32
|
+
export interface UseDnDResult<T> {
|
|
33
33
|
/** 拖拽容器元素;未传 `parent` 选项时通过模板引用绑定到列表容器上 */
|
|
34
34
|
parentRef: Ref<HTMLElement | undefined>;
|
|
35
35
|
/** 拖拽数据。`filter` 模式下为参与拖拽的视图;排序/转移后自动更新 */
|
|
@@ -71,7 +71,7 @@ interface UseDnDResult<T> {
|
|
|
71
71
|
* })
|
|
72
72
|
* ```
|
|
73
73
|
*/
|
|
74
|
-
declare function useDnD<T>(options?: UseDnDOptions<T>): UseDnDResult<T>;
|
|
74
|
+
export declare function useDnD<T>(options?: UseDnDOptions<T>): UseDnDResult<T>;
|
|
75
75
|
//#endregion
|
|
76
|
-
export { type BaseDragState, type DNDPlugin, type DNDPluginData, type DragState, type DragendEvent, type DragendEventData, type DragstartEvent, type DragstartEventData, type DropSwapConfig, type InsertConfig, type InsertEvent, type NativeDragEffects, type Node, type NodeData, type NodeDragEventData, type NodeEventData, type NodePointerEventData, type NodeRecord, type NodeTargetData, type ParentConfig, type ParentData, type ParentDragEventData, type ParentEventData, type ParentRecord, type ParentTargetData, type PointeroverNodeEvent, type PointeroverParentEvent, type SetupNode, type SetupNodeData, type ShouldSwapData, type SortEvent, type SortEventData, type SynthDragState, type TearDownNode, type TearDownNodeData, type TransferEvent, type TransferEventData,
|
|
76
|
+
export { type BaseDragState, type DNDPlugin, type DNDPluginData, type DragState, type DragendEvent, type DragendEventData, type DragstartEvent, type DragstartEventData, type DropSwapConfig, type InsertConfig, type InsertEvent, type NativeDragEffects, type Node, type NodeData, type NodeDragEventData, type NodeEventData, type NodePointerEventData, type NodeRecord, type NodeTargetData, type ParentConfig, type ParentData, type ParentDragEventData, type ParentEventData, type ParentRecord, type ParentTargetData, type PointeroverNodeEvent, type PointeroverParentEvent, type SetupNode, type SetupNodeData, type ShouldSwapData, type SortEvent, type SortEventData, type SynthDragState, type TearDownNode, type TearDownNodeData, type TransferEvent, type TransferEventData, type VueDragAndDropData, type VueElement, type VueParentConfig$1 as VueParentConfig, animations, dragAndDrop$1 as dragAndDrop, dragValues, dropOrSwap, insert, isBrowser, isDragState, isSynthDragState, parentValues, performSort, performTransfer, remapNodes, setParentValues, tearDown$1 as tearDown, updateConfig, useDragAndDrop };
|
|
77
77
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/use-drag/index.d.ts
CHANGED
|
@@ -35,12 +35,11 @@ interface DragOptions {
|
|
|
35
35
|
* 拖动组合式方法
|
|
36
36
|
* @param options 拖动选项
|
|
37
37
|
*/
|
|
38
|
-
declare function useDrag(options: DragOptions): {
|
|
38
|
+
export declare function useDrag(options: DragOptions): {
|
|
39
39
|
update: (options: {
|
|
40
40
|
offsetX?: number;
|
|
41
41
|
offsetY?: number;
|
|
42
42
|
}) => void;
|
|
43
43
|
};
|
|
44
44
|
//#endregion
|
|
45
|
-
export { useDrag };
|
|
46
45
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -6,7 +6,7 @@ import { ComputedRef } from "vue";
|
|
|
6
6
|
* @param propsList 属性列表,最右边的属性优先级最高
|
|
7
7
|
* @param fallbackProps 要回滚的属性和默认值
|
|
8
8
|
*/
|
|
9
|
-
declare function useFallbackProps<F extends Record<string, any>, R extends { [key in keyof F]: ComputedRef<F[key]>; }>(propsList: Record<string, any>[], fallbackProps: F): R;
|
|
9
|
+
export declare function useFallbackProps<F extends Record<string, any>, R extends { [key in keyof F]: ComputedRef<F[key]>; }>(propsList: Record<string, any>[], fallbackProps: F): R;
|
|
10
10
|
type FormFallbackProps = {
|
|
11
11
|
size: ComponentSize;
|
|
12
12
|
disabled: boolean;
|
|
@@ -17,14 +17,13 @@ type FormFallbackProps = {
|
|
|
17
17
|
* @param propsList props列表
|
|
18
18
|
* @returns
|
|
19
19
|
*/
|
|
20
|
-
declare function useFormFallbackProps(propsList: Record<string, any>[]): { [key in keyof FormFallbackProps]: ComputedRef<FormFallbackProps[key]>; };
|
|
20
|
+
export declare function useFormFallbackProps(propsList: Record<string, any>[]): { [key in keyof FormFallbackProps]: ComputedRef<FormFallbackProps[key]>; };
|
|
21
21
|
/**
|
|
22
22
|
* 表单组件的回滚属性
|
|
23
23
|
* @param propsList props列表
|
|
24
24
|
* @param fallbackProps 回滚属性,可以只指定部分表单属性
|
|
25
25
|
* @returns
|
|
26
26
|
*/
|
|
27
|
-
declare function useFormFallbackProps<F extends Partial<FormFallbackProps>>(propsList: Record<string, any>[], fallbackProps: F): { [key in keyof F]: key extends keyof FormFallbackProps ? ComputedRef<FormFallbackProps[key]> : never; };
|
|
27
|
+
export declare function useFormFallbackProps<F extends Partial<FormFallbackProps>>(propsList: Record<string, any>[], fallbackProps: F): { [key in keyof F]: key extends keyof FormFallbackProps ? ComputedRef<FormFallbackProps[key]> : never; };
|
|
28
28
|
//#endregion
|
|
29
|
-
export { useFallbackProps, useFormFallbackProps };
|
|
30
29
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,11 +5,10 @@ import { Ref } from "vue";
|
|
|
5
5
|
* @param cb 回调
|
|
6
6
|
* @returns
|
|
7
7
|
*/
|
|
8
|
-
declare function useFocus(cb?: (focused: boolean) => void): {
|
|
8
|
+
export declare function useFocus(cb?: (focused: boolean) => void): {
|
|
9
9
|
focus: Ref<boolean>;
|
|
10
10
|
handleBlur: () => void;
|
|
11
11
|
handleFocus: () => void;
|
|
12
12
|
};
|
|
13
13
|
//#endregion
|
|
14
|
-
export { useFocus };
|
|
15
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -25,10 +25,9 @@ interface ModelOptions<Props extends Record<string, unknown>, Name extends keyof
|
|
|
25
25
|
* @param options - 选项
|
|
26
26
|
* @returns - 一个模型值
|
|
27
27
|
*/
|
|
28
|
-
declare function useModel<Props extends Record<string, any>, Name extends keyof Props = 'modelValue'>(options: ModelOptions<Props, Name>): Ref<Props[Name] | undefined> | {
|
|
28
|
+
export declare function useModel<Props extends Record<string, any>, Name extends keyof Props = 'modelValue'>(options: ModelOptions<Props, Name>): Ref<Props[Name] | undefined> | {
|
|
29
29
|
__v_isRef: boolean;
|
|
30
30
|
value: Props[Name];
|
|
31
31
|
};
|
|
32
32
|
//#endregion
|
|
33
|
-
export { useModel };
|
|
34
33
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/use-pop/index.d.ts
CHANGED
|
@@ -46,7 +46,6 @@ interface PopResult {
|
|
|
46
46
|
* @param options 选项
|
|
47
47
|
* @returns
|
|
48
48
|
*/
|
|
49
|
-
declare function usePop(options: Options): PopResult;
|
|
49
|
+
export declare function usePop(options: Options): PopResult;
|
|
50
50
|
//#endregion
|
|
51
|
-
export { usePop };
|
|
52
51
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -9,8 +9,7 @@ interface ElementSize {
|
|
|
9
9
|
* @param targets 目标元素
|
|
10
10
|
* @returns 目标元素的宽高
|
|
11
11
|
*/
|
|
12
|
-
declare function useReactiveSize(target: RefElement): ElementSize;
|
|
13
|
-
declare function useReactiveSize(targets: RefElement[]): ElementSize[];
|
|
12
|
+
export declare function useReactiveSize(target: RefElement): ElementSize;
|
|
13
|
+
export declare function useReactiveSize(targets: RefElement[]): ElementSize[];
|
|
14
14
|
//#endregion
|
|
15
|
-
export { useReactiveSize };
|
|
16
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref, ShallowRef } from "vue";
|
|
2
2
|
//#region src/use-resize-observer/index.d.ts
|
|
3
|
-
type RefElement = ShallowRef<HTMLElement | undefined | null> | Ref<HTMLElement | undefined | null>;
|
|
3
|
+
export type RefElement = ShallowRef<HTMLElement | undefined | null> | Ref<HTMLElement | undefined | null>;
|
|
4
4
|
interface ResizeObserverOptions {
|
|
5
5
|
/** 目标节点 */
|
|
6
6
|
targets: RefElement | RefElement[];
|
|
@@ -10,7 +10,7 @@ interface ResizeObserverOptions {
|
|
|
10
10
|
when?: () => boolean;
|
|
11
11
|
}
|
|
12
12
|
/** 监听器 */
|
|
13
|
-
type ResizeObserverReturn = {
|
|
13
|
+
export type ResizeObserverReturn = {
|
|
14
14
|
/** 终止监听 */
|
|
15
15
|
disconnect: () => void;
|
|
16
16
|
};
|
|
@@ -18,16 +18,15 @@ type ResizeObserverReturn = {
|
|
|
18
18
|
* 监听目标尺寸变化
|
|
19
19
|
* @param options 选项
|
|
20
20
|
*/
|
|
21
|
-
declare function useResizeObserver(options: ResizeObserverOptions): ResizeObserverReturn;
|
|
21
|
+
export declare function useResizeObserver(options: ResizeObserverOptions): ResizeObserverReturn;
|
|
22
22
|
/**
|
|
23
23
|
* 监听元素尺寸变化
|
|
24
24
|
*/
|
|
25
|
-
declare function useObserverCallback(): {
|
|
25
|
+
export declare function useObserverCallback(): {
|
|
26
26
|
observeEl: <El extends HTMLElement>(el: El, cb: (entry: Omit<ResizeObserverEntry, 'target'> & {
|
|
27
27
|
target: El;
|
|
28
28
|
}) => void) => void;
|
|
29
29
|
unobserveEl: (el: HTMLElement) => void;
|
|
30
30
|
};
|
|
31
31
|
//#endregion
|
|
32
|
-
export { RefElement, ResizeObserverReturn, useObserverCallback, useResizeObserver };
|
|
33
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,13 +5,12 @@ import { CssTransitionOptions, Returned, StyleTransitionOptions } from "./type.j
|
|
|
5
5
|
* @param type 过渡类型
|
|
6
6
|
* @param options 过渡选项
|
|
7
7
|
*/
|
|
8
|
-
declare function useTransition(type: 'css', options: CssTransitionOptions): Returned;
|
|
8
|
+
export declare function useTransition(type: 'css', options: CssTransitionOptions): Returned;
|
|
9
9
|
/**
|
|
10
10
|
* 使用style样式过渡
|
|
11
11
|
* @param type 过渡类型
|
|
12
12
|
* @param options 过渡选项
|
|
13
13
|
*/
|
|
14
|
-
declare function useTransition(type: 'style', options: StyleTransitionOptions): Returned;
|
|
14
|
+
export declare function useTransition(type: 'style', options: StyleTransitionOptions): Returned;
|
|
15
15
|
//#endregion
|
|
16
|
-
export { useTransition };
|
|
17
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CSSProperties, Ref, ShallowRef } from "vue";
|
|
2
2
|
//#region src/use-transition/type.d.ts
|
|
3
|
-
interface TransitionBase {
|
|
3
|
+
export interface TransitionBase {
|
|
4
4
|
/** 被应用的目标元素 */
|
|
5
5
|
target: ShallowRef<HTMLElement | undefined> | HTMLElement;
|
|
6
6
|
/** 进入动画结束回调 */
|
|
@@ -12,13 +12,13 @@ interface TransitionBase {
|
|
|
12
12
|
/** 离开动画被取消回调(css 实现中阶段被打断时由新阶段直接接管,不会触发) */
|
|
13
13
|
leaveCanceled?: () => void;
|
|
14
14
|
}
|
|
15
|
-
interface CssTransitionOptions extends TransitionBase {
|
|
15
|
+
export interface CssTransitionOptions extends TransitionBase {
|
|
16
16
|
/** 类的名称, 会生成 `${name}-enter-${'to' | 'active' | 'from'}`, `${name}-leave-${'to' | 'active' | 'from'}这几种类` */
|
|
17
17
|
name: ShallowRef<string> | string | Ref<string>;
|
|
18
18
|
/** 保留进入类 */
|
|
19
19
|
keepEnterTo?: boolean;
|
|
20
20
|
}
|
|
21
|
-
interface StyleTransitionOptions extends TransitionBase {
|
|
21
|
+
export interface StyleTransitionOptions extends TransitionBase {
|
|
22
22
|
/** 进入后的样式 */
|
|
23
23
|
enterTo: CSSProperties;
|
|
24
24
|
/** 进入过渡时的样式 */
|
|
@@ -26,7 +26,7 @@ interface StyleTransitionOptions extends TransitionBase {
|
|
|
26
26
|
/** 离开过渡时的样式 */
|
|
27
27
|
leaveActive: CSSProperties;
|
|
28
28
|
}
|
|
29
|
-
interface Returned {
|
|
29
|
+
export interface Returned {
|
|
30
30
|
/**
|
|
31
31
|
* 切换进入/离开动画
|
|
32
32
|
* @param active 是否激活
|
|
@@ -42,5 +42,4 @@ interface Returned {
|
|
|
42
42
|
leave(): void;
|
|
43
43
|
}
|
|
44
44
|
//#endregion
|
|
45
|
-
export { CssTransitionOptions, Returned, StyleTransitionOptions, TransitionBase };
|
|
46
45
|
//# sourceMappingURL=type.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region src/use-user-action/index.d.ts
|
|
2
|
-
type UserAction = <T extends (...args: any[]) => void | Promise<void>>(fn: T) => (...args: Parameters<T>) => Promise<void>;
|
|
3
|
-
interface UserActionResult {
|
|
2
|
+
export type UserAction = <T extends (...args: any[]) => void | Promise<void>>(fn: T) => (...args: Parameters<T>) => Promise<void>;
|
|
3
|
+
export interface UserActionResult {
|
|
4
4
|
isUserActive: () => boolean;
|
|
5
5
|
userAction: UserAction;
|
|
6
6
|
}
|
|
@@ -26,7 +26,6 @@ interface UserActionResult {
|
|
|
26
26
|
* })
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
declare function useUserAction(): UserActionResult;
|
|
29
|
+
export declare function useUserAction(): UserActionResult;
|
|
30
30
|
//#endregion
|
|
31
|
-
export { UserAction, UserActionResult, useUserAction };
|
|
32
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -2,7 +2,7 @@ import { MaybeRefOrGetter, Ref, ShallowRef } from "vue";
|
|
|
2
2
|
import { VirtualItem, VirtualSnapshot, Virtualizer, VirtualizerOptions } from "@cat-kit/fe";
|
|
3
3
|
//#region src/use-virtualizer/index.d.ts
|
|
4
4
|
type MaybeEl = HTMLElement | null | undefined;
|
|
5
|
-
interface UseVirtualizerOptions extends Omit<VirtualizerOptions, 'count'> {
|
|
5
|
+
export interface UseVirtualizerOptions extends Omit<VirtualizerOptions, 'count'> {
|
|
6
6
|
/** 响应式虚拟项总数;内部 `watch` 驱动 `virtualizer.setCount`。 */
|
|
7
7
|
count: Ref<number>;
|
|
8
8
|
/**
|
|
@@ -22,7 +22,7 @@ interface UseVirtualizerOptions extends Omit<VirtualizerOptions, 'count'> {
|
|
|
22
22
|
/** 可选:末项后占位元素。语义同 `contentEl`,写 `afterSize`。 */
|
|
23
23
|
afterEl?: MaybeRefOrGetter<MaybeEl>;
|
|
24
24
|
}
|
|
25
|
-
interface UseVirtualizerReturned {
|
|
25
|
+
export interface UseVirtualizerReturned {
|
|
26
26
|
/**
|
|
27
27
|
* 底层 `Virtualizer` 实例。
|
|
28
28
|
*
|
|
@@ -62,7 +62,6 @@ interface UseVirtualizerReturned {
|
|
|
62
62
|
* - `initialOffset` / `initialViewport` 仅构造时生效,后续 `setOptions` 忽略(底层契约)。
|
|
63
63
|
* - 消费者若需运行时切换 `estimateSize` / `getItemKey` 等字段,调用 `virtualizer.setOptions(...)`。
|
|
64
64
|
*/
|
|
65
|
-
declare function useVirtualizer(options: UseVirtualizerOptions): UseVirtualizerReturned;
|
|
65
|
+
export declare function useVirtualizer(options: UseVirtualizerOptions): UseVirtualizerReturned;
|
|
66
66
|
//#endregion
|
|
67
|
-
export { UseVirtualizerOptions, UseVirtualizerReturned, useVirtualizer };
|
|
68
67
|
//# sourceMappingURL=index.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@veltra/compositions",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.15",
|
|
4
4
|
"homepage": "https://github.com/cabinet-fe/ultra-ui#readme",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/cabinet-fe/ultra-ui/issues"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@cat-kit/core": ">=1.2.1",
|
|
33
33
|
"@cat-kit/fe": ">=1.2.1",
|
|
34
|
-
"@veltra/utils": "^1.7.
|
|
34
|
+
"@veltra/utils": "^1.7.14",
|
|
35
35
|
"vue": ">=3.5.42"
|
|
36
36
|
}
|
|
37
37
|
}
|