@agile-team/mach-report 2.8.4 → 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 (94) hide show
  1. package/README.md +27 -9
  2. package/dist/ExcelBindingWizard-DiaxvWpQ.cjs +1 -0
  3. package/dist/ExcelBindingWizard-RLJIXKKG.js +816 -0
  4. package/dist/{ReportPreview-DTWiCH5a.js → ReportPreview-B5ZNEasW.js} +22 -21
  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/analytics.cjs +1 -1
  11. package/dist/analytics.d.cts +188 -5
  12. package/dist/analytics.d.ts +188 -5
  13. package/dist/analytics.js +68 -202
  14. package/dist/{assets-B9qJku3V.js → assets-DDsfEi8R.js} +3 -3
  15. package/dist/{assets-RZan7EyL.cjs → assets-ahTRUXRk.cjs} +1 -1
  16. package/dist/binding-preview-B5834rml.cjs +2 -0
  17. package/dist/binding-preview-ChXjN5L5.js +649 -0
  18. package/dist/{capabilities-joSutDF8.js → capabilities-Cm9hZ3uV.js} +5 -5
  19. package/dist/{capabilities-xGTpnPjJ.cjs → capabilities-DYzWL7KS.cjs} +1 -1
  20. package/dist/dataset-BkRmwgeJ.cjs +1 -0
  21. package/dist/dataset-H5pFuQGU.js +121 -0
  22. package/dist/defaults-DXhiM1ZD.js +10 -0
  23. package/dist/defaults-xhmcLLrf.cjs +1 -0
  24. package/dist/designer.cjs +2 -1
  25. package/dist/designer.d.cts +1373 -6
  26. package/dist/designer.d.ts +1373 -6
  27. package/dist/designer.js +2495 -767
  28. package/dist/grid-geometry-BNptEcMm.js +65 -0
  29. package/dist/grid-geometry-CZ_cYB6O.cjs +1 -0
  30. package/dist/import-template-CNMLJSQw.js +23030 -0
  31. package/dist/import-template-CpxunKVp.cjs +29 -0
  32. package/dist/index.cjs +7 -7
  33. package/dist/index.d.cts +202 -3
  34. package/dist/index.d.ts +202 -3
  35. package/dist/index.js +554 -535
  36. package/dist/matrix-CNPDJxED.js +745 -0
  37. package/dist/matrix-Div9Ilh3.cjs +1 -0
  38. package/dist/pdf.cjs +46 -46
  39. package/dist/pdf.d.cts +2 -0
  40. package/dist/pdf.d.ts +2 -0
  41. package/dist/pdf.js +17 -16
  42. package/dist/{plugin-CQmJXNcA.js → plugin-BWwIgZXV.js} +1 -1
  43. package/dist/{plugin-DSFu51Ua.cjs → plugin-Dg-J1Rbm.cjs} +1 -1
  44. package/dist/progress-7OSZbFok.js +39 -0
  45. package/dist/progress-BnLiS5eH.cjs +1 -0
  46. package/dist/render-plan-7xpGrCEl.cjs +1 -0
  47. package/dist/render-plan-Ck6koX9L.js +13 -0
  48. package/dist/server/node.d.cts +62 -0
  49. package/dist/server/node.d.ts +62 -0
  50. package/dist/server-node.cjs +1 -1
  51. package/dist/server-node.js +373 -145
  52. package/dist/server.cjs +1 -1
  53. package/dist/server.d.cts +311 -0
  54. package/dist/server.d.ts +311 -0
  55. package/dist/server.js +590 -186
  56. package/dist/{style-Dv5o_x6b.js → style-CQ1PK8ZB.js} +5 -5
  57. package/dist/style-UgIJSA1F.cjs +1 -0
  58. package/dist/style.css +1 -1
  59. package/dist/template-registry-CHMYZ7SD.cjs +1 -0
  60. package/dist/template-registry-R61AMCr0.js +433 -0
  61. package/dist/template-review-hvWWQFsi.js +1027 -0
  62. package/dist/template-review-jEcOfmGr.cjs +1 -0
  63. package/dist/textwrap-CWHyzkBH.cjs +4 -0
  64. package/dist/{textwrap-DOl04hCQ.js → textwrap-DE1kgcJB.js} +1 -1
  65. package/dist/{validate-DfHPD8wX.cjs → validate-BDiMqkJC.cjs} +1 -1
  66. package/dist/{validate-S6CgIm5d.js → validate-DWPF7icl.js} +13 -13
  67. package/dist/vue/async.d.cts +186 -0
  68. package/dist/vue/async.d.ts +186 -0
  69. package/dist/vue/index.d.cts +271 -3
  70. package/dist/vue/index.d.ts +271 -3
  71. package/dist/vue-async.cjs +1 -1
  72. package/dist/vue-async.js +3 -3
  73. package/dist/vue.cjs +1 -1
  74. package/dist/vue.js +4 -4
  75. package/dist/worker.cjs +1 -1
  76. package/dist/worker.d.cts +2 -0
  77. package/dist/worker.d.ts +2 -0
  78. package/dist/worker.js +1 -1
  79. package/dist/xlsx.cjs +2 -30
  80. package/dist/xlsx.d.cts +268 -0
  81. package/dist/xlsx.d.ts +268 -0
  82. package/dist/xlsx.js +220 -23440
  83. package/package.json +1 -1
  84. package/dist/ReportPreview-DjGeWHY-.cjs +0 -6
  85. package/dist/progress-DD964VAB.js +0 -102
  86. package/dist/progress-KvhwXZ1Q.cjs +0 -1
  87. package/dist/render-plan-CckPEQyf.cjs +0 -1
  88. package/dist/render-plan-uzZYYSy1.js +0 -19
  89. package/dist/report-source-BXHNy_AD.js +0 -755
  90. package/dist/report-source-CCAvFE3t.cjs +0 -1
  91. package/dist/style-CpwiOPyB.cjs +0 -1
  92. package/dist/template-registry-DWExx0gU.cjs +0 -1
  93. package/dist/template-registry-NpOakidD.js +0 -354
  94. package/dist/textwrap-CnGsEum6.cjs +0 -4
package/dist/designer.js CHANGED
@@ -1,268 +1,285 @@
1
- import { defineComponent as Ce, openBlock as p, createElementBlock as y, Fragment as X, renderList as oe, toDisplayString as s, nextTick as Y, ref as D, watch as te, onMounted as Ee, onBeforeUnmount as be, computed as j, shallowRef as Ae, getCurrentInstance as Te, unref as e, createElementVNode as n, createVNode as q, normalizeClass as me, createTextVNode as P, createCommentVNode as H, withKeys as ge, withModifiers as De, withDirectives as fe, isRef as he, vModelSelect as $e, vModelText as _e, createBlock as ke } from "vue";
2
- import { provideMachReportConfig as je, createLocalFetcher as Ve, ReportPreview as Le } from "@agile-team/mach-report/vue";
3
- import { _ as Se, a as W } from "./_plugin-vue_export-helper-8SL1F89S.js";
4
- import { resolveGridLayout as pe, parseReportTemplate as U, serializeReportTemplate as ee, validateReportTemplateDocument as Re } from "@agile-team/mach-report";
5
- const Be = ["aria-label"], Pe = ["data-align", "aria-label", "title", "aria-checked", "tabindex", "onClick", "onKeydown"], Oe = { key: 0 }, Ie = {
6
- key: 1,
7
- viewBox: "0 0 20 20",
8
- fill: "none",
9
- "aria-hidden": "true"
10
- }, Je = {
11
- key: 0,
12
- d: "M3 4h14M3 8h9M3 12h14M3 16h9"
13
- }, Ne = {
14
- key: 1,
15
- d: "M3 4h14M6 8h8M3 12h14M6 16h8"
16
- }, Ge = {
17
- key: 2,
18
- d: "M3 4h14M8 8h9M3 12h14M8 16h9"
19
- }, He = {
20
- key: 3,
21
- d: "M3 4h14M3 8h14M3 12h14M3 16h14"
22
- }, Ue = /* @__PURE__ */ Ce({
23
- __name: "AlignmentControl",
24
- props: {
25
- modelValue: {},
26
- label: {},
27
- labels: {},
28
- autoLabel: {},
29
- allowAuto: { type: Boolean }
30
- },
31
- emits: ["update:modelValue"],
32
- setup(r, { emit: w }) {
33
- const c = r, g = w, u = () => c.allowAuto ? ["auto", "left", "center", "right", "justify"] : ["left", "center", "right", "justify"];
34
- async function i(b, $) {
35
- if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(b.key)) return;
36
- b.preventDefault();
37
- const _ = u(), k = _.indexOf($), C = b.key === "Home" ? 0 : b.key === "End" ? _.length - 1 : (k + (b.key === "ArrowRight" ? 1 : -1) + _.length) % _.length;
38
- g("update:modelValue", _[C]);
39
- const A = b.currentTarget.parentElement;
40
- await Y(), A?.querySelector(`[data-align="${_[C]}"]`)?.focus();
41
- }
42
- return (b, $) => (p(), y("div", {
43
- class: "mr-designer-alignment",
44
- role: "radiogroup",
45
- "aria-label": r.label
46
- }, [
47
- (p(!0), y(X, null, oe(u(), (m) => (p(), y("button", {
48
- key: m,
49
- type: "button",
50
- role: "radio",
51
- "data-align": m,
52
- "aria-label": r.labels[m],
53
- title: r.labels[m],
54
- "aria-checked": r.modelValue === m,
55
- tabindex: r.modelValue === m ? 0 : -1,
56
- onClick: (_) => g("update:modelValue", m),
57
- onKeydown: (_) => i(_, m)
58
- }, [
59
- m === "auto" ? (p(), y("span", Oe, s(r.autoLabel), 1)) : (p(), y("svg", Ie, [
60
- m === "left" ? (p(), y("path", Je)) : m === "center" ? (p(), y("path", Ne)) : m === "right" ? (p(), y("path", Ge)) : (p(), y("path", He))
61
- ]))
62
- ], 40, Pe))), 128))
63
- ], 8, Be));
64
- }
65
- }), we = /* @__PURE__ */ Se(Ue, [["__scopeId", "data-v-c85770c4"]]);
66
- function Fe(r, w, c) {
67
- if (!r.length) return;
68
- const g = Math.max(0, r.indexOf(w)), i = {
69
- ArrowDown: Math.min(g + 1, r.length - 1),
70
- ArrowUp: Math.max(g - 1, 0),
71
- Home: 0,
72
- End: r.length - 1
73
- }[c];
74
- return i === void 0 ? void 0 : r[i];
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;
75
15
  }
