@websy/websy-designs 1.7.9 → 1.7.10
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/server/helpers/v1/authHelper.js +24 -0
- package/dist/server/routes/v1/api.js +2 -3
- package/dist/server/websy-designs-server.js +2 -1
- package/dist/websy-designs-es6.debug.js +43 -32
- package/dist/websy-designs-es6.js +40 -30
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +43 -32
- package/dist/websy-designs.js +40 -30
- package/dist/websy-designs.min.css +1 -1
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
|
@@ -131,6 +131,30 @@ class AuthHelper {
|
|
|
131
131
|
res.redirect('/login')
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
|
+
checkPermissions (req, res, next) {
|
|
135
|
+
console.log('hello')
|
|
136
|
+
const permissions = {
|
|
137
|
+
entities: {
|
|
138
|
+
POST: false,
|
|
139
|
+
PUT: true,
|
|
140
|
+
GET: true,
|
|
141
|
+
DELETE: true
|
|
142
|
+
},
|
|
143
|
+
item: {
|
|
144
|
+
POST: true,
|
|
145
|
+
PUT: true,
|
|
146
|
+
GET: true,
|
|
147
|
+
DELETE: true
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (permissions[req.params.entity] && permissions[req.params.entity][req.method] === true) {
|
|
151
|
+
next()
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
res.status(403)
|
|
155
|
+
res.json('User does not have permissions to ....')
|
|
156
|
+
}
|
|
157
|
+
}
|
|
134
158
|
}
|
|
135
159
|
|
|
136
160
|
module.exports = AuthHelper
|
|
@@ -2,9 +2,8 @@ const express = require('express')
|
|
|
2
2
|
const router = express.Router()
|
|
3
3
|
// const PG = require('../helpers/dbHelper')
|
|
4
4
|
// const dbHelper = new PG()
|
|
5
|
-
// const AuthHelper = require('../helpers/auth')
|
|
6
5
|
|
|
7
|
-
function APIRoutes (dbHelper) {
|
|
6
|
+
function APIRoutes (dbHelper, authHelper) {
|
|
8
7
|
router.delete('/:entity/:id', (req, res) => {
|
|
9
8
|
const sql = `DELETE FROM ${req.params.entity} WHERE ${dbHelper.buildWhereWithId(req.params.entity, req.params.id)}`
|
|
10
9
|
dbHelper.execute(sql).then(response => res.json(response), err => res.json(err))
|
|
@@ -44,7 +43,7 @@ function APIRoutes (dbHelper) {
|
|
|
44
43
|
}
|
|
45
44
|
}, err => res.json(err))
|
|
46
45
|
})
|
|
47
|
-
router.post('/:entity', (req, res) => {
|
|
46
|
+
router.post('/:entity', authHelper.checkPermissions, (req, res) => {
|
|
48
47
|
// const sql = dbHelper.buildInsert(req.params.entity, req.body, req.session.passport.user.id)
|
|
49
48
|
console.log(req.body)
|
|
50
49
|
const sql = dbHelper.buildInsert(req.params.entity, req.body)
|
|
@@ -26,6 +26,7 @@ module.exports = function (options) {
|
|
|
26
26
|
app.set('trust proxy', 1)
|
|
27
27
|
process.env.wdRoot = __dirname
|
|
28
28
|
let version = options.version || 'v1'
|
|
29
|
+
process.env.WD_VERSION = version
|
|
29
30
|
app.use(bodyParser.json({limit: '5mb'}))
|
|
30
31
|
app.use(bodyParser.urlencoded({limit: '5mb', extended: true}))
|
|
31
32
|
app.use(bodyParser.raw({limit: '5mb'}))
|
|
@@ -172,7 +173,7 @@ module.exports = function (options) {
|
|
|
172
173
|
}
|
|
173
174
|
app.use(protectedRoutes)
|
|
174
175
|
if (options.useAPI === true) {
|
|
175
|
-
app.use('/api', protectedRoutes, require(`./routes/${version}/api`)(dbHelper))
|
|
176
|
+
app.use('/api', protectedRoutes, require(`./routes/${version}/api`)(dbHelper, app.authHelper))
|
|
176
177
|
}
|
|
177
178
|
if (options.useShop === true) {
|
|
178
179
|
app.use('/shop', protectedRoutes, require(`./routes/${version}/shop`)(dbHelper, options.dbEngine, app))
|
|
@@ -6055,7 +6055,13 @@ class WebsyTable3 {
|
|
|
6055
6055
|
<div id="${this.elementId}_hScrollContainer" class="websy-h-scroll-container">
|
|
6056
6056
|
<div id="${this.elementId}_hScrollHandle" class="websy-scroll-handle websy-scroll-handle-x"></div>
|
|
6057
6057
|
</div>
|
|
6058
|
-
|
|
6058
|
+
`
|
|
6059
|
+
if (this.isTouchDevice === true) {
|
|
6060
|
+
html += `
|
|
6061
|
+
<div id="${this.elementId}_touchScroller" class="websy-table-touch-scroller"></div>
|
|
6062
|
+
`
|
|
6063
|
+
}
|
|
6064
|
+
html += `
|
|
6059
6065
|
</div>
|
|
6060
6066
|
<div id="${this.elementId}_errorContainer" class='websy-vis-error-container'>
|
|
6061
6067
|
<div>
|
|
@@ -6079,7 +6085,7 @@ class WebsyTable3 {
|
|
|
6079
6085
|
el.addEventListener('click', this.handleClick.bind(this))
|
|
6080
6086
|
el.addEventListener('mousedown', this.handleMouseDown.bind(this))
|
|
6081
6087
|
el.addEventListener('touchstart', this.handleTouchStart.bind(this))
|
|
6082
|
-
|
|
6088
|
+
el.addEventListener('touchmove', this.handleTouchMove.bind(this))
|
|
6083
6089
|
window.addEventListener('touchend', this.handleTouchEnd.bind(this))
|
|
6084
6090
|
window.addEventListener('mousemove', this.handleMouseMove.bind(this))
|
|
6085
6091
|
window.addEventListener('mouseup', this.handleMouseUp.bind(this))
|
|
@@ -6212,12 +6218,12 @@ class WebsyTable3 {
|
|
|
6212
6218
|
}
|
|
6213
6219
|
if (sizingColumns[sizeIndex].showAsLink === true && cell.value.trim() !== '') {
|
|
6214
6220
|
cell.value = `
|
|
6215
|
-
<a href=
|
|
6221
|
+
<a href="${cell.value}" target='${sizingColumns[sizeIndex].openInNewTab === true ? '_blank' : '_self'}'>${cell.displayText || sizingColumns[sizeIndex].linkText || cell.value}</a>
|
|
6216
6222
|
`
|
|
6217
6223
|
}
|
|
6218
6224
|
if (sizingColumns[sizeIndex].showAsRouterLink === true && cell.value.trim() !== '') {
|
|
6219
6225
|
cell.value = `
|
|
6220
|
-
<a data-view=
|
|
6226
|
+
<a data-view="${(cell.link || cell.value).replace(/'/g, '\'')}" class='websy-trigger'>${cell.value}</a>
|
|
6221
6227
|
`
|
|
6222
6228
|
}
|
|
6223
6229
|
if (sizingColumns[sizeIndex].showAsImage === true) {
|
|
@@ -6623,8 +6629,8 @@ class WebsyTable3 {
|
|
|
6623
6629
|
this.isPerpetual = true
|
|
6624
6630
|
// this.perpetualScroll()
|
|
6625
6631
|
this.touchStartTime = null
|
|
6626
|
-
const touchScrollEl = document.getElementById(`${this.elementId}_touchScroller`)
|
|
6627
|
-
touchScrollEl.classList.add('hidden')
|
|
6632
|
+
// const touchScrollEl = document.getElementById(`${this.elementId}_touchScroller`)
|
|
6633
|
+
// touchScrollEl.classList.add('hidden')
|
|
6628
6634
|
}
|
|
6629
6635
|
}
|
|
6630
6636
|
handleTouchMove (event) {
|
|
@@ -6635,6 +6641,12 @@ class WebsyTable3 {
|
|
|
6635
6641
|
if (typeof event.targetTouches !== 'undefined' && event.targetTouches.length > 0) {
|
|
6636
6642
|
let deltaX = (this.mouseXStart - event.targetTouches[0].pageX)
|
|
6637
6643
|
let deltaY = (this.mouseYStart - event.targetTouches[0].pageY)
|
|
6644
|
+
const hScrollContainerEl = document.getElementById(`${this.elementId}_hScrollContainer`)
|
|
6645
|
+
const vScrollContainerEl = document.getElementById(`${this.elementId}_vScrollContainer`)
|
|
6646
|
+
const hScrollHandleEl = document.getElementById(`${this.elementId}_hScrollHandle`)
|
|
6647
|
+
const vScrollHandleEl = document.getElementById(`${this.elementId}_vScrollHandle`)
|
|
6648
|
+
let translatedDeltaX = deltaX * (hScrollHandleEl.getBoundingClientRect().width / vScrollContainerEl.getBoundingClientRect().width)
|
|
6649
|
+
let translatedDeltaY = deltaY * (vScrollHandleEl.getBoundingClientRect().height / vScrollContainerEl.getBoundingClientRect().height)
|
|
6638
6650
|
// need to adjust the delta so that it scrolls at a reasonable speed/distance
|
|
6639
6651
|
const scrollHandleXEl = document.getElementById(`${this.elementId}_hScrollHandle`)
|
|
6640
6652
|
const scrollHandleYEl = document.getElementById(`${this.elementId}_vScrollHandle`)
|
|
@@ -6644,7 +6656,7 @@ class WebsyTable3 {
|
|
|
6644
6656
|
// else {
|
|
6645
6657
|
// this.isTouchScrolling = false
|
|
6646
6658
|
// }
|
|
6647
|
-
console.log('delta
|
|
6659
|
+
console.log('delta', this.mouseYStart, event.targetTouches[0].pageY, deltaY)
|
|
6648
6660
|
// deltaX = deltaX * (scrollHandleXEl.offsetWidth / this.sizes.scrollableWidth)
|
|
6649
6661
|
// deltaY = deltaY * (scrollHandleYEl.offsetHeight / this.sizes.bodyHeight)
|
|
6650
6662
|
// console.log('delta', deltaY)
|
|
@@ -6659,11 +6671,13 @@ class WebsyTable3 {
|
|
|
6659
6671
|
// delta = Math.max(-10, delta)
|
|
6660
6672
|
if (this.isTouchScrolling === true) {
|
|
6661
6673
|
// this.$scope.scrollTop += (delta / (this.$scope.layout.qHyperCube.qSize.qcy / this.$scope.rowsToLoad / (this.$scope.totalSpaceAvailable / 250)))
|
|
6662
|
-
if (Math.abs(deltaX) > Math.abs(deltaY) && deltaX >
|
|
6663
|
-
this.scrollX(Math.max(-5, Math.min(5,
|
|
6674
|
+
if (Math.abs(deltaX) > Math.abs(deltaY) && deltaX > 20) {
|
|
6675
|
+
// this.scrollX(Math.max(-5, Math.min(5, translatedDeltaX)))
|
|
6676
|
+
this.scrollX(translatedDeltaX)
|
|
6664
6677
|
}
|
|
6665
|
-
else {
|
|
6666
|
-
this.scrollY(Math.max(-5, Math.min(5,
|
|
6678
|
+
else if (deltaY > 20) {
|
|
6679
|
+
// this.scrollY(Math.max(-5, Math.min(5, translatedDeltaY)))
|
|
6680
|
+
this.scrollY(translatedDeltaY)
|
|
6667
6681
|
}
|
|
6668
6682
|
}
|
|
6669
6683
|
}
|
|
@@ -6683,8 +6697,8 @@ class WebsyTable3 {
|
|
|
6683
6697
|
this.isPerpetual = false
|
|
6684
6698
|
this.mouseYStart = event.targetTouches[0].pageY
|
|
6685
6699
|
this.mouseXStart = event.targetTouches[0].pageX
|
|
6686
|
-
const touchScrollEl = document.getElementById(`${this.elementId}_touchScroller`)
|
|
6687
|
-
touchScrollEl.classList.remove('hidden')
|
|
6700
|
+
// const touchScrollEl = document.getElementById(`${this.elementId}_touchScroller`)
|
|
6701
|
+
// touchScrollEl.classList.remove('hidden')
|
|
6688
6702
|
const handleYEl = document.getElementById(`${this.elementId}_vScrollHandle`)
|
|
6689
6703
|
this.handleYStart = handleYEl.offsetTop
|
|
6690
6704
|
const handleXEl = document.getElementById(`${this.elementId}_hScrollHandle`)
|
|
@@ -7528,14 +7542,14 @@ else {
|
|
|
7528
7542
|
this.options.data.bottom = { data: [] }
|
|
7529
7543
|
}
|
|
7530
7544
|
if (this.options.orientation === 'vertical') {
|
|
7531
|
-
this.leftAxisLayer.attr('class', 'y-axis')
|
|
7532
|
-
this.rightAxisLayer.attr('class', 'y-axis')
|
|
7533
|
-
this.bottomAxisLayer.attr('class', 'x-axis')
|
|
7545
|
+
this.leftAxisLayer && this.leftAxisLayer.attr('class', 'y-axis')
|
|
7546
|
+
this.rightAxisLayer && this.rightAxisLayer.attr('class', 'y-axis')
|
|
7547
|
+
this.bottomAxisLayer && this.bottomAxisLayer.attr('class', 'x-axis')
|
|
7534
7548
|
}
|
|
7535
7549
|
else {
|
|
7536
|
-
this.leftAxisLayer.attr('class', 'x-axis')
|
|
7537
|
-
this.rightAxisLayer.attr('class', 'x-axis')
|
|
7538
|
-
this.bottomAxisLayer.attr('class', 'y-axis')
|
|
7550
|
+
this.leftAxisLayer && this.leftAxisLayer.attr('class', 'x-axis')
|
|
7551
|
+
this.rightAxisLayer && this.rightAxisLayer.attr('class', 'x-axis')
|
|
7552
|
+
this.bottomAxisLayer && this.bottomAxisLayer.attr('class', 'y-axis')
|
|
7539
7553
|
}
|
|
7540
7554
|
const el = document.getElementById(this.elementId)
|
|
7541
7555
|
if (el) {
|
|
@@ -8675,8 +8689,7 @@ if (this.options.showLabels === true || series.showLabels === true) {
|
|
|
8675
8689
|
if (that.options.grouping === 'stacked' && series.labelPosition !== 'outside') {
|
|
8676
8690
|
this.setAttribute('text-anchor', 'middle')
|
|
8677
8691
|
}
|
|
8678
|
-
else if (that.plotWidth - getLabelX.call(that, d) < this.getComputedTextLength()) {
|
|
8679
|
-
console.log('anhor end for', d.y.value)
|
|
8692
|
+
else if (that.plotWidth - getLabelX.call(that, d) < this.getComputedTextLength()) {
|
|
8680
8693
|
this.setAttribute('text-anchor', 'end')
|
|
8681
8694
|
this.setAttribute('x', +(this.getAttribute('x')) - 8)
|
|
8682
8695
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color))
|
|
@@ -8686,8 +8699,7 @@ if (this.options.showLabels === true || series.showLabels === true) {
|
|
|
8686
8699
|
this.setAttribute('x', Math.max(+(this.getAttribute('x')) + 8, 8))
|
|
8687
8700
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color))
|
|
8688
8701
|
}
|
|
8689
|
-
else if (d.y.value < 0 && this.getAttribute('x') > 0) {
|
|
8690
|
-
console.log('anhor end for', d.y.value)
|
|
8702
|
+
else if (d.y.value < 0 && this.getAttribute('x') > 0) {
|
|
8691
8703
|
this.setAttribute('text-anchor', 'end')
|
|
8692
8704
|
this.setAttribute('x', +(this.getAttribute('x')) - 8)
|
|
8693
8705
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'))
|
|
@@ -8697,8 +8709,7 @@ if (this.options.showLabels === true || series.showLabels === true) {
|
|
|
8697
8709
|
this.setAttribute('x', +(this.getAttribute('x')) + 8)
|
|
8698
8710
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'))
|
|
8699
8711
|
}
|
|
8700
|
-
else {
|
|
8701
|
-
console.log('anhor end for', d.y.value)
|
|
8712
|
+
else {
|
|
8702
8713
|
this.setAttribute('text-anchor', 'start')
|
|
8703
8714
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'))
|
|
8704
8715
|
}
|
|
@@ -8736,16 +8747,16 @@ if (this.options.showLabels === true || series.showLabels === true) {
|
|
|
8736
8747
|
this.setAttribute('x', +(this.getAttribute('x')) - 8)
|
|
8737
8748
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color))
|
|
8738
8749
|
}
|
|
8739
|
-
else if (d.y.value < 0 &&
|
|
8740
|
-
this.setAttribute('text-anchor', 'end')
|
|
8741
|
-
this.setAttribute('x', +(this.getAttribute('x')) - 8)
|
|
8742
|
-
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'))
|
|
8743
|
-
}
|
|
8744
|
-
else if (d.y.value < 0 && d.y.value === that.options.data[yAxis].min) {
|
|
8750
|
+
else if (d.y.value < 0 && this.getAttribute('x') < 0) {
|
|
8745
8751
|
this.setAttribute('text-anchor', 'start')
|
|
8746
|
-
this.setAttribute('x', +(this.getAttribute('x')) + 8)
|
|
8752
|
+
this.setAttribute('x', Math.max(+(this.getAttribute('x')) + 8, 8))
|
|
8747
8753
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color))
|
|
8748
8754
|
}
|
|
8755
|
+
else if (d.y.value < 0 && this.getAttribute('x') > 0) {
|
|
8756
|
+
this.setAttribute('text-anchor', 'end')
|
|
8757
|
+
this.setAttribute('x', +(this.getAttribute('x')) - 8)
|
|
8758
|
+
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'))
|
|
8759
|
+
}
|
|
8749
8760
|
else if (series.labelPosition === 'outside') {
|
|
8750
8761
|
this.setAttribute('text-anchor', 'start')
|
|
8751
8762
|
this.setAttribute('x', +(this.getAttribute('x')) + 8)
|
|
@@ -6637,7 +6637,13 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6637
6637
|
var el = document.getElementById(this.elementId);
|
|
6638
6638
|
|
|
6639
6639
|
if (el) {
|
|
6640
|
-
var html = "\n <div id='".concat(this.elementId, "_tableContainer' class='websy-vis-table-3 ").concat(this.options.paging === 'pages' ? 'with-paging' : '', " ").concat(this.options.virtualScroll === true ? 'with-virtual-scroll' : '', "'>\n <!--<div class=\"download-button\">\n <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>\n </div>-->\n <div id=\"").concat(this.elementId, "_tableInner\" class=\"websy-table-inner-container\">\n <table id=\"").concat(this.elementId, "_tableHeader\" class=\"websy-table-header\"></table>\n <table id=\"").concat(this.elementId, "_tableBody\" class=\"websy-table-body\"></table>\n <table id=\"").concat(this.elementId, "_tableFooter\" class=\"websy-table-footer\"></table>\n <div id=\"").concat(this.elementId, "_vScrollContainer\" class=\"websy-v-scroll-container\">\n <div id=\"").concat(this.elementId, "_vScrollHandle\" class=\"websy-scroll-handle websy-scroll-handle-y\"></div>\n </div>\n <div id=\"").concat(this.elementId, "_hScrollContainer\" class=\"websy-h-scroll-container\">\n <div id=\"").concat(this.elementId, "_hScrollHandle\" class=\"websy-scroll-handle websy-scroll-handle-x\"></div>\n </div>\n
|
|
6640
|
+
var html = "\n <div id='".concat(this.elementId, "_tableContainer' class='websy-vis-table-3 ").concat(this.options.paging === 'pages' ? 'with-paging' : '', " ").concat(this.options.virtualScroll === true ? 'with-virtual-scroll' : '', "'>\n <!--<div class=\"download-button\">\n <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>\n </div>-->\n <div id=\"").concat(this.elementId, "_tableInner\" class=\"websy-table-inner-container\">\n <table id=\"").concat(this.elementId, "_tableHeader\" class=\"websy-table-header\"></table>\n <table id=\"").concat(this.elementId, "_tableBody\" class=\"websy-table-body\"></table>\n <table id=\"").concat(this.elementId, "_tableFooter\" class=\"websy-table-footer\"></table>\n <div id=\"").concat(this.elementId, "_vScrollContainer\" class=\"websy-v-scroll-container\">\n <div id=\"").concat(this.elementId, "_vScrollHandle\" class=\"websy-scroll-handle websy-scroll-handle-y\"></div>\n </div>\n <div id=\"").concat(this.elementId, "_hScrollContainer\" class=\"websy-h-scroll-container\">\n <div id=\"").concat(this.elementId, "_hScrollHandle\" class=\"websy-scroll-handle websy-scroll-handle-x\"></div>\n </div>\n ");
|
|
6641
|
+
|
|
6642
|
+
if (this.isTouchDevice === true) {
|
|
6643
|
+
html += "\n <div id=\"".concat(this.elementId, "_touchScroller\" class=\"websy-table-touch-scroller\"></div>\n ");
|
|
6644
|
+
}
|
|
6645
|
+
|
|
6646
|
+
html += " \n </div> \n <div id=\"".concat(this.elementId, "_errorContainer\" class='websy-vis-error-container'>\n <div>\n <div id=\"").concat(this.elementId, "_errorTitle\"></div>\n <div id=\"").concat(this.elementId, "_errorMessage\"></div>\n </div> \n </div>\n <div id=\"").concat(this.elementId, "_dropdownContainer\" class=\"table-dropdown-container\"></div>\n <div id=\"").concat(this.elementId, "_loadingContainer\"></div>\n </div>\n ");
|
|
6641
6647
|
|
|
6642
6648
|
if (this.options.paging === 'pages') {
|
|
6643
6649
|
html += "\n <div class=\"websy-table-paging-container\">\n Show <div id=\"".concat(this.elementId, "_pageSizeSelector\" class=\"websy-vis-page-selector\"></div> rows\n <ul id=\"").concat(this.elementId, "_pageList\" class=\"websy-vis-page-list\"></ul>\n </div>\n ");
|
|
@@ -6647,7 +6653,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6647
6653
|
el.addEventListener('click', this.handleClick.bind(this));
|
|
6648
6654
|
el.addEventListener('mousedown', this.handleMouseDown.bind(this));
|
|
6649
6655
|
el.addEventListener('touchstart', this.handleTouchStart.bind(this));
|
|
6650
|
-
|
|
6656
|
+
el.addEventListener('touchmove', this.handleTouchMove.bind(this));
|
|
6651
6657
|
window.addEventListener('touchend', this.handleTouchEnd.bind(this));
|
|
6652
6658
|
window.addEventListener('mousemove', this.handleMouseMove.bind(this));
|
|
6653
6659
|
window.addEventListener('mouseup', this.handleMouseUp.bind(this));
|
|
@@ -6774,11 +6780,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6774
6780
|
}
|
|
6775
6781
|
|
|
6776
6782
|
if (sizingColumns[sizeIndex].showAsLink === true && cell.value.trim() !== '') {
|
|
6777
|
-
cell.value = "\n <a href
|
|
6783
|
+
cell.value = "\n <a href=\"".concat(cell.value, "\" target='").concat(sizingColumns[sizeIndex].openInNewTab === true ? '_blank' : '_self', "'>").concat(cell.displayText || sizingColumns[sizeIndex].linkText || cell.value, "</a>\n ");
|
|
6778
6784
|
}
|
|
6779
6785
|
|
|
6780
6786
|
if (sizingColumns[sizeIndex].showAsRouterLink === true && cell.value.trim() !== '') {
|
|
6781
|
-
cell.value = "\n <a data-view
|
|
6787
|
+
cell.value = "\n <a data-view=\"".concat((cell.link || cell.value).replace(/'/g, '\''), "\" class='websy-trigger'>").concat(cell.value, "</a>\n ");
|
|
6782
6788
|
}
|
|
6783
6789
|
|
|
6784
6790
|
if (sizingColumns[sizeIndex].showAsImage === true) {
|
|
@@ -7233,9 +7239,8 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7233
7239
|
this.touchEndTime = new Date().getTime();
|
|
7234
7240
|
this.isPerpetual = true; // this.perpetualScroll()
|
|
7235
7241
|
|
|
7236
|
-
this.touchStartTime = null;
|
|
7237
|
-
|
|
7238
|
-
touchScrollEl.classList.add('hidden');
|
|
7242
|
+
this.touchStartTime = null; // const touchScrollEl = document.getElementById(`${this.elementId}_touchScroller`)
|
|
7243
|
+
// touchScrollEl.classList.add('hidden')
|
|
7239
7244
|
}
|
|
7240
7245
|
}
|
|
7241
7246
|
}, {
|
|
@@ -7249,7 +7254,13 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7249
7254
|
|
|
7250
7255
|
if (typeof event.targetTouches !== 'undefined' && event.targetTouches.length > 0) {
|
|
7251
7256
|
var deltaX = this.mouseXStart - event.targetTouches[0].pageX;
|
|
7252
|
-
var deltaY = this.mouseYStart - event.targetTouches[0].pageY;
|
|
7257
|
+
var deltaY = this.mouseYStart - event.targetTouches[0].pageY;
|
|
7258
|
+
var hScrollContainerEl = document.getElementById("".concat(this.elementId, "_hScrollContainer"));
|
|
7259
|
+
var vScrollContainerEl = document.getElementById("".concat(this.elementId, "_vScrollContainer"));
|
|
7260
|
+
var hScrollHandleEl = document.getElementById("".concat(this.elementId, "_hScrollHandle"));
|
|
7261
|
+
var vScrollHandleEl = document.getElementById("".concat(this.elementId, "_vScrollHandle"));
|
|
7262
|
+
var translatedDeltaX = deltaX * (hScrollHandleEl.getBoundingClientRect().width / vScrollContainerEl.getBoundingClientRect().width);
|
|
7263
|
+
var translatedDeltaY = deltaY * (vScrollHandleEl.getBoundingClientRect().height / vScrollContainerEl.getBoundingClientRect().height); // need to adjust the delta so that it scrolls at a reasonable speed/distance
|
|
7253
7264
|
|
|
7254
7265
|
var scrollHandleXEl = document.getElementById("".concat(this.elementId, "_hScrollHandle"));
|
|
7255
7266
|
var scrollHandleYEl = document.getElementById("".concat(this.elementId, "_vScrollHandle")); // if (Math.abs(deltaY) > this.sizes.cellHeight) {
|
|
@@ -7259,7 +7270,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7259
7270
|
// this.isTouchScrolling = false
|
|
7260
7271
|
// }
|
|
7261
7272
|
|
|
7262
|
-
console.log('delta
|
|
7273
|
+
console.log('delta', this.mouseYStart, event.targetTouches[0].pageY, deltaY); // deltaX = deltaX * (scrollHandleXEl.offsetWidth / this.sizes.scrollableWidth)
|
|
7263
7274
|
// deltaY = deltaY * (scrollHandleYEl.offsetHeight / this.sizes.bodyHeight)
|
|
7264
7275
|
// console.log('delta', deltaY)
|
|
7265
7276
|
// NW
|
|
@@ -7274,10 +7285,12 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7274
7285
|
|
|
7275
7286
|
if (this.isTouchScrolling === true) {
|
|
7276
7287
|
// this.$scope.scrollTop += (delta / (this.$scope.layout.qHyperCube.qSize.qcy / this.$scope.rowsToLoad / (this.$scope.totalSpaceAvailable / 250)))
|
|
7277
|
-
if (Math.abs(deltaX) > Math.abs(deltaY) && deltaX >
|
|
7278
|
-
this.scrollX(Math.max(-5, Math.min(5,
|
|
7279
|
-
|
|
7280
|
-
|
|
7288
|
+
if (Math.abs(deltaX) > Math.abs(deltaY) && deltaX > 20) {
|
|
7289
|
+
// this.scrollX(Math.max(-5, Math.min(5, translatedDeltaX)))
|
|
7290
|
+
this.scrollX(translatedDeltaX);
|
|
7291
|
+
} else if (deltaY > 20) {
|
|
7292
|
+
// this.scrollY(Math.max(-5, Math.min(5, translatedDeltaY)))
|
|
7293
|
+
this.scrollY(translatedDeltaY);
|
|
7281
7294
|
}
|
|
7282
7295
|
}
|
|
7283
7296
|
}
|
|
@@ -7301,9 +7314,9 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7301
7314
|
this.isTouchScrolling = true;
|
|
7302
7315
|
this.isPerpetual = false;
|
|
7303
7316
|
this.mouseYStart = event.targetTouches[0].pageY;
|
|
7304
|
-
this.mouseXStart = event.targetTouches[0].pageX;
|
|
7305
|
-
|
|
7306
|
-
|
|
7317
|
+
this.mouseXStart = event.targetTouches[0].pageX; // const touchScrollEl = document.getElementById(`${this.elementId}_touchScroller`)
|
|
7318
|
+
// touchScrollEl.classList.remove('hidden')
|
|
7319
|
+
|
|
7307
7320
|
var handleYEl = document.getElementById("".concat(this.elementId, "_vScrollHandle"));
|
|
7308
7321
|
this.handleYStart = handleYEl.offsetTop;
|
|
7309
7322
|
var handleXEl = document.getElementById("".concat(this.elementId, "_hScrollHandle"));
|
|
@@ -8310,13 +8323,13 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8310
8323
|
}
|
|
8311
8324
|
|
|
8312
8325
|
if (this.options.orientation === 'vertical') {
|
|
8313
|
-
this.leftAxisLayer.attr('class', 'y-axis');
|
|
8314
|
-
this.rightAxisLayer.attr('class', 'y-axis');
|
|
8315
|
-
this.bottomAxisLayer.attr('class', 'x-axis');
|
|
8326
|
+
this.leftAxisLayer && this.leftAxisLayer.attr('class', 'y-axis');
|
|
8327
|
+
this.rightAxisLayer && this.rightAxisLayer.attr('class', 'y-axis');
|
|
8328
|
+
this.bottomAxisLayer && this.bottomAxisLayer.attr('class', 'x-axis');
|
|
8316
8329
|
} else {
|
|
8317
|
-
this.leftAxisLayer.attr('class', 'x-axis');
|
|
8318
|
-
this.rightAxisLayer.attr('class', 'x-axis');
|
|
8319
|
-
this.bottomAxisLayer.attr('class', 'y-axis');
|
|
8330
|
+
this.leftAxisLayer && this.leftAxisLayer.attr('class', 'x-axis');
|
|
8331
|
+
this.rightAxisLayer && this.rightAxisLayer.attr('class', 'x-axis');
|
|
8332
|
+
this.bottomAxisLayer && this.bottomAxisLayer.attr('class', 'y-axis');
|
|
8320
8333
|
}
|
|
8321
8334
|
|
|
8322
8335
|
var el = document.getElementById(this.elementId);
|
|
@@ -9466,7 +9479,6 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
9466
9479
|
if (that.options.grouping === 'stacked' && series.labelPosition !== 'outside') {
|
|
9467
9480
|
this.setAttribute('text-anchor', 'middle');
|
|
9468
9481
|
} else if (that.plotWidth - getLabelX.call(that, d) < this.getComputedTextLength()) {
|
|
9469
|
-
console.log('anhor end for', d.y.value);
|
|
9470
9482
|
this.setAttribute('text-anchor', 'end');
|
|
9471
9483
|
this.setAttribute('x', +this.getAttribute('x') - 8);
|
|
9472
9484
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
|
|
@@ -9475,7 +9487,6 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
9475
9487
|
this.setAttribute('x', Math.max(+this.getAttribute('x') + 8, 8));
|
|
9476
9488
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
|
|
9477
9489
|
} else if (d.y.value < 0 && this.getAttribute('x') > 0) {
|
|
9478
|
-
console.log('anhor end for', d.y.value);
|
|
9479
9490
|
this.setAttribute('text-anchor', 'end');
|
|
9480
9491
|
this.setAttribute('x', +this.getAttribute('x') - 8);
|
|
9481
9492
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
|
|
@@ -9484,7 +9495,6 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
9484
9495
|
this.setAttribute('x', +this.getAttribute('x') + 8);
|
|
9485
9496
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
|
|
9486
9497
|
} else {
|
|
9487
|
-
console.log('anhor end for', d.y.value);
|
|
9488
9498
|
this.setAttribute('text-anchor', 'start');
|
|
9489
9499
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
|
|
9490
9500
|
}
|
|
@@ -9514,14 +9524,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
9514
9524
|
this.setAttribute('text-anchor', 'end');
|
|
9515
9525
|
this.setAttribute('x', +this.getAttribute('x') - 8);
|
|
9516
9526
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
|
|
9517
|
-
} else if (d.y.value < 0 &&
|
|
9527
|
+
} else if (d.y.value < 0 && this.getAttribute('x') < 0) {
|
|
9528
|
+
this.setAttribute('text-anchor', 'start');
|
|
9529
|
+
this.setAttribute('x', Math.max(+this.getAttribute('x') + 8, 8));
|
|
9530
|
+
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
|
|
9531
|
+
} else if (d.y.value < 0 && this.getAttribute('x') > 0) {
|
|
9518
9532
|
this.setAttribute('text-anchor', 'end');
|
|
9519
9533
|
this.setAttribute('x', +this.getAttribute('x') - 8);
|
|
9520
9534
|
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
|
|
9521
|
-
} else if (d.y.value < 0 && d.y.value === that.options.data[yAxis].min) {
|
|
9522
|
-
this.setAttribute('text-anchor', 'start');
|
|
9523
|
-
this.setAttribute('x', +this.getAttribute('x') + 8);
|
|
9524
|
-
this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
|
|
9525
9535
|
} else if (series.labelPosition === 'outside') {
|
|
9526
9536
|
this.setAttribute('text-anchor', 'start');
|
|
9527
9537
|
this.setAttribute('x', +this.getAttribute('x') + 8);
|