@guodun/antdv 1.4.2 → 1.4.3
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/ContractSigningLocationCanvas.vue.mjs +304 -293
- package/dist/es/components/contract-signing-location/src/coordinates.mjs +23 -23
- package/dist/es/components/contract-signing-location/src/location-rules.mjs +20 -10
- package/dist/es/components/contract-signing-location/src/page-layout.mjs +12 -9
- package/dist/es/components/contract-signing-location/src/template-source.mjs +2 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +186 -148
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.vue.mjs +179 -0
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +104 -81
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1205 -1035
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/coordinates.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/page-layout.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.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/style/index.css +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/types/components/contract-signing-location/src/coordinates.d.ts +2 -2
- package/dist/types/components/contract-signing-location/src/page-layout.d.ts +2 -2
- package/dist/types/components/contract-signing-location/src/template-source.d.ts +2 -0
- package/dist/types/components/contract-signing-location/src/types.d.ts +3 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +10 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.vue.d.ts +43 -0
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +22 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +90 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/context-menu-viewport.d.ts +3 -0
- package/package.json +3 -3
package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs
CHANGED
|
@@ -12,37 +12,39 @@ import Re from "./TableContextMenu.mjs";
|
|
|
12
12
|
import ze from "./ContractTemplateDesignerWorkspaceHeader.mjs";
|
|
13
13
|
import Be from "./ContractTemplateDesignerToolbar.mjs";
|
|
14
14
|
import Ve from "./ContractTemplateTextContextMenu.mjs";
|
|
15
|
-
import He from "./
|
|
16
|
-
import Ue from "./
|
|
17
|
-
import We from "./
|
|
18
|
-
import
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import dt from "./
|
|
26
|
-
import ft from "./
|
|
27
|
-
import pt from "./
|
|
28
|
-
import mt from "./
|
|
15
|
+
import He from "./ContractTemplateTextBubbleMenu.mjs";
|
|
16
|
+
import Ue from "./ContractTemplateImageContextMenu.mjs";
|
|
17
|
+
import We from "./ContractTemplatePreviewModal.mjs";
|
|
18
|
+
import Ge from "./ContractTemplateSubmitDataModal.mjs";
|
|
19
|
+
import { DEFAULT_DRAFT_CACHE_INTERVAL as Ke, DEFAULT_DRAFT_CACHE_KEY as qe, DEFAULT_DRAFT_CACHE_MAX_BYTES as l, createDraftCacheStatus as Je, formatDraftCacheSavedAt as Ye } from "./composables/use-template-draft-cache.mjs";
|
|
20
|
+
import { useAutoPagination as Xe } from "./composables/use-auto-pagination.mjs";
|
|
21
|
+
import { resolveSetActiveFileIdOptions as Ze } from "./composables/use-designer-files.mjs";
|
|
22
|
+
import { cloneContractTemplateFiles as u, constrainContractTemplateFiles as Qe, createContractTemplateFile as $e, exportContractTemplateFiles as et, moveContractTemplateFile as tt, normalizeContractTemplateFiles as nt, removeContractTemplateFile as rt, renameContractTemplateFile as it, replaceContractTemplateFile as at, resolveContractTemplateActiveFileId as ot } from "./composables/use-template-files.mjs";
|
|
23
|
+
import { useDraftCacheSession as st } from "./composables/use-draft-cache-session.mjs";
|
|
24
|
+
import { cloneSigningPlacement as ct, useSigningPlacementEditor as lt } from "./composables/use-signing-placement-editor.mjs";
|
|
25
|
+
import { resolveFieldTypeIcon as ut, resolveSigningPlacementTypeIcon as dt } from "./utils/template-tool-icons.mjs";
|
|
26
|
+
import ft from "./ContractTemplateFileBar.mjs";
|
|
27
|
+
import pt from "./ContractTemplateDesignerSidebar.mjs";
|
|
28
|
+
import mt from "./ContractTemplateDesignerInspector.mjs";
|
|
29
|
+
import ht from "./ContractTemplatePageDecorationsStudio.mjs";
|
|
29
30
|
import { serializeFingerprint as d } from "./utils/serialize-fingerprint.mjs";
|
|
30
|
-
import { isSameEditorState as
|
|
31
|
-
import { clampContextMenuPosition as
|
|
32
|
-
import { Fragment as
|
|
33
|
-
import { Alert as Pt, Modal as Ft } from "ant-design-vue";
|
|
34
|
-
import { useElementSize as
|
|
31
|
+
import { isSameEditorState as gt } from "./utils/editor-state.mjs";
|
|
32
|
+
import { clampContextMenuPosition as _t, clampContextMenuToElement as vt } from "./utils/context-menu-viewport.mjs";
|
|
33
|
+
import { Fragment as yt, Teleport as bt, computed as f, createBlock as xt, createCommentVNode as St, createElementBlock as Ct, createElementVNode as p, createVNode as m, defineComponent as h, nextTick as g, normalizeClass as wt, normalizeStyle as Tt, onBeforeUnmount as Et, onMounted as Dt, openBlock as _, ref as v, renderList as Ot, toDisplayString as kt, unref as y, useId as At, vShow as jt, watch as b, withCtx as Mt, withDirectives as Nt } from "vue";
|
|
34
|
+
import { Alert as Pt, Modal as Ft, Tooltip as It } from "ant-design-vue";
|
|
35
|
+
import { useElementSize as Lt } from "@vueuse/core";
|
|
36
|
+
import { CompressOutlined as Rt, DownOutlined as zt } from "@ant-design/icons-vue";
|
|
35
37
|
//#region src/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue?vue&type=script&setup=true&lang.ts
|
|
36
|
-
var
|
|
37
|
-
key:
|
|
38
|
+
var Bt = {
|
|
39
|
+
key: 2,
|
|
38
40
|
class: "gd-contract-template-designer__validation"
|
|
39
|
-
},
|
|
41
|
+
}, Vt = {
|
|
40
42
|
key: 0,
|
|
41
43
|
class: "gd-contract-template-designer__validation-list"
|
|
42
|
-
},
|
|
44
|
+
}, Ht = ["onClick"], Ut = {
|
|
43
45
|
class: "gd-contract-template-designer__sr-status",
|
|
44
46
|
"aria-live": "polite"
|
|
45
|
-
},
|
|
47
|
+
}, Wt = .5, Gt = 1.5, Kt = .1, qt = 120, Jt = 128, Yt = 108, Xt = 48, Zt = 24, Qt = 10, $t = 48, en = 8, tn = /* @__PURE__ */ h({
|
|
46
48
|
name: "ProContractTemplateDesigner",
|
|
47
49
|
__name: "ProContractTemplateDesigner",
|
|
48
50
|
props: {
|
|
@@ -83,8 +85,8 @@ var Lt = {
|
|
|
83
85
|
type: Boolean,
|
|
84
86
|
default: !0
|
|
85
87
|
},
|
|
86
|
-
draftCacheKey: { default:
|
|
87
|
-
draftCacheInterval: { default:
|
|
88
|
+
draftCacheKey: { default: qe },
|
|
89
|
+
draftCacheInterval: { default: Ke },
|
|
88
90
|
draftCacheMaxBytes: { default: l },
|
|
89
91
|
showDraftCacheStatus: {
|
|
90
92
|
type: Boolean,
|
|
@@ -111,9 +113,9 @@ var Lt = {
|
|
|
111
113
|
"signing-placement-remove",
|
|
112
114
|
"signing-placement-select"
|
|
113
115
|
],
|
|
114
|
-
setup(s, { expose:
|
|
115
|
-
let l = s,
|
|
116
|
-
function
|
|
116
|
+
setup(s, { expose: Ke, emit: qe }) {
|
|
117
|
+
let l = s, h = qe, tn = f(() => ({ height: typeof l.height == "number" ? `${l.height}px` : l.height })), nn = v(), rn = v(), an = v(), on = v(), sn = v(), cn = `gd-contract-template-page-decorations-studio-${At()}`, ln = `gd-contract-template-workspace-chrome-${At()}`, un = v(), dn = v();
|
|
118
|
+
function fn(e) {
|
|
117
119
|
if (!e || !Array.isArray(e.pages) || !Array.isArray(e.signingPlacements)) return [];
|
|
118
120
|
try {
|
|
119
121
|
return Ae(e).filter((e) => e.type === "signing-placement");
|
|
@@ -121,52 +123,52 @@ var Lt = {
|
|
|
121
123
|
return [];
|
|
122
124
|
}
|
|
123
125
|
}
|
|
124
|
-
function
|
|
125
|
-
return Object.fromEntries(e.map((e, n) => [e.id,
|
|
126
|
+
function pn(e, t) {
|
|
127
|
+
return Object.fromEntries(e.map((e, n) => [e.id, fn(t?.[n]?.template ?? e.template)]));
|
|
126
128
|
}
|
|
127
|
-
let
|
|
128
|
-
if (
|
|
129
|
-
if (
|
|
130
|
-
let e = u(
|
|
131
|
-
|
|
129
|
+
let mn = "", hn = "", gn = v(!1), x = f(() => gn.value || Array.isArray(l.files)), _n = nt(l.files, l.modelValue, l.pageSize), vn = Qe(_n, l.pageSizeOptions), yn = x.value ? vn.files : _n, bn = ot(yn, l.activeFileId), S = v(yn), C = v(bn), xn = yn.find((e) => e.id === bn) ?? yn[0], w = v(pn(yn, Array.isArray(l.files) ? l.files : l.modelValue ? [{ template: l.modelValue }] : void 0)), T = v(w.value[bn] ?? fn(xn?.template)), Sn = Ee(xn?.template ?? l.modelValue, l.pageSize), Cn = ge(Sn, l.pageSizeOptions), E = v(Cn.value);
|
|
130
|
+
if (x.value) {
|
|
131
|
+
if (S.value = at(S.value, C.value, Cn.value), d(S.value) !== d(_n)) {
|
|
132
|
+
let e = u(S.value);
|
|
133
|
+
mn = d(e), h("update:files", e), h("files-change", u(e));
|
|
132
134
|
}
|
|
133
|
-
} else l.modelValue && d(
|
|
134
|
-
let
|
|
135
|
+
} else l.modelValue && d(Cn.value) !== d(Sn) && (hn = d(Cn.value), h("update:modelValue", c(Cn.value)), h("change", c(Cn.value)), Ui(Cn.resizedSigningPlacementIds, Cn.value));
|
|
136
|
+
let D = v(""), O = v(""), k = v(E.value.pages[0]?.id ?? ""), A = v(!1), j = v([]), M = /* @__PURE__ */ new Map(), wn = v(!1), Tn = v(""), En = v(!1), Dn = v(), On = v(), kn = v(""), An = v(!1), jn = v(""), N = v(1), P = v(!1), Mn = v(!1), Nn = v(!1), Pn = v(!1), Fn = v(!1), In = v(), F = v(!1), Ln = v("header"), Rn = v(!1), zn = v({}), Bn = v(""), I = v(!1), L = v(!1), Vn = v(!1), Hn = v(!1), Un = v(""), Wn = v(), Gn = v(), Kn = v(""), qn = v(!1), R = v(), Jn = v(), z = v(), Yn = v(), Xn = v(!1), Zn, Qn = v(!1), $n, er = v(!1), tr = v(""), B = v(), nr = v(), V = v(), rr = v(), ir = v(), ar = v(), H = v(""), U = v(Je("idle", "暂无本地草稿")), or = v({
|
|
135
137
|
rows: 3,
|
|
136
138
|
cols: 3,
|
|
137
139
|
withHeaderRow: !0
|
|
138
|
-
}),
|
|
140
|
+
}), sr = /* @__PURE__ */ new WeakSet(), cr = [".gd-contract-template-designer__page-decorations-select-popup", ".gd-contract-template-designer__page-decorations-dropdown-popup"].join(","), lr, ur, dr = !1, fr = !1, pr, W = f(() => l.readonly || l.disabled), mr = f(() => !!(R.value || B.value || V.value || I.value || L.value || Rn.value || Vn.value || Hn.value)), hr = f(() => !!l.enableDraftCache && !W.value), gr = f(() => S.value.find((e) => e.id === C.value) ?? S.value[0]), _r = f(() => l.draftCacheKey), G = f(() => E.value.variables.find((e) => e.key === D.value)), K = f(() => E.value.signingPlacements ?? []), vr = f(() => Dn.value ? pe(Dn.value) : []), yr = f(() => (On.value ?? []).map((e) => ({
|
|
139
141
|
file: e,
|
|
140
142
|
pages: pe(e.template)
|
|
141
|
-
}))),
|
|
142
|
-
let t =
|
|
143
|
+
}))), br = f(() => yr.value.find((e) => e.file.id === kn.value) ?? yr.value[0]), xr = f(() => K.value.find((e) => e.id === O.value)), Sr = f(() => K.value.map((e) => {
|
|
144
|
+
let t = E.value.pages.findIndex((t) => t.id === e.pageId);
|
|
143
145
|
return {
|
|
144
146
|
placement: e,
|
|
145
147
|
label: n[e.type],
|
|
146
148
|
detail: `${n[e.type]} · 第 ${Math.max(0, t) + 1} 页`
|
|
147
149
|
};
|
|
148
|
-
})),
|
|
149
|
-
let e =
|
|
150
|
-
return
|
|
151
|
-
}),
|
|
152
|
-
let e =
|
|
153
|
-
return `${
|
|
154
|
-
}),
|
|
150
|
+
})), Cr = f(() => {
|
|
151
|
+
let e = xr.value?.pageId;
|
|
152
|
+
return Vi(E.value.pages.find((t) => t.id === e));
|
|
153
|
+
}), q = f(() => E.value.pages.find((e) => e.id === k.value) ?? E.value.pages[0]), wr = f(() => De(q.value?.pageSize, E.value.pageSize)), Tr = f(() => A.value && j.value.length === 0), Er = f(() => A.value ? Tr.value ? "校验通过,正文变量与变量配置一致" : `发现 ${j.value.length} 个校验问题` : ""), Dr = f(() => {
|
|
154
|
+
let e = q.value?.title || "合同正文";
|
|
155
|
+
return `${x.value && gr.value ? `${gr.value.name} · ` : ""}${e} · ${wr.value.label} · 共 ${E.value.pages.length} 页`;
|
|
156
|
+
}), Or = f(() => ({
|
|
155
157
|
none: "无装饰",
|
|
156
158
|
"page-number": "标准页码",
|
|
157
159
|
"internal-review": "内部审阅",
|
|
158
160
|
draft: "草稿",
|
|
159
161
|
custom: "自定义"
|
|
160
|
-
})[ce(
|
|
161
|
-
let e = se(
|
|
162
|
+
})[ce(E.value.pageDecorations)]), kr = f(() => {
|
|
163
|
+
let e = se(E.value.pageDecorations);
|
|
162
164
|
return {
|
|
163
165
|
header: e.header.enabled,
|
|
164
166
|
footer: e.footer.enabled,
|
|
165
167
|
watermark: e.watermark.enabled
|
|
166
168
|
};
|
|
167
|
-
}),
|
|
168
|
-
switch (
|
|
169
|
-
case "saved": return `草稿已缓存 ${
|
|
169
|
+
}), Ar = f(() => Object.values(kr.value).filter(Boolean).length), jr = f(() => {
|
|
170
|
+
switch (U.value.type) {
|
|
171
|
+
case "saved": return `草稿已缓存 ${Ye(U.value.savedAt)}`;
|
|
170
172
|
case "restored": return "已恢复本地草稿";
|
|
171
173
|
case "too-large": return "草稿过大,未缓存";
|
|
172
174
|
case "unavailable":
|
|
@@ -175,23 +177,23 @@ var Lt = {
|
|
|
175
177
|
case "cleared": return "草稿缓存已清理";
|
|
176
178
|
default: return "";
|
|
177
179
|
}
|
|
178
|
-
}),
|
|
179
|
-
"is-success":
|
|
180
|
-
"is-warning":
|
|
181
|
-
"is-error":
|
|
182
|
-
})),
|
|
180
|
+
}), Mr = f(() => ({
|
|
181
|
+
"is-success": U.value.type === "saved" || U.value.type === "restored",
|
|
182
|
+
"is-warning": U.value.type === "too-large",
|
|
183
|
+
"is-error": U.value.type === "unavailable" || U.value.type === "read-failed" || U.value.type === "write-failed"
|
|
184
|
+
})), Nr = f(() => `${Math.round(N.value * 100)}%`), Pr = f(() => ae(l.fontFamilies, l.fontFamilyMode)), Fr = f(() => Pr.value.map((e) => ({
|
|
183
185
|
label: e.label,
|
|
184
186
|
value: e.value
|
|
185
|
-
}))),
|
|
187
|
+
}))), Ir = ie, Lr = [...te.map((e) => ({
|
|
186
188
|
label: e.label,
|
|
187
189
|
value: e.format
|
|
188
|
-
}))],
|
|
190
|
+
}))], Rr = [{
|
|
189
191
|
label: "实线",
|
|
190
192
|
value: "solid"
|
|
191
193
|
}, {
|
|
192
194
|
label: "虚线",
|
|
193
195
|
value: "dashed"
|
|
194
|
-
}],
|
|
196
|
+
}], zr = [
|
|
195
197
|
{
|
|
196
198
|
label: "完整显示",
|
|
197
199
|
value: "contain"
|
|
@@ -204,76 +206,76 @@ var Lt = {
|
|
|
204
206
|
label: "拉伸填充",
|
|
205
207
|
value: "fill"
|
|
206
208
|
}
|
|
207
|
-
],
|
|
209
|
+
], Br = f(() => Te(l.pageSizeOptions)), Vr = f(() => Br.value.map((e) => ({
|
|
208
210
|
label: `${e.label} · ${e.width} × ${e.height}`,
|
|
209
211
|
value: Ce(e)
|
|
210
|
-
}))),
|
|
212
|
+
}))), Hr = f(() => Ce(wr.value)), Ur = f(() => o({ showSigningPlacementTools: l.showSigningPlacementTools })), Wr = f(() => l.variableTypes.filter((t) => e(t?.type))), Gr = f(() => Wr.value.map((e) => ({
|
|
211
213
|
...e,
|
|
212
|
-
icon:
|
|
213
|
-
}))),
|
|
214
|
-
let e = he(
|
|
215
|
-
return Array.from(oe(
|
|
216
|
-
}), { scheduleAutoPaginate:
|
|
217
|
-
templateValue:
|
|
218
|
-
readonlyState:
|
|
219
|
-
isAutoPaginating:
|
|
220
|
-
pendingPaginationPageId:
|
|
221
|
-
activePageId:
|
|
222
|
-
normalizedMaxPages:
|
|
223
|
-
pageRefs:
|
|
224
|
-
syncPageEditors:
|
|
225
|
-
commitBodyChange:
|
|
226
|
-
getPageSize:
|
|
227
|
-
notifyPageLimit:
|
|
228
|
-
}), { insertSigningPlacement:
|
|
229
|
-
templateValue:
|
|
230
|
-
signingPlacements:
|
|
231
|
-
selectedSigningPlacement:
|
|
232
|
-
selectedSigningPlacementId:
|
|
233
|
-
selectedPage:
|
|
234
|
-
activePageId:
|
|
214
|
+
icon: ut(e.type)
|
|
215
|
+
}))), Kr = f(() => we(l.maxPages)), qr = f(() => E.value.pages.length >= Kr.value), Jr = f(() => {
|
|
216
|
+
let e = he(E.value);
|
|
217
|
+
return Array.from(oe(E.value.pageDecorations)).filter((t) => !e.has(t));
|
|
218
|
+
}), { scheduleAutoPaginate: J } = Xe({
|
|
219
|
+
templateValue: E,
|
|
220
|
+
readonlyState: W,
|
|
221
|
+
isAutoPaginating: wn,
|
|
222
|
+
pendingPaginationPageId: Tn,
|
|
223
|
+
activePageId: k,
|
|
224
|
+
normalizedMaxPages: Kr,
|
|
225
|
+
pageRefs: M,
|
|
226
|
+
syncPageEditors: Ei,
|
|
227
|
+
commitBodyChange: zi,
|
|
228
|
+
getPageSize: Vi,
|
|
229
|
+
notifyPageLimit: Yi
|
|
230
|
+
}), { insertSigningPlacement: Yr, handleSigningPlacementDrop: Xr, insertSigningPlacementTool: Zr, handleSigningPlacementDragStart: Qr, updateSigningPlacement: $r, patchSelectedSigningPlacement: ei, duplicateSigningPlacement: ti, removeSigningPlacement: ni } = lt({
|
|
231
|
+
templateValue: E,
|
|
232
|
+
signingPlacements: K,
|
|
233
|
+
selectedSigningPlacement: xr,
|
|
234
|
+
selectedSigningPlacementId: O,
|
|
235
|
+
selectedPage: q,
|
|
236
|
+
activePageId: k,
|
|
235
237
|
readonly: () => l.readonly,
|
|
236
238
|
disabled: () => l.disabled,
|
|
237
239
|
showSigningPlacementTools: () => !!l.showSigningPlacementTools,
|
|
238
|
-
getPageSize:
|
|
239
|
-
getVisiblePosition: (e, t) =>
|
|
240
|
-
commitSigningPlacements:
|
|
240
|
+
getPageSize: Vi,
|
|
241
|
+
getVisiblePosition: (e, t) => M.get(e)?.getVisibleSigningPlacementPosition(t),
|
|
242
|
+
commitSigningPlacements: qi,
|
|
241
243
|
selectSigningPlacement: Q,
|
|
242
|
-
emitAdd: (e) =>
|
|
243
|
-
emitChange: (e) =>
|
|
244
|
-
emitRemove: (e) =>
|
|
245
|
-
}), { saveDraftCache:
|
|
246
|
-
draftCacheWritable:
|
|
247
|
-
multipleFilesMode:
|
|
248
|
-
filesValue:
|
|
249
|
-
activeFileIdValue:
|
|
250
|
-
templateValue:
|
|
251
|
-
draftCacheKey:
|
|
244
|
+
emitAdd: (e) => h("signing-placement-add", e),
|
|
245
|
+
emitChange: (e) => h("signing-placement-change", e),
|
|
246
|
+
emitRemove: (e) => h("signing-placement-remove", e)
|
|
247
|
+
}), { saveDraftCache: ri, loadDraftCache: ii, clearDraftCache: ai, restoreDraftCacheIfNeeded: oi, stopDraftCacheTimer: si, restartDraftCacheTimer: ci, resetDraftFingerprint: li } = st({
|
|
248
|
+
draftCacheWritable: hr,
|
|
249
|
+
multipleFilesMode: x,
|
|
250
|
+
filesValue: S,
|
|
251
|
+
activeFileIdValue: C,
|
|
252
|
+
templateValue: E,
|
|
253
|
+
draftCacheKey: _r,
|
|
252
254
|
draftCacheInterval: () => l.draftCacheInterval,
|
|
253
255
|
draftCacheMaxBytes: () => l.draftCacheMaxBytes,
|
|
254
256
|
pageSize: () => l.pageSize,
|
|
255
257
|
pageSizeOptions: () => l.pageSizeOptions,
|
|
256
|
-
syncActiveFileSnapshot:
|
|
257
|
-
syncPageEditors:
|
|
258
|
-
setActiveFileId:
|
|
259
|
-
emitFilesChange:
|
|
260
|
-
commit:
|
|
258
|
+
syncActiveFileSnapshot: Y,
|
|
259
|
+
syncPageEditors: Ei,
|
|
260
|
+
setActiveFileId: Ni,
|
|
261
|
+
emitFilesChange: Mi,
|
|
262
|
+
commit: X,
|
|
261
263
|
setSigningPlacementInputErrorsByFile: (e) => {
|
|
262
|
-
|
|
264
|
+
w.value = e;
|
|
263
265
|
},
|
|
264
|
-
buildSigningPlacementInputErrorsByFile:
|
|
265
|
-
updateDraftCacheStatus:
|
|
266
|
-
scheduleAutoPaginate:
|
|
267
|
-
activePageId:
|
|
268
|
-
selectedVariableKey:
|
|
269
|
-
}),
|
|
270
|
-
let e =
|
|
266
|
+
buildSigningPlacementInputErrorsByFile: pn,
|
|
267
|
+
updateDraftCacheStatus: Pi,
|
|
268
|
+
scheduleAutoPaginate: J,
|
|
269
|
+
activePageId: k,
|
|
270
|
+
selectedVariableKey: D
|
|
271
|
+
}), ui = f(() => {
|
|
272
|
+
let e = tr.value.trim().toLowerCase(), t = E.value.variables;
|
|
271
273
|
return e ? t.filter((t) => t.label.toLowerCase().includes(e) || t.key.toLowerCase().includes(e)) : t;
|
|
272
|
-
}),
|
|
274
|
+
}), di = f(() => Math.max(Xt, wr.value.width - Jt)), fi = f(() => Math.max(Zt, wr.value.height - Yt)), pi = f(() => zn.value[k.value] ?? xi()), mi = f(() => pi.value.hasMixedBlockFormats ? void 0 : pi.value.currentHeadingLevel ?? "paragraph"), hi = f(() => pi.value.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif"), gi = f(() => pi.value.fontSize ?? de.fontSize ?? 14), _i = f(() => pi.value.textColor || de.color || "#1f2937"), vi = f(() => G.value?.style?.fontFamily || de.fontFamily || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif"), yi = f(() => {
|
|
273
275
|
let e = re.map((e) => ({
|
|
274
276
|
label: `${e}px`,
|
|
275
277
|
value: e
|
|
276
|
-
})), t =
|
|
278
|
+
})), t = Ti(gi.value), n = Ti(Bn.value), r = /* @__PURE__ */ new Map();
|
|
277
279
|
return n && !re.includes(n) && r.set(n, {
|
|
278
280
|
label: `使用 ${n}px`,
|
|
279
281
|
value: n
|
|
@@ -282,78 +284,86 @@ var Lt = {
|
|
|
282
284
|
value: t
|
|
283
285
|
}), [...Array.from(r.values()), ...e];
|
|
284
286
|
});
|
|
285
|
-
|
|
286
|
-
if (!e ||
|
|
287
|
-
let t = Ee(e, l.pageSize), n = ge(t, l.pageSizeOptions), r = n.value, i = d(r) !== d(
|
|
288
|
-
o && (
|
|
289
|
-
...
|
|
290
|
-
[
|
|
291
|
-
},
|
|
292
|
-
}, { deep: !0 }),
|
|
287
|
+
b(() => l.modelValue, (e) => {
|
|
288
|
+
if (!e || x.value) return;
|
|
289
|
+
let t = Ee(e, l.pageSize), n = ge(t, l.pageSizeOptions), r = n.value, i = d(r) !== d(E.value), a = d(r), o = a === hn;
|
|
290
|
+
o && (hn = ""), (i || !o) && (T.value = fn(e), w.value = {
|
|
291
|
+
...w.value,
|
|
292
|
+
[C.value]: T.value
|
|
293
|
+
}, E.value = r, S.value = at(S.value, C.value, r), k.value = r.pages[0]?.id ?? "", D.value = "", O.value = "", J(k.value)), d(r) !== d(t) && (hn = a, h("update:modelValue", c(r)), h("change", c(r)), Ui(n.resizedSigningPlacementIds, r));
|
|
294
|
+
}, { deep: !0 }), b(() => l.files, (e) => {
|
|
293
295
|
if (!Array.isArray(e)) return;
|
|
294
|
-
let t =
|
|
295
|
-
a || (
|
|
296
|
-
let o =
|
|
297
|
-
if (r === i ? o !==
|
|
296
|
+
let t = nt(e, void 0, l.pageSize), n = Qe(t, l.pageSizeOptions).files, r = d(n), i = d(S.value), a = r === mn;
|
|
297
|
+
a || (w.value = pn(n, e)), a && (mn = "");
|
|
298
|
+
let o = ot(n, l.activeFileId || C.value);
|
|
299
|
+
if (r === i ? o !== C.value && Ni(o, {
|
|
298
300
|
syncCurrent: !1,
|
|
299
301
|
shouldEmit: !1
|
|
300
|
-
}) : (
|
|
302
|
+
}) : (S.value = n, Ni(o, {
|
|
301
303
|
syncCurrent: !1,
|
|
302
304
|
shouldEmit: !1,
|
|
303
305
|
forceRefresh: !0,
|
|
304
306
|
persistCurrentErrors: !1
|
|
305
307
|
})), r !== d(t)) {
|
|
306
308
|
let e = u(n);
|
|
307
|
-
|
|
309
|
+
mn = d(e), h("update:files", e), h("files-change", u(e));
|
|
308
310
|
}
|
|
309
|
-
}, { deep: !0 }),
|
|
310
|
-
!
|
|
311
|
+
}, { deep: !0 }), b(() => l.activeFileId, (e) => {
|
|
312
|
+
!x.value || !e || e === C.value || Ni(e, {
|
|
311
313
|
syncCurrent: !0,
|
|
312
314
|
shouldEmit: !1
|
|
313
315
|
});
|
|
314
316
|
});
|
|
315
|
-
function
|
|
316
|
-
let n = d(
|
|
317
|
-
|
|
318
|
-
let { files: r, resizedSigningPlacementIds: i } =
|
|
319
|
-
o && d(o.template) !== d(
|
|
320
|
-
let ee = i.get(
|
|
321
|
-
return ee?.length && o &&
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
if (
|
|
325
|
-
|
|
317
|
+
function bi(e, t) {
|
|
318
|
+
let n = d(S.value);
|
|
319
|
+
Y(!1);
|
|
320
|
+
let { files: r, resizedSigningPlacementIds: i } = Qe(nt(S.value, void 0, e), t), a = d(r) !== n, o = r.find((e) => e.id === C.value);
|
|
321
|
+
o && d(o.template) !== d(E.value) && (E.value = c(o.template), T.value = [...w.value[C.value] ?? []]), a && (A.value = !1, j.value = [], Mi(r, ""));
|
|
322
|
+
let ee = i.get(C.value);
|
|
323
|
+
return ee?.length && o && Ui(ee, o.template), a;
|
|
324
|
+
}
|
|
325
|
+
b([() => l.pageSize, () => l.pageSizeOptions], ([e, t]) => {
|
|
326
|
+
if (x.value) {
|
|
327
|
+
bi(e, t), J(k.value);
|
|
326
328
|
return;
|
|
327
329
|
}
|
|
328
|
-
let n = ge(Ee(
|
|
329
|
-
d(n.value) !== d(
|
|
330
|
-
}, { deep: !0 }),
|
|
331
|
-
|
|
332
|
-
}),
|
|
333
|
-
e && ($(),
|
|
334
|
-
}),
|
|
335
|
-
|
|
336
|
-
}
|
|
330
|
+
let n = ge(Ee(E.value, e), t);
|
|
331
|
+
d(n.value) !== d(E.value) && X(n.value), J(k.value);
|
|
332
|
+
}, { deep: !0 }), b(Kr, () => {
|
|
333
|
+
J(E.value.pages[0]?.id);
|
|
334
|
+
}), b(W, (e) => {
|
|
335
|
+
e && ($(), I.value = !1, L.value = !1);
|
|
336
|
+
}), b(k, () => {
|
|
337
|
+
z.value = void 0;
|
|
338
|
+
}), b([
|
|
339
|
+
mr,
|
|
340
|
+
F,
|
|
341
|
+
En
|
|
342
|
+
], () => {
|
|
343
|
+
cs();
|
|
344
|
+
}), b(K, (e) => {
|
|
345
|
+
O.value && !e.some((e) => e.id === O.value) && (O.value = "", h("signing-placement-select", void 0));
|
|
346
|
+
}, { deep: !0 }), b(() => [
|
|
337
347
|
l.enableDraftCache,
|
|
338
|
-
|
|
348
|
+
_r.value,
|
|
339
349
|
l.draftCacheInterval,
|
|
340
|
-
|
|
350
|
+
W.value
|
|
341
351
|
], () => {
|
|
342
|
-
|
|
343
|
-
}),
|
|
352
|
+
li(), ci();
|
|
353
|
+
}), b(P, (e) => {
|
|
344
354
|
if (!(typeof document > "u")) {
|
|
345
355
|
if (e) {
|
|
346
|
-
|
|
356
|
+
lr = document.body.style.overflow, document.body.style.overflow = "hidden";
|
|
347
357
|
return;
|
|
348
358
|
}
|
|
349
|
-
document.body.style.overflow =
|
|
359
|
+
document.body.style.overflow = lr ?? "", lr = void 0;
|
|
350
360
|
}
|
|
351
|
-
}), Ot(() => {
|
|
352
|
-
Wr(), Kr(), G(D.value), window.addEventListener("pointerdown", Fo, !0), window.addEventListener("keydown", Ro, !0), window.addEventListener("keydown", zo), window.addEventListener("resize", $), window.addEventListener("scroll", Io, !0);
|
|
353
361
|
}), Dt(() => {
|
|
354
|
-
|
|
362
|
+
oi(), ci(), J(k.value), window.addEventListener("pointerdown", gs, !0), window.addEventListener("pointerup", ps), window.addEventListener("keydown", ys, !0), window.addEventListener("keydown", bs), window.addEventListener("resize", ms), window.addEventListener("scroll", _s, !0);
|
|
363
|
+
}), Et(() => {
|
|
364
|
+
Oi(), dr = !0, P.value && typeof document < "u" && (document.body.style.overflow = lr ?? ""), window.removeEventListener("pointerdown", gs, !0), window.removeEventListener("pointerup", ps), window.removeEventListener("keydown", ys, !0), window.removeEventListener("keydown", bs), window.removeEventListener("resize", ms), window.removeEventListener("scroll", _s, !0), $n !== void 0 && cancelAnimationFrame($n), si();
|
|
355
365
|
});
|
|
356
|
-
function
|
|
366
|
+
function xi() {
|
|
357
367
|
return {
|
|
358
368
|
isFocused: !1,
|
|
359
369
|
canUndo: !1,
|
|
@@ -372,27 +382,27 @@ var Lt = {
|
|
|
372
382
|
hasMixedBlockFormats: !1
|
|
373
383
|
};
|
|
374
384
|
}
|
|
375
|
-
function
|
|
385
|
+
function Si(e) {
|
|
376
386
|
return e === "left" || e === "center" || e === "right";
|
|
377
387
|
}
|
|
378
|
-
function
|
|
388
|
+
function Ci(e) {
|
|
379
389
|
return typeof e == "number" && Number.isInteger(e) && e >= 1 && e <= 6;
|
|
380
390
|
}
|
|
381
|
-
function
|
|
391
|
+
function wi(e, t = gi.value) {
|
|
382
392
|
let n = Number(e);
|
|
383
|
-
return Number.isFinite(n) ? Math.min(
|
|
393
|
+
return Number.isFinite(n) ? Math.min($t, Math.max(Qt, Math.round(n))) : t;
|
|
384
394
|
}
|
|
385
|
-
function
|
|
395
|
+
function Ti(e) {
|
|
386
396
|
let t = String(e || "").trim().match(/(\d+(\.\d+)?)/);
|
|
387
397
|
if (!t) return;
|
|
388
398
|
let n = Number(t[1]);
|
|
389
|
-
if (Number.isFinite(n)) return Math.min(
|
|
399
|
+
if (Number.isFinite(n)) return Math.min($t, Math.max(Qt, Math.round(n)));
|
|
390
400
|
}
|
|
391
|
-
function
|
|
401
|
+
function Ei(e = E.value) {
|
|
392
402
|
return {
|
|
393
403
|
...e,
|
|
394
404
|
pages: e.pages.map((e) => {
|
|
395
|
-
let t =
|
|
405
|
+
let t = M.get(e.id);
|
|
396
406
|
return {
|
|
397
407
|
...e,
|
|
398
408
|
contentHtml: t?.getHTML() ?? e.contentHtml,
|
|
@@ -401,204 +411,204 @@ var Lt = {
|
|
|
401
411
|
})
|
|
402
412
|
};
|
|
403
413
|
}
|
|
404
|
-
function
|
|
405
|
-
|
|
414
|
+
function Di() {
|
|
415
|
+
fr = !1, pr &&= (clearTimeout(pr), void 0);
|
|
406
416
|
}
|
|
407
|
-
function
|
|
408
|
-
let e =
|
|
409
|
-
|
|
417
|
+
function Oi() {
|
|
418
|
+
let e = fr;
|
|
419
|
+
Di(), e && ji();
|
|
410
420
|
}
|
|
411
|
-
function
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
},
|
|
421
|
+
function ki() {
|
|
422
|
+
fr = !0, pr && clearTimeout(pr), pr = setTimeout(() => {
|
|
423
|
+
pr = void 0, !(!fr || dr) && (fr = !1, ji());
|
|
424
|
+
}, qt);
|
|
415
425
|
}
|
|
416
|
-
function
|
|
417
|
-
let t =
|
|
426
|
+
function Ai(e) {
|
|
427
|
+
let t = E.value.pages, n = t.findIndex((t) => t.id === e.id);
|
|
418
428
|
if (n < 0) return;
|
|
419
429
|
let r = t[n];
|
|
420
430
|
if (r.contentHtml === e.contentHtml && r.contentJson === e.contentJson && r.title === e.title && r.pageSize === e.pageSize) return;
|
|
421
431
|
let i = t.slice();
|
|
422
|
-
i[n] = e,
|
|
423
|
-
...
|
|
432
|
+
i[n] = e, E.value = {
|
|
433
|
+
...E.value,
|
|
424
434
|
pages: i
|
|
425
435
|
};
|
|
426
436
|
}
|
|
427
|
-
function
|
|
428
|
-
let e = Oe(
|
|
429
|
-
|
|
430
|
-
}
|
|
431
|
-
function
|
|
432
|
-
|
|
433
|
-
let t = c(
|
|
434
|
-
if (!
|
|
435
|
-
let n =
|
|
436
|
-
return
|
|
437
|
-
}
|
|
438
|
-
function
|
|
439
|
-
if (!
|
|
437
|
+
function ji() {
|
|
438
|
+
let e = Oe(Ei());
|
|
439
|
+
D.value && !e.variables.some((e) => e.key === D.value) && (D.value = ""), X(e);
|
|
440
|
+
}
|
|
441
|
+
function Y(e = !1) {
|
|
442
|
+
Oi();
|
|
443
|
+
let t = c(Ei());
|
|
444
|
+
if (!x.value) return t;
|
|
445
|
+
let n = S.value.find((e) => e.id === C.value)?.template, r = d(n) !== d(t), i = at(S.value, C.value, t);
|
|
446
|
+
return S.value = i, r && e && Mi(i), t;
|
|
447
|
+
}
|
|
448
|
+
function Mi(e, t = C.value) {
|
|
449
|
+
if (!x.value) return;
|
|
440
450
|
let n = u(e);
|
|
441
|
-
|
|
451
|
+
S.value = n, mn = d(n), h("update:files", u(n)), h("files-change", u(n));
|
|
442
452
|
let r = n.find((e) => e.id === t);
|
|
443
|
-
r &&
|
|
444
|
-
}
|
|
445
|
-
function
|
|
446
|
-
let { syncCurrent: n, shouldEmit: r, forceRefresh: i, persistCurrentErrors: a } =
|
|
447
|
-
if (a &&
|
|
448
|
-
...
|
|
449
|
-
[
|
|
450
|
-
}), n ?
|
|
451
|
-
let te =
|
|
452
|
-
te && (
|
|
453
|
-
|
|
453
|
+
r && h("file-change", u([r])[0]);
|
|
454
|
+
}
|
|
455
|
+
function Ni(e, t = {}) {
|
|
456
|
+
let { syncCurrent: n, shouldEmit: r, forceRefresh: i, persistCurrentErrors: a } = Ze(t), o = ot(S.value, e), ee = o !== C.value;
|
|
457
|
+
if (a && x.value && C.value && (w.value = {
|
|
458
|
+
...w.value,
|
|
459
|
+
[C.value]: [...T.value]
|
|
460
|
+
}), n ? Y(!0) : Di(), !ee && !i) return;
|
|
461
|
+
let te = S.value.find((e) => e.id === o);
|
|
462
|
+
te && (C.value = o, E.value = c(te.template), T.value = [...w.value[o] ?? []], D.value = "", O.value = "", k.value = E.value.pages[0]?.id ?? "", zn.value = {}, M.clear(), Tn.value = "", A.value = !1, j.value = [], En.value = !1, Dn.value = void 0, On.value = void 0, li(), r && ee && h("update:activeFileId", o), n && ee && hr.value && ri(), g(() => {
|
|
463
|
+
J(k.value);
|
|
454
464
|
}));
|
|
455
465
|
}
|
|
456
|
-
function
|
|
457
|
-
|
|
466
|
+
function X(e) {
|
|
467
|
+
Di();
|
|
458
468
|
let t = ge(Ee(e, l.pageSize), l.pageSizeOptions), n = t.value;
|
|
459
|
-
return
|
|
469
|
+
return E.value = n, A.value = !1, j.value = [], x.value ? Mi(at(S.value, C.value, n)) : (S.value = at(S.value, C.value, n), hn = d(n), h("update:modelValue", c(n)), h("change", c(n))), Ui(t.resizedSigningPlacementIds, n), n;
|
|
460
470
|
}
|
|
461
|
-
function
|
|
462
|
-
|
|
471
|
+
function Pi(e, t = e.type !== "unchanged") {
|
|
472
|
+
U.value = e, t && h("draft-cache-change", { ...e });
|
|
463
473
|
}
|
|
464
|
-
function
|
|
465
|
-
return { ...
|
|
474
|
+
function Fi() {
|
|
475
|
+
return { ...U.value };
|
|
466
476
|
}
|
|
467
|
-
function
|
|
468
|
-
t ?
|
|
477
|
+
function Ii(e, t) {
|
|
478
|
+
t ? M.set(e, t) : M.delete(e);
|
|
469
479
|
}
|
|
470
|
-
function
|
|
471
|
-
|
|
480
|
+
function Z(e, t = q.value?.id ?? k.value) {
|
|
481
|
+
W.value || M.get(t)?.runCommand(e);
|
|
472
482
|
}
|
|
473
|
-
function
|
|
474
|
-
|
|
483
|
+
function Li(e) {
|
|
484
|
+
Z(e), $();
|
|
475
485
|
}
|
|
476
|
-
function
|
|
477
|
-
let t =
|
|
478
|
-
t && (
|
|
486
|
+
function Ri(e) {
|
|
487
|
+
let t = R.value?.pageId;
|
|
488
|
+
t && (M.get(t)?.focus(), H.value = typeof document < "u" && document.execCommand(e) ? `${e === "copy" ? "已复制" : e === "cut" ? "已剪切" : "已粘贴"}` : "浏览器未授权剪贴板操作,请使用系统快捷键。", $());
|
|
479
489
|
}
|
|
480
|
-
function
|
|
481
|
-
let t =
|
|
482
|
-
return
|
|
490
|
+
function zi(e) {
|
|
491
|
+
let t = X(Oe(e));
|
|
492
|
+
return D.value && !t.variables.some((e) => e.key === D.value) && (D.value = ""), t;
|
|
483
493
|
}
|
|
484
|
-
function
|
|
485
|
-
|
|
494
|
+
function Bi(e) {
|
|
495
|
+
Ai(e), ki(), J(e.id);
|
|
486
496
|
}
|
|
487
|
-
function
|
|
488
|
-
return De(e?.pageSize,
|
|
497
|
+
function Vi(e) {
|
|
498
|
+
return De(e?.pageSize, E.value.pageSize);
|
|
489
499
|
}
|
|
490
|
-
function
|
|
491
|
-
return
|
|
500
|
+
function Hi(e) {
|
|
501
|
+
return K.value.filter((t) => t.pageId === e);
|
|
492
502
|
}
|
|
493
|
-
function
|
|
503
|
+
function Ui(e, t = E.value) {
|
|
494
504
|
let n = new Set(e);
|
|
495
|
-
n.size && (
|
|
505
|
+
n.size && (Gi(n), (t.signingPlacements ?? []).filter((e) => n.has(e.id)).forEach((e) => h("signing-placement-change", ct(e))));
|
|
496
506
|
}
|
|
497
507
|
function Q(e) {
|
|
498
|
-
let t = e ?
|
|
499
|
-
|
|
508
|
+
let t = e ? K.value.find((t) => t.id === e) : void 0;
|
|
509
|
+
O.value = t?.id ?? "", t && (D.value = "", k.value = t.pageId), h("signing-placement-select", t ? ct(t) : void 0);
|
|
500
510
|
}
|
|
501
|
-
function
|
|
511
|
+
function Wi(e) {
|
|
502
512
|
Q(e.id);
|
|
503
513
|
}
|
|
504
|
-
function
|
|
514
|
+
function Gi(e) {
|
|
505
515
|
let t = new Set(e);
|
|
506
516
|
if (!t.size) return;
|
|
507
|
-
let n =
|
|
508
|
-
|
|
509
|
-
...
|
|
510
|
-
[
|
|
517
|
+
let n = T.value.filter((e) => e.type !== "signing-placement" || !t.has(e.id));
|
|
518
|
+
T.value = n, w.value = {
|
|
519
|
+
...w.value,
|
|
520
|
+
[C.value]: n
|
|
511
521
|
};
|
|
512
522
|
}
|
|
513
|
-
function
|
|
514
|
-
let t =
|
|
515
|
-
|
|
516
|
-
...
|
|
517
|
-
[
|
|
523
|
+
function Ki(e) {
|
|
524
|
+
let t = T.value.filter((t) => t.type !== "signing-placement" || t.pageId !== e);
|
|
525
|
+
T.value = t, w.value = {
|
|
526
|
+
...w.value,
|
|
527
|
+
[C.value]: t
|
|
518
528
|
};
|
|
519
529
|
}
|
|
520
|
-
function
|
|
521
|
-
return
|
|
522
|
-
...
|
|
530
|
+
function qi(e, t = []) {
|
|
531
|
+
return Gi(t), X({
|
|
532
|
+
...E.value,
|
|
523
533
|
signingPlacements: e
|
|
524
534
|
});
|
|
525
535
|
}
|
|
526
|
-
function
|
|
527
|
-
if (
|
|
528
|
-
let t =
|
|
536
|
+
function Ji(e) {
|
|
537
|
+
if (W.value || !q.value) return;
|
|
538
|
+
let t = Br.value.find((t) => Ce(t) === e);
|
|
529
539
|
if (!t) return;
|
|
530
|
-
let n =
|
|
531
|
-
|
|
532
|
-
...
|
|
533
|
-
pages:
|
|
540
|
+
let n = q.value.id, r = Vi(q.value), i = De(t, E.value.pageSize), a = K.value.map((e) => e.pageId === n ? ee(e, r, i) : e);
|
|
541
|
+
Gi(a.filter((e) => e.pageId === n).map((e) => e.id)), X({
|
|
542
|
+
...E.value,
|
|
543
|
+
pages: E.value.pages.map((e) => e.id === n ? {
|
|
534
544
|
...e,
|
|
535
545
|
pageSize: i
|
|
536
546
|
} : e),
|
|
537
547
|
signingPlacements: a
|
|
538
|
-
}), a.filter((e) => e.pageId === n).forEach((e) =>
|
|
548
|
+
}), a.filter((e) => e.pageId === n).forEach((e) => h("signing-placement-change", ct(e))), J(n);
|
|
539
549
|
}
|
|
540
|
-
function
|
|
541
|
-
let t =
|
|
542
|
-
|
|
550
|
+
function Yi(e) {
|
|
551
|
+
let t = Kr.value;
|
|
552
|
+
H.value = `合同最多支持 ${t} 页`, h("page-limit", t, e);
|
|
543
553
|
}
|
|
544
|
-
function
|
|
545
|
-
if (
|
|
546
|
-
if (
|
|
547
|
-
|
|
554
|
+
function Xi() {
|
|
555
|
+
if (W.value) return;
|
|
556
|
+
if (qr.value) {
|
|
557
|
+
Yi("add");
|
|
548
558
|
return;
|
|
549
559
|
}
|
|
550
|
-
let e = ye(
|
|
551
|
-
|
|
552
|
-
...
|
|
553
|
-
pages: [...
|
|
554
|
-
}),
|
|
555
|
-
}
|
|
556
|
-
function
|
|
557
|
-
if (
|
|
558
|
-
if (
|
|
559
|
-
|
|
560
|
+
let e = ye(E.value.pages.length + 1, wr.value);
|
|
561
|
+
X({
|
|
562
|
+
...E.value,
|
|
563
|
+
pages: [...E.value.pages, e]
|
|
564
|
+
}), k.value = e.id;
|
|
565
|
+
}
|
|
566
|
+
function Zi(e) {
|
|
567
|
+
if (W.value) return;
|
|
568
|
+
if (qr.value) {
|
|
569
|
+
Yi("duplicate");
|
|
560
570
|
return;
|
|
561
571
|
}
|
|
562
|
-
let t =
|
|
572
|
+
let t = E.value.pages.findIndex((t) => t.id === e.id);
|
|
563
573
|
if (t < 0) return;
|
|
564
574
|
let n = c({
|
|
565
575
|
pages: [e],
|
|
566
576
|
variables: [],
|
|
567
|
-
pageSize:
|
|
577
|
+
pageSize: E.value.pageSize,
|
|
568
578
|
signingPlacements: []
|
|
569
|
-
}).pages[0], r = _e(t + 2,
|
|
579
|
+
}).pages[0], r = _e(t + 2, Vi(e), n.contentHtml, n.contentJson);
|
|
570
580
|
r.title = `${e.title || `第 ${t + 1} 页`}副本`;
|
|
571
|
-
let i = [...
|
|
581
|
+
let i = [...E.value.pages];
|
|
572
582
|
i.splice(t + 1, 0, r);
|
|
573
|
-
let o =
|
|
574
|
-
...
|
|
583
|
+
let o = Hi(e.id).map((e) => a(e.type, r.id, Vi(r), {
|
|
584
|
+
...ct(e),
|
|
575
585
|
id: void 0,
|
|
576
586
|
pageId: r.id
|
|
577
587
|
}));
|
|
578
|
-
|
|
579
|
-
...
|
|
588
|
+
X({
|
|
589
|
+
...E.value,
|
|
580
590
|
pages: i,
|
|
581
|
-
signingPlacements: [...
|
|
582
|
-
}),
|
|
591
|
+
signingPlacements: [...K.value, ...o]
|
|
592
|
+
}), k.value = r.id, o.forEach((e) => h("signing-placement-add", ct(e))), o[0] && Q(o[0].id);
|
|
583
593
|
}
|
|
584
|
-
function
|
|
585
|
-
if (
|
|
586
|
-
let t =
|
|
594
|
+
function Qi(e) {
|
|
595
|
+
if (W.value || E.value.pages.length <= 1) return;
|
|
596
|
+
let t = E.value.pages.findIndex((t) => t.id === e.id);
|
|
587
597
|
if (t < 0) return;
|
|
588
|
-
let n =
|
|
589
|
-
|
|
590
|
-
let r =
|
|
591
|
-
...
|
|
598
|
+
let n = Hi(e.id);
|
|
599
|
+
Ki(e.id);
|
|
600
|
+
let r = E.value.pages.filter((t) => t.id !== e.id), i = zi({
|
|
601
|
+
...E.value,
|
|
592
602
|
pages: r,
|
|
593
|
-
signingPlacements:
|
|
603
|
+
signingPlacements: K.value.filter((t) => t.pageId !== e.id)
|
|
594
604
|
});
|
|
595
|
-
|
|
605
|
+
k.value = i.pages[Math.min(t, i.pages.length - 1)]?.id ?? "", n.some((e) => e.id === O.value) && Q(), n.forEach((e) => h("signing-placement-remove", ct(e)));
|
|
596
606
|
}
|
|
597
|
-
function
|
|
598
|
-
if (
|
|
599
|
-
let t =
|
|
607
|
+
function $i(e) {
|
|
608
|
+
if (W.value || E.value.pages.length <= 1) return;
|
|
609
|
+
let t = Hi(e.id).length;
|
|
600
610
|
if (!t) {
|
|
601
|
-
|
|
611
|
+
Qi(e);
|
|
602
612
|
return;
|
|
603
613
|
}
|
|
604
614
|
Ft.confirm({
|
|
@@ -608,34 +618,34 @@ var Lt = {
|
|
|
608
618
|
okType: "danger",
|
|
609
619
|
cancelText: "取消",
|
|
610
620
|
onOk: () => {
|
|
611
|
-
|
|
621
|
+
Qi(e);
|
|
612
622
|
}
|
|
613
623
|
});
|
|
614
624
|
}
|
|
615
|
-
function
|
|
616
|
-
let t = new Set(
|
|
625
|
+
function ea(e) {
|
|
626
|
+
let t = new Set(E.value.variables.map((e) => e.key)), n = 1;
|
|
617
627
|
for (; t.has(`${e}_${n}`);) n += 1;
|
|
618
628
|
return `${e}_${n}`;
|
|
619
629
|
}
|
|
620
|
-
function
|
|
630
|
+
function ta(e) {
|
|
621
631
|
let t = e.type ?? "text";
|
|
622
632
|
return be({
|
|
623
633
|
...e,
|
|
624
634
|
type: t,
|
|
625
|
-
key: e.key ||
|
|
635
|
+
key: e.key || ea(t),
|
|
626
636
|
label: e.label || Se(t, l.variableTypes).label
|
|
627
637
|
}, l.variableTypes, l.defaultVariableStyle);
|
|
628
638
|
}
|
|
629
|
-
function
|
|
630
|
-
if (
|
|
631
|
-
let r =
|
|
632
|
-
return
|
|
633
|
-
...
|
|
634
|
-
pages: r ?
|
|
635
|
-
variables: i ? [...
|
|
636
|
-
}),
|
|
639
|
+
function na(e, t = q.value?.id ?? E.value.pages[0].id, n) {
|
|
640
|
+
if (W.value) return e;
|
|
641
|
+
let r = M.get(t)?.insertVariable(e, n), i = !E.value.variables.some((t) => t.key === e.key);
|
|
642
|
+
return X({
|
|
643
|
+
...E.value,
|
|
644
|
+
pages: r ? E.value.pages.map((e) => e.id === r.id ? r : e) : E.value.pages,
|
|
645
|
+
variables: i ? [...E.value.variables, e] : E.value.variables
|
|
646
|
+
}), D.value = e.key, Q(), k.value = t, i && h("variable-add", e), J(t), e;
|
|
637
647
|
}
|
|
638
|
-
function
|
|
648
|
+
function ra(e) {
|
|
639
649
|
let { width: t, height: n, ...r } = e, i = Ne(t), a = Ne(n);
|
|
640
650
|
return {
|
|
641
651
|
...r,
|
|
@@ -643,96 +653,96 @@ var Lt = {
|
|
|
643
653
|
...a === void 0 ? {} : { height: a }
|
|
644
654
|
};
|
|
645
655
|
}
|
|
646
|
-
function
|
|
647
|
-
let t = Ne(
|
|
656
|
+
function ia(e = {}) {
|
|
657
|
+
let t = Ne(Wn.value), n = Ne(Gn.value);
|
|
648
658
|
return {
|
|
649
659
|
...e,
|
|
650
660
|
...t === void 0 ? {} : { width: t },
|
|
651
661
|
...n === void 0 ? {} : { height: n }
|
|
652
662
|
};
|
|
653
663
|
}
|
|
654
|
-
function
|
|
655
|
-
|
|
664
|
+
function aa() {
|
|
665
|
+
Un.value = "", Wn.value = void 0, Gn.value = void 0, Kn.value = "";
|
|
656
666
|
}
|
|
657
|
-
function
|
|
658
|
-
let r =
|
|
667
|
+
function oa(e, t = q.value?.id ?? E.value.pages[0]?.id, n) {
|
|
668
|
+
let r = ra({
|
|
659
669
|
...e,
|
|
660
670
|
src: e.src.trim()
|
|
661
671
|
});
|
|
662
|
-
if (!(
|
|
672
|
+
if (!(W.value || !t || !je(r.src) || !r.src || !M.get(t)?.insertContentImage(r, n))) return k.value = t, D.value = "", Q(), r.src;
|
|
663
673
|
}
|
|
664
|
-
function
|
|
674
|
+
function sa(e) {
|
|
665
675
|
return e instanceof Error ? e : /* @__PURE__ */ Error("图片处理失败");
|
|
666
676
|
}
|
|
667
|
-
async function
|
|
668
|
-
t === "toolbar" && (
|
|
677
|
+
async function ca(e, t) {
|
|
678
|
+
t === "toolbar" && (qn.value = !0, Kn.value = "");
|
|
669
679
|
try {
|
|
670
680
|
let n = await Pe(e, {
|
|
671
681
|
source: t,
|
|
672
682
|
compression: l.imageCompression,
|
|
673
683
|
upload: l.imageUpload
|
|
674
684
|
});
|
|
675
|
-
return
|
|
685
|
+
return dr ? void 0 : n.src;
|
|
676
686
|
} catch (e) {
|
|
677
|
-
let n =
|
|
678
|
-
t === "toolbar" && (
|
|
687
|
+
let n = sa(e);
|
|
688
|
+
t === "toolbar" && (Kn.value = n.message), H.value = n.message, h("image-error", n, t);
|
|
679
689
|
return;
|
|
680
690
|
} finally {
|
|
681
|
-
t === "toolbar" && (
|
|
691
|
+
t === "toolbar" && (qn.value = !1);
|
|
682
692
|
}
|
|
683
693
|
}
|
|
684
|
-
async function
|
|
685
|
-
return await
|
|
694
|
+
async function la(e) {
|
|
695
|
+
return await ca(e, "paste") ?? null;
|
|
686
696
|
}
|
|
687
|
-
async function
|
|
688
|
-
if (
|
|
689
|
-
let n =
|
|
690
|
-
if (
|
|
697
|
+
async function ua(e, t = {}) {
|
|
698
|
+
if (W.value) return;
|
|
699
|
+
let n = q.value?.id ?? E.value.pages[0]?.id, r = n ? M.get(n)?.getSelectionRange() : void 0, i = typeof e == "string" ? e.trim() : await ca(e, "toolbar");
|
|
700
|
+
if (dr) return;
|
|
691
701
|
if (!i || !je(i)) {
|
|
692
|
-
typeof e == "string" && (
|
|
702
|
+
typeof e == "string" && (Kn.value = "请输入安全的图片 URL");
|
|
693
703
|
return;
|
|
694
704
|
}
|
|
695
|
-
if (n && !
|
|
696
|
-
let a =
|
|
705
|
+
if (n && !M.has(n)) return;
|
|
706
|
+
let a = oa({
|
|
697
707
|
...t,
|
|
698
708
|
src: i
|
|
699
709
|
}, n, r);
|
|
700
|
-
return a && (
|
|
710
|
+
return a && (Hn.value = !1, aa(), H.value = "已插入图片"), a;
|
|
701
711
|
}
|
|
702
|
-
function
|
|
703
|
-
|
|
712
|
+
function da() {
|
|
713
|
+
W.value || qn.value || ($(), Kn.value = "", dn.value && (dn.value.value = ""), dn.value?.click());
|
|
704
714
|
}
|
|
705
|
-
async function
|
|
715
|
+
async function fa(e) {
|
|
706
716
|
let t = e.target.files?.[0];
|
|
707
|
-
t && await
|
|
717
|
+
t && await ua(t, ia({ alt: t.name }));
|
|
708
718
|
}
|
|
709
|
-
async function
|
|
710
|
-
let e =
|
|
711
|
-
await
|
|
719
|
+
async function pa() {
|
|
720
|
+
let e = Un.value;
|
|
721
|
+
await ua(e, ia());
|
|
712
722
|
}
|
|
713
|
-
function
|
|
714
|
-
|
|
723
|
+
function ma(e) {
|
|
724
|
+
Pa(e), Vn.value = !1;
|
|
715
725
|
}
|
|
716
|
-
function
|
|
717
|
-
$(),
|
|
726
|
+
function ha() {
|
|
727
|
+
$(), Xi();
|
|
718
728
|
}
|
|
719
|
-
function
|
|
720
|
-
$(),
|
|
729
|
+
function ga(e, t, n, r) {
|
|
730
|
+
$(), na(ta({ type: t }), e, {
|
|
721
731
|
left: n,
|
|
722
732
|
top: r
|
|
723
733
|
});
|
|
724
734
|
}
|
|
725
|
-
function
|
|
726
|
-
$(),
|
|
735
|
+
function _a(e) {
|
|
736
|
+
$(), D.value = e, Q();
|
|
727
737
|
}
|
|
728
|
-
function
|
|
729
|
-
let t =
|
|
738
|
+
function va(e) {
|
|
739
|
+
let t = E.value.variables.find((t) => t.id === e.id);
|
|
730
740
|
if (!t) return;
|
|
731
741
|
let n = e.key.trim();
|
|
732
742
|
if (n !== t.key) {
|
|
733
|
-
let t = ke(n,
|
|
743
|
+
let t = ke(n, E.value.variables, e.id);
|
|
734
744
|
if (t) {
|
|
735
|
-
|
|
745
|
+
H.value = t;
|
|
736
746
|
return;
|
|
737
747
|
}
|
|
738
748
|
}
|
|
@@ -740,321 +750,346 @@ var Lt = {
|
|
|
740
750
|
...e,
|
|
741
751
|
key: n
|
|
742
752
|
};
|
|
743
|
-
let r = [...
|
|
744
|
-
|
|
753
|
+
let r = [...E.value.pages], i = t.key, a = "";
|
|
754
|
+
M.forEach((t, n) => {
|
|
745
755
|
let o = t.updateVariable(e, i);
|
|
746
756
|
if (o) {
|
|
747
757
|
a ||= n;
|
|
748
758
|
let e = r.findIndex((e) => e.id === n);
|
|
749
759
|
e >= 0 && (r[e] = o);
|
|
750
760
|
}
|
|
751
|
-
}),
|
|
752
|
-
...
|
|
761
|
+
}), X({
|
|
762
|
+
...E.value,
|
|
753
763
|
pages: r,
|
|
754
|
-
variables:
|
|
755
|
-
...i !== e.key &&
|
|
756
|
-
}),
|
|
764
|
+
variables: E.value.variables.map((t) => t.id === e.id ? e : t),
|
|
765
|
+
...i !== e.key && E.value.pageDecorations ? { pageDecorations: ue(E.value.pageDecorations, i, e.key) } : {}
|
|
766
|
+
}), D.value = e.key, J(a || k.value);
|
|
757
767
|
}
|
|
758
|
-
function
|
|
759
|
-
|
|
760
|
-
...
|
|
768
|
+
function ya(e) {
|
|
769
|
+
G.value && va({
|
|
770
|
+
...G.value,
|
|
761
771
|
...e,
|
|
762
772
|
style: {
|
|
763
|
-
...
|
|
773
|
+
...G.value.style,
|
|
764
774
|
...e.style
|
|
765
775
|
}
|
|
766
776
|
});
|
|
767
777
|
}
|
|
768
|
-
function
|
|
769
|
-
|
|
778
|
+
function ba(e) {
|
|
779
|
+
W.value || !G.value || ya({ key: e });
|
|
770
780
|
}
|
|
771
|
-
function
|
|
772
|
-
|
|
773
|
-
...
|
|
781
|
+
function xa(e) {
|
|
782
|
+
W.value || (X({
|
|
783
|
+
...E.value,
|
|
774
784
|
pageDecorations: se(e)
|
|
775
|
-
}),
|
|
785
|
+
}), J(E.value.pages[0]?.id));
|
|
776
786
|
}
|
|
777
|
-
function
|
|
778
|
-
(e === "left" || e === "center" || e === "right") &&
|
|
787
|
+
function Sa(e) {
|
|
788
|
+
(e === "left" || e === "center" || e === "right") && ya({ style: { textAlign: e } });
|
|
779
789
|
}
|
|
780
|
-
function
|
|
781
|
-
(e === "solid" || e === "dashed") &&
|
|
790
|
+
function Ca(e) {
|
|
791
|
+
(e === "solid" || e === "dashed") && ya({ style: { borderStyle: e } });
|
|
782
792
|
}
|
|
783
|
-
function
|
|
784
|
-
(e === "contain" || e === "cover" || e === "fill") &&
|
|
793
|
+
function wa(e) {
|
|
794
|
+
(e === "contain" || e === "cover" || e === "fill") && ya({ style: { objectFit: e } });
|
|
785
795
|
}
|
|
786
|
-
function
|
|
787
|
-
|
|
796
|
+
function Ta(e) {
|
|
797
|
+
ya({ style: e });
|
|
788
798
|
}
|
|
789
|
-
function
|
|
790
|
-
|
|
799
|
+
function Ea(e) {
|
|
800
|
+
Ta({ fontFamily: String(e || "").trim() || "Noto Serif SC, Source Han Serif SC, Songti SC, STSong, SimSun, serif" });
|
|
791
801
|
}
|
|
792
|
-
function
|
|
793
|
-
|
|
802
|
+
function Da(e) {
|
|
803
|
+
Ta({ fontSize: wi(e, G.value?.style?.fontSize ?? 14) });
|
|
794
804
|
}
|
|
795
|
-
function
|
|
796
|
-
|
|
805
|
+
function Oa(e) {
|
|
806
|
+
G.value && ya({
|
|
797
807
|
multiline: e,
|
|
798
|
-
rows:
|
|
799
|
-
lineHeight:
|
|
808
|
+
rows: G.value.rows || 3,
|
|
809
|
+
lineHeight: G.value.lineHeight || 28,
|
|
800
810
|
style: e ? { underline: !0 } : void 0
|
|
801
811
|
});
|
|
802
812
|
}
|
|
803
|
-
function
|
|
804
|
-
|
|
813
|
+
function ka(e) {
|
|
814
|
+
G.value && ya({
|
|
805
815
|
rows: Number(e || 3),
|
|
806
|
-
lineHeight:
|
|
816
|
+
lineHeight: G.value.lineHeight || 28
|
|
807
817
|
});
|
|
808
818
|
}
|
|
809
|
-
function
|
|
810
|
-
if (
|
|
811
|
-
let t = [...
|
|
812
|
-
|
|
819
|
+
function Aa(e) {
|
|
820
|
+
if (W.value) return;
|
|
821
|
+
let t = [...E.value.pages];
|
|
822
|
+
M.forEach((n, r) => {
|
|
813
823
|
let i = n.removeVariable(e.key);
|
|
814
824
|
if (i) {
|
|
815
825
|
let e = t.findIndex((e) => e.id === r);
|
|
816
826
|
e >= 0 && (t[e] = i);
|
|
817
827
|
}
|
|
818
|
-
}),
|
|
819
|
-
...
|
|
828
|
+
}), X({
|
|
829
|
+
...E.value,
|
|
820
830
|
pages: t,
|
|
821
|
-
variables:
|
|
822
|
-
...
|
|
823
|
-
}),
|
|
831
|
+
variables: E.value.variables.filter((t) => t.id !== e.id),
|
|
832
|
+
...E.value.pageDecorations ? { pageDecorations: ue(E.value.pageDecorations, e.key) } : {}
|
|
833
|
+
}), D.value = "", O.value = "";
|
|
824
834
|
}
|
|
825
|
-
function
|
|
826
|
-
let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(
|
|
835
|
+
function ja(e) {
|
|
836
|
+
let t = (e.trim() || "variable").replace(/\s+/g, "_"), n = new Set(E.value.variables.map((e) => e.key));
|
|
827
837
|
if (!n.has(t)) return t;
|
|
828
838
|
let r = 2;
|
|
829
839
|
for (; n.has(`${t}_${r}`);) r += 1;
|
|
830
840
|
return `${t}_${r}`;
|
|
831
841
|
}
|
|
832
|
-
function
|
|
833
|
-
|
|
842
|
+
function Ma(e) {
|
|
843
|
+
W.value || na(be({
|
|
834
844
|
...e,
|
|
835
845
|
id: void 0,
|
|
836
|
-
key:
|
|
846
|
+
key: ja(`${e.key || e.type}_copy`),
|
|
837
847
|
label: `${e.label}副本`,
|
|
838
848
|
style: { ...e.style }
|
|
839
849
|
}, l.variableTypes, l.defaultVariableStyle));
|
|
840
850
|
}
|
|
841
|
-
function
|
|
842
|
-
return
|
|
851
|
+
function Na(e) {
|
|
852
|
+
return W.value ? void 0 : na(E.value.variables.find((t) => t.key === e.key) ?? be(e, l.variableTypes, l.defaultVariableStyle));
|
|
843
853
|
}
|
|
844
|
-
function
|
|
845
|
-
if (!
|
|
854
|
+
function Pa(e) {
|
|
855
|
+
if (!W.value) return na(ta({ type: e }));
|
|
846
856
|
}
|
|
847
|
-
function
|
|
848
|
-
if (
|
|
849
|
-
let n =
|
|
857
|
+
function Fa(t) {
|
|
858
|
+
if (W.value || !e(t)) return;
|
|
859
|
+
let n = R.value, r = Wr.value.find((e) => e.type === t);
|
|
850
860
|
if (!n || !r) return;
|
|
851
|
-
let i = Fe(n.leadingText) || r.label, a = Ie(n.selectionWidth,
|
|
852
|
-
|
|
861
|
+
let i = Fe(n.leadingText) || r.label, a = Ie(n.selectionWidth, Xt, di.value), o = Ia();
|
|
862
|
+
na(ta({
|
|
853
863
|
type: t,
|
|
854
864
|
label: i,
|
|
855
865
|
...a ? { width: a } : {},
|
|
856
866
|
...o ? { style: o } : {}
|
|
857
|
-
}), n.pageId),
|
|
867
|
+
}), n.pageId), H.value = n.hasSelection ? `已将选中内容替换为${r.label}控件` : `已插入${r.label}控件`, $();
|
|
858
868
|
}
|
|
859
|
-
function
|
|
860
|
-
let e =
|
|
869
|
+
function Ia() {
|
|
870
|
+
let e = pi.value, t = {};
|
|
861
871
|
return e.isUnderline && (t.underline = !0), typeof e.fontSize == "number" && Number.isFinite(e.fontSize) && (t.fontSize = e.fontSize), e.fontFamily && (t.fontFamily = e.fontFamily), e.textColor && (t.color = e.textColor), Object.keys(t).length ? t : void 0;
|
|
862
872
|
}
|
|
863
|
-
function
|
|
864
|
-
if (
|
|
865
|
-
let t =
|
|
866
|
-
t && (
|
|
873
|
+
function La(e) {
|
|
874
|
+
if (W.value) return;
|
|
875
|
+
let t = R.value;
|
|
876
|
+
t && (na(e, t.pageId), H.value = `已绑定到${e.label},沿用原控件尺寸`, $());
|
|
867
877
|
}
|
|
868
|
-
function
|
|
869
|
-
return Se(t.type && e(t.type) ? t.type : "text",
|
|
878
|
+
function Ra(t) {
|
|
879
|
+
return Se(t.type && e(t.type) ? t.type : "text", Wr.value).label;
|
|
870
880
|
}
|
|
871
|
-
function
|
|
872
|
-
|
|
873
|
-
|
|
881
|
+
function za() {
|
|
882
|
+
E.value.variables.length && (er.value = !0, g(() => {
|
|
883
|
+
Qo(), Jn.value?.focusBindSearch();
|
|
874
884
|
}));
|
|
875
885
|
}
|
|
876
|
-
function
|
|
886
|
+
function Ba(e, t) {
|
|
877
887
|
e.dataTransfer?.setData("application/x-gd-contract-variable", t), e.dataTransfer && (e.dataTransfer.effectAllowed = "copy");
|
|
878
888
|
}
|
|
879
|
-
function
|
|
880
|
-
return
|
|
889
|
+
function Va(e) {
|
|
890
|
+
return N.value = Math.round(Math.min(Gt, Math.max(Wt, Number.isFinite(e) ? e : 1)) * 100) / 100, N.value;
|
|
881
891
|
}
|
|
882
|
-
let { width:
|
|
883
|
-
viewportWidth:
|
|
884
|
-
widestPageWidth: f(() => Math.max(...
|
|
892
|
+
let { width: Ha } = Lt(rn), { fitWidth: Ua, applyAutoFit: Wa, markUserAdjusted: Ga, userAdjusted: Ka } = Me({
|
|
893
|
+
viewportWidth: Ha,
|
|
894
|
+
widestPageWidth: f(() => Math.max(...E.value.pages.map((e) => Vi(e).width), fe.width) + 10),
|
|
885
895
|
padding: 48,
|
|
886
|
-
minZoom:
|
|
887
|
-
maxZoom:
|
|
888
|
-
getZoom: () =>
|
|
889
|
-
applyZoom:
|
|
896
|
+
minZoom: Wt,
|
|
897
|
+
maxZoom: Gt,
|
|
898
|
+
getZoom: () => N.value,
|
|
899
|
+
applyZoom: Va
|
|
890
900
|
});
|
|
891
|
-
function
|
|
892
|
-
return
|
|
901
|
+
function qa(e) {
|
|
902
|
+
return Ga(), Va(e);
|
|
893
903
|
}
|
|
894
|
-
function
|
|
895
|
-
return
|
|
904
|
+
function Ja() {
|
|
905
|
+
return Wa();
|
|
896
906
|
}
|
|
897
|
-
function
|
|
898
|
-
return
|
|
907
|
+
function Ya() {
|
|
908
|
+
return N.value;
|
|
899
909
|
}
|
|
900
|
-
function
|
|
901
|
-
|
|
910
|
+
function Xa() {
|
|
911
|
+
qa(N.value + Kt);
|
|
902
912
|
}
|
|
903
|
-
function
|
|
904
|
-
|
|
913
|
+
function Za() {
|
|
914
|
+
qa(N.value - Kt);
|
|
905
915
|
}
|
|
906
|
-
function
|
|
907
|
-
$(),
|
|
916
|
+
function Qa() {
|
|
917
|
+
$(), I.value = !1, L.value = !1, Rn.value = !1, P.value = !P.value;
|
|
908
918
|
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
919
|
+
b(Ha, (e) => {
|
|
920
|
+
Fn.value && !Ka.value && e > 0 && Ua();
|
|
921
|
+
});
|
|
922
|
+
function $a(e) {
|
|
923
|
+
Pn.value ? un.value?.focus() : e();
|
|
924
|
+
}
|
|
925
|
+
function eo() {
|
|
926
|
+
$(), as(), F.value = !1, ur = {
|
|
927
|
+
fullscreen: P.value,
|
|
928
|
+
sidebar: Mn.value,
|
|
929
|
+
inspector: Nn.value,
|
|
930
|
+
chrome: Pn.value,
|
|
931
|
+
zoom: N.value,
|
|
932
|
+
userAdjusted: Ka.value
|
|
933
|
+
}, P.value = !0, Mn.value = !0, Nn.value = !0, Pn.value = !0, Fn.value = !0, g(() => {
|
|
934
|
+
W.value ? In.value?.focus() : M.get(k.value)?.focus();
|
|
935
|
+
});
|
|
913
936
|
}
|
|
914
|
-
function
|
|
915
|
-
|
|
937
|
+
function to() {
|
|
938
|
+
let e = ur;
|
|
939
|
+
Fn.value = !1, ur = void 0, e && (P.value = e.fullscreen, Mn.value = e.sidebar, Nn.value = e.inspector, Pn.value = e.chrome, e.userAdjusted ? qa(e.zoom) : Wa(), g(() => $a(() => on.value?.focusImmersive())));
|
|
916
940
|
}
|
|
917
|
-
function
|
|
918
|
-
|
|
941
|
+
function no() {
|
|
942
|
+
Fn.value ? to() : eo();
|
|
919
943
|
}
|
|
920
|
-
function
|
|
944
|
+
function ro() {
|
|
945
|
+
$(), z.value = void 0;
|
|
946
|
+
let e = Y(!1);
|
|
947
|
+
x.value ? (On.value = u(S.value), Dn.value = void 0, kn.value = C.value || S.value[0]?.id || "") : (Dn.value = c(e), On.value = void 0, kn.value = ""), En.value = !0;
|
|
948
|
+
}
|
|
949
|
+
function io() {
|
|
950
|
+
En.value = !1, Dn.value = void 0, On.value = void 0, kn.value = "";
|
|
951
|
+
}
|
|
952
|
+
function ao() {
|
|
953
|
+
return Mo();
|
|
954
|
+
}
|
|
955
|
+
function oo() {
|
|
921
956
|
$();
|
|
922
|
-
let e =
|
|
923
|
-
return
|
|
924
|
-
}
|
|
925
|
-
function
|
|
926
|
-
|
|
927
|
-
}
|
|
928
|
-
function
|
|
929
|
-
$(),
|
|
930
|
-
let e =
|
|
931
|
-
|
|
932
|
-
...
|
|
933
|
-
[
|
|
957
|
+
let e = ao();
|
|
958
|
+
return jn.value = JSON.stringify(e, null, 2), An.value = !0, e;
|
|
959
|
+
}
|
|
960
|
+
function so() {
|
|
961
|
+
An.value = !1;
|
|
962
|
+
}
|
|
963
|
+
function co() {
|
|
964
|
+
$(), z.value = void 0, I.value = !1, L.value = !1;
|
|
965
|
+
let e = K.value.map(ct);
|
|
966
|
+
T.value = [], w.value = {
|
|
967
|
+
...w.value,
|
|
968
|
+
[C.value]: []
|
|
934
969
|
};
|
|
935
|
-
let t = !!
|
|
936
|
-
|
|
937
|
-
let n =
|
|
938
|
-
return t &&
|
|
970
|
+
let t = !!O.value;
|
|
971
|
+
D.value = "", O.value = "", k.value = "", En.value = !1, Dn.value = void 0, On.value = void 0, An.value = !1, jn.value = "", zn.value = {}, Tn.value = "";
|
|
972
|
+
let n = X(ve(fe));
|
|
973
|
+
return t && h("signing-placement-select", void 0), e.forEach((e) => h("signing-placement-remove", e)), k.value = n.pages[0]?.id ?? "", c(n);
|
|
939
974
|
}
|
|
940
|
-
function
|
|
941
|
-
|
|
975
|
+
function lo() {
|
|
976
|
+
W.value || ($(), Ft.confirm({
|
|
942
977
|
title: "清空合同内容",
|
|
943
978
|
content: "将清空全部合同正文、页面、模板变量和签署位置,仅保留一个空白 A4 合同页。此操作不可撤销。",
|
|
944
979
|
okText: "确认清空",
|
|
945
980
|
okType: "danger",
|
|
946
981
|
cancelText: "取消",
|
|
947
982
|
onOk: () => {
|
|
948
|
-
|
|
983
|
+
co();
|
|
949
984
|
}
|
|
950
985
|
}));
|
|
951
986
|
}
|
|
952
|
-
function
|
|
953
|
-
let t =
|
|
987
|
+
function uo(e) {
|
|
988
|
+
let t = Ei().pages, n = t.find((e) => e.id === k.value);
|
|
954
989
|
return (n ? [n, ...t.filter((e) => e.id !== n.id)] : t).find((t) => t.contentHtml.includes(`data-key="${e.key}"`) || t.contentHtml.includes(`data-key='${e.key}'`));
|
|
955
990
|
}
|
|
956
|
-
function
|
|
957
|
-
$(),
|
|
958
|
-
let t =
|
|
959
|
-
t && (
|
|
960
|
-
|
|
991
|
+
function fo(e) {
|
|
992
|
+
$(), D.value = e.key, Q();
|
|
993
|
+
let t = uo(e);
|
|
994
|
+
t && (k.value = t.id, g(() => {
|
|
995
|
+
M.get(t.id)?.scrollIntoVariable(e.key);
|
|
961
996
|
}));
|
|
962
997
|
}
|
|
963
|
-
function
|
|
964
|
-
let t =
|
|
965
|
-
t &&
|
|
998
|
+
function po(e) {
|
|
999
|
+
let t = E.value.variables.find((t) => t.key === e || t.id === e);
|
|
1000
|
+
t && fo(t);
|
|
966
1001
|
}
|
|
967
|
-
function
|
|
968
|
-
let t =
|
|
969
|
-
t && ($(),
|
|
970
|
-
|
|
1002
|
+
function mo(e) {
|
|
1003
|
+
let t = K.value.find((t) => t.id === e);
|
|
1004
|
+
t && ($(), D.value = "", k.value = t.pageId, Q(t.id), g(() => {
|
|
1005
|
+
M.get(t.pageId)?.scrollIntoSigningPlacement(t.id);
|
|
971
1006
|
}));
|
|
972
1007
|
}
|
|
973
|
-
function
|
|
974
|
-
$(),
|
|
975
|
-
|
|
1008
|
+
function ho(e, t = !0) {
|
|
1009
|
+
$(), k.value = e, t && g(() => {
|
|
1010
|
+
M.get(e)?.scrollIntoPage();
|
|
976
1011
|
});
|
|
977
1012
|
}
|
|
978
|
-
function
|
|
979
|
-
|
|
1013
|
+
function go(e) {
|
|
1014
|
+
E.value.pages.some((t) => t.id === e) && ho(e);
|
|
980
1015
|
}
|
|
981
|
-
function
|
|
982
|
-
if (
|
|
983
|
-
|
|
1016
|
+
function _o() {
|
|
1017
|
+
if (F.value) {
|
|
1018
|
+
vo();
|
|
984
1019
|
return;
|
|
985
1020
|
}
|
|
986
|
-
|
|
1021
|
+
F.value = !0;
|
|
987
1022
|
}
|
|
988
|
-
function
|
|
989
|
-
|
|
1023
|
+
function vo() {
|
|
1024
|
+
F.value = !1, g(() => $a(() => on.value?.focusPageDecorations()));
|
|
990
1025
|
}
|
|
991
|
-
function
|
|
992
|
-
return
|
|
1026
|
+
function yo() {
|
|
1027
|
+
return Oi(), c(Ei());
|
|
993
1028
|
}
|
|
994
|
-
function
|
|
995
|
-
|
|
996
|
-
...
|
|
997
|
-
[
|
|
1029
|
+
function bo(e) {
|
|
1030
|
+
T.value = fn(e), w.value = {
|
|
1031
|
+
...w.value,
|
|
1032
|
+
[C.value]: T.value
|
|
998
1033
|
};
|
|
999
|
-
let t =
|
|
1000
|
-
t.signingPlacements?.some((e) => e.id ===
|
|
1034
|
+
let t = X(Ee(e, l.pageSize));
|
|
1035
|
+
t.signingPlacements?.some((e) => e.id === O.value) || Q(), J(t.pages[0]?.id);
|
|
1001
1036
|
}
|
|
1002
|
-
function
|
|
1003
|
-
let e =
|
|
1004
|
-
return
|
|
1037
|
+
function xo() {
|
|
1038
|
+
let e = Y(!1);
|
|
1039
|
+
return x.value ? u(S.value) : u(at(S.value, C.value, e));
|
|
1005
1040
|
}
|
|
1006
|
-
function
|
|
1007
|
-
let n =
|
|
1008
|
-
|
|
1041
|
+
function So(e, t) {
|
|
1042
|
+
let n = Qe(nt(e, void 0, l.pageSize), l.pageSizeOptions), r = S.value;
|
|
1043
|
+
gn.value = !0, Y(!1), S.value = n.files, w.value = pn(n.files, e), Ni(ot(S.value, t ?? C.value), {
|
|
1009
1044
|
syncCurrent: !1,
|
|
1010
1045
|
shouldEmit: !0,
|
|
1011
1046
|
forceRefresh: !0,
|
|
1012
1047
|
persistCurrentErrors: !1
|
|
1013
|
-
}), d(r) !== d(
|
|
1014
|
-
}
|
|
1015
|
-
function
|
|
1016
|
-
if (
|
|
1017
|
-
|
|
1018
|
-
let t =
|
|
1019
|
-
return
|
|
1020
|
-
...
|
|
1048
|
+
}), d(r) !== d(S.value) && Mi(S.value, "");
|
|
1049
|
+
}
|
|
1050
|
+
function Co(e) {
|
|
1051
|
+
if (W.value) return;
|
|
1052
|
+
gn.value = !0, Y(!0);
|
|
1053
|
+
let t = $e(e || `合同文件 ${S.value.length + 1}`, l.pageSize);
|
|
1054
|
+
return S.value = [...S.value, t], w.value = {
|
|
1055
|
+
...w.value,
|
|
1021
1056
|
[t.id]: []
|
|
1022
|
-
},
|
|
1057
|
+
}, Mi(S.value, ""), h("file-add", u([t])[0]), Ni(t.id, {
|
|
1023
1058
|
syncCurrent: !1,
|
|
1024
1059
|
shouldEmit: !0,
|
|
1025
1060
|
forceRefresh: !0
|
|
1026
1061
|
}), u([t])[0];
|
|
1027
1062
|
}
|
|
1028
|
-
function
|
|
1029
|
-
!
|
|
1030
|
-
}
|
|
1031
|
-
function
|
|
1032
|
-
if (
|
|
1033
|
-
|
|
1034
|
-
let n =
|
|
1035
|
-
if (r) return
|
|
1036
|
-
}
|
|
1037
|
-
function
|
|
1038
|
-
if (
|
|
1039
|
-
|
|
1040
|
-
let t =
|
|
1063
|
+
function wo(e) {
|
|
1064
|
+
!x.value && !S.value.some((t) => t.id === e) || (gn.value = !0, Ni(e));
|
|
1065
|
+
}
|
|
1066
|
+
function To(e, t) {
|
|
1067
|
+
if (W.value) return;
|
|
1068
|
+
gn.value = !0, Y(!1);
|
|
1069
|
+
let n = it(S.value, e, t), r = n.find((t) => t.id === e);
|
|
1070
|
+
if (r) return S.value = n, Mi(n, e), u([r])[0];
|
|
1071
|
+
}
|
|
1072
|
+
function Eo(e) {
|
|
1073
|
+
if (W.value || S.value.length <= 1) return;
|
|
1074
|
+
gn.value = !0, Y(!1);
|
|
1075
|
+
let t = S.value.find((t) => t.id === e);
|
|
1041
1076
|
if (!t) return;
|
|
1042
|
-
let n =
|
|
1043
|
-
if (n.length ===
|
|
1044
|
-
|
|
1045
|
-
let { [e]: r, ...i } =
|
|
1046
|
-
|
|
1077
|
+
let n = rt(S.value, e);
|
|
1078
|
+
if (n.length === S.value.length) return;
|
|
1079
|
+
S.value = n;
|
|
1080
|
+
let { [e]: r, ...i } = w.value;
|
|
1081
|
+
w.value = i, Mi(n, ""), h("file-remove", u([t])[0]);
|
|
1047
1082
|
let a = t.template.signingPlacements ?? [];
|
|
1048
|
-
return a.forEach((e) =>
|
|
1083
|
+
return a.forEach((e) => h("signing-placement-remove", ct(e))), a.some((e) => e.id === O.value) && h("signing-placement-select", void 0), C.value === e && Ni(ot(n, n[0]?.id), {
|
|
1049
1084
|
syncCurrent: !1,
|
|
1050
1085
|
shouldEmit: !0,
|
|
1051
1086
|
forceRefresh: !0,
|
|
1052
1087
|
persistCurrentErrors: !1
|
|
1053
1088
|
}), u([t])[0];
|
|
1054
1089
|
}
|
|
1055
|
-
function
|
|
1056
|
-
if (
|
|
1057
|
-
let t =
|
|
1090
|
+
function Do(e) {
|
|
1091
|
+
if (W.value || S.value.length <= 1) return;
|
|
1092
|
+
let t = S.value.find((t) => t.id === e);
|
|
1058
1093
|
if (!t) return;
|
|
1059
1094
|
let n = t.template.signingPlacements?.length ?? 0;
|
|
1060
1095
|
Ft.confirm({
|
|
@@ -1064,30 +1099,30 @@ var Lt = {
|
|
|
1064
1099
|
okType: "danger",
|
|
1065
1100
|
cancelText: "取消",
|
|
1066
1101
|
onOk: () => {
|
|
1067
|
-
|
|
1102
|
+
Eo(e);
|
|
1068
1103
|
}
|
|
1069
1104
|
});
|
|
1070
1105
|
}
|
|
1071
|
-
function
|
|
1072
|
-
if (
|
|
1073
|
-
|
|
1074
|
-
let n =
|
|
1075
|
-
if (!(!a || n === i)) return
|
|
1076
|
-
}
|
|
1077
|
-
function
|
|
1078
|
-
|
|
1079
|
-
let e =
|
|
1080
|
-
let t = Ae(e.template, { maxPages:
|
|
1081
|
-
return [...
|
|
1106
|
+
function Oo(e, t) {
|
|
1107
|
+
if (W.value) return;
|
|
1108
|
+
gn.value = !0, Y(!1);
|
|
1109
|
+
let n = S.value.findIndex((t) => t.id === e), r = tt(S.value, e, t), i = r.findIndex((t) => t.id === e), a = r[i];
|
|
1110
|
+
if (!(!a || n === i)) return S.value = r, Mi(r, ""), h("file-move", u([a])[0], n, i), u([a])[0];
|
|
1111
|
+
}
|
|
1112
|
+
function ko() {
|
|
1113
|
+
Y(!1);
|
|
1114
|
+
let e = Lo(x.value ? S.value.flatMap((e) => {
|
|
1115
|
+
let t = Ae(e.template, { maxPages: Kr.value });
|
|
1116
|
+
return [...w.value[e.id] ?? [], ...t].map((t) => ({
|
|
1082
1117
|
...t,
|
|
1083
1118
|
fileId: e.id
|
|
1084
1119
|
}));
|
|
1085
|
-
}) : [...
|
|
1086
|
-
return
|
|
1120
|
+
}) : [...T.value, ...Ae(Ei(), { maxPages: Kr.value })]);
|
|
1121
|
+
return j.value = e, A.value = !0, h("validate", e), e;
|
|
1087
1122
|
}
|
|
1088
|
-
function
|
|
1089
|
-
if (e.fileId && e.fileId !==
|
|
1090
|
-
|
|
1123
|
+
function Ao(e) {
|
|
1124
|
+
if (e.fileId && e.fileId !== C.value) {
|
|
1125
|
+
wo(e.fileId), g(() => Ao({
|
|
1091
1126
|
...e,
|
|
1092
1127
|
fileId: void 0
|
|
1093
1128
|
}));
|
|
@@ -1095,271 +1130,338 @@ var Lt = {
|
|
|
1095
1130
|
}
|
|
1096
1131
|
let t = le(e);
|
|
1097
1132
|
if (t) {
|
|
1098
|
-
|
|
1133
|
+
F.value = !0, g(() => sn.value?.focusField(t));
|
|
1099
1134
|
return;
|
|
1100
1135
|
}
|
|
1101
1136
|
if (e.type === "signing-placement") {
|
|
1102
|
-
let t =
|
|
1137
|
+
let t = K.value.find((t) => t.id === e.id);
|
|
1103
1138
|
if (t) {
|
|
1104
|
-
|
|
1139
|
+
ho(t.pageId), Q(t.id);
|
|
1105
1140
|
return;
|
|
1106
1141
|
}
|
|
1107
1142
|
}
|
|
1108
1143
|
if (e.variableKey) {
|
|
1109
|
-
|
|
1144
|
+
po(e.variableKey);
|
|
1110
1145
|
return;
|
|
1111
1146
|
}
|
|
1112
1147
|
if (e.pageId) {
|
|
1113
|
-
|
|
1148
|
+
go(e.pageId);
|
|
1114
1149
|
return;
|
|
1115
1150
|
}
|
|
1116
|
-
let n =
|
|
1151
|
+
let n = E.value.variables.find((t) => t.id === e.id || t.key === e.id);
|
|
1117
1152
|
if (n) {
|
|
1118
|
-
|
|
1153
|
+
fo(n);
|
|
1119
1154
|
return;
|
|
1120
1155
|
}
|
|
1121
|
-
|
|
1156
|
+
E.value.pages.some((t) => t.id === e.id) && ho(e.id);
|
|
1122
1157
|
}
|
|
1123
|
-
function
|
|
1158
|
+
function jo(e) {
|
|
1124
1159
|
return le(e) ? "页面装饰" : e.type === "signing-placement" ? "签署位置" : e.type === "variable" ? "变量" : "字段";
|
|
1125
1160
|
}
|
|
1126
|
-
function
|
|
1127
|
-
return
|
|
1161
|
+
function Mo() {
|
|
1162
|
+
return Oi(), xe(Ei());
|
|
1128
1163
|
}
|
|
1129
|
-
function
|
|
1130
|
-
let e =
|
|
1131
|
-
return
|
|
1164
|
+
function No() {
|
|
1165
|
+
let e = Y(!1);
|
|
1166
|
+
return et(x.value ? S.value : at(S.value, C.value, e));
|
|
1132
1167
|
}
|
|
1133
|
-
function
|
|
1134
|
-
let n =
|
|
1168
|
+
function Po(e) {
|
|
1169
|
+
let n = Ei();
|
|
1135
1170
|
try {
|
|
1136
|
-
let r = me(n,
|
|
1171
|
+
let r = me(n, T.value);
|
|
1137
1172
|
if (r.length) throw new t(r);
|
|
1138
1173
|
return e(n);
|
|
1139
1174
|
} catch (e) {
|
|
1140
|
-
throw e instanceof t && (
|
|
1175
|
+
throw e instanceof t && (j.value = [...e.errors], A.value = !0, h("validate", [...e.errors])), e;
|
|
1141
1176
|
}
|
|
1142
1177
|
}
|
|
1143
|
-
function
|
|
1144
|
-
return
|
|
1178
|
+
function Fo(e) {
|
|
1179
|
+
return Po((t) => i(t, e));
|
|
1145
1180
|
}
|
|
1146
|
-
function
|
|
1147
|
-
return
|
|
1181
|
+
function Io(e) {
|
|
1182
|
+
return Po((t) => r(t, e));
|
|
1148
1183
|
}
|
|
1149
|
-
function
|
|
1184
|
+
function Lo(e) {
|
|
1150
1185
|
let t = /* @__PURE__ */ new Set();
|
|
1151
1186
|
return e.filter((e) => {
|
|
1152
1187
|
let n = `${e.fileId ?? ""}|${e.code ?? ""}|${e.id}|${e.pageId ?? ""}|${e.message}`;
|
|
1153
1188
|
return t.has(n) ? !1 : (t.add(n), !0);
|
|
1154
1189
|
});
|
|
1155
1190
|
}
|
|
1156
|
-
function
|
|
1157
|
-
|
|
1191
|
+
function Ro(e) {
|
|
1192
|
+
j.value = [...e], A.value = !0;
|
|
1158
1193
|
}
|
|
1159
|
-
function
|
|
1160
|
-
|
|
1194
|
+
function zo() {
|
|
1195
|
+
j.value = [], A.value = !1;
|
|
1161
1196
|
}
|
|
1162
|
-
function
|
|
1163
|
-
|
|
1197
|
+
function Bo() {
|
|
1198
|
+
M.get(q.value?.id ?? k.value)?.focus();
|
|
1164
1199
|
}
|
|
1165
|
-
function
|
|
1166
|
-
|
|
1200
|
+
function Vo(e) {
|
|
1201
|
+
Si(e) && Z({
|
|
1167
1202
|
type: "set-text-align",
|
|
1168
1203
|
value: e
|
|
1169
1204
|
});
|
|
1170
1205
|
}
|
|
1171
|
-
function
|
|
1172
|
-
(e === "paragraph" ||
|
|
1206
|
+
function Ho(e) {
|
|
1207
|
+
(e === "paragraph" || Ci(e)) && Z({
|
|
1173
1208
|
type: "apply-block-style",
|
|
1174
1209
|
format: e
|
|
1175
1210
|
});
|
|
1176
1211
|
}
|
|
1177
|
-
function
|
|
1178
|
-
let t =
|
|
1179
|
-
t && (
|
|
1212
|
+
function Uo(e) {
|
|
1213
|
+
let t = Ti(e);
|
|
1214
|
+
t && (Z({
|
|
1180
1215
|
type: "set-font-size",
|
|
1181
1216
|
value: t
|
|
1182
|
-
}),
|
|
1217
|
+
}), Bn.value = "");
|
|
1183
1218
|
}
|
|
1184
|
-
function
|
|
1219
|
+
function Wo(e) {
|
|
1185
1220
|
let t = String(e || "").trim();
|
|
1186
1221
|
if (!t) {
|
|
1187
|
-
|
|
1222
|
+
Z({ type: "unset-font-family" });
|
|
1188
1223
|
return;
|
|
1189
1224
|
}
|
|
1190
|
-
|
|
1225
|
+
Z({
|
|
1191
1226
|
type: "set-font-family",
|
|
1192
1227
|
value: t
|
|
1193
1228
|
});
|
|
1194
1229
|
}
|
|
1195
|
-
function
|
|
1196
|
-
|
|
1230
|
+
function Go(e) {
|
|
1231
|
+
Ko(e.target?.value ?? "");
|
|
1197
1232
|
}
|
|
1198
|
-
function
|
|
1233
|
+
function Ko(e) {
|
|
1199
1234
|
let t = e.trim();
|
|
1200
|
-
t &&
|
|
1235
|
+
t && Z({
|
|
1201
1236
|
type: "set-color",
|
|
1202
1237
|
value: t
|
|
1203
1238
|
});
|
|
1204
1239
|
}
|
|
1205
|
-
function
|
|
1206
|
-
|
|
1240
|
+
function qo(e) {
|
|
1241
|
+
Bn.value = e;
|
|
1207
1242
|
}
|
|
1208
|
-
function
|
|
1209
|
-
|
|
1243
|
+
function Jo() {
|
|
1244
|
+
Bn.value.trim() && Uo(Bn.value);
|
|
1210
1245
|
}
|
|
1211
|
-
function
|
|
1212
|
-
e.key === "Enter" && (e.preventDefault(),
|
|
1246
|
+
function Yo(e) {
|
|
1247
|
+
e.key === "Enter" && (e.preventDefault(), Jo());
|
|
1213
1248
|
}
|
|
1214
|
-
function
|
|
1215
|
-
e || (
|
|
1249
|
+
function Xo(e) {
|
|
1250
|
+
e || (Jo(), Bn.value = "");
|
|
1216
1251
|
}
|
|
1217
|
-
function
|
|
1218
|
-
if (
|
|
1219
|
-
|
|
1220
|
-
let t =
|
|
1221
|
-
|
|
1252
|
+
function Zo(e) {
|
|
1253
|
+
if (W.value) return;
|
|
1254
|
+
k.value = e.pageId, I.value = !1, L.value = !1, B.value = void 0, V.value = void 0, er.value = !1, tr.value = "";
|
|
1255
|
+
let t = _t(e.clientX, e.clientY, 304, 300);
|
|
1256
|
+
R.value = {
|
|
1222
1257
|
pageId: e.pageId,
|
|
1223
1258
|
x: t.x,
|
|
1224
1259
|
y: t.y,
|
|
1225
1260
|
hasSelection: e.hasSelection,
|
|
1226
1261
|
selectionWidth: e.selectionWidth,
|
|
1227
1262
|
leadingText: e.leadingText
|
|
1228
|
-
},
|
|
1229
|
-
|
|
1263
|
+
}, g(() => {
|
|
1264
|
+
Qo(), Jn.value?.focusFirstButton();
|
|
1230
1265
|
});
|
|
1231
1266
|
}
|
|
1232
|
-
function
|
|
1233
|
-
let e =
|
|
1267
|
+
function Qo() {
|
|
1268
|
+
let e = Jn.value?.getMenuElement(), t = R.value;
|
|
1234
1269
|
if (!e || !t) return;
|
|
1235
|
-
let n =
|
|
1236
|
-
|
|
1270
|
+
let n = vt(t.x, t.y, e);
|
|
1271
|
+
R.value = {
|
|
1237
1272
|
...t,
|
|
1238
1273
|
x: n.x,
|
|
1239
1274
|
y: n.y
|
|
1240
1275
|
};
|
|
1241
1276
|
}
|
|
1242
|
-
function
|
|
1243
|
-
if (
|
|
1244
|
-
|
|
1245
|
-
let t =
|
|
1246
|
-
|
|
1277
|
+
function $o(e) {
|
|
1278
|
+
if (W.value) return;
|
|
1279
|
+
k.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, V.value = void 0;
|
|
1280
|
+
let t = _t(e.clientX, e.clientY, 248, 400);
|
|
1281
|
+
B.value = {
|
|
1247
1282
|
...e,
|
|
1248
1283
|
x: t.x,
|
|
1249
1284
|
y: t.y
|
|
1250
|
-
},
|
|
1251
|
-
let e =
|
|
1285
|
+
}, g(() => {
|
|
1286
|
+
let e = nr.value?.getMenuElement(), t = B.value;
|
|
1252
1287
|
if (e && t) {
|
|
1253
|
-
let n =
|
|
1254
|
-
|
|
1288
|
+
let n = vt(t.x, t.y, e);
|
|
1289
|
+
B.value = {
|
|
1255
1290
|
...t,
|
|
1256
1291
|
x: n.x,
|
|
1257
1292
|
y: n.y
|
|
1258
1293
|
};
|
|
1259
1294
|
}
|
|
1260
|
-
|
|
1295
|
+
nr.value?.focusFirstItem();
|
|
1261
1296
|
});
|
|
1262
1297
|
}
|
|
1263
|
-
function
|
|
1264
|
-
if (
|
|
1265
|
-
|
|
1266
|
-
let t =
|
|
1267
|
-
|
|
1298
|
+
function es(e) {
|
|
1299
|
+
if (W.value) return;
|
|
1300
|
+
k.value = e.pageId, I.value = !1, L.value = !1, R.value = void 0, B.value = void 0, ir.value = e.image.width, ar.value = e.image.height, D.value = "", O.value && Q();
|
|
1301
|
+
let t = _t(e.clientX, e.clientY, 288, 196);
|
|
1302
|
+
V.value = {
|
|
1268
1303
|
pageId: e.pageId,
|
|
1269
1304
|
image: e.image,
|
|
1270
1305
|
x: t.x,
|
|
1271
1306
|
y: t.y
|
|
1272
|
-
},
|
|
1273
|
-
|
|
1307
|
+
}, g(() => {
|
|
1308
|
+
ts(), rr.value?.getMenuElement()?.querySelector("input, button:not(:disabled)")?.focus();
|
|
1274
1309
|
});
|
|
1275
1310
|
}
|
|
1276
|
-
function
|
|
1277
|
-
let e =
|
|
1311
|
+
function ts() {
|
|
1312
|
+
let e = rr.value?.getMenuElement(), t = V.value;
|
|
1278
1313
|
if (!e || !t) return;
|
|
1279
|
-
let n =
|
|
1280
|
-
|
|
1314
|
+
let n = vt(t.x, t.y, e);
|
|
1315
|
+
V.value = {
|
|
1281
1316
|
...t,
|
|
1282
1317
|
x: n.x,
|
|
1283
1318
|
y: n.y
|
|
1284
1319
|
};
|
|
1285
1320
|
}
|
|
1286
|
-
function
|
|
1287
|
-
let e =
|
|
1288
|
-
!e ||
|
|
1289
|
-
width: Ne(
|
|
1290
|
-
height: Ne(
|
|
1291
|
-
}) && (
|
|
1321
|
+
function ns() {
|
|
1322
|
+
let e = V.value;
|
|
1323
|
+
!e || W.value || (M.get(e.pageId)?.updateSelectedContentImage({
|
|
1324
|
+
width: Ne(ir.value),
|
|
1325
|
+
height: Ne(ar.value)
|
|
1326
|
+
}) && (H.value = "已更新图片尺寸"), $());
|
|
1292
1327
|
}
|
|
1293
|
-
function
|
|
1294
|
-
let e =
|
|
1295
|
-
!e ||
|
|
1328
|
+
function rs() {
|
|
1329
|
+
let e = V.value;
|
|
1330
|
+
!e || W.value || (M.get(e.pageId)?.updateSelectedContentImage({
|
|
1296
1331
|
width: void 0,
|
|
1297
1332
|
height: void 0
|
|
1298
|
-
}) && (
|
|
1333
|
+
}) && (H.value = "已恢复图片自然尺寸"), $());
|
|
1299
1334
|
}
|
|
1300
|
-
function
|
|
1301
|
-
e.type === "table" ?
|
|
1335
|
+
function is(e) {
|
|
1336
|
+
e.type === "table" ? $o(e) : e.type === "image" ? es(e) : Zo(e);
|
|
1302
1337
|
}
|
|
1303
1338
|
function $() {
|
|
1304
|
-
|
|
1339
|
+
R.value = void 0, B.value = void 0, V.value = void 0, er.value = !1, tr.value = "";
|
|
1340
|
+
}
|
|
1341
|
+
function as() {
|
|
1342
|
+
I.value = !1, L.value = !1, Rn.value = !1, Vn.value = !1, Hn.value = !1;
|
|
1343
|
+
}
|
|
1344
|
+
function os() {
|
|
1345
|
+
as(), Pn.value = !Pn.value, g(() => $a(() => on.value?.focusChromeToggle()));
|
|
1346
|
+
}
|
|
1347
|
+
let ss = [
|
|
1348
|
+
".gd-contract-template-designer__context-menu",
|
|
1349
|
+
".gd-contract-template-designer__bubble-menu",
|
|
1350
|
+
".gd-contract-template-designer__bubble-menu-popup"
|
|
1351
|
+
].join(",");
|
|
1352
|
+
function cs() {
|
|
1353
|
+
let e = W.value || Qn.value || Xn.value || mr.value || F.value || En.value, t = k.value, n = e ? void 0 : M.get(t)?.getSelectionViewportRect();
|
|
1354
|
+
if (!n) {
|
|
1355
|
+
z.value = void 0;
|
|
1356
|
+
return;
|
|
1357
|
+
}
|
|
1358
|
+
let r = n.top - 40 - en, i = r >= 12 ? r : n.bottom + en, a = _t((n.left + n.right) / 2 - 380 / 2, i, 380, 40);
|
|
1359
|
+
z.value = {
|
|
1360
|
+
pageId: t,
|
|
1361
|
+
x: a.x,
|
|
1362
|
+
y: a.y
|
|
1363
|
+
}, g(() => ls(n));
|
|
1364
|
+
}
|
|
1365
|
+
function ls(e) {
|
|
1366
|
+
let t = Yn.value?.getMenuElement(), n = z.value;
|
|
1367
|
+
if (!t || !n) return;
|
|
1368
|
+
let r = t.getBoundingClientRect(), i = e.top - r.height - en, a = i >= 12 ? i : e.bottom + en, o = vt((e.left + e.right) / 2 - r.width / 2, a, t);
|
|
1369
|
+
z.value = {
|
|
1370
|
+
...n,
|
|
1371
|
+
x: o.x,
|
|
1372
|
+
y: o.y
|
|
1373
|
+
};
|
|
1305
1374
|
}
|
|
1306
|
-
function
|
|
1307
|
-
|
|
1375
|
+
function us() {
|
|
1376
|
+
let e = z.value?.pageId ?? k.value, t = M.get(e)?.getSelectionRange();
|
|
1377
|
+
Zn = t ? {
|
|
1378
|
+
pageId: e,
|
|
1379
|
+
...t
|
|
1380
|
+
} : void 0, Xn.value = !0, z.value = void 0;
|
|
1381
|
+
}
|
|
1382
|
+
function ds(e) {
|
|
1383
|
+
if (!Xn.value) return;
|
|
1384
|
+
let t = Zn, n = M.get(e)?.getSelectionRange();
|
|
1385
|
+
t && n && t.pageId === e && t.from === n.from && t.to === n.to || (Xn.value = !1, Zn = void 0);
|
|
1386
|
+
}
|
|
1387
|
+
function fs() {
|
|
1388
|
+
!z.value || $n !== void 0 || ($n = requestAnimationFrame(() => {
|
|
1389
|
+
$n = void 0, cs();
|
|
1390
|
+
}));
|
|
1308
1391
|
}
|
|
1309
|
-
function
|
|
1310
|
-
|
|
1392
|
+
function ps() {
|
|
1393
|
+
Qn.value && (Qn.value = !1, cs());
|
|
1311
1394
|
}
|
|
1312
|
-
function
|
|
1313
|
-
|
|
1395
|
+
function ms() {
|
|
1396
|
+
$(), fs();
|
|
1397
|
+
}
|
|
1398
|
+
function hs(e, t) {
|
|
1399
|
+
M.get(z.value?.pageId ?? k.value)?.requestTextContextMenu(e, t);
|
|
1400
|
+
}
|
|
1401
|
+
function gs(e) {
|
|
1402
|
+
let t = e.target instanceof HTMLElement ? e.target : null;
|
|
1403
|
+
t?.closest(".ProseMirror") && (Qn.value = !0, z.value = void 0), !(!R.value && !B.value && !V.value && !z.value) && (t?.closest(ss) || ($(), z.value && us()));
|
|
1404
|
+
}
|
|
1405
|
+
function _s(e) {
|
|
1406
|
+
(e.target instanceof Element ? e.target : null)?.closest(ss) || ($(), fs());
|
|
1407
|
+
}
|
|
1408
|
+
function vs(e) {
|
|
1409
|
+
let t = nn.value;
|
|
1314
1410
|
if (!t || typeof document > "u") return !1;
|
|
1315
1411
|
let n = e.target instanceof Node ? e.target : void 0, r = document.activeElement;
|
|
1316
1412
|
return !!(n && t.contains(n) || r && t.contains(r) || n instanceof Element && n.closest(".gd-contract-template-designer__context-menu"));
|
|
1317
1413
|
}
|
|
1318
|
-
function
|
|
1319
|
-
if (e.key !== "Escape" || !
|
|
1320
|
-
let t =
|
|
1414
|
+
function ys(e) {
|
|
1415
|
+
if (e.key !== "Escape" || !F.value || typeof document > "u") return;
|
|
1416
|
+
let t = nn.value?.querySelector(".gd-contract-template-designer__page-decorations-studio");
|
|
1321
1417
|
if (!t) return;
|
|
1322
|
-
let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(
|
|
1418
|
+
let n = e.target instanceof Element ? e.target : null, r = document.activeElement instanceof Element ? document.activeElement : null, i = !!(n?.closest(cr) || r?.closest(cr)), a = !!(n && t.contains(n) || r && t.contains(r)), o = !!t.querySelector(".ant-select-open, .ant-dropdown-open");
|
|
1323
1419
|
if (i || a && o) {
|
|
1324
|
-
|
|
1420
|
+
sr.add(e);
|
|
1325
1421
|
return;
|
|
1326
1422
|
}
|
|
1327
|
-
!
|
|
1423
|
+
!mr.value && (a || e.target === document) && (e.preventDefault(), e.stopPropagation(), vo());
|
|
1328
1424
|
}
|
|
1329
|
-
function
|
|
1425
|
+
function bs(e) {
|
|
1330
1426
|
if ((e.ctrlKey || e.metaKey) && !e.altKey && e.key.toLowerCase() === "s") {
|
|
1331
|
-
if (
|
|
1332
|
-
e.preventDefault(),
|
|
1427
|
+
if (!hr.value || !vs(e)) return;
|
|
1428
|
+
e.preventDefault(), ri();
|
|
1333
1429
|
return;
|
|
1334
1430
|
}
|
|
1335
1431
|
if (e.key === "Escape") {
|
|
1336
|
-
if (
|
|
1337
|
-
|
|
1432
|
+
if (sr.has(e)) {
|
|
1433
|
+
sr.delete(e);
|
|
1338
1434
|
return;
|
|
1339
1435
|
}
|
|
1340
|
-
let t =
|
|
1341
|
-
!t &&
|
|
1436
|
+
let t = mr.value, n = t || F.value;
|
|
1437
|
+
if (!t && F.value && vo(), $(), as(), n && e.stopPropagation(), !n) {
|
|
1438
|
+
if (z.value) {
|
|
1439
|
+
us(), e.stopPropagation();
|
|
1440
|
+
return;
|
|
1441
|
+
}
|
|
1442
|
+
Fn.value ? to() : P.value = !1;
|
|
1443
|
+
}
|
|
1342
1444
|
}
|
|
1343
1445
|
}
|
|
1344
|
-
function
|
|
1345
|
-
e ===
|
|
1346
|
-
let n =
|
|
1347
|
-
n &&
|
|
1348
|
-
...
|
|
1446
|
+
function xs(e, t) {
|
|
1447
|
+
e === k.value && t.selectedContentImage && (D.value = "", O.value && Q()), e === k.value && (ds(e), cs());
|
|
1448
|
+
let n = zn.value[e];
|
|
1449
|
+
n && gt(n, t) || (zn.value = {
|
|
1450
|
+
...zn.value,
|
|
1349
1451
|
[e]: t
|
|
1350
1452
|
});
|
|
1351
1453
|
}
|
|
1352
|
-
function
|
|
1353
|
-
|
|
1454
|
+
function Ss(e = or.value.rows, t = or.value.cols) {
|
|
1455
|
+
Z({
|
|
1354
1456
|
type: "insert-table",
|
|
1355
1457
|
options: {
|
|
1356
1458
|
rows: Math.min(10, Math.max(1, Math.round(Number(e) || 3))),
|
|
1357
1459
|
cols: Math.min(10, Math.max(1, Math.round(Number(t) || 3))),
|
|
1358
|
-
withHeaderRow: !!
|
|
1460
|
+
withHeaderRow: !!or.value.withHeaderRow
|
|
1359
1461
|
}
|
|
1360
|
-
}),
|
|
1462
|
+
}), I.value = !1, $();
|
|
1361
1463
|
}
|
|
1362
|
-
let
|
|
1464
|
+
let Cs = {
|
|
1363
1465
|
"delete-table-row": {
|
|
1364
1466
|
label: "删除当前行",
|
|
1365
1467
|
countKey: "deleteRow"
|
|
@@ -1373,12 +1475,12 @@ var Lt = {
|
|
|
1373
1475
|
countKey: "deleteTable"
|
|
1374
1476
|
}
|
|
1375
1477
|
};
|
|
1376
|
-
function
|
|
1377
|
-
let t =
|
|
1478
|
+
function ws(e) {
|
|
1479
|
+
let t = B.value;
|
|
1378
1480
|
if (!t) return;
|
|
1379
1481
|
let n = () => {
|
|
1380
|
-
|
|
1381
|
-
}, r =
|
|
1482
|
+
Z(e, t.pageId), $();
|
|
1483
|
+
}, r = Cs[e.type];
|
|
1382
1484
|
if (!r) {
|
|
1383
1485
|
n();
|
|
1384
1486
|
return;
|
|
@@ -1391,16 +1493,16 @@ var Lt = {
|
|
|
1391
1493
|
okType: "danger",
|
|
1392
1494
|
cancelText: "取消",
|
|
1393
1495
|
onOk: n,
|
|
1394
|
-
onCancel: () =>
|
|
1496
|
+
onCancel: () => M.get(t.pageId)?.focus()
|
|
1395
1497
|
});
|
|
1396
1498
|
}
|
|
1397
|
-
function
|
|
1398
|
-
let t =
|
|
1499
|
+
function Ts(e) {
|
|
1500
|
+
let t = nr.value?.getMenuElement();
|
|
1399
1501
|
if (!t) return;
|
|
1400
1502
|
if (e.key === "Escape") {
|
|
1401
1503
|
e.preventDefault(), e.stopPropagation();
|
|
1402
|
-
let t =
|
|
1403
|
-
$(),
|
|
1504
|
+
let t = B.value?.pageId;
|
|
1505
|
+
$(), M.get(t ?? "")?.focus();
|
|
1404
1506
|
return;
|
|
1405
1507
|
}
|
|
1406
1508
|
let n = Array.from(t.querySelectorAll("button:not(:disabled)"));
|
|
@@ -1418,117 +1520,118 @@ var Lt = {
|
|
|
1418
1520
|
let r = (Math.max(0, n.indexOf(document.activeElement)) + (e.key === "ArrowUp" || e.key === "ArrowLeft" ? -1 : 1) + n.length) % n.length;
|
|
1419
1521
|
e.preventDefault(), n[r]?.focus();
|
|
1420
1522
|
}
|
|
1421
|
-
function
|
|
1523
|
+
function Es(e) {
|
|
1422
1524
|
if (e.key !== "Escape") return;
|
|
1423
1525
|
e.preventDefault(), e.stopPropagation();
|
|
1424
|
-
let t =
|
|
1425
|
-
$(),
|
|
1526
|
+
let t = R.value?.pageId;
|
|
1527
|
+
$(), M.get(t ?? "")?.focus();
|
|
1426
1528
|
}
|
|
1427
|
-
function
|
|
1529
|
+
function Ds(e) {
|
|
1428
1530
|
if (e.key !== "Escape") return;
|
|
1429
1531
|
e.preventDefault(), e.stopPropagation();
|
|
1430
|
-
let t =
|
|
1431
|
-
$(),
|
|
1432
|
-
}
|
|
1433
|
-
function
|
|
1434
|
-
|
|
1435
|
-
}
|
|
1436
|
-
return
|
|
1437
|
-
getValue:
|
|
1438
|
-
setValue:
|
|
1439
|
-
getFiles:
|
|
1440
|
-
setFiles:
|
|
1441
|
-
addFile:
|
|
1442
|
-
selectFile:
|
|
1443
|
-
renameFile:
|
|
1444
|
-
removeFile:
|
|
1445
|
-
moveFile:
|
|
1446
|
-
validate:
|
|
1447
|
-
exportTemplate:
|
|
1448
|
-
exportFiles:
|
|
1449
|
-
getSubmitData:
|
|
1450
|
-
clearTemplate:
|
|
1451
|
-
saveDraftCache:
|
|
1452
|
-
loadDraftCache:
|
|
1453
|
-
clearDraftCache:
|
|
1454
|
-
getDraftCacheStatus:
|
|
1455
|
-
insertVariable:
|
|
1456
|
-
insertImage:
|
|
1457
|
-
focus:
|
|
1458
|
-
openPreview:
|
|
1459
|
-
closePreview:
|
|
1460
|
-
openSubmitDataViewer:
|
|
1461
|
-
closeSubmitDataViewer:
|
|
1462
|
-
setServerValidationErrors:
|
|
1463
|
-
clearValidationErrors:
|
|
1464
|
-
scrollToVariable:
|
|
1465
|
-
scrollToSigningPlacement:
|
|
1466
|
-
scrollToPage:
|
|
1467
|
-
setZoom:
|
|
1468
|
-
resetZoom:
|
|
1469
|
-
getZoom:
|
|
1470
|
-
fitWidth:
|
|
1471
|
-
insertSigningPlacement:
|
|
1532
|
+
let t = V.value?.pageId;
|
|
1533
|
+
$(), M.get(t ?? "")?.focus();
|
|
1534
|
+
}
|
|
1535
|
+
function Os(e) {
|
|
1536
|
+
Z({ type: e }), L.value = !1, $();
|
|
1537
|
+
}
|
|
1538
|
+
return Ke({
|
|
1539
|
+
getValue: yo,
|
|
1540
|
+
setValue: bo,
|
|
1541
|
+
getFiles: xo,
|
|
1542
|
+
setFiles: So,
|
|
1543
|
+
addFile: Co,
|
|
1544
|
+
selectFile: wo,
|
|
1545
|
+
renameFile: To,
|
|
1546
|
+
removeFile: Eo,
|
|
1547
|
+
moveFile: Oo,
|
|
1548
|
+
validate: ko,
|
|
1549
|
+
exportTemplate: Mo,
|
|
1550
|
+
exportFiles: No,
|
|
1551
|
+
getSubmitData: ao,
|
|
1552
|
+
clearTemplate: co,
|
|
1553
|
+
saveDraftCache: ri,
|
|
1554
|
+
loadDraftCache: ii,
|
|
1555
|
+
clearDraftCache: ai,
|
|
1556
|
+
getDraftCacheStatus: Fi,
|
|
1557
|
+
insertVariable: Na,
|
|
1558
|
+
insertImage: ua,
|
|
1559
|
+
focus: Bo,
|
|
1560
|
+
openPreview: ro,
|
|
1561
|
+
closePreview: io,
|
|
1562
|
+
openSubmitDataViewer: oo,
|
|
1563
|
+
closeSubmitDataViewer: so,
|
|
1564
|
+
setServerValidationErrors: Ro,
|
|
1565
|
+
clearValidationErrors: zo,
|
|
1566
|
+
scrollToVariable: po,
|
|
1567
|
+
scrollToSigningPlacement: mo,
|
|
1568
|
+
scrollToPage: go,
|
|
1569
|
+
setZoom: qa,
|
|
1570
|
+
resetZoom: Ja,
|
|
1571
|
+
getZoom: Ya,
|
|
1572
|
+
fitWidth: Ua,
|
|
1573
|
+
insertSigningPlacement: Yr,
|
|
1472
1574
|
selectSigningPlacement: Q,
|
|
1473
|
-
buildLocationRules:
|
|
1474
|
-
buildContractLocationRules:
|
|
1475
|
-
}), (e, t) => (
|
|
1575
|
+
buildLocationRules: Fo,
|
|
1576
|
+
buildContractLocationRules: Io
|
|
1577
|
+
}), (e, t) => (_(), Ct("div", {
|
|
1476
1578
|
ref_key: "designerElement",
|
|
1477
|
-
ref:
|
|
1478
|
-
class:
|
|
1579
|
+
ref: nn,
|
|
1580
|
+
class: wt(["gd-contract-template-designer", {
|
|
1479
1581
|
"is-disabled": s.disabled,
|
|
1480
|
-
"is-readonly":
|
|
1481
|
-
"is-fullscreen":
|
|
1582
|
+
"is-readonly": W.value,
|
|
1583
|
+
"is-fullscreen": P.value,
|
|
1584
|
+
"is-immersive": Fn.value
|
|
1482
1585
|
}]),
|
|
1483
|
-
style:
|
|
1586
|
+
style: Tt(tn.value)
|
|
1484
1587
|
}, [
|
|
1485
|
-
|
|
1588
|
+
x.value ? (_(), xt(ft, {
|
|
1486
1589
|
key: 0,
|
|
1487
|
-
files:
|
|
1488
|
-
"active-file-id":
|
|
1489
|
-
readonly:
|
|
1490
|
-
onSelect:
|
|
1491
|
-
onAdd: t[0] ||= (e) =>
|
|
1492
|
-
onRename:
|
|
1493
|
-
onRemove:
|
|
1494
|
-
onMove:
|
|
1590
|
+
files: S.value,
|
|
1591
|
+
"active-file-id": C.value,
|
|
1592
|
+
readonly: W.value,
|
|
1593
|
+
onSelect: wo,
|
|
1594
|
+
onAdd: t[0] ||= (e) => Co(),
|
|
1595
|
+
onRename: To,
|
|
1596
|
+
onRemove: Do,
|
|
1597
|
+
onMove: Oo
|
|
1495
1598
|
}, null, 8, [
|
|
1496
1599
|
"files",
|
|
1497
1600
|
"active-file-id",
|
|
1498
1601
|
"readonly"
|
|
1499
|
-
])) :
|
|
1500
|
-
|
|
1501
|
-
"is-sidebar-collapsed":
|
|
1502
|
-
"is-inspector-collapsed":
|
|
1602
|
+
])) : St("", !0),
|
|
1603
|
+
p("div", { class: wt(["gd-contract-template-designer__layout", {
|
|
1604
|
+
"is-sidebar-collapsed": Mn.value,
|
|
1605
|
+
"is-inspector-collapsed": Nn.value
|
|
1503
1606
|
}]) }, [
|
|
1504
|
-
|
|
1505
|
-
collapsed:
|
|
1506
|
-
pages:
|
|
1507
|
-
variables:
|
|
1508
|
-
"decoration-variable-keys":
|
|
1509
|
-
"signing-placement-navigation-items":
|
|
1510
|
-
"active-page-id":
|
|
1511
|
-
"selected-variable-key":
|
|
1512
|
-
"selected-signing-placement-id":
|
|
1513
|
-
"normalized-max-pages":
|
|
1514
|
-
"page-limit-reached":
|
|
1515
|
-
"selected-page":
|
|
1516
|
-
"selected-page-size":
|
|
1517
|
-
"normalized-page-size-options":
|
|
1518
|
-
"page-size-options":
|
|
1519
|
-
"selected-page-size-option-value":
|
|
1607
|
+
m(pt, {
|
|
1608
|
+
collapsed: Mn.value,
|
|
1609
|
+
pages: E.value.pages,
|
|
1610
|
+
variables: E.value.variables,
|
|
1611
|
+
"decoration-variable-keys": Jr.value,
|
|
1612
|
+
"signing-placement-navigation-items": Sr.value,
|
|
1613
|
+
"active-page-id": k.value,
|
|
1614
|
+
"selected-variable-key": D.value,
|
|
1615
|
+
"selected-signing-placement-id": O.value,
|
|
1616
|
+
"normalized-max-pages": Kr.value,
|
|
1617
|
+
"page-limit-reached": qr.value,
|
|
1618
|
+
"selected-page": q.value,
|
|
1619
|
+
"selected-page-size": wr.value,
|
|
1620
|
+
"normalized-page-size-options": Br.value,
|
|
1621
|
+
"page-size-options": Vr.value,
|
|
1622
|
+
"selected-page-size-option-value": Hr.value,
|
|
1520
1623
|
"show-signing-placement-tools": l.showSigningPlacementTools,
|
|
1521
|
-
readonly:
|
|
1522
|
-
"get-page-size":
|
|
1523
|
-
"get-page-signing-placements":
|
|
1524
|
-
onToggle: t[1] ||= (e) =>
|
|
1525
|
-
onAddPage:
|
|
1526
|
-
onActivatePage:
|
|
1527
|
-
onDuplicatePage:
|
|
1528
|
-
onRemovePage:
|
|
1529
|
-
onPatchPageFormat:
|
|
1530
|
-
onScrollToVariable:
|
|
1531
|
-
onScrollToSigningPlacement:
|
|
1624
|
+
readonly: W.value,
|
|
1625
|
+
"get-page-size": Vi,
|
|
1626
|
+
"get-page-signing-placements": Hi,
|
|
1627
|
+
onToggle: t[1] ||= (e) => Mn.value = !Mn.value,
|
|
1628
|
+
onAddPage: Xi,
|
|
1629
|
+
onActivatePage: ho,
|
|
1630
|
+
onDuplicatePage: Zi,
|
|
1631
|
+
onRemovePage: $i,
|
|
1632
|
+
onPatchPageFormat: Ji,
|
|
1633
|
+
onScrollToVariable: fo,
|
|
1634
|
+
onScrollToSigningPlacement: mo
|
|
1532
1635
|
}, null, 8, [
|
|
1533
1636
|
"collapsed",
|
|
1534
1637
|
"pages",
|
|
@@ -1548,40 +1651,47 @@ var Lt = {
|
|
|
1548
1651
|
"show-signing-placement-tools",
|
|
1549
1652
|
"readonly"
|
|
1550
1653
|
]),
|
|
1551
|
-
|
|
1654
|
+
p("main", {
|
|
1552
1655
|
ref_key: "workspaceElement",
|
|
1553
|
-
ref:
|
|
1656
|
+
ref: an,
|
|
1554
1657
|
class: "gd-contract-template-designer__workspace"
|
|
1555
1658
|
}, [
|
|
1556
|
-
|
|
1659
|
+
Nt(p("div", {
|
|
1660
|
+
id: ln,
|
|
1661
|
+
class: "gd-contract-template-designer__workspace-chrome"
|
|
1662
|
+
}, [m(ze, {
|
|
1557
1663
|
ref_key: "workspaceHeaderElement",
|
|
1558
|
-
ref:
|
|
1559
|
-
summary:
|
|
1560
|
-
"draft-cache-status-text":
|
|
1561
|
-
"draft-cache-status-class":
|
|
1664
|
+
ref: on,
|
|
1665
|
+
summary: Dr.value,
|
|
1666
|
+
"draft-cache-status-text": jr.value,
|
|
1667
|
+
"draft-cache-status-class": Mr.value,
|
|
1562
1668
|
"show-draft-cache-status": s.showDraftCacheStatus,
|
|
1563
1669
|
"show-clear-button": s.showClearButton,
|
|
1564
1670
|
"show-submit-data-viewer": s.showSubmitDataViewer,
|
|
1565
|
-
readonly:
|
|
1566
|
-
"zoom-percent":
|
|
1567
|
-
"zoom-out-disabled":
|
|
1568
|
-
"zoom-in-disabled":
|
|
1569
|
-
"is-fullscreen":
|
|
1570
|
-
|
|
1571
|
-
"page-decorations-
|
|
1572
|
-
"page-decorations-
|
|
1573
|
-
"page-decorations-
|
|
1574
|
-
"page-decorations-enabled-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1671
|
+
readonly: W.value,
|
|
1672
|
+
"zoom-percent": Nr.value,
|
|
1673
|
+
"zoom-out-disabled": N.value <= Wt,
|
|
1674
|
+
"zoom-in-disabled": N.value >= Gt,
|
|
1675
|
+
"is-fullscreen": P.value,
|
|
1676
|
+
immersive: Fn.value,
|
|
1677
|
+
"page-decorations-open": F.value,
|
|
1678
|
+
"page-decorations-studio-id": cn,
|
|
1679
|
+
"page-decorations-preset-label": Or.value,
|
|
1680
|
+
"page-decorations-enabled-count": Ar.value,
|
|
1681
|
+
"page-decorations-enabled-states": kr.value,
|
|
1682
|
+
"chrome-controls-id": ln,
|
|
1683
|
+
onZoomOut: Za,
|
|
1684
|
+
onZoomIn: Xa,
|
|
1685
|
+
onFitWidth: y(Ua),
|
|
1686
|
+
onResetZoom: Ja,
|
|
1687
|
+
onToggleFullscreen: Qa,
|
|
1688
|
+
onToggleImmersive: no,
|
|
1689
|
+
onClear: lo,
|
|
1690
|
+
onValidate: ko,
|
|
1691
|
+
onPreview: ro,
|
|
1692
|
+
onSubmitData: oo,
|
|
1693
|
+
onTogglePageDecorations: _o,
|
|
1694
|
+
onToggleChrome: os
|
|
1585
1695
|
}, null, 8, [
|
|
1586
1696
|
"summary",
|
|
1587
1697
|
"draft-cache-status-text",
|
|
@@ -1594,62 +1704,62 @@ var Lt = {
|
|
|
1594
1704
|
"zoom-out-disabled",
|
|
1595
1705
|
"zoom-in-disabled",
|
|
1596
1706
|
"is-fullscreen",
|
|
1707
|
+
"immersive",
|
|
1597
1708
|
"page-decorations-open",
|
|
1598
1709
|
"page-decorations-preset-label",
|
|
1599
1710
|
"page-decorations-enabled-count",
|
|
1600
1711
|
"page-decorations-enabled-states",
|
|
1601
1712
|
"onFitWidth"
|
|
1602
|
-
]),
|
|
1603
|
-
|
|
1604
|
-
"
|
|
1605
|
-
"
|
|
1606
|
-
"
|
|
1607
|
-
"
|
|
1608
|
-
"
|
|
1609
|
-
"
|
|
1610
|
-
"
|
|
1611
|
-
"
|
|
1612
|
-
"
|
|
1613
|
-
"
|
|
1614
|
-
"
|
|
1615
|
-
"
|
|
1616
|
-
"
|
|
1617
|
-
"
|
|
1618
|
-
"
|
|
1619
|
-
"
|
|
1620
|
-
"
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
"
|
|
1624
|
-
"
|
|
1625
|
-
"
|
|
1626
|
-
"font-family
|
|
1627
|
-
"
|
|
1628
|
-
"font-size
|
|
1629
|
-
"
|
|
1630
|
-
"editor-
|
|
1631
|
-
"
|
|
1632
|
-
"
|
|
1633
|
-
"
|
|
1634
|
-
"
|
|
1635
|
-
"image-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
onFontSizeKeydown: To
|
|
1713
|
+
]), m(Be, {
|
|
1714
|
+
"variable-insert-popover-open": Vn.value,
|
|
1715
|
+
"onUpdate:variableInsertPopoverOpen": t[2] ||= (e) => Vn.value = e,
|
|
1716
|
+
"image-insert-popover-open": Hn.value,
|
|
1717
|
+
"onUpdate:imageInsertPopoverOpen": t[3] ||= (e) => Hn.value = e,
|
|
1718
|
+
"image-insert-url": Un.value,
|
|
1719
|
+
"onUpdate:imageInsertUrl": t[4] ||= (e) => Un.value = e,
|
|
1720
|
+
"image-insert-width": Wn.value,
|
|
1721
|
+
"onUpdate:imageInsertWidth": t[5] ||= (e) => Wn.value = e,
|
|
1722
|
+
"image-insert-height": Gn.value,
|
|
1723
|
+
"onUpdate:imageInsertHeight": t[6] ||= (e) => Gn.value = e,
|
|
1724
|
+
"table-insert-popover-open": I.value,
|
|
1725
|
+
"onUpdate:tableInsertPopoverOpen": t[7] ||= (e) => I.value = e,
|
|
1726
|
+
"table-actions-popover-open": L.value,
|
|
1727
|
+
"onUpdate:tableActionsPopoverOpen": t[8] ||= (e) => L.value = e,
|
|
1728
|
+
"table-insert-draft": or.value,
|
|
1729
|
+
"onUpdate:tableInsertDraft": t[9] ||= (e) => or.value = e,
|
|
1730
|
+
"toolbar-more-open": Rn.value,
|
|
1731
|
+
"onUpdate:toolbarMoreOpen": t[10] ||= (e) => Rn.value = e,
|
|
1732
|
+
readonly: W.value,
|
|
1733
|
+
"editor-state": pi.value,
|
|
1734
|
+
"current-block-format": mi.value,
|
|
1735
|
+
"block-format-options": Lr,
|
|
1736
|
+
"font-family-select-options": Fr.value,
|
|
1737
|
+
"current-editor-font-family": hi.value,
|
|
1738
|
+
"font-size-preset-options": yi.value,
|
|
1739
|
+
"current-editor-font-size": gi.value,
|
|
1740
|
+
"editor-font-size-search-value": Bn.value,
|
|
1741
|
+
"current-editor-text-color": _i.value,
|
|
1742
|
+
"body-control-tool-items": Gr.value,
|
|
1743
|
+
"page-limit-reached": qr.value,
|
|
1744
|
+
"normalized-max-pages": Kr.value,
|
|
1745
|
+
"image-processing": qn.value,
|
|
1746
|
+
"image-insert-error": Kn.value,
|
|
1747
|
+
onCommand: t[11] ||= (e) => Z(e),
|
|
1748
|
+
onPatchBlockFormat: Ho,
|
|
1749
|
+
onPatchFontFamily: Wo,
|
|
1750
|
+
onPatchFontSize: Uo,
|
|
1751
|
+
onPatchColor: Go,
|
|
1752
|
+
onPatchTextAlign: Vo,
|
|
1753
|
+
onInsertVariable: ma,
|
|
1754
|
+
onOpenImageFile: da,
|
|
1755
|
+
onInsertImageUrl: pa,
|
|
1756
|
+
onAddPage: Xi,
|
|
1757
|
+
onInsertTable: Ss,
|
|
1758
|
+
onTableAction: Os,
|
|
1759
|
+
onFontSizeSearch: qo,
|
|
1760
|
+
onFontSizeCommit: Jo,
|
|
1761
|
+
onFontSizeDropdownChange: Xo,
|
|
1762
|
+
onFontSizeKeydown: Yo
|
|
1653
1763
|
}, null, 8, [
|
|
1654
1764
|
"variable-insert-popover-open",
|
|
1655
1765
|
"image-insert-popover-open",
|
|
@@ -1674,50 +1784,79 @@ var Lt = {
|
|
|
1674
1784
|
"normalized-max-pages",
|
|
1675
1785
|
"image-processing",
|
|
1676
1786
|
"image-insert-error"
|
|
1677
|
-
]),
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1787
|
+
])], 512), [[jt, !Pn.value]]),
|
|
1788
|
+
Pn.value ? (_(), xt(y(It), {
|
|
1789
|
+
key: 0,
|
|
1790
|
+
title: "展开工具区"
|
|
1791
|
+
}, {
|
|
1792
|
+
default: Mt(() => [p("button", {
|
|
1793
|
+
ref_key: "workspaceChromeHandleElement",
|
|
1794
|
+
ref: un,
|
|
1795
|
+
type: "button",
|
|
1796
|
+
class: "gd-contract-template-designer__workspace-chrome-handle",
|
|
1797
|
+
"aria-label": "展开工具区",
|
|
1798
|
+
"aria-expanded": !1,
|
|
1799
|
+
"aria-controls": ln,
|
|
1800
|
+
onClick: os
|
|
1801
|
+
}, [m(y(zt), { "aria-hidden": "true" })], 512)]),
|
|
1802
|
+
_: 1
|
|
1803
|
+
})) : St("", !0),
|
|
1804
|
+
Fn.value && !F.value ? (_(), Ct("button", {
|
|
1805
|
+
key: 1,
|
|
1806
|
+
ref_key: "immersiveExitElement",
|
|
1807
|
+
ref: In,
|
|
1808
|
+
type: "button",
|
|
1809
|
+
class: "gd-contract-template-designer__immersive-exit",
|
|
1810
|
+
"aria-label": "退出沉浸写作",
|
|
1811
|
+
onClick: to
|
|
1812
|
+
}, [
|
|
1813
|
+
m(y(Rt), { "aria-hidden": "true" }),
|
|
1814
|
+
t[25] ||= p("span", { class: "gd-contract-template-designer__immersive-exit-label" }, "退出沉浸", -1),
|
|
1815
|
+
t[26] ||= p("kbd", null, "Esc", -1)
|
|
1816
|
+
], 512)) : St("", !0),
|
|
1817
|
+
A.value ? (_(), Ct("section", Bt, [m(y(Pt), {
|
|
1818
|
+
type: Tr.value ? "success" : "error",
|
|
1819
|
+
message: Er.value,
|
|
1681
1820
|
"show-icon": ""
|
|
1682
|
-
}, null, 8, ["type", "message"]),
|
|
1821
|
+
}, null, 8, ["type", "message"]), j.value.length ? (_(), Ct("div", Vt, [(_(!0), Ct(yt, null, Ot(j.value, (e) => (_(), Ct("button", {
|
|
1683
1822
|
key: `${e.id}-${e.message}`,
|
|
1684
1823
|
type: "button",
|
|
1685
1824
|
class: "gd-contract-template-designer__validation-item",
|
|
1686
|
-
onClick: (t) =>
|
|
1687
|
-
}, [
|
|
1688
|
-
|
|
1825
|
+
onClick: (t) => Ao(e)
|
|
1826
|
+
}, [p("span", null, kt(e.message), 1), p("small", null, kt(jo(e)), 1)], 8, Ht))), 128))])) : St("", !0)])) : St("", !0),
|
|
1827
|
+
p("div", {
|
|
1689
1828
|
ref_key: "canvasElement",
|
|
1690
|
-
ref:
|
|
1829
|
+
ref: rn,
|
|
1691
1830
|
class: "gd-contract-template-designer__canvas"
|
|
1692
|
-
}, [(
|
|
1693
|
-
key: `${
|
|
1831
|
+
}, [(_(!0), Ct(yt, null, Ot(E.value.pages, (e, n) => (_(), xt(Le, {
|
|
1832
|
+
key: `${C.value}:${e.id}`,
|
|
1694
1833
|
ref_for: !0,
|
|
1695
|
-
ref: (t) =>
|
|
1834
|
+
ref: (t) => Ii(e.id, t),
|
|
1696
1835
|
page: e,
|
|
1697
1836
|
"page-index": n,
|
|
1698
|
-
"page-size":
|
|
1699
|
-
"page-decorations":
|
|
1700
|
-
"total-pages":
|
|
1701
|
-
variables:
|
|
1702
|
-
"selected-variable-key":
|
|
1703
|
-
"signing-placements": l.showSigningPlacementTools ?
|
|
1704
|
-
"selected-signing-placement-id":
|
|
1705
|
-
active:
|
|
1837
|
+
"page-size": Vi(e),
|
|
1838
|
+
"page-decorations": E.value.pageDecorations,
|
|
1839
|
+
"total-pages": E.value.pages.length,
|
|
1840
|
+
variables: E.value.variables,
|
|
1841
|
+
"selected-variable-key": D.value,
|
|
1842
|
+
"signing-placements": l.showSigningPlacementTools ? Hi(e.id) : [],
|
|
1843
|
+
"selected-signing-placement-id": O.value,
|
|
1844
|
+
active: k.value === e.id,
|
|
1706
1845
|
readonly: s.readonly,
|
|
1707
1846
|
disabled: s.disabled,
|
|
1708
|
-
zoom:
|
|
1709
|
-
"process-image-file":
|
|
1710
|
-
onPageUpdate:
|
|
1711
|
-
onVariableDrop:
|
|
1712
|
-
onVariableSelect:
|
|
1713
|
-
onSigningPlacementDrop:
|
|
1714
|
-
onSigningPlacementSelect:
|
|
1715
|
-
onSigningPlacementMove:
|
|
1716
|
-
onSigningPlacementRemove:
|
|
1717
|
-
onEditorFocus: t[12] ||= (e) =>
|
|
1718
|
-
onEditorStateChange:
|
|
1719
|
-
onEditorContextMenu:
|
|
1720
|
-
onVariableMoveBlocked: t[13] ||= (e) =>
|
|
1847
|
+
zoom: N.value,
|
|
1848
|
+
"process-image-file": la,
|
|
1849
|
+
onPageUpdate: Bi,
|
|
1850
|
+
onVariableDrop: ga,
|
|
1851
|
+
onVariableSelect: _a,
|
|
1852
|
+
onSigningPlacementDrop: y(Xr),
|
|
1853
|
+
onSigningPlacementSelect: Wi,
|
|
1854
|
+
onSigningPlacementMove: y($r),
|
|
1855
|
+
onSigningPlacementRemove: y(ni),
|
|
1856
|
+
onEditorFocus: t[12] ||= (e) => ho(e, !1),
|
|
1857
|
+
onEditorStateChange: xs,
|
|
1858
|
+
onEditorContextMenu: is,
|
|
1859
|
+
onVariableMoveBlocked: t[13] ||= (e) => H.value = "变量只能在当前页内移动,跨页移动尚未支持。"
|
|
1721
1860
|
}, null, 8, [
|
|
1722
1861
|
"page",
|
|
1723
1862
|
"page-index",
|
|
@@ -1736,20 +1875,20 @@ var Lt = {
|
|
|
1736
1875
|
"onSigningPlacementMove",
|
|
1737
1876
|
"onSigningPlacementRemove"
|
|
1738
1877
|
]))), 128))], 512),
|
|
1739
|
-
Nt(
|
|
1878
|
+
Nt(m(ht, {
|
|
1740
1879
|
ref_key: "pageDecorationsStudioElement",
|
|
1741
|
-
ref:
|
|
1742
|
-
id:
|
|
1743
|
-
open:
|
|
1744
|
-
decorations:
|
|
1745
|
-
variables:
|
|
1746
|
-
"font-family-options":
|
|
1880
|
+
ref: sn,
|
|
1881
|
+
id: cn,
|
|
1882
|
+
open: F.value,
|
|
1883
|
+
decorations: E.value.pageDecorations,
|
|
1884
|
+
variables: E.value.variables,
|
|
1885
|
+
"font-family-options": Fr.value,
|
|
1747
1886
|
readonly: s.readonly,
|
|
1748
1887
|
disabled: s.disabled,
|
|
1749
|
-
"active-tab":
|
|
1750
|
-
"onUpdate:activeTab": t[14] ||= (e) =>
|
|
1751
|
-
onChange:
|
|
1752
|
-
onClose:
|
|
1888
|
+
"active-tab": Ln.value,
|
|
1889
|
+
"onUpdate:activeTab": t[14] ||= (e) => Ln.value = e,
|
|
1890
|
+
onChange: xa,
|
|
1891
|
+
onClose: vo
|
|
1753
1892
|
}, null, 8, [
|
|
1754
1893
|
"open",
|
|
1755
1894
|
"decorations",
|
|
@@ -1758,52 +1897,52 @@ var Lt = {
|
|
|
1758
1897
|
"readonly",
|
|
1759
1898
|
"disabled",
|
|
1760
1899
|
"active-tab"
|
|
1761
|
-
]), [[
|
|
1900
|
+
]), [[jt, F.value]])
|
|
1762
1901
|
], 512),
|
|
1763
|
-
|
|
1764
|
-
collapsed:
|
|
1902
|
+
m(mt, {
|
|
1903
|
+
collapsed: Nn.value,
|
|
1765
1904
|
readonly: s.readonly,
|
|
1766
1905
|
disabled: s.disabled,
|
|
1767
1906
|
"show-signing-placement-tools": l.showSigningPlacementTools,
|
|
1768
|
-
"body-control-tool-items":
|
|
1769
|
-
"signing-placement-tools":
|
|
1770
|
-
"signing-placements":
|
|
1771
|
-
"selected-signing-placement":
|
|
1772
|
-
"selected-signing-placement-page-size":
|
|
1773
|
-
"selected-variable":
|
|
1774
|
-
variables:
|
|
1775
|
-
"current-variable-font-family":
|
|
1776
|
-
"font-family-select-options":
|
|
1777
|
-
"text-align-options":
|
|
1778
|
-
"border-style-options":
|
|
1779
|
-
"object-fit-options":
|
|
1780
|
-
"selected-variable-width-max":
|
|
1781
|
-
"selected-variable-height-max":
|
|
1782
|
-
"min-font-size":
|
|
1783
|
-
"max-font-size":
|
|
1784
|
-
"default-multiline-rows":
|
|
1785
|
-
"resolve-signing-placement-type-icon":
|
|
1786
|
-
"signing-placement-type-labels":
|
|
1787
|
-
onToggle: t[15] ||= (e) =>
|
|
1788
|
-
onVariableDragStart:
|
|
1789
|
-
onInsertVariable:
|
|
1790
|
-
onSigningPlacementDragStart:
|
|
1791
|
-
onInsertSigningPlacement:
|
|
1792
|
-
onPatchSigningPlacement:
|
|
1793
|
-
onDuplicateSigningPlacement: t[16] ||= (e) =>
|
|
1794
|
-
onRemoveSigningPlacement: t[17] ||= (e) =>
|
|
1795
|
-
onDuplicateVariable:
|
|
1796
|
-
onRemoveVariable:
|
|
1797
|
-
onPatchVariable:
|
|
1798
|
-
onRenameVariable:
|
|
1799
|
-
onPatchStyle:
|
|
1800
|
-
onPatchMultiline:
|
|
1801
|
-
onPatchRows:
|
|
1802
|
-
onPatchFontFamily:
|
|
1803
|
-
onPatchFontSize:
|
|
1804
|
-
onPatchTextAlign:
|
|
1805
|
-
onPatchBorderStyle:
|
|
1806
|
-
onPatchObjectFit:
|
|
1907
|
+
"body-control-tool-items": Gr.value,
|
|
1908
|
+
"signing-placement-tools": Ur.value,
|
|
1909
|
+
"signing-placements": K.value,
|
|
1910
|
+
"selected-signing-placement": xr.value,
|
|
1911
|
+
"selected-signing-placement-page-size": Cr.value,
|
|
1912
|
+
"selected-variable": G.value,
|
|
1913
|
+
variables: E.value.variables,
|
|
1914
|
+
"current-variable-font-family": vi.value,
|
|
1915
|
+
"font-family-select-options": Fr.value,
|
|
1916
|
+
"text-align-options": y(Ir),
|
|
1917
|
+
"border-style-options": Rr,
|
|
1918
|
+
"object-fit-options": zr,
|
|
1919
|
+
"selected-variable-width-max": di.value,
|
|
1920
|
+
"selected-variable-height-max": fi.value,
|
|
1921
|
+
"min-font-size": Qt,
|
|
1922
|
+
"max-font-size": $t,
|
|
1923
|
+
"default-multiline-rows": y(3),
|
|
1924
|
+
"resolve-signing-placement-type-icon": y(dt),
|
|
1925
|
+
"signing-placement-type-labels": y(n),
|
|
1926
|
+
onToggle: t[15] ||= (e) => Nn.value = !Nn.value,
|
|
1927
|
+
onVariableDragStart: Ba,
|
|
1928
|
+
onInsertVariable: Pa,
|
|
1929
|
+
onSigningPlacementDragStart: y(Qr),
|
|
1930
|
+
onInsertSigningPlacement: y(Zr),
|
|
1931
|
+
onPatchSigningPlacement: y(ei),
|
|
1932
|
+
onDuplicateSigningPlacement: t[16] ||= (e) => y(ti)(),
|
|
1933
|
+
onRemoveSigningPlacement: t[17] ||= (e) => y(ni)(),
|
|
1934
|
+
onDuplicateVariable: Ma,
|
|
1935
|
+
onRemoveVariable: Aa,
|
|
1936
|
+
onPatchVariable: ya,
|
|
1937
|
+
onRenameVariable: ba,
|
|
1938
|
+
onPatchStyle: Ta,
|
|
1939
|
+
onPatchMultiline: Oa,
|
|
1940
|
+
onPatchRows: ka,
|
|
1941
|
+
onPatchFontFamily: Ea,
|
|
1942
|
+
onPatchFontSize: Da,
|
|
1943
|
+
onPatchTextAlign: Sa,
|
|
1944
|
+
onPatchBorderStyle: Ca,
|
|
1945
|
+
onPatchObjectFit: wa
|
|
1807
1946
|
}, null, 8, [
|
|
1808
1947
|
"collapsed",
|
|
1809
1948
|
"readonly",
|
|
@@ -1829,83 +1968,83 @@ var Lt = {
|
|
|
1829
1968
|
"onPatchSigningPlacement"
|
|
1830
1969
|
])
|
|
1831
1970
|
], 2),
|
|
1832
|
-
(
|
|
1833
|
-
|
|
1971
|
+
(_(), xt(bt, { to: "body" }, [
|
|
1972
|
+
B.value ? (_(), xt(Re, {
|
|
1834
1973
|
key: 0,
|
|
1835
1974
|
ref_key: "tableContextMenuElement",
|
|
1836
|
-
ref:
|
|
1837
|
-
capabilities:
|
|
1838
|
-
"active-alignment":
|
|
1839
|
-
style:
|
|
1840
|
-
left: `${
|
|
1841
|
-
top: `${
|
|
1975
|
+
ref: nr,
|
|
1976
|
+
capabilities: B.value.capabilities,
|
|
1977
|
+
"active-alignment": B.value.activeAlignment,
|
|
1978
|
+
style: Tt({
|
|
1979
|
+
left: `${B.value.x}px`,
|
|
1980
|
+
top: `${B.value.y}px`
|
|
1842
1981
|
}),
|
|
1843
|
-
onExecute:
|
|
1844
|
-
onKeydown:
|
|
1982
|
+
onExecute: ws,
|
|
1983
|
+
onKeydown: Ts
|
|
1845
1984
|
}, null, 8, [
|
|
1846
1985
|
"capabilities",
|
|
1847
1986
|
"active-alignment",
|
|
1848
1987
|
"style"
|
|
1849
|
-
])) :
|
|
1850
|
-
|
|
1988
|
+
])) : St("", !0),
|
|
1989
|
+
V.value ? (_(), xt(Ue, {
|
|
1851
1990
|
key: 1,
|
|
1852
1991
|
ref_key: "imageContextMenuElement",
|
|
1853
|
-
ref:
|
|
1854
|
-
width:
|
|
1855
|
-
"onUpdate:width": t[18] ||= (e) =>
|
|
1856
|
-
height:
|
|
1857
|
-
"onUpdate:height": t[19] ||= (e) =>
|
|
1858
|
-
x:
|
|
1859
|
-
y:
|
|
1860
|
-
readonly:
|
|
1861
|
-
onRestore:
|
|
1862
|
-
onApply:
|
|
1863
|
-
onKeydown:
|
|
1992
|
+
ref: rr,
|
|
1993
|
+
width: ir.value,
|
|
1994
|
+
"onUpdate:width": t[18] ||= (e) => ir.value = e,
|
|
1995
|
+
height: ar.value,
|
|
1996
|
+
"onUpdate:height": t[19] ||= (e) => ar.value = e,
|
|
1997
|
+
x: V.value.x,
|
|
1998
|
+
y: V.value.y,
|
|
1999
|
+
readonly: W.value,
|
|
2000
|
+
onRestore: rs,
|
|
2001
|
+
onApply: ns,
|
|
2002
|
+
onKeydown: Ds
|
|
1864
2003
|
}, null, 8, [
|
|
1865
2004
|
"width",
|
|
1866
2005
|
"height",
|
|
1867
2006
|
"x",
|
|
1868
2007
|
"y",
|
|
1869
2008
|
"readonly"
|
|
1870
|
-
])) :
|
|
1871
|
-
|
|
2009
|
+
])) : St("", !0),
|
|
2010
|
+
R.value ? (_(), xt(Ve, {
|
|
1872
2011
|
key: 2,
|
|
1873
2012
|
ref_key: "textContextMenuElement",
|
|
1874
|
-
ref:
|
|
1875
|
-
"bind-open":
|
|
1876
|
-
"onUpdate:bindOpen": t[20] ||= (e) =>
|
|
1877
|
-
"bind-keyword":
|
|
1878
|
-
"onUpdate:bindKeyword": t[21] ||= (e) =>
|
|
1879
|
-
x:
|
|
1880
|
-
y:
|
|
1881
|
-
"has-selection":
|
|
1882
|
-
"editor-state":
|
|
1883
|
-
"font-size-preset-options":
|
|
1884
|
-
"current-editor-font-size":
|
|
1885
|
-
"editor-font-size-search-value":
|
|
1886
|
-
"text-align-options":
|
|
1887
|
-
"current-editor-text-color":
|
|
1888
|
-
"body-control-tool-items":
|
|
1889
|
-
"text-menu-bindable-variables":
|
|
1890
|
-
"page-limit-reached":
|
|
1891
|
-
"table-insert-draft":
|
|
1892
|
-
"variables-count":
|
|
1893
|
-
"resolve-bind-variable-type-label":
|
|
1894
|
-
onCommand:
|
|
1895
|
-
onClipboard:
|
|
1896
|
-
onOpenImage:
|
|
1897
|
-
onAddPage:
|
|
1898
|
-
onInsertVariable:
|
|
1899
|
-
onBindVariable:
|
|
1900
|
-
onOpenBindPanel:
|
|
1901
|
-
onKeydown:
|
|
1902
|
-
onPatchFontSize:
|
|
1903
|
-
onPatchTextAlign:
|
|
1904
|
-
onPatchColor:
|
|
1905
|
-
onFontSizeSearch:
|
|
1906
|
-
onFontSizeCommit:
|
|
1907
|
-
onFontSizeDropdownChange:
|
|
1908
|
-
onFontSizeKeydown:
|
|
2013
|
+
ref: Jn,
|
|
2014
|
+
"bind-open": er.value,
|
|
2015
|
+
"onUpdate:bindOpen": t[20] ||= (e) => er.value = e,
|
|
2016
|
+
"bind-keyword": tr.value,
|
|
2017
|
+
"onUpdate:bindKeyword": t[21] ||= (e) => tr.value = e,
|
|
2018
|
+
x: R.value.x,
|
|
2019
|
+
y: R.value.y,
|
|
2020
|
+
"has-selection": R.value.hasSelection,
|
|
2021
|
+
"editor-state": pi.value,
|
|
2022
|
+
"font-size-preset-options": yi.value,
|
|
2023
|
+
"current-editor-font-size": gi.value,
|
|
2024
|
+
"editor-font-size-search-value": Bn.value,
|
|
2025
|
+
"text-align-options": y(Ir),
|
|
2026
|
+
"current-editor-text-color": _i.value,
|
|
2027
|
+
"body-control-tool-items": Gr.value,
|
|
2028
|
+
"text-menu-bindable-variables": ui.value,
|
|
2029
|
+
"page-limit-reached": qr.value,
|
|
2030
|
+
"table-insert-draft": or.value,
|
|
2031
|
+
"variables-count": E.value.variables.length,
|
|
2032
|
+
"resolve-bind-variable-type-label": Ra,
|
|
2033
|
+
onCommand: Li,
|
|
2034
|
+
onClipboard: Ri,
|
|
2035
|
+
onOpenImage: da,
|
|
2036
|
+
onAddPage: ha,
|
|
2037
|
+
onInsertVariable: Fa,
|
|
2038
|
+
onBindVariable: La,
|
|
2039
|
+
onOpenBindPanel: za,
|
|
2040
|
+
onKeydown: Es,
|
|
2041
|
+
onPatchFontSize: Uo,
|
|
2042
|
+
onPatchTextAlign: Vo,
|
|
2043
|
+
onPatchColor: Ko,
|
|
2044
|
+
onFontSizeSearch: qo,
|
|
2045
|
+
onFontSizeCommit: Jo,
|
|
2046
|
+
onFontSizeDropdownChange: Xo,
|
|
2047
|
+
onFontSizeKeydown: Yo
|
|
1909
2048
|
}, null, 8, [
|
|
1910
2049
|
"bind-open",
|
|
1911
2050
|
"bind-keyword",
|
|
@@ -1923,28 +2062,59 @@ var Lt = {
|
|
|
1923
2062
|
"page-limit-reached",
|
|
1924
2063
|
"table-insert-draft",
|
|
1925
2064
|
"variables-count"
|
|
1926
|
-
])) :
|
|
2065
|
+
])) : St("", !0),
|
|
2066
|
+
z.value ? (_(), xt(He, {
|
|
2067
|
+
key: 3,
|
|
2068
|
+
ref_key: "textBubbleElement",
|
|
2069
|
+
ref: Yn,
|
|
2070
|
+
x: z.value.x,
|
|
2071
|
+
y: z.value.y,
|
|
2072
|
+
"editor-state": pi.value,
|
|
2073
|
+
"font-size-preset-options": yi.value,
|
|
2074
|
+
"current-editor-font-size": gi.value,
|
|
2075
|
+
"editor-font-size-search-value": Bn.value,
|
|
2076
|
+
"current-editor-text-color": _i.value,
|
|
2077
|
+
"text-align-options": y(Ir),
|
|
2078
|
+
onCommand: Z,
|
|
2079
|
+
onPatchFontSize: Uo,
|
|
2080
|
+
onPatchTextAlign: Vo,
|
|
2081
|
+
onPatchColor: Ko,
|
|
2082
|
+
onFontSizeSearch: qo,
|
|
2083
|
+
onFontSizeCommit: Jo,
|
|
2084
|
+
onFontSizeDropdownChange: Xo,
|
|
2085
|
+
onFontSizeKeydown: Yo,
|
|
2086
|
+
onMore: hs
|
|
2087
|
+
}, null, 8, [
|
|
2088
|
+
"x",
|
|
2089
|
+
"y",
|
|
2090
|
+
"editor-state",
|
|
2091
|
+
"font-size-preset-options",
|
|
2092
|
+
"current-editor-font-size",
|
|
2093
|
+
"editor-font-size-search-value",
|
|
2094
|
+
"current-editor-text-color",
|
|
2095
|
+
"text-align-options"
|
|
2096
|
+
])) : St("", !0)
|
|
1927
2097
|
])),
|
|
1928
|
-
|
|
2098
|
+
p("input", {
|
|
1929
2099
|
ref_key: "imageFileInputElement",
|
|
1930
|
-
ref:
|
|
2100
|
+
ref: dn,
|
|
1931
2101
|
class: "gd-contract-template-designer__hidden-file-input",
|
|
1932
2102
|
type: "file",
|
|
1933
2103
|
accept: "image/png,image/jpeg,image/webp,image/gif,image/bmp",
|
|
1934
2104
|
tabindex: "-1",
|
|
1935
2105
|
"aria-hidden": "true",
|
|
1936
|
-
onChange:
|
|
2106
|
+
onChange: fa
|
|
1937
2107
|
}, null, 544),
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
open:
|
|
1941
|
-
"onUpdate:open": t[22] ||= (e) =>
|
|
1942
|
-
"preview-pages":
|
|
1943
|
-
"preview-file-groups":
|
|
1944
|
-
"preview-active-group":
|
|
1945
|
-
"preview-snapshot":
|
|
1946
|
-
onCancel:
|
|
1947
|
-
onSelectFile: t[23] ||= (e) =>
|
|
2108
|
+
p("span", Ut, kt(H.value), 1),
|
|
2109
|
+
m(We, {
|
|
2110
|
+
open: En.value,
|
|
2111
|
+
"onUpdate:open": t[22] ||= (e) => En.value = e,
|
|
2112
|
+
"preview-pages": vr.value,
|
|
2113
|
+
"preview-file-groups": yr.value,
|
|
2114
|
+
"preview-active-group": br.value,
|
|
2115
|
+
"preview-snapshot": Dn.value,
|
|
2116
|
+
onCancel: io,
|
|
2117
|
+
onSelectFile: t[23] ||= (e) => kn.value = e
|
|
1948
2118
|
}, null, 8, [
|
|
1949
2119
|
"open",
|
|
1950
2120
|
"preview-pages",
|
|
@@ -1952,14 +2122,14 @@ var Lt = {
|
|
|
1952
2122
|
"preview-active-group",
|
|
1953
2123
|
"preview-snapshot"
|
|
1954
2124
|
]),
|
|
1955
|
-
|
|
1956
|
-
open:
|
|
1957
|
-
"onUpdate:open": t[24] ||= (e) =>
|
|
1958
|
-
json:
|
|
1959
|
-
onCancel:
|
|
2125
|
+
m(Ge, {
|
|
2126
|
+
open: An.value,
|
|
2127
|
+
"onUpdate:open": t[24] ||= (e) => An.value = e,
|
|
2128
|
+
json: jn.value,
|
|
2129
|
+
onCancel: so
|
|
1960
2130
|
}, null, 8, ["open", "json"])
|
|
1961
2131
|
], 6));
|
|
1962
2132
|
}
|
|
1963
2133
|
});
|
|
1964
2134
|
//#endregion
|
|
1965
|
-
export {
|
|
2135
|
+
export { tn as default };
|