@agile-team/mach-report 2.8.3 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/README.md +28 -10
  2. package/dist/ExcelBindingWizard-DiaxvWpQ.cjs +1 -0
  3. package/dist/ExcelBindingWizard-RLJIXKKG.js +816 -0
  4. package/dist/{ReportPreview-DRBAUkxj.js → ReportPreview-B5ZNEasW.js} +23 -22
  5. package/dist/ReportPreview-DRtVPUYo.cjs +6 -0
  6. package/dist/RuleEditor-N4qnMZ-Z.cjs +1 -0
  7. package/dist/RuleEditor-ynnUEK0s.js +1575 -0
  8. package/dist/TemplateReviewPanel-C_Lmzis6.cjs +1 -0
  9. package/dist/TemplateReviewPanel-Cn32OY4_.js +173 -0
  10. package/dist/{_plugin-vue_export-helper-DPbiz14D.js → _plugin-vue_export-helper-8SL1F89S.js} +2 -2
  11. package/dist/analytics.cjs +1 -1
  12. package/dist/analytics.d.cts +188 -5
  13. package/dist/analytics.d.ts +188 -5
  14. package/dist/analytics.js +68 -202
  15. package/dist/{assets-B9qJku3V.js → assets-DDsfEi8R.js} +3 -3
  16. package/dist/{assets-RZan7EyL.cjs → assets-ahTRUXRk.cjs} +1 -1
  17. package/dist/binding-preview-B5834rml.cjs +2 -0
  18. package/dist/binding-preview-ChXjN5L5.js +649 -0
  19. package/dist/{capabilities-joSutDF8.js → capabilities-Cm9hZ3uV.js} +5 -5
  20. package/dist/{capabilities-xGTpnPjJ.cjs → capabilities-DYzWL7KS.cjs} +1 -1
  21. package/dist/dataset-BkRmwgeJ.cjs +1 -0
  22. package/dist/dataset-H5pFuQGU.js +121 -0
  23. package/dist/defaults-DXhiM1ZD.js +10 -0
  24. package/dist/defaults-xhmcLLrf.cjs +1 -0
  25. package/dist/designer.cjs +2 -1
  26. package/dist/designer.d.cts +1391 -6
  27. package/dist/designer.d.ts +1391 -6
  28. package/dist/designer.js +2636 -673
  29. package/dist/grid-geometry-BNptEcMm.js +65 -0
  30. package/dist/grid-geometry-CZ_cYB6O.cjs +1 -0
  31. package/dist/import-template-CNMLJSQw.js +23030 -0
  32. package/dist/import-template-CpxunKVp.cjs +29 -0
  33. package/dist/index.cjs +7 -7
  34. package/dist/index.d.cts +202 -3
  35. package/dist/index.d.ts +202 -3
  36. package/dist/index.js +554 -535
  37. package/dist/matrix-CNPDJxED.js +745 -0
  38. package/dist/matrix-Div9Ilh3.cjs +1 -0
  39. package/dist/pdf.cjs +46 -46
  40. package/dist/pdf.d.cts +2 -0
  41. package/dist/pdf.d.ts +2 -0
  42. package/dist/pdf.js +17 -16
  43. package/dist/{plugin-BurDDMcd.js → plugin-BWwIgZXV.js} +1 -1
  44. package/dist/{plugin-DSFu51Ua.cjs → plugin-Dg-J1Rbm.cjs} +1 -1
  45. package/dist/progress-7OSZbFok.js +39 -0
  46. package/dist/progress-BnLiS5eH.cjs +1 -0
  47. package/dist/render-plan-7xpGrCEl.cjs +1 -0
  48. package/dist/render-plan-Ck6koX9L.js +13 -0
  49. package/dist/server/node.d.cts +62 -0
  50. package/dist/server/node.d.ts +62 -0
  51. package/dist/server-node.cjs +1 -1
  52. package/dist/server-node.js +373 -145
  53. package/dist/server.cjs +1 -1
  54. package/dist/server.d.cts +311 -0
  55. package/dist/server.d.ts +311 -0
  56. package/dist/server.js +590 -186
  57. package/dist/{style-Dv5o_x6b.js → style-CQ1PK8ZB.js} +5 -5
  58. package/dist/style-UgIJSA1F.cjs +1 -0
  59. package/dist/style.css +1 -1
  60. package/dist/template-registry-CHMYZ7SD.cjs +1 -0
  61. package/dist/template-registry-R61AMCr0.js +433 -0
  62. package/dist/template-review-hvWWQFsi.js +1027 -0
  63. package/dist/template-review-jEcOfmGr.cjs +1 -0
  64. package/dist/textwrap-CWHyzkBH.cjs +4 -0
  65. package/dist/{textwrap-DOl04hCQ.js → textwrap-DE1kgcJB.js} +1 -1
  66. package/dist/{validate-DfHPD8wX.cjs → validate-BDiMqkJC.cjs} +1 -1
  67. package/dist/{validate-S6CgIm5d.js → validate-DWPF7icl.js} +13 -13
  68. package/dist/vue/async.d.cts +186 -0
  69. package/dist/vue/async.d.ts +186 -0
  70. package/dist/vue/index.d.cts +271 -3
  71. package/dist/vue/index.d.ts +271 -3
  72. package/dist/vue-async.cjs +1 -1
  73. package/dist/vue-async.js +3 -3
  74. package/dist/vue.cjs +1 -1
  75. package/dist/vue.js +4 -4
  76. package/dist/worker.cjs +1 -1
  77. package/dist/worker.d.cts +2 -0
  78. package/dist/worker.d.ts +2 -0
  79. package/dist/worker.js +1 -1
  80. package/dist/xlsx.cjs +2 -30
  81. package/dist/xlsx.d.cts +268 -0
  82. package/dist/xlsx.d.ts +268 -0
  83. package/dist/xlsx.js +220 -23440
  84. package/package.json +1 -1
  85. package/dist/ReportPreview-DjGeWHY-.cjs +0 -6
  86. package/dist/progress-DD964VAB.js +0 -102
  87. package/dist/progress-KvhwXZ1Q.cjs +0 -1
  88. package/dist/render-plan-CckPEQyf.cjs +0 -1
  89. package/dist/render-plan-uzZYYSy1.js +0 -19
  90. package/dist/report-source-BXHNy_AD.js +0 -755
  91. package/dist/report-source-CCAvFE3t.cjs +0 -1
  92. package/dist/style-CpwiOPyB.cjs +0 -1
  93. package/dist/template-registry-DWExx0gU.cjs +0 -1
  94. package/dist/template-registry-NpOakidD.js +0 -354
  95. package/dist/textwrap-CnGsEum6.cjs +0 -4
