@guodun/antdv 1.7.6 → 1.7.7

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 (35) hide show
  1. package/dist/es/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.mjs +152 -146
  2. package/dist/es/components/pro-contract-template-designer/src/DesignerPage.vue.mjs +351 -301
  3. package/dist/es/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.mjs +939 -914
  4. package/dist/es/components/pro-contract-template-designer/src/composables/use-auto-pagination.mjs +82 -47
  5. package/dist/es/components/pro-contract-template-designer/src/composables/use-draft-cache-session.mjs +1 -1
  6. package/dist/es/components/pro-contract-template-designer/src/composables/use-page-authoring.mjs +22 -21
  7. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-authoring.mjs +37 -36
  8. package/dist/es/components/pro-contract-template-designer/src/composables/use-template-designer.mjs +125 -75
  9. package/dist/es/components/pro-contract-template-designer/src/utils/authoring-search.mjs +34 -13
  10. package/dist/es/components/pro-contract-template-designer/src/utils/document-outline.mjs +24 -1
  11. package/dist/es/components/pro-contract-template-designer/src/utils/editor-snapshot-cache.mjs +15 -0
  12. package/dist/es/index.mjs +21 -21
  13. package/dist/lib/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.cjs +1 -1
  14. package/dist/lib/components/pro-contract-template-designer/src/DesignerPage.vue.cjs +2 -2
  15. package/dist/lib/components/pro-contract-template-designer/src/ProContractTemplateDesigner.vue.cjs +1 -1
  16. package/dist/lib/components/pro-contract-template-designer/src/composables/use-auto-pagination.cjs +1 -1
  17. package/dist/lib/components/pro-contract-template-designer/src/composables/use-draft-cache-session.cjs +1 -1
  18. package/dist/lib/components/pro-contract-template-designer/src/composables/use-page-authoring.cjs +1 -1
  19. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-authoring.cjs +1 -1
  20. package/dist/lib/components/pro-contract-template-designer/src/composables/use-template-designer.cjs +4 -4
  21. package/dist/lib/components/pro-contract-template-designer/src/utils/authoring-search.cjs +1 -1
  22. package/dist/lib/components/pro-contract-template-designer/src/utils/document-outline.cjs +1 -1
  23. package/dist/lib/components/pro-contract-template-designer/src/utils/editor-snapshot-cache.cjs +1 -0
  24. package/dist/lib/index.cjs +1 -1
  25. package/dist/theme/icon.css +1 -1
  26. package/dist/theme/index.css +1 -1
  27. package/dist/types/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue.d.ts +1 -0
  28. package/dist/types/components/pro-contract-template-designer/src/DesignerPage.vue.d.ts +14 -0
  29. package/dist/types/components/pro-contract-template-designer/src/composables/use-auto-pagination.d.ts +8 -2
  30. package/dist/types/components/pro-contract-template-designer/src/composables/use-draft-cache-session.d.ts +1 -1
  31. package/dist/types/components/pro-contract-template-designer/src/composables/use-template-designer.d.ts +10 -1
  32. package/dist/types/components/pro-contract-template-designer/src/utils/authoring-search.d.ts +5 -0
  33. package/dist/types/components/pro-contract-template-designer/src/utils/document-outline.d.ts +6 -0
  34. package/dist/types/components/pro-contract-template-designer/src/utils/editor-snapshot-cache.d.ts +16 -0
  35. package/package.json +3 -3
@@ -1,58 +1,59 @@
1
1
  import { getFieldOption as e } from "./composables/use-template-designer.mjs";
2
2
  import { resolveFieldTypeIcon as t } from "./utils/template-tool-icons.mjs";
3
3
  import n from "./ContractTemplatePanelTabs.mjs";
4
- import { readContractPageNavigation as r } from "./utils/document-outline.mjs";
4
+ import { createContractPageNavigationCache as r } from "./utils/document-outline.mjs";
5
5
  import { matchesContractPanelSearch as i } from "./utils/panel-search.mjs";
