jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
41 lines (40 loc) • 1.37 kB
TypeScript
import type { PropsWithChildren } from 'react';
import React from 'react';
import type { SchemaClassName } from 'jamis-core';
interface CheckboxProps extends PropsWithChildren {
type: 'checkbox' | 'radio';
size?: 'sm' | 'lg' | 'small' | 'large';
label?: string | JSX.Element;
labelClassName?: SchemaClassName;
className?: SchemaClassName;
iconClassName?: SchemaClassName;
value?: boolean | string | number;
inline?: boolean;
trueValue?: boolean | string | number;
falseValue?: boolean | string | number;
disabled?: boolean;
readOnly?: boolean;
checked?: boolean;
name?: string;
description?: string;
descClassName?: SchemaClassName;
partial?: boolean;
optionType?: 'default' | 'button';
/** 在数组中的索引位置, 用在Checkboxes */
index?: number;
/** 整个数组的长度, 用在Checkboxes */
length?: number;
onClick?: (ev: React.MouseEvent<HTMLLabelElement>) => void;
onChange?: (value: any, shift: boolean) => void;
}
export default class Checkbox extends React.Component<CheckboxProps, any> {
static defaultProps: Pick<CheckboxProps, 'trueValue' | 'falseValue' | 'type'>;
state: {
isFocused: boolean;
};
handleCheck(e: React.ChangeEvent<any>): void;
handleFocus(): void;
handleBlur(): void;
render(): JSX.Element;
}
export {};