@guodun/antdv 1.7.11 → 1.7.13

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 (64) hide show
  1. package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +370 -294
  2. package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +219 -202
  3. package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +18 -18
  4. package/dist/es/components/contract-signing-location/src/template-source.mjs +62 -49
  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/ContractTemplatePreviewPage.vue.mjs +37 -42
  8. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.mjs +69 -55
  9. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.mjs +278 -270
  10. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +344 -343
  11. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1046 -1000
  12. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +120 -74
  13. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +133 -132
  14. package/dist/es/components/pro-contract-template-designer/src/constants.mjs +7 -7
  15. package/dist/es/components/pro-contract-template-designer/src/utils/contract-layout-check.mjs +239 -0
  16. package/dist/es/components/pro-contract-template-designer/src/utils/contract-print-document.mjs +99 -75
  17. package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +67 -76
  18. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +96 -83
  19. package/dist/es/components/pro-contract-template-designer/src/utils/template-variable-render.mjs +23 -15
  20. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  21. package/dist/es/contract-print-css/index.mjs +473 -0
  22. package/dist/es/contract-print.mjs +2 -0
  23. package/dist/es/index.mjs +21 -20
  24. package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
  25. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
  26. package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -1
  27. package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
  28. package/dist/lib/components/index.cjs +1 -1
  29. package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
  30. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
  31. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.cjs +1 -1
  32. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.cjs +1 -1
  33. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  34. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  35. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
  36. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
  37. package/dist/lib/components/pro-contract-template-designer/src/constants.cjs +1 -1
  38. package/dist/lib/components/pro-contract-template-designer/src/utils/contract-layout-check.cjs +1 -0
  39. package/dist/lib/components/pro-contract-template-designer/src/utils/contract-print-document.cjs +52 -30
  40. package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -1
  41. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +5 -5
  42. package/dist/lib/components/pro-contract-template-designer/src/utils/template-variable-render.cjs +1 -1
  43. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  44. package/dist/lib/contract-print-css/index.cjs +413 -0
  45. package/dist/lib/contract-print.cjs +1 -0
  46. package/dist/lib/index.cjs +1 -1
  47. package/dist/theme/icon.css +1 -1
  48. package/dist/theme/index.css +1 -1
  49. package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +9 -0
  50. package/dist/types/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.d.ts +7 -0
  51. package/dist/types/components/contract-signing-location/src/template-source.d.ts +6 -0
  52. package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
  53. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.d.ts +2 -0
  54. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +5 -1
  55. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +7 -2
  56. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +2 -2
  57. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +36 -0
  58. package/dist/types/components/pro-contract-template-designer/src/utils/contract-layout-check.d.ts +104 -0
  59. package/dist/types/components/pro-contract-template-designer/src/utils/contract-print-document.d.ts +4 -1
  60. package/dist/types/components/pro-contract-template-designer/src/utils/page-decorations.d.ts +2 -8
  61. package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +6 -1
  62. package/dist/types/contract-print-css/index.d.ts +99 -0
  63. package/dist/types/contract-print.d.ts +2 -0
  64. package/package.json +16 -5
@@ -1,19 +1,20 @@
1
1
  import { isContractTemplateFieldType as e } from "./types.mjs";
2
- import { isAllowedContractTemplateRemoteUrl as t, normalizeContractTemplateControlOptions as n, normalizeContractTemplateJsonObject as r, normalizeContractTemplateRequestTimeout as i } from "./utils/advanced-controls.mjs";
3
- import { buildInitialRenderValues as a, buildTemplateRenderPages as o, isEmptyRenderValue as s, normalizeRenderValues as c, resolveTemplateRenderSubmitErrors as ee, validateTemplateRenderStructure as te, validateTemplateRenderValues as ne, validateTemplateTextOverflow as re } from "./utils/template-renderer.mjs";
4
- import ie from "./ContractTemplateRendererField.mjs";
5
- import ae from "./ContractTemplateRendererHeader.mjs";
6
- import oe from "./ContractTemplateRendererPage.mjs";
7
- import se from "./ContractTemplateRendererValidation.mjs";
8
- import { Fragment as ce, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as le, createTextVNode as ue, createVNode as m, defineComponent as h, mergeProps as de, nextTick as g, normalizeClass as fe, onBeforeUnmount as pe, openBlock as _, ref as v, renderList as me, renderSlot as he, toDisplayString as y, unref as b, watch as x, withCtx as S } from "vue";
9
- import { Button as ge, Empty as C, Input as _e, Modal as ve, Progress as ye, Segmented as be, Tooltip as xe } from "ant-design-vue";
10
- import { useElementSize as Se } from "@vueuse/core";
11
- import { LeftOutlined as Ce, RightOutlined as we, SearchOutlined as Te } from "@ant-design/icons-vue";
2
+ import { isAllowedContractTemplateRemoteUrl as t, normalizeContractTemplateControlOptions as n, normalizeContractTemplateRequestTimeout as r } from "./utils/advanced-controls.mjs";
3
+ import { buildInitialRenderValues as i, buildTemplateRenderPages as a, isEmptyRenderValue as o, normalizeRenderValues as s, resolveTemplateDisplayValues as c, resolveTemplateRenderSubmitErrors as ee, validateTemplateRenderStructure as te, validateTemplateRenderValues as ne, validateTemplateTextOverflow as re } from "./utils/template-renderer.mjs";
4
+ import { createContractTemplateLayoutPage as ie } from "./utils/contract-layout-check.mjs";
5
+ import ae from "./ContractTemplateRendererField.mjs";
6
+ import oe from "./ContractTemplateRendererHeader.mjs";
7
+ import se from "./ContractTemplateRendererPage.mjs";
8
+ import ce from "./ContractTemplateRendererValidation.mjs";
9
+ import { Fragment as le, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as ue, createTextVNode as de, createVNode as m, defineComponent as h, mergeProps as fe, nextTick as g, normalizeClass as pe, onBeforeUnmount as me, openBlock as _, ref as v, renderList as he, renderSlot as ge, toDisplayString as y, unref as b, watch as x, withCtx as S } from "vue";
10
+ import { Button as _e, Empty as C, Input as ve, Modal as ye, Progress as be, Segmented as xe, Tooltip as Se } from "ant-design-vue";
11
+ import { useElementSize as Ce } from "@vueuse/core";
12
+ import { LeftOutlined as we, RightOutlined as Te, SearchOutlined as Ee } from "@ant-design/icons-vue";
12
13
  //#region src/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue?vue&type=script&setup=true&lang.ts
