@guodun/antdv 1.7.7 → 1.7.9

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 (47) hide show
  1. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.mjs +5 -0
  2. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.vue.mjs +132 -0
  3. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.mjs +209 -246
  4. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +395 -325
  5. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +1047 -1015
  6. package/dist/es/components/pro-contract-template-designer/src/composables/use-auto-pagination.mjs +122 -63
  7. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +192 -162
  8. package/dist/es/components/pro-contract-template-designer/src/extensions/template-variable.mjs +70 -68
  9. package/dist/es/components/pro-contract-template-designer/src/utils/advanced-controls.mjs +63 -25
  10. package/dist/es/components/pro-contract-template-designer/src/utils/caret-viewport.mjs +41 -0
  11. package/dist/es/components/pro-contract-template-designer/src/utils/template-renderer.mjs +129 -75
  12. package/dist/es/components/pro-contract-template-designer/src/utils/template-variable-render.mjs +17 -5
  13. package/dist/es/components/pro-contract-template-designer/style/index.css +1 -1
  14. package/dist/es/index.mjs +22 -22
  15. package/dist/es/node_modules/@tiptap/pm/dist/transform/index.mjs +1 -0
  16. package/dist/es/node_modules/prosemirror-transform/dist/index.mjs +161 -67
  17. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.cjs +1 -0
  18. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.vue.cjs +1 -0
  19. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerInspector.vue.cjs +1 -2
  20. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  21. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  22. package/dist/lib/components/pro-contract-template-designer/src/composables/use-auto-pagination.cjs +1 -1
  23. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
  24. package/dist/lib/components/pro-contract-template-designer/src/extensions/template-variable.cjs +1 -1
  25. package/dist/lib/components/pro-contract-template-designer/src/utils/advanced-controls.cjs +1 -1
  26. package/dist/lib/components/pro-contract-template-designer/src/utils/caret-viewport.cjs +1 -0
  27. package/dist/lib/components/pro-contract-template-designer/src/utils/template-renderer.cjs +3 -3
  28. package/dist/lib/components/pro-contract-template-designer/src/utils/template-variable-render.cjs +1 -1
  29. package/dist/lib/components/pro-contract-template-designer/style/index.css +1 -1
  30. package/dist/lib/index.cjs +1 -1
  31. package/dist/lib/node_modules/@tiptap/pm/dist/transform/index.cjs +1 -0
  32. package/dist/lib/node_modules/prosemirror-transform/dist/index.cjs +2 -2
  33. package/dist/theme/icon.css +1 -1
  34. package/dist/theme/index.css +1 -1
  35. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.vue.d.ts +12 -0
  36. package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +14 -0
  37. package/dist/types/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.d.ts +2 -0
  38. package/dist/types/components/pro-contract-template-designer/src/composables/use-auto-pagination.d.ts +17 -0
  39. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +5 -1
  40. package/dist/types/components/pro-contract-template-designer/src/types.d.ts +15 -2
  41. package/dist/types/components/pro-contract-template-designer/src/utils/advanced-controls.d.ts +10 -0
  42. package/dist/types/components/pro-contract-template-designer/src/utils/caret-viewport.d.ts +18 -0
  43. package/dist/types/components/pro-contract-template-designer/src/utils/template-variable-render.d.ts +7 -0
  44. package/package.json +5 -5
  45. package/dist/theme/dept-selector.css +0 -1
  46. package/dist/theme/pro-selector-group.css +0 -1
  47. package/dist/theme/role-selector.css +0 -1