76
- function ze(r, w, c) {
77
- const g = D(!1), u = D(r.activeIndex.value), i = D(null), b = D(null), $ = D(null), m = D(null);
78
- function _(f = !1) {
79
- const o = m.value, d = o?.querySelector(
80
- `button[data-column-index="${u.value}"]`
81
- );
82
- if (!o || !d) return;
83
- f && d.focus({ preventScroll: !0 });
84
- const v = o.getBoundingClientRect(), h = d.getBoundingClientRect(), x = v.top + o.clientTop, t = x + o.clientHeight;
85
- h.top < x ? o.scrollTop += h.top - x : h.bottom > t && (o.scrollTop += h.bottom - t);
86
- }
87
- async function k(f = !1) {
88
- g.value && (g.value = !1, f && (await Y(), i.value?.focus({ preventScroll: !0 })));
89
- }
90
- async function C() {
91
- if (g.value) return k(!0);
92
- const f = c.value.map((o) => o.index);
93
- u.value = f.includes(r.activeIndex.value) ? r.activeIndex.value : f[0] ?? -1, g.value = !0, await Y(), $.value?.focus({ preventScroll: !0 }), _();
94
- }
95
- function A(f) {
96
- r.activate(f), k(!0);
97
- }
98
- function S(f) {
99
- g.value && (f.preventDefault(), f.stopPropagation(), k(!0));
100
- }
101
- async function G(f) {
102
- const o = Fe(
103
- c.value.map((d) => d.index),
104
- u.value,
105
- f.key
106
- );
107
- o !== void 0 && (u.value = o, f.preventDefault(), await Y(), _(!0));
108
- }
109
- async function Z(f) {
110
- if (!["ArrowDown", "ArrowUp", "Enter"].includes(f.key)) return;
111
- f.preventDefault(), f.stopPropagation();
112
- const o = c.value.map((d) => d.index);
113
- if (o.length) {
114
- if (f.key === "Enter") {
115
- o.includes(u.value) && A(u.value);
116
- return;
117
- }
118
- f.key === "ArrowUp" && (u.value = o.at(-1)), await Y(), _(!0);
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"
119
54
  }
120
- }
121
- function O(f) {
122
- const o = f.target;
123
- !g.value || b.value?.contains(o) || i.value?.contains(o) || k();
124
- }
125
- function V(f) {
126
- const o = f.relatedTarget;
127
- !o || b.value?.contains(o) || i.value?.contains(o) || k();
128
- }
129
- return te(c, (f) => {
130
- f.some((o) => o.index === u.value) || (u.value = f[0]?.index ?? -1);
131
- }), te(w, () => {
132
- k();
133
- }), Ee(() => document.addEventListener("pointerdown", O)), be(() => document.removeEventListener("pointerdown", O)), {
134
- open: g,
135
- cursor: u,
136
- trigger: i,
137
- panel: b,
138
- search: $,
139
- list: m,
140
- toggle: C,
141
- close: k,
142
- choose: A,
143
- escape: S,
144
- navigate: G,
145
- searchKeydown: Z,
146
- leave: V
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>')}`
147
61
  };
148
62
  }
149
- function Ke(r, w, c, g) {
150
- const u = D(0), i = D(""), b = D([]), $ = j(() => r.value.template.pages.flatMap((o, d) => o.components.flatMap((v, h) => v.kind === "list" ? [{ component: v, pageIndex: d, componentIndex: h }] : []))), m = j(() => $.value[u.value]?.component), _ = j(() => {
151
- const o = m.value;
152
- if (!o) return [];
153
- const d = o.columns.map((v) => v.headerStyle?.align ?? v.headerAlign ?? o.headerStyle?.align ?? o.headerAlign ?? v.style?.align ?? "center");
154
- if (o.headerGrid && w())
155
- for (const v of pe(o.headerGrid, o.widthMm, 100).cells)
156
- for (let h = v.ci; h < v.ci + (v.cell.colSpan ?? 1); h++) d[h] = v.cell.style?.align ?? "left";
157
- return d;
158
- }), k = j(() => {
159
- const o = i.value.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);
160
- return (m.value?.columns ?? []).flatMap((d, v) => {
161
- const h = `${d.header} ${d.field}`.toLocaleLowerCase();
162
- return o.every((x) => h.includes(x)) ? [{ column: d, index: v }] : [];
163
- });
164
- });
165
- function C(o, d) {
166
- b.value = d ? [.../* @__PURE__ */ new Set([...b.value, o])] : b.value.filter((v) => v !== o);
167
- }
168
- function A(o) {
169
- for (const d of k.value) C(d.index, o);
170
- }
171
- function S() {
172
- b.value = [];
173
- }
174
- function G(o, d, v) {
175
- if (!c()) return;
176
- const h = m.value?.columns[o];
177
- h && (Object.assign(h, { [d]: d === "widthMm" ? Number(v) : v }), d === "header" && O(o, String(v)), d === "headerAlign" && V(o, v), d === "widthMm" && Z(), g());
178
- }
179
- function Z() {
180
- const o = $.value[u.value];
181
- if (!o) return;
182
- const d = o.component, v = r.value.template.pages[o.pageIndex], h = d.columns.map((x) => x.widthMm);
183
- d.headerGrid && (d.headerGrid.colWidthsMm = h), v.layout === "wide" && h.every((x) => Number.isFinite(x) && x > 0) && (d.widthMm = h.reduce((x, t) => x + t, 0), v.widthMm = Math.max(...v.components.map((x) => x.leftMm + x.widthMm)) + (v.marginRightMm ?? 0));
184
- }
185
- function O(o, d) {
186
- const v = m.value;
187
- if (!v?.headerGrid) return;
188
- const x = pe(v.headerGrid, v.widthMm, 100).cells.filter(({ ci: t, cell: I }) => t <= o && t + (I.colSpan ?? 1) > o).slice(-1)[0];
189
- x && (Object.assign(x.cell, { text: d, rawText: d, value: d }), v.columns.slice(x.ci, x.ci + (x.cell.colSpan ?? 1)).forEach((t) => {
190
- t.header = d;
191
- }));
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
+ ));
192
92
  }
193
- function V(o, d) {
194
- const v = m.value, h = v?.columns[o];
195
- if (h?.headerStyle?.align !== void 0 && (h.headerStyle = { ...h.headerStyle, align: d }), !v?.headerGrid) return;
196
- const t = pe(v.headerGrid, v.widthMm, 100).cells.filter(({ ci: I, cell: R }) => I <= o && I + (R.colSpan ?? 1) > o).slice(-1)[0];
197
- t && (t.cell.style = { ...t.cell.style, align: d }, v.columns.slice(t.ci, t.ci + (t.cell.colSpan ?? 1)).forEach((I) => {
198
- I.headerAlign = d, I.headerStyle?.align !== void 0 && (I.headerStyle = { ...I.headerStyle, align: d });
199
- }));
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
+ );
200
107
  }
201
- function f(o, d) {
202
- if (!(!c() || o === "headerAlign" && d === "auto")) {
203
- for (const v of b.value) {
204
- const h = m.value?.columns[v];
205
- h && (Object.assign(h, { [o]: d }), o === "headerAlign" && V(v, d));
206
- }
207
- g();
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;
208
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;
209
204
  }
210
- return { selected: u, query: i, selectedColumns: b, lists: $, activeList: m, headerAlignments: _, visibleColumns: k, toggleColumn: C, selectVisible: A, clearSelection: S, setColumn: G, alignColumns: f };
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;
211
207
  }
