@guodun/antdv 1.4.1 → 1.4.2
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/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +208 -180
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +2 -1
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.mjs +690 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +215 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.mjs +87 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.mjs +98 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.mjs +550 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.mjs +117 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.mjs +96 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +51 -26
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.mjs +56 -33
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.mjs +29 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.mjs +390 -0
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +313 -267
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1278 -2293
- package/dist/es/components/pro-contract-template-designer/src/composables/use-auto-pagination.mjs +71 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-designer-files.mjs +11 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-draft-cache-session.mjs +111 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.mjs +79 -0
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +189 -160
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-files.mjs +35 -22
- package/dist/es/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.mjs +71 -0
- package/dist/es/components/pro-contract-template-designer/src/constants.mjs +71 -10
- package/dist/es/components/pro-contract-template-designer/src/extensions/editor-extensions.mjs +1 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/block-style.mjs +43 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/context-menu-viewport.mjs +13 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/editor-state.mjs +7 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +398 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/serialize-fingerprint.mjs +6 -0
- package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +88 -72
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/index.mjs +20 -20
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.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-auto-pagination.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-designer-files.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-draft-cache-session.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-files.cjs +2 -2
- package/dist/lib/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/constants.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/extensions/editor-extensions.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/block-style.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/context-menu-viewport.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/editor-state.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/serialize-fingerprint.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +3 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +104 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +50 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateImageContextMenu.vue.d.ts +27 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorations.vue.d.ts +13 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsInspector.vue.d.ts +28 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePageDecorationsStudio.vue.d.ts +77 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.d.ts +36 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.d.ts +5 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererHeader.vue.d.ts +4 -4
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererToolbar.vue.d.ts +4 -4
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateSubmitDataModal.vue.d.ts +12 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateTextContextMenu.vue.d.ts +77 -0
- package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +8 -32
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +366 -12
- package/dist/types/components/pro-contract-template-designer/src/composables/use-auto-pagination.d.ts +43 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-designer-files.d.ts +22 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-draft-cache-session.d.ts +41 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-signing-placement-editor.d.ts +49 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +15 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts +13 -0
- package/dist/types/components/pro-contract-template-designer/src/composables/use-toolbar-overflow.d.ts +19 -0
- package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +7 -1
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +89 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/block-style.d.ts +4 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/context-menu-viewport.d.ts +22 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/editor-state.d.ts +8 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/page-decorations.d.ts +90 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/serialize-fingerprint.d.ts +8 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +4 -1
- package/package.json +1 -1
package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isContractTemplateFieldType as e } from "../types.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 { normalizeSigningPlacements as
|
|
4
|
-
import { DEFAULT_CONTRACT_FONT_FAMILY as
|
|
5
|
-
import { resolveTemplateVariablePresentation as
|
|
3
|
+
import { normalizeSigningPlacements as ee, scaleSigningPlacementToPage as te, validateSigningPlacements as ne } from "../utils/signing-placement.mjs";
|
|
4
|
+
import { DEFAULT_CONTRACT_FONT_FAMILY as re } from "../constants.mjs";
|
|
5
|
+
import { resolveTemplateVariablePresentation as ie } from "../utils/template-variable-render.mjs";
|
|
6
|
+
import { buildPageDecorationClassNames as ae, buildPageDecorationsHtml as d, collectPageDecorationVariableKeys as f, normalizePageDecorations as p, validatePageDecorations as m } from "../utils/page-decorations.mjs";
|
|
6
7
|
//#region src/components/pro-contract-template-designer/src/composables/use-template-designer.ts
|
|
7
|
-
var
|
|
8
|
+
var h = [
|
|
8
9
|
{
|
|
9
10
|
format: "A0",
|
|
10
11
|
width: 3178,
|
|
@@ -53,22 +54,30 @@ var f = [
|
|
|
53
54
|
height: 1344,
|
|
54
55
|
label: "Legal"
|
|
55
56
|
}
|
|
56
|
-
],
|
|
57
|
+
], g = { ...h[4] }, _ = {
|
|
57
58
|
color: "#1f2937",
|
|
58
59
|
background: "transparent",
|
|
59
60
|
fontSize: 14,
|
|
60
|
-
fontFamily:
|
|
61
|
+
fontFamily: re,
|
|
61
62
|
placeholderColor: "#7a818b",
|
|
62
63
|
lineColor: "#565b66",
|
|
63
64
|
textAlign: "left",
|
|
64
65
|
borderStyle: "solid",
|
|
65
66
|
objectFit: "contain"
|
|
66
|
-
},
|
|
67
|
-
|
|
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}$/, ce = new Set([
|
|
68
|
+
"pageNumber",
|
|
69
|
+
"totalPages",
|
|
70
|
+
"rendererVersion"
|
|
71
|
+
]);
|
|
72
|
+
function x(e, t, n) {
|
|
73
|
+
let r = typeof e == "string" ? e.trim() : "";
|
|
74
|
+
return r ? b.test(r) ? ce.has(r) ? `${r} 是系统保留标识` : t.some((e) => e.id !== n && e.key.trim() === r) ? `变量标识 ${r} 已存在` : "" : "变量标识需以字母开头,仅包含字母、数字和下划线,长度为 2~64 位" : "请输入变量标识";
|
|
75
|
+
}
|
|
76
|
+
function le(e) {
|
|
68
77
|
let t = Number(e);
|
|
69
78
|
return Number.isFinite(t) && t >= 1 ? Math.max(1, Math.floor(t)) : 20;
|
|
70
79
|
}
|
|
71
|
-
var
|
|
80
|
+
var S = [
|
|
72
81
|
{
|
|
73
82
|
type: "text",
|
|
74
83
|
label: "输入框",
|
|
@@ -99,11 +108,11 @@ var y = [
|
|
|
99
108
|
defaultWidth: 96,
|
|
100
109
|
defaultHeight: 28
|
|
101
110
|
}
|
|
102
|
-
],
|
|
103
|
-
function
|
|
104
|
-
return
|
|
111
|
+
], C = 0;
|
|
112
|
+
function w(e) {
|
|
113
|
+
return C += 1, `${e}-${Date.now().toString(36)}-${C.toString(36)}`;
|
|
105
114
|
}
|
|
106
|
-
function
|
|
115
|
+
function T(e) {
|
|
107
116
|
let t = JSON.parse(JSON.stringify(e));
|
|
108
117
|
return Array.isArray(t.signingPlacements) && (t.signingPlacements = t.signingPlacements.map((e) => ({
|
|
109
118
|
id: e.id,
|
|
@@ -117,14 +126,14 @@ function S(e) {
|
|
|
117
126
|
...e.sealTypes?.length ? { sealTypes: [...e.sealTypes] } : {}
|
|
118
127
|
}))), t;
|
|
119
128
|
}
|
|
120
|
-
function
|
|
121
|
-
return
|
|
129
|
+
function E(e) {
|
|
130
|
+
return h.find((t) => t.format === e);
|
|
122
131
|
}
|
|
123
|
-
function
|
|
124
|
-
if (e) return e.format && e.format !== "Custom" ? e.format :
|
|
132
|
+
function D(e) {
|
|
133
|
+
if (e) return e.format && e.format !== "Custom" ? e.format : h.find((t) => t.width === e.width && t.height === e.height)?.format;
|
|
125
134
|
}
|
|
126
|
-
function
|
|
127
|
-
let n =
|
|
135
|
+
function O(e, t = g) {
|
|
136
|
+
let n = D(t) ?? t.format, r = e?.format ?? D(e) ?? n ?? "Custom", i = r === "Custom" ? void 0 : E(r), a = M(i?.width ?? e?.width, t.width), o = M(i?.height ?? e?.height, t.height);
|
|
128
137
|
return {
|
|
129
138
|
format: i?.format ?? r,
|
|
130
139
|
width: a,
|
|
@@ -132,22 +141,22 @@ function T(e, t = p) {
|
|
|
132
141
|
label: e?.label ?? i?.label ?? t.label ?? r
|
|
133
142
|
};
|
|
134
143
|
}
|
|
135
|
-
function
|
|
144
|
+
function k(e) {
|
|
136
145
|
return `${e.format ?? "Custom"}:${e.width}:${e.height}`;
|
|
137
146
|
}
|
|
138
|
-
function
|
|
139
|
-
let t = (Array.isArray(e) ? e :
|
|
147
|
+
function A(e) {
|
|
148
|
+
let t = (Array.isArray(e) ? e : h).map((e) => {
|
|
140
149
|
let t = Number(e?.width), n = Number(e?.height);
|
|
141
150
|
if (!Number.isFinite(t) || t <= 0 || !Number.isFinite(n) || n <= 0) return;
|
|
142
151
|
let r = e?.format;
|
|
143
152
|
if (r && r !== "Custom") {
|
|
144
|
-
let t =
|
|
153
|
+
let t = E(r);
|
|
145
154
|
return t ? {
|
|
146
155
|
...t,
|
|
147
156
|
label: e.label ?? t.label
|
|
148
157
|
} : void 0;
|
|
149
158
|
}
|
|
150
|
-
let i = r ? void 0 :
|
|
159
|
+
let i = r ? void 0 : D(e), a = i ? E(i) : void 0;
|
|
151
160
|
if (a) return {
|
|
152
161
|
...a,
|
|
153
162
|
label: e.label ?? a.label
|
|
@@ -161,19 +170,19 @@ function D(e) {
|
|
|
161
170
|
label: e.label ?? "Custom"
|
|
162
171
|
};
|
|
163
172
|
}).filter(Boolean), n = /* @__PURE__ */ new Set(), r = t.filter((e) => {
|
|
164
|
-
let t =
|
|
173
|
+
let t = k(e);
|
|
165
174
|
return n.has(t) ? !1 : (n.add(t), !0);
|
|
166
175
|
});
|
|
167
|
-
return (r.length ? r :
|
|
176
|
+
return (r.length ? r : h).map((e) => ({ ...e }));
|
|
168
177
|
}
|
|
169
|
-
function
|
|
170
|
-
let n =
|
|
171
|
-
return t.find((e) =>
|
|
178
|
+
function j(e, t) {
|
|
179
|
+
let n = k(e);
|
|
180
|
+
return t.find((e) => k(e) === n);
|
|
172
181
|
}
|
|
173
|
-
function
|
|
174
|
-
let n =
|
|
175
|
-
let t =
|
|
176
|
-
return
|
|
182
|
+
function ue(e, t) {
|
|
183
|
+
let n = A(t), r = n[0], i = O(e.pageSize, r), a = j(i, n) ?? r, o = /* @__PURE__ */ new Map(), s = e.pages.map((e) => {
|
|
184
|
+
let t = O(e.pageSize, i), a = j(t, n) ?? r;
|
|
185
|
+
return k(t) !== k(a) && o.set(e.id, {
|
|
177
186
|
source: t,
|
|
178
187
|
target: a
|
|
179
188
|
}), {
|
|
@@ -182,7 +191,7 @@ function k(e, t) {
|
|
|
182
191
|
};
|
|
183
192
|
}), c = [], l = (e.signingPlacements ?? []).map((e) => {
|
|
184
193
|
let t = o.get(e.pageId);
|
|
185
|
-
return t ? (c.push(e.id),
|
|
194
|
+
return t ? (c.push(e.id), te(e, t.source, t.target)) : e;
|
|
186
195
|
});
|
|
187
196
|
return {
|
|
188
197
|
value: {
|
|
@@ -194,52 +203,52 @@ function k(e, t) {
|
|
|
194
203
|
resizedSigningPlacementIds: c
|
|
195
204
|
};
|
|
196
205
|
}
|
|
197
|
-
function
|
|
206
|
+
function M(e, t) {
|
|
198
207
|
let n = Number(e);
|
|
199
208
|
return !Number.isFinite(n) || n <= 0 ? t : Math.round(n);
|
|
200
209
|
}
|
|
201
|
-
function
|
|
210
|
+
function N(e = 1, t) {
|
|
202
211
|
return {
|
|
203
|
-
id:
|
|
212
|
+
id: w("page"),
|
|
204
213
|
title: `第 ${e} 页`,
|
|
205
|
-
pageSize: t ?
|
|
206
|
-
contentHtml: "<p
|
|
214
|
+
pageSize: t ? O(t) : void 0,
|
|
215
|
+
contentHtml: "<p>请输入合同正文。</p>"
|
|
207
216
|
};
|
|
208
217
|
}
|
|
209
|
-
function
|
|
218
|
+
function P(e = 1, t, n = "<p></p>", r) {
|
|
210
219
|
return {
|
|
211
|
-
id:
|
|
220
|
+
id: w("page"),
|
|
212
221
|
title: `第 ${e} 页`,
|
|
213
|
-
pageSize: t ?
|
|
222
|
+
pageSize: t ? O(t) : void 0,
|
|
214
223
|
contentHtml: n,
|
|
215
224
|
contentJson: r
|
|
216
225
|
};
|
|
217
226
|
}
|
|
218
|
-
function
|
|
219
|
-
let t =
|
|
227
|
+
function F(e = g) {
|
|
228
|
+
let t = O(e);
|
|
220
229
|
return {
|
|
221
|
-
pages: [
|
|
230
|
+
pages: [N(1, t)],
|
|
222
231
|
variables: [],
|
|
223
232
|
pageSize: t,
|
|
224
233
|
signingPlacements: []
|
|
225
234
|
};
|
|
226
235
|
}
|
|
227
|
-
function
|
|
228
|
-
let t =
|
|
236
|
+
function de(e = g) {
|
|
237
|
+
let t = O(e);
|
|
229
238
|
return {
|
|
230
|
-
pages: [
|
|
239
|
+
pages: [P(1, t, "<p></p>")],
|
|
231
240
|
variables: [],
|
|
232
241
|
pageSize: t,
|
|
233
242
|
signingPlacements: []
|
|
234
243
|
};
|
|
235
244
|
}
|
|
236
|
-
function
|
|
237
|
-
return t.find((t) => t.type === e) ??
|
|
245
|
+
function I(e, t = S) {
|
|
246
|
+
return t.find((t) => t.type === e) ?? S[0];
|
|
238
247
|
}
|
|
239
|
-
function
|
|
240
|
-
let r = e.type === void 0 ? "text" : e.type, i =
|
|
248
|
+
function L(e, t = S, n = {}) {
|
|
249
|
+
let r = e.type === void 0 ? "text" : e.type, i = I(r, t), a = fe(r);
|
|
241
250
|
return {
|
|
242
|
-
id: e.id ??
|
|
251
|
+
id: e.id ?? w("variable"),
|
|
243
252
|
key: e.key,
|
|
244
253
|
label: e.label ?? i.label ?? e.key,
|
|
245
254
|
type: r,
|
|
@@ -257,14 +266,14 @@ function F(e, t = y, n = {}) {
|
|
|
257
266
|
rows: Math.max(1, Math.round(e.rows ?? 3)),
|
|
258
267
|
lineHeight: Math.max(18, Math.round(e.lineHeight ?? 28)),
|
|
259
268
|
style: {
|
|
260
|
-
...
|
|
269
|
+
..._,
|
|
261
270
|
...a.style,
|
|
262
271
|
...n,
|
|
263
272
|
...e.style
|
|
264
273
|
}
|
|
265
274
|
};
|
|
266
275
|
}
|
|
267
|
-
function
|
|
276
|
+
function fe(e) {
|
|
268
277
|
return e === "date" ? {
|
|
269
278
|
placeholder: "年 月 日",
|
|
270
279
|
format: "YYYY年MM月DD日",
|
|
@@ -306,63 +315,71 @@ function oe(e) {
|
|
|
306
315
|
underline: !0
|
|
307
316
|
} };
|
|
308
317
|
}
|
|
309
|
-
function
|
|
318
|
+
function R(t) {
|
|
310
319
|
return t !== void 0 && !e(t);
|
|
311
320
|
}
|
|
312
|
-
function
|
|
313
|
-
if (!e) return
|
|
314
|
-
let n =
|
|
315
|
-
id: e.id ||
|
|
321
|
+
function pe(e, t = g) {
|
|
322
|
+
if (!e) return F(t);
|
|
323
|
+
let n = O(e.pageSize, t), r = (e.pages?.length ? e.pages : [N(1, n)]).map((e, t) => ({
|
|
324
|
+
id: e.id || w("page"),
|
|
316
325
|
title: e.title || `第 ${t + 1} 页`,
|
|
317
|
-
pageSize:
|
|
326
|
+
pageSize: O(e.pageSize, n),
|
|
318
327
|
contentHtml: e.contentHtml || "<p></p>",
|
|
319
328
|
contentJson: e.contentJson
|
|
320
|
-
})), i = /* @__PURE__ */ new Map(),
|
|
329
|
+
})), i = [], a = /* @__PURE__ */ new Map(), o = Object.fromEntries(r.map((e) => [e.id, O(e.pageSize, n)]));
|
|
321
330
|
return (e.variables ?? []).forEach((e) => {
|
|
322
|
-
|
|
331
|
+
let t = L({
|
|
323
332
|
...e,
|
|
324
|
-
id: e.id ||
|
|
325
|
-
})
|
|
333
|
+
id: e.id || w("variable")
|
|
334
|
+
});
|
|
335
|
+
i.push(t), t.key && a.set(t.key, t);
|
|
326
336
|
}), r.forEach((e) => {
|
|
327
|
-
|
|
337
|
+
xe(e).forEach((e) => {
|
|
328
338
|
if (!e.key) return;
|
|
329
|
-
let t =
|
|
339
|
+
let t = a.get(e.key);
|
|
330
340
|
if (!t) {
|
|
331
|
-
|
|
341
|
+
let t = L(e);
|
|
342
|
+
i.push(t), a.set(e.key, t);
|
|
332
343
|
return;
|
|
333
344
|
}
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
345
|
+
if (R(e.type)) {
|
|
346
|
+
let n = L({
|
|
347
|
+
...t,
|
|
348
|
+
type: e.type
|
|
349
|
+
});
|
|
350
|
+
a.set(e.key, n);
|
|
351
|
+
let r = i.findIndex((e) => e.id === t.id);
|
|
352
|
+
r >= 0 && (i[r] = n);
|
|
353
|
+
}
|
|
338
354
|
});
|
|
339
355
|
}), {
|
|
340
356
|
pages: r,
|
|
341
|
-
variables:
|
|
357
|
+
variables: i,
|
|
342
358
|
pageSize: n,
|
|
343
|
-
signingPlacements:
|
|
359
|
+
signingPlacements: ee(e.signingPlacements, o, n),
|
|
360
|
+
...e.pageDecorations ? { pageDecorations: p(e.pageDecorations) } : {}
|
|
344
361
|
};
|
|
345
362
|
}
|
|
346
|
-
function
|
|
347
|
-
return e.pages.map((t) =>
|
|
363
|
+
function me(e) {
|
|
364
|
+
return e.pages.map((t, n) => G(e, t, n, t.contentHtml, {})).join("\n");
|
|
348
365
|
}
|
|
349
|
-
function
|
|
350
|
-
return e.pages.map((t) =>
|
|
366
|
+
function z(e) {
|
|
367
|
+
return e.pages.map((t, n) => G(e, t, n, Ae(t.contentHtml))).join("\n");
|
|
351
368
|
}
|
|
352
|
-
function
|
|
353
|
-
return
|
|
354
|
-
let
|
|
355
|
-
return `<section ${
|
|
369
|
+
function he(e) {
|
|
370
|
+
return B(e).map(({ page: t, contentHtml: n }, r) => {
|
|
371
|
+
let i = O(t.pageSize, e.pageSize), a = d(e.pageDecorations, r + 1, e.pages.length, e.variables, {});
|
|
372
|
+
return `<section ${K(t, e.pageSize, e.pageDecorations, r + 1)} style="width:${i.width}px;min-height:${i.height}px">${a}<div class="gd-contract-template-page__content">${n}</div></section>`;
|
|
356
373
|
}).join("\n");
|
|
357
374
|
}
|
|
358
|
-
function
|
|
375
|
+
function B(e) {
|
|
359
376
|
let t = new Map(e.variables.map((e) => [e.key, e])), n = Array.isArray(e.signingPlacements) ? e.signingPlacements : [];
|
|
360
377
|
return e.pages.map((e) => ({
|
|
361
378
|
page: {
|
|
362
379
|
...e,
|
|
363
380
|
...e.pageSize ? { pageSize: { ...e.pageSize } } : {}
|
|
364
381
|
},
|
|
365
|
-
contentHtml:
|
|
382
|
+
contentHtml: Ce(e.contentHtml, t),
|
|
366
383
|
signingPlacements: n.filter((t) => t.pageId === e.id).map((e) => ({
|
|
367
384
|
id: e.id,
|
|
368
385
|
pageId: e.pageId,
|
|
@@ -376,47 +393,55 @@ function z(e) {
|
|
|
376
393
|
}))
|
|
377
394
|
}));
|
|
378
395
|
}
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
396
|
+
var V = class extends Error {
|
|
397
|
+
constructor(e) {
|
|
398
|
+
super(e[0]?.message || "页面装饰配置无效"), this.errors = e, this.name = "ContractTemplatePageDecorationValidationError";
|
|
399
|
+
}
|
|
400
|
+
};
|
|
401
|
+
function ge(e) {
|
|
402
|
+
let t = m(e.pageDecorations, e.variables);
|
|
403
|
+
if (t.length) throw new V(t);
|
|
404
|
+
let n = T(e);
|
|
405
|
+
return n.pageDecorations &&= p(n.pageDecorations), {
|
|
406
|
+
...n,
|
|
407
|
+
rendererVersion: v,
|
|
408
|
+
styleVersion: y,
|
|
409
|
+
html: z(n)
|
|
386
410
|
};
|
|
387
411
|
}
|
|
388
|
-
function
|
|
389
|
-
let n = [], r = /* @__PURE__ */ new
|
|
412
|
+
function H(e, t = {}) {
|
|
413
|
+
let n = [], r = /* @__PURE__ */ new Set();
|
|
390
414
|
typeof t.maxPages == "number" && e.pages.length > t.maxPages && n.push({
|
|
391
415
|
type: "page",
|
|
392
416
|
id: e.pages[t.maxPages]?.id ?? e.pages.at(-1)?.id ?? "",
|
|
393
417
|
pageId: e.pages[t.maxPages]?.id,
|
|
394
418
|
code: "PAGE_LIMIT_EXCEEDED",
|
|
395
419
|
message: `合同共 ${e.pages.length} 页,超过最多 ${t.maxPages} 页限制`
|
|
396
|
-
}), e.variables.forEach((
|
|
397
|
-
|
|
420
|
+
}), e.variables.forEach((t) => {
|
|
421
|
+
let i = x(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
|
+
i && (!a || t.key !== t.key.trim()) && n.push({
|
|
398
423
|
type: "variable",
|
|
399
|
-
id:
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
type: "variable",
|
|
405
|
-
id: e.id,
|
|
406
|
-
message: `变量标识 ${e.key} 重复`
|
|
407
|
-
}), r.set(e.key, e.id);
|
|
408
|
-
}
|
|
409
|
-
I(e.type) && n.push({
|
|
424
|
+
id: t.id,
|
|
425
|
+
variableKey: t.key,
|
|
426
|
+
message: t.key?.trim() ? i : `${t.label || "变量"} 缺少变量标识`,
|
|
427
|
+
code: t.key?.trim() ? "VARIABLE_KEY_INVALID" : "VARIABLE_KEY_MISSING"
|
|
428
|
+
}), t.key && (r.has(t.key) && n.push({
|
|
410
429
|
type: "variable",
|
|
411
|
-
id:
|
|
412
|
-
variableKey:
|
|
413
|
-
message:
|
|
430
|
+
id: t.id,
|
|
431
|
+
variableKey: t.key,
|
|
432
|
+
message: `变量标识 ${t.key} 重复`,
|
|
433
|
+
code: "VARIABLE_KEY_DUPLICATED"
|
|
434
|
+
}), r.add(t.key)), R(t.type) && n.push({
|
|
435
|
+
type: "variable",
|
|
436
|
+
id: t.id,
|
|
437
|
+
variableKey: t.key,
|
|
438
|
+
message: `${t.label || t.key || "变量"} 不是正文填写变量`,
|
|
414
439
|
code: "VARIABLE_TYPE_UNSUPPORTED"
|
|
415
440
|
});
|
|
416
441
|
});
|
|
417
|
-
let i = new Set(e.variables.map((e) => e.key).filter(Boolean)), a = /* @__PURE__ */ new Set();
|
|
442
|
+
let i = new Set(e.variables.map((e) => e.key).filter(Boolean)), a = /* @__PURE__ */ new Set(), o = f(e.pageDecorations);
|
|
418
443
|
return e.pages.forEach((e) => {
|
|
419
|
-
|
|
444
|
+
U(e).forEach((t) => {
|
|
420
445
|
a.add(t), i.has(t) || n.push({
|
|
421
446
|
type: "variable",
|
|
422
447
|
id: e.id,
|
|
@@ -424,19 +449,19 @@ function V(e, t = {}) {
|
|
|
424
449
|
});
|
|
425
450
|
});
|
|
426
451
|
}), e.variables.forEach((e) => {
|
|
427
|
-
e.key && !a.has(e.key) && n.push({
|
|
452
|
+
e.key && !a.has(e.key) && !o.has(e.key) && n.push({
|
|
428
453
|
type: "variable",
|
|
429
454
|
id: e.id,
|
|
430
455
|
message: `${e.label || e.key} 缺少对应正文变量节点`
|
|
431
456
|
});
|
|
432
|
-
}), n.push(...
|
|
457
|
+
}), n.push(...m(e.pageDecorations, e.variables)), n.push(...ne(e)), n;
|
|
433
458
|
}
|
|
434
|
-
function
|
|
459
|
+
function U(e) {
|
|
435
460
|
let t = /* @__PURE__ */ new Set();
|
|
436
461
|
function n(e) {
|
|
437
462
|
if (!e || typeof e != "object") return;
|
|
438
463
|
let r = e;
|
|
439
|
-
|
|
464
|
+
_e(r.type) && r.attrs?.key && t.add(r.attrs.key), r.content?.forEach(n);
|
|
440
465
|
}
|
|
441
466
|
n(e.contentJson);
|
|
442
467
|
let r = e.contentHtml || "", i = /data-template-variable=["']true["'][^>]*data-key=["']([^"']+)["']|data-key=["']([^"']+)["'][^>]*data-template-variable=["']true["']/g, a = i.exec(r);
|
|
@@ -446,23 +471,23 @@ function H(e) {
|
|
|
446
471
|
}
|
|
447
472
|
return t;
|
|
448
473
|
}
|
|
449
|
-
function
|
|
474
|
+
function _e(e) {
|
|
450
475
|
return e === "templateVariable" || e === "templateField";
|
|
451
476
|
}
|
|
452
477
|
function W(e) {
|
|
453
478
|
let t = /* @__PURE__ */ new Set();
|
|
454
479
|
return e.pages.forEach((e) => {
|
|
455
|
-
|
|
480
|
+
U(e).forEach((e) => t.add(e));
|
|
456
481
|
}), t;
|
|
457
482
|
}
|
|
458
|
-
function
|
|
459
|
-
let t = W(e);
|
|
483
|
+
function ve(e) {
|
|
484
|
+
let t = W(e), n = f(e.pageDecorations);
|
|
460
485
|
return {
|
|
461
486
|
...e,
|
|
462
|
-
variables: e.variables.filter((
|
|
487
|
+
variables: e.variables.filter((r) => x(r.key, e.variables, r.id) ? !0 : t.has(r.key) || n.has(r.key))
|
|
463
488
|
};
|
|
464
489
|
}
|
|
465
|
-
function
|
|
490
|
+
function ye(e, t, n) {
|
|
466
491
|
let r = e ?? [];
|
|
467
492
|
if (r.length <= 1 || n <= 0) return;
|
|
468
493
|
let i = Math.min(r.length, t.length), a = -1;
|
|
@@ -479,39 +504,43 @@ function ue(e, t, n) {
|
|
|
479
504
|
overflowContent: r.slice(a)
|
|
480
505
|
};
|
|
481
506
|
}
|
|
482
|
-
function G(e, t) {
|
|
483
|
-
let
|
|
507
|
+
function G(e, t, n, r, i) {
|
|
508
|
+
let a = d(e.pageDecorations, n + 1, e.pages.length, e.variables, i);
|
|
509
|
+
return `<section ${K(t, e.pageSize, e.pageDecorations, n + 1)}>${a}<div class="gd-contract-template-page__content">${r}</div></section>`;
|
|
510
|
+
}
|
|
511
|
+
function K(e, t, n, r = 1) {
|
|
512
|
+
let a = O(e.pageSize, t);
|
|
484
513
|
return [
|
|
485
|
-
|
|
514
|
+
`class="${ae(n, r)}"`,
|
|
486
515
|
`data-page-id="${i(e.id)}"`,
|
|
487
|
-
`data-page-format="${i(
|
|
488
|
-
`data-page-label="${i(
|
|
489
|
-
`data-page-width="${
|
|
490
|
-
`data-page-height="${
|
|
516
|
+
`data-page-format="${i(a.format ?? "Custom")}"`,
|
|
517
|
+
`data-page-label="${i(a.label ?? a.format ?? "自定义")}"`,
|
|
518
|
+
`data-page-width="${a.width}"`,
|
|
519
|
+
`data-page-height="${a.height}"`
|
|
491
520
|
].join(" ");
|
|
492
521
|
}
|
|
493
|
-
var
|
|
494
|
-
function
|
|
522
|
+
var be = /<span\b[^>]*data-template-variable=["']true["'][^>]*>/g;
|
|
523
|
+
function xe(e) {
|
|
495
524
|
let i = /* @__PURE__ */ new Map();
|
|
496
525
|
function a(e) {
|
|
497
526
|
if (!e.key) return;
|
|
498
527
|
let t = i.get(e.key);
|
|
499
|
-
(!t ||
|
|
528
|
+
(!t || R(e.type) && !R(t.type)) && i.set(e.key, e);
|
|
500
529
|
}
|
|
501
530
|
function s(e) {
|
|
502
531
|
if (!e || typeof e != "object") return;
|
|
503
532
|
let t = e;
|
|
504
|
-
t.type === "templateVariable" && typeof t.attrs?.key == "string" && a(
|
|
533
|
+
t.type === "templateVariable" && typeof t.attrs?.key == "string" && a(Se(t.attrs, t.attrs.key)), t.content?.forEach(s);
|
|
505
534
|
}
|
|
506
535
|
s(e.contentJson);
|
|
507
536
|
let c = e.contentHtml || "";
|
|
508
537
|
return t() ? new DOMParser().parseFromString(c, "text/html").querySelectorAll("[data-template-variable]").forEach((e) => {
|
|
509
|
-
a(
|
|
510
|
-
}) : o(c,
|
|
511
|
-
a(
|
|
538
|
+
a(q(n(e)));
|
|
539
|
+
}) : o(c, be, (e) => {
|
|
540
|
+
a(q(r(e)));
|
|
512
541
|
}), Array.from(i.values());
|
|
513
542
|
}
|
|
514
|
-
function
|
|
543
|
+
function q(e) {
|
|
515
544
|
let t = e("data-key") ?? "", n = e("data-variable-type"), r = e("data-precision"), i = e("data-use-grouping");
|
|
516
545
|
return {
|
|
517
546
|
key: t,
|
|
@@ -545,7 +574,7 @@ function K(e) {
|
|
|
545
574
|
}
|
|
546
575
|
};
|
|
547
576
|
}
|
|
548
|
-
function
|
|
577
|
+
function Se(e, t) {
|
|
549
578
|
let n = (t) => typeof e[t] == "string" ? e[t] : void 0;
|
|
550
579
|
return {
|
|
551
580
|
key: t,
|
|
@@ -579,20 +608,20 @@ function pe(e, t) {
|
|
|
579
608
|
}
|
|
580
609
|
};
|
|
581
610
|
}
|
|
582
|
-
function
|
|
611
|
+
function Ce(e, n) {
|
|
583
612
|
if (!e) return e;
|
|
584
613
|
if (t()) {
|
|
585
614
|
let t = new DOMParser().parseFromString(e, "text/html");
|
|
586
|
-
return
|
|
587
|
-
|
|
615
|
+
return we(t), t.querySelectorAll("[data-template-variable]").forEach((e) => {
|
|
616
|
+
Te(e, n);
|
|
588
617
|
}), t.body.innerHTML;
|
|
589
618
|
}
|
|
590
|
-
return u(
|
|
619
|
+
return u(De(e), (e, t) => {
|
|
591
620
|
let i = r(t);
|
|
592
|
-
return i("data-key") ?
|
|
621
|
+
return i("data-key") ? Ee(i, n) : e;
|
|
593
622
|
});
|
|
594
623
|
}
|
|
595
|
-
function
|
|
624
|
+
function we(e) {
|
|
596
625
|
e.querySelectorAll("script,style,meta,link").forEach((e) => e.remove()), e.querySelectorAll("*").forEach((e) => {
|
|
597
626
|
Array.from(e.attributes).forEach((t) => {
|
|
598
627
|
let n = t.name.toLowerCase(), r = t.value;
|
|
@@ -609,7 +638,7 @@ function q(e) {
|
|
|
609
638
|
});
|
|
610
639
|
}
|
|
611
640
|
function J(e, t) {
|
|
612
|
-
let n = e("data-key") ?? "", r = t.get(n), i = r?.type ?? e("data-variable-type") ?? "text", a =
|
|
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 = ie({
|
|
613
642
|
type: i,
|
|
614
643
|
width: r?.width ?? e("data-width"),
|
|
615
644
|
height: r?.height ?? e("data-height"),
|
|
@@ -623,7 +652,7 @@ function J(e, t) {
|
|
|
623
652
|
multiline: r?.multiline ?? c(e("data-multiline")) ?? !1,
|
|
624
653
|
rows: r?.rows ?? e("data-rows"),
|
|
625
654
|
lineHeight: r?.lineHeight ?? e("data-line-height"),
|
|
626
|
-
style:
|
|
655
|
+
style: Oe(r, e)
|
|
627
656
|
});
|
|
628
657
|
return {
|
|
629
658
|
key: n,
|
|
@@ -632,18 +661,18 @@ function J(e, t) {
|
|
|
632
661
|
text: o.type === "image" && o.hasDefaultValue ? " " : o.displayText || " "
|
|
633
662
|
};
|
|
634
663
|
}
|
|
635
|
-
function
|
|
664
|
+
function Te(e, t) {
|
|
636
665
|
let { key: r, label: i, presentation: a, text: o } = J(n(e), t);
|
|
637
666
|
e.setAttribute("data-template-variable", "true"), e.setAttribute("data-key", r), e.setAttribute("data-label", i), e.setAttribute("data-variable-type", a.type), e.setAttribute("data-width", String(a.width)), e.setAttribute("data-height", String(a.height)), e.setAttribute("data-border", String(a.border)), e.setAttribute("data-underline", String(a.underline)), e.setAttribute("data-color", a.color), e.setAttribute("data-background", a.background), e.setAttribute("data-font-size", String(a.fontSize)), e.setAttribute("data-font-family", a.fontFamily), e.setAttribute("data-placeholder-color", a.placeholderColor), e.setAttribute("data-line-color", a.lineColor), e.setAttribute("data-text-align", a.textAlign), e.setAttribute("data-border-style", a.borderStyle), e.setAttribute("data-object-fit", a.objectFit), e.className = a.classes.join(" "), e.setAttribute("style", a.styleText), e.textContent = o;
|
|
638
667
|
}
|
|
639
|
-
function
|
|
668
|
+
function Ee(e, t) {
|
|
640
669
|
let { key: n, label: r, presentation: o, text: s } = J(e, t);
|
|
641
670
|
return `<span data-template-variable="true" data-key="${i(n)}" data-label="${i(r)}" data-variable-type="${i(o.type)}" data-width="${o.width}" data-height="${o.height}" data-border="${o.border}" data-underline="${o.underline}" data-font-family="${i(o.fontFamily)}" class="${i(o.classes.join(" "))}" style="${i(o.styleText)}">${a(s)}</span>`;
|
|
642
671
|
}
|
|
643
|
-
function
|
|
672
|
+
function De(e) {
|
|
644
673
|
return e.replace(/<\s*(script|style|meta|link)\b[\s\S]*?<\s*\/\s*\1\s*>/gi, "").replace(/<\s*(meta|link)\b[^>]*>/gi, "").replace(/\s+on[a-z]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/\s+srcdoc\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/\s+(href|src)\s*=\s*(["'])(.*?)\2/gi, (e, t, n, r) => Y(r) ? "" : ` ${t}=${n}${r}${n}`).replace(/\s+style\s*=\s*(["'])(.*?)\1/gi, (e, t, n) => X(n) ? "" : ` style=${t}${n}${t}`);
|
|
645
674
|
}
|
|
646
|
-
function
|
|
675
|
+
function Oe(e, t) {
|
|
647
676
|
return {
|
|
648
677
|
border: e?.style?.border ?? c(t("data-border")),
|
|
649
678
|
underline: e?.style?.underline ?? c(t("data-underline")),
|
|
@@ -658,7 +687,7 @@ function ve(e, t) {
|
|
|
658
687
|
objectFit: e?.style?.objectFit ?? $(t("data-object-fit"))
|
|
659
688
|
};
|
|
660
689
|
}
|
|
661
|
-
function
|
|
690
|
+
function ke(e, t) {
|
|
662
691
|
return e === "image" && Y(t) ? "" : t;
|
|
663
692
|
}
|
|
664
693
|
function Y(e) {
|
|
@@ -668,7 +697,7 @@ function Y(e) {
|
|
|
668
697
|
function X(e) {
|
|
669
698
|
return /expression\s*\(|javascript:|vbscript:/i.test(e);
|
|
670
699
|
}
|
|
671
|
-
function
|
|
700
|
+
function Ae(e) {
|
|
672
701
|
if (!e) return e;
|
|
673
702
|
if (t()) {
|
|
674
703
|
let t = new DOMParser().parseFromString(e, "text/html");
|
|
@@ -682,30 +711,30 @@ function be(e) {
|
|
|
682
711
|
return n ? `<span${t}>\${{${n}}}</span>` : e;
|
|
683
712
|
});
|
|
684
713
|
}
|
|
685
|
-
function
|
|
714
|
+
function je(e) {
|
|
686
715
|
return e === "left" || e === "center" || e === "right";
|
|
687
716
|
}
|
|
688
|
-
function
|
|
717
|
+
function Me(e) {
|
|
689
718
|
return e === "solid" || e === "dashed";
|
|
690
719
|
}
|
|
691
|
-
function
|
|
720
|
+
function Ne(e) {
|
|
692
721
|
return e === "contain" || e === "cover" || e === "fill";
|
|
693
722
|
}
|
|
694
723
|
function Z(e) {
|
|
695
|
-
return
|
|
724
|
+
return je(e) ? e : void 0;
|
|
696
725
|
}
|
|
697
726
|
function Q(e) {
|
|
698
|
-
return
|
|
727
|
+
return Me(e) ? e : void 0;
|
|
699
728
|
}
|
|
700
729
|
function $(e) {
|
|
701
|
-
return
|
|
730
|
+
return Ne(e) ? e : void 0;
|
|
702
731
|
}
|
|
703
|
-
function
|
|
704
|
-
let n = [...t, ...
|
|
732
|
+
function Pe(e, t = []) {
|
|
733
|
+
let n = [...t, ...H(e)], r = /* @__PURE__ */ new Set();
|
|
705
734
|
return n.filter((e) => {
|
|
706
735
|
let t = `${e.code ?? ""}|${e.id}|${e.pageId ?? ""}|${e.message}`;
|
|
707
736
|
return r.has(t) ? !1 : (r.add(t), !0);
|
|
708
737
|
});
|
|
709
738
|
}
|
|
710
739
|
//#endregion
|
|
711
|
-
export {
|
|
740
|
+
export { v as CONTRACT_TEMPLATE_RENDERER_VERSION, ce 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, S 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, T 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, w as createDesignerId, L as createTemplateVariable, ge as exportTemplateValue, j as findPageSizeOption, I as getFieldOption, k as getPageSizeKey, E as getPageSizeOption, D as inferPageFormat, le as normalizeContractTemplateMaxPages, A as normalizePageSizeOptions, pe as normalizeTemplateValue, O as resolvePageSize, ye as splitPageContentByMeasurements, ve as syncTemplateVariablesWithPages, x as validateContractTemplateVariableKey, H as validateTemplateValue };
|