@guodun/antdv 1.4.7 → 1.5.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 (70) hide show
  1. package/dist/es/components/contract-signing-location/src/ContractSigningLocation.vue.mjs +315 -286
  2. package/dist/es/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.mjs +316 -285
  3. package/dist/es/components/contract-signing-location/src/ContractSigningTemplatePage.vue.mjs +62 -54
  4. package/dist/es/components/contract-signing-location/style/index.css +1 -1
  5. package/dist/es/components/index.mjs +1 -0
  6. package/dist/es/components/pro-contract-template-designer/index.mjs +1 -0
  7. package/dist/es/components/pro-contract-template-designer/src/ContractPrintIframe.mjs +7 -0
  8. package/dist/es/components/pro-contract-template-designer/src/ContractPrintIframe.vue.mjs +129 -0
  9. package/dist/es/components/pro-contract-template-designer/src/ContractPrintIframe.vue_vue_type_style_index_0_scoped_a9912ff0_lang.css +1 -0
  10. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.mjs +10 -5
  11. package/dist/es/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.mjs +64 -43
  12. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.mjs +82 -53
  13. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +271 -265
  14. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +762 -751
  15. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.mjs +217 -197
  16. package/dist/es/components/pro-contract-template-designer/src/constants.mjs +29 -51
  17. package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +103 -103
  18. package/dist/es/components/pro-contract-template-designer/src/extensions/word-paste.mjs +24 -21
  19. package/dist/es/components/pro-contract-template-designer/src/utils/contract-print-document.mjs +314 -0
  20. package/dist/es/components/pro-contract-template-designer/src/utils/page-decorations.mjs +1 -1
  21. package/dist/es/components/pro-contract-template-designer/src/utils/template-variable-render.mjs +47 -47
  22. package/dist/es/components/pro-contract-template-designer/src/utils/word-paste.mjs +216 -148
  23. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  24. package/dist/es/index.mjs +27 -26
  25. package/dist/lib/components/contract-signing-location/src/ContractSigningLocation.vue.cjs +1 -1
  26. package/dist/lib/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.cjs +1 -1
  27. package/dist/lib/components/contract-signing-location/src/ContractSigningTemplatePage.vue.cjs +1 -1
  28. package/dist/lib/components/contract-signing-location/style/index.css +1 -1
  29. package/dist/lib/components/index.cjs +1 -1
  30. package/dist/lib/components/pro-contract-template-designer/index.cjs +1 -1
  31. package/dist/lib/components/pro-contract-template-designer/src/ContractPrintIframe.cjs +1 -0
  32. package/dist/lib/components/pro-contract-template-designer/src/ContractPrintIframe.vue.cjs +1 -0
  33. package/dist/lib/components/pro-contract-template-designer/src/ContractPrintIframe.vue_vue_type_style_index_0_scoped_a9912ff0_lang.css +1 -0
  34. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.cjs +1 -1
  35. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.cjs +1 -1
  36. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.cjs +1 -1
  37. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  38. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  39. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.cjs +1 -1
  40. package/dist/lib/components/pro-contract-template-designer/src/constants.cjs +1 -1
  41. package/dist/lib/components/pro-contract-template-designer/src/extensions/template-variable.cjs +1 -1
  42. package/dist/lib/components/pro-contract-template-designer/src/extensions/word-paste.cjs +1 -1
  43. package/dist/lib/components/pro-contract-template-designer/src/utils/contract-print-document.cjs +211 -0
  44. package/dist/lib/components/pro-contract-template-designer/src/utils/page-decorations.cjs +1 -1
  45. package/dist/lib/components/pro-contract-template-designer/src/utils/template-variable-render.cjs +1 -1
  46. package/dist/lib/components/pro-contract-template-designer/src/utils/word-paste.cjs +2 -2
  47. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  48. package/dist/lib/index.cjs +1 -1
  49. package/dist/theme/contract-signing-location.css +1 -1
  50. package/dist/theme/icon.css +1 -1
  51. package/dist/theme/index.css +1 -1
  52. package/dist/types/components/contract-signing-location/src/ContractSigningLocation.vue.d.ts +7 -0
  53. package/dist/types/components/contract-signing-location/src/ContractSigningLocationCanvas.vue.d.ts +4 -0
  54. package/dist/types/components/contract-signing-location/src/ContractSigningTemplatePage.vue.d.ts +9 -3
  55. package/dist/types/components/contract-signing-location/src/types.d.ts +5 -0
  56. package/dist/types/components/pro-contract-template-designer/index.d.ts +1 -0
  57. package/dist/types/components/pro-contract-template-designer/src/ContractPrintIframe.vue.d.ts +35 -0
  58. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerToolbar.vue.d.ts +2 -2
  59. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewModal.vue.d.ts +1 -0
  60. package/dist/types/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue.d.ts +1 -0
  61. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue.d.ts +13 -1
  62. package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +6 -0
  63. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +1 -0
  64. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateRenderer.vue.d.ts +1 -0
  65. package/dist/types/components/pro-contract-template-designer/src/constants.d.ts +4 -4
  66. package/dist/types/components/pro-contract-template-designer/src/extensions/word-paste.d.ts +8 -0
  67. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +10 -0
  68. package/dist/types/components/pro-contract-template-designer/src/utils/contract-print-document.d.ts +119 -0
  69. package/dist/types/components/pro-contract-template-designer/src/utils/word-paste.d.ts +2 -0
  70. package/package.json +2 -1
