@agile-team/mach-report 2.8.3 → 2.8.4

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.
package/dist/designer.js CHANGED
@@ -1,122 +1,266 @@
1
- import { ref as j, computed as A, shallowRef as be, onBeforeUnmount as pe, watch as W, defineComponent as ye, getCurrentInstance as _e, nextTick as ne, openBlock as _, createElementBlock as C, unref as e, createElementVNode as n, createVNode as le, toDisplayString as a, normalizeClass as fe, createTextVNode as R, createCommentVNode as N, withKeys as ke, withModifiers as Ce, Fragment as K, renderList as ie, withDirectives as ue, isRef as ce, vModelSelect as we, vModelText as ge, createBlock as he } from "vue";
2
- import { provideMachReportConfig as Se, createLocalFetcher as xe, ReportPreview as Ee } from "@agile-team/mach-report/vue";
3
- import { _ as Y, a as Me } from "./_plugin-vue_export-helper-DPbiz14D.js";
4
- import { resolveGridLayout as ve, parseReportTemplate as I, serializeReportTemplate as U, validateReportTemplateDocument as Te } from "@agile-team/mach-report";
5
- function Ae(v, M, c, y) {
6
- const f = j(0), s = j(""), w = j([]), $ = A(() => v.value.template.pages.flatMap((d, r) => d.components.flatMap((i, m) => i.kind === "list" ? [{ component: i, pageIndex: r, componentIndex: m }] : []))), S = A(() => $.value[f.value]?.component), p = A(() => {
7
- const d = S.value;
8
- if (!d) return [];
9
- const r = d.columns.map((i) => i.headerStyle?.align ?? i.headerAlign ?? d.headerStyle?.align ?? d.headerAlign ?? i.style?.align ?? "center");
10
- if (d.headerGrid && M())
11
- for (const i of ve(d.headerGrid, d.widthMm, 100).cells)
12
- for (let m = i.ci; m < i.ci + (i.cell.colSpan ?? 1); m++) r[m] = i.cell.style?.align ?? "left";
13
- return r;
14
- }), g = A(() => {
15
- const d = s.value.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);
16
- return (S.value?.columns ?? []).flatMap((r, i) => {
17
- const m = `${r.header} ${r.field}`.toLocaleLowerCase();
18
- return d.every((x) => m.includes(x)) ? [{ column: r, index: i }] : [];
1
+ import { defineComponent as Ce, openBlock as p, createElementBlock as y, Fragment as X, renderList as oe, toDisplayString as s, nextTick as Y, ref as D, watch as te, onMounted as Ee, onBeforeUnmount as be, computed as j, shallowRef as Ae, getCurrentInstance as Te, unref as e, createElementVNode as n, createVNode as q, normalizeClass as me, createTextVNode as P, createCommentVNode as H, withKeys as ge, withModifiers as De, withDirectives as fe, isRef as he, vModelSelect as $e, vModelText as _e, createBlock as ke } from "vue";
2
+ import { provideMachReportConfig as je, createLocalFetcher as Ve, ReportPreview as Le } from "@agile-team/mach-report/vue";
3
+ import { _ as Se, a as W } from "./_plugin-vue_export-helper-8SL1F89S.js";
4
+ import { resolveGridLayout as pe, parseReportTemplate as U, serializeReportTemplate as ee, validateReportTemplateDocument as Re } from "@agile-team/mach-report";
5
+ const Be = ["aria-label"], Pe = ["data-align", "aria-label", "title", "aria-checked", "tabindex", "onClick", "onKeydown"], Oe = { key: 0 }, Ie = {
6
+ key: 1,
7
+ viewBox: "0 0 20 20",
8
+ fill: "none",
9
+ "aria-hidden": "true"
10
+ }, Je = {
11
+ key: 0,
12
+ d: "M3 4h14M3 8h9M3 12h14M3 16h9"
13
+ }, Ne = {
14
+ key: 1,
15
+ d: "M3 4h14M6 8h8M3 12h14M6 16h8"
16
+ }, Ge = {
17
+ key: 2,
18
+ d: "M3 4h14M8 8h9M3 12h14M8 16h9"
19
+ }, He = {
20
+ key: 3,
21
+ d: "M3 4h14M3 8h14M3 12h14M3 16h14"
22
+ }, Ue = /* @__PURE__ */ Ce({
23
+ __name: "AlignmentControl",
24
+ props: {
25
+ modelValue: {},
26
+ label: {},
27
+ labels: {},
28
+ autoLabel: {},
29
+ allowAuto: { type: Boolean }
30
+ },
31
+ emits: ["update:modelValue"],
32
+ setup(r, { emit: w }) {
33
+ const c = r, g = w, u = () => c.allowAuto ? ["auto", "left", "center", "right", "justify"] : ["left", "center", "right", "justify"];
34
+ async function i(b, $) {
35
+ if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(b.key)) return;
36
+ b.preventDefault();
37
+ const _ = u(), k = _.indexOf($), C = b.key === "Home" ? 0 : b.key === "End" ? _.length - 1 : (k + (b.key === "ArrowRight" ? 1 : -1) + _.length) % _.length;
38
+ g("update:modelValue", _[C]);
39
+ const A = b.currentTarget.parentElement;
40
+ await Y(), A?.querySelector(`[data-align="${_[C]}"]`)?.focus();
41
+ }
42
+ return (b, $) => (p(), y("div", {
43
+ class: "mr-designer-alignment",
44
+ role: "radiogroup",
45
+ "aria-label": r.label
46
+ }, [
47
+ (p(!0), y(X, null, oe(u(), (m) => (p(), y("button", {
48
+ key: m,
49
+ type: "button",
50
+ role: "radio",
51
+ "data-align": m,
52
+ "aria-label": r.labels[m],
53
+ title: r.labels[m],
54
+ "aria-checked": r.modelValue === m,
55
+ tabindex: r.modelValue === m ? 0 : -1,
56
+ onClick: (_) => g("update:modelValue", m),
57
+ onKeydown: (_) => i(_, m)
58
+ }, [
59
+ m === "auto" ? (p(), y("span", Oe, s(r.autoLabel), 1)) : (p(), y("svg", Ie, [
60
+ m === "left" ? (p(), y("path", Je)) : m === "center" ? (p(), y("path", Ne)) : m === "right" ? (p(), y("path", Ge)) : (p(), y("path", He))
61
+ ]))
62
+ ], 40, Pe))), 128))
63
+ ], 8, Be));
64
+ }
65
+ }), we = /* @__PURE__ */ Se(Ue, [["__scopeId", "data-v-c85770c4"]]);
66
+ function Fe(r, w, c) {
67
+ if (!r.length) return;
68
+ const g = Math.max(0, r.indexOf(w)), i = {
69
+ ArrowDown: Math.min(g + 1, r.length - 1),
70
+ ArrowUp: Math.max(g - 1, 0),
71
+ Home: 0,
72
+ End: r.length - 1
73
+ }[c];
74
+ return i === void 0 ? void 0 : r[i];
75
+ }
76
+ function ze(r, w, c) {
77
+ const g = D(!1), u = D(r.activeIndex.value), i = D(null), b = D(null), $ = D(null), m = D(null);
78
+ function _(f = !1) {
79
+ const o = m.value, d = o?.querySelector(
80
+ `button[data-column-index="${u.value}"]`
81
+ );
82
+ if (!o || !d) return;
83
+ f && d.focus({ preventScroll: !0 });
84
+ const v = o.getBoundingClientRect(), h = d.getBoundingClientRect(), x = v.top + o.clientTop, t = x + o.clientHeight;
85
+ h.top < x ? o.scrollTop += h.top - x : h.bottom > t && (o.scrollTop += h.bottom - t);
86
+ }
87
+ async function k(f = !1) {
88
+ g.value && (g.value = !1, f && (await Y(), i.value?.focus({ preventScroll: !0 })));
89
+ }
90
+ async function C() {
91
+ if (g.value) return k(!0);
92
+ const f = c.value.map((o) => o.index);
93
+ u.value = f.includes(r.activeIndex.value) ? r.activeIndex.value : f[0] ?? -1, g.value = !0, await Y(), $.value?.focus({ preventScroll: !0 }), _();
94
+ }
95
+ function A(f) {
96
+ r.activate(f), k(!0);
97
+ }
98
+ function S(f) {
99
+ g.value && (f.preventDefault(), f.stopPropagation(), k(!0));
100
+ }
101
+ async function G(f) {
102
+ const o = Fe(
103
+ c.value.map((d) => d.index),
104
+ u.value,
105
+ f.key
106
+ );
107
+ o !== void 0 && (u.value = o, f.preventDefault(), await Y(), _(!0));
108
+ }
109
+ async function Z(f) {
110
+ if (!["ArrowDown", "ArrowUp", "Enter"].includes(f.key)) return;
111
+ f.preventDefault(), f.stopPropagation();
112
+ const o = c.value.map((d) => d.index);
113
+ if (o.length) {
114
+ if (f.key === "Enter") {
115
+ o.includes(u.value) && A(u.value);
116
+ return;
117
+ }
118
+ f.key === "ArrowUp" && (u.value = o.at(-1)), await Y(), _(!0);
119
+ }
120
+ }
121
+ function O(f) {
122
+ const o = f.target;
123
+ !g.value || b.value?.contains(o) || i.value?.contains(o) || k();
124
+ }
125
+ function V(f) {
126
+ const o = f.relatedTarget;
127
+ !o || b.value?.contains(o) || i.value?.contains(o) || k();
128
+ }
129
+ return te(c, (f) => {
130
+ f.some((o) => o.index === u.value) || (u.value = f[0]?.index ?? -1);
131
+ }), te(w, () => {
132
+ k();
133
+ }), Ee(() => document.addEventListener("pointerdown", O)), be(() => document.removeEventListener("pointerdown", O)), {
134
+ open: g,
135
+ cursor: u,
136
+ trigger: i,
137
+ panel: b,
138
+ search: $,
139
+ list: m,
140
+ toggle: C,
141
+ close: k,
142
+ choose: A,
143
+ escape: S,
144
+ navigate: G,
145
+ searchKeydown: Z,
146
+ leave: V
147
+ };
148
+ }
149
+ function Ke(r, w, c, g) {
150
+ const u = D(0), i = D(""), b = D([]), $ = j(() => r.value.template.pages.flatMap((o, d) => o.components.flatMap((v, h) => v.kind === "list" ? [{ component: v, pageIndex: d, componentIndex: h }] : []))), m = j(() => $.value[u.value]?.component), _ = j(() => {
151
+ const o = m.value;
152
+ if (!o) return [];
153
+ const d = o.columns.map((v) => v.headerStyle?.align ?? v.headerAlign ?? o.headerStyle?.align ?? o.headerAlign ?? v.style?.align ?? "center");
154
+ if (o.headerGrid && w())
155
+ for (const v of pe(o.headerGrid, o.widthMm, 100).cells)
156
+ for (let h = v.ci; h < v.ci + (v.cell.colSpan ?? 1); h++) d[h] = v.cell.style?.align ?? "left";
157
+ return d;
158
+ }), k = j(() => {
159
+ const o = i.value.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean);
160
+ return (m.value?.columns ?? []).flatMap((d, v) => {
161
+ const h = `${d.header} ${d.field}`.toLocaleLowerCase();
162
+ return o.every((x) => h.includes(x)) ? [{ column: d, index: v }] : [];
19
163
  });
20
164
  });
21
- function k(d, r) {
22
- w.value = r ? [.../* @__PURE__ */ new Set([...w.value, d])] : w.value.filter((i) => i !== d);
165
+ function C(o, d) {
166
+ b.value = d ? [.../* @__PURE__ */ new Set([...b.value, o])] : b.value.filter((v) => v !== o);
23
167
  }
24
- function T(d) {
25
- for (const r of g.value) k(r.index, d);
168
+ function A(o) {
169
+ for (const d of k.value) C(d.index, o);
26
170
  }
27
- function h() {
28
- w.value = [];
171
+ function S() {
172
+ b.value = [];
29
173
  }
30
- function B(d, r, i) {
174
+ function G(o, d, v) {
31
175
  if (!c()) return;
32
- const m = S.value?.columns[d];
33
- m && (Object.assign(m, { [r]: r === "widthMm" ? Number(i) : i }), r === "header" && O(d, String(i)), r === "headerAlign" && D(d, i), r === "widthMm" && Q(), y());
34
- }
35
- function Q() {
36
- const d = $.value[f.value];
37
- if (!d) return;
38
- const r = d.component, i = v.value.template.pages[d.pageIndex], m = r.columns.map((x) => x.widthMm);
39
- r.headerGrid && (r.headerGrid.colWidthsMm = m), i.layout === "wide" && m.every((x) => Number.isFinite(x) && x > 0) && (r.widthMm = m.reduce((x, t) => x + t, 0), i.widthMm = Math.max(...i.components.map((x) => x.leftMm + x.widthMm)) + (i.marginRightMm ?? 0));
40
- }
41
- function O(d, r) {
42
- const i = S.value;
43
- if (!i?.headerGrid) return;
44
- const x = ve(i.headerGrid, i.widthMm, 100).cells.filter(({ ci: t, cell: L }) => t <= d && t + (L.colSpan ?? 1) > d).slice(-1)[0];
45
- x && (Object.assign(x.cell, { text: r, rawText: r, value: r }), i.columns.slice(x.ci, x.ci + (x.cell.colSpan ?? 1)).forEach((t) => {
46
- t.header = r;
176
+ const h = m.value?.columns[o];
177
+ h && (Object.assign(h, { [d]: d === "widthMm" ? Number(v) : v }), d === "header" && O(o, String(v)), d === "headerAlign" && V(o, v), d === "widthMm" && Z(), g());
178
+ }
179
+ function Z() {
180
+ const o = $.value[u.value];
181
+ if (!o) return;
182
+ const d = o.component, v = r.value.template.pages[o.pageIndex], h = d.columns.map((x) => x.widthMm);
183
+ d.headerGrid && (d.headerGrid.colWidthsMm = h), v.layout === "wide" && h.every((x) => Number.isFinite(x) && x > 0) && (d.widthMm = h.reduce((x, t) => x + t, 0), v.widthMm = Math.max(...v.components.map((x) => x.leftMm + x.widthMm)) + (v.marginRightMm ?? 0));
184
+ }
185
+ function O(o, d) {
186
+ const v = m.value;
187
+ if (!v?.headerGrid) return;
188
+ const x = pe(v.headerGrid, v.widthMm, 100).cells.filter(({ ci: t, cell: I }) => t <= o && t + (I.colSpan ?? 1) > o).slice(-1)[0];
189
+ x && (Object.assign(x.cell, { text: d, rawText: d, value: d }), v.columns.slice(x.ci, x.ci + (x.cell.colSpan ?? 1)).forEach((t) => {
190
+ t.header = d;
47
191
  }));
48
192
  }
49
- function D(d, r) {
50
- const i = S.value, m = i?.columns[d];
51
- if (m?.headerStyle?.align !== void 0 && (m.headerStyle = { ...m.headerStyle, align: r }), !i?.headerGrid) return;
52
- const t = ve(i.headerGrid, i.widthMm, 100).cells.filter(({ ci: L, cell: V }) => L <= d && L + (V.colSpan ?? 1) > d).slice(-1)[0];
53
- t && (t.cell.style = { ...t.cell.style, align: r }, i.columns.slice(t.ci, t.ci + (t.cell.colSpan ?? 1)).forEach((L) => {
54
- L.headerAlign = r, L.headerStyle?.align !== void 0 && (L.headerStyle = { ...L.headerStyle, align: r });
193
+ function V(o, d) {
194
+ const v = m.value, h = v?.columns[o];
195
+ if (h?.headerStyle?.align !== void 0 && (h.headerStyle = { ...h.headerStyle, align: d }), !v?.headerGrid) return;
196
+ const t = pe(v.headerGrid, v.widthMm, 100).cells.filter(({ ci: I, cell: R }) => I <= o && I + (R.colSpan ?? 1) > o).slice(-1)[0];
197
+ t && (t.cell.style = { ...t.cell.style, align: d }, v.columns.slice(t.ci, t.ci + (t.cell.colSpan ?? 1)).forEach((I) => {
198
+ I.headerAlign = d, I.headerStyle?.align !== void 0 && (I.headerStyle = { ...I.headerStyle, align: d });
55
199
  }));
56
200
  }
57
- function P(d, r) {
58
- if (!(!c() || d === "headerAlign" && r === "auto")) {
59
- for (const i of w.value) {
60
- const m = S.value?.columns[i];
61
- m && (Object.assign(m, { [d]: r }), d === "headerAlign" && D(i, r));
201
+ function f(o, d) {
202
+ if (!(!c() || o === "headerAlign" && d === "auto")) {
203
+ for (const v of b.value) {
204
+ const h = m.value?.columns[v];
205
+ h && (Object.assign(h, { [o]: d }), o === "headerAlign" && V(v, d));
62
206
  }
63
- y();
207
+ g();
64
208
  }
65
209
  }
66
- return { selected: f, query: s, selectedColumns: w, lists: $, activeList: S, headerAlignments: p, visibleColumns: g, toggleColumn: k, selectVisible: T, clearSelection: h, setColumn: B, alignColumns: P };
210
+ return { selected: u, query: i, selectedColumns: b, lists: $, activeList: m, headerAlignments: _, visibleColumns: k, toggleColumn: C, selectVisible: A, clearSelection: S, setColumn: G, alignColumns: f };
67
211
  }
68
- function De(v, M = { entries: 100, bytes: 16 * 1024 * 1024 }) {
69
- const c = j([v]), y = j(0), f = A(() => y.value > 0), s = A(() => y.value + 1 < c.value.length), w = A(() => c.value[y.value]);
70
- function $(g) {
71
- c.value = [g], y.value = 0;
72
- }
73
- function S(g) {
74
- if (c.value[y.value] === g) return;
75
- const k = c.value.slice(0, y.value + 1);
76
- k.push(g);
77
- let T = k.reduce((h, B) => h + B.length * 2, 0);
78
- for (; k.length > 1 && (k.length > M.entries || T > M.bytes); ) T -= k.shift().length * 2;
79
- c.value = k, y.value = c.value.length - 1;
80
- }
81
- function p(g) {
82
- if (!(g < 0 ? !f.value : !s.value))
83
- return y.value += g, c.value[y.value];
84
- }
85
- return { canUndo: f, canRedo: s, current: w, reset: $, record: S, move: p };
212
+ function qe(r, w = { entries: 100, bytes: 16 * 1024 * 1024 }) {
213
+ const c = D([r]), g = D(0), u = j(() => g.value > 0), i = j(() => g.value + 1 < c.value.length), b = j(() => c.value[g.value]);
214
+ function $(k) {
215
+ c.value = [k], g.value = 0;
216
+ }
217
+ function m(k) {
218
+ if (c.value[g.value] === k) return;
219
+ const C = c.value.slice(0, g.value + 1);
220
+ C.push(k);
221
+ let A = C.reduce((S, G) => S + G.length * 2, 0);
222
+ for (; C.length > 1 && (C.length > w.entries || A > w.bytes); ) A -= C.shift().length * 2;
223
+ c.value = C, g.value = c.value.length - 1;
224
+ }
225
+ function _(k) {
226
+ if (!(k < 0 ? !u.value : !i.value))
227
+ return g.value += k, c.value[g.value];
228
+ }
229
+ return { canUndo: u, canRedo: i, current: b, reset: $, record: m, move: _ };
86
230
  }
87
- function je(v) {
88
- const M = be(null), c = j(!1);
89
- let y, f = 0;
90
- function s(S) {
91
- y?.(S), y = void 0, M.value = null;
92
- }
93
- function w() {
94
- f++, s(!1), c.value = !1;
95
- }
96
- async function $(S) {
97
- w();
98
- const p = f, g = v();
231
+ function We(r) {
232
+ const w = Ae(null), c = D(!1);
233
+ let g, u = 0;
234
+ function i(m) {
235
+ g?.(m), g = void 0, w.value = null;
236
+ }
237
+ function b() {
238
+ u++, i(!1), c.value = !1;
239
+ }
240
+ async function $(m) {
241
+ b();
242
+ const _ = u, k = r();
99
243
  c.value = !0;
100
244
  try {
101
- const k = await new Promise((T, h) => {
102
- if (y = T, !g) {
103
- M.value = S;
245
+ const C = await new Promise((A, S) => {
246
+ if (g = A, !k) {
247
+ w.value = m;
104
248
  return;
105
249
  }
106
- Promise.resolve().then(() => f === p ? g(S) : !1).then((B) => {
107
- f === p && s(B === !0);
108
- }, (B) => {
109
- f === p && (y = void 0, M.value = null, h(B));
250
+ Promise.resolve().then(() => u === _ ? k(m) : !1).then((G) => {
251
+ u === _ && i(G === !0);
252
+ }, (G) => {
253
+ u === _ && (g = void 0, w.value = null, S(G));
110
254
  });
111
255
  });
112
- return f === p && k === !0;
256
+ return u === _ && C === !0;
113
257
  } finally {
114
- f === p && (c.value = !1);
258
+ u === _ && (c.value = !1);
115
259
  }
116
260
  }
117
- return pe(w), { confirmation: M, pending: c, decide: s, request: $, cancel: w };
261
+ return be(b), { confirmation: w, pending: c, decide: i, request: $, cancel: b };
118
262
  }
119
- const Re = {
263
+ const Qe = {
120
264
  title: "报表模板属性编辑器",
121
265
  heading: "模板属性",
122
266
  unpublished: "未发布",
@@ -149,7 +293,7 @@ const Re = {
149
293
  applyJson: "校验并应用 JSON",
150
294
  note: "字段映射应与数据源契约一致。此编辑器维护模板属性;保存由接入方提供的版本服务处理。",
151
295
  invalid: "请先修正模板错误,再预览或保存。"
152
- }, $e = {
296
+ }, Xe = {
153
297
  undo: "撤销",
154
298
  redo: "重做",
155
299
  columnsSearch: "搜索列名或字段",
@@ -181,14 +325,26 @@ const Re = {
181
325
  templateRevision: "当前修订",
182
326
  readonly: "只读",
183
327
  ready: "可编辑",
184
- previewTitle: "实时预览"
185
- }, Be = { ...Re, ...$e };
186
- function Le(v, M) {
187
- const c = j(I(v.modelValue)), y = j(U(c.value)), f = j(U(c.value)), s = j(""), w = j(!1), $ = A(() => ({ ...Be, ...v.messages })), S = A(() => ({
328
+ previewTitle: "实时预览",
329
+ contentGroup: "内容",
330
+ formatGroup: "格式",
331
+ autoShort: "自动",
332
+ previousColumn: "上一字段",
333
+ nextColumn: "下一字段",
334
+ closeDirectory: "关闭字段目录",
335
+ technicalDetails: "标识与修订",
336
+ fieldPosition: "当前字段",
337
+ previewFieldDirectory: "定位字段"
338
+ }, Ye = {
339
+ ...Qe,
340
+ ...Xe
341
+ };
342
+ function Ze(r, w) {
343
+ const c = D(U(r.modelValue)), g = D(ee(c.value)), u = D(ee(c.value)), i = D(""), b = D(!1), $ = j(() => ({ ...Ye, ...r.messages })), m = j(() => ({
188
344
  showExport: !1,
189
345
  showPrint: !1,
190
346
  showPdfWindow: !1,
191
- ...v.preview,
347
+ ...r.preview,
192
348
  theme: {
193
349
  shellBg: "#f1f5f9",
194
350
  shellFg: "#334155",
@@ -200,183 +356,170 @@ function Le(v, M) {
200
356
  btnHoverBg: "#eff6ff",
201
357
  btnHoverFg: "#1d4ed8",
202
358
  btnActiveBg: "#2563eb",
203
- ...v.preview?.theme
359
+ ...r.preview?.theme
204
360
  }
205
361
  }));
206
- Se({ get defaults() {
207
- return S.value;
362
+ je({ get defaults() {
363
+ return m.value;
208
364
  } });
209
- let p, g = 0;
210
- const k = A(() => Te(c.value)), T = A(() => {
365
+ let _, k = 0;
366
+ const C = j(() => Re(c.value)), A = j(() => {
211
367
  try {
212
- return U(c.value) !== y.value;
368
+ return ee(c.value) !== g.value;
213
369
  } catch {
214
370
  return !0;
215
371
  }
216
- }), h = j(f.value), B = A(() => f.value !== h.value), Q = A(() => T.value || f.value !== h.value), O = () => JSON.stringify({ document: c.value, json: f.value, appliedJson: h.value }), D = De(O()), P = je(() => v.beforeDiscard), d = A(() => w.value || P.pending.value), r = () => !v.readonly && !d.value && !B.value, i = Ae(c, () => k.value.ok, r, q), { selected: m, lists: x, activeList: t, headerAlignments: L, setColumn: V } = i;
217
- W(m, () => i.clearSelection());
218
- const z = A(() => k.value.ok ? xe({ draft: { template: c.value.template, datasets: v.datasets ?? {}, params: [] } }) : void 0);
219
- function E() {
220
- g++, p?.abort(), p = void 0, w.value = !1;
221
- }
222
- let H = 0;
223
- async function J(u = "replace", o) {
224
- if (!Q.value) return !0;
225
- const l = O();
372
+ }), S = D(u.value), G = j(() => u.value !== S.value), Z = j(() => A.value || u.value !== S.value), O = () => JSON.stringify({ document: c.value, json: u.value, appliedJson: S.value }), V = qe(O()), f = We(() => r.beforeDiscard), o = j(() => b.value || f.pending.value), d = () => !r.readonly && !o.value && !G.value, v = Ke(c, () => C.value.ok, d, ne), { selected: h, lists: x, activeList: t, headerAlignments: I, setColumn: R } = v;
373
+ te(h, () => v.clearSelection());
374
+ const Q = j(() => C.value.ok ? Ve({ draft: { template: c.value.template, datasets: r.datasets ?? {}, params: [] } }) : void 0);
375
+ function T() {
376
+ k++, _?.abort(), _ = void 0, b.value = !1;
377
+ }
378
+ let F = 0;
379
+ async function z(M = "replace", L) {
380
+ if (!Z.value) return !0;
381
+ const E = O();
226
382
  try {
227
- return await P.request({
228
- reason: u,
383
+ return await f.request({
384
+ reason: M,
229
385
  document: JSON.parse(JSON.stringify(c.value)),
230
- replacement: o ? I(o) : void 0,
386
+ replacement: L ? U(L) : void 0,
231
387
  pendingLocalChanges: !0
232
- }) && l === O();
233
- } catch (b) {
234
- return s.value = b instanceof Error ? b.message : String(b), !1;
388
+ }) && E === O();
389
+ } catch (K) {
390
+ return i.value = K instanceof Error ? K.message : String(K), !1;
235
391
  }
236
392
  }
237
- function oe(u) {
238
- E(), c.value = u, y.value = U(u), f.value = y.value, h.value = f.value, s.value = "", m.value = 0, i.clearSelection(), D.reset(O());
393
+ function se(M) {
394
+ T(), c.value = M, g.value = ee(M), u.value = g.value, S.value = u.value, i.value = "", h.value = 0, v.clearSelection(), V.reset(O());
239
395
  }
240
- W(() => v.modelValue, async (u) => {
241
- let o;
396
+ te(() => r.modelValue, async (M) => {
397
+ let L;
242
398
  try {
243
- o = I(u);
244
- } catch (b) {
245
- s.value = b instanceof Error ? b.message : String(b);
399
+ L = U(M);
400
+ } catch (K) {
401
+ i.value = K instanceof Error ? K.message : String(K);
246
402
  return;
247
403
  }
248
404
  try {
249
- if (U(o) === U(c.value)) return;
405
+ if (ee(L) === ee(c.value)) return;
250
406
  } catch {
251
407
  }
252
- const l = ++H;
253
- if (E(), !await J("replace", o)) {
254
- l === H && k.value.ok && M("update:modelValue", I(c.value));
408
+ const E = ++F;
409
+ if (T(), !await z("replace", L)) {
410
+ E === F && C.value.ok && w("update:modelValue", U(c.value));
255
411
  return;
256
412
  }
257
- l === H && oe(o);
258
- }), pe(() => {
259
- H++, E();
413
+ E === F && se(L);
414
+ }), be(() => {
415
+ F++, T();
260
416
  });
261
- function q() {
262
- P.cancel(), s.value = "", k.value.ok && (f.value = U(c.value), h.value = f.value, M("update:modelValue", I(c.value))), D.record(O());
417
+ function ne() {
418
+ f.cancel(), i.value = "", C.value.ok && (u.value = ee(c.value), S.value = u.value, w("update:modelValue", U(c.value))), V.record(O());
263
419
  }
264
- function ae(u) {
265
- r() && (c.value.name = u, q());
420
+ function ae(M) {
421
+ d() && (c.value.name = M, ne());
266
422
  }
267
- function Z(u) {
268
- r() && (c.value.description = u, q());
423
+ function B(M) {
424
+ d() && (c.value.description = M, ne());
269
425
  }
270
- function X() {
271
- if (!(v.readonly || d.value))
426
+ function ie() {
427
+ if (!(r.readonly || o.value))
272
428
  try {
273
- const u = I(f.value);
274
- if (u.id !== c.value.id) throw new Error("属性编辑不允许更换模板 ID,请另存为新模板");
275
- if (u.revision !== c.value.revision) throw new Error("修订号由保存服务管理,不能在 JSON 中修改");
276
- c.value = u, m.value = 0, i.clearSelection(), q();
277
- } catch (u) {
278
- s.value = u instanceof Error ? u.message : String(u);
429
+ const M = U(u.value);
430
+ if (M.id !== c.value.id) throw new Error("属性编辑不允许更换模板 ID,请另存为新模板");
431
+ if (M.revision !== c.value.revision) throw new Error("修订号由保存服务管理,不能在 JSON 中修改");
432
+ c.value = M, h.value = 0, v.clearSelection(), ne();
433
+ } catch (M) {
434
+ i.value = M instanceof Error ? M.message : String(M);
279
435
  }
280
436
  }
281
- async function G() {
282
- d.value || v.readonly || !await J("reset") || (oe(I(y.value)), M("update:modelValue", I(c.value)));
437
+ async function ue() {
438
+ o.value || r.readonly || !await z("reset") || (se(U(g.value)), w("update:modelValue", U(c.value)));
283
439
  }
284
- function ee(u) {
285
- if (d.value || v.readonly) return;
286
- D.record(O());
287
- const o = D.move(u);
288
- if (!o) return;
289
- P.cancel();
290
- const l = JSON.parse(o);
291
- c.value = l.document, f.value = l.json, h.value = l.appliedJson, s.value = "", m.value = 0, i.clearSelection(), k.value.ok && M("update:modelValue", I(c.value));
292
- }
293
- async function se() {
294
- if (!v.save || !r() || !k.value.ok) return;
295
- const u = ++g;
296
- p = new AbortController(), w.value = !0, s.value = "";
297
- const o = I(c.value);
440
+ function re(M) {
441
+ if (o.value || r.readonly) return;
442
+ V.record(O());
443
+ const L = V.move(M);
444
+ if (!L) return;
445
+ f.cancel();
446
+ const E = JSON.parse(L);
447
+ c.value = E.document, u.value = E.json, S.value = E.appliedJson, i.value = "", h.value = 0, v.clearSelection(), C.value.ok && w("update:modelValue", U(c.value));
448
+ }
449
+ async function de() {
450
+ if (!r.save || !d() || !C.value.ok) return;
451
+ const M = ++k;
452
+ _ = new AbortController(), b.value = !0, i.value = "";
453
+ const L = U(c.value);
298
454
  try {
299
- const l = I(await v.save(o, { expectedRevision: o.revision, signal: p.signal }));
300
- if (u !== g) return;
301
- if (l.id !== o.id) throw new Error("保存服务返回了其他模板的文档");
302
- c.value = l, y.value = U(l), f.value = y.value, h.value = f.value, D.reset(O()), M("saved", I(l)), M("update:modelValue", I(l));
303
- } catch (l) {
304
- u === g && (s.value = l instanceof Error ? l.message : String(l));
455
+ const E = U(await r.save(L, { expectedRevision: L.revision, signal: _.signal }));
456
+ if (M !== k) return;
457
+ if (E.id !== L.id) throw new Error("保存服务返回了其他模板的文档");
458
+ c.value = E, g.value = ee(E), u.value = g.value, S.value = u.value, V.reset(O()), w("saved", U(E)), w("update:modelValue", U(E));
459
+ } catch (E) {
460
+ M === k && (i.value = E instanceof Error ? E.message : String(E));
305
461
  } finally {
306
- u === g && (w.value = !1, p = void 0);
462
+ M === k && (b.value = !1, _ = void 0);
307
463
  }
308
464
  }
309
- const re = A(() => D.canUndo.value || O() !== D.current.value), de = A(() => D.canRedo.value && O() === D.current.value);
310
- return { ...i, canUndo: re, canRedo: de, undo: () => ee(-1), redo: () => ee(1), pendingLocalChanges: Q, jsonPending: B, blocked: d, confirmation: P.confirmation, decideDiscard: P.decide, guardChanges: J, draft: c, json: f, selected: m, error: s, saving: w, dirty: T, validation: k, lists: x, activeList: t, headerAlignments: L, previewOptions: S, fetcher: z, messages: $, setName: ae, setDescription: Z, setColumn: V, applyJson: X, reset: G, save: se };
465
+ const ce = j(() => V.canUndo.value || O() !== V.current.value), ve = j(() => V.canRedo.value && O() === V.current.value);
466
+ return { ...v, canUndo: ce, canRedo: ve, undo: () => re(-1), redo: () => re(1), pendingLocalChanges: Z, jsonPending: G, blocked: o, confirmation: f.confirmation, decideDiscard: f.decide, guardChanges: z, draft: c, json: u, selected: h, error: i, saving: b, dirty: A, validation: C, lists: x, activeList: t, headerAlignments: I, previewOptions: m, fetcher: Q, messages: $, setName: ae, setDescription: B, setColumn: R, applyJson: ie, reset: ue, save: de };
311
467
  }
312
- function Ve(v, M, c, y) {
313
- const f = j("fields"), s = j(v.value[0]?.index ?? -1), w = A(() => {
314
- const p = c.value?.columns[s.value];
315
- return p ? { column: p, index: s.value } : void 0;
468
+ function et(r, w) {
469
+ const c = D("fields"), g = () => w.value?.columns.length ? 0 : -1, u = D(g()), i = j(() => {
470
+ const m = w.value?.columns[u.value];
471
+ return m ? { column: m, index: u.value } : void 0;
316
472
  });
317
- W(y, () => {
318
- v.value.some((p) => p.index === s.value) || (s.value = v.value[0]?.index ?? -1);
319
- }), W(M, () => {
320
- s.value = v.value[0]?.index ?? -1;
321
- }), W(c, (p) => {
322
- p?.columns[s.value] || (s.value = v.value[0]?.index ?? -1);
473
+ te(r, () => {
474
+ u.value = g();
475
+ }), te(w, (m) => {
476
+ m?.columns[u.value] || (u.value = g());
323
477
  });
324
- function $(p) {
325
- v.value.some((g) => g.index === p) && (s.value = p);
478
+ function b(m) {
479
+ w.value?.columns[m] && (u.value = m);
326
480
  }
327
- function S(p) {
328
- const g = v.value;
329
- if (!g.length) return;
330
- const k = Math.max(
481
+ function $(m) {
482
+ const _ = w.value?.columns.length ?? 0;
483
+ _ && (u.value = Math.max(
331
484
  0,
332
- g.findIndex((B) => B.index === s.value)
333
- ), h = {
334
- ArrowDown: Math.min(k + 1, g.length - 1),
335
- ArrowUp: Math.max(k - 1, 0),
336
- Home: 0,
337
- End: g.length - 1
338
- }[p];
339
- if (h !== void 0)
340
- return s.value = g[h].index, s.value;
341
- }
342
- return { section: f, activeIndex: s, activeColumn: w, activate: $, moveColumn: S };
485
+ Math.min(_ - 1, u.value + m)
486
+ ));
487
+ }
488
+ return { section: c, activeIndex: u, activeColumn: i, activate: b, stepColumn: $ };
343
489
  }
344
- const Oe = ["aria-label", "aria-busy"], Ie = { class: "mr-designer-bar" }, Je = { class: "mr-designer-heading" }, Ne = { class: "mr-designer-actions" }, Pe = { class: "mr-designer-history" }, He = ["aria-label", "title", "disabled"], Ge = ["aria-label", "title", "disabled"], Fe = ["disabled"], Ue = ["disabled"], ze = ["aria-label"], qe = { class: "mr-designer-body" }, Ke = { class: "mr-designer-inspector" }, We = ["aria-label"], Qe = ["id", "aria-selected", "aria-controls", "tabindex", "onClick"], Xe = ["id", "aria-labelledby"], Ye = {
490
+ const tt = ["aria-label", "aria-busy"], nt = { class: "mr-designer-bar" }, lt = { class: "mr-designer-heading" }, at = ["aria-label"], ot = ["id", "aria-selected", "aria-controls", "tabindex", "onClick"], st = { class: "mr-designer-actions" }, it = { class: "mr-designer-history" }, rt = ["aria-label", "title", "disabled"], ut = ["aria-label", "title", "disabled"], dt = ["disabled"], ct = ["disabled"], vt = ["aria-label"], mt = { class: "mr-designer-body" }, gt = { class: "mr-designer-inspector" }, ft = ["id", "aria-labelledby"], ht = {
345
491
  key: 0,
346
492
  class: "mr-designer-area"
347
- }, Ze = ["value"], et = {
348
- key: 1,
349
- class: "mr-designer-columns"
350
- }, tt = { class: "mr-designer-directory-heading" }, nt = { class: "mr-designer-search" }, lt = ["aria-label", "placeholder"], ot = ["aria-label", "title"], at = { class: "mr-designer-column-tools" }, st = ["disabled"], it = {
493
+ }, pt = ["value"], bt = { class: "mr-designer-current" }, yt = ["aria-expanded", "aria-controls"], _t = { class: "mr-designer-current-name" }, kt = { class: "mr-designer-directory-entry" }, wt = { class: "mr-designer-field-position" }, Ct = ["aria-label"], St = ["aria-label", "title", "disabled"], xt = ["aria-label", "title", "disabled"], Mt = ["disabled", "aria-label"], Et = { class: "mr-designer-property-group" }, At = ["value"], Tt = ["value"], Dt = { class: "mr-designer-property-group" }, $t = { class: "mr-designer-format-pair" }, jt = { class: "mr-designer-stacked" }, Vt = ["value"], Lt = { class: "mr-designer-stacked" }, Rt = ["value"], Bt = { value: "identifier" }, Pt = { value: "dimension" }, Ot = { value: "measure" }, It = { value: "date" }, Jt = { value: "text" }, Nt = { class: "mr-designer-control-row" }, Gt = { class: "mr-designer-control-row" }, Ht = { class: "mr-designer-toggle" }, Ut = ["checked"], Ft = ["id", "aria-label"], zt = { class: "mr-designer-directory-heading" }, Kt = ["aria-label"], qt = { class: "mr-designer-search" }, Wt = ["aria-label", "placeholder"], Qt = ["aria-label", "title"], Xt = { class: "mr-designer-column-tools" }, Yt = ["disabled"], Zt = {
351
494
  key: 1,
352
495
  role: "status"
353
- }, rt = { key: 2 }, dt = ["aria-label"], ut = ["aria-label", "checked", "disabled", "onChange"], ct = ["data-column-index", "aria-pressed", "tabindex", "onClick"], vt = { class: "mr-designer-column-number" }, mt = { class: "mr-designer-column-name" }, ft = {
496
+ }, en = { key: 2 }, tn = ["aria-label"], nn = ["aria-label", "checked", "disabled", "onChange"], ln = ["data-column-index", "aria-pressed", "tabindex", "onClick"], an = { class: "mr-designer-column-number" }, on = { class: "mr-designer-column-name" }, sn = {
354
497
  key: 0,
355
498
  role: "status",
356
499
  class: "mr-designer-empty"
357
- }, gt = {
500
+ }, rn = {
358
501
  key: 0,
359
502
  class: "mr-designer-batch"
360
- }, ht = ["aria-label", "disabled"], pt = { value: "" }, bt = { value: "auto" }, yt = { value: "left" }, _t = { value: "center" }, kt = { value: "right" }, Ct = { value: "justify" }, wt = ["aria-label", "disabled"], St = { value: "" }, xt = { value: "left" }, Et = { value: "center" }, Mt = { value: "right" }, Tt = { value: "justify" }, At = ["disabled"], Dt = ["value"], jt = ["value"], Rt = ["value"], $t = ["value"], Bt = { value: "identifier" }, Lt = { value: "dimension" }, Vt = { value: "measure" }, Ot = { value: "date" }, It = { value: "text" }, Jt = ["value"], Nt = { value: "auto" }, Pt = { value: "left" }, Ht = { value: "center" }, Gt = { value: "right" }, Ft = { value: "justify" }, Ut = ["value"], zt = { value: "left" }, qt = { value: "center" }, Kt = { value: "right" }, Wt = { value: "justify" }, Qt = { class: "mr-designer-toggle" }, Xt = ["checked"], Yt = {
503
+ }, un = ["aria-label", "disabled"], dn = { value: "" }, cn = { value: "auto" }, vn = { value: "left" }, mn = { value: "center" }, gn = { value: "right" }, fn = { value: "justify" }, hn = ["aria-label", "disabled"], pn = { value: "" }, bn = { value: "left" }, yn = { value: "center" }, _n = { value: "right" }, kn = { value: "justify" }, wn = {
361
504
  key: 2,
362
505
  role: "status",
363
506
  class: "mr-designer-empty"
364
- }, Zt = { class: "mr-designer-stacked" }, en = ["value", "disabled"], tn = { class: "mr-designer-stacked" }, nn = ["value", "disabled"], ln = { class: "mr-designer-identity" }, on = { class: "mr-designer-note" }, an = { class: "mr-designer-note" }, sn = { class: "mr-designer-stacked" }, rn = ["aria-label", "disabled"], dn = ["disabled"], un = {
507
+ }, Cn = { class: "mr-designer-stacked" }, Sn = ["value", "disabled"], xn = { class: "mr-designer-stacked" }, Mn = ["value", "disabled"], En = { class: "mr-designer-technical" }, An = { class: "mr-designer-identity" }, Tn = { class: "mr-designer-stacked mr-designer-json-label" }, Dn = ["aria-label", "disabled"], $n = ["disabled"], jn = {
365
508
  key: 3,
366
509
  role: "status",
367
510
  class: "mr-designer-note mr-designer-pending"
368
- }, cn = ["aria-label"], vn = {
511
+ }, Vn = ["aria-label"], Ln = {
369
512
  key: 0,
370
513
  role: "alert",
371
514
  class: "mr-designer-error"
372
- }, mn = {
515
+ }, Rn = {
373
516
  key: 1,
374
517
  role: "alert",
375
518
  class: "mr-designer-error"
376
- }, fn = {
519
+ }, Bn = {
377
520
  key: 3,
378
521
  class: "mr-designer-note mr-designer-invalid"
379
- }, gn = /* @__PURE__ */ ye({
522
+ }, Pn = /* @__PURE__ */ Ce({
380
523
  __name: "ReportTemplateEditor",
381
524
  props: {
382
525
  modelValue: {},
@@ -388,132 +531,137 @@ const Oe = ["aria-label", "aria-busy"], Ie = { class: "mr-designer-bar" }, Je =
388
531
  save: { type: Function }
389
532
  },
390
533
  emits: ["update:modelValue", "saved"],
391
- setup(v, { expose: M, emit: c }) {
392
- const y = v, f = c, s = Le(y, (u, o) => {
393
- f(u === "saved" ? "saved" : "update:modelValue", o);
534
+ setup(r, { expose: w, emit: c }) {
535
+ const g = r, u = c, i = Ze(g, (J, a) => {
536
+ u(J === "saved" ? "saved" : "update:modelValue", a);
394
537
  }), {
395
- draft: w,
538
+ draft: b,
396
539
  json: $,
397
- selected: S,
398
- error: p,
399
- saving: g,
400
- pendingLocalChanges: k,
401
- jsonPending: T,
402
- blocked: h,
403
- confirmation: B,
404
- canUndo: Q,
540
+ selected: m,
541
+ error: _,
542
+ saving: k,
543
+ pendingLocalChanges: C,
544
+ jsonPending: A,
545
+ blocked: S,
546
+ confirmation: G,
547
+ canUndo: Z,
405
548
  canRedo: O,
406
- validation: D,
407
- lists: P,
408
- activeList: d,
409
- visibleColumns: r,
410
- query: i,
411
- selectedColumns: m,
549
+ validation: V,
550
+ lists: f,
551
+ activeList: o,
552
+ visibleColumns: d,
553
+ query: v,
554
+ selectedColumns: h,
412
555
  fetcher: x,
413
556
  messages: t
414
- } = s, L = Ve(
415
- r,
416
- S,
417
- d,
418
- i
419
- ), { section: V, activeIndex: z, activeColumn: E } = L, H = `mr-designer-${_e()?.uid ?? 0}`, J = ["fields", "template", "advanced"], oe = A(
420
- () => g.value ? t.value.saving : y.readonly ? t.value.readonly : k.value ? t.value.dirty : t.value.ready
421
- ), q = j(null), ae = j(null), Z = j(null);
422
- W(V, async (u) => {
423
- if (await ne(), Z.value && (Z.value.scrollTop = 0), u !== "fields") return;
424
- const o = ae.value, l = o?.querySelector(
425
- `button[data-column-index="${z.value}"]`
426
- );
427
- if (!o || !l) return;
428
- const b = o.getBoundingClientRect(), F = l.getBoundingClientRect(), te = b.top + o.clientTop, me = te + o.clientHeight;
429
- F.top < te ? o.scrollTop += F.top - te : F.bottom > me && (o.scrollTop += F.bottom - me);
557
+ } = i, I = et(m, o), { section: R, activeIndex: Q, activeColumn: T } = I, F = `mr-designer-${Te()?.uid ?? 0}`, z = ["fields", "template", "advanced"], se = j(
558
+ () => k.value ? t.value.saving : g.readonly ? t.value.readonly : C.value ? t.value.dirty : t.value.ready
559
+ ), ne = D(null), ae = D(null), B = ze(I, R, d), {
560
+ open: ie,
561
+ cursor: ue,
562
+ trigger: re,
563
+ panel: de,
564
+ search: ce,
565
+ list: ve
566
+ } = B;
567
+ te(R, async () => {
568
+ await Y(), ae.value && (ae.value.scrollTop = 0);
430
569
  });
431
- let X = null;
432
- W(B, async (u) => {
433
- u ? (X = document.activeElement, await ne(), q.value?.focus()) : (await ne(), X?.isConnected && X.focus(), X = null);
434
- }), M({
570
+ const M = j(() => ({
571
+ auto: t.value.auto,
572
+ left: t.value.left,
573
+ center: t.value.center,
574
+ right: t.value.right,
575
+ justify: t.value.justify
576
+ }));
577
+ let L = null;
578
+ te(G, async (J) => {
579
+ J ? (L = document.activeElement, await Y(), ne.value?.focus()) : (await Y(), L?.isConnected && L.focus(), L = null);
580
+ }), w({
435
581
  get pendingLocalChanges() {
436
- return k.value;
582
+ return C.value;
437
583
  },
438
584
  get saving() {
439
- return g.value;
585
+ return k.value;
440
586
  },
441
587
  get blocked() {
442
- return h.value;
588
+ return S.value;
443
589
  },
444
- guardChanges: s.guardChanges,
445
- reset: s.reset,
446
- save: s.save
590
+ guardChanges: i.guardChanges,
591
+ reset: i.reset,
592
+ save: i.save
447
593
  });
448
- function G(u) {
449
- return u.target.value;
594
+ function E(J) {
595
+ return J.target.value;
450
596
  }
451
- function ee(u) {
452
- return u.target.checked;
597
+ function K(J) {
598
+ return J.target.checked;
453
599
  }
454
- function se(u, o) {
455
- const l = u.target;
456
- s.alignColumns(
457
- o,
600
+ function ye(J, a) {
601
+ const l = J.target;
602
+ i.alignColumns(
603
+ a,
458
604
  l.value
459
605
  ), l.value = "";
460
606
  }
461
- async function re(u) {
462
- const o = L.moveColumn(u.key);
463
- if (o === void 0) return;
464
- u.preventDefault();
465
- const l = u.currentTarget.closest(
466
- ".mr-designer-column-list"
467
- );
468
- await ne();
469
- const b = l?.querySelector(
470
- `button[data-column-index="${o}"]`
471
- );
472
- b?.focus({ preventScroll: !0 }), b?.scrollIntoView({ block: "nearest" });
473
- }
474
- async function de(u) {
607
+ async function xe(J) {
475
608
  const l = {
476
609
  ArrowRight: 1,
477
610
  ArrowLeft: -1,
478
- Home: -J.length,
479
- End: J.length
480
- }[u.key];
611
+ Home: -z.length,
612
+ End: z.length
613
+ }[J.key];
481
614
  if (l === void 0) return;
482
- u.preventDefault();
483
- const b = J.indexOf(V.value), F = u.key === "Home" ? 0 : u.key === "End" ? J.length - 1 : (b + l + J.length) % J.length;
484
- V.value = J[F];
485
- const te = u.currentTarget.parentElement;
486
- await ne(), te?.querySelector(`#${H}-tab-${V.value}`)?.focus();
615
+ J.preventDefault();
616
+ const N = z.indexOf(R.value), le = J.key === "Home" ? 0 : J.key === "End" ? z.length - 1 : (N + l + z.length) % z.length;
617
+ R.value = z[le];
618
+ const Me = J.currentTarget.parentElement;
619
+ await Y(), Me?.querySelector(`#${F}-tab-${R.value}`)?.focus();
487
620
  }
488
- return (u, o) => (_(), C("section", {
621
+ return (J, a) => (p(), y("section", {
489
622
  class: "mr-designer",
490
623
  "aria-label": e(t).title,
491
- "aria-busy": e(g)
624
+ "aria-busy": e(k)
492
625
  }, [
493
- n("header", Ie, [
494
- n("div", Je, [
495
- le(Y, {
626
+ n("header", nt, [
627
+ n("div", lt, [
628
+ q(W, {
496
629
  name: "columns",
497
- size: 18
630
+ size: 15
498
631
  }),
499
- n("div", null, [
500
- n("strong", null, a(e(t).heading), 1),
501
- n("span", {
502
- class: fe({ "mr-designer-dirty": e(k) })
503
- }, a(oe.value), 3)
504
- ])
632
+ n("strong", null, s(e(t).heading), 1),
633
+ n("span", {
634
+ class: me({ "mr-designer-dirty": e(C) })
635
+ }, s(se.value), 3)
505
636
  ]),
506
- n("div", Ne, [
507
- n("div", Pe, [
637
+ n("nav", {
638
+ class: "mr-designer-tabs",
639
+ role: "tablist",
640
+ "aria-label": e(t).sectionsLabel
641
+ }, [
642
+ (p(), y(X, null, oe(z, (l) => n("button", {
643
+ id: `${F}-tab-${l}`,
644
+ key: l,
645
+ type: "button",
646
+ role: "tab",
647
+ "aria-selected": e(R) === l,
648
+ "aria-controls": `${F}-panel-${l}`,
649
+ tabindex: e(R) === l ? 0 : -1,
650
+ onClick: (N) => R.value = l,
651
+ onKeydown: xe
652
+ }, s(e(t)[`${l}Section`]), 41, ot)), 64))
653
+ ], 8, at),
654
+ n("div", st, [
655
+ n("div", it, [
508
656
  n("button", {
509
657
  type: "button",
510
658
  class: "mr-designer-icon-button",
511
659
  "aria-label": e(t).undo,
512
660
  title: e(t).undo,
513
- disabled: v.readonly || e(h) || !e(Q),
514
- onClick: o[0] || (o[0] = //@ts-ignore
515
- (...l) => e(s).undo && e(s).undo(...l))
516
- }, [...o[25] || (o[25] = [
661
+ disabled: r.readonly || e(S) || !e(Z),
662
+ onClick: a[0] || (a[0] = //@ts-ignore
663
+ (...l) => e(i).undo && e(i).undo(...l))
664
+ }, [...a[34] || (a[34] = [
517
665
  n("svg", {
518
666
  viewBox: "0 0 24 24",
519
667
  fill: "none",
@@ -521,16 +669,16 @@ const Oe = ["aria-label", "aria-busy"], Ie = { class: "mr-designer-bar" }, Je =
521
669
  }, [
522
670
  n("path", { d: "M4 10h10a6 6 0 0 1 0 12M4 10l5-5M4 10l5 5" })
523
671
  ], -1)
524
- ])], 8, He),
672
+ ])], 8, rt),
525
673
  n("button", {
526
674
  type: "button",
527
675
  class: "mr-designer-icon-button",
528
676
  "aria-label": e(t).redo,
529
677
  title: e(t).redo,
530
- disabled: v.readonly || e(h) || !e(O),
531
- onClick: o[1] || (o[1] = //@ts-ignore
532
- (...l) => e(s).redo && e(s).redo(...l))
533
- }, [...o[26] || (o[26] = [
678
+ disabled: r.readonly || e(S) || !e(O),
679
+ onClick: a[1] || (a[1] = //@ts-ignore
680
+ (...l) => e(i).redo && e(i).redo(...l))
681
+ }, [...a[35] || (a[35] = [
534
682
  n("svg", {
535
683
  viewBox: "0 0 24 24",
536
684
  fill: "none",
@@ -538,405 +686,492 @@ const Oe = ["aria-label", "aria-busy"], Ie = { class: "mr-designer-bar" }, Je =
538
686
  }, [
539
687
  n("path", { d: "M20 10H10a6 6 0 0 0 0 12m10-12-5-5m5 5-5 5" })
540
688
  ], -1)
541
- ])], 8, Ge)
689
+ ])], 8, ut)
542
690
  ]),
543
691
  n("button", {
544
692
  type: "button",
545
693
  class: "mr-designer-reset",
546
- disabled: v.readonly || e(h) || !e(k),
547
- onClick: o[2] || (o[2] = //@ts-ignore
548
- (...l) => e(s).reset && e(s).reset(...l))
549
- }, a(e(t).reset), 9, Fe),
550
- v.save ? (_(), C("button", {
694
+ disabled: r.readonly || e(S) || !e(C),
695
+ onClick: a[2] || (a[2] = //@ts-ignore
696
+ (...l) => e(i).reset && e(i).reset(...l))
697
+ }, s(e(t).reset), 9, dt),
698
+ r.save ? (p(), y("button", {
551
699
  key: 0,
552
700
  type: "button",
553
701
  class: "mr-designer-save",
554
- disabled: v.readonly || e(h) || e(T) || !e(D).ok || !e(k),
555
- onClick: o[3] || (o[3] = //@ts-ignore
556
- (...l) => e(s).save && e(s).save(...l))
702
+ disabled: r.readonly || e(S) || e(A) || !e(V).ok || !e(C),
703
+ onClick: a[3] || (a[3] = //@ts-ignore
704
+ (...l) => e(i).save && e(i).save(...l))
557
705
  }, [
558
- le(Y, {
706
+ q(W, {
559
707
  name: "file",
560
- size: 14
708
+ size: 13
561
709
  }),
562
- R(a(e(g) ? e(t).saving : e(t).save), 1)
563
- ], 8, Ue)) : N("", !0)
710
+ P(s(e(k) ? e(t).saving : e(t).save), 1)
711
+ ], 8, ct)) : H("", !0)
564
712
  ])
565
713
  ]),
566
- e(B) ? (_(), C("div", {
714
+ e(G) ? (p(), y("div", {
567
715
  key: 0,
568
716
  role: "alertdialog",
569
717
  "aria-label": e(t).discardTitle,
570
718
  class: "mr-designer-confirm",
571
- onKeydown: o[6] || (o[6] = ke(Ce((l) => e(s).decideDiscard(!1), ["prevent"]), ["esc"]))
719
+ onKeydown: a[6] || (a[6] = ge(De((l) => e(i).decideDiscard(!1), ["prevent", "stop"]), ["esc"]))
572
720
  }, [
573
721
  n("div", null, [
574
- n("strong", null, a(e(t).discardTitle), 1),
575
- n("p", null, a(e(t).discardDescription), 1)
722
+ n("strong", null, s(e(t).discardTitle), 1),
723
+ n("p", null, s(e(t).discardDescription), 1)
576
724
  ]),
577
725
  n("div", null, [
578
726
  n("button", {
579
727
  ref_key: "keepButton",
580
- ref: q,
728
+ ref: ne,
581
729
  type: "button",
582
- onClick: o[4] || (o[4] = (l) => e(s).decideDiscard(!1))
583
- }, a(e(t).keepEditing), 513),
730
+ onClick: a[4] || (a[4] = (l) => e(i).decideDiscard(!1))
731
+ }, s(e(t).keepEditing), 513),
584
732
  n("button", {
585
733
  type: "button",
586
- onClick: o[5] || (o[5] = (l) => e(s).decideDiscard(!0))
587
- }, a(e(t).discard), 1)
734
+ onClick: a[5] || (a[5] = (l) => e(i).decideDiscard(!0))
735
+ }, s(e(t).discard), 1)
588
736
  ])
589
- ], 40, ze)) : N("", !0),
590
- n("div", qe, [
591
- n("aside", Ke, [
592
- n("nav", {
593
- class: "mr-designer-tabs",
594
- role: "tablist",
595
- "aria-label": e(t).sectionsLabel
596
- }, [
597
- (_(), C(K, null, ie(J, (l) => n("button", {
598
- id: `${H}-tab-${l}`,
599
- key: l,
600
- type: "button",
601
- role: "tab",
602
- "aria-selected": e(V) === l,
603
- "aria-controls": `${H}-panel-${l}`,
604
- tabindex: e(V) === l ? 0 : -1,
605
- onClick: (b) => V.value = l,
606
- onKeydown: de
607
- }, a(e(t)[`${l}Section`]), 41, Qe)), 64))
608
- ], 8, We),
737
+ ], 40, vt)) : H("", !0),
738
+ n("div", mt, [
739
+ n("aside", gt, [
609
740
  n("div", {
610
741
  ref_key: "inspectorPanel",
611
- ref: Z,
612
- id: `${H}-panel-${e(V)}`,
613
- class: "mr-designer-panel",
742
+ ref: ae,
743
+ id: `${F}-panel-${e(R)}`,
744
+ class: me(["mr-designer-panel", { "is-advanced": e(R) === "advanced" }]),
614
745
  role: "tabpanel",
615
- "aria-labelledby": `${H}-tab-${e(V)}`
746
+ "aria-labelledby": `${F}-tab-${e(R)}`
616
747
  }, [
617
- e(V) === "fields" ? (_(), C(K, { key: 0 }, [
618
- e(P).length > 1 ? (_(), C("label", Ye, [
619
- R(a(e(t).area), 1),
620
- ue(n("select", {
621
- "onUpdate:modelValue": o[7] || (o[7] = (l) => ce(S) ? S.value = l : null)
748
+ e(R) === "fields" ? (p(), y(X, { key: 0 }, [
749
+ e(f).length > 1 ? (p(), y("label", ht, [
750
+ P(s(e(t).area), 1),
751
+ fe(n("select", {
752
+ "onUpdate:modelValue": a[7] || (a[7] = (l) => he(m) ? m.value = l : null)
622
753
  }, [
623
- (_(!0), C(K, null, ie(e(P), (l, b) => (_(), C("option", {
624
- key: b,
625
- value: b
626
- }, a(l.pageIndex + 1) + " " + a(e(t).page) + " · " + a(l.component.title || l.component.dataset), 9, Ze))), 128))
754
+ (p(!0), y(X, null, oe(e(f), (l, N) => (p(), y("option", {
755
+ key: N,
756
+ value: N
757
+ }, s(l.pageIndex + 1) + " " + s(e(t).page) + " · " + s(l.component.title || l.component.dataset), 9, pt))), 128))
627
758
  ], 512), [
628
- [we, e(S)]
759
+ [$e, e(m)]
629
760
  ])
630
- ])) : N("", !0),
631
- e(d) ? (_(), C("div", et, [
632
- n("div", tt, [
633
- n("strong", null, a(e(t).columnDirectory), 1),
634
- n("span", null, a(e(d).columns.length) + " " + a(e(t).fieldsCount), 1)
635
- ]),
636
- n("div", nt, [
637
- le(Y, {
638
- name: "search",
639
- size: 15
640
- }),
641
- ue(n("input", {
642
- "onUpdate:modelValue": o[8] || (o[8] = (l) => ce(i) ? i.value = l : null),
643
- type: "search",
644
- "aria-label": e(t).columnsSearch,
645
- placeholder: e(t).columnsSearch
646
- }, null, 8, lt), [
647
- [ge, e(i)]
648
- ]),
649
- e(i) ? (_(), C("button", {
650
- key: 0,
651
- type: "button",
652
- class: "mr-designer-icon-button",
653
- "aria-label": e(t).clearSearch,
654
- title: e(t).clearSearch,
655
- onClick: o[9] || (o[9] = (l) => i.value = "")
656
- }, [
657
- le(Y, {
658
- name: "close",
659
- size: 14
660
- })
661
- ], 8, ot)) : N("", !0)
662
- ]),
663
- n("div", at, [
761
+ ])) : H("", !0),
762
+ e(o) ? (p(), y(X, { key: 1 }, [
763
+ n("div", bt, [
664
764
  n("button", {
765
+ ref_key: "directoryTrigger",
766
+ ref: re,
665
767
  type: "button",
666
- disabled: v.readonly || e(h) || e(T) || !e(r).length,
667
- onClick: o[10] || (o[10] = (l) => e(s).selectVisible(!0))
668
- }, a(e(t).selectVisible), 9, st),
669
- e(m).length ? (_(), C("button", {
670
- key: 0,
671
- type: "button",
672
- onClick: o[11] || (o[11] = //@ts-ignore
673
- (...l) => e(s).clearSelection && e(s).clearSelection(...l))
674
- }, a(e(t).clearSelection), 1)) : N("", !0),
675
- e(m).length ? (_(), C("span", it, a(e(t).columnsSelected) + " " + a(e(m).length), 1)) : (_(), C("span", rt, a(e(r).length) + " / " + a(e(d).columns.length), 1))
676
- ]),
677
- n("div", {
678
- ref_key: "columnList",
679
- ref: ae,
680
- class: "mr-designer-column-list",
681
- "aria-label": e(t).columnDirectory,
682
- role: "group"
683
- }, [
684
- (_(!0), C(K, null, ie(e(r), ({ column: l, index: b }) => (_(), C("div", {
685
- key: b,
686
- class: fe(["mr-designer-column-row", { "is-active": e(z) === b }])
768
+ class: "mr-designer-field-trigger",
769
+ "aria-expanded": e(ie),
770
+ "aria-controls": `${F}-directory`,
771
+ "aria-haspopup": "dialog",
772
+ onClick: a[8] || (a[8] = //@ts-ignore
773
+ (...l) => e(B).toggle && e(B).toggle(...l)),
774
+ onKeydown: a[9] || (a[9] = ge(
775
+ //@ts-ignore
776
+ (...l) => e(B).escape && e(B).escape(...l),
777
+ ["esc"]
778
+ ))
687
779
  }, [
688
- n("input", {
689
- type: "checkbox",
690
- "aria-label": `${e(t).selectColumn} ${l.header}`,
691
- checked: e(m).includes(b),
692
- disabled: v.readonly || e(h) || e(T),
693
- onChange: (F) => e(s).toggleColumn(b, ee(F))
694
- }, null, 40, ut),
780
+ n("span", _t, [
781
+ n("strong", null, s(e(T)?.column.header || e(t).noColumns), 1),
782
+ n("small", null, s(e(T)?.column.field || "—"), 1)
783
+ ]),
784
+ n("span", kt, [
785
+ P(s(e(t).columnDirectory) + " ", 1),
786
+ n("b", null, s(e(o).columns.length), 1),
787
+ q(W, {
788
+ name: "chevron-down",
789
+ size: 13
790
+ })
791
+ ])
792
+ ], 40, yt),
793
+ n("div", wt, [
794
+ n("span", {
795
+ "aria-label": e(t).fieldPosition
796
+ }, [
797
+ P(s(e(Q) >= 0 ? e(Q) + 1 : 0), 1),
798
+ a[36] || (a[36] = n("i", null, "/", -1)),
799
+ P(s(e(o).columns.length), 1)
800
+ ], 8, Ct),
695
801
  n("button", {
696
802
  type: "button",
697
- "data-column-index": b,
698
- "aria-pressed": e(z) === b,
699
- tabindex: e(z) === b ? 0 : -1,
700
- onClick: (F) => e(L).activate(b),
701
- onKeydown: re
803
+ class: "mr-designer-icon-button",
804
+ "aria-label": e(t).previousColumn,
805
+ title: e(t).previousColumn,
806
+ disabled: e(Q) <= 0,
807
+ onClick: a[10] || (a[10] = (l) => e(I).stepColumn(-1))
702
808
  }, [
703
- n("span", vt, a(b + 1), 1),
704
- n("span", mt, [
705
- n("strong", null, a(l.header), 1),
706
- n("small", null, a(l.field), 1)
707
- ]),
708
- e(z) === b ? (_(), he(Y, {
709
- key: 0,
710
- name: "chevron-right",
809
+ q(W, {
810
+ name: "chevron-left",
711
811
  size: 14
712
- })) : N("", !0)
713
- ], 40, ct)
714
- ], 2))), 128)),
715
- e(r).length ? N("", !0) : (_(), C("p", ft, [
716
- le(Y, {
717
- name: "search",
718
- size: 20
719
- }),
720
- R(a(e(t).noColumns), 1)
721
- ]))
722
- ], 8, dt),
723
- e(m).length ? (_(), C("div", gt, [
724
- n("label", null, [
725
- R(a(e(t).batchBody), 1),
726
- n("select", {
727
- "aria-label": e(t).batchBody,
728
- disabled: v.readonly || e(h) || e(T),
729
- onChange: o[12] || (o[12] = (l) => se(l, "align"))
730
- }, [
731
- n("option", pt, a(e(t).chooseAlignment), 1),
732
- n("option", bt, a(e(t).auto), 1),
733
- n("option", yt, a(e(t).left), 1),
734
- n("option", _t, a(e(t).center), 1),
735
- n("option", kt, a(e(t).right), 1),
736
- n("option", Ct, a(e(t).justify), 1)
737
- ], 40, ht)
738
- ]),
739
- n("label", null, [
740
- R(a(e(t).batchHeader), 1),
741
- n("select", {
742
- "aria-label": e(t).batchHeader,
743
- disabled: v.readonly || e(h) || e(T),
744
- onChange: o[13] || (o[13] = (l) => se(l, "headerAlign"))
812
+ })
813
+ ], 8, St),
814
+ n("button", {
815
+ type: "button",
816
+ class: "mr-designer-icon-button",
817
+ "aria-label": e(t).nextColumn,
818
+ title: e(t).nextColumn,
819
+ disabled: e(Q) >= e(o).columns.length - 1,
820
+ onClick: a[11] || (a[11] = (l) => e(I).stepColumn(1))
745
821
  }, [
746
- n("option", St, a(e(t).chooseAlignment), 1),
747
- n("option", xt, a(e(t).left), 1),
748
- n("option", Et, a(e(t).center), 1),
749
- n("option", Mt, a(e(t).right), 1),
750
- n("option", Tt, a(e(t).justify), 1)
751
- ], 40, wt)
822
+ q(W, {
823
+ name: "chevron-right",
824
+ size: 14
825
+ })
826
+ ], 8, xt)
752
827
  ])
753
- ])) : N("", !0),
754
- e(E) ? (_(), C("fieldset", {
755
- key: 1,
828
+ ]),
829
+ e(T) ? (p(), y("fieldset", {
830
+ key: 0,
756
831
  class: "mr-designer-properties",
757
- disabled: v.readonly || e(h) || e(T)
832
+ disabled: r.readonly || e(S) || e(A),
833
+ "aria-label": e(t).columnProperties
758
834
  }, [
759
- n("legend", null, [
760
- R(a(e(t).columnProperties) + " ", 1),
761
- n("span", null, a(e(E).index + 1) + " · " + a(e(E).column.header), 1)
762
- ]),
763
- n("label", null, [
764
- R(a(e(t).header), 1),
765
- n("input", {
766
- value: e(E).column.header,
767
- onInput: o[14] || (o[14] = (l) => e(s).setColumn(
768
- e(E).index,
769
- "header",
770
- G(l)
771
- ))
772
- }, null, 40, Dt)
835
+ n("div", Et, [
836
+ n("h3", null, s(e(t).contentGroup), 1),
837
+ n("label", null, [
838
+ P(s(e(t).header), 1),
839
+ n("input", {
840
+ value: e(T).column.header,
841
+ onInput: a[12] || (a[12] = (l) => e(i).setColumn(
842
+ e(T).index,
843
+ "header",
844
+ E(l)
845
+ ))
846
+ }, null, 40, At)
847
+ ]),
848
+ n("label", null, [
849
+ P(s(e(t).field), 1),
850
+ n("input", {
851
+ value: e(T).column.field,
852
+ onChange: a[13] || (a[13] = (l) => e(i).setColumn(
853
+ e(T).index,
854
+ "field",
855
+ E(l)
856
+ ))
857
+ }, null, 40, Tt)
858
+ ])
773
859
  ]),
774
- n("label", null, [
775
- R(a(e(t).field), 1),
776
- n("input", {
777
- value: e(E).column.field,
778
- onChange: o[15] || (o[15] = (l) => e(s).setColumn(
779
- e(E).index,
780
- "field",
781
- G(l)
782
- ))
783
- }, null, 40, jt)
860
+ n("div", Dt, [
861
+ n("h3", null, s(e(t).formatGroup), 1),
862
+ n("div", $t, [
863
+ n("label", jt, [
864
+ P(s(e(t).width), 1),
865
+ n("input", {
866
+ type: "number",
867
+ min: "0.1",
868
+ step: "0.5",
869
+ value: e(T).column.widthMm,
870
+ onChange: a[14] || (a[14] = (l) => e(i).setColumn(
871
+ e(T).index,
872
+ "widthMm",
873
+ E(l)
874
+ ))
875
+ }, null, 40, Vt)
876
+ ]),
877
+ n("label", Lt, [
878
+ P(s(e(t).semantic), 1),
879
+ n("select", {
880
+ value: e(T).column.semanticRole || "text",
881
+ onChange: a[15] || (a[15] = (l) => e(i).setColumn(
882
+ e(T).index,
883
+ "semanticRole",
884
+ E(l)
885
+ ))
886
+ }, [
887
+ n("option", Bt, s(e(t).identifier), 1),
888
+ n("option", Pt, s(e(t).dimension), 1),
889
+ n("option", Ot, s(e(t).measure), 1),
890
+ n("option", It, s(e(t).date), 1),
891
+ n("option", Jt, s(e(t).text), 1)
892
+ ], 40, Rt)
893
+ ])
894
+ ]),
895
+ n("div", Nt, [
896
+ n("span", null, s(e(t).bodyAlign), 1),
897
+ q(we, {
898
+ "model-value": e(T).column.align ?? e(T).column.style?.align ?? e(o).align ?? "left",
899
+ label: e(t).bodyAlign,
900
+ labels: M.value,
901
+ "auto-label": e(t).autoShort,
902
+ "allow-auto": "",
903
+ "onUpdate:modelValue": a[16] || (a[16] = (l) => e(i).setColumn(e(T).index, "align", l))
904
+ }, null, 8, ["model-value", "label", "labels", "auto-label"])
905
+ ]),
906
+ n("div", Gt, [
907
+ n("span", null, s(e(t).headerAlign), 1),
908
+ q(we, {
909
+ "model-value": e(i).headerAlignments.value[e(T).index] || "left",
910
+ label: e(t).headerAlign,
911
+ labels: M.value,
912
+ "auto-label": e(t).autoShort,
913
+ "onUpdate:modelValue": a[17] || (a[17] = (l) => e(i).setColumn(
914
+ e(T).index,
915
+ "headerAlign",
916
+ l
917
+ ))
918
+ }, null, 8, ["model-value", "label", "labels", "auto-label"])
919
+ ])
784
920
  ]),
785
- n("label", null, [
786
- R(a(e(t).width), 1),
921
+ n("label", Ht, [
922
+ P(s(e(t).editable), 1),
787
923
  n("input", {
788
- type: "number",
789
- min: "0.1",
790
- step: "0.5",
791
- value: e(E).column.widthMm,
792
- onChange: o[16] || (o[16] = (l) => e(s).setColumn(
793
- e(E).index,
794
- "widthMm",
795
- G(l)
796
- ))
797
- }, null, 40, Rt)
798
- ]),
799
- n("label", null, [
800
- R(a(e(t).semantic), 1),
801
- n("select", {
802
- value: e(E).column.semanticRole || "text",
803
- onChange: o[17] || (o[17] = (l) => e(s).setColumn(
804
- e(E).index,
805
- "semanticRole",
806
- G(l)
924
+ type: "checkbox",
925
+ role: "switch",
926
+ checked: e(T).column.editable === !0,
927
+ onChange: a[18] || (a[18] = (l) => e(i).setColumn(
928
+ e(T).index,
929
+ "editable",
930
+ K(l)
807
931
  ))
932
+ }, null, 40, Ut)
933
+ ])
934
+ ], 8, Mt)) : H("", !0),
935
+ e(ie) ? (p(), y("div", {
936
+ key: 1,
937
+ id: `${F}-directory`,
938
+ ref_key: "directoryPanel",
939
+ ref: de,
940
+ role: "dialog",
941
+ "aria-label": e(t).columnDirectory,
942
+ class: "mr-designer-directory",
943
+ onKeydown: a[28] || (a[28] = ge(
944
+ //@ts-ignore
945
+ (...l) => e(B).escape && e(B).escape(...l),
946
+ ["esc"]
947
+ )),
948
+ onFocusout: a[29] || (a[29] = //@ts-ignore
949
+ (...l) => e(B).leave && e(B).leave(...l))
950
+ }, [
951
+ n("div", zt, [
952
+ n("strong", null, [
953
+ P(s(e(t).columnDirectory) + " ", 1),
954
+ n("span", null, s(e(o).columns.length), 1)
955
+ ]),
956
+ n("button", {
957
+ type: "button",
958
+ class: "mr-designer-icon-button",
959
+ "aria-label": e(t).closeDirectory,
960
+ onClick: a[19] || (a[19] = (l) => e(B).close(!0))
808
961
  }, [
809
- n("option", Bt, a(e(t).identifier), 1),
810
- n("option", Lt, a(e(t).dimension), 1),
811
- n("option", Vt, a(e(t).measure), 1),
812
- n("option", Ot, a(e(t).date), 1),
813
- n("option", It, a(e(t).text), 1)
814
- ], 40, $t)
962
+ q(W, {
963
+ name: "close",
964
+ size: 15
965
+ })
966
+ ], 8, Kt)
815
967
  ]),
816
- n("label", null, [
817
- R(a(e(t).bodyAlign), 1),
818
- n("select", {
819
- value: e(E).column.align ?? e(E).column.style?.align ?? e(d).align ?? "left",
820
- onChange: o[18] || (o[18] = (l) => e(s).setColumn(
821
- e(E).index,
822
- "align",
823
- G(l)
824
- ))
968
+ n("div", qt, [
969
+ q(W, {
970
+ name: "search",
971
+ size: 14
972
+ }),
973
+ fe(n("input", {
974
+ ref_key: "directorySearch",
975
+ ref: ce,
976
+ "onUpdate:modelValue": a[20] || (a[20] = (l) => he(v) ? v.value = l : null),
977
+ type: "search",
978
+ "aria-label": e(t).columnsSearch,
979
+ placeholder: e(t).columnsSearch,
980
+ onKeydown: a[21] || (a[21] = //@ts-ignore
981
+ (...l) => e(B).searchKeydown && e(B).searchKeydown(...l))
982
+ }, null, 40, Wt), [
983
+ [_e, e(v)]
984
+ ]),
985
+ e(v) ? (p(), y("button", {
986
+ key: 0,
987
+ type: "button",
988
+ class: "mr-designer-icon-button",
989
+ "aria-label": e(t).clearSearch,
990
+ title: e(t).clearSearch,
991
+ onClick: a[22] || (a[22] = (l) => v.value = "")
825
992
  }, [
826
- n("option", Nt, a(e(t).auto), 1),
827
- n("option", Pt, a(e(t).left), 1),
828
- n("option", Ht, a(e(t).center), 1),
829
- n("option", Gt, a(e(t).right), 1),
830
- n("option", Ft, a(e(t).justify), 1)
831
- ], 40, Jt)
993
+ q(W, {
994
+ name: "close",
995
+ size: 13
996
+ })
997
+ ], 8, Qt)) : H("", !0)
832
998
  ]),
833
- n("label", null, [
834
- R(a(e(t).headerAlign), 1),
835
- n("select", {
836
- value: e(s).headerAlignments.value[e(E).index],
837
- onChange: o[19] || (o[19] = (l) => e(s).setColumn(
838
- e(E).index,
839
- "headerAlign",
840
- G(l)
841
- ))
842
- }, [
843
- n("option", zt, a(e(t).left), 1),
844
- n("option", qt, a(e(t).center), 1),
845
- n("option", Kt, a(e(t).right), 1),
846
- n("option", Wt, a(e(t).justify), 1)
847
- ], 40, Ut)
999
+ n("div", Xt, [
1000
+ n("button", {
1001
+ type: "button",
1002
+ disabled: r.readonly || e(S) || e(A) || !e(d).length,
1003
+ onClick: a[23] || (a[23] = (l) => e(i).selectVisible(!0))
1004
+ }, s(e(t).selectVisible), 9, Yt),
1005
+ e(h).length ? (p(), y("button", {
1006
+ key: 0,
1007
+ type: "button",
1008
+ onClick: a[24] || (a[24] = //@ts-ignore
1009
+ (...l) => e(i).clearSelection && e(i).clearSelection(...l))
1010
+ }, s(e(t).clearSelection), 1)) : H("", !0),
1011
+ e(h).length ? (p(), y("span", Zt, s(e(t).columnsSelected) + " " + s(e(h).length), 1)) : (p(), y("span", en, s(e(d).length) + " / " + s(e(o).columns.length), 1))
848
1012
  ]),
849
- n("label", Qt, [
850
- R(a(e(t).editable), 1),
851
- n("input", {
852
- type: "checkbox",
853
- checked: e(E).column.editable === !0,
854
- onChange: o[20] || (o[20] = (l) => e(s).setColumn(
855
- e(E).index,
856
- "editable",
857
- ee(l)
858
- ))
859
- }, null, 40, Xt)
860
- ])
861
- ], 8, At)) : N("", !0)
862
- ])) : (_(), C("p", Yt, a(e(t).noColumns), 1))
863
- ], 64)) : e(V) === "template" ? (_(), C(K, { key: 1 }, [
864
- n("h3", null, a(e(t).templateDetails), 1),
865
- n("label", Zt, [
866
- R(a(e(t).name), 1),
1013
+ n("div", {
1014
+ ref_key: "columnList",
1015
+ ref: ve,
1016
+ class: "mr-designer-column-list",
1017
+ "aria-label": e(t).columnDirectory,
1018
+ role: "group"
1019
+ }, [
1020
+ (p(!0), y(X, null, oe(e(d), ({ column: l, index: N }) => (p(), y("div", {
1021
+ key: N,
1022
+ class: me(["mr-designer-column-row", { "is-active": e(Q) === N }])
1023
+ }, [
1024
+ n("input", {
1025
+ type: "checkbox",
1026
+ "aria-label": `${e(t).selectColumn} ${l.header}`,
1027
+ checked: e(h).includes(N),
1028
+ disabled: r.readonly || e(S) || e(A),
1029
+ onChange: (le) => e(i).toggleColumn(N, K(le))
1030
+ }, null, 40, nn),
1031
+ n("button", {
1032
+ type: "button",
1033
+ "data-column-index": N,
1034
+ "aria-pressed": e(Q) === N,
1035
+ tabindex: e(ue) === N ? 0 : -1,
1036
+ onClick: (le) => e(B).choose(N),
1037
+ onKeydown: a[25] || (a[25] = //@ts-ignore
1038
+ (...le) => e(B).navigate && e(B).navigate(...le))
1039
+ }, [
1040
+ n("span", an, s(N + 1), 1),
1041
+ n("span", on, [
1042
+ n("strong", null, s(l.header), 1),
1043
+ n("small", null, s(l.field), 1)
1044
+ ]),
1045
+ e(Q) === N ? (p(), ke(W, {
1046
+ key: 0,
1047
+ name: "chevron-right",
1048
+ size: 13
1049
+ })) : H("", !0)
1050
+ ], 40, ln)
1051
+ ], 2))), 128)),
1052
+ e(d).length ? H("", !0) : (p(), y("p", sn, [
1053
+ q(W, {
1054
+ name: "search",
1055
+ size: 20
1056
+ }),
1057
+ P(s(e(t).noColumns), 1)
1058
+ ]))
1059
+ ], 8, tn),
1060
+ e(h).length ? (p(), y("div", rn, [
1061
+ n("label", null, [
1062
+ P(s(e(t).batchBody), 1),
1063
+ n("select", {
1064
+ "aria-label": e(t).batchBody,
1065
+ disabled: r.readonly || e(S) || e(A),
1066
+ onChange: a[26] || (a[26] = (l) => ye(l, "align"))
1067
+ }, [
1068
+ n("option", dn, s(e(t).chooseAlignment), 1),
1069
+ n("option", cn, s(e(t).auto), 1),
1070
+ n("option", vn, s(e(t).left), 1),
1071
+ n("option", mn, s(e(t).center), 1),
1072
+ n("option", gn, s(e(t).right), 1),
1073
+ n("option", fn, s(e(t).justify), 1)
1074
+ ], 40, un)
1075
+ ]),
1076
+ n("label", null, [
1077
+ P(s(e(t).batchHeader), 1),
1078
+ n("select", {
1079
+ "aria-label": e(t).batchHeader,
1080
+ disabled: r.readonly || e(S) || e(A),
1081
+ onChange: a[27] || (a[27] = (l) => ye(l, "headerAlign"))
1082
+ }, [
1083
+ n("option", pn, s(e(t).chooseAlignment), 1),
1084
+ n("option", bn, s(e(t).left), 1),
1085
+ n("option", yn, s(e(t).center), 1),
1086
+ n("option", _n, s(e(t).right), 1),
1087
+ n("option", kn, s(e(t).justify), 1)
1088
+ ], 40, hn)
1089
+ ])
1090
+ ])) : H("", !0)
1091
+ ], 40, Ft)) : H("", !0)
1092
+ ], 64)) : (p(), y("p", wn, s(e(t).noColumns), 1))
1093
+ ], 64)) : e(R) === "template" ? (p(), y(X, { key: 1 }, [
1094
+ n("h3", null, s(e(t).templateDetails), 1),
1095
+ n("label", Cn, [
1096
+ P(s(e(t).name), 1),
867
1097
  n("input", {
868
- value: e(w).name,
869
- disabled: v.readonly || e(h) || e(T),
870
- onInput: o[21] || (o[21] = (l) => e(s).setName(G(l)))
871
- }, null, 40, en)
1098
+ value: e(b).name,
1099
+ disabled: r.readonly || e(S) || e(A),
1100
+ onInput: a[30] || (a[30] = (l) => e(i).setName(E(l)))
1101
+ }, null, 40, Sn)
872
1102
  ]),
873
- n("label", tn, [
874
- R(a(e(t).description), 1),
1103
+ n("label", xn, [
1104
+ P(s(e(t).description), 1),
875
1105
  n("textarea", {
876
- rows: "4",
877
- value: e(w).description,
878
- disabled: v.readonly || e(h) || e(T),
879
- onInput: o[22] || (o[22] = (l) => e(s).setDescription(G(l)))
880
- }, null, 40, nn)
881
- ]),
882
- n("dl", ln, [
883
- n("dt", null, a(e(t).templateIdentity), 1),
884
- n("dd", null, a(e(w).id), 1),
885
- n("dt", null, a(e(t).templateRevision), 1),
886
- n("dd", null, a(e(w).revision || e(t).unpublished), 1)
1106
+ rows: "2",
1107
+ value: e(b).description,
1108
+ disabled: r.readonly || e(S) || e(A),
1109
+ onInput: a[31] || (a[31] = (l) => e(i).setDescription(E(l)))
1110
+ }, null, 40, Mn)
887
1111
  ]),
888
- n("p", on, a(e(t).note), 1)
889
- ], 64)) : (_(), C(K, { key: 2 }, [
890
- n("h3", null, a(e(t).advancedTitle), 1),
891
- n("p", an, a(e(t).advancedDescription), 1),
892
- n("label", sn, [
893
- R(a(e(t).json), 1),
894
- ue(n("textarea", {
895
- "onUpdate:modelValue": o[23] || (o[23] = (l) => ce($) ? $.value = l : null),
1112
+ n("details", En, [
1113
+ n("summary", null, s(e(t).technicalDetails), 1),
1114
+ n("dl", An, [
1115
+ n("dt", null, s(e(t).templateIdentity), 1),
1116
+ n("dd", null, s(e(b).id), 1),
1117
+ n("dt", null, s(e(t).templateRevision), 1),
1118
+ n("dd", null, s(e(b).revision || e(t).unpublished), 1)
1119
+ ])
1120
+ ])
1121
+ ], 64)) : (p(), y(X, { key: 2 }, [
1122
+ n("h3", null, s(e(t).advancedTitle), 1),
1123
+ n("label", Tn, [
1124
+ P(s(e(t).json), 1),
1125
+ fe(n("textarea", {
1126
+ "onUpdate:modelValue": a[32] || (a[32] = (l) => he($) ? $.value = l : null),
896
1127
  class: "mr-designer-json",
897
1128
  "aria-label": e(t).json,
898
- disabled: v.readonly || e(h),
1129
+ disabled: r.readonly || e(S),
899
1130
  spellcheck: "false"
900
- }, null, 8, rn), [
901
- [ge, e($)]
1131
+ }, null, 8, Dn), [
1132
+ [_e, e($)]
902
1133
  ])
903
1134
  ]),
904
1135
  n("button", {
905
1136
  type: "button",
906
1137
  class: "mr-designer-apply-json",
907
- disabled: v.readonly || e(h),
908
- onClick: o[24] || (o[24] = //@ts-ignore
909
- (...l) => e(s).applyJson && e(s).applyJson(...l))
910
- }, a(e(t).applyJson), 9, dn)
1138
+ disabled: r.readonly || e(S),
1139
+ onClick: a[33] || (a[33] = //@ts-ignore
1140
+ (...l) => e(i).applyJson && e(i).applyJson(...l))
1141
+ }, s(e(t).applyJson), 9, $n)
911
1142
  ], 64)),
912
- e(T) ? (_(), C("p", un, a(e(t).jsonPending), 1)) : N("", !0)
913
- ], 8, Xe)
1143
+ e(A) ? (p(), y("p", jn, s(e(t).jsonPending), 1)) : H("", !0)
1144
+ ], 10, ft)
914
1145
  ]),
915
1146
  n("div", {
916
1147
  class: "mr-designer-preview",
917
1148
  "aria-label": e(t).previewTitle
918
1149
  }, [
919
- e(p) ? (_(), C("div", vn, a(e(p)), 1)) : N("", !0),
920
- e(D).ok ? N("", !0) : (_(), C("ul", mn, [
921
- (_(!0), C(K, null, ie(e(D).errors, (l) => (_(), C("li", {
1150
+ e(_) ? (p(), y("div", Ln, s(e(_)), 1)) : H("", !0),
1151
+ e(V).ok ? H("", !0) : (p(), y("ul", Rn, [
1152
+ (p(!0), y(X, null, oe(e(V).errors, (l) => (p(), y("li", {
922
1153
  key: l.path
923
- }, a(l.path) + ":" + a(l.message), 1))), 128))
1154
+ }, s(l.path) + ":" + s(l.message), 1))), 128))
924
1155
  ])),
925
- e(x) && e(D).ok ? (_(), he(e(Ee), {
1156
+ e(x) && e(V).ok ? (p(), ke(e(Le), {
926
1157
  key: 2,
927
1158
  "report-id": "draft",
928
1159
  fetcher: e(x),
1160
+ messages: {
1161
+ title: e(t).previewTitle,
1162
+ columnDirectory: e(t).previewFieldDirectory
1163
+ },
929
1164
  "show-params": !1,
930
1165
  editable: !1,
931
1166
  "excel-import": !1,
932
1167
  height: "100%"
933
- }, null, 8, ["fetcher"])) : (_(), C("p", fn, a(e(t).invalid), 1))
934
- ], 8, cn)
1168
+ }, null, 8, ["fetcher", "messages"])) : (p(), y("p", Bn, s(e(t).invalid), 1))
1169
+ ], 8, Vn)
935
1170
  ])
936
- ], 8, Oe));
1171
+ ], 8, tt));
937
1172
  }
938
- }), _n = /* @__PURE__ */ Me(gn, [["__scopeId", "data-v-c4eab8e7"]]);
1173
+ }), Gn = /* @__PURE__ */ Se(Pn, [["__scopeId", "data-v-10c10f4e"]]);
939
1174
  export {
940
- _n as ReportTemplateEditor,
941
- Be as TEMPLATE_EDITOR_MESSAGES
1175
+ Gn as ReportTemplateEditor,
1176
+ Ye as TEMPLATE_EDITOR_MESSAGES
942
1177
  };