@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.
@@ -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 overlays the table's right edge without an HTML scrolling layer.
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,3 @@
1
- /** SVG scrollbar overlays the table bounds but stays outside foreignObject for WKWebView scaling. */
2
1
  export declare class AlarmTableScrollbar {
3
2
  private readonly y;
4
3
  private readonly height;
@@ -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', '#8f99aa');
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', '#b6bdc9');
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', '#eef0f4');
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 + width / 4, y, width / 2, height);
101
- this.thumb.setAttribute('fill', '#b6bdc9');
102
- this.thumb.setAttribute('rx', String(width / 4));
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":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"}]}}}}]
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"}]}}}}]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "main": "bundles/fc-gui.umd.js",
3
- "version": "3.0.0-alpha.189",
3
+ "version": "3.0.0-alpha.190",
4
4
  "module": "public_api.js",
5
5
  "typings": "public_api.d.ts",
6
6
  "license": "UNLICENSED",