@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.
@@ -3508,7 +3508,9 @@ class WebsyPDFButton {
3508
3508
  classes: [],
3509
3509
  wait: 0,
3510
3510
  buttonText: 'Download',
3511
- directDownload: false
3511
+ directDownload: false,
3512
+ preProcess: (callbackFn) => (callbackFn(true)),
3513
+ onError: () => {}
3512
3514
  }
3513
3515
  this.elementId = elementId
3514
3516
  this.options = Object.assign({}, DEFAULTS, options)
@@ -3566,87 +3568,95 @@ class WebsyPDFButton {
3566
3568
  handleClick (event) {
3567
3569
  if (event.target.classList.contains('websy-pdf-button')) {
3568
3570
  this.loader.show()
3569
- setTimeout(() => {
3570
- if (this.options.targetId) {
3571
- const el = document.getElementById(this.options.targetId)
3572
- if (el) {
3573
- const pdfData = { options: {} }
3574
- if (this.options.pdfOptions) {
3575
- pdfData.options = Object.assign({}, this.options.pdfOptions)
3576
- }
3577
- if (this.options.header) {
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
- }
3571
+ this.options.preProcess((proceed) => {
3572
+ if (proceed === true) {
3573
+ setTimeout(() => {
3574
+ if (this.options.targetId) {
3575
+ const el = document.getElementById(this.options.targetId)
3576
+ if (el) {
3577
+ const pdfData = { options: {} }
3578
+ if (this.options.pdfOptions) {
3579
+ pdfData.options = Object.assign({}, this.options.pdfOptions)
3585
3580
  }
3586
- }
3587
- else if (this.options.header.html) {
3588
- pdfData.header = this.options.header.html
3589
- if (this.options.header.css) {
3590
- pdfData.options.headerCSS = this.options.header.css
3591
- }
3592
- }
3593
- else {
3594
- pdfData.header = this.options.header
3595
- }
3596
- }
3597
- if (this.options.footer) {
3598
- if (this.options.footer.elementId) {
3599
- const footerEl = document.getElementById(this.options.footer.elementId)
3600
- if (footerEl) {
3601
- pdfData.footer = footerEl.outerHTML
3602
- if (this.options.footer.css) {
3603
- pdfData.options.footerCSS = this.options.footer.css
3581
+ if (this.options.header) {
3582
+ if (this.options.header.elementId) {
3583
+ const headerEl = document.getElementById(this.options.header.elementId)
3584
+ if (headerEl) {
3585
+ pdfData.header = headerEl.outerHTML
3586
+ if (this.options.header.css) {
3587
+ pdfData.options.headerCSS = this.options.header.css
3588
+ }
3589
+ }
3590
+ }
3591
+ else if (this.options.header.html) {
3592
+ pdfData.header = this.options.header.html
3593
+ if (this.options.header.css) {
3594
+ pdfData.options.headerCSS = this.options.header.css
3595
+ }
3596
+ }
3597
+ else {
3598
+ pdfData.header = this.options.header
3604
3599
  }
3605
3600
  }
3606
- }
3607
- else {
3608
- pdfData.footer = this.options.footer
3609
- }
3610
- }
3611
- pdfData.html = el.outerHTML
3612
- // document.getElementById(`${this.elementId}_pdfHeader`).value = pdfData.header
3613
- // document.getElementById(`${this.elementId}_pdfHTML`).value = pdfData.html
3614
- // document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
3615
- // document.getElementById(`${this.elementId}_form`).submit()
3616
- this.service.add('', pdfData, {responseType: 'blob'}).then(response => {
3617
- this.loader.hide()
3618
- const blob = new Blob([response], {type: 'application/pdf'})
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'
3601
+ if (this.options.footer) {
3602
+ if (this.options.footer.elementId) {
3603
+ const footerEl = document.getElementById(this.options.footer.elementId)
3604
+ if (footerEl) {
3605
+ pdfData.footer = footerEl.outerHTML
3606
+ if (this.options.footer.css) {
3607
+ pdfData.options.footerCSS = this.options.footer.css
3608
+ }
3609
+ }
3610
+ }
3611
+ else {
3612
+ pdfData.footer = this.options.footer
3613
+ }
3628
3614
  }
3629
- else {
3630
- fileName = this.options.fileName || 'Export'
3631
- }
3632
- msg += `download='${fileName}.pdf'`
3615
+ pdfData.html = el.outerHTML
3616
+ // document.getElementById(`${this.elementId}_pdfHeader`).value = pdfData.header
3617
+ // document.getElementById(`${this.elementId}_pdfHTML`).value = pdfData.html
3618
+ // document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
3619
+ // document.getElementById(`${this.elementId}_form`).submit()
3620
+ this.service.add('', pdfData, {responseType: 'blob'}).then(response => {
3621
+ this.loader.hide()
3622
+ const blob = new Blob([response], {type: 'application/pdf'})
3623
+ let msg = `
3624
+ <div class='text-center websy-pdf-download'>
3625
+ <div>Your file is ready to download</div>
3626
+ <a href='${URL.createObjectURL(blob)}' target='_blank'
3627
+ `
3628
+ if (this.options.directDownload === true) {
3629
+ let fileName
3630
+ if (typeof this.options.fileName === 'function') {
3631
+ fileName = this.options.fileName() || 'Export'
3632
+ }
3633
+ else {
3634
+ fileName = this.options.fileName || 'Export'
3635
+ }
3636
+ msg += `download='${fileName}.pdf'`
3637
+ }
3638
+ msg += `
3639
+ >
3640
+ <button class='websy-btn download-pdf'>${this.options.buttonText}</button>
3641
+ </a>
3642
+ </div>
3643
+ `
3644
+ this.popup.show({
3645
+ message: msg,
3646
+ mask: true
3647
+ })
3648
+ }, err => {
3649
+ console.error(err)
3650
+ })
3633
3651
  }
3634
- msg += `
3635
- >
3636
- <button class='websy-btn download-pdf'>${this.options.buttonText}</button>
3637
- </a>
3638
- </div>
3639
- `
3640
- this.popup.show({
3641
- message: msg,
3642
- mask: true
3643
- })
3644
- }, err => {
3645
- console.error(err)
3646
- })
3647
- }
3648
- }
3649
- }, this.options.wait)
3652
+ }
3653
+ }, this.options.wait)
3654
+ }
3655
+ else {
3656
+ this.loader.hide()
3657
+ this.options.onError()
3658
+ }
3659
+ })
3650
3660
  }
3651
3661
  else if (event.target.classList.contains('download-pdf')) {
3652
3662
  this.popup.hide()
@@ -6447,6 +6457,7 @@ class WebsyTable3 {
6447
6457
  autoFitColumns: true
6448
6458
  }
6449
6459
  this.options = Object.assign({}, DEFAULTS, options)
6460
+ this._isRendered = false
6450
6461
  this.isTouchDevice = ('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0)
6451
6462
  if (this.options.disableTouch === true) {
6452
6463
  this.isTouchDevice = false
@@ -6541,6 +6552,9 @@ class WebsyTable3 {
6541
6552
  console.error(`No element found with ID ${this.elementId}`)
6542
6553
  }
6543
6554
  }
6555
+ get isRendered () {
6556
+ return this._isRendered
6557
+ }
6544
6558
  set columns (columns) {
6545
6559
  this.options.columns = columns
6546
6560
  this.renderColumnHeaders()
@@ -6550,6 +6564,7 @@ class WebsyTable3 {
6550
6564
  this.renderTotals()
6551
6565
  }
6552
6566
  appendRows (data) {
6567
+ this._isRendered = false
6553
6568
  this.hideError()
6554
6569
  let bodyEl = document.getElementById(`${this.elementId}_tableBody`)
6555
6570
  if (bodyEl) {
@@ -6563,6 +6578,7 @@ class WebsyTable3 {
6563
6578
  }
6564
6579
  else {
6565
6580
  bodyEl.innerHTML += this.buildBodyHtml(data, true)
6581
+ this._isRendered = true
6566
6582
  }
6567
6583
  this.currentData = this.currentData.concat(data)
6568
6584
  }
@@ -7564,10 +7580,12 @@ class WebsyChart {
7564
7580
  maxBandWidth: 100,
7565
7581
  allowUnevenBands: true,
7566
7582
  allowBrushing: true,
7567
- balancedMinMax: false
7583
+ balancedMinMax: false,
7584
+ onRendered: () => {}
7568
7585
  }
7569
7586
  this.elementId = elementId
7570
7587
  this.options = Object.assign({}, DEFAULTS, options)
7588
+ this._isRendered = false
7571
7589
  this.leftAxis = null
7572
7590
  this.rightAxis = null
7573
7591
  this.topAxis = null
@@ -7606,21 +7624,6 @@ class WebsyChart {
7606
7624
  }
7607
7625
  }
7608
7626
  }
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
7627
  return output
7625
7628
  }
7626
7629
  let that = this
@@ -7707,6 +7710,9 @@ class WebsyChart {
7707
7710
  this.options.data = d
7708
7711
  this.render()
7709
7712
  }
7713
+ get isRendered () {
7714
+ return this._isRendered
7715
+ }
7710
7716
  close () {
7711
7717
  this.leftAxisLayer && this.leftAxisLayer.selectAll('*').remove()
7712
7718
  this.rightAxisLayer && this.rightAxisLayer.selectAll('*').remove()
@@ -8017,6 +8023,7 @@ this.render()
8017
8023
  }
8018
8024
  render (options) {
8019
8025
  /* global d3 options WebsyUtils */
8026
+ this._isRendered = false
8020
8027
  if (typeof options !== 'undefined') {
8021
8028
  this.options = Object.assign({}, this.options, options)
8022
8029
  if (this.options.legendOptions) {
@@ -8883,6 +8890,7 @@ this.refLineLayer.selectAll('.reference-line-label').remove()
8883
8890
  if (this.options.refLines && this.options.refLines.length > 0) {
8884
8891
  this.options.refLines.forEach(l => this.renderRefLine(l))
8885
8892
  }
8893
+ this._isRendered = true
8886
8894
 
8887
8895
  }
8888
8896
  renderarea (series, index) {
@@ -9886,9 +9894,14 @@ class WebsyKPI {
9886
9894
  }
9887
9895
  this.elementId = elementId
9888
9896
  this.options = Object.assign({}, DEFAULTS, options)
9897
+ this._isRendered = false
9889
9898
  this.render()
9890
9899
  }
9900
+ get isRendered () {
9901
+ return this._isRendered
9902
+ }
9891
9903
  render (options) {
9904
+ this._isRendered = false
9892
9905
  this.options = Object.assign({}, this.options, options)
9893
9906
  if (!this.options.label.classes) {
9894
9907
  this.options.label.classes = []
@@ -9941,6 +9954,7 @@ class WebsyKPI {
9941
9954
  </div>
9942
9955
  `
9943
9956
  el.innerHTML = html
9957
+ this._isRendered = true
9944
9958
  }
9945
9959
  }
9946
9960
  }
@@ -9962,6 +9976,7 @@ class WebsyMap {
9962
9976
  }
9963
9977
  this.elementId = elementId
9964
9978
  this.options = Object.assign({}, DEFAULTS, options)
9979
+ this._isRendered = false
9965
9980
  if (!elementId) {
9966
9981
  console.log('No element Id provided for Websy Map')
9967
9982
  return
@@ -9993,6 +10008,9 @@ class WebsyMap {
9993
10008
  this.render()
9994
10009
  }
9995
10010
  }
10011
+ get isRendered () {
10012
+ return this._isRendered
10013
+ }
9996
10014
  handleClick (event) {
9997
10015
 
9998
10016
  }
@@ -10000,6 +10018,7 @@ class WebsyMap {
10000
10018
 
10001
10019
  }
10002
10020
  render () {
10021
+ this._isRendered = false
10003
10022
  const mapEl = document.getElementById(`${this.elementId}_map`)
10004
10023
  const legendEl = document.getElementById(`${this.elementId}_map`)
10005
10024
  if (this.options.showLegend === true && this.options.data.polygons) {
@@ -10131,6 +10150,7 @@ class WebsyMap {
10131
10150
  else if (this.options.center) {
10132
10151
  this.map.setView(this.options.center, this.options.zoom || null)
10133
10152
  }
10153
+ this._isRendered = true
10134
10154
  }
10135
10155
  }
10136
10156
 
@@ -3344,7 +3344,11 @@ var WebsyPDFButton = /*#__PURE__*/function () {
3344
3344
  classes: [],
3345
3345
  wait: 0,
3346
3346
  buttonText: 'Download',
3347
- directDownload: false
3347
+ directDownload: false,
3348
+ preProcess: function preProcess(callbackFn) {
3349
+ return callbackFn(true);
3350
+ },
3351
+ onError: function onError() {}
3348
3352
  };
3349
3353
  this.elementId = elementId;
3350
3354
  this.options = _extends({}, DEFAULTS, options);
@@ -3375,80 +3379,87 @@ var WebsyPDFButton = /*#__PURE__*/function () {
3375
3379
  var _this25 = this;
3376
3380
  if (event.target.classList.contains('websy-pdf-button')) {
3377
3381
  this.loader.show();
3378
- setTimeout(function () {
3379
- if (_this25.options.targetId) {
3380
- var el = document.getElementById(_this25.options.targetId);
3381
- if (el) {
3382
- var pdfData = {
3383
- options: {}
3384
- };
3385
- if (_this25.options.pdfOptions) {
3386
- pdfData.options = _extends({}, _this25.options.pdfOptions);
3387
- }
3388
- if (_this25.options.header) {
3389
- if (_this25.options.header.elementId) {
3390
- var headerEl = document.getElementById(_this25.options.header.elementId);
3391
- if (headerEl) {
3392
- pdfData.header = headerEl.outerHTML;
3393
- if (_this25.options.header.css) {
3394
- pdfData.options.headerCSS = _this25.options.header.css;
3395
- }
3382
+ this.options.preProcess(function (proceed) {
3383
+ if (proceed === true) {
3384
+ setTimeout(function () {
3385
+ if (_this25.options.targetId) {
3386
+ var el = document.getElementById(_this25.options.targetId);
3387
+ if (el) {
3388
+ var pdfData = {
3389
+ options: {}
3390
+ };
3391
+ if (_this25.options.pdfOptions) {
3392
+ pdfData.options = _extends({}, _this25.options.pdfOptions);
3396
3393
  }
3397
- } else if (_this25.options.header.html) {
3398
- pdfData.header = _this25.options.header.html;
3399
- if (_this25.options.header.css) {
3400
- pdfData.options.headerCSS = _this25.options.header.css;
3394
+ if (_this25.options.header) {
3395
+ if (_this25.options.header.elementId) {
3396
+ var headerEl = document.getElementById(_this25.options.header.elementId);
3397
+ if (headerEl) {
3398
+ pdfData.header = headerEl.outerHTML;
3399
+ if (_this25.options.header.css) {
3400
+ pdfData.options.headerCSS = _this25.options.header.css;
3401
+ }
3402
+ }
3403
+ } else if (_this25.options.header.html) {
3404
+ pdfData.header = _this25.options.header.html;
3405
+ if (_this25.options.header.css) {
3406
+ pdfData.options.headerCSS = _this25.options.header.css;
3407
+ }
3408
+ } else {
3409
+ pdfData.header = _this25.options.header;
3410
+ }
3401
3411
  }
3402
- } else {
3403
- pdfData.header = _this25.options.header;
3404
- }
3405
- }
3406
- if (_this25.options.footer) {
3407
- if (_this25.options.footer.elementId) {
3408
- var footerEl = document.getElementById(_this25.options.footer.elementId);
3409
- if (footerEl) {
3410
- pdfData.footer = footerEl.outerHTML;
3411
- if (_this25.options.footer.css) {
3412
- pdfData.options.footerCSS = _this25.options.footer.css;
3412
+ if (_this25.options.footer) {
3413
+ if (_this25.options.footer.elementId) {
3414
+ var footerEl = document.getElementById(_this25.options.footer.elementId);
3415
+ if (footerEl) {
3416
+ pdfData.footer = footerEl.outerHTML;
3417
+ if (_this25.options.footer.css) {
3418
+ pdfData.options.footerCSS = _this25.options.footer.css;
3419
+ }
3420
+ }
3421
+ } else {
3422
+ pdfData.footer = _this25.options.footer;
3413
3423
  }
3414
3424
  }
3415
- } else {
3416
- pdfData.footer = _this25.options.footer;
3425
+ pdfData.html = el.outerHTML;
3426
+ // document.getElementById(`${this.elementId}_pdfHeader`).value = pdfData.header
3427
+ // document.getElementById(`${this.elementId}_pdfHTML`).value = pdfData.html
3428
+ // document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
3429
+ // document.getElementById(`${this.elementId}_form`).submit()
3430
+ _this25.service.add('', pdfData, {
3431
+ responseType: 'blob'
3432
+ }).then(function (response) {
3433
+ _this25.loader.hide();
3434
+ var blob = new Blob([response], {
3435
+ type: 'application/pdf'
3436
+ });
3437
+ 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 ");
3438
+ if (_this25.options.directDownload === true) {
3439
+ var fileName;
3440
+ if (typeof _this25.options.fileName === 'function') {
3441
+ fileName = _this25.options.fileName() || 'Export';
3442
+ } else {
3443
+ fileName = _this25.options.fileName || 'Export';
3444
+ }
3445
+ msg += "download='".concat(fileName, ".pdf'");
3446
+ }
3447
+ msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this25.options.buttonText, "</button>\n </a>\n </div>\n ");
3448
+ _this25.popup.show({
3449
+ message: msg,
3450
+ mask: true
3451
+ });
3452
+ }, function (err) {
3453
+ console.error(err);
3454
+ });
3417
3455
  }
3418
3456
  }
3419
- pdfData.html = el.outerHTML;
3420
- // document.getElementById(`${this.elementId}_pdfHeader`).value = pdfData.header
3421
- // document.getElementById(`${this.elementId}_pdfHTML`).value = pdfData.html
3422
- // document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
3423
- // document.getElementById(`${this.elementId}_form`).submit()
3424
- _this25.service.add('', pdfData, {
3425
- responseType: 'blob'
3426
- }).then(function (response) {
3427
- _this25.loader.hide();
3428
- var blob = new Blob([response], {
3429
- type: 'application/pdf'
3430
- });
3431
- 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 ");
3432
- if (_this25.options.directDownload === true) {
3433
- var fileName;
3434
- if (typeof _this25.options.fileName === 'function') {
3435
- fileName = _this25.options.fileName() || 'Export';
3436
- } else {
3437
- fileName = _this25.options.fileName || 'Export';
3438
- }
3439
- msg += "download='".concat(fileName, ".pdf'");
3440
- }
3441
- msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this25.options.buttonText, "</button>\n </a>\n </div>\n ");
3442
- _this25.popup.show({
3443
- message: msg,
3444
- mask: true
3445
- });
3446
- }, function (err) {
3447
- console.error(err);
3448
- });
3449
- }
3457
+ }, _this25.options.wait);
3458
+ } else {
3459
+ _this25.loader.hide();
3460
+ _this25.options.onError();
3450
3461
  }
3451
- }, this.options.wait);
3462
+ });
3452
3463
  } else if (event.target.classList.contains('download-pdf')) {
3453
3464
  this.popup.hide();
3454
3465
  if (this.options.onClose) {
@@ -6190,6 +6201,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6190
6201
  autoFitColumns: true
6191
6202
  };
6192
6203
  this.options = _extends({}, DEFAULTS, options);
6204
+ this._isRendered = false;
6193
6205
  this.isTouchDevice = 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0;
6194
6206
  if (this.options.disableTouch === true) {
6195
6207
  this.isTouchDevice = false;
@@ -6250,6 +6262,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
6250
6262
  }
6251
6263
  }
6252
6264
  _createClass(WebsyTable3, [{
6265
+ key: "isRendered",
6266
+ get: function get() {
6267
+ return this._isRendered;
6268
+ }
6269
+ }, {
6253
6270
  key: "columns",
6254
6271
  set: function set(columns) {
6255
6272
  this.options.columns = columns;
@@ -6264,6 +6281,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6264
6281
  }, {
6265
6282
  key: "appendRows",
6266
6283
  value: function appendRows(data) {
6284
+ this._isRendered = false;
6267
6285
  this.hideError();
6268
6286
  var bodyEl = document.getElementById("".concat(this.elementId, "_tableBody"));
6269
6287
  if (bodyEl) {
@@ -6275,6 +6293,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6275
6293
  bodyEl.querySelector('tbody').innerHTML += this.buildBodyHtml(data, true, true);
6276
6294
  } else {
6277
6295
  bodyEl.innerHTML += this.buildBodyHtml(data, true);
6296
+ this._isRendered = true;
6278
6297
  }
6279
6298
  this.currentData = this.currentData.concat(data);
6280
6299
  }
@@ -7280,10 +7299,12 @@ var WebsyChart = /*#__PURE__*/function () {
7280
7299
  maxBandWidth: 100,
7281
7300
  allowUnevenBands: true,
7282
7301
  allowBrushing: true,
7283
- balancedMinMax: false
7302
+ balancedMinMax: false,
7303
+ onRendered: function onRendered() {}
7284
7304
  };
7285
7305
  this.elementId = elementId;
7286
7306
  this.options = _extends({}, DEFAULTS, options);
7307
+ this._isRendered = false;
7287
7308
  this.leftAxis = null;
7288
7309
  this.rightAxis = null;
7289
7310
  this.topAxis = null;
@@ -7322,21 +7343,6 @@ var WebsyChart = /*#__PURE__*/function () {
7322
7343
  }
7323
7344
  }
7324
7345
  }
7325
- // }
7326
- // else {
7327
- // let domain = [...this[xAxis].domain()]
7328
- // if (this.options.orientation === 'horizontal') {
7329
- // domain = domain.reverse()
7330
- // }
7331
- // for (let j = 0; j < domain.length; j++) {
7332
- // let breakA = this[xAxis](domain[j]) - (width / 2)
7333
- // let breakB = breakA + width
7334
- // if (input > breakA && input <= breakB) {
7335
- // output = j
7336
- // break
7337
- // }
7338
- // }
7339
- // }
7340
7346
  return output;
7341
7347
  };
7342
7348
  var that = this;
@@ -7411,6 +7417,11 @@ var WebsyChart = /*#__PURE__*/function () {
7411
7417
  this.options.data = d;
7412
7418
  this.render();
7413
7419
  }
7420
+ }, {
7421
+ key: "isRendered",
7422
+ get: function get() {
7423
+ return this._isRendered;
7424
+ }
7414
7425
  }, {
7415
7426
  key: "close",
7416
7427
  value: function close() {
@@ -7716,6 +7727,7 @@ var WebsyChart = /*#__PURE__*/function () {
7716
7727
  value: function render(options) {
7717
7728
  var _this50 = this;
7718
7729
  /* global d3 options WebsyUtils */
7730
+ this._isRendered = false;
7719
7731
  if (typeof options !== 'undefined') {
7720
7732
  this.options = _extends({}, this.options, options);
7721
7733
  if (this.options.legendOptions) {
@@ -8456,6 +8468,7 @@ var WebsyChart = /*#__PURE__*/function () {
8456
8468
  return _this51.renderRefLine(l);
8457
8469
  });
8458
8470
  }
8471
+ this._isRendered = true;
8459
8472
  }
8460
8473
  }, {
8461
8474
  key: "renderarea",
@@ -9372,11 +9385,18 @@ var WebsyKPI = /*#__PURE__*/function () {
9372
9385
  };
9373
9386
  this.elementId = elementId;
9374
9387
  this.options = _extends({}, DEFAULTS, options);
9388
+ this._isRendered = false;
9375
9389
  this.render();
9376
9390
  }
9377
9391
  _createClass(WebsyKPI, [{
9392
+ key: "isRendered",
9393
+ get: function get() {
9394
+ return this._isRendered;
9395
+ }
9396
+ }, {
9378
9397
  key: "render",
9379
9398
  value: function render(options) {
9399
+ this._isRendered = false;
9380
9400
  this.options = _extends({}, this.options, options);
9381
9401
  if (!this.options.label.classes) {
9382
9402
  this.options.label.classes = [];
@@ -9411,6 +9431,7 @@ var WebsyKPI = /*#__PURE__*/function () {
9411
9431
  }
9412
9432
  html += " \n </div>\n </div>\n ";
9413
9433
  el.innerHTML = html;
9434
+ this._isRendered = true;
9414
9435
  }
9415
9436
  }
9416
9437
  }]);
@@ -9434,6 +9455,7 @@ var WebsyMap = /*#__PURE__*/function () {
9434
9455
  };
9435
9456
  this.elementId = elementId;
9436
9457
  this.options = _extends({}, DEFAULTS, options);
9458
+ this._isRendered = false;
9437
9459
  if (!elementId) {
9438
9460
  console.log('No element Id provided for Websy Map');
9439
9461
  return;
@@ -9463,6 +9485,11 @@ var WebsyMap = /*#__PURE__*/function () {
9463
9485
  }
9464
9486
  }
9465
9487
  _createClass(WebsyMap, [{
9488
+ key: "isRendered",
9489
+ get: function get() {
9490
+ return this._isRendered;
9491
+ }
9492
+ }, {
9466
9493
  key: "handleClick",
9467
9494
  value: function handleClick(event) {}
9468
9495
  }, {
@@ -9472,6 +9499,7 @@ var WebsyMap = /*#__PURE__*/function () {
9472
9499
  key: "render",
9473
9500
  value: function render() {
9474
9501
  var _this58 = this;
9502
+ this._isRendered = false;
9475
9503
  var mapEl = document.getElementById("".concat(this.elementId, "_map"));
9476
9504
  var legendEl = document.getElementById("".concat(this.elementId, "_map"));
9477
9505
  if (this.options.showLegend === true && this.options.data.polygons) {
@@ -9613,6 +9641,7 @@ var WebsyMap = /*#__PURE__*/function () {
9613
9641
  } else if (this.options.center) {
9614
9642
  this.map.setView(this.options.center, this.options.zoom || null);
9615
9643
  }
9644
+ this._isRendered = true;
9616
9645
  }
9617
9646
  }]);
9618
9647
  return WebsyMap;