@agile-team/mach-report 2.25.2 → 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 +12 -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-D1ZC5kzz.js → ReportPreview-C9c0Rp7Y.js} +2938 -2875
- 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-j7mr8Kvc.js → auto-C7udkeAa.js} +20 -19
- 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-BWEMdzFG.js → encoding-D480EM2r.js} +2 -2
- package/dist/{encoding-DVea2qIR.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.js +25 -25
- package/dist/{json-snapshot-DdzALe8q.js → json-snapshot-BZ0CIQln.js} +1041 -887
- 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-D5BRHlne.cjs → plugin-B7Bi-1te.cjs} +1 -1
- package/dist/{plugin-FWhTnjr0.js → plugin-OKDFQFS4.js} +1 -1
- package/dist/{prefill-m01IM1hl.js → prefill-C8fF91JB.js} +3 -3
- package/dist/{prefill-DZymomY6.cjs → prefill-C_Bf_AMo.cjs} +1 -1
- package/dist/{prepared-BHu8bIdj.cjs → prepared-BLhV7vdE.cjs} +1 -1
- package/dist/{prepared-DO5pe6Ed.js → prepared-DhgQ0d-h.js} +7 -7
- package/dist/protocol-CZ-BILne.cjs +1 -0
- package/dist/{protocol-CZddmu2n.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 +2049 -1889
- 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-DLu814zA.js → template-catalog-BbrN9dgu.js} +5 -5
- package/dist/{template-catalog-Lil5Ryt-.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 +215 -24
- package/dist/vue/index.d.ts +215 -24
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +433 -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-DAU-V3Ov.cjs +0 -6
- package/dist/auto-DjmvmcX-.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-L_gJ7KRS.cjs +0 -2
- package/dist/protocol-CymmHWmL.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-D8AlfJ6S.js +0 -234
- package/dist/runtime-ywf3oLBR.cjs +0 -1
- package/dist/workbook-session-BclW7KKH.cjs +0 -29
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as M, watch as I, nextTick as V, onMounted as be, onBeforeUnmount as re, inject as oe, computed as S, provide as ye, shallowRef as he, defineComponent as _, openBlock as f, createElementBlock as m, Fragment as U, renderList as H, unref as w, createElementVNode as L, toDisplayString as O, createTextVNode as G, createCommentVNode as $, normalizeClass as Y, createVNode as W, withModifiers as we, createBlock as ne, withKeys as K } from "vue";
|
|
2
2
|
import { a as Q } from "./injection-keys-e85udZCp.js";
|
|
3
|
-
import { ReportParamValidationError as Se, ReportSourceError as Ee, validateReportParams as
|
|
4
|
-
import { w as Ae } from "./diagnostic-collector-
|
|
3
|
+
import { ReportParamValidationError as Se, ReportSourceError as Ee, validateReportParams as se, parseReportCascaderPath as Ce, formatReportCascaderPath as Re, parseReportParamSelection as Pe, formatReportParamSelection as Oe } from "@agile-team/mach-report";
|
|
4
|
+
import { w as Ae } from "./diagnostic-collector-C-JBA016.js";
|
|
5
5
|
import { _ as ee, a as X } from "./_plugin-vue_export-helper-8SL1F89S.js";
|
|
6
6
|
const xe = {
|
|
7
7
|
printPrepareTimeout: "打印资源准备超时,请检查字体与图片后重试。",
|
|
@@ -14,12 +14,12 @@ const xe = {
|
|
|
14
14
|
printCalibrationTest: "打印校准页",
|
|
15
15
|
printCalibrationHint: "正值向右/向下移动,负值向左/向上。使用同规格纸张及 100% 比例,先试打一张。系统对话框关闭不代表设备已完成。"
|
|
16
16
|
};
|
|
17
|
-
function
|
|
17
|
+
function Aa(e) {
|
|
18
18
|
const t = e?.calibration?.offsetXmm ?? 0, l = e?.calibration?.offsetYmm ?? 0;
|
|
19
19
|
if (![t, l].every((n) => Number.isFinite(n) && Math.abs(n) <= 20)) throw new RangeError("Print calibration must be within ±20 mm");
|
|
20
20
|
return { x: t, y: l };
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function xa(e = {}) {
|
|
23
23
|
if (e.fonts && (!Array.isArray(e.fonts) || e.fonts.length > 8)) throw new RangeError("At most eight print font faces are allowed");
|
|
24
24
|
return { ...e, ...e.fonts ? { fonts: e.fonts.map((t) => ({ ...t })) } : {}, ...e.calibration ? { calibration: { ...e.calibration } } : {} };
|
|
25
25
|
}
|
|
@@ -28,7 +28,7 @@ class B extends Error {
|
|
|
28
28
|
super(l), this.name = "MachReportError", this.code = t, this.cause = n;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Ma(e) {
|
|
32
32
|
return e instanceof B ? { code: e.code, cause: e.cause } : { code: "render", cause: e };
|
|
33
33
|
}
|
|
34
34
|
function ka(e) {
|
|
@@ -41,24 +41,24 @@ function ka(e) {
|
|
|
41
41
|
}
|
|
42
42
|
return new B("fetch", e instanceof Error ? e.message : "预览加载失败", e);
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
const t =
|
|
44
|
+
function Me(e = {}) {
|
|
45
|
+
const t = M(!1), l = M(null), n = M(null), r = M(null);
|
|
46
46
|
function c(d = !1) {
|
|
47
47
|
t.value = !1, d && V(() => n.value?.focus());
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function g(d) {
|
|
50
50
|
d.target instanceof Node && !l.value?.contains(d.target) && c();
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function o(d) {
|
|
53
53
|
d.key !== "Escape" || !t.value || d.isComposing || (d.preventDefault(), d.stopPropagation(), c(!0));
|
|
54
54
|
}
|
|
55
55
|
return I(t, (d) => {
|
|
56
56
|
!d || e.focusOnOpen === !1 || V(() => (r.value?.querySelector("input") ?? r.value?.querySelector("button:not(:disabled)"))?.focus());
|
|
57
57
|
}), be(() => {
|
|
58
|
-
document.addEventListener("pointerdown",
|
|
58
|
+
document.addEventListener("pointerdown", g), document.addEventListener("focusin", g);
|
|
59
59
|
}), re(() => {
|
|
60
|
-
document.removeEventListener("pointerdown",
|
|
61
|
-
}), { opened: t, root: l, trigger: n, panel: r, close: c, onKeydown:
|
|
60
|
+
document.removeEventListener("pointerdown", g), document.removeEventListener("focusin", g);
|
|
61
|
+
}), { opened: t, root: l, trigger: n, panel: r, close: c, onKeydown: o };
|
|
62
62
|
}
|
|
63
63
|
const de = {
|
|
64
64
|
conflictReviewTitle: "核对保存冲突",
|
|
@@ -80,12 +80,20 @@ const de = {
|
|
|
80
80
|
conflictReviewStale: "当前查询已变化,请重新读取最新数据后核对。",
|
|
81
81
|
conflictReviewRetained: "修改仍已保留,可重新读取核对或关闭后继续编辑。"
|
|
82
82
|
};
|
|
83
|
-
function
|
|
83
|
+
function Fa(e) {
|
|
84
84
|
const t = { ...de };
|
|
85
85
|
for (const l of Object.keys(t)) typeof e[l] == "string" && (t[l] = e[l]);
|
|
86
86
|
return t;
|
|
87
87
|
}
|
|
88
|
-
const
|
|
88
|
+
const ke = {
|
|
89
|
+
documentBuilding: "生成中 · 已就绪 {pages} 页",
|
|
90
|
+
documentComplete: "共 {pages} 页 · 按页加载",
|
|
91
|
+
documentFailed: "生成已停止 · 可查看已就绪页面",
|
|
92
|
+
documentRefresh: "刷新文档",
|
|
93
|
+
documentLoading: "正在读取页面…",
|
|
94
|
+
documentCancel: "取消",
|
|
95
|
+
documentFullExport: "导出完整文档"
|
|
96
|
+
}, ae = {
|
|
89
97
|
paramOptionsLoading: "正在搜索选项…",
|
|
90
98
|
paramOptionsEmpty: "没有匹配选项",
|
|
91
99
|
paramOptionsFailed: "选项加载失败,请重试",
|
|
@@ -133,7 +141,7 @@ const ae = {
|
|
|
133
141
|
reviewNext: "下一页",
|
|
134
142
|
reviewPage: "差异分页"
|
|
135
143
|
};
|
|
136
|
-
function
|
|
144
|
+
function Da(e) {
|
|
137
145
|
return { ...ue, ...Object.fromEntries(Object.entries(e).filter(([, t]) => t !== void 0)) };
|
|
138
146
|
}
|
|
139
147
|
const ce = {
|
|
@@ -181,7 +189,9 @@ function $a(e) {
|
|
|
181
189
|
}
|
|
182
190
|
return t;
|
|
183
191
|
}
|
|
184
|
-
const
|
|
192
|
+
const Fe = {
|
|
193
|
+
...ke,
|
|
194
|
+
importOmitted: "另有 {count} 项同类提示;可缩小导入范围查看详细位置。",
|
|
185
195
|
...de,
|
|
186
196
|
previousSnapshot: "当前保留上次成功结果,刷新成功后恢复编辑和输出。",
|
|
187
197
|
...ae,
|
|
@@ -371,7 +381,7 @@ const Me = {
|
|
|
371
381
|
diagnosticImageDecode: "图片加载失败,请检查资源后重试。",
|
|
372
382
|
diagnosticAssetFailed: "图表或图片生成失败,请重试或联系管理员。",
|
|
373
383
|
diagnosticAssetBudget: "图片资源超出处理范围,请减少资源或缩小报表范围。"
|
|
374
|
-
},
|
|
384
|
+
}, De = {
|
|
375
385
|
colorScheme: "light",
|
|
376
386
|
emptyAccent: "#79a7e8",
|
|
377
387
|
shellBg: "#f4f7fc",
|
|
@@ -392,7 +402,7 @@ const Me = {
|
|
|
392
402
|
function $e(e = {}) {
|
|
393
403
|
return { ...e, defaults: e.defaults ?? {}, presets: e.presets ?? {} };
|
|
394
404
|
}
|
|
395
|
-
function
|
|
405
|
+
function Ia(e) {
|
|
396
406
|
return e;
|
|
397
407
|
}
|
|
398
408
|
const q = {
|
|
@@ -404,14 +414,14 @@ const q = {
|
|
|
404
414
|
gapPx: 18,
|
|
405
415
|
pdfFontUrl: "/simhei.ttf",
|
|
406
416
|
logger: console
|
|
407
|
-
},
|
|
417
|
+
}, La = { warn: () => {
|
|
408
418
|
}, info: () => {
|
|
409
419
|
} };
|
|
410
|
-
function
|
|
420
|
+
function Ie(e, t) {
|
|
411
421
|
if (!(!e && !t))
|
|
412
422
|
return { ...e, ...t, calibration: { ...e?.calibration, ...t?.calibration } };
|
|
413
423
|
}
|
|
414
|
-
function
|
|
424
|
+
function Le(e = {}, t = {}) {
|
|
415
425
|
const l = { ...e, ...t };
|
|
416
426
|
return (e.unavailableReasons || t.unavailableReasons) && (l.unavailableReasons = { ...e.unavailableReasons, ...t.unavailableReasons }), l;
|
|
417
427
|
}
|
|
@@ -423,14 +433,14 @@ function j(e, t) {
|
|
|
423
433
|
messages: { ...e?.messages, ...t?.messages },
|
|
424
434
|
preview: { ...e?.preview, ...t?.preview },
|
|
425
435
|
xlsx: { ...e?.xlsx, ...t?.xlsx },
|
|
426
|
-
toolbar:
|
|
436
|
+
toolbar: Le(e?.toolbar, t?.toolbar),
|
|
427
437
|
interaction: { ...e?.interaction, ...t?.interaction },
|
|
428
438
|
refresh: { ...e?.refresh, ...t?.refresh },
|
|
429
439
|
output: { ...e?.output, ...t?.output },
|
|
430
|
-
printOptions:
|
|
440
|
+
printOptions: Ie(e?.printOptions, t?.printOptions)
|
|
431
441
|
};
|
|
432
442
|
}
|
|
433
|
-
function
|
|
443
|
+
function Te(e) {
|
|
434
444
|
return {
|
|
435
445
|
showExport: e.showExport ?? q.showExport,
|
|
436
446
|
showPrint: e.showPrint ?? q.showPrint,
|
|
@@ -440,7 +450,7 @@ function Le(e) {
|
|
|
440
450
|
gapPx: e.gapPx ?? q.gapPx
|
|
441
451
|
};
|
|
442
452
|
}
|
|
443
|
-
function
|
|
453
|
+
function Ta(e, t) {
|
|
444
454
|
const l = t ? e?.presets?.[t] : e?.defaultPreset ? e?.presets?.[e.defaultPreset] : void 0, n = j(e?.defaults, l);
|
|
445
455
|
return {
|
|
446
456
|
drill: n.drill,
|
|
@@ -448,10 +458,10 @@ function La(e, t) {
|
|
|
448
458
|
dataComparison: n.dataComparison,
|
|
449
459
|
exportExecution: n.exportExecution,
|
|
450
460
|
loadParamOptions: n.loadParamOptions,
|
|
451
|
-
...
|
|
461
|
+
...Te(n),
|
|
452
462
|
pdfFontUrl: n.pdfFontUrl ?? q.pdfFontUrl,
|
|
453
|
-
theme: { ...
|
|
454
|
-
messages: { ...
|
|
463
|
+
theme: { ...De, ...n.theme },
|
|
464
|
+
messages: { ...Fe, ...n.messages },
|
|
455
465
|
logger: n.logger ?? q.logger,
|
|
456
466
|
preview: {
|
|
457
467
|
overscanPages: ie(n.preview?.overscanPages, 1, 10, !0),
|
|
@@ -476,19 +486,19 @@ function ie(e, t, l, n = !1) {
|
|
|
476
486
|
const r = Math.max(0, Math.min(l, e));
|
|
477
487
|
return n ? Math.floor(r) : r;
|
|
478
488
|
}
|
|
479
|
-
function
|
|
489
|
+
function qa(e) {
|
|
480
490
|
const t = {};
|
|
481
491
|
return e.colorScheme != null && (t["--mrp-color-scheme"] = e.colorScheme), e.emptyAccent != null && (t["--mrp-empty-accent"] = e.emptyAccent), e.shellBg != null && (t["--mrp-shell-bg"] = e.shellBg), e.shellFg != null && (t["--mrp-shell-fg"] = e.shellFg), e.toolbarBg != null && (t["--mrp-toolbar-bg"] = e.toolbarBg), e.toolbarBorder != null && (t["--mrp-toolbar-border"] = e.toolbarBorder), e.toolbarFg != null && (t["--mrp-toolbar-fg"] = e.toolbarFg), e.btnFg != null && (t["--mrp-btn-fg"] = e.btnFg), e.btnBorder != null && (t["--mrp-btn-border"] = e.btnBorder), e.btnHoverBg != null && (t["--mrp-btn-hover-bg"] = e.btnHoverBg), e.btnHoverFg != null && (t["--mrp-btn-hover-fg"] = e.btnHoverFg), e.btnActiveBg != null && (t["--mrp-btn-active-bg"] = e.btnActiveBg), e.btnActiveFg != null && (t["--mrp-btn-active-fg"] = e.btnActiveFg), e.errorFg != null && (t["--mrp-error-fg"] = e.errorFg), e.warningFg != null && (t["--mrp-warning-fg"] = e.warningFg), e.successFg != null && (t["--mrp-success-fg"] = e.successFg), t;
|
|
482
492
|
}
|
|
483
|
-
function
|
|
484
|
-
const t =
|
|
493
|
+
function Na(e) {
|
|
494
|
+
const t = oe(Q, null), l = S(() => {
|
|
485
495
|
const n = t?.value ?? null, r = "defaults" in e || "presets" in e || "defaultPreset" in e ? $e(e) : { defaults: e, presets: {} };
|
|
486
496
|
if (!n) return r;
|
|
487
497
|
const c = { ...n.presets, ...r.presets };
|
|
488
|
-
for (const
|
|
489
|
-
c[
|
|
490
|
-
j(n.presets[
|
|
491
|
-
r.presets[
|
|
498
|
+
for (const g of Object.keys(c))
|
|
499
|
+
c[g] = j(
|
|
500
|
+
j(n.presets[g], r.defaults),
|
|
501
|
+
r.presets[g]
|
|
492
502
|
);
|
|
493
503
|
return {
|
|
494
504
|
defaults: j(n.defaults, r.defaults),
|
|
@@ -498,75 +508,75 @@ function qa(e) {
|
|
|
498
508
|
});
|
|
499
509
|
ye(Q, l);
|
|
500
510
|
}
|
|
501
|
-
function
|
|
502
|
-
return
|
|
511
|
+
function Ba() {
|
|
512
|
+
return oe(Q, S(() => null));
|
|
503
513
|
}
|
|
504
|
-
let
|
|
505
|
-
function
|
|
506
|
-
return `mrp-params-${++
|
|
514
|
+
let qe = 0;
|
|
515
|
+
function Ne() {
|
|
516
|
+
return `mrp-params-${++qe}`;
|
|
507
517
|
}
|
|
508
518
|
function fe(e, t, l) {
|
|
509
519
|
const n = (Array.isArray(t) ? t.find((r) => r?.field === e.field)?.label : void 0) ?? e.field;
|
|
510
520
|
return e.code === "required" ? l.paramRequired.replace("{label}", n) : (l.paramInvalid ?? "{label}:{message}").replace("{label}", n).replace("{message}", e.message);
|
|
511
521
|
}
|
|
512
|
-
function
|
|
513
|
-
const t =
|
|
522
|
+
function Ua(e) {
|
|
523
|
+
const t = M({}), l = M(!1);
|
|
514
524
|
function n() {
|
|
515
|
-
const
|
|
525
|
+
const o = {};
|
|
516
526
|
for (const d of Array.isArray(e.defs.value) ? e.defs.value : [])
|
|
517
|
-
typeof d?.field == "string" && Object.defineProperty(
|
|
518
|
-
t.value =
|
|
527
|
+
typeof d?.field == "string" && Object.defineProperty(o, d.field, { value: e.params()[d.field] ?? d.defaultValue ?? "", writable: !0, enumerable: !0, configurable: !0 });
|
|
528
|
+
t.value = o, l.value = !1;
|
|
519
529
|
}
|
|
520
530
|
n(), I(e.defs, n), I(e.reportIds, n), I(() => JSON.stringify(e.params()), n);
|
|
521
|
-
const r = S(() =>
|
|
522
|
-
function
|
|
523
|
-
const
|
|
524
|
-
if (!
|
|
525
|
-
const y =
|
|
526
|
-
return { quiet: c.value, error: new B(y.code === "definition" ? "config" : "param", fe(y, e.defs.value, e.messages()), { issues:
|
|
531
|
+
const r = S(() => se(e.defs.value, { ...e.params(), ...t.value })), c = S(() => !l.value && r.value.issues.length > 0 && r.value.issues.every((o) => o.code === "required"));
|
|
532
|
+
function g() {
|
|
533
|
+
const o = r.value;
|
|
534
|
+
if (!o.ok) {
|
|
535
|
+
const y = o.issues[0];
|
|
536
|
+
return { quiet: c.value, error: new B(y.code === "definition" ? "config" : "param", fe(y, e.defs.value, e.messages()), { issues: o.issues }) };
|
|
527
537
|
}
|
|
528
|
-
const d = { ...
|
|
538
|
+
const d = { ...o.values }, x = new Set(e.defs.value.filter((y) => y.defaultValue !== void 0).map((y) => y.field));
|
|
529
539
|
for (const [y, u] of Object.entries(d)) u === "" && !x.has(y) && delete d[y];
|
|
530
540
|
return { params: d, quiet: !1 };
|
|
531
541
|
}
|
|
532
|
-
return { values: t, attempted: l, validation: r, pendingRequired: c, reset: n, query:
|
|
542
|
+
return { values: t, attempted: l, validation: r, pendingRequired: c, reset: n, query: g };
|
|
533
543
|
}
|
|
534
|
-
const Z = 100,
|
|
535
|
-
function
|
|
544
|
+
const Z = 100, Be = 32, Ue = 6e4, He = 15e3;
|
|
545
|
+
function Ve(e) {
|
|
536
546
|
let t = 0;
|
|
537
547
|
const l = /* @__PURE__ */ new Set();
|
|
538
548
|
function n(r, c) {
|
|
539
549
|
if (!Array.isArray(r) || c > 16 || r.length > Z) throw new Error("Invalid option response");
|
|
540
|
-
const
|
|
541
|
-
return Object.freeze(r.map((
|
|
542
|
-
if (++t > Z || !
|
|
543
|
-
return l.add(
|
|
550
|
+
const g = /* @__PURE__ */ new Set();
|
|
551
|
+
return Object.freeze(r.map((o) => {
|
|
552
|
+
if (++t > Z || !o || l.has(o) || typeof o.value != "string" || !o.value || o.value.length > 1024 || typeof o.label != "string" || o.label.length > 1024 || g.has(o.value)) throw new Error("Invalid option response");
|
|
553
|
+
return l.add(o), g.add(o.value), Object.freeze({ label: o.label, value: o.value, ...o.children === void 0 ? {} : { children: n(o.children, c + 1) } });
|
|
544
554
|
}));
|
|
545
555
|
}
|
|
546
556
|
return n(e, 1);
|
|
547
557
|
}
|
|
548
558
|
function pe(e) {
|
|
549
|
-
const t =
|
|
559
|
+
const t = M(""), l = he([]), n = M(!1), r = M(!1), c = S(() => Object.fromEntries((Array.isArray(e.def().dependsOn) ? e.def().dependsOn : []).map((A) => [A, e.values()[A] ?? ""]))), g = S(() => Object.values(c.value).some((A) => !A.trim())), o = S(() => !e.loader()), d = /* @__PURE__ */ new Map();
|
|
550
560
|
let x, y, u = 0;
|
|
551
561
|
function h() {
|
|
552
562
|
u++, x?.abort(), x = void 0, clearTimeout(y), n.value = !1;
|
|
553
563
|
}
|
|
554
564
|
async function b() {
|
|
555
565
|
h(), r.value = !1;
|
|
556
|
-
const A = e.loader(),
|
|
557
|
-
if (!A || !
|
|
558
|
-
const
|
|
559
|
-
if (p && Date.now() - p.at <
|
|
566
|
+
const A = e.loader(), k = e.def();
|
|
567
|
+
if (!A || !k.optionsSource || g.value || e.disabled() || !e.opened()) return;
|
|
568
|
+
const D = { source: k.optionsSource, field: k.field, query: t.value.trim().slice(0, 256), params: Object.freeze({ ...c.value }), limit: Z }, i = JSON.stringify(D), p = d.get(i);
|
|
569
|
+
if (p && Date.now() - p.at < Ue) {
|
|
560
570
|
d.delete(i), d.set(i, p), l.value = p.options;
|
|
561
571
|
return;
|
|
562
572
|
}
|
|
563
|
-
const a = u,
|
|
564
|
-
x =
|
|
565
|
-
const E = setTimeout(() =>
|
|
573
|
+
const a = u, s = new AbortController();
|
|
574
|
+
x = s, n.value = !0;
|
|
575
|
+
const E = setTimeout(() => s.abort(), He);
|
|
566
576
|
try {
|
|
567
|
-
const P =
|
|
577
|
+
const P = Ve(await Ae(A(Object.freeze({ ...D, signal: s.signal })), s.signal));
|
|
568
578
|
if (a !== u) return;
|
|
569
|
-
for (l.value = P, d.delete(i), d.set(i, { at: Date.now(), options: P }); d.size >
|
|
579
|
+
for (l.value = P, d.delete(i), d.set(i, { at: Date.now(), options: P }); d.size > Be; ) d.delete(d.keys().next().value);
|
|
570
580
|
} catch {
|
|
571
581
|
a === u && (r.value = !0);
|
|
572
582
|
} finally {
|
|
@@ -584,9 +594,9 @@ function pe(e) {
|
|
|
584
594
|
!e.opened() || e.disabled() ? h() : b();
|
|
585
595
|
}, { immediate: !0 }), re(() => {
|
|
586
596
|
h(), d.clear();
|
|
587
|
-
}), { query: t, options: l, loading: n, failed: r, waiting:
|
|
597
|
+
}), { query: t, options: l, loading: n, failed: r, waiting: g, missingLoader: o, request: b, cancel: h };
|
|
588
598
|
}
|
|
589
|
-
const
|
|
599
|
+
const je = ["aria-labelledby"], Ge = ["value", "disabled", "aria-label", "aria-invalid", "aria-describedby", "aria-required", "onChange"], ze = { value: "" }, Je = ["value"], We = ["id"], Ke = /* @__PURE__ */ _({
|
|
590
600
|
__name: "ReportCascaderParam",
|
|
591
601
|
props: {
|
|
592
602
|
def: {},
|
|
@@ -609,26 +619,26 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
609
619
|
} catch {
|
|
610
620
|
return [];
|
|
611
621
|
}
|
|
612
|
-
}),
|
|
622
|
+
}), g = S(() => ({ ...ae, ...l.messages })), o = S(() => {
|
|
613
623
|
const y = [];
|
|
614
624
|
let u = l.def.optionsSource ? r.options.value : l.def.options ?? [];
|
|
615
625
|
for (let h = 0; h < 16 && u.length; h++)
|
|
616
626
|
y.push(u), u = u.find((b) => b.value === c.value[h])?.children ?? [];
|
|
617
627
|
return y;
|
|
618
|
-
}), d = S(() => l.def.optionsSource ? r.waiting.value ?
|
|
628
|
+
}), d = S(() => l.def.optionsSource ? r.waiting.value ? g.value.paramOptionsDependencies : r.missingLoader.value ? g.value.paramOptionsMissingLoader : r.failed.value ? g.value.paramOptionsFailed : r.loading.value ? g.value.paramOptionsLoading : o.value.length ? "" : g.value.paramOptionsEmpty : "");
|
|
619
629
|
function x(y, u) {
|
|
620
630
|
if (l.disabled) return;
|
|
621
631
|
const h = c.value.slice(0, y);
|
|
622
632
|
u && h.push(u);
|
|
623
|
-
const b = u ?
|
|
633
|
+
const b = u ? o.value[y]?.find((R) => R.value === u)?.children : o.value[y];
|
|
624
634
|
n("change", h.length ? b?.length ? JSON.stringify([...h, null]) : Re(h) : "");
|
|
625
635
|
}
|
|
626
|
-
return (y, u) => (f(),
|
|
636
|
+
return (y, u) => (f(), m("div", {
|
|
627
637
|
class: "mrp-cascader",
|
|
628
638
|
role: "group",
|
|
629
639
|
"aria-labelledby": `${e.id}-label`
|
|
630
640
|
}, [
|
|
631
|
-
(f(!0),
|
|
641
|
+
(f(!0), m(U, null, H(o.value, (h, b) => (f(), m("select", {
|
|
632
642
|
key: b,
|
|
633
643
|
class: "mrp-param-input",
|
|
634
644
|
value: c.value[b] ?? "",
|
|
@@ -639,35 +649,35 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
639
649
|
"aria-required": e.def.required || void 0,
|
|
640
650
|
onChange: (R) => x(b, R.target.value)
|
|
641
651
|
}, [
|
|
642
|
-
L("option",
|
|
643
|
-
(f(!0),
|
|
652
|
+
L("option", ze, O(e.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", e.def.label ?? e.def.field)), 1),
|
|
653
|
+
(f(!0), m(U, null, H(h, (R) => (f(), m("option", {
|
|
644
654
|
key: R.value,
|
|
645
655
|
value: R.value
|
|
646
|
-
}, O(R.label), 9,
|
|
647
|
-
], 40,
|
|
648
|
-
d.value ? (f(),
|
|
656
|
+
}, O(R.label), 9, Je))), 128))
|
|
657
|
+
], 40, Ge))), 128)),
|
|
658
|
+
d.value ? (f(), m("small", {
|
|
649
659
|
key: 0,
|
|
650
660
|
id: `${e.id}-status`,
|
|
651
661
|
role: "status"
|
|
652
662
|
}, [
|
|
653
663
|
G(O(d.value), 1),
|
|
654
|
-
w(r).failed.value ? (f(),
|
|
664
|
+
w(r).failed.value ? (f(), m("button", {
|
|
655
665
|
key: 0,
|
|
656
666
|
type: "button",
|
|
657
667
|
onClick: u[0] || (u[0] = //@ts-ignore
|
|
658
668
|
(...h) => w(r).request && w(r).request(...h))
|
|
659
|
-
}, O(e.messages.retry), 1)) :
|
|
660
|
-
], 8,
|
|
661
|
-
], 8,
|
|
669
|
+
}, O(e.messages.retry), 1)) : $("", !0)
|
|
670
|
+
], 8, We)) : $("", !0)
|
|
671
|
+
], 8, je));
|
|
662
672
|
}
|
|
663
|
-
}),
|
|
673
|
+
}), Xe = /* @__PURE__ */ ee(Ke, [["__scopeId", "data-v-734dde49"]]), Ye = ["id", "value", "aria-labelledby", "aria-invalid", "aria-required", "aria-describedby", "aria-expanded", "aria-controls", "aria-activedescendant", "disabled", "placeholder"], Qe = ["aria-label", "disabled"], Ze = ["aria-label", "disabled"], _e = ["id"], ea = ["id", "aria-label", "aria-busy", "aria-multiselectable"], aa = ["id", "aria-selected", "disabled", "onPointermove", "onClick"], ta = {
|
|
664
674
|
key: 0,
|
|
665
675
|
"aria-hidden": "true",
|
|
666
676
|
class: "mrp-option-check"
|
|
667
|
-
},
|
|
677
|
+
}, la = { key: 0 }, na = {
|
|
668
678
|
key: 0,
|
|
669
679
|
role: "status"
|
|
670
|
-
},
|
|
680
|
+
}, ia = /* @__PURE__ */ _({
|
|
671
681
|
__name: "ReportRemoteParamSelect",
|
|
672
682
|
props: {
|
|
673
683
|
def: {},
|
|
@@ -681,22 +691,22 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
681
691
|
},
|
|
682
692
|
emits: ["change"],
|
|
683
693
|
setup(e, { emit: t }) {
|
|
684
|
-
const l = e, n = t, r =
|
|
694
|
+
const l = e, n = t, r = Me({ focusOnOpen: !1 }), { root: c, panel: g, opened: o } = r, d = pe({ def: () => l.def, values: () => l.values, loader: () => l.loadOptions, opened: () => o.value, disabled: () => l.disabled === !0 }), { query: x, options: y, loading: u, failed: h, waiting: b, missingLoader: R } = d, A = S(() => ({ ...ae, ...l.messages })), k = S(() => l.def.type === "multiSelect"), D = S(() => k.value ? Pe(l.value) ?? [] : [l.value]), i = S(() => l.def.optionsSource ? y.value : (l.def.options ?? []).filter((v) => `${v.label} ${v.value}`.toLocaleLowerCase().includes(x.value.toLocaleLowerCase())).slice(0, 100)), p = /* @__PURE__ */ new Map(), a = S(() => k.value ? D.value.map((v) => p.get(v) ?? l.def.options?.find((C) => C.value === v)?.label ?? v).join("、") : E.value || l.value), s = M(0), E = M(""), P = M(), N = S(() => `${l.id}-options`), T = S(() => b.value ? A.value.paramOptionsDependencies : l.def.optionsSource && R.value ? A.value.paramOptionsMissingLoader : h.value ? A.value.paramOptionsFailed : u.value ? A.value.paramOptionsLoading : i.value.length ? "" : A.value.paramOptionsEmpty);
|
|
685
695
|
I(() => l.value, () => {
|
|
686
696
|
E.value = "";
|
|
687
697
|
}), I(i, () => {
|
|
688
|
-
|
|
698
|
+
s.value = 0;
|
|
689
699
|
}), I(() => [l.def.field, l.def.optionsSource, JSON.stringify(l.def.options)], () => {
|
|
690
700
|
p.clear(), E.value = "";
|
|
691
|
-
}), I(
|
|
701
|
+
}), I(o, (v) => {
|
|
692
702
|
v && V(() => P.value?.focus());
|
|
693
703
|
});
|
|
694
704
|
function te(v) {
|
|
695
705
|
if (!(l.disabled || b.value || u.value || h.value)) {
|
|
696
706
|
p.set(v.value, v.label);
|
|
697
|
-
for (const C of p.keys()) C !== v.value &&
|
|
698
|
-
if (
|
|
699
|
-
const C =
|
|
707
|
+
for (const C of p.keys()) C !== v.value && !D.value.includes(C) && p.delete(C);
|
|
708
|
+
if (k.value) {
|
|
709
|
+
const C = D.value.includes(v.value) ? D.value.filter((F) => F !== v.value) : [...D.value, v.value];
|
|
700
710
|
if (C.length > Math.min(l.def.maxItems ?? 100, 100)) return;
|
|
701
711
|
n("change", C.length ? Oe(C) : "");
|
|
702
712
|
} else
|
|
@@ -707,35 +717,35 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
707
717
|
}
|
|
708
718
|
}
|
|
709
719
|
function le(v) {
|
|
710
|
-
v.isComposing || (
|
|
720
|
+
v.isComposing || (o.value = !0, x.value = v.target.value);
|
|
711
721
|
}
|
|
712
722
|
function z() {
|
|
713
|
-
!l.disabled && !b.value && (!l.def.optionsSource || !R.value) && (x.value = "",
|
|
723
|
+
!l.disabled && !b.value && (!l.def.optionsSource || !R.value) && (x.value = "", o.value = !0);
|
|
714
724
|
}
|
|
715
725
|
function ve(v) {
|
|
716
726
|
if (!(v.isComposing || v.keyCode === 229)) {
|
|
717
727
|
if (v.key === "Escape") {
|
|
718
|
-
|
|
728
|
+
o.value && (v.preventDefault(), v.stopPropagation(), r.close());
|
|
719
729
|
return;
|
|
720
730
|
}
|
|
721
731
|
if (["ArrowUp", "ArrowDown", "Enter"].includes(v.key)) {
|
|
722
|
-
if (v.preventDefault(), v.stopPropagation(), !
|
|
732
|
+
if (v.preventDefault(), v.stopPropagation(), !o.value) {
|
|
723
733
|
z();
|
|
724
734
|
return;
|
|
725
735
|
}
|
|
726
736
|
if (v.key === "Enter") {
|
|
727
|
-
const C = i.value[
|
|
737
|
+
const C = i.value[s.value];
|
|
728
738
|
C && te(C);
|
|
729
739
|
return;
|
|
730
740
|
}
|
|
731
|
-
i.value.length && (
|
|
741
|
+
i.value.length && (s.value = (s.value + (v.key === "ArrowDown" ? 1 : -1) + i.value.length) % i.value.length, V(() => g.value?.querySelector(`[id="${N.value}-${s.value}"]`)?.scrollIntoView?.({ block: "nearest" })));
|
|
732
742
|
}
|
|
733
743
|
}
|
|
734
744
|
}
|
|
735
|
-
function
|
|
745
|
+
function me() {
|
|
736
746
|
l.disabled || (n("change", ""), E.value = "", r.close());
|
|
737
747
|
}
|
|
738
|
-
return (v, C) => (f(),
|
|
748
|
+
return (v, C) => (f(), m("div", {
|
|
739
749
|
ref_key: "root",
|
|
740
750
|
ref: c,
|
|
741
751
|
class: "mrp-remote-param"
|
|
@@ -754,56 +764,56 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
754
764
|
type: "text",
|
|
755
765
|
role: "combobox",
|
|
756
766
|
autocomplete: "off",
|
|
757
|
-
value: w(
|
|
767
|
+
value: w(o) ? w(x) : a.value,
|
|
758
768
|
maxlength: 256,
|
|
759
769
|
"aria-labelledby": `${e.id}-label`,
|
|
760
770
|
"aria-invalid": e.invalid || void 0,
|
|
761
771
|
"aria-required": e.def.required || void 0,
|
|
762
772
|
"aria-describedby": e.invalid ? `${e.id}-error` : w(b) || e.def.optionsSource && w(R) ? `${e.id}-remote-status` : void 0,
|
|
763
773
|
"aria-autocomplete": "list",
|
|
764
|
-
"aria-expanded": w(
|
|
765
|
-
"aria-controls": w(
|
|
766
|
-
"aria-activedescendant": w(
|
|
774
|
+
"aria-expanded": w(o),
|
|
775
|
+
"aria-controls": w(o) ? N.value : void 0,
|
|
776
|
+
"aria-activedescendant": w(o) && i.value.length ? `${N.value}-${s.value}` : void 0,
|
|
767
777
|
disabled: e.disabled || w(b) || !!e.def.optionsSource && w(R),
|
|
768
778
|
placeholder: e.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", e.def.label ?? e.def.field),
|
|
769
779
|
onClick: z,
|
|
770
780
|
onInput: le,
|
|
771
781
|
onCompositionend: le,
|
|
772
782
|
onKeydown: ve
|
|
773
|
-
}, null, 40,
|
|
774
|
-
e.value ? (f(),
|
|
783
|
+
}, null, 40, Ye),
|
|
784
|
+
e.value ? (f(), m("button", {
|
|
775
785
|
key: 0,
|
|
776
786
|
type: "button",
|
|
777
787
|
"aria-label": A.value.paramOptionsClear,
|
|
778
788
|
disabled: e.disabled,
|
|
779
|
-
onClick:
|
|
789
|
+
onClick: me
|
|
780
790
|
}, [
|
|
781
791
|
W(X, {
|
|
782
792
|
name: "close",
|
|
783
793
|
size: 12
|
|
784
794
|
})
|
|
785
|
-
], 8,
|
|
795
|
+
], 8, Qe)) : (f(), m("button", {
|
|
786
796
|
key: 1,
|
|
787
797
|
type: "button",
|
|
788
798
|
"aria-label": e.def.label ?? e.def.field,
|
|
789
799
|
disabled: e.disabled || w(b) || !!e.def.optionsSource && w(R),
|
|
790
|
-
onClick: C[0] || (C[0] = (F) => w(
|
|
800
|
+
onClick: C[0] || (C[0] = (F) => w(o) ? w(r).close() : z())
|
|
791
801
|
}, [
|
|
792
802
|
W(X, {
|
|
793
803
|
name: "chevron-down",
|
|
794
804
|
size: 12
|
|
795
805
|
})
|
|
796
|
-
], 8,
|
|
806
|
+
], 8, Ze))
|
|
797
807
|
], 2),
|
|
798
|
-
w(b) || e.def.optionsSource && w(R) ? (f(),
|
|
808
|
+
w(b) || e.def.optionsSource && w(R) ? (f(), m("small", {
|
|
799
809
|
key: 0,
|
|
800
810
|
id: `${e.id}-remote-status`,
|
|
801
811
|
role: "status"
|
|
802
|
-
}, O(T.value), 9,
|
|
803
|
-
w(
|
|
812
|
+
}, O(T.value), 9, _e)) : $("", !0),
|
|
813
|
+
w(o) ? (f(), m("div", {
|
|
804
814
|
key: 1,
|
|
805
815
|
ref_key: "panel",
|
|
806
|
-
ref:
|
|
816
|
+
ref: g,
|
|
807
817
|
class: "mrp-remote-options"
|
|
808
818
|
}, [
|
|
809
819
|
L("div", {
|
|
@@ -811,52 +821,52 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
811
821
|
role: "listbox",
|
|
812
822
|
"aria-label": e.def.label ?? e.def.field,
|
|
813
823
|
"aria-busy": w(u),
|
|
814
|
-
"aria-multiselectable":
|
|
824
|
+
"aria-multiselectable": k.value || void 0
|
|
815
825
|
}, [
|
|
816
|
-
(f(!0),
|
|
826
|
+
(f(!0), m(U, null, H(i.value, (F, J) => (f(), m("button", {
|
|
817
827
|
id: `${N.value}-${J}`,
|
|
818
828
|
key: F.value,
|
|
819
829
|
type: "button",
|
|
820
830
|
role: "option",
|
|
821
831
|
tabindex: "-1",
|
|
822
|
-
"aria-selected":
|
|
823
|
-
class: Y({ active: J ===
|
|
832
|
+
"aria-selected": D.value.includes(F.value),
|
|
833
|
+
class: Y({ active: J === s.value }),
|
|
824
834
|
disabled: w(u),
|
|
825
|
-
onPointermove: (
|
|
835
|
+
onPointermove: (ge) => s.value = J,
|
|
826
836
|
onMousedown: C[1] || (C[1] = we(() => {
|
|
827
837
|
}, ["prevent"])),
|
|
828
|
-
onClick: (
|
|
838
|
+
onClick: (ge) => te(F)
|
|
829
839
|
}, [
|
|
830
840
|
L("span", null, [
|
|
831
|
-
|
|
841
|
+
k.value ? (f(), m("span", ta, O(D.value.includes(F.value) ? "✓" : ""), 1)) : $("", !0),
|
|
832
842
|
G(O(F.label), 1)
|
|
833
843
|
]),
|
|
834
|
-
F.label !== F.value ? (f(),
|
|
835
|
-
], 42,
|
|
836
|
-
], 8,
|
|
837
|
-
T.value ? (f(),
|
|
844
|
+
F.label !== F.value ? (f(), m("small", la, O(F.value), 1)) : $("", !0)
|
|
845
|
+
], 42, aa))), 128))
|
|
846
|
+
], 8, ea),
|
|
847
|
+
T.value ? (f(), m("p", na, [
|
|
838
848
|
G(O(T.value), 1),
|
|
839
|
-
w(h) ? (f(),
|
|
849
|
+
w(h) ? (f(), m("button", {
|
|
840
850
|
key: 0,
|
|
841
851
|
type: "button",
|
|
842
852
|
onClick: C[2] || (C[2] = //@ts-ignore
|
|
843
853
|
(...F) => w(d).request && w(d).request(...F))
|
|
844
|
-
}, O(e.messages.retry), 1)) :
|
|
845
|
-
])) :
|
|
846
|
-
], 512)) :
|
|
854
|
+
}, O(e.messages.retry), 1)) : $("", !0)
|
|
855
|
+
])) : $("", !0)
|
|
856
|
+
], 512)) : $("", !0)
|
|
847
857
|
], 512));
|
|
848
858
|
}
|
|
849
|
-
}),
|
|
859
|
+
}), ra = /* @__PURE__ */ ee(ia, [["__scopeId", "data-v-6ad41cf4"]]), oa = {
|
|
850
860
|
key: 0,
|
|
851
861
|
class: "mrp-params-title"
|
|
852
|
-
}, sa = { class: "mrp-params-grid" },
|
|
862
|
+
}, sa = { class: "mrp-params-grid" }, da = ["id"], ua = {
|
|
853
863
|
key: 0,
|
|
854
864
|
class: "mrp-param-star",
|
|
855
865
|
"aria-hidden": "true"
|
|
856
|
-
},
|
|
866
|
+
}, ca = ["value", "disabled", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onChange"], fa = ["disabled", "hidden"], pa = ["value"], va = ["aria-labelledby"], ma = ["type", "step", "value", "disabled", "min", "max", "aria-label", "aria-invalid", "aria-describedby", "aria-required", "onInput"], ga = ["type", "inputmode", "maxlength", "placeholder", "value", "disabled", "min", "max", "step", "aria-labelledby", "aria-invalid", "aria-describedby", "aria-required", "onInput"], ba = ["id"], ya = {
|
|
857
867
|
key: 1,
|
|
858
868
|
class: "mrp-params-actions"
|
|
859
|
-
},
|
|
869
|
+
}, ha = ["disabled"], wa = ["disabled"], Sa = /* @__PURE__ */ _({
|
|
860
870
|
__name: "ReportParamPanel",
|
|
861
871
|
props: {
|
|
862
872
|
defs: {},
|
|
@@ -871,17 +881,17 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
871
881
|
},
|
|
872
882
|
emits: ["update:modelValue", "query", "reset"],
|
|
873
883
|
setup(e, { expose: t, emit: l }) {
|
|
874
|
-
const n = e, r = l, c =
|
|
884
|
+
const n = e, r = l, c = M({ ...n.modelValue }), g = M(null), o = Ne();
|
|
875
885
|
I(
|
|
876
886
|
() => n.modelValue,
|
|
877
887
|
(i) => {
|
|
878
888
|
c.value = { ...i };
|
|
879
889
|
}
|
|
880
890
|
);
|
|
881
|
-
const d = S(() => n.issues ??
|
|
891
|
+
const d = S(() => n.issues ?? se(n.defs, c.value).issues), x = S(
|
|
882
892
|
() => (Array.isArray(n.defs) ? n.defs : []).filter((i) => i && typeof i.field == "string").map((i, p) => ({
|
|
883
893
|
def: i,
|
|
884
|
-
id: `${
|
|
894
|
+
id: `${o}-${p}`,
|
|
885
895
|
label: i.label ?? i.field,
|
|
886
896
|
value: c.value[i.field] ?? "",
|
|
887
897
|
error: n.attempted ? d.value.find((a) => a.field === i.field) : void 0
|
|
@@ -889,17 +899,17 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
889
899
|
), y = S(() => {
|
|
890
900
|
const i = /* @__PURE__ */ new Map();
|
|
891
901
|
for (const p of n.defs) for (const a of Array.isArray(p.dependsOn) ? p.dependsOn : []) {
|
|
892
|
-
const
|
|
893
|
-
|
|
902
|
+
const s = i.get(a) ?? [];
|
|
903
|
+
s.push(p.field), i.set(a, s);
|
|
894
904
|
}
|
|
895
905
|
return i;
|
|
896
906
|
});
|
|
897
907
|
function u(i, p) {
|
|
898
908
|
if (n.disabled || c.value[i] === p) return;
|
|
899
909
|
c.value = { ...c.value, [i]: p };
|
|
900
|
-
const a = /* @__PURE__ */ new Set([i]),
|
|
901
|
-
for (let E = 0; E <
|
|
902
|
-
a.has(P) || (c.value[P] = "", a.add(P),
|
|
910
|
+
const a = /* @__PURE__ */ new Set([i]), s = [i];
|
|
911
|
+
for (let E = 0; E < s.length; E++) for (const P of y.value.get(s[E]) ?? [])
|
|
912
|
+
a.has(P) || (c.value[P] = "", a.add(P), s.push(P));
|
|
903
913
|
r("update:modelValue", { ...c.value });
|
|
904
914
|
}
|
|
905
915
|
function h(i) {
|
|
@@ -908,8 +918,8 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
908
918
|
function b(i, p, a = !1) {
|
|
909
919
|
if (!a) return i.split("/")[p] ?? "";
|
|
910
920
|
try {
|
|
911
|
-
const
|
|
912
|
-
return Array.isArray(
|
|
921
|
+
const s = JSON.parse(i);
|
|
922
|
+
return Array.isArray(s) && (typeof s[p] == "number" || typeof s[p] == "string") ? String(s[p]) : "";
|
|
913
923
|
} catch {
|
|
914
924
|
return "";
|
|
915
925
|
}
|
|
@@ -918,25 +928,25 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
918
928
|
return a ? !!b(i, 0) != !!b(i, 1) ? !b(i, p) || void 0 : !0 : void 0;
|
|
919
929
|
}
|
|
920
930
|
function A(i, p, a) {
|
|
921
|
-
const
|
|
931
|
+
const s = i.type === "numberRange", E = c.value[i.field] ?? "", P = [b(E, 0, s), b(E, 1, s)];
|
|
922
932
|
P[p] = a;
|
|
923
|
-
const N =
|
|
933
|
+
const N = s ? JSON.stringify(P.map((T) => T === "" ? null : Number(T))) : P.join("/");
|
|
924
934
|
u(i.field, P.every((T) => !T) ? "" : N);
|
|
925
935
|
}
|
|
926
|
-
function
|
|
936
|
+
function k(i) {
|
|
927
937
|
i.isComposing || r("query");
|
|
928
938
|
}
|
|
929
|
-
function
|
|
930
|
-
|
|
939
|
+
function D() {
|
|
940
|
+
g.value?.querySelector('[aria-invalid="true"]')?.focus();
|
|
931
941
|
}
|
|
932
|
-
return t({ focusInvalid:
|
|
942
|
+
return t({ focusInvalid: D }), (i, p) => (f(), m("div", {
|
|
933
943
|
ref_key: "root",
|
|
934
|
-
ref:
|
|
944
|
+
ref: g,
|
|
935
945
|
class: "mrp-params"
|
|
936
946
|
}, [
|
|
937
|
-
e.showTitle !== !1 ? (f(),
|
|
947
|
+
e.showTitle !== !1 ? (f(), m("span", oa, O(e.messages.paramsTitle), 1)) : $("", !0),
|
|
938
948
|
L("div", sa, [
|
|
939
|
-
(f(!0),
|
|
949
|
+
(f(!0), m(U, null, H(x.value, (a) => (f(), m("label", {
|
|
940
950
|
key: a.id,
|
|
941
951
|
class: Y(["mrp-param", { "mrp-param-missing": !!a.error }])
|
|
942
952
|
}, [
|
|
@@ -945,9 +955,9 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
945
955
|
class: "mrp-param-label"
|
|
946
956
|
}, [
|
|
947
957
|
G(O(a.label), 1),
|
|
948
|
-
a.def.required ? (f(),
|
|
949
|
-
], 8,
|
|
950
|
-
a.def.type === "cascader" ? (f(), ne(
|
|
958
|
+
a.def.required ? (f(), m("i", ua, "*")) : $("", !0)
|
|
959
|
+
], 8, da),
|
|
960
|
+
a.def.type === "cascader" ? (f(), ne(Xe, {
|
|
951
961
|
key: 0,
|
|
952
962
|
id: a.id,
|
|
953
963
|
def: a.def,
|
|
@@ -957,8 +967,8 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
957
967
|
messages: e.messages,
|
|
958
968
|
disabled: e.disabled,
|
|
959
969
|
invalid: !!a.error,
|
|
960
|
-
onChange: (
|
|
961
|
-
}, null, 8, ["id", "def", "value", "values", "load-options", "messages", "disabled", "invalid", "onChange"])) : a.def.optionsSource || a.def.type === "multiSelect" ? (f(), ne(
|
|
970
|
+
onChange: (s) => u(a.def.field, s)
|
|
971
|
+
}, null, 8, ["id", "def", "value", "values", "load-options", "messages", "disabled", "invalid", "onChange"])) : a.def.optionsSource || a.def.type === "multiSelect" ? (f(), ne(ra, {
|
|
962
972
|
key: 1,
|
|
963
973
|
id: a.id,
|
|
964
974
|
def: a.def,
|
|
@@ -968,8 +978,8 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
968
978
|
messages: e.messages,
|
|
969
979
|
disabled: e.disabled,
|
|
970
980
|
invalid: !!a.error,
|
|
971
|
-
onChange: (
|
|
972
|
-
}, null, 8, ["id", "def", "value", "values", "load-options", "messages", "disabled", "invalid", "onChange"])) : (a.def.type ?? "text") === "select" ? (f(),
|
|
981
|
+
onChange: (s) => u(a.def.field, s)
|
|
982
|
+
}, null, 8, ["id", "def", "value", "values", "load-options", "messages", "disabled", "invalid", "onChange"])) : (a.def.type ?? "text") === "select" ? (f(), m("select", {
|
|
973
983
|
key: 2,
|
|
974
984
|
class: "mrp-param-input",
|
|
975
985
|
value: a.value,
|
|
@@ -978,25 +988,25 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
978
988
|
"aria-invalid": a.error ? !0 : void 0,
|
|
979
989
|
"aria-describedby": a.error ? `${a.id}-error` : void 0,
|
|
980
990
|
"aria-required": a.def.required || void 0,
|
|
981
|
-
onChange: (
|
|
982
|
-
onKeydown: K(
|
|
991
|
+
onChange: (s) => u(a.def.field, s.target.value),
|
|
992
|
+
onKeydown: K(k, ["enter"])
|
|
983
993
|
}, [
|
|
984
994
|
L("option", {
|
|
985
995
|
value: "",
|
|
986
996
|
disabled: a.def.required,
|
|
987
997
|
hidden: a.def.required
|
|
988
|
-
}, O(a.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", a.label)), 9,
|
|
989
|
-
(f(!0),
|
|
990
|
-
key:
|
|
991
|
-
value:
|
|
992
|
-
}, O(
|
|
993
|
-
], 40,
|
|
998
|
+
}, O(a.def.placeholder ?? (e.messages.paramSelectPlaceholder ?? "请选择{label}").replace("{label}", a.label)), 9, fa),
|
|
999
|
+
(f(!0), m(U, null, H(a.def.options ?? [], (s) => (f(), m("option", {
|
|
1000
|
+
key: s.value,
|
|
1001
|
+
value: s.value
|
|
1002
|
+
}, O(s.label), 9, pa))), 128))
|
|
1003
|
+
], 40, ca)) : a.def.type === "dateRange" || a.def.type === "numberRange" ? (f(), m("div", {
|
|
994
1004
|
key: 3,
|
|
995
1005
|
class: "mrp-param-range",
|
|
996
1006
|
role: "group",
|
|
997
1007
|
"aria-labelledby": `${a.id}-label`
|
|
998
1008
|
}, [
|
|
999
|
-
(f(!0),
|
|
1009
|
+
(f(!0), m(U, null, H(a.def.type === "numberRange" ? [e.messages.paramNumberRangeStart ?? "最小值", e.messages.paramNumberRangeEnd ?? "最大值"] : [e.messages.paramRangeStart ?? "开始日期", e.messages.paramRangeEnd ?? "结束日期"], (s, E) => (f(), m("input", {
|
|
1000
1010
|
key: E,
|
|
1001
1011
|
class: "mrp-param-input",
|
|
1002
1012
|
type: a.def.type === "numberRange" ? "number" : "date",
|
|
@@ -1005,14 +1015,14 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
1005
1015
|
disabled: e.disabled,
|
|
1006
1016
|
min: a.def.min,
|
|
1007
1017
|
max: a.def.max,
|
|
1008
|
-
"aria-label": `${a.label} · ${
|
|
1018
|
+
"aria-label": `${a.label} · ${s}`,
|
|
1009
1019
|
"aria-invalid": a.def.type === "numberRange" ? !!a.error || void 0 : R(a.value, E, a.error),
|
|
1010
1020
|
"aria-describedby": a.error ? `${a.id}-error` : void 0,
|
|
1011
1021
|
"aria-required": a.def.required || void 0,
|
|
1012
1022
|
onInput: (P) => A(a.def, E, P.target.value),
|
|
1013
|
-
onKeydown: K(
|
|
1014
|
-
}, null, 40,
|
|
1015
|
-
], 8,
|
|
1023
|
+
onKeydown: K(k, ["enter"])
|
|
1024
|
+
}, null, 40, ma))), 128))
|
|
1025
|
+
], 8, va)) : (f(), m("input", {
|
|
1016
1026
|
key: 4,
|
|
1017
1027
|
class: "mrp-param-input",
|
|
1018
1028
|
type: h(a.def),
|
|
@@ -1028,57 +1038,58 @@ const Ve = ["aria-labelledby"], je = ["value", "disabled", "aria-label", "aria-i
|
|
|
1028
1038
|
"aria-invalid": a.error ? !0 : void 0,
|
|
1029
1039
|
"aria-describedby": a.error ? `${a.id}-error` : void 0,
|
|
1030
1040
|
"aria-required": a.def.required || void 0,
|
|
1031
|
-
onInput: (
|
|
1032
|
-
onKeydown: K(
|
|
1041
|
+
onInput: (s) => u(a.def.field, s.target.value),
|
|
1042
|
+
onKeydown: K(k, ["enter"])
|
|
1033
1043
|
}, null, 40, ga)),
|
|
1034
|
-
a.error ? (f(),
|
|
1044
|
+
a.error ? (f(), m("small", {
|
|
1035
1045
|
key: 5,
|
|
1036
1046
|
id: `${a.id}-error`,
|
|
1037
1047
|
class: "mrp-param-error",
|
|
1038
1048
|
role: "status"
|
|
1039
|
-
}, O(w(fe)(a.error, e.defs, e.messages)), 9,
|
|
1049
|
+
}, O(w(fe)(a.error, e.defs, e.messages)), 9, ba)) : $("", !0)
|
|
1040
1050
|
], 2))), 128))
|
|
1041
1051
|
]),
|
|
1042
|
-
e.showActions !== !1 ? (f(),
|
|
1052
|
+
e.showActions !== !1 ? (f(), m("div", ya, [
|
|
1043
1053
|
L("button", {
|
|
1044
1054
|
class: "mrp-nav mrp-param-query",
|
|
1045
1055
|
type: "button",
|
|
1046
1056
|
disabled: e.disabled,
|
|
1047
1057
|
onClick: p[0] || (p[0] = (a) => i.$emit("query"))
|
|
1048
|
-
}, O(e.messages.query), 9,
|
|
1058
|
+
}, O(e.messages.query), 9, ha),
|
|
1049
1059
|
L("button", {
|
|
1050
1060
|
class: "mrp-nav",
|
|
1051
1061
|
type: "button",
|
|
1052
1062
|
disabled: e.disabled,
|
|
1053
1063
|
onClick: p[1] || (p[1] = (a) => i.$emit("reset"))
|
|
1054
|
-
}, O(e.messages.reset), 9,
|
|
1055
|
-
])) :
|
|
1064
|
+
}, O(e.messages.reset), 9, wa)
|
|
1065
|
+
])) : $("", !0)
|
|
1056
1066
|
], 512));
|
|
1057
1067
|
}
|
|
1058
|
-
}),
|
|
1068
|
+
}), Ha = /* @__PURE__ */ ee(Sa, [["__scopeId", "data-v-bad4d7de"]]);
|
|
1059
1069
|
export {
|
|
1060
|
-
|
|
1070
|
+
ke as D,
|
|
1061
1071
|
B as M,
|
|
1062
1072
|
ae as P,
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1073
|
+
Ha as R,
|
|
1074
|
+
La as S,
|
|
1075
|
+
ce as a,
|
|
1076
|
+
ue as b,
|
|
1077
|
+
Fe as c,
|
|
1078
|
+
xe as d,
|
|
1079
|
+
De as e,
|
|
1080
|
+
$e as f,
|
|
1081
|
+
Ia as g,
|
|
1082
|
+
Na as h,
|
|
1083
|
+
$a as i,
|
|
1084
|
+
Da as j,
|
|
1085
|
+
Ma as k,
|
|
1086
|
+
Me as l,
|
|
1087
|
+
Fa as m,
|
|
1078
1088
|
ka as n,
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1089
|
+
Ua as o,
|
|
1090
|
+
Aa as p,
|
|
1091
|
+
Ta as r,
|
|
1092
|
+
xa as s,
|
|
1093
|
+
qa as t,
|
|
1094
|
+
Ba as u
|
|
1084
1095
|
};
|