@guiexpert/table 1.1.117 → 1.1.118

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/index.js CHANGED
@@ -1075,7 +1075,9 @@ class ua {
1075
1075
  constructor(e) {
1076
1076
  this.tableScope = e, this.doubleClickDelay = 500, this.clickMoveTolerance = 4, this.lastClickedCellKey = "", this.nativeClickCount = 0, this.nativeDblClickCount = 0, this.mouseDown = !1, this.repaintAfterMouseUp = !1, this.dragging = !1, this.dragGeneration = 0, this.lastClicked = 0;
1077
1077
  const t = this.tableScope.listenerAbortController.signal;
1078
- this.tableScope.hostElement.addEventListener("click", this.onHostElementClicked.bind(this), { signal: t }), this.tableScope.hostElement.addEventListener("dblclick", this.onHostElementDblClicked.bind(this), { signal: t }), this.tableScope.hostElement.addEventListener("mousedown", this.onMouseDown.bind(this), { signal: t }), this.tableScope.hostElement.addEventListener("mousemove", this.onMouseMove.bind(this), { signal: t }), this.tableScope.hostElement.addEventListener("mouseup", this.onMouseUp.bind(this), { signal: t }), this.tableScope.hostElement.addEventListener("contextmenu", this.onContextmenu.bind(this), { signal: t }), t.addEventListener("abort", () => clearTimeout(this.lostClickTimer)), this.tableScope.hostElement._MouseHandler = "true", this.tableScope.scrollViewport.addEventListener("scroll", () => this.tableScope.onViewportScroll(), { signal: t }), this.tableScope.scrollViewport.addEventListener("wheel", this.tableScope.onWheel.bind(this.tableScope), { passive: !1, signal: t }), [window, this.tableScope.hostElement].forEach(
1078
+ this.tableScope.hostElement.addEventListener("click", this.onHostElementClicked.bind(this), { signal: t }), this.tableScope.hostElement.addEventListener("dblclick", this.onHostElementDblClicked.bind(this), { signal: t }), this.tableScope.hostElement.addEventListener("mousedown", this.onMouseDown.bind(this), { signal: t }), this.tableScope.hostElement.addEventListener("mousemove", this.onMouseMove.bind(this), { signal: t }), this.tableScope.hostElement.addEventListener("mouseup", this.onMouseUp.bind(this), { signal: t }), this.tableScope.hostElement.addEventListener("contextmenu", this.onContextmenu.bind(this), { signal: t }), t.addEventListener("abort", () => clearTimeout(this.lostClickTimer)), this.tableScope.hostElement._MouseHandler = "true", this.tableScope.scrollViewport.addEventListener("scroll", () => this.tableScope.onViewportScroll(), { signal: t }), this.tableScope.scrollViewport.addEventListener("wheel", this.tableScope.onWheel.bind(this.tableScope), { passive: !1, signal: t }), this.tableScope.getFixedBodyAreaElements().forEach(
1079
+ (s) => s.addEventListener("wheel", (o) => this.tableScope.onFixedAreaWheel(o), { passive: !1, signal: t })
1080
+ ), [window, this.tableScope.hostElement].forEach(
1079
1081
  (s) => s.addEventListener("resize", this.tableScope.adjustContainersAndRows.bind(this.tableScope), { signal: t })
1080
1082
  );
1081
1083
  }
@@ -10343,6 +10345,15 @@ const mo = class mo {
10343
10345
  const e = `${this.tableModel.getContentWidthInPixel()}px`, t = this.getBodyContentHeight() + 1, s = `${Math.min(t, mo.maxScrollHeightInPx)}px`;
10344
10346
  this.dom.setStyle(this.contentWrapperDiv, "width", e), this.dom.setStyle(this.contentWrapperDiv, "height", s);
10345
10347
  }
10348
+ /**
10349
+ * The parent divs of the fixed body areas (west, east) – they lie above the scroll viewport, not inside it.
10350
+ *
10351
+ * @returns {HTMLDivElement[]} west and east body area
10352
+ * @since 1.1.118
10353
+ */
10354
+ getFixedBodyAreaElements() {
10355
+ return [this.areaBodyWest.parent, this.areaBodyEast.parent];
10356
+ }
10346
10357
  };
10347
10358
  mo.maxScrollHeightInPx = 8e6;
10348
10359
  let io = mo;
@@ -11547,6 +11558,24 @@ class Fc extends io {
11547
11558
  const o = s / t, i = e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? this.scrollViewport.clientHeight : 1;
11548
11559
  e.preventDefault(), e.deltaY && (this.scrollViewport.scrollTop += e.deltaY * i * o), e.deltaX && (this.scrollViewport.scrollLeft += e.deltaX * i);
11549
11560
  }
11561
+ /**
11562
+ * Mouse wheel over the FIXED body areas (west/east): they lie next to the scroll viewport, so the browser does not
11563
+ * scroll anything there – pass the movement on to the viewport, like a wheel over the middle columns.
11564
+ * Not consumed when the table cannot move further (the page scrolls), with Ctrl (zoom) or over a form field.
11565
+ *
11566
+ * @param {WheelEvent} evt - the wheel event of a fixed body area
11567
+ * @since 1.1.118
11568
+ */
11569
+ onFixedAreaWheel(e) {
11570
+ var l;
11571
+ if (e.defaultPrevented || e.ctrlKey)
11572
+ return;
11573
+ const t = e.target;
11574
+ if ((l = t == null ? void 0 : t.closest) != null && l.call(t, 'input, textarea, select, [contenteditable="true"]'))
11575
+ return;
11576
+ const s = this.scrollViewport, o = e.deltaMode === 1 ? 16 : e.deltaMode === 2 ? s.clientHeight : 1, i = s.scrollTop, r = s.scrollLeft;
11577
+ e.deltaY && (s.scrollTop = i + e.deltaY * o * this.getScrollerToContentRatioY()), e.deltaX && (s.scrollLeft = r + e.deltaX * o), (s.scrollTop !== i || s.scrollLeft !== r) && e.preventDefault();
11578
+ }
11550
11579
  adjustBody() {
11551
11580
  const e = this.areaBodyCenterGeo.height - this.getBodyContentHeight(), t = this.snapToDevicePixel(this.scrollFactorY * e);
11552
11581
  this.contentScrollTop = -t, this.adjustArea("body", t);
@@ -206,4 +206,11 @@ export declare class EleScope {
206
206
  * @returns {void} Returns nothing.
207
207
  */
208
208
  protected resetSizeOfWrapperDiv(): void;
209
+ /**
210
+ * The parent divs of the fixed body areas (west, east) – they lie above the scroll viewport, not inside it.
211
+ *
212
+ * @returns {HTMLDivElement[]} west and east body area
213
+ * @since 1.1.118
214
+ */
215
+ getFixedBodyAreaElements(): HTMLDivElement[];
209
216
  }
@@ -553,6 +553,15 @@ export declare class RenderScope extends EleScope {
553
553
  * @param {WheelEvent} evt - the wheel event of the scroll viewport
554
554
  */
555
555
  onWheel(evt: WheelEvent): void;
556
+ /**
557
+ * Mouse wheel over the FIXED body areas (west/east): they lie next to the scroll viewport, so the browser does not
558
+ * scroll anything there – pass the movement on to the viewport, like a wheel over the middle columns.
559
+ * Not consumed when the table cannot move further (the page scrolls), with Ctrl (zoom) or over a form field.
560
+ *
561
+ * @param {WheelEvent} evt - the wheel event of a fixed body area
562
+ * @since 1.1.118
563
+ */
564
+ onFixedAreaWheel(evt: WheelEvent): void;
556
565
  protected adjustBody(): void;
557
566
  /**
558
567
  * Returns a number value extracted from the specified attribute of the source element.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@guiexpert/table",
3
- "version": "1.1.117",
3
+ "version": "1.1.118",
4
4
  "license": "MIT",
5
5
  "author": "Dr. Marc Kronberg <info@gui.expert> (https://gui.expert)",
6
6
  "repository": {