@record-evolution/widget-gauge 1.7.35 → 1.7.37
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/widget-gauge.js +260 -228
- package/dist/widget-gauge.js.map +1 -1
- package/package.json +6 -2
- package/src/widget-gauge.ts +118 -61
package/dist/widget-gauge.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { TooltipComponent as
|
|
3
|
-
import { GaugeChart as
|
|
4
|
-
import { CanvasRenderer as
|
|
5
|
-
const
|
|
6
|
-
let
|
|
1
|
+
import * as V from "echarts/core";
|
|
2
|
+
import { TooltipComponent as At } from "echarts/components";
|
|
3
|
+
import { GaugeChart as St } from "echarts/charts";
|
|
4
|
+
import { CanvasRenderer as Ct } from "echarts/renderers";
|
|
5
|
+
const B = globalThis, K = B.ShadowRoot && (B.ShadyCSS === void 0 || B.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, Z = /* @__PURE__ */ Symbol(), nt = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
let gt = class {
|
|
7
7
|
constructor(t, e, i) {
|
|
8
8
|
if (this._$cssResult$ = !0, i !== Z) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
9
9
|
this.cssText = t, this.t = e;
|
|
@@ -13,7 +13,7 @@ let ut = class {
|
|
|
13
13
|
const e = this.t;
|
|
14
14
|
if (K && t === void 0) {
|
|
15
15
|
const i = e !== void 0 && e.length === 1;
|
|
16
|
-
i && (t =
|
|
16
|
+
i && (t = nt.get(e)), t === void 0 && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), i && nt.set(e, t));
|
|
17
17
|
}
|
|
18
18
|
return t;
|
|
19
19
|
}
|
|
@@ -21,28 +21,28 @@ let ut = class {
|
|
|
21
21
|
return this.cssText;
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
const
|
|
24
|
+
const wt = (s) => new gt(typeof s == "string" ? s : s + "", void 0, Z), xt = (s, ...t) => {
|
|
25
25
|
const e = s.length === 1 ? s[0] : t.reduce(((i, r, n) => i + ((o) => {
|
|
26
26
|
if (o._$cssResult$ === !0) return o.cssText;
|
|
27
27
|
if (typeof o == "number") return o;
|
|
28
28
|
throw Error("Value passed to 'css' function must be a 'css' function result: " + o + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
29
29
|
})(r) + s[n + 1]), s[0]);
|
|
30
|
-
return new
|
|
31
|
-
},
|
|
30
|
+
return new gt(e, s, Z);
|
|
31
|
+
}, Et = (s, t) => {
|
|
32
32
|
if (K) s.adoptedStyleSheets = t.map(((e) => e instanceof CSSStyleSheet ? e : e.styleSheet));
|
|
33
33
|
else for (const e of t) {
|
|
34
|
-
const i = document.createElement("style"), r =
|
|
34
|
+
const i = document.createElement("style"), r = B.litNonce;
|
|
35
35
|
r !== void 0 && i.setAttribute("nonce", r), i.textContent = e.cssText, s.appendChild(i);
|
|
36
36
|
}
|
|
37
|
-
},
|
|
37
|
+
}, ot = K ? (s) => s : (s) => s instanceof CSSStyleSheet ? ((t) => {
|
|
38
38
|
let e = "";
|
|
39
39
|
for (const i of t.cssRules) e += i.cssText;
|
|
40
|
-
return
|
|
40
|
+
return wt(e);
|
|
41
41
|
})(s) : s;
|
|
42
|
-
const { is:
|
|
42
|
+
const { is: Pt, defineProperty: Tt, getOwnPropertyDescriptor: Ot, getOwnPropertyNames: Nt, getOwnPropertySymbols: zt, getPrototypeOf: Mt } = Object, q = globalThis, at = q.trustedTypes, Ut = at ? at.emptyScript : "", Ht = q.reactiveElementPolyfillSupport, U = (s, t) => s, W = { toAttribute(s, t) {
|
|
43
43
|
switch (t) {
|
|
44
44
|
case Boolean:
|
|
45
|
-
s = s ?
|
|
45
|
+
s = s ? Ut : null;
|
|
46
46
|
break;
|
|
47
47
|
case Object:
|
|
48
48
|
case Array:
|
|
@@ -67,44 +67,44 @@ const { is: xt, defineProperty: Et, getOwnPropertyDescriptor: Pt, getOwnProperty
|
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
return e;
|
|
70
|
-
} }, F = (s, t) => !
|
|
71
|
-
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"),
|
|
72
|
-
let
|
|
70
|
+
} }, F = (s, t) => !Pt(s, t), lt = { attribute: !0, type: String, converter: W, reflect: !1, useDefault: !1, hasChanged: F };
|
|
71
|
+
Symbol.metadata ??= /* @__PURE__ */ Symbol("metadata"), q.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
|
|
72
|
+
let T = class extends HTMLElement {
|
|
73
73
|
static addInitializer(t) {
|
|
74
74
|
this._$Ei(), (this.l ??= []).push(t);
|
|
75
75
|
}
|
|
76
76
|
static get observedAttributes() {
|
|
77
77
|
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
78
78
|
}
|
|
79
|
-
static createProperty(t, e =
|
|
79
|
+
static createProperty(t, e = lt) {
|
|
80
80
|
if (e.state && (e.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((e = Object.create(e)).wrapped = !0), this.elementProperties.set(t, e), !e.noAccessor) {
|
|
81
81
|
const i = /* @__PURE__ */ Symbol(), r = this.getPropertyDescriptor(t, i, e);
|
|
82
|
-
r !== void 0 &&
|
|
82
|
+
r !== void 0 && Tt(this.prototype, t, r);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
static getPropertyDescriptor(t, e, i) {
|
|
86
|
-
const { get: r, set: n } =
|
|
86
|
+
const { get: r, set: n } = Ot(this.prototype, t) ?? { get() {
|
|
87
87
|
return this[e];
|
|
88
88
|
}, set(o) {
|
|
89
89
|
this[e] = o;
|
|
90
90
|
} };
|
|
91
91
|
return { get: r, set(o) {
|
|
92
|
-
const
|
|
93
|
-
n?.call(this, o), this.requestUpdate(t,
|
|
92
|
+
const h = r?.call(this);
|
|
93
|
+
n?.call(this, o), this.requestUpdate(t, h, i);
|
|
94
94
|
}, configurable: !0, enumerable: !0 };
|
|
95
95
|
}
|
|
96
96
|
static getPropertyOptions(t) {
|
|
97
|
-
return this.elementProperties.get(t) ??
|
|
97
|
+
return this.elementProperties.get(t) ?? lt;
|
|
98
98
|
}
|
|
99
99
|
static _$Ei() {
|
|
100
|
-
if (this.hasOwnProperty(
|
|
101
|
-
const t =
|
|
100
|
+
if (this.hasOwnProperty(U("elementProperties"))) return;
|
|
101
|
+
const t = Mt(this);
|
|
102
102
|
t.finalize(), t.l !== void 0 && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
103
103
|
}
|
|
104
104
|
static finalize() {
|
|
105
|
-
if (this.hasOwnProperty(
|
|
106
|
-
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(
|
|
107
|
-
const e = this.properties, i = [...
|
|
105
|
+
if (this.hasOwnProperty(U("finalized"))) return;
|
|
106
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(U("properties"))) {
|
|
107
|
+
const e = this.properties, i = [...Nt(e), ...zt(e)];
|
|
108
108
|
for (const r of i) this.createProperty(r, e[r]);
|
|
109
109
|
}
|
|
110
110
|
const t = this[Symbol.metadata];
|
|
@@ -123,8 +123,8 @@ let w = class extends HTMLElement {
|
|
|
123
123
|
const e = [];
|
|
124
124
|
if (Array.isArray(t)) {
|
|
125
125
|
const i = new Set(t.flat(1 / 0).reverse());
|
|
126
|
-
for (const r of i) e.unshift(
|
|
127
|
-
} else t !== void 0 && e.push(
|
|
126
|
+
for (const r of i) e.unshift(ot(r));
|
|
127
|
+
} else t !== void 0 && e.push(ot(t));
|
|
128
128
|
return e;
|
|
129
129
|
}
|
|
130
130
|
static _$Eu(t, e) {
|
|
@@ -150,7 +150,7 @@ let w = class extends HTMLElement {
|
|
|
150
150
|
}
|
|
151
151
|
createRenderRoot() {
|
|
152
152
|
const t = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
|
|
153
|
-
return
|
|
153
|
+
return Et(t, this.constructor.elementStyles), t;
|
|
154
154
|
}
|
|
155
155
|
connectedCallback() {
|
|
156
156
|
this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(!0), this._$EO?.forEach(((t) => t.hostConnected?.()));
|
|
@@ -166,14 +166,14 @@ let w = class extends HTMLElement {
|
|
|
166
166
|
_$ET(t, e) {
|
|
167
167
|
const i = this.constructor.elementProperties.get(t), r = this.constructor._$Eu(t, i);
|
|
168
168
|
if (r !== void 0 && i.reflect === !0) {
|
|
169
|
-
const n = (i.converter?.toAttribute !== void 0 ? i.converter :
|
|
169
|
+
const n = (i.converter?.toAttribute !== void 0 ? i.converter : W).toAttribute(e, i.type);
|
|
170
170
|
this._$Em = t, n == null ? this.removeAttribute(r) : this.setAttribute(r, n), this._$Em = null;
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
_$AK(t, e) {
|
|
174
174
|
const i = this.constructor, r = i._$Eh.get(t);
|
|
175
175
|
if (r !== void 0 && this._$Em !== r) {
|
|
176
|
-
const n = i.getPropertyOptions(r), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter :
|
|
176
|
+
const n = i.getPropertyOptions(r), o = typeof n.converter == "function" ? { fromAttribute: n.converter } : n.converter?.fromAttribute !== void 0 ? n.converter : W;
|
|
177
177
|
this._$Em = r, this[r] = o.fromAttribute(e, n.type) ?? this._$Ej?.get(r) ?? null, this._$Em = null;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
@@ -210,8 +210,8 @@ let w = class extends HTMLElement {
|
|
|
210
210
|
}
|
|
211
211
|
const i = this.constructor.elementProperties;
|
|
212
212
|
if (i.size > 0) for (const [r, n] of i) {
|
|
213
|
-
const { wrapped: o } = n,
|
|
214
|
-
o !== !0 || this._$AL.has(r) ||
|
|
213
|
+
const { wrapped: o } = n, h = this[r];
|
|
214
|
+
o !== !0 || this._$AL.has(r) || h === void 0 || this.C(r, void 0, n, h);
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
217
|
let t = !1;
|
|
@@ -248,70 +248,70 @@ let w = class extends HTMLElement {
|
|
|
248
248
|
firstUpdated(t) {
|
|
249
249
|
}
|
|
250
250
|
};
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
\f\r]`,
|
|
254
|
-
\f\r"'\`<>=]|("|')|))|$)`, "g"),
|
|
255
|
-
function
|
|
256
|
-
if (!
|
|
257
|
-
return
|
|
251
|
+
T.elementStyles = [], T.shadowRootOptions = { mode: "open" }, T[U("elementProperties")] = /* @__PURE__ */ new Map(), T[U("finalized")] = /* @__PURE__ */ new Map(), Ht?.({ ReactiveElement: T }), (q.reactiveElementVersions ??= []).push("2.1.0");
|
|
252
|
+
const Q = globalThis, I = Q.trustedTypes, ht = I ? I.createPolicy("lit-html", { createHTML: (s) => s }) : void 0, mt = "$lit$", w = `lit$${Math.random().toFixed(9).slice(2)}$`, $t = "?" + w, Lt = `<${$t}>`, P = document, L = () => P.createComment(""), D = (s) => s === null || typeof s != "object" && typeof s != "function", X = Array.isArray, Dt = (s) => X(s) || typeof s?.[Symbol.iterator] == "function", J = `[
|
|
253
|
+
\f\r]`, M = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, ct = /-->/g, dt = />/g, x = RegExp(`>|${J}(?:([^\\s"'>=/]+)(${J}*=${J}*(?:[^
|
|
254
|
+
\f\r"'\`<>=]|("|')|))|$)`, "g"), pt = /'/g, ut = /"/g, yt = /^(?:script|style|textarea|title)$/i, jt = (s) => (t, ...e) => ({ _$litType$: s, strings: t, values: e }), Rt = jt(1), O = /* @__PURE__ */ Symbol.for("lit-noChange"), g = /* @__PURE__ */ Symbol.for("lit-nothing"), ft = /* @__PURE__ */ new WeakMap(), E = P.createTreeWalker(P, 129);
|
|
255
|
+
function _t(s, t) {
|
|
256
|
+
if (!X(s) || !s.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
257
|
+
return ht !== void 0 ? ht.createHTML(t) : t;
|
|
258
258
|
}
|
|
259
|
-
const
|
|
259
|
+
const kt = (s, t) => {
|
|
260
260
|
const e = s.length - 1, i = [];
|
|
261
|
-
let r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o =
|
|
262
|
-
for (let
|
|
263
|
-
const
|
|
264
|
-
let
|
|
265
|
-
for (;
|
|
266
|
-
const
|
|
267
|
-
n += o ===
|
|
268
|
-
}
|
|
269
|
-
return [
|
|
261
|
+
let r, n = t === 2 ? "<svg>" : t === 3 ? "<math>" : "", o = M;
|
|
262
|
+
for (let h = 0; h < e; h++) {
|
|
263
|
+
const l = s[h];
|
|
264
|
+
let p, u, a = -1, c = 0;
|
|
265
|
+
for (; c < l.length && (o.lastIndex = c, u = o.exec(l), u !== null); ) c = o.lastIndex, o === M ? u[1] === "!--" ? o = ct : u[1] !== void 0 ? o = dt : u[2] !== void 0 ? (yt.test(u[2]) && (r = RegExp("</" + u[2], "g")), o = x) : u[3] !== void 0 && (o = x) : o === x ? u[0] === ">" ? (o = r ?? M, a = -1) : u[1] === void 0 ? a = -2 : (a = o.lastIndex - u[2].length, p = u[1], o = u[3] === void 0 ? x : u[3] === '"' ? ut : pt) : o === ut || o === pt ? o = x : o === ct || o === dt ? o = M : (o = x, r = void 0);
|
|
266
|
+
const m = o === x && s[h + 1].startsWith("/>") ? " " : "";
|
|
267
|
+
n += o === M ? l + Lt : a >= 0 ? (i.push(p), l.slice(0, a) + mt + l.slice(a) + w + m) : l + w + (a === -2 ? h : m);
|
|
268
|
+
}
|
|
269
|
+
return [_t(s, n + (s[e] || "<?>") + (t === 2 ? "</svg>" : t === 3 ? "</math>" : "")), i];
|
|
270
270
|
};
|
|
271
|
-
class
|
|
271
|
+
class j {
|
|
272
272
|
constructor({ strings: t, _$litType$: e }, i) {
|
|
273
273
|
let r;
|
|
274
274
|
this.parts = [];
|
|
275
275
|
let n = 0, o = 0;
|
|
276
|
-
const
|
|
277
|
-
if (this.el =
|
|
278
|
-
const
|
|
279
|
-
|
|
276
|
+
const h = t.length - 1, l = this.parts, [p, u] = kt(t, e);
|
|
277
|
+
if (this.el = j.createElement(p, i), E.currentNode = this.el.content, e === 2 || e === 3) {
|
|
278
|
+
const a = this.el.content.firstChild;
|
|
279
|
+
a.replaceWith(...a.childNodes);
|
|
280
280
|
}
|
|
281
|
-
for (; (r =
|
|
281
|
+
for (; (r = E.nextNode()) !== null && l.length < h; ) {
|
|
282
282
|
if (r.nodeType === 1) {
|
|
283
|
-
if (r.hasAttributes()) for (const
|
|
284
|
-
const
|
|
285
|
-
|
|
286
|
-
} else
|
|
287
|
-
if (
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
290
|
-
r.textContent =
|
|
291
|
-
for (let
|
|
292
|
-
r.append(c
|
|
283
|
+
if (r.hasAttributes()) for (const a of r.getAttributeNames()) if (a.endsWith(mt)) {
|
|
284
|
+
const c = u[o++], m = r.getAttribute(a).split(w), $ = /([.?@])?(.*)/.exec(c);
|
|
285
|
+
l.push({ type: 1, index: n, name: $[2], strings: m, ctor: $[1] === "." ? Bt : $[1] === "?" ? Wt : $[1] === "@" ? It : G }), r.removeAttribute(a);
|
|
286
|
+
} else a.startsWith(w) && (l.push({ type: 6, index: n }), r.removeAttribute(a));
|
|
287
|
+
if (yt.test(r.tagName)) {
|
|
288
|
+
const a = r.textContent.split(w), c = a.length - 1;
|
|
289
|
+
if (c > 0) {
|
|
290
|
+
r.textContent = I ? I.emptyScript : "";
|
|
291
|
+
for (let m = 0; m < c; m++) r.append(a[m], L()), E.nextNode(), l.push({ type: 2, index: ++n });
|
|
292
|
+
r.append(a[c], L());
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
} else if (r.nodeType === 8) if (r.data ===
|
|
295
|
+
} else if (r.nodeType === 8) if (r.data === $t) l.push({ type: 2, index: n });
|
|
296
296
|
else {
|
|
297
|
-
let
|
|
298
|
-
for (; (
|
|
297
|
+
let a = -1;
|
|
298
|
+
for (; (a = r.data.indexOf(w, a + 1)) !== -1; ) l.push({ type: 7, index: n }), a += w.length - 1;
|
|
299
299
|
}
|
|
300
300
|
n++;
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
static createElement(t, e) {
|
|
304
|
-
const i =
|
|
304
|
+
const i = P.createElement("template");
|
|
305
305
|
return i.innerHTML = t, i;
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
|
-
function
|
|
309
|
-
if (t ===
|
|
308
|
+
function N(s, t, e = s, i) {
|
|
309
|
+
if (t === O) return t;
|
|
310
310
|
let r = i !== void 0 ? e._$Co?.[i] : e._$Cl;
|
|
311
|
-
const n =
|
|
312
|
-
return r?.constructor !== n && (r?._$AO?.(!1), n === void 0 ? r = void 0 : (r = new n(s), r._$AT(s, e, i)), i !== void 0 ? (e._$Co ??= [])[i] = r : e._$Cl = r), r !== void 0 && (t =
|
|
311
|
+
const n = D(t) ? void 0 : t._$litDirective$;
|
|
312
|
+
return r?.constructor !== n && (r?._$AO?.(!1), n === void 0 ? r = void 0 : (r = new n(s), r._$AT(s, e, i)), i !== void 0 ? (e._$Co ??= [])[i] = r : e._$Cl = r), r !== void 0 && (t = N(s, r._$AS(s, t.values), r, i)), t;
|
|
313
313
|
}
|
|
314
|
-
class
|
|
314
|
+
class Vt {
|
|
315
315
|
constructor(t, e) {
|
|
316
316
|
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = e;
|
|
317
317
|
}
|
|
@@ -322,29 +322,29 @@ class Rt {
|
|
|
322
322
|
return this._$AM._$AU;
|
|
323
323
|
}
|
|
324
324
|
u(t) {
|
|
325
|
-
const { el: { content: e }, parts: i } = this._$AD, r = (t?.creationScope ??
|
|
326
|
-
|
|
327
|
-
let n =
|
|
328
|
-
for (;
|
|
329
|
-
if (o ===
|
|
330
|
-
let
|
|
331
|
-
|
|
325
|
+
const { el: { content: e }, parts: i } = this._$AD, r = (t?.creationScope ?? P).importNode(e, !0);
|
|
326
|
+
E.currentNode = r;
|
|
327
|
+
let n = E.nextNode(), o = 0, h = 0, l = i[0];
|
|
328
|
+
for (; l !== void 0; ) {
|
|
329
|
+
if (o === l.index) {
|
|
330
|
+
let p;
|
|
331
|
+
l.type === 2 ? p = new R(n, n.nextSibling, this, t) : l.type === 1 ? p = new l.ctor(n, l.name, l.strings, this, t) : l.type === 6 && (p = new qt(n, this, t)), this._$AV.push(p), l = i[++h];
|
|
332
332
|
}
|
|
333
|
-
o !==
|
|
333
|
+
o !== l?.index && (n = E.nextNode(), o++);
|
|
334
334
|
}
|
|
335
|
-
return
|
|
335
|
+
return E.currentNode = P, r;
|
|
336
336
|
}
|
|
337
337
|
p(t) {
|
|
338
338
|
let e = 0;
|
|
339
339
|
for (const i of this._$AV) i !== void 0 && (i.strings !== void 0 ? (i._$AI(t, i, e), e += i.strings.length - 2) : i._$AI(t[e])), e++;
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
class
|
|
342
|
+
class R {
|
|
343
343
|
get _$AU() {
|
|
344
344
|
return this._$AM?._$AU ?? this._$Cv;
|
|
345
345
|
}
|
|
346
346
|
constructor(t, e, i, r) {
|
|
347
|
-
this.type = 2, this._$AH =
|
|
347
|
+
this.type = 2, this._$AH = g, this._$AN = void 0, this._$AA = t, this._$AB = e, this._$AM = i, this.options = r, this._$Cv = r?.isConnected ?? !0;
|
|
348
348
|
}
|
|
349
349
|
get parentNode() {
|
|
350
350
|
let t = this._$AA.parentNode;
|
|
@@ -358,7 +358,7 @@ class U {
|
|
|
358
358
|
return this._$AB;
|
|
359
359
|
}
|
|
360
360
|
_$AI(t, e = this) {
|
|
361
|
-
t =
|
|
361
|
+
t = N(this, t, e), D(t) ? t === g || t == null || t === "" ? (this._$AH !== g && this._$AR(), this._$AH = g) : t !== this._$AH && t !== O && this._(t) : t._$litType$ !== void 0 ? this.$(t) : t.nodeType !== void 0 ? this.T(t) : Dt(t) ? this.k(t) : this._(t);
|
|
362
362
|
}
|
|
363
363
|
O(t) {
|
|
364
364
|
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
@@ -367,25 +367,25 @@ class U {
|
|
|
367
367
|
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
368
368
|
}
|
|
369
369
|
_(t) {
|
|
370
|
-
this._$AH !==
|
|
370
|
+
this._$AH !== g && D(this._$AH) ? this._$AA.nextSibling.data = t : this.T(P.createTextNode(t)), this._$AH = t;
|
|
371
371
|
}
|
|
372
372
|
$(t) {
|
|
373
|
-
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el =
|
|
373
|
+
const { values: e, _$litType$: i } = t, r = typeof i == "number" ? this._$AC(t) : (i.el === void 0 && (i.el = j.createElement(_t(i.h, i.h[0]), this.options)), i);
|
|
374
374
|
if (this._$AH?._$AD === r) this._$AH.p(e);
|
|
375
375
|
else {
|
|
376
|
-
const n = new
|
|
376
|
+
const n = new Vt(r, this), o = n.u(this.options);
|
|
377
377
|
n.p(e), this.T(o), this._$AH = n;
|
|
378
378
|
}
|
|
379
379
|
}
|
|
380
380
|
_$AC(t) {
|
|
381
|
-
let e =
|
|
382
|
-
return e === void 0 &&
|
|
381
|
+
let e = ft.get(t.strings);
|
|
382
|
+
return e === void 0 && ft.set(t.strings, e = new j(t)), e;
|
|
383
383
|
}
|
|
384
384
|
k(t) {
|
|
385
|
-
|
|
385
|
+
X(this._$AH) || (this._$AH = [], this._$AR());
|
|
386
386
|
const e = this._$AH;
|
|
387
387
|
let i, r = 0;
|
|
388
|
-
for (const n of t) r === e.length ? e.push(i = new
|
|
388
|
+
for (const n of t) r === e.length ? e.push(i = new R(this.O(L()), this.O(L()), this, this.options)) : i = e[r], i._$AI(n), r++;
|
|
389
389
|
r < e.length && (this._$AR(i && i._$AB.nextSibling, r), e.length = r);
|
|
390
390
|
}
|
|
391
391
|
_$AR(t = this._$AA.nextSibling, e) {
|
|
@@ -398,7 +398,7 @@ class U {
|
|
|
398
398
|
this._$AM === void 0 && (this._$Cv = t, this._$AP?.(t));
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
|
-
class
|
|
401
|
+
class G {
|
|
402
402
|
get tagName() {
|
|
403
403
|
return this.element.tagName;
|
|
404
404
|
}
|
|
@@ -406,53 +406,53 @@ class I {
|
|
|
406
406
|
return this._$AM._$AU;
|
|
407
407
|
}
|
|
408
408
|
constructor(t, e, i, r, n) {
|
|
409
|
-
this.type = 1, this._$AH =
|
|
409
|
+
this.type = 1, this._$AH = g, this._$AN = void 0, this.element = t, this.name = e, this._$AM = r, this.options = n, i.length > 2 || i[0] !== "" || i[1] !== "" ? (this._$AH = Array(i.length - 1).fill(new String()), this.strings = i) : this._$AH = g;
|
|
410
410
|
}
|
|
411
411
|
_$AI(t, e = this, i, r) {
|
|
412
412
|
const n = this.strings;
|
|
413
413
|
let o = !1;
|
|
414
|
-
if (n === void 0) t =
|
|
414
|
+
if (n === void 0) t = N(this, t, e, 0), o = !D(t) || t !== this._$AH && t !== O, o && (this._$AH = t);
|
|
415
415
|
else {
|
|
416
|
-
const
|
|
417
|
-
let
|
|
418
|
-
for (t = n[0],
|
|
416
|
+
const h = t;
|
|
417
|
+
let l, p;
|
|
418
|
+
for (t = n[0], l = 0; l < n.length - 1; l++) p = N(this, h[i + l], e, l), p === O && (p = this._$AH[l]), o ||= !D(p) || p !== this._$AH[l], p === g ? t = g : t !== g && (t += (p ?? "") + n[l + 1]), this._$AH[l] = p;
|
|
419
419
|
}
|
|
420
420
|
o && !r && this.j(t);
|
|
421
421
|
}
|
|
422
422
|
j(t) {
|
|
423
|
-
t ===
|
|
423
|
+
t === g ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t ?? "");
|
|
424
424
|
}
|
|
425
425
|
}
|
|
426
|
-
class
|
|
426
|
+
class Bt extends G {
|
|
427
427
|
constructor() {
|
|
428
428
|
super(...arguments), this.type = 3;
|
|
429
429
|
}
|
|
430
430
|
j(t) {
|
|
431
|
-
this.element[this.name] = t ===
|
|
431
|
+
this.element[this.name] = t === g ? void 0 : t;
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
|
-
class
|
|
434
|
+
class Wt extends G {
|
|
435
435
|
constructor() {
|
|
436
436
|
super(...arguments), this.type = 4;
|
|
437
437
|
}
|
|
438
438
|
j(t) {
|
|
439
|
-
this.element.toggleAttribute(this.name, !!t && t !==
|
|
439
|
+
this.element.toggleAttribute(this.name, !!t && t !== g);
|
|
440
440
|
}
|
|
441
441
|
}
|
|
442
|
-
class
|
|
442
|
+
class It extends G {
|
|
443
443
|
constructor(t, e, i, r, n) {
|
|
444
444
|
super(t, e, i, r, n), this.type = 5;
|
|
445
445
|
}
|
|
446
446
|
_$AI(t, e = this) {
|
|
447
|
-
if ((t =
|
|
448
|
-
const i = this._$AH, r = t ===
|
|
447
|
+
if ((t = N(this, t, e, 0) ?? g) === O) return;
|
|
448
|
+
const i = this._$AH, r = t === g && i !== g || t.capture !== i.capture || t.once !== i.once || t.passive !== i.passive, n = t !== g && (i === g || r);
|
|
449
449
|
r && this.element.removeEventListener(this.name, this, i), n && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
450
450
|
}
|
|
451
451
|
handleEvent(t) {
|
|
452
452
|
typeof this._$AH == "function" ? this._$AH.call(this.options?.host ?? this.element, t) : this._$AH.handleEvent(t);
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
class
|
|
455
|
+
class qt {
|
|
456
456
|
constructor(t, e, i) {
|
|
457
457
|
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = e, this.options = i;
|
|
458
458
|
}
|
|
@@ -460,22 +460,22 @@ class Wt {
|
|
|
460
460
|
return this._$AM._$AU;
|
|
461
461
|
}
|
|
462
462
|
_$AI(t) {
|
|
463
|
-
|
|
463
|
+
N(this, t);
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
const
|
|
467
|
-
|
|
468
|
-
const
|
|
466
|
+
const Gt = Q.litHtmlPolyfillSupport;
|
|
467
|
+
Gt?.(j, R), (Q.litHtmlVersions ??= []).push("3.3.0");
|
|
468
|
+
const Jt = (s, t, e) => {
|
|
469
469
|
const i = e?.renderBefore ?? t;
|
|
470
470
|
let r = i._$litPart$;
|
|
471
471
|
if (r === void 0) {
|
|
472
472
|
const n = e?.renderBefore ?? null;
|
|
473
|
-
i._$litPart$ = r = new
|
|
473
|
+
i._$litPart$ = r = new R(t.insertBefore(L(), n), n, void 0, e ?? {});
|
|
474
474
|
}
|
|
475
475
|
return r._$AI(s), r;
|
|
476
476
|
};
|
|
477
|
-
const
|
|
478
|
-
class
|
|
477
|
+
const Y = globalThis;
|
|
478
|
+
class H extends T {
|
|
479
479
|
constructor() {
|
|
480
480
|
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
481
481
|
}
|
|
@@ -485,7 +485,7 @@ class M extends w {
|
|
|
485
485
|
}
|
|
486
486
|
update(t) {
|
|
487
487
|
const e = this.render();
|
|
488
|
-
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do =
|
|
488
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = Jt(e, this.renderRoot, this.renderOptions);
|
|
489
489
|
}
|
|
490
490
|
connectedCallback() {
|
|
491
491
|
super.connectedCallback(), this._$Do?.setConnected(!0);
|
|
@@ -494,68 +494,78 @@ class M extends w {
|
|
|
494
494
|
super.disconnectedCallback(), this._$Do?.setConnected(!1);
|
|
495
495
|
}
|
|
496
496
|
render() {
|
|
497
|
-
return
|
|
497
|
+
return O;
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
|
|
501
|
-
const
|
|
502
|
-
|
|
503
|
-
(
|
|
504
|
-
const
|
|
500
|
+
H._$litElement$ = !0, H.finalized = !0, Y.litElementHydrateSupport?.({ LitElement: H });
|
|
501
|
+
const Kt = Y.litElementPolyfillSupport;
|
|
502
|
+
Kt?.({ LitElement: H });
|
|
503
|
+
(Y.litElementVersions ??= []).push("4.2.0");
|
|
504
|
+
const Zt = (s) => (t, e) => {
|
|
505
505
|
e !== void 0 ? e.addInitializer((() => {
|
|
506
506
|
customElements.define(s, t);
|
|
507
507
|
})) : customElements.define(s, t);
|
|
508
508
|
};
|
|
509
|
-
const
|
|
509
|
+
const Ft = { attribute: !0, type: String, converter: W, reflect: !1, hasChanged: F }, Qt = (s = Ft, t, e) => {
|
|
510
510
|
const { kind: i, metadata: r } = e;
|
|
511
511
|
let n = globalThis.litPropertyMetadata.get(r);
|
|
512
512
|
if (n === void 0 && globalThis.litPropertyMetadata.set(r, n = /* @__PURE__ */ new Map()), i === "setter" && ((s = Object.create(s)).wrapped = !0), n.set(e.name, s), i === "accessor") {
|
|
513
513
|
const { name: o } = e;
|
|
514
|
-
return { set(
|
|
515
|
-
const
|
|
516
|
-
t.set.call(this,
|
|
517
|
-
}, init(
|
|
518
|
-
return
|
|
514
|
+
return { set(h) {
|
|
515
|
+
const l = t.get.call(this);
|
|
516
|
+
t.set.call(this, h), this.requestUpdate(o, l, s);
|
|
517
|
+
}, init(h) {
|
|
518
|
+
return h !== void 0 && this.C(o, void 0, s, h), h;
|
|
519
519
|
} };
|
|
520
520
|
}
|
|
521
521
|
if (i === "setter") {
|
|
522
522
|
const { name: o } = e;
|
|
523
|
-
return function(
|
|
524
|
-
const
|
|
525
|
-
t.call(this,
|
|
523
|
+
return function(h) {
|
|
524
|
+
const l = this[o];
|
|
525
|
+
t.call(this, h), this.requestUpdate(o, l, s);
|
|
526
526
|
};
|
|
527
527
|
}
|
|
528
528
|
throw Error("Unsupported decorator location: " + i);
|
|
529
529
|
};
|
|
530
|
-
function
|
|
531
|
-
return (t, e) => typeof e == "object" ?
|
|
530
|
+
function tt(s) {
|
|
531
|
+
return (t, e) => typeof e == "object" ? Qt(s, t, e) : ((i, r, n) => {
|
|
532
532
|
const o = r.hasOwnProperty(n);
|
|
533
533
|
return r.constructor.createProperty(n, i), o ? Object.getOwnPropertyDescriptor(r, n) : void 0;
|
|
534
534
|
})(s, t, e);
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
return
|
|
536
|
+
function k(s) {
|
|
537
|
+
return tt({ ...s, state: !0, attribute: !1 });
|
|
538
538
|
}
|
|
539
|
-
const
|
|
540
|
-
function
|
|
539
|
+
const Xt = (s, t, e) => (e.configurable = !0, e.enumerable = !0, Reflect.decorate && typeof t != "object" && Object.defineProperty(s, t, e), e);
|
|
540
|
+
function vt(s, t) {
|
|
541
541
|
return (e, i, r) => {
|
|
542
542
|
const n = (o) => o.renderRoot?.querySelector(s) ?? null;
|
|
543
|
-
return
|
|
543
|
+
return Xt(e, i, { get() {
|
|
544
544
|
return n(this);
|
|
545
545
|
} });
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
|
-
var
|
|
549
|
-
for (var r = i > 1 ? void 0 : i ?
|
|
548
|
+
var Yt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, S = (s, t, e, i) => {
|
|
549
|
+
for (var r = i > 1 ? void 0 : i ? te(t, e) : t, n = s.length - 1, o; n >= 0; n--)
|
|
550
550
|
(o = s[n]) && (r = (i ? o(t, e, r) : o(r)) || r);
|
|
551
|
-
return i && r &&
|
|
551
|
+
return i && r && Yt(t, e, r), r;
|
|
552
552
|
};
|
|
553
|
-
|
|
554
|
-
let
|
|
553
|
+
V.use([At, St, Ct]);
|
|
554
|
+
let v = class extends H {
|
|
555
555
|
constructor() {
|
|
556
|
-
super(), this.dataSets = [], this.canvasList = /* @__PURE__ */ new Map(), this.origWidth = 600, this.origHeight = 350, this.textContainerHeight = 36, this.modifier = 1, this.version = "1.7.
|
|
556
|
+
super(), this.dataSets = [], this.canvasList = /* @__PURE__ */ new Map(), this.origWidth = 600, this.origHeight = 350, this.textContainerHeight = 36, this.modifier = 1, this.version = "1.7.37", this.resizeObserver = new ResizeObserver(() => {
|
|
557
557
|
this.adjustSizes(), this.applyData();
|
|
558
558
|
}), this.template = {
|
|
559
|
+
// The registered ECharts theme carries its own canvas
|
|
560
|
+
// `backgroundColor` (chalk paints `rgba(41,52,65,1)`), which the
|
|
561
|
+
// gauge canvas draws as an opaque slab on top of the wrapper's
|
|
562
|
+
// background. That hides whatever colour the tile actually has —
|
|
563
|
+
// the `--re-tile-background-color` the host injects, or a user's
|
|
564
|
+
// custom colour — so the gauge sits in a differently coloured box.
|
|
565
|
+
// Forcing the option's background to transparent lets the wrapper's
|
|
566
|
+
// background show through; the wrapper already falls back to the
|
|
567
|
+
// theme's own colour when no override is set, so nothing is lost.
|
|
568
|
+
backgroundColor: "transparent",
|
|
559
569
|
series: [
|
|
560
570
|
{
|
|
561
571
|
type: "gauge",
|
|
@@ -664,32 +674,31 @@ let $ = class extends M {
|
|
|
664
674
|
], r = Object.fromEntries(
|
|
665
675
|
Object.entries(s.theme_object).filter(([n]) => !i.includes(n))
|
|
666
676
|
);
|
|
667
|
-
|
|
677
|
+
V.registerTheme(s.theme_name, r);
|
|
668
678
|
}
|
|
669
679
|
adjustSizes() {
|
|
670
680
|
if (!this.gaugeContainer) return;
|
|
671
681
|
const s = this.gaugeContainer.getBoundingClientRect().width, t = this.gaugeContainer.getBoundingClientRect().height, e = this.dataSets.length, i = this.origWidth, r = this.origHeight;
|
|
672
682
|
if (!t || !s || !i || !r) return;
|
|
673
683
|
const n = [];
|
|
674
|
-
for (let
|
|
675
|
-
const
|
|
676
|
-
|
|
684
|
+
for (let a = 1; a <= e; a++) {
|
|
685
|
+
const c = Math.ceil(e / a), m = s - 24 * (a - 1), $ = t - 24 * (c - 1), y = m / i / a, A = y * y * i * r * e;
|
|
686
|
+
c * y * r <= $ && n.push({ c: a, r: c, m: y, size: A, uwgap: m, uhgap: $ });
|
|
677
687
|
}
|
|
678
|
-
for (let
|
|
679
|
-
const
|
|
680
|
-
|
|
688
|
+
for (let a = 1; a <= e; a++) {
|
|
689
|
+
const c = Math.ceil(e / a), m = s - 24 * (c - 1), $ = t - 24 * (a - 1), y = $ / r / a, A = y * y * i * r * e;
|
|
690
|
+
c * y * i <= m && n.push({ c, r: a, m: y, size: A, uwgap: m, uhgap: $ });
|
|
681
691
|
}
|
|
682
|
-
const o = n.reduce((
|
|
683
|
-
if (!
|
|
684
|
-
const
|
|
685
|
-
this.boxes = Array.from(this.gaugeContainer?.querySelectorAll(".chart"))
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
});
|
|
692
|
+
const o = n.reduce((a, c) => c.size < a ? a : c.size, 0), h = n.find((a) => a.size === o);
|
|
693
|
+
if (!h) return;
|
|
694
|
+
const l = h.m ?? 0;
|
|
695
|
+
this.boxes = Array.from(this.gaugeContainer?.querySelectorAll(".chart"));
|
|
696
|
+
const p = `repeat(${h.c}, 1fr)`;
|
|
697
|
+
this.gaugeContainer.style.gridTemplateColumns !== p && (this.gaugeContainer.style.gridTemplateColumns = p);
|
|
698
|
+
const u = `width:${l * i}px; height:${l * (r - this.textContainerHeight)}px`;
|
|
699
|
+
this.boxes?.forEach((a) => {
|
|
700
|
+
a.getAttribute("style") !== u && (a.setAttribute("style", u), V.getInstanceByDom(a)?.resize());
|
|
701
|
+
}), this.modifier = l;
|
|
693
702
|
}
|
|
694
703
|
async transformData() {
|
|
695
704
|
this.dataSets = [], this?.inputData && this.inputData.dataseries?.sort((s, t) => (s.label ?? "") > (t.label ?? "") ? 1 : -1).forEach((s, t) => {
|
|
@@ -697,7 +706,7 @@ let $ = class extends M {
|
|
|
697
706
|
e.forEach((i) => {
|
|
698
707
|
const r = i ?? "";
|
|
699
708
|
let n = String(s.label ?? "").trim();
|
|
700
|
-
n = r + (r && n ? " - " : "") + n, this.dataSets.some((
|
|
709
|
+
n = r + (r && n ? " - " : "") + n, this.dataSets.some((h) => h.label === n) && (n += " " + t);
|
|
701
710
|
const o = {
|
|
702
711
|
label: n,
|
|
703
712
|
unit: s.unit,
|
|
@@ -707,7 +716,7 @@ let $ = class extends M {
|
|
|
707
716
|
sections: s.sections,
|
|
708
717
|
multiChart: s.multiChart,
|
|
709
718
|
value: s.value,
|
|
710
|
-
data: e.length === 1 ? s.data : s?.data?.filter((
|
|
719
|
+
data: e.length === 1 ? s.data : s?.data?.filter((h) => h.pivot === i)
|
|
711
720
|
};
|
|
712
721
|
this.dataSets.push(o);
|
|
713
722
|
});
|
|
@@ -725,39 +734,62 @@ let $ = class extends M {
|
|
|
725
734
|
if (!t.multiChart)
|
|
726
735
|
t.needleValue = t.value === void 0 || t.value === null ? void 0 : Number(t.value);
|
|
727
736
|
else {
|
|
728
|
-
const
|
|
729
|
-
t.needleValue =
|
|
737
|
+
const d = e?.map((f) => f.value)?.filter((f) => f !== void 0)?.map(Number) ?? [];
|
|
738
|
+
t.needleValue = d.reduce((f, b) => f + b, 0) / d.length;
|
|
730
739
|
}
|
|
731
740
|
t.needleValue = isNaN(t.needleValue) ? r : t.needleValue;
|
|
732
|
-
const n =
|
|
733
|
-
isNaN(
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
};
|
|
737
|
-
const c = ["#bf444c", "#d88273", "#f6efa6"], f = this.theme?.theme_object?.color ?? c, u = (t.sections?.sectionLimits ?? []).map((p, g) => {
|
|
738
|
-
const y = p?.limit;
|
|
741
|
+
const n = Date.parse(t.data?.[t.data.length - 1]?.tsp ?? "");
|
|
742
|
+
isNaN(n) || (/* @__PURE__ */ new Date()).getTime() - n > (t.advanced?.maxLatency ?? 1 / 0) * 1e3 && (t.needleValue = void 0);
|
|
743
|
+
const o = ["#bf444c", "#d88273", "#f6efa6"], h = this.theme?.theme_object?.color ?? o, l = (t.sections?.sectionLimits ?? []).map((d, f) => {
|
|
744
|
+
const b = d?.limit;
|
|
739
745
|
return {
|
|
740
|
-
limit:
|
|
741
|
-
color:
|
|
746
|
+
limit: b === "" || b == null ? void 0 : Number(b),
|
|
747
|
+
color: d?.sectionColor || h[f % h.length]
|
|
742
748
|
};
|
|
743
749
|
}).filter(
|
|
744
|
-
(
|
|
745
|
-
),
|
|
746
|
-
t.range = Math.abs(
|
|
747
|
-
const
|
|
748
|
-
const
|
|
749
|
-
return [
|
|
750
|
-
}).filter(([
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
it = P?.[p] ?? P?.[0];
|
|
750
|
+
(d) => d.limit != null && !isNaN(d.limit)
|
|
751
|
+
), p = !l.length || r <= l[0].limit, u = l.filter((d, f, b) => f === 0 ? !0 : p ? d.limit > b[f - 1].limit : d.limit < b[f - 1].limit), a = u.length ? u.map((d) => d.limit) : [40, 80, 100], c = u.length ? u.map((d) => d.color) : h.slice(0, 3), m = a?.[a.length - 1] ?? 100;
|
|
752
|
+
t.range = Math.abs(m - r);
|
|
753
|
+
const $ = a.map((d, f) => {
|
|
754
|
+
const b = Math.abs(d - r) / t.range, bt = c[f];
|
|
755
|
+
return [b, bt];
|
|
756
|
+
}).filter(([d]) => !isNaN(d) && d >= 0);
|
|
757
|
+
let y = c?.[c.length - 1];
|
|
758
|
+
for (const [d, f] of a?.entries() ?? [])
|
|
759
|
+
if (p ? f > t.needleValue : f < t.needleValue) {
|
|
760
|
+
y = c?.[d] ?? c?.[0];
|
|
756
761
|
break;
|
|
757
762
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
763
|
+
const A = this.canvasList.get(t.label), et = A?.echart, it = JSON.stringify([
|
|
764
|
+
s,
|
|
765
|
+
t.unit,
|
|
766
|
+
t.precision,
|
|
767
|
+
t.valueColor,
|
|
768
|
+
t.sections,
|
|
769
|
+
this.themeTitleColor
|
|
770
|
+
]);
|
|
771
|
+
if (A && A.lastConfig === it) {
|
|
772
|
+
et?.setOption(
|
|
773
|
+
{
|
|
774
|
+
series: [
|
|
775
|
+
{
|
|
776
|
+
data: [{ value: t.needleValue ?? null, name: t.unit }],
|
|
777
|
+
progress: { itemStyle: { color: y } }
|
|
778
|
+
}
|
|
779
|
+
]
|
|
780
|
+
},
|
|
781
|
+
{ lazyUpdate: !0 }
|
|
782
|
+
);
|
|
783
|
+
continue;
|
|
784
|
+
}
|
|
785
|
+
A && (A.lastConfig = it);
|
|
786
|
+
const st = window.structuredClone(this.template), rt = st.series, _ = rt?.[0], C = rt?.[1];
|
|
787
|
+
_.data[0].value = t.needleValue, _.data[0].name = t.unit, _.title.fontSize = 32 * s, _.title.color = t.valueColor || this.themeTitleColor, _.title.opacity = 1, _.detail.color = t.valueColor || this.themeTitleColor, _.detail.opacity = 1, _.detail.fontSize = 60 * s, _.detail.formatter = (d) => {
|
|
788
|
+
const f = Number(d);
|
|
789
|
+
return isNaN(f) ? "-" : f.toFixed(Math.floor(t.precision ?? 0));
|
|
790
|
+
}, _.min = C.min = r, _.max = C.max = m, C.axisLine.lineStyle.width = 8 * s, $.length && (C.axisLine.lineStyle.color = $), C.axisLabel.fontSize = 24 * s, C.axisLabel.distance = -24 * s, C.splitLine.length = 16 * s, C.splitLine.distance = -16 * s, _.progress.itemStyle.color = y, _.progress.width = 60 * s;
|
|
791
|
+
const z = A?.title;
|
|
792
|
+
z && (z.style.fontSize = String(36 * s) + "px", z.style.maxWidth = String(550 * s) + "px", z.style.height = String(this.textContainerHeight * s) + "px", z.textContent = t.label ?? ""), et?.setOption(st, { lazyUpdate: !0 });
|
|
761
793
|
}
|
|
762
794
|
}
|
|
763
795
|
deleteCharts() {
|
|
@@ -779,12 +811,12 @@ let $ = class extends M {
|
|
|
779
811
|
"style",
|
|
780
812
|
`min-width: ${this.origWidth}px; min-height: ${this.origHeight}px; width: ${this.origWidth}px; height: ${this.origHeight}px;`
|
|
781
813
|
), t.appendChild(e), t.appendChild(i), this.gaugeContainer.appendChild(t);
|
|
782
|
-
const r =
|
|
814
|
+
const r = V.init(i, this.theme?.theme_name);
|
|
783
815
|
this.canvasList.set(s.label ?? "", { echart: r, title: e, wrapper: t });
|
|
784
816
|
}));
|
|
785
817
|
}
|
|
786
818
|
render() {
|
|
787
|
-
return
|
|
819
|
+
return Rt`
|
|
788
820
|
<div
|
|
789
821
|
class="wrapper"
|
|
790
822
|
style="background-color: ${this.themeBgColor}; color: ${this.themeTitleColor}"
|
|
@@ -805,7 +837,7 @@ let $ = class extends M {
|
|
|
805
837
|
`;
|
|
806
838
|
}
|
|
807
839
|
};
|
|
808
|
-
|
|
840
|
+
v.styles = xt`
|
|
809
841
|
:host {
|
|
810
842
|
display: block;
|
|
811
843
|
font-family: sans-serif;
|
|
@@ -880,37 +912,37 @@ $.styles = Ct`
|
|
|
880
912
|
justify-content: center;
|
|
881
913
|
}
|
|
882
914
|
`;
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
],
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
],
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
],
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
],
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
],
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
],
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
],
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
],
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
],
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
],
|
|
915
|
+
S([
|
|
916
|
+
tt({ type: Object })
|
|
917
|
+
], v.prototype, "inputData", 2);
|
|
918
|
+
S([
|
|
919
|
+
tt({ type: Object })
|
|
920
|
+
], v.prototype, "theme", 2);
|
|
921
|
+
S([
|
|
922
|
+
k()
|
|
923
|
+
], v.prototype, "dataSets", 2);
|
|
924
|
+
S([
|
|
925
|
+
k()
|
|
926
|
+
], v.prototype, "canvasList", 2);
|
|
927
|
+
S([
|
|
928
|
+
k()
|
|
929
|
+
], v.prototype, "themeBgColor", 2);
|
|
930
|
+
S([
|
|
931
|
+
k()
|
|
932
|
+
], v.prototype, "themeTitleColor", 2);
|
|
933
|
+
S([
|
|
934
|
+
k()
|
|
935
|
+
], v.prototype, "themeSubtitleColor", 2);
|
|
936
|
+
S([
|
|
937
|
+
vt(".gauge-container")
|
|
938
|
+
], v.prototype, "gaugeContainer", 2);
|
|
939
|
+
S([
|
|
940
|
+
vt(".wrapper")
|
|
941
|
+
], v.prototype, "wrapper", 2);
|
|
942
|
+
v = S([
|
|
943
|
+
Zt("widget-gauge-1.7.37")
|
|
944
|
+
], v);
|
|
913
945
|
export {
|
|
914
|
-
|
|
946
|
+
v as WidgetGauge
|
|
915
947
|
};
|
|
916
948
|
//# sourceMappingURL=widget-gauge.js.map
|