@websy/websy-designs 1.4.10 → 1.4.12
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/components/icons/bag-icon.svg +11 -0
- package/dist/components/icons/dock-left-icon.svg +9 -0
- package/dist/components/icons/dock-right-icon.svg +9 -0
- package/dist/components/icons/index.js +45 -0
- package/dist/components/icons/minus-filled-icon.svg +10 -0
- package/dist/components/icons/minus-icon.svg +3 -0
- package/dist/components/icons/pin-icon.svg +11 -0
- package/dist/components/icons/plus-filled-icon.svg +11 -0
- package/dist/components/icons/plus-icon.svg +4 -0
- package/dist/components/icons/search-icon.svg +7 -0
- package/dist/components/icons/user-icon.svg +9 -0
- package/dist/components/icons/window-popout-icon.svg +9 -0
- package/dist/generic.css +4 -10
- package/dist/server/helpers/v1/pgHelper.js +2 -2
- package/dist/websy-designs-es6.debug.js +16 -11
- package/dist/websy-designs-es6.js +247 -243
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +16 -11
- package/dist/websy-designs.js +250 -246
- package/dist/websy-designs.min.css +1 -1
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
package/dist/websy-designs.js
CHANGED
|
@@ -773,13 +773,14 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
773
773
|
} else if (event.target.classList.contains('websy-dp-cancel')) {
|
|
774
774
|
this.close();
|
|
775
775
|
} else if (event.target.classList.contains('clear-selection')) {
|
|
776
|
+
this.currentselection = [];
|
|
777
|
+
this.selectedRangeDates = [];
|
|
776
778
|
this.selectRange(0, false);
|
|
777
779
|
|
|
778
780
|
if (this.options.onClear) {
|
|
779
781
|
this.options.onClear();
|
|
780
|
-
}
|
|
782
|
+
} // this.updateRange(0)
|
|
781
783
|
|
|
782
|
-
this.updateRange(0);
|
|
783
784
|
}
|
|
784
785
|
}
|
|
785
786
|
}, {
|
|
@@ -1353,29 +1354,32 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1353
1354
|
}, {
|
|
1354
1355
|
key: "selectRange",
|
|
1355
1356
|
value: function selectRange(index) {
|
|
1356
|
-
var _this8 = this;
|
|
1357
|
-
|
|
1358
1357
|
var confirm = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
1359
1358
|
|
|
1360
1359
|
if (this.options.ranges[this.options.mode][index]) {
|
|
1361
1360
|
this.selectedRangeDates = _toConsumableArray(this.options.ranges[this.options.mode][index].range);
|
|
1362
|
-
this.currentselection = this.options.ranges[this.options.mode][index].range.map(
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
}
|
|
1361
|
+
this.currentselection = []; // this.currentselection = this.options.ranges[this.options.mode][index].range.map(d => {
|
|
1362
|
+
// if (this.options.mode === 'date' || this.options.mode === 'monthyear') {
|
|
1363
|
+
// return d.getTime()
|
|
1364
|
+
// }
|
|
1365
|
+
// else {
|
|
1366
|
+
// return d
|
|
1367
|
+
// }
|
|
1368
|
+
// })
|
|
1369
|
+
|
|
1369
1370
|
this.selectedRange = +index;
|
|
1370
1371
|
this.highlightRange();
|
|
1371
1372
|
this.updateRange();
|
|
1372
|
-
|
|
1373
|
+
|
|
1374
|
+
if (confirm === true) {
|
|
1375
|
+
this.close(confirm, true);
|
|
1376
|
+
}
|
|
1373
1377
|
}
|
|
1374
1378
|
}
|
|
1375
1379
|
}, {
|
|
1376
1380
|
key: "selectCustomRange",
|
|
1377
1381
|
value: function selectCustomRange(rangeInput) {
|
|
1378
|
-
var
|
|
1382
|
+
var _this8 = this;
|
|
1379
1383
|
|
|
1380
1384
|
this.selectedRange = -1;
|
|
1381
1385
|
this.isContinuousRange = true; // if (rangeInput.length === 1) {
|
|
@@ -1391,13 +1395,13 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1391
1395
|
this.customRangeSelected = true;
|
|
1392
1396
|
rangeInput.forEach(function (r, i) {
|
|
1393
1397
|
if (i > 0) {
|
|
1394
|
-
if (
|
|
1395
|
-
if (r.getTime() /
|
|
1396
|
-
|
|
1398
|
+
if (_this8.options.mode === 'date' || _this8.options.mode === 'monthyear') {
|
|
1399
|
+
if (r.getTime() / _this8.oneDay - rangeInput[i - 1] / _this8.oneDay > 1) {
|
|
1400
|
+
_this8.isContinuousRange = false;
|
|
1397
1401
|
}
|
|
1398
|
-
} else if (
|
|
1402
|
+
} else if (_this8.options.mode === 'hour' || _this8.options.mode === 'year') {
|
|
1399
1403
|
if (r - rangeInput[i - 1] > 1) {
|
|
1400
|
-
|
|
1404
|
+
_this8.isContinuousRange = false;
|
|
1401
1405
|
}
|
|
1402
1406
|
}
|
|
1403
1407
|
}
|
|
@@ -1476,27 +1480,27 @@ var WebsyDatePicker = /*#__PURE__*/function () {
|
|
|
1476
1480
|
}, {
|
|
1477
1481
|
key: "updateRange",
|
|
1478
1482
|
value: function updateRange() {
|
|
1479
|
-
var
|
|
1483
|
+
var _this9 = this;
|
|
1480
1484
|
|
|
1481
1485
|
var range;
|
|
1482
1486
|
|
|
1483
1487
|
if (this.selectedRange === -1) {
|
|
1484
1488
|
var list = (this.currentselection.length > 0 ? this.currentselection : this.selectedRangeDates).map(function (d) {
|
|
1485
|
-
if (
|
|
1489
|
+
if (_this9.options.mode === 'date') {
|
|
1486
1490
|
if (!d.toLocaleDateString) {
|
|
1487
1491
|
d = new Date(d);
|
|
1488
1492
|
}
|
|
1489
1493
|
|
|
1490
1494
|
return d.toLocaleDateString();
|
|
1491
|
-
} else if (
|
|
1495
|
+
} else if (_this9.options.mode === 'year') {
|
|
1492
1496
|
return d;
|
|
1493
|
-
} else if (
|
|
1497
|
+
} else if (_this9.options.mode === 'monthyear') {
|
|
1494
1498
|
if (!d.getMonth) {
|
|
1495
1499
|
d = new Date(d);
|
|
1496
1500
|
}
|
|
1497
1501
|
|
|
1498
|
-
return "".concat(
|
|
1499
|
-
} else if (
|
|
1502
|
+
return "".concat(_this9.options.monthMap[d.getMonth()], " ").concat(d.getFullYear());
|
|
1503
|
+
} else if (_this9.options.mode === 'hour') {
|
|
1500
1504
|
return d;
|
|
1501
1505
|
}
|
|
1502
1506
|
});
|
|
@@ -1569,7 +1573,7 @@ Date.prototype.floor = function () {
|
|
|
1569
1573
|
|
|
1570
1574
|
var WebsyDropdown = /*#__PURE__*/function () {
|
|
1571
1575
|
function WebsyDropdown(elementId, options) {
|
|
1572
|
-
var
|
|
1576
|
+
var _this10 = this;
|
|
1573
1577
|
|
|
1574
1578
|
_classCallCheck(this, WebsyDropdown);
|
|
1575
1579
|
|
|
@@ -1618,10 +1622,10 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1618
1622
|
el.addEventListener('mouseout', this.handleMouseOut.bind(this));
|
|
1619
1623
|
el.addEventListener('mousemove', this.handleMouseMove.bind(this));
|
|
1620
1624
|
var headerLabel = this.selectedItems.map(function (s) {
|
|
1621
|
-
return
|
|
1625
|
+
return _this10.options.items[s].label || _this10.options.items[s].value;
|
|
1622
1626
|
}).join(this.options.multiValueDelimiter);
|
|
1623
1627
|
var headerValue = this.selectedItems.map(function (s) {
|
|
1624
|
-
return
|
|
1628
|
+
return _this10.options.items[s].value || _this10.options.items[s].label;
|
|
1625
1629
|
}).join(this.options.multiValueDelimiter);
|
|
1626
1630
|
var html = "\n <div id='".concat(this.elementId, "_container' class='websy-dropdown-container ").concat(this.options.disabled ? 'disabled' : '', " ").concat(this.options.disableSearch !== true ? 'with-search' : '', " ").concat(this.options.style, " ").concat(this.options.customActions.length > 0 ? 'with-actions' : '', "'>\n <div id='").concat(this.elementId, "_header' class='websy-dropdown-header ").concat(this.selectedItems.length === 1 ? 'one-selected' : '', " ").concat(this.options.allowClear === true ? 'allow-clear' : '', "'>\n ");
|
|
1627
1631
|
|
|
@@ -1915,10 +1919,10 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1915
1919
|
}, {
|
|
1916
1920
|
key: "renderItems",
|
|
1917
1921
|
value: function renderItems() {
|
|
1918
|
-
var
|
|
1922
|
+
var _this11 = this;
|
|
1919
1923
|
|
|
1920
1924
|
var html = this.options.items.map(function (r, i) {
|
|
1921
|
-
return "\n <li data-index='".concat(r.index, "' class='websy-dropdown-item ").concat((r.classes || []).join(' '), " ").concat(
|
|
1925
|
+
return "\n <li data-index='".concat(r.index, "' class='websy-dropdown-item ").concat((r.classes || []).join(' '), " ").concat(_this11.selectedItems.indexOf(r.index) !== -1 ? 'active' : '', "'>").concat(r.label, "</li>\n ");
|
|
1922
1926
|
}).join('');
|
|
1923
1927
|
var el = document.getElementById("".concat(this.elementId, "_items"));
|
|
1924
1928
|
|
|
@@ -2388,7 +2392,7 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
2388
2392
|
}, {
|
|
2389
2393
|
key: "render",
|
|
2390
2394
|
value: function render() {
|
|
2391
|
-
var
|
|
2395
|
+
var _this12 = this;
|
|
2392
2396
|
|
|
2393
2397
|
var el = document.getElementById("".concat(this.elementId, "_container"));
|
|
2394
2398
|
|
|
@@ -2396,7 +2400,7 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
2396
2400
|
this.measureItems();
|
|
2397
2401
|
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 ");
|
|
2398
2402
|
html += this.options.items.map(function (d, i) {
|
|
2399
|
-
return
|
|
2403
|
+
return _this12.createItemHtml(_this12.elementId, i, d);
|
|
2400
2404
|
}).join('');
|
|
2401
2405
|
el.innerHTML = html;
|
|
2402
2406
|
this.options.items.forEach(function (item, i) {
|
|
@@ -2475,16 +2479,16 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2475
2479
|
}, {
|
|
2476
2480
|
key: "checkRecaptcha",
|
|
2477
2481
|
value: function checkRecaptcha() {
|
|
2478
|
-
var
|
|
2482
|
+
var _this13 = this;
|
|
2479
2483
|
|
|
2480
2484
|
return new Promise(function (resolve, reject) {
|
|
2481
|
-
if (
|
|
2485
|
+
if (_this13.options.useRecaptcha === true) {
|
|
2482
2486
|
// if (this.recaptchaValue) {
|
|
2483
2487
|
grecaptcha.ready(function () {
|
|
2484
2488
|
grecaptcha.execute(ENVIRONMENT.RECAPTCHA_KEY, {
|
|
2485
2489
|
action: 'submit'
|
|
2486
2490
|
}).then(function (token) {
|
|
2487
|
-
|
|
2491
|
+
_this13.apiService.add('google/checkrecaptcha', {
|
|
2488
2492
|
grecaptcharesponse: token
|
|
2489
2493
|
}).then(function (response) {
|
|
2490
2494
|
if (response.success && response.success === true) {
|
|
@@ -2547,14 +2551,14 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2547
2551
|
}, {
|
|
2548
2552
|
key: "processComponents",
|
|
2549
2553
|
value: function processComponents(components, callbackFn) {
|
|
2550
|
-
var
|
|
2554
|
+
var _this14 = this;
|
|
2551
2555
|
|
|
2552
2556
|
if (components.length === 0) {
|
|
2553
2557
|
callbackFn();
|
|
2554
2558
|
} else {
|
|
2555
2559
|
components.forEach(function (c) {
|
|
2556
2560
|
if (typeof WebsyDesigns[c.component] !== 'undefined') {
|
|
2557
|
-
c.instance = new WebsyDesigns[c.component]("".concat(
|
|
2561
|
+
c.instance = new WebsyDesigns[c.component]("".concat(_this14.elementId, "_input_").concat(c.field, "_component"), c.options);
|
|
2558
2562
|
} else {// some user feedback here
|
|
2559
2563
|
}
|
|
2560
2564
|
});
|
|
@@ -2575,7 +2579,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2575
2579
|
}, {
|
|
2576
2580
|
key: "render",
|
|
2577
2581
|
value: function render(update, data) {
|
|
2578
|
-
var
|
|
2582
|
+
var _this15 = this;
|
|
2579
2583
|
|
|
2580
2584
|
var el = document.getElementById(this.elementId);
|
|
2581
2585
|
var componentsToProcess = [];
|
|
@@ -2585,11 +2589,11 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2585
2589
|
this.options.fields.forEach(function (f, i) {
|
|
2586
2590
|
if (f.component) {
|
|
2587
2591
|
componentsToProcess.push(f);
|
|
2588
|
-
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(
|
|
2592
|
+
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(_this15.elementId, "_input_").concat(f.field, "_component' class='form-component'></div>\n </div><!--\n ");
|
|
2589
2593
|
} else if (f.type === 'longtext') {
|
|
2590
|
-
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(
|
|
2594
|
+
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(_this15.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 ");
|
|
2591
2595
|
} else {
|
|
2592
|
-
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(
|
|
2596
|
+
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(_this15.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 ");
|
|
2593
2597
|
}
|
|
2594
2598
|
});
|
|
2595
2599
|
html += "\n --><button class=\"websy-btn submit ".concat(this.options.submit.classes || '', "\">").concat(this.options.submit.text || 'Save', "</button>").concat(this.options.cancel ? '<!--' : '', "\n ");
|
|
@@ -2606,7 +2610,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2606
2610
|
|
|
2607
2611
|
el.innerHTML = html;
|
|
2608
2612
|
this.processComponents(componentsToProcess, function () {
|
|
2609
|
-
if (
|
|
2613
|
+
if (_this15.options.useRecaptcha === true && typeof grecaptcha !== 'undefined') {// this.recaptchaReady()
|
|
2610
2614
|
}
|
|
2611
2615
|
});
|
|
2612
2616
|
}
|
|
@@ -2614,7 +2618,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2614
2618
|
}, {
|
|
2615
2619
|
key: "submitForm",
|
|
2616
2620
|
value: function submitForm() {
|
|
2617
|
-
var
|
|
2621
|
+
var _this16 = this;
|
|
2618
2622
|
|
|
2619
2623
|
var formEl = document.getElementById("".concat(this.elementId, "Form"));
|
|
2620
2624
|
|
|
@@ -2628,32 +2632,32 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2628
2632
|
data[key] = value;
|
|
2629
2633
|
});
|
|
2630
2634
|
|
|
2631
|
-
if (
|
|
2632
|
-
var
|
|
2635
|
+
if (_this16.options.url) {
|
|
2636
|
+
var _this16$apiService;
|
|
2633
2637
|
|
|
2634
|
-
var params = [
|
|
2638
|
+
var params = [_this16.options.url];
|
|
2635
2639
|
|
|
2636
|
-
if (
|
|
2637
|
-
params.push(
|
|
2640
|
+
if (_this16.options.mode === 'update') {
|
|
2641
|
+
params.push(_this16.options.id);
|
|
2638
2642
|
}
|
|
2639
2643
|
|
|
2640
2644
|
params.push(data);
|
|
2641
2645
|
|
|
2642
|
-
(
|
|
2643
|
-
if (
|
|
2646
|
+
(_this16$apiService = _this16.apiService)[_this16.options.mode].apply(_this16$apiService, params).then(function (result) {
|
|
2647
|
+
if (_this16.options.clearAfterSave === true) {
|
|
2644
2648
|
// this.render()
|
|
2645
2649
|
formEl.reset();
|
|
2646
2650
|
}
|
|
2647
2651
|
|
|
2648
|
-
|
|
2652
|
+
_this16.options.onSuccess.call(_this16, result);
|
|
2649
2653
|
}, function (err) {
|
|
2650
2654
|
console.log('Error submitting form data:', err);
|
|
2651
2655
|
|
|
2652
|
-
|
|
2656
|
+
_this16.options.onError.call(_this16, err);
|
|
2653
2657
|
});
|
|
2654
|
-
} else if (
|
|
2655
|
-
|
|
2656
|
-
if (
|
|
2658
|
+
} else if (_this16.options.submitFn) {
|
|
2659
|
+
_this16.options.submitFn(data, function () {
|
|
2660
|
+
if (_this16.options.clearAfterSave === true) {
|
|
2657
2661
|
// this.render()
|
|
2658
2662
|
formEl.reset();
|
|
2659
2663
|
}
|
|
@@ -2673,17 +2677,17 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2673
2677
|
}, {
|
|
2674
2678
|
key: "data",
|
|
2675
2679
|
set: function set(d) {
|
|
2676
|
-
var
|
|
2680
|
+
var _this17 = this;
|
|
2677
2681
|
|
|
2678
2682
|
if (!this.options.fields) {
|
|
2679
2683
|
this.options.fields = [];
|
|
2680
2684
|
}
|
|
2681
2685
|
|
|
2682
2686
|
var _loop = function _loop(key) {
|
|
2683
|
-
|
|
2687
|
+
_this17.options.fields.forEach(function (f) {
|
|
2684
2688
|
if (f.field === key) {
|
|
2685
2689
|
f.value = d[key];
|
|
2686
|
-
var el = document.getElementById("".concat(
|
|
2690
|
+
var el = document.getElementById("".concat(_this17.elementId, "_input_").concat(f.field));
|
|
2687
2691
|
el.value = f.value;
|
|
2688
2692
|
}
|
|
2689
2693
|
});
|
|
@@ -2951,11 +2955,11 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2951
2955
|
}, {
|
|
2952
2956
|
key: "handleSearch",
|
|
2953
2957
|
value: function handleSearch(searchText) {
|
|
2954
|
-
var
|
|
2958
|
+
var _this18 = this;
|
|
2955
2959
|
|
|
2956
2960
|
var el = document.getElementById(this.elementId);
|
|
2957
2961
|
var lowestItems = this.flatItems.filter(function (d) {
|
|
2958
|
-
return d.level ===
|
|
2962
|
+
return d.level === _this18.maxLevel;
|
|
2959
2963
|
});
|
|
2960
2964
|
var visibleItems = lowestItems;
|
|
2961
2965
|
var defaultMethod = 'remove';
|
|
@@ -2963,7 +2967,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2963
2967
|
if (searchText.length > 1) {
|
|
2964
2968
|
defaultMethod = 'add';
|
|
2965
2969
|
visibleItems = lowestItems.filter(function (d) {
|
|
2966
|
-
return d[
|
|
2970
|
+
return d[_this18.options.searchProp].toLowerCase().indexOf(searchText.toLowerCase()) !== -1;
|
|
2967
2971
|
});
|
|
2968
2972
|
} // hide everything
|
|
2969
2973
|
|
|
@@ -3147,7 +3151,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
3147
3151
|
|
|
3148
3152
|
var Pager = /*#__PURE__*/function () {
|
|
3149
3153
|
function Pager(elementId, options) {
|
|
3150
|
-
var
|
|
3154
|
+
var _this19 = this;
|
|
3151
3155
|
|
|
3152
3156
|
_classCallCheck(this, Pager);
|
|
3153
3157
|
|
|
@@ -3200,8 +3204,8 @@ var Pager = /*#__PURE__*/function () {
|
|
|
3200
3204
|
allowClear: false,
|
|
3201
3205
|
disableSearch: true,
|
|
3202
3206
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
3203
|
-
if (
|
|
3204
|
-
|
|
3207
|
+
if (_this19.options.onChangePageSize) {
|
|
3208
|
+
_this19.options.onChangePageSize(selectedItem.value);
|
|
3205
3209
|
}
|
|
3206
3210
|
}
|
|
3207
3211
|
});
|
|
@@ -3225,13 +3229,13 @@ var Pager = /*#__PURE__*/function () {
|
|
|
3225
3229
|
}, {
|
|
3226
3230
|
key: "render",
|
|
3227
3231
|
value: function render() {
|
|
3228
|
-
var
|
|
3232
|
+
var _this20 = this;
|
|
3229
3233
|
|
|
3230
3234
|
var el = document.getElementById("".concat(this.elementId, "_pageList"));
|
|
3231
3235
|
|
|
3232
3236
|
if (el) {
|
|
3233
3237
|
var pages = this.options.pages.map(function (item, index) {
|
|
3234
|
-
return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
3238
|
+
return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(_this20.options.activePage === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
3235
3239
|
});
|
|
3236
3240
|
var startIndex = 0;
|
|
3237
3241
|
|
|
@@ -3299,58 +3303,58 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
3299
3303
|
_createClass(WebsyPDFButton, [{
|
|
3300
3304
|
key: "handleClick",
|
|
3301
3305
|
value: function handleClick(event) {
|
|
3302
|
-
var
|
|
3306
|
+
var _this21 = this;
|
|
3303
3307
|
|
|
3304
3308
|
if (event.target.classList.contains('websy-pdf-button')) {
|
|
3305
3309
|
this.loader.show();
|
|
3306
3310
|
setTimeout(function () {
|
|
3307
|
-
if (
|
|
3308
|
-
var el = document.getElementById(
|
|
3311
|
+
if (_this21.options.targetId) {
|
|
3312
|
+
var el = document.getElementById(_this21.options.targetId);
|
|
3309
3313
|
|
|
3310
3314
|
if (el) {
|
|
3311
3315
|
var pdfData = {
|
|
3312
3316
|
options: {}
|
|
3313
3317
|
};
|
|
3314
3318
|
|
|
3315
|
-
if (
|
|
3316
|
-
pdfData.options = _extends({},
|
|
3319
|
+
if (_this21.options.pdfOptions) {
|
|
3320
|
+
pdfData.options = _extends({}, _this21.options.pdfOptions);
|
|
3317
3321
|
}
|
|
3318
3322
|
|
|
3319
|
-
if (
|
|
3320
|
-
if (
|
|
3321
|
-
var headerEl = document.getElementById(
|
|
3323
|
+
if (_this21.options.header) {
|
|
3324
|
+
if (_this21.options.header.elementId) {
|
|
3325
|
+
var headerEl = document.getElementById(_this21.options.header.elementId);
|
|
3322
3326
|
|
|
3323
3327
|
if (headerEl) {
|
|
3324
3328
|
pdfData.header = headerEl.outerHTML;
|
|
3325
3329
|
|
|
3326
|
-
if (
|
|
3327
|
-
pdfData.options.headerCSS =
|
|
3330
|
+
if (_this21.options.header.css) {
|
|
3331
|
+
pdfData.options.headerCSS = _this21.options.header.css;
|
|
3328
3332
|
}
|
|
3329
3333
|
}
|
|
3330
|
-
} else if (
|
|
3331
|
-
pdfData.header =
|
|
3334
|
+
} else if (_this21.options.header.html) {
|
|
3335
|
+
pdfData.header = _this21.options.header.html;
|
|
3332
3336
|
|
|
3333
|
-
if (
|
|
3334
|
-
pdfData.options.headerCSS =
|
|
3337
|
+
if (_this21.options.header.css) {
|
|
3338
|
+
pdfData.options.headerCSS = _this21.options.header.css;
|
|
3335
3339
|
}
|
|
3336
3340
|
} else {
|
|
3337
|
-
pdfData.header =
|
|
3341
|
+
pdfData.header = _this21.options.header;
|
|
3338
3342
|
}
|
|
3339
3343
|
}
|
|
3340
3344
|
|
|
3341
|
-
if (
|
|
3342
|
-
if (
|
|
3343
|
-
var footerEl = document.getElementById(
|
|
3345
|
+
if (_this21.options.footer) {
|
|
3346
|
+
if (_this21.options.footer.elementId) {
|
|
3347
|
+
var footerEl = document.getElementById(_this21.options.footer.elementId);
|
|
3344
3348
|
|
|
3345
3349
|
if (footerEl) {
|
|
3346
3350
|
pdfData.footer = footerEl.outerHTML;
|
|
3347
3351
|
|
|
3348
|
-
if (
|
|
3349
|
-
pdfData.options.footerCSS =
|
|
3352
|
+
if (_this21.options.footer.css) {
|
|
3353
|
+
pdfData.options.footerCSS = _this21.options.footer.css;
|
|
3350
3354
|
}
|
|
3351
3355
|
}
|
|
3352
3356
|
} else {
|
|
3353
|
-
pdfData.footer =
|
|
3357
|
+
pdfData.footer = _this21.options.footer;
|
|
3354
3358
|
}
|
|
3355
3359
|
}
|
|
3356
3360
|
|
|
@@ -3359,31 +3363,31 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
3359
3363
|
// document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
|
|
3360
3364
|
// document.getElementById(`${this.elementId}_form`).submit()
|
|
3361
3365
|
|
|
3362
|
-
|
|
3366
|
+
_this21.service.add('', pdfData, {
|
|
3363
3367
|
responseType: 'blob'
|
|
3364
3368
|
}).then(function (response) {
|
|
3365
|
-
|
|
3369
|
+
_this21.loader.hide();
|
|
3366
3370
|
|
|
3367
3371
|
var blob = new Blob([response], {
|
|
3368
3372
|
type: 'application/pdf'
|
|
3369
3373
|
});
|
|
3370
3374
|
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 ");
|
|
3371
3375
|
|
|
3372
|
-
if (
|
|
3376
|
+
if (_this21.options.directDownload === true) {
|
|
3373
3377
|
var fileName;
|
|
3374
3378
|
|
|
3375
|
-
if (typeof
|
|
3376
|
-
fileName =
|
|
3379
|
+
if (typeof _this21.options.fileName === 'function') {
|
|
3380
|
+
fileName = _this21.options.fileName() || 'Export';
|
|
3377
3381
|
} else {
|
|
3378
|
-
fileName =
|
|
3382
|
+
fileName = _this21.options.fileName || 'Export';
|
|
3379
3383
|
}
|
|
3380
3384
|
|
|
3381
3385
|
msg += "download='".concat(fileName, ".pdf'");
|
|
3382
3386
|
}
|
|
3383
3387
|
|
|
3384
|
-
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(
|
|
3388
|
+
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this21.options.buttonText, "</button>\n </a>\n </div>\n ");
|
|
3385
3389
|
|
|
3386
|
-
|
|
3390
|
+
_this21.popup.show({
|
|
3387
3391
|
message: msg,
|
|
3388
3392
|
mask: true
|
|
3389
3393
|
});
|
|
@@ -3584,7 +3588,7 @@ var WebsyPubSub = /*#__PURE__*/function () {
|
|
|
3584
3588
|
|
|
3585
3589
|
var ResponsiveText = /*#__PURE__*/function () {
|
|
3586
3590
|
function ResponsiveText(elementId, options) {
|
|
3587
|
-
var
|
|
3591
|
+
var _this22 = this;
|
|
3588
3592
|
|
|
3589
3593
|
_classCallCheck(this, ResponsiveText);
|
|
3590
3594
|
|
|
@@ -3597,7 +3601,7 @@ var ResponsiveText = /*#__PURE__*/function () {
|
|
|
3597
3601
|
this.elementId = elementId;
|
|
3598
3602
|
this.canvas = document.createElement('canvas');
|
|
3599
3603
|
window.addEventListener('resize', function () {
|
|
3600
|
-
return
|
|
3604
|
+
return _this22.render();
|
|
3601
3605
|
});
|
|
3602
3606
|
var el = document.getElementById(this.elementId);
|
|
3603
3607
|
|
|
@@ -3816,7 +3820,7 @@ var ResponsiveText = /*#__PURE__*/function () {
|
|
|
3816
3820
|
|
|
3817
3821
|
var WebsyResultList = /*#__PURE__*/function () {
|
|
3818
3822
|
function WebsyResultList(elementId, options) {
|
|
3819
|
-
var
|
|
3823
|
+
var _this23 = this;
|
|
3820
3824
|
|
|
3821
3825
|
_classCallCheck(this, WebsyResultList);
|
|
3822
3826
|
|
|
@@ -3848,9 +3852,9 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3848
3852
|
|
|
3849
3853
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
3850
3854
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
3851
|
-
|
|
3855
|
+
_this23.options.template = templateString;
|
|
3852
3856
|
|
|
3853
|
-
|
|
3857
|
+
_this23.render();
|
|
3854
3858
|
});
|
|
3855
3859
|
} else {
|
|
3856
3860
|
this.render();
|
|
@@ -3870,7 +3874,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3870
3874
|
}, {
|
|
3871
3875
|
key: "buildHTML",
|
|
3872
3876
|
value: function buildHTML(d) {
|
|
3873
|
-
var
|
|
3877
|
+
var _this24 = this;
|
|
3874
3878
|
|
|
3875
3879
|
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
3876
3880
|
var inputTemplate = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -3880,7 +3884,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3880
3884
|
if (this.options.template) {
|
|
3881
3885
|
if (d.length > 0) {
|
|
3882
3886
|
d.forEach(function (row, ix) {
|
|
3883
|
-
var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate ||
|
|
3887
|
+
var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate || _this24.options.template).concat(ix < d.length - 1 ? '<!--' : ''); // find conditional elements
|
|
3884
3888
|
|
|
3885
3889
|
var ifMatches = _toConsumableArray(template.matchAll(/<\s*if[^>]*>([\s\S]*?)<\s*\/\s*if>/g));
|
|
3886
3890
|
|
|
@@ -3985,7 +3989,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3985
3989
|
parts.forEach(function (p) {
|
|
3986
3990
|
items = items[p];
|
|
3987
3991
|
});
|
|
3988
|
-
template = template.replace(m[0],
|
|
3992
|
+
template = template.replace(m[0], _this24.buildHTML(items, 0, withoutFor, [].concat(_toConsumableArray(locator), ["".concat(startIndex + ix, ":").concat(c)])));
|
|
3989
3993
|
}
|
|
3990
3994
|
});
|
|
3991
3995
|
|
|
@@ -3997,7 +4001,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3997
4001
|
}
|
|
3998
4002
|
});
|
|
3999
4003
|
|
|
4000
|
-
var flatRow =
|
|
4004
|
+
var flatRow = _this24.flattenObject(row);
|
|
4001
4005
|
|
|
4002
4006
|
for (var key in flatRow) {
|
|
4003
4007
|
var rg = new RegExp("{".concat(key, "}"), 'gm');
|
|
@@ -4132,13 +4136,13 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
4132
4136
|
}, {
|
|
4133
4137
|
key: "render",
|
|
4134
4138
|
value: function render() {
|
|
4135
|
-
var
|
|
4139
|
+
var _this25 = this;
|
|
4136
4140
|
|
|
4137
4141
|
if (this.options.entity) {
|
|
4138
4142
|
this.apiService.get(this.options.entity).then(function (results) {
|
|
4139
|
-
|
|
4143
|
+
_this25.rows = results.rows;
|
|
4140
4144
|
|
|
4141
|
-
|
|
4145
|
+
_this25.resize();
|
|
4142
4146
|
});
|
|
4143
4147
|
} else {
|
|
4144
4148
|
this.resize();
|
|
@@ -4224,14 +4228,14 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4224
4228
|
_createClass(WebsyRouter, [{
|
|
4225
4229
|
key: "addGroup",
|
|
4226
4230
|
value: function addGroup(group) {
|
|
4227
|
-
var
|
|
4231
|
+
var _this26 = this;
|
|
4228
4232
|
|
|
4229
4233
|
if (!this.groups[group]) {
|
|
4230
4234
|
var els = document.querySelectorAll(".websy-view[data-group=\"".concat(group, "\"]"));
|
|
4231
4235
|
|
|
4232
4236
|
if (els) {
|
|
4233
4237
|
this.getClosestParent(els[0], function (parent) {
|
|
4234
|
-
|
|
4238
|
+
_this26.groups[group] = {
|
|
4235
4239
|
activeView: '',
|
|
4236
4240
|
views: [],
|
|
4237
4241
|
parent: parent.getAttribute('data-view')
|
|
@@ -4294,7 +4298,7 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4294
4298
|
}, {
|
|
4295
4299
|
key: "removeUrlParams",
|
|
4296
4300
|
value: function removeUrlParams() {
|
|
4297
|
-
var
|
|
4301
|
+
var _this27 = this;
|
|
4298
4302
|
|
|
4299
4303
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
4300
4304
|
var reloadView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -4308,7 +4312,7 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4308
4312
|
|
|
4309
4313
|
if (this.currentParams && this.currentParams.items) {
|
|
4310
4314
|
params.forEach(function (p) {
|
|
4311
|
-
delete
|
|
4315
|
+
delete _this27.currentParams.items[p];
|
|
4312
4316
|
});
|
|
4313
4317
|
path = this.buildUrlPath(this.currentParams.items);
|
|
4314
4318
|
}
|
|
@@ -4672,12 +4676,12 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4672
4676
|
}, {
|
|
4673
4677
|
key: "showComponents",
|
|
4674
4678
|
value: function showComponents(view) {
|
|
4675
|
-
var
|
|
4679
|
+
var _this28 = this;
|
|
4676
4680
|
|
|
4677
4681
|
if (this.options.views && this.options.views[view] && this.options.views[view].components) {
|
|
4678
4682
|
this.options.views[view].components.forEach(function (c) {
|
|
4679
4683
|
if (typeof c.instance === 'undefined') {
|
|
4680
|
-
|
|
4684
|
+
_this28.prepComponent(c.elementId, c.options);
|
|
4681
4685
|
|
|
4682
4686
|
c.instance = new c.Component(c.elementId, c.options);
|
|
4683
4687
|
} else if (c.instance.render) {
|
|
@@ -5032,7 +5036,7 @@ var WebsySearch = /*#__PURE__*/function () {
|
|
|
5032
5036
|
}, {
|
|
5033
5037
|
key: "handleKeyUp",
|
|
5034
5038
|
value: function handleKeyUp(event) {
|
|
5035
|
-
var
|
|
5039
|
+
var _this29 = this;
|
|
5036
5040
|
|
|
5037
5041
|
if (event.target.classList.contains('websy-search-input')) {
|
|
5038
5042
|
if (this.searchTimeoutFn) {
|
|
@@ -5051,8 +5055,8 @@ var WebsySearch = /*#__PURE__*/function () {
|
|
|
5051
5055
|
|
|
5052
5056
|
if (event.target.value.length >= this.options.minLength) {
|
|
5053
5057
|
this.searchTimeoutFn = setTimeout(function () {
|
|
5054
|
-
if (
|
|
5055
|
-
|
|
5058
|
+
if (_this29.options.onSearch) {
|
|
5059
|
+
_this29.options.onSearch(event.target.value);
|
|
5056
5060
|
}
|
|
5057
5061
|
}, this.options.searchTimeout);
|
|
5058
5062
|
} else {
|
|
@@ -5214,7 +5218,7 @@ var Switch = /*#__PURE__*/function () {
|
|
|
5214
5218
|
|
|
5215
5219
|
var WebsyTemplate = /*#__PURE__*/function () {
|
|
5216
5220
|
function WebsyTemplate(elementId, options) {
|
|
5217
|
-
var
|
|
5221
|
+
var _this30 = this;
|
|
5218
5222
|
|
|
5219
5223
|
_classCallCheck(this, WebsyTemplate);
|
|
5220
5224
|
|
|
@@ -5240,9 +5244,9 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
5240
5244
|
|
|
5241
5245
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
5242
5246
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
5243
|
-
|
|
5247
|
+
_this30.options.template = templateString;
|
|
5244
5248
|
|
|
5245
|
-
|
|
5249
|
+
_this30.render();
|
|
5246
5250
|
});
|
|
5247
5251
|
} else {
|
|
5248
5252
|
this.render();
|
|
@@ -5252,7 +5256,7 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
5252
5256
|
_createClass(WebsyTemplate, [{
|
|
5253
5257
|
key: "buildHTML",
|
|
5254
5258
|
value: function buildHTML() {
|
|
5255
|
-
var
|
|
5259
|
+
var _this31 = this;
|
|
5256
5260
|
|
|
5257
5261
|
var html = "";
|
|
5258
5262
|
|
|
@@ -5314,14 +5318,14 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
5314
5318
|
}
|
|
5315
5319
|
|
|
5316
5320
|
if (polarity === true) {
|
|
5317
|
-
if (typeof
|
|
5321
|
+
if (typeof _this31.options.data[parts[0]] !== 'undefined' && _this31.options.data[parts[0]] === parts[1]) {
|
|
5318
5322
|
// remove the <if> tags
|
|
5319
5323
|
removeAll = false;
|
|
5320
5324
|
} else if (parts[0] === parts[1]) {
|
|
5321
5325
|
removeAll = false;
|
|
5322
5326
|
}
|
|
5323
5327
|
} else if (polarity === false) {
|
|
5324
|
-
if (typeof
|
|
5328
|
+
if (typeof _this31.options.data[parts[0]] !== 'undefined' && _this31.options.data[parts[0]] !== parts[1]) {
|
|
5325
5329
|
// remove the <if> tags
|
|
5326
5330
|
removeAll = false;
|
|
5327
5331
|
}
|
|
@@ -5611,7 +5615,7 @@ var WebsyUtils = {
|
|
|
5611
5615
|
|
|
5612
5616
|
var WebsyTable = /*#__PURE__*/function () {
|
|
5613
5617
|
function WebsyTable(elementId, options) {
|
|
5614
|
-
var
|
|
5618
|
+
var _this32 = this;
|
|
5615
5619
|
|
|
5616
5620
|
_classCallCheck(this, WebsyTable);
|
|
5617
5621
|
|
|
@@ -5649,8 +5653,8 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5649
5653
|
allowClear: false,
|
|
5650
5654
|
disableSearch: true,
|
|
5651
5655
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
5652
|
-
if (
|
|
5653
|
-
|
|
5656
|
+
if (_this32.options.onChangePageSize) {
|
|
5657
|
+
_this32.options.onChangePageSize(selectedItem.value);
|
|
5654
5658
|
}
|
|
5655
5659
|
}
|
|
5656
5660
|
});
|
|
@@ -5671,7 +5675,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5671
5675
|
_createClass(WebsyTable, [{
|
|
5672
5676
|
key: "appendRows",
|
|
5673
5677
|
value: function appendRows(data) {
|
|
5674
|
-
var
|
|
5678
|
+
var _this33 = this;
|
|
5675
5679
|
|
|
5676
5680
|
this.hideError();
|
|
5677
5681
|
var bodyHTML = '';
|
|
@@ -5679,15 +5683,15 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5679
5683
|
if (data) {
|
|
5680
5684
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
5681
5685
|
return '<tr>' + r.map(function (c, i) {
|
|
5682
|
-
if (
|
|
5686
|
+
if (_this33.options.columns[i].show !== false) {
|
|
5683
5687
|
var style = '';
|
|
5684
5688
|
|
|
5685
5689
|
if (c.style) {
|
|
5686
5690
|
style += c.style;
|
|
5687
5691
|
}
|
|
5688
5692
|
|
|
5689
|
-
if (
|
|
5690
|
-
style += "width: ".concat(
|
|
5693
|
+
if (_this33.options.columns[i].width) {
|
|
5694
|
+
style += "width: ".concat(_this33.options.columns[i].width, "; ");
|
|
5691
5695
|
}
|
|
5692
5696
|
|
|
5693
5697
|
if (c.backgroundColor) {
|
|
@@ -5702,18 +5706,18 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5702
5706
|
style += "color: ".concat(c.color, "; ");
|
|
5703
5707
|
}
|
|
5704
5708
|
|
|
5705
|
-
if (
|
|
5706
|
-
return "\n <td \n data-row-index='".concat(
|
|
5707
|
-
} else if ((
|
|
5708
|
-
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(
|
|
5709
|
+
if (_this33.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
5710
|
+
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 ");
|
|
5711
|
+
} else if ((_this33.options.columns[i].showAsNavigatorLink === true || _this33.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
5712
|
+
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 ");
|
|
5709
5713
|
} else {
|
|
5710
5714
|
var info = c.value;
|
|
5711
5715
|
|
|
5712
|
-
if (
|
|
5716
|
+
if (_this33.options.columns[i].showAsImage === true) {
|
|
5713
5717
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
5714
5718
|
}
|
|
5715
5719
|
|
|
5716
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
5720
|
+
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 ");
|
|
5717
5721
|
}
|
|
5718
5722
|
}
|
|
5719
5723
|
}).join('') + '</tr>';
|
|
@@ -5885,7 +5889,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5885
5889
|
}, {
|
|
5886
5890
|
key: "render",
|
|
5887
5891
|
value: function render(data) {
|
|
5888
|
-
var
|
|
5892
|
+
var _this34 = this;
|
|
5889
5893
|
|
|
5890
5894
|
if (!this.options.columns) {
|
|
5891
5895
|
return;
|
|
@@ -5920,7 +5924,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5920
5924
|
style += "width: ".concat(c.width || 'auto', ";");
|
|
5921
5925
|
}
|
|
5922
5926
|
|
|
5923
|
-
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 ?
|
|
5927
|
+
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 ? _this34.buildSearchIcon(c.qGroupFieldDefs[0]) : '', "-->\n </div>\n </th>\n ");
|
|
5924
5928
|
}
|
|
5925
5929
|
}).join('') + '</tr>';
|
|
5926
5930
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -5939,7 +5943,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5939
5943
|
|
|
5940
5944
|
if (pagingEl) {
|
|
5941
5945
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
5942
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
5946
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this34.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
5943
5947
|
});
|
|
5944
5948
|
var startIndex = 0;
|
|
5945
5949
|
|
|
@@ -6007,7 +6011,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
6007
6011
|
|
|
6008
6012
|
var WebsyTable2 = /*#__PURE__*/function () {
|
|
6009
6013
|
function WebsyTable2(elementId, options) {
|
|
6010
|
-
var
|
|
6014
|
+
var _this35 = this;
|
|
6011
6015
|
|
|
6012
6016
|
_classCallCheck(this, WebsyTable2);
|
|
6013
6017
|
|
|
@@ -6048,8 +6052,8 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6048
6052
|
allowClear: false,
|
|
6049
6053
|
disableSearch: true,
|
|
6050
6054
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
6051
|
-
if (
|
|
6052
|
-
|
|
6055
|
+
if (_this35.options.onChangePageSize) {
|
|
6056
|
+
_this35.options.onChangePageSize(selectedItem.value);
|
|
6053
6057
|
}
|
|
6054
6058
|
}
|
|
6055
6059
|
});
|
|
@@ -6073,7 +6077,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6073
6077
|
_createClass(WebsyTable2, [{
|
|
6074
6078
|
key: "appendRows",
|
|
6075
6079
|
value: function appendRows(data) {
|
|
6076
|
-
var
|
|
6080
|
+
var _this36 = this;
|
|
6077
6081
|
|
|
6078
6082
|
this.hideError();
|
|
6079
6083
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
@@ -6082,15 +6086,15 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6082
6086
|
if (data) {
|
|
6083
6087
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
6084
6088
|
return '<tr>' + r.map(function (c, i) {
|
|
6085
|
-
if (
|
|
6086
|
-
var style = "height: ".concat(
|
|
6089
|
+
if (_this36.options.columns[i].show !== false) {
|
|
6090
|
+
var style = "height: ".concat(_this36.options.cellSize, "px; line-height: ").concat(_this36.options.cellSize, "px;");
|
|
6087
6091
|
|
|
6088
6092
|
if (c.style) {
|
|
6089
6093
|
style += c.style;
|
|
6090
6094
|
}
|
|
6091
6095
|
|
|
6092
|
-
if (
|
|
6093
|
-
style += "width: ".concat(
|
|
6096
|
+
if (_this36.options.columns[i].width) {
|
|
6097
|
+
style += "width: ".concat(_this36.options.columns[i].width, "; ");
|
|
6094
6098
|
}
|
|
6095
6099
|
|
|
6096
6100
|
if (c.backgroundColor) {
|
|
@@ -6105,18 +6109,18 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6105
6109
|
style += "color: ".concat(c.color, "; ");
|
|
6106
6110
|
}
|
|
6107
6111
|
|
|
6108
|
-
if (
|
|
6109
|
-
return "\n <td \n data-row-index='".concat(
|
|
6110
|
-
} else if ((
|
|
6111
|
-
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(
|
|
6112
|
+
if (_this36.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
6113
|
+
return "\n <td \n data-row-index='".concat(_this36.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this36.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(_this36.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this36.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
|
|
6114
|
+
} else if ((_this36.options.columns[i].showAsNavigatorLink === true || _this36.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
6115
|
+
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this36.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this36.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this36.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this36.options.columns[i].linkText || c.value, "</td>\n ");
|
|
6112
6116
|
} else {
|
|
6113
6117
|
var info = c.value;
|
|
6114
6118
|
|
|
6115
|
-
if (
|
|
6119
|
+
if (_this36.options.columns[i].showAsImage === true) {
|
|
6116
6120
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
6117
6121
|
}
|
|
6118
6122
|
|
|
6119
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
6123
|
+
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this36.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this36.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 ");
|
|
6120
6124
|
}
|
|
6121
6125
|
}
|
|
6122
6126
|
}).join('') + '</tr>';
|
|
@@ -6379,7 +6383,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6379
6383
|
}, {
|
|
6380
6384
|
key: "render",
|
|
6381
6385
|
value: function render(data) {
|
|
6382
|
-
var
|
|
6386
|
+
var _this37 = this;
|
|
6383
6387
|
|
|
6384
6388
|
if (!this.options.columns) {
|
|
6385
6389
|
return;
|
|
@@ -6415,7 +6419,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6415
6419
|
style += "width: ".concat(c.width || 'auto', "; ");
|
|
6416
6420
|
}
|
|
6417
6421
|
|
|
6418
|
-
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 ?
|
|
6422
|
+
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 ? _this37.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
|
|
6419
6423
|
}
|
|
6420
6424
|
}).join('') + '</tr>';
|
|
6421
6425
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -6426,7 +6430,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6426
6430
|
var dropdownHTML = "";
|
|
6427
6431
|
this.options.columns.forEach(function (c, i) {
|
|
6428
6432
|
if (c.searchable && c.searchField) {
|
|
6429
|
-
dropdownHTML += "\n <div id=\"".concat(
|
|
6433
|
+
dropdownHTML += "\n <div id=\"".concat(_this37.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
|
|
6430
6434
|
}
|
|
6431
6435
|
});
|
|
6432
6436
|
dropdownEl.innerHTML = dropdownHTML;
|
|
@@ -6448,7 +6452,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6448
6452
|
|
|
6449
6453
|
if (pagingEl) {
|
|
6450
6454
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
6451
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
6455
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this37.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
6452
6456
|
});
|
|
6453
6457
|
var startIndex = 0;
|
|
6454
6458
|
|
|
@@ -6539,7 +6543,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6539
6543
|
}, {
|
|
6540
6544
|
key: "getColumnParameters",
|
|
6541
6545
|
value: function getColumnParameters(values) {
|
|
6542
|
-
var
|
|
6546
|
+
var _this38 = this;
|
|
6543
6547
|
|
|
6544
6548
|
var tableEl = document.getElementById("".concat(this.elementId, "_table"));
|
|
6545
6549
|
tableEl.style.tableLayout = 'auto';
|
|
@@ -6547,10 +6551,10 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6547
6551
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
6548
6552
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
6549
6553
|
headEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c, i) {
|
|
6550
|
-
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 ?
|
|
6554
|
+
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 ? _this38.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
|
|
6551
6555
|
}).join('') + '</tr>';
|
|
6552
6556
|
bodyEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c) {
|
|
6553
|
-
return "\n <td \n style='height: ".concat(
|
|
6557
|
+
return "\n <td \n style='height: ".concat(_this38.options.cellSize, "px; line-height: ").concat(_this38.options.cellSize, "px; padding: 10px 5px;'\n >").concat(c.value || ' ', "</td>\n ");
|
|
6554
6558
|
}).join('') + '</tr>'; // get height of the first data cell
|
|
6555
6559
|
|
|
6556
6560
|
var cells = bodyEl.querySelectorAll("tr:first-of-type td");
|
|
@@ -6678,7 +6682,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6678
6682
|
}, {
|
|
6679
6683
|
key: "buildBodyHtml",
|
|
6680
6684
|
value: function buildBodyHtml() {
|
|
6681
|
-
var
|
|
6685
|
+
var _this39 = this;
|
|
6682
6686
|
|
|
6683
6687
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6684
6688
|
var useWidths = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -6747,11 +6751,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6747
6751
|
bodyHtml += "\n ><div style='".concat(divStyle, "'>");
|
|
6748
6752
|
|
|
6749
6753
|
if (cell.expandable === true) {
|
|
6750
|
-
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(
|
|
6754
|
+
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(_this39.options.plusIcon, "</i>");
|
|
6751
6755
|
}
|
|
6752
6756
|
|
|
6753
6757
|
if (cell.collapsable === true) {
|
|
6754
|
-
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(
|
|
6758
|
+
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(_this39.options.minusIcon, "</i>");
|
|
6755
6759
|
}
|
|
6756
6760
|
|
|
6757
6761
|
if (sizingColumns[sizeIndex].showAsLink === true && cell.value.trim() !== '') {
|
|
@@ -6776,7 +6780,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6776
6780
|
}, {
|
|
6777
6781
|
key: "buildHeaderHtml",
|
|
6778
6782
|
value: function buildHeaderHtml() {
|
|
6779
|
-
var
|
|
6783
|
+
var _this40 = this;
|
|
6780
6784
|
|
|
6781
6785
|
var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6782
6786
|
var headerHtml = '';
|
|
@@ -6791,7 +6795,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6791
6795
|
}
|
|
6792
6796
|
|
|
6793
6797
|
this.options.columns.forEach(function (row, rowIndex) {
|
|
6794
|
-
if (useWidths === false && rowIndex !==
|
|
6798
|
+
if (useWidths === false && rowIndex !== _this40.options.columns.length - 1) {
|
|
6795
6799
|
// if we're calculating the size we only want to render the last row of column headers
|
|
6796
6800
|
return;
|
|
6797
6801
|
}
|
|
@@ -6817,18 +6821,18 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6817
6821
|
// `
|
|
6818
6822
|
// }
|
|
6819
6823
|
|
|
6820
|
-
headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ?
|
|
6824
|
+
headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ? _this40.buildSearchIcon(col, colIndex) : '', "</div></td>");
|
|
6821
6825
|
});
|
|
6822
6826
|
headerHtml += "</tr>";
|
|
6823
6827
|
});
|
|
6824
6828
|
var dropdownEl = document.getElementById("".concat(this.elementId, "_dropdownContainer"));
|
|
6825
6829
|
this.options.columns[this.options.columns.length - 1].forEach(function (c, i) {
|
|
6826
6830
|
if (c.searchable && c.isExternalSearch === true) {
|
|
6827
|
-
var testEl = document.getElementById("".concat(
|
|
6831
|
+
var testEl = document.getElementById("".concat(_this40.elementId, "_columnSearch_").concat(c.dimId || i));
|
|
6828
6832
|
|
|
6829
6833
|
if (!testEl) {
|
|
6830
6834
|
var newE = document.createElement('div');
|
|
6831
|
-
newE.id = "".concat(
|
|
6835
|
+
newE.id = "".concat(_this40.elementId, "_columnSearch_").concat(c.dimId || i);
|
|
6832
6836
|
newE.className = 'websy-modal-dropdown';
|
|
6833
6837
|
dropdownEl.appendChild(newE);
|
|
6834
6838
|
}
|
|
@@ -6844,7 +6848,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6844
6848
|
}, {
|
|
6845
6849
|
key: "buildTotalHtml",
|
|
6846
6850
|
value: function buildTotalHtml() {
|
|
6847
|
-
var
|
|
6851
|
+
var _this41 = this;
|
|
6848
6852
|
|
|
6849
6853
|
var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6850
6854
|
|
|
@@ -6857,7 +6861,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6857
6861
|
totalHtml += "<td \n class='websy-table-cell'\n colspan='".concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
|
|
6858
6862
|
|
|
6859
6863
|
if (useWidths === true) {
|
|
6860
|
-
totalHtml += "\n style='width: ".concat(
|
|
6864
|
+
totalHtml += "\n style='width: ".concat(_this41.options.columns[_this41.options.columns.length - 1][colIndex].width || _this41.options.columns[_this41.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
|
|
6861
6865
|
}
|
|
6862
6866
|
|
|
6863
6867
|
totalHtml += " \n >\n ".concat(col.value, "\n </td>");
|
|
@@ -6868,7 +6872,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6868
6872
|
}, {
|
|
6869
6873
|
key: "calculateSizes",
|
|
6870
6874
|
value: function calculateSizes() {
|
|
6871
|
-
var
|
|
6875
|
+
var _this42 = this;
|
|
6872
6876
|
|
|
6873
6877
|
var sample = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6874
6878
|
var totalRowCount = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -6911,32 +6915,32 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6911
6915
|
rows.forEach(function (row, rowIndex) {
|
|
6912
6916
|
Array.from(row.children).forEach(function (col, colIndex) {
|
|
6913
6917
|
var colSize = col.getBoundingClientRect();
|
|
6914
|
-
|
|
6918
|
+
_this42.sizes.cellHeight = colSize.height;
|
|
6915
6919
|
|
|
6916
|
-
if (
|
|
6917
|
-
if (!
|
|
6918
|
-
|
|
6920
|
+
if (_this42.options.columns[_this42.options.columns.length - 1][colIndex]) {
|
|
6921
|
+
if (!_this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth) {
|
|
6922
|
+
_this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth = 0;
|
|
6919
6923
|
}
|
|
6920
6924
|
|
|
6921
|
-
|
|
6922
|
-
|
|
6925
|
+
_this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth = Math.min(Math.max(_this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth, colSize.width), maxWidth);
|
|
6926
|
+
_this42.options.columns[_this42.options.columns.length - 1][colIndex].cellHeight = colSize.height;
|
|
6923
6927
|
|
|
6924
|
-
if (colIndex >=
|
|
6925
|
-
firstNonPinnedColumnWidth =
|
|
6928
|
+
if (colIndex >= _this42.pinnedColumns) {
|
|
6929
|
+
firstNonPinnedColumnWidth = _this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth;
|
|
6926
6930
|
}
|
|
6927
6931
|
}
|
|
6928
6932
|
});
|
|
6929
6933
|
});
|
|
6930
6934
|
this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
|
|
6931
|
-
if (colIndex <
|
|
6932
|
-
|
|
6935
|
+
if (colIndex < _this42.pinnedColumns) {
|
|
6936
|
+
_this42.sizes.scrollableWidth -= col.actualWidth;
|
|
6933
6937
|
}
|
|
6934
6938
|
});
|
|
6935
6939
|
this.sizes.totalWidth = this.options.columns[this.options.columns.length - 1].reduce(function (a, b) {
|
|
6936
6940
|
return a + (b.width || b.actualWidth);
|
|
6937
6941
|
}, 0);
|
|
6938
6942
|
this.sizes.totalNonPinnedWidth = this.options.columns[this.options.columns.length - 1].filter(function (c, i) {
|
|
6939
|
-
return i >=
|
|
6943
|
+
return i >= _this42.pinnedColumns;
|
|
6940
6944
|
}).reduce(function (a, b) {
|
|
6941
6945
|
return a + (b.width || b.actualWidth);
|
|
6942
6946
|
}, 0);
|
|
@@ -6957,10 +6961,10 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6957
6961
|
c.actualWidth += equalWidth; // }
|
|
6958
6962
|
// }
|
|
6959
6963
|
|
|
6960
|
-
|
|
6964
|
+
_this42.sizes.totalWidth += c.width || c.actualWidth;
|
|
6961
6965
|
|
|
6962
|
-
if (i <
|
|
6963
|
-
|
|
6966
|
+
if (i < _this42.pinnedColumns) {
|
|
6967
|
+
_this42.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
|
|
6964
6968
|
} // equalWidth = (outerSize.width - this.sizes.totalWidth) / (this.options.columns[this.options.columns.length - 1].length - (i + 1))
|
|
6965
6969
|
|
|
6966
6970
|
});
|
|
@@ -7017,7 +7021,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7017
7021
|
}, {
|
|
7018
7022
|
key: "createSample",
|
|
7019
7023
|
value: function createSample(data) {
|
|
7020
|
-
var
|
|
7024
|
+
var _this43 = this;
|
|
7021
7025
|
|
|
7022
7026
|
var output = [];
|
|
7023
7027
|
this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
|
|
@@ -7029,7 +7033,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7029
7033
|
var longest = '';
|
|
7030
7034
|
|
|
7031
7035
|
for (var i = 0; i < Math.min(data.length, 1000); i++) {
|
|
7032
|
-
if (data[i].length ===
|
|
7036
|
+
if (data[i].length === _this43.options.columns[_this43.options.columns.length - 1].length) {
|
|
7033
7037
|
if (longest.length < data[i][colIndex].value.length) {
|
|
7034
7038
|
longest = data[i][colIndex].value;
|
|
7035
7039
|
}
|
|
@@ -7424,7 +7428,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7424
7428
|
|
|
7425
7429
|
var WebsyChart = /*#__PURE__*/function () {
|
|
7426
7430
|
function WebsyChart(elementId, options) {
|
|
7427
|
-
var
|
|
7431
|
+
var _this44 = this;
|
|
7428
7432
|
|
|
7429
7433
|
_classCallCheck(this, WebsyChart);
|
|
7430
7434
|
|
|
@@ -7475,22 +7479,22 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7475
7479
|
this.invertOverride = function (input, input2) {
|
|
7476
7480
|
var xAxis = 'bottomAxis';
|
|
7477
7481
|
|
|
7478
|
-
if (
|
|
7482
|
+
if (_this44.options.orientation === 'horizontal') {
|
|
7479
7483
|
xAxis = 'leftAxis';
|
|
7480
7484
|
}
|
|
7481
7485
|
|
|
7482
|
-
var width =
|
|
7486
|
+
var width = _this44[xAxis].step();
|
|
7483
7487
|
|
|
7484
7488
|
var output;
|
|
7485
7489
|
|
|
7486
|
-
var domain = _toConsumableArray(
|
|
7490
|
+
var domain = _toConsumableArray(_this44[xAxis].domain());
|
|
7487
7491
|
|
|
7488
|
-
if (
|
|
7492
|
+
if (_this44.options.orientation === 'horizontal') {
|
|
7489
7493
|
domain = domain.reverse();
|
|
7490
7494
|
}
|
|
7491
7495
|
|
|
7492
7496
|
for (var j = 0; j < domain.length; j++) {
|
|
7493
|
-
var breakA =
|
|
7497
|
+
var breakA = _this44[xAxis](domain[j]) - width / 2;
|
|
7494
7498
|
var breakB = breakA + width;
|
|
7495
7499
|
|
|
7496
7500
|
if (input > breakA && input <= breakB) {
|
|
@@ -7590,10 +7594,10 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7590
7594
|
}, {
|
|
7591
7595
|
key: "handleEventMouseMove",
|
|
7592
7596
|
value: function handleEventMouseMove(event, d) {
|
|
7593
|
-
var
|
|
7597
|
+
var _this45 = this;
|
|
7594
7598
|
|
|
7595
7599
|
var bisectDate = d3.bisector(function (d) {
|
|
7596
|
-
return
|
|
7600
|
+
return _this45.parseX(d.x.value);
|
|
7597
7601
|
}).left;
|
|
7598
7602
|
|
|
7599
7603
|
if (this.options.showTrackingLine === true && d3.pointer(event)) {
|
|
@@ -7632,8 +7636,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7632
7636
|
}
|
|
7633
7637
|
|
|
7634
7638
|
this.options.data.series.forEach(function (s) {
|
|
7635
|
-
if (
|
|
7636
|
-
xPoint =
|
|
7639
|
+
if (_this45.options.data[xData].scale !== 'Time') {
|
|
7640
|
+
xPoint = _this45[xAxis](_this45.parseX(xLabel));
|
|
7637
7641
|
s.data.forEach(function (d) {
|
|
7638
7642
|
if (d.x.value === xLabel) {
|
|
7639
7643
|
if (!tooltipTitle) {
|
|
@@ -7652,13 +7656,13 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7652
7656
|
var pointA = s.data[index - 1];
|
|
7653
7657
|
var pointB = s.data[index];
|
|
7654
7658
|
|
|
7655
|
-
if (
|
|
7659
|
+
if (_this45.options.orientation === 'horizontal') {
|
|
7656
7660
|
pointA = _toConsumableArray(s.data).reverse()[index - 1];
|
|
7657
7661
|
pointB = _toConsumableArray(s.data).reverse()[index];
|
|
7658
7662
|
}
|
|
7659
7663
|
|
|
7660
7664
|
if (pointA && !pointB) {
|
|
7661
|
-
xPoint =
|
|
7665
|
+
xPoint = _this45[xAxis](_this45.parseX(pointA.x.value));
|
|
7662
7666
|
tooltipTitle = pointA.x.value;
|
|
7663
7667
|
|
|
7664
7668
|
if (!pointA.y.color) {
|
|
@@ -7668,12 +7672,12 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7668
7672
|
tooltipData.push(pointA.y);
|
|
7669
7673
|
|
|
7670
7674
|
if (typeof pointA.x.value.getTime !== 'undefined') {
|
|
7671
|
-
tooltipTitle = d3.timeFormat(
|
|
7675
|
+
tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointA.x.value);
|
|
7672
7676
|
}
|
|
7673
7677
|
}
|
|
7674
7678
|
|
|
7675
7679
|
if (pointB && !pointA) {
|
|
7676
|
-
xPoint =
|
|
7680
|
+
xPoint = _this45[xAxis](_this45.parseX(pointB.x.value));
|
|
7677
7681
|
tooltipTitle = pointB.x.value;
|
|
7678
7682
|
|
|
7679
7683
|
if (!pointB.y.color) {
|
|
@@ -7683,14 +7687,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7683
7687
|
tooltipData.push(pointB.y);
|
|
7684
7688
|
|
|
7685
7689
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7686
|
-
tooltipTitle = d3.timeFormat(
|
|
7690
|
+
tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7687
7691
|
}
|
|
7688
7692
|
}
|
|
7689
7693
|
|
|
7690
7694
|
if (pointA && pointB) {
|
|
7691
|
-
var d0 =
|
|
7695
|
+
var d0 = _this45[xAxis](_this45.parseX(pointA.x.value));
|
|
7692
7696
|
|
|
7693
|
-
var d1 =
|
|
7697
|
+
var d1 = _this45[xAxis](_this45.parseX(pointB.x.value));
|
|
7694
7698
|
|
|
7695
7699
|
var mid = Math.abs(d0 - d1) / 2;
|
|
7696
7700
|
|
|
@@ -7699,7 +7703,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7699
7703
|
tooltipTitle = pointB.x.value;
|
|
7700
7704
|
|
|
7701
7705
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7702
|
-
tooltipTitle = d3.timeFormat(
|
|
7706
|
+
tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7703
7707
|
}
|
|
7704
7708
|
|
|
7705
7709
|
if (!pointB.y.color) {
|
|
@@ -7712,7 +7716,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7712
7716
|
tooltipTitle = pointA.x.value;
|
|
7713
7717
|
|
|
7714
7718
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7715
|
-
tooltipTitle = d3.timeFormat(
|
|
7719
|
+
tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7716
7720
|
}
|
|
7717
7721
|
|
|
7718
7722
|
if (!pointA.y.color) {
|
|
@@ -7826,7 +7830,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7826
7830
|
}, {
|
|
7827
7831
|
key: "render",
|
|
7828
7832
|
value: function render(options) {
|
|
7829
|
-
var
|
|
7833
|
+
var _this46 = this;
|
|
7830
7834
|
|
|
7831
7835
|
/* global d3 options WebsyUtils */
|
|
7832
7836
|
if (typeof options !== 'undefined') {
|
|
@@ -7895,7 +7899,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7895
7899
|
var legendData = this.options.data.series.map(function (s, i) {
|
|
7896
7900
|
return {
|
|
7897
7901
|
value: s.label || s.key,
|
|
7898
|
-
color: s.color ||
|
|
7902
|
+
color: s.color || _this46.options.colors[i % _this46.options.colors.length]
|
|
7899
7903
|
};
|
|
7900
7904
|
});
|
|
7901
7905
|
|
|
@@ -8177,7 +8181,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8177
8181
|
|
|
8178
8182
|
if (this.options.data.bottom.formatter) {
|
|
8179
8183
|
bAxisFunc.tickFormat(function (d) {
|
|
8180
|
-
return
|
|
8184
|
+
return _this46.options.data.bottom.formatter(d);
|
|
8181
8185
|
});
|
|
8182
8186
|
}
|
|
8183
8187
|
|
|
@@ -8203,8 +8207,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8203
8207
|
|
|
8204
8208
|
if (this.options.margin.axisLeft > 0) {
|
|
8205
8209
|
this.leftAxisLayer.call(d3.axisLeft(this.leftAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
8206
|
-
if (
|
|
8207
|
-
d =
|
|
8210
|
+
if (_this46.options.data.left.formatter) {
|
|
8211
|
+
d = _this46.options.data.left.formatter(d);
|
|
8208
8212
|
}
|
|
8209
8213
|
|
|
8210
8214
|
return d;
|
|
@@ -8241,8 +8245,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8241
8245
|
|
|
8242
8246
|
if (this.options.margin.axisRight > 0 && (this.options.data.right.min !== 0 || this.options.data.right.max !== 0)) {
|
|
8243
8247
|
this.rightAxisLayer.call(d3.axisRight(this.rightAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
8244
|
-
if (
|
|
8245
|
-
d =
|
|
8248
|
+
if (_this46.options.data.right.formatter) {
|
|
8249
|
+
d = _this46.options.data.right.formatter(d);
|
|
8246
8250
|
}
|
|
8247
8251
|
|
|
8248
8252
|
return d;
|
|
@@ -8281,18 +8285,18 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8281
8285
|
this.renderedKeys = {};
|
|
8282
8286
|
this.options.data.series.forEach(function (series, index) {
|
|
8283
8287
|
if (!series.key) {
|
|
8284
|
-
series.key =
|
|
8288
|
+
series.key = _this46.createIdentity();
|
|
8285
8289
|
}
|
|
8286
8290
|
|
|
8287
8291
|
if (!series.color) {
|
|
8288
|
-
series.color =
|
|
8292
|
+
series.color = _this46.options.colors[index % _this46.options.colors.length];
|
|
8289
8293
|
}
|
|
8290
8294
|
|
|
8291
|
-
|
|
8295
|
+
_this46["render".concat(series.type || 'bar')](series, index);
|
|
8292
8296
|
|
|
8293
|
-
|
|
8297
|
+
_this46.renderLabels(series, index);
|
|
8294
8298
|
|
|
8295
|
-
|
|
8299
|
+
_this46.renderedKeys[series.key] = series.type;
|
|
8296
8300
|
});
|
|
8297
8301
|
}
|
|
8298
8302
|
}
|
|
@@ -8300,17 +8304,17 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8300
8304
|
}, {
|
|
8301
8305
|
key: "renderarea",
|
|
8302
8306
|
value: function renderarea(series, index) {
|
|
8303
|
-
var
|
|
8307
|
+
var _this47 = this;
|
|
8304
8308
|
|
|
8305
8309
|
/* global d3 series index */
|
|
8306
8310
|
var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
|
|
8307
8311
|
return d3.area().x(function (d) {
|
|
8308
|
-
return
|
|
8312
|
+
return _this47[xAxis](_this47.parseX(d.x.value));
|
|
8309
8313
|
}).y0(function (d) {
|
|
8310
|
-
return
|
|
8314
|
+
return _this47[yAxis](0);
|
|
8311
8315
|
}).y1(function (d) {
|
|
8312
|
-
return
|
|
8313
|
-
}).curve(d3[curveStyle ||
|
|
8316
|
+
return _this47[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
|
|
8317
|
+
}).curve(d3[curveStyle || _this47.options.curveStyle]);
|
|
8314
8318
|
};
|
|
8315
8319
|
|
|
8316
8320
|
var xAxis = 'bottomAxis';
|
|
@@ -8433,7 +8437,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8433
8437
|
}, {
|
|
8434
8438
|
key: "renderLabels",
|
|
8435
8439
|
value: function renderLabels(series, index) {
|
|
8436
|
-
var
|
|
8440
|
+
var _this48 = this;
|
|
8437
8441
|
|
|
8438
8442
|
/* global series index d3 WebsyDesigns */
|
|
8439
8443
|
var xAxis = 'bottomAxis';
|
|
@@ -8452,11 +8456,11 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8452
8456
|
var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
|
|
8453
8457
|
labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
|
|
8454
8458
|
labels.attr('x', function (d) {
|
|
8455
|
-
return getLabelX.call(
|
|
8459
|
+
return getLabelX.call(_this48, d, series.labelPosition);
|
|
8456
8460
|
}).attr('y', function (d) {
|
|
8457
|
-
return getLabelY.call(
|
|
8461
|
+
return getLabelY.call(_this48, d, series.labelPosition);
|
|
8458
8462
|
}).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
|
|
8459
|
-
return
|
|
8463
|
+
return _this48.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
8460
8464
|
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
|
|
8461
8465
|
return d.y.label || d.y.value;
|
|
8462
8466
|
}).each(function (d, i) {
|
|
@@ -8481,11 +8485,11 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8481
8485
|
}
|
|
8482
8486
|
});
|
|
8483
8487
|
labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', function (d) {
|
|
8484
|
-
return getLabelX.call(
|
|
8488
|
+
return getLabelX.call(_this48, d, series.labelPosition);
|
|
8485
8489
|
}).attr('y', function (d) {
|
|
8486
|
-
return getLabelY.call(
|
|
8490
|
+
return getLabelY.call(_this48, d, series.labelPosition);
|
|
8487
8491
|
}).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
|
|
8488
|
-
return
|
|
8492
|
+
return _this48.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
8489
8493
|
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).text(function (d) {
|
|
8490
8494
|
return d.y.label || d.y.value;
|
|
8491
8495
|
}).each(function (d, i) {
|
|
@@ -8542,16 +8546,16 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8542
8546
|
}, {
|
|
8543
8547
|
key: "renderline",
|
|
8544
8548
|
value: function renderline(series, index) {
|
|
8545
|
-
var
|
|
8549
|
+
var _this49 = this;
|
|
8546
8550
|
|
|
8547
8551
|
/* global series index d3 */
|
|
8548
8552
|
var drawLine = function drawLine(xAxis, yAxis, curveStyle) {
|
|
8549
8553
|
return d3.line().x(function (d) {
|
|
8550
|
-
var adjustment =
|
|
8551
|
-
return
|
|
8554
|
+
var adjustment = _this49.options.data[xAxis].scale === 'Time' ? 0 : _this49["".concat(xAxis, "Axis")].bandwidth() / 2;
|
|
8555
|
+
return _this49["".concat(xAxis, "Axis")](_this49.parseX(d.x.value)) + adjustment;
|
|
8552
8556
|
}).y(function (d) {
|
|
8553
|
-
return
|
|
8554
|
-
}).curve(d3[curveStyle ||
|
|
8557
|
+
return _this49["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
|
|
8558
|
+
}).curve(d3[curveStyle || _this49.options.curveStyle]);
|
|
8555
8559
|
};
|
|
8556
8560
|
|
|
8557
8561
|
var xAxis = 'bottom';
|
|
@@ -8595,14 +8599,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8595
8599
|
}, {
|
|
8596
8600
|
key: "rendersymbol",
|
|
8597
8601
|
value: function rendersymbol(series, index) {
|
|
8598
|
-
var
|
|
8602
|
+
var _this50 = this;
|
|
8599
8603
|
|
|
8600
8604
|
/* global d3 series index series.key */
|
|
8601
8605
|
var drawSymbol = function drawSymbol(size) {
|
|
8602
8606
|
return d3.symbol() // .type(d => {
|
|
8603
8607
|
// return d3.symbols[0]
|
|
8604
8608
|
// })
|
|
8605
|
-
.size(size ||
|
|
8609
|
+
.size(size || _this50.options.symbolSize);
|
|
8606
8610
|
};
|
|
8607
8611
|
|
|
8608
8612
|
var xAxis = 'bottomAxis';
|
|
@@ -8620,7 +8624,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8620
8624
|
symbols.attr('d', function (d) {
|
|
8621
8625
|
return drawSymbol(d.y.size || series.symbolSize)(d);
|
|
8622
8626
|
}).transition(this.transition).attr('fill', 'white').attr('stroke', series.color).attr('transform', function (d) {
|
|
8623
|
-
return "translate(".concat(
|
|
8627
|
+
return "translate(".concat(_this50[xAxis](_this50.parseX(d.x.value)), ", ").concat(_this50[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
8624
8628
|
}); // Enter
|
|
8625
8629
|
|
|
8626
8630
|
symbols.enter().append('path').attr('d', function (d) {
|
|
@@ -8629,7 +8633,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8629
8633
|
.attr('fill', 'white').attr('stroke', series.color).attr('class', function (d) {
|
|
8630
8634
|
return "symbol symbol_".concat(series.key);
|
|
8631
8635
|
}).attr('transform', function (d) {
|
|
8632
|
-
return "translate(".concat(
|
|
8636
|
+
return "translate(".concat(_this50[xAxis](_this50.parseX(d.x.value)), ", ").concat(_this50[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
8633
8637
|
});
|
|
8634
8638
|
}
|
|
8635
8639
|
}, {
|
|
@@ -8784,7 +8788,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
8784
8788
|
}, {
|
|
8785
8789
|
key: "resize",
|
|
8786
8790
|
value: function resize() {
|
|
8787
|
-
var
|
|
8791
|
+
var _this51 = this;
|
|
8788
8792
|
|
|
8789
8793
|
var el = document.getElementById(this.elementId);
|
|
8790
8794
|
|
|
@@ -8797,7 +8801,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
8797
8801
|
// }
|
|
8798
8802
|
var html = "\n <div class='text-".concat(this.options.align, "'>\n ");
|
|
8799
8803
|
html += this._data.map(function (d, i) {
|
|
8800
|
-
return
|
|
8804
|
+
return _this51.getLegendItemHTML(d);
|
|
8801
8805
|
}).join('');
|
|
8802
8806
|
html += "\n <div>\n ";
|
|
8803
8807
|
el.innerHTML = html;
|
|
@@ -8969,7 +8973,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8969
8973
|
}, {
|
|
8970
8974
|
key: "render",
|
|
8971
8975
|
value: function render() {
|
|
8972
|
-
var
|
|
8976
|
+
var _this52 = this;
|
|
8973
8977
|
|
|
8974
8978
|
var mapEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
8975
8979
|
var legendEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
@@ -8978,7 +8982,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8978
8982
|
var legendData = this.options.data.polygons.map(function (s, i) {
|
|
8979
8983
|
return {
|
|
8980
8984
|
value: s.label || s.key,
|
|
8981
|
-
color: s.color ||
|
|
8985
|
+
color: s.color || _this52.options.colors[i % _this52.options.colors.length]
|
|
8982
8986
|
};
|
|
8983
8987
|
});
|
|
8984
8988
|
var longestValue = legendData.map(function (s) {
|
|
@@ -9042,7 +9046,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
9042
9046
|
|
|
9043
9047
|
if (this.polygons) {
|
|
9044
9048
|
this.polygons.forEach(function (p) {
|
|
9045
|
-
return
|
|
9049
|
+
return _this52.map.removeLayer(p);
|
|
9046
9050
|
});
|
|
9047
9051
|
}
|
|
9048
9052
|
|
|
@@ -9100,18 +9104,18 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
9100
9104
|
}
|
|
9101
9105
|
|
|
9102
9106
|
if (!p.options.color) {
|
|
9103
|
-
p.options.color =
|
|
9107
|
+
p.options.color = _this52.options.colors[i % _this52.options.colors.length];
|
|
9104
9108
|
}
|
|
9105
9109
|
|
|
9106
9110
|
var pol = L.polygon(p.data.map(function (c) {
|
|
9107
9111
|
return c.map(function (d) {
|
|
9108
9112
|
return [d.Latitude, d.Longitude];
|
|
9109
9113
|
});
|
|
9110
|
-
}), p.options).addTo(
|
|
9114
|
+
}), p.options).addTo(_this52.map);
|
|
9111
9115
|
|
|
9112
|
-
|
|
9116
|
+
_this52.polygons.push(pol);
|
|
9113
9117
|
|
|
9114
|
-
|
|
9118
|
+
_this52.map.fitBounds(pol.getBounds());
|
|
9115
9119
|
});
|
|
9116
9120
|
} // if (this.data.markers.length > 0) {
|
|
9117
9121
|
// el.classList.remove('hidden')
|