@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.
@@ -47,6 +47,9 @@ export declare class HistoricalCurveElement extends ConditionalDisplayElement {
47
47
  private needResize;
48
48
  private dropdownListEl;
49
49
  private dropdownTriggerEl;
50
+ private _outsideClickHandler;
51
+ private _fullscreenChangeHandler;
52
+ private _resizeHideHandler;
50
53
  constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, historyDataStore: HistoryDataStore, signalRAppId: string, systemTextLibraryService?: SystemTextLibraryService, languageService?: LanguageService, guiContext?: GuiContext, releasedVariableService?: ReleasedVariableService);
51
54
  dispose(): void;
52
55
  private initKeyboardListener;
@@ -40,6 +40,9 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
40
40
  this.needResize = true;
41
41
  this.dropdownListEl = null;
42
42
  this.dropdownTriggerEl = null;
43
+ this._outsideClickHandler = null;
44
+ this._fullscreenChangeHandler = null;
45
+ this._resizeHideHandler = null;
43
46
  this.setNeedResize = () => {
44
47
  this.needResize = false;
45
48
  setTimeout(() => this.needResize = true, 500);
@@ -81,6 +84,24 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
81
84
  window.removeEventListener('native.keyboardshow', this.setNeedResize);
82
85
  window.removeEventListener('native.keyboardhide', this.setNeedResize);
83
86
  }
87
+ // 清理下拉相关事件监听及 DOM
88
+ if (this._outsideClickHandler) {
89
+ document.removeEventListener('click', this._outsideClickHandler);
90
+ this._outsideClickHandler = null;
91
+ }
92
+ if (this._fullscreenChangeHandler) {
93
+ document.removeEventListener('fullscreenchange', this._fullscreenChangeHandler);
94
+ document.removeEventListener('webkitfullscreenchange', this._fullscreenChangeHandler);
95
+ this._fullscreenChangeHandler = null;
96
+ }
97
+ if (this._resizeHideHandler) {
98
+ window.removeEventListener('resize', this._resizeHideHandler);
99
+ this._resizeHideHandler = null;
100
+ }
101
+ if (this.dropdownListEl && this.dropdownListEl.parentNode) {
102
+ this.dropdownListEl.parentNode.removeChild(this.dropdownListEl);
103
+ this.dropdownListEl = null;
104
+ }
84
105
  // 取消语种变化订阅
85
106
  if (this.languageChangeSubscription) {
86
107
  this.languageChangeSubscription.unsubscribe();
@@ -603,7 +624,6 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
603
624
  const dropdownBg = this.model.displaySetting.axisSetting.filterBackgroudColor || fillColor || '#fff';
604
625
  const dropdownWrapper = operationArea.append('div')
605
626
  .style('display', 'inline-block')
606
- .style('position', 'relative')
607
627
  .style('margin-left', this.displayOption.marginLeft + 'px')
608
628
  .style('vertical-align', 'middle');
609
629
  const selectedText = this.timePeriods.find(t => t.key === Number(this.currentTimePeriod));
@@ -730,12 +750,20 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
730
750
  }
731
751
  });
732
752
  // 点击外部收起
733
- document.addEventListener('click', (event) => {
753
+ this._outsideClickHandler = (event) => {
734
754
  const triggerNode = dropdownTrigger.node();
735
755
  if (!dropdownListEl.contains(event.target) && !triggerNode.contains(event.target)) {
736
756
  hideDropdown();
737
757
  }
738
- });
758
+ };
759
+ document.addEventListener('click', this._outsideClickHandler);
760
+ // 全屏切换(含点击全屏按钮和 F11)时收起
761
+ this._fullscreenChangeHandler = () => { hideDropdown(); };
762
+ document.addEventListener('fullscreenchange', this._fullscreenChangeHandler);
763
+ document.addEventListener('webkitfullscreenchange', this._fullscreenChangeHandler);
764
+ // F11 退出全屏时 keydown 被浏览器拦截,用 resize 兜底
765
+ this._resizeHideHandler = () => { hideDropdown(); };
766
+ window.addEventListener('resize', this._resizeHideHandler);
739
767
  // 滚动时收起
740
768
  document.addEventListener('scroll', hideDropdown, true);
741
769
  const buttonWidth = this.displayOption.operationButtonWidth + 'px', buttonHeight = this.displayOption.operationButtonHeight + 'px';
@@ -1 +1 @@
1
- [{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":23,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":75,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":76,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":77,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":78,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":79,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":80,"character":43},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"SystemTextLibraryService","line":82,"character":52},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":83,"character":43},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":84,"character":38},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":85,"character":51}]}],"dispose":[{"__symbolic":"method"}],"initKeyboardListener":[{"__symbolic":"method"}],"subscribeLanguageChange":[{"__symbolic":"method"}],"updateLanguageTexts":[{"__symbolic":"method"}],"getCurrentCulture":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"getTimePeriodText":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"setupTooltipAutoHide":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"initPoint":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__symbolic":"method"}],"fmtDatetimeLocal":[{"__symbolic":"method"}],"showCustomTimeRangeModal":[{"__symbolic":"method"}],"showCustomTimeRangeModalFallback":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"initElementStatus":[{"__symbolic":"method"}],"updateElementStatus":[{"__symbolic":"method"}],"setStatusAsUnbound":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"setStatusAsLoadFailed":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
1
+ [{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":23,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":77,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":78,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":79,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":80,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":81,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":82,"character":43},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"SystemTextLibraryService","line":84,"character":52},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":85,"character":43},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":86,"character":38},{"__symbolic":"reference","module":"../../service","name":"ReleasedVariableService","line":87,"character":51}]}],"dispose":[{"__symbolic":"method"}],"initKeyboardListener":[{"__symbolic":"method"}],"subscribeLanguageChange":[{"__symbolic":"method"}],"updateLanguageTexts":[{"__symbolic":"method"}],"getCurrentCulture":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"getTimePeriodText":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"setupTooltipAutoHide":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"initPoint":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__symbolic":"method"}],"fmtDatetimeLocal":[{"__symbolic":"method"}],"showCustomTimeRangeModal":[{"__symbolic":"method"}],"showCustomTimeRangeModalFallback":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"initElementStatus":[{"__symbolic":"method"}],"updateElementStatus":[{"__symbolic":"method"}],"setStatusAsUnbound":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"setStatusAsLoadFailed":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "main": "bundles/fc-gui.umd.js",
3
- "version": "3.0.0-alpha.173",
3
+ "version": "3.0.0-alpha.175",
4
4
  "module": "public_api.js",
5
5
  "typings": "public_api.d.ts",
6
6
  "license": "UNLICENSED",