ehr-form-engine 1.0.0-beta.2 → 1.0.0-beta.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -2
- package/dist/index-D3g2Umnj.cjs +1 -0
- package/dist/index-DRjOL7bC.js +5 -0
- package/dist/index.cjs.js +4 -30
- package/dist/index.es.js +31377 -33471
- package/dist/src/components/ConfigProvider/index.d.ts +4 -0
- package/dist/src/components/ConfigProvider/index.vue.d.ts +24 -0
- package/dist/src/components/Core/index.vue.d.ts +32 -3
- package/dist/src/components/Dependency/Operator/index.vue.d.ts +2 -2
- package/dist/src/components/Dependency/types/emits.d.ts +1 -1
- package/dist/src/components/Render/Core/index.d.ts +3 -0
- package/dist/src/components/Render/Core/index.vue.d.ts +50 -0
- package/dist/src/components/Render/Form/index.vue.d.ts +24 -3
- package/dist/src/components/Render/MobileTable/index.d.ts +3 -0
- package/dist/src/components/Render/MobileTable/index.vue.d.ts +28 -0
- package/dist/src/components/Render/Table/index.vue.d.ts +4 -1
- package/dist/src/components/Render/Upload/index.vue.d.ts +34 -1
- package/dist/src/components/Render/Uploads/index.vue.d.ts +2 -0
- package/dist/src/components/Render/index.d.ts +2 -0
- package/dist/src/components/Render/types/props.d.ts +7 -5
- package/dist/src/components/Render/types/types.d.ts +35 -0
- package/dist/src/components/index.d.ts +7 -3
- package/dist/src/composables/useConfig.d.ts +37 -0
- package/dist/src/data/common/dataMap.d.ts +1 -0
- package/dist/src/data/components/componentMap.d.ts +6 -0
- package/dist/src/styles/css.d.ts +4 -0
- package/dist/src/types/config.d.ts +129 -0
- package/dist/src/types/types.d.ts +6 -2
- package/dist/src/utils/device.d.ts +12 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/style.css +1 -1
- package/package.json +33 -21
- package/dist/src/components/utils/sleep.d.ts +0 -1
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { HrFormEngineConfig } from '../../types/config';
|
|
2
|
+
|
|
3
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
config?: HrFormEngineConfig | undefined;
|
|
5
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
6
|
+
config?: HrFormEngineConfig | undefined;
|
|
7
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, {
|
|
8
|
+
default?(_: {}): any;
|
|
9
|
+
}>;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
12
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
13
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
14
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
15
|
+
} : {
|
|
16
|
+
type: import('vue').PropType<T[K]>;
|
|
17
|
+
required: true;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
21
|
+
new (): {
|
|
22
|
+
$slots: S;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -1,11 +1,40 @@
|
|
|
1
1
|
import { JsonSchemaType } from '../../types';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface ResumeDesignerProps {
|
|
4
|
+
/** 表单 JSON Schema 数据 */
|
|
5
|
+
jsonSchema?: JsonSchemaType[];
|
|
6
|
+
}
|
|
7
|
+
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ResumeDesignerProps>, {
|
|
8
|
+
jsonSchema: () => never[];
|
|
9
|
+
}>>, {
|
|
4
10
|
exportJsonSchema: () => JsonSchemaType[];
|
|
5
|
-
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<
|
|
6
|
-
|
|
11
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ResumeDesignerProps>, {
|
|
12
|
+
jsonSchema: () => never[];
|
|
13
|
+
}>>> & Readonly<{}>, {
|
|
14
|
+
jsonSchema: JsonSchemaType[];
|
|
15
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>, Readonly<{
|
|
16
|
+
'toolbar-custom-actions': Record<string, never>;
|
|
17
|
+
}> & {
|
|
18
|
+
'toolbar-custom-actions': Record<string, never>;
|
|
7
19
|
}>;
|
|
8
20
|
export default _default;
|
|
21
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
23
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
24
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
25
|
+
} : {
|
|
26
|
+
type: import('vue').PropType<T[K]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type __VLS_WithDefaults<P, D> = {
|
|
31
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
32
|
+
default: D[K];
|
|
33
|
+
}> : P[K];
|
|
34
|
+
};
|
|
35
|
+
type __VLS_Prettify<T> = {
|
|
36
|
+
[K in keyof T]: T[K];
|
|
37
|
+
} & {};
|
|
9
38
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
10
39
|
new (): {
|
|
11
40
|
$slots: S;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DependencyOperatorProps } from '../types';
|
|
2
2
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<DependencyOperatorProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
|
-
|
|
4
|
+
eventOnOperateChange: (value: "AND" | "OR") => void;
|
|
5
5
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<DependencyOperatorProps>>> & Readonly<{
|
|
6
|
-
|
|
6
|
+
onEventOnOperateChange?: ((value: "AND" | "OR") => any) | undefined;
|
|
7
7
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
8
8
|
export default _default;
|
|
9
9
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { FormRenderInstance, TableRenderInstance, UploadsRenderInstance, RenderEngineProps } from '../types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<RenderEngineProps>, {}>>, {
|
|
4
|
+
validateAll: (containerId?: string | undefined) => Promise<{
|
|
5
|
+
success: boolean;
|
|
6
|
+
errors: Record<string, unknown>;
|
|
7
|
+
segmentId: string;
|
|
8
|
+
segmentType: string;
|
|
9
|
+
}>;
|
|
10
|
+
getComponentData: (containerId?: string | undefined) => {
|
|
11
|
+
form: Record<string, Record<string, any> | undefined>;
|
|
12
|
+
table: Record<string, any[] | undefined>;
|
|
13
|
+
upload: Record<string, any[] | undefined>;
|
|
14
|
+
} | {
|
|
15
|
+
form: Record<string, any> | undefined;
|
|
16
|
+
table: any[] | undefined;
|
|
17
|
+
upload: any[] | undefined;
|
|
18
|
+
};
|
|
19
|
+
componentRefs: import('vue').Ref<{
|
|
20
|
+
form: Record<string, FormRenderInstance | undefined>;
|
|
21
|
+
table: Record<string, TableRenderInstance | undefined>;
|
|
22
|
+
upload: Record<string, UploadsRenderInstance | undefined>;
|
|
23
|
+
}, {
|
|
24
|
+
form: Record<string, FormRenderInstance | undefined>;
|
|
25
|
+
table: Record<string, TableRenderInstance | undefined>;
|
|
26
|
+
upload: Record<string, UploadsRenderInstance | undefined>;
|
|
27
|
+
} | {
|
|
28
|
+
form: Record<string, FormRenderInstance | undefined>;
|
|
29
|
+
table: Record<string, TableRenderInstance | undefined>;
|
|
30
|
+
upload: Record<string, UploadsRenderInstance | undefined>;
|
|
31
|
+
}>;
|
|
32
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<RenderEngineProps>, {}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
35
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
36
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
37
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
38
|
+
} : {
|
|
39
|
+
type: import('vue').PropType<T[K]>;
|
|
40
|
+
required: true;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
type __VLS_WithDefaults<P, D> = {
|
|
44
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
45
|
+
default: D[K];
|
|
46
|
+
}> : P[K];
|
|
47
|
+
};
|
|
48
|
+
type __VLS_Prettify<T> = {
|
|
49
|
+
[K in keyof T]: T[K];
|
|
50
|
+
} & {};
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import { FormRenderProps } from '../types';
|
|
2
2
|
|
|
3
|
-
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<FormRenderProps
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FormRenderProps>, {
|
|
4
|
+
formLayout: string;
|
|
5
|
+
labelWidth: number;
|
|
6
|
+
colSpan: number;
|
|
7
|
+
}>>, {
|
|
4
8
|
validate: () => Promise<{
|
|
5
9
|
[key: string]: any;
|
|
6
10
|
}> | undefined;
|
|
7
11
|
resetFields: () => void | undefined;
|
|
12
|
+
getData: () => Record<string, any>;
|
|
8
13
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
14
|
submit: (data: Record<string, any>) => void;
|
|
10
15
|
onValueChange: (fieldId: string, value: any) => void;
|
|
11
16
|
reset: () => void;
|
|
12
|
-
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<FormRenderProps
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<FormRenderProps>, {
|
|
18
|
+
formLayout: string;
|
|
19
|
+
labelWidth: number;
|
|
20
|
+
colSpan: number;
|
|
21
|
+
}>>> & Readonly<{
|
|
13
22
|
onReset?: (() => any) | undefined;
|
|
14
23
|
onSubmit?: ((data: Record<string, any>) => any) | undefined;
|
|
15
24
|
onOnValueChange?: ((fieldId: string, value: any) => any) | undefined;
|
|
16
|
-
}>, {
|
|
25
|
+
}>, {
|
|
26
|
+
colSpan: number;
|
|
27
|
+
formLayout: "inline" | "vertical" | "horizontal";
|
|
28
|
+
labelWidth: number;
|
|
29
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
17
30
|
export default _default;
|
|
18
31
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
32
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -24,3 +37,11 @@ type __VLS_TypePropsToRuntimeProps<T> = {
|
|
|
24
37
|
required: true;
|
|
25
38
|
};
|
|
26
39
|
};
|
|
40
|
+
type __VLS_WithDefaults<P, D> = {
|
|
41
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
42
|
+
default: D[K];
|
|
43
|
+
}> : P[K];
|
|
44
|
+
};
|
|
45
|
+
type __VLS_Prettify<T> = {
|
|
46
|
+
[K in keyof T]: T[K];
|
|
47
|
+
} & {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ColumnSchemaType, DynamicRowVO, TableSchemaType } from '../../../types';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
editMode: boolean;
|
|
5
|
+
innerDrawerMode: false | undefined;
|
|
6
|
+
readonlyMode: boolean;
|
|
7
|
+
tableColumns: Array<ColumnSchemaType>;
|
|
8
|
+
tableSchema: null | TableSchemaType;
|
|
9
|
+
}>>, {
|
|
10
|
+
validate: () => Promise<void>;
|
|
11
|
+
getData: () => DynamicRowVO<ColumnSchemaType[]>[];
|
|
12
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
13
|
+
editMode: boolean;
|
|
14
|
+
innerDrawerMode: false | undefined;
|
|
15
|
+
readonlyMode: boolean;
|
|
16
|
+
tableColumns: Array<ColumnSchemaType>;
|
|
17
|
+
tableSchema: null | TableSchemaType;
|
|
18
|
+
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
19
|
+
export default _default;
|
|
20
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
21
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
22
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
23
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
24
|
+
} : {
|
|
25
|
+
type: import('vue').PropType<T[K]>;
|
|
26
|
+
required: true;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { TableRenderProps } from '../types';
|
|
2
2
|
|
|
3
|
-
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<TableRenderProps>>, {
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<TableRenderProps>>, {
|
|
4
|
+
validate: () => Promise<void>;
|
|
5
|
+
getData: () => any;
|
|
6
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<TableRenderProps>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
4
7
|
export default _default;
|
|
5
8
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
6
9
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -2,8 +2,41 @@ import { UploadSchemaType } from '../../../types';
|
|
|
2
2
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
uploadSchema: UploadSchemaType;
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* 上传 API 地址
|
|
7
|
+
* 优先级最高,覆盖全局配置
|
|
8
|
+
*/
|
|
9
|
+
uploadApiUrl?: string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* 上传成功后图片宽度
|
|
12
|
+
* 优先级最高,覆盖 schema.pixel.width 和全局配置
|
|
13
|
+
*/
|
|
14
|
+
imageWidth?: number | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* 上传成功后图片高度
|
|
17
|
+
* 优先级最高,覆盖 schema.pixel.height 和全局配置
|
|
18
|
+
*/
|
|
19
|
+
imageHeight?: number | undefined;
|
|
20
|
+
}>>, {
|
|
21
|
+
validate: () => Promise<void>;
|
|
22
|
+
getData: () => (string | undefined)[];
|
|
23
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
6
24
|
uploadSchema: UploadSchemaType;
|
|
25
|
+
/**
|
|
26
|
+
* 上传 API 地址
|
|
27
|
+
* 优先级最高,覆盖全局配置
|
|
28
|
+
*/
|
|
29
|
+
uploadApiUrl?: string | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* 上传成功后图片宽度
|
|
32
|
+
* 优先级最高,覆盖 schema.pixel.width 和全局配置
|
|
33
|
+
*/
|
|
34
|
+
imageWidth?: number | undefined;
|
|
35
|
+
/**
|
|
36
|
+
* 上传成功后图片高度
|
|
37
|
+
* 优先级最高,覆盖 schema.pixel.height 和全局配置
|
|
38
|
+
*/
|
|
39
|
+
imageHeight?: number | undefined;
|
|
7
40
|
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
8
41
|
export default _default;
|
|
9
42
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -2,8 +2,10 @@ import { UploadSchemaType } from '../../../types';
|
|
|
2
2
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
jsonSchema: Array<UploadSchemaType>;
|
|
5
|
+
uploadApiUrl?: string | undefined;
|
|
5
6
|
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
6
7
|
jsonSchema: Array<UploadSchemaType>;
|
|
8
|
+
uploadApiUrl?: string | undefined;
|
|
7
9
|
}>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
8
10
|
export default _default;
|
|
9
11
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -4,4 +4,6 @@ export { default as FormItemRender } from './FormItem';
|
|
|
4
4
|
export { default as FormRender } from './Form';
|
|
5
5
|
export { default as UploadRender } from './Upload';
|
|
6
6
|
export { default as UploadsRender } from './Uploads';
|
|
7
|
+
export { default as RenderEngine } from './Core';
|
|
8
|
+
export { default as MobileTableRender } from './MobileTable';
|
|
7
9
|
export * from './types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ColumnSchemaType, FieldSchemaType, TableSchemaType } from '../../../types';
|
|
1
|
+
import { ColumnSchemaType, FieldSchemaType, TableSchemaType, JsonSchemaType } from '../../../types';
|
|
2
2
|
|
|
3
3
|
export interface TableFormProps {
|
|
4
4
|
colSpan: number | string;
|
|
@@ -22,9 +22,11 @@ export interface FormItemRenderProps {
|
|
|
22
22
|
item: FieldSchemaType;
|
|
23
23
|
}
|
|
24
24
|
export interface FormRenderProps {
|
|
25
|
-
colSpan
|
|
25
|
+
colSpan?: number;
|
|
26
26
|
formLayout?: 'horizontal' | 'inline' | 'vertical';
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
jsonSchema: JsonSchemaType;
|
|
28
|
+
labelWidth?: number;
|
|
29
|
+
}
|
|
30
|
+
export interface RenderEngineProps {
|
|
31
|
+
jsonSchema: JsonSchemaType[];
|
|
30
32
|
}
|
|
@@ -10,3 +10,38 @@ export type TableFormInstance = {
|
|
|
10
10
|
validate: () => Promise<void>;
|
|
11
11
|
resetFields: () => void;
|
|
12
12
|
} | null;
|
|
13
|
+
export interface FormRenderInstance {
|
|
14
|
+
validate: () => Promise<void>;
|
|
15
|
+
resetFields: () => void;
|
|
16
|
+
getData: () => Record<string, any>;
|
|
17
|
+
}
|
|
18
|
+
export interface TableRenderInstance {
|
|
19
|
+
validate: () => Promise<void>;
|
|
20
|
+
getData: () => any[];
|
|
21
|
+
}
|
|
22
|
+
export interface UploadsRenderInstance {
|
|
23
|
+
validate: () => Promise<void>;
|
|
24
|
+
getData: () => any[];
|
|
25
|
+
}
|
|
26
|
+
export interface RenderEngineInstance {
|
|
27
|
+
validateAll: (containerId?: string) => Promise<{
|
|
28
|
+
errors: Record<string, Error | string | unknown>;
|
|
29
|
+
segmentId: string;
|
|
30
|
+
segmentType: 'form' | 'table' | 'upload';
|
|
31
|
+
success: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
getComponentData: (containerId?: string) => {
|
|
34
|
+
form: Record<string, any> | undefined;
|
|
35
|
+
table: any[] | undefined;
|
|
36
|
+
upload: any[] | undefined;
|
|
37
|
+
} | {
|
|
38
|
+
form: Record<string, Record<string, any> | undefined>;
|
|
39
|
+
table: Record<string, any[] | undefined>;
|
|
40
|
+
upload: Record<string, any[] | undefined>;
|
|
41
|
+
};
|
|
42
|
+
componentRefs: {
|
|
43
|
+
form: Record<string, FormRenderInstance | undefined>;
|
|
44
|
+
table: Record<string, TableRenderInstance | undefined>;
|
|
45
|
+
upload: Record<string, undefined | UploadsRenderInstance>;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
@@ -10,17 +10,17 @@ import { DragContainerItem, DragContainerList, DragContainerDesigner } from './D
|
|
|
10
10
|
import { CodeSandBoxDrawer, DesignerEngineDrawer, TemplateEngineDrawer } from './Drawer';
|
|
11
11
|
import { default as ResumeDesigner } from './Core';
|
|
12
12
|
import { InputProps, InputNumberProps, CascaderProps, DatePickerProps, InputPasswordProps, RadioGroupProps, RangePickerProps, RateProps, SelectProps, SwitchProps, TextareaProps, TimePickerProps, TimeRangePickerProps, UploadDraggerProps, UploadProps } from './ComponentProps';
|
|
13
|
-
import { TableFormRender, TableRender, FormRender, FormItemRender, UploadRender, UploadsRender } from './Render';
|
|
13
|
+
import { TableFormRender, TableRender, MobileTableRender, FormRender, FormItemRender, UploadRender, UploadsRender, RenderEngine } from './Render';
|
|
14
14
|
import { DesignerFormPanel, DesignerTablePanel, DesignerUploadPanel, DesignerFormTemplate, DesignerTableTemplate, DesignerUploadTemplate, DesignerToolbar, TemplateDesignerEngine } from './Designer';
|
|
15
15
|
import { DependencyItem, DependencyList, DependencyOperator } from './Dependency';
|
|
16
16
|
import { DependencyModal, TableSettingModal } from './Modal';
|
|
17
17
|
import { FieldPropertyPanel, UploadPropertyPanel, ContainerPropertyPanel, GlobalPropertyPanel, TablePropertyPanel, DesignerPanel } from './Panel';
|
|
18
18
|
import { ColumnContainer, ColumnDesigner, ColumnProperty } from './Column';
|
|
19
19
|
import { default as Toolbar } from './Toolbar';
|
|
20
|
-
import {
|
|
20
|
+
import { default as HrFormEngineConfigProvider } from './ConfigProvider';
|
|
21
21
|
|
|
22
22
|
export { AutoScrollbar, GridSkeleton, TableSkeleton, LeftRightSkeleton, MixinIcon, MyInput, // 公共组件
|
|
23
|
-
TagInput, ValueInput, TableFormRender, TableRender, FormRender, FormItemRender, UploadRender, UploadsRender, DeleteButton, DragDropButton, MoveDownButton, MoveBottomButton, CollapseButton, MoveTopButton, MoveUpButton, ToggleVisibleButton, FormDraggableContainer, UploadDraggableContainer, TableDraggableContainer, NestedDraggableContainer, InputProps, InputNumberProps, CascaderProps, DatePickerProps, InputPasswordProps, RadioGroupProps, RangePickerProps, RateProps, SelectProps, SwitchProps, TextareaProps, TimePickerProps, TimeRangePickerProps, UploadDraggerProps, UploadProps, DragContainerItem, DragContainerList, DragContainerDesigner, DependencyItem, DependencyList, DependencyOperator, DependencyModal, TableSettingModal, FieldPropertyPanel, UploadPropertyPanel, ContainerPropertyPanel, GlobalPropertyPanel, TablePropertyPanel, DesignerPanel, ColumnContainer, ColumnDesigner, ColumnProperty, CodeSandBoxDrawer, DesignerEngineDrawer, TemplateEngineDrawer, DesignerFormPanel, DesignerTablePanel, DesignerUploadPanel, DesignerFormTemplate, DesignerTableTemplate, DesignerUploadTemplate, DesignerToolbar, TemplateDesignerEngine, Toolbar, ResumeDesigner,
|
|
23
|
+
TagInput, ValueInput, TableFormRender, TableRender, MobileTableRender, FormRender, FormItemRender, UploadRender, UploadsRender, RenderEngine, DeleteButton, DragDropButton, MoveDownButton, MoveBottomButton, CollapseButton, MoveTopButton, MoveUpButton, ToggleVisibleButton, FormDraggableContainer, UploadDraggableContainer, TableDraggableContainer, NestedDraggableContainer, InputProps, InputNumberProps, CascaderProps, DatePickerProps, InputPasswordProps, RadioGroupProps, RangePickerProps, RateProps, SelectProps, SwitchProps, TextareaProps, TimePickerProps, TimeRangePickerProps, UploadDraggerProps, UploadProps, DragContainerItem, DragContainerList, DragContainerDesigner, DependencyItem, DependencyList, DependencyOperator, DependencyModal, TableSettingModal, FieldPropertyPanel, UploadPropertyPanel, ContainerPropertyPanel, GlobalPropertyPanel, TablePropertyPanel, DesignerPanel, ColumnContainer, ColumnDesigner, ColumnProperty, CodeSandBoxDrawer, DesignerEngineDrawer, TemplateEngineDrawer, DesignerFormPanel, DesignerTablePanel, DesignerUploadPanel, DesignerFormTemplate, DesignerTableTemplate, DesignerUploadTemplate, DesignerToolbar, TemplateDesignerEngine, Toolbar, ResumeDesigner, HrFormEngineConfigProvider, };
|
|
24
24
|
export * from './Button';
|
|
25
25
|
export * from './Icon';
|
|
26
26
|
export * from './Input';
|
|
@@ -37,6 +37,10 @@ export * from './Toolbar';
|
|
|
37
37
|
export * from './Core';
|
|
38
38
|
export * from '../data';
|
|
39
39
|
export * from '../types';
|
|
40
|
+
export * from '../utils';
|
|
41
|
+
export { useConfig, useUploadConfig, useTableConfig, useDesignerConfig, useValidationConfig, useUploadDimensions, } from '../composables/useConfig';
|
|
42
|
+
export type { HrFormEngineConfig, UploadGlobalConfig, TableGlobalConfig, DesignerGlobalConfig, ValidationGlobalConfig, } from '../types/config';
|
|
43
|
+
export { DEFAULT_CONFIG, HR_FORM_ENGINE_CONFIG_KEY } from '../types/config';
|
|
40
44
|
declare const _default: {
|
|
41
45
|
install(app: App): void;
|
|
42
46
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DesignerGlobalConfig, HrFormEngineConfig, TableGlobalConfig, UploadGlobalConfig, ValidationGlobalConfig } from '../types/config';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 获取全局配置
|
|
5
|
+
* @returns 合并后的全局配置对象
|
|
6
|
+
*/
|
|
7
|
+
export declare function useConfig(): HrFormEngineConfig;
|
|
8
|
+
/**
|
|
9
|
+
* 获取上传组件配置
|
|
10
|
+
* @returns 上传组件配置(已合并默认值)
|
|
11
|
+
*/
|
|
12
|
+
export declare function useUploadConfig(): UploadGlobalConfig;
|
|
13
|
+
/**
|
|
14
|
+
* 获取表格组件配置
|
|
15
|
+
* @returns 表格组件配置(已合并默认值)
|
|
16
|
+
*/
|
|
17
|
+
export declare function useTableConfig(): TableGlobalConfig;
|
|
18
|
+
/**
|
|
19
|
+
* 获取设计器配置
|
|
20
|
+
* @returns 设计器配置(已合并默认值)
|
|
21
|
+
*/
|
|
22
|
+
export declare function useDesignerConfig(): DesignerGlobalConfig;
|
|
23
|
+
/**
|
|
24
|
+
* 获取校验规则配置
|
|
25
|
+
* @returns 校验规则配置(已合并默认值)
|
|
26
|
+
*/
|
|
27
|
+
export declare function useValidationConfig(): ValidationGlobalConfig;
|
|
28
|
+
/**
|
|
29
|
+
* 获取上传尺寸配置
|
|
30
|
+
* 优先级:schema.pixel > 全局配置 typeWidthMap/typeHeightMap > 默认配置
|
|
31
|
+
* @param fieldType 上传字段类型
|
|
32
|
+
* @returns { width, height } 尺寸配置
|
|
33
|
+
*/
|
|
34
|
+
export declare function useUploadDimensions(fieldType: string): {
|
|
35
|
+
width: number;
|
|
36
|
+
height: number;
|
|
37
|
+
};
|
|
@@ -11,6 +11,7 @@ export declare const datePickerMap: {
|
|
|
11
11
|
export declare const datePickerOptions: Array<SelectOption>;
|
|
12
12
|
export declare const timePickerOptions: Array<SelectOption>;
|
|
13
13
|
export declare const selectModeOptions: Array<SelectOption>;
|
|
14
|
+
export declare const mobileInputModeOptions: Array<SelectOption>;
|
|
14
15
|
export declare const uploadListTypeOptions: Array<SelectOption>;
|
|
15
16
|
export declare const selectPlacementOptions: Array<SelectOption>;
|
|
16
17
|
export declare const layoutOptions: Array<SelectOption>;
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { Component } from 'vue';
|
|
2
2
|
|
|
3
3
|
declare const componentMap: Map<string, Component>;
|
|
4
|
+
export declare function getComponent(name: string): Component | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* 动态获取 MixinIcon 组件
|
|
7
|
+
* 使用动态导入避免循环依赖问题
|
|
8
|
+
*/
|
|
9
|
+
export declare function getMixinIcon(): Promise<Component>;
|
|
4
10
|
export { componentMap };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { InjectionKey } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 上传组件全局配置
|
|
5
|
+
*/
|
|
6
|
+
export interface UploadGlobalConfig {
|
|
7
|
+
/**
|
|
8
|
+
* 默认上传 API 地址
|
|
9
|
+
* 可被组件 props.uploadApiUrl 覆盖
|
|
10
|
+
* @default undefined(必须传入)
|
|
11
|
+
*/
|
|
12
|
+
defaultUploadApiUrl?: string;
|
|
13
|
+
/**
|
|
14
|
+
* 上传类型对应的宽度映射
|
|
15
|
+
* 可被组件 schema.pixel.width 覆盖
|
|
16
|
+
*/
|
|
17
|
+
typeWidthMap?: Record<string, number>;
|
|
18
|
+
/**
|
|
19
|
+
* 上传类型对应的高度映射
|
|
20
|
+
* 可被组件 schema.pixel.height 覆盖
|
|
21
|
+
*/
|
|
22
|
+
typeHeightMap?: Record<string, number>;
|
|
23
|
+
/**
|
|
24
|
+
* 默认单图上传接口路径后缀
|
|
25
|
+
* @default 'single'
|
|
26
|
+
*/
|
|
27
|
+
singleUploadPath?: string;
|
|
28
|
+
/**
|
|
29
|
+
* 默认多图上传接口路径后缀
|
|
30
|
+
* @default 'multiple'
|
|
31
|
+
*/
|
|
32
|
+
multipleUploadPath?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 表格组件全局配置
|
|
36
|
+
*/
|
|
37
|
+
export interface TableGlobalConfig {
|
|
38
|
+
/**
|
|
39
|
+
* 表格滚动加载的防抖延迟(毫秒)
|
|
40
|
+
* @default 800
|
|
41
|
+
*/
|
|
42
|
+
scrollDebounceMs?: number;
|
|
43
|
+
/**
|
|
44
|
+
* 默认分页大小选项
|
|
45
|
+
* @default [10, 20, 50, 100]
|
|
46
|
+
*/
|
|
47
|
+
pageSizeOptions?: number[];
|
|
48
|
+
/**
|
|
49
|
+
* 默认每页条数
|
|
50
|
+
* @default 20
|
|
51
|
+
*/
|
|
52
|
+
defaultPageSize?: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 设计器全局配置
|
|
56
|
+
*/
|
|
57
|
+
export interface DesignerGlobalConfig {
|
|
58
|
+
/**
|
|
59
|
+
* 是否启用组件拖拽动画
|
|
60
|
+
* @default true
|
|
61
|
+
*/
|
|
62
|
+
enableDragAnimation?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* 拖拽动画持续时间(毫秒)
|
|
65
|
+
* @default 300
|
|
66
|
+
*/
|
|
67
|
+
dragAnimationDurationMs?: number;
|
|
68
|
+
/**
|
|
69
|
+
* 属性面板宽度
|
|
70
|
+
* @default 300
|
|
71
|
+
*/
|
|
72
|
+
propertyPanelWidth?: number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* 校验规则全局配置
|
|
76
|
+
*/
|
|
77
|
+
export interface ValidationGlobalConfig {
|
|
78
|
+
/**
|
|
79
|
+
* 必填项错误消息模板
|
|
80
|
+
* @default '{field} 为必填项'
|
|
81
|
+
*/
|
|
82
|
+
requiredMessageTemplate?: string;
|
|
83
|
+
/**
|
|
84
|
+
* 最小上传数量错误消息模板
|
|
85
|
+
* @default '{field} 至少需要上传 {min} 个附件'
|
|
86
|
+
*/
|
|
87
|
+
minUploadCountMessageTemplate?: string;
|
|
88
|
+
/**
|
|
89
|
+
* 自定义校验规则扩展
|
|
90
|
+
*/
|
|
91
|
+
customRules?: Record<string, {
|
|
92
|
+
pattern: RegExp;
|
|
93
|
+
message: string;
|
|
94
|
+
}>;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* 组件库全局配置对象
|
|
98
|
+
*/
|
|
99
|
+
export interface HrFormEngineConfig {
|
|
100
|
+
/**
|
|
101
|
+
* 上传组件配置
|
|
102
|
+
*/
|
|
103
|
+
upload?: UploadGlobalConfig;
|
|
104
|
+
/**
|
|
105
|
+
* 表格组件配置
|
|
106
|
+
*/
|
|
107
|
+
table?: TableGlobalConfig;
|
|
108
|
+
/**
|
|
109
|
+
* 设计器配置
|
|
110
|
+
*/
|
|
111
|
+
designer?: DesignerGlobalConfig;
|
|
112
|
+
/**
|
|
113
|
+
* 校验规则配置
|
|
114
|
+
*/
|
|
115
|
+
validation?: ValidationGlobalConfig;
|
|
116
|
+
/**
|
|
117
|
+
* 是否开启调试模式
|
|
118
|
+
* @default false
|
|
119
|
+
*/
|
|
120
|
+
debug?: boolean;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* 配置注入 key
|
|
124
|
+
*/
|
|
125
|
+
export declare const HR_FORM_ENGINE_CONFIG_KEY: InjectionKey<HrFormEngineConfig>;
|
|
126
|
+
/**
|
|
127
|
+
* 默认配置
|
|
128
|
+
*/
|
|
129
|
+
export declare const DEFAULT_CONFIG: HrFormEngineConfig;
|
|
@@ -138,6 +138,7 @@ export declare namespace ComponentProps {
|
|
|
138
138
|
maxlength: number;
|
|
139
139
|
placeholder: string;
|
|
140
140
|
showCount: boolean;
|
|
141
|
+
inputmode?: string;
|
|
141
142
|
}>;
|
|
142
143
|
type InputNumberProps = StrictProps<{
|
|
143
144
|
addonAfter?: string;
|
|
@@ -147,6 +148,7 @@ export declare namespace ComponentProps {
|
|
|
147
148
|
precision: number;
|
|
148
149
|
prefix?: string;
|
|
149
150
|
step: number;
|
|
151
|
+
inputmode?: string;
|
|
150
152
|
}>;
|
|
151
153
|
type InputPasswordProps = StrictProps<InputProps & {
|
|
152
154
|
visibilityToggle: boolean;
|
|
@@ -157,6 +159,7 @@ export declare namespace ComponentProps {
|
|
|
157
159
|
maxlength: number;
|
|
158
160
|
placeholder: string;
|
|
159
161
|
showCount: boolean;
|
|
162
|
+
inputmode?: string;
|
|
160
163
|
}>;
|
|
161
164
|
type RadioGroupProps = StrictProps<{
|
|
162
165
|
optionType: 'button' | 'default';
|
|
@@ -245,7 +248,7 @@ interface ComponentMap {
|
|
|
245
248
|
};
|
|
246
249
|
InputNumber: {
|
|
247
250
|
DataType: 'number';
|
|
248
|
-
ModelValue: number | undefined;
|
|
251
|
+
ModelValue: null | number | undefined;
|
|
249
252
|
NeedOptions: false;
|
|
250
253
|
Props: ComponentProps.InputNumberProps;
|
|
251
254
|
};
|
|
@@ -276,7 +279,7 @@ interface ComponentMap {
|
|
|
276
279
|
};
|
|
277
280
|
Select: {
|
|
278
281
|
DataType: 'select';
|
|
279
|
-
ModelValue: number | string | undefined;
|
|
282
|
+
ModelValue: null | number | string | undefined;
|
|
280
283
|
NeedOptions: true;
|
|
281
284
|
Props: ComponentProps.SelectProps;
|
|
282
285
|
};
|
|
@@ -346,6 +349,7 @@ export type BaseSchemaType<CN extends ValidComponentName, Tag extends ItemTypeTa
|
|
|
346
349
|
isEndNode: boolean;
|
|
347
350
|
label: string;
|
|
348
351
|
labelProp?: CN extends 'none' ? LabelProp : never;
|
|
352
|
+
minCount: number;
|
|
349
353
|
modelValue: ComponentMap[CN]['ModelValue'];
|
|
350
354
|
name: string;
|
|
351
355
|
required: boolean;
|