@agile-team/mach-report 2.25.1 → 2.26.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.
- package/README.md +14 -8
- package/dist/ExcelBindingWizard-B418l44t.js +1578 -0
- package/dist/ExcelBindingWizard-C4FGVsY_.cjs +1 -0
- package/dist/{ParamEditor-CGfaweYX.cjs → ParamEditor-BemJE8n8.cjs} +1 -1
- package/dist/{ParamEditor-B7YVD28E.js → ParamEditor-XvMtf_XQ.js} +2 -2
- package/dist/{ReportBatchPanel-BRJt0TXp.cjs → ReportBatchPanel-CbY4fvXD.cjs} +1 -1
- package/dist/{ReportBatchPanel-BTKHtLTW.js → ReportBatchPanel-Ds0R_uXn.js} +37 -37
- package/dist/{ReportLabelStudio-BvK_WBke.cjs → ReportLabelStudio-DuTwN5er.cjs} +1 -1
- package/dist/{ReportLabelStudio-CZwqyO3t.js → ReportLabelStudio-ZFy79eRv.js} +26 -26
- package/dist/ReportParamPanel-Chxu4MTx.cjs +1 -0
- package/dist/{ReportParamPanel-DGXzBzl2.js → ReportParamPanel-Czm3OPo_.js} +216 -205
- package/dist/ReportPreview-C9c0Rp7Y.js +7380 -0
- package/dist/ReportPreview-CIMR4ERo.cjs +6 -0
- package/dist/{ReportTemplateLibrary-ClwxhnC0.cjs → ReportTemplateLibrary-C6lByc69.cjs} +1 -1
- package/dist/{ReportTemplateLibrary-C7sB0Jay.js → ReportTemplateLibrary-XJVoTDIz.js} +1 -1
- package/dist/{RuleEditor-CsDGFaWz.js → RuleEditor-CeNFPeOc.js} +5 -5
- package/dist/{RuleEditor-D-OdaGdR.cjs → RuleEditor-gggUkEwB.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-DAqR9zQi.cjs → TemplateOutlinePanel-B0e-umq2.cjs} +1 -1
- package/dist/{TemplateOutlinePanel-CXOT7d1r.js → TemplateOutlinePanel-BWN4Y9iz.js} +2 -2
- package/dist/{TemplateReusePanel-Dcfx3Hba.js → TemplateReusePanel-CR-4OHoU.js} +2 -2
- package/dist/{TemplateReusePanel-ygIi-Ajz.cjs → TemplateReusePanel-Cthig1S1.cjs} +1 -1
- package/dist/{TemplateReviewPanel-COU8FqPq.js → TemplateReviewPanel-BkWzyNL4.js} +2 -2
- package/dist/{TemplateReviewPanel-DyGULVxr.cjs → TemplateReviewPanel-D8o2gDaK.cjs} +1 -1
- package/dist/analytics.cjs +1 -1
- package/dist/analytics.js +5 -5
- package/dist/artifact-integrity.json +106 -102
- package/dist/{assets-C4MIvzQ4.js → assets-BFTP-0WR.js} +2 -2
- package/dist/{assets-BYdpkTIt.cjs → assets-CZiZhTf2.cjs} +1 -1
- package/dist/{auto-D7x7QsWD.js → auto-C7udkeAa.js} +89 -88
- package/dist/auto-CXd2E2aZ.cjs +1 -0
- package/dist/capabilities-D8UU2clQ.cjs +1 -0
- package/dist/{capabilities-CN_kSVjO.js → capabilities-g0a2j9Yy.js} +50 -46
- package/dist/{charts-Cjw5AYkg.cjs → charts-D-Vg-ak9.cjs} +1 -1
- package/dist/{charts-CxJZ0XaY.js → charts-D48XCefN.js} +1 -1
- package/dist/computed-BQgBrma-.cjs +1 -0
- package/dist/{computed-f3pOqWLX.js → computed-CH3NYPOW.js} +198 -188
- package/dist/{data-bar-Bfh54sT4.js → data-bar-DjOgTLqu.js} +1 -1
- package/dist/{dataset-DL83majE.js → dataset-B8oTsC6o.js} +69 -66
- package/dist/dataset-D3OsyzG1.cjs +1 -0
- package/dist/designer-COuSUxZ1.cjs +2 -0
- package/dist/designer-CT4mlrr0.js +7997 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +83 -4
- package/dist/designer.d.ts +83 -4
- package/dist/designer.js +4 -4
- package/dist/{diagnostic-collector-gB07PHy2.js → diagnostic-collector-C-JBA016.js} +2 -2
- package/dist/dom-DgWc-DY1.js +452 -0
- package/dist/dom-Fk4NF-gN.cjs +1 -0
- package/dist/{encoding-Amq3XrtU.js → encoding-D480EM2r.js} +2 -2
- package/dist/{encoding-DRVXs5xm.cjs → encoding-tWc2Wn89.cjs} +1 -1
- package/dist/execution-result-7sG_mdcD.cjs +1 -0
- package/dist/execution-result-Ba65gieT.js +39 -0
- package/dist/{font-loader-p_SyTvqt.cjs → font-loader-BIxme_9g.cjs} +1 -1
- package/dist/{font-loader-D4NLIKJL.js → font-loader-CHmEwkHl.js} +1 -1
- package/dist/{grid-strokes-DkZEZvcI.js → grid-strokes-DsoICRjZ.js} +1 -1
- package/dist/import-range-BwT86Z3j.cjs +1 -0
- package/dist/import-range-D9p_blcb.js +98 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -25
- package/dist/{json-snapshot-CBVWZvyC.js → json-snapshot-BZ0CIQln.js} +1142 -951
- package/dist/json-snapshot-DGFeI30h.cjs +2 -0
- package/dist/{matrix-b6T291xo.js → matrix-CB9TqTEy.js} +1 -1
- package/dist/{matrix-DUYPRL7t.cjs → matrix-CcqYOuq_.cjs} +1 -1
- package/dist/{pdf-DU8HelKd.js → pdf-DTR7fAIr.js} +3596 -3517
- package/dist/{pdf-C060D5UY.cjs → pdf-d9oJ6V0P.cjs} +49 -49
- package/dist/pdf.cjs +1 -1
- package/dist/pdf.js +2 -2
- package/dist/{plugin-DHe8y5pD.cjs → plugin-B7Bi-1te.cjs} +1 -1
- package/dist/{plugin-BdCplNe1.js → plugin-OKDFQFS4.js} +1 -1
- package/dist/{prefill-Buy4NJ15.js → prefill-C8fF91JB.js} +3 -3
- package/dist/{prefill-Cw4ZYGXZ.cjs → prefill-C_Bf_AMo.cjs} +1 -1
- package/dist/{prepared-BlNeOjoO.cjs → prepared-BLhV7vdE.cjs} +1 -1
- package/dist/{prepared-CBJ7BkK0.js → prepared-DhgQ0d-h.js} +7 -7
- package/dist/protocol-CZ-BILne.cjs +1 -0
- package/dist/{protocol-CB19KXGr.js → protocol-DHO91-Jt.js} +3 -3
- package/dist/{record-bindings-Cv7lFiof.js → record-bindings-DBrCu6zO.js} +3 -3
- package/dist/{record-bindings-B7djSjNs.cjs → record-bindings-KEs-DKCS.cjs} +1 -1
- package/dist/region-binding-workflow-FSyIZge8.js +882 -0
- package/dist/region-binding-workflow-ikpY1Kbw.cjs +3 -0
- package/dist/report-encoding-worker.cjs +1 -1
- package/dist/report-encoding-worker.js +1 -1
- package/dist/rich-text-layout-BYbIc3eJ.cjs +3 -0
- package/dist/rich-text-layout-BtygMWZC.js +96 -0
- package/dist/runtime-B5HG8poy.cjs +1 -0
- package/dist/runtime-BsvAqz4a.js +204 -0
- package/dist/sbom.cdx.json +1 -1
- package/dist/server-node.cjs +5 -5
- package/dist/server-node.js +2323 -2120
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +35 -0
- package/dist/server.d.ts +35 -0
- package/dist/server.js +340 -328
- package/dist/style.css +1 -1
- package/dist/{template-catalog-CM6U_RlD.js → template-catalog-BbrN9dgu.js} +5 -5
- package/dist/{template-catalog-Cj66M84u.cjs → template-catalog-DDH-5J57.cjs} +1 -1
- package/dist/{template-fragments-BDxdCuMD.js → template-fragments-CUTE8-_I.js} +3 -3
- package/dist/{template-fragments-DbKdxI1z.cjs → template-fragments-cyAQu7aw.cjs} +1 -1
- package/dist/{template-registry-B-AK1oam.cjs → template-registry-D24Z8aQf.cjs} +1 -1
- package/dist/{template-registry-DeVgwEZj.js → template-registry-PSuLsnyq.js} +4 -4
- package/dist/{template-serialization-CqQY4zDg.cjs → template-serialization-BOUidUlh.cjs} +1 -1
- package/dist/{template-serialization-CWmHq7lX.js → template-serialization-BgGWYV_1.js} +1 -1
- package/dist/{textwrap-BywMBMXM.js → textwrap-Bt_tnI6V.js} +1 -1
- package/dist/vue/async.d.cts +46 -3
- package/dist/vue/async.d.ts +46 -3
- package/dist/vue/index.d.cts +217 -25
- package/dist/vue/index.d.ts +217 -25
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +434 -202
- package/dist/workbook-session-BJfZVp4q.cjs +29 -0
- package/dist/{workbook-session-B6hRjTyX.js → workbook-session-DRnMjIFK.js} +2377 -2350
- package/dist/worker.cjs +1 -1
- package/dist/worker.js +4 -4
- package/dist/xlsx.cjs +1 -1
- package/dist/xlsx.d.cts +27 -2
- package/dist/xlsx.d.ts +27 -2
- package/dist/xlsx.js +15 -15
- package/package.json +1 -1
- package/dist/ExcelBindingWizard-bs3F4dD8.js +0 -1486
- package/dist/ExcelBindingWizard-jSdjBtWw.cjs +0 -1
- package/dist/ReportParamPanel-B27IGJjk.cjs +0 -1
- package/dist/ReportPreview-CnxaDTCO.js +0 -7170
- package/dist/ReportPreview-DqFBcsJQ.cjs +0 -6
- package/dist/auto-mPK9W0y5.cjs +0 -1
- package/dist/capabilities-D4nfhcvB.cjs +0 -1
- package/dist/computed-DK6BruFz.cjs +0 -1
- package/dist/dataset-IrlXbUvh.cjs +0 -1
- package/dist/designer-B597ZdC0.js +0 -7595
- package/dist/designer-DFIdv_n7.cjs +0 -2
- package/dist/dom-CXWMmwh-.cjs +0 -1
- package/dist/dom-DxdCMLzs.js +0 -452
- package/dist/json-snapshot-DCFEtfFw.cjs +0 -2
- package/dist/protocol-BU_4sXP0.cjs +0 -1
- package/dist/region-binding-workflow-EYxvUYJ-.js +0 -977
- package/dist/region-binding-workflow-NdkMSFCh.cjs +0 -3
- package/dist/rich-text-layout-Ch_N0Ubu.js +0 -52
- package/dist/rich-text-layout-yJGuThtC.cjs +0 -3
- package/dist/runtime-B5d_lQNQ.js +0 -227
- package/dist/runtime-BRx8Agqr.cjs +0 -1
- package/dist/workbook-session-BclW7KKH.cjs +0 -29
|
@@ -0,0 +1,1578 @@
|
|
|
1
|
+
import { defineComponent as Be, ref as E, computed as M, watch as ne, nextTick as De, openBlock as v, createElementBlock as g, createElementVNode as a, createTextVNode as N, toDisplayString as o, createVNode as B, Fragment as U, renderList as Y, normalizeClass as Se, createCommentVNode as K, unref as e, shallowRef as ot, onBeforeUnmount as it, normalizeStyle as We, createBlock as Pe, withDirectives as st, vShow as rt } from "vue";
|
|
2
|
+
import { a as Te, F as $e, E as Le, b as ut, u as dt } from "./designer-CT4mlrr0.js";
|
|
3
|
+
import { p as be, c as ze } from "./import-range-D9p_blcb.js";
|
|
4
|
+
import { a as L, _ as ct } from "./_plugin-vue_export-helper-8SL1F89S.js";
|
|
5
|
+
import { f as vt, n as gt, m as ft, h as bt, k as mt, v as ht, i as yt, p as pt, d as wt, c as kt, e as $t, a as xt, g as Ct } from "./region-binding-workflow-FSyIZge8.js";
|
|
6
|
+
import { u as Rt } from "./useLocalDraft-BnhcxXk_.js";
|
|
7
|
+
function Oe(t, k) {
|
|
8
|
+
const u = /^\$\.datasets\[(\d+)\]/.exec(t.path)?.[1];
|
|
9
|
+
return u !== void 0 ? k[Number(u)]?.id : k.find((b) => t.path.startsWith(`$.datasets.${b.id}.samples`))?.id;
|
|
10
|
+
}
|
|
11
|
+
function qe(t, k) {
|
|
12
|
+
const u = /\.fields\[(\d+)\]/.exec(t)?.[1];
|
|
13
|
+
return u !== void 0 ? { control: "field", fieldIndex: Number(u) } : { control: t.split(".").at(-1) || k };
|
|
14
|
+
}
|
|
15
|
+
function Ve(t, k, u) {
|
|
16
|
+
const b = /^\$\.recipe\.regions\[(\d+)\]/.exec(t.path)?.[1], d = Oe(t, u), f = b === void 0 ? k.regions.find(($) => $.dataset === d) : k.regions[Number(b)];
|
|
17
|
+
if (!f) return { control: t.path.endsWith("footerRange") ? "footer" : "regions", ...k.footerRange ? { range: k.footerRange } : {} };
|
|
18
|
+
if (t.path.startsWith("$.datasets")) return { regionId: f.id, range: f.range, control: t.code === "row-key" ? "rowKey" : "contract" };
|
|
19
|
+
const c = qe(t.path, "range"), x = t.code === "row-key" ? "rowKey" : c.control.startsWith("regions[") ? "range" : c.control;
|
|
20
|
+
return { ...c, control: x, regionId: f.id, range: f.range };
|
|
21
|
+
}
|
|
22
|
+
function It(t, k, u) {
|
|
23
|
+
if (t.path.startsWith("$.datasets")) {
|
|
24
|
+
const d = Oe(t, u);
|
|
25
|
+
return d === void 0 ? [] : k.regions.filter((f) => f.dataset === d).map((f) => f.id);
|
|
26
|
+
}
|
|
27
|
+
const b = Ve(t, k, u).regionId;
|
|
28
|
+
return b ? [b] : [];
|
|
29
|
+
}
|
|
30
|
+
function Mt(t, k) {
|
|
31
|
+
const u = /^\$\.recipe\.regions\.(title|header|detail|footer)$/.exec(t.path)?.[1];
|
|
32
|
+
return u ? { control: u, range: k.regions[u] } : t.path.startsWith("$.datasets") ? { control: t.code === "row-key" ? "rowKey" : "contract", range: k.regions.detail } : { ...qe(t.path, "detail"), range: k.regions.detail };
|
|
33
|
+
}
|
|
34
|
+
function xe(t) {
|
|
35
|
+
if (t.range)
|
|
36
|
+
try {
|
|
37
|
+
const k = be(t.range);
|
|
38
|
+
return t.fieldIndex !== void 0 && (k.left = k.right = k.left + t.fieldIndex), k;
|
|
39
|
+
} catch {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function St(t, k, u) {
|
|
44
|
+
return k.control === "dataset" ? !u.dataset : k.control === "rowKey" ? !u.rowKey : k.control === "field" && k.fieldIndex !== void 0 ? !u.fields[k.fieldIndex] : !1;
|
|
45
|
+
}
|
|
46
|
+
const Kt = ["aria-label"], Ft = { class: "mr-binding-group" }, Et = { class: "mr-binding-note" }, Dt = ["title", "disabled"], Tt = {
|
|
47
|
+
class: "mr-binding-region-list",
|
|
48
|
+
role: "list",
|
|
49
|
+
tabindex: "-1",
|
|
50
|
+
"data-binding-control": "regions"
|
|
51
|
+
}, zt = ["data-state"], Bt = ["aria-pressed", "onClick"], Nt = ["title"], At = { class: "mr-binding-region-state" }, Wt = { key: 0 }, Pt = ["aria-label", "disabled", "onClick"], Ht = ["disabled"], Lt = {
|
|
52
|
+
key: 0,
|
|
53
|
+
class: "mr-binding-group"
|
|
54
|
+
}, Ot = {
|
|
55
|
+
class: "mr-binding-label",
|
|
56
|
+
tabindex: "-1"
|
|
57
|
+
}, qt = ["value", "aria-label"], Vt = { class: "mr-binding-label" }, Jt = ["value", "aria-label"], jt = { value: "record" }, Gt = { value: "repeat" }, Ut = { class: "mr-binding-note" }, Xt = {
|
|
58
|
+
class: "mr-binding-label",
|
|
59
|
+
tabindex: "-1"
|
|
60
|
+
}, _t = ["value", "aria-label"], Qt = { value: "" }, Yt = ["value"], Zt = {
|
|
61
|
+
key: 0,
|
|
62
|
+
class: "mr-binding-label",
|
|
63
|
+
tabindex: "-1"
|
|
64
|
+
}, ea = { class: "mr-binding-region-tools" }, ta = ["disabled"], aa = ["aria-label"], na = {
|
|
65
|
+
key: 1,
|
|
66
|
+
class: "mr-binding-mappings"
|
|
67
|
+
}, la = { key: 0 }, oa = {
|
|
68
|
+
key: 2,
|
|
69
|
+
class: "mr-binding-map-pages"
|
|
70
|
+
}, ia = ["disabled", "aria-label"], sa = ["disabled", "aria-label"], ra = {
|
|
71
|
+
key: 3,
|
|
72
|
+
class: "mr-binding-concurrency"
|
|
73
|
+
}, ua = {
|
|
74
|
+
class: "mr-binding-group",
|
|
75
|
+
tabindex: "-1",
|
|
76
|
+
"data-binding-control": "footer"
|
|
77
|
+
}, da = { class: "mr-binding-note" }, ca = { class: "mr-binding-region-tools" }, va = ["disabled"], ga = ["aria-label"], fa = /* @__PURE__ */ Be({
|
|
78
|
+
__name: "ExcelRegionBindingPanel",
|
|
79
|
+
props: {
|
|
80
|
+
controller: {},
|
|
81
|
+
datasets: {},
|
|
82
|
+
disabled: { type: Boolean },
|
|
83
|
+
messages: {}
|
|
84
|
+
},
|
|
85
|
+
setup(t) {
|
|
86
|
+
const k = t, u = E(0), b = E(), d = k.controller.active, f = M(() => k.datasets.find((S) => S.id === d.value?.dataset)), c = M(() => {
|
|
87
|
+
if (!d.value) return [];
|
|
88
|
+
let S = 1;
|
|
89
|
+
try {
|
|
90
|
+
S = be(d.value.range).left;
|
|
91
|
+
} catch {
|
|
92
|
+
}
|
|
93
|
+
return d.value.fields.slice(u.value * 12, u.value * 12 + 12).map((I, l) => ({ field: I, index: u.value * 12 + l, physical: ze(S + u.value * 12 + l) }));
|
|
94
|
+
}), x = M(() => Math.max(1, Math.ceil((d.value?.fields.length ?? 0) / 12)));
|
|
95
|
+
function $(S) {
|
|
96
|
+
return S.target.value;
|
|
97
|
+
}
|
|
98
|
+
function F(S) {
|
|
99
|
+
k.controller.setActive(S), u.value = 0;
|
|
100
|
+
}
|
|
101
|
+
ne(() => k.controller.focusTarget.value, async (S) => {
|
|
102
|
+
if (!S) return;
|
|
103
|
+
u.value = Math.floor((S.target.fieldIndex ?? 0) / 12), await De();
|
|
104
|
+
const I = S.target.control === "field" ? `field-${S.target.fieldIndex}` : S.target.control === "contract" ? "dataset" : S.target.control, l = b.value?.querySelector(`[data-binding-control="${I}"]`), D = l?.closest("details");
|
|
105
|
+
D && (D.open = !0);
|
|
106
|
+
const C = k.disabled && l?.matches("input,select,textarea,button") ? l.closest("label") : l;
|
|
107
|
+
C?.focus(), C?.scrollIntoView?.({ block: "nearest" }), Te(C);
|
|
108
|
+
});
|
|
109
|
+
function G(S) {
|
|
110
|
+
if (!(!d.value || k.disabled)) {
|
|
111
|
+
d.value.range = $(S);
|
|
112
|
+
try {
|
|
113
|
+
const I = be(d.value.range), l = I.right - I.left + 1;
|
|
114
|
+
l <= 2048 && (d.value.fields = Array.from({ length: l }, (D, C) => d.value.fields[C] ?? ""));
|
|
115
|
+
} catch {
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
return (S, I) => (v(), g("section", {
|
|
120
|
+
ref_key: "panel",
|
|
121
|
+
ref: b,
|
|
122
|
+
class: "mr-binding-multi",
|
|
123
|
+
"aria-label": t.messages.multiRegions
|
|
124
|
+
}, [
|
|
125
|
+
a("div", Ft, [
|
|
126
|
+
a("h3", null, [
|
|
127
|
+
N(o(t.messages.multiRegions), 1),
|
|
128
|
+
a("span", null, o(t.controller.recipe.value.regions.length) + "/128", 1)
|
|
129
|
+
]),
|
|
130
|
+
a("p", Et, o(t.messages.multiHint), 1),
|
|
131
|
+
a("button", {
|
|
132
|
+
type: "button",
|
|
133
|
+
class: "mr-binding-add-region",
|
|
134
|
+
title: t.controller.recipe.value.regions.length >= 128 ? t.messages.limitRegions : t.controller.selection.value ? t.messages.addRegion : t.messages.noCellSelection,
|
|
135
|
+
disabled: t.disabled || !t.controller.selection.value || t.controller.recipe.value.regions.length >= 128,
|
|
136
|
+
onClick: I[0] || (I[0] = //@ts-ignore
|
|
137
|
+
(...l) => t.controller.add && t.controller.add(...l))
|
|
138
|
+
}, [
|
|
139
|
+
B(L, {
|
|
140
|
+
name: "grid",
|
|
141
|
+
size: 13
|
|
142
|
+
}),
|
|
143
|
+
N(o(t.messages.addRegion), 1),
|
|
144
|
+
a("code", null, o(t.controller.selection.value || "—"), 1)
|
|
145
|
+
], 8, Dt),
|
|
146
|
+
a("div", Tt, [
|
|
147
|
+
(v(!0), g(U, null, Y(t.controller.directory.value, (l) => (v(), g("div", {
|
|
148
|
+
key: l.region.id,
|
|
149
|
+
class: Se(["mr-binding-region-entry", { "is-active": l.region.id === t.controller.activeId.value }]),
|
|
150
|
+
"data-state": l.state
|
|
151
|
+
}, [
|
|
152
|
+
a("button", {
|
|
153
|
+
type: "button",
|
|
154
|
+
"aria-pressed": l.region.id === t.controller.activeId.value,
|
|
155
|
+
onClick: (D) => F(l.region.id)
|
|
156
|
+
}, [
|
|
157
|
+
a("strong", {
|
|
158
|
+
title: l.region.id
|
|
159
|
+
}, o(l.region.id), 9, Nt),
|
|
160
|
+
a("code", null, o(l.region.range), 1),
|
|
161
|
+
a("small", null, o(l.region.mode === "record" ? t.messages.recordMode : t.messages.repeatMode) + " · " + o(l.region.dataset || t.messages.chooseDataset), 1),
|
|
162
|
+
a("span", At, [
|
|
163
|
+
N(o(l.state === "ready" ? t.messages.regionReady : l.state === "pending" ? t.messages.regionPending : t.messages.regionError), 1),
|
|
164
|
+
l.issues.length ? (v(), g("span", Wt, " · " + o(l.issues.length), 1)) : K("", !0)
|
|
165
|
+
])
|
|
166
|
+
], 8, Bt),
|
|
167
|
+
a("button", {
|
|
168
|
+
type: "button",
|
|
169
|
+
"aria-label": `${t.messages.removeRegion} ${l.region.id}`,
|
|
170
|
+
disabled: t.disabled,
|
|
171
|
+
onClick: (D) => t.controller.remove(l.region.id)
|
|
172
|
+
}, [
|
|
173
|
+
B(L, {
|
|
174
|
+
name: "close",
|
|
175
|
+
size: 12
|
|
176
|
+
})
|
|
177
|
+
], 8, Pt)
|
|
178
|
+
], 10, zt))), 128))
|
|
179
|
+
])
|
|
180
|
+
]),
|
|
181
|
+
a("fieldset", {
|
|
182
|
+
disabled: t.disabled,
|
|
183
|
+
class: "mr-binding-region-editor"
|
|
184
|
+
}, [
|
|
185
|
+
e(d) ? (v(), g("section", Lt, [
|
|
186
|
+
a("h3", null, [
|
|
187
|
+
N(o(t.messages.regionProperties), 1),
|
|
188
|
+
a("code", null, o(e(d).id), 1)
|
|
189
|
+
]),
|
|
190
|
+
a("label", Ot, [
|
|
191
|
+
N(o(t.messages.regionCoordinates), 1),
|
|
192
|
+
a("input", {
|
|
193
|
+
"data-binding-control": "range",
|
|
194
|
+
value: e(d).range,
|
|
195
|
+
"aria-label": t.messages.regionCoordinates,
|
|
196
|
+
onChange: G
|
|
197
|
+
}, null, 40, qt)
|
|
198
|
+
]),
|
|
199
|
+
a("label", Vt, [
|
|
200
|
+
N(o(t.messages.regionMode), 1),
|
|
201
|
+
a("select", {
|
|
202
|
+
value: e(d).mode,
|
|
203
|
+
"aria-label": t.messages.regionMode,
|
|
204
|
+
onChange: I[1] || (I[1] = (l) => t.controller.property("mode", $(l)))
|
|
205
|
+
}, [
|
|
206
|
+
a("option", jt, o(t.messages.recordMode), 1),
|
|
207
|
+
a("option", Gt, o(t.messages.repeatMode), 1)
|
|
208
|
+
], 40, Jt)
|
|
209
|
+
]),
|
|
210
|
+
a("p", Ut, o(e(d).mode === "record" ? t.messages.recordHint : t.messages.repeatHint), 1),
|
|
211
|
+
a("label", Xt, [
|
|
212
|
+
N(o(t.messages.dataset), 1),
|
|
213
|
+
a("select", {
|
|
214
|
+
"data-binding-control": "dataset",
|
|
215
|
+
value: e(d).dataset,
|
|
216
|
+
"aria-label": t.messages.dataset,
|
|
217
|
+
onChange: I[2] || (I[2] = (l) => t.controller.dataset($(l)))
|
|
218
|
+
}, [
|
|
219
|
+
a("option", Qt, o(t.messages.chooseDataset), 1),
|
|
220
|
+
(v(!0), g(U, null, Y(t.datasets, (l) => (v(), g("option", {
|
|
221
|
+
key: l.id,
|
|
222
|
+
value: l.id
|
|
223
|
+
}, o(l.label || l.id), 9, Yt))), 128))
|
|
224
|
+
], 40, _t)
|
|
225
|
+
]),
|
|
226
|
+
f.value ? (v(), g("label", Zt, [
|
|
227
|
+
N(o(t.messages.rowKey), 1),
|
|
228
|
+
B($e, {
|
|
229
|
+
"data-binding-control": "rowKey",
|
|
230
|
+
"model-value": e(d).rowKey,
|
|
231
|
+
fields: f.value.fields.filter((l) => l.type !== "boolean"),
|
|
232
|
+
label: t.messages.rowKey,
|
|
233
|
+
disabled: t.disabled,
|
|
234
|
+
messages: t.messages,
|
|
235
|
+
placeholder: t.messages.chooseRowKey,
|
|
236
|
+
onChange: I[3] || (I[3] = (l) => t.controller.property("rowKey", l))
|
|
237
|
+
}, null, 8, ["model-value", "fields", "label", "disabled", "messages", "placeholder"])
|
|
238
|
+
])) : K("", !0),
|
|
239
|
+
a("div", ea, [
|
|
240
|
+
a("button", {
|
|
241
|
+
type: "button",
|
|
242
|
+
disabled: !t.controller.selection.value,
|
|
243
|
+
onClick: I[4] || (I[4] = //@ts-ignore
|
|
244
|
+
(...l) => t.controller.header && t.controller.header(...l))
|
|
245
|
+
}, o(t.messages.bindRegionHeader), 9, ta),
|
|
246
|
+
a("code", null, o(e(d).headerRange || t.messages.noRegionHeader), 1),
|
|
247
|
+
e(d).headerRange ? (v(), g("button", {
|
|
248
|
+
key: 0,
|
|
249
|
+
type: "button",
|
|
250
|
+
"aria-label": t.messages.clearHeader,
|
|
251
|
+
onClick: I[5] || (I[5] = //@ts-ignore
|
|
252
|
+
(...l) => t.controller.clearHeader && t.controller.clearHeader(...l))
|
|
253
|
+
}, [
|
|
254
|
+
B(L, {
|
|
255
|
+
name: "close",
|
|
256
|
+
size: 11
|
|
257
|
+
})
|
|
258
|
+
], 8, aa)) : K("", !0)
|
|
259
|
+
]),
|
|
260
|
+
f.value ? (v(), g("div", na, [
|
|
261
|
+
(v(!0), g(U, null, Y(c.value, (l) => (v(), g("label", {
|
|
262
|
+
key: l.index,
|
|
263
|
+
class: "mr-binding-map",
|
|
264
|
+
tabindex: "-1"
|
|
265
|
+
}, [
|
|
266
|
+
a("span", null, o(l.physical), 1),
|
|
267
|
+
a("div", null, [
|
|
268
|
+
B($e, {
|
|
269
|
+
"data-binding-control": `field-${l.index}`,
|
|
270
|
+
"model-value": e(d).fields[l.index] ?? "",
|
|
271
|
+
fields: f.value.fields,
|
|
272
|
+
disabled: t.disabled,
|
|
273
|
+
messages: t.messages,
|
|
274
|
+
placeholder: t.messages.chooseField,
|
|
275
|
+
label: `${t.messages.physical} ${l.physical} · ${t.messages.business}`,
|
|
276
|
+
onChange: (D) => t.controller.mapping(l.index, D)
|
|
277
|
+
}, null, 8, ["data-binding-control", "model-value", "fields", "disabled", "messages", "placeholder", "label", "onChange"]),
|
|
278
|
+
l.field ? (v(), g("small", la, o(f.value.fields.find((D) => D.field === l.field)?.type) + " · " + o(f.value.fields.find((D) => D.field === l.field)?.unit || "—"), 1)) : K("", !0)
|
|
279
|
+
])
|
|
280
|
+
]))), 128))
|
|
281
|
+
])) : K("", !0),
|
|
282
|
+
x.value > 1 ? (v(), g("div", oa, [
|
|
283
|
+
a("button", {
|
|
284
|
+
type: "button",
|
|
285
|
+
disabled: u.value <= 0,
|
|
286
|
+
"aria-label": t.messages.previousColumns,
|
|
287
|
+
onClick: I[6] || (I[6] = (l) => u.value--)
|
|
288
|
+
}, [
|
|
289
|
+
B(L, {
|
|
290
|
+
name: "chevron-left",
|
|
291
|
+
size: 13
|
|
292
|
+
})
|
|
293
|
+
], 8, ia),
|
|
294
|
+
a("span", null, o(u.value + 1) + "/" + o(x.value), 1),
|
|
295
|
+
a("button", {
|
|
296
|
+
type: "button",
|
|
297
|
+
disabled: u.value + 1 >= x.value,
|
|
298
|
+
"aria-label": t.messages.nextColumns,
|
|
299
|
+
onClick: I[7] || (I[7] = (l) => u.value++)
|
|
300
|
+
}, [
|
|
301
|
+
B(L, {
|
|
302
|
+
name: "chevron-right",
|
|
303
|
+
size: 13
|
|
304
|
+
})
|
|
305
|
+
], 8, sa)
|
|
306
|
+
])) : K("", !0),
|
|
307
|
+
f.value ? (v(), g("details", ra, [
|
|
308
|
+
a("summary", null, o(t.messages.concurrency), 1),
|
|
309
|
+
(v(), g(U, null, Y(["revisionField", "sourceTokenField"], (l) => a("label", {
|
|
310
|
+
key: l,
|
|
311
|
+
class: "mr-binding-label",
|
|
312
|
+
tabindex: "-1"
|
|
313
|
+
}, [
|
|
314
|
+
N(o(l === "revisionField" ? t.messages.revisionField : t.messages.sourceTokenField), 1),
|
|
315
|
+
B($e, {
|
|
316
|
+
"data-binding-control": l,
|
|
317
|
+
"model-value": e(d)[l] || "",
|
|
318
|
+
fields: f.value.fields,
|
|
319
|
+
disabled: t.disabled,
|
|
320
|
+
messages: t.messages,
|
|
321
|
+
placeholder: t.messages.optional,
|
|
322
|
+
label: l === "revisionField" ? t.messages.revisionField : t.messages.sourceTokenField,
|
|
323
|
+
onChange: (D) => t.controller.property(l, D)
|
|
324
|
+
}, null, 8, ["data-binding-control", "model-value", "fields", "disabled", "messages", "placeholder", "label", "onChange"])
|
|
325
|
+
])), 64))
|
|
326
|
+
])) : K("", !0)
|
|
327
|
+
])) : K("", !0),
|
|
328
|
+
a("section", ua, [
|
|
329
|
+
a("h3", null, o(t.messages.flowFooter), 1),
|
|
330
|
+
a("p", da, o(t.messages.flowFooterHint), 1),
|
|
331
|
+
a("div", ca, [
|
|
332
|
+
a("button", {
|
|
333
|
+
type: "button",
|
|
334
|
+
disabled: !t.controller.selection.value,
|
|
335
|
+
onClick: I[8] || (I[8] = //@ts-ignore
|
|
336
|
+
(...l) => t.controller.footer && t.controller.footer(...l))
|
|
337
|
+
}, o(t.messages.bindFooter), 9, va),
|
|
338
|
+
a("code", null, o(t.controller.recipe.value.footerRange || "—"), 1),
|
|
339
|
+
t.controller.recipe.value.footerRange ? (v(), g("button", {
|
|
340
|
+
key: 0,
|
|
341
|
+
type: "button",
|
|
342
|
+
"aria-label": t.messages.clearFooter,
|
|
343
|
+
onClick: I[9] || (I[9] = //@ts-ignore
|
|
344
|
+
(...l) => t.controller.clearFooter && t.controller.clearFooter(...l))
|
|
345
|
+
}, [
|
|
346
|
+
B(L, {
|
|
347
|
+
name: "close",
|
|
348
|
+
size: 11
|
|
349
|
+
})
|
|
350
|
+
], 8, ga)) : K("", !0)
|
|
351
|
+
])
|
|
352
|
+
])
|
|
353
|
+
], 8, Ht)
|
|
354
|
+
], 8, Kt));
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
function ba(t, k) {
|
|
358
|
+
const u = k.sheets.find((b) => b.name === t.sheet);
|
|
359
|
+
if (u)
|
|
360
|
+
try {
|
|
361
|
+
const b = be(u.range), d = t.cell ?? t.range, f = d ? be(d) : void 0, c = t.row ?? f?.top ?? b.top, x = t.column ?? f?.left ?? b.left;
|
|
362
|
+
return !Number.isInteger(c) || !Number.isInteger(x) || c < b.top || c > b.bottom || x < b.left || x > b.right ? void 0 : { sheet: u.name, row: c, column: x };
|
|
363
|
+
} catch {
|
|
364
|
+
return;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
const ma = {
|
|
368
|
+
key: 0,
|
|
369
|
+
class: "mr-import-diagnostics"
|
|
370
|
+
}, ha = { key: 0 }, ya = ["aria-label", "onClick"], pa = {
|
|
371
|
+
key: 1,
|
|
372
|
+
class: "mr-import-diagnostic-text"
|
|
373
|
+
}, wa = { key: 0 }, ka = ["aria-label"], $a = ["disabled", "aria-label"], xa = ["disabled", "aria-label"], Ca = /* @__PURE__ */ Be({
|
|
374
|
+
__name: "ExcelImportDiagnostics",
|
|
375
|
+
props: {
|
|
376
|
+
source: {},
|
|
377
|
+
currentSheet: {},
|
|
378
|
+
disabled: { type: Boolean },
|
|
379
|
+
messages: {}
|
|
380
|
+
},
|
|
381
|
+
emits: ["locate"],
|
|
382
|
+
setup(t, { emit: k }) {
|
|
383
|
+
const u = t, b = k, d = M(() => ({ ...Le, ...u.messages })), f = E(0), c = 12, x = M(() => (u.source.diagnostics ?? []).slice(0, 200)), $ = M(() => Math.max(1, Math.ceil(x.value.length / c))), F = M(() => u.source.diagnosticSummary?.total ?? u.source.diagnostics?.length ?? 0), G = M(() => x.value.slice(f.value * c, (f.value + 1) * c).map((l) => ({ diagnostic: l, target: ba(l, u.source) })));
|
|
384
|
+
ne(() => u.source, () => {
|
|
385
|
+
f.value = 0;
|
|
386
|
+
}), ne($, (l) => {
|
|
387
|
+
f.value = Math.min(f.value, l - 1);
|
|
388
|
+
});
|
|
389
|
+
function S(l) {
|
|
390
|
+
return !!l && (!u.disabled || l.sheet === u.currentSheet);
|
|
391
|
+
}
|
|
392
|
+
function I(l) {
|
|
393
|
+
S(l) && b("locate", l);
|
|
394
|
+
}
|
|
395
|
+
return (l, D) => F.value ? (v(), g("details", ma, [
|
|
396
|
+
a("summary", null, [
|
|
397
|
+
N(o(d.value.inspectWarning) + " · " + o(F.value), 1),
|
|
398
|
+
F.value > x.value.length ? (v(), g("small", ha, o(d.value.diagnosticDetails.replace("{shown}", String(x.value.length)).replace("{total}", String(F.value))), 1)) : K("", !0)
|
|
399
|
+
]),
|
|
400
|
+
a("ul", null, [
|
|
401
|
+
(v(!0), g(U, null, Y(G.value, ({ diagnostic: C, target: re }, X) => (v(), g("li", {
|
|
402
|
+
key: `${f.value}:${X}`
|
|
403
|
+
}, [
|
|
404
|
+
S(re) ? (v(), g("button", {
|
|
405
|
+
key: 0,
|
|
406
|
+
type: "button",
|
|
407
|
+
"aria-label": `${d.value.locateSource} · ${C.sheet} ${C.cell || C.range || ""}`,
|
|
408
|
+
onClick: (oe) => I(re)
|
|
409
|
+
}, [
|
|
410
|
+
a("span", null, [
|
|
411
|
+
a("strong", null, [
|
|
412
|
+
N(o(C.sheet), 1),
|
|
413
|
+
C.cell || C.range ? (v(), g(U, { key: 0 }, [
|
|
414
|
+
N(" · " + o(C.cell || C.range), 1)
|
|
415
|
+
], 64)) : K("", !0)
|
|
416
|
+
]),
|
|
417
|
+
a("span", null, o(C.message), 1)
|
|
418
|
+
]),
|
|
419
|
+
B(L, {
|
|
420
|
+
name: "arrow-right",
|
|
421
|
+
size: 12
|
|
422
|
+
})
|
|
423
|
+
], 8, ya)) : (v(), g("span", pa, [
|
|
424
|
+
C.sheet || C.part ? (v(), g("strong", wa, [
|
|
425
|
+
N(o(C.sheet || C.part), 1),
|
|
426
|
+
C.cell || C.range ? (v(), g(U, { key: 0 }, [
|
|
427
|
+
N(" · " + o(C.cell || C.range), 1)
|
|
428
|
+
], 64)) : K("", !0)
|
|
429
|
+
])) : K("", !0),
|
|
430
|
+
a("span", null, o(C.message), 1)
|
|
431
|
+
]))
|
|
432
|
+
]))), 128))
|
|
433
|
+
]),
|
|
434
|
+
$.value > 1 ? (v(), g("nav", {
|
|
435
|
+
key: 0,
|
|
436
|
+
"aria-label": d.value.inspectWarning
|
|
437
|
+
}, [
|
|
438
|
+
a("button", {
|
|
439
|
+
type: "button",
|
|
440
|
+
disabled: f.value === 0,
|
|
441
|
+
"aria-label": d.value.previousIssues,
|
|
442
|
+
onClick: D[0] || (D[0] = (C) => f.value--)
|
|
443
|
+
}, [
|
|
444
|
+
B(L, {
|
|
445
|
+
name: "chevron-left",
|
|
446
|
+
size: 12
|
|
447
|
+
})
|
|
448
|
+
], 8, $a),
|
|
449
|
+
a("span", null, o(f.value + 1) + "/" + o($.value), 1),
|
|
450
|
+
a("button", {
|
|
451
|
+
type: "button",
|
|
452
|
+
disabled: f.value + 1 >= $.value,
|
|
453
|
+
"aria-label": d.value.nextIssues,
|
|
454
|
+
onClick: D[1] || (D[1] = (C) => f.value++)
|
|
455
|
+
}, [
|
|
456
|
+
B(L, {
|
|
457
|
+
name: "chevron-right",
|
|
458
|
+
size: 12
|
|
459
|
+
})
|
|
460
|
+
], 8, xa)
|
|
461
|
+
], 8, ka)) : K("", !0)
|
|
462
|
+
])) : K("", !0);
|
|
463
|
+
}
|
|
464
|
+
}), Ra = /* @__PURE__ */ ct(Ca, [["__scopeId", "data-v-12fad748"]]);
|
|
465
|
+
function He(t = "") {
|
|
466
|
+
return { version: "2.0", sheet: t, regions: [] };
|
|
467
|
+
}
|
|
468
|
+
function Ia(t, k, u, b) {
|
|
469
|
+
const d = E(He()), f = E(""), c = E(), x = E(), $ = E(), F = M(() => !t.value || !x.value || !$.value ? "" : vt(t.value, k.value, x.value, $.value)), G = M(() => ({ ...d.value, regions: d.value.regions.map((h) => ({ ...h, fields: [] })) })), S = M(() => t.value ? gt(t.value, G.value) : []), I = M(() => {
|
|
470
|
+
const h = ft(d.value, b()), p = [...S.value, ...h.issues];
|
|
471
|
+
return { ...h, ok: !p.length, issues: p };
|
|
472
|
+
}), l = M(() => d.value.regions.find((h) => h.id === f.value));
|
|
473
|
+
function D(h) {
|
|
474
|
+
return Ve(h, d.value, b());
|
|
475
|
+
}
|
|
476
|
+
const C = M(() => {
|
|
477
|
+
const h = /* @__PURE__ */ new Map();
|
|
478
|
+
for (const p of I.value.issues) {
|
|
479
|
+
const W = D(p);
|
|
480
|
+
for (const w of It(p, d.value, b())) {
|
|
481
|
+
const J = h.get(w) ?? [];
|
|
482
|
+
J.push({ issue: p, target: { ...W, regionId: w } }), h.set(w, J);
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return d.value.regions.map((p) => {
|
|
486
|
+
const W = h.get(p.id) ?? [], w = W.length ? W.every((J) => St(J.issue, J.target, p)) ? "pending" : "error" : "ready";
|
|
487
|
+
return { region: p, state: w, issues: W };
|
|
488
|
+
});
|
|
489
|
+
});
|
|
490
|
+
function re(h = He(k.value)) {
|
|
491
|
+
d.value = JSON.parse(JSON.stringify(h)), f.value = d.value.regions[0]?.id ?? "", x.value = void 0, $.value = void 0, c.value = void 0;
|
|
492
|
+
}
|
|
493
|
+
function X(h) {
|
|
494
|
+
h.regionId && (f.value = h.regionId);
|
|
495
|
+
const p = xe(h);
|
|
496
|
+
p && (x.value = { row: p.top, column: p.left }, $.value = { row: p.bottom, column: p.right }), c.value = { target: h, sequence: (c.value?.sequence ?? 0) + 1 };
|
|
497
|
+
}
|
|
498
|
+
function oe(h) {
|
|
499
|
+
X(D(h));
|
|
500
|
+
}
|
|
501
|
+
function Z(h, p, W) {
|
|
502
|
+
u.value || ((!W || !x.value) && (x.value = { row: h, column: p }), $.value = { row: h, column: p });
|
|
503
|
+
}
|
|
504
|
+
function r() {
|
|
505
|
+
if (u.value || !F.value || d.value.regions.length >= 128) return;
|
|
506
|
+
let h = 1;
|
|
507
|
+
for (; d.value.regions.some((w) => w.id === `region-${h}`); ) h++;
|
|
508
|
+
const p = `region-${h}`, W = Math.abs($.value.column - x.value.column) + 1;
|
|
509
|
+
d.value.regions.push({ id: p, range: F.value, mode: "repeat", dataset: "", fields: Array.from({ length: W }, () => ""), rowKey: "" }), f.value = p;
|
|
510
|
+
}
|
|
511
|
+
function P(h) {
|
|
512
|
+
u.value || (d.value.regions = d.value.regions.filter((p) => p.id !== h), f.value === h && (f.value = d.value.regions[0]?.id ?? ""));
|
|
513
|
+
}
|
|
514
|
+
function ee(h) {
|
|
515
|
+
!u.value && l.value && (l.value.dataset = h, l.value.rowKey = "", l.value.fields.fill(""), delete l.value.revisionField, delete l.value.sourceTokenField);
|
|
516
|
+
}
|
|
517
|
+
function q(h, p) {
|
|
518
|
+
if (!(u.value || !l.value)) {
|
|
519
|
+
if (h === "mode") {
|
|
520
|
+
(p === "record" || p === "repeat") && (l.value.mode = p);
|
|
521
|
+
return;
|
|
522
|
+
}
|
|
523
|
+
p || h === "rowKey" ? l.value[h] = p : delete l.value[h];
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
function H(h, p) {
|
|
527
|
+
!u.value && l.value && h >= 0 && h < l.value.fields.length && (l.value.fields[h] = p);
|
|
528
|
+
}
|
|
529
|
+
function z() {
|
|
530
|
+
!u.value && l.value && delete l.value.headerRange;
|
|
531
|
+
}
|
|
532
|
+
function j() {
|
|
533
|
+
!u.value && l.value && F.value && (l.value.headerRange = F.value);
|
|
534
|
+
}
|
|
535
|
+
function _() {
|
|
536
|
+
!u.value && F.value && (d.value.footerRange = F.value);
|
|
537
|
+
}
|
|
538
|
+
function ie() {
|
|
539
|
+
u.value || delete d.value.footerRange;
|
|
540
|
+
}
|
|
541
|
+
function V(h) {
|
|
542
|
+
const p = d.value.regions.find((W) => W.id === h);
|
|
543
|
+
p && X({ regionId: h, control: "range", range: p.range });
|
|
544
|
+
}
|
|
545
|
+
function te(h, p) {
|
|
546
|
+
return !!x.value && !!$.value && h >= Math.min(x.value.row, $.value.row) && h <= Math.max(x.value.row, $.value.row) && p >= Math.min(x.value.column, $.value.column) && p <= Math.max(x.value.column, $.value.column);
|
|
547
|
+
}
|
|
548
|
+
return { recipe: d, activeId: f, active: l, selection: F, validation: I, directory: C, focusTarget: c, target: D, locate: oe, reset: re, select: Z, add: r, remove: P, dataset: ee, property: q, mapping: H, header: j, clearHeader: z, footer: _, clearFooter: ie, setActive: V, selected: te };
|
|
549
|
+
}
|
|
550
|
+
function ke(t = "", k = 0) {
|
|
551
|
+
return {
|
|
552
|
+
version: "1.0",
|
|
553
|
+
sheet: t,
|
|
554
|
+
dataset: "",
|
|
555
|
+
regions: { header: "", detail: "" },
|
|
556
|
+
fields: Array.from({ length: k }, () => ""),
|
|
557
|
+
rowKey: ""
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
function Me(t) {
|
|
561
|
+
return t instanceof Error ? t.message : String(t);
|
|
562
|
+
}
|
|
563
|
+
function Ma(t, k) {
|
|
564
|
+
const u = ot(), b = E(ke()), d = E("table"), f = Ia(u, M(() => b.value.sheet), M(() => J.value), () => t.datasets), c = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map(), $ = E({ table: [], regions: [] });
|
|
565
|
+
function F() {
|
|
566
|
+
c.clear(), x.clear(), $.value = { table: [], regions: [] };
|
|
567
|
+
}
|
|
568
|
+
function G() {
|
|
569
|
+
b.value.sheet && (c.set(b.value.sheet, S(b.value)), x.set(b.value.sheet, JSON.parse(JSON.stringify(f.recipe.value))), $.value = { table: [...c.values()], regions: [...x.values()] });
|
|
570
|
+
}
|
|
571
|
+
const S = (i) => JSON.parse(JSON.stringify(i));
|
|
572
|
+
function I(i, m) {
|
|
573
|
+
return S(c.get(i) ?? ke(i, m));
|
|
574
|
+
}
|
|
575
|
+
const l = E({
|
|
576
|
+
id: t.identity?.id ?? "excel-template",
|
|
577
|
+
name: t.identity?.name ?? "Excel 业务模板"
|
|
578
|
+
}), D = E(""), C = E(!1), re = () => ({ recipe: b.value, regions: f.recipe.value, mode: d.value, cached: $.value, identity: l.value });
|
|
579
|
+
let X;
|
|
580
|
+
function oe(i) {
|
|
581
|
+
b.value = S(i.recipe), f.reset(i.regions), d.value = i.mode, l.value = { ...i.identity, ...t.lockId && t.identity ? { id: t.identity.id } : {} }, F();
|
|
582
|
+
for (const m of i.cached.table) c.set(m.sheet, m);
|
|
583
|
+
for (const m of i.cached.regions) x.set(m.sheet, m);
|
|
584
|
+
$.value = i.cached;
|
|
585
|
+
}
|
|
586
|
+
const Z = E(0), r = Rt(() => ({ source: Z.value, recipe: b.value, mode: d.value, regions: f.recipe.value, cached: $.value, identity: l.value })), P = E([]);
|
|
587
|
+
let ee;
|
|
588
|
+
function q() {
|
|
589
|
+
ee?.dispose(), ee = void 0;
|
|
590
|
+
}
|
|
591
|
+
const H = E(""), z = E(!1), j = E(!1), _ = E(!1), ie = E(!1), V = E(1), te = E(1), h = E(), p = E(), W = E(0), w = M(() => ({ ...Le, ...t.messages })), J = M(() => !!t.readonly || z.value || ie.value), le = M(() => !z.value && !ie.value), ve = M(
|
|
592
|
+
() => u.value?.sheets.find((i) => i.name === b.value.sheet)
|
|
593
|
+
), O = M(
|
|
594
|
+
() => ve.value ? be(ve.value.range) : void 0
|
|
595
|
+
), me = M(
|
|
596
|
+
() => t.datasets.find((i) => i.id === b.value.dataset)
|
|
597
|
+
), ge = M(
|
|
598
|
+
() => u.value && ve.value ? bt(u.value, ve.value.name, {
|
|
599
|
+
row: V.value,
|
|
600
|
+
column: te.value
|
|
601
|
+
}) : void 0
|
|
602
|
+
), Ke = M(
|
|
603
|
+
() => u.value ? mt(u.value, b.value) : []
|
|
604
|
+
), Fe = M(() => {
|
|
605
|
+
if (!u.value) return { ok: !1, issues: [], mapped: 0, total: 0 };
|
|
606
|
+
const i = ht(
|
|
607
|
+
u.value,
|
|
608
|
+
b.value,
|
|
609
|
+
t.datasets
|
|
610
|
+
), m = [...Ke.value, ...i.issues];
|
|
611
|
+
return { ...i, ok: m.length === 0, issues: m };
|
|
612
|
+
}), ue = M(() => d.value === "regions" ? f.validation.value : Fe.value), ye = E(), Ce = M(() => d.value === "regions" ? f.focusTarget.value : ye.value);
|
|
613
|
+
function pe(i) {
|
|
614
|
+
return d.value === "regions" ? f.target(i) : Mt(i, b.value);
|
|
615
|
+
}
|
|
616
|
+
function Re(i) {
|
|
617
|
+
const m = { dataset: w.value.dataset, contract: w.value.dataContract, rowKey: w.value.rowKey, range: w.value.regionCoordinates, field: w.value.mapping, fields: w.value.mapping, footer: w.value.flowFooter, header: w.value.headerRegion, detail: w.value.detailRegion, title: w.value.titleRegion, sheet: w.value.sheet, regions: d.value === "regions" ? w.value.multiRegions : w.value.regionLegend, revisionField: w.value.revisionField, sourceTokenField: w.value.sourceTokenField }, T = xe(i), A = i.fieldIndex === void 0 ? "" : ` ${ze(T?.left ?? i.fieldIndex + 1)}`;
|
|
618
|
+
return `${i.regionId ? `${i.regionId} · ` : ""}${m[i.control] ?? w.value.regionCoordinates}${A}`;
|
|
619
|
+
}
|
|
620
|
+
const y = M(() => ue.value.issues.map((i) => ({
|
|
621
|
+
issue: i,
|
|
622
|
+
label: Re(pe(i)),
|
|
623
|
+
message: i.message.replace(/\$\.recipe\.regions\[(\d+)\]/g, (m, T) => f.recipe.value.regions[Number(T)]?.id ?? w.value.regionProperties)
|
|
624
|
+
})));
|
|
625
|
+
function s(i) {
|
|
626
|
+
return i ? { dataset: w.value.nextDataset, rowKey: w.value.nextRowKey, field: w.value.nextField, fields: w.value.nextField, range: w.value.nextRange, regions: w.value.nextRegion, footer: w.value.nextFooter, header: w.value.nextHeader, detail: w.value.nextHeader, title: w.value.nextHeader }[i.control] ?? w.value.nextContract : d.value === "regions" ? w.value.nextRegion : w.value.nextHeader;
|
|
627
|
+
}
|
|
628
|
+
const n = M(() => t.readonly ? w.value.readonly : z.value ? w.value.loading : ie.value ? w.value.applying : _.value ? w.value.applied : ue.value.ok ? w.value.ready : s(ue.value.issues[0] ? pe(ue.value.issues[0]) : void 0));
|
|
629
|
+
ne(Ce, (i) => {
|
|
630
|
+
const m = i && xe(i.target);
|
|
631
|
+
!m || !O.value || (V.value = Math.max(O.value.top, Math.min(O.value.bottom, m.top)), te.value = Math.max(O.value.left, Math.min(O.value.right, m.left)));
|
|
632
|
+
});
|
|
633
|
+
function R(i) {
|
|
634
|
+
if (d.value === "regions") {
|
|
635
|
+
f.locate(i);
|
|
636
|
+
return;
|
|
637
|
+
}
|
|
638
|
+
const m = pe(i), T = xe(m);
|
|
639
|
+
T && (h.value = T.top, p.value = T.bottom), m.fieldIndex !== void 0 && (W.value = Math.floor(m.fieldIndex / 12)), ye.value = { target: m, sequence: (ye.value?.sequence ?? 0) + 1 };
|
|
640
|
+
}
|
|
641
|
+
const Q = M(
|
|
642
|
+
() => b.value.fields.slice(W.value * 12, (W.value + 1) * 12).map((i, m) => ({
|
|
643
|
+
index: W.value * 12 + m,
|
|
644
|
+
field: i,
|
|
645
|
+
physical: ze(
|
|
646
|
+
(O.value?.left ?? 1) + W.value * 12 + m
|
|
647
|
+
)
|
|
648
|
+
}))
|
|
649
|
+
), Ie = M(
|
|
650
|
+
() => me.value?.fields.filter((i) => i.type !== "boolean") ?? []
|
|
651
|
+
), fe = M(
|
|
652
|
+
() => h.value !== void 0 && p.value !== void 0 ? {
|
|
653
|
+
top: Math.min(h.value, p.value),
|
|
654
|
+
bottom: Math.max(h.value, p.value)
|
|
655
|
+
} : void 0
|
|
656
|
+
);
|
|
657
|
+
let se, ae = 0;
|
|
658
|
+
function de() {
|
|
659
|
+
ae++, se?.abort(), se = void 0, z.value = !1;
|
|
660
|
+
}
|
|
661
|
+
function we() {
|
|
662
|
+
V.value = O.value?.top ?? 1, te.value = O.value?.left ?? 1, h.value = void 0, p.value = void 0, W.value = 0, j.value = !1, _.value = !1;
|
|
663
|
+
}
|
|
664
|
+
function Ne(i) {
|
|
665
|
+
de();
|
|
666
|
+
try {
|
|
667
|
+
const m = i.version === "2.0" ? yt(i) : pt(i);
|
|
668
|
+
de(), q(), P.value = m.source.sheets.map((T) => ({
|
|
669
|
+
name: T.name,
|
|
670
|
+
index: T.index
|
|
671
|
+
})), u.value = m.source, F(), m.version === "2.0" ? (b.value = ke(m.recipe.sheet, m.source.sheets.find((T) => T.name === m.recipe.sheet).columnCount), f.reset(m.recipe), d.value = "regions") : (b.value = m.recipe, f.reset(), d.value = "table"), l.value = { ...m.identity, ...t.lockId && t.identity ? { id: t.identity.id } : {} }, D.value = m.recipe.sheet, H.value = "", we(), Z.value++, r.accept();
|
|
672
|
+
} catch (m) {
|
|
673
|
+
H.value = Me(m);
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
ne(
|
|
677
|
+
() => t.session,
|
|
678
|
+
(i) => {
|
|
679
|
+
i && Ne(i);
|
|
680
|
+
},
|
|
681
|
+
{ immediate: !0 }
|
|
682
|
+
), ne(
|
|
683
|
+
() => t.readonly,
|
|
684
|
+
(i) => {
|
|
685
|
+
i && (de(), q());
|
|
686
|
+
}
|
|
687
|
+
), ne(
|
|
688
|
+
[b, l, d, f.recipe],
|
|
689
|
+
() => {
|
|
690
|
+
j.value = !1, _.value = !1;
|
|
691
|
+
},
|
|
692
|
+
{ deep: !0, flush: "sync" }
|
|
693
|
+
), ne(
|
|
694
|
+
() => t.datasets,
|
|
695
|
+
() => {
|
|
696
|
+
j.value = !1, _.value = !1;
|
|
697
|
+
}
|
|
698
|
+
), it(() => {
|
|
699
|
+
de(), q();
|
|
700
|
+
});
|
|
701
|
+
async function Je(i) {
|
|
702
|
+
if (t.readonly) return;
|
|
703
|
+
if (de(), !/\.xlsx$/i.test(i.name)) {
|
|
704
|
+
H.value = w.value.invalidFile;
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
707
|
+
const m = ++ae;
|
|
708
|
+
se = new AbortController(), z.value = !0, H.value = "";
|
|
709
|
+
let T;
|
|
710
|
+
try {
|
|
711
|
+
const { openExcelWorkbook: A } = await import("./workbook-session-DRnMjIFK.js").then((ce) => ce.w);
|
|
712
|
+
if (m !== ae || t.readonly || (T = await A(i, { ...t.importOptions, signal: se.signal }), m !== ae || t.readonly)) return;
|
|
713
|
+
const he = T.inspect().sheets.filter((ce) => ce.visible);
|
|
714
|
+
if (!he.length) throw new Error("Excel 中没有可导入的可见工作表");
|
|
715
|
+
const Ae = X?.recipe.sheet || he[0].name;
|
|
716
|
+
if (!he.some((ce) => ce.name === Ae)) throw new Error(w.value.recoveredSheetMissing);
|
|
717
|
+
const Ee = await T.importTemplate({ sheets: [Ae], signal: se.signal });
|
|
718
|
+
if (m !== ae || t.readonly) return;
|
|
719
|
+
q(), ee = T, T = void 0, u.value = Ee, Z.value++, D.value = i.name, P.value = he.map((ce) => ({
|
|
720
|
+
name: ce.name,
|
|
721
|
+
index: ce.index
|
|
722
|
+
})), F(), b.value = ke(
|
|
723
|
+
Ee.sheets[0].name,
|
|
724
|
+
Ee.sheets[0].columnCount
|
|
725
|
+
), f.reset(), X && (oe(X), X = void 0, C.value = !1), we();
|
|
726
|
+
} catch (A) {
|
|
727
|
+
m === ae && (H.value = Me(A));
|
|
728
|
+
} finally {
|
|
729
|
+
T?.dispose(), m === ae && (z.value = !1, se = void 0);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
async function je(i) {
|
|
733
|
+
if (J.value || !P.value.some((A) => A.name === i) || b.value.sheet === i)
|
|
734
|
+
return;
|
|
735
|
+
G();
|
|
736
|
+
const m = u.value?.sheets.find((A) => A.name === i);
|
|
737
|
+
if (m) {
|
|
738
|
+
b.value = I(i, m.columnCount), f.reset(x.get(i)), H.value = "", we();
|
|
739
|
+
return;
|
|
740
|
+
}
|
|
741
|
+
if (!ee || ee.disposed) return;
|
|
742
|
+
de();
|
|
743
|
+
const T = ++ae;
|
|
744
|
+
se = new AbortController(), z.value = !0, H.value = "";
|
|
745
|
+
try {
|
|
746
|
+
const A = await ee.importTemplate({ sheets: [i], signal: se.signal });
|
|
747
|
+
if (T !== ae || t.readonly) return;
|
|
748
|
+
u.value = A, b.value = I(i, A.sheets[0].columnCount), f.reset(x.get(i)), we();
|
|
749
|
+
} catch (A) {
|
|
750
|
+
T === ae && (H.value = Me(A));
|
|
751
|
+
} finally {
|
|
752
|
+
T === ae && (z.value = !1, se = void 0);
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
function Ge(i) {
|
|
756
|
+
J.value || (b.value.dataset = i, b.value.rowKey = "", b.value.fields.fill(""), j.value = !1, _.value = !1);
|
|
757
|
+
}
|
|
758
|
+
function Ue(i, m) {
|
|
759
|
+
J.value || !O.value || i < O.value.top || i > O.value.bottom || ((!m || h.value === void 0) && (h.value = i), p.value = i);
|
|
760
|
+
}
|
|
761
|
+
function Xe(i) {
|
|
762
|
+
if (J.value || !u.value || !fe.value) {
|
|
763
|
+
J.value || (H.value = w.value.emptySelection);
|
|
764
|
+
return;
|
|
765
|
+
}
|
|
766
|
+
b.value.regions[i] = Ct(
|
|
767
|
+
u.value,
|
|
768
|
+
b.value.sheet,
|
|
769
|
+
fe.value.top,
|
|
770
|
+
fe.value.bottom
|
|
771
|
+
), j.value = !1, _.value = !1, H.value = "";
|
|
772
|
+
}
|
|
773
|
+
function _e(i) {
|
|
774
|
+
J.value || (delete b.value.regions[i], j.value = !1, _.value = !1);
|
|
775
|
+
}
|
|
776
|
+
function Qe(i, m) {
|
|
777
|
+
!J.value && i >= 0 && i < b.value.fields.length && (b.value.fields[i] = m, j.value = !1, _.value = !1);
|
|
778
|
+
}
|
|
779
|
+
function Ye(i) {
|
|
780
|
+
J.value || (b.value.rowKey = i);
|
|
781
|
+
}
|
|
782
|
+
function Ze(i, m) {
|
|
783
|
+
!J.value && !(i === "id" && t.lockId) && (l.value[i] = m);
|
|
784
|
+
}
|
|
785
|
+
function et(i) {
|
|
786
|
+
for (const m of ["title", "header", "detail", "footer"]) {
|
|
787
|
+
const T = b.value.regions[m];
|
|
788
|
+
if (!T) continue;
|
|
789
|
+
const A = be(T);
|
|
790
|
+
if (i >= A.top && i <= A.bottom) return m;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
function tt(i, m) {
|
|
794
|
+
O.value && (i === "row" ? V.value = Math.max(
|
|
795
|
+
O.value.top,
|
|
796
|
+
Math.min(O.value.bottom, V.value + m)
|
|
797
|
+
) : te.value = Math.max(
|
|
798
|
+
O.value.left,
|
|
799
|
+
Math.min(O.value.right, te.value + m)
|
|
800
|
+
));
|
|
801
|
+
}
|
|
802
|
+
function at() {
|
|
803
|
+
if (!t.readonly) {
|
|
804
|
+
if (t.session) {
|
|
805
|
+
Ne(t.session);
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
X = void 0, C.value = !1, de(), q(), u.value = void 0, P.value = [], D.value = "", F(), b.value = ke(), l.value = { id: t.identity?.id ?? "excel-template", name: t.identity?.name ?? "Excel 业务模板" }, f.reset(), d.value = "table", we(), Z.value++, r.accept(), H.value = "";
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
function nt() {
|
|
812
|
+
le.value && (j.value = !0, H.value = "");
|
|
813
|
+
}
|
|
814
|
+
async function lt() {
|
|
815
|
+
if (!(J.value || !u.value || C.value) && (j.value = !0, H.value = "", !!ue.value.ok)) {
|
|
816
|
+
ie.value = !0;
|
|
817
|
+
try {
|
|
818
|
+
const i = { ...l.value, ...t.lockId && t.identity ? { id: t.identity.id } : {} }, m = d.value === "regions" ? wt(u.value, f.recipe.value, t.datasets, i) : kt(u.value, b.value, t.datasets, i), T = d.value === "regions" ? $t(u.value, f.recipe.value, i) : xt(u.value, b.value, i), A = { ...m, session: T }, he = r.snapshot();
|
|
819
|
+
if (t.accept && !await t.accept(A) || t.readonly || he !== r.snapshot() && r.pending.value) return;
|
|
820
|
+
t.accept || k(A), F(), r.accept(), _.value = !0;
|
|
821
|
+
} catch (i) {
|
|
822
|
+
H.value = Me(i);
|
|
823
|
+
} finally {
|
|
824
|
+
ie.value = !1;
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
return ut({ key: () => "excel", baseline: () => "declarations-only", pending: () => r.pending.value || C.value, snapshot: () => JSON.stringify(re()), restore(i, m, T) {
|
|
829
|
+
const A = JSON.parse(i);
|
|
830
|
+
if (!A.recipe || !A.regions || !Array.isArray(A.cached?.table) || !Array.isArray(A.cached?.regions)) throw new Error("Invalid Excel mapping draft");
|
|
831
|
+
oe(A), C.value = T?.pending !== !1, X = C.value ? A : void 0, C.value || r.accept();
|
|
832
|
+
} }), {
|
|
833
|
+
recoveredMapping: C,
|
|
834
|
+
imported: u,
|
|
835
|
+
mode: d,
|
|
836
|
+
regionBindings: f,
|
|
837
|
+
pendingLocalChanges: M(() => r.pending.value || C.value),
|
|
838
|
+
recipe: b,
|
|
839
|
+
identity: l,
|
|
840
|
+
sourceName: D,
|
|
841
|
+
sheetChoices: P,
|
|
842
|
+
error: H,
|
|
843
|
+
loading: z,
|
|
844
|
+
checked: j,
|
|
845
|
+
applied: _,
|
|
846
|
+
row: V,
|
|
847
|
+
column: te,
|
|
848
|
+
mappingPage: W,
|
|
849
|
+
m: w,
|
|
850
|
+
disabled: J,
|
|
851
|
+
canCheck: le,
|
|
852
|
+
sheet: ve,
|
|
853
|
+
sourceRange: O,
|
|
854
|
+
dataset: me,
|
|
855
|
+
window: ge,
|
|
856
|
+
validation: ue,
|
|
857
|
+
focusTarget: Ce,
|
|
858
|
+
issueEntries: y,
|
|
859
|
+
guidance: n,
|
|
860
|
+
locateIssue: R,
|
|
861
|
+
mappings: Q,
|
|
862
|
+
rowKeys: Ie,
|
|
863
|
+
selection: fe,
|
|
864
|
+
cancel: de,
|
|
865
|
+
importFile: Je,
|
|
866
|
+
chooseSheet: je,
|
|
867
|
+
chooseDataset: Ge,
|
|
868
|
+
chooseRow: Ue,
|
|
869
|
+
markRegion: Xe,
|
|
870
|
+
clearRegion: _e,
|
|
871
|
+
setMapping: Qe,
|
|
872
|
+
setRowKey: Ye,
|
|
873
|
+
setIdentity: Ze,
|
|
874
|
+
regionAt: et,
|
|
875
|
+
moveWindow: tt,
|
|
876
|
+
check: nt,
|
|
877
|
+
restoreDraft: at,
|
|
878
|
+
apply: lt
|
|
879
|
+
};
|
|
880
|
+
}
|
|
881
|
+
const Sa = ["aria-label", "aria-busy"], Ka = {
|
|
882
|
+
key: 0,
|
|
883
|
+
role: "status",
|
|
884
|
+
class: "mr-binding-recovery"
|
|
885
|
+
}, Fa = { class: "mr-binding-bar" }, Ea = { class: "mr-binding-heading" }, Da = ["aria-label", "disabled"], Ta = ["disabled"], za = {
|
|
886
|
+
key: 1,
|
|
887
|
+
class: "mr-binding-error",
|
|
888
|
+
role: "alert"
|
|
889
|
+
}, Ba = {
|
|
890
|
+
key: 2,
|
|
891
|
+
class: "mr-binding-placeholder",
|
|
892
|
+
role: "status"
|
|
893
|
+
}, Na = {
|
|
894
|
+
key: 3,
|
|
895
|
+
class: "mr-binding-placeholder"
|
|
896
|
+
}, Aa = ["disabled"], Wa = { class: "mr-binding-sourcebar" }, Pa = ["value", "aria-label", "disabled"], Ha = ["value"], La = ["aria-label"], Oa = ["aria-pressed", "disabled"], qa = ["aria-pressed", "disabled"], Va = { class: "mr-binding-range" }, Ja = { class: "mr-binding-sample-note" }, ja = { class: "mr-binding-layout" }, Ga = { class: "mr-binding-source" }, Ua = { class: "mr-binding-grid-heading" }, Xa = ["aria-label"], _a = { class: "mr-binding-grid" }, Qa = ["data-region"], Ya = { scope: "row" }, Za = ["data-source-row", "aria-label", "aria-pressed", "disabled", "onPointerdown", "onPointerenter", "onKeydown"], en = ["rowspan", "colspan", "title", "data-source-cell", "tabindex", "aria-label", "aria-selected", "onPointerdown", "onPointerenter", "onKeydown"], tn = {
|
|
897
|
+
key: 1,
|
|
898
|
+
class: "mr-binding-grid-footer"
|
|
899
|
+
}, an = { class: "mr-binding-window" }, nn = ["aria-label", "disabled"], ln = ["min", "max", "value", "aria-label"], on = ["aria-label", "disabled"], sn = { class: "mr-binding-window" }, rn = ["aria-label", "disabled"], un = ["min", "max", "value", "aria-label"], dn = ["aria-label", "disabled"], cn = { class: "mr-binding-inspector" }, vn = ["disabled"], gn = { class: "mr-binding-group" }, fn = ["data-role"], bn = { key: 0 }, mn = ["aria-label", "data-binding-control", "title", "disabled", "onClick"], hn = ["aria-label", "onClick"], yn = {
|
|
900
|
+
key: 0,
|
|
901
|
+
class: "mr-binding-note"
|
|
902
|
+
}, pn = { class: "mr-binding-group" }, wn = {
|
|
903
|
+
class: "mr-binding-label",
|
|
904
|
+
tabindex: "-1"
|
|
905
|
+
}, kn = ["value", "aria-label"], $n = { value: "" }, xn = ["value"], Cn = {
|
|
906
|
+
key: 0,
|
|
907
|
+
class: "mr-binding-note"
|
|
908
|
+
}, Rn = {
|
|
909
|
+
key: 1,
|
|
910
|
+
class: "mr-binding-label",
|
|
911
|
+
tabindex: "-1"
|
|
912
|
+
}, In = {
|
|
913
|
+
key: 2,
|
|
914
|
+
class: "mr-binding-mappings"
|
|
915
|
+
}, Mn = { key: 0 }, Sn = {
|
|
916
|
+
key: 3,
|
|
917
|
+
class: "mr-binding-map-pages"
|
|
918
|
+
}, Kn = ["disabled", "aria-label"], Fn = ["disabled", "aria-label"], En = ["disabled"], Dn = { class: "mr-binding-group" }, Tn = { class: "mr-binding-label" }, zn = ["value", "readonly"], Bn = { class: "mr-binding-label" }, Nn = ["value"], An = {
|
|
919
|
+
key: 0,
|
|
920
|
+
class: "mr-binding-issues",
|
|
921
|
+
open: ""
|
|
922
|
+
}, Wn = ["aria-label", "onClick"], Pn = {
|
|
923
|
+
key: 0,
|
|
924
|
+
class: "mr-binding-issue-pages"
|
|
925
|
+
}, Hn = ["disabled", "aria-label"], Ln = ["disabled", "aria-label"], On = {
|
|
926
|
+
key: 2,
|
|
927
|
+
class: "mr-binding-warnings"
|
|
928
|
+
}, qn = { class: "mr-binding-actions" }, Vn = ["title"], Jn = ["disabled"], jn = ["disabled"], Gn = ["disabled", "title"], el = /* @__PURE__ */ Be({
|
|
929
|
+
__name: "ExcelBindingWizard",
|
|
930
|
+
props: {
|
|
931
|
+
datasets: {},
|
|
932
|
+
accept: { type: Function },
|
|
933
|
+
session: {},
|
|
934
|
+
identity: {},
|
|
935
|
+
lockId: { type: Boolean },
|
|
936
|
+
readonly: { type: Boolean },
|
|
937
|
+
importOptions: {},
|
|
938
|
+
messages: {}
|
|
939
|
+
},
|
|
940
|
+
emits: ["apply", "dirty"],
|
|
941
|
+
setup(t, { expose: k, emit: u }) {
|
|
942
|
+
const b = dt(), d = t, f = u, c = Ma(d, (y) => f("apply", y)), {
|
|
943
|
+
imported: x,
|
|
944
|
+
mode: $,
|
|
945
|
+
regionBindings: F,
|
|
946
|
+
recipe: G,
|
|
947
|
+
identity: S,
|
|
948
|
+
sourceName: I,
|
|
949
|
+
sheetChoices: l,
|
|
950
|
+
error: D,
|
|
951
|
+
loading: C,
|
|
952
|
+
checked: re,
|
|
953
|
+
row: X,
|
|
954
|
+
column: oe,
|
|
955
|
+
mappingPage: Z,
|
|
956
|
+
m: r,
|
|
957
|
+
disabled: P,
|
|
958
|
+
sheet: ee,
|
|
959
|
+
sourceRange: q,
|
|
960
|
+
dataset: H,
|
|
961
|
+
window: z,
|
|
962
|
+
validation: j,
|
|
963
|
+
mappings: _,
|
|
964
|
+
rowKeys: ie,
|
|
965
|
+
selection: V
|
|
966
|
+
} = c;
|
|
967
|
+
ne([c.pendingLocalChanges, G, S], () => f("dirty", c.pendingLocalChanges.value), { immediate: !0, deep: !0, flush: "sync" });
|
|
968
|
+
const te = E(), h = E(), p = E(0), W = M(() => Math.max(1, Math.ceil(c.issueEntries.value.length / 12))), w = M(() => c.issueEntries.value.slice(p.value * 12, (p.value + 1) * 12));
|
|
969
|
+
async function J(y) {
|
|
970
|
+
if (await c.chooseSheet(y.sheet), G.value.sheet !== y.sheet) return;
|
|
971
|
+
X.value = y.row, oe.value = y.column, await De();
|
|
972
|
+
const s = h.value?.querySelector(`td[data-source-cell="${y.row}:${y.column}"]`);
|
|
973
|
+
s?.focus(), s?.scrollIntoView?.({ block: "nearest", inline: "nearest" }), Te(s);
|
|
974
|
+
}
|
|
975
|
+
ne(W, (y) => {
|
|
976
|
+
p.value = Math.min(p.value, y - 1);
|
|
977
|
+
}), ne(c.focusTarget, async (y) => {
|
|
978
|
+
if (!y) return;
|
|
979
|
+
await De();
|
|
980
|
+
const s = xe(y.target);
|
|
981
|
+
if (s && h.value?.querySelector(`td[data-source-cell="${s.top}:${s.left}"]`)?.scrollIntoView?.({ block: "nearest", inline: "nearest" }), $.value === "regions") return;
|
|
982
|
+
const n = y.target.control === "field" ? `field-${y.target.fieldIndex}` : y.target.control === "contract" ? "dataset" : y.target.control, R = h.value?.querySelector(`.mr-binding-table-editor [data-binding-control="${n}"]`), Q = P.value ? R?.closest("label") : R;
|
|
983
|
+
Q?.focus(), Q?.scrollIntoView?.({ block: "nearest" }), Te(Q);
|
|
984
|
+
});
|
|
985
|
+
const le = E(!1), ve = ["title", "header", "detail", "footer"], O = M(() => ({
|
|
986
|
+
title: r.value.titleRegion,
|
|
987
|
+
header: r.value.headerRegion,
|
|
988
|
+
detail: r.value.detailRegion,
|
|
989
|
+
footer: r.value.footerRegion
|
|
990
|
+
})), me = M(
|
|
991
|
+
() => Math.max(1, Math.ceil(G.value.fields.length / 12))
|
|
992
|
+
);
|
|
993
|
+
function ge(y) {
|
|
994
|
+
return y.target.value;
|
|
995
|
+
}
|
|
996
|
+
function Ke(y) {
|
|
997
|
+
const s = y.target, n = s.files?.[0];
|
|
998
|
+
n && c.importFile(n), s.value = "";
|
|
999
|
+
}
|
|
1000
|
+
function Fe(y, s) {
|
|
1001
|
+
y.button !== 0 || P.value || (y.preventDefault(), le.value = !0, c.chooseRow(s, y.shiftKey), $.value === "regions" && q.value && (F.select(s, q.value.left, !1), F.select(s, q.value.right, !0)), y.currentTarget.focus());
|
|
1002
|
+
}
|
|
1003
|
+
function ue(y, s, n) {
|
|
1004
|
+
$.value !== "regions" || y.button !== 0 || P.value || (y.preventDefault(), le.value = !0, F.select(s, n, y.shiftKey), y.currentTarget.focus());
|
|
1005
|
+
}
|
|
1006
|
+
function ye(y, s, n) {
|
|
1007
|
+
if ($.value !== "regions") return;
|
|
1008
|
+
(y.key === " " || y.key === "Enter") && (y.preventDefault(), F.select(s, n, y.shiftKey));
|
|
1009
|
+
const Q = { ArrowUp: [-1, 0], ArrowDown: [1, 0], ArrowLeft: [0, -1], ArrowRight: [0, 1] }[y.key];
|
|
1010
|
+
if (!Q || !q.value) return;
|
|
1011
|
+
y.preventDefault();
|
|
1012
|
+
const Ie = Math.max(q.value.top, Math.min(q.value.bottom, s + Q[0])), fe = Math.max(q.value.left, Math.min(q.value.right, n + Q[1]));
|
|
1013
|
+
y.shiftKey && F.select(Ie, fe, !0), y.currentTarget.closest("table")?.querySelector(`td[data-source-cell="${Ie}:${fe}"]`)?.focus();
|
|
1014
|
+
}
|
|
1015
|
+
function Ce(y, s) {
|
|
1016
|
+
if ((y.key === " " || y.key === "Enter") && (y.preventDefault(), c.chooseRow(s, y.shiftKey)), y.key === "ArrowDown" || y.key === "ArrowUp") {
|
|
1017
|
+
y.preventDefault();
|
|
1018
|
+
const n = s + (y.key === "ArrowDown" ? 1 : -1);
|
|
1019
|
+
y.shiftKey && c.chooseRow(n, !0), y.currentTarget.closest("table")?.querySelector(`button[data-source-row="${n}"]`)?.focus();
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
function pe(y) {
|
|
1023
|
+
const s = H.value?.fields.find((n) => n.field === y);
|
|
1024
|
+
return s ? [
|
|
1025
|
+
s.type,
|
|
1026
|
+
s.unit,
|
|
1027
|
+
s.digits === void 0 ? void 0 : `${s.digits}${r.value.precision}`,
|
|
1028
|
+
s.sample === void 0 ? void 0 : `${r.value.sample}: ${String(s.sample)}`
|
|
1029
|
+
].filter((n) => n !== void 0 && n !== "").join(" · ") : "";
|
|
1030
|
+
}
|
|
1031
|
+
function Re(y, s) {
|
|
1032
|
+
const n = Number(ge(y));
|
|
1033
|
+
!Number.isInteger(n) || !q.value || (s === "row" ? X.value = Math.max(
|
|
1034
|
+
q.value.top,
|
|
1035
|
+
Math.min(q.value.bottom, n)
|
|
1036
|
+
) : oe.value = Math.max(
|
|
1037
|
+
q.value.left,
|
|
1038
|
+
Math.min(q.value.right, n)
|
|
1039
|
+
));
|
|
1040
|
+
}
|
|
1041
|
+
return k({
|
|
1042
|
+
get pendingLocalChanges() {
|
|
1043
|
+
return c.pendingLocalChanges.value;
|
|
1044
|
+
},
|
|
1045
|
+
importFile: c.importFile,
|
|
1046
|
+
apply: c.apply,
|
|
1047
|
+
cancel: c.cancel
|
|
1048
|
+
}), (y, s) => (v(), g("section", {
|
|
1049
|
+
ref_key: "element",
|
|
1050
|
+
ref: h,
|
|
1051
|
+
class: "mr-binding",
|
|
1052
|
+
style: We(e(b)),
|
|
1053
|
+
"aria-label": e(r).title,
|
|
1054
|
+
"aria-busy": e(C),
|
|
1055
|
+
onPointerup: s[22] || (s[22] = (n) => le.value = !1),
|
|
1056
|
+
onPointercancel: s[23] || (s[23] = (n) => le.value = !1),
|
|
1057
|
+
onPointerleave: s[24] || (s[24] = (n) => le.value = !1)
|
|
1058
|
+
}, [
|
|
1059
|
+
e(c).recoveredMapping.value ? (v(), g("p", Ka, o(e(r).recoveredMapping), 1)) : K("", !0),
|
|
1060
|
+
a("header", Fa, [
|
|
1061
|
+
a("div", Ea, [
|
|
1062
|
+
B(L, {
|
|
1063
|
+
name: "file",
|
|
1064
|
+
size: 17
|
|
1065
|
+
}),
|
|
1066
|
+
a("strong", null, o(e(r).title), 1),
|
|
1067
|
+
a("span", null, o(e(I) || e(r).intro), 1)
|
|
1068
|
+
]),
|
|
1069
|
+
a("input", {
|
|
1070
|
+
ref_key: "input",
|
|
1071
|
+
ref: te,
|
|
1072
|
+
type: "file",
|
|
1073
|
+
accept: ".xlsx,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
1074
|
+
"aria-label": e(r).upload,
|
|
1075
|
+
class: "mr-binding-file",
|
|
1076
|
+
disabled: t.readonly,
|
|
1077
|
+
onChange: Ke
|
|
1078
|
+
}, null, 40, Da),
|
|
1079
|
+
e(C) ? (v(), g("button", {
|
|
1080
|
+
key: 0,
|
|
1081
|
+
type: "button",
|
|
1082
|
+
onClick: s[0] || (s[0] = //@ts-ignore
|
|
1083
|
+
(...n) => e(c).cancel && e(c).cancel(...n))
|
|
1084
|
+
}, o(e(r).cancel), 1)) : (v(), g("button", {
|
|
1085
|
+
key: 1,
|
|
1086
|
+
type: "button",
|
|
1087
|
+
disabled: t.readonly,
|
|
1088
|
+
onClick: s[1] || (s[1] = (n) => te.value?.click())
|
|
1089
|
+
}, [
|
|
1090
|
+
B(L, {
|
|
1091
|
+
name: "upload",
|
|
1092
|
+
size: 14
|
|
1093
|
+
}),
|
|
1094
|
+
N(o(e(x) ? e(r).replace : e(r).upload), 1)
|
|
1095
|
+
], 8, Ta))
|
|
1096
|
+
]),
|
|
1097
|
+
e(D) ? (v(), g("div", za, o(e(D)), 1)) : K("", !0),
|
|
1098
|
+
e(C) ? (v(), g("div", Ba, [
|
|
1099
|
+
s[25] || (s[25] = a("span", { class: "mr-binding-loader" }, null, -1)),
|
|
1100
|
+
N(o(e(r).loading), 1)
|
|
1101
|
+
])) : e(x) ? (v(), g(U, { key: 4 }, [
|
|
1102
|
+
a("div", Wa, [
|
|
1103
|
+
a("label", null, [
|
|
1104
|
+
N(o(e(r).sheet), 1),
|
|
1105
|
+
a("select", {
|
|
1106
|
+
value: e(G).sheet,
|
|
1107
|
+
"aria-label": e(r).sheet,
|
|
1108
|
+
disabled: e(P),
|
|
1109
|
+
onChange: s[3] || (s[3] = (n) => e(c).chooseSheet(ge(n)))
|
|
1110
|
+
}, [
|
|
1111
|
+
(v(!0), g(U, null, Y(e(l), (n) => (v(), g("option", {
|
|
1112
|
+
key: n.name,
|
|
1113
|
+
value: n.name
|
|
1114
|
+
}, o(n.name), 9, Ha))), 128))
|
|
1115
|
+
], 40, Pa)
|
|
1116
|
+
]),
|
|
1117
|
+
a("div", {
|
|
1118
|
+
class: "mr-binding-mode",
|
|
1119
|
+
role: "group",
|
|
1120
|
+
"aria-label": e(r).regionMode
|
|
1121
|
+
}, [
|
|
1122
|
+
a("button", {
|
|
1123
|
+
type: "button",
|
|
1124
|
+
"aria-pressed": e($) === "table",
|
|
1125
|
+
disabled: e(P),
|
|
1126
|
+
onClick: s[4] || (s[4] = (n) => $.value = "table")
|
|
1127
|
+
}, o(e(r).tableMode), 9, Oa),
|
|
1128
|
+
a("button", {
|
|
1129
|
+
type: "button",
|
|
1130
|
+
"aria-pressed": e($) === "regions",
|
|
1131
|
+
disabled: e(P),
|
|
1132
|
+
onClick: s[5] || (s[5] = (n) => $.value = "regions")
|
|
1133
|
+
}, [
|
|
1134
|
+
B(L, {
|
|
1135
|
+
name: "grid",
|
|
1136
|
+
size: 12
|
|
1137
|
+
}),
|
|
1138
|
+
N(o(e(r).multiRegions), 1)
|
|
1139
|
+
], 8, qa)
|
|
1140
|
+
], 8, La),
|
|
1141
|
+
a("span", Va, o(e(ee)?.range) + " · " + o(e(ee)?.rowCount) + " × " + o(e(ee)?.columnCount), 1),
|
|
1142
|
+
a("span", Ja, o(e(r).sourceOnly), 1)
|
|
1143
|
+
]),
|
|
1144
|
+
a("div", ja, [
|
|
1145
|
+
a("div", Ga, [
|
|
1146
|
+
a("div", Ua, [
|
|
1147
|
+
a("strong", null, o(e(r).source), 1),
|
|
1148
|
+
a("span", null, o(e($) === "regions" ? e(r).multiHint : e(r).sourceHint), 1)
|
|
1149
|
+
]),
|
|
1150
|
+
e(z) ? (v(), g("div", {
|
|
1151
|
+
key: 0,
|
|
1152
|
+
class: "mr-binding-grid-scroll",
|
|
1153
|
+
"aria-label": e(r).source
|
|
1154
|
+
}, [
|
|
1155
|
+
a("table", _a, [
|
|
1156
|
+
a("thead", null, [
|
|
1157
|
+
a("tr", null, [
|
|
1158
|
+
s[27] || (s[27] = a("th", {
|
|
1159
|
+
class: "mr-binding-corner",
|
|
1160
|
+
"aria-label": "#"
|
|
1161
|
+
}, "#", -1)),
|
|
1162
|
+
(v(!0), g(U, null, Y(e(z).columns, (n) => (v(), g("th", {
|
|
1163
|
+
key: n.column,
|
|
1164
|
+
scope: "col"
|
|
1165
|
+
}, o(n.name), 1))), 128))
|
|
1166
|
+
])
|
|
1167
|
+
]),
|
|
1168
|
+
a("tbody", null, [
|
|
1169
|
+
(v(!0), g(U, null, Y(e(z).rows, (n) => (v(), g("tr", {
|
|
1170
|
+
key: n.row,
|
|
1171
|
+
"data-region": e(c).regionAt(n.row),
|
|
1172
|
+
class: Se({
|
|
1173
|
+
"is-selected": e(V) && n.row >= e(V).top && n.row <= e(V).bottom
|
|
1174
|
+
})
|
|
1175
|
+
}, [
|
|
1176
|
+
a("th", Ya, [
|
|
1177
|
+
a("button", {
|
|
1178
|
+
type: "button",
|
|
1179
|
+
"data-source-row": n.row,
|
|
1180
|
+
"aria-label": `${e(r).selectionLabel} ${n.row}`,
|
|
1181
|
+
"aria-pressed": !!e(V) && n.row >= e(V).top && n.row <= e(V).bottom,
|
|
1182
|
+
disabled: e(P),
|
|
1183
|
+
onPointerdown: (R) => Fe(R, n.row),
|
|
1184
|
+
onPointerenter: (R) => le.value && e(c).chooseRow(n.row, !0),
|
|
1185
|
+
onKeydown: (R) => Ce(R, n.row)
|
|
1186
|
+
}, o(n.row), 41, Za)
|
|
1187
|
+
]),
|
|
1188
|
+
(v(!0), g(U, null, Y(n.cells, (R) => (v(), g("td", {
|
|
1189
|
+
key: R.column,
|
|
1190
|
+
rowspan: R.rowSpan,
|
|
1191
|
+
colspan: R.colSpan,
|
|
1192
|
+
title: `${R.address} · ${R.text}`,
|
|
1193
|
+
"data-source-cell": `${R.row}:${R.column}`,
|
|
1194
|
+
tabindex: e($) === "regions" ? 0 : -1,
|
|
1195
|
+
"aria-label": e($) === "regions" ? `${e(r).selectionCellLabel} ${R.address}` : void 0,
|
|
1196
|
+
"aria-selected": e($) === "regions" ? e(F).selected(R.row, R.column) : void 0,
|
|
1197
|
+
class: Se({ "is-continued": R.continued, "is-cell-selected": e($) === "regions" && e(F).selected(R.row, R.column) }),
|
|
1198
|
+
onPointerdown: (Q) => ue(Q, R.row, R.column),
|
|
1199
|
+
onPointerenter: (Q) => e($) === "regions" && le.value && e(F).select(R.row, R.column, !0),
|
|
1200
|
+
onKeydown: (Q) => ye(Q, R.row, R.column),
|
|
1201
|
+
style: We({
|
|
1202
|
+
textAlign: R.style?.align,
|
|
1203
|
+
fontWeight: R.style?.bold ? "600" : void 0
|
|
1204
|
+
})
|
|
1205
|
+
}, [
|
|
1206
|
+
a("span", null, o(R.text), 1)
|
|
1207
|
+
], 46, en))), 128))
|
|
1208
|
+
], 10, Qa))), 128))
|
|
1209
|
+
])
|
|
1210
|
+
])
|
|
1211
|
+
], 8, Xa)) : K("", !0),
|
|
1212
|
+
e(z) ? (v(), g("footer", tn, [
|
|
1213
|
+
a("span", null, [
|
|
1214
|
+
N(o(e(r).selected) + " ", 1),
|
|
1215
|
+
a("strong", null, o(e($) === "regions" ? e(F).selection.value || "—" : e(V) ? `${e(V).top}–${e(V).bottom}` : "—"), 1)
|
|
1216
|
+
]),
|
|
1217
|
+
a("div", an, [
|
|
1218
|
+
a("button", {
|
|
1219
|
+
type: "button",
|
|
1220
|
+
"aria-label": e(r).previousRows,
|
|
1221
|
+
disabled: e(z).top <= e(z).source.top,
|
|
1222
|
+
onClick: s[6] || (s[6] = (n) => e(c).moveWindow("row", -24))
|
|
1223
|
+
}, [
|
|
1224
|
+
B(L, {
|
|
1225
|
+
name: "chevron-left",
|
|
1226
|
+
size: 13
|
|
1227
|
+
})
|
|
1228
|
+
], 8, nn),
|
|
1229
|
+
a("label", null, [
|
|
1230
|
+
N(o(e(r).rowStart), 1),
|
|
1231
|
+
a("input", {
|
|
1232
|
+
type: "number",
|
|
1233
|
+
min: e(z).source.top,
|
|
1234
|
+
max: e(z).source.bottom,
|
|
1235
|
+
value: e(X),
|
|
1236
|
+
"aria-label": e(r).rowStart,
|
|
1237
|
+
onChange: s[7] || (s[7] = (n) => Re(n, "row"))
|
|
1238
|
+
}, null, 40, ln)
|
|
1239
|
+
]),
|
|
1240
|
+
a("button", {
|
|
1241
|
+
type: "button",
|
|
1242
|
+
"aria-label": e(r).nextRows,
|
|
1243
|
+
disabled: e(z).bottom >= e(z).source.bottom,
|
|
1244
|
+
onClick: s[8] || (s[8] = (n) => e(c).moveWindow("row", 24))
|
|
1245
|
+
}, [
|
|
1246
|
+
B(L, {
|
|
1247
|
+
name: "chevron-right",
|
|
1248
|
+
size: 13
|
|
1249
|
+
})
|
|
1250
|
+
], 8, on)
|
|
1251
|
+
]),
|
|
1252
|
+
a("div", sn, [
|
|
1253
|
+
a("button", {
|
|
1254
|
+
type: "button",
|
|
1255
|
+
"aria-label": e(r).previousColumns,
|
|
1256
|
+
disabled: e(z).left <= e(z).source.left,
|
|
1257
|
+
onClick: s[9] || (s[9] = (n) => e(c).moveWindow("column", -12))
|
|
1258
|
+
}, [
|
|
1259
|
+
B(L, {
|
|
1260
|
+
name: "chevron-left",
|
|
1261
|
+
size: 13
|
|
1262
|
+
})
|
|
1263
|
+
], 8, rn),
|
|
1264
|
+
a("label", null, [
|
|
1265
|
+
N(o(e(r).columnStart), 1),
|
|
1266
|
+
a("input", {
|
|
1267
|
+
type: "number",
|
|
1268
|
+
min: e(z).source.left,
|
|
1269
|
+
max: e(z).source.right,
|
|
1270
|
+
value: e(oe),
|
|
1271
|
+
"aria-label": e(r).columnStart,
|
|
1272
|
+
onChange: s[10] || (s[10] = (n) => Re(n, "column"))
|
|
1273
|
+
}, null, 40, un)
|
|
1274
|
+
]),
|
|
1275
|
+
a("button", {
|
|
1276
|
+
type: "button",
|
|
1277
|
+
"aria-label": e(r).nextColumns,
|
|
1278
|
+
disabled: e(z).right >= e(z).source.right,
|
|
1279
|
+
onClick: s[11] || (s[11] = (n) => e(c).moveWindow("column", 12))
|
|
1280
|
+
}, [
|
|
1281
|
+
B(L, {
|
|
1282
|
+
name: "chevron-right",
|
|
1283
|
+
size: 13
|
|
1284
|
+
})
|
|
1285
|
+
], 8, dn)
|
|
1286
|
+
])
|
|
1287
|
+
])) : K("", !0)
|
|
1288
|
+
]),
|
|
1289
|
+
a("div", cn, [
|
|
1290
|
+
e($) === "regions" ? (v(), Pe(fa, {
|
|
1291
|
+
key: 0,
|
|
1292
|
+
controller: e(F),
|
|
1293
|
+
datasets: t.datasets,
|
|
1294
|
+
disabled: e(P),
|
|
1295
|
+
messages: e(r)
|
|
1296
|
+
}, null, 8, ["controller", "datasets", "disabled", "messages"])) : K("", !0),
|
|
1297
|
+
st(a("fieldset", {
|
|
1298
|
+
disabled: e(P),
|
|
1299
|
+
class: "mr-binding-table-editor"
|
|
1300
|
+
}, [
|
|
1301
|
+
a("section", gn, [
|
|
1302
|
+
a("h3", null, [
|
|
1303
|
+
s[28] || (s[28] = a("b", null, "1", -1)),
|
|
1304
|
+
N(o(e(r).regionLegend), 1)
|
|
1305
|
+
]),
|
|
1306
|
+
(v(), g(U, null, Y(ve, (n) => a("div", {
|
|
1307
|
+
key: n,
|
|
1308
|
+
class: "mr-binding-region",
|
|
1309
|
+
"data-role": n
|
|
1310
|
+
}, [
|
|
1311
|
+
a("div", null, [
|
|
1312
|
+
a("strong", null, [
|
|
1313
|
+
N(o(O.value[n]), 1),
|
|
1314
|
+
n === "title" || n === "footer" ? (v(), g("small", bn, o(e(r).optional), 1)) : K("", !0)
|
|
1315
|
+
]),
|
|
1316
|
+
a("code", null, o(e(G).regions[n] || e(r).unnamed), 1)
|
|
1317
|
+
]),
|
|
1318
|
+
a("button", {
|
|
1319
|
+
type: "button",
|
|
1320
|
+
"aria-label": `${e(r).selectRegion} · ${O.value[n]}`,
|
|
1321
|
+
"data-binding-control": n,
|
|
1322
|
+
title: e(V) ? `${e(r).selectRegion} · ${O.value[n]}` : e(r).emptySelection,
|
|
1323
|
+
disabled: !e(V),
|
|
1324
|
+
onClick: (R) => e(c).markRegion(n)
|
|
1325
|
+
}, [
|
|
1326
|
+
B(L, {
|
|
1327
|
+
name: "arrow-right",
|
|
1328
|
+
size: 13
|
|
1329
|
+
})
|
|
1330
|
+
], 8, mn),
|
|
1331
|
+
(n === "title" || n === "footer") && e(G).regions[n] ? (v(), g("button", {
|
|
1332
|
+
key: 0,
|
|
1333
|
+
type: "button",
|
|
1334
|
+
"aria-label": `${e(r).clear} · ${O.value[n]}`,
|
|
1335
|
+
onClick: (R) => e(c).clearRegion(n)
|
|
1336
|
+
}, [
|
|
1337
|
+
B(L, {
|
|
1338
|
+
name: "close",
|
|
1339
|
+
size: 13
|
|
1340
|
+
})
|
|
1341
|
+
], 8, hn)) : K("", !0)
|
|
1342
|
+
], 8, fn)), 64)),
|
|
1343
|
+
e(G).regions.footer ? (v(), g("p", yn, o(e(r).footerHint), 1)) : K("", !0)
|
|
1344
|
+
]),
|
|
1345
|
+
a("section", pn, [
|
|
1346
|
+
a("h3", null, [
|
|
1347
|
+
s[29] || (s[29] = a("b", null, "2", -1)),
|
|
1348
|
+
N(o(e(r).mapping), 1),
|
|
1349
|
+
a("span", null, o(e(j).mapped) + "/" + o(e(j).total), 1)
|
|
1350
|
+
]),
|
|
1351
|
+
a("label", wn, [
|
|
1352
|
+
N(o(e(r).dataset), 1),
|
|
1353
|
+
a("select", {
|
|
1354
|
+
"data-binding-control": "dataset",
|
|
1355
|
+
value: e(G).dataset,
|
|
1356
|
+
"aria-label": e(r).dataset,
|
|
1357
|
+
onChange: s[12] || (s[12] = (n) => e(c).chooseDataset(ge(n)))
|
|
1358
|
+
}, [
|
|
1359
|
+
a("option", $n, o(e(r).chooseDataset), 1),
|
|
1360
|
+
(v(!0), g(U, null, Y(t.datasets, (n) => (v(), g("option", {
|
|
1361
|
+
key: n.id,
|
|
1362
|
+
value: n.id
|
|
1363
|
+
}, o(n.label || n.id), 9, xn))), 128))
|
|
1364
|
+
], 40, kn)
|
|
1365
|
+
]),
|
|
1366
|
+
t.datasets.length ? K("", !0) : (v(), g("p", Cn, o(e(r).noContract), 1)),
|
|
1367
|
+
e(H) ? (v(), g("label", Rn, [
|
|
1368
|
+
N(o(e(r).rowKey), 1),
|
|
1369
|
+
B($e, {
|
|
1370
|
+
"data-binding-control": "rowKey",
|
|
1371
|
+
"model-value": e(G).rowKey,
|
|
1372
|
+
fields: e(ie),
|
|
1373
|
+
label: e(r).rowKey,
|
|
1374
|
+
disabled: e(P),
|
|
1375
|
+
messages: e(r),
|
|
1376
|
+
placeholder: e(r).chooseRowKey,
|
|
1377
|
+
onChange: e(c).setRowKey
|
|
1378
|
+
}, null, 8, ["model-value", "fields", "label", "disabled", "messages", "placeholder", "onChange"])
|
|
1379
|
+
])) : K("", !0),
|
|
1380
|
+
e(H) ? (v(), g("div", In, [
|
|
1381
|
+
(v(!0), g(U, null, Y(e(_), (n) => (v(), g("label", {
|
|
1382
|
+
key: n.index,
|
|
1383
|
+
class: "mr-binding-map",
|
|
1384
|
+
tabindex: "-1"
|
|
1385
|
+
}, [
|
|
1386
|
+
a("span", null, o(n.physical), 1),
|
|
1387
|
+
a("div", null, [
|
|
1388
|
+
B($e, {
|
|
1389
|
+
"data-binding-control": `field-${n.index}`,
|
|
1390
|
+
label: `${e(r).physical} ${n.physical} · ${e(r).business}`,
|
|
1391
|
+
"model-value": n.field,
|
|
1392
|
+
fields: e(H).fields,
|
|
1393
|
+
disabled: e(P),
|
|
1394
|
+
messages: e(r),
|
|
1395
|
+
placeholder: e(r).chooseField,
|
|
1396
|
+
onChange: (R) => e(c).setMapping(n.index, R)
|
|
1397
|
+
}, null, 8, ["data-binding-control", "label", "model-value", "fields", "disabled", "messages", "placeholder", "onChange"]),
|
|
1398
|
+
n.field ? (v(), g("small", Mn, o(pe(n.field)), 1)) : K("", !0)
|
|
1399
|
+
])
|
|
1400
|
+
]))), 128))
|
|
1401
|
+
])) : K("", !0),
|
|
1402
|
+
e(H) && me.value > 1 ? (v(), g("div", Sn, [
|
|
1403
|
+
a("button", {
|
|
1404
|
+
type: "button",
|
|
1405
|
+
disabled: e(Z) <= 0,
|
|
1406
|
+
"aria-label": e(r).previousColumns,
|
|
1407
|
+
onClick: s[13] || (s[13] = (n) => Z.value--)
|
|
1408
|
+
}, [
|
|
1409
|
+
B(L, {
|
|
1410
|
+
name: "chevron-left",
|
|
1411
|
+
size: 13
|
|
1412
|
+
})
|
|
1413
|
+
], 8, Kn),
|
|
1414
|
+
a("span", null, o(e(Z) + 1) + " / " + o(me.value), 1),
|
|
1415
|
+
a("button", {
|
|
1416
|
+
type: "button",
|
|
1417
|
+
disabled: e(Z) + 1 >= me.value,
|
|
1418
|
+
"aria-label": e(r).nextColumns,
|
|
1419
|
+
onClick: s[14] || (s[14] = (n) => Z.value++)
|
|
1420
|
+
}, [
|
|
1421
|
+
B(L, {
|
|
1422
|
+
name: "chevron-right",
|
|
1423
|
+
size: 13
|
|
1424
|
+
})
|
|
1425
|
+
], 8, Fn)
|
|
1426
|
+
])) : K("", !0)
|
|
1427
|
+
])
|
|
1428
|
+
], 8, vn), [
|
|
1429
|
+
[rt, e($) === "table"]
|
|
1430
|
+
]),
|
|
1431
|
+
a("fieldset", { disabled: e(P) }, [
|
|
1432
|
+
a("section", Dn, [
|
|
1433
|
+
a("h3", null, o(e(r).identity), 1),
|
|
1434
|
+
a("label", Tn, [
|
|
1435
|
+
N(o(e(r).templateId), 1),
|
|
1436
|
+
a("input", {
|
|
1437
|
+
value: t.lockId ? d.identity?.id ?? e(S).id : e(S).id,
|
|
1438
|
+
autocomplete: "off",
|
|
1439
|
+
readonly: t.lockId,
|
|
1440
|
+
onInput: s[15] || (s[15] = (n) => e(c).setIdentity("id", ge(n)))
|
|
1441
|
+
}, null, 40, zn)
|
|
1442
|
+
]),
|
|
1443
|
+
a("label", Bn, [
|
|
1444
|
+
N(o(e(r).templateName), 1),
|
|
1445
|
+
a("input", {
|
|
1446
|
+
value: e(S).name,
|
|
1447
|
+
autocomplete: "off",
|
|
1448
|
+
onInput: s[16] || (s[16] = (n) => e(c).setIdentity("name", ge(n)))
|
|
1449
|
+
}, null, 40, Nn)
|
|
1450
|
+
])
|
|
1451
|
+
])
|
|
1452
|
+
], 8, En)
|
|
1453
|
+
])
|
|
1454
|
+
]),
|
|
1455
|
+
e(re) && e(j).issues.length ? (v(), g("details", An, [
|
|
1456
|
+
a("summary", null, o(e(r).issues) + " · " + o(e(j).issues.length) + " " + o(e(r).errors), 1),
|
|
1457
|
+
a("ul", null, [
|
|
1458
|
+
(v(!0), g(U, null, Y(w.value, (n) => (v(), g("li", {
|
|
1459
|
+
key: `${n.issue.path}:${n.issue.message}`
|
|
1460
|
+
}, [
|
|
1461
|
+
a("button", {
|
|
1462
|
+
type: "button",
|
|
1463
|
+
class: "mr-binding-issue-link",
|
|
1464
|
+
"aria-label": `${e(r).locateIssue} · ${n.label}`,
|
|
1465
|
+
onClick: (R) => e(c).locateIssue(n.issue)
|
|
1466
|
+
}, [
|
|
1467
|
+
a("strong", null, o(n.label), 1),
|
|
1468
|
+
a("span", null, o(n.message), 1),
|
|
1469
|
+
B(L, {
|
|
1470
|
+
name: "arrow-right",
|
|
1471
|
+
size: 12
|
|
1472
|
+
})
|
|
1473
|
+
], 8, Wn)
|
|
1474
|
+
]))), 128))
|
|
1475
|
+
]),
|
|
1476
|
+
W.value > 1 ? (v(), g("div", Pn, [
|
|
1477
|
+
a("button", {
|
|
1478
|
+
type: "button",
|
|
1479
|
+
disabled: p.value === 0,
|
|
1480
|
+
"aria-label": e(r).previousIssues,
|
|
1481
|
+
onClick: s[17] || (s[17] = (n) => p.value--)
|
|
1482
|
+
}, [
|
|
1483
|
+
B(L, {
|
|
1484
|
+
name: "chevron-left",
|
|
1485
|
+
size: 12
|
|
1486
|
+
})
|
|
1487
|
+
], 8, Hn),
|
|
1488
|
+
a("span", null, o(p.value + 1) + "/" + o(W.value), 1),
|
|
1489
|
+
a("button", {
|
|
1490
|
+
type: "button",
|
|
1491
|
+
disabled: p.value + 1 >= W.value,
|
|
1492
|
+
"aria-label": e(r).nextIssues,
|
|
1493
|
+
onClick: s[18] || (s[18] = (n) => p.value++)
|
|
1494
|
+
}, [
|
|
1495
|
+
B(L, {
|
|
1496
|
+
name: "chevron-right",
|
|
1497
|
+
size: 12
|
|
1498
|
+
})
|
|
1499
|
+
], 8, Ln)
|
|
1500
|
+
])) : K("", !0)
|
|
1501
|
+
])) : K("", !0),
|
|
1502
|
+
e(x).diagnostics ? (v(), Pe(Ra, {
|
|
1503
|
+
key: 1,
|
|
1504
|
+
source: e(x),
|
|
1505
|
+
"current-sheet": e(G).sheet,
|
|
1506
|
+
disabled: e(P),
|
|
1507
|
+
messages: e(r),
|
|
1508
|
+
onLocate: J
|
|
1509
|
+
}, null, 8, ["source", "current-sheet", "disabled", "messages"])) : e(x).warnings.length ? (v(), g("details", On, [
|
|
1510
|
+
a("summary", null, o(e(r).inspectWarning) + " · " + o(e(x).warnings.length), 1),
|
|
1511
|
+
a("ul", null, [
|
|
1512
|
+
(v(!0), g(U, null, Y(e(x).warnings, (n, R) => (v(), g("li", { key: R }, o(n), 1))), 128))
|
|
1513
|
+
])
|
|
1514
|
+
])) : K("", !0),
|
|
1515
|
+
a("footer", qn, [
|
|
1516
|
+
a("span", {
|
|
1517
|
+
class: Se({ "is-ready": e(j).ok }),
|
|
1518
|
+
role: "status",
|
|
1519
|
+
title: e(c).guidance.value
|
|
1520
|
+
}, o(e(c).guidance.value), 11, Vn),
|
|
1521
|
+
e(c).pendingLocalChanges.value ? (v(), g("button", {
|
|
1522
|
+
key: 0,
|
|
1523
|
+
type: "button",
|
|
1524
|
+
disabled: e(P),
|
|
1525
|
+
onClick: s[19] || (s[19] = //@ts-ignore
|
|
1526
|
+
(...n) => e(c).restoreDraft && e(c).restoreDraft(...n))
|
|
1527
|
+
}, o(e(r).restoreDraft), 9, Jn)) : K("", !0),
|
|
1528
|
+
a("button", {
|
|
1529
|
+
type: "button",
|
|
1530
|
+
disabled: !e(c).canCheck.value,
|
|
1531
|
+
onClick: s[20] || (s[20] = //@ts-ignore
|
|
1532
|
+
(...n) => e(c).check && e(c).check(...n))
|
|
1533
|
+
}, o(e(r).check), 9, jn),
|
|
1534
|
+
a("button", {
|
|
1535
|
+
type: "button",
|
|
1536
|
+
class: "mr-binding-primary",
|
|
1537
|
+
disabled: e(P) || !e(j).ok,
|
|
1538
|
+
title: e(c).guidance.value,
|
|
1539
|
+
onClick: s[21] || (s[21] = //@ts-ignore
|
|
1540
|
+
(...n) => e(c).apply && e(c).apply(...n))
|
|
1541
|
+
}, o(e(r).apply), 9, Gn)
|
|
1542
|
+
])
|
|
1543
|
+
], 64)) : (v(), g("div", Na, [
|
|
1544
|
+
s[26] || (s[26] = a("svg", {
|
|
1545
|
+
viewBox: "0 0 80 80",
|
|
1546
|
+
fill: "none",
|
|
1547
|
+
"aria-hidden": "true"
|
|
1548
|
+
}, [
|
|
1549
|
+
a("rect", {
|
|
1550
|
+
x: "15",
|
|
1551
|
+
y: "10",
|
|
1552
|
+
width: "50",
|
|
1553
|
+
height: "60",
|
|
1554
|
+
rx: "8",
|
|
1555
|
+
fill: "#eff6ff",
|
|
1556
|
+
stroke: "#bfdbfe"
|
|
1557
|
+
}),
|
|
1558
|
+
a("path", {
|
|
1559
|
+
d: "M25 25h30M25 35h30M25 45h30M35 25v30M45 25v30M25 55h30",
|
|
1560
|
+
stroke: "#93c5fd",
|
|
1561
|
+
"stroke-width": "1.5"
|
|
1562
|
+
})
|
|
1563
|
+
], -1)),
|
|
1564
|
+
a("strong", null, o(e(r).noSource), 1),
|
|
1565
|
+
a("span", null, o(e(r).sourceOnly), 1),
|
|
1566
|
+
a("button", {
|
|
1567
|
+
type: "button",
|
|
1568
|
+
class: "mr-binding-primary",
|
|
1569
|
+
disabled: t.readonly,
|
|
1570
|
+
onClick: s[2] || (s[2] = (n) => te.value?.click())
|
|
1571
|
+
}, o(e(r).upload), 9, Aa)
|
|
1572
|
+
]))
|
|
1573
|
+
], 44, Sa));
|
|
1574
|
+
}
|
|
1575
|
+
});
|
|
1576
|
+
export {
|
|
1577
|
+
el as default
|
|
1578
|
+
};
|