jamis
Version:
一种支持通过JSON配置方式生成页面的组件库
164 lines (163 loc) • 7.65 kB
TypeScript
import React from 'react';
import type { ListenerAction } from 'jamis-core';
import type { DiffControlSchema, FormControlProps } from '../types';
export type DiffEditorRendererEvent = 'blur' | 'focus';
export interface DiffEditorProps extends FormControlProps, Omit<DiffControlSchema, 'type' | 'className' | 'descriptionClassName' | 'inputClassName'> {
}
export declare class DiffEditor extends React.Component<DiffEditorProps, any> {
static defaultProps: Partial<DiffEditorProps>;
state: {
focused: boolean;
};
editor: any;
monaco: any;
originalEditor: any;
modifiedEditor: any;
toDispose: Array<Function>;
divRef: React.RefObject<HTMLDivElement>;
constructor(props: DiffEditorProps);
componentWillUnmount(): void;
doAction(action: ListenerAction, args: any): void;
focus(): void;
handleFocus(): void;
handleBlur(): void;
componentDidUpdate(prevProps: any): void;
editorFactory(containerElement: any, monaco: any, options: any): any;
handleEditorMounted(editor: any, monaco: any): void;
handleModifiedEditorChange(): void;
prevHeight: number;
updateContainerSize(editor: any, monaco: any): void;
render(): JSX.Element;
}
export declare class DiffEditorControlRenderer extends DiffEditor {
static defaultProps: {
[x: string]: any;
render?: import("jamis-core").SchemaRenderFn | undefined;
env?: import("jamis-core").RendererEnv | undefined;
$path?: string | undefined;
scopeRef?: (scoped: import("jamis-core").IScopedContext) => void;
$schema?: (import("jamis-core").BaseSchemaWithoutType & {
[key: string]: any;
type: string;
}) | undefined;
store?: import("jamis-core").IIRendererStore;
syncSuperStore?: boolean;
data?: import("jamis-core").RendererPropsData | undefined;
defaultData?: Record<string, any>;
className?: import("jamis-core").SchemaClassName;
rootStore?: import("jamis-core").IRendererStoreCopy | undefined;
topStore?: import("jamis-core").IRootStoreCopy | undefined;
appStore?: import("jamis-core").IAppStoreCopy;
dispatchEvent?: import("jamis-core").DispatchEventFn<import("jamis-core").RendererPropsData, string | React.SyntheticEvent<HTMLElement, Event>> | undefined;
onAction?: import("jamis-core").OnActionFn;
$$editor?: any;
style?: React.CSSProperties;
onEvent?: import("jamis-core").EventListeners;
onOpenDialog?: ((schema: import("jamis-core").Schema, data: any) => Promise<any>) | undefined;
name?: string;
formStore?: import("../types").IFormStore;
formItem?: import("../types").IFormItemStore;
formInited?: boolean | undefined;
formMode?: "normal" | "horizontal" | "inline" | "default" | "row" | undefined;
formHorizontal?: import("../types").FormHorizontal | undefined;
horizontal?: import("../types").FormHorizontal;
formLabelAlign?: import("../types").LabelAlign | undefined;
formLabelWidth?: number | string;
defaultSize?: import("../types").SizeUnit;
size?: import("../types").SizeUnit;
labelAlign?: import("../types").LabelAlign;
labelWidth?: number | string;
labelClassName?: string;
disabled?: boolean;
btnDisabled?: boolean | undefined;
defaultValue?: any;
value?: any;
prinstine?: any;
formItemValue?: any;
inputClassName?: string;
inputStyle?: React.CSSProperties;
inputOnly?: boolean;
renderLabel?: boolean;
renderDescription?: boolean;
sizeMutable?: boolean;
wrap?: boolean;
hint?: string;
description?: string;
descriptionClassName?: string;
errors?: {
[propName: string]: string;
};
error?: string;
showErrorMsg?: boolean;
requiredClassName?: import("jamis-core").SchemaClassName;
valueClassName?: import("jamis-core").SchemaClassName;
setPrinstineValue?: ((value: any) => void) | undefined;
onChange?: ((value: any, submitOnChange?: boolean, changeImmediately?: boolean) => void) | undefined;
onBulkChange?: (values: {
[propName: string]: any;
}, submitOnChange?: boolean) => void;
addHook?: ((fn: Function, mode: "validate" | "init" | "flush") => () => void) | undefined;
removeHook?: ((fn: Function, mode?: "validate" | "init" | "flush") => void) | undefined;
renderFormItems?: ((schema: Partial<import("../types").FormSchemaBase>, region: string, props: any) => JSX.Element) | undefined;
onFocus?: ((e: any) => void) | undefined;
onBlur?: ((e: any) => void) | undefined;
getValue?: (() => any) | undefined;
setValue?: ((value: any, key: string) => void) | undefined;
renderControl?: (props: FormControlProps) => JSX.Element;
sizeExpr?: import("jamis-core").SchemaExpression;
placeholder?: string;
placeholderExpr?: import("jamis-core").SchemaExpression;
id?: string;
key?: any;
$ref?: string;
definitions?: Record<string, any>;
disabledOn?: import("jamis-core").SchemaBoolean;
hidden?: boolean;
hiddenOn?: import("jamis-core").SchemaBoolean;
visible?: boolean;
visibleOn?: import("jamis-core").SchemaBoolean;
editorSetting?: {
behavior?: string;
displayName?: string;
mock?: any;
[propName: string]: any;
};
remark?: import("../types").SchemaRemark;
labelRemark?: import("../types").SchemaRemark;
clearable?: boolean;
label?: string | false | import("jamis-core").Schema;
submitOnChange?: boolean;
readOnly?: boolean;
readOnlyOn?: string;
validateOnChange?: boolean;
validatable?: boolean;
validatableOn?: import("jamis-core").SchemaExpression;
desc?: string;
mode?: "normal" | "inline" | "horizontal";
modeExpr?: import("jamis-core").SchemaExpression;
inline?: boolean;
controlBodyClassName?: import("jamis-core").SchemaClassName;
required?: boolean;
requiredOn?: import("jamis-core").SchemaExpression;
changeImmediately?: boolean;
validationErrors?: { [k in keyof import("../types").FormValidation]: string; };
validations?: string | import("../types").FormValidation;
clearValueOnHidden?: boolean;
validateApi?: import("jamis-core").Api;
columnRatio?: import("jamis-core").GridSizeUnit;
columnRatioExpr?: import("jamis-core").GridSizeUnit | import("jamis-core").SchemaExpression | Record<import("jamis-core").GridSizeUnitStr, boolean | import("jamis-core").SchemaBoolean>;
static?: boolean;
staticOn?: import("jamis-core").SchemaExpression;
staticPlaceholder?: string;
staticClassName?: import("jamis-core").SchemaClassName;
staticLabelClassName?: import("jamis-core").SchemaClassName;
staticInputClassName?: import("jamis-core").SchemaClassName;
staticSchema?: any;
validate?: (values: any, value: any) => string | boolean;
pipeIn?: ((value: any, data: Record<string, any>) => any) | import("jamis-core").SchemaExpression;
pipeOut?: ((value: any, originValue: any, data: Record<string, any>) => any) | import("jamis-core").SchemaExpression;
options?: any;
diffValue?: import("../types").SchemaTokenizeableString;
language?: string;
};
}