@websy/websy-designs 1.4.1 → 1.4.3

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.
@@ -66,7 +66,9 @@ var APIService = /*#__PURE__*/function () {
66
66
  _classCallCheck(this, APIService);
67
67
 
68
68
  this.baseUrl = baseUrl;
69
- this.options = _extends({}, options);
69
+ this.options = _extends({}, {
70
+ fieldValueSeparator: ':'
71
+ }, options);
70
72
  }
71
73
 
72
74
  _createClass(APIService, [{
@@ -84,7 +86,7 @@ var APIService = /*#__PURE__*/function () {
84
86
  }
85
87
 
86
88
  if (id) {
87
- query.push("id:".concat(id));
89
+ query.push("id".concat(this.options.fieldValueSeparator).concat(id));
88
90
  }
89
91
 
90
92
  return "".concat(this.baseUrl, "/").concat(entity).concat(query.length > 0 ? "".concat(entity.indexOf('?') === -1 ? '?' : '&', "where=").concat(query.join(';')) : '');
@@ -341,6 +343,11 @@ var WebsyCarousel = /*#__PURE__*/function () {
341
343
  }
342
344
 
343
345
  _createClass(WebsyCarousel, [{
346
+ key: "close",
347
+ value: function close() {
348
+ this.pause();
349
+ }
350
+ }, {
344
351
  key: "handleClick",
345
352
  value: function handleClick(event) {
346
353
  if (event.target.classList.contains('websy-next-arrow')) {
@@ -453,7 +460,7 @@ var WebsyCarousel = /*#__PURE__*/function () {
453
460
  }
454
461
 
455
462
  if (this.options.showPrevNext === true && this.options.frames.length > 1) {
456
- html += "\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"websy-prev-arrow\"\n viewBox=\"0 0 512 512\">\n <title>Caret Back</title>\n <path d=\"M321.94 98L158.82 237.78a24 24 0 000 36.44L321.94 414c15.57 13.34 39.62 2.28 39.62-18.22v-279.6c0-20.5-24.05-31.56-39.62-18.18z\"/>\n </svg>\n \n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" class=\"websy-next-arrow\">\n <title>Caret Forward</title>\n <path d=\"M190.06 414l163.12-139.78a24 24 0 000-36.44L190.06 98c-15.57-13.34-39.62-2.28-39.62 18.22v279.6c0 20.5 24.05 31.56 39.62 18.18z\"/>\n </svg>\n ";
463
+ html += "\n <svg xmlns=\"http://www.w3.org/2000/svg\" class=\"websy-prev-arrow\"\n viewBox=\"0 0 512 512\">\n <title>Caret Back</title>\n <path d=\"M321.94 98L158.82 237.78a24 24 0 000 36.44L321.94 414c15.57 13.34 39.62 2.28 39.62-18.22v-279.6c0-20.5-24.05-31.56-39.62-18.18z\"/>\n </svg>\n \n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" class=\"websy-next-arrow\">\n <title>Caret Forward</title>\n <path d=\"M190.06 414l163.12-139.78a24 24 0 000-36.44L190.06 98c-15.57-13.34-39.62-2.28-39.62 18.22v279.6c0 20.5 24.05 31.56 39.62 18.18z\"/>\n </svg>\n ";
457
464
  }
458
465
 
459
466
  html += "\n </div>\n ";
@@ -477,20 +484,35 @@ var WebsyCarousel = /*#__PURE__*/function () {
477
484
  }
478
485
 
479
486
  var prevF = document.getElementById("".concat(this.elementId, "_frame_").concat(prevFrameIndex));
480
- setTimeout(function () {
481
- prevF.style.transform = "translateX(".concat(prevTranslateX, ")");
482
- }, 100);
487
+
488
+ if (prevF) {
489
+ setTimeout(function () {
490
+ prevF.style.transform = "translateX(".concat(prevTranslateX, ")");
491
+ }, 100);
492
+ }
493
+
483
494
  var btnInactive = document.getElementById("".concat(this.elementId, "_selector_").concat(prevFrameIndex));
484
- btnInactive.classList.remove('websy-progress-btn-active');
495
+
496
+ if (btnInactive) {
497
+ btnInactive.classList.remove('websy-progress-btn-active');
498
+ }
499
+
485
500
  var newF = document.getElementById("".concat(this.elementId, "_frame_").concat(currFrameIndex));
486
- newF.classList.remove('animate');
487
- newF.style.transform = "translateX(".concat(nextTranslateX, ")");
488
- setTimeout(function () {
489
- newF.classList.add('animate');
490
- newF.style.transform = 'translateX(0%)';
491
- }, 100);
501
+
502
+ if (newF) {
503
+ newF.classList.remove('animate');
504
+ newF.style.transform = "translateX(".concat(nextTranslateX, ")");
505
+ setTimeout(function () {
506
+ newF.classList.add('animate');
507
+ newF.style.transform = 'translateX(0%)';
508
+ }, 100);
509
+ }
510
+
492
511
  var btnActive = document.getElementById("".concat(this.elementId, "_selector_").concat(currFrameIndex));
493
- btnActive.classList.add('websy-progress-btn-active');
512
+
513
+ if (btnActive) {
514
+ btnActive.classList.add('websy-progress-btn-active');
515
+ }
494
516
  } // showFrameSelector () {
495
517
  // }
496
518
 
@@ -819,75 +841,103 @@ var WebsyDatePicker = /*#__PURE__*/function () {
819
841
  }
820
842
 
821
843
  if (this.customRangeSelected === true) {
822
- var diff;
823
-
824
- if (this.options.mode === 'date') {
825
- diff = Math.floor((this.selectedRangeDates[this.selectedRangeDates.length - 1].getTime() - this.selectedRangeDates[0].getTime()) / this.oneDay); // if (this.selectedRangeDates[0].getMonth() !== this.selectedRangeDates[this.selectedRangeDates.length - 1].getMonth()) {
826
- // diff += 1
827
- // }
828
- } else if (this.options.mode === 'year') {
829
- diff = this.selectedRangeDates[this.selectedRangeDates.length - 1] - this.selectedRangeDates[0];
830
-
831
- if (this.selectedRangeDates[this.selectedRangeDates.length - 1] !== this.selectedRangeDates[0]) {// diff += 1
832
- }
833
- } else if (this.options.mode === 'monthyear') {
834
- var yearDiff = (this.selectedRangeDates[this.selectedRangeDates.length - 1].getFullYear() - this.selectedRangeDates[0].getFullYear()) * 12;
835
- diff = Math.floor(this.selectedRangeDates[this.selectedRangeDates.length - 1].getMonth() - this.selectedRangeDates[0].getMonth()) + yearDiff;
836
- } else if (this.options.mode === 'hour') {
837
- diff = this.selectedRangeDates[this.selectedRangeDates.length - 1] - this.selectedRangeDates[0];
838
- }
839
-
840
- for (var _i = 0; _i < diff + 1; _i++) {
841
- var d = void 0;
842
- var rangeStart = void 0;
843
- var rangeEnd = void 0;
844
+ if (this.isContinuousRange || this.mouseDown) {
845
+ var diff;
844
846
 
845
847
  if (this.options.mode === 'date') {
846
- d = this.floorDate(new Date(this.selectedRangeDates[0].getTime() + _i * this.oneDay)); // d.setUTCHours(12, 0, 0, 0)
847
-
848
- d = d.getTime(); // console.log('highlighting', this.selectedRangeDates[0].getTime(), d)
849
-
850
- rangeStart = this.selectedRangeDates[0].getTime();
851
- rangeEnd = this.selectedRangeDates[this.selectedRangeDates.length - 1].getTime();
848
+ diff = Math.floor((this.selectedRangeDates[this.selectedRangeDates.length - 1].getTime() - this.selectedRangeDates[0].getTime()) / this.oneDay); // if (this.selectedRangeDates[0].getMonth() !== this.selectedRangeDates[this.selectedRangeDates.length - 1].getMonth()) {
849
+ // diff += 1
850
+ // }
852
851
  } else if (this.options.mode === 'year') {
853
- d = this.selectedRangeDates[0] + _i;
854
- rangeStart = this.selectedRangeDates[0];
855
- rangeEnd = this.selectedRangeDates[this.selectedRangeDates.length - 1];
856
- } else if (this.options.mode === 'monthyear') {
857
- d = this.floorDate(new Date(this.selectedRangeDates[0].getTime()).setMonth(this.selectedRangeDates[0].getMonth() + _i));
858
- d = d.getTime();
859
- console.log('highlighting', this.selectedRangeDates[0].getTime(), d);
860
- rangeStart = this.selectedRangeDates[0].getTime();
861
- rangeEnd = this.selectedRangeDates[this.selectedRangeDates.length - 1].getTime();
862
- } else if (this.options.mode === 'hour') {
863
- d = this.selectedRangeDates[0] + _i;
864
- rangeStart = this.selectedRangeDates[0];
865
- rangeEnd = this.selectedRangeDates[this.selectedRangeDates.length - 1];
866
- }
852
+ diff = this.selectedRangeDates[this.selectedRangeDates.length - 1] - this.selectedRangeDates[0];
867
853
 
868
- var dateEl = void 0;
869
-
870
- if (this.options.mode === 'date') {
871
- dateEl = document.getElementById("".concat(this.elementId, "_").concat(d, "_date"));
872
- } else if (this.options.mode === 'year') {
873
- dateEl = document.getElementById("".concat(this.elementId, "_").concat(d, "_year"));
854
+ if (this.selectedRangeDates[this.selectedRangeDates.length - 1] !== this.selectedRangeDates[0]) {// diff += 1
855
+ }
874
856
  } else if (this.options.mode === 'monthyear') {
875
- dateEl = document.getElementById("".concat(this.elementId, "_").concat(d, "_monthyear"));
857
+ var yearDiff = (this.selectedRangeDates[this.selectedRangeDates.length - 1].getFullYear() - this.selectedRangeDates[0].getFullYear()) * 12;
858
+ diff = Math.floor(this.selectedRangeDates[this.selectedRangeDates.length - 1].getMonth() - this.selectedRangeDates[0].getMonth()) + yearDiff;
876
859
  } else if (this.options.mode === 'hour') {
877
- dateEl = document.getElementById("".concat(this.elementId, "_").concat(d, "_hour"));
878
- }
860
+ diff = this.selectedRangeDates[this.selectedRangeDates.length - 1] - this.selectedRangeDates[0];
861
+ }
862
+
863
+ for (var _i = 0; _i < diff + 1; _i++) {
864
+ var d = void 0;
865
+ var rangeStart = void 0;
866
+ var rangeEnd = void 0;
867
+
868
+ if (this.options.mode === 'date') {
869
+ d = this.floorDate(new Date(this.selectedRangeDates[0].getTime() + _i * this.oneDay)); // d.setUTCHours(12, 0, 0, 0)
870
+
871
+ d = d.getTime(); // console.log('highlighting', this.selectedRangeDates[0].getTime(), d)
872
+
873
+ rangeStart = this.selectedRangeDates[0].getTime();
874
+ rangeEnd = this.selectedRangeDates[this.selectedRangeDates.length - 1].getTime();
875
+ } else if (this.options.mode === 'year') {
876
+ d = this.selectedRangeDates[0] + _i;
877
+ rangeStart = this.selectedRangeDates[0];
878
+ rangeEnd = this.selectedRangeDates[this.selectedRangeDates.length - 1];
879
+ } else if (this.options.mode === 'monthyear') {
880
+ d = this.floorDate(new Date(this.selectedRangeDates[0].getTime()).setMonth(this.selectedRangeDates[0].getMonth() + _i));
881
+ d = d.getTime();
882
+ console.log('highlighting', this.selectedRangeDates[0].getTime(), d);
883
+ rangeStart = this.selectedRangeDates[0].getTime();
884
+ rangeEnd = this.selectedRangeDates[this.selectedRangeDates.length - 1].getTime();
885
+ } else if (this.options.mode === 'hour') {
886
+ d = this.selectedRangeDates[0] + _i;
887
+ rangeStart = this.selectedRangeDates[0];
888
+ rangeEnd = this.selectedRangeDates[this.selectedRangeDates.length - 1];
889
+ }
879
890
 
880
- if (dateEl) {
881
- dateEl.classList.add('selected');
891
+ var dateEl = void 0;
882
892
 
883
- if (d === rangeStart) {
884
- dateEl.classList.add("".concat(this.options.sortDirection === 'desc' ? 'last' : 'first'));
893
+ if (this.options.mode === 'date') {
894
+ dateEl = document.getElementById("".concat(this.elementId, "_").concat(d, "_date"));
895
+ } else if (this.options.mode === 'year') {
896
+ dateEl = document.getElementById("".concat(this.elementId, "_").concat(d, "_year"));
897
+ } else if (this.options.mode === 'monthyear') {
898
+ dateEl = document.getElementById("".concat(this.elementId, "_").concat(d, "_monthyear"));
899
+ } else if (this.options.mode === 'hour') {
900
+ dateEl = document.getElementById("".concat(this.elementId, "_").concat(d, "_hour"));
885
901
  }
886
902
 
887
- if (d === rangeEnd) {
888
- dateEl.classList.add("".concat(this.options.sortDirection === 'desc' ? 'first' : 'last'));
903
+ if (dateEl) {
904
+ dateEl.classList.add('selected');
905
+
906
+ if (d === rangeStart) {
907
+ dateEl.classList.add("".concat(this.options.sortDirection === 'desc' ? 'last' : 'first'));
908
+ }
909
+
910
+ if (d === rangeEnd) {
911
+ dateEl.classList.add("".concat(this.options.sortDirection === 'desc' ? 'first' : 'last'));
912
+ }
889
913
  }
890
914
  }
915
+ } else {
916
+ this.selectedRangeDates.forEach(function (dIn) {
917
+ var d;
918
+ var suffix = '_date';
919
+
920
+ if (_this5.options.mode === 'date') {
921
+ d = _this5.floorDate(new Date(dIn.getTime()));
922
+ d = d.getTime();
923
+ } else if (_this5.options.mode === 'year') {
924
+ d = dIn;
925
+ suffix = '_year';
926
+ } else if (_this5.options.mode === 'monthyear') {
927
+ d = _this5.floorDate(new Date(dIn.getTime()).setMonth(dIn.getMonth()));
928
+ d = d.getTime();
929
+ suffix = '_monthyear';
930
+ } else if (_this5.options.mode === 'hour') {
931
+ d = dIn;
932
+ suffix = '_hour';
933
+ }
934
+
935
+ var dateEl = document.getElementById("".concat(_this5.elementId, "_").concat(d).concat(suffix));
936
+
937
+ if (dateEl) {
938
+ dateEl.classList.add('selected', 'first', 'last');
939
+ }
940
+ });
891
941
  }
892
942
  } else {
893
943
  this.currentselection.forEach(function (d) {
@@ -1184,7 +1234,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
1184
1234
  } else if (this.options.mode === 'hour') {
1185
1235
  html += "<div id='".concat(this.elementId, "_dateList' class='websy-dp-date-list'><ul>");
1186
1236
  html += this.options.hours.map(function (h) {
1187
- return "<li id='".concat(_this6.elementId, "_").concat(+h.text.split(':')[0], "_hour' data-hour='").concat(h.text, "' class='websy-dp-date websy-dp-hour'>").concat(h.text, "</li>");
1237
+ return "<li id='".concat(_this6.elementId, "_").concat(+h.text.split(':')[0], "_hour' data-id='").concat(+h.text.split(':')[0], "' data-hour='").concat(h.text, "' class='websy-dp-date websy-dp-hour'>").concat(h.text, "</li>");
1188
1238
  }).join('');
1189
1239
  html += "</ul></div>";
1190
1240
  }
@@ -1294,7 +1344,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
1294
1344
  var _this8 = this;
1295
1345
 
1296
1346
  this.selectedRange = -1;
1297
- var isContinuousRange = true; // if (rangeInput.length === 1) {
1347
+ this.isContinuousRange = true; // if (rangeInput.length === 1) {
1298
1348
  // this.selectedRangeDates = [...rangeInput]
1299
1349
  // this.customRangeSelected = true
1300
1350
  // }
@@ -1309,22 +1359,22 @@ var WebsyDatePicker = /*#__PURE__*/function () {
1309
1359
  if (i > 0) {
1310
1360
  if (_this8.options.mode === 'date' || _this8.options.mode === 'monthyear') {
1311
1361
  if (r.getTime() / _this8.oneDay - rangeInput[i - 1] / _this8.oneDay > 1) {
1312
- isContinuousRange = false;
1362
+ _this8.isContinuousRange = false;
1313
1363
  }
1314
1364
  } else if (_this8.options.mode === 'hour' || _this8.options.mode === 'year') {
1315
1365
  if (r - rangeInput[i - 1] > 1) {
1316
- isContinuousRange = false;
1366
+ _this8.isContinuousRange = false;
1317
1367
  }
1318
1368
  }
1319
1369
  }
1320
1370
  });
1321
1371
 
1322
- if (rangeInput.length > 2 && isContinuousRange === true) {
1372
+ if (rangeInput.length > 2 && this.isContinuousRange === true) {
1323
1373
  this.selectedRangeDates = [rangeInput[0], rangeInput[rangeInput.length - 1]];
1324
1374
  this.customRangeSelected = true;
1325
1375
  }
1326
1376
 
1327
- if (isContinuousRange === false) {
1377
+ if (this.isContinuousRange === false) {
1328
1378
  this.currentselection = [];
1329
1379
  } // check if the custom range matches a configured range
1330
1380
 
@@ -1419,7 +1469,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
1419
1469
  var start = list[0];
1420
1470
  var end = '';
1421
1471
 
1422
- if (this.customRangeSelected === true) {
1472
+ if (this.customRangeSelected === true && this.isContinuousRange === true) {
1423
1473
  end = " - ".concat(list[list.length - 1]);
1424
1474
 
1425
1475
  if (this.options.mode === 'hour') {
@@ -1512,8 +1562,9 @@ var WebsyDropdown = /*#__PURE__*/function () {
1512
1562
  });
1513
1563
  }
1514
1564
 
1565
+ this.searchText = '';
1515
1566
  this.tooltipTimeoutFn = null;
1516
- this._originalData = [];
1567
+ this._originalData = _toConsumableArray(this.options.items);
1517
1568
  this.selectedItems = this.options.selectedItems || [];
1518
1569
 
1519
1570
  if (!elementId) {
@@ -1656,6 +1707,8 @@ var WebsyDropdown = /*#__PURE__*/function () {
1656
1707
  key: "handleKeyUp",
1657
1708
  value: function handleKeyUp(event) {
1658
1709
  if (event.target.classList.contains('websy-dropdown-search')) {
1710
+ this.searchText = event.target.value;
1711
+
1659
1712
  if (this._originalData.length === 0) {
1660
1713
  this._originalData = _toConsumableArray(this.options.items);
1661
1714
  }
@@ -1852,6 +1905,10 @@ var WebsyDropdown = /*#__PURE__*/function () {
1852
1905
  var itemEls = el.querySelectorAll(".websy-dropdown-item");
1853
1906
  var dataToUse = this._originalData;
1854
1907
 
1908
+ if (this._originalData.length === 0 && this.searchText === '') {
1909
+ dataToUse = this.options.items;
1910
+ }
1911
+
1855
1912
  if (this.options.onSearch) {
1856
1913
  dataToUse = this.options.items;
1857
1914
  }
@@ -3744,6 +3801,9 @@ var WebsyResultList = /*#__PURE__*/function () {
3744
3801
 
3745
3802
  if (el) {
3746
3803
  el.addEventListener('click', this.handleClick.bind(this));
3804
+ el.addEventListener('change', this.handleChange.bind(this));
3805
+ el.addEventListener('keyup', this.handleKeyUp.bind(this));
3806
+ el.addEventListener('keydown', this.handleKeyDown.bind(this));
3747
3807
  }
3748
3808
 
3749
3809
  if (_typeof(options.template) === 'object' && options.template.url) {
@@ -3956,56 +4016,76 @@ var WebsyResultList = /*#__PURE__*/function () {
3956
4016
  key: "handleClick",
3957
4017
  value: function handleClick(event) {
3958
4018
  if (event.target.classList.contains('clickable')) {
3959
- var l = event.target.getAttribute('data-event');
4019
+ this.handleEvent(event, 'clickable', 'click');
4020
+ }
4021
+ }
4022
+ }, {
4023
+ key: "handleChange",
4024
+ value: function handleChange(event) {
4025
+ this.handleEvent(event, 'keyable', 'change');
4026
+ }
4027
+ }, {
4028
+ key: "handleKeyUp",
4029
+ value: function handleKeyUp(event) {
4030
+ this.handleEvent(event, 'keyable', 'keyup');
4031
+ }
4032
+ }, {
4033
+ key: "handleKeyDown",
4034
+ value: function handleKeyDown(event) {
4035
+ this.handleEvent(event, 'keyable', 'keydown');
4036
+ }
4037
+ }, {
4038
+ key: "handleEvent",
4039
+ value: function handleEvent(event, eventType, action) {
4040
+ var l = event.target.getAttribute('data-event');
3960
4041
 
3961
- if (l) {
3962
- l = l.split('(');
3963
- var params = [];
3964
- var id = event.target.getAttribute('data-id');
3965
- var locator = event.target.getAttribute('data-locator');
4042
+ if (l) {
4043
+ l = l.split('(');
4044
+ var params = [];
4045
+ var id = event.target.getAttribute('data-id');
4046
+ var locator = event.target.getAttribute('data-locator');
3966
4047
 
3967
- if (l[1]) {
3968
- l[1] = l[1].replace(')', '');
3969
- params = l[1].split(',');
3970
- }
4048
+ if (l[1]) {
4049
+ l[1] = l[1].replace(')', '');
4050
+ params = l[1].split(',');
4051
+ }
3971
4052
 
3972
- l = l[0];
3973
- var data = this.rows;
4053
+ l = l[0];
4054
+ var data = this.rows;
3974
4055
 
3975
- if (locator !== '') {
3976
- var locatorItems = locator.split(';');
3977
- locatorItems.forEach(function (loc) {
3978
- var locatorParts = loc.split(':');
4056
+ if (locator !== '') {
4057
+ var locatorItems = locator.split(';');
4058
+ locatorItems.forEach(function (loc) {
4059
+ var locatorParts = loc.split(':');
3979
4060
 
3980
- if (data[locatorParts[0]]) {
3981
- data = data[locatorParts[0]];
3982
- var parts = locatorParts[1].split('.');
3983
- parts.forEach(function (p) {
3984
- data = data[p];
3985
- });
3986
- }
3987
- });
3988
- }
4061
+ if (data[locatorParts[0]]) {
4062
+ data = data[locatorParts[0]];
4063
+ var parts = locatorParts[1].split('.');
4064
+ parts.forEach(function (p) {
4065
+ data = data[p];
4066
+ });
4067
+ }
4068
+ });
4069
+ }
3989
4070
 
3990
- params = params.map(function (p) {
3991
- if (typeof p !== 'string' && typeof p !== 'number') {
3992
- if (data[+id]) {
3993
- p = data[+id][p];
3994
- }
3995
- } else if (typeof p === 'string') {
3996
- p = p.replace(/"/g, '').replace(/'/g, '');
4071
+ params = params.map(function (p) {
4072
+ if (typeof p !== 'string' && typeof p !== 'number') {
4073
+ if (data[+id]) {
4074
+ p = data[+id][p];
3997
4075
  }
4076
+ } else if (typeof p === 'string') {
4077
+ p = p.replace(/"/g, '').replace(/'/g, '');
4078
+ }
3998
4079
 
3999
- return p;
4000
- });
4080
+ return p;
4081
+ });
4001
4082
 
4002
- if (event.target.classList.contains('clickable') && this.options.listeners.click[l]) {
4003
- var _this$options$listene;
4083
+ if (event.target.classList.contains(eventType) && this.options.listeners[action] && this.options.listeners[action][l]) {
4084
+ var _this$options$listene;
4004
4085
 
4005
- event.stopPropagation();
4086
+ event.stopPropagation();
4006
4087
 
4007
- (_this$options$listene = this.options.listeners.click[l]).call.apply(_this$options$listene, [this, event, data[+id]].concat(_toConsumableArray(params)));
4008
- }
4088
+ (_this$options$listene = this.options.listeners[action][l]).call.apply(_this$options$listene, [this, event, data[+id]].concat(_toConsumableArray(params)));
4009
4089
  }
4010
4090
  }
4011
4091
  }
@@ -4065,7 +4145,8 @@ var WebsyRouter = /*#__PURE__*/function () {
4065
4145
  show: [],
4066
4146
  hide: []
4067
4147
  },
4068
- persistentParameters: false
4148
+ persistentParameters: false,
4149
+ fieldValueSeparator: ':'
4069
4150
  };
4070
4151
  this.triggerIdList = [];
4071
4152
  this.viewIdList = [];
@@ -4134,6 +4215,7 @@ var WebsyRouter = /*#__PURE__*/function () {
4134
4215
  key: "addUrlParams",
4135
4216
  value: function addUrlParams(params) {
4136
4217
  var reloadView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4218
+ var noHistory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
4137
4219
 
4138
4220
  if (typeof params === 'undefined') {
4139
4221
  return;
@@ -4159,14 +4241,47 @@ var WebsyRouter = /*#__PURE__*/function () {
4159
4241
 
4160
4242
  if (this.options.urlPrefix) {
4161
4243
  inputPath = "/".concat(this.options.urlPrefix, "/").concat(inputPath);
4244
+ } // history.pushState({
4245
+ // inputPath
4246
+ // }, 'unused', `${inputPath}?${path}`)
4247
+
4248
+
4249
+ if (reloadView === true) {
4250
+ // this.showView(this.currentView, this.currentParams, 'main')
4251
+ this.navigate("".concat(inputPath, "?").concat(path), 'main', null, noHistory);
4252
+ }
4253
+ }
4254
+ }, {
4255
+ key: "removeUrlParams",
4256
+ value: function removeUrlParams() {
4257
+ var _this27 = this;
4258
+
4259
+ var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
4260
+ var reloadView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
4261
+ var noHistory = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
4262
+ this.previousParams = _extends({}, this.currentParams);
4263
+ var output = {
4264
+ path: '',
4265
+ items: {}
4266
+ };
4267
+ var path = '';
4268
+
4269
+ if (this.currentParams && this.currentParams.items) {
4270
+ params.forEach(function (p) {
4271
+ delete _this27.currentParams.items[p];
4272
+ });
4273
+ path = this.buildUrlPath(this.currentParams.items);
4162
4274
  }
4163
4275
 
4164
- history.pushState({
4165
- inputPath: inputPath
4166
- }, inputPath, "".concat(inputPath, "?").concat(path));
4276
+ var inputPath = this.currentView;
4277
+
4278
+ if (this.options.urlPrefix) {
4279
+ inputPath = "/".concat(this.options.urlPrefix, "/").concat(inputPath);
4280
+ }
4167
4281
 
4168
4282
  if (reloadView === true) {
4169
- this.showView(this.currentView, this.currentParams, 'main');
4283
+ // this.showView(this.currentView, this.currentParams, 'main')
4284
+ this.navigate("".concat(inputPath, "?").concat(path), 'main', null, noHistory);
4170
4285
  }
4171
4286
  }
4172
4287
  }, {
@@ -4270,6 +4385,38 @@ var WebsyRouter = /*#__PURE__*/function () {
4270
4385
 
4271
4386
  return views;
4272
4387
  }
4388
+ }, {
4389
+ key: "getParamValues",
4390
+ value: function getParamValues(param) {
4391
+ var output = [];
4392
+
4393
+ if (this.currentParams && this.currentParams.items && this.currentParams.items[param] && this.currentParams.items[param] !== '') {
4394
+ return this.currentParams.items[param].split('|').map(function (d) {
4395
+ return decodeURI(d);
4396
+ });
4397
+ }
4398
+
4399
+ return output;
4400
+ }
4401
+ }, {
4402
+ key: "getAPIQuery",
4403
+ value: function getAPIQuery() {
4404
+ var ignoredParams = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
4405
+
4406
+ if (this.currentParams && this.currentParams.items) {
4407
+ var query = [];
4408
+
4409
+ for (var key in this.currentParams.items) {
4410
+ if (ignoredParams.indexOf(key) === -1) {
4411
+ query.push("".concat(key).concat(this.options.fieldValueSeparator).concat(this.currentParams.items[key]));
4412
+ }
4413
+ }
4414
+
4415
+ return query;
4416
+ }
4417
+
4418
+ return [];
4419
+ }
4273
4420
  }, {
4274
4421
  key: "handleClick",
4275
4422
  value: function handleClick(event) {
@@ -4300,20 +4447,17 @@ var WebsyRouter = /*#__PURE__*/function () {
4300
4447
  url += "?".concat(params.path);
4301
4448
  }
4302
4449
 
4303
- this.currentView = view;
4304
- this.currentViewMain = view;
4305
-
4306
- if (this.currentView === '/' || this.currentView === '') {
4307
- this.currentView = this.options.defaultView;
4308
- }
4309
-
4310
- if (this.currentViewMain === '/' || this.currentViewMain === '') {
4311
- this.currentViewMain = this.options.defaultView;
4312
- }
4313
-
4314
- if (view !== '') {
4315
- this.showView(view, params, 'main');
4316
- }
4450
+ this.navigate(url); // this.currentView = view
4451
+ // this.currentViewMain = view
4452
+ // if (this.currentView === '/' || this.currentView === '') {
4453
+ // this.currentView = this.options.defaultView
4454
+ // }
4455
+ // if (this.currentViewMain === '/' || this.currentViewMain === '') {
4456
+ // this.currentViewMain = this.options.defaultView
4457
+ // }
4458
+ // if (view !== '') {
4459
+ // this.showView(view, params, 'main')
4460
+ // }
4317
4461
  }
4318
4462
  }, {
4319
4463
  key: "handleFocus",
@@ -4461,12 +4605,12 @@ var WebsyRouter = /*#__PURE__*/function () {
4461
4605
  }, {
4462
4606
  key: "showComponents",
4463
4607
  value: function showComponents(view) {
4464
- var _this27 = this;
4608
+ var _this28 = this;
4465
4609
 
4466
4610
  if (this.options.views && this.options.views[view] && this.options.views[view].components) {
4467
4611
  this.options.views[view].components.forEach(function (c) {
4468
4612
  if (typeof c.instance === 'undefined') {
4469
- _this27.prepComponent(c.elementId, c.options);
4613
+ _this28.prepComponent(c.elementId, c.options);
4470
4614
 
4471
4615
  c.instance = new c.Component(c.elementId, c.options);
4472
4616
  } else if (c.instance.render) {
@@ -4625,27 +4769,30 @@ var WebsyRouter = /*#__PURE__*/function () {
4625
4769
  inputPath = window.location.pathname.split('/').pop() + inputPath;
4626
4770
  }
4627
4771
 
4628
- if ((this.currentPath !== newPath || previousParamsPath !== this.currentParams.path) && group === this.options.defaultGroup) {
4629
- if (popped === false) {
4630
- var historyUrl = inputPath;
4772
+ if ((this.currentPath !== inputPath || previousParamsPath !== this.currentParams.path) && group === this.options.defaultGroup) {
4773
+ var historyUrl = inputPath;
4631
4774
 
4632
- if (this.options.urlPrefix) {
4633
- historyUrl = historyUrl === '/' ? '' : "/".concat(historyUrl);
4634
- inputPath = inputPath === '/' ? '' : "/".concat(inputPath);
4635
- historyUrl = "/".concat(this.options.urlPrefix).concat(historyUrl).replace(/\/\//g, '/');
4636
- inputPath = "/".concat(this.options.urlPrefix).concat(inputPath).replace(/\/\//g, '/');
4637
- }
4775
+ if (this.options.urlPrefix) {
4776
+ historyUrl = historyUrl === '/' ? '' : "/".concat(historyUrl);
4777
+ inputPath = inputPath === '/' ? '' : "/".concat(inputPath);
4778
+ historyUrl = "/".concat(this.options.urlPrefix).concat(historyUrl).replace(/\/\//g, '/');
4779
+ inputPath = "/".concat(this.options.urlPrefix).concat(inputPath).replace(/\/\//g, '/');
4780
+ }
4638
4781
 
4639
- if (this.currentParams && this.currentParams.path) {
4640
- historyUrl += "?".concat(this.currentParams.path);
4641
- } else if (this.queryParams && this.options.persistentParameters === true) {
4642
- historyUrl += "?".concat(this.queryParams);
4643
- }
4782
+ if (this.currentParams && this.currentParams.path) {
4783
+ historyUrl += "?".concat(this.currentParams.path);
4784
+ } else if (this.queryParams && this.options.persistentParameters === true) {
4785
+ historyUrl += "?".concat(this.queryParams);
4786
+ }
4644
4787
 
4788
+ if (popped === false) {
4645
4789
  history.pushState({
4646
- inputPath: inputPath
4647
- }, inputPath, historyUrl);
4648
- } else {//
4790
+ inputPath: historyUrl
4791
+ }, 'unused', historyUrl);
4792
+ } else {
4793
+ history.replaceState({
4794
+ inputPath: historyUrl
4795
+ }, 'unused', historyUrl);
4649
4796
  }
4650
4797
  }
4651
4798
 
@@ -4795,8 +4942,13 @@ var WebsySearch = /*#__PURE__*/function () {
4795
4942
  value: function handleClick(event) {
4796
4943
  if (event.target.classList.contains('clear')) {
4797
4944
  var inputEl = document.getElementById("".concat(this.elementId, "_search"));
4798
- inputEl.value = '';
4799
- this.options.onSearch('');
4945
+ inputEl.value = ''; // if (this.options.onSearch) {
4946
+ // this.options.onSearch('')
4947
+ // }
4948
+
4949
+ if (this.options.onClear) {
4950
+ this.options.onClear();
4951
+ }
4800
4952
  }
4801
4953
  }
4802
4954
  }, {
@@ -4812,7 +4964,7 @@ var WebsySearch = /*#__PURE__*/function () {
4812
4964
  }, {
4813
4965
  key: "handleKeyUp",
4814
4966
  value: function handleKeyUp(event) {
4815
- var _this28 = this;
4967
+ var _this29 = this;
4816
4968
 
4817
4969
  if (event.target.classList.contains('websy-search-input')) {
4818
4970
  if (this.searchTimeoutFn) {
@@ -4829,17 +4981,28 @@ var WebsySearch = /*#__PURE__*/function () {
4829
4981
 
4830
4982
  if (event.target.value.length >= this.options.minLength) {
4831
4983
  this.searchTimeoutFn = setTimeout(function () {
4832
- if (_this28.options.onSearch) {
4833
- _this28.options.onSearch(event.target.value);
4984
+ if (_this29.options.onSearch) {
4985
+ _this29.options.onSearch(event.target.value);
4834
4986
  }
4835
4987
  }, this.options.searchTimeout);
4836
4988
  } else {
4837
4989
  if (this.options.onSearch && (event.key === 'Delete' || event.key === 'Backspace')) {
4838
- this.options.onSearch('');
4990
+ if (this.options.onClear) {
4991
+ this.options.onClear();
4992
+ }
4839
4993
  }
4840
4994
  }
4841
4995
  }
4842
4996
  }
4997
+ }, {
4998
+ key: "text",
4999
+ set: function set(text) {
5000
+ var el = document.getElementById("".concat(this.elementId, "_search"));
5001
+
5002
+ if (el) {
5003
+ el.value = text;
5004
+ }
5005
+ }
4843
5006
  }]);
4844
5007
 
4845
5008
  return WebsySearch;
@@ -4981,7 +5144,7 @@ var Switch = /*#__PURE__*/function () {
4981
5144
 
4982
5145
  var WebsyTemplate = /*#__PURE__*/function () {
4983
5146
  function WebsyTemplate(elementId, options) {
4984
- var _this29 = this;
5147
+ var _this30 = this;
4985
5148
 
4986
5149
  _classCallCheck(this, WebsyTemplate);
4987
5150
 
@@ -5007,9 +5170,9 @@ var WebsyTemplate = /*#__PURE__*/function () {
5007
5170
 
5008
5171
  if (_typeof(options.template) === 'object' && options.template.url) {
5009
5172
  this.templateService.get(options.template.url).then(function (templateString) {
5010
- _this29.options.template = templateString;
5173
+ _this30.options.template = templateString;
5011
5174
 
5012
- _this29.render();
5175
+ _this30.render();
5013
5176
  });
5014
5177
  } else {
5015
5178
  this.render();
@@ -5019,7 +5182,7 @@ var WebsyTemplate = /*#__PURE__*/function () {
5019
5182
  _createClass(WebsyTemplate, [{
5020
5183
  key: "buildHTML",
5021
5184
  value: function buildHTML() {
5022
- var _this30 = this;
5185
+ var _this31 = this;
5023
5186
 
5024
5187
  var html = "";
5025
5188
 
@@ -5081,14 +5244,14 @@ var WebsyTemplate = /*#__PURE__*/function () {
5081
5244
  }
5082
5245
 
5083
5246
  if (polarity === true) {
5084
- if (typeof _this30.options.data[parts[0]] !== 'undefined' && _this30.options.data[parts[0]] === parts[1]) {
5247
+ if (typeof _this31.options.data[parts[0]] !== 'undefined' && _this31.options.data[parts[0]] === parts[1]) {
5085
5248
  // remove the <if> tags
5086
5249
  removeAll = false;
5087
5250
  } else if (parts[0] === parts[1]) {
5088
5251
  removeAll = false;
5089
5252
  }
5090
5253
  } else if (polarity === false) {
5091
- if (typeof _this30.options.data[parts[0]] !== 'undefined' && _this30.options.data[parts[0]] !== parts[1]) {
5254
+ if (typeof _this31.options.data[parts[0]] !== 'undefined' && _this31.options.data[parts[0]] !== parts[1]) {
5092
5255
  // remove the <if> tags
5093
5256
  removeAll = false;
5094
5257
  }
@@ -5378,7 +5541,7 @@ var WebsyUtils = {
5378
5541
 
5379
5542
  var WebsyTable = /*#__PURE__*/function () {
5380
5543
  function WebsyTable(elementId, options) {
5381
- var _this31 = this;
5544
+ var _this32 = this;
5382
5545
 
5383
5546
  _classCallCheck(this, WebsyTable);
5384
5547
 
@@ -5416,8 +5579,8 @@ var WebsyTable = /*#__PURE__*/function () {
5416
5579
  allowClear: false,
5417
5580
  disableSearch: true,
5418
5581
  onItemSelected: function onItemSelected(selectedItem) {
5419
- if (_this31.options.onChangePageSize) {
5420
- _this31.options.onChangePageSize(selectedItem.value);
5582
+ if (_this32.options.onChangePageSize) {
5583
+ _this32.options.onChangePageSize(selectedItem.value);
5421
5584
  }
5422
5585
  }
5423
5586
  });
@@ -5438,7 +5601,7 @@ var WebsyTable = /*#__PURE__*/function () {
5438
5601
  _createClass(WebsyTable, [{
5439
5602
  key: "appendRows",
5440
5603
  value: function appendRows(data) {
5441
- var _this32 = this;
5604
+ var _this33 = this;
5442
5605
 
5443
5606
  this.hideError();
5444
5607
  var bodyHTML = '';
@@ -5446,15 +5609,15 @@ var WebsyTable = /*#__PURE__*/function () {
5446
5609
  if (data) {
5447
5610
  bodyHTML += data.map(function (r, rowIndex) {
5448
5611
  return '<tr>' + r.map(function (c, i) {
5449
- if (_this32.options.columns[i].show !== false) {
5612
+ if (_this33.options.columns[i].show !== false) {
5450
5613
  var style = '';
5451
5614
 
5452
5615
  if (c.style) {
5453
5616
  style += c.style;
5454
5617
  }
5455
5618
 
5456
- if (_this32.options.columns[i].width) {
5457
- style += "width: ".concat(_this32.options.columns[i].width, "; ");
5619
+ if (_this33.options.columns[i].width) {
5620
+ style += "width: ".concat(_this33.options.columns[i].width, "; ");
5458
5621
  }
5459
5622
 
5460
5623
  if (c.backgroundColor) {
@@ -5469,18 +5632,18 @@ var WebsyTable = /*#__PURE__*/function () {
5469
5632
  style += "color: ".concat(c.color, "; ");
5470
5633
  }
5471
5634
 
5472
- if (_this32.options.columns[i].showAsLink === true && c.value.trim() !== '') {
5473
- return "\n <td \n data-row-index='".concat(_this32.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this32.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(_this32.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this32.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
5474
- } else if ((_this32.options.columns[i].showAsNavigatorLink === true || _this32.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
5475
- return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this32.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this32.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this32.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this32.options.columns[i].linkText || c.value, "</td>\n ");
5635
+ if (_this33.options.columns[i].showAsLink === true && c.value.trim() !== '') {
5636
+ 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 ");
5637
+ } else if ((_this33.options.columns[i].showAsNavigatorLink === true || _this33.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
5638
+ 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 ");
5476
5639
  } else {
5477
5640
  var info = c.value;
5478
5641
 
5479
- if (_this32.options.columns[i].showAsImage === true) {
5642
+ if (_this33.options.columns[i].showAsImage === true) {
5480
5643
  c.value = "\n <img src='".concat(c.value, "'>\n ");
5481
5644
  }
5482
5645
 
5483
- return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this32.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this32.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 ");
5646
+ 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 ");
5484
5647
  }
5485
5648
  }
5486
5649
  }).join('') + '</tr>';
@@ -5652,7 +5815,7 @@ var WebsyTable = /*#__PURE__*/function () {
5652
5815
  }, {
5653
5816
  key: "render",
5654
5817
  value: function render(data) {
5655
- var _this33 = this;
5818
+ var _this34 = this;
5656
5819
 
5657
5820
  if (!this.options.columns) {
5658
5821
  return;
@@ -5687,7 +5850,7 @@ var WebsyTable = /*#__PURE__*/function () {
5687
5850
  style += "width: ".concat(c.width || 'auto', ";");
5688
5851
  }
5689
5852
 
5690
- 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 ? _this33.buildSearchIcon(c.qGroupFieldDefs[0]) : '', "-->\n </div>\n </th>\n ");
5853
+ 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 ");
5691
5854
  }
5692
5855
  }).join('') + '</tr>';
5693
5856
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
@@ -5706,7 +5869,7 @@ var WebsyTable = /*#__PURE__*/function () {
5706
5869
 
5707
5870
  if (pagingEl) {
5708
5871
  var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
5709
- return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this33.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
5872
+ return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this34.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
5710
5873
  });
5711
5874
  var startIndex = 0;
5712
5875
 
@@ -5774,7 +5937,7 @@ var WebsyTable = /*#__PURE__*/function () {
5774
5937
 
5775
5938
  var WebsyTable2 = /*#__PURE__*/function () {
5776
5939
  function WebsyTable2(elementId, options) {
5777
- var _this34 = this;
5940
+ var _this35 = this;
5778
5941
 
5779
5942
  _classCallCheck(this, WebsyTable2);
5780
5943
 
@@ -5815,8 +5978,8 @@ var WebsyTable2 = /*#__PURE__*/function () {
5815
5978
  allowClear: false,
5816
5979
  disableSearch: true,
5817
5980
  onItemSelected: function onItemSelected(selectedItem) {
5818
- if (_this34.options.onChangePageSize) {
5819
- _this34.options.onChangePageSize(selectedItem.value);
5981
+ if (_this35.options.onChangePageSize) {
5982
+ _this35.options.onChangePageSize(selectedItem.value);
5820
5983
  }
5821
5984
  }
5822
5985
  });
@@ -5840,7 +6003,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
5840
6003
  _createClass(WebsyTable2, [{
5841
6004
  key: "appendRows",
5842
6005
  value: function appendRows(data) {
5843
- var _this35 = this;
6006
+ var _this36 = this;
5844
6007
 
5845
6008
  this.hideError();
5846
6009
  var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
@@ -5849,15 +6012,15 @@ var WebsyTable2 = /*#__PURE__*/function () {
5849
6012
  if (data) {
5850
6013
  bodyHTML += data.map(function (r, rowIndex) {
5851
6014
  return '<tr>' + r.map(function (c, i) {
5852
- if (_this35.options.columns[i].show !== false) {
5853
- var style = "height: ".concat(_this35.options.cellSize, "px; line-height: ").concat(_this35.options.cellSize, "px;");
6015
+ if (_this36.options.columns[i].show !== false) {
6016
+ var style = "height: ".concat(_this36.options.cellSize, "px; line-height: ").concat(_this36.options.cellSize, "px;");
5854
6017
 
5855
6018
  if (c.style) {
5856
6019
  style += c.style;
5857
6020
  }
5858
6021
 
5859
- if (_this35.options.columns[i].width) {
5860
- style += "width: ".concat(_this35.options.columns[i].width, "; ");
6022
+ if (_this36.options.columns[i].width) {
6023
+ style += "width: ".concat(_this36.options.columns[i].width, "; ");
5861
6024
  }
5862
6025
 
5863
6026
  if (c.backgroundColor) {
@@ -5872,18 +6035,18 @@ var WebsyTable2 = /*#__PURE__*/function () {
5872
6035
  style += "color: ".concat(c.color, "; ");
5873
6036
  }
5874
6037
 
5875
- if (_this35.options.columns[i].showAsLink === true && c.value.trim() !== '') {
5876
- return "\n <td \n data-row-index='".concat(_this35.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this35.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(_this35.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this35.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
5877
- } else if ((_this35.options.columns[i].showAsNavigatorLink === true || _this35.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
5878
- return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this35.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this35.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this35.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this35.options.columns[i].linkText || c.value, "</td>\n ");
6038
+ if (_this36.options.columns[i].showAsLink === true && c.value.trim() !== '') {
6039
+ 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 ");
6040
+ } else if ((_this36.options.columns[i].showAsNavigatorLink === true || _this36.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
6041
+ 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 ");
5879
6042
  } else {
5880
6043
  var info = c.value;
5881
6044
 
5882
- if (_this35.options.columns[i].showAsImage === true) {
6045
+ if (_this36.options.columns[i].showAsImage === true) {
5883
6046
  c.value = "\n <img src='".concat(c.value, "'>\n ");
5884
6047
  }
5885
6048
 
5886
- return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this35.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this35.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 ");
6049
+ 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 ");
5887
6050
  }
5888
6051
  }
5889
6052
  }).join('') + '</tr>';
@@ -6146,7 +6309,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6146
6309
  }, {
6147
6310
  key: "render",
6148
6311
  value: function render(data) {
6149
- var _this36 = this;
6312
+ var _this37 = this;
6150
6313
 
6151
6314
  if (!this.options.columns) {
6152
6315
  return;
@@ -6182,7 +6345,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6182
6345
  style += "width: ".concat(c.width || 'auto', "; ");
6183
6346
  }
6184
6347
 
6185
- 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 ? _this36.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
6348
+ 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 ");
6186
6349
  }
6187
6350
  }).join('') + '</tr>';
6188
6351
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
@@ -6193,7 +6356,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6193
6356
  var dropdownHTML = "";
6194
6357
  this.options.columns.forEach(function (c, i) {
6195
6358
  if (c.searchable && c.searchField) {
6196
- dropdownHTML += "\n <div id=\"".concat(_this36.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
6359
+ dropdownHTML += "\n <div id=\"".concat(_this37.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
6197
6360
  }
6198
6361
  });
6199
6362
  dropdownEl.innerHTML = dropdownHTML;
@@ -6215,7 +6378,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6215
6378
 
6216
6379
  if (pagingEl) {
6217
6380
  var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
6218
- return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this36.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
6381
+ return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this37.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
6219
6382
  });
6220
6383
  var startIndex = 0;
6221
6384
 
@@ -6306,7 +6469,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6306
6469
  }, {
6307
6470
  key: "getColumnParameters",
6308
6471
  value: function getColumnParameters(values) {
6309
- var _this37 = this;
6472
+ var _this38 = this;
6310
6473
 
6311
6474
  var tableEl = document.getElementById("".concat(this.elementId, "_table"));
6312
6475
  tableEl.style.tableLayout = 'auto';
@@ -6314,10 +6477,10 @@ var WebsyTable2 = /*#__PURE__*/function () {
6314
6477
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
6315
6478
  var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
6316
6479
  headEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c, i) {
6317
- 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 ? _this37.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
6480
+ 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 ");
6318
6481
  }).join('') + '</tr>';
6319
6482
  bodyEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c) {
6320
- return "\n <td \n style='height: ".concat(_this37.options.cellSize, "px; line-height: ").concat(_this37.options.cellSize, "px; padding: 10px 5px;'\n >").concat(c.value || '&nbsp;', "</td>\n ");
6483
+ 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 ");
6321
6484
  }).join('') + '</tr>'; // get height of the first data cell
6322
6485
 
6323
6486
  var cells = bodyEl.querySelectorAll("tr:first-of-type td");
@@ -6522,7 +6685,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6522
6685
  }, {
6523
6686
  key: "buildHeaderHtml",
6524
6687
  value: function buildHeaderHtml() {
6525
- var _this38 = this;
6688
+ var _this39 = this;
6526
6689
 
6527
6690
  var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6528
6691
  var headerHtml = '';
@@ -6537,7 +6700,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6537
6700
  }
6538
6701
 
6539
6702
  this.options.columns.forEach(function (row, rowIndex) {
6540
- if (useWidths === false && rowIndex !== _this38.options.columns.length - 1) {
6703
+ if (useWidths === false && rowIndex !== _this39.options.columns.length - 1) {
6541
6704
  // if we're calculating the size we only want to render the last row of column headers
6542
6705
  return;
6543
6706
  }
@@ -6563,18 +6726,18 @@ var WebsyTable3 = /*#__PURE__*/function () {
6563
6726
  // `
6564
6727
  // }
6565
6728
 
6566
- headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ? _this38.buildSearchIcon(col, colIndex) : '', "</div></td>");
6729
+ headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ? _this39.buildSearchIcon(col, colIndex) : '', "</div></td>");
6567
6730
  });
6568
6731
  headerHtml += "</tr>";
6569
6732
  });
6570
6733
  var dropdownEl = document.getElementById("".concat(this.elementId, "_dropdownContainer"));
6571
6734
  this.options.columns[this.options.columns.length - 1].forEach(function (c, i) {
6572
6735
  if (c.searchable && c.isExternalSearch === true) {
6573
- var testEl = document.getElementById("".concat(_this38.elementId, "_columnSearch_").concat(c.dimId || i));
6736
+ var testEl = document.getElementById("".concat(_this39.elementId, "_columnSearch_").concat(c.dimId || i));
6574
6737
 
6575
6738
  if (!testEl) {
6576
6739
  var newE = document.createElement('div');
6577
- newE.id = "".concat(_this38.elementId, "_columnSearch_").concat(c.dimId || i);
6740
+ newE.id = "".concat(_this39.elementId, "_columnSearch_").concat(c.dimId || i);
6578
6741
  newE.className = 'websy-modal-dropdown';
6579
6742
  dropdownEl.appendChild(newE);
6580
6743
  }
@@ -6590,7 +6753,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6590
6753
  }, {
6591
6754
  key: "buildTotalHtml",
6592
6755
  value: function buildTotalHtml() {
6593
- var _this39 = this;
6756
+ var _this40 = this;
6594
6757
 
6595
6758
  var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6596
6759
 
@@ -6603,7 +6766,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6603
6766
  totalHtml += "<td \n class='websy-table-cell'\n colspan='".concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
6604
6767
 
6605
6768
  if (useWidths === true) {
6606
- totalHtml += "\n style='width: ".concat(_this39.options.columns[_this39.options.columns.length - 1][colIndex].width || _this39.options.columns[_this39.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
6769
+ totalHtml += "\n style='width: ".concat(_this40.options.columns[_this40.options.columns.length - 1][colIndex].width || _this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
6607
6770
  }
6608
6771
 
6609
6772
  totalHtml += " \n >\n ".concat(col.value, "\n </td>");
@@ -6614,7 +6777,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6614
6777
  }, {
6615
6778
  key: "calculateSizes",
6616
6779
  value: function calculateSizes() {
6617
- var _this40 = this;
6780
+ var _this41 = this;
6618
6781
 
6619
6782
  var sample = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6620
6783
  var totalRowCount = arguments.length > 1 ? arguments[1] : undefined;
@@ -6657,32 +6820,32 @@ var WebsyTable3 = /*#__PURE__*/function () {
6657
6820
  rows.forEach(function (row, rowIndex) {
6658
6821
  Array.from(row.children).forEach(function (col, colIndex) {
6659
6822
  var colSize = col.getBoundingClientRect();
6660
- _this40.sizes.cellHeight = colSize.height;
6823
+ _this41.sizes.cellHeight = colSize.height;
6661
6824
 
6662
- if (_this40.options.columns[_this40.options.columns.length - 1][colIndex]) {
6663
- if (!_this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth) {
6664
- _this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth = 0;
6825
+ if (_this41.options.columns[_this41.options.columns.length - 1][colIndex]) {
6826
+ if (!_this41.options.columns[_this41.options.columns.length - 1][colIndex].actualWidth) {
6827
+ _this41.options.columns[_this41.options.columns.length - 1][colIndex].actualWidth = 0;
6665
6828
  }
6666
6829
 
6667
- _this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth = Math.min(Math.max(_this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth, colSize.width), maxWidth);
6668
- _this40.options.columns[_this40.options.columns.length - 1][colIndex].cellHeight = colSize.height;
6830
+ _this41.options.columns[_this41.options.columns.length - 1][colIndex].actualWidth = Math.min(Math.max(_this41.options.columns[_this41.options.columns.length - 1][colIndex].actualWidth, colSize.width), maxWidth);
6831
+ _this41.options.columns[_this41.options.columns.length - 1][colIndex].cellHeight = colSize.height;
6669
6832
 
6670
- if (colIndex >= _this40.pinnedColumns) {
6671
- firstNonPinnedColumnWidth = _this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth;
6833
+ if (colIndex >= _this41.pinnedColumns) {
6834
+ firstNonPinnedColumnWidth = _this41.options.columns[_this41.options.columns.length - 1][colIndex].actualWidth;
6672
6835
  }
6673
6836
  }
6674
6837
  });
6675
6838
  });
6676
6839
  this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
6677
- if (colIndex < _this40.pinnedColumns) {
6678
- _this40.sizes.scrollableWidth -= col.actualWidth;
6840
+ if (colIndex < _this41.pinnedColumns) {
6841
+ _this41.sizes.scrollableWidth -= col.actualWidth;
6679
6842
  }
6680
6843
  });
6681
6844
  this.sizes.totalWidth = this.options.columns[this.options.columns.length - 1].reduce(function (a, b) {
6682
6845
  return a + (b.width || b.actualWidth);
6683
6846
  }, 0);
6684
6847
  this.sizes.totalNonPinnedWidth = this.options.columns[this.options.columns.length - 1].filter(function (c, i) {
6685
- return i >= _this40.pinnedColumns;
6848
+ return i >= _this41.pinnedColumns;
6686
6849
  }).reduce(function (a, b) {
6687
6850
  return a + (b.width || b.actualWidth);
6688
6851
  }, 0);
@@ -6703,10 +6866,10 @@ var WebsyTable3 = /*#__PURE__*/function () {
6703
6866
  c.actualWidth += equalWidth; // }
6704
6867
  // }
6705
6868
 
6706
- _this40.sizes.totalWidth += c.width || c.actualWidth;
6869
+ _this41.sizes.totalWidth += c.width || c.actualWidth;
6707
6870
 
6708
- if (i < _this40.pinnedColumns) {
6709
- _this40.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
6871
+ if (i < _this41.pinnedColumns) {
6872
+ _this41.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
6710
6873
  } // equalWidth = (outerSize.width - this.sizes.totalWidth) / (this.options.columns[this.options.columns.length - 1].length - (i + 1))
6711
6874
 
6712
6875
  });
@@ -6763,6 +6926,8 @@ var WebsyTable3 = /*#__PURE__*/function () {
6763
6926
  }, {
6764
6927
  key: "createSample",
6765
6928
  value: function createSample(data) {
6929
+ var _this42 = this;
6930
+
6766
6931
  var output = [];
6767
6932
  this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
6768
6933
  if (col.maxLength) {
@@ -6773,8 +6938,10 @@ var WebsyTable3 = /*#__PURE__*/function () {
6773
6938
  var longest = '';
6774
6939
 
6775
6940
  for (var i = 0; i < Math.min(data.length, 1000); i++) {
6776
- if (longest.length < data[i][colIndex].value.length) {
6777
- longest = data[i][colIndex].value;
6941
+ if (data[i].length === _this42.options.columns[_this42.options.columns.length - 1].length) {
6942
+ if (longest.length < data[i][colIndex].value.length) {
6943
+ longest = data[i][colIndex].value;
6944
+ }
6778
6945
  }
6779
6946
  }
6780
6947
 
@@ -7164,7 +7331,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7164
7331
 
7165
7332
  var WebsyChart = /*#__PURE__*/function () {
7166
7333
  function WebsyChart(elementId, options) {
7167
- var _this41 = this;
7334
+ var _this43 = this;
7168
7335
 
7169
7336
  _classCallCheck(this, WebsyChart);
7170
7337
 
@@ -7215,22 +7382,22 @@ var WebsyChart = /*#__PURE__*/function () {
7215
7382
  this.invertOverride = function (input, input2) {
7216
7383
  var xAxis = 'bottomAxis';
7217
7384
 
7218
- if (_this41.options.orientation === 'horizontal') {
7385
+ if (_this43.options.orientation === 'horizontal') {
7219
7386
  xAxis = 'leftAxis';
7220
7387
  }
7221
7388
 
7222
- var width = _this41[xAxis].step();
7389
+ var width = _this43[xAxis].step();
7223
7390
 
7224
7391
  var output;
7225
7392
 
7226
- var domain = _toConsumableArray(_this41[xAxis].domain());
7393
+ var domain = _toConsumableArray(_this43[xAxis].domain());
7227
7394
 
7228
- if (_this41.options.orientation === 'horizontal') {
7395
+ if (_this43.options.orientation === 'horizontal') {
7229
7396
  domain = domain.reverse();
7230
7397
  }
7231
7398
 
7232
7399
  for (var j = 0; j < domain.length; j++) {
7233
- var breakA = _this41[xAxis](domain[j]) - width / 2;
7400
+ var breakA = _this43[xAxis](domain[j]) - width / 2;
7234
7401
  var breakB = breakA + width;
7235
7402
 
7236
7403
  if (input > breakA && input <= breakB) {
@@ -7330,10 +7497,10 @@ var WebsyChart = /*#__PURE__*/function () {
7330
7497
  }, {
7331
7498
  key: "handleEventMouseMove",
7332
7499
  value: function handleEventMouseMove(event, d) {
7333
- var _this42 = this;
7500
+ var _this44 = this;
7334
7501
 
7335
7502
  var bisectDate = d3.bisector(function (d) {
7336
- return _this42.parseX(d.x.value);
7503
+ return _this44.parseX(d.x.value);
7337
7504
  }).left;
7338
7505
 
7339
7506
  if (this.options.showTrackingLine === true && d3.pointer(event)) {
@@ -7372,8 +7539,8 @@ var WebsyChart = /*#__PURE__*/function () {
7372
7539
  }
7373
7540
 
7374
7541
  this.options.data.series.forEach(function (s) {
7375
- if (_this42.options.data[xData].scale !== 'Time') {
7376
- xPoint = _this42[xAxis](_this42.parseX(xLabel));
7542
+ if (_this44.options.data[xData].scale !== 'Time') {
7543
+ xPoint = _this44[xAxis](_this44.parseX(xLabel));
7377
7544
  s.data.forEach(function (d) {
7378
7545
  if (d.x.value === xLabel) {
7379
7546
  if (!tooltipTitle) {
@@ -7392,13 +7559,13 @@ var WebsyChart = /*#__PURE__*/function () {
7392
7559
  var pointA = s.data[index - 1];
7393
7560
  var pointB = s.data[index];
7394
7561
 
7395
- if (_this42.options.orientation === 'horizontal') {
7562
+ if (_this44.options.orientation === 'horizontal') {
7396
7563
  pointA = _toConsumableArray(s.data).reverse()[index - 1];
7397
7564
  pointB = _toConsumableArray(s.data).reverse()[index];
7398
7565
  }
7399
7566
 
7400
7567
  if (pointA && !pointB) {
7401
- xPoint = _this42[xAxis](_this42.parseX(pointA.x.value));
7568
+ xPoint = _this44[xAxis](_this44.parseX(pointA.x.value));
7402
7569
  tooltipTitle = pointA.x.value;
7403
7570
 
7404
7571
  if (!pointA.y.color) {
@@ -7408,12 +7575,12 @@ var WebsyChart = /*#__PURE__*/function () {
7408
7575
  tooltipData.push(pointA.y);
7409
7576
 
7410
7577
  if (typeof pointA.x.value.getTime !== 'undefined') {
7411
- tooltipTitle = d3.timeFormat(_this42.options.dateFormat || _this42.options.calculatedTimeFormatPattern)(pointA.x.value);
7578
+ tooltipTitle = d3.timeFormat(_this44.options.dateFormat || _this44.options.calculatedTimeFormatPattern)(pointA.x.value);
7412
7579
  }
7413
7580
  }
7414
7581
 
7415
7582
  if (pointB && !pointA) {
7416
- xPoint = _this42[xAxis](_this42.parseX(pointB.x.value));
7583
+ xPoint = _this44[xAxis](_this44.parseX(pointB.x.value));
7417
7584
  tooltipTitle = pointB.x.value;
7418
7585
 
7419
7586
  if (!pointB.y.color) {
@@ -7423,14 +7590,14 @@ var WebsyChart = /*#__PURE__*/function () {
7423
7590
  tooltipData.push(pointB.y);
7424
7591
 
7425
7592
  if (typeof pointB.x.value.getTime !== 'undefined') {
7426
- tooltipTitle = d3.timeFormat(_this42.options.dateFormat || _this42.options.calculatedTimeFormatPattern)(pointB.x.value);
7593
+ tooltipTitle = d3.timeFormat(_this44.options.dateFormat || _this44.options.calculatedTimeFormatPattern)(pointB.x.value);
7427
7594
  }
7428
7595
  }
7429
7596
 
7430
7597
  if (pointA && pointB) {
7431
- var d0 = _this42[xAxis](_this42.parseX(pointA.x.value));
7598
+ var d0 = _this44[xAxis](_this44.parseX(pointA.x.value));
7432
7599
 
7433
- var d1 = _this42[xAxis](_this42.parseX(pointB.x.value));
7600
+ var d1 = _this44[xAxis](_this44.parseX(pointB.x.value));
7434
7601
 
7435
7602
  var mid = Math.abs(d0 - d1) / 2;
7436
7603
 
@@ -7439,7 +7606,7 @@ var WebsyChart = /*#__PURE__*/function () {
7439
7606
  tooltipTitle = pointB.x.value;
7440
7607
 
7441
7608
  if (typeof pointB.x.value.getTime !== 'undefined') {
7442
- tooltipTitle = d3.timeFormat(_this42.options.dateFormat || _this42.options.calculatedTimeFormatPattern)(pointB.x.value);
7609
+ tooltipTitle = d3.timeFormat(_this44.options.dateFormat || _this44.options.calculatedTimeFormatPattern)(pointB.x.value);
7443
7610
  }
7444
7611
 
7445
7612
  if (!pointB.y.color) {
@@ -7452,7 +7619,7 @@ var WebsyChart = /*#__PURE__*/function () {
7452
7619
  tooltipTitle = pointA.x.value;
7453
7620
 
7454
7621
  if (typeof pointB.x.value.getTime !== 'undefined') {
7455
- tooltipTitle = d3.timeFormat(_this42.options.dateFormat || _this42.options.calculatedTimeFormatPattern)(pointB.x.value);
7622
+ tooltipTitle = d3.timeFormat(_this44.options.dateFormat || _this44.options.calculatedTimeFormatPattern)(pointB.x.value);
7456
7623
  }
7457
7624
 
7458
7625
  if (!pointA.y.color) {
@@ -7566,7 +7733,7 @@ var WebsyChart = /*#__PURE__*/function () {
7566
7733
  }, {
7567
7734
  key: "render",
7568
7735
  value: function render(options) {
7569
- var _this43 = this;
7736
+ var _this45 = this;
7570
7737
 
7571
7738
  /* global d3 options WebsyUtils */
7572
7739
  if (typeof options !== 'undefined') {
@@ -7635,7 +7802,7 @@ var WebsyChart = /*#__PURE__*/function () {
7635
7802
  var legendData = this.options.data.series.map(function (s, i) {
7636
7803
  return {
7637
7804
  value: s.label || s.key,
7638
- color: s.color || _this43.options.colors[i % _this43.options.colors.length]
7805
+ color: s.color || _this45.options.colors[i % _this45.options.colors.length]
7639
7806
  };
7640
7807
  });
7641
7808
 
@@ -7917,7 +8084,7 @@ var WebsyChart = /*#__PURE__*/function () {
7917
8084
 
7918
8085
  if (this.options.data.bottom.formatter) {
7919
8086
  bAxisFunc.tickFormat(function (d) {
7920
- return _this43.options.data.bottom.formatter(d);
8087
+ return _this45.options.data.bottom.formatter(d);
7921
8088
  });
7922
8089
  }
7923
8090
 
@@ -7943,8 +8110,8 @@ var WebsyChart = /*#__PURE__*/function () {
7943
8110
 
7944
8111
  if (this.options.margin.axisLeft > 0) {
7945
8112
  this.leftAxisLayer.call(d3.axisLeft(this.leftAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
7946
- if (_this43.options.data.left.formatter) {
7947
- d = _this43.options.data.left.formatter(d);
8113
+ if (_this45.options.data.left.formatter) {
8114
+ d = _this45.options.data.left.formatter(d);
7948
8115
  }
7949
8116
 
7950
8117
  return d;
@@ -7981,8 +8148,8 @@ var WebsyChart = /*#__PURE__*/function () {
7981
8148
 
7982
8149
  if (this.options.margin.axisRight > 0 && (this.options.data.right.min !== 0 || this.options.data.right.max !== 0)) {
7983
8150
  this.rightAxisLayer.call(d3.axisRight(this.rightAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
7984
- if (_this43.options.data.right.formatter) {
7985
- d = _this43.options.data.right.formatter(d);
8151
+ if (_this45.options.data.right.formatter) {
8152
+ d = _this45.options.data.right.formatter(d);
7986
8153
  }
7987
8154
 
7988
8155
  return d;
@@ -8021,18 +8188,18 @@ var WebsyChart = /*#__PURE__*/function () {
8021
8188
  this.renderedKeys = {};
8022
8189
  this.options.data.series.forEach(function (series, index) {
8023
8190
  if (!series.key) {
8024
- series.key = _this43.createIdentity();
8191
+ series.key = _this45.createIdentity();
8025
8192
  }
8026
8193
 
8027
8194
  if (!series.color) {
8028
- series.color = _this43.options.colors[index % _this43.options.colors.length];
8195
+ series.color = _this45.options.colors[index % _this45.options.colors.length];
8029
8196
  }
8030
8197
 
8031
- _this43["render".concat(series.type || 'bar')](series, index);
8198
+ _this45["render".concat(series.type || 'bar')](series, index);
8032
8199
 
8033
- _this43.renderLabels(series, index);
8200
+ _this45.renderLabels(series, index);
8034
8201
 
8035
- _this43.renderedKeys[series.key] = series.type;
8202
+ _this45.renderedKeys[series.key] = series.type;
8036
8203
  });
8037
8204
  }
8038
8205
  }
@@ -8040,17 +8207,17 @@ var WebsyChart = /*#__PURE__*/function () {
8040
8207
  }, {
8041
8208
  key: "renderarea",
8042
8209
  value: function renderarea(series, index) {
8043
- var _this44 = this;
8210
+ var _this46 = this;
8044
8211
 
8045
8212
  /* global d3 series index */
8046
8213
  var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
8047
8214
  return d3.area().x(function (d) {
8048
- return _this44[xAxis](_this44.parseX(d.x.value));
8215
+ return _this46[xAxis](_this46.parseX(d.x.value));
8049
8216
  }).y0(function (d) {
8050
- return _this44[yAxis](0);
8217
+ return _this46[yAxis](0);
8051
8218
  }).y1(function (d) {
8052
- return _this44[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
8053
- }).curve(d3[curveStyle || _this44.options.curveStyle]);
8219
+ return _this46[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
8220
+ }).curve(d3[curveStyle || _this46.options.curveStyle]);
8054
8221
  };
8055
8222
 
8056
8223
  var xAxis = 'bottomAxis';
@@ -8173,7 +8340,7 @@ var WebsyChart = /*#__PURE__*/function () {
8173
8340
  }, {
8174
8341
  key: "renderLabels",
8175
8342
  value: function renderLabels(series, index) {
8176
- var _this45 = this;
8343
+ var _this47 = this;
8177
8344
 
8178
8345
  /* global series index d3 WebsyDesigns */
8179
8346
  var xAxis = 'bottomAxis';
@@ -8192,11 +8359,11 @@ var WebsyChart = /*#__PURE__*/function () {
8192
8359
  var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
8193
8360
  labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
8194
8361
  labels.attr('x', function (d) {
8195
- return getLabelX.call(_this45, d, series.labelPosition);
8362
+ return getLabelX.call(_this47, d, series.labelPosition);
8196
8363
  }).attr('y', function (d) {
8197
- return getLabelY.call(_this45, d, series.labelPosition);
8364
+ return getLabelY.call(_this47, d, series.labelPosition);
8198
8365
  }).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
8199
- return _this45.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
8366
+ return _this47.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
8200
8367
  }).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
8201
8368
  return d.y.label || d.y.value;
8202
8369
  }).each(function (d, i) {
@@ -8221,11 +8388,11 @@ var WebsyChart = /*#__PURE__*/function () {
8221
8388
  }
8222
8389
  });
8223
8390
  labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', function (d) {
8224
- return getLabelX.call(_this45, d, series.labelPosition);
8391
+ return getLabelX.call(_this47, d, series.labelPosition);
8225
8392
  }).attr('y', function (d) {
8226
- return getLabelY.call(_this45, d, series.labelPosition);
8393
+ return getLabelY.call(_this47, d, series.labelPosition);
8227
8394
  }).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
8228
- return _this45.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
8395
+ return _this47.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
8229
8396
  }).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).text(function (d) {
8230
8397
  return d.y.label || d.y.value;
8231
8398
  }).each(function (d, i) {
@@ -8282,16 +8449,16 @@ var WebsyChart = /*#__PURE__*/function () {
8282
8449
  }, {
8283
8450
  key: "renderline",
8284
8451
  value: function renderline(series, index) {
8285
- var _this46 = this;
8452
+ var _this48 = this;
8286
8453
 
8287
8454
  /* global series index d3 */
8288
8455
  var drawLine = function drawLine(xAxis, yAxis, curveStyle) {
8289
8456
  return d3.line().x(function (d) {
8290
- var adjustment = _this46.options.data[xAxis].scale === 'Time' ? 0 : _this46["".concat(xAxis, "Axis")].bandwidth() / 2;
8291
- return _this46["".concat(xAxis, "Axis")](_this46.parseX(d.x.value)) + adjustment;
8457
+ var adjustment = _this48.options.data[xAxis].scale === 'Time' ? 0 : _this48["".concat(xAxis, "Axis")].bandwidth() / 2;
8458
+ return _this48["".concat(xAxis, "Axis")](_this48.parseX(d.x.value)) + adjustment;
8292
8459
  }).y(function (d) {
8293
- return _this46["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
8294
- }).curve(d3[curveStyle || _this46.options.curveStyle]);
8460
+ return _this48["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
8461
+ }).curve(d3[curveStyle || _this48.options.curveStyle]);
8295
8462
  };
8296
8463
 
8297
8464
  var xAxis = 'bottom';
@@ -8335,14 +8502,14 @@ var WebsyChart = /*#__PURE__*/function () {
8335
8502
  }, {
8336
8503
  key: "rendersymbol",
8337
8504
  value: function rendersymbol(series, index) {
8338
- var _this47 = this;
8505
+ var _this49 = this;
8339
8506
 
8340
8507
  /* global d3 series index series.key */
8341
8508
  var drawSymbol = function drawSymbol(size) {
8342
8509
  return d3.symbol() // .type(d => {
8343
8510
  // return d3.symbols[0]
8344
8511
  // })
8345
- .size(size || _this47.options.symbolSize);
8512
+ .size(size || _this49.options.symbolSize);
8346
8513
  };
8347
8514
 
8348
8515
  var xAxis = 'bottomAxis';
@@ -8360,7 +8527,7 @@ var WebsyChart = /*#__PURE__*/function () {
8360
8527
  symbols.attr('d', function (d) {
8361
8528
  return drawSymbol(d.y.size || series.symbolSize)(d);
8362
8529
  }).transition(this.transition).attr('fill', 'white').attr('stroke', series.color).attr('transform', function (d) {
8363
- return "translate(".concat(_this47[xAxis](_this47.parseX(d.x.value)), ", ").concat(_this47[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8530
+ return "translate(".concat(_this49[xAxis](_this49.parseX(d.x.value)), ", ").concat(_this49[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8364
8531
  }); // Enter
8365
8532
 
8366
8533
  symbols.enter().append('path').attr('d', function (d) {
@@ -8369,7 +8536,7 @@ var WebsyChart = /*#__PURE__*/function () {
8369
8536
  .attr('fill', 'white').attr('stroke', series.color).attr('class', function (d) {
8370
8537
  return "symbol symbol_".concat(series.key);
8371
8538
  }).attr('transform', function (d) {
8372
- return "translate(".concat(_this47[xAxis](_this47.parseX(d.x.value)), ", ").concat(_this47[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8539
+ return "translate(".concat(_this49[xAxis](_this49.parseX(d.x.value)), ", ").concat(_this49[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
8373
8540
  });
8374
8541
  }
8375
8542
  }, {
@@ -8524,7 +8691,7 @@ var WebsyLegend = /*#__PURE__*/function () {
8524
8691
  }, {
8525
8692
  key: "resize",
8526
8693
  value: function resize() {
8527
- var _this48 = this;
8694
+ var _this50 = this;
8528
8695
 
8529
8696
  var el = document.getElementById(this.elementId);
8530
8697
 
@@ -8537,7 +8704,7 @@ var WebsyLegend = /*#__PURE__*/function () {
8537
8704
  // }
8538
8705
  var html = "\n <div class='text-".concat(this.options.align, "'>\n ");
8539
8706
  html += this._data.map(function (d, i) {
8540
- return _this48.getLegendItemHTML(d);
8707
+ return _this50.getLegendItemHTML(d);
8541
8708
  }).join('');
8542
8709
  html += "\n <div>\n ";
8543
8710
  el.innerHTML = html;
@@ -8709,7 +8876,7 @@ var WebsyMap = /*#__PURE__*/function () {
8709
8876
  }, {
8710
8877
  key: "render",
8711
8878
  value: function render() {
8712
- var _this49 = this;
8879
+ var _this51 = this;
8713
8880
 
8714
8881
  var mapEl = document.getElementById("".concat(this.elementId, "_map"));
8715
8882
  var legendEl = document.getElementById("".concat(this.elementId, "_map"));
@@ -8718,7 +8885,7 @@ var WebsyMap = /*#__PURE__*/function () {
8718
8885
  var legendData = this.options.data.polygons.map(function (s, i) {
8719
8886
  return {
8720
8887
  value: s.label || s.key,
8721
- color: s.color || _this49.options.colors[i % _this49.options.colors.length]
8888
+ color: s.color || _this51.options.colors[i % _this51.options.colors.length]
8722
8889
  };
8723
8890
  });
8724
8891
  var longestValue = legendData.map(function (s) {
@@ -8782,7 +8949,7 @@ var WebsyMap = /*#__PURE__*/function () {
8782
8949
 
8783
8950
  if (this.polygons) {
8784
8951
  this.polygons.forEach(function (p) {
8785
- return _this49.map.removeLayer(p);
8952
+ return _this51.map.removeLayer(p);
8786
8953
  });
8787
8954
  }
8788
8955
 
@@ -8840,18 +9007,18 @@ var WebsyMap = /*#__PURE__*/function () {
8840
9007
  }
8841
9008
 
8842
9009
  if (!p.options.color) {
8843
- p.options.color = _this49.options.colors[i % _this49.options.colors.length];
9010
+ p.options.color = _this51.options.colors[i % _this51.options.colors.length];
8844
9011
  }
8845
9012
 
8846
9013
  var pol = L.polygon(p.data.map(function (c) {
8847
9014
  return c.map(function (d) {
8848
9015
  return [d.Latitude, d.Longitude];
8849
9016
  });
8850
- }), p.options).addTo(_this49.map);
9017
+ }), p.options).addTo(_this51.map);
8851
9018
 
8852
- _this49.polygons.push(pol);
9019
+ _this51.polygons.push(pol);
8853
9020
 
8854
- _this49.map.fitBounds(pol.getBounds());
9021
+ _this51.map.fitBounds(pol.getBounds());
8855
9022
  });
8856
9023
  } // if (this.data.markers.length > 0) {
8857
9024
  // el.classList.remove('hidden')