@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,45 @@
|
|
|
1
|
+
import { PopperConfig, PositionStyle, usePopper } from '../../../compositions/popper/usePopper.ts';
|
|
2
|
+
import { PopoverProps } from './props';
|
|
3
|
+
import { Ref } from 'vue';
|
|
4
|
+
export type IPopper = ReturnType<typeof usePopper>;
|
|
5
|
+
/**
|
|
6
|
+
* Popover 实例,管理定位、显示/隐藏状态
|
|
7
|
+
*/
|
|
8
|
+
export declare class PopoverImpl {
|
|
9
|
+
protected _active: HTMLElement;
|
|
10
|
+
protected _content: HTMLElement;
|
|
11
|
+
protected _arrow: HTMLElement | undefined;
|
|
12
|
+
popperInstance: IPopper;
|
|
13
|
+
style: Ref;
|
|
14
|
+
arrowStyle: Ref;
|
|
15
|
+
placement: Ref;
|
|
16
|
+
visible: boolean;
|
|
17
|
+
onShow?: Function;
|
|
18
|
+
onHide?: Function;
|
|
19
|
+
constructor(val: {
|
|
20
|
+
style: Ref;
|
|
21
|
+
arrowStyle: Ref;
|
|
22
|
+
placement: Ref;
|
|
23
|
+
show: boolean;
|
|
24
|
+
}, active: HTMLElement, content: HTMLElement, arrow?: HTMLElement, config?: PopperConfig, lifecycle?: {
|
|
25
|
+
onShow?: Function;
|
|
26
|
+
onHide?: Function;
|
|
27
|
+
});
|
|
28
|
+
get content(): HTMLElement;
|
|
29
|
+
show(): Promise<void>;
|
|
30
|
+
update(positionStyle: PositionStyle): void;
|
|
31
|
+
hide(): void;
|
|
32
|
+
toggle(): Promise<void>;
|
|
33
|
+
destroy(): void;
|
|
34
|
+
}
|
|
35
|
+
export default function usePopover(props: Required<PopoverProps>, ctx: any): {
|
|
36
|
+
popoverEnter: () => void;
|
|
37
|
+
popoverLeave: () => void;
|
|
38
|
+
popoverRef: any;
|
|
39
|
+
contentRef: any;
|
|
40
|
+
arrowRef: any;
|
|
41
|
+
popperInstance: any;
|
|
42
|
+
style: any;
|
|
43
|
+
arrowStyle: any;
|
|
44
|
+
placement: any;
|
|
45
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const RadioCore: {
|
|
2
|
+
props: import('../../types/props').MCOPO<import('./props').RadioProps>;
|
|
3
|
+
initChecked: (props: {
|
|
4
|
+
checked: boolean | null | undefined;
|
|
5
|
+
modelValue: any;
|
|
6
|
+
value: any;
|
|
7
|
+
}) => boolean;
|
|
8
|
+
getNewModelValue: (props: {
|
|
9
|
+
value: any;
|
|
10
|
+
modelValue?: any;
|
|
11
|
+
}, checked: boolean) => any;
|
|
12
|
+
createRadioId: () => string;
|
|
13
|
+
};
|
|
14
|
+
export { initChecked, getNewModelValue, createRadioId } from './useRadio';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description radio hook
|
|
3
|
+
* @author 阿怪
|
|
4
|
+
* @date 2025/02/25 00:00
|
|
5
|
+
* @version v1.0.0
|
|
6
|
+
*
|
|
7
|
+
* 江湖的业务千篇一律,复杂的代码好几百行。
|
|
8
|
+
*/
|
|
9
|
+
export { initChecked, getNewModelValue } from '../../../compositions/input/useBooleanInput';
|
|
10
|
+
export declare const createRadioId: () => string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RateProps } from './props';
|
|
2
|
+
export default function useRate(props: Required<RateProps>, emit: (event: string, ...args: unknown[]) => void): {
|
|
3
|
+
hoverValue: any;
|
|
4
|
+
getStarState: (index: number) => "full" | "half" | "empty";
|
|
5
|
+
onMouseEnter: (e: MouseEvent, index: number) => void;
|
|
6
|
+
onMouseMove: (e: MouseEvent, index: number) => void;
|
|
7
|
+
onMouseLeave: () => void;
|
|
8
|
+
onClick: (e: MouseEvent, index: number) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useSelect } from './useSelect';
|
|
2
|
+
export declare const SelectCore: {
|
|
3
|
+
props: import('../../types/props').MCOPO<import('./props').SelectProps>;
|
|
4
|
+
useSelect: typeof useSelect;
|
|
5
|
+
};
|
|
6
|
+
export type { SelectProps } from './props';
|
|
7
|
+
export type { SelectOptionItem } from './useSelect';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { SelectProps } from './props';
|
|
2
|
+
export interface SelectOptionItem {
|
|
3
|
+
/** 原始值 */
|
|
4
|
+
value: any;
|
|
5
|
+
/** 在 options 数组中的索引 */
|
|
6
|
+
index: number;
|
|
7
|
+
/** 是否选中 */
|
|
8
|
+
isSelected: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function useSelect(props: SelectProps, ctx: any): {
|
|
11
|
+
inputValue: any;
|
|
12
|
+
isOpen: any;
|
|
13
|
+
fetchLoading: any;
|
|
14
|
+
inputReadonly: any;
|
|
15
|
+
displayOptions: any;
|
|
16
|
+
selectedTags: any;
|
|
17
|
+
lastOptionRef: any;
|
|
18
|
+
optionsContainerRef: any;
|
|
19
|
+
onSelect: (index: number) => void;
|
|
20
|
+
onDeleteTag: (index: number) => void;
|
|
21
|
+
onInput: () => void;
|
|
22
|
+
onFocus: (e: FocusEvent) => void;
|
|
23
|
+
onBlur: (e: FocusEvent) => void;
|
|
24
|
+
tools: {
|
|
25
|
+
getInfoWithKey: (option: any, key: import('./useSelectTools').SelectParamKeys) => any;
|
|
26
|
+
getInputValue: (option: any) => string;
|
|
27
|
+
getOptionValue: (option: any) => string;
|
|
28
|
+
getModelValue: (option: any) => any;
|
|
29
|
+
};
|
|
30
|
+
updateFetchObserver: () => void;
|
|
31
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SelectProps } from './props';
|
|
2
|
+
export type SelectParamKeys = 'optionParam' | 'valueParam' | 'inputParam';
|
|
3
|
+
export declare function useSelectTools(props: SelectProps): {
|
|
4
|
+
getInfoWithKey: (option: any, key: SelectParamKeys) => any;
|
|
5
|
+
getInputValue: (option: any) => string;
|
|
6
|
+
getOptionValue: (option: any) => string;
|
|
7
|
+
getModelValue: (option: any) => any;
|
|
8
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MCOPO } from '../../types/props';
|
|
2
|
+
import { StepsProps, StepProps } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* Steps 容器组件运行时 props
|
|
5
|
+
*/
|
|
6
|
+
export declare const stepsProps: MCOPO<StepsProps>;
|
|
7
|
+
/**
|
|
8
|
+
* Step 单个步骤组件运行时 props
|
|
9
|
+
*/
|
|
10
|
+
export declare const stepProps: MCOPO<StepProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { useSteps, useStep, resolveStepStatus } from './useSteps';
|
|
2
|
+
export declare const StepsCore: {
|
|
3
|
+
stepsProps: import('../../types/props').MCOPO<import('./props').StepsProps>;
|
|
4
|
+
stepProps: import('../../types/props').MCOPO<import('./props').StepProps>;
|
|
5
|
+
useSteps: typeof useSteps;
|
|
6
|
+
useStep: typeof useStep;
|
|
7
|
+
stepsContextKey: InjectionKey<import('./useSteps').StepsContext>;
|
|
8
|
+
resolveStepStatus: typeof resolveStepStatus;
|
|
9
|
+
};
|
|
10
|
+
export type { StepsProps, StepProps, StepItem, StepStatus, StepsDirection } from './props';
|
|
11
|
+
export type { StepsContext } from './useSteps';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { InjectionKey } from 'vue';
|
|
2
|
+
import { StepsProps, StepStatus } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* Steps 向子 Step 注入的上下文结构
|
|
5
|
+
*/
|
|
6
|
+
export interface StepsContext {
|
|
7
|
+
/** 当前激活步骤索引 */
|
|
8
|
+
active: number;
|
|
9
|
+
/** 已完成步骤状态 */
|
|
10
|
+
finishStatus: 'success' | 'finish';
|
|
11
|
+
/** 当前步骤状态 */
|
|
12
|
+
processStatus: 'process' | 'finish';
|
|
13
|
+
/** 步骤总数(由子步骤注册后更新) */
|
|
14
|
+
total: number;
|
|
15
|
+
/** 方向 */
|
|
16
|
+
direction: 'horizontal' | 'vertical';
|
|
17
|
+
}
|
|
18
|
+
/** 注入键 */
|
|
19
|
+
export declare const stepsContextKey: InjectionKey<StepsContext>;
|
|
20
|
+
/**
|
|
21
|
+
* Steps 容器 composable
|
|
22
|
+
* 负责将当前激活状态通过 provide 下发给 MStep 子组件
|
|
23
|
+
*/
|
|
24
|
+
export declare function useSteps(props: StepsProps): {
|
|
25
|
+
stepsClass: any;
|
|
26
|
+
context: StepsContext;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* 根据步骤索引和父级上下文推算当前步骤状态
|
|
30
|
+
* @param index 当前步骤序号(从 0 开始)
|
|
31
|
+
* @param overrideStatus 显式指定的状态,优先级最高
|
|
32
|
+
* @param ctx 父级 Steps 上下文
|
|
33
|
+
*/
|
|
34
|
+
export declare function resolveStepStatus(index: number, overrideStatus: StepStatus | undefined, ctx: StepsContext): StepStatus;
|
|
35
|
+
/**
|
|
36
|
+
* Step 单个步骤 composable
|
|
37
|
+
* 从父级注入 StepsContext,计算当前步骤的状态与样式类
|
|
38
|
+
*/
|
|
39
|
+
export declare function useStep(index: number, overrideStatus?: StepStatus): {
|
|
40
|
+
status: any;
|
|
41
|
+
stepClass: any;
|
|
42
|
+
isLast: any;
|
|
43
|
+
ctx: any;
|
|
44
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as useSwitch } from './useSwitch.tsx';
|
|
2
|
+
export declare const SwitchCore: {
|
|
3
|
+
props: import('../../types/props').MCOPO<import('./props').SwitchProps>;
|
|
4
|
+
switchIsBoolean: (value: import('./props').SwitchProps["modelValue"]) => value is boolean;
|
|
5
|
+
getIsActive: (value: import('./props').SwitchProps["modelValue"], activeValue: import('./props').SwitchProps["activeValue"]) => boolean;
|
|
6
|
+
useSwitch: typeof useSwitch;
|
|
7
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SwitchProps } from './props';
|
|
2
|
+
import { EmitsOptions, SlotsType } from '@vue/runtime-core';
|
|
3
|
+
export declare const switchIsBoolean: (value: SwitchProps["modelValue"]) => value is boolean;
|
|
4
|
+
export declare const getIsActive: (value: SwitchProps["modelValue"], activeValue: SwitchProps["activeValue"]) => boolean;
|
|
5
|
+
export default function useSwitch<Props extends Record<string, any>, E extends EmitsOptions = {}, EE extends string = string, S extends SlotsType = {}>(props: Props, ctx: any): {
|
|
6
|
+
getInfo: (key: keyof Pick<SwitchProps, "activeInfo" | "inactiveInfo">) => any;
|
|
7
|
+
changeSwitch: () => void;
|
|
8
|
+
switchClass: any;
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as useTabs } from './useTabs.ts';
|
|
2
|
+
export declare const TabsCore: {
|
|
3
|
+
props: import('../../types/props').MCOPO<import('./props').TabsProps>;
|
|
4
|
+
tabPaneProps: import('../../types/props').MCOPO<import('./props').TabPaneProps>;
|
|
5
|
+
useTabs: typeof useTabs;
|
|
6
|
+
};
|
|
7
|
+
export type { TabsProps, TabPaneProps, TabItem } from './props';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export default function useTabs<Props extends Record<string, unknown>>(props: Props, ctx: any): {
|
|
2
|
+
activeTab: any;
|
|
3
|
+
isActive: (name: string | number) => boolean;
|
|
4
|
+
switchTab: (name: string | number, disabled?: boolean) => void;
|
|
5
|
+
tabsClass: any;
|
|
6
|
+
navClass: string;
|
|
7
|
+
getNavItemClass: (name: string | number, disabled?: boolean) => string[];
|
|
8
|
+
contentClass: string;
|
|
9
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useTimePicker } from './useTimePicker';
|
|
2
|
+
export declare const TimePickerCore: {
|
|
3
|
+
props: import('../../types/props').MCOPO<import('./props').TimePickerProps>;
|
|
4
|
+
useTimePicker: typeof useTimePicker;
|
|
5
|
+
};
|
|
6
|
+
export type { TimePickerProps, TimeRefType } from './props';
|
|
7
|
+
export { useTimePicker, generateColumn } from './useTimePicker';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TimePickerProps, TimeRefType } from './props';
|
|
2
|
+
/**
|
|
3
|
+
* 生成一列可选数字数组。
|
|
4
|
+
* @param max 最大值(不含),如 24、60
|
|
5
|
+
* @param step 步长
|
|
6
|
+
*/
|
|
7
|
+
export declare const generateColumn: (max: number, step: number) => number[];
|
|
8
|
+
export declare function useTimePicker(props: TimePickerProps): {
|
|
9
|
+
timeRef: any;
|
|
10
|
+
displayValue: any;
|
|
11
|
+
spanClass: any;
|
|
12
|
+
hoursColumn: any;
|
|
13
|
+
minutesColumn: any;
|
|
14
|
+
secondsColumn: any;
|
|
15
|
+
updateTimeRef: (value: string | undefined) => void;
|
|
16
|
+
selectHour: (hour: number) => void;
|
|
17
|
+
selectMinute: (minute: number) => void;
|
|
18
|
+
selectSecond: (second: number) => void;
|
|
19
|
+
getValue: () => string;
|
|
20
|
+
formatTime: (time: TimeRefType) => string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const TimelineCore: {
|
|
2
|
+
timelineProps: import('../../types/props').MCOPO<import('./props').TimelineProps>;
|
|
3
|
+
timelineItemProps: import('../../types/props').MCOPO<import('./props').TimelineItemProps>;
|
|
4
|
+
};
|
|
5
|
+
export type { TimelineProps, TimelineItemProps } from './props';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TooltipProps } from './props';
|
|
2
|
+
export type TooltipStyle = {
|
|
3
|
+
position: string;
|
|
4
|
+
left: string;
|
|
5
|
+
top: string;
|
|
6
|
+
zIndex: string;
|
|
7
|
+
};
|
|
8
|
+
export default function useTooltip(props: Required<TooltipProps>): {
|
|
9
|
+
visible: any;
|
|
10
|
+
tooltipStyle: any;
|
|
11
|
+
triggerRef: any;
|
|
12
|
+
tooltipRef: any;
|
|
13
|
+
show: () => Promise<void>;
|
|
14
|
+
hide: () => void;
|
|
15
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TransferProps } from './props';
|
|
2
|
+
export declare function useTransfer(props: TransferProps, ctx: any): {
|
|
3
|
+
leftSearch: any;
|
|
4
|
+
rightSearch: any;
|
|
5
|
+
leftData: any;
|
|
6
|
+
rightData: any;
|
|
7
|
+
filteredLeftData: any;
|
|
8
|
+
filteredRightData: any;
|
|
9
|
+
leftChecked: any;
|
|
10
|
+
rightChecked: any;
|
|
11
|
+
hasLeftChecked: any;
|
|
12
|
+
hasRightChecked: any;
|
|
13
|
+
isLeftAllChecked: any;
|
|
14
|
+
isLeftIndeterminate: any;
|
|
15
|
+
isRightAllChecked: any;
|
|
16
|
+
isRightIndeterminate: any;
|
|
17
|
+
toggleLeftCheck: (key: string | number, disabled: boolean) => void;
|
|
18
|
+
toggleRightCheck: (key: string | number, disabled: boolean) => void;
|
|
19
|
+
toggleLeftAll: () => void;
|
|
20
|
+
toggleRightAll: () => void;
|
|
21
|
+
moveToRight: () => void;
|
|
22
|
+
moveToLeft: () => void;
|
|
23
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MCOPO } from '../../types/props';
|
|
2
|
+
import { TreeNodeProps, TreeProps } from './props';
|
|
3
|
+
/** 默认树配置(对外导出供使用方引用) */
|
|
4
|
+
export declare const DEFAULT_TREE_CONFIG: import('./props').TreeConfig;
|
|
5
|
+
/** MTree 组件的 props 定义 */
|
|
6
|
+
export declare const props: MCOPO<TreeProps>;
|
|
7
|
+
/** MTreeNode 子组件的 props 定义 */
|
|
8
|
+
export declare const treeNodeProps: MCOPO<TreeNodeProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const TreeCore: {
|
|
2
|
+
props: import('../../types/props').MCOPO<import('./props').TreeProps>;
|
|
3
|
+
treeNodeProps: import('../../types/props').MCOPO<import('./props').TreeNodeProps>;
|
|
4
|
+
useTree: (options: import('./useTree').UseTreeOptions) => {
|
|
5
|
+
treeRef: any;
|
|
6
|
+
getNodesByKeys: (keys: import('./props').TreeNodeData["key"][]) => import('./props').TreeNodeData[];
|
|
7
|
+
handleToggleExpand: (node: import('./props').TreeNodeData, e: MouseEvent) => void;
|
|
8
|
+
handleToggleChecked: (node: import('./props').TreeNodeData, checked: boolean) => void;
|
|
9
|
+
initTreeRef: (data?: import('./props').TreeData | import('./props').TreeData[] | undefined) => void;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export type { TreeProps, TreeData, TreeNodeData, TreeConfig, TreeStatusKey, TreeNodeProps, } from './props';
|
|
13
|
+
export { useTree, fixKey } from './useTree';
|
|
14
|
+
export { default as Tree } from './tree';
|
|
15
|
+
export { DEFAULT_TREE_CONFIG, props as treeProps, treeNodeProps } from './api';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { TreeConfig, TreeData, TreeNodeData } from './props';
|
|
2
|
+
/** 节点缓存 Map 类型 */
|
|
3
|
+
export type TreeDataMap = Map<TreeNodeData['key'], TreeNodeData>;
|
|
4
|
+
/** 默认字段映射配置 */
|
|
5
|
+
export declare const DEFAULT_CONFIG: TreeConfig;
|
|
6
|
+
/** 合并用户配置与默认配置 */
|
|
7
|
+
export declare const mergeConfig: (config: Partial<TreeConfig>) => TreeConfig;
|
|
8
|
+
export interface TreeNodeOptions {
|
|
9
|
+
data: TreeData | TreeData[];
|
|
10
|
+
config?: TreeConfig;
|
|
11
|
+
defaultExpandAll?: boolean;
|
|
12
|
+
checkStrictly?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface TreeAttrs {
|
|
15
|
+
defaultExpandAll: boolean;
|
|
16
|
+
checkStrictly: boolean;
|
|
17
|
+
}
|
|
18
|
+
export default class Tree {
|
|
19
|
+
#private;
|
|
20
|
+
constructor(options: TreeNodeOptions);
|
|
21
|
+
/** 暴露配置,供组件层读取 */
|
|
22
|
+
get config(): TreeConfig;
|
|
23
|
+
/** 获取某节点的直接子节点 key 列表 */
|
|
24
|
+
getChildrenKeys(node: TreeNodeData): TreeNodeData['key'][];
|
|
25
|
+
/** 根据 key 数组批量获取节点 */
|
|
26
|
+
getNodesByKeys(keys: TreeNodeData['key'][]): TreeNodeData[];
|
|
27
|
+
/**
|
|
28
|
+
* 获取树形数据
|
|
29
|
+
* @param keys 若传入则返回对应 key 的节点列表,否则返回所有根节点
|
|
30
|
+
*/
|
|
31
|
+
getTreeData(keys?: TreeNodeData['key'][]): TreeNodeData[];
|
|
32
|
+
/** 获取当前所有选中 key 和展开 key */
|
|
33
|
+
getKeys(): {
|
|
34
|
+
checkedKeys: TreeNodeData['key'][];
|
|
35
|
+
expandKeys: TreeNodeData['key'][];
|
|
36
|
+
};
|
|
37
|
+
/** 切换节点展开/收起状态 */
|
|
38
|
+
toggleExpand(node: TreeNodeData, value?: boolean): void;
|
|
39
|
+
/**
|
|
40
|
+
* 设置节点 checkbox 选中状态
|
|
41
|
+
* checkStrictly=true(默认)时级联更新子节点和父节点状态
|
|
42
|
+
*/
|
|
43
|
+
setNodeCheckbox(node: TreeNodeData, checked: boolean): void;
|
|
44
|
+
/** 根据 key 数组批量设置节点为选中状态 */
|
|
45
|
+
setCheckedByKeys(keys: TreeNodeData['key'][]): void;
|
|
46
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { TreeData, TreeNodeData, TreeProps } from './props';
|
|
2
|
+
/**
|
|
3
|
+
* 为没有 key 的节点递归生成唯一标识
|
|
4
|
+
* @param data 树数据(数组或单节点)
|
|
5
|
+
* @param key key 字段名,默认 'key'
|
|
6
|
+
* @param prefixKey 前缀 key,用于构造子节点唯一 id
|
|
7
|
+
*/
|
|
8
|
+
export declare const fixKey: (data: TreeData | TreeData[], key: string | number, prefixKey?: string | number) => TreeData | TreeData[];
|
|
9
|
+
export interface UseTreeOptions {
|
|
10
|
+
props: TreeProps;
|
|
11
|
+
event: {
|
|
12
|
+
/** 触发 shallowRef 更新,通知 Vue 重新渲染 */
|
|
13
|
+
triggerTree: () => void;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* useTree — Tree 组件逻辑 composable
|
|
18
|
+
*
|
|
19
|
+
* 返回:
|
|
20
|
+
* - treeRef:Tree 实例的 shallowRef
|
|
21
|
+
* - initTreeRef:重新初始化 Tree(数据变化时调用)
|
|
22
|
+
* - handleToggleExpand:切换节点展开/收起
|
|
23
|
+
* - handleToggleChecked:切换节点 checkbox 选中状态
|
|
24
|
+
* - getNodesByKeys:根据 key 批量获取节点
|
|
25
|
+
*/
|
|
26
|
+
export declare const useTree: (options: UseTreeOptions) => {
|
|
27
|
+
treeRef: any;
|
|
28
|
+
getNodesByKeys: (keys: TreeNodeData["key"][]) => TreeNodeData[];
|
|
29
|
+
handleToggleExpand: (node: TreeNodeData, e: MouseEvent) => void;
|
|
30
|
+
handleToggleChecked: (node: TreeNodeData, checked: boolean) => void;
|
|
31
|
+
initTreeRef: (data?: TreeData | TreeData[] | undefined) => void;
|
|
32
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MCOPO } from '../../types/props';
|
|
2
|
+
import { MessageProps, MessageListProps } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* 单条消息组件的运行时 props
|
|
5
|
+
*/
|
|
6
|
+
export declare const messageProps: MCOPO<MessageProps>;
|
|
7
|
+
/**
|
|
8
|
+
* 消息列表容器的运行时 props
|
|
9
|
+
*/
|
|
10
|
+
export declare const messageListProps: MCOPO<MessageListProps>;
|