@@ -0,0 +1,5 @@
1
+ import e from "./ContractTemplateChoiceOptionsEditor.vue.mjs";
2
+ //#region src/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.vue
3
+ var t = e;
4
+ //#endregion
5
+ export { t as default };
@@ -0,0 +1,132 @@
1
+ import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createTextVNode as a, createVNode as o, defineComponent as s, normalizeClass as c, openBlock as l, ref as u, renderList as d, toDisplayString as f, unref as p, withCtx as m } from "vue";
2
+ import { Button as h, Input as g } from "ant-design-vue";
3
+ import { ArrowDownOutlined as _, ArrowUpOutlined as v, DeleteOutlined as y, PlusOutlined as b } from "@ant-design/icons-vue";
4
+ //#region src/components/pro-contract-template-designer/src/ContractTemplateChoiceOptionsEditor.vue?vue&type=script&setup=true&lang.ts
5
+ var x = { class: "gd-contract-choice-options" }, S = {
6
+ key: 0,
7
+ class: "gd-contract-choice-options__error"
8
+ }, C = { class: "gd-contract-choice-options__actions" }, w = /* @__PURE__ */ s({
9
+ name: "ContractTemplateChoiceOptionsEditor",
10
+ __name: "ContractTemplateChoiceOptionsEditor",
11
+ props: {
12
+ options: {},
13
+ variableType: {},
14
+ readonly: { type: Boolean }
15
+ },
16
+ emits: ["change"],
17
+ setup(s, { emit: w }) {
18
+ let T = s, E = w, D = u((T.options ?? []).map((e) => ({
19
+ label: e.label ?? "",
20
+ value: String(e.value ?? "")
21
+ }))), O = t(() => D.value.map((e, t) => k(D.value, t)));
22
+ function k(e, t) {
23
+ let n = e[t]?.label.trim() ?? "", r = e[t]?.value.trim() ?? "";
24
+ return n ? r ? e.some((e, n) => n !== t && e.value.trim() === r) ? "选项值不能重复" : "" : "选项值不能为空" : "显示文本不能为空";
25
+ }
26
+ function A() {
27
+ T.readonly || O.value.some(Boolean) || E("change", D.value.map((e) => ({
28
+ value: e.value.trim(),
29
+ label: e.label.trim(),
30
+ type: T.variableType || "select"
31
+ })));
32
+ }
33
+ function j(e, t) {
34
+ T.readonly || (D.value = D.value.map((n, r) => r === e ? {
35
+ ...n,
36
+ ...t
37
+ } : n), A());
38
+ }
39
+ function M(e, t) {
40
+ if (T.readonly) return;
41
+ let n = e + t;
42
+ if (n < 0 || n >= D.value.length) return;
43
+ let r = D.value.slice(), [i] = r.splice(e, 1);
44
+ r.splice(n, 0, i), D.value = r, A();
45
+ }
46
+ function N(e) {
47
+ T.readonly || (D.value = D.value.filter((t, n) => n !== e), A());
48
+ }
49
+ function P() {
50
+ if (T.readonly) return;
51
+ let e = new Set(D.value.flatMap((e) => [e.label.trim(), e.value.trim()])), t = D.value.length + 1;
52
+ for (; e.has(`选项${t}`) || e.has(`option${t}`);) t += 1;
53
+ D.value = [...D.value, {
54
+ label: `选项${t}`,
55
+ value: `option${t}`
56
+ }], A();
57
+ }
58
+ return (t, u) => (l(), r("div", x, [(l(!0), r(e, null, d(D.value, (e, t) => (l(), r("div", {
59
+ key: t,
60
+ class: c(["gd-contract-choice-options__row", { "is-invalid": !!O.value[t] }])
61
+ }, [
62
+ o(p(g), {
63
+ value: e.label,
64
+ disabled: s.readonly,
65
+ placeholder: "显示文本",
66
+ "aria-label": `选项 ${t + 1} 显示文本`,
67
+ "onUpdate:value": (e) => j(t, { label: String(e ?? "") })
68
+ }, null, 8, [
69
+ "value",
70
+ "disabled",
71
+ "aria-label",
72
+ "onUpdate:value"
73
+ ]),
74
+ o(p(g), {
75
+ value: e.value,
76
+ disabled: s.readonly,
77
+ placeholder: "选项值",
78
+ "aria-label": `选项 ${t + 1} 选项值`,
79
+ "onUpdate:value": (e) => j(t, { value: String(e ?? "") })
80
+ }, null, 8, [
81
+ "value",
82
+ "disabled",
83
+ "aria-label",
84
+ "onUpdate:value"
85
+ ]),
86
+ O.value[t] ? (l(), r("p", S, f(O.value[t]), 1)) : n("", !0),
87
+ i("div", C, [
88
+ o(p(h), {
89
+ type: "text",
90
+ size: "small",
91
+ disabled: s.readonly || t === 0,
92
+ "aria-label": "上移选项",
93
+ onClick: (e) => M(t, -1)
94
+ }, {
95
+ default: m(() => [o(p(v), { "aria-hidden": "true" })]),
96
+ _: 1
97
+ }, 8, ["disabled", "onClick"]),
98
+ o(p(h), {
99
+ type: "text",
100
+ size: "small",
101
+ disabled: s.readonly || t === D.value.length - 1,
102
+ "aria-label": "下移选项",
103
+ onClick: (e) => M(t, 1)
104
+ }, {
105
+ default: m(() => [o(p(_), { "aria-hidden": "true" })]),
106
+ _: 1
107
+ }, 8, ["disabled", "onClick"]),
108
+ o(p(h), {
109
+ type: "text",
110
+ size: "small",
111
+ danger: "",
112
+ disabled: s.readonly,
113
+ "aria-label": "删除选项",
114
+ onClick: (e) => N(t)
115
+ }, {
116
+ default: m(() => [o(p(y), { "aria-hidden": "true" })]),
117
+ _: 1
118
+ }, 8, ["disabled", "onClick"])
119
+ ])
120
+ ], 2))), 128)), o(p(h), {
121
+ block: "",
122
+ disabled: s.readonly,
123
+ "aria-label": "添加选项",
124
+ onClick: P
125
+ }, {
126
+ default: m(() => [o(p(b), { "aria-hidden": "true" }), u[0] ||= a(" 添加选项 ", -1)]),
127
+ _: 1
128
+ }, 8, ["disabled"])]));
129
+ }
130
+ });
131
+ //#endregion
132
+ export { w as default };