@guodun/antdv 1.4.3 → 1.4.4

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 (42) hide show
  1. package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +1 -1
  2. package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +66 -13
  3. package/dist/es/components/contract-signing-location/src/constants.mjs +27 -17
  4. package/dist/es/components/contract-signing-location/src/location-rules.mjs +2 -2
  5. package/dist/es/components/contract-signing-location/src/template-source.mjs +52 -36
  6. package/dist/es/components/contract-signing-location/style/index.css +1 -1
  7. package/dist/es/components/index.mjs +1 -1
  8. package/dist/es/components/pro-contract-template-designer/index.mjs +1 -1
  9. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +4 -4
  10. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +50 -50
  11. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +50 -50
  12. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +34 -34
  13. package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +17 -17
  14. package/dist/es/components/pro-contract-template-designer/src/utils/signing-placement.mjs +14 -14
  15. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +89 -89
  16. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  17. package/dist/es/index.mjs +25 -25
  18. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
  19. package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -1
  20. package/dist/lib/components/contract-signing-location/src/constants.cjs +1 -1
  21. package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -1
  22. package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
  23. package/dist/lib/components/contract-signing-location/style/index.css +1 -1
  24. package/dist/lib/components/index.cjs +1 -1
  25. package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
  26. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
  27. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  28. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  29. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +3 -3
  30. package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -1
  31. package/dist/lib/components/pro-contract-template-designer/src/utils/signing-placement.cjs +1 -1
  32. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +2 -2
  33. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  34. package/dist/lib/index.cjs +1 -1
  35. package/dist/theme/contract-signing-location.css +1 -1
  36. package/dist/theme/icon.css +1 -1
  37. package/dist/theme/index.css +1 -1
  38. package/dist/types/components/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +3 -1
  39. package/dist/types/components/contract-signing-location/src/constants.d.ts +18 -0
  40. package/dist/types/components/contract-signing-location/src/coordinates.d.ts +6 -0
  41. package/dist/types/components/contract-signing-location/src/template-source.d.ts +17 -0
  42. package/package.json +3 -1
@@ -1,5 +1,5 @@
1
- import { escapeHtmlAttribute as e, escapeHtmlText as t } from "./html.mjs";
2
- import { DEFAULT_CONTRACT_FONT_FAMILY as n } from "../constants.mjs";
1
+ import { DEFAULT_CONTRACT_FONT_FAMILY as e } from "../constants.mjs";
2
+ import { escapeHtmlAttribute as t, escapeHtmlText as n } from "./html.mjs";
3
3
  import { resolveTemplateVariablePresentation as r } from "./template-variable-render.mjs";
4
4
  //#region src/components/pro-contract-template-designer/src/utils/page-decorations.ts
5
5
  var i = {
@@ -31,7 +31,7 @@ var i = {
31
31
  right: ""
32
32
  },
33
33
  showOnFirstPage: !0,
34
- fontFamily: n,
34
+ fontFamily: e,
35
35
  fontSize: 12,
36
36
  fontWeight: 400,
37
37
  color: "#565b66",
@@ -51,7 +51,7 @@ var i = {
51
51
  right: ""
52
52
  },
53
53
  showOnFirstPage: !0,
54
- fontFamily: n,
54
+ fontFamily: e,
55
55
  fontSize: 12,
56
56
  fontWeight: 400,
57
57
  color: "#565b66",
@@ -291,26 +291,26 @@ function k(e, t, n) {
291
291
  };
292
292
  return r[n] = V(e?.text, t.text), r;
293
293
  }
