UNPKG

@up-group/react-controls

Version:

We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get

41 lines (40 loc) 1.64 kB
/// <reference types="react" /> import * as React from "react"; import ValidationManager from "../Validation/ValidationManager"; import "../../../../Common/theming/base.css"; import { Tooltip } from '../../../Display/Tooltip'; import { ThemedProps } from '../../../../Common/theming/types'; export interface BaseControlProps<_BaseType> extends ThemedProps { onChange?: (arg: _BaseType, event: any, error: boolean) => void; value?: _BaseType; defaultValue?: _BaseType; disabled?: boolean; readonly?: boolean; tooltip?: string | Tooltip; isRequired?: boolean; showError?: boolean; } export interface BaseControlState<_BaseType> { error?: string; value?: _BaseType; extra?: any; } export declare abstract class BaseControlComponent<_Props, _BaseType> extends React.Component<BaseControlProps<_BaseType> & _Props, BaseControlState<_BaseType>> { _validationManager: ValidationManager; constructor(props?: BaseControlProps<_BaseType> & _Props, context?: any); private initWithProps(); protected registerValidations(): void; abstract getValue(args: any): _BaseType; protected setValue: (receiveValue: any) => _BaseType; abstract renderControl(): JSX.Element; private checkAndDispatch; private equal; validateProps(nextProps: any): void; componentWillReceiveProps(nextProps: any): void; handleChangeEvent: (event: any) => void; private checkData; hasError: () => boolean; render(): JSX.Element; componentDidMount(): void; dispatchOnChange: (data: _BaseType, event: any, error: boolean) => void; }