@websy/websy-designs 1.7.15 → 1.7.17

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.
@@ -7024,11 +7024,20 @@ class WebsyTable3 {
7024
7024
  event.preventDefault()
7025
7025
  // console.log('scrollwheel', event)
7026
7026
  if (Math.abs(event.deltaX) > Math.abs(event.deltaY)) {
7027
- this.scrollX(Math.max(-5, Math.min(5, event.deltaX)))
7027
+ this.scrollX(Math.max(-2, Math.min(2, event.deltaX)))
7028
7028
  }
7029
7029
  else {
7030
7030
  console.log('delta', event.deltaY)
7031
- this.scrollY(Math.max(-5, Math.min(5, event.deltaY)))
7031
+ // force the scroll to be a single row at a time
7032
+ const scrollHandleEl = document.getElementById(`${this.elementId}_vScrollHandle`)
7033
+ const scrollContainerEl = document.getElementById(`${this.elementId}_vScrollContainer`)
7034
+ let resolvedDelta = (scrollContainerEl.getBoundingClientRect().height - scrollHandleEl.getBoundingClientRect().height) / this.totalRowCount
7035
+ if (event.deltaY < 0) {
7036
+ resolvedDelta = resolvedDelta * -1
7037
+ }
7038
+ console.log('resolvedDelta', resolvedDelta)
7039
+ // this.scrollY(Math.max(-2, Math.min(2, event.deltaY)))
7040
+ this.scrollY(resolvedDelta)
7032
7041
  }
7033
7042
  }
