react-antd-admin-panel
Version:
Modern TypeScript-first React admin panel builder with Ant Design 6
56 lines • 1.53 kB
TypeScript
import React from 'react';
import { FormFieldBuilder, FormFieldBuilderConfig } from '../base/FormFieldBuilder';
export interface CheckboxConfig extends FormFieldBuilderConfig {
text?: string;
indeterminate?: boolean;
}
export interface CheckboxOption {
label: string;
value: string | number;
disabled?: boolean;
}
export interface CheckboxGroupConfig extends FormFieldBuilderConfig {
options?: CheckboxOption[];
direction?: 'horizontal' | 'vertical';
}
/**
* Checkbox Field Builder
* Wrapper for Ant Design Checkbox component
*/
export declare class Checkbox extends FormFieldBuilder<CheckboxConfig, boolean> {
/**
* Set checkbox text/label
*/
text(value: string): this;
/**
* Set indeterminate state
*/
indeterminate(value?: boolean): this;
/**
* Render the checkbox component
*/
render(): React.ReactNode;
}
/**
* CheckboxGroup Field Builder
* Wrapper for Ant Design Checkbox.Group component
*/
export declare class CheckboxGroup extends FormFieldBuilder<CheckboxGroupConfig, (string | number)[]> {
/**
* Set checkbox options
*/
options(opts: CheckboxOption[]): this;
/**
* Add a single checkbox option
*/
option(label: string, value: string | number, disabled?: boolean): this;
/**
* Set layout direction
*/
direction(dir: 'horizontal' | 'vertical'): this;
/**
* Render the checkbox group component
*/
render(): React.ReactNode;
}
//# sourceMappingURL=Checkbox.d.ts.map