@kine-design/core 0.0.1-beta.1
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/components/base/affix/api.d.ts +3 -0
- package/dist/components/base/affix/index.d.ts +5 -0
- package/dist/components/base/affix/useAffix.d.ts +7 -0
- package/dist/components/base/alert/api.d.ts +3 -0
- package/dist/components/base/alert/index.d.ts +4 -0
- package/dist/components/base/anchor/api.d.ts +4 -0
- package/dist/components/base/anchor/index.d.ts +6 -0
- package/dist/components/base/anchor/useAnchor.d.ts +7 -0
- package/dist/components/base/autoComplete/api.d.ts +3 -0
- package/dist/components/base/autoComplete/index.d.ts +6 -0
- package/dist/components/base/autoComplete/useAutoComplete.d.ts +13 -0
- package/dist/components/base/avatar/api.d.ts +3 -0
- package/dist/components/base/avatar/index.d.ts +3 -0
- package/dist/components/base/backTop/api.d.ts +3 -0
- package/dist/components/base/backTop/index.d.ts +5 -0
- package/dist/components/base/backTop/useBackTop.d.ts +5 -0
- package/dist/components/base/badge/api.d.ts +3 -0
- package/dist/components/base/badge/index.d.ts +4 -0
- package/dist/components/base/button/api.d.ts +3 -0
- package/dist/components/base/button/index.d.ts +24 -0
- package/dist/components/base/button/useButton.d.ts +22 -0
- package/dist/components/base/card/api.d.ts +3 -0
- package/dist/components/base/card/index.d.ts +4 -0
- package/dist/components/base/carousel/api.d.ts +3 -0
- package/dist/components/base/carousel/index.d.ts +6 -0
- package/dist/components/base/carousel/useCarousel.d.ts +10 -0
- package/dist/components/base/cascader/api.d.ts +3 -0
- package/dist/components/base/cascader/index.d.ts +7 -0
- package/dist/components/base/cascader/useCascader.d.ts +31 -0
- package/dist/components/base/checkbox/api.d.ts +4 -0
- package/dist/components/base/checkbox/index.d.ts +5 -0
- package/dist/components/base/checkbox/useCheckbox.d.ts +9 -0
- package/dist/components/base/collapse/api.d.ts +4 -0
- package/dist/components/base/collapse/index.d.ts +6 -0
- package/dist/components/base/collapse/useCollapse.d.ts +16 -0
- package/dist/components/base/datePicker/api.d.ts +3 -0
- package/dist/components/base/datePicker/index.d.ts +8 -0
- package/dist/components/base/datePicker/useDatePicker.d.ts +52 -0
- package/dist/components/base/divider/api.d.ts +3 -0
- package/dist/components/base/divider/index.d.ts +4 -0
- package/dist/components/base/dropdown/api.d.ts +4 -0
- package/dist/components/base/dropdown/index.d.ts +6 -0
- package/dist/components/base/dropdown/useDropdown.d.ts +22 -0
- package/dist/components/base/empty/api.d.ts +3 -0
- package/dist/components/base/empty/index.d.ts +4 -0
- package/dist/components/base/image/api.d.ts +3 -0
- package/dist/components/base/image/index.d.ts +7 -0
- package/dist/components/base/image/useImage.d.ts +19 -0
- package/dist/components/base/input/api.d.ts +3 -0
- package/dist/components/base/input/index.d.ts +5 -0
- package/dist/components/base/input/useInput.d.ts +22 -0
- package/dist/components/base/inputNumber/api.d.ts +3 -0
- package/dist/components/base/inputNumber/index.d.ts +5 -0
- package/dist/components/base/inputNumber/useInputNumber.d.ts +12 -0
- package/dist/components/base/li/api.d.ts +3 -0
- package/dist/components/base/li/index.d.ts +3 -0
- package/dist/components/base/list/api.d.ts +3 -0
- package/dist/components/base/list/index.d.ts +5 -0
- package/dist/components/base/list/useList.d.ts +12 -0
- package/dist/components/base/loading/api.d.ts +3 -0
- package/dist/components/base/loading/index.d.ts +4 -0
- package/dist/components/base/popover/api.d.ts +3 -0
- package/dist/components/base/popover/index.d.ts +5 -0
- package/dist/components/base/popover/usePopover.d.ts +45 -0
- package/dist/components/base/progress/api.d.ts +3 -0
- package/dist/components/base/progress/index.d.ts +5 -0
- package/dist/components/base/progress/useProgress.d.ts +4 -0
- package/dist/components/base/radio/api.d.ts +3 -0
- package/dist/components/base/radio/index.d.ts +14 -0
- package/dist/components/base/radio/useRadio.d.ts +10 -0
- package/dist/components/base/rate/api.d.ts +3 -0
- package/dist/components/base/rate/index.d.ts +5 -0
- package/dist/components/base/rate/useRate.d.ts +9 -0
- package/dist/components/base/result/api.d.ts +3 -0
- package/dist/components/base/result/index.d.ts +4 -0
- package/dist/components/base/select/api.d.ts +3 -0
- package/dist/components/base/select/index.d.ts +7 -0
- package/dist/components/base/select/useSelect.d.ts +31 -0
- package/dist/components/base/select/useSelectTools.d.ts +8 -0
- package/dist/components/base/skeleton/api.d.ts +3 -0
- package/dist/components/base/skeleton/index.d.ts +4 -0
- package/dist/components/base/slider/api.d.ts +3 -0
- package/dist/components/base/slider/index.d.ts +5 -0
- package/dist/components/base/slider/useSlider.d.ts +6 -0
- package/dist/components/base/space/api.d.ts +3 -0
- package/dist/components/base/space/index.d.ts +4 -0
- package/dist/components/base/steps/api.d.ts +10 -0
- package/dist/components/base/steps/index.d.ts +11 -0
- package/dist/components/base/steps/useSteps.d.ts +44 -0
- package/dist/components/base/switch/api.d.ts +3 -0
- package/dist/components/base/switch/index.d.ts +7 -0
- package/dist/components/base/switch/useSwitch.d.ts +9 -0
- package/dist/components/base/tabs/api.d.ts +4 -0
- package/dist/components/base/tabs/index.d.ts +7 -0
- package/dist/components/base/tabs/useTabs.d.ts +9 -0
- package/dist/components/base/tag/api.d.ts +3 -0
- package/dist/components/base/tag/index.d.ts +3 -0
- package/dist/components/base/timePicker/api.d.ts +3 -0
- package/dist/components/base/timePicker/index.d.ts +7 -0
- package/dist/components/base/timePicker/useTimePicker.d.ts +21 -0
- package/dist/components/base/timeline/api.d.ts +4 -0
- package/dist/components/base/timeline/index.d.ts +5 -0
- package/dist/components/base/tooltip/api.d.ts +3 -0
- package/dist/components/base/tooltip/index.d.ts +6 -0
- package/dist/components/base/tooltip/useTooltip.d.ts +15 -0
- package/dist/components/base/transfer/api.d.ts +3 -0
- package/dist/components/base/transfer/index.d.ts +6 -0
- package/dist/components/base/transfer/useTransfer.d.ts +23 -0
- package/dist/components/base/tree/api.d.ts +8 -0
- package/dist/components/base/tree/index.d.ts +15 -0
- package/dist/components/base/tree/tree.d.ts +46 -0
- package/dist/components/base/tree/useTree.d.ts +32 -0
- package/dist/components/message/confirm/api.d.ts +3 -0
- package/dist/components/message/confirm/index.d.ts +4 -0
- package/dist/components/message/dialog/api.d.ts +3 -0
- package/dist/components/message/dialog/index.d.ts +4 -0
- package/dist/components/message/drawer/api.d.ts +3 -0
- package/dist/components/message/drawer/index.d.ts +4 -0
- package/dist/components/message/message/api.d.ts +10 -0
- package/dist/components/message/message/index.d.ts +9 -0
- package/dist/components/message/message/useMessage.d.ts +23 -0
- package/dist/components/message/notification/api.d.ts +6 -0
- package/dist/components/message/notification/index.d.ts +8 -0
- package/dist/components/message/notification/useNotification.d.ts +33 -0
- package/dist/components/message/popover/MPopover.d.ts +2 -0
- package/dist/components/message/popover/api.d.ts +3 -0
- package/dist/components/message/popover/index.d.ts +6 -0
- package/dist/components/message/popover/usePopover.d.ts +56 -0
- package/dist/components/other/darkMode/api.d.ts +3 -0
- package/dist/components/other/darkMode/index.d.ts +6 -0
- package/dist/components/other/darkMode/useDarkMode.d.ts +11 -0
- package/dist/components/template/border/api.d.ts +3 -0
- package/dist/components/template/border/index.d.ts +4 -0
- package/dist/components/template/breadcrumb/api.d.ts +3 -0
- package/dist/components/template/breadcrumb/index.d.ts +4 -0
- package/dist/components/template/descriptions/api.d.ts +4 -0
- package/dist/components/template/descriptions/index.d.ts +5 -0
- package/dist/components/template/form/api.d.ts +4 -0
- package/dist/components/template/form/index.d.ts +9 -0
- package/dist/components/template/grid/api.d.ts +3 -0
- package/dist/components/template/grid/index.d.ts +4 -0
- package/dist/components/template/menu/api.d.ts +8 -0
- package/dist/components/template/menu/index.d.ts +9 -0
- package/dist/components/template/menu/useMenu.d.ts +12 -0
- package/dist/components/template/pagination/api.d.ts +3 -0
- package/dist/components/template/pagination/index.d.ts +7 -0
- package/dist/components/template/pagination/usePagination.d.ts +27 -0
- package/dist/components/template/table/api.d.ts +3 -0
- package/dist/components/template/table/index.d.ts +7 -0
- package/dist/components/template/table/useTable.d.ts +51 -0
- package/dist/components/template/tableColumn/api.d.ts +3 -0
- package/dist/components/template/tableColumn/index.d.ts +4 -0
- package/dist/components/template/virtualList/api.d.ts +3 -0
- package/dist/components/template/virtualList/index.d.ts +7 -0
- package/dist/components/template/virtualList/useVirtualList.d.ts +15 -0
- package/dist/compositions/common/defineCore.d.ts +25 -0
- package/dist/compositions/common/useDebounceFn.d.ts +12 -0
- package/dist/compositions/common/useDrag.d.ts +28 -0
- package/dist/compositions/common/useElementSize.d.ts +5 -0
- package/dist/compositions/common/useEventListener.d.ts +19 -0
- package/dist/compositions/common/usePopover.d.ts +9 -0
- package/dist/compositions/common/useResizeObserver.d.ts +4 -0
- package/dist/compositions/common/useTeleport.d.ts +7 -0
- package/dist/compositions/input/useBooleanInput.d.ts +9 -0
- package/dist/compositions/modal/useModal.d.ts +14 -0
- package/dist/compositions/popper/useClickAway.d.ts +9 -0
- package/dist/compositions/popper/usePopper.d.ts +19 -0
- package/dist/compositions/utils/filters.d.ts +41 -0
- package/dist/compositions/virtualList/enums.d.ts +49 -0
- package/dist/compositions/virtualList/useContainerObserver.d.ts +9 -0
- package/dist/compositions/virtualList/useEntries.d.ts +29 -0
- package/dist/compositions/virtualList/useHeightCache.d.ts +26 -0
- package/dist/compositions/virtualList/useSentinelObserver.d.ts +14 -0
- package/dist/core.js +4270 -0
- package/dist/index.d.ts +65 -0
- package/dist/runtime/defineHook.d.ts +3 -0
- package/dist/tools/empty.d.ts +18 -0
- package/dist/tools/index.d.ts +10 -0
- package/dist/tools/types.d.ts +9 -0
- package/dist/vite.config.build.d.ts +2 -0
- package/package.json +32 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useMessageQueue } from './useMessage';
|
|
2
|
+
export declare const MessageCore: {
|
|
3
|
+
messageProps: import('../../types/props').MCOPO<import('./props').MessageProps>;
|
|
4
|
+
messageListProps: import('../../types/props').MCOPO<import('./props').MessageListProps>;
|
|
5
|
+
useMessageQueue: typeof useMessageQueue;
|
|
6
|
+
};
|
|
7
|
+
export { useMessageQueue } from './useMessage';
|
|
8
|
+
export type { MessageProps, MessageListProps, MessageType, MessageDirectionType } from './props';
|
|
9
|
+
export type { MessageItem } from './useMessage';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { MessageType } from './props';
|
|
2
|
+
/**
|
|
3
|
+
* 消息队列中每一条消息的内部结构
|
|
4
|
+
*/
|
|
5
|
+
export interface MessageItem {
|
|
6
|
+
id: number;
|
|
7
|
+
type: MessageType;
|
|
8
|
+
content: string;
|
|
9
|
+
duration: number;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 消息队列 composable
|
|
13
|
+
* 管理消息的增删与自动关闭定时器
|
|
14
|
+
*/
|
|
15
|
+
export declare function useMessageQueue(): {
|
|
16
|
+
messages: any;
|
|
17
|
+
add: (props: {
|
|
18
|
+
type?: MessageType;
|
|
19
|
+
content: string;
|
|
20
|
+
duration?: number;
|
|
21
|
+
}) => number;
|
|
22
|
+
remove: (id: number) => void;
|
|
23
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { useNotificationQueue } from './useNotification';
|
|
2
|
+
export declare const NotificationCore: {
|
|
3
|
+
notificationProps: import('../../types/props').MCOPO<import('./props').NotificationProps>;
|
|
4
|
+
useNotificationQueue: typeof useNotificationQueue;
|
|
5
|
+
};
|
|
6
|
+
export { useNotificationQueue } from './useNotification';
|
|
7
|
+
export type { NotificationProps, NotificationEvents, NotificationType, NotificationPosition } from './props';
|
|
8
|
+
export type { NotificationItem, NotificationAddOptions } from './useNotification';
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NotificationType, NotificationPosition } from './props';
|
|
2
|
+
/**
|
|
3
|
+
* 通知队列中每一条通知的内部结构
|
|
4
|
+
*/
|
|
5
|
+
export interface NotificationItem {
|
|
6
|
+
id: number;
|
|
7
|
+
title: string;
|
|
8
|
+
message: string;
|
|
9
|
+
type: NotificationType;
|
|
10
|
+
duration: number;
|
|
11
|
+
position: NotificationPosition;
|
|
12
|
+
closable: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* 创建通知时的配置参数
|
|
16
|
+
*/
|
|
17
|
+
export interface NotificationAddOptions {
|
|
18
|
+
title: string;
|
|
19
|
+
message?: string;
|
|
20
|
+
type?: NotificationType;
|
|
21
|
+
duration?: number;
|
|
22
|
+
position?: NotificationPosition;
|
|
23
|
+
closable?: boolean;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 通知队列 composable
|
|
27
|
+
* 管理通知的增删与自动关闭定时器
|
|
28
|
+
*/
|
|
29
|
+
export declare function useNotificationQueue(): {
|
|
30
|
+
notifications: any;
|
|
31
|
+
add: (options: NotificationAddOptions) => number;
|
|
32
|
+
remove: (id: number) => void;
|
|
33
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { usePopover } from './usePopover.ts';
|
|
2
|
+
export declare const MessagePopoverCore: {
|
|
3
|
+
props: import('../../types/props').MCOPO<import('./props').PopoverProps>;
|
|
4
|
+
usePopover: typeof usePopover;
|
|
5
|
+
};
|
|
6
|
+
export type { PopoverProps as MessagePopoverProps } from './props';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { Placement, PopperConfig, PositionStyle, usePopper } from '../../../compositions/popper/usePopper.ts';
|
|
2
|
+
import { Options } from '../../../compositions/common/defineCore';
|
|
3
|
+
import { PopoverProps } from './props';
|
|
4
|
+
import { Ref } from 'vue';
|
|
5
|
+
export type IPopper = ReturnType<typeof usePopper>;
|
|
6
|
+
export declare class PopoverImpl {
|
|
7
|
+
protected _active: HTMLElement;
|
|
8
|
+
protected _content: HTMLElement;
|
|
9
|
+
protected _arrow: HTMLElement | undefined;
|
|
10
|
+
popperInstance: IPopper;
|
|
11
|
+
style: Ref;
|
|
12
|
+
arrowStyle: Ref;
|
|
13
|
+
placement: Ref;
|
|
14
|
+
visible: boolean;
|
|
15
|
+
onShow?: Function;
|
|
16
|
+
onHide?: Function;
|
|
17
|
+
constructor(val: {
|
|
18
|
+
style: Ref;
|
|
19
|
+
arrowStyle: Ref;
|
|
20
|
+
placement: Ref;
|
|
21
|
+
show: boolean;
|
|
22
|
+
}, active?: HTMLElement, content?: HTMLElement, arrow?: HTMLElement, config?: PopperConfig, lifecycle?: {
|
|
23
|
+
onShow?: Function;
|
|
24
|
+
onHide?: Function;
|
|
25
|
+
});
|
|
26
|
+
get content(): HTMLElement;
|
|
27
|
+
show(): Promise<void>;
|
|
28
|
+
update(positionStyle: PositionStyle): void;
|
|
29
|
+
hide(): void;
|
|
30
|
+
toggle(): Promise<void>;
|
|
31
|
+
destroy(): void;
|
|
32
|
+
}
|
|
33
|
+
type ArrayElement<ArrayType> = ArrayType extends readonly (infer ElementType)[] ? ElementType : never;
|
|
34
|
+
export declare function usePopover(options: Options<{
|
|
35
|
+
props: PopoverProps;
|
|
36
|
+
value: {
|
|
37
|
+
placement: Placement;
|
|
38
|
+
};
|
|
39
|
+
}>, lifecycle?: {
|
|
40
|
+
onShow?: Function;
|
|
41
|
+
onHide?: Function;
|
|
42
|
+
}): {
|
|
43
|
+
getContent: <T>(props: PopoverProps, getContentSlot: () => T, useTeleport: (options: any) => ArrayElement<T> | T, _instance?: PopoverImpl | null) => T | ArrayElement<T> | null;
|
|
44
|
+
popoverEnter: () => void;
|
|
45
|
+
popoverLeave: () => void;
|
|
46
|
+
popoverRef: any;
|
|
47
|
+
contentRef: any;
|
|
48
|
+
arrowRef: any;
|
|
49
|
+
popperInstance: any;
|
|
50
|
+
style: any;
|
|
51
|
+
arrowStyle: any;
|
|
52
|
+
lifecycle: {
|
|
53
|
+
onBeforeDestroyEvents: Function[];
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DarkModeProps } from './props';
|
|
2
|
+
/** 将暗色状态同步到 html[dark] attribute */
|
|
3
|
+
declare function applyDarkAttr(isDark: boolean): void;
|
|
4
|
+
export declare function useDarkMode(props: DarkModeProps, ctx: {
|
|
5
|
+
emit: (event: string, ...args: any[]) => void;
|
|
6
|
+
}): {
|
|
7
|
+
isDark: any;
|
|
8
|
+
toggle: () => void;
|
|
9
|
+
applyDarkAttr: typeof applyDarkAttr;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const DescriptionsCore: {
|
|
2
|
+
descriptionsProps: import('../../types/props').MCOPO<import('./props').DescriptionsProps>;
|
|
3
|
+
descriptionsItemProps: import('../../types/props').MCOPO<import('./props').DescriptionsItemProps>;
|
|
4
|
+
};
|
|
5
|
+
export type { DescriptionsProps, DescriptionsItemProps } from './props';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormCore 使用包装对象导出,避免 formProps / formItemProps 两个 props 名称与其他组件冲突。
|
|
3
|
+
* headless / lib 均通过解构 FormCore 取用。
|
|
4
|
+
*/
|
|
5
|
+
export declare const FormCore: {
|
|
6
|
+
props: import('../../types/props').MCOPO<import('./props').FormProps>;
|
|
7
|
+
formItemProps: import('../../types/props').MCOPO<import('./props').FormItemProps>;
|
|
8
|
+
};
|
|
9
|
+
export type { FormProps, FormItemProps } from './props';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DEFAULT_MENU_CONFIG } from './api';
|
|
2
|
+
import { useMenu } from './useMenu';
|
|
3
|
+
export declare const MenuCore: {
|
|
4
|
+
props: import('../../types/props').MCOPO<import('./props').MenuProps>;
|
|
5
|
+
useMenu: typeof useMenu;
|
|
6
|
+
};
|
|
7
|
+
export { DEFAULT_MENU_CONFIG };
|
|
8
|
+
export { useMenu } from './useMenu';
|
|
9
|
+
export type { MenuProps, MenuData, MenuNodeData, MenuConfig } from './props';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MenuData, MenuNodeData, MenuConfig, MenuProps } from './props';
|
|
2
|
+
export declare function useMenu(props: MenuProps, emit?: (event: string, ...args: unknown[]) => void): {
|
|
3
|
+
nodesRef: ShallowRef<MenuNodeData[]>;
|
|
4
|
+
nodeMap: Map<string | number, MenuNodeData>;
|
|
5
|
+
initNodes: (data?: MenuData[]) => void;
|
|
6
|
+
toggleExpand: (node: MenuNodeData) => void;
|
|
7
|
+
setActive: (node: MenuNodeData) => void;
|
|
8
|
+
toggleChecked: (node: MenuNodeData, checked: boolean) => void;
|
|
9
|
+
getCheckedKeys: () => (string | number)[];
|
|
10
|
+
getNodesByKeys: (keys: (string | number)[]) => MenuNodeData[];
|
|
11
|
+
config: MenuConfig;
|
|
12
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { usePagination } from './usePagination';
|
|
2
|
+
export declare const PaginationCore: {
|
|
3
|
+
props: import('../../types/props').MCOPO<import('./props').PaginationProps>;
|
|
4
|
+
usePagination: typeof usePagination;
|
|
5
|
+
};
|
|
6
|
+
export type { PaginationProps } from './props';
|
|
7
|
+
export { usePagination, type Pager } from './usePagination';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { PaginationProps } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* 页码按钮描述类型
|
|
5
|
+
* - type 为 'number' 时表示普通页码按钮
|
|
6
|
+
* - type 为 'folded' 时表示折叠省略号,jump 为点击后跳转的目标页
|
|
7
|
+
*/
|
|
8
|
+
export type Pager = {
|
|
9
|
+
value: number;
|
|
10
|
+
type: 'number';
|
|
11
|
+
isCurrent: boolean;
|
|
12
|
+
jump?: number;
|
|
13
|
+
} | {
|
|
14
|
+
value: string;
|
|
15
|
+
type: 'folded';
|
|
16
|
+
isCurrent: false;
|
|
17
|
+
jump: number;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* 分页核心 hook
|
|
21
|
+
* @param props 分页组件 props(需包含 total / pageSize / foldedMaxPageBtn / maxPageBtn / showEdgePageNum)
|
|
22
|
+
* @param currentValue 当前页的响应式引用,由调用方维护
|
|
23
|
+
*/
|
|
24
|
+
export declare function usePagination(props: PaginationProps, currentValue: Ref<number>): {
|
|
25
|
+
getPageNumList: () => Pager[];
|
|
26
|
+
getPageBtnLength: () => number;
|
|
27
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useTable } from './useTable';
|
|
2
|
+
export declare const TableCore: {
|
|
3
|
+
props: import('../../types/props').MCOPO<import('./props').TableProps>;
|
|
4
|
+
useTable: typeof useTable;
|
|
5
|
+
};
|
|
6
|
+
export type { TableProps } from './props';
|
|
7
|
+
export { useTable } from './useTable';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description core table hook
|
|
3
|
+
* @author 阿怪
|
|
4
|
+
* @date 2026/2/25
|
|
5
|
+
* @version v1.0.0
|
|
6
|
+
*
|
|
7
|
+
* 江湖的业务千篇一律,复杂的代码好几百行。
|
|
8
|
+
*/
|
|
9
|
+
export declare function useTable(): {
|
|
10
|
+
initTable: <T>(renders: {
|
|
11
|
+
/** 数据为空时渲染的内容 */
|
|
12
|
+
empty: T;
|
|
13
|
+
/** 渲染单个 td 单元格 */
|
|
14
|
+
tbodyTr: (option: {
|
|
15
|
+
data: any | string;
|
|
16
|
+
param: string;
|
|
17
|
+
slot?: any;
|
|
18
|
+
style?: {
|
|
19
|
+
width?: string;
|
|
20
|
+
} | undefined;
|
|
21
|
+
slotInfo?: {
|
|
22
|
+
data: any;
|
|
23
|
+
index: number;
|
|
24
|
+
};
|
|
25
|
+
}) => T;
|
|
26
|
+
/** 渲染单个 th 表头单元格 */
|
|
27
|
+
theadTh: (option: {
|
|
28
|
+
param?: string;
|
|
29
|
+
label?: string;
|
|
30
|
+
slot?: any;
|
|
31
|
+
style?: {
|
|
32
|
+
width?: string;
|
|
33
|
+
} | undefined;
|
|
34
|
+
}) => T;
|
|
35
|
+
/** 渲染整个 thead */
|
|
36
|
+
thead: (ths: T[]) => T;
|
|
37
|
+
/** 渲染整个 tbody */
|
|
38
|
+
tbody: (trs: T[]) => T;
|
|
39
|
+
/** 渲染单行 tr */
|
|
40
|
+
tbodyTrs: (tds: T[], i: number) => T;
|
|
41
|
+
/** 从 tableColumn VNode 中提取 body/head 插槽 */
|
|
42
|
+
initSlot: (tableColumn: any) => {
|
|
43
|
+
body: any;
|
|
44
|
+
head: any;
|
|
45
|
+
} | undefined;
|
|
46
|
+
}, columns: Array<any>, data: any[]) => {
|
|
47
|
+
thead: T;
|
|
48
|
+
tbody: T;
|
|
49
|
+
};
|
|
50
|
+
error: (msg: string) => void;
|
|
51
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useVirtualList } from './useVirtualList';
|
|
2
|
+
export declare const VirtualListCore: {
|
|
3
|
+
props: import('../../types/props').MCOPO<import('./props').VirtualListProps>;
|
|
4
|
+
useVirtualList: typeof useVirtualList;
|
|
5
|
+
};
|
|
6
|
+
export type { VirtualListProps } from './props';
|
|
7
|
+
export { useVirtualList } from './useVirtualList';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { VirtualListProps } from './props';
|
|
2
|
+
export interface UseVirtualListOptions<T> {
|
|
3
|
+
props: VirtualListProps<T>;
|
|
4
|
+
/** 触底事件 */
|
|
5
|
+
onReachBottom?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function useVirtualList<T>(options: UseVirtualListOptions<T>): {
|
|
8
|
+
displayList: any;
|
|
9
|
+
containerRef: any;
|
|
10
|
+
wrapperRef: any;
|
|
11
|
+
topSentinelRef: any;
|
|
12
|
+
bottomSentinelRef: any;
|
|
13
|
+
totalHeight: any;
|
|
14
|
+
offsetY: any;
|
|
15
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
type OptionsEmpty = undefined;
|
|
3
|
+
type IsAllUndefined<T extends any[]> = T extends [infer H, ...infer R] ? H extends undefined ? IsAllUndefined<R> : false : true;
|
|
4
|
+
interface OptionsNotEmpty<P, V, E> {
|
|
5
|
+
props: Required<P>;
|
|
6
|
+
value: {
|
|
7
|
+
[K in keyof V]: Ref<V[K]>;
|
|
8
|
+
};
|
|
9
|
+
event: E;
|
|
10
|
+
}
|
|
11
|
+
type CoreArguments = keyof OptionsNotEmpty<any, any, any>;
|
|
12
|
+
type AnyArguments = {
|
|
13
|
+
[K in CoreArguments]?: any;
|
|
14
|
+
};
|
|
15
|
+
type DefinedKeys<T extends AnyArguments> = {
|
|
16
|
+
[K in keyof T]: T[K] extends undefined ? never : K;
|
|
17
|
+
}[keyof T];
|
|
18
|
+
type UndefinedKeys<T extends AnyArguments> = Exclude<keyof CoreArguments, DefinedKeys<T>>;
|
|
19
|
+
export type OptionsKeys<A extends AnyArguments, P, V, E, DK extends string | number | symbol = DefinedKeys<A>, UK extends string | number | symbol = UndefinedKeys<A>> = {
|
|
20
|
+
[K in DK & keyof OptionsNotEmpty<P, V, E>]: OptionsNotEmpty<P, V, E>[K];
|
|
21
|
+
} & {
|
|
22
|
+
[K in UK & keyof OptionsNotEmpty<P, V, E>]-?: OptionsNotEmpty<P, V, E>[K];
|
|
23
|
+
};
|
|
24
|
+
export type Options<K extends AnyArguments, P = K['props'], V = K['value'], E = K['event']> = IsAllUndefined<[P, V, E]> extends true ? OptionsEmpty : OptionsKeys<K, P, V, E>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DebounceFilterOptions, FunctionArgs } from '../utils/filters';
|
|
2
|
+
/**
|
|
3
|
+
* Debounce execution of a function.
|
|
4
|
+
*
|
|
5
|
+
* @see https://vueuse.org/useDebounceFn
|
|
6
|
+
* @param fn A function to be executed after delay milliseconds debounced.
|
|
7
|
+
* @param ms A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
|
|
8
|
+
* @param opts options
|
|
9
|
+
*
|
|
10
|
+
* @return A new, debounce, function.
|
|
11
|
+
*/
|
|
12
|
+
export default function useDebounceFn<T extends FunctionArgs>(fn: T, ms?: number, options?: DebounceFilterOptions): T;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export type DragDirectionType = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'top-center' | string;
|
|
3
|
+
export type InteractEvent = any;
|
|
4
|
+
export type DragPosition = {
|
|
5
|
+
x: number;
|
|
6
|
+
y: number;
|
|
7
|
+
};
|
|
8
|
+
export type DragOption = {
|
|
9
|
+
startAxis: 'x' | 'y';
|
|
10
|
+
lockAxis: 'x' | 'y';
|
|
11
|
+
};
|
|
12
|
+
export default function useDrag(config: {
|
|
13
|
+
direction: DragDirectionType;
|
|
14
|
+
value?: {
|
|
15
|
+
domRef?: Ref<HTMLElement | null>;
|
|
16
|
+
};
|
|
17
|
+
event?: {
|
|
18
|
+
getOption?: () => DragOption;
|
|
19
|
+
movePositionHandler?: (event: InteractEvent, position: DragPosition) => DragPosition;
|
|
20
|
+
onDragLeave?: (event: InteractEvent) => void;
|
|
21
|
+
};
|
|
22
|
+
}): {
|
|
23
|
+
domRef: any;
|
|
24
|
+
init: (basePosition?: {
|
|
25
|
+
x?: number;
|
|
26
|
+
y?: number;
|
|
27
|
+
}) => any;
|
|
28
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description event listener hook
|
|
3
|
+
* @author 阿怪
|
|
4
|
+
* @date 2023/5/12 00:57
|
|
5
|
+
* @version v1.0.0
|
|
6
|
+
*
|
|
7
|
+
* 江湖的业务千篇一律,复杂的代码好几百行。
|
|
8
|
+
*/
|
|
9
|
+
export type EventListenerOptions = {
|
|
10
|
+
target: any;
|
|
11
|
+
event: string;
|
|
12
|
+
handler: EventListenerOrEventListenerObject;
|
|
13
|
+
};
|
|
14
|
+
export default function useEventListener(options: EventListenerOptions): {
|
|
15
|
+
add: () => void;
|
|
16
|
+
remove: () => void;
|
|
17
|
+
onMounted: () => void;
|
|
18
|
+
onBeforeDestroy: () => void;
|
|
19
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PopoverProps } from '../../components/message/popover/props';
|
|
2
|
+
import { arrow, flip, offset, OffsetOptions, shift } from '@floating-ui/dom';
|
|
3
|
+
export { flip, offset, shift, arrow, };
|
|
4
|
+
export default function usePopover(props?: Partial<PopoverProps>, middleware?: {
|
|
5
|
+
offset?: OffsetOptions;
|
|
6
|
+
extends?: any[];
|
|
7
|
+
}): {
|
|
8
|
+
popoverOptions: PopoverProps;
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TeleportProps, VNode } from 'vue';
|
|
2
|
+
import { MTeleportProps } from '../../types/common/common';
|
|
3
|
+
export default function useTeleport(options: {
|
|
4
|
+
teleportProps?: MTeleportProps | true;
|
|
5
|
+
slot: VNode | VNode[];
|
|
6
|
+
}): any;
|
|
7
|
+
export declare const initTeleportOptions: (options: TeleportProps | true | undefined) => any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ModelMask } from '../../types/common/model';
|
|
2
|
+
export interface UseModalProps {
|
|
3
|
+
visible?: boolean;
|
|
4
|
+
mask?: ModelMask;
|
|
5
|
+
}
|
|
6
|
+
export declare function useModal(props: UseModalProps, emit: (...args: any[]) => void): {
|
|
7
|
+
visible: any;
|
|
8
|
+
open: () => void;
|
|
9
|
+
close: () => void;
|
|
10
|
+
toggle: () => void;
|
|
11
|
+
onMaskClick: () => void;
|
|
12
|
+
showMask: () => boolean;
|
|
13
|
+
onContentClick: (e: MouseEvent) => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ComputePositionConfig } from '@floating-ui/dom';
|
|
2
|
+
export type Placement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
|
|
3
|
+
export type PopperConfig = Partial<ComputePositionConfig>;
|
|
4
|
+
type DomStyle = {
|
|
5
|
+
left: string;
|
|
6
|
+
top: string;
|
|
7
|
+
display: string;
|
|
8
|
+
position: string;
|
|
9
|
+
};
|
|
10
|
+
export type PositionStyle = {
|
|
11
|
+
style: DomStyle;
|
|
12
|
+
arrowStyle: DomStyle;
|
|
13
|
+
placement: Placement;
|
|
14
|
+
};
|
|
15
|
+
export declare const usePopper: (triggerNode: HTMLElement, popperNode: HTMLElement, update: (data: PositionStyle) => void, arrowNode?: HTMLElement, config?: PopperConfig) => {
|
|
16
|
+
getPositionStyle: () => Promise<PositionStyle>;
|
|
17
|
+
clear: () => void;
|
|
18
|
+
};
|
|
19
|
+
export {};
|