212
- function qe(r, w = { entries: 100, bytes: 16 * 1024 * 1024 }) {
213
- const c = D([r]), g = D(0), u = j(() => g.value > 0), i = j(() => g.value + 1 < c.value.length), b = j(() => c.value[g.value]);
214
- function $(k) {
215
- c.value = [k], g.value = 0;
216
- }
217
- function m(k) {
218
- if (c.value[g.value] === k) return;
219
- const C = c.value.slice(0, g.value + 1);
220
- C.push(k);
221
- let A = C.reduce((S, G) => S + G.length * 2, 0);
222
- for (; C.length > 1 && (C.length > w.entries || A > w.bytes); ) A -= C.shift().length * 2;
223
- c.value = C, g.value = c.value.length - 1;
224
- }
225
- function _(k) {
226
- if (!(k < 0 ? !u.value : !i.value))
227
- return g.value += k, c.value[g.value];
228
- }
229
- return { canUndo: u, canRedo: i, current: b, reset: $, record: m, move: _ };
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;
230
219
  }
231
- function We(r) {
232
- const w = Ae(null), c = D(!1);
233
- let g, u = 0;
234
- function i(m) {
235
- g?.(m), g = void 0, w.value = null;
236
- }
237
- function b() {
238
- u++, i(!1), c.value = !1;
239
- }
240
- async function $(m) {
241
- b();
242
- const _ = u, k = r();
243
- c.value = !0;
244
- try {
245
- const C = await new Promise((A, S) => {
246
- if (g = A, !k) {
247
- w.value = m;
248
- return;
249
- }
250
- Promise.resolve().then(() => u === _ ? k(m) : !1).then((G) => {
251
- u === _ && i(G === !0);
252
- }, (G) => {
253
- u === _ && (g = void 0, w.value = null, S(G));
254
- });
255
- });
256
- return u === _ && C === !0;
257
- } finally {
258
- u === _ && (c.value = !1);
259
- }
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;
260
275
  }
261
- return be(b), { confirmation: w, pending: c, decide: i, request: $, cancel: b };
276
+ return Z(t.disabled, (r) => {
277
+ r && u?.();
278
+ }), Z(t.page, () => u?.()), $e(() => u?.()), { start: s };
262
279
  }
