UNPKG

@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

123 lines (122 loc) 5.57 kB
import * as React from 'react'; import { WithThemeProps } from '../../../Common/theming'; import { UpMenuCustomStyles } from './styles'; import { ThemeInterface } from 'theming/types'; export declare type RenderCallback = (props: Partial<UpMenuProps>, state: UpMenuState) => JSX.Element; export declare type UpMenuCustomStylesKeys = 'menu' | 'nav' | 'content' | 'header' | 'footer'; export interface UpMenuProps { title?: string; icon?: RenderCallback | JSX.Element; header?: RenderCallback | JSX.Element; menuItems: MenuItemData[]; footer?: RenderCallback | JSX.Element; children?: RenderCallback | React.ReactNode; width?: number; minified?: boolean; blocked?: boolean; onClick?: (uri: string, menuItem?: MenuItemData) => boolean | void; onMinifiedChange?: (minified?: boolean) => void; customStyles?: UpMenuCustomStyles; className?: string; } export interface UpMenuState { minified: boolean; } declare class UpMenu extends React.Component<UpMenuProps & WithThemeProps, UpMenuState> { static defaultProps: { theme: ThemeInterface; icon: () => JSX.Element; width: number; }; constructor(p: any, c: any); toggleMinification: () => void; setMinification: (minified: boolean) => void; get isMinifiedControlled(): boolean; get currentMinifiedValue(): boolean; handleClick: (menuitem: MenuItemData) => boolean | void; render(): JSX.Element; } export declare type RenderIcon = (props: Partial<MenuItemProps>) => JSX.Element; export interface MenuItemData { title?: string; uri?: string; icon?: string | RenderIcon; isSelected?: boolean; isVisible?: boolean; childMenuItems?: MenuItemData[]; isSeparator?: boolean; render?: (item: MenuItemData, props?: Partial<UpMenuProps>, state?: UpMenuState) => JSX.Element; } export interface MenuItemProps extends MenuItemData { onClick?: (menuItem: MenuItemData) => boolean | void; } export declare class MenuItem extends React.Component<MenuItemProps> { constructor(p: any, c: any); shouldComponentUpdate(nextProps: any): boolean; onItemClick: (e: any) => void; render(): JSX.Element; } export interface SubMenuProps { title?: string; childMenuItems?: MenuItemData[]; onClick: (menuItem: MenuItemData) => void; } export declare class SubMenu extends React.Component<SubMenuProps> { constructor(p: any, c: any); shouldComponentUpdate(nextProps: any): boolean; render(): JSX.Element; } export interface SubItemsProps extends MenuItemData { onClick: (menuItem: MenuItemData) => boolean | void; } export interface SubItemsState { active: boolean; } export declare class SubItems extends React.Component<SubItemsProps, SubItemsState> { constructor(p: any, c: any); shouldComponentUpdate(nextProps: any, nextState: any): boolean; get anyChild(): boolean; onClick: (e: any) => boolean; onClickA: (e: any) => void; render(): JSX.Element; } declare const UpMenuDefaultHeader: (props: { title: string; theme?: ThemeInterface; }, state: { minified: boolean; }) => JSX.Element; export { UpMenu, UpMenuDefaultHeader }; declare const _default: { new (props: any, context: any): { render(): JSX.Element; context: any; setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<UpMenuProps & import("../../../Common/theming/withTheme").WithThemeProps>) => {} | Pick<{}, K>) | Pick<{}, K>, callback?: () => void): void; forceUpdate(callback?: () => void): void; readonly props: Readonly<UpMenuProps & import("../../../Common/theming/withTheme").WithThemeProps> & Readonly<{ children?: React.ReactNode; }>; state: Readonly<{}>; refs: { [key: string]: React.ReactInstance; }; componentDidMount?(): void; shouldComponentUpdate?(nextProps: Readonly<UpMenuProps & import("../../../Common/theming/withTheme").WithThemeProps>, nextState: Readonly<{}>, nextContext: any): boolean; componentWillUnmount?(): void; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly<UpMenuProps & import("../../../Common/theming/withTheme").WithThemeProps>, prevState: Readonly<{}>): any; componentDidUpdate?(prevProps: Readonly<UpMenuProps & import("../../../Common/theming/withTheme").WithThemeProps>, prevState: Readonly<{}>, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly<UpMenuProps & import("../../../Common/theming/withTheme").WithThemeProps>, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly<UpMenuProps & import("../../../Common/theming/withTheme").WithThemeProps>, nextContext: any): void; componentWillUpdate?(nextProps: Readonly<UpMenuProps & import("../../../Common/theming/withTheme").WithThemeProps>, nextState: Readonly<{}>, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly<UpMenuProps & import("../../../Common/theming/withTheme").WithThemeProps>, nextState: Readonly<{}>, nextContext: any): void; }; displayName: string; contextTypes: { theme: import("prop-types").Requireable<object>; }; contextType?: React.Context<any>; }; export default _default;