extended-dynamic-forms
Version:
Extended React JSON Schema Form (RJSF) v6 with custom components, widgets, templates, layouts, and form events
71 lines (69 loc) • 2.36 kB
TypeScript
import { default as React } from 'react';
import { PresenterStrategy } from './PresenterStrategy';
import { ChoiceWidgetProps, ChoiceWidgetState, ChoiceWidgetConfig, PresentationMode } from '../ChoiceWidget.types';
/**
* Checkbox presenter configuration
*/
export interface CheckboxPresenterConfig {
/** Enable/disable select all functionality */
showSelectAll?: boolean;
/** Label for select all checkbox */
selectAllLabel?: string;
/** Layout mode: 'vertical' | 'horizontal' | 'grid' */
layout?: 'vertical' | 'horizontal' | 'grid';
/** Number of columns for grid layout */
columns?: number;
/** Responsive column configuration */
responsive?: {
xs?: number;
sm?: number;
md?: number;
lg?: number;
xl?: number;
xxl?: number;
};
/** Space between checkboxes */
spacing?: number;
/** Enable bulk operations (select all, clear, invert) */
enableBulkOperations?: boolean;
/** Custom bulk operation labels */
bulkOperationLabels?: {
selectAll?: string;
clearAll?: string;
invertSelection?: string;
};
}
/**
* Checkbox-based presenter strategy for multi-select choice widgets
*
* Features:
* - Ant Design Checkbox.Group integration
* - "Select All" with indeterminate states
* - Grid layout support with responsive columns
* - Individual checkbox disabled states
* - Bulk selection operations
* - Comprehensive accessibility support
*/
export declare class CheckboxPresenter extends PresenterStrategy {
readonly presentationMode = PresentationMode.CHECKBOX;
/**
* Render the checkbox widget using CheckboxWidget component.
*/
render(props: ChoiceWidgetProps, state: ChoiceWidgetState): React.ReactElement;
/**
* Handle selection change from Checkbox.Group component.
*/
handleSelectionChange(value: unknown, _props: ChoiceWidgetProps, _state: ChoiceWidgetState): (string | number | boolean)[];
/**
* Get default configuration for checkbox presentation.
*/
getDefaultProps(): Partial<ChoiceWidgetConfig>;
/**
* Validate checkbox-specific configuration.
*/
validateProps(config: ChoiceWidgetConfig): string[] | null;
/**
* Get the appropriate ARIA role for checkbox presentation.
*/
protected getAriaRole(): string;
}