@flexem/fc-gui 3.0.0-alpha.173 → 3.0.0-alpha.175
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/bundles/@flexem/fc-gui.umd.js +31 -3
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +4 -4
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/historical-curve/historical-curve.element.d.ts +3 -0
- package/elements/historical-curve/historical-curve.element.js +31 -3
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -37191,6 +37191,9 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
37191
37191
|
this.needResize = true;
|
|
37192
37192
|
this.dropdownListEl = null;
|
|
37193
37193
|
this.dropdownTriggerEl = null;
|
|
37194
|
+
this._outsideClickHandler = null;
|
|
37195
|
+
this._fullscreenChangeHandler = null;
|
|
37196
|
+
this._resizeHideHandler = null;
|
|
37194
37197
|
this.setNeedResize = () => {
|
|
37195
37198
|
this.needResize = false;
|
|
37196
37199
|
setTimeout(() => this.needResize = true, 500);
|
|
@@ -37232,6 +37235,24 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
37232
37235
|
window.removeEventListener('native.keyboardshow', this.setNeedResize);
|
|
37233
37236
|
window.removeEventListener('native.keyboardhide', this.setNeedResize);
|
|
37234
37237
|
}
|
|
37238
|
+
// 清理下拉相关事件监听及 DOM
|
|
37239
|
+
if (this._outsideClickHandler) {
|
|
37240
|
+
document.removeEventListener('click', this._outsideClickHandler);
|
|
37241
|
+
this._outsideClickHandler = null;
|
|
37242
|
+
}
|
|
37243
|
+
if (this._fullscreenChangeHandler) {
|
|
37244
|
+
document.removeEventListener('fullscreenchange', this._fullscreenChangeHandler);
|
|
37245
|
+
document.removeEventListener('webkitfullscreenchange', this._fullscreenChangeHandler);
|
|
37246
|
+
this._fullscreenChangeHandler = null;
|
|
37247
|
+
}
|
|
37248
|
+
if (this._resizeHideHandler) {
|
|
37249
|
+
window.removeEventListener('resize', this._resizeHideHandler);
|
|
37250
|
+
this._resizeHideHandler = null;
|
|
37251
|
+
}
|
|
37252
|
+
if (this.dropdownListEl && this.dropdownListEl.parentNode) {
|
|
37253
|
+
this.dropdownListEl.parentNode.removeChild(this.dropdownListEl);
|
|
37254
|
+
this.dropdownListEl = null;
|
|
37255
|
+
}
|
|
37235
37256
|
// 取消语种变化订阅
|
|
37236
37257
|
if (this.languageChangeSubscription) {
|
|
37237
37258
|
this.languageChangeSubscription.unsubscribe();
|
|
@@ -37754,7 +37775,6 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
37754
37775
|
const dropdownBg = this.model.displaySetting.axisSetting.filterBackgroudColor || fillColor || '#fff';
|
|
37755
37776
|
const dropdownWrapper = operationArea.append('div')
|
|
37756
37777
|
.style('display', 'inline-block')
|
|
37757
|
-
.style('position', 'relative')
|
|
37758
37778
|
.style('margin-left', this.displayOption.marginLeft + 'px')
|
|
37759
37779
|
.style('vertical-align', 'middle');
|
|
37760
37780
|
const selectedText = this.timePeriods.find(t => t.key === Number(this.currentTimePeriod));
|
|
@@ -37881,12 +37901,20 @@ class historical_curve_element_HistoricalCurveElement extends conditional_displa
|
|
|
37881
37901
|
}
|
|
37882
37902
|
});
|
|
37883
37903
|
// 点击外部收起
|
|
37884
|
-
|
|
37904
|
+
this._outsideClickHandler = (event) => {
|
|
37885
37905
|
const triggerNode = dropdownTrigger.node();
|
|
37886
37906
|
if (!dropdownListEl.contains(event.target) && !triggerNode.contains(event.target)) {
|
|
37887
37907
|
hideDropdown();
|
|
37888
37908
|
}
|
|
37889
|
-
}
|
|
37909
|
+
};
|
|
37910
|
+
document.addEventListener('click', this._outsideClickHandler);
|
|
37911
|
+
// 全屏切换(含点击全屏按钮和 F11)时收起
|
|
37912
|
+
this._fullscreenChangeHandler = () => { hideDropdown(); };
|
|
37913
|
+
document.addEventListener('fullscreenchange', this._fullscreenChangeHandler);
|
|
37914
|
+
document.addEventListener('webkitfullscreenchange', this._fullscreenChangeHandler);
|
|
37915
|
+
// F11 退出全屏时 keydown 被浏览器拦截,用 resize 兜底
|
|
37916
|
+
this._resizeHideHandler = () => { hideDropdown(); };
|
|
37917
|
+
window.addEventListener('resize', this._resizeHideHandler);
|
|
37890
37918
|
// 滚动时收起
|
|
37891
37919
|
document.addEventListener('scroll', hideDropdown, true);
|
|
37892
37920
|
const buttonWidth = this.displayOption.operationButtonWidth + 'px', buttonHeight = this.displayOption.operationButtonHeight + 'px';
|