@guodun/antdv 1.4.3 → 1.4.5
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/ContractSigningLocation.vue.mjs +85 -85
- package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +1 -1
- 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/location-rules.mjs +2 -2
- package/dist/es/components/contract-signing-location/src/template-source.mjs +52 -36
- package/dist/es/components/contract-signing-location/style/index.css +1 -1
- package/dist/es/components/dept-selector/src/dept.mjs +170 -142
- package/dist/es/components/index.mjs +2 -1
- package/dist/es/components/pro-contract-template-designer/index.mjs +2 -1
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +372 -185
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +59 -42
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +4 -4
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +218 -85
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.mjs +5 -0
- package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.mjs +97 -0
- package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +50 -50
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +948 -887
- package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +550 -245
- package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +225 -150
- package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +53 -35
- package/dist/es/components/pro-contract-template-designer/src/types.mjs +15 -2
- package/dist/es/components/pro-contract-template-designer/src/utils/advanced-controls.mjs +91 -0
- 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 +168 -137
- package/dist/es/components/pro-contract-template-designer/src/utils/template-tool-icons.mjs +23 -16
- package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/es/components/pro-selector/src/components/org-tree.mjs +130 -89
- package/dist/es/components/pro-selector/src/components/user.mjs +34 -26
- package/dist/es/components/pro-selector/src/pro-user.mjs +86 -72
- package/dist/es/components/pro-selector/src/types.mjs +4 -1
- package/dist/es/components/pro-selector/src/utils/orgTree.mjs +5 -2
- package/dist/es/components/pro-selector-group/src/compoents/dept-tree.vue.mjs +92 -65
- package/dist/es/components/pro-selector-group/src/compoents/dept.vue.mjs +3 -3
- package/dist/es/components/pro-selector-group/src/compoents/role.vue.mjs +98 -73
- package/dist/es/components/pro-selector-group/src/compoents/select-box.vue.mjs +12 -9
- package/dist/es/components/pro-selector-group/src/compoents/user.vue.mjs +101 -72
- package/dist/es/components/pro-selector-group/src/hooks/useApi.mjs +39 -22
- package/dist/es/components/pro-selector-group/src/index.vue.mjs +105 -83
- package/dist/es/components/pro-selector-group/src/utils/index.mjs +36 -0
- package/dist/es/components/role-selector/src/role.mjs +134 -120
- package/dist/es/index.mjs +50 -49
- package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
- 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/location-rules.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/dept-selector/src/dept.cjs +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/ContractTemplateDesignerInspector.vue.cjs +2 -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/ContractTemplateRendererField.vue.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.cjs +1 -0
- package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.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/ProContractTemplateRenderer.vue.cjs +1 -1
- 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/extensions/template-variable.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/types.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/src/utils/advanced-controls.cjs +1 -0
- 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 +3 -3
- package/dist/lib/components/pro-contract-template-designer/src/utils/template-tool-icons.cjs +1 -1
- package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
- package/dist/lib/components/pro-selector/src/components/org-tree.cjs +1 -1
- package/dist/lib/components/pro-selector/src/components/user.cjs +1 -1
- package/dist/lib/components/pro-selector/src/pro-user.cjs +1 -1
- package/dist/lib/components/pro-selector/src/types.cjs +1 -1
- package/dist/lib/components/pro-selector/src/utils/orgTree.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/dept-tree.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/dept.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/role.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/select-box.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/compoents/user.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/hooks/useApi.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
- package/dist/lib/components/pro-selector-group/src/utils/index.cjs +1 -0
- package/dist/lib/components/role-selector/src/role.cjs +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/theme/contract-signing-location.css +1 -1
- package/dist/theme/dept-selector.css +1 -1
- package/dist/theme/icon.css +1 -1
- package/dist/theme/index.css +1 -1
- package/dist/theme/pro-selector-group.css +1 -1
- package/dist/theme/pro-selector.css +1 -1
- package/dist/theme/role-selector.css +1 -1
- package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +3 -3
- 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 +6 -0
- package/dist/types/components/contract-signing-location/src/template-source.d.ts +17 -0
- package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +1 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +3 -0
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.d.ts +7 -1
- package/dist/types/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.d.ts +14 -0
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +13 -1
- package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +11 -1
- package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +4 -0
- package/dist/types/components/pro-contract-template-designer/src/extensions/template-variable.d.ts +11 -1
- package/dist/types/components/pro-contract-template-designer/src/types.d.ts +131 -2
- package/dist/types/components/pro-contract-template-designer/src/utils/advanced-controls.d.ts +15 -0
- package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +10 -2
- package/dist/types/components/pro-selector/index.d.ts +9 -0
- package/dist/types/components/pro-selector/src/components/user.d.ts +9 -0
- package/dist/types/components/pro-selector/src/types.d.ts +2 -0
- package/dist/types/components/pro-selector/src/utils/orgTree.d.ts +4 -1
- package/dist/types/components/pro-selector-group/src/compoents/select-box.vue.d.ts +4 -4
- package/dist/types/components/pro-selector-group/src/hooks/useApi.d.ts +6 -1
- package/dist/types/components/pro-selector-group/src/utils/index.d.ts +8 -0
- package/package.json +5 -1
package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs
CHANGED
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
import "../constants.mjs";
|
|
2
2
|
import { resolveTemplateVariablePresentation as e } from "../utils/template-variable-render.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { decodeContractTemplateJsonAttribute as t, encodeContractTemplateJsonAttribute as n } from "../utils/advanced-controls.mjs";
|
|
4
|
+
import { Node as r, mergeAttributes as i } from "@tiptap/core";
|
|
4
5
|
//#region src/components/pro-contract-template-designer/src/extensions/template-variable.ts
|
|
5
|
-
function
|
|
6
|
+
function a(e, t, n = "") {
|
|
6
7
|
return {
|
|
7
8
|
default: n,
|
|
8
9
|
parseHTML: (e) => e.getAttribute(t) ?? n,
|
|
9
10
|
renderHTML: (n) => ({ [t]: n[e] })
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
+
function o(e, t, n) {
|
|
13
14
|
return {
|
|
14
15
|
default: n,
|
|
15
16
|
parseHTML: (e) => Number(e.getAttribute(t) || n),
|
|
16
17
|
renderHTML: (n) => ({ [t]: n[e] })
|
|
17
18
|
};
|
|
18
19
|
}
|
|
19
|
-
function
|
|
20
|
+
function s(e, t) {
|
|
20
21
|
return {
|
|
21
22
|
default: !1,
|
|
22
23
|
parseHTML: (e) => e.getAttribute(t) === "true",
|
|
23
24
|
renderHTML: (n) => ({ [t]: String(!!n[e]) })
|
|
24
25
|
};
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
+
function c(e, r, i) {
|
|
28
|
+
return {
|
|
29
|
+
default: i,
|
|
30
|
+
parseHTML: (e) => t(e.getAttribute(r)) ?? i,
|
|
31
|
+
renderHTML: (t) => t[e] === void 0 || t[e] === null ? {} : { [r]: n(t[e]) }
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
var l = r.create({
|
|
27
35
|
name: "templateVariable",
|
|
28
36
|
group: "inline",
|
|
29
37
|
inline: !0,
|
|
@@ -32,19 +40,19 @@ var o = t.create({
|
|
|
32
40
|
draggable: !0,
|
|
33
41
|
addAttributes() {
|
|
34
42
|
return {
|
|
35
|
-
key:
|
|
43
|
+
key: a("key", "data-key"),
|
|
36
44
|
label: {
|
|
37
45
|
default: "",
|
|
38
46
|
parseHTML: (e) => e.getAttribute("data-label") ?? e.textContent ?? "",
|
|
39
47
|
renderHTML: (e) => ({ "data-label": e.label })
|
|
40
48
|
},
|
|
41
|
-
type:
|
|
42
|
-
placeholder:
|
|
43
|
-
width:
|
|
44
|
-
height:
|
|
45
|
-
required:
|
|
46
|
-
defaultValue:
|
|
47
|
-
format:
|
|
49
|
+
type: a("type", "data-variable-type", "text"),
|
|
50
|
+
placeholder: a("placeholder", "data-placeholder"),
|
|
51
|
+
width: o("width", "data-width", 160),
|
|
52
|
+
height: o("height", "data-height", 32),
|
|
53
|
+
required: s("required", "data-required"),
|
|
54
|
+
defaultValue: a("defaultValue", "data-default-value"),
|
|
55
|
+
format: a("format", "data-format"),
|
|
48
56
|
precision: {
|
|
49
57
|
default: void 0,
|
|
50
58
|
parseHTML: (e) => {
|
|
@@ -61,37 +69,42 @@ var o = t.create({
|
|
|
61
69
|
},
|
|
62
70
|
renderHTML: (e) => e.useGrouping === void 0 ? {} : { "data-use-grouping": String(!!e.useGrouping) }
|
|
63
71
|
},
|
|
64
|
-
checkedText:
|
|
65
|
-
uncheckedText:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
checkedText: a("checkedText", "data-checked-text"),
|
|
73
|
+
uncheckedText: a("uncheckedText", "data-unchecked-text"),
|
|
74
|
+
options: c("options", "data-control-options", []),
|
|
75
|
+
dataSource: c("dataSource", "data-control-source", void 0),
|
|
76
|
+
multiple: s("multiple", "data-multiple"),
|
|
77
|
+
componentKey: a("componentKey", "data-component-key"),
|
|
78
|
+
componentConfig: c("componentConfig", "data-component-config", {}),
|
|
79
|
+
multiline: s("multiline", "data-multiline"),
|
|
80
|
+
rows: o("rows", "data-rows", 3),
|
|
81
|
+
lineHeight: o("lineHeight", "data-line-height", 28),
|
|
82
|
+
border: s("border", "data-border"),
|
|
83
|
+
underline: s("underline", "data-underline"),
|
|
84
|
+
color: a("color", "data-color", "#1f2937"),
|
|
85
|
+
background: a("background", "data-background", "transparent"),
|
|
86
|
+
fontSize: o("fontSize", "data-font-size", 14),
|
|
74
87
|
fontFamily: {
|
|
75
88
|
default: "",
|
|
76
89
|
parseHTML: (e) => e.getAttribute("data-font-family") ?? "",
|
|
77
90
|
renderHTML: (e) => e.fontFamily ? { "data-font-family": e.fontFamily } : {}
|
|
78
91
|
},
|
|
79
|
-
placeholderColor:
|
|
80
|
-
lineColor:
|
|
81
|
-
textAlign:
|
|
82
|
-
borderStyle:
|
|
83
|
-
objectFit:
|
|
92
|
+
placeholderColor: a("placeholderColor", "data-placeholder-color", "#7a818b"),
|
|
93
|
+
lineColor: a("lineColor", "data-line-color", "#565b66"),
|
|
94
|
+
textAlign: a("textAlign", "data-text-align", "left"),
|
|
95
|
+
borderStyle: a("borderStyle", "data-border-style", "solid"),
|
|
96
|
+
objectFit: a("objectFit", "data-object-fit", "contain")
|
|
84
97
|
};
|
|
85
98
|
},
|
|
86
99
|
parseHTML() {
|
|
87
100
|
return [{ tag: "span[data-template-variable]" }];
|
|
88
101
|
},
|
|
89
102
|
renderHTML({ HTMLAttributes: t }) {
|
|
90
|
-
let
|
|
103
|
+
let n = t["data-border"] ?? t.border, r = t["data-precision"] ?? t.precision, a = r === void 0 || r === "" ? void 0 : Number(r), o = t["data-use-grouping"] ?? t.useGrouping, s = o === void 0 || o === "" ? void 0 : o === !0 || o === "true", c = e({
|
|
91
104
|
type: String(t["data-variable-type"] || t.type || "text"),
|
|
92
105
|
width: t["data-width"] || t.width || 160,
|
|
93
106
|
height: t["data-height"] || t.height || 32,
|
|
94
|
-
border:
|
|
107
|
+
border: n === !0 || n === "true",
|
|
95
108
|
underline: t["data-underline"] === "true" || t.underline === !0,
|
|
96
109
|
color: String(t["data-color"] || t.color || "#1f2937"),
|
|
97
110
|
background: String(t["data-background"] || t.background || "transparent"),
|
|
@@ -115,7 +128,7 @@ var o = t.create({
|
|
|
115
128
|
});
|
|
116
129
|
return [
|
|
117
130
|
"span",
|
|
118
|
-
|
|
131
|
+
i(t, {
|
|
119
132
|
"data-template-variable": "true",
|
|
120
133
|
"data-variable-type": c.type,
|
|
121
134
|
"data-width": String(c.width),
|
|
@@ -141,7 +154,7 @@ var o = t.create({
|
|
|
141
154
|
];
|
|
142
155
|
}
|
|
143
156
|
});
|
|
144
|
-
function
|
|
157
|
+
function u(e) {
|
|
145
158
|
return {
|
|
146
159
|
key: e.key,
|
|
147
160
|
label: e.label,
|
|
@@ -156,6 +169,11 @@ function s(e) {
|
|
|
156
169
|
useGrouping: e.useGrouping,
|
|
157
170
|
checkedText: e.checkedText || "",
|
|
158
171
|
uncheckedText: e.uncheckedText || "",
|
|
172
|
+
options: e.options?.map((e) => ({ ...e })) ?? [],
|
|
173
|
+
dataSource: e.dataSource ? { ...e.dataSource } : void 0,
|
|
174
|
+
multiple: !!e.multiple,
|
|
175
|
+
componentKey: e.componentKey || "",
|
|
176
|
+
componentConfig: e.componentConfig ? { ...e.componentConfig } : {},
|
|
159
177
|
multiline: !!e.multiline,
|
|
160
178
|
rows: Math.max(1, Math.round(e.rows ?? 3)),
|
|
161
179
|
lineHeight: Math.max(18, Math.round(e.lineHeight ?? 28)),
|
|
@@ -172,13 +190,13 @@ function s(e) {
|
|
|
172
190
|
objectFit: e.style?.objectFit || "contain"
|
|
173
191
|
};
|
|
174
192
|
}
|
|
175
|
-
function
|
|
193
|
+
function d(e, t, n) {
|
|
176
194
|
if (!e) return !1;
|
|
177
195
|
let r = {
|
|
178
196
|
type: "templateVariable",
|
|
179
|
-
attrs:
|
|
197
|
+
attrs: u(t)
|
|
180
198
|
}, i = e.chain().focus();
|
|
181
199
|
return typeof n == "number" ? i.insertContentAt(n, r).run() : i.insertContent(r).run();
|
|
182
200
|
}
|
|
183
201
|
//#endregion
|
|
184
|
-
export {
|
|
202
|
+
export { l as TemplateVariable, u as buildTemplateVariableAttrs, d as insertTemplateVariableNode };
|
|
@@ -4,10 +4,23 @@ var e = [
|
|
|
4
4
|
"date",
|
|
5
5
|
"number",
|
|
6
6
|
"image",
|
|
7
|
-
"checkbox"
|
|
7
|
+
"checkbox",
|
|
8
|
+
"select",
|
|
9
|
+
"radio",
|
|
10
|
+
"user-selector",
|
|
11
|
+
"dept-selector",
|
|
12
|
+
"role-selector",
|
|
13
|
+
"org-selector",
|
|
14
|
+
"custom"
|
|
8
15
|
];
|
|
9
16
|
function t(t) {
|
|
10
17
|
return typeof t == "string" && e.includes(t);
|
|
11
18
|
}
|
|
19
|
+
function n(e) {
|
|
20
|
+
return e === "select" || e === "radio";
|
|
21
|
+
}
|
|
22
|
+
function r(e) {
|
|
23
|
+
return e === "user-selector" || e === "dept-selector" || e === "role-selector" || e === "org-selector";
|
|
24
|
+
}
|
|
12
25
|
//#endregion
|
|
13
|
-
export { t as isContractTemplateFieldType };
|
|
26
|
+
export { n as isContractTemplateAdvancedChoiceFieldType, r as isContractTemplateBuiltinSelectorFieldType, t as isContractTemplateFieldType };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
//#region src/components/pro-contract-template-designer/src/utils/advanced-controls.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
if (!e || typeof e != "object" || Array.isArray(e)) return !1;
|
|
4
|
+
let t = e;
|
|
5
|
+
return (typeof t.value == "string" || typeof t.value == "number") && typeof t.label == "string" && typeof t.type == "string";
|
|
6
|
+
}
|
|
7
|
+
function t(t, r) {
|
|
8
|
+
if (e(t)) return {
|
|
9
|
+
...n(t),
|
|
10
|
+
value: t.value,
|
|
11
|
+
label: t.label,
|
|
12
|
+
type: t.type || r
|
|
13
|
+
};
|
|
14
|
+
if (typeof t == "string" || typeof t == "number") return {
|
|
15
|
+
value: t,
|
|
16
|
+
label: String(t),
|
|
17
|
+
type: r
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function n(e) {
|
|
21
|
+
let t = {};
|
|
22
|
+
return Object.entries(e).forEach(([e, n]) => {
|
|
23
|
+
if (!(e === "value" || e === "label" || e === "type")) try {
|
|
24
|
+
JSON.stringify(n), t[e] = n;
|
|
25
|
+
} catch {}
|
|
26
|
+
}), t;
|
|
27
|
+
}
|
|
28
|
+
function r(e, n, r) {
|
|
29
|
+
let i = (Array.isArray(e) ? e : e == null || e === "" ? [] : [e]).map((e) => t(e, n)).filter(Boolean);
|
|
30
|
+
return r ? i : i[0];
|
|
31
|
+
}
|
|
32
|
+
function i(t) {
|
|
33
|
+
return Array.isArray(t) ? t.map((e) => e.displayText || e.label || String(e.value)).filter(Boolean).join("、") : e(t) ? t.displayText || t.label || String(t.value) : t == null ? "" : String(t);
|
|
34
|
+
}
|
|
35
|
+
function a(e) {
|
|
36
|
+
try {
|
|
37
|
+
return encodeURIComponent(JSON.stringify(e ?? null));
|
|
38
|
+
} catch {
|
|
39
|
+
return "";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function o(e) {
|
|
43
|
+
if (!(typeof e != "string" || !e)) try {
|
|
44
|
+
return JSON.parse(decodeURIComponent(e));
|
|
45
|
+
} catch {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function s(e, t, n) {
|
|
50
|
+
let r = u(e, t?.dataPath), i = Array.isArray(r) ? r : [], a = t?.valueField || "value", o = t?.labelField || "label";
|
|
51
|
+
return i.flatMap((e) => {
|
|
52
|
+
if (!e || typeof e != "object") return [];
|
|
53
|
+
let t = e, r = t[a];
|
|
54
|
+
return typeof r != "string" && typeof r != "number" ? [] : [{
|
|
55
|
+
value: r,
|
|
56
|
+
label: String(t[o] ?? r),
|
|
57
|
+
type: typeof t.type == "string" && t.type ? t.type : n,
|
|
58
|
+
...typeof t.disabled == "boolean" ? { disabled: t.disabled } : {}
|
|
59
|
+
}];
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
function c(e, t) {
|
|
63
|
+
let n = e.trim();
|
|
64
|
+
if (/^\/(?!\/)/.test(n)) return !0;
|
|
65
|
+
try {
|
|
66
|
+
let e = new URL(n);
|
|
67
|
+
return e.protocol !== "https:" && e.protocol !== "http:" ? !1 : t.some((t) => {
|
|
68
|
+
try {
|
|
69
|
+
return new URL(t).origin === e.origin;
|
|
70
|
+
} catch {
|
|
71
|
+
return !1;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
} catch {
|
|
75
|
+
return !1;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function l(e, t = 1e4) {
|
|
79
|
+
let n = Number.isFinite(t) ? Math.max(500, Math.floor(t)) : 1e4, r = Number(e);
|
|
80
|
+
return Number.isFinite(r) ? Math.min(n, Math.max(500, Math.floor(r))) : n;
|
|
81
|
+
}
|
|
82
|
+
function u(e, t) {
|
|
83
|
+
return t ? t.split(".").filter(Boolean).reduce((e, t) => {
|
|
84
|
+
if (!(!e || typeof e != "object" || Array.isArray(e))) return e[t];
|
|
85
|
+
}, e) : e;
|
|
86
|
+
}
|
|
87
|
+
function d(e) {
|
|
88
|
+
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
89
|
+
}
|
|
90
|
+
//#endregion
|
|
91
|
+
export { o as decodeContractTemplateJsonAttribute, a as encodeContractTemplateJsonAttribute, i as formatContractTemplateRenderValue, c as isAllowedContractTemplateRemoteUrl, e as isContractTemplateSelectionValue, s as normalizeContractTemplateControlOptions, d as normalizeContractTemplateJsonObject, l as normalizeContractTemplateRequestTimeout, t as normalizeContractTemplateSelectionValue, r as normalizeContractTemplateSelectionValues };
|
|
@@ -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();
|