@guodun/antdv 1.4.8 → 1.5.1

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