294
- function A(t, n, r, i, a, o, s) {
295
- let c = w(n), l = n.divider.enabled ? `;border-${t === "header" ? "bottom" : "top"}:1px solid ${e(n.divider.color)}` : "", u = `color:${e(n.color)};font-family:${e(n.fontFamily)};font-size:${n.fontSize}px;font-weight:${n.fontWeight};${t === "header" ? "top" : "bottom"}:${n.offset}px${l}`, d = [
294
+ function A(e, n, r, i, a, o, s) {
295
+ let c = w(n), l = n.divider.enabled ? `;border-${e === "header" ? "bottom" : "top"}:1px solid ${t(n.divider.color)}` : "", u = `color:${t(n.color)};font-family:${t(n.fontFamily)};font-size:${n.fontSize}px;font-weight:${n.fontWeight};${e === "header" ? "top" : "bottom"}:${n.offset}px${l}`, d = [
296
296
  "left",
297
297
  "center",
298
298
  "right"
299
299
  ].map((e) => `<div class="gd-contract-template-page__decoration-slot is-${e}">${M(n.slots[e], r, i, a, o, s)}</div>`).join("");
300
- return `<div class="gd-contract-template-page__${t}" data-decoration-offset="${n.offset}" data-decoration-font-size="${n.fontSize}" data-decoration-safe-padding="${c}" style="${u}">${d}</div>`;
300
+ return `<div class="gd-contract-template-page__${e}" data-decoration-offset="${n.offset}" data-decoration-font-size="${n.fontSize}" data-decoration-safe-padding="${c}" style="${u}">${d}</div>`;
301
301
  }
302
- function j(t, n, r, i, a, o) {
303
- let s = C(t.density), c = t.layout === "tiled" ? s.columns * s.rows : 1, l = M(t.text, n, r, i, a, o), u = Array.from({ length: c }, () => `<div class="gd-contract-template-page__watermark-item" style="color:${e(t.color)};font-size:${t.fontSize}px;opacity:${t.opacity};transform:rotate(${t.rotation}deg)">${l}</div>`).join(""), d = t.layout === "tiled" ? `--gd-watermark-columns:${s.columns};--gd-watermark-rows:${s.rows}` : "";
304
- return `<div class="gd-contract-template-page__watermark is-${t.layout} density-${t.density}" data-watermark-layout="${t.layout}" data-watermark-density="${t.density}" aria-hidden="true" style="${d}">${u}</div>`;
302
+ function j(e, n, r, i, a, o) {
303
+ let s = C(e.density), c = e.layout === "tiled" ? s.columns * s.rows : 1, l = M(e.text, n, r, i, a, o), u = Array.from({ length: c }, () => `<div class="gd-contract-template-page__watermark-item" style="color:${t(e.color)};font-size:${e.fontSize}px;opacity:${e.opacity};transform:rotate(${e.rotation}deg)">${l}</div>`).join(""), d = e.layout === "tiled" ? `--gd-watermark-columns:${s.columns};--gd-watermark-rows:${s.rows}` : "";
304
+ return `<div class="gd-contract-template-page__watermark is-${e.layout} density-${e.density}" data-watermark-layout="${e.layout}" data-watermark-density="${e.density}" aria-hidden="true" style="${d}">${u}</div>`;
305
305
  }
306
- function M(n, r, i, a, o, s) {
306
+ function M(e, r, i, a, o, s) {
307
307
  let c = g(a, o, s), l = new Map(r.map((e) => [e.key, e]));
308
- return _(n).tokens.map((n) => {
309
- if (n.type === "text") return t(n.value);
310
- if (n.type === "pageNumber") return t(c.pageNumber);
311
- if (n.type === "totalPages") return t(c.totalPages);
312
- let r = l.get(n.key);
313
- return i !== void 0 && r && r.type !== "image" ? t(N(r, i[n.key])) : `<span class="gd-contract-template-page__variable" data-template-variable="true" data-key="${e(n.key)}" data-label="${e(r?.label ?? n.key)}" data-variable-type="${e(r?.type ?? "text")}">\${{${t(n.key)}}}</span>`;
308
+ return _(e).tokens.map((e) => {
309
+ if (e.type === "text") return n(e.value);
310
+ if (e.type === "pageNumber") return n(c.pageNumber);
311
+ if (e.type === "totalPages") return n(c.totalPages);
312
+ let r = l.get(e.key);
313
+ return i !== void 0 && r && r.type !== "image" ? n(N(r, i[e.key])) : `<span class="gd-contract-template-page__variable" data-template-variable="true" data-key="${t(e.key)}" data-label="${t(r?.label ?? e.key)}" data-variable-type="${t(r?.type ?? "text")}">\${{${n(e.key)}}}</span>`;
314
314
  }).join("");
315
315
  }
316
316
  function N(e, t) {
@@ -1,8 +1,8 @@
1
- import { resolveContractSigningSealSizeInCssPixels as e } from "../../../contract-signing-location/src/constants.mjs";
2
- import { hasPositivePageSize as t } from "./html.mjs";
1
+ import { hasPositivePageSize as e } from "./html.mjs";
2
+ import { resolveContractSigningSealSizeInCssPixels as t } from "../../../contract-signing-location/src/constants.mjs";
3
3
  //#region src/components/pro-contract-template-designer/src/utils/signing-placement.ts
4
4
  var n = "application/x-gd-contract-signing-placement", r = {
5
- seal: e(["04"]),
5
+ seal: t(["04"]),
6
6
  signature: {
7
7
  width: l(50),
8
8
  height: l(20)
@@ -80,21 +80,21 @@ function v(e, t, n = 8) {
80
80
  ...l ? { sealTypes: l } : {}
81
81
  };
82
82
  }
83
- function y(t, n, r) {
84
- let i = n.type ?? t.type, a = {
85
- ...t,
83
+ function y(e, n, r) {
84
+ let i = n.type ?? e.type, a = {
85
+ ...e,
86
86
  ...n,
87
87
  type: i,
88
88
  ...i === "seal" ? {} : { sealTypes: void 0 }
89
89
  };
90
90
  if (i === "seal" && (n.type !== void 0 || n.sealTypes !== void 0)) {
91
- let t = e(n.sealTypes ?? a.sealTypes ?? ["04"]);
92
- a.width = t.width, a.height = t.height;
91
+ let e = t(n.sealTypes ?? a.sealTypes ?? ["04"]);
92
+ a.width = e.width, a.height = e.height;
93
93
  }
94
94
  return v(a, r);
95
95
  }
96
- function b(t, n, r, i = {}) {
97
- let a = N(t) ? t : "signature", o = g(a), s = d(r), l = a === "seal" ? e(i.sealTypes ?? ["04"]) : o, f = u(i.width, l.width), p = u(i.height, l.height);
96
+ function b(e, n, r, i = {}) {
97
+ let a = N(e) ? e : "signature", o = g(a), s = d(r), l = a === "seal" ? t(i.sealTypes ?? ["04"]) : o, f = u(i.width, l.width), p = u(i.height, l.height);
98
98
  return v({
99
99
  id: i.id || c(),
100
100
  pageId: n,
@@ -260,10 +260,10 @@ function D(e, t, n) {
260
260
  location: t
261
261
  }));
262
262
  }
263
- function O(e, n, r, i) {
264
- if (!e) return i;
265
- let a = Array.isArray(e) ? e[r] : e[n];
266
- return t(a) ? d(a) : i;
263
+ function O(t, n, r, i) {
264
+ if (!t) return i;
265
+ let a = Array.isArray(t) ? t[r] : t[n];
266
+ return e(a) ? d(a) : i;
267
267
  }
268
268
  function k(e) {
269
269
  let t = new Set(e.map((e) => e && typeof e == "object" ? String(e.id || "") : "").filter(Boolean)), n = /* @__PURE__ */ new Set();
@@ -1,7 +1,7 @@
1
- import { isContractTemplateFieldType as e } from "../types.mjs";
2
- import { canParseHtmlDocument as t, canUseDomHtml as n, collectFromHtmlTags as r, escapeHtmlAttribute as i, escapeHtmlText as a, getHtmlAttribute as o, hasPositivePageSize as s, replaceTemplateVariableSpans as c } from "./html.mjs";
3
- import { resolveTemplateVariablePresentation as l } from "./template-variable-render.mjs";
4
- import { buildPageDecorationClassNames as u, buildPageDecorationsHtml as d, collectPageDecorationVariableKeys as f, normalizePageDecorations as p, validatePageDecorations as m } from "./page-decorations.mjs";
1
+ import { canParseHtmlDocument as e, canUseDomHtml as t, collectFromHtmlTags as n, escapeHtmlAttribute as r, escapeHtmlText as i, getHtmlAttribute as a, hasPositivePageSize as o, replaceTemplateVariableSpans as s } from "./html.mjs";
2
+ import { resolveTemplateVariablePresentation as c } from "./template-variable-render.mjs";
3
+ import { buildPageDecorationClassNames as l, buildPageDecorationsHtml as u, collectPageDecorationVariableKeys as d, normalizePageDecorations as f, validatePageDecorations as p } from "./page-decorations.mjs";
4
+ import { isContractTemplateFieldType as m } from "../types.mjs";
5
5
  import { CONTRACT_TEMPLATE_RESERVED_VARIABLE_KEYS as h, CONTRACT_TEMPLATE_VARIABLE_KEY_PATTERN as g, DEFAULT_PAGE_SIZE as _, resolvePageSize as v, validateContractTemplateVariableKey as y } from "../composables/use-template-designer.mjs";
6
6
  import { isSafeContractImageUrl as b } from "./image-url.mjs";
7
7
  //#region src/components/pro-contract-template-designer/src/utils/template-renderer.ts
@@ -79,93 +79,93 @@ function T(e, t) {
79
79
  function E(e, t, n) {
80
80
  return n ? T(e, t) : D(e);
81
81
  }
82
- function D(t) {
83
- if (!t) return [{
82
+ function D(e) {
83
+ if (!e) return [{
84
84
  type: "page",
85
85
  id: "template",
86
86
  message: "缺少可渲染的合同模板",
87
87
  code: "TEMPLATE_MISSING"
88
88
  }];
89
- let n = [], r = Array.isArray(t.pages) ? t.pages : [], i = Array.isArray(t.variables) ? t.variables : [];
90
- (!Array.isArray(t.pages) || r.length === 0) && n.push({
89
+ let t = [], n = Array.isArray(e.pages) ? e.pages : [], r = Array.isArray(e.variables) ? e.variables : [];
90
+ (!Array.isArray(e.pages) || n.length === 0) && t.push({
91
91
  type: "page",
92
92
  id: "template-pages",
93
93
  message: "模板至少需要一个合法页面",
94
94
  code: "TEMPLATE_PAGES_INVALID"
95
- }), Array.isArray(t.variables) || n.push({
95
+ }), Array.isArray(e.variables) || t.push({
96
96
  type: "variable",
97
97
  id: "template-variables",
98
98
  message: "模板变量列表格式无效",
99
99
  code: "TEMPLATE_VARIABLES_INVALID"
100
- }), s(t.pageSize) || n.push({
100
+ }), o(e.pageSize) || t.push({
101
101
  type: "page",
102
102
  id: "template-page-size",
103
103
  message: "模板默认页面尺寸无效,已回退为安全默认尺寸",
104
104
  code: "TEMPLATE_PAGE_SIZE_INVALID"
105
105
  });
106
- let a = /* @__PURE__ */ new Map();
107
- i.forEach((t, r) => {
108
- if (!t || typeof t.key != "string" || !t.key.trim()) {
109
- n.push({
106
+ let i = /* @__PURE__ */ new Map();
107
+ r.forEach((e, n) => {
108
+ if (!e || typeof e.key != "string" || !e.key.trim()) {
109
+ t.push({
110
110
  type: "variable",
111
- id: t?.id || `variable-${r}`,
112
- message: `第 ${r + 1} 个变量缺少有效 key`,
111
+ id: e?.id || `variable-${n}`,
112
+ message: `第 ${n + 1} 个变量缺少有效 key`,
113
113
  code: "VARIABLE_KEY_MISSING"
114
114
  });
115
115
  return;
116
116
  }
117
- let o = t.key.trim(), s = i.some((e) => e?.id !== t.id && typeof e?.key == "string" && e.key.trim() === o), c = y(t.key, i, t.id), l = !g.test(o) || h.has(o);
118
- c && (l || !s || t.key !== o) && n.push({
117
+ let a = e.key.trim(), o = r.some((t) => t?.id !== e.id && typeof t?.key == "string" && t.key.trim() === a), s = y(e.key, r, e.id), c = !g.test(a) || h.has(a);
118
+ s && (c || !o || e.key !== a) && t.push({
119
119
  type: "variable",
120
- id: t.id || `variable-${r}`,
121
- variableKey: t.key,
122
- message: `${t.label || t.key}:${c}`,
120
+ id: e.id || `variable-${n}`,
121
+ variableKey: e.key,
122
+ message: `${e.label || e.key}:${s}`,
123
123
  code: "VARIABLE_KEY_INVALID"
124
- }), a.set(o, (a.get(o) ?? 0) + 1), e(t.type ?? "text") || n.push({
124
+ }), i.set(a, (i.get(a) ?? 0) + 1), m(e.type ?? "text") || t.push({
125
125
  type: "variable",
126
- id: t.id,
127
- variableKey: t.key,
128
- message: `${t.label || t.key} 不是正文填写变量`,
126
+ id: e.id,
127
+ variableKey: e.key,
128
+ message: `${e.label || e.key} 不是正文填写变量`,
129
129
  code: "VARIABLE_TYPE_UNSUPPORTED"
130
130
  });
131
- }), a.forEach((e, t) => {
132
- e > 1 && n.push({
131
+ }), i.forEach((e, n) => {
132
+ e > 1 && t.push({
133
133
  type: "variable",
134
- id: t,
135
- variableKey: t,
136
- message: `变量 key ${t} 重复`,
134
+ id: n,
135
+ variableKey: n,
136
+ message: `变量 key ${n} 重复`,
137
137
  code: "VARIABLE_KEY_DUPLICATED"
138
138
  });
139
139
  });
140
- let o = /* @__PURE__ */ new Set();
141
- r.forEach((e, t) => {
140
+ let a = /* @__PURE__ */ new Set();
141
+ n.forEach((e, n) => {
142
142
  if (!e || typeof e.id != "string" || !e.id.trim() || typeof e.contentHtml != "string") {
143
- n.push({
143
+ t.push({
144
144
  type: "page",
145
- id: e?.id || `page-${t}`,
145
+ id: e?.id || `page-${n}`,
146
146
  pageId: e?.id,
147
- message: `第 ${t + 1} 页结构无效,已跳过渲染`,
147
+ message: `第 ${n + 1} 页结构无效,已跳过渲染`,
148
148
  code: "PAGE_INVALID"
149
149
  });
150
150
  return;
151
151
  }
152
- e.pageSize !== void 0 && !s(e.pageSize) && n.push({
152
+ e.pageSize !== void 0 && !o(e.pageSize) && t.push({
153
153
  type: "page",
154
154
  id: `${e.id}-page-size`,
155
155
  pageId: e.id,
156
- message: `${e.title || `第 ${t + 1} 页`}:页面尺寸无效,已回退为安全尺寸`,
156
+ message: `${e.title || `第 ${n + 1} 页`}:页面尺寸无效,已回退为安全尺寸`,
157
157
  code: "PAGE_SIZE_INVALID"
158
- }), V(e.contentHtml).forEach((e) => o.add(e)), H(e.contentHtml).forEach((r, i) => {
159
- n.push({
158
+ }), V(e.contentHtml).forEach((e) => a.add(e)), H(e.contentHtml).forEach((r, i) => {
159
+ t.push({
160
160
  type: "security",
161
161
  id: `${e.id}-security-${i}`,
162
162
  pageId: e.id,
163
- message: `${e.title || `第 ${t + 1} 页`}:${r}`,
163
+ message: `${e.title || `第 ${n + 1} 页`}:${r}`,
164
164
  code: "HTML_UNSAFE"
165
165
  });
166
166
  });
167
- }), o.forEach((e) => {
168
- a.has(e) || n.push({
167
+ }), a.forEach((e) => {
168
+ i.has(e) || t.push({
169
169
  type: "variable",
170
170
  id: e,
171
171
  variableKey: e,
@@ -173,20 +173,20 @@ function D(t) {
173
173
  code: "VARIABLE_CONFIG_MISSING"
174
174
  });
175
175
  });
176
- let c = f(t.pageDecorations);
177
- return a.forEach((e, t) => {
178
- !o.has(t) && !c.has(t) && n.push({
176
+ let s = d(e.pageDecorations);
177
+ return i.forEach((e, n) => {
178
+ !a.has(n) && !s.has(n) && t.push({
179
179
  type: "variable",
180
- id: t,
181
- variableKey: t,
182
- message: `变量 ${t} 缺少正文节点`,
180
+ id: n,
181
+ variableKey: n,
182
+ message: `变量 ${n} 缺少正文节点`,
183
183
  code: "VARIABLE_NODE_MISSING"
184
184
  });
185
- }), n.push(...m(t.pageDecorations, i)), n;
185
+ }), t.push(...p(e.pageDecorations, r)), t;
186
186
  }
187
187
  function O(e, t, n = {}) {
188
188
  if (!e || !Array.isArray(e.pages)) return [];
189
- let r = Array.isArray(e.variables) ? e.variables : [], i = new Map(r.filter((e) => e?.key).map((e) => [e.key, e])), a = s(e.pageSize) ? e.pageSize : _;
189
+ let r = Array.isArray(e.variables) ? e.variables : [], i = new Map(r.filter((e) => e?.key).map((e) => [e.key, e])), a = o(e.pageSize) ? e.pageSize : _;
190
190
  return e.pages.flatMap((o) => {
191
191
  if (!o || typeof o.id != "string" || !o.id.trim() || typeof o.contentHtml != "string") return [];
192
192
  let s = v(o.pageSize, a);
@@ -197,7 +197,7 @@ function O(e, t, n = {}) {
197
197
  width: s.width,
198
198
  height: s.height,
199
199
  contentHtml: j(o.contentHtml, i, t, n),
200
- ...e.pageDecorations ? { pageDecorations: p(e.pageDecorations) } : {},
200
+ ...e.pageDecorations ? { pageDecorations: f(e.pageDecorations) } : {},
201
201
  decorationVariables: r,
202
202
  decorationValues: t
203
203
  }];
@@ -205,25 +205,25 @@ function O(e, t, n = {}) {
205
205
  }
206
206
  function k(e, t, n = {}) {
207
207
  return O(e, t, n).map((e, t, n) => {
208
- let r = d(e.pageDecorations, t + 1, n.length, e.decorationVariables, e.decorationValues);
209
- return `<section class="${u(e.pageDecorations, t + 1)}" data-page-id="${i(e.id)}" data-page-format="${i(e.format)}" data-page-width="${e.width}" data-page-height="${e.height}" style="width:${e.width}px;min-height:${e.height}px">${r}<div class="gd-contract-template-page__content">${e.contentHtml}</div></section>`;
208
+ let i = u(e.pageDecorations, t + 1, n.length, e.decorationVariables, e.decorationValues);
209
+ return `<section class="${l(e.pageDecorations, t + 1)}" data-page-id="${r(e.id)}" data-page-format="${r(e.format)}" data-page-width="${e.width}" data-page-height="${e.height}" style="width:${e.width}px;min-height:${e.height}px">${i}<div class="gd-contract-template-page__content">${e.contentHtml}</div></section>`;
210
210
  }).join("\n");
211
211
  }
212
212
  function A(e) {
213
213
  return e == null || e === "";
214
214
  }
215
- function j(e, t, r, i) {
215
+ function j(e, n, r, i) {
216
216
  if (!e) return e;
217
- let a = B(e);
218
- if (n()) {
219
- let e = new DOMParser().parseFromString(a, "text/html");
217
+ let o = B(e);
218
+ if (t()) {
219
+ let e = new DOMParser().parseFromString(o, "text/html");
220
220
  return e.querySelectorAll("[data-template-variable]").forEach((e) => {
221
- M(e, t, r, i);
221
+ M(e, n, r, i);
222
222
  }), e.body.innerHTML;
223
223
  }
224
- return c(a, (e, n) => {
225
- let a = o(n, "data-key");
226
- return a ? N(t.get(a), a, r[a], i) : e;
224
+ return s(o, (e, t) => {
225
+ let o = a(t, "data-key");
226
+ return o ? N(n.get(o), o, r[o], i) : e;
227
227
  });
228
228
  }
229
229
  function M(e, t, n, r) {
@@ -235,8 +235,8 @@ function M(e, t, n, r) {
235
235
  function N(e, t, n, r) {
236
236
  return r.mode === "display" ? P(e, t, n, r) : F(e, t, n, r);
237
237
  }
238
- function P(e, t, n, r) {
239
- let o = e?.type ?? "text", s = n ?? I(e), c = o === "image" && !A(s) && !b(String(s)) ? "" : s, u = R(c), d = l({
238
+ function P(e, t, n, a) {
239
+ let o = e?.type ?? "text", s = n ?? I(e), l = o === "image" && !A(s) && !b(String(s)) ? "" : s, u = R(l), d = c({
240
240
  type: o,
241
241
  width: e?.width,
242
242
  height: e?.height,
@@ -252,31 +252,31 @@ function P(e, t, n, r) {
252
252
  lineHeight: e?.lineHeight,
253
253
  style: e?.style
254
254
  }), f = d.displayText || e?.placeholder || e?.label || t, p = [
255
- `class="${i([
255
+ `class="${r([
256
256
  "gd-contract-template-renderer__control",
257
257
  "gd-contract-template-renderer__preview-control",
258
258
  ...d.classes,
259
- r.activeKey === t ? "is-active" : "",
260
- A(c) ? "is-empty" : ""
259
+ a.activeKey === t ? "is-active" : "",
260
+ A(l) ? "is-empty" : ""
261
261
  ].filter(Boolean).join(" "))}"`,
262
- `style="${i(d.styleText)}"`,
262
+ `style="${r(d.styleText)}"`,
263
263
  "data-contract-render-wrapper=\"true\"",
264
264
  "data-contract-render-preview=\"true\"",
265
- `data-key="${i(t)}"`,
266
- `data-variable-type="${i(o)}"`,
267
- `aria-label="${i(e?.label || t)}"`,
268
- r.disabled ? "" : "role=\"button\"",
269
- r.disabled ? "" : "tabindex=\"0\""
265
+ `data-key="${r(t)}"`,
266
+ `data-variable-type="${r(o)}"`,
267
+ `aria-label="${r(e?.label || t)}"`,
268
+ a.disabled ? "" : "role=\"button\"",
269
+ a.disabled ? "" : "tabindex=\"0\""
270
270
  ].filter(Boolean).join(" ");
271
- return o === "checkbox" ? `<span ${p}><span class="gd-contract-template-renderer__checkbox-mark" aria-hidden="true">${z(c) ? "✓" : ""}</span>${a(f)}</span>` : o === "image" && !A(c) ? `<span ${p}></span>` : `<span ${p}>${a(f)}</span>`;
271
+ return o === "checkbox" ? `<span ${p}><span class="gd-contract-template-renderer__checkbox-mark" aria-hidden="true">${z(l) ? "✓" : ""}</span>${i(f)}</span>` : o === "image" && !A(l) ? `<span ${p}></span>` : `<span ${p}>${i(f)}</span>`;
272
272
  }
273
- function F(e, t, n, r) {
274
- let o = e?.type ?? "text", s = !!r.readonly, c = L(n ?? I(e)), u = l({
273
+ function F(e, t, n, a) {
274
+ let o = e?.type ?? "text", s = !!a.readonly, l = L(n ?? I(e)), u = c({
275
275
  type: o,
276
276
  width: e?.width,
277
277
  height: e?.height,
278
278
  placeholder: e?.placeholder ?? "",
279
- defaultValue: s ? c : "",
279
+ defaultValue: s ? l : "",
280
280
  format: e?.format ?? "",
281
281
  precision: e?.precision,
282
282
  useGrouping: e?.useGrouping,
@@ -286,15 +286,15 @@ function F(e, t, n, r) {
286
286
  rows: e?.rows,
287
287
  lineHeight: e?.lineHeight,
288
288
  style: e?.style
289
- }), d = r.disabled || s, f = [
289
+ }), d = a.disabled || s, f = [
290
290
  "data-contract-render-control=\"true\"",
291
- `data-key="${i(t)}"`,
292
- `data-variable-type="${i(o)}"`,
293
- `aria-label="${i(e?.label || t)}"`,
291
+ `data-key="${r(t)}"`,
292
+ `data-variable-type="${r(o)}"`,
293
+ `aria-label="${r(e?.label || t)}"`,
294
294
  d ? "disabled" : "",
295
295
  s ? "readonly" : ""
296
- ].filter(Boolean).join(" "), p = `style="${i(u.styleText)}"`, m = i(["gd-contract-template-renderer__control", ...u.classes].join(" "));
297
- return o === "checkbox" ? `<label class="${m}" ${p} data-contract-render-wrapper="true" data-key="${i(t)}"><input type="checkbox" ${f} ${z(c) ? "checked" : ""}>${a(e?.checkedText || e?.label || t)}</label>` : s ? `<span class="${m}" ${p} data-contract-render-wrapper="true" data-key="${i(t)}">${a(u.displayText || c)}</span>` : o === "number" ? `<input class="${m}" ${p} type="number" ${f} value="${i(c)}" placeholder="${i(e?.placeholder || "")}">` : o === "date" ? `<input class="${m}" ${p} type="date" ${f} value="${i(c)}" placeholder="${i(e?.placeholder || "")}">` : e?.multiline ? `<textarea class="${m}" ${p} ${f} placeholder="${i(e.placeholder || "")}">${a(c)}</textarea>` : `<input class="${m}" ${p} type="text" ${f} value="${i(c)}" placeholder="${i(e?.placeholder || "")}">`;
296
+ ].filter(Boolean).join(" "), p = `style="${r(u.styleText)}"`, m = r(["gd-contract-template-renderer__control", ...u.classes].join(" "));
297
+ return o === "checkbox" ? `<label class="${m}" ${p} data-contract-render-wrapper="true" data-key="${r(t)}"><input type="checkbox" ${f} ${z(l) ? "checked" : ""}>${i(e?.checkedText || e?.label || t)}</label>` : s ? `<span class="${m}" ${p} data-contract-render-wrapper="true" data-key="${r(t)}">${i(u.displayText || l)}</span>` : o === "number" ? `<input class="${m}" ${p} type="number" ${f} value="${r(l)}" placeholder="${r(e?.placeholder || "")}">` : o === "date" ? `<input class="${m}" ${p} type="date" ${f} value="${r(l)}" placeholder="${r(e?.placeholder || "")}">` : e?.multiline ? `<textarea class="${m}" ${p} ${f} placeholder="${r(e.placeholder || "")}">${i(l)}</textarea>` : `<input class="${m}" ${p} type="text" ${f} value="${r(l)}" placeholder="${r(e?.placeholder || "")}">`;
298
298
  }
299
299
  function I(e) {
300
300
  if (!e) return "";
@@ -314,23 +314,23 @@ function R(e) {
314
314
  function z(e) {
315
315
  return e === !0 || e === "true" || e === "1" || e === "yes" || e === "是" || e === "已选";
316
316
  }
317
- function B(e) {
318
- if (t()) {
319
- let t = new DOMParser().parseFromString(e, "text/html");
320
- return t.querySelectorAll("script,style,meta,link,iframe,object,embed").forEach((e) => e.remove()), t.querySelectorAll("*").forEach((e) => {
317
+ function B(t) {
318
+ if (e()) {
319
+ let e = new DOMParser().parseFromString(t, "text/html");
320
+ return e.querySelectorAll("script,style,meta,link,iframe,object,embed").forEach((e) => e.remove()), e.querySelectorAll("*").forEach((e) => {
321
321
  Array.from(e.attributes).forEach((t) => {
322
322
  let n = t.name.toLowerCase();
323
323
  (n.startsWith("on") || n === "srcdoc" || x.has(n) && U(t.value) || n === "style" && G(t.value)) && e.removeAttribute(t.name);
324
324
  });
325
- }), t.body.innerHTML;
325
+ }), e.body.innerHTML;
326
326
  }
327
- return e.replace(/<\s*(script|style|iframe|object|embed)\b[^>]*>[\s\S]*?<\s*\/\s*\1\s*>/gi, "").replace(/<\s*\/?\s*(?:script|style|meta|link|iframe|object|embed)\b[^>]*>/gi, "").replace(/\s+on[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/\s+srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/\s+(action|formaction|href|src|xlink:href)\s*=\s*(?:(["'])(.*?)\2|([^\s>]+))/gi, (e, t, n, r, i) => {
327
+ return t.replace(/<\s*(script|style|iframe|object|embed)\b[^>]*>[\s\S]*?<\s*\/\s*\1\s*>/gi, "").replace(/<\s*\/?\s*(?:script|style|meta|link|iframe|object|embed)\b[^>]*>/gi, "").replace(/\s+on[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/\s+srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/\s+(action|formaction|href|src|xlink:href)\s*=\s*(?:(["'])(.*?)\2|([^\s>]+))/gi, (e, t, n, r, i) => {
328
328
  let a = r ?? i ?? "";
329
329
  return U(a) ? "" : n ? ` ${t}=${n}${a}${n}` : ` ${t}=${a}`;
330
330
  }).replace(/\s+style\s*=\s*(["'])(.*?)\1/gi, (e, t, n) => G(n) ? "" : ` style=${t}${n}${t}`);
331
331
  }
332
332
  function V(e) {
333
- return r(e, S, (e) => o(e, "data-key"));
333
+ return n(e, S, (e) => a(e, "data-key"));
334
334
  }
335
335
  function H(e) {
336
336
  let t = [];