@websy/websy-designs 1.10.0 → 1.10.2
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/routes/v1/api.js +13 -2
- package/dist/websy-designs-es6.debug.js +139 -100
- package/dist/websy-designs-es6.js +142 -90
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +139 -100
- package/dist/websy-designs.js +142 -90
- package/dist/websy-designs.min.css +1 -1
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
- package/dist/server/helpers/v1/puppeteer-report/examples/package-lock.json +0 -972
|
@@ -3,7 +3,7 @@ const router = express.Router()
|
|
|
3
3
|
// const PG = require('../helpers/dbHelper')
|
|
4
4
|
// const dbHelper = new PG()
|
|
5
5
|
|
|
6
|
-
function APIRoutes (dbHelper, authHelper) {
|
|
6
|
+
function APIRoutes (dbHelper, authHelper) {
|
|
7
7
|
router.delete('/:entity/:id', (req, res) => {
|
|
8
8
|
const sql = `DELETE FROM ${req.params.entity} WHERE ${dbHelper.buildWhereWithId(req.params.entity, req.params.id)}`
|
|
9
9
|
dbHelper.execute(sql).then(response => res.json(response), err => res.json(err))
|
|
@@ -12,6 +12,18 @@ function APIRoutes (dbHelper, authHelper) {
|
|
|
12
12
|
const sql = dbHelper.buildDelete(req.params.entity, req.query.where)
|
|
13
13
|
dbHelper.execute(sql).then(response => res.json(response), err => res.json(err))
|
|
14
14
|
})
|
|
15
|
+
router.get('/currentuser', (req, res) => {
|
|
16
|
+
let user = {}
|
|
17
|
+
if (req.session && req.session.user) {
|
|
18
|
+
user = req.session.user
|
|
19
|
+
}
|
|
20
|
+
if (process.env.SENSITIVE_USERPROPS) {
|
|
21
|
+
process.env.SENSITIVE_USERPROPS.split(',').forEach(d => {
|
|
22
|
+
delete user[d.trim()]
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
res.json(user)
|
|
26
|
+
})
|
|
15
27
|
router.get('/:entity/:id', (req, res) => {
|
|
16
28
|
let lang = process.env.DEFAULT_LANGUAGE
|
|
17
29
|
if (req.session && req.session.language && req.query.notranslate !== 'true') {
|
|
@@ -49,7 +61,6 @@ function APIRoutes (dbHelper, authHelper) {
|
|
|
49
61
|
user = req.session.user
|
|
50
62
|
}
|
|
51
63
|
const sql = dbHelper.buildUpsert(req.params.entity, req.body, user)
|
|
52
|
-
console.log('upsert sql', sql)
|
|
53
64
|
dbHelper.execute(sql).then(response => res.json(response), err => res.json(err))
|
|
54
65
|
})
|
|
55
66
|
router.post('/:entity', authHelper.checkPermissions, (req, res) => {
|
|
@@ -1559,6 +1559,7 @@ class WebsyDropdown {
|
|
|
1559
1559
|
closeAfterSelection: true,
|
|
1560
1560
|
customActions: [],
|
|
1561
1561
|
customButtons: [],
|
|
1562
|
+
minWidth: 220,
|
|
1562
1563
|
searchIcon: `<svg width="20" height="20" viewBox="0 0 512 512"><path d="M221.09,64A157.09,157.09,0,1,0,378.18,221.09,157.1,157.1,0,0,0,221.09,64Z" style="fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px"/><line x1="338.29" y1="338.29" x2="448" y2="448" style="fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px"/></svg>`,
|
|
1563
1564
|
clearIcon: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 512 512"><title>ionicons-v5-l</title><line x1="368" y1="368" x2="144" y2="144" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/><line x1="368" y1="144" x2="144" y2="368" style="fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px"/></svg>`,
|
|
1564
1565
|
arrowIcon: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M23.677 18.52c.914 1.523-.183 3.472-1.967 3.472h-19.414c-1.784 0-2.881-1.949-1.967-3.472l9.709-16.18c.891-1.483 3.041-1.48 3.93 0l9.709 16.18z"/></svg>`,
|
|
@@ -1585,7 +1586,7 @@ class WebsyDropdown {
|
|
|
1585
1586
|
el.addEventListener('click', this.handleClick.bind(this))
|
|
1586
1587
|
el.addEventListener('keyup', this.handleKeyUp.bind(this))
|
|
1587
1588
|
el.addEventListener('mouseout', this.handleMouseOut.bind(this))
|
|
1588
|
-
el.addEventListener('mousemove', this.handleMouseMove.bind(this))
|
|
1589
|
+
el.addEventListener('mousemove', this.handleMouseMove.bind(this))
|
|
1589
1590
|
const headerLabel = this.selectedItems.map(s => this.options.items[s].label || this.options.items[s].value).join(this.options.multiValueDelimiter)
|
|
1590
1591
|
const headerValue = this.selectedItems.map(s => this.options.items[s].value || this.options.items[s].label).join(this.options.multiValueDelimiter)
|
|
1591
1592
|
let html = `
|
|
@@ -1670,6 +1671,15 @@ class WebsyDropdown {
|
|
|
1670
1671
|
</div>
|
|
1671
1672
|
`
|
|
1672
1673
|
el.innerHTML = html
|
|
1674
|
+
const maskEl = document.getElementById(`${this.elementId}_mask`)
|
|
1675
|
+
if (maskEl) {
|
|
1676
|
+
maskEl.addEventListener('mousewheel', event => {
|
|
1677
|
+
if (event.target.classList.contains('websy-dropdown-mask')) {
|
|
1678
|
+
event.preventDefault()
|
|
1679
|
+
event.stopPropagation()
|
|
1680
|
+
}
|
|
1681
|
+
})
|
|
1682
|
+
}
|
|
1673
1683
|
const scrollEl = document.getElementById(`${this.elementId}_itemsContainer`)
|
|
1674
1684
|
if (scrollEl) {
|
|
1675
1685
|
scrollEl.addEventListener('scroll', this.handleScroll.bind(this))
|
|
@@ -1900,7 +1910,7 @@ class WebsyDropdown {
|
|
|
1900
1910
|
const contentPos = WebsyUtils.getElementPos(contentEl)
|
|
1901
1911
|
if (this.options.style === 'plain' && headerPos.width > 0 && headerPos.height > 0) {
|
|
1902
1912
|
contentEl.style.right = `calc(100vw - ${headerPos.right}px)`
|
|
1903
|
-
contentEl.style.width = `${headerEl.clientWidth}px`
|
|
1913
|
+
contentEl.style.width = `${Math.max(this.options.minWidth, headerEl.clientWidth)}px`
|
|
1904
1914
|
if (headerPos.bottom + contentPos.height > window.innerHeight) {
|
|
1905
1915
|
// contentEl.classList.add('on-top')
|
|
1906
1916
|
contentEl.style.bottom = `calc(100vh - ${headerPos.top}px)`
|
|
@@ -1912,7 +1922,7 @@ class WebsyDropdown {
|
|
|
1912
1922
|
else if (this.options.style === 'plain' && headerPos.width === 0 && headerPos.height === 0) {
|
|
1913
1923
|
const targetPos = WebsyUtils.getElementPos(event.target)
|
|
1914
1924
|
contentEl.style.right = `calc(100vw - ${targetPos.right}px)`
|
|
1915
|
-
contentEl.style.width = `${targetPos.width}px`
|
|
1925
|
+
contentEl.style.width = `${Math.max(this.options.minWidth, targetPos.width)}px`
|
|
1916
1926
|
}
|
|
1917
1927
|
if (this.options.disableSearch !== true) {
|
|
1918
1928
|
const searchEl = document.getElementById(`${this.elementId}_search`)
|
|
@@ -3508,7 +3518,9 @@ class WebsyPDFButton {
|
|
|
3508
3518
|
classes: [],
|
|
3509
3519
|
wait: 0,
|
|
3510
3520
|
buttonText: 'Download',
|
|
3511
|
-
directDownload: false
|
|
3521
|
+
directDownload: false,
|
|
3522
|
+
preProcess: (callbackFn) => (callbackFn(true)),
|
|
3523
|
+
onError: () => {}
|
|
3512
3524
|
}
|
|
3513
3525
|
this.elementId = elementId
|
|
3514
3526
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
@@ -3566,87 +3578,95 @@ class WebsyPDFButton {
|
|
|
3566
3578
|
handleClick (event) {
|
|
3567
3579
|
if (event.target.classList.contains('websy-pdf-button')) {
|
|
3568
3580
|
this.loader.show()
|
|
3569
|
-
|
|
3570
|
-
if (
|
|
3571
|
-
|
|
3572
|
-
|
|
3573
|
-
|
|
3574
|
-
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
|
|
3578
|
-
if (this.options.header.elementId) {
|
|
3579
|
-
const headerEl = document.getElementById(this.options.header.elementId)
|
|
3580
|
-
if (headerEl) {
|
|
3581
|
-
pdfData.header = headerEl.outerHTML
|
|
3582
|
-
if (this.options.header.css) {
|
|
3583
|
-
pdfData.options.headerCSS = this.options.header.css
|
|
3584
|
-
}
|
|
3581
|
+
this.options.preProcess((proceed) => {
|
|
3582
|
+
if (proceed === true) {
|
|
3583
|
+
setTimeout(() => {
|
|
3584
|
+
if (this.options.targetId) {
|
|
3585
|
+
const el = document.getElementById(this.options.targetId)
|
|
3586
|
+
if (el) {
|
|
3587
|
+
const pdfData = { options: {} }
|
|
3588
|
+
if (this.options.pdfOptions) {
|
|
3589
|
+
pdfData.options = Object.assign({}, this.options.pdfOptions)
|
|
3585
3590
|
}
|
|
3586
|
-
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
|
|
3596
|
-
|
|
3597
|
-
|
|
3598
|
-
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
pdfData.
|
|
3591
|
+
if (this.options.header) {
|
|
3592
|
+
if (this.options.header.elementId) {
|
|
3593
|
+
const headerEl = document.getElementById(this.options.header.elementId)
|
|
3594
|
+
if (headerEl) {
|
|
3595
|
+
pdfData.header = headerEl.outerHTML
|
|
3596
|
+
if (this.options.header.css) {
|
|
3597
|
+
pdfData.options.headerCSS = this.options.header.css
|
|
3598
|
+
}
|
|
3599
|
+
}
|
|
3600
|
+
}
|
|
3601
|
+
else if (this.options.header.html) {
|
|
3602
|
+
pdfData.header = this.options.header.html
|
|
3603
|
+
if (this.options.header.css) {
|
|
3604
|
+
pdfData.options.headerCSS = this.options.header.css
|
|
3605
|
+
}
|
|
3606
|
+
}
|
|
3607
|
+
else {
|
|
3608
|
+
pdfData.header = this.options.header
|
|
3604
3609
|
}
|
|
3605
3610
|
}
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3617
|
-
|
|
3618
|
-
|
|
3619
|
-
let msg = `
|
|
3620
|
-
<div class='text-center websy-pdf-download'>
|
|
3621
|
-
<div>Your file is ready to download</div>
|
|
3622
|
-
<a href='${URL.createObjectURL(blob)}' target='_blank'
|
|
3623
|
-
`
|
|
3624
|
-
if (this.options.directDownload === true) {
|
|
3625
|
-
let fileName
|
|
3626
|
-
if (typeof this.options.fileName === 'function') {
|
|
3627
|
-
fileName = this.options.fileName() || 'Export'
|
|
3611
|
+
if (this.options.footer) {
|
|
3612
|
+
if (this.options.footer.elementId) {
|
|
3613
|
+
const footerEl = document.getElementById(this.options.footer.elementId)
|
|
3614
|
+
if (footerEl) {
|
|
3615
|
+
pdfData.footer = footerEl.outerHTML
|
|
3616
|
+
if (this.options.footer.css) {
|
|
3617
|
+
pdfData.options.footerCSS = this.options.footer.css
|
|
3618
|
+
}
|
|
3619
|
+
}
|
|
3620
|
+
}
|
|
3621
|
+
else {
|
|
3622
|
+
pdfData.footer = this.options.footer
|
|
3623
|
+
}
|
|
3628
3624
|
}
|
|
3629
|
-
|
|
3630
|
-
|
|
3631
|
-
}
|
|
3632
|
-
|
|
3625
|
+
pdfData.html = el.outerHTML
|
|
3626
|
+
// document.getElementById(`${this.elementId}_pdfHeader`).value = pdfData.header
|
|
3627
|
+
// document.getElementById(`${this.elementId}_pdfHTML`).value = pdfData.html
|
|
3628
|
+
// document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
|
|
3629
|
+
// document.getElementById(`${this.elementId}_form`).submit()
|
|
3630
|
+
this.service.add('', pdfData, {responseType: 'blob'}).then(response => {
|
|
3631
|
+
this.loader.hide()
|
|
3632
|
+
const blob = new Blob([response], {type: 'application/pdf'})
|
|
3633
|
+
let msg = `
|
|
3634
|
+
<div class='text-center websy-pdf-download'>
|
|
3635
|
+
<div>Your file is ready to download</div>
|
|
3636
|
+
<a href='${URL.createObjectURL(blob)}' target='_blank'
|
|
3637
|
+
`
|
|
3638
|
+
if (this.options.directDownload === true) {
|
|
3639
|
+
let fileName
|
|
3640
|
+
if (typeof this.options.fileName === 'function') {
|
|
3641
|
+
fileName = this.options.fileName() || 'Export'
|
|
3642
|
+
}
|
|
3643
|
+
else {
|
|
3644
|
+
fileName = this.options.fileName || 'Export'
|
|
3645
|
+
}
|
|
3646
|
+
msg += `download='${fileName}.pdf'`
|
|
3647
|
+
}
|
|
3648
|
+
msg += `
|
|
3649
|
+
>
|
|
3650
|
+
<button class='websy-btn download-pdf'>${this.options.buttonText}</button>
|
|
3651
|
+
</a>
|
|
3652
|
+
</div>
|
|
3653
|
+
`
|
|
3654
|
+
this.popup.show({
|
|
3655
|
+
message: msg,
|
|
3656
|
+
mask: true
|
|
3657
|
+
})
|
|
3658
|
+
}, err => {
|
|
3659
|
+
console.error(err)
|
|
3660
|
+
})
|
|
3633
3661
|
}
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
mask: true
|
|
3643
|
-
})
|
|
3644
|
-
}, err => {
|
|
3645
|
-
console.error(err)
|
|
3646
|
-
})
|
|
3647
|
-
}
|
|
3648
|
-
}
|
|
3649
|
-
}, this.options.wait)
|
|
3662
|
+
}
|
|
3663
|
+
}, this.options.wait)
|
|
3664
|
+
}
|
|
3665
|
+
else {
|
|
3666
|
+
this.loader.hide()
|
|
3667
|
+
this.options.onError()
|
|
3668
|
+
}
|
|
3669
|
+
})
|
|
3650
3670
|
}
|
|
3651
3671
|
else if (event.target.classList.contains('download-pdf')) {
|
|
3652
3672
|
this.popup.hide()
|
|
@@ -5267,10 +5287,12 @@ const WebsyUtils = {
|
|
|
5267
5287
|
const scrollLeft = window.pageXOffset || document.documentElement.scrollLeft
|
|
5268
5288
|
const scrollTop = window.pageYOffset || document.documentElement.scrollTop
|
|
5269
5289
|
return {
|
|
5270
|
-
top: rect.top + scrollTop,
|
|
5271
|
-
left: rect.left + scrollLeft,
|
|
5272
|
-
bottom: rect.top + scrollTop + el.clientHeight,
|
|
5273
|
-
|
|
5290
|
+
top: rect.top, // + scrollTop,
|
|
5291
|
+
left: rect.left, // + scrollLeft,
|
|
5292
|
+
// bottom: rect.top + scrollTop + el.clientHeight,
|
|
5293
|
+
bottom: rect.top + el.clientHeight,
|
|
5294
|
+
// right: rect.left + scrollLeft + el.clientWidth,
|
|
5295
|
+
right: rect.left + el.clientWidth,
|
|
5274
5296
|
width: rect.width,
|
|
5275
5297
|
height: rect.height
|
|
5276
5298
|
}
|
|
@@ -5458,6 +5480,7 @@ class WebsyTable {
|
|
|
5458
5480
|
this.busy = false
|
|
5459
5481
|
this.tooltipTimeoutFn = null
|
|
5460
5482
|
this.data = []
|
|
5483
|
+
this._isRendered = false
|
|
5461
5484
|
const el = document.getElementById(this.elementId)
|
|
5462
5485
|
if (el) {
|
|
5463
5486
|
let html = `
|
|
@@ -5517,7 +5540,11 @@ class WebsyTable {
|
|
|
5517
5540
|
console.error(`No element found with ID ${this.elementId}`)
|
|
5518
5541
|
}
|
|
5519
5542
|
}
|
|
5543
|
+
get isRendered () {
|
|
5544
|
+
return this._isRendered
|
|
5545
|
+
}
|
|
5520
5546
|
appendRows (data) {
|
|
5547
|
+
this._isRendered = false
|
|
5521
5548
|
this.hideError()
|
|
5522
5549
|
let bodyHTML = ''
|
|
5523
5550
|
if (data) {
|
|
@@ -5594,6 +5621,7 @@ class WebsyTable {
|
|
|
5594
5621
|
}
|
|
5595
5622
|
const bodyEl = document.getElementById(`${this.elementId}_body`)
|
|
5596
5623
|
bodyEl.innerHTML += bodyHTML
|
|
5624
|
+
this._isRendered = true
|
|
5597
5625
|
}
|
|
5598
5626
|
buildSearchIcon (field) {
|
|
5599
5627
|
return `
|
|
@@ -5733,6 +5761,7 @@ class WebsyTable {
|
|
|
5733
5761
|
this.render(this.data)
|
|
5734
5762
|
}
|
|
5735
5763
|
render (data) {
|
|
5764
|
+
this._isRendered = false
|
|
5736
5765
|
if (!this.options.columns) {
|
|
5737
5766
|
return
|
|
5738
5767
|
}
|
|
@@ -6447,6 +6476,7 @@ class WebsyTable3 {
|
|
|
6447
6476
|
autoFitColumns: true
|
|
6448
6477
|
}
|
|
6449
6478
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
6479
|
+
this._isRendered = false
|
|
6450
6480
|
this.isTouchDevice = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)
|
|
6451
6481
|
if (this.options.disableTouch === true) {
|
|
6452
6482
|
this.isTouchDevice = false
|
|
@@ -6541,6 +6571,9 @@ class WebsyTable3 {
|
|
|
6541
6571
|
console.error(`No element found with ID ${this.elementId}`)
|
|
6542
6572
|
}
|
|
6543
6573
|
}
|
|
6574
|
+
get isRendered () {
|
|
6575
|
+
return this._isRendered
|
|
6576
|
+
}
|
|
6544
6577
|
set columns (columns) {
|
|
6545
6578
|
this.options.columns = columns
|
|
6546
6579
|
this.renderColumnHeaders()
|
|
@@ -6550,6 +6583,7 @@ class WebsyTable3 {
|
|
|
6550
6583
|
this.renderTotals()
|
|
6551
6584
|
}
|
|
6552
6585
|
appendRows (data) {
|
|
6586
|
+
this._isRendered = false
|
|
6553
6587
|
this.hideError()
|
|
6554
6588
|
let bodyEl = document.getElementById(`${this.elementId}_tableBody`)
|
|
6555
6589
|
if (bodyEl) {
|
|
@@ -6563,6 +6597,7 @@ class WebsyTable3 {
|
|
|
6563
6597
|
}
|
|
6564
6598
|
else {
|
|
6565
6599
|
bodyEl.innerHTML += this.buildBodyHtml(data, true)
|
|
6600
|
+
this._isRendered = true
|
|
6566
6601
|
}
|
|
6567
6602
|
this.currentData = this.currentData.concat(data)
|
|
6568
6603
|
}
|
|
@@ -7564,10 +7599,12 @@ class WebsyChart {
|
|
|
7564
7599
|
maxBandWidth: 100,
|
|
7565
7600
|
allowUnevenBands: true,
|
|
7566
7601
|
allowBrushing: true,
|
|
7567
|
-
balancedMinMax: false
|
|
7602
|
+
balancedMinMax: false,
|
|
7603
|
+
onRendered: () => {}
|
|
7568
7604
|
}
|
|
7569
7605
|
this.elementId = elementId
|
|
7570
7606
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
7607
|
+
this._isRendered = false
|
|
7571
7608
|
this.leftAxis = null
|
|
7572
7609
|
this.rightAxis = null
|
|
7573
7610
|
this.topAxis = null
|
|
@@ -7606,21 +7643,6 @@ class WebsyChart {
|
|
|
7606
7643
|
}
|
|
7607
7644
|
}
|
|
7608
7645
|
}
|
|
7609
|
-
// }
|
|
7610
|
-
// else {
|
|
7611
|
-
// let domain = [...this[xAxis].domain()]
|
|
7612
|
-
// if (this.options.orientation === 'horizontal') {
|
|
7613
|
-
// domain = domain.reverse()
|
|
7614
|
-
// }
|
|
7615
|
-
// for (let j = 0; j < domain.length; j++) {
|
|
7616
|
-
// let breakA = this[xAxis](domain[j]) - (width / 2)
|
|
7617
|
-
// let breakB = breakA + width
|
|
7618
|
-
// if (input > breakA && input <= breakB) {
|
|
7619
|
-
// output = j
|
|
7620
|
-
// break
|
|
7621
|
-
// }
|
|
7622
|
-
// }
|
|
7623
|
-
// }
|
|
7624
7646
|
return output
|
|
7625
7647
|
}
|
|
7626
7648
|
let that = this
|
|
@@ -7707,6 +7729,9 @@ class WebsyChart {
|
|
|
7707
7729
|
this.options.data = d
|
|
7708
7730
|
this.render()
|
|
7709
7731
|
}
|
|
7732
|
+
get isRendered () {
|
|
7733
|
+
return this._isRendered
|
|
7734
|
+
}
|
|
7710
7735
|
close () {
|
|
7711
7736
|
this.leftAxisLayer && this.leftAxisLayer.selectAll('*').remove()
|
|
7712
7737
|
this.rightAxisLayer && this.rightAxisLayer.selectAll('*').remove()
|
|
@@ -8017,6 +8042,7 @@ this.render()
|
|
|
8017
8042
|
}
|
|
8018
8043
|
render (options) {
|
|
8019
8044
|
/* global d3 options WebsyUtils */
|
|
8045
|
+
this._isRendered = false
|
|
8020
8046
|
if (typeof options !== 'undefined') {
|
|
8021
8047
|
this.options = Object.assign({}, this.options, options)
|
|
8022
8048
|
if (this.options.legendOptions) {
|
|
@@ -8883,6 +8909,7 @@ this.refLineLayer.selectAll('.reference-line-label').remove()
|
|
|
8883
8909
|
if (this.options.refLines && this.options.refLines.length > 0) {
|
|
8884
8910
|
this.options.refLines.forEach(l => this.renderRefLine(l))
|
|
8885
8911
|
}
|
|
8912
|
+
this._isRendered = true
|
|
8886
8913
|
|
|
8887
8914
|
}
|
|
8888
8915
|
renderarea (series, index) {
|
|
@@ -9886,9 +9913,14 @@ class WebsyKPI {
|
|
|
9886
9913
|
}
|
|
9887
9914
|
this.elementId = elementId
|
|
9888
9915
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
9916
|
+
this._isRendered = false
|
|
9889
9917
|
this.render()
|
|
9890
9918
|
}
|
|
9919
|
+
get isRendered () {
|
|
9920
|
+
return this._isRendered
|
|
9921
|
+
}
|
|
9891
9922
|
render (options) {
|
|
9923
|
+
this._isRendered = false
|
|
9892
9924
|
this.options = Object.assign({}, this.options, options)
|
|
9893
9925
|
if (!this.options.label.classes) {
|
|
9894
9926
|
this.options.label.classes = []
|
|
@@ -9941,6 +9973,7 @@ class WebsyKPI {
|
|
|
9941
9973
|
</div>
|
|
9942
9974
|
`
|
|
9943
9975
|
el.innerHTML = html
|
|
9976
|
+
this._isRendered = true
|
|
9944
9977
|
}
|
|
9945
9978
|
}
|
|
9946
9979
|
}
|
|
@@ -9962,6 +9995,7 @@ class WebsyMap {
|
|
|
9962
9995
|
}
|
|
9963
9996
|
this.elementId = elementId
|
|
9964
9997
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
9998
|
+
this._isRendered = false
|
|
9965
9999
|
if (!elementId) {
|
|
9966
10000
|
console.log('No element Id provided for Websy Map')
|
|
9967
10001
|
return
|
|
@@ -9993,6 +10027,9 @@ class WebsyMap {
|
|
|
9993
10027
|
this.render()
|
|
9994
10028
|
}
|
|
9995
10029
|
}
|
|
10030
|
+
get isRendered () {
|
|
10031
|
+
return this._isRendered
|
|
10032
|
+
}
|
|
9996
10033
|
handleClick (event) {
|
|
9997
10034
|
|
|
9998
10035
|
}
|
|
@@ -10000,6 +10037,7 @@ class WebsyMap {
|
|
|
10000
10037
|
|
|
10001
10038
|
}
|
|
10002
10039
|
render () {
|
|
10040
|
+
this._isRendered = false
|
|
10003
10041
|
const mapEl = document.getElementById(`${this.elementId}_map`)
|
|
10004
10042
|
const legendEl = document.getElementById(`${this.elementId}_map`)
|
|
10005
10043
|
if (this.options.showLegend === true && this.options.data.polygons) {
|
|
@@ -10131,6 +10169,7 @@ class WebsyMap {
|
|
|
10131
10169
|
else if (this.options.center) {
|
|
10132
10170
|
this.map.setView(this.options.center, this.options.zoom || null)
|
|
10133
10171
|
}
|
|
10172
|
+
this._isRendered = true
|
|
10134
10173
|
}
|
|
10135
10174
|
}
|
|
10136
10175
|
|