@websy/websy-designs 1.3.4 → 1.3.6

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.
@@ -1590,9 +1590,9 @@ var WebsyDropdown = /*#__PURE__*/function () {
1590
1590
  showCompleteSelectedList: false,
1591
1591
  closeAfterSelection: true,
1592
1592
  customActions: [],
1593
- searchIcon: "<svg class='search' width=\"20\" height=\"20\" viewBox=\"0 0 512 512\"><path d=\"M221.09,64A157.09,157.09,0,1,0,378.18,221.09,157.1,157.1,0,0,0,221.09,64Z\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/><line x1=\"338.29\" y1=\"338.29\" x2=\"448\" y2=\"448\" style=\"fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px\"/></svg>",
1594
- clearIcon: "<svg class='clear' xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 512 512\"><title>ionicons-v5-l</title><line x1=\"368\" y1=\"368\" x2=\"144\" y2=\"144\" style=\"fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px\"/><line x1=\"368\" y1=\"144\" x2=\"144\" y2=\"368\" style=\"fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px\"/></svg>",
1595
- arrowIcon: "<svg class='arrow' xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M23.677 18.52c.914 1.523-.183 3.472-1.967 3.472h-19.414c-1.784 0-2.881-1.949-1.967-3.472l9.709-16.18c.891-1.483 3.041-1.48 3.93 0l9.709 16.18z\"/></svg>",
1593
+ searchIcon: "<svg width=\"20\" height=\"20\" viewBox=\"0 0 512 512\"><path d=\"M221.09,64A157.09,157.09,0,1,0,378.18,221.09,157.1,157.1,0,0,0,221.09,64Z\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/><line x1=\"338.29\" y1=\"338.29\" x2=\"448\" y2=\"448\" style=\"fill:none;stroke:#000;stroke-linecap:round;stroke-miterlimit:10;stroke-width:32px\"/></svg>",
1594
+ clearIcon: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 512 512\"><title>ionicons-v5-l</title><line x1=\"368\" y1=\"368\" x2=\"144\" y2=\"144\" style=\"fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px\"/><line x1=\"368\" y1=\"144\" x2=\"144\" y2=\"368\" style=\"fill:none;stroke-linecap:round;stroke-linejoin:round;stroke-width:32px\"/></svg>",
1595
+ arrowIcon: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M23.677 18.52c.914 1.523-.183 3.472-1.967 3.472h-19.414c-1.784 0-2.881-1.949-1.967-3.472l9.709-16.18c.891-1.483 3.041-1.48 3.93 0l9.709 16.18z\"/></svg>",
1596
1596
  actionsIcon: "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"30\" height=\"30\" viewBox=\"0 0 512 512\">><circle cx=\"256\" cy=\"256\" r=\"32\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/><circle cx=\"416\" cy=\"256\" r=\"32\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/><circle cx=\"96\" cy=\"256\" r=\"32\" style=\"fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:32px\"/></svg>"
1597
1597
  };
1598
1598
  this.options = _extends({}, DEFAULTS, options);
