@guodun/antdv 1.4.4 → 1.4.6

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 (95) hide show
  1. package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +85 -85
  2. package/dist/es/components/contract-signing-location/src/template-source.mjs +63 -4
  3. package/dist/es/components/dept-selector/src/dept.mjs +170 -142
  4. package/dist/es/components/index.mjs +1 -0
  5. package/dist/es/components/pro-contract-template-designer/index.mjs +1 -0
  6. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +372 -185
  7. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.mjs +59 -42
  8. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.mjs +218 -85
  9. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.mjs +5 -0
  10. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.mjs +97 -0
  11. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +914 -853
  12. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +550 -245
  13. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +214 -139
  14. package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +53 -35
  15. package/dist/es/components/pro-contract-template-designer/src/types.mjs +15 -2
  16. package/dist/es/components/pro-contract-template-designer/src/utils/advanced-controls.mjs +91 -0
  17. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +96 -65
  18. package/dist/es/components/pro-contract-template-designer/src/utils/template-tool-icons.mjs +23 -16
  19. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  20. package/dist/es/components/pro-selector/src/components/org-tree.mjs +130 -89
  21. package/dist/es/components/pro-selector/src/components/user.mjs +34 -26
  22. package/dist/es/components/pro-selector/src/pro-user.mjs +86 -72
  23. package/dist/es/components/pro-selector/src/types.mjs +4 -1
  24. package/dist/es/components/pro-selector/src/utils/orgTree.mjs +5 -2
  25. package/dist/es/components/pro-selector-group/src/compoents/dept-tree.vue.mjs +92 -65
  26. package/dist/es/components/pro-selector-group/src/compoents/dept.vue.mjs +3 -3
  27. package/dist/es/components/pro-selector-group/src/compoents/role.vue.mjs +98 -73
  28. package/dist/es/components/pro-selector-group/src/compoents/select-box.vue.mjs +12 -9
  29. package/dist/es/components/pro-selector-group/src/compoents/user.vue.mjs +101 -72
  30. package/dist/es/components/pro-selector-group/src/hooks/useApi.mjs +39 -22
  31. package/dist/es/components/pro-selector-group/src/index.vue.mjs +105 -83
  32. package/dist/es/components/pro-selector-group/src/utils/index.mjs +36 -0
  33. package/dist/es/components/role-selector/src/role.mjs +134 -120
  34. package/dist/es/index.mjs +50 -49
  35. package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
  36. package/dist/lib/components/contract-signing-location/src/template-source.cjs +1 -1
  37. package/dist/lib/components/dept-selector/src/dept.cjs +1 -1
  38. package/dist/lib/components/index.cjs +1 -1
  39. package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
  40. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +2 -1
  41. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.cjs +1 -1
  42. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.cjs +1 -1
  43. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.cjs +1 -0
  44. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.cjs +1 -0
  45. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  46. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
  47. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
  48. package/dist/lib/components/pro-contract-template-designer/src/extensions/template-variable.cjs +1 -1
  49. package/dist/lib/components/pro-contract-template-designer/src/types.cjs +1 -1
  50. package/dist/lib/components/pro-contract-template-designer/src/utils/advanced-controls.cjs +1 -0
  51. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
  52. package/dist/lib/components/pro-contract-template-designer/src/utils/template-tool-icons.cjs +1 -1
  53. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  54. package/dist/lib/components/pro-selector/src/components/org-tree.cjs +1 -1
  55. package/dist/lib/components/pro-selector/src/components/user.cjs +1 -1
  56. package/dist/lib/components/pro-selector/src/pro-user.cjs +1 -1
  57. package/dist/lib/components/pro-selector/src/types.cjs +1 -1
  58. package/dist/lib/components/pro-selector/src/utils/orgTree.cjs +1 -1
  59. package/dist/lib/components/pro-selector-group/src/compoents/dept-tree.vue.cjs +1 -1
  60. package/dist/lib/components/pro-selector-group/src/compoents/dept.vue.cjs +1 -1
  61. package/dist/lib/components/pro-selector-group/src/compoents/role.vue.cjs +1 -1
  62. package/dist/lib/components/pro-selector-group/src/compoents/select-box.vue.cjs +1 -1
  63. package/dist/lib/components/pro-selector-group/src/compoents/user.vue.cjs +1 -1
  64. package/dist/lib/components/pro-selector-group/src/hooks/useApi.cjs +1 -1
  65. package/dist/lib/components/pro-selector-group/src/index.vue.cjs +1 -1
  66. package/dist/lib/components/pro-selector-group/src/utils/index.cjs +1 -0
  67. package/dist/lib/components/role-selector/src/role.cjs +1 -1
  68. package/dist/lib/index.cjs +1 -1
  69. package/dist/theme/dept-selector.css +1 -1
  70. package/dist/theme/icon.css +1 -1
  71. package/dist/theme/index.css +1 -1
  72. package/dist/theme/pro-selector-group.css +1 -1
  73. package/dist/theme/pro-selector.css +1 -1
  74. package/dist/theme/role-selector.css +1 -1
  75. package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +3 -3
  76. package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
  77. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.d.ts +1 -0
  78. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerWorkspaceHeader.vue.d.ts +3 -0
  79. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererField.vue.d.ts +7 -1
  80. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateVariableDataModal.vue.d.ts +14 -0
  81. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +13 -1
  82. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +11 -1
  83. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +4 -0
  84. package/dist/types/components/pro-contract-template-designer/src/extensions/template-variable.d.ts +11 -1
  85. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +131 -2
  86. package/dist/types/components/pro-contract-template-designer/src/utils/advanced-controls.d.ts +15 -0
  87. package/dist/types/components/pro-contract-template-designer/src/utils/template-renderer.d.ts +10 -2
  88. package/dist/types/components/pro-selector/index.d.ts +9 -0
  89. package/dist/types/components/pro-selector/src/components/user.d.ts +9 -0
  90. package/dist/types/components/pro-selector/src/types.d.ts +2 -0
  91. package/dist/types/components/pro-selector/src/utils/orgTree.d.ts +4 -1
  92. package/dist/types/components/pro-selector-group/src/compoents/select-box.vue.d.ts +4 -4
  93. package/dist/types/components/pro-selector-group/src/hooks/useApi.d.ts +6 -1
  94. package/dist/types/components/pro-selector-group/src/utils/index.d.ts +8 -0
  95. package/package.json +5 -3
@@ -1,18 +1,19 @@
1
1
  import { isContractTemplateFieldType as e } from "./types.mjs";
2
- import { buildInitialRenderValues as t, buildTemplateRenderPages as n, isEmptyRenderValue as r, normalizeRenderValues as i, resolveTemplateRenderSubmitErrors as ee, validateTemplateRenderStructure as te, validateTemplateRenderValues as ne } from "./utils/template-renderer.mjs";
2
+ import { isAllowedContractTemplateRemoteUrl as t, normalizeContractTemplateControlOptions as n, normalizeContractTemplateJsonObject as r, normalizeContractTemplateRequestTimeout as i } from "./utils/advanced-controls.mjs";
3
+ import { buildInitialRenderValues as a, buildTemplateRenderPages as o, isEmptyRenderValue as s, normalizeRenderValues as c, resolveTemplateRenderSubmitErrors as ee, validateTemplateRenderStructure as te, validateTemplateRenderValues as ne } from "./utils/template-renderer.mjs";
3
4
  import re from "./ContractTemplateRendererField.mjs";