263
- const Qe = {
264
- title: "报表模板属性编辑器",
265
- heading: "模板属性",
280
+ const Et = {
281
+ title: "报表模板设计器",
282
+ heading: "模板设计",
266
283
  unpublished: "未发布",
267
284
  dirty: "有未保存修改",
268
285
  reset: "恢复草稿",
@@ -293,7 +310,65 @@ const Qe = {
293
310
  applyJson: "校验并应用 JSON",
294
311
  note: "字段映射应与数据源契约一致。此编辑器维护模板属性;保存由接入方提供的版本服务处理。",
295
312
  invalid: "请先修正模板错误,再预览或保存。"
296
- }, Xe = {
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: "请先在字段区域选择明细表。",
297
372
  undo: "撤销",
298
373
  redo: "重做",
299
374
  columnsSearch: "搜索列名或字段",
@@ -335,16 +410,1047 @@ const Qe = {
335
410
  technicalDetails: "标识与修订",
336
411
  fieldPosition: "当前字段",
337
412
  previewFieldDirectory: "定位字段"
338
- }, Ye = {
339
- ...Qe,
340
- ...Xe
341
- };
342
- function Ze(r, w) {
343
- const c = D(U(r.modelValue)), g = D(ee(c.value)), u = D(ee(c.value)), i = D(""), b = D(!1), $ = j(() => ({ ...Ye, ...r.messages })), m = j(() => ({
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(() => ({
344
1450
  showExport: !1,
345
1451
  showPrint: !1,
346
1452
  showPdfWindow: !1,
347
- ...r.preview,
1453
+ ...t.preview,
348
1454
  theme: {
349
1455
  shellBg: "#f1f5f9",
350
1456
  shellFg: "#334155",
@@ -356,312 +1462,488 @@ function Ze(r, w) {
356
1462
  btnHoverBg: "#eff6ff",
357
1463
  btnHoverFg: "#1d4ed8",
358
1464
  btnActiveBg: "#2563eb",
359
- ...r.preview?.theme
1465
+ ...t.preview?.theme
360
1466
  }
361
1467
  }));
362
- je({ get defaults() {
363
- return m.value;
364
- } });
365
- let _, k = 0;
366
- const C = j(() => Re(c.value)), A = j(() => {
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(() => {
367
1477
  try {
368
- return ee(c.value) !== g.value;
1478
+ return me(s.value) !== r.value;
369
1479
  } catch {
370
1480
  return !0;
371
1481
  }
372
- }), S = D(u.value), G = j(() => u.value !== S.value), Z = j(() => A.value || u.value !== S.value), O = () => JSON.stringify({ document: c.value, json: u.value, appliedJson: S.value }), V = qe(O()), f = We(() => r.beforeDiscard), o = j(() => b.value || f.pending.value), d = () => !r.readonly && !o.value && !G.value, v = Ke(c, () => C.value.ok, d, ne), { selected: h, lists: x, activeList: t, headerAlignments: I, setColumn: R } = v;
373
- te(h, () => v.clearSelection());
374
- const Q = j(() => C.value.ok ? Ve({ draft: { template: c.value.template, datasets: r.datasets ?? {}, params: [] } }) : void 0);
375
- function T() {
376
- k++, _?.abort(), _ = void 0, b.value = !1;
377
- }
378
- let F = 0;
379
- async function z(M = "replace", L) {
380
- if (!Z.value) return !0;
381
- const E = O();
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;
1506
+ }
1507
+ let $ = 0;
1508
+ async function L(V = "replace", j) {
1509
+ if (!f.value) return !0;
1510
+ const J = I();
382
1511
  try {
383
- return await f.request({
384
- reason: M,
385
- document: JSON.parse(JSON.stringify(c.value)),
386
- replacement: L ? U(L) : 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,
387
1518
  pendingLocalChanges: !0
388
- }) && E === O();
389
- } catch (K) {
390
- return i.value = K instanceof Error ? K.message : String(K), !1;
1519
+ }) && J === I();
1520
+ } catch (ne) {
1521
+ return b.value = ne instanceof Error ? ne.message : String(ne), !1;
391
1522
  }
392
1523
  }
393
- function se(M) {
394
- T(), c.value = M, g.value = ee(M), u.value = g.value, S.value = u.value, i.value = "", h.value = 0, v.clearSelection(), V.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());
395
1526
  }
396
- te(() => r.modelValue, async (M) => {
397
- let L;
398
- try {
399
- L = U(M);
400
- } catch (K) {
401
- i.value = K instanceof Error ? K.message : String(K);
402
- 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);
403
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;
404
1557
  try {
405
- if (ee(L) === ee(c.value)) return;
406
- } 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;
407
1569
  }
408
- const E = ++F;
409
- if (T(), !await z("replace", L)) {
410
- E === F && C.value.ok && w("update:modelValue", U(c.value));
411
- 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;
412
1578
  }
413
- E === F && se(L);
414
- }), be(() => {
415
- F++, T();
416
- });
417
- function ne() {
418
- f.cancel(), i.value = "", C.value.ok && (u.value = ee(c.value), S.value = u.value, w("update:modelValue", U(c.value))), V.record(O());
419
1579
  }
420
- function ae(M) {
421
- d() && (c.value.name = M, ne());
1580
+ function Ce(V) {
1581
+ M() && (s.value.name = V, H());
422
1582
  }
423
- function B(M) {
424
- d() && (c.value.description = M, ne());
1583
+ function Ae(V) {
1584
+ M() && (s.value.description = V, H());
425
1585
  }
426
- function ie() {
427
- if (!(r.readonly || o.value))
1586
+ function pe() {
1587
+ if (!(t.readonly || c.value))
428
1588
  try {
429
- const M = U(u.value);
430
- if (M.id !== c.value.id) throw new Error("属性编辑不允许更换模板 ID,请另存为新模板");
431
- if (M.revision !== c.value.revision) throw new Error("修订号由保存服务管理,不能在 JSON 中修改");
432
- c.value = M, h.value = 0, v.clearSelection(), ne();
433
- } catch (M) {
434
- i.value = M instanceof Error ? M.message : String(M);
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);
435
1597
  }
436
1598
  }
437
- async function ue() {
438
- o.value || r.readonly || !await z("reset") || (se(U(g.value)), w("update:modelValue", U(c.value)));
1599
+ async function se() {
1600
+ c.value || t.readonly || !await L("reset") || (R(Y(r.value)), u("update:modelValue", Y(s.value)));
439
1601
  }
440
- function re(M) {
441
- if (o.value || r.readonly) return;
442
- V.record(O());
443
- const L = V.move(M);
444
- if (!L) return;
445
- f.cancel();
446
- const E = JSON.parse(L);
447
- c.value = E.document, u.value = E.json, S.value = E.appliedJson, i.value = "", h.value = 0, v.clearSelection(), C.value.ok && w("update:modelValue", U(c.value));
448
- }
449
- async function de() {
450
- if (!r.save || !d() || !C.value.ok) return;
451
- const M = ++k;
452
- _ = new AbortController(), b.value = !0, i.value = "";
453
- const L = U(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));
1610
+ }
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);
454
1616
  try {
455
- const E = U(await r.save(L, { expectedRevision: L.revision, signal: _.signal }));
456
- if (M !== k) return;
457
- if (E.id !== L.id) throw new Error("保存服务返回了其他模板的文档");
458
- c.value = E, g.value = ee(E), u.value = g.value, S.value = u.value, V.reset(O()), w("saved", U(E)), w("update:modelValue", U(E));
459
- } catch (E) {
460
- M === k && (i.value = E instanceof Error ? E.message : String(E));
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));
461
1629
  } finally {
462
- M === k && (b.value = !1, _ = void 0);
1630
+ V === C && (m.value = !1, w = void 0);
463
1631
  }
464
1632
  }
465
- const ce = j(() => V.canUndo.value || O() !== V.current.value), ve = j(() => V.canRedo.value && O() === V.current.value);
466
- return { ...v, canUndo: ce, canRedo: ve, undo: () => re(-1), redo: () => re(1), pendingLocalChanges: Z, jsonPending: G, blocked: o, confirmation: f.confirmation, decideDiscard: f.decide, guardChanges: z, draft: c, json: u, selected: h, error: i, saving: b, dirty: A, validation: C, lists: x, activeList: t, headerAlignments: I, previewOptions: m, fetcher: Q, messages: $, setName: ae, setDescription: B, setColumn: R, applyJson: ie, reset: ue, save: de };
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
+ };
467
1674
  }
468
- function et(r, w) {
469
- const c = D("fields"), g = () => w.value?.columns.length ? 0 : -1, u = D(g()), i = j(() => {
470
- const m = w.value?.columns[u.value];
471
- return m ? { column: m, index: u.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;
472
1679
  });
473
- te(r, () => {
474
- u.value = g();
475
- }), te(w, (m) => {
476
- m?.columns[u.value] || (u.value = g());
1680
+ Z(t, () => {
1681
+ o.value = r();
1682
+ }), Z(u, (d) => {
1683
+ d?.columns[o.value] || (o.value = r());
477
1684
  });
478
- function b(m) {
479
- w.value?.columns[m] && (u.value = m);
1685
+ function m(d) {
1686
+ u.value?.columns[d] && (o.value = d);
480
1687
  }
481
- function $(m) {
482
- const _ = w.value?.columns.length ?? 0;
483
- _ && (u.value = Math.max(
1688
+ function _(d) {
1689
+ const w = u.value?.columns.length ?? 0;
1690
+ w && (o.value = Math.max(
484
1691
  0,
485
- Math.min(_ - 1, u.value + m)
1692
+ Math.min(w - 1, o.value + d)
486
1693
  ));
487
1694
  }
488
- return { section: c, activeIndex: u, activeColumn: i, activate: b, stepColumn: $ };
1695
+ return { section: s, activeIndex: o, activeColumn: b, activate: m, stepColumn: _ };
489
1696
  }
490
- const tt = ["aria-label", "aria-busy"], nt = { class: "mr-designer-bar" }, lt = { class: "mr-designer-heading" }, at = ["aria-label"], ot = ["id", "aria-selected", "aria-controls", "tabindex", "onClick"], st = { class: "mr-designer-actions" }, it = { class: "mr-designer-history" }, rt = ["aria-label", "title", "disabled"], ut = ["aria-label", "title", "disabled"], dt = ["disabled"], ct = ["disabled"], vt = ["aria-label"], mt = { class: "mr-designer-body" }, gt = { class: "mr-designer-inspector" }, ft = ["id", "aria-labelledby"], ht = {
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 = {
1698
+ key: 0,
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 = {
1707
+ key: 1,
1708
+ class: "mr-designer-inspector"
1709
+ }, ho = ["id", "aria-labelledby"], go = {
491
1710
  key: 0,
492
1711
  class: "mr-designer-area"
493
- }, pt = ["value"], bt = { class: "mr-designer-current" }, yt = ["aria-expanded", "aria-controls"], _t = { class: "mr-designer-current-name" }, kt = { class: "mr-designer-directory-entry" }, wt = { class: "mr-designer-field-position" }, Ct = ["aria-label"], St = ["aria-label", "title", "disabled"], xt = ["aria-label", "title", "disabled"], Mt = ["disabled", "aria-label"], Et = { class: "mr-designer-property-group" }, At = ["value"], Tt = ["value"], Dt = { class: "mr-designer-property-group" }, $t = { class: "mr-designer-format-pair" }, jt = { class: "mr-designer-stacked" }, Vt = ["value"], Lt = { class: "mr-designer-stacked" }, Rt = ["value"], Bt = { value: "identifier" }, Pt = { value: "dimension" }, Ot = { value: "measure" }, It = { value: "date" }, Jt = { value: "text" }, Nt = { class: "mr-designer-control-row" }, Gt = { class: "mr-designer-control-row" }, Ht = { class: "mr-designer-toggle" }, Ut = ["checked"], Ft = ["id", "aria-label"], zt = { class: "mr-designer-directory-heading" }, Kt = ["aria-label"], qt = { class: "mr-designer-search" }, Wt = ["aria-label", "placeholder"], Qt = ["aria-label", "title"], Xt = { class: "mr-designer-column-tools" }, Yt = ["disabled"], Zt = {
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 = {
494
1713
  key: 1,
495
1714
  role: "status"
496
- }, en = { key: 2 }, tn = ["aria-label"], nn = ["aria-label", "checked", "disabled", "onChange"], ln = ["data-column-index", "aria-pressed", "tabindex", "onClick"], an = { class: "mr-designer-column-number" }, on = { class: "mr-designer-column-name" }, sn = {
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 = {
497
1716
  key: 0,
498
1717
  role: "status",
499
1718
  class: "mr-designer-empty"
500
- }, rn = {
1719
+ }, va = {
501
1720
  key: 0,
502
1721
  class: "mr-designer-batch"
503
- }, un = ["aria-label", "disabled"], dn = { value: "" }, cn = { value: "auto" }, vn = { value: "left" }, mn = { value: "center" }, gn = { value: "right" }, fn = { value: "justify" }, hn = ["aria-label", "disabled"], pn = { value: "" }, bn = { value: "left" }, yn = { value: "center" }, _n = { value: "right" }, kn = { value: "justify" }, wn = {
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 = {
504
1723
  key: 2,
505
1724
  role: "status",
506
1725
  class: "mr-designer-empty"
507
- }, Cn = { class: "mr-designer-stacked" }, Sn = ["value", "disabled"], xn = { class: "mr-designer-stacked" }, Mn = ["value", "disabled"], En = { class: "mr-designer-technical" }, An = { class: "mr-designer-identity" }, Tn = { class: "mr-designer-stacked mr-designer-json-label" }, Dn = ["aria-label", "disabled"], $n = ["disabled"], jn = {
508
- 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,
509
1734
  role: "status",
510
1735
  class: "mr-designer-note mr-designer-pending"
511
- }, Vn = ["aria-label"], Ln = {
1736
+ }, ol = ["aria-label"], al = {
512
1737
  key: 0,
513
1738
  role: "alert",
514
1739
  class: "mr-designer-error"
515
- }, Rn = {
1740
+ }, ll = {
516
1741
  key: 1,
517
1742
  role: "alert",
518
1743
  class: "mr-designer-error"
519
- }, Bn = {
520
- key: 3,
1744
+ }, sl = {
1745
+ key: 4,
521
1746
  class: "mr-designer-note mr-designer-invalid"
522
- }, Pn = /* @__PURE__ */ Ce({
1747
+ }, il = /* @__PURE__ */ Ee({
523
1748
  __name: "ReportTemplateEditor",
524
1749
  props: {
525
1750
  modelValue: {},
526
1751
  datasets: {},
1752
+ dataSchemas: {},
1753
+ bindingDatasets: {},
1754
+ bindingSession: {},
527
1755
  readonly: { type: Boolean },
528
1756
  messages: {},
529
1757
  preview: {},
530
1758
  beforeDiscard: { type: Function },
531
1759
  save: { type: Function }
532
1760
  },
533
- emits: ["update:modelValue", "saved"],
534
- setup(r, { expose: w, emit: c }) {
535
- const g = r, u = c, i = Ze(g, (J, a) => {
536
- u(J === "saved" ? "saved" : "update:modelValue", a);
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);
537
1769
  }), {
538
- draft: b,
539
- json: $,
540
- selected: m,
541
- error: _,
542
- saving: k,
543
- pendingLocalChanges: C,
544
- jsonPending: A,
545
- blocked: S,
546
- confirmation: G,
547
- canUndo: Z,
548
- canRedo: O,
549
- validation: V,
550
- lists: f,
551
- activeList: o,
552
- visibleColumns: d,
553
- query: v,
554
- selectedColumns: h,
555
- fetcher: x,
556
- messages: t
557
- } = i, I = et(m, o), { section: R, activeIndex: Q, activeColumn: T } = I, F = `mr-designer-${Te()?.uid ?? 0}`, z = ["fields", "template", "advanced"], se = j(
558
- () => k.value ? t.value.saving : g.readonly ? t.value.readonly : C.value ? t.value.dirty : t.value.ready
559
- ), ne = D(null), ae = D(null), B = ze(I, R, d), {
560
- open: ie,
561
- cursor: ue,
562
- trigger: re,
563
- panel: de,
564
- search: ce,
565
- list: ve
566
- } = B;
567
- te(R, async () => {
568
- await Y(), ae.value && (ae.value.scrollTop = 0);
1770
+ draft: w,
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(
1796
+ d,
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);
569
1829
  });
570
- const M = j(() => ({
571
- auto: t.value.auto,
572
- left: t.value.left,
573
- center: t.value.center,
574
- right: t.value.right,
575
- justify: t.value.justify
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
576
1836
  }));
577
- let L = null;
578
- te(G, async (J) => {
579
- J ? (L = document.activeElement, await Y(), ne.value?.focus()) : (await Y(), L?.isConnected && L.focus(), L = null);
580
- }), w({
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({
581
1841
  get pendingLocalChanges() {
582
- return C.value;
1842
+ return g.value;
583
1843
  },
584
1844
  get saving() {
585
- return k.value;
1845
+ return A.value;
586
1846
  },
587
1847
  get blocked() {
588
- return S.value;
1848
+ return I.value;
589
1849
  },
590
- guardChanges: i.guardChanges,
591
- reset: i.reset,
592
- save: i.save
1850
+ guardChanges: d.guardChanges,
1851
+ reset: d.reset,
1852
+ save: d.save
593
1853
  });
594
- function E(J) {
595
- return J.target.value;
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 } } });
596
1859
  }
597
- function K(J) {
598
- return J.target.checked;
1860
+ function ge(X) {
1861
+ return X.target.value;
599
1862
  }
600
- function ye(J, a) {
601
- const l = J.target;
602
- i.alignColumns(
603
- a,
604
- l.value
605
- ), l.value = "";
1863
+ function Ve(X) {
1864
+ return X.target.checked;
606
1865
  }
607
- async function xe(J) {
608
- 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 = {
609
1875
  ArrowRight: 1,
610
1876
  ArrowLeft: -1,
611
- Home: -z.length,
612
- End: z.length
613
- }[J.key];
614
- if (l === void 0) return;
615
- J.preventDefault();
616
- const N = z.indexOf(R.value), le = J.key === "Home" ? 0 : J.key === "End" ? z.length - 1 : (N + l + z.length) % z.length;
617
- R.value = z[le];
618
- const Me = J.currentTarget.parentElement;
619
- await Y(), Me?.querySelector(`#${F}-tab-${R.value}`)?.focus();
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();
620
1886
  }
621
- return (J, a) => (p(), y("section", {
1887
+ return (X, v) => (h(), y("section", {
622
1888
  class: "mr-designer",
623
- "aria-label": e(t).title,
624
- "aria-busy": e(k)
1889
+ "aria-label": e(a).title,
1890
+ "aria-busy": e(A)
625
1891
  }, [
626
- n("header", nt, [
627
- n("div", lt, [
628
- q(W, {
1892
+ n("header", Un, [
1893
+ n("div", Jn, [
1894
+ Q(oe, {
629
1895
  name: "columns",
630
1896
  size: 15
631
1897
  }),
632
- n("strong", null, s(e(t).heading), 1),
1898
+ n("strong", null, l(e(a).heading), 1),
633
1899
  n("span", {
634
- class: me({ "mr-designer-dirty": e(C) })
635
- }, s(se.value), 3)
1900
+ class: _e({ "mr-designer-dirty": e(g) })
1901
+ }, l(st.value), 3)
636
1902
  ]),
637
1903
  n("nav", {
638
1904
  class: "mr-designer-tabs",
639
1905
  role: "tablist",
640
- "aria-label": e(t).sectionsLabel
1906
+ "aria-label": e(a).sectionsLabel
641
1907
  }, [
642
- (p(), y(X, null, oe(z, (l) => n("button", {
643
- id: `${F}-tab-${l}`,
644
- key: l,
1908
+ (h(), y(U, null, W(K, (i) => n("button", {
1909
+ id: `${H}-tab-${i}`,
1910
+ key: i,
645
1911
  type: "button",
646
1912
  role: "tab",
647
- "aria-selected": e(R) === l,
648
- "aria-controls": `${F}-panel-${l}`,
649
- tabindex: e(R) === l ? 0 : -1,
650
- onClick: (N) => R.value = l,
651
- onKeydown: xe
652
- }, s(e(t)[`${l}Section`]), 41, ot)), 64))
653
- ], 8, at),
654
- n("div", st, [
655
- n("div", it, [
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, [
656
1938
  n("button", {
657
1939
  type: "button",
658
1940
  class: "mr-designer-icon-button",
659
- "aria-label": e(t).undo,
660
- title: e(t).undo,
661
- disabled: r.readonly || e(S) || !e(Z),
662
- onClick: a[0] || (a[0] = //@ts-ignore
663
- (...l) => e(i).undo && e(i).undo(...l))
664
- }, [...a[34] || (a[34] = [
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] = [
665
1947
  n("svg", {
666
1948
  viewBox: "0 0 24 24",
667
1949
  fill: "none",
@@ -669,16 +1951,16 @@ const tt = ["aria-label", "aria-busy"], nt = { class: "mr-designer-bar" }, lt =
669
1951
  }, [
670
1952
  n("path", { d: "M4 10h10a6 6 0 0 1 0 12M4 10l5-5M4 10l5 5" })
671
1953
  ], -1)
672
- ])], 8, rt),
1954
+ ])], 8, eo),
673
1955
  n("button", {
674
1956
  type: "button",
675
1957
  class: "mr-designer-icon-button",
676
- "aria-label": e(t).redo,
677
- title: e(t).redo,
678
- disabled: r.readonly || e(S) || !e(O),
679
- onClick: a[1] || (a[1] = //@ts-ignore
680
- (...l) => e(i).redo && e(i).redo(...l))
681
- }, [...a[35] || (a[35] = [
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] = [
682
1964
  n("svg", {
683
1965
  viewBox: "0 0 24 24",
684
1966
  fill: "none",
@@ -686,492 +1968,938 @@ const tt = ["aria-label", "aria-busy"], nt = { class: "mr-designer-bar" }, lt =
686
1968
  }, [
687
1969
  n("path", { d: "M20 10H10a6 6 0 0 0 0 12m10-12-5-5m5 5-5 5" })
688
1970
  ], -1)
689
- ])], 8, ut)
1971
+ ])], 8, to)
690
1972
  ]),
691
1973
  n("button", {
692
1974
  type: "button",
693
1975
  class: "mr-designer-reset",
694
- disabled: r.readonly || e(S) || !e(C),
695
- onClick: a[2] || (a[2] = //@ts-ignore
696
- (...l) => e(i).reset && e(i).reset(...l))
697
- }, s(e(t).reset), 9, dt),
698
- r.save ? (p(), y("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", {
699
1981
  key: 0,
700
1982
  type: "button",
701
1983
  class: "mr-designer-save",
702
- disabled: r.readonly || e(S) || e(A) || !e(V).ok || !e(C),
703
- onClick: a[3] || (a[3] = //@ts-ignore
704
- (...l) => e(i).save && e(i).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))
705
1987
  }, [
706
- q(W, {
1988
+ Q(oe, {
707
1989
  name: "file",
708
1990
  size: 13
709
1991
  }),
710
- P(s(e(k) ? e(t).saving : e(t).save), 1)
711
- ], 8, ct)) : H("", !0)
1992
+ P(l(e(A) ? e(a).saving : e(a).save), 1)
1993
+ ], 8, oo)) : B("", !0)
712
1994
  ])
713
1995
  ]),
714
- e(G) ? (p(), y("div", {
1996
+ e(k) ? (h(), y("div", {
715
1997
  key: 0,
716
1998
  role: "alertdialog",
717
- "aria-label": e(t).discardTitle,
1999
+ "aria-label": e(a).discardTitle,
718
2000
  class: "mr-designer-confirm",
719
- onKeydown: a[6] || (a[6] = ge(De((l) => e(i).decideDiscard(!1), ["prevent", "stop"]), ["esc"]))
2001
+ onKeydown: v[8] || (v[8] = Be(tt((i) => e(d).decideDiscard(!1), ["prevent", "stop"]), ["esc"]))
720
2002
  }, [
721
2003
  n("div", null, [
722
- n("strong", null, s(e(t).discardTitle), 1),
723
- n("p", null, s(e(t).discardDescription), 1)
2004
+ n("strong", null, l(e(a).discardTitle), 1),
2005
+ n("p", null, l(e(a).discardDescription), 1)
724
2006
  ]),
725
2007
  n("div", null, [
726
2008
  n("button", {
727
2009
  ref_key: "keepButton",
728
- ref: ne,
2010
+ ref: Je,
729
2011
  type: "button",
730
- onClick: a[4] || (a[4] = (l) => e(i).decideDiscard(!1))
731
- }, s(e(t).keepEditing), 513),
2012
+ onClick: v[6] || (v[6] = (i) => e(d).decideDiscard(!1))
2013
+ }, l(e(a).keepEditing), 513),
732
2014
  n("button", {
733
2015
  type: "button",
734
- onClick: a[5] || (a[5] = (l) => e(i).decideDiscard(!0))
735
- }, s(e(t).discard), 1)
2016
+ onClick: v[7] || (v[7] = (i) => e(d).decideDiscard(!0))
2017
+ }, l(e(a).discard), 1)
736
2018
  ])
737
- ], 40, vt)) : H("", !0),
738
- n("div", mt, [
739
- n("aside", gt, [
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, [
2024
+ n("nav", {
2025
+ class: "mr-designer-tool-tabs",
2026
+ "aria-label": e(a).toolsSection
2027
+ }, [
2028
+ (h(), y(U, null, W(["excel", "rules", "review"], (i) => n("button", {
2029
+ key: i,
2030
+ type: "button",
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, [
740
2089
  n("div", {
741
2090
  ref_key: "inspectorPanel",
742
- ref: ae,
743
- id: `${F}-panel-${e(R)}`,
744
- class: me(["mr-designer-panel", { "is-advanced": e(R) === "advanced" }]),
2091
+ ref: He,
2092
+ id: `${H}-panel-${e($)}`,
2093
+ class: _e(["mr-designer-panel", { "is-advanced": e($) === "advanced" }]),
745
2094
  role: "tabpanel",
746
- "aria-labelledby": `${F}-tab-${e(R)}`
2095
+ "aria-labelledby": `${H}-tab-${e($)}`
747
2096
  }, [
748
- e(R) === "fields" ? (p(), y(X, { key: 0 }, [
749
- e(f).length > 1 ? (p(), y("label", ht, [
750
- P(s(e(t).area), 1),
751
- fe(n("select", {
752
- "onUpdate:modelValue": a[7] || (a[7] = (l) => he(m) ? m.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)
753
2102
  }, [
754
- (p(!0), y(X, null, oe(e(f), (l, N) => (p(), y("option", {
755
- key: N,
756
- value: N
757
- }, s(l.pageIndex + 1) + " " + s(e(t).page) + " · " + s(l.component.title || l.component.dataset), 9, pt))), 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))
758
2107
  ], 512), [
759
- [$e, e(m)]
2108
+ [ye, e(E)]
760
2109
  ])
761
- ])) : H("", !0),
762
- e(o) ? (p(), y(X, { key: 1 }, [
763
- n("div", bt, [
2110
+ ])) : B("", !0),
2111
+ e(x) ? (h(), y(U, { key: 1 }, [
2112
+ n("div", bo, [
764
2113
  n("button", {
765
2114
  ref_key: "directoryTrigger",
766
- ref: re,
2115
+ ref: rt,
767
2116
  type: "button",
768
2117
  class: "mr-designer-field-trigger",
769
- "aria-expanded": e(ie),
770
- "aria-controls": `${F}-directory`,
2118
+ "aria-expanded": e(Ke),
2119
+ "aria-controls": `${H}-directory`,
771
2120
  "aria-haspopup": "dialog",
772
- onClick: a[8] || (a[8] = //@ts-ignore
773
- (...l) => e(B).toggle && e(B).toggle(...l)),
774
- onKeydown: a[9] || (a[9] = ge(
2121
+ onClick: v[11] || (v[11] = //@ts-ignore
2122
+ (...i) => e(ee).toggle && e(ee).toggle(...i)),
2123
+ onKeydown: v[12] || (v[12] = Be(
775
2124
  //@ts-ignore
776
- (...l) => e(B).escape && e(B).escape(...l),
2125
+ (...i) => e(ee).escape && e(ee).escape(...i),
777
2126
  ["esc"]
778
2127
  ))
779
2128
  }, [
780
- n("span", _t, [
781
- n("strong", null, s(e(T)?.column.header || e(t).noColumns), 1),
782
- n("small", null, s(e(T)?.column.field || "—"), 1)
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)
783
2132
  ]),
784
- n("span", kt, [
785
- P(s(e(t).columnDirectory) + " ", 1),
786
- n("b", null, s(e(o).columns.length), 1),
787
- q(W, {
2133
+ n("span", ko, [
2134
+ P(l(e(a).columnDirectory) + " ", 1),
2135
+ n("b", null, l(e(x).columns.length), 1),
2136
+ Q(oe, {
788
2137
  name: "chevron-down",
789
2138
  size: 13
790
2139
  })
791
2140
  ])
792
- ], 40, yt),
793
- n("div", wt, [
2141
+ ], 40, yo),
2142
+ n("div", Mo, [
794
2143
  n("span", {
795
- "aria-label": e(t).fieldPosition
2144
+ "aria-label": e(a).fieldPosition
796
2145
  }, [
797
- P(s(e(Q) >= 0 ? e(Q) + 1 : 0), 1),
798
- a[36] || (a[36] = n("i", null, "/", -1)),
799
- P(s(e(o).columns.length), 1)
800
- ], 8, Ct),
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),
801
2150
  n("button", {
802
2151
  type: "button",
803
2152
  class: "mr-designer-icon-button",
804
- "aria-label": e(t).previousColumn,
805
- title: e(t).previousColumn,
806
- disabled: e(Q) <= 0,
807
- onClick: a[10] || (a[10] = (l) => e(I).stepColumn(-1))
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))
808
2157
  }, [
809
- q(W, {
2158
+ Q(oe, {
810
2159
  name: "chevron-left",
811
2160
  size: 14
812
2161
  })
813
- ], 8, St),
2162
+ ], 8, xo),
814
2163
  n("button", {
815
2164
  type: "button",
816
2165
  class: "mr-designer-icon-button",
817
- "aria-label": e(t).nextColumn,
818
- title: e(t).nextColumn,
819
- disabled: e(Q) >= e(o).columns.length - 1,
820
- onClick: a[11] || (a[11] = (l) => e(I).stepColumn(1))
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))
821
2170
  }, [
822
- q(W, {
2171
+ Q(oe, {
823
2172
  name: "chevron-right",
824
2173
  size: 14
825
2174
  })
826
- ], 8, xt)
2175
+ ], 8, _o)
827
2176
  ])
828
2177
  ]),
829
- e(T) ? (p(), y("fieldset", {
2178
+ e(R) ? (h(), y("fieldset", {
830
2179
  key: 0,
831
2180
  class: "mr-designer-properties",
832
- disabled: r.readonly || e(S) || e(A),
833
- "aria-label": e(t).columnProperties
2181
+ disabled: t.readonly || e(I) || e(f),
2182
+ "aria-label": e(a).columnProperties
834
2183
  }, [
835
- n("div", Et, [
836
- n("h3", null, s(e(t).contentGroup), 1),
2184
+ n("div", $o, [
2185
+ n("h3", null, l(e(a).contentGroup), 1),
837
2186
  n("label", null, [
838
- P(s(e(t).header), 1),
2187
+ P(l(e(a).header), 1),
839
2188
  n("input", {
840
- value: e(T).column.header,
841
- onInput: a[12] || (a[12] = (l) => e(i).setColumn(
842
- e(T).index,
2189
+ value: e(R).column.header,
2190
+ onInput: v[15] || (v[15] = (i) => e(d).setColumn(
2191
+ e(R).index,
843
2192
  "header",
844
- E(l)
2193
+ ge(i)
845
2194
  ))
846
- }, null, 40, At)
2195
+ }, null, 40, Eo)
847
2196
  ]),
848
2197
  n("label", null, [
849
- P(s(e(t).field), 1),
2198
+ P(l(e(a).field), 1),
850
2199
  n("input", {
851
- value: e(T).column.field,
852
- onChange: a[13] || (a[13] = (l) => e(i).setColumn(
853
- e(T).index,
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,
854
2204
  "field",
855
- E(l)
2205
+ ge(i)
856
2206
  ))
857
- }, null, 40, Tt)
858
- ])
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)
859
2218
  ]),
860
- n("div", Dt, [
861
- n("h3", null, s(e(t).formatGroup), 1),
862
- n("div", $t, [
863
- n("label", jt, [
864
- P(s(e(t).width), 1),
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),
865
2224
  n("input", {
866
2225
  type: "number",
867
2226
  min: "0.1",
868
2227
  step: "0.5",
869
- value: e(T).column.widthMm,
870
- onChange: a[14] || (a[14] = (l) => e(i).setColumn(
871
- e(T).index,
2228
+ value: e(R).column.widthMm,
2229
+ onChange: v[17] || (v[17] = (i) => e(d).setColumn(
2230
+ e(R).index,
872
2231
  "widthMm",
873
- E(l)
2232
+ ge(i)
874
2233
  ))
875
- }, null, 40, Vt)
2234
+ }, null, 40, Go)
876
2235
  ]),
877
- n("label", Lt, [
878
- P(s(e(t).semantic), 1),
2236
+ n("label", Po, [
2237
+ P(l(e(a).semantic), 1),
879
2238
  n("select", {
880
- value: e(T).column.semanticRole || "text",
881
- onChange: a[15] || (a[15] = (l) => e(i).setColumn(
882
- e(T).index,
2239
+ value: e(R).column.semanticRole || "text",
2240
+ onChange: v[18] || (v[18] = (i) => e(d).setColumn(
2241
+ e(R).index,
883
2242
  "semanticRole",
884
- E(l)
2243
+ ge(i)
885
2244
  ))
886
2245
  }, [
887
- n("option", Bt, s(e(t).identifier), 1),
888
- n("option", Pt, s(e(t).dimension), 1),
889
- n("option", Ot, s(e(t).measure), 1),
890
- n("option", It, s(e(t).date), 1),
891
- n("option", Jt, s(e(t).text), 1)
892
- ], 40, Rt)
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)
893
2252
  ])
894
2253
  ]),
895
- n("div", Nt, [
896
- n("span", null, s(e(t).bodyAlign), 1),
897
- q(we, {
898
- "model-value": e(T).column.align ?? e(T).column.style?.align ?? e(o).align ?? "left",
899
- label: e(t).bodyAlign,
900
- labels: M.value,
901
- "auto-label": e(t).autoShort,
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,
902
2261
  "allow-auto": "",
903
- "onUpdate:modelValue": a[16] || (a[16] = (l) => e(i).setColumn(e(T).index, "align", l))
2262
+ "onUpdate:modelValue": v[19] || (v[19] = (i) => e(d).setColumn(e(R).index, "align", i))
904
2263
  }, null, 8, ["model-value", "label", "labels", "auto-label"])
905
2264
  ]),
906
- n("div", Gt, [
907
- n("span", null, s(e(t).headerAlign), 1),
908
- q(we, {
909
- "model-value": e(i).headerAlignments.value[e(T).index] || "left",
910
- label: e(t).headerAlign,
911
- labels: M.value,
912
- "auto-label": e(t).autoShort,
913
- "onUpdate:modelValue": a[17] || (a[17] = (l) => e(i).setColumn(
914
- e(T).index,
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,
915
2274
  "headerAlign",
916
- l
2275
+ i
917
2276
  ))
918
2277
  }, null, 8, ["model-value", "label", "labels", "auto-label"])
919
2278
  ])
920
2279
  ]),
921
- n("label", Ht, [
922
- P(s(e(t).editable), 1),
2280
+ n("label", Uo, [
2281
+ P(l(e(a).editable), 1),
923
2282
  n("input", {
924
2283
  type: "checkbox",
925
2284
  role: "switch",
926
- checked: e(T).column.editable === !0,
927
- onChange: a[18] || (a[18] = (l) => e(i).setColumn(
928
- e(T).index,
2285
+ checked: e(R).column.editable === !0,
2286
+ onChange: v[21] || (v[21] = (i) => e(d).setColumn(
2287
+ e(R).index,
929
2288
  "editable",
930
- K(l)
2289
+ Ve(i)
931
2290
  ))
932
- }, null, 40, Ut)
2291
+ }, null, 40, Jo)
2292
+ ]),
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))
2301
+ }, [
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))
2313
+ }, [
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
+ ])
933
2332
  ])
934
- ], 8, Mt)) : H("", !0),
935
- e(ie) ? (p(), y("div", {
2333
+ ], 8, So)) : B("", !0),
2334
+ e(Ke) ? (h(), y("div", {
936
2335
  key: 1,
937
- id: `${F}-directory`,
2336
+ id: `${H}-directory`,
938
2337
  ref_key: "directoryPanel",
939
- ref: de,
2338
+ ref: dt,
940
2339
  role: "dialog",
941
- "aria-label": e(t).columnDirectory,
2340
+ "aria-label": e(a).columnDirectory,
942
2341
  class: "mr-designer-directory",
943
- onKeydown: a[28] || (a[28] = ge(
2342
+ onKeydown: v[34] || (v[34] = Be(
944
2343
  //@ts-ignore
945
- (...l) => e(B).escape && e(B).escape(...l),
2344
+ (...i) => e(ee).escape && e(ee).escape(...i),
946
2345
  ["esc"]
947
2346
  )),
948
- onFocusout: a[29] || (a[29] = //@ts-ignore
949
- (...l) => e(B).leave && e(B).leave(...l))
2347
+ onFocusout: v[35] || (v[35] = //@ts-ignore
2348
+ (...i) => e(ee).leave && e(ee).leave(...i))
950
2349
  }, [
951
- n("div", zt, [
2350
+ n("div", Qo, [
952
2351
  n("strong", null, [
953
- P(s(e(t).columnDirectory) + " ", 1),
954
- n("span", null, s(e(o).columns.length), 1)
2352
+ P(l(e(a).columnDirectory) + " ", 1),
2353
+ n("span", null, l(e(x).columns.length), 1)
955
2354
  ]),
956
2355
  n("button", {
957
2356
  type: "button",
958
2357
  class: "mr-designer-icon-button",
959
- "aria-label": e(t).closeDirectory,
960
- onClick: a[19] || (a[19] = (l) => e(B).close(!0))
2358
+ "aria-label": e(a).closeDirectory,
2359
+ onClick: v[25] || (v[25] = (i) => e(ee).close(!0))
961
2360
  }, [
962
- q(W, {
2361
+ Q(oe, {
963
2362
  name: "close",
964
2363
  size: 15
965
2364
  })
966
- ], 8, Kt)
2365
+ ], 8, Zo)
967
2366
  ]),
968
- n("div", qt, [
969
- q(W, {
2367
+ n("div", ea, [
2368
+ Q(oe, {
970
2369
  name: "search",
971
2370
  size: 14
972
2371
  }),
973
- fe(n("input", {
2372
+ ae(n("input", {
974
2373
  ref_key: "directorySearch",
975
- ref: ce,
976
- "onUpdate:modelValue": a[20] || (a[20] = (l) => he(v) ? v.value = l : null),
2374
+ ref: ut,
2375
+ "onUpdate:modelValue": v[26] || (v[26] = (i) => xe(T) ? T.value = i : null),
977
2376
  type: "search",
978
- "aria-label": e(t).columnsSearch,
979
- placeholder: e(t).columnsSearch,
980
- onKeydown: a[21] || (a[21] = //@ts-ignore
981
- (...l) => e(B).searchKeydown && e(B).searchKeydown(...l))
982
- }, null, 40, Wt), [
983
- [_e, e(v)]
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)]
984
2383
  ]),
985
- e(v) ? (p(), y("button", {
2384
+ e(T) ? (h(), y("button", {
986
2385
  key: 0,
987
2386
  type: "button",
988
2387
  class: "mr-designer-icon-button",
989
- "aria-label": e(t).clearSearch,
990
- title: e(t).clearSearch,
991
- onClick: a[22] || (a[22] = (l) => v.value = "")
2388
+ "aria-label": e(a).clearSearch,
2389
+ title: e(a).clearSearch,
2390
+ onClick: v[28] || (v[28] = (i) => T.value = "")
992
2391
  }, [
993
- q(W, {
2392
+ Q(oe, {
994
2393
  name: "close",
995
2394
  size: 13
996
2395
  })
997
- ], 8, Qt)) : H("", !0)
2396
+ ], 8, na)) : B("", !0)
998
2397
  ]),
999
- n("div", Xt, [
2398
+ n("div", oa, [
1000
2399
  n("button", {
1001
2400
  type: "button",
1002
- disabled: r.readonly || e(S) || e(A) || !e(d).length,
1003
- onClick: a[23] || (a[23] = (l) => e(i).selectVisible(!0))
1004
- }, s(e(t).selectVisible), 9, Yt),
1005
- e(h).length ? (p(), y("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", {
1006
2405
  key: 0,
1007
2406
  type: "button",
1008
- onClick: a[24] || (a[24] = //@ts-ignore
1009
- (...l) => e(i).clearSelection && e(i).clearSelection(...l))
1010
- }, s(e(t).clearSelection), 1)) : H("", !0),
1011
- e(h).length ? (p(), y("span", Zt, s(e(t).columnsSelected) + " " + s(e(h).length), 1)) : (p(), y("span", en, s(e(d).length) + " / " + s(e(o).columns.length), 1))
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))
1012
2411
  ]),
1013
2412
  n("div", {
1014
2413
  ref_key: "columnList",
1015
- ref: ve,
2414
+ ref: ct,
1016
2415
  class: "mr-designer-column-list",
1017
- "aria-label": e(t).columnDirectory,
2416
+ "aria-label": e(a).columnDirectory,
1018
2417
  role: "group"
1019
2418
  }, [
1020
- (p(!0), y(X, null, oe(e(d), ({ column: l, index: N }) => (p(), y("div", {
1021
- key: N,
1022
- class: me(["mr-designer-column-row", { "is-active": e(Q) === N }])
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 }])
1023
2422
  }, [
1024
2423
  n("input", {
1025
2424
  type: "checkbox",
1026
- "aria-label": `${e(t).selectColumn} ${l.header}`,
1027
- checked: e(h).includes(N),
1028
- disabled: r.readonly || e(S) || e(A),
1029
- onChange: (le) => e(i).toggleColumn(N, K(le))
1030
- }, null, 40, nn),
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),
1031
2430
  n("button", {
1032
2431
  type: "button",
1033
- "data-column-index": N,
1034
- "aria-pressed": e(Q) === N,
1035
- tabindex: e(ue) === N ? 0 : -1,
1036
- onClick: (le) => e(B).choose(N),
1037
- onKeydown: a[25] || (a[25] = //@ts-ignore
1038
- (...le) => e(B).navigate && e(B).navigate(...le))
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))
1039
2438
  }, [
1040
- n("span", an, s(N + 1), 1),
1041
- n("span", on, [
1042
- n("strong", null, s(l.header), 1),
1043
- n("small", null, s(l.field), 1)
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)
1044
2443
  ]),
1045
- e(Q) === N ? (p(), ke(W, {
2444
+ e(L) === O ? (h(), fe(oe, {
1046
2445
  key: 0,
1047
2446
  name: "chevron-right",
1048
2447
  size: 13
1049
- })) : H("", !0)
1050
- ], 40, ln)
2448
+ })) : B("", !0)
2449
+ ], 40, da)
1051
2450
  ], 2))), 128)),
1052
- e(d).length ? H("", !0) : (p(), y("p", sn, [
1053
- q(W, {
2451
+ e(D).length ? B("", !0) : (h(), y("p", ma, [
2452
+ Q(oe, {
1054
2453
  name: "search",
1055
2454
  size: 20
1056
2455
  }),
1057
- P(s(e(t).noColumns), 1)
2456
+ P(l(e(a).noColumns), 1)
1058
2457
  ]))
1059
- ], 8, tn),
1060
- e(h).length ? (p(), y("div", rn, [
2458
+ ], 8, ia),
2459
+ e(N).length ? (h(), y("div", va, [
1061
2460
  n("label", null, [
1062
- P(s(e(t).batchBody), 1),
2461
+ P(l(e(a).batchBody), 1),
1063
2462
  n("select", {
1064
- "aria-label": e(t).batchBody,
1065
- disabled: r.readonly || e(S) || e(A),
1066
- onChange: a[26] || (a[26] = (l) => ye(l, "align"))
2463
+ "aria-label": e(a).batchBody,
2464
+ disabled: t.readonly || e(I) || e(f),
2465
+ onChange: v[32] || (v[32] = (i) => Xe(i, "align"))
1067
2466
  }, [
1068
- n("option", dn, s(e(t).chooseAlignment), 1),
1069
- n("option", cn, s(e(t).auto), 1),
1070
- n("option", vn, s(e(t).left), 1),
1071
- n("option", mn, s(e(t).center), 1),
1072
- n("option", gn, s(e(t).right), 1),
1073
- n("option", fn, s(e(t).justify), 1)
1074
- ], 40, un)
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)
1075
2474
  ]),
1076
2475
  n("label", null, [
1077
- P(s(e(t).batchHeader), 1),
2476
+ P(l(e(a).batchHeader), 1),
1078
2477
  n("select", {
1079
- "aria-label": e(t).batchHeader,
1080
- disabled: r.readonly || e(S) || e(A),
1081
- onChange: a[27] || (a[27] = (l) => ye(l, "headerAlign"))
2478
+ "aria-label": e(a).batchHeader,
2479
+ disabled: t.readonly || e(I) || e(f),
2480
+ onChange: v[33] || (v[33] = (i) => Xe(i, "headerAlign"))
1082
2481
  }, [
1083
- n("option", pn, s(e(t).chooseAlignment), 1),
1084
- n("option", bn, s(e(t).left), 1),
1085
- n("option", yn, s(e(t).center), 1),
1086
- n("option", _n, s(e(t).right), 1),
1087
- n("option", kn, s(e(t).justify), 1)
1088
- ], 40, hn)
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)
1089
2488
  ])
1090
- ])) : H("", !0)
1091
- ], 40, Ft)) : H("", !0)
1092
- ], 64)) : (p(), y("p", wn, s(e(t).noColumns), 1))
1093
- ], 64)) : e(R) === "template" ? (p(), y(X, { key: 1 }, [
1094
- n("h3", null, s(e(t).templateDetails), 1),
1095
- n("label", Cn, [
1096
- P(s(e(t).name), 1),
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),
1097
2594
  n("input", {
1098
- value: e(b).name,
1099
- disabled: r.readonly || e(S) || e(A),
1100
- onInput: a[30] || (a[30] = (l) => e(i).setName(E(l)))
1101
- }, null, 40, Sn)
2595
+ value: e(w).name,
2596
+ disabled: t.readonly || e(I) || e(f),
2597
+ onInput: v[43] || (v[43] = (i) => e(d).setName(ge(i)))
2598
+ }, null, 40, Wa)
1102
2599
  ]),
1103
- n("label", xn, [
1104
- P(s(e(t).description), 1),
2600
+ n("label", Xa, [
2601
+ P(l(e(a).description), 1),
1105
2602
  n("textarea", {
1106
2603
  rows: "2",
1107
- value: e(b).description,
1108
- disabled: r.readonly || e(S) || e(A),
1109
- onInput: a[31] || (a[31] = (l) => e(i).setDescription(E(l)))
1110
- }, null, 40, Mn)
2604
+ value: e(w).description,
2605
+ disabled: t.readonly || e(I) || e(f),
2606
+ onInput: v[44] || (v[44] = (i) => e(d).setDescription(ge(i)))
2607
+ }, null, 40, qa)
1111
2608
  ]),
1112
- n("details", En, [
1113
- n("summary", null, s(e(t).technicalDetails), 1),
1114
- n("dl", An, [
1115
- n("dt", null, s(e(t).templateIdentity), 1),
1116
- n("dd", null, s(e(b).id), 1),
1117
- n("dt", null, s(e(t).templateRevision), 1),
1118
- n("dd", null, s(e(b).revision || e(t).unpublished), 1)
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)
1119
2616
  ])
1120
2617
  ])
1121
- ], 64)) : (p(), y(X, { key: 2 }, [
1122
- n("h3", null, s(e(t).advancedTitle), 1),
1123
- n("label", Tn, [
1124
- P(s(e(t).json), 1),
1125
- fe(n("textarea", {
1126
- "onUpdate:modelValue": a[32] || (a[32] = (l) => he($) ? $.value = l : null),
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),
1127
2624
  class: "mr-designer-json",
1128
- "aria-label": e(t).json,
1129
- disabled: r.readonly || e(S),
2625
+ "aria-label": e(a).json,
2626
+ disabled: t.readonly || e(I),
1130
2627
  spellcheck: "false"
1131
- }, null, 8, Dn), [
1132
- [_e, e($)]
2628
+ }, null, 8, el), [
2629
+ [qe, e(C)]
1133
2630
  ])
1134
2631
  ]),
1135
2632
  n("button", {
1136
2633
  type: "button",
1137
2634
  class: "mr-designer-apply-json",
1138
- disabled: r.readonly || e(S),
1139
- onClick: a[33] || (a[33] = //@ts-ignore
1140
- (...l) => e(i).applyJson && e(i).applyJson(...l))
1141
- }, s(e(t).applyJson), 9, $n)
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)
1142
2639
  ], 64)),
1143
- e(A) ? (p(), y("p", jn, s(e(t).jsonPending), 1)) : H("", !0)
1144
- ], 10, ft)
1145
- ]),
1146
- 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,
1147
2645
  class: "mr-designer-preview",
1148
- "aria-label": e(t).previewTitle
2646
+ "aria-label": e(a).previewTitle
1149
2647
  }, [
1150
- e(_) ? (p(), y("div", Ln, s(e(_)), 1)) : H("", !0),
1151
- e(V).ok ? H("", !0) : (p(), y("ul", Rn, [
1152
- (p(!0), y(X, null, oe(e(V).errors, (l) => (p(), y("li", {
1153
- key: l.path
1154
- }, s(l.path) + ":" + s(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))
1155
2653
  ])),
1156
- e(x) && e(V).ok ? (p(), ke(e(Le), {
2654
+ e(Ce) === "design" && e(M).ok ? (h(), fe(Ot, {
1157
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,
1158
2668
  "report-id": "draft",
1159
- fetcher: e(x),
2669
+ fetcher: e(te),
1160
2670
  messages: {
1161
- title: e(t).previewTitle,
1162
- columnDirectory: e(t).previewFieldDirectory
2671
+ title: e(a).previewTitle,
2672
+ columnDirectory: e(a).previewFieldDirectory
1163
2673
  },
1164
2674
  "show-params": !1,
1165
2675
  editable: !1,
1166
2676
  "excel-import": !1,
1167
2677
  height: "100%"
1168
- }, null, 8, ["fetcher", "messages"])) : (p(), y("p", Bn, s(e(t).invalid), 1))
1169
- ], 8, Vn)
1170
- ])
1171
- ], 8, tt));
2678
+ }, null, 8, ["fetcher", "messages"])) : (h(), y("p", sl, l(e(a).invalid), 1))
2679
+ ], 8, ol)) : B("", !0)
2680
+ ], 2)
2681
+ ], 8, On));
1172
2682
  }
1173
- }), Gn = /* @__PURE__ */ Se(Pn, [["__scopeId", "data-v-10c10f4e"]]);
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"));
1174
2896
  export {
1175
- Gn as ReportTemplateEditor,
1176
- Ye 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
1177
2905
  };