@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.
- package/dist/server/helpers/v1/pgHelper.js +9 -3
- package/dist/websy-designs-es6.debug.js +275 -65
- package/dist/websy-designs-es6.js +356 -211
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +294 -67
- package/dist/websy-designs.js +379 -216
- package/dist/websy-designs.min.css +1 -1
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
package/dist/websy-designs.js
CHANGED
|
@@ -1484,9 +1484,9 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1484
1484
|
showCompleteSelectedList: false,
|
|
1485
1485
|
closeAfterSelection: true,
|
|
1486
1486
|
customActions: [],
|
|
1487
|
-
searchIcon: "<svg
|
|
1488
|
-
clearIcon: "<svg
|
|
1489
|
-
arrowIcon: "<svg
|
|
1487
|
+
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>",
|
|
1488
|
+
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>",
|
|
1489
|
+
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>",
|
|
1490
1490
|
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>"
|
|
1491
1491
|
};
|
|
1492
1492
|
this.options = _extends({}, DEFAULTS, options);
|
|
@@ -1521,10 +1521,16 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1521
1521
|
var headerValue = this.selectedItems.map(function (s) {
|
|
1522
1522
|
return _this10.options.items[s].value || _this10.options.items[s].label;
|
|
1523
1523
|
}).join(this.options.multiValueDelimiter);
|
|
1524
|
-
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
|
|
1524
|
+
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 ");
|
|
1525
|
+
|
|
1526
|
+
if (this.options.disableSearch !== true) {
|
|
1527
|
+
html += "<div class='search'>".concat(this.options.searchIcon, "</div>");
|
|
1528
|
+
}
|
|
1529
|
+
|
|
1530
|
+
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 ");
|
|
1525
1531
|
|
|
1526
1532
|
if (this.options.allowClear === true) {
|
|
1527
|
-
html += this.options.clearIcon;
|
|
1533
|
+
html += "<div class='clear'>".concat(this.options.clearIcon, "</div>");
|
|
1528
1534
|
}
|
|
1529
1535
|
|
|
1530
1536
|
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 ");
|
|
@@ -2587,8 +2593,17 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2587
2593
|
|
|
2588
2594
|
var WebsyIcons = {
|
|
2589
2595
|
'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 ",
|
|
2590
|
-
'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\"
|
|
2591
|
-
'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 "
|
|
2596
|
+
'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 ",
|
|
2597
|
+
'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 ",
|
|
2598
|
+
'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 ",
|
|
2599
|
+
'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 ",
|
|
2600
|
+
'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 ",
|
|
2601
|
+
'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 ",
|
|
2602
|
+
'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 ",
|
|
2603
|
+
'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 ",
|
|
2604
|
+
'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 ",
|
|
2605
|
+
'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 ",
|
|
2606
|
+
'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 "
|
|
2592
2607
|
};
|
|
2593
2608
|
|
|
2594
2609
|
var WebsyLoadingDialog = /*#__PURE__*/function () {
|
|
@@ -2719,7 +2734,7 @@ var WebsyLogin = /*#__PURE__*/function () {
|
|
|
2719
2734
|
|
|
2720
2735
|
return WebsyLogin;
|
|
2721
2736
|
}();
|
|
2722
|
-
/* global */
|
|
2737
|
+
/* global WebsyDesigns */
|
|
2723
2738
|
|
|
2724
2739
|
|
|
2725
2740
|
var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
@@ -2731,7 +2746,11 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2731
2746
|
orientation: 'horizontal',
|
|
2732
2747
|
parentMap: {},
|
|
2733
2748
|
childIndentation: 10,
|
|
2734
|
-
activeSymbol: 'none'
|
|
2749
|
+
activeSymbol: 'none',
|
|
2750
|
+
enableSearch: false,
|
|
2751
|
+
searchProp: 'text',
|
|
2752
|
+
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>",
|
|
2753
|
+
searchOptions: {}
|
|
2735
2754
|
}, options);
|
|
2736
2755
|
|
|
2737
2756
|
if (!elementId) {
|
|
@@ -2739,6 +2758,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2739
2758
|
return;
|
|
2740
2759
|
}
|
|
2741
2760
|
|
|
2761
|
+
this.maxLevel = 0;
|
|
2742
2762
|
var el = document.getElementById(elementId);
|
|
2743
2763
|
|
|
2744
2764
|
if (el) {
|
|
@@ -2747,7 +2767,6 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2747
2767
|
this.flatItems = [];
|
|
2748
2768
|
this.itemMap = {};
|
|
2749
2769
|
this.flattenItems(0, this.options.items);
|
|
2750
|
-
console.log(this.flatItems);
|
|
2751
2770
|
el.classList.add("websy-".concat(this.options.orientation, "-list-container"));
|
|
2752
2771
|
el.classList.add('websy-menu');
|
|
2753
2772
|
|
|
@@ -2774,25 +2793,28 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2774
2793
|
key: "flattenItems",
|
|
2775
2794
|
value: function flattenItems(index, items) {
|
|
2776
2795
|
var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
2796
|
+
var path = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
2777
2797
|
|
|
2778
2798
|
if (items[index]) {
|
|
2779
2799
|
this.lowestLevel = Math.max(level, this.lowestLevel);
|
|
2780
2800
|
items[index].id = items[index].id || "".concat(this.elementId, "_").concat(this.normaliseString(items[index].text));
|
|
2781
|
-
this.itemMap[items[index].id] = items[index];
|
|
2782
2801
|
items[index].level = level;
|
|
2802
|
+
items[index].hasChildren = items[index].items && items[index].items.length > 0;
|
|
2803
|
+
items[index].path = path !== '' ? "".concat(path, "::").concat(items[index].id) : items[index].id;
|
|
2804
|
+
this.itemMap[items[index].id] = _extends({}, items[index]);
|
|
2783
2805
|
this.flatItems.push(items[index]);
|
|
2784
2806
|
|
|
2785
2807
|
if (items[index].items) {
|
|
2786
|
-
this.flattenItems(0, items[index].items, level + 1);
|
|
2808
|
+
this.flattenItems(0, items[index].items, level + 1, items[index].path);
|
|
2787
2809
|
}
|
|
2788
2810
|
|
|
2789
|
-
this.flattenItems(++index, items, level);
|
|
2811
|
+
this.flattenItems(++index, items, level, path);
|
|
2790
2812
|
}
|
|
2791
2813
|
}
|
|
2792
2814
|
}, {
|
|
2793
2815
|
key: "handleClick",
|
|
2794
2816
|
value: function handleClick(event) {
|
|
2795
|
-
if (event.target.classList.contains('websy-menu-icon')
|
|
2817
|
+
if (event.target.classList.contains('websy-menu-icon')) {
|
|
2796
2818
|
this.toggleMobileMenu();
|
|
2797
2819
|
}
|
|
2798
2820
|
|
|
@@ -2803,7 +2825,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2803
2825
|
this.toggleMobileMenu('remove');
|
|
2804
2826
|
}
|
|
2805
2827
|
|
|
2806
|
-
if (item.
|
|
2828
|
+
if (item.hasChildren === true) {
|
|
2807
2829
|
event.target.classList.toggle('menu-open');
|
|
2808
2830
|
this.toggleMenu(item.id);
|
|
2809
2831
|
}
|
|
@@ -2813,6 +2835,60 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2813
2835
|
this.toggleMobileMenu();
|
|
2814
2836
|
}
|
|
2815
2837
|
}
|
|
2838
|
+
}, {
|
|
2839
|
+
key: "handleSearch",
|
|
2840
|
+
value: function handleSearch(searchText) {
|
|
2841
|
+
var _this18 = this;
|
|
2842
|
+
|
|
2843
|
+
var el = document.getElementById(this.elementId);
|
|
2844
|
+
var lowestItems = this.flatItems.filter(function (d) {
|
|
2845
|
+
return d.level === _this18.maxLevel;
|
|
2846
|
+
});
|
|
2847
|
+
var visibleItems = lowestItems;
|
|
2848
|
+
var defaultMethod = 'remove';
|
|
2849
|
+
|
|
2850
|
+
if (searchText.length > 1) {
|
|
2851
|
+
defaultMethod = 'add';
|
|
2852
|
+
visibleItems = lowestItems.filter(function (d) {
|
|
2853
|
+
return d[_this18.options.searchProp].toLowerCase().indexOf(searchText.toLowerCase()) !== -1;
|
|
2854
|
+
});
|
|
2855
|
+
} // hide everything
|
|
2856
|
+
|
|
2857
|
+
|
|
2858
|
+
var textEls = el.querySelectorAll("div.websy-menu-header");
|
|
2859
|
+
|
|
2860
|
+
for (var t = 0; t < textEls.length; t++) {
|
|
2861
|
+
textEls[t].classList[defaultMethod]('websy-hidden');
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
var listEls = el.querySelectorAll("ul.websy-child-list");
|
|
2865
|
+
|
|
2866
|
+
for (var l = 0; l < listEls.length; l++) {
|
|
2867
|
+
listEls[l].classList.add('websy-menu-collapsed');
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
if (searchText.length > 1) {
|
|
2871
|
+
visibleItems.forEach(function (d) {
|
|
2872
|
+
// show the item and open the list
|
|
2873
|
+
var pathParts = d.path.split('::');
|
|
2874
|
+
pathParts.forEach(function (p) {
|
|
2875
|
+
var textEl = document.getElementById(p);
|
|
2876
|
+
|
|
2877
|
+
if (textEl) {
|
|
2878
|
+
textEl.classList.remove('websy-hidden');
|
|
2879
|
+
}
|
|
2880
|
+
|
|
2881
|
+
var listEl = document.getElementById("".concat(p, "_list"));
|
|
2882
|
+
|
|
2883
|
+
if (listEl) {
|
|
2884
|
+
listEl.classList.remove('websy-menu-collapsed');
|
|
2885
|
+
}
|
|
2886
|
+
});
|
|
2887
|
+
});
|
|
2888
|
+
}
|
|
2889
|
+
|
|
2890
|
+
console.log('visibleItems', visibleItems);
|
|
2891
|
+
}
|
|
2816
2892
|
}, {
|
|
2817
2893
|
key: "normaliseString",
|
|
2818
2894
|
value: function normaliseString(text) {
|
|
@@ -2827,7 +2903,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2827
2903
|
var html = "";
|
|
2828
2904
|
|
|
2829
2905
|
if (this.options.collapsible === true) {
|
|
2830
|
-
html += "\n <div id='".concat(this.elementId, "_menuIcon' class='websy-menu-icon'>\n
|
|
2906
|
+
html += "\n <div id='".concat(this.elementId, "_menuIcon' class='websy-menu-icon'>\n ").concat(this.options.menuIcon, "\n </div>\n ");
|
|
2831
2907
|
}
|
|
2832
2908
|
|
|
2833
2909
|
if (this.options.logo) {
|
|
@@ -2838,16 +2914,27 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2838
2914
|
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 ");
|
|
2839
2915
|
}
|
|
2840
2916
|
|
|
2841
|
-
|
|
2917
|
+
if (this.options.enableSearch === true) {
|
|
2918
|
+
html += "\n <div id='".concat(this.elementId, "_search' class='websy-menu-search'></div>\n ");
|
|
2919
|
+
}
|
|
2920
|
+
|
|
2921
|
+
html += this.renderBlock(this.elementId, this.elementId, this.options.items, 'main', 0);
|
|
2842
2922
|
html += "</div>";
|
|
2843
2923
|
el.innerHTML = html;
|
|
2924
|
+
|
|
2925
|
+
if (this.options.enableSearch === true) {
|
|
2926
|
+
this.search = new WebsyDesigns.Search("".concat(this.elementId, "_search"), _extends({}, {
|
|
2927
|
+
onSearch: this.handleSearch.bind(this)
|
|
2928
|
+
}, this.options.searchOptions));
|
|
2929
|
+
}
|
|
2844
2930
|
}
|
|
2845
2931
|
}
|
|
2846
2932
|
}, {
|
|
2847
2933
|
key: "renderBlock",
|
|
2848
|
-
value: function renderBlock(items, block) {
|
|
2849
|
-
var level = arguments.length >
|
|
2850
|
-
|
|
2934
|
+
value: function renderBlock(id, path, items, block) {
|
|
2935
|
+
var level = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;
|
|
2936
|
+
this.maxLevel = Math.max(this.maxLevel, level);
|
|
2937
|
+
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 ");
|
|
2851
2938
|
|
|
2852
2939
|
if (block !== 'main') {
|
|
2853
2940
|
html += " data-collapsed='".concat(block !== 'main' ? 'true' : 'false', "'");
|
|
@@ -2867,7 +2954,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2867
2954
|
items[i].classes = items[i].classes.join(' ');
|
|
2868
2955
|
}
|
|
2869
2956
|
|
|
2870
|
-
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
|
|
2957
|
+
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 ");
|
|
2871
2958
|
|
|
2872
2959
|
if (this.options.orientation === 'horizontal') {
|
|
2873
2960
|
html += items[i].text;
|
|
@@ -2883,8 +2970,9 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2883
2970
|
|
|
2884
2971
|
html += " \n <span class='".concat(items[i].items && items[i].items.length > 0 ? 'menu-carat' : '', "'></span>\n ");
|
|
2885
2972
|
|
|
2886
|
-
if (this.options.orientation === 'vertical') {
|
|
2887
|
-
|
|
2973
|
+
if (this.options.orientation === 'vertical') {// html += `
|
|
2974
|
+
//
|
|
2975
|
+
// `
|
|
2888
2976
|
}
|
|
2889
2977
|
|
|
2890
2978
|
if (items[i].isLink === true && items[i].href) {
|
|
@@ -2894,7 +2982,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2894
2982
|
html += " \n\t\t\t\t</div>\n\t\t ";
|
|
2895
2983
|
|
|
2896
2984
|
if (items[i].items) {
|
|
2897
|
-
html += this.renderBlock(items[i].items, currentBlock, items[i].level + 1);
|
|
2985
|
+
html += this.renderBlock(blockId, items[i].path, items[i].items, currentBlock, items[i].level + 1);
|
|
2898
2986
|
} // map the item to it's parent
|
|
2899
2987
|
|
|
2900
2988
|
|
|
@@ -2913,7 +3001,8 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2913
3001
|
}, {
|
|
2914
3002
|
key: "toggleMenu",
|
|
2915
3003
|
value: function toggleMenu(id) {
|
|
2916
|
-
var el = document.getElementById("".concat(id, "_list"));
|
|
3004
|
+
var el = document.getElementById("".concat(id, "_list")); // const menuId = el.getAttribute('data-menu-id')
|
|
3005
|
+
// const menuEl = document.getElementById(menuId)
|
|
2917
3006
|
|
|
2918
3007
|
if (el) {
|
|
2919
3008
|
el.classList.toggle('websy-menu-collapsed');
|
|
@@ -2945,7 +3034,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2945
3034
|
|
|
2946
3035
|
var Pager = /*#__PURE__*/function () {
|
|
2947
3036
|
function Pager(elementId, options) {
|
|
2948
|
-
var
|
|
3037
|
+
var _this19 = this;
|
|
2949
3038
|
|
|
2950
3039
|
_classCallCheck(this, Pager);
|
|
2951
3040
|
|
|
@@ -2998,8 +3087,8 @@ var Pager = /*#__PURE__*/function () {
|
|
|
2998
3087
|
allowClear: false,
|
|
2999
3088
|
disableSearch: true,
|
|
3000
3089
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
3001
|
-
if (
|
|
3002
|
-
|
|
3090
|
+
if (_this19.options.onChangePageSize) {
|
|
3091
|
+
_this19.options.onChangePageSize(selectedItem.value);
|
|
3003
3092
|
}
|
|
3004
3093
|
}
|
|
3005
3094
|
});
|
|
@@ -3023,13 +3112,13 @@ var Pager = /*#__PURE__*/function () {
|
|
|
3023
3112
|
}, {
|
|
3024
3113
|
key: "render",
|
|
3025
3114
|
value: function render() {
|
|
3026
|
-
var
|
|
3115
|
+
var _this20 = this;
|
|
3027
3116
|
|
|
3028
3117
|
var el = document.getElementById("".concat(this.elementId, "_pageList"));
|
|
3029
3118
|
|
|
3030
3119
|
if (el) {
|
|
3031
3120
|
var pages = this.options.pages.map(function (item, index) {
|
|
3032
|
-
return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
3121
|
+
return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(_this20.options.activePage === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
3033
3122
|
});
|
|
3034
3123
|
var startIndex = 0;
|
|
3035
3124
|
|
|
@@ -3097,58 +3186,58 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
3097
3186
|
_createClass(WebsyPDFButton, [{
|
|
3098
3187
|
key: "handleClick",
|
|
3099
3188
|
value: function handleClick(event) {
|
|
3100
|
-
var
|
|
3189
|
+
var _this21 = this;
|
|
3101
3190
|
|
|
3102
3191
|
if (event.target.classList.contains('websy-pdf-button')) {
|
|
3103
3192
|
this.loader.show();
|
|
3104
3193
|
setTimeout(function () {
|
|
3105
|
-
if (
|
|
3106
|
-
var el = document.getElementById(
|
|
3194
|
+
if (_this21.options.targetId) {
|
|
3195
|
+
var el = document.getElementById(_this21.options.targetId);
|
|
3107
3196
|
|
|
3108
3197
|
if (el) {
|
|
3109
3198
|
var pdfData = {
|
|
3110
3199
|
options: {}
|
|
3111
3200
|
};
|
|
3112
3201
|
|
|
3113
|
-
if (
|
|
3114
|
-
pdfData.options = _extends({},
|
|
3202
|
+
if (_this21.options.pdfOptions) {
|
|
3203
|
+
pdfData.options = _extends({}, _this21.options.pdfOptions);
|
|
3115
3204
|
}
|
|
3116
3205
|
|
|
3117
|
-
if (
|
|
3118
|
-
if (
|
|
3119
|
-
var headerEl = document.getElementById(
|
|
3206
|
+
if (_this21.options.header) {
|
|
3207
|
+
if (_this21.options.header.elementId) {
|
|
3208
|
+
var headerEl = document.getElementById(_this21.options.header.elementId);
|
|
3120
3209
|
|
|
3121
3210
|
if (headerEl) {
|
|
3122
3211
|
pdfData.header = headerEl.outerHTML;
|
|
3123
3212
|
|
|
3124
|
-
if (
|
|
3125
|
-
pdfData.options.headerCSS =
|
|
3213
|
+
if (_this21.options.header.css) {
|
|
3214
|
+
pdfData.options.headerCSS = _this21.options.header.css;
|
|
3126
3215
|
}
|
|
3127
3216
|
}
|
|
3128
|
-
} else if (
|
|
3129
|
-
pdfData.header =
|
|
3217
|
+
} else if (_this21.options.header.html) {
|
|
3218
|
+
pdfData.header = _this21.options.header.html;
|
|
3130
3219
|
|
|
3131
|
-
if (
|
|
3132
|
-
pdfData.options.headerCSS =
|
|
3220
|
+
if (_this21.options.header.css) {
|
|
3221
|
+
pdfData.options.headerCSS = _this21.options.header.css;
|
|
3133
3222
|
}
|
|
3134
3223
|
} else {
|
|
3135
|
-
pdfData.header =
|
|
3224
|
+
pdfData.header = _this21.options.header;
|
|
3136
3225
|
}
|
|
3137
3226
|
}
|
|
3138
3227
|
|
|
3139
|
-
if (
|
|
3140
|
-
if (
|
|
3141
|
-
var footerEl = document.getElementById(
|
|
3228
|
+
if (_this21.options.footer) {
|
|
3229
|
+
if (_this21.options.footer.elementId) {
|
|
3230
|
+
var footerEl = document.getElementById(_this21.options.footer.elementId);
|
|
3142
3231
|
|
|
3143
3232
|
if (footerEl) {
|
|
3144
3233
|
pdfData.footer = footerEl.outerHTML;
|
|
3145
3234
|
|
|
3146
|
-
if (
|
|
3147
|
-
pdfData.options.footerCSS =
|
|
3235
|
+
if (_this21.options.footer.css) {
|
|
3236
|
+
pdfData.options.footerCSS = _this21.options.footer.css;
|
|
3148
3237
|
}
|
|
3149
3238
|
}
|
|
3150
3239
|
} else {
|
|
3151
|
-
pdfData.footer =
|
|
3240
|
+
pdfData.footer = _this21.options.footer;
|
|
3152
3241
|
}
|
|
3153
3242
|
}
|
|
3154
3243
|
|
|
@@ -3157,31 +3246,31 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
3157
3246
|
// document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
|
|
3158
3247
|
// document.getElementById(`${this.elementId}_form`).submit()
|
|
3159
3248
|
|
|
3160
|
-
|
|
3249
|
+
_this21.service.add('', pdfData, {
|
|
3161
3250
|
responseType: 'blob'
|
|
3162
3251
|
}).then(function (response) {
|
|
3163
|
-
|
|
3252
|
+
_this21.loader.hide();
|
|
3164
3253
|
|
|
3165
3254
|
var blob = new Blob([response], {
|
|
3166
3255
|
type: 'application/pdf'
|
|
3167
3256
|
});
|
|
3168
3257
|
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 ");
|
|
3169
3258
|
|
|
3170
|
-
if (
|
|
3259
|
+
if (_this21.options.directDownload === true) {
|
|
3171
3260
|
var fileName;
|
|
3172
3261
|
|
|
3173
|
-
if (typeof
|
|
3174
|
-
fileName =
|
|
3262
|
+
if (typeof _this21.options.fileName === 'function') {
|
|
3263
|
+
fileName = _this21.options.fileName() || 'Export';
|
|
3175
3264
|
} else {
|
|
3176
|
-
fileName =
|
|
3265
|
+
fileName = _this21.options.fileName || 'Export';
|
|
3177
3266
|
}
|
|
3178
3267
|
|
|
3179
3268
|
msg += "download='".concat(fileName, ".pdf'");
|
|
3180
3269
|
}
|
|
3181
3270
|
|
|
3182
|
-
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(
|
|
3271
|
+
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this21.options.buttonText, "</button>\n </a>\n </div>\n ");
|
|
3183
3272
|
|
|
3184
|
-
|
|
3273
|
+
_this21.popup.show({
|
|
3185
3274
|
message: msg,
|
|
3186
3275
|
mask: true
|
|
3187
3276
|
});
|
|
@@ -3382,7 +3471,7 @@ var WebsyPubSub = /*#__PURE__*/function () {
|
|
|
3382
3471
|
|
|
3383
3472
|
var ResponsiveText = /*#__PURE__*/function () {
|
|
3384
3473
|
function ResponsiveText(elementId, options) {
|
|
3385
|
-
var
|
|
3474
|
+
var _this22 = this;
|
|
3386
3475
|
|
|
3387
3476
|
_classCallCheck(this, ResponsiveText);
|
|
3388
3477
|
|
|
@@ -3395,7 +3484,7 @@ var ResponsiveText = /*#__PURE__*/function () {
|
|
|
3395
3484
|
this.elementId = elementId;
|
|
3396
3485
|
this.canvas = document.createElement('canvas');
|
|
3397
3486
|
window.addEventListener('resize', function () {
|
|
3398
|
-
return
|
|
3487
|
+
return _this22.render();
|
|
3399
3488
|
});
|
|
3400
3489
|
var el = document.getElementById(this.elementId);
|
|
3401
3490
|
|
|
@@ -3614,7 +3703,7 @@ var ResponsiveText = /*#__PURE__*/function () {
|
|
|
3614
3703
|
|
|
3615
3704
|
var WebsyResultList = /*#__PURE__*/function () {
|
|
3616
3705
|
function WebsyResultList(elementId, options) {
|
|
3617
|
-
var
|
|
3706
|
+
var _this23 = this;
|
|
3618
3707
|
|
|
3619
3708
|
_classCallCheck(this, WebsyResultList);
|
|
3620
3709
|
|
|
@@ -3643,9 +3732,9 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3643
3732
|
|
|
3644
3733
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
3645
3734
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
3646
|
-
|
|
3735
|
+
_this23.options.template = templateString;
|
|
3647
3736
|
|
|
3648
|
-
|
|
3737
|
+
_this23.render();
|
|
3649
3738
|
});
|
|
3650
3739
|
} else {
|
|
3651
3740
|
this.render();
|
|
@@ -3665,7 +3754,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3665
3754
|
}, {
|
|
3666
3755
|
key: "buildHTML",
|
|
3667
3756
|
value: function buildHTML(d) {
|
|
3668
|
-
var
|
|
3757
|
+
var _this24 = this;
|
|
3669
3758
|
|
|
3670
3759
|
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
3671
3760
|
var inputTemplate = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -3675,7 +3764,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3675
3764
|
if (this.options.template) {
|
|
3676
3765
|
if (d.length > 0) {
|
|
3677
3766
|
d.forEach(function (row, ix) {
|
|
3678
|
-
var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate ||
|
|
3767
|
+
var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate || _this24.options.template).concat(ix < d.length - 1 ? '<!--' : ''); // find conditional elements
|
|
3679
3768
|
|
|
3680
3769
|
var ifMatches = _toConsumableArray(template.matchAll(/<\s*if[^>]*>([\s\S]*?)<\s*\/\s*if>/g));
|
|
3681
3770
|
|
|
@@ -3780,7 +3869,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3780
3869
|
parts.forEach(function (p) {
|
|
3781
3870
|
items = items[p];
|
|
3782
3871
|
});
|
|
3783
|
-
template = template.replace(m[0],
|
|
3872
|
+
template = template.replace(m[0], _this24.buildHTML(items, 0, withoutFor, [].concat(_toConsumableArray(locator), ["".concat(startIndex + ix, ":").concat(c)])));
|
|
3784
3873
|
}
|
|
3785
3874
|
});
|
|
3786
3875
|
|
|
@@ -3792,7 +3881,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3792
3881
|
}
|
|
3793
3882
|
});
|
|
3794
3883
|
|
|
3795
|
-
var flatRow =
|
|
3884
|
+
var flatRow = _this24.flattenObject(row);
|
|
3796
3885
|
|
|
3797
3886
|
for (var key in flatRow) {
|
|
3798
3887
|
var rg = new RegExp("{".concat(key, "}"), 'gm');
|
|
@@ -3907,13 +3996,13 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3907
3996
|
}, {
|
|
3908
3997
|
key: "render",
|
|
3909
3998
|
value: function render() {
|
|
3910
|
-
var
|
|
3999
|
+
var _this25 = this;
|
|
3911
4000
|
|
|
3912
4001
|
if (this.options.entity) {
|
|
3913
4002
|
this.apiService.get(this.options.entity).then(function (results) {
|
|
3914
|
-
|
|
4003
|
+
_this25.rows = results.rows;
|
|
3915
4004
|
|
|
3916
|
-
|
|
4005
|
+
_this25.resize();
|
|
3917
4006
|
});
|
|
3918
4007
|
} else {
|
|
3919
4008
|
this.resize();
|
|
@@ -3968,7 +4057,14 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
3968
4057
|
this.previousView = '';
|
|
3969
4058
|
this.currentView = '';
|
|
3970
4059
|
this.currentViewMain = '';
|
|
3971
|
-
this.currentParams = {
|
|
4060
|
+
this.currentParams = {
|
|
4061
|
+
path: '',
|
|
4062
|
+
items: {}
|
|
4063
|
+
};
|
|
4064
|
+
this.previousParams = {
|
|
4065
|
+
path: '',
|
|
4066
|
+
items: {}
|
|
4067
|
+
};
|
|
3972
4068
|
this.controlPressed = false;
|
|
3973
4069
|
this.usesHTMLSuffix = window.location.pathname.indexOf('.htm') !== -1;
|
|
3974
4070
|
window.addEventListener('popstate', this.onPopState.bind(this));
|
|
@@ -3991,14 +4087,14 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
3991
4087
|
_createClass(WebsyRouter, [{
|
|
3992
4088
|
key: "addGroup",
|
|
3993
4089
|
value: function addGroup(group) {
|
|
3994
|
-
var
|
|
4090
|
+
var _this26 = this;
|
|
3995
4091
|
|
|
3996
4092
|
if (!this.groups[group]) {
|
|
3997
4093
|
var els = document.querySelectorAll(".websy-view[data-group=\"".concat(group, "\"]"));
|
|
3998
4094
|
|
|
3999
4095
|
if (els) {
|
|
4000
4096
|
this.getClosestParent(els[0], function (parent) {
|
|
4001
|
-
|
|
4097
|
+
_this26.groups[group] = {
|
|
4002
4098
|
activeView: '',
|
|
4003
4099
|
views: [],
|
|
4004
4100
|
parent: parent.getAttribute('data-view')
|
|
@@ -4021,10 +4117,13 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4021
4117
|
}, {
|
|
4022
4118
|
key: "addUrlParams",
|
|
4023
4119
|
value: function addUrlParams(params) {
|
|
4120
|
+
var reloadView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
4121
|
+
|
|
4024
4122
|
if (typeof params === 'undefined') {
|
|
4025
4123
|
return;
|
|
4026
4124
|
}
|
|
4027
4125
|
|
|
4126
|
+
this.previousParams = _extends({}, this.currentParams);
|
|
4028
4127
|
var output = {
|
|
4029
4128
|
path: '',
|
|
4030
4129
|
items: {}
|
|
@@ -4049,6 +4148,10 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4049
4148
|
history.pushState({
|
|
4050
4149
|
inputPath: inputPath
|
|
4051
4150
|
}, inputPath, "".concat(inputPath, "?").concat(path));
|
|
4151
|
+
|
|
4152
|
+
if (reloadView === true) {
|
|
4153
|
+
this.showView(this.currentView, this.currentParams, 'main');
|
|
4154
|
+
}
|
|
4052
4155
|
}
|
|
4053
4156
|
}, {
|
|
4054
4157
|
key: "buildUrlPath",
|
|
@@ -4090,6 +4193,7 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4090
4193
|
}, {
|
|
4091
4194
|
key: "formatParams",
|
|
4092
4195
|
value: function formatParams(params) {
|
|
4196
|
+
this.previousParams = _extends({}, this.currentParams);
|
|
4093
4197
|
var output = {
|
|
4094
4198
|
path: params,
|
|
4095
4199
|
items: {}
|
|
@@ -4323,12 +4427,12 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4323
4427
|
}, {
|
|
4324
4428
|
key: "showComponents",
|
|
4325
4429
|
value: function showComponents(view) {
|
|
4326
|
-
var
|
|
4430
|
+
var _this27 = this;
|
|
4327
4431
|
|
|
4328
4432
|
if (this.options.views && this.options.views[view] && this.options.views[view].components) {
|
|
4329
4433
|
this.options.views[view].components.forEach(function (c) {
|
|
4330
4434
|
if (typeof c.instance === 'undefined') {
|
|
4331
|
-
|
|
4435
|
+
_this27.prepComponent(c.elementId, c.options);
|
|
4332
4436
|
|
|
4333
4437
|
c.instance = new c.Component(c.elementId, c.options);
|
|
4334
4438
|
} else if (c.instance.render) {
|
|
@@ -4354,6 +4458,9 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4354
4458
|
if (this.previousView !== this.currentView || group !== 'main') {
|
|
4355
4459
|
this.showComponents(view);
|
|
4356
4460
|
this.publish('show', [view, params, group]);
|
|
4461
|
+
} else if (this.previousView === this.currentView && this.previousParams.path !== this.currentParams.path) {
|
|
4462
|
+
this.showComponents(view);
|
|
4463
|
+
this.publish('show', [view, params, group]);
|
|
4357
4464
|
}
|
|
4358
4465
|
}
|
|
4359
4466
|
}, {
|
|
@@ -4379,7 +4486,7 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4379
4486
|
var params = {};
|
|
4380
4487
|
var newPath = inputPath;
|
|
4381
4488
|
|
|
4382
|
-
if (inputPath === this.options.defaultView && this.usesHTMLSuffix === false) {
|
|
4489
|
+
if (inputPath.split('?')[0] === this.options.defaultView && this.usesHTMLSuffix === false) {
|
|
4383
4490
|
inputPath = inputPath.replace(this.options.defaultView, '/');
|
|
4384
4491
|
}
|
|
4385
4492
|
|
|
@@ -4387,8 +4494,6 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4387
4494
|
if (inputPath.indexOf('?') === -1 && this.queryParams) {
|
|
4388
4495
|
inputPath += "?".concat(this.queryParams);
|
|
4389
4496
|
}
|
|
4390
|
-
} else {
|
|
4391
|
-
this.currentParams = {};
|
|
4392
4497
|
}
|
|
4393
4498
|
|
|
4394
4499
|
if (this.usesHTMLSuffix === true) {
|
|
@@ -4412,7 +4517,11 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4412
4517
|
params = this.formatParams(parts[1]);
|
|
4413
4518
|
inputPath = parts[0];
|
|
4414
4519
|
} else if (group === this.options.defaultGroup) {
|
|
4415
|
-
this.
|
|
4520
|
+
this.previousParams = _extends({}, this.currentParams);
|
|
4521
|
+
this.currentParams = {
|
|
4522
|
+
path: '',
|
|
4523
|
+
items: {}
|
|
4524
|
+
};
|
|
4416
4525
|
}
|
|
4417
4526
|
|
|
4418
4527
|
if (event) {
|
|
@@ -4478,12 +4587,6 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4478
4587
|
return;
|
|
4479
4588
|
}
|
|
4480
4589
|
|
|
4481
|
-
if (toggle === false) {
|
|
4482
|
-
this.showView(this.currentView, this.currentParams, group);
|
|
4483
|
-
} else if (newPath && newPath !== '') {
|
|
4484
|
-
this.showView(newPath, null, group);
|
|
4485
|
-
}
|
|
4486
|
-
|
|
4487
4590
|
if (this.usesHTMLSuffix === true) {
|
|
4488
4591
|
inputPath = window.location.pathname.split('/').pop() + inputPath;
|
|
4489
4592
|
}
|
|
@@ -4511,6 +4614,12 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4511
4614
|
} else {//
|
|
4512
4615
|
}
|
|
4513
4616
|
}
|
|
4617
|
+
|
|
4618
|
+
if (toggle === false) {
|
|
4619
|
+
this.showView(this.currentView, this.currentParams, group);
|
|
4620
|
+
} else if (newPath && newPath !== '') {
|
|
4621
|
+
this.showView(newPath, null, group);
|
|
4622
|
+
}
|
|
4514
4623
|
}
|
|
4515
4624
|
}, {
|
|
4516
4625
|
key: "on",
|
|
@@ -4627,7 +4736,7 @@ var WebsySearch = /*#__PURE__*/function () {
|
|
|
4627
4736
|
this.elementId = elementId;
|
|
4628
4737
|
var DEFAULTS = {
|
|
4629
4738
|
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>",
|
|
4630
|
-
clearIcon: "<svg
|
|
4739
|
+
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>",
|
|
4631
4740
|
placeholder: 'Search',
|
|
4632
4741
|
searchTimeout: 500,
|
|
4633
4742
|
minLength: 2
|
|
@@ -4638,27 +4747,45 @@ var WebsySearch = /*#__PURE__*/function () {
|
|
|
4638
4747
|
|
|
4639
4748
|
if (el) {
|
|
4640
4749
|
// el.addEventListener('click', this.handleClick.bind(this))
|
|
4750
|
+
el.addEventListener('click', this.handleClick.bind(this));
|
|
4641
4751
|
el.addEventListener('keyup', this.handleKeyUp.bind(this));
|
|
4642
|
-
el.innerHTML = "\n <div class='websy-search-input-container'>\n ".concat(this.options.searchIcon, "\n <input id='").concat(this.elementId, "_search' class='websy-search-input' placeholder='").concat(this.options.placeholder || 'Search', "'>\n ").concat(this.options.clearIcon, "\n </div>\n ");
|
|
4752
|
+
el.innerHTML = "\n <div class='websy-search-input-container'>\n ".concat(this.options.searchIcon, "\n <input id='").concat(this.elementId, "_search' class='websy-search-input' placeholder='").concat(this.options.placeholder || 'Search', "'>\n <div class='clear websy-hidden' id='").concat(this.elementId, "_clear'>\n ").concat(this.options.clearIcon, "\n </div>\n </div>\n ");
|
|
4643
4753
|
} else {
|
|
4644
4754
|
console.log('No element found with Id', elementId);
|
|
4645
4755
|
}
|
|
4646
4756
|
}
|
|
4647
4757
|
|
|
4648
4758
|
_createClass(WebsySearch, [{
|
|
4759
|
+
key: "handleClick",
|
|
4760
|
+
value: function handleClick(event) {
|
|
4761
|
+
if (event.target.classList.contains('clear')) {
|
|
4762
|
+
var inputEl = document.getElementById("".concat(this.elementId, "_search"));
|
|
4763
|
+
inputEl.value = '';
|
|
4764
|
+
this.options.onSearch('');
|
|
4765
|
+
}
|
|
4766
|
+
}
|
|
4767
|
+
}, {
|
|
4649
4768
|
key: "handleKeyUp",
|
|
4650
4769
|
value: function handleKeyUp(event) {
|
|
4651
|
-
var
|
|
4770
|
+
var _this28 = this;
|
|
4652
4771
|
|
|
4653
4772
|
if (event.target.classList.contains('websy-search-input')) {
|
|
4654
4773
|
if (this.searchTimeoutFn) {
|
|
4655
4774
|
clearTimeout(this.searchTimeoutFn);
|
|
4656
4775
|
}
|
|
4657
4776
|
|
|
4777
|
+
var clearEl = document.getElementById("".concat(this.elementId, "_clear"));
|
|
4778
|
+
|
|
4779
|
+
if (event.target.value.length > 0) {
|
|
4780
|
+
clearEl.classList.remove('websy-hidden');
|
|
4781
|
+
} else {
|
|
4782
|
+
clearEl.classList.add('websy-hidden');
|
|
4783
|
+
}
|
|
4784
|
+
|
|
4658
4785
|
if (event.target.value.length >= this.options.minLength) {
|
|
4659
4786
|
this.searchTimeoutFn = setTimeout(function () {
|
|
4660
|
-
if (
|
|
4661
|
-
|
|
4787
|
+
if (_this28.options.onSearch) {
|
|
4788
|
+
_this28.options.onSearch(event.target.value);
|
|
4662
4789
|
}
|
|
4663
4790
|
}, this.options.searchTimeout);
|
|
4664
4791
|
} else {
|
|
@@ -4809,7 +4936,7 @@ var Switch = /*#__PURE__*/function () {
|
|
|
4809
4936
|
|
|
4810
4937
|
var WebsyTemplate = /*#__PURE__*/function () {
|
|
4811
4938
|
function WebsyTemplate(elementId, options) {
|
|
4812
|
-
var
|
|
4939
|
+
var _this29 = this;
|
|
4813
4940
|
|
|
4814
4941
|
_classCallCheck(this, WebsyTemplate);
|
|
4815
4942
|
|
|
@@ -4835,9 +4962,9 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4835
4962
|
|
|
4836
4963
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
4837
4964
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
4838
|
-
|
|
4965
|
+
_this29.options.template = templateString;
|
|
4839
4966
|
|
|
4840
|
-
|
|
4967
|
+
_this29.render();
|
|
4841
4968
|
});
|
|
4842
4969
|
} else {
|
|
4843
4970
|
this.render();
|
|
@@ -4847,7 +4974,7 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4847
4974
|
_createClass(WebsyTemplate, [{
|
|
4848
4975
|
key: "buildHTML",
|
|
4849
4976
|
value: function buildHTML() {
|
|
4850
|
-
var
|
|
4977
|
+
var _this30 = this;
|
|
4851
4978
|
|
|
4852
4979
|
var html = "";
|
|
4853
4980
|
|
|
@@ -4909,14 +5036,14 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4909
5036
|
}
|
|
4910
5037
|
|
|
4911
5038
|
if (polarity === true) {
|
|
4912
|
-
if (typeof
|
|
5039
|
+
if (typeof _this30.options.data[parts[0]] !== 'undefined' && _this30.options.data[parts[0]] === parts[1]) {
|
|
4913
5040
|
// remove the <if> tags
|
|
4914
5041
|
removeAll = false;
|
|
4915
5042
|
} else if (parts[0] === parts[1]) {
|
|
4916
5043
|
removeAll = false;
|
|
4917
5044
|
}
|
|
4918
5045
|
} else if (polarity === false) {
|
|
4919
|
-
if (typeof
|
|
5046
|
+
if (typeof _this30.options.data[parts[0]] !== 'undefined' && _this30.options.data[parts[0]] !== parts[1]) {
|
|
4920
5047
|
// remove the <if> tags
|
|
4921
5048
|
removeAll = false;
|
|
4922
5049
|
}
|
|
@@ -5206,7 +5333,7 @@ var WebsyUtils = {
|
|
|
5206
5333
|
|
|
5207
5334
|
var WebsyTable = /*#__PURE__*/function () {
|
|
5208
5335
|
function WebsyTable(elementId, options) {
|
|
5209
|
-
var
|
|
5336
|
+
var _this31 = this;
|
|
5210
5337
|
|
|
5211
5338
|
_classCallCheck(this, WebsyTable);
|
|
5212
5339
|
|
|
@@ -5244,8 +5371,8 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5244
5371
|
allowClear: false,
|
|
5245
5372
|
disableSearch: true,
|
|
5246
5373
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
5247
|
-
if (
|
|
5248
|
-
|
|
5374
|
+
if (_this31.options.onChangePageSize) {
|
|
5375
|
+
_this31.options.onChangePageSize(selectedItem.value);
|
|
5249
5376
|
}
|
|
5250
5377
|
}
|
|
5251
5378
|
});
|
|
@@ -5266,7 +5393,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5266
5393
|
_createClass(WebsyTable, [{
|
|
5267
5394
|
key: "appendRows",
|
|
5268
5395
|
value: function appendRows(data) {
|
|
5269
|
-
var
|
|
5396
|
+
var _this32 = this;
|
|
5270
5397
|
|
|
5271
5398
|
this.hideError();
|
|
5272
5399
|
var bodyHTML = '';
|
|
@@ -5274,15 +5401,15 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5274
5401
|
if (data) {
|
|
5275
5402
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
5276
5403
|
return '<tr>' + r.map(function (c, i) {
|
|
5277
|
-
if (
|
|
5404
|
+
if (_this32.options.columns[i].show !== false) {
|
|
5278
5405
|
var style = '';
|
|
5279
5406
|
|
|
5280
5407
|
if (c.style) {
|
|
5281
5408
|
style += c.style;
|
|
5282
5409
|
}
|
|
5283
5410
|
|
|
5284
|
-
if (
|
|
5285
|
-
style += "width: ".concat(
|
|
5411
|
+
if (_this32.options.columns[i].width) {
|
|
5412
|
+
style += "width: ".concat(_this32.options.columns[i].width, "; ");
|
|
5286
5413
|
}
|
|
5287
5414
|
|
|
5288
5415
|
if (c.backgroundColor) {
|
|
@@ -5297,18 +5424,18 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5297
5424
|
style += "color: ".concat(c.color, "; ");
|
|
5298
5425
|
}
|
|
5299
5426
|
|
|
5300
|
-
if (
|
|
5301
|
-
return "\n <td \n data-row-index='".concat(
|
|
5302
|
-
} else if ((
|
|
5303
|
-
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(
|
|
5427
|
+
if (_this32.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
5428
|
+
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 ");
|
|
5429
|
+
} else if ((_this32.options.columns[i].showAsNavigatorLink === true || _this32.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
5430
|
+
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 ");
|
|
5304
5431
|
} else {
|
|
5305
5432
|
var info = c.value;
|
|
5306
5433
|
|
|
5307
|
-
if (
|
|
5434
|
+
if (_this32.options.columns[i].showAsImage === true) {
|
|
5308
5435
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
5309
5436
|
}
|
|
5310
5437
|
|
|
5311
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
5438
|
+
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 ");
|
|
5312
5439
|
}
|
|
5313
5440
|
}
|
|
5314
5441
|
}).join('') + '</tr>';
|
|
@@ -5480,7 +5607,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5480
5607
|
}, {
|
|
5481
5608
|
key: "render",
|
|
5482
5609
|
value: function render(data) {
|
|
5483
|
-
var
|
|
5610
|
+
var _this33 = this;
|
|
5484
5611
|
|
|
5485
5612
|
if (!this.options.columns) {
|
|
5486
5613
|
return;
|
|
@@ -5515,7 +5642,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5515
5642
|
style += "width: ".concat(c.width || 'auto', ";");
|
|
5516
5643
|
}
|
|
5517
5644
|
|
|
5518
|
-
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 ?
|
|
5645
|
+
return "\n <th style=\"".concat(style, "\">\n <div class =\"tableHeader\">\n <div class=\"leftSection\">\n <div\n class=\"tableHeaderField ").concat(['asc', 'desc'].indexOf(c.sort) !== -1 ? 'sortable-column' : '', "\"\n data-index=\"").concat(i, "\" \n data-sort=\"").concat(c.sort, "\" \n >\n ").concat(c.name, "\n </div>\n </div>\n <div class=\"").concat(c.activeSort ? c.sort + ' sortOrder' : '', "\"></div>\n <!--").concat(c.searchable === true ? _this33.buildSearchIcon(c.qGroupFieldDefs[0]) : '', "-->\n </div>\n </th>\n ");
|
|
5519
5646
|
}
|
|
5520
5647
|
}).join('') + '</tr>';
|
|
5521
5648
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -5534,7 +5661,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5534
5661
|
|
|
5535
5662
|
if (pagingEl) {
|
|
5536
5663
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
5537
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
5664
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this33.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
5538
5665
|
});
|
|
5539
5666
|
var startIndex = 0;
|
|
5540
5667
|
|
|
@@ -5602,7 +5729,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5602
5729
|
|
|
5603
5730
|
var WebsyTable2 = /*#__PURE__*/function () {
|
|
5604
5731
|
function WebsyTable2(elementId, options) {
|
|
5605
|
-
var
|
|
5732
|
+
var _this34 = this;
|
|
5606
5733
|
|
|
5607
5734
|
_classCallCheck(this, WebsyTable2);
|
|
5608
5735
|
|
|
@@ -5643,8 +5770,8 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5643
5770
|
allowClear: false,
|
|
5644
5771
|
disableSearch: true,
|
|
5645
5772
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
5646
|
-
if (
|
|
5647
|
-
|
|
5773
|
+
if (_this34.options.onChangePageSize) {
|
|
5774
|
+
_this34.options.onChangePageSize(selectedItem.value);
|
|
5648
5775
|
}
|
|
5649
5776
|
}
|
|
5650
5777
|
});
|
|
@@ -5668,7 +5795,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5668
5795
|
_createClass(WebsyTable2, [{
|
|
5669
5796
|
key: "appendRows",
|
|
5670
5797
|
value: function appendRows(data) {
|
|
5671
|
-
var
|
|
5798
|
+
var _this35 = this;
|
|
5672
5799
|
|
|
5673
5800
|
this.hideError();
|
|
5674
5801
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
@@ -5677,15 +5804,15 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5677
5804
|
if (data) {
|
|
5678
5805
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
5679
5806
|
return '<tr>' + r.map(function (c, i) {
|
|
5680
|
-
if (
|
|
5681
|
-
var style = "height: ".concat(
|
|
5807
|
+
if (_this35.options.columns[i].show !== false) {
|
|
5808
|
+
var style = "height: ".concat(_this35.options.cellSize, "px; line-height: ").concat(_this35.options.cellSize, "px;");
|
|
5682
5809
|
|
|
5683
5810
|
if (c.style) {
|
|
5684
5811
|
style += c.style;
|
|
5685
5812
|
}
|
|
5686
5813
|
|
|
5687
|
-
if (
|
|
5688
|
-
style += "width: ".concat(
|
|
5814
|
+
if (_this35.options.columns[i].width) {
|
|
5815
|
+
style += "width: ".concat(_this35.options.columns[i].width, "; ");
|
|
5689
5816
|
}
|
|
5690
5817
|
|
|
5691
5818
|
if (c.backgroundColor) {
|
|
@@ -5700,18 +5827,18 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5700
5827
|
style += "color: ".concat(c.color, "; ");
|
|
5701
5828
|
}
|
|
5702
5829
|
|
|
5703
|
-
if (
|
|
5704
|
-
return "\n <td \n data-row-index='".concat(
|
|
5705
|
-
} else if ((
|
|
5706
|
-
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(
|
|
5830
|
+
if (_this35.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
5831
|
+
return "\n <td \n data-row-index='".concat(_this35.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this35.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >\n <a href='").concat(c.value, "' target='").concat(_this35.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this35.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
|
|
5832
|
+
} else if ((_this35.options.columns[i].showAsNavigatorLink === true || _this35.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
5833
|
+
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this35.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this35.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this35.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this35.options.columns[i].linkText || c.value, "</td>\n ");
|
|
5707
5834
|
} else {
|
|
5708
5835
|
var info = c.value;
|
|
5709
5836
|
|
|
5710
|
-
if (
|
|
5837
|
+
if (_this35.options.columns[i].showAsImage === true) {
|
|
5711
5838
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
5712
5839
|
}
|
|
5713
5840
|
|
|
5714
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
5841
|
+
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this35.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this35.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.value, "</td>\n ");
|
|
5715
5842
|
}
|
|
5716
5843
|
}
|
|
5717
5844
|
}).join('') + '</tr>';
|
|
@@ -5974,7 +6101,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5974
6101
|
}, {
|
|
5975
6102
|
key: "render",
|
|
5976
6103
|
value: function render(data) {
|
|
5977
|
-
var
|
|
6104
|
+
var _this36 = this;
|
|
5978
6105
|
|
|
5979
6106
|
if (!this.options.columns) {
|
|
5980
6107
|
return;
|
|
@@ -6010,7 +6137,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6010
6137
|
style += "width: ".concat(c.width || 'auto', "; ");
|
|
6011
6138
|
}
|
|
6012
6139
|
|
|
6013
|
-
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 ?
|
|
6140
|
+
return "\n <th style=\"".concat(style, "\">\n <div class =\"tableHeader\">\n <div class=\"leftSection\">\n <div\n class=\"tableHeaderField ").concat(['asc', 'desc'].indexOf(c.sort) !== -1 ? 'sortable-column' : '', "\"\n data-sort-index=\"").concat(c.sortIndex || i, "\"\n data-index=\"").concat(i, "\"\n data-sort=\"").concat(c.sort, "\"\n style=\"").concat(c.style || '', "\" \n >\n ").concat(c.name, "\n </div>\n </div>\n <div class=\"").concat(c.activeSort ? c.sort + ' sortOrder' : '', "\"></div>\n ").concat(c.searchable === true ? _this36.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
|
|
6014
6141
|
}
|
|
6015
6142
|
}).join('') + '</tr>';
|
|
6016
6143
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -6021,7 +6148,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6021
6148
|
var dropdownHTML = "";
|
|
6022
6149
|
this.options.columns.forEach(function (c, i) {
|
|
6023
6150
|
if (c.searchable && c.searchField) {
|
|
6024
|
-
dropdownHTML += "\n <div id=\"".concat(
|
|
6151
|
+
dropdownHTML += "\n <div id=\"".concat(_this36.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
|
|
6025
6152
|
}
|
|
6026
6153
|
});
|
|
6027
6154
|
dropdownEl.innerHTML = dropdownHTML;
|
|
@@ -6043,7 +6170,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6043
6170
|
|
|
6044
6171
|
if (pagingEl) {
|
|
6045
6172
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
6046
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
6173
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this36.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
6047
6174
|
});
|
|
6048
6175
|
var startIndex = 0;
|
|
6049
6176
|
|
|
@@ -6134,7 +6261,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6134
6261
|
}, {
|
|
6135
6262
|
key: "getColumnParameters",
|
|
6136
6263
|
value: function getColumnParameters(values) {
|
|
6137
|
-
var
|
|
6264
|
+
var _this37 = this;
|
|
6138
6265
|
|
|
6139
6266
|
var tableEl = document.getElementById("".concat(this.elementId, "_table"));
|
|
6140
6267
|
tableEl.style.tableLayout = 'auto';
|
|
@@ -6142,10 +6269,10 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6142
6269
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
6143
6270
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
6144
6271
|
headEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c, i) {
|
|
6145
|
-
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 ?
|
|
6272
|
+
return "\n <th>\n <div class =\"tableHeader\">\n <div class=\"leftSection\">\n <div\n class=\"tableHeaderField\" \n >\n ".concat(c.value || 'nbsp;', "\n </div>\n </div> \n ").concat(c.searchable === true ? _this37.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
|
|
6146
6273
|
}).join('') + '</tr>';
|
|
6147
6274
|
bodyEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c) {
|
|
6148
|
-
return "\n <td \n style='height: ".concat(
|
|
6275
|
+
return "\n <td \n style='height: ".concat(_this37.options.cellSize, "px; line-height: ").concat(_this37.options.cellSize, "px; padding: 10px 5px;'\n >").concat(c.value || ' ', "</td>\n ");
|
|
6149
6276
|
}).join('') + '</tr>'; // get height of the first data cell
|
|
6150
6277
|
|
|
6151
6278
|
var cells = bodyEl.querySelectorAll("tr:first-of-type td");
|
|
@@ -6289,7 +6416,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6289
6416
|
bodyHtml += '</colgroup>';
|
|
6290
6417
|
}
|
|
6291
6418
|
|
|
6292
|
-
data.forEach(function (row) {
|
|
6419
|
+
data.forEach(function (row, rowIndex) {
|
|
6293
6420
|
bodyHtml += "<tr class=\"websy-table-row\">";
|
|
6294
6421
|
row.forEach(function (cell, cellIndex) {
|
|
6295
6422
|
if (typeof sizingColumns[cellIndex] === 'undefined') {
|
|
@@ -6319,14 +6446,24 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6319
6446
|
}
|
|
6320
6447
|
|
|
6321
6448
|
console.log('rowspan', cell.rowspan);
|
|
6322
|
-
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) {
|
|
6449
|
+
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) {
|
|
6323
6450
|
// bodyHtml += `
|
|
6324
6451
|
// style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
|
|
6325
6452
|
// width='${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}'
|
|
6326
6453
|
// `
|
|
6327
6454
|
// }
|
|
6328
6455
|
|
|
6329
|
-
bodyHtml += "\n
|
|
6456
|
+
bodyHtml += "\n >";
|
|
6457
|
+
|
|
6458
|
+
if (cell.expandable === true) {
|
|
6459
|
+
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>");
|
|
6460
|
+
}
|
|
6461
|
+
|
|
6462
|
+
if (cell.collapsable === true) {
|
|
6463
|
+
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>");
|
|
6464
|
+
}
|
|
6465
|
+
|
|
6466
|
+
bodyHtml += "\n ".concat(cell.value, "\n </td>");
|
|
6330
6467
|
});
|
|
6331
6468
|
bodyHtml += "</tr>";
|
|
6332
6469
|
}); // bodyHtml += `</div>`
|
|
@@ -6336,7 +6473,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6336
6473
|
}, {
|
|
6337
6474
|
key: "buildHeaderHtml",
|
|
6338
6475
|
value: function buildHeaderHtml() {
|
|
6339
|
-
var
|
|
6476
|
+
var _this38 = this;
|
|
6340
6477
|
|
|
6341
6478
|
var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6342
6479
|
var headerHtml = '';
|
|
@@ -6351,7 +6488,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6351
6488
|
}
|
|
6352
6489
|
|
|
6353
6490
|
this.options.columns.forEach(function (row, rowIndex) {
|
|
6354
|
-
if (useWidths === false && rowIndex !==
|
|
6491
|
+
if (useWidths === false && rowIndex !== _this38.options.columns.length - 1) {
|
|
6355
6492
|
// if we're calculating the size we only want to render the last row of column headers
|
|
6356
6493
|
return;
|
|
6357
6494
|
}
|
|
@@ -6365,18 +6502,18 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6365
6502
|
// `
|
|
6366
6503
|
// }
|
|
6367
6504
|
|
|
6368
|
-
headerHtml += " \n >\n <div>\n ".concat(col.name, "\n ").concat(col.searchable === true ?
|
|
6505
|
+
headerHtml += " \n >\n <div>\n ".concat(col.name, "\n ").concat(col.searchable === true ? _this38.buildSearchIcon(col, colIndex) : '', "\n </div>\n </td>");
|
|
6369
6506
|
});
|
|
6370
6507
|
headerHtml += "</tr>";
|
|
6371
6508
|
});
|
|
6372
6509
|
var dropdownEl = document.getElementById("".concat(this.elementId, "_dropdownContainer"));
|
|
6373
6510
|
this.options.columns[this.options.columns.length - 1].forEach(function (c, i) {
|
|
6374
6511
|
if (c.searchable && c.isExternalSearch === true) {
|
|
6375
|
-
var testEl = document.getElementById("".concat(
|
|
6512
|
+
var testEl = document.getElementById("".concat(_this38.elementId, "_columnSearch_").concat(c.dimId || i));
|
|
6376
6513
|
|
|
6377
6514
|
if (!testEl) {
|
|
6378
6515
|
var newE = document.createElement('div');
|
|
6379
|
-
newE.id = "".concat(
|
|
6516
|
+
newE.id = "".concat(_this38.elementId, "_columnSearch_").concat(c.dimId || i);
|
|
6380
6517
|
newE.className = 'websy-modal-dropdown';
|
|
6381
6518
|
dropdownEl.appendChild(newE);
|
|
6382
6519
|
}
|
|
@@ -6392,7 +6529,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6392
6529
|
}, {
|
|
6393
6530
|
key: "buildTotalHtml",
|
|
6394
6531
|
value: function buildTotalHtml() {
|
|
6395
|
-
var
|
|
6532
|
+
var _this39 = this;
|
|
6396
6533
|
|
|
6397
6534
|
var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6398
6535
|
|
|
@@ -6405,7 +6542,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6405
6542
|
totalHtml += "<td \n class='websy-table-cell'\n colspan='".concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
|
|
6406
6543
|
|
|
6407
6544
|
if (useWidths === true) {
|
|
6408
|
-
totalHtml += "\n style='width: ".concat(
|
|
6545
|
+
totalHtml += "\n style='width: ".concat(_this39.options.columns[_this39.options.columns.length - 1][colIndex].width || _this39.options.columns[_this39.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
|
|
6409
6546
|
}
|
|
6410
6547
|
|
|
6411
6548
|
totalHtml += " \n >\n ".concat(col.value, "\n </td>");
|
|
@@ -6416,7 +6553,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6416
6553
|
}, {
|
|
6417
6554
|
key: "calculateSizes",
|
|
6418
6555
|
value: function calculateSizes() {
|
|
6419
|
-
var
|
|
6556
|
+
var _this40 = this;
|
|
6420
6557
|
|
|
6421
6558
|
var sample = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6422
6559
|
var totalRowCount = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -6458,28 +6595,28 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6458
6595
|
rows.forEach(function (row, rowIndex) {
|
|
6459
6596
|
Array.from(row.children).forEach(function (col, colIndex) {
|
|
6460
6597
|
var colSize = col.getBoundingClientRect();
|
|
6461
|
-
|
|
6598
|
+
_this40.sizes.cellHeight = colSize.height;
|
|
6462
6599
|
|
|
6463
|
-
if (
|
|
6464
|
-
if (!
|
|
6465
|
-
|
|
6600
|
+
if (_this40.options.columns[_this40.options.columns.length - 1][colIndex]) {
|
|
6601
|
+
if (!_this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth) {
|
|
6602
|
+
_this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth = 0;
|
|
6466
6603
|
}
|
|
6467
6604
|
|
|
6468
|
-
|
|
6469
|
-
|
|
6605
|
+
_this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth = Math.min(Math.max(_this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth, colSize.width), maxWidth);
|
|
6606
|
+
_this40.options.columns[_this40.options.columns.length - 1][colIndex].cellHeight = colSize.height;
|
|
6470
6607
|
}
|
|
6471
6608
|
});
|
|
6472
6609
|
});
|
|
6473
6610
|
this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
|
|
6474
|
-
if (colIndex <
|
|
6475
|
-
|
|
6611
|
+
if (colIndex < _this40.pinnedColumns) {
|
|
6612
|
+
_this40.sizes.scrollableWidth -= col.actualWidth;
|
|
6476
6613
|
}
|
|
6477
6614
|
});
|
|
6478
6615
|
this.sizes.totalWidth = this.options.columns[this.options.columns.length - 1].reduce(function (a, b) {
|
|
6479
6616
|
return a + (b.width || b.actualWidth);
|
|
6480
6617
|
}, 0);
|
|
6481
6618
|
this.sizes.totalNonPinnedWidth = this.options.columns[this.options.columns.length - 1].filter(function (c, i) {
|
|
6482
|
-
return i >=
|
|
6619
|
+
return i >= _this40.pinnedColumns;
|
|
6483
6620
|
}).reduce(function (a, b) {
|
|
6484
6621
|
return a + (b.width || b.actualWidth);
|
|
6485
6622
|
}, 0);
|
|
@@ -6497,13 +6634,13 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6497
6634
|
}
|
|
6498
6635
|
}
|
|
6499
6636
|
|
|
6500
|
-
|
|
6637
|
+
_this40.sizes.totalWidth += c.width || c.actualWidth;
|
|
6501
6638
|
|
|
6502
|
-
if (i <
|
|
6503
|
-
|
|
6639
|
+
if (i < _this40.pinnedColumns) {
|
|
6640
|
+
_this40.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
|
|
6504
6641
|
}
|
|
6505
6642
|
|
|
6506
|
-
equalWidth = (outerSize.width -
|
|
6643
|
+
equalWidth = (outerSize.width - _this40.sizes.totalWidth) / (_this40.options.columns[_this40.options.columns.length - 1].length - (i + 1));
|
|
6507
6644
|
});
|
|
6508
6645
|
} // take the height of the last cell as the official height for data cells
|
|
6509
6646
|
// this.sizes.dataCellHeight = this.options.columns[this.options.columns.length - 1].cellHeight
|
|
@@ -6572,14 +6709,30 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6572
6709
|
}, {
|
|
6573
6710
|
key: "handleClick",
|
|
6574
6711
|
value: function handleClick(event) {
|
|
6712
|
+
var colIndex = +event.target.getAttribute('data-col-index');
|
|
6713
|
+
var rowIndex = +event.target.getAttribute('data-row-index');
|
|
6714
|
+
|
|
6575
6715
|
if (event.target.classList.contains('websy-table-search-icon')) {
|
|
6576
6716
|
console.log('clicked on search icon');
|
|
6577
|
-
var colIndex = +event.target.getAttribute('data-col-index');
|
|
6578
6717
|
|
|
6579
6718
|
if (this.options.columns[this.options.columns.length - 1][colIndex].onSearch) {
|
|
6580
6719
|
this.options.columns[this.options.columns.length - 1][colIndex].onSearch(event, this.options.columns[this.options.columns.length - 1][colIndex]);
|
|
6581
6720
|
}
|
|
6582
6721
|
}
|
|
6722
|
+
|
|
6723
|
+
if (event.target.classList.contains('websy-table-cell-collapse')) {
|
|
6724
|
+
if (this.options.onCollapseCell) {
|
|
6725
|
+
this.options.onCollapseCell(event, +rowIndex, +colIndex);
|
|
6726
|
+
} else {// out of box function
|
|
6727
|
+
}
|
|
6728
|
+
}
|
|
6729
|
+
|
|
6730
|
+
if (event.target.classList.contains('websy-table-cell-expand')) {
|
|
6731
|
+
if (this.options.onExpandCell) {
|
|
6732
|
+
this.options.onExpandCell(event, +rowIndex, +colIndex);
|
|
6733
|
+
} else {// out of box function
|
|
6734
|
+
}
|
|
6735
|
+
}
|
|
6583
6736
|
}
|
|
6584
6737
|
}, {
|
|
6585
6738
|
key: "handleMouseDown",
|
|
@@ -6932,7 +7085,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6932
7085
|
|
|
6933
7086
|
var WebsyChart = /*#__PURE__*/function () {
|
|
6934
7087
|
function WebsyChart(elementId, options) {
|
|
6935
|
-
var
|
|
7088
|
+
var _this41 = this;
|
|
6936
7089
|
|
|
6937
7090
|
_classCallCheck(this, WebsyChart);
|
|
6938
7091
|
|
|
@@ -6981,22 +7134,22 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
6981
7134
|
this.invertOverride = function (input, input2) {
|
|
6982
7135
|
var xAxis = 'bottomAxis';
|
|
6983
7136
|
|
|
6984
|
-
if (
|
|
7137
|
+
if (_this41.options.orientation === 'horizontal') {
|
|
6985
7138
|
xAxis = 'leftAxis';
|
|
6986
7139
|
}
|
|
6987
7140
|
|
|
6988
|
-
var width =
|
|
7141
|
+
var width = _this41[xAxis].step();
|
|
6989
7142
|
|
|
6990
7143
|
var output;
|
|
6991
7144
|
|
|
6992
|
-
var domain = _toConsumableArray(
|
|
7145
|
+
var domain = _toConsumableArray(_this41[xAxis].domain());
|
|
6993
7146
|
|
|
6994
|
-
if (
|
|
7147
|
+
if (_this41.options.orientation === 'horizontal') {
|
|
6995
7148
|
domain = domain.reverse();
|
|
6996
7149
|
}
|
|
6997
7150
|
|
|
6998
7151
|
for (var j = 0; j < domain.length; j++) {
|
|
6999
|
-
var breakA =
|
|
7152
|
+
var breakA = _this41[xAxis](domain[j]) - width / 2;
|
|
7000
7153
|
var breakB = breakA + width;
|
|
7001
7154
|
|
|
7002
7155
|
if (input > breakA && input <= breakB) {
|
|
@@ -7096,10 +7249,10 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7096
7249
|
}, {
|
|
7097
7250
|
key: "handleEventMouseMove",
|
|
7098
7251
|
value: function handleEventMouseMove(event, d) {
|
|
7099
|
-
var
|
|
7252
|
+
var _this42 = this;
|
|
7100
7253
|
|
|
7101
7254
|
var bisectDate = d3.bisector(function (d) {
|
|
7102
|
-
return
|
|
7255
|
+
return _this42.parseX(d.x.value);
|
|
7103
7256
|
}).left;
|
|
7104
7257
|
|
|
7105
7258
|
if (this.options.showTrackingLine === true && d3.pointer(event)) {
|
|
@@ -7138,8 +7291,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7138
7291
|
}
|
|
7139
7292
|
|
|
7140
7293
|
this.options.data.series.forEach(function (s) {
|
|
7141
|
-
if (
|
|
7142
|
-
xPoint =
|
|
7294
|
+
if (_this42.options.data[xData].scale !== 'Time') {
|
|
7295
|
+
xPoint = _this42[xAxis](_this42.parseX(xLabel));
|
|
7143
7296
|
s.data.forEach(function (d) {
|
|
7144
7297
|
if (d.x.value === xLabel) {
|
|
7145
7298
|
if (!tooltipTitle) {
|
|
@@ -7158,13 +7311,13 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7158
7311
|
var pointA = s.data[index - 1];
|
|
7159
7312
|
var pointB = s.data[index];
|
|
7160
7313
|
|
|
7161
|
-
if (
|
|
7314
|
+
if (_this42.options.orientation === 'horizontal') {
|
|
7162
7315
|
pointA = _toConsumableArray(s.data).reverse()[index - 1];
|
|
7163
7316
|
pointB = _toConsumableArray(s.data).reverse()[index];
|
|
7164
7317
|
}
|
|
7165
7318
|
|
|
7166
7319
|
if (pointA && !pointB) {
|
|
7167
|
-
xPoint =
|
|
7320
|
+
xPoint = _this42[xAxis](_this42.parseX(pointA.x.value));
|
|
7168
7321
|
tooltipTitle = pointA.x.value;
|
|
7169
7322
|
|
|
7170
7323
|
if (!pointA.y.color) {
|
|
@@ -7174,12 +7327,12 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7174
7327
|
tooltipData.push(pointA.y);
|
|
7175
7328
|
|
|
7176
7329
|
if (typeof pointA.x.value.getTime !== 'undefined') {
|
|
7177
|
-
tooltipTitle = d3.timeFormat(
|
|
7330
|
+
tooltipTitle = d3.timeFormat(_this42.options.dateFormat || _this42.options.calculatedTimeFormatPattern)(pointA.x.value);
|
|
7178
7331
|
}
|
|
7179
7332
|
}
|
|
7180
7333
|
|
|
7181
7334
|
if (pointB && !pointA) {
|
|
7182
|
-
xPoint =
|
|
7335
|
+
xPoint = _this42[xAxis](_this42.parseX(pointB.x.value));
|
|
7183
7336
|
tooltipTitle = pointB.x.value;
|
|
7184
7337
|
|
|
7185
7338
|
if (!pointB.y.color) {
|
|
@@ -7189,14 +7342,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7189
7342
|
tooltipData.push(pointB.y);
|
|
7190
7343
|
|
|
7191
7344
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7192
|
-
tooltipTitle = d3.timeFormat(
|
|
7345
|
+
tooltipTitle = d3.timeFormat(_this42.options.dateFormat || _this42.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7193
7346
|
}
|
|
7194
7347
|
}
|
|
7195
7348
|
|
|
7196
7349
|
if (pointA && pointB) {
|
|
7197
|
-
var d0 =
|
|
7350
|
+
var d0 = _this42[xAxis](_this42.parseX(pointA.x.value));
|
|
7198
7351
|
|
|
7199
|
-
var d1 =
|
|
7352
|
+
var d1 = _this42[xAxis](_this42.parseX(pointB.x.value));
|
|
7200
7353
|
|
|
7201
7354
|
var mid = Math.abs(d0 - d1) / 2;
|
|
7202
7355
|
|
|
@@ -7205,7 +7358,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7205
7358
|
tooltipTitle = pointB.x.value;
|
|
7206
7359
|
|
|
7207
7360
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7208
|
-
tooltipTitle = d3.timeFormat(
|
|
7361
|
+
tooltipTitle = d3.timeFormat(_this42.options.dateFormat || _this42.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7209
7362
|
}
|
|
7210
7363
|
|
|
7211
7364
|
if (!pointB.y.color) {
|
|
@@ -7218,7 +7371,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7218
7371
|
tooltipTitle = pointA.x.value;
|
|
7219
7372
|
|
|
7220
7373
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7221
|
-
tooltipTitle = d3.timeFormat(
|
|
7374
|
+
tooltipTitle = d3.timeFormat(_this42.options.dateFormat || _this42.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7222
7375
|
}
|
|
7223
7376
|
|
|
7224
7377
|
if (!pointA.y.color) {
|
|
@@ -7323,7 +7476,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7323
7476
|
}, {
|
|
7324
7477
|
key: "render",
|
|
7325
7478
|
value: function render(options) {
|
|
7326
|
-
var
|
|
7479
|
+
var _this43 = this;
|
|
7327
7480
|
|
|
7328
7481
|
/* global d3 options WebsyUtils */
|
|
7329
7482
|
if (typeof options !== 'undefined') {
|
|
@@ -7392,7 +7545,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7392
7545
|
var legendData = this.options.data.series.map(function (s, i) {
|
|
7393
7546
|
return {
|
|
7394
7547
|
value: s.label || s.key,
|
|
7395
|
-
color: s.color ||
|
|
7548
|
+
color: s.color || _this43.options.colors[i % _this43.options.colors.length]
|
|
7396
7549
|
};
|
|
7397
7550
|
});
|
|
7398
7551
|
|
|
@@ -7452,6 +7605,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7452
7605
|
|
|
7453
7606
|
if (this.options.data.bottom.formatter) {
|
|
7454
7607
|
this.longestBottom = this.options.data.bottom.formatter(this.options.data.bottom.max).toString();
|
|
7608
|
+
} else {
|
|
7609
|
+
this.longestBottom = '01/01/2000';
|
|
7455
7610
|
}
|
|
7456
7611
|
}
|
|
7457
7612
|
|
|
@@ -7644,7 +7799,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7644
7799
|
|
|
7645
7800
|
if (this.options.data.bottom.formatter) {
|
|
7646
7801
|
bAxisFunc.tickFormat(function (d) {
|
|
7647
|
-
return
|
|
7802
|
+
return _this43.options.data.bottom.formatter(d);
|
|
7648
7803
|
});
|
|
7649
7804
|
}
|
|
7650
7805
|
|
|
@@ -7670,8 +7825,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7670
7825
|
|
|
7671
7826
|
if (this.options.margin.axisLeft > 0) {
|
|
7672
7827
|
this.leftAxisLayer.call(d3.axisLeft(this.leftAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
7673
|
-
if (
|
|
7674
|
-
d =
|
|
7828
|
+
if (_this43.options.data.left.formatter) {
|
|
7829
|
+
d = _this43.options.data.left.formatter(d);
|
|
7675
7830
|
}
|
|
7676
7831
|
|
|
7677
7832
|
return d;
|
|
@@ -7708,8 +7863,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7708
7863
|
|
|
7709
7864
|
if (this.options.margin.axisRight > 0 && (this.options.data.right.min !== 0 || this.options.data.right.max !== 0)) {
|
|
7710
7865
|
this.rightAxisLayer.call(d3.axisRight(this.rightAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
7711
|
-
if (
|
|
7712
|
-
d =
|
|
7866
|
+
if (_this43.options.data.right.formatter) {
|
|
7867
|
+
d = _this43.options.data.right.formatter(d);
|
|
7713
7868
|
}
|
|
7714
7869
|
|
|
7715
7870
|
return d;
|
|
@@ -7735,16 +7890,16 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7735
7890
|
|
|
7736
7891
|
this.options.data.series.forEach(function (series, index) {
|
|
7737
7892
|
if (!series.key) {
|
|
7738
|
-
series.key =
|
|
7893
|
+
series.key = _this43.createIdentity();
|
|
7739
7894
|
}
|
|
7740
7895
|
|
|
7741
7896
|
if (!series.color) {
|
|
7742
|
-
series.color =
|
|
7897
|
+
series.color = _this43.options.colors[index % _this43.options.colors.length];
|
|
7743
7898
|
}
|
|
7744
7899
|
|
|
7745
|
-
|
|
7900
|
+
_this43["render".concat(series.type || 'bar')](series, index);
|
|
7746
7901
|
|
|
7747
|
-
|
|
7902
|
+
_this43.renderLabels(series, index);
|
|
7748
7903
|
});
|
|
7749
7904
|
}
|
|
7750
7905
|
}
|
|
@@ -7752,17 +7907,17 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7752
7907
|
}, {
|
|
7753
7908
|
key: "renderarea",
|
|
7754
7909
|
value: function renderarea(series, index) {
|
|
7755
|
-
var
|
|
7910
|
+
var _this44 = this;
|
|
7756
7911
|
|
|
7757
7912
|
/* global d3 series index */
|
|
7758
7913
|
var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
|
|
7759
7914
|
return d3.area().x(function (d) {
|
|
7760
|
-
return
|
|
7915
|
+
return _this44[xAxis](_this44.parseX(d.x.value));
|
|
7761
7916
|
}).y0(function (d) {
|
|
7762
|
-
return
|
|
7917
|
+
return _this44[yAxis](0);
|
|
7763
7918
|
}).y1(function (d) {
|
|
7764
|
-
return
|
|
7765
|
-
}).curve(d3[curveStyle ||
|
|
7919
|
+
return _this44[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
|
|
7920
|
+
}).curve(d3[curveStyle || _this44.options.curveStyle]);
|
|
7766
7921
|
};
|
|
7767
7922
|
|
|
7768
7923
|
var xAxis = 'bottomAxis';
|
|
@@ -7878,7 +8033,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7878
8033
|
}, {
|
|
7879
8034
|
key: "renderLabels",
|
|
7880
8035
|
value: function renderLabels(series, index) {
|
|
7881
|
-
var
|
|
8036
|
+
var _this45 = this;
|
|
7882
8037
|
|
|
7883
8038
|
/* global series index d3 WebsyDesigns */
|
|
7884
8039
|
var xAxis = 'bottomAxis';
|
|
@@ -7896,8 +8051,12 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7896
8051
|
// We currently only support 'Auto'
|
|
7897
8052
|
var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
|
|
7898
8053
|
labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
|
|
7899
|
-
labels.attr('x',
|
|
7900
|
-
return
|
|
8054
|
+
labels.attr('x', function (d) {
|
|
8055
|
+
return getLabelX.call(_this45, d, series.labelPosition);
|
|
8056
|
+
}).attr('y', function (d) {
|
|
8057
|
+
return getLabelY.call(_this45, d, series.labelPosition);
|
|
8058
|
+
}).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
|
|
8059
|
+
return _this45.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
7901
8060
|
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
|
|
7902
8061
|
return d.y.label || d.y.value;
|
|
7903
8062
|
}).each(function (d, i) {
|
|
@@ -7921,8 +8080,12 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7921
8080
|
}
|
|
7922
8081
|
}
|
|
7923
8082
|
});
|
|
7924
|
-
labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x',
|
|
7925
|
-
return
|
|
8083
|
+
labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', function (d) {
|
|
8084
|
+
return getLabelX.call(_this45, d, series.labelPosition);
|
|
8085
|
+
}).attr('y', function (d) {
|
|
8086
|
+
return getLabelY.call(_this45, d, series.labelPosition);
|
|
8087
|
+
}).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
|
|
8088
|
+
return _this45.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
7926
8089
|
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).text(function (d) {
|
|
7927
8090
|
return d.y.label || d.y.value;
|
|
7928
8091
|
}).each(function (d, i) {
|
|
@@ -7979,15 +8142,15 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7979
8142
|
}, {
|
|
7980
8143
|
key: "renderline",
|
|
7981
8144
|
value: function renderline(series, index) {
|
|
7982
|
-
var
|
|
8145
|
+
var _this46 = this;
|
|
7983
8146
|
|
|
7984
8147
|
/* global series index d3 */
|
|
7985
8148
|
var drawLine = function drawLine(xAxis, yAxis, curveStyle) {
|
|
7986
8149
|
return d3.line().x(function (d) {
|
|
7987
|
-
return
|
|
8150
|
+
return _this46[xAxis](_this46.parseX(d.x.value));
|
|
7988
8151
|
}).y(function (d) {
|
|
7989
|
-
return
|
|
7990
|
-
}).curve(d3[curveStyle ||
|
|
8152
|
+
return _this46[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
|
|
8153
|
+
}).curve(d3[curveStyle || _this46.options.curveStyle]);
|
|
7991
8154
|
};
|
|
7992
8155
|
|
|
7993
8156
|
var xAxis = 'bottomAxis';
|
|
@@ -8025,14 +8188,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8025
8188
|
}, {
|
|
8026
8189
|
key: "rendersymbol",
|
|
8027
8190
|
value: function rendersymbol(series, index) {
|
|
8028
|
-
var
|
|
8191
|
+
var _this47 = this;
|
|
8029
8192
|
|
|
8030
8193
|
/* global d3 series index series.key */
|
|
8031
8194
|
var drawSymbol = function drawSymbol(size) {
|
|
8032
8195
|
return d3.symbol() // .type(d => {
|
|
8033
8196
|
// return d3.symbols[0]
|
|
8034
8197
|
// })
|
|
8035
|
-
.size(size ||
|
|
8198
|
+
.size(size || _this47.options.symbolSize);
|
|
8036
8199
|
};
|
|
8037
8200
|
|
|
8038
8201
|
var xAxis = 'bottomAxis';
|
|
@@ -8050,7 +8213,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8050
8213
|
symbols.attr('d', function (d) {
|
|
8051
8214
|
return drawSymbol(d.y.size || series.symbolSize)(d);
|
|
8052
8215
|
}).transition(this.transition).attr('fill', 'white').attr('stroke', series.color).attr('transform', function (d) {
|
|
8053
|
-
return "translate(".concat(
|
|
8216
|
+
return "translate(".concat(_this47[xAxis](_this47.parseX(d.x.value)), ", ").concat(_this47[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
8054
8217
|
}); // Enter
|
|
8055
8218
|
|
|
8056
8219
|
symbols.enter().append('path').attr('d', function (d) {
|
|
@@ -8059,7 +8222,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8059
8222
|
.attr('fill', 'white').attr('stroke', series.color).attr('class', function (d) {
|
|
8060
8223
|
return "symbol symbol_".concat(series.key);
|
|
8061
8224
|
}).attr('transform', function (d) {
|
|
8062
|
-
return "translate(".concat(
|
|
8225
|
+
return "translate(".concat(_this47[xAxis](_this47.parseX(d.x.value)), ", ").concat(_this47[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
8063
8226
|
});
|
|
8064
8227
|
}
|
|
8065
8228
|
}, {
|
|
@@ -8214,7 +8377,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
8214
8377
|
}, {
|
|
8215
8378
|
key: "resize",
|
|
8216
8379
|
value: function resize() {
|
|
8217
|
-
var
|
|
8380
|
+
var _this48 = this;
|
|
8218
8381
|
|
|
8219
8382
|
var el = document.getElementById(this.elementId);
|
|
8220
8383
|
|
|
@@ -8227,7 +8390,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
8227
8390
|
// }
|
|
8228
8391
|
var html = "\n <div class='text-".concat(this.options.align, "'>\n ");
|
|
8229
8392
|
html += this._data.map(function (d, i) {
|
|
8230
|
-
return
|
|
8393
|
+
return _this48.getLegendItemHTML(d);
|
|
8231
8394
|
}).join('');
|
|
8232
8395
|
html += "\n <div>\n ";
|
|
8233
8396
|
el.innerHTML = html;
|
|
@@ -8399,7 +8562,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8399
8562
|
}, {
|
|
8400
8563
|
key: "render",
|
|
8401
8564
|
value: function render() {
|
|
8402
|
-
var
|
|
8565
|
+
var _this49 = this;
|
|
8403
8566
|
|
|
8404
8567
|
var mapEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
8405
8568
|
var legendEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
@@ -8408,7 +8571,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8408
8571
|
var legendData = this.options.data.polygons.map(function (s, i) {
|
|
8409
8572
|
return {
|
|
8410
8573
|
value: s.label || s.key,
|
|
8411
|
-
color: s.color ||
|
|
8574
|
+
color: s.color || _this49.options.colors[i % _this49.options.colors.length]
|
|
8412
8575
|
};
|
|
8413
8576
|
});
|
|
8414
8577
|
var longestValue = legendData.map(function (s) {
|
|
@@ -8472,7 +8635,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8472
8635
|
|
|
8473
8636
|
if (this.polygons) {
|
|
8474
8637
|
this.polygons.forEach(function (p) {
|
|
8475
|
-
return
|
|
8638
|
+
return _this49.map.removeLayer(p);
|
|
8476
8639
|
});
|
|
8477
8640
|
}
|
|
8478
8641
|
|
|
@@ -8530,18 +8693,18 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8530
8693
|
}
|
|
8531
8694
|
|
|
8532
8695
|
if (!p.options.color) {
|
|
8533
|
-
p.options.color =
|
|
8696
|
+
p.options.color = _this49.options.colors[i % _this49.options.colors.length];
|
|
8534
8697
|
}
|
|
8535
8698
|
|
|
8536
8699
|
var pol = L.polygon(p.data.map(function (c) {
|
|
8537
8700
|
return c.map(function (d) {
|
|
8538
8701
|
return [d.Latitude, d.Longitude];
|
|
8539
8702
|
});
|
|
8540
|
-
}), p.options).addTo(
|
|
8703
|
+
}), p.options).addTo(_this49.map);
|
|
8541
8704
|
|
|
8542
|
-
|
|
8705
|
+
_this49.polygons.push(pol);
|
|
8543
8706
|
|
|
8544
|
-
|
|
8707
|
+
_this49.map.fitBounds(pol.getBounds());
|
|
8545
8708
|
});
|
|
8546
8709
|
} // if (this.data.markers.length > 0) {
|
|
8547
8710
|
// el.classList.remove('hidden')
|