@websy/websy-designs 1.4.11 → 1.4.13
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/websy-designs-es6.debug.js +37 -18
- package/dist/websy-designs-es6.js +269 -250
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +37 -18
- package/dist/websy-designs.js +272 -253
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
|
@@ -538,13 +538,14 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
538
538
|
} else if (event.target.classList.contains('websy-dp-cancel')) {
|
|
539
539
|
this.close();
|
|
540
540
|
} else if (event.target.classList.contains('clear-selection')) {
|
|
541
|
+
this.currentselection = [];
|
|
542
|
+
this.selectedRangeDates = [];
|
|
541
543
|
this.selectRange(0, false);
|
|
542
544
|
|
|
543
545
|
if (this.options.onClear) {
|
|
544
546
|
this.options.onClear();
|
|
545
|
-
}
|
|
547
|
+
} // this.updateRange(0)
|
|
546
548
|
|
|
547
|
-
this.updateRange(0);
|
|
548
549
|
}
|
|
549
550
|
}
|
|
550
551
|
}, {
|
|
@@ -1118,29 +1119,32 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1118
1119
|
}, {
|
|
1119
1120
|
key: "selectRange",
|
|
1120
1121
|
value: function selectRange(index) {
|
|
1121
|
-
var _this6 = this;
|
|
1122
|
-
|
|
1123
1122
|
var confirm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
1124
1123
|
|
|
1125
1124
|
if (this.options.ranges[this.options.mode][index]) {
|
|
1126
1125
|
this.selectedRangeDates = _toConsumableArray(this.options.ranges[this.options.mode][index].range);
|
|
1127
|
-
this.currentselection = this.options.ranges[this.options.mode][index].range.map(
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
}
|
|
1126
|
+
this.currentselection = []; // this.currentselection = this.options.ranges[this.options.mode][index].range.map(d => {
|
|
1127
|
+
// if (this.options.mode === 'date' || this.options.mode === 'monthyear') {
|
|
1128
|
+
// return d.getTime()
|
|
1129
|
+
// }
|
|
1130
|
+
// else {
|
|
1131
|
+
// return d
|
|
1132
|
+
// }
|
|
1133
|
+
// })
|
|
1134
|
+
|
|
1134
1135
|
this.selectedRange = +index;
|
|
1135
1136
|
this.highlightRange();
|
|
1136
1137
|
this.updateRange();
|
|
1137
|
-
|
|
1138
|
+
|
|
1139
|
+
if (confirm === true) {
|
|
1140
|
+
this.close(confirm, true);
|
|
1141
|
+
}
|
|
1138
1142
|
}
|
|
1139
1143
|
}
|
|
1140
1144
|
}, {
|
|
1141
1145
|
key: "selectCustomRange",
|
|
1142
1146
|
value: function selectCustomRange(rangeInput) {
|
|
1143
|
-
var
|
|
1147
|
+
var _this6 = this;
|
|
1144
1148
|
|
|
1145
1149
|
this.selectedRange = -1;
|
|
1146
1150
|
this.isContinuousRange = true; // if (rangeInput.length === 1) {
|
|
@@ -1156,13 +1160,13 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1156
1160
|
this.customRangeSelected = true;
|
|
1157
1161
|
rangeInput.forEach(function (r, i) {
|
|
1158
1162
|
if (i > 0) {
|
|
1159
|
-
if (
|
|
1160
|
-
if (r.getTime() /
|
|
1161
|
-
|
|
1163
|
+
if (_this6.options.mode === 'date' || _this6.options.mode === 'monthyear') {
|
|
1164
|
+
if (r.getTime() / _this6.oneDay - rangeInput[i - 1] / _this6.oneDay > 1) {
|
|
1165
|
+
_this6.isContinuousRange = false;
|
|
1162
1166
|
}
|
|
1163
|
-
} else if (
|
|
1167
|
+
} else if (_this6.options.mode === 'hour' || _this6.options.mode === 'year') {
|
|
1164
1168
|
if (r - rangeInput[i - 1] > 1) {
|
|
1165
|
-
|
|
1169
|
+
_this6.isContinuousRange = false;
|
|
1166
1170
|
}
|
|
1167
1171
|
}
|
|
1168
1172
|
}
|
|
@@ -1241,27 +1245,27 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1241
1245
|
}, {
|
|
1242
1246
|
key: "updateRange",
|
|
1243
1247
|
value: function updateRange() {
|
|
1244
|
-
var
|
|
1248
|
+
var _this7 = this;
|
|
1245
1249
|
|
|
1246
1250
|
var range;
|
|
1247
1251
|
|
|
1248
1252
|
if (this.selectedRange === -1) {
|
|
1249
1253
|
var list = (this.currentselection.length > 0 ? this.currentselection : this.selectedRangeDates).map(function (d) {
|
|
1250
|
-
if (
|
|
1254
|
+
if (_this7.options.mode === 'date') {
|
|
1251
1255
|
if (!d.toLocaleDateString) {
|
|
1252
1256
|
d = new Date(d);
|
|
1253
1257
|
}
|
|
1254
1258
|
|
|
1255
1259
|
return d.toLocaleDateString();
|
|
1256
|
-
} else if (
|
|
1260
|
+
} else if (_this7.options.mode === 'year') {
|
|
1257
1261
|
return d;
|
|
1258
|
-
} else if (
|
|
1262
|
+
} else if (_this7.options.mode === 'monthyear') {
|
|
1259
1263
|
if (!d.getMonth) {
|
|
1260
1264
|
d = new Date(d);
|
|
1261
1265
|
}
|
|
1262
1266
|
|
|
1263
|
-
return "".concat(
|
|
1264
|
-
} else if (
|
|
1267
|
+
return "".concat(_this7.options.monthMap[d.getMonth()], " ").concat(d.getFullYear());
|
|
1268
|
+
} else if (_this7.options.mode === 'hour') {
|
|
1265
1269
|
return d;
|
|
1266
1270
|
}
|
|
1267
1271
|
});
|
|
@@ -1622,7 +1626,7 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
1622
1626
|
}, {
|
|
1623
1627
|
key: "render",
|
|
1624
1628
|
value: function render() {
|
|
1625
|
-
var
|
|
1629
|
+
var _this8 = this;
|
|
1626
1630
|
|
|
1627
1631
|
var el = document.getElementById("".concat(this.elementId, "_container"));
|
|
1628
1632
|
|
|
@@ -1630,7 +1634,7 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
1630
1634
|
this.measureItems();
|
|
1631
1635
|
var html = "\n <div id='".concat(this.elementId, "start_item' class='websy-dragdrop-item ").concat(this.options.items.length === 0 ? 'empty' : '', "' data-id='").concat(this.elementId, "start'>\n <div id='").concat(this.elementId, "start_dropZone' class='websy-drop-zone droppable' data-index='start' data-side='start' data-id='").concat(this.elementId, "start' data-placeholder='").concat(this.options.dropPlaceholder, "'></div>\n </div>\n ");
|
|
1632
1636
|
html += this.options.items.map(function (d, i) {
|
|
1633
|
-
return
|
|
1637
|
+
return _this8.createItemHtml(_this8.elementId, i, d);
|
|
1634
1638
|
}).join('');
|
|
1635
1639
|
el.innerHTML = html;
|
|
1636
1640
|
this.options.items.forEach(function (item, i) {
|
|
@@ -1655,7 +1659,7 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
1655
1659
|
|
|
1656
1660
|
var WebsyDropdown = /*#__PURE__*/function () {
|
|
1657
1661
|
function WebsyDropdown(elementId, options) {
|
|
1658
|
-
var
|
|
1662
|
+
var _this9 = this;
|
|
1659
1663
|
|
|
1660
1664
|
_classCallCheck(this, WebsyDropdown);
|
|
1661
1665
|
|
|
@@ -1704,10 +1708,10 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1704
1708
|
el.addEventListener('mouseout', this.handleMouseOut.bind(this));
|
|
1705
1709
|
el.addEventListener('mousemove', this.handleMouseMove.bind(this));
|
|
1706
1710
|
var headerLabel = this.selectedItems.map(function (s) {
|
|
1707
|
-
return
|
|
1711
|
+
return _this9.options.items[s].label || _this9.options.items[s].value;
|
|
1708
1712
|
}).join(this.options.multiValueDelimiter);
|
|
1709
1713
|
var headerValue = this.selectedItems.map(function (s) {
|
|
1710
|
-
return
|
|
1714
|
+
return _this9.options.items[s].value || _this9.options.items[s].label;
|
|
1711
1715
|
}).join(this.options.multiValueDelimiter);
|
|
1712
1716
|
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 ");
|
|
1713
1717
|
|
|
@@ -1780,9 +1784,15 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1780
1784
|
scrollEl.scrollTo(0, 0);
|
|
1781
1785
|
}
|
|
1782
1786
|
|
|
1783
|
-
maskEl
|
|
1784
|
-
|
|
1785
|
-
|
|
1787
|
+
if (maskEl) {
|
|
1788
|
+
maskEl.classList.remove('active');
|
|
1789
|
+
}
|
|
1790
|
+
|
|
1791
|
+
if (contentEl) {
|
|
1792
|
+
contentEl.classList.remove('active');
|
|
1793
|
+
contentEl.classList.remove('on-top');
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1786
1796
|
var searchEl = document.getElementById("".concat(this.elementId, "_search"));
|
|
1787
1797
|
|
|
1788
1798
|
if (searchEl) {
|
|
@@ -2001,10 +2011,10 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
2001
2011
|
}, {
|
|
2002
2012
|
key: "renderItems",
|
|
2003
2013
|
value: function renderItems() {
|
|
2004
|
-
var
|
|
2014
|
+
var _this10 = this;
|
|
2005
2015
|
|
|
2006
2016
|
var html = this.options.items.map(function (r, i) {
|
|
2007
|
-
return "\n <li data-index='".concat(r.index, "' class='websy-dropdown-item ").concat((r.classes || []).join(' '), " ").concat(
|
|
2017
|
+
return "\n <li data-index='".concat(r.index, "' class='websy-dropdown-item ").concat((r.classes || []).join(' '), " ").concat(_this10.selectedItems.indexOf(r.index) !== -1 ? 'active' : '', "'>").concat(r.label, "</li>\n ");
|
|
2008
2018
|
}).join('');
|
|
2009
2019
|
var el = document.getElementById("".concat(this.elementId, "_items"));
|
|
2010
2020
|
|
|
@@ -2240,16 +2250,16 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2240
2250
|
}, {
|
|
2241
2251
|
key: "checkRecaptcha",
|
|
2242
2252
|
value: function checkRecaptcha() {
|
|
2243
|
-
var
|
|
2253
|
+
var _this11 = this;
|
|
2244
2254
|
|
|
2245
2255
|
return new Promise(function (resolve, reject) {
|
|
2246
|
-
if (
|
|
2256
|
+
if (_this11.options.useRecaptcha === true) {
|
|
2247
2257
|
// if (this.recaptchaValue) {
|
|
2248
2258
|
grecaptcha.ready(function () {
|
|
2249
2259
|
grecaptcha.execute(ENVIRONMENT.RECAPTCHA_KEY, {
|
|
2250
2260
|
action: 'submit'
|
|
2251
2261
|
}).then(function (token) {
|
|
2252
|
-
|
|
2262
|
+
_this11.apiService.add('google/checkrecaptcha', {
|
|
2253
2263
|
grecaptcharesponse: token
|
|
2254
2264
|
}).then(function (response) {
|
|
2255
2265
|
if (response.success && response.success === true) {
|
|
@@ -2312,14 +2322,14 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2312
2322
|
}, {
|
|
2313
2323
|
key: "processComponents",
|
|
2314
2324
|
value: function processComponents(components, callbackFn) {
|
|
2315
|
-
var
|
|
2325
|
+
var _this12 = this;
|
|
2316
2326
|
|
|
2317
2327
|
if (components.length === 0) {
|
|
2318
2328
|
callbackFn();
|
|
2319
2329
|
} else {
|
|
2320
2330
|
components.forEach(function (c) {
|
|
2321
2331
|
if (typeof WebsyDesigns[c.component] !== 'undefined') {
|
|
2322
|
-
c.instance = new WebsyDesigns[c.component]("".concat(
|
|
2332
|
+
c.instance = new WebsyDesigns[c.component]("".concat(_this12.elementId, "_input_").concat(c.field, "_component"), c.options);
|
|
2323
2333
|
} else {// some user feedback here
|
|
2324
2334
|
}
|
|
2325
2335
|
});
|
|
@@ -2340,7 +2350,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2340
2350
|
}, {
|
|
2341
2351
|
key: "render",
|
|
2342
2352
|
value: function render(update, data) {
|
|
2343
|
-
var
|
|
2353
|
+
var _this13 = this;
|
|
2344
2354
|
|
|
2345
2355
|
var el = document.getElementById(this.elementId);
|
|
2346
2356
|
var componentsToProcess = [];
|
|
@@ -2350,11 +2360,11 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2350
2360
|
this.options.fields.forEach(function (f, i) {
|
|
2351
2361
|
if (f.component) {
|
|
2352
2362
|
componentsToProcess.push(f);
|
|
2353
|
-
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(
|
|
2363
|
+
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 ");
|
|
2354
2364
|
} else if (f.type === 'longtext') {
|
|
2355
|
-
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(
|
|
2365
|
+
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 ");
|
|
2356
2366
|
} else {
|
|
2357
|
-
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(
|
|
2367
|
+
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 ");
|
|
2358
2368
|
}
|
|
2359
2369
|
});
|
|
2360
2370
|
html += "\n --><button class=\"websy-btn submit ".concat(this.options.submit.classes || '', "\">").concat(this.options.submit.text || 'Save', "</button>").concat(this.options.cancel ? '<!--' : '', "\n ");
|
|
@@ -2371,7 +2381,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2371
2381
|
|
|
2372
2382
|
el.innerHTML = html;
|
|
2373
2383
|
this.processComponents(componentsToProcess, function () {
|
|
2374
|
-
if (
|
|
2384
|
+
if (_this13.options.useRecaptcha === true && typeof grecaptcha !== 'undefined') {// this.recaptchaReady()
|
|
2375
2385
|
}
|
|
2376
2386
|
});
|
|
2377
2387
|
}
|
|
@@ -2379,7 +2389,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2379
2389
|
}, {
|
|
2380
2390
|
key: "submitForm",
|
|
2381
2391
|
value: function submitForm() {
|
|
2382
|
-
var
|
|
2392
|
+
var _this14 = this;
|
|
2383
2393
|
|
|
2384
2394
|
var formEl = document.getElementById("".concat(this.elementId, "Form"));
|
|
2385
2395
|
|
|
@@ -2393,32 +2403,32 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2393
2403
|
data[key] = value;
|
|
2394
2404
|
});
|
|
2395
2405
|
|
|
2396
|
-
if (
|
|
2397
|
-
var
|
|
2406
|
+
if (_this14.options.url) {
|
|
2407
|
+
var _this14$apiService;
|
|
2398
2408
|
|
|
2399
|
-
var params = [
|
|
2409
|
+
var params = [_this14.options.url];
|
|
2400
2410
|
|
|
2401
|
-
if (
|
|
2402
|
-
params.push(
|
|
2411
|
+
if (_this14.options.mode === 'update') {
|
|
2412
|
+
params.push(_this14.options.id);
|
|
2403
2413
|
}
|
|
2404
2414
|
|
|
2405
2415
|
params.push(data);
|
|
2406
2416
|
|
|
2407
|
-
(
|
|
2408
|
-
if (
|
|
2417
|
+
(_this14$apiService = _this14.apiService)[_this14.options.mode].apply(_this14$apiService, params).then(function (result) {
|
|
2418
|
+
if (_this14.options.clearAfterSave === true) {
|
|
2409
2419
|
// this.render()
|
|
2410
2420
|
formEl.reset();
|
|
2411
2421
|
}
|
|
2412
2422
|
|
|
2413
|
-
|
|
2423
|
+
_this14.options.onSuccess.call(_this14, result);
|
|
2414
2424
|
}, function (err) {
|
|
2415
2425
|
console.log('Error submitting form data:', err);
|
|
2416
2426
|
|
|
2417
|
-
|
|
2427
|
+
_this14.options.onError.call(_this14, err);
|
|
2418
2428
|
});
|
|
2419
|
-
} else if (
|
|
2420
|
-
|
|
2421
|
-
if (
|
|
2429
|
+
} else if (_this14.options.submitFn) {
|
|
2430
|
+
_this14.options.submitFn(data, function () {
|
|
2431
|
+
if (_this14.options.clearAfterSave === true) {
|
|
2422
2432
|
// this.render()
|
|
2423
2433
|
formEl.reset();
|
|
2424
2434
|
}
|
|
@@ -2438,17 +2448,17 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2438
2448
|
}, {
|
|
2439
2449
|
key: "data",
|
|
2440
2450
|
set: function set(d) {
|
|
2441
|
-
var
|
|
2451
|
+
var _this15 = this;
|
|
2442
2452
|
|
|
2443
2453
|
if (!this.options.fields) {
|
|
2444
2454
|
this.options.fields = [];
|
|
2445
2455
|
}
|
|
2446
2456
|
|
|
2447
2457
|
var _loop = function _loop(key) {
|
|
2448
|
-
|
|
2458
|
+
_this15.options.fields.forEach(function (f) {
|
|
2449
2459
|
if (f.field === key) {
|
|
2450
2460
|
f.value = d[key];
|
|
2451
|
-
var el = document.getElementById("".concat(
|
|
2461
|
+
var el = document.getElementById("".concat(_this15.elementId, "_input_").concat(f.field));
|
|
2452
2462
|
el.value = f.value;
|
|
2453
2463
|
}
|
|
2454
2464
|
});
|
|
@@ -2502,8 +2512,11 @@ var WebsyLoadingDialog = /*#__PURE__*/function () {
|
|
|
2502
2512
|
key: "hide",
|
|
2503
2513
|
value: function hide() {
|
|
2504
2514
|
var el = document.getElementById(this.elementId);
|
|
2505
|
-
|
|
2506
|
-
el
|
|
2515
|
+
|
|
2516
|
+
if (el) {
|
|
2517
|
+
el.classList.remove('loading');
|
|
2518
|
+
el.innerHTML = '';
|
|
2519
|
+
}
|
|
2507
2520
|
}
|
|
2508
2521
|
}, {
|
|
2509
2522
|
key: "render",
|
|
@@ -2649,11 +2662,11 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2649
2662
|
}, {
|
|
2650
2663
|
key: "handleSearch",
|
|
2651
2664
|
value: function handleSearch(searchText) {
|
|
2652
|
-
var
|
|
2665
|
+
var _this16 = this;
|
|
2653
2666
|
|
|
2654
2667
|
var el = document.getElementById(this.elementId);
|
|
2655
2668
|
var lowestItems = this.flatItems.filter(function (d) {
|
|
2656
|
-
return d.level ===
|
|
2669
|
+
return d.level === _this16.maxLevel;
|
|
2657
2670
|
});
|
|
2658
2671
|
var visibleItems = lowestItems;
|
|
2659
2672
|
var defaultMethod = 'remove';
|
|
@@ -2661,7 +2674,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2661
2674
|
if (searchText.length > 1) {
|
|
2662
2675
|
defaultMethod = 'add';
|
|
2663
2676
|
visibleItems = lowestItems.filter(function (d) {
|
|
2664
|
-
return d[
|
|
2677
|
+
return d[_this16.options.searchProp].toLowerCase().indexOf(searchText.toLowerCase()) !== -1;
|
|
2665
2678
|
});
|
|
2666
2679
|
} // hide everything
|
|
2667
2680
|
|
|
@@ -2845,7 +2858,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2845
2858
|
|
|
2846
2859
|
var Pager = /*#__PURE__*/function () {
|
|
2847
2860
|
function Pager(elementId, options) {
|
|
2848
|
-
var
|
|
2861
|
+
var _this17 = this;
|
|
2849
2862
|
|
|
2850
2863
|
_classCallCheck(this, Pager);
|
|
2851
2864
|
|
|
@@ -2898,8 +2911,8 @@ var Pager = /*#__PURE__*/function () {
|
|
|
2898
2911
|
allowClear: false,
|
|
2899
2912
|
disableSearch: true,
|
|
2900
2913
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
2901
|
-
if (
|
|
2902
|
-
|
|
2914
|
+
if (_this17.options.onChangePageSize) {
|
|
2915
|
+
_this17.options.onChangePageSize(selectedItem.value);
|
|
2903
2916
|
}
|
|
2904
2917
|
}
|
|
2905
2918
|
});
|
|
@@ -2923,13 +2936,13 @@ var Pager = /*#__PURE__*/function () {
|
|
|
2923
2936
|
}, {
|
|
2924
2937
|
key: "render",
|
|
2925
2938
|
value: function render() {
|
|
2926
|
-
var
|
|
2939
|
+
var _this18 = this;
|
|
2927
2940
|
|
|
2928
2941
|
var el = document.getElementById("".concat(this.elementId, "_pageList"));
|
|
2929
2942
|
|
|
2930
2943
|
if (el) {
|
|
2931
2944
|
var pages = this.options.pages.map(function (item, index) {
|
|
2932
|
-
return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
2945
|
+
return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(_this18.options.activePage === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
2933
2946
|
});
|
|
2934
2947
|
var startIndex = 0;
|
|
2935
2948
|
|
|
@@ -2997,58 +3010,58 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
2997
3010
|
_createClass(WebsyPDFButton, [{
|
|
2998
3011
|
key: "handleClick",
|
|
2999
3012
|
value: function handleClick(event) {
|
|
3000
|
-
var
|
|
3013
|
+
var _this19 = this;
|
|
3001
3014
|
|
|
3002
3015
|
if (event.target.classList.contains('websy-pdf-button')) {
|
|
3003
3016
|
this.loader.show();
|
|
3004
3017
|
setTimeout(function () {
|
|
3005
|
-
if (
|
|
3006
|
-
var el = document.getElementById(
|
|
3018
|
+
if (_this19.options.targetId) {
|
|
3019
|
+
var el = document.getElementById(_this19.options.targetId);
|
|
3007
3020
|
|
|
3008
3021
|
if (el) {
|
|
3009
3022
|
var pdfData = {
|
|
3010
3023
|
options: {}
|
|
3011
3024
|
};
|
|
3012
3025
|
|
|
3013
|
-
if (
|
|
3014
|
-
pdfData.options = _extends({},
|
|
3026
|
+
if (_this19.options.pdfOptions) {
|
|
3027
|
+
pdfData.options = _extends({}, _this19.options.pdfOptions);
|
|
3015
3028
|
}
|
|
3016
3029
|
|
|
3017
|
-
if (
|
|
3018
|
-
if (
|
|
3019
|
-
var headerEl = document.getElementById(
|
|
3030
|
+
if (_this19.options.header) {
|
|
3031
|
+
if (_this19.options.header.elementId) {
|
|
3032
|
+
var headerEl = document.getElementById(_this19.options.header.elementId);
|
|
3020
3033
|
|
|
3021
3034
|
if (headerEl) {
|
|
3022
3035
|
pdfData.header = headerEl.outerHTML;
|
|
3023
3036
|
|
|
3024
|
-
if (
|
|
3025
|
-
pdfData.options.headerCSS =
|
|
3037
|
+
if (_this19.options.header.css) {
|
|
3038
|
+
pdfData.options.headerCSS = _this19.options.header.css;
|
|
3026
3039
|
}
|
|
3027
3040
|
}
|
|
3028
|
-
} else if (
|
|
3029
|
-
pdfData.header =
|
|
3041
|
+
} else if (_this19.options.header.html) {
|
|
3042
|
+
pdfData.header = _this19.options.header.html;
|
|
3030
3043
|
|
|
3031
|
-
if (
|
|
3032
|
-
pdfData.options.headerCSS =
|
|
3044
|
+
if (_this19.options.header.css) {
|
|
3045
|
+
pdfData.options.headerCSS = _this19.options.header.css;
|
|
3033
3046
|
}
|
|
3034
3047
|
} else {
|
|
3035
|
-
pdfData.header =
|
|
3048
|
+
pdfData.header = _this19.options.header;
|
|
3036
3049
|
}
|
|
3037
3050
|
}
|
|
3038
3051
|
|
|
3039
|
-
if (
|
|
3040
|
-
if (
|
|
3041
|
-
var footerEl = document.getElementById(
|
|
3052
|
+
if (_this19.options.footer) {
|
|
3053
|
+
if (_this19.options.footer.elementId) {
|
|
3054
|
+
var footerEl = document.getElementById(_this19.options.footer.elementId);
|
|
3042
3055
|
|
|
3043
3056
|
if (footerEl) {
|
|
3044
3057
|
pdfData.footer = footerEl.outerHTML;
|
|
3045
3058
|
|
|
3046
|
-
if (
|
|
3047
|
-
pdfData.options.footerCSS =
|
|
3059
|
+
if (_this19.options.footer.css) {
|
|
3060
|
+
pdfData.options.footerCSS = _this19.options.footer.css;
|
|
3048
3061
|
}
|
|
3049
3062
|
}
|
|
3050
3063
|
} else {
|
|
3051
|
-
pdfData.footer =
|
|
3064
|
+
pdfData.footer = _this19.options.footer;
|
|
3052
3065
|
}
|
|
3053
3066
|
}
|
|
3054
3067
|
|
|
@@ -3057,31 +3070,31 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
3057
3070
|
// document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
|
|
3058
3071
|
// document.getElementById(`${this.elementId}_form`).submit()
|
|
3059
3072
|
|
|
3060
|
-
|
|
3073
|
+
_this19.service.add('', pdfData, {
|
|
3061
3074
|
responseType: 'blob'
|
|
3062
3075
|
}).then(function (response) {
|
|
3063
|
-
|
|
3076
|
+
_this19.loader.hide();
|
|
3064
3077
|
|
|
3065
3078
|
var blob = new Blob([response], {
|
|
3066
3079
|
type: 'application/pdf'
|
|
3067
3080
|
});
|
|
3068
3081
|
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 ");
|
|
3069
3082
|
|
|
3070
|
-
if (
|
|
3083
|
+
if (_this19.options.directDownload === true) {
|
|
3071
3084
|
var fileName;
|
|
3072
3085
|
|
|
3073
|
-
if (typeof
|
|
3074
|
-
fileName =
|
|
3086
|
+
if (typeof _this19.options.fileName === 'function') {
|
|
3087
|
+
fileName = _this19.options.fileName() || 'Export';
|
|
3075
3088
|
} else {
|
|
3076
|
-
fileName =
|
|
3089
|
+
fileName = _this19.options.fileName || 'Export';
|
|
3077
3090
|
}
|
|
3078
3091
|
|
|
3079
3092
|
msg += "download='".concat(fileName, ".pdf'");
|
|
3080
3093
|
}
|
|
3081
3094
|
|
|
3082
|
-
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(
|
|
3095
|
+
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this19.options.buttonText, "</button>\n </a>\n </div>\n ");
|
|
3083
3096
|
|
|
3084
|
-
|
|
3097
|
+
_this19.popup.show({
|
|
3085
3098
|
message: msg,
|
|
3086
3099
|
mask: true
|
|
3087
3100
|
});
|
|
@@ -3282,7 +3295,7 @@ var WebsyPubSub = /*#__PURE__*/function () {
|
|
|
3282
3295
|
|
|
3283
3296
|
var ResponsiveText = /*#__PURE__*/function () {
|
|
3284
3297
|
function ResponsiveText(elementId, options) {
|
|
3285
|
-
var
|
|
3298
|
+
var _this20 = this;
|
|
3286
3299
|
|
|
3287
3300
|
_classCallCheck(this, ResponsiveText);
|
|
3288
3301
|
|
|
@@ -3295,7 +3308,7 @@ var ResponsiveText = /*#__PURE__*/function () {
|
|
|
3295
3308
|
this.elementId = elementId;
|
|
3296
3309
|
this.canvas = document.createElement('canvas');
|
|
3297
3310
|
window.addEventListener('resize', function () {
|
|
3298
|
-
return
|
|
3311
|
+
return _this20.render();
|
|
3299
3312
|
});
|
|
3300
3313
|
var el = document.getElementById(this.elementId);
|
|
3301
3314
|
|
|
@@ -3514,7 +3527,7 @@ var ResponsiveText = /*#__PURE__*/function () {
|
|
|
3514
3527
|
|
|
3515
3528
|
var WebsyResultList = /*#__PURE__*/function () {
|
|
3516
3529
|
function WebsyResultList(elementId, options) {
|
|
3517
|
-
var
|
|
3530
|
+
var _this21 = this;
|
|
3518
3531
|
|
|
3519
3532
|
_classCallCheck(this, WebsyResultList);
|
|
3520
3533
|
|
|
@@ -3546,9 +3559,9 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3546
3559
|
|
|
3547
3560
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
3548
3561
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
3549
|
-
|
|
3562
|
+
_this21.options.template = templateString;
|
|
3550
3563
|
|
|
3551
|
-
|
|
3564
|
+
_this21.render();
|
|
3552
3565
|
});
|
|
3553
3566
|
} else {
|
|
3554
3567
|
this.render();
|
|
@@ -3568,7 +3581,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3568
3581
|
}, {
|
|
3569
3582
|
key: "buildHTML",
|
|
3570
3583
|
value: function buildHTML(d) {
|
|
3571
|
-
var
|
|
3584
|
+
var _this22 = this;
|
|
3572
3585
|
|
|
3573
3586
|
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
3574
3587
|
var inputTemplate = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -3578,7 +3591,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3578
3591
|
if (this.options.template) {
|
|
3579
3592
|
if (d.length > 0) {
|
|
3580
3593
|
d.forEach(function (row, ix) {
|
|
3581
|
-
var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate ||
|
|
3594
|
+
var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate || _this22.options.template).concat(ix < d.length - 1 ? '<!--' : ''); // find conditional elements
|
|
3582
3595
|
|
|
3583
3596
|
var ifMatches = _toConsumableArray(template.matchAll(/<\s*if[^>]*>([\s\S]*?)<\s*\/\s*if>/g));
|
|
3584
3597
|
|
|
@@ -3683,7 +3696,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3683
3696
|
parts.forEach(function (p) {
|
|
3684
3697
|
items = items[p];
|
|
3685
3698
|
});
|
|
3686
|
-
template = template.replace(m[0],
|
|
3699
|
+
template = template.replace(m[0], _this22.buildHTML(items, 0, withoutFor, [].concat(_toConsumableArray(locator), ["".concat(startIndex + ix, ":").concat(c)])));
|
|
3687
3700
|
}
|
|
3688
3701
|
});
|
|
3689
3702
|
|
|
@@ -3695,7 +3708,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3695
3708
|
}
|
|
3696
3709
|
});
|
|
3697
3710
|
|
|
3698
|
-
var flatRow =
|
|
3711
|
+
var flatRow = _this22.flattenObject(row);
|
|
3699
3712
|
|
|
3700
3713
|
for (var key in flatRow) {
|
|
3701
3714
|
var rg = new RegExp("{".concat(key, "}"), 'gm');
|
|
@@ -3830,13 +3843,13 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3830
3843
|
}, {
|
|
3831
3844
|
key: "render",
|
|
3832
3845
|
value: function render() {
|
|
3833
|
-
var
|
|
3846
|
+
var _this23 = this;
|
|
3834
3847
|
|
|
3835
3848
|
if (this.options.entity) {
|
|
3836
3849
|
this.apiService.get(this.options.entity).then(function (results) {
|
|
3837
|
-
|
|
3850
|
+
_this23.rows = results.rows;
|
|
3838
3851
|
|
|
3839
|
-
|
|
3852
|
+
_this23.resize();
|
|
3840
3853
|
});
|
|
3841
3854
|
} else {
|
|
3842
3855
|
this.resize();
|
|
@@ -3922,14 +3935,14 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
3922
3935
|
_createClass(WebsyRouter, [{
|
|
3923
3936
|
key: "addGroup",
|
|
3924
3937
|
value: function addGroup(group) {
|
|
3925
|
-
var
|
|
3938
|
+
var _this24 = this;
|
|
3926
3939
|
|
|
3927
3940
|
if (!this.groups[group]) {
|
|
3928
3941
|
var els = document.querySelectorAll(".websy-view[data-group=\"".concat(group, "\"]"));
|
|
3929
3942
|
|
|
3930
3943
|
if (els) {
|
|
3931
3944
|
this.getClosestParent(els[0], function (parent) {
|
|
3932
|
-
|
|
3945
|
+
_this24.groups[group] = {
|
|
3933
3946
|
activeView: '',
|
|
3934
3947
|
views: [],
|
|
3935
3948
|
parent: parent.getAttribute('data-view')
|
|
@@ -3992,7 +4005,7 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
3992
4005
|
}, {
|
|
3993
4006
|
key: "removeUrlParams",
|
|
3994
4007
|
value: function removeUrlParams() {
|
|
3995
|
-
var
|
|
4008
|
+
var _this25 = this;
|
|
3996
4009
|
|
|
3997
4010
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
3998
4011
|
var reloadView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -4006,7 +4019,7 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4006
4019
|
|
|
4007
4020
|
if (this.currentParams && this.currentParams.items) {
|
|
4008
4021
|
params.forEach(function (p) {
|
|
4009
|
-
delete
|
|
4022
|
+
delete _this25.currentParams.items[p];
|
|
4010
4023
|
});
|
|
4011
4024
|
path = this.buildUrlPath(this.currentParams.items);
|
|
4012
4025
|
}
|
|
@@ -4370,12 +4383,12 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4370
4383
|
}, {
|
|
4371
4384
|
key: "showComponents",
|
|
4372
4385
|
value: function showComponents(view) {
|
|
4373
|
-
var
|
|
4386
|
+
var _this26 = this;
|
|
4374
4387
|
|
|
4375
4388
|
if (this.options.views && this.options.views[view] && this.options.views[view].components) {
|
|
4376
4389
|
this.options.views[view].components.forEach(function (c) {
|
|
4377
4390
|
if (typeof c.instance === 'undefined') {
|
|
4378
|
-
|
|
4391
|
+
_this26.prepComponent(c.elementId, c.options);
|
|
4379
4392
|
|
|
4380
4393
|
c.instance = new c.Component(c.elementId, c.options);
|
|
4381
4394
|
} else if (c.instance.render) {
|
|
@@ -4752,7 +4765,7 @@ var Switch = /*#__PURE__*/function () {
|
|
|
4752
4765
|
|
|
4753
4766
|
var WebsyTemplate = /*#__PURE__*/function () {
|
|
4754
4767
|
function WebsyTemplate(elementId, options) {
|
|
4755
|
-
var
|
|
4768
|
+
var _this27 = this;
|
|
4756
4769
|
|
|
4757
4770
|
_classCallCheck(this, WebsyTemplate);
|
|
4758
4771
|
|
|
@@ -4778,9 +4791,9 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4778
4791
|
|
|
4779
4792
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
4780
4793
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
4781
|
-
|
|
4794
|
+
_this27.options.template = templateString;
|
|
4782
4795
|
|
|
4783
|
-
|
|
4796
|
+
_this27.render();
|
|
4784
4797
|
});
|
|
4785
4798
|
} else {
|
|
4786
4799
|
this.render();
|
|
@@ -4790,7 +4803,7 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4790
4803
|
_createClass(WebsyTemplate, [{
|
|
4791
4804
|
key: "buildHTML",
|
|
4792
4805
|
value: function buildHTML() {
|
|
4793
|
-
var
|
|
4806
|
+
var _this28 = this;
|
|
4794
4807
|
|
|
4795
4808
|
var html = "";
|
|
4796
4809
|
|
|
@@ -4852,14 +4865,14 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4852
4865
|
}
|
|
4853
4866
|
|
|
4854
4867
|
if (polarity === true) {
|
|
4855
|
-
if (typeof
|
|
4868
|
+
if (typeof _this28.options.data[parts[0]] !== 'undefined' && _this28.options.data[parts[0]] === parts[1]) {
|
|
4856
4869
|
// remove the <if> tags
|
|
4857
4870
|
removeAll = false;
|
|
4858
4871
|
} else if (parts[0] === parts[1]) {
|
|
4859
4872
|
removeAll = false;
|
|
4860
4873
|
}
|
|
4861
4874
|
} else if (polarity === false) {
|
|
4862
|
-
if (typeof
|
|
4875
|
+
if (typeof _this28.options.data[parts[0]] !== 'undefined' && _this28.options.data[parts[0]] !== parts[1]) {
|
|
4863
4876
|
// remove the <if> tags
|
|
4864
4877
|
removeAll = false;
|
|
4865
4878
|
}
|
|
@@ -5149,7 +5162,7 @@ var WebsyUtils = {
|
|
|
5149
5162
|
|
|
5150
5163
|
var WebsyTable = /*#__PURE__*/function () {
|
|
5151
5164
|
function WebsyTable(elementId, options) {
|
|
5152
|
-
var
|
|
5165
|
+
var _this29 = this;
|
|
5153
5166
|
|
|
5154
5167
|
_classCallCheck(this, WebsyTable);
|
|
5155
5168
|
|
|
@@ -5187,8 +5200,8 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5187
5200
|
allowClear: false,
|
|
5188
5201
|
disableSearch: true,
|
|
5189
5202
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
5190
|
-
if (
|
|
5191
|
-
|
|
5203
|
+
if (_this29.options.onChangePageSize) {
|
|
5204
|
+
_this29.options.onChangePageSize(selectedItem.value);
|
|
5192
5205
|
}
|
|
5193
5206
|
}
|
|
5194
5207
|
});
|
|
@@ -5209,7 +5222,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5209
5222
|
_createClass(WebsyTable, [{
|
|
5210
5223
|
key: "appendRows",
|
|
5211
5224
|
value: function appendRows(data) {
|
|
5212
|
-
var
|
|
5225
|
+
var _this30 = this;
|
|
5213
5226
|
|
|
5214
5227
|
this.hideError();
|
|
5215
5228
|
var bodyHTML = '';
|
|
@@ -5217,15 +5230,15 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5217
5230
|
if (data) {
|
|
5218
5231
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
5219
5232
|
return '<tr>' + r.map(function (c, i) {
|
|
5220
|
-
if (
|
|
5233
|
+
if (_this30.options.columns[i].show !== false) {
|
|
5221
5234
|
var style = '';
|
|
5222
5235
|
|
|
5223
5236
|
if (c.style) {
|
|
5224
5237
|
style += c.style;
|
|
5225
5238
|
}
|
|
5226
5239
|
|
|
5227
|
-
if (
|
|
5228
|
-
style += "width: ".concat(
|
|
5240
|
+
if (_this30.options.columns[i].width) {
|
|
5241
|
+
style += "width: ".concat(_this30.options.columns[i].width, "; ");
|
|
5229
5242
|
}
|
|
5230
5243
|
|
|
5231
5244
|
if (c.backgroundColor) {
|
|
@@ -5240,18 +5253,18 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5240
5253
|
style += "color: ".concat(c.color, "; ");
|
|
5241
5254
|
}
|
|
5242
5255
|
|
|
5243
|
-
if (
|
|
5244
|
-
return "\n <td \n data-row-index='".concat(
|
|
5245
|
-
} else if ((
|
|
5246
|
-
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(
|
|
5256
|
+
if (_this30.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
5257
|
+
return "\n <td \n data-row-index='".concat(_this30.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this30.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(_this30.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this30.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
|
|
5258
|
+
} else if ((_this30.options.columns[i].showAsNavigatorLink === true || _this30.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
5259
|
+
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this30.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this30.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this30.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this30.options.columns[i].linkText || c.value, "</td>\n ");
|
|
5247
5260
|
} else {
|
|
5248
5261
|
var info = c.value;
|
|
5249
5262
|
|
|
5250
|
-
if (
|
|
5263
|
+
if (_this30.options.columns[i].showAsImage === true) {
|
|
5251
5264
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
5252
5265
|
}
|
|
5253
5266
|
|
|
5254
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
5267
|
+
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this30.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this30.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 ");
|
|
5255
5268
|
}
|
|
5256
5269
|
}
|
|
5257
5270
|
}).join('') + '</tr>';
|
|
@@ -5423,7 +5436,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5423
5436
|
}, {
|
|
5424
5437
|
key: "render",
|
|
5425
5438
|
value: function render(data) {
|
|
5426
|
-
var
|
|
5439
|
+
var _this31 = this;
|
|
5427
5440
|
|
|
5428
5441
|
if (!this.options.columns) {
|
|
5429
5442
|
return;
|
|
@@ -5458,7 +5471,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5458
5471
|
style += "width: ".concat(c.width || 'auto', ";");
|
|
5459
5472
|
}
|
|
5460
5473
|
|
|
5461
|
-
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 ?
|
|
5474
|
+
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 ? _this31.buildSearchIcon(c.qGroupFieldDefs[0]) : '', "-->\n </div>\n </th>\n ");
|
|
5462
5475
|
}
|
|
5463
5476
|
}).join('') + '</tr>';
|
|
5464
5477
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -5477,7 +5490,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5477
5490
|
|
|
5478
5491
|
if (pagingEl) {
|
|
5479
5492
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
5480
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
5493
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this31.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
5481
5494
|
});
|
|
5482
5495
|
var startIndex = 0;
|
|
5483
5496
|
|
|
@@ -5545,7 +5558,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5545
5558
|
|
|
5546
5559
|
var WebsyTable2 = /*#__PURE__*/function () {
|
|
5547
5560
|
function WebsyTable2(elementId, options) {
|
|
5548
|
-
var
|
|
5561
|
+
var _this32 = this;
|
|
5549
5562
|
|
|
5550
5563
|
_classCallCheck(this, WebsyTable2);
|
|
5551
5564
|
|
|
@@ -5586,8 +5599,8 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5586
5599
|
allowClear: false,
|
|
5587
5600
|
disableSearch: true,
|
|
5588
5601
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
5589
|
-
if (
|
|
5590
|
-
|
|
5602
|
+
if (_this32.options.onChangePageSize) {
|
|
5603
|
+
_this32.options.onChangePageSize(selectedItem.value);
|
|
5591
5604
|
}
|
|
5592
5605
|
}
|
|
5593
5606
|
});
|
|
@@ -5611,7 +5624,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5611
5624
|
_createClass(WebsyTable2, [{
|
|
5612
5625
|
key: "appendRows",
|
|
5613
5626
|
value: function appendRows(data) {
|
|
5614
|
-
var
|
|
5627
|
+
var _this33 = this;
|
|
5615
5628
|
|
|
5616
5629
|
this.hideError();
|
|
5617
5630
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
@@ -5620,15 +5633,15 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5620
5633
|
if (data) {
|
|
5621
5634
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
5622
5635
|
return '<tr>' + r.map(function (c, i) {
|
|
5623
|
-
if (
|
|
5624
|
-
var style = "height: ".concat(
|
|
5636
|
+
if (_this33.options.columns[i].show !== false) {
|
|
5637
|
+
var style = "height: ".concat(_this33.options.cellSize, "px; line-height: ").concat(_this33.options.cellSize, "px;");
|
|
5625
5638
|
|
|
5626
5639
|
if (c.style) {
|
|
5627
5640
|
style += c.style;
|
|
5628
5641
|
}
|
|
5629
5642
|
|
|
5630
|
-
if (
|
|
5631
|
-
style += "width: ".concat(
|
|
5643
|
+
if (_this33.options.columns[i].width) {
|
|
5644
|
+
style += "width: ".concat(_this33.options.columns[i].width, "; ");
|
|
5632
5645
|
}
|
|
5633
5646
|
|
|
5634
5647
|
if (c.backgroundColor) {
|
|
@@ -5643,18 +5656,18 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5643
5656
|
style += "color: ".concat(c.color, "; ");
|
|
5644
5657
|
}
|
|
5645
5658
|
|
|
5646
|
-
if (
|
|
5647
|
-
return "\n <td \n data-row-index='".concat(
|
|
5648
|
-
} else if ((
|
|
5649
|
-
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(
|
|
5659
|
+
if (_this33.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
5660
|
+
return "\n <td \n data-row-index='".concat(_this33.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this33.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >\n <a href='").concat(c.value, "' target='").concat(_this33.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this33.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
|
|
5661
|
+
} else if ((_this33.options.columns[i].showAsNavigatorLink === true || _this33.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
5662
|
+
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this33.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this33.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this33.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this33.options.columns[i].linkText || c.value, "</td>\n ");
|
|
5650
5663
|
} else {
|
|
5651
5664
|
var info = c.value;
|
|
5652
5665
|
|
|
5653
|
-
if (
|
|
5666
|
+
if (_this33.options.columns[i].showAsImage === true) {
|
|
5654
5667
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
5655
5668
|
}
|
|
5656
5669
|
|
|
5657
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
5670
|
+
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this33.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this33.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.value, "</td>\n ");
|
|
5658
5671
|
}
|
|
5659
5672
|
}
|
|
5660
5673
|
}).join('') + '</tr>';
|
|
@@ -5917,7 +5930,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5917
5930
|
}, {
|
|
5918
5931
|
key: "render",
|
|
5919
5932
|
value: function render(data) {
|
|
5920
|
-
var
|
|
5933
|
+
var _this34 = this;
|
|
5921
5934
|
|
|
5922
5935
|
if (!this.options.columns) {
|
|
5923
5936
|
return;
|
|
@@ -5953,7 +5966,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5953
5966
|
style += "width: ".concat(c.width || 'auto', "; ");
|
|
5954
5967
|
}
|
|
5955
5968
|
|
|
5956
|
-
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 ?
|
|
5969
|
+
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 ? _this34.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
|
|
5957
5970
|
}
|
|
5958
5971
|
}).join('') + '</tr>';
|
|
5959
5972
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -5964,7 +5977,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5964
5977
|
var dropdownHTML = "";
|
|
5965
5978
|
this.options.columns.forEach(function (c, i) {
|
|
5966
5979
|
if (c.searchable && c.searchField) {
|
|
5967
|
-
dropdownHTML += "\n <div id=\"".concat(
|
|
5980
|
+
dropdownHTML += "\n <div id=\"".concat(_this34.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
|
|
5968
5981
|
}
|
|
5969
5982
|
});
|
|
5970
5983
|
dropdownEl.innerHTML = dropdownHTML;
|
|
@@ -5986,7 +5999,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5986
5999
|
|
|
5987
6000
|
if (pagingEl) {
|
|
5988
6001
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
5989
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
6002
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this34.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
5990
6003
|
});
|
|
5991
6004
|
var startIndex = 0;
|
|
5992
6005
|
|
|
@@ -6077,7 +6090,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6077
6090
|
}, {
|
|
6078
6091
|
key: "getColumnParameters",
|
|
6079
6092
|
value: function getColumnParameters(values) {
|
|
6080
|
-
var
|
|
6093
|
+
var _this35 = this;
|
|
6081
6094
|
|
|
6082
6095
|
var tableEl = document.getElementById("".concat(this.elementId, "_table"));
|
|
6083
6096
|
tableEl.style.tableLayout = 'auto';
|
|
@@ -6085,10 +6098,10 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6085
6098
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
6086
6099
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
6087
6100
|
headEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c, i) {
|
|
6088
|
-
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 ?
|
|
6101
|
+
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 ? _this35.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
|
|
6089
6102
|
}).join('') + '</tr>';
|
|
6090
6103
|
bodyEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c) {
|
|
6091
|
-
return "\n <td \n style='height: ".concat(
|
|
6104
|
+
return "\n <td \n style='height: ".concat(_this35.options.cellSize, "px; line-height: ").concat(_this35.options.cellSize, "px; padding: 10px 5px;'\n >").concat(c.value || ' ', "</td>\n ");
|
|
6092
6105
|
}).join('') + '</tr>'; // get height of the first data cell
|
|
6093
6106
|
|
|
6094
6107
|
var cells = bodyEl.querySelectorAll("tr:first-of-type td");
|
|
@@ -6216,7 +6229,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6216
6229
|
}, {
|
|
6217
6230
|
key: "buildBodyHtml",
|
|
6218
6231
|
value: function buildBodyHtml() {
|
|
6219
|
-
var
|
|
6232
|
+
var _this36 = this;
|
|
6220
6233
|
|
|
6221
6234
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6222
6235
|
var useWidths = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -6275,7 +6288,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6275
6288
|
} // console.log('rowspan', cell.rowspan)
|
|
6276
6289
|
|
|
6277
6290
|
|
|
6278
|
-
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) {
|
|
6291
|
+
bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this36.pinnedColumns ? 'pinned' : 'unpinned', " ").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) {
|
|
6279
6292
|
// bodyHtml += `
|
|
6280
6293
|
// style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
|
|
6281
6294
|
// width='${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}'
|
|
@@ -6285,11 +6298,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6285
6298
|
bodyHtml += "\n ><div style='".concat(divStyle, "'>");
|
|
6286
6299
|
|
|
6287
6300
|
if (cell.expandable === true) {
|
|
6288
|
-
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(
|
|
6301
|
+
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(_this36.options.plusIcon, "</i>");
|
|
6289
6302
|
}
|
|
6290
6303
|
|
|
6291
6304
|
if (cell.collapsable === true) {
|
|
6292
|
-
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(
|
|
6305
|
+
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(_this36.options.minusIcon, "</i>");
|
|
6293
6306
|
}
|
|
6294
6307
|
|
|
6295
6308
|
if (sizingColumns[sizeIndex].showAsLink === true && cell.value.trim() !== '') {
|
|
@@ -6314,7 +6327,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6314
6327
|
}, {
|
|
6315
6328
|
key: "buildHeaderHtml",
|
|
6316
6329
|
value: function buildHeaderHtml() {
|
|
6317
|
-
var
|
|
6330
|
+
var _this37 = this;
|
|
6318
6331
|
|
|
6319
6332
|
var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6320
6333
|
var headerHtml = '';
|
|
@@ -6329,7 +6342,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6329
6342
|
}
|
|
6330
6343
|
|
|
6331
6344
|
this.options.columns.forEach(function (row, rowIndex) {
|
|
6332
|
-
if (useWidths === false && rowIndex !==
|
|
6345
|
+
if (useWidths === false && rowIndex !== _this37.options.columns.length - 1) {
|
|
6333
6346
|
// if we're calculating the size we only want to render the last row of column headers
|
|
6334
6347
|
return;
|
|
6335
6348
|
}
|
|
@@ -6355,18 +6368,18 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6355
6368
|
// `
|
|
6356
6369
|
// }
|
|
6357
6370
|
|
|
6358
|
-
headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ?
|
|
6371
|
+
headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ? _this37.buildSearchIcon(col, colIndex) : '', "</div></td>");
|
|
6359
6372
|
});
|
|
6360
6373
|
headerHtml += "</tr>";
|
|
6361
6374
|
});
|
|
6362
6375
|
var dropdownEl = document.getElementById("".concat(this.elementId, "_dropdownContainer"));
|
|
6363
6376
|
this.options.columns[this.options.columns.length - 1].forEach(function (c, i) {
|
|
6364
6377
|
if (c.searchable && c.isExternalSearch === true) {
|
|
6365
|
-
var testEl = document.getElementById("".concat(
|
|
6378
|
+
var testEl = document.getElementById("".concat(_this37.elementId, "_columnSearch_").concat(c.dimId || i));
|
|
6366
6379
|
|
|
6367
6380
|
if (!testEl) {
|
|
6368
6381
|
var newE = document.createElement('div');
|
|
6369
|
-
newE.id = "".concat(
|
|
6382
|
+
newE.id = "".concat(_this37.elementId, "_columnSearch_").concat(c.dimId || i);
|
|
6370
6383
|
newE.className = 'websy-modal-dropdown';
|
|
6371
6384
|
dropdownEl.appendChild(newE);
|
|
6372
6385
|
}
|
|
@@ -6382,7 +6395,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6382
6395
|
}, {
|
|
6383
6396
|
key: "buildTotalHtml",
|
|
6384
6397
|
value: function buildTotalHtml() {
|
|
6385
|
-
var
|
|
6398
|
+
var _this38 = this;
|
|
6386
6399
|
|
|
6387
6400
|
var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6388
6401
|
|
|
@@ -6395,7 +6408,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6395
6408
|
totalHtml += "<td \n class='websy-table-cell'\n colspan='".concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
|
|
6396
6409
|
|
|
6397
6410
|
if (useWidths === true) {
|
|
6398
|
-
totalHtml += "\n style='width: ".concat(
|
|
6411
|
+
totalHtml += "\n style='width: ".concat(_this38.options.columns[_this38.options.columns.length - 1][colIndex].width || _this38.options.columns[_this38.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
|
|
6399
6412
|
}
|
|
6400
6413
|
|
|
6401
6414
|
totalHtml += " \n >\n ".concat(col.value, "\n </td>");
|
|
@@ -6406,7 +6419,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6406
6419
|
}, {
|
|
6407
6420
|
key: "calculateSizes",
|
|
6408
6421
|
value: function calculateSizes() {
|
|
6409
|
-
var
|
|
6422
|
+
var _this39 = this;
|
|
6410
6423
|
|
|
6411
6424
|
var sample = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6412
6425
|
var totalRowCount = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -6449,32 +6462,32 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6449
6462
|
rows.forEach(function (row, rowIndex) {
|
|
6450
6463
|
Array.from(row.children).forEach(function (col, colIndex) {
|
|
6451
6464
|
var colSize = col.getBoundingClientRect();
|
|
6452
|
-
|
|
6465
|
+
_this39.sizes.cellHeight = colSize.height;
|
|
6453
6466
|
|
|
6454
|
-
if (
|
|
6455
|
-
if (!
|
|
6456
|
-
|
|
6467
|
+
if (_this39.options.columns[_this39.options.columns.length - 1][colIndex]) {
|
|
6468
|
+
if (!_this39.options.columns[_this39.options.columns.length - 1][colIndex].actualWidth) {
|
|
6469
|
+
_this39.options.columns[_this39.options.columns.length - 1][colIndex].actualWidth = 0;
|
|
6457
6470
|
}
|
|
6458
6471
|
|
|
6459
|
-
|
|
6460
|
-
|
|
6472
|
+
_this39.options.columns[_this39.options.columns.length - 1][colIndex].actualWidth = Math.min(Math.max(_this39.options.columns[_this39.options.columns.length - 1][colIndex].actualWidth, colSize.width), maxWidth);
|
|
6473
|
+
_this39.options.columns[_this39.options.columns.length - 1][colIndex].cellHeight = colSize.height;
|
|
6461
6474
|
|
|
6462
|
-
if (colIndex >=
|
|
6463
|
-
firstNonPinnedColumnWidth =
|
|
6475
|
+
if (colIndex >= _this39.pinnedColumns) {
|
|
6476
|
+
firstNonPinnedColumnWidth = _this39.options.columns[_this39.options.columns.length - 1][colIndex].actualWidth;
|
|
6464
6477
|
}
|
|
6465
6478
|
}
|
|
6466
6479
|
});
|
|
6467
6480
|
});
|
|
6468
6481
|
this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
|
|
6469
|
-
if (colIndex <
|
|
6470
|
-
|
|
6482
|
+
if (colIndex < _this39.pinnedColumns) {
|
|
6483
|
+
_this39.sizes.scrollableWidth -= col.actualWidth;
|
|
6471
6484
|
}
|
|
6472
6485
|
});
|
|
6473
6486
|
this.sizes.totalWidth = this.options.columns[this.options.columns.length - 1].reduce(function (a, b) {
|
|
6474
6487
|
return a + (b.width || b.actualWidth);
|
|
6475
6488
|
}, 0);
|
|
6476
6489
|
this.sizes.totalNonPinnedWidth = this.options.columns[this.options.columns.length - 1].filter(function (c, i) {
|
|
6477
|
-
return i >=
|
|
6490
|
+
return i >= _this39.pinnedColumns;
|
|
6478
6491
|
}).reduce(function (a, b) {
|
|
6479
6492
|
return a + (b.width || b.actualWidth);
|
|
6480
6493
|
}, 0);
|
|
@@ -6495,10 +6508,10 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6495
6508
|
c.actualWidth += equalWidth; // }
|
|
6496
6509
|
// }
|
|
6497
6510
|
|
|
6498
|
-
|
|
6511
|
+
_this39.sizes.totalWidth += c.width || c.actualWidth;
|
|
6499
6512
|
|
|
6500
|
-
if (i <
|
|
6501
|
-
|
|
6513
|
+
if (i < _this39.pinnedColumns) {
|
|
6514
|
+
_this39.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
|
|
6502
6515
|
} // equalWidth = (outerSize.width - this.sizes.totalWidth) / (this.options.columns[this.options.columns.length - 1].length - (i + 1))
|
|
6503
6516
|
|
|
6504
6517
|
});
|
|
@@ -6555,7 +6568,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6555
6568
|
}, {
|
|
6556
6569
|
key: "createSample",
|
|
6557
6570
|
value: function createSample(data) {
|
|
6558
|
-
var
|
|
6571
|
+
var _this40 = this;
|
|
6559
6572
|
|
|
6560
6573
|
var output = [];
|
|
6561
6574
|
this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
|
|
@@ -6567,7 +6580,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6567
6580
|
var longest = '';
|
|
6568
6581
|
|
|
6569
6582
|
for (var i = 0; i < Math.min(data.length, 1000); i++) {
|
|
6570
|
-
if (data[i].length ===
|
|
6583
|
+
if (data[i].length === _this40.options.columns[_this40.options.columns.length - 1].length) {
|
|
6571
6584
|
if (longest.length < data[i][colIndex].value.length) {
|
|
6572
6585
|
longest = data[i][colIndex].value;
|
|
6573
6586
|
}
|
|
@@ -6962,7 +6975,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6962
6975
|
|
|
6963
6976
|
var WebsyChart = /*#__PURE__*/function () {
|
|
6964
6977
|
function WebsyChart(elementId, options) {
|
|
6965
|
-
var
|
|
6978
|
+
var _this41 = this;
|
|
6966
6979
|
|
|
6967
6980
|
_classCallCheck(this, WebsyChart);
|
|
6968
6981
|
|
|
@@ -7013,22 +7026,22 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7013
7026
|
this.invertOverride = function (input, input2) {
|
|
7014
7027
|
var xAxis = 'bottomAxis';
|
|
7015
7028
|
|
|
7016
|
-
if (
|
|
7029
|
+
if (_this41.options.orientation === 'horizontal') {
|
|
7017
7030
|
xAxis = 'leftAxis';
|
|
7018
7031
|
}
|
|
7019
7032
|
|
|
7020
|
-
var width =
|
|
7033
|
+
var width = _this41[xAxis].step();
|
|
7021
7034
|
|
|
7022
7035
|
var output;
|
|
7023
7036
|
|
|
7024
|
-
var domain = _toConsumableArray(
|
|
7037
|
+
var domain = _toConsumableArray(_this41[xAxis].domain());
|
|
7025
7038
|
|
|
7026
|
-
if (
|
|
7039
|
+
if (_this41.options.orientation === 'horizontal') {
|
|
7027
7040
|
domain = domain.reverse();
|
|
7028
7041
|
}
|
|
7029
7042
|
|
|
7030
7043
|
for (var j = 0; j < domain.length; j++) {
|
|
7031
|
-
var breakA =
|
|
7044
|
+
var breakA = _this41[xAxis](domain[j]) - width / 2;
|
|
7032
7045
|
var breakB = breakA + width;
|
|
7033
7046
|
|
|
7034
7047
|
if (input > breakA && input <= breakB) {
|
|
@@ -7128,10 +7141,10 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7128
7141
|
}, {
|
|
7129
7142
|
key: "handleEventMouseMove",
|
|
7130
7143
|
value: function handleEventMouseMove(event, d) {
|
|
7131
|
-
var
|
|
7144
|
+
var _this42 = this;
|
|
7132
7145
|
|
|
7133
7146
|
var bisectDate = d3.bisector(function (d) {
|
|
7134
|
-
return
|
|
7147
|
+
return _this42.parseX(d.x.value);
|
|
7135
7148
|
}).left;
|
|
7136
7149
|
|
|
7137
7150
|
if (this.options.showTrackingLine === true && d3.pointer(event)) {
|
|
@@ -7170,8 +7183,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7170
7183
|
}
|
|
7171
7184
|
|
|
7172
7185
|
this.options.data.series.forEach(function (s) {
|
|
7173
|
-
if (
|
|
7174
|
-
xPoint =
|
|
7186
|
+
if (_this42.options.data[xData].scale !== 'Time') {
|
|
7187
|
+
xPoint = _this42[xAxis](_this42.parseX(xLabel));
|
|
7175
7188
|
s.data.forEach(function (d) {
|
|
7176
7189
|
if (d.x.value === xLabel) {
|
|
7177
7190
|
if (!tooltipTitle) {
|
|
@@ -7190,13 +7203,13 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7190
7203
|
var pointA = s.data[index - 1];
|
|
7191
7204
|
var pointB = s.data[index];
|
|
7192
7205
|
|
|
7193
|
-
if (
|
|
7206
|
+
if (_this42.options.orientation === 'horizontal') {
|
|
7194
7207
|
pointA = _toConsumableArray(s.data).reverse()[index - 1];
|
|
7195
7208
|
pointB = _toConsumableArray(s.data).reverse()[index];
|
|
7196
7209
|
}
|
|
7197
7210
|
|
|
7198
7211
|
if (pointA && !pointB) {
|
|
7199
|
-
xPoint =
|
|
7212
|
+
xPoint = _this42[xAxis](_this42.parseX(pointA.x.value));
|
|
7200
7213
|
tooltipTitle = pointA.x.value;
|
|
7201
7214
|
|
|
7202
7215
|
if (!pointA.y.color) {
|
|
@@ -7206,12 +7219,12 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7206
7219
|
tooltipData.push(pointA.y);
|
|
7207
7220
|
|
|
7208
7221
|
if (typeof pointA.x.value.getTime !== 'undefined') {
|
|
7209
|
-
tooltipTitle = d3.timeFormat(
|
|
7222
|
+
tooltipTitle = d3.timeFormat(_this42.options.dateFormat || _this42.options.calculatedTimeFormatPattern)(pointA.x.value);
|
|
7210
7223
|
}
|
|
7211
7224
|
}
|
|
7212
7225
|
|
|
7213
7226
|
if (pointB && !pointA) {
|
|
7214
|
-
xPoint =
|
|
7227
|
+
xPoint = _this42[xAxis](_this42.parseX(pointB.x.value));
|
|
7215
7228
|
tooltipTitle = pointB.x.value;
|
|
7216
7229
|
|
|
7217
7230
|
if (!pointB.y.color) {
|
|
@@ -7221,14 +7234,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7221
7234
|
tooltipData.push(pointB.y);
|
|
7222
7235
|
|
|
7223
7236
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7224
|
-
tooltipTitle = d3.timeFormat(
|
|
7237
|
+
tooltipTitle = d3.timeFormat(_this42.options.dateFormat || _this42.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7225
7238
|
}
|
|
7226
7239
|
}
|
|
7227
7240
|
|
|
7228
7241
|
if (pointA && pointB) {
|
|
7229
|
-
var d0 =
|
|
7242
|
+
var d0 = _this42[xAxis](_this42.parseX(pointA.x.value));
|
|
7230
7243
|
|
|
7231
|
-
var d1 =
|
|
7244
|
+
var d1 = _this42[xAxis](_this42.parseX(pointB.x.value));
|
|
7232
7245
|
|
|
7233
7246
|
var mid = Math.abs(d0 - d1) / 2;
|
|
7234
7247
|
|
|
@@ -7237,7 +7250,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7237
7250
|
tooltipTitle = pointB.x.value;
|
|
7238
7251
|
|
|
7239
7252
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7240
|
-
tooltipTitle = d3.timeFormat(
|
|
7253
|
+
tooltipTitle = d3.timeFormat(_this42.options.dateFormat || _this42.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7241
7254
|
}
|
|
7242
7255
|
|
|
7243
7256
|
if (!pointB.y.color) {
|
|
@@ -7250,7 +7263,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7250
7263
|
tooltipTitle = pointA.x.value;
|
|
7251
7264
|
|
|
7252
7265
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7253
|
-
tooltipTitle = d3.timeFormat(
|
|
7266
|
+
tooltipTitle = d3.timeFormat(_this42.options.dateFormat || _this42.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7254
7267
|
}
|
|
7255
7268
|
|
|
7256
7269
|
if (!pointA.y.color) {
|
|
@@ -7364,7 +7377,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7364
7377
|
}, {
|
|
7365
7378
|
key: "render",
|
|
7366
7379
|
value: function render(options) {
|
|
7367
|
-
var
|
|
7380
|
+
var _this43 = this;
|
|
7368
7381
|
|
|
7369
7382
|
/* global d3 options WebsyUtils */
|
|
7370
7383
|
if (typeof options !== 'undefined') {
|
|
@@ -7433,7 +7446,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7433
7446
|
var legendData = this.options.data.series.map(function (s, i) {
|
|
7434
7447
|
return {
|
|
7435
7448
|
value: s.label || s.key,
|
|
7436
|
-
color: s.color ||
|
|
7449
|
+
color: s.color || _this43.options.colors[i % _this43.options.colors.length]
|
|
7437
7450
|
};
|
|
7438
7451
|
});
|
|
7439
7452
|
|
|
@@ -7715,7 +7728,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7715
7728
|
|
|
7716
7729
|
if (this.options.data.bottom.formatter) {
|
|
7717
7730
|
bAxisFunc.tickFormat(function (d) {
|
|
7718
|
-
return
|
|
7731
|
+
return _this43.options.data.bottom.formatter(d);
|
|
7719
7732
|
});
|
|
7720
7733
|
}
|
|
7721
7734
|
|
|
@@ -7741,8 +7754,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7741
7754
|
|
|
7742
7755
|
if (this.options.margin.axisLeft > 0) {
|
|
7743
7756
|
this.leftAxisLayer.call(d3.axisLeft(this.leftAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
7744
|
-
if (
|
|
7745
|
-
d =
|
|
7757
|
+
if (_this43.options.data.left.formatter) {
|
|
7758
|
+
d = _this43.options.data.left.formatter(d);
|
|
7746
7759
|
}
|
|
7747
7760
|
|
|
7748
7761
|
return d;
|
|
@@ -7779,8 +7792,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7779
7792
|
|
|
7780
7793
|
if (this.options.margin.axisRight > 0 && (this.options.data.right.min !== 0 || this.options.data.right.max !== 0)) {
|
|
7781
7794
|
this.rightAxisLayer.call(d3.axisRight(this.rightAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
7782
|
-
if (
|
|
7783
|
-
d =
|
|
7795
|
+
if (_this43.options.data.right.formatter) {
|
|
7796
|
+
d = _this43.options.data.right.formatter(d);
|
|
7784
7797
|
}
|
|
7785
7798
|
|
|
7786
7799
|
return d;
|
|
@@ -7819,18 +7832,18 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7819
7832
|
this.renderedKeys = {};
|
|
7820
7833
|
this.options.data.series.forEach(function (series, index) {
|
|
7821
7834
|
if (!series.key) {
|
|
7822
|
-
series.key =
|
|
7835
|
+
series.key = _this43.createIdentity();
|
|
7823
7836
|
}
|
|
7824
7837
|
|
|
7825
7838
|
if (!series.color) {
|
|
7826
|
-
series.color =
|
|
7839
|
+
series.color = _this43.options.colors[index % _this43.options.colors.length];
|
|
7827
7840
|
}
|
|
7828
7841
|
|
|
7829
|
-
|
|
7842
|
+
_this43["render".concat(series.type || 'bar')](series, index);
|
|
7830
7843
|
|
|
7831
|
-
|
|
7844
|
+
_this43.renderLabels(series, index);
|
|
7832
7845
|
|
|
7833
|
-
|
|
7846
|
+
_this43.renderedKeys[series.key] = series.type;
|
|
7834
7847
|
});
|
|
7835
7848
|
}
|
|
7836
7849
|
}
|
|
@@ -7838,17 +7851,17 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7838
7851
|
}, {
|
|
7839
7852
|
key: "renderarea",
|
|
7840
7853
|
value: function renderarea(series, index) {
|
|
7841
|
-
var
|
|
7854
|
+
var _this44 = this;
|
|
7842
7855
|
|
|
7843
7856
|
/* global d3 series index */
|
|
7844
7857
|
var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
|
|
7845
7858
|
return d3.area().x(function (d) {
|
|
7846
|
-
return
|
|
7859
|
+
return _this44[xAxis](_this44.parseX(d.x.value));
|
|
7847
7860
|
}).y0(function (d) {
|
|
7848
|
-
return
|
|
7861
|
+
return _this44[yAxis](0);
|
|
7849
7862
|
}).y1(function (d) {
|
|
7850
|
-
return
|
|
7851
|
-
}).curve(d3[curveStyle ||
|
|
7863
|
+
return _this44[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
|
|
7864
|
+
}).curve(d3[curveStyle || _this44.options.curveStyle]);
|
|
7852
7865
|
};
|
|
7853
7866
|
|
|
7854
7867
|
var xAxis = 'bottomAxis';
|
|
@@ -7957,7 +7970,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7957
7970
|
}
|
|
7958
7971
|
}
|
|
7959
7972
|
|
|
7960
|
-
bars.exit().transition(this.transition).style('
|
|
7973
|
+
bars.exit().transition(this.transition).style('fill-opacity', 1e-6).remove();
|
|
7961
7974
|
bars.attr('width', getBarWidth.bind(this)).attr('height', getBarHeight.bind(this)).attr('x', getBarX.bind(this)).attr('y', getBarY.bind(this)).transition(this.transition).attr('fill', function (d) {
|
|
7962
7975
|
return d.y.color || d.color || series.color;
|
|
7963
7976
|
});
|
|
@@ -7968,10 +7981,16 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7968
7981
|
return "bar bar_".concat(series.key);
|
|
7969
7982
|
});
|
|
7970
7983
|
}
|
|
7984
|
+
}, {
|
|
7985
|
+
key: "removebar",
|
|
7986
|
+
value: function removebar(key) {
|
|
7987
|
+
/* global key d3 */
|
|
7988
|
+
var bars = this.barLayer.selectAll(".bar_".concat(key)).transition(this.transition).style('fill-opacity', 1e-6).remove();
|
|
7989
|
+
}
|
|
7971
7990
|
}, {
|
|
7972
7991
|
key: "renderLabels",
|
|
7973
7992
|
value: function renderLabels(series, index) {
|
|
7974
|
-
var
|
|
7993
|
+
var _this45 = this;
|
|
7975
7994
|
|
|
7976
7995
|
/* global series index d3 WebsyDesigns */
|
|
7977
7996
|
var xAxis = 'bottomAxis';
|
|
@@ -7990,11 +8009,11 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7990
8009
|
var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
|
|
7991
8010
|
labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
|
|
7992
8011
|
labels.attr('x', function (d) {
|
|
7993
|
-
return getLabelX.call(
|
|
8012
|
+
return getLabelX.call(_this45, d, series.labelPosition);
|
|
7994
8013
|
}).attr('y', function (d) {
|
|
7995
|
-
return getLabelY.call(
|
|
8014
|
+
return getLabelY.call(_this45, d, series.labelPosition);
|
|
7996
8015
|
}).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
|
|
7997
|
-
return
|
|
8016
|
+
return _this45.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
7998
8017
|
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
|
|
7999
8018
|
return d.y.label || d.y.value;
|
|
8000
8019
|
}).each(function (d, i) {
|
|
@@ -8019,11 +8038,11 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8019
8038
|
}
|
|
8020
8039
|
});
|
|
8021
8040
|
labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', function (d) {
|
|
8022
|
-
return getLabelX.call(
|
|
8041
|
+
return getLabelX.call(_this45, d, series.labelPosition);
|
|
8023
8042
|
}).attr('y', function (d) {
|
|
8024
|
-
return getLabelY.call(
|
|
8043
|
+
return getLabelY.call(_this45, d, series.labelPosition);
|
|
8025
8044
|
}).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
|
|
8026
|
-
return
|
|
8045
|
+
return _this45.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
8027
8046
|
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).text(function (d) {
|
|
8028
8047
|
return d.y.label || d.y.value;
|
|
8029
8048
|
}).each(function (d, i) {
|
|
@@ -8080,16 +8099,16 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8080
8099
|
}, {
|
|
8081
8100
|
key: "renderline",
|
|
8082
8101
|
value: function renderline(series, index) {
|
|
8083
|
-
var
|
|
8102
|
+
var _this46 = this;
|
|
8084
8103
|
|
|
8085
8104
|
/* global series index d3 */
|
|
8086
8105
|
var drawLine = function drawLine(xAxis, yAxis, curveStyle) {
|
|
8087
8106
|
return d3.line().x(function (d) {
|
|
8088
|
-
var adjustment =
|
|
8089
|
-
return
|
|
8107
|
+
var adjustment = _this46.options.data[xAxis].scale === 'Time' ? 0 : _this46["".concat(xAxis, "Axis")].bandwidth() / 2;
|
|
8108
|
+
return _this46["".concat(xAxis, "Axis")](_this46.parseX(d.x.value)) + adjustment;
|
|
8090
8109
|
}).y(function (d) {
|
|
8091
|
-
return
|
|
8092
|
-
}).curve(d3[curveStyle ||
|
|
8110
|
+
return _this46["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
|
|
8111
|
+
}).curve(d3[curveStyle || _this46.options.curveStyle]);
|
|
8093
8112
|
};
|
|
8094
8113
|
|
|
8095
8114
|
var xAxis = 'bottom';
|
|
@@ -8133,14 +8152,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8133
8152
|
}, {
|
|
8134
8153
|
key: "rendersymbol",
|
|
8135
8154
|
value: function rendersymbol(series, index) {
|
|
8136
|
-
var
|
|
8155
|
+
var _this47 = this;
|
|
8137
8156
|
|
|
8138
8157
|
/* global d3 series index series.key */
|
|
8139
8158
|
var drawSymbol = function drawSymbol(size) {
|
|
8140
8159
|
return d3.symbol() // .type(d => {
|
|
8141
8160
|
// return d3.symbols[0]
|
|
8142
8161
|
// })
|
|
8143
|
-
.size(size ||
|
|
8162
|
+
.size(size || _this47.options.symbolSize);
|
|
8144
8163
|
};
|
|
8145
8164
|
|
|
8146
8165
|
var xAxis = 'bottomAxis';
|
|
@@ -8158,7 +8177,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8158
8177
|
symbols.attr('d', function (d) {
|
|
8159
8178
|
return drawSymbol(d.y.size || series.symbolSize)(d);
|
|
8160
8179
|
}).transition(this.transition).attr('fill', 'white').attr('stroke', series.color).attr('transform', function (d) {
|
|
8161
|
-
return "translate(".concat(
|
|
8180
|
+
return "translate(".concat(_this47[xAxis](_this47.parseX(d.x.value)), ", ").concat(_this47[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
8162
8181
|
}); // Enter
|
|
8163
8182
|
|
|
8164
8183
|
symbols.enter().append('path').attr('d', function (d) {
|
|
@@ -8167,7 +8186,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8167
8186
|
.attr('fill', 'white').attr('stroke', series.color).attr('class', function (d) {
|
|
8168
8187
|
return "symbol symbol_".concat(series.key);
|
|
8169
8188
|
}).attr('transform', function (d) {
|
|
8170
|
-
return "translate(".concat(
|
|
8189
|
+
return "translate(".concat(_this47[xAxis](_this47.parseX(d.x.value)), ", ").concat(_this47[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
8171
8190
|
});
|
|
8172
8191
|
}
|
|
8173
8192
|
}, {
|
|
@@ -8322,7 +8341,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
8322
8341
|
}, {
|
|
8323
8342
|
key: "resize",
|
|
8324
8343
|
value: function resize() {
|
|
8325
|
-
var
|
|
8344
|
+
var _this48 = this;
|
|
8326
8345
|
|
|
8327
8346
|
var el = document.getElementById(this.elementId);
|
|
8328
8347
|
|
|
@@ -8335,7 +8354,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
8335
8354
|
// }
|
|
8336
8355
|
var html = "\n <div class='text-".concat(this.options.align, "'>\n ");
|
|
8337
8356
|
html += this._data.map(function (d, i) {
|
|
8338
|
-
return
|
|
8357
|
+
return _this48.getLegendItemHTML(d);
|
|
8339
8358
|
}).join('');
|
|
8340
8359
|
html += "\n <div>\n ";
|
|
8341
8360
|
el.innerHTML = html;
|
|
@@ -8507,7 +8526,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8507
8526
|
}, {
|
|
8508
8527
|
key: "render",
|
|
8509
8528
|
value: function render() {
|
|
8510
|
-
var
|
|
8529
|
+
var _this49 = this;
|
|
8511
8530
|
|
|
8512
8531
|
var mapEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
8513
8532
|
var legendEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
@@ -8516,7 +8535,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8516
8535
|
var legendData = this.options.data.polygons.map(function (s, i) {
|
|
8517
8536
|
return {
|
|
8518
8537
|
value: s.label || s.key,
|
|
8519
|
-
color: s.color ||
|
|
8538
|
+
color: s.color || _this49.options.colors[i % _this49.options.colors.length]
|
|
8520
8539
|
};
|
|
8521
8540
|
});
|
|
8522
8541
|
var longestValue = legendData.map(function (s) {
|
|
@@ -8580,7 +8599,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8580
8599
|
|
|
8581
8600
|
if (this.polygons) {
|
|
8582
8601
|
this.polygons.forEach(function (p) {
|
|
8583
|
-
return
|
|
8602
|
+
return _this49.map.removeLayer(p);
|
|
8584
8603
|
});
|
|
8585
8604
|
}
|
|
8586
8605
|
|
|
@@ -8638,18 +8657,18 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8638
8657
|
}
|
|
8639
8658
|
|
|
8640
8659
|
if (!p.options.color) {
|
|
8641
|
-
p.options.color =
|
|
8660
|
+
p.options.color = _this49.options.colors[i % _this49.options.colors.length];
|
|
8642
8661
|
}
|
|
8643
8662
|
|
|
8644
8663
|
var pol = L.polygon(p.data.map(function (c) {
|
|
8645
8664
|
return c.map(function (d) {
|
|
8646
8665
|
return [d.Latitude, d.Longitude];
|
|
8647
8666
|
});
|
|
8648
|
-
}), p.options).addTo(
|
|
8667
|
+
}), p.options).addTo(_this49.map);
|
|
8649
8668
|
|
|
8650
|
-
|
|
8669
|
+
_this49.polygons.push(pol);
|
|
8651
8670
|
|
|
8652
|
-
|
|
8671
|
+
_this49.map.fitBounds(pol.getBounds());
|
|
8653
8672
|
});
|
|
8654
8673
|
} // if (this.data.markers.length > 0) {
|
|
8655
8674
|
// el.classList.remove('hidden')
|