@@ -1,16 +1,20 @@
1
- import { CONTRACT_PAGE_BASE_PADDING as e, getPageDecorationSafePadding as t, hasEnabledPageFooter as n, hasEnabledPageHeader as r, normalizePageDecorations as i } from "./utils/page-decorations.mjs";
2
- import a from "./ContractTemplatePageDecorations.mjs";
3
- import { resolvePageSize as o } from "./composables/use-template-designer.mjs";
4
- import s from "./ContractTemplatePreviewSigningLayer.mjs";
5
- import { computed as c, createElementBlock as l, createElementVNode as u, createVNode as d, defineComponent as f, normalizeStyle as p, openBlock as m } from "vue";
1
+ import e from "./ContractPrintIframe.mjs";
2
+ import { CONTRACT_PAGE_BASE_PADDING as t, buildPageDecorationClassNames as n, buildPageDecorationsHtml as r, getPageDecorationSafePadding as i, hasEnabledPageFooter as a, hasEnabledPageHeader as o, normalizePageDecorations as s } from "./utils/page-decorations.mjs";
3
+ import { resolvePageSize as c } from "./composables/use-template-designer.mjs";
4
+ import l from "./ContractTemplatePreviewSigningLayer.mjs";
5
+ import { computed as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createVNode as m, defineComponent as h, normalizeStyle as g, openBlock as _, shallowRef as v, toDisplayString as y } from "vue";
6
6
  //#region src/components/pro-contract-template-designer/src/ContractTemplatePreviewPage.vue?vue&type=script&setup=true&lang.ts
