@websy/websy-designs 1.7.18 → 1.7.20
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/dist/websy-designs-es6.debug.js +152 -68
- package/dist/websy-designs-es6.js +166 -69
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +583 -68
- package/dist/websy-designs.js +632 -69
- package/dist/websy-designs.min.css +1 -1
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
|
@@ -1471,8 +1471,8 @@ class WebsyDragDrop {
|
|
|
1471
1471
|
el.innerHTML = html
|
|
1472
1472
|
this.options.items.forEach((item, i) => {
|
|
1473
1473
|
if (item.component) {
|
|
1474
|
-
if (item.isQlikPlugin && WebsyDesigns.
|
|
1475
|
-
item.instance = new WebsyDesigns.
|
|
1474
|
+
if (item.isQlikPlugin && WebsyDesigns.QlikPlugins[item.component]) {
|
|
1475
|
+
item.instance = new WebsyDesigns.QlikPlugins[item.component](`${item.id}_component`, item.options)
|
|
1476
1476
|
}
|
|
1477
1477
|
else if (WebsyDesigns[item.component]) {
|
|
1478
1478
|
item.instance = new WebsyDesigns[item.component](`${item.id}_component`, item.options)
|
|
@@ -4650,11 +4650,21 @@ class Switch {
|
|
|
4650
4650
|
}
|
|
4651
4651
|
disable () {
|
|
4652
4652
|
this.options.enabled = false
|
|
4653
|
-
this.
|
|
4653
|
+
let method = this.options.enabled === true ? 'add' : 'remove'
|
|
4654
|
+
const el = document.getElementById(`${this.elementId}_switch`)
|
|
4655
|
+
el.classList[method]('enabled')
|
|
4656
|
+
if (this.options.onToggle) {
|
|
4657
|
+
this.options.onToggle(this.options.enabled)
|
|
4658
|
+
}
|
|
4654
4659
|
}
|
|
4655
4660
|
enable () {
|
|
4656
4661
|
this.options.enabled = true
|
|
4657
|
-
this.
|
|
4662
|
+
let method = this.options.enabled === true ? 'add' : 'remove'
|
|
4663
|
+
const el = document.getElementById(`${this.elementId}_switch`)
|
|
4664
|
+
el.classList[method]('enabled')
|
|
4665
|
+
if (this.options.onToggle) {
|
|
4666
|
+
this.options.onToggle(this.options.enabled)
|
|
4667
|
+
}
|
|
4658
4668
|
}
|
|
4659
4669
|
handleClick (event) {
|
|
4660
4670
|
this.options.enabled = !this.options.enabled
|
|
@@ -6041,7 +6051,7 @@ class WebsyTable3 {
|
|
|
6041
6051
|
const el = document.getElementById(this.elementId)
|
|
6042
6052
|
if (el) {
|
|
6043
6053
|
let html = `
|
|
6044
|
-
<div id='${this.elementId}_tableContainer' class='websy-vis-table-3 ${this.options.paging === 'pages' ? 'with-paging' : ''} ${this.options.virtualScroll === true ? 'with-virtual-scroll' : ''}'>
|
|
6054
|
+
<div id='${this.elementId}_tableContainer' class='websy-vis-table-3 ${this.options.paging === 'pages' ? 'with-paging' : ''} ${this.options.virtualScroll === true ? 'with-virtual-scroll' : ''} ${this.isTouchDevice === true && this.options.virtualScroll === true ? 'touch-device' : ''}'>
|
|
6045
6055
|
<!--<div class="download-button">
|
|
6046
6056
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M16 11h5l-9 10-9-10h5v-11h8v11zm1 11h-10v2h10v-2z"/></svg>
|
|
6047
6057
|
</div>-->
|
|
@@ -6561,11 +6571,11 @@ class WebsyTable3 {
|
|
|
6561
6571
|
}
|
|
6562
6572
|
}
|
|
6563
6573
|
}
|
|
6564
|
-
handleMouseDown (event) {
|
|
6565
|
-
if (this.isTouchDevice
|
|
6574
|
+
handleMouseDown (event) {
|
|
6575
|
+
if (this.isTouchDevice) {
|
|
6566
6576
|
return
|
|
6567
6577
|
}
|
|
6568
|
-
if (event.target.classList.contains('websy-scroll-handle-y')) {
|
|
6578
|
+
if (event.target.classList.contains('websy-scroll-handle-y')) {
|
|
6569
6579
|
// set up the scroll start values
|
|
6570
6580
|
this.scrollDragging = true
|
|
6571
6581
|
this.scrollDirection = 'y'
|
|
@@ -6576,6 +6586,9 @@ class WebsyTable3 {
|
|
|
6576
6586
|
// console.log(scrollHandleEl.offsetTop)
|
|
6577
6587
|
}
|
|
6578
6588
|
else if (event.target.classList.contains('websy-scroll-handle-x')) {
|
|
6589
|
+
if (this.isTouchDevice) {
|
|
6590
|
+
event.preventDefault()
|
|
6591
|
+
}
|
|
6579
6592
|
this.scrollDragging = true
|
|
6580
6593
|
this.scrollDirection = 'x'
|
|
6581
6594
|
const scrollHandleEl = document.getElementById(`${this.elementId}_hScrollHandle`)
|
|
@@ -6583,9 +6596,12 @@ class WebsyTable3 {
|
|
|
6583
6596
|
this.mouseXStart = event.pageX
|
|
6584
6597
|
}
|
|
6585
6598
|
}
|
|
6586
|
-
handleMouseMove (event) {
|
|
6599
|
+
handleMouseMove (event) {
|
|
6587
6600
|
// event.preventDefault()
|
|
6588
6601
|
if (this.scrollDragging === true) {
|
|
6602
|
+
if (this.isTouchDevice) {
|
|
6603
|
+
event.preventDefault()
|
|
6604
|
+
}
|
|
6589
6605
|
if (this.scrollDirection === 'y') {
|
|
6590
6606
|
const diff = event.pageY - this.mouseYStart
|
|
6591
6607
|
this.scrollY(diff)
|
|
@@ -6609,11 +6625,24 @@ class WebsyTable3 {
|
|
|
6609
6625
|
event.preventDefault()
|
|
6610
6626
|
// console.log('scrollwheel', event)
|
|
6611
6627
|
if (Math.abs(event.deltaX) > Math.abs(event.deltaY)) {
|
|
6612
|
-
this.scrollX(Math.max(-2, Math.min(2, event.deltaX)))
|
|
6628
|
+
// this.scrollX(Math.max(-2, Math.min(2, event.deltaX)))
|
|
6629
|
+
if (this.hScrollRequired === false) {
|
|
6630
|
+
return
|
|
6631
|
+
}
|
|
6632
|
+
const scrollHandleEl = document.getElementById(`${this.elementId}_hScrollHandle`)
|
|
6633
|
+
const scrollContainerEl = document.getElementById(`${this.elementId}_hScrollContainer`)
|
|
6634
|
+
let resolvedDelta = (scrollContainerEl.getBoundingClientRect().width - scrollHandleEl.getBoundingClientRect().width) / this.totalColumnCount
|
|
6635
|
+
if (event.deltaX < 0) {
|
|
6636
|
+
resolvedDelta = resolvedDelta * -1
|
|
6637
|
+
}
|
|
6638
|
+
this.scrollX(resolvedDelta)
|
|
6613
6639
|
}
|
|
6614
6640
|
else {
|
|
6615
6641
|
// console.log('delta', event.deltaY)
|
|
6616
6642
|
// force the scroll to be a single row at a time
|
|
6643
|
+
if (this.vScrollRequired === false) {
|
|
6644
|
+
return
|
|
6645
|
+
}
|
|
6617
6646
|
const scrollHandleEl = document.getElementById(`${this.elementId}_vScrollHandle`)
|
|
6618
6647
|
const scrollContainerEl = document.getElementById(`${this.elementId}_vScrollContainer`)
|
|
6619
6648
|
let resolvedDelta = (scrollContainerEl.getBoundingClientRect().height - scrollHandleEl.getBoundingClientRect().height) / this.totalRowCount
|
|
@@ -6632,12 +6661,18 @@ class WebsyTable3 {
|
|
|
6632
6661
|
}
|
|
6633
6662
|
handleTouchEnd (event) {
|
|
6634
6663
|
// console.log('touch end fired')
|
|
6664
|
+
this.scrollDragging = false
|
|
6665
|
+
this.cellDragging = false
|
|
6666
|
+
this.handleYStart = null
|
|
6667
|
+
this.mouseYStart = null
|
|
6668
|
+
this.handleXStart = null
|
|
6669
|
+
this.mouseXStart = null
|
|
6635
6670
|
if (typeof event.targetTouches !== 'undefined') {
|
|
6636
6671
|
this.isTouchScrolling = false
|
|
6637
|
-
this.touchEndTime = (new Date()).getTime()
|
|
6638
|
-
this.isPerpetual = true
|
|
6672
|
+
// this.touchEndTime = (new Date()).getTime()
|
|
6673
|
+
// this.isPerpetual = true
|
|
6639
6674
|
// this.perpetualScroll()
|
|
6640
|
-
this.touchStartTime = null
|
|
6675
|
+
// this.touchStartTime = null
|
|
6641
6676
|
// const touchScrollEl = document.getElementById(`${this.elementId}_touchScroller`)
|
|
6642
6677
|
// touchScrollEl.classList.add('hidden')
|
|
6643
6678
|
}
|
|
@@ -6648,47 +6683,68 @@ class WebsyTable3 {
|
|
|
6648
6683
|
event.preventDefault()
|
|
6649
6684
|
event.stopPropagation()
|
|
6650
6685
|
if (typeof event.targetTouches !== 'undefined' && event.targetTouches.length > 0) {
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
//
|
|
6663
|
-
//
|
|
6664
|
-
// }
|
|
6665
|
-
//
|
|
6666
|
-
//
|
|
6667
|
-
//
|
|
6668
|
-
//
|
|
6669
|
-
//
|
|
6670
|
-
//
|
|
6671
|
-
//
|
|
6672
|
-
//
|
|
6673
|
-
//
|
|
6674
|
-
//
|
|
6675
|
-
//
|
|
6676
|
-
this.
|
|
6677
|
-
|
|
6678
|
-
//
|
|
6679
|
-
//
|
|
6680
|
-
//
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6686
|
+
event.deltaX = this.touchXStart - event.targetTouches[0].pageX
|
|
6687
|
+
event.deltaY = this.touchYStart - event.targetTouches[0].pageY
|
|
6688
|
+
if (Math.abs(event.deltaY) > 50) {
|
|
6689
|
+
event.deltaX = 0
|
|
6690
|
+
this.handleScrollWheel(event)
|
|
6691
|
+
}
|
|
6692
|
+
else if (Math.abs(event.deltaX) > 50) {
|
|
6693
|
+
event.deltaY = 0
|
|
6694
|
+
this.handleScrollWheel(event)
|
|
6695
|
+
}
|
|
6696
|
+
// let deltaX = (this.mouseXStart - event.targetTouches[0].pageX)
|
|
6697
|
+
// let deltaY = (this.mouseYStart - event.targetTouches[0].pageY)
|
|
6698
|
+
// const hScrollContainerEl = document.getElementById(`${this.elementId}_hScrollContainer`)
|
|
6699
|
+
// const vScrollContainerEl = document.getElementById(`${this.elementId}_vScrollContainer`)
|
|
6700
|
+
// const hScrollHandleEl = document.getElementById(`${this.elementId}_hScrollHandle`)
|
|
6701
|
+
// const vScrollHandleEl = document.getElementById(`${this.elementId}_vScrollHandle`)
|
|
6702
|
+
// let translatedDeltaX = deltaX * (hScrollHandleEl.getBoundingClientRect().width / vScrollContainerEl.getBoundingClientRect().width)
|
|
6703
|
+
// let translatedDeltaY = deltaY * (vScrollHandleEl.getBoundingClientRect().height / vScrollContainerEl.getBoundingClientRect().height)
|
|
6704
|
+
// // need to adjust the delta so that it scrolls at a reasonable speed/distance
|
|
6705
|
+
// const scrollHandleXEl = document.getElementById(`${this.elementId}_hScrollHandle`)
|
|
6706
|
+
// const scrollHandleYEl = document.getElementById(`${this.elementId}_vScrollHandle`)
|
|
6707
|
+
// // if (Math.abs(deltaY) > this.sizes.cellHeight) {
|
|
6708
|
+
// // this.isTouchScrolling = true
|
|
6709
|
+
// // }
|
|
6710
|
+
// // else {
|
|
6711
|
+
// // this.isTouchScrolling = false
|
|
6712
|
+
// // }
|
|
6713
|
+
// // console.log('delta', this.mouseYStart, event.targetTouches[0].pageY, deltaY)
|
|
6714
|
+
// // deltaX = deltaX * (scrollHandleXEl.offsetWidth / this.sizes.scrollableWidth)
|
|
6715
|
+
// // deltaY = deltaY * (scrollHandleYEl.offsetHeight / this.sizes.bodyHeight)
|
|
6716
|
+
// // console.log('delta', deltaY)
|
|
6717
|
+
// // NW
|
|
6718
|
+
// // else if (Math.abs(deltaX) > 50) {
|
|
6719
|
+
// // this.isTouchScrolling = false
|
|
6720
|
+
// // }
|
|
6721
|
+
// this.currentClientY = event.targetTouches[0].pageY
|
|
6722
|
+
// this.currentTouchtime = (new Date()).getTime()
|
|
6723
|
+
// // end
|
|
6724
|
+
// // delta = Math.min(10, delta)
|
|
6725
|
+
// // delta = Math.max(-10, delta)
|
|
6726
|
+
// if (this.isTouchScrolling === true) {
|
|
6727
|
+
// // this.$scope.scrollTop += (delta / (this.$scope.layout.qHyperCube.qSize.qcy / this.$scope.rowsToLoad / (this.$scope.totalSpaceAvailable / 250)))
|
|
6728
|
+
// if (Math.abs(deltaX) > Math.abs(deltaY) && deltaX > 20) {
|
|
6729
|
+
// // this.scrollX(Math.max(-5, Math.min(5, translatedDeltaX)))
|
|
6730
|
+
// this.scrollX(translatedDeltaX)
|
|
6731
|
+
// }
|
|
6732
|
+
// else if (deltaY > 20) {
|
|
6733
|
+
// // this.scrollY(Math.max(-5, Math.min(5, translatedDeltaY)))
|
|
6734
|
+
// this.scrollY(translatedDeltaY)
|
|
6735
|
+
// }
|
|
6736
|
+
// }
|
|
6737
|
+
}
|
|
6738
|
+
}
|
|
6739
|
+
if (this.scrollDragging === true) {
|
|
6740
|
+
event.preventDefault()
|
|
6741
|
+
if (this.scrollDirection === 'y') {
|
|
6742
|
+
const diff = event.targetTouches[0].pageY - this.mouseYStart
|
|
6743
|
+
this.scrollY(diff)
|
|
6744
|
+
}
|
|
6745
|
+
else if (this.scrollDirection === 'x') {
|
|
6746
|
+
const diff = event.targetTouches[0].pageX - this.mouseXStart
|
|
6747
|
+
this.scrollX(diff)
|
|
6692
6748
|
}
|
|
6693
6749
|
}
|
|
6694
6750
|
}
|
|
@@ -6700,19 +6756,42 @@ class WebsyTable3 {
|
|
|
6700
6756
|
return
|
|
6701
6757
|
}
|
|
6702
6758
|
// console.log(event.target.classList)
|
|
6703
|
-
if (
|
|
6704
|
-
this.
|
|
6705
|
-
|
|
6706
|
-
|
|
6759
|
+
if (event.target.classList.contains('websy-table-touch-scroller')) {
|
|
6760
|
+
if (this.options.virtualScroll === true) {
|
|
6761
|
+
// this.touchStartTime = (new Date()).getTime()
|
|
6762
|
+
this.isTouchScrolling = true
|
|
6763
|
+
// this.isPerpetual = false
|
|
6764
|
+
this.touchYStart = event.targetTouches[0].pageY
|
|
6765
|
+
this.touchXStart = event.targetTouches[0].pageX
|
|
6766
|
+
}
|
|
6767
|
+
}
|
|
6768
|
+
if (event.target.classList.contains('websy-scroll-handle-y')) {
|
|
6769
|
+
// set up the scroll start values
|
|
6770
|
+
this.scrollDragging = true
|
|
6771
|
+
this.scrollDirection = 'y'
|
|
6772
|
+
const scrollHandleEl = document.getElementById(`${this.elementId}_vScrollHandle`)
|
|
6773
|
+
this.handleYStart = scrollHandleEl.offsetTop
|
|
6707
6774
|
this.mouseYStart = event.targetTouches[0].pageY
|
|
6708
|
-
|
|
6709
|
-
//
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
this.
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6775
|
+
// console.log('mouse down', this.handleYStart, this.mouseYStart)
|
|
6776
|
+
// console.log(scrollHandleEl.offsetTop)
|
|
6777
|
+
}
|
|
6778
|
+
else if (event.target.classList.contains('websy-scroll-handle-x')) {
|
|
6779
|
+
if (this.isTouchDevice) {
|
|
6780
|
+
event.preventDefault()
|
|
6781
|
+
}
|
|
6782
|
+
this.scrollDragging = true
|
|
6783
|
+
this.scrollDirection = 'x'
|
|
6784
|
+
const scrollHandleEl = document.getElementById(`${this.elementId}_hScrollHandle`)
|
|
6785
|
+
this.handleXStart = scrollHandleEl.offsetLeft
|
|
6786
|
+
this.mouseXStart = event.targetTouches[0].pageX
|
|
6787
|
+
}
|
|
6788
|
+
// // const touchScrollEl = document.getElementById(`${this.elementId}_touchScroller`)
|
|
6789
|
+
// // touchScrollEl.classList.remove('hidden')
|
|
6790
|
+
// const handleYEl = document.getElementById(`${this.elementId}_vScrollHandle`)
|
|
6791
|
+
// this.handleYStart = handleYEl.offsetTop
|
|
6792
|
+
// const handleXEl = document.getElementById(`${this.elementId}_hScrollHandle`)
|
|
6793
|
+
// this.handleXStart = handleXEl.offsetLeft
|
|
6794
|
+
// }
|
|
6716
6795
|
}
|
|
6717
6796
|
hideError () {
|
|
6718
6797
|
const el = document.getElementById(`${this.elementId}_tableContainer`)
|
|
@@ -6821,7 +6900,7 @@ class WebsyTable3 {
|
|
|
6821
6900
|
let hHandleEl = document.getElementById(`${this.elementId}_hScrollHandle`)
|
|
6822
6901
|
if (this.hScrollRequired === true) {
|
|
6823
6902
|
hScrollEl.style.left = `${this.sizes.table.width - this.sizes.scrollableWidth}px`
|
|
6824
|
-
hScrollEl.style.width = `${this.sizes.scrollableWidth - 20}px`
|
|
6903
|
+
hScrollEl.style.width = `${this.sizes.scrollableWidth - (this.isTouchDevice ? 30 : 20)}px`
|
|
6825
6904
|
hHandleEl.style.width = Math.max(this.options.minHandleSize, this.sizes.scrollableWidth * (this.sizes.scrollableWidth / this.sizes.totalNonPinnedWidth)) + 'px'
|
|
6826
6905
|
}
|
|
6827
6906
|
else {
|
|
@@ -8659,7 +8738,12 @@ if (!this.brushBarsInitialized[series.key]) {
|
|
|
8659
8738
|
}
|
|
8660
8739
|
removebar (key) {
|
|
8661
8740
|
/* global key d3 */
|
|
8662
|
-
|
|
8741
|
+
this.barLayer.selectAll(`.bar_${key}`)
|
|
8742
|
+
.transition(this.transition)
|
|
8743
|
+
.style('fill-opacity', 1e-6)
|
|
8744
|
+
.remove()
|
|
8745
|
+
// remove from the brush as well
|
|
8746
|
+
this.brushArea.selectAll(`.bar_${key}`)
|
|
8663
8747
|
.transition(this.transition)
|
|
8664
8748
|
.style('fill-opacity', 1e-6)
|
|
8665
8749
|
.remove()
|