@guodun/antdv 1.4.1 → 1.4.2
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/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +208 -180
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +2 -1
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.mjs +690 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +215 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.mjs +87 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.mjs +98 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.mjs +550 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.mjs +117 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.mjs +96 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +51 -26
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.mjs +56 -33
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.mjs +29 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.mjs +390 -0
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +313 -267
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1278 -2293
- package/dist/es/components/pro-contract-template-designer/src/composables/use-auto-pagination.mjs +71 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-designer-files.mjs +11 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-draft-cache-session.mjs +111 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.mjs +79 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +189 -160
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-files.mjs +35 -22
- package/dist/es/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.mjs +71 -0
- package/dist/es/components/pro-contract-template-designer/src/constants.mjs +71 -10
- package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/block-style.mjs +43 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/context-menu-viewport.mjs +13 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/editor-state.mjs +7 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +398 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/serialize-fingerprint.mjs +6 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +88 -72
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/index.mjs +20 -20
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.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/composables/use-auto-pagination.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-designer-files.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-draft-cache-session.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.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-template-files.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/constants.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/editor-extensions.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/block-style.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/context-menu-viewport.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/editor-state.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/serialize-fingerprint.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/index.cjs +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/ContractTemplateDesignerInspector.vue.d.ts +3 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +104 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +50 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.d.ts +27 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.d.ts +13 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.d.ts +28 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.d.ts +77 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.d.ts +36 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.d.ts +5 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.vue.d.ts +4 -4
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererToolbar.vue.d.ts +4 -4
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.d.ts +12 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.d.ts +77 -0
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +8 -32
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +366 -12
- package/dist/types/components/pro-contract-template-designer/src/composables/use-auto-pagination.d.ts +43 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-designer-files.d.ts +22 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-draft-cache-session.d.ts +41 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.d.ts +49 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +15 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts +13 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.d.ts +19 -0
- package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +7 -1
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +89 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/block-style.d.ts +4 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/context-menu-viewport.d.ts +22 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/editor-state.d.ts +8 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/page-decorations.d.ts +90 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/serialize-fingerprint.d.ts +8 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +4 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ContractTemplateContentImage, ContractTemplateData, ContractTemplateFile, ContractTemplateFilesExportResult, ContractLocationRule, ContractTemplateDesignerProps, ContractTemplateDraftCacheStatus, ContractTemplateEditorCommand, ContractTemplateEditorTextAlign, ContractTemplateFieldStyle, ContractTemplatePageSize, ContractTemplateLocationRule, ContractTemplateLocationRuleOptions, ContractTemplateSigningPlacement, ContractTemplateSigningPlacementType, ContractTemplateTableCommandCapabilities, ContractTemplateValidationError, ContractTemplateVariable } from './types';
|
|
1
|
+
import { ContractTemplateContentImage, ContractTemplateData, ContractTemplateFile, ContractTemplateFilesExportResult, ContractLocationRule, ContractTemplateDesignerProps, ContractTemplateDraftCacheStatus, ContractTemplateEditorCommand, ContractTemplateEditorState, ContractTemplateEditorTextAlign, ContractTemplateFieldStyle, ContractTemplateFieldType, ContractTemplatePageDecorations, ContractTemplatePageSize, ContractTemplateLocationRule, ContractTemplateLocationRuleOptions, ContractTemplateSigningPlacement, ContractTemplateSigningPlacementType, ContractTemplateTableInsertOptions, ContractTemplateTableCommandCapabilities, ContractTemplateValidationError, ContractTemplateVariable } from './types';
|
|
2
2
|
import { ContractTemplateImageSource } from './utils/content-image';
|
|
3
3
|
declare const _default: import('vue').DefineComponent<ContractTemplateDesignerProps, {
|
|
4
4
|
getValue: () => ContractTemplateData;
|
|
@@ -86,29 +86,209 @@ declare const _default: import('vue').DefineComponent<ContractTemplateDesignerPr
|
|
|
86
86
|
height: string | number;
|
|
87
87
|
readonly: boolean;
|
|
88
88
|
pageSize: ContractTemplatePageSize;
|
|
89
|
+
showDraftCacheStatus: boolean;
|
|
90
|
+
showClearButton: boolean;
|
|
91
|
+
showSubmitDataViewer: boolean;
|
|
89
92
|
showSigningPlacementTools: boolean;
|
|
90
93
|
maxPages: number;
|
|
91
94
|
variableTypes: import('./types').ContractTemplateFieldTypeOption[];
|
|
92
95
|
defaultVariableStyle: ContractTemplateFieldStyle;
|
|
93
96
|
fontFamilies: import('./types').ContractTemplateFontFamilyOption[];
|
|
94
97
|
fontFamilyMode: import('./types').ContractTemplateFontFamilyMode;
|
|
95
|
-
showSubmitDataViewer: boolean;
|
|
96
|
-
showClearButton: boolean;
|
|
97
98
|
enableDraftCache: boolean;
|
|
98
99
|
draftCacheKey: string;
|
|
99
100
|
draftCacheInterval: number;
|
|
100
101
|
draftCacheMaxBytes: number;
|
|
101
|
-
showDraftCacheStatus: boolean;
|
|
102
102
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
103
103
|
designerElement: HTMLDivElement;
|
|
104
104
|
workspaceElement: HTMLElement;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
workspaceHeaderElement: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
106
|
+
summary: string;
|
|
107
|
+
draftCacheStatusText: string;
|
|
108
|
+
draftCacheStatusClass: Record<string, boolean>;
|
|
109
|
+
showDraftCacheStatus: boolean;
|
|
110
|
+
showClearButton: boolean;
|
|
111
|
+
showSubmitDataViewer: boolean;
|
|
112
|
+
readonly: boolean;
|
|
113
|
+
zoomPercent: string;
|
|
114
|
+
zoomOutDisabled: boolean;
|
|
115
|
+
zoomInDisabled: boolean;
|
|
116
|
+
isFullscreen: boolean;
|
|
117
|
+
pageDecorationsOpen: boolean;
|
|
118
|
+
pageDecorationsStudioId: string;
|
|
119
|
+
pageDecorationsPresetLabel: string;
|
|
120
|
+
pageDecorationsEnabledCount: number;
|
|
121
|
+
pageDecorationsEnabledStates: {
|
|
122
|
+
header: boolean;
|
|
123
|
+
footer: boolean;
|
|
124
|
+
watermark: boolean;
|
|
125
|
+
};
|
|
126
|
+
}> & Readonly<{
|
|
127
|
+
onClear?: (() => any) | undefined;
|
|
128
|
+
onValidate?: (() => any) | undefined;
|
|
129
|
+
onPreview?: (() => any) | undefined;
|
|
130
|
+
onFitWidth?: (() => any) | undefined;
|
|
131
|
+
onZoomOut?: (() => any) | undefined;
|
|
132
|
+
onZoomIn?: (() => any) | undefined;
|
|
133
|
+
onResetZoom?: (() => any) | undefined;
|
|
134
|
+
onToggleFullscreen?: (() => any) | undefined;
|
|
135
|
+
onSubmitData?: (() => any) | undefined;
|
|
136
|
+
onTogglePageDecorations?: (() => any) | undefined;
|
|
137
|
+
}>, {
|
|
138
|
+
focusPageDecorations: () => void | undefined;
|
|
139
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
140
|
+
clear: () => any;
|
|
141
|
+
validate: () => any;
|
|
142
|
+
preview: () => any;
|
|
143
|
+
fitWidth: () => any;
|
|
144
|
+
zoomOut: () => any;
|
|
145
|
+
zoomIn: () => any;
|
|
146
|
+
resetZoom: () => any;
|
|
147
|
+
toggleFullscreen: () => any;
|
|
148
|
+
submitData: () => any;
|
|
149
|
+
togglePageDecorations: () => any;
|
|
150
|
+
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
151
|
+
workspaceHeader: HTMLElement;
|
|
152
|
+
}, HTMLElement, import('vue').ComponentProvideOptions, {
|
|
153
|
+
P: {};
|
|
154
|
+
B: {};
|
|
155
|
+
D: {};
|
|
156
|
+
C: {};
|
|
157
|
+
M: {};
|
|
158
|
+
Defaults: {};
|
|
159
|
+
}, Readonly<{
|
|
160
|
+
summary: string;
|
|
161
|
+
draftCacheStatusText: string;
|
|
162
|
+
draftCacheStatusClass: Record<string, boolean>;
|
|
163
|
+
showDraftCacheStatus: boolean;
|
|
164
|
+
showClearButton: boolean;
|
|
165
|
+
showSubmitDataViewer: boolean;
|
|
166
|
+
readonly: boolean;
|
|
167
|
+
zoomPercent: string;
|
|
168
|
+
zoomOutDisabled: boolean;
|
|
169
|
+
zoomInDisabled: boolean;
|
|
170
|
+
isFullscreen: boolean;
|
|
171
|
+
pageDecorationsOpen: boolean;
|
|
172
|
+
pageDecorationsStudioId: string;
|
|
173
|
+
pageDecorationsPresetLabel: string;
|
|
174
|
+
pageDecorationsEnabledCount: number;
|
|
175
|
+
pageDecorationsEnabledStates: {
|
|
176
|
+
header: boolean;
|
|
177
|
+
footer: boolean;
|
|
178
|
+
watermark: boolean;
|
|
179
|
+
};
|
|
180
|
+
}> & Readonly<{
|
|
181
|
+
onClear?: (() => any) | undefined;
|
|
182
|
+
onValidate?: (() => any) | undefined;
|
|
183
|
+
onPreview?: (() => any) | undefined;
|
|
184
|
+
onFitWidth?: (() => any) | undefined;
|
|
185
|
+
onZoomOut?: (() => any) | undefined;
|
|
186
|
+
onZoomIn?: (() => any) | undefined;
|
|
187
|
+
onResetZoom?: (() => any) | undefined;
|
|
188
|
+
onToggleFullscreen?: (() => any) | undefined;
|
|
189
|
+
onSubmitData?: (() => any) | undefined;
|
|
190
|
+
onTogglePageDecorations?: (() => any) | undefined;
|
|
191
|
+
}>, {
|
|
192
|
+
focusPageDecorations: () => void | undefined;
|
|
193
|
+
}, {}, {}, {}, {}> | null;
|
|
111
194
|
canvasElement: HTMLDivElement;
|
|
195
|
+
pageDecorationsStudioElement: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
196
|
+
id?: string;
|
|
197
|
+
open: boolean;
|
|
198
|
+
decorations?: ContractTemplatePageDecorations;
|
|
199
|
+
variables: ContractTemplateVariable[];
|
|
200
|
+
fontFamilyOptions: Array<{
|
|
201
|
+
label: string;
|
|
202
|
+
value: string;
|
|
203
|
+
}>;
|
|
204
|
+
readonly: boolean;
|
|
205
|
+
disabled: boolean;
|
|
206
|
+
activeTab?: "header" | "footer" | "watermark";
|
|
207
|
+
}> & Readonly<{
|
|
208
|
+
onChange?: ((value: ContractTemplatePageDecorations) => any) | undefined;
|
|
209
|
+
onClose?: (() => any) | undefined;
|
|
210
|
+
"onUpdate:activeTab"?: ((value: "footer" | "header" | "watermark") => any) | undefined;
|
|
211
|
+
}>, {
|
|
212
|
+
focusField: (path: import('./utils/page-decorations').ContractTemplatePageDecorationFieldPath) => Promise<void>;
|
|
213
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
214
|
+
change: (value: ContractTemplatePageDecorations) => any;
|
|
215
|
+
close: () => any;
|
|
216
|
+
"update:activeTab": (value: "footer" | "header" | "watermark") => any;
|
|
217
|
+
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
218
|
+
studioRoot: HTMLElement;
|
|
219
|
+
inspectorRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
220
|
+
decorations?: ContractTemplatePageDecorations;
|
|
221
|
+
variables: ContractTemplateVariable[];
|
|
222
|
+
fontFamilyOptions: Array<{
|
|
223
|
+
label: string;
|
|
224
|
+
value: string;
|
|
225
|
+
}>;
|
|
226
|
+
readonly: boolean;
|
|
227
|
+
disabled: boolean;
|
|
228
|
+
activeTab?: "header" | "footer" | "watermark";
|
|
229
|
+
embedded?: boolean;
|
|
230
|
+
}> & Readonly<{
|
|
231
|
+
onChange?: ((value: ContractTemplatePageDecorations) => any) | undefined;
|
|
232
|
+
"onUpdate:activeTab"?: ((value: "footer" | "header" | "watermark") => any) | undefined;
|
|
233
|
+
}>, {
|
|
234
|
+
resetToDefault: () => void;
|
|
235
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
236
|
+
change: (value: ContractTemplatePageDecorations) => any;
|
|
237
|
+
"update:activeTab": (value: "footer" | "header" | "watermark") => any;
|
|
238
|
+
}, import('vue').PublicProps, {
|
|
239
|
+
embedded: boolean;
|
|
240
|
+
}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLElement, import('vue').ComponentProvideOptions, {
|
|
241
|
+
P: {};
|
|
242
|
+
B: {};
|
|
243
|
+
D: {};
|
|
244
|
+
C: {};
|
|
245
|
+
M: {};
|
|
246
|
+
Defaults: {};
|
|
247
|
+
}, Readonly<{
|
|
248
|
+
decorations?: ContractTemplatePageDecorations;
|
|
249
|
+
variables: ContractTemplateVariable[];
|
|
250
|
+
fontFamilyOptions: Array<{
|
|
251
|
+
label: string;
|
|
252
|
+
value: string;
|
|
253
|
+
}>;
|
|
254
|
+
readonly: boolean;
|
|
255
|
+
disabled: boolean;
|
|
256
|
+
activeTab?: "header" | "footer" | "watermark";
|
|
257
|
+
embedded?: boolean;
|
|
258
|
+
}> & Readonly<{
|
|
259
|
+
onChange?: ((value: ContractTemplatePageDecorations) => any) | undefined;
|
|
260
|
+
"onUpdate:activeTab"?: ((value: "footer" | "header" | "watermark") => any) | undefined;
|
|
261
|
+
}>, {
|
|
262
|
+
resetToDefault: () => void;
|
|
263
|
+
}, {}, {}, {}, {
|
|
264
|
+
embedded: boolean;
|
|
265
|
+
}> | null;
|
|
266
|
+
}, HTMLElement, import('vue').ComponentProvideOptions, {
|
|
267
|
+
P: {};
|
|
268
|
+
B: {};
|
|
269
|
+
D: {};
|
|
270
|
+
C: {};
|
|
271
|
+
M: {};
|
|
272
|
+
Defaults: {};
|
|
273
|
+
}, Readonly<{
|
|
274
|
+
id?: string;
|
|
275
|
+
open: boolean;
|
|
276
|
+
decorations?: ContractTemplatePageDecorations;
|
|
277
|
+
variables: ContractTemplateVariable[];
|
|
278
|
+
fontFamilyOptions: Array<{
|
|
279
|
+
label: string;
|
|
280
|
+
value: string;
|
|
281
|
+
}>;
|
|
282
|
+
readonly: boolean;
|
|
283
|
+
disabled: boolean;
|
|
284
|
+
activeTab?: "header" | "footer" | "watermark";
|
|
285
|
+
}> & Readonly<{
|
|
286
|
+
onChange?: ((value: ContractTemplatePageDecorations) => any) | undefined;
|
|
287
|
+
onClose?: (() => any) | undefined;
|
|
288
|
+
"onUpdate:activeTab"?: ((value: "footer" | "header" | "watermark") => any) | undefined;
|
|
289
|
+
}>, {
|
|
290
|
+
focusField: (path: import('./utils/page-decorations').ContractTemplatePageDecorationFieldPath) => Promise<void>;
|
|
291
|
+
}, {}, {}, {}, {}> | null;
|
|
112
292
|
tableContextMenuElement: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
113
293
|
capabilities: ContractTemplateTableCommandCapabilities;
|
|
114
294
|
activeAlignment: ContractTemplateEditorTextAlign | "mixed";
|
|
@@ -140,8 +320,182 @@ declare const _default: import('vue').DefineComponent<ContractTemplateDesignerPr
|
|
|
140
320
|
focusFirstItem: () => void;
|
|
141
321
|
getMenuElement: () => HTMLElement | undefined;
|
|
142
322
|
}, {}, {}, {}, {}> | null;
|
|
143
|
-
imageContextMenuElement:
|
|
144
|
-
|
|
323
|
+
imageContextMenuElement: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
324
|
+
width?: number | undefined;
|
|
325
|
+
height?: number | undefined;
|
|
326
|
+
} & {
|
|
327
|
+
x: number;
|
|
328
|
+
y: number;
|
|
329
|
+
readonly: boolean;
|
|
330
|
+
}> & Readonly<{
|
|
331
|
+
onKeydown?: ((event: KeyboardEvent) => any) | undefined;
|
|
332
|
+
onRestore?: (() => any) | undefined;
|
|
333
|
+
onApply?: (() => any) | undefined;
|
|
334
|
+
"onUpdate:width"?: ((value: number | undefined) => any) | undefined;
|
|
335
|
+
"onUpdate:height"?: ((value: number | undefined) => any) | undefined;
|
|
336
|
+
}>, {
|
|
337
|
+
getMenuElement: () => HTMLElement | undefined;
|
|
338
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
339
|
+
keydown: (event: KeyboardEvent) => any;
|
|
340
|
+
restore: () => any;
|
|
341
|
+
apply: () => any;
|
|
342
|
+
"update:width": (value: number | undefined) => any;
|
|
343
|
+
"update:height": (value: number | undefined) => any;
|
|
344
|
+
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
345
|
+
menuElement: HTMLDivElement;
|
|
346
|
+
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
347
|
+
P: {};
|
|
348
|
+
B: {};
|
|
349
|
+
D: {};
|
|
350
|
+
C: {};
|
|
351
|
+
M: {};
|
|
352
|
+
Defaults: {};
|
|
353
|
+
}, Readonly<{
|
|
354
|
+
width?: number | undefined;
|
|
355
|
+
height?: number | undefined;
|
|
356
|
+
} & {
|
|
357
|
+
x: number;
|
|
358
|
+
y: number;
|
|
359
|
+
readonly: boolean;
|
|
360
|
+
}> & Readonly<{
|
|
361
|
+
onKeydown?: ((event: KeyboardEvent) => any) | undefined;
|
|
362
|
+
onRestore?: (() => any) | undefined;
|
|
363
|
+
onApply?: (() => any) | undefined;
|
|
364
|
+
"onUpdate:width"?: ((value: number | undefined) => any) | undefined;
|
|
365
|
+
"onUpdate:height"?: ((value: number | undefined) => any) | undefined;
|
|
366
|
+
}>, {
|
|
367
|
+
getMenuElement: () => HTMLElement | undefined;
|
|
368
|
+
}, {}, {}, {}, {}> | null;
|
|
369
|
+
textContextMenuElement: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
370
|
+
bindOpen?: boolean;
|
|
371
|
+
bindKeyword?: string;
|
|
372
|
+
} & {
|
|
373
|
+
x: number;
|
|
374
|
+
y: number;
|
|
375
|
+
hasSelection: boolean;
|
|
376
|
+
editorState: ContractTemplateEditorState;
|
|
377
|
+
fontSizePresetOptions: Array<{
|
|
378
|
+
label: string;
|
|
379
|
+
value: number | string;
|
|
380
|
+
}>;
|
|
381
|
+
currentEditorFontSize: number;
|
|
382
|
+
editorFontSizeSearchValue: string;
|
|
383
|
+
textAlignOptions: Array<{
|
|
384
|
+
label: string;
|
|
385
|
+
value: ContractTemplateEditorTextAlign;
|
|
386
|
+
}>;
|
|
387
|
+
currentEditorTextColor: string;
|
|
388
|
+
bodyControlToolItems: Array<{
|
|
389
|
+
type: ContractTemplateFieldType;
|
|
390
|
+
label: string;
|
|
391
|
+
icon: import('vue').Component;
|
|
392
|
+
}>;
|
|
393
|
+
textMenuBindableVariables: ContractTemplateVariable[];
|
|
394
|
+
pageLimitReached: boolean;
|
|
395
|
+
tableInsertDraft: ContractTemplateTableInsertOptions;
|
|
396
|
+
variablesCount: number;
|
|
397
|
+
resolveBindVariableTypeLabel: (variable: ContractTemplateVariable) => string;
|
|
398
|
+
}> & Readonly<{
|
|
399
|
+
onKeydown?: ((event: KeyboardEvent) => any) | undefined;
|
|
400
|
+
onCommand?: ((command: ContractTemplateEditorCommand) => any) | undefined;
|
|
401
|
+
"onPatch-font-size"?: ((value: unknown) => any) | undefined;
|
|
402
|
+
"onPatch-color"?: ((value: string) => any) | undefined;
|
|
403
|
+
"onPatch-text-align"?: ((value: unknown) => any) | undefined;
|
|
404
|
+
"onInsert-variable"?: ((type: ContractTemplateFieldType) => any) | undefined;
|
|
405
|
+
"onAdd-page"?: (() => any) | undefined;
|
|
406
|
+
"onFont-size-search"?: ((value: string) => any) | undefined;
|
|
407
|
+
"onFont-size-commit"?: (() => any) | undefined;
|
|
408
|
+
"onFont-size-dropdown-change"?: ((open: boolean) => any) | undefined;
|
|
409
|
+
"onFont-size-keydown"?: ((event: KeyboardEvent) => any) | undefined;
|
|
410
|
+
onClipboard?: ((command: "copy" | "cut" | "paste") => any) | undefined;
|
|
411
|
+
"onOpen-image"?: (() => any) | undefined;
|
|
412
|
+
"onBind-variable"?: ((variable: ContractTemplateVariable) => any) | undefined;
|
|
413
|
+
"onOpen-bind-panel"?: (() => any) | undefined;
|
|
414
|
+
"onUpdate:bindOpen"?: ((value: boolean) => any) | undefined;
|
|
415
|
+
"onUpdate:bindKeyword"?: ((value: string) => any) | undefined;
|
|
416
|
+
}>, {
|
|
417
|
+
getMenuElement: () => HTMLElement | undefined;
|
|
418
|
+
focusBindSearch: () => void;
|
|
419
|
+
focusFirstButton: () => void;
|
|
420
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
421
|
+
keydown: (event: KeyboardEvent) => any;
|
|
422
|
+
command: (command: ContractTemplateEditorCommand) => any;
|
|
423
|
+
"patch-font-size": (value: unknown) => any;
|
|
424
|
+
"patch-color": (value: string) => any;
|
|
425
|
+
"patch-text-align": (value: unknown) => any;
|
|
426
|
+
"insert-variable": (type: ContractTemplateFieldType) => any;
|
|
427
|
+
"add-page": () => any;
|
|
428
|
+
"font-size-search": (value: string) => any;
|
|
429
|
+
"font-size-commit": () => any;
|
|
430
|
+
"font-size-dropdown-change": (open: boolean) => any;
|
|
431
|
+
"font-size-keydown": (event: KeyboardEvent) => any;
|
|
432
|
+
clipboard: (command: "copy" | "cut" | "paste") => any;
|
|
433
|
+
"open-image": () => any;
|
|
434
|
+
"bind-variable": (variable: ContractTemplateVariable) => any;
|
|
435
|
+
"open-bind-panel": () => any;
|
|
436
|
+
"update:bindOpen": (value: boolean) => any;
|
|
437
|
+
"update:bindKeyword": (value: string) => any;
|
|
438
|
+
}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
439
|
+
menuElement: HTMLDivElement;
|
|
440
|
+
}, HTMLDivElement, import('vue').ComponentProvideOptions, {
|
|
441
|
+
P: {};
|
|
442
|
+
B: {};
|
|
443
|
+
D: {};
|
|
444
|
+
C: {};
|
|
445
|
+
M: {};
|
|
446
|
+
Defaults: {};
|
|
447
|
+
}, Readonly<{
|
|
448
|
+
bindOpen?: boolean;
|
|
449
|
+
bindKeyword?: string;
|
|
450
|
+
} & {
|
|
451
|
+
x: number;
|
|
452
|
+
y: number;
|
|
453
|
+
hasSelection: boolean;
|
|
454
|
+
editorState: ContractTemplateEditorState;
|
|
455
|
+
fontSizePresetOptions: Array<{
|
|
456
|
+
label: string;
|
|
457
|
+
value: number | string;
|
|
458
|
+
}>;
|
|
459
|
+
currentEditorFontSize: number;
|
|
460
|
+
editorFontSizeSearchValue: string;
|
|
461
|
+
textAlignOptions: Array<{
|
|
462
|
+
label: string;
|
|
463
|
+
value: ContractTemplateEditorTextAlign;
|
|
464
|
+
}>;
|
|
465
|
+
currentEditorTextColor: string;
|
|
466
|
+
bodyControlToolItems: Array<{
|
|
467
|
+
type: ContractTemplateFieldType;
|
|
468
|
+
label: string;
|
|
469
|
+
icon: import('vue').Component;
|
|
470
|
+
}>;
|
|
471
|
+
textMenuBindableVariables: ContractTemplateVariable[];
|
|
472
|
+
pageLimitReached: boolean;
|
|
473
|
+
tableInsertDraft: ContractTemplateTableInsertOptions;
|
|
474
|
+
variablesCount: number;
|
|
475
|
+
resolveBindVariableTypeLabel: (variable: ContractTemplateVariable) => string;
|
|
476
|
+
}> & Readonly<{
|
|
477
|
+
onKeydown?: ((event: KeyboardEvent) => any) | undefined;
|
|
478
|
+
onCommand?: ((command: ContractTemplateEditorCommand) => any) | undefined;
|
|
479
|
+
"onPatch-font-size"?: ((value: unknown) => any) | undefined;
|
|
480
|
+
"onPatch-color"?: ((value: string) => any) | undefined;
|
|
481
|
+
"onPatch-text-align"?: ((value: unknown) => any) | undefined;
|
|
482
|
+
"onInsert-variable"?: ((type: ContractTemplateFieldType) => any) | undefined;
|
|
483
|
+
"onAdd-page"?: (() => any) | undefined;
|
|
484
|
+
"onFont-size-search"?: ((value: string) => any) | undefined;
|
|
485
|
+
"onFont-size-commit"?: (() => any) | undefined;
|
|
486
|
+
"onFont-size-dropdown-change"?: ((open: boolean) => any) | undefined;
|
|
487
|
+
"onFont-size-keydown"?: ((event: KeyboardEvent) => any) | undefined;
|
|
488
|
+
onClipboard?: ((command: "copy" | "cut" | "paste") => any) | undefined;
|
|
489
|
+
"onOpen-image"?: (() => any) | undefined;
|
|
490
|
+
"onBind-variable"?: ((variable: ContractTemplateVariable) => any) | undefined;
|
|
491
|
+
"onOpen-bind-panel"?: (() => any) | undefined;
|
|
492
|
+
"onUpdate:bindOpen"?: ((value: boolean) => any) | undefined;
|
|
493
|
+
"onUpdate:bindKeyword"?: ((value: string) => any) | undefined;
|
|
494
|
+
}>, {
|
|
495
|
+
getMenuElement: () => HTMLElement | undefined;
|
|
496
|
+
focusBindSearch: () => void;
|
|
497
|
+
focusFirstButton: () => void;
|
|
498
|
+
}, {}, {}, {}, {}> | null;
|
|
145
499
|
imageFileInputElement: HTMLInputElement;
|
|
146
500
|
}, HTMLDivElement>;
|
|
147
501
|
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { JSONContent } from '@tiptap/core';
|
|
3
|
+
import { ContractTemplateData, ContractTemplatePage, ContractTemplatePageSize } from '../types';
|
|
4
|
+
export interface AutoPaginationPageRef {
|
|
5
|
+
hasOverflowContent: () => boolean;
|
|
6
|
+
splitOverflowContent: () => {
|
|
7
|
+
page: ContractTemplatePage;
|
|
8
|
+
overflowContent: JSONContent[];
|
|
9
|
+
overflowHtml: string;
|
|
10
|
+
} | undefined;
|
|
11
|
+
prependContent: (content: JSONContent[]) => ContractTemplatePage | undefined;
|
|
12
|
+
}
|
|
13
|
+
declare function createDocContent(content: JSONContent[]): ContractTemplatePage['contentJson'];
|
|
14
|
+
/**
|
|
15
|
+
* 把上一页溢出的内容插到本页开头(页面组件不可用时的纯数据兜底路径)。
|
|
16
|
+
*
|
|
17
|
+
* 本页原本是空白时丢掉它的占位 HTML,否则拼接后会多出一个空段落。
|
|
18
|
+
*/
|
|
19
|
+
export declare function prependOverflowToPageData(page: ContractTemplatePage, overflowContent: JSONContent[], overflowHtml: string): ContractTemplatePage;
|
|
20
|
+
/**
|
|
21
|
+
* 自动分页编排:登记待办、测量 DOM、连锁切页。
|
|
22
|
+
*
|
|
23
|
+
* 正文真源在各页 Tiptap;本 composable 只调度循环,不自己改坐标。
|
|
24
|
+
*/
|
|
25
|
+
export declare function useAutoPagination(options: {
|
|
26
|
+
templateValue: Ref<ContractTemplateData>;
|
|
27
|
+
readonlyState: Ref<boolean> | ComputedRef<boolean>;
|
|
28
|
+
isAutoPaginating: Ref<boolean>;
|
|
29
|
+
pendingPaginationPageId: Ref<string>;
|
|
30
|
+
activePageId: Ref<string>;
|
|
31
|
+
normalizedMaxPages: Ref<number> | ComputedRef<number>;
|
|
32
|
+
pageRefs: Map<string, AutoPaginationPageRef>;
|
|
33
|
+
syncPageEditors: () => ContractTemplateData;
|
|
34
|
+
commitBodyChange: (nextValue: ContractTemplateData) => ContractTemplateData;
|
|
35
|
+
getPageSize: (page?: ContractTemplatePage) => ContractTemplatePageSize;
|
|
36
|
+
notifyPageLimit: (source: 'add' | 'duplicate' | 'auto-pagination') => void;
|
|
37
|
+
}): {
|
|
38
|
+
scheduleAutoPaginate: (pageId?: string) => void;
|
|
39
|
+
runAutoPagination: () => Promise<void>;
|
|
40
|
+
createDocContent: typeof createDocContent;
|
|
41
|
+
prependOverflowToPageData: typeof prependOverflowToPageData;
|
|
42
|
+
};
|
|
43
|
+
export {};
|
package/dist/types/components/pro-contract-template-designer/src/composables/use-designer-files.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface SetActiveFileIdOptions {
|
|
2
|
+
/** 切换前是否把当前编辑器快照写回文件数组。 */
|
|
3
|
+
syncCurrent?: boolean;
|
|
4
|
+
/** 是否向外抛 `update:activeFileId`。 */
|
|
5
|
+
shouldEmit?: boolean;
|
|
6
|
+
/** 即使 fileId 没变也强制重装当前文件(外部 files 整体替换时用)。 */
|
|
7
|
+
forceRefresh?: boolean;
|
|
8
|
+
/** 切换前是否把当前文件的签署入参错误快照留下来。 */
|
|
9
|
+
persistCurrentErrors?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 文件切换选项。
|
|
13
|
+
*
|
|
14
|
+
* 以前五个布尔参数排队,调用点几乎读不懂;收成具名 options 后默认值仍保持
|
|
15
|
+
* 「同步当前文件、向外抛事件、保留错误」。
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveSetActiveFileIdOptions(options?: SetActiveFileIdOptions): {
|
|
18
|
+
syncCurrent: boolean;
|
|
19
|
+
shouldEmit: boolean;
|
|
20
|
+
forceRefresh: boolean;
|
|
21
|
+
persistCurrentErrors: boolean;
|
|
22
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { ContractTemplateData, ContractTemplateDraftCacheStatus, ContractTemplateFile, ContractTemplatePageSize, ContractTemplateValidationError } from '../types';
|
|
3
|
+
import { SetActiveFileIdOptions } from './use-designer-files';
|
|
4
|
+
/**
|
|
5
|
+
* 草稿缓存会话:定时写入、空白才恢复、卸载时停表。
|
|
6
|
+
*
|
|
7
|
+
* 宿主已有正文时不得用本地草稿覆盖;指纹用来跳过内容没变的重复写入。
|
|
8
|
+
*/
|
|
9
|
+
export declare function useDraftCacheSession(options: {
|
|
10
|
+
draftCacheWritable: ComputedRef<boolean>;
|
|
11
|
+
multipleFilesMode: ComputedRef<boolean>;
|
|
12
|
+
filesValue: Ref<ContractTemplateFile[]>;
|
|
13
|
+
activeFileIdValue: Ref<string>;
|
|
14
|
+
templateValue: Ref<ContractTemplateData>;
|
|
15
|
+
draftCacheKey: ComputedRef<string | undefined>;
|
|
16
|
+
draftCacheInterval: () => number | undefined;
|
|
17
|
+
draftCacheMaxBytes: () => number | undefined;
|
|
18
|
+
pageSize: () => ContractTemplatePageSize | undefined;
|
|
19
|
+
pageSizeOptions: () => ContractTemplatePageSize[] | undefined;
|
|
20
|
+
syncActiveFileSnapshot: (shouldEmit?: boolean) => ContractTemplateData;
|
|
21
|
+
syncPageEditors: () => ContractTemplateData;
|
|
22
|
+
setActiveFileId: (fileId: string, opts?: SetActiveFileIdOptions) => void;
|
|
23
|
+
emitFilesChange: (files: ContractTemplateFile[], changedFileId?: string) => void;
|
|
24
|
+
commit: (value: ContractTemplateData) => ContractTemplateData;
|
|
25
|
+
setSigningPlacementInputErrorsByFile: (value: Record<string, ContractTemplateValidationError[]>) => void;
|
|
26
|
+
buildSigningPlacementInputErrorsByFile: (files: ContractTemplateFile[], rawFiles?: Array<{
|
|
27
|
+
template?: ContractTemplateData;
|
|
28
|
+
}>) => Record<string, ContractTemplateValidationError[]>;
|
|
29
|
+
updateDraftCacheStatus: (status: ContractTemplateDraftCacheStatus, shouldEmit?: boolean) => void;
|
|
30
|
+
scheduleAutoPaginate: (pageId?: string) => void;
|
|
31
|
+
activePageId: Ref<string>;
|
|
32
|
+
selectedVariableKey: Ref<string>;
|
|
33
|
+
}): {
|
|
34
|
+
saveDraftCache: () => ContractTemplateDraftCacheStatus;
|
|
35
|
+
loadDraftCache: () => ContractTemplateData | undefined;
|
|
36
|
+
clearDraftCache: () => void;
|
|
37
|
+
restoreDraftCacheIfNeeded: () => void;
|
|
38
|
+
stopDraftCacheTimer: () => void;
|
|
39
|
+
restartDraftCacheTimer: () => void;
|
|
40
|
+
resetDraftFingerprint: () => void;
|
|
41
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { ContractTemplateData, ContractTemplatePage, ContractTemplatePageSize, ContractTemplateSigningPlacement, ContractTemplateSigningPlacementType } from '../types';
|
|
3
|
+
import { ContractTemplateSigningPlacementDragPayload, ContractTemplateSigningPlacementToolItem } from '../utils/signing-placement';
|
|
4
|
+
/**
|
|
5
|
+
* 深克隆签署位置。
|
|
6
|
+
*
|
|
7
|
+
* 位置对象会通过事件抛给宿主,`sealTypes` 是数组,直接透传会让宿主拿到内部引用;
|
|
8
|
+
* 这里只需要复制这一层数组,其余字段都是原始值。
|
|
9
|
+
*/
|
|
10
|
+
export declare function cloneSigningPlacement(placement: ContractTemplateSigningPlacement): ContractTemplateSigningPlacement;
|
|
11
|
+
/**
|
|
12
|
+
* 签署位置 CRUD 与拖放。
|
|
13
|
+
*
|
|
14
|
+
* `showSigningPlacementTools === false` 时 drop 必须短路,不能只藏 UI。
|
|
15
|
+
*/
|
|
16
|
+
export declare function useSigningPlacementEditor(options: {
|
|
17
|
+
templateValue: Ref<ContractTemplateData>;
|
|
18
|
+
signingPlacements: ComputedRef<ContractTemplateSigningPlacement[]>;
|
|
19
|
+
selectedSigningPlacement: ComputedRef<ContractTemplateSigningPlacement | undefined>;
|
|
20
|
+
selectedSigningPlacementId: Ref<string>;
|
|
21
|
+
selectedPage: ComputedRef<ContractTemplatePage | undefined>;
|
|
22
|
+
activePageId: Ref<string>;
|
|
23
|
+
readonly: () => boolean;
|
|
24
|
+
disabled: () => boolean;
|
|
25
|
+
showSigningPlacementTools: () => boolean;
|
|
26
|
+
getPageSize: (page?: ContractTemplatePage) => ContractTemplatePageSize;
|
|
27
|
+
getVisiblePosition: (pageId: string, type: ContractTemplateSigningPlacementType) => {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
} | undefined;
|
|
31
|
+
commitSigningPlacements: (placements: ContractTemplateSigningPlacement[], resolvedPlacementIds?: Iterable<string>) => ContractTemplateData;
|
|
32
|
+
selectSigningPlacement: (id?: string) => void;
|
|
33
|
+
emitAdd: (placement: ContractTemplateSigningPlacement) => void;
|
|
34
|
+
emitChange: (placement: ContractTemplateSigningPlacement) => void;
|
|
35
|
+
emitRemove: (placement: ContractTemplateSigningPlacement) => void;
|
|
36
|
+
}): {
|
|
37
|
+
insertSigningPlacement: (type: ContractTemplateSigningPlacementType, pageId?: string, position?: {
|
|
38
|
+
x: number;
|
|
39
|
+
y: number;
|
|
40
|
+
}) => ContractTemplateSigningPlacement | undefined;
|
|
41
|
+
handleSigningPlacementDrop: (pageId: string, payload: ContractTemplateSigningPlacementDragPayload, centerX: number, centerY: number) => void;
|
|
42
|
+
insertSigningPlacementTool: (item: ContractTemplateSigningPlacementDragPayload) => ContractTemplateSigningPlacement | undefined;
|
|
43
|
+
handleSigningPlacementDragStart: (event: DragEvent, item: ContractTemplateSigningPlacementToolItem) => void;
|
|
44
|
+
updateSigningPlacement: (nextPlacement: ContractTemplateSigningPlacement) => void;
|
|
45
|
+
patchSelectedSigningPlacement: (patch: Partial<ContractTemplateSigningPlacement>) => void;
|
|
46
|
+
duplicateSigningPlacement: (placement?: ContractTemplateSigningPlacement | undefined) => void;
|
|
47
|
+
removeSigningPlacement: (placement?: ContractTemplateSigningPlacement | undefined) => void;
|
|
48
|
+
cloneSigningPlacement: typeof cloneSigningPlacement;
|
|
49
|
+
};
|
|
@@ -14,6 +14,11 @@ export declare const DEFAULT_MULTILINE_LINE_HEIGHT = 28;
|
|
|
14
14
|
export declare const CONTRACT_TEMPLATE_RENDERER_VERSION = "contract-template-renderer-1.0.0";
|
|
15
15
|
/** 合同渲染 CSS 版本快照,用于服务端 PDF 复现。 */
|
|
16
16
|
export declare const CONTRACT_TEMPLATE_STYLE_VERSION = "contract-render-css-1.0.0";
|
|
17
|
+
/** 与 PDF 模板填值服务保持一致,避免设计器允许保存但服务端拒绝的变量标识。 */
|
|
18
|
+
export declare const CONTRACT_TEMPLATE_VARIABLE_KEY_PATTERN: RegExp;
|
|
19
|
+
export declare const CONTRACT_TEMPLATE_RESERVED_VARIABLE_KEYS: Set<string>;
|
|
20
|
+
/** 属性面板和模板全量校验共用的变量标识规则。 */
|
|
21
|
+
export declare function validateContractTemplateVariableKey(key: unknown, variables: ContractTemplateVariable[], currentVariableId?: string): string;
|
|
17
22
|
/** 页数配置只接受正整数;非法值回落到默认 20 页。 */
|
|
18
23
|
export declare function normalizeContractTemplateMaxPages(value: unknown): number;
|
|
19
24
|
/** 正文可插入的变量类型及其默认尺寸。 */
|
|
@@ -111,6 +116,10 @@ export declare function buildTemplatePreviewPages(value: ContractTemplateData):
|
|
|
111
116
|
* 先深拷贝再附加渲染器/样式版本号和表达式 HTML,保证导出快照与设计态数据解耦,
|
|
112
117
|
* 宿主后续改动设计态不会污染已经拿到的导出对象。
|
|
113
118
|
*/
|
|
119
|
+
export declare class ContractTemplatePageDecorationValidationError extends Error {
|
|
120
|
+
readonly errors: ContractTemplateValidationError[];
|
|
121
|
+
constructor(errors: ContractTemplateValidationError[]);
|
|
122
|
+
}
|
|
114
123
|
export declare function exportTemplateValue(value: ContractTemplateData): ContractTemplateExportResult;
|
|
115
124
|
/**
|
|
116
125
|
* 全量校验模板结构,返回可定位到具体节点的错误列表。
|
|
@@ -131,7 +140,12 @@ export declare function validateTemplateValue(value: ContractTemplateData, optio
|
|
|
131
140
|
export declare function collectTemplateVariableKeys(page: ContractTemplatePage): Set<string>;
|
|
132
141
|
/** 汇总整份模板引用到的变量 key。 */
|
|
133
142
|
export declare function collectTemplateValueVariableKeys(value: Pick<ContractTemplateData, 'pages'>): Set<string>;
|
|
134
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* 删除正文和页面装饰里已经不存在的合法变量配置。
|
|
145
|
+
*
|
|
146
|
+
* 空 key、非法 key、保留字和重复声明必须继续留到校验层;若在这里按“无引用”
|
|
147
|
+
* 一并裁掉,外部脏模板会在首次正文同步后静默变成合法数据,用户反而看不到可定位错误。
|
|
148
|
+
*/
|
|
135
149
|
export declare function syncTemplateVariablesWithPages(value: ContractTemplateData): ContractTemplateData;
|
|
136
150
|
/** 自动分页用的单个顶层块测量结果,坐标相对正文容器顶部。 */
|
|
137
151
|
export interface ContractTemplateBlockMeasurement {
|
package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts
CHANGED
|
@@ -11,6 +11,19 @@ export declare function createContractTemplateFile(name?: string, pageSize?: Con
|
|
|
11
11
|
* 重复/空 id 只在编辑态补成稳定新 id,外部数据不会被原地改写。
|
|
12
12
|
*/
|
|
13
13
|
export declare function normalizeContractTemplateFiles(input: ContractTemplateFile[] | undefined, fallbackTemplate?: ContractTemplateData, pageSize?: ContractTemplatePageSize): ContractTemplateFile[];
|
|
14
|
+
/**
|
|
15
|
+
* 对每份文件独立套用页面尺寸白名单。
|
|
16
|
+
*
|
|
17
|
+
* 导入超页数上限时不在这里截断;被回退的签署位置 id 按文件分组,便于宿主同步坐标。
|
|
18
|
+
*/
|
|
19
|
+
export declare function constrainContractTemplateFiles(files: ContractTemplateFile[], pageSizeOptions: ContractTemplatePageSize[] | undefined): {
|
|
20
|
+
files: {
|
|
21
|
+
template: ContractTemplateData;
|
|
22
|
+
id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
}[];
|
|
25
|
+
resizedSigningPlacementIds: Map<string, string[]>;
|
|
26
|
+
};
|
|
14
27
|
/** 当前 id 不可用时稳定回退第一份文件,空数组返回空字符串。 */
|
|
15
28
|
export declare function resolveContractTemplateActiveFileId(files: ContractTemplateFile[], activeFileId?: string): string;
|
|
16
29
|
/** 不可变替换一份文件的模板;找不到 id 时保持原数组内容。 */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ContractTemplateToolbarOverflowKey } from '../utils/toolbar-overflow';
|
|
3
|
+
/**
|
|
4
|
+
* 工具栏按组收纳进「更多」面板。
|
|
5
|
+
*
|
|
6
|
+
* 组宽只在该组仍是主行子元素时缓存;进面板后量到的是竖排宽度,不能拿去算主行。
|
|
7
|
+
*/
|
|
8
|
+
export declare function useToolbarOverflow(options: {
|
|
9
|
+
toolbarMainElement: Ref<HTMLElement | undefined>;
|
|
10
|
+
toolbarMoreElement: Ref<HTMLElement | undefined>;
|
|
11
|
+
toolbarMoreOpen: Ref<boolean>;
|
|
12
|
+
measureDependencies: () => unknown;
|
|
13
|
+
isDisposed: () => boolean;
|
|
14
|
+
}): {
|
|
15
|
+
toolbarOverflowKeys: Ref<("table" | "insert" | "cleanup" | "typography")[], ("table" | "insert" | "cleanup" | "typography")[]>;
|
|
16
|
+
toolbarHasOverflow: import('vue').ComputedRef<boolean>;
|
|
17
|
+
isToolbarGroupOverflowed: (key: ContractTemplateToolbarOverflowKey) => boolean;
|
|
18
|
+
measureToolbarOverflow: (settlePass?: number) => void;
|
|
19
|
+
};
|