@guodun/antdv 1.3.2 → 1.4.1

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 (111) hide show
  1. package/dist/es/components/contract-signing-location/index.mjs +1 -0
  2. package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +311 -289
  3. package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +337 -326
  4. package/dist/es/components/contract-signing-location/src/ContractSigningLocationInspector.vue.mjs +3 -2
  5. package/dist/es/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.mjs +41 -33
  6. package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.mjs +5 -0
  7. package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +23 -0
  8. package/dist/es/components/contract-signing-location/src/location-rules.mjs +115 -77
  9. package/dist/es/components/contract-signing-location/src/template-source.mjs +85 -0
  10. package/dist/es/components/contract-signing-location/style/index.css +1 -1
  11. package/dist/es/components/index.mjs +8 -6
  12. package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.mjs +164 -57
  13. package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.mjs +132 -126
  14. package/dist/es/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.mjs +75 -49
  15. package/dist/es/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.mjs +136 -91
  16. package/dist/es/components/pro-contract-signing-flow/src/constants.mjs +25 -5
  17. package/dist/es/components/pro-contract-signing-flow/style/index.css +1 -1
  18. package/dist/es/components/pro-contract-template-designer/index.mjs +5 -4
  19. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.mjs +5 -0
  20. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +347 -0
  21. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.mjs +5 -0
  22. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +171 -0
  23. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateFileBar.mjs +5 -0
  24. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.mjs +166 -0
  25. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +4 -4
  26. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.mjs +5 -0
  27. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.mjs +36 -0
  28. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +202 -202
  29. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1591 -1612
  30. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +235 -239
  31. package/dist/es/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.mjs +16 -16
  32. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +166 -166
  33. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-draft-cache.mjs +100 -33
  34. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-files.mjs +77 -0
  35. package/dist/es/components/pro-contract-template-designer/src/extensions/word-paste.mjs +23 -23
  36. package/dist/es/components/pro-contract-template-designer/src/utils/file-tabs.mjs +14 -0
  37. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +121 -121
  38. package/dist/es/components/pro-contract-template-designer/src/utils/toolbar-overflow.mjs +19 -0
  39. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  40. package/dist/es/index.mjs +23 -21
  41. package/dist/lib/components/contract-signing-location/index.cjs +1 -1
  42. package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
  43. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
  44. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationInspector.vue.cjs +1 -1
  45. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationNavigator.vue.cjs +1 -1
  46. package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.cjs +1 -0
  47. package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -0
  48. package/dist/lib/components/contract-signing-location/src/location-rules.cjs +1 -1
  49. package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -0
  50. package/dist/lib/components/contract-signing-location/style/index.css +1 -1
  51. package/dist/lib/components/index.cjs +1 -1
  52. package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.cjs +1 -1
  53. package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowInspector.vue.cjs +1 -1
  54. package/dist/lib/components/pro-contract-signing-flow/src/ContractSigningFlowNodeCard.vue.cjs +1 -1
  55. package/dist/lib/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.cjs +1 -1
  56. package/dist/lib/components/pro-contract-signing-flow/src/constants.cjs +1 -1
  57. package/dist/lib/components/pro-contract-signing-flow/style/index.css +1 -1
  58. package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
  59. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.cjs +1 -0
  60. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -0
  61. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.cjs +1 -0
  62. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -0
  63. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateFileBar.cjs +1 -0
  64. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.cjs +1 -0
  65. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
  66. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.cjs +1 -0
  67. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.cjs +1 -0
  68. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  69. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  70. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
  71. package/dist/lib/components/pro-contract-template-designer/src/SigningPlacementLayer.vue.cjs +1 -1
  72. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +2 -2
  73. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-draft-cache.cjs +1 -1
  74. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-files.cjs +2 -0
  75. package/dist/lib/components/pro-contract-template-designer/src/extensions/word-paste.cjs +1 -1
  76. package/dist/lib/components/pro-contract-template-designer/src/utils/file-tabs.cjs +1 -0
  77. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +2 -2
  78. package/dist/lib/components/pro-contract-template-designer/src/utils/toolbar-overflow.cjs +1 -0
  79. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  80. package/dist/lib/index.cjs +1 -1
  81. package/dist/theme/contract-signing-location.css +1 -1
  82. package/dist/theme/icon.css +1 -1
  83. package/dist/theme/index.css +1 -1
  84. package/dist/theme/pro-contract-signing-flow.css +1 -1
  85. package/dist/types/components/contract-signing-location/index.d.ts +1 -0
  86. package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +4 -1
  87. package/dist/types/components/contract-signing-location/src/ContractSigningLocationInspector.vue.d.ts +3 -2
  88. package/dist/types/components/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +6 -0
  89. package/dist/types/components/contract-signing-location/src/location-rules.d.ts +3 -3
  90. package/dist/types/components/contract-signing-location/src/template-source.d.ts +20 -0
  91. package/dist/types/components/contract-signing-location/src/types.d.ts +49 -2
  92. package/dist/types/components/pro-contract-signing-flow/src/ContractSigningFlowCanvas.vue.d.ts +19 -3
  93. package/dist/types/components/pro-contract-signing-flow/src/ProContractSigningFlow.vue.d.ts +223 -2
  94. package/dist/types/components/pro-contract-signing-flow/src/constants.d.ts +15 -0
  95. package/dist/types/components/pro-contract-signing-flow/src/types.d.ts +14 -0
  96. package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
  97. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +103 -0
  98. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +48 -0
  99. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateFileBar.vue.d.ts +231 -0
  100. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererValidation.vue.d.ts +15 -0
  101. package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +1 -1
  102. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +25 -2
  103. package/dist/types/components/pro-contract-template-designer/src/SigningPlacementInspector.vue.d.ts +2 -2
  104. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +1 -1
  105. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-draft-cache.d.ts +29 -1
  106. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-files.d.ts +24 -0
  107. package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +2 -2
  108. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +59 -1
  109. package/dist/types/components/pro-contract-template-designer/src/utils/file-tabs.d.ts +3 -0
  110. package/dist/types/components/pro-contract-template-designer/src/utils/toolbar-overflow.d.ts +11 -0
  111. package/package.json +4 -3
