Group.d.ts 1.1 KB

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