UNPKG

jamis

Version:

一种支持通过JSON配置方式生成页面的组件库

55 lines (54 loc) 2.04 kB
import React from 'react'; import type { ActionObject, IScopedContext, RendererProps } from 'jamis-core'; import { ScopedContext } from 'jamis-core'; import type { ActionProps } from '../types'; interface ActionState { inCountDown: boolean; countDownEnd: number; timeLeft: number; } export default class Action extends React.Component<ActionProps, ActionState> { static defaultProps: Partial<ActionProps>; state: ActionState; localStorageKey: string; dom: any; constructor(props: ActionProps); handleAction(e: React.MouseEvent<any>): Promise<void>; dispatchEventForward: (event: string, more?: Record<string, any>) => void; handleCountDown: () => void; componentDidMount(): void; componentWillUnmount(): void; render(): JSX.Element; } export type ActionRendererProps = RendererProps & Omit<ActionProps, 'onAction' | 'isCurrentUrl' | 'tooltipContainer'> & { onAction: (e: React.MouseEvent<any> | string | void | null, action: object, data: any) => void; btnDisabled?: boolean; }; export declare class ActionRenderer extends React.Component<ActionRendererProps> { static contextType: React.Context<IScopedContext<import("jamis-core").ScopedComponentType>>; context: React.ContextType<typeof ScopedContext>; constructor(props: ActionRendererProps, scoped: IScopedContext); componentWillUnmount(): void; /** * 动作处理 */ doAction(action: ActionObject, args: { value?: string | { [key: string]: string; }; }): void; handleAction(e: React.MouseEvent<any> | null, action: any): Promise<void>; handleMouseEnter(e: React.MouseEvent<any>): void; handleMouseLeave(e: React.MouseEvent<any>): void; isCurrentAction(link: string): boolean | { params?: object; }; render(): JSX.Element; } export declare class ButtonRenderer extends ActionRenderer { } export declare class SubmitRenderer extends ActionRenderer { } export declare class ResetRenderer extends ActionRenderer { } export {};