7
- var h = { class: "gd-contract-template-designer__preview-page-shell" }, g = [
7
+ var b = { class: "gd-contract-template-designer__preview-page-shell" }, x = [
8
8
  "data-page-id",
9
9
  "data-page-format",
10
10
  "data-page-label",
11
11
  "data-page-width",
12
12
  "data-page-height"
13
- ], _ = ["innerHTML"], v = /* @__PURE__ */ f({
13
+ ], S = {
14
+ key: 0,
15
+ class: "gd-contract-template-designer__preview-font-error",
16
+ role: "alert"
17
+ }, C = /* @__PURE__ */ h({
14
18
  name: "ContractTemplatePreviewPage",
15
19
  __name: "ContractTemplatePreviewPage",
16
20
  props: {
@@ -21,48 +25,65 @@ var h = { class: "gd-contract-template-designer__preview-page-shell" }, g = [
21
25
  pageDecorations: {},
22
26
  pageNumber: {},
23
27
  totalPages: {},
24
- variables: {}
28
+ variables: {},
29
+ fontBaseUrl: {}
25
30
  },
26
- setup(f) {
27
- let v = f, y = c(() => o(v.page.pageSize, v.fallbackPageSize)), b = c(() => {
28
- let a = i(v.pageDecorations);
31
+ setup(h) {
32
+ let C = h, w = u(() => c(C.page.pageSize, C.fallbackPageSize)), T = u(() => {
33
+ let e = s(C.pageDecorations);
29
34
  return {
30
- width: `${y.value.width}px`,
31
- height: `${y.value.height}px`,
32
- paddingTop: `${r(a, v.pageNumber) ? t(a.header) : e.top}px`,
33
- paddingBottom: `${n(a, v.pageNumber) ? t(a.footer) : e.bottom}px`
35
+ top: o(e, C.pageNumber) ? i(e.header) : t.top,
36
+ bottom: a(e, C.pageNumber) ? i(e.footer) : t.bottom
34
37
  };
35
- });
36
- return (e, t) => (m(), l("article", h, [u("section", {
37
- class: "gd-contract-template-page gd-contract-template-designer__preview-page",
38
- "data-page-id": f.page.id,
39
- "data-page-format": y.value.format ?? "Custom",
40
- "data-page-label": y.value.label ?? y.value.format ?? "自定义",
41
- "data-page-width": y.value.width,
42
- "data-page-height": y.value.height,
43
- style: p(b.value)
38
+ }), E = u(() => ({
39
+ width: `${w.value.width}px`,
40
+ height: `${w.value.height}px`
41
+ })), D = u(() => n(C.pageDecorations, C.pageNumber)), O = u(() => r(C.pageDecorations, C.pageNumber, C.totalPages, C.variables)), k = v("");
42
+ function A(e, t) {
43
+ k.value = e === "error" ? t || "合同排版度量校验失败" : "";
44
+ }
45
+ return (t, n) => (_(), f("article", b, [p("section", {
46
+ class: "gd-contract-template-designer__preview-page",
47
+ "data-page-id": h.page.id,
48
+ "data-page-format": w.value.format ?? "Custom",
49
+ "data-page-label": w.value.label ?? w.value.format ?? "自定义",
50
+ "data-page-width": w.value.width,
51
+ "data-page-height": w.value.height,
52
+ style: g(E.value)
44
53
  }, [
45
- d(a, {
46
- decorations: f.pageDecorations,
47
- "page-number": f.pageNumber,
48
- "total-pages": f.totalPages,
49
- variables: f.variables
54
+ m(e, {
55
+ "page-id": h.page.id,
56
+ "page-format": w.value.format,
57
+ width: w.value.width,
58
+ height: w.value.height,
59
+ "padding-top": T.value.top,
60
+ "padding-bottom": T.value.bottom,
61
+ "class-names": D.value,
62
+ "decorations-html": O.value,
63
+ "content-html": h.contentHtml,
64
+ "font-base-url": h.fontBaseUrl,
65
+ title: `第 ${h.pageNumber} 页合同预览`,
66
+ onStatus: A
50
67
  }, null, 8, [
51
- "decorations",
52
- "page-number",
53
- "total-pages",
54
- "variables"
68
+ "page-id",
69
+ "page-format",
70
+ "width",
71
+ "height",
72
+ "padding-top",
73
+ "padding-bottom",
74
+ "class-names",
75
+ "decorations-html",
76
+ "content-html",
77
+ "font-base-url",
78
+ "title"
55
79
  ]),
56
- u("div", {
57
- class: "gd-contract-template-page__content gd-contract-template-designer__preview-page-content",
58
- innerHTML: f.contentHtml
59
- }, null, 8, _),
60
- d(s, {
61
- "page-size": y.value,
62
- placements: f.signingPlacements
63
- }, null, 8, ["page-size", "placements"])
64
- ], 12, g)]));
80
+ m(l, {
81
+ "page-size": w.value,
82
+ placements: h.signingPlacements
83
+ }, null, 8, ["page-size", "placements"]),
84
+ k.value ? (_(), f("div", S, y(k.value), 1)) : d("", !0)
85
+ ], 12, x)]));
65
86
  }
66
87
  });
67
88
  //#endregion
68
- export { v as default };
89
+ export { C as default };
@@ -1,16 +1,20 @@
1
- import { CONTRACT_PAGE_BASE_PADDING as e, getPageDecorationSafePadding as t, hasEnabledPageFooter as n, hasEnabledPageHeader as r, normalizePageDecorations as i } from "./utils/page-decorations.mjs";
2
- import a from "./ContractTemplatePageDecorations.mjs";
3
- import { computed as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, createVNode as u, defineComponent as d, normalizeClass as f, normalizeStyle as p, openBlock as m, toDisplayString as h, unref as g } from "vue";
1
+ import e from "./ContractPrintIframe.mjs";
2
+ import { CONTRACT_PAGE_BASE_PADDING as t, buildPageDecorationClassNames as n, buildPageDecorationsHtml as r, getPageDecorationSafePadding as i, hasEnabledPageFooter as a, hasEnabledPageHeader as o, normalizePageDecorations as s } from "./utils/page-decorations.mjs";
3
+ import { computed as c, createCommentVNode as l, createElementBlock as u, createElementVNode as d, createVNode as f, defineComponent as p, normalizeStyle as m, openBlock as h, shallowRef as g, toDisplayString as _ } from "vue";
4
4
  //#region src/components/pro-contract-template-designer/src/ContractTemplateRendererPage.vue?vue&type=script&setup=true&lang.ts
5
- var _ = ["data-render-page-id"], v = {
5
+ var v = ["data-render-page-id"], y = {
6
6
  key: 0,
7
7
  class: "gd-contract-template-renderer__page-meta"
8
- }, y = [
8
+ }, b = [
9
9
  "data-page-id",
10
10
  "data-page-format",
11
11
  "data-page-width",
12
12
  "data-page-height"
13
- ], b = ["innerHTML"], x = /* @__PURE__ */ d({
13
+ ], x = {
14
+ key: 0,
15
+ class: "gd-contract-template-renderer__font-error",
16
+ role: "alert"
17
+ }, S = /* @__PURE__ */ p({
14
18
  name: "ContractTemplateRendererPage",
15
19
  __name: "ContractTemplateRendererPage",
16
20
  props: {
@@ -18,59 +22,84 @@ var _ = ["data-render-page-id"], v = {
18
22
  index: {},
19
23
  total: {},
20
24
  zoom: {},
21
- showMeta: { type: Boolean }
25
+ showMeta: { type: Boolean },
26
+ fontBaseUrl: {},
27
+ activeKey: {},
28
+ scrollRequest: {}
22
29
  },
23
- setup(d) {
24
- let x = d, S = o(() => ({
25
- width: `${x.page.width * x.zoom}px`,
26
- height: `${x.page.height * x.zoom}px`
27
- })), C = o(() => {
28
- let a = i(x.page.pageDecorations);
30
+ emits: [
31
+ "status",
32
+ "metrics",
33
+ "interaction"
34
+ ],
35
+ setup(p, { emit: S }) {
36
+ let C = p, w = S, T = c(() => ({
37
+ width: `${C.page.width * C.zoom}px`,
38
+ height: `${C.page.height * C.zoom}px`
39
+ })), E = c(() => {
40
+ let e = s(C.page.pageDecorations);
29
41
  return {
30
- width: `${x.page.width}px`,
31
- minHeight: `${x.page.height}px`,
32
- paddingTop: `${r(a, x.index + 1) ? t(a.header) : e.top}px`,
33
- paddingBottom: `${n(a, x.index + 1) ? t(a.footer) : e.bottom}px`,
34
- transform: `scale(${x.zoom})`
42
+ top: o(e, C.index + 1) ? i(e.header) : t.top,
43
+ bottom: a(e, C.index + 1) ? i(e.footer) : t.bottom
35
44
  };
36
- });
37
- return (e, t) => (m(), c("article", {
45
+ }), D = c(() => ({
46
+ width: `${C.page.width}px`,
47
+ height: `${C.page.height}px`,
48
+ transform: `scale(${C.zoom})`
49
+ })), O = c(() => n(C.page.pageDecorations, C.index + 1)), k = c(() => r(C.page.pageDecorations, C.index + 1, C.total, C.page.decorationVariables, C.page.decorationValues)), A = g("");
50
+ function j(e, t) {
51
+ A.value = e === "error" ? t || "合同排版度量校验失败" : "", w("status", e, t);
52
+ }
53
+ return (t, n) => (h(), u("article", {
38
54
  class: "gd-contract-template-renderer__page-shell",
39
- "data-render-page-id": d.page.id
40
- }, [d.showMeta ? (m(), c("header", v, [
41
- l("strong", null, "第 " + h(d.index + 1) + " / " + h(d.total) + " 页", 1),
42
- l("span", null, h(d.page.title), 1),
43
- l("small", null, h(d.page.format) + " · " + h(d.page.width) + " × " + h(d.page.height) + " px", 1)
44
- ])) : s("", !0), l("div", {
55
+ "data-render-page-id": p.page.id
56
+ }, [p.showMeta ? (h(), u("header", y, [
57
+ d("strong", null, "第 " + _(p.index + 1) + " / " + _(p.total) + " 页", 1),
58
+ d("span", null, _(p.page.title), 1),
59
+ d("small", null, _(p.page.format) + " · " + _(p.page.width) + " × " + _(p.page.height) + " px", 1)
60
+ ])) : l("", !0), d("div", {
45
61
  class: "gd-contract-template-renderer__page-frame",
46
- style: p(S.value)
47
- }, [l("section", {
48
- class: f(["gd-contract-template-page", {
49
- "has-contract-header": g(r)(d.page.pageDecorations, d.index + 1),
50
- "has-contract-footer": g(n)(d.page.pageDecorations, d.index + 1)
51
- }]),
52
- "data-page-id": d.page.id,
53
- "data-page-format": d.page.format,
54
- "data-page-width": d.page.width,
55
- "data-page-height": d.page.height,
56
- style: p(C.value)
57
- }, [u(a, {
58
- decorations: d.page.pageDecorations,
59
- "page-number": d.index + 1,
60
- "total-pages": d.total,
61
- variables: d.page.decorationVariables,
62
- values: d.page.decorationValues
62
+ style: m(T.value)
63
+ }, [d("div", {
64
+ class: "gd-contract-template-renderer__print-page",
65
+ "data-page-id": p.page.id,
66
+ "data-page-format": p.page.format,
67
+ "data-page-width": p.page.width,
68
+ "data-page-height": p.page.height,
69
+ style: m(D.value)
70
+ }, [f(e, {
71
+ "page-id": p.page.id,
72
+ "page-format": p.page.format,
73
+ width: p.page.width,
74
+ height: p.page.height,
75
+ "padding-top": E.value.top,
76
+ "padding-bottom": E.value.bottom,
77
+ "class-names": O.value,
78
+ "decorations-html": k.value,
79
+ "content-html": p.page.contentHtml,
80
+ "font-base-url": p.fontBaseUrl,
81
+ "active-key": p.activeKey,
82
+ "scroll-request": p.scrollRequest,
83
+ title: `第 ${p.index + 1} 页合同填写内容`,
84
+ onInteraction: n[0] ||= (e) => w("interaction", e),
85
+ onMetrics: n[1] ||= (e) => w("metrics", e),
86
+ onStatus: j
63
87
  }, null, 8, [
64
- "decorations",
65
- "page-number",
66
- "total-pages",
67
- "variables",
68
- "values"
69
- ]), l("div", {
70
- class: "gd-contract-template-page__content",
71
- innerHTML: d.page.contentHtml
72
- }, null, 8, b)], 14, y)], 4)], 8, _));
88
+ "page-id",
89
+ "page-format",
90
+ "width",
91
+ "height",
92
+ "padding-top",
93
+ "padding-bottom",
94
+ "class-names",
95
+ "decorations-html",
96
+ "content-html",
97
+ "font-base-url",
98
+ "active-key",
99
+ "scroll-request",
100
+ "title"
101
+ ]), A.value ? (h(), u("div", x, _(A.value), 1)) : l("", !0)], 12, b)], 4)], 8, v));
73
102
  }
74
103
  });
75
104
  //#endregion
76
- export { x as default };
105
+ export { S as default };