@agile-team/mach-report 2.10.0 → 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 (111) hide show
  1. package/README.md +6 -2
  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 +2 -0
  18. package/dist/analytics.d.ts +2 -0
  19. package/dist/analytics.js +29 -29
  20. package/dist/batch-Bt3Fd27Z.cjs +1 -0
  21. package/dist/batch-mRqhhhjt.js +364 -0
  22. package/dist/computed-Bvk0W15F.js +521 -0
  23. package/dist/computed-CGV2a809.cjs +1 -0
  24. package/dist/config-B612mw0x.js +525 -0
  25. package/dist/config-BRoLo2oj.cjs +1 -0
  26. package/dist/designer.cjs +2 -2
  27. package/dist/designer.d.cts +659 -9
  28. package/dist/designer.d.ts +659 -9
  29. package/dist/designer.js +2030 -1824
  30. package/dist/index.cjs +8 -8
  31. package/dist/index.d.cts +147 -3
  32. package/dist/index.d.ts +147 -3
  33. package/dist/index.js +639 -592
  34. package/dist/injection-keys-Db_DyLkm.cjs +1 -0
  35. package/dist/injection-keys-e85udZCp.js +7 -0
  36. package/dist/list-cell-BuYn4tGF.cjs +1 -0
  37. package/dist/{list-cell-Dxyi7DOw.js → list-cell-ClFra1zS.js} +54 -40
  38. package/dist/matrix-DVyWiYsd.cjs +1 -0
  39. package/dist/matrix-yZsGnldA.js +227 -0
  40. package/dist/param-validation-BlHHXs6u.js +153 -0
  41. package/dist/param-validation-DCK039V1.cjs +1 -0
  42. package/dist/pdf.cjs +25 -25
  43. package/dist/pdf.d.cts +3 -0
  44. package/dist/pdf.d.ts +3 -0
  45. package/dist/pdf.js +677 -677
  46. package/dist/plugin-BDTU4D94.cjs +1 -0
  47. package/dist/plugin-Cd5G2QQn.js +22 -0
  48. package/dist/region-binding-workflow-CXDmt9Bs.js +977 -0
  49. package/dist/region-binding-workflow-DhQvu1co.cjs +3 -0
  50. package/dist/{report-params-B_VCihAh.js → report-params-B44imUd4.js} +1 -1
  51. package/dist/{report-params-CjWrjPl6.cjs → report-params-SJfhKgaX.cjs} +1 -1
  52. package/dist/server/node.d.cts +5 -2
  53. package/dist/server/node.d.ts +5 -2
  54. package/dist/server-node.cjs +1 -1
  55. package/dist/server-node.js +87 -87
  56. package/dist/server.cjs +1 -1
  57. package/dist/server.d.cts +201 -2
  58. package/dist/server.d.ts +201 -2
  59. package/dist/server.js +557 -658
  60. package/dist/style.css +1 -1
  61. package/dist/template-registry-WNXdkiET.js +506 -0
  62. package/dist/template-registry-ukBGlm8N.cjs +1 -0
  63. package/dist/template-review-BXp2oyqg.cjs +1 -0
  64. package/dist/template-review-BdcXSYbx.js +1616 -0
  65. package/dist/tree-BX380Rr7.cjs +1 -0
  66. package/dist/tree-CqcQ99NM.js +172 -0
  67. package/dist/{validate-UUy9yP4K.js → validate-7s0yn6ii.js} +44 -44
  68. package/dist/validate-DsRiNw8h.cjs +1 -0
  69. package/dist/vue/async.d.cts +93 -4
  70. package/dist/vue/async.d.ts +93 -4
  71. package/dist/vue/index.d.cts +145 -7
  72. package/dist/vue/index.d.ts +145 -7
  73. package/dist/vue-async.cjs +1 -1
  74. package/dist/vue-async.js +5 -5
  75. package/dist/vue.cjs +1 -1
  76. package/dist/vue.js +116 -113
  77. package/dist/{workbook-session-B-bW5_yR.js → workbook-session-BKOTwcoq.js} +1 -1
  78. package/dist/{workbook-session-D7RtdNo0.cjs → workbook-session-CLYLhZWu.cjs} +1 -1
  79. package/dist/worker.cjs +1 -1
  80. package/dist/worker.d.cts +5 -2
  81. package/dist/worker.d.ts +5 -2
  82. package/dist/worker.js +1 -1
  83. package/dist/xlsx.cjs +3 -3
  84. package/dist/xlsx.d.cts +129 -2
  85. package/dist/xlsx.d.ts +129 -2
  86. package/dist/xlsx.js +336 -242
  87. package/package.json +1 -1
  88. package/dist/ExcelBindingWizard-CF7RplWm.cjs +0 -1
  89. package/dist/ExcelBindingWizard-qhwEderR.js +0 -842
  90. package/dist/ReportPreview-BE1tCHqE.js +0 -4604
  91. package/dist/ReportPreview-QKRKQOe3.cjs +0 -6
  92. package/dist/RuleEditor-BA36yIV6.js +0 -1723
  93. package/dist/RuleEditor-CczJ6mJm.cjs +0 -1
  94. package/dist/TemplateReviewPanel-CHi4Alqa.cjs +0 -1
  95. package/dist/TemplateReviewPanel-Dz0G5o83.js +0 -217
  96. package/dist/binding-preview-BWsdf_z2.cjs +0 -2
  97. package/dist/binding-preview-DILq0-0f.js +0 -649
  98. package/dist/decimal-CI1OAczk.js +0 -87
  99. package/dist/decimal-CQA0xJex.cjs +0 -1
  100. package/dist/list-cell-CyM1ZlRN.cjs +0 -1
  101. package/dist/matrix-BbXarwyk.js +0 -661
  102. package/dist/matrix-Cm65WLLP.cjs +0 -1
  103. package/dist/param-validation-BWNjLcN0.js +0 -116
  104. package/dist/param-validation-CiTxFeZ8.cjs +0 -1
  105. package/dist/plugin-CThk42vJ.cjs +0 -1
  106. package/dist/plugin-tGn7-5oF.js +0 -25
  107. package/dist/template-registry-CGWTLtIA.cjs +0 -1
  108. package/dist/template-registry-DzlQs3OF.js +0 -434
  109. package/dist/template-review-D1RoNCPw.cjs +0 -1
  110. package/dist/template-review-fnteXRng.js +0 -1473
  111. package/dist/validate-Bf6ccFr2.cjs +0 -1
