@websy/websy-designs 1.2.18 → 1.2.20
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/routes/v1/pdf.js +1 -1
- package/dist/websy-designs-es6.debug.js +32 -7
- package/dist/websy-designs-es6.js +220 -193
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +32 -7
- package/dist/websy-designs.js +220 -193
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
|
@@ -1053,24 +1053,51 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
}, {
|
|
1055
1055
|
key: "selectCustomRange",
|
|
1056
|
-
value: function selectCustomRange(
|
|
1057
|
-
var
|
|
1056
|
+
value: function selectCustomRange(rangeInput) {
|
|
1057
|
+
var _this6 = this;
|
|
1058
|
+
|
|
1058
1059
|
this.selectedRange = -1;
|
|
1059
|
-
|
|
1060
|
+
var isContinuousRange = true;
|
|
1061
|
+
|
|
1062
|
+
if (rangeInput.length === 1) {
|
|
1063
|
+
this.selectedRangeDates = _toConsumableArray(rangeInput);
|
|
1064
|
+
this.customRangeSelected = _toConsumableArray(rangeInput);
|
|
1065
|
+
} else if (rangeInput.length === 2) {
|
|
1066
|
+
this.selectedRangeDates = _toConsumableArray(rangeInput);
|
|
1067
|
+
this.customRangeSelected = _toConsumableArray(rangeInput);
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
rangeInput.forEach(function (r, i) {
|
|
1071
|
+
if (i > 0) {
|
|
1072
|
+
if (_this6.options.mode === 'date' || _this6.options.mode === 'monthyear') {
|
|
1073
|
+
if (r.getTime() / _this6.oneDay - rangeInput[i - 1] / _this6.oneDay > 1) {
|
|
1074
|
+
isContinuousRange = false;
|
|
1075
|
+
}
|
|
1076
|
+
} else if (_this6.options.mode === 'hour' || _this6.options.mode === 'year') {
|
|
1077
|
+
if (r - rangeInput[i - 1] > 1) {
|
|
1078
|
+
isContinuousRange = false;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
});
|
|
1083
|
+
|
|
1084
|
+
if (rangeInput.length > 2 && isContinuousRange === true) {
|
|
1085
|
+
this.selectedRangeDates = [rangeInput[0], rangeInput[rangeInput.length - 1]];
|
|
1086
|
+
}
|
|
1060
1087
|
|
|
1061
|
-
if (
|
|
1088
|
+
if (isContinuousRange === false) {
|
|
1062
1089
|
this.currentselection = [];
|
|
1063
1090
|
} // check if the custom range matches a configured range
|
|
1064
1091
|
|
|
1065
1092
|
|
|
1066
1093
|
for (var i = 0; i < this.options.ranges[this.options.mode].length; i++) {
|
|
1067
1094
|
if (this.options.ranges[this.options.mode][i].range.length === 1) {
|
|
1068
|
-
if (this.options.ranges[this.options.mode][i].range[0] ===
|
|
1095
|
+
if (this.options.ranges[this.options.mode][i].range[0] === rangeInput[0]) {
|
|
1069
1096
|
this.selectedRange = i;
|
|
1070
1097
|
break;
|
|
1071
1098
|
}
|
|
1072
1099
|
} else if (this.options.ranges[this.options.mode][i].range.length === 2) {
|
|
1073
|
-
if (this.options.ranges[this.options.mode][i].range[0] ===
|
|
1100
|
+
if (this.options.ranges[this.options.mode][i].range[0] === rangeInput[0] && this.options.ranges[this.options.mode][i].range[1] === rangeInput[1]) {
|
|
1074
1101
|
this.selectedRange = i;
|
|
1075
1102
|
break;
|
|
1076
1103
|
}
|
|
@@ -1104,27 +1131,27 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1104
1131
|
}, {
|
|
1105
1132
|
key: "updateRange",
|
|
1106
1133
|
value: function updateRange() {
|
|
1107
|
-
var
|
|
1134
|
+
var _this7 = this;
|
|
1108
1135
|
|
|
1109
1136
|
var range;
|
|
1110
1137
|
|
|
1111
1138
|
if (this.selectedRange === -1) {
|
|
1112
1139
|
var list = (this.currentselection.length > 0 ? this.currentselection : this.selectedRangeDates).map(function (d) {
|
|
1113
|
-
if (
|
|
1140
|
+
if (_this7.options.mode === 'date') {
|
|
1114
1141
|
if (!d.toLocaleDateString) {
|
|
1115
1142
|
d = new Date(d);
|
|
1116
1143
|
}
|
|
1117
1144
|
|
|
1118
1145
|
return d.toLocaleDateString();
|
|
1119
|
-
} else if (
|
|
1146
|
+
} else if (_this7.options.mode === 'year') {
|
|
1120
1147
|
return d;
|
|
1121
|
-
} else if (
|
|
1148
|
+
} else if (_this7.options.mode === 'monthyear') {
|
|
1122
1149
|
if (!d.getMonth) {
|
|
1123
1150
|
d = new Date(d);
|
|
1124
1151
|
}
|
|
1125
1152
|
|
|
1126
|
-
return "".concat(
|
|
1127
|
-
} else if (
|
|
1153
|
+
return "".concat(_this7.options.monthMap[d.getMonth()], " ").concat(d.getFullYear());
|
|
1154
|
+
} else if (_this7.options.mode === 'hour') {
|
|
1128
1155
|
return d;
|
|
1129
1156
|
}
|
|
1130
1157
|
});
|
|
@@ -1184,7 +1211,7 @@ Date.prototype.floor = function () {
|
|
|
1184
1211
|
|
|
1185
1212
|
var WebsyDropdown = /*#__PURE__*/function () {
|
|
1186
1213
|
function WebsyDropdown(elementId, options) {
|
|
1187
|
-
var
|
|
1214
|
+
var _this8 = this;
|
|
1188
1215
|
|
|
1189
1216
|
_classCallCheck(this, WebsyDropdown);
|
|
1190
1217
|
|
|
@@ -1228,10 +1255,10 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1228
1255
|
el.addEventListener('mouseout', this.handleMouseOut.bind(this));
|
|
1229
1256
|
el.addEventListener('mousemove', this.handleMouseMove.bind(this));
|
|
1230
1257
|
var headerLabel = this.selectedItems.map(function (s) {
|
|
1231
|
-
return
|
|
1258
|
+
return _this8.options.items[s].label || _this8.options.items[s].value;
|
|
1232
1259
|
}).join(this.options.multiValueDelimiter);
|
|
1233
1260
|
var headerValue = this.selectedItems.map(function (s) {
|
|
1234
|
-
return
|
|
1261
|
+
return _this8.options.items[s].value || _this8.options.items[s].label;
|
|
1235
1262
|
}).join(this.options.multiValueDelimiter);
|
|
1236
1263
|
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 <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>\n <span id='").concat(this.elementId, "_headerLabel' class='websy-dropdown-header-label'>").concat(this.options.label, "</span>\n <span data-info='").concat(headerLabel, "' class='websy-dropdown-header-value' id='").concat(this.elementId, "_selectedItems'>").concat(headerLabel, "</span>\n <input class='dropdown-input' id='").concat(this.elementId, "_input' name='").concat(this.options.field || this.options.label, "' value='").concat(headerValue, "'>\n <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> \n ");
|
|
1237
1264
|
|
|
@@ -1514,10 +1541,10 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1514
1541
|
}, {
|
|
1515
1542
|
key: "renderItems",
|
|
1516
1543
|
value: function renderItems() {
|
|
1517
|
-
var
|
|
1544
|
+
var _this9 = this;
|
|
1518
1545
|
|
|
1519
1546
|
var html = this.options.items.map(function (r, i) {
|
|
1520
|
-
return "\n <li data-index='".concat(r.index, "' class='websy-dropdown-item ").concat((r.classes || []).join(' '), " ").concat(
|
|
1547
|
+
return "\n <li data-index='".concat(r.index, "' class='websy-dropdown-item ").concat((r.classes || []).join(' '), " ").concat(_this9.selectedItems.indexOf(r.index) !== -1 ? 'active' : '', "'>").concat(r.label, "</li>\n ");
|
|
1521
1548
|
}).join('');
|
|
1522
1549
|
var el = document.getElementById("".concat(this.elementId, "_items"));
|
|
1523
1550
|
|
|
@@ -1536,7 +1563,7 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1536
1563
|
}, {
|
|
1537
1564
|
key: "updateHeader",
|
|
1538
1565
|
value: function updateHeader(item) {
|
|
1539
|
-
var
|
|
1566
|
+
var _this10 = this;
|
|
1540
1567
|
|
|
1541
1568
|
var el = document.getElementById(this.elementId);
|
|
1542
1569
|
var headerEl = document.getElementById("".concat(this.elementId, "_header"));
|
|
@@ -1583,17 +1610,17 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1583
1610
|
} else if (this.selectedItems.length > 1) {
|
|
1584
1611
|
if (this.options.showCompleteSelectedList === true) {
|
|
1585
1612
|
var selectedLabels = this.selectedItems.map(function (s) {
|
|
1586
|
-
return
|
|
1613
|
+
return _this10.options.items[s].label || _this10.options.items[s].value;
|
|
1587
1614
|
}).join(this.options.multiValueDelimiter);
|
|
1588
1615
|
var selectedValues = this.selectedItems.map(function (s) {
|
|
1589
|
-
return
|
|
1616
|
+
return _this10.options.items[s].value || _this10.options.items[s].label;
|
|
1590
1617
|
}).join(this.options.multiValueDelimiter);
|
|
1591
1618
|
labelEl.innerHTML = selectedLabels;
|
|
1592
1619
|
labelEl.setAttribute('data-info', selectedLabels);
|
|
1593
1620
|
inputEl.value = selectedValues;
|
|
1594
1621
|
} else {
|
|
1595
1622
|
var _selectedValues = this.selectedItems.map(function (s) {
|
|
1596
|
-
return
|
|
1623
|
+
return _this10.options.items[s].value || _this10.options.items[s].label;
|
|
1597
1624
|
}).join(this.options.multiValueDelimiter);
|
|
1598
1625
|
|
|
1599
1626
|
labelEl.innerHTML = "".concat(this.selectedItems.length, " selected");
|
|
@@ -1730,16 +1757,16 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
1730
1757
|
}, {
|
|
1731
1758
|
key: "checkRecaptcha",
|
|
1732
1759
|
value: function checkRecaptcha() {
|
|
1733
|
-
var
|
|
1760
|
+
var _this11 = this;
|
|
1734
1761
|
|
|
1735
1762
|
return new Promise(function (resolve, reject) {
|
|
1736
|
-
if (
|
|
1763
|
+
if (_this11.options.useRecaptcha === true) {
|
|
1737
1764
|
// if (this.recaptchaValue) {
|
|
1738
1765
|
grecaptcha.ready(function () {
|
|
1739
1766
|
grecaptcha.execute(ENVIRONMENT.RECAPTCHA_KEY, {
|
|
1740
1767
|
action: 'submit'
|
|
1741
1768
|
}).then(function (token) {
|
|
1742
|
-
|
|
1769
|
+
_this11.apiService.add('google/checkrecaptcha', {
|
|
1743
1770
|
grecaptcharesponse: token
|
|
1744
1771
|
}).then(function (response) {
|
|
1745
1772
|
if (response.success && response.success === true) {
|
|
@@ -1802,14 +1829,14 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
1802
1829
|
}, {
|
|
1803
1830
|
key: "processComponents",
|
|
1804
1831
|
value: function processComponents(components, callbackFn) {
|
|
1805
|
-
var
|
|
1832
|
+
var _this12 = this;
|
|
1806
1833
|
|
|
1807
1834
|
if (components.length === 0) {
|
|
1808
1835
|
callbackFn();
|
|
1809
1836
|
} else {
|
|
1810
1837
|
components.forEach(function (c) {
|
|
1811
1838
|
if (typeof WebsyDesigns[c.component] !== 'undefined') {
|
|
1812
|
-
c.instance = new WebsyDesigns[c.component]("".concat(
|
|
1839
|
+
c.instance = new WebsyDesigns[c.component]("".concat(_this12.elementId, "_input_").concat(c.field, "_component"), c.options);
|
|
1813
1840
|
} else {// some user feedback here
|
|
1814
1841
|
}
|
|
1815
1842
|
});
|
|
@@ -1830,7 +1857,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
1830
1857
|
}, {
|
|
1831
1858
|
key: "render",
|
|
1832
1859
|
value: function render(update, data) {
|
|
1833
|
-
var
|
|
1860
|
+
var _this13 = this;
|
|
1834
1861
|
|
|
1835
1862
|
var el = document.getElementById(this.elementId);
|
|
1836
1863
|
var componentsToProcess = [];
|
|
@@ -1840,11 +1867,11 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
1840
1867
|
this.options.fields.forEach(function (f, i) {
|
|
1841
1868
|
if (f.component) {
|
|
1842
1869
|
componentsToProcess.push(f);
|
|
1843
|
-
html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <div id='").concat(
|
|
1870
|
+
html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <div id='").concat(_this13.elementId, "_input_").concat(f.field, "_component' class='form-component'></div>\n </div><!--\n ");
|
|
1844
1871
|
} else if (f.type === 'longtext') {
|
|
1845
|
-
html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <textarea\n id=\"").concat(
|
|
1872
|
+
html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <textarea\n id=\"").concat(_this13.elementId, "_input_").concat(f.field, "\"\n ").concat(f.required === true ? 'required' : '', " \n placeholder=\"").concat(f.placeholder || '', "\"\n name=\"").concat(f.field, "\" \n ").concat((f.attributes || []).join(' '), "\n class=\"websy-input websy-textarea\"\n ></textarea>\n </div><!--\n ");
|
|
1846
1873
|
} else {
|
|
1847
|
-
html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <input \n id=\"").concat(
|
|
1874
|
+
html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <input \n id=\"").concat(_this13.elementId, "_input_").concat(f.field, "\"\n ").concat(f.required === true ? 'required' : '', " \n type=\"").concat(f.type || 'text', "\" \n class=\"websy-input\" \n ").concat((f.attributes || []).join(' '), "\n name=\"").concat(f.field, "\" \n placeholder=\"").concat(f.placeholder || '', "\"\n value=\"").concat(f.value || '', "\"\n valueAsDate=\"").concat(f.type === 'date' ? f.value : '', "\"\n oninvalidx=\"this.setCustomValidity('").concat(f.invalidMessage || 'Please fill in this field.', "')\"\n />\n </div><!--\n ");
|
|
1848
1875
|
}
|
|
1849
1876
|
});
|
|
1850
1877
|
html += "\n --><button class=\"websy-btn submit ".concat(this.options.submit.classes || '', "\">").concat(this.options.submit.text || 'Save', "</button>").concat(this.options.cancel ? '<!--' : '', "\n ");
|
|
@@ -1861,7 +1888,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
1861
1888
|
|
|
1862
1889
|
el.innerHTML = html;
|
|
1863
1890
|
this.processComponents(componentsToProcess, function () {
|
|
1864
|
-
if (
|
|
1891
|
+
if (_this13.options.useRecaptcha === true && typeof grecaptcha !== 'undefined') {// this.recaptchaReady()
|
|
1865
1892
|
}
|
|
1866
1893
|
});
|
|
1867
1894
|
}
|
|
@@ -1869,7 +1896,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
1869
1896
|
}, {
|
|
1870
1897
|
key: "submitForm",
|
|
1871
1898
|
value: function submitForm() {
|
|
1872
|
-
var
|
|
1899
|
+
var _this14 = this;
|
|
1873
1900
|
|
|
1874
1901
|
var formEl = document.getElementById("".concat(this.elementId, "Form"));
|
|
1875
1902
|
|
|
@@ -1883,32 +1910,32 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
1883
1910
|
data[key] = value;
|
|
1884
1911
|
});
|
|
1885
1912
|
|
|
1886
|
-
if (
|
|
1887
|
-
var
|
|
1913
|
+
if (_this14.options.url) {
|
|
1914
|
+
var _this14$apiService;
|
|
1888
1915
|
|
|
1889
|
-
var params = [
|
|
1916
|
+
var params = [_this14.options.url];
|
|
1890
1917
|
|
|
1891
|
-
if (
|
|
1892
|
-
params.push(
|
|
1918
|
+
if (_this14.options.mode === 'update') {
|
|
1919
|
+
params.push(_this14.options.id);
|
|
1893
1920
|
}
|
|
1894
1921
|
|
|
1895
1922
|
params.push(data);
|
|
1896
1923
|
|
|
1897
|
-
(
|
|
1898
|
-
if (
|
|
1924
|
+
(_this14$apiService = _this14.apiService)[_this14.options.mode].apply(_this14$apiService, params).then(function (result) {
|
|
1925
|
+
if (_this14.options.clearAfterSave === true) {
|
|
1899
1926
|
// this.render()
|
|
1900
1927
|
formEl.reset();
|
|
1901
1928
|
}
|
|
1902
1929
|
|
|
1903
|
-
|
|
1930
|
+
_this14.options.onSuccess.call(_this14, result);
|
|
1904
1931
|
}, function (err) {
|
|
1905
1932
|
console.log('Error submitting form data:', err);
|
|
1906
1933
|
|
|
1907
|
-
|
|
1934
|
+
_this14.options.onError.call(_this14, err);
|
|
1908
1935
|
});
|
|
1909
|
-
} else if (
|
|
1910
|
-
|
|
1911
|
-
if (
|
|
1936
|
+
} else if (_this14.options.submitFn) {
|
|
1937
|
+
_this14.options.submitFn(data, function () {
|
|
1938
|
+
if (_this14.options.clearAfterSave === true) {
|
|
1912
1939
|
// this.render()
|
|
1913
1940
|
formEl.reset();
|
|
1914
1941
|
}
|
|
@@ -1928,17 +1955,17 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
1928
1955
|
}, {
|
|
1929
1956
|
key: "data",
|
|
1930
1957
|
set: function set(d) {
|
|
1931
|
-
var
|
|
1958
|
+
var _this15 = this;
|
|
1932
1959
|
|
|
1933
1960
|
if (!this.options.fields) {
|
|
1934
1961
|
this.options.fields = [];
|
|
1935
1962
|
}
|
|
1936
1963
|
|
|
1937
1964
|
var _loop = function _loop(key) {
|
|
1938
|
-
|
|
1965
|
+
_this15.options.fields.forEach(function (f) {
|
|
1939
1966
|
if (f.field === key) {
|
|
1940
1967
|
f.value = d[key];
|
|
1941
|
-
var el = document.getElementById("".concat(
|
|
1968
|
+
var el = document.getElementById("".concat(_this15.elementId, "_input_").concat(f.field));
|
|
1942
1969
|
el.value = f.value;
|
|
1943
1970
|
}
|
|
1944
1971
|
});
|
|
@@ -2250,7 +2277,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2250
2277
|
|
|
2251
2278
|
var Pager = /*#__PURE__*/function () {
|
|
2252
2279
|
function Pager(elementId, options) {
|
|
2253
|
-
var
|
|
2280
|
+
var _this16 = this;
|
|
2254
2281
|
|
|
2255
2282
|
_classCallCheck(this, Pager);
|
|
2256
2283
|
|
|
@@ -2303,8 +2330,8 @@ var Pager = /*#__PURE__*/function () {
|
|
|
2303
2330
|
allowClear: false,
|
|
2304
2331
|
disableSearch: true,
|
|
2305
2332
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
2306
|
-
if (
|
|
2307
|
-
|
|
2333
|
+
if (_this16.options.onChangePageSize) {
|
|
2334
|
+
_this16.options.onChangePageSize(selectedItem.value);
|
|
2308
2335
|
}
|
|
2309
2336
|
}
|
|
2310
2337
|
});
|
|
@@ -2328,13 +2355,13 @@ var Pager = /*#__PURE__*/function () {
|
|
|
2328
2355
|
}, {
|
|
2329
2356
|
key: "render",
|
|
2330
2357
|
value: function render() {
|
|
2331
|
-
var
|
|
2358
|
+
var _this17 = this;
|
|
2332
2359
|
|
|
2333
2360
|
var el = document.getElementById("".concat(this.elementId, "_pageList"));
|
|
2334
2361
|
|
|
2335
2362
|
if (el) {
|
|
2336
2363
|
var pages = this.options.pages.map(function (item, index) {
|
|
2337
|
-
return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
2364
|
+
return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(_this17.options.activePage === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
2338
2365
|
});
|
|
2339
2366
|
var startIndex = 0;
|
|
2340
2367
|
|
|
@@ -2402,58 +2429,58 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
2402
2429
|
_createClass(WebsyPDFButton, [{
|
|
2403
2430
|
key: "handleClick",
|
|
2404
2431
|
value: function handleClick(event) {
|
|
2405
|
-
var
|
|
2432
|
+
var _this18 = this;
|
|
2406
2433
|
|
|
2407
2434
|
if (event.target.classList.contains('websy-pdf-button')) {
|
|
2408
2435
|
this.loader.show();
|
|
2409
2436
|
setTimeout(function () {
|
|
2410
|
-
if (
|
|
2411
|
-
var el = document.getElementById(
|
|
2437
|
+
if (_this18.options.targetId) {
|
|
2438
|
+
var el = document.getElementById(_this18.options.targetId);
|
|
2412
2439
|
|
|
2413
2440
|
if (el) {
|
|
2414
2441
|
var pdfData = {
|
|
2415
2442
|
options: {}
|
|
2416
2443
|
};
|
|
2417
2444
|
|
|
2418
|
-
if (
|
|
2419
|
-
pdfData.options = _extends({},
|
|
2445
|
+
if (_this18.options.pdfOptions) {
|
|
2446
|
+
pdfData.options = _extends({}, _this18.options.pdfOptions);
|
|
2420
2447
|
}
|
|
2421
2448
|
|
|
2422
|
-
if (
|
|
2423
|
-
if (
|
|
2424
|
-
var headerEl = document.getElementById(
|
|
2449
|
+
if (_this18.options.header) {
|
|
2450
|
+
if (_this18.options.header.elementId) {
|
|
2451
|
+
var headerEl = document.getElementById(_this18.options.header.elementId);
|
|
2425
2452
|
|
|
2426
2453
|
if (headerEl) {
|
|
2427
2454
|
pdfData.header = headerEl.outerHTML;
|
|
2428
2455
|
|
|
2429
|
-
if (
|
|
2430
|
-
pdfData.options.headerCSS =
|
|
2456
|
+
if (_this18.options.header.css) {
|
|
2457
|
+
pdfData.options.headerCSS = _this18.options.header.css;
|
|
2431
2458
|
}
|
|
2432
2459
|
}
|
|
2433
|
-
} else if (
|
|
2434
|
-
pdfData.header =
|
|
2460
|
+
} else if (_this18.options.header.html) {
|
|
2461
|
+
pdfData.header = _this18.options.header.html;
|
|
2435
2462
|
|
|
2436
|
-
if (
|
|
2437
|
-
pdfData.options.headerCSS =
|
|
2463
|
+
if (_this18.options.header.css) {
|
|
2464
|
+
pdfData.options.headerCSS = _this18.options.header.css;
|
|
2438
2465
|
}
|
|
2439
2466
|
} else {
|
|
2440
|
-
pdfData.header =
|
|
2467
|
+
pdfData.header = _this18.options.header;
|
|
2441
2468
|
}
|
|
2442
2469
|
}
|
|
2443
2470
|
|
|
2444
|
-
if (
|
|
2445
|
-
if (
|
|
2446
|
-
var footerEl = document.getElementById(
|
|
2471
|
+
if (_this18.options.footer) {
|
|
2472
|
+
if (_this18.options.footer.elementId) {
|
|
2473
|
+
var footerEl = document.getElementById(_this18.options.footer.elementId);
|
|
2447
2474
|
|
|
2448
2475
|
if (footerEl) {
|
|
2449
2476
|
pdfData.footer = footerEl.outerHTML;
|
|
2450
2477
|
|
|
2451
|
-
if (
|
|
2452
|
-
pdfData.options.footerCSS =
|
|
2478
|
+
if (_this18.options.footer.css) {
|
|
2479
|
+
pdfData.options.footerCSS = _this18.options.footer.css;
|
|
2453
2480
|
}
|
|
2454
2481
|
}
|
|
2455
2482
|
} else {
|
|
2456
|
-
pdfData.footer =
|
|
2483
|
+
pdfData.footer = _this18.options.footer;
|
|
2457
2484
|
}
|
|
2458
2485
|
}
|
|
2459
2486
|
|
|
@@ -2462,31 +2489,31 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
2462
2489
|
// document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
|
|
2463
2490
|
// document.getElementById(`${this.elementId}_form`).submit()
|
|
2464
2491
|
|
|
2465
|
-
|
|
2492
|
+
_this18.service.add('', pdfData, {
|
|
2466
2493
|
responseType: 'blob'
|
|
2467
2494
|
}).then(function (response) {
|
|
2468
|
-
|
|
2495
|
+
_this18.loader.hide();
|
|
2469
2496
|
|
|
2470
2497
|
var blob = new Blob([response], {
|
|
2471
2498
|
type: 'application/pdf'
|
|
2472
2499
|
});
|
|
2473
2500
|
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 ");
|
|
2474
2501
|
|
|
2475
|
-
if (
|
|
2502
|
+
if (_this18.options.directDownload === true) {
|
|
2476
2503
|
var fileName;
|
|
2477
2504
|
|
|
2478
|
-
if (typeof
|
|
2479
|
-
fileName =
|
|
2505
|
+
if (typeof _this18.options.fileName === 'function') {
|
|
2506
|
+
fileName = _this18.options.fileName() || 'Export';
|
|
2480
2507
|
} else {
|
|
2481
|
-
fileName =
|
|
2508
|
+
fileName = _this18.options.fileName || 'Export';
|
|
2482
2509
|
}
|
|
2483
2510
|
|
|
2484
2511
|
msg += "download='".concat(fileName, ".pdf'");
|
|
2485
2512
|
}
|
|
2486
2513
|
|
|
2487
|
-
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(
|
|
2514
|
+
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this18.options.buttonText, "</button>\n </a>\n </div>\n ");
|
|
2488
2515
|
|
|
2489
|
-
|
|
2516
|
+
_this18.popup.show({
|
|
2490
2517
|
message: msg,
|
|
2491
2518
|
mask: true
|
|
2492
2519
|
});
|
|
@@ -2671,7 +2698,7 @@ var WebsyPubSub = /*#__PURE__*/function () {
|
|
|
2671
2698
|
|
|
2672
2699
|
var ResponsiveText = /*#__PURE__*/function () {
|
|
2673
2700
|
function ResponsiveText(elementId, options) {
|
|
2674
|
-
var
|
|
2701
|
+
var _this19 = this;
|
|
2675
2702
|
|
|
2676
2703
|
_classCallCheck(this, ResponsiveText);
|
|
2677
2704
|
|
|
@@ -2684,7 +2711,7 @@ var ResponsiveText = /*#__PURE__*/function () {
|
|
|
2684
2711
|
this.elementId = elementId;
|
|
2685
2712
|
this.canvas = document.createElement('canvas');
|
|
2686
2713
|
window.addEventListener('resize', function () {
|
|
2687
|
-
return
|
|
2714
|
+
return _this19.render();
|
|
2688
2715
|
});
|
|
2689
2716
|
var el = document.getElementById(this.elementId);
|
|
2690
2717
|
|
|
@@ -2903,7 +2930,7 @@ var ResponsiveText = /*#__PURE__*/function () {
|
|
|
2903
2930
|
|
|
2904
2931
|
var WebsyResultList = /*#__PURE__*/function () {
|
|
2905
2932
|
function WebsyResultList(elementId, options) {
|
|
2906
|
-
var
|
|
2933
|
+
var _this20 = this;
|
|
2907
2934
|
|
|
2908
2935
|
_classCallCheck(this, WebsyResultList);
|
|
2909
2936
|
|
|
@@ -2931,9 +2958,9 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
2931
2958
|
|
|
2932
2959
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
2933
2960
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
2934
|
-
|
|
2961
|
+
_this20.options.template = templateString;
|
|
2935
2962
|
|
|
2936
|
-
|
|
2963
|
+
_this20.render();
|
|
2937
2964
|
});
|
|
2938
2965
|
} else {
|
|
2939
2966
|
this.render();
|
|
@@ -2952,7 +2979,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
2952
2979
|
}, {
|
|
2953
2980
|
key: "buildHTML",
|
|
2954
2981
|
value: function buildHTML(d) {
|
|
2955
|
-
var
|
|
2982
|
+
var _this21 = this;
|
|
2956
2983
|
|
|
2957
2984
|
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
2958
2985
|
var html = "";
|
|
@@ -2960,7 +2987,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
2960
2987
|
if (this.options.template) {
|
|
2961
2988
|
if (d.length > 0) {
|
|
2962
2989
|
d.forEach(function (row, ix) {
|
|
2963
|
-
var template = "".concat(ix > 0 ? '-->' : '').concat(
|
|
2990
|
+
var template = "".concat(ix > 0 ? '-->' : '').concat(_this21.options.template).concat(ix < d.length - 1 ? '<!--' : ''); // find conditional elements
|
|
2964
2991
|
|
|
2965
2992
|
var ifMatches = _toConsumableArray(template.matchAll(/<\s*if[^>]*>([\s\S]*?)<\s*\/\s*if>/g));
|
|
2966
2993
|
|
|
@@ -3080,7 +3107,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3080
3107
|
}, {
|
|
3081
3108
|
key: "handleClick",
|
|
3082
3109
|
value: function handleClick(event) {
|
|
3083
|
-
var
|
|
3110
|
+
var _this22 = this;
|
|
3084
3111
|
|
|
3085
3112
|
if (event.target.classList.contains('clickable')) {
|
|
3086
3113
|
var l = event.target.getAttribute('data-event');
|
|
@@ -3098,8 +3125,8 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3098
3125
|
l = l[0];
|
|
3099
3126
|
params = params.map(function (p) {
|
|
3100
3127
|
if (typeof p !== 'string' && typeof p !== 'number') {
|
|
3101
|
-
if (
|
|
3102
|
-
p =
|
|
3128
|
+
if (_this22.rows[+id]) {
|
|
3129
|
+
p = _this22.rows[+id][p];
|
|
3103
3130
|
}
|
|
3104
3131
|
} else if (typeof p === 'string') {
|
|
3105
3132
|
p = p.replace(/"/g, '').replace(/'/g, '');
|
|
@@ -3121,13 +3148,13 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3121
3148
|
}, {
|
|
3122
3149
|
key: "render",
|
|
3123
3150
|
value: function render() {
|
|
3124
|
-
var
|
|
3151
|
+
var _this23 = this;
|
|
3125
3152
|
|
|
3126
3153
|
if (this.options.entity) {
|
|
3127
3154
|
this.apiService.get(this.options.entity).then(function (results) {
|
|
3128
|
-
|
|
3155
|
+
_this23.rows = results.rows;
|
|
3129
3156
|
|
|
3130
|
-
|
|
3157
|
+
_this23.resize();
|
|
3131
3158
|
});
|
|
3132
3159
|
} else {
|
|
3133
3160
|
this.resize();
|
|
@@ -3206,14 +3233,14 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
3206
3233
|
_createClass(WebsyRouter, [{
|
|
3207
3234
|
key: "addGroup",
|
|
3208
3235
|
value: function addGroup(group) {
|
|
3209
|
-
var
|
|
3236
|
+
var _this24 = this;
|
|
3210
3237
|
|
|
3211
3238
|
if (!this.groups[group]) {
|
|
3212
3239
|
var els = document.querySelectorAll(".websy-view[data-group=\"".concat(group, "\"]"));
|
|
3213
3240
|
|
|
3214
3241
|
if (els) {
|
|
3215
3242
|
this.getClosestParent(els[0], function (parent) {
|
|
3216
|
-
|
|
3243
|
+
_this24.groups[group] = {
|
|
3217
3244
|
activeView: '',
|
|
3218
3245
|
views: [],
|
|
3219
3246
|
parent: parent.getAttribute('data-view')
|
|
@@ -3538,12 +3565,12 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
3538
3565
|
}, {
|
|
3539
3566
|
key: "showComponents",
|
|
3540
3567
|
value: function showComponents(view) {
|
|
3541
|
-
var
|
|
3568
|
+
var _this25 = this;
|
|
3542
3569
|
|
|
3543
3570
|
if (this.options.views && this.options.views[view] && this.options.views[view].components) {
|
|
3544
3571
|
this.options.views[view].components.forEach(function (c) {
|
|
3545
3572
|
if (typeof c.instance === 'undefined') {
|
|
3546
|
-
|
|
3573
|
+
_this25.prepComponent(c.elementId, c.options);
|
|
3547
3574
|
|
|
3548
3575
|
c.instance = new c.Component(c.elementId, c.options);
|
|
3549
3576
|
} else if (c.instance.render) {
|
|
@@ -3912,7 +3939,7 @@ var Switch = /*#__PURE__*/function () {
|
|
|
3912
3939
|
|
|
3913
3940
|
var WebsyTemplate = /*#__PURE__*/function () {
|
|
3914
3941
|
function WebsyTemplate(elementId, options) {
|
|
3915
|
-
var
|
|
3942
|
+
var _this26 = this;
|
|
3916
3943
|
|
|
3917
3944
|
_classCallCheck(this, WebsyTemplate);
|
|
3918
3945
|
|
|
@@ -3938,9 +3965,9 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
3938
3965
|
|
|
3939
3966
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
3940
3967
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
3941
|
-
|
|
3968
|
+
_this26.options.template = templateString;
|
|
3942
3969
|
|
|
3943
|
-
|
|
3970
|
+
_this26.render();
|
|
3944
3971
|
});
|
|
3945
3972
|
} else {
|
|
3946
3973
|
this.render();
|
|
@@ -3950,7 +3977,7 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
3950
3977
|
_createClass(WebsyTemplate, [{
|
|
3951
3978
|
key: "buildHTML",
|
|
3952
3979
|
value: function buildHTML() {
|
|
3953
|
-
var
|
|
3980
|
+
var _this27 = this;
|
|
3954
3981
|
|
|
3955
3982
|
var html = "";
|
|
3956
3983
|
|
|
@@ -4012,14 +4039,14 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4012
4039
|
}
|
|
4013
4040
|
|
|
4014
4041
|
if (polarity === true) {
|
|
4015
|
-
if (typeof
|
|
4042
|
+
if (typeof _this27.options.data[parts[0]] !== 'undefined' && _this27.options.data[parts[0]] === parts[1]) {
|
|
4016
4043
|
// remove the <if> tags
|
|
4017
4044
|
removeAll = false;
|
|
4018
4045
|
} else if (parts[0] === parts[1]) {
|
|
4019
4046
|
removeAll = false;
|
|
4020
4047
|
}
|
|
4021
4048
|
} else if (polarity === false) {
|
|
4022
|
-
if (typeof
|
|
4049
|
+
if (typeof _this27.options.data[parts[0]] !== 'undefined' && _this27.options.data[parts[0]] !== parts[1]) {
|
|
4023
4050
|
// remove the <if> tags
|
|
4024
4051
|
removeAll = false;
|
|
4025
4052
|
}
|
|
@@ -4306,7 +4333,7 @@ var WebsyUtils = {
|
|
|
4306
4333
|
|
|
4307
4334
|
var WebsyTable = /*#__PURE__*/function () {
|
|
4308
4335
|
function WebsyTable(elementId, options) {
|
|
4309
|
-
var
|
|
4336
|
+
var _this28 = this;
|
|
4310
4337
|
|
|
4311
4338
|
_classCallCheck(this, WebsyTable);
|
|
4312
4339
|
|
|
@@ -4344,8 +4371,8 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
4344
4371
|
allowClear: false,
|
|
4345
4372
|
disableSearch: true,
|
|
4346
4373
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
4347
|
-
if (
|
|
4348
|
-
|
|
4374
|
+
if (_this28.options.onChangePageSize) {
|
|
4375
|
+
_this28.options.onChangePageSize(selectedItem.value);
|
|
4349
4376
|
}
|
|
4350
4377
|
}
|
|
4351
4378
|
});
|
|
@@ -4366,7 +4393,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
4366
4393
|
_createClass(WebsyTable, [{
|
|
4367
4394
|
key: "appendRows",
|
|
4368
4395
|
value: function appendRows(data) {
|
|
4369
|
-
var
|
|
4396
|
+
var _this29 = this;
|
|
4370
4397
|
|
|
4371
4398
|
this.hideError();
|
|
4372
4399
|
var bodyHTML = '';
|
|
@@ -4374,15 +4401,15 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
4374
4401
|
if (data) {
|
|
4375
4402
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
4376
4403
|
return '<tr>' + r.map(function (c, i) {
|
|
4377
|
-
if (
|
|
4404
|
+
if (_this29.options.columns[i].show !== false) {
|
|
4378
4405
|
var style = '';
|
|
4379
4406
|
|
|
4380
4407
|
if (c.style) {
|
|
4381
4408
|
style += c.style;
|
|
4382
4409
|
}
|
|
4383
4410
|
|
|
4384
|
-
if (
|
|
4385
|
-
style += "width: ".concat(
|
|
4411
|
+
if (_this29.options.columns[i].width) {
|
|
4412
|
+
style += "width: ".concat(_this29.options.columns[i].width, "; ");
|
|
4386
4413
|
}
|
|
4387
4414
|
|
|
4388
4415
|
if (c.backgroundColor) {
|
|
@@ -4397,18 +4424,18 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
4397
4424
|
style += "color: ".concat(c.color, "; ");
|
|
4398
4425
|
}
|
|
4399
4426
|
|
|
4400
|
-
if (
|
|
4401
|
-
return "\n <td \n data-row-index='".concat(
|
|
4402
|
-
} else if ((
|
|
4403
|
-
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(
|
|
4427
|
+
if (_this29.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
4428
|
+
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 ");
|
|
4429
|
+
} else if ((_this29.options.columns[i].showAsNavigatorLink === true || _this29.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
4430
|
+
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 ");
|
|
4404
4431
|
} else {
|
|
4405
4432
|
var info = c.value;
|
|
4406
4433
|
|
|
4407
|
-
if (
|
|
4434
|
+
if (_this29.options.columns[i].showAsImage === true) {
|
|
4408
4435
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
4409
4436
|
}
|
|
4410
4437
|
|
|
4411
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
4438
|
+
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 ");
|
|
4412
4439
|
}
|
|
4413
4440
|
}
|
|
4414
4441
|
}).join('') + '</tr>';
|
|
@@ -4580,7 +4607,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
4580
4607
|
}, {
|
|
4581
4608
|
key: "render",
|
|
4582
4609
|
value: function render(data) {
|
|
4583
|
-
var
|
|
4610
|
+
var _this30 = this;
|
|
4584
4611
|
|
|
4585
4612
|
if (!this.options.columns) {
|
|
4586
4613
|
return;
|
|
@@ -4605,7 +4632,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
4605
4632
|
|
|
4606
4633
|
var headHTML = '<tr>' + this.options.columns.map(function (c, i) {
|
|
4607
4634
|
if (c.show !== false) {
|
|
4608
|
-
return "\n <th ".concat(c.width ? 'style="width: ' + (c.width || 'auto') + ';"' : '', ">\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 ?
|
|
4635
|
+
return "\n <th ".concat(c.width ? 'style="width: ' + (c.width || 'auto') + ';"' : '', ">\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 ");
|
|
4609
4636
|
}
|
|
4610
4637
|
}).join('') + '</tr>';
|
|
4611
4638
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -4624,7 +4651,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
4624
4651
|
|
|
4625
4652
|
if (pagingEl) {
|
|
4626
4653
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
4627
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
4654
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this30.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
4628
4655
|
});
|
|
4629
4656
|
var startIndex = 0;
|
|
4630
4657
|
|
|
@@ -4692,7 +4719,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
4692
4719
|
|
|
4693
4720
|
var WebsyTable2 = /*#__PURE__*/function () {
|
|
4694
4721
|
function WebsyTable2(elementId, options) {
|
|
4695
|
-
var
|
|
4722
|
+
var _this31 = this;
|
|
4696
4723
|
|
|
4697
4724
|
_classCallCheck(this, WebsyTable2);
|
|
4698
4725
|
|
|
@@ -4733,8 +4760,8 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
4733
4760
|
allowClear: false,
|
|
4734
4761
|
disableSearch: true,
|
|
4735
4762
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
4736
|
-
if (
|
|
4737
|
-
|
|
4763
|
+
if (_this31.options.onChangePageSize) {
|
|
4764
|
+
_this31.options.onChangePageSize(selectedItem.value);
|
|
4738
4765
|
}
|
|
4739
4766
|
}
|
|
4740
4767
|
});
|
|
@@ -4758,7 +4785,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
4758
4785
|
_createClass(WebsyTable2, [{
|
|
4759
4786
|
key: "appendRows",
|
|
4760
4787
|
value: function appendRows(data) {
|
|
4761
|
-
var
|
|
4788
|
+
var _this32 = this;
|
|
4762
4789
|
|
|
4763
4790
|
this.hideError();
|
|
4764
4791
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
@@ -4767,15 +4794,15 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
4767
4794
|
if (data) {
|
|
4768
4795
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
4769
4796
|
return '<tr>' + r.map(function (c, i) {
|
|
4770
|
-
if (
|
|
4771
|
-
var style = "height: ".concat(
|
|
4797
|
+
if (_this32.options.columns[i].show !== false) {
|
|
4798
|
+
var style = "height: ".concat(_this32.options.cellSize, "px; line-height: ").concat(_this32.options.cellSize, "px;");
|
|
4772
4799
|
|
|
4773
4800
|
if (c.style) {
|
|
4774
4801
|
style += c.style;
|
|
4775
4802
|
}
|
|
4776
4803
|
|
|
4777
|
-
if (
|
|
4778
|
-
style += "width: ".concat(
|
|
4804
|
+
if (_this32.options.columns[i].width) {
|
|
4805
|
+
style += "width: ".concat(_this32.options.columns[i].width, "; ");
|
|
4779
4806
|
}
|
|
4780
4807
|
|
|
4781
4808
|
if (c.backgroundColor) {
|
|
@@ -4790,18 +4817,18 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
4790
4817
|
style += "color: ".concat(c.color, "; ");
|
|
4791
4818
|
}
|
|
4792
4819
|
|
|
4793
|
-
if (
|
|
4794
|
-
return "\n <td \n data-row-index='".concat(
|
|
4795
|
-
} else if ((
|
|
4796
|
-
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(
|
|
4820
|
+
if (_this32.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
4821
|
+
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 ");
|
|
4822
|
+
} else if ((_this32.options.columns[i].showAsNavigatorLink === true || _this32.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
4823
|
+
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 ");
|
|
4797
4824
|
} else {
|
|
4798
4825
|
var info = c.value;
|
|
4799
4826
|
|
|
4800
|
-
if (
|
|
4827
|
+
if (_this32.options.columns[i].showAsImage === true) {
|
|
4801
4828
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
4802
4829
|
}
|
|
4803
4830
|
|
|
4804
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
4831
|
+
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 ");
|
|
4805
4832
|
}
|
|
4806
4833
|
}
|
|
4807
4834
|
}).join('') + '</tr>';
|
|
@@ -5059,7 +5086,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5059
5086
|
}, {
|
|
5060
5087
|
key: "render",
|
|
5061
5088
|
value: function render(data) {
|
|
5062
|
-
var
|
|
5089
|
+
var _this33 = this;
|
|
5063
5090
|
|
|
5064
5091
|
if (!this.options.columns) {
|
|
5065
5092
|
return;
|
|
@@ -5095,7 +5122,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5095
5122
|
style += "width: ".concat(c.width || 'auto', "; ");
|
|
5096
5123
|
}
|
|
5097
5124
|
|
|
5098
|
-
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 ?
|
|
5125
|
+
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(i) : '', "\n </div>\n </th>\n ");
|
|
5099
5126
|
}
|
|
5100
5127
|
}).join('') + '</tr>';
|
|
5101
5128
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -5106,7 +5133,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5106
5133
|
var dropdownHTML = "";
|
|
5107
5134
|
this.options.columns.forEach(function (c, i) {
|
|
5108
5135
|
if (c.searchable && c.searchField) {
|
|
5109
|
-
dropdownHTML += "\n <div id=\"".concat(
|
|
5136
|
+
dropdownHTML += "\n <div id=\"".concat(_this33.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
|
|
5110
5137
|
}
|
|
5111
5138
|
});
|
|
5112
5139
|
dropdownEl.innerHTML = dropdownHTML;
|
|
@@ -5128,7 +5155,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5128
5155
|
|
|
5129
5156
|
if (pagingEl) {
|
|
5130
5157
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
5131
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
5158
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this33.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
5132
5159
|
});
|
|
5133
5160
|
var startIndex = 0;
|
|
5134
5161
|
|
|
@@ -5215,7 +5242,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5215
5242
|
}, {
|
|
5216
5243
|
key: "getColumnParameters",
|
|
5217
5244
|
value: function getColumnParameters(values) {
|
|
5218
|
-
var
|
|
5245
|
+
var _this34 = this;
|
|
5219
5246
|
|
|
5220
5247
|
var tableEl = document.getElementById("".concat(this.elementId, "_table"));
|
|
5221
5248
|
tableEl.style.tableLayout = 'auto';
|
|
@@ -5223,10 +5250,10 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5223
5250
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
5224
5251
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
5225
5252
|
headEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c, i) {
|
|
5226
|
-
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 ?
|
|
5253
|
+
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 ");
|
|
5227
5254
|
}).join('') + '</tr>';
|
|
5228
5255
|
bodyEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c) {
|
|
5229
|
-
return "\n <td \n style='height: ".concat(
|
|
5256
|
+
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 || ' ', "</td>\n ");
|
|
5230
5257
|
}).join('') + '</tr>'; // get height of the first data cell
|
|
5231
5258
|
|
|
5232
5259
|
var cells = bodyEl.querySelectorAll("tr:first-of-type td");
|
|
@@ -5276,7 +5303,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5276
5303
|
|
|
5277
5304
|
var WebsyChart = /*#__PURE__*/function () {
|
|
5278
5305
|
function WebsyChart(elementId, options) {
|
|
5279
|
-
var
|
|
5306
|
+
var _this35 = this;
|
|
5280
5307
|
|
|
5281
5308
|
_classCallCheck(this, WebsyChart);
|
|
5282
5309
|
|
|
@@ -5325,22 +5352,22 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
5325
5352
|
this.invertOverride = function (input, input2) {
|
|
5326
5353
|
var xAxis = 'bottomAxis';
|
|
5327
5354
|
|
|
5328
|
-
if (
|
|
5355
|
+
if (_this35.options.orientation === 'horizontal') {
|
|
5329
5356
|
xAxis = 'leftAxis';
|
|
5330
5357
|
}
|
|
5331
5358
|
|
|
5332
|
-
var width =
|
|
5359
|
+
var width = _this35[xAxis].step();
|
|
5333
5360
|
|
|
5334
5361
|
var output;
|
|
5335
5362
|
|
|
5336
|
-
var domain = _toConsumableArray(
|
|
5363
|
+
var domain = _toConsumableArray(_this35[xAxis].domain());
|
|
5337
5364
|
|
|
5338
|
-
if (
|
|
5365
|
+
if (_this35.options.orientation === 'horizontal') {
|
|
5339
5366
|
domain = domain.reverse();
|
|
5340
5367
|
}
|
|
5341
5368
|
|
|
5342
5369
|
for (var j = 0; j < domain.length; j++) {
|
|
5343
|
-
var breakA =
|
|
5370
|
+
var breakA = _this35[xAxis](domain[j]) - width / 2;
|
|
5344
5371
|
var breakB = breakA + width;
|
|
5345
5372
|
|
|
5346
5373
|
if (input > breakA && input <= breakB) {
|
|
@@ -5440,10 +5467,10 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
5440
5467
|
}, {
|
|
5441
5468
|
key: "handleEventMouseMove",
|
|
5442
5469
|
value: function handleEventMouseMove(event, d) {
|
|
5443
|
-
var
|
|
5470
|
+
var _this36 = this;
|
|
5444
5471
|
|
|
5445
5472
|
var bisectDate = d3.bisector(function (d) {
|
|
5446
|
-
return
|
|
5473
|
+
return _this36.parseX(d.x.value);
|
|
5447
5474
|
}).left;
|
|
5448
5475
|
|
|
5449
5476
|
if (this.options.showTrackingLine === true && d3.pointer(event)) {
|
|
@@ -5482,8 +5509,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
5482
5509
|
}
|
|
5483
5510
|
|
|
5484
5511
|
this.options.data.series.forEach(function (s) {
|
|
5485
|
-
if (
|
|
5486
|
-
xPoint =
|
|
5512
|
+
if (_this36.options.data[xData].scale !== 'Time') {
|
|
5513
|
+
xPoint = _this36[xAxis](_this36.parseX(xLabel));
|
|
5487
5514
|
s.data.forEach(function (d) {
|
|
5488
5515
|
if (d.x.value === xLabel) {
|
|
5489
5516
|
if (!tooltipTitle) {
|
|
@@ -5502,13 +5529,13 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
5502
5529
|
var pointA = s.data[index - 1];
|
|
5503
5530
|
var pointB = s.data[index];
|
|
5504
5531
|
|
|
5505
|
-
if (
|
|
5532
|
+
if (_this36.options.orientation === 'horizontal') {
|
|
5506
5533
|
pointA = _toConsumableArray(s.data).reverse()[index - 1];
|
|
5507
5534
|
pointB = _toConsumableArray(s.data).reverse()[index];
|
|
5508
5535
|
}
|
|
5509
5536
|
|
|
5510
5537
|
if (pointA && !pointB) {
|
|
5511
|
-
xPoint =
|
|
5538
|
+
xPoint = _this36[xAxis](_this36.parseX(pointA.x.value));
|
|
5512
5539
|
tooltipTitle = pointA.x.value;
|
|
5513
5540
|
|
|
5514
5541
|
if (!pointA.y.color) {
|
|
@@ -5518,12 +5545,12 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
5518
5545
|
tooltipData.push(pointA.y);
|
|
5519
5546
|
|
|
5520
5547
|
if (typeof pointA.x.value.getTime !== 'undefined') {
|
|
5521
|
-
tooltipTitle = d3.timeFormat(
|
|
5548
|
+
tooltipTitle = d3.timeFormat(_this36.options.dateFormat || _this36.options.calculatedTimeFormatPattern)(pointA.x.value);
|
|
5522
5549
|
}
|
|
5523
5550
|
}
|
|
5524
5551
|
|
|
5525
5552
|
if (pointB && !pointA) {
|
|
5526
|
-
xPoint =
|
|
5553
|
+
xPoint = _this36[xAxis](_this36.parseX(pointB.x.value));
|
|
5527
5554
|
tooltipTitle = pointB.x.value;
|
|
5528
5555
|
|
|
5529
5556
|
if (!pointB.y.color) {
|
|
@@ -5533,14 +5560,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
5533
5560
|
tooltipData.push(pointB.y);
|
|
5534
5561
|
|
|
5535
5562
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
5536
|
-
tooltipTitle = d3.timeFormat(
|
|
5563
|
+
tooltipTitle = d3.timeFormat(_this36.options.dateFormat || _this36.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
5537
5564
|
}
|
|
5538
5565
|
}
|
|
5539
5566
|
|
|
5540
5567
|
if (pointA && pointB) {
|
|
5541
|
-
var d0 =
|
|
5568
|
+
var d0 = _this36[xAxis](_this36.parseX(pointA.x.value));
|
|
5542
5569
|
|
|
5543
|
-
var d1 =
|
|
5570
|
+
var d1 = _this36[xAxis](_this36.parseX(pointB.x.value));
|
|
5544
5571
|
|
|
5545
5572
|
var mid = Math.abs(d0 - d1) / 2;
|
|
5546
5573
|
|
|
@@ -5549,7 +5576,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
5549
5576
|
tooltipTitle = pointB.x.value;
|
|
5550
5577
|
|
|
5551
5578
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
5552
|
-
tooltipTitle = d3.timeFormat(
|
|
5579
|
+
tooltipTitle = d3.timeFormat(_this36.options.dateFormat || _this36.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
5553
5580
|
}
|
|
5554
5581
|
|
|
5555
5582
|
if (!pointB.y.color) {
|
|
@@ -5562,7 +5589,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
5562
5589
|
tooltipTitle = pointA.x.value;
|
|
5563
5590
|
|
|
5564
5591
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
5565
|
-
tooltipTitle = d3.timeFormat(
|
|
5592
|
+
tooltipTitle = d3.timeFormat(_this36.options.dateFormat || _this36.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
5566
5593
|
}
|
|
5567
5594
|
|
|
5568
5595
|
if (!pointA.y.color) {
|
|
@@ -5667,7 +5694,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
5667
5694
|
}, {
|
|
5668
5695
|
key: "render",
|
|
5669
5696
|
value: function render(options) {
|
|
5670
|
-
var
|
|
5697
|
+
var _this37 = this;
|
|
5671
5698
|
|
|
5672
5699
|
/* global d3 options WebsyUtils */
|
|
5673
5700
|
if (typeof options !== 'undefined') {
|
|
@@ -5736,7 +5763,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
5736
5763
|
var legendData = this.options.data.series.map(function (s, i) {
|
|
5737
5764
|
return {
|
|
5738
5765
|
value: s.label || s.key,
|
|
5739
|
-
color: s.color ||
|
|
5766
|
+
color: s.color || _this37.options.colors[i % _this37.options.colors.length]
|
|
5740
5767
|
};
|
|
5741
5768
|
});
|
|
5742
5769
|
|
|
@@ -5988,7 +6015,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
5988
6015
|
|
|
5989
6016
|
if (this.options.data.bottom.formatter) {
|
|
5990
6017
|
bAxisFunc.tickFormat(function (d) {
|
|
5991
|
-
return
|
|
6018
|
+
return _this37.options.data.bottom.formatter(d);
|
|
5992
6019
|
});
|
|
5993
6020
|
}
|
|
5994
6021
|
|
|
@@ -6014,8 +6041,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
6014
6041
|
|
|
6015
6042
|
if (this.options.margin.axisLeft > 0) {
|
|
6016
6043
|
this.leftAxisLayer.call(d3.axisLeft(this.leftAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
6017
|
-
if (
|
|
6018
|
-
d =
|
|
6044
|
+
if (_this37.options.data.left.formatter) {
|
|
6045
|
+
d = _this37.options.data.left.formatter(d);
|
|
6019
6046
|
}
|
|
6020
6047
|
|
|
6021
6048
|
return d;
|
|
@@ -6052,8 +6079,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
6052
6079
|
|
|
6053
6080
|
if (this.options.margin.axisRight > 0 && (this.options.data.right.min !== 0 || this.options.data.right.max !== 0)) {
|
|
6054
6081
|
this.rightAxisLayer.call(d3.axisRight(this.rightAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
6055
|
-
if (
|
|
6056
|
-
d =
|
|
6082
|
+
if (_this37.options.data.right.formatter) {
|
|
6083
|
+
d = _this37.options.data.right.formatter(d);
|
|
6057
6084
|
}
|
|
6058
6085
|
|
|
6059
6086
|
return d;
|
|
@@ -6079,16 +6106,16 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
6079
6106
|
|
|
6080
6107
|
this.options.data.series.forEach(function (series, index) {
|
|
6081
6108
|
if (!series.key) {
|
|
6082
|
-
series.key =
|
|
6109
|
+
series.key = _this37.createIdentity();
|
|
6083
6110
|
}
|
|
6084
6111
|
|
|
6085
6112
|
if (!series.color) {
|
|
6086
|
-
series.color =
|
|
6113
|
+
series.color = _this37.options.colors[index % _this37.options.colors.length];
|
|
6087
6114
|
}
|
|
6088
6115
|
|
|
6089
|
-
|
|
6116
|
+
_this37["render".concat(series.type || 'bar')](series, index);
|
|
6090
6117
|
|
|
6091
|
-
|
|
6118
|
+
_this37.renderLabels(series, index);
|
|
6092
6119
|
});
|
|
6093
6120
|
}
|
|
6094
6121
|
}
|
|
@@ -6096,17 +6123,17 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
6096
6123
|
}, {
|
|
6097
6124
|
key: "renderarea",
|
|
6098
6125
|
value: function renderarea(series, index) {
|
|
6099
|
-
var
|
|
6126
|
+
var _this38 = this;
|
|
6100
6127
|
|
|
6101
6128
|
/* global d3 series index */
|
|
6102
6129
|
var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
|
|
6103
6130
|
return d3.area().x(function (d) {
|
|
6104
|
-
return
|
|
6131
|
+
return _this38[xAxis](_this38.parseX(d.x.value));
|
|
6105
6132
|
}).y0(function (d) {
|
|
6106
|
-
return
|
|
6133
|
+
return _this38[yAxis](0);
|
|
6107
6134
|
}).y1(function (d) {
|
|
6108
|
-
return
|
|
6109
|
-
}).curve(d3[curveStyle ||
|
|
6135
|
+
return _this38[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
|
|
6136
|
+
}).curve(d3[curveStyle || _this38.options.curveStyle]);
|
|
6110
6137
|
};
|
|
6111
6138
|
|
|
6112
6139
|
var xAxis = 'bottomAxis';
|
|
@@ -6281,15 +6308,15 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
6281
6308
|
}, {
|
|
6282
6309
|
key: "renderline",
|
|
6283
6310
|
value: function renderline(series, index) {
|
|
6284
|
-
var
|
|
6311
|
+
var _this39 = this;
|
|
6285
6312
|
|
|
6286
6313
|
/* global series index d3 */
|
|
6287
6314
|
var drawLine = function drawLine(xAxis, yAxis, curveStyle) {
|
|
6288
6315
|
return d3.line().x(function (d) {
|
|
6289
|
-
return
|
|
6316
|
+
return _this39[xAxis](_this39.parseX(d.x.value));
|
|
6290
6317
|
}).y(function (d) {
|
|
6291
|
-
return
|
|
6292
|
-
}).curve(d3[curveStyle ||
|
|
6318
|
+
return _this39[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
|
|
6319
|
+
}).curve(d3[curveStyle || _this39.options.curveStyle]);
|
|
6293
6320
|
};
|
|
6294
6321
|
|
|
6295
6322
|
var xAxis = 'bottomAxis';
|
|
@@ -6327,14 +6354,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
6327
6354
|
}, {
|
|
6328
6355
|
key: "rendersymbol",
|
|
6329
6356
|
value: function rendersymbol(series, index) {
|
|
6330
|
-
var
|
|
6357
|
+
var _this40 = this;
|
|
6331
6358
|
|
|
6332
6359
|
/* global d3 series index series.key */
|
|
6333
6360
|
var drawSymbol = function drawSymbol(size) {
|
|
6334
6361
|
return d3.symbol() // .type(d => {
|
|
6335
6362
|
// return d3.symbols[0]
|
|
6336
6363
|
// })
|
|
6337
|
-
.size(size ||
|
|
6364
|
+
.size(size || _this40.options.symbolSize);
|
|
6338
6365
|
};
|
|
6339
6366
|
|
|
6340
6367
|
var xAxis = 'bottomAxis';
|
|
@@ -6352,7 +6379,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
6352
6379
|
symbols.attr('d', function (d) {
|
|
6353
6380
|
return drawSymbol(d.y.size || series.symbolSize)(d);
|
|
6354
6381
|
}).transition(this.transition).attr('fill', 'white').attr('stroke', series.color).attr('transform', function (d) {
|
|
6355
|
-
return "translate(".concat(
|
|
6382
|
+
return "translate(".concat(_this40[xAxis](_this40.parseX(d.x.value)), ", ").concat(_this40[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
6356
6383
|
}); // Enter
|
|
6357
6384
|
|
|
6358
6385
|
symbols.enter().append('path').attr('d', function (d) {
|
|
@@ -6361,7 +6388,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
6361
6388
|
.attr('fill', 'white').attr('stroke', series.color).attr('class', function (d) {
|
|
6362
6389
|
return "symbol symbol_".concat(series.key);
|
|
6363
6390
|
}).attr('transform', function (d) {
|
|
6364
|
-
return "translate(".concat(
|
|
6391
|
+
return "translate(".concat(_this40[xAxis](_this40.parseX(d.x.value)), ", ").concat(_this40[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
6365
6392
|
});
|
|
6366
6393
|
}
|
|
6367
6394
|
}, {
|
|
@@ -6516,7 +6543,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
6516
6543
|
}, {
|
|
6517
6544
|
key: "resize",
|
|
6518
6545
|
value: function resize() {
|
|
6519
|
-
var
|
|
6546
|
+
var _this41 = this;
|
|
6520
6547
|
|
|
6521
6548
|
var el = document.getElementById(this.elementId);
|
|
6522
6549
|
|
|
@@ -6529,7 +6556,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
6529
6556
|
// }
|
|
6530
6557
|
var html = "\n <div class='text-".concat(this.options.align, "'>\n ");
|
|
6531
6558
|
html += this._data.map(function (d, i) {
|
|
6532
|
-
return
|
|
6559
|
+
return _this41.getLegendItemHTML(d);
|
|
6533
6560
|
}).join('');
|
|
6534
6561
|
html += "\n <div>\n ";
|
|
6535
6562
|
el.innerHTML = html;
|
|
@@ -6701,7 +6728,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
6701
6728
|
}, {
|
|
6702
6729
|
key: "render",
|
|
6703
6730
|
value: function render() {
|
|
6704
|
-
var
|
|
6731
|
+
var _this42 = this;
|
|
6705
6732
|
|
|
6706
6733
|
var mapEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
6707
6734
|
var legendEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
@@ -6710,7 +6737,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
6710
6737
|
var legendData = this.options.data.polygons.map(function (s, i) {
|
|
6711
6738
|
return {
|
|
6712
6739
|
value: s.label || s.key,
|
|
6713
|
-
color: s.color ||
|
|
6740
|
+
color: s.color || _this42.options.colors[i % _this42.options.colors.length]
|
|
6714
6741
|
};
|
|
6715
6742
|
});
|
|
6716
6743
|
var longestValue = legendData.map(function (s) {
|
|
@@ -6774,7 +6801,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
6774
6801
|
|
|
6775
6802
|
if (this.polygons) {
|
|
6776
6803
|
this.polygons.forEach(function (p) {
|
|
6777
|
-
return
|
|
6804
|
+
return _this42.map.removeLayer(p);
|
|
6778
6805
|
});
|
|
6779
6806
|
}
|
|
6780
6807
|
|
|
@@ -6832,18 +6859,18 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
6832
6859
|
}
|
|
6833
6860
|
|
|
6834
6861
|
if (!p.options.color) {
|
|
6835
|
-
p.options.color =
|
|
6862
|
+
p.options.color = _this42.options.colors[i % _this42.options.colors.length];
|
|
6836
6863
|
}
|
|
6837
6864
|
|
|
6838
6865
|
var pol = L.polygon(p.data.map(function (c) {
|
|
6839
6866
|
return c.map(function (d) {
|
|
6840
6867
|
return [d.Latitude, d.Longitude];
|
|
6841
6868
|
});
|
|
6842
|
-
}), p.options).addTo(
|
|
6869
|
+
}), p.options).addTo(_this42.map);
|
|
6843
6870
|
|
|
6844
|
-
|
|
6871
|
+
_this42.polygons.push(pol);
|
|
6845
6872
|
|
|
6846
|
-
|
|
6873
|
+
_this42.map.fitBounds(pol.getBounds());
|
|
6847
6874
|
});
|
|
6848
6875
|
} // if (this.data.markers.length > 0) {
|
|
6849
6876
|
// el.classList.remove('hidden')
|