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