UNPKG

rmwc

Version:

A thin React wrapper for Material Design (Web) Components

372 lines (371 loc) 14.6 kB
import { SimpleTagPropsT, CustomEventT } from '../Base'; import * as React from 'react'; export declare const DialogRoot: { new <P>(props: any, context?: any): { render(): React.ReactElement<any> | null; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: any) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callBack?: (() => void) | undefined): void; props: Readonly<{ children?: React.ReactNode; }> & Readonly<any>; state: Readonly<{}>; context: any; refs: { [key: string]: React.ReactInstance; }; }; displayName: string; defaultProps: { tag: string | React.ComponentClass<any> | React.StatelessComponent<any>; constructor: Function; toString(): string; toLocaleString(): string; valueOf(): Object; hasOwnProperty(v: string | number | symbol): boolean; isPrototypeOf(v: Object): boolean; propertyIsEnumerable(v: string | number | symbol): boolean; }; isSimpleTag: boolean; }; /** The Dialog backdrop */ export declare const DialogBackdrop: { new <P>(props: any, context?: any): { render(): React.ReactElement<any> | null; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: any) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callBack?: (() => void) | undefined): void; props: Readonly<{ children?: React.ReactNode; }> & Readonly<any>; state: Readonly<{}>; context: any; refs: { [key: string]: React.ReactInstance; }; }; displayName: string; defaultProps: { tag: string | React.ComponentClass<any> | React.StatelessComponent<any>; constructor: Function; toString(): string; toLocaleString(): string; valueOf(): Object; hasOwnProperty(v: string | number | symbol): boolean; isPrototypeOf(v: Object): boolean; propertyIsEnumerable(v: string | number | symbol): boolean; }; isSimpleTag: boolean; }; /** The Dialog surface */ export declare const DialogSurface: { new <P>(props: any, context?: any): { render(): React.ReactElement<any> | null; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: any) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callBack?: (() => void) | undefined): void; props: Readonly<{ children?: React.ReactNode; }> & Readonly<any>; state: Readonly<{}>; context: any; refs: { [key: string]: React.ReactInstance; }; }; displayName: string; defaultProps: { tag: string | React.ComponentClass<any> | React.StatelessComponent<any>; constructor: Function; toString(): string; toLocaleString(): string; valueOf(): Object; hasOwnProperty(v: string | number | symbol): boolean; isPrototypeOf(v: Object): boolean; propertyIsEnumerable(v: string | number | symbol): boolean; }; isSimpleTag: boolean; }; /** The Dialog header */ export declare const DialogHeader: { new <P>(props: any, context?: any): { render(): React.ReactElement<any> | null; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: any) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callBack?: (() => void) | undefined): void; props: Readonly<{ children?: React.ReactNode; }> & Readonly<any>; state: Readonly<{}>; context: any; refs: { [key: string]: React.ReactInstance; }; }; displayName: string; defaultProps: { tag: string | React.ComponentClass<any> | React.StatelessComponent<any>; constructor: Function; toString(): string; toLocaleString(): string; valueOf(): Object; hasOwnProperty(v: string | number | symbol): boolean; isPrototypeOf(v: Object): boolean; propertyIsEnumerable(v: string | number | symbol): boolean; }; isSimpleTag: boolean; }; /** The Dialog title */ export declare const DialogHeaderTitle: { new <P>(props: any, context?: any): { render(): React.ReactElement<any> | null; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: any) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callBack?: (() => void) | undefined): void; props: Readonly<{ children?: React.ReactNode; }> & Readonly<any>; state: Readonly<{}>; context: any; refs: { [key: string]: React.ReactInstance; }; }; displayName: string; defaultProps: { tag: string | React.ComponentClass<any> | React.StatelessComponent<any>; constructor: Function; toString(): string; toLocaleString(): string; valueOf(): Object; hasOwnProperty(v: string | number | symbol): boolean; isPrototypeOf(v: Object): boolean; propertyIsEnumerable(v: string | number | symbol): boolean; }; isSimpleTag: boolean; }; export declare type DialogBodyT = { /** Make it scrollable. */ scrollable?: boolean; } & SimpleTagPropsT; declare const DialogBody_base: { new <P>(props: any, context?: any): { render(): React.ReactElement<any> | null; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: any) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callBack?: (() => void) | undefined): void; props: Readonly<{ children?: React.ReactNode; }> & Readonly<any>; state: Readonly<{}>; context: any; refs: { [key: string]: React.ReactInstance; }; }; displayName: string; defaultProps: { tag: string | React.ComponentClass<any> | React.StatelessComponent<any>; constructor: Function; toString(): string; toLocaleString(): string; valueOf(): Object; hasOwnProperty(v: string | number | symbol): boolean; isPrototypeOf(v: Object): boolean; propertyIsEnumerable(v: string | number | symbol): boolean; }; isSimpleTag: boolean; }; /** The Dialog body */ export declare class DialogBody extends DialogBody_base<DialogBodyT> { static displayName: string; render(): React.ReactElement<any> | null; } /** The Dialog footer */ export declare const DialogFooter: { new <P>(props: any, context?: any): { render(): React.ReactElement<any> | null; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: any) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callBack?: (() => void) | undefined): void; props: Readonly<{ children?: React.ReactNode; }> & Readonly<any>; state: Readonly<{}>; context: any; refs: { [key: string]: React.ReactInstance; }; }; displayName: string; defaultProps: { tag: string | React.ComponentClass<any> | React.StatelessComponent<any>; constructor: Function; toString(): string; toLocaleString(): string; valueOf(): Object; hasOwnProperty(v: string | number | symbol): boolean; isPrototypeOf(v: Object): boolean; propertyIsEnumerable(v: string | number | symbol): boolean; }; isSimpleTag: boolean; }; export declare type DialogFooterButtonT = { /** Make it an accept button. */ accept?: boolean; /** Make it a cancel button. */ cancel?: boolean; } & SimpleTagPropsT; declare const DialogFooterButton_base: { new <P>(props: any, context?: any): { render(): React.ReactElement<any> | null; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: any) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callBack?: (() => void) | undefined): void; props: Readonly<{ children?: React.ReactNode; }> & Readonly<any>; state: Readonly<{}>; context: any; refs: { [key: string]: React.ReactInstance; }; }; displayName: string; defaultProps: { tag: string | React.ComponentClass<any> | React.StatelessComponent<any>; constructor: Function; toString(): string; toLocaleString(): string; valueOf(): Object; hasOwnProperty(v: string | number | symbol): boolean; isPrototypeOf(v: Object): boolean; propertyIsEnumerable(v: string | number | symbol): boolean; }; isSimpleTag: boolean; }; /** A Dialog footer button */ export declare class DialogFooterButton extends DialogFooterButton_base<DialogFooterButtonT> { static displayName: string; render(): React.ReactElement<any> | null; } export declare type DialogPropsT = { /** Whether or not the Dialog is showing. */ open: boolean; /** Callback for when the accept Button is pressed. */ onAccept?: (evt: CustomEventT) => any; /** Callback for when the Dialog was closed without acceptance. */ onCancel?: (evt: CustomEventT) => any; /** Callback for when the Dialog closes. */ onClose?: (evt: CustomEventT) => any; }; declare const Dialog_base: { new <P>(props: P & { tag?: string | React.ComponentClass<any> | React.StatelessComponent<any> | undefined; className?: string | undefined; wrap?: boolean | undefined; elementRef?: any; theme?: string | string[] | undefined; children?: React.ReactNode; apiRef?: (<S>(api: S) => S) | undefined; } & React.HTMLProps<any>): { foundation_: { [key: string]: any; adapter_: any; init: Function; destroy: Function; } | null; foundationRefs: { [name: string]: (ref: HTMLElement) => any; }; root_: Element | Text | null; props: P & { tag?: string | React.ComponentClass<any> | React.StatelessComponent<any> | undefined; className?: string | undefined; wrap?: boolean | undefined; elementRef?: any; theme?: string | string[] | undefined; children?: React.ReactNode; apiRef?: (<S>(api: S) => S) | undefined; } & React.HTMLProps<any>; componentDidMount(): void; componentWillReceiveProps(nextProps: P & { tag?: string | React.ComponentClass<any> | React.StatelessComponent<any> | undefined; className?: string | undefined; wrap?: boolean | undefined; elementRef?: any; theme?: string | string[] | undefined; children?: React.ReactNode; apiRef?: (<S>(api: S) => S) | undefined; } & React.HTMLProps<any>): void; componentWillUnmount(): void; _safeSyncWithProps(props: Object): void; initFoundation(): void; destroyComponent(): void; syncWithProps(nextProps: Object): void; initialize(...args: any[]): void; initialSyncWithDOM(): void; destroy(): void; getDefaultFoundation(): { adapter_: {}; init: () => void; destroy: () => void; }; emit(evtType: string, evtData: Object, shouldBubble?: boolean): any; listen(evtType: string, handler: Function): void; unlisten(evtType: string, handler: Function): void; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: P & { tag?: string | React.ComponentClass<any> | React.StatelessComponent<any> | undefined; className?: string | undefined; wrap?: boolean | undefined; elementRef?: any; theme?: string | string[] | undefined; children?: React.ReactNode; apiRef?: (<S>(api: S) => S) | undefined; } & React.HTMLProps<any>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void; forceUpdate(callBack?: (() => void) | undefined): void; render(): React.ReactNode; state: Readonly<{}>; context: any; refs: { [key: string]: React.ReactInstance; }; }; }; export declare class Dialog extends Dialog_base<DialogPropsT> { static displayName: string; show: Function; close: Function; open: boolean; syncWithProps(nextProps: DialogPropsT): void; render(): JSX.Element; } export declare type SimpleDialogPropsT = { /** A title for the default Dialog template. */ title?: React.ReactNode; /** Additional Dialog header content for the default Dialog template. */ header?: React.ReactNode; /** Body content for the default Dialog template, rendered before children. */ body?: React.ReactNode; /** Additional footer content for the default Dialog template, rendered before any buttons. */ footer?: React.ReactNode; /** Creates an accept button for the default Dialog template with a given label. You can pass `null` to remove the button.*/ acceptLabel?: React.ReactNode; /** Creates an cancel button for the default Dialog with a given label. You can pass `null` to remove the button.*/ cancelLabel?: React.ReactNode; /** Any children will be rendered in the body of the default Dialog template. */ children?: React.ReactNode; /** Allow the body to be scrollable */ scrollable?: boolean; } & DialogPropsT; /** A non-standard SimpleDialog component for ease of use. */ export declare class SimpleDialog extends React.Component<SimpleDialogPropsT> { static defaultProps: { title: undefined; header: undefined; body: undefined; footer: undefined; scrollable: undefined; acceptLabel: string; cancelLabel: string; open: boolean; onAccept: () => void; onCancel: () => void; onClose: () => void; children: undefined; }; render(): JSX.Element; } export {};