@guodun/antdv 1.7.12 → 1.7.14

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 (67) hide show
  1. package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +373 -295
  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 +1025 -964
  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/SigningLayoutCustomModal.vue.mjs +72 -59
  14. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +133 -132
  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 +95 -71
  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/signing-layout-presets.mjs +77 -61
  19. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +96 -83
  20. package/dist/es/components/pro-contract-template-designer/src/utils/template-variable-render.mjs +23 -15
  21. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  22. package/dist/es/contract-print-css/index.mjs +134 -30
  23. package/dist/es/contract-print.mjs +2 -0
  24. package/dist/es/index.mjs +21 -20
  25. package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
  26. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
  27. package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -1
  28. package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
  29. package/dist/lib/components/index.cjs +1 -1
  30. package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
  31. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
  32. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.cjs +1 -1
  33. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.cjs +1 -1
  34. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  35. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  36. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
  37. package/dist/lib/components/pro-contract-template-designer/src/SigningLayoutCustomModal.vue.cjs +1 -1
  38. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
  39. package/dist/lib/components/pro-contract-template-designer/src/utils/contract-layout-check.cjs +1 -0
  40. package/dist/lib/components/pro-contract-template-designer/src/utils/contract-print-document.cjs +50 -28
  41. package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -1
  42. package/dist/lib/components/pro-contract-template-designer/src/utils/signing-layout-presets.cjs +1 -1
  43. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +5 -5
  44. package/dist/lib/components/pro-contract-template-designer/src/utils/template-variable-render.cjs +1 -1
  45. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  46. package/dist/lib/contract-print-css/index.cjs +74 -23
  47. package/dist/lib/contract-print.cjs +1 -0
  48. package/dist/lib/index.cjs +1 -1
  49. package/dist/theme/icon.css +1 -1
  50. package/dist/theme/index.css +1 -1
  51. package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +9 -0
  52. package/dist/types/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.d.ts +7 -0
  53. package/dist/types/components/contract-signing-location/src/template-source.d.ts +6 -0
  54. package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
  55. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateSingleRenderer.vue.d.ts +2 -0
  56. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +5 -1
  57. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +7 -2
  58. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +2 -2
  59. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +36 -0
  60. package/dist/types/components/pro-contract-template-designer/src/utils/contract-layout-check.d.ts +104 -0
  61. package/dist/types/components/pro-contract-template-designer/src/utils/contract-print-document.d.ts +4 -1
  62. package/dist/types/components/pro-contract-template-designer/src/utils/page-decorations.d.ts +2 -8
  63. package/dist/types/components/pro-contract-template-designer/src/utils/signing-layout-presets.d.ts +9 -0
  64. package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +6 -1
  65. package/dist/types/contract-print-css/index.d.ts +70 -0
  66. package/dist/types/contract-print.d.ts +2 -0
  67. package/package.json +14 -2