6
- import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, normalizeClass as m, normalizeStyle as ee, openBlock as h, reactive as te, renderList as g, resolveDynamicComponent as ne, shallowRef as re, toDisplayString as _, unref as v, useId as ie, vShow as y, withCtx as b, withDirectives as x } from "vue";
7
- import { Button as S, Input as ae, Select as oe, Tooltip as C } from "ant-design-vue";
8
- import { CopyOutlined as se, DeleteOutlined as ce, LeftOutlined as le, PlusOutlined as ue, RightOutlined as de, SearchOutlined as fe } from "@ant-design/icons-vue";
6
+ import { Fragment as a, computed as o, createBlock as s, createCommentVNode as c, createElementBlock as l, createElementVNode as u, createTextVNode as d, createVNode as f, defineComponent as p, normalizeClass as m, normalizeStyle as ee, onScopeDispose as te, openBlock as h, reactive as ne, renderList as g, resolveDynamicComponent as re, shallowRef as ie, toDisplayString as _, unref as v, useId as ae, vShow as y, watch as b, withCtx as x, withDirectives as S } from "vue";
7
+ import { Button as C, Input as oe, Select as se, Tooltip as w } from "ant-design-vue";
8
+ import { CopyOutlined as ce, DeleteOutlined as le, LeftOutlined as ue, PlusOutlined as de, RightOutlined as fe, SearchOutlined as pe } from "@ant-design/icons-vue";
9
9
  //#region src/components/pro-contract-template-designer/src/ContractTemplateDesignerSidebar.vue?vue&type=script&setup=true&lang.ts
