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