13
- var Ee = {
14
+ var De = {
14
15
  key: 2,
15
16
  class: "gd-contract-template-renderer__empty"
16
- }, De = ["data-highlighted-variable-key"], Oe = { class: "gd-contract-template-renderer__pages" }, ke = ["aria-label", "aria-expanded"], Ae = { class: "gd-contract-template-renderer__panel-clip" }, je = { class: "gd-contract-template-renderer__panel" }, Me = { class: "gd-contract-template-renderer__panel-head" }, Ne = { class: "gd-contract-template-renderer__panel-head-row" }, Pe = { class: "gd-contract-template-renderer__panel-head-actions" }, Fe = { class: "gd-contract-template-renderer__field-group-head" }, Ie = { class: "gd-contract-template-renderer__field-group-items" }, Le = ["data-field-key"], Re = .5, ze = 1.5, w = .1, Be = 3e3, Ve = /* @__PURE__ */ h({
17
+ }, Oe = ["data-highlighted-variable-key"], ke = { class: "gd-contract-template-renderer__pages" }, Ae = ["aria-label", "aria-expanded"], je = { class: "gd-contract-template-renderer__panel-clip" }, Me = { class: "gd-contract-template-renderer__panel" }, Ne = { class: "gd-contract-template-renderer__panel-head" }, Pe = { class: "gd-contract-template-renderer__panel-head-row" }, Fe = { class: "gd-contract-template-renderer__panel-head-actions" }, Ie = { class: "gd-contract-template-renderer__field-group-head" }, Le = { class: "gd-contract-template-renderer__field-group-items" }, Re = ["data-field-key"], ze = .5, Be = 1.5, w = .1, Ve = 3e3, He = 128, Ue = /* @__PURE__ */ h({
17
18
  name: "ContractTemplateSingleRenderer",
18
19
  __name: "ContractTemplateSingleRenderer",
19
20
  props: {
@@ -87,8 +88,8 @@ var Ee = {
87
88
  "update:zoom",
88
89
  "control-warning"
89
90
  ],
90
- setup(h, { expose: Ve, emit: He }) {
91
- let T = h, E = He, Ue = [
91
+ setup(h, { expose: Ue, emit: We }) {
92
+ let T = h, E = We, Ge = [
92
93
  {
93
94
  label: "全部",
94
95
  value: "all"
@@ -101,35 +102,24 @@ var Ee = {
101
102
  label: "有错误",
102
103
  value: "error"
103
104
  }
104
- ], We = v(), D = v(), Ge = v(), O = v(c(T.template, T.values)), Ke = v({ ...O.value }), k = v(!1), A = v([]), j = v([]), M = v(!1), N = v(!1), P = v(""), F = v(""), I = v(""), qe = v(0), L = v($t(T.zoom)), R = v(""), z = v("all"), B = v(!1), Je = v(/* @__PURE__ */ new Map()), V = /* @__PURE__ */ new Map(), Ye = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new Set(), { width: Ze } = Se(D), Qe = l(() => T.readonly || T.disabled), $e = l(() => T.interactionMode === "inline" && !Qe.value), et = l(() => te(T.template)), U = l(() => k.value ? A.value : [...et.value, ...j.value]), W = l(() => (Array.isArray(T.template?.variables) ? T.template.variables : []).filter((t) => !!t?.key && e(t.type ?? "text"))), tt = l(() => {
105
- let e = { ...O.value };
106
- return W.value.forEach((t) => {
107
- let n = Nt(t);
108
- if (n?.toDisplayText) try {
109
- e[t.key] = n.toDisplayText(e[t.key], {
110
- variable: t,
111
- config: r(t.componentConfig)
112
- });
113
- } catch {}
114
- }), e;
115
- }), nt = l(() => W.value.filter((e) => s(O.value[e.key])).length), rt = l(() => {
105
+ ], Ke = v(), D = v(), qe = v(), O = v(s(T.template, T.values)), Je = v({ ...O.value }), k = v(!1), A = v([]), j = v([]), M = v(!1), N = v(!1), P = v(""), F = v(""), I = v(""), Ye = v(0), L = v(an(T.zoom)), R = v(""), z = v("all"), B = v(!1), Xe = v(/* @__PURE__ */ new Map()), V = /* @__PURE__ */ new Map(), Ze = /* @__PURE__ */ new Map(), H = /* @__PURE__ */ new Map(), Qe = /* @__PURE__ */ new Set(), U = /* @__PURE__ */ new Map(), { width: $e } = Ce(D), et = l(() => T.readonly || T.disabled), tt = l(() => T.interactionMode === "inline" && !et.value), nt = l(() => te(T.template)), W = l(() => k.value ? A.value : [...nt.value, ...j.value]), G = l(() => (Array.isArray(T.template?.variables) ? T.template.variables : []).filter((t) => !!t?.key && e(t.type ?? "text"))), rt = l(() => c(T.template, O.value, T.controlRegistry)), it = l(() => G.value.filter((e) => o(O.value[e.key])).length), at = l(() => {
116
106
  let e = /* @__PURE__ */ new Map();
117
- return U.value.forEach((t) => {
107
+ return W.value.forEach((t) => {
118
108
  t.variableKey && e.set(t.variableKey, [...e.get(t.variableKey) ?? [], t]);
119
109
  }), e;
120
- }), G = l(() => o(T.template, $e.value ? Ke.value : tt.value, {
110
+ }), K = l(() => a(T.template, tt.value ? Je.value : rt.value, {
121
111
  readonly: T.readonly,
122
112
  disabled: T.disabled,
123
- mode: $e.value ? "control" : "display"
124
- })), it = l(() => {
125
- let e = /* @__PURE__ */ new Map(), t = new Set(W.value.map((e) => e.key));
126
- return G.value.forEach((n) => {
127
- qt(n.contentHtml).forEach((r) => {
113
+ mode: tt.value ? "control" : "display"
114
+ })), ot = l(() => {
115
+ let e = /* @__PURE__ */ new Map(), t = new Set(G.value.map((e) => e.key));
116
+ return K.value.forEach((n) => {
117
+ Qt(n.contentHtml).forEach((r) => {
128
118
  t.has(r) && !e.has(r) && e.set(r, n.id);
129
119
  });
130
120
  }), e;
131
- }), at = l(() => W.value.filter(Ht)), ot = l(() => {
132
- let e = G.value.map((e, t) => ({
121
+ }), st = l(() => G.value.filter(qt)), ct = l(() => {
122
+ let e = K.value.map((e, t) => ({
133
123
  id: `page:${e.id}`,
134
124
  pageId: e.id,
135
125
  title: `第 ${t + 1} 页${e.title ? ` · ${e.title}` : ""}`,
@@ -141,20 +131,20 @@ var Ee = {
141
131
  allVariables: [],
142
132
  variables: []
143
133
  };
144
- return W.value.forEach((e) => {
145
- let r = t.get(it.value.get(e.key) ?? "") ?? n;
146
- r.allVariables.push(e), Ht(e) && r.variables.push(e);
134
+ return G.value.forEach((e) => {
135
+ let r = t.get(ot.value.get(e.key) ?? "") ?? n;
136
+ r.allVariables.push(e), qt(e) && r.variables.push(e);
147
137
  }), [...e, n].filter((e) => e.variables.length > 0).map((e) => ({
148
138
  id: e.id,
149
139
  title: e.title,
150
140
  totalCount: e.allVariables.length,
151
141
  variables: e.variables
152
142
  }));
153
- }), st = l(() => G.value.length > 0), ct = l(() => W.value.filter((e) => !s(O.value[e.key])).length), lt = l(() => W.value.filter((e) => e.required && s(O.value[e.key])).length), ut = l(() => W.value.length ? Math.round(ct.value / W.value.length * 100) : 0), dt = l(() => k.value && A.value.length === 0), ft = l(() => k.value ? dt.value ? "校验通过,模板与填写值均符合规则" : `发现 ${A.value.length} 个模板或填写问题` : j.value.length ? `发现 ${U.value.length} 个模板或填写问题` : et.value.length ? `模板存在 ${et.value.length} 个问题,已安全降级展示` : ""), pt = l(() => k.value ? U.value.length > 0 || N.value : U.value.length > 0);
143
+ }), lt = l(() => K.value.length > 0), ut = l(() => G.value.filter((e) => !o(O.value[e.key])).length), dt = l(() => G.value.filter((e) => e.required && o(O.value[e.key])).length), ft = l(() => G.value.length ? Math.round(ut.value / G.value.length * 100) : 0), pt = l(() => k.value && A.value.length === 0), mt = l(() => k.value ? pt.value ? "校验通过,模板与填写值均符合规则" : `发现 ${A.value.length} 个模板或填写问题` : j.value.length ? `发现 ${W.value.length} 个模板或填写问题` : nt.value.length ? `模板存在 ${nt.value.length} 个问题,已安全降级展示` : ""), ht = l(() => k.value ? W.value.length > 0 || N.value : W.value.length > 0);
154
144
  x(() => T.template, (e) => {
155
- K(c(e, T.values), !1), wt();
145
+ q(s(e, T.values), !1), Ot();
156
146
  let t = Array.isArray(e?.pages) ? e.pages.map((e) => e?.id) : [];
157
- t.includes(I.value) || (I.value = t.find(Boolean) ?? ""), F.value && !W.value.some((e) => e.key === F.value) && Ot();
147
+ t.includes(I.value) || (I.value = t.find(Boolean) ?? ""), F.value && !G.value.some((e) => e.key === F.value) && Nt();
158
148
  }, { deep: !0 }), x(() => [
159
149
  T.template?.variables,
160
150
  T.optionResolver,
@@ -163,176 +153,191 @@ var Ee = {
163
153
  T.remoteRequestTimeoutMs,
164
154
  T.remoteOptionsCacheTtlMs
165
155
  ], () => {
166
- Ft();
156
+ Bt();
167
157
  }, {
168
158
  deep: !0,
169
159
  immediate: !0
170
160
  }), x(() => T.values, (e) => {
171
- let t = c(T.template, e);
172
- tn(t, O.value) || (K(t, !1, { refreshInlineHtml: T.interactionMode !== "inline" }), wt());
173
- }, { deep: !0 }), x($e, (e) => {
174
- e && (Ke.value = { ...O.value });
161
+ let t = s(T.template, e);
162
+ sn(t, O.value) || (q(t, !1, { refreshInlineHtml: T.interactionMode !== "inline" }), Ot());
163
+ }, { deep: !0 }), x(tt, (e) => {
164
+ e && (Je.value = { ...O.value });
175
165
  }), x(() => T.collapsiblePanel, (e) => {
176
166
  e || (B.value = !1);
177
- }), x(() => T.zoom, (e) => L.value = $t(e)), x(G, (e) => {
167
+ }), x(() => T.zoom, (e) => L.value = an(e)), x(K, (e) => {
178
168
  !I.value && e.length && (I.value = e[0].id);
179
169
  }, { immediate: !0 });
180
- function K(e, t = !0, n = {}) {
181
- O.value = { ...e }, n.refreshInlineHtml !== !1 && (Ke.value = { ...e }), t && (E("update:values", { ...O.value }), E("change", { ...O.value }));
170
+ function q(e, t = !0, n = {}) {
171
+ O.value = { ...e }, n.refreshInlineHtml !== !1 && (Je.value = { ...e }), t && (E("update:values", { ...O.value }), E("change", { ...O.value }));
182
172
  }
183
- function q(e, t) {
184
- if (!e || Qe.value) return;
185
- if (K({
173
+ function J(e, t) {
174
+ if (!e || et.value) return;
175
+ if (q({
186
176
  ...O.value,
187
177
  [e]: t
188
178
  }, !0, { refreshInlineHtml: T.interactionMode !== "inline" }), k.value) {
189
- bt();
179
+ wt();
190
180
  return;
191
181
  }
192
- let n = W.value.find((t) => t.key === e);
193
- n && (n.type ?? "text") === "text" && (j.value = [...j.value.filter((t) => t.variableKey !== e), ...re(n, t)], E("validate", U.value));
182
+ let n = G.value.find((t) => t.key === e);
183
+ n && (n.type ?? "text") === "text" && (j.value = [...j.value.filter((t) => t.variableKey !== e), ...re(n, t)], E("validate", W.value));
194
184
  }
195
- function mt(e) {
185
+ function gt(e) {
196
186
  if (T.interactionMode !== "inline") return;
197
187
  let t = e.target;
198
188
  if (!(t instanceof HTMLInputElement) && !(t instanceof HTMLTextAreaElement)) return;
199
189
  let n = t.dataset.key || "";
200
- n && (t instanceof HTMLInputElement && t.type === "checkbox" ? q(n, t.checked) : t instanceof HTMLInputElement && t.type === "number" ? q(n, t.value === "" ? void 0 : t.valueAsNumber) : q(n, t.value));
190
+ n && (t instanceof HTMLInputElement && t.type === "checkbox" ? J(n, t.checked) : t instanceof HTMLInputElement && t.type === "number" ? J(n, t.value === "" ? void 0 : t.valueAsNumber) : J(n, t.value));
201
191
  }
202
- function ht(e) {
192
+ function _t(e) {
203
193
  let t = e.target;
204
194
  if (!(t instanceof Element)) return;
205
195
  let n = t.closest("[data-render-page-id]");
206
196
  n?.dataset.renderPageId && (I.value = n.dataset.renderPageId);
207
197
  let r = t.closest("[data-contract-render-wrapper], [data-contract-render-control]")?.dataset.key || "";
208
- r && Z(r);
198
+ r && Mt(r);
199
+ }
200
+ function vt(e, t, n) {
201
+ let r = ie(e, {
202
+ pageIndex: t,
203
+ pageNumber: t + 1,
204
+ totalPages: K.value.length
205
+ }).key;
206
+ for (U.delete(r), U.set(r, n); U.size > He;) {
207
+ let e = U.keys().next().value;
208
+ if (e === void 0) break;
209
+ U.delete(e);
210
+ }
209
211
  }
210
- function gt(e) {
211
- let t = G.value.find((t) => t.id === e.pageId), n = W.value.some((t) => t.key === e.key);
212
- if (!(!t || !n || !qt(t.contentHtml).has(e.key)) && !(e.kind === "input" && T.interactionMode !== "inline")) {
212
+ function yt(e) {
213
+ return U.get(e);
214
+ }
215
+ function bt(e) {
216
+ let t = K.value.find((t) => t.id === e.pageId), n = G.value.some((t) => t.key === e.key);
217
+ if (!(!t || !n || !Qt(t.contentHtml).has(e.key)) && !(e.kind === "input" && T.interactionMode !== "inline")) {
213
218
  if (I.value = e.pageId, e.kind === "input") {
214
- q(e.key, e.value);
219
+ J(e.key, e.value);
215
220
  return;
216
221
  }
217
- Z(e.key);
222
+ Mt(e.key);
218
223
  }
219
224
  }
220
- function _t(e) {
225
+ function xt(e) {
221
226
  if (e.key !== "Enter" && e.key !== " ") return;
222
227
  let t = e.target;
223
- !(t instanceof HTMLElement) || !t.dataset.key || (e.preventDefault(), Z(t.dataset.key));
228
+ !(t instanceof HTMLElement) || !t.dataset.key || (e.preventDefault(), Mt(t.dataset.key));
224
229
  }
225
- function vt() {
230
+ function St() {
226
231
  return { ...O.value };
227
232
  }
228
- function yt(e) {
229
- K(c(T.template, e));
233
+ function Ct(e) {
234
+ q(s(T.template, e));
230
235
  }
231
- function bt() {
236
+ function wt() {
232
237
  let e = ne(T.template, O.value);
233
- return Tt(e), E("validate", e), e;
238
+ return kt(e), E("validate", e), e;
234
239
  }
235
- function xt() {
240
+ function Tt() {
236
241
  let e = ee(T.template, O.value, T.validateOnSubmit);
237
- if ((T.validateOnSubmit || e.length) && (Tt(e), E("validate", e)), e.length) return At(e[0]), !1;
238
- let t = vt();
242
+ if ((T.validateOnSubmit || e.length) && (kt(e), E("validate", e)), e.length) return Ft(e[0]), !1;
243
+ let t = St();
239
244
  return E("submit", t), t;
240
245
  }
241
- function St() {
242
- return K(a(T.template)), wt(), vt();
246
+ function Et() {
247
+ return q(i(T.template)), Ot(), St();
243
248
  }
244
- function Ct() {
245
- Qe.value || ve.confirm({
249
+ function Dt() {
250
+ et.value || ye.confirm({
246
251
  title: "重置填写内容?",
247
252
  content: "将恢复模板中的默认值,当前未提交的填写内容会被覆盖。",
248
253
  okText: "确认重置",
249
254
  cancelText: "取消",
250
- onOk: () => St()
255
+ onOk: () => Et()
251
256
  });
252
257
  }
253
- function wt() {
254
- j.value = [], k.value = !1, A.value = [], M.value = !1, N.value = !1, Y();
258
+ function Ot() {
259
+ j.value = [], k.value = !1, A.value = [], M.value = !1, N.value = !1, X();
255
260
  }
256
- function Tt(e) {
261
+ function kt(e) {
257
262
  if (j.value = [], A.value = e, k.value = !0, M.value = !1, e.length) {
258
- N.value = !1, Y();
263
+ N.value = !1, X();
259
264
  return;
260
265
  }
261
- Et();
266
+ At();
262
267
  }
263
- let J;
264
- function Y() {
265
- J &&= (clearTimeout(J), void 0);
268
+ let Y;
269
+ function X() {
270
+ Y &&= (clearTimeout(Y), void 0);
266
271
  }
267
- function Et() {
268
- Y(), N.value = !0, J = setTimeout(() => {
269
- N.value = !1, J = void 0;
270
- }, Be);
272
+ function At() {
273
+ X(), N.value = !0, Y = setTimeout(() => {
274
+ N.value = !1, Y = void 0;
275
+ }, Ve);
271
276
  }
272
- function X(e) {
273
- Z(e, !0);
277
+ function Z(e) {
278
+ Mt(e, !0);
274
279
  }
275
- function Dt(e) {
276
- T.interactionMode === "panel" && (B.value &&= !1, W.value.some((t) => t.key === e) && !at.value.some((t) => t.key === e) && Ut());
280
+ function jt(e) {
281
+ T.interactionMode === "panel" && (B.value &&= !1, G.value.some((t) => t.key === e) && !st.value.some((t) => t.key === e) && Jt());
277
282
  }
278
- function Z(e, t = !1) {
283
+ function Mt(e, t = !1) {
279
284
  if (!e) return;
280
- Dt(e), F.value = e, P.value = e;
281
- let n = it.value.get(e);
282
- n && (I.value = n), t && (qe.value += 1), g(() => {
283
- kt(e);
284
- let r = n ? D.value?.querySelector(`[data-render-page-id="${en(n)}"]`) : void 0;
285
+ jt(e), F.value = e, P.value = e;
286
+ let n = ot.value.get(e);
287
+ n && (I.value = n), t && (Ye.value += 1), g(() => {
288
+ Pt(e);
289
+ let r = n ? D.value?.querySelector(`[data-render-page-id="${on(n)}"]`) : void 0;
285
290
  t && r?.scrollIntoView({
286
291
  behavior: "smooth",
287
292
  block: "center",
288
293
  inline: "center"
289
- }), T.interactionMode === "panel" && Ge.value?.querySelector(`[data-field-key="${en(e)}"]`)?.scrollIntoView({
294
+ }), T.interactionMode === "panel" && qe.value?.querySelector(`[data-field-key="${on(e)}"]`)?.scrollIntoView({
290
295
  behavior: "smooth",
291
296
  block: "nearest"
292
297
  });
293
298
  });
294
299
  }
295
- function Ot() {
296
- F.value = "", P.value = "", kt("");
300
+ function Nt() {
301
+ F.value = "", P.value = "", Pt("");
297
302
  }
298
- function kt(e) {
303
+ function Pt(e) {
299
304
  D.value?.querySelectorAll("[data-contract-render-wrapper], [data-contract-render-control]").forEach((t) => t.classList.toggle("is-active", !!e && t.dataset.key === e));
300
305
  }
301
- function At(e) {
302
- e.variableKey ? (X(e.variableKey), T.interactionMode === "panel" && g(() => Gt(e.variableKey))) : e.pageId && Qt(e.pageId);
306
+ function Ft(e) {
307
+ e.variableKey ? (Z(e.variableKey), T.interactionMode === "panel" && g(() => Xt(e.variableKey))) : e.pageId && rn(e.pageId);
303
308
  }
304
- function jt(e) {
305
- return rt.value.get(e) ?? [];
309
+ function It(e) {
310
+ return at.value.get(e) ?? [];
306
311
  }
307
- function Mt(e) {
308
- return Je.value.get(e.key) ?? {
312
+ function Lt(e) {
313
+ return Xe.value.get(e.key) ?? {
309
314
  options: e.options ?? [],
310
315
  loading: !1
311
316
  };
312
317
  }
313
- function Nt(e) {
318
+ function Rt(e) {
314
319
  let t = e.componentKey || e.type || "";
315
320
  return t ? T.controlRegistry?.[t] : void 0;
316
321
  }
317
322
  function Q(e, t) {
318
- let n = new Map(Je.value);
319
- n.set(e, t), Je.value = n;
323
+ let n = new Map(Xe.value);
324
+ n.set(e, t), Xe.value = n;
320
325
  }
321
- function Pt(e) {
326
+ function zt(e) {
322
327
  E("control-warning", e);
323
328
  }
324
- async function Ft() {
325
- V.forEach((e) => e.abort()), V.clear(), Ye.clear(), Xe.clear();
329
+ async function Bt() {
330
+ V.forEach((e) => e.abort()), V.clear(), Ze.clear(), Qe.clear();
326
331
  let e = Array.isArray(T.template?.variables) ? T.template.variables : [];
327
332
  await Promise.all(e.map(async (e) => {
328
333
  if (!e?.key) return;
329
334
  let t = Array.isArray(e.options) ? e.options.map((e) => ({ ...e })) : [];
330
- if (e.dataSource ? await It(e, t) : Q(e.key, {
335
+ if (e.dataSource ? await Vt(e, t) : Q(e.key, {
331
336
  options: t,
332
337
  loading: !1
333
- }), e.type === "custom" && !Nt(e)) {
338
+ }), e.type === "custom" && !Rt(e)) {
334
339
  let t = e.componentKey || "", n = `${e.key}:${t}`;
335
- Xe.has(n) || (Xe.add(n), Pt({
340
+ Qe.has(n) || (Qe.add(n), zt({
336
341
  code: "CONTROL_COMPONENT_MISSING",
337
342
  variableKey: e.key,
338
343
  componentKey: t,
@@ -341,7 +346,7 @@ var Ee = {
341
346
  }
342
347
  }));
343
348
  }
344
- async function It(e, n) {
349
+ async function Vt(e, n) {
345
350
  let r = e.dataSource;
346
351
  if (!r) return;
347
352
  let i = new AbortController();
@@ -349,7 +354,7 @@ var Ee = {
349
354
  options: n,
350
355
  loading: !0
351
356
  });
352
- let a = Lt(e), o = Date.now(), s = Ye.get(a);
357
+ let a = Ht(e), o = Date.now(), s = Ze.get(a);
353
358
  if (s && s.expiresAt > o) {
354
359
  Q(e.key, {
355
360
  options: s.options,
@@ -361,13 +366,13 @@ var Ee = {
361
366
  try {
362
367
  r.kind === "url" && !t(r.url, T.allowedRemoteOrigins) && (c = "CONTROL_REMOTE_URL_BLOCKED");
363
368
  let o = H.get(a);
364
- o || (o = Rt(e, r, c, i), H.set(a, o), o.finally(() => {
369
+ o || (o = Ut(e, r, c, i), H.set(a, o), o.finally(() => {
365
370
  H.get(a) === o && H.delete(a);
366
371
  }).catch(() => void 0));
367
372
  let s = await o;
368
373
  if (i.signal.aborted) return;
369
374
  let ee = Math.max(0, Number(T.remoteOptionsCacheTtlMs) || 0);
370
- ee > 0 && Ye.set(a, {
375
+ ee > 0 && Ze.set(a, {
371
376
  options: s,
372
377
  expiresAt: Date.now() + ee
373
378
  }), Q(e.key, {
@@ -382,7 +387,7 @@ var Ee = {
382
387
  options: n,
383
388
  loading: !1,
384
389
  error: a
385
- }), Pt({
390
+ }), zt({
386
391
  code: c,
387
392
  variableKey: e.key,
388
393
  message: `${e.label || e.key}:${a}`,
@@ -392,40 +397,40 @@ var Ee = {
392
397
  V.get(e.key) === i && V.delete(e.key);
393
398
  }
394
399
  }
395
- function Lt(e) {
400
+ function Ht(e) {
396
401
  try {
397
402
  return JSON.stringify([e.type, e.dataSource]);
398
403
  } catch {
399
404
  return `${e.key}:${e.type}`;
400
405
  }
401
406
  }
402
- async function Rt(e, r, a, o) {
407
+ async function Ut(e, i, a, o) {
403
408
  let s;
404
- if (r.kind === "resolver") {
405
- if (!T.optionResolver) throw Error(`缺少 resolver ${r.resolverKey} 的宿主实现`);
409
+ if (i.kind === "resolver") {
410
+ if (!T.optionResolver) throw Error(`缺少 resolver ${i.resolverKey} 的宿主实现`);
406
411
  s = await T.optionResolver({
407
- resolverKey: r.resolverKey,
408
- params: r.params,
412
+ resolverKey: i.resolverKey,
413
+ params: i.params,
409
414
  variable: e,
410
415
  signal: o.signal
411
416
  });
412
417
  } else {
413
- if (!t(r.url, T.allowedRemoteOrigins)) throw Error(`远程地址未在 allowlist 中:${r.url}`);
418
+ if (!t(i.url, T.allowedRemoteOrigins)) throw Error(`远程地址未在 allowlist 中:${i.url}`);
414
419
  if (!T.requester) throw Error("缺少宿主 requester,组件库不会直接发起网络请求");
415
- let n = i(r.timeoutMs, T.remoteRequestTimeoutMs);
416
- s = await zt(T.requester({
417
- url: r.url,
418
- method: r.method || "GET",
419
- params: r.params,
420
- headers: r.headers,
420
+ let n = r(i.timeoutMs, T.remoteRequestTimeoutMs);
421
+ s = await Wt(T.requester({
422
+ url: i.url,
423
+ method: i.method || "GET",
424
+ params: i.params,
425
+ headers: i.headers,
421
426
  timeoutMs: n,
422
427
  signal: o.signal,
423
428
  variable: e
424
429
  }), o, n);
425
430
  }
426
- return n(s, r.kind === "url" ? r : void 0, e.type || "select");
431
+ return n(s, i.kind === "url" ? i : void 0, e.type || "select");
427
432
  }
428
- function zt(e, t, n) {
433
+ function Wt(e, t, n) {
429
434
  return new Promise((r, i) => {
430
435
  let a = () => {
431
436
  clearTimeout(c), t.signal.removeEventListener("abort", s);
@@ -437,58 +442,58 @@ var Ee = {
437
442
  t.signal.addEventListener("abort", s, { once: !0 }), e.then((e) => o(() => r(e)), (e) => o(() => i(e)));
438
443
  });
439
444
  }
440
- function Bt(e) {
441
- let t = Mt(e);
445
+ function Gt(e) {
446
+ let t = Lt(e);
442
447
  return {
443
448
  variable: e,
444
449
  value: O.value[e.key],
445
- errors: jt(e.key),
450
+ errors: It(e.key),
446
451
  active: F.value === e.key,
447
452
  readonly: T.readonly,
448
453
  disabled: T.disabled,
449
454
  options: t.options,
450
455
  loading: t.loading,
451
456
  loadError: t.error,
452
- updateValue: (t) => q(e.key, t),
453
- focusVariable: () => X(e.key)
457
+ updateValue: (t) => J(e.key, t),
458
+ focusVariable: () => Z(e.key)
454
459
  };
455
460
  }
456
- function Vt() {
457
- let e = W.value;
461
+ function Kt() {
462
+ let e = G.value;
458
463
  if (!e.length) return;
459
464
  let t = e.findIndex((e) => e.key === F.value), n = t < 0 ? 0 : t + 1;
460
465
  for (let t = 0; t < e.length; t += 1) {
461
466
  let r = e[(n + t) % e.length];
462
- if (s(O.value[r.key])) {
463
- X(r.key);
467
+ if (o(O.value[r.key])) {
468
+ Z(r.key);
464
469
  return;
465
470
  }
466
471
  }
467
472
  }
468
- function Ht(e) {
473
+ function qt(e) {
469
474
  let t = R.value.trim().toLocaleLowerCase();
470
- return !t || e.key.toLocaleLowerCase().includes(t) || (e.label ?? "").toLocaleLowerCase().includes(t) ? z.value === "unfilled" ? s(O.value[e.key]) : z.value === "error" ? jt(e.key).length > 0 : !0 : !1;
475
+ return !t || e.key.toLocaleLowerCase().includes(t) || (e.label ?? "").toLocaleLowerCase().includes(t) ? z.value === "unfilled" ? o(O.value[e.key]) : z.value === "error" ? It(e.key).length > 0 : !0 : !1;
471
476
  }
472
- function Ut() {
477
+ function Jt() {
473
478
  R.value = "", z.value = "all";
474
479
  }
475
- function Wt(e, t) {
476
- let n = at.value;
480
+ function Yt(e, t) {
481
+ let n = st.value;
477
482
  if (!n.length) return;
478
483
  let r = n.findIndex((t) => t.key === e), i = n[r < 0 ? 0 : (r + t + n.length) % n.length]?.key;
479
- i && (X(i), g(() => Gt(i)));
484
+ i && (Z(i), g(() => Xt(i)));
480
485
  }
481
- function Gt(e) {
482
- (Ge.value?.querySelector(`[data-field-key="${en(e)}"]`))?.querySelector("input:not([disabled]), textarea:not([disabled]), button:not([disabled])")?.focus();
486
+ function Xt(e) {
487
+ (qe.value?.querySelector(`[data-field-key="${on(e)}"]`))?.querySelector("input:not([disabled]), textarea:not([disabled]), button:not([disabled])")?.focus();
483
488
  }
484
- function Kt(e) {
489
+ function Zt(e) {
485
490
  if (e.key !== "Enter" || e.target instanceof HTMLTextAreaElement) return;
486
491
  let t = e.target;
487
492
  if (!(t instanceof Element)) return;
488
493
  let n = t.closest("[data-field-key]")?.dataset.fieldKey;
489
- n && (e.preventDefault(), Wt(n, e.shiftKey ? -1 : 1));
494
+ n && (e.preventDefault(), Yt(n, e.shiftKey ? -1 : 1));
490
495
  }
491
- function qt(e) {
496
+ function Qt(e) {
492
497
  let t = /* @__PURE__ */ new Set();
493
498
  if (typeof DOMParser < "u") return new DOMParser().parseFromString(e, "text/html").querySelectorAll("[data-key]").forEach((e) => {
494
499
  let n = e.getAttribute("data-key")?.trim();
@@ -501,100 +506,101 @@ var Ee = {
501
506
  }
502
507
  return t;
503
508
  }
504
- function Jt() {
509
+ function $t() {
505
510
  !T.collapsiblePanel || T.interactionMode !== "panel" || (B.value = !B.value);
506
511
  }
507
512
  function $(e) {
508
- let t = $t(e);
513
+ let t = an(e);
509
514
  return L.value = t, E("update:zoom", t), t;
510
515
  }
511
- function Yt() {
516
+ function en() {
512
517
  return $(1);
513
518
  }
514
- function Xt() {
519
+ function tn() {
515
520
  return L.value;
516
521
  }
517
- function Zt() {
518
- let e = Math.max(...G.value.map((e) => e.width), 1);
519
- return $(Math.max(0, Ze.value - 48) / e);
522
+ function nn() {
523
+ let e = Math.max(...K.value.map((e) => e.width), 1);
524
+ return $(Math.max(0, $e.value - 48) / e);
520
525
  }
521
- function Qt(e) {
526
+ function rn(e) {
522
527
  e && (I.value = e, g(() => {
523
- D.value?.querySelector(`[data-render-page-id="${en(e)}"]`)?.scrollIntoView({
528
+ D.value?.querySelector(`[data-render-page-id="${on(e)}"]`)?.scrollIntoView({
524
529
  behavior: "smooth",
525
530
  block: "start",
526
531
  inline: "center"
527
532
  });
528
533
  }));
529
534
  }
530
- function $t(e) {
535
+ function an(e) {
531
536
  let t = Number(e);
532
- return Number.isFinite(t) ? Math.min(ze, Math.max(Re, Math.round(t * 100) / 100)) : 1;
537
+ return Number.isFinite(t) ? Math.min(Be, Math.max(ze, Math.round(t * 100) / 100)) : 1;
533
538
  }
534
- function en(e) {
539
+ function on(e) {
535
540
  return e.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
536
541
  }
537
- function tn(e, t) {
542
+ function sn(e, t) {
538
543
  let n = new Set([...Object.keys(e), ...Object.keys(t)]);
539
544
  return Array.from(n).every((n) => e[n] === t[n]);
540
545
  }
541
- function nn(e) {
542
- !(e.ctrlKey || e.metaKey) || !st.value || (e.preventDefault(), $(e.deltaY > 0 ? L.value - w : L.value + w));
546
+ function cn(e) {
547
+ !(e.ctrlKey || e.metaKey) || !lt.value || (e.preventDefault(), $(e.deltaY > 0 ? L.value - w : L.value + w));
543
548
  }
544
- let rn;
545
- function an() {
546
- rn?.removeEventListener("wheel", nn), rn = void 0;
549
+ let ln;
550
+ function un() {
551
+ ln?.removeEventListener("wheel", cn), ln = void 0;
547
552
  }
548
- function on(e) {
549
- an(), e && (e.addEventListener("wheel", nn, { passive: !1 }), rn = e);
553
+ function dn(e) {
554
+ un(), e && (e.addEventListener("wheel", cn, { passive: !1 }), ln = e);
550
555
  }
551
556
  return x(D, (e) => {
552
- on(e);
553
- }, { immediate: !0 }), pe(() => {
554
- an(), Y(), V.forEach((e) => e.abort()), V.clear();
555
- }), Ve({
556
- showValidation: Tt,
557
+ dn(e);
558
+ }, { immediate: !0 }), me(() => {
559
+ un(), X(), V.forEach((e) => e.abort()), V.clear();
560
+ }), Ue({
561
+ showValidation: kt,
562
+ getMountedLayoutMetrics: yt,
557
563
  focusError: (e) => {
558
- At(e), e.variableKey && g(() => Gt(e.variableKey));
564
+ Ft(e), e.variableKey && g(() => Xt(e.variableKey));
559
565
  },
560
- getValues: vt,
561
- setValues: yt,
562
- validate: bt,
563
- submit: xt,
564
- resetValues: St,
565
- scrollToVariable: X,
566
+ getValues: St,
567
+ setValues: Ct,
568
+ validate: wt,
569
+ submit: Tt,
570
+ resetValues: Et,
571
+ scrollToVariable: Z,
566
572
  setZoom: $,
567
- resetZoom: Yt,
568
- getZoom: Xt,
569
- fitWidth: Zt,
570
- scrollToPage: Qt
573
+ resetZoom: en,
574
+ getZoom: tn,
575
+ fitWidth: nn,
576
+ scrollToPage: rn
571
577
  }), (e, t) => (_(), f("section", {
572
578
  ref_key: "rendererElement",
573
- ref: We,
574
- class: fe(["gd-contract-template-renderer", {
579
+ ref: Ke,
580
+ class: pe(["gd-contract-template-renderer", {
575
581
  "is-disabled": h.disabled,
576
582
  "is-readonly": h.readonly,
577
583
  "is-panel": h.interactionMode === "panel",
578
584
  "is-inline": h.interactionMode === "inline"
579
585
  }]),
580
- onClick: ht,
581
- onKeydown: _t,
582
- onInput: mt,
583
- onChange: mt
586
+ onClick: _t,
587
+ onKeydown: xt,
588
+ onInput: gt,
589
+ onChange: gt
584
590
  }, [
585
- he(e.$slots, "fileBar"),
586
- st.value ? (_(), u(ae, {
591
+ ge(e.$slots, "fileBar"),
592
+ lt.value ? (_(), u(oe, {
587
593
  key: 0,
588
594
  title: h.title,
589
- "filled-count": ct.value,
590
- "total-count": W.value.length,
591
- "progress-percent": ut.value,
592
- "required-missing-count": lt.value,
595
+ "filled-count": ut.value,
596
+ "total-count": G.value.length,
597
+ "progress-percent": ft.value,
598
+ "required-missing-count": dt.value,
593
599
  zoom: L.value,
594
- pages: G.value,
600
+ pages: K.value,
595
601
  "active-page-id": I.value,
596
- "min-zoom": Re,
597
- "max-zoom": ze,
602
+ "min-zoom": ze,
603
+ "max-zoom": Be,
598
604
  "show-toolbar": h.showToolbar,
599
605
  "show-validate-button": h.showValidateButton,
600
606
  "show-reset-button": h.showResetButton,
@@ -605,15 +611,15 @@ var Ee = {
605
611
  disabled: h.disabled,
606
612
  onZoomIn: t[0] ||= (e) => $(L.value + w),
607
613
  onZoomOut: t[1] ||= (e) => $(L.value - w),
608
- onResetZoom: Yt,
609
- onFitWidth: Zt,
610
- onSelectPage: Qt,
611
- onValidate: bt,
612
- onReset: Ct,
613
- onSubmit: xt,
614
- onTogglePanel: Jt
614
+ onResetZoom: en,
615
+ onFitWidth: nn,
616
+ onSelectPage: rn,
617
+ onValidate: wt,
618
+ onReset: Dt,
619
+ onSubmit: Tt,
620
+ onTogglePanel: $t
615
621
  }, {
616
- extra: S(() => [he(e.$slots, "headerExtra")]),
622
+ extra: S(() => [ge(e.$slots, "headerExtra")]),
617
623
  _: 3
618
624
  }, 8, [
619
625
  "title",
@@ -633,39 +639,40 @@ var Ee = {
633
639
  "readonly",
634
640
  "disabled"
635
641
  ])) : d("", !0),
636
- pt.value ? (_(), u(se, {
642
+ ht.value ? (_(), u(ce, {
637
643
  key: 1,
638
- passed: dt.value,
639
- summary: ft.value,
640
- errors: U.value,
644
+ passed: pt.value,
645
+ summary: mt.value,
646
+ errors: W.value,
641
647
  expanded: M.value,
642
648
  onToggle: t[2] ||= (e) => M.value = !M.value,
643
- onFocusError: At
649
+ onFocusError: Ft
644
650
  }, null, 8, [
645
651
  "passed",
646
652
  "summary",
647
653
  "errors",
648
654
  "expanded"
649
655
  ])) : d("", !0),
650
- st.value ? (_(), f("div", {
656
+ lt.value ? (_(), f("div", {
651
657
  key: 3,
652
- class: fe(["gd-contract-template-renderer__workspace", { "is-inline": h.interactionMode === "inline" }])
658
+ class: pe(["gd-contract-template-renderer__workspace", { "is-inline": h.interactionMode === "inline" }])
653
659
  }, [p("div", {
654
660
  ref_key: "pagesViewportElement",
655
661
  ref: D,
656
662
  class: "gd-contract-template-renderer__pages-viewport",
657
663
  "data-highlighted-variable-key": P.value
658
- }, [p("div", Oe, [(_(!0), f(ce, null, me(G.value, (e, t) => (_(), u(oe, {
664
+ }, [p("div", ke, [(_(!0), f(le, null, he(K.value, (e, t) => (_(), u(se, {
659
665
  key: e.id,
660
666
  page: e,
661
667
  index: t,
662
- total: G.value.length,
668
+ total: K.value.length,
663
669
  zoom: L.value,
664
670
  "show-meta": h.showPageMeta,
665
671
  "font-base-url": h.contractFontBaseUrl,
666
672
  "active-key": P.value,
667
- "scroll-request": qe.value,
668
- onInteraction: gt
673
+ "scroll-request": Ye.value,
674
+ onInteraction: bt,
675
+ onMetrics: (n) => vt(e, t, n)
669
676
  }, null, 8, [
670
677
  "page",
671
678
  "index",
@@ -674,11 +681,12 @@ var Ee = {
674
681
  "show-meta",
675
682
  "font-base-url",
676
683
  "active-key",
677
- "scroll-request"
678
- ]))), 128))])], 8, De), h.interactionMode === "panel" ? (_(), f("div", {
684
+ "scroll-request",
685
+ "onMetrics"
686
+ ]))), 128))])], 8, Oe), h.interactionMode === "panel" ? (_(), f("div", {
679
687
  key: 0,
680
- class: fe(["gd-contract-template-renderer__panel-wrap", { "is-collapsed": B.value && h.collapsiblePanel }])
681
- }, [h.collapsiblePanel ? (_(), u(b(xe), {
688
+ class: pe(["gd-contract-template-renderer__panel-wrap", { "is-collapsed": B.value && h.collapsiblePanel }])
689
+ }, [h.collapsiblePanel ? (_(), u(b(Se), {
682
690
  key: 0,
683
691
  title: B.value ? "展开填写面板" : "收起填写面板"
684
692
  }, {
@@ -688,17 +696,17 @@ var Ee = {
688
696
  "aria-label": B.value ? "展开填写面板" : "收起填写面板",
689
697
  "aria-expanded": !B.value,
690
698
  onClick: t[3] ||= (e) => B.value = !B.value
691
- }, [B.value ? (_(), u(b(Ce), {
699
+ }, [B.value ? (_(), u(b(we), {
692
700
  key: 0,
693
701
  "aria-hidden": "true"
694
- })) : (_(), u(b(we), {
702
+ })) : (_(), u(b(Te), {
695
703
  key: 1,
696
704
  "aria-hidden": "true"
697
- }))], 8, ke)]),
705
+ }))], 8, Ae)]),
698
706
  _: 1
699
- }, 8, ["title"])) : d("", !0), p("div", Ae, [p("aside", je, [p("div", Me, [
700
- p("div", Ne, [p("div", null, [t[6] ||= p("strong", null, "填写项", -1), p("span", null, y(ct.value) + " / " + y(W.value.length) + " 已填写", 1)]), p("span", null, y(lt.value ? `${lt.value} 项必填未完成` : "必填项已完成"), 1)]),
701
- m(b(_e), {
707
+ }, 8, ["title"])) : d("", !0), p("div", je, [p("aside", Me, [p("div", Ne, [
708
+ p("div", Pe, [p("div", null, [t[6] ||= p("strong", null, "填写项", -1), p("span", null, y(ut.value) + " / " + y(G.value.length) + " 已填写", 1)]), p("span", null, y(dt.value ? `${dt.value} 项必填未完成` : "必填项已完成"), 1)]),
709
+ m(b(ve), {
702
710
  value: R.value,
703
711
  "onUpdate:value": t[4] ||= (e) => R.value = e,
704
712
  "allow-clear": "",
@@ -706,55 +714,55 @@ var Ee = {
706
714
  class: "gd-contract-template-renderer__field-search",
707
715
  placeholder: "搜索字段名称或标识"
708
716
  }, {
709
- prefix: S(() => [m(b(Te), { "aria-hidden": "true" })]),
717
+ prefix: S(() => [m(b(Ee), { "aria-hidden": "true" })]),
710
718
  _: 1
711
719
  }, 8, ["value"]),
712
- p("div", Pe, [m(b(be), {
720
+ p("div", Fe, [m(b(xe), {
713
721
  value: z.value,
714
722
  "onUpdate:value": t[5] ||= (e) => z.value = e,
715
723
  size: "small",
716
724
  class: "gd-contract-template-renderer__field-filter",
717
- options: Ue
718
- }, null, 8, ["value"]), m(b(ge), {
725
+ options: Ge
726
+ }, null, 8, ["value"]), m(b(_e), {
719
727
  size: "small",
720
- disabled: !nt.value,
721
- onClick: Vt
728
+ disabled: !it.value,
729
+ onClick: Kt
722
730
  }, {
723
- default: S(() => [...t[7] ||= [ue(" 下一个未填项 ", -1)]]),
731
+ default: S(() => [...t[7] ||= [de(" 下一个未填项 ", -1)]]),
724
732
  _: 1
725
733
  }, 8, ["disabled"])]),
726
- m(b(ye), {
727
- percent: ut.value,
734
+ m(b(be), {
735
+ percent: ft.value,
728
736
  size: "small",
729
737
  "show-info": !1
730
738
  }, null, 8, ["percent"])
731
- ]), at.value.length ? (_(), f("div", {
739
+ ]), st.value.length ? (_(), f("div", {
732
740
  key: 1,
733
741
  ref_key: "fieldListElement",
734
- ref: Ge,
742
+ ref: qe,
735
743
  class: "gd-contract-template-renderer__field-list",
736
- onKeydownCapture: Kt
737
- }, [(_(!0), f(ce, null, me(ot.value, (t) => (_(), f("div", {
744
+ onKeydownCapture: Zt
745
+ }, [(_(!0), f(le, null, he(ct.value, (t) => (_(), f("div", {
738
746
  key: t.id,
739
747
  class: "gd-contract-template-renderer__field-group"
740
- }, [p("div", Fe, [p("strong", null, y(t.title), 1), p("span", null, y(t.variables.length) + " / " + y(t.totalCount) + " 项", 1)]), p("div", Ie, [(_(!0), f(ce, null, me(t.variables, (t) => (_(), f("div", {
748
+ }, [p("div", Ie, [p("strong", null, y(t.title), 1), p("span", null, y(t.variables.length) + " / " + y(t.totalCount) + " 项", 1)]), p("div", Le, [(_(!0), f(le, null, he(t.variables, (t) => (_(), f("div", {
741
749
  key: t.id || t.key,
742
750
  "data-field-key": t.key
743
- }, [he(e.$slots, "field", de({ ref_for: !0 }, Bt(t)), () => [m(ie, {
751
+ }, [ge(e.$slots, "field", fe({ ref_for: !0 }, Gt(t)), () => [m(ae, {
744
752
  variable: t,
745
753
  value: O.value[t.key],
746
- errors: jt(t.key),
754
+ errors: It(t.key),
747
755
  active: F.value === t.key,
748
756
  readonly: h.readonly,
749
757
  disabled: h.disabled,
750
- options: Mt(t).options,
751
- loading: Mt(t).loading,
752
- "load-error": Mt(t).error,
753
- registration: Nt(t),
758
+ options: Lt(t).options,
759
+ loading: Lt(t).loading,
760
+ "load-error": Lt(t).error,
761
+ registration: Rt(t),
754
762
  "selector-http": h.selectorHttp,
755
763
  "selector-url-prefix": h.selectorUrlPrefix,
756
- onUpdateValue: (e) => q(t.key, e),
757
- onFocusVariable: (e) => X(t.key)
764
+ onUpdateValue: (e) => J(t.key, e),
765
+ onFocusVariable: (e) => Z(t.key)
758
766
  }, null, 8, [
759
767
  "variable",
760
768
  "value",
@@ -770,19 +778,19 @@ var Ee = {
770
778
  "selector-url-prefix",
771
779
  "onUpdateValue",
772
780
  "onFocusVariable"
773
- ])])], 8, Le))), 128))])]))), 128))], 544)) : (_(), u(b(C), {
781
+ ])])], 8, Re))), 128))])]))), 128))], 544)) : (_(), u(b(C), {
774
782
  key: 0,
775
783
  class: "gd-contract-template-renderer__field-empty",
776
- description: W.value.length ? "没有符合条件的填写项" : "暂无填写项",
784
+ description: G.value.length ? "没有符合条件的填写项" : "暂无填写项",
777
785
  image: b(C).PRESENTED_IMAGE_SIMPLE
778
- }, le({
779
- default: S(() => [R.value || z.value !== "all" ? (_(), u(b(ge), {
786
+ }, ue({
787
+ default: S(() => [R.value || z.value !== "all" ? (_(), u(b(_e), {
780
788
  key: 0,
781
789
  type: "link",
782
790
  size: "small",
783
- onClick: Ut
791
+ onClick: Jt
784
792
  }, {
785
- default: S(() => [...t[9] ||= [ue("清除筛选", -1)]]),
793
+ default: S(() => [...t[9] ||= [de("清除筛选", -1)]]),
786
794
  _: 1
787
795
  })) : d("", !0)]),
788
796
  _: 2
@@ -790,7 +798,7 @@ var Ee = {
790
798
  name: "description",
791
799
  fn: S(() => [t[8] ||= p("span", null, "没有符合条件的填写项", -1)]),
792
800
  key: "0"
793
- } : void 0]), 1032, ["description", "image"]))])])], 2)) : d("", !0)], 2)) : (_(), f("div", Ee, [m(b(C), {
801
+ } : void 0]), 1032, ["description", "image"]))])])], 2)) : d("", !0)], 2)) : (_(), f("div", De, [m(b(C), {
794
802
  description: "暂无可渲染的合同页面",
795
803
  image: b(C).PRESENTED_IMAGE_SIMPLE
796
804
  }, null, 8, ["image"])]))
@@ -798,4 +806,4 @@ var Ee = {
798
806
  }
799
807
  });
800
808
  //#endregion
801
- export { Ve as default };
809
+ export { Ue as default };