@websy/websy-designs 1.10.2 → 1.10.4

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.
@@ -5116,22 +5116,71 @@ var WebsySearch = /*#__PURE__*/function () {
5116
5116
  clearAlwaysOn: false,
5117
5117
  placeholder: 'Search',
5118
5118
  searchTimeout: 500,
5119
+ suggestTimeout: 100,
5120
+ suggestingTimeout: 3000,
5121
+ suggestLimit: 5,
5119
5122
  minLength: 2
5120
5123
  };
5121
5124
  this.options = _extends({}, DEFAULTS, options);
5122
5125
  this.searchTimeoutFn = null;
5126
+ this.suggestTimeoutFn = null;
5127
+ this.suggestingTimeoutFn = null;
5128
+ this.isSuggesting = false;
5129
+ this.inSuggestions = false;
5130
+ this.cursorPosition = 0;
5131
+ this.terms = [];
5132
+ this.Key = {
5133
+ BACKSPACE: 8,
5134
+ ESCAPE: 27,
5135
+ CONTROL: 17,
5136
+ COMMAND: 91,
5137
+ PASTE: 86,
5138
+ TAB: 9,
5139
+ ENTER: 13,
5140
+ SHIFT: 16,
5141
+ UP: 38,
5142
+ DOWN: 40,
5143
+ RIGHT: 39,
5144
+ LEFT: 37,
5145
+ DELETE: 46,
5146
+ SPACE: 32
5147
+ };
5123
5148
  var el = document.getElementById(elementId);
5124
5149
  if (el) {
5125
5150
  // el.addEventListener('click', this.handleClick.bind(this))
5126
5151
  el.addEventListener('click', this.handleClick.bind(this));
5127
5152
  el.addEventListener('keyup', this.handleKeyUp.bind(this));
5128
- el.addEventListener('keyup', this.handleKeyDown.bind(this));
5129
- el.innerHTML = "\n <div class='websy-search-input-container'>\n ".concat(this.options.searchIcon, "\n <input id='").concat(this.elementId, "_search' class='websy-search-input' placeholder='").concat(this.options.placeholder || 'Search', "' value='").concat(this.options.initialValue || '', "'>\n <div class='clear ").concat(this.options.clearAlwaysOn === true ? '' : 'websy-hidden', "' id='").concat(this.elementId, "_clear'>\n ").concat(this.options.clearIcon, "\n </div>\n </div>\n ");
5153
+ el.addEventListener('keydown', this.handleKeyDown.bind(this));
5154
+ el.addEventListener('mouseover', this.handleMouseOver.bind(this));
5155
+ // el.innerHTML = `
5156
+ // <div class='websy-search-input-container'>
5157
+ // ${this.options.searchIcon}
5158
+ // <input id='${this.elementId}_search' class='websy-search-input' placeholder='${this.options.placeholder || 'Search'}' value='${this.options.initialValue || ''}'>
5159
+ // <div class='clear ${this.options.clearAlwaysOn === true ? '' : 'websy-hidden'}' id='${this.elementId}_clear'>
5160
+ // ${this.options.clearIcon}
5161
+ // </div>
5162
+ // </div>
5163
+ // `
5164
+ el.innerHTML = "\n <div class='websy-search-input-container'>\n ".concat(this.options.searchIcon, "\n <div id='").concat(this.elementId, "_ghost' class='websy-search-input-ghost'></div>\n <div id='").concat(this.elementId, "_lozenges' class='websy-search-lozenge-container'></div>\n <input id='").concat(this.elementId, "_search' class='websy-search-input' placeholder='").concat(this.options.placeholder || 'Search', "' value='").concat(this.options.initialValue || '', "' autocorrect='off' autocomplete='off' autocapitalize='off' spellcheck='false'>\n <div id='").concat(this.elementId, "_ambiguities' class='websy-search-ambiguity-container'></div>\n <div class='clear ").concat(this.options.clearAlwaysOn === true ? '' : 'websy-hidden', "' id='").concat(this.elementId, "_clear'>\n ").concat(this.options.clearIcon, "\n </div>\n <div id='").concat(this.elementId, "_suggestions' class='websy-search-suggestion-container'>\n <ul id='").concat(this.elementId, "_suggestionList'></ul>\n </div>\n <div id='").concat(this.elementId, "_associations' class='websy-search-association-container'>\n <ul id='").concat(this.elementId, "_associationsList'></ul>\n </div>\n </div>\n ");
5130
5165
  } else {
5131
5166
  console.log('No element found with Id', elementId);
5132
5167
  }
5133
5168
  }