4
5
  import ie from "./ContractTemplateRendererHeader.mjs";
5
6
  import ae from "./ContractTemplateRendererPage.mjs";
6
7
  import oe from "./ContractTemplateRendererValidation.mjs";
7
- import { Fragment as se, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createTextVNode as ce, createVNode as u, defineComponent as d, mergeProps as le, nextTick as ue, normalizeClass as f, onBeforeUnmount as de, openBlock as p, ref as m, renderList as fe, renderSlot as pe, toDisplayString as h, unref as g, watch as _, withCtx as v } from "vue";
8
- import { Button as me, Empty as y, Progress as he, Tooltip as ge } from "ant-design-vue";
9
- import { useElementSize as _e } from "@vueuse/core";
10
- import { LeftOutlined as ve, RightOutlined as ye } from "@ant-design/icons-vue";
8
+ import { Fragment as se, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createSlots as ce, createTextVNode as le, createVNode as m, defineComponent as h, mergeProps as ue, nextTick as de, normalizeClass as fe, onBeforeUnmount as pe, openBlock as g, ref as _, renderList as me, renderSlot as he, toDisplayString as v, unref as y, watch as b, withCtx as x } from "vue";
9
+ import { Button as ge, Empty as S, Input as _e, Modal as ve, Progress as ye, Segmented as be, Tooltip as xe } from "ant-design-vue";
10
+ import { useElementSize as Se } from "@vueuse/core";
11
+ import { LeftOutlined as Ce, RightOutlined as we, SearchOutlined as Te } from "@ant-design/icons-vue";
11
12
  //#region src/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue?vue&type=script&setup=true&lang.ts
