@flexem/fc-gui 3.0.0-alpha.189 → 3.0.0-alpha.190
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 +12 -8
- 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.js +2 -2
- package/elements/alarm/alarm-table-scrollbar.d.ts +0 -1
- package/elements/alarm/alarm-table-scrollbar.js +10 -6
- package/elements/alarm/alarm-table-scrollbar.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -565,7 +565,7 @@ export class AlarmElement extends ConditionalDisplayElement {
|
|
|
565
565
|
this.scrollWindowStart = 0;
|
|
566
566
|
// WKWebView can paint positioned HTML descendants outside the SVG scale.
|
|
567
567
|
// Keep a single unpositioned table directly in foreignObject. The sibling
|
|
568
|
-
// SVG scrollbar
|
|
568
|
+
// SVG scrollbar sits inside the table's right border without an HTML scrolling layer.
|
|
569
569
|
const scrollbarWidth = Math.min(12, this.model.size.width * 0.04);
|
|
570
570
|
const tableHeight = elementHeight - operationAreaReservedHeight;
|
|
571
571
|
const table = document.createElement('table');
|
|
@@ -580,7 +580,7 @@ export class AlarmElement extends ConditionalDisplayElement {
|
|
|
580
580
|
const renderedTableHeight = table.getBoundingClientRect().height / canvasScaleY || tableHeight;
|
|
581
581
|
const renderedHeaderHeight = table.rows[0].getBoundingClientRect().height / canvasScaleY || this.model.heights[0];
|
|
582
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());
|
|
583
|
+
this.scrollbar = new AlarmTableScrollbar(this.element.parentNode, this.model.size.width - scrollbarWidth - scrollbarInset, renderedHeaderHeight + scrollbarInset, scrollbarWidth, Math.max(0, renderedTableHeight - renderedHeaderHeight - scrollbarInset * 2), this.maxVisibleRows, start => this.moveScrollWindowBy(start - this.scrollWindowStart), () => clearInterval(this.scrollIntervalId), () => this.startAutoScroll());
|
|
584
584
|
this.updateScrollThumb();
|
|
585
585
|
this.hoverTarget = table;
|
|
586
586
|
this.bindScrollHoverEvents();
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/** SVG scrollbar overlays the table bounds but stays outside foreignObject for WKWebView scaling. */
|
|
2
|
+
const TRACK_COLOR = '#f0f1f4';
|
|
3
|
+
const THUMB_COLOR = '#c5cbd4';
|
|
4
|
+
const ACTIVE_THUMB_COLOR = '#adb6c2';
|
|
2
5
|
export class AlarmTableScrollbar {
|
|
3
6
|
constructor(parent, x, y, width, height, visibleRows, onChange, onPause, onResume) {
|
|
4
7
|
this.y = y;
|
|
@@ -31,7 +34,7 @@ export class AlarmTableScrollbar {
|
|
|
31
34
|
this.dragging = true;
|
|
32
35
|
this.dragStartY = localY;
|
|
33
36
|
this.dragStartRow = this.start;
|
|
34
|
-
this.thumb.setAttribute('fill',
|
|
37
|
+
this.thumb.setAttribute('fill', ACTIVE_THUMB_COLOR);
|
|
35
38
|
this.thumb.style.cursor = 'grabbing';
|
|
36
39
|
this.ownerDocument.addEventListener('mousemove', this.handleMove);
|
|
37
40
|
this.ownerDocument.addEventListener('mouseup', this.handleEnd);
|
|
@@ -56,7 +59,7 @@ export class AlarmTableScrollbar {
|
|
|
56
59
|
return;
|
|
57
60
|
this.dragging = false;
|
|
58
61
|
this.unbindDrag();
|
|
59
|
-
this.thumb.setAttribute('fill',
|
|
62
|
+
this.thumb.setAttribute('fill', THUMB_COLOR);
|
|
60
63
|
this.thumb.style.cursor = 'grab';
|
|
61
64
|
this.onResume();
|
|
62
65
|
};
|
|
@@ -94,12 +97,13 @@ export class AlarmTableScrollbar {
|
|
|
94
97
|
this.group.style.cursor = 'default';
|
|
95
98
|
this.track = this.createElement('rect');
|
|
96
99
|
this.setRect(this.track, x, y, width, height);
|
|
97
|
-
this.track.setAttribute('fill',
|
|
100
|
+
this.track.setAttribute('fill', TRACK_COLOR);
|
|
98
101
|
this.track.setAttribute('rx', '0');
|
|
99
102
|
this.thumb = this.createElement('rect');
|
|
100
|
-
this.setRect(this.thumb, x
|
|
101
|
-
this.thumb.setAttribute('fill',
|
|
102
|
-
this.thumb.setAttribute('rx', String(width /
|
|
103
|
+
this.setRect(this.thumb, x, y, width, height);
|
|
104
|
+
this.thumb.setAttribute('fill', THUMB_COLOR);
|
|
105
|
+
this.thumb.setAttribute('rx', String(width / 2));
|
|
106
|
+
this.thumb.style.transition = 'fill 120ms ease';
|
|
103
107
|
this.thumb.style.cursor = 'grab';
|
|
104
108
|
this.group.appendChild(this.track);
|
|
105
109
|
this.group.appendChild(this.thumb);
|
|
@@ -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":20,"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":26,"character":35},{"__symbolic":"error","message":"Expression form not supported","line":27,"character":34},{"__symbolic":"error","message":"Expression form not supported","line":28,"character":35}]}],"update":[{"__symbolic":"method"}],"dispose":[{"__symbolic":"method"}],"createElement":[{"__symbolic":"method"}],"setRect":[{"__symbolic":"method"}],"getLocalY":[{"__symbolic":"method"}],"unbindDrag":[{"__symbolic":"method"}],"supportsMouseHover":[{"__symbolic":"method"}]}}}}]
|