package/dist/designer.js CHANGED
@@ -1,124 +1,285 @@
1
- import { ref as j, computed as A, shallowRef as be, onBeforeUnmount as pe, watch as W, defineComponent as ye, getCurrentInstance as _e, nextTick as ne, openBlock as _, createElementBlock as C, unref as e, createElementVNode as n, createVNode as le, toDisplayString as a, normalizeClass as fe, createTextVNode as R, createCommentVNode as N, withKeys as ke, withModifiers as Ce, Fragment as K, renderList as ie, withDirectives as ue, isRef as ce, vModelSelect as we, vModelText as ge, createBlock as he } from "vue";
2
- import { provideMachReportConfig as Se, createLocalFetcher as xe, ReportPreview as Ee } from "@agile-team/mach-report/vue";
3
- import { _ as Y, a as Me } from "./_plugin-vue_export-helper-DPbiz14D.js";
4
- import { resolveGridLayout as ve, parseReportTemplate as I, serializeReportTemplate as U, validateReportTemplateDocument as Te } from "@agile-team/mach-report";
5
- function Ae(v, M, c, y) {
6
- const f = j(0), s = j(""), w = j([]), $ = A(() => v.value.template.pages.flatMap((d, r) => d.components.flatMap((i, m) => i.kind === "list" ? [{ component: i, pageIndex: r, componentIndex: m }] : []))), S = A(() => $.value[f.value]?.component), p = A(() => {
7
- const d = S.value;
8
- if (!d) return [];
9
- const r = d.columns.map((i) => i.headerStyle?.align ?? i.headerAlign ?? d.headerStyle?.align ?? d.headerAlign ?? i.style?.align ?? "center");
10
- if (d.headerGrid && M())
11
- for (const i of ve(d.headerGrid, d.widthMm, 100).cells)
12
- for (let m = i.ci; m < i.ci + (i.cell.colSpan ?? 1); m++) r[m] = i.cell.style?.align ?? "left";
13
- return r;
14
- }), g = A(() => {
15
- const d = s.value.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);
16
- return (S.value?.columns ?? []).flatMap((r, i) => {
17
- const m = `${r.header} ${r.field}`.toLocaleLowerCase();
18
- return d.every((x) => m.includes(x)) ? [{ column: r, index: i }] : [];
19
- });
20
- });
21
- function k(d, r) {
22
- w.value = r ? [.../* @__PURE__ */ new Set([...w.value, d])] : w.value.filter((i) => i !== d);
23
- }
24
- function T(d) {
25
- for (const r of g.value) k(r.index, d);
26
- }
27
- function h() {
28
- w.value = [];
29
- }
30
- function B(d, r, i) {
31
- if (!c()) return;
32
- const m = S.value?.columns[d];
33
- m && (Object.assign(m, { [r]: r === "widthMm" ? Number(i) : i }), r === "header" && O(d, String(i)), r === "headerAlign" && D(d, i), r === "widthMm" && Q(), y());
34
- }
35
- function Q() {
36
- const d = $.value[f.value];
37
- if (!d) return;
38
- const r = d.component, i = v.value.template.pages[d.pageIndex], m = r.columns.map((x) => x.widthMm);
39
- r.headerGrid && (r.headerGrid.colWidthsMm = m), i.layout === "wide" && m.every((x) => Number.isFinite(x) && x > 0) && (r.widthMm = m.reduce((x, t) => x + t, 0), i.widthMm = Math.max(...i.components.map((x) => x.leftMm + x.widthMm)) + (i.marginRightMm ?? 0));
40
- }
41
- function O(d, r) {
42
- const i = S.value;
43
- if (!i?.headerGrid) return;
44
- const x = ve(i.headerGrid, i.widthMm, 100).cells.filter(({ ci: t, cell: L }) => t <= d && t + (L.colSpan ?? 1) > d).slice(-1)[0];
45
- x && (Object.assign(x.cell, { text: r, rawText: r, value: r }), i.columns.slice(x.ci, x.ci + (x.cell.colSpan ?? 1)).forEach((t) => {
46
- t.header = r;
47
- }));
1
+ import { watch as Z, onBeforeUnmount as $e, defineComponent as Ee, computed as z, ref as F, openBlock as h, createElementBlock as y, createElementVNode as n, toDisplayString as l, createTextVNode as P, withDirectives as ae, vModelSelect as ye, normalizeStyle as re, Fragment as U, renderList as W, unref as e, normalizeClass as _e, withModifiers as tt, createCommentVNode as B, nextTick as de, createVNode as Q, onMounted as ht, shallowRef as nt, defineAsyncComponent as Me, getCurrentInstance as gt, withKeys as Be, createBlock as fe, vShow as Te, isRef as xe, vModelText as qe } from "vue";
2
+ import { provideMachReportConfig as ft, createLocalFetcher as bt, ReportPreview as yt } from "@agile-team/mach-report/vue";
3
+ import { resolveGridLayout as ve, parseReportTemplate as Y, serializeReportTemplate as me, validateReportTemplateDocument as Ye } from "@agile-team/mach-report";
4
+ import { _ as Ie, a as oe } from "./_plugin-vue_export-helper-8SL1F89S.js";
5
+ import { r as je } from "./style-CQ1PK8ZB.js";
6
+ const wt = 96 / 25.4;
7
+ function Oe(t) {
8
+ return t.kind === "list" ? Math.max(
9
+ 16,
10
+ (t.headerGrid?.rowHeightsMm?.reduce(
11
+ (u, s) => u + s,
12
+ 0
13
+ ) ?? 8) + (t.rowHeightMm ?? 8) * 3
14
+ ) : t.heightMm;
15
+ }
16
+ function Se(t) {
17
+ return {
18
+ leftMm: t.leftMm,
19
+ topMm: t.topMm,
20
+ widthMm: t.widthMm,
21
+ heightMm: Oe(t)
22
+ };
23
+ }
24
+ function ze(t, u) {
25
+ return u ? t.template.pages[u.pageIndex]?.components[u.componentIndex] : void 0;
26
+ }
27
+ function kt(t, u = "detail") {
28
+ const s = { leftMm: 10, topMm: 10, widthMm: 60, heightMm: 10 };
29
+ return t === "list" ? {
30
+ kind: t,
31
+ leftMm: 10,
32
+ topMm: 30,
33
+ widthMm: 90,
34
+ dataset: u,
35
+ columns: [
36
+ { header: "字段", field: "field", widthMm: 45 },
37
+ { header: "数值", field: "value", widthMm: 45 }
38
+ ],
39
+ border: !0,
40
+ headerBackgroundColor: "#eaf2fc",
41
+ headerAlign: "center"
42
+ } : t === "text" ? {
43
+ ...s,
44
+ kind: t,
45
+ text: "文本",
46
+ style: { fontSize: 12, color: "#233c5c" }
47
+ } : t === "rect" ? {
48
+ ...s,
49
+ kind: t,
50
+ style: {
51
+ borderColor: "#cbd5e1",
52
+ lineWidthPt: 0.75,
53
+ backgroundColor: "#eff6ff"
54
+ }
55
+ } : {
56
+ ...s,
57
+ kind: t,
58
+ widthMm: 48,
59
+ heightMm: 24,
60
+ imageData: `data:image/svg+xml;charset=utf-8,${encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="180" height="90" viewBox="0 0 180 90"><rect width="180" height="90" rx="5" fill="#eff6ff"/><path d="m25 68 32-32 25 23 27-35 45 44" fill="none" stroke="#94b8e5" stroke-width="3"/><circle cx="45" cy="24" r="7" fill="#bfd5ef"/></svg>')}`
61
+ };
62
+ }
63
+ function Fe(t, u, s = !1) {
64
+ const r = Math.max(2, Math.min(u.widthMm, t.widthMm)), o = Math.max(2, Math.min(u.heightMm, t.heightMm));
65
+ return {
66
+ leftMm: Math.max(0, Math.min(u.widthMm - r, t.leftMm)),
67
+ topMm: Math.max(
68
+ 0,
69
+ Math.min(u.heightMm - (s ? 2 : o), t.topMm)
70
+ ),
71
+ widthMm: r,
72
+ heightMm: o
73
+ };
74
+ }
75
+ function Qe(t, u) {
76
+ const s = t.widthMm;
77
+ if (Object.assign(t, {
78
+ leftMm: u.leftMm,
79
+ topMm: u.topMm,
80
+ widthMm: u.widthMm
81
+ }), t.kind !== "list") t.heightMm = u.heightMm;
82
+ else if (s > 0 && u.widthMm !== s) {
83
+ const r = u.widthMm / s;
84
+ t.columns.forEach((o) => {
85
+ o.widthMm = Math.round(o.widthMm * r * 100) / 100;
86
+ }), t.widthMm = t.columns.reduce(
87
+ (o, b) => o + b.widthMm,
88
+ 0
89
+ ), t.headerGrid && (t.headerGrid.colWidthsMm = t.columns.map(
90
+ (o) => o.widthMm
91
+ ));
48
92
  }
49
- function D(d, r) {
50
- const i = S.value, m = i?.columns[d];
51
- if (m?.headerStyle?.align !== void 0 && (m.headerStyle = { ...m.headerStyle, align: r }), !i?.headerGrid) return;
52
- const t = ve(i.headerGrid, i.widthMm, 100).cells.filter(({ ci: L, cell: V }) => L <= d && L + (V.colSpan ?? 1) > d).slice(-1)[0];
53
- t && (t.cell.style = { ...t.cell.style, align: r }, i.columns.slice(t.ci, t.ci + (t.cell.colSpan ?? 1)).forEach((L) => {
54
- L.headerAlign = r, L.headerStyle?.align !== void 0 && (L.headerStyle = { ...L.headerStyle, align: r });
55
- }));
93
+ }
94
+ function Mt(t, u, s) {
95
+ if (u === s || !t.columns[u] || !t.columns[s]) return !1;
96
+ if (t.headerGrid) {
97
+ if (ve(t.headerGrid, t.widthMm, 100).cells.some(({ cell: b }) => (b.colSpan ?? 1) > 1))
98
+ throw new Error("请先拆分跨列合并表头,再调整列顺序,避免改变业务分组。");
99
+ const o = Re(t);
100
+ o.forEach((b) => {
101
+ b.splice(s, 0, b.splice(u, 1)[0]);
102
+ }), t.headerGrid = Ge(
103
+ o,
104
+ t.columns.map((b) => b.widthMm),
105
+ t.headerGrid.rowHeightsMm ?? o.map(() => 8)
106
+ );
56
107
  }
57
- function P(d, r) {
58
- if (!(!c() || d === "headerAlign" && r === "auto")) {
59
- for (const i of w.value) {
60
- const m = S.value?.columns[i];
61
- m && (Object.assign(m, { [d]: r }), d === "headerAlign" && D(i, r));
62
- }
63
- y();
108
+ return t.columns.splice(s, 0, t.columns.splice(u, 1)[0]), t.headerGrid && (t.headerGrid.colWidthsMm = t.columns.map((r) => r.widthMm)), !0;
109
+ }
110
+ function Re(t) {
111
+ if (!t.headerGrid)
112
+ return [t.columns.map((s) => ({ text: s.header }))];
113
+ const u = Array.from(
114
+ { length: t.headerGrid.cells.length },
115
+ () => Array.from({ length: t.columns.length }, () => null)
116
+ );
117
+ for (const { cell: s, ri: r, ci: o } of ve(
118
+ t.headerGrid,
119
+ t.widthMm,
120
+ 100
121
+ ).cells)
122
+ u[r][o] = s;
123
+ return u;
124
+ }
125
+ function Ge(t, u, s) {
126
+ const r = /* @__PURE__ */ new Set();
127
+ return { cells: t.map(
128
+ (b, m) => b.flatMap((_, d) => {
129
+ if (r.has(`${m}:${d}`)) return [];
130
+ if (!_) return [null];
131
+ for (let w = m; w < m + (_.rowSpan ?? 1); w++)
132
+ for (let C = d; C < d + (_.colSpan ?? 1); C++)
133
+ (w !== m || C !== d) && r.add(`${w}:${C}`);
134
+ return [_];
135
+ })
136
+ ), colWidthsMm: u, rowHeightsMm: s };
137
+ }
138
+ function Ct(t) {
139
+ const u = Re(t), s = t.headerGrid?.rowHeightsMm ?? u.map(() => 8);
140
+ u.unshift(
141
+ t.columns.map(() => ({
142
+ text: "分组",
143
+ style: { align: "center", backgroundColor: "#eaf2fc", bold: !0 }
144
+ }))
145
+ ), t.headerGrid = Ge(
146
+ u,
147
+ t.columns.map((r) => r.widthMm),
148
+ [8, ...s]
149
+ );
150
+ }
151
+ function xt(t, u, s, r) {
152
+ if (s >= r || s < 0 || r >= t.columns.length)
153
+ throw new Error("请选择同一行的至少两个连续表头。");
154
+ const o = Re(t), b = o[u];
155
+ if (!b) throw new Error("表头行不存在。");
156
+ const m = b.slice(s, r + 1);
157
+ if (m.some(
158
+ (d) => !d || (d.colSpan ?? 1) !== 1 || (d.rowSpan ?? 1) !== 1
159
+ ))
160
+ throw new Error("选择包含合并区域,请先拆分,再重新合并。");
161
+ const _ = m[0];
162
+ b[s] = { ..._, colSpan: r - s + 1 };
163
+ for (let d = s + 1; d <= r; d++) b[d] = null;
164
+ t.headerGrid = Ge(
165
+ o,
166
+ t.columns.map((d) => d.widthMm),
167
+ t.headerGrid?.rowHeightsMm ?? [8]
168
+ );
169
+ }
170
+ function _t(t, u, s) {
171
+ if (!t.headerGrid) return;
172
+ const o = ve(t.headerGrid, t.widthMm, 100).cells.find(
173
+ ({ ri: w, ci: C, cell: E }) => u >= w && u < w + (E.rowSpan ?? 1) && s >= C && s < C + (E.colSpan ?? 1)
174
+ );
175
+ if (!o) return;
176
+ const b = Re(t), { ri: m, ci: _, cell: d } = o;
177
+ for (let w = m; w < m + (d.rowSpan ?? 1); w++)
178
+ for (let C = _; C < _ + (d.colSpan ?? 1); C++) {
179
+ const E = {
180
+ ...d,
181
+ text: w === b.length - 1 ? t.columns[C].header : d.text
182
+ };
183
+ delete E.colSpan, delete E.rowSpan, b[w][C] = E;
64
184
  }
185
+ t.headerGrid = Ge(
186
+ b,
187
+ t.columns.map((w) => w.widthMm),
188
+ t.headerGrid.rowHeightsMm ?? b.map(() => 8)
189
+ );
190
+ }
191
+ function Ze(t, u, s) {
192
+ const r = t.filter((o) => o !== u).flatMap((o) => {
193
+ const b = o[s], m = s === "leftMm" ? o.widthMm : Oe(o);
194
+ return [b, b + m / 2, b + m];
195
+ });
196
+ return [...new Set(r)].sort((o, b) => o - b);
197
+ }
198
+ function St(t, u) {
199
+ if (!t.length) return;
200
+ let s = 0, r = t.length;
201
+ for (; s < r; ) {
202
+ const m = s + r >>> 1;
203
+ t[m] < u ? s = m + 1 : r = m;
65
204
  }
66
- return { selected: f, query: s, selectedColumns: w, lists: $, activeList: S, headerAlignments: p, visibleColumns: g, toggleColumn: k, selectVisible: T, clearSelection: h, setColumn: B, alignColumns: P };
205
+ const o = t[Math.max(0, s - 1)], b = t[Math.min(t.length - 1, s)];
206
+ return Math.abs(o - u) < Math.abs(b - u) ? o : b;
67
207
  }
68
- function De(v, M = { entries: 100, bytes: 16 * 1024 * 1024 }) {
69
- const c = j([v]), y = j(0), f = A(() => y.value > 0), s = A(() => y.value + 1 < c.value.length), w = A(() => c.value[y.value]);
70
- function $(g) {
71
- c.value = [g], y.value = 0;
72
- }
73
- function S(g) {
74
- if (c.value[y.value] === g) return;
75
- const k = c.value.slice(0, y.value + 1);
76
- k.push(g);
77
- let T = k.reduce((h, B) => h + B.length * 2, 0);
78
- for (; k.length > 1 && (k.length > M.entries || T > M.bytes); ) T -= k.shift().length * 2;
79
- c.value = k, y.value = c.value.length - 1;
80
- }
81
- function p(g) {
82
- if (!(g < 0 ? !f.value : !s.value))
83
- return y.value += g, c.value[y.value];
84
- }
85
- return { canUndo: f, canRedo: s, current: w, reset: $, record: S, move: p };
208
+ function et(t, u, s, r) {
209
+ let o = 1 / 0, b = {
210
+ value: Math.round(t * 2) / 2
211
+ };
212
+ for (const m of [0, u / 2, u]) {
213
+ const _ = St(s, t + m);
214
+ if (_ === void 0) continue;
215
+ const d = Math.abs(_ - t - m);
216
+ d <= r && d < o && (o = d, b = { value: _ - m, guide: _ });
217
+ }
218
+ return b;
86
219
  }
87
- function je(v) {
88
- const M = be(null), c = j(!1);
89
- let y, f = 0;
90
- function s(S) {
91
- y?.(S), y = void 0, M.value = null;
92
- }
93
- function w() {
94
- f++, s(!1), c.value = !1;
95
- }
96
- async function $(S) {
97
- w();
98
- const p = f, g = v();
99
- c.value = !0;
100
- try {
101
- const k = await new Promise((T, h) => {
102
- if (y = T, !g) {
103
- M.value = S;
104
- return;
105
- }
106
- Promise.resolve().then(() => f === p ? g(S) : !1).then((B) => {
107
- f === p && s(B === !0);
108
- }, (B) => {
109
- f === p && (y = void 0, M.value = null, h(B));
110
- });
111
- });
112
- return f === p && k === !0;
113
- } finally {
114
- f === p && (c.value = !1);
115
- }
220
+ function $t(t) {
221
+ let u;
222
+ function s(r, o, b = !1) {
223
+ if (t.disabled() || r.button !== 0) return;
224
+ r.preventDefault(), r.stopPropagation(), u?.();
225
+ const m = r.currentTarget.closest(
226
+ "[data-canvas-component]"
227
+ ), _ = Se(o), d = r.clientX, w = r.clientY;
228
+ let C = _, E = 0;
229
+ const G = t.scale.value, A = m.parentElement;
230
+ let g, f;
231
+ const I = () => {
232
+ for (const [T, N] of [
233
+ ["x", g],
234
+ ["y", f]
235
+ ])
236
+ A.style.setProperty(
237
+ `--mr-canvas-guide-${T}-display`,
238
+ N === void 0 ? "none" : "block"
239
+ ), N !== void 0 && A.style.setProperty(
240
+ `--mr-canvas-guide-${T}`,
241
+ `${N * G}px`
242
+ );
243
+ }, k = () => {
244
+ E = 0, I(), m.style.left = `${C.leftMm * G}px`, m.style.top = `${C.topMm * G}px`, m.style.width = `${C.widthMm * G}px`, m.style.height = `${C.heightMm * G}px`;
245
+ }, S = {
246
+ leftMm: Ze(t.page().components, o, "leftMm"),
247
+ topMm: Ze(t.page().components, o, "topMm")
248
+ }, c = (T) => {
249
+ const N = (T.clientX - d) / G, te = (T.clientY - w) / G, a = et(
250
+ _.leftMm + N,
251
+ _.widthMm,
252
+ S.leftMm,
253
+ 5 / G
254
+ ), q = et(
255
+ _.topMm + te,
256
+ _.heightMm,
257
+ S.topMm,
258
+ 5 / G
259
+ );
260
+ g = b ? void 0 : a.guide, f = b ? void 0 : q.guide, C = Fe(
261
+ b ? {
262
+ ..._,
263
+ widthMm: Math.round((_.widthMm + N) * 2) / 2,
264
+ heightMm: Math.round((_.heightMm + te) * 2) / 2
265
+ } : { ..._, leftMm: a.value, topMm: q.value },
266
+ t.page(),
267
+ o.kind === "list"
268
+ ), E || (E = requestAnimationFrame(k));
269
+ }, M = (T) => {
270
+ window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", p), window.removeEventListener("pointercancel", x), window.removeEventListener("keydown", D), E && cancelAnimationFrame(E), C = T ? C : _, g = void 0, f = void 0, k(), u = void 0, T && JSON.stringify(C) !== JSON.stringify(_) && t.commit(C);
271
+ }, p = () => M(!0), x = () => M(!1), D = (T) => {
272
+ T.key === "Escape" && (T.preventDefault(), x());
273
+ };
274
+ window.addEventListener("pointermove", c), window.addEventListener("pointerup", p), window.addEventListener("pointercancel", x), window.addEventListener("keydown", D), u = x;
116
275
  }
117
- return pe(w), { confirmation: M, pending: c, decide: s, request: $, cancel: w };
276
+ return Z(t.disabled, (r) => {
277
+ r && u?.();
278
+ }), Z(t.page, () => u?.()), $e(() => u?.()), { start: s };
118
279
  }
119
- const Re = {
120
- title: "报表模板属性编辑器",
121
- heading: "模板属性",
280
+ const Et = {
281
+ title: "报表模板设计器",
282
+ heading: "模板设计",
122
283
  unpublished: "未发布",
123
284
  dirty: "有未保存修改",
124
285
  reset: "恢复草稿",
@@ -149,7 +310,65 @@ const Re = {
149
310
  applyJson: "校验并应用 JSON",
150
311
  note: "字段映射应与数据源契约一致。此编辑器维护模板属性;保存由接入方提供的版本服务处理。",
151
312
  invalid: "请先修正模板错误,再预览或保存。"
152
- }, $e = {
313
+ }, It = {
314
+ repeatPage: "每页重复",
315
+ repeatNone: "不重复",
316
+ repeatHeader: "页眉",
317
+ repeatFooter: "页脚",
318
+ textFormat: "文字样式",
319
+ fontSize: "字号(pt)",
320
+ fontBold: "加粗",
321
+ textColor: "文字颜色",
322
+ backgroundColor: "背景颜色",
323
+ canvasGridLimited: "设计窗口仅显示前 2000 个单元格;最终预览与导出保留完整内容。",
324
+ design: "设计",
325
+ preview: "预览",
326
+ componentSection: "组件",
327
+ toolsSection: "工具",
328
+ component: "组件",
329
+ components: "组件目录",
330
+ canvasHint: "点击选择 · 拖动移动 · 方向键微调 · Shift 加速 · Esc 取消",
331
+ zoom: "缩放",
332
+ sampleRows: "数据预览区域",
333
+ resizeComponent: "调整组件尺寸",
334
+ resizeColumn: "调整列宽",
335
+ insertComponent: "添加组件",
336
+ insertText: "文本",
337
+ insertList: "明细表",
338
+ insertImage: "图片",
339
+ insertRect: "矩形",
340
+ removeComponent: "删除组件",
341
+ duplicateComponent: "复制组件",
342
+ forward: "向上移动层级",
343
+ backward: "向下移动层级",
344
+ positionGroup: "位置与尺寸 · mm",
345
+ componentContent: "组件内容",
346
+ componentText: "文本内容",
347
+ imageSource: "图片地址或 data URI",
348
+ imageUpload: "上传图片",
349
+ imageBudget: "图片不超过 4 MB,支持 PNG/JPEG/WebP/SVG",
350
+ leftPosition: "左侧",
351
+ topPosition: "顶部",
352
+ componentWidth: "宽度",
353
+ componentHeight: "高度",
354
+ noComponent: "在画布或目录选择组件",
355
+ listDataset: "数据集",
356
+ columnOrder: "列结构",
357
+ moveColumnLeft: "向前移动列",
358
+ moveColumnRight: "向后移动列",
359
+ columnVisible: "显示此列",
360
+ headerStructure: "多层表头",
361
+ addHeaderRow: "添加分组行",
362
+ mergeHeader: "合并所选表头",
363
+ splitHeader: "拆分表头",
364
+ headerRow: "表头行",
365
+ headerFirst: "开始列",
366
+ headerLast: "结束列",
367
+ excelTool: "Excel 绑定",
368
+ rulesTool: "计算与规则",
369
+ reviewTool: "发布检查",
370
+ toolsDescription: "按需绑定数据、定义规则并验证模板。",
371
+ rulesNeedList: "请先在字段区域选择明细表。",
153
372
  undo: "撤销",
154
373
  redo: "重做",
155
374
  columnsSearch: "搜索列名或字段",
@@ -181,14 +400,1057 @@ const Re = {
181
400
  templateRevision: "当前修订",
182
401
  readonly: "只读",
183
402
  ready: "可编辑",
184
- previewTitle: "实时预览"
185
- }, Be = { ...Re, ...$e };
186
- function Le(v, M) {
187
- const c = j(I(v.modelValue)), y = j(U(c.value)), f = j(U(c.value)), s = j(""), w = j(!1), $ = A(() => ({ ...Be, ...v.messages })), S = A(() => ({
403
+ previewTitle: "实时预览",
404
+ contentGroup: "内容",
405
+ formatGroup: "格式",
406
+ autoShort: "自动",
407
+ previousColumn: "上一字段",
408
+ nextColumn: "下一字段",
409
+ closeDirectory: "关闭字段目录",
410
+ technicalDetails: "标识与修订",
411
+ fieldPosition: "当前字段",
412
+ previewFieldDirectory: "定位字段"
413
+ }, Pe = {
414
+ ...Et,
415
+ ...It
416
+ }, At = { class: "mr-canvas" }, Dt = { class: "mr-canvas-heading" }, Tt = { class: "mr-canvas-scroll" }, Lt = ["data-canvas-component", "aria-label", "aria-pressed", "tabindex", "onFocus", "onPointerdown", "onClick", "onKeydown"], Rt = { class: "mr-canvas-table" }, Gt = {
417
+ key: 1,
418
+ class: "mr-canvas-table-row is-header"
419
+ }, Pt = ["onPointerdown"], Ht = {
420
+ key: 2,
421
+ class: "mr-canvas-placeholder"
422
+ }, Vt = ["aria-label", "onPointerdown"], Bt = {
423
+ key: 1,
424
+ class: "mr-canvas-static-grid"
425
+ }, zt = {
426
+ key: 0,
427
+ class: "mr-canvas-grid-limit"
428
+ }, jt = ["src"], Ft = ["aria-label", "onPointerdown"], Nt = /* @__PURE__ */ Ee({
429
+ __name: "TemplateDesignCanvas",
430
+ props: {
431
+ document: {},
432
+ selection: {},
433
+ pageIndex: {},
434
+ datasets: {},
435
+ disabled: { type: Boolean },
436
+ messages: {}
437
+ },
438
+ emits: ["select", "geometry", "column", "width"],
439
+ setup(t, { emit: u }) {
440
+ const s = t, r = u, o = z(() => ({ ...Pe, ...s.messages })), b = F(0.8), m = z(() => b.value * wt), _ = z(() => s.document.template.pages[s.pageIndex]), d = $t({
441
+ scale: m,
442
+ page: () => _.value,
443
+ disabled: () => s.disabled === !0,
444
+ commit: (k) => r("geometry", k)
445
+ });
446
+ function w(k) {
447
+ return s.selection?.pageIndex === s.pageIndex && s.selection.componentIndex === k;
448
+ }
449
+ function C(k) {
450
+ const S = _.value.components[k];
451
+ return {
452
+ left: `${S.leftMm * m.value}px`,
453
+ top: `${S.topMm * m.value}px`,
454
+ width: `${S.widthMm * m.value}px`,
455
+ height: `${Oe(S) * m.value}px`
456
+ };
457
+ }
458
+ function E(k, S) {
459
+ const c = _.value.components[S];
460
+ if (s.disabled || !w(S)) return;
461
+ const M = {
462
+ ArrowLeft: [-1, 0],
463
+ ArrowRight: [1, 0],
464
+ ArrowUp: [0, -1],
465
+ ArrowDown: [0, 1]
466
+ }, p = M[k.key];
467
+ if (!p) return;
468
+ k.preventDefault(), k.stopPropagation();
469
+ const x = Se(c), D = k.shiftKey ? 5 : 0.5;
470
+ x.leftMm += p[0] * D, x.topMm += p[1] * D, r("geometry", x);
471
+ }
472
+ function G(k) {
473
+ let S = 0;
474
+ return k.columns.map((c) => (S += c.widthMm, S));
475
+ }
476
+ function A(k) {
477
+ return k.grid ? ve(
478
+ k.grid,
479
+ k.widthMm,
480
+ k.heightMm
481
+ ).cells.slice(0, 2e3) : [];
482
+ }
483
+ function g(k) {
484
+ return k.headerGrid ? ve(
485
+ k.headerGrid,
486
+ k.widthMm,
487
+ k.headerGrid.rowHeightsMm?.reduce(
488
+ (S, c) => S + c,
489
+ 0
490
+ ) ?? k.headerGrid.cells.length * 8
491
+ ).cells : [];
492
+ }
493
+ let f;
494
+ Z(
495
+ () => s.disabled,
496
+ (k) => {
497
+ k && f?.();
498
+ }
499
+ ), Z(
500
+ () => s.document,
501
+ () => f?.()
502
+ ), $e(() => f?.());
503
+ function I(k, S, c) {
504
+ if (s.disabled || k.button !== 0) return;
505
+ k.preventDefault(), k.stopPropagation(), f?.();
506
+ const M = k.clientX, p = S.columns[c].widthMm;
507
+ let x = p;
508
+ const D = k.currentTarget, T = ($) => {
509
+ x = Math.max(
510
+ 2,
511
+ Math.round((p + ($.clientX - M) / m.value) * 2) / 2
512
+ ), D.style.transform = `translateX(${(x - p) * m.value}px)`;
513
+ }, N = () => {
514
+ window.removeEventListener("pointermove", T), window.removeEventListener("pointerup", te), window.removeEventListener("pointercancel", a), window.removeEventListener("keydown", q), D.style.transform = "", f = void 0;
515
+ }, te = () => {
516
+ N(), x !== p && r("width", c, x);
517
+ }, a = () => N(), q = ($) => {
518
+ $.key === "Escape" && ($.preventDefault(), a());
519
+ };
520
+ window.addEventListener("pointermove", T), window.addEventListener("pointerup", te), window.addEventListener("pointercancel", a), window.addEventListener("keydown", q), f = a;
521
+ }
522
+ return (k, S) => (h(), y("div", At, [
523
+ n("div", Dt, [
524
+ n("span", null, l(o.value.canvasHint), 1),
525
+ n("label", null, [
526
+ P(l(o.value.zoom), 1),
527
+ ae(n("select", {
528
+ "onUpdate:modelValue": S[0] || (S[0] = (c) => b.value = c)
529
+ }, [...S[1] || (S[1] = [
530
+ n("option", { value: 0.5 }, "50%", -1),
531
+ n("option", { value: 0.8 }, "80%", -1),
532
+ n("option", { value: 1 }, "100%", -1),
533
+ n("option", { value: 1.25 }, "125%", -1)
534
+ ])], 512), [
535
+ [
536
+ ye,
537
+ b.value,
538
+ void 0,
539
+ { number: !0 }
540
+ ]
541
+ ])
542
+ ])
543
+ ]),
544
+ n("div", Tt, [
545
+ n("div", {
546
+ class: "mr-canvas-paper",
547
+ style: re({
548
+ width: `${_.value.widthMm * m.value}px`,
549
+ height: `${_.value.heightMm * m.value}px`
550
+ })
551
+ }, [
552
+ (h(!0), y(U, null, W(_.value.components, (c, M) => (h(), y("div", {
553
+ key: M,
554
+ class: _e(["mr-canvas-component", { "is-selected": w(M) }]),
555
+ "data-canvas-component": M,
556
+ style: re(C(M)),
557
+ role: "button",
558
+ "aria-label": `${o.value.component} ${M + 1} ${c.kind}`,
559
+ "aria-pressed": w(M),
560
+ tabindex: w(M) ? 0 : -1,
561
+ onFocus: (p) => r("select", { pageIndex: t.pageIndex, componentIndex: M }),
562
+ onPointerdown: (p) => {
563
+ r("select", { pageIndex: t.pageIndex, componentIndex: M }), e(d).start(p, c);
564
+ },
565
+ onClick: (p) => r("select", { pageIndex: t.pageIndex, componentIndex: M }),
566
+ onKeydown: (p) => E(p, M)
567
+ }, [
568
+ c.kind === "list" ? (h(), y(U, { key: 0 }, [
569
+ n("div", Rt, [
570
+ c.headerGrid ? (h(), y("div", {
571
+ key: 0,
572
+ class: "mr-canvas-merged",
573
+ style: re({
574
+ height: `${(c.headerGrid.rowHeightsMm?.reduce((p, x) => p + x, 0) ?? c.headerGrid.cells.length * 8) * m.value}px`
575
+ })
576
+ }, [
577
+ (h(!0), y(U, null, W(g(c), (p, x) => (h(), y("div", {
578
+ key: x,
579
+ style: re({
580
+ left: `${p.xMm * m.value}px`,
581
+ top: `${p.yMm * m.value}px`,
582
+ width: `${p.widthMm * m.value}px`,
583
+ height: `${p.heightMm * m.value}px`,
584
+ textAlign: p.cell.style?.align ?? "center"
585
+ })
586
+ }, l(p.cell.text), 5))), 128))
587
+ ], 4)) : (h(), y("div", Gt, [
588
+ (h(!0), y(U, null, W(c.columns, (p, x) => (h(), y("div", {
589
+ key: x,
590
+ style: re({
591
+ width: `${p.widthMm * m.value}px`,
592
+ opacity: p.hidden ? 0.35 : 1
593
+ }),
594
+ onPointerdown: tt((D) => {
595
+ r("select", { pageIndex: t.pageIndex, componentIndex: M }), r("column", x);
596
+ }, ["stop"])
597
+ }, l(p.header), 45, Pt))), 128))
598
+ ])),
599
+ (h(!0), y(U, null, W((t.datasets?.[c.dataset] ?? []).slice(0, 3), (p, x) => (h(), y("div", {
600
+ key: x,
601
+ class: "mr-canvas-table-row"
602
+ }, [
603
+ (h(!0), y(U, null, W(c.columns, (D, T) => (h(), y("div", {
604
+ key: T,
605
+ style: re({
606
+ width: `${D.widthMm * m.value}px`,
607
+ opacity: D.hidden ? 0.35 : 1
608
+ })
609
+ }, l(p[D.field] ?? "—"), 5))), 128))
610
+ ]))), 128)),
611
+ t.datasets?.[c.dataset]?.length ? B("", !0) : (h(), y("div", Ht, l(c.dataset) + " · " + l(o.value.sampleRows), 1))
612
+ ]),
613
+ w(M) && !t.disabled ? (h(!0), y(U, { key: 0 }, W(G(c), (p, x) => (h(), y("span", {
614
+ key: x,
615
+ class: "mr-canvas-column-handle",
616
+ "aria-label": `${o.value.resizeColumn} ${c.columns[x]?.header}`,
617
+ role: "separator",
618
+ "aria-orientation": "vertical",
619
+ style: re({ left: `${p * m.value}px` }),
620
+ onPointerdown: (D) => I(D, c, x)
621
+ }, null, 44, Vt))), 128)) : B("", !0)
622
+ ], 64)) : c.grid ? (h(), y("div", Bt, [
623
+ (h(!0), y(U, null, W(A(c), (p, x) => (h(), y("div", {
624
+ key: x,
625
+ style: re({
626
+ left: `${p.xMm * m.value}px`,
627
+ top: `${p.yMm * m.value}px`,
628
+ width: `${p.widthMm * m.value}px`,
629
+ height: `${p.heightMm * m.value}px`,
630
+ backgroundColor: p.cell.style?.backgroundColor,
631
+ color: p.cell.style?.color,
632
+ fontWeight: p.cell.style?.bold ? "700" : "400",
633
+ fontSize: `${e(je)(p.cell.style).fontSizePx * b.value}px`,
634
+ textAlign: p.cell.style?.align ?? "left"
635
+ })
636
+ }, l(p.cell.text), 5))), 128)),
637
+ c.grid.cells.reduce((p, x) => p + x.length, 0) > 2e3 ? (h(), y("span", zt, l(o.value.canvasGridLimited), 1)) : B("", !0)
638
+ ])) : c.imageData ? (h(), y("img", {
639
+ key: 2,
640
+ src: c.imageData,
641
+ alt: "",
642
+ draggable: "false"
643
+ }, null, 8, jt)) : (h(), y("div", {
644
+ key: 3,
645
+ class: "mr-canvas-content",
646
+ style: re({
647
+ color: c.style?.color,
648
+ backgroundColor: c.style?.backgroundColor,
649
+ fontWeight: c.style?.bold ? "700" : "400",
650
+ fontSize: `${e(je)(c.style).fontSizePx * b.value}px`,
651
+ textAlign: c.style?.align
652
+ })
653
+ }, l(c.text ?? c.fallbackText ?? (c.kind === "rect" ? "" : c.kind)), 5)),
654
+ w(M) && !t.disabled ? (h(), y("span", {
655
+ key: 4,
656
+ class: "mr-canvas-resize",
657
+ "aria-label": o.value.resizeComponent,
658
+ role: "separator",
659
+ onPointerdown: (p) => e(d).start(p, c, !0)
660
+ }, null, 40, Ft)) : B("", !0)
661
+ ], 46, Lt))), 128))
662
+ ], 4)
663
+ ])
664
+ ]));
665
+ }
666
+ }), Ot = /* @__PURE__ */ Ie(Nt, [["__scopeId", "data-v-0b2669dc"]]), Ut = ["aria-label"], Jt = ["data-align", "aria-label", "title", "aria-checked", "tabindex", "onClick", "onKeydown"], Kt = { key: 0 }, Wt = {
667
+ key: 1,
668
+ viewBox: "0 0 20 20",
669
+ fill: "none",
670
+ "aria-hidden": "true"
671
+ }, Xt = {
672
+ key: 0,
673
+ d: "M3 4h14M3 8h9M3 12h14M3 16h9"
674
+ }, qt = {
675
+ key: 1,
676
+ d: "M3 4h14M6 8h8M3 12h14M6 16h8"
677
+ }, Yt = {
678
+ key: 2,
679
+ d: "M3 4h14M8 8h9M3 12h14M8 16h9"
680
+ }, Qt = {
681
+ key: 3,
682
+ d: "M3 4h14M3 8h14M3 12h14M3 16h14"
683
+ }, Zt = /* @__PURE__ */ Ee({
684
+ __name: "AlignmentControl",
685
+ props: {
686
+ modelValue: {},
687
+ label: {},
688
+ labels: {},
689
+ autoLabel: {},
690
+ allowAuto: { type: Boolean }
691
+ },
692
+ emits: ["update:modelValue"],
693
+ setup(t, { emit: u }) {
694
+ const s = t, r = u, o = () => s.allowAuto ? ["auto", "left", "center", "right", "justify"] : ["left", "center", "right", "justify"];
695
+ async function b(m, _) {
696
+ if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(m.key)) return;
697
+ m.preventDefault();
698
+ const w = o(), C = w.indexOf(_), E = m.key === "Home" ? 0 : m.key === "End" ? w.length - 1 : (C + (m.key === "ArrowRight" ? 1 : -1) + w.length) % w.length;
699
+ r("update:modelValue", w[E]);
700
+ const G = m.currentTarget.parentElement;
701
+ await de(), G?.querySelector(`[data-align="${w[E]}"]`)?.focus();
702
+ }
703
+ return (m, _) => (h(), y("div", {
704
+ class: "mr-designer-alignment",
705
+ role: "radiogroup",
706
+ "aria-label": t.label
707
+ }, [
708
+ (h(!0), y(U, null, W(o(), (d) => (h(), y("button", {
709
+ key: d,
710
+ type: "button",
711
+ role: "radio",
712
+ "data-align": d,
713
+ "aria-label": t.labels[d],
714
+ title: t.labels[d],
715
+ "aria-checked": t.modelValue === d,
716
+ tabindex: t.modelValue === d ? 0 : -1,
717
+ onClick: (w) => r("update:modelValue", d),
718
+ onKeydown: (w) => b(w, d)
719
+ }, [
720
+ d === "auto" ? (h(), y("span", Kt, l(t.autoLabel), 1)) : (h(), y("svg", Wt, [
721
+ d === "left" ? (h(), y("path", Xt)) : d === "center" ? (h(), y("path", qt)) : d === "right" ? (h(), y("path", Yt)) : (h(), y("path", Qt))
722
+ ]))
723
+ ], 40, Jt))), 128))
724
+ ], 8, Ut));
725
+ }
726
+ }), Ne = /* @__PURE__ */ Ie(Zt, [["__scopeId", "data-v-c85770c4"]]), en = ["disabled"], tn = { class: "mr-component-dimensions" }, nn = ["min", "value", "onChange"], on = { key: 0 }, an = ["value"], ln = { value: "" }, sn = { value: "header" }, rn = { value: "footer" }, dn = { key: 1 }, un = ["value"], cn = ["value"], mn = { class: "mr-component-upload" }, vn = ["aria-label"], pn = {
727
+ key: 0,
728
+ role: "alert"
729
+ }, hn = {
730
+ key: 3,
731
+ class: "mr-component-type"
732
+ }, gn = { class: "mr-component-dimensions" }, fn = ["value"], bn = ["checked"], yn = { class: "mr-component-dimensions" }, wn = ["value"], kn = ["value"], Mn = { key: 4 }, Cn = ["value"], xn = /* @__PURE__ */ Ee({
733
+ __name: "CanvasComponentInspector",
734
+ props: {
735
+ component: {},
736
+ disabled: { type: Boolean },
737
+ messages: {}
738
+ },
739
+ emits: ["geometry", "patch"],
740
+ setup(t, { emit: u }) {
741
+ const s = t, r = u, o = z(() => ({ ...Pe, ...s.messages })), b = F(""), m = ["leftMm", "topMm", "widthMm", "heightMm"], _ = z(() => [
742
+ o.value.leftPosition,
743
+ o.value.topPosition,
744
+ o.value.componentWidth,
745
+ o.value.componentHeight
746
+ ]);
747
+ function d(A, g) {
748
+ const f = Number(g.target.value);
749
+ Number.isFinite(f) && r("geometry", { ...Se(s.component), [A]: f });
750
+ }
751
+ function w(A, g) {
752
+ if (s.component.kind === "list") return;
753
+ const f = { ...s.component.style, [A]: g };
754
+ A === "fontSize" && delete f.fontSizePx, r("patch", { style: f });
755
+ }
756
+ const C = z(() => ({
757
+ auto: o.value.auto,
758
+ left: o.value.left,
759
+ center: o.value.center,
760
+ right: o.value.right,
761
+ justify: o.value.justify
762
+ }));
763
+ function E(A) {
764
+ return A.target.value;
765
+ }
766
+ async function G(A) {
767
+ const g = A.target, f = g.files?.[0];
768
+ if (!f) return;
769
+ b.value = "";
770
+ const I = s.component;
771
+ try {
772
+ if (f.size > 4 * 1024 * 1024 || !["image/png", "image/jpeg", "image/webp", "image/svg+xml"].includes(
773
+ f.type
774
+ ))
775
+ throw new Error(o.value.imageBudget);
776
+ const k = new FileReader(), S = await new Promise((c, M) => {
777
+ k.onload = () => c(String(k.result)), k.onerror = () => M(k.error), k.readAsDataURL(f);
778
+ });
779
+ !s.disabled && s.component === I && r("patch", { imageData: S });
780
+ } catch (k) {
781
+ b.value = k instanceof Error ? k.message : String(k);
782
+ } finally {
783
+ g.value = "";
784
+ }
785
+ }
786
+ return (A, g) => (h(), y("fieldset", {
787
+ class: "mr-component-properties",
788
+ disabled: t.disabled
789
+ }, [
790
+ n("h3", null, l(o.value.positionGroup), 1),
791
+ n("div", tn, [
792
+ (h(!0), y(U, null, W(m.filter(
793
+ (f) => t.component.kind !== "list" || f !== "heightMm"
794
+ ), (f, I) => (h(), y("label", { key: f }, [
795
+ P(l(_.value[I]), 1),
796
+ n("input", {
797
+ type: "number",
798
+ step: "0.5",
799
+ min: f === "widthMm" || f === "heightMm" ? 2 : 0,
800
+ value: e(Se)(t.component)[f],
801
+ onChange: (k) => d(f, k)
802
+ }, null, 40, nn)
803
+ ]))), 128))
804
+ ]),
805
+ t.component.kind !== "list" ? (h(), y("label", on, [
806
+ P(l(o.value.repeatPage), 1),
807
+ n("select", {
808
+ value: t.component.pageAnchor ?? "",
809
+ onChange: g[0] || (g[0] = (f) => r("patch", { pageAnchor: E(f) || void 0 }))
810
+ }, [
811
+ n("option", ln, l(o.value.repeatNone), 1),
812
+ n("option", sn, l(o.value.repeatHeader), 1),
813
+ n("option", rn, l(o.value.repeatFooter), 1)
814
+ ], 40, an)
815
+ ])) : B("", !0),
816
+ n("h3", null, l(o.value.componentContent), 1),
817
+ t.component.kind === "text" ? (h(), y("label", dn, [
818
+ P(l(o.value.componentText), 1),
819
+ n("textarea", {
820
+ rows: "4",
821
+ value: t.component.text,
822
+ onChange: g[1] || (g[1] = (f) => r("patch", { text: E(f) }))
823
+ }, null, 40, un)
824
+ ])) : B("", !0),
825
+ t.component.kind === "image" ? (h(), y(U, { key: 2 }, [
826
+ n("label", null, [
827
+ P(l(o.value.imageSource), 1),
828
+ n("textarea", {
829
+ rows: "2",
830
+ value: t.component.imageData,
831
+ onChange: g[2] || (g[2] = (f) => r("patch", { imageData: E(f) }))
832
+ }, null, 40, cn)
833
+ ]),
834
+ n("label", mn, [
835
+ P(l(o.value.imageUpload), 1),
836
+ n("input", {
837
+ type: "file",
838
+ accept: "image/png,image/jpeg,image/webp,image/svg+xml",
839
+ "aria-label": o.value.imageUpload,
840
+ onChange: G
841
+ }, null, 40, vn)
842
+ ]),
843
+ b.value ? (h(), y("p", pn, l(b.value), 1)) : B("", !0)
844
+ ], 64)) : B("", !0),
845
+ t.component.kind === "text" ? (h(), y("div", hn, [
846
+ n("h3", null, l(o.value.textFormat), 1),
847
+ n("div", gn, [
848
+ n("label", null, [
849
+ P(l(o.value.fontSize), 1),
850
+ n("input", {
851
+ type: "number",
852
+ min: "1",
853
+ max: "200",
854
+ value: e(je)(t.component.style).fontSizePt,
855
+ onChange: g[3] || (g[3] = (f) => w("fontSize", Number(E(f))))
856
+ }, null, 40, fn)
857
+ ]),
858
+ n("label", null, [
859
+ P(l(o.value.fontBold), 1),
860
+ n("input", {
861
+ type: "checkbox",
862
+ checked: t.component.style?.bold === !0,
863
+ onChange: g[4] || (g[4] = (f) => w("bold", f.target.checked))
864
+ }, null, 40, bn)
865
+ ])
866
+ ]),
867
+ Q(Ne, {
868
+ "model-value": t.component.style?.align ?? "left",
869
+ label: o.value.bodyAlign,
870
+ labels: C.value,
871
+ "auto-label": o.value.autoShort,
872
+ "onUpdate:modelValue": g[5] || (g[5] = (f) => w("align", f))
873
+ }, null, 8, ["model-value", "label", "labels", "auto-label"]),
874
+ n("div", yn, [
875
+ n("label", null, [
876
+ P(l(o.value.textColor), 1),
877
+ n("input", {
878
+ type: "color",
879
+ value: t.component.style?.color ?? "#233c5c",
880
+ onChange: g[6] || (g[6] = (f) => w("color", E(f)))
881
+ }, null, 40, wn)
882
+ ]),
883
+ n("label", null, [
884
+ P(l(o.value.backgroundColor), 1),
885
+ n("input", {
886
+ type: "color",
887
+ value: t.component.style?.backgroundColor ?? "#ffffff",
888
+ onChange: g[7] || (g[7] = (f) => w("backgroundColor", E(f)))
889
+ }, null, 40, kn)
890
+ ])
891
+ ])
892
+ ])) : B("", !0),
893
+ t.component.kind === "list" ? (h(), y("label", Mn, [
894
+ P(l(o.value.listDataset), 1),
895
+ n("input", {
896
+ value: t.component.dataset,
897
+ onChange: g[8] || (g[8] = (f) => r("patch", { dataset: E(f) }))
898
+ }, null, 40, Cn)
899
+ ])) : B("", !0)
900
+ ], 8, en));
901
+ }
902
+ }), _n = /* @__PURE__ */ Ie(xn, [["__scopeId", "data-v-2dcbd9cb"]]), Sn = { class: "mr-header-editor" }, $n = ["disabled"], En = ["value"], In = ["value"], An = ["value"], Dn = ["disabled"], Tn = /* @__PURE__ */ Ee({
903
+ __name: "HeaderStructureEditor",
904
+ props: {
905
+ list: {},
906
+ disabled: { type: Boolean },
907
+ messages: {}
908
+ },
909
+ emits: ["command"],
910
+ setup(t, { emit: u }) {
911
+ const s = t, r = u, o = z(() => ({ ...Pe, ...s.messages })), b = F(0), m = F(0), _ = F(Math.min(1, s.list.columns.length - 1));
912
+ return Z(
913
+ () => s.list.columns.length,
914
+ (d) => {
915
+ m.value = Math.min(m.value, d - 1), _.value = Math.min(_.value, d - 1);
916
+ }
917
+ ), (d, w) => (h(), y("details", Sn, [
918
+ n("summary", null, [
919
+ P(l(o.value.headerStructure), 1),
920
+ n("span", null, l(t.list.headerGrid?.cells.length ?? 1) + " " + l(o.value.headerRow), 1)
921
+ ]),
922
+ n("fieldset", { disabled: t.disabled }, [
923
+ n("label", null, [
924
+ P(l(o.value.headerRow), 1),
925
+ ae(n("select", {
926
+ "onUpdate:modelValue": w[0] || (w[0] = (C) => b.value = C)
927
+ }, [
928
+ (h(!0), y(U, null, W(t.list.headerGrid?.cells.length ?? 1, (C) => (h(), y("option", {
929
+ key: C,
930
+ value: C - 1
931
+ }, l(C), 9, En))), 128))
932
+ ], 512), [
933
+ [
934
+ ye,
935
+ b.value,
936
+ void 0,
937
+ { number: !0 }
938
+ ]
939
+ ])
940
+ ]),
941
+ n("label", null, [
942
+ P(l(o.value.headerFirst), 1),
943
+ ae(n("select", {
944
+ "onUpdate:modelValue": w[1] || (w[1] = (C) => m.value = C)
945
+ }, [
946
+ (h(!0), y(U, null, W(t.list.columns, (C, E) => (h(), y("option", {
947
+ key: E,
948
+ value: E
949
+ }, l(E + 1) + " · " + l(C.header), 9, In))), 128))
950
+ ], 512), [
951
+ [
952
+ ye,
953
+ m.value,
954
+ void 0,
955
+ { number: !0 }
956
+ ]
957
+ ])
958
+ ]),
959
+ n("label", null, [
960
+ P(l(o.value.headerLast), 1),
961
+ ae(n("select", {
962
+ "onUpdate:modelValue": w[2] || (w[2] = (C) => _.value = C)
963
+ }, [
964
+ (h(!0), y(U, null, W(t.list.columns, (C, E) => (h(), y("option", {
965
+ key: E,
966
+ value: E
967
+ }, l(E + 1) + " · " + l(C.header), 9, An))), 128))
968
+ ], 512), [
969
+ [
970
+ ye,
971
+ _.value,
972
+ void 0,
973
+ { number: !0 }
974
+ ]
975
+ ])
976
+ ]),
977
+ n("div", null, [
978
+ n("button", {
979
+ type: "button",
980
+ onClick: w[3] || (w[3] = (C) => r("command", { action: "add", row: b.value, first: m.value, last: _.value }))
981
+ }, l(o.value.addHeaderRow), 1),
982
+ n("button", {
983
+ type: "button",
984
+ disabled: m.value >= _.value,
985
+ onClick: w[4] || (w[4] = (C) => r("command", { action: "merge", row: b.value, first: m.value, last: _.value }))
986
+ }, l(o.value.mergeHeader), 9, Dn),
987
+ n("button", {
988
+ type: "button",
989
+ onClick: w[5] || (w[5] = (C) => r("command", { action: "split", row: b.value, first: m.value, last: _.value }))
990
+ }, l(o.value.splitHeader), 1)
991
+ ])
992
+ ], 8, $n)
993
+ ]));
994
+ }
995
+ }), Ln = /* @__PURE__ */ Ie(Tn, [["__scopeId", "data-v-acd607ef"]]);
996
+ function Rn(t, u) {
997
+ const s = F("preview"), r = F(), o = F(0), b = z(
998
+ () => ze(t.value, r.value)
999
+ );
1000
+ Z(t, () => {
1001
+ b.value || (r.value = void 0), t.value.template.pages[o.value] || (o.value = 0);
1002
+ });
1003
+ function m(A) {
1004
+ r.value = A, o.value = A.pageIndex;
1005
+ }
1006
+ function _(A) {
1007
+ const g = r.value;
1008
+ return g ? u((f) => {
1009
+ const I = ze(f, g);
1010
+ I && A(I, f);
1011
+ }) : !1;
1012
+ }
1013
+ function d(A) {
1014
+ _((g, f) => {
1015
+ const I = f.template.pages[r.value.pageIndex];
1016
+ Qe(
1017
+ g,
1018
+ Fe(A, I, g.kind === "list")
1019
+ );
1020
+ });
1021
+ }
1022
+ function w(A) {
1023
+ let g = -1;
1024
+ const f = o.value;
1025
+ u((I) => {
1026
+ const k = I.template.pages[f].components;
1027
+ k.push(kt(A)), g = k.length - 1;
1028
+ }) && m({ pageIndex: f, componentIndex: g });
1029
+ }
1030
+ function C() {
1031
+ const A = r.value;
1032
+ A && u((g) => {
1033
+ g.template.pages[A.pageIndex].components.splice(
1034
+ A.componentIndex,
1035
+ 1
1036
+ );
1037
+ }) && (r.value = void 0);
1038
+ }
1039
+ function E() {
1040
+ const A = r.value;
1041
+ if (!A) return;
1042
+ let g = -1;
1043
+ u((f) => {
1044
+ const I = f.template.pages[A.pageIndex], k = structuredClone(ze(f, A)), S = Se(k);
1045
+ S.leftMm += 4, S.topMm += 4, Qe(
1046
+ k,
1047
+ Fe(S, I, k.kind === "list")
1048
+ ), k.kind === "list" ? delete k.id : (delete k.nid, delete k.rkey), I.components.push(k), g = I.components.length - 1;
1049
+ }) && m({ pageIndex: A.pageIndex, componentIndex: g });
1050
+ }
1051
+ function G(A) {
1052
+ const g = r.value;
1053
+ if (!g) return;
1054
+ const f = g.componentIndex + A;
1055
+ t.value.template.pages[g.pageIndex]?.components[f] && u((I) => {
1056
+ const k = I.template.pages[g.pageIndex].components;
1057
+ k.splice(f, 0, k.splice(g.componentIndex, 1)[0]);
1058
+ }) && m({ pageIndex: g.pageIndex, componentIndex: f });
1059
+ }
1060
+ return {
1061
+ mode: s,
1062
+ selection: r,
1063
+ pageIndex: o,
1064
+ active: b,
1065
+ select: m,
1066
+ mutate: _,
1067
+ geometry: d,
1068
+ insert: w,
1069
+ remove: C,
1070
+ duplicate: E,
1071
+ reorder: G
1072
+ };
1073
+ }
1074
+ function Gn(t, u, s) {
1075
+ const { draft: r, lists: o, selected: b, activeList: m, blocked: _, jsonPending: d, error: w } = t, { section: C, activeIndex: E } = u, G = Rn(r, t.transaction), {
1076
+ mode: A,
1077
+ selection: g,
1078
+ pageIndex: f,
1079
+ active: I
1080
+ } = G, k = F("excel"), S = F(/* @__PURE__ */ new Set());
1081
+ Z([C, k], () => {
1082
+ C.value === "tools" && (S.value = /* @__PURE__ */ new Set([...S.value, k.value]));
1083
+ }), Z(g, ($) => {
1084
+ if (!$) return;
1085
+ const L = o.value.findIndex(
1086
+ (R) => R.pageIndex === $.pageIndex && R.componentIndex === $.componentIndex
1087
+ );
1088
+ L >= 0 && (b.value = L);
1089
+ });
1090
+ const c = z(
1091
+ () => t.editingReadonly.value || _.value || d.value
1092
+ ), M = z(
1093
+ () => s()?.[m.value?.dataset ?? ""]
1094
+ );
1095
+ function p($) {
1096
+ A.value = $, C.value === "tools" && (C.value = $ === "design" ? "component" : "fields");
1097
+ }
1098
+ function x($) {
1099
+ if (!r.value.template.pages[$.pageIndex]?.components[$.componentIndex])
1100
+ return;
1101
+ if (G.select($), r.value.template.pages[$.pageIndex]?.components[$.componentIndex]?.kind === "list") {
1102
+ const R = o.value.findIndex(
1103
+ (H) => H.pageIndex === $.pageIndex && H.componentIndex === $.componentIndex
1104
+ );
1105
+ R >= 0 && (b.value = R), C.value = "fields";
1106
+ } else C.value = "component";
1107
+ }
1108
+ function D($) {
1109
+ const L = $.target;
1110
+ L.value && (G.insert(L.value), A.value = "design", C.value = "component", L.value = "");
1111
+ }
1112
+ function T($) {
1113
+ G.mutate((L, R) => {
1114
+ if (L.kind !== "list" && $.pageAnchor !== L.pageAnchor) {
1115
+ const K = R.template.pages[g.value.pageIndex];
1116
+ $.pageAnchor === "header" && (L.topMm = K.marginTopMm ?? 0), $.pageAnchor === "footer" && (L.topMm = Math.max(
1117
+ 0,
1118
+ K.heightMm - (K.marginBottomMm ?? 0) - L.heightMm
1119
+ ));
1120
+ }
1121
+ const H = L;
1122
+ for (const [K, ue] of Object.entries($))
1123
+ ue === void 0 ? delete H[K] : H[K] = ue;
1124
+ });
1125
+ }
1126
+ function N($) {
1127
+ const L = o.value[b.value];
1128
+ L && t.transaction((R) => {
1129
+ R.template.pages[L.pageIndex].components[L.componentIndex] = $;
1130
+ });
1131
+ }
1132
+ function te($) {
1133
+ const L = m.value;
1134
+ if (!L) return;
1135
+ const R = JSON.parse(JSON.stringify(L));
1136
+ try {
1137
+ Mt(R, E.value, E.value + $) && (N(R), u.activate(E.value + $));
1138
+ } catch (H) {
1139
+ w.value = H instanceof Error ? H.message : String(H);
1140
+ }
1141
+ }
1142
+ function a($) {
1143
+ const L = o.value[b.value];
1144
+ L && t.transaction((R) => {
1145
+ const H = R.template.pages[L.pageIndex].components[L.componentIndex];
1146
+ H?.kind === "list" && ($.action === "add" ? Ct(H) : $.action === "merge" ? xt(H, $.row, $.first, $.last) : _t(H, $.row, $.first));
1147
+ });
1148
+ }
1149
+ function q($) {
1150
+ const L = /\.pages\[(\d+)\]\.components\[(\d+)\]/.exec($.path ?? ""), R = $.pageIndex ?? (L ? Number(L[1]) : void 0), H = $.componentIndex ?? (L ? Number(L[2]) : void 0);
1151
+ if (!(R === void 0 || H === void 0) && (A.value = "design", x({ pageIndex: R, componentIndex: H }), $.field)) {
1152
+ const K = m.value?.columns.findIndex(
1153
+ (ue) => ue.field === $.field
1154
+ );
1155
+ K !== void 0 && K >= 0 && u.activate(K);
1156
+ }
1157
+ }
1158
+ return {
1159
+ mode: A,
1160
+ setMode: p,
1161
+ canvasSelection: g,
1162
+ canvasPage: f,
1163
+ canvasActive: I,
1164
+ tool: k,
1165
+ visitedTools: S,
1166
+ editDisabled: c,
1167
+ dataSchema: M,
1168
+ chooseCanvas: x,
1169
+ insertComponent: D,
1170
+ patchCanvas: T,
1171
+ changeList: N,
1172
+ moveColumn: te,
1173
+ headerCommand: a,
1174
+ locateReview: q,
1175
+ canvas: G
1176
+ };
1177
+ }
1178
+ function Pn(t, u, s) {
1179
+ if (!t.length) return;
1180
+ const r = Math.max(0, t.indexOf(u)), b = {
1181
+ ArrowDown: Math.min(r + 1, t.length - 1),
1182
+ ArrowUp: Math.max(r - 1, 0),
1183
+ Home: 0,
1184
+ End: t.length - 1
1185
+ }[s];
1186
+ return b === void 0 ? void 0 : t[b];
1187
+ }
1188
+ function Hn(t, u, s) {
1189
+ const r = F(!1), o = F(t.activeIndex.value), b = F(null), m = F(null), _ = F(null), d = F(null);
1190
+ function w(S = !1) {
1191
+ const c = d.value, M = c?.querySelector(
1192
+ `button[data-column-index="${o.value}"]`
1193
+ );
1194
+ if (!c || !M) return;
1195
+ S && M.focus({ preventScroll: !0 });
1196
+ const p = c.getBoundingClientRect(), x = M.getBoundingClientRect(), D = p.top + c.clientTop, T = D + c.clientHeight;
1197
+ x.top < D ? c.scrollTop += x.top - D : x.bottom > T && (c.scrollTop += x.bottom - T);
1198
+ }
1199
+ async function C(S = !1) {
1200
+ r.value && (r.value = !1, S && (await de(), b.value?.focus({ preventScroll: !0 })));
1201
+ }
1202
+ async function E() {
1203
+ if (r.value) return C(!0);
1204
+ const S = s.value.map((c) => c.index);
1205
+ o.value = S.includes(t.activeIndex.value) ? t.activeIndex.value : S[0] ?? -1, r.value = !0, await de(), _.value?.focus({ preventScroll: !0 }), w();
1206
+ }
1207
+ function G(S) {
1208
+ t.activate(S), C(!0);
1209
+ }
1210
+ function A(S) {
1211
+ r.value && (S.preventDefault(), S.stopPropagation(), C(!0));
1212
+ }
1213
+ async function g(S) {
1214
+ const c = Pn(
1215
+ s.value.map((M) => M.index),
1216
+ o.value,
1217
+ S.key
1218
+ );
1219
+ c !== void 0 && (o.value = c, S.preventDefault(), await de(), w(!0));
1220
+ }
1221
+ async function f(S) {
1222
+ if (!["ArrowDown", "ArrowUp", "Enter"].includes(S.key)) return;
1223
+ S.preventDefault(), S.stopPropagation();
1224
+ const c = s.value.map((M) => M.index);
1225
+ if (c.length) {
1226
+ if (S.key === "Enter") {
1227
+ c.includes(o.value) && G(o.value);
1228
+ return;
1229
+ }
1230
+ S.key === "ArrowUp" && (o.value = c.at(-1)), await de(), w(!0);
1231
+ }
1232
+ }
1233
+ function I(S) {
1234
+ const c = S.target;
1235
+ !r.value || m.value?.contains(c) || b.value?.contains(c) || C();
1236
+ }
1237
+ function k(S) {
1238
+ const c = S.relatedTarget;
1239
+ !c || m.value?.contains(c) || b.value?.contains(c) || C();
1240
+ }
1241
+ return Z(s, (S) => {
1242
+ S.some((c) => c.index === o.value) || (o.value = S[0]?.index ?? -1);
1243
+ }), Z(u, () => {
1244
+ C();
1245
+ }), ht(() => document.addEventListener("pointerdown", I)), $e(() => document.removeEventListener("pointerdown", I)), {
1246
+ open: r,
1247
+ cursor: o,
1248
+ trigger: b,
1249
+ panel: m,
1250
+ search: _,
1251
+ list: d,
1252
+ toggle: E,
1253
+ close: C,
1254
+ choose: G,
1255
+ escape: A,
1256
+ navigate: g,
1257
+ searchKeydown: f,
1258
+ leave: k
1259
+ };
1260
+ }
1261
+ function Vn(t, u, s, r) {
1262
+ const o = F(0), b = F(""), m = F([]), _ = z(
1263
+ () => t.value.template.pages.flatMap(
1264
+ (c, M) => c.components.flatMap(
1265
+ (p, x) => p.kind === "list" ? [{ component: p, pageIndex: M, componentIndex: x }] : []
1266
+ )
1267
+ )
1268
+ ), d = z(
1269
+ () => _.value[o.value]?.component
1270
+ ), w = z(() => {
1271
+ const c = d.value;
1272
+ if (!c) return [];
1273
+ const M = c.columns.map(
1274
+ (p) => p.headerStyle?.align ?? p.headerAlign ?? c.headerStyle?.align ?? c.headerAlign ?? p.style?.align ?? "center"
1275
+ );
1276
+ if (c.headerGrid && u())
1277
+ for (const p of ve(c.headerGrid, c.widthMm, 100).cells)
1278
+ for (let x = p.ci; x < p.ci + (p.cell.colSpan ?? 1); x++)
1279
+ M[x] = p.cell.style?.align ?? "left";
1280
+ return M;
1281
+ }), C = z(() => {
1282
+ const c = b.value.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);
1283
+ return (d.value?.columns ?? []).flatMap((M, p) => {
1284
+ const x = `${M.header} ${M.field}`.toLocaleLowerCase();
1285
+ return c.every((D) => x.includes(D)) ? [{ column: M, index: p }] : [];
1286
+ });
1287
+ });
1288
+ function E(c, M) {
1289
+ m.value = M ? [.../* @__PURE__ */ new Set([...m.value, c])] : m.value.filter((p) => p !== c);
1290
+ }
1291
+ function G(c) {
1292
+ for (const M of C.value) E(M.index, c);
1293
+ }
1294
+ function A() {
1295
+ m.value = [];
1296
+ }
1297
+ function g(c, M, p) {
1298
+ if (!s()) return;
1299
+ const x = d.value?.columns[c];
1300
+ x && (M === "hidden" && p === !0 && !d.value?.columns.some(
1301
+ (D, T) => T !== c && !D.hidden
1302
+ ) || (Object.assign(x, { [M]: M === "widthMm" ? Number(p) : p }), M === "header" && I(c, String(p)), M === "headerAlign" && k(
1303
+ c,
1304
+ p
1305
+ ), M === "widthMm" && f(), r()));
1306
+ }
1307
+ function f() {
1308
+ const c = _.value[o.value];
1309
+ if (!c) return;
1310
+ const M = c.component, p = t.value.template.pages[c.pageIndex], x = M.columns.map((D) => D.widthMm);
1311
+ M.headerGrid && (M.headerGrid.colWidthsMm = x), p.layout === "wide" && x.every((D) => Number.isFinite(D) && D > 0) && (M.widthMm = x.reduce((D, T) => D + T, 0), p.widthMm = Math.max(
1312
+ ...p.components.map(
1313
+ (D) => D.leftMm + D.widthMm
1314
+ )
1315
+ ) + (p.marginRightMm ?? 0));
1316
+ }
1317
+ function I(c, M) {
1318
+ const p = d.value;
1319
+ if (!p?.headerGrid) return;
1320
+ const D = ve(p.headerGrid, p.widthMm, 100).cells.filter(({ ci: T, cell: N }) => T <= c && T + (N.colSpan ?? 1) > c).slice(-1)[0];
1321
+ D && (Object.assign(D.cell, { text: M, rawText: M, value: M }), p.columns.slice(D.ci, D.ci + (D.cell.colSpan ?? 1)).forEach((T) => {
1322
+ T.header = M;
1323
+ }));
1324
+ }
1325
+ function k(c, M) {
1326
+ const p = d.value, x = p?.columns[c];
1327
+ if (x?.headerStyle?.align !== void 0 && (x.headerStyle = { ...x.headerStyle, align: M }), !p?.headerGrid) return;
1328
+ const T = ve(p.headerGrid, p.widthMm, 100).cells.filter(({ ci: N, cell: te }) => N <= c && N + (te.colSpan ?? 1) > c).slice(-1)[0];
1329
+ T && (T.cell.style = { ...T.cell.style, align: M }, p.columns.slice(T.ci, T.ci + (T.cell.colSpan ?? 1)).forEach((N) => {
1330
+ N.headerAlign = M, N.headerStyle?.align !== void 0 && (N.headerStyle = { ...N.headerStyle, align: M });
1331
+ }));
1332
+ }
1333
+ function S(c, M) {
1334
+ if (!(!s() || c === "headerAlign" && M === "auto")) {
1335
+ for (const p of m.value) {
1336
+ const x = d.value?.columns[p];
1337
+ x && (Object.assign(x, { [c]: M }), c === "headerAlign" && k(
1338
+ p,
1339
+ M
1340
+ ));
1341
+ }
1342
+ r();
1343
+ }
1344
+ }
1345
+ return {
1346
+ selected: o,
1347
+ query: b,
1348
+ selectedColumns: m,
1349
+ lists: _,
1350
+ activeList: d,
1351
+ headerAlignments: w,
1352
+ visibleColumns: C,
1353
+ toggleColumn: E,
1354
+ selectVisible: G,
1355
+ clearSelection: A,
1356
+ setColumn: g,
1357
+ alignColumns: S
1358
+ };
1359
+ }
1360
+ function be(t) {
1361
+ return t.kind === "snapshot" ? t.value.length * 2 : (t.removed.length + t.inserted.length) * 2 + 16;
1362
+ }
1363
+ function Bn(t, u, s = !1) {
1364
+ const r = { kind: "snapshot", value: u };
1365
+ if (s) return r;
1366
+ let o = 0;
1367
+ const b = Math.min(t.length, u.length);
1368
+ for (; o < b && t.charCodeAt(o) === u.charCodeAt(o); ) o++;
1369
+ let m = t.length, _ = u.length;
1370
+ for (; m > o && _ > o && t.charCodeAt(m - 1) === u.charCodeAt(_ - 1); )
1371
+ m--, _--;
1372
+ const d = { kind: "patch", start: o, removed: t.slice(o, m), inserted: u.slice(o, _) };
1373
+ return be(d) < be(r) ? d : r;
1374
+ }
1375
+ function Le(t, u, s = !1) {
1376
+ if (u.kind === "snapshot") return u.value;
1377
+ const r = s ? u.inserted : u.removed, o = s ? u.removed : u.inserted;
1378
+ return t.slice(0, u.start) + o + t.slice(u.start + r.length);
1379
+ }
1380
+ function zn(t, u = { entries: 100, bytes: 16 * 1024 * 1024 }) {
1381
+ if (![u.entries, u.bytes].every((g) => Number.isSafeInteger(g) && g > 0)) throw new RangeError("History budgets must be positive safe integers");
1382
+ const s = nt([{ kind: "snapshot", value: t }]), r = F(0), o = F(t), b = z(() => r.value > 0), m = z(() => r.value + 1 < s.value.length), _ = z(() => o.value), d = z(() => s.value.reduce((g, f) => g + be(f), 0));
1383
+ function w(g) {
1384
+ s.value = [{ kind: "snapshot", value: g }], r.value = 0, o.value = g;
1385
+ }
1386
+ function C(g) {
1387
+ let f = g;
1388
+ for (; f > 0 && s.value[f].kind !== "snapshot"; ) f--;
1389
+ let I = "";
1390
+ for (; f <= g; f++) I = Le(I, s.value[f]);
1391
+ return I;
1392
+ }
1393
+ function E(g) {
1394
+ let f = g.reduce((I, k) => I + be(k), 0);
1395
+ for (; g.length > 1 && (g.length > u.entries || f > u.bytes); ) {
1396
+ const I = g[0], k = g[1], S = { kind: "snapshot", value: Le(I.value, k) };
1397
+ f += be(S) - be(I) - be(k), g.splice(0, 2, S);
1398
+ }
1399
+ return g;
1400
+ }
1401
+ function G(g) {
1402
+ if (o.value === g) return;
1403
+ const f = s.value.slice(0, r.value + 1);
1404
+ f.push(Bn(o.value, g, f.length % 20 === 0)), s.value = E(f), r.value = s.value.length - 1, o.value = g;
1405
+ }
1406
+ function A(g) {
1407
+ if (g < 0 ? !b.value : !m.value) return;
1408
+ const f = s.value[r.value];
1409
+ return g < 0 && f.kind === "patch" ? o.value = Le(o.value, f, !0) : g > 0 ? o.value = Le(o.value, s.value[r.value + 1]) : o.value = C(r.value - 1), r.value += g, o.value;
1410
+ }
1411
+ return { canUndo: b, canRedo: m, current: _, retainedBytes: d, reset: w, record: G, move: A };
1412
+ }
1413
+ function jn(t) {
1414
+ const u = nt(null), s = F(!1);
1415
+ let r, o = 0;
1416
+ function b(d) {
1417
+ r?.(d), r = void 0, u.value = null;
1418
+ }
1419
+ function m() {
1420
+ o++, b(!1), s.value = !1;
1421
+ }
1422
+ async function _(d) {
1423
+ m();
1424
+ const w = o, C = t();
1425
+ s.value = !0;
1426
+ try {
1427
+ const E = await new Promise((G, A) => {
1428
+ if (r = G, !C) {
1429
+ u.value = d;
1430
+ return;
1431
+ }
1432
+ Promise.resolve().then(() => o === w ? C(d) : !1).then((g) => {
1433
+ o === w && b(g === !0);
1434
+ }, (g) => {
1435
+ o === w && (r = void 0, u.value = null, A(g));
1436
+ });
1437
+ });
1438
+ return o === w && E === !0;
1439
+ } finally {
1440
+ o === w && (s.value = !1);
1441
+ }
1442
+ }
1443
+ return $e(m), { confirmation: u, pending: s, decide: b, request: _, cancel: m };
1444
+ }
1445
+ function Fn(t, u) {
1446
+ const s = F(Y(t.modelValue)), r = F(me(s.value)), o = F(me(s.value)), b = F(""), m = F(!1), _ = z(() => ({
1447
+ ...Pe,
1448
+ ...t.messages
1449
+ })), d = z(() => ({
188
1450
  showExport: !1,
189
1451
  showPrint: !1,
190
1452
  showPdfWindow: !1,
191
- ...v.preview,
1453
+ ...t.preview,
192
1454
  theme: {
193
1455
  shellBg: "#f1f5f9",
194
1456
  shellFg: "#334155",
@@ -200,320 +1462,488 @@ function Le(v, M) {
200
1462
  btnHoverBg: "#eff6ff",
201
1463
  btnHoverFg: "#1d4ed8",
202
1464
  btnActiveBg: "#2563eb",
203
- ...v.preview?.theme
1465
+ ...t.preview?.theme
204
1466
  }
205
1467
  }));
206
- Se({ get defaults() {
207
- return S.value;
208
- } });
209
- let p, g = 0;
210
- const k = A(() => Te(c.value)), T = A(() => {
1468
+ ft({
1469
+ get defaults() {
1470
+ return d.value;
1471
+ }
1472
+ });
1473
+ let w, C = 0;
1474
+ const E = z(
1475
+ () => Ye(s.value)
1476
+ ), G = z(() => {
211
1477
  try {
212
- return U(c.value) !== y.value;
1478
+ return me(s.value) !== r.value;
213
1479
  } catch {
214
1480
  return !0;
215
1481
  }
216
- }), h = j(f.value), B = A(() => f.value !== h.value), Q = A(() => T.value || f.value !== h.value), O = () => JSON.stringify({ document: c.value, json: f.value, appliedJson: h.value }), D = De(O()), P = je(() => v.beforeDiscard), d = A(() => w.value || P.pending.value), r = () => !v.readonly && !d.value && !B.value, i = Ae(c, () => k.value.ok, r, q), { selected: m, lists: x, activeList: t, headerAlignments: L, setColumn: V } = i;
217
- W(m, () => i.clearSelection());
218
- const z = A(() => k.value.ok ? xe({ draft: { template: c.value.template, datasets: v.datasets ?? {}, params: [] } }) : void 0);
219
- function E() {
220
- g++, p?.abort(), p = void 0, w.value = !1;
1482
+ }), A = F(o.value), g = z(() => o.value !== A.value), f = z(
1483
+ () => G.value || o.value !== A.value
1484
+ ), I = () => JSON.stringify({
1485
+ document: s.value,
1486
+ json: o.value,
1487
+ appliedJson: A.value
1488
+ }), k = zn(I()), S = jn(() => t.beforeDiscard), c = z(() => m.value || S.pending.value), M = () => !t.readonly && !c.value && !g.value, p = Vn(
1489
+ s,
1490
+ () => E.value.ok,
1491
+ M,
1492
+ H
1493
+ ), { selected: x, lists: D, activeList: T, headerAlignments: N, setColumn: te } = p;
1494
+ Z(x, () => p.clearSelection());
1495
+ const a = z(
1496
+ () => E.value.ok ? bt({
1497
+ draft: {
1498
+ template: s.value.template,
1499
+ datasets: t.datasets ?? {},
1500
+ params: []
1501
+ }
1502
+ }) : void 0
1503
+ );
1504
+ function q() {
1505
+ C++, w?.abort(), w = void 0, m.value = !1;
221
1506
  }
222
- let H = 0;
223
- async function J(u = "replace", o) {
224
- if (!Q.value) return !0;
225
- const l = O();
1507
+ let $ = 0;
1508
+ async function L(V = "replace", j) {
1509
+ if (!f.value) return !0;
1510
+ const J = I();
226
1511
  try {
227
- return await P.request({
228
- reason: u,
229
- document: JSON.parse(JSON.stringify(c.value)),
230
- replacement: o ? I(o) : void 0,
1512
+ return await S.request({
1513
+ reason: V,
1514
+ document: JSON.parse(
1515
+ JSON.stringify(s.value)
1516
+ ),
1517
+ replacement: j ? Y(j) : void 0,
231
1518
  pendingLocalChanges: !0
232
- }) && l === O();
233
- } catch (b) {
234
- return s.value = b instanceof Error ? b.message : String(b), !1;
1519
+ }) && J === I();
1520
+ } catch (ne) {
1521
+ return b.value = ne instanceof Error ? ne.message : String(ne), !1;
235
1522
  }
236
1523
  }
237
- function oe(u) {
238
- E(), c.value = u, y.value = U(u), f.value = y.value, h.value = f.value, s.value = "", m.value = 0, i.clearSelection(), D.reset(O());
1524
+ function R(V) {
1525
+ q(), s.value = V, r.value = me(V), o.value = r.value, A.value = o.value, b.value = "", x.value = 0, p.clearSelection(), k.reset(I());
239
1526
  }
240
- W(() => v.modelValue, async (u) => {
241
- let o;
242
- try {
243
- o = I(u);
244
- } catch (b) {
245
- s.value = b instanceof Error ? b.message : String(b);
246
- return;
1527
+ Z(
1528
+ () => t.modelValue,
1529
+ async (V) => {
1530
+ let j;
1531
+ try {
1532
+ j = Y(V);
1533
+ } catch (ne) {
1534
+ b.value = ne instanceof Error ? ne.message : String(ne);
1535
+ return;
1536
+ }
1537
+ try {
1538
+ if (me(j) === me(s.value))
1539
+ return;
1540
+ } catch {
1541
+ }
1542
+ const J = ++$;
1543
+ if (q(), !await L("replace", j)) {
1544
+ J === $ && E.value.ok && u("update:modelValue", Y(s.value));
1545
+ return;
1546
+ }
1547
+ J === $ && R(j);
247
1548
  }
1549
+ ), $e(() => {
1550
+ $++, q();
1551
+ });
1552
+ function H() {
1553
+ S.cancel(), b.value = "", E.value.ok && (o.value = me(s.value), A.value = o.value, u("update:modelValue", Y(s.value))), k.record(I());
1554
+ }
1555
+ function K(V) {
1556
+ if (!M()) return !1;
248
1557
  try {
249
- if (U(o) === U(c.value)) return;
250
- } catch {
1558
+ const j = Y(s.value);
1559
+ V(j);
1560
+ const J = Ye(j);
1561
+ if (!J.ok)
1562
+ throw new Error(
1563
+ J.errors.map((ne) => `${ne.path}: ${ne.message}`).join(`
1564
+ `)
1565
+ );
1566
+ return s.value = j, H(), !0;
1567
+ } catch (j) {
1568
+ return b.value = j instanceof Error ? j.message : String(j), !1;
251
1569
  }
252
- const l = ++H;
253
- if (E(), !await J("replace", o)) {
254
- l === H && k.value.ok && M("update:modelValue", I(c.value));
255
- return;
1570
+ }
1571
+ async function ue(V) {
1572
+ if (!M()) return !1;
1573
+ try {
1574
+ const j = Y(V);
1575
+ return !await L("replace", j) || !M() ? !1 : (s.value = j, x.value = 0, p.clearSelection(), H(), !0);
1576
+ } catch (j) {
1577
+ return b.value = j instanceof Error ? j.message : String(j), !1;
256
1578
  }
257
- l === H && oe(o);
258
- }), pe(() => {
259
- H++, E();
260
- });
261
- function q() {
262
- P.cancel(), s.value = "", k.value.ok && (f.value = U(c.value), h.value = f.value, M("update:modelValue", I(c.value))), D.record(O());
263
1579
  }
264
- function ae(u) {
265
- r() && (c.value.name = u, q());
1580
+ function Ce(V) {
1581
+ M() && (s.value.name = V, H());
266
1582
  }
267
- function Z(u) {
268
- r() && (c.value.description = u, q());
1583
+ function Ae(V) {
1584
+ M() && (s.value.description = V, H());
269
1585
  }
270
- function X() {
271
- if (!(v.readonly || d.value))
1586
+ function pe() {
1587
+ if (!(t.readonly || c.value))
272
1588
  try {
273
- const u = I(f.value);
274
- if (u.id !== c.value.id) throw new Error("属性编辑不允许更换模板 ID,请另存为新模板");
275
- if (u.revision !== c.value.revision) throw new Error("修订号由保存服务管理,不能在 JSON 中修改");
276
- c.value = u, m.value = 0, i.clearSelection(), q();
277
- } catch (u) {
278
- s.value = u instanceof Error ? u.message : String(u);
1589
+ const V = Y(o.value);
1590
+ if (V.id !== s.value.id)
1591
+ throw new Error("属性编辑不允许更换模板 ID,请另存为新模板");
1592
+ if (V.revision !== s.value.revision)
1593
+ throw new Error("修订号由保存服务管理,不能在 JSON 中修改");
1594
+ s.value = V, x.value = 0, p.clearSelection(), H();
1595
+ } catch (V) {
1596
+ b.value = V instanceof Error ? V.message : String(V);
279
1597
  }
280
1598
  }
281
- async function G() {
282
- d.value || v.readonly || !await J("reset") || (oe(I(y.value)), M("update:modelValue", I(c.value)));
1599
+ async function se() {
1600
+ c.value || t.readonly || !await L("reset") || (R(Y(r.value)), u("update:modelValue", Y(s.value)));
283
1601
  }
284
- function ee(u) {
285
- if (d.value || v.readonly) return;
286
- D.record(O());
287
- const o = D.move(u);
288
- if (!o) return;
289
- P.cancel();
290
- const l = JSON.parse(o);
291
- c.value = l.document, f.value = l.json, h.value = l.appliedJson, s.value = "", m.value = 0, i.clearSelection(), k.value.ok && M("update:modelValue", I(c.value));
1602
+ function ie(V) {
1603
+ if (c.value || t.readonly) return;
1604
+ k.record(I());
1605
+ const j = k.move(V);
1606
+ if (!j) return;
1607
+ S.cancel();
1608
+ const J = JSON.parse(j);
1609
+ s.value = J.document, o.value = J.json, A.value = J.appliedJson, b.value = "", x.value = 0, p.clearSelection(), E.value.ok && u("update:modelValue", Y(s.value));
292
1610
  }
293
- async function se() {
294
- if (!v.save || !r() || !k.value.ok) return;
295
- const u = ++g;
296
- p = new AbortController(), w.value = !0, s.value = "";
297
- const o = I(c.value);
1611
+ async function he() {
1612
+ if (!t.save || !M() || !E.value.ok) return;
1613
+ const V = ++C;
1614
+ w = new AbortController(), m.value = !0, b.value = "";
1615
+ const j = Y(s.value);
298
1616
  try {
299
- const l = I(await v.save(o, { expectedRevision: o.revision, signal: p.signal }));
300
- if (u !== g) return;
301
- if (l.id !== o.id) throw new Error("保存服务返回了其他模板的文档");
302
- c.value = l, y.value = U(l), f.value = y.value, h.value = f.value, D.reset(O()), M("saved", I(l)), M("update:modelValue", I(l));
303
- } catch (l) {
304
- u === g && (s.value = l instanceof Error ? l.message : String(l));
1617
+ const J = Y(
1618
+ await t.save(j, {
1619
+ expectedRevision: j.revision,
1620
+ signal: w.signal
1621
+ })
1622
+ );
1623
+ if (V !== C) return;
1624
+ if (J.id !== j.id)
1625
+ throw new Error("保存服务返回了其他模板的文档");
1626
+ s.value = J, r.value = me(J), o.value = r.value, A.value = o.value, k.reset(I()), u("saved", Y(J)), u("update:modelValue", Y(J));
1627
+ } catch (J) {
1628
+ V === C && (b.value = J instanceof Error ? J.message : String(J));
305
1629
  } finally {
306
- u === g && (w.value = !1, p = void 0);
1630
+ V === C && (m.value = !1, w = void 0);
307
1631
  }
308
1632
  }
309
- const re = A(() => D.canUndo.value || O() !== D.current.value), de = A(() => D.canRedo.value && O() === D.current.value);
310
- return { ...i, canUndo: re, canRedo: de, undo: () => ee(-1), redo: () => ee(1), pendingLocalChanges: Q, jsonPending: B, blocked: d, confirmation: P.confirmation, decideDiscard: P.decide, guardChanges: J, draft: c, json: f, selected: m, error: s, saving: w, dirty: T, validation: k, lists: x, activeList: t, headerAlignments: L, previewOptions: S, fetcher: z, messages: $, setName: ae, setDescription: Z, setColumn: V, applyJson: X, reset: G, save: se };
1633
+ const we = z(
1634
+ () => k.canUndo.value || I() !== k.current.value
1635
+ ), le = z(
1636
+ () => k.canRedo.value && I() === k.current.value
1637
+ );
1638
+ return {
1639
+ ...p,
1640
+ editingReadonly: z(() => t.readonly === !0),
1641
+ transaction: K,
1642
+ replaceDocument: ue,
1643
+ originalDocument: z(() => Y(r.value)),
1644
+ canUndo: we,
1645
+ canRedo: le,
1646
+ undo: () => ie(-1),
1647
+ redo: () => ie(1),
1648
+ pendingLocalChanges: f,
1649
+ jsonPending: g,
1650
+ blocked: c,
1651
+ confirmation: S.confirmation,
1652
+ decideDiscard: S.decide,
1653
+ guardChanges: L,
1654
+ draft: s,
1655
+ json: o,
1656
+ selected: x,
1657
+ error: b,
1658
+ saving: m,
1659
+ dirty: G,
1660
+ validation: E,
1661
+ lists: D,
1662
+ activeList: T,
1663
+ headerAlignments: N,
1664
+ previewOptions: d,
1665
+ fetcher: a,
1666
+ messages: _,
1667
+ setName: Ce,
1668
+ setDescription: Ae,
1669
+ setColumn: te,
1670
+ applyJson: pe,
1671
+ reset: se,
1672
+ save: he
1673
+ };
311
1674
  }
312
- function Ve(v, M, c, y) {
313
- const f = j("fields"), s = j(v.value[0]?.index ?? -1), w = A(() => {
314
- const p = c.value?.columns[s.value];
315
- return p ? { column: p, index: s.value } : void 0;
1675
+ function Nn(t, u) {
1676
+ const s = F("fields"), r = () => u.value?.columns.length ? 0 : -1, o = F(r()), b = z(() => {
1677
+ const d = u.value?.columns[o.value];
1678
+ return d ? { column: d, index: o.value } : void 0;
316
1679
  });
317
- W(y, () => {
318
- v.value.some((p) => p.index === s.value) || (s.value = v.value[0]?.index ?? -1);
319
- }), W(M, () => {
320
- s.value = v.value[0]?.index ?? -1;
321
- }), W(c, (p) => {
322
- p?.columns[s.value] || (s.value = v.value[0]?.index ?? -1);
1680
+ Z(t, () => {
1681
+ o.value = r();
1682
+ }), Z(u, (d) => {
1683
+ d?.columns[o.value] || (o.value = r());
323
1684
  });
324
- function $(p) {
325
- v.value.some((g) => g.index === p) && (s.value = p);
1685
+ function m(d) {
1686
+ u.value?.columns[d] && (o.value = d);
326
1687
  }
327
- function S(p) {
328
- const g = v.value;
329
- if (!g.length) return;
330
- const k = Math.max(
1688
+ function _(d) {
1689
+ const w = u.value?.columns.length ?? 0;
1690
+ w && (o.value = Math.max(
331
1691
  0,
332
- g.findIndex((B) => B.index === s.value)
333
- ), h = {
334
- ArrowDown: Math.min(k + 1, g.length - 1),
335
- ArrowUp: Math.max(k - 1, 0),
336
- Home: 0,
337
- End: g.length - 1
338
- }[p];
339
- if (h !== void 0)
340
- return s.value = g[h].index, s.value;
341
- }
342
- return { section: f, activeIndex: s, activeColumn: w, activate: $, moveColumn: S };
1692
+ Math.min(w - 1, o.value + d)
1693
+ ));
1694
+ }
1695
+ return { section: s, activeIndex: o, activeColumn: b, activate: m, stepColumn: _ };
343
1696
  }
344
- const Oe = ["aria-label", "aria-busy"], Ie = { class: "mr-designer-bar" }, Je = { class: "mr-designer-heading" }, Ne = { class: "mr-designer-actions" }, Pe = { class: "mr-designer-history" }, He = ["aria-label", "title", "disabled"], Ge = ["aria-label", "title", "disabled"], Fe = ["disabled"], Ue = ["disabled"], ze = ["aria-label"], qe = { class: "mr-designer-body" }, Ke = { class: "mr-designer-inspector" }, We = ["aria-label"], Qe = ["id", "aria-selected", "aria-controls", "tabindex", "onClick"], Xe = ["id", "aria-labelledby"], Ye = {
1697
+ const On = ["aria-label", "aria-busy"], Un = { class: "mr-designer-bar" }, Jn = { class: "mr-designer-heading" }, Kn = ["aria-label"], Wn = ["id", "aria-selected", "aria-controls", "tabindex", "onClick"], Xn = ["aria-label"], qn = ["aria-pressed"], Yn = ["aria-pressed"], Qn = { class: "mr-designer-actions" }, Zn = { class: "mr-designer-history" }, eo = ["aria-label", "title", "disabled"], to = ["aria-label", "title", "disabled"], no = ["disabled"], oo = ["disabled"], ao = ["aria-label"], lo = {
345
1698
  key: 0,
346
- class: "mr-designer-area"
347
- }, Ze = ["value"], et = {
1699
+ class: "mr-designer-tools"
1700
+ }, so = ["aria-label"], io = ["aria-pressed", "onClick"], ro = { class: "mr-designer-tool-content" }, uo = {
1701
+ key: 2,
1702
+ class: "mr-designer-rule-workspace"
1703
+ }, co = { key: 0 }, mo = ["value"], vo = {
1704
+ key: 2,
1705
+ class: "mr-designer-note"
1706
+ }, po = {
348
1707
  key: 1,
349
- class: "mr-designer-columns"
350
- }, tt = { class: "mr-designer-directory-heading" }, nt = { class: "mr-designer-search" }, lt = ["aria-label", "placeholder"], ot = ["aria-label", "title"], at = { class: "mr-designer-column-tools" }, st = ["disabled"], it = {
1708
+ class: "mr-designer-inspector"
1709
+ }, ho = ["id", "aria-labelledby"], go = {
1710
+ key: 0,
1711
+ class: "mr-designer-area"
1712
+ }, fo = ["value"], bo = { class: "mr-designer-current" }, yo = ["aria-expanded", "aria-controls"], wo = { class: "mr-designer-current-name" }, ko = { class: "mr-designer-directory-entry" }, Mo = { class: "mr-designer-field-position" }, Co = ["aria-label"], xo = ["aria-label", "title", "disabled"], _o = ["aria-label", "title", "disabled"], So = ["disabled", "aria-label"], $o = { class: "mr-designer-property-group" }, Eo = ["value"], Io = ["value", "list"], Ao = ["id"], Do = ["value"], To = { class: "mr-designer-property-group" }, Lo = { class: "mr-designer-format-pair" }, Ro = { class: "mr-designer-stacked" }, Go = ["value"], Po = { class: "mr-designer-stacked" }, Ho = ["value"], Vo = { value: "identifier" }, Bo = { value: "dimension" }, zo = { value: "measure" }, jo = { value: "date" }, Fo = { value: "text" }, No = { class: "mr-designer-control-row" }, Oo = { class: "mr-designer-control-row" }, Uo = { class: "mr-designer-toggle" }, Jo = ["checked"], Ko = { class: "mr-designer-column-structure" }, Wo = ["aria-label", "title", "disabled"], Xo = ["aria-label", "title", "disabled"], qo = ["checked", "disabled"], Yo = ["id", "aria-label"], Qo = { class: "mr-designer-directory-heading" }, Zo = ["aria-label"], ea = { class: "mr-designer-search" }, ta = ["aria-label", "placeholder"], na = ["aria-label", "title"], oa = { class: "mr-designer-column-tools" }, aa = ["disabled"], la = {
351
1713
  key: 1,
352
1714
  role: "status"
353
- }, rt = { key: 2 }, dt = ["aria-label"], ut = ["aria-label", "checked", "disabled", "onChange"], ct = ["data-column-index", "aria-pressed", "tabindex", "onClick"], vt = { class: "mr-designer-column-number" }, mt = { class: "mr-designer-column-name" }, ft = {
1715
+ }, sa = { key: 2 }, ia = ["aria-label"], ra = ["aria-label", "checked", "disabled", "onChange"], da = ["data-column-index", "aria-pressed", "tabindex", "onClick"], ua = { class: "mr-designer-column-number" }, ca = { class: "mr-designer-column-name" }, ma = {
354
1716
  key: 0,
355
1717
  role: "status",
356
1718
  class: "mr-designer-empty"
357
- }, gt = {
1719
+ }, va = {
358
1720
  key: 0,
359
1721
  class: "mr-designer-batch"
360
- }, ht = ["aria-label", "disabled"], pt = { value: "" }, bt = { value: "auto" }, yt = { value: "left" }, _t = { value: "center" }, kt = { value: "right" }, Ct = { value: "justify" }, wt = ["aria-label", "disabled"], St = { value: "" }, xt = { value: "left" }, Et = { value: "center" }, Mt = { value: "right" }, Tt = { value: "justify" }, At = ["disabled"], Dt = ["value"], jt = ["value"], Rt = ["value"], $t = ["value"], Bt = { value: "identifier" }, Lt = { value: "dimension" }, Vt = { value: "measure" }, Ot = { value: "date" }, It = { value: "text" }, Jt = ["value"], Nt = { value: "auto" }, Pt = { value: "left" }, Ht = { value: "center" }, Gt = { value: "right" }, Ft = { value: "justify" }, Ut = ["value"], zt = { value: "left" }, qt = { value: "center" }, Kt = { value: "right" }, Wt = { value: "justify" }, Qt = { class: "mr-designer-toggle" }, Xt = ["checked"], Yt = {
1722
+ }, pa = ["aria-label", "disabled"], ha = { value: "" }, ga = { value: "auto" }, fa = { value: "left" }, ba = { value: "center" }, ya = { value: "right" }, wa = { value: "justify" }, ka = ["aria-label", "disabled"], Ma = { value: "" }, Ca = { value: "left" }, xa = { value: "center" }, _a = { value: "right" }, Sa = { value: "justify" }, $a = {
361
1723
  key: 2,
362
1724
  role: "status",
363
1725
  class: "mr-designer-empty"
364
- }, Zt = { class: "mr-designer-stacked" }, en = ["value", "disabled"], tn = { class: "mr-designer-stacked" }, nn = ["value", "disabled"], ln = { class: "mr-designer-identity" }, on = { class: "mr-designer-note" }, an = { class: "mr-designer-note" }, sn = { class: "mr-designer-stacked" }, rn = ["aria-label", "disabled"], dn = ["disabled"], un = {
365
- key: 3,
1726
+ }, Ea = { class: "mr-designer-object-tools" }, Ia = ["aria-label", "disabled"], Aa = { value: "" }, Da = { value: "text" }, Ta = { value: "list" }, La = { value: "image" }, Ra = { value: "rect" }, Ga = ["title", "aria-label", "disabled"], Pa = ["title", "aria-label", "disabled"], Ha = { key: 0 }, Va = ["value"], Ba = { class: "mr-designer-stacked" }, za = ["value"], ja = {
1727
+ value: -1,
1728
+ disabled: ""
1729
+ }, Fa = ["value"], Na = { class: "mr-designer-layer-tools" }, Oa = ["disabled"], Ua = ["disabled"], Ja = {
1730
+ key: 2,
1731
+ class: "mr-designer-empty"
1732
+ }, Ka = { class: "mr-designer-stacked" }, Wa = ["value", "disabled"], Xa = { class: "mr-designer-stacked" }, qa = ["value", "disabled"], Ya = { class: "mr-designer-technical" }, Qa = { class: "mr-designer-identity" }, Za = { class: "mr-designer-stacked mr-designer-json-label" }, el = ["aria-label", "disabled"], tl = ["disabled"], nl = {
1733
+ key: 4,
366
1734
  role: "status",
367
1735
  class: "mr-designer-note mr-designer-pending"
368
- }, cn = ["aria-label"], vn = {
1736
+ }, ol = ["aria-label"], al = {
369
1737
  key: 0,
370
1738
  role: "alert",
371
1739
  class: "mr-designer-error"
372
- }, mn = {
1740
+ }, ll = {
373
1741
  key: 1,
374
1742
  role: "alert",
375
1743
  class: "mr-designer-error"
376
- }, fn = {
377
- key: 3,
1744
+ }, sl = {
1745
+ key: 4,
378
1746
  class: "mr-designer-note mr-designer-invalid"
379
- }, gn = /* @__PURE__ */ ye({
1747
+ }, il = /* @__PURE__ */ Ee({
380
1748
  __name: "ReportTemplateEditor",
381
1749
  props: {
382
1750
  modelValue: {},
383
1751
  datasets: {},
1752
+ dataSchemas: {},
1753
+ bindingDatasets: {},
1754
+ bindingSession: {},
384
1755
  readonly: { type: Boolean },
385
1756
  messages: {},
386
1757
  preview: {},
387
1758
  beforeDiscard: { type: Function },
388
1759
  save: { type: Function }
389
1760
  },
390
- emits: ["update:modelValue", "saved"],
391
- setup(v, { expose: M, emit: c }) {
392
- const y = v, f = c, s = Le(y, (u, o) => {
393
- f(u === "saved" ? "saved" : "update:modelValue", o);
1761
+ emits: ["update:modelValue", "saved", "excel-bound"],
1762
+ setup(t, { expose: u, emit: s }) {
1763
+ const r = Me(
1764
+ () => import("./ExcelBindingWizard-RLJIXKKG.js")
1765
+ ), o = Me(() => import("./RuleEditor-ynnUEK0s.js")), b = Me(
1766
+ () => import("./TemplateReviewPanel-Cn32OY4_.js")
1767
+ ), m = t, _ = s, d = Fn(m, (X, v) => {
1768
+ _(X === "saved" ? "saved" : "update:modelValue", v);
394
1769
  }), {
395
1770
  draft: w,
396
- json: $,
397
- selected: S,
398
- error: p,
399
- saving: g,
400
- pendingLocalChanges: k,
401
- jsonPending: T,
402
- blocked: h,
403
- confirmation: B,
404
- canUndo: Q,
405
- canRedo: O,
406
- validation: D,
407
- lists: P,
408
- activeList: d,
409
- visibleColumns: r,
410
- query: i,
411
- selectedColumns: m,
412
- fetcher: x,
413
- messages: t
414
- } = s, L = Ve(
415
- r,
416
- S,
1771
+ json: C,
1772
+ selected: E,
1773
+ error: G,
1774
+ saving: A,
1775
+ pendingLocalChanges: g,
1776
+ jsonPending: f,
1777
+ blocked: I,
1778
+ confirmation: k,
1779
+ canUndo: S,
1780
+ canRedo: c,
1781
+ validation: M,
1782
+ lists: p,
1783
+ activeList: x,
1784
+ visibleColumns: D,
1785
+ query: T,
1786
+ selectedColumns: N,
1787
+ fetcher: te,
1788
+ messages: a
1789
+ } = d, q = Nn(E, x), { section: $, activeIndex: L, activeColumn: R } = q, H = `mr-designer-${gt()?.uid ?? 0}`, K = [
1790
+ "fields",
1791
+ "component",
1792
+ "template",
1793
+ "tools",
1794
+ "advanced"
1795
+ ], ue = Gn(
417
1796
  d,
418
- i
419
- ), { section: V, activeIndex: z, activeColumn: E } = L, H = `mr-designer-${_e()?.uid ?? 0}`, J = ["fields", "template", "advanced"], oe = A(
420
- () => g.value ? t.value.saving : y.readonly ? t.value.readonly : k.value ? t.value.dirty : t.value.ready
421
- ), q = j(null), ae = j(null), Z = j(null);
422
- W(V, async (u) => {
423
- if (await ne(), Z.value && (Z.value.scrollTop = 0), u !== "fields") return;
424
- const o = ae.value, l = o?.querySelector(
425
- `button[data-column-index="${z.value}"]`
426
- );
427
- if (!o || !l) return;
428
- const b = o.getBoundingClientRect(), F = l.getBoundingClientRect(), te = b.top + o.clientTop, me = te + o.clientHeight;
429
- F.top < te ? o.scrollTop += F.top - te : F.bottom > me && (o.scrollTop += F.bottom - me);
1797
+ q,
1798
+ () => m.dataSchemas
1799
+ ), {
1800
+ mode: Ce,
1801
+ setMode: Ae,
1802
+ canvasSelection: pe,
1803
+ canvasPage: se,
1804
+ canvasActive: ie,
1805
+ tool: he,
1806
+ visitedTools: we,
1807
+ editDisabled: le,
1808
+ dataSchema: V,
1809
+ chooseCanvas: j,
1810
+ insertComponent: J,
1811
+ patchCanvas: ne,
1812
+ changeList: ot,
1813
+ moveColumn: Ue,
1814
+ headerCommand: at,
1815
+ locateReview: lt,
1816
+ canvas: ce
1817
+ } = ue, st = z(
1818
+ () => A.value ? a.value.saving : m.readonly ? a.value.readonly : g.value ? a.value.dirty : a.value.ready
1819
+ ), Je = F(null), He = F(null), ee = Hn(q, $, D), {
1820
+ open: Ke,
1821
+ cursor: it,
1822
+ trigger: rt,
1823
+ panel: dt,
1824
+ search: ut,
1825
+ list: ct
1826
+ } = ee;
1827
+ Z($, async () => {
1828
+ await de(), He.value && (He.value.scrollTop = 0);
430
1829
  });
431
- let X = null;
432
- W(B, async (u) => {
433
- u ? (X = document.activeElement, await ne(), q.value?.focus()) : (await ne(), X?.isConnected && X.focus(), X = null);
434
- }), M({
1830
+ const We = z(() => ({
1831
+ auto: a.value.auto,
1832
+ left: a.value.left,
1833
+ center: a.value.center,
1834
+ right: a.value.right,
1835
+ justify: a.value.justify
1836
+ }));
1837
+ let De = null;
1838
+ Z(k, async (X) => {
1839
+ X ? (De = document.activeElement, await de(), Je.value?.focus()) : (await de(), De?.isConnected && De.focus(), De = null);
1840
+ }), u({
435
1841
  get pendingLocalChanges() {
436
- return k.value;
1842
+ return g.value;
437
1843
  },
438
1844
  get saving() {
439
- return g.value;
1845
+ return A.value;
440
1846
  },
441
1847
  get blocked() {
442
- return h.value;
1848
+ return I.value;
443
1849
  },
444
- guardChanges: s.guardChanges,
445
- reset: s.reset,
446
- save: s.save
1850
+ guardChanges: d.guardChanges,
1851
+ reset: d.reset,
1852
+ save: d.save
447
1853
  });
448
- function G(u) {
449
- return u.target.value;
450
- }
451
- function ee(u) {
452
- return u.target.checked;
453
- }
454
- function se(u, o) {
455
- const l = u.target;
456
- s.alignColumns(
457
- o,
458
- l.value
459
- ), l.value = "";
460
- }
461
- async function re(u) {
462
- const o = L.moveColumn(u.key);
463
- if (o === void 0) return;
464
- u.preventDefault();
465
- const l = u.currentTarget.closest(
466
- ".mr-designer-column-list"
467
- );
468
- await ne();
469
- const b = l?.querySelector(
470
- `button[data-column-index="${o}"]`
471
- );
472
- b?.focus({ preventScroll: !0 }), b?.scrollIntoView({ block: "nearest" });
1854
+ async function mt(X) {
1855
+ const v = { ...X.document, id: w.value.id };
1856
+ if (w.value.revision === void 0 ? delete v.revision : v.revision = w.value.revision, !await d.replaceDocument(v)) return;
1857
+ const i = Y(d.draft.value);
1858
+ _("excel-bound", { ...X, document: i, session: { ...X.session, identity: { id: i.id, name: i.name } } });
1859
+ }
1860
+ function ge(X) {
1861
+ return X.target.value;
1862
+ }
1863
+ function Ve(X) {
1864
+ return X.target.checked;
473
1865
  }
474
- async function de(u) {
475
- const l = {
1866
+ function Xe(X, v) {
1867
+ const i = X.target;
1868
+ d.alignColumns(
1869
+ v,
1870
+ i.value
1871
+ ), i.value = "";
1872
+ }
1873
+ async function vt(X) {
1874
+ const i = {
476
1875
  ArrowRight: 1,
477
1876
  ArrowLeft: -1,
478
- Home: -J.length,
479
- End: J.length
480
- }[u.key];
481
- if (l === void 0) return;
482
- u.preventDefault();
483
- const b = J.indexOf(V.value), F = u.key === "Home" ? 0 : u.key === "End" ? J.length - 1 : (b + l + J.length) % J.length;
484
- V.value = J[F];
485
- const te = u.currentTarget.parentElement;
486
- await ne(), te?.querySelector(`#${H}-tab-${V.value}`)?.focus();
487
- }
488
- return (u, o) => (_(), C("section", {
1877
+ Home: -K.length,
1878
+ End: K.length
1879
+ }[X.key];
1880
+ if (i === void 0) return;
1881
+ X.preventDefault();
1882
+ const O = K.indexOf($.value), ke = X.key === "Home" ? 0 : X.key === "End" ? K.length - 1 : (O + i + K.length) % K.length;
1883
+ $.value = K[ke];
1884
+ const pt = X.currentTarget.parentElement;
1885
+ await de(), pt?.querySelector(`#${H}-tab-${$.value}`)?.focus();
1886
+ }
1887
+ return (X, v) => (h(), y("section", {
489
1888
  class: "mr-designer",
490
- "aria-label": e(t).title,
491
- "aria-busy": e(g)
1889
+ "aria-label": e(a).title,
1890
+ "aria-busy": e(A)
492
1891
  }, [
493
- n("header", Ie, [
494
- n("div", Je, [
495
- le(Y, {
1892
+ n("header", Un, [
1893
+ n("div", Jn, [
1894
+ Q(oe, {
496
1895
  name: "columns",
497
- size: 18
1896
+ size: 15
498
1897
  }),
499
- n("div", null, [
500
- n("strong", null, a(e(t).heading), 1),
501
- n("span", {
502
- class: fe({ "mr-designer-dirty": e(k) })
503
- }, a(oe.value), 3)
504
- ])
1898
+ n("strong", null, l(e(a).heading), 1),
1899
+ n("span", {
1900
+ class: _e({ "mr-designer-dirty": e(g) })
1901
+ }, l(st.value), 3)
505
1902
  ]),
506
- n("div", Ne, [
507
- n("div", Pe, [
1903
+ n("nav", {
1904
+ class: "mr-designer-tabs",
1905
+ role: "tablist",
1906
+ "aria-label": e(a).sectionsLabel
1907
+ }, [
1908
+ (h(), y(U, null, W(K, (i) => n("button", {
1909
+ id: `${H}-tab-${i}`,
1910
+ key: i,
1911
+ type: "button",
1912
+ role: "tab",
1913
+ "aria-selected": e($) === i,
1914
+ "aria-controls": `${H}-panel-${i}`,
1915
+ tabindex: e($) === i ? 0 : -1,
1916
+ onClick: (O) => $.value = i,
1917
+ onKeydown: vt
1918
+ }, l(e(a)[`${i}Section`]), 41, Wn)), 64))
1919
+ ], 8, Kn),
1920
+ n("div", {
1921
+ class: "mr-designer-mode",
1922
+ role: "group",
1923
+ "aria-label": e(a).design
1924
+ }, [
1925
+ n("button", {
1926
+ type: "button",
1927
+ "aria-pressed": e(Ce) === "design",
1928
+ onClick: v[0] || (v[0] = (i) => e(Ae)("design"))
1929
+ }, l(e(a).design), 9, qn),
1930
+ n("button", {
1931
+ type: "button",
1932
+ "aria-pressed": e(Ce) === "preview",
1933
+ onClick: v[1] || (v[1] = (i) => e(Ae)("preview"))
1934
+ }, l(e(a).preview), 9, Yn)
1935
+ ], 8, Xn),
1936
+ n("div", Qn, [
1937
+ n("div", Zn, [
508
1938
  n("button", {
509
1939
  type: "button",
510
1940
  class: "mr-designer-icon-button",
511
- "aria-label": e(t).undo,
512
- title: e(t).undo,
513
- disabled: v.readonly || e(h) || !e(Q),
514
- onClick: o[0] || (o[0] = //@ts-ignore
515
- (...l) => e(s).undo && e(s).undo(...l))
516
- }, [...o[25] || (o[25] = [
1941
+ "aria-label": e(a).undo,
1942
+ title: e(a).undo,
1943
+ disabled: t.readonly || e(I) || !e(S),
1944
+ onClick: v[2] || (v[2] = //@ts-ignore
1945
+ (...i) => e(d).undo && e(d).undo(...i))
1946
+ }, [...v[48] || (v[48] = [
517
1947
  n("svg", {
518
1948
  viewBox: "0 0 24 24",
519
1949
  fill: "none",
@@ -521,16 +1951,16 @@ const Oe = ["aria-label", "aria-busy"], Ie = { class: "mr-designer-bar" }, Je =
521
1951
  }, [
522
1952
  n("path", { d: "M4 10h10a6 6 0 0 1 0 12M4 10l5-5M4 10l5 5" })
523
1953
  ], -1)
524
- ])], 8, He),
1954
+ ])], 8, eo),
525
1955
  n("button", {
526
1956
  type: "button",
527
1957
  class: "mr-designer-icon-button",
528
- "aria-label": e(t).redo,
529
- title: e(t).redo,
530
- disabled: v.readonly || e(h) || !e(O),
531
- onClick: o[1] || (o[1] = //@ts-ignore
532
- (...l) => e(s).redo && e(s).redo(...l))
533
- }, [...o[26] || (o[26] = [
1958
+ "aria-label": e(a).redo,
1959
+ title: e(a).redo,
1960
+ disabled: t.readonly || e(I) || !e(c),
1961
+ onClick: v[3] || (v[3] = //@ts-ignore
1962
+ (...i) => e(d).redo && e(d).redo(...i))
1963
+ }, [...v[49] || (v[49] = [
534
1964
  n("svg", {
535
1965
  viewBox: "0 0 24 24",
536
1966
  fill: "none",
@@ -538,405 +1968,938 @@ const Oe = ["aria-label", "aria-busy"], Ie = { class: "mr-designer-bar" }, Je =
538
1968
  }, [
539
1969
  n("path", { d: "M20 10H10a6 6 0 0 0 0 12m10-12-5-5m5 5-5 5" })
540
1970
  ], -1)
541
- ])], 8, Ge)
1971
+ ])], 8, to)
542
1972
  ]),
543
1973
  n("button", {
544
1974
  type: "button",
545
1975
  class: "mr-designer-reset",
546
- disabled: v.readonly || e(h) || !e(k),
547
- onClick: o[2] || (o[2] = //@ts-ignore
548
- (...l) => e(s).reset && e(s).reset(...l))
549
- }, a(e(t).reset), 9, Fe),
550
- v.save ? (_(), C("button", {
1976
+ disabled: t.readonly || e(I) || !e(g),
1977
+ onClick: v[4] || (v[4] = //@ts-ignore
1978
+ (...i) => e(d).reset && e(d).reset(...i))
1979
+ }, l(e(a).reset), 9, no),
1980
+ t.save ? (h(), y("button", {
551
1981
  key: 0,
552
1982
  type: "button",
553
1983
  class: "mr-designer-save",
554
- disabled: v.readonly || e(h) || e(T) || !e(D).ok || !e(k),
555
- onClick: o[3] || (o[3] = //@ts-ignore
556
- (...l) => e(s).save && e(s).save(...l))
1984
+ disabled: t.readonly || e(I) || e(f) || !e(M).ok || !e(g),
1985
+ onClick: v[5] || (v[5] = //@ts-ignore
1986
+ (...i) => e(d).save && e(d).save(...i))
557
1987
  }, [
558
- le(Y, {
1988
+ Q(oe, {
559
1989
  name: "file",
560
- size: 14
1990
+ size: 13
561
1991
  }),
562
- R(a(e(g) ? e(t).saving : e(t).save), 1)
563
- ], 8, Ue)) : N("", !0)
1992
+ P(l(e(A) ? e(a).saving : e(a).save), 1)
1993
+ ], 8, oo)) : B("", !0)
564
1994
  ])
565
1995
  ]),
566
- e(B) ? (_(), C("div", {
1996
+ e(k) ? (h(), y("div", {
567
1997
  key: 0,
568
1998
  role: "alertdialog",
569
- "aria-label": e(t).discardTitle,
1999
+ "aria-label": e(a).discardTitle,
570
2000
  class: "mr-designer-confirm",
571
- onKeydown: o[6] || (o[6] = ke(Ce((l) => e(s).decideDiscard(!1), ["prevent"]), ["esc"]))
2001
+ onKeydown: v[8] || (v[8] = Be(tt((i) => e(d).decideDiscard(!1), ["prevent", "stop"]), ["esc"]))
572
2002
  }, [
573
2003
  n("div", null, [
574
- n("strong", null, a(e(t).discardTitle), 1),
575
- n("p", null, a(e(t).discardDescription), 1)
2004
+ n("strong", null, l(e(a).discardTitle), 1),
2005
+ n("p", null, l(e(a).discardDescription), 1)
576
2006
  ]),
577
2007
  n("div", null, [
578
2008
  n("button", {
579
2009
  ref_key: "keepButton",
580
- ref: q,
2010
+ ref: Je,
581
2011
  type: "button",
582
- onClick: o[4] || (o[4] = (l) => e(s).decideDiscard(!1))
583
- }, a(e(t).keepEditing), 513),
2012
+ onClick: v[6] || (v[6] = (i) => e(d).decideDiscard(!1))
2013
+ }, l(e(a).keepEditing), 513),
584
2014
  n("button", {
585
2015
  type: "button",
586
- onClick: o[5] || (o[5] = (l) => e(s).decideDiscard(!0))
587
- }, a(e(t).discard), 1)
2016
+ onClick: v[7] || (v[7] = (i) => e(d).decideDiscard(!0))
2017
+ }, l(e(a).discard), 1)
588
2018
  ])
589
- ], 40, ze)) : N("", !0),
590
- n("div", qe, [
591
- n("aside", Ke, [
2019
+ ], 40, ao)) : B("", !0),
2020
+ n("div", {
2021
+ class: _e(["mr-designer-body", { "is-tools": e($) === "tools" }])
2022
+ }, [
2023
+ e(we).size ? ae((h(), y("div", lo, [
592
2024
  n("nav", {
593
- class: "mr-designer-tabs",
594
- role: "tablist",
595
- "aria-label": e(t).sectionsLabel
2025
+ class: "mr-designer-tool-tabs",
2026
+ "aria-label": e(a).toolsSection
596
2027
  }, [
597
- (_(), C(K, null, ie(J, (l) => n("button", {
598
- id: `${H}-tab-${l}`,
599
- key: l,
2028
+ (h(), y(U, null, W(["excel", "rules", "review"], (i) => n("button", {
2029
+ key: i,
600
2030
  type: "button",
601
- role: "tab",
602
- "aria-selected": e(V) === l,
603
- "aria-controls": `${H}-panel-${l}`,
604
- tabindex: e(V) === l ? 0 : -1,
605
- onClick: (b) => V.value = l,
606
- onKeydown: de
607
- }, a(e(t)[`${l}Section`]), 41, Qe)), 64))
608
- ], 8, We),
2031
+ "aria-pressed": e(he) === i,
2032
+ onClick: (O) => he.value = i
2033
+ }, l(e(a)[`${i}Tool`]), 9, io)), 64)),
2034
+ n("span", null, l(e(a).toolsDescription), 1)
2035
+ ], 8, so),
2036
+ n("div", ro, [
2037
+ e(we).has("excel") ? ae((h(), fe(e(r), {
2038
+ key: 0,
2039
+ datasets: t.bindingDatasets ?? [],
2040
+ session: t.bindingSession,
2041
+ identity: { id: e(w).id, name: e(w).name },
2042
+ "lock-id": "",
2043
+ readonly: e(le),
2044
+ onApply: mt
2045
+ }, null, 8, ["datasets", "session", "identity", "readonly"])), [
2046
+ [Te, e(he) === "excel"]
2047
+ ]) : B("", !0),
2048
+ e(we).has("review") ? ae((h(), fe(e(b), {
2049
+ key: 1,
2050
+ document: e(w),
2051
+ previous: e(d).originalDocument.value,
2052
+ datasets: t.datasets,
2053
+ "data-schemas": t.dataSchemas,
2054
+ onLocate: e(lt)
2055
+ }, null, 8, ["document", "previous", "datasets", "data-schemas", "onLocate"])), [
2056
+ [Te, e(he) === "review"]
2057
+ ]) : B("", !0),
2058
+ e(we).has("rules") ? ae((h(), y("div", uo, [
2059
+ e(p).length > 1 ? (h(), y("label", co, [
2060
+ P(l(e(a).area), 1),
2061
+ ae(n("select", {
2062
+ "onUpdate:modelValue": v[9] || (v[9] = (i) => xe(E) ? E.value = i : null)
2063
+ }, [
2064
+ (h(!0), y(U, null, W(e(p), (i, O) => (h(), y("option", {
2065
+ key: O,
2066
+ value: O
2067
+ }, l(i.component.title || i.component.dataset), 9, mo))), 128))
2068
+ ], 512), [
2069
+ [ye, e(E)]
2070
+ ])
2071
+ ])) : B("", !0),
2072
+ e(x) ? (h(), fe(e(o), {
2073
+ key: 1,
2074
+ list: e(x),
2075
+ datasets: t.datasets,
2076
+ "dataset-schema": e(V),
2077
+ "dataset-schemas": t.dataSchemas,
2078
+ readonly: e(le),
2079
+ onChange: e(ot)
2080
+ }, null, 8, ["list", "datasets", "dataset-schema", "dataset-schemas", "readonly", "onChange"])) : (h(), y("p", vo, l(e(a).rulesNeedList), 1))
2081
+ ], 512)), [
2082
+ [Te, e(he) === "rules"]
2083
+ ]) : B("", !0)
2084
+ ])
2085
+ ], 512)), [
2086
+ [Te, e($) === "tools"]
2087
+ ]) : B("", !0),
2088
+ e($) !== "tools" ? (h(), y("aside", po, [
609
2089
  n("div", {
610
2090
  ref_key: "inspectorPanel",
611
- ref: Z,
612
- id: `${H}-panel-${e(V)}`,
613
- class: "mr-designer-panel",
2091
+ ref: He,
2092
+ id: `${H}-panel-${e($)}`,
2093
+ class: _e(["mr-designer-panel", { "is-advanced": e($) === "advanced" }]),
614
2094
  role: "tabpanel",
615
- "aria-labelledby": `${H}-tab-${e(V)}`
2095
+ "aria-labelledby": `${H}-tab-${e($)}`
616
2096
  }, [
617
- e(V) === "fields" ? (_(), C(K, { key: 0 }, [
618
- e(P).length > 1 ? (_(), C("label", Ye, [
619
- R(a(e(t).area), 1),
620
- ue(n("select", {
621
- "onUpdate:modelValue": o[7] || (o[7] = (l) => ce(S) ? S.value = l : null)
2097
+ e($) === "fields" ? (h(), y(U, { key: 0 }, [
2098
+ e(p).length > 1 ? (h(), y("label", go, [
2099
+ P(l(e(a).area), 1),
2100
+ ae(n("select", {
2101
+ "onUpdate:modelValue": v[10] || (v[10] = (i) => xe(E) ? E.value = i : null)
622
2102
  }, [
623
- (_(!0), C(K, null, ie(e(P), (l, b) => (_(), C("option", {
624
- key: b,
625
- value: b
626
- }, a(l.pageIndex + 1) + " " + a(e(t).page) + " · " + a(l.component.title || l.component.dataset), 9, Ze))), 128))
2103
+ (h(!0), y(U, null, W(e(p), (i, O) => (h(), y("option", {
2104
+ key: O,
2105
+ value: O
2106
+ }, l(i.pageIndex + 1) + " " + l(e(a).page) + " · " + l(i.component.title || i.component.dataset), 9, fo))), 128))
627
2107
  ], 512), [
628
- [we, e(S)]
2108
+ [ye, e(E)]
629
2109
  ])
630
- ])) : N("", !0),
631
- e(d) ? (_(), C("div", et, [
632
- n("div", tt, [
633
- n("strong", null, a(e(t).columnDirectory), 1),
634
- n("span", null, a(e(d).columns.length) + " " + a(e(t).fieldsCount), 1)
635
- ]),
636
- n("div", nt, [
637
- le(Y, {
638
- name: "search",
639
- size: 15
640
- }),
641
- ue(n("input", {
642
- "onUpdate:modelValue": o[8] || (o[8] = (l) => ce(i) ? i.value = l : null),
643
- type: "search",
644
- "aria-label": e(t).columnsSearch,
645
- placeholder: e(t).columnsSearch
646
- }, null, 8, lt), [
647
- [ge, e(i)]
648
- ]),
649
- e(i) ? (_(), C("button", {
650
- key: 0,
651
- type: "button",
652
- class: "mr-designer-icon-button",
653
- "aria-label": e(t).clearSearch,
654
- title: e(t).clearSearch,
655
- onClick: o[9] || (o[9] = (l) => i.value = "")
656
- }, [
657
- le(Y, {
658
- name: "close",
659
- size: 14
660
- })
661
- ], 8, ot)) : N("", !0)
662
- ]),
663
- n("div", at, [
2110
+ ])) : B("", !0),
2111
+ e(x) ? (h(), y(U, { key: 1 }, [
2112
+ n("div", bo, [
664
2113
  n("button", {
2114
+ ref_key: "directoryTrigger",
2115
+ ref: rt,
665
2116
  type: "button",
666
- disabled: v.readonly || e(h) || e(T) || !e(r).length,
667
- onClick: o[10] || (o[10] = (l) => e(s).selectVisible(!0))
668
- }, a(e(t).selectVisible), 9, st),
669
- e(m).length ? (_(), C("button", {
670
- key: 0,
671
- type: "button",
672
- onClick: o[11] || (o[11] = //@ts-ignore
673
- (...l) => e(s).clearSelection && e(s).clearSelection(...l))
674
- }, a(e(t).clearSelection), 1)) : N("", !0),
675
- e(m).length ? (_(), C("span", it, a(e(t).columnsSelected) + " " + a(e(m).length), 1)) : (_(), C("span", rt, a(e(r).length) + " / " + a(e(d).columns.length), 1))
676
- ]),
677
- n("div", {
678
- ref_key: "columnList",
679
- ref: ae,
680
- class: "mr-designer-column-list",
681
- "aria-label": e(t).columnDirectory,
682
- role: "group"
683
- }, [
684
- (_(!0), C(K, null, ie(e(r), ({ column: l, index: b }) => (_(), C("div", {
685
- key: b,
686
- class: fe(["mr-designer-column-row", { "is-active": e(z) === b }])
2117
+ class: "mr-designer-field-trigger",
2118
+ "aria-expanded": e(Ke),
2119
+ "aria-controls": `${H}-directory`,
2120
+ "aria-haspopup": "dialog",
2121
+ onClick: v[11] || (v[11] = //@ts-ignore
2122
+ (...i) => e(ee).toggle && e(ee).toggle(...i)),
2123
+ onKeydown: v[12] || (v[12] = Be(
2124
+ //@ts-ignore
2125
+ (...i) => e(ee).escape && e(ee).escape(...i),
2126
+ ["esc"]
2127
+ ))
687
2128
  }, [
688
- n("input", {
689
- type: "checkbox",
690
- "aria-label": `${e(t).selectColumn} ${l.header}`,
691
- checked: e(m).includes(b),
692
- disabled: v.readonly || e(h) || e(T),
693
- onChange: (F) => e(s).toggleColumn(b, ee(F))
694
- }, null, 40, ut),
2129
+ n("span", wo, [
2130
+ n("strong", null, l(e(R)?.column.header || e(a).noColumns), 1),
2131
+ n("small", null, l(e(R)?.column.field || "—"), 1)
2132
+ ]),
2133
+ n("span", ko, [
2134
+ P(l(e(a).columnDirectory) + " ", 1),
2135
+ n("b", null, l(e(x).columns.length), 1),
2136
+ Q(oe, {
2137
+ name: "chevron-down",
2138
+ size: 13
2139
+ })
2140
+ ])
2141
+ ], 40, yo),
2142
+ n("div", Mo, [
2143
+ n("span", {
2144
+ "aria-label": e(a).fieldPosition
2145
+ }, [
2146
+ P(l(e(L) >= 0 ? e(L) + 1 : 0), 1),
2147
+ v[50] || (v[50] = n("i", null, "/", -1)),
2148
+ P(l(e(x).columns.length), 1)
2149
+ ], 8, Co),
695
2150
  n("button", {
696
2151
  type: "button",
697
- "data-column-index": b,
698
- "aria-pressed": e(z) === b,
699
- tabindex: e(z) === b ? 0 : -1,
700
- onClick: (F) => e(L).activate(b),
701
- onKeydown: re
2152
+ class: "mr-designer-icon-button",
2153
+ "aria-label": e(a).previousColumn,
2154
+ title: e(a).previousColumn,
2155
+ disabled: e(L) <= 0,
2156
+ onClick: v[13] || (v[13] = (i) => e(q).stepColumn(-1))
702
2157
  }, [
703
- n("span", vt, a(b + 1), 1),
704
- n("span", mt, [
705
- n("strong", null, a(l.header), 1),
706
- n("small", null, a(l.field), 1)
707
- ]),
708
- e(z) === b ? (_(), he(Y, {
709
- key: 0,
710
- name: "chevron-right",
2158
+ Q(oe, {
2159
+ name: "chevron-left",
711
2160
  size: 14
712
- })) : N("", !0)
713
- ], 40, ct)
714
- ], 2))), 128)),
715
- e(r).length ? N("", !0) : (_(), C("p", ft, [
716
- le(Y, {
717
- name: "search",
718
- size: 20
719
- }),
720
- R(a(e(t).noColumns), 1)
721
- ]))
722
- ], 8, dt),
723
- e(m).length ? (_(), C("div", gt, [
724
- n("label", null, [
725
- R(a(e(t).batchBody), 1),
726
- n("select", {
727
- "aria-label": e(t).batchBody,
728
- disabled: v.readonly || e(h) || e(T),
729
- onChange: o[12] || (o[12] = (l) => se(l, "align"))
730
- }, [
731
- n("option", pt, a(e(t).chooseAlignment), 1),
732
- n("option", bt, a(e(t).auto), 1),
733
- n("option", yt, a(e(t).left), 1),
734
- n("option", _t, a(e(t).center), 1),
735
- n("option", kt, a(e(t).right), 1),
736
- n("option", Ct, a(e(t).justify), 1)
737
- ], 40, ht)
738
- ]),
739
- n("label", null, [
740
- R(a(e(t).batchHeader), 1),
741
- n("select", {
742
- "aria-label": e(t).batchHeader,
743
- disabled: v.readonly || e(h) || e(T),
744
- onChange: o[13] || (o[13] = (l) => se(l, "headerAlign"))
2161
+ })
2162
+ ], 8, xo),
2163
+ n("button", {
2164
+ type: "button",
2165
+ class: "mr-designer-icon-button",
2166
+ "aria-label": e(a).nextColumn,
2167
+ title: e(a).nextColumn,
2168
+ disabled: e(L) >= e(x).columns.length - 1,
2169
+ onClick: v[14] || (v[14] = (i) => e(q).stepColumn(1))
745
2170
  }, [
746
- n("option", St, a(e(t).chooseAlignment), 1),
747
- n("option", xt, a(e(t).left), 1),
748
- n("option", Et, a(e(t).center), 1),
749
- n("option", Mt, a(e(t).right), 1),
750
- n("option", Tt, a(e(t).justify), 1)
751
- ], 40, wt)
2171
+ Q(oe, {
2172
+ name: "chevron-right",
2173
+ size: 14
2174
+ })
2175
+ ], 8, _o)
752
2176
  ])
753
- ])) : N("", !0),
754
- e(E) ? (_(), C("fieldset", {
755
- key: 1,
2177
+ ]),
2178
+ e(R) ? (h(), y("fieldset", {
2179
+ key: 0,
756
2180
  class: "mr-designer-properties",
757
- disabled: v.readonly || e(h) || e(T)
2181
+ disabled: t.readonly || e(I) || e(f),
2182
+ "aria-label": e(a).columnProperties
758
2183
  }, [
759
- n("legend", null, [
760
- R(a(e(t).columnProperties) + " ", 1),
761
- n("span", null, a(e(E).index + 1) + " · " + a(e(E).column.header), 1)
762
- ]),
763
- n("label", null, [
764
- R(a(e(t).header), 1),
765
- n("input", {
766
- value: e(E).column.header,
767
- onInput: o[14] || (o[14] = (l) => e(s).setColumn(
768
- e(E).index,
769
- "header",
770
- G(l)
771
- ))
772
- }, null, 40, Dt)
2184
+ n("div", $o, [
2185
+ n("h3", null, l(e(a).contentGroup), 1),
2186
+ n("label", null, [
2187
+ P(l(e(a).header), 1),
2188
+ n("input", {
2189
+ value: e(R).column.header,
2190
+ onInput: v[15] || (v[15] = (i) => e(d).setColumn(
2191
+ e(R).index,
2192
+ "header",
2193
+ ge(i)
2194
+ ))
2195
+ }, null, 40, Eo)
2196
+ ]),
2197
+ n("label", null, [
2198
+ P(l(e(a).field), 1),
2199
+ n("input", {
2200
+ value: e(R).column.field,
2201
+ list: e(V) ? `${H}-fields` : void 0,
2202
+ onChange: v[16] || (v[16] = (i) => e(d).setColumn(
2203
+ e(R).index,
2204
+ "field",
2205
+ ge(i)
2206
+ ))
2207
+ }, null, 40, Io)
2208
+ ]),
2209
+ e(V) ? (h(), y("datalist", {
2210
+ key: 0,
2211
+ id: `${H}-fields`
2212
+ }, [
2213
+ (h(!0), y(U, null, W(e(V).fields, (i) => (h(), y("option", {
2214
+ key: i.field,
2215
+ value: i.field
2216
+ }, l(i.label) + " · " + l(i.type) + " " + l(i.unit), 9, Do))), 128))
2217
+ ], 8, Ao)) : B("", !0)
773
2218
  ]),
774
- n("label", null, [
775
- R(a(e(t).field), 1),
776
- n("input", {
777
- value: e(E).column.field,
778
- onChange: o[15] || (o[15] = (l) => e(s).setColumn(
779
- e(E).index,
780
- "field",
781
- G(l)
782
- ))
783
- }, null, 40, jt)
2219
+ n("div", To, [
2220
+ n("h3", null, l(e(a).formatGroup), 1),
2221
+ n("div", Lo, [
2222
+ n("label", Ro, [
2223
+ P(l(e(a).width), 1),
2224
+ n("input", {
2225
+ type: "number",
2226
+ min: "0.1",
2227
+ step: "0.5",
2228
+ value: e(R).column.widthMm,
2229
+ onChange: v[17] || (v[17] = (i) => e(d).setColumn(
2230
+ e(R).index,
2231
+ "widthMm",
2232
+ ge(i)
2233
+ ))
2234
+ }, null, 40, Go)
2235
+ ]),
2236
+ n("label", Po, [
2237
+ P(l(e(a).semantic), 1),
2238
+ n("select", {
2239
+ value: e(R).column.semanticRole || "text",
2240
+ onChange: v[18] || (v[18] = (i) => e(d).setColumn(
2241
+ e(R).index,
2242
+ "semanticRole",
2243
+ ge(i)
2244
+ ))
2245
+ }, [
2246
+ n("option", Vo, l(e(a).identifier), 1),
2247
+ n("option", Bo, l(e(a).dimension), 1),
2248
+ n("option", zo, l(e(a).measure), 1),
2249
+ n("option", jo, l(e(a).date), 1),
2250
+ n("option", Fo, l(e(a).text), 1)
2251
+ ], 40, Ho)
2252
+ ])
2253
+ ]),
2254
+ n("div", No, [
2255
+ n("span", null, l(e(a).bodyAlign), 1),
2256
+ Q(Ne, {
2257
+ "model-value": e(R).column.align ?? e(R).column.style?.align ?? e(x).align ?? "left",
2258
+ label: e(a).bodyAlign,
2259
+ labels: We.value,
2260
+ "auto-label": e(a).autoShort,
2261
+ "allow-auto": "",
2262
+ "onUpdate:modelValue": v[19] || (v[19] = (i) => e(d).setColumn(e(R).index, "align", i))
2263
+ }, null, 8, ["model-value", "label", "labels", "auto-label"])
2264
+ ]),
2265
+ n("div", Oo, [
2266
+ n("span", null, l(e(a).headerAlign), 1),
2267
+ Q(Ne, {
2268
+ "model-value": e(d).headerAlignments.value[e(R).index] || "left",
2269
+ label: e(a).headerAlign,
2270
+ labels: We.value,
2271
+ "auto-label": e(a).autoShort,
2272
+ "onUpdate:modelValue": v[20] || (v[20] = (i) => e(d).setColumn(
2273
+ e(R).index,
2274
+ "headerAlign",
2275
+ i
2276
+ ))
2277
+ }, null, 8, ["model-value", "label", "labels", "auto-label"])
2278
+ ])
784
2279
  ]),
785
- n("label", null, [
786
- R(a(e(t).width), 1),
2280
+ n("label", Uo, [
2281
+ P(l(e(a).editable), 1),
787
2282
  n("input", {
788
- type: "number",
789
- min: "0.1",
790
- step: "0.5",
791
- value: e(E).column.widthMm,
792
- onChange: o[16] || (o[16] = (l) => e(s).setColumn(
793
- e(E).index,
794
- "widthMm",
795
- G(l)
2283
+ type: "checkbox",
2284
+ role: "switch",
2285
+ checked: e(R).column.editable === !0,
2286
+ onChange: v[21] || (v[21] = (i) => e(d).setColumn(
2287
+ e(R).index,
2288
+ "editable",
2289
+ Ve(i)
796
2290
  ))
797
- }, null, 40, Rt)
2291
+ }, null, 40, Jo)
798
2292
  ]),
799
- n("label", null, [
800
- R(a(e(t).semantic), 1),
801
- n("select", {
802
- value: e(E).column.semanticRole || "text",
803
- onChange: o[17] || (o[17] = (l) => e(s).setColumn(
804
- e(E).index,
805
- "semanticRole",
806
- G(l)
807
- ))
2293
+ n("div", Ko, [
2294
+ n("span", null, l(e(a).columnOrder), 1),
2295
+ n("button", {
2296
+ type: "button",
2297
+ "aria-label": e(a).moveColumnLeft,
2298
+ title: e(a).moveColumnLeft,
2299
+ disabled: e(L) <= 0,
2300
+ onClick: v[22] || (v[22] = (i) => e(Ue)(-1))
808
2301
  }, [
809
- n("option", Bt, a(e(t).identifier), 1),
810
- n("option", Lt, a(e(t).dimension), 1),
811
- n("option", Vt, a(e(t).measure), 1),
812
- n("option", Ot, a(e(t).date), 1),
813
- n("option", It, a(e(t).text), 1)
814
- ], 40, $t)
815
- ]),
816
- n("label", null, [
817
- R(a(e(t).bodyAlign), 1),
818
- n("select", {
819
- value: e(E).column.align ?? e(E).column.style?.align ?? e(d).align ?? "left",
820
- onChange: o[18] || (o[18] = (l) => e(s).setColumn(
821
- e(E).index,
822
- "align",
823
- G(l)
824
- ))
2302
+ Q(oe, {
2303
+ name: "chevron-left",
2304
+ size: 13
2305
+ })
2306
+ ], 8, Wo),
2307
+ n("button", {
2308
+ type: "button",
2309
+ "aria-label": e(a).moveColumnRight,
2310
+ title: e(a).moveColumnRight,
2311
+ disabled: e(L) >= e(x).columns.length - 1,
2312
+ onClick: v[23] || (v[23] = (i) => e(Ue)(1))
825
2313
  }, [
826
- n("option", Nt, a(e(t).auto), 1),
827
- n("option", Pt, a(e(t).left), 1),
828
- n("option", Ht, a(e(t).center), 1),
829
- n("option", Gt, a(e(t).right), 1),
830
- n("option", Ft, a(e(t).justify), 1)
831
- ], 40, Jt)
2314
+ Q(oe, {
2315
+ name: "chevron-right",
2316
+ size: 13
2317
+ })
2318
+ ], 8, Xo),
2319
+ n("label", null, [
2320
+ P(l(e(a).columnVisible), 1),
2321
+ n("input", {
2322
+ type: "checkbox",
2323
+ checked: e(R).column.hidden !== !0,
2324
+ disabled: e(R).column.hidden !== !0 && e(x).columns.filter((i) => !i.hidden).length === 1,
2325
+ onChange: v[24] || (v[24] = (i) => e(d).setColumn(
2326
+ e(R).index,
2327
+ "hidden",
2328
+ !Ve(i)
2329
+ ))
2330
+ }, null, 40, qo)
2331
+ ])
2332
+ ])
2333
+ ], 8, So)) : B("", !0),
2334
+ e(Ke) ? (h(), y("div", {
2335
+ key: 1,
2336
+ id: `${H}-directory`,
2337
+ ref_key: "directoryPanel",
2338
+ ref: dt,
2339
+ role: "dialog",
2340
+ "aria-label": e(a).columnDirectory,
2341
+ class: "mr-designer-directory",
2342
+ onKeydown: v[34] || (v[34] = Be(
2343
+ //@ts-ignore
2344
+ (...i) => e(ee).escape && e(ee).escape(...i),
2345
+ ["esc"]
2346
+ )),
2347
+ onFocusout: v[35] || (v[35] = //@ts-ignore
2348
+ (...i) => e(ee).leave && e(ee).leave(...i))
2349
+ }, [
2350
+ n("div", Qo, [
2351
+ n("strong", null, [
2352
+ P(l(e(a).columnDirectory) + " ", 1),
2353
+ n("span", null, l(e(x).columns.length), 1)
2354
+ ]),
2355
+ n("button", {
2356
+ type: "button",
2357
+ class: "mr-designer-icon-button",
2358
+ "aria-label": e(a).closeDirectory,
2359
+ onClick: v[25] || (v[25] = (i) => e(ee).close(!0))
2360
+ }, [
2361
+ Q(oe, {
2362
+ name: "close",
2363
+ size: 15
2364
+ })
2365
+ ], 8, Zo)
832
2366
  ]),
833
- n("label", null, [
834
- R(a(e(t).headerAlign), 1),
835
- n("select", {
836
- value: e(s).headerAlignments.value[e(E).index],
837
- onChange: o[19] || (o[19] = (l) => e(s).setColumn(
838
- e(E).index,
839
- "headerAlign",
840
- G(l)
841
- ))
2367
+ n("div", ea, [
2368
+ Q(oe, {
2369
+ name: "search",
2370
+ size: 14
2371
+ }),
2372
+ ae(n("input", {
2373
+ ref_key: "directorySearch",
2374
+ ref: ut,
2375
+ "onUpdate:modelValue": v[26] || (v[26] = (i) => xe(T) ? T.value = i : null),
2376
+ type: "search",
2377
+ "aria-label": e(a).columnsSearch,
2378
+ placeholder: e(a).columnsSearch,
2379
+ onKeydown: v[27] || (v[27] = //@ts-ignore
2380
+ (...i) => e(ee).searchKeydown && e(ee).searchKeydown(...i))
2381
+ }, null, 40, ta), [
2382
+ [qe, e(T)]
2383
+ ]),
2384
+ e(T) ? (h(), y("button", {
2385
+ key: 0,
2386
+ type: "button",
2387
+ class: "mr-designer-icon-button",
2388
+ "aria-label": e(a).clearSearch,
2389
+ title: e(a).clearSearch,
2390
+ onClick: v[28] || (v[28] = (i) => T.value = "")
842
2391
  }, [
843
- n("option", zt, a(e(t).left), 1),
844
- n("option", qt, a(e(t).center), 1),
845
- n("option", Kt, a(e(t).right), 1),
846
- n("option", Wt, a(e(t).justify), 1)
847
- ], 40, Ut)
2392
+ Q(oe, {
2393
+ name: "close",
2394
+ size: 13
2395
+ })
2396
+ ], 8, na)) : B("", !0)
848
2397
  ]),
849
- n("label", Qt, [
850
- R(a(e(t).editable), 1),
851
- n("input", {
852
- type: "checkbox",
853
- checked: e(E).column.editable === !0,
854
- onChange: o[20] || (o[20] = (l) => e(s).setColumn(
855
- e(E).index,
856
- "editable",
857
- ee(l)
858
- ))
859
- }, null, 40, Xt)
860
- ])
861
- ], 8, At)) : N("", !0)
862
- ])) : (_(), C("p", Yt, a(e(t).noColumns), 1))
863
- ], 64)) : e(V) === "template" ? (_(), C(K, { key: 1 }, [
864
- n("h3", null, a(e(t).templateDetails), 1),
865
- n("label", Zt, [
866
- R(a(e(t).name), 1),
2398
+ n("div", oa, [
2399
+ n("button", {
2400
+ type: "button",
2401
+ disabled: t.readonly || e(I) || e(f) || !e(D).length,
2402
+ onClick: v[29] || (v[29] = (i) => e(d).selectVisible(!0))
2403
+ }, l(e(a).selectVisible), 9, aa),
2404
+ e(N).length ? (h(), y("button", {
2405
+ key: 0,
2406
+ type: "button",
2407
+ onClick: v[30] || (v[30] = //@ts-ignore
2408
+ (...i) => e(d).clearSelection && e(d).clearSelection(...i))
2409
+ }, l(e(a).clearSelection), 1)) : B("", !0),
2410
+ e(N).length ? (h(), y("span", la, l(e(a).columnsSelected) + " " + l(e(N).length), 1)) : (h(), y("span", sa, l(e(D).length) + " / " + l(e(x).columns.length), 1))
2411
+ ]),
2412
+ n("div", {
2413
+ ref_key: "columnList",
2414
+ ref: ct,
2415
+ class: "mr-designer-column-list",
2416
+ "aria-label": e(a).columnDirectory,
2417
+ role: "group"
2418
+ }, [
2419
+ (h(!0), y(U, null, W(e(D), ({ column: i, index: O }) => (h(), y("div", {
2420
+ key: O,
2421
+ class: _e(["mr-designer-column-row", { "is-active": e(L) === O }])
2422
+ }, [
2423
+ n("input", {
2424
+ type: "checkbox",
2425
+ "aria-label": `${e(a).selectColumn} ${i.header}`,
2426
+ checked: e(N).includes(O),
2427
+ disabled: t.readonly || e(I) || e(f),
2428
+ onChange: (ke) => e(d).toggleColumn(O, Ve(ke))
2429
+ }, null, 40, ra),
2430
+ n("button", {
2431
+ type: "button",
2432
+ "data-column-index": O,
2433
+ "aria-pressed": e(L) === O,
2434
+ tabindex: e(it) === O ? 0 : -1,
2435
+ onClick: (ke) => e(ee).choose(O),
2436
+ onKeydown: v[31] || (v[31] = //@ts-ignore
2437
+ (...ke) => e(ee).navigate && e(ee).navigate(...ke))
2438
+ }, [
2439
+ n("span", ua, l(O + 1), 1),
2440
+ n("span", ca, [
2441
+ n("strong", null, l(i.header), 1),
2442
+ n("small", null, l(i.field), 1)
2443
+ ]),
2444
+ e(L) === O ? (h(), fe(oe, {
2445
+ key: 0,
2446
+ name: "chevron-right",
2447
+ size: 13
2448
+ })) : B("", !0)
2449
+ ], 40, da)
2450
+ ], 2))), 128)),
2451
+ e(D).length ? B("", !0) : (h(), y("p", ma, [
2452
+ Q(oe, {
2453
+ name: "search",
2454
+ size: 20
2455
+ }),
2456
+ P(l(e(a).noColumns), 1)
2457
+ ]))
2458
+ ], 8, ia),
2459
+ e(N).length ? (h(), y("div", va, [
2460
+ n("label", null, [
2461
+ P(l(e(a).batchBody), 1),
2462
+ n("select", {
2463
+ "aria-label": e(a).batchBody,
2464
+ disabled: t.readonly || e(I) || e(f),
2465
+ onChange: v[32] || (v[32] = (i) => Xe(i, "align"))
2466
+ }, [
2467
+ n("option", ha, l(e(a).chooseAlignment), 1),
2468
+ n("option", ga, l(e(a).auto), 1),
2469
+ n("option", fa, l(e(a).left), 1),
2470
+ n("option", ba, l(e(a).center), 1),
2471
+ n("option", ya, l(e(a).right), 1),
2472
+ n("option", wa, l(e(a).justify), 1)
2473
+ ], 40, pa)
2474
+ ]),
2475
+ n("label", null, [
2476
+ P(l(e(a).batchHeader), 1),
2477
+ n("select", {
2478
+ "aria-label": e(a).batchHeader,
2479
+ disabled: t.readonly || e(I) || e(f),
2480
+ onChange: v[33] || (v[33] = (i) => Xe(i, "headerAlign"))
2481
+ }, [
2482
+ n("option", Ma, l(e(a).chooseAlignment), 1),
2483
+ n("option", Ca, l(e(a).left), 1),
2484
+ n("option", xa, l(e(a).center), 1),
2485
+ n("option", _a, l(e(a).right), 1),
2486
+ n("option", Sa, l(e(a).justify), 1)
2487
+ ], 40, ka)
2488
+ ])
2489
+ ])) : B("", !0)
2490
+ ], 40, Yo)) : B("", !0)
2491
+ ], 64)) : (h(), y("p", $a, l(e(a).noColumns), 1))
2492
+ ], 64)) : e($) === "component" ? (h(), y(U, { key: 1 }, [
2493
+ n("div", Ea, [
2494
+ n("select", {
2495
+ "aria-label": e(a).insertComponent,
2496
+ disabled: e(le),
2497
+ onChange: v[36] || (v[36] = //@ts-ignore
2498
+ (...i) => e(J) && e(J)(...i))
2499
+ }, [
2500
+ n("option", Aa, l(e(a).insertComponent), 1),
2501
+ n("option", Da, l(e(a).insertText), 1),
2502
+ n("option", Ta, l(e(a).insertList), 1),
2503
+ n("option", La, l(e(a).insertImage), 1),
2504
+ n("option", Ra, l(e(a).insertRect), 1)
2505
+ ], 40, Ia),
2506
+ n("button", {
2507
+ type: "button",
2508
+ title: e(a).duplicateComponent,
2509
+ "aria-label": e(a).duplicateComponent,
2510
+ disabled: e(le) || !e(ie),
2511
+ onClick: v[37] || (v[37] = //@ts-ignore
2512
+ (...i) => e(ce).duplicate && e(ce).duplicate(...i))
2513
+ }, " + ", 8, Ga),
2514
+ n("button", {
2515
+ type: "button",
2516
+ title: e(a).removeComponent,
2517
+ "aria-label": e(a).removeComponent,
2518
+ disabled: e(le) || !e(ie),
2519
+ onClick: v[38] || (v[38] = //@ts-ignore
2520
+ (...i) => e(ce).remove && e(ce).remove(...i))
2521
+ }, [
2522
+ Q(oe, {
2523
+ name: "close",
2524
+ size: 14
2525
+ })
2526
+ ], 8, Pa)
2527
+ ]),
2528
+ e(w).template.pages.length > 1 ? (h(), y("label", Ha, [
2529
+ P(l(e(a).page), 1),
2530
+ ae(n("select", {
2531
+ "onUpdate:modelValue": v[39] || (v[39] = (i) => xe(se) ? se.value = i : null)
2532
+ }, [
2533
+ (h(!0), y(U, null, W(e(w).template.pages, (i, O) => (h(), y("option", {
2534
+ key: O,
2535
+ value: O
2536
+ }, l(O + 1), 9, Va))), 128))
2537
+ ], 512), [
2538
+ [
2539
+ ye,
2540
+ e(se),
2541
+ void 0,
2542
+ { number: !0 }
2543
+ ]
2544
+ ])
2545
+ ])) : B("", !0),
2546
+ n("label", Ba, [
2547
+ P(l(e(a).components), 1),
2548
+ n("select", {
2549
+ value: e(pe)?.pageIndex === e(se) ? e(pe).componentIndex : -1,
2550
+ onChange: v[40] || (v[40] = (i) => e(j)({
2551
+ pageIndex: e(se),
2552
+ componentIndex: Number(ge(i))
2553
+ }))
2554
+ }, [
2555
+ n("option", ja, l(e(a).noComponent), 1),
2556
+ (h(!0), y(U, null, W(e(w).template.pages[e(se)]?.components, (i, O) => (h(), y("option", {
2557
+ key: O,
2558
+ value: O
2559
+ }, l(O + 1) + " · " + l(i.kind === "list" ? i.title || i.dataset : i.text || i.kind), 9, Fa))), 128))
2560
+ ], 40, za)
2561
+ ]),
2562
+ e(ie) ? (h(), y(U, { key: 1 }, [
2563
+ n("div", Na, [
2564
+ n("button", {
2565
+ type: "button",
2566
+ disabled: e(le) || e(pe)?.componentIndex === 0,
2567
+ onClick: v[41] || (v[41] = (i) => e(ce).reorder(-1))
2568
+ }, l(e(a).backward), 9, Oa),
2569
+ n("button", {
2570
+ type: "button",
2571
+ disabled: e(le) || e(pe)?.componentIndex === (e(w).template.pages[e(se)]?.components.length ?? 0) - 1,
2572
+ onClick: v[42] || (v[42] = (i) => e(ce).reorder(1))
2573
+ }, l(e(a).forward), 9, Ua)
2574
+ ]),
2575
+ Q(_n, {
2576
+ component: e(ie),
2577
+ disabled: e(le),
2578
+ messages: e(a),
2579
+ onGeometry: e(ce).geometry,
2580
+ onPatch: e(ne)
2581
+ }, null, 8, ["component", "disabled", "messages", "onGeometry", "onPatch"]),
2582
+ e(ie).kind === "list" ? (h(), fe(Ln, {
2583
+ key: 0,
2584
+ list: e(ie),
2585
+ disabled: e(le),
2586
+ messages: e(a),
2587
+ onCommand: e(at)
2588
+ }, null, 8, ["list", "disabled", "messages", "onCommand"])) : B("", !0)
2589
+ ], 64)) : (h(), y("p", Ja, l(e(a).noComponent), 1))
2590
+ ], 64)) : e($) === "template" ? (h(), y(U, { key: 2 }, [
2591
+ n("h3", null, l(e(a).templateDetails), 1),
2592
+ n("label", Ka, [
2593
+ P(l(e(a).name), 1),
867
2594
  n("input", {
868
2595
  value: e(w).name,
869
- disabled: v.readonly || e(h) || e(T),
870
- onInput: o[21] || (o[21] = (l) => e(s).setName(G(l)))
871
- }, null, 40, en)
2596
+ disabled: t.readonly || e(I) || e(f),
2597
+ onInput: v[43] || (v[43] = (i) => e(d).setName(ge(i)))
2598
+ }, null, 40, Wa)
872
2599
  ]),
873
- n("label", tn, [
874
- R(a(e(t).description), 1),
2600
+ n("label", Xa, [
2601
+ P(l(e(a).description), 1),
875
2602
  n("textarea", {
876
- rows: "4",
2603
+ rows: "2",
877
2604
  value: e(w).description,
878
- disabled: v.readonly || e(h) || e(T),
879
- onInput: o[22] || (o[22] = (l) => e(s).setDescription(G(l)))
880
- }, null, 40, nn)
2605
+ disabled: t.readonly || e(I) || e(f),
2606
+ onInput: v[44] || (v[44] = (i) => e(d).setDescription(ge(i)))
2607
+ }, null, 40, qa)
881
2608
  ]),
882
- n("dl", ln, [
883
- n("dt", null, a(e(t).templateIdentity), 1),
884
- n("dd", null, a(e(w).id), 1),
885
- n("dt", null, a(e(t).templateRevision), 1),
886
- n("dd", null, a(e(w).revision || e(t).unpublished), 1)
887
- ]),
888
- n("p", on, a(e(t).note), 1)
889
- ], 64)) : (_(), C(K, { key: 2 }, [
890
- n("h3", null, a(e(t).advancedTitle), 1),
891
- n("p", an, a(e(t).advancedDescription), 1),
892
- n("label", sn, [
893
- R(a(e(t).json), 1),
894
- ue(n("textarea", {
895
- "onUpdate:modelValue": o[23] || (o[23] = (l) => ce($) ? $.value = l : null),
2609
+ n("details", Ya, [
2610
+ n("summary", null, l(e(a).technicalDetails), 1),
2611
+ n("dl", Qa, [
2612
+ n("dt", null, l(e(a).templateIdentity), 1),
2613
+ n("dd", null, l(e(w).id), 1),
2614
+ n("dt", null, l(e(a).templateRevision), 1),
2615
+ n("dd", null, l(e(w).revision || e(a).unpublished), 1)
2616
+ ])
2617
+ ])
2618
+ ], 64)) : (h(), y(U, { key: 3 }, [
2619
+ n("h3", null, l(e(a).advancedTitle), 1),
2620
+ n("label", Za, [
2621
+ P(l(e(a).json), 1),
2622
+ ae(n("textarea", {
2623
+ "onUpdate:modelValue": v[45] || (v[45] = (i) => xe(C) ? C.value = i : null),
896
2624
  class: "mr-designer-json",
897
- "aria-label": e(t).json,
898
- disabled: v.readonly || e(h),
2625
+ "aria-label": e(a).json,
2626
+ disabled: t.readonly || e(I),
899
2627
  spellcheck: "false"
900
- }, null, 8, rn), [
901
- [ge, e($)]
2628
+ }, null, 8, el), [
2629
+ [qe, e(C)]
902
2630
  ])
903
2631
  ]),
904
2632
  n("button", {
905
2633
  type: "button",
906
2634
  class: "mr-designer-apply-json",
907
- disabled: v.readonly || e(h),
908
- onClick: o[24] || (o[24] = //@ts-ignore
909
- (...l) => e(s).applyJson && e(s).applyJson(...l))
910
- }, a(e(t).applyJson), 9, dn)
2635
+ disabled: t.readonly || e(I),
2636
+ onClick: v[46] || (v[46] = //@ts-ignore
2637
+ (...i) => e(d).applyJson && e(d).applyJson(...i))
2638
+ }, l(e(a).applyJson), 9, tl)
911
2639
  ], 64)),
912
- e(T) ? (_(), C("p", un, a(e(t).jsonPending), 1)) : N("", !0)
913
- ], 8, Xe)
914
- ]),
915
- n("div", {
2640
+ e(f) ? (h(), y("p", nl, l(e(a).jsonPending), 1)) : B("", !0)
2641
+ ], 10, ho)
2642
+ ])) : B("", !0),
2643
+ e($) !== "tools" ? (h(), y("div", {
2644
+ key: 2,
916
2645
  class: "mr-designer-preview",
917
- "aria-label": e(t).previewTitle
2646
+ "aria-label": e(a).previewTitle
918
2647
  }, [
919
- e(p) ? (_(), C("div", vn, a(e(p)), 1)) : N("", !0),
920
- e(D).ok ? N("", !0) : (_(), C("ul", mn, [
921
- (_(!0), C(K, null, ie(e(D).errors, (l) => (_(), C("li", {
922
- key: l.path
923
- }, a(l.path) + ":" + a(l.message), 1))), 128))
2648
+ e(G) ? (h(), y("div", al, l(e(G)), 1)) : B("", !0),
2649
+ e(M).ok ? B("", !0) : (h(), y("ul", ll, [
2650
+ (h(!0), y(U, null, W(e(M).errors, (i) => (h(), y("li", {
2651
+ key: i.path
2652
+ }, l(i.path) + ":" + l(i.message), 1))), 128))
924
2653
  ])),
925
- e(x) && e(D).ok ? (_(), he(e(Ee), {
2654
+ e(Ce) === "design" && e(M).ok ? (h(), fe(Ot, {
926
2655
  key: 2,
2656
+ document: e(w),
2657
+ selection: e(pe),
2658
+ "page-index": e(se),
2659
+ datasets: t.datasets,
2660
+ disabled: e(le),
2661
+ messages: e(a),
2662
+ onSelect: e(j),
2663
+ onGeometry: e(ce).geometry,
2664
+ onColumn: e(q).activate,
2665
+ onWidth: v[47] || (v[47] = (i, O) => e(d).setColumn(i, "widthMm", String(O)))
2666
+ }, null, 8, ["document", "selection", "page-index", "datasets", "disabled", "messages", "onSelect", "onGeometry", "onColumn"])) : e(te) && e(M).ok ? (h(), fe(e(yt), {
2667
+ key: 3,
927
2668
  "report-id": "draft",
928
- fetcher: e(x),
2669
+ fetcher: e(te),
2670
+ messages: {
2671
+ title: e(a).previewTitle,
2672
+ columnDirectory: e(a).previewFieldDirectory
2673
+ },
929
2674
  "show-params": !1,
930
2675
  editable: !1,
931
2676
  "excel-import": !1,
932
2677
  height: "100%"
933
- }, null, 8, ["fetcher"])) : (_(), C("p", fn, a(e(t).invalid), 1))
934
- ], 8, cn)
935
- ])
936
- ], 8, Oe));
2678
+ }, null, 8, ["fetcher", "messages"])) : (h(), y("p", sl, l(e(a).invalid), 1))
2679
+ ], 8, ol)) : B("", !0)
2680
+ ], 2)
2681
+ ], 8, On));
937
2682
  }
938
- }), _n = /* @__PURE__ */ Me(gn, [["__scopeId", "data-v-c4eab8e7"]]);
2683
+ }), vl = /* @__PURE__ */ Ie(il, [["__scopeId", "data-v-9e22163e"]]), pl = {
2684
+ title: "变更与验收",
2685
+ run: "运行检查",
2686
+ running: "检查中…",
2687
+ samples: "验收样例",
2688
+ none: "仅检查结构",
2689
+ first20: "每个数据集前 20 行",
2690
+ first100: "每个数据集前 100 行",
2691
+ all: "全部当前数据(总计 ≤1000 行)",
2692
+ changes: "模板变更",
2693
+ issues: "待处理项",
2694
+ results: "样例结果",
2695
+ noChanges: "与基线一致",
2696
+ noIssues: "本次检查未发现问题",
2697
+ empty: "选择验收样例后运行,检查字段映射、排版与输出能力。",
2698
+ baseline: "未提供上一版本,仅检查当前模板。",
2699
+ errors: "错误",
2700
+ warnings: "提示",
2701
+ locate: "定位",
2702
+ before: "修改前",
2703
+ after: "修改后",
2704
+ breaking: "影响兼容性",
2705
+ acknowledge: "已确认字段与结构变更",
2706
+ truncated: "变更较多,仅展示前 500 项;兼容检查仍包含全部变更。",
2707
+ pages: "页",
2708
+ rows: "行",
2709
+ checked: "检查结果对应本次样例,不代替服务端发布权限与全量数据校验。",
2710
+ categories: { metadata: "信息", structure: "结构", binding: "字段", calculation: "计算", format: "样式" },
2711
+ kinds: { added: "新增", removed: "删除", modified: "修改", moved: "调序" }
2712
+ }, hl = {
2713
+ title: "Excel 业务绑定",
2714
+ intro: "保留模板版式,明确数据来源",
2715
+ upload: "选择 Excel 模板",
2716
+ replace: "更换文件",
2717
+ loading: "正在解析模板…",
2718
+ cancel: "取消解析",
2719
+ source: "原始模板",
2720
+ sourceHint: "点击行号选择,Shift 点击扩展;选择整行区域后标记用途。",
2721
+ sourceOnly: "来源样例仅供设计,应用时将全部替换为接口数据。",
2722
+ sheet: "工作表",
2723
+ dataset: "业务数据集",
2724
+ chooseDataset: "选择数据集契约",
2725
+ rowKey: "稳定业务主键",
2726
+ chooseRowKey: "选择业务主键",
2727
+ titleRegion: "标题",
2728
+ headerRegion: "多层表头",
2729
+ detailRegion: "样例明细",
2730
+ footerRegion: "静态尾页",
2731
+ optional: "可选",
2732
+ selectRegion: "标记选中行",
2733
+ clear: "清除",
2734
+ mapping: "逐列映射",
2735
+ coverage: "映射覆盖",
2736
+ physical: "Excel 列",
2737
+ business: "业务字段",
2738
+ chooseField: "选择已声明字段",
2739
+ selected: "已选行",
2740
+ previousRows: "上一组行",
2741
+ nextRows: "下一组行",
2742
+ previousColumns: "上一组列",
2743
+ nextColumns: "下一组列",
2744
+ rowStart: "预览起始行",
2745
+ columnStart: "预览起始列",
2746
+ apply: "校验并使用模板",
2747
+ check: "校验绑定",
2748
+ identity: "新模板",
2749
+ templateId: "模板标识",
2750
+ templateName: "模板名称",
2751
+ issues: "请先修正绑定",
2752
+ ready: "绑定校验通过",
2753
+ noSource: "导入 .xlsx,开始绑定业务数据",
2754
+ noContract: "请由接入方提供数据集字段契约,再配置业务绑定。",
2755
+ fieldType: "类型",
2756
+ precision: "位小数",
2757
+ sample: "契约样例",
2758
+ unnamed: "未标记",
2759
+ applied: "模板已生成,等待接入方确认",
2760
+ readonly: "当前只读",
2761
+ invalidFile: "请选择未加密的 .xlsx 文件",
2762
+ emptySelection: "请先在原始模板中选择行",
2763
+ footerHint: "静态尾页保留为独立页面,不随明细重复;不是每页页脚。",
2764
+ inspectWarning: "来源兼容性提示",
2765
+ session: "绑定会话可随草稿保存,再次传入即可恢复",
2766
+ decimals: "精确小数按原文本保留",
2767
+ selectionLabel: "选择源行",
2768
+ regionLegend: "区域用途",
2769
+ summary: "绑定摘要",
2770
+ stepSource: "选模板",
2771
+ stepRegions: "标区域",
2772
+ stepFields: "绑字段",
2773
+ stepValidate: "校验应用",
2774
+ errors: "项问题",
2775
+ sourceError: "模板解析失败",
2776
+ dimensions: "原始范围",
2777
+ mappedTo: "绑定到",
2778
+ sampleOnly: "仅契约样例",
2779
+ schemaOnly: "契约字段,不执行接口查询"
2780
+ }, gl = {
2781
+ detail: "主从",
2782
+ matrix: "矩阵",
2783
+ measureLabel: "显示名称",
2784
+ childDataset: "明细数据集",
2785
+ parentKey: "主表关联键",
2786
+ foreignKey: "明细外键",
2787
+ rowKey: "明细业务主键",
2788
+ noRowKey: "只读明细,不绑定编辑身份",
2789
+ childColumns: "明细展示字段",
2790
+ title: "明细标题",
2791
+ unmatched: "未关联明细",
2792
+ ignore: "显式忽略",
2793
+ childHeader: "展示明细表头",
2794
+ rowFields: "行维度",
2795
+ columnFields: "列维度",
2796
+ totals: "原始样本总计",
2797
+ widthSettings: "动态列宽 · mm",
2798
+ dimensionWidth: "维度列宽",
2799
+ measureWidth: "度量列宽",
2800
+ detailHint: "以业务键关联宿主提供的数据集。应用主从布局将替换矩阵配置。",
2801
+ matrixHint: "查询时按维度生成动态列。应用矩阵将替换普通分组、主从和总计;可撤销恢复。",
2802
+ computations: "计算",
2803
+ groups: "分组",
2804
+ conditions: "条件",
2805
+ target: "结果字段",
2806
+ newField: "新增计算字段",
2807
+ select: "选择字段",
2808
+ row: "当前行",
2809
+ group: "当前组",
2810
+ dataset: "整个数据集",
2811
+ scope: "计算范围",
2812
+ numeric: "数值模式",
2813
+ number: "普通数值",
2814
+ decimal: "精确小数",
2815
+ digits: "小数位",
2816
+ groupFields: "分组依据",
2817
+ field: "字段",
2818
+ constant: "常量",
2819
+ operation: "运算",
2820
+ aggregate: "聚合",
2821
+ text: "文本",
2822
+ boolean: "布尔",
2823
+ null: "空值",
2824
+ true: "是",
2825
+ false: "否",
2826
+ add: "相加",
2827
+ subtract: "相减",
2828
+ multiply: "相乘",
2829
+ divide: "相除",
2830
+ coalesce: "首个非空值",
2831
+ sum: "求和",
2832
+ count: "计数",
2833
+ avg: "平均值",
2834
+ min: "最小值",
2835
+ max: "最大值",
2836
+ weightedAvg: "加权平均",
2837
+ subtotalLabel: "小计",
2838
+ weight: "权重字段",
2839
+ argument: "参数",
2840
+ addArgument: "添加参数",
2841
+ remove: "移除",
2842
+ apply: "应用规则",
2843
+ check: "样例验算",
2844
+ addGroup: "添加分组",
2845
+ noGroups: "尚未配置分组",
2846
+ header: "组头模板",
2847
+ footer: "组尾标签",
2848
+ repeat: "跨页重复组头",
2849
+ orphan: "组头与首行保持同页",
2850
+ outer: "外层",
2851
+ inner: "内层",
2852
+ addAggregate: "添加聚合",
2853
+ measure: "度量字段",
2854
+ output: "输出字段",
2855
+ condition: "条件字段",
2856
+ comparison: "比较方式",
2857
+ threshold: "比较值",
2858
+ effect: "效果",
2859
+ style: "条件样式",
2860
+ cell: "单元格可见",
2861
+ rowVisibility: "明细行可见",
2862
+ color: "文字颜色",
2863
+ background: "背景颜色",
2864
+ bold: "加粗",
2865
+ column: "目标列",
2866
+ newCondition: "新增条件样式",
2867
+ removeCondition: "移除此规则",
2868
+ advanced: "计算边界",
2869
+ nulls: "空值处理",
2870
+ propagate: "保留为空",
2871
+ error: "报告错误",
2872
+ division: "除零处理",
2873
+ dependencies: "计算顺序",
2874
+ noData: "尚无样例数据",
2875
+ sample: "样例前 1000 行 · 仅验算,不修改来源",
2876
+ preview: "计算结果",
2877
+ existing: "已有规则",
2878
+ ready: "规则已通过结构校验",
2879
+ allRows: "全部行",
2880
+ noFields: "当前数据集尚无字段",
2881
+ resultType: "常量类型",
2882
+ settings: "规则设置",
2883
+ moveUp: "向外移动",
2884
+ moveDown: "向内移动",
2885
+ missingTarget: "请选择或填写结果字段",
2886
+ noSelection: "请先选择列",
2887
+ countHint: "留空度量字段可统计行数",
2888
+ decimalHint: "精确小数以文本保存,避免大数精度丢失。",
2889
+ readonly: "只读",
2890
+ formatMode: "条件规则",
2891
+ rule: "规则",
2892
+ sampleError: "验算未通过",
2893
+ new: "新增",
2894
+ enabled: "启用"
2895
+ }, fl = Me(() => import("./TemplateReviewPanel-Cn32OY4_.js")), bl = Me(() => import("./ExcelBindingWizard-RLJIXKKG.js")), yl = Me(() => import("./RuleEditor-ynnUEK0s.js"));
939
2896
  export {
940
- _n as ReportTemplateEditor,
941
- Be as TEMPLATE_EDITOR_MESSAGES
2897
+ hl as EXCEL_BINDING_MESSAGES,
2898
+ bl as ExcelBindingWizard,
2899
+ gl as RULE_EDITOR_MESSAGES,
2900
+ vl as ReportTemplateEditor,
2901
+ yl as RuleEditor,
2902
+ Pe as TEMPLATE_EDITOR_MESSAGES,
2903
+ pl as TEMPLATE_REVIEW_MESSAGES,
2904
+ fl as TemplateReviewPanel
942
2905
  };