@flexem/fc-gui 3.0.0-alpha.105 → 3.0.0-alpha.106
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/CHANGELOG.md +6 -1
- package/bundles/@flexem/fc-gui.umd.js +20 -1
- package/bundles/@flexem/fc-gui.umd.js.map +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js +1 -1
- package/bundles/@flexem/fc-gui.umd.min.js.map +1 -1
- package/elements/datetime-display/datetime-display-element.js +1 -1
- package/elements/historical-curve/historical-curve.element.d.ts +4 -0
- package/elements/historical-curve/historical-curve.element.js +19 -0
- package/elements/historical-curve/historical-curve.element.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -35,8 +35,12 @@ export declare class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
35
35
|
private data;
|
|
36
36
|
private timer;
|
|
37
37
|
private resizeEventListener;
|
|
38
|
+
private isAndroid;
|
|
39
|
+
private needResize;
|
|
38
40
|
constructor(element: HTMLElement, injector: Injector, permissionChecker: PermissionChecker, variableCommunicator: VariableCommunicator, variableStore: VariableStore, historyDataStore: HistoryDataStore, signalRAppId: string);
|
|
39
41
|
dispose(): void;
|
|
42
|
+
private initKeyboardListener;
|
|
43
|
+
private setNeedResize;
|
|
40
44
|
private getValidTimePeriods;
|
|
41
45
|
private updateTimeRange;
|
|
42
46
|
private updateQueryTimeRange;
|
|
@@ -30,6 +30,11 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
30
30
|
};
|
|
31
31
|
this.elementStatus = HistoricalCurveElementStatus.Loading;
|
|
32
32
|
this.data = [];
|
|
33
|
+
this.needResize = true;
|
|
34
|
+
this.setNeedResize = () => {
|
|
35
|
+
this.needResize = false;
|
|
36
|
+
setTimeout(() => this.needResize = true, 500);
|
|
37
|
+
};
|
|
33
38
|
this.logger = injector.get(LOGGER_SERVICE_TOKEN);
|
|
34
39
|
this.localization = injector.get(LOCALIZATION);
|
|
35
40
|
this.timePeriods = this.getValidTimePeriods();
|
|
@@ -50,6 +55,7 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
50
55
|
}
|
|
51
56
|
}
|
|
52
57
|
this.loadFirstPage();
|
|
58
|
+
this.initKeyboardListener();
|
|
53
59
|
}
|
|
54
60
|
dispose() {
|
|
55
61
|
clearInterval(this.refreshIntervalId);
|
|
@@ -59,8 +65,19 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
59
65
|
if (this.resizeEventListener) {
|
|
60
66
|
this.resizeEventListener.clear();
|
|
61
67
|
}
|
|
68
|
+
if (this.isAndroid) {
|
|
69
|
+
window.removeEventListener('native.keyboardshow', this.setNeedResize);
|
|
70
|
+
window.removeEventListener('native.keyboardhide', this.setNeedResize);
|
|
71
|
+
}
|
|
62
72
|
this.logger.debug(`[GUI]Dispose Histoical Curve Refresh Interval:${d3.time.format('%x %X')(new Date())}`);
|
|
63
73
|
}
|
|
74
|
+
initKeyboardListener() {
|
|
75
|
+
this.isAndroid = !!navigator.userAgent.match(/(Android)/i);
|
|
76
|
+
if (this.isAndroid) {
|
|
77
|
+
window.addEventListener('native.keyboardshow', this.setNeedResize);
|
|
78
|
+
window.addEventListener('native.keyboardhide', this.setNeedResize);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
64
81
|
getValidTimePeriods() {
|
|
65
82
|
const timePeriods = new Array();
|
|
66
83
|
timePeriods.push({ key: 6, name: this.localization.lastThirtyMinutes });
|
|
@@ -307,6 +324,8 @@ export class HistoricalCurveElement extends ConditionalDisplayElement {
|
|
|
307
324
|
this.rootElement.append('g').datum(data).call(chart);
|
|
308
325
|
this.rootElement.selectAll('.nv-noData').attr('x', chartWidth / 2).attr('y', chartHeight / 2 + this.displayOption.operationAreaHeight);
|
|
309
326
|
this.resizeEventListener = nv.utils.windowResize(() => {
|
|
327
|
+
if (!this.needResize)
|
|
328
|
+
return;
|
|
310
329
|
chart.update();
|
|
311
330
|
this.rootElement.selectAll('.nv-noData').attr('x', chartWidth / 2).attr('y', chartHeight / 2 + this.displayOption.operationAreaHeight);
|
|
312
331
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":21,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"HistoricalCurveElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":21,"character":44},"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":68,"character":25,"context":{"typeName":"HTMLElement"}},{"__symbolic":"reference","module":"@angular/core","name":"Injector","line":69,"character":18},{"__symbolic":"reference","module":"../../service","name":"PermissionChecker","line":70,"character":27},{"__symbolic":"reference","module":"../../communication","name":"VariableCommunicator","line":71,"character":30},{"__symbolic":"reference","module":"../../config","name":"VariableStore","line":72,"character":23},{"__symbolic":"reference","module":"../../config","name":"HistoryDataStore","line":73,"character":43},{"__symbolic":"reference","name":"string"}]}],"dispose":[{"__symbolic":"method"}],"initKeyboardListener":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"reRenderElement":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"renderChart":[{"__symbolic":"method"}],"initPoint":[{"__symbolic":"method"}],"getLineChart":[{"__symbolic":"method"}],"getMultiBarWithFocusChart":[{"__symbolic":"method"}],"renderCommonProperty":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"timeFormat":[{"__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"}]}}}}]
|