@flexem/fc-gui 3.0.0-alpha.188 → 3.0.0-alpha.189
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 +25 -23
- 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/alarm/alarm-element.d.ts +1 -0
- package/elements/alarm/alarm-element.js +16 -7
- package/elements/alarm/alarm-element.metadata.json +1 -1
- package/elements/alarm/alarm-table-scrollbar.d.ts +2 -4
- package/elements/alarm/alarm-table-scrollbar.js +9 -16
- package/elements/alarm/alarm-table-scrollbar.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -88,6 +88,7 @@ export declare class AlarmElement extends ConditionalDisplayElement {
|
|
|
88
88
|
private readonly handleScrollTouchEnd;
|
|
89
89
|
private getCanvasScaleY;
|
|
90
90
|
private getScreenRowHeight;
|
|
91
|
+
private supportsMouseHover;
|
|
91
92
|
private startAutoScroll;
|
|
92
93
|
private scrollOneRow;
|
|
93
94
|
private autoNextPage;
|
|
@@ -87,6 +87,8 @@ export class AlarmElement extends ConditionalDisplayElement {
|
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
this.handleScrollMouseEnter = () => {
|
|
90
|
+
if (!this.supportsMouseHover())
|
|
91
|
+
return;
|
|
90
92
|
this.scrollHovered = true;
|
|
91
93
|
clearInterval(this.scrollIntervalId);
|
|
92
94
|
};
|
|
@@ -416,10 +418,10 @@ export class AlarmElement extends ConditionalDisplayElement {
|
|
|
416
418
|
}
|
|
417
419
|
updateScrollThumb() {
|
|
418
420
|
if (this.scrollbar)
|
|
419
|
-
this.scrollbar.update(this.scrollWindowStart, this.
|
|
421
|
+
this.scrollbar.update(this.scrollWindowStart, this.pageSize);
|
|
420
422
|
}
|
|
421
423
|
getMaxWindowStart() {
|
|
422
|
-
return Math.max(0, this.
|
|
424
|
+
return Math.max(0, this.pageSize - this.maxVisibleRows);
|
|
423
425
|
}
|
|
424
426
|
getIconScale() {
|
|
425
427
|
const initSize = this.model.initSize;
|
|
@@ -562,8 +564,8 @@ export class AlarmElement extends ConditionalDisplayElement {
|
|
|
562
564
|
this.rowHeight = dataRowHeight;
|
|
563
565
|
this.scrollWindowStart = 0;
|
|
564
566
|
// WKWebView can paint positioned HTML descendants outside the SVG scale.
|
|
565
|
-
// Keep a single unpositioned table directly in foreignObject
|
|
566
|
-
//
|
|
567
|
+
// Keep a single unpositioned table directly in foreignObject. The sibling
|
|
568
|
+
// SVG scrollbar overlays the table's right edge without an HTML scrolling layer.
|
|
567
569
|
const scrollbarWidth = Math.min(12, this.model.size.width * 0.04);
|
|
568
570
|
const tableHeight = elementHeight - operationAreaReservedHeight;
|
|
569
571
|
const table = document.createElement('table');
|
|
@@ -571,12 +573,14 @@ export class AlarmElement extends ConditionalDisplayElement {
|
|
|
571
573
|
height: ${tableHeight}px; width: 100%; table-layout: fixed;
|
|
572
574
|
overflow-wrap: break-word; -webkit-text-size-adjust: none; text-size-adjust: none;`;
|
|
573
575
|
table.appendChild(this.buildHeaderRow());
|
|
574
|
-
this.element.setAttribute('width', String(this.model.size.width - scrollbarWidth));
|
|
575
576
|
this.element.appendChild(table);
|
|
576
577
|
this.scrollContent = table;
|
|
577
578
|
this.renderScrollWindow(0);
|
|
578
|
-
const
|
|
579
|
-
|
|
579
|
+
const canvasScaleY = this.getCanvasScaleY();
|
|
580
|
+
const renderedTableHeight = table.getBoundingClientRect().height / canvasScaleY || tableHeight;
|
|
581
|
+
const renderedHeaderHeight = table.rows[0].getBoundingClientRect().height / canvasScaleY || this.model.heights[0];
|
|
582
|
+
const scrollbarInset = 2;
|
|
583
|
+
this.scrollbar = new AlarmTableScrollbar(this.element.parentNode, this.model.size.width - scrollbarWidth, renderedHeaderHeight + scrollbarInset, scrollbarWidth, Math.max(0, renderedTableHeight - renderedHeaderHeight - scrollbarInset * 2), this.maxVisibleRows, start => this.moveScrollWindowBy(start - this.scrollWindowStart), () => clearInterval(this.scrollIntervalId), () => this.startAutoScroll());
|
|
580
584
|
this.updateScrollThumb();
|
|
581
585
|
this.hoverTarget = table;
|
|
582
586
|
this.bindScrollHoverEvents();
|
|
@@ -633,6 +637,11 @@ export class AlarmElement extends ConditionalDisplayElement {
|
|
|
633
637
|
const row = (_a = this.scrollContent) === null || _a === void 0 ? void 0 : _a.querySelectorAll('tr')[1];
|
|
634
638
|
return (row === null || row === void 0 ? void 0 : row.getBoundingClientRect().height) || this.rowHeight * this.getCanvasScaleY();
|
|
635
639
|
}
|
|
640
|
+
supportsMouseHover() {
|
|
641
|
+
var _a, _b;
|
|
642
|
+
const view = (_b = (_a = this.element) === null || _a === void 0 ? void 0 : _a.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView;
|
|
643
|
+
return !!view && (!view.matchMedia || view.matchMedia('(hover: hover) and (pointer: fine)').matches);
|
|
644
|
+
}
|
|
636
645
|
startAutoScroll() {
|
|
637
646
|
var _a;
|
|
638
647
|
clearInterval(this.scrollIntervalId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"AlarmElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":22,"character":34},"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":"AlarmsStore","line":73,"character":38},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"SystemTextLibraryService","line":75,"character":52},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":76,"character":43},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":77,"character":38}]}],"dispose":[{"__symbolic":"method"}],"subscribeLanguageChange":[{"__symbolic":"method"}],"updateLanguageTexts":[{"__symbolic":"method"}],"getCurrentCulture":[{"__symbolic":"method"}],"getHeaderTextByColumn":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"getTimePeriodText":[{"__symbolic":"method"}],"getAlarmData":[{"__symbolic":"method"}],"refreshCurrentPageData":[{"__symbolic":"method"}],"updateTableContent":[{"__symbolic":"method"}],"renderScrollWindow":[{"__symbolic":"method"}],"updateScrollThumb":[{"__symbolic":"method"}],"getMaxWindowStart":[{"__symbolic":"method"}],"getIconScale":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"buildHeaderRow":[{"__symbolic":"method"}],"buildDataRow":[{"__symbolic":"method"}],"renderPlainTable":[{"__symbolic":"method"}],"renderScrollableTable":[{"__symbolic":"method"}],"bindScrollHoverEvents":[{"__symbolic":"method"}],"unbindScrollHoverEvents":[{"__symbolic":"method"}],"moveScrollWindowBy":[{"__symbolic":"method"}],"getCanvasScaleY":[{"__symbolic":"method"}],"getScreenRowHeight":[{"__symbolic":"method"}],"startAutoScroll":[{"__symbolic":"method"}],"scrollOneRow":[{"__symbolic":"method"}],"autoNextPage":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"setStatusAsNormal":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AlarmElement":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../base/conditional-display-element","name":"ConditionalDisplayElement","line":22,"character":34},"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":"AlarmsStore","line":73,"character":38},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"../../service","name":"SystemTextLibraryService","line":75,"character":52},{"__symbolic":"reference","module":"../../service","name":"LanguageService","line":76,"character":43},{"__symbolic":"reference","module":"../../gui/gui-context","name":"GuiContext","line":77,"character":38}]}],"dispose":[{"__symbolic":"method"}],"subscribeLanguageChange":[{"__symbolic":"method"}],"updateLanguageTexts":[{"__symbolic":"method"}],"getCurrentCulture":[{"__symbolic":"method"}],"getHeaderTextByColumn":[{"__symbolic":"method"}],"getValidTimePeriods":[{"__symbolic":"method"}],"getTimePeriodText":[{"__symbolic":"method"}],"getAlarmData":[{"__symbolic":"method"}],"refreshCurrentPageData":[{"__symbolic":"method"}],"updateTableContent":[{"__symbolic":"method"}],"renderScrollWindow":[{"__symbolic":"method"}],"updateScrollThumb":[{"__symbolic":"method"}],"getMaxWindowStart":[{"__symbolic":"method"}],"getIconScale":[{"__symbolic":"method"}],"renderElement":[{"__symbolic":"method"}],"buildHeaderRow":[{"__symbolic":"method"}],"buildDataRow":[{"__symbolic":"method"}],"renderPlainTable":[{"__symbolic":"method"}],"renderScrollableTable":[{"__symbolic":"method"}],"bindScrollHoverEvents":[{"__symbolic":"method"}],"unbindScrollHoverEvents":[{"__symbolic":"method"}],"moveScrollWindowBy":[{"__symbolic":"method"}],"getCanvasScaleY":[{"__symbolic":"method"}],"getScreenRowHeight":[{"__symbolic":"method"}],"supportsMouseHover":[{"__symbolic":"method"}],"startAutoScroll":[{"__symbolic":"method"}],"scrollOneRow":[{"__symbolic":"method"}],"autoNextPage":[{"__symbolic":"method"}],"renderOperationArea":[{"__symbolic":"method"}],"updateTimeRange":[{"__symbolic":"method"}],"updateQueryTimeRange":[{"__symbolic":"method"}],"loadFirstPage":[{"__symbolic":"method"}],"loadNextPage":[{"__symbolic":"method"}],"loadPreviousPage":[{"__symbolic":"method"}],"loadLastPage":[{"__symbolic":"method"}],"setStatusAsNormal":[{"__symbolic":"method"}],"setStatusAsLoading":[{"__symbolic":"method"}],"renderStatus":[{"__symbolic":"method"}],"clearStatus":[{"__symbolic":"method"}]}}}}]
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** SVG scrollbar
|
|
1
|
+
/** SVG scrollbar overlays the table bounds but stays outside foreignObject for WKWebView scaling. */
|
|
2
2
|
export declare class AlarmTableScrollbar {
|
|
3
3
|
private readonly y;
|
|
4
4
|
private readonly height;
|
|
@@ -16,7 +16,6 @@ export declare class AlarmTableScrollbar {
|
|
|
16
16
|
private thumbTop;
|
|
17
17
|
private dragging;
|
|
18
18
|
private hovered;
|
|
19
|
-
private focused;
|
|
20
19
|
private dragStartY;
|
|
21
20
|
private dragStartRow;
|
|
22
21
|
constructor(parent: SVGElement, x: number, y: number, width: number, height: number, visibleRows: number, onChange: (start: number) => void, onPause: () => void, onResume: () => void);
|
|
@@ -31,8 +30,7 @@ export declare class AlarmTableScrollbar {
|
|
|
31
30
|
private readonly handleEnd;
|
|
32
31
|
private readonly handleLeave;
|
|
33
32
|
private readonly handleEnter;
|
|
34
|
-
private readonly handleFocus;
|
|
35
|
-
private readonly handleBlur;
|
|
36
33
|
private readonly handleKeyDown;
|
|
37
34
|
private unbindDrag;
|
|
35
|
+
private supportsMouseHover;
|
|
38
36
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** SVG scrollbar
|
|
1
|
+
/** SVG scrollbar overlays the table bounds but stays outside foreignObject for WKWebView scaling. */
|
|
2
2
|
export class AlarmTableScrollbar {
|
|
3
3
|
constructor(parent, x, y, width, height, visibleRows, onChange, onPause, onResume) {
|
|
4
4
|
this.y = y;
|
|
@@ -13,7 +13,6 @@ export class AlarmTableScrollbar {
|
|
|
13
13
|
this.thumbTop = 0;
|
|
14
14
|
this.dragging = false;
|
|
15
15
|
this.hovered = false;
|
|
16
|
-
this.focused = false;
|
|
17
16
|
this.dragStartY = 0;
|
|
18
17
|
this.dragStartRow = 0;
|
|
19
18
|
this.handleStart = (event) => {
|
|
@@ -66,17 +65,11 @@ export class AlarmTableScrollbar {
|
|
|
66
65
|
this.onResume();
|
|
67
66
|
};
|
|
68
67
|
this.handleEnter = () => {
|
|
68
|
+
if (!this.supportsMouseHover())
|
|
69
|
+
return;
|
|
69
70
|
this.hovered = true;
|
|
70
71
|
this.onPause();
|
|
71
72
|
};
|
|
72
|
-
this.handleFocus = () => {
|
|
73
|
-
this.focused = true;
|
|
74
|
-
this.onPause();
|
|
75
|
-
};
|
|
76
|
-
this.handleBlur = () => {
|
|
77
|
-
this.focused = false;
|
|
78
|
-
this.onResume();
|
|
79
|
-
};
|
|
80
73
|
this.handleKeyDown = (event) => {
|
|
81
74
|
const targets = {
|
|
82
75
|
ArrowUp: this.start - 1,
|
|
@@ -102,7 +95,7 @@ export class AlarmTableScrollbar {
|
|
|
102
95
|
this.track = this.createElement('rect');
|
|
103
96
|
this.setRect(this.track, x, y, width, height);
|
|
104
97
|
this.track.setAttribute('fill', '#eef0f4');
|
|
105
|
-
this.track.setAttribute('rx',
|
|
98
|
+
this.track.setAttribute('rx', '0');
|
|
106
99
|
this.thumb = this.createElement('rect');
|
|
107
100
|
this.setRect(this.thumb, x + width / 4, y, width / 2, height);
|
|
108
101
|
this.thumb.setAttribute('fill', '#b6bdc9');
|
|
@@ -116,11 +109,9 @@ export class AlarmTableScrollbar {
|
|
|
116
109
|
this.group.addEventListener('keydown', this.handleKeyDown);
|
|
117
110
|
this.group.addEventListener('mouseenter', this.handleEnter);
|
|
118
111
|
this.group.addEventListener('mouseleave', this.handleLeave);
|
|
119
|
-
this.group.addEventListener('focus', this.handleFocus);
|
|
120
|
-
this.group.addEventListener('blur', this.handleBlur);
|
|
121
112
|
}
|
|
122
113
|
get isInteracting() {
|
|
123
|
-
return this.dragging || this.hovered
|
|
114
|
+
return this.dragging || this.hovered;
|
|
124
115
|
}
|
|
125
116
|
update(start, totalRows) {
|
|
126
117
|
this.maxStart = Math.max(0, totalRows - this.visibleRows);
|
|
@@ -141,8 +132,6 @@ export class AlarmTableScrollbar {
|
|
|
141
132
|
this.group.removeEventListener('keydown', this.handleKeyDown);
|
|
142
133
|
this.group.removeEventListener('mouseenter', this.handleEnter);
|
|
143
134
|
this.group.removeEventListener('mouseleave', this.handleLeave);
|
|
144
|
-
this.group.removeEventListener('focus', this.handleFocus);
|
|
145
|
-
this.group.removeEventListener('blur', this.handleBlur);
|
|
146
135
|
this.group.remove();
|
|
147
136
|
}
|
|
148
137
|
createElement(name) {
|
|
@@ -170,4 +159,8 @@ export class AlarmTableScrollbar {
|
|
|
170
159
|
this.ownerDocument.removeEventListener('touchcancel', this.handleEnd);
|
|
171
160
|
this.ownerDocument.defaultView.removeEventListener('blur', this.handleEnd);
|
|
172
161
|
}
|
|
162
|
+
supportsMouseHover() {
|
|
163
|
+
const view = this.ownerDocument.defaultView;
|
|
164
|
+
return !!view && (!view.matchMedia || view.matchMedia('(hover: hover) and (pointer: fine)').matches);
|
|
165
|
+
}
|
|
173
166
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"AlarmTableScrollbar":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"AlarmTableScrollbar":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Could not resolve type","line":16,"character":16,"context":{"typeName":"SVGElement"}},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"number"},{"__symbolic":"error","message":"Expression form not supported","line":22,"character":35},{"__symbolic":"error","message":"Expression form not supported","line":23,"character":34},{"__symbolic":"error","message":"Expression form not supported","line":24,"character":35}]}],"update":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"createElement":[{"__symbolic":"method"}],"setRect":[{"__symbolic":"method"}],"getLocalY":[{"__symbolic":"method"}],"unbindDrag":[{"__symbolic":"method"}],"supportsMouseHover":[{"__symbolic":"method"}]}}}}]
|