UNPKG

jamis

Version:

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

491 lines (490 loc) 23.5 kB
import React from 'react'; import type { ActionObject } from 'jamis-core'; import type { Moment } from 'moment'; import type { DateRangePickerProps, DateRangeProps, DateRangeValue } from '../types'; interface DateRangeControlState { minDate?: Moment; maxDate?: Moment; } export default class DateRangeControl extends React.PureComponent<DateRangeProps, DateRangeControlState> { static defaultProps: Partial<DateRangeProps>; dateRef?: any; constructor(props: DateRangeProps); componentDidUpdate(prevProps: DateRangeProps): void; getRef(ref: any): void; dispatchEvent(eventName: string): void; doAction(action: ActionObject, data: object, throwErrors: boolean): void; handleChange(nextValue: any): Promise<void>; calcInputFormat: () => string | undefined; formatRanges: (ranges: DateRangeProps["ranges"]) => DateRangePickerProps["ranges"]; updateRules: () => void; render(): JSX.Element; } export declare class DateRangeControlRenderer extends DateRangeControl { static defaultProps: { strictMode: boolean; timeFormat: string; delimiter?: string | undefined; format?: string | undefined; joinValues?: boolean | undefined; 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; pickClassStyle?: import("jamis-core").PickClassStyleFn; 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: import("../types").FormControlProps) => JSX.Element; type?: "input-date-range" | "input-datetime-range" | "input-time-range" | undefined; sizeExpr?: import("jamis-core").SchemaExpression; placeholder?: string; placeholderExpr?: import("jamis-core").SchemaExpression; id?: string; key?: any; classMap?: import("jamis-core").ClassMap; styleMap?: import("jamis-core").StyleMap; $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; embed?: boolean; borderMode?: "full" | "half" | "none"; inputFormat?: string; animation?: boolean; minDate?: string; maxDate?: string; pickerInputClassName?: import("jamis-core").SchemaClassName; maxDuration?: string; minDuration?: string; ranges?: Array<DateRangeValue | { label: string; value?: DateRangeValue; startDate?: import("./components/Calendar.types").DateExpression; endDate?: import("./components/Calendar.types").DateExpression; }> | string; rangesPosition?: "picker" | "input"; rangesRefDate?: import("jamis-core").SchemaExpression; rangesClassName?: import("jamis-core").SchemaClassName; startPlaceholder?: string; endPlaceholder?: string; }; } export declare class DateTimeRangeControlRenderer extends DateRangeControl { static defaultProps: { strictMode: boolean; timeFormat: string; inputFormat: string; delimiter?: string | undefined; format?: string | undefined; joinValues?: boolean | undefined; 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; pickClassStyle?: import("jamis-core").PickClassStyleFn; 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: import("../types").FormControlProps) => JSX.Element; type?: "input-date-range" | "input-datetime-range" | "input-time-range" | undefined; sizeExpr?: import("jamis-core").SchemaExpression; placeholder?: string; placeholderExpr?: import("jamis-core").SchemaExpression; id?: string; key?: any; classMap?: import("jamis-core").ClassMap; styleMap?: import("jamis-core").StyleMap; $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; embed?: boolean; borderMode?: "full" | "half" | "none"; animation?: boolean; minDate?: string; maxDate?: string; pickerInputClassName?: import("jamis-core").SchemaClassName; maxDuration?: string; minDuration?: string; ranges?: Array<DateRangeValue | { label: string; value?: DateRangeValue; startDate?: import("./components/Calendar.types").DateExpression; endDate?: import("./components/Calendar.types").DateExpression; }> | string; rangesPosition?: "picker" | "input"; rangesRefDate?: import("jamis-core").SchemaExpression; rangesClassName?: import("jamis-core").SchemaClassName; startPlaceholder?: string; endPlaceholder?: string; }; } export declare class TimeRangeControlRenderer extends DateRangeControl { static defaultProps: { strictMode: boolean; format: string; timeFormat: string; inputFormat: string; viewMode: string; ranges: string; delimiter?: string | undefined; joinValues?: boolean | undefined; 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; pickClassStyle?: import("jamis-core").PickClassStyleFn; 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: import("../types").FormControlProps) => JSX.Element; type?: "input-date-range" | "input-datetime-range" | "input-time-range" | undefined; sizeExpr?: import("jamis-core").SchemaExpression; placeholder?: string; placeholderExpr?: import("jamis-core").SchemaExpression; id?: string; key?: any; classMap?: import("jamis-core").ClassMap; styleMap?: import("jamis-core").StyleMap; $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; embed?: boolean; borderMode?: "full" | "half" | "none"; animation?: boolean; minDate?: string; maxDate?: string; pickerInputClassName?: import("jamis-core").SchemaClassName; maxDuration?: string; minDuration?: string; rangesPosition?: "picker" | "input"; rangesRefDate?: import("jamis-core").SchemaExpression; rangesClassName?: import("jamis-core").SchemaClassName; startPlaceholder?: string; endPlaceholder?: string; }; } export {};