UNPKG

1.09 kBTypeScriptView Raw
1import * as React from 'react';
2import type { CheckboxChangeEvent } from './Checkbox';
3import GroupContext from './GroupContext';
4export interface CheckboxOptionType<T = any> {
5 label: React.ReactNode;
6 value: T;
7 style?: React.CSSProperties;
8 disabled?: boolean;
9 title?: string;
10 id?: string;
11 onChange?: (e: CheckboxChangeEvent) => void;
12 required?: boolean;
13}
14export interface AbstractCheckboxGroupProps<T = any> {
15 prefixCls?: string;
16 className?: string;
17 rootClassName?: string;
18 options?: (CheckboxOptionType<T> | string | number)[];
19 disabled?: boolean;
20 style?: React.CSSProperties;
21}
22export interface CheckboxGroupProps<T = any> extends AbstractCheckboxGroupProps<T> {
23 name?: string;
24 defaultValue?: T[];
25 value?: T[];
26 onChange?: (checkedValue: T[]) => void;
27 children?: React.ReactNode;
28}
29export type { CheckboxGroupContext } from './GroupContext';
30export { GroupContext };
31declare const _default: <T = any>(props: CheckboxGroupProps<T> & React.RefAttributes<HTMLDivElement>) => React.ReactElement;
32export default _default;