@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
@@ -3,18 +3,16 @@ import { buildInitialRenderValues as t, buildTemplateRenderPages as n, isEmptyRe
3
3
  import re from "./ContractTemplateRendererField.mjs";
4
4
  import ie from "./ContractTemplateRendererHeader.mjs";
5
5
  import ae from "./ContractTemplateRendererPage.mjs";
6
- import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as oe, createVNode as d, defineComponent as f, mergeProps as se, nextTick as ce, normalizeClass as p, onBeforeUnmount as le, openBlock as m, ref as h, renderList as g, renderSlot as ue, toDisplayString as _, unref as v, watch as y, withCtx as b } from "vue";
7
- import { Button as de, Empty as x, Progress as fe, Tooltip as pe } from "ant-design-vue";
8
- import { useElementSize as me } from "@vueuse/core";
9
- import { LeftOutlined as he, RightOutlined as ge } from "@ant-design/icons-vue";
6
+ 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";
10
11
  //#region src/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue?vue&type=script&setup=true&lang.ts
11
- var _e = { class: "gd-contract-template-renderer__validation-bar" }, ve = ["aria-expanded"], ye = {
12
- key: 0,
13
- class: "gd-contract-template-renderer__validation-list"
14
- }, be = ["onClick"], xe = {
12
+ var be = {
15
13
  key: 2,
16
14
  class: "gd-contract-template-renderer__empty"
17
- }, Se = ["data-highlighted-variable-key"], Ce = { class: "gd-contract-template-renderer__pages" }, we = ["aria-label", "aria-expanded"], Te = { class: "gd-contract-template-renderer__panel-clip" }, Ee = { class: "gd-contract-template-renderer__panel" }, De = { class: "gd-contract-template-renderer__panel-head" }, Oe = { class: "gd-contract-template-renderer__panel-head-row" }, ke = { class: "gd-contract-template-renderer__panel-head-actions" }, Ae = ["data-field-key"], je = .5, Me = 1.5, S = .1, Ne = 3e3, Pe = /* @__PURE__ */ f({
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({
18
16
  name: "ProContractTemplateRenderer",
19
17
  __name: "ProContractTemplateRenderer",
20
18
  props: {
@@ -67,265 +65,265 @@ var _e = { class: "gd-contract-template-renderer__validation-bar" }, ve = ["aria
67
65
  "submit",
68
66
  "update:zoom"
69
67
  ],
70
- setup(f, { expose: Pe, emit: Fe }) {
71
- let C = f, w = Fe, Ie = h(), T = h(), Le = h(), E = h(i(C.template, C.values)), D = h({ ...E.value }), O = h(!1), k = h([]), A = h(!1), j = h(!1), M = h(""), N = h(""), P = h(""), F = h(ht(C.zoom)), I = h(!1), L = h(!1), { width: Re } = me(T), ze = o(() => C.readonly || C.disabled), R = o(() => te(C.template)), z = o(() => O.value ? k.value : R.value), B = o(() => (Array.isArray(C.template?.variables) ? C.template.variables : []).filter((t) => !!t?.key && e(t.type ?? "text"))), V = o(() => I.value ? B.value.filter((e) => r(E.value[e.key])) : B.value), Be = o(() => B.value.filter((e) => r(E.value[e.key])).length), Ve = o(() => {
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(() => {
72
70
  let e = /* @__PURE__ */ new Map();
73
- return z.value.forEach((t) => {
71
+ return L.value.forEach((t) => {
74
72
  t.variableKey && e.set(t.variableKey, [...e.get(t.variableKey) ?? [], t]);
75
73
  }), e;
76
- }), H = o(() => {
77
- let e = C.interactionMode === "panel";
78
- return n(C.template, e ? E.value : D.value, {
79
- readonly: C.readonly,
80
- disabled: C.disabled,
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,
81
79
  mode: e ? "display" : "control",
82
- activeKey: e ? N.value : ""
80
+ activeKey: e ? j.value : ""
83
81
  });
84
- }), U = o(() => H.value.length > 0), W = o(() => B.value.filter((e) => !r(E.value[e.key])).length), G = o(() => B.value.filter((e) => e.required && r(E.value[e.key])).length), He = o(() => B.value.length ? Math.round(W.value / B.value.length * 100) : 0), Ue = o(() => O.value && k.value.length === 0), We = o(() => O.value ? Ue.value ? "校验通过,模板与填写值均符合规则" : `发现 ${k.value.length} 个模板或填写问题` : R.value.length ? `模板存在 ${R.value.length} 个问题,已安全降级展示` : ""), Ge = o(() => O.value ? z.value.length > 0 || j.value : R.value.length > 0);
85
- y(() => C.template, (e) => {
86
- K(i(e, C.values), !1), $e();
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();
87
85
  let t = Array.isArray(e?.pages) ? e.pages.map((e) => e?.id) : [];
88
- t.includes(P.value) || (P.value = t.find(Boolean) ?? ""), N.value && !B.value.some((e) => e.key === N.value) && it();
89
- }, { deep: !0 }), y(() => C.values, (e) => {
90
- let t = i(C.template, e);
91
- _t(t, E.value) || (K(t, !1), $e());
92
- }, { deep: !0 }), y(() => C.interactionMode, (e) => {
93
- e === "inline" && (D.value = { ...E.value });
94
- }), y(() => C.collapsiblePanel, (e) => {
95
- e || (L.value = !1);
96
- }), y(() => C.zoom, (e) => F.value = ht(e)), y(H, (e) => {
97
- !P.value && e.length && (P.value = e[0].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);
98
96
  }, { immediate: !0 });
99
- function K(e, t = !0, n = {}) {
100
- E.value = { ...e }, n.refreshInlineHtml !== !1 && (D.value = { ...e }), t && (w("update:values", { ...E.value }), w("change", { ...E.value }));
97
+ 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 }));
101
99
  }
102
- function q(e, t) {
103
- !e || ze.value || (K({
104
- ...E.value,
100
+ function G(e, t) {
101
+ !e || Re.value || (W({
102
+ ...w.value,
105
103
  [e]: t
106
- }, !0, { refreshInlineHtml: C.interactionMode !== "inline" }), O.value && Xe());
104
+ }, !0, { refreshInlineHtml: x.interactionMode !== "inline" }), E.value && q());
107
105
  }
108
- function Ke(e) {
109
- if (C.interactionMode !== "inline") return;
106
+ function Ge(e) {
107
+ if (x.interactionMode !== "inline") return;
110
108
  let t = e.target;
111
109
  if (!(t instanceof HTMLInputElement) && !(t instanceof HTMLTextAreaElement)) return;
112
110
  let n = t.dataset.key || "";
113
- n && (t instanceof HTMLInputElement && t.type === "checkbox" ? q(n, t.checked) : t instanceof HTMLInputElement && t.type === "number" ? q(n, t.value === "" ? void 0 : t.valueAsNumber) : q(n, t.value));
111
+ 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));
114
112
  }
115
- function qe(e) {
113
+ function Ke(e) {
116
114
  let t = e.target;
117
115
  if (!(t instanceof Element)) return;
118
116
  let n = t.closest("[data-render-page-id]");
119
- n?.dataset.renderPageId && (P.value = n.dataset.renderPageId);
117
+ n?.dataset.renderPageId && (M.value = n.dataset.renderPageId);
120
118
  let r = t.closest("[data-contract-render-wrapper], [data-contract-render-control]")?.dataset.key || "";
121
- r && rt(r);
119
+ r && et(r);
122
120
  }
123
- function Je(e) {
121
+ function qe(e) {
124
122
  if (e.key !== "Enter" && e.key !== " ") return;
125
123
  let t = e.target;
126
- !(t instanceof HTMLElement) || !t.dataset.key || (e.preventDefault(), rt(t.dataset.key));
124
+ !(t instanceof HTMLElement) || !t.dataset.key || (e.preventDefault(), et(t.dataset.key));
127
125
  }
128
- function J() {
129
- return { ...E.value };
126
+ function K() {
127
+ return { ...w.value };
130
128
  }
131
- function Ye(e) {
132
- K(i(C.template, e));
129
+ function Je(e) {
130
+ W(i(x.template, e));
133
131
  }
134
- function Xe() {
135
- let e = ne(C.template, E.value);
136
- return et(e), w("validate", e), e;
132
+ function q() {
133
+ let e = ne(x.template, w.value);
134
+ return Ze(e), S("validate", e), e;
137
135
  }
138
- function Ze() {
139
- let e = ee(C.template, E.value, C.validateOnSubmit);
140
- if ((C.validateOnSubmit || e.length) && (et(e), w("validate", e)), e.length) return ot(e[0]), !1;
141
- let t = J();
142
- return w("submit", t), t;
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;
143
141
  }
144
- function Qe() {
145
- return K(t(C.template)), $e(), J();
142
+ function Xe() {
143
+ return W(t(x.template)), J(), K();
146
144
  }
147
- function $e() {
148
- O.value = !1, k.value = [], A.value = !1, j.value = !1, X();
145
+ function J() {
146
+ E.value = !1, D.value = [], O.value = !1, k.value = !1, X();
149
147
  }
150
- function et(e) {
151
- if (k.value = e, O.value = !0, A.value = !1, e.length) {
152
- j.value = !1, X();
148
+ function Ze(e) {
149
+ if (D.value = e, E.value = !0, O.value = !1, e.length) {
150
+ k.value = !1, X();
153
151
  return;
154
152
  }
155
- tt();
153
+ Qe();
156
154
  }
157
155
  let Y;
158
156
  function X() {
159
157
  Y &&= (clearTimeout(Y), void 0);
160
158
  }
161
- function tt() {
162
- X(), j.value = !0, Y = setTimeout(() => {
163
- j.value = !1, Y = void 0;
164
- }, Ne);
159
+ function Qe() {
160
+ X(), k.value = !0, Y = setTimeout(() => {
161
+ k.value = !1, Y = void 0;
162
+ }, Me);
165
163
  }
166
164
  function Z(e) {
167
- rt(e, !0);
165
+ et(e, !0);
168
166
  }
169
- function nt(e) {
170
- C.interactionMode === "panel" && (L.value &&= !1, I.value && B.value.some((t) => t.key === e) && !V.value.some((t) => t.key === e) && (I.value = !1));
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));
171
169
  }
172
- function rt(e, t = !1) {
173
- e && (nt(e), N.value = e, M.value = e, ce(() => {
174
- at(e);
175
- let n = T.value?.querySelector(`[data-key="${gt(e)}"]`), r = n?.closest("[data-render-page-id]");
176
- r?.dataset.renderPageId && (P.value = r.dataset.renderPageId), t && n?.scrollIntoView({
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({
177
175
  behavior: "smooth",
178
176
  block: "center",
179
177
  inline: "center"
180
- }), C.interactionMode === "panel" && Le.value?.querySelector(`[data-field-key="${gt(e)}"]`)?.scrollIntoView({
178
+ }), x.interactionMode === "panel" && Ie.value?.querySelector(`[data-field-key="${pt(e)}"]`)?.scrollIntoView({
181
179
  behavior: "smooth",
182
180
  block: "nearest"
183
181
  });
184
182
  }));
185
183
  }
186
- function it() {
187
- N.value = "", M.value = "", at("");
184
+ function tt() {
185
+ j.value = "", A.value = "", nt("");
188
186
  }
189
- function at(e) {
190
- T.value?.querySelectorAll("[data-contract-render-wrapper], [data-contract-render-control]").forEach((t) => t.classList.toggle("is-active", !!e && t.dataset.key === e));
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));
191
189
  }
192
- function ot(e) {
193
- e.variableKey ? Z(e.variableKey) : e.pageId && mt(e.pageId);
190
+ function rt(e) {
191
+ e.variableKey ? Z(e.variableKey) : e.pageId && dt(e.pageId);
194
192
  }
195
- function st(e) {
196
- return Ve.value.get(e) ?? [];
193
+ function it(e) {
194
+ return Be.value.get(e) ?? [];
197
195
  }
198
- function ct(e) {
196
+ function at(e) {
199
197
  return {
200
198
  variable: e,
201
- value: E.value[e.key],
202
- errors: st(e.key),
203
- active: N.value === e.key,
204
- readonly: C.readonly,
205
- disabled: C.disabled,
206
- updateValue: (t) => q(e.key, t),
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,
204
+ updateValue: (t) => G(e.key, t),
207
205
  focusVariable: () => Z(e.key)
208
206
  };
209
207
  }
210
- function lt() {
211
- let e = B.value;
208
+ function ot() {
209
+ let e = R.value;
212
210
  if (!e.length) return;
213
- let t = e.findIndex((e) => e.key === N.value), n = t < 0 ? 0 : t + 1;
211
+ let t = e.findIndex((e) => e.key === j.value), n = t < 0 ? 0 : t + 1;
214
212
  for (let t = 0; t < e.length; t += 1) {
215
213
  let i = e[(n + t) % e.length];
216
- if (r(E.value[i.key])) {
214
+ if (r(w.value[i.key])) {
217
215
  Z(i.key);
218
216
  return;
219
217
  }
220
218
  }
221
219
  }
222
- function ut() {
223
- !C.collapsiblePanel || C.interactionMode !== "panel" || (L.value = !L.value);
220
+ function st() {
221
+ !x.collapsiblePanel || x.interactionMode !== "panel" || (F.value = !F.value);
224
222
  }
225
223
  function Q(e) {
226
- let t = ht(e);
227
- return F.value = t, w("update:zoom", t), t;
224
+ let t = ft(e);
225
+ return N.value = t, S("update:zoom", t), t;
228
226
  }
229
- function dt() {
227
+ function ct() {
230
228
  return Q(1);
231
229
  }
232
- function ft() {
233
- return F.value;
230
+ function lt() {
231
+ return N.value;
234
232
  }
235
- function pt() {
236
- let e = Math.max(...H.value.map((e) => e.width), 1);
237
- return Q(Math.max(0, Re.value - 48) / e);
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);
238
236
  }
239
- function mt(e) {
240
- e && (P.value = e, ce(() => {
241
- T.value?.querySelector(`[data-render-page-id="${gt(e)}"]`)?.scrollIntoView({
237
+ function dt(e) {
238
+ e && (M.value = e, ue(() => {
239
+ C.value?.querySelector(`[data-render-page-id="${pt(e)}"]`)?.scrollIntoView({
242
240
  behavior: "smooth",
243
241
  block: "start",
244
242
  inline: "center"
245
243
  });
246
244
  }));
247
245
  }
248
- function ht(e) {
246
+ function ft(e) {
249
247
  let t = Number(e);
250
- return Number.isFinite(t) ? Math.min(Me, Math.max(je, Math.round(t * 100) / 100)) : 1;
248
+ return Number.isFinite(t) ? Math.min(je, Math.max(Ae, Math.round(t * 100) / 100)) : 1;
251
249
  }
252
- function gt(e) {
250
+ function pt(e) {
253
251
  return e.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"");
254
252
  }
255
- function _t(e, t) {
253
+ function mt(e, t) {
256
254
  let n = new Set([...Object.keys(e), ...Object.keys(t)]);
257
255
  return Array.from(n).every((n) => e[n] === t[n]);
258
256
  }
259
- function vt(e) {
260
- !(e.ctrlKey || e.metaKey) || !U.value || (e.preventDefault(), Q(e.deltaY > 0 ? F.value - S : F.value + S));
257
+ function ht(e) {
258
+ !(e.ctrlKey || e.metaKey) || !V.value || (e.preventDefault(), Q(e.deltaY > 0 ? N.value - b : N.value + b));
261
259
  }
262
260
  let $;
263
- function yt() {
264
- $?.removeEventListener("wheel", vt), $ = void 0;
265
- }
266
- function bt(e) {
267
- yt(), e && (e.addEventListener("wheel", vt, { passive: !1 }), $ = e);
268
- }
269
- return y(T, (e) => {
270
- bt(e);
271
- }, { immediate: !0 }), le(() => {
272
- yt(), X();
273
- }), Pe({
274
- getValues: J,
275
- setValues: Ye,
276
- validate: Xe,
277
- submit: Ze,
278
- resetValues: Qe,
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,
279
277
  scrollToVariable: Z,
280
278
  setZoom: Q,
281
- resetZoom: dt,
282
- getZoom: ft,
283
- fitWidth: pt,
284
- scrollToPage: mt
285
- }), (e, t) => (m(), l("section", {
279
+ resetZoom: ct,
280
+ getZoom: lt,
281
+ fitWidth: ut,
282
+ scrollToPage: dt
283
+ }), (e, t) => (p(), c("section", {
286
284
  ref_key: "rendererElement",
287
- ref: Ie,
288
- class: p(["gd-contract-template-renderer", {
289
- "is-disabled": f.disabled,
290
- "is-readonly": f.readonly,
291
- "is-panel": f.interactionMode === "panel",
292
- "is-inline": f.interactionMode === "inline"
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"
293
291
  }]),
294
- onClick: qe,
295
- onKeydown: Je,
296
- onInput: Ke,
297
- onChange: Ke
292
+ onClick: Ke,
293
+ onKeydown: qe,
294
+ onInput: Ge,
295
+ onChange: Ge
298
296
  }, [
299
- U.value ? (m(), s(ie, {
297
+ V.value ? (p(), o(ie, {
300
298
  key: 0,
301
- title: f.title,
302
- "filled-count": W.value,
303
- "total-count": B.value.length,
304
- "required-missing-count": G.value,
305
- zoom: F.value,
306
- pages: H.value,
307
- "active-page-id": P.value,
308
- "min-zoom": je,
309
- "max-zoom": Me,
310
- "show-toolbar": f.showToolbar,
311
- "show-validate-button": f.showValidateButton,
312
- "show-reset-button": f.showResetButton,
313
- "show-submit-button": f.showSubmitButton,
314
- "show-panel-toggle": f.interactionMode === "panel" && f.collapsiblePanel,
315
- "panel-collapsed": L.value,
316
- readonly: f.readonly,
317
- disabled: f.disabled,
318
- onZoomIn: t[0] ||= (e) => Q(F.value + S),
319
- onZoomOut: t[1] ||= (e) => Q(F.value - S),
320
- onResetZoom: dt,
321
- onFitWidth: pt,
322
- onSelectPage: mt,
323
- onValidate: Xe,
324
- onReset: Qe,
325
- onSubmit: Ze,
326
- onTogglePanel: ut
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
327
325
  }, {
328
- extra: b(() => [ue(e.$slots, "headerExtra")]),
326
+ extra: v(() => [pe(e.$slots, "headerExtra")]),
329
327
  _: 3
330
328
  }, 8, [
331
329
  "title",
@@ -343,103 +341,101 @@ var _e = { class: "gd-contract-template-renderer__validation-bar" }, ve = ["aria
343
341
  "panel-collapsed",
344
342
  "readonly",
345
343
  "disabled"
346
- ])) : c("", !0),
347
- Ge.value ? (m(), l("div", {
344
+ ])) : s("", !0),
345
+ We.value ? (p(), o(oe, {
348
346
  key: 1,
349
- class: p(["gd-contract-template-renderer__validation", Ue.value ? "is-success" : "is-error"]),
350
- role: "status"
351
- }, [u("div", _e, [u("span", null, _(We.value), 1), z.value.length ? (m(), l("button", {
352
- key: 0,
353
- type: "button",
354
- class: "gd-contract-template-renderer__validation-toggle",
355
- "aria-expanded": A.value,
356
- onClick: t[2] ||= (e) => A.value = !A.value
357
- }, _(A.value ? "收起" : `展开 ${z.value.length} 个问题`), 9, ve)) : c("", !0)]), A.value && z.value.length ? (m(), l("div", ye, [(m(!0), l(a, null, g(z.value, (e) => (m(), l("button", {
358
- key: `${e.code}-${e.id}-${e.message}`,
359
- type: "button",
360
- class: "gd-contract-template-renderer__validation-item",
361
- onClick: (t) => ot(e)
362
- }, _(e.message), 9, be))), 128))])) : c("", !0)], 2)) : c("", !0),
363
- U.value ? (m(), l("div", {
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
353
+ }, null, 8, [
354
+ "passed",
355
+ "summary",
356
+ "errors",
357
+ "expanded"
358
+ ])) : s("", !0),
359
+ V.value ? (p(), c("div", {
364
360
  key: 3,
365
- class: p(["gd-contract-template-renderer__workspace", { "is-inline": f.interactionMode === "inline" }])
366
- }, [u("div", {
361
+ class: f(["gd-contract-template-renderer__workspace", { "is-inline": d.interactionMode === "inline" }])
362
+ }, [l("div", {
367
363
  ref_key: "pagesViewportElement",
368
- ref: T,
364
+ ref: C,
369
365
  class: "gd-contract-template-renderer__pages-viewport",
370
- "data-highlighted-variable-key": M.value
371
- }, [u("div", Ce, [(m(!0), l(a, null, g(H.value, (e, t) => (m(), s(ae, {
366
+ "data-highlighted-variable-key": A.value
367
+ }, [l("div", Se, [(p(!0), c(se, null, fe(B.value, (e, t) => (p(), o(ae, {
372
368
  key: e.id,
373
369
  page: e,
374
370
  index: t,
375
- total: H.value.length,
376
- zoom: F.value,
377
- "show-meta": f.showPageMeta
371
+ total: B.value.length,
372
+ zoom: N.value,
373
+ "show-meta": d.showPageMeta
378
374
  }, null, 8, [
379
375
  "page",
380
376
  "index",
381
377
  "total",
382
378
  "zoom",
383
379
  "show-meta"
384
- ]))), 128))])], 8, Se), f.interactionMode === "panel" ? (m(), l("div", {
380
+ ]))), 128))])], 8, xe), d.interactionMode === "panel" ? (p(), c("div", {
385
381
  key: 0,
386
- class: p(["gd-contract-template-renderer__panel-wrap", { "is-collapsed": L.value && f.collapsiblePanel }])
387
- }, [f.collapsiblePanel ? (m(), s(v(pe), {
382
+ class: f(["gd-contract-template-renderer__panel-wrap", { "is-collapsed": F.value && d.collapsiblePanel }])
383
+ }, [d.collapsiblePanel ? (p(), o(g(ge), {
388
384
  key: 0,
389
- title: L.value ? "展开填写面板" : "收起填写面板"
385
+ title: F.value ? "展开填写面板" : "收起填写面板"
390
386
  }, {
391
- default: b(() => [u("button", {
387
+ default: v(() => [l("button", {
392
388
  type: "button",
393
389
  class: "gd-contract-template-renderer__panel-handle",
394
- "aria-label": L.value ? "展开填写面板" : "收起填写面板",
395
- "aria-expanded": !L.value,
396
- onClick: t[3] ||= (e) => L.value = !L.value
397
- }, [L.value ? (m(), s(v(he), {
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), {
398
394
  key: 0,
399
395
  "aria-hidden": "true"
400
- })) : (m(), s(v(ge), {
396
+ })) : (p(), o(g(ye), {
401
397
  key: 1,
402
398
  "aria-hidden": "true"
403
- }))], 8, we)]),
399
+ }))], 8, Ce)]),
404
400
  _: 1
405
- }, 8, ["title"])) : c("", !0), u("div", Te, [u("aside", Ee, [u("div", De, [
406
- u("div", Oe, [u("div", null, [t[5] ||= u("strong", null, "填写项", -1), u("span", null, _(W.value) + " / " + _(B.value.length) + " 已填写", 1)]), u("span", null, _(G.value ? `${G.value} 项必填未完成` : "必填项已完成"), 1)]),
407
- u("div", ke, [d(v(de), {
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), {
408
404
  size: "small",
409
- type: I.value ? "primary" : "default",
410
- onClick: t[4] ||= (e) => I.value = !I.value
405
+ type: P.value ? "primary" : "default",
406
+ onClick: t[4] ||= (e) => P.value = !P.value
411
407
  }, {
412
- default: b(() => [...t[6] ||= [oe(" 仅看未填 ", -1)]]),
408
+ default: v(() => [...t[6] ||= [ce(" 仅看未填 ", -1)]]),
413
409
  _: 1
414
- }, 8, ["type"]), d(v(de), {
410
+ }, 8, ["type"]), u(g(me), {
415
411
  size: "small",
416
- disabled: !Be.value,
417
- onClick: lt
412
+ disabled: !ze.value,
413
+ onClick: ot
418
414
  }, {
419
- default: b(() => [...t[7] ||= [oe(" 下一个未填项 ", -1)]]),
415
+ default: v(() => [...t[7] ||= [ce(" 下一个未填项 ", -1)]]),
420
416
  _: 1
421
417
  }, 8, ["disabled"])]),
422
- d(v(fe), {
423
- percent: He.value,
418
+ u(g(he), {
419
+ percent: Ve.value,
424
420
  size: "small",
425
421
  "show-info": !1
426
422
  }, null, 8, ["percent"])
427
- ]), V.value.length ? (m(), l("div", {
423
+ ]), z.value.length ? (p(), c("div", {
428
424
  key: 1,
429
425
  ref_key: "fieldListElement",
430
- ref: Le,
426
+ ref: Ie,
431
427
  class: "gd-contract-template-renderer__field-list"
432
- }, [(m(!0), l(a, null, g(V.value, (t) => (m(), l("div", {
428
+ }, [(p(!0), c(se, null, fe(z.value, (t) => (p(), c("div", {
433
429
  key: t.id || t.key,
434
430
  "data-field-key": t.key
435
- }, [ue(e.$slots, "field", se({ ref_for: !0 }, ct(t)), () => [d(re, {
431
+ }, [pe(e.$slots, "field", le({ ref_for: !0 }, at(t)), () => [u(re, {
436
432
  variable: t,
437
- value: E.value[t.key],
438
- errors: st(t.key),
439
- active: N.value === t.key,
440
- readonly: f.readonly,
441
- disabled: f.disabled,
442
- onUpdateValue: (e) => q(t.key, e),
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,
438
+ onUpdateValue: (e) => G(t.key, e),
443
439
  onFocusVariable: (e) => Z(t.key)
444
440
  }, null, 8, [
445
441
  "variable",
@@ -450,16 +446,16 @@ var _e = { class: "gd-contract-template-renderer__validation-bar" }, ve = ["aria
450
446
  "disabled",
451
447
  "onUpdateValue",
452
448
  "onFocusVariable"
453
- ])])], 8, Ae))), 128))], 512)) : (m(), s(v(x), {
449
+ ])])], 8, ke))), 128))], 512)) : (p(), o(g(y), {
454
450
  key: 0,
455
- description: B.value.length ? "暂无未填项" : "暂无填写项",
456
- image: v(x).PRESENTED_IMAGE_SIMPLE
457
- }, null, 8, ["description", "image"]))])])], 2)) : c("", !0)], 2)) : (m(), l("div", xe, [d(v(x), {
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), {
458
454
  description: "暂无可渲染的合同页面",
459
- image: v(x).PRESENTED_IMAGE_SIMPLE
455
+ image: g(y).PRESENTED_IMAGE_SIMPLE
460
456
  }, null, 8, ["image"])]))
461
457
  ], 34));
462
458
  }
463
459
  });
464
460
  //#endregion
465
- export { Pe as default };
461
+ export { Ne as default };