@websy/websy-designs 1.4.15 → 1.4.17

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.
@@ -276,7 +276,7 @@ var ButtonGroup = /*#__PURE__*/function () {
276
276
  this.options.activeItem = index;
277
277
 
278
278
  if (this.options.onActivate) {
279
- this.options.onActivate(this.options.items[index], index);
279
+ this.options.onActivate(this.options.items[index], index, event);
280
280
  }
281
281
 
282
282
  var el = document.getElementById(this.elementId);
@@ -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
  });
@@ -2954,6 +2982,13 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2954
2982
  if (item.hasChildren === true) {
2955
2983
  event.target.classList.toggle('menu-open');
2956
2984
  this.toggleMenu(item.id);
2985
+ } else {
2986
+ var el = document.getElementById(this.elementId);
2987
+ var allEls = el.querySelectorAll('.websy-menu-header');
2988
+ Array.from(allEls).forEach(function (e) {
2989
+ return e.classList.remove('active');
2990
+ });
2991
+ event.target.classList.add('active');
2957
2992
  }
2958
2993
  }
2959
2994
 
@@ -2964,11 +2999,11 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2964
2999
  }, {
2965
3000
  key: "handleSearch",
2966
3001
  value: function handleSearch(searchText) {
2967
- var _this18 = this;
3002
+ var _this19 = this;
2968
3003
 
2969
3004
  var el = document.getElementById(this.elementId);
2970
3005
  var lowestItems = this.flatItems.filter(function (d) {
2971
- return d.level === _this18.maxLevel;
3006
+ return d.level === _this19.maxLevel;
2972
3007
  });
2973
3008
  var visibleItems = lowestItems;
2974
3009
  var defaultMethod = 'remove';
@@ -2976,7 +3011,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2976
3011
  if (searchText && searchText.length > 1) {
2977
3012
  defaultMethod = 'add';
2978
3013
  visibleItems = lowestItems.filter(function (d) {
2979
- return d[_this18.options.searchProp].toLowerCase().indexOf(searchText.toLowerCase()) !== -1;
3014
+ return d[_this19.options.searchProp].toLowerCase().indexOf(searchText.toLowerCase()) !== -1;
2980
3015
  });
2981
3016
  } // hide everything
2982
3017
 
@@ -3053,7 +3088,24 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
3053
3088
  html += "</div>";
3054
3089
  }
3055
3090
 
3056
- el.innerHTML = html;
3091
+ el.innerHTML = html; // open the menu if an item is set as 'active'
3092
+
3093
+ var activeEl = el.querySelector('.websy-menu-header.active');
3094
+
3095
+ if (activeEl) {
3096
+ var parent = activeEl.parentElement;
3097
+
3098
+ while (parent) {
3099
+ if (parent.tagName === 'UL') {
3100
+ parent.classList.remove('websy-menu-collapsed');
3101
+ parent = parent.parentElement;
3102
+ } else if (parent.tagName === 'LI') {
3103
+ parent = parent.parentElement;
3104
+ } else {
3105
+ parent = null;
3106
+ }
3107
+ }
3108
+ }
3057
3109
 
3058
3110
  if (this.options.enableSearch === true) {
3059
3111
  this.search = new WebsyDesigns.Search("".concat(this.elementId, "_search"), _extends({}, {
@@ -3088,7 +3140,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
3088
3140
  items[i].classes = items[i].classes.join(' ');
3089
3141
  }
3090
3142
 
3091
- html += "\n\t\t\t<li class='websy-".concat(this.options.orientation, "-list-item ").concat(items[i].alwaysOpen === true ? 'always-open' : '', "'>\n\t\t\t\t<div class='websy-menu-header ").concat(items[i].classes || '', " ").concat(selected, " ").concat(active, "' \n id='").concat(blockId, "' \n data-id='").concat(currentBlock, "'\n data-path='").concat(items[i].path, "'\n data-menu-id='").concat(this.elementId, "_").concat(currentBlock, "_list'\n data-popout-id='").concat(level > 1 ? block : currentBlock, "'\n data-text='").concat(items[i].isLink !== true ? items[i].text : '', "'\n style='padding-left: ").concat(level * this.options.childIndentation, "px'\n ").concat(items[i].attributes && items[i].attributes.join(' ') || '', "\n >\n ");
3143
+ html += "\n\t\t\t<li class='websy-".concat(this.options.orientation, "-list-item ").concat(items[i].alwaysOpen === true ? 'always-open' : '', "'>\n\t\t\t\t<div class='websy-menu-header websy-menu-level-").concat(level, " ").concat(items[i].classes || '', " ").concat(selected, " ").concat(active, "' \n id='").concat(blockId, "' \n data-id='").concat(currentBlock, "'\n data-path='").concat(items[i].path, "'\n data-menu-id='").concat(this.elementId, "_").concat(currentBlock, "_list'\n data-popout-id='").concat(level > 1 ? block : currentBlock, "'\n data-text='").concat(items[i].isLink !== true ? items[i].text : '', "'\n style='padding-left: ").concat(level * this.options.childIndentation, "px'\n ").concat(items[i].attributes && items[i].attributes.join(' ') || '', "\n >\n ");
3092
3144
 
3093
3145
  if (this.options.orientation === 'horizontal') {
3094
3146
  html += items[i].text;
@@ -3180,7 +3232,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
3180
3232
 
3181
3233
  var Pager = /*#__PURE__*/function () {
3182
3234
  function Pager(elementId, options) {
3183
- var _this19 = this;
3235
+ var _this20 = this;
3184
3236
 
3185
3237
  _classCallCheck(this, Pager);
3186
3238
 
@@ -3233,8 +3285,8 @@ var Pager = /*#__PURE__*/function () {
3233
3285
  allowClear: false,
3234
3286
  disableSearch: true,
3235
3287
  onItemSelected: function onItemSelected(selectedItem) {
3236
- if (_this19.options.onChangePageSize) {
3237
- _this19.options.onChangePageSize(selectedItem.value);
3288
+ if (_this20.options.onChangePageSize) {
3289
+ _this20.options.onChangePageSize(selectedItem.value);
3238
3290
  }
3239
3291
  }
3240
3292
  });
@@ -3258,13 +3310,13 @@ var Pager = /*#__PURE__*/function () {
3258
3310
  }, {
3259
3311
  key: "render",
3260
3312
  value: function render() {
3261
- var _this20 = this;
3313
+ var _this21 = this;
3262
3314
 
3263
3315
  var el = document.getElementById("".concat(this.elementId, "_pageList"));
3264
3316
 
3265
3317
  if (el) {
3266
3318
  var pages = this.options.pages.map(function (item, index) {
3267
- return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(_this20.options.activePage === index ? 'active' : '', "\">").concat(index + 1, "</li>");
3319
+ return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(_this21.options.activePage === index ? 'active' : '', "\">").concat(index + 1, "</li>");
3268
3320
  });
3269
3321
  var startIndex = 0;
3270
3322
 
@@ -3332,58 +3384,58 @@ var WebsyPDFButton = /*#__PURE__*/function () {
3332
3384
  _createClass(WebsyPDFButton, [{
3333
3385
  key: "handleClick",
3334
3386
  value: function handleClick(event) {
3335
- var _this21 = this;
3387
+ var _this22 = this;
3336
3388
 
3337
3389
  if (event.target.classList.contains('websy-pdf-button')) {
3338
3390
  this.loader.show();
3339
3391
  setTimeout(function () {
3340
- if (_this21.options.targetId) {
3341
- var el = document.getElementById(_this21.options.targetId);
3392
+ if (_this22.options.targetId) {
3393
+ var el = document.getElementById(_this22.options.targetId);
3342
3394
 
3343
3395
  if (el) {
3344
3396
  var pdfData = {
3345
3397
  options: {}
3346
3398
  };
3347
3399
 
3348
- if (_this21.options.pdfOptions) {
3349
- pdfData.options = _extends({}, _this21.options.pdfOptions);
3400
+ if (_this22.options.pdfOptions) {
3401
+ pdfData.options = _extends({}, _this22.options.pdfOptions);
3350
3402
  }
3351
3403
 
3352
- if (_this21.options.header) {
3353
- if (_this21.options.header.elementId) {
3354
- var headerEl = document.getElementById(_this21.options.header.elementId);
3404
+ if (_this22.options.header) {
3405
+ if (_this22.options.header.elementId) {
3406
+ var headerEl = document.getElementById(_this22.options.header.elementId);
3355
3407
 
3356
3408
  if (headerEl) {
3357
3409
  pdfData.header = headerEl.outerHTML;
3358
3410
 
3359
- if (_this21.options.header.css) {
3360
- pdfData.options.headerCSS = _this21.options.header.css;
3411
+ if (_this22.options.header.css) {
3412
+ pdfData.options.headerCSS = _this22.options.header.css;
3361
3413
  }
3362
3414
  }
3363
- } else if (_this21.options.header.html) {
3364
- pdfData.header = _this21.options.header.html;
3415
+ } else if (_this22.options.header.html) {
3416
+ pdfData.header = _this22.options.header.html;
3365
3417
 
3366
- if (_this21.options.header.css) {
3367
- pdfData.options.headerCSS = _this21.options.header.css;
3418
+ if (_this22.options.header.css) {
3419
+ pdfData.options.headerCSS = _this22.options.header.css;
3368
3420
  }
3369
3421
  } else {
3370
- pdfData.header = _this21.options.header;
3422
+ pdfData.header = _this22.options.header;
3371
3423
  }
3372
3424
  }
3373
3425
 
3374
- if (_this21.options.footer) {
3375
- if (_this21.options.footer.elementId) {
3376
- var footerEl = document.getElementById(_this21.options.footer.elementId);
3426
+ if (_this22.options.footer) {
3427
+ if (_this22.options.footer.elementId) {
3428
+ var footerEl = document.getElementById(_this22.options.footer.elementId);
3377
3429
 
3378
3430
  if (footerEl) {
3379
3431
  pdfData.footer = footerEl.outerHTML;
3380
3432
 
3381
- if (_this21.options.footer.css) {
3382
- pdfData.options.footerCSS = _this21.options.footer.css;
3433
+ if (_this22.options.footer.css) {
3434
+ pdfData.options.footerCSS = _this22.options.footer.css;
3383
3435
  }
3384
3436
  }
3385
3437
  } else {
3386
- pdfData.footer = _this21.options.footer;
3438
+ pdfData.footer = _this22.options.footer;
3387
3439
  }
3388
3440
  }
3389
3441
 
@@ -3392,31 +3444,31 @@ var WebsyPDFButton = /*#__PURE__*/function () {
3392
3444
  // document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
3393
3445
  // document.getElementById(`${this.elementId}_form`).submit()
3394
3446
 
3395
- _this21.service.add('', pdfData, {
3447
+ _this22.service.add('', pdfData, {
3396
3448
  responseType: 'blob'
3397
3449
  }).then(function (response) {
3398
- _this21.loader.hide();
3450
+ _this22.loader.hide();
3399
3451
 
3400
3452
  var blob = new Blob([response], {
3401
3453
  type: 'application/pdf'
3402
3454
  });
3403
3455
  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 ");
3404
3456
 
3405
- if (_this21.options.directDownload === true) {
3457
+ if (_this22.options.directDownload === true) {
3406
3458
  var fileName;
3407
3459
 
3408
- if (typeof _this21.options.fileName === 'function') {
3409
- fileName = _this21.options.fileName() || 'Export';
3460
+ if (typeof _this22.options.fileName === 'function') {
3461
+ fileName = _this22.options.fileName() || 'Export';
3410
3462
  } else {
3411
- fileName = _this21.options.fileName || 'Export';
3463
+ fileName = _this22.options.fileName || 'Export';
3412
3464
  }
3413
3465
 
3414
3466
  msg += "download='".concat(fileName, ".pdf'");
3415
3467
  }
3416
3468
 
3417
- msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this21.options.buttonText, "</button>\n </a>\n </div>\n ");
3469
+ msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this22.options.buttonText, "</button>\n </a>\n </div>\n ");
3418
3470
 
3419
- _this21.popup.show({
3471
+ _this22.popup.show({
3420
3472
  message: msg,
3421
3473
  mask: true
3422
3474
  });
@@ -3617,7 +3669,7 @@ var WebsyPubSub = /*#__PURE__*/function () {
3617
3669
 
3618
3670
  var ResponsiveText = /*#__PURE__*/function () {
3619
3671
  function ResponsiveText(elementId, options) {
3620
- var _this22 = this;
3672
+ var _this23 = this;
3621
3673
 
3622
3674
  _classCallCheck(this, ResponsiveText);
3623
3675
 
@@ -3630,7 +3682,7 @@ var ResponsiveText = /*#__PURE__*/function () {
3630
3682
  this.elementId = elementId;
3631
3683
  this.canvas = document.createElement('canvas');
3632
3684
  window.addEventListener('resize', function () {
3633
- return _this22.render();
3685
+ return _this23.render();
3634
3686
  });
3635
3687
  var el = document.getElementById(this.elementId);
3636
3688
 
@@ -3849,7 +3901,7 @@ var ResponsiveText = /*#__PURE__*/function () {
3849
3901
 
3850
3902
  var WebsyResultList = /*#__PURE__*/function () {
3851
3903
  function WebsyResultList(elementId, options) {
3852
- var _this23 = this;
3904
+ var _this24 = this;
3853
3905
 
3854
3906
  _classCallCheck(this, WebsyResultList);
3855
3907
 
@@ -3881,9 +3933,9 @@ var WebsyResultList = /*#__PURE__*/function () {
3881
3933
 
3882
3934
  if (_typeof(options.template) === 'object' && options.template.url) {
3883
3935
  this.templateService.get(options.template.url).then(function (templateString) {
3884
- _this23.options.template = templateString;
3936
+ _this24.options.template = templateString;
3885
3937
 
3886
- _this23.render();
3938
+ _this24.render();
3887
3939
  });
3888
3940
  } else {
3889
3941
  this.render();
@@ -3903,7 +3955,7 @@ var WebsyResultList = /*#__PURE__*/function () {
3903
3955
  }, {
3904
3956
  key: "buildHTML",
3905
3957
  value: function buildHTML(d) {
3906
- var _this24 = this;
3958
+ var _this25 = this;
3907
3959
 
3908
3960
  var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3909
3961
  var inputTemplate = arguments.length > 2 ? arguments[2] : undefined;
@@ -3913,7 +3965,7 @@ var WebsyResultList = /*#__PURE__*/function () {
3913
3965
  if (this.options.template) {
3914
3966
  if (d.length > 0) {
3915
3967
  d.forEach(function (row, ix) {
3916
- var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate || _this24.options.template).concat(ix < d.length - 1 ? '<!--' : ''); // find conditional elements
3968
+ var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate || _this25.options.template).concat(ix < d.length - 1 ? '<!--' : ''); // find conditional elements
3917
3969
 
3918
3970
  var ifMatches = _toConsumableArray(template.matchAll(/<\s*if[^>]*>([\s\S]*?)<\s*\/\s*if>/g));
3919
3971
 
@@ -4018,7 +4070,7 @@ var WebsyResultList = /*#__PURE__*/function () {
4018
4070
  parts.forEach(function (p) {
4019
4071
  items = items[p];
4020
4072
  });
4021
- template = template.replace(m[0], _this24.buildHTML(items, 0, withoutFor, [].concat(_toConsumableArray(locator), ["".concat(startIndex + ix, ":").concat(c)])));
4073
+ template = template.replace(m[0], _this25.buildHTML(items, 0, withoutFor, [].concat(_toConsumableArray(locator), ["".concat(startIndex + ix, ":").concat(c)])));
4022
4074
  }
4023
4075
  });
4024
4076
 
@@ -4030,7 +4082,7 @@ var WebsyResultList = /*#__PURE__*/function () {
4030
4082
  }
4031
4083
  });
4032
4084
 
4033
- var flatRow = _this24.flattenObject(row);
4085
+ var flatRow = _this25.flattenObject(row);
4034
4086
 
4035
4087
  for (var key in flatRow) {
4036
4088
  var rg = new RegExp("{".concat(key, "}"), 'gm');
@@ -4165,13 +4217,13 @@ var WebsyResultList = /*#__PURE__*/function () {
4165
4217
  }, {
4166
4218
  key: "render",
4167
4219
  value: function render() {
4168
- var _this25 = this;
4220
+ var _this26 = this;
4169
4221
 
4170
4222
  if (this.options.entity) {
4171
4223
  this.apiService.get(this.options.entity).then(function (results) {
4172
- _this25.rows = results.rows;
4224
+ _this26.rows = results.rows;
4173
4225
 
4174
- _this25.resize();
4226
+ _this26.resize();
4175
4227
  });
4176
4228
  } else {
4177
4229
  this.resize();
@@ -4257,14 +4309,14 @@ var WebsyRouter = /*#__PURE__*/function () {
4257
4309
  _createClass(WebsyRouter, [{
4258
4310
  key: "addGroup",
4259
4311
  value: function addGroup(group) {
4260
- var _this26 = this;
4312
+ var _this27 = this;
4261
4313
 
4262
4314
  if (!this.groups[group]) {
4263
4315
  var els = document.querySelectorAll(".websy-view[data-group=\"".concat(group, "\"]"));
4264
4316
 
4265
4317
  if (els) {
4266
4318
  this.getClosestParent(els[0], function (parent) {
4267
- _this26.groups[group] = {
4319
+ _this27.groups[group] = {
4268
4320
  activeView: '',
4269
4321
  views: [],
4270
4322
  parent: parent.getAttribute('data-view')
@@ -4327,7 +4379,7 @@ var WebsyRouter = /*#__PURE__*/function () {
4327
4379
  }, {
4328
4380
  key: "removeUrlParams",
4329
4381
  value: function removeUrlParams() {
4330
- var _this27 = this;
4382
+ var _this28 = this;
4331
4383
 
4332
4384
  var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
4333
4385
  var reloadView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -4341,7 +4393,7 @@ var WebsyRouter = /*#__PURE__*/function () {
4341
4393
 
4342
4394
  if (this.currentParams && this.currentParams.items) {
4343
4395
  params.forEach(function (p) {
4344
- delete _this27.currentParams.items[p];
4396
+ delete _this28.currentParams.items[p];
4345
4397
  });
4346
4398
  path = this.buildUrlPath(this.currentParams.items);
4347
4399
  }
@@ -4705,12 +4757,12 @@ var WebsyRouter = /*#__PURE__*/function () {
4705
4757
  }, {
4706
4758
  key: "showComponents",
4707
4759
  value: function showComponents(view) {
4708
- var _this28 = this;
4760
+ var _this29 = this;
4709
4761
 
4710
4762
  if (this.options.views && this.options.views[view] && this.options.views[view].components) {
4711
4763
  this.options.views[view].components.forEach(function (c) {
4712
4764
  if (typeof c.instance === 'undefined') {
4713
- _this28.prepComponent(c.elementId, c.options);
4765
+ _this29.prepComponent(c.elementId, c.options);
4714
4766
 
4715
4767
  c.instance = new c.Component(c.elementId, c.options);
4716
4768
  } else if (c.instance.render) {
@@ -5065,7 +5117,7 @@ var WebsySearch = /*#__PURE__*/function () {
5065
5117
  }, {
5066
5118
  key: "handleKeyUp",
5067
5119
  value: function handleKeyUp(event) {
5068
- var _this29 = this;
5120
+ var _this30 = this;
5069
5121
 
5070
5122
  if (event.target.classList.contains('websy-search-input')) {
5071
5123
  if (this.searchTimeoutFn) {
@@ -5084,8 +5136,8 @@ var WebsySearch = /*#__PURE__*/function () {
5084
5136
 
5085
5137
  if (event.target.value.length >= this.options.minLength) {
5086
5138
  this.searchTimeoutFn = setTimeout(function () {
5087
- if (_this29.options.onSearch) {
5088
- _this29.options.onSearch(event.target.value);
5139
+ if (_this30.options.onSearch) {
5140
+ _this30.options.onSearch(event.target.value);
5089
5141
  }
5090
5142
  }, this.options.searchTimeout);
5091
5143
  } else {
@@ -5247,7 +5299,7 @@ var Switch = /*#__PURE__*/function () {
5247
5299
 
5248
5300
  var WebsyTemplate = /*#__PURE__*/function () {
5249
5301
  function WebsyTemplate(elementId, options) {
5250
- var _this30 = this;
5302
+ var _this31 = this;
5251
5303
 
5252
5304
  _classCallCheck(this, WebsyTemplate);
5253
5305
 
@@ -5273,9 +5325,9 @@ var WebsyTemplate = /*#__PURE__*/function () {
5273
5325
 
5274
5326
  if (_typeof(options.template) === 'object' && options.template.url) {
5275
5327
  this.templateService.get(options.template.url).then(function (templateString) {
5276
- _this30.options.template = templateString;
5328
+ _this31.options.template = templateString;
5277
5329
 
5278
- _this30.render();
5330
+ _this31.render();
5279
5331
  });
5280
5332
  } else {
5281
5333
  this.render();
@@ -5285,7 +5337,7 @@ var WebsyTemplate = /*#__PURE__*/function () {
5285
5337
  _createClass(WebsyTemplate, [{
5286
5338
  key: "buildHTML",
5287
5339
  value: function buildHTML() {
5288
- var _this31 = this;
5340
+ var _this32 = this;
5289
5341
 
5290
5342
  var html = "";
5291
5343
 
@@ -5347,14 +5399,14 @@ var WebsyTemplate = /*#__PURE__*/function () {
5347
5399
  }
5348
5400
 
5349
5401
  if (polarity === true) {
5350
- if (typeof _this31.options.data[parts[0]] !== 'undefined' && _this31.options.data[parts[0]] === parts[1]) {
5402
+ if (typeof _this32.options.data[parts[0]] !== 'undefined' && _this32.options.data[parts[0]] === parts[1]) {
5351
5403
  // remove the <if> tags
5352
5404
  removeAll = false;
5353
5405
  } else if (parts[0] === parts[1]) {
5354
5406
  removeAll = false;
5355
5407
  }
5356
5408
  } else if (polarity === false) {
5357
- if (typeof _this31.options.data[parts[0]] !== 'undefined' && _this31.options.data[parts[0]] !== parts[1]) {
5409
+ if (typeof _this32.options.data[parts[0]] !== 'undefined' && _this32.options.data[parts[0]] !== parts[1]) {
5358
5410
  // remove the <if> tags
5359
5411
  removeAll = false;
5360
5412
  }
@@ -5644,7 +5696,7 @@ var WebsyUtils = {
5644
5696
 
5645
5697
  var WebsyTable = /*#__PURE__*/function () {
5646
5698
  function WebsyTable(elementId, options) {
5647
- var _this32 = this;
5699
+ var _this33 = this;
5648
5700
 
5649
5701
  _classCallCheck(this, WebsyTable);
5650
5702
 
@@ -5682,8 +5734,8 @@ var WebsyTable = /*#__PURE__*/function () {
5682
5734
  allowClear: false,
5683
5735
  disableSearch: true,
5684
5736
  onItemSelected: function onItemSelected(selectedItem) {
5685
- if (_this32.options.onChangePageSize) {
5686
- _this32.options.onChangePageSize(selectedItem.value);
5737
+ if (_this33.options.onChangePageSize) {
5738
+ _this33.options.onChangePageSize(selectedItem.value);
5687
5739
  }
5688
5740
  }
5689
5741
  });
@@ -5704,7 +5756,7 @@ var WebsyTable = /*#__PURE__*/function () {
5704
5756
  _createClass(WebsyTable, [{
5705
5757
  key: "appendRows",
5706
5758
  value: function appendRows(data) {
5707
- var _this33 = this;
5759
+ var _this34 = this;
5708
5760
 
5709
5761
  this.hideError();
5710
5762
  var bodyHTML = '';
@@ -5712,15 +5764,15 @@ var WebsyTable = /*#__PURE__*/function () {
5712
5764
  if (data) {
5713
5765
  bodyHTML += data.map(function (r, rowIndex) {
5714
5766
  return '<tr>' + r.map(function (c, i) {
5715
- if (_this33.options.columns[i].show !== false) {
5767
+ if (_this34.options.columns[i].show !== false) {
5716
5768
  var style = '';
5717
5769
 
5718
5770
  if (c.style) {
5719
5771
  style += c.style;
5720
5772
  }
5721
5773
 
5722
- if (_this33.options.columns[i].width) {
5723
- style += "width: ".concat(_this33.options.columns[i].width, "; ");
5774
+ if (_this34.options.columns[i].width) {
5775
+ style += "width: ".concat(_this34.options.columns[i].width, "; ");
5724
5776
  }
5725
5777
 
5726
5778
  if (c.backgroundColor) {
@@ -5735,18 +5787,18 @@ var WebsyTable = /*#__PURE__*/function () {
5735
5787
  style += "color: ".concat(c.color, "; ");
5736
5788
  }
5737
5789
 
5738
- if (_this33.options.columns[i].showAsLink === true && c.value.trim() !== '') {
5739
- 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 ");
5740
- } else if ((_this33.options.columns[i].showAsNavigatorLink === true || _this33.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
5741
- 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 ");
5790
+ if (_this34.options.columns[i].showAsLink === true && c.value.trim() !== '') {
5791
+ 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 ");
5792
+ } else if ((_this34.options.columns[i].showAsNavigatorLink === true || _this34.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
5793
+ 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 ");
5742
5794
  } else {
5743
5795
  var info = c.value;
5744
5796
 
5745
- if (_this33.options.columns[i].showAsImage === true) {
5797
+ if (_this34.options.columns[i].showAsImage === true) {
5746
5798
  c.value = "\n <img src='".concat(c.value, "'>\n ");
5747
5799
  }
5748
5800
 
5749
- 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 ");
5801
+ 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 ");
5750
5802
  }
5751
5803
  }
5752
5804
  }).join('') + '</tr>';
@@ -5918,7 +5970,7 @@ var WebsyTable = /*#__PURE__*/function () {
5918
5970
  }, {
5919
5971
  key: "render",
5920
5972
  value: function render(data) {
5921
- var _this34 = this;
5973
+ var _this35 = this;
5922
5974
 
5923
5975
  if (!this.options.columns) {
5924
5976
  return;
@@ -5953,7 +6005,7 @@ var WebsyTable = /*#__PURE__*/function () {
5953
6005
  style += "width: ".concat(c.width || 'auto', ";");
5954
6006
  }
5955
6007
 
5956
- 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 ");
6008
+ 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 ");
5957
6009
  }
5958
6010
  }).join('') + '</tr>';
5959
6011
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
@@ -5972,7 +6024,7 @@ var WebsyTable = /*#__PURE__*/function () {
5972
6024
 
5973
6025
  if (pagingEl) {
5974
6026
  var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
5975
- return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this34.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
6027
+ return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this35.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
5976
6028
  });
5977
6029
  var startIndex = 0;
5978
6030
 
@@ -6040,7 +6092,7 @@ var WebsyTable = /*#__PURE__*/function () {
6040
6092
 
6041
6093
  var WebsyTable2 = /*#__PURE__*/function () {
6042
6094
  function WebsyTable2(elementId, options) {
6043
- var _this35 = this;
6095
+ var _this36 = this;
6044
6096
 
6045
6097
  _classCallCheck(this, WebsyTable2);
6046
6098
 
@@ -6081,8 +6133,8 @@ var WebsyTable2 = /*#__PURE__*/function () {
6081
6133
  allowClear: false,
6082
6134
  disableSearch: true,
6083
6135
  onItemSelected: function onItemSelected(selectedItem) {
6084
- if (_this35.options.onChangePageSize) {
6085
- _this35.options.onChangePageSize(selectedItem.value);
6136
+ if (_this36.options.onChangePageSize) {
6137
+ _this36.options.onChangePageSize(selectedItem.value);
6086
6138
  }
6087
6139
  }
6088
6140
  });
@@ -6106,7 +6158,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6106
6158
  _createClass(WebsyTable2, [{
6107
6159
  key: "appendRows",
6108
6160
  value: function appendRows(data) {
6109
- var _this36 = this;
6161
+ var _this37 = this;
6110
6162
 
6111
6163
  this.hideError();
6112
6164
  var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
@@ -6115,15 +6167,15 @@ var WebsyTable2 = /*#__PURE__*/function () {
6115
6167
  if (data) {
6116
6168
  bodyHTML += data.map(function (r, rowIndex) {
6117
6169
  return '<tr>' + r.map(function (c, i) {
6118
- if (_this36.options.columns[i].show !== false) {
6119
- var style = "height: ".concat(_this36.options.cellSize, "px; line-height: ").concat(_this36.options.cellSize, "px;");
6170
+ if (_this37.options.columns[i].show !== false) {
6171
+ var style = "height: ".concat(_this37.options.cellSize, "px; line-height: ").concat(_this37.options.cellSize, "px;");
6120
6172
 
6121
6173
  if (c.style) {
6122
6174
  style += c.style;
6123
6175
  }
6124
6176
 
6125
- if (_this36.options.columns[i].width) {
6126
- style += "width: ".concat(_this36.options.columns[i].width, "; ");
6177
+ if (_this37.options.columns[i].width) {
6178
+ style += "width: ".concat(_this37.options.columns[i].width, "; ");
6127
6179
  }
6128
6180
 
6129
6181
  if (c.backgroundColor) {
@@ -6138,18 +6190,18 @@ var WebsyTable2 = /*#__PURE__*/function () {
6138
6190
  style += "color: ".concat(c.color, "; ");
6139
6191
  }
6140
6192
 
6141
- if (_this36.options.columns[i].showAsLink === true && c.value.trim() !== '') {
6142
- 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 ");
6143
- } else if ((_this36.options.columns[i].showAsNavigatorLink === true || _this36.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
6144
- 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 ");
6193
+ if (_this37.options.columns[i].showAsLink === true && c.value.trim() !== '') {
6194
+ 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 ");
6195
+ } else if ((_this37.options.columns[i].showAsNavigatorLink === true || _this37.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
6196
+ 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 ");
6145
6197
  } else {
6146
6198
  var info = c.value;
6147
6199
 
6148
- if (_this36.options.columns[i].showAsImage === true) {
6200
+ if (_this37.options.columns[i].showAsImage === true) {
6149
6201
  c.value = "\n <img src='".concat(c.value, "'>\n ");
6150
6202
  }
6151
6203
 
6152
- 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 ");
6204
+ 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 ");
6153
6205
  }
6154
6206
  }
6155
6207
  }).join('') + '</tr>';
@@ -6412,7 +6464,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6412
6464
  }, {
6413
6465
  key: "render",
6414
6466
  value: function render(data) {
6415
- var _this37 = this;
6467
+ var _this38 = this;
6416
6468
 
6417
6469
  if (!this.options.columns) {
6418
6470
  return;
@@ -6448,7 +6500,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6448
6500
  style += "width: ".concat(c.width || 'auto', "; ");
6449
6501
  }
6450
6502
 
6451
- 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 ");
6503
+ 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 ");
6452
6504
  }
6453
6505
  }).join('') + '</tr>';
6454
6506
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
@@ -6459,7 +6511,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6459
6511
  var dropdownHTML = "";
6460
6512
  this.options.columns.forEach(function (c, i) {
6461
6513
  if (c.searchable && c.searchField) {
6462
- dropdownHTML += "\n <div id=\"".concat(_this37.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
6514
+ dropdownHTML += "\n <div id=\"".concat(_this38.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
6463
6515
  }
6464
6516
  });
6465
6517
  dropdownEl.innerHTML = dropdownHTML;
@@ -6481,7 +6533,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6481
6533
 
6482
6534
  if (pagingEl) {
6483
6535
  var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
6484
- return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this37.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
6536
+ return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this38.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
6485
6537
  });
6486
6538
  var startIndex = 0;
6487
6539
 
@@ -6572,7 +6624,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6572
6624
  }, {
6573
6625
  key: "getColumnParameters",
6574
6626
  value: function getColumnParameters(values) {
6575
- var _this38 = this;
6627
+ var _this39 = this;
6576
6628
 
6577
6629
  var tableEl = document.getElementById("".concat(this.elementId, "_table"));
6578
6630
  tableEl.style.tableLayout = 'auto';
@@ -6580,10 +6632,10 @@ var WebsyTable2 = /*#__PURE__*/function () {
6580
6632
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
6581
6633
  var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
6582
6634
  headEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c, i) {
6583
- 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 ");
6635
+ 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 ");
6584
6636
  }).join('') + '</tr>';
6585
6637
  bodyEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c) {
6586
- 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 ");
6638
+ 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 ");
6587
6639
  }).join('') + '</tr>'; // get height of the first data cell
6588
6640
 
6589
6641
  var cells = bodyEl.querySelectorAll("tr:first-of-type td");
@@ -6711,7 +6763,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6711
6763
  }, {
6712
6764
  key: "buildBodyHtml",
6713
6765
  value: function buildBodyHtml() {
6714
- var _this39 = this;
6766
+ var _this40 = this;
6715
6767
 
6716
6768
  var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6717
6769
  var useWidths = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
@@ -6770,7 +6822,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6770
6822
  } // console.log('rowspan', cell.rowspan)
6771
6823
 
6772
6824
 
6773
- 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) {
6825
+ 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) {
6774
6826
  // bodyHtml += `
6775
6827
  // style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
6776
6828
  // width='${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}'
@@ -6780,11 +6832,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
6780
6832
  bodyHtml += "\n ><div style='".concat(divStyle, "'>");
6781
6833
 
6782
6834
  if (cell.expandable === true) {
6783
- 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>");
6835
+ 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>");
6784
6836
  }
6785
6837
 
6786
6838
  if (cell.collapsable === true) {
6787
- 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>");
6839
+ 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>");
6788
6840
  }
6789
6841
 
6790
6842
  if (sizingColumns[sizeIndex].showAsLink === true && cell.value.trim() !== '') {
@@ -6809,7 +6861,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6809
6861
  }, {
6810
6862
  key: "buildHeaderHtml",
6811
6863
  value: function buildHeaderHtml() {
6812
- var _this40 = this;
6864
+ var _this41 = this;
6813
6865
 
6814
6866
  var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6815
6867
  var headerHtml = '';
@@ -6824,7 +6876,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6824
6876
  }
6825
6877
 
6826
6878
  this.options.columns.forEach(function (row, rowIndex) {
6827
- if (useWidths === false && rowIndex !== _this40.options.columns.length - 1) {
6879
+ if (useWidths === false && rowIndex !== _this41.options.columns.length - 1) {
6828
6880
  // if we're calculating the size we only want to render the last row of column headers
6829
6881
  return;
6830
6882
  }
@@ -6850,18 +6902,18 @@ var WebsyTable3 = /*#__PURE__*/function () {
6850
6902
  // `
6851
6903
  // }
6852
6904
 
6853
- headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ? _this40.buildSearchIcon(col, colIndex) : '', "</div></td>");
6905
+ headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ? _this41.buildSearchIcon(col, colIndex) : '', "</div></td>");
6854
6906
  });
6855
6907
  headerHtml += "</tr>";
6856
6908
  });
6857
6909
  var dropdownEl = document.getElementById("".concat(this.elementId, "_dropdownContainer"));
6858
6910
  this.options.columns[this.options.columns.length - 1].forEach(function (c, i) {
6859
6911
  if (c.searchable && c.isExternalSearch === true) {
6860
- var testEl = document.getElementById("".concat(_this40.elementId, "_columnSearch_").concat(c.dimId || i));
6912
+ var testEl = document.getElementById("".concat(_this41.elementId, "_columnSearch_").concat(c.dimId || i));
6861
6913
 
6862
6914
  if (!testEl) {
6863
6915
  var newE = document.createElement('div');
6864
- newE.id = "".concat(_this40.elementId, "_columnSearch_").concat(c.dimId || i);
6916
+ newE.id = "".concat(_this41.elementId, "_columnSearch_").concat(c.dimId || i);
6865
6917
  newE.className = 'websy-modal-dropdown';
6866
6918
  dropdownEl.appendChild(newE);
6867
6919
  }
@@ -6877,7 +6929,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6877
6929
  }, {
6878
6930
  key: "buildTotalHtml",
6879
6931
  value: function buildTotalHtml() {
6880
- var _this41 = this;
6932
+ var _this42 = this;
6881
6933
 
6882
6934
  var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6883
6935
 
@@ -6890,7 +6942,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6890
6942
  totalHtml += "<td \n class='websy-table-cell'\n colspan='".concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
6891
6943
 
6892
6944
  if (useWidths === true) {
6893
- 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 ");
6945
+ 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 ");
6894
6946
  }
6895
6947
 
6896
6948
  totalHtml += " \n >\n ".concat(col.value, "\n </td>");
@@ -6901,7 +6953,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6901
6953
  }, {
6902
6954
  key: "calculateSizes",
6903
6955
  value: function calculateSizes() {
6904
- var _this42 = this;
6956
+ var _this43 = this;
6905
6957
 
6906
6958
  var sample = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6907
6959
  var totalRowCount = arguments.length > 1 ? arguments[1] : undefined;
@@ -6944,32 +6996,32 @@ var WebsyTable3 = /*#__PURE__*/function () {
6944
6996
  rows.forEach(function (row, rowIndex) {
6945
6997
  Array.from(row.children).forEach(function (col, colIndex) {
6946
6998
  var colSize = col.getBoundingClientRect();
6947
- _this42.sizes.cellHeight = colSize.height;
6999
+ _this43.sizes.cellHeight = colSize.height;
6948
7000
 
6949
- if (_this42.options.columns[_this42.options.columns.length - 1][colIndex]) {
6950
- if (!_this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth) {
6951
- _this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth = 0;
7001
+ if (_this43.options.columns[_this43.options.columns.length - 1][colIndex]) {
7002
+ if (!_this43.options.columns[_this43.options.columns.length - 1][colIndex].actualWidth) {
7003
+ _this43.options.columns[_this43.options.columns.length - 1][colIndex].actualWidth = 0;
6952
7004
  }
6953
7005
 
6954
- _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);
6955
- _this42.options.columns[_this42.options.columns.length - 1][colIndex].cellHeight = colSize.height;
7006
+ _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);
7007
+ _this43.options.columns[_this43.options.columns.length - 1][colIndex].cellHeight = colSize.height;
6956
7008
 
6957
- if (colIndex >= _this42.pinnedColumns) {
6958
- firstNonPinnedColumnWidth = _this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth;
7009
+ if (colIndex >= _this43.pinnedColumns) {
7010
+ firstNonPinnedColumnWidth = _this43.options.columns[_this43.options.columns.length - 1][colIndex].actualWidth;
6959
7011
  }
6960
7012
  }
6961
7013
  });
6962
7014
  });
6963
7015
  this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
6964
- if (colIndex < _this42.pinnedColumns) {
6965
- _this42.sizes.scrollableWidth -= col.actualWidth;
7016
+ if (colIndex < _this43.pinnedColumns) {
7017
+ _this43.sizes.scrollableWidth -= col.actualWidth;
6966
7018
  }
6967
7019
  });
6968
7020
  this.sizes.totalWidth = this.options.columns[this.options.columns.length - 1].reduce(function (a, b) {
6969
7021
  return a + (b.width || b.actualWidth);
6970
7022
  }, 0);
6971
7023
  this.sizes.totalNonPinnedWidth = this.options.columns[this.options.columns.length - 1].filter(function (c, i) {
6972
- return i >= _this42.pinnedColumns;
7024
+ return i >= _this43.pinnedColumns;
6973
7025
  }).reduce(function (a, b) {
6974
7026
  return a + (b.width || b.actualWidth);
6975
7027
  }, 0);
@@ -6990,10 +7042,10 @@ var WebsyTable3 = /*#__PURE__*/function () {
6990
7042
  c.actualWidth += equalWidth; // }
6991
7043
  // }
6992
7044
 
6993
- _this42.sizes.totalWidth += c.width || c.actualWidth;
7045
+ _this43.sizes.totalWidth += c.width || c.actualWidth;
6994
7046
 
6995
- if (i < _this42.pinnedColumns) {
6996
- _this42.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
7047
+ if (i < _this43.pinnedColumns) {
7048
+ _this43.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
6997
7049
  } // equalWidth = (outerSize.width - this.sizes.totalWidth) / (this.options.columns[this.options.columns.length - 1].length - (i + 1))
6998
7050
 
6999
7051
  });
@@ -7050,7 +7102,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7050
7102
  }, {
7051
7103
  key: "createSample",
7052
7104
  value: function createSample(data) {
7053
- var _this43 = this;
7105
+ var _this44 = this;
7054
7106
 
7055
7107
  var output = [];
7056
7108
  this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
@@ -7062,7 +7114,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7062
7114
  var longest = '';
7063
7115
 
7064
7116
  for (var i = 0; i < Math.min(data.length, 1000); i++) {
7065
- if (data[i].length === _this43.options.columns[_this43.options.columns.length - 1].length) {
7117
+ if (data[i].length === _this44.options.columns[_this44.options.columns.length - 1].length) {
7066
7118
  if (longest.length < data[i][colIndex].value.length) {
7067
7119
  longest = data[i][colIndex].value;
7068
7120
  }
@@ -7457,7 +7509,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7457
7509
 
7458
7510
  var WebsyChart = /*#__PURE__*/function () {
7459
7511
  function WebsyChart(elementId, options) {
7460
- var _this44 = this;
7512
+ var _this45 = this;
7461
7513
 
7462
7514
  _classCallCheck(this, WebsyChart);
7463
7515
 
@@ -7508,22 +7560,22 @@ var WebsyChart = /*#__PURE__*/function () {
7508
7560
  this.invertOverride = function (input, input2) {
7509
7561
  var xAxis = 'bottomAxis';
7510
7562
 
7511
- if (_this44.options.orientation === 'horizontal') {
7563
+ if (_this45.options.orientation === 'horizontal') {
7512
7564
  xAxis = 'leftAxis';
7513
7565
  }
7514
7566
 
7515
- var width = _this44[xAxis].step();
7567
+ var width = _this45[xAxis].step();
7516
7568
 
7517
7569
  var output;
7518
7570
 
7519
- var domain = _toConsumableArray(_this44[xAxis].domain());
7571
+ var domain = _toConsumableArray(_this45[xAxis].domain());
7520
7572
 
7521
- if (_this44.options.orientation === 'horizontal') {
7573
+ if (_this45.options.orientation === 'horizontal') {
7522
7574
  domain = domain.reverse();
7523
7575
  }
7524
7576
 
7525
7577
  for (var j = 0; j < domain.length; j++) {
7526
- var breakA = _this44[xAxis](domain[j]) - width / 2;
7578
+ var breakA = _this45[xAxis](domain[j]) - width / 2;
7527
7579
  var breakB = breakA + width;
7528
7580
 
7529
7581
  if (input > breakA && input <= breakB) {
@@ -7623,10 +7675,10 @@ var WebsyChart = /*#__PURE__*/function () {
7623
7675
  }, {
7624
7676
  key: "handleEventMouseMove",
7625
7677
  value: function handleEventMouseMove(event, d) {
7626
- var _this45 = this;
7678
+ var _this46 = this;
7627
7679
 
7628
7680
  var bisectDate = d3.bisector(function (d) {
7629
- return _this45.parseX(d.x.value);
7681
+ return _this46.parseX(d.x.value);
7630
7682
  }).left;
7631
7683
 
7632
7684
  if (this.options.showTrackingLine === true && d3.pointer(event)) {
@@ -7665,8 +7717,8 @@ var WebsyChart = /*#__PURE__*/function () {
7665
7717
  }
7666
7718
 
7667
7719
  this.options.data.series.forEach(function (s) {
7668
- if (_this45.options.data[xData].scale !== 'Time') {
7669
- xPoint = _this45[xAxis](_this45.parseX(xLabel));
7720
+ if (_this46.options.data[xData].scale !== 'Time') {
7721
+ xPoint = _this46[xAxis](_this46.parseX(xLabel));
7670
7722
  s.data.forEach(function (d) {
7671
7723
  if (d.x.value === xLabel) {
7672
7724
  if (!tooltipTitle) {
@@ -7685,13 +7737,13 @@ var WebsyChart = /*#__PURE__*/function () {
7685
7737
  var pointA = s.data[index - 1];
7686
7738
  var pointB = s.data[index];
7687
7739
 
7688
- if (_this45.options.orientation === 'horizontal') {
7740
+ if (_this46.options.orientation === 'horizontal') {
7689
7741
  pointA = _toConsumableArray(s.data).reverse()[index - 1];
7690
7742
  pointB = _toConsumableArray(s.data).reverse()[index];
7691
7743
  }
7692
7744
 
7693
7745
  if (pointA && !pointB) {
7694
- xPoint = _this45[xAxis](_this45.parseX(pointA.x.value));
7746
+ xPoint = _this46[xAxis](_this46.parseX(pointA.x.value));
7695
7747
  tooltipTitle = pointA.x.value;
7696
7748
 
7697
7749
  if (!pointA.y.color) {
@@ -7701,12 +7753,12 @@ var WebsyChart = /*#__PURE__*/function () {
7701
7753
  tooltipData.push(pointA.y);
7702
7754
 
7703
7755
  if (typeof pointA.x.value.getTime !== 'undefined') {
7704
- tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointA.x.value);
7756
+ tooltipTitle = d3.timeFormat(_this46.options.dateFormat || _this46.options.calculatedTimeFormatPattern)(pointA.x.value);
7705
7757
  }
7706
7758
  }
7707
7759
 
7708
7760
  if (pointB && !pointA) {
7709
- xPoint = _this45[xAxis](_this45.parseX(pointB.x.value));
7761
+ xPoint = _this46[xAxis](_this46.parseX(pointB.x.value));
7710
7762
  tooltipTitle = pointB.x.value;
7711
7763
 
7712
7764
  if (!pointB.y.color) {
@@ -7716,14 +7768,14 @@ var WebsyChart = /*#__PURE__*/function () {
7716
7768
  tooltipData.push(pointB.y);
7717
7769
 
7718
7770
  if (typeof pointB.x.value.getTime !== 'undefined') {
7719
- tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointB.x.value);
7771
+ tooltipTitle = d3.timeFormat(_this46.options.dateFormat || _this46.options.calculatedTimeFormatPattern)(pointB.x.value);
7720
7772
  }
7721
7773
  }
7722
7774
 
7723
7775
  if (pointA && pointB) {
7724
- var d0 = _this45[xAxis](_this45.parseX(pointA.x.value));
7776
+ var d0 = _this46[xAxis](_this46.parseX(pointA.x.value));
7725
7777
 
7726
- var d1 = _this45[xAxis](_this45.parseX(pointB.x.value));
7778
+ var d1 = _this46[xAxis](_this46.parseX(pointB.x.value));
7727
7779
 
7728
7780
  var mid = Math.abs(d0 - d1) / 2;
7729
7781
 
@@ -7732,7 +7784,7 @@ var WebsyChart = /*#__PURE__*/function () {
7732
7784
  tooltipTitle = pointB.x.value;
7733
7785
 
7734
7786
  if (typeof pointB.x.value.getTime !== 'undefined') {
7735
- tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointB.x.value);
7787
+ tooltipTitle = d3.timeFormat(_this46.options.dateFormat || _this46.options.calculatedTimeFormatPattern)(pointB.x.value);
7736
7788
  }
7737
7789
 
7738
7790
  if (!pointB.y.color) {
@@ -7745,7 +7797,7 @@ var WebsyChart = /*#__PURE__*/function () {
7745
7797
  tooltipTitle = pointA.x.value;
7746
7798
 
7747
7799
  if (typeof pointB.x.value.getTime !== 'undefined') {
7748
- tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointB.x.value);
7800
+ tooltipTitle = d3.timeFormat(_this46.options.dateFormat || _this46.options.calculatedTimeFormatPattern)(pointB.x.value);
7749
7801
  }
7750
7802
 
7751
7803
  if (!pointA.y.color) {
@@ -7859,7 +7911,7 @@ var WebsyChart = /*#__PURE__*/function () {
7859
7911
  }, {
7860
7912
  key: "render",
7861
7913
  value: function render(options) {
7862
- var _this46 = this;
7914
+ var _this47 = this;
7863
7915
 
7864
7916
  /* global d3 options WebsyUtils */
7865
7917
  if (typeof options !== 'undefined') {
@@ -7928,7 +7980,7 @@ var WebsyChart = /*#__PURE__*/function () {
7928
7980
  var legendData = this.options.data.series.map(function (s, i) {
7929
7981
  return {
7930
7982
  value: s.label || s.key,
7931
- color: s.color || _this46.options.colors[i % _this46.options.colors.length]
7983
+ color: s.color || _this47.options.colors[i % _this47.options.colors.length]
7932
7984
  };
7933
7985
  });
7934
7986
 
@@ -8210,7 +8262,7 @@ var WebsyChart = /*#__PURE__*/function () {
8210
8262
 
8211
8263
  if (this.options.data.bottom.formatter) {
8212
8264
  bAxisFunc.tickFormat(function (d) {
8213
- return _this46.options.data.bottom.formatter(d);
8265
+ return _this47.options.data.bottom.formatter(d);
8214
8266
  });
8215
8267
  }
8216
8268
 
@@ -8236,8 +8288,8 @@ var WebsyChart = /*#__PURE__*/function () {
8236
8288
 
8237
8289
  if (this.options.margin.axisLeft > 0) {
8238
8290
  this.leftAxisLayer.call(d3.axisLeft(this.leftAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
8239
- if (_this46.options.data.left.formatter) {
8240
- d = _this46.options.data.left.formatter(d);
8291
+ if (_this47.options.data.left.formatter) {
8292
+ d = _this47.options.data.left.formatter(d);
8241
8293
  }
8242
8294
 
8243
8295
  return d;
@@ -8274,8 +8326,8 @@ var WebsyChart = /*#__PURE__*/function () {
8274
8326
 
8275
8327
  if (this.options.margin.axisRight > 0 && (this.options.data.right.min !== 0 || this.options.data.right.max !== 0)) {
8276
8328
  this.rightAxisLayer.call(d3.axisRight(this.rightAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
8277
- if (_this46.options.data.right.formatter) {
8278
- d = _this46.options.data.right.formatter(d);
8329
+ if (_this47.options.data.right.formatter) {
8330
+ d = _this47.options.data.right.formatter(d);
8279
8331
  }
8280
8332
 
8281
8333
  return d;
@@ -8314,18 +8366,18 @@ var WebsyChart = /*#__PURE__*/function () {
8314
8366
  this.renderedKeys = {};
8315
8367
  this.options.data.series.forEach(function (series, index) {
8316
8368
  if (!series.key) {
8317
- series.key = _this46.createIdentity();
8369
+ series.key = _this47.createIdentity();
8318
8370
  }
8319
8371
 
8320
8372
  if (!series.color) {
8321
- series.color = _this46.options.colors[index % _this46.options.colors.length];
8373
+ series.color = _this47.options.colors[index % _this47.options.colors.length];
8322
8374
  }
8323
8375
 
8324
- _this46["render".concat(series.type || 'bar')](series, index);
8376
+ _this47["render".concat(series.type || 'bar')](series, index);
8325
8377
 
8326
- _this46.renderLabels(series, index);
8378
+ _this47.renderLabels(series, index);
8327
8379
 
8328
- _this46.renderedKeys[series.key] = series.type;
8380
+ _this47.renderedKeys[series.key] = series.type;
8329
8381
  });
8330
8382
  }
8331
8383
  }
@@ -8333,17 +8385,17 @@ var WebsyChart = /*#__PURE__*/function () {
8333
8385
  }, {
8334
8386
  key: "renderarea",
8335
8387
  value: function renderarea(series, index) {
8336
- var _this47 = this;
8388
+ var _this48 = this;
8337
8389
 
8338
8390
  /* global d3 series index */
8339
8391
  var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
8340
8392
  return d3.area().x(function (d) {
8341
- return _this47[xAxis](_this47.parseX(d.x.value));
8393
+ return _this48[xAxis](_this48.parseX(d.x.value));
8342
8394
  }).y0(function (d) {
8343
- return _this47[yAxis](0);
8395
+ return _this48[yAxis](0);
8344
8396
  }).y1(function (d) {
8345
- return _this47[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
8346
- }).curve(d3[curveStyle || _this47.options.curveStyle]);
8397
+ return _this48[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
8398
+ }).curve(d3[curveStyle || _this48.options.curveStyle]);
8347
8399
  };
8348
8400
 
8349
8401
  var xAxis = 'bottomAxis';
@@ -8472,7 +8524,7 @@ var WebsyChart = /*#__PURE__*/function () {
8472
8524
  }, {
8473
8525
  key: "renderLabels",
8474
8526
  value: function renderLabels(series, index) {
8475
- var _this48 = this;
8527
+ var _this49 = this;
8476
8528
 
8477
8529
  /* global series index d3 WebsyDesigns */
8478
8530
  var xAxis = 'bottomAxis';
@@ -8491,11 +8543,11 @@ var WebsyChart = /*#__PURE__*/function () {
8491
8543
  var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
8492
8544
  labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
8493
8545
  labels.attr('x', function (d) {
8494
- return getLabelX.call(_this48, d, series.labelPosition);
8546
+ return getLabelX.call(_this49, d, series.labelPosition);
8495
8547
  }).attr('y', function (d) {
8496
- return getLabelY.call(_this48, d, series.labelPosition);
8548
+ return getLabelY.call(_this49, d, series.labelPosition);
8497
8549
  }).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
8498
- return _this48.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
8550
+ return _this49.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
8499
8551
  }).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
8500
8552
  return d.y.label || d.y.value;
8501
8553
  }).each(function (d, i) {
@@ -8520,11 +8572,11 @@ var WebsyChart = /*#__PURE__*/function () {
8520
8572
  }
8521
8573
  });
8522
8574
  labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', function (d) {
8523
- return getLabelX.call(_this48, d, series.labelPosition);
8575
+ return getLabelX.call(_this49, d, series.labelPosition);
8524
8576
  }).attr('y', function (d) {
8525
- return getLabelY.call(_this48, d, series.labelPosition);
8577
+ return getLabelY.call(_this49, d, series.labelPosition);
8526
8578
  }).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
8527
- return _this48.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
8579
+ return _this49.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
8528
8580
  }).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).text(function (d) {
8529
8581
  return d.y.label || d.y.value;
8530
8582
  }).each(function (d, i) {
@@ -8581,16 +8633,16 @@ var WebsyChart = /*#__PURE__*/function () {
8581
8633
  }, {
8582
8634
  key: "renderline",
8583
8635
  value: function renderline(series, index) {
8584
- var _this49 = this;
8636
+ var _this50 = this;
8585
8637
 
8586
8638
  /* global series index d3 */
8587
8639
  var drawLine = function drawLine(xAxis, yAxis, curveStyle) {
8588
8640
  return d3.line().x(function (d) {
8589
- var adjustment = _this49.options.data[xAxis].scale === 'Time' ? 0 : _this49["".concat(xAxis, "Axis")].bandwidth() / 2;
8590
- return _this49["".concat(xAxis, "Axis")](_this49.parseX(d.x.value)) + adjustment;
8641
+ var adjustment = _this50.options.data[xAxis].scale === 'Time' ? 0 : _this50["".concat(xAxis, "Axis")].bandwidth() / 2;
8642
+ return _this50["".concat(xAxis, "Axis")](_this50.parseX(d.x.value)) + adjustment;
8591
8643
  }).y(function (d) {
8592
- return _this49["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
8593
- }).curve(d3[curveStyle || _this49.options.curveStyle]);
8644
+ return _this50["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
8645
+ }).curve(d3[curveStyle || _this50.options.curveStyle]);
8594
8646
  };
8595
8647
 
8596
8648
  var xAxis = 'bottom';
@@ -8634,14 +8686,14 @@ var WebsyChart = /*#__PURE__*/function () {
8634
8686
  }, {
8635
8687
  key: "rendersymbol",
8636
8688
  value: function rendersymbol(series, index) {
8637
- var _this50 = this;
8689
+ var _this51 = this;
8638
8690
 
8639
8691
  /* global d3 series index series.key */
8640
8692
  var drawSymbol = function drawSymbol(size) {
8641
8693
  return d3.symbol() // .type(d => {
8642
8694
  // return d3.symbols[0]
8643
8695
  // })
8644
- .size(size || _this50.options.symbolSize);
8696
+ .size(size || _this51.options.symbolSize);
8645
8697
  };
8646
8698
 
8647
8699
  var xAxis = 'bottomAxis';
@@ -8659,7 +8711,7 @@ var WebsyChart = /*#__PURE__*/function () {
8659
8711
  symbols.attr('d', function (d) {
8660
8712
  return drawSymbol(d.y.size || series.symbolSize)(d);
8661
8713
  }).transition(this.transition).attr('fill', 'white').attr('stroke', series.color).attr('transform', function (d) {
8662
- return "translate(".concat(_this50[xAxis](_this50.parseX(d.x.value)), ", ").concat(_this50[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8714
+ return "translate(".concat(_this51[xAxis](_this51.parseX(d.x.value)), ", ").concat(_this51[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8663
8715
  }); // Enter
8664
8716
 
8665
8717
  symbols.enter().append('path').attr('d', function (d) {
@@ -8668,7 +8720,7 @@ var WebsyChart = /*#__PURE__*/function () {
8668
8720
  .attr('fill', 'white').attr('stroke', series.color).attr('class', function (d) {
8669
8721
  return "symbol symbol_".concat(series.key);
8670
8722
  }).attr('transform', function (d) {
8671
- return "translate(".concat(_this50[xAxis](_this50.parseX(d.x.value)), ", ").concat(_this50[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8723
+ return "translate(".concat(_this51[xAxis](_this51.parseX(d.x.value)), ", ").concat(_this51[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8672
8724
  });
8673
8725
  }
8674
8726
  }, {
@@ -8823,7 +8875,7 @@ var WebsyLegend = /*#__PURE__*/function () {
8823
8875
  }, {
8824
8876
  key: "resize",
8825
8877
  value: function resize() {
8826
- var _this51 = this;
8878
+ var _this52 = this;
8827
8879
 
8828
8880
  var el = document.getElementById(this.elementId);
8829
8881
 
@@ -8836,7 +8888,7 @@ var WebsyLegend = /*#__PURE__*/function () {
8836
8888
  // }
8837
8889
  var html = "\n <div class='text-".concat(this.options.align, "'>\n ");
8838
8890
  html += this._data.map(function (d, i) {
8839
- return _this51.getLegendItemHTML(d);
8891
+ return _this52.getLegendItemHTML(d);
8840
8892
  }).join('');
8841
8893
  html += "\n <div>\n ";
8842
8894
  el.innerHTML = html;
@@ -9008,7 +9060,7 @@ var WebsyMap = /*#__PURE__*/function () {
9008
9060
  }, {
9009
9061
  key: "render",
9010
9062
  value: function render() {
9011
- var _this52 = this;
9063
+ var _this53 = this;
9012
9064
 
9013
9065
  var mapEl = document.getElementById("".concat(this.elementId, "_map"));
9014
9066
  var legendEl = document.getElementById("".concat(this.elementId, "_map"));
@@ -9017,7 +9069,7 @@ var WebsyMap = /*#__PURE__*/function () {
9017
9069
  var legendData = this.options.data.polygons.map(function (s, i) {
9018
9070
  return {
9019
9071
  value: s.label || s.key,
9020
- color: s.color || _this52.options.colors[i % _this52.options.colors.length]
9072
+ color: s.color || _this53.options.colors[i % _this53.options.colors.length]
9021
9073
  };
9022
9074
  });
9023
9075
  var longestValue = legendData.map(function (s) {
@@ -9081,7 +9133,7 @@ var WebsyMap = /*#__PURE__*/function () {
9081
9133
 
9082
9134
  if (this.polygons) {
9083
9135
  this.polygons.forEach(function (p) {
9084
- return _this52.map.removeLayer(p);
9136
+ return _this53.map.removeLayer(p);
9085
9137
  });
9086
9138
  }
9087
9139
 
@@ -9139,18 +9191,18 @@ var WebsyMap = /*#__PURE__*/function () {
9139
9191
  }
9140
9192
 
9141
9193
  if (!p.options.color) {
9142
- p.options.color = _this52.options.colors[i % _this52.options.colors.length];
9194
+ p.options.color = _this53.options.colors[i % _this53.options.colors.length];
9143
9195
  }
9144
9196
 
9145
9197
  var pol = L.polygon(p.data.map(function (c) {
9146
9198
  return c.map(function (d) {
9147
9199
  return [d.Latitude, d.Longitude];
9148
9200
  });
9149
- }), p.options).addTo(_this52.map);
9201
+ }), p.options).addTo(_this53.map);
9150
9202
 
9151
- _this52.polygons.push(pol);
9203
+ _this53.polygons.push(pol);
9152
9204
 
9153
- _this52.map.fitBounds(pol.getBounds());
9205
+ _this53.map.fitBounds(pol.getBounds());
9154
9206
  });
9155
9207
  } // if (this.data.markers.length > 0) {
9156
9208
  // el.classList.remove('hidden')
@@ -9330,7 +9382,7 @@ function recaptchaReadyCallBack() {
9330
9382
 
9331
9383
  function useGoogleRecaptcha(key) {
9332
9384
  var rcs = document.createElement('script');
9333
- rcs.src = "//www.google.com/recaptcha/api.js?render=".concat(key);
9385
+ rcs.src = "//www.google.com/recaptcha/api.js";
9334
9386
  document.body.appendChild(rcs);
9335
9387
  }
9336
9388