7034
7043
  else if (this.options.onNativeScroll) {
@@ -7340,6 +7349,9 @@ class WebsyTable3 {
7340
7349
  }
7341
7350
  scrollY (diff) {
7342
7351
  const el = document.getElementById(`${this.elementId}_tableContainer`)
7352
+ if (this.vScrollRequired === false) {
7353
+ return
7354
+ }
7343
7355
  if (!el.classList.contains('scrolling')) {
7344
7356
  el.classList.add('scrolling')
7345
7357
  }
@@ -7349,9 +7361,10 @@ class WebsyTable3 {
7349
7361
  this.scrollTimeoutFn = setTimeout(() => {
7350
7362
  el.classList.remove('scrolling')
7351
7363
  }, 200)
7352
- if (this.vScrollRequired === false) {
7353
- return
7354
- }
7364
+ // if (this.vScrollRequired === false) {
7365
+ // return
7366
+ // }
7367
+ console.log('this.handleYStart', this.handleYStart)
7355
7368
  const scrollContainerEl = document.getElementById(`${this.elementId}_vScrollContainer`)
7356
7369
  const scrollHandleEl = document.getElementById(`${this.elementId}_vScrollHandle`)
7357
7370
  let handlePos
@@ -7360,7 +7373,7 @@ class WebsyTable3 {
7360
7373
  }
7361
7374
  else {
7362
7375
  // console.log('appending not resetting')
7363
- handlePos = scrollHandleEl.offsetTop + diff
7376
+ handlePos = +scrollHandleEl.style.top.replace('px', '') + diff
7364
7377
  }
7365
7378
  const scrollableSpace = scrollContainerEl.getBoundingClientRect().height - scrollHandleEl.getBoundingClientRect().height
7366
7379
  // console.log('dragging y', (diff), scrollContainerEl.getBoundingClientRect().height - scrollHandleEl.getBoundingClientRect().height)
@@ -8084,15 +8097,15 @@ else {
8084
8097
  // Check to see if we need to balance the min and max values
8085
8098
  if (this.options.balancedMinMax) {
8086
8099
  if (this.options.orientation === 'horizontal') {
8087
- let biggestBottom = Math.max(Math.abs(this.options.data.bottom.min, this.options.data.bottom.max))
8100
+ let biggestBottom = Math.max(Math.abs(this.options.data.bottom.min), this.options.data.bottom.max)
8088
8101
  this.options.data.bottom.min = 1 - biggestBottom
8089
8102
  this.options.data.bottom.max = biggestBottom
8090
8103
  }
8091
8104
  else {
8092
- let biggestLeft = Math.max(Math.abs(this.options.data.left.min, this.options.data.left.max))
8105
+ let biggestLeft = Math.max(Math.abs(this.options.data.left.min), this.options.data.left.max)
8093
8106
  this.options.data.left.min = 1 - biggestLeft
8094
8107
  this.options.data.left.max = biggestLeft
8095
- let biggestRight = Math.max(Math.abs(this.options.data.right.min, this.options.data.right.max))
8108
+ let biggestRight = Math.max(Math.abs(this.options.data.right.min), this.options.data.right.max)
8096
8109
  this.options.data.right.min = 1 - biggestRight
8097
8110
  this.options.data.right.max = biggestRight
8098
8111
  }
@@ -7700,10 +7700,21 @@ var WebsyTable3 = /*#__PURE__*/function () {
7700
7700
  event.preventDefault(); // console.log('scrollwheel', event)
7701
7701
 
7702
7702
  if (Math.abs(event.deltaX) > Math.abs(event.deltaY)) {
7703
- this.scrollX(Math.max(-5, Math.min(5, event.deltaX)));
7703
+ this.scrollX(Math.max(-2, Math.min(2, event.deltaX)));
7704
7704
  } else {
7705
- console.log('delta', event.deltaY);
7706
- this.scrollY(Math.max(-5, Math.min(5, event.deltaY)));
7705
+ console.log('delta', event.deltaY); // force the scroll to be a single row at a time
7706
+
7707
+ var scrollHandleEl = document.getElementById("".concat(this.elementId, "_vScrollHandle"));
7708
+ var scrollContainerEl = document.getElementById("".concat(this.elementId, "_vScrollContainer"));
7709
+ var resolvedDelta = (scrollContainerEl.getBoundingClientRect().height - scrollHandleEl.getBoundingClientRect().height) / this.totalRowCount;
7710
+
7711
+ if (event.deltaY < 0) {
7712
+ resolvedDelta = resolvedDelta * -1;
7713
+ }
7714
+
7715
+ console.log('resolvedDelta', resolvedDelta); // this.scrollY(Math.max(-2, Math.min(2, event.deltaY)))
7716
+
7717
+ this.scrollY(resolvedDelta);
7707
7718
  }
7708
7719
  } else if (this.options.onNativeScroll) {
7709
7720
  var el = document.getElementById("".concat(this.elementId, "_tableBody"));
@@ -8094,6 +8105,10 @@ var WebsyTable3 = /*#__PURE__*/function () {
8094
8105
  value: function scrollY(diff) {
8095
8106
  var el = document.getElementById("".concat(this.elementId, "_tableContainer"));
8096
8107
 
8108
+ if (this.vScrollRequired === false) {
8109
+ return;
8110
+ }
8111
+
8097
8112
  if (!el.classList.contains('scrolling')) {
8098
8113
  el.classList.add('scrolling');
8099
8114
  }
@@ -8104,12 +8119,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
8104
8119
 
8105
8120
  this.scrollTimeoutFn = setTimeout(function () {
8106
8121
  el.classList.remove('scrolling');
8107
- }, 200);
8108
-
8109
- if (this.vScrollRequired === false) {
8110
- return;
8111
- }
8122
+ }, 200); // if (this.vScrollRequired === false) {
8123
+ // return
8124
+ // }
8112
8125
 
8126
+ console.log('this.handleYStart', this.handleYStart);
8113
8127
  var scrollContainerEl = document.getElementById("".concat(this.elementId, "_vScrollContainer"));
8114
8128
  var scrollHandleEl = document.getElementById("".concat(this.elementId, "_vScrollHandle"));
8115
8129
  var handlePos;
@@ -8118,7 +8132,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
8118
8132
  handlePos = this.handleYStart + diff;
8119
8133
  } else {
8120
8134
  // console.log('appending not resetting')
8121
- handlePos = scrollHandleEl.offsetTop + diff;
8135
+ handlePos = +scrollHandleEl.style.top.replace('px', '') + diff;
8122
8136
  }
8123
8137
 
8124
8138
  var scrollableSpace = scrollContainerEl.getBoundingClientRect().height - scrollHandleEl.getBoundingClientRect().height; // console.log('dragging y', (diff), scrollContainerEl.getBoundingClientRect().height - scrollHandleEl.getBoundingClientRect().height)
@@ -8964,14 +8978,14 @@ var WebsyChart = /*#__PURE__*/function () {
8964
8978
 
8965
8979
  if (this.options.balancedMinMax) {
8966
8980
  if (this.options.orientation === 'horizontal') {
8967
- var biggestBottom = Math.max(Math.abs(this.options.data.bottom.min, this.options.data.bottom.max));
8981
+ var biggestBottom = Math.max(Math.abs(this.options.data.bottom.min), this.options.data.bottom.max);
8968
8982
  this.options.data.bottom.min = 1 - biggestBottom;
8969
8983
  this.options.data.bottom.max = biggestBottom;
8970
8984
  } else {
8971
- var biggestLeft = Math.max(Math.abs(this.options.data.left.min, this.options.data.left.max));
8985
+ var biggestLeft = Math.max(Math.abs(this.options.data.left.min), this.options.data.left.max);
8972
8986
  this.options.data.left.min = 1 - biggestLeft;
8973
8987
  this.options.data.left.max = biggestLeft;
8974
- var biggestRight = Math.max(Math.abs(this.options.data.right.min, this.options.data.right.max));
8988
+ var biggestRight = Math.max(Math.abs(this.options.data.right.min), this.options.data.right.max);
8975
8989
  this.options.data.right.min = 1 - biggestRight;
8976
8990
  this.options.data.right.max = biggestRight;
8977
8991
  }