@blazes/data-visualization 1.0.0-alpha.1 → 1.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +20 -0
  2. package/dist/.vite/manifest.json +26 -26
  3. package/dist/core/config/dashboard-config-schema.d.ts +13 -0
  4. package/dist/core/config/dashboard-config-schema.d.ts.map +1 -1
  5. package/dist/core/config/dashboard-config.d.ts +4 -0
  6. package/dist/core/config/dashboard-config.d.ts.map +1 -1
  7. package/dist/core/export/index.d.ts +1 -0
  8. package/dist/core/export/index.d.ts.map +1 -1
  9. package/dist/core/export/panel-export.d.ts +4 -0
  10. package/dist/core/export/panel-export.d.ts.map +1 -0
  11. package/dist/core/index.js +63 -61
  12. package/dist/core/runtime/dashboard-runtime.d.ts +4 -0
  13. package/dist/core/runtime/dashboard-runtime.d.ts.map +1 -1
  14. package/dist/{dashboard-runtime-8a-9P8Ku.js → dashboard-runtime-6VlVQIuQ.js} +27 -27
  15. package/dist/{dashboard-runtime-8a-9P8Ku.js.map → dashboard-runtime-6VlVQIuQ.js.map} +1 -1
  16. package/dist/experimental/s2/index.js +12 -12
  17. package/dist/index.css +1 -1
  18. package/dist/index.js +63 -61
  19. package/dist/{csv-Dyrr2yMA.js → panel-export-Di_5Frul.js} +24 -19
  20. package/dist/panel-export-Di_5Frul.js.map +1 -0
  21. package/dist/renderers/word-cloud/index.js +1 -1
  22. package/dist/{runtime-schema-BO2qLlvE.js → runtime-schema-BmeEvFU-.js} +42 -34
  23. package/dist/runtime-schema-BmeEvFU-.js.map +1 -0
  24. package/dist/{standard-definitions-DHtaLAf1.js → standard-definitions-hgJ-kOoz.js} +5 -5
  25. package/dist/{standard-definitions-DHtaLAf1.js.map → standard-definitions-hgJ-kOoz.js.map} +1 -1
  26. package/dist/vue/components/DashboardPanel.vue.d.ts.map +1 -1
  27. package/dist/vue/components/DashboardRenderer.vue.d.ts.map +1 -1
  28. package/dist/vue/index.js +609 -592
  29. package/dist/vue/index.js.map +1 -1
  30. package/package.json +1 -1
  31. package/dist/csv-Dyrr2yMA.js.map +0 -1
  32. package/dist/runtime-schema-BO2qLlvE.js.map +0 -1
