///
import * as React from "react";
import { noop } from "../Dynamics/Utils";
export interface CheckBoxListManagerProps {
/** Individual checkbox change callback. You can also just use onListChange. */
onChange?: (value: string, checked: boolean, evt: any) => void;
/** Called with all checked values if a checkbox changes or after the the component mounts. */
onListChange?: (values: Set) => undefined;
}
/**
* Parent for checkbox list. Only passes enhanced props to and then renders the first child.
* The only requirement for the child is to receive `getInputProps` and potentially
* use it to render a checkbox. Children can use `updateList` in getInputProps to contribute
* to the overall checkbox list reporting from the mangaer.
*
* The underyling "checkbox creator" can optionally use `getInputProps` to set the props
* for the input element and `updateList` to add and remove checked status
* back to the manager for reporting in `onListChange`.
*/
export declare class CheckBoxListManager extends React.Component {
constructor(props: CheckBoxListManagerProps);
static defaultProps: {
onChange: typeof noop;
onListChange: typeof noop;
};
/** Non-state in the sense it does not drive rendering. */
private checkedValues;
private input_handleOnChange;
private input_updateList;
private getInputProps;
private getCombinedProps;
render(): any;
}
export interface CheckBoxListProps {
className?: string | null;
/** Array of {value, label} pairs. Values will be converted to strings. */
options: Array;
/** Array of values that are checked or a predicate. If checked is undefined, will look for checked property. */
checked?: Array | ((v: string) => boolean);
/** Outer react container component */
Container: React.ReactType;
/** Component for the checkbox. It will be passed {key,value,label,checked,getInputProps}. */
CheckBoxComponent: React.ReactType;
/** Individual checkbox change callback. You can also just use onListChange. */
onChange?: (value: string, checked: boolean, evt: any) => void;
/** Called with all checked values if a checkbox changes or after the the component mounts. */
onListChange?: (values: Set) => undefined;
/** name, not sure what this is for anymore. */
name?: string | null;
}
/**
* A checkbox input element wrapped with a label.
*/
export declare function CheckBox({getInputProps, ...rest}: {
[x: string]: any;
getInputProps: any;
}): JSX.Element;
/** Render items using a flexbox.
* @param direction "column"|"row", default is column.
*/
export declare function DefaultContainer(props: any): JSX.Element;
export declare const CheckBoxList: React.ComponentType & Partial>;
export default CheckBoxList;
/** Render items using an HTML ul element. Each checkbox item is wrapped in a li.
*/
export declare function ListContainer({children, className, style}: {
children: any;
className: any;
style: any;
}): JSX.Element;
export declare function ListCheckBox(props: any): JSX.Element;
export declare const CheckBoxListUsingList: React.ComponentType & Partial>;