qc-ui-lit 0.0.7 → 0.0.8
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.
|
@@ -44652,26 +44652,35 @@ NC([wk]), NC([mk]), NC([
|
|
|
44652
44652
|
var V4 = class extends n {
|
|
44653
44653
|
constructor() {
|
|
44654
44654
|
super(), this.options = null, this.loading = !0, this.echarts = null, this.onFinished = () => {
|
|
44655
|
-
|
|
44655
|
+
setTimeout(() => {
|
|
44656
|
+
this.loading = !1;
|
|
44657
|
+
}, 100);
|
|
44656
44658
|
}, this.onResize = () => {
|
|
44657
44659
|
this.echarts && this.echarts.resize();
|
|
44658
44660
|
};
|
|
44659
44661
|
}
|
|
44660
44662
|
willUpdate(e) {
|
|
44661
|
-
e.has("options")
|
|
44663
|
+
if (e.has("options")) {
|
|
44664
|
+
if (typeof this.options == "string") try {
|
|
44665
|
+
this.options = JSON.parse(this.options);
|
|
44666
|
+
} catch {
|
|
44667
|
+
this.options = null;
|
|
44668
|
+
}
|
|
44669
|
+
this.setOptions();
|
|
44670
|
+
}
|
|
44662
44671
|
}
|
|
44663
44672
|
async firstUpdated() {
|
|
44664
44673
|
this.initECharts();
|
|
44665
44674
|
}
|
|
44666
44675
|
disconnectedCallback() {
|
|
44667
|
-
super.disconnectedCallback();
|
|
44676
|
+
super.disconnectedCallback(), this.echarts?.dispose(), this.echarts = null;
|
|
44668
44677
|
}
|
|
44669
44678
|
initECharts() {
|
|
44670
44679
|
let e = this.renderRoot.querySelector(".qc-echarts-container");
|
|
44671
44680
|
e && (this.echarts = pC(e), this.echarts.on("finished", this.onFinished), this.setOptions());
|
|
44672
44681
|
}
|
|
44673
44682
|
setOptions() {
|
|
44674
|
-
this.echarts && this.options
|
|
44683
|
+
this.echarts && (!this.options || typeof this.options != "object" || this.echarts.setOption(this.options));
|
|
44675
44684
|
}
|
|
44676
44685
|
render() {
|
|
44677
44686
|
return i`<section id="qc-echarts">
|