@@ -1,8 +1,8 @@
1
- import { resolveTemplateVariablePresentation as e } from "./template-variable-render.mjs";
2
- import { isSafeContractImageUrl as t } from "./image-url.mjs";
3
- import { canParseHtmlDocument as n, canUseDomHtml as r, collectFromHtmlTags as i, escapeHtmlAttribute as a, escapeHtmlText as o, getHtmlAttribute as s, hasPositivePageSize as c, replaceTemplateVariableSpans as l } from "./html.mjs";
4
- import { isContractTemplateFieldType as u } from "../types.mjs";
5
- import { DEFAULT_PAGE_SIZE as d, resolvePageSize as f } from "../composables/use-template-designer.mjs";
1
+ import { isContractTemplateFieldType as e } from "../types.mjs";
2
+ import { canParseHtmlDocument as t, canUseDomHtml as n, collectFromHtmlTags as r, escapeHtmlAttribute as i, escapeHtmlText as a, getHtmlAttribute as o, hasPositivePageSize as s, replaceTemplateVariableSpans as c } from "./html.mjs";
3
+ import { resolveTemplateVariablePresentation as l } from "./template-variable-render.mjs";
4
+ import { DEFAULT_PAGE_SIZE as u, resolvePageSize as d } from "../composables/use-template-designer.mjs";
5
+ import { isSafeContractImageUrl as f } from "./image-url.mjs";
6
6
  //#region src/components/pro-contract-template-designer/src/utils/template-renderer.ts