@@ -1,842 +0,0 @@
1
- import { shallowRef as Ce, ref as k, computed as D, watch as se, onBeforeUnmount as $e, defineComponent as Re, openBlock as r, createElementBlock as u, unref as e, createElementVNode as n, createVNode as O, toDisplayString as o, createTextVNode as $, createCommentVNode as R, Fragment as B, renderList as L, normalizeClass as ve, normalizeStyle as Me, withDirectives as fe, vModelSelect as Se, vModelText as Ee } from "vue";
2
- import { a as T, _ as De } from "./_plugin-vue_export-helper-8SL1F89S.js";
3
- import { u as ze } from "./useLocalDraft-C07SYRnC.js";
4
- import { h as ge, g as Be, f as Ie, v as Ke, i as Ne, p as We, c as Le, a as Ae, e as Pe } from "./binding-preview-DILq0-0f.js";
5
- import { EXCEL_BINDING_MESSAGES as Fe } from "./designer.js";
6
- function re(s = "", ae = 0) {
7
- return {
8
- version: "1.0",
9
- sheet: s,
10
- dataset: "",
11
- regions: { header: "", detail: "" },
12
- fields: Array.from({ length: ae }, () => ""),
13
- rowKey: ""
14
- };
15
- }
16
- function ue(s) {
17
- return s instanceof Error ? s.message : String(s);
18
- }
19
- function Oe(s, ae) {
20
- const p = Ce(), v = k(re()), V = /* @__PURE__ */ new Map(), c = (i) => JSON.parse(JSON.stringify(i));
21
- function G(i, d) {
22
- return c(V.get(i) ?? re(i, d));
23
- }
24
- const _ = k({
25
- id: s.identity?.id ?? "excel-template",
26
- name: s.identity?.name ?? "Excel 业务模板"
27
- }), I = k(""), Y = k(0), U = ze(() => ({ source: Y.value, recipe: v.value, identity: _.value })), H = k([]);
28
- let A;
29
- function q() {
30
- A?.dispose(), A = void 0;
31
- }
32
- const w = k(""), P = k(!1), M = k(!1), C = k(!1), a = k(!1), S = k(1), j = k(1), z = k(), K = k(), m = k(0), x = D(() => ({ ...Fe, ...s.messages })), N = D(() => !!s.readonly || P.value || a.value), X = D(
33
- () => p.value?.sheets.find((i) => i.name === v.value.sheet)
34
- ), b = D(
35
- () => X.value ? ge(X.value.range) : void 0
36
- ), Z = D(
37
- () => s.datasets.find((i) => i.id === v.value.dataset)
38
- ), Q = D(
39
- () => p.value && X.value ? Be(p.value, X.value.name, {
40
- row: S.value,
41
- column: j.value
42
- }) : void 0
43
- ), de = D(
44
- () => p.value ? Ie(p.value, v.value) : []
45
- ), ee = D(() => {
46
- if (!p.value) return { ok: !1, issues: [], mapped: 0, total: 0 };
47
- const i = Ke(
48
- p.value,
49
- v.value,
50
- s.datasets
51
- ), d = [...de.value, ...i.issues];
52
- return { ...i, ok: d.length === 0, issues: d };
53
- }), oe = D(
54
- () => v.value.fields.slice(m.value * 12, (m.value + 1) * 12).map((i, d) => ({
55
- index: m.value * 12 + d,
56
- field: i,
57
- physical: Ne(
58
- (b.value?.left ?? 1) + m.value * 12 + d
59
- )
60
- }))
61
- ), te = D(
62
- () => Z.value?.fields.filter((i) => i.type !== "boolean") ?? []
63
- ), ne = D(
64
- () => z.value !== void 0 && K.value !== void 0 ? {
65
- top: Math.min(z.value, K.value),
66
- bottom: Math.max(z.value, K.value)
67
- } : void 0
68
- );
69
- let W, E = 0;
70
- function F() {
71
- E++, W?.abort(), W = void 0, P.value = !1;
72
- }
73
- function J() {
74
- S.value = b.value?.top ?? 1, j.value = b.value?.left ?? 1, z.value = void 0, K.value = void 0, m.value = 0, M.value = !1, C.value = !1;
75
- }
76
- function g(i) {
77
- F();
78
- try {
79
- const d = We(i);
80
- F(), q(), H.value = d.source.sheets.map((h) => ({
81
- name: h.name,
82
- index: h.index
83
- })), p.value = d.source, V.clear(), v.value = d.recipe, _.value = { ...d.identity, ...s.lockId && s.identity ? { id: s.identity.id } : {} }, I.value = d.recipe.sheet, w.value = "", J(), Y.value++, U.accept();
84
- } catch (d) {
85
- w.value = ue(d);
86
- }
87
- }
88
- se(
89
- () => s.session,
90
- (i) => {
91
- i && g(i);
92
- },
93
- { immediate: !0 }
94
- ), se(
95
- () => s.readonly,
96
- (i) => {
97
- i && (F(), q());
98
- }
99
- ), se(
100
- [v, _],
101
- () => {
102
- M.value = !1, C.value = !1;
103
- },
104
- { deep: !0, flush: "sync" }
105
- ), se(
106
- () => s.datasets,
107
- () => {
108
- M.value = !1, C.value = !1;
109
- }
110
- ), $e(() => {
111
- F(), q();
112
- });
113
- async function l(i) {
114
- if (s.readonly) return;
115
- if (F(), !/\.xlsx$/i.test(i.name)) {
116
- w.value = x.value.invalidFile;
117
- return;
118
- }
119
- const d = ++E;
120
- W = new AbortController(), P.value = !0, w.value = "";
121
- let h;
122
- try {
123
- const { openExcelWorkbook: y } = await import("./workbook-session-B-bW5_yR.js").then((le) => le.w);
124
- if (d !== E || s.readonly || (h = await y(i, { ...s.importOptions, signal: W.signal }), d !== E || s.readonly)) return;
125
- const ie = h.inspect().sheets.filter((le) => le.visible);
126
- if (!ie.length) throw new Error("Excel 中没有可导入的可见工作表");
127
- const ce = await h.importTemplate({ sheets: [ie[0].name], signal: W.signal });
128
- if (d !== E || s.readonly) return;
129
- q(), A = h, h = void 0, p.value = ce, Y.value++, I.value = i.name, H.value = ie.map((le) => ({
130
- name: le.name,
131
- index: le.index
132
- })), V.clear(), v.value = re(
133
- ce.sheets[0].name,
134
- ce.sheets[0].columnCount
135
- ), J();
136
- } catch (y) {
137
- d === E && (w.value = ue(y));
138
- } finally {
139
- h?.dispose(), d === E && (P.value = !1, W = void 0);
140
- }
141
- }
142
- async function t(i) {
143
- if (N.value || !H.value.some((y) => y.name === i))
144
- return;
145
- v.value.sheet && V.set(v.value.sheet, c(v.value));
146
- const d = p.value?.sheets.find((y) => y.name === i);
147
- if (d) {
148
- v.value = G(i, d.columnCount), w.value = "", J();
149
- return;
150
- }
151
- if (!A || A.disposed) return;
152
- F();
153
- const h = ++E;
154
- W = new AbortController(), P.value = !0, w.value = "";
155
- try {
156
- const y = await A.importTemplate({ sheets: [i], signal: W.signal });
157
- if (h !== E || s.readonly) return;
158
- p.value = y, v.value = G(i, y.sheets[0].columnCount), J();
159
- } catch (y) {
160
- h === E && (w.value = ue(y));
161
- } finally {
162
- h === E && (P.value = !1, W = void 0);
163
- }
164
- }
165
- function f(i) {
166
- N.value || (v.value.dataset = i, v.value.rowKey = "", v.value.fields.fill(""), M.value = !1, C.value = !1);
167
- }
168
- function me(i, d) {
169
- N.value || !b.value || i < b.value.top || i > b.value.bottom || ((!d || z.value === void 0) && (z.value = i), K.value = i);
170
- }
171
- function be(i) {
172
- if (N.value || !p.value || !ne.value) {
173
- N.value || (w.value = x.value.emptySelection);
174
- return;
175
- }
176
- v.value.regions[i] = Pe(
177
- p.value,
178
- v.value.sheet,
179
- ne.value.top,
180
- ne.value.bottom
181
- ), M.value = !1, C.value = !1, w.value = "";
182
- }
183
- function pe(i) {
184
- N.value || (delete v.value.regions[i], M.value = !1, C.value = !1);
185
- }
186
- function he(i, d) {
187
- !N.value && i >= 0 && i < v.value.fields.length && (v.value.fields[i] = d, M.value = !1, C.value = !1);
188
- }
189
- function ye(i) {
190
- for (const d of ["title", "header", "detail", "footer"]) {
191
- const h = v.value.regions[d];
192
- if (!h) continue;
193
- const y = ge(h);
194
- if (i >= y.top && i <= y.bottom) return d;
195
- }
196
- }
197
- function we(i, d) {
198
- b.value && (i === "row" ? S.value = Math.max(
199
- b.value.top,
200
- Math.min(b.value.bottom, S.value + d)
201
- ) : j.value = Math.max(
202
- b.value.left,
203
- Math.min(b.value.right, j.value + d)
204
- ));
205
- }
206
- function ke() {
207
- if (!s.readonly) {
208
- if (s.session) {
209
- g(s.session);
210
- return;
211
- }
212
- F(), q(), p.value = void 0, H.value = [], I.value = "", V.clear(), v.value = re(), _.value = { id: s.identity?.id ?? "excel-template", name: s.identity?.name ?? "Excel 业务模板" }, J(), Y.value++, U.accept(), w.value = "";
213
- }
214
- }
215
- function _e() {
216
- M.value = !0, w.value = "";
217
- }
218
- async function xe() {
219
- if (!(N.value || !p.value) && (M.value = !0, w.value = "", !!ee.value.ok)) {
220
- a.value = !0;
221
- try {
222
- const i = { ..._.value, ...s.lockId && s.identity ? { id: s.identity.id } : {} }, d = Le(
223
- p.value,
224
- v.value,
225
- s.datasets,
226
- i
227
- ), h = Ae(
228
- p.value,
229
- v.value,
230
- i
231
- ), y = { ...d, session: h }, ie = U.snapshot();
232
- if (s.accept && !await s.accept(y) || s.readonly || ie !== U.snapshot() && U.pending.value) return;
233
- s.accept || ae(y), U.accept(), V.clear(), C.value = !0;
234
- } catch (i) {
235
- w.value = ue(i);
236
- } finally {
237
- a.value = !1;
238
- }
239
- }
240
- }
241
- return {
242
- imported: p,
243
- pendingLocalChanges: U.pending,
244
- recipe: v,
245
- identity: _,
246
- sourceName: I,
247
- sheetChoices: H,
248
- error: w,
249
- loading: P,
250
- checked: M,
251
- applied: C,
252
- row: S,
253
- column: j,
254
- mappingPage: m,
255
- m: x,
256
- disabled: N,
257
- sheet: X,
258
- sourceRange: b,
259
- dataset: Z,
260
- window: Q,
261
- validation: ee,
262
- mappings: oe,
263
- rowKeys: te,
264
- selection: ne,
265
- cancel: F,
266
- importFile: l,
267
- chooseSheet: t,
268
- chooseDataset: f,
269
- chooseRow: me,
270
- markRegion: be,
271
- clearRegion: pe,
272
- setMapping: he,
273
- regionAt: ye,
274
- moveWindow: we,
275
- check: _e,
276
- restoreDraft: ke,
277
- apply: xe
278
- };
279
- }
280
- const Te = ["aria-label", "aria-busy"], Ve = { class: "mr-binding-bar" }, Ue = { class: "mr-binding-heading" }, je = ["aria-label", "disabled"], Ge = ["disabled"], He = {
281
- key: 0,
282
- class: "mr-binding-error",
283
- role: "alert"
284
- }, Je = {
285
- key: 1,
286
- class: "mr-binding-placeholder",
287
- role: "status"
288
- }, qe = {
289
- key: 2,
290
- class: "mr-binding-placeholder"
291
- }, Xe = ["disabled"], Qe = { class: "mr-binding-sourcebar" }, Ye = ["value", "aria-label", "disabled"], Ze = ["value"], et = { class: "mr-binding-range" }, tt = { class: "mr-binding-sample-note" }, nt = { class: "mr-binding-layout" }, lt = { class: "mr-binding-source" }, at = { class: "mr-binding-grid-heading" }, ot = ["aria-label"], it = { class: "mr-binding-grid" }, st = ["data-region"], rt = { scope: "row" }, ut = ["data-source-row", "aria-label", "aria-pressed", "disabled", "onPointerdown", "onPointerenter", "onKeydown"], dt = ["rowspan", "colspan", "title"], ct = {
292
- key: 1,
293
- class: "mr-binding-grid-footer"
294
- }, vt = { class: "mr-binding-window" }, ft = ["aria-label", "disabled"], gt = ["min", "max", "value"], mt = ["aria-label", "disabled"], bt = { class: "mr-binding-window" }, pt = ["aria-label", "disabled"], ht = ["min", "max", "value"], yt = ["aria-label", "disabled"], wt = { class: "mr-binding-inspector" }, kt = ["disabled"], _t = { class: "mr-binding-group" }, xt = ["data-role"], Ct = { key: 0 }, $t = ["aria-label", "disabled", "onClick"], Rt = ["aria-label", "onClick"], Mt = {
295
- key: 0,
296
- class: "mr-binding-note"
297
- }, St = { class: "mr-binding-group" }, Et = { class: "mr-binding-label" }, Dt = ["value", "aria-label"], zt = { value: "" }, Bt = ["value"], It = {
298
- key: 0,
299
- class: "mr-binding-note"
300
- }, Kt = {
301
- key: 1,
302
- class: "mr-binding-label"
303
- }, Nt = ["aria-label"], Wt = { value: "" }, Lt = ["value"], At = {
304
- key: 2,
305
- class: "mr-binding-mappings"
306
- }, Pt = ["aria-label", "value", "onChange"], Ft = { value: "" }, Ot = ["value"], Tt = { key: 0 }, Vt = {
307
- key: 3,
308
- class: "mr-binding-map-pages"
309
- }, Ut = ["disabled", "aria-label"], jt = ["disabled", "aria-label"], Gt = { class: "mr-binding-group" }, Ht = { class: "mr-binding-label" }, Jt = ["value", "readonly"], qt = { class: "mr-binding-label" }, Xt = {
310
- key: 0,
311
- class: "mr-binding-issues",
312
- role: "alert"
313
- }, Qt = { key: 0 }, Yt = {
314
- key: 1,
315
- class: "mr-binding-warnings"
316
- }, Zt = { class: "mr-binding-actions" }, en = ["disabled"], tn = ["disabled"], nn = ["disabled"], ln = /* @__PURE__ */ Re({
317
- __name: "ExcelBindingWizard",
318
- props: {
319
- datasets: {},
320
- accept: { type: Function },
321
- session: {},
322
- identity: {},
323
- lockId: { type: Boolean },
324
- readonly: { type: Boolean },
325
- importOptions: {},
326
- messages: {}
327
- },
328
- emits: ["apply", "dirty"],
329
- setup(s, { expose: ae, emit: p }) {
330
- const v = s, V = p, c = Oe(v, (g) => V("apply", g)), {
331
- imported: G,
332
- recipe: _,
333
- identity: I,
334
- sourceName: Y,
335
- sheetChoices: U,
336
- error: H,
337
- loading: A,
338
- checked: q,
339
- applied: w,
340
- row: P,
341
- column: M,
342
- mappingPage: C,
343
- m: a,
344
- disabled: S,
345
- sheet: j,
346
- sourceRange: z,
347
- dataset: K,
348
- window: m,
349
- validation: x,
350
- mappings: N,
351
- rowKeys: X,
352
- selection: b
353
- } = c;
354
- se([c.pendingLocalChanges, _, I], () => V("dirty", c.pendingLocalChanges.value), { immediate: !0, deep: !0, flush: "sync" });
355
- const Z = k(), Q = k(!1), de = ["title", "header", "detail", "footer"], ee = D(() => ({
356
- title: a.value.titleRegion,
357
- header: a.value.headerRegion,
358
- detail: a.value.detailRegion,
359
- footer: a.value.footerRegion
360
- })), oe = D(
361
- () => Math.max(1, Math.ceil(_.value.fields.length / 12))
362
- );
363
- function te(g) {
364
- return g.target.value;
365
- }
366
- function ne(g) {
367
- const l = g.target, t = l.files?.[0];
368
- t && c.importFile(t), l.value = "";
369
- }
370
- function W(g, l) {
371
- g.button !== 0 || S.value || (g.preventDefault(), Q.value = !0, c.chooseRow(l, g.shiftKey), g.currentTarget.focus());
372
- }
373
- function E(g, l) {
374
- if ((g.key === " " || g.key === "Enter") && (g.preventDefault(), c.chooseRow(l, g.shiftKey)), g.key === "ArrowDown" || g.key === "ArrowUp") {
375
- g.preventDefault();
376
- const t = l + (g.key === "ArrowDown" ? 1 : -1);
377
- g.shiftKey && c.chooseRow(t, !0), g.currentTarget.closest("table")?.querySelector(`button[data-source-row="${t}"]`)?.focus();
378
- }
379
- }
380
- function F(g) {
381
- const l = K.value?.fields.find((t) => t.field === g);
382
- return l ? [
383
- l.type,
384
- l.unit,
385
- l.digits === void 0 ? void 0 : `${l.digits}${a.value.precision}`,
386
- l.sample === void 0 ? void 0 : `${a.value.sample}: ${String(l.sample)}`
387
- ].filter((t) => t !== void 0 && t !== "").join(" · ") : "";
388
- }
389
- function J(g, l) {
390
- const t = Number(te(g));
391
- !Number.isInteger(t) || !z.value || (l === "row" ? P.value = Math.max(
392
- z.value.top,
393
- Math.min(z.value.bottom, t)
394
- ) : M.value = Math.max(
395
- z.value.left,
396
- Math.min(z.value.right, t)
397
- ));
398
- }
399
- return ae({
400
- get pendingLocalChanges() {
401
- return c.pendingLocalChanges.value;
402
- },
403
- importFile: c.importFile,
404
- apply: c.apply,
405
- cancel: c.cancel
406
- }), (g, l) => (r(), u("section", {
407
- class: "mr-binding",
408
- "aria-label": e(a).title,
409
- "aria-busy": e(A),
410
- onPointerup: l[19] || (l[19] = (t) => Q.value = !1),
411
- onPointercancel: l[20] || (l[20] = (t) => Q.value = !1),
412
- onPointerleave: l[21] || (l[21] = (t) => Q.value = !1)
413
- }, [
414
- n("header", Ve, [
415
- n("div", Ue, [
416
- O(T, {
417
- name: "file",
418
- size: 17
419
- }),
420
- n("strong", null, o(e(a).title), 1),
421
- n("span", null, o(e(Y) || e(a).intro), 1)
422
- ]),
423
- n("input", {
424
- ref_key: "input",
425
- ref: Z,
426
- type: "file",
427
- accept: ".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
428
- "aria-label": e(a).upload,
429
- class: "mr-binding-file",
430
- disabled: s.readonly,
431
- onChange: ne
432
- }, null, 40, je),
433
- e(A) ? (r(), u("button", {
434
- key: 0,
435
- type: "button",
436
- onClick: l[0] || (l[0] = //@ts-ignore
437
- (...t) => e(c).cancel && e(c).cancel(...t))
438
- }, o(e(a).cancel), 1)) : (r(), u("button", {
439
- key: 1,
440
- type: "button",
441
- disabled: s.readonly,
442
- onClick: l[1] || (l[1] = (t) => Z.value?.click())
443
- }, [
444
- O(T, {
445
- name: "upload",
446
- size: 14
447
- }),
448
- $(o(e(G) ? e(a).replace : e(a).upload), 1)
449
- ], 8, Ge))
450
- ]),
451
- e(H) ? (r(), u("div", He, o(e(H)), 1)) : R("", !0),
452
- e(A) ? (r(), u("div", Je, [
453
- l[22] || (l[22] = n("span", { class: "mr-binding-loader" }, null, -1)),
454
- $(o(e(a).loading), 1)
455
- ])) : e(G) ? (r(), u(B, { key: 3 }, [
456
- n("div", Qe, [
457
- n("label", null, [
458
- $(o(e(a).sheet), 1),
459
- n("select", {
460
- value: e(_).sheet,
461
- "aria-label": e(a).sheet,
462
- disabled: e(S),
463
- onChange: l[3] || (l[3] = (t) => e(c).chooseSheet(te(t)))
464
- }, [
465
- (r(!0), u(B, null, L(e(U), (t) => (r(), u("option", {
466
- key: t.name,
467
- value: t.name
468
- }, o(t.name), 9, Ze))), 128))
469
- ], 40, Ye)
470
- ]),
471
- n("span", et, o(e(j)?.range) + " · " + o(e(j)?.rowCount) + " × " + o(e(j)?.columnCount), 1),
472
- n("span", tt, o(e(a).sourceOnly), 1)
473
- ]),
474
- n("div", nt, [
475
- n("div", lt, [
476
- n("div", at, [
477
- n("strong", null, o(e(a).source), 1),
478
- n("span", null, o(e(a).sourceHint), 1)
479
- ]),
480
- e(m) ? (r(), u("div", {
481
- key: 0,
482
- class: "mr-binding-grid-scroll",
483
- "aria-label": e(a).source
484
- }, [
485
- n("table", it, [
486
- n("thead", null, [
487
- n("tr", null, [
488
- l[24] || (l[24] = n("th", {
489
- class: "mr-binding-corner",
490
- "aria-label": "#"
491
- }, "#", -1)),
492
- (r(!0), u(B, null, L(e(m).columns, (t) => (r(), u("th", {
493
- key: t.column,
494
- scope: "col"
495
- }, o(t.name), 1))), 128))
496
- ])
497
- ]),
498
- n("tbody", null, [
499
- (r(!0), u(B, null, L(e(m).rows, (t) => (r(), u("tr", {
500
- key: t.row,
501
- "data-region": e(c).regionAt(t.row),
502
- class: ve({
503
- "is-selected": e(b) && t.row >= e(b).top && t.row <= e(b).bottom
504
- })
505
- }, [
506
- n("th", rt, [
507
- n("button", {
508
- type: "button",
509
- "data-source-row": t.row,
510
- "aria-label": `${e(a).selectionLabel} ${t.row}`,
511
- "aria-pressed": !!e(b) && t.row >= e(b).top && t.row <= e(b).bottom,
512
- disabled: e(S),
513
- onPointerdown: (f) => W(f, t.row),
514
- onPointerenter: (f) => Q.value && e(c).chooseRow(t.row, !0),
515
- onKeydown: (f) => E(f, t.row)
516
- }, o(t.row), 41, ut)
517
- ]),
518
- (r(!0), u(B, null, L(t.cells, (f) => (r(), u("td", {
519
- key: f.column,
520
- rowspan: f.rowSpan,
521
- colspan: f.colSpan,
522
- title: `${f.address} · ${f.text}`,
523
- class: ve({ "is-continued": f.continued }),
524
- style: Me({
525
- textAlign: f.style?.align,
526
- fontWeight: f.style?.bold ? "600" : void 0
527
- })
528
- }, [
529
- n("span", null, o(f.text), 1)
530
- ], 14, dt))), 128))
531
- ], 10, st))), 128))
532
- ])
533
- ])
534
- ], 8, ot)) : R("", !0),
535
- e(m) ? (r(), u("footer", ct, [
536
- n("span", null, [
537
- $(o(e(a).selected) + " ", 1),
538
- n("strong", null, o(e(b) ? `${e(b).top}–${e(b).bottom}` : "—"), 1)
539
- ]),
540
- n("div", vt, [
541
- n("button", {
542
- type: "button",
543
- "aria-label": e(a).previousRows,
544
- disabled: e(m).top <= e(m).source.top,
545
- onClick: l[4] || (l[4] = (t) => e(c).moveWindow("row", -24))
546
- }, [
547
- O(T, {
548
- name: "chevron-left",
549
- size: 13
550
- })
551
- ], 8, ft),
552
- n("label", null, [
553
- $(o(e(a).rowStart), 1),
554
- n("input", {
555
- type: "number",
556
- min: e(m).source.top,
557
- max: e(m).source.bottom,
558
- value: e(P),
559
- onChange: l[5] || (l[5] = (t) => J(t, "row"))
560
- }, null, 40, gt)
561
- ]),
562
- n("button", {
563
- type: "button",
564
- "aria-label": e(a).nextRows,
565
- disabled: e(m).bottom >= e(m).source.bottom,
566
- onClick: l[6] || (l[6] = (t) => e(c).moveWindow("row", 24))
567
- }, [
568
- O(T, {
569
- name: "chevron-right",
570
- size: 13
571
- })
572
- ], 8, mt)
573
- ]),
574
- n("div", bt, [
575
- n("button", {
576
- type: "button",
577
- "aria-label": e(a).previousColumns,
578
- disabled: e(m).left <= e(m).source.left,
579
- onClick: l[7] || (l[7] = (t) => e(c).moveWindow("column", -12))
580
- }, [
581
- O(T, {
582
- name: "chevron-left",
583
- size: 13
584
- })
585
- ], 8, pt),
586
- n("label", null, [
587
- $(o(e(a).columnStart), 1),
588
- n("input", {
589
- type: "number",
590
- min: e(m).source.left,
591
- max: e(m).source.right,
592
- value: e(M),
593
- onChange: l[8] || (l[8] = (t) => J(t, "column"))
594
- }, null, 40, ht)
595
- ]),
596
- n("button", {
597
- type: "button",
598
- "aria-label": e(a).nextColumns,
599
- disabled: e(m).right >= e(m).source.right,
600
- onClick: l[9] || (l[9] = (t) => e(c).moveWindow("column", 12))
601
- }, [
602
- O(T, {
603
- name: "chevron-right",
604
- size: 13
605
- })
606
- ], 8, yt)
607
- ])
608
- ])) : R("", !0)
609
- ]),
610
- n("div", wt, [
611
- n("fieldset", { disabled: e(S) }, [
612
- n("section", _t, [
613
- n("h3", null, [
614
- l[25] || (l[25] = n("b", null, "1", -1)),
615
- $(o(e(a).regionLegend), 1)
616
- ]),
617
- (r(), u(B, null, L(de, (t) => n("div", {
618
- key: t,
619
- class: "mr-binding-region",
620
- "data-role": t
621
- }, [
622
- n("div", null, [
623
- n("strong", null, [
624
- $(o(ee.value[t]), 1),
625
- t === "title" || t === "footer" ? (r(), u("small", Ct, o(e(a).optional), 1)) : R("", !0)
626
- ]),
627
- n("code", null, o(e(_).regions[t] || e(a).unnamed), 1)
628
- ]),
629
- n("button", {
630
- type: "button",
631
- "aria-label": `${e(a).selectRegion} · ${ee.value[t]}`,
632
- disabled: !e(b),
633
- onClick: (f) => e(c).markRegion(t)
634
- }, [
635
- O(T, {
636
- name: "arrow-right",
637
- size: 13
638
- })
639
- ], 8, $t),
640
- (t === "title" || t === "footer") && e(_).regions[t] ? (r(), u("button", {
641
- key: 0,
642
- type: "button",
643
- "aria-label": `${e(a).clear} · ${ee.value[t]}`,
644
- onClick: (f) => e(c).clearRegion(t)
645
- }, [
646
- O(T, {
647
- name: "close",
648
- size: 13
649
- })
650
- ], 8, Rt)) : R("", !0)
651
- ], 8, xt)), 64)),
652
- e(_).regions.footer ? (r(), u("p", Mt, o(e(a).footerHint), 1)) : R("", !0)
653
- ]),
654
- n("section", St, [
655
- n("h3", null, [
656
- l[26] || (l[26] = n("b", null, "2", -1)),
657
- $(o(e(a).mapping), 1),
658
- n("span", null, o(e(x).mapped) + "/" + o(e(x).total), 1)
659
- ]),
660
- n("label", Et, [
661
- $(o(e(a).dataset), 1),
662
- n("select", {
663
- value: e(_).dataset,
664
- "aria-label": e(a).dataset,
665
- onChange: l[10] || (l[10] = (t) => e(c).chooseDataset(te(t)))
666
- }, [
667
- n("option", zt, o(e(a).chooseDataset), 1),
668
- (r(!0), u(B, null, L(s.datasets, (t) => (r(), u("option", {
669
- key: t.id,
670
- value: t.id
671
- }, o(t.label || t.id), 9, Bt))), 128))
672
- ], 40, Dt)
673
- ]),
674
- s.datasets.length ? R("", !0) : (r(), u("p", It, o(e(a).noContract), 1)),
675
- e(K) ? (r(), u("label", Kt, [
676
- $(o(e(a).rowKey), 1),
677
- fe(n("select", {
678
- "onUpdate:modelValue": l[11] || (l[11] = (t) => e(_).rowKey = t),
679
- "aria-label": e(a).rowKey
680
- }, [
681
- n("option", Wt, o(e(a).chooseRowKey), 1),
682
- (r(!0), u(B, null, L(e(X), (t) => (r(), u("option", {
683
- key: t.field,
684
- value: t.field
685
- }, o(t.label || t.field) + " · " + o(t.field), 9, Lt))), 128))
686
- ], 8, Nt), [
687
- [Se, e(_).rowKey]
688
- ])
689
- ])) : R("", !0),
690
- e(K) ? (r(), u("div", At, [
691
- (r(!0), u(B, null, L(e(N), (t) => (r(), u("label", {
692
- key: t.index,
693
- class: "mr-binding-map"
694
- }, [
695
- n("span", null, o(t.physical), 1),
696
- n("div", null, [
697
- n("select", {
698
- "aria-label": `${e(a).physical} ${t.physical} · ${e(a).business}`,
699
- value: t.field,
700
- onChange: (f) => e(c).setMapping(t.index, te(f))
701
- }, [
702
- n("option", Ft, o(e(a).chooseField), 1),
703
- (r(!0), u(B, null, L(e(K).fields, (f) => (r(), u("option", {
704
- key: f.field,
705
- value: f.field
706
- }, o(f.label || f.field) + " · " + o(f.field), 9, Ot))), 128))
707
- ], 40, Pt),
708
- t.field ? (r(), u("small", Tt, o(F(t.field)), 1)) : R("", !0)
709
- ])
710
- ]))), 128))
711
- ])) : R("", !0),
712
- e(K) && oe.value > 1 ? (r(), u("div", Vt, [
713
- n("button", {
714
- type: "button",
715
- disabled: e(C) <= 0,
716
- "aria-label": e(a).previousColumns,
717
- onClick: l[12] || (l[12] = (t) => C.value--)
718
- }, [
719
- O(T, {
720
- name: "chevron-left",
721
- size: 13
722
- })
723
- ], 8, Ut),
724
- n("span", null, o(e(C) + 1) + " / " + o(oe.value), 1),
725
- n("button", {
726
- type: "button",
727
- disabled: e(C) + 1 >= oe.value,
728
- "aria-label": e(a).nextColumns,
729
- onClick: l[13] || (l[13] = (t) => C.value++)
730
- }, [
731
- O(T, {
732
- name: "chevron-right",
733
- size: 13
734
- })
735
- ], 8, jt)
736
- ])) : R("", !0)
737
- ]),
738
- n("section", Gt, [
739
- n("h3", null, [
740
- l[27] || (l[27] = n("b", null, "3", -1)),
741
- $(o(e(a).identity), 1)
742
- ]),
743
- n("label", Ht, [
744
- $(o(e(a).templateId), 1),
745
- n("input", {
746
- value: s.lockId ? v.identity?.id ?? e(I).id : e(I).id,
747
- autocomplete: "off",
748
- readonly: s.lockId,
749
- onInput: l[14] || (l[14] = (t) => e(I).id = t.target.value)
750
- }, null, 40, Jt)
751
- ]),
752
- n("label", qt, [
753
- $(o(e(a).templateName), 1),
754
- fe(n("input", {
755
- "onUpdate:modelValue": l[15] || (l[15] = (t) => e(I).name = t),
756
- autocomplete: "off"
757
- }, null, 512), [
758
- [Ee, e(I).name]
759
- ])
760
- ])
761
- ])
762
- ], 8, kt)
763
- ])
764
- ]),
765
- e(q) && e(x).issues.length ? (r(), u("div", Xt, [
766
- n("strong", null, o(e(a).issues) + " · " + o(e(x).issues.length) + " " + o(e(a).errors), 1),
767
- n("ul", null, [
768
- (r(!0), u(B, null, L(e(x).issues.slice(0, 12), (t, f) => (r(), u("li", { key: f }, [
769
- n("code", null, o(t.path), 1),
770
- $(o(t.message), 1)
771
- ]))), 128))
772
- ]),
773
- e(x).issues.length > 12 ? (r(), u("span", Qt, "+ " + o(e(x).issues.length - 12), 1)) : R("", !0)
774
- ])) : R("", !0),
775
- e(G).warnings.length ? (r(), u("details", Yt, [
776
- n("summary", null, o(e(a).inspectWarning) + " · " + o(e(G).warnings.length), 1),
777
- n("ul", null, [
778
- (r(!0), u(B, null, L(e(G).warnings, (t, f) => (r(), u("li", { key: f }, o(t), 1))), 128))
779
- ])
780
- ])) : R("", !0),
781
- n("footer", Zt, [
782
- n("span", {
783
- class: ve({ "is-ready": e(x).ok }),
784
- role: "status"
785
- }, o(s.readonly ? e(a).readonly : e(w) ? e(a).applied : e(x).ok ? e(a).ready : `${e(a).coverage} ${e(x).mapped}/${e(x).total}`), 3),
786
- e(c).pendingLocalChanges.value ? (r(), u("button", {
787
- key: 0,
788
- type: "button",
789
- disabled: e(S),
790
- onClick: l[16] || (l[16] = //@ts-ignore
791
- (...t) => e(c).restoreDraft && e(c).restoreDraft(...t))
792
- }, o(e(a).restoreDraft), 9, en)) : R("", !0),
793
- n("button", {
794
- type: "button",
795
- disabled: e(S),
796
- onClick: l[17] || (l[17] = //@ts-ignore
797
- (...t) => e(c).check && e(c).check(...t))
798
- }, o(e(a).check), 9, tn),
799
- n("button", {
800
- type: "button",
801
- class: "mr-binding-primary",
802
- disabled: e(S) || !e(x).ok,
803
- onClick: l[18] || (l[18] = //@ts-ignore
804
- (...t) => e(c).apply && e(c).apply(...t))
805
- }, o(e(a).apply), 9, nn)
806
- ])
807
- ], 64)) : (r(), u("div", qe, [
808
- l[23] || (l[23] = n("svg", {
809
- viewBox: "0 0 80 80",
810
- fill: "none",
811
- "aria-hidden": "true"
812
- }, [
813
- n("rect", {
814
- x: "15",
815
- y: "10",
816
- width: "50",
817
- height: "60",
818
- rx: "8",
819
- fill: "#eff6ff",
820
- stroke: "#bfdbfe"
821
- }),
822
- n("path", {
823
- d: "M25 25h30M25 35h30M25 45h30M35 25v30M45 25v30M25 55h30",
824
- stroke: "#93c5fd",
825
- "stroke-width": "1.5"
826
- })
827
- ], -1)),
828
- n("strong", null, o(e(a).noSource), 1),
829
- n("span", null, o(e(a).sourceOnly), 1),
830
- n("button", {
831
- type: "button",
832
- class: "mr-binding-primary",
833
- disabled: s.readonly,
834
- onClick: l[2] || (l[2] = (t) => Z.value?.click())
835
- }, o(e(a).upload), 9, Xe)
836
- ]))
837
- ], 40, Te));
838
- }
839
- }), dn = /* @__PURE__ */ De(ln, [["__scopeId", "data-v-76b9c5c3"]]);
840
- export {
841
- dn as default
842
- };