@guodun/antdv 1.7.3 → 1.7.4
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/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +313 -308
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.mjs +796 -0
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +16 -5
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +3 -1
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +123 -710
- package/dist/es/components/pro-contract-template-designer/src/composables/use-renderer-files.mjs +80 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +172 -134
- package/dist/es/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.mjs +11 -9
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +136 -76
- package/dist/es/components/pro-contract-template-designer/src/utils/toolbar-overflow.mjs +10 -9
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-renderer-files.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
- package/dist/lib/components/pro-contract-template-designer/src/utils/toolbar-overflow.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.d.ts +89 -0
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +2 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +388 -10
- package/dist/types/components/pro-contract-template-designer/src/composables/use-renderer-files.d.ts +14 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +9 -2
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +16 -2
- package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +3 -3
- package/dist/types/components/pro-contract-template-designer/src/utils/toolbar-overflow.d.ts +2 -0
- package/package.json +4 -4
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { VNode } from 'vue';
|
|
2
|
+
import { ContractTemplateRenderValues, ContractTemplateRendererFieldSlotProps, ContractTemplateRendererProps, ContractTemplateValidationError, ContractTemplateControlWarning } from './types';
|
|
3
|
+
declare function __VLS_template(): {
|
|
4
|
+
attrs: Partial<{}>;
|
|
5
|
+
slots: Readonly<{
|
|
6
|
+
field?: (props: ContractTemplateRendererFieldSlotProps) => VNode[] | undefined;
|
|
7
|
+
headerExtra?: () => VNode[] | undefined;
|
|
8
|
+
fileBar?: () => VNode[] | undefined;
|
|
9
|
+
}> & {
|
|
10
|
+
field?: (props: ContractTemplateRendererFieldSlotProps) => VNode[] | undefined;
|
|
11
|
+
headerExtra?: () => VNode[] | undefined;
|
|
12
|
+
fileBar?: () => VNode[] | undefined;
|
|
13
|
+
};
|
|
14
|
+
refs: {
|
|
15
|
+
rendererElement: HTMLElement;
|
|
16
|
+
pagesViewportElement: HTMLDivElement;
|
|
17
|
+
fieldListElement: HTMLDivElement;
|
|
18
|
+
};
|
|
19
|
+
rootEl: HTMLElement;
|
|
20
|
+
};
|
|
21
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
22
|
+
declare const __VLS_component: import('vue').DefineComponent<ContractTemplateRendererProps, {
|
|
23
|
+
validate: () => ContractTemplateValidationError[];
|
|
24
|
+
submit: () => false | ContractTemplateRenderValues;
|
|
25
|
+
fitWidth: () => number;
|
|
26
|
+
scrollToPage: (pageId: string) => void;
|
|
27
|
+
setZoom: (value: number) => number;
|
|
28
|
+
getZoom: () => number;
|
|
29
|
+
resetZoom: () => number;
|
|
30
|
+
scrollToVariable: (variableKey: string) => void;
|
|
31
|
+
getValues: () => ContractTemplateRenderValues;
|
|
32
|
+
setValues: (values: ContractTemplateRenderValues) => void;
|
|
33
|
+
resetValues: () => ContractTemplateRenderValues;
|
|
34
|
+
showValidation: (errors: ContractTemplateValidationError[]) => void;
|
|
35
|
+
focusError: (error: ContractTemplateValidationError) => void;
|
|
36
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
37
|
+
validate: (errors: ContractTemplateValidationError[]) => any;
|
|
38
|
+
change: (value: ContractTemplateRenderValues) => any;
|
|
39
|
+
submit: (value: ContractTemplateRenderValues) => any;
|
|
40
|
+
"update:zoom": (value: number) => any;
|
|
41
|
+
"update:activeFileId": (value: string) => any;
|
|
42
|
+
"update:valuesByFile": (value: import('./types').ContractTemplateRenderValuesByFile) => any;
|
|
43
|
+
"update:values": (value: ContractTemplateRenderValues) => any;
|
|
44
|
+
"control-warning": (warning: ContractTemplateControlWarning) => any;
|
|
45
|
+
}, string, import('vue').PublicProps, Readonly<ContractTemplateRendererProps> & Readonly<{
|
|
46
|
+
onValidate?: ((errors: ContractTemplateValidationError[]) => any) | undefined;
|
|
47
|
+
onChange?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
48
|
+
onSubmit?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
49
|
+
"onUpdate:zoom"?: ((value: number) => any) | undefined;
|
|
50
|
+
"onUpdate:activeFileId"?: ((value: string) => any) | undefined;
|
|
51
|
+
"onUpdate:valuesByFile"?: ((value: import('./types').ContractTemplateRenderValuesByFile) => any) | undefined;
|
|
52
|
+
"onUpdate:values"?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
53
|
+
"onControl-warning"?: ((warning: ContractTemplateControlWarning) => any) | undefined;
|
|
54
|
+
}>, {
|
|
55
|
+
values: ContractTemplateRenderValues;
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
title: string;
|
|
58
|
+
template: import('./types').ContractTemplateData;
|
|
59
|
+
readonly: boolean;
|
|
60
|
+
zoom: number;
|
|
61
|
+
showToolbar: boolean;
|
|
62
|
+
showSubmitButton: boolean;
|
|
63
|
+
contractFontBaseUrl: string;
|
|
64
|
+
selectorHttp: undefined;
|
|
65
|
+
selectorUrlPrefix: string;
|
|
66
|
+
showValidateButton: boolean;
|
|
67
|
+
showResetButton: boolean;
|
|
68
|
+
interactionMode: import('./types').ContractTemplateRendererMode;
|
|
69
|
+
validateOnSubmit: boolean;
|
|
70
|
+
showPageMeta: boolean;
|
|
71
|
+
collapsiblePanel: boolean;
|
|
72
|
+
controlRegistry: import('./types').ContractTemplateControlRegistry;
|
|
73
|
+
optionResolver: import('./types').ContractTemplateOptionResolver;
|
|
74
|
+
requester: import('./types').ContractTemplateControlRequester;
|
|
75
|
+
allowedRemoteOrigins: string[];
|
|
76
|
+
remoteRequestTimeoutMs: number;
|
|
77
|
+
remoteOptionsCacheTtlMs: number;
|
|
78
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
79
|
+
rendererElement: HTMLElement;
|
|
80
|
+
pagesViewportElement: HTMLDivElement;
|
|
81
|
+
fieldListElement: HTMLDivElement;
|
|
82
|
+
}, HTMLElement>;
|
|
83
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
84
|
+
export default _default;
|
|
85
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
86
|
+
new (): {
|
|
87
|
+
$slots: S;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
@@ -151,6 +151,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
|
151
151
|
"variable-select": (variableKey: string) => any;
|
|
152
152
|
"variable-move-blocked": (pageId: string) => any;
|
|
153
153
|
"editor-focus": (pageId: string) => any;
|
|
154
|
+
"editor-ready": (pageId: string) => any;
|
|
154
155
|
"editor-state-change": (pageId: string, state: ContractTemplateEditorState) => any;
|
|
155
156
|
"editor-context-menu": (payload: ContractTemplateEditorContextMenuPayload) => any;
|
|
156
157
|
"word-paste": (payload: {
|
|
@@ -162,6 +163,7 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
|
162
163
|
"onVariable-select"?: ((variableKey: string) => any) | undefined;
|
|
163
164
|
"onVariable-move-blocked"?: ((pageId: string) => any) | undefined;
|
|
164
165
|
"onEditor-focus"?: ((pageId: string) => any) | undefined;
|
|
166
|
+
"onEditor-ready"?: ((pageId: string) => any) | undefined;
|
|
165
167
|
"onEditor-state-change"?: ((pageId: string, state: ContractTemplateEditorState) => any) | undefined;
|
|
166
168
|
"onEditor-context-menu"?: ((payload: ContractTemplateEditorContextMenuPayload) => any) | undefined;
|
|
167
169
|
"onWord-paste"?: ((payload: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { VNode } from 'vue';
|
|
2
|
-
import {
|
|
1
|
+
import { nextTick, VNode } from 'vue';
|
|
2
|
+
import { ContractTemplateRendererFieldSlotProps, ContractTemplateRendererProps, ContractTemplateRenderValues, ContractTemplateValidationError } from './types';
|
|
3
3
|
declare function __VLS_template(): {
|
|
4
4
|
attrs: Partial<{}>;
|
|
5
5
|
slots: Readonly<{
|
|
@@ -10,14 +10,202 @@ declare function __VLS_template(): {
|
|
|
10
10
|
headerExtra?: () => VNode[] | undefined;
|
|
11
11
|
};
|
|
12
12
|
refs: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
renderer: ({
|
|
14
|
+
$: import('vue').ComponentInternalInstance;
|
|
15
|
+
$data: {};
|
|
16
|
+
$props: {
|
|
17
|
+
readonly files?: import('./types').ContractTemplateFile[] | undefined;
|
|
18
|
+
readonly activeFileId?: string | undefined;
|
|
19
|
+
readonly valuesByFile?: import('./types').ContractTemplateRenderValuesByFile | undefined;
|
|
20
|
+
readonly template?: import('./types').ContractTemplateData | undefined;
|
|
21
|
+
readonly values?: ContractTemplateRenderValues | undefined;
|
|
22
|
+
readonly interactionMode?: import('./types').ContractTemplateRendererMode | undefined;
|
|
23
|
+
readonly readonly?: boolean | undefined;
|
|
24
|
+
readonly disabled?: boolean | undefined;
|
|
25
|
+
readonly title?: string | undefined;
|
|
26
|
+
readonly showSubmitButton?: boolean | undefined;
|
|
27
|
+
readonly validateOnSubmit?: boolean | undefined;
|
|
28
|
+
readonly showValidateButton?: boolean | undefined;
|
|
29
|
+
readonly showResetButton?: boolean | undefined;
|
|
30
|
+
readonly showToolbar?: boolean | undefined;
|
|
31
|
+
readonly showPageMeta?: boolean | undefined;
|
|
32
|
+
readonly collapsiblePanel?: boolean | undefined;
|
|
33
|
+
readonly zoom?: number | undefined;
|
|
34
|
+
readonly controlRegistry?: import('./types').ContractTemplateControlRegistry | undefined;
|
|
35
|
+
readonly optionResolver?: import('./types').ContractTemplateOptionResolver | undefined;
|
|
36
|
+
readonly requester?: import('./types').ContractTemplateControlRequester | undefined;
|
|
37
|
+
readonly allowedRemoteOrigins?: string[] | undefined;
|
|
38
|
+
readonly remoteRequestTimeoutMs?: number | undefined;
|
|
39
|
+
readonly remoteOptionsCacheTtlMs?: number | undefined;
|
|
40
|
+
readonly selectorHttp?: unknown;
|
|
41
|
+
readonly selectorUrlPrefix?: string | undefined;
|
|
42
|
+
readonly contractFontBaseUrl?: string | undefined;
|
|
43
|
+
readonly onValidate?: ((errors: ContractTemplateValidationError[]) => any) | undefined;
|
|
44
|
+
readonly onChange?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
45
|
+
readonly onSubmit?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
46
|
+
readonly "onUpdate:zoom"?: ((value: number) => any) | undefined;
|
|
47
|
+
readonly "onUpdate:activeFileId"?: ((value: string) => any) | undefined;
|
|
48
|
+
readonly "onUpdate:valuesByFile"?: ((value: import('./types').ContractTemplateRenderValuesByFile) => any) | undefined;
|
|
49
|
+
readonly "onUpdate:values"?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
50
|
+
readonly "onControl-warning"?: ((warning: import('./types').ContractTemplateControlWarning) => any) | undefined;
|
|
51
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
52
|
+
$attrs: import('vue').Attrs;
|
|
53
|
+
$refs: {
|
|
54
|
+
[x: string]: unknown;
|
|
55
|
+
} & {
|
|
56
|
+
rendererElement: HTMLElement;
|
|
57
|
+
pagesViewportElement: HTMLDivElement;
|
|
58
|
+
fieldListElement: HTMLDivElement;
|
|
59
|
+
};
|
|
60
|
+
$slots: Readonly<{
|
|
61
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
64
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
65
|
+
$host: Element | null;
|
|
66
|
+
$emit: ((event: "validate", errors: ContractTemplateValidationError[]) => void) & ((event: "change", value: ContractTemplateRenderValues) => void) & ((event: "submit", value: ContractTemplateRenderValues) => void) & ((event: "update:zoom", value: number) => void) & ((event: "update:activeFileId", value: string) => void) & ((event: "update:valuesByFile", value: import('./types').ContractTemplateRenderValuesByFile) => void) & ((event: "update:values", value: ContractTemplateRenderValues) => void) & ((event: "control-warning", warning: import('./types').ContractTemplateControlWarning) => void);
|
|
67
|
+
$el: HTMLElement;
|
|
68
|
+
$options: import('vue').ComponentOptionsBase<Readonly<ContractTemplateRendererProps> & Readonly<{
|
|
69
|
+
onValidate?: ((errors: ContractTemplateValidationError[]) => any) | undefined;
|
|
70
|
+
onChange?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
71
|
+
onSubmit?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
72
|
+
"onUpdate:zoom"?: ((value: number) => any) | undefined;
|
|
73
|
+
"onUpdate:activeFileId"?: ((value: string) => any) | undefined;
|
|
74
|
+
"onUpdate:valuesByFile"?: ((value: import('./types').ContractTemplateRenderValuesByFile) => any) | undefined;
|
|
75
|
+
"onUpdate:values"?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
76
|
+
"onControl-warning"?: ((warning: import('./types').ContractTemplateControlWarning) => any) | undefined;
|
|
77
|
+
}>, {
|
|
78
|
+
validate: () => ContractTemplateValidationError[];
|
|
79
|
+
submit: () => false | ContractTemplateRenderValues;
|
|
80
|
+
fitWidth: () => number;
|
|
81
|
+
scrollToPage: (pageId: string) => void;
|
|
82
|
+
setZoom: (value: number) => number;
|
|
83
|
+
getZoom: () => number;
|
|
84
|
+
resetZoom: () => number;
|
|
85
|
+
scrollToVariable: (variableKey: string) => void;
|
|
86
|
+
getValues: () => ContractTemplateRenderValues;
|
|
87
|
+
setValues: (values: ContractTemplateRenderValues) => void;
|
|
88
|
+
resetValues: () => ContractTemplateRenderValues;
|
|
89
|
+
showValidation: (errors: ContractTemplateValidationError[]) => void;
|
|
90
|
+
focusError: (error: ContractTemplateValidationError) => void;
|
|
91
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
92
|
+
validate: (errors: ContractTemplateValidationError[]) => any;
|
|
93
|
+
change: (value: ContractTemplateRenderValues) => any;
|
|
94
|
+
submit: (value: ContractTemplateRenderValues) => any;
|
|
95
|
+
"update:zoom": (value: number) => any;
|
|
96
|
+
"update:activeFileId": (value: string) => any;
|
|
97
|
+
"update:valuesByFile": (value: import('./types').ContractTemplateRenderValuesByFile) => any;
|
|
98
|
+
"update:values": (value: ContractTemplateRenderValues) => any;
|
|
99
|
+
"control-warning": (warning: import('./types').ContractTemplateControlWarning) => any;
|
|
100
|
+
}, string, {
|
|
101
|
+
values: ContractTemplateRenderValues;
|
|
102
|
+
disabled: boolean;
|
|
103
|
+
title: string;
|
|
104
|
+
template: import('./types').ContractTemplateData;
|
|
105
|
+
readonly: boolean;
|
|
106
|
+
zoom: number;
|
|
107
|
+
showToolbar: boolean;
|
|
108
|
+
showSubmitButton: boolean;
|
|
109
|
+
contractFontBaseUrl: string;
|
|
110
|
+
selectorHttp: undefined;
|
|
111
|
+
selectorUrlPrefix: string;
|
|
112
|
+
showValidateButton: boolean;
|
|
113
|
+
showResetButton: boolean;
|
|
114
|
+
interactionMode: import('./types').ContractTemplateRendererMode;
|
|
115
|
+
validateOnSubmit: boolean;
|
|
116
|
+
showPageMeta: boolean;
|
|
117
|
+
collapsiblePanel: boolean;
|
|
118
|
+
controlRegistry: import('./types').ContractTemplateControlRegistry;
|
|
119
|
+
optionResolver: import('./types').ContractTemplateOptionResolver;
|
|
120
|
+
requester: import('./types').ContractTemplateControlRequester;
|
|
121
|
+
allowedRemoteOrigins: string[];
|
|
122
|
+
remoteRequestTimeoutMs: number;
|
|
123
|
+
remoteOptionsCacheTtlMs: number;
|
|
124
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
125
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
126
|
+
created?: (() => void) | (() => void)[];
|
|
127
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
128
|
+
mounted?: (() => void) | (() => void)[];
|
|
129
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
130
|
+
updated?: (() => void) | (() => void)[];
|
|
131
|
+
activated?: (() => void) | (() => void)[];
|
|
132
|
+
deactivated?: (() => void) | (() => void)[];
|
|
133
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
134
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
135
|
+
destroyed?: (() => void) | (() => void)[];
|
|
136
|
+
unmounted?: (() => void) | (() => void)[];
|
|
137
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
138
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
139
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
140
|
+
};
|
|
141
|
+
$forceUpdate: () => void;
|
|
142
|
+
$nextTick: typeof nextTick;
|
|
143
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
144
|
+
} & Readonly<{
|
|
145
|
+
values: ContractTemplateRenderValues;
|
|
146
|
+
disabled: boolean;
|
|
147
|
+
title: string;
|
|
148
|
+
template: import('./types').ContractTemplateData;
|
|
149
|
+
readonly: boolean;
|
|
150
|
+
zoom: number;
|
|
151
|
+
showToolbar: boolean;
|
|
152
|
+
showSubmitButton: boolean;
|
|
153
|
+
contractFontBaseUrl: string;
|
|
154
|
+
selectorHttp: undefined;
|
|
155
|
+
selectorUrlPrefix: string;
|
|
156
|
+
showValidateButton: boolean;
|
|
157
|
+
showResetButton: boolean;
|
|
158
|
+
interactionMode: import('./types').ContractTemplateRendererMode;
|
|
159
|
+
validateOnSubmit: boolean;
|
|
160
|
+
showPageMeta: boolean;
|
|
161
|
+
collapsiblePanel: boolean;
|
|
162
|
+
controlRegistry: import('./types').ContractTemplateControlRegistry;
|
|
163
|
+
optionResolver: import('./types').ContractTemplateOptionResolver;
|
|
164
|
+
requester: import('./types').ContractTemplateControlRequester;
|
|
165
|
+
allowedRemoteOrigins: string[];
|
|
166
|
+
remoteRequestTimeoutMs: number;
|
|
167
|
+
remoteOptionsCacheTtlMs: number;
|
|
168
|
+
}> & Omit<Readonly<ContractTemplateRendererProps> & Readonly<{
|
|
169
|
+
onValidate?: ((errors: ContractTemplateValidationError[]) => any) | undefined;
|
|
170
|
+
onChange?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
171
|
+
onSubmit?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
172
|
+
"onUpdate:zoom"?: ((value: number) => any) | undefined;
|
|
173
|
+
"onUpdate:activeFileId"?: ((value: string) => any) | undefined;
|
|
174
|
+
"onUpdate:valuesByFile"?: ((value: import('./types').ContractTemplateRenderValuesByFile) => any) | undefined;
|
|
175
|
+
"onUpdate:values"?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
176
|
+
"onControl-warning"?: ((warning: import('./types').ContractTemplateControlWarning) => any) | undefined;
|
|
177
|
+
}>, "validate" | "submit" | "fitWidth" | "scrollToPage" | "setZoom" | "getZoom" | "resetZoom" | "scrollToVariable" | "focusError" | "getValues" | "setValues" | "resetValues" | "showValidation" | ("values" | "disabled" | "title" | "template" | "readonly" | "zoom" | "showToolbar" | "showSubmitButton" | "contractFontBaseUrl" | "selectorHttp" | "selectorUrlPrefix" | "showValidateButton" | "showResetButton" | "interactionMode" | "validateOnSubmit" | "showPageMeta" | "collapsiblePanel" | "controlRegistry" | "optionResolver" | "requester" | "allowedRemoteOrigins" | "remoteRequestTimeoutMs" | "remoteOptionsCacheTtlMs")> & {
|
|
178
|
+
validate: () => ContractTemplateValidationError[];
|
|
179
|
+
submit: () => false | ContractTemplateRenderValues;
|
|
180
|
+
fitWidth: () => number;
|
|
181
|
+
scrollToPage: (pageId: string) => void;
|
|
182
|
+
setZoom: (value: number) => number;
|
|
183
|
+
getZoom: () => number;
|
|
184
|
+
resetZoom: () => number;
|
|
185
|
+
scrollToVariable: (variableKey: string) => void;
|
|
186
|
+
getValues: () => ContractTemplateRenderValues;
|
|
187
|
+
setValues: (values: ContractTemplateRenderValues) => void;
|
|
188
|
+
resetValues: () => ContractTemplateRenderValues;
|
|
189
|
+
showValidation: (errors: ContractTemplateValidationError[]) => void;
|
|
190
|
+
focusError: (error: ContractTemplateValidationError) => void;
|
|
191
|
+
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
192
|
+
$slots: Readonly<{
|
|
193
|
+
field?: (props: ContractTemplateRendererFieldSlotProps) => VNode[] | undefined;
|
|
194
|
+
headerExtra?: () => VNode[] | undefined;
|
|
195
|
+
fileBar?: () => VNode[] | undefined;
|
|
196
|
+
}> & {
|
|
197
|
+
field?: (props: ContractTemplateRendererFieldSlotProps) => VNode[] | undefined;
|
|
198
|
+
headerExtra?: () => VNode[] | undefined;
|
|
199
|
+
fileBar?: () => VNode[] | undefined;
|
|
200
|
+
};
|
|
201
|
+
}) | null;
|
|
16
202
|
};
|
|
17
203
|
rootEl: HTMLElement;
|
|
18
204
|
};
|
|
19
205
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
206
|
declare const __VLS_component: import('vue').DefineComponent<ContractTemplateRendererProps, {
|
|
207
|
+
getAllValues: () => import('./types').ContractTemplateRenderValuesByFile;
|
|
208
|
+
validateAll: () => ContractTemplateValidationError[];
|
|
21
209
|
getValues: () => ContractTemplateRenderValues;
|
|
22
210
|
setValues: (values: ContractTemplateRenderValues) => void;
|
|
23
211
|
validate: () => ContractTemplateValidationError[];
|
|
@@ -34,15 +222,19 @@ declare const __VLS_component: import('vue').DefineComponent<ContractTemplateRen
|
|
|
34
222
|
change: (value: ContractTemplateRenderValues) => any;
|
|
35
223
|
submit: (value: ContractTemplateRenderValues) => any;
|
|
36
224
|
"update:zoom": (value: number) => any;
|
|
225
|
+
"update:activeFileId": (value: string) => any;
|
|
226
|
+
"update:valuesByFile": (value: import('./types').ContractTemplateRenderValuesByFile) => any;
|
|
37
227
|
"update:values": (value: ContractTemplateRenderValues) => any;
|
|
38
|
-
"control-warning": (warning: ContractTemplateControlWarning) => any;
|
|
228
|
+
"control-warning": (warning: import('./types').ContractTemplateControlWarning) => any;
|
|
39
229
|
}, string, import('vue').PublicProps, Readonly<ContractTemplateRendererProps> & Readonly<{
|
|
40
230
|
onValidate?: ((errors: ContractTemplateValidationError[]) => any) | undefined;
|
|
41
231
|
onChange?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
42
232
|
onSubmit?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
43
233
|
"onUpdate:zoom"?: ((value: number) => any) | undefined;
|
|
234
|
+
"onUpdate:activeFileId"?: ((value: string) => any) | undefined;
|
|
235
|
+
"onUpdate:valuesByFile"?: ((value: import('./types').ContractTemplateRenderValuesByFile) => any) | undefined;
|
|
44
236
|
"onUpdate:values"?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
45
|
-
"onControl-warning"?: ((warning: ContractTemplateControlWarning) => any) | undefined;
|
|
237
|
+
"onControl-warning"?: ((warning: import('./types').ContractTemplateControlWarning) => any) | undefined;
|
|
46
238
|
}>, {
|
|
47
239
|
values: ContractTemplateRenderValues;
|
|
48
240
|
disabled: boolean;
|
|
@@ -68,9 +260,195 @@ declare const __VLS_component: import('vue').DefineComponent<ContractTemplateRen
|
|
|
68
260
|
remoteRequestTimeoutMs: number;
|
|
69
261
|
remoteOptionsCacheTtlMs: number;
|
|
70
262
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
263
|
+
renderer: ({
|
|
264
|
+
$: import('vue').ComponentInternalInstance;
|
|
265
|
+
$data: {};
|
|
266
|
+
$props: {
|
|
267
|
+
readonly files?: import('./types').ContractTemplateFile[] | undefined;
|
|
268
|
+
readonly activeFileId?: string | undefined;
|
|
269
|
+
readonly valuesByFile?: import('./types').ContractTemplateRenderValuesByFile | undefined;
|
|
270
|
+
readonly template?: import('./types').ContractTemplateData | undefined;
|
|
271
|
+
readonly values?: ContractTemplateRenderValues | undefined;
|
|
272
|
+
readonly interactionMode?: import('./types').ContractTemplateRendererMode | undefined;
|
|
273
|
+
readonly readonly?: boolean | undefined;
|
|
274
|
+
readonly disabled?: boolean | undefined;
|
|
275
|
+
readonly title?: string | undefined;
|
|
276
|
+
readonly showSubmitButton?: boolean | undefined;
|
|
277
|
+
readonly validateOnSubmit?: boolean | undefined;
|
|
278
|
+
readonly showValidateButton?: boolean | undefined;
|
|
279
|
+
readonly showResetButton?: boolean | undefined;
|
|
280
|
+
readonly showToolbar?: boolean | undefined;
|
|
281
|
+
readonly showPageMeta?: boolean | undefined;
|
|
282
|
+
readonly collapsiblePanel?: boolean | undefined;
|
|
283
|
+
readonly zoom?: number | undefined;
|
|
284
|
+
readonly controlRegistry?: import('./types').ContractTemplateControlRegistry | undefined;
|
|
285
|
+
readonly optionResolver?: import('./types').ContractTemplateOptionResolver | undefined;
|
|
286
|
+
readonly requester?: import('./types').ContractTemplateControlRequester | undefined;
|
|
287
|
+
readonly allowedRemoteOrigins?: string[] | undefined;
|
|
288
|
+
readonly remoteRequestTimeoutMs?: number | undefined;
|
|
289
|
+
readonly remoteOptionsCacheTtlMs?: number | undefined;
|
|
290
|
+
readonly selectorHttp?: unknown;
|
|
291
|
+
readonly selectorUrlPrefix?: string | undefined;
|
|
292
|
+
readonly contractFontBaseUrl?: string | undefined;
|
|
293
|
+
readonly onValidate?: ((errors: ContractTemplateValidationError[]) => any) | undefined;
|
|
294
|
+
readonly onChange?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
295
|
+
readonly onSubmit?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
296
|
+
readonly "onUpdate:zoom"?: ((value: number) => any) | undefined;
|
|
297
|
+
readonly "onUpdate:activeFileId"?: ((value: string) => any) | undefined;
|
|
298
|
+
readonly "onUpdate:valuesByFile"?: ((value: import('./types').ContractTemplateRenderValuesByFile) => any) | undefined;
|
|
299
|
+
readonly "onUpdate:values"?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
300
|
+
readonly "onControl-warning"?: ((warning: import('./types').ContractTemplateControlWarning) => any) | undefined;
|
|
301
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
|
|
302
|
+
$attrs: import('vue').Attrs;
|
|
303
|
+
$refs: {
|
|
304
|
+
[x: string]: unknown;
|
|
305
|
+
} & {
|
|
306
|
+
rendererElement: HTMLElement;
|
|
307
|
+
pagesViewportElement: HTMLDivElement;
|
|
308
|
+
fieldListElement: HTMLDivElement;
|
|
309
|
+
};
|
|
310
|
+
$slots: Readonly<{
|
|
311
|
+
[name: string]: import('vue').Slot<any> | undefined;
|
|
312
|
+
}>;
|
|
313
|
+
$root: import('vue').ComponentPublicInstance | null;
|
|
314
|
+
$parent: import('vue').ComponentPublicInstance | null;
|
|
315
|
+
$host: Element | null;
|
|
316
|
+
$emit: ((event: "validate", errors: ContractTemplateValidationError[]) => void) & ((event: "change", value: ContractTemplateRenderValues) => void) & ((event: "submit", value: ContractTemplateRenderValues) => void) & ((event: "update:zoom", value: number) => void) & ((event: "update:activeFileId", value: string) => void) & ((event: "update:valuesByFile", value: import('./types').ContractTemplateRenderValuesByFile) => void) & ((event: "update:values", value: ContractTemplateRenderValues) => void) & ((event: "control-warning", warning: import('./types').ContractTemplateControlWarning) => void);
|
|
317
|
+
$el: HTMLElement;
|
|
318
|
+
$options: import('vue').ComponentOptionsBase<Readonly<ContractTemplateRendererProps> & Readonly<{
|
|
319
|
+
onValidate?: ((errors: ContractTemplateValidationError[]) => any) | undefined;
|
|
320
|
+
onChange?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
321
|
+
onSubmit?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
322
|
+
"onUpdate:zoom"?: ((value: number) => any) | undefined;
|
|
323
|
+
"onUpdate:activeFileId"?: ((value: string) => any) | undefined;
|
|
324
|
+
"onUpdate:valuesByFile"?: ((value: import('./types').ContractTemplateRenderValuesByFile) => any) | undefined;
|
|
325
|
+
"onUpdate:values"?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
326
|
+
"onControl-warning"?: ((warning: import('./types').ContractTemplateControlWarning) => any) | undefined;
|
|
327
|
+
}>, {
|
|
328
|
+
validate: () => ContractTemplateValidationError[];
|
|
329
|
+
submit: () => false | ContractTemplateRenderValues;
|
|
330
|
+
fitWidth: () => number;
|
|
331
|
+
scrollToPage: (pageId: string) => void;
|
|
332
|
+
setZoom: (value: number) => number;
|
|
333
|
+
getZoom: () => number;
|
|
334
|
+
resetZoom: () => number;
|
|
335
|
+
scrollToVariable: (variableKey: string) => void;
|
|
336
|
+
getValues: () => ContractTemplateRenderValues;
|
|
337
|
+
setValues: (values: ContractTemplateRenderValues) => void;
|
|
338
|
+
resetValues: () => ContractTemplateRenderValues;
|
|
339
|
+
showValidation: (errors: ContractTemplateValidationError[]) => void;
|
|
340
|
+
focusError: (error: ContractTemplateValidationError) => void;
|
|
341
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
342
|
+
validate: (errors: ContractTemplateValidationError[]) => any;
|
|
343
|
+
change: (value: ContractTemplateRenderValues) => any;
|
|
344
|
+
submit: (value: ContractTemplateRenderValues) => any;
|
|
345
|
+
"update:zoom": (value: number) => any;
|
|
346
|
+
"update:activeFileId": (value: string) => any;
|
|
347
|
+
"update:valuesByFile": (value: import('./types').ContractTemplateRenderValuesByFile) => any;
|
|
348
|
+
"update:values": (value: ContractTemplateRenderValues) => any;
|
|
349
|
+
"control-warning": (warning: import('./types').ContractTemplateControlWarning) => any;
|
|
350
|
+
}, string, {
|
|
351
|
+
values: ContractTemplateRenderValues;
|
|
352
|
+
disabled: boolean;
|
|
353
|
+
title: string;
|
|
354
|
+
template: import('./types').ContractTemplateData;
|
|
355
|
+
readonly: boolean;
|
|
356
|
+
zoom: number;
|
|
357
|
+
showToolbar: boolean;
|
|
358
|
+
showSubmitButton: boolean;
|
|
359
|
+
contractFontBaseUrl: string;
|
|
360
|
+
selectorHttp: undefined;
|
|
361
|
+
selectorUrlPrefix: string;
|
|
362
|
+
showValidateButton: boolean;
|
|
363
|
+
showResetButton: boolean;
|
|
364
|
+
interactionMode: import('./types').ContractTemplateRendererMode;
|
|
365
|
+
validateOnSubmit: boolean;
|
|
366
|
+
showPageMeta: boolean;
|
|
367
|
+
collapsiblePanel: boolean;
|
|
368
|
+
controlRegistry: import('./types').ContractTemplateControlRegistry;
|
|
369
|
+
optionResolver: import('./types').ContractTemplateOptionResolver;
|
|
370
|
+
requester: import('./types').ContractTemplateControlRequester;
|
|
371
|
+
allowedRemoteOrigins: string[];
|
|
372
|
+
remoteRequestTimeoutMs: number;
|
|
373
|
+
remoteOptionsCacheTtlMs: number;
|
|
374
|
+
}, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
|
|
375
|
+
beforeCreate?: (() => void) | (() => void)[];
|
|
376
|
+
created?: (() => void) | (() => void)[];
|
|
377
|
+
beforeMount?: (() => void) | (() => void)[];
|
|
378
|
+
mounted?: (() => void) | (() => void)[];
|
|
379
|
+
beforeUpdate?: (() => void) | (() => void)[];
|
|
380
|
+
updated?: (() => void) | (() => void)[];
|
|
381
|
+
activated?: (() => void) | (() => void)[];
|
|
382
|
+
deactivated?: (() => void) | (() => void)[];
|
|
383
|
+
beforeDestroy?: (() => void) | (() => void)[];
|
|
384
|
+
beforeUnmount?: (() => void) | (() => void)[];
|
|
385
|
+
destroyed?: (() => void) | (() => void)[];
|
|
386
|
+
unmounted?: (() => void) | (() => void)[];
|
|
387
|
+
renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
388
|
+
renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
|
|
389
|
+
errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
|
|
390
|
+
};
|
|
391
|
+
$forceUpdate: () => void;
|
|
392
|
+
$nextTick: typeof nextTick;
|
|
393
|
+
$watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
|
|
394
|
+
} & Readonly<{
|
|
395
|
+
values: ContractTemplateRenderValues;
|
|
396
|
+
disabled: boolean;
|
|
397
|
+
title: string;
|
|
398
|
+
template: import('./types').ContractTemplateData;
|
|
399
|
+
readonly: boolean;
|
|
400
|
+
zoom: number;
|
|
401
|
+
showToolbar: boolean;
|
|
402
|
+
showSubmitButton: boolean;
|
|
403
|
+
contractFontBaseUrl: string;
|
|
404
|
+
selectorHttp: undefined;
|
|
405
|
+
selectorUrlPrefix: string;
|
|
406
|
+
showValidateButton: boolean;
|
|
407
|
+
showResetButton: boolean;
|
|
408
|
+
interactionMode: import('./types').ContractTemplateRendererMode;
|
|
409
|
+
validateOnSubmit: boolean;
|
|
410
|
+
showPageMeta: boolean;
|
|
411
|
+
collapsiblePanel: boolean;
|
|
412
|
+
controlRegistry: import('./types').ContractTemplateControlRegistry;
|
|
413
|
+
optionResolver: import('./types').ContractTemplateOptionResolver;
|
|
414
|
+
requester: import('./types').ContractTemplateControlRequester;
|
|
415
|
+
allowedRemoteOrigins: string[];
|
|
416
|
+
remoteRequestTimeoutMs: number;
|
|
417
|
+
remoteOptionsCacheTtlMs: number;
|
|
418
|
+
}> & Omit<Readonly<ContractTemplateRendererProps> & Readonly<{
|
|
419
|
+
onValidate?: ((errors: ContractTemplateValidationError[]) => any) | undefined;
|
|
420
|
+
onChange?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
421
|
+
onSubmit?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
422
|
+
"onUpdate:zoom"?: ((value: number) => any) | undefined;
|
|
423
|
+
"onUpdate:activeFileId"?: ((value: string) => any) | undefined;
|
|
424
|
+
"onUpdate:valuesByFile"?: ((value: import('./types').ContractTemplateRenderValuesByFile) => any) | undefined;
|
|
425
|
+
"onUpdate:values"?: ((value: ContractTemplateRenderValues) => any) | undefined;
|
|
426
|
+
"onControl-warning"?: ((warning: import('./types').ContractTemplateControlWarning) => any) | undefined;
|
|
427
|
+
}>, "validate" | "submit" | "fitWidth" | "scrollToPage" | "setZoom" | "getZoom" | "resetZoom" | "scrollToVariable" | "focusError" | "getValues" | "setValues" | "resetValues" | "showValidation" | ("values" | "disabled" | "title" | "template" | "readonly" | "zoom" | "showToolbar" | "showSubmitButton" | "contractFontBaseUrl" | "selectorHttp" | "selectorUrlPrefix" | "showValidateButton" | "showResetButton" | "interactionMode" | "validateOnSubmit" | "showPageMeta" | "collapsiblePanel" | "controlRegistry" | "optionResolver" | "requester" | "allowedRemoteOrigins" | "remoteRequestTimeoutMs" | "remoteOptionsCacheTtlMs")> & {
|
|
428
|
+
validate: () => ContractTemplateValidationError[];
|
|
429
|
+
submit: () => false | ContractTemplateRenderValues;
|
|
430
|
+
fitWidth: () => number;
|
|
431
|
+
scrollToPage: (pageId: string) => void;
|
|
432
|
+
setZoom: (value: number) => number;
|
|
433
|
+
getZoom: () => number;
|
|
434
|
+
resetZoom: () => number;
|
|
435
|
+
scrollToVariable: (variableKey: string) => void;
|
|
436
|
+
getValues: () => ContractTemplateRenderValues;
|
|
437
|
+
setValues: (values: ContractTemplateRenderValues) => void;
|
|
438
|
+
resetValues: () => ContractTemplateRenderValues;
|
|
439
|
+
showValidation: (errors: ContractTemplateValidationError[]) => void;
|
|
440
|
+
focusError: (error: ContractTemplateValidationError) => void;
|
|
441
|
+
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
442
|
+
$slots: Readonly<{
|
|
443
|
+
field?: (props: ContractTemplateRendererFieldSlotProps) => VNode[] | undefined;
|
|
444
|
+
headerExtra?: () => VNode[] | undefined;
|
|
445
|
+
fileBar?: () => VNode[] | undefined;
|
|
446
|
+
}> & {
|
|
447
|
+
field?: (props: ContractTemplateRendererFieldSlotProps) => VNode[] | undefined;
|
|
448
|
+
headerExtra?: () => VNode[] | undefined;
|
|
449
|
+
fileBar?: () => VNode[] | undefined;
|
|
450
|
+
};
|
|
451
|
+
}) | null;
|
|
74
452
|
}, HTMLElement>;
|
|
75
453
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
76
454
|
export default _default;
|
package/dist/types/components/pro-contract-template-designer/src/composables/use-renderer-files.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ContractTemplateFile, ContractTemplateRendererProps, ContractTemplateRenderValues, ContractTemplateRenderValuesByFile, ContractTemplateValidationError } from '../types';
|
|
2
|
+
/** 填写端只识别持久化 id,不使用设计器会补造文件/id 的编辑态归一化。 */
|
|
3
|
+
export declare function useRendererFiles(props: ContractTemplateRendererProps, onSelect: (id: string) => void, onValues: (values: ContractTemplateRenderValuesByFile) => void): {
|
|
4
|
+
enabled: import('vue').ComputedRef<boolean>;
|
|
5
|
+
files: import('vue').ComputedRef<ContractTemplateFile[]>;
|
|
6
|
+
activeId: import('vue').Ref<string, string>;
|
|
7
|
+
activeFile: import('vue').ComputedRef<ContractTemplateFile | undefined>;
|
|
8
|
+
values: import('vue').Ref<ContractTemplateRenderValuesByFile, ContractTemplateRenderValuesByFile>;
|
|
9
|
+
fileErrors: import('vue').ComputedRef<ContractTemplateValidationError[]>;
|
|
10
|
+
select: (id: string) => void;
|
|
11
|
+
update: (value: ContractTemplateRenderValues) => void;
|
|
12
|
+
getAllValues: () => ContractTemplateRenderValuesByFile;
|
|
13
|
+
validateAll: () => ContractTemplateValidationError[];
|
|
14
|
+
};
|
|
@@ -137,10 +137,17 @@ export declare function collectTemplateValueVariableKeys(value: Pick<ContractTem
|
|
|
137
137
|
* 一并裁掉,外部脏模板会在首次正文同步后静默变成合法数据,用户反而看不到可定位错误。
|
|
138
138
|
*/
|
|
139
139
|
export declare function syncTemplateVariablesWithPages(value: ContractTemplateData): ContractTemplateData;
|
|
140
|
+
/** 自动分页用的表格行测量结果,坐标相对正文容器顶部。 */
|
|
141
|
+
export interface ContractTemplateTableRowMeasurement {
|
|
142
|
+
top: number;
|
|
143
|
+
height: number;
|
|
144
|
+
}
|
|
140
145
|
/** 自动分页用的单个顶层块测量结果,坐标相对正文容器顶部。 */
|
|
141
146
|
export interface ContractTemplateBlockMeasurement {
|
|
142
147
|
top: number;
|
|
143
148
|
height: number;
|
|
149
|
+
tableRows?: ContractTemplateTableRowMeasurement[];
|
|
150
|
+
trailingTextBlockHeight?: number;
|
|
144
151
|
}
|
|
145
152
|
/** 自动分页结果:`splitIndex` 为溢出块下标,`-1` 表示当前页无需拆分。 */
|
|
146
153
|
export interface ContractTemplateContentSplitResult {
|
|
@@ -151,8 +158,8 @@ export interface ContractTemplateContentSplitResult {
|
|
|
151
158
|
/**
|
|
152
159
|
* 依据实测块高决定当前页在哪个顶层块处溢出。
|
|
153
160
|
*
|
|
154
|
-
*
|
|
155
|
-
*
|
|
161
|
+
* 普通块仍在顶层边界整体迁移;表格是唯一允许内部拆分的块,按完整行分页并避开
|
|
162
|
+
* rowspan。返回 `undefined` 表示无需分页,或首个超高非表格块无法安全拆分。
|
|
156
163
|
*/
|
|
157
164
|
export declare function splitPageContentByMeasurements(content: JSONContent[] | undefined, measurements: ContractTemplateBlockMeasurement[], maxContentHeight: number): ContractTemplateContentSplitResult | undefined;
|
|
158
165
|
/**
|
|
@@ -471,6 +471,8 @@ export interface ContractTemplateValidationError {
|
|
|
471
471
|
}
|
|
472
472
|
export type ContractTemplateRenderValue = string | number | boolean | ContractTemplateSelectionValue | ContractTemplateSelectionValue[] | null | undefined;
|
|
473
473
|
export type ContractTemplateRenderValues = Record<string, ContractTemplateRenderValue>;
|
|
474
|
+
/** 按稳定文件 id 隔离填写值;不同文件的同名变量互不共享。 */
|
|
475
|
+
export type ContractTemplateRenderValuesByFile = Record<string, ContractTemplateRenderValues>;
|
|
474
476
|
export type ContractTemplateRendererMode = 'panel' | 'inline';
|
|
475
477
|
export interface ContractTemplateRendererFieldSlotProps {
|
|
476
478
|
variable: ContractTemplateVariable;
|
|
@@ -486,6 +488,12 @@ export interface ContractTemplateRendererFieldSlotProps {
|
|
|
486
488
|
focusVariable: () => void;
|
|
487
489
|
}
|
|
488
490
|
export interface ContractTemplateRendererProps {
|
|
491
|
+
/** 显式传入即启用多文件模式(包括空数组);优先于 template,不补造文件或 id。 */
|
|
492
|
+
files?: ContractTemplateFile[];
|
|
493
|
+
/** 当前文件 id;无效时回退第一份 id 合法且唯一的文件。 */
|
|
494
|
+
activeFileId?: string;
|
|
495
|
+
/** 多文件填写值,优先于单文件 values。 */
|
|
496
|
+
valuesByFile?: ContractTemplateRenderValuesByFile;
|
|
489
497
|
/** 设计器导出的模板数据 */
|
|
490
498
|
template?: ContractTemplateData;
|
|
491
499
|
/** 按变量 key 记录的填写值 */
|
|
@@ -516,7 +524,7 @@ export interface ContractTemplateRendererProps {
|
|
|
516
524
|
*/
|
|
517
525
|
showSubmitButton?: boolean;
|
|
518
526
|
/**
|
|
519
|
-
*
|
|
527
|
+
* 点击提交时是否主动展示填写校验结果;服务端一定会拒绝的规则始终阻止提交
|
|
520
528
|
* @default true
|
|
521
529
|
*/
|
|
522
530
|
validateOnSubmit?: boolean;
|
|
@@ -572,13 +580,15 @@ export interface ContractTemplateRendererProps {
|
|
|
572
580
|
contractFontBaseUrl?: string;
|
|
573
581
|
}
|
|
574
582
|
export interface ContractTemplateRendererEmits {
|
|
583
|
+
'update:activeFileId': [value: string];
|
|
584
|
+
'update:valuesByFile': [value: ContractTemplateRenderValuesByFile];
|
|
575
585
|
/** 填写值变化时同步 v-model:values */
|
|
576
586
|
'update:values': [value: ContractTemplateRenderValues];
|
|
577
587
|
/** 填写值变化时触发 */
|
|
578
588
|
change: [value: ContractTemplateRenderValues];
|
|
579
589
|
/** 调用 validate 后返回校验错误 */
|
|
580
590
|
validate: [errors: ContractTemplateValidationError[]];
|
|
581
|
-
/**
|
|
591
|
+
/** 提交当前填写值;服务端一定会拒绝的模板、资源和填写值规则必须通过 */
|
|
582
592
|
submit: [value: ContractTemplateRenderValues];
|
|
583
593
|
/** 缩放比例变化时同步 v-model:zoom */
|
|
584
594
|
'update:zoom': [value: number];
|
|
@@ -586,6 +596,10 @@ export interface ContractTemplateRendererEmits {
|
|
|
586
596
|
'control-warning': [warning: ContractTemplateControlWarning];
|
|
587
597
|
}
|
|
588
598
|
export interface ContractTemplateRendererExpose {
|
|
599
|
+
/** 所有合法文件的填写值(含未访问文件默认值);单文件模式返回空 map,不合成 id。 */
|
|
600
|
+
getAllValues: () => ContractTemplateRenderValuesByFile;
|
|
601
|
+
/** 校验全部文件并切换、定位首个错误;disabled 时只校验、不切换。单文件等价于 validate。 */
|
|
602
|
+
validateAll: () => ContractTemplateValidationError[];
|
|
589
603
|
/** 获取当前填写值快照 */
|
|
590
604
|
getValues: () => ContractTemplateRenderValues;
|
|
591
605
|
/** 替换当前填写值 */
|