10
- var pe = ["aria-label", "aria-expanded"], w = { class: "gd-contract-template-designer__panel-stack" }, T = { class: "gd-contract-authoring-panel__body" }, E = { class: "gd-contract-authoring-panel__search" }, D = { class: "gd-contract-authoring-panel__results" }, O = {
10
+ var me = ["aria-label", "aria-expanded"], T = { class: "gd-contract-template-designer__panel-stack" }, E = { class: "gd-contract-authoring-panel__body" }, D = { class: "gd-contract-authoring-panel__search" }, O = { class: "gd-contract-authoring-panel__results" }, k = {
11
11
  role: "status",
12
12
  "aria-live": "polite"
13
- }, k = ["id", "aria-labelledby"], A = {
13
+ }, A = ["id", "aria-labelledby"], j = {
14
14
  key: 0,
15
15
  class: "gd-contract-authoring-panel__empty"
16
- }, j = [
16
+ }, M = [
17
17
  "aria-current",
18
18
  "aria-label",
19
19
  "onClick"
20
- ], M = {
20
+ ], N = {
21
21
  class: "gd-contract-authoring-panel__page-number",
22
22
  "aria-hidden": "true"
23
- }, N = { class: "gd-contract-authoring-panel__page-copy" }, P = { class: "gd-contract-authoring-panel__item-title" }, F = { class: "gd-contract-authoring-panel__summary" }, I = { class: "gd-contract-authoring-panel__meta" }, L = {
23
+ }, P = { class: "gd-contract-authoring-panel__page-copy" }, F = { class: "gd-contract-authoring-panel__item-title" }, I = { class: "gd-contract-authoring-panel__summary" }, L = { class: "gd-contract-authoring-panel__meta" }, R = {
24
24
  key: 1,
25
25
  class: "gd-contract-authoring-panel__page-config"
26
- }, R = { class: "gd-contract-authoring-panel__section-heading" }, z = ["aria-label"], B = {
26
+ }, z = { class: "gd-contract-authoring-panel__section-heading" }, he = ["aria-label"], ge = {
27
27
  key: 0,
28
28
  class: "gd-contract-authoring-panel__field"
29
- }, me = { class: "gd-contract-authoring-panel__meta" }, he = { class: "gd-contract-authoring-panel__page-actions" }, ge = ["id", "aria-labelledby"], _e = {
29
+ }, _e = { class: "gd-contract-authoring-panel__meta" }, ve = { class: "gd-contract-authoring-panel__page-actions" }, B = ["id", "aria-labelledby"], ye = {
30
30
  key: 0,
31
31
  class: "gd-contract-authoring-panel__empty"
32
- }, ve = {
32
+ }, be = {
33
33
  key: 0,
34
34
  class: "gd-contract-authoring-panel__meta"
35
- }, V = { class: "gd-contract-authoring-panel__outline-page" }, ye = { class: "gd-contract-authoring-panel__outline-list" }, be = ["aria-label", "onClick"], xe = {
35
+ }, xe = { class: "gd-contract-authoring-panel__outline-page" }, Se = { class: "gd-contract-authoring-panel__outline-list" }, Ce = ["aria-label", "onClick"], we = {
36
36
  class: "gd-contract-authoring-panel__heading-level",
37
37
  "aria-hidden": "true"
38
- }, Se = ["id", "aria-labelledby"], Ce = {
38
+ }, Te = ["id", "aria-labelledby"], Ee = {
39
39
  key: 0,
40
40
  class: "gd-contract-authoring-panel__empty"
41
- }, we = {
41
+ }, De = {
42
42
  key: 0,
43
43
  class: "gd-contract-authoring-panel__meta"
44
- }, Te = [
44
+ }, Oe = [
45
45
  "aria-pressed",
46
46
  "aria-label",
47
47
  "onClick"
48
- ], Ee = {
48
+ ], ke = {
49
49
  class: "gd-contract-authoring-panel__variable-icon",
50
50
  "aria-hidden": "true"
51
- }, De = { class: "gd-contract-authoring-panel__variable-copy" }, Oe = { class: "gd-contract-authoring-panel__item-title" }, ke = { class: "gd-contract-authoring-panel__meta" }, H = /* @__PURE__ */ p({
51
+ }, Ae = { class: "gd-contract-authoring-panel__variable-copy" }, je = { class: "gd-contract-authoring-panel__item-title" }, Me = { class: "gd-contract-authoring-panel__meta" }, V = /* @__PURE__ */ p({
52
52
  name: "ContractTemplateDesignerSidebar",
53
53
  __name: "ContractTemplateDesignerSidebar",
54
54
  props: {
55
55
  collapsed: { type: Boolean },
56
+ fileId: {},
56
57
  pages: {},
57
58
  variables: {},
58
59
  decorationVariableKeys: {},
@@ -78,12 +79,12 @@ var pe = ["aria-label", "aria-expanded"], w = { class: "gd-contract-template-des
78
79
  "scrollToVariable",
79
80
  "navigateOutline"
80
81
  ],
81
- setup(p, { emit: H }) {
82
- let U = p, W = H, G = `gd-contract-navigation-${ie()}`, K = re("pages"), q = te({
82
+ setup(p, { emit: V }) {
83
+ let H = p, U = V, W = `gd-contract-navigation-${ae()}`, G = ie("pages"), K = ne({
83
84
  pages: "",
84
85
  outline: "",
85
86
  variables: ""
86
- }), Ae = [
87
+ }), Ne = [
87
88
  {
88
89
  value: "pages",
89
90
  label: "页面"
@@ -96,233 +97,238 @@ var pe = ["aria-label", "aria-expanded"], w = { class: "gd-contract-template-des
96
97
  value: "variables",
97
98
  label: "变量"
98
99
  }
99
- ], je = {
100
+ ], Pe = {
100
101
  pages: "搜索页面",
101
102
  outline: "搜索大纲",
102
103
  variables: "搜索变量"
103
- }, Me = {
104
+ }, Fe = {
104
105
  pages: "页名、页码或正文",
105
106
  outline: "标题文字或所在页",
106
107
  variables: "名称、类型或变量标识"
107
- }, J = o({
108
- get: () => q[K.value],
108
+ }, q = o({
109
+ get: () => K[G.value],
109
110
  set: (e) => {
110
- q[K.value] = e;
111
+ K[G.value] = e;
111
112
  }
112
- }), Y = o(() => U.pages.map((e, t) => ({
113
- page: e,
114
- number: t + 1,
115
- title: e.title || `第 ${t + 1} 页`,
116
- format: U.getPageSize(e).label || U.getPageSize(e).format || "自定义",
117
- ...r(e)
118
- }))), X = o(() => Y.value.filter((e) => i(q.pages, e.title, `第 ${e.number} 页`, e.format, e.text))), Z = o(() => Y.value.map((e) => ({
113
+ }), J = r();
114
+ b(() => H.fileId, () => J.clear(), { flush: "sync" }), b(() => JSON.stringify(H.pages.map((e) => e.id)), () => J.retainPages(H.pages)), te(() => J.clear());
115
+ let Y = o(() => {
116
+ let e = J.readPages(H.pages);
117
+ return H.pages.map((t, n) => {
118
+ let r = H.getPageSize(t);
119
+ return {
120
+ page: t,
121
+ number: n + 1,
122
+ title: t.title || `第 ${n + 1} 页`,
123
+ format: r.label || r.format || "自定义",
124
+ ...e[n]
125
+ };
126
+ });
127
+ }), X = o(() => Y.value.filter((e) => i(K.pages, e.title, `第 ${e.number} 页`, e.format, e.text))), Z = o(() => Y.value.map((e) => ({
119
128
  ...e,
120
- headings: e.headings.filter((t) => i(q.outline, t.text, e.title, `第 ${e.number} 页`))
121
- })).filter((e) => e.headings.length > 0)), Ne = o(() => Y.value.reduce((e, t) => e + t.headings.length, 0)), Q = o(() => Z.value.reduce((e, t) => e + t.headings.length, 0)), Pe = o(() => U.variables.map((t) => ({
129
+ headings: e.headings.filter((t) => i(K.outline, t.text, e.title, `第 ${e.number} 页`))
130
+ })).filter((e) => e.headings.length > 0)), Ie = o(() => Y.value.reduce((e, t) => e + t.headings.length, 0)), Q = o(() => Z.value.reduce((e, t) => e + t.headings.length, 0)), Le = o(() => H.variables.map((t) => ({
122
131
  variable: t,
123
132
  typeLabel: e(t.type || "text").label,
124
- decoration: U.decorationVariableKeys.includes(t.key)
125
- }))), $ = o(() => Pe.value.filter((e) => i(q.variables, e.variable.label, e.variable.key, e.variable.type || "text", e.typeLabel, e.decoration ? "页面装饰" : "正文"))), Fe = o(() => {
126
- let [e, t, n] = {
127
- pages: [
128
- X.value.length,
129
- U.pages.length,
130
- "页"
131
- ],
132
- outline: [
133
- Q.value,
134
- Ne.value,
135
- "个标题"
136
- ],
137
- variables: [
138
- $.value.length,
139
- U.variables.length,
140
- "个变量"
141
- ]
142
- }[K.value];
143
- return J.value.trim() ? `找到 ${e} / ${t} ${n}` : `共 ${t} ${n}`;
133
+ decoration: H.decorationVariableKeys.includes(t.key)
134
+ }))), $ = o(() => Le.value.filter((e) => i(K.variables, e.variable.label, e.variable.key, e.variable.type || "text", e.typeLabel, e.decoration ? "页面装饰" : "正文"))), Re = o(() => {
135
+ if (H.collapsed) return "";
136
+ let [e, t, n] = G.value === "pages" ? [
137
+ X.value.length,
138
+ H.pages.length,
139
+ "页"
140
+ ] : G.value === "outline" ? [
141
+ Q.value,
142
+ Ie.value,
143
+ "个标题"
144
+ ] : [
145
+ $.value.length,
146
+ H.variables.length,
147
+ "个变量"
148
+ ];
149
+ return q.value.trim() ? `找到 ${e} / ${t} ${n}` : `共 ${t} ${n}`;
144
150
  });
145
- function Ie(e) {
146
- (e === "pages" || e === "outline" || e === "variables") && (K.value = e);
151
+ function ze(e) {
152
+ (e === "pages" || e === "outline" || e === "variables") && (G.value = e);
147
153
  }
148
154
  return (e, r) => (h(), l("aside", {
149
- class: m(["gd-contract-template-designer__sidebar gd-contract-authoring-panel", { "is-collapsed": U.collapsed }]),
155
+ class: m(["gd-contract-template-designer__sidebar gd-contract-authoring-panel", { "is-collapsed": H.collapsed }]),
150
156
  "aria-label": "合同内容导航"
151
- }, [f(v(C), { title: U.collapsed ? "展开页面栏" : "收起页面栏" }, {
152
- default: b(() => [u("button", {
157
+ }, [f(v(w), { title: H.collapsed ? "展开页面栏" : "收起页面栏" }, {
158
+ default: x(() => [u("button", {
153
159
  type: "button",
154
160
  class: "gd-contract-template-designer__panel-handle gd-contract-authoring-panel__handle",
155
- "aria-label": U.collapsed ? "展开页面栏" : "收起页面栏",
156
- "aria-expanded": !U.collapsed,
157
- onClick: r[0] ||= (e) => W("toggle")
158
- }, [U.collapsed ? (h(), s(v(de), {
161
+ "aria-label": H.collapsed ? "展开页面栏" : "收起页面栏",
162
+ "aria-expanded": !H.collapsed,
163
+ onClick: r[0] ||= (e) => U("toggle")
164
+ }, [H.collapsed ? (h(), s(v(fe), {
159
165
  key: 0,
160
166
  "aria-hidden": "true"
161
- })) : (h(), s(v(le), {
167
+ })) : (h(), s(v(ue), {
162
168
  key: 1,
163
169
  "aria-hidden": "true"
164
- }))], 8, pe)]),
170
+ }))], 8, me)]),
165
171
  _: 1
166
- }, 8, ["title"]), u("div", w, [u("div", T, [
172
+ }, 8, ["title"]), u("div", T, [u("div", E, [
167
173
  f(n, {
168
- id: G,
169
- "model-value": K.value,
170
- items: Ae,
174
+ id: W,
175
+ "model-value": G.value,
176
+ items: Ne,
171
177
  label: "导航视图",
172
- "onUpdate:modelValue": Ie
178
+ "onUpdate:modelValue": ze
173
179
  }, null, 8, ["model-value"]),
174
- u("div", E, [f(v(ae), {
175
- value: J.value,
176
- "onUpdate:value": r[1] ||= (e) => J.value = e,
180
+ u("div", D, [f(v(oe), {
181
+ value: q.value,
182
+ "onUpdate:value": r[1] ||= (e) => q.value = e,
177
183
  "allow-clear": "",
178
184
  type: "search",
179
- "aria-label": je[K.value],
180
- placeholder: Me[K.value]
185
+ "aria-label": Pe[G.value],
186
+ placeholder: Fe[G.value]
181
187
  }, {
182
- prefix: b(() => [f(v(fe), { "aria-hidden": "true" })]),
188
+ prefix: x(() => [f(v(pe), { "aria-hidden": "true" })]),
183
189
  _: 1
184
190
  }, 8, [
185
191
  "value",
186
192
  "aria-label",
187
193
  "placeholder"
188
194
  ])]),
189
- u("div", D, [u("span", O, _(Fe.value), 1), K.value === "pages" ? (h(), s(v(C), {
195
+ u("div", O, [u("span", k, _(Re.value), 1), G.value === "pages" ? (h(), s(v(w), {
190
196
  key: 0,
191
- title: U.pageLimitReached ? `已达 ${U.normalizedMaxPages} 页上限` : "新增页面"
197
+ title: H.pageLimitReached ? `已达 ${H.normalizedMaxPages} 页上限` : "新增页面"
192
198
  }, {
193
- default: b(() => [f(v(S), {
199
+ default: x(() => [f(v(C), {
194
200
  type: "text",
195
201
  size: "small",
196
202
  class: "gd-contract-authoring-panel__action",
197
- disabled: U.readonly || U.pageLimitReached,
203
+ disabled: H.readonly || H.pageLimitReached,
198
204
  "aria-label": "新增页面",
199
- onClick: r[2] ||= (e) => W("addPage")
205
+ onClick: r[2] ||= (e) => U("addPage")
200
206
  }, {
201
- default: b(() => [f(v(ue), { "aria-hidden": "true" }), r[10] ||= d("新增", -1)]),
207
+ default: x(() => [f(v(de), { "aria-hidden": "true" }), r[10] ||= d("新增", -1)]),
202
208
  _: 1
203
209
  }, 8, ["disabled"])]),
204
210
  _: 1
205
211
  }, 8, ["title"])) : c("", !0)]),
206
- x(u("section", {
207
- id: `${G}-panel-pages`,
212
+ S(u("section", {
213
+ id: `${W}-panel-pages`,
208
214
  role: "tabpanel",
209
- "aria-labelledby": `${G}-tab-pages`,
215
+ "aria-labelledby": `${W}-tab-pages`,
210
216
  class: "gd-contract-authoring-panel__view"
211
- }, [
212
- X.value.length ? c("", !0) : (h(), l("div", A, [u("span", null, _(q.pages.trim() ? "没有匹配的页面" : "暂无页面"), 1), q.pages.trim() ? (h(), s(v(S), {
217
+ }, [!H.collapsed && G.value === "pages" ? (h(), l(a, { key: 0 }, [
218
+ X.value.length ? c("", !0) : (h(), l("div", j, [u("span", null, _(K.pages.trim() ? "没有匹配的页面" : "暂无页面"), 1), K.pages.trim() ? (h(), s(v(C), {
213
219
  key: 0,
214
220
  type: "link",
215
- onClick: r[3] ||= (e) => q.pages = ""
221
+ onClick: r[3] ||= (e) => K.pages = ""
216
222
  }, {
217
- default: b(() => [...r[11] ||= [d("清空搜索", -1)]]),
223
+ default: x(() => [...r[11] ||= [d("清空搜索", -1)]]),
218
224
  _: 1
219
- })) : (h(), s(v(S), {
225
+ })) : (h(), s(v(C), {
220
226
  key: 1,
221
- disabled: U.readonly || U.pageLimitReached,
222
- onClick: r[4] ||= (e) => W("addPage")
227
+ disabled: H.readonly || H.pageLimitReached,
228
+ onClick: r[4] ||= (e) => U("addPage")
223
229
  }, {
224
- default: b(() => [...r[12] ||= [d("新增页面", -1)]]),
230
+ default: x(() => [...r[12] ||= [d("新增页面", -1)]]),
225
231
  _: 1
226
232
  }, 8, ["disabled"]))])),
227
233
  (h(!0), l(a, null, g(X.value, (e) => (h(), l("button", {
228
234
  key: e.page.id,
229
235
  type: "button",
230
- class: m(["gd-contract-authoring-panel__page", { "is-active": U.activePageId === e.page.id }]),
231
- "aria-current": U.activePageId === e.page.id ? "page" : void 0,
236
+ class: m(["gd-contract-authoring-panel__page", { "is-active": H.activePageId === e.page.id }]),
237
+ "aria-current": H.activePageId === e.page.id ? "page" : void 0,
232
238
  "aria-label": `第 ${e.number} 页:${e.title},${e.format}`,
233
- onClick: (t) => W("activatePage", e.page.id)
234
- }, [u("span", M, _(e.number), 1), u("span", N, [
235
- u("span", P, _(e.title), 1),
236
- u("span", F, _(e.summary || "暂无正文文字"), 1),
237
- u("small", I, "第 " + _(e.number) + " 页 · " + _(e.format), 1)
238
- ])], 10, j))), 128)),
239
- U.selectedPage ? (h(), l("div", L, [
240
- u("div", R, [r[13] ||= u("span", null, "页面数量", -1), u("small", {
239
+ onClick: (t) => U("activatePage", e.page.id)
240
+ }, [u("span", N, _(e.number), 1), u("span", P, [
241
+ u("span", F, _(e.title), 1),
242
+ u("span", I, _(e.summary || "暂无正文文字"), 1),
243
+ u("small", L, "第 " + _(e.number) + " 页 · " + _(e.format), 1)
244
+ ])], 10, M))), 128)),
245
+ H.selectedPage ? (h(), l("div", R, [
246
+ u("div", z, [r[13] ||= u("span", null, "页面数量", -1), u("small", {
241
247
  class: "gd-contract-authoring-panel__meta",
242
- "aria-label": `共 ${U.pages.length} 页,上限 ${U.normalizedMaxPages} 页`
243
- }, _(U.pages.length) + " / " + _(U.normalizedMaxPages), 9, z)]),
244
- U.normalizedPageSizeOptions.length > 1 ? (h(), l("label", B, [r[14] ||= u("span", null, "页面格式", -1), f(v(oe), {
245
- value: U.selectedPageSizeOptionValue,
246
- options: U.pageSizeOptions,
247
- disabled: U.readonly,
248
+ "aria-label": `共 ${H.pages.length} 页,上限 ${H.normalizedMaxPages} 页`
249
+ }, _(H.pages.length) + " / " + _(H.normalizedMaxPages), 9, he)]),
250
+ H.normalizedPageSizeOptions.length > 1 ? (h(), l("label", ge, [r[14] ||= u("span", null, "页面格式", -1), f(v(se), {
251
+ value: H.selectedPageSizeOptionValue,
252
+ options: H.pageSizeOptions,
253
+ disabled: H.readonly,
248
254
  "aria-label": "当前页面格式",
249
- onChange: r[5] ||= (e) => W("patchPageFormat", e)
255
+ onChange: r[5] ||= (e) => U("patchPageFormat", e)
250
256
  }, null, 8, [
251
257
  "value",
252
258
  "options",
253
259
  "disabled"
254
260
  ])])) : c("", !0),
255
- u("small", me, _(U.selectedPageSize.width) + " × " + _(U.selectedPageSize.height) + " px", 1),
256
- u("div", he, [f(v(S), {
257
- disabled: U.readonly || U.pageLimitReached,
261
+ u("small", _e, _(H.selectedPageSize.width) + " × " + _(H.selectedPageSize.height) + " px", 1),
262
+ u("div", ve, [f(v(C), {
263
+ disabled: H.readonly || H.pageLimitReached,
258
264
  "aria-label": "复制页面",
259
- onClick: r[6] ||= (e) => W("duplicatePage", U.selectedPage)
265
+ onClick: r[6] ||= (e) => U("duplicatePage", H.selectedPage)
260
266
  }, {
261
- default: b(() => [f(v(se), { "aria-hidden": "true" }), r[15] ||= d("复制页 ", -1)]),
267
+ default: x(() => [f(v(ce), { "aria-hidden": "true" }), r[15] ||= d("复制页 ", -1)]),
262
268
  _: 1
263
- }, 8, ["disabled"]), f(v(S), {
269
+ }, 8, ["disabled"]), f(v(C), {
264
270
  type: "text",
265
271
  danger: "",
266
- disabled: U.readonly || U.pages.length <= 1,
272
+ disabled: H.readonly || H.pages.length <= 1,
267
273
  "aria-label": "删除页面",
268
- onClick: r[7] ||= (e) => W("removePage", U.selectedPage)
274
+ onClick: r[7] ||= (e) => U("removePage", H.selectedPage)
269
275
  }, {
270
- default: b(() => [f(v(ce), { "aria-hidden": "true" }), r[16] ||= d("删除页 ", -1)]),
276
+ default: x(() => [f(v(le), { "aria-hidden": "true" }), r[16] ||= d("删除页 ", -1)]),
271
277
  _: 1
272
278
  }, 8, ["disabled"])])
273
279
  ])) : c("", !0)
274
- ], 8, k), [[y, K.value === "pages"]]),
275
- x(u("section", {
276
- id: `${G}-panel-outline`,
280
+ ], 64)) : c("", !0)], 8, A), [[y, G.value === "pages"]]),
281
+ S(u("section", {
282
+ id: `${W}-panel-outline`,
277
283
  role: "tabpanel",
278
- "aria-labelledby": `${G}-tab-outline`,
284
+ "aria-labelledby": `${W}-tab-outline`,
279
285
  class: "gd-contract-authoring-panel__view"
280
- }, [Q.value ? c("", !0) : (h(), l("div", _e, [u("span", null, _(q.outline.trim() ? "没有匹配的标题" : "正文还没有标题"), 1), q.outline.trim() ? (h(), s(v(S), {
286
+ }, [!H.collapsed && G.value === "outline" ? (h(), l(a, { key: 0 }, [Q.value ? c("", !0) : (h(), l("div", ye, [u("span", null, _(K.outline.trim() ? "没有匹配的标题" : "正文还没有标题"), 1), K.outline.trim() ? (h(), s(v(C), {
281
287
  key: 1,
282
288
  type: "link",
283
- onClick: r[8] ||= (e) => q.outline = ""
289
+ onClick: r[8] ||= (e) => K.outline = ""
284
290
  }, {
285
- default: b(() => [...r[17] ||= [d("清空搜索", -1)]]),
291
+ default: x(() => [...r[17] ||= [d("清空搜索", -1)]]),
286
292
  _: 1
287
- })) : (h(), l("small", ve, "在正文使用标题样式后,即可在这里定位条款。"))])), (h(!0), l(a, null, g(Z.value, (e) => (h(), l("div", {
293
+ })) : (h(), l("small", be, "在正文使用标题样式后,即可在这里定位条款。"))])), (h(!0), l(a, null, g(Z.value, (e) => (h(), l("div", {
288
294
  key: e.page.id,
289
295
  class: "gd-contract-authoring-panel__outline-group"
290
- }, [u("div", V, "第 " + _(e.number) + " 页 · " + _(e.title), 1), u("ul", ye, [(h(!0), l(a, null, g(e.headings, (t) => (h(), l("li", { key: t.headingIndex }, [u("button", {
296
+ }, [u("div", xe, "第 " + _(e.number) + " 页 · " + _(e.title), 1), u("ul", Se, [(h(!0), l(a, null, g(e.headings, (t) => (h(), l("li", { key: t.headingIndex }, [u("button", {
291
297
  type: "button",
292
- class: m(["gd-contract-authoring-panel__outline-item", { "is-current-page": U.activePageId === t.pageId }]),
298
+ class: m(["gd-contract-authoring-panel__outline-item", { "is-current-page": H.activePageId === t.pageId }]),
293
299
  style: ee({ "--gd-authoring-outline-depth": t.depth }),
294
300
  "aria-label": `${t.text},第 ${e.number} 页,${t.level} 级标题`,
295
- onClick: (e) => W("navigateOutline", {
301
+ onClick: (e) => U("navigateOutline", {
296
302
  pageId: t.pageId,
297
303
  headingIndex: t.headingIndex
298
304
  })
299
- }, [u("small", xe, "H" + _(t.level), 1), u("span", null, _(t.text), 1)], 14, be)]))), 128))])]))), 128))], 8, ge), [[y, K.value === "outline"]]),
300
- x(u("section", {
301
- id: `${G}-panel-variables`,
305
+ }, [u("small", we, "H" + _(t.level), 1), u("span", null, _(t.text), 1)], 14, Ce)]))), 128))])]))), 128))], 64)) : c("", !0)], 8, B), [[y, G.value === "outline"]]),
306
+ S(u("section", {
307
+ id: `${W}-panel-variables`,
302
308
  role: "tabpanel",
303
- "aria-labelledby": `${G}-tab-variables`,
309
+ "aria-labelledby": `${W}-tab-variables`,
304
310
  class: "gd-contract-authoring-panel__view"
305
- }, [
311
+ }, [!H.collapsed && G.value === "variables" ? (h(), l(a, { key: 0 }, [
306
312
  r[19] ||= u("div", { class: "gd-contract-authoring-panel__section-heading" }, [u("strong", null, "控件参数")], -1),
307
- $.value.length ? c("", !0) : (h(), l("div", Ce, [u("span", null, _(q.variables.trim() ? "没有匹配的变量" : "暂无正文控件"), 1), q.variables.trim() ? (h(), s(v(S), {
313
+ $.value.length ? c("", !0) : (h(), l("div", Ee, [u("span", null, _(K.variables.trim() ? "没有匹配的变量" : "暂无正文控件"), 1), K.variables.trim() ? (h(), s(v(C), {
308
314
  key: 1,
309
315
  type: "link",
310
- onClick: r[9] ||= (e) => q.variables = ""
316
+ onClick: r[9] ||= (e) => K.variables = ""
311
317
  }, {
312
- default: b(() => [...r[18] ||= [d("清空搜索", -1)]]),
318
+ default: x(() => [...r[18] ||= [d("清空搜索", -1)]]),
313
319
  _: 1
314
- })) : (h(), l("small", we, "从右侧「插入控件」添加,选中后可定位并修改属性。"))])),
320
+ })) : (h(), l("small", De, "从右侧「插入控件」添加,选中后可定位并修改属性。"))])),
315
321
  (h(!0), l(a, null, g($.value, (e) => (h(), l("button", {
316
322
  key: e.variable.id,
317
323
  type: "button",
318
- class: m(["gd-contract-template-designer__nav-item gd-contract-authoring-panel__variable", { "is-active": U.selectedVariableKey === e.variable.key }]),
319
- "aria-pressed": U.selectedVariableKey === e.variable.key,
324
+ class: m(["gd-contract-template-designer__nav-item gd-contract-authoring-panel__variable", { "is-active": H.selectedVariableKey === e.variable.key }]),
325
+ "aria-pressed": H.selectedVariableKey === e.variable.key,
320
326
  "aria-label": `定位变量:${e.variable.label}(${e.variable.key})`,
321
- onClick: (t) => W("scrollToVariable", e.variable)
322
- }, [u("span", Ee, [(h(), s(ne(v(t)(e.variable.type))))]), u("span", De, [u("span", Oe, _(e.variable.label), 1), u("small", ke, _(e.decoration ? "页面装饰" : e.typeLabel) + " · " + _(e.variable.key), 1)])], 10, Te))), 128))
323
- ], 8, Se), [[y, K.value === "variables"]])
327
+ onClick: (t) => U("scrollToVariable", e.variable)
328
+ }, [u("span", ke, [(h(), s(re(v(t)(e.variable.type))))]), u("span", Ae, [u("span", je, _(e.variable.label), 1), u("small", Me, _(e.decoration ? "页面装饰" : e.typeLabel) + " · " + _(e.variable.key), 1)])], 10, Oe))), 128))
329
+ ], 64)) : c("", !0)], 8, Te), [[y, G.value === "variables"]])
324
330
  ])])], 2));
325
331
  }
326
332
  });
327
333
  //#endregion
328
- export { H as default };
334
+ export { V as default };