package/dist/vue/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { defineComponent as O, openBlock as p, createElementBlock as w, normalizeClass as q, createElementVNode as I, Fragment as H, renderList as K, normalizeStyle as ue, toDisplayString as L, createVNode as R, unref as u, mergeProps as xe, withCtx as k, createTextVNode as U, createBlock as z, createCommentVNode as $, ref as j, computed as P, onErrorCaptured as Ce, watch as Se, resolveDynamicComponent as pe, pushScopeId as ke, popScopeId as Re, shallowRef as Ie, onMounted as fe, onBeforeUnmount as ve, onBeforeMount as $e, markRaw as Pe, toRaw as De, h as V } from "vue";
2
- import { FormatType as Z, ChartBar as Ae, Size as J, ChartLine as ze, ChartPie as Le } from "@blazes/charts";
3
- import { a as ee, b as G, c as Q, S as te } from "../visual-theme-DH-k3L51.js";
4
- import { v as E } from "../value-formatter-D5QmLSMG.js";
5
- import { RedoOutlined as X, ExclamationCircleOutlined as Te, BarChartOutlined as Fe, WarningOutlined as Ee, CloudDownloadOutlined as Ve, QuestionCircleOutlined as Oe, RiseOutlined as me, FallOutlined as _e, MinusOutlined as ge } from "@ant-design/icons-vue";
6
- import { RangePicker as Be, RadioGroup as Ue, RadioButton as Ne, Select as le, Tooltip as N, Button as Y, Card as je, Spin as de, Dropdown as Ye, Menu as He, MenuItem as ce, Progress as qe, Tag as Ke, Table as Ge } from "ant-design-vue";
7
- import { b as We, s as Ze, a as Qe, P as Xe } from "../csv-Dyrr2yMA.js";
8
- const Je = { class: "dv-filter-bar__controls" }, et = { class: "dv-filter-bar__label" }, tt = {
1
+ import { defineComponent as O, openBlock as u, createElementBlock as b, normalizeClass as K, createElementVNode as R, Fragment as H, renderList as G, normalizeStyle as pe, toDisplayString as L, createVNode as k, unref as c, mergeProps as Ce, withCtx as S, createTextVNode as U, createBlock as z, createCommentVNode as $, ref as j, computed as I, onErrorCaptured as Se, watch as ke, resolveDynamicComponent as fe, pushScopeId as Re, popScopeId as Ie, shallowRef as Pe, onMounted as ve, onBeforeUnmount as me, onBeforeMount as $e, markRaw as De, toRaw as Ae, h as V } from "vue";
2
+ import { FormatType as X, ChartBar as ze, Size as te, ChartLine as Le, ChartPie as Te } from "@blazes/charts";
3
+ import { a as ne, b as W, c as J, S as ae } from "../visual-theme-DH-k3L51.js";
4
+ import { v as F } from "../value-formatter-D5QmLSMG.js";
5
+ import { RedoOutlined as ee, ExclamationCircleOutlined as Ee, BarChartOutlined as Fe, WarningOutlined as Ve, CloudDownloadOutlined as Oe, QuestionCircleOutlined as Be, RiseOutlined as _e, FallOutlined as ge, MinusOutlined as he } from "@ant-design/icons-vue";
6
+ import { RangePicker as Ue, RadioGroup as Ne, RadioButton as je, Select as de, Tooltip as N, Button as Y, Card as Ye, Spin as ce, Dropdown as He, Menu as qe, MenuItem as ue, Progress as Ke, Tag as Ge, Table as We } from "ant-design-vue";
7
+ import { i as Z, b as Ze, s as Qe, a as Xe, P as Je } from "../panel-export-Di_5Frul.js";
8
+ const et = { class: "dv-filter-bar__controls" }, tt = { class: "dv-filter-bar__label" }, nt = {
9
9
  key: 0,
10
10
  class: "dv-filter-bar__date-range"
11
- }, nt = /* @__PURE__ */ O({
11
+ }, at = /* @__PURE__ */ O({
12
12
  __name: "DashboardFilterBar",
13
13
  props: {
14
14
  config: {},
@@ -16,166 +16,166 @@ const Je = { class: "dv-filter-bar__controls" }, et = { class: "dv-filter-bar__l
16
16
  loading: { type: Boolean }
17
17
  },
18
18
  emits: ["change", "refresh"],
19
- setup(r, { emit: _ }) {
20
- const o = r, e = _;
21
- function h(i) {
19
+ setup(o, { emit: _ }) {
20
+ const i = o, t = _;
21
+ function g(e) {
22
22
  return {
23
- "--dv-filter-xs": String(i.xs),
24
- "--dv-filter-sm": String(i.sm ?? i.xs),
25
- "--dv-filter-md": String(i.md ?? i.sm ?? i.xs),
26
- "--dv-filter-lg": String(i.lg ?? i.md ?? i.sm ?? i.xs),
27
- "--dv-filter-xl": String(i.xl ?? i.lg ?? i.md ?? i.sm ?? i.xs)
23
+ "--dv-filter-xs": String(e.xs),
24
+ "--dv-filter-sm": String(e.sm ?? e.xs),
25
+ "--dv-filter-md": String(e.md ?? e.sm ?? e.xs),
26
+ "--dv-filter-lg": String(e.lg ?? e.md ?? e.sm ?? e.xs),
27
+ "--dv-filter-xl": String(e.xl ?? e.lg ?? e.md ?? e.sm ?? e.xs)
28
28
  };
29
29
  }
30
- function x(i) {
31
- return i;
30
+ function M(e) {
31
+ return e;
32
32
  }
33
- function C(i) {
34
- return i.map((a) => ({ ...a }));
33
+ function x(e) {
34
+ return e.map((a) => ({ ...a }));
35
35
  }
36
- function s(i) {
37
- if (typeof i != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(i)) return;
38
- const a = /* @__PURE__ */ new Date(`${i}T12:00:00Z`);
36
+ function s(e) {
37
+ if (typeof e != "string" || !/^\d{4}-\d{2}-\d{2}$/.test(e)) return;
38
+ const a = /* @__PURE__ */ new Date(`${e}T12:00:00Z`);
39
39
  return Number.isNaN(a.getTime()) ? void 0 : a;
40
40
  }
41
- function S(i) {
42
- return i.toISOString().slice(0, 10);
41
+ function C(e) {
42
+ return e.toISOString().slice(0, 10);
43
43
  }
44
- function D() {
45
- const i = new Intl.DateTimeFormat("en-CA", {
46
- timeZone: o.context.timezone,
44
+ function P() {
45
+ const e = new Intl.DateTimeFormat("en-CA", {
46
+ timeZone: i.context.timezone,
47
47
  year: "numeric",
48
48
  month: "2-digit",
49
49
  day: "2-digit"
50
- }).formatToParts(/* @__PURE__ */ new Date()), a = Object.fromEntries(i.map((g) => [g.type, g.value])), t = /* @__PURE__ */ new Date(`${a.year}-${a.month}-${a.day}T12:00:00Z`);
51
- return t.setUTCDate(t.getUTCDate() - 1), t;
50
+ }).formatToParts(/* @__PURE__ */ new Date()), a = Object.fromEntries(e.map((f) => [f.type, f.value])), n = /* @__PURE__ */ new Date(`${a.year}-${a.month}-${a.day}T12:00:00Z`);
51
+ return n.setUTCDate(n.getUTCDate() - 1), n;
52
52
  }
53
- function c(i) {
54
- return o.context.variables[i];
53
+ function r(e) {
54
+ return i.context.variables[e];
55
55
  }
56
- function l(i) {
57
- const a = c(i.startVariableId), t = c(i.endVariableId);
58
- return typeof a != "string" || typeof t != "string" || !s(a) || !s(t) ? {} : { value: [a, t] };
56
+ function l(e) {
57
+ const a = r(e.startVariableId), n = r(e.endVariableId);
58
+ return typeof a != "string" || typeof n != "string" || !s(a) || !s(n) ? {} : { value: [a, n] };
59
59
  }
60
- function f(i, a) {
60
+ function m(e, a) {
61
61
  if (!Array.isArray(a) || a.length !== 2) return;
62
- const [t, g] = a;
63
- typeof t != "string" || typeof g != "string" || e("change", {
64
- [i.startVariableId]: t,
65
- [i.endVariableId]: g
62
+ const [n, f] = a;
63
+ typeof n != "string" || typeof f != "string" || t("change", {
64
+ [e.startVariableId]: n,
65
+ [e.endVariableId]: f
66
66
  });
67
67
  }
68
- function d(i) {
69
- var y, A;
70
- const a = s(c(i.startVariableId)), t = s(c(i.endVariableId));
71
- if (!a || !t || t.getTime() !== D().getTime()) return;
72
- const g = Math.round((t.getTime() - a.getTime()) / 864e5) + 1;
73
- return (A = (y = i.presets) == null ? void 0 : y.find((F) => F.days === g)) == null ? void 0 : A.id;
68
+ function d(e) {
69
+ var h, A;
70
+ const a = s(r(e.startVariableId)), n = s(r(e.endVariableId));
71
+ if (!a || !n || n.getTime() !== P().getTime()) return;
72
+ const f = Math.round((n.getTime() - a.getTime()) / 864e5) + 1;
73
+ return (A = (h = e.presets) == null ? void 0 : h.find((E) => E.days === f)) == null ? void 0 : A.id;
74
74
  }
75
- function n(i, a) {
76
- var F;
77
- const t = typeof a.target.value == "string" ? a.target.value : void 0, g = (F = i.presets) == null ? void 0 : F.find((W) => W.id === t);
78
- if (!g) return;
79
- const y = D(), A = new Date(y);
80
- A.setUTCDate(A.getUTCDate() - g.days + 1), e("change", {
81
- [i.startVariableId]: S(A),
82
- [i.endVariableId]: S(y)
75
+ function w(e, a) {
76
+ var E;
77
+ const n = typeof a.target.value == "string" ? a.target.value : void 0, f = (E = e.presets) == null ? void 0 : E.find((Q) => Q.id === n);
78
+ if (!f) return;
79
+ const h = P(), A = new Date(h);
80
+ A.setUTCDate(A.getUTCDate() - f.days + 1), t("change", {
81
+ [e.startVariableId]: C(A),
82
+ [e.endVariableId]: C(h)
83
83
  });
84
84
  }
85
- function M(i, a) {
86
- e("change", { [i]: a ?? null });
85
+ function D(e, a) {
86
+ t("change", { [e]: a ?? null });
87
87
  }
88
- return (i, a) => i.config ? (p(), w("div", {
88
+ return (e, a) => e.config ? (u(), b("div", {
89
89
  key: 0,
90
- class: q(["dv-filter-bar", { "dv-filter-bar--flow": i.config.layout === "flow" }])
90
+ class: K(["dv-filter-bar", { "dv-filter-bar--flow": e.config.layout === "flow" }])
91
91
  }, [
92
- I("div", Je, [
93
- (p(!0), w(H, null, K(i.config.controls, (t) => {
94
- var g;
95
- return p(), w("div", {
96
- key: t.id,
97
- class: q(["dv-filter-bar__control", `dv-filter-bar__control--${t.type}`]),
98
- style: ue(h(t.layout))
92
+ R("div", et, [
93
+ (u(!0), b(H, null, G(e.config.controls, (n) => {
94
+ var f;
95
+ return u(), b("div", {
96
+ key: n.id,
97
+ class: K(["dv-filter-bar__control", `dv-filter-bar__control--${n.type}`]),
98
+ style: pe(g(n.layout))
99
99
  }, [
100
- I("label", et, L(t.label), 1),
101
- t.type === "date-range" ? (p(), w("div", tt, [
102
- R(u(Be), xe({
100
+ R("label", tt, L(n.label), 1),
101
+ n.type === "date-range" ? (u(), b("div", nt, [
102
+ k(c(Ue), Ce({
103
103
  class: "dv-filter-bar__range-picker",
104
104
  "allow-clear": !1,
105
- disabled: t.disabled ?? !1,
105
+ disabled: n.disabled ?? !1,
106
106
  "dropdown-class-name": "dv-filter-bar__date-popup",
107
- format: t.format ?? "YYYY-MM-DD"
108
- }, l(t), {
107
+ format: n.format ?? "YYYY-MM-DD"
108
+ }, l(n), {
109
109
  "value-format": "YYYY-MM-DD",
110
- onChange: (y) => f(t, y)
110
+ onChange: (h) => m(n, h)
111
111
  }), {
112
- separator: k(() => [
112
+ separator: S(() => [
113
113
  U("至")
114
114
  ]),
115
115
  _: 2
116
116
  }, 1040, ["disabled", "format", "onChange"]),
117
- (g = t.presets) != null && g.length ? (p(), z(u(Ue), {
117
+ (f = n.presets) != null && f.length ? (u(), z(c(Ne), {
118
118
  key: 0,
119
119
  class: "dv-filter-bar__presets",
120
- disabled: t.disabled ?? !1,
120
+ disabled: n.disabled ?? !1,
121
121
  size: "small",
122
- value: d(t),
123
- onChange: (y) => n(t, y)
122
+ value: d(n),
123
+ onChange: (h) => w(n, h)
124
124
  }, {
125
- default: k(() => [
126
- (p(!0), w(H, null, K(t.presets, (y) => (p(), z(u(Ne), {
127
- key: y.id,
128
- value: y.id
125
+ default: S(() => [
126
+ (u(!0), b(H, null, G(n.presets, (h) => (u(), z(c(je), {
127
+ key: h.id,
128
+ value: h.id
129
129
  }, {
130
- default: k(() => [
131
- U(L(y.label), 1)
130
+ default: S(() => [
131
+ U(L(h.label), 1)
132
132
  ]),
133
133
  _: 2
134
134
  }, 1032, ["value"]))), 128))
135
135
  ]),
136
136
  _: 2
137
137
  }, 1032, ["disabled", "value", "onChange"])) : $("", !0)
138
- ])) : t.type === "multi-select" ? (p(), z(u(le), {
138
+ ])) : n.type === "multi-select" ? (u(), z(c(de), {
139
139
  key: 1,
140
- "allow-clear": t.allowClear ?? !1,
141
- disabled: t.disabled ?? !1,
142
- "max-tag-count": t.maxTagCount ?? "responsive",
140
+ "allow-clear": n.allowClear ?? !1,
141
+ disabled: n.disabled ?? !1,
142
+ "max-tag-count": n.maxTagCount ?? "responsive",
143
143
  mode: "multiple",
144
144
  "option-filter-prop": "label",
145
- options: C(t.options),
146
- placeholder: t.placeholder ?? "",
147
- "show-search": t.showSearch ?? !1,
148
- value: i.context.variables[t.variableId],
149
- onChange: (y) => M(t.variableId, y)
150
- }, null, 8, ["allow-clear", "disabled", "max-tag-count", "options", "placeholder", "show-search", "value", "onChange"])) : (p(), z(u(le), {
145
+ options: x(n.options),
146
+ placeholder: n.placeholder ?? "",
147
+ "show-search": n.showSearch ?? !1,
148
+ value: e.context.variables[n.variableId],
149
+ onChange: (h) => D(n.variableId, h)
150
+ }, null, 8, ["allow-clear", "disabled", "max-tag-count", "options", "placeholder", "show-search", "value", "onChange"])) : (u(), z(c(de), {
151
151
  key: 2,
152
- "allow-clear": t.allowClear ?? !1,
153
- disabled: t.disabled ?? !1,
152
+ "allow-clear": n.allowClear ?? !1,
153
+ disabled: n.disabled ?? !1,
154
154
  "option-filter-prop": "label",
155
- options: C(t.options),
156
- placeholder: t.placeholder ?? "",
157
- "show-search": t.showSearch ?? !1,
158
- value: i.context.variables[t.variableId],
159
- onChange: (y) => M(t.variableId, y)
155
+ options: x(n.options),
156
+ placeholder: n.placeholder ?? "",
157
+ "show-search": n.showSearch ?? !1,
158
+ value: e.context.variables[n.variableId],
159
+ onChange: (h) => D(n.variableId, h)
160
160
  }, null, 8, ["allow-clear", "disabled", "options", "placeholder", "show-search", "value", "onChange"]))
161
161
  ], 6);
162
162
  }), 128))
163
163
  ]),
164
- i.config.showRefresh !== !1 ? (p(), z(u(N), {
164
+ e.config.showRefresh !== !1 ? (u(), z(c(N), {
165
165
  key: 0,
166
166
  title: "刷新全部"
167
167
  }, {
168
- default: k(() => [
169
- R(u(Y), {
168
+ default: S(() => [
169
+ k(c(Y), {
170
170
  type: "primary",
171
171
  class: "dv-filter-bar__refresh",
172
- loading: i.loading ?? !1,
173
- onClick: a[0] || (a[0] = (t) => i.$emit("refresh"))
172
+ loading: e.loading ?? !1,
173
+ onClick: a[0] || (a[0] = (n) => e.$emit("refresh"))
174
174
  }, {
175
- icon: k(() => [
176
- R(u(X))
175
+ icon: S(() => [
176
+ k(c(ee))
177
177
  ]),
178
- default: k(() => [
178
+ default: S(() => [
179
179
  U(" 刷新 ")
180
180
  ]),
181
181
  _: 1
@@ -185,50 +185,50 @@ const Je = { class: "dv-filter-bar__controls" }, et = { class: "dv-filter-bar__l
185
185
  })) : $("", !0)
186
186
  ], 2)) : $("", !0);
187
187
  }
188
- }), B = (r, _) => {
189
- const o = r.__vccOpts || r;
190
- for (const [e, h] of _)
191
- o[e] = h;
192
- return o;
193
- }, at = /* @__PURE__ */ B(nt, [["__scopeId", "data-v-45855b0b"]]), he = (r) => (ke("data-v-b524c4f2"), r = r(), Re(), r), it = { class: "dv-panel__heading" }, ot = { class: "dv-panel__title-group" }, rt = { class: "dv-panel__title" }, st = {
188
+ }), B = (o, _) => {
189
+ const i = o.__vccOpts || o;
190
+ for (const [t, g] of _)
191
+ i[t] = g;
192
+ return i;
193
+ }, it = /* @__PURE__ */ B(at, [["__scopeId", "data-v-45855b0b"]]), ye = (o) => (Re("data-v-d457add9"), o = o(), Ie(), o), rt = { class: "dv-panel__heading" }, ot = { class: "dv-panel__title-group" }, st = { class: "dv-panel__title" }, lt = {
194
194
  key: 0,
195
195
  class: "dv-panel__title-note"
196
- }, lt = { class: "dv-panel__actions" }, dt = {
196
+ }, dt = { class: "dv-panel__actions" }, ct = {
197
197
  key: 0,
198
198
  class: "dv-panel__filters"
199
- }, ct = {
199
+ }, ut = {
200
200
  key: 1,
201
201
  class: "dv-panel__state dv-panel__state--failure",
202
202
  role: "status"
203
- }, ut = { class: "dv-panel__failure" }, pt = { class: "dv-panel__failure-copy" }, ft = { class: "dv-panel__failure-heading" }, vt = ["title"], mt = /* @__PURE__ */ he(() => /* @__PURE__ */ I("span", { class: "dv-panel__retry-label" }, "重新加载", -1)), _t = {
203
+ }, pt = { class: "dv-panel__failure" }, ft = { class: "dv-panel__failure-copy" }, vt = { class: "dv-panel__failure-heading" }, mt = ["title"], _t = /* @__PURE__ */ ye(() => /* @__PURE__ */ R("span", { class: "dv-panel__retry-label" }, "重新加载", -1)), gt = {
204
204
  key: 2,
205
205
  class: "dv-panel__state dv-panel__state--loading"
206
- }, gt = {
206
+ }, ht = {
207
207
  key: 0,
208
208
  class: "dv-panel__state dv-panel__state--metric-empty"
209
- }, ht = {
209
+ }, yt = {
210
210
  key: 1,
211
211
  class: "dv-panel__state dv-panel__state--empty",
212
212
  role: "status",
213
213
  "aria-live": "polite"
214
- }, yt = {
214
+ }, bt = {
215
215
  class: "dv-panel__empty-icon",
216
216
  "aria-hidden": "true"
217
- }, bt = /* @__PURE__ */ he(() => /* @__PURE__ */ I("div", { class: "dv-panel__empty-copy" }, [
218
- /* @__PURE__ */ I("div", { class: "dv-panel__empty-title" }, "暂无数据")
219
- ], -1)), wt = {
217
+ }, wt = /* @__PURE__ */ ye(() => /* @__PURE__ */ R("div", { class: "dv-panel__empty-copy" }, [
218
+ /* @__PURE__ */ R("div", { class: "dv-panel__empty-title" }, "暂无数据")
219
+ ], -1)), Mt = {
220
220
  key: 4,
221
221
  class: "dv-panel__renderer"
222
- }, Mt = {
222
+ }, xt = {
223
223
  key: 0,
224
224
  class: "dv-panel__refreshing"
225
- }, xt = {
225
+ }, Ct = {
226
226
  key: 5,
227
227
  class: "dv-panel__state dv-panel__idle"
228
- }, Ct = {
228
+ }, St = {
229
229
  key: 6,
230
230
  class: "dv-panel__updated"
231
- }, St = /* @__PURE__ */ O({
231
+ }, kt = /* @__PURE__ */ O({
232
232
  __name: "DashboardPanel",
233
233
  props: {
234
234
  panel: {},
@@ -240,103 +240,106 @@ const Je = { class: "dv-filter-bar__controls" }, et = { class: "dv-filter-bar__l
240
240
  refreshDisabled: { type: Boolean }
241
241
  },
242
242
  emits: ["refresh", "retry", "exportCsv", "exportPng", "action", "visualizationEvent"],
243
- setup(r, { expose: _, emit: o }) {
244
- const e = r, h = o, x = j(), C = j(), s = P(() => e.panel.rendererId === "metric"), S = P(() => {
245
- var n;
246
- if (C.value)
247
- return { title: "图表暂时无法展示", detail: C.value.message };
248
- if (e.state.status === "error" || e.state.status === "cancelled")
249
- return { title: "数据暂时无法加载", detail: (n = e.state.error) == null ? void 0 : n.message };
250
- }), D = P(
251
- () => e.definition.capabilities.csv && !!e.state.dataset || e.definition.capabilities.png && !!e.state.viewModel
252
- ), c = P(() => {
253
- const n = e.panel.layout.minHeight ?? (s.value ? 119 : 401), M = s.value ? 40 : 50;
254
- return { minHeight: `${Math.max(n - M - 2, s.value ? 77 : 190)}px` };
255
- }), l = P(
256
- () => e.state.lastSuccessfulAt ? new Intl.DateTimeFormat(e.context.locale, { timeStyle: "medium", timeZone: e.context.timezone }).format(
257
- new Date(e.state.lastSuccessfulAt)
243
+ setup(o, { expose: _, emit: i }) {
244
+ const t = o, g = i, M = j(), x = j(), s = I(() => t.panel.rendererId === "metric"), C = I(() => {
245
+ var e;
246
+ if (x.value)
247
+ return { title: "图表暂时无法展示", detail: x.value.message };
248
+ if (t.state.status === "error" || t.state.status === "cancelled")
249
+ return { title: "数据暂时无法加载", detail: (e = t.state.error) == null ? void 0 : e.message };
250
+ }), P = I(
251
+ () => Z(t.panel, t.definition.capabilities, "csv") && !!t.state.dataset
252
+ ), r = I(
253
+ () => Z(t.panel, t.definition.capabilities, "png") && !!t.state.viewModel
254
+ ), l = I(() => P.value || r.value), m = I(() => {
255
+ const e = t.panel.layout.minHeight ?? (s.value ? 119 : 401), a = s.value ? 40 : 50;
256
+ return { minHeight: `${Math.max(e - a - 2, s.value ? 77 : 190)}px` };
257
+ }), d = I(
258
+ () => t.state.lastSuccessfulAt ? new Intl.DateTimeFormat(t.context.locale, { timeStyle: "medium", timeZone: t.context.timezone }).format(
259
+ new Date(t.state.lastSuccessfulAt)
258
260
  ) : ""
259
261
  );
260
- function f() {
261
- var n, M;
262
- return (M = (n = x.value) == null ? void 0 : n.exportPng) == null ? void 0 : M.call(n);
262
+ function w() {
263
+ var e, a;
264
+ if (r.value)
265
+ return (a = (e = M.value) == null ? void 0 : e.exportPng) == null ? void 0 : a.call(e);
263
266
  }
264
- function d(n) {
265
- n.key === "csv" && h("exportCsv"), n.key === "png" && h("exportPng");
267
+ function D(e) {
268
+ e.key === "csv" && P.value && g("exportCsv"), e.key === "png" && r.value && g("exportPng");
266
269
  }
267
- return Ce((n) => (C.value = n instanceof Error ? n : new Error(String(n)), !1)), Se(
268
- () => [e.state.generation, e.state.viewModel],
270
+ return Se((e) => (x.value = e instanceof Error ? e : new Error(String(e)), !1)), ke(
271
+ () => [t.state.generation, t.state.viewModel],
269
272
  () => {
270
- C.value = void 0;
273
+ x.value = void 0;
271
274
  }
272
- ), _({ exportPng: f }), (n, M) => (p(), z(u(je), {
273
- class: q(["dv-panel", { "dv-panel--metric": s.value }]),
274
- "body-style": c.value
275
+ ), _({ exportPng: w }), (e, a) => (u(), z(c(Ye), {
276
+ class: K(["dv-panel", { "dv-panel--metric": s.value }]),
277
+ "body-style": m.value
275
278
  }, {
276
- title: k(() => [
277
- I("div", it, [
278
- I("span", ot, [
279
- I("span", rt, L(n.panel.title), 1),
280
- n.panel.description ? (p(), z(u(N), {
279
+ title: S(() => [
280
+ R("div", rt, [
281
+ R("span", ot, [
282
+ R("span", st, L(e.panel.title), 1),
283
+ e.panel.description ? (u(), z(c(N), {
281
284
  key: 0,
282
- title: n.panel.description
285
+ title: e.panel.description
283
286
  }, {
284
- default: k(() => [
285
- R(u(Oe))
287
+ default: S(() => [
288
+ k(c(Be))
286
289
  ]),
287
290
  _: 1
288
291
  }, 8, ["title"])) : $("", !0)
289
292
  ]),
290
- n.panel.titleNote ? (p(), w("span", st, L(n.panel.titleNote), 1)) : $("", !0)
293
+ e.panel.titleNote ? (u(), b("span", lt, L(e.panel.titleNote), 1)) : $("", !0)
291
294
  ])
292
295
  ]),
293
- extra: k(() => {
294
- var i;
296
+ extra: S(() => {
297
+ var n;
295
298
  return [
296
- I("div", lt, [
297
- n.state.status === "stale" ? (p(), z(u(N), {
299
+ R("div", dt, [
300
+ e.state.status === "stale" ? (u(), z(c(N), {
298
301
  key: 0,
299
- title: `刷新失败,当前展示上次成功数据${(i = n.state.error) != null && i.message ? `:${n.state.error.message}` : ""}`
302
+ title: `刷新失败,当前展示上次成功数据${(n = e.state.error) != null && n.message ? `:${e.state.error.message}` : ""}`
300
303
  }, {
301
- default: k(() => [
302
- R(u(Ee), { class: "dv-panel__warning" })
304
+ default: S(() => [
305
+ k(c(Ve), { class: "dv-panel__warning" })
303
306
  ]),
304
307
  _: 1
305
308
  }, 8, ["title"])) : $("", !0),
306
- R(u(N), {
307
- title: n.refreshDisabled ? "正在刷新全部" : "刷新"
309
+ k(c(N), {
310
+ title: e.refreshDisabled ? "正在刷新全部" : "刷新"
308
311
  }, {
309
- default: k(() => [
310
- R(u(Y), {
311
- disabled: n.refreshDisabled ?? !1,
312
+ default: S(() => [
313
+ k(c(Y), {
314
+ disabled: e.refreshDisabled ?? !1,
312
315
  type: "text",
313
316
  size: "small",
314
- onClick: M[0] || (M[0] = (a) => n.$emit("refresh"))
317
+ onClick: a[0] || (a[0] = (f) => e.$emit("refresh"))
315
318
  }, {
316
- icon: k(() => [
317
- R(u(X))
319
+ icon: S(() => [
320
+ k(c(ee))
318
321
  ]),
319
322
  _: 1
320
323
  }, 8, ["disabled"])
321
324
  ]),
322
325
  _: 1
323
326
  }, 8, ["title"]),
324
- D.value ? (p(), z(u(Ye), {
327
+ l.value ? (u(), z(c(He), {
325
328
  key: 1,
326
329
  placement: "bottomRight",
327
330
  trigger: ["click"]
328
331
  }, {
329
- overlay: k(() => [
330
- R(u(He), { onClick: d }, {
331
- default: k(() => [
332
- n.definition.capabilities.csv && n.state.dataset ? (p(), z(u(ce), { key: "csv" }, {
333
- default: k(() => [
332
+ overlay: S(() => [
333
+ k(c(qe), { onClick: D }, {
334
+ default: S(() => [
335
+ P.value ? (u(), z(c(ue), { key: "csv" }, {
336
+ default: S(() => [
334
337
  U("导出 CSV")
335
338
  ]),
336
339
  _: 1
337
340
  })) : $("", !0),
338
- n.definition.capabilities.png && n.state.viewModel ? (p(), z(u(ce), { key: "png" }, {
339
- default: k(() => [
341
+ r.value ? (u(), z(c(ue), { key: "png" }, {
342
+ default: S(() => [
340
343
  U("导出 PNG")
341
344
  ]),
342
345
  _: 1
@@ -345,15 +348,15 @@ const Je = { class: "dv-filter-bar__controls" }, et = { class: "dv-filter-bar__l
345
348
  _: 1
346
349
  })
347
350
  ]),
348
- default: k(() => [
349
- R(u(N), { title: "下载" }, {
350
- default: k(() => [
351
- R(u(Y), {
351
+ default: S(() => [
352
+ k(c(N), { title: "下载" }, {
353
+ default: S(() => [
354
+ k(c(Y), {
352
355
  type: "text",
353
356
  size: "small"
354
357
  }, {
355
- icon: k(() => [
356
- R(u(Ve))
358
+ icon: S(() => [
359
+ k(c(Oe))
357
360
  ]),
358
361
  _: 1
359
362
  })
@@ -363,46 +366,46 @@ const Je = { class: "dv-filter-bar__controls" }, et = { class: "dv-filter-bar__l
363
366
  ]),
364
367
  _: 1
365
368
  })) : $("", !0),
366
- (p(!0), w(H, null, K(n.panel.actions ?? [], (a) => (p(), z(u(Y), {
367
- key: a.id,
369
+ (u(!0), b(H, null, G(e.panel.actions ?? [], (f) => (u(), z(c(Y), {
370
+ key: f.id,
368
371
  type: "link",
369
372
  size: "small",
370
- onClick: (t) => n.$emit("action", a.id)
373
+ onClick: (h) => e.$emit("action", f.id)
371
374
  }, {
372
- default: k(() => [
373
- U(L(a.label ?? a.id), 1)
375
+ default: S(() => [
376
+ U(L(f.label ?? f.id), 1)
374
377
  ]),
375
378
  _: 2
376
379
  }, 1032, ["onClick"]))), 128))
377
380
  ])
378
381
  ];
379
382
  }),
380
- default: k(() => [
381
- n.filterSummary ? (p(), w("div", dt, L(n.filterSummary), 1)) : $("", !0),
382
- S.value ? (p(), w("div", ct, [
383
- I("div", ut, [
384
- R(u(Te), { class: "dv-panel__failure-icon" }),
385
- I("div", pt, [
386
- I("div", ft, L(S.value.title), 1),
387
- S.value.detail ? (p(), w("div", {
383
+ default: S(() => [
384
+ e.filterSummary ? (u(), b("div", ct, L(e.filterSummary), 1)) : $("", !0),
385
+ C.value ? (u(), b("div", ut, [
386
+ R("div", pt, [
387
+ k(c(Ee), { class: "dv-panel__failure-icon" }),
388
+ R("div", ft, [
389
+ R("div", vt, L(C.value.title), 1),
390
+ C.value.detail ? (u(), b("div", {
388
391
  key: 0,
389
392
  class: "dv-panel__failure-detail",
390
- title: S.value.detail
391
- }, L(S.value.detail), 9, vt)) : $("", !0)
393
+ title: C.value.detail
394
+ }, L(C.value.detail), 9, mt)) : $("", !0)
392
395
  ]),
393
- R(u(N), { title: "重试" }, {
394
- default: k(() => [
395
- R(u(Y), {
396
+ k(c(N), { title: "重试" }, {
397
+ default: S(() => [
398
+ k(c(Y), {
396
399
  class: "dv-panel__retry",
397
400
  size: "small",
398
401
  "aria-label": "重试",
399
- onClick: M[1] || (M[1] = (i) => n.$emit("retry"))
402
+ onClick: a[1] || (a[1] = (n) => e.$emit("retry"))
400
403
  }, {
401
- icon: k(() => [
402
- R(u(X))
404
+ icon: S(() => [
405
+ k(c(ee))
403
406
  ]),
404
- default: k(() => [
405
- mt
407
+ default: S(() => [
408
+ _t
406
409
  ]),
407
410
  _: 1
408
411
  })
@@ -410,69 +413,69 @@ const Je = { class: "dv-filter-bar__controls" }, et = { class: "dv-filter-bar__l
410
413
  _: 1
411
414
  })
412
415
  ])
413
- ])) : n.state.status === "loading" && !n.state.viewModel ? (p(), w("div", _t, [
414
- R(u(de))
415
- ])) : n.state.status === "empty" ? (p(), w(H, { key: 3 }, [
416
- s.value ? (p(), w("div", gt, "暂无数据")) : (p(), w("div", ht, [
417
- I("span", yt, [
418
- R(u(Fe))
416
+ ])) : e.state.status === "loading" && !e.state.viewModel ? (u(), b("div", gt, [
417
+ k(c(ce))
418
+ ])) : e.state.status === "empty" ? (u(), b(H, { key: 3 }, [
419
+ s.value ? (u(), b("div", ht, "暂无数据")) : (u(), b("div", yt, [
420
+ R("span", bt, [
421
+ k(c(Fe))
419
422
  ]),
420
- bt
423
+ wt
421
424
  ]))
422
- ], 64)) : n.state.viewModel ? (p(), w("div", wt, [
423
- (p(), z(pe(n.renderer), {
425
+ ], 64)) : e.state.viewModel ? (u(), b("div", Mt, [
426
+ (u(), z(fe(e.renderer), {
424
427
  ref_key: "rendererRef",
425
- ref: x,
426
- context: n.context,
427
- panel: n.panel,
428
- "view-model": n.state.viewModel,
429
- onVisualizationEvent: M[2] || (M[2] = (i) => n.$emit("visualizationEvent", i))
428
+ ref: M,
429
+ context: e.context,
430
+ panel: e.panel,
431
+ "view-model": e.state.viewModel,
432
+ onVisualizationEvent: a[2] || (a[2] = (n) => e.$emit("visualizationEvent", n))
430
433
  }, null, 40, ["context", "panel", "view-model"])),
431
- n.state.isRefreshing ? (p(), w("div", Mt, [
432
- R(u(de))
434
+ e.state.isRefreshing ? (u(), b("div", xt, [
435
+ k(c(ce))
433
436
  ])) : $("", !0)
434
- ])) : (p(), w("div", xt, "等待加载")),
435
- n.state.lastSuccessfulAt ? (p(), w("div", Ct, "更新于 " + L(l.value), 1)) : $("", !0)
437
+ ])) : (u(), b("div", Ct, "等待加载")),
438
+ e.state.lastSuccessfulAt ? (u(), b("div", St, "更新于 " + L(d.value), 1)) : $("", !0)
436
439
  ]),
437
440
  _: 1
438
441
  }, 8, ["class", "body-style"]));
439
442
  }
440
- }), kt = /* @__PURE__ */ B(St, [["__scopeId", "data-v-b524c4f2"]]);
441
- function Rt(r, _ = {}) {
442
- const o = Ie(r.snapshot);
443
- let e;
444
- return fe(() => {
445
- e = r.subscribe((h) => {
446
- o.value = h;
447
- }), _.autoLoad !== !1 && r.load();
448
- }), ve(() => e == null ? void 0 : e()), {
449
- snapshot: o,
450
- context: P(() => o.value.context),
451
- panelStates: P(() => o.value.panelStates),
452
- isLoading: P(() => o.value.isGlobalLoading),
453
- loadPanels: (h) => r.loadPanels(h),
454
- refreshAll: () => r.refreshAll(),
455
- refreshPanels: (h, x) => r.refreshPanels(h, x),
456
- refreshPanel: (h) => r.refreshPanel(h),
457
- retryPanel: (h) => r.retryPanel(h),
458
- setVariables: (h, x) => r.setVariables(h, x)
443
+ }), Rt = /* @__PURE__ */ B(kt, [["__scopeId", "data-v-d457add9"]]);
444
+ function It(o, _ = {}) {
445
+ const i = Pe(o.snapshot);
446
+ let t;
447
+ return ve(() => {
448
+ t = o.subscribe((g) => {
449
+ i.value = g;
450
+ }), _.autoLoad !== !1 && o.load();
451
+ }), me(() => t == null ? void 0 : t()), {
452
+ snapshot: i,
453
+ context: I(() => i.value.context),
454
+ panelStates: I(() => i.value.panelStates),
455
+ isLoading: I(() => i.value.isGlobalLoading),
456
+ loadPanels: (g) => o.loadPanels(g),
457
+ refreshAll: () => o.refreshAll(),
458
+ refreshPanels: (g, M) => o.refreshPanels(g, M),
459
+ refreshPanel: (g) => o.refreshPanel(g),
460
+ retryPanel: (g) => o.retryPanel(g),
461
+ setVariables: (g, M) => o.setVariables(g, M)
459
462
  };
460
463
  }
461
- function It(r, _, o) {
462
- const e = URL.createObjectURL(new Blob([r], { type: _ }));
463
- ye(e, o), window.setTimeout(() => URL.revokeObjectURL(e), 0);
464
+ function Pt(o, _, i) {
465
+ const t = URL.createObjectURL(new Blob([o], { type: _ }));
466
+ be(t, i), window.setTimeout(() => URL.revokeObjectURL(t), 0);
464
467
  }
465
- function $t(r, _) {
466
- ye(r, _);
468
+ function $t(o, _) {
469
+ be(o, _);
467
470
  }
468
- function ye(r, _) {
469
- const o = document.createElement("a");
470
- o.href = r, o.download = _, o.hidden = !0, document.body.append(o), o.click(), o.remove();
471
+ function be(o, _) {
472
+ const i = document.createElement("a");
473
+ i.href = o, i.download = _, i.hidden = !0, document.body.append(i), i.click(), i.remove();
471
474
  }
472
- const Pt = {
475
+ const Dt = {
473
476
  key: 0,
474
477
  class: "dv-dashboard__header"
475
- }, Dt = { key: 0 }, At = { class: "dv-dashboard__grid" }, zt = ["data-panel-id"], Lt = /* @__PURE__ */ O({
478
+ }, At = { key: 0 }, zt = { class: "dv-dashboard__grid" }, Lt = ["data-panel-id"], Tt = /* @__PURE__ */ O({
476
479
  __name: "DashboardRenderer",
477
480
  props: {
478
481
  runtime: {},
@@ -484,153 +487,167 @@ const Pt = {
484
487
  syncUrl: { type: Boolean, default: !0 },
485
488
  showHeader: { type: Boolean, default: !0 }
486
489
  },
487
- setup(r, { expose: _ }) {
488
- const o = r, e = /* @__PURE__ */ new Map(), h = j(), x = /* @__PURE__ */ new Set(), C = /* @__PURE__ */ new Set();
489
- let s, S = !1, D = !1;
490
+ setup(o, { expose: _ }) {
491
+ const i = o, t = /* @__PURE__ */ new Map(), g = j(), M = /* @__PURE__ */ new Set(), x = /* @__PURE__ */ new Set();
492
+ let s, C = !1, P = !1;
490
493
  $e(() => {
491
- o.syncUrl && typeof window < "u" && o.runtime.restoreContext(window.location.search);
494
+ i.syncUrl && typeof window < "u" && i.runtime.restoreContext(window.location.search);
492
495
  });
493
496
  const {
494
- context: c,
497
+ context: r,
495
498
  panelStates: l,
496
- isLoading: f,
499
+ isLoading: m,
497
500
  loadPanels: d,
498
- refreshAll: n,
499
- refreshPanels: M,
500
- refreshPanel: i,
501
+ refreshAll: w,
502
+ refreshPanels: D,
503
+ refreshPanel: e,
501
504
  retryPanel: a,
502
- setVariables: t
503
- } = Rt(o.runtime, { autoLoad: o.autoLoad && !o.lazyLoad });
504
- fe(() => {
505
+ setVariables: n
506
+ } = It(i.runtime, { autoLoad: i.autoLoad && !i.lazyLoad });
507
+ ve(() => {
505
508
  var v;
506
- if (!(!o.autoLoad || !o.lazyLoad)) {
509
+ if (!(!i.autoLoad || !i.lazyLoad)) {
507
510
  if (typeof IntersectionObserver > "u") {
508
- n();
511
+ w();
509
512
  return;
510
513
  }
511
- S = !0, s = new IntersectionObserver(be, {
512
- rootMargin: o.lazyLoadRootMargin
513
- }), (v = h.value) == null || v.querySelectorAll(".dv-dashboard__cell").forEach((m) => s == null ? void 0 : s.observe(m));
514
+ C = !0, s = new IntersectionObserver(we, {
515
+ rootMargin: i.lazyLoadRootMargin
516
+ }), (v = g.value) == null || v.querySelectorAll(".dv-dashboard__cell").forEach((p) => s == null ? void 0 : s.observe(p));
514
517
  }
515
- }), ve(() => {
516
- s == null || s.disconnect(), s = void 0, S = !1, x.clear(), C.clear();
518
+ }), me(() => {
519
+ s == null || s.disconnect(), s = void 0, C = !1, M.clear(), x.clear();
517
520
  });
518
- const g = P(
519
- () => (o.runtime.config.variables ?? []).map((v) => `${v.label}: ${y(c.value.variables[v.id])}`).join(" · ")
521
+ const f = I(
522
+ () => (i.runtime.config.variables ?? []).map((v) => `${v.label}: ${h(r.value.variables[v.id])}`).join(" · ")
520
523
  );
521
- function y(v) {
524
+ function h(v) {
522
525
  return Array.isArray(v) ? v.join(", ") : String(v ?? "--");
523
526
  }
524
527
  function A(v) {
525
- const m = v.layout.span;
528
+ const p = v.layout.span;
526
529
  return {
527
- "--dv-panel-xs": String(m.xs),
528
- "--dv-panel-sm": String(m.sm ?? m.xs),
529
- "--dv-panel-md": String(m.md ?? m.sm ?? m.xs),
530
- "--dv-panel-lg": String(m.lg ?? m.md ?? m.sm ?? m.xs),
531
- "--dv-panel-xl": String(m.xl ?? m.lg ?? m.md ?? m.sm ?? m.xs)
530
+ "--dv-panel-xs": String(p.xs),
531
+ "--dv-panel-sm": String(p.sm ?? p.xs),
532
+ "--dv-panel-md": String(p.md ?? p.sm ?? p.xs),
533
+ "--dv-panel-lg": String(p.lg ?? p.md ?? p.sm ?? p.xs),
534
+ "--dv-panel-xl": String(p.xl ?? p.lg ?? p.md ?? p.sm ?? p.xs)
532
535
  };
533
536
  }
534
- function F(v) {
535
- var b;
536
- const m = ((b = o.panelComponents) == null ? void 0 : b[v.id]) ?? o.rendererRegistry.require(v.rendererId).component;
537
- return Pe(De(m));
537
+ function E(v) {
538
+ var y;
539
+ const p = ((y = i.panelComponents) == null ? void 0 : y[v.id]) ?? i.rendererRegistry.require(v.rendererId).component;
540
+ return De(Ae(p));
538
541
  }
539
- function W(v, m) {
540
- m ? e.set(v, m) : e.delete(v);
542
+ function Q(v, p) {
543
+ p ? t.set(v, p) : t.delete(v);
541
544
  }
542
- function be(v) {
543
- v.forEach((m) => {
544
- const b = m.target.dataset.panelId;
545
- b && (m.isIntersecting ? (x.add(b), C.add(b)) : (x.delete(b), C.delete(b)));
546
- }), !(!C.size || D) && (D = !0, queueMicrotask(() => {
547
- D = !1;
548
- const m = Array.from(C);
549
- C.clear(), d(m);
545
+ function we(v) {
546
+ v.forEach((p) => {
547
+ const y = p.target.dataset.panelId;
548
+ y && (p.isIntersecting ? (M.add(y), x.add(y)) : (M.delete(y), x.delete(y)));
549
+ }), !(!x.size || P) && (P = !0, queueMicrotask(() => {
550
+ P = !1;
551
+ const p = Array.from(x);
552
+ x.clear(), d(p);
550
553
  }));
551
554
  }
552
- function ie() {
553
- return S ? M(x, { deferUnselected: !0 }) : n();
555
+ function oe() {
556
+ return C ? D(M, { deferUnselected: !0 }) : w();
554
557
  }
555
- async function we(v) {
556
- const m = t(v, S ? x : void 0);
557
- if (o.syncUrl && typeof window < "u") {
558
- const b = We(o.runtime.config, o.runtime.context, window.location.search);
558
+ async function Me(v) {
559
+ const p = n(v, C ? M : void 0);
560
+ if (i.syncUrl && typeof window < "u") {
561
+ const y = Ze(i.runtime.config, i.runtime.context, window.location.search);
559
562
  window.history.replaceState(
560
563
  window.history.state,
561
564
  "",
562
- `${window.location.pathname}${b}${window.location.hash}`
565
+ `${window.location.pathname}${y}${window.location.hash}`
563
566
  );
564
567
  }
565
- await m;
568
+ await p;
566
569
  }
567
- function oe(v) {
568
- var se;
569
- const m = o.runtime.config.panels.find((Me) => Me.id === v), b = (se = l.value[v]) == null ? void 0 : se.dataset;
570
- if (!b) return;
571
- const T = Ze(b, m, c.value);
572
- It(T, "text/csv;charset=utf-8", Qe(o.runtime.config.id, m.id));
570
+ function se(v) {
571
+ var q;
572
+ const p = i.runtime.config.panels.find((xe) => xe.id === v);
573
+ if (!p || !Z(
574
+ p,
575
+ i.runtime.dataRuntime.registries.rendererDefinitions.require(p.rendererId).capabilities,
576
+ "csv"
577
+ ))
578
+ return;
579
+ const y = (q = l.value[v]) == null ? void 0 : q.dataset;
580
+ if (!y) return;
581
+ const T = Qe(y, p, r.value);
582
+ Pt(T, "text/csv;charset=utf-8", Xe(i.runtime.config.id, p.id));
573
583
  }
574
- function re(v) {
575
- var b;
576
- const m = (b = e.get(v)) == null ? void 0 : b.exportPng();
577
- m && $t(m, `${o.runtime.config.id}-${v}.png`);
584
+ function le(v) {
585
+ var T;
586
+ const p = i.runtime.config.panels.find((q) => q.id === v);
587
+ if (!p || !Z(
588
+ p,
589
+ i.runtime.dataRuntime.registries.rendererDefinitions.require(p.rendererId).capabilities,
590
+ "png"
591
+ ))
592
+ return;
593
+ const y = (T = t.get(v)) == null ? void 0 : T.exportPng();
594
+ y && $t(y, `${i.runtime.config.id}-${v}.png`);
578
595
  }
579
- return _({ refreshAll: ie, refreshPanel: i, exportCsv: oe, exportPng: re }), (v, m) => (p(), w("section", {
596
+ return _({ refreshAll: oe, refreshPanel: e, exportCsv: se, exportPng: le }), (v, p) => (u(), b("section", {
580
597
  ref_key: "dashboardElement",
581
- ref: h,
598
+ ref: g,
582
599
  class: "dv-dashboard"
583
600
  }, [
584
- v.showHeader ? (p(), w("header", Pt, [
585
- I("div", null, [
586
- I("h1", null, L(v.runtime.config.title), 1),
587
- v.runtime.config.description ? (p(), w("p", Dt, L(v.runtime.config.description), 1)) : $("", !0)
601
+ v.showHeader ? (u(), b("header", Dt, [
602
+ R("div", null, [
603
+ R("h1", null, L(v.runtime.config.title), 1),
604
+ v.runtime.config.description ? (u(), b("p", At, L(v.runtime.config.description), 1)) : $("", !0)
588
605
  ])
589
606
  ])) : $("", !0),
590
- v.runtime.config.filterBar ? (p(), z(at, {
607
+ v.runtime.config.filterBar ? (u(), z(it, {
591
608
  key: 1,
592
609
  config: v.runtime.config.filterBar,
593
- context: u(c),
594
- loading: u(f),
595
- onChange: we,
596
- onRefresh: ie
610
+ context: c(r),
611
+ loading: c(m),
612
+ onChange: Me,
613
+ onRefresh: oe
597
614
  }, null, 8, ["config", "context", "loading"])) : $("", !0),
598
- I("div", At, [
599
- (p(!0), w(H, null, K(v.runtime.config.panels, (b) => (p(), w("div", {
600
- key: b.id,
615
+ R("div", zt, [
616
+ (u(!0), b(H, null, G(v.runtime.config.panels, (y) => (u(), b("div", {
617
+ key: y.id,
601
618
  class: "dv-dashboard__cell",
602
- "data-panel-id": b.id,
603
- style: ue(A(b))
619
+ "data-panel-id": y.id,
620
+ style: pe(A(y))
604
621
  }, [
605
- R(kt, {
622
+ k(Rt, {
606
623
  ref_for: !0,
607
- ref: (T) => W(b.id, T),
608
- context: u(c),
609
- definition: v.runtime.dataRuntime.registries.rendererDefinitions.require(b.rendererId),
610
- "filter-summary": g.value,
611
- panel: b,
612
- "refresh-disabled": u(f),
613
- renderer: F(b),
614
- state: u(l)[b.id],
615
- onAction: (T) => v.runtime.executePanelAction(b.id, T),
616
- onExportCsv: (T) => oe(b.id),
617
- onExportPng: (T) => re(b.id),
618
- onRefresh: (T) => u(i)(b.id),
619
- onRetry: (T) => u(a)(b.id),
620
- onVisualizationEvent: m[0] || (m[0] = (T) => v.runtime.dispatchEvent(T))
624
+ ref: (T) => Q(y.id, T),
625
+ context: c(r),
626
+ definition: v.runtime.dataRuntime.registries.rendererDefinitions.require(y.rendererId),
627
+ "filter-summary": f.value,
628
+ panel: y,
629
+ "refresh-disabled": c(m),
630
+ renderer: E(y),
631
+ state: c(l)[y.id],
632
+ onAction: (T) => v.runtime.executePanelAction(y.id, T),
633
+ onExportCsv: (T) => se(y.id),
634
+ onExportPng: (T) => le(y.id),
635
+ onRefresh: (T) => c(e)(y.id),
636
+ onRetry: (T) => c(a)(y.id),
637
+ onVisualizationEvent: p[0] || (p[0] = (T) => v.runtime.dispatchEvent(T))
621
638
  }, null, 8, ["context", "definition", "filter-summary", "panel", "refresh-disabled", "renderer", "state", "onAction", "onExportCsv", "onExportPng", "onRefresh", "onRetry"])
622
- ], 12, zt))), 128))
639
+ ], 12, Lt))), 128))
623
640
  ])
624
641
  ], 512));
625
642
  }
626
- }), dn = /* @__PURE__ */ B(Lt, [["__scopeId", "data-v-6d4b5bdb"]]);
627
- function ne(r) {
628
- return r.type === "percent" ? Z.PERCENT : r.type === "decimal" ? Z.DECIMAL : Z.COMMAS;
643
+ }), cn = /* @__PURE__ */ B(Tt, [["__scopeId", "data-v-39ec9b07"]]);
644
+ function ie(o) {
645
+ return o.type === "percent" ? X.PERCENT : o.type === "decimal" ? X.DECIMAL : X.COMMAS;
629
646
  }
630
- function ae(r) {
631
- return typeof r == "object" && r !== null ? r : {};
647
+ function re(o) {
648
+ return typeof o == "object" && o !== null ? o : {};
632
649
  }
633
- const Tt = { class: "dv-chart-renderer dv-bar-renderer" }, Ft = /* @__PURE__ */ O({
650
+ const Et = { class: "dv-chart-renderer dv-bar-renderer" }, Ft = /* @__PURE__ */ O({
634
651
  __name: "BarRenderer",
635
652
  props: {
636
653
  viewModel: {},
@@ -638,82 +655,82 @@ const Tt = { class: "dv-chart-renderer dv-bar-renderer" }, Ft = /* @__PURE__ */
638
655
  context: {}
639
656
  },
640
657
  emits: ["visualizationEvent"],
641
- setup(r, { expose: _, emit: o }) {
642
- const e = r, h = o, x = j();
643
- function C(c, l, f = !1) {
644
- const d = f ? E.formatAxis(c, l.format, e.context) : E.formatTooltip(c, l.format, e.context), n = l.format.type === "currency" || l.format.type === "percent" || l.format.unit;
645
- return c != null && c !== "" && l.unit && !n ? `${d}${l.unit}` : d;
658
+ setup(o, { expose: _, emit: i }) {
659
+ const t = o, g = i, M = j();
660
+ function x(r, l, m = !1) {
661
+ const d = m ? F.formatAxis(r, l.format, t.context) : F.formatTooltip(r, l.format, t.context), w = l.format.type === "currency" || l.format.type === "percent" || l.format.unit;
662
+ return r != null && r !== "" && l.unit && !w ? `${d}${l.unit}` : d;
646
663
  }
647
- const s = P(() => ({
648
- categories: [...e.viewModel.categories],
649
- colors: [...te],
650
- orientation: e.viewModel.orientation,
651
- ...e.viewModel.visibleCount !== void 0 ? { visibleCount: e.viewModel.visibleCount } : {},
664
+ const s = I(() => ({
665
+ categories: [...t.viewModel.categories],
666
+ colors: [...ae],
667
+ orientation: t.viewModel.orientation,
668
+ ...t.viewModel.visibleCount !== void 0 ? { visibleCount: t.viewModel.visibleCount } : {},
652
669
  grid: {
653
670
  top: 18,
654
- right: e.viewModel.orientation === "horizontal" && e.viewModel.showLabels ? 78 : 18,
671
+ right: t.viewModel.orientation === "horizontal" && t.viewModel.showLabels ? 78 : 18,
655
672
  bottom: 10,
656
673
  left: 16,
657
674
  containLabel: !0
658
675
  },
659
676
  categoryAxis: {
660
- ...Q,
661
- ...e.viewModel.orientation === "horizontal" && e.viewModel.visibleCount !== void 0 ? { inverse: !0 } : {},
662
- axisLabel: { ...Q.axisLabel, interval: 0 }
677
+ ...J,
678
+ ...t.viewModel.orientation === "horizontal" && t.viewModel.visibleCount !== void 0 ? { inverse: !0 } : {},
679
+ axisLabel: { ...J.axisLabel, interval: 0 }
663
680
  },
664
681
  valueAxis: {
665
- ...G,
682
+ ...W,
666
683
  splitNumber: 4,
667
684
  axisLabel: {
668
- ...G.axisLabel,
685
+ ...W.axisLabel,
669
686
  hideOverlap: !0,
670
- ...e.viewModel.series[0] ? { formatter: (c) => C(c, e.viewModel.series[0], !0) } : {}
687
+ ...t.viewModel.series[0] ? { formatter: (r) => x(r, t.viewModel.series[0], !0) } : {}
671
688
  }
672
689
  },
673
690
  tooltip: {
674
- ...ee,
691
+ ...ne,
675
692
  axisPointer: { type: "shadow", shadowStyle: { color: "rgba(91, 114, 238, 0.055)" } }
676
693
  },
677
- ...e.viewModel.stacked ? { stack: "total" } : {},
678
- series: e.viewModel.series.map((c) => ({
679
- name: c.label,
680
- data: [...c.values],
681
- formatType: ne(c.format),
682
- valueFormatter: (l) => C(l, c),
683
- showLabel: e.viewModel.showLabels,
694
+ ...t.viewModel.stacked ? { stack: "total" } : {},
695
+ series: t.viewModel.series.map((r) => ({
696
+ name: r.label,
697
+ data: [...r.values],
698
+ formatType: ie(r.format),
699
+ valueFormatter: (l) => x(l, r),
700
+ showLabel: t.viewModel.showLabels,
684
701
  itemStyle: {
685
- borderRadius: e.viewModel.orientation === "horizontal" ? [0, 5, 5, 0] : [5, 5, 0, 0]
702
+ borderRadius: t.viewModel.orientation === "horizontal" ? [0, 5, 5, 0] : [5, 5, 0, 0]
686
703
  }
687
704
  }))
688
705
  }));
689
- function S(c) {
690
- const l = ae(c), f = typeof l.seriesIndex == "number" ? l.seriesIndex : 0, d = e.panel.binding.type === "bar" ? e.panel.binding : void 0;
691
- d && h("visualizationEvent", {
706
+ function C(r) {
707
+ const l = re(r), m = typeof l.seriesIndex == "number" ? l.seriesIndex : 0, d = t.panel.binding.type === "bar" ? t.panel.binding : void 0;
708
+ d && g("visualizationEvent", {
692
709
  type: "dataPointClick",
693
- panelId: e.panel.id,
710
+ panelId: t.panel.id,
694
711
  datasetId: d.datasetId,
695
712
  fields: Object.freeze({
696
713
  [d.categoryField]: l.name,
697
714
  ...d.seriesField ? { [d.seriesField]: l.seriesName } : {},
698
- [d.valueFields[d.seriesField ? 0 : f] ?? d.valueFields[0]]: l.value
715
+ [d.valueFields[d.seriesField ? 0 : m] ?? d.valueFields[0]]: l.value
699
716
  })
700
717
  });
701
718
  }
702
- function D() {
703
- var c;
704
- return (c = x.value) == null ? void 0 : c.exportPng();
719
+ function P() {
720
+ var r;
721
+ return (r = M.value) == null ? void 0 : r.exportPng();
705
722
  }
706
- return _({ exportPng: D }), (c, l) => (p(), w("div", Tt, [
707
- R(u(Ae), {
723
+ return _({ exportPng: P }), (r, l) => (u(), b("div", Et, [
724
+ k(c(ze), {
708
725
  ref_key: "chartRef",
709
- ref: x,
726
+ ref: M,
710
727
  option: s.value,
711
- size: u(J).SMALL,
712
- onDataPointClick: S
728
+ size: c(te).SMALL,
729
+ onDataPointClick: C
713
730
  }, null, 8, ["option", "size"])
714
731
  ]));
715
732
  }
716
- }), Et = /* @__PURE__ */ B(Ft, [["__scopeId", "data-v-4f111bdf"]]), Vt = { class: "dv-chart-renderer dv-line-renderer" }, Ot = /* @__PURE__ */ O({
733
+ }), Vt = /* @__PURE__ */ B(Ft, [["__scopeId", "data-v-4f111bdf"]]), Ot = { class: "dv-chart-renderer dv-line-renderer" }, Bt = /* @__PURE__ */ O({
717
734
  __name: "LineRenderer",
718
735
  props: {
719
736
  viewModel: {},
@@ -721,63 +738,63 @@ const Tt = { class: "dv-chart-renderer dv-bar-renderer" }, Ft = /* @__PURE__ */
721
738
  context: {}
722
739
  },
723
740
  emits: ["visualizationEvent"],
724
- setup(r, { expose: _, emit: o }) {
725
- const e = r, h = o, x = j();
726
- function C(l, f) {
727
- const d = E.formatAxis(l, f.format, e.context);
728
- return s(d, f);
741
+ setup(o, { expose: _, emit: i }) {
742
+ const t = o, g = i, M = j();
743
+ function x(l, m) {
744
+ const d = F.formatAxis(l, m.format, t.context);
745
+ return s(d, m);
729
746
  }
730
- function s(l, f) {
731
- const d = f.format.type === "currency" || f.format.type === "percent" || f.format.unit;
732
- return f.unit && !d ? `${l}${f.unit}` : l;
747
+ function s(l, m) {
748
+ const d = m.format.type === "currency" || m.format.type === "percent" || m.format.unit;
749
+ return m.unit && !d ? `${l}${m.unit}` : l;
733
750
  }
734
- const S = P(() => {
751
+ const C = I(() => {
735
752
  const l = Array.from(
736
- new Map(e.viewModel.series.map((d) => [d.axisKey, d])).values()
737
- ), f = new Map(l.map((d, n) => [d.axisKey, n]));
753
+ new Map(t.viewModel.series.map((d) => [d.axisKey, d])).values()
754
+ ), m = new Map(l.map((d, w) => [d.axisKey, w]));
738
755
  return {
739
- colors: [...te],
756
+ colors: [...ae],
740
757
  grid: { top: 18, right: l.length > 1 ? 24 : 16, bottom: 10, left: 16, containLabel: !0 },
741
758
  tooltip: {
742
- ...ee,
759
+ ...ne,
743
760
  axisPointer: { type: "line", lineStyle: { color: "#b8c1d1", type: "dashed" } }
744
761
  },
745
762
  xAxis: {
746
- data: e.viewModel.categories.map(String),
747
- ...Q,
748
- ...e.viewModel.categoryFormat ? {
749
- valueFormatter: (d) => E.formatAxis(d, e.viewModel.categoryFormat, e.context)
763
+ data: t.viewModel.categories.map(String),
764
+ ...J,
765
+ ...t.viewModel.categoryFormat ? {
766
+ valueFormatter: (d) => F.formatAxis(d, t.viewModel.categoryFormat, t.context)
750
767
  } : {}
751
768
  },
752
- yAxis: l.map((d, n) => ({
753
- ...G,
754
- position: n === 0 ? "left" : "right",
755
- show: n < 2,
769
+ yAxis: l.map((d, w) => ({
770
+ ...W,
771
+ position: w === 0 ? "left" : "right",
772
+ show: w < 2,
756
773
  axisLabel: {
757
- ...G.axisLabel,
758
- formatter: (M) => C(M, d)
774
+ ...W.axisLabel,
775
+ formatter: (D) => x(D, d)
759
776
  },
760
777
  splitLine: {
761
- show: n === 0,
778
+ show: w === 0,
762
779
  lineStyle: { color: "#edf0f5", type: "dashed" }
763
780
  }
764
781
  })),
765
- series: e.viewModel.series.map((d, n) => ({
782
+ series: t.viewModel.series.map((d, w) => ({
766
783
  name: d.label,
767
- data: d.values.map((M) => M ?? void 0),
768
- formatType: ne(d.format),
769
- valueFormatter: (M) => {
770
- const i = E.formatTooltip(M, d.format, e.context);
771
- return M == null || M === "" ? i : s(i, d);
784
+ data: d.values.map((D) => D ?? void 0),
785
+ formatType: ie(d.format),
786
+ valueFormatter: (D) => {
787
+ const e = F.formatTooltip(D, d.format, t.context);
788
+ return D == null || D === "" ? e : s(e, d);
772
789
  },
773
- showLabel: e.viewModel.showLabels,
774
- smooth: e.viewModel.smooth,
775
- yAxisIndex: f.get(d.axisKey) ?? 0,
790
+ showLabel: t.viewModel.showLabels,
791
+ smooth: t.viewModel.smooth,
792
+ yAxisIndex: m.get(d.axisKey) ?? 0,
776
793
  showSymbol: !1,
777
794
  symbol: "circle",
778
795
  symbolSize: 7,
779
- lineStyle: { width: n === 0 ? 3 : 2.25 },
780
- ...n === 0 ? {
796
+ lineStyle: { width: w === 0 ? 3 : 2.25 },
797
+ ...w === 0 ? {
781
798
  areaStyle: {
782
799
  opacity: 1,
783
800
  color: {
@@ -795,83 +812,83 @@ const Tt = { class: "dv-chart-renderer dv-bar-renderer" }, Ft = /* @__PURE__ */
795
812
  } : {}
796
813
  })),
797
814
  markLine: {
798
- xAxis: e.viewModel.annotations.filter((d) => d.type === "category").map((d) => String(d.value)),
799
- yAxis: e.viewModel.annotations.filter((d) => d.type === "value").map((d) => String(d.value))
815
+ xAxis: t.viewModel.annotations.filter((d) => d.type === "category").map((d) => String(d.value)),
816
+ yAxis: t.viewModel.annotations.filter((d) => d.type === "value").map((d) => String(d.value))
800
817
  }
801
818
  };
802
819
  });
803
- function D(l) {
804
- const f = ae(l), d = typeof f.seriesIndex == "number" ? f.seriesIndex : 0, n = e.panel.binding.type === "line" ? e.panel.binding : void 0;
805
- n && h("visualizationEvent", {
820
+ function P(l) {
821
+ const m = re(l), d = typeof m.seriesIndex == "number" ? m.seriesIndex : 0, w = t.panel.binding.type === "line" ? t.panel.binding : void 0;
822
+ w && g("visualizationEvent", {
806
823
  type: "dataPointClick",
807
- panelId: e.panel.id,
808
- datasetId: n.datasetId,
824
+ panelId: t.panel.id,
825
+ datasetId: w.datasetId,
809
826
  fields: Object.freeze({
810
- [n.xField]: f.name,
811
- ...n.seriesField ? { [n.seriesField]: f.seriesName } : {},
812
- [n.yFields[n.seriesField ? 0 : d] ?? n.yFields[0]]: f.value
827
+ [w.xField]: m.name,
828
+ ...w.seriesField ? { [w.seriesField]: m.seriesName } : {},
829
+ [w.yFields[w.seriesField ? 0 : d] ?? w.yFields[0]]: m.value
813
830
  })
814
831
  });
815
832
  }
816
- function c() {
833
+ function r() {
817
834
  var l;
818
- return (l = x.value) == null ? void 0 : l.exportPng();
835
+ return (l = M.value) == null ? void 0 : l.exportPng();
819
836
  }
820
- return _({ exportPng: c }), (l, f) => (p(), w("div", Vt, [
821
- R(u(ze), {
837
+ return _({ exportPng: r }), (l, m) => (u(), b("div", Ot, [
838
+ k(c(Le), {
822
839
  ref_key: "chartRef",
823
- ref: x,
824
- option: S.value,
825
- size: u(J).SMALL,
826
- onDataPointClick: D
840
+ ref: M,
841
+ option: C.value,
842
+ size: c(te).SMALL,
843
+ onDataPointClick: P
827
844
  }, null, 8, ["option", "size"])
828
845
  ]));
829
846
  }
830
- }), Bt = /* @__PURE__ */ B(Ot, [["__scopeId", "data-v-efc34766"]]), Ut = { class: "dv-metric" }, Nt = { class: "dv-metric__value" }, jt = { class: "dv-metric__number" }, Yt = {
847
+ }), Ut = /* @__PURE__ */ B(Bt, [["__scopeId", "data-v-efc34766"]]), Nt = { class: "dv-metric" }, jt = { class: "dv-metric__value" }, Yt = { class: "dv-metric__number" }, Ht = {
831
848
  key: 0,
832
849
  class: "dv-metric__unit"
833
- }, Ht = {
850
+ }, qt = {
834
851
  key: 0,
835
852
  class: "dv-metric__comparison"
836
- }, qt = /* @__PURE__ */ O({
853
+ }, Kt = /* @__PURE__ */ O({
837
854
  __name: "MetricRenderer",
838
855
  props: {
839
856
  viewModel: {},
840
857
  panel: {},
841
858
  context: {}
842
859
  },
843
- setup(r) {
844
- const _ = r, o = P(
845
- () => E.formatDisplay(_.viewModel.value, _.viewModel.format, _.context)
846
- ), e = P(
860
+ setup(o) {
861
+ const _ = o, i = I(
862
+ () => F.formatDisplay(_.viewModel.value, _.viewModel.format, _.context)
863
+ ), t = I(
847
864
  () => _.viewModel.format.type === "currency" || _.viewModel.format.type === "percent" ? void 0 : _.viewModel.unit
848
- ), h = P(() => {
865
+ ), g = I(() => {
849
866
  const s = _.viewModel.comparison;
850
- return s ? E.formatDisplay(s.value, s.format, _.context) : "";
851
- }), x = P(() => {
852
- var s, S;
853
- return ((s = _.viewModel.comparison) == null ? void 0 : s.direction) === "up" ? me : ((S = _.viewModel.comparison) == null ? void 0 : S.direction) === "down" ? _e : ge;
854
- }), C = P(() => {
867
+ return s ? F.formatDisplay(s.value, s.format, _.context) : "";
868
+ }), M = I(() => {
869
+ var s, C;
870
+ return ((s = _.viewModel.comparison) == null ? void 0 : s.direction) === "up" ? _e : ((C = _.viewModel.comparison) == null ? void 0 : C.direction) === "down" ? ge : he;
871
+ }), x = I(() => {
855
872
  const s = _.viewModel.comparison;
856
873
  return !s || s.direction === "flat" ? "neutral" : s.colorMode === "direction" ? s.direction === "up" ? "unfavorable" : "favorable" : s.meaning === "neutral" ? "neutral" : s.meaning === "positive" && s.direction === "up" || s.meaning === "negative" && s.direction === "down" ? "favorable" : "unfavorable";
857
874
  });
858
- return (s, S) => (p(), w("div", Ut, [
859
- I("div", Nt, [
860
- I("span", jt, L(o.value), 1),
861
- e.value ? (p(), w("span", Yt, L(e.value), 1)) : $("", !0)
875
+ return (s, C) => (u(), b("div", Nt, [
876
+ R("div", jt, [
877
+ R("span", Yt, L(i.value), 1),
878
+ t.value ? (u(), b("span", Ht, L(t.value), 1)) : $("", !0)
862
879
  ]),
863
- s.viewModel.comparison ? (p(), w("div", Ht, [
864
- I("span", null, L(s.viewModel.comparison.label), 1),
865
- I("strong", {
866
- class: q(`dv-metric__comparison--${C.value}`)
880
+ s.viewModel.comparison ? (u(), b("div", qt, [
881
+ R("span", null, L(s.viewModel.comparison.label), 1),
882
+ R("strong", {
883
+ class: K(`dv-metric__comparison--${x.value}`)
867
884
  }, [
868
- (p(), z(pe(x.value))),
869
- U(" " + L(h.value), 1)
885
+ (u(), z(fe(M.value))),
886
+ U(" " + L(g.value), 1)
870
887
  ], 2)
871
888
  ])) : $("", !0)
872
889
  ]));
873
890
  }
874
- }), Kt = /* @__PURE__ */ B(qt, [["__scopeId", "data-v-efa26253"]]), Gt = { class: "dv-chart-renderer dv-pie-renderer" }, Wt = /* @__PURE__ */ O({
891
+ }), Gt = /* @__PURE__ */ B(Kt, [["__scopeId", "data-v-efa26253"]]), Wt = { class: "dv-chart-renderer dv-pie-renderer" }, Zt = /* @__PURE__ */ O({
875
892
  __name: "PieRenderer",
876
893
  props: {
877
894
  viewModel: {},
@@ -879,60 +896,60 @@ const Tt = { class: "dv-chart-renderer dv-bar-renderer" }, Ft = /* @__PURE__ */
879
896
  context: {}
880
897
  },
881
898
  emits: ["visualizationEvent"],
882
- setup(r, { expose: _, emit: o }) {
883
- const e = r, h = o, x = j();
884
- function C(c) {
885
- const l = E.formatTooltip(c, e.viewModel.valueFormat, e.context), f = e.viewModel.valueFormat.type === "currency" || e.viewModel.valueFormat.type === "percent" || e.viewModel.valueFormat.unit;
886
- return e.viewModel.unit && !f ? `${l}${e.viewModel.unit}` : l;
899
+ setup(o, { expose: _, emit: i }) {
900
+ const t = o, g = i, M = j();
901
+ function x(r) {
902
+ const l = F.formatTooltip(r, t.viewModel.valueFormat, t.context), m = t.viewModel.valueFormat.type === "currency" || t.viewModel.valueFormat.type === "percent" || t.viewModel.valueFormat.unit;
903
+ return t.viewModel.unit && !m ? `${l}${t.viewModel.unit}` : l;
887
904
  }
888
- const s = P(() => ({
889
- colors: [...te],
890
- donut: e.viewModel.donut,
891
- showLegend: e.viewModel.showLegend,
905
+ const s = I(() => ({
906
+ colors: [...ae],
907
+ donut: t.viewModel.donut,
908
+ showLegend: t.viewModel.showLegend,
892
909
  showLabels: !1,
893
910
  center: ["50%", "43%"],
894
- radius: e.viewModel.donut ? ["50%", "70%"] : "70%",
911
+ radius: t.viewModel.donut ? ["50%", "70%"] : "70%",
895
912
  itemStyle: { borderColor: "#fff", borderWidth: 3, borderRadius: 4 },
896
- tooltip: { ...ee },
897
- series: e.viewModel.items.map((c) => ({
898
- name: c.label,
899
- data: c.value,
900
- formatType: ne(e.viewModel.valueFormat),
901
- valueFormatter: C
913
+ tooltip: { ...ne },
914
+ series: t.viewModel.items.map((r) => ({
915
+ name: r.label,
916
+ data: r.value,
917
+ formatType: ie(t.viewModel.valueFormat),
918
+ valueFormatter: x
902
919
  })),
903
- ...e.viewModel.donut ? {
920
+ ...t.viewModel.donut ? {
904
921
  aggregation: {
905
- total: e.viewModel.items.reduce((c, l) => c + l.value, 0),
906
- label: e.panel.title.replace(/占比$/, ""),
907
- valueFormatter: C,
908
- ...e.viewModel.unit ? { unit: e.viewModel.unit } : {}
922
+ total: t.viewModel.items.reduce((r, l) => r + l.value, 0),
923
+ label: t.panel.title.replace(/占比$/, ""),
924
+ valueFormatter: x,
925
+ ...t.viewModel.unit ? { unit: t.viewModel.unit } : {}
909
926
  }
910
927
  } : {}
911
928
  }));
912
- function S(c) {
913
- const l = ae(c), f = e.panel.binding.type === "pie" ? e.panel.binding : void 0;
914
- f && h("visualizationEvent", {
929
+ function C(r) {
930
+ const l = re(r), m = t.panel.binding.type === "pie" ? t.panel.binding : void 0;
931
+ m && g("visualizationEvent", {
915
932
  type: "dataPointClick",
916
- panelId: e.panel.id,
917
- datasetId: f.datasetId,
918
- fields: Object.freeze({ [f.nameField]: l.name, [f.valueField]: l.value })
933
+ panelId: t.panel.id,
934
+ datasetId: m.datasetId,
935
+ fields: Object.freeze({ [m.nameField]: l.name, [m.valueField]: l.value })
919
936
  });
920
937
  }
921
- function D() {
922
- var c;
923
- return (c = x.value) == null ? void 0 : c.exportPng();
938
+ function P() {
939
+ var r;
940
+ return (r = M.value) == null ? void 0 : r.exportPng();
924
941
  }
925
- return _({ exportPng: D }), (c, l) => (p(), w("div", Gt, [
926
- R(u(Le), {
942
+ return _({ exportPng: P }), (r, l) => (u(), b("div", Wt, [
943
+ k(c(Te), {
927
944
  ref_key: "chartRef",
928
- ref: x,
945
+ ref: M,
929
946
  option: s.value,
930
- size: u(J).SMALL,
931
- onDataPointClick: S
947
+ size: c(te).SMALL,
948
+ onDataPointClick: C
932
949
  }, null, 8, ["option", "size"])
933
950
  ]));
934
951
  }
935
- }), Zt = /* @__PURE__ */ B(Wt, [["__scopeId", "data-v-ccdee116"]]), Qt = { class: "dv-table-scroll" }, Xt = /* @__PURE__ */ O({
952
+ }), Qt = /* @__PURE__ */ B(Zt, [["__scopeId", "data-v-ccdee116"]]), Xt = { class: "dv-table-scroll" }, Jt = /* @__PURE__ */ O({
936
953
  __name: "TableRenderer",
937
954
  props: {
938
955
  viewModel: {},
@@ -940,136 +957,136 @@ const Tt = { class: "dv-chart-renderer dv-bar-renderer" }, Ft = /* @__PURE__ */
940
957
  context: {}
941
958
  },
942
959
  emits: ["visualizationEvent"],
943
- setup(r, { emit: _ }) {
944
- const o = r, e = _, h = P(
945
- () => o.viewModel.columns.map((a) => ({
960
+ setup(o, { emit: _ }) {
961
+ const i = o, t = _, g = I(
962
+ () => i.viewModel.columns.map((a) => ({
946
963
  title: a.label,
947
964
  dataIndex: a.field,
948
965
  key: a.field,
949
966
  ...a.width ? { width: a.width } : {},
950
967
  sorter: a.sortable,
951
968
  ...a.filterable ? {
952
- filters: Array.from(new Set(o.viewModel.rows.map((t) => String(t[a.field] ?? "")))).slice(0, 50).map((t) => ({ text: t || "--", value: t })),
953
- onFilter: (t, g) => String(g[a.field] ?? "") === String(t)
969
+ filters: Array.from(new Set(i.viewModel.rows.map((n) => String(n[a.field] ?? "")))).slice(0, 50).map((n) => ({ text: n || "--", value: n })),
970
+ onFilter: (n, f) => String(f[a.field] ?? "") === String(n)
954
971
  } : {},
955
- customRender: ({ text: t }) => C(t, a)
972
+ customRender: ({ text: n }) => x(n, a)
956
973
  }))
957
974
  );
958
- function x(a, t) {
959
- return E.formatDisplay(
975
+ function M(a, n) {
976
+ return F.formatDisplay(
960
977
  a,
961
- t.format ?? {
962
- type: t.dataType === "date" ? "date" : t.dataType === "datetime" ? "datetime" : "number"
978
+ n.format ?? {
979
+ type: n.dataType === "date" ? "date" : n.dataType === "datetime" ? "datetime" : "number"
963
980
  },
964
- o.context
981
+ i.context
965
982
  );
966
983
  }
967
- function C(a, t) {
968
- const g = x(a, t);
969
- return t.display ? t.display.type === "progress" ? S(a, g, t.display) : t.display.type === "trend" ? D(a, g, t.display) : c(a, g, t.display) : g;
984
+ function x(a, n) {
985
+ const f = M(a, n);
986
+ return n.display ? n.display.type === "progress" ? C(a, f, n.display) : n.display.type === "trend" ? P(a, f, n.display) : r(a, f, n.display) : f;
970
987
  }
971
988
  function s(a) {
972
989
  return typeof a == "number" && Number.isFinite(a) ? a : void 0;
973
990
  }
974
- function S(a, t, g) {
975
- const y = s(a);
976
- if (y === void 0) return t;
977
- const A = g.max ?? 1, F = Math.min(100, Math.max(0, y / A * 100));
991
+ function C(a, n, f) {
992
+ const h = s(a);
993
+ if (h === void 0) return n;
994
+ const A = f.max ?? 1, E = Math.min(100, Math.max(0, h / A * 100));
978
995
  return V("div", { class: "dv-table__progress-cell" }, [
979
- V(qe, { percent: F, showInfo: !1, size: "small", strokeWidth: 6 }),
980
- V("span", { class: "dv-table__cell-value" }, t)
996
+ V(Ke, { percent: E, showInfo: !1, size: "small", strokeWidth: 6 }),
997
+ V("span", { class: "dv-table__cell-value" }, n)
981
998
  ]);
982
999
  }
983
- function D(a, t, g) {
984
- const y = s(a);
985
- if (y === void 0) return t;
986
- const A = y > 0 ? g.positiveTone ?? "success" : y < 0 ? g.negativeTone ?? "danger" : g.zeroTone ?? "neutral", F = y > 0 ? me : y < 0 ? _e : ge;
987
- return V("span", { class: ["dv-table__trend", `dv-table__trend--${A}`] }, [V(F), V("span", t)]);
1000
+ function P(a, n, f) {
1001
+ const h = s(a);
1002
+ if (h === void 0) return n;
1003
+ const A = h > 0 ? f.positiveTone ?? "success" : h < 0 ? f.negativeTone ?? "danger" : f.zeroTone ?? "neutral", E = h > 0 ? _e : h < 0 ? ge : he;
1004
+ return V("span", { class: ["dv-table__trend", `dv-table__trend--${A}`] }, [V(E), V("span", n)]);
988
1005
  }
989
- function c(a, t, g) {
1006
+ function r(a, n, f) {
990
1007
  var A;
991
- const y = ((A = g.toneByValue) == null ? void 0 : A[String(a ?? "")]) ?? g.defaultTone ?? "neutral";
992
- return l(t, y);
1008
+ const h = ((A = f.toneByValue) == null ? void 0 : A[String(a ?? "")]) ?? f.defaultTone ?? "neutral";
1009
+ return l(n, h);
993
1010
  }
994
- function l(a, t, g) {
1011
+ function l(a, n, f) {
995
1012
  return V(
996
- Ke,
997
- { class: ["dv-table__tag", `dv-table__tag--${t}`] },
1013
+ Ge,
1014
+ { class: ["dv-table__tag", `dv-table__tag--${n}`] },
998
1015
  { default: () => [V("span", a)] }
999
1016
  );
1000
1017
  }
1001
- const f = /* @__PURE__ */ new WeakMap();
1018
+ const m = /* @__PURE__ */ new WeakMap();
1002
1019
  let d = 0;
1003
- function n(a) {
1004
- const t = f.get(a);
1005
- if (t) return t;
1006
- const g = `row-${++d}`;
1007
- return f.set(a, g), g;
1020
+ function w(a) {
1021
+ const n = m.get(a);
1022
+ if (n) return n;
1023
+ const f = `row-${++d}`;
1024
+ return m.set(a, f), f;
1008
1025
  }
1009
- function M(a) {
1026
+ function D(a) {
1010
1027
  return {
1011
- onClick: () => e("visualizationEvent", {
1028
+ onClick: () => t("visualizationEvent", {
1012
1029
  type: "rowClick",
1013
- panelId: o.panel.id,
1014
- datasetId: o.panel.binding.datasetId,
1030
+ panelId: i.panel.id,
1031
+ datasetId: i.panel.binding.datasetId,
1015
1032
  fields: a
1016
1033
  })
1017
1034
  };
1018
1035
  }
1019
- function i() {
1036
+ function e() {
1020
1037
  }
1021
- return (a, t) => (p(), w("div", Qt, [
1022
- R(u(Ge), {
1038
+ return (a, n) => (u(), b("div", Xt, [
1039
+ k(c(We), {
1023
1040
  class: "dv-table",
1024
- columns: h.value,
1041
+ columns: g.value,
1025
1042
  "data-source": [...a.viewModel.rows],
1026
1043
  pagination: a.viewModel.showPagination ? { pageSize: a.viewModel.pageSize, showSizeChanger: !1 } : !1,
1027
- "row-key": n,
1044
+ "row-key": w,
1028
1045
  scroll: { x: "max-content" },
1029
1046
  size: "small",
1030
- onChange: i,
1031
- "custom-row": M
1047
+ onChange: e,
1048
+ "custom-row": D
1032
1049
  }, null, 8, ["columns", "data-source", "pagination"])
1033
1050
  ]));
1034
1051
  }
1035
- }), Jt = /* @__PURE__ */ B(Xt, [["__scopeId", "data-v-c8a717c4"]]);
1036
- function cn(r) {
1037
- return r.registerMany([
1038
- { id: "metric", component: Kt },
1039
- { id: "line", component: Bt },
1040
- { id: "bar", component: Et },
1041
- { id: "pie", component: Zt },
1042
- { id: "table", component: Jt }
1043
- ]), r;
1052
+ }), en = /* @__PURE__ */ B(Jt, [["__scopeId", "data-v-c8a717c4"]]);
1053
+ function un(o) {
1054
+ return o.registerMany([
1055
+ { id: "metric", component: Gt },
1056
+ { id: "line", component: Ut },
1057
+ { id: "bar", component: Vt },
1058
+ { id: "pie", component: Qt },
1059
+ { id: "table", component: en }
1060
+ ]), o;
1044
1061
  }
1045
- class en extends Xe {
1062
+ class tn extends Je {
1046
1063
  constructor() {
1047
1064
  super("VueVisualizationRenderer");
1048
1065
  }
1049
1066
  }
1050
- function un() {
1051
- return new en();
1067
+ function pn() {
1068
+ return new tn();
1052
1069
  }
1053
1070
  export {
1054
- Et as BarRenderer,
1055
- at as DashboardFilterBar,
1056
- kt as DashboardPanel,
1057
- dn as DashboardRenderer,
1058
- Bt as LineRenderer,
1059
- Kt as MetricRenderer,
1060
- Zt as PieRenderer,
1061
- Q as STANDARD_CATEGORY_AXIS,
1062
- te as STANDARD_CHART_COLORS,
1063
- ee as STANDARD_CHART_TOOLTIP,
1064
- G as STANDARD_VALUE_AXIS,
1065
- Jt as TableRenderer,
1066
- en as VueRendererRegistry,
1067
- ae as chartEventFields,
1068
- un as createVueRendererRegistry,
1069
- It as downloadBlob,
1071
+ Vt as BarRenderer,
1072
+ it as DashboardFilterBar,
1073
+ Rt as DashboardPanel,
1074
+ cn as DashboardRenderer,
1075
+ Ut as LineRenderer,
1076
+ Gt as MetricRenderer,
1077
+ Qt as PieRenderer,
1078
+ J as STANDARD_CATEGORY_AXIS,
1079
+ ae as STANDARD_CHART_COLORS,
1080
+ ne as STANDARD_CHART_TOOLTIP,
1081
+ W as STANDARD_VALUE_AXIS,
1082
+ en as TableRenderer,
1083
+ tn as VueRendererRegistry,
1084
+ re as chartEventFields,
1085
+ pn as createVueRendererRegistry,
1086
+ Pt as downloadBlob,
1070
1087
  $t as downloadDataUrl,
1071
- cn as registerStandardVueRenderers,
1072
- ne as toChartFormat,
1073
- Rt as useDashboardRuntime
1088
+ un as registerStandardVueRenderers,
1089
+ ie as toChartFormat,
1090
+ It as useDashboardRuntime
1074
1091
  };
1075
1092
  //# sourceMappingURL=index.js.map