@guodun/antdv 1.4.2 → 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.
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +304 -293
- package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +66 -13
- package/dist/es/components/contract-signing-location/src/constants.mjs +27 -17
- package/dist/es/components/contract-signing-location/src/coordinates.mjs +23 -23
- package/dist/es/components/contract-signing-location/src/location-rules.mjs +20 -10
- package/dist/es/components/contract-signing-location/src/page-layout.mjs +12 -9
- package/dist/es/components/contract-signing-location/src/template-source.mjs +52 -34
- package/dist/es/components/contract-signing-location/style/index.css +1 -1
- package/dist/es/components/index.mjs +1 -1
- package/dist/es/components/pro-contract-template-designer/index.mjs +1 -1
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +186 -148
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +4 -4
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.vue.mjs +179 -0
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +149 -126
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1229 -1059
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +34 -34
- package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +17 -17
- package/dist/es/components/pro-contract-template-designer/src/utils/signing-placement.mjs +14 -14
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +89 -89
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/index.mjs +25 -25
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/constants.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/coordinates.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/page-layout.cjs +1 -1
- package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
- package/dist/lib/components/contract-signing-location/style/index.css +1 -1
- package/dist/lib/components/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +3 -3
- package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/signing-placement.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/contract-signing-location.css +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/types/components/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +3 -1
- package/dist/types/components/contract-signing-location/src/constants.d.ts +18 -0
- package/dist/types/components/contract-signing-location/src/coordinates.d.ts +8 -2
- package/dist/types/components/contract-signing-location/src/page-layout.d.ts +2 -2
- package/dist/types/components/contract-signing-location/src/template-source.d.ts +19 -0
- package/dist/types/components/contract-signing-location/src/types.d.ts +3 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +10 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateTextBubbleMenu.vue.d.ts +43 -0
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +22 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +90 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/context-menu-viewport.d.ts +3 -0
- package/package.json +5 -3
package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEFAULT_CONTRACT_FONT_FAMILY as e } from "../constants.mjs";
|
|
2
2
|
import { canUseDomHtml as t, createElementAttributeReader as n, createTagAttributeReader as r, escapeHtmlAttribute as i, escapeHtmlText as a, forEachHtmlTag as o, readNumberAttribute as s, readOptionalBoolean as c, readOptionalNumber as l, replaceTemplateVariableSpans as u } from "../utils/html.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { resolveTemplateVariablePresentation as ee } from "../utils/template-variable-render.mjs";
|
|
4
|
+
import { buildPageDecorationClassNames as te, buildPageDecorationsHtml as d, collectPageDecorationVariableKeys as f, normalizePageDecorations as p, validatePageDecorations as m } from "../utils/page-decorations.mjs";
|
|
5
|
+
import { isContractTemplateFieldType as ne } from "../types.mjs";
|
|
6
|
+
import { normalizeSigningPlacements as re, scaleSigningPlacementToPage as ie, validateSigningPlacements as ae } from "../utils/signing-placement.mjs";
|
|
7
7
|
//#region src/components/pro-contract-template-designer/src/composables/use-template-designer.ts
|
|
8
8
|
var h = [
|
|
9
9
|
{
|
|
@@ -58,26 +58,26 @@ var h = [
|
|
|
58
58
|
color: "#1f2937",
|
|
59
59
|
background: "transparent",
|
|
60
60
|
fontSize: 14,
|
|
61
|
-
fontFamily:
|
|
61
|
+
fontFamily: e,
|
|
62
62
|
placeholderColor: "#7a818b",
|
|
63
63
|
lineColor: "#565b66",
|
|
64
64
|
textAlign: "left",
|
|
65
65
|
borderStyle: "solid",
|
|
66
66
|
objectFit: "contain"
|
|
67
|
-
}, oe = 3, se = 28, v = "contract-template-renderer-1.0.0", y = "contract-render-css-1.0.0", b = /^[A-Za-z][A-Za-z0-9_]{1,63}$/,
|
|
67
|
+
}, oe = 3, se = 28, v = "contract-template-renderer-1.0.0", y = "contract-render-css-1.0.0", b = /^[A-Za-z][A-Za-z0-9_]{1,63}$/, x = new Set([
|
|
68
68
|
"pageNumber",
|
|
69
69
|
"totalPages",
|
|
70
70
|
"rendererVersion"
|
|
71
71
|
]);
|
|
72
|
-
function
|
|
72
|
+
function S(e, t, n) {
|
|
73
73
|
let r = typeof e == "string" ? e.trim() : "";
|
|
74
|
-
return r ? b.test(r) ?
|
|
74
|
+
return r ? b.test(r) ? x.has(r) ? `${r} 是系统保留标识` : t.some((e) => e.id !== n && e.key.trim() === r) ? `变量标识 ${r} 已存在` : "" : "变量标识需以字母开头,仅包含字母、数字和下划线,长度为 2~64 位" : "请输入变量标识";
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function ce(e) {
|
|
77
77
|
let t = Number(e);
|
|
78
78
|
return Number.isFinite(t) && t >= 1 ? Math.max(1, Math.floor(t)) : 20;
|
|
79
79
|
}
|
|
80
|
-
var
|
|
80
|
+
var C = [
|
|
81
81
|
{
|
|
82
82
|
type: "text",
|
|
83
83
|
label: "输入框",
|
|
@@ -108,11 +108,11 @@ var S = [
|
|
|
108
108
|
defaultWidth: 96,
|
|
109
109
|
defaultHeight: 28
|
|
110
110
|
}
|
|
111
|
-
],
|
|
112
|
-
function w(e) {
|
|
113
|
-
return C += 1, `${e}-${Date.now().toString(36)}-${C.toString(36)}`;
|
|
114
|
-
}
|
|
111
|
+
], w = 0;
|
|
115
112
|
function T(e) {
|
|
113
|
+
return w += 1, `${e}-${Date.now().toString(36)}-${w.toString(36)}`;
|
|
114
|
+
}
|
|
115
|
+
function le(e) {
|
|
116
116
|
let t = JSON.parse(JSON.stringify(e));
|
|
117
117
|
return Array.isArray(t.signingPlacements) && (t.signingPlacements = t.signingPlacements.map((e) => ({
|
|
118
118
|
id: e.id,
|
|
@@ -191,7 +191,7 @@ function ue(e, t) {
|
|
|
191
191
|
};
|
|
192
192
|
}), c = [], l = (e.signingPlacements ?? []).map((e) => {
|
|
193
193
|
let t = o.get(e.pageId);
|
|
194
|
-
return t ? (c.push(e.id),
|
|
194
|
+
return t ? (c.push(e.id), ie(e, t.source, t.target)) : e;
|
|
195
195
|
});
|
|
196
196
|
return {
|
|
197
197
|
value: {
|
|
@@ -209,7 +209,7 @@ function M(e, t) {
|
|
|
209
209
|
}
|
|
210
210
|
function N(e = 1, t) {
|
|
211
211
|
return {
|
|
212
|
-
id:
|
|
212
|
+
id: T("page"),
|
|
213
213
|
title: `第 ${e} 页`,
|
|
214
214
|
pageSize: t ? O(t) : void 0,
|
|
215
215
|
contentHtml: "<p>请输入合同正文。</p>"
|
|
@@ -217,7 +217,7 @@ function N(e = 1, t) {
|
|
|
217
217
|
}
|
|
218
218
|
function P(e = 1, t, n = "<p></p>", r) {
|
|
219
219
|
return {
|
|
220
|
-
id:
|
|
220
|
+
id: T("page"),
|
|
221
221
|
title: `第 ${e} 页`,
|
|
222
222
|
pageSize: t ? O(t) : void 0,
|
|
223
223
|
contentHtml: n,
|
|
@@ -242,13 +242,13 @@ function de(e = g) {
|
|
|
242
242
|
signingPlacements: []
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
|
-
function I(e, t =
|
|
246
|
-
return t.find((t) => t.type === e) ??
|
|
245
|
+
function I(e, t = C) {
|
|
246
|
+
return t.find((t) => t.type === e) ?? C[0];
|
|
247
247
|
}
|
|
248
|
-
function L(e, t =
|
|
248
|
+
function L(e, t = C, n = {}) {
|
|
249
249
|
let r = e.type === void 0 ? "text" : e.type, i = I(r, t), a = fe(r);
|
|
250
250
|
return {
|
|
251
|
-
id: e.id ??
|
|
251
|
+
id: e.id ?? T("variable"),
|
|
252
252
|
key: e.key,
|
|
253
253
|
label: e.label ?? i.label ?? e.key,
|
|
254
254
|
type: r,
|
|
@@ -315,13 +315,13 @@ function fe(e) {
|
|
|
315
315
|
underline: !0
|
|
316
316
|
} };
|
|
317
317
|
}
|
|
318
|
-
function R(
|
|
319
|
-
return
|
|
318
|
+
function R(e) {
|
|
319
|
+
return e !== void 0 && !ne(e);
|
|
320
320
|
}
|
|
321
321
|
function pe(e, t = g) {
|
|
322
322
|
if (!e) return F(t);
|
|
323
323
|
let n = O(e.pageSize, t), r = (e.pages?.length ? e.pages : [N(1, n)]).map((e, t) => ({
|
|
324
|
-
id: e.id ||
|
|
324
|
+
id: e.id || T("page"),
|
|
325
325
|
title: e.title || `第 ${t + 1} 页`,
|
|
326
326
|
pageSize: O(e.pageSize, n),
|
|
327
327
|
contentHtml: e.contentHtml || "<p></p>",
|
|
@@ -330,7 +330,7 @@ function pe(e, t = g) {
|
|
|
330
330
|
return (e.variables ?? []).forEach((e) => {
|
|
331
331
|
let t = L({
|
|
332
332
|
...e,
|
|
333
|
-
id: e.id ||
|
|
333
|
+
id: e.id || T("variable")
|
|
334
334
|
});
|
|
335
335
|
i.push(t), t.key && a.set(t.key, t);
|
|
336
336
|
}), r.forEach((e) => {
|
|
@@ -356,7 +356,7 @@ function pe(e, t = g) {
|
|
|
356
356
|
pages: r,
|
|
357
357
|
variables: i,
|
|
358
358
|
pageSize: n,
|
|
359
|
-
signingPlacements:
|
|
359
|
+
signingPlacements: re(e.signingPlacements, o, n),
|
|
360
360
|
...e.pageDecorations ? { pageDecorations: p(e.pageDecorations) } : {}
|
|
361
361
|
};
|
|
362
362
|
}
|
|
@@ -401,7 +401,7 @@ var V = class extends Error {
|
|
|
401
401
|
function ge(e) {
|
|
402
402
|
let t = m(e.pageDecorations, e.variables);
|
|
403
403
|
if (t.length) throw new V(t);
|
|
404
|
-
let n =
|
|
404
|
+
let n = le(e);
|
|
405
405
|
return n.pageDecorations &&= p(n.pageDecorations), {
|
|
406
406
|
...n,
|
|
407
407
|
rendererVersion: v,
|
|
@@ -418,7 +418,7 @@ function H(e, t = {}) {
|
|
|
418
418
|
code: "PAGE_LIMIT_EXCEEDED",
|
|
419
419
|
message: `合同共 ${e.pages.length} 页,超过最多 ${t.maxPages} 页限制`
|
|
420
420
|
}), e.variables.forEach((t) => {
|
|
421
|
-
let i =
|
|
421
|
+
let i = S(t.key, e.variables, t.id), a = !!t.key?.trim() && e.variables.some((e) => e.id !== t.id && e.key.trim() === t.key.trim());
|
|
422
422
|
i && (!a || t.key !== t.key.trim()) && n.push({
|
|
423
423
|
type: "variable",
|
|
424
424
|
id: t.id,
|
|
@@ -454,7 +454,7 @@ function H(e, t = {}) {
|
|
|
454
454
|
id: e.id,
|
|
455
455
|
message: `${e.label || e.key} 缺少对应正文变量节点`
|
|
456
456
|
});
|
|
457
|
-
}), n.push(...m(e.pageDecorations, e.variables)), n.push(...
|
|
457
|
+
}), n.push(...m(e.pageDecorations, e.variables)), n.push(...ae(e)), n;
|
|
458
458
|
}
|
|
459
459
|
function U(e) {
|
|
460
460
|
let t = /* @__PURE__ */ new Set();
|
|
@@ -484,7 +484,7 @@ function ve(e) {
|
|
|
484
484
|
let t = W(e), n = f(e.pageDecorations);
|
|
485
485
|
return {
|
|
486
486
|
...e,
|
|
487
|
-
variables: e.variables.filter((r) =>
|
|
487
|
+
variables: e.variables.filter((r) => S(r.key, e.variables, r.id) ? !0 : t.has(r.key) || n.has(r.key))
|
|
488
488
|
};
|
|
489
489
|
}
|
|
490
490
|
function ye(e, t, n) {
|
|
@@ -511,7 +511,7 @@ function G(e, t, n, r, i) {
|
|
|
511
511
|
function K(e, t, n, r = 1) {
|
|
512
512
|
let a = O(e.pageSize, t);
|
|
513
513
|
return [
|
|
514
|
-
`class="${
|
|
514
|
+
`class="${te(n, r)}"`,
|
|
515
515
|
`data-page-id="${i(e.id)}"`,
|
|
516
516
|
`data-page-format="${i(a.format ?? "Custom")}"`,
|
|
517
517
|
`data-page-label="${i(a.label ?? a.format ?? "自定义")}"`,
|
|
@@ -638,7 +638,7 @@ function we(e) {
|
|
|
638
638
|
});
|
|
639
639
|
}
|
|
640
640
|
function J(e, t) {
|
|
641
|
-
let n = e("data-key") ?? "", r = t.get(n), i = r?.type ?? e("data-variable-type") ?? "text", a = ke(i, r?.defaultValue ?? e("data-default-value") ?? ""), o =
|
|
641
|
+
let n = e("data-key") ?? "", r = t.get(n), i = r?.type ?? e("data-variable-type") ?? "text", a = ke(i, r?.defaultValue ?? e("data-default-value") ?? ""), o = ee({
|
|
642
642
|
type: i,
|
|
643
643
|
width: r?.width ?? e("data-width"),
|
|
644
644
|
height: r?.height ?? e("data-height"),
|
|
@@ -737,4 +737,4 @@ function Pe(e, t = []) {
|
|
|
737
737
|
});
|
|
738
738
|
}
|
|
739
739
|
//#endregion
|
|
740
|
-
export { v as CONTRACT_TEMPLATE_RENDERER_VERSION,
|
|
740
|
+
export { v as CONTRACT_TEMPLATE_RENDERER_VERSION, x as CONTRACT_TEMPLATE_RESERVED_VARIABLE_KEYS, y as CONTRACT_TEMPLATE_STYLE_VERSION, b as CONTRACT_TEMPLATE_VARIABLE_KEY_PATTERN, V as ContractTemplatePageDecorationValidationError, _ as DEFAULT_FIELD_STYLE, C as DEFAULT_FIELD_TYPES, se as DEFAULT_MULTILINE_LINE_HEIGHT, oe as DEFAULT_MULTILINE_ROWS, g as DEFAULT_PAGE_SIZE, h as PAGE_SIZE_OPTIONS, z as buildTemplateExpressionHtml, me as buildTemplateHtml, he as buildTemplatePreviewHtml, B as buildTemplatePreviewPages, le as cloneTemplateValue, Pe as collectTemplateLocationRuleExportErrors, W as collectTemplateValueVariableKeys, U as collectTemplateVariableKeys, ue as constrainTemplatePageSizes, P as createBlankPage, de as createBlankTemplate, N as createDefaultPage, F as createDefaultTemplate, T as createDesignerId, L as createTemplateVariable, ge as exportTemplateValue, j as findPageSizeOption, I as getFieldOption, k as getPageSizeKey, E as getPageSizeOption, D as inferPageFormat, ce as normalizeContractTemplateMaxPages, A as normalizePageSizeOptions, pe as normalizeTemplateValue, O as resolvePageSize, ye as splitPageContentByMeasurements, ve as syncTemplateVariablesWithPages, S as validateContractTemplateVariableKey, H as validateTemplateValue };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
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:
|
|
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:
|
|
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(
|
|
295
|
-
let c = w(n), l = n.divider.enabled ? `;border-${
|
|
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__${
|
|
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(
|
|
303
|
-
let s = C(
|
|
304
|
-
return `<div class="gd-contract-template-page__watermark is-${
|
|
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(
|
|
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 _(
|
|
309
|
-
if (
|
|
310
|
-
if (
|
|
311
|
-
if (
|
|
312
|
-
let r = l.get(
|
|
313
|
-
return i !== void 0 && r && r.type !== "image" ?
|
|
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 {
|
|
2
|
-
import {
|
|
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:
|
|
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(
|
|
84
|
-
let i = n.type ??
|
|
85
|
-
...
|
|
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
|
|
92
|
-
a.width =
|
|
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(
|
|
97
|
-
let a = N(
|
|
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(
|
|
264
|
-
if (!
|
|
265
|
-
let a = Array.isArray(
|
|
266
|
-
return
|
|
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();
|