@iimm/formily-mui
Version:
form field components based on @mui/material and @formily/react
36 lines (35 loc) • 1.75 kB
TypeScript
import type { ReactNode } from "react";
import { CheckboxProps, type FormGroupProps, type SxProps } from "@mui/material";
import { type FormItemExtraProps, type FormItemBaseProps } from "../../layout/FormItem/FormItemBase";
import type { FieldBaseProps, IFieldOptionItem, IFieldPropOptions, RefreshOptionsProps } from "../../types";
import "../../styles/refresh.scss";
export declare const CheckboxGroupBase: (props: CheckboxGroupBaseProps) => import("react/jsx-runtime").JSX.Element;
export interface CheckboxGroupBaseProps extends FieldBaseProps<any[]>, Omit<FormGroupProps, "sx" | "defaultValue" | "value" | "onChange">, Omit<FormItemBaseProps, "className" | "style" | "prefixCls">, FormItemExtraProps, RefreshOptionsProps {
/** 选项或返回选项的函数。
*选项值:{value,label,color?,size?,disabled?,icon?,required?,checkedIcon?}
*/
options?: IFieldPropOptions<any, string | number, CheckboxOptionItem>;
minCount?: number;
maxCount?: number;
layout?: "horizontal" | "vertical";
/** 传递给每个checkbox项 */
itemSx?: SxProps;
/** 传递给FormGroup */
sx?: SxProps;
labelPlacement?: "bottom" | "end" | "start" | "top";
/** 未选中时的图标 */
icon?: ReactNode;
/** 选中时的图标 */
checkedIcon?: ReactNode;
size?: "medium" | "small";
color?: "default" | "primary" | "secondary" | "error" | "info" | "success" | "warning" | string;
}
interface CheckboxOptionItem<V = any, L extends ReactNode = ReactNode> extends IFieldOptionItem<V, L> {
size?: CheckboxProps["size"];
color?: CheckboxProps["color"];
icon?: CheckboxProps["icon"];
checkedIcon?: CheckboxProps["checkedIcon"];
required?: boolean;
sx?: SxProps;
}
export {};