7
7
  var p = new Set([
8
8
  "action",
@@ -23,23 +23,23 @@ function g(e, t) {
23
23
  ...t ?? {}
24
24
  };
25
25
  }
26
- function _(e, n) {
27
- let r = y(e);
28
- if (!e) return r;
29
- let i = Array.isArray(e.variables) ? e.variables : [], a = new Set(i.map((e) => e?.key).filter(Boolean));
30
- return Object.keys(n).forEach((e) => {
31
- a.has(e) || r.push({
26
+ function _(e, t) {
27
+ let n = y(e);
28
+ if (!e) return n;
29
+ let r = Array.isArray(e.variables) ? e.variables : [], i = new Set(r.map((e) => e?.key).filter(Boolean));
30
+ return Object.keys(t).forEach((e) => {
31
+ i.has(e) || n.push({
32
32
  type: "variable",
33
33
  id: e,
34
34
  variableKey: e,
35
35
  message: `提交值 ${e} 不属于模板变量`,
36
36
  code: "VARIABLE_UNKNOWN"
37
37
  });
38
- }), i.forEach((e) => {
38
+ }), r.forEach((e) => {
39
39
  if (!e?.key) return;
40
- let i = n[e.key];
41
- if (e.required && S(i)) {
42
- r.push({
40
+ let r = t[e.key];
41
+ if (e.required && S(r)) {
42
+ n.push({
43
43
  type: "variable",
44
44
  id: e.id,
45
45
  variableKey: e.key,
@@ -48,138 +48,138 @@ function _(e, n) {
48
48
  });
49
49
  return;
50
50
  }
51
- S(i) || (e.type === "number" && (typeof i != "number" || !Number.isFinite(i)) && r.push({
51
+ S(r) || (e.type === "number" && (typeof r != "number" || !Number.isFinite(r)) && n.push({
52
52
  type: "variable",
53
53
  id: e.id,
54
54
  variableKey: e.key,
55
55
  message: `${e.label || e.key} 不是合法数字`,
56
56
  code: "VARIABLE_TYPE_INVALID"
57
- }), e.type === "checkbox" && typeof i != "boolean" && r.push({
57
+ }), e.type === "checkbox" && typeof r != "boolean" && n.push({
58
58
  type: "variable",
59
59
  id: e.id,
60
60
  variableKey: e.key,
61
61
  message: `${e.label || e.key} 不是合法复选值`,
62
62
  code: "VARIABLE_TYPE_INVALID"
63
- }), e.type === "date" && !R(i) && r.push({
63
+ }), e.type === "date" && !R(r) && n.push({
64
64
  type: "variable",
65
65
  id: e.id,
66
66
  variableKey: e.key,
67
67
  message: `${e.label || e.key} 不是合法日期`,
68
68
  code: "VARIABLE_TYPE_INVALID"
69
- }), e.type === "image" && !t(String(i)) && r.push({
69
+ }), e.type === "image" && !f(String(r)) && n.push({
70
70
  type: "security",
71
71
  id: e.id,
72
72
  variableKey: e.key,
73
73
  message: `${e.label || e.key} 不是安全的图片地址`,
74
74
  code: "IMAGE_URL_UNSAFE"
75
75
  }));
76
- }), r;
76
+ }), n;
77
77
  }
78
78
  function v(e, t, n) {
79
79
  return n ? _(e, t) : y(e);
80
80
  }
81
- function y(e) {
82
- if (!e) return [{
81
+ function y(t) {
82
+ if (!t) return [{
83
83
  type: "page",
84
84
  id: "template",
85
85
  message: "缺少可渲染的合同模板",
86
86
  code: "TEMPLATE_MISSING"
87
87
  }];
88
- let t = [], n = Array.isArray(e.pages) ? e.pages : [], r = Array.isArray(e.variables) ? e.variables : [];
89
- (!Array.isArray(e.pages) || n.length === 0) && t.push({
88
+ let n = [], r = Array.isArray(t.pages) ? t.pages : [], i = Array.isArray(t.variables) ? t.variables : [];
89
+ (!Array.isArray(t.pages) || r.length === 0) && n.push({
90
90
  type: "page",
91
91
  id: "template-pages",
92
92
  message: "模板至少需要一个合法页面",
93
93
  code: "TEMPLATE_PAGES_INVALID"
94
- }), Array.isArray(e.variables) || t.push({
94
+ }), Array.isArray(t.variables) || n.push({
95
95
  type: "variable",
96
96
  id: "template-variables",
97
97
  message: "模板变量列表格式无效",
98
98
  code: "TEMPLATE_VARIABLES_INVALID"
99
- }), c(e.pageSize) || t.push({
99
+ }), s(t.pageSize) || n.push({
100
100
  type: "page",
101
101
  id: "template-page-size",
102
102
  message: "模板默认页面尺寸无效,已回退为安全默认尺寸",
103
103
  code: "TEMPLATE_PAGE_SIZE_INVALID"
104
104
  });
105
- let i = /* @__PURE__ */ new Map();
106
- r.forEach((e, n) => {
107
- if (!e || typeof e.key != "string" || !e.key.trim()) {
108
- t.push({
105
+ let a = /* @__PURE__ */ new Map();
106
+ i.forEach((t, r) => {
107
+ if (!t || typeof t.key != "string" || !t.key.trim()) {
108
+ n.push({
109
109
  type: "variable",
110
- id: e?.id || `variable-${n}`,
111
- message: `第 ${n + 1} 个变量缺少有效 key`,
110
+ id: t?.id || `variable-${r}`,
111
+ message: `第 ${r + 1} 个变量缺少有效 key`,
112
112
  code: "VARIABLE_KEY_MISSING"
113
113
  });
114
114
  return;
115
115
  }
116
- i.set(e.key, (i.get(e.key) ?? 0) + 1), u(e.type ?? "text") || t.push({
116
+ a.set(t.key, (a.get(t.key) ?? 0) + 1), e(t.type ?? "text") || n.push({
117
117
  type: "variable",
118
- id: e.id,
119
- variableKey: e.key,
120
- message: `${e.label || e.key} 不是正文填写变量`,
118
+ id: t.id,
119
+ variableKey: t.key,
120
+ message: `${t.label || t.key} 不是正文填写变量`,
121
121
  code: "VARIABLE_TYPE_UNSUPPORTED"
122
122
  });
123
- }), i.forEach((e, n) => {
124
- e > 1 && t.push({
123
+ }), a.forEach((e, t) => {
124
+ e > 1 && n.push({
125
125
  type: "variable",
126
- id: n,
127
- variableKey: n,
128
- message: `变量 key ${n} 重复`,
126
+ id: t,
127
+ variableKey: t,
128
+ message: `变量 key ${t} 重复`,
129
129
  code: "VARIABLE_KEY_DUPLICATED"
130
130
  });
131
131
  });
132
- let a = /* @__PURE__ */ new Set();
133
- return n.forEach((e, n) => {
132
+ let o = /* @__PURE__ */ new Set();
133
+ return r.forEach((e, t) => {
134
134
  if (!e || typeof e.id != "string" || !e.id.trim() || typeof e.contentHtml != "string") {
135
- t.push({
135
+ n.push({
136
136
  type: "page",
137
- id: e?.id || `page-${n}`,
137
+ id: e?.id || `page-${t}`,
138
138
  pageId: e?.id,
139
- message: `第 ${n + 1} 页结构无效,已跳过渲染`,
139
+ message: `第 ${t + 1} 页结构无效,已跳过渲染`,
140
140
  code: "PAGE_INVALID"
141
141
  });
142
142
  return;
143
143
  }
144
- e.pageSize !== void 0 && !c(e.pageSize) && t.push({
144
+ e.pageSize !== void 0 && !s(e.pageSize) && n.push({
145
145
  type: "page",
146
146
  id: `${e.id}-page-size`,
147
147
  pageId: e.id,
148
- message: `${e.title || `第 ${n + 1} 页`}:页面尺寸无效,已回退为安全尺寸`,
148
+ message: `${e.title || `第 ${t + 1} 页`}:页面尺寸无效,已回退为安全尺寸`,
149
149
  code: "PAGE_SIZE_INVALID"
150
- }), N(e.contentHtml).forEach((e) => a.add(e)), P(e.contentHtml).forEach((r, i) => {
151
- t.push({
150
+ }), N(e.contentHtml).forEach((e) => o.add(e)), P(e.contentHtml).forEach((r, i) => {
151
+ n.push({
152
152
  type: "security",
153
153
  id: `${e.id}-security-${i}`,
154
154
  pageId: e.id,
155
- message: `${e.title || `第 ${n + 1} 页`}:${r}`,
155
+ message: `${e.title || `第 ${t + 1} 页`}:${r}`,
156
156
  code: "HTML_UNSAFE"
157
157
  });
158
158
  });
159
- }), a.forEach((e) => {
160
- i.has(e) || t.push({
159
+ }), o.forEach((e) => {
160
+ a.has(e) || n.push({
161
161
  type: "variable",
162
162
  id: e,
163
163
  variableKey: e,
164
164
  message: `正文引用的变量 ${e} 缺少配置`,
165
165
  code: "VARIABLE_CONFIG_MISSING"
166
166
  });
167
- }), i.forEach((e, n) => {
168
- a.has(n) || t.push({
167
+ }), a.forEach((e, t) => {
168
+ o.has(t) || n.push({
169
169
  type: "variable",
170
- id: n,
171
- variableKey: n,
172
- message: `变量 ${n} 缺少正文节点`,
170
+ id: t,
171
+ variableKey: t,
172
+ message: `变量 ${t} 缺少正文节点`,
173
173
  code: "VARIABLE_NODE_MISSING"
174
174
  });
175
- }), t;
175
+ }), n;
176
176
  }
177
177
  function b(e, t, n = {}) {
178
178
  if (!e || !Array.isArray(e.pages)) return [];
179
- let r = Array.isArray(e.variables) ? e.variables : [], i = new Map(r.filter((e) => e?.key).map((e) => [e.key, e])), a = c(e.pageSize) ? e.pageSize : d;
179
+ let r = Array.isArray(e.variables) ? e.variables : [], i = new Map(r.filter((e) => e?.key).map((e) => [e.key, e])), a = s(e.pageSize) ? e.pageSize : u;
180
180
  return e.pages.flatMap((e) => {
181
181
  if (!e || typeof e.id != "string" || !e.id.trim() || typeof e.contentHtml != "string") return [];
182
- let r = f(e.pageSize, a);
182
+ let r = d(e.pageSize, a);
183
183
  return [{
184
184
  id: e.id,
185
185
  title: e.title || "未命名页面",
@@ -191,23 +191,23 @@ function b(e, t, n = {}) {
191
191
  });
192
192
  }
193
193
  function x(e, t, n = {}) {
194
- return b(e, t, n).map((e) => `<section class="gd-contract-template-page" data-page-id="${a(e.id)}" data-page-format="${a(e.format)}" data-page-width="${e.width}" data-page-height="${e.height}" style="width:${e.width}px;min-height:${e.height}px">${e.contentHtml}</section>`).join("\n");
194
+ return b(e, t, n).map((e) => `<section class="gd-contract-template-page" data-page-id="${i(e.id)}" data-page-format="${i(e.format)}" data-page-width="${e.width}" data-page-height="${e.height}" style="width:${e.width}px;min-height:${e.height}px">${e.contentHtml}</section>`).join("\n");
195
195
  }
196
196
  function S(e) {
197
197
  return e == null || e === "";
198
198
  }
199
- function C(e, t, n, i) {
199
+ function C(e, t, r, i) {
200
200
  if (!e) return e;
201
201
  let a = M(e);
202
- if (r()) {
202
+ if (n()) {
203
203
  let e = new DOMParser().parseFromString(a, "text/html");
204
204
  return e.querySelectorAll("[data-template-variable]").forEach((e) => {
205
- w(e, t, n, i);
205
+ w(e, t, r, i);
206
206
  }), e.body.innerHTML;
207
207
  }
208
- return l(a, (e, r) => {
209
- let a = s(r, "data-key");
210
- return a ? T(t.get(a), a, n[a], i) : e;
208
+ return c(a, (e, n) => {
209
+ let a = o(n, "data-key");
210
+ return a ? T(t.get(a), a, r[a], i) : e;
211
211
  });
212
212
  }
213
213
  function w(e, t, n, r) {
@@ -219,66 +219,66 @@ function w(e, t, n, r) {
219
219
  function T(e, t, n, r) {
220
220
  return r.mode === "display" ? E(e, t, n, r) : D(e, t, n, r);
221
221
  }
222
- function E(n, r, i, s) {
223
- let c = n?.type ?? "text", l = i ?? O(n), u = c === "image" && !S(l) && !t(String(l)) ? "" : l, d = A(u), f = e({
224
- type: c,
225
- width: n?.width,
226
- height: n?.height,
227
- placeholder: n?.placeholder ?? "",
228
- defaultValue: d,
229
- format: n?.format ?? "",
230
- precision: n?.precision,
231
- useGrouping: n?.useGrouping,
232
- checkedText: n?.checkedText ?? "",
233
- uncheckedText: n?.uncheckedText ?? "",
234
- multiline: n?.multiline,
235
- rows: n?.rows,
236
- lineHeight: n?.lineHeight,
237
- style: n?.style
238
- }), p = f.displayText || n?.placeholder || n?.label || r, m = [
239
- `class="${a([
222
+ function E(e, t, n, r) {
223
+ let o = e?.type ?? "text", s = n ?? O(e), c = o === "image" && !S(s) && !f(String(s)) ? "" : s, u = A(c), d = l({
224
+ type: o,
225
+ width: e?.width,
226
+ height: e?.height,
227
+ placeholder: e?.placeholder ?? "",
228
+ defaultValue: u,
229
+ format: e?.format ?? "",
230
+ precision: e?.precision,
231
+ useGrouping: e?.useGrouping,
232
+ checkedText: e?.checkedText ?? "",
233
+ uncheckedText: e?.uncheckedText ?? "",
234
+ multiline: e?.multiline,
235
+ rows: e?.rows,
236
+ lineHeight: e?.lineHeight,
237
+ style: e?.style
238
+ }), p = d.displayText || e?.placeholder || e?.label || t, m = [
239
+ `class="${i([
240
240
  "gd-contract-template-renderer__control",
241
241
  "gd-contract-template-renderer__preview-control",
242
- ...f.classes,
243
- s.activeKey === r ? "is-active" : "",
244
- S(u) ? "is-empty" : ""
242
+ ...d.classes,
243
+ r.activeKey === t ? "is-active" : "",
244
+ S(c) ? "is-empty" : ""
245
245
  ].filter(Boolean).join(" "))}"`,
246
- `style="${a(f.styleText)}"`,
246
+ `style="${i(d.styleText)}"`,
247
247
  "data-contract-render-wrapper=\"true\"",
248
248
  "data-contract-render-preview=\"true\"",
249
- `data-key="${a(r)}"`,
250
- `data-variable-type="${a(c)}"`,
251
- `aria-label="${a(n?.label || r)}"`,
252
- s.disabled ? "" : "role=\"button\"",
253
- s.disabled ? "" : "tabindex=\"0\""
249
+ `data-key="${i(t)}"`,
250
+ `data-variable-type="${i(o)}"`,
251
+ `aria-label="${i(e?.label || t)}"`,
252
+ r.disabled ? "" : "role=\"button\"",
253
+ r.disabled ? "" : "tabindex=\"0\""
254
254
  ].filter(Boolean).join(" ");
255
- return c === "checkbox" ? `<span ${m}><span class="gd-contract-template-renderer__checkbox-mark" aria-hidden="true">${j(u) ? "✓" : ""}</span>${o(p)}</span>` : c === "image" && !S(u) ? `<span ${m}></span>` : `<span ${m}>${o(p)}</span>`;
255
+ return o === "checkbox" ? `<span ${m}><span class="gd-contract-template-renderer__checkbox-mark" aria-hidden="true">${j(c) ? "✓" : ""}</span>${a(p)}</span>` : o === "image" && !S(c) ? `<span ${m}></span>` : `<span ${m}>${a(p)}</span>`;
256
256
  }
257
- function D(t, n, r, i) {
258
- let s = t?.type ?? "text", c = !!i.readonly, l = k(r ?? O(t)), u = e({
259
- type: s,
260
- width: t?.width,
261
- height: t?.height,
262
- placeholder: t?.placeholder ?? "",
263
- defaultValue: c ? l : "",
264
- format: t?.format ?? "",
265
- precision: t?.precision,
266
- useGrouping: t?.useGrouping,
267
- checkedText: t?.checkedText ?? "",
268
- uncheckedText: t?.uncheckedText ?? "",
269
- multiline: t?.multiline,
270
- rows: t?.rows,
271
- lineHeight: t?.lineHeight,
272
- style: t?.style
273
- }), d = i.disabled || c, f = [
257
+ function D(e, t, n, r) {
258
+ let o = e?.type ?? "text", s = !!r.readonly, c = k(n ?? O(e)), u = l({
259
+ type: o,
260
+ width: e?.width,
261
+ height: e?.height,
262
+ placeholder: e?.placeholder ?? "",
263
+ defaultValue: s ? c : "",
264
+ format: e?.format ?? "",
265
+ precision: e?.precision,
266
+ useGrouping: e?.useGrouping,
267
+ checkedText: e?.checkedText ?? "",
268
+ uncheckedText: e?.uncheckedText ?? "",
269
+ multiline: e?.multiline,
270
+ rows: e?.rows,
271
+ lineHeight: e?.lineHeight,
272
+ style: e?.style
273
+ }), d = r.disabled || s, f = [
274
274
  "data-contract-render-control=\"true\"",
275
- `data-key="${a(n)}"`,
276
- `data-variable-type="${a(s)}"`,
277
- `aria-label="${a(t?.label || n)}"`,
275
+ `data-key="${i(t)}"`,
276
+ `data-variable-type="${i(o)}"`,
277
+ `aria-label="${i(e?.label || t)}"`,
278
278
  d ? "disabled" : "",
279
- c ? "readonly" : ""
280
- ].filter(Boolean).join(" "), p = `style="${a(u.styleText)}"`, m = a(["gd-contract-template-renderer__control", ...u.classes].join(" "));
281
- return s === "checkbox" ? `<label class="${m}" ${p} data-contract-render-wrapper="true" data-key="${a(n)}"><input type="checkbox" ${f} ${j(l) ? "checked" : ""}>${o(t?.checkedText || t?.label || n)}</label>` : c ? `<span class="${m}" ${p} data-contract-render-wrapper="true" data-key="${a(n)}">${o(u.displayText || l)}</span>` : s === "number" ? `<input class="${m}" ${p} type="number" ${f} value="${a(l)}" placeholder="${a(t?.placeholder || "")}">` : s === "date" ? `<input class="${m}" ${p} type="date" ${f} value="${a(l)}" placeholder="${a(t?.placeholder || "")}">` : t?.multiline ? `<textarea class="${m}" ${p} ${f} placeholder="${a(t.placeholder || "")}">${o(l)}</textarea>` : `<input class="${m}" ${p} type="text" ${f} value="${a(l)}" placeholder="${a(t?.placeholder || "")}">`;
279
+ s ? "readonly" : ""
280
+ ].filter(Boolean).join(" "), p = `style="${i(u.styleText)}"`, m = i(["gd-contract-template-renderer__control", ...u.classes].join(" "));
281
+ return o === "checkbox" ? `<label class="${m}" ${p} data-contract-render-wrapper="true" data-key="${i(t)}"><input type="checkbox" ${f} ${j(c) ? "checked" : ""}>${a(e?.checkedText || e?.label || t)}</label>` : s ? `<span class="${m}" ${p} data-contract-render-wrapper="true" data-key="${i(t)}">${a(u.displayText || c)}</span>` : o === "number" ? `<input class="${m}" ${p} type="number" ${f} value="${i(c)}" placeholder="${i(e?.placeholder || "")}">` : o === "date" ? `<input class="${m}" ${p} type="date" ${f} value="${i(c)}" placeholder="${i(e?.placeholder || "")}">` : e?.multiline ? `<textarea class="${m}" ${p} ${f} placeholder="${i(e.placeholder || "")}">${a(c)}</textarea>` : `<input class="${m}" ${p} type="text" ${f} value="${i(c)}" placeholder="${i(e?.placeholder || "")}">`;
282
282
  }
283
283
  function O(e) {
284
284
  if (!e) return "";
@@ -299,7 +299,7 @@ function j(e) {
299
299
  return e === !0 || e === "true" || e === "1" || e === "yes" || e === "是" || e === "已选";
300
300
  }
301
301
  function M(e) {
302
- if (n()) {
302
+ if (t()) {
303
303
  let t = new DOMParser().parseFromString(e, "text/html");
304
304
  return t.querySelectorAll("script,style,meta,link,iframe,object,embed").forEach((e) => e.remove()), t.querySelectorAll("*").forEach((e) => {
305
305
  Array.from(e.attributes).forEach((t) => {
@@ -314,7 +314,7 @@ function M(e) {
314
314
  }).replace(/\s+style\s*=\s*(["'])(.*?)\1/gi, (e, t, n) => L(n) ? "" : ` style=${t}${n}${t}`);
315
315
  }
316
316
  function N(e) {
317
- return i(e, m, (e) => s(e, "data-key"));
317
+ return r(e, m, (e) => o(e, "data-key"));
318
318
  }
319
319
  function P(e) {
320
320
  let t = [];
@@ -0,0 +1,19 @@
1
+ //#region src/components/pro-contract-template-designer/src/utils/toolbar-overflow.ts
2
+ var e = [
3
+ "table",
4
+ "cleanup",
5
+ "typography",
6
+ "insert"
7
+ ];
8
+ function t(t) {
9
+ let n = t.buffer ?? 0, r = e.reduce((e, n) => e + (t.groupWidths[n] ?? 0), 0);
10
+ if (t.fixedWidth + r + n <= t.availableWidth) return [];
11
+ let i = [], a = t.fixedWidth + r + t.moreWidth;
12
+ for (let n of e) {
13
+ if (a <= t.availableWidth) break;
14
+ i.push(n), a -= t.groupWidths[n] ?? 0;
15
+ }
16
+ return i;
17
+ }
18
+ //#endregion
19
+ export { e as CONTRACT_TEMPLATE_TOOLBAR_OVERFLOW_PRIORITY, t as resolveContractTemplateToolbarOverflowKeys };