12
- var be = {
13
+ var Ee = {
13
14
  key: 2,
14
15
  class: "gd-contract-template-renderer__empty"
15
- }, xe = ["data-highlighted-variable-key"], Se = { class: "gd-contract-template-renderer__pages" }, Ce = ["aria-label", "aria-expanded"], we = { class: "gd-contract-template-renderer__panel-clip" }, Te = { class: "gd-contract-template-renderer__panel" }, Ee = { class: "gd-contract-template-renderer__panel-head" }, De = { class: "gd-contract-template-renderer__panel-head-row" }, Oe = { class: "gd-contract-template-renderer__panel-head-actions" }, ke = ["data-field-key"], Ae = .5, je = 1.5, b = .1, Me = 3e3, Ne = /* @__PURE__ */ d({
16
+ }, De = ["data-highlighted-variable-key"], Oe = { class: "gd-contract-template-renderer__pages" }, ke = ["aria-label", "aria-expanded"], Ae = { class: "gd-contract-template-renderer__panel-clip" }, je = { class: "gd-contract-template-renderer__panel" }, Me = { class: "gd-contract-template-renderer__panel-head" }, Ne = { class: "gd-contract-template-renderer__panel-head-row" }, Pe = { class: "gd-contract-template-renderer__panel-head-actions" }, Fe = { class: "gd-contract-template-renderer__field-group-head" }, Ie = { class: "gd-contract-template-renderer__field-group-items" }, Le = ["data-field-key"], Re = .5, ze = 1.5, C = .1, Be = 3e3, Ve = /* @__PURE__ */ h({
16
17
  name: "ProContractTemplateRenderer",
17
18
  __name: "ProContractTemplateRenderer",
18
19
  props: {
@@ -56,274 +57,536 @@ var be = {
56
57
  type: Boolean,
57
58
  default: !0
58
59
  },
59
- zoom: { default: 1 }
60
+ zoom: { default: 1 },
61
+ controlRegistry: { default: () => ({}) },
62
+ optionResolver: {
63
+ type: Function,
64
+ default: void 0
65
+ },
66
+ requester: {
67
+ type: Function,
68
+ default: void 0
69
+ },
70
+ allowedRemoteOrigins: { default: () => [] },
71
+ remoteRequestTimeoutMs: { default: 1e4 },
72
+ remoteOptionsCacheTtlMs: { default: 3e4 },
73
+ selectorHttp: { default: void 0 },
74
+ selectorUrlPrefix: { default: "" }
60
75
  },
61
76
  emits: [
62
77
  "update:values",
63
78
  "change",
64
79
  "validate",
65
80
  "submit",
66
- "update:zoom"
81
+ "update:zoom",
82
+ "control-warning"
67
83
  ],
68
- setup(d, { expose: Ne, emit: Pe }) {
69
- let x = d, S = Pe, Fe = m(), C = m(), Ie = m(), w = m(i(x.template, x.values)), T = m({ ...w.value }), E = m(!1), D = m([]), O = m(!1), k = m(!1), A = m(""), j = m(""), M = m(""), N = m(ft(x.zoom)), P = m(!1), F = m(!1), { width: Le } = _e(C), Re = a(() => x.readonly || x.disabled), I = a(() => te(x.template)), L = a(() => E.value ? D.value : I.value), R = a(() => (Array.isArray(x.template?.variables) ? x.template.variables : []).filter((t) => !!t?.key && e(t.type ?? "text"))), z = a(() => P.value ? R.value.filter((e) => r(w.value[e.key])) : R.value), ze = a(() => R.value.filter((e) => r(w.value[e.key])).length), Be = a(() => {
84
+ setup(h, { expose: Ve, emit: He }) {
85
+ let w = h, T = He, Ue = [
86
+ {
87
+ label: "全部",
88
+ value: "all"
89
+ },
90
+ {
91
+ label: "未填写",
92
+ value: "unfilled"
93
+ },
94
+ {
95
+ label: "有错误",
96
+ value: "error"
97
+ }
98
+ ], We = _(), E = _(), Ge = _(), D = _(c(w.template, w.values)), Ke = _({ ...D.value }), O = _(!1), k = _([]), A = _(!1), j = _(!1), qe = _(""), M = _(""), N = _(""), P = _(Xt(w.zoom)), F = _(""), I = _("all"), L = _(!1), Je = _(/* @__PURE__ */ new Map()), R = /* @__PURE__ */ new Map(), Ye = /* @__PURE__ */ new Map(), z = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new Set(), { width: Ze } = Se(E), Qe = l(() => w.readonly || w.disabled), B = l(() => te(w.template)), V = l(() => O.value ? k.value : B.value), H = l(() => (Array.isArray(w.template?.variables) ? w.template.variables : []).filter((t) => !!t?.key && e(t.type ?? "text"))), $e = l(() => {
99
+ let e = { ...D.value };
100
+ return H.value.forEach((t) => {
101
+ let n = At(t);
102
+ if (n?.toDisplayText) try {
103
+ e[t.key] = n.toDisplayText(e[t.key], {
104
+ variable: t,
105
+ config: r(t.componentConfig)
106
+ });
107
+ } catch {}
108
+ }), e;
109
+ }), et = l(() => H.value.filter((e) => s(D.value[e.key])).length), tt = l(() => {
70
110
  let e = /* @__PURE__ */ new Map();
71
- return L.value.forEach((t) => {
111
+ return V.value.forEach((t) => {
72
112
  t.variableKey && e.set(t.variableKey, [...e.get(t.variableKey) ?? [], t]);
73
113
  }), e;
74
- }), B = a(() => {
75
- let e = x.interactionMode === "panel";
76
- return n(x.template, e ? w.value : T.value, {
77
- readonly: x.readonly,
78
- disabled: x.disabled,
114
+ }), U = l(() => {
115
+ let e = w.interactionMode === "panel";
116
+ return o(w.template, e ? $e.value : Ke.value, {
117
+ readonly: w.readonly,
118
+ disabled: w.disabled,
79
119
  mode: e ? "display" : "control",
80
- activeKey: e ? j.value : ""
120
+ activeKey: e ? M.value : ""
81
121
  });
82
- }), V = a(() => B.value.length > 0), H = a(() => R.value.filter((e) => !r(w.value[e.key])).length), U = a(() => R.value.filter((e) => e.required && r(w.value[e.key])).length), Ve = a(() => R.value.length ? Math.round(H.value / R.value.length * 100) : 0), He = a(() => E.value && D.value.length === 0), Ue = a(() => E.value ? He.value ? "校验通过,模板与填写值均符合规则" : `发现 ${D.value.length} 个模板或填写问题` : I.value.length ? `模板存在 ${I.value.length} 个问题,已安全降级展示` : ""), We = a(() => E.value ? L.value.length > 0 || k.value : I.value.length > 0);
83
- _(() => x.template, (e) => {
84
- W(i(e, x.values), !1), J();
122
+ }), nt = l(() => {
123
+ let e = /* @__PURE__ */ new Map(), t = new Set(H.value.map((e) => e.key));
124
+ return U.value.forEach((n) => {
125
+ Wt(n.contentHtml).forEach((r) => {
126
+ t.has(r) && !e.has(r) && e.set(r, n.id);
127
+ });
128
+ }), e;
129
+ }), rt = l(() => H.value.filter(zt)), it = l(() => {
130
+ let e = U.value.map((e, t) => ({
131
+ id: `page:${e.id}`,
132
+ pageId: e.id,
133
+ title: `第 ${t + 1} 页${e.title ? ` · ${e.title}` : ""}`,
134
+ allVariables: [],
135
+ variables: []
136
+ })), t = new Map(e.map((e) => [e.pageId, e])), n = {
137
+ id: "unlocated",
138
+ title: "未定位字段",
139
+ allVariables: [],
140
+ variables: []
141
+ };
142
+ return H.value.forEach((e) => {
143
+ let r = t.get(nt.value.get(e.key) ?? "") ?? n;
144
+ r.allVariables.push(e), zt(e) && r.variables.push(e);
145
+ }), [...e, n].filter((e) => e.variables.length > 0).map((e) => ({
146
+ id: e.id,
147
+ title: e.title,
148
+ totalCount: e.allVariables.length,
149
+ variables: e.variables
150
+ }));
151
+ }), at = l(() => U.value.length > 0), ot = l(() => H.value.filter((e) => !s(D.value[e.key])).length), st = l(() => H.value.filter((e) => e.required && s(D.value[e.key])).length), ct = l(() => H.value.length ? Math.round(ot.value / H.value.length * 100) : 0), lt = l(() => O.value && k.value.length === 0), ut = l(() => O.value ? lt.value ? "校验通过,模板与填写值均符合规则" : `发现 ${k.value.length} 个模板或填写问题` : B.value.length ? `模板存在 ${B.value.length} 个问题,已安全降级展示` : ""), dt = l(() => O.value ? V.value.length > 0 || j.value : B.value.length > 0);
152
+ b(() => w.template, (e) => {
153
+ W(c(e, w.values), !1), xt();
85
154
  let t = Array.isArray(e?.pages) ? e.pages.map((e) => e?.id) : [];
86
- t.includes(M.value) || (M.value = t.find(Boolean) ?? ""), j.value && !R.value.some((e) => e.key === j.value) && tt();
87
- }, { deep: !0 }), _(() => x.values, (e) => {
88
- let t = i(x.template, e);
89
- mt(t, w.value) || (W(t, !1), J());
90
- }, { deep: !0 }), _(() => x.interactionMode, (e) => {
91
- e === "inline" && (T.value = { ...w.value });
92
- }), _(() => x.collapsiblePanel, (e) => {
93
- e || (F.value = !1);
94
- }), _(() => x.zoom, (e) => N.value = ft(e)), _(B, (e) => {
95
- !M.value && e.length && (M.value = e[0].id);
155
+ t.includes(N.value) || (N.value = t.find(Boolean) ?? ""), M.value && !H.value.some((e) => e.key === M.value) && Et();
156
+ }, { deep: !0 }), b(() => [
157
+ w.template?.variables,
158
+ w.optionResolver,
159
+ w.requester,
160
+ w.allowedRemoteOrigins,
161
+ w.remoteRequestTimeoutMs,
162
+ w.remoteOptionsCacheTtlMs
163
+ ], () => {
164
+ Mt();
165
+ }, {
166
+ deep: !0,
167
+ immediate: !0
168
+ }), b(() => w.values, (e) => {
169
+ let t = c(w.template, e);
170
+ Zt(t, D.value) || (W(t, !1), xt());
171
+ }, { deep: !0 }), b(() => w.interactionMode, (e) => {
172
+ e === "inline" && (Ke.value = { ...D.value });
173
+ }), b(() => w.collapsiblePanel, (e) => {
174
+ e || (L.value = !1);
175
+ }), b(() => w.zoom, (e) => P.value = Xt(e)), b(U, (e) => {
176
+ !N.value && e.length && (N.value = e[0].id);
96
177
  }, { immediate: !0 });
97
178
  function W(e, t = !0, n = {}) {
98
- w.value = { ...e }, n.refreshInlineHtml !== !1 && (T.value = { ...e }), t && (S("update:values", { ...w.value }), S("change", { ...w.value }));
179
+ D.value = { ...e }, n.refreshInlineHtml !== !1 && (Ke.value = { ...e }), t && (T("update:values", { ...D.value }), T("change", { ...D.value }));
99
180
  }
100
181
  function G(e, t) {
101
- !e || Re.value || (W({
102
- ...w.value,
182
+ !e || Qe.value || (W({
183
+ ...D.value,
103
184
  [e]: t
104
- }, !0, { refreshInlineHtml: x.interactionMode !== "inline" }), E.value && q());
185
+ }, !0, { refreshInlineHtml: w.interactionMode !== "inline" }), O.value && _t());
105
186
  }
106
- function Ge(e) {
107
- if (x.interactionMode !== "inline") return;
187
+ function ft(e) {
188
+ if (w.interactionMode !== "inline") return;
108
189
  let t = e.target;
109
190
  if (!(t instanceof HTMLInputElement) && !(t instanceof HTMLTextAreaElement)) return;
110
191
  let n = t.dataset.key || "";
111
192
  n && (t instanceof HTMLInputElement && t.type === "checkbox" ? G(n, t.checked) : t instanceof HTMLInputElement && t.type === "number" ? G(n, t.value === "" ? void 0 : t.valueAsNumber) : G(n, t.value));
112
193
  }
113
- function Ke(e) {
194
+ function pt(e) {
114
195
  let t = e.target;
115
196
  if (!(t instanceof Element)) return;
116
197
  let n = t.closest("[data-render-page-id]");
117
- n?.dataset.renderPageId && (M.value = n.dataset.renderPageId);
198
+ n?.dataset.renderPageId && (N.value = n.dataset.renderPageId);
118
199
  let r = t.closest("[data-contract-render-wrapper], [data-contract-render-control]")?.dataset.key || "";
119
- r && et(r);
200
+ r && Tt(r);
120
201
  }
121
- function qe(e) {
202
+ function mt(e) {
122
203
  if (e.key !== "Enter" && e.key !== " ") return;
123
204
  let t = e.target;
124
- !(t instanceof HTMLElement) || !t.dataset.key || (e.preventDefault(), et(t.dataset.key));
125
- }
126
- function K() {
127
- return { ...w.value };
128
- }
129
- function Je(e) {
130
- W(i(x.template, e));
131
- }
132
- function q() {
133
- let e = ne(x.template, w.value);
134
- return Ze(e), S("validate", e), e;
135
- }
136
- function Ye() {
137
- let e = ee(x.template, w.value, x.validateOnSubmit);
138
- if ((x.validateOnSubmit || e.length) && (Ze(e), S("validate", e)), e.length) return rt(e[0]), !1;
139
- let t = K();
140
- return S("submit", t), t;
141
- }
142
- function Xe() {
143
- return W(t(x.template)), J(), K();
205
+ !(t instanceof HTMLElement) || !t.dataset.key || (e.preventDefault(), Tt(t.dataset.key));
206
+ }
207
+ function ht() {
208
+ return { ...D.value };
209
+ }
210
+ function gt(e) {
211
+ W(c(w.template, e));
212
+ }
213
+ function _t() {
214
+ let e = ne(w.template, D.value);
215
+ return St(e), T("validate", e), e;
216
+ }
217
+ function vt() {
218
+ let e = ee(w.template, D.value, w.validateOnSubmit);
219
+ if ((w.validateOnSubmit || e.length) && (St(e), T("validate", e)), e.length) return Ot(e[0]), !1;
220
+ let t = ht();
221
+ return T("submit", t), t;
222
+ }
223
+ function yt() {
224
+ return W(a(w.template)), xt(), ht();
225
+ }
226
+ function bt() {
227
+ Qe.value || ve.confirm({
228
+ title: "重置填写内容?",
229
+ content: "将恢复模板中的默认值,当前未提交的填写内容会被覆盖。",
230
+ okText: "确认重置",
231
+ cancelText: "取消",
232
+ onOk: () => yt()
233
+ });
144
234
  }
145
- function J() {
146
- E.value = !1, D.value = [], O.value = !1, k.value = !1, X();
235
+ function xt() {
236
+ O.value = !1, k.value = [], A.value = !1, j.value = !1, q();
147
237
  }
148
- function Ze(e) {
149
- if (D.value = e, E.value = !0, O.value = !1, e.length) {
150
- k.value = !1, X();
238
+ function St(e) {
239
+ if (k.value = e, O.value = !0, A.value = !1, e.length) {
240
+ j.value = !1, q();
151
241
  return;
152
242
  }
153
- Qe();
243
+ Ct();
154
244
  }
155
- let Y;
156
- function X() {
157
- Y &&= (clearTimeout(Y), void 0);
245
+ let K;
246
+ function q() {
247
+ K &&= (clearTimeout(K), void 0);
158
248
  }
159
- function Qe() {
160
- X(), k.value = !0, Y = setTimeout(() => {
161
- k.value = !1, Y = void 0;
162
- }, Me);
249
+ function Ct() {
250
+ q(), j.value = !0, K = setTimeout(() => {
251
+ j.value = !1, K = void 0;
252
+ }, Be);
163
253
  }
164
- function Z(e) {
165
- et(e, !0);
254
+ function J(e) {
255
+ Tt(e, !0);
166
256
  }
167
- function $e(e) {
168
- x.interactionMode === "panel" && (F.value &&= !1, P.value && R.value.some((t) => t.key === e) && !z.value.some((t) => t.key === e) && (P.value = !1));
257
+ function wt(e) {
258
+ w.interactionMode === "panel" && (L.value &&= !1, H.value.some((t) => t.key === e) && !rt.value.some((t) => t.key === e) && Bt());
169
259
  }
170
- function et(e, t = !1) {
171
- e && ($e(e), j.value = e, A.value = e, ue(() => {
172
- nt(e);
173
- let n = C.value?.querySelector(`[data-key="${pt(e)}"]`), r = n?.closest("[data-render-page-id]");
174
- r?.dataset.renderPageId && (M.value = r.dataset.renderPageId), t && n?.scrollIntoView({
260
+ function Tt(e, t = !1) {
261
+ e && (wt(e), M.value = e, qe.value = e, de(() => {
262
+ Dt(e);
263
+ let n = E.value?.querySelector(`[data-key="${Q(e)}"]`), r = n?.closest("[data-render-page-id]");
264
+ r?.dataset.renderPageId && (N.value = r.dataset.renderPageId), t && n?.scrollIntoView({
175
265
  behavior: "smooth",
176
266
  block: "center",
177
267
  inline: "center"
178
- }), x.interactionMode === "panel" && Ie.value?.querySelector(`[data-field-key="${pt(e)}"]`)?.scrollIntoView({
268
+ }), w.interactionMode === "panel" && Ge.value?.querySelector(`[data-field-key="${Q(e)}"]`)?.scrollIntoView({
179
269
  behavior: "smooth",
180
270
  block: "nearest"
181
271
  });
182
272
  }));
183
273
  }
184
- function tt() {
185
- j.value = "", A.value = "", nt("");
274
+ function Et() {
275
+ M.value = "", qe.value = "", Dt("");
276
+ }
277
+ function Dt(e) {
278
+ E.value?.querySelectorAll("[data-contract-render-wrapper], [data-contract-render-control]").forEach((t) => t.classList.toggle("is-active", !!e && t.dataset.key === e));
279
+ }
280
+ function Ot(e) {
281
+ e.variableKey ? J(e.variableKey) : e.pageId && Yt(e.pageId);
186
282
  }
187
- function nt(e) {
188
- C.value?.querySelectorAll("[data-contract-render-wrapper], [data-contract-render-control]").forEach((t) => t.classList.toggle("is-active", !!e && t.dataset.key === e));
283
+ function kt(e) {
284
+ return tt.value.get(e) ?? [];
189
285
  }
190
- function rt(e) {
191
- e.variableKey ? Z(e.variableKey) : e.pageId && dt(e.pageId);
286
+ function Y(e) {
287
+ return Je.value.get(e.key) ?? {
288
+ options: e.options ?? [],
289
+ loading: !1
290
+ };
192
291
  }
193
- function it(e) {
194
- return Be.value.get(e) ?? [];
292
+ function At(e) {
293
+ let t = e.componentKey || e.type || "";
294
+ return t ? w.controlRegistry?.[t] : void 0;
295
+ }
296
+ function X(e, t) {
297
+ let n = new Map(Je.value);
298
+ n.set(e, t), Je.value = n;
299
+ }
300
+ function jt(e) {
301
+ T("control-warning", e);
302
+ }
303
+ async function Mt() {
304
+ R.forEach((e) => e.abort()), R.clear(), Ye.clear(), Xe.clear();
305
+ let e = Array.isArray(w.template?.variables) ? w.template.variables : [];
306
+ await Promise.all(e.map(async (e) => {
307
+ if (!e?.key) return;
308
+ let t = Array.isArray(e.options) ? e.options.map((e) => ({ ...e })) : [];
309
+ if (e.dataSource ? await Nt(e, t) : X(e.key, {
310
+ options: t,
311
+ loading: !1
312
+ }), e.type === "custom" && !At(e)) {
313
+ let t = e.componentKey || "", n = `${e.key}:${t}`;
314
+ Xe.has(n) || (Xe.add(n), jt({
315
+ code: "CONTROL_COMPONENT_MISSING",
316
+ variableKey: e.key,
317
+ componentKey: t,
318
+ message: `${e.label || e.key} 未注册自定义控件 ${t || "(空)"}`
319
+ }));
320
+ }
321
+ }));
195
322
  }
196
- function at(e) {
323
+ async function Nt(e, n) {
324
+ let r = e.dataSource;
325
+ if (!r) return;
326
+ let i = new AbortController();
327
+ R.set(e.key, i), X(e.key, {
328
+ options: n,
329
+ loading: !0
330
+ });
331
+ let a = Pt(e), o = Date.now(), s = Ye.get(a);
332
+ if (s && s.expiresAt > o) {
333
+ X(e.key, {
334
+ options: s.options,
335
+ loading: !1
336
+ }), R.delete(e.key);
337
+ return;
338
+ }
339
+ let c = "CONTROL_OPTIONS_LOAD_FAILED";
340
+ try {
341
+ r.kind === "url" && !t(r.url, w.allowedRemoteOrigins) && (c = "CONTROL_REMOTE_URL_BLOCKED");
342
+ let o = z.get(a);
343
+ o || (o = Ft(e, r, c, i), z.set(a, o), o.finally(() => {
344
+ z.get(a) === o && z.delete(a);
345
+ }).catch(() => void 0));
346
+ let s = await o;
347
+ if (i.signal.aborted) return;
348
+ let ee = Math.max(0, Number(w.remoteOptionsCacheTtlMs) || 0);
349
+ ee > 0 && Ye.set(a, {
350
+ options: s,
351
+ expiresAt: Date.now() + ee
352
+ }), X(e.key, {
353
+ options: s.length ? s : n,
354
+ loading: !1
355
+ });
356
+ } catch (t) {
357
+ let r = t instanceof Error && t.message.startsWith("高级控件请求超时");
358
+ if (i.signal.aborted && !r) return;
359
+ let a = t instanceof Error ? t.message : "高级控件选项加载失败";
360
+ X(e.key, {
361
+ options: n,
362
+ loading: !1,
363
+ error: a
364
+ }), jt({
365
+ code: c,
366
+ variableKey: e.key,
367
+ message: `${e.label || e.key}:${a}`,
368
+ cause: t
369
+ });
370
+ } finally {
371
+ R.get(e.key) === i && R.delete(e.key);
372
+ }
373
+ }
374
+ function Pt(e) {
375
+ try {
376
+ return JSON.stringify([e.type, e.dataSource]);
377
+ } catch {
378
+ return `${e.key}:${e.type}`;
379
+ }
380
+ }
381
+ async function Ft(e, r, a, o) {
382
+ let s;
383
+ if (r.kind === "resolver") {
384
+ if (!w.optionResolver) throw Error(`缺少 resolver ${r.resolverKey} 的宿主实现`);
385
+ s = await w.optionResolver({
386
+ resolverKey: r.resolverKey,
387
+ params: r.params,
388
+ variable: e,
389
+ signal: o.signal
390
+ });
391
+ } else {
392
+ if (!t(r.url, w.allowedRemoteOrigins)) throw Error(`远程地址未在 allowlist 中:${r.url}`);
393
+ if (!w.requester) throw Error("缺少宿主 requester,组件库不会直接发起网络请求");
394
+ let n = i(r.timeoutMs, w.remoteRequestTimeoutMs);
395
+ s = await It(w.requester({
396
+ url: r.url,
397
+ method: r.method || "GET",
398
+ params: r.params,
399
+ headers: r.headers,
400
+ timeoutMs: n,
401
+ signal: o.signal,
402
+ variable: e
403
+ }), o, n);
404
+ }
405
+ return n(s, r.kind === "url" ? r : void 0, e.type || "select");
406
+ }
407
+ function It(e, t, n) {
408
+ return new Promise((r, i) => {
409
+ let a = () => {
410
+ clearTimeout(c), t.signal.removeEventListener("abort", s);
411
+ }, o = (e) => {
412
+ a(), e();
413
+ }, s = () => o(() => i(/* @__PURE__ */ Error("高级控件请求已取消"))), c = setTimeout(() => {
414
+ o(() => i(/* @__PURE__ */ Error(`高级控件请求超时(${n}ms)`))), t.abort();
415
+ }, n);
416
+ t.signal.addEventListener("abort", s, { once: !0 }), e.then((e) => o(() => r(e)), (e) => o(() => i(e)));
417
+ });
418
+ }
419
+ function Lt(e) {
420
+ let t = Y(e);
197
421
  return {
198
422
  variable: e,
199
- value: w.value[e.key],
200
- errors: it(e.key),
201
- active: j.value === e.key,
202
- readonly: x.readonly,
203
- disabled: x.disabled,
423
+ value: D.value[e.key],
424
+ errors: kt(e.key),
425
+ active: M.value === e.key,
426
+ readonly: w.readonly,
427
+ disabled: w.disabled,
428
+ options: t.options,
429
+ loading: t.loading,
430
+ loadError: t.error,
204
431
  updateValue: (t) => G(e.key, t),
205
- focusVariable: () => Z(e.key)
432
+ focusVariable: () => J(e.key)
206
433
  };
207
434
  }
208
- function ot() {
209
- let e = R.value;
435
+ function Rt() {
436
+ let e = H.value;
210
437
  if (!e.length) return;
211
- let t = e.findIndex((e) => e.key === j.value), n = t < 0 ? 0 : t + 1;
438
+ let t = e.findIndex((e) => e.key === M.value), n = t < 0 ? 0 : t + 1;
212
439
  for (let t = 0; t < e.length; t += 1) {
213
- let i = e[(n + t) % e.length];
214
- if (r(w.value[i.key])) {
215
- Z(i.key);
440
+ let r = e[(n + t) % e.length];
441
+ if (s(D.value[r.key])) {
442
+ J(r.key);
216
443
  return;
217
444
  }
218
445
  }
219
446
  }
220
- function st() {
221
- !x.collapsiblePanel || x.interactionMode !== "panel" || (F.value = !F.value);
447
+ function zt(e) {
448
+ let t = F.value.trim().toLocaleLowerCase();
449
+ return !t || e.key.toLocaleLowerCase().includes(t) || (e.label ?? "").toLocaleLowerCase().includes(t) ? I.value === "unfilled" ? s(D.value[e.key]) : I.value === "error" ? kt(e.key).length > 0 : !0 : !1;
222
450
  }
223
- function Q(e) {
224
- let t = ft(e);
225
- return N.value = t, S("update:zoom", t), t;
451
+ function Bt() {
452
+ F.value = "", I.value = "all";
453
+ }
454
+ function Vt(e, t) {
455
+ let n = rt.value;
456
+ if (!n.length) return;
457
+ let r = n.findIndex((t) => t.key === e), i = n[r < 0 ? 0 : (r + t + n.length) % n.length]?.key;
458
+ i && (J(i), de(() => Ht(i)));
226
459
  }
227
- function ct() {
228
- return Q(1);
460
+ function Ht(e) {
461
+ (Ge.value?.querySelector(`[data-field-key="${Q(e)}"]`))?.querySelector("input:not([disabled]), textarea:not([disabled]), button:not([disabled])")?.focus();
229
462
  }
230
- function lt() {
231
- return N.value;
463
+ function Ut(e) {
464
+ if (e.key !== "Enter" || e.target instanceof HTMLTextAreaElement) return;
465
+ let t = e.target;
466
+ if (!(t instanceof Element)) return;
467
+ let n = t.closest("[data-field-key]")?.dataset.fieldKey;
468
+ n && (e.preventDefault(), Vt(n, e.shiftKey ? -1 : 1));
469
+ }
470
+ function Wt(e) {
471
+ let t = /* @__PURE__ */ new Set();
472
+ if (typeof DOMParser < "u") return new DOMParser().parseFromString(e, "text/html").querySelectorAll("[data-key]").forEach((e) => {
473
+ let n = e.getAttribute("data-key")?.trim();
474
+ n && t.add(n);
475
+ }), t;
476
+ let n = /\bdata-key\s*=\s*(?:"([^"]+)"|'([^']+)'|([^\s>]+))/gi, r;
477
+ for (; r = n.exec(e);) {
478
+ let e = (r[1] ?? r[2] ?? r[3] ?? "").trim();
479
+ e && t.add(e);
480
+ }
481
+ return t;
232
482
  }
233
- function ut() {
234
- let e = Math.max(...B.value.map((e) => e.width), 1);
235
- return Q(Math.max(0, Le.value - 48) / e);
483
+ function Gt() {
484
+ !w.collapsiblePanel || w.interactionMode !== "panel" || (L.value = !L.value);
236
485
  }
237
- function dt(e) {
238
- e && (M.value = e, ue(() => {
239
- C.value?.querySelector(`[data-render-page-id="${pt(e)}"]`)?.scrollIntoView({
486
+ function Z(e) {
487
+ let t = Xt(e);
488
+ return P.value = t, T("update:zoom", t), t;
489
+ }
490
+ function Kt() {
491
+ return Z(1);
492
+ }
493
+ function qt() {
494
+ return P.value;
495
+ }
496
+ function Jt() {
497
+ let e = Math.max(...U.value.map((e) => e.width), 1);
498
+ return Z(Math.max(0, Ze.value - 48) / e);
499
+ }
500
+ function Yt(e) {
501
+ e && (N.value = e, de(() => {
502
+ E.value?.querySelector(`[data-render-page-id="${Q(e)}"]`)?.scrollIntoView({
240
503
  behavior: "smooth",
241
504
  block: "start",
242
505
  inline: "center"
243
506
  });
244
507
  }));
245
508
  }
246
- function ft(e) {
509
+ function Xt(e) {
247
510
  let t = Number(e);
248
- return Number.isFinite(t) ? Math.min(je, Math.max(Ae, Math.round(t * 100) / 100)) : 1;
511
+ return Number.isFinite(t) ? Math.min(ze, Math.max(Re, Math.round(t * 100) / 100)) : 1;
249
512
  }
250
- function pt(e) {
513
+ function Q(e) {
251
514
  return e.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
252
515
  }
253
- function mt(e, t) {
516
+ function Zt(e, t) {
254
517
  let n = new Set([...Object.keys(e), ...Object.keys(t)]);
255
518
  return Array.from(n).every((n) => e[n] === t[n]);
256
519
  }
257
- function ht(e) {
258
- !(e.ctrlKey || e.metaKey) || !V.value || (e.preventDefault(), Q(e.deltaY > 0 ? N.value - b : N.value + b));
520
+ function Qt(e) {
521
+ !(e.ctrlKey || e.metaKey) || !at.value || (e.preventDefault(), Z(e.deltaY > 0 ? P.value - C : P.value + C));
259
522
  }
260
523
  let $;
261
- function gt() {
262
- $?.removeEventListener("wheel", ht), $ = void 0;
263
- }
264
- function _t(e) {
265
- gt(), e && (e.addEventListener("wheel", ht, { passive: !1 }), $ = e);
266
- }
267
- return _(C, (e) => {
268
- _t(e);
269
- }, { immediate: !0 }), de(() => {
270
- gt(), X();
271
- }), Ne({
272
- getValues: K,
273
- setValues: Je,
274
- validate: q,
275
- submit: Ye,
276
- resetValues: Xe,
277
- scrollToVariable: Z,
278
- setZoom: Q,
279
- resetZoom: ct,
280
- getZoom: lt,
281
- fitWidth: ut,
282
- scrollToPage: dt
283
- }), (e, t) => (p(), c("section", {
524
+ function $t() {
525
+ $?.removeEventListener("wheel", Qt), $ = void 0;
526
+ }
527
+ function en(e) {
528
+ $t(), e && (e.addEventListener("wheel", Qt, { passive: !1 }), $ = e);
529
+ }
530
+ return b(E, (e) => {
531
+ en(e);
532
+ }, { immediate: !0 }), pe(() => {
533
+ $t(), q(), R.forEach((e) => e.abort()), R.clear();
534
+ }), Ve({
535
+ getValues: ht,
536
+ setValues: gt,
537
+ validate: _t,
538
+ submit: vt,
539
+ resetValues: yt,
540
+ scrollToVariable: J,
541
+ setZoom: Z,
542
+ resetZoom: Kt,
543
+ getZoom: qt,
544
+ fitWidth: Jt,
545
+ scrollToPage: Yt
546
+ }), (e, t) => (g(), f("section", {
284
547
  ref_key: "rendererElement",
285
- ref: Fe,
286
- class: f(["gd-contract-template-renderer", {
287
- "is-disabled": d.disabled,
288
- "is-readonly": d.readonly,
289
- "is-panel": d.interactionMode === "panel",
290
- "is-inline": d.interactionMode === "inline"
548
+ ref: We,
549
+ class: fe(["gd-contract-template-renderer", {
550
+ "is-disabled": h.disabled,
551
+ "is-readonly": h.readonly,
552
+ "is-panel": h.interactionMode === "panel",
553
+ "is-inline": h.interactionMode === "inline"
291
554
  }]),
292
- onClick: Ke,
293
- onKeydown: qe,
294
- onInput: Ge,
295
- onChange: Ge
555
+ onClick: pt,
556
+ onKeydown: mt,
557
+ onInput: ft,
558
+ onChange: ft
296
559
  }, [
297
- V.value ? (p(), o(ie, {
560
+ at.value ? (g(), u(ie, {
298
561
  key: 0,
299
- title: d.title,
300
- "filled-count": H.value,
301
- "total-count": R.value.length,
302
- "required-missing-count": U.value,
303
- zoom: N.value,
304
- pages: B.value,
305
- "active-page-id": M.value,
306
- "min-zoom": Ae,
307
- "max-zoom": je,
308
- "show-toolbar": d.showToolbar,
309
- "show-validate-button": d.showValidateButton,
310
- "show-reset-button": d.showResetButton,
311
- "show-submit-button": d.showSubmitButton,
312
- "show-panel-toggle": d.interactionMode === "panel" && d.collapsiblePanel,
313
- "panel-collapsed": F.value,
314
- readonly: d.readonly,
315
- disabled: d.disabled,
316
- onZoomIn: t[0] ||= (e) => Q(N.value + b),
317
- onZoomOut: t[1] ||= (e) => Q(N.value - b),
318
- onResetZoom: ct,
319
- onFitWidth: ut,
320
- onSelectPage: dt,
321
- onValidate: q,
322
- onReset: Xe,
323
- onSubmit: Ye,
324
- onTogglePanel: st
562
+ title: h.title,
563
+ "filled-count": ot.value,
564
+ "total-count": H.value.length,
565
+ "required-missing-count": st.value,
566
+ zoom: P.value,
567
+ pages: U.value,
568
+ "active-page-id": N.value,
569
+ "min-zoom": Re,
570
+ "max-zoom": ze,
571
+ "show-toolbar": h.showToolbar,
572
+ "show-validate-button": h.showValidateButton,
573
+ "show-reset-button": h.showResetButton,
574
+ "show-submit-button": h.showSubmitButton,
575
+ "show-panel-toggle": h.interactionMode === "panel" && h.collapsiblePanel,
576
+ "panel-collapsed": L.value,
577
+ readonly: h.readonly,
578
+ disabled: h.disabled,
579
+ onZoomIn: t[0] ||= (e) => Z(P.value + C),
580
+ onZoomOut: t[1] ||= (e) => Z(P.value - C),
581
+ onResetZoom: Kt,
582
+ onFitWidth: Jt,
583
+ onSelectPage: Yt,
584
+ onValidate: _t,
585
+ onReset: bt,
586
+ onSubmit: vt,
587
+ onTogglePanel: Gt
325
588
  }, {
326
- extra: v(() => [pe(e.$slots, "headerExtra")]),
589
+ extra: x(() => [he(e.$slots, "headerExtra")]),
327
590
  _: 3
328
591
  }, 8, [
329
592
  "title",
@@ -341,102 +604,122 @@ var be = {
341
604
  "panel-collapsed",
342
605
  "readonly",
343
606
  "disabled"
344
- ])) : s("", !0),
345
- We.value ? (p(), o(oe, {
607
+ ])) : d("", !0),
608
+ dt.value ? (g(), u(oe, {
346
609
  key: 1,
347
- passed: He.value,
348
- summary: Ue.value,
349
- errors: L.value,
350
- expanded: O.value,
351
- onToggle: t[2] ||= (e) => O.value = !O.value,
352
- onFocusError: rt
610
+ passed: lt.value,
611
+ summary: ut.value,
612
+ errors: V.value,
613
+ expanded: A.value,
614
+ onToggle: t[2] ||= (e) => A.value = !A.value,
615
+ onFocusError: Ot
353
616
  }, null, 8, [
354
617
  "passed",
355
618
  "summary",
356
619
  "errors",
357
620
  "expanded"
358
- ])) : s("", !0),
359
- V.value ? (p(), c("div", {
621
+ ])) : d("", !0),
622
+ at.value ? (g(), f("div", {
360
623
  key: 3,
361
- class: f(["gd-contract-template-renderer__workspace", { "is-inline": d.interactionMode === "inline" }])
362
- }, [l("div", {
624
+ class: fe(["gd-contract-template-renderer__workspace", { "is-inline": h.interactionMode === "inline" }])
625
+ }, [p("div", {
363
626
  ref_key: "pagesViewportElement",
364
- ref: C,
627
+ ref: E,
365
628
  class: "gd-contract-template-renderer__pages-viewport",
366
- "data-highlighted-variable-key": A.value
367
- }, [l("div", Se, [(p(!0), c(se, null, fe(B.value, (e, t) => (p(), o(ae, {
629
+ "data-highlighted-variable-key": qe.value
630
+ }, [p("div", Oe, [(g(!0), f(se, null, me(U.value, (e, t) => (g(), u(ae, {
368
631
  key: e.id,
369
632
  page: e,
370
633
  index: t,
371
- total: B.value.length,
372
- zoom: N.value,
373
- "show-meta": d.showPageMeta
634
+ total: U.value.length,
635
+ zoom: P.value,
636
+ "show-meta": h.showPageMeta
374
637
  }, null, 8, [
375
638
  "page",
376
639
  "index",
377
640
  "total",
378
641
  "zoom",
379
642
  "show-meta"
380
- ]))), 128))])], 8, xe), d.interactionMode === "panel" ? (p(), c("div", {
643
+ ]))), 128))])], 8, De), h.interactionMode === "panel" ? (g(), f("div", {
381
644
  key: 0,
382
- class: f(["gd-contract-template-renderer__panel-wrap", { "is-collapsed": F.value && d.collapsiblePanel }])
383
- }, [d.collapsiblePanel ? (p(), o(g(ge), {
645
+ class: fe(["gd-contract-template-renderer__panel-wrap", { "is-collapsed": L.value && h.collapsiblePanel }])
646
+ }, [h.collapsiblePanel ? (g(), u(y(xe), {
384
647
  key: 0,
385
- title: F.value ? "展开填写面板" : "收起填写面板"
648
+ title: L.value ? "展开填写面板" : "收起填写面板"
386
649
  }, {
387
- default: v(() => [l("button", {
650
+ default: x(() => [p("button", {
388
651
  type: "button",
389
652
  class: "gd-contract-template-renderer__panel-handle",
390
- "aria-label": F.value ? "展开填写面板" : "收起填写面板",
391
- "aria-expanded": !F.value,
392
- onClick: t[3] ||= (e) => F.value = !F.value
393
- }, [F.value ? (p(), o(g(ve), {
653
+ "aria-label": L.value ? "展开填写面板" : "收起填写面板",
654
+ "aria-expanded": !L.value,
655
+ onClick: t[3] ||= (e) => L.value = !L.value
656
+ }, [L.value ? (g(), u(y(Ce), {
394
657
  key: 0,
395
658
  "aria-hidden": "true"
396
- })) : (p(), o(g(ye), {
659
+ })) : (g(), u(y(we), {
397
660
  key: 1,
398
661
  "aria-hidden": "true"
399
- }))], 8, Ce)]),
662
+ }))], 8, ke)]),
400
663
  _: 1
401
- }, 8, ["title"])) : s("", !0), l("div", we, [l("aside", Te, [l("div", Ee, [
402
- l("div", De, [l("div", null, [t[5] ||= l("strong", null, "填写项", -1), l("span", null, h(H.value) + " / " + h(R.value.length) + " 已填写", 1)]), l("span", null, h(U.value ? `${U.value} 项必填未完成` : "必填项已完成"), 1)]),
403
- l("div", Oe, [u(g(me), {
664
+ }, 8, ["title"])) : d("", !0), p("div", Ae, [p("aside", je, [p("div", Me, [
665
+ p("div", Ne, [p("div", null, [t[6] ||= p("strong", null, "填写项", -1), p("span", null, v(ot.value) + " / " + v(H.value.length) + " 已填写", 1)]), p("span", null, v(st.value ? `${st.value} 项必填未完成` : "必填项已完成"), 1)]),
666
+ m(y(_e), {
667
+ value: F.value,
668
+ "onUpdate:value": t[4] ||= (e) => F.value = e,
669
+ "allow-clear": "",
404
670
  size: "small",
405
- type: P.value ? "primary" : "default",
406
- onClick: t[4] ||= (e) => P.value = !P.value
671
+ class: "gd-contract-template-renderer__field-search",
672
+ placeholder: "搜索字段名称或标识"
407
673
  }, {
408
- default: v(() => [...t[6] ||= [ce(" 仅看未填 ", -1)]]),
674
+ prefix: x(() => [m(y(Te), { "aria-hidden": "true" })]),
409
675
  _: 1
410
- }, 8, ["type"]), u(g(me), {
676
+ }, 8, ["value"]),
677
+ p("div", Pe, [m(y(be), {
678
+ value: I.value,
679
+ "onUpdate:value": t[5] ||= (e) => I.value = e,
680
+ size: "small",
681
+ class: "gd-contract-template-renderer__field-filter",
682
+ options: Ue
683
+ }, null, 8, ["value"]), m(y(ge), {
411
684
  size: "small",
412
- disabled: !ze.value,
413
- onClick: ot
685
+ disabled: !et.value,
686
+ onClick: Rt
414
687
  }, {
415
- default: v(() => [...t[7] ||= [ce(" 下一个未填项 ", -1)]]),
688
+ default: x(() => [...t[7] ||= [le(" 下一个未填项 ", -1)]]),
416
689
  _: 1
417
690
  }, 8, ["disabled"])]),
418
- u(g(he), {
419
- percent: Ve.value,
691
+ m(y(ye), {
692
+ percent: ct.value,
420
693
  size: "small",
421
694
  "show-info": !1
422
695
  }, null, 8, ["percent"])
423
- ]), z.value.length ? (p(), c("div", {
696
+ ]), rt.value.length ? (g(), f("div", {
424
697
  key: 1,
425
698
  ref_key: "fieldListElement",
426
- ref: Ie,
427
- class: "gd-contract-template-renderer__field-list"
428
- }, [(p(!0), c(se, null, fe(z.value, (t) => (p(), c("div", {
699
+ ref: Ge,
700
+ class: "gd-contract-template-renderer__field-list",
701
+ onKeydownCapture: Ut
702
+ }, [(g(!0), f(se, null, me(it.value, (t) => (g(), f("div", {
703
+ key: t.id,
704
+ class: "gd-contract-template-renderer__field-group"
705
+ }, [p("div", Fe, [p("strong", null, v(t.title), 1), p("span", null, v(t.variables.length) + " / " + v(t.totalCount) + " 项", 1)]), p("div", Ie, [(g(!0), f(se, null, me(t.variables, (t) => (g(), f("div", {
429
706
  key: t.id || t.key,
430
707
  "data-field-key": t.key
431
- }, [pe(e.$slots, "field", le({ ref_for: !0 }, at(t)), () => [u(re, {
708
+ }, [he(e.$slots, "field", ue({ ref_for: !0 }, Lt(t)), () => [m(re, {
432
709
  variable: t,
433
- value: w.value[t.key],
434
- errors: it(t.key),
435
- active: j.value === t.key,
436
- readonly: d.readonly,
437
- disabled: d.disabled,
710
+ value: D.value[t.key],
711
+ errors: kt(t.key),
712
+ active: M.value === t.key,
713
+ readonly: h.readonly,
714
+ disabled: h.disabled,
715
+ options: Y(t).options,
716
+ loading: Y(t).loading,
717
+ "load-error": Y(t).error,
718
+ registration: At(t),
719
+ "selector-http": h.selectorHttp,
720
+ "selector-url-prefix": h.selectorUrlPrefix,
438
721
  onUpdateValue: (e) => G(t.key, e),
439
- onFocusVariable: (e) => Z(t.key)
722
+ onFocusVariable: (e) => J(t.key)
440
723
  }, null, 8, [
441
724
  "variable",
442
725
  "value",
@@ -444,18 +727,40 @@ var be = {
444
727
  "active",
445
728
  "readonly",
446
729
  "disabled",
730
+ "options",
731
+ "loading",
732
+ "load-error",
733
+ "registration",
734
+ "selector-http",
735
+ "selector-url-prefix",
447
736
  "onUpdateValue",
448
737
  "onFocusVariable"
449
- ])])], 8, ke))), 128))], 512)) : (p(), o(g(y), {
738
+ ])])], 8, Le))), 128))])]))), 128))], 544)) : (g(), u(y(S), {
450
739
  key: 0,
451
- description: R.value.length ? "暂无未填项" : "暂无填写项",
452
- image: g(y).PRESENTED_IMAGE_SIMPLE
453
- }, null, 8, ["description", "image"]))])])], 2)) : s("", !0)], 2)) : (p(), c("div", be, [u(g(y), {
740
+ class: "gd-contract-template-renderer__field-empty",
741
+ description: H.value.length ? "没有符合条件的填写项" : "暂无填写项",
742
+ image: y(S).PRESENTED_IMAGE_SIMPLE
743
+ }, ce({
744
+ default: x(() => [F.value || I.value !== "all" ? (g(), u(y(ge), {
745
+ key: 0,
746
+ type: "link",
747
+ size: "small",
748
+ onClick: Bt
749
+ }, {
750
+ default: x(() => [...t[9] ||= [le("清除筛选", -1)]]),
751
+ _: 1
752
+ })) : d("", !0)]),
753
+ _: 2
754
+ }, [F.value || I.value !== "all" ? {
755
+ name: "description",
756
+ fn: x(() => [t[8] ||= p("span", null, "没有符合条件的填写项", -1)]),
757
+ key: "0"
758
+ } : void 0]), 1032, ["description", "image"]))])])], 2)) : d("", !0)], 2)) : (g(), f("div", Ee, [m(y(S), {
454
759
  description: "暂无可渲染的合同页面",
455
- image: g(y).PRESENTED_IMAGE_SIMPLE
760
+ image: y(S).PRESENTED_IMAGE_SIMPLE
456
761
  }, null, 8, ["image"])]))
457
762
  ], 34));
458
763
  }
459
764
  });
460
765
  //#endregion
461
- export { Ne as default };
766
+ export { Ve as default };