@@ -1627,10 +1627,16 @@ var WebsyDropdown = /*#__PURE__*/function () {
1627
1627
  var headerValue = this.selectedItems.map(function (s) {
1628
1628
  return _this9.options.items[s].value || _this9.options.items[s].label;
1629
1629
  }).join(this.options.multiValueDelimiter);
1630
- var html = "\n <div id='".concat(this.elementId, "_container' class='websy-dropdown-container ").concat(this.options.disabled ? 'disabled' : '', " ").concat(this.options.disableSearch !== true ? 'with-search' : '', " ").concat(this.options.style, " ").concat(this.options.customActions.length > 0 ? 'with-actions' : '', "'>\n <div id='").concat(this.elementId, "_header' class='websy-dropdown-header ").concat(this.selectedItems.length === 1 ? 'one-selected' : '', " ").concat(this.options.allowClear === true ? 'allow-clear' : '', "'>\n ").concat(this.options.searchIcon, "\n <span>\n <span class='websy-dropdown-header-value' data-info='").concat(headerLabel, "' id='").concat(this.elementId, "_selectedItems'>").concat(headerLabel, "</span> \n <span class='websy-dropdown-header-label' id='").concat(this.elementId, "_headerLabel'>").concat(this.options.label, "</span>\n </span>\n <input class='dropdown-input' id='").concat(this.elementId, "_input' name='").concat(this.options.field || this.options.label, "' value='").concat(headerValue, "'>\n ").concat(this.options.arrowIcon, "\n ");
1630
+ var html = "\n <div id='".concat(this.elementId, "_container' class='websy-dropdown-container ").concat(this.options.disabled ? 'disabled' : '', " ").concat(this.options.disableSearch !== true ? 'with-search' : '', " ").concat(this.options.style, " ").concat(this.options.customActions.length > 0 ? 'with-actions' : '', "'>\n <div id='").concat(this.elementId, "_header' class='websy-dropdown-header ").concat(this.selectedItems.length === 1 ? 'one-selected' : '', " ").concat(this.options.allowClear === true ? 'allow-clear' : '', "'>\n ");
1631
+
1632
+ if (this.options.disableSearch !== true) {
1633
+ html += "<div class='search'>".concat(this.options.searchIcon, "</div>");
1634
+ }
1635
+
1636
+ html += "\n <div class='header-label'>\n <span class='websy-dropdown-header-value' data-info='".concat(headerLabel, "' id='").concat(this.elementId, "_selectedItems'>").concat(headerLabel, "</span> \n <span class='websy-dropdown-header-label' id='").concat(this.elementId, "_headerLabel'>").concat(this.options.label, "</span>\n </div>\n <input class='dropdown-input' id='").concat(this.elementId, "_input' name='").concat(this.options.field || this.options.label, "' value='").concat(headerValue, "'>\n <div class='arrow'>").concat(this.options.arrowIcon, "</div>\n ");
1631
1637
 
1632
1638
  if (this.options.allowClear === true) {
1633
- html += this.options.clearIcon;
1639
+ html += "<div class='clear'>".concat(this.options.clearIcon, "</div>");
1634
1640
  }
1635
1641
 
1636
1642
  html += " \n </div>\n <div id='".concat(this.elementId, "_mask' class='websy-dropdown-mask'></div>\n <div id='").concat(this.elementId, "_content' class='websy-dropdown-content'>\n ");
@@ -2372,8 +2378,17 @@ var WebsyForm = /*#__PURE__*/function () {
2372
2378
 
2373
2379
  var WebsyIcons = {
2374
2380
  'search-icon': "\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 500 500\" xml:space=\"preserve\">\n<path d=\"M481.4,468.6c-17.2-17.2-34.4-34.4-51.6-51.6c-27.4-27.4-54.8-54.8-82.2-82.2c-4.8-4.8-9.5-9.5-14.3-14.3\n\tc29.4-32.5,47.4-75.5,47.4-122.7C380.7,97,298.7,15,197.9,15S15,97,15,197.9s82,182.9,182.9,182.9c47.2,0,90.3-18,122.7-47.4\n\tc15.7,15.7,31.4,31.4,47.1,47.1c27.4,27.4,54.8,54.8,82.2,82.2c6.3,6.3,12.5,12.5,18.8,18.8C476.8,489.6,489.6,476.8,481.4,468.6z\n\t M35,197.9C35,108.1,108.1,35,197.9,35s162.9,73.1,162.9,162.9s-73.1,162.9-162.9,162.9S35,287.7,35,197.9z\"/>\n</svg>\n\n ",
2375
- 'bag-icon': "\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 500 500\" style=\"enable-background:new 0 0 500 500;\" xml:space=\"preserve\">\n<path d=\"M456.6,472.3H43.4c-5.3,0-10.2-2.1-13.7-6c-3.6-3.9-5.2-9.2-4.5-14.4l37-285.4c1.2-9,9-15.9,18.2-15.9h339.2\n\tc9.2,0,17,6.8,18.2,15.8l37,285.4c0.7,5.2-1,10.5-4.5,14.4l0,0C466.8,470.1,461.9,472.3,456.6,472.3z M46.5,451.2h407l-36.3-279.6\n\tH82.8L46.5,451.2z\"/>\n<g>\n\t<path d=\"M361.3,157.1C357.3,94.8,308.4,46,249.9,46c-28,0-54.8,11.1-75.4,31.4c-20.7,20.3-33.5,47.9-35.9,77.8l-21.5-1.6\n\t\tc2.8-34.8,17.7-67.1,42.1-91C183.9,38.3,216.1,25,249.9,25c34.2,0,66.6,13.6,91.5,38.3c24.5,24.3,39.2,57.2,41.5,92.5L361.3,157.1z\n\t\t\"/>\n</g>\n</svg>\n\n ",
2376
- 'user-icon': "\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 500 500\" style=\"enable-background:new 0 0 500 500;\" xml:space=\"preserve\">\n<g>\n\t<path d=\"M248,260.5c-62,0-112.5-52.8-112.5-117.7S186,25,248,25s112.5,52.8,112.5,117.7S310,260.5,248,260.5z M248,45.9\n\t\tc-51,0-92.5,43.4-92.5,96.8s41.5,96.8,92.5,96.8c51,0,92.5-43.4,92.5-96.8S299,45.9,248,45.9z\"/>\n</g>\n<path d=\"M45,475C45,475,45,475,45,475c0-118.3,92-214.5,205-214.5c113,0,205,96.2,205,214.5c0,0,0,0,0,0h20c0,0,0,0,0,0\n\tc0-62.9-23.4-122-65.9-166.5c-42.5-44.5-99-69-159.1-69s-116.6,24.5-159.1,69C48.4,353,25,412.1,25,475c0,0,0,0,0,0H45z\"/>\n</svg>\n\n "
2381
+ 'bag-icon': "\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 500 500\">\n<path d=\"M456.6,472.3H43.4c-5.3,0-10.2-2.1-13.7-6c-3.6-3.9-5.2-9.2-4.5-14.4l37-285.4c1.2-9,9-15.9,18.2-15.9h339.2\n\tc9.2,0,17,6.8,18.2,15.8l37,285.4c0.7,5.2-1,10.5-4.5,14.4l0,0C466.8,470.1,461.9,472.3,456.6,472.3z M46.5,451.2h407l-36.3-279.6\n\tH82.8L46.5,451.2z\"/>\n<g>\n\t<path d=\"M361.3,157.1C357.3,94.8,308.4,46,249.9,46c-28,0-54.8,11.1-75.4,31.4c-20.7,20.3-33.5,47.9-35.9,77.8l-21.5-1.6\n\t\tc2.8-34.8,17.7-67.1,42.1-91C183.9,38.3,216.1,25,249.9,25c34.2,0,66.6,13.6,91.5,38.3c24.5,24.3,39.2,57.2,41.5,92.5L361.3,157.1z\n\t\t\"/>\n</g>\n</svg>\n\n ",
2382
+ 'user-icon': "\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 500 500\" style=\"enable-background:new 0 0 500 500;\" xml:space=\"preserve\">\n<g>\n\t<path d=\"M248,260.5c-62,0-112.5-52.8-112.5-117.7S186,25,248,25s112.5,52.8,112.5,117.7S310,260.5,248,260.5z M248,45.9\n\t\tc-51,0-92.5,43.4-92.5,96.8s41.5,96.8,92.5,96.8c51,0,92.5-43.4,92.5-96.8S299,45.9,248,45.9z\"/>\n</g>\n<path d=\"M45,475C45,475,45,475,45,475c0-118.3,92-214.5,205-214.5c113,0,205,96.2,205,214.5c0,0,0,0,0,0h20c0,0,0,0,0,0\n\tc0-62.9-23.4-122-65.9-166.5c-42.5-44.5-99-69-159.1-69s-116.6,24.5-159.1,69C48.4,353,25,412.1,25,475c0,0,0,0,0,0H45z\"/>\n</svg>\n\n ",
2383
+ 'Search': "\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 500 500\" xml:space=\"preserve\">\n<path d=\"M481.4,468.6c-17.2-17.2-34.4-34.4-51.6-51.6c-27.4-27.4-54.8-54.8-82.2-82.2c-4.8-4.8-9.5-9.5-14.3-14.3\n\tc29.4-32.5,47.4-75.5,47.4-122.7C380.7,97,298.7,15,197.9,15S15,97,15,197.9s82,182.9,182.9,182.9c47.2,0,90.3-18,122.7-47.4\n\tc15.7,15.7,31.4,31.4,47.1,47.1c27.4,27.4,54.8,54.8,82.2,82.2c6.3,6.3,12.5,12.5,18.8,18.8C476.8,489.6,489.6,476.8,481.4,468.6z\n\t M35,197.9C35,108.1,108.1,35,197.9,35s162.9,73.1,162.9,162.9s-73.1,162.9-162.9,162.9S35,287.7,35,197.9z\"/>\n</svg>\n\n ",
2384
+ 'Bag': "\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 500 500\">\n<path d=\"M456.6,472.3H43.4c-5.3,0-10.2-2.1-13.7-6c-3.6-3.9-5.2-9.2-4.5-14.4l37-285.4c1.2-9,9-15.9,18.2-15.9h339.2\n\tc9.2,0,17,6.8,18.2,15.8l37,285.4c0.7,5.2-1,10.5-4.5,14.4l0,0C466.8,470.1,461.9,472.3,456.6,472.3z M46.5,451.2h407l-36.3-279.6\n\tH82.8L46.5,451.2z\"/>\n<g>\n\t<path d=\"M361.3,157.1C357.3,94.8,308.4,46,249.9,46c-28,0-54.8,11.1-75.4,31.4c-20.7,20.3-33.5,47.9-35.9,77.8l-21.5-1.6\n\t\tc2.8-34.8,17.7-67.1,42.1-91C183.9,38.3,216.1,25,249.9,25c34.2,0,66.6,13.6,91.5,38.3c24.5,24.3,39.2,57.2,41.5,92.5L361.3,157.1z\n\t\t\"/>\n</g>\n</svg>\n\n ",
2385
+ 'User': "\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 500 500\" style=\"enable-background:new 0 0 500 500;\" xml:space=\"preserve\">\n<g>\n\t<path d=\"M248,260.5c-62,0-112.5-52.8-112.5-117.7S186,25,248,25s112.5,52.8,112.5,117.7S310,260.5,248,260.5z M248,45.9\n\t\tc-51,0-92.5,43.4-92.5,96.8s41.5,96.8,92.5,96.8c51,0,92.5-43.4,92.5-96.8S299,45.9,248,45.9z\"/>\n</g>\n<path d=\"M45,475C45,475,45,475,45,475c0-118.3,92-214.5,205-214.5c113,0,205,96.2,205,214.5c0,0,0,0,0,0h20c0,0,0,0,0,0\n\tc0-62.9-23.4-122-65.9-166.5c-42.5-44.5-99-69-159.1-69s-116.6,24.5-159.1,69C48.4,353,25,412.1,25,475c0,0,0,0,0,0H45z\"/>\n</svg>\n\n ",
2386
+ 'DockLeft': "\n <svg xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 500 500\" style=\"enable-background:new 0 0 500 500;\" xml:space=\"preserve\">\n\t<g>\n\t\t<path d=\"M419.7,425H80.3C49.8,425,25,400.2,25,369.7V130.3C25,99.8,49.8,75,80.3,75h339.4c30.5,0,55.3,24.8,55.3,55.3v239.4\n\t\t\tC475,400.2,450.2,425,419.7,425z M80.3,95C60.8,95,45,110.8,45,130.3v239.4c0,19.5,15.8,35.3,35.3,35.3h339.4\n\t\t\tc19.5,0,35.3-15.8,35.3-35.3V130.3c0-19.5-15.8-35.3-35.3-35.3H80.3z\"/>\n\t</g>\n\t<path d=\"M92.8,90.1H92h-4.2c-24.8,0-45,20.2-45,45v229.8c0,24.8,20.2,45,45,45H92h0.8h105.4V90.1H92.8z\"/>\n</svg>\n\n ",
2387
+ 'DockRight': "\n <svg xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 500 500\" style=\"enable-background:new 0 0 500 500;\" xml:space=\"preserve\">\n\t<g>\n\t\t<path d=\"M25,369.7V130.3C25,99.8,49.8,75,80.3,75h339.4c30.5,0,55.3,24.8,55.3,55.3v239.4c0,30.5-24.8,55.3-55.3,55.3H80.3\n\t\t\tC49.8,425,25,400.2,25,369.7z M80.3,95C60.8,95,45,110.8,45,130.3v239.4c0,19.5,15.8,35.3,35.3,35.3h339.4\n\t\t\tc19.5,0,35.3-15.8,35.3-35.3V130.3c0-19.5-15.8-35.3-35.3-35.3H80.3z\"/>\n\t</g>\n\t<path d=\"M407.2,90.1h0.8h4.2c24.8,0,45,20.2,45,45v229.8c0,24.8-20.2,45-45,45H408h-0.8H301.8V90.1H407.2z\"/>\n</svg>\n\n ",
2388
+ 'Pin': "\n <svg xmlns=\"http://www.w3.org/2000/svg\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 500 500\" style=\"enable-background:new 0 0 500 500;\" xml:space=\"preserve\">\n\t<g>\n\t\t<path d=\"M368,312.1H132l-0.6-9.4c-0.1-2.4-0.2-4.8-0.2-7.1c0-40.3,20.7-78.1,54.4-99.9V73.2h-9c-13,0-23.6-10.6-23.6-23.6\n\t\t\tS163.5,26,176.6,26h146.9c13,0,23.6,10.6,23.6,23.6s-10.6,23.6-23.6,23.6h-9v122.5c33.7,21.8,54.4,59.5,54.4,99.9\n\t\t\tc0,2.3-0.1,4.7-0.2,7.1L368,312.1z M151.2,292.1h197.5c-1.2-33.8-19.9-65.1-49.4-82.1l-5-2.9V53.2h29c2,0,3.6-1.6,3.6-3.6\n\t\t\tc0-2-1.6-3.6-3.6-3.6H176.6c-2,0-3.6,1.6-3.6,3.6c0,2,1.6,3.6,3.6,3.6h29v153.9l-5,2.9C171.1,227,152.4,258.3,151.2,292.1z\"/>\n\t</g>\n\t<path d=\"M260.9,403.8V299.9h-21.8v108.8h0c0.1,36.1,4.9,65.3,10.9,65.3c6,0,10.9-29.7,10.9-66.4\n\t\tC260.9,406.4,260.9,405.1,260.9,403.8z\"/>\n</svg>\n\n ",
2389
+ 'WindowPopout': "\n <svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\"\n\t viewBox=\"0 0 500 500\" style=\"enable-background:new 0 0 500 500;\" xml:space=\"preserve\">\n<style type=\"text/css\">\n\t.st0{fill:none;stroke:#000000;stroke-width:20;stroke-miterlimit:10;}\n</style>\n<path class=\"st0\" d=\"M420.1,359.6h-285c-24.7,0-45-20.2-45-45V124.9c0-24.7,20.2-45,45-45h285c24.7,0,45,20.2,45,45v189.7\n\tC465.1,339.3,444.9,359.6,420.1,359.6z\"/>\n<path class=\"st0\" d=\"M407.3,389.8c-6.3,17.3-22.9,29.7-42.3,29.7H80c-24.7,0-45-20.2-45-45V184.9c0-18.2,10.9-33.9,26.5-41\"/>\n</svg>\n\n ",
2390
+ 'Plus': "\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 500 500\">\n<path d=\"M254.7,486h-10.3c-5.5,0-10-4.5-10-10V26c0-5.5,4.5-10,10-10h10.3c5.5,0,10,4.5,10,10v450C264.6,481.5,260.2,486,254.7,486z\"/>\n<path d=\"M15,255.1v-10.3c0-5.5,4.5-10,10-10h450c5.5,0,10,4.5,10,10v10.3c0,5.5-4.5,10-10,10H25C19.5,265.1,15,260.7,15,255.1z\"/>\n</svg>\n\n ",
2391
+ 'Minus': "\n <svg version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 500 500\">\n<path d=\"M15,255.1v-10.3c0-5.5,4.5-10,10-10h450c5.5,0,10,4.5,10,10v10.3c0,5.5-4.5,10-10,10H25C19.5,265.1,15,260.7,15,255.1z\"/>\n</svg>\n "
2377
2392
  };
2378
2393
 
2379
2394
  var WebsyLoadingDialog = /*#__PURE__*/function () {
@@ -2437,7 +2452,7 @@ var WebsyLoadingDialog = /*#__PURE__*/function () {
2437
2452
 
2438
2453
  return WebsyLoadingDialog;
2439
2454
  }();
2440
- /* global */
2455
+ /* global WebsyDesigns */
2441
2456
 
2442
2457
 
2443
2458
  var WebsyNavigationMenu = /*#__PURE__*/function () {
@@ -2449,7 +2464,11 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2449
2464
  orientation: 'horizontal',
2450
2465
  parentMap: {},
2451
2466
  childIndentation: 10,
2452
- activeSymbol: 'none'
2467
+ activeSymbol: 'none',
2468
+ enableSearch: false,
2469
+ searchProp: 'text',
2470
+ menuIcon: "<svg viewbox=\"0 0 40 40\" width=\"30\" height=\"40\"> \n <rect x=\"0\" y=\"0\" width=\"30\" height=\"4\" rx=\"2\"></rect>\n <rect x=\"0\" y=\"12\" width=\"30\" height=\"4\" rx=\"2\"></rect>\n <rect x=\"0\" y=\"24\" width=\"30\" height=\"4\" rx=\"2\"></rect>\n </svg>",
2471
+ searchOptions: {}
2453
2472
  }, options);
2454
2473
 
2455
2474
  if (!elementId) {
@@ -2457,6 +2476,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2457
2476
  return;
2458
2477
  }
2459
2478
 
2479
+ this.maxLevel = 0;
2460
2480
  var el = document.getElementById(elementId);
2461
2481
 
2462
2482
  if (el) {
@@ -2465,7 +2485,6 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2465
2485
  this.flatItems = [];
2466
2486
  this.itemMap = {};
2467
2487
  this.flattenItems(0, this.options.items);
2468
- console.log(this.flatItems);
2469
2488
  el.classList.add("websy-".concat(this.options.orientation, "-list-container"));
2470
2489
  el.classList.add('websy-menu');
2471
2490
 
@@ -2492,25 +2511,28 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2492
2511
  key: "flattenItems",
2493
2512
  value: function flattenItems(index, items) {
2494
2513
  var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
2514
+ var path = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
2495
2515
 
2496
2516
  if (items[index]) {
2497
2517
  this.lowestLevel = Math.max(level, this.lowestLevel);
2498
2518
  items[index].id = items[index].id || "".concat(this.elementId, "_").concat(this.normaliseString(items[index].text));
2499
- this.itemMap[items[index].id] = items[index];
2500
2519
  items[index].level = level;
2520
+ items[index].hasChildren = items[index].items && items[index].items.length > 0;
2521
+ items[index].path = path !== '' ? "".concat(path, "::").concat(items[index].id) : items[index].id;
2522
+ this.itemMap[items[index].id] = _extends({}, items[index]);
2501
2523
  this.flatItems.push(items[index]);
2502
2524
 
2503
2525
  if (items[index].items) {
2504
- this.flattenItems(0, items[index].items, level + 1);
2526
+ this.flattenItems(0, items[index].items, level + 1, items[index].path);
2505
2527
  }
2506
2528
 
2507
- this.flattenItems(++index, items, level);
2529
+ this.flattenItems(++index, items, level, path);
2508
2530
  }
2509
2531
  }
2510
2532
  }, {
2511
2533
  key: "handleClick",
2512
2534
  value: function handleClick(event) {
2513
- if (event.target.classList.contains('websy-menu-icon') || event.target.nodeName === 'svg' || event.target.nodeName === 'rect') {
2535
+ if (event.target.classList.contains('websy-menu-icon')) {
2514
2536
  this.toggleMobileMenu();
2515
2537
  }
2516
2538
 
@@ -2521,7 +2543,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2521
2543
  this.toggleMobileMenu('remove');
2522
2544
  }
2523
2545
 
2524
- if (item.items) {
2546
+ if (item.hasChildren === true) {
2525
2547
  event.target.classList.toggle('menu-open');
2526
2548
  this.toggleMenu(item.id);
2527
2549
  }
@@ -2531,6 +2553,60 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2531
2553
  this.toggleMobileMenu();
2532
2554
  }
2533
2555
  }
2556
+ }, {
2557
+ key: "handleSearch",
2558
+ value: function handleSearch(searchText) {
2559
+ var _this16 = this;
2560
+
2561
+ var el = document.getElementById(this.elementId);
2562
+ var lowestItems = this.flatItems.filter(function (d) {
2563
+ return d.level === _this16.maxLevel;
2564
+ });
2565
+ var visibleItems = lowestItems;
2566
+ var defaultMethod = 'remove';
2567
+
2568
+ if (searchText.length > 1) {
2569
+ defaultMethod = 'add';
2570
+ visibleItems = lowestItems.filter(function (d) {
2571
+ return d[_this16.options.searchProp].toLowerCase().indexOf(searchText.toLowerCase()) !== -1;
2572
+ });
2573
+ } // hide everything
2574
+
2575
+
2576
+ var textEls = el.querySelectorAll("div.websy-menu-header");
2577
+
2578
+ for (var t = 0; t < textEls.length; t++) {
2579
+ textEls[t].classList[defaultMethod]('websy-hidden');
2580
+ }
2581
+
2582
+ var listEls = el.querySelectorAll("ul.websy-child-list");
2583
+
2584
+ for (var l = 0; l < listEls.length; l++) {
2585
+ listEls[l].classList.add('websy-menu-collapsed');
2586
+ }
2587
+
2588
+ if (searchText.length > 1) {
2589
+ visibleItems.forEach(function (d) {
2590
+ // show the item and open the list
2591
+ var pathParts = d.path.split('::');
2592
+ pathParts.forEach(function (p) {
2593
+ var textEl = document.getElementById(p);
2594
+
2595
+ if (textEl) {
2596
+ textEl.classList.remove('websy-hidden');
2597
+ }
2598
+
2599
+ var listEl = document.getElementById("".concat(p, "_list"));
2600
+
2601
+ if (listEl) {
2602
+ listEl.classList.remove('websy-menu-collapsed');
2603
+ }
2604
+ });
2605
+ });
2606
+ }
2607
+
2608
+ console.log('visibleItems', visibleItems);
2609
+ }
2534
2610
  }, {
2535
2611
  key: "normaliseString",
2536
2612
  value: function normaliseString(text) {
@@ -2545,7 +2621,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2545
2621
  var html = "";
2546
2622
 
2547
2623
  if (this.options.collapsible === true) {
2548
- html += "\n <div id='".concat(this.elementId, "_menuIcon' class='websy-menu-icon'>\n <svg viewbox=\"0 0 40 40\" width=\"30\" height=\"40\"> \n <rect x=\"0\" y=\"0\" width=\"30\" height=\"4\" rx=\"2\"></rect>\n <rect x=\"0\" y=\"12\" width=\"30\" height=\"4\" rx=\"2\"></rect>\n <rect x=\"0\" y=\"24\" width=\"30\" height=\"4\" rx=\"2\"></rect>\n </svg>\n </div>\n ");
2624
+ html += "\n <div id='".concat(this.elementId, "_menuIcon' class='websy-menu-icon'>\n ").concat(this.options.menuIcon, "\n </div>\n ");
2549
2625
  }
2550
2626
 
2551
2627
  if (this.options.logo) {
@@ -2556,16 +2632,27 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2556
2632
  html += " \n <div \n class='logo ".concat(this.options.logo.classes || '', "'\n ").concat(this.options.logo.attributes && this.options.logo.attributes.join(' '), "\n >\n <img src='").concat(this.options.logo.url, "'></img>\n </div>\n <div id='").concat(this.elementId, "_mask' class='websy-menu-mask'></div>\n <div id=\"").concat(this.elementId, "_menuContainer\" class=\"websy-menu-block-container\">\n ");
2557
2633
  }
2558
2634
 
2559
- html += this.renderBlock(this.options.items, 'main', 0);
2635
+ if (this.options.enableSearch === true) {
2636
+ html += "\n <div id='".concat(this.elementId, "_search' class='websy-menu-search'></div>\n ");
2637
+ }
2638
+
2639
+ html += this.renderBlock(this.elementId, this.elementId, this.options.items, 'main', 0);
2560
2640
  html += "</div>";
2561
2641
  el.innerHTML = html;
2642
+
2643
+ if (this.options.enableSearch === true) {
2644
+ this.search = new WebsyDesigns.Search("".concat(this.elementId, "_search"), _extends({}, {
2645
+ onSearch: this.handleSearch.bind(this)
2646
+ }, this.options.searchOptions));
2647
+ }
2562
2648
  }
2563
2649
  }
2564
2650
  }, {
2565
2651
  key: "renderBlock",
2566
- value: function renderBlock(items, block) {
2567
- var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
2568
- var html = "\n\t\t <ul class='websy-".concat(this.options.orientation, "-list ").concat(level > 0 ? 'websy-child-list' : '', " ").concat(block !== 'main' ? 'websy-menu-collapsed' : '', "' id='").concat(this.elementId, "_").concat(block, "_list'\n\t ");
2652
+ value: function renderBlock(id, path, items, block) {
2653
+ var level = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
2654
+ this.maxLevel = Math.max(this.maxLevel, level);
2655
+ var html = "\n\t\t <ul class='websy-".concat(this.options.orientation, "-list ").concat(level > 0 ? 'websy-child-list' : '', " ").concat(block !== 'main' ? 'websy-menu-collapsed' : '', "' id='").concat(id, "_list' data-path='").concat(path, "'\n\t ");
2569
2656
 
2570
2657
  if (block !== 'main') {
2571
2658
  html += " data-collapsed='".concat(block !== 'main' ? 'true' : 'false', "'");
@@ -2585,7 +2672,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2585
2672
  items[i].classes = items[i].classes.join(' ');
2586
2673
  }
2587
2674
 
2588
- html += "\n\t\t\t<li class='websy-".concat(this.options.orientation, "-list-item ").concat(items[i].alwaysOpen === true ? 'always-open' : '', "'>\n\t\t\t\t<div class='websy-menu-header ").concat(items[i].classes || '', " ").concat(selected, " ").concat(active, "' \n\t\t\t\t\t\t id='").concat(blockId, "' \n\t\t\t\t\t\t data-id='").concat(currentBlock, "'\n data-menu-id='").concat(this.elementId, "_").concat(currentBlock, "_list'\n\t\t\t\t\t\t data-popout-id='").concat(level > 1 ? block : currentBlock, "'\n\t\t\t\t\t\t data-text='").concat(items[i].isLink !== true ? items[i].text : '', "'\n\t\t\t\t\t\t style='padding-left: ").concat(level * this.options.childIndentation, "px'\n\t\t\t\t\t\t ").concat(items[i].attributes && items[i].attributes.join(' ') || '', "\n >\n ");
2675
+ html += "\n\t\t\t<li class='websy-".concat(this.options.orientation, "-list-item ").concat(items[i].alwaysOpen === true ? 'always-open' : '', "'>\n\t\t\t\t<div class='websy-menu-header ").concat(items[i].classes || '', " ").concat(selected, " ").concat(active, "' \n id='").concat(blockId, "' \n data-id='").concat(currentBlock, "'\n data-path='").concat(items[i].path, "'\n data-menu-id='").concat(this.elementId, "_").concat(currentBlock, "_list'\n data-popout-id='").concat(level > 1 ? block : currentBlock, "'\n data-text='").concat(items[i].isLink !== true ? items[i].text : '', "'\n style='padding-left: ").concat(level * this.options.childIndentation, "px'\n ").concat(items[i].attributes && items[i].attributes.join(' ') || '', "\n >\n ");
2589
2676
 
2590
2677
  if (this.options.orientation === 'horizontal') {
2591
2678
  html += items[i].text;
@@ -2601,8 +2688,9 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2601
2688
 
2602
2689
  html += " \n <span class='".concat(items[i].items && items[i].items.length > 0 ? 'menu-carat' : '', "'></span>\n ");
2603
2690
 
2604
- if (this.options.orientation === 'vertical') {
2605
- html += "\n &nbsp;\n ";
2691
+ if (this.options.orientation === 'vertical') {// html += `
2692
+ // &nbsp;
2693
+ // `
2606
2694
  }
2607
2695
 
2608
2696
  if (items[i].isLink === true && items[i].href) {
@@ -2612,7 +2700,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2612
2700
  html += " \n\t\t\t\t</div>\n\t\t ";
2613
2701
 
2614
2702
  if (items[i].items) {
2615
- html += this.renderBlock(items[i].items, currentBlock, items[i].level + 1);
2703
+ html += this.renderBlock(blockId, items[i].path, items[i].items, currentBlock, items[i].level + 1);
2616
2704
  } // map the item to it's parent
2617
2705
 
2618
2706
 
@@ -2631,7 +2719,8 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2631
2719
  }, {
2632
2720
  key: "toggleMenu",
2633
2721
  value: function toggleMenu(id) {
2634
- var el = document.getElementById("".concat(id, "_list"));
2722
+ var el = document.getElementById("".concat(id, "_list")); // const menuId = el.getAttribute('data-menu-id')
2723
+ // const menuEl = document.getElementById(menuId)
2635
2724
 
2636
2725
  if (el) {
2637
2726
  el.classList.toggle('websy-menu-collapsed');
@@ -2663,7 +2752,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
2663
2752
 
2664
2753
  var Pager = /*#__PURE__*/function () {
2665
2754
  function Pager(elementId, options) {
2666
- var _this16 = this;
2755
+ var _this17 = this;
2667
2756
 
2668
2757
  _classCallCheck(this, Pager);
2669
2758
 
@@ -2716,8 +2805,8 @@ var Pager = /*#__PURE__*/function () {
2716
2805
  allowClear: false,
2717
2806
  disableSearch: true,
2718
2807
  onItemSelected: function onItemSelected(selectedItem) {
2719
- if (_this16.options.onChangePageSize) {
2720
- _this16.options.onChangePageSize(selectedItem.value);
2808
+ if (_this17.options.onChangePageSize) {
2809
+ _this17.options.onChangePageSize(selectedItem.value);
2721
2810
  }
2722
2811
  }
2723
2812
  });
@@ -2741,13 +2830,13 @@ var Pager = /*#__PURE__*/function () {
2741
2830
  }, {
2742
2831
  key: "render",
2743
2832
  value: function render() {
2744
- var _this17 = this;
2833
+ var _this18 = this;
2745
2834
 
2746
2835
  var el = document.getElementById("".concat(this.elementId, "_pageList"));
2747
2836
 
2748
2837
  if (el) {
2749
2838
  var pages = this.options.pages.map(function (item, index) {
2750
- return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(_this17.options.activePage === index ? 'active' : '', "\">").concat(index + 1, "</li>");
2839
+ return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(_this18.options.activePage === index ? 'active' : '', "\">").concat(index + 1, "</li>");
2751
2840
  });
2752
2841
  var startIndex = 0;
2753
2842
 
@@ -2815,58 +2904,58 @@ var WebsyPDFButton = /*#__PURE__*/function () {
2815
2904
  _createClass(WebsyPDFButton, [{
2816
2905
  key: "handleClick",
2817
2906
  value: function handleClick(event) {
2818
- var _this18 = this;
2907
+ var _this19 = this;
2819
2908
 
2820
2909
  if (event.target.classList.contains('websy-pdf-button')) {
2821
2910
  this.loader.show();
2822
2911
  setTimeout(function () {
2823
- if (_this18.options.targetId) {
2824
- var el = document.getElementById(_this18.options.targetId);
2912
+ if (_this19.options.targetId) {
2913
+ var el = document.getElementById(_this19.options.targetId);
2825
2914
 
2826
2915
  if (el) {
2827
2916
  var pdfData = {
2828
2917
  options: {}
2829
2918
  };
2830
2919
 
2831
- if (_this18.options.pdfOptions) {
2832
- pdfData.options = _extends({}, _this18.options.pdfOptions);
2920
+ if (_this19.options.pdfOptions) {
2921
+ pdfData.options = _extends({}, _this19.options.pdfOptions);
2833
2922
  }
2834
2923
 
2835
- if (_this18.options.header) {
2836
- if (_this18.options.header.elementId) {
2837
- var headerEl = document.getElementById(_this18.options.header.elementId);
2924
+ if (_this19.options.header) {
2925
+ if (_this19.options.header.elementId) {
2926
+ var headerEl = document.getElementById(_this19.options.header.elementId);
2838
2927
 
2839
2928
  if (headerEl) {
2840
2929
  pdfData.header = headerEl.outerHTML;
2841
2930
 
2842
- if (_this18.options.header.css) {
2843
- pdfData.options.headerCSS = _this18.options.header.css;
2931
+ if (_this19.options.header.css) {
2932
+ pdfData.options.headerCSS = _this19.options.header.css;
2844
2933
  }
2845
2934
  }
2846
- } else if (_this18.options.header.html) {
2847
- pdfData.header = _this18.options.header.html;
2935
+ } else if (_this19.options.header.html) {
2936
+ pdfData.header = _this19.options.header.html;
2848
2937
 
2849
- if (_this18.options.header.css) {
2850
- pdfData.options.headerCSS = _this18.options.header.css;
2938
+ if (_this19.options.header.css) {
2939
+ pdfData.options.headerCSS = _this19.options.header.css;
2851
2940
  }
2852
2941
  } else {
2853
- pdfData.header = _this18.options.header;
2942
+ pdfData.header = _this19.options.header;
2854
2943
  }
2855
2944
  }
2856
2945
 
2857
- if (_this18.options.footer) {
2858
- if (_this18.options.footer.elementId) {
2859
- var footerEl = document.getElementById(_this18.options.footer.elementId);
2946
+ if (_this19.options.footer) {
2947
+ if (_this19.options.footer.elementId) {
2948
+ var footerEl = document.getElementById(_this19.options.footer.elementId);
2860
2949
 
2861
2950
  if (footerEl) {
2862
2951
  pdfData.footer = footerEl.outerHTML;
2863
2952
 
2864
- if (_this18.options.footer.css) {
2865
- pdfData.options.footerCSS = _this18.options.footer.css;
2953
+ if (_this19.options.footer.css) {
2954
+ pdfData.options.footerCSS = _this19.options.footer.css;
2866
2955
  }
2867
2956
  }
2868
2957
  } else {
2869
- pdfData.footer = _this18.options.footer;
2958
+ pdfData.footer = _this19.options.footer;
2870
2959
  }
2871
2960
  }
2872
2961
 
@@ -2875,31 +2964,31 @@ var WebsyPDFButton = /*#__PURE__*/function () {
2875
2964
  // document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
2876
2965
  // document.getElementById(`${this.elementId}_form`).submit()
2877
2966
 
2878
- _this18.service.add('', pdfData, {
2967
+ _this19.service.add('', pdfData, {
2879
2968
  responseType: 'blob'
2880
2969
  }).then(function (response) {
2881
- _this18.loader.hide();
2970
+ _this19.loader.hide();
2882
2971
 
2883
2972
  var blob = new Blob([response], {
2884
2973
  type: 'application/pdf'
2885
2974
  });
2886
2975
  var msg = "\n <div class='text-center websy-pdf-download'>\n <div>Your file is ready to download</div>\n <a href='".concat(URL.createObjectURL(blob), "' target='_blank'\n ");
2887
2976
 
2888
- if (_this18.options.directDownload === true) {
2977
+ if (_this19.options.directDownload === true) {
2889
2978
  var fileName;
2890
2979
 
2891
- if (typeof _this18.options.fileName === 'function') {
2892
- fileName = _this18.options.fileName() || 'Export';
2980
+ if (typeof _this19.options.fileName === 'function') {
2981
+ fileName = _this19.options.fileName() || 'Export';
2893
2982
  } else {
2894
- fileName = _this18.options.fileName || 'Export';
2983
+ fileName = _this19.options.fileName || 'Export';
2895
2984
  }
2896
2985
 
2897
2986
  msg += "download='".concat(fileName, ".pdf'");
2898
2987
  }
2899
2988
 
2900
- msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this18.options.buttonText, "</button>\n </a>\n </div>\n ");
2989
+ msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this19.options.buttonText, "</button>\n </a>\n </div>\n ");
2901
2990
 
2902
- _this18.popup.show({
2991
+ _this19.popup.show({
2903
2992
  message: msg,
2904
2993
  mask: true
2905
2994
  });
@@ -3100,7 +3189,7 @@ var WebsyPubSub = /*#__PURE__*/function () {
3100
3189
 
3101
3190
  var ResponsiveText = /*#__PURE__*/function () {
3102
3191
  function ResponsiveText(elementId, options) {
3103
- var _this19 = this;
3192
+ var _this20 = this;
3104
3193
 
3105
3194
  _classCallCheck(this, ResponsiveText);
3106
3195
 
@@ -3113,7 +3202,7 @@ var ResponsiveText = /*#__PURE__*/function () {
3113
3202
  this.elementId = elementId;
3114
3203
  this.canvas = document.createElement('canvas');
3115
3204
  window.addEventListener('resize', function () {
3116
- return _this19.render();
3205
+ return _this20.render();
3117
3206
  });
3118
3207
  var el = document.getElementById(this.elementId);
3119
3208
 
@@ -3332,7 +3421,7 @@ var ResponsiveText = /*#__PURE__*/function () {
3332
3421
 
3333
3422
  var WebsyResultList = /*#__PURE__*/function () {
3334
3423
  function WebsyResultList(elementId, options) {
3335
- var _this20 = this;
3424
+ var _this21 = this;
3336
3425
 
3337
3426
  _classCallCheck(this, WebsyResultList);
3338
3427
 
@@ -3361,9 +3450,9 @@ var WebsyResultList = /*#__PURE__*/function () {
3361
3450
 
3362
3451
  if (_typeof(options.template) === 'object' && options.template.url) {
3363
3452
  this.templateService.get(options.template.url).then(function (templateString) {
3364
- _this20.options.template = templateString;
3453
+ _this21.options.template = templateString;
3365
3454
 
3366
- _this20.render();
3455
+ _this21.render();
3367
3456
  });
3368
3457
  } else {
3369
3458
  this.render();
@@ -3383,7 +3472,7 @@ var WebsyResultList = /*#__PURE__*/function () {
3383
3472
  }, {
3384
3473
  key: "buildHTML",
3385
3474
  value: function buildHTML(d) {
3386
- var _this21 = this;
3475
+ var _this22 = this;
3387
3476
 
3388
3477
  var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
3389
3478
  var inputTemplate = arguments.length > 2 ? arguments[2] : undefined;
@@ -3393,7 +3482,7 @@ var WebsyResultList = /*#__PURE__*/function () {
3393
3482
  if (this.options.template) {
3394
3483
  if (d.length > 0) {
3395
3484
  d.forEach(function (row, ix) {
3396
- var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate || _this21.options.template).concat(ix < d.length - 1 ? '<!--' : ''); // find conditional elements
3485
+ var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate || _this22.options.template).concat(ix < d.length - 1 ? '<!--' : ''); // find conditional elements
3397
3486
 
3398
3487
  var ifMatches = _toConsumableArray(template.matchAll(/<\s*if[^>]*>([\s\S]*?)<\s*\/\s*if>/g));
3399
3488
 
@@ -3498,7 +3587,7 @@ var WebsyResultList = /*#__PURE__*/function () {
3498
3587
  parts.forEach(function (p) {
3499
3588
  items = items[p];
3500
3589
  });
3501
- template = template.replace(m[0], _this21.buildHTML(items, 0, withoutFor, [].concat(_toConsumableArray(locator), ["".concat(startIndex + ix, ":").concat(c)])));
3590
+ template = template.replace(m[0], _this22.buildHTML(items, 0, withoutFor, [].concat(_toConsumableArray(locator), ["".concat(startIndex + ix, ":").concat(c)])));
3502
3591
  }
3503
3592
  });
3504
3593
 
@@ -3510,7 +3599,7 @@ var WebsyResultList = /*#__PURE__*/function () {
3510
3599
  }
3511
3600
  });
3512
3601
 
3513
- var flatRow = _this21.flattenObject(row);
3602
+ var flatRow = _this22.flattenObject(row);
3514
3603
 
3515
3604
  for (var key in flatRow) {
3516
3605
  var rg = new RegExp("{".concat(key, "}"), 'gm');
@@ -3625,13 +3714,13 @@ var WebsyResultList = /*#__PURE__*/function () {
3625
3714
  }, {
3626
3715
  key: "render",
3627
3716
  value: function render() {
3628
- var _this22 = this;
3717
+ var _this23 = this;
3629
3718
 
3630
3719
  if (this.options.entity) {
3631
3720
  this.apiService.get(this.options.entity).then(function (results) {
3632
- _this22.rows = results.rows;
3721
+ _this23.rows = results.rows;
3633
3722
 
3634
- _this22.resize();
3723
+ _this23.resize();
3635
3724
  });
3636
3725
  } else {
3637
3726
  this.resize();
@@ -3686,7 +3775,14 @@ var WebsyRouter = /*#__PURE__*/function () {
3686
3775
  this.previousView = '';
3687
3776
  this.currentView = '';
3688
3777
  this.currentViewMain = '';
3689
- this.currentParams = {};
3778
+ this.currentParams = {
3779
+ path: '',
3780
+ items: {}
3781
+ };
3782
+ this.previousParams = {
3783
+ path: '',
3784
+ items: {}
3785
+ };
3690
3786
  this.controlPressed = false;
3691
3787
  this.usesHTMLSuffix = window.location.pathname.indexOf('.htm') !== -1;
3692
3788
  window.addEventListener('popstate', this.onPopState.bind(this));
@@ -3709,14 +3805,14 @@ var WebsyRouter = /*#__PURE__*/function () {
3709
3805
  _createClass(WebsyRouter, [{
3710
3806
  key: "addGroup",
3711
3807
  value: function addGroup(group) {
3712
- var _this23 = this;
3808
+ var _this24 = this;
3713
3809
 
3714
3810
  if (!this.groups[group]) {
3715
3811
  var els = document.querySelectorAll(".websy-view[data-group=\"".concat(group, "\"]"));
3716
3812
 
3717
3813
  if (els) {
3718
3814
  this.getClosestParent(els[0], function (parent) {
3719
- _this23.groups[group] = {
3815
+ _this24.groups[group] = {
3720
3816
  activeView: '',
3721
3817
  views: [],
3722
3818
  parent: parent.getAttribute('data-view')
@@ -3739,10 +3835,13 @@ var WebsyRouter = /*#__PURE__*/function () {
3739
3835
  }, {
3740
3836
  key: "addUrlParams",
3741
3837
  value: function addUrlParams(params) {
3838
+ var reloadView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3839
+
3742
3840
  if (typeof params === 'undefined') {
3743
3841
  return;
3744
3842
  }
3745
3843
 
3844
+ this.previousParams = _extends({}, this.currentParams);
3746
3845
  var output = {
3747
3846
  path: '',
3748
3847
  items: {}
@@ -3767,6 +3866,10 @@ var WebsyRouter = /*#__PURE__*/function () {
3767
3866
  history.pushState({
3768
3867
  inputPath: inputPath
3769
3868
  }, inputPath, "".concat(inputPath, "?").concat(path));
3869
+
3870
+ if (reloadView === true) {
3871
+ this.showView(this.currentView, this.currentParams, 'main');
3872
+ }
3770
3873
  }
3771
3874
  }, {
3772
3875
  key: "buildUrlPath",
@@ -3808,6 +3911,7 @@ var WebsyRouter = /*#__PURE__*/function () {
3808
3911
  }, {
3809
3912
  key: "formatParams",
3810
3913
  value: function formatParams(params) {
3914
+ this.previousParams = _extends({}, this.currentParams);
3811
3915
  var output = {
3812
3916
  path: params,
3813
3917
  items: {}
@@ -4041,12 +4145,12 @@ var WebsyRouter = /*#__PURE__*/function () {
4041
4145
  }, {
4042
4146
  key: "showComponents",
4043
4147
  value: function showComponents(view) {
4044
- var _this24 = this;
4148
+ var _this25 = this;
4045
4149
 
4046
4150
  if (this.options.views && this.options.views[view] && this.options.views[view].components) {
4047
4151
  this.options.views[view].components.forEach(function (c) {
4048
4152
  if (typeof c.instance === 'undefined') {
4049
- _this24.prepComponent(c.elementId, c.options);
4153
+ _this25.prepComponent(c.elementId, c.options);
4050
4154
 
4051
4155
  c.instance = new c.Component(c.elementId, c.options);
4052
4156
  } else if (c.instance.render) {
@@ -4072,6 +4176,9 @@ var WebsyRouter = /*#__PURE__*/function () {
4072
4176
  if (this.previousView !== this.currentView || group !== 'main') {
4073
4177
  this.showComponents(view);
4074
4178
  this.publish('show', [view, params, group]);
4179
+ } else if (this.previousView === this.currentView && this.previousParams.path !== this.currentParams.path) {
4180
+ this.showComponents(view);
4181
+ this.publish('show', [view, params, group]);
4075
4182
  }
4076
4183
  }
4077
4184
  }, {
@@ -4097,7 +4204,7 @@ var WebsyRouter = /*#__PURE__*/function () {
4097
4204
  var params = {};
4098
4205
  var newPath = inputPath;
4099
4206
 
4100
- if (inputPath === this.options.defaultView && this.usesHTMLSuffix === false) {
4207
+ if (inputPath.split('?')[0] === this.options.defaultView && this.usesHTMLSuffix === false) {
4101
4208
  inputPath = inputPath.replace(this.options.defaultView, '/');
4102
4209
  }
4103
4210
 
@@ -4105,8 +4212,6 @@ var WebsyRouter = /*#__PURE__*/function () {
4105
4212
  if (inputPath.indexOf('?') === -1 && this.queryParams) {
4106
4213
  inputPath += "?".concat(this.queryParams);
4107
4214
  }
4108
- } else {
4109
- this.currentParams = {};
4110
4215
  }
4111
4216
 
4112
4217
  if (this.usesHTMLSuffix === true) {
@@ -4130,7 +4235,11 @@ var WebsyRouter = /*#__PURE__*/function () {
4130
4235
  params = this.formatParams(parts[1]);
4131
4236
  inputPath = parts[0];
4132
4237
  } else if (group === this.options.defaultGroup) {
4133
- this.currentParams = {};
4238
+ this.previousParams = _extends({}, this.currentParams);
4239
+ this.currentParams = {
4240
+ path: '',
4241
+ items: {}
4242
+ };
4134
4243
  }
4135
4244
 
4136
4245
  if (event) {
@@ -4196,12 +4305,6 @@ var WebsyRouter = /*#__PURE__*/function () {
4196
4305
  return;
4197
4306
  }
4198
4307
 
4199
- if (toggle === false) {
4200
- this.showView(this.currentView, this.currentParams, group);
4201
- } else if (newPath && newPath !== '') {
4202
- this.showView(newPath, null, group);
4203
- }
4204
-
4205
4308
  if (this.usesHTMLSuffix === true) {
4206
4309
  inputPath = window.location.pathname.split('/').pop() + inputPath;
4207
4310
  }
@@ -4229,6 +4332,12 @@ var WebsyRouter = /*#__PURE__*/function () {
4229
4332
  } else {//
4230
4333
  }
4231
4334
  }
4335
+
4336
+ if (toggle === false) {
4337
+ this.showView(this.currentView, this.currentParams, group);
4338
+ } else if (newPath && newPath !== '') {
4339
+ this.showView(newPath, null, group);
4340
+ }
4232
4341
  }
4233
4342
  }, {
4234
4343
  key: "on",
@@ -4415,7 +4524,7 @@ var Switch = /*#__PURE__*/function () {
4415
4524
 
4416
4525
  var WebsyTemplate = /*#__PURE__*/function () {
4417
4526
  function WebsyTemplate(elementId, options) {
4418
- var _this25 = this;
4527
+ var _this26 = this;
4419
4528
 
4420
4529
  _classCallCheck(this, WebsyTemplate);
4421
4530
 
@@ -4441,9 +4550,9 @@ var WebsyTemplate = /*#__PURE__*/function () {
4441
4550
 
4442
4551
  if (_typeof(options.template) === 'object' && options.template.url) {
4443
4552
  this.templateService.get(options.template.url).then(function (templateString) {
4444
- _this25.options.template = templateString;
4553
+ _this26.options.template = templateString;
4445
4554
 
4446
- _this25.render();
4555
+ _this26.render();
4447
4556
  });
4448
4557
  } else {
4449
4558
  this.render();
@@ -4453,7 +4562,7 @@ var WebsyTemplate = /*#__PURE__*/function () {
4453
4562
  _createClass(WebsyTemplate, [{
4454
4563
  key: "buildHTML",
4455
4564
  value: function buildHTML() {
4456
- var _this26 = this;
4565
+ var _this27 = this;
4457
4566
 
4458
4567
  var html = "";
4459
4568
 
@@ -4515,14 +4624,14 @@ var WebsyTemplate = /*#__PURE__*/function () {
4515
4624
  }
4516
4625
 
4517
4626
  if (polarity === true) {
4518
- if (typeof _this26.options.data[parts[0]] !== 'undefined' && _this26.options.data[parts[0]] === parts[1]) {
4627
+ if (typeof _this27.options.data[parts[0]] !== 'undefined' && _this27.options.data[parts[0]] === parts[1]) {
4519
4628
  // remove the <if> tags
4520
4629
  removeAll = false;
4521
4630
  } else if (parts[0] === parts[1]) {
4522
4631
  removeAll = false;
4523
4632
  }
4524
4633
  } else if (polarity === false) {
4525
- if (typeof _this26.options.data[parts[0]] !== 'undefined' && _this26.options.data[parts[0]] !== parts[1]) {
4634
+ if (typeof _this27.options.data[parts[0]] !== 'undefined' && _this27.options.data[parts[0]] !== parts[1]) {
4526
4635
  // remove the <if> tags
4527
4636
  removeAll = false;
4528
4637
  }
@@ -4812,7 +4921,7 @@ var WebsyUtils = {
4812
4921
 
4813
4922
  var WebsyTable = /*#__PURE__*/function () {
4814
4923
  function WebsyTable(elementId, options) {
4815
- var _this27 = this;
4924
+ var _this28 = this;
4816
4925
 
4817
4926
  _classCallCheck(this, WebsyTable);
4818
4927
 
@@ -4850,8 +4959,8 @@ var WebsyTable = /*#__PURE__*/function () {
4850
4959
  allowClear: false,
4851
4960
  disableSearch: true,
4852
4961
  onItemSelected: function onItemSelected(selectedItem) {
4853
- if (_this27.options.onChangePageSize) {
4854
- _this27.options.onChangePageSize(selectedItem.value);
4962
+ if (_this28.options.onChangePageSize) {
4963
+ _this28.options.onChangePageSize(selectedItem.value);
4855
4964
  }
4856
4965
  }
4857
4966
  });
@@ -4872,7 +4981,7 @@ var WebsyTable = /*#__PURE__*/function () {
4872
4981
  _createClass(WebsyTable, [{
4873
4982
  key: "appendRows",
4874
4983
  value: function appendRows(data) {
4875
- var _this28 = this;
4984
+ var _this29 = this;
4876
4985
 
4877
4986
  this.hideError();
4878
4987
  var bodyHTML = '';
@@ -4880,15 +4989,15 @@ var WebsyTable = /*#__PURE__*/function () {
4880
4989
  if (data) {
4881
4990
  bodyHTML += data.map(function (r, rowIndex) {
4882
4991
  return '<tr>' + r.map(function (c, i) {
4883
- if (_this28.options.columns[i].show !== false) {
4992
+ if (_this29.options.columns[i].show !== false) {
4884
4993
  var style = '';
4885
4994
 
4886
4995
  if (c.style) {
4887
4996
  style += c.style;
4888
4997
  }
4889
4998
 
4890
- if (_this28.options.columns[i].width) {
4891
- style += "width: ".concat(_this28.options.columns[i].width, "; ");
4999
+ if (_this29.options.columns[i].width) {
5000
+ style += "width: ".concat(_this29.options.columns[i].width, "; ");
4892
5001
  }
4893
5002
 
4894
5003
  if (c.backgroundColor) {
@@ -4903,18 +5012,18 @@ var WebsyTable = /*#__PURE__*/function () {
4903
5012
  style += "color: ".concat(c.color, "; ");
4904
5013
  }
4905
5014
 
4906
- if (_this28.options.columns[i].showAsLink === true && c.value.trim() !== '') {
4907
- return "\n <td \n data-row-index='".concat(_this28.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this28.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(_this28.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this28.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
4908
- } else if ((_this28.options.columns[i].showAsNavigatorLink === true || _this28.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
4909
- return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this28.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this28.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this28.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this28.options.columns[i].linkText || c.value, "</td>\n ");
5015
+ if (_this29.options.columns[i].showAsLink === true && c.value.trim() !== '') {
5016
+ return "\n <td \n data-row-index='".concat(_this29.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this29.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(_this29.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this29.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
5017
+ } else if ((_this29.options.columns[i].showAsNavigatorLink === true || _this29.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
5018
+ return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this29.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this29.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this29.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this29.options.columns[i].linkText || c.value, "</td>\n ");
4910
5019
  } else {
4911
5020
  var info = c.value;
4912
5021
 
4913
- if (_this28.options.columns[i].showAsImage === true) {
5022
+ if (_this29.options.columns[i].showAsImage === true) {
4914
5023
  c.value = "\n <img src='".concat(c.value, "'>\n ");
4915
5024
  }
4916
5025
 
4917
- return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this28.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this28.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 ");
5026
+ return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this29.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this29.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 ");
4918
5027
  }
4919
5028
  }
4920
5029
  }).join('') + '</tr>';
@@ -5086,7 +5195,7 @@ var WebsyTable = /*#__PURE__*/function () {
5086
5195
  }, {
5087
5196
  key: "render",
5088
5197
  value: function render(data) {
5089
- var _this29 = this;
5198
+ var _this30 = this;
5090
5199
 
5091
5200
  if (!this.options.columns) {
5092
5201
  return;
@@ -5121,7 +5230,7 @@ var WebsyTable = /*#__PURE__*/function () {
5121
5230
  style += "width: ".concat(c.width || 'auto', ";");
5122
5231
  }
5123
5232
 
5124
- 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 ? _this29.buildSearchIcon(c.qGroupFieldDefs[0]) : '', "-->\n </div>\n </th>\n ");
5233
+ 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 ? _this30.buildSearchIcon(c.qGroupFieldDefs[0]) : '', "-->\n </div>\n </th>\n ");
5125
5234
  }
5126
5235
  }).join('') + '</tr>';
5127
5236
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
@@ -5140,7 +5249,7 @@ var WebsyTable = /*#__PURE__*/function () {
5140
5249
 
5141
5250
  if (pagingEl) {
5142
5251
  var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
5143
- return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this29.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
5252
+ return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this30.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
5144
5253
  });
5145
5254
  var startIndex = 0;
5146
5255
 
@@ -5208,7 +5317,7 @@ var WebsyTable = /*#__PURE__*/function () {
5208
5317
 
5209
5318
  var WebsyTable2 = /*#__PURE__*/function () {
5210
5319
  function WebsyTable2(elementId, options) {
5211
- var _this30 = this;
5320
+ var _this31 = this;
5212
5321
 
5213
5322
  _classCallCheck(this, WebsyTable2);
5214
5323
 
@@ -5249,8 +5358,8 @@ var WebsyTable2 = /*#__PURE__*/function () {
5249
5358
  allowClear: false,
5250
5359
  disableSearch: true,
5251
5360
  onItemSelected: function onItemSelected(selectedItem) {
5252
- if (_this30.options.onChangePageSize) {
5253
- _this30.options.onChangePageSize(selectedItem.value);
5361
+ if (_this31.options.onChangePageSize) {
5362
+ _this31.options.onChangePageSize(selectedItem.value);
5254
5363
  }
5255
5364
  }
5256
5365
  });
@@ -5274,7 +5383,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
5274
5383
  _createClass(WebsyTable2, [{
5275
5384
  key: "appendRows",
5276
5385
  value: function appendRows(data) {
5277
- var _this31 = this;
5386
+ var _this32 = this;
5278
5387
 
5279
5388
  this.hideError();
5280
5389
  var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
@@ -5283,15 +5392,15 @@ var WebsyTable2 = /*#__PURE__*/function () {
5283
5392
  if (data) {
5284
5393
  bodyHTML += data.map(function (r, rowIndex) {
5285
5394
  return '<tr>' + r.map(function (c, i) {
5286
- if (_this31.options.columns[i].show !== false) {
5287
- var style = "height: ".concat(_this31.options.cellSize, "px; line-height: ").concat(_this31.options.cellSize, "px;");
5395
+ if (_this32.options.columns[i].show !== false) {
5396
+ var style = "height: ".concat(_this32.options.cellSize, "px; line-height: ").concat(_this32.options.cellSize, "px;");
5288
5397
 
5289
5398
  if (c.style) {
5290
5399
  style += c.style;
5291
5400
  }
5292
5401
 
5293
- if (_this31.options.columns[i].width) {
5294
- style += "width: ".concat(_this31.options.columns[i].width, "; ");
5402
+ if (_this32.options.columns[i].width) {
5403
+ style += "width: ".concat(_this32.options.columns[i].width, "; ");
5295
5404
  }
5296
5405
 
5297
5406
  if (c.backgroundColor) {
@@ -5306,18 +5415,18 @@ var WebsyTable2 = /*#__PURE__*/function () {
5306
5415
  style += "color: ".concat(c.color, "; ");
5307
5416
  }
5308
5417
 
5309
- if (_this31.options.columns[i].showAsLink === true && c.value.trim() !== '') {
5310
- return "\n <td \n data-row-index='".concat(_this31.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this31.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(_this31.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this31.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
5311
- } else if ((_this31.options.columns[i].showAsNavigatorLink === true || _this31.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
5312
- return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this31.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this31.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this31.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this31.options.columns[i].linkText || c.value, "</td>\n ");
5418
+ if (_this32.options.columns[i].showAsLink === true && c.value.trim() !== '') {
5419
+ 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 ");
5420
+ } else if ((_this32.options.columns[i].showAsNavigatorLink === true || _this32.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
5421
+ 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 ");
5313
5422
  } else {
5314
5423
  var info = c.value;
5315
5424
 
5316
- if (_this31.options.columns[i].showAsImage === true) {
5425
+ if (_this32.options.columns[i].showAsImage === true) {
5317
5426
  c.value = "\n <img src='".concat(c.value, "'>\n ");
5318
5427
  }
5319
5428
 
5320
- return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this31.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this31.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 ");
5429
+ 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 ");
5321
5430
  }
5322
5431
  }
5323
5432
  }).join('') + '</tr>';
@@ -5580,7 +5689,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
5580
5689
  }, {
5581
5690
  key: "render",
5582
5691
  value: function render(data) {
5583
- var _this32 = this;
5692
+ var _this33 = this;
5584
5693
 
5585
5694
  if (!this.options.columns) {
5586
5695
  return;
@@ -5616,7 +5725,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
5616
5725
  style += "width: ".concat(c.width || 'auto', "; ");
5617
5726
  }
5618
5727
 
5619
- 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 ? _this32.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
5728
+ 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 ? _this33.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
5620
5729
  }
5621
5730
  }).join('') + '</tr>';
5622
5731
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
@@ -5627,7 +5736,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
5627
5736
  var dropdownHTML = "";
5628
5737
  this.options.columns.forEach(function (c, i) {
5629
5738
  if (c.searchable && c.searchField) {
5630
- dropdownHTML += "\n <div id=\"".concat(_this32.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
5739
+ dropdownHTML += "\n <div id=\"".concat(_this33.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
5631
5740
  }
5632
5741
  });
5633
5742
  dropdownEl.innerHTML = dropdownHTML;
@@ -5649,7 +5758,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
5649
5758
 
5650
5759
  if (pagingEl) {
5651
5760
  var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
5652
- return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this32.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
5761
+ return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this33.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
5653
5762
  });
5654
5763
  var startIndex = 0;
5655
5764
 
@@ -5740,7 +5849,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
5740
5849
  }, {
5741
5850
  key: "getColumnParameters",
5742
5851
  value: function getColumnParameters(values) {
5743
- var _this33 = this;
5852
+ var _this34 = this;
5744
5853
 
5745
5854
  var tableEl = document.getElementById("".concat(this.elementId, "_table"));
5746
5855
  tableEl.style.tableLayout = 'auto';
@@ -5748,10 +5857,10 @@ var WebsyTable2 = /*#__PURE__*/function () {
5748
5857
  var headEl = document.getElementById("".concat(this.elementId, "_head"));
5749
5858
  var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
5750
5859
  headEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c, i) {
5751
- 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 ? _this33.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
5860
+ 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 ? _this34.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
5752
5861
  }).join('') + '</tr>';
5753
5862
  bodyEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c) {
5754
- return "\n <td \n style='height: ".concat(_this33.options.cellSize, "px; line-height: ").concat(_this33.options.cellSize, "px; padding: 10px 5px;'\n >").concat(c.value || '&nbsp;', "</td>\n ");
5863
+ return "\n <td \n style='height: ".concat(_this34.options.cellSize, "px; line-height: ").concat(_this34.options.cellSize, "px; padding: 10px 5px;'\n >").concat(c.value || '&nbsp;', "</td>\n ");
5755
5864
  }).join('') + '</tr>'; // get height of the first data cell
5756
5865
 
5757
5866
  var cells = bodyEl.querySelectorAll("tr:first-of-type td");
@@ -5895,7 +6004,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
5895
6004
  bodyHtml += '</colgroup>';
5896
6005
  }
5897
6006
 
5898
- data.forEach(function (row) {
6007
+ data.forEach(function (row, rowIndex) {
5899
6008
  bodyHtml += "<tr class=\"websy-table-row\">";
5900
6009
  row.forEach(function (cell, cellIndex) {
5901
6010
  if (typeof sizingColumns[cellIndex] === 'undefined') {
@@ -5925,14 +6034,24 @@ var WebsyTable3 = /*#__PURE__*/function () {
5925
6034
  }
5926
6035
 
5927
6036
  console.log('rowspan', cell.rowspan);
5928
- bodyHtml += "<td \n class='websy-table-cell ".concat((cell.classes || []).join(' '), "'\n style='").concat(style, "'\n data-info='").concat(cell.value, "'\n colspan='").concat(cell.colspan || 1, "'\n rowspan='").concat(cell.rowspan || 1, "'\n "); // if (useWidths === true) {
6037
+ bodyHtml += "<td \n class='websy-table-cell ".concat((cell.classes || []).join(' '), "'\n style='").concat(style, "'\n data-info='").concat(cell.value, "'\n colspan='").concat(cell.colspan || 1, "'\n rowspan='").concat(cell.rowspan || 1, "'\n data-row-index='").concat(rowIndex, "'\n data-col-index='").concat(cellIndex, "'\n "); // if (useWidths === true) {
5929
6038
  // bodyHtml += `
5930
6039
  // style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
5931
6040
  // width='${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}'
5932
6041
  // `
5933
6042
  // }
5934
6043
 
5935
- bodyHtml += "\n >\n ".concat(cell.value, "\n </td>");
6044
+ bodyHtml += "\n >";
6045
+
6046
+ if (cell.expandable === true) {
6047
+ bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(WebsyDesigns.Icons.Plus, "</i>");
6048
+ }
6049
+
6050
+ if (cell.collapsable === true) {
6051
+ bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(WebsyDesigns.Icons.Minus, "</i>");
6052
+ }
6053
+
6054
+ bodyHtml += "\n ".concat(cell.value, "\n </td>");
5936
6055
  });
5937
6056
  bodyHtml += "</tr>";
5938
6057
  }); // bodyHtml += `</div>`
@@ -5942,7 +6061,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
5942
6061
  }, {
5943
6062
  key: "buildHeaderHtml",
5944
6063
  value: function buildHeaderHtml() {
5945
- var _this34 = this;
6064
+ var _this35 = this;
5946
6065
 
5947
6066
  var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5948
6067
  var headerHtml = '';
@@ -5957,7 +6076,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
5957
6076
  }
5958
6077
 
5959
6078
  this.options.columns.forEach(function (row, rowIndex) {
5960
- if (useWidths === false && rowIndex !== _this34.options.columns.length - 1) {
6079
+ if (useWidths === false && rowIndex !== _this35.options.columns.length - 1) {
5961
6080
  // if we're calculating the size we only want to render the last row of column headers
5962
6081
  return;
5963
6082
  }
@@ -5971,18 +6090,18 @@ var WebsyTable3 = /*#__PURE__*/function () {
5971
6090
  // `
5972
6091
  // }
5973
6092
 
5974
- headerHtml += " \n >\n <div>\n ".concat(col.name, "\n ").concat(col.searchable === true ? _this34.buildSearchIcon(col, colIndex) : '', "\n </div>\n </td>");
6093
+ headerHtml += " \n >\n <div>\n ".concat(col.name, "\n ").concat(col.searchable === true ? _this35.buildSearchIcon(col, colIndex) : '', "\n </div>\n </td>");
5975
6094
  });
5976
6095
  headerHtml += "</tr>";
5977
6096
  });
5978
6097
  var dropdownEl = document.getElementById("".concat(this.elementId, "_dropdownContainer"));
5979
6098
  this.options.columns[this.options.columns.length - 1].forEach(function (c, i) {
5980
6099
  if (c.searchable && c.isExternalSearch === true) {
5981
- var testEl = document.getElementById("".concat(_this34.elementId, "_columnSearch_").concat(c.dimId || i));
6100
+ var testEl = document.getElementById("".concat(_this35.elementId, "_columnSearch_").concat(c.dimId || i));
5982
6101
 
5983
6102
  if (!testEl) {
5984
6103
  var newE = document.createElement('div');
5985
- newE.id = "".concat(_this34.elementId, "_columnSearch_").concat(c.dimId || i);
6104
+ newE.id = "".concat(_this35.elementId, "_columnSearch_").concat(c.dimId || i);
5986
6105
  newE.className = 'websy-modal-dropdown';
5987
6106
  dropdownEl.appendChild(newE);
5988
6107
  }
@@ -5998,7 +6117,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
5998
6117
  }, {
5999
6118
  key: "buildTotalHtml",
6000
6119
  value: function buildTotalHtml() {
6001
- var _this35 = this;
6120
+ var _this36 = this;
6002
6121
 
6003
6122
  var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
6004
6123
 
@@ -6011,7 +6130,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6011
6130
  totalHtml += "<td \n class='websy-table-cell'\n colspan='".concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
6012
6131
 
6013
6132
  if (useWidths === true) {
6014
- totalHtml += "\n style='width: ".concat(_this35.options.columns[_this35.options.columns.length - 1][colIndex].width || _this35.options.columns[_this35.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
6133
+ totalHtml += "\n style='width: ".concat(_this36.options.columns[_this36.options.columns.length - 1][colIndex].width || _this36.options.columns[_this36.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
6015
6134
  }
6016
6135
 
6017
6136
  totalHtml += " \n >\n ".concat(col.value, "\n </td>");
@@ -6022,7 +6141,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6022
6141
  }, {
6023
6142
  key: "calculateSizes",
6024
6143
  value: function calculateSizes() {
6025
- var _this36 = this;
6144
+ var _this37 = this;
6026
6145
 
6027
6146
  var sample = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
6028
6147
  var totalRowCount = arguments.length > 1 ? arguments[1] : undefined;
@@ -6064,28 +6183,28 @@ var WebsyTable3 = /*#__PURE__*/function () {
6064
6183
  rows.forEach(function (row, rowIndex) {
6065
6184
  Array.from(row.children).forEach(function (col, colIndex) {
6066
6185
  var colSize = col.getBoundingClientRect();
6067
- _this36.sizes.cellHeight = colSize.height;
6186
+ _this37.sizes.cellHeight = colSize.height;
6068
6187
 
6069
- if (_this36.options.columns[_this36.options.columns.length - 1][colIndex]) {
6070
- if (!_this36.options.columns[_this36.options.columns.length - 1][colIndex].actualWidth) {
6071
- _this36.options.columns[_this36.options.columns.length - 1][colIndex].actualWidth = 0;
6188
+ if (_this37.options.columns[_this37.options.columns.length - 1][colIndex]) {
6189
+ if (!_this37.options.columns[_this37.options.columns.length - 1][colIndex].actualWidth) {
6190
+ _this37.options.columns[_this37.options.columns.length - 1][colIndex].actualWidth = 0;
6072
6191
  }
6073
6192
 
6074
- _this36.options.columns[_this36.options.columns.length - 1][colIndex].actualWidth = Math.min(Math.max(_this36.options.columns[_this36.options.columns.length - 1][colIndex].actualWidth, colSize.width), maxWidth);
6075
- _this36.options.columns[_this36.options.columns.length - 1][colIndex].cellHeight = colSize.height;
6193
+ _this37.options.columns[_this37.options.columns.length - 1][colIndex].actualWidth = Math.min(Math.max(_this37.options.columns[_this37.options.columns.length - 1][colIndex].actualWidth, colSize.width), maxWidth);
6194
+ _this37.options.columns[_this37.options.columns.length - 1][colIndex].cellHeight = colSize.height;
6076
6195
  }
6077
6196
  });
6078
6197
  });
6079
6198
  this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
6080
- if (colIndex < _this36.pinnedColumns) {
6081
- _this36.sizes.scrollableWidth -= col.actualWidth;
6199
+ if (colIndex < _this37.pinnedColumns) {
6200
+ _this37.sizes.scrollableWidth -= col.actualWidth;
6082
6201
  }
6083
6202
  });
6084
6203
  this.sizes.totalWidth = this.options.columns[this.options.columns.length - 1].reduce(function (a, b) {
6085
6204
  return a + (b.width || b.actualWidth);
6086
6205
  }, 0);
6087
6206
  this.sizes.totalNonPinnedWidth = this.options.columns[this.options.columns.length - 1].filter(function (c, i) {
6088
- return i >= _this36.pinnedColumns;
6207
+ return i >= _this37.pinnedColumns;
6089
6208
  }).reduce(function (a, b) {
6090
6209
  return a + (b.width || b.actualWidth);
6091
6210
  }, 0);
@@ -6103,13 +6222,13 @@ var WebsyTable3 = /*#__PURE__*/function () {
6103
6222
  }
6104
6223
  }
6105
6224
 
6106
- _this36.sizes.totalWidth += c.width || c.actualWidth;
6225
+ _this37.sizes.totalWidth += c.width || c.actualWidth;
6107
6226
 
6108
- if (i < _this36.pinnedColumns) {
6109
- _this36.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
6227
+ if (i < _this37.pinnedColumns) {
6228
+ _this37.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
6110
6229
  }
6111
6230
 
6112
- equalWidth = (outerSize.width - _this36.sizes.totalWidth) / (_this36.options.columns[_this36.options.columns.length - 1].length - (i + 1));
6231
+ equalWidth = (outerSize.width - _this37.sizes.totalWidth) / (_this37.options.columns[_this37.options.columns.length - 1].length - (i + 1));
6113
6232
  });
6114
6233
  } // take the height of the last cell as the official height for data cells
6115
6234
  // this.sizes.dataCellHeight = this.options.columns[this.options.columns.length - 1].cellHeight
@@ -6178,14 +6297,30 @@ var WebsyTable3 = /*#__PURE__*/function () {
6178
6297
  }, {
6179
6298
  key: "handleClick",
6180
6299
  value: function handleClick(event) {
6300
+ var colIndex = +event.target.getAttribute('data-col-index');
6301
+ var rowIndex = +event.target.getAttribute('data-row-index');
6302
+
6181
6303
  if (event.target.classList.contains('websy-table-search-icon')) {
6182
6304
  console.log('clicked on search icon');
6183
- var colIndex = +event.target.getAttribute('data-col-index');
6184
6305
 
6185
6306
  if (this.options.columns[this.options.columns.length - 1][colIndex].onSearch) {
6186
6307
  this.options.columns[this.options.columns.length - 1][colIndex].onSearch(event, this.options.columns[this.options.columns.length - 1][colIndex]);
6187
6308
  }
6188
6309
  }
6310
+
6311
+ if (event.target.classList.contains('websy-table-cell-collapse')) {
6312
+ if (this.options.onCollapseCell) {
6313
+ this.options.onCollapseCell(event, +rowIndex, +colIndex);
6314
+ } else {// out of box function
6315
+ }
6316
+ }
6317
+
6318
+ if (event.target.classList.contains('websy-table-cell-expand')) {
6319
+ if (this.options.onExpandCell) {
6320
+ this.options.onExpandCell(event, +rowIndex, +colIndex);
6321
+ } else {// out of box function
6322
+ }
6323
+ }
6189
6324
  }
6190
6325
  }, {
6191
6326
  key: "handleMouseDown",
@@ -6538,7 +6673,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6538
6673
 
6539
6674
  var WebsyChart = /*#__PURE__*/function () {
6540
6675
  function WebsyChart(elementId, options) {
6541
- var _this37 = this;
6676
+ var _this38 = this;
6542
6677
 
6543
6678
  _classCallCheck(this, WebsyChart);
6544
6679
 
@@ -6587,22 +6722,22 @@ var WebsyChart = /*#__PURE__*/function () {
6587
6722
  this.invertOverride = function (input, input2) {
6588
6723
  var xAxis = 'bottomAxis';
6589
6724
 
6590
- if (_this37.options.orientation === 'horizontal') {
6725
+ if (_this38.options.orientation === 'horizontal') {
6591
6726
  xAxis = 'leftAxis';
6592
6727
  }
6593
6728
 
6594
- var width = _this37[xAxis].step();
6729
+ var width = _this38[xAxis].step();
6595
6730
 
6596
6731
  var output;
6597
6732
 
6598
- var domain = _toConsumableArray(_this37[xAxis].domain());
6733
+ var domain = _toConsumableArray(_this38[xAxis].domain());
6599
6734
 
6600
- if (_this37.options.orientation === 'horizontal') {
6735
+ if (_this38.options.orientation === 'horizontal') {
6601
6736
  domain = domain.reverse();
6602
6737
  }
6603
6738
 
6604
6739
  for (var j = 0; j < domain.length; j++) {
6605
- var breakA = _this37[xAxis](domain[j]) - width / 2;
6740
+ var breakA = _this38[xAxis](domain[j]) - width / 2;
6606
6741
  var breakB = breakA + width;
6607
6742
 
6608
6743
  if (input > breakA && input <= breakB) {
@@ -6702,10 +6837,10 @@ var WebsyChart = /*#__PURE__*/function () {
6702
6837
  }, {
6703
6838
  key: "handleEventMouseMove",
6704
6839
  value: function handleEventMouseMove(event, d) {
6705
- var _this38 = this;
6840
+ var _this39 = this;
6706
6841
 
6707
6842
  var bisectDate = d3.bisector(function (d) {
6708
- return _this38.parseX(d.x.value);
6843
+ return _this39.parseX(d.x.value);
6709
6844
  }).left;
6710
6845
 
6711
6846
  if (this.options.showTrackingLine === true && d3.pointer(event)) {
@@ -6744,8 +6879,8 @@ var WebsyChart = /*#__PURE__*/function () {
6744
6879
  }
6745
6880
 
6746
6881
  this.options.data.series.forEach(function (s) {
6747
- if (_this38.options.data[xData].scale !== 'Time') {
6748
- xPoint = _this38[xAxis](_this38.parseX(xLabel));
6882
+ if (_this39.options.data[xData].scale !== 'Time') {
6883
+ xPoint = _this39[xAxis](_this39.parseX(xLabel));
6749
6884
  s.data.forEach(function (d) {
6750
6885
  if (d.x.value === xLabel) {
6751
6886
  if (!tooltipTitle) {
@@ -6764,13 +6899,13 @@ var WebsyChart = /*#__PURE__*/function () {
6764
6899
  var pointA = s.data[index - 1];
6765
6900
  var pointB = s.data[index];
6766
6901
 
6767
- if (_this38.options.orientation === 'horizontal') {
6902
+ if (_this39.options.orientation === 'horizontal') {
6768
6903
  pointA = _toConsumableArray(s.data).reverse()[index - 1];
6769
6904
  pointB = _toConsumableArray(s.data).reverse()[index];
6770
6905
  }
6771
6906
 
6772
6907
  if (pointA && !pointB) {
6773
- xPoint = _this38[xAxis](_this38.parseX(pointA.x.value));
6908
+ xPoint = _this39[xAxis](_this39.parseX(pointA.x.value));
6774
6909
  tooltipTitle = pointA.x.value;
6775
6910
 
6776
6911
  if (!pointA.y.color) {
@@ -6780,12 +6915,12 @@ var WebsyChart = /*#__PURE__*/function () {
6780
6915
  tooltipData.push(pointA.y);
6781
6916
 
6782
6917
  if (typeof pointA.x.value.getTime !== 'undefined') {
6783
- tooltipTitle = d3.timeFormat(_this38.options.dateFormat || _this38.options.calculatedTimeFormatPattern)(pointA.x.value);
6918
+ tooltipTitle = d3.timeFormat(_this39.options.dateFormat || _this39.options.calculatedTimeFormatPattern)(pointA.x.value);
6784
6919
  }
6785
6920
  }
6786
6921
 
6787
6922
  if (pointB && !pointA) {
6788
- xPoint = _this38[xAxis](_this38.parseX(pointB.x.value));
6923
+ xPoint = _this39[xAxis](_this39.parseX(pointB.x.value));
6789
6924
  tooltipTitle = pointB.x.value;
6790
6925
 
6791
6926
  if (!pointB.y.color) {
@@ -6795,14 +6930,14 @@ var WebsyChart = /*#__PURE__*/function () {
6795
6930
  tooltipData.push(pointB.y);
6796
6931
 
6797
6932
  if (typeof pointB.x.value.getTime !== 'undefined') {
6798
- tooltipTitle = d3.timeFormat(_this38.options.dateFormat || _this38.options.calculatedTimeFormatPattern)(pointB.x.value);
6933
+ tooltipTitle = d3.timeFormat(_this39.options.dateFormat || _this39.options.calculatedTimeFormatPattern)(pointB.x.value);
6799
6934
  }
6800
6935
  }
6801
6936
 
6802
6937
  if (pointA && pointB) {
6803
- var d0 = _this38[xAxis](_this38.parseX(pointA.x.value));
6938
+ var d0 = _this39[xAxis](_this39.parseX(pointA.x.value));
6804
6939
 
6805
- var d1 = _this38[xAxis](_this38.parseX(pointB.x.value));
6940
+ var d1 = _this39[xAxis](_this39.parseX(pointB.x.value));
6806
6941
 
6807
6942
  var mid = Math.abs(d0 - d1) / 2;
6808
6943
 
@@ -6811,7 +6946,7 @@ var WebsyChart = /*#__PURE__*/function () {
6811
6946
  tooltipTitle = pointB.x.value;
6812
6947
 
6813
6948
  if (typeof pointB.x.value.getTime !== 'undefined') {
6814
- tooltipTitle = d3.timeFormat(_this38.options.dateFormat || _this38.options.calculatedTimeFormatPattern)(pointB.x.value);
6949
+ tooltipTitle = d3.timeFormat(_this39.options.dateFormat || _this39.options.calculatedTimeFormatPattern)(pointB.x.value);
6815
6950
  }
6816
6951
 
6817
6952
  if (!pointB.y.color) {
@@ -6824,7 +6959,7 @@ var WebsyChart = /*#__PURE__*/function () {
6824
6959
  tooltipTitle = pointA.x.value;
6825
6960
 
6826
6961
  if (typeof pointB.x.value.getTime !== 'undefined') {
6827
- tooltipTitle = d3.timeFormat(_this38.options.dateFormat || _this38.options.calculatedTimeFormatPattern)(pointB.x.value);
6962
+ tooltipTitle = d3.timeFormat(_this39.options.dateFormat || _this39.options.calculatedTimeFormatPattern)(pointB.x.value);
6828
6963
  }
6829
6964
 
6830
6965
  if (!pointA.y.color) {
@@ -6929,7 +7064,7 @@ var WebsyChart = /*#__PURE__*/function () {
6929
7064
  }, {
6930
7065
  key: "render",
6931
7066
  value: function render(options) {
6932
- var _this39 = this;
7067
+ var _this40 = this;
6933
7068
 
6934
7069
  /* global d3 options WebsyUtils */
6935
7070
  if (typeof options !== 'undefined') {
@@ -6998,7 +7133,7 @@ var WebsyChart = /*#__PURE__*/function () {
6998
7133
  var legendData = this.options.data.series.map(function (s, i) {
6999
7134
  return {
7000
7135
  value: s.label || s.key,
7001
- color: s.color || _this39.options.colors[i % _this39.options.colors.length]
7136
+ color: s.color || _this40.options.colors[i % _this40.options.colors.length]
7002
7137
  };
7003
7138
  });
7004
7139
 
@@ -7058,6 +7193,8 @@ var WebsyChart = /*#__PURE__*/function () {
7058
7193
 
7059
7194
  if (this.options.data.bottom.formatter) {
7060
7195
  this.longestBottom = this.options.data.bottom.formatter(this.options.data.bottom.max).toString();
7196
+ } else {
7197
+ this.longestBottom = '01/01/2000';
7061
7198
  }
7062
7199
  }
7063
7200
 
@@ -7250,7 +7387,7 @@ var WebsyChart = /*#__PURE__*/function () {
7250
7387
 
7251
7388
  if (this.options.data.bottom.formatter) {
7252
7389
  bAxisFunc.tickFormat(function (d) {
7253
- return _this39.options.data.bottom.formatter(d);
7390
+ return _this40.options.data.bottom.formatter(d);
7254
7391
  });
7255
7392
  }
7256
7393
 
@@ -7276,8 +7413,8 @@ var WebsyChart = /*#__PURE__*/function () {
7276
7413
 
7277
7414
  if (this.options.margin.axisLeft > 0) {
7278
7415
  this.leftAxisLayer.call(d3.axisLeft(this.leftAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
7279
- if (_this39.options.data.left.formatter) {
7280
- d = _this39.options.data.left.formatter(d);
7416
+ if (_this40.options.data.left.formatter) {
7417
+ d = _this40.options.data.left.formatter(d);
7281
7418
  }
7282
7419
 
7283
7420
  return d;
@@ -7314,8 +7451,8 @@ var WebsyChart = /*#__PURE__*/function () {
7314
7451
 
7315
7452
  if (this.options.margin.axisRight > 0 && (this.options.data.right.min !== 0 || this.options.data.right.max !== 0)) {
7316
7453
  this.rightAxisLayer.call(d3.axisRight(this.rightAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
7317
- if (_this39.options.data.right.formatter) {
7318
- d = _this39.options.data.right.formatter(d);
7454
+ if (_this40.options.data.right.formatter) {
7455
+ d = _this40.options.data.right.formatter(d);
7319
7456
  }
7320
7457
 
7321
7458
  return d;
@@ -7341,16 +7478,16 @@ var WebsyChart = /*#__PURE__*/function () {
7341
7478
 
7342
7479
  this.options.data.series.forEach(function (series, index) {
7343
7480
  if (!series.key) {
7344
- series.key = _this39.createIdentity();
7481
+ series.key = _this40.createIdentity();
7345
7482
  }
7346
7483
 
7347
7484
  if (!series.color) {
7348
- series.color = _this39.options.colors[index % _this39.options.colors.length];
7485
+ series.color = _this40.options.colors[index % _this40.options.colors.length];
7349
7486
  }
7350
7487
 
7351
- _this39["render".concat(series.type || 'bar')](series, index);
7488
+ _this40["render".concat(series.type || 'bar')](series, index);
7352
7489
 
7353
- _this39.renderLabels(series, index);
7490
+ _this40.renderLabels(series, index);
7354
7491
  });
7355
7492
  }
7356
7493
  }
@@ -7358,17 +7495,17 @@ var WebsyChart = /*#__PURE__*/function () {
7358
7495
  }, {
7359
7496
  key: "renderarea",
7360
7497
  value: function renderarea(series, index) {
7361
- var _this40 = this;
7498
+ var _this41 = this;
7362
7499
 
7363
7500
  /* global d3 series index */
7364
7501
  var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
7365
7502
  return d3.area().x(function (d) {
7366
- return _this40[xAxis](_this40.parseX(d.x.value));
7503
+ return _this41[xAxis](_this41.parseX(d.x.value));
7367
7504
  }).y0(function (d) {
7368
- return _this40[yAxis](0);
7505
+ return _this41[yAxis](0);
7369
7506
  }).y1(function (d) {
7370
- return _this40[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
7371
- }).curve(d3[curveStyle || _this40.options.curveStyle]);
7507
+ return _this41[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
7508
+ }).curve(d3[curveStyle || _this41.options.curveStyle]);
7372
7509
  };
7373
7510
 
7374
7511
  var xAxis = 'bottomAxis';
@@ -7484,7 +7621,7 @@ var WebsyChart = /*#__PURE__*/function () {
7484
7621
  }, {
7485
7622
  key: "renderLabels",
7486
7623
  value: function renderLabels(series, index) {
7487
- var _this41 = this;
7624
+ var _this42 = this;
7488
7625
 
7489
7626
  /* global series index d3 WebsyDesigns */
7490
7627
  var xAxis = 'bottomAxis';
@@ -7502,8 +7639,12 @@ var WebsyChart = /*#__PURE__*/function () {
7502
7639
  // We currently only support 'Auto'
7503
7640
  var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
7504
7641
  labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
7505
- labels.attr('x', getLabelX.bind(this)).attr('y', getLabelY.bind(this)).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
7506
- return _this41.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
7642
+ labels.attr('x', function (d) {
7643
+ return getLabelX.call(_this42, d, series.labelPosition);
7644
+ }).attr('y', function (d) {
7645
+ return getLabelY.call(_this42, d, series.labelPosition);
7646
+ }).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
7647
+ return _this42.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
7507
7648
  }).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
7508
7649
  return d.y.label || d.y.value;
7509
7650
  }).each(function (d, i) {
@@ -7527,8 +7668,12 @@ var WebsyChart = /*#__PURE__*/function () {
7527
7668
  }
7528
7669
  }
7529
7670
  });
7530
- labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', getLabelX.bind(this)).attr('y', getLabelY.bind(this)).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
7531
- return _this41.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
7671
+ labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', function (d) {
7672
+ return getLabelX.call(_this42, d, series.labelPosition);
7673
+ }).attr('y', function (d) {
7674
+ return getLabelY.call(_this42, d, series.labelPosition);
7675
+ }).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
7676
+ return _this42.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
7532
7677
  }).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).text(function (d) {
7533
7678
  return d.y.label || d.y.value;
7534
7679
  }).each(function (d, i) {
@@ -7585,15 +7730,15 @@ var WebsyChart = /*#__PURE__*/function () {
7585
7730
  }, {
7586
7731
  key: "renderline",
7587
7732
  value: function renderline(series, index) {
7588
- var _this42 = this;
7733
+ var _this43 = this;
7589
7734
 
7590
7735
  /* global series index d3 */
7591
7736
  var drawLine = function drawLine(xAxis, yAxis, curveStyle) {
7592
7737
  return d3.line().x(function (d) {
7593
- return _this42[xAxis](_this42.parseX(d.x.value));
7738
+ return _this43[xAxis](_this43.parseX(d.x.value));
7594
7739
  }).y(function (d) {
7595
- return _this42[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
7596
- }).curve(d3[curveStyle || _this42.options.curveStyle]);
7740
+ return _this43[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
7741
+ }).curve(d3[curveStyle || _this43.options.curveStyle]);
7597
7742
  };
7598
7743
 
7599
7744
  var xAxis = 'bottomAxis';
@@ -7631,14 +7776,14 @@ var WebsyChart = /*#__PURE__*/function () {
7631
7776
  }, {
7632
7777
  key: "rendersymbol",
7633
7778
  value: function rendersymbol(series, index) {
7634
- var _this43 = this;
7779
+ var _this44 = this;
7635
7780
 
7636
7781
  /* global d3 series index series.key */
7637
7782
  var drawSymbol = function drawSymbol(size) {
7638
7783
  return d3.symbol() // .type(d => {
7639
7784
  // return d3.symbols[0]
7640
7785
  // })
7641
- .size(size || _this43.options.symbolSize);
7786
+ .size(size || _this44.options.symbolSize);
7642
7787
  };
7643
7788
 
7644
7789
  var xAxis = 'bottomAxis';
@@ -7656,7 +7801,7 @@ var WebsyChart = /*#__PURE__*/function () {
7656
7801
  symbols.attr('d', function (d) {
7657
7802
  return drawSymbol(d.y.size || series.symbolSize)(d);
7658
7803
  }).transition(this.transition).attr('fill', 'white').attr('stroke', series.color).attr('transform', function (d) {
7659
- return "translate(".concat(_this43[xAxis](_this43.parseX(d.x.value)), ", ").concat(_this43[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
7804
+ return "translate(".concat(_this44[xAxis](_this44.parseX(d.x.value)), ", ").concat(_this44[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
7660
7805
  }); // Enter
7661
7806
 
7662
7807
  symbols.enter().append('path').attr('d', function (d) {
@@ -7665,7 +7810,7 @@ var WebsyChart = /*#__PURE__*/function () {
7665
7810
  .attr('fill', 'white').attr('stroke', series.color).attr('class', function (d) {
7666
7811
  return "symbol symbol_".concat(series.key);
7667
7812
  }).attr('transform', function (d) {
7668
- return "translate(".concat(_this43[xAxis](_this43.parseX(d.x.value)), ", ").concat(_this43[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
7813
+ return "translate(".concat(_this44[xAxis](_this44.parseX(d.x.value)), ", ").concat(_this44[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
7669
7814
  });
7670
7815
  }
7671
7816
  }, {
@@ -7820,7 +7965,7 @@ var WebsyLegend = /*#__PURE__*/function () {
7820
7965
  }, {
7821
7966
  key: "resize",
7822
7967
  value: function resize() {
7823
- var _this44 = this;
7968
+ var _this45 = this;
7824
7969
 
7825
7970
  var el = document.getElementById(this.elementId);
7826
7971
 
@@ -7833,7 +7978,7 @@ var WebsyLegend = /*#__PURE__*/function () {
7833
7978
  // }
7834
7979
  var html = "\n <div class='text-".concat(this.options.align, "'>\n ");
7835
7980
  html += this._data.map(function (d, i) {
7836
- return _this44.getLegendItemHTML(d);
7981
+ return _this45.getLegendItemHTML(d);
7837
7982
  }).join('');
7838
7983
  html += "\n <div>\n ";
7839
7984
  el.innerHTML = html;
@@ -8005,7 +8150,7 @@ var WebsyMap = /*#__PURE__*/function () {
8005
8150
  }, {
8006
8151
  key: "render",
8007
8152
  value: function render() {
8008
- var _this45 = this;
8153
+ var _this46 = this;
8009
8154
 
8010
8155
  var mapEl = document.getElementById("".concat(this.elementId, "_map"));
8011
8156
  var legendEl = document.getElementById("".concat(this.elementId, "_map"));
@@ -8014,7 +8159,7 @@ var WebsyMap = /*#__PURE__*/function () {
8014
8159
  var legendData = this.options.data.polygons.map(function (s, i) {
8015
8160
  return {
8016
8161
  value: s.label || s.key,
8017
- color: s.color || _this45.options.colors[i % _this45.options.colors.length]
8162
+ color: s.color || _this46.options.colors[i % _this46.options.colors.length]
8018
8163
  };
8019
8164
  });
8020
8165
  var longestValue = legendData.map(function (s) {
@@ -8078,7 +8223,7 @@ var WebsyMap = /*#__PURE__*/function () {
8078
8223
 
8079
8224
  if (this.polygons) {
8080
8225
  this.polygons.forEach(function (p) {
8081
- return _this45.map.removeLayer(p);
8226
+ return _this46.map.removeLayer(p);
8082
8227
  });
8083
8228
  }
8084
8229
 
@@ -8136,18 +8281,18 @@ var WebsyMap = /*#__PURE__*/function () {
8136
8281
  }
8137
8282
 
8138
8283
  if (!p.options.color) {
8139
- p.options.color = _this45.options.colors[i % _this45.options.colors.length];
8284
+ p.options.color = _this46.options.colors[i % _this46.options.colors.length];
8140
8285
  }
8141
8286
 
8142
8287
  var pol = L.polygon(p.data.map(function (c) {
8143
8288
  return c.map(function (d) {
8144
8289
  return [d.Latitude, d.Longitude];
8145
8290
  });
8146
- }), p.options).addTo(_this45.map);
8291
+ }), p.options).addTo(_this46.map);
8147
8292
 
8148
- _this45.polygons.push(pol);
8293
+ _this46.polygons.push(pol);
8149
8294
 
8150
- _this45.map.fitBounds(pol.getBounds());
8295
+ _this46.map.fitBounds(pol.getBounds());
8151
8296
  });
8152
8297
  } // if (this.data.markers.length > 0) {
8153
8298
  // el.classList.remove('hidden')