@ovalbee/reportifact 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Chart-Cmh3H_Wv.js +5634 -0
- package/dist/Chart-jF5jqxGZ.cjs +1 -0
- package/dist/ImageGallery-CPZM1tc_.cjs +1 -0
- package/dist/ImageGallery-DQzba-4p.js +163 -0
- package/dist/MetricCallout-C7SUQTrj.js +39 -0
- package/dist/MetricCallout-CxhVOiqg.cjs +1 -0
- package/dist/MetricCards-DW-_QLhI.cjs +1 -0
- package/dist/MetricCards-JR4hUW4_.js +61 -0
- package/dist/MetricsTable-CH8vIbWG.cjs +1 -0
- package/dist/MetricsTable-OXsVygq0.js +98 -0
- package/dist/Reportifact.vue.d.ts +3 -2
- package/dist/ReportifactWidgetHost-DIlz4TxO.js +13 -0
- package/dist/ReportifactWidgetHost-xDT1ykZc.cjs +1 -0
- package/dist/Timeline-DSGSvRjj.js +295 -0
- package/dist/Timeline-P3CpGmBD.cjs +1 -0
- package/dist/WidgetWrapper-AmnP99H8.js +62 -0
- package/dist/WidgetWrapper-C0lc1m0V.cjs +1 -0
- package/dist/components/TableOfContents.vue.d.ts +3 -4
- package/dist/dist-DBIuOmpr.cjs +27 -0
- package/dist/dist-DEKe39T1.js +23629 -0
- package/dist/markdownTable-BCLRoyPL.cjs +2 -0
- package/dist/markdownTable-DHdS_81b.js +40 -0
- package/dist/middleware.cjs +1 -1
- package/dist/middleware.js +146 -175
- package/dist/portable/ReportifactWidgetHost.vue.d.ts +7 -11
- package/dist/portable/usePortableSource.d.ts +18 -0
- package/dist/reportifact.cjs +63 -64
- package/dist/reportifact.d.ts +1 -1
- package/dist/reportifact.js +4909 -5228
- package/dist/rolldown-runtime-DF3sbh8G.cjs +1 -0
- package/dist/style.css +2 -13
- package/dist/usePortableSource--y_qMDXB.js +55 -0
- package/dist/usePortableSource-CN5URH4d.cjs +1 -0
- package/dist/utils/tfeventsParser.cjs +1 -1
- package/dist/utils/tfeventsParser.js +298 -327
- package/dist/widgets/Card.vue.d.ts +2 -1
- package/dist/widgets/Chart.vue.d.ts +9 -14
- package/dist/widgets/HelpTooltip.vue.d.ts +2 -1
- package/dist/widgets/ImageGallery.vue.d.ts +9 -15
- package/dist/widgets/Markdown.vue.d.ts +3 -2
- package/dist/widgets/MetricCallout.vue.d.ts +7 -13
- package/dist/widgets/MetricCards.vue.d.ts +7 -10
- package/dist/widgets/MetricTable.vue.d.ts +2 -1
- package/dist/widgets/MetricsTable.vue.d.ts +9 -14
- package/dist/widgets/ModelClassComparison.vue.d.ts +3 -2
- package/dist/widgets/ModelComparisonGallery.vue.d.ts +3 -2
- package/dist/widgets/Notice.vue.d.ts +2 -1
- package/dist/widgets/ReportifactWidget.vue.d.ts +3 -4
- package/dist/widgets/Scope.vue.d.ts +2 -3
- package/dist/widgets/Table.vue.d.ts +3 -2
- package/dist/widgets/Tensorboard.vue.d.ts +3 -2
- package/dist/widgets/Timeline.vue.d.ts +9 -14
- package/dist/widgets/WidgetWrapper.vue.d.ts +18 -20
- package/dist/widgets/chart-config/range.d.ts +2 -0
- package/dist/widgets/chart-config/shared.d.ts +25 -0
- package/dist/widgets/chart-config/types.d.ts +12 -3
- package/dist/widgets/chart.cjs +1 -1
- package/dist/widgets/chart.d.ts +3 -3
- package/dist/widgets/chart.js +2 -5
- package/dist/widgets/chartSizing.d.ts +10 -0
- package/dist/widgets/contracts.cjs +1 -1
- package/dist/widgets/contracts.d.ts +1 -1
- package/dist/widgets/contracts.js +0 -1
- package/dist/widgets/host.cjs +1 -1
- package/dist/widgets/host.d.ts +3 -3
- package/dist/widgets/host.js +2 -5
- package/dist/widgets/image-gallery.cjs +1 -1
- package/dist/widgets/image-gallery.d.ts +3 -3
- package/dist/widgets/image-gallery.js +2 -5
- package/dist/widgets/markdownTable.d.ts +1 -1
- package/dist/widgets/metric-callout.cjs +1 -1
- package/dist/widgets/metric-callout.d.ts +3 -3
- package/dist/widgets/metric-callout.js +2 -5
- package/dist/widgets/metric-cards.cjs +1 -1
- package/dist/widgets/metric-cards.d.ts +3 -3
- package/dist/widgets/metric-cards.js +2 -5
- package/dist/widgets/metrics-table.cjs +1 -1
- package/dist/widgets/metrics-table.d.ts +3 -3
- package/dist/widgets/metrics-table.js +2 -5
- package/dist/widgets/timeline.cjs +1 -1
- package/dist/widgets/timeline.d.ts +3 -3
- package/dist/widgets/timeline.js +2 -5
- package/package.json +5 -5
- package/dist/Chart.vue_vue_type_style_index_0_lang-Bxrsp8Oz.js +0 -5956
- package/dist/Chart.vue_vue_type_style_index_0_lang-mN1IaQ_U.cjs +0 -1
- package/dist/ImageGallery.vue_vue_type_style_index_0_lang-Ak_OUL_c.js +0 -197
- package/dist/ImageGallery.vue_vue_type_style_index_0_lang-Ch0UPxhs.cjs +0 -1
- package/dist/MetricCallout.vue_vue_type_style_index_0_lang-ANFFq7CE.js +0 -62
- package/dist/MetricCallout.vue_vue_type_style_index_0_lang-CT9lFI28.cjs +0 -1
- package/dist/MetricCards.vue_vue_type_style_index_0_lang-1hn2BMbU.js +0 -46
- package/dist/MetricCards.vue_vue_type_style_index_0_lang-BDU7pisC.cjs +0 -1
- package/dist/MetricsTable.vue_vue_type_style_index_0_lang-BfxK3vcz.js +0 -140
- package/dist/MetricsTable.vue_vue_type_style_index_0_lang-CS7xiHRk.cjs +0 -1
- package/dist/ReportifactWidgetHost-A73gQ3bT.cjs +0 -1
- package/dist/ReportifactWidgetHost-BjKBwCWI.js +0 -17
- package/dist/Timeline.vue_vue_type_style_index_0_lang-EmkZbKjQ.js +0 -2646
- package/dist/Timeline.vue_vue_type_style_index_0_lang-HOC43_F3.cjs +0 -2
- package/dist/WidgetWrapper.vue_vue_type_style_index_0_lang-BY2t_Hvs.cjs +0 -1
- package/dist/WidgetWrapper.vue_vue_type_style_index_0_lang-BbnW8GXT.js +0 -72
- package/dist/index-3DTuh2Dr.cjs +0 -47
- package/dist/index-DevYhXSC.js +0 -22104
- package/dist/markdownTable-B5207r3E.js +0 -32
- package/dist/markdownTable-Cbn1Du3L.cjs +0 -2
- package/dist/useFetch-BfOAq-Kg.cjs +0 -1
- package/dist/useFetch-CHQm_TmB.js +0 -35
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { t as e } from "./WidgetWrapper-AmnP99H8.js";
|
|
2
|
+
import { n as t, r as n, t as r } from "./markdownTable-DHdS_81b.js";
|
|
3
|
+
import { Fragment as i, computed as a, createBlock as o, createCommentVNode as s, createElementBlock as c, createElementVNode as l, defineComponent as u, normalizeClass as d, normalizeStyle as f, openBlock as p, renderList as m, toDisplayString as h, unref as g, withCtx as _ } from "vue";
|
|
4
|
+
//#region src/widgets/MetricCards.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var v = { class: "reportifact-metric-card-label" }, y = { class: "reportifact-metric-card-value" }, b = { class: "reportifact-metric-card-description" }, x = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "reportifact-metric-card-bar"
|
|
8
|
+
}, S = /* @__PURE__ */ u({
|
|
9
|
+
__name: "MetricCards",
|
|
10
|
+
props: {
|
|
11
|
+
caption: {},
|
|
12
|
+
sourceHref: {},
|
|
13
|
+
sourceLabel: {},
|
|
14
|
+
widget: {},
|
|
15
|
+
content: {},
|
|
16
|
+
data: {}
|
|
17
|
+
},
|
|
18
|
+
setup(u) {
|
|
19
|
+
let S = u, C = a(() => S.data ?? n(S.content ?? S.widget?.content ?? "")), w = a(() => String(S.widget?.options.variant ?? "") === "compact"), T = r, E = /* @__PURE__ */ new Set([
|
|
20
|
+
"low",
|
|
21
|
+
"mid",
|
|
22
|
+
"high",
|
|
23
|
+
"none"
|
|
24
|
+
]);
|
|
25
|
+
function D(e) {
|
|
26
|
+
let n = String(e.tone ?? "").trim();
|
|
27
|
+
return E.has(n) ? n : t(e.value);
|
|
28
|
+
}
|
|
29
|
+
function O(e) {
|
|
30
|
+
let t = Number(e.bar);
|
|
31
|
+
return e.bar === void 0 || e.bar === "" || !Number.isFinite(t) ? null : Math.max(0, Math.min(1, t)) * 100;
|
|
32
|
+
}
|
|
33
|
+
return (t, n) => (p(), o(e, {
|
|
34
|
+
caption: S.caption,
|
|
35
|
+
"source-href": S.sourceHref,
|
|
36
|
+
"source-label": S.sourceLabel
|
|
37
|
+
}, {
|
|
38
|
+
default: _(() => [l("div", { class: d(["reportifact-metric-cards", { "reportifact-metric-cards--compact": w.value }]) }, [(p(!0), c(i, null, m(C.value, (e) => (p(), c("article", {
|
|
39
|
+
key: e.label,
|
|
40
|
+
class: d(["reportifact-metric-card", `reportifact-metric-card--${D(e)}`])
|
|
41
|
+
}, [
|
|
42
|
+
w.value ? s("", !0) : (p(), c("span", {
|
|
43
|
+
key: 0,
|
|
44
|
+
class: "reportifact-metric-card-fill",
|
|
45
|
+
style: f({ height: `${g(T)(e.value)}%` })
|
|
46
|
+
}, null, 4)),
|
|
47
|
+
l("span", v, h(e.label), 1),
|
|
48
|
+
l("strong", y, h(e.value), 1),
|
|
49
|
+
l("p", b, h(e.description), 1),
|
|
50
|
+
O(e) === null ? s("", !0) : (p(), c("span", x, [l("span", { style: f({ width: `${O(e)}%` }) }, null, 4)]))
|
|
51
|
+
], 2))), 128))], 2)]),
|
|
52
|
+
_: 1
|
|
53
|
+
}, 8, [
|
|
54
|
+
"caption",
|
|
55
|
+
"source-href",
|
|
56
|
+
"source-label"
|
|
57
|
+
]));
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
//#endregion
|
|
61
|
+
export { S as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./usePortableSource-CN5URH4d.cjs"),t=require("./WidgetWrapper-C0lc1m0V.cjs");let n=require("vue");var r={class:`rm-skeleton`},i={class:`rm-card`},a={key:0,class:`rm-title`},o={key:0,class:`rm-empty`},s={class:`rm-name`},c={class:`rm-value`},l={class:`rm-bar-track`},u={key:0,class:`rm-pct`},d={key:2,class:`rm-table`},f=(0,n.defineComponent)({__name:`MetricsTable`,props:{caption:{},sourceHref:{},sourceLabel:{},url:{},src:{},data:{},options:{}},setup(f,{expose:p}){let m=f,h=(0,n.computed)(()=>typeof m.options?.title==`string`?m.options.title:``),g=(0,n.computed)(()=>m.options?.show_pct===!0),_=(0,n.ref)(null),{isLoading:v,sourceError:y,refresh:b}=e.t(m,e=>{_.value=e});p({refresh:b});let x=(0,n.computed)(()=>{let e=_.value;if(!e||!Array.isArray(e.rows))return!1;let t=e.rows[0];return t===void 0||typeof t==`object`&&`value`in t}),S=(0,n.computed)(()=>{let e=_.value;return!!e&&Array.isArray(e.columns)}),C=(0,n.computed)(()=>x.value?_.value.rows:[]),w=(0,n.computed)(()=>S.value?_.value.columns:[]),T=(0,n.computed)(()=>S.value?_.value.rows:[]);function E(e){return e.toFixed(3)}function D(e,t){return Math.min(100,Math.max(0,e/(t??1)*100))}return(e,f)=>((0,n.openBlock)(),(0,n.createBlock)(t.t,{loading:(0,n.unref)(v),error:(0,n.unref)(y),caption:m.caption,"source-href":m.sourceHref,"source-label":m.sourceLabel},{skeleton:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`div`,r,[((0,n.openBlock)(),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(4,e=>(0,n.createElementVNode)(`div`,{key:e,class:`rm-skeleton-row`},[...f[0]||=[(0,n.createElementVNode)(`div`,{class:`reportifact-skeleton-line`,style:{width:`80px`}},null,-1),(0,n.createElementVNode)(`div`,{class:`reportifact-skeleton-line`,style:{width:`40px`}},null,-1),(0,n.createElementVNode)(`div`,{class:`reportifact-skeleton-line`,style:{flex:`1`}},null,-1)]])),64))])]),default:(0,n.withCtx)(()=>[(0,n.createElementVNode)(`div`,i,[h.value?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,a,(0,n.toDisplayString)(h.value),1)):(0,n.createCommentVNode)(``,!0),x.value?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:1,class:(0,n.normalizeClass)([`rm-metrics`,{"rm-metrics--with-pct":g.value}])},[C.value.length===0?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,o,` Waiting for first evaluation… `)):((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,{key:1},(0,n.renderList)(C.value,e=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{key:e.name,class:`rm-row`},[(0,n.createElementVNode)(`span`,s,(0,n.toDisplayString)(e.name),1),(0,n.createElementVNode)(`span`,c,(0,n.toDisplayString)(E(e.value)),1),(0,n.createElementVNode)(`div`,l,[(0,n.createElementVNode)(`div`,{class:`rm-bar-fill`,style:(0,n.normalizeStyle)({width:D(e.value,e.max)+`%`})},null,4)]),g.value?((0,n.openBlock)(),(0,n.createElementBlock)(`span`,u,(0,n.toDisplayString)((e.value*100).toFixed(1))+`%`,1)):(0,n.createCommentVNode)(``,!0)]))),128))],2)):S.value?((0,n.openBlock)(),(0,n.createElementBlock)(`table`,d,[(0,n.createElementVNode)(`thead`,null,[(0,n.createElementVNode)(`tr`,null,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(w.value,e=>((0,n.openBlock)(),(0,n.createElementBlock)(`th`,{key:e},(0,n.toDisplayString)(e),1))),128))])]),(0,n.createElementVNode)(`tbody`,null,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(T.value,(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`tr`,{key:t},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e,(e,t)=>((0,n.openBlock)(),(0,n.createElementBlock)(`td`,{key:t},(0,n.toDisplayString)(e),1))),128))]))),128))])])):(0,n.createCommentVNode)(``,!0)])]),_:1},8,[`loading`,`error`,`caption`,`source-href`,`source-label`]))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return f}});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { t as e } from "./usePortableSource--y_qMDXB.js";
|
|
2
|
+
import { t } from "./WidgetWrapper-AmnP99H8.js";
|
|
3
|
+
import { Fragment as n, computed as r, createBlock as i, createCommentVNode as a, createElementBlock as o, createElementVNode as s, defineComponent as c, normalizeClass as l, normalizeStyle as u, openBlock as d, ref as f, renderList as p, toDisplayString as m, unref as h, withCtx as g } from "vue";
|
|
4
|
+
//#region src/widgets/MetricsTable.vue?vue&type=script&setup=true&lang.ts
|
|
5
|
+
var _ = { class: "rm-skeleton" }, v = { class: "rm-card" }, y = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "rm-title"
|
|
8
|
+
}, b = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "rm-empty"
|
|
11
|
+
}, x = { class: "rm-name" }, S = { class: "rm-value" }, C = { class: "rm-bar-track" }, w = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "rm-pct"
|
|
14
|
+
}, T = {
|
|
15
|
+
key: 2,
|
|
16
|
+
class: "rm-table"
|
|
17
|
+
}, E = /* @__PURE__ */ c({
|
|
18
|
+
__name: "MetricsTable",
|
|
19
|
+
props: {
|
|
20
|
+
caption: {},
|
|
21
|
+
sourceHref: {},
|
|
22
|
+
sourceLabel: {},
|
|
23
|
+
url: {},
|
|
24
|
+
src: {},
|
|
25
|
+
data: {},
|
|
26
|
+
options: {}
|
|
27
|
+
},
|
|
28
|
+
setup(c, { expose: E }) {
|
|
29
|
+
let D = c, O = r(() => typeof D.options?.title == "string" ? D.options.title : ""), k = r(() => D.options?.show_pct === !0), A = f(null), { isLoading: j, sourceError: M, refresh: N } = e(D, (e) => {
|
|
30
|
+
A.value = e;
|
|
31
|
+
});
|
|
32
|
+
E({ refresh: N });
|
|
33
|
+
let P = r(() => {
|
|
34
|
+
let e = A.value;
|
|
35
|
+
if (!e || !Array.isArray(e.rows)) return !1;
|
|
36
|
+
let t = e.rows[0];
|
|
37
|
+
return t === void 0 || typeof t == "object" && "value" in t;
|
|
38
|
+
}), F = r(() => {
|
|
39
|
+
let e = A.value;
|
|
40
|
+
return !!e && Array.isArray(e.columns);
|
|
41
|
+
}), I = r(() => P.value ? A.value.rows : []), L = r(() => F.value ? A.value.columns : []), R = r(() => F.value ? A.value.rows : []);
|
|
42
|
+
function z(e) {
|
|
43
|
+
return e.toFixed(3);
|
|
44
|
+
}
|
|
45
|
+
function B(e, t) {
|
|
46
|
+
return Math.min(100, Math.max(0, e / (t ?? 1) * 100));
|
|
47
|
+
}
|
|
48
|
+
return (e, r) => (d(), i(t, {
|
|
49
|
+
loading: h(j),
|
|
50
|
+
error: h(M),
|
|
51
|
+
caption: D.caption,
|
|
52
|
+
"source-href": D.sourceHref,
|
|
53
|
+
"source-label": D.sourceLabel
|
|
54
|
+
}, {
|
|
55
|
+
skeleton: g(() => [s("div", _, [(d(), o(n, null, p(4, (e) => s("div", {
|
|
56
|
+
key: e,
|
|
57
|
+
class: "rm-skeleton-row"
|
|
58
|
+
}, [...r[0] ||= [
|
|
59
|
+
s("div", {
|
|
60
|
+
class: "reportifact-skeleton-line",
|
|
61
|
+
style: { width: "80px" }
|
|
62
|
+
}, null, -1),
|
|
63
|
+
s("div", {
|
|
64
|
+
class: "reportifact-skeleton-line",
|
|
65
|
+
style: { width: "40px" }
|
|
66
|
+
}, null, -1),
|
|
67
|
+
s("div", {
|
|
68
|
+
class: "reportifact-skeleton-line",
|
|
69
|
+
style: { flex: "1" }
|
|
70
|
+
}, null, -1)
|
|
71
|
+
]])), 64))])]),
|
|
72
|
+
default: g(() => [s("div", v, [O.value ? (d(), o("div", y, m(O.value), 1)) : a("", !0), P.value ? (d(), o("div", {
|
|
73
|
+
key: 1,
|
|
74
|
+
class: l(["rm-metrics", { "rm-metrics--with-pct": k.value }])
|
|
75
|
+
}, [I.value.length === 0 ? (d(), o("div", b, " Waiting for first evaluation… ")) : (d(!0), o(n, { key: 1 }, p(I.value, (e) => (d(), o("div", {
|
|
76
|
+
key: e.name,
|
|
77
|
+
class: "rm-row"
|
|
78
|
+
}, [
|
|
79
|
+
s("span", x, m(e.name), 1),
|
|
80
|
+
s("span", S, m(z(e.value)), 1),
|
|
81
|
+
s("div", C, [s("div", {
|
|
82
|
+
class: "rm-bar-fill",
|
|
83
|
+
style: u({ width: B(e.value, e.max) + "%" })
|
|
84
|
+
}, null, 4)]),
|
|
85
|
+
k.value ? (d(), o("span", w, m((e.value * 100).toFixed(1)) + "%", 1)) : a("", !0)
|
|
86
|
+
]))), 128))], 2)) : F.value ? (d(), o("table", T, [s("thead", null, [s("tr", null, [(d(!0), o(n, null, p(L.value, (e) => (d(), o("th", { key: e }, m(e), 1))), 128))])]), s("tbody", null, [(d(!0), o(n, null, p(R.value, (e, t) => (d(), o("tr", { key: t }, [(d(!0), o(n, null, p(e, (e, t) => (d(), o("td", { key: t }, m(e), 1))), 128))]))), 128))])])) : a("", !0)])]),
|
|
87
|
+
_: 1
|
|
88
|
+
}, 8, [
|
|
89
|
+
"loading",
|
|
90
|
+
"error",
|
|
91
|
+
"caption",
|
|
92
|
+
"source-href",
|
|
93
|
+
"source-label"
|
|
94
|
+
]));
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
//#endregion
|
|
98
|
+
export { E as t };
|
|
@@ -19,7 +19,7 @@ type __VLS_Props = {
|
|
|
19
19
|
customWidgets?: ReportifactCustomWidgets;
|
|
20
20
|
};
|
|
21
21
|
declare function forceRefresh(): void;
|
|
22
|
-
declare const
|
|
22
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {
|
|
23
23
|
forceRefresh: typeof forceRefresh;
|
|
24
24
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
25
25
|
"row-click": (payload: unknown) => any;
|
|
@@ -36,5 +36,6 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
|
36
36
|
basePath: string;
|
|
37
37
|
scrollContainer: HTMLElement | null;
|
|
38
38
|
refreshInterval: number;
|
|
39
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {},
|
|
39
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
40
|
+
declare const _default: typeof __VLS_export;
|
|
40
41
|
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createElementBlock as e, openBlock as t, renderSlot as n } from "vue";
|
|
2
|
+
//#region \0plugin-vue:export-helper
|
|
3
|
+
var r = (e, t) => {
|
|
4
|
+
let n = e.__vccOpts || e;
|
|
5
|
+
for (let [e, r] of t) n[e] = r;
|
|
6
|
+
return n;
|
|
7
|
+
}, i = {}, a = { class: "reportifact reportifact-widget-host" };
|
|
8
|
+
function o(r, i) {
|
|
9
|
+
return t(), e("div", a, [n(r.$slots, "default")]);
|
|
10
|
+
}
|
|
11
|
+
var s = /*#__PURE__*/ r(i, [["render", o]]);
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as n, s as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("vue");var t=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},n={},r={class:`reportifact reportifact-widget-host`};function i(t,n){return(0,e.openBlock)(),(0,e.createElementBlock)(`div`,r,[(0,e.renderSlot)(t.$slots,`default`)])}var a=t(n,[[`render`,i]]);Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return a}});
|
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { D as e, S as t, a as n, i as r, n as i, o as a, r as o, s, t as c, xt as l } from "./dist-DEKe39T1.js";
|
|
2
|
+
import { t as ee } from "./usePortableSource--y_qMDXB.js";
|
|
3
|
+
import { t as te } from "./WidgetWrapper-AmnP99H8.js";
|
|
4
|
+
import { Fragment as u, computed as d, createBlock as f, createCommentVNode as p, createElementBlock as m, createElementVNode as h, defineComponent as g, normalizeClass as _, normalizeStyle as v, onMounted as y, onUnmounted as b, openBlock as x, ref as S, renderList as ne, toDisplayString as C, unref as w, withCtx as T } from "vue";
|
|
5
|
+
//#region src/widgets/Timeline.vue?vue&type=script&setup=true&lang.ts
|
|
6
|
+
var E = { class: "reportifact-timeline-toolbar" }, D = ["onClick"], O = "#ef4444", k = "Cuts", re = 22, A = /* @__PURE__ */ g({
|
|
7
|
+
__name: "Timeline",
|
|
8
|
+
props: {
|
|
9
|
+
caption: {},
|
|
10
|
+
sourceHref: {},
|
|
11
|
+
sourceLabel: {},
|
|
12
|
+
url: {},
|
|
13
|
+
src: {},
|
|
14
|
+
data: {},
|
|
15
|
+
options: {}
|
|
16
|
+
},
|
|
17
|
+
emits: ["row-click"],
|
|
18
|
+
setup(g, { expose: A, emit: j }) {
|
|
19
|
+
e([
|
|
20
|
+
t,
|
|
21
|
+
s,
|
|
22
|
+
r,
|
|
23
|
+
n,
|
|
24
|
+
o,
|
|
25
|
+
a,
|
|
26
|
+
i
|
|
27
|
+
]);
|
|
28
|
+
let M = [
|
|
29
|
+
"#3b82f6",
|
|
30
|
+
"#f59e0b",
|
|
31
|
+
"#10b981",
|
|
32
|
+
"#8b5cf6",
|
|
33
|
+
"#0ea5e9",
|
|
34
|
+
"#64748b",
|
|
35
|
+
"#ec4899",
|
|
36
|
+
"#14b8a6"
|
|
37
|
+
], N = [{
|
|
38
|
+
value: "seconds",
|
|
39
|
+
label: "sec"
|
|
40
|
+
}, {
|
|
41
|
+
value: "clock",
|
|
42
|
+
label: "mm:ss"
|
|
43
|
+
}], P = S(!1), F = null;
|
|
44
|
+
y(() => {
|
|
45
|
+
P.value = document.documentElement.classList.contains("dark"), F = new MutationObserver(() => {
|
|
46
|
+
P.value = document.documentElement.classList.contains("dark");
|
|
47
|
+
}), F.observe(document.documentElement, {
|
|
48
|
+
attributes: !0,
|
|
49
|
+
attributeFilter: ["class"]
|
|
50
|
+
});
|
|
51
|
+
}), b(() => {
|
|
52
|
+
F?.disconnect();
|
|
53
|
+
});
|
|
54
|
+
let I = g, L = j, R = S([]), z = S(I.options?.timeFormat === "clock" ? "clock" : "seconds"), B = I.options?.zoom === !0 || I.options?.zoom === "true";
|
|
55
|
+
function V(e) {
|
|
56
|
+
let t = Array.isArray(e) ? e : typeof e == "object" && e && "rows" in e ? e.rows : [];
|
|
57
|
+
R.value = G(t);
|
|
58
|
+
}
|
|
59
|
+
let { isLoading: H, sourceError: U, refresh: W } = ee(I, V);
|
|
60
|
+
function G(e) {
|
|
61
|
+
if (!Array.isArray(e)) return [];
|
|
62
|
+
let t = [];
|
|
63
|
+
for (let n of e) {
|
|
64
|
+
if (typeof n != "object" || !n) continue;
|
|
65
|
+
let e = n, r = Number(e.end);
|
|
66
|
+
if (typeof e.name != "string" || !Number.isFinite(r)) continue;
|
|
67
|
+
let i = Number(e.start), a = Array.isArray(e.cuts) ? e.cuts.map(Number).filter(Number.isFinite).sort((e, t) => e - t) : [];
|
|
68
|
+
t.push({
|
|
69
|
+
id: typeof e.id == "string" ? e.id : void 0,
|
|
70
|
+
name: e.name,
|
|
71
|
+
group: typeof e.group == "string" && e.group ? e.group : void 0,
|
|
72
|
+
color: typeof e.color == "string" && e.color ? e.color : void 0,
|
|
73
|
+
start: Number.isFinite(i) ? i : 0,
|
|
74
|
+
end: r,
|
|
75
|
+
cuts: a,
|
|
76
|
+
click: typeof e.click == "object" && e.click !== null ? e.click : void 0
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return t;
|
|
80
|
+
}
|
|
81
|
+
let K = d(() => `${Math.max(280, R.value.length * re + (B ? 150 : 126))}px`), q = d(() => R.value.reduce((e, t) => Math.max(e, t.end), 0));
|
|
82
|
+
function J(e, t, n) {
|
|
83
|
+
let r = Math.max(0, Math.round(e));
|
|
84
|
+
if (t === "seconds") return `${r}s`;
|
|
85
|
+
let i = Math.floor(r / 3600), a = Math.floor(r % 3600 / 60), o = r % 60, s = (e) => String(e).padStart(2, "0");
|
|
86
|
+
return n >= 3600 ? `${s(i)}:${s(a)}:${s(o)}` : `${s(a)}:${s(o)}`;
|
|
87
|
+
}
|
|
88
|
+
let Y = d(() => {
|
|
89
|
+
let e = [];
|
|
90
|
+
for (let t of R.value) {
|
|
91
|
+
let n = t.group ?? "";
|
|
92
|
+
e.includes(n) || e.push(n);
|
|
93
|
+
}
|
|
94
|
+
return e;
|
|
95
|
+
});
|
|
96
|
+
function ie(e) {
|
|
97
|
+
let t = Y.value.indexOf(e);
|
|
98
|
+
return M[Math.max(0, t) % M.length];
|
|
99
|
+
}
|
|
100
|
+
function X(e, t) {
|
|
101
|
+
return l(t, e.coordSys);
|
|
102
|
+
}
|
|
103
|
+
function Z(e) {
|
|
104
|
+
return Math.min(e.size([0, 1])[1] * .6, 14);
|
|
105
|
+
}
|
|
106
|
+
function ae(e, t) {
|
|
107
|
+
let n = t.value(0), r = t.coord([t.value(1), n]), i = t.coord([t.value(2), n]), a = Z(t), o = X(e, {
|
|
108
|
+
x: r[0],
|
|
109
|
+
y: r[1] - a / 2,
|
|
110
|
+
width: Math.max(i[0] - r[0], 1),
|
|
111
|
+
height: a
|
|
112
|
+
});
|
|
113
|
+
if (!o) return;
|
|
114
|
+
let s = R.value[n];
|
|
115
|
+
return {
|
|
116
|
+
type: "rect",
|
|
117
|
+
shape: {
|
|
118
|
+
...o,
|
|
119
|
+
r: 2
|
|
120
|
+
},
|
|
121
|
+
style: { fill: s?.color ?? t.visual("color") }
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function oe(e, t) {
|
|
125
|
+
let n = t.value(0), r = t.coord([t.value(1), n]), i = Z(t) + 4, a = X(e, {
|
|
126
|
+
x: r[0] - 1,
|
|
127
|
+
y: r[1] - i / 2,
|
|
128
|
+
width: 2,
|
|
129
|
+
height: i
|
|
130
|
+
});
|
|
131
|
+
if (a) return {
|
|
132
|
+
type: "rect",
|
|
133
|
+
shape: a,
|
|
134
|
+
style: { fill: O }
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
function Q(e) {
|
|
138
|
+
return typeof e == "object" && !!e && "rowIndex" in e;
|
|
139
|
+
}
|
|
140
|
+
function se(e, t) {
|
|
141
|
+
let n = e;
|
|
142
|
+
if (!Q(n.data)) return "";
|
|
143
|
+
let r = R.value[n.data.rowIndex];
|
|
144
|
+
if (!r) return "";
|
|
145
|
+
if (n.seriesName === k) {
|
|
146
|
+
let e = n.data.value[1];
|
|
147
|
+
return `${r.name}<br/>cut @ <strong>${t(e)}</strong>`;
|
|
148
|
+
}
|
|
149
|
+
let i = t(r.end - (r.start ?? 0)), a = `${t(r.start ?? 0)} – ${t(r.end)}`, o = r.group ? `${r.group} · ` : "", s = r.cuts?.length ? `${r.cuts.length} cuts: ${r.cuts.map((e) => t(e)).join(", ")}` : "no cuts";
|
|
150
|
+
return `<strong>${r.name}</strong><br/>${o}${i} (${a})<br/>${s}`;
|
|
151
|
+
}
|
|
152
|
+
let $ = d(() => {
|
|
153
|
+
if (!R.value.length) return null;
|
|
154
|
+
let e = z.value, t = q.value || 1, n = (n) => J(n, e, t), r = Y.value.map((e) => ({
|
|
155
|
+
name: e || "videos",
|
|
156
|
+
type: "custom",
|
|
157
|
+
renderItem: ae,
|
|
158
|
+
itemStyle: { color: ie(e) },
|
|
159
|
+
encode: {
|
|
160
|
+
x: [1, 2],
|
|
161
|
+
y: 0
|
|
162
|
+
},
|
|
163
|
+
data: R.value.map((e, t) => ({
|
|
164
|
+
value: [
|
|
165
|
+
t,
|
|
166
|
+
e.start ?? 0,
|
|
167
|
+
e.end
|
|
168
|
+
],
|
|
169
|
+
rowIndex: t
|
|
170
|
+
})).filter((t) => (R.value[t.rowIndex].group ?? "") === e)
|
|
171
|
+
})), i = R.value.flatMap((e, t) => (e.cuts ?? []).map((e) => ({
|
|
172
|
+
value: [t, e],
|
|
173
|
+
rowIndex: t
|
|
174
|
+
}))), a = {
|
|
175
|
+
name: k,
|
|
176
|
+
type: "custom",
|
|
177
|
+
renderItem: oe,
|
|
178
|
+
itemStyle: { color: O },
|
|
179
|
+
encode: {
|
|
180
|
+
x: 1,
|
|
181
|
+
y: 0
|
|
182
|
+
},
|
|
183
|
+
z: 10,
|
|
184
|
+
data: i
|
|
185
|
+
}, o = typeof I.options?.title == "string" ? I.options.title : "";
|
|
186
|
+
return {
|
|
187
|
+
animationDurationUpdate: 0,
|
|
188
|
+
backgroundColor: "transparent",
|
|
189
|
+
title: o ? {
|
|
190
|
+
text: o,
|
|
191
|
+
left: 0,
|
|
192
|
+
top: 0,
|
|
193
|
+
textStyle: { fontSize: 14 }
|
|
194
|
+
} : void 0,
|
|
195
|
+
legend: {
|
|
196
|
+
top: 0,
|
|
197
|
+
left: "center",
|
|
198
|
+
data: [...r.map((e) => e.name), k]
|
|
199
|
+
},
|
|
200
|
+
tooltip: {
|
|
201
|
+
trigger: "item",
|
|
202
|
+
textStyle: { fontSize: 12 },
|
|
203
|
+
formatter: (e) => se(e, n)
|
|
204
|
+
},
|
|
205
|
+
grid: {
|
|
206
|
+
left: 8,
|
|
207
|
+
right: 16,
|
|
208
|
+
top: 32,
|
|
209
|
+
bottom: B ? 44 : 24,
|
|
210
|
+
containLabel: !0
|
|
211
|
+
},
|
|
212
|
+
xAxis: {
|
|
213
|
+
type: "value",
|
|
214
|
+
min: 0,
|
|
215
|
+
max: t,
|
|
216
|
+
axisLabel: {
|
|
217
|
+
fontSize: 10,
|
|
218
|
+
formatter: n
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
yAxis: {
|
|
222
|
+
type: "category",
|
|
223
|
+
inverse: !0,
|
|
224
|
+
data: R.value.map((e) => e.name),
|
|
225
|
+
axisLabel: {
|
|
226
|
+
fontSize: 10,
|
|
227
|
+
width: 180,
|
|
228
|
+
overflow: "truncate"
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
dataZoom: B ? [{
|
|
232
|
+
type: "inside",
|
|
233
|
+
xAxisIndex: 0
|
|
234
|
+
}, {
|
|
235
|
+
type: "slider",
|
|
236
|
+
xAxisIndex: 0,
|
|
237
|
+
height: 16,
|
|
238
|
+
bottom: 8,
|
|
239
|
+
labelFormatter: n
|
|
240
|
+
}] : void 0,
|
|
241
|
+
series: [...r, a]
|
|
242
|
+
};
|
|
243
|
+
});
|
|
244
|
+
function ce(e) {
|
|
245
|
+
let t = e;
|
|
246
|
+
if (!Q(t.data)) return;
|
|
247
|
+
let n = R.value[t.data.rowIndex]?.click;
|
|
248
|
+
n && L("row-click", n);
|
|
249
|
+
}
|
|
250
|
+
return A({ refresh: W }), (e, t) => (x(), f(te, {
|
|
251
|
+
loading: !R.value.length && w(H),
|
|
252
|
+
error: w(U),
|
|
253
|
+
caption: I.caption,
|
|
254
|
+
"source-href": I.sourceHref,
|
|
255
|
+
"source-label": I.sourceLabel
|
|
256
|
+
}, {
|
|
257
|
+
skeleton: T(() => [h("div", {
|
|
258
|
+
class: "reportifact-chart-skeleton",
|
|
259
|
+
style: v({ "--reportifact-chart-height": K.value })
|
|
260
|
+
}, [...t[0] ||= [h("div", {
|
|
261
|
+
class: "reportifact-skeleton-line",
|
|
262
|
+
style: {
|
|
263
|
+
width: "200px",
|
|
264
|
+
height: "24px",
|
|
265
|
+
"margin-bottom": "16px"
|
|
266
|
+
}
|
|
267
|
+
}, null, -1), h("div", { class: "reportifact-skeleton-line reportifact-chart-skeleton-body" }, null, -1)]], 4)]),
|
|
268
|
+
default: T(() => [h("div", {
|
|
269
|
+
class: "reportifact-timeline-container",
|
|
270
|
+
style: v({ "--reportifact-chart-height": K.value })
|
|
271
|
+
}, [h("div", E, [(x(), m(u, null, ne(N, (e) => h("button", {
|
|
272
|
+
key: e.value,
|
|
273
|
+
type: "button",
|
|
274
|
+
class: _(["reportifact-timeline-mode", { "is-active": z.value === e.value }]),
|
|
275
|
+
onClick: (t) => z.value = e.value
|
|
276
|
+
}, C(e.label), 11, D)), 64))]), $.value ? (x(), f(w(c), {
|
|
277
|
+
key: 0,
|
|
278
|
+
option: $.value,
|
|
279
|
+
theme: P.value ? "dark" : void 0,
|
|
280
|
+
autoresize: !0,
|
|
281
|
+
class: "reportifact-chart",
|
|
282
|
+
onClick: ce
|
|
283
|
+
}, null, 8, ["option", "theme"])) : p("", !0)], 4)]),
|
|
284
|
+
_: 1
|
|
285
|
+
}, 8, [
|
|
286
|
+
"loading",
|
|
287
|
+
"error",
|
|
288
|
+
"caption",
|
|
289
|
+
"source-href",
|
|
290
|
+
"source-label"
|
|
291
|
+
]));
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
//#endregion
|
|
295
|
+
export { A as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require("./usePortableSource-CN5URH4d.cjs"),t=require("./WidgetWrapper-C0lc1m0V.cjs"),n=require("./dist-DBIuOmpr.cjs");let r=require("vue");var i={class:`reportifact-timeline-toolbar`},a=[`onClick`],o=`#ef4444`,s=`Cuts`,c=22,l=(0,r.defineComponent)({__name:`Timeline`,props:{caption:{},sourceHref:{},sourceLabel:{},url:{},src:{},data:{},options:{}},emits:[`row-click`],setup(l,{expose:u,emit:d}){n.D([n.S,n.s,n.i,n.a,n.r,n.o,n.n]);let f=[`#3b82f6`,`#f59e0b`,`#10b981`,`#8b5cf6`,`#0ea5e9`,`#64748b`,`#ec4899`,`#14b8a6`],p=[{value:`seconds`,label:`sec`},{value:`clock`,label:`mm:ss`}],m=(0,r.ref)(!1),h=null;(0,r.onMounted)(()=>{m.value=document.documentElement.classList.contains(`dark`),h=new MutationObserver(()=>{m.value=document.documentElement.classList.contains(`dark`)}),h.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`]})}),(0,r.onUnmounted)(()=>{h?.disconnect()});let g=l,_=d,v=(0,r.ref)([]),y=(0,r.ref)(g.options?.timeFormat===`clock`?`clock`:`seconds`),b=g.options?.zoom===!0||g.options?.zoom===`true`;function x(e){let t=Array.isArray(e)?e:typeof e==`object`&&e&&`rows`in e?e.rows:[];v.value=T(t)}let{isLoading:S,sourceError:C,refresh:w}=e.t(g,x);function T(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(typeof n!=`object`||!n)continue;let e=n,r=Number(e.end);if(typeof e.name!=`string`||!Number.isFinite(r))continue;let i=Number(e.start),a=Array.isArray(e.cuts)?e.cuts.map(Number).filter(Number.isFinite).sort((e,t)=>e-t):[];t.push({id:typeof e.id==`string`?e.id:void 0,name:e.name,group:typeof e.group==`string`&&e.group?e.group:void 0,color:typeof e.color==`string`&&e.color?e.color:void 0,start:Number.isFinite(i)?i:0,end:r,cuts:a,click:typeof e.click==`object`&&e.click!==null?e.click:void 0})}return t}let E=(0,r.computed)(()=>`${Math.max(280,v.value.length*c+(b?150:126))}px`),D=(0,r.computed)(()=>v.value.reduce((e,t)=>Math.max(e,t.end),0));function O(e,t,n){let r=Math.max(0,Math.round(e));if(t===`seconds`)return`${r}s`;let i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60,s=e=>String(e).padStart(2,`0`);return n>=3600?`${s(i)}:${s(a)}:${s(o)}`:`${s(a)}:${s(o)}`}let k=(0,r.computed)(()=>{let e=[];for(let t of v.value){let n=t.group??``;e.includes(n)||e.push(n)}return e});function A(e){let t=k.value.indexOf(e);return f[Math.max(0,t)%f.length]}function j(e,t){return n.xt(t,e.coordSys)}function M(e){return Math.min(e.size([0,1])[1]*.6,14)}function N(e,t){let n=t.value(0),r=t.coord([t.value(1),n]),i=t.coord([t.value(2),n]),a=M(t),o=j(e,{x:r[0],y:r[1]-a/2,width:Math.max(i[0]-r[0],1),height:a});if(!o)return;let s=v.value[n];return{type:`rect`,shape:{...o,r:2},style:{fill:s?.color??t.visual(`color`)}}}function P(e,t){let n=t.value(0),r=t.coord([t.value(1),n]),i=M(t)+4,a=j(e,{x:r[0]-1,y:r[1]-i/2,width:2,height:i});if(a)return{type:`rect`,shape:a,style:{fill:o}}}function F(e){return typeof e==`object`&&!!e&&`rowIndex`in e}function I(e,t){let n=e;if(!F(n.data))return``;let r=v.value[n.data.rowIndex];if(!r)return``;if(n.seriesName===s){let e=n.data.value[1];return`${r.name}<br/>cut @ <strong>${t(e)}</strong>`}let i=t(r.end-(r.start??0)),a=`${t(r.start??0)} – ${t(r.end)}`,o=r.group?`${r.group} · `:``,c=r.cuts?.length?`${r.cuts.length} cuts: ${r.cuts.map(e=>t(e)).join(`, `)}`:`no cuts`;return`<strong>${r.name}</strong><br/>${o}${i} (${a})<br/>${c}`}let L=(0,r.computed)(()=>{if(!v.value.length)return null;let e=y.value,t=D.value||1,n=n=>O(n,e,t),r=k.value.map(e=>({name:e||`videos`,type:`custom`,renderItem:N,itemStyle:{color:A(e)},encode:{x:[1,2],y:0},data:v.value.map((e,t)=>({value:[t,e.start??0,e.end],rowIndex:t})).filter(t=>(v.value[t.rowIndex].group??``)===e)})),i=v.value.flatMap((e,t)=>(e.cuts??[]).map(e=>({value:[t,e],rowIndex:t}))),a={name:s,type:`custom`,renderItem:P,itemStyle:{color:o},encode:{x:1,y:0},z:10,data:i},c=typeof g.options?.title==`string`?g.options.title:``;return{animationDurationUpdate:0,backgroundColor:`transparent`,title:c?{text:c,left:0,top:0,textStyle:{fontSize:14}}:void 0,legend:{top:0,left:`center`,data:[...r.map(e=>e.name),s]},tooltip:{trigger:`item`,textStyle:{fontSize:12},formatter:e=>I(e,n)},grid:{left:8,right:16,top:32,bottom:b?44:24,containLabel:!0},xAxis:{type:`value`,min:0,max:t,axisLabel:{fontSize:10,formatter:n}},yAxis:{type:`category`,inverse:!0,data:v.value.map(e=>e.name),axisLabel:{fontSize:10,width:180,overflow:`truncate`}},dataZoom:b?[{type:`inside`,xAxisIndex:0},{type:`slider`,xAxisIndex:0,height:16,bottom:8,labelFormatter:n}]:void 0,series:[...r,a]}});function R(e){let t=e;if(!F(t.data))return;let n=v.value[t.data.rowIndex]?.click;n&&_(`row-click`,n)}return u({refresh:w}),(e,o)=>((0,r.openBlock)(),(0,r.createBlock)(t.t,{loading:!v.value.length&&(0,r.unref)(S),error:(0,r.unref)(C),caption:g.caption,"source-href":g.sourceHref,"source-label":g.sourceLabel},{skeleton:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:`reportifact-chart-skeleton`,style:(0,r.normalizeStyle)({"--reportifact-chart-height":E.value})},[...o[0]||=[(0,r.createElementVNode)(`div`,{class:`reportifact-skeleton-line`,style:{width:`200px`,height:`24px`,"margin-bottom":`16px`}},null,-1),(0,r.createElementVNode)(`div`,{class:`reportifact-skeleton-line reportifact-chart-skeleton-body`},null,-1)]],4)]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:`reportifact-timeline-container`,style:(0,r.normalizeStyle)({"--reportifact-chart-height":E.value})},[(0,r.createElementVNode)(`div`,i,[((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(p,e=>(0,r.createElementVNode)(`button`,{key:e.value,type:`button`,class:(0,r.normalizeClass)([`reportifact-timeline-mode`,{"is-active":y.value===e.value}]),onClick:t=>y.value=e.value},(0,r.toDisplayString)(e.label),11,a)),64))]),L.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(n.t),{key:0,option:L.value,theme:m.value?`dark`:void 0,autoresize:!0,class:`reportifact-chart`,onClick:R},null,8,[`option`,`theme`])):(0,r.createCommentVNode)(``,!0)],4)]),_:1},8,[`loading`,`error`,`caption`,`source-href`,`source-label`]))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return l}});
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { computed as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, onMounted as a, openBlock as o, ref as s, renderSlot as c, toDisplayString as l, unref as u, watch as d } from "vue";
|
|
2
|
+
//#region src/composables/useDelayedLoading.ts
|
|
3
|
+
function f(e, t = 30) {
|
|
4
|
+
let n = s(!1), r = null;
|
|
5
|
+
function i() {
|
|
6
|
+
r && clearTimeout(r), r = setTimeout(() => {
|
|
7
|
+
e.value && (n.value = !0);
|
|
8
|
+
}, t);
|
|
9
|
+
}
|
|
10
|
+
function a() {
|
|
11
|
+
n.value = !1, r &&= (clearTimeout(r), null);
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
showOverlay: n,
|
|
15
|
+
startLoading: i,
|
|
16
|
+
stopLoading: a
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/widgets/WidgetWrapper.vue?vue&type=script&setup=true&lang.ts
|
|
21
|
+
var p = { class: "reportifact reportifact-figure reportifact-widget-wrapper" }, m = {
|
|
22
|
+
key: 0,
|
|
23
|
+
class: "reportifact-widget-skeleton"
|
|
24
|
+
}, h = {
|
|
25
|
+
key: 1,
|
|
26
|
+
class: "reportifact-widget-error"
|
|
27
|
+
}, g = { class: "reportifact-widget-error-message" }, _ = {
|
|
28
|
+
key: 2,
|
|
29
|
+
class: "reportifact-widget-content"
|
|
30
|
+
}, v = {
|
|
31
|
+
key: 3,
|
|
32
|
+
class: "reportifact-figure-caption"
|
|
33
|
+
}, y = { key: 0 }, b = ["href"], x = /* @__PURE__ */ i({
|
|
34
|
+
__name: "WidgetWrapper",
|
|
35
|
+
props: {
|
|
36
|
+
caption: {},
|
|
37
|
+
sourceHref: {},
|
|
38
|
+
sourceLabel: { default: "View source data" },
|
|
39
|
+
loading: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: !1
|
|
42
|
+
},
|
|
43
|
+
error: { default: null },
|
|
44
|
+
showSkeleton: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !0
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
setup(i) {
|
|
50
|
+
let s = i, { showOverlay: x, startLoading: S, stopLoading: C } = f(e(() => s.loading && s.showSkeleton), 30);
|
|
51
|
+
return d(() => s.loading && s.showSkeleton, (e) => {
|
|
52
|
+
e ? S() : C();
|
|
53
|
+
}), a(() => {
|
|
54
|
+
s.loading && s.showSkeleton && S();
|
|
55
|
+
}), (e, a) => (o(), n("figure", p, [u(x) ? (o(), n("div", m, [c(e.$slots, "skeleton")])) : i.error ? (o(), n("div", h, [c(e.$slots, "fallback", { error: i.error }, () => [r("div", g, l(i.error), 1)])])) : (o(), n("div", _, [c(e.$slots, "default")])), i.caption || i.sourceHref ? (o(), n("figcaption", v, [i.caption ? (o(), n("span", y, l(i.caption), 1)) : t("", !0), i.sourceHref ? (o(), n("a", {
|
|
56
|
+
key: 1,
|
|
57
|
+
href: i.sourceHref
|
|
58
|
+
}, l(i.sourceLabel), 9, b)) : t("", !0)])) : t("", !0)]));
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
//#endregion
|
|
62
|
+
export { x as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e=require("vue");function t(t,n=30){let r=(0,e.ref)(!1),i=null;function a(){i&&clearTimeout(i),i=setTimeout(()=>{t.value&&(r.value=!0)},n)}function o(){r.value=!1,i&&=(clearTimeout(i),null)}return{showOverlay:r,startLoading:a,stopLoading:o}}var n={class:`reportifact reportifact-figure reportifact-widget-wrapper`},r={key:0,class:`reportifact-widget-skeleton`},i={key:1,class:`reportifact-widget-error`},a={class:`reportifact-widget-error-message`},o={key:2,class:`reportifact-widget-content`},s={key:3,class:`reportifact-figure-caption`},c={key:0},l=[`href`],u=(0,e.defineComponent)({__name:`WidgetWrapper`,props:{caption:{},sourceHref:{},sourceLabel:{default:`View source data`},loading:{type:Boolean,default:!1},error:{default:null},showSkeleton:{type:Boolean,default:!0}},setup(u){let d=u,{showOverlay:f,startLoading:p,stopLoading:m}=t((0,e.computed)(()=>d.loading&&d.showSkeleton),30);return(0,e.watch)(()=>d.loading&&d.showSkeleton,e=>{e?p():m()}),(0,e.onMounted)(()=>{d.loading&&d.showSkeleton&&p()}),(t,d)=>((0,e.openBlock)(),(0,e.createElementBlock)(`figure`,n,[(0,e.unref)(f)?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,r,[(0,e.renderSlot)(t.$slots,`skeleton`)])):u.error?((0,e.openBlock)(),(0,e.createElementBlock)(`div`,i,[(0,e.renderSlot)(t.$slots,`fallback`,{error:u.error},()=>[(0,e.createElementVNode)(`div`,a,(0,e.toDisplayString)(u.error),1)])])):((0,e.openBlock)(),(0,e.createElementBlock)(`div`,o,[(0,e.renderSlot)(t.$slots,`default`)])),u.caption||u.sourceHref?((0,e.openBlock)(),(0,e.createElementBlock)(`figcaption`,s,[u.caption?((0,e.openBlock)(),(0,e.createElementBlock)(`span`,c,(0,e.toDisplayString)(u.caption),1)):(0,e.createCommentVNode)(``,!0),u.sourceHref?((0,e.openBlock)(),(0,e.createElementBlock)(`a`,{key:1,href:u.sourceHref},(0,e.toDisplayString)(u.sourceLabel),9,l)):(0,e.createCommentVNode)(``,!0)])):(0,e.createCommentVNode)(``,!0)]))}});Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
|
|
@@ -5,11 +5,10 @@ type __VLS_Props = {
|
|
|
5
5
|
sections: Section[];
|
|
6
6
|
activeSectionId: string | null;
|
|
7
7
|
};
|
|
8
|
-
declare const
|
|
8
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
9
|
"scroll-to-section": (sectionId: string) => any;
|
|
10
10
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
11
11
|
"onScroll-to-section"?: ((sectionId: string) => any) | undefined;
|
|
12
|
-
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
13
|
-
|
|
14
|
-
}, HTMLDivElement>;
|
|
12
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
13
|
+
declare const _default: typeof __VLS_export;
|
|
15
14
|
export default _default;
|