@arche-mc2/arche-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
99 lines (98 loc) • 3.98 kB
TypeScript
import * as React from 'react';
import { WithThemeProps } from '../../../Common/theming/withTheme';
export declare type Size = 'small' | 'normal' | 'large';
import { TestableComponentProps } from '../../../Common/utils/types';
export interface UpToggleProps extends TestableComponentProps {
value: any;
checked?: boolean;
defaultChecked?: boolean;
disabled?: boolean;
icons?: any;
size?: Size;
className?: string;
tabIndex?: number;
onChange?: (event: any, value: any) => void;
onFocus?: (event: any) => void;
onBlur?: (event: any) => void;
}
export interface UpToggleState {
checked?: boolean;
hasFocus?: boolean;
}
declare class UpToggle extends React.PureComponent<UpToggleProps & WithThemeProps, UpToggleState> {
previouslyChecked: boolean;
input: any;
moved: boolean;
startX: number;
activated: boolean;
static defaultProps: Partial<UpToggleProps & WithThemeProps>;
constructor(props: any);
private pointerCoord;
componentWillReceiveProps(nextProps: any): void;
handleClick: (event: any) => void;
handleTouchStart: (event: any) => void;
handleTouchMove: (event: any) => void;
handleTouchEnd: (event: any) => void;
handleFocus: (event: any) => void;
handleBlur: (event: any) => void;
handleChangeEvent: (event: any) => void;
getIcon: (type: any) => any;
getTrackHeight: () => string;
getTrackWidth: () => string;
getThumbWidth: () => string;
getThumbHeight: () => string;
getTrackBorder: () => string;
getThumbBorder: () => string;
getThumbPosition: () => {
top: string;
left: string;
};
getThumbSelectedPosition: () => {
left: string;
};
getTrackXPosition: () => {
top: string;
bottom: string;
right: string;
};
getTrackCheckPosition: () => {
top: string;
bottom: string;
left: string;
};
render(): JSX.Element;
}
export { UpToggle };
declare const _default: {
new (props: any, context: any): {
render(): JSX.Element;
context: any;
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<UpToggleProps & WithThemeProps>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: () => void): void;
forceUpdate(callback?: () => void): void;
readonly props: Readonly<UpToggleProps & WithThemeProps> & Readonly<{
children?: React.ReactNode;
}>;
state: Readonly<{}>;
refs: {
[key: string]: React.ReactInstance;
};
componentDidMount?(): void;
shouldComponentUpdate?(nextProps: Readonly<UpToggleProps & WithThemeProps>, nextState: Readonly<{}>, nextContext: any): boolean;
componentWillUnmount?(): void;
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
getSnapshotBeforeUpdate?(prevProps: Readonly<UpToggleProps & WithThemeProps>, prevState: Readonly<{}>): any;
componentDidUpdate?(prevProps: Readonly<UpToggleProps & WithThemeProps>, prevState: Readonly<{}>, snapshot?: any): void;
componentWillMount?(): void;
UNSAFE_componentWillMount?(): void;
componentWillReceiveProps?(nextProps: Readonly<UpToggleProps & WithThemeProps>, nextContext: any): void;
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<UpToggleProps & WithThemeProps>, nextContext: any): void;
componentWillUpdate?(nextProps: Readonly<UpToggleProps & WithThemeProps>, nextState: Readonly<{}>, nextContext: any): void;
UNSAFE_componentWillUpdate?(nextProps: Readonly<UpToggleProps & WithThemeProps>, nextState: Readonly<{}>, nextContext: any): void;
};
displayName: string;
contextTypes: {
theme: import("prop-types").Requireable<object>;
};
contextType?: React.Context<any>;
};
export default _default;