@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.
@@ -42488,7 +42488,7 @@ C140,111.8,99.2,158.4,78,178.6z M78,40.4c-17.8,0-32.4,14.4-32.4,32.2s14.5,32.2,3
42488
42488
  }
42489
42489
 
42490
42490
  // CONCATENATED MODULE: ./.tmp/elements/alarm/alarm-table-scrollbar.ts
42491
- /** SVG scrollbar kept outside foreignObject so WKWebView applies the canvas scale. */
42491
+ /** SVG scrollbar overlays the table bounds but stays outside foreignObject for WKWebView scaling. */
42492
42492
  class AlarmTableScrollbar {
42493
42493
  constructor(parent, x, y, width, height, visibleRows, onChange, onPause, onResume) {
42494
42494
  this.y = y;
@@ -42503,7 +42503,6 @@ class AlarmTableScrollbar {
42503
42503
  this.thumbTop = 0;
42504
42504
  this.dragging = false;
42505
42505
  this.hovered = false;
42506
- this.focused = false;
42507
42506
  this.dragStartY = 0;
42508
42507
  this.dragStartRow = 0;
42509
42508
  this.handleStart = (event) => {
@@ -42556,17 +42555,11 @@ class AlarmTableScrollbar {
42556
42555
  this.onResume();
42557
42556
  };
42558
42557
  this.handleEnter = () => {
42558
+ if (!this.supportsMouseHover())
42559
+ return;
42559
42560
  this.hovered = true;
42560
42561
  this.onPause();
42561
42562
  };
42562
- this.handleFocus = () => {
42563
- this.focused = true;
42564
- this.onPause();
42565
- };
42566
- this.handleBlur = () => {
42567
- this.focused = false;
42568
- this.onResume();
42569
- };
42570
42563
  this.handleKeyDown = (event) => {
42571
42564
  const targets = {
42572
42565
  ArrowUp: this.start - 1,
@@ -42592,7 +42585,7 @@ class AlarmTableScrollbar {
42592
42585
  this.track = this.createElement('rect');
42593
42586
  this.setRect(this.track, x, y, width, height);
42594
42587
  this.track.setAttribute('fill', '#eef0f4');
42595
- this.track.setAttribute('rx', String(width / 2));
42588
+ this.track.setAttribute('rx', '0');
42596
42589
  this.thumb = this.createElement('rect');
42597
42590
  this.setRect(this.thumb, x + width / 4, y, width / 2, height);
42598
42591
  this.thumb.setAttribute('fill', '#b6bdc9');
@@ -42606,11 +42599,9 @@ class AlarmTableScrollbar {
42606
42599
  this.group.addEventListener('keydown', this.handleKeyDown);
42607
42600
  this.group.addEventListener('mouseenter', this.handleEnter);
42608
42601
  this.group.addEventListener('mouseleave', this.handleLeave);
42609
- this.group.addEventListener('focus', this.handleFocus);
42610
- this.group.addEventListener('blur', this.handleBlur);
42611
42602
  }
42612
42603
  get isInteracting() {
42613
- return this.dragging || this.hovered || this.focused;
42604
+ return this.dragging || this.hovered;
42614
42605
  }
42615
42606
  update(start, totalRows) {
42616
42607
  this.maxStart = Math.max(0, totalRows - this.visibleRows);
@@ -42631,8 +42622,6 @@ class AlarmTableScrollbar {
42631
42622
  this.group.removeEventListener('keydown', this.handleKeyDown);
42632
42623
  this.group.removeEventListener('mouseenter', this.handleEnter);
42633
42624
  this.group.removeEventListener('mouseleave', this.handleLeave);
42634
- this.group.removeEventListener('focus', this.handleFocus);
42635
- this.group.removeEventListener('blur', this.handleBlur);
42636
42625
  this.group.remove();
42637
42626
  }
42638
42627
  createElement(name) {
@@ -42660,6 +42649,10 @@ class AlarmTableScrollbar {
42660
42649
  this.ownerDocument.removeEventListener('touchcancel', this.handleEnd);
42661
42650
  this.ownerDocument.defaultView.removeEventListener('blur', this.handleEnd);
42662
42651
  }
42652
+ supportsMouseHover() {
42653
+ const view = this.ownerDocument.defaultView;
42654
+ return !!view && (!view.matchMedia || view.matchMedia('(hover: hover) and (pointer: fine)').matches);
42655
+ }
42663
42656
  }
42664
42657
 
42665
42658
  // CONCATENATED MODULE: ./.tmp/elements/alarm/alarm-element.ts
@@ -42752,6 +42745,8 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
42752
42745
  }
42753
42746
  };
42754
42747
  this.handleScrollMouseEnter = () => {
42748
+ if (!this.supportsMouseHover())
42749
+ return;
42755
42750
  this.scrollHovered = true;
42756
42751
  clearInterval(this.scrollIntervalId);
42757
42752
  };
@@ -43081,10 +43076,10 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
43081
43076
  }
43082
43077
  updateScrollThumb() {
43083
43078
  if (this.scrollbar)
43084
- this.scrollbar.update(this.scrollWindowStart, this.alarmList.length);
43079
+ this.scrollbar.update(this.scrollWindowStart, this.pageSize);
43085
43080
  }
43086
43081
  getMaxWindowStart() {
43087
- return Math.max(0, this.alarmList.length - this.maxVisibleRows);
43082
+ return Math.max(0, this.pageSize - this.maxVisibleRows);
43088
43083
  }
43089
43084
  getIconScale() {
43090
43085
  const initSize = this.model.initSize;
@@ -43227,8 +43222,8 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
43227
43222
  this.rowHeight = dataRowHeight;
43228
43223
  this.scrollWindowStart = 0;
43229
43224
  // WKWebView can paint positioned HTML descendants outside the SVG scale.
43230
- // Keep a single unpositioned table directly in foreignObject; the scrollbar
43231
- // is a sibling SVG group, never an HTML overlay or native scrolling layer.
43225
+ // Keep a single unpositioned table directly in foreignObject. The sibling
43226
+ // SVG scrollbar overlays the table's right edge without an HTML scrolling layer.
43232
43227
  const scrollbarWidth = Math.min(12, this.model.size.width * 0.04);
43233
43228
  const tableHeight = elementHeight - operationAreaReservedHeight;
43234
43229
  const table = document.createElement('table');
@@ -43236,12 +43231,14 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
43236
43231
  height: ${tableHeight}px; width: 100%; table-layout: fixed;
43237
43232
  overflow-wrap: break-word; -webkit-text-size-adjust: none; text-size-adjust: none;`;
43238
43233
  table.appendChild(this.buildHeaderRow());
43239
- this.element.setAttribute('width', String(this.model.size.width - scrollbarWidth));
43240
43234
  this.element.appendChild(table);
43241
43235
  this.scrollContent = table;
43242
43236
  this.renderScrollWindow(0);
43243
- const headerHeight = Math.min(tableHeight, table.rows[0].getBoundingClientRect().height / this.getCanvasScaleY());
43244
- this.scrollbar = new AlarmTableScrollbar(this.element.parentNode, this.model.size.width - scrollbarWidth, headerHeight, scrollbarWidth, Math.max(0, tableHeight - headerHeight), this.maxVisibleRows, start => this.moveScrollWindowBy(start - this.scrollWindowStart), () => clearInterval(this.scrollIntervalId), () => this.startAutoScroll());
43237
+ const canvasScaleY = this.getCanvasScaleY();
43238
+ const renderedTableHeight = table.getBoundingClientRect().height / canvasScaleY || tableHeight;
43239
+ const renderedHeaderHeight = table.rows[0].getBoundingClientRect().height / canvasScaleY || this.model.heights[0];
43240
+ const scrollbarInset = 2;
43241
+ 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());
43245
43242
  this.updateScrollThumb();
43246
43243
  this.hoverTarget = table;
43247
43244
  this.bindScrollHoverEvents();
@@ -43298,6 +43295,11 @@ class alarm_element_AlarmElement extends conditional_display_element_Conditional
43298
43295
  const row = (_a = this.scrollContent) === null || _a === void 0 ? void 0 : _a.querySelectorAll('tr')[1];
43299
43296
  return (row === null || row === void 0 ? void 0 : row.getBoundingClientRect().height) || this.rowHeight * this.getCanvasScaleY();
43300
43297
  }
43298
+ supportsMouseHover() {
43299
+ var _a, _b;
43300
+ const view = (_b = (_a = this.element) === null || _a === void 0 ? void 0 : _a.ownerDocument) === null || _b === void 0 ? void 0 : _b.defaultView;
43301
+ return !!view && (!view.matchMedia || view.matchMedia('(hover: hover) and (pointer: fine)').matches);
43302
+ }
43301
43303
  startAutoScroll() {
43302
43304
  var _a;
43303
43305
  clearInterval(this.scrollIntervalId);