5134
5169
  _createClass(WebsySearch, [{
5170
+ key: "acceptSuggestion",
5171
+ value: function acceptSuggestion() {
5172
+ this.searchText = this.ghostQuery;
5173
+ this.suggestions = [];
5174
+ this.hideSuggestions();
5175
+ var inputEl = document.getElementById("".concat(this.elementId, "_search"));
5176
+ if (inputEl) {
5177
+ inputEl.value = this.searchText;
5178
+ }
5179
+ if (this.options.onSearch) {
5180
+ this.options.onSearch(this.searchText);
5181
+ }
5182
+ }
5183
+ }, {
5135
5184
  key: "handleClick",
5136
5185
  value: function handleClick(event) {
5137
5186
  if (event.target.classList.contains('clear')) {
@@ -5143,6 +5192,8 @@ var WebsySearch = /*#__PURE__*/function () {
5143
5192
  if (this.options.onClear) {
5144
5193
  this.options.onClear();
5145
5194
  }
5195
+ } else if (event.target.classList.contains('websy-search-suggestion-item')) {
5196
+ this.acceptSuggestion();
5146
5197
  }
5147
5198
  }
5148
5199
  }, {
@@ -5154,17 +5205,65 @@ var WebsySearch = /*#__PURE__*/function () {
5154
5205
  event.preventDefault();
5155
5206
  return false;
5156
5207
  }
5208
+ } else if (event.keyCode === this.Key.ESCAPE) {
5209
+ this.hideSuggestions();
5210
+ } else if (event.keyCode === this.Key.CONTROL || event.keyCode === this.Key.COMMAND) {
5211
+ // show the suggestions again
5212
+ this.isCutCopyPaste = true;
5213
+ } else if (event.keyCode === this.Key.PASTE && this.isCutCopyPaste) {
5214
+ // show the suggestions again
5215
+ this.isPaste = true;
5216
+ } else if (event.keyCode === this.Key.DOWN) {
5217
+ // show the suggestions again
5218
+ this.inSuggestions = true;
5219
+ this.showSuggestions();
5220
+ } else if (event.keyCode === this.Key.UP) {
5221
+ // show the suggestions again
5222
+ if (this.inSuggestions) {
5223
+ event.preventDefault();
5224
+ }
5225
+ this.inSuggestions = false;
5226
+ } else if (event.keyCode === this.Key.RIGHT) {
5227
+ if (this.suggesting && this.inSuggestions) {
5228
+ // activate the next suggestion
5229
+ event.preventDefault();
5230
+ this.nextSuggestion();
5231
+ }
5232
+ } else if (event.keyCode === this.Key.LEFT) {
5233
+ if (this.suggesting && this.inSuggestions) {
5234
+ // activate the previous suggestion
5235
+ event.preventDefault();
5236
+ this.prevSuggestion();
5237
+ }
5238
+ } else if (event.keyCode === this.Key.ENTER || event.keyCode === this.Key.TAB) {
5239
+ if (this.suggesting) {
5240
+ event.preventDefault();
5241
+ this.acceptSuggestion();
5242
+ } else if (this.associating && event.keyCode === this.Key.ENTER) {
5243
+ event.preventDefault();
5244
+ // this.searchEntity.selectAssociations(this.searchFields || [], 0);
5245
+ this.hideAssociations();
5246
+ }
5247
+ } else if (event.keyCode === this.Key.SPACE) {
5248
+ this.hideSuggestions();
5249
+ // this.hideAssociations()
5157
5250
  }
5251
+ // else{
5252
+ // this.hideSuggestions();
5253
+ // this.hideAssociations();
5254
+ // }
5158
5255
  }
5159
5256
  }, {
5160
5257
  key: "handleKeyUp",
5161
5258
  value: function handleKeyUp(event) {
5162
5259
  var _this35 = this;
5163
5260
  if (event.target.classList.contains('websy-search-input')) {
5261
+ this.cursorPosition = event.target.selectionStart;
5262
+ this.searchText = event.target.value;
5164
5263
  if (this.searchTimeoutFn) {
5165
5264
  clearTimeout(this.searchTimeoutFn);
5166
5265
  }
5167
- if (event.key === 'Enter') {
5266
+ if (event.key === 'Enter' || event.key === 'Tab') {
5168
5267
  return false;
5169
5268
  }
5170
5269
  var clearEl = document.getElementById("".concat(this.elementId, "_clear"));
@@ -5175,6 +5274,9 @@ var WebsySearch = /*#__PURE__*/function () {
5175
5274
  clearEl.classList.add('websy-hidden');
5176
5275
  }
5177
5276
  }
5277
+ if (this.options.onKeyUp) {
5278
+ this.options.onKeyUp(event.target.value, event);
5279
+ }
5178
5280
  if (event.target.value.length >= this.options.minLength) {
5179
5281
  this.searchTimeoutFn = setTimeout(function () {
5180
5282
  if (_this35.options.onSearch) {
@@ -5189,6 +5291,174 @@ var WebsySearch = /*#__PURE__*/function () {
5189
5291
  }
5190
5292
  }
5191
5293
  }
5294
+ this.renderLozenges();
5295
+ }
5296
+ }, {
5297
+ key: "handleMouseOver",
5298
+ value: function handleMouseOver(event) {
5299
+ if (event.target.classList.contains('websy-search-suggestion-item')) {
5300
+ this.startSuggestionTimeout();
5301
+ var index = event.target.getAttribute('data-index');
5302
+ this.activeSuggestion = +index;
5303
+ this.renderGhost();
5304
+ this.highlightActiveSuggestion();
5305
+ }
5306
+ }
5307
+ }, {
5308
+ key: "hideSuggestions",
5309
+ value: function hideSuggestions() {
5310
+ this.suggesting = false;
5311
+ this.activeSuggestion = 0;
5312
+ this.inSuggestions = false;
5313
+ this.ghostPart = '';
5314
+ this.ghostQuery = '';
5315
+ this.ghostDisplay = '';
5316
+ this.hideGhost();
5317
+ var suggestEl = document.getElementById("".concat(this.elementId, "_suggestions"));
5318
+ if (suggestEl) {
5319
+ suggestEl.classList.remove('active');
5320
+ }
5321
+ }
5322
+ }, {
5323
+ key: "hideGhost",
5324
+ value: function hideGhost() {
5325
+ var ghostEl = document.getElementById("".concat(this.elementId, "_ghost"));
5326
+ if (ghostEl) {
5327
+ ghostEl.innerHTML = '';
5328
+ }
5329
+ }
5330
+ }, {
5331
+ key: "highlightActiveSuggestion",
5332
+ value: function highlightActiveSuggestion() {
5333
+ var _this36 = this;
5334
+ // remove all previous highlights
5335
+ // const parent = document.getElementById(`${this.elementId}_suggestionList`)
5336
+ // if (parent) {
5337
+ // for (let c = 0; c < parent.childElementCount; c++) {
5338
+ // parent.childNodes[c].classList.remove('active')
5339
+ // }
5340
+ // }
5341
+ // // add the 'active' class to the current suggestion
5342
+ // const activeSuggEl = document.getElementById(`${this.elementId}_suggestion_${this.activeSuggestion}`)
5343
+ // if (activeSuggEl) {
5344
+ // activeSuggEl.classList.add('active')
5345
+ // }
5346
+ var el = document.getElementById(this.elementId);
5347
+ if (el) {
5348
+ var els = document.querySelectorAll('.websy-search-suggestion-item');
5349
+ Array.from(els).forEach(function (e) {
5350
+ e.classList.remove('active');
5351
+ var index = e.getAttribute('data-index');
5352
+ if (+index === _this36.activeSuggestion) {
5353
+ e.classList.add('active');
5354
+ }
5355
+ });
5356
+ }
5357
+ }
5358
+ }, {
5359
+ key: "nextSuggestion",
5360
+ value: function nextSuggestion() {
5361
+ this.startSuggestionTimeout();
5362
+ if (this.activeSuggestion === this.suggestions.length - 1) {
5363
+ this.activeSuggestion = 0;
5364
+ } else {
5365
+ this.activeSuggestion++;
5366
+ }
5367
+ this.renderGhost();
5368
+ this.highlightActiveSuggestion();
5369
+ }
5370
+ }, {
5371
+ key: "prevSuggestion",
5372
+ value: function prevSuggestion() {
5373
+ this.startSuggestionTimeout();
5374
+ if (this.activeSuggestion === 0) {
5375
+ this.activeSuggestion = this.suggestions.length - 1;
5376
+ } else {
5377
+ this.activeSuggestion--;
5378
+ }
5379
+ this.renderGhost();
5380
+ this.highlightActiveSuggestion();
5381
+ }
5382
+ }, {
5383
+ key: "renderGhost",
5384
+ value: function renderGhost() {
5385
+ this.ghostPart = getGhostString(this.searchText, this.suggestions[this.activeSuggestion].label);
5386
+ this.ghostQuery = this.searchText + this.ghostPart;
5387
+ var ghostDisplay = "<span style='color: transparent;'>".concat(this.searchText, "</span>").concat(this.ghostPart);
5388
+ var ghostEl = document.getElementById("".concat(this.elementId, "_ghost"));
5389
+ if (ghostEl) {
5390
+ ghostEl.innerHTML = ghostDisplay;
5391
+ }
5392
+ function getGhostString(query, suggestion) {
5393
+ var suggestBase = query.toLowerCase();
5394
+ suggestion = suggestion.toLowerCase();
5395
+ while (suggestion.indexOf(suggestBase) === -1) {
5396
+ suggestBase = suggestBase.split(' ');
5397
+ suggestBase.splice(0, 1);
5398
+ suggestBase = suggestBase.join(' ');
5399
+ }
5400
+ var re = new RegExp(suggestBase, 'i');
5401
+ return suggestion.replace(re, '');
5402
+ }
5403
+ }
5404
+ }, {
5405
+ key: "renderLozenges",
5406
+ value: function renderLozenges() {
5407
+ var items = this.searchText.split('').map(function (d) {
5408
+ return "<div>".concat(d.replace(/ /g, '&nbsp;'), "</div>");
5409
+ });
5410
+ var el = document.getElementById("".concat(this.elementId, "_lozenges"));
5411
+ el.innerHTML = items.join('');
5412
+ }
5413
+ }, {
5414
+ key: "renderSuggestion",
5415
+ value: function renderSuggestion() {
5416
+ var suggestionsHtml = '';
5417
+ for (var i = 0; i < this.suggestions.length; i++) {
5418
+ suggestionsHtml += "\n <li id='".concat(this.elementId, "_suggestion_").concat(i, "' class='websy-search-suggestion-item' data-index='").concat(i, "'>\n ").concat(this.suggestions[i].label, "\n </li>\n ");
5419
+ }
5420
+ var suggListEl = document.getElementById("".concat(this.elementId, "_suggestionList"));
5421
+ if (suggListEl) {
5422
+ suggListEl.innerHTML = suggestionsHtml;
5423
+ }
5424
+ this.highlightActiveSuggestion();
5425
+ }
5426
+ }, {
5427
+ key: "showSuggestions",
5428
+ value: function showSuggestions() {
5429
+ var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
5430
+ this.suggestions = items.splice(0, this.options.suggestLimit);
5431
+ this.startSuggestionTimeout();
5432
+ if (this.searchText && this.searchText.length > 1 && this.cursorPosition === this.searchText.length && this.suggestions.length > 0) {
5433
+ if (!this.suggesting) {
5434
+ this.activeSuggestion = 0;
5435
+ this.suggesting = true;
5436
+ }
5437
+ // render the suggested completion
5438
+ this.renderGhost();
5439
+ // render the suggestions
5440
+ var suggestEl = document.getElementById("".concat(this.elementId, "_suggestions"));
5441
+ if (suggestEl) {
5442
+ suggestEl.classList.add('active');
5443
+ }
5444
+ this.renderSuggestion();
5445
+ } else {
5446
+ this.suggesting = false;
5447
+ this.hideGhost();
5448
+ this.hideSuggestions();
5449
+ }
5450
+ }
5451
+ }, {
5452
+ key: "startSuggestionTimeout",
5453
+ value: function startSuggestionTimeout() {
5454
+ var _this37 = this;
5455
+ if (this.suggestingTimeoutFn) {
5456
+ clearTimeout(this.suggestingTimeoutFn);
5457
+ }
5458
+ this.suggestingTimeoutFn = setTimeout(function () {
5459
+ // close the suggestions after inactivity for [suggestingTimeout] milliseconds
5460
+ _this37.hideSuggestions(_this37);
5461
+ }, this.options.suggestingTimeout);
5192
5462
  }
5193
5463
  }, {
5194
5464
  key: "text",
@@ -5336,7 +5606,7 @@ var Switch = /*#__PURE__*/function () {
5336
5606
  /* global WebsyDesigns */
5337
5607
  var WebsyTemplate = /*#__PURE__*/function () {
5338
5608
  function WebsyTemplate(elementId, options) {
5339
- var _this36 = this;
5609
+ var _this38 = this;
5340
5610
  _classCallCheck(this, WebsyTemplate);
5341
5611
  var DEFAULTS = {
5342
5612
  listeners: {
@@ -5356,8 +5626,8 @@ var WebsyTemplate = /*#__PURE__*/function () {
5356
5626
  }
5357
5627
  if (_typeof(options.template) === 'object' && options.template.url) {
5358
5628
  this.templateService.get(options.template.url).then(function (templateString) {
5359
- _this36.options.template = templateString;
5360
- _this36.render();
5629
+ _this38.options.template = templateString;
5630
+ _this38.render();
5361
5631
  });
5362
5632
  } else {
5363
5633
  this.render();
@@ -5366,7 +5636,7 @@ var WebsyTemplate = /*#__PURE__*/function () {
5366
5636
  _createClass(WebsyTemplate, [{
5367
5637
  key: "buildHTML",
5368
5638
  value: function buildHTML() {
5369
- var _this37 = this;
5639
+ var _this39 = this;
5370
5640
  var html = "";
5371
5641
  if (this.options.template) {
5372
5642
  var template = this.options.template;
@@ -5415,14 +5685,14 @@ var WebsyTemplate = /*#__PURE__*/function () {
5415
5685
  }
5416
5686
  }
5417
5687
  if (polarity === true) {
5418
- if (typeof _this37.options.data[parts[0]] !== 'undefined' && _this37.options.data[parts[0]] === parts[1]) {
5688
+ if (typeof _this39.options.data[parts[0]] !== 'undefined' && _this39.options.data[parts[0]] === parts[1]) {
5419
5689
  // remove the <if> tags
5420
5690
  removeAll = false;
5421
5691
  } else if (parts[0] === parts[1]) {
5422
5692
  removeAll = false;
5423
5693
  }
5424
5694
  } else if (polarity === false) {
5425
- if (typeof _this37.options.data[parts[0]] !== 'undefined' && _this37.options.data[parts[0]] !== parts[1]) {
5695
+ if (typeof _this39.options.data[parts[0]] !== 'undefined' && _this39.options.data[parts[0]] !== parts[1]) {
5426
5696
  // remove the <if> tags
5427
5697
  removeAll = false;
5428
5698
  }
@@ -5735,7 +6005,7 @@ var WebsyUtils = {
5735
6005
  /* global WebsyDesigns */
5736
6006
  var WebsyTable = /*#__PURE__*/function () {
5737
6007
  function WebsyTable(elementId, options) {
5738
- var _this38 = this;
6008
+ var _this40 = this;
5739
6009
  _classCallCheck(this, WebsyTable);
5740
6010
  var DEFAULTS = {
5741
6011
  pageSize: 20,
@@ -5768,8 +6038,8 @@ var WebsyTable = /*#__PURE__*/function () {
5768
6038
  allowClear: false,
5769
6039
  disableSearch: true,
5770
6040
  onItemSelected: function onItemSelected(selectedItem) {
5771
- if (_this38.options.onChangePageSize) {
5772
- _this38.options.onChangePageSize(selectedItem.value);
6041
+ if (_this40.options.onChangePageSize) {
6042
+ _this40.options.onChangePageSize(selectedItem.value);
5773
6043
  }
5774
6044
  }
5775
6045
  });
@@ -5793,20 +6063,20 @@ var WebsyTable = /*#__PURE__*/function () {
5793
6063
  }, {
5794
6064
  key: "appendRows",
5795
6065
  value: function appendRows(data) {
5796
- var _this39 = this;
6066
+ var _this41 = this;
5797
6067
  this._isRendered = false;
5798
6068
  this.hideError();
5799
6069
  var bodyHTML = '';
5800
6070
  if (data) {
5801
6071
  bodyHTML += data.map(function (r, rowIndex) {
5802
6072
  return '<tr>' + r.map(function (c, i) {
5803
- if (_this39.options.columns[i].show !== false) {
6073
+ if (_this41.options.columns[i].show !== false) {
5804
6074
  var style = '';
5805
6075
  if (c.style) {
5806
6076
  style += c.style;
5807
6077
  }
5808
- if (_this39.options.columns[i].width) {
5809
- style += "width: ".concat(_this39.options.columns[i].width, "; ");
6078
+ if (_this41.options.columns[i].width) {
6079
+ style += "width: ".concat(_this41.options.columns[i].width, "; ");
5810
6080
  }
5811
6081
  if (c.backgroundColor) {
5812
6082
  style += "background-color: ".concat(c.backgroundColor, "; ");
@@ -5817,16 +6087,16 @@ var WebsyTable = /*#__PURE__*/function () {
5817
6087
  if (c.color) {
5818
6088
  style += "color: ".concat(c.color, "; ");
5819
6089
  }
5820
- if (_this39.options.columns[i].showAsLink === true && c.value.trim() !== '') {
5821
- return "\n <td \n data-row-index='".concat(_this39.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this39.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(_this39.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this39.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
5822
- } else if ((_this39.options.columns[i].showAsNavigatorLink === true || _this39.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
5823
- return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this39.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this39.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this39.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this39.options.columns[i].linkText || c.value, "</td>\n ");
6090
+ if (_this41.options.columns[i].showAsLink === true && c.value.trim() !== '') {
6091
+ return "\n <td \n data-row-index='".concat(_this41.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this41.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(_this41.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this41.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
6092
+ } else if ((_this41.options.columns[i].showAsNavigatorLink === true || _this41.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
6093
+ return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this41.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this41.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this41.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this41.options.columns[i].linkText || c.value, "</td>\n ");
5824
6094
  } else {
5825
6095
  var info = c.value;
5826
- if (_this39.options.columns[i].showAsImage === true) {
6096
+ if (_this41.options.columns[i].showAsImage === true) {
5827
6097
  c.value = "\n <img src='".concat(c.value, "'>\n ");
5828
6098
  }
5829
- return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this39.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this39.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 ");
6099
+ return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this41.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this41.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 ");
5830
6100
  }
5831
6101
  }
5832
6102
  }).join('') + '</tr>';
@@ -5986,7 +6256,7 @@ var WebsyTable = /*#__PURE__*/function () {
5986
6256
  }, {
5987
6257
  key: "render",
5988
6258
  value: function render(data) {
5989
- var _this40 = this;
6259
+ var _this42 = this;
5990
6260
  this._isRendered = false;
5991
6261
  if (!this.options.columns) {
5992
6262
  return;
@@ -6014,7 +6284,7 @@ var WebsyTable = /*#__PURE__*/function () {
6014
6284
  if (c.width) {
6015
6285
  style += "width: ".concat(c.width || 'auto', ";");
6016
6286
  }
6017
- 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 ? _this40.buildSearchIcon(c.qGroupFieldDefs[0]) : '', "-->\n </div>\n </th>\n ");
6287
+ 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 ? _this42.buildSearchIcon(c.qGroupFieldDefs[0]) : '', "-->\n </div>\n </th>\n ");
6018
6288
  }
6019
6289
  }).join('') + '</tr>';
6020
6290
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
@@ -6032,7 +6302,7 @@ var WebsyTable = /*#__PURE__*/function () {
6032
6302
  var pagingEl = document.getElementById("".concat(this.elementId, "_pageList"));
6033
6303
  if (pagingEl) {
6034
6304
  var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
6035
- return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this40.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
6305
+ return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this42.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
6036
6306
  });
6037
6307
  var startIndex = 0;
6038
6308
  if (this.options.pageCount > 8) {
@@ -6087,7 +6357,7 @@ var WebsyTable = /*#__PURE__*/function () {
6087
6357
  /* global WebsyDesigns */
6088
6358
  var WebsyTable2 = /*#__PURE__*/function () {
6089
6359
  function WebsyTable2(elementId, options) {
6090
- var _this41 = this;
6360
+ var _this43 = this;
6091
6361
  _classCallCheck(this, WebsyTable2);
6092
6362
  var DEFAULTS = {
6093
6363
  pageSize: 20,
@@ -6122,8 +6392,8 @@ var WebsyTable2 = /*#__PURE__*/function () {
6122
6392
  allowClear: false,
6123
6393
  disableSearch: true,
6124
6394
  onItemSelected: function onItemSelected(selectedItem) {
6125
- if (_this41.options.onChangePageSize) {
6126
- _this41.options.onChangePageSize(selectedItem.value);
6395
+ if (_this43.options.onChangePageSize) {
6396
+ _this43.options.onChangePageSize(selectedItem.value);
6127
6397
  }
6128
6398
  }
6129
6399
  });
@@ -6145,20 +6415,20 @@ var WebsyTable2 = /*#__PURE__*/function () {
6145
6415
  _createClass(WebsyTable2, [{
6146
6416
  key: "appendRows",
6147
6417
  value: function appendRows(data) {
6148
- var _this42 = this;
6418
+ var _this44 = this;
6149
6419
  this.hideError();
6150
6420
  var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
6151
6421
  var bodyHTML = '';
6152
6422
  if (data) {
6153
6423
  bodyHTML += data.map(function (r, rowIndex) {
6154
6424
  return '<tr>' + r.map(function (c, i) {
6155
- if (_this42.options.columns[i].show !== false) {
6156
- var style = "height: ".concat(_this42.options.cellSize, "px; line-height: ").concat(_this42.options.cellSize, "px;");
6425
+ if (_this44.options.columns[i].show !== false) {
6426
+ var style = "height: ".concat(_this44.options.cellSize, "px; line-height: ").concat(_this44.options.cellSize, "px;");
6157
6427
  if (c.style) {
6158
6428
  style += c.style;
6159
6429
  }
6160
- if (_this42.options.columns[i].width) {
6161
- style += "width: ".concat(_this42.options.columns[i].width, "; ");
6430
+ if (_this44.options.columns[i].width) {
6431
+ style += "width: ".concat(_this44.options.columns[i].width, "; ");
6162
6432
  }
6163
6433
  if (c.backgroundColor) {
6164
6434
  style += "background-color: ".concat(c.backgroundColor, "; ");
@@ -6169,16 +6439,16 @@ var WebsyTable2 = /*#__PURE__*/function () {
6169
6439
  if (c.color) {
6170
6440
  style += "color: ".concat(c.color, "; ");
6171
6441
  }
6172
- if (_this42.options.columns[i].showAsLink === true && c.value.trim() !== '') {
6173
- return "\n <td \n data-row-index='".concat(_this42.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this42.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(_this42.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this42.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
6174
- } else if ((_this42.options.columns[i].showAsNavigatorLink === true || _this42.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
6175
- return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this42.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this42.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this42.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this42.options.columns[i].linkText || c.value, "</td>\n ");
6442
+ if (_this44.options.columns[i].showAsLink === true && c.value.trim() !== '') {
6443
+ return "\n <td \n data-row-index='".concat(_this44.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this44.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(_this44.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this44.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
6444
+ } else if ((_this44.options.columns[i].showAsNavigatorLink === true || _this44.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
6445
+ return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this44.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this44.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this44.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this44.options.columns[i].linkText || c.value, "</td>\n ");
6176
6446
  } else {
6177
6447
  var info = c.value;
6178
- if (_this42.options.columns[i].showAsImage === true) {
6448
+ if (_this44.options.columns[i].showAsImage === true) {
6179
6449
  c.value = "\n <img src='".concat(c.value, "'>\n ");
6180
6450
  }
6181
- return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this42.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this42.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 ");
6451
+ return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this44.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this44.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 ");
6182
6452
  }
6183
6453
  }
6184
6454
  }).join('') + '</tr>';
@@ -6412,7 +6682,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6412
6682
  }, {
6413
6683
  key: "render",
6414
6684
  value: function render(data) {
6415
- var _this43 = this;
6685
+ var _this45 = this;
6416
6686
  if (!this.options.columns) {
6417
6687
  return;
6418
6688
  }
@@ -6440,7 +6710,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6440
6710
  if (c.width) {
6441
6711
  style += "width: ".concat(c.width || 'auto', "; ");
6442
6712
  }
6443
- 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 ? _this43.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
6713
+ 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 ? _this45.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
6444
6714
  }
6445
6715
  }).join('') + '</tr>';
6446
6716
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
@@ -6450,7 +6720,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6450
6720
  var dropdownHTML = "";
6451
6721
  this.options.columns.forEach(function (c, i) {
6452
6722
  if (c.searchable && c.searchField) {
6453
- dropdownHTML += "\n <div id=\"".concat(_this43.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
6723
+ dropdownHTML += "\n <div id=\"".concat(_this45.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
6454
6724
  }
6455
6725
  });
6456
6726
  dropdownEl.innerHTML = dropdownHTML;
@@ -6470,7 +6740,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
6470
6740
  var pagingEl = document.getElementById("".concat(this.elementId, "_pageList"));
6471
6741
  if (pagingEl) {
6472
6742
  var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
6473
- return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this43.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
6743
+ return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this45.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
6474
6744
  });
6475
6745
  var startIndex = 0;
6476
6746
  if (this.options.pageCount > 8) {
@@ -6547,17 +6817,17 @@ var WebsyTable2 = /*#__PURE__*/function () {
6547
6817
  }, {
6548
6818
  key: "getColumnParameters",
6549
6819
  value: function getColumnParameters(values) {
6550
- var _this44 = this;
6820
+ var _this46 = this;
6551
6821
  var tableEl = document.getElementById("".concat(this.elementId, "_table"));
6552
6822
  tableEl.style.tableLayout = 'auto';
6553
6823
  tableEl.style.width = 'auto';
6554
6824
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
6555
6825
  var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
6556
6826
  headEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c, i) {
6557
- 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 ? _this44.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
6827
+ 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 ? _this46.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
6558
6828
  }).join('') + '</tr>';
6559
6829
  bodyEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c) {
6560
- return "\n <td \n style='height: ".concat(_this44.options.cellSize, "px; line-height: ").concat(_this44.options.cellSize, "px; padding: 10px 5px;'\n >").concat(c.value || '&nbsp;', "</td>\n ");
6830
+ return "\n <td \n style='height: ".concat(_this46.options.cellSize, "px; line-height: ").concat(_this46.options.cellSize, "px; padding: 10px 5px;'\n >").concat(c.value || '&nbsp;', "</td>\n ");
6561
6831
  }).join('') + '</tr>';
6562
6832
  // get height of the first data cell
6563
6833
  var cells = bodyEl.querySelectorAll("tr:first-of-type td");
@@ -6721,7 +6991,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6721
6991
  }, {
6722
6992
  key: "buildBodyHtml",
6723
6993
  value: function buildBodyHtml() {
6724
- var _this45 = this;
6994
+ var _this47 = this;
6725
6995
  var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6726
6996
  var useWidths = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
6727
6997
  if (!this.options.columns) {
@@ -6746,7 +7016,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6746
7016
  row.forEach(function (cell, cellIndex) {
6747
7017
  var sizeIndex = cell.level || cellIndex;
6748
7018
  var colIndex = cell.index || cellIndex;
6749
- if (typeof sizingColumns[sizeIndex] === 'undefined' || _this45.options.columns[_this45.options.columns.length - 1][colIndex].show === false) {
7019
+ if (typeof sizingColumns[sizeIndex] === 'undefined' || _this47.options.columns[_this47.options.columns.length - 1][colIndex].show === false) {
6750
7020
  return; // need to revisit this logic
6751
7021
  }
6752
7022
 
@@ -6773,7 +7043,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6773
7043
  style += "color: ".concat(cell.color, "; ");
6774
7044
  }
6775
7045
  // console.log('rowspan', cell.rowspan)
6776
- bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this45.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((cell.classes || []).join(' '), " ").concat((sizingColumns[sizeIndex].classes || []).join(' '), "'\n style='").concat(style, "'\n data-info='").concat(cell.value.replace ? cell.value.replace(/'/g, '`') : cell.value, "'\n colspan='").concat(cell.colspan || 1, "'\n rowspan='").concat(cell.rowspan || 1, "'\n data-row-index='").concat(rowIndex, "'\n data-cell-index='").concat(cellIndex, "'\n data-col-index='").concat(colIndex, "'\n ");
7046
+ bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this47.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((cell.classes || []).join(' '), " ").concat((sizingColumns[sizeIndex].classes || []).join(' '), "'\n style='").concat(style, "'\n data-info='").concat(cell.value.replace ? cell.value.replace(/'/g, '`') : cell.value, "'\n colspan='").concat(cell.colspan || 1, "'\n rowspan='").concat(cell.rowspan || 1, "'\n data-row-index='").concat(rowIndex, "'\n data-cell-index='").concat(cellIndex, "'\n data-col-index='").concat(colIndex, "'\n ");
6777
7047
  // if (useWidths === true) {
6778
7048
  // bodyHtml += `
6779
7049
  // style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
@@ -6782,10 +7052,10 @@ var WebsyTable3 = /*#__PURE__*/function () {
6782
7052
  // }
6783
7053
  bodyHtml += "\n ><div \n style='".concat(divStyle, "' \n class='websy-table-cell-content'\n data-row-index='").concat(rowIndex, "'\n data-cell-index='").concat(cellIndex, "'\n data-col-index='").concat(colIndex, "'\n >");
6784
7054
  if (cell.expandable === true) {
6785
- bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(_this45.options.plusIcon, "</i>");
7055
+ bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(_this47.options.plusIcon, "</i>");
6786
7056
  }
6787
7057
  if (cell.collapsable === true) {
6788
- bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(_this45.options.minusIcon, "</i>");
7058
+ bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(_this47.options.minusIcon, "</i>");
6789
7059
  }
6790
7060
  if (sizingColumns[sizeIndex].showAsLink === true && cell.value.trim() !== '') {
6791
7061
  cell.value = "\n <a href=\"".concat(encodeURI(cell.value), "\" target='").concat(sizingColumns[sizeIndex].openInNewTab === true ? '_blank' : '_self', "'>").concat(cell.displayText || sizingColumns[sizeIndex].linkText || cell.value, "</a>\n ");
@@ -6806,7 +7076,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6806
7076
  }, {
6807
7077
  key: "buildHeaderHtml",
6808
7078
  value: function buildHeaderHtml() {
6809
- var _this46 = this;
7079
+ var _this48 = this;
6810
7080
  var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6811
7081
  if (!this.options.columns) {
6812
7082
  return '';
@@ -6823,11 +7093,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
6823
7093
  headerHtml += '</colgroup>';
6824
7094
  }
6825
7095
  this.options.columns.forEach(function (row, rowIndex) {
6826
- if (useWidths === false && rowIndex !== _this46.options.columns.length - 1) {
6827
- // if we're calculating the size we only want to render the last row of column headers
6828
- return;
6829
- }
6830
- headerHtml += "<tr class=\"websy-table-row websy-table-header-row\">";
7096
+ // if (useWidths === false && rowIndex !== this.options.columns.length - 1) {
7097
+ // // if we're calculating the size we only want to render the last row of column headers
7098
+ // return
7099
+ // }
7100
+ headerHtml += "<tr class=\"websy-table-row websy-table-header-row ".concat(rowIndex !== _this48.options.columns.length - 1 ? 'websy-table-parent-header' : '', "\">");
6831
7101
  row.filter(function (c) {
6832
7102
  return c.show !== false;
6833
7103
  }).forEach(function (col, colIndex) {
@@ -6847,24 +7117,24 @@ var WebsyTable3 = /*#__PURE__*/function () {
6847
7117
  if (col.style) {
6848
7118
  style += col.style;
6849
7119
  }
6850
- headerHtml += "<td \n class='websy-table-cell ".concat(colIndex < _this46.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((col.classes || []).join(' '), "' \n style='").concat(style, "' \n colspan='").concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
7120
+ headerHtml += "<td \n class='websy-table-cell ".concat(colIndex < _this48.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((col.classes || []).join(' '), "' \n style='").concat(style, "' \n colspan='").concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
6851
7121
  // if (useWidths === true && rowIndex === this.options.columns.length - 1) {
6852
7122
  // headerHtml += `
6853
7123
  // style='width: ${col.width || col.actualWidth}px'
6854
7124
  // width='${col.width || col.actualWidth}'
6855
7125
  // `
6856
7126
  // }
6857
- headerHtml += ">\n <div \n style='".concat(divStyle, "'\n data-col-index=\"").concat(colIndex, "\"\n class='").concat(['asc', 'desc'].indexOf(col.sort) !== -1 ? 'sortable-column' : '', "'\n >\n ").concat(col.name).concat(col.activeSort ? _this46.buildSortIcon(col.sort, colIndex) : '').concat(col.searchable === true ? _this46.buildSearchIcon(col, colIndex) : '', "\n </div>\n </td>");
7127
+ headerHtml += ">\n <div \n style='".concat(divStyle, "'\n data-col-index=\"").concat(colIndex, "\"\n class='").concat(['asc', 'desc'].indexOf(col.sort) !== -1 ? 'sortable-column' : '', "'\n >\n ").concat(col.name).concat(col.activeSort ? _this48.buildSortIcon(col.sort, colIndex) : '').concat(col.searchable === true ? _this48.buildSearchIcon(col, colIndex) : '', "\n </div>\n </td>");
6858
7128
  });
6859
7129
  headerHtml += "</tr>";
6860
7130
  });
6861
7131
  var dropdownEl = document.getElementById("".concat(this.elementId, "_dropdownContainer"));
6862
7132
  this.options.columns[this.options.columns.length - 1].forEach(function (c, i) {
6863
7133
  if (c.searchable && c.isExternalSearch === true) {
6864
- var testEl = document.getElementById("".concat(_this46.elementId, "_columnSearch_").concat(c.dimId || i));
7134
+ var testEl = document.getElementById("".concat(_this48.elementId, "_columnSearch_").concat(c.dimId || i));
6865
7135
  if (!testEl) {
6866
7136
  var newE = document.createElement('div');
6867
- newE.id = "".concat(_this46.elementId, "_columnSearch_").concat(c.dimId || i);
7137
+ newE.id = "".concat(_this48.elementId, "_columnSearch_").concat(c.dimId || i);
6868
7138
  newE.className = 'websy-modal-dropdown';
6869
7139
  dropdownEl.appendChild(newE);
6870
7140
  }
@@ -6887,7 +7157,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6887
7157
  }, {
6888
7158
  key: "buildTotalHtml",
6889
7159
  value: function buildTotalHtml() {
6890
- var _this47 = this;
7160
+ var _this49 = this;
6891
7161
  var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6892
7162
  if (!this.options.totals) {
6893
7163
  return '';
@@ -6903,7 +7173,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6903
7173
 
6904
7174
  totalHtml += "<td \n class='websy-table-cell ".concat((col.classes || []).join(' '), "'\n colspan='").concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
6905
7175
  if (useWidths === true) {
6906
- totalHtml += "\n style='width: ".concat(_this47.options.columns[_this47.options.columns.length - 1][colIndex].width || _this47.options.columns[_this47.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
7176
+ totalHtml += "\n style='width: ".concat(_this49.options.columns[_this49.options.columns.length - 1][colIndex].width || _this49.options.columns[_this49.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
6907
7177
  }
6908
7178
  totalHtml += " \n >\n ".concat(col.value, "\n </td>");
6909
7179
  });
@@ -6913,7 +7183,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6913
7183
  }, {
6914
7184
  key: "calculateSizes",
6915
7185
  value: function calculateSizes() {
6916
- var _this48 = this;
7186
+ var _this50 = this;
6917
7187
  var sample = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6918
7188
  var totalRowCount = arguments.length > 1 ? arguments[1] : undefined;
6919
7189
  var totalColumnCount = arguments.length > 2 ? arguments[2] : undefined;
@@ -6947,7 +7217,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6947
7217
  var footerEl = document.getElementById("".concat(this.elementId, "_tableFooter"));
6948
7218
  footerEl.innerHTML = this.buildTotalHtml();
6949
7219
  this.sizes.total = footerEl.getBoundingClientRect();
6950
- var rows = Array.from(tableEl.querySelectorAll('.websy-table-row'));
7220
+ var rows = Array.from(tableEl.querySelectorAll('.websy-table-row:not(.websy-table-parent-header)'));
6951
7221
  var totalWidth = 0;
6952
7222
  this.sizes.scrollableWidth = this.sizes.table.width;
6953
7223
  var firstNonPinnedColumnWidth = 0;
@@ -6957,7 +7227,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6957
7227
  rows.forEach(function (row, rowIndex) {
6958
7228
  Array.from(row.children).forEach(function (col, colIndex) {
6959
7229
  var colSize = col.getBoundingClientRect();
6960
- _this48.sizes.cellHeight = colSize.height;
7230
+ _this50.sizes.cellHeight = colSize.height;
6961
7231
  if (columnsForSizing[colIndex]) {
6962
7232
  if (!columnsForSizing[colIndex].actualWidth) {
6963
7233
  columnsForSizing[colIndex].potentialWidth = 0;
@@ -6969,7 +7239,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6969
7239
  // columnsForSizing[colIndex].actualWidth = columnsForSizing[colIndex].width
6970
7240
  // }
6971
7241
  columnsForSizing[colIndex].cellHeight = colSize.height;
6972
- if (colIndex >= _this48.pinnedColumns) {
7242
+ if (colIndex >= _this50.pinnedColumns) {
6973
7243
  firstNonPinnedColumnWidth = columnsForSizing[colIndex].actualWidth;
6974
7244
  }
6975
7245
  }
@@ -6984,7 +7254,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6984
7254
  return a + (b.width || b.actualWidth);
6985
7255
  }, 0);
6986
7256
  this.sizes.totalNonPinnedWidth = columnsForSizing.filter(function (c, i) {
6987
- return i >= _this48.pinnedColumns;
7257
+ return i >= _this50.pinnedColumns;
6988
7258
  }).reduce(function (a, b) {
6989
7259
  return a + (b.width || b.actualWidth);
6990
7260
  }, 0);
@@ -6995,7 +7265,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6995
7265
  var availableSpace = this.sizes.table.width - this.sizes.totalWidth;
6996
7266
  columnsForSizing.forEach(function (c) {
6997
7267
  c.shouldGrow = true;
6998
- if (_this48.options.autoFitColumns === false) {
7268
+ if (_this50.options.autoFitColumns === false) {
6999
7269
  c.shouldGrow = false;
7000
7270
  if (c.potentialWidth > c.actualWidth) {
7001
7271
  c.shouldGrow = true;
@@ -7014,7 +7284,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7014
7284
  // if (!c.width) {
7015
7285
  // if (c.actualWidth < equalWidth) {
7016
7286
  // adjust the width
7017
- if (_this48.options.autoFitColumns === true) {
7287
+ if (_this50.options.autoFitColumns === true) {
7018
7288
  if (c.width) {
7019
7289
  c.width += equalWidth;
7020
7290
  }
@@ -7038,9 +7308,9 @@ var WebsyTable3 = /*#__PURE__*/function () {
7038
7308
  }
7039
7309
  // }
7040
7310
  // }
7041
- _this48.sizes.totalWidth += c.width || c.actualWidth;
7042
- if (i > _this48.pinnedColumns) {
7043
- _this48.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
7311
+ _this50.sizes.totalWidth += c.width || c.actualWidth;
7312
+ if (i > _this50.pinnedColumns) {
7313
+ _this50.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
7044
7314
  }
7045
7315
  // equalWidth = (outerSize.width - this.sizes.totalWidth) / (this.options.columns[this.options.columns.length - 1].length - (i + 1))
7046
7316
  });
@@ -7099,7 +7369,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7099
7369
  }, {
7100
7370
  key: "createSample",
7101
7371
  value: function createSample(data) {
7102
- var _this49 = this;
7372
+ var _this51 = this;
7103
7373
  var output = [];
7104
7374
  this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
7105
7375
  if (col.maxLength) {
@@ -7109,7 +7379,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7109
7379
  } else if (data) {
7110
7380
  var longest = '';
7111
7381
  for (var i = 0; i < Math.min(data.length, 1000); i++) {
7112
- if (data[i].length === _this49.options.columns[_this49.options.columns.length - 1].length) {
7382
+ if (data[i].length === _this51.options.columns[_this51.options.columns.length - 1].length) {
7113
7383
  if (longest.length < data[i][colIndex].value.length) {
7114
7384
  longest = data[i][colIndex].value;
7115
7385
  }
@@ -7381,7 +7651,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7381
7651
  }, {
7382
7652
  key: "perpetualScroll",
7383
7653
  value: function perpetualScroll() {
7384
- var _this50 = this;
7654
+ var _this52 = this;
7385
7655
  // if the currentTouchtime and touchEndTime are more than 300ms apart then we abort the perpetual scroll
7386
7656
  if (this.touchEndTime - this.currentTouchtime > 300) {
7387
7657
  return;
@@ -7400,17 +7670,17 @@ var WebsyTable3 = /*#__PURE__*/function () {
7400
7670
  var direction = touchDistance > 0 ? -1 : 1;
7401
7671
  var _loop2 = function _loop2(i) {
7402
7672
  setTimeout(function () {
7403
- var delta = _this50.mouseYStart - _this50.currentClientY + _this50.sizes.cellHeight * (i + 1) * direction;
7673
+ var delta = _this52.mouseYStart - _this52.currentClientY + _this52.sizes.cellHeight * (i + 1) * direction;
7404
7674
  delta = Math.min(10, delta);
7405
7675
  delta = Math.max(-10, delta);
7406
7676
  // only run this if isPerpetual === true
7407
7677
  // this value is reset to false on touchStart
7408
- if (_this50.isPerpetual === true) {
7678
+ if (_this52.isPerpetual === true) {
7409
7679
  // this.$scope.scrollTop += (delta / (this.$scope.layout.qHyperCube.qSize.qcy / this.$scope.rowsToLoad / (this.$scope.totalSpaceAvailable / 250)))
7410
7680
  // this.$scope.scrollTop += (delta / (this.$scope.layout.qHyperCube.qSize.qcy / this.$scope.rowsToLoad / (this.$scope.totalSpaceAvailable / 200)))
7411
- _this50.scrollY(Math.max(-5, Math.min(5, delta)));
7412
- if (_this50.scrollTimeout) {
7413
- clearTimeout(_this50.scrollTimeout);
7681
+ _this52.scrollY(Math.max(-5, Math.min(5, delta)));
7682
+ if (_this52.scrollTimeout) {
7683
+ clearTimeout(_this52.scrollTimeout);
7414
7684
  }
7415
7685
  }
7416
7686
  }, 1000 / fps * i);
@@ -7678,7 +7948,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
7678
7948
  /* global d3 include WebsyDesigns */
7679
7949
  var WebsyChart = /*#__PURE__*/function () {
7680
7950
  function WebsyChart(elementId, options) {
7681
- var _this51 = this;
7951
+ var _this53 = this;
7682
7952
  _classCallCheck(this, WebsyChart);
7683
7953
  var DEFAULTS = {
7684
7954
  margin: {
@@ -7737,7 +8007,7 @@ var WebsyChart = /*#__PURE__*/function () {
7737
8007
  this.invertOverride = function (input, input2) {
7738
8008
  var forBrush = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7739
8009
  var xAxis = 'bottom';
7740
- if (_this51.options.orientation === 'horizontal') {
8010
+ if (_this53.options.orientation === 'horizontal') {
7741
8011
  xAxis = 'left';
7742
8012
  }
7743
8013
  if (forBrush === true) {
@@ -7745,12 +8015,12 @@ var WebsyChart = /*#__PURE__*/function () {
7745
8015
  }
7746
8016
  xAxis += 'Axis';
7747
8017
  var output;
7748
- var width = _this51.options.data[xAxis.replace('Brush', '').replace('Axis', '')].bandWidth;
8018
+ var width = _this53.options.data[xAxis.replace('Brush', '').replace('Axis', '')].bandWidth;
7749
8019
  // if (this.customBottomRange) {
7750
- for (var index = 0; index < _this51.customBottomRange.length; index++) {
7751
- if (input > _this51.customBottomRange[index]) {
7752
- if (_this51.customBottomRange[index + 1]) {
7753
- if (input < _this51.customBottomRange[index + 1]) {
8020
+ for (var index = 0; index < _this53.customBottomRange.length; index++) {
8021
+ if (input > _this53.customBottomRange[index]) {
8022
+ if (_this53.customBottomRange[index + 1]) {
8023
+ if (input < _this53.customBottomRange[index + 1]) {
7754
8024
  output = index;
7755
8025
  break;
7756
8026
  }
@@ -7915,9 +8185,9 @@ var WebsyChart = /*#__PURE__*/function () {
7915
8185
  }, {
7916
8186
  key: "handleEventMouseMove",
7917
8187
  value: function handleEventMouseMove(event, d) {
7918
- var _this52 = this;
8188
+ var _this54 = this;
7919
8189
  var bisectDate = d3.bisector(function (d) {
7920
- return _this52.parseX(d.x.value);
8190
+ return _this54.parseX(d.x.value);
7921
8191
  }).left;
7922
8192
  if (this.options.showTrackingLine === true && d3.pointer(event)) {
7923
8193
  var xAxis = 'bottomAxis';
@@ -7950,9 +8220,9 @@ var WebsyChart = /*#__PURE__*/function () {
7950
8220
  xLabel = _toConsumableArray(this[xAxis].domain().reverse())[x0];
7951
8221
  }
7952
8222
  this.options.data.series.forEach(function (s) {
7953
- if (_this52.options.data[xData].scale !== 'Time') {
8223
+ if (_this54.options.data[xData].scale !== 'Time') {
7954
8224
  // if (this.customBottomRange && this.customBottomRange.length > 0) {
7955
- xPoint = _this52.customBottomRange[x0] + (_this52.customBottomRange[x0 + 1] - _this52.customBottomRange[x0]) / 2;
8225
+ xPoint = _this54.customBottomRange[x0] + (_this54.customBottomRange[x0 + 1] - _this54.customBottomRange[x0]) / 2;
7956
8226
  // }
7957
8227
  // else {
7958
8228
  // xPoint = this[xAxis](this.parseX(xLabel))
@@ -7972,41 +8242,41 @@ var WebsyChart = /*#__PURE__*/function () {
7972
8242
  var index = bisectDate(s.data, x0, 1);
7973
8243
  var pointA = s.data[index - 1];
7974
8244
  var pointB = s.data[index];
7975
- if (_this52.options.orientation === 'horizontal') {
8245
+ if (_this54.options.orientation === 'horizontal') {
7976
8246
  pointA = _toConsumableArray(s.data).reverse()[index - 1];
7977
8247
  pointB = _toConsumableArray(s.data).reverse()[index];
7978
8248
  }
7979
8249
  if (pointA && !pointB) {
7980
- xPoint = _this52[xAxis](_this52.parseX(pointA.x.value));
8250
+ xPoint = _this54[xAxis](_this54.parseX(pointA.x.value));
7981
8251
  tooltipTitle = pointA.x.value;
7982
8252
  if (!pointA.y.color) {
7983
8253
  pointA.y.color = s.color;
7984
8254
  }
7985
8255
  tooltipData.push(pointA);
7986
8256
  if (typeof pointA.x.value.getTime !== 'undefined') {
7987
- tooltipTitle = d3.timeFormat(_this52.options.dateFormat || _this52.options.calculatedTimeFormatPattern)(pointA.x.value);
8257
+ tooltipTitle = d3.timeFormat(_this54.options.dateFormat || _this54.options.calculatedTimeFormatPattern)(pointA.x.value);
7988
8258
  }
7989
8259
  }
7990
8260
  if (pointB && !pointA) {
7991
- xPoint = _this52[xAxis](_this52.parseX(pointB.x.value));
8261
+ xPoint = _this54[xAxis](_this54.parseX(pointB.x.value));
7992
8262
  tooltipTitle = pointB.x.value;
7993
8263
  if (!pointB.y.color) {
7994
8264
  pointB.y.color = s.color;
7995
8265
  }
7996
8266
  tooltipData.push(pointB);
7997
8267
  if (typeof pointB.x.value.getTime !== 'undefined') {
7998
- tooltipTitle = d3.timeFormat(_this52.options.dateFormat || _this52.options.calculatedTimeFormatPattern)(pointB.x.value);
8268
+ tooltipTitle = d3.timeFormat(_this54.options.dateFormat || _this54.options.calculatedTimeFormatPattern)(pointB.x.value);
7999
8269
  }
8000
8270
  }
8001
8271
  if (pointA && pointB) {
8002
- var d0 = _this52[xAxis](_this52.parseX(pointA.x.value));
8003
- var d1 = _this52[xAxis](_this52.parseX(pointB.x.value));
8272
+ var d0 = _this54[xAxis](_this54.parseX(pointA.x.value));
8273
+ var d1 = _this54[xAxis](_this54.parseX(pointB.x.value));
8004
8274
  var mid = Math.abs(d0 - d1) / 2;
8005
8275
  if (d3.pointer(event)[0] - d0 >= mid) {
8006
8276
  xPoint = d1;
8007
8277
  tooltipTitle = pointB.x.value;
8008
8278
  if (typeof pointB.x.value.getTime !== 'undefined') {
8009
- tooltipTitle = d3.timeFormat(_this52.options.dateFormat || _this52.options.calculatedTimeFormatPattern)(pointB.x.value);
8279
+ tooltipTitle = d3.timeFormat(_this54.options.dateFormat || _this54.options.calculatedTimeFormatPattern)(pointB.x.value);
8010
8280
  }
8011
8281
  if (!pointB.y.color) {
8012
8282
  pointB.y.color = s.color;
@@ -8016,7 +8286,7 @@ var WebsyChart = /*#__PURE__*/function () {
8016
8286
  xPoint = d0;
8017
8287
  tooltipTitle = pointA.x.value;
8018
8288
  if (typeof pointB.x.value.getTime !== 'undefined') {
8019
- tooltipTitle = d3.timeFormat(_this52.options.dateFormat || _this52.options.calculatedTimeFormatPattern)(pointB.x.value);
8289
+ tooltipTitle = d3.timeFormat(_this54.options.dateFormat || _this54.options.calculatedTimeFormatPattern)(pointB.x.value);
8020
8290
  }
8021
8291
  if (!pointA.y.color) {
8022
8292
  pointA.y.color = s.color;
@@ -8142,7 +8412,7 @@ var WebsyChart = /*#__PURE__*/function () {
8142
8412
  }, {
8143
8413
  key: "render",
8144
8414
  value: function render(options) {
8145
- var _this53 = this;
8415
+ var _this55 = this;
8146
8416
  /* global d3 options WebsyUtils */
8147
8417
  this._isRendered = false;
8148
8418
  if (typeof options !== 'undefined') {
@@ -8211,7 +8481,7 @@ var WebsyChart = /*#__PURE__*/function () {
8211
8481
  this.options.data.series.map(function (s, i) {
8212
8482
  return {
8213
8483
  value: s.label || s.key,
8214
- color: s.color || _this53.options.colors[i % _this53.options.colors.length]
8484
+ color: s.color || _this55.options.colors[i % _this55.options.colors.length]
8215
8485
  };
8216
8486
  });
8217
8487
  }
@@ -8568,25 +8838,25 @@ var WebsyChart = /*#__PURE__*/function () {
8568
8838
  if (this.options.data[customRangeSideLC].data && this.options.data[customRangeSideLC].data[0] && (this.options.data[customRangeSideLC].data[0].valueCount || 1) && this.options.data[customRangeSideLC].scale === 'Ordinal') {
8569
8839
  var acc = 0;
8570
8840
  this["custom".concat(customRangeSide, "Range")] = [0].concat(_toConsumableArray(this.options.data[customRangeSideLC].data.map(function (d, index, arr) {
8571
- var adjustment = _this53.bandPadding * index + _this53.bandPadding;
8841
+ var adjustment = _this55.bandPadding * index + _this55.bandPadding;
8572
8842
  // if (this.options.data.bottom.padding) {
8573
8843
  // adjustment = (this.widthForCalc * this.options.data.bottom.padding) / (arr.length * 2)
8574
8844
  // }
8575
- var start = _this53.widthForCalc / noOfPoints * acc;
8845
+ var start = _this55.widthForCalc / noOfPoints * acc;
8576
8846
  for (var i = 0; i < (d.valueCount || 1); i++) {
8577
8847
  var pos = i * proposedBandWidth;
8578
- _this53["custom".concat(customRangeSide, "DetailRange")].push(start + adjustment + pos);
8848
+ _this55["custom".concat(customRangeSide, "DetailRange")].push(start + adjustment + pos);
8579
8849
  }
8580
- acc += _this53.options.grouping !== 'stacked' && _this53.options.allowUnevenBands === true ? d.valueCount || 1 : 1;
8581
- var end = _this53.widthForCalc / noOfPoints * acc;
8850
+ acc += _this55.options.grouping !== 'stacked' && _this55.options.allowUnevenBands === true ? d.valueCount || 1 : 1;
8851
+ var end = _this55.widthForCalc / noOfPoints * acc;
8582
8852
  // this.customBottomBrushRange.push((end + adjustment) * (this.plotWidth / this.widthForCalc))
8583
8853
  return end + adjustment;
8584
8854
  })));
8585
8855
  acc = 0;
8586
8856
  this["custom".concat(customRangeSide, "BrushRange")] = [0].concat(_toConsumableArray(this.options.data[customRangeSideLC].data.map(function (d, index, arr) {
8587
- var adjustment = _this53.brushBandPadding * index + _this53.brushBandPadding;
8588
- acc += _this53.options.grouping !== 'stacked' && _this53.options.allowUnevenBands === true ? d.valueCount || 1 : 1;
8589
- return (_this53.options.orientation === 'vertical' ? _this53.plotWidth : _this53.plotHeight) / noOfPoints * acc;
8857
+ var adjustment = _this55.brushBandPadding * index + _this55.brushBandPadding;
8858
+ acc += _this55.options.grouping !== 'stacked' && _this55.options.allowUnevenBands === true ? d.valueCount || 1 : 1;
8859
+ return (_this55.options.orientation === 'vertical' ? _this55.plotWidth : _this55.plotHeight) / noOfPoints * acc;
8590
8860
  })));
8591
8861
  }
8592
8862
  // }
@@ -8759,7 +9029,7 @@ var WebsyChart = /*#__PURE__*/function () {
8759
9029
  this.bAxisFunc = d3.axisBottom(this.bottomAxis).ticks(tickDefinition);
8760
9030
  if (this.options.data.bottom.formatter) {
8761
9031
  this.bAxisFunc.tickFormat(function (d) {
8762
- return _this53.options.data.bottom.formatter(d);
9032
+ return _this55.options.data.bottom.formatter(d);
8763
9033
  });
8764
9034
  }
8765
9035
  this.bottomAxisLayer.call(this.bAxisFunc);
@@ -8769,7 +9039,7 @@ var WebsyChart = /*#__PURE__*/function () {
8769
9039
  }
8770
9040
  if (this.customBottomRange.length > 0) {
8771
9041
  this.bottomAxisLayer.selectAll('g').attr('transform', function (d, i) {
8772
- return "translate(".concat(_this53.customBottomRange[i] + (_this53.customBottomRange[i + 1] - _this53.customBottomRange[i]) / 2, ", 0)");
9042
+ return "translate(".concat(_this55.customBottomRange[i] + (_this55.customBottomRange[i + 1] - _this55.customBottomRange[i]) / 2, ", 0)");
8773
9043
  });
8774
9044
  }
8775
9045
  }
@@ -8788,14 +9058,14 @@ var WebsyChart = /*#__PURE__*/function () {
8788
9058
  }
8789
9059
  if (this.options.margin.axisLeft > 0) {
8790
9060
  this.leftAxisLayer.call(d3.axisLeft(this.leftAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
8791
- if (_this53.options.data.left.formatter) {
8792
- d = _this53.options.data.left.formatter(d);
9061
+ if (_this55.options.data.left.formatter) {
9062
+ d = _this55.options.data.left.formatter(d);
8793
9063
  }
8794
9064
  return d;
8795
9065
  }));
8796
9066
  if (this.customLeftRange.length > 0) {
8797
9067
  this.leftAxisLayer.selectAll('g').attr('transform', function (d, i) {
8798
- return "translate(0, ".concat(_this53.customLeftRange[i] + (_this53.customLeftRange[i + 1] - _this53.customLeftRange[i]) / 2, ")");
9068
+ return "translate(0, ".concat(_this55.customLeftRange[i] + (_this55.customLeftRange[i + 1] - _this55.customLeftRange[i]) / 2, ")");
8799
9069
  });
8800
9070
  }
8801
9071
  }
@@ -8823,8 +9093,8 @@ var WebsyChart = /*#__PURE__*/function () {
8823
9093
  }
8824
9094
  if (this.options.margin.axisRight > 0 && (this.options.data.right.min !== 0 || this.options.data.right.max !== 0)) {
8825
9095
  this.rightAxisLayer.call(d3.axisRight(this.rightAxis).ticks(this.options.data.right.ticks || 5).tickFormat(function (d) {
8826
- if (_this53.options.data.right.formatter) {
8827
- d = _this53.options.data.right.formatter(d);
9096
+ if (_this55.options.data.right.formatter) {
9097
+ d = _this55.options.data.right.formatter(d);
8828
9098
  }
8829
9099
  return d;
8830
9100
  }));
@@ -8864,25 +9134,25 @@ var WebsyChart = /*#__PURE__*/function () {
8864
9134
  }, {
8865
9135
  key: "renderComponents",
8866
9136
  value: function renderComponents() {
8867
- var _this54 = this;
9137
+ var _this56 = this;
8868
9138
  // Draw the series data
8869
9139
  this.renderedKeys = {};
8870
9140
  this.options.data.series.forEach(function (series, index) {
8871
9141
  if (!series.key) {
8872
- series.key = _this54.createIdentity();
9142
+ series.key = _this56.createIdentity();
8873
9143
  }
8874
9144
  if (!series.color) {
8875
- series.color = _this54.options.colors[index % _this54.options.colors.length];
9145
+ series.color = _this56.options.colors[index % _this56.options.colors.length];
8876
9146
  }
8877
- _this54["render".concat(series.type || 'bar')](series, index);
8878
- _this54.renderLabels(series, index);
8879
- _this54.renderedKeys[series.key] = series.type;
9147
+ _this56["render".concat(series.type || 'bar')](series, index);
9148
+ _this56.renderLabels(series, index);
9149
+ _this56.renderedKeys[series.key] = series.type;
8880
9150
  });
8881
9151
  this.refLineLayer.selectAll('.reference-line').remove();
8882
9152
  this.refLineLayer.selectAll('.reference-line-label').remove();
8883
9153
  if (this.options.refLines && this.options.refLines.length > 0) {
8884
9154
  this.options.refLines.forEach(function (l) {
8885
- return _this54.renderRefLine(l);
9155
+ return _this56.renderRefLine(l);
8886
9156
  });
8887
9157
  }
8888
9158
  this._isRendered = true;
@@ -8890,25 +9160,25 @@ var WebsyChart = /*#__PURE__*/function () {
8890
9160
  }, {
8891
9161
  key: "renderarea",
8892
9162
  value: function renderarea(series, index) {
8893
- var _this55 = this;
9163
+ var _this57 = this;
8894
9164
  /* global d3 series index */
8895
9165
  var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
8896
9166
  return d3.area().x(function (d) {
8897
- if (_this55.options.data[xAxis].scale === 'Time') {
8898
- return _this55["".concat(xAxis, "Axis")](_this55.parseX(d.x.value));
9167
+ if (_this57.options.data[xAxis].scale === 'Time') {
9168
+ return _this57["".concat(xAxis, "Axis")](_this57.parseX(d.x.value));
8899
9169
  } else {
8900
- var xIndex = _this55[xAxis + 'Axis'].domain().indexOf(d.x.value);
8901
- var xPos = _this55["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
8902
- if (_this55["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
8903
- xPos = xPos + (_this55["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9170
+ var xIndex = _this57[xAxis + 'Axis'].domain().indexOf(d.x.value);
9171
+ var xPos = _this57["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9172
+ if (_this57["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9173
+ xPos = xPos + (_this57["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
8904
9174
  }
8905
9175
  return xPos;
8906
9176
  }
8907
9177
  }).y0(function (d) {
8908
- return _this55["".concat(yAxis, "Axis")](0);
9178
+ return _this57["".concat(yAxis, "Axis")](0);
8909
9179
  }).y1(function (d) {
8910
- return _this55["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
8911
- }).curve(d3[curveStyle || _this55.options.curveStyle]);
9180
+ return _this57["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
9181
+ }).curve(d3[curveStyle || _this57.options.curveStyle]);
8912
9182
  };
8913
9183
  var xAxis = 'bottom';
8914
9184
  var yAxis = series.axis === 'secondary' ? 'right' : 'left';
@@ -8948,7 +9218,7 @@ var WebsyChart = /*#__PURE__*/function () {
8948
9218
  }, {
8949
9219
  key: "renderbar",
8950
9220
  value: function renderbar(series, index) {
8951
- var _this56 = this;
9221
+ var _this58 = this;
8952
9222
  /* global series index d3 */
8953
9223
  var xAxis = 'bottom';
8954
9224
  var yAxis = 'left';
@@ -9115,26 +9385,26 @@ var WebsyChart = /*#__PURE__*/function () {
9115
9385
  }
9116
9386
  bars.exit().transition(this.transition).style('fill-opacity', 1e-6).remove();
9117
9387
  bars.attr('width', function (d, i) {
9118
- return Math.abs(getBarWidth.call(_this56, d, i, yAxis, xAxis));
9388
+ return Math.abs(getBarWidth.call(_this58, d, i, yAxis, xAxis));
9119
9389
  }).attr('height', function (d, i) {
9120
- return getBarHeight.call(_this56, d, i, yAxis, xAxis);
9390
+ return getBarHeight.call(_this58, d, i, yAxis, xAxis);
9121
9391
  }).attr('x', function (d, i) {
9122
- return getBarX.call(_this56, d, i, yAxis, xAxis);
9392
+ return getBarX.call(_this58, d, i, yAxis, xAxis);
9123
9393
  }).attr('y', function (d, i) {
9124
- return getBarY.call(_this56, d, i, yAxis, xAxis);
9394
+ return getBarY.call(_this58, d, i, yAxis, xAxis);
9125
9395
  })
9126
9396
  // .transition(this.transition)
9127
9397
  .attr('fill', function (d) {
9128
9398
  return d.y.color || d.color || series.color;
9129
9399
  });
9130
9400
  bars.enter().append('rect').attr('width', function (d, i) {
9131
- return Math.abs(getBarWidth.call(_this56, d, i, yAxis, xAxis));
9401
+ return Math.abs(getBarWidth.call(_this58, d, i, yAxis, xAxis));
9132
9402
  }).attr('height', function (d, i) {
9133
- return getBarHeight.call(_this56, d, i, yAxis, xAxis);
9403
+ return getBarHeight.call(_this58, d, i, yAxis, xAxis);
9134
9404
  }).attr('x', function (d, i) {
9135
- return getBarX.call(_this56, d, i, yAxis, xAxis);
9405
+ return getBarX.call(_this58, d, i, yAxis, xAxis);
9136
9406
  }).attr('y', function (d, i) {
9137
- return getBarY.call(_this56, d, i, yAxis, xAxis);
9407
+ return getBarY.call(_this58, d, i, yAxis, xAxis);
9138
9408
  })
9139
9409
  // .transition(this.transition)
9140
9410
  .attr('fill', function (d) {
@@ -9146,26 +9416,26 @@ var WebsyChart = /*#__PURE__*/function () {
9146
9416
  this.brushBarsInitialized[series.key] = true;
9147
9417
  brushBars.exit().transition(this.transition).style('fill-opacity', 1e-6).remove();
9148
9418
  brushBars.attr('width', function (d, i) {
9149
- return Math.abs(getBarWidth.call(_this56, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush")));
9419
+ return Math.abs(getBarWidth.call(_this58, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush")));
9150
9420
  }).attr('height', function (d, i) {
9151
- return getBarHeight.call(_this56, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9421
+ return getBarHeight.call(_this58, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9152
9422
  }).attr('x', function (d, i) {
9153
- return getBarX.call(_this56, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9423
+ return getBarX.call(_this58, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9154
9424
  }).attr('y', function (d, i) {
9155
- return getBarY.call(_this56, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9425
+ return getBarY.call(_this58, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9156
9426
  })
9157
9427
  // .transition(this.transition)
9158
9428
  .attr('fill', function (d) {
9159
9429
  return d.y.color || d.color || series.color;
9160
9430
  });
9161
9431
  brushBars.enter().append('rect').attr('width', function (d, i) {
9162
- return Math.abs(getBarWidth.call(_this56, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush")));
9432
+ return Math.abs(getBarWidth.call(_this58, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush")));
9163
9433
  }).attr('height', function (d, i) {
9164
- return getBarHeight.call(_this56, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9434
+ return getBarHeight.call(_this58, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9165
9435
  }).attr('x', function (d, i) {
9166
- return getBarX.call(_this56, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9436
+ return getBarX.call(_this58, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9167
9437
  }).attr('y', function (d, i) {
9168
- return getBarY.call(_this56, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9438
+ return getBarY.call(_this58, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
9169
9439
  })
9170
9440
  // .transition(this.transition)
9171
9441
  .attr('fill', function (d) {
@@ -9186,7 +9456,7 @@ var WebsyChart = /*#__PURE__*/function () {
9186
9456
  }, {
9187
9457
  key: "renderLabels",
9188
9458
  value: function renderLabels(series, index) {
9189
- var _this57 = this;
9459
+ var _this59 = this;
9190
9460
  /* global series index d3 WebsyDesigns */
9191
9461
  var xAxis = 'bottom';
9192
9462
  var yAxis = 'left';
@@ -9202,14 +9472,14 @@ var WebsyChart = /*#__PURE__*/function () {
9202
9472
  var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
9203
9473
  labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
9204
9474
  labels.attr('x', function (d) {
9205
- return getLabelX.call(_this57, d, series.labelPosition);
9475
+ return getLabelX.call(_this59, d, series.labelPosition);
9206
9476
  }).attr('y', function (d) {
9207
- return getLabelY.call(_this57, d, series.labelPosition);
9477
+ return getLabelY.call(_this59, d, series.labelPosition);
9208
9478
  }).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
9209
- if (_this57.options.grouping === 'stacked' && d.y.value === 0) {
9479
+ if (_this59.options.grouping === 'stacked' && d.y.value === 0) {
9210
9480
  return 'transparent';
9211
9481
  }
9212
- return _this57.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
9482
+ return _this59.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
9213
9483
  }).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
9214
9484
  return d.y.label || d.y.value;
9215
9485
  }).each(function (d, i) {
@@ -9243,14 +9513,14 @@ var WebsyChart = /*#__PURE__*/function () {
9243
9513
  }
9244
9514
  });
9245
9515
  labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', function (d) {
9246
- return getLabelX.call(_this57, d, series.labelPosition);
9516
+ return getLabelX.call(_this59, d, series.labelPosition);
9247
9517
  }).attr('y', function (d) {
9248
- return getLabelY.call(_this57, d, series.labelPosition);
9518
+ return getLabelY.call(_this59, d, series.labelPosition);
9249
9519
  }).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
9250
- if (_this57.options.grouping === 'stacked' && d.y.value === 0) {
9520
+ if (_this59.options.grouping === 'stacked' && d.y.value === 0) {
9251
9521
  return 'transparent';
9252
9522
  }
9253
- return _this57.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
9523
+ return _this59.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
9254
9524
  }).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).text(function (d) {
9255
9525
  return d.y.label || d.y.value;
9256
9526
  }).each(function (d, i) {
@@ -9328,32 +9598,32 @@ var WebsyChart = /*#__PURE__*/function () {
9328
9598
  }, {
9329
9599
  key: "renderline",
9330
9600
  value: function renderline(series, index) {
9331
- var _this58 = this;
9601
+ var _this60 = this;
9332
9602
  /* global series index d3 */
9333
9603
  var drawLine = function drawLine(xAxis, yAxis, curveStyle) {
9334
9604
  return d3.line().x(function (d) {
9335
- if (_this58.options.orientation === 'horizontal') {
9336
- return _this58["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
9605
+ if (_this60.options.orientation === 'horizontal') {
9606
+ return _this60["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
9337
9607
  } else {
9338
- if (_this58.options.data[xAxis].scale === 'Time') {
9339
- return _this58["".concat(xAxis, "Axis")](_this58.parseX(d.x.value));
9608
+ if (_this60.options.data[xAxis].scale === 'Time') {
9609
+ return _this60["".concat(xAxis, "Axis")](_this60.parseX(d.x.value));
9340
9610
  } else {
9341
- var xIndex = _this58[xAxis + 'Axis'].domain().indexOf(d.x.value);
9342
- var xPos = _this58["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9343
- if (_this58["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9344
- xPos = xPos + (_this58["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9611
+ var xIndex = _this60[xAxis + 'Axis'].domain().indexOf(d.x.value);
9612
+ var xPos = _this60["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9613
+ if (_this60["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9614
+ xPos = xPos + (_this60["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9345
9615
  }
9346
9616
  return xPos;
9347
9617
  }
9348
9618
  }
9349
9619
  }).y(function (d) {
9350
- if (_this58.options.orientation === 'horizontal') {
9351
- var adjustment = _this58.options.data[xAxis.replace('Brush', '')].scale === 'Time' ? 0 : _this58.options.data[xAxis].bandWidth / 2;
9352
- return _this58["".concat(xAxis, "Axis")](_this58.parseX(d.x.value)) + adjustment;
9620
+ if (_this60.options.orientation === 'horizontal') {
9621
+ var adjustment = _this60.options.data[xAxis.replace('Brush', '')].scale === 'Time' ? 0 : _this60.options.data[xAxis].bandWidth / 2;
9622
+ return _this60["".concat(xAxis, "Axis")](_this60.parseX(d.x.value)) + adjustment;
9353
9623
  } else {
9354
- return _this58["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
9624
+ return _this60["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
9355
9625
  }
9356
- }).curve(d3[curveStyle || _this58.options.curveStyle]);
9626
+ }).curve(d3[curveStyle || _this60.options.curveStyle]);
9357
9627
  };
9358
9628
  var xAxis = 'bottom';
9359
9629
  var yAxis = series.axis === 'secondary' ? 'right' : 'left';
@@ -9462,14 +9732,14 @@ var WebsyChart = /*#__PURE__*/function () {
9462
9732
  }, {
9463
9733
  key: "rendersymbol",
9464
9734
  value: function rendersymbol(series, index) {
9465
- var _this59 = this;
9735
+ var _this61 = this;
9466
9736
  /* global d3 series index series.key */
9467
9737
  var drawSymbol = function drawSymbol(size) {
9468
9738
  return d3.symbol()
9469
9739
  // .type(d => {
9470
9740
  // return d3.symbols[0]
9471
9741
  // })
9472
- .size(size || _this59.options.symbolSize);
9742
+ .size(size || _this61.options.symbolSize);
9473
9743
  };
9474
9744
  var xAxis = 'bottom';
9475
9745
  var yAxis = series.axis === 'secondary' ? 'right' : 'left';
@@ -9495,27 +9765,27 @@ var WebsyChart = /*#__PURE__*/function () {
9495
9765
  // else {
9496
9766
  // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
9497
9767
  // }
9498
- var xIndex = _this59[xAxis + 'Axis'].domain().indexOf(d.x.value);
9499
- var xPos = _this59["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9500
- if (_this59["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9501
- xPos = xPos + (_this59["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9502
- }
9503
- var adjustment = _this59.options.data[xAxis].scale === 'Time' || _this59.options.data[xAxis].scale === 'Linear' ? 0 : _this59.options.data[xAxis].bandWidth / 2;
9504
- if (_this59.options.orientation === 'horizontal') {
9505
- return "translate(".concat(_this59["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ", ").concat(xPos, ")");
9768
+ var xIndex = _this61[xAxis + 'Axis'].domain().indexOf(d.x.value);
9769
+ var xPos = _this61["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9770
+ if (_this61["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9771
+ xPos = xPos + (_this61["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9772
+ }
9773
+ var adjustment = _this61.options.data[xAxis].scale === 'Time' || _this61.options.data[xAxis].scale === 'Linear' ? 0 : _this61.options.data[xAxis].bandWidth / 2;
9774
+ if (_this61.options.orientation === 'horizontal') {
9775
+ return "translate(".concat(_this61["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ", ").concat(xPos, ")");
9506
9776
  } else {
9507
- if (_this59.options.data[xAxis].scale === 'Time') {
9508
- xPos = _this59["".concat(xAxis, "Axis")](_this59.parseX(d.x.value));
9777
+ if (_this61.options.data[xAxis].scale === 'Time') {
9778
+ xPos = _this61["".concat(xAxis, "Axis")](_this61.parseX(d.x.value));
9509
9779
  } else {
9510
- var _xIndex = _this59[xAxis + 'Axis'].domain().indexOf(d.x.value);
9511
- var _xPos = _this59["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex];
9512
- if (_this59["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex + 1]) {
9513
- _xPos = _xPos + (_this59["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex + 1] - _xPos) / 2;
9780
+ var _xIndex = _this61[xAxis + 'Axis'].domain().indexOf(d.x.value);
9781
+ var _xPos = _this61["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex];
9782
+ if (_this61["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex + 1]) {
9783
+ _xPos = _xPos + (_this61["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex + 1] - _xPos) / 2;
9514
9784
  }
9515
9785
  // return xPos
9516
9786
  }
9517
9787
  // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
9518
- return "translate(".concat(xPos, ", ").concat(_this59["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
9788
+ return "translate(".concat(xPos, ", ").concat(_this61["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
9519
9789
  }
9520
9790
  });
9521
9791
  // Enter
@@ -9530,27 +9800,27 @@ var WebsyChart = /*#__PURE__*/function () {
9530
9800
  }).attr('class', function (d) {
9531
9801
  return "symbol symbol_".concat(series.key);
9532
9802
  }).attr('transform', function (d) {
9533
- var xIndex = _this59[xAxis + 'Axis'].domain().indexOf(d.x.value);
9534
- var xPos = _this59["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9535
- if (_this59["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9536
- xPos = xPos + (_this59["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9537
- }
9538
- var adjustment = _this59.options.data[xAxis].scale === 'Time' || _this59.options.data[xAxis].scale === 'Linear' ? 0 : _this59.options.data[xAxis].bandWidth / 2;
9539
- if (_this59.options.orientation === 'horizontal') {
9540
- return "translate(".concat(_this59["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ", ").concat(xPos, ")");
9803
+ var xIndex = _this61[xAxis + 'Axis'].domain().indexOf(d.x.value);
9804
+ var xPos = _this61["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
9805
+ if (_this61["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
9806
+ xPos = xPos + (_this61["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
9807
+ }
9808
+ var adjustment = _this61.options.data[xAxis].scale === 'Time' || _this61.options.data[xAxis].scale === 'Linear' ? 0 : _this61.options.data[xAxis].bandWidth / 2;
9809
+ if (_this61.options.orientation === 'horizontal') {
9810
+ return "translate(".concat(_this61["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ", ").concat(xPos, ")");
9541
9811
  } else {
9542
- if (_this59.options.data[xAxis].scale === 'Time') {
9543
- xPos = _this59["".concat(xAxis, "Axis")](_this59.parseX(d.x.value));
9812
+ if (_this61.options.data[xAxis].scale === 'Time') {
9813
+ xPos = _this61["".concat(xAxis, "Axis")](_this61.parseX(d.x.value));
9544
9814
  } else {
9545
- var _xIndex2 = _this59[xAxis + 'Axis'].domain().indexOf(d.x.value);
9546
- var _xPos2 = _this59["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex2];
9547
- if (_this59["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex2 + 1]) {
9548
- _xPos2 = _xPos2 + (_this59["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex2 + 1] - _xPos2) / 2;
9815
+ var _xIndex2 = _this61[xAxis + 'Axis'].domain().indexOf(d.x.value);
9816
+ var _xPos2 = _this61["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex2];
9817
+ if (_this61["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex2 + 1]) {
9818
+ _xPos2 = _xPos2 + (_this61["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex2 + 1] - _xPos2) / 2;
9549
9819
  }
9550
9820
  // return xPos
9551
9821
  }
9552
9822
  // return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
9553
- return "translate(".concat(xPos, ", ").concat(_this59["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
9823
+ return "translate(".concat(xPos, ", ").concat(_this61["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
9554
9824
  }
9555
9825
  });
9556
9826
  }
@@ -10173,7 +10443,7 @@ var WebsyLegend = /*#__PURE__*/function () {
10173
10443
  }, {
10174
10444
  key: "resize",
10175
10445
  value: function resize() {
10176
- var _this60 = this;
10446
+ var _this62 = this;
10177
10447
  var el = document.getElementById(this.elementId);
10178
10448
  if (el) {
10179
10449
  // if (this.options.width) {
@@ -10184,7 +10454,7 @@ var WebsyLegend = /*#__PURE__*/function () {
10184
10454
  // }
10185
10455
  var html = "\n <div class='text-".concat(this.options.align, "'>\n ");
10186
10456
  html += this._data.map(function (d, i) {
10187
- return _this60.getLegendItemHTML(d);
10457
+ return _this62.getLegendItemHTML(d);
10188
10458
  }).join('');
10189
10459
  html += "\n <div>\n ";
10190
10460
  el.innerHTML = html;
@@ -10342,7 +10612,7 @@ var WebsyMap = /*#__PURE__*/function () {
10342
10612
  }, {
10343
10613
  key: "render",
10344
10614
  value: function render() {
10345
- var _this61 = this;
10615
+ var _this63 = this;
10346
10616
  this._isRendered = false;
10347
10617
  var mapEl = document.getElementById("".concat(this.elementId, "_map"));
10348
10618
  var legendEl = document.getElementById("".concat(this.elementId, "_map"));
@@ -10350,7 +10620,7 @@ var WebsyMap = /*#__PURE__*/function () {
10350
10620
  var legendData = this.options.data.polygons.map(function (s, i) {
10351
10621
  return {
10352
10622
  value: s.label || s.key,
10353
- color: s.color || _this61.options.colors[i % _this61.options.colors.length]
10623
+ color: s.color || _this63.options.colors[i % _this63.options.colors.length]
10354
10624
  };
10355
10625
  });
10356
10626
  var longestValue = legendData.map(function (s) {
@@ -10404,7 +10674,7 @@ var WebsyMap = /*#__PURE__*/function () {
10404
10674
  }
10405
10675
  if (this.polygons) {
10406
10676
  this.polygons.forEach(function (p) {
10407
- return _this61.map.removeLayer(p);
10677
+ return _this63.map.removeLayer(p);
10408
10678
  });
10409
10679
  }
10410
10680
  this.polygons = [];
@@ -10458,15 +10728,15 @@ var WebsyMap = /*#__PURE__*/function () {
10458
10728
  p.options = {};
10459
10729
  }
10460
10730
  if (!p.options.color) {
10461
- p.options.color = _this61.options.colors[i % _this61.options.colors.length];
10731
+ p.options.color = _this63.options.colors[i % _this63.options.colors.length];
10462
10732
  }
10463
10733
  var pol = L.polygon(p.data.map(function (c) {
10464
10734
  return c.map(function (d) {
10465
10735
  return [d.Latitude, d.Longitude];
10466
10736
  });
10467
- }), p.options).addTo(_this61.map);
10468
- _this61.polygons.push(pol);
10469
- _this61.map.fitBounds(pol.getBounds());
10737
+ }), p.options).addTo(_this63.map);
10738
+ _this63.polygons.push(pol);
10739
+ _this63.map.fitBounds(pol.getBounds());
10470
10740
  });
10471
10741
  }
10472
10742
  // if (this.data.markers.length > 0) {