sard-uniapp
Version:
sard-uniapp 是一套基于 Uniapp + Vue3 框架开发的兼容多端的 UI 组件库
71 lines (70 loc) • 2.15 kB
TypeScript
import { type StyleValue } from 'vue';
import { type DefaultProps } from '../config';
import { type OptionKeys } from '../../use';
export type IconType = 'square' | 'circle';
export interface CheckboxProps {
rootStyle?: StyleValue;
rootClass?: string;
checked?: boolean;
indeterminate?: boolean;
value?: any;
label?: string;
disabled?: boolean;
readonly?: boolean;
size?: string;
type?: IconType;
checkedColor?: string;
validateEvent?: boolean;
}
export declare const defaultCheckboxProps: () => DefaultProps<CheckboxProps>;
export interface CheckboxSlots {
default?(props: Record<string, never>): any;
icon?(props: {
checked: boolean;
}): any;
}
export interface CheckboxEmits {
(e: 'click', event: any): void;
(e: 'update:checked', checked: boolean): void;
(e: 'change', checked: boolean): void;
}
export type CheckboxGroupOption = {
[key: PropertyKey]: any;
} | string | number | boolean;
export interface CheckboxGroupProps {
rootStyle?: StyleValue;
rootClass?: string;
modelValue?: any[];
disabled?: boolean;
readonly?: boolean;
size?: string;
type?: IconType;
checkedColor?: string;
direction?: 'horizontal' | 'vertical';
validateEvent?: boolean;
options?: CheckboxGroupOption[];
optionKeys?: OptionKeys;
}
export declare const defaultCheckboxGroupProps: () => DefaultProps<CheckboxGroupProps>;
export interface CheckboxGroupSlots {
default?(props: Record<string, never>): any;
custom?(props: {
toggle: (value: any) => void;
value: any[];
}): any;
}
export interface CheckboxGroupEmits {
(e: 'click', event: any): void;
(e: 'update:model-value', value: any[]): void;
(e: 'change', value: any[]): void;
}
export interface CheckboxContext {
disabled: CheckboxGroupProps['disabled'];
readonly: CheckboxGroupProps['readonly'];
size: CheckboxGroupProps['size'];
type: CheckboxGroupProps['type'];
checkedColor: CheckboxGroupProps['checkedColor'];
value: any[];
toggle: (value: any) => void;
}
export declare const checkboxContextSymbol: unique symbol;