@websy/websy-designs 1.4.14 → 1.4.16

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.
@@ -2489,27 +2489,28 @@ var WebsyForm = /*#__PURE__*/function () {
2489
2489
 
2490
2490
  return new Promise(function (resolve, reject) {
2491
2491
  if (_this13.options.useRecaptcha === true) {
2492
- // if (this.recaptchaValue) {
2493
- grecaptcha.ready(function () {
2494
- grecaptcha.execute(ENVIRONMENT.RECAPTCHA_KEY, {
2495
- action: 'submit'
2496
- }).then(function (token) {
2497
- _this13.apiService.add('google/checkrecaptcha', {
2498
- grecaptcharesponse: token
2499
- }).then(function (response) {
2500
- if (response.success && response.success === true) {
2501
- resolve(true);
2502
- } else {
2503
- reject(false);
2504
- }
2505
- });
2506
- }, function (err) {
2507
- reject(err);
2508
- });
2509
- }); // }
2510
- // else {
2511
- // reject(false)
2512
- // }
2492
+ if (_this13.recaptchaValue) {
2493
+ // grecaptcha.ready(() => {
2494
+ // grecaptcha.execute(this.recaptchaValue, { action: 'submit' }).then(token => {
2495
+ _this13.apiService.add('google/checkrecaptcha', {
2496
+ grecaptcharesponse: _this13.recaptchaValue
2497
+ }).then(function (response) {
2498
+ if (response.success && response.success === true) {
2499
+ resolve(true);
2500
+ grecaptcha.reset("".concat(_this13.elementId, "_recaptcha"), {
2501
+ sitekey: ENVIRONMENT.RECAPTCHA_KEY
2502
+ });
2503
+ } else {
2504
+ resolve(false);
2505
+ }
2506
+ }); // }, err => {
2507
+ // reject(err)
2508
+ // })
2509
+ // })
2510
+
2511
+ } else {
2512
+ resolve(false);
2513
+ }
2513
2514
  } else {
2514
2515
  resolve(true);
2515
2516
  }
@@ -2573,19 +2574,23 @@ var WebsyForm = /*#__PURE__*/function () {
2573
2574
  }, {
2574
2575
  key: "recaptchaReady",
2575
2576
  value: function recaptchaReady() {
2577
+ var _this15 = this;
2578
+
2576
2579
  var el = document.getElementById("".concat(this.elementId, "_recaptcha"));
2577
2580
 
2578
2581
  if (el) {
2579
- grecaptcha.render("".concat(this.elementId, "_recaptcha"), {
2580
- sitekey: ENVIRONMENT.RECAPTCHA_KEY,
2581
- callback: this.validateRecaptcha.bind(this)
2582
+ grecaptcha.ready(function () {
2583
+ grecaptcha.render("".concat(_this15.elementId, "_recaptcha"), {
2584
+ sitekey: ENVIRONMENT.RECAPTCHA_KEY,
2585
+ callback: _this15.validateRecaptcha.bind(_this15)
2586
+ });
2582
2587
  });
2583
2588
  }
2584
2589
  }
2585
2590
  }, {
2586
2591
  key: "render",
2587
2592
  value: function render(update, data) {
2588
- var _this15 = this;
2593
+ var _this16 = this;
2589
2594
 
2590
2595
  var el = document.getElementById(this.elementId);
2591
2596
  var componentsToProcess = [];
@@ -2595,13 +2600,18 @@ var WebsyForm = /*#__PURE__*/function () {
2595
2600
  this.options.fields.forEach(function (f, i) {
2596
2601
  if (f.component) {
2597
2602
  componentsToProcess.push(f);
2598
- html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <div id='").concat(_this15.elementId, "_input_").concat(f.field, "_component' class='form-component'></div>\n </div><!--\n ");
2603
+ html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <div id='").concat(_this16.elementId, "_input_").concat(f.field, "_component' class='form-component'></div>\n </div><!--\n ");
2599
2604
  } else if (f.type === 'longtext') {
2600
- html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <textarea\n id=\"").concat(_this15.elementId, "_input_").concat(f.field, "\"\n ").concat(f.required === true ? 'required' : '', " \n placeholder=\"").concat(f.placeholder || '', "\"\n name=\"").concat(f.field, "\" \n ").concat((f.attributes || []).join(' '), "\n class=\"websy-input websy-textarea\"\n ></textarea>\n </div><!--\n ");
2605
+ html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <textarea\n id=\"").concat(_this16.elementId, "_input_").concat(f.field, "\"\n ").concat(f.required === true ? 'required' : '', " \n placeholder=\"").concat(f.placeholder || '', "\"\n name=\"").concat(f.field, "\" \n ").concat((f.attributes || []).join(' '), "\n class=\"websy-input websy-textarea\"\n ></textarea>\n </div><!--\n ");
2601
2606
  } else {
2602
- html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <input \n id=\"").concat(_this15.elementId, "_input_").concat(f.field, "\"\n ").concat(f.required === true ? 'required' : '', " \n type=\"").concat(f.type || 'text', "\" \n class=\"websy-input\" \n ").concat((f.attributes || []).join(' '), "\n name=\"").concat(f.field, "\" \n placeholder=\"").concat(f.placeholder || '', "\"\n value=\"").concat(f.value || '', "\"\n valueAsDate=\"").concat(f.type === 'date' ? f.value : '', "\"\n oninvalidx=\"this.setCustomValidity('").concat(f.invalidMessage || 'Please fill in this field.', "')\"\n />\n </div><!--\n ");
2607
+ html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <input \n id=\"").concat(_this16.elementId, "_input_").concat(f.field, "\"\n ").concat(f.required === true ? 'required' : '', " \n type=\"").concat(f.type || 'text', "\" \n class=\"websy-input\" \n ").concat((f.attributes || []).join(' '), "\n name=\"").concat(f.field, "\" \n placeholder=\"").concat(f.placeholder || '', "\"\n value=\"").concat(f.value || '', "\"\n valueAsDate=\"").concat(f.type === 'date' ? f.value : '', "\"\n oninvalidx=\"this.setCustomValidity('").concat(f.invalidMessage || 'Please fill in this field.', "')\"\n />\n </div><!--\n ");
2603
2608
  }
2604
2609
  });
2610
+
2611
+ if (this.options.useRecaptcha === true) {
2612
+ html += "\n --><div id='".concat(this.elementId, "_recaptcha' data-sitekey='").concat(ENVIRONMENT.RECAPTCHA_KEY, "' class='websy-form-recaptcha'></div>\n <div id='").concat(this.elementId, "_recaptchaError' class='websy-alert websy-alert-error websy-hidden'>Invalid recaptcha response</div><!--\n ");
2613
+ }
2614
+
2605
2615
  html += "\n --><button class=\"websy-btn submit ".concat(this.options.submit.classes || '', "\">").concat(this.options.submit.text || 'Save', "</button>").concat(this.options.cancel ? '<!--' : '', "\n ");
2606
2616
 
2607
2617
  if (this.options.cancel) {
@@ -2609,14 +2619,10 @@ var WebsyForm = /*#__PURE__*/function () {
2609
2619
  }
2610
2620
 
2611
2621
  html += " \n </form>\n <div id=\"".concat(this.elementId, "_validationFail\" class=\"websy-validation-failure\"></div>\n ");
2612
-
2613
- if (this.options.useRecaptcha === true) {
2614
- html += "\n <div id='".concat(this.elementId, "_recaptcha'></div>\n ");
2615
- }
2616
-
2617
2622
  el.innerHTML = html;
2618
2623
  this.processComponents(componentsToProcess, function () {
2619
- if (_this15.options.useRecaptcha === true && typeof grecaptcha !== 'undefined') {// this.recaptchaReady()
2624
+ if (_this16.options.useRecaptcha === true && typeof grecaptcha !== 'undefined') {
2625
+ _this16.recaptchaReady();
2620
2626
  }
2621
2627
  });
2622
2628
  }
@@ -2624,13 +2630,27 @@ var WebsyForm = /*#__PURE__*/function () {
2624
2630
  }, {
2625
2631
  key: "submitForm",
2626
2632
  value: function submitForm() {
2627
- var _this16 = this;
2633
+ var _this17 = this;
2628
2634
 
2629
2635
  var formEl = document.getElementById("".concat(this.elementId, "Form"));
2636
+ var buttonEl = formEl.querySelector('button.websy-btn.submit');
2637
+ var recaptchErrEl = document.getElementById("".concat(this.elementId, "_recaptchaError"));
2630
2638
 
2631
2639
  if (formEl.reportValidity() === true) {
2640
+ if (buttonEl) {
2641
+ buttonEl.setAttribute('disabled', true);
2642
+ }
2643
+
2632
2644
  this.checkRecaptcha().then(function (result) {
2645
+ if (buttonEl) {
2646
+ buttonEl.removeAttribute('disabled');
2647
+ }
2648
+
2633
2649
  if (result === true) {
2650
+ if (recaptchErrEl) {
2651
+ recaptchErrEl.classList.add('websy-hidden');
2652
+ }
2653
+
2634
2654
  var formData = new FormData(formEl);
2635
2655
  var data = {};
2636
2656
  var temp = new FormData(formEl);
@@ -2638,39 +2658,47 @@ var WebsyForm = /*#__PURE__*/function () {
2638
2658
  data[key] = value;
2639
2659
  });
2640
2660
 
2641
- if (_this16.options.url) {
2642
- var _this16$apiService;
2661
+ if (_this17.options.url) {
2662
+ var _this17$apiService;
2643
2663
 
2644
- var params = [_this16.options.url];
2664
+ var params = [_this17.options.url];
2645
2665
 
2646
- if (_this16.options.mode === 'update') {
2647
- params.push(_this16.options.id);
2666
+ if (_this17.options.mode === 'update') {
2667
+ params.push(_this17.options.id);
2648
2668
  }
2649
2669
 
2650
2670
  params.push(data);
2651
2671
 
2652
- (_this16$apiService = _this16.apiService)[_this16.options.mode].apply(_this16$apiService, params).then(function (result) {
2653
- if (_this16.options.clearAfterSave === true) {
2672
+ (_this17$apiService = _this17.apiService)[_this17.options.mode].apply(_this17$apiService, params).then(function (result) {
2673
+ if (_this17.options.clearAfterSave === true) {
2654
2674
  // this.render()
2655
2675
  formEl.reset();
2656
2676
  }
2657
2677
 
2658
- _this16.options.onSuccess.call(_this16, result);
2678
+ buttonEl.removeAttribute('disabled');
2679
+
2680
+ _this17.options.onSuccess.call(_this17, result);
2659
2681
  }, function (err) {
2660
2682
  console.log('Error submitting form data:', err);
2661
2683
 
2662
- _this16.options.onError.call(_this16, err);
2684
+ _this17.options.onError.call(_this17, err);
2663
2685
  });
2664
- } else if (_this16.options.submitFn) {
2665
- _this16.options.submitFn(data, function () {
2666
- if (_this16.options.clearAfterSave === true) {
2686
+ } else if (_this17.options.submitFn) {
2687
+ _this17.options.submitFn(data, function () {
2688
+ if (_this17.options.clearAfterSave === true) {
2667
2689
  // this.render()
2668
2690
  formEl.reset();
2669
2691
  }
2670
2692
  });
2671
2693
  }
2672
2694
  } else {
2673
- console.log('bad recaptcha');
2695
+ if (buttonEl) {
2696
+ buttonEl.removeAttribute('disabled');
2697
+ }
2698
+
2699
+ if (recaptchErrEl) {
2700
+ recaptchErrEl.classList.remove('websy-hidden');
2701
+ }
2674
2702
  }
2675
2703
  });
2676
2704
  }
@@ -2683,17 +2711,17 @@ var WebsyForm = /*#__PURE__*/function () {
2683
2711
  }, {
2684
2712
  key: "data",
2685
2713
  set: function set(d) {
2686
- var _this17 = this;
2714
+ var _this18 = this;
2687
2715
 
2688
2716
  if (!this.options.fields) {
2689
2717
  this.options.fields = [];
2690
2718
  }
2691
2719
 
2692
2720
  var _loop = function _loop(key) {
2693
- _this17.options.fields.forEach(function (f) {
2721
+ _this18.options.fields.forEach(function (f) {
2694
2722
  if (f.field === key) {
2695
2723
  f.value = d[key];
2696
- var el = document.getElementById("".concat(_this17.elementId, "_input_").concat(f.field));
2724
+ var el = document.getElementById("".concat(_this18.elementId, "_input_").concat(f.field));
2697
2725
  el.value = f.value;
2698
2726
  }
2699
2727
  });
@@ -2964,19 +2992,19 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2964
2992
  }, {
2965
2993
  key: "handleSearch",
2966
2994
  value: function handleSearch(searchText) {
2967
- var _this18 = this;
2995
+ var _this19 = this;
2968
2996
 
2969
2997
  var el = document.getElementById(this.elementId);
2970
2998
  var lowestItems = this.flatItems.filter(function (d) {
2971
- return d.level === _this18.maxLevel;
2999
+ return d.level === _this19.maxLevel;
2972
3000
  });
2973
3001
  var visibleItems = lowestItems;
2974
3002
  var defaultMethod = 'remove';
2975
3003
 
2976
- if (searchText.length > 1) {
3004
+ if (searchText && searchText.length > 1) {
2977
3005
  defaultMethod = 'add';
2978
3006
  visibleItems = lowestItems.filter(function (d) {
2979
- return d[_this18.options.searchProp].toLowerCase().indexOf(searchText.toLowerCase()) !== -1;
3007
+ return d[_this19.options.searchProp].toLowerCase().indexOf(searchText.toLowerCase()) !== -1;
2980
3008
  });
2981
3009
  } // hide everything
2982
3010
 
@@ -2993,7 +3021,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2993
3021
  listEls[l].classList.add('websy-menu-collapsed');
2994
3022
  }
2995
3023
 
2996
- if (searchText.length > 1) {
3024
+ if (searchText && searchText.length > 1) {
2997
3025
  visibleItems.forEach(function (d) {
2998
3026
  // show the item and open the list
2999
3027
  var pathParts = d.path.split('::');
@@ -3046,11 +3074,19 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
3046
3074
 
3047
3075
  html += this.renderBlock(this.elementId, this.elementId, this.options.items, 'main', 0);
3048
3076
  html += "</div>";
3077
+
3078
+ if (this.options.secondaryItems) {
3079
+ html += "<div class='websy-menu-secondary' style='height: ".concat(this.options.secondaryHeight || '100%', "; width: ").concat(this.options.secondaryWidth || '100%', "'>");
3080
+ html += this.renderBlock(this.elementId, this.elementId, this.options.secondaryItems, 'main', 0);
3081
+ html += "</div>";
3082
+ }
3083
+
3049
3084
  el.innerHTML = html;
3050
3085
 
3051
3086
  if (this.options.enableSearch === true) {
3052
3087
  this.search = new WebsyDesigns.Search("".concat(this.elementId, "_search"), _extends({}, {
3053
- onSearch: this.handleSearch.bind(this)
3088
+ onSearch: this.handleSearch.bind(this),
3089
+ onClear: this.handleSearch.bind(this)
3054
3090
  }, this.options.searchOptions));
3055
3091
  }
3056
3092
  }
@@ -3090,19 +3126,31 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
3090
3126
  html += "\n <span class='selected-bar'></span>\n ";
3091
3127
  }
3092
3128
 
3093
- if (this.options.activeSymbol === 'triangle') {
3094
- html += "\n <span class='active-square'></span>\n ";
3095
- }
3096
-
3097
- html += " \n <span class='".concat(items[i].items && items[i].items.length > 0 ? 'menu-carat' : '', "'></span>\n ");
3098
-
3099
3129
  if (this.options.orientation === 'vertical') {// html += `
3100
3130
  // &nbsp;
3101
3131
  // `
3102
3132
  }
3103
3133
 
3104
3134
  if (items[i].isLink === true && items[i].href) {
3105
- html += "<a href='".concat(items[i].href, "'>").concat(items[i].text, "</a>");
3135
+ html += "<a href='".concat(items[i].href, "' target='").concat(items[i].openInNewTab ? 'blank' : '_self', "'>");
3136
+ }
3137
+
3138
+ if (items[i].icon) {
3139
+ html += "\n <div class='websy-menu-item-icon'>".concat(items[i].icon, "</div>\n ");
3140
+ }
3141
+
3142
+ html += "<span>".concat(items[i].text, "</span>");
3143
+
3144
+ if (items[i].isLink === true && items[i].href) {
3145
+ html += "</a>";
3146
+ }
3147
+
3148
+ if (items[i].items && items[i].items.length > 0) {
3149
+ html += " \n <span class='menu-carat'></span>\n ";
3150
+ }
3151
+
3152
+ if (this.options.activeSymbol === 'triangle') {
3153
+ html += "\n <span class='active-square'></span>\n ";
3106
3154
  }
3107
3155
 
3108
3156
  html += " \n\t\t\t\t</div>\n\t\t ";
@@ -3160,7 +3208,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
3160
3208
 
3161
3209
  var Pager = /*#__PURE__*/function () {
3162
3210
  function Pager(elementId, options) {
3163
- var _this19 = this;
3211
+ var _this20 = this;
3164
3212
 
3165
3213
  _classCallCheck(this, Pager);
3166
3214
 
@@ -3213,8 +3261,8 @@ var Pager = /*#__PURE__*/function () {
3213
3261
  allowClear: false,
3214
3262
  disableSearch: true,
3215
3263
  onItemSelected: function onItemSelected(selectedItem) {
3216
- if (_this19.options.onChangePageSize) {
3217
- _this19.options.onChangePageSize(selectedItem.value);
3264
+ if (_this20.options.onChangePageSize) {
3265
+ _this20.options.onChangePageSize(selectedItem.value);
3218
3266
  }
3219
3267
  }
3220
3268
  });
@@ -3238,13 +3286,13 @@ var Pager = /*#__PURE__*/function () {
3238
3286
  }, {
3239
3287
  key: "render",
3240
3288
  value: function render() {
3241
- var _this20 = this;
3289
+ var _this21 = this;
3242
3290
 
3243
3291
  var el = document.getElementById("".concat(this.elementId, "_pageList"));
3244
3292
 
3245
3293
  if (el) {
3246
3294
  var pages = this.options.pages.map(function (item, index) {
3247
- return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(_this20.options.activePage === index ? 'active' : '', "\">").concat(index + 1, "</li>");
3295
+ return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(_this21.options.activePage === index ? 'active' : '', "\">").concat(index + 1, "</li>");
3248
3296
  });
3249
3297
  var startIndex = 0;
3250
3298
 
@@ -3312,58 +3360,58 @@ var WebsyPDFButton = /*#__PURE__*/function () {
3312
3360
  _createClass(WebsyPDFButton, [{
3313
3361
  key: "handleClick",
3314
3362
  value: function handleClick(event) {
3315
- var _this21 = this;
3363
+ var _this22 = this;
3316
3364
 
3317
3365
  if (event.target.classList.contains('websy-pdf-button')) {
3318
3366
  this.loader.show();
3319
3367
  setTimeout(function () {
3320
- if (_this21.options.targetId) {
3321
- var el = document.getElementById(_this21.options.targetId);
3368
+ if (_this22.options.targetId) {
3369
+ var el = document.getElementById(_this22.options.targetId);
3322
3370
 
3323
3371
  if (el) {
3324
3372
  var pdfData = {
3325
3373
  options: {}
3326
3374
  };
3327
3375
 
3328
- if (_this21.options.pdfOptions) {
3329
- pdfData.options = _extends({}, _this21.options.pdfOptions);
3376
+ if (_this22.options.pdfOptions) {
3377
+ pdfData.options = _extends({}, _this22.options.pdfOptions);
3330
3378
  }
3331
3379
 
3332
- if (_this21.options.header) {
3333
- if (_this21.options.header.elementId) {
3334
- var headerEl = document.getElementById(_this21.options.header.elementId);
3380
+ if (_this22.options.header) {
3381
+ if (_this22.options.header.elementId) {
3382
+ var headerEl = document.getElementById(_this22.options.header.elementId);
3335
3383
 
3336
3384
  if (headerEl) {
3337
3385
  pdfData.header = headerEl.outerHTML;
3338
3386
 
3339
- if (_this21.options.header.css) {
3340
- pdfData.options.headerCSS = _this21.options.header.css;
3387
+ if (_this22.options.header.css) {
3388
+ pdfData.options.headerCSS = _this22.options.header.css;
3341
3389
  }
3342
3390
  }
3343
- } else if (_this21.options.header.html) {
3344
- pdfData.header = _this21.options.header.html;
3391
+ } else if (_this22.options.header.html) {
3392
+ pdfData.header = _this22.options.header.html;
3345
3393
 
3346
- if (_this21.options.header.css) {
3347
- pdfData.options.headerCSS = _this21.options.header.css;
3394
+ if (_this22.options.header.css) {
3395
+ pdfData.options.headerCSS = _this22.options.header.css;
3348
3396
  }
3349
3397
  } else {
3350
- pdfData.header = _this21.options.header;
3398
+ pdfData.header = _this22.options.header;
3351
3399
  }
3352
3400
  }
3353
3401
 
3354
- if (_this21.options.footer) {
3355
- if (_this21.options.footer.elementId) {
3356
- var footerEl = document.getElementById(_this21.options.footer.elementId);
3402
+ if (_this22.options.footer) {
3403
+ if (_this22.options.footer.elementId) {
3404
+ var footerEl = document.getElementById(_this22.options.footer.elementId);
3357
3405
 
3358
3406
  if (footerEl) {
3359
3407
  pdfData.footer = footerEl.outerHTML;
3360
3408
 
3361
- if (_this21.options.footer.css) {
3362
- pdfData.options.footerCSS = _this21.options.footer.css;
3409
+ if (_this22.options.footer.css) {
3410
+ pdfData.options.footerCSS = _this22.options.footer.css;
3363
3411
  }
3364
3412
  }
3365
3413
  } else {
3366
- pdfData.footer = _this21.options.footer;
3414
+ pdfData.footer = _this22.options.footer;
3367
3415
  }
3368
3416
  }
3369
3417
 
@@ -3372,31 +3420,31 @@ var WebsyPDFButton = /*#__PURE__*/function () {
3372
3420
  // document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
3373
3421
  // document.getElementById(`${this.elementId}_form`).submit()
3374
3422
 
3375
- _this21.service.add('', pdfData, {
3423
+ _this22.service.add('', pdfData, {
3376
3424
  responseType: 'blob'
3377
3425
  }).then(function (response) {
3378
- _this21.loader.hide();
3426
+ _this22.loader.hide();
3379
3427
 
3380
3428
  var blob = new Blob([response], {
3381
3429
  type: 'application/pdf'
3382
3430
  });
3383
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 ");
3384
3432
 
3385
- if (_this21.options.directDownload === true) {
3433
+ if (_this22.options.directDownload === true) {
3386
3434
  var fileName;
3387
3435
 
3388
- if (typeof _this21.options.fileName === 'function') {
3389
- fileName = _this21.options.fileName() || 'Export';
3436
+ if (typeof _this22.options.fileName === 'function') {
3437
+ fileName = _this22.options.fileName() || 'Export';
3390
3438
  } else {
3391
- fileName = _this21.options.fileName || 'Export';
3439
+ fileName = _this22.options.fileName || 'Export';
3392
3440
  }
3393
3441
 
3394
3442
  msg += "download='".concat(fileName, ".pdf'");
3395
3443
  }
3396
3444
 
3397
- msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this21.options.buttonText, "</button>\n </a>\n </div>\n ");
3445
+ msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this22.options.buttonText, "</button>\n </a>\n </div>\n ");
3398
3446
 
3399
- _this21.popup.show({
3447
+ _this22.popup.show({
3400
3448
  message: msg,
3401
3449
  mask: true
3402
3450
  });
@@ -3597,7 +3645,7 @@ var WebsyPubSub = /*#__PURE__*/function () {
3597
3645
 
3598
3646
  var ResponsiveText = /*#__PURE__*/function () {
3599
3647
  function ResponsiveText(elementId, options) {
3600
- var _this22 = this;
3648
+ var _this23 = this;
3601
3649
 
3602
3650
  _classCallCheck(this, ResponsiveText);
3603
3651
 
@@ -3610,7 +3658,7 @@ var ResponsiveText = /*#__PURE__*/function () {
3610
3658
  this.elementId = elementId;
3611
3659
  this.canvas = document.createElement('canvas');
3612
3660
  window.addEventListener('resize', function () {
3613
- return _this22.render();
3661
+ return _this23.render();
3614
3662
  });
3615
3663
  var el = document.getElementById(this.elementId);
3616
3664
 
@@ -3829,7 +3877,7 @@ var ResponsiveText = /*#__PURE__*/function () {
3829
3877
 
3830
3878
  var WebsyResultList = /*#__PURE__*/function () {
3831
3879
  function WebsyResultList(elementId, options) {
3832
- var _this23 = this;
3880
+ var _this24 = this;
3833
3881
 
3834
3882
  _classCallCheck(this, WebsyResultList);
3835
3883
 
@@ -3861,9 +3909,9 @@ var WebsyResultList = /*#__PURE__*/function () {
3861
3909
 
3862
3910
  if (_typeof(options.template) === 'object' && options.template.url) {
3863
3911
  this.templateService.get(options.template.url).then(function (templateString) {
3864
- _this23.options.template = templateString;
3912
+ _this24.options.template = templateString;
3865
3913
 
3866
- _this23.render();
3914
+ _this24.render();
3867
3915
  });
3868
3916
  } else {
3869
3917
  this.render();
@@ -3883,7 +3931,7 @@ var WebsyResultList = /*#__PURE__*/function () {
3883
3931
  }, {
3884
3932
  key: "buildHTML",
3885
3933
  value: function buildHTML(d) {
3886
- var _this24 = this;
3934
+ var _this25 = this;
3887
3935
 
3888
3936
  var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3889
3937
  var inputTemplate = arguments.length > 2 ? arguments[2] : undefined;
@@ -3893,7 +3941,7 @@ var WebsyResultList = /*#__PURE__*/function () {
3893
3941
  if (this.options.template) {
3894
3942
  if (d.length > 0) {
3895
3943
  d.forEach(function (row, ix) {
3896
- var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate || _this24.options.template).concat(ix < d.length - 1 ? '<!--' : ''); // find conditional elements
3944
+ var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate || _this25.options.template).concat(ix < d.length - 1 ? '<!--' : ''); // find conditional elements
3897
3945
 
3898
3946
  var ifMatches = _toConsumableArray(template.matchAll(/<\s*if[^>]*>([\s\S]*?)<\s*\/\s*if>/g));
3899
3947
 
@@ -3998,7 +4046,7 @@ var WebsyResultList = /*#__PURE__*/function () {
3998
4046
  parts.forEach(function (p) {
3999
4047
  items = items[p];
4000
4048
  });
4001
- template = template.replace(m[0], _this24.buildHTML(items, 0, withoutFor, [].concat(_toConsumableArray(locator), ["".concat(startIndex + ix, ":").concat(c)])));
4049
+ template = template.replace(m[0], _this25.buildHTML(items, 0, withoutFor, [].concat(_toConsumableArray(locator), ["".concat(startIndex + ix, ":").concat(c)])));
4002
4050
  }
4003
4051
  });
4004
4052
 
@@ -4010,7 +4058,7 @@ var WebsyResultList = /*#__PURE__*/function () {
4010
4058
  }
4011
4059
  });
4012
4060
 
4013
- var flatRow = _this24.flattenObject(row);
4061
+ var flatRow = _this25.flattenObject(row);
4014
4062
 
4015
4063
  for (var key in flatRow) {
4016
4064
  var rg = new RegExp("{".concat(key, "}"), 'gm');
@@ -4145,13 +4193,13 @@ var WebsyResultList = /*#__PURE__*/function () {
4145
4193
  }, {
4146
4194
  key: "render",
4147
4195
  value: function render() {
4148
- var _this25 = this;
4196
+ var _this26 = this;
4149
4197
 
4150
4198
  if (this.options.entity) {
4151
4199
  this.apiService.get(this.options.entity).then(function (results) {
4152
- _this25.rows = results.rows;
4200
+ _this26.rows = results.rows;
4153
4201
 
4154
- _this25.resize();
4202
+ _this26.resize();
4155
4203
  });
4156
4204
  } else {
4157
4205
  this.resize();
@@ -4237,14 +4285,14 @@ var WebsyRouter = /*#__PURE__*/function () {
4237
4285
  _createClass(WebsyRouter, [{
4238
4286
  key: "addGroup",
4239
4287
  value: function addGroup(group) {
4240
- var _this26 = this;
4288
+ var _this27 = this;
4241
4289
 
4242
4290
  if (!this.groups[group]) {
4243
4291
  var els = document.querySelectorAll(".websy-view[data-group=\"".concat(group, "\"]"));
4244
4292
 
4245
4293
  if (els) {
4246
4294
  this.getClosestParent(els[0], function (parent) {
4247
- _this26.groups[group] = {
4295
+ _this27.groups[group] = {
4248
4296
  activeView: '',
4249
4297
  views: [],
4250
4298
  parent: parent.getAttribute('data-view')
@@ -4307,7 +4355,7 @@ var WebsyRouter = /*#__PURE__*/function () {
4307
4355
  }, {
4308
4356
  key: "removeUrlParams",
4309
4357
  value: function removeUrlParams() {
4310
- var _this27 = this;
4358
+ var _this28 = this;
4311
4359
 
4312
4360
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
4313
4361
  var reloadView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -4321,7 +4369,7 @@ var WebsyRouter = /*#__PURE__*/function () {
4321
4369
 
4322
4370
  if (this.currentParams && this.currentParams.items) {
4323
4371
  params.forEach(function (p) {
4324
- delete _this27.currentParams.items[p];
4372
+ delete _this28.currentParams.items[p];
4325
4373
  });
4326
4374
  path = this.buildUrlPath(this.currentParams.items);
4327
4375
  }
@@ -4685,12 +4733,12 @@ var WebsyRouter = /*#__PURE__*/function () {
4685
4733
  }, {
4686
4734
  key: "showComponents",
4687
4735
  value: function showComponents(view) {
4688
- var _this28 = this;
4736
+ var _this29 = this;
4689
4737
 
4690
4738
  if (this.options.views && this.options.views[view] && this.options.views[view].components) {
4691
4739
  this.options.views[view].components.forEach(function (c) {
4692
4740
  if (typeof c.instance === 'undefined') {
4693
- _this28.prepComponent(c.elementId, c.options);
4741
+ _this29.prepComponent(c.elementId, c.options);
4694
4742
 
4695
4743
  c.instance = new c.Component(c.elementId, c.options);
4696
4744
  } else if (c.instance.render) {
@@ -5045,7 +5093,7 @@ var WebsySearch = /*#__PURE__*/function () {
5045
5093
  }, {
5046
5094
  key: "handleKeyUp",
5047
5095
  value: function handleKeyUp(event) {
5048
- var _this29 = this;
5096
+ var _this30 = this;
5049
5097
 
5050
5098
  if (event.target.classList.contains('websy-search-input')) {
5051
5099
  if (this.searchTimeoutFn) {
@@ -5064,8 +5112,8 @@ var WebsySearch = /*#__PURE__*/function () {
5064
5112
 
5065
5113
  if (event.target.value.length >= this.options.minLength) {
5066
5114
  this.searchTimeoutFn = setTimeout(function () {
5067
- if (_this29.options.onSearch) {
5068
- _this29.options.onSearch(event.target.value);
5115
+ if (_this30.options.onSearch) {
5116
+ _this30.options.onSearch(event.target.value);
5069
5117
  }
5070
5118
  }, this.options.searchTimeout);
5071
5119
  } else {
@@ -5227,7 +5275,7 @@ var Switch = /*#__PURE__*/function () {
5227
5275
 
5228
5276
  var WebsyTemplate = /*#__PURE__*/function () {
5229
5277
  function WebsyTemplate(elementId, options) {
5230
- var _this30 = this;
5278
+ var _this31 = this;
5231
5279
 
5232
5280
  _classCallCheck(this, WebsyTemplate);
5233
5281
 
@@ -5253,9 +5301,9 @@ var WebsyTemplate = /*#__PURE__*/function () {
5253
5301
 
5254
5302
  if (_typeof(options.template) === 'object' && options.template.url) {
5255
5303
  this.templateService.get(options.template.url).then(function (templateString) {
5256
- _this30.options.template = templateString;
5304
+ _this31.options.template = templateString;
5257
5305
 
5258
- _this30.render();
5306
+ _this31.render();
5259
5307
  });
5260
5308
  } else {
5261
5309
  this.render();
@@ -5265,7 +5313,7 @@ var WebsyTemplate = /*#__PURE__*/function () {
5265
5313
  _createClass(WebsyTemplate, [{
5266
5314
  key: "buildHTML",
5267
5315
  value: function buildHTML() {
5268
- var _this31 = this;
5316
+ var _this32 = this;
5269
5317
 
5270
5318
  var html = "";
5271
5319
 
@@ -5327,14 +5375,14 @@ var WebsyTemplate = /*#__PURE__*/function () {
5327
5375
  }
5328
5376
 
5329
5377
  if (polarity === true) {
5330
- if (typeof _this31.options.data[parts[0]] !== 'undefined' && _this31.options.data[parts[0]] === parts[1]) {
5378
+ if (typeof _this32.options.data[parts[0]] !== 'undefined' && _this32.options.data[parts[0]] === parts[1]) {
5331
5379
  // remove the <if> tags
5332
5380
  removeAll = false;
5333
5381
  } else if (parts[0] === parts[1]) {
5334
5382
  removeAll = false;
5335
5383
  }
5336
5384
  } else if (polarity === false) {
5337
- if (typeof _this31.options.data[parts[0]] !== 'undefined' && _this31.options.data[parts[0]] !== parts[1]) {
5385
+ if (typeof _this32.options.data[parts[0]] !== 'undefined' && _this32.options.data[parts[0]] !== parts[1]) {
5338
5386
  // remove the <if> tags
5339
5387
  removeAll = false;
5340
5388
  }
@@ -5624,7 +5672,7 @@ var WebsyUtils = {
5624
5672
 
5625
5673
  var WebsyTable = /*#__PURE__*/function () {
5626
5674
  function WebsyTable(elementId, options) {
5627
- var _this32 = this;
5675
+ var _this33 = this;
5628
5676
 
5629
5677
  _classCallCheck(this, WebsyTable);
5630
5678
 
@@ -5662,8 +5710,8 @@ var WebsyTable = /*#__PURE__*/function () {
5662
5710
  allowClear: false,
5663
5711
  disableSearch: true,
5664
5712
  onItemSelected: function onItemSelected(selectedItem) {
5665
- if (_this32.options.onChangePageSize) {
5666
- _this32.options.onChangePageSize(selectedItem.value);
5713
+ if (_this33.options.onChangePageSize) {
5714
+ _this33.options.onChangePageSize(selectedItem.value);
5667
5715
  }
5668
5716
  }
5669
5717
  });
@@ -5684,7 +5732,7 @@ var WebsyTable = /*#__PURE__*/function () {
5684
5732
  _createClass(WebsyTable, [{
5685
5733
  key: "appendRows",
5686
5734
  value: function appendRows(data) {
5687
- var _this33 = this;
5735
+ var _this34 = this;
5688
5736
 
5689
5737
  this.hideError();
5690
5738
  var bodyHTML = '';
@@ -5692,15 +5740,15 @@ var WebsyTable = /*#__PURE__*/function () {
5692
5740
  if (data) {
5693
5741
  bodyHTML += data.map(function (r, rowIndex) {
5694
5742
  return '<tr>' + r.map(function (c, i) {
5695
- if (_this33.options.columns[i].show !== false) {
5743
+ if (_this34.options.columns[i].show !== false) {
5696
5744
  var style = '';
5697
5745
 
5698
5746
  if (c.style) {
5699
5747
  style += c.style;
5700
5748
  }
5701
5749
 
5702
- if (_this33.options.columns[i].width) {
5703
- style += "width: ".concat(_this33.options.columns[i].width, "; ");
5750
+ if (_this34.options.columns[i].width) {
5751
+ style += "width: ".concat(_this34.options.columns[i].width, "; ");
5704
5752
  }
5705
5753
 
5706
5754
  if (c.backgroundColor) {
@@ -5715,18 +5763,18 @@ var WebsyTable = /*#__PURE__*/function () {
5715
5763
  style += "color: ".concat(c.color, "; ");
5716
5764
  }
5717
5765
 
5718
- if (_this33.options.columns[i].showAsLink === true && c.value.trim() !== '') {
5719
- return "\n <td \n data-row-index='".concat(_this33.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this33.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >\n <a href='").concat(c.value, "' target='").concat(_this33.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this33.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
5720
- } else if ((_this33.options.columns[i].showAsNavigatorLink === true || _this33.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
5721
- return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this33.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this33.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this33.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this33.options.columns[i].linkText || c.value, "</td>\n ");
5766
+ if (_this34.options.columns[i].showAsLink === true && c.value.trim() !== '') {
5767
+ return "\n <td \n data-row-index='".concat(_this34.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this34.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >\n <a href='").concat(c.value, "' target='").concat(_this34.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this34.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
5768
+ } else if ((_this34.options.columns[i].showAsNavigatorLink === true || _this34.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
5769
+ return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this34.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this34.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this34.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this34.options.columns[i].linkText || c.value, "</td>\n ");
5722
5770
  } else {
5723
5771
  var info = c.value;
5724
5772
 
5725
- if (_this33.options.columns[i].showAsImage === true) {
5773
+ if (_this34.options.columns[i].showAsImage === true) {
5726
5774
  c.value = "\n <img src='".concat(c.value, "'>\n ");
5727
5775
  }
5728
5776
 
5729
- return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this33.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this33.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.value, "</td>\n ");
5777
+ return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this34.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this34.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.value, "</td>\n ");
5730
5778
  }
5731
5779
  }
5732
5780
  }).join('') + '</tr>';
@@ -5898,7 +5946,7 @@ var WebsyTable = /*#__PURE__*/function () {
5898
5946
  }, {
5899
5947
  key: "render",
5900
5948
  value: function render(data) {
5901
- var _this34 = this;
5949
+ var _this35 = this;
5902
5950
 
5903
5951
  if (!this.options.columns) {
5904
5952
  return;
@@ -5933,7 +5981,7 @@ var WebsyTable = /*#__PURE__*/function () {
5933
5981
  style += "width: ".concat(c.width || 'auto', ";");
5934
5982
  }
5935
5983
 
5936
- return "\n <th style=\"".concat(style, "\">\n <div class =\"tableHeader\">\n <div class=\"leftSection\">\n <div\n class=\"tableHeaderField ").concat(['asc', 'desc'].indexOf(c.sort) !== -1 ? 'sortable-column' : '', "\"\n data-index=\"").concat(i, "\" \n data-sort=\"").concat(c.sort, "\" \n >\n ").concat(c.name, "\n </div>\n </div>\n <div class=\"").concat(c.activeSort ? c.sort + ' sortOrder' : '', "\"></div>\n <!--").concat(c.searchable === true ? _this34.buildSearchIcon(c.qGroupFieldDefs[0]) : '', "-->\n </div>\n </th>\n ");
5984
+ return "\n <th style=\"".concat(style, "\">\n <div class =\"tableHeader\">\n <div class=\"leftSection\">\n <div\n class=\"tableHeaderField ").concat(['asc', 'desc'].indexOf(c.sort) !== -1 ? 'sortable-column' : '', "\"\n data-index=\"").concat(i, "\" \n data-sort=\"").concat(c.sort, "\" \n >\n ").concat(c.name, "\n </div>\n </div>\n <div class=\"").concat(c.activeSort ? c.sort + ' sortOrder' : '', "\"></div>\n <!--").concat(c.searchable === true ? _this35.buildSearchIcon(c.qGroupFieldDefs[0]) : '', "-->\n </div>\n </th>\n ");
5937
5985
  }
5938
5986
  }).join('') + '</tr>';
5939
5987
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
@@ -5952,7 +6000,7 @@ var WebsyTable = /*#__PURE__*/function () {
5952
6000
 
5953
6001
  if (pagingEl) {
5954
6002
  var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
5955
- return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this34.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
6003
+ return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this35.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
5956
6004
  });
5957
6005
  var startIndex = 0;
5958
6006
 
@@ -6020,7 +6068,7 @@ var WebsyTable = /*#__PURE__*/function () {
6020
6068
 
6021
6069
  var WebsyTable2 = /*#__PURE__*/function () {
6022
6070
  function WebsyTable2(elementId, options) {
6023
- var _this35 = this;
6071
+ var _this36 = this;
6024
6072
 
6025
6073
  _classCallCheck(this, WebsyTable2);
6026
6074
 
@@ -6061,8 +6109,8 @@ var WebsyTable2 = /*#__PURE__*/function () {
6061
6109
  allowClear: false,
6062
6110
  disableSearch: true,
6063
6111
  onItemSelected: function onItemSelected(selectedItem) {
6064
- if (_this35.options.onChangePageSize) {
6065
- _this35.options.onChangePageSize(selectedItem.value);
6112
+ if (_this36.options.onChangePageSize) {
6113
+ _this36.options.onChangePageSize(selectedItem.value);
6066
6114
  }
6067
6115
  }
6068
6116
  });
@@ -6086,7 +6134,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6086
6134
  _createClass(WebsyTable2, [{
6087
6135
  key: "appendRows",
6088
6136
  value: function appendRows(data) {
6089
- var _this36 = this;
6137
+ var _this37 = this;
6090
6138
 
6091
6139
  this.hideError();
6092
6140
  var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
@@ -6095,15 +6143,15 @@ var WebsyTable2 = /*#__PURE__*/function () {
6095
6143
  if (data) {
6096
6144
  bodyHTML += data.map(function (r, rowIndex) {
6097
6145
  return '<tr>' + r.map(function (c, i) {
6098
- if (_this36.options.columns[i].show !== false) {
6099
- var style = "height: ".concat(_this36.options.cellSize, "px; line-height: ").concat(_this36.options.cellSize, "px;");
6146
+ if (_this37.options.columns[i].show !== false) {
6147
+ var style = "height: ".concat(_this37.options.cellSize, "px; line-height: ").concat(_this37.options.cellSize, "px;");
6100
6148
 
6101
6149
  if (c.style) {
6102
6150
  style += c.style;
6103
6151
  }
6104
6152
 
6105
- if (_this36.options.columns[i].width) {
6106
- style += "width: ".concat(_this36.options.columns[i].width, "; ");
6153
+ if (_this37.options.columns[i].width) {
6154
+ style += "width: ".concat(_this37.options.columns[i].width, "; ");
6107
6155
  }
6108
6156
 
6109
6157
  if (c.backgroundColor) {
@@ -6118,18 +6166,18 @@ var WebsyTable2 = /*#__PURE__*/function () {
6118
6166
  style += "color: ".concat(c.color, "; ");
6119
6167
  }
6120
6168
 
6121
- if (_this36.options.columns[i].showAsLink === true && c.value.trim() !== '') {
6122
- return "\n <td \n data-row-index='".concat(_this36.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this36.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >\n <a href='").concat(c.value, "' target='").concat(_this36.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this36.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
6123
- } else if ((_this36.options.columns[i].showAsNavigatorLink === true || _this36.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
6124
- return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this36.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this36.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this36.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this36.options.columns[i].linkText || c.value, "</td>\n ");
6169
+ if (_this37.options.columns[i].showAsLink === true && c.value.trim() !== '') {
6170
+ return "\n <td \n data-row-index='".concat(_this37.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this37.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >\n <a href='").concat(c.value, "' target='").concat(_this37.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this37.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
6171
+ } else if ((_this37.options.columns[i].showAsNavigatorLink === true || _this37.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
6172
+ return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this37.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this37.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this37.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this37.options.columns[i].linkText || c.value, "</td>\n ");
6125
6173
  } else {
6126
6174
  var info = c.value;
6127
6175
 
6128
- if (_this36.options.columns[i].showAsImage === true) {
6176
+ if (_this37.options.columns[i].showAsImage === true) {
6129
6177
  c.value = "\n <img src='".concat(c.value, "'>\n ");
6130
6178
  }
6131
6179
 
6132
- return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this36.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this36.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.value, "</td>\n ");
6180
+ return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this37.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this37.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.value, "</td>\n ");
6133
6181
  }
6134
6182
  }
6135
6183
  }).join('') + '</tr>';
@@ -6392,7 +6440,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6392
6440
  }, {
6393
6441
  key: "render",
6394
6442
  value: function render(data) {
6395
- var _this37 = this;
6443
+ var _this38 = this;
6396
6444
 
6397
6445
  if (!this.options.columns) {
6398
6446
  return;
@@ -6428,7 +6476,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6428
6476
  style += "width: ".concat(c.width || 'auto', "; ");
6429
6477
  }
6430
6478
 
6431
- return "\n <th style=\"".concat(style, "\">\n <div class =\"tableHeader\">\n <div class=\"leftSection\">\n <div\n class=\"tableHeaderField ").concat(['asc', 'desc'].indexOf(c.sort) !== -1 ? 'sortable-column' : '', "\"\n data-sort-index=\"").concat(c.sortIndex || i, "\"\n data-index=\"").concat(i, "\"\n data-sort=\"").concat(c.sort, "\"\n style=\"").concat(c.style || '', "\" \n >\n ").concat(c.name, "\n </div>\n </div>\n <div class=\"").concat(c.activeSort ? c.sort + ' sortOrder' : '', "\"></div>\n ").concat(c.searchable === true ? _this37.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
6479
+ return "\n <th style=\"".concat(style, "\">\n <div class =\"tableHeader\">\n <div class=\"leftSection\">\n <div\n class=\"tableHeaderField ").concat(['asc', 'desc'].indexOf(c.sort) !== -1 ? 'sortable-column' : '', "\"\n data-sort-index=\"").concat(c.sortIndex || i, "\"\n data-index=\"").concat(i, "\"\n data-sort=\"").concat(c.sort, "\"\n style=\"").concat(c.style || '', "\" \n >\n ").concat(c.name, "\n </div>\n </div>\n <div class=\"").concat(c.activeSort ? c.sort + ' sortOrder' : '', "\"></div>\n ").concat(c.searchable === true ? _this38.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
6432
6480
  }
6433
6481
  }).join('') + '</tr>';
6434
6482
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
@@ -6439,7 +6487,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6439
6487
  var dropdownHTML = "";
6440
6488
  this.options.columns.forEach(function (c, i) {
6441
6489
  if (c.searchable && c.searchField) {
6442
- dropdownHTML += "\n <div id=\"".concat(_this37.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
6490
+ dropdownHTML += "\n <div id=\"".concat(_this38.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
6443
6491
  }
6444
6492
  });
6445
6493
  dropdownEl.innerHTML = dropdownHTML;
@@ -6461,7 +6509,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6461
6509
 
6462
6510
  if (pagingEl) {
6463
6511
  var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
6464
- return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this37.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
6512
+ return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this38.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
6465
6513
  });
6466
6514
  var startIndex = 0;
6467
6515
 
@@ -6552,7 +6600,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6552
6600
  }, {
6553
6601
  key: "getColumnParameters",
6554
6602
  value: function getColumnParameters(values) {
6555
- var _this38 = this;
6603
+ var _this39 = this;
6556
6604
 
6557
6605
  var tableEl = document.getElementById("".concat(this.elementId, "_table"));
6558
6606
  tableEl.style.tableLayout = 'auto';
@@ -6560,10 +6608,10 @@ var WebsyTable2 = /*#__PURE__*/function () {
6560
6608
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
6561
6609
  var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
6562
6610
  headEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c, i) {
6563
- return "\n <th>\n <div class =\"tableHeader\">\n <div class=\"leftSection\">\n <div\n class=\"tableHeaderField\" \n >\n ".concat(c.value || 'nbsp;', "\n </div>\n </div> \n ").concat(c.searchable === true ? _this38.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
6611
+ return "\n <th>\n <div class =\"tableHeader\">\n <div class=\"leftSection\">\n <div\n class=\"tableHeaderField\" \n >\n ".concat(c.value || 'nbsp;', "\n </div>\n </div> \n ").concat(c.searchable === true ? _this39.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
6564
6612
  }).join('') + '</tr>';
6565
6613
  bodyEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c) {
6566
- return "\n <td \n style='height: ".concat(_this38.options.cellSize, "px; line-height: ").concat(_this38.options.cellSize, "px; padding: 10px 5px;'\n >").concat(c.value || '&nbsp;', "</td>\n ");
6614
+ return "\n <td \n style='height: ".concat(_this39.options.cellSize, "px; line-height: ").concat(_this39.options.cellSize, "px; padding: 10px 5px;'\n >").concat(c.value || '&nbsp;', "</td>\n ");
6567
6615
  }).join('') + '</tr>'; // get height of the first data cell
6568
6616
 
6569
6617
  var cells = bodyEl.querySelectorAll("tr:first-of-type td");
@@ -6691,7 +6739,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6691
6739
  }, {
6692
6740
  key: "buildBodyHtml",
6693
6741
  value: function buildBodyHtml() {
6694
- var _this39 = this;
6742
+ var _this40 = this;
6695
6743
 
6696
6744
  var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6697
6745
  var useWidths = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -6750,7 +6798,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6750
6798
  } // console.log('rowspan', cell.rowspan)
6751
6799
 
6752
6800
 
6753
- bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this39.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((cell.classes || []).join(' '), "'\n style='").concat(style, "'\n data-info='").concat(cell.value, "'\n colspan='").concat(cell.colspan || 1, "'\n rowspan='").concat(cell.rowspan || 1, "'\n data-row-index='").concat(rowIndex, "'\n data-col-index='").concat(cellIndex, "'\n "); // if (useWidths === true) {
6801
+ bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this40.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((cell.classes || []).join(' '), "'\n style='").concat(style, "'\n data-info='").concat(cell.value, "'\n colspan='").concat(cell.colspan || 1, "'\n rowspan='").concat(cell.rowspan || 1, "'\n data-row-index='").concat(rowIndex, "'\n data-col-index='").concat(cellIndex, "'\n "); // if (useWidths === true) {
6754
6802
  // bodyHtml += `
6755
6803
  // style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
6756
6804
  // width='${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}'
@@ -6760,11 +6808,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
6760
6808
  bodyHtml += "\n ><div style='".concat(divStyle, "'>");
6761
6809
 
6762
6810
  if (cell.expandable === true) {
6763
- bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(_this39.options.plusIcon, "</i>");
6811
+ bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(_this40.options.plusIcon, "</i>");
6764
6812
  }
6765
6813
 
6766
6814
  if (cell.collapsable === true) {
6767
- bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(_this39.options.minusIcon, "</i>");
6815
+ bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(_this40.options.minusIcon, "</i>");
6768
6816
  }
6769
6817
 
6770
6818
  if (sizingColumns[sizeIndex].showAsLink === true && cell.value.trim() !== '') {
@@ -6789,7 +6837,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6789
6837
  }, {
6790
6838
  key: "buildHeaderHtml",
6791
6839
  value: function buildHeaderHtml() {
6792
- var _this40 = this;
6840
+ var _this41 = this;
6793
6841
 
6794
6842
  var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6795
6843
  var headerHtml = '';
@@ -6804,7 +6852,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6804
6852
  }
6805
6853
 
6806
6854
  this.options.columns.forEach(function (row, rowIndex) {
6807
- if (useWidths === false && rowIndex !== _this40.options.columns.length - 1) {
6855
+ if (useWidths === false && rowIndex !== _this41.options.columns.length - 1) {
6808
6856
  // if we're calculating the size we only want to render the last row of column headers
6809
6857
  return;
6810
6858
  }
@@ -6830,18 +6878,18 @@ var WebsyTable3 = /*#__PURE__*/function () {
6830
6878
  // `
6831
6879
  // }
6832
6880
 
6833
- headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ? _this40.buildSearchIcon(col, colIndex) : '', "</div></td>");
6881
+ headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ? _this41.buildSearchIcon(col, colIndex) : '', "</div></td>");
6834
6882
  });
6835
6883
  headerHtml += "</tr>";
6836
6884
  });
6837
6885
  var dropdownEl = document.getElementById("".concat(this.elementId, "_dropdownContainer"));
6838
6886
  this.options.columns[this.options.columns.length - 1].forEach(function (c, i) {
6839
6887
  if (c.searchable && c.isExternalSearch === true) {
6840
- var testEl = document.getElementById("".concat(_this40.elementId, "_columnSearch_").concat(c.dimId || i));
6888
+ var testEl = document.getElementById("".concat(_this41.elementId, "_columnSearch_").concat(c.dimId || i));
6841
6889
 
6842
6890
  if (!testEl) {
6843
6891
  var newE = document.createElement('div');
6844
- newE.id = "".concat(_this40.elementId, "_columnSearch_").concat(c.dimId || i);
6892
+ newE.id = "".concat(_this41.elementId, "_columnSearch_").concat(c.dimId || i);
6845
6893
  newE.className = 'websy-modal-dropdown';
6846
6894
  dropdownEl.appendChild(newE);
6847
6895
  }
@@ -6857,7 +6905,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6857
6905
  }, {
6858
6906
  key: "buildTotalHtml",
6859
6907
  value: function buildTotalHtml() {
6860
- var _this41 = this;
6908
+ var _this42 = this;
6861
6909
 
6862
6910
  var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6863
6911
 
@@ -6870,7 +6918,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6870
6918
  totalHtml += "<td \n class='websy-table-cell'\n colspan='".concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
6871
6919
 
6872
6920
  if (useWidths === true) {
6873
- totalHtml += "\n style='width: ".concat(_this41.options.columns[_this41.options.columns.length - 1][colIndex].width || _this41.options.columns[_this41.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
6921
+ totalHtml += "\n style='width: ".concat(_this42.options.columns[_this42.options.columns.length - 1][colIndex].width || _this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
6874
6922
  }
6875
6923
 
6876
6924
  totalHtml += " \n >\n ".concat(col.value, "\n </td>");
@@ -6881,7 +6929,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6881
6929
  }, {
6882
6930
  key: "calculateSizes",
6883
6931
  value: function calculateSizes() {
6884
- var _this42 = this;
6932
+ var _this43 = this;
6885
6933
 
6886
6934
  var sample = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6887
6935
  var totalRowCount = arguments.length > 1 ? arguments[1] : undefined;
@@ -6924,32 +6972,32 @@ var WebsyTable3 = /*#__PURE__*/function () {
6924
6972
  rows.forEach(function (row, rowIndex) {
6925
6973
  Array.from(row.children).forEach(function (col, colIndex) {
6926
6974
  var colSize = col.getBoundingClientRect();
6927
- _this42.sizes.cellHeight = colSize.height;
6975
+ _this43.sizes.cellHeight = colSize.height;
6928
6976
 
6929
- if (_this42.options.columns[_this42.options.columns.length - 1][colIndex]) {
6930
- if (!_this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth) {
6931
- _this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth = 0;
6977
+ if (_this43.options.columns[_this43.options.columns.length - 1][colIndex]) {
6978
+ if (!_this43.options.columns[_this43.options.columns.length - 1][colIndex].actualWidth) {
6979
+ _this43.options.columns[_this43.options.columns.length - 1][colIndex].actualWidth = 0;
6932
6980
  }
6933
6981
 
6934
- _this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth = Math.min(Math.max(_this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth, colSize.width), maxWidth);
6935
- _this42.options.columns[_this42.options.columns.length - 1][colIndex].cellHeight = colSize.height;
6982
+ _this43.options.columns[_this43.options.columns.length - 1][colIndex].actualWidth = Math.min(Math.max(_this43.options.columns[_this43.options.columns.length - 1][colIndex].actualWidth, colSize.width), maxWidth);
6983
+ _this43.options.columns[_this43.options.columns.length - 1][colIndex].cellHeight = colSize.height;
6936
6984
 
6937
- if (colIndex >= _this42.pinnedColumns) {
6938
- firstNonPinnedColumnWidth = _this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth;
6985
+ if (colIndex >= _this43.pinnedColumns) {
6986
+ firstNonPinnedColumnWidth = _this43.options.columns[_this43.options.columns.length - 1][colIndex].actualWidth;
6939
6987
  }
6940
6988
  }
6941
6989
  });
6942
6990
  });
6943
6991
  this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
6944
- if (colIndex < _this42.pinnedColumns) {
6945
- _this42.sizes.scrollableWidth -= col.actualWidth;
6992
+ if (colIndex < _this43.pinnedColumns) {
6993
+ _this43.sizes.scrollableWidth -= col.actualWidth;
6946
6994
  }
6947
6995
  });
6948
6996
  this.sizes.totalWidth = this.options.columns[this.options.columns.length - 1].reduce(function (a, b) {
6949
6997
  return a + (b.width || b.actualWidth);
6950
6998
  }, 0);
6951
6999
  this.sizes.totalNonPinnedWidth = this.options.columns[this.options.columns.length - 1].filter(function (c, i) {
6952
- return i >= _this42.pinnedColumns;
7000
+ return i >= _this43.pinnedColumns;
6953
7001
  }).reduce(function (a, b) {
6954
7002
  return a + (b.width || b.actualWidth);
6955
7003
  }, 0);
@@ -6970,10 +7018,10 @@ var WebsyTable3 = /*#__PURE__*/function () {
6970
7018
  c.actualWidth += equalWidth; // }
6971
7019
  // }
6972
7020
 
6973
- _this42.sizes.totalWidth += c.width || c.actualWidth;
7021
+ _this43.sizes.totalWidth += c.width || c.actualWidth;
6974
7022
 
6975
- if (i < _this42.pinnedColumns) {
6976
- _this42.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
7023
+ if (i < _this43.pinnedColumns) {
7024
+ _this43.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
6977
7025
  } // equalWidth = (outerSize.width - this.sizes.totalWidth) / (this.options.columns[this.options.columns.length - 1].length - (i + 1))
6978
7026
 
6979
7027
  });
@@ -7030,7 +7078,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7030
7078
  }, {
7031
7079
  key: "createSample",
7032
7080
  value: function createSample(data) {
7033
- var _this43 = this;
7081
+ var _this44 = this;
7034
7082
 
7035
7083
  var output = [];
7036
7084
  this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
@@ -7042,7 +7090,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7042
7090
  var longest = '';
7043
7091
 
7044
7092
  for (var i = 0; i < Math.min(data.length, 1000); i++) {
7045
- if (data[i].length === _this43.options.columns[_this43.options.columns.length - 1].length) {
7093
+ if (data[i].length === _this44.options.columns[_this44.options.columns.length - 1].length) {
7046
7094
  if (longest.length < data[i][colIndex].value.length) {
7047
7095
  longest = data[i][colIndex].value;
7048
7096
  }
@@ -7437,7 +7485,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7437
7485
 
7438
7486
  var WebsyChart = /*#__PURE__*/function () {
7439
7487
  function WebsyChart(elementId, options) {
7440
- var _this44 = this;
7488
+ var _this45 = this;
7441
7489
 
7442
7490
  _classCallCheck(this, WebsyChart);
7443
7491
 
@@ -7488,22 +7536,22 @@ var WebsyChart = /*#__PURE__*/function () {
7488
7536
  this.invertOverride = function (input, input2) {
7489
7537
  var xAxis = 'bottomAxis';
7490
7538
 
7491
- if (_this44.options.orientation === 'horizontal') {
7539
+ if (_this45.options.orientation === 'horizontal') {
7492
7540
  xAxis = 'leftAxis';
7493
7541
  }
7494
7542
 
7495
- var width = _this44[xAxis].step();
7543
+ var width = _this45[xAxis].step();
7496
7544
 
7497
7545
  var output;
7498
7546
 
7499
- var domain = _toConsumableArray(_this44[xAxis].domain());
7547
+ var domain = _toConsumableArray(_this45[xAxis].domain());
7500
7548
 
7501
- if (_this44.options.orientation === 'horizontal') {
7549
+ if (_this45.options.orientation === 'horizontal') {
7502
7550
  domain = domain.reverse();
7503
7551
  }
7504
7552
 
7505
7553
  for (var j = 0; j < domain.length; j++) {
7506
- var breakA = _this44[xAxis](domain[j]) - width / 2;
7554
+ var breakA = _this45[xAxis](domain[j]) - width / 2;
7507
7555
  var breakB = breakA + width;
7508
7556
 
7509
7557
  if (input > breakA && input <= breakB) {
@@ -7603,10 +7651,10 @@ var WebsyChart = /*#__PURE__*/function () {
7603
7651
  }, {
7604
7652
  key: "handleEventMouseMove",
7605
7653
  value: function handleEventMouseMove(event, d) {
7606
- var _this45 = this;
7654
+ var _this46 = this;
7607
7655
 
7608
7656
  var bisectDate = d3.bisector(function (d) {
7609
- return _this45.parseX(d.x.value);
7657
+ return _this46.parseX(d.x.value);
7610
7658
  }).left;
7611
7659
 
7612
7660
  if (this.options.showTrackingLine === true && d3.pointer(event)) {
@@ -7645,8 +7693,8 @@ var WebsyChart = /*#__PURE__*/function () {
7645
7693
  }
7646
7694
 
7647
7695
  this.options.data.series.forEach(function (s) {
7648
- if (_this45.options.data[xData].scale !== 'Time') {
7649
- xPoint = _this45[xAxis](_this45.parseX(xLabel));
7696
+ if (_this46.options.data[xData].scale !== 'Time') {
7697
+ xPoint = _this46[xAxis](_this46.parseX(xLabel));
7650
7698
  s.data.forEach(function (d) {
7651
7699
  if (d.x.value === xLabel) {
7652
7700
  if (!tooltipTitle) {
@@ -7665,13 +7713,13 @@ var WebsyChart = /*#__PURE__*/function () {
7665
7713
  var pointA = s.data[index - 1];
7666
7714
  var pointB = s.data[index];
7667
7715
 
7668
- if (_this45.options.orientation === 'horizontal') {
7716
+ if (_this46.options.orientation === 'horizontal') {
7669
7717
  pointA = _toConsumableArray(s.data).reverse()[index - 1];
7670
7718
  pointB = _toConsumableArray(s.data).reverse()[index];
7671
7719
  }
7672
7720
 
7673
7721
  if (pointA && !pointB) {
7674
- xPoint = _this45[xAxis](_this45.parseX(pointA.x.value));
7722
+ xPoint = _this46[xAxis](_this46.parseX(pointA.x.value));
7675
7723
  tooltipTitle = pointA.x.value;
7676
7724
 
7677
7725
  if (!pointA.y.color) {
@@ -7681,12 +7729,12 @@ var WebsyChart = /*#__PURE__*/function () {
7681
7729
  tooltipData.push(pointA.y);
7682
7730
 
7683
7731
  if (typeof pointA.x.value.getTime !== 'undefined') {
7684
- tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointA.x.value);
7732
+ tooltipTitle = d3.timeFormat(_this46.options.dateFormat || _this46.options.calculatedTimeFormatPattern)(pointA.x.value);
7685
7733
  }
7686
7734
  }
7687
7735
 
7688
7736
  if (pointB && !pointA) {
7689
- xPoint = _this45[xAxis](_this45.parseX(pointB.x.value));
7737
+ xPoint = _this46[xAxis](_this46.parseX(pointB.x.value));
7690
7738
  tooltipTitle = pointB.x.value;
7691
7739
 
7692
7740
  if (!pointB.y.color) {
@@ -7696,14 +7744,14 @@ var WebsyChart = /*#__PURE__*/function () {
7696
7744
  tooltipData.push(pointB.y);
7697
7745
 
7698
7746
  if (typeof pointB.x.value.getTime !== 'undefined') {
7699
- tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointB.x.value);
7747
+ tooltipTitle = d3.timeFormat(_this46.options.dateFormat || _this46.options.calculatedTimeFormatPattern)(pointB.x.value);
7700
7748
  }
7701
7749
  }
7702
7750
 
7703
7751
  if (pointA && pointB) {
7704
- var d0 = _this45[xAxis](_this45.parseX(pointA.x.value));
7752
+ var d0 = _this46[xAxis](_this46.parseX(pointA.x.value));
7705
7753
 
7706
- var d1 = _this45[xAxis](_this45.parseX(pointB.x.value));
7754
+ var d1 = _this46[xAxis](_this46.parseX(pointB.x.value));
7707
7755
 
7708
7756
  var mid = Math.abs(d0 - d1) / 2;
7709
7757
 
@@ -7712,7 +7760,7 @@ var WebsyChart = /*#__PURE__*/function () {
7712
7760
  tooltipTitle = pointB.x.value;
7713
7761
 
7714
7762
  if (typeof pointB.x.value.getTime !== 'undefined') {
7715
- tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointB.x.value);
7763
+ tooltipTitle = d3.timeFormat(_this46.options.dateFormat || _this46.options.calculatedTimeFormatPattern)(pointB.x.value);
7716
7764
  }
7717
7765
 
7718
7766
  if (!pointB.y.color) {
@@ -7725,7 +7773,7 @@ var WebsyChart = /*#__PURE__*/function () {
7725
7773
  tooltipTitle = pointA.x.value;
7726
7774
 
7727
7775
  if (typeof pointB.x.value.getTime !== 'undefined') {
7728
- tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointB.x.value);
7776
+ tooltipTitle = d3.timeFormat(_this46.options.dateFormat || _this46.options.calculatedTimeFormatPattern)(pointB.x.value);
7729
7777
  }
7730
7778
 
7731
7779
  if (!pointA.y.color) {
@@ -7839,7 +7887,7 @@ var WebsyChart = /*#__PURE__*/function () {
7839
7887
  }, {
7840
7888
  key: "render",
7841
7889
  value: function render(options) {
7842
- var _this46 = this;
7890
+ var _this47 = this;
7843
7891
 
7844
7892
  /* global d3 options WebsyUtils */
7845
7893
  if (typeof options !== 'undefined') {
@@ -7908,7 +7956,7 @@ var WebsyChart = /*#__PURE__*/function () {
7908
7956
  var legendData = this.options.data.series.map(function (s, i) {
7909
7957
  return {
7910
7958
  value: s.label || s.key,
7911
- color: s.color || _this46.options.colors[i % _this46.options.colors.length]
7959
+ color: s.color || _this47.options.colors[i % _this47.options.colors.length]
7912
7960
  };
7913
7961
  });
7914
7962
 
@@ -8190,7 +8238,7 @@ var WebsyChart = /*#__PURE__*/function () {
8190
8238
 
8191
8239
  if (this.options.data.bottom.formatter) {
8192
8240
  bAxisFunc.tickFormat(function (d) {
8193
- return _this46.options.data.bottom.formatter(d);
8241
+ return _this47.options.data.bottom.formatter(d);
8194
8242
  });
8195
8243
  }
8196
8244
 
@@ -8216,8 +8264,8 @@ var WebsyChart = /*#__PURE__*/function () {
8216
8264
 
8217
8265
  if (this.options.margin.axisLeft > 0) {
8218
8266
  this.leftAxisLayer.call(d3.axisLeft(this.leftAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
8219
- if (_this46.options.data.left.formatter) {
8220
- d = _this46.options.data.left.formatter(d);
8267
+ if (_this47.options.data.left.formatter) {
8268
+ d = _this47.options.data.left.formatter(d);
8221
8269
  }
8222
8270
 
8223
8271
  return d;
@@ -8254,8 +8302,8 @@ var WebsyChart = /*#__PURE__*/function () {
8254
8302
 
8255
8303
  if (this.options.margin.axisRight > 0 && (this.options.data.right.min !== 0 || this.options.data.right.max !== 0)) {
8256
8304
  this.rightAxisLayer.call(d3.axisRight(this.rightAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
8257
- if (_this46.options.data.right.formatter) {
8258
- d = _this46.options.data.right.formatter(d);
8305
+ if (_this47.options.data.right.formatter) {
8306
+ d = _this47.options.data.right.formatter(d);
8259
8307
  }
8260
8308
 
8261
8309
  return d;
@@ -8294,18 +8342,18 @@ var WebsyChart = /*#__PURE__*/function () {
8294
8342
  this.renderedKeys = {};
8295
8343
  this.options.data.series.forEach(function (series, index) {
8296
8344
  if (!series.key) {
8297
- series.key = _this46.createIdentity();
8345
+ series.key = _this47.createIdentity();
8298
8346
  }
8299
8347
 
8300
8348
  if (!series.color) {
8301
- series.color = _this46.options.colors[index % _this46.options.colors.length];
8349
+ series.color = _this47.options.colors[index % _this47.options.colors.length];
8302
8350
  }
8303
8351
 
8304
- _this46["render".concat(series.type || 'bar')](series, index);
8352
+ _this47["render".concat(series.type || 'bar')](series, index);
8305
8353
 
8306
- _this46.renderLabels(series, index);
8354
+ _this47.renderLabels(series, index);
8307
8355
 
8308
- _this46.renderedKeys[series.key] = series.type;
8356
+ _this47.renderedKeys[series.key] = series.type;
8309
8357
  });
8310
8358
  }
8311
8359
  }
@@ -8313,17 +8361,17 @@ var WebsyChart = /*#__PURE__*/function () {
8313
8361
  }, {
8314
8362
  key: "renderarea",
8315
8363
  value: function renderarea(series, index) {
8316
- var _this47 = this;
8364
+ var _this48 = this;
8317
8365
 
8318
8366
  /* global d3 series index */
8319
8367
  var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
8320
8368
  return d3.area().x(function (d) {
8321
- return _this47[xAxis](_this47.parseX(d.x.value));
8369
+ return _this48[xAxis](_this48.parseX(d.x.value));
8322
8370
  }).y0(function (d) {
8323
- return _this47[yAxis](0);
8371
+ return _this48[yAxis](0);
8324
8372
  }).y1(function (d) {
8325
- return _this47[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
8326
- }).curve(d3[curveStyle || _this47.options.curveStyle]);
8373
+ return _this48[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
8374
+ }).curve(d3[curveStyle || _this48.options.curveStyle]);
8327
8375
  };
8328
8376
 
8329
8377
  var xAxis = 'bottomAxis';
@@ -8452,7 +8500,7 @@ var WebsyChart = /*#__PURE__*/function () {
8452
8500
  }, {
8453
8501
  key: "renderLabels",
8454
8502
  value: function renderLabels(series, index) {
8455
- var _this48 = this;
8503
+ var _this49 = this;
8456
8504
 
8457
8505
  /* global series index d3 WebsyDesigns */
8458
8506
  var xAxis = 'bottomAxis';
@@ -8471,11 +8519,11 @@ var WebsyChart = /*#__PURE__*/function () {
8471
8519
  var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
8472
8520
  labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
8473
8521
  labels.attr('x', function (d) {
8474
- return getLabelX.call(_this48, d, series.labelPosition);
8522
+ return getLabelX.call(_this49, d, series.labelPosition);
8475
8523
  }).attr('y', function (d) {
8476
- return getLabelY.call(_this48, d, series.labelPosition);
8524
+ return getLabelY.call(_this49, d, series.labelPosition);
8477
8525
  }).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
8478
- return _this48.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
8526
+ return _this49.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
8479
8527
  }).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
8480
8528
  return d.y.label || d.y.value;
8481
8529
  }).each(function (d, i) {
@@ -8500,11 +8548,11 @@ var WebsyChart = /*#__PURE__*/function () {
8500
8548
  }
8501
8549
  });
8502
8550
  labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', function (d) {
8503
- return getLabelX.call(_this48, d, series.labelPosition);
8551
+ return getLabelX.call(_this49, d, series.labelPosition);
8504
8552
  }).attr('y', function (d) {
8505
- return getLabelY.call(_this48, d, series.labelPosition);
8553
+ return getLabelY.call(_this49, d, series.labelPosition);
8506
8554
  }).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
8507
- return _this48.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
8555
+ return _this49.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
8508
8556
  }).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).text(function (d) {
8509
8557
  return d.y.label || d.y.value;
8510
8558
  }).each(function (d, i) {
@@ -8561,16 +8609,16 @@ var WebsyChart = /*#__PURE__*/function () {
8561
8609
  }, {
8562
8610
  key: "renderline",
8563
8611
  value: function renderline(series, index) {
8564
- var _this49 = this;
8612
+ var _this50 = this;
8565
8613
 
8566
8614
  /* global series index d3 */
8567
8615
  var drawLine = function drawLine(xAxis, yAxis, curveStyle) {
8568
8616
  return d3.line().x(function (d) {
8569
- var adjustment = _this49.options.data[xAxis].scale === 'Time' ? 0 : _this49["".concat(xAxis, "Axis")].bandwidth() / 2;
8570
- return _this49["".concat(xAxis, "Axis")](_this49.parseX(d.x.value)) + adjustment;
8617
+ var adjustment = _this50.options.data[xAxis].scale === 'Time' ? 0 : _this50["".concat(xAxis, "Axis")].bandwidth() / 2;
8618
+ return _this50["".concat(xAxis, "Axis")](_this50.parseX(d.x.value)) + adjustment;
8571
8619
  }).y(function (d) {
8572
- return _this49["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
8573
- }).curve(d3[curveStyle || _this49.options.curveStyle]);
8620
+ return _this50["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
8621
+ }).curve(d3[curveStyle || _this50.options.curveStyle]);
8574
8622
  };
8575
8623
 
8576
8624
  var xAxis = 'bottom';
@@ -8614,14 +8662,14 @@ var WebsyChart = /*#__PURE__*/function () {
8614
8662
  }, {
8615
8663
  key: "rendersymbol",
8616
8664
  value: function rendersymbol(series, index) {
8617
- var _this50 = this;
8665
+ var _this51 = this;
8618
8666
 
8619
8667
  /* global d3 series index series.key */
8620
8668
  var drawSymbol = function drawSymbol(size) {
8621
8669
  return d3.symbol() // .type(d => {
8622
8670
  // return d3.symbols[0]
8623
8671
  // })
8624
- .size(size || _this50.options.symbolSize);
8672
+ .size(size || _this51.options.symbolSize);
8625
8673
  };
8626
8674
 
8627
8675
  var xAxis = 'bottomAxis';
@@ -8639,7 +8687,7 @@ var WebsyChart = /*#__PURE__*/function () {
8639
8687
  symbols.attr('d', function (d) {
8640
8688
  return drawSymbol(d.y.size || series.symbolSize)(d);
8641
8689
  }).transition(this.transition).attr('fill', 'white').attr('stroke', series.color).attr('transform', function (d) {
8642
- return "translate(".concat(_this50[xAxis](_this50.parseX(d.x.value)), ", ").concat(_this50[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8690
+ return "translate(".concat(_this51[xAxis](_this51.parseX(d.x.value)), ", ").concat(_this51[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8643
8691
  }); // Enter
8644
8692
 
8645
8693
  symbols.enter().append('path').attr('d', function (d) {
@@ -8648,7 +8696,7 @@ var WebsyChart = /*#__PURE__*/function () {
8648
8696
  .attr('fill', 'white').attr('stroke', series.color).attr('class', function (d) {
8649
8697
  return "symbol symbol_".concat(series.key);
8650
8698
  }).attr('transform', function (d) {
8651
- return "translate(".concat(_this50[xAxis](_this50.parseX(d.x.value)), ", ").concat(_this50[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8699
+ return "translate(".concat(_this51[xAxis](_this51.parseX(d.x.value)), ", ").concat(_this51[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8652
8700
  });
8653
8701
  }
8654
8702
  }, {
@@ -8803,7 +8851,7 @@ var WebsyLegend = /*#__PURE__*/function () {
8803
8851
  }, {
8804
8852
  key: "resize",
8805
8853
  value: function resize() {
8806
- var _this51 = this;
8854
+ var _this52 = this;
8807
8855
 
8808
8856
  var el = document.getElementById(this.elementId);
8809
8857
 
@@ -8816,7 +8864,7 @@ var WebsyLegend = /*#__PURE__*/function () {
8816
8864
  // }
8817
8865
  var html = "\n <div class='text-".concat(this.options.align, "'>\n ");
8818
8866
  html += this._data.map(function (d, i) {
8819
- return _this51.getLegendItemHTML(d);
8867
+ return _this52.getLegendItemHTML(d);
8820
8868
  }).join('');
8821
8869
  html += "\n <div>\n ";
8822
8870
  el.innerHTML = html;
@@ -8988,7 +9036,7 @@ var WebsyMap = /*#__PURE__*/function () {
8988
9036
  }, {
8989
9037
  key: "render",
8990
9038
  value: function render() {
8991
- var _this52 = this;
9039
+ var _this53 = this;
8992
9040
 
8993
9041
  var mapEl = document.getElementById("".concat(this.elementId, "_map"));
8994
9042
  var legendEl = document.getElementById("".concat(this.elementId, "_map"));
@@ -8997,7 +9045,7 @@ var WebsyMap = /*#__PURE__*/function () {
8997
9045
  var legendData = this.options.data.polygons.map(function (s, i) {
8998
9046
  return {
8999
9047
  value: s.label || s.key,
9000
- color: s.color || _this52.options.colors[i % _this52.options.colors.length]
9048
+ color: s.color || _this53.options.colors[i % _this53.options.colors.length]
9001
9049
  };
9002
9050
  });
9003
9051
  var longestValue = legendData.map(function (s) {
@@ -9061,7 +9109,7 @@ var WebsyMap = /*#__PURE__*/function () {
9061
9109
 
9062
9110
  if (this.polygons) {
9063
9111
  this.polygons.forEach(function (p) {
9064
- return _this52.map.removeLayer(p);
9112
+ return _this53.map.removeLayer(p);
9065
9113
  });
9066
9114
  }
9067
9115
 
@@ -9119,18 +9167,18 @@ var WebsyMap = /*#__PURE__*/function () {
9119
9167
  }
9120
9168
 
9121
9169
  if (!p.options.color) {
9122
- p.options.color = _this52.options.colors[i % _this52.options.colors.length];
9170
+ p.options.color = _this53.options.colors[i % _this53.options.colors.length];
9123
9171
  }
9124
9172
 
9125
9173
  var pol = L.polygon(p.data.map(function (c) {
9126
9174
  return c.map(function (d) {
9127
9175
  return [d.Latitude, d.Longitude];
9128
9176
  });
9129
- }), p.options).addTo(_this52.map);
9177
+ }), p.options).addTo(_this53.map);
9130
9178
 
9131
- _this52.polygons.push(pol);
9179
+ _this53.polygons.push(pol);
9132
9180
 
9133
- _this52.map.fitBounds(pol.getBounds());
9181
+ _this53.map.fitBounds(pol.getBounds());
9134
9182
  });
9135
9183
  } // if (this.data.markers.length > 0) {
9136
9184
  // el.classList.remove('hidden')
@@ -9310,7 +9358,7 @@ function recaptchaReadyCallBack() {
9310
9358
 
9311
9359
  function useGoogleRecaptcha(key) {
9312
9360
  var rcs = document.createElement('script');
9313
- rcs.src = "//www.google.com/recaptcha/api.js?render=".concat(key);
9361
+ rcs.src = "//www.google.com/recaptcha/api.js";
9314
9362
  document.body.appendChild(rcs);
9315
9363
  }
9316
9364