ehr-form-engine 1.0.0-beta.20 → 1.0.0-beta.21
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/dist/index.cjs.js +4 -4
- package/dist/index.es.js +4922 -4759
- package/dist/src/components/Designer/index.vue.d.ts +4 -1
- package/dist/src/components/Panel/ContainerProperty/index.vue.d.ts +2 -3
- package/dist/src/components/Panel/Designer/index.vue.d.ts +37 -5
- package/dist/src/components/Panel/FieldProperty/index.vue.d.ts +2 -3
- package/dist/src/components/Panel/TableProperty/index.vue.d.ts +2 -3
- package/dist/src/components/Panel/UploadProperty/index.vue.d.ts +2 -3
- package/dist/src/components/Panel/types/designer.d.ts +9 -0
- package/dist/src/components/Panel/types/emits.d.ts +6 -5
- package/dist/src/components/Panel/types/index.d.ts +1 -0
- package/dist/src/components/Panel/types/props.d.ts +3 -3
- package/dist/src/components/index.d.ts +2 -0
- package/dist/src/composables/index.d.ts +2 -0
- package/dist/src/composables/useDesigner.d.ts +38 -0
- package/dist/src/data/components/componentMap.d.ts +0 -5
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index-D3g2Umnj.cjs +0 -1
- package/dist/index-DRjOL7bC.js +0 -5
|
@@ -3,7 +3,10 @@ import { TemplateDesignerProps } from './types';
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TemplateDesignerProps>, {
|
|
4
4
|
designerMode: boolean;
|
|
5
5
|
jsonSchema: () => never[];
|
|
6
|
-
}>>, {
|
|
6
|
+
}>>, {
|
|
7
|
+
exportJsonSchema: () => string;
|
|
8
|
+
getDesigner: () => import('../../composables').DesignerInstance;
|
|
9
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<TemplateDesignerProps>, {
|
|
7
10
|
designerMode: boolean;
|
|
8
11
|
jsonSchema: () => never[];
|
|
9
12
|
}>>> & Readonly<{}>, {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ContainerSchemaType } from '../../../types';
|
|
2
1
|
import { ContainerPanelProps } from '../types';
|
|
3
2
|
|
|
4
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ContainerPanelProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
-
update: (item:
|
|
4
|
+
update: (item: import('../../../types').JsonSchemaType) => void;
|
|
6
5
|
eventOnLayoutChange: (id: string, span: string | number) => void;
|
|
7
6
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<ContainerPanelProps>>> & Readonly<{
|
|
8
|
-
onUpdate?: ((item:
|
|
7
|
+
onUpdate?: ((item: import('../../../types').JsonSchemaType) => any) | undefined;
|
|
9
8
|
onEventOnLayoutChange?: ((id: string, span: string | number) => any) | undefined;
|
|
10
9
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
10
|
export default _default;
|
|
@@ -1,14 +1,38 @@
|
|
|
1
|
+
import { ContainerSchemaType, FieldSchemaType, ItemTypeTag, JsonSchemaType, TableSchemaType, UploadSchemaType } from '../../../types';
|
|
1
2
|
import { DesignerPanelProps } from '../types';
|
|
2
3
|
|
|
3
|
-
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<DesignerPanelProps
|
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DesignerPanelProps>, {
|
|
5
|
+
jsonSchema: () => never[];
|
|
6
|
+
selectedContainerSchema: null;
|
|
7
|
+
selectedFieldSchema: null;
|
|
8
|
+
selectedTableSchema: null;
|
|
9
|
+
selectedUploadSchema: null;
|
|
10
|
+
selectedType: undefined;
|
|
11
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
4
12
|
eventResetSelected: () => void;
|
|
5
13
|
eventOnLayoutChange: (id: string, span: string | number) => void;
|
|
6
|
-
update: (item:
|
|
7
|
-
|
|
8
|
-
|
|
14
|
+
update: (item: JsonSchemaType) => void;
|
|
15
|
+
"event-on-select": (id: string | undefined, type: ItemTypeTag) => void;
|
|
16
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<DesignerPanelProps>, {
|
|
17
|
+
jsonSchema: () => never[];
|
|
18
|
+
selectedContainerSchema: null;
|
|
19
|
+
selectedFieldSchema: null;
|
|
20
|
+
selectedTableSchema: null;
|
|
21
|
+
selectedUploadSchema: null;
|
|
22
|
+
selectedType: undefined;
|
|
23
|
+
}>>> & Readonly<{
|
|
24
|
+
onUpdate?: ((item: JsonSchemaType) => any) | undefined;
|
|
9
25
|
onEventOnLayoutChange?: ((id: string, span: string | number) => any) | undefined;
|
|
10
26
|
onEventResetSelected?: (() => any) | undefined;
|
|
11
|
-
|
|
27
|
+
"onEvent-on-select"?: ((id: string | undefined, type: ItemTypeTag) => any) | undefined;
|
|
28
|
+
}>, {
|
|
29
|
+
jsonSchema: ContainerSchemaType[];
|
|
30
|
+
selectedContainerSchema: ContainerSchemaType | null;
|
|
31
|
+
selectedFieldSchema: FieldSchemaType | null;
|
|
32
|
+
selectedTableSchema: TableSchemaType | null;
|
|
33
|
+
selectedType: ItemTypeTag | undefined;
|
|
34
|
+
selectedUploadSchema: UploadSchemaType | null;
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
12
36
|
export default _default;
|
|
13
37
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
14
38
|
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
@@ -19,3 +43,11 @@ type __VLS_TypePropsToRuntimeProps<T> = {
|
|
|
19
43
|
required: true;
|
|
20
44
|
};
|
|
21
45
|
};
|
|
46
|
+
type __VLS_WithDefaults<P, D> = {
|
|
47
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
48
|
+
default: D[K];
|
|
49
|
+
}> : P[K];
|
|
50
|
+
};
|
|
51
|
+
type __VLS_Prettify<T> = {
|
|
52
|
+
[K in keyof T]: T[K];
|
|
53
|
+
} & {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { FieldSchemaType } from '../../../types';
|
|
2
1
|
import { FieldPanelProps } from '../types';
|
|
3
2
|
|
|
4
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<FieldPanelProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
-
update: (item:
|
|
4
|
+
update: (item: import('../../../types').JsonSchemaType) => void;
|
|
6
5
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<FieldPanelProps>>> & Readonly<{
|
|
7
|
-
onUpdate?: ((item:
|
|
6
|
+
onUpdate?: ((item: import('../../../types').JsonSchemaType) => any) | undefined;
|
|
8
7
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
9
8
|
export default _default;
|
|
10
9
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { TableSchemaType } from '../../../types';
|
|
2
1
|
import { TablePanelProps } from '../types';
|
|
3
2
|
|
|
4
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<TablePanelProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
-
update: (item:
|
|
4
|
+
update: (item: import('../../../types').JsonSchemaType) => void;
|
|
6
5
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<TablePanelProps>>> & Readonly<{
|
|
7
|
-
onUpdate?: ((item:
|
|
6
|
+
onUpdate?: ((item: import('../../../types').JsonSchemaType) => any) | undefined;
|
|
8
7
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
9
8
|
export default _default;
|
|
10
9
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { UploadSchemaType } from '../../../types';
|
|
2
1
|
import { UploadPanelProps } from '../types';
|
|
3
2
|
|
|
4
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<UploadPanelProps>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
-
update: (item:
|
|
4
|
+
update: (item: import('../../../types').JsonSchemaType) => void;
|
|
6
5
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<UploadPanelProps>>> & Readonly<{
|
|
7
|
-
onUpdate?: ((item:
|
|
6
|
+
onUpdate?: ((item: import('../../../types').JsonSchemaType) => any) | undefined;
|
|
8
7
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
9
8
|
export default _default;
|
|
10
9
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { InjectionKey } from 'vue';
|
|
2
|
+
import { useDesigner } from '../../../composables';
|
|
3
|
+
|
|
4
|
+
export type DesignerInstance = ReturnType<typeof useDesigner>;
|
|
5
|
+
/**
|
|
6
|
+
* 设计器注入键
|
|
7
|
+
* 用于在 TemplateDesignerEngine 和子组件间传递设计器实例
|
|
8
|
+
*/
|
|
9
|
+
export declare const DESIGNER_INJECTION_KEY: InjectionKey<DesignerInstance>;
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ItemTypeTag, JsonSchemaType } from '../../../types';
|
|
2
2
|
|
|
3
3
|
export interface FieldPanelEmits {
|
|
4
|
-
(e: 'update', item:
|
|
4
|
+
(e: 'update', item: JsonSchemaType): void;
|
|
5
5
|
}
|
|
6
6
|
export interface UploadPanelEmits {
|
|
7
|
-
(e: 'update', item:
|
|
7
|
+
(e: 'update', item: JsonSchemaType): void;
|
|
8
8
|
}
|
|
9
9
|
export interface ContainerPanelEmits {
|
|
10
|
-
(e: 'update', item:
|
|
10
|
+
(e: 'update', item: JsonSchemaType): void;
|
|
11
11
|
(e: 'eventOnLayoutChange', id: string, span: number | string): void;
|
|
12
12
|
}
|
|
13
13
|
export interface TablePanelEmits {
|
|
14
|
-
(e: 'update', item:
|
|
14
|
+
(e: 'update', item: JsonSchemaType): void;
|
|
15
15
|
}
|
|
16
16
|
export interface DesignerPanelEmits {
|
|
17
17
|
(e: 'eventResetSelected'): void;
|
|
18
18
|
(e: 'eventOnLayoutChange', id: string, span: number | string): void;
|
|
19
19
|
(e: 'update', item: JsonSchemaType): void;
|
|
20
|
+
(e: 'event-on-select', id: string | undefined, type: ItemTypeTag): void;
|
|
20
21
|
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ContainerSchemaType, FieldSchemaType, ItemTypeTag, TableSchemaType, UploadSchemaType } from '../../../types';
|
|
2
2
|
|
|
3
3
|
export interface FieldPanelProps {
|
|
4
|
-
dragItems
|
|
4
|
+
dragItems?: Array<ContainerSchemaType>;
|
|
5
5
|
selectedSchema: FieldSchemaType;
|
|
6
6
|
}
|
|
7
7
|
export interface UploadPanelProps {
|
|
8
|
-
dragItems
|
|
8
|
+
dragItems?: Array<ContainerSchemaType>;
|
|
9
9
|
selectedSchema: UploadSchemaType;
|
|
10
10
|
}
|
|
11
11
|
export interface ContainerPanelProps {
|
|
12
12
|
element: ContainerSchemaType | null;
|
|
13
13
|
}
|
|
14
14
|
export interface TablePanelProps {
|
|
15
|
-
dragItems
|
|
15
|
+
dragItems?: Array<ContainerSchemaType>;
|
|
16
16
|
selectedSchema: TableSchemaType;
|
|
17
17
|
}
|
|
18
18
|
export interface DesignerPanelProps {
|
|
@@ -39,6 +39,8 @@ export * from '../data';
|
|
|
39
39
|
export * from '../types';
|
|
40
40
|
export * from '../utils';
|
|
41
41
|
export { useConfig, useUploadConfig, useTableConfig, useDesignerConfig, useValidationConfig, useUploadDimensions, } from '../composables/useConfig';
|
|
42
|
+
export { useDesigner } from '../composables';
|
|
43
|
+
export { DESIGNER_INJECTION_KEY } from './Panel/types';
|
|
42
44
|
export type { HrFormEngineConfig, UploadGlobalConfig, TableGlobalConfig, DesignerGlobalConfig, ValidationGlobalConfig, } from '../types/config';
|
|
43
45
|
export { DEFAULT_CONFIG, HR_FORM_ENGINE_CONFIG_KEY } from '../types/config';
|
|
44
46
|
declare const _default: {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ComputedRef, UnwrapNestedRefs } from 'vue';
|
|
2
|
+
import { ItemTypeTag, JsonSchemaType } from '../types';
|
|
3
|
+
|
|
4
|
+
export interface DesignerState {
|
|
5
|
+
jsonSchema: JsonSchemaType[];
|
|
6
|
+
selectedId: string | null;
|
|
7
|
+
history: DesignerHistoryRecord[];
|
|
8
|
+
historyIndex: number;
|
|
9
|
+
isDragging: boolean;
|
|
10
|
+
draggedItem: JsonSchemaType | null;
|
|
11
|
+
}
|
|
12
|
+
export interface DesignerHistoryRecord {
|
|
13
|
+
jsonSchema: JsonSchemaType[];
|
|
14
|
+
selectedId: string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface DesignerInstance {
|
|
17
|
+
state: UnwrapNestedRefs<DesignerState>;
|
|
18
|
+
selectedItem: ComputedRef<JsonSchemaType | null>;
|
|
19
|
+
selectedItemType: ComputedRef<ItemTypeTag | null>;
|
|
20
|
+
canUndo: ComputedRef<boolean>;
|
|
21
|
+
canRedo: ComputedRef<boolean>;
|
|
22
|
+
selectItem: (id: string | null) => void;
|
|
23
|
+
loadSchema: (schema: JsonSchemaType[]) => void;
|
|
24
|
+
addItem: (parentId: string | null, item: JsonSchemaType) => void;
|
|
25
|
+
deleteItem: (id: string) => void;
|
|
26
|
+
updateItem: (id: string, changes: Partial<JsonSchemaType>) => void;
|
|
27
|
+
moveItem: (id: string, direction: 'up' | 'down') => void;
|
|
28
|
+
undo: () => void;
|
|
29
|
+
redo: () => void;
|
|
30
|
+
reset: () => void;
|
|
31
|
+
findItemById: (schema: JsonSchemaType[], id: string) => JsonSchemaType | null;
|
|
32
|
+
findParentById: (schema: JsonSchemaType[], id: string) => JsonSchemaType | null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* 设计器状态管理
|
|
36
|
+
* 提供完整的设计器状态管理功能,包括选中、历史记录、增删改查等
|
|
37
|
+
*/
|
|
38
|
+
export declare function useDesigner(): DesignerInstance;
|
|
@@ -2,9 +2,4 @@ import { Component } from 'vue';
|
|
|
2
2
|
|
|
3
3
|
declare const componentMap: Map<string, Component>;
|
|
4
4
|
export declare function getComponent(name: string): Component | undefined;
|
|
5
|
-
/**
|
|
6
|
-
* 动态获取 MixinIcon 组件
|
|
7
|
-
* 使用动态导入避免循环依赖问题
|
|
8
|
-
*/
|
|
9
|
-
export declare function getMixinIcon(): Promise<Component>;
|
|
10
5
|
export { componentMap };
|