@@ -1,13 +1,8 @@
1
- import { DEFAULT_CONTRACT_FONT_FAMILY as e } from "../constants.mjs";
2
- import { escapeHtmlAttribute as t, escapeHtmlText as n } from "./html.mjs";
3
- import { resolveTemplateVariablePresentation as r } from "./template-variable-render.mjs";
4
- //#region src/components/pro-contract-template-designer/src/utils/page-decorations.ts
5
- var i = {
6
- top: 54,
7
- right: 64,
8
- bottom: 54,
9
- left: 64
10
- }, a = {
1
+ import { isContractPageDecorationVisible as e, resolveContractDecorationSafePadding as t } from "../../../../contract-print-css/index.mjs";
2
+ import { DEFAULT_CONTRACT_FONT_FAMILY as n } from "../constants.mjs";
3
+ import { escapeHtmlAttribute as r, escapeHtmlText as i } from "./html.mjs";
4
+ import { resolveTemplateVariablePresentation as a } from "./template-variable-render.mjs";
5
+ var o = {
11
6
  sparse: {
12
7
  columns: 2,
13
8
  rows: 3
@@ -20,7 +15,7 @@ var i = {
20
15
  columns: 4,
21
16
  rows: 6
22
17
  }
23
- }, o = {
18
+ }, s = {
24
19
  header: {
25
20
  enabled: !1,
26
21
  text: "",
@@ -31,7 +26,7 @@ var i = {
31
26
  right: ""
32
27
  },
33
28
  showOnFirstPage: !0,
34
- fontFamily: e,
29
+ fontFamily: n,
35
30
  fontSize: 12,
36
31
  fontWeight: 400,
37
32
  color: "#565b66",
@@ -51,7 +46,7 @@ var i = {
51
46
  right: ""
52
47
  },
53
48
  showOnFirstPage: !0,
54
- fontFamily: e,
49
+ fontFamily: n,
55
50
  fontSize: 12,
56
51
  fontWeight: 400,
57
52
  color: "#565b66",
@@ -73,17 +68,17 @@ var i = {
73
68
  density: "normal"
74
69
  },
75
70
  pageNumbering: { countFirstPage: !0 }
76
- }, s = /^#[\da-f]{6}$/i, c = /^[A-Za-z][A-Za-z0-9_]{1,63}$/, l = /\$\{\{[\s\S]*?\}\}|\$\{\{|\$\{[^{}]*\}|\{[A-Za-z][A-Za-z0-9]*\}/g;
77
- function u(e) {
71
+ }, c = /^#[\da-f]{6}$/i, l = /^[A-Za-z][A-Za-z0-9_]{1,63}$/, u = /\$\{\{[\s\S]*?\}\}|\$\{\{|\$\{[^{}]*\}|\{[A-Za-z][A-Za-z0-9]*\}/g;
72
+ function d(e) {
78
73
  return {
79
- header: D(e?.header, o.header),
80
- footer: D(e?.footer, o.footer),
74
+ header: D(e?.header, s.header),
75
+ footer: D(e?.footer, s.footer),
81
76
  watermark: O(e?.watermark),
82
77
  pageNumbering: { countFirstPage: e?.pageNumbering?.countFirstPage !== !1 }
83
78
  };
84
79
  }
85
- function d(e) {
86
- let t = u();
80
+ function f(e) {
81
+ let t = d();
87
82
  return e === "none" ? t : (t.footer = D({
88
83
  ...t.footer,
89
84
  enabled: !0,
@@ -92,7 +87,7 @@ function d(e) {
92
87
  center: "第 {pageNumber} / {totalPages} 页",
93
88
  right: ""
94
89
  }
95
- }, o.footer), (e === "internal-review" || e === "draft") && (t.watermark = O({
90
+ }, s.footer), (e === "internal-review" || e === "draft") && (t.watermark = O({
96
91
  ...t.watermark,
97
92
  enabled: !0,
98
93
  text: e === "internal-review" ? "内部审阅" : "草稿",
@@ -100,38 +95,38 @@ function d(e) {
100
95
  density: "normal"
101
96
  })), t);
102
97
  }
103
- function f(e) {
104
- let t = JSON.stringify(u(e));
98
+ function p(e) {
99
+ let t = JSON.stringify(d(e));
105
100
  return [
106
101
  "none",
107
102
  "page-number",
108
103
  "internal-review",
109
104
  "draft"
110
- ].find((e) => JSON.stringify(d(e)) === t) ?? "custom";
111
- }
112
- function p(e, t = 1) {
113
- let n = u(e).header;
114
- return I(n, t);
105
+ ].find((e) => JSON.stringify(f(e)) === t) ?? "custom";
115
106
  }
116
107
  function m(e, t = 1) {
117
- let n = u(e).footer;
108
+ let n = d(e).header;
118
109
  return I(n, t);
119
110
  }
120
111
  function h(e, t = 1) {
121
- let n = u(e).watermark;
112
+ let n = d(e).footer;
113
+ return I(n, t);
114
+ }
115
+ function g(e, t = 1) {
116
+ let n = d(e).watermark;
122
117
  return n.enabled && !!n.text.trim() && (t !== 1 || n.showOnFirstPage);
123
118
  }
124
- function g(e, t, n = !0) {
119
+ function _(e, t, n = !0) {
125
120
  let r = Math.max(1, Math.floor(e || 1)), i = Math.max(0, Math.floor(t || 0));
126
121
  return {
127
122
  pageNumber: n ? String(r) : r === 1 ? "" : String(r - 1),
128
123
  totalPages: String(n ? i : Math.max(0, i - 1))
129
124
  };
130
125
  }
131
- function _(e, t = [], n = !1) {
126
+ function v(e, t = [], n = !1) {
132
127
  let r = [], i = [], a = new Map(t.map((e) => [e.key, e])), o = 0;
133
- l.lastIndex = 0;
134
- let s = l.exec(e);
128
+ u.lastIndex = 0;
129
+ let s = u.exec(e);
135
130
  for (; s;) {
136
131
  s.index > o && r.push({
137
132
  type: "text",
@@ -142,7 +137,7 @@ function _(e, t = [], n = !1) {
142
137
  else if (t === "{totalPages}") r.push({ type: "totalPages" });
143
138
  else if (t.startsWith("${{") && t.endsWith("}}")) {
144
139
  let e = t.slice(3, -2), o = e.trim();
145
- if (e !== o || !c.test(o)) i.push({
140
+ if (e !== o || !l.test(o)) i.push({
146
141
  code: "DECORATION_TOKEN_MALFORMED",
147
142
  message: `页面装饰变量令牌 ${t} 格式错误`,
148
143
  token: t,
@@ -178,7 +173,7 @@ function _(e, t = [], n = !1) {
178
173
  type: "text",
179
174
  value: t
180
175
  });
181
- o = s.index + t.length, s = l.exec(e);
176
+ o = s.index + t.length, s = u.exec(e);
182
177
  }
183
178
  return o < e.length && r.push({
184
179
  type: "text",
@@ -188,18 +183,18 @@ function _(e, t = [], n = !1) {
188
183
  issues: i
189
184
  };
190
185
  }
191
- function v(e) {
192
- let t = u(e), n = /* @__PURE__ */ new Set();
186
+ function y(e) {
187
+ let t = d(e), n = /* @__PURE__ */ new Set();
193
188
  return P(t, (e) => {
194
- _(e).tokens.forEach((e) => {
189
+ v(e).tokens.forEach((e) => {
195
190
  e.type === "variable" && n.add(e.key);
196
191
  }), R(e).forEach((e) => n.add(e.key));
197
192
  }), n;
198
193
  }
199
- function y(e, t) {
200
- let n = u(e), r = [];
194
+ function b(e, t) {
195
+ let n = d(e), r = [];
201
196
  return P(n, (e, n) => {
202
- _(e, t, !0).issues.forEach((e, t) => {
197
+ v(e, t, !0).issues.forEach((e, t) => {
203
198
  r.push({
204
199
  type: "variable",
205
200
  id: `${n}-${e.offset}-${t}`,
@@ -210,40 +205,36 @@ function y(e, t) {
210
205
  });
211
206
  }), r;
212
207
  }
213
- function b(e) {
208
+ function x(e) {
214
209
  if (!e.code?.startsWith("DECORATION_")) return;
215
210
  let t = e.id.replace(/-\d+-\d+$/, "");
216
211
  if (/^(?:header|footer)\.slots\.(?:left|center|right)$/.test(t) || t === "watermark.text") return t;
217
212
  }
218
- function x(e, t, n) {
219
- let r = u(e), i = (e) => z(e, t, n);
220
- return r.header.slots = L(r.header.slots, i), r.footer.slots = L(r.footer.slots, i), r.watermark.text = i(r.watermark.text), r.header = D(r.header, o.header), r.footer = D(r.footer, o.footer), r;
213
+ function S(e, t, n) {
214
+ let r = d(e), i = (e) => z(e, t, n);
215
+ return r.header.slots = L(r.header.slots, i), r.footer.slots = L(r.footer.slots, i), r.watermark.text = i(r.watermark.text), r.header = D(r.header, s.header), r.footer = D(r.footer, s.footer), r;
221
216
  }
222
- function S(e, t, n, r, i, a) {
217
+ function C(e, t, n, r, i, a) {
223
218
  if (e.type === "text") return e.value;
224
- let o = g(r, i, a);
219
+ let o = _(r, i, a);
225
220
  if (e.type === "pageNumber") return o.pageNumber;
226
221
  if (e.type === "totalPages") return o.totalPages;
227
222
  let s = t.find((t) => t.key === e.key);
228
223
  return !s || s.type === "image" ? e.raw : N(s, n?.[e.key]);
229
224
  }
230
- function C(e) {
231
- return a[e] ?? a.normal;
232
- }
233
225
  function w(e) {
234
- let t = D(e, o.header);
235
- return Math.max(80, t.offset + Math.ceil(t.fontSize * 1.5) + 20);
226
+ return o[e] ?? o.normal;
236
227
  }
237
228
  function T(e, t = 1) {
238
229
  return [
239
230
  "gd-contract-template-page",
240
- p(e, t) ? "has-contract-header" : "",
241
- m(e, t) ? "has-contract-footer" : ""
231
+ m(e, t) ? "has-contract-header" : "",
232
+ h(e, t) ? "has-contract-footer" : ""
242
233
  ].filter(Boolean).join(" ");
243
234
  }
244
235
  function E(e, t, n, r = [], i) {
245
- let a = u(e), o = [];
246
- return h(a, t) && o.push(j(a.watermark, r, i, t, n, a.pageNumbering.countFirstPage)), p(a, t) && o.push(A("header", a.header, r, i, t, n, a.pageNumbering.countFirstPage)), m(a, t) && o.push(A("footer", a.footer, r, i, t, n, a.pageNumbering.countFirstPage)), o.join("");
236
+ let a = d(e), o = [];
237
+ return g(a, t) && o.push(j(a.watermark, r, i, t, n, a.pageNumbering.countFirstPage)), m(a, t) && o.push(A("header", a.header, r, i, t, n, a.pageNumbering.countFirstPage)), h(a, t) && o.push(A("footer", a.footer, r, i, t, n, a.pageNumbering.countFirstPage)), o.join("");
247
238
  }
248
239
  function D(e, t) {
249
240
  let n = B(e?.textAlign, t.textAlign), r = k(e, t, n), i = r[n].trim() ? n : r.center.trim() ? "center" : r.left.trim() ? "left" : r.right.trim() ? "right" : n;
@@ -265,7 +256,7 @@ function D(e, t) {
265
256
  };
266
257
  }
267
258
  function O(e) {
268
- let t = o.watermark;
259
+ let t = s.watermark;
269
260
  return {
270
261
  enabled: !!e?.enabled,
271
262
  text: V(e?.text, t.text),
@@ -291,31 +282,31 @@ function k(e, t, n) {
291
282
  };
292
283
  return r[n] = V(e?.text, t.text), r;
293
284
  }
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 = [
285
+ function A(e, n, i, a, o, s, c) {
286
+ let l = t(n), u = n.divider.enabled ? `;border-${e === "header" ? "bottom" : "top"}:1px solid ${r(n.divider.color)}` : "", d = `color:${r(n.color)};font-family:${r(n.fontFamily)};font-size:${n.fontSize}px;font-weight:${n.fontWeight};${e === "header" ? "top" : "bottom"}:${n.offset}px${u}`, f = [
296
287
  "left",
297
288
  "center",
298
289
  "right"
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__${e}" data-decoration-offset="${n.offset}" data-decoration-font-size="${n.fontSize}" data-decoration-safe-padding="${c}" style="${u}">${d}</div>`;
290
+ ].map((e) => `<div class="gd-contract-template-page__decoration-slot is-${e}">${M(n.slots[e], i, a, o, s, c)}</div>`).join("");
291
+ return `<div class="gd-contract-template-page__${e}" data-decoration-offset="${n.offset}" data-decoration-font-size="${n.fontSize}" data-decoration-safe-padding="${l}" style="${d}">${f}</div>`;
301
292
  }
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}` : "";
293
+ function j(e, t, n, i, a, o) {
294
+ let s = w(e.density), c = e.layout === "tiled" ? s.columns * s.rows : 1, l = M(e.text, t, n, i, a, o), u = Array.from({ length: c }, () => `<div class="gd-contract-template-page__watermark-item" style="color:${r(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
295
  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
296
  }
306
- function M(e, r, i, a, o, s) {
307
- let c = g(a, o, s), l = new Map(r.map((e) => [e.key, e]));
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>`;
297
+ function M(e, t, n, a, o, s) {
298
+ let c = _(a, o, s), l = new Map(t.map((e) => [e.key, e]));
299
+ return v(e).tokens.map((e) => {
300
+ if (e.type === "text") return i(e.value);
301
+ if (e.type === "pageNumber") return i(c.pageNumber);
302
+ if (e.type === "totalPages") return i(c.totalPages);
303
+ let t = l.get(e.key);
304
+ return n !== void 0 && t && t.type !== "image" ? i(N(t, n[e.key])) : `<span class="gd-contract-template-page__variable" data-template-variable="true" data-key="${r(e.key)}" data-label="${r(t?.label ?? e.key)}" data-variable-type="${r(t?.type ?? "text")}">\${{${i(e.key)}}}</span>`;
314
305
  }).join("");
315
306
  }
316
307
  function N(e, t) {
317
308
  let n = t == null ? e.defaultValue ?? "" : String(t);
318
- return r({
309
+ return a({
319
310
  type: e.type,
320
311
  defaultValue: n,
321
312
  placeholder: e.placeholder,
@@ -347,8 +338,8 @@ function F(e) {
347
338
  "watermark.text": "水印内容"
348
339
  }[e] ?? "页面装饰";
349
340
  }
350
- function I(e, t) {
351
- return e.enabled && Object.values(e.slots).some((e) => e.trim()) && (t !== 1 || e.showOnFirstPage);
341
+ function I(t, n) {
342
+ return e(t, n);
352
343
  }
353
344
  function L(e, t) {
354
345
  return {
@@ -385,7 +376,7 @@ function V(e, t) {
385
376
  return (typeof e == "string" ? e : t).slice(0, 240);
386
377
  }
387
378
  function H(e, t) {
388
- return typeof e == "string" && s.test(e) ? e : t;
379
+ return typeof e == "string" && c.test(e) ? e : t;
389
380
  }
390
381
  function U(e, t) {
391
382
  return typeof e == "string" && e.replace(/[;{}<>]/g, "").trim().slice(0, 120) || t;
@@ -395,4 +386,4 @@ function W(e, t, n, r) {
395
386
  return Number.isFinite(i) ? Math.min(n, Math.max(t, i)) : r;
396
387
  }
397
388
  //#endregion
398
- export { i as CONTRACT_PAGE_BASE_PADDING, T as buildPageDecorationClassNames, E as buildPageDecorationsHtml, v as collectPageDecorationVariableKeys, d as createPageDecorationPreset, w as getPageDecorationSafePadding, C as getWatermarkDensityGrid, m as hasEnabledPageFooter, p as hasEnabledPageHeader, h as hasEnabledPageWatermark, u as normalizePageDecorations, _ as parsePageDecorationText, f as resolvePageDecorationPreset, S as resolvePageDecorationTokenText, b as resolvePageDecorationValidationPath, x as rewritePageDecorationVariableTokens, y as validatePageDecorations };
389
+ export { T as buildPageDecorationClassNames, E as buildPageDecorationsHtml, y as collectPageDecorationVariableKeys, f as createPageDecorationPreset, w as getWatermarkDensityGrid, h as hasEnabledPageFooter, m as hasEnabledPageHeader, g as hasEnabledPageWatermark, d as normalizePageDecorations, v as parsePageDecorationText, p as resolvePageDecorationPreset, C as resolvePageDecorationTokenText, x as resolvePageDecorationValidationPath, S as rewritePageDecorationVariableTokens, b as validatePageDecorations };
@@ -1,26 +1,27 @@
1
- import { buildSigningMarkAttrs as e } from "./signing-mark.mjs";
1
+ import { CONTRACT_PAGE_BASE_PADDING as e } from "../../../../contract-print-css/index.mjs";
2
+ import { buildSigningMarkAttrs as t, getSigningMarkDefaultSize as n } from "./signing-mark.mjs";
2
3
  //#region src/components/pro-contract-template-designer/src/utils/signing-layout-presets.ts
3
- var t = "dual-party", n = "custom", r = 1, i = 6, a = [
4
+ var r = "dual-party", i = 794, a = 24, o = 4, s = i - e.left - e.right, c = 3, l = "custom", u = 1, d = 6, f = [
4
5
  "side-by-side",
5
6
  "stacked",
6
7
  "table-cell",
7
8
  "final-page"
8
- ], o = {
9
+ ], p = {
9
10
  "side-by-side": "并排分栏",
10
11
  stacked: "逐行列出",
11
12
  "table-cell": "表格单元格",
12
13
  "final-page": "末页集中"
13
- }, s = [
14
+ }, m = [
14
15
  "seal",
15
16
  "signature",
16
17
  "date",
17
18
  "title"
18
- ], c = {
19
+ ], h = {
19
20
  seal: "盖章框",
20
21
  signature: "签字线",
21
22
  date: "日期",
22
23
  title: "职务"
23
- }, l = [
24
+ }, g = [
24
25
  "甲",
25
26
  "乙",
26
27
  "丙",
@@ -31,12 +32,12 @@ var t = "dual-party", n = "custom", r = 1, i = 6, a = [
31
32
  "辛",
32
33
  "壬",
33
34
  "癸"
34
- ], u = "年  月  日", d = "      ", f = "签署页";
35
- function p(e) {
36
- let t = l[e];
35
+ ], _ = "年  月  日", v = "      ", y = "签署页";
36
+ function b(e) {
37
+ let t = g[e];
37
38
  return t ? `${t}方` : `${e + 1}方`;
38
39
  }
39
- var m = {
40
+ var x = {
40
41
  "dual-party": {
41
42
  key: "dual-party",
42
43
  label: "双方并排",
@@ -97,22 +98,22 @@ var m = {
97
98
  }
98
99
  }
99
100
  }
100
- }, h = [
101
+ }, S = [
101
102
  "dual-party",
102
103
  "party-list",
103
104
  "table-cell",
104
105
  "final-page"
105
- ], g = [...h, n];
106
- function _(e) {
107
- return typeof e == "string" && Object.prototype.hasOwnProperty.call(m, e);
106
+ ], C = [...S, l];
107
+ function w(e) {
108
+ return typeof e == "string" && Object.prototype.hasOwnProperty.call(x, e);
108
109
  }
109
- function v(e) {
110
- return typeof e == "string" && g.includes(e);
110
+ function T(e) {
111
+ return typeof e == "string" && C.includes(e);
111
112
  }
112
- function y(e) {
113
- return a.includes(e);
113
+ function E(e) {
114
+ return f.includes(e);
114
115
  }
115
- function b(e) {
116
+ function D(e) {
116
117
  let t = Number(e?.partyCount), n = e?.fields, r = {
117
118
  seal: n?.seal !== !1,
118
119
  signature: n?.signature !== !1,
@@ -120,38 +121,48 @@ function b(e) {
120
121
  title: n?.title === !0
121
122
  };
122
123
  !r.seal && !r.signature && !r.date && !r.title && (r.seal = !0);
123
- let i = Array.isArray(e?.partyNames) ? e.partyNames.map((e) => String(e ?? "").trim()) : void 0;
124
+ let i = Array.isArray(e?.partyNames) ? e.partyNames.map((e) => String(e ?? "").trim()) : void 0, a = Number.isFinite(t) ? Math.min(6, Math.max(1, Math.round(t))) : x["dual-party"].options.partyCount, o = E(e?.arrangement) ? e.arrangement : "side-by-side";
124
125
  return {
125
- partyCount: Number.isFinite(t) ? Math.min(6, Math.max(1, Math.round(t))) : m["dual-party"].options.partyCount,
126
- arrangement: y(e?.arrangement) ? e.arrangement : "side-by-side",
126
+ partyCount: a,
127
+ arrangement: M(o) && a > 3 ? "stacked" : o,
127
128
  fields: r,
128
129
  ...i?.length ? { partyNames: i } : {}
129
130
  };
130
131
  }
131
- function x(e) {
132
- return Array.from({ length: e.partyCount }, (t, n) => e.partyNames?.[n] || p(n));
132
+ function O(e) {
133
+ return Array.from({ length: e.partyCount }, (t, n) => e.partyNames?.[n] || b(n));
133
134
  }
134
- function S(e = [], t) {
135
+ function k(e = [], t) {
135
136
  return {
136
137
  type: "paragraph",
137
138
  ...t ? { attrs: { textAlign: t } } : {},
138
139
  content: e
139
140
  };
140
141
  }
141
- function C(e, t) {
142
- return S([{
142
+ function A(e, t) {
143
+ return k([{
143
144
  type: "text",
144
145
  text: e
145
146
  }], t);
146
147
  }
147
- function w(t, n = "") {
148
- return S([{
148
+ function j(e, n = "", r) {
149
+ return k([{
149
150
  type: "signingMark",
150
- attrs: e(t, { label: n })
151
+ attrs: t(e, {
152
+ label: n,
153
+ width: r
154
+ })
151
155
  }]);
152
156
  }
153
- function T(e, t) {
154
- return S([{
157
+ function M(e) {
158
+ return e !== "stacked";
159
+ }
160
+ function N(e) {
161
+ let t = Math.floor(s / Math.max(1, e)) - a * 2 - o;
162
+ return Math.min(n("line").width, t);
163
+ }
164
+ function P(e, t) {
165
+ return k([{
155
166
  type: "text",
156
167
  text: e
157
168
  }, {
@@ -160,13 +171,13 @@ function T(e, t) {
160
171
  marks: [{ type: "underline" }]
161
172
  }]);
162
173
  }
163
- function E() {
164
- return T("日期:", u);
174
+ function F() {
175
+ return P("日期:", _);
165
176
  }
166
- function D() {
167
- return T("职务:", d);
177
+ function I() {
178
+ return P("职务:", v);
168
179
  }
169
- function O(e, t = "tableCell") {
180
+ function L(e, t = "tableCell") {
170
181
  return {
171
182
  type: t,
172
183
  attrs: {
@@ -178,45 +189,50 @@ function O(e, t = "tableCell") {
178
189
  content: e
179
190
  };
180
191
  }
181
- function k(e, t) {
182
- let n = [C(t.seal ? `${e}(盖章):` : `${e}:`)];
183
- return t.seal && n.push(w("seal")), t.signature && (n.push(C("授权代表(签字):")), n.push(w("line"))), t.title && n.push(D()), t.date && n.push(E()), O(n);
192
+ function R(e, t, n) {
193
+ let r = [A(t.seal ? `${e}(盖章):` : `${e}:`)];
194
+ return t.seal && r.push(j("seal")), t.signature && (r.push(A("授权代表(签字):")), r.push(j("line", "", n))), t.title && r.push(I()), t.date && r.push(F()), L(r);
184
195
  }
185
- function A(e, t) {
196
+ function z(e, t) {
186
197
  return {
187
198
  type: "table",
188
199
  attrs: { signingLayout: t },
189
200
  content: e
190
201
  };
191
202
  }
192
- function j(e, t = n) {
193
- let r = b(e), i = x(r), a = v(t) ? t : n, o = [];
194
- return r.arrangement === "final-page" && o.push(C(f, "center")), r.arrangement === "stacked" ? o.push(A(i.map((e) => ({
195
- type: "tableRow",
196
- content: [k(e, r.fields)]
197
- })), a)) : o.push(A([{
203
+ function B(e, t = l) {
204
+ let n = D(e), r = O(n), i = T(t) ? t : l, a = [];
205
+ if (n.arrangement === "final-page" && a.push(A(y, "center")), n.arrangement === "stacked") a.push(z(r.map((e) => ({
198
206
  type: "tableRow",
199
- content: i.map((e) => k(e, r.fields))
200
- }], a)), o.push(S()), o;
207
+ content: [R(e, n.fields)]
208
+ })), i));
209
+ else {
210
+ let e = N(n.partyCount);
211
+ a.push(z([{
212
+ type: "tableRow",
213
+ content: r.map((t) => R(t, n.fields, e))
214
+ }], i));
215
+ }
216
+ return a.push(k()), a;
201
217
  }
202
- function M(e) {
203
- return j(m[e].options, e);
218
+ function V(e) {
219
+ return B(x[e].options, e);
204
220
  }
205
- function N() {
206
- return M("dual-party");
221
+ function H() {
222
+ return V("dual-party");
207
223
  }
208
- function P(e) {
209
- let t = b(e), n = s.filter((e) => t.fields[e]).map((e) => c[e]);
210
- return `${t.partyCount} 个签署方 · ${o[t.arrangement]} · ${n.join("、")}`;
224
+ function U(e) {
225
+ let t = D(e), n = m.filter((e) => t.fields[e]).map((e) => h[e]);
226
+ return `${t.partyCount} 个签署方 · ${p[t.arrangement]} · ${n.join("、")}`;
211
227
  }
212
- var F = {
228
+ var W = {
213
229
  seal: "seal",
214
230
  signature: "line",
215
231
  date: "date",
216
232
  title: "text"
217
233
  };
218
- function I(e) {
219
- let t = b(e), n = x(t), r = s.filter((e) => t.fields[e]).map((e) => F[e]), i = n.map((e) => ({
234
+ function G(e) {
235
+ let t = D(e), n = O(t), r = m.filter((e) => t.fields[e]).map((e) => W[e]), i = n.map((e) => ({
220
236
  partyLabel: e,
221
237
  items: r
222
238
  }));
@@ -227,9 +243,9 @@ function I(e) {
227
243
  } : {
228
244
  arrangement: t.arrangement,
229
245
  columns: t.partyCount,
230
- ...t.arrangement === "final-page" ? { title: f } : {},
246
+ ...t.arrangement === "final-page" ? { title: y } : {},
231
247
  cells: i
232
248
  };
233
249
  }
234
250
  //#endregion
235
- export { n as CUSTOM_SIGNING_LAYOUT, t as DUAL_PARTY_SIGNING_LAYOUT, i as MAX_SIGNING_LAYOUT_PARTY_COUNT, r as MIN_SIGNING_LAYOUT_PARTY_COUNT, a as SIGNING_LAYOUT_ARRANGEMENTS, o as SIGNING_LAYOUT_ARRANGEMENT_LABELS, g as SIGNING_LAYOUT_ATTRIBUTE_VALUES, s as SIGNING_LAYOUT_FIELD_KEYS, c as SIGNING_LAYOUT_FIELD_LABELS, m as SIGNING_LAYOUT_PRESETS, h as SIGNING_LAYOUT_PRESET_KEYS, N as buildDualPartySigningLayoutPreset, j as buildSigningLayoutContent, M as buildSigningLayoutPresetContent, I as buildSigningLayoutPreviewModel, P as describeSigningLayoutOptions, v as isSigningLayoutAttributeValue, _ as isSigningLayoutPresetKey, b as normalizeSigningLayoutOptions, p as resolvePartyName };
251
+ export { l as CUSTOM_SIGNING_LAYOUT, r as DUAL_PARTY_SIGNING_LAYOUT, c as MAX_SIDE_BY_SIDE_SIGNING_LAYOUT_PARTY_COUNT, d as MAX_SIGNING_LAYOUT_PARTY_COUNT, u as MIN_SIGNING_LAYOUT_PARTY_COUNT, f as SIGNING_LAYOUT_ARRANGEMENTS, p as SIGNING_LAYOUT_ARRANGEMENT_LABELS, C as SIGNING_LAYOUT_ATTRIBUTE_VALUES, m as SIGNING_LAYOUT_FIELD_KEYS, h as SIGNING_LAYOUT_FIELD_LABELS, x as SIGNING_LAYOUT_PRESETS, S as SIGNING_LAYOUT_PRESET_KEYS, H as buildDualPartySigningLayoutPreset, B as buildSigningLayoutContent, V as buildSigningLayoutPresetContent, G as buildSigningLayoutPreviewModel, U as describeSigningLayoutOptions, T as isSigningLayoutAttributeValue, w as isSigningLayoutPresetKey, M as isSingleRowSigningLayoutArrangement, D as normalizeSigningLayoutOptions, b as resolvePartyName, N as resolveSingleRowSignatureLineWidth };