@fesjs/fes-design
Version:
fes-design for PC
36 lines (35 loc) • 1.21 kB
TypeScript
import { type InjectionKey } from 'vue';
import type { ChangeEvent, VModelEvent } from '../interface';
export interface ParentGroupInjection<Value, ParentGroupProps extends {
disabled?: boolean;
}> {
name: string;
props: ParentGroupProps;
isSelect: (value: Value) => void;
onSelect: (value: Value, afterSelect: () => void) => void;
}
export default function useSelect<Value, ParentGroupProps extends {
disabled?: boolean;
}>({ props, emit, parent, }: {
props: any;
emit: {
(e: VModelEvent, ...args: any[]): void;
(e: ChangeEvent, ...args: any[]): void;
};
parent: {
groupKey: InjectionKey<ParentGroupInjection<Value, ParentGroupProps>>;
name: string;
};
}): {
currentValue: import("vue").WritableComputedRef<any, any>;
updateCurrentValue: (val: any) => void;
checked: import("vue").ComputedRef<any>;
innerDisabled: import("vue").ComputedRef<any>;
isGroup: boolean;
group: ParentGroupInjection<Value, ParentGroupProps>;
focus: import("vue").Ref<boolean, boolean>;
hover: import("vue").Ref<boolean, boolean>;
handleClick: () => void;
handleMouseOver: () => void;
handleMouseOut: () => void;
};