react-input-material
Version:
Reusable material design based input field with support for (richt-)text, code, selections, numbers, dates and so on.
44 lines (43 loc) • 2.1 kB
TypeScript
import { ForwardRefRenderFunction } from 'react';
import { Adapter, Component, DefaultProperties, ModelState, Props } from './type';
/**
* Derives validation state from provided properties and state.
* @param properties - Current component properties.
* @param currentState - Current component state.
* @returns Whether component is in an aggregated valid or invalid state.
*/
export declare function determineValidationState(properties: DefaultProperties, currentState: Partial<ModelState>): boolean;
/**
* Wrapper component for checkboxes to validate.
* @property displayName - Descriptive name for component to show in web
* developer tools.
* Dataflow:
* 1. On-Render all states are merged with given properties into a normalized
* property object.
* 2. Properties, corresponding state values and sub node instances are saved
* into a "ref" object (to make them accessible from the outside for example
* for wrapper like web-components).
* 3. Event handler saves corresponding data modifications into state and
* normalized properties object.
* 4. All state changes except selection changes trigger an "onChange" event
* which delivers the consolidated properties object (with latest
* modifications included).
* @param props - Given components properties.
* @param reference - Reference object to forward internal state.
* @returns React elements.
*/
export declare const CheckboxInner: ForwardRefRenderFunction<Adapter, Props>;
/**
* Wrapping web component compatible react component.
* @property defaultModelState - Initial model state.
* @property defaultProperties - Initial property configuration.
* @property propTypes - Triggers reacts runtime property value checks.
* @property strict - Indicates whether we should wrap render output in reacts
* strict component.
* @property wrapped - Wrapped component.
* @param props - Given components properties.
* @param reference - Reference object to forward internal state.
* @returns React elements.
*/
export declare const Checkbox: Component<typeof CheckboxInner>;
export default Checkbox;