@guodun/antdv 1.4.1 → 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/ContractTemplateDesignerInspector.vue.mjs +208 -180
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +2 -1
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.mjs +690 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +253 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.mjs +87 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.mjs +98 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.mjs +550 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.mjs +117 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.mjs +96 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +51 -26
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.mjs +56 -33
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.mjs +29 -0
- package/dist/es/components/pro-contract-template-designer/src/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/ContractTemplateTextContextMenu.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.mjs +390 -0
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +332 -263
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1442 -2287
- package/dist/es/components/pro-contract-template-designer/src/composables/use-auto-pagination.mjs +71 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-designer-files.mjs +11 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-draft-cache-session.mjs +111 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.mjs +79 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +189 -160
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-files.mjs +35 -22
- package/dist/es/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.mjs +71 -0
- package/dist/es/components/pro-contract-template-designer/src/constants.mjs +71 -10
- package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/block-style.mjs +43 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/context-menu-viewport.mjs +13 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/editor-state.mjs +7 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +398 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/serialize-fingerprint.mjs +6 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +88 -72
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/index.mjs +20 -20
- package/dist/lib/components/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/ContractTemplateDesignerInspector.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/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/ContractTemplateTextContextMenu.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-auto-pagination.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-designer-files.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-draft-cache-session.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-files.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/constants.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/editor-extensions.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/block-style.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/context-menu-viewport.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/editor-state.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/serialize-fingerprint.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/types/components/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/ContractTemplateDesignerInspector.vue.d.ts +3 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +104 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +60 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.d.ts +27 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.d.ts +13 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.d.ts +28 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.d.ts +77 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.d.ts +36 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.d.ts +5 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.vue.d.ts +4 -4
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererToolbar.vue.d.ts +4 -4
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.d.ts +12 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.vue.d.ts +43 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.d.ts +77 -0
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +30 -32
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +456 -12
- package/dist/types/components/pro-contract-template-designer/src/composables/use-auto-pagination.d.ts +43 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-designer-files.d.ts +22 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-draft-cache-session.d.ts +41 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.d.ts +49 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +15 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts +13 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.d.ts +19 -0
- package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +7 -1
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +89 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/block-style.d.ts +4 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/context-menu-viewport.d.ts +25 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/editor-state.d.ts +8 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/page-decorations.d.ts +90 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/serialize-fingerprint.d.ts +8 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +4 -1
- package/package.json +3 -3
package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
1
|
import e from "./ContractSigningTemplatePage.mjs";
|
|
2
2
|
import "./constants.mjs";
|
|
3
|
-
import { canResizeContractSigningPlacement as t, clampContractSigningPlacement as n, getContractSigningPlacementDistances as r, getContractSigningRuleGeometry as i, moveContractSigningPlacementByDisplayDelta as a, resizeContractSigningSealGeometry as o, snapContractSigningPlacement as
|
|
4
|
-
import { buildContractSigningTemplateRenderPages as
|
|
5
|
-
import { isContractSigningPageUsable as
|
|
6
|
-
import { CONTRACT_SIGNING_FALLBACK_PAGE_SIZE as
|
|
7
|
-
import { useFitWidthZoom as
|
|
8
|
-
import { getContractSigningPlacementVisual as
|
|
9
|
-
import { Fragment as
|
|
10
|
-
import { Button as
|
|
11
|
-
import { useElementSize as
|
|
12
|
-
import { ColumnWidthOutlined as
|
|
3
|
+
import { canResizeContractSigningPlacement as t, clampContractSigningPlacement as n, getContractSigningPlacementDistances as r, getContractSigningRuleGeometry as i, moveContractSigningPlacementByDisplayDelta as a, resizeContractSigningSealGeometry as o, snapContractSigningPlacement as s } from "./coordinates.mjs";
|
|
4
|
+
import { buildContractSigningTemplateRenderPages as c, getContractSigningTemplateDisplayError as l, isContractSigningTemplateFile as u } from "./template-source.mjs";
|
|
5
|
+
import { isContractSigningPageUsable as d } from "./location-rules.mjs";
|
|
6
|
+
import { CONTRACT_SIGNING_FALLBACK_PAGE_SIZE as f, buildPageLayouts as p, contentPointToPagePoint as m, findPageAtOffset as h, getContractSigningAutoScrollDelta as g, getPageLayoutScrollTop as _, getPageLayoutsContentSize as ee, getVisibleRange as te } from "./page-layout.mjs";
|
|
7
|
+
import { useFitWidthZoom as ne } from "../../pro-contract-template-designer/src/composables/use-fit-width-zoom.mjs";
|
|
8
|
+
import { getContractSigningPlacementVisual as re } from "./signing-visuals.mjs";
|
|
9
|
+
import { Fragment as v, computed as y, createBlock as ie, createCommentVNode as ae, createElementBlock as b, createElementVNode as x, createTextVNode as oe, createVNode as S, defineComponent as C, nextTick as se, normalizeClass as ce, normalizeStyle as w, onBeforeUnmount as le, onMounted as ue, openBlock as T, ref as de, renderList as E, shallowRef as D, toDisplayString as O, unref as k, watch as fe, withCtx as A, withKeys as pe, withModifiers as j } from "vue";
|
|
10
|
+
import { Button as M } from "ant-design-vue";
|
|
11
|
+
import { useElementSize as me } from "@vueuse/core";
|
|
12
|
+
import { ColumnWidthOutlined as he, LeftOutlined as ge, RightOutlined as _e, ZoomInOutlined as ve, ZoomOutOutlined as ye } from "@ant-design/icons-vue";
|
|
13
13
|
//#region src/components/contract-signing-location/src/ContractSigningLocationCanvas.vue?vue&type=script&setup=true&lang.ts
|
|
14
|
-
var
|
|
14
|
+
var be = { class: "gd-ant-contract-signing-location__workspace" }, xe = { class: "gd-ant-contract-signing-location__workspace-head" }, Se = { key: 0 }, Ce = { class: "gd-ant-contract-signing-location__workspace-tools" }, we = {
|
|
15
15
|
class: "gd-ant-contract-signing-location__page-jumper",
|
|
16
16
|
"aria-label": "页码跳转"
|
|
17
|
-
},
|
|
17
|
+
}, Te = ["value", "max"], Ee = {
|
|
18
18
|
class: "gd-ant-contract-signing-location__zoom-tools",
|
|
19
19
|
"aria-label": "页面缩放"
|
|
20
|
-
},
|
|
20
|
+
}, De = ["aria-label"], Oe = {
|
|
21
21
|
key: 1,
|
|
22
22
|
class: "gd-ant-contract-signing-location__page-placeholder is-error",
|
|
23
23
|
role: "alert"
|
|
24
|
-
},
|
|
24
|
+
}, ke = ["src"], Ae = {
|
|
25
25
|
key: 3,
|
|
26
26
|
class: "gd-ant-contract-signing-location__page-placeholder"
|
|
27
|
-
},
|
|
27
|
+
}, je = ["onClick"], Me = ["onClick"], Ne = { class: "gd-ant-contract-signing-location__render-region" }, Pe = { class: "gd-ant-contract-signing-location__render-region-content" }, Fe = { class: "is-horizontal is-top" }, Ie = { class: "is-horizontal is-bottom" }, Le = { class: "is-vertical is-left" }, Re = { class: "is-vertical is-right" }, ze = {
|
|
28
28
|
key: 1,
|
|
29
29
|
class: "gd-ant-contract-signing-location__snap-guides",
|
|
30
30
|
"aria-hidden": "true"
|
|
31
|
-
},
|
|
31
|
+
}, Be = [
|
|
32
32
|
"title",
|
|
33
33
|
"aria-label",
|
|
34
34
|
"aria-pressed",
|
|
35
35
|
"onClick",
|
|
36
36
|
"onPointerdown",
|
|
37
37
|
"onKeydown"
|
|
38
|
-
],
|
|
38
|
+
], Ve = { class: "gd-ant-contract-signing-location__placement-body" }, He = ["src", "alt"], Ue = {
|
|
39
39
|
key: 0,
|
|
40
40
|
class: "gd-ant-contract-signing-location__placement-badge"
|
|
41
|
-
},
|
|
41
|
+
}, We = ["onPointerdown"], Ge = /* @__PURE__ */ C({
|
|
42
42
|
name: "ContractSigningLocationCanvas",
|
|
43
43
|
__name: "ContractSigningLocationCanvas",
|
|
44
44
|
props: {
|
|
@@ -69,8 +69,8 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
|
|
|
69
69
|
"zoom-change",
|
|
70
70
|
"scroll-to-ready"
|
|
71
71
|
],
|
|
72
|
-
setup(
|
|
73
|
-
let
|
|
72
|
+
setup(C, { expose: Ge, emit: Ke }) {
|
|
73
|
+
let qe = [
|
|
74
74
|
"nw",
|
|
75
75
|
"n",
|
|
76
76
|
"ne",
|
|
@@ -79,142 +79,154 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
|
|
|
79
79
|
"s",
|
|
80
80
|
"sw",
|
|
81
81
|
"w"
|
|
82
|
-
],
|
|
82
|
+
], N = C, P = Ke, F = de(null), I = de(null), Je = D(1), L = D(N.activePageIndex), Ye = D({
|
|
83
83
|
start: 0,
|
|
84
84
|
end: -1
|
|
85
|
-
}), { width: Xe } =
|
|
85
|
+
}), { width: Xe } = me(F), { fitWidth: Ze, markUserAdjusted: Qe } = ne({
|
|
86
86
|
viewportWidth: Xe,
|
|
87
|
-
widestPageWidth:
|
|
87
|
+
widestPageWidth: y(() => Math.max(...N.pages.map((e) => e.displayWidth || e.width || f.width), f.width)),
|
|
88
88
|
padding: 48,
|
|
89
|
-
minZoom: () =>
|
|
90
|
-
maxZoom: () =>
|
|
91
|
-
getZoom: () =>
|
|
92
|
-
applyZoom: (e) => (
|
|
93
|
-
}), $e =
|
|
89
|
+
minZoom: () => N.minZoom,
|
|
90
|
+
maxZoom: () => N.maxZoom,
|
|
91
|
+
getZoom: () => N.zoom,
|
|
92
|
+
applyZoom: (e) => (P("zoom-change", e), e)
|
|
93
|
+
}), $e = D([]), et = D(), R = D(), z, B = 0, V, tt, nt, H, U = y(() => p(N.pages, N.zoom, 16)), rt = y(() => ee(U.value)), W = y(() => u(N.file)), it = y(() => c(N.file?.source)), at = y(() => new Map(it.value.map((e) => [e.pageIndex, e]))), ot = y(() => l(N.file)), st = y(() => {
|
|
94
94
|
let e = Ye.value;
|
|
95
95
|
return U.value.length ? e.end < e.start ? U.value.slice(0, 2) : U.value.slice(e.start, e.end + 1) : [];
|
|
96
|
-
}),
|
|
97
|
-
let t =
|
|
96
|
+
}), ct = y(() => st.value.flatMap((e) => {
|
|
97
|
+
let t = q(e.pageIndex);
|
|
98
98
|
return t ? [{
|
|
99
99
|
layout: e,
|
|
100
100
|
page: t,
|
|
101
|
-
logical:
|
|
101
|
+
logical: J(t),
|
|
102
102
|
templatePage: at.value.get(e.pageIndex)
|
|
103
103
|
}] : [];
|
|
104
|
-
})),
|
|
105
|
-
function
|
|
104
|
+
})), lt = y(() => N.pages.find((e) => e.pageIndex === L.value) ?? N.pages[0]), ut = y(() => Math.min(N.minZoom, N.maxZoom)), dt = y(() => Math.max(N.minZoom, N.maxZoom)), G = y(() => N.placements.find((e) => e.id === N.selectedPlacementId)), ft = /* @__PURE__ */ new Date(), K = /* @__PURE__ */ new Map();
|
|
105
|
+
function pt(e) {
|
|
106
106
|
return JSON.stringify([
|
|
107
107
|
e.signType,
|
|
108
108
|
e.sealType ?? [],
|
|
109
|
-
|
|
109
|
+
N.sealTypeOptions ?? []
|
|
110
110
|
]);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
let t =
|
|
112
|
+
function mt(e) {
|
|
113
|
+
let t = pt(e), n = K.get(t);
|
|
114
114
|
if (n) return n;
|
|
115
|
-
let r =
|
|
116
|
-
sealTypeOptions:
|
|
117
|
-
date:
|
|
115
|
+
let r = re(e, {
|
|
116
|
+
sealTypeOptions: N.sealTypeOptions,
|
|
117
|
+
date: ft
|
|
118
118
|
});
|
|
119
|
-
if (
|
|
120
|
-
let e =
|
|
121
|
-
e !== void 0 &&
|
|
119
|
+
if (K.size >= 128) {
|
|
120
|
+
let e = K.keys().next().value;
|
|
121
|
+
e !== void 0 && K.delete(e);
|
|
122
122
|
}
|
|
123
|
-
return
|
|
123
|
+
return K.set(t, r), r;
|
|
124
124
|
}
|
|
125
|
-
let
|
|
125
|
+
let ht = y(() => {
|
|
126
126
|
let e = /* @__PURE__ */ new WeakMap();
|
|
127
|
-
return
|
|
128
|
-
e.set(t,
|
|
127
|
+
return N.placements.forEach((t) => {
|
|
128
|
+
e.set(t, mt(t));
|
|
129
129
|
}), e;
|
|
130
130
|
});
|
|
131
|
-
|
|
132
|
-
L.value = e,
|
|
133
|
-
}),
|
|
134
|
-
|
|
135
|
-
X(), Z(),
|
|
131
|
+
fe(() => N.activePageIndex, (e) => {
|
|
132
|
+
L.value = e, At() || Q(e);
|
|
133
|
+
}), fe(() => N.pages.map((e) => e.pageIndex).join(","), () => {
|
|
134
|
+
se(() => {
|
|
135
|
+
X(), Z(), P("scroll-to-ready");
|
|
136
136
|
});
|
|
137
|
-
}),
|
|
138
|
-
if (!
|
|
139
|
-
let n =
|
|
137
|
+
}), fe(() => N.zoom, (e, t) => {
|
|
138
|
+
if (!F.value || t == null || e === t) return;
|
|
139
|
+
let n = Ot(), r = p(N.pages, t, 16), i = h(r, n.layoutScrollTop + 1) ?? r[0];
|
|
140
140
|
if (!i) return;
|
|
141
141
|
nt = {
|
|
142
142
|
pageIndex: i.pageIndex,
|
|
143
143
|
offsetInPage: n.layoutScrollTop - i.top
|
|
144
144
|
};
|
|
145
145
|
let a = e / Math.max(.01, t);
|
|
146
|
-
|
|
146
|
+
se(() => Mt(a));
|
|
147
147
|
}), ue(() => {
|
|
148
|
-
X(), Z(),
|
|
148
|
+
X(), Z(), P("scroll-to-ready"), !(typeof ResizeObserver > "u" || !F.value) && (H = new ResizeObserver(() => {
|
|
149
149
|
X(), Z();
|
|
150
|
-
}), H.observe(
|
|
150
|
+
}), H.observe(F.value));
|
|
151
151
|
}), le(() => {
|
|
152
|
-
|
|
152
|
+
Yt(), Bt(), V && clearTimeout(V), H?.disconnect(), H = void 0;
|
|
153
153
|
});
|
|
154
|
-
function
|
|
155
|
-
return
|
|
154
|
+
function q(e) {
|
|
155
|
+
return N.pages.find((t) => t.pageIndex === e);
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
return
|
|
157
|
+
function J(e) {
|
|
158
|
+
return e && d(e) ? {
|
|
159
159
|
width: e.width,
|
|
160
160
|
height: e.height
|
|
161
|
-
} : { ...
|
|
161
|
+
} : { ...f };
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
return
|
|
163
|
+
function Y(e) {
|
|
164
|
+
if (!e || !d(e)) return { ...f };
|
|
165
|
+
let t = Number(e.displayWidth), n = Number(e.displayHeight);
|
|
166
|
+
return {
|
|
167
|
+
width: Number.isFinite(t) && t > 0 ? t : e.width,
|
|
168
|
+
height: Number.isFinite(n) && n > 0 ? n : e.height
|
|
169
|
+
};
|
|
165
170
|
}
|
|
166
171
|
function gt(e) {
|
|
167
|
-
return
|
|
172
|
+
return `${N.file?.fileId ?? ""}:${e}`;
|
|
168
173
|
}
|
|
169
174
|
function _t(e) {
|
|
170
|
-
return
|
|
175
|
+
return N.previewLoadingKeys.includes(gt(e));
|
|
171
176
|
}
|
|
172
177
|
function vt(e) {
|
|
173
|
-
return
|
|
178
|
+
return N.previewErrorMap[gt(e)] || "";
|
|
174
179
|
}
|
|
175
180
|
function yt(e) {
|
|
176
|
-
|
|
177
|
-
return t && t.pageIndex === e.pageIndex ? r(t, e) : void 0;
|
|
181
|
+
return N.placements.filter((t) => t.pageIndex === e);
|
|
178
182
|
}
|
|
179
183
|
function bt(e) {
|
|
180
|
-
let t =
|
|
184
|
+
let t = G.value;
|
|
185
|
+
return t && t.pageIndex === e.pageIndex ? r(t, e) : void 0;
|
|
186
|
+
}
|
|
187
|
+
function xt(e) {
|
|
188
|
+
let t = i(e), n = q(e.pageIndex), r = Y(n), a = J(n);
|
|
181
189
|
return {
|
|
182
|
-
left: `${t.signLeft}px`,
|
|
183
|
-
top: `${t.signTop}px`,
|
|
184
|
-
width: `${t.signWidth}px`,
|
|
185
|
-
height: `${t.signHeight}px`
|
|
190
|
+
left: `${t.signLeft * r.width / Math.max(1, a.width)}px`,
|
|
191
|
+
top: `${t.signTop * r.height / Math.max(1, a.height)}px`,
|
|
192
|
+
width: `${t.signWidth * r.width / Math.max(1, a.width)}px`,
|
|
193
|
+
height: `${t.signHeight * r.height / Math.max(1, a.height)}px`
|
|
186
194
|
};
|
|
187
195
|
}
|
|
188
|
-
function
|
|
189
|
-
let t = i(e);
|
|
196
|
+
function St(e) {
|
|
197
|
+
let t = i(e), n = q(e.pageIndex), r = Y(n), a = J(n), o = r.width / Math.max(1, a.width), s = r.height / Math.max(1, a.height);
|
|
190
198
|
return {
|
|
191
|
-
"--gd-contract-sign-left": `${t.signLeft}px`,
|
|
192
|
-
"--gd-contract-sign-top": `${t.signTop}px`,
|
|
193
|
-
"--gd-contract-sign-right": `${t.signLeft + t.signWidth}px`,
|
|
194
|
-
"--gd-contract-sign-bottom": `${t.signTop + t.signHeight}px`
|
|
199
|
+
"--gd-contract-sign-left": `${t.signLeft * o}px`,
|
|
200
|
+
"--gd-contract-sign-top": `${t.signTop * s}px`,
|
|
201
|
+
"--gd-contract-sign-right": `${(t.signLeft + t.signWidth) * o}px`,
|
|
202
|
+
"--gd-contract-sign-bottom": `${(t.signTop + t.signHeight) * s}px`
|
|
195
203
|
};
|
|
196
204
|
}
|
|
197
|
-
function
|
|
205
|
+
function Ct(e, t) {
|
|
206
|
+
let n = Y(t), r = J(t), i = e.axis === "x" ? n.width / Math.max(1, r.width) : n.height / Math.max(1, r.height);
|
|
207
|
+
return e.axis === "x" ? { left: `${e.position * i}px` } : { top: `${e.position * i}px` };
|
|
208
|
+
}
|
|
209
|
+
function wt(e, t) {
|
|
198
210
|
return n(e, t, {
|
|
199
|
-
sealSizeLimit:
|
|
211
|
+
sealSizeLimit: N.sealSizeLimit,
|
|
200
212
|
sealTypes: e.sealType,
|
|
201
|
-
sealTypeOptions:
|
|
213
|
+
sealTypeOptions: N.sealTypeOptions
|
|
202
214
|
});
|
|
203
215
|
}
|
|
204
|
-
function
|
|
205
|
-
return
|
|
216
|
+
function Tt(e) {
|
|
217
|
+
return ht.value.get(e) ?? mt(e);
|
|
206
218
|
}
|
|
207
|
-
function
|
|
208
|
-
return t(e,
|
|
219
|
+
function Et(e) {
|
|
220
|
+
return t(e, N.resizable, N.readonly) && e.id === N.selectedPlacementId;
|
|
209
221
|
}
|
|
210
|
-
function
|
|
222
|
+
function Dt(e) {
|
|
211
223
|
return {
|
|
212
224
|
...e,
|
|
213
225
|
sealType: e.sealType ? [...e.sealType] : void 0
|
|
214
226
|
};
|
|
215
227
|
}
|
|
216
|
-
function
|
|
217
|
-
let e =
|
|
228
|
+
function Ot() {
|
|
229
|
+
let e = F.value, t = I.value;
|
|
218
230
|
if (!e) return {
|
|
219
231
|
layoutScrollTop: 0,
|
|
220
232
|
viewportHeight: 0
|
|
@@ -225,8 +237,8 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
|
|
|
225
237
|
viewportHeight: e.clientHeight
|
|
226
238
|
};
|
|
227
239
|
}
|
|
228
|
-
function
|
|
229
|
-
let n =
|
|
240
|
+
function kt(e, t) {
|
|
241
|
+
let n = I.value;
|
|
230
242
|
if (n) {
|
|
231
243
|
let r = n.getBoundingClientRect();
|
|
232
244
|
return {
|
|
@@ -234,7 +246,7 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
|
|
|
234
246
|
y: t - r.top
|
|
235
247
|
};
|
|
236
248
|
}
|
|
237
|
-
let r =
|
|
249
|
+
let r = F.value;
|
|
238
250
|
if (!r) return {
|
|
239
251
|
x: e,
|
|
240
252
|
y: t
|
|
@@ -245,83 +257,83 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
|
|
|
245
257
|
y: t - i.top + r.scrollTop - o
|
|
246
258
|
};
|
|
247
259
|
}
|
|
248
|
-
function
|
|
260
|
+
function At() {
|
|
249
261
|
return !!(document.activeElement && document.activeElement.tagName === "INPUT");
|
|
250
262
|
}
|
|
251
263
|
function X() {
|
|
252
|
-
let e =
|
|
253
|
-
Ye.value =
|
|
254
|
-
let t =
|
|
264
|
+
let e = Ot();
|
|
265
|
+
Ye.value = te(U.value, e.layoutScrollTop, e.viewportHeight, 1);
|
|
266
|
+
let t = h(U.value, e.layoutScrollTop + 1);
|
|
255
267
|
if (t) {
|
|
256
268
|
let e = L.value !== t.pageIndex;
|
|
257
|
-
L.value = t.pageIndex,
|
|
269
|
+
L.value = t.pageIndex, At() || Q(t.pageIndex), e && P("view-page", t.pageIndex);
|
|
258
270
|
}
|
|
259
271
|
}
|
|
260
272
|
function Z() {
|
|
261
273
|
let e = Ye.value;
|
|
262
|
-
|
|
274
|
+
P("visible-pages", U.value.slice(Math.max(0, e.start), e.end + 1).map((e) => e.pageIndex));
|
|
263
275
|
}
|
|
264
|
-
function
|
|
276
|
+
function jt() {
|
|
265
277
|
X(), V && clearTimeout(V), V = setTimeout(() => {
|
|
266
|
-
Z(), L.value !== tt && (tt = L.value,
|
|
278
|
+
Z(), L.value !== tt && (tt = L.value, P("page-change", L.value));
|
|
267
279
|
}, 80);
|
|
268
280
|
}
|
|
269
|
-
function
|
|
270
|
-
let t =
|
|
281
|
+
function Mt(e) {
|
|
282
|
+
let t = F.value, n = I.value, r = nt;
|
|
271
283
|
if (nt = void 0, !t || !n || !r) return;
|
|
272
284
|
let i = U.value.find((e) => e.pageIndex === r.pageIndex);
|
|
273
285
|
i && (t.scrollTop = n.offsetTop + i.top + r.offsetInPage * e, X());
|
|
274
286
|
}
|
|
275
|
-
function
|
|
276
|
-
let t =
|
|
277
|
-
t && (L.value = e, Q(e),
|
|
278
|
-
let r =
|
|
287
|
+
function Nt(e) {
|
|
288
|
+
let t = F.value, n = I.value;
|
|
289
|
+
t && (L.value = e, Q(e), P("page-change", e), tt = e, se(() => {
|
|
290
|
+
let r = _(U.value, e);
|
|
279
291
|
t.scrollTop = (n?.offsetTop ?? 0) + r, X(), Z();
|
|
280
292
|
}));
|
|
281
293
|
}
|
|
282
|
-
function
|
|
283
|
-
let t =
|
|
294
|
+
function Pt(e) {
|
|
295
|
+
let t = N.placements.find((t) => t.id === e), n = F.value, r = I.value;
|
|
284
296
|
if (!t || !n) return;
|
|
285
297
|
let a = U.value.find((e) => e.pageIndex === t.pageIndex);
|
|
286
|
-
a && (L.value = t.pageIndex, Q(t.pageIndex),
|
|
287
|
-
let e =
|
|
288
|
-
(
|
|
298
|
+
a && (L.value = t.pageIndex, Q(t.pageIndex), se(() => {
|
|
299
|
+
let e = Ot(), o = q(t.pageIndex), s = Y(o), c = J(o), l = a.top + i(t).signTop * s.height / Math.max(1, c.height) * N.zoom, u = l + i(t).signHeight * s.height / Math.max(1, c.height) * N.zoom, d = e.layoutScrollTop, f = d + e.viewportHeight;
|
|
300
|
+
(l < d || u > f) && (n.scrollTop = (r?.offsetTop ?? 0) + Math.max(0, l - 24)), X(), Z(), P("page-change", t.pageIndex);
|
|
289
301
|
}));
|
|
290
302
|
}
|
|
291
303
|
function Q(e) {
|
|
292
|
-
let t =
|
|
293
|
-
|
|
304
|
+
let t = N.pages.findIndex((t) => t.pageIndex === e);
|
|
305
|
+
Je.value = t >= 0 ? t + 1 : 1;
|
|
294
306
|
}
|
|
295
|
-
function
|
|
296
|
-
let t =
|
|
297
|
-
r &&
|
|
307
|
+
function Ft(e) {
|
|
308
|
+
let t = N.pages.findIndex((e) => e.pageIndex === L.value), n = Math.min(N.pages.length - 1, Math.max(0, (t < 0 ? 0 : t) + e)), r = N.pages[n];
|
|
309
|
+
r && Nt(r.pageIndex);
|
|
298
310
|
}
|
|
299
|
-
function
|
|
311
|
+
function It(e) {
|
|
300
312
|
let t = Number(e.target.value);
|
|
301
313
|
if (!Number.isFinite(t)) {
|
|
302
314
|
Q(L.value);
|
|
303
315
|
return;
|
|
304
316
|
}
|
|
305
|
-
let n = Math.min(
|
|
306
|
-
r ?
|
|
317
|
+
let n = Math.min(N.pages.length, Math.max(1, Math.round(t))) - 1, r = N.pages[n];
|
|
318
|
+
r ? Nt(r.pageIndex) : Q(L.value);
|
|
307
319
|
}
|
|
308
|
-
function
|
|
309
|
-
t === "user" && Qe(),
|
|
320
|
+
function Lt(e, t = "user") {
|
|
321
|
+
t === "user" && Qe(), P("zoom-change", e);
|
|
310
322
|
}
|
|
311
|
-
function
|
|
312
|
-
e.target.closest(".gd-ant-contract-signing-location__placement") ||
|
|
323
|
+
function Rt(e) {
|
|
324
|
+
e.target.closest(".gd-ant-contract-signing-location__placement") || P("select", "");
|
|
313
325
|
}
|
|
314
|
-
function
|
|
315
|
-
window.addEventListener("pointermove",
|
|
326
|
+
function zt() {
|
|
327
|
+
window.addEventListener("pointermove", Ut, { passive: !1 }), window.addEventListener("pointerup", $), window.addEventListener("pointercancel", $);
|
|
316
328
|
}
|
|
317
|
-
function
|
|
318
|
-
window.removeEventListener("pointermove",
|
|
329
|
+
function Bt() {
|
|
330
|
+
window.removeEventListener("pointermove", Ut), window.removeEventListener("pointerup", $), window.removeEventListener("pointercancel", $);
|
|
319
331
|
}
|
|
320
|
-
function
|
|
321
|
-
e.stopPropagation(),
|
|
322
|
-
let r =
|
|
323
|
-
if (
|
|
324
|
-
let i =
|
|
332
|
+
function Vt(e, t, n) {
|
|
333
|
+
e.stopPropagation(), P("select", t.id);
|
|
334
|
+
let r = q(t.pageIndex);
|
|
335
|
+
if (N.readonly || !r || !d(r) || e.button !== 0) return;
|
|
336
|
+
let i = kt(e.clientX, e.clientY), a = m(U.value, N.pages, i.x, i.y), o = e.currentTarget;
|
|
325
337
|
o.focus({ preventScroll: !0 }), R.value = {
|
|
326
338
|
pointerId: e.pointerId,
|
|
327
339
|
mode: n ? "resize" : "move",
|
|
@@ -329,102 +341,102 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
|
|
|
329
341
|
placementId: t.id,
|
|
330
342
|
startX: e.clientX,
|
|
331
343
|
startY: e.clientY,
|
|
332
|
-
origin:
|
|
344
|
+
origin: Dt(t),
|
|
333
345
|
grabOffsetX: (a?.x ?? t.signLeft) - t.signLeft,
|
|
334
346
|
grabOffsetY: (a?.y ?? t.signTop) - t.signTop
|
|
335
347
|
}, z = {
|
|
336
348
|
clientX: e.clientX,
|
|
337
349
|
clientY: e.clientY,
|
|
338
350
|
pointerId: e.pointerId
|
|
339
|
-
},
|
|
351
|
+
}, zt(), Jt();
|
|
340
352
|
try {
|
|
341
353
|
o.setPointerCapture(e.pointerId);
|
|
342
354
|
} catch {}
|
|
343
355
|
}
|
|
344
|
-
function
|
|
345
|
-
|
|
356
|
+
function Ht(e, t, n) {
|
|
357
|
+
Vt(e, t, n);
|
|
346
358
|
}
|
|
347
|
-
function
|
|
359
|
+
function Ut(e) {
|
|
348
360
|
let t = R.value;
|
|
349
361
|
!t || t.pointerId !== e.pointerId || (e.preventDefault(), z = {
|
|
350
362
|
clientX: e.clientX,
|
|
351
363
|
clientY: e.clientY,
|
|
352
364
|
pointerId: e.pointerId
|
|
353
|
-
},
|
|
365
|
+
}, Wt(z));
|
|
354
366
|
}
|
|
355
367
|
function $(e) {
|
|
356
|
-
R.value?.pointerId === e.pointerId && (R.value = void 0, z = void 0, $e.value = [], et.value = void 0,
|
|
368
|
+
R.value?.pointerId === e.pointerId && (R.value = void 0, z = void 0, $e.value = [], et.value = void 0, Yt(), Bt());
|
|
357
369
|
}
|
|
358
|
-
function
|
|
370
|
+
function Wt(e) {
|
|
359
371
|
let t = R.value;
|
|
360
372
|
if (!t) return;
|
|
361
373
|
if (t.mode === "resize") {
|
|
362
|
-
|
|
374
|
+
Gt(t, e);
|
|
363
375
|
return;
|
|
364
376
|
}
|
|
365
|
-
let n =
|
|
377
|
+
let n = kt(e.clientX, e.clientY), r = m(U.value, N.pages, n.x, n.y);
|
|
366
378
|
if (!r) return;
|
|
367
|
-
let i =
|
|
368
|
-
if (!i || !
|
|
369
|
-
let a =
|
|
379
|
+
let i = qt(r.pageIndex, t.origin.pageIndex);
|
|
380
|
+
if (!i || !d(i)) return;
|
|
381
|
+
let a = s(wt({
|
|
370
382
|
...t.origin,
|
|
371
383
|
pageIndex: i.pageIndex,
|
|
372
384
|
signLeft: r.x - t.grabOffsetX,
|
|
373
385
|
signTop: r.y - t.grabOffsetY
|
|
374
|
-
}, i),
|
|
375
|
-
$e.value = a.guides, et.value = i.pageIndex,
|
|
386
|
+
}, i), yt(i.pageIndex), N.zoom, void 0, i), o = wt(a.placement, i);
|
|
387
|
+
$e.value = a.guides, et.value = i.pageIndex, P("update", o);
|
|
376
388
|
}
|
|
377
|
-
function
|
|
378
|
-
let n =
|
|
379
|
-
if (!n || !r || !
|
|
389
|
+
function Gt(e, t) {
|
|
390
|
+
let n = q(e.origin.pageIndex), r = e.handle;
|
|
391
|
+
if (!n || !r || !d(n)) return;
|
|
380
392
|
let a = U.value.find((e) => e.pageIndex === n.pageIndex);
|
|
381
393
|
if (!a) return;
|
|
382
|
-
let o =
|
|
394
|
+
let o = kt(t.clientX, t.clientY), s = Y(n), c = n.width / Math.max(1, s.width * N.zoom), l = n.height / Math.max(1, s.height * N.zoom), u = (o.x - a.left) * c, f = (o.y - a.top) * l;
|
|
383
395
|
if (e.origin.signType === "seal") {
|
|
384
|
-
|
|
396
|
+
Kt(e, n, r, u, f);
|
|
385
397
|
return;
|
|
386
398
|
}
|
|
387
|
-
let
|
|
388
|
-
r.includes("w") && (
|
|
399
|
+
let p = i(e.origin), m = p.signLeft, h = p.signTop, g = p.signLeft + p.signWidth, _ = p.signTop + p.signHeight;
|
|
400
|
+
r.includes("w") && (m = u), r.includes("e") && (g = u), r.includes("n") && (h = f), r.includes("s") && (_ = f), g - m < 8 && (r.includes("w") ? m = g - 8 : g = m + 8), _ - h < 8 && (r.includes("n") ? h = _ - 8 : _ = h + 8), P("update", wt({
|
|
389
401
|
...e.origin,
|
|
390
|
-
signLeft:
|
|
391
|
-
signTop:
|
|
392
|
-
signWidth:
|
|
393
|
-
signHeight:
|
|
402
|
+
signLeft: m,
|
|
403
|
+
signTop: h,
|
|
404
|
+
signWidth: g - m,
|
|
405
|
+
signHeight: _ - h
|
|
394
406
|
}, n));
|
|
395
407
|
}
|
|
396
|
-
function
|
|
397
|
-
let a = o(e.origin, n, r, i, t,
|
|
398
|
-
|
|
408
|
+
function Kt(e, t, n, r, i) {
|
|
409
|
+
let a = o(e.origin, n, r, i, t, N.sealSizeLimit);
|
|
410
|
+
P("update", wt({
|
|
399
411
|
...e.origin,
|
|
400
412
|
...a
|
|
401
413
|
}, t));
|
|
402
414
|
}
|
|
403
|
-
function
|
|
404
|
-
let n =
|
|
405
|
-
return n &&
|
|
415
|
+
function qt(e, t) {
|
|
416
|
+
let n = q(e);
|
|
417
|
+
return n && d(n) ? n : q(t);
|
|
406
418
|
}
|
|
407
|
-
function
|
|
408
|
-
|
|
419
|
+
function Jt() {
|
|
420
|
+
Yt();
|
|
409
421
|
let e = () => {
|
|
410
|
-
let t = R.value, n =
|
|
422
|
+
let t = R.value, n = F.value;
|
|
411
423
|
if (!t || !n || !z) {
|
|
412
424
|
B = 0;
|
|
413
425
|
return;
|
|
414
426
|
}
|
|
415
|
-
let r = n.getBoundingClientRect(), i =
|
|
416
|
-
i !== 0 && (n.scrollTop += i, X(),
|
|
427
|
+
let r = n.getBoundingClientRect(), i = g(z.clientY, r);
|
|
428
|
+
i !== 0 && (n.scrollTop += i, X(), Wt(z)), B = requestAnimationFrame(e);
|
|
417
429
|
};
|
|
418
430
|
B = requestAnimationFrame(e);
|
|
419
431
|
}
|
|
420
|
-
function
|
|
432
|
+
function Yt() {
|
|
421
433
|
B &&= (cancelAnimationFrame(B), 0);
|
|
422
434
|
}
|
|
423
|
-
function
|
|
424
|
-
let n =
|
|
425
|
-
if (
|
|
435
|
+
function Xt(e, t) {
|
|
436
|
+
let n = q(t.pageIndex);
|
|
437
|
+
if (N.readonly || !n || !d(n)) return;
|
|
426
438
|
if (e.key === "Delete" || e.key === "Backspace") {
|
|
427
|
-
e.preventDefault(),
|
|
439
|
+
e.preventDefault(), P("remove", t.id);
|
|
428
440
|
return;
|
|
429
441
|
}
|
|
430
442
|
let r = e.shiftKey ? 10 : 1, i = 0, o = 0;
|
|
@@ -433,116 +445,115 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
|
|
|
433
445
|
else if (e.key === "ArrowUp") o = -r;
|
|
434
446
|
else if (e.key === "ArrowDown") o = r;
|
|
435
447
|
else return;
|
|
436
|
-
e.preventDefault()
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
}, { sealSizeLimit: M.sealSizeLimit }));
|
|
448
|
+
e.preventDefault();
|
|
449
|
+
let s = Y(n), c = J(n);
|
|
450
|
+
P("update", a(t, i * s.width / Math.max(1, c.width), o * s.height / Math.max(1, c.height), n, Y(n), { sealSizeLimit: N.sealSizeLimit }));
|
|
440
451
|
}
|
|
441
|
-
function
|
|
452
|
+
function Zt(e) {
|
|
442
453
|
let t = e.dataTransfer?.getData("application/x-gd-contract-signing-location") || e.dataTransfer?.getData("text/plain");
|
|
443
454
|
if (t) try {
|
|
444
455
|
let e = JSON.parse(t);
|
|
445
|
-
return
|
|
456
|
+
return $t(e.type) ? e.type : void 0;
|
|
446
457
|
} catch {
|
|
447
|
-
return
|
|
458
|
+
return $t(t) ? t : void 0;
|
|
448
459
|
}
|
|
449
460
|
}
|
|
450
|
-
function
|
|
451
|
-
if (
|
|
452
|
-
let t =
|
|
461
|
+
function Qt(e) {
|
|
462
|
+
if (N.readonly) return;
|
|
463
|
+
let t = Zt(e);
|
|
453
464
|
if (!t) return;
|
|
454
465
|
e.preventDefault();
|
|
455
|
-
let n =
|
|
456
|
-
r &&
|
|
466
|
+
let n = kt(e.clientX, e.clientY), r = m(U.value, N.pages, n.x, n.y, 1);
|
|
467
|
+
r && P("add", t, r.x, r.y, r.pageIndex);
|
|
457
468
|
}
|
|
458
|
-
function
|
|
469
|
+
function $t(e) {
|
|
459
470
|
return e === "seal" || e === "signature" || e === "date";
|
|
460
471
|
}
|
|
461
|
-
return
|
|
462
|
-
scrollToPage:
|
|
463
|
-
scrollToPlacement:
|
|
472
|
+
return Ge({
|
|
473
|
+
scrollToPage: Nt,
|
|
474
|
+
scrollToPlacement: Pt,
|
|
464
475
|
fitWidth: Ze
|
|
465
|
-
}), (t, n) => (T(),
|
|
466
|
-
|
|
476
|
+
}), (t, n) => (T(), b("main", be, [x("header", xe, [x("div", null, [x("strong", null, O(C.file?.fileName || "合同页面"), 1), lt.value ? (T(), b("span", Se, "第 " + O(lt.value.displayPageNumber) + " 页 · " + O(W.value ? "HTML" : "PDF") + " " + O(lt.value.width) + " × " + O(lt.value.height), 1)) : ae("", !0)]), x("div", Ce, [x("div", we, [
|
|
477
|
+
S(k(M), {
|
|
467
478
|
size: "small",
|
|
468
|
-
disabled:
|
|
479
|
+
disabled: Je.value <= 1,
|
|
469
480
|
"aria-label": "上一页",
|
|
470
|
-
onClick: n[0] ||= (e) =>
|
|
481
|
+
onClick: n[0] ||= (e) => Ft(-1)
|
|
471
482
|
}, {
|
|
472
|
-
default:
|
|
483
|
+
default: A(() => [S(k(ge), { "aria-hidden": "true" })]),
|
|
473
484
|
_: 1
|
|
474
485
|
}, 8, ["disabled"]),
|
|
475
|
-
|
|
476
|
-
n[6] ||=
|
|
477
|
-
|
|
478
|
-
value:
|
|
486
|
+
x("label", null, [
|
|
487
|
+
n[6] ||= oe(" 第 ", -1),
|
|
488
|
+
x("input", {
|
|
489
|
+
value: Je.value,
|
|
479
490
|
type: "number",
|
|
480
491
|
min: "1",
|
|
481
|
-
max: Math.max(1,
|
|
482
|
-
onChange:
|
|
483
|
-
onKeydown:
|
|
484
|
-
}, null, 40,
|
|
485
|
-
|
|
492
|
+
max: Math.max(1, C.pages.length),
|
|
493
|
+
onChange: It,
|
|
494
|
+
onKeydown: pe(It, ["enter"])
|
|
495
|
+
}, null, 40, Te),
|
|
496
|
+
oe(" / " + O(C.pages.length) + " 页 ", 1)
|
|
486
497
|
]),
|
|
487
|
-
|
|
498
|
+
S(k(M), {
|
|
488
499
|
size: "small",
|
|
489
|
-
disabled:
|
|
500
|
+
disabled: Je.value >= C.pages.length,
|
|
490
501
|
"aria-label": "下一页",
|
|
491
|
-
onClick: n[1] ||= (e) =>
|
|
502
|
+
onClick: n[1] ||= (e) => Ft(1)
|
|
492
503
|
}, {
|
|
493
|
-
default:
|
|
504
|
+
default: A(() => [S(k(_e), { "aria-hidden": "true" })]),
|
|
494
505
|
_: 1
|
|
495
506
|
}, 8, ["disabled"])
|
|
496
|
-
]),
|
|
497
|
-
|
|
507
|
+
]), x("div", Ee, [
|
|
508
|
+
S(k(M), {
|
|
498
509
|
size: "small",
|
|
499
|
-
disabled:
|
|
510
|
+
disabled: C.zoom <= ut.value,
|
|
500
511
|
"aria-label": "缩小页面",
|
|
501
|
-
onClick: n[2] ||= (e) =>
|
|
512
|
+
onClick: n[2] ||= (e) => Lt(C.zoom - .1)
|
|
502
513
|
}, {
|
|
503
|
-
default:
|
|
514
|
+
default: A(() => [S(k(ye), { "aria-hidden": "true" })]),
|
|
504
515
|
_: 1
|
|
505
516
|
}, 8, ["disabled"]),
|
|
506
|
-
|
|
517
|
+
x("button", {
|
|
507
518
|
type: "button",
|
|
508
|
-
onClick: n[3] ||= (e) =>
|
|
509
|
-
},
|
|
510
|
-
|
|
519
|
+
onClick: n[3] ||= (e) => Lt(1)
|
|
520
|
+
}, O(Math.round(C.zoom * 100)) + "%", 1),
|
|
521
|
+
S(k(M), {
|
|
511
522
|
size: "small",
|
|
512
|
-
disabled:
|
|
523
|
+
disabled: C.zoom >= dt.value,
|
|
513
524
|
"aria-label": "放大页面",
|
|
514
|
-
onClick: n[4] ||= (e) =>
|
|
525
|
+
onClick: n[4] ||= (e) => Lt(C.zoom + .1)
|
|
515
526
|
}, {
|
|
516
|
-
default:
|
|
527
|
+
default: A(() => [S(k(ve), { "aria-hidden": "true" })]),
|
|
517
528
|
_: 1
|
|
518
529
|
}, 8, ["disabled"]),
|
|
519
|
-
|
|
530
|
+
S(k(M), {
|
|
520
531
|
size: "small",
|
|
521
532
|
"aria-label": "适应宽度",
|
|
522
533
|
title: "适应宽度",
|
|
523
|
-
onClick:
|
|
534
|
+
onClick: k(Ze)
|
|
524
535
|
}, {
|
|
525
|
-
default:
|
|
536
|
+
default: A(() => [S(k(he), { "aria-hidden": "true" })]),
|
|
526
537
|
_: 1
|
|
527
538
|
}, 8, ["onClick"])
|
|
528
|
-
])])]),
|
|
539
|
+
])])]), x("div", {
|
|
529
540
|
ref_key: "scrollRef",
|
|
530
|
-
ref:
|
|
541
|
+
ref: F,
|
|
531
542
|
class: "gd-ant-contract-signing-location__canvas-scroll",
|
|
532
|
-
onScrollPassive:
|
|
533
|
-
onClick:
|
|
534
|
-
onDragover: n[5] ||=
|
|
535
|
-
onDrop:
|
|
536
|
-
}, [
|
|
543
|
+
onScrollPassive: jt,
|
|
544
|
+
onClick: Rt,
|
|
545
|
+
onDragover: n[5] ||= j(() => {}, ["prevent"]),
|
|
546
|
+
onDrop: Qt
|
|
547
|
+
}, [C.pages.length ? (T(), b("div", {
|
|
537
548
|
key: 1,
|
|
538
549
|
ref_key: "stackRef",
|
|
539
|
-
ref:
|
|
550
|
+
ref: I,
|
|
540
551
|
class: "gd-ant-contract-signing-location__page-stack",
|
|
541
552
|
style: w({
|
|
542
553
|
width: `${rt.value.width}px`,
|
|
543
554
|
height: `${rt.value.height}px`
|
|
544
555
|
})
|
|
545
|
-
}, [(T(!0), v
|
|
556
|
+
}, [(T(!0), b(v, null, E(ct.value, (t) => (T(), b("div", {
|
|
546
557
|
key: t.layout.pageIndex,
|
|
547
558
|
class: "gd-ant-contract-signing-location__page-shell",
|
|
548
559
|
style: w({
|
|
@@ -551,89 +562,89 @@ var xe = { class: "gd-ant-contract-signing-location__workspace" }, Se = { class:
|
|
|
551
562
|
width: `${t.layout.width}px`,
|
|
552
563
|
height: `${t.layout.height}px`
|
|
553
564
|
})
|
|
554
|
-
}, [
|
|
565
|
+
}, [x("div", {
|
|
555
566
|
class: "gd-ant-contract-signing-location__page",
|
|
556
567
|
style: w({
|
|
557
|
-
width: `${t.
|
|
558
|
-
height: `${t.
|
|
559
|
-
transform: `scale(${
|
|
568
|
+
width: `${Y(t.page).width}px`,
|
|
569
|
+
height: `${Y(t.page).height}px`,
|
|
570
|
+
transform: `scale(${C.zoom})`
|
|
560
571
|
}),
|
|
561
|
-
"aria-label": `${
|
|
562
|
-
}, [W.value && t.templatePage ? (T(),
|
|
572
|
+
"aria-label": `${C.file?.fileName || "合同"}第 ${t.page.displayPageNumber} 页`
|
|
573
|
+
}, [W.value && t.templatePage ? (T(), ie(e, {
|
|
563
574
|
key: 0,
|
|
564
575
|
page: t.templatePage
|
|
565
|
-
}, null, 8, ["page"])) : W.value ? (T(),
|
|
576
|
+
}, null, 8, ["page"])) : W.value ? (T(), b("div", Oe, [n[8] ||= x("strong", null, "模板页面无法渲染", -1), x("span", null, O(ot.value || "页面结构无效,请回到模板设计器修复后重试。"), 1)])) : t.page.previewUrl ? (T(), b("img", {
|
|
566
577
|
key: 2,
|
|
567
578
|
class: "gd-ant-contract-signing-location__page-image",
|
|
568
579
|
src: t.page.previewUrl,
|
|
569
580
|
alt: "合同页面预览"
|
|
570
|
-
}, null, 8,
|
|
571
|
-
n[9] ||=
|
|
572
|
-
|
|
573
|
-
|
|
581
|
+
}, null, 8, ke)) : (T(), b("div", Ae, [_t(t.layout.pageIndex) ? (T(), b(v, { key: 0 }, [x("strong", null, "第 " + O(t.page.displayPageNumber) + " 页加载中…", 1), x("span", null, O(t.page.width) + " × " + O(t.page.height), 1)], 64)) : vt(t.layout.pageIndex) ? (T(), b(v, { key: 1 }, [
|
|
582
|
+
n[9] ||= x("strong", null, "合同页面预览加载失败", -1),
|
|
583
|
+
x("span", null, O(vt(t.layout.pageIndex)), 1),
|
|
584
|
+
x("button", {
|
|
574
585
|
type: "button",
|
|
575
|
-
onClick:
|
|
576
|
-
}, "重试当前页", 8,
|
|
577
|
-
], 64)) :
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
n[12] ||=
|
|
581
|
-
], 64)) : (T(), v
|
|
582
|
-
n[10] ||=
|
|
583
|
-
n[11] ||=
|
|
584
|
-
|
|
586
|
+
onClick: j((e) => P("retry", t.layout.pageIndex), ["stop"])
|
|
587
|
+
}, "重试当前页", 8, je)
|
|
588
|
+
], 64)) : k(d)(t.page) ? (T(), b(v, { key: 3 }, [
|
|
589
|
+
x("strong", null, "第 " + O(t.page.displayPageNumber) + " 页", 1),
|
|
590
|
+
x("span", null, O(t.page.width) + " × " + O(t.page.height), 1),
|
|
591
|
+
n[12] ||= x("small", null, "等待 dataProvider 返回页面预览图", -1)
|
|
592
|
+
], 64)) : (T(), b(v, { key: 2 }, [
|
|
593
|
+
n[10] ||= x("strong", null, "页面元数据不完整", -1),
|
|
594
|
+
n[11] ||= x("span", null, "缺少有效的原始宽高,无法安全计算签署坐标。", -1),
|
|
595
|
+
x("button", {
|
|
585
596
|
type: "button",
|
|
586
|
-
onClick:
|
|
587
|
-
}, "重新加载页面", 8,
|
|
588
|
-
], 64))])),
|
|
589
|
-
|
|
597
|
+
onClick: j((e) => P("retry", t.layout.pageIndex), ["stop"])
|
|
598
|
+
}, "重新加载页面", 8, Me)
|
|
599
|
+
], 64))])), x("div", Ne, [x("div", Pe, [
|
|
600
|
+
G.value && G.value.pageIndex === t.layout.pageIndex ? (T(), b("div", {
|
|
590
601
|
key: 0,
|
|
591
602
|
class: "gd-ant-contract-signing-location__coordinate-guides",
|
|
592
|
-
style: w(
|
|
603
|
+
style: w(St(G.value)),
|
|
593
604
|
"aria-hidden": "true"
|
|
594
605
|
}, [
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
], 4)) :
|
|
600
|
-
$e.value.length && et.value === t.layout.pageIndex ? (T(),
|
|
601
|
-
key: `${e.axis}-${
|
|
602
|
-
class:
|
|
603
|
-
style: w(e
|
|
604
|
-
}, null, 6))), 128))])) :
|
|
605
|
-
(T(!0), v
|
|
606
|
+
x("span", Fe, [x("small", null, "上 " + O(bt(t.page)?.top), 1)]),
|
|
607
|
+
x("span", Ie, [x("small", null, "下 " + O(bt(t.page)?.bottom), 1)]),
|
|
608
|
+
x("span", Le, [x("small", null, "左 " + O(bt(t.page)?.left), 1)]),
|
|
609
|
+
x("span", Re, [x("small", null, "右 " + O(bt(t.page)?.right), 1)])
|
|
610
|
+
], 4)) : ae("", !0),
|
|
611
|
+
$e.value.length && et.value === t.layout.pageIndex ? (T(), b("div", ze, [(T(!0), b(v, null, E($e.value, (e, n) => (T(), b("span", {
|
|
612
|
+
key: `${e.axis}-${n}`,
|
|
613
|
+
class: ce(e.axis === "x" ? "is-vertical" : "is-horizontal"),
|
|
614
|
+
style: w(Ct(e, t.page))
|
|
615
|
+
}, null, 6))), 128))])) : ae("", !0),
|
|
616
|
+
(T(!0), b(v, null, E(yt(t.layout.pageIndex), (e) => (T(), b("button", {
|
|
606
617
|
key: e.id,
|
|
607
618
|
type: "button",
|
|
608
|
-
class:
|
|
609
|
-
style: w(
|
|
610
|
-
title:
|
|
611
|
-
"aria-label":
|
|
612
|
-
"aria-pressed": e.id ===
|
|
613
|
-
onClick:
|
|
614
|
-
onPointerdown: (t) =>
|
|
619
|
+
class: ce(["gd-ant-contract-signing-location__placement", [`is-${e.signType}`, { "is-selected": e.id === C.selectedPlacementId }]]),
|
|
620
|
+
style: w(xt(e)),
|
|
621
|
+
title: Tt(e).alt,
|
|
622
|
+
"aria-label": Tt(e).alt,
|
|
623
|
+
"aria-pressed": e.id === C.selectedPlacementId,
|
|
624
|
+
onClick: j((t) => P("select", e.id), ["stop"]),
|
|
625
|
+
onPointerdown: (t) => Vt(t, e),
|
|
615
626
|
onLostpointercapture: $,
|
|
616
|
-
onKeydown: (t) =>
|
|
627
|
+
onKeydown: (t) => Xt(t, e)
|
|
617
628
|
}, [
|
|
618
|
-
|
|
629
|
+
x("span", Ve, [x("img", {
|
|
619
630
|
class: "gd-ant-contract-signing-location__placement-visual",
|
|
620
|
-
src:
|
|
621
|
-
alt:
|
|
631
|
+
src: Tt(e).dataUrl,
|
|
632
|
+
alt: Tt(e).alt,
|
|
622
633
|
draggable: "false"
|
|
623
|
-
}, null, 8,
|
|
624
|
-
e.mustSign ? (T(),
|
|
625
|
-
(T(!0), v
|
|
634
|
+
}, null, 8, He)]),
|
|
635
|
+
e.mustSign ? (T(), b("span", Ue, "必签")) : ae("", !0),
|
|
636
|
+
(T(!0), b(v, null, E(Et(e) ? qe : [], (t) => (T(), b("i", {
|
|
626
637
|
key: t,
|
|
627
|
-
class:
|
|
628
|
-
onPointerdown:
|
|
629
|
-
}, null, 42,
|
|
630
|
-
], 46,
|
|
631
|
-
])])], 12,
|
|
638
|
+
class: ce(["gd-ant-contract-signing-location__resize-handle", `is-${t}`]),
|
|
639
|
+
onPointerdown: j((n) => Ht(n, e, t), ["stop"])
|
|
640
|
+
}, null, 42, We))), 128))
|
|
641
|
+
], 46, Be))), 128))
|
|
642
|
+
])])], 12, De)], 4))), 128))], 4)) : (T(), b("div", {
|
|
632
643
|
key: 0,
|
|
633
|
-
class:
|
|
644
|
+
class: ce(["gd-ant-contract-signing-location__canvas-state", { "is-error": W.value && ot.value }]),
|
|
634
645
|
role: "status"
|
|
635
|
-
}, [W.value &&
|
|
646
|
+
}, [W.value && ot.value ? (T(), b(v, { key: 0 }, [n[7] ||= x("strong", null, "合同模板无法渲染", -1), x("span", null, O(ot.value), 1)], 64)) : (T(), b(v, { key: 1 }, [oe("请选择可用的合同页面")], 64))], 2))], 544)]));
|
|
636
647
|
}
|
|
637
648
|
});
|
|
638
649
|
//#endregion
|
|
639
|
-
export {
|
|
650
|
+
export { Ge as default };
|