@websy/websy-designs 1.10.0 → 1.10.1
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 +113 -93
- package/dist/websy-designs-es6.js +113 -84
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +113 -93
- package/dist/websy-designs.js +113 -84
- 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
|
@@ -3776,7 +3776,9 @@ class WebsyPDFButton {
|
|
|
3776
3776
|
classes: [],
|
|
3777
3777
|
wait: 0,
|
|
3778
3778
|
buttonText: 'Download',
|
|
3779
|
-
directDownload: false
|
|
3779
|
+
directDownload: false,
|
|
3780
|
+
preProcess: (callbackFn) => (callbackFn(true)),
|
|
3781
|
+
onError: () => {}
|
|
3780
3782
|
}
|
|
3781
3783
|
this.elementId = elementId
|
|
3782
3784
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
@@ -3834,87 +3836,95 @@ class WebsyPDFButton {
|
|
|
3834
3836
|
handleClick (event) {
|
|
3835
3837
|
if (event.target.classList.contains('websy-pdf-button')) {
|
|
3836
3838
|
this.loader.show()
|
|
3837
|
-
|
|
3838
|
-
if (
|
|
3839
|
-
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
if (this.options.header.elementId) {
|
|
3847
|
-
const headerEl = document.getElementById(this.options.header.elementId)
|
|
3848
|
-
if (headerEl) {
|
|
3849
|
-
pdfData.header = headerEl.outerHTML
|
|
3850
|
-
if (this.options.header.css) {
|
|
3851
|
-
pdfData.options.headerCSS = this.options.header.css
|
|
3852
|
-
}
|
|
3839
|
+
this.options.preProcess((proceed) => {
|
|
3840
|
+
if (proceed === true) {
|
|
3841
|
+
setTimeout(() => {
|
|
3842
|
+
if (this.options.targetId) {
|
|
3843
|
+
const el = document.getElementById(this.options.targetId)
|
|
3844
|
+
if (el) {
|
|
3845
|
+
const pdfData = { options: {} }
|
|
3846
|
+
if (this.options.pdfOptions) {
|
|
3847
|
+
pdfData.options = Object.assign({}, this.options.pdfOptions)
|
|
3853
3848
|
}
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3866
|
-
|
|
3867
|
-
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
|
|
3871
|
-
pdfData.
|
|
3849
|
+
if (this.options.header) {
|
|
3850
|
+
if (this.options.header.elementId) {
|
|
3851
|
+
const headerEl = document.getElementById(this.options.header.elementId)
|
|
3852
|
+
if (headerEl) {
|
|
3853
|
+
pdfData.header = headerEl.outerHTML
|
|
3854
|
+
if (this.options.header.css) {
|
|
3855
|
+
pdfData.options.headerCSS = this.options.header.css
|
|
3856
|
+
}
|
|
3857
|
+
}
|
|
3858
|
+
}
|
|
3859
|
+
else if (this.options.header.html) {
|
|
3860
|
+
pdfData.header = this.options.header.html
|
|
3861
|
+
if (this.options.header.css) {
|
|
3862
|
+
pdfData.options.headerCSS = this.options.header.css
|
|
3863
|
+
}
|
|
3864
|
+
}
|
|
3865
|
+
else {
|
|
3866
|
+
pdfData.header = this.options.header
|
|
3872
3867
|
}
|
|
3873
3868
|
}
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3886
|
-
|
|
3887
|
-
let msg = `
|
|
3888
|
-
<div class='text-center websy-pdf-download'>
|
|
3889
|
-
<div>Your file is ready to download</div>
|
|
3890
|
-
<a href='${URL.createObjectURL(blob)}' target='_blank'
|
|
3891
|
-
`
|
|
3892
|
-
if (this.options.directDownload === true) {
|
|
3893
|
-
let fileName
|
|
3894
|
-
if (typeof this.options.fileName === 'function') {
|
|
3895
|
-
fileName = this.options.fileName() || 'Export'
|
|
3869
|
+
if (this.options.footer) {
|
|
3870
|
+
if (this.options.footer.elementId) {
|
|
3871
|
+
const footerEl = document.getElementById(this.options.footer.elementId)
|
|
3872
|
+
if (footerEl) {
|
|
3873
|
+
pdfData.footer = footerEl.outerHTML
|
|
3874
|
+
if (this.options.footer.css) {
|
|
3875
|
+
pdfData.options.footerCSS = this.options.footer.css
|
|
3876
|
+
}
|
|
3877
|
+
}
|
|
3878
|
+
}
|
|
3879
|
+
else {
|
|
3880
|
+
pdfData.footer = this.options.footer
|
|
3881
|
+
}
|
|
3896
3882
|
}
|
|
3897
|
-
|
|
3898
|
-
|
|
3899
|
-
}
|
|
3900
|
-
|
|
3883
|
+
pdfData.html = el.outerHTML
|
|
3884
|
+
// document.getElementById(`${this.elementId}_pdfHeader`).value = pdfData.header
|
|
3885
|
+
// document.getElementById(`${this.elementId}_pdfHTML`).value = pdfData.html
|
|
3886
|
+
// document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
|
|
3887
|
+
// document.getElementById(`${this.elementId}_form`).submit()
|
|
3888
|
+
this.service.add('', pdfData, {responseType: 'blob'}).then(response => {
|
|
3889
|
+
this.loader.hide()
|
|
3890
|
+
const blob = new Blob([response], {type: 'application/pdf'})
|
|
3891
|
+
let msg = `
|
|
3892
|
+
<div class='text-center websy-pdf-download'>
|
|
3893
|
+
<div>Your file is ready to download</div>
|
|
3894
|
+
<a href='${URL.createObjectURL(blob)}' target='_blank'
|
|
3895
|
+
`
|
|
3896
|
+
if (this.options.directDownload === true) {
|
|
3897
|
+
let fileName
|
|
3898
|
+
if (typeof this.options.fileName === 'function') {
|
|
3899
|
+
fileName = this.options.fileName() || 'Export'
|
|
3900
|
+
}
|
|
3901
|
+
else {
|
|
3902
|
+
fileName = this.options.fileName || 'Export'
|
|
3903
|
+
}
|
|
3904
|
+
msg += `download='${fileName}.pdf'`
|
|
3905
|
+
}
|
|
3906
|
+
msg += `
|
|
3907
|
+
>
|
|
3908
|
+
<button class='websy-btn download-pdf'>${this.options.buttonText}</button>
|
|
3909
|
+
</a>
|
|
3910
|
+
</div>
|
|
3911
|
+
`
|
|
3912
|
+
this.popup.show({
|
|
3913
|
+
message: msg,
|
|
3914
|
+
mask: true
|
|
3915
|
+
})
|
|
3916
|
+
}, err => {
|
|
3917
|
+
console.error(err)
|
|
3918
|
+
})
|
|
3901
3919
|
}
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
|
|
3906
|
-
|
|
3907
|
-
|
|
3908
|
-
|
|
3909
|
-
|
|
3910
|
-
mask: true
|
|
3911
|
-
})
|
|
3912
|
-
}, err => {
|
|
3913
|
-
console.error(err)
|
|
3914
|
-
})
|
|
3915
|
-
}
|
|
3916
|
-
}
|
|
3917
|
-
}, this.options.wait)
|
|
3920
|
+
}
|
|
3921
|
+
}, this.options.wait)
|
|
3922
|
+
}
|
|
3923
|
+
else {
|
|
3924
|
+
this.loader.hide()
|
|
3925
|
+
this.options.onError()
|
|
3926
|
+
}
|
|
3927
|
+
})
|
|
3918
3928
|
}
|
|
3919
3929
|
else if (event.target.classList.contains('download-pdf')) {
|
|
3920
3930
|
this.popup.hide()
|
|
@@ -6868,6 +6878,7 @@ class WebsyTable3 {
|
|
|
6868
6878
|
autoFitColumns: true
|
|
6869
6879
|
}
|
|
6870
6880
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
6881
|
+
this._isRendered = false
|
|
6871
6882
|
this.isTouchDevice = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)
|
|
6872
6883
|
if (this.options.disableTouch === true) {
|
|
6873
6884
|
this.isTouchDevice = false
|
|
@@ -6962,6 +6973,9 @@ class WebsyTable3 {
|
|
|
6962
6973
|
console.error(`No element found with ID ${this.elementId}`)
|
|
6963
6974
|
}
|
|
6964
6975
|
}
|
|
6976
|
+
get isRendered () {
|
|
6977
|
+
return this._isRendered
|
|
6978
|
+
}
|
|
6965
6979
|
set columns (columns) {
|
|
6966
6980
|
this.options.columns = columns
|
|
6967
6981
|
this.renderColumnHeaders()
|
|
@@ -6971,6 +6985,7 @@ class WebsyTable3 {
|
|
|
6971
6985
|
this.renderTotals()
|
|
6972
6986
|
}
|
|
6973
6987
|
appendRows (data) {
|
|
6988
|
+
this._isRendered = false
|
|
6974
6989
|
this.hideError()
|
|
6975
6990
|
let bodyEl = document.getElementById(`${this.elementId}_tableBody`)
|
|
6976
6991
|
if (bodyEl) {
|
|
@@ -6984,6 +6999,7 @@ class WebsyTable3 {
|
|
|
6984
6999
|
}
|
|
6985
7000
|
else {
|
|
6986
7001
|
bodyEl.innerHTML += this.buildBodyHtml(data, true)
|
|
7002
|
+
this._isRendered = true
|
|
6987
7003
|
}
|
|
6988
7004
|
this.currentData = this.currentData.concat(data)
|
|
6989
7005
|
}
|
|
@@ -7985,10 +8001,12 @@ class WebsyChart {
|
|
|
7985
8001
|
maxBandWidth: 100,
|
|
7986
8002
|
allowUnevenBands: true,
|
|
7987
8003
|
allowBrushing: true,
|
|
7988
|
-
balancedMinMax: false
|
|
8004
|
+
balancedMinMax: false,
|
|
8005
|
+
onRendered: () => {}
|
|
7989
8006
|
}
|
|
7990
8007
|
this.elementId = elementId
|
|
7991
8008
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
8009
|
+
this._isRendered = false
|
|
7992
8010
|
this.leftAxis = null
|
|
7993
8011
|
this.rightAxis = null
|
|
7994
8012
|
this.topAxis = null
|
|
@@ -8027,21 +8045,6 @@ class WebsyChart {
|
|
|
8027
8045
|
}
|
|
8028
8046
|
}
|
|
8029
8047
|
}
|
|
8030
|
-
// }
|
|
8031
|
-
// else {
|
|
8032
|
-
// let domain = [...this[xAxis].domain()]
|
|
8033
|
-
// if (this.options.orientation === 'horizontal') {
|
|
8034
|
-
// domain = domain.reverse()
|
|
8035
|
-
// }
|
|
8036
|
-
// for (let j = 0; j < domain.length; j++) {
|
|
8037
|
-
// let breakA = this[xAxis](domain[j]) - (width / 2)
|
|
8038
|
-
// let breakB = breakA + width
|
|
8039
|
-
// if (input > breakA && input <= breakB) {
|
|
8040
|
-
// output = j
|
|
8041
|
-
// break
|
|
8042
|
-
// }
|
|
8043
|
-
// }
|
|
8044
|
-
// }
|
|
8045
8048
|
return output
|
|
8046
8049
|
}
|
|
8047
8050
|
let that = this
|
|
@@ -8128,6 +8131,9 @@ class WebsyChart {
|
|
|
8128
8131
|
this.options.data = d
|
|
8129
8132
|
this.render()
|
|
8130
8133
|
}
|
|
8134
|
+
get isRendered () {
|
|
8135
|
+
return this._isRendered
|
|
8136
|
+
}
|
|
8131
8137
|
close () {
|
|
8132
8138
|
this.leftAxisLayer && this.leftAxisLayer.selectAll('*').remove()
|
|
8133
8139
|
this.rightAxisLayer && this.rightAxisLayer.selectAll('*').remove()
|
|
@@ -8438,6 +8444,7 @@ this.render()
|
|
|
8438
8444
|
}
|
|
8439
8445
|
render (options) {
|
|
8440
8446
|
/* global d3 options WebsyUtils */
|
|
8447
|
+
this._isRendered = false
|
|
8441
8448
|
if (typeof options !== 'undefined') {
|
|
8442
8449
|
this.options = Object.assign({}, this.options, options)
|
|
8443
8450
|
if (this.options.legendOptions) {
|
|
@@ -9304,6 +9311,7 @@ this.refLineLayer.selectAll('.reference-line-label').remove()
|
|
|
9304
9311
|
if (this.options.refLines && this.options.refLines.length > 0) {
|
|
9305
9312
|
this.options.refLines.forEach(l => this.renderRefLine(l))
|
|
9306
9313
|
}
|
|
9314
|
+
this._isRendered = true
|
|
9307
9315
|
|
|
9308
9316
|
}
|
|
9309
9317
|
renderarea (series, index) {
|
|
@@ -10735,9 +10743,14 @@ class WebsyKPI {
|
|
|
10735
10743
|
}
|
|
10736
10744
|
this.elementId = elementId
|
|
10737
10745
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
10746
|
+
this._isRendered = false
|
|
10738
10747
|
this.render()
|
|
10739
10748
|
}
|
|
10749
|
+
get isRendered () {
|
|
10750
|
+
return this._isRendered
|
|
10751
|
+
}
|
|
10740
10752
|
render (options) {
|
|
10753
|
+
this._isRendered = false
|
|
10741
10754
|
this.options = Object.assign({}, this.options, options)
|
|
10742
10755
|
if (!this.options.label.classes) {
|
|
10743
10756
|
this.options.label.classes = []
|
|
@@ -10790,6 +10803,7 @@ class WebsyKPI {
|
|
|
10790
10803
|
</div>
|
|
10791
10804
|
`
|
|
10792
10805
|
el.innerHTML = html
|
|
10806
|
+
this._isRendered = true
|
|
10793
10807
|
}
|
|
10794
10808
|
}
|
|
10795
10809
|
}
|
|
@@ -10811,6 +10825,7 @@ class WebsyMap {
|
|
|
10811
10825
|
}
|
|
10812
10826
|
this.elementId = elementId
|
|
10813
10827
|
this.options = Object.assign({}, DEFAULTS, options)
|
|
10828
|
+
this._isRendered = false
|
|
10814
10829
|
if (!elementId) {
|
|
10815
10830
|
console.log('No element Id provided for Websy Map')
|
|
10816
10831
|
return
|
|
@@ -10842,6 +10857,9 @@ class WebsyMap {
|
|
|
10842
10857
|
this.render()
|
|
10843
10858
|
}
|
|
10844
10859
|
}
|
|
10860
|
+
get isRendered () {
|
|
10861
|
+
return this._isRendered
|
|
10862
|
+
}
|
|
10845
10863
|
handleClick (event) {
|
|
10846
10864
|
|
|
10847
10865
|
}
|
|
@@ -10849,6 +10867,7 @@ class WebsyMap {
|
|
|
10849
10867
|
|
|
10850
10868
|
}
|
|
10851
10869
|
render () {
|
|
10870
|
+
this._isRendered = false
|
|
10852
10871
|
const mapEl = document.getElementById(`${this.elementId}_map`)
|
|
10853
10872
|
const legendEl = document.getElementById(`${this.elementId}_map`)
|
|
10854
10873
|
if (this.options.showLegend === true && this.options.data.polygons) {
|
|
@@ -10980,6 +10999,7 @@ class WebsyMap {
|
|
|
10980
10999
|
else if (this.options.center) {
|
|
10981
11000
|
this.map.setView(this.options.center, this.options.zoom || null)
|
|
10982
11001
|
}
|
|
11002
|
+
this._isRendered = true
|
|
10983
11003
|
}
|
|
10984
11004
|
}
|
|
10985
11005
|
|
package/dist/websy-designs.js
CHANGED
|
@@ -3585,7 +3585,11 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
3585
3585
|
classes: [],
|
|
3586
3586
|
wait: 0,
|
|
3587
3587
|
buttonText: 'Download',
|
|
3588
|
-
directDownload: false
|
|
3588
|
+
directDownload: false,
|
|
3589
|
+
preProcess: function preProcess(callbackFn) {
|
|
3590
|
+
return callbackFn(true);
|
|
3591
|
+
},
|
|
3592
|
+
onError: function onError() {}
|
|
3589
3593
|
};
|
|
3590
3594
|
this.elementId = elementId;
|
|
3591
3595
|
this.options = _extends({}, DEFAULTS, options);
|
|
@@ -3616,80 +3620,87 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
3616
3620
|
var _this27 = this;
|
|
3617
3621
|
if (event.target.classList.contains('websy-pdf-button')) {
|
|
3618
3622
|
this.loader.show();
|
|
3619
|
-
|
|
3620
|
-
if (
|
|
3621
|
-
|
|
3622
|
-
|
|
3623
|
-
|
|
3624
|
-
|
|
3625
|
-
|
|
3626
|
-
|
|
3627
|
-
|
|
3628
|
-
|
|
3629
|
-
|
|
3630
|
-
if (_this27.options.header.elementId) {
|
|
3631
|
-
var headerEl = document.getElementById(_this27.options.header.elementId);
|
|
3632
|
-
if (headerEl) {
|
|
3633
|
-
pdfData.header = headerEl.outerHTML;
|
|
3634
|
-
if (_this27.options.header.css) {
|
|
3635
|
-
pdfData.options.headerCSS = _this27.options.header.css;
|
|
3636
|
-
}
|
|
3623
|
+
this.options.preProcess(function (proceed) {
|
|
3624
|
+
if (proceed === true) {
|
|
3625
|
+
setTimeout(function () {
|
|
3626
|
+
if (_this27.options.targetId) {
|
|
3627
|
+
var el = document.getElementById(_this27.options.targetId);
|
|
3628
|
+
if (el) {
|
|
3629
|
+
var pdfData = {
|
|
3630
|
+
options: {}
|
|
3631
|
+
};
|
|
3632
|
+
if (_this27.options.pdfOptions) {
|
|
3633
|
+
pdfData.options = _extends({}, _this27.options.pdfOptions);
|
|
3637
3634
|
}
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3635
|
+
if (_this27.options.header) {
|
|
3636
|
+
if (_this27.options.header.elementId) {
|
|
3637
|
+
var headerEl = document.getElementById(_this27.options.header.elementId);
|
|
3638
|
+
if (headerEl) {
|
|
3639
|
+
pdfData.header = headerEl.outerHTML;
|
|
3640
|
+
if (_this27.options.header.css) {
|
|
3641
|
+
pdfData.options.headerCSS = _this27.options.header.css;
|
|
3642
|
+
}
|
|
3643
|
+
}
|
|
3644
|
+
} else if (_this27.options.header.html) {
|
|
3645
|
+
pdfData.header = _this27.options.header.html;
|
|
3646
|
+
if (_this27.options.header.css) {
|
|
3647
|
+
pdfData.options.headerCSS = _this27.options.header.css;
|
|
3648
|
+
}
|
|
3649
|
+
} else {
|
|
3650
|
+
pdfData.header = _this27.options.header;
|
|
3651
|
+
}
|
|
3642
3652
|
}
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
pdfData.
|
|
3653
|
+
if (_this27.options.footer) {
|
|
3654
|
+
if (_this27.options.footer.elementId) {
|
|
3655
|
+
var footerEl = document.getElementById(_this27.options.footer.elementId);
|
|
3656
|
+
if (footerEl) {
|
|
3657
|
+
pdfData.footer = footerEl.outerHTML;
|
|
3658
|
+
if (_this27.options.footer.css) {
|
|
3659
|
+
pdfData.options.footerCSS = _this27.options.footer.css;
|
|
3660
|
+
}
|
|
3661
|
+
}
|
|
3662
|
+
} else {
|
|
3663
|
+
pdfData.footer = _this27.options.footer;
|
|
3654
3664
|
}
|
|
3655
3665
|
}
|
|
3656
|
-
|
|
3657
|
-
|
|
3666
|
+
pdfData.html = el.outerHTML;
|
|
3667
|
+
// document.getElementById(`${this.elementId}_pdfHeader`).value = pdfData.header
|
|
3668
|
+
// document.getElementById(`${this.elementId}_pdfHTML`).value = pdfData.html
|
|
3669
|
+
// document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
|
|
3670
|
+
// document.getElementById(`${this.elementId}_form`).submit()
|
|
3671
|
+
_this27.service.add('', pdfData, {
|
|
3672
|
+
responseType: 'blob'
|
|
3673
|
+
}).then(function (response) {
|
|
3674
|
+
_this27.loader.hide();
|
|
3675
|
+
var blob = new Blob([response], {
|
|
3676
|
+
type: 'application/pdf'
|
|
3677
|
+
});
|
|
3678
|
+
var msg = "\n <div class='text-center websy-pdf-download'>\n <div>Your file is ready to download</div>\n <a href='".concat(URL.createObjectURL(blob), "' target='_blank'\n ");
|
|
3679
|
+
if (_this27.options.directDownload === true) {
|
|
3680
|
+
var fileName;
|
|
3681
|
+
if (typeof _this27.options.fileName === 'function') {
|
|
3682
|
+
fileName = _this27.options.fileName() || 'Export';
|
|
3683
|
+
} else {
|
|
3684
|
+
fileName = _this27.options.fileName || 'Export';
|
|
3685
|
+
}
|
|
3686
|
+
msg += "download='".concat(fileName, ".pdf'");
|
|
3687
|
+
}
|
|
3688
|
+
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this27.options.buttonText, "</button>\n </a>\n </div>\n ");
|
|
3689
|
+
_this27.popup.show({
|
|
3690
|
+
message: msg,
|
|
3691
|
+
mask: true
|
|
3692
|
+
});
|
|
3693
|
+
}, function (err) {
|
|
3694
|
+
console.error(err);
|
|
3695
|
+
});
|
|
3658
3696
|
}
|
|
3659
3697
|
}
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
// document.getElementById(`${this.elementId}_form`).submit()
|
|
3665
|
-
_this27.service.add('', pdfData, {
|
|
3666
|
-
responseType: 'blob'
|
|
3667
|
-
}).then(function (response) {
|
|
3668
|
-
_this27.loader.hide();
|
|
3669
|
-
var blob = new Blob([response], {
|
|
3670
|
-
type: 'application/pdf'
|
|
3671
|
-
});
|
|
3672
|
-
var msg = "\n <div class='text-center websy-pdf-download'>\n <div>Your file is ready to download</div>\n <a href='".concat(URL.createObjectURL(blob), "' target='_blank'\n ");
|
|
3673
|
-
if (_this27.options.directDownload === true) {
|
|
3674
|
-
var fileName;
|
|
3675
|
-
if (typeof _this27.options.fileName === 'function') {
|
|
3676
|
-
fileName = _this27.options.fileName() || 'Export';
|
|
3677
|
-
} else {
|
|
3678
|
-
fileName = _this27.options.fileName || 'Export';
|
|
3679
|
-
}
|
|
3680
|
-
msg += "download='".concat(fileName, ".pdf'");
|
|
3681
|
-
}
|
|
3682
|
-
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this27.options.buttonText, "</button>\n </a>\n </div>\n ");
|
|
3683
|
-
_this27.popup.show({
|
|
3684
|
-
message: msg,
|
|
3685
|
-
mask: true
|
|
3686
|
-
});
|
|
3687
|
-
}, function (err) {
|
|
3688
|
-
console.error(err);
|
|
3689
|
-
});
|
|
3690
|
-
}
|
|
3698
|
+
}, _this27.options.wait);
|
|
3699
|
+
} else {
|
|
3700
|
+
_this27.loader.hide();
|
|
3701
|
+
_this27.options.onError();
|
|
3691
3702
|
}
|
|
3692
|
-
}
|
|
3703
|
+
});
|
|
3693
3704
|
} else if (event.target.classList.contains('download-pdf')) {
|
|
3694
3705
|
this.popup.hide();
|
|
3695
3706
|
if (this.options.onClose) {
|
|
@@ -6584,6 +6595,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6584
6595
|
autoFitColumns: true
|
|
6585
6596
|
};
|
|
6586
6597
|
this.options = _extends({}, DEFAULTS, options);
|
|
6598
|
+
this._isRendered = false;
|
|
6587
6599
|
this.isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
|
|
6588
6600
|
if (this.options.disableTouch === true) {
|
|
6589
6601
|
this.isTouchDevice = false;
|
|
@@ -6644,6 +6656,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6644
6656
|
}
|
|
6645
6657
|
}
|
|
6646
6658
|
_createClass(WebsyTable3, [{
|
|
6659
|
+
key: "isRendered",
|
|
6660
|
+
get: function get() {
|
|
6661
|
+
return this._isRendered;
|
|
6662
|
+
}
|
|
6663
|
+
}, {
|
|
6647
6664
|
key: "columns",
|
|
6648
6665
|
set: function set(columns) {
|
|
6649
6666
|
this.options.columns = columns;
|
|
@@ -6658,6 +6675,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6658
6675
|
}, {
|
|
6659
6676
|
key: "appendRows",
|
|
6660
6677
|
value: function appendRows(data) {
|
|
6678
|
+
this._isRendered = false;
|
|
6661
6679
|
this.hideError();
|
|
6662
6680
|
var bodyEl = document.getElementById("".concat(this.elementId, "_tableBody"));
|
|
6663
6681
|
if (bodyEl) {
|
|
@@ -6669,6 +6687,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6669
6687
|
bodyEl.querySelector('tbody').innerHTML += this.buildBodyHtml(data, true, true);
|
|
6670
6688
|
} else {
|
|
6671
6689
|
bodyEl.innerHTML += this.buildBodyHtml(data, true);
|
|
6690
|
+
this._isRendered = true;
|
|
6672
6691
|
}
|
|
6673
6692
|
this.currentData = this.currentData.concat(data);
|
|
6674
6693
|
}
|
|
@@ -7674,10 +7693,12 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7674
7693
|
maxBandWidth: 100,
|
|
7675
7694
|
allowUnevenBands: true,
|
|
7676
7695
|
allowBrushing: true,
|
|
7677
|
-
balancedMinMax: false
|
|
7696
|
+
balancedMinMax: false,
|
|
7697
|
+
onRendered: function onRendered() {}
|
|
7678
7698
|
};
|
|
7679
7699
|
this.elementId = elementId;
|
|
7680
7700
|
this.options = _extends({}, DEFAULTS, options);
|
|
7701
|
+
this._isRendered = false;
|
|
7681
7702
|
this.leftAxis = null;
|
|
7682
7703
|
this.rightAxis = null;
|
|
7683
7704
|
this.topAxis = null;
|
|
@@ -7716,21 +7737,6 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7716
7737
|
}
|
|
7717
7738
|
}
|
|
7718
7739
|
}
|
|
7719
|
-
// }
|
|
7720
|
-
// else {
|
|
7721
|
-
// let domain = [...this[xAxis].domain()]
|
|
7722
|
-
// if (this.options.orientation === 'horizontal') {
|
|
7723
|
-
// domain = domain.reverse()
|
|
7724
|
-
// }
|
|
7725
|
-
// for (let j = 0; j < domain.length; j++) {
|
|
7726
|
-
// let breakA = this[xAxis](domain[j]) - (width / 2)
|
|
7727
|
-
// let breakB = breakA + width
|
|
7728
|
-
// if (input > breakA && input <= breakB) {
|
|
7729
|
-
// output = j
|
|
7730
|
-
// break
|
|
7731
|
-
// }
|
|
7732
|
-
// }
|
|
7733
|
-
// }
|
|
7734
7740
|
return output;
|
|
7735
7741
|
};
|
|
7736
7742
|
var that = this;
|
|
@@ -7805,6 +7811,11 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7805
7811
|
this.options.data = d;
|
|
7806
7812
|
this.render();
|
|
7807
7813
|
}
|
|
7814
|
+
}, {
|
|
7815
|
+
key: "isRendered",
|
|
7816
|
+
get: function get() {
|
|
7817
|
+
return this._isRendered;
|
|
7818
|
+
}
|
|
7808
7819
|
}, {
|
|
7809
7820
|
key: "close",
|
|
7810
7821
|
value: function close() {
|
|
@@ -8110,6 +8121,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8110
8121
|
value: function render(options) {
|
|
8111
8122
|
var _this53 = this;
|
|
8112
8123
|
/* global d3 options WebsyUtils */
|
|
8124
|
+
this._isRendered = false;
|
|
8113
8125
|
if (typeof options !== 'undefined') {
|
|
8114
8126
|
this.options = _extends({}, this.options, options);
|
|
8115
8127
|
if (this.options.legendOptions) {
|
|
@@ -8850,6 +8862,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8850
8862
|
return _this54.renderRefLine(l);
|
|
8851
8863
|
});
|
|
8852
8864
|
}
|
|
8865
|
+
this._isRendered = true;
|
|
8853
8866
|
}
|
|
8854
8867
|
}, {
|
|
8855
8868
|
key: "renderarea",
|
|
@@ -10193,11 +10206,18 @@ var WebsyKPI = /*#__PURE__*/function () {
|
|
|
10193
10206
|
};
|
|
10194
10207
|
this.elementId = elementId;
|
|
10195
10208
|
this.options = _extends({}, DEFAULTS, options);
|
|
10209
|
+
this._isRendered = false;
|
|
10196
10210
|
this.render();
|
|
10197
10211
|
}
|
|
10198
10212
|
_createClass(WebsyKPI, [{
|
|
10213
|
+
key: "isRendered",
|
|
10214
|
+
get: function get() {
|
|
10215
|
+
return this._isRendered;
|
|
10216
|
+
}
|
|
10217
|
+
}, {
|
|
10199
10218
|
key: "render",
|
|
10200
10219
|
value: function render(options) {
|
|
10220
|
+
this._isRendered = false;
|
|
10201
10221
|
this.options = _extends({}, this.options, options);
|
|
10202
10222
|
if (!this.options.label.classes) {
|
|
10203
10223
|
this.options.label.classes = [];
|
|
@@ -10232,6 +10252,7 @@ var WebsyKPI = /*#__PURE__*/function () {
|
|
|
10232
10252
|
}
|
|
10233
10253
|
html += " \n </div>\n </div>\n ";
|
|
10234
10254
|
el.innerHTML = html;
|
|
10255
|
+
this._isRendered = true;
|
|
10235
10256
|
}
|
|
10236
10257
|
}
|
|
10237
10258
|
}]);
|
|
@@ -10255,6 +10276,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
10255
10276
|
};
|
|
10256
10277
|
this.elementId = elementId;
|
|
10257
10278
|
this.options = _extends({}, DEFAULTS, options);
|
|
10279
|
+
this._isRendered = false;
|
|
10258
10280
|
if (!elementId) {
|
|
10259
10281
|
console.log('No element Id provided for Websy Map');
|
|
10260
10282
|
return;
|
|
@@ -10284,6 +10306,11 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
10284
10306
|
}
|
|
10285
10307
|
}
|
|
10286
10308
|
_createClass(WebsyMap, [{
|
|
10309
|
+
key: "isRendered",
|
|
10310
|
+
get: function get() {
|
|
10311
|
+
return this._isRendered;
|
|
10312
|
+
}
|
|
10313
|
+
}, {
|
|
10287
10314
|
key: "handleClick",
|
|
10288
10315
|
value: function handleClick(event) {}
|
|
10289
10316
|
}, {
|
|
@@ -10293,6 +10320,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
10293
10320
|
key: "render",
|
|
10294
10321
|
value: function render() {
|
|
10295
10322
|
var _this61 = this;
|
|
10323
|
+
this._isRendered = false;
|
|
10296
10324
|
var mapEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
10297
10325
|
var legendEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
10298
10326
|
if (this.options.showLegend === true && this.options.data.polygons) {
|
|
@@ -10434,6 +10462,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
10434
10462
|
} else if (this.options.center) {
|
|
10435
10463
|
this.map.setView(this.options.center, this.options.zoom || null);
|
|
10436
10464
|
}
|
|
10465
|
+
this._isRendered = true;
|
|
10437
10466
|
}
|
|
10438
10467
|
}]);
|
|
10439
10468
|
return WebsyMap;
|