@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
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
|
|
|
@@ -1694,9 +1698,15 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1694
1698
|
scrollEl.scrollTo(0, 0);
|
|
1695
1699
|
}
|
|
1696
1700
|
|
|
1697
|
-
maskEl
|
|
1698
|
-
|
|
1699
|
-
|
|
1701
|
+
if (maskEl) {
|
|
1702
|
+
maskEl.classList.remove('active');
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
if (contentEl) {
|
|
1706
|
+
contentEl.classList.remove('active');
|
|
1707
|
+
contentEl.classList.remove('on-top');
|
|
1708
|
+
}
|
|
1709
|
+
|
|
1700
1710
|
var searchEl = document.getElementById("".concat(this.elementId, "_search"));
|
|
1701
1711
|
|
|
1702
1712
|
if (searchEl) {
|
|
@@ -1915,10 +1925,10 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1915
1925
|
}, {
|
|
1916
1926
|
key: "renderItems",
|
|
1917
1927
|
value: function renderItems() {
|
|
1918
|
-
var
|
|
1928
|
+
var _this11 = this;
|
|
1919
1929
|
|
|
1920
1930
|
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(
|
|
1931
|
+
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
1932
|
}).join('');
|
|
1923
1933
|
var el = document.getElementById("".concat(this.elementId, "_items"));
|
|
1924
1934
|
|
|
@@ -2388,7 +2398,7 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
2388
2398
|
}, {
|
|
2389
2399
|
key: "render",
|
|
2390
2400
|
value: function render() {
|
|
2391
|
-
var
|
|
2401
|
+
var _this12 = this;
|
|
2392
2402
|
|
|
2393
2403
|
var el = document.getElementById("".concat(this.elementId, "_container"));
|
|
2394
2404
|
|
|
@@ -2396,7 +2406,7 @@ var WebsyDragDrop = /*#__PURE__*/function () {
|
|
|
2396
2406
|
this.measureItems();
|
|
2397
2407
|
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
2408
|
html += this.options.items.map(function (d, i) {
|
|
2399
|
-
return
|
|
2409
|
+
return _this12.createItemHtml(_this12.elementId, i, d);
|
|
2400
2410
|
}).join('');
|
|
2401
2411
|
el.innerHTML = html;
|
|
2402
2412
|
this.options.items.forEach(function (item, i) {
|
|
@@ -2475,16 +2485,16 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2475
2485
|
}, {
|
|
2476
2486
|
key: "checkRecaptcha",
|
|
2477
2487
|
value: function checkRecaptcha() {
|
|
2478
|
-
var
|
|
2488
|
+
var _this13 = this;
|
|
2479
2489
|
|
|
2480
2490
|
return new Promise(function (resolve, reject) {
|
|
2481
|
-
if (
|
|
2491
|
+
if (_this13.options.useRecaptcha === true) {
|
|
2482
2492
|
// if (this.recaptchaValue) {
|
|
2483
2493
|
grecaptcha.ready(function () {
|
|
2484
2494
|
grecaptcha.execute(ENVIRONMENT.RECAPTCHA_KEY, {
|
|
2485
2495
|
action: 'submit'
|
|
2486
2496
|
}).then(function (token) {
|
|
2487
|
-
|
|
2497
|
+
_this13.apiService.add('google/checkrecaptcha', {
|
|
2488
2498
|
grecaptcharesponse: token
|
|
2489
2499
|
}).then(function (response) {
|
|
2490
2500
|
if (response.success && response.success === true) {
|
|
@@ -2547,14 +2557,14 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2547
2557
|
}, {
|
|
2548
2558
|
key: "processComponents",
|
|
2549
2559
|
value: function processComponents(components, callbackFn) {
|
|
2550
|
-
var
|
|
2560
|
+
var _this14 = this;
|
|
2551
2561
|
|
|
2552
2562
|
if (components.length === 0) {
|
|
2553
2563
|
callbackFn();
|
|
2554
2564
|
} else {
|
|
2555
2565
|
components.forEach(function (c) {
|
|
2556
2566
|
if (typeof WebsyDesigns[c.component] !== 'undefined') {
|
|
2557
|
-
c.instance = new WebsyDesigns[c.component]("".concat(
|
|
2567
|
+
c.instance = new WebsyDesigns[c.component]("".concat(_this14.elementId, "_input_").concat(c.field, "_component"), c.options);
|
|
2558
2568
|
} else {// some user feedback here
|
|
2559
2569
|
}
|
|
2560
2570
|
});
|
|
@@ -2575,7 +2585,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2575
2585
|
}, {
|
|
2576
2586
|
key: "render",
|
|
2577
2587
|
value: function render(update, data) {
|
|
2578
|
-
var
|
|
2588
|
+
var _this15 = this;
|
|
2579
2589
|
|
|
2580
2590
|
var el = document.getElementById(this.elementId);
|
|
2581
2591
|
var componentsToProcess = [];
|
|
@@ -2585,11 +2595,11 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2585
2595
|
this.options.fields.forEach(function (f, i) {
|
|
2586
2596
|
if (f.component) {
|
|
2587
2597
|
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(
|
|
2598
|
+
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
2599
|
} 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(
|
|
2600
|
+
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
2601
|
} 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(
|
|
2602
|
+
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
2603
|
}
|
|
2594
2604
|
});
|
|
2595
2605
|
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 +2616,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2606
2616
|
|
|
2607
2617
|
el.innerHTML = html;
|
|
2608
2618
|
this.processComponents(componentsToProcess, function () {
|
|
2609
|
-
if (
|
|
2619
|
+
if (_this15.options.useRecaptcha === true && typeof grecaptcha !== 'undefined') {// this.recaptchaReady()
|
|
2610
2620
|
}
|
|
2611
2621
|
});
|
|
2612
2622
|
}
|
|
@@ -2614,7 +2624,7 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2614
2624
|
}, {
|
|
2615
2625
|
key: "submitForm",
|
|
2616
2626
|
value: function submitForm() {
|
|
2617
|
-
var
|
|
2627
|
+
var _this16 = this;
|
|
2618
2628
|
|
|
2619
2629
|
var formEl = document.getElementById("".concat(this.elementId, "Form"));
|
|
2620
2630
|
|
|
@@ -2628,32 +2638,32 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2628
2638
|
data[key] = value;
|
|
2629
2639
|
});
|
|
2630
2640
|
|
|
2631
|
-
if (
|
|
2632
|
-
var
|
|
2641
|
+
if (_this16.options.url) {
|
|
2642
|
+
var _this16$apiService;
|
|
2633
2643
|
|
|
2634
|
-
var params = [
|
|
2644
|
+
var params = [_this16.options.url];
|
|
2635
2645
|
|
|
2636
|
-
if (
|
|
2637
|
-
params.push(
|
|
2646
|
+
if (_this16.options.mode === 'update') {
|
|
2647
|
+
params.push(_this16.options.id);
|
|
2638
2648
|
}
|
|
2639
2649
|
|
|
2640
2650
|
params.push(data);
|
|
2641
2651
|
|
|
2642
|
-
(
|
|
2643
|
-
if (
|
|
2652
|
+
(_this16$apiService = _this16.apiService)[_this16.options.mode].apply(_this16$apiService, params).then(function (result) {
|
|
2653
|
+
if (_this16.options.clearAfterSave === true) {
|
|
2644
2654
|
// this.render()
|
|
2645
2655
|
formEl.reset();
|
|
2646
2656
|
}
|
|
2647
2657
|
|
|
2648
|
-
|
|
2658
|
+
_this16.options.onSuccess.call(_this16, result);
|
|
2649
2659
|
}, function (err) {
|
|
2650
2660
|
console.log('Error submitting form data:', err);
|
|
2651
2661
|
|
|
2652
|
-
|
|
2662
|
+
_this16.options.onError.call(_this16, err);
|
|
2653
2663
|
});
|
|
2654
|
-
} else if (
|
|
2655
|
-
|
|
2656
|
-
if (
|
|
2664
|
+
} else if (_this16.options.submitFn) {
|
|
2665
|
+
_this16.options.submitFn(data, function () {
|
|
2666
|
+
if (_this16.options.clearAfterSave === true) {
|
|
2657
2667
|
// this.render()
|
|
2658
2668
|
formEl.reset();
|
|
2659
2669
|
}
|
|
@@ -2673,17 +2683,17 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2673
2683
|
}, {
|
|
2674
2684
|
key: "data",
|
|
2675
2685
|
set: function set(d) {
|
|
2676
|
-
var
|
|
2686
|
+
var _this17 = this;
|
|
2677
2687
|
|
|
2678
2688
|
if (!this.options.fields) {
|
|
2679
2689
|
this.options.fields = [];
|
|
2680
2690
|
}
|
|
2681
2691
|
|
|
2682
2692
|
var _loop = function _loop(key) {
|
|
2683
|
-
|
|
2693
|
+
_this17.options.fields.forEach(function (f) {
|
|
2684
2694
|
if (f.field === key) {
|
|
2685
2695
|
f.value = d[key];
|
|
2686
|
-
var el = document.getElementById("".concat(
|
|
2696
|
+
var el = document.getElementById("".concat(_this17.elementId, "_input_").concat(f.field));
|
|
2687
2697
|
el.value = f.value;
|
|
2688
2698
|
}
|
|
2689
2699
|
});
|
|
@@ -2737,8 +2747,11 @@ var WebsyLoadingDialog = /*#__PURE__*/function () {
|
|
|
2737
2747
|
key: "hide",
|
|
2738
2748
|
value: function hide() {
|
|
2739
2749
|
var el = document.getElementById(this.elementId);
|
|
2740
|
-
|
|
2741
|
-
el
|
|
2750
|
+
|
|
2751
|
+
if (el) {
|
|
2752
|
+
el.classList.remove('loading');
|
|
2753
|
+
el.innerHTML = '';
|
|
2754
|
+
}
|
|
2742
2755
|
}
|
|
2743
2756
|
}, {
|
|
2744
2757
|
key: "render",
|
|
@@ -2951,11 +2964,11 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2951
2964
|
}, {
|
|
2952
2965
|
key: "handleSearch",
|
|
2953
2966
|
value: function handleSearch(searchText) {
|
|
2954
|
-
var
|
|
2967
|
+
var _this18 = this;
|
|
2955
2968
|
|
|
2956
2969
|
var el = document.getElementById(this.elementId);
|
|
2957
2970
|
var lowestItems = this.flatItems.filter(function (d) {
|
|
2958
|
-
return d.level ===
|
|
2971
|
+
return d.level === _this18.maxLevel;
|
|
2959
2972
|
});
|
|
2960
2973
|
var visibleItems = lowestItems;
|
|
2961
2974
|
var defaultMethod = 'remove';
|
|
@@ -2963,7 +2976,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2963
2976
|
if (searchText.length > 1) {
|
|
2964
2977
|
defaultMethod = 'add';
|
|
2965
2978
|
visibleItems = lowestItems.filter(function (d) {
|
|
2966
|
-
return d[
|
|
2979
|
+
return d[_this18.options.searchProp].toLowerCase().indexOf(searchText.toLowerCase()) !== -1;
|
|
2967
2980
|
});
|
|
2968
2981
|
} // hide everything
|
|
2969
2982
|
|
|
@@ -3147,7 +3160,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
3147
3160
|
|
|
3148
3161
|
var Pager = /*#__PURE__*/function () {
|
|
3149
3162
|
function Pager(elementId, options) {
|
|
3150
|
-
var
|
|
3163
|
+
var _this19 = this;
|
|
3151
3164
|
|
|
3152
3165
|
_classCallCheck(this, Pager);
|
|
3153
3166
|
|
|
@@ -3200,8 +3213,8 @@ var Pager = /*#__PURE__*/function () {
|
|
|
3200
3213
|
allowClear: false,
|
|
3201
3214
|
disableSearch: true,
|
|
3202
3215
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
3203
|
-
if (
|
|
3204
|
-
|
|
3216
|
+
if (_this19.options.onChangePageSize) {
|
|
3217
|
+
_this19.options.onChangePageSize(selectedItem.value);
|
|
3205
3218
|
}
|
|
3206
3219
|
}
|
|
3207
3220
|
});
|
|
@@ -3225,13 +3238,13 @@ var Pager = /*#__PURE__*/function () {
|
|
|
3225
3238
|
}, {
|
|
3226
3239
|
key: "render",
|
|
3227
3240
|
value: function render() {
|
|
3228
|
-
var
|
|
3241
|
+
var _this20 = this;
|
|
3229
3242
|
|
|
3230
3243
|
var el = document.getElementById("".concat(this.elementId, "_pageList"));
|
|
3231
3244
|
|
|
3232
3245
|
if (el) {
|
|
3233
3246
|
var pages = this.options.pages.map(function (item, index) {
|
|
3234
|
-
return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
3247
|
+
return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(_this20.options.activePage === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
3235
3248
|
});
|
|
3236
3249
|
var startIndex = 0;
|
|
3237
3250
|
|
|
@@ -3299,58 +3312,58 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
3299
3312
|
_createClass(WebsyPDFButton, [{
|
|
3300
3313
|
key: "handleClick",
|
|
3301
3314
|
value: function handleClick(event) {
|
|
3302
|
-
var
|
|
3315
|
+
var _this21 = this;
|
|
3303
3316
|
|
|
3304
3317
|
if (event.target.classList.contains('websy-pdf-button')) {
|
|
3305
3318
|
this.loader.show();
|
|
3306
3319
|
setTimeout(function () {
|
|
3307
|
-
if (
|
|
3308
|
-
var el = document.getElementById(
|
|
3320
|
+
if (_this21.options.targetId) {
|
|
3321
|
+
var el = document.getElementById(_this21.options.targetId);
|
|
3309
3322
|
|
|
3310
3323
|
if (el) {
|
|
3311
3324
|
var pdfData = {
|
|
3312
3325
|
options: {}
|
|
3313
3326
|
};
|
|
3314
3327
|
|
|
3315
|
-
if (
|
|
3316
|
-
pdfData.options = _extends({},
|
|
3328
|
+
if (_this21.options.pdfOptions) {
|
|
3329
|
+
pdfData.options = _extends({}, _this21.options.pdfOptions);
|
|
3317
3330
|
}
|
|
3318
3331
|
|
|
3319
|
-
if (
|
|
3320
|
-
if (
|
|
3321
|
-
var headerEl = document.getElementById(
|
|
3332
|
+
if (_this21.options.header) {
|
|
3333
|
+
if (_this21.options.header.elementId) {
|
|
3334
|
+
var headerEl = document.getElementById(_this21.options.header.elementId);
|
|
3322
3335
|
|
|
3323
3336
|
if (headerEl) {
|
|
3324
3337
|
pdfData.header = headerEl.outerHTML;
|
|
3325
3338
|
|
|
3326
|
-
if (
|
|
3327
|
-
pdfData.options.headerCSS =
|
|
3339
|
+
if (_this21.options.header.css) {
|
|
3340
|
+
pdfData.options.headerCSS = _this21.options.header.css;
|
|
3328
3341
|
}
|
|
3329
3342
|
}
|
|
3330
|
-
} else if (
|
|
3331
|
-
pdfData.header =
|
|
3343
|
+
} else if (_this21.options.header.html) {
|
|
3344
|
+
pdfData.header = _this21.options.header.html;
|
|
3332
3345
|
|
|
3333
|
-
if (
|
|
3334
|
-
pdfData.options.headerCSS =
|
|
3346
|
+
if (_this21.options.header.css) {
|
|
3347
|
+
pdfData.options.headerCSS = _this21.options.header.css;
|
|
3335
3348
|
}
|
|
3336
3349
|
} else {
|
|
3337
|
-
pdfData.header =
|
|
3350
|
+
pdfData.header = _this21.options.header;
|
|
3338
3351
|
}
|
|
3339
3352
|
}
|
|
3340
3353
|
|
|
3341
|
-
if (
|
|
3342
|
-
if (
|
|
3343
|
-
var footerEl = document.getElementById(
|
|
3354
|
+
if (_this21.options.footer) {
|
|
3355
|
+
if (_this21.options.footer.elementId) {
|
|
3356
|
+
var footerEl = document.getElementById(_this21.options.footer.elementId);
|
|
3344
3357
|
|
|
3345
3358
|
if (footerEl) {
|
|
3346
3359
|
pdfData.footer = footerEl.outerHTML;
|
|
3347
3360
|
|
|
3348
|
-
if (
|
|
3349
|
-
pdfData.options.footerCSS =
|
|
3361
|
+
if (_this21.options.footer.css) {
|
|
3362
|
+
pdfData.options.footerCSS = _this21.options.footer.css;
|
|
3350
3363
|
}
|
|
3351
3364
|
}
|
|
3352
3365
|
} else {
|
|
3353
|
-
pdfData.footer =
|
|
3366
|
+
pdfData.footer = _this21.options.footer;
|
|
3354
3367
|
}
|
|
3355
3368
|
}
|
|
3356
3369
|
|
|
@@ -3359,31 +3372,31 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
3359
3372
|
// document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
|
|
3360
3373
|
// document.getElementById(`${this.elementId}_form`).submit()
|
|
3361
3374
|
|
|
3362
|
-
|
|
3375
|
+
_this21.service.add('', pdfData, {
|
|
3363
3376
|
responseType: 'blob'
|
|
3364
3377
|
}).then(function (response) {
|
|
3365
|
-
|
|
3378
|
+
_this21.loader.hide();
|
|
3366
3379
|
|
|
3367
3380
|
var blob = new Blob([response], {
|
|
3368
3381
|
type: 'application/pdf'
|
|
3369
3382
|
});
|
|
3370
3383
|
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
3384
|
|
|
3372
|
-
if (
|
|
3385
|
+
if (_this21.options.directDownload === true) {
|
|
3373
3386
|
var fileName;
|
|
3374
3387
|
|
|
3375
|
-
if (typeof
|
|
3376
|
-
fileName =
|
|
3388
|
+
if (typeof _this21.options.fileName === 'function') {
|
|
3389
|
+
fileName = _this21.options.fileName() || 'Export';
|
|
3377
3390
|
} else {
|
|
3378
|
-
fileName =
|
|
3391
|
+
fileName = _this21.options.fileName || 'Export';
|
|
3379
3392
|
}
|
|
3380
3393
|
|
|
3381
3394
|
msg += "download='".concat(fileName, ".pdf'");
|
|
3382
3395
|
}
|
|
3383
3396
|
|
|
3384
|
-
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(
|
|
3397
|
+
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this21.options.buttonText, "</button>\n </a>\n </div>\n ");
|
|
3385
3398
|
|
|
3386
|
-
|
|
3399
|
+
_this21.popup.show({
|
|
3387
3400
|
message: msg,
|
|
3388
3401
|
mask: true
|
|
3389
3402
|
});
|
|
@@ -3584,7 +3597,7 @@ var WebsyPubSub = /*#__PURE__*/function () {
|
|
|
3584
3597
|
|
|
3585
3598
|
var ResponsiveText = /*#__PURE__*/function () {
|
|
3586
3599
|
function ResponsiveText(elementId, options) {
|
|
3587
|
-
var
|
|
3600
|
+
var _this22 = this;
|
|
3588
3601
|
|
|
3589
3602
|
_classCallCheck(this, ResponsiveText);
|
|
3590
3603
|
|
|
@@ -3597,7 +3610,7 @@ var ResponsiveText = /*#__PURE__*/function () {
|
|
|
3597
3610
|
this.elementId = elementId;
|
|
3598
3611
|
this.canvas = document.createElement('canvas');
|
|
3599
3612
|
window.addEventListener('resize', function () {
|
|
3600
|
-
return
|
|
3613
|
+
return _this22.render();
|
|
3601
3614
|
});
|
|
3602
3615
|
var el = document.getElementById(this.elementId);
|
|
3603
3616
|
|
|
@@ -3816,7 +3829,7 @@ var ResponsiveText = /*#__PURE__*/function () {
|
|
|
3816
3829
|
|
|
3817
3830
|
var WebsyResultList = /*#__PURE__*/function () {
|
|
3818
3831
|
function WebsyResultList(elementId, options) {
|
|
3819
|
-
var
|
|
3832
|
+
var _this23 = this;
|
|
3820
3833
|
|
|
3821
3834
|
_classCallCheck(this, WebsyResultList);
|
|
3822
3835
|
|
|
@@ -3848,9 +3861,9 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3848
3861
|
|
|
3849
3862
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
3850
3863
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
3851
|
-
|
|
3864
|
+
_this23.options.template = templateString;
|
|
3852
3865
|
|
|
3853
|
-
|
|
3866
|
+
_this23.render();
|
|
3854
3867
|
});
|
|
3855
3868
|
} else {
|
|
3856
3869
|
this.render();
|
|
@@ -3870,7 +3883,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3870
3883
|
}, {
|
|
3871
3884
|
key: "buildHTML",
|
|
3872
3885
|
value: function buildHTML(d) {
|
|
3873
|
-
var
|
|
3886
|
+
var _this24 = this;
|
|
3874
3887
|
|
|
3875
3888
|
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
3876
3889
|
var inputTemplate = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -3880,7 +3893,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3880
3893
|
if (this.options.template) {
|
|
3881
3894
|
if (d.length > 0) {
|
|
3882
3895
|
d.forEach(function (row, ix) {
|
|
3883
|
-
var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate ||
|
|
3896
|
+
var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate || _this24.options.template).concat(ix < d.length - 1 ? '<!--' : ''); // find conditional elements
|
|
3884
3897
|
|
|
3885
3898
|
var ifMatches = _toConsumableArray(template.matchAll(/<\s*if[^>]*>([\s\S]*?)<\s*\/\s*if>/g));
|
|
3886
3899
|
|
|
@@ -3985,7 +3998,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3985
3998
|
parts.forEach(function (p) {
|
|
3986
3999
|
items = items[p];
|
|
3987
4000
|
});
|
|
3988
|
-
template = template.replace(m[0],
|
|
4001
|
+
template = template.replace(m[0], _this24.buildHTML(items, 0, withoutFor, [].concat(_toConsumableArray(locator), ["".concat(startIndex + ix, ":").concat(c)])));
|
|
3989
4002
|
}
|
|
3990
4003
|
});
|
|
3991
4004
|
|
|
@@ -3997,7 +4010,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3997
4010
|
}
|
|
3998
4011
|
});
|
|
3999
4012
|
|
|
4000
|
-
var flatRow =
|
|
4013
|
+
var flatRow = _this24.flattenObject(row);
|
|
4001
4014
|
|
|
4002
4015
|
for (var key in flatRow) {
|
|
4003
4016
|
var rg = new RegExp("{".concat(key, "}"), 'gm');
|
|
@@ -4132,13 +4145,13 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
4132
4145
|
}, {
|
|
4133
4146
|
key: "render",
|
|
4134
4147
|
value: function render() {
|
|
4135
|
-
var
|
|
4148
|
+
var _this25 = this;
|
|
4136
4149
|
|
|
4137
4150
|
if (this.options.entity) {
|
|
4138
4151
|
this.apiService.get(this.options.entity).then(function (results) {
|
|
4139
|
-
|
|
4152
|
+
_this25.rows = results.rows;
|
|
4140
4153
|
|
|
4141
|
-
|
|
4154
|
+
_this25.resize();
|
|
4142
4155
|
});
|
|
4143
4156
|
} else {
|
|
4144
4157
|
this.resize();
|
|
@@ -4224,14 +4237,14 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4224
4237
|
_createClass(WebsyRouter, [{
|
|
4225
4238
|
key: "addGroup",
|
|
4226
4239
|
value: function addGroup(group) {
|
|
4227
|
-
var
|
|
4240
|
+
var _this26 = this;
|
|
4228
4241
|
|
|
4229
4242
|
if (!this.groups[group]) {
|
|
4230
4243
|
var els = document.querySelectorAll(".websy-view[data-group=\"".concat(group, "\"]"));
|
|
4231
4244
|
|
|
4232
4245
|
if (els) {
|
|
4233
4246
|
this.getClosestParent(els[0], function (parent) {
|
|
4234
|
-
|
|
4247
|
+
_this26.groups[group] = {
|
|
4235
4248
|
activeView: '',
|
|
4236
4249
|
views: [],
|
|
4237
4250
|
parent: parent.getAttribute('data-view')
|
|
@@ -4294,7 +4307,7 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4294
4307
|
}, {
|
|
4295
4308
|
key: "removeUrlParams",
|
|
4296
4309
|
value: function removeUrlParams() {
|
|
4297
|
-
var
|
|
4310
|
+
var _this27 = this;
|
|
4298
4311
|
|
|
4299
4312
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
4300
4313
|
var reloadView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -4308,7 +4321,7 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4308
4321
|
|
|
4309
4322
|
if (this.currentParams && this.currentParams.items) {
|
|
4310
4323
|
params.forEach(function (p) {
|
|
4311
|
-
delete
|
|
4324
|
+
delete _this27.currentParams.items[p];
|
|
4312
4325
|
});
|
|
4313
4326
|
path = this.buildUrlPath(this.currentParams.items);
|
|
4314
4327
|
}
|
|
@@ -4672,12 +4685,12 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4672
4685
|
}, {
|
|
4673
4686
|
key: "showComponents",
|
|
4674
4687
|
value: function showComponents(view) {
|
|
4675
|
-
var
|
|
4688
|
+
var _this28 = this;
|
|
4676
4689
|
|
|
4677
4690
|
if (this.options.views && this.options.views[view] && this.options.views[view].components) {
|
|
4678
4691
|
this.options.views[view].components.forEach(function (c) {
|
|
4679
4692
|
if (typeof c.instance === 'undefined') {
|
|
4680
|
-
|
|
4693
|
+
_this28.prepComponent(c.elementId, c.options);
|
|
4681
4694
|
|
|
4682
4695
|
c.instance = new c.Component(c.elementId, c.options);
|
|
4683
4696
|
} else if (c.instance.render) {
|
|
@@ -5032,7 +5045,7 @@ var WebsySearch = /*#__PURE__*/function () {
|
|
|
5032
5045
|
}, {
|
|
5033
5046
|
key: "handleKeyUp",
|
|
5034
5047
|
value: function handleKeyUp(event) {
|
|
5035
|
-
var
|
|
5048
|
+
var _this29 = this;
|
|
5036
5049
|
|
|
5037
5050
|
if (event.target.classList.contains('websy-search-input')) {
|
|
5038
5051
|
if (this.searchTimeoutFn) {
|
|
@@ -5051,8 +5064,8 @@ var WebsySearch = /*#__PURE__*/function () {
|
|
|
5051
5064
|
|
|
5052
5065
|
if (event.target.value.length >= this.options.minLength) {
|
|
5053
5066
|
this.searchTimeoutFn = setTimeout(function () {
|
|
5054
|
-
if (
|
|
5055
|
-
|
|
5067
|
+
if (_this29.options.onSearch) {
|
|
5068
|
+
_this29.options.onSearch(event.target.value);
|
|
5056
5069
|
}
|
|
5057
5070
|
}, this.options.searchTimeout);
|
|
5058
5071
|
} else {
|
|
@@ -5214,7 +5227,7 @@ var Switch = /*#__PURE__*/function () {
|
|
|
5214
5227
|
|
|
5215
5228
|
var WebsyTemplate = /*#__PURE__*/function () {
|
|
5216
5229
|
function WebsyTemplate(elementId, options) {
|
|
5217
|
-
var
|
|
5230
|
+
var _this30 = this;
|
|
5218
5231
|
|
|
5219
5232
|
_classCallCheck(this, WebsyTemplate);
|
|
5220
5233
|
|
|
@@ -5240,9 +5253,9 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
5240
5253
|
|
|
5241
5254
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
5242
5255
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
5243
|
-
|
|
5256
|
+
_this30.options.template = templateString;
|
|
5244
5257
|
|
|
5245
|
-
|
|
5258
|
+
_this30.render();
|
|
5246
5259
|
});
|
|
5247
5260
|
} else {
|
|
5248
5261
|
this.render();
|
|
@@ -5252,7 +5265,7 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
5252
5265
|
_createClass(WebsyTemplate, [{
|
|
5253
5266
|
key: "buildHTML",
|
|
5254
5267
|
value: function buildHTML() {
|
|
5255
|
-
var
|
|
5268
|
+
var _this31 = this;
|
|
5256
5269
|
|
|
5257
5270
|
var html = "";
|
|
5258
5271
|
|
|
@@ -5314,14 +5327,14 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
5314
5327
|
}
|
|
5315
5328
|
|
|
5316
5329
|
if (polarity === true) {
|
|
5317
|
-
if (typeof
|
|
5330
|
+
if (typeof _this31.options.data[parts[0]] !== 'undefined' && _this31.options.data[parts[0]] === parts[1]) {
|
|
5318
5331
|
// remove the <if> tags
|
|
5319
5332
|
removeAll = false;
|
|
5320
5333
|
} else if (parts[0] === parts[1]) {
|
|
5321
5334
|
removeAll = false;
|
|
5322
5335
|
}
|
|
5323
5336
|
} else if (polarity === false) {
|
|
5324
|
-
if (typeof
|
|
5337
|
+
if (typeof _this31.options.data[parts[0]] !== 'undefined' && _this31.options.data[parts[0]] !== parts[1]) {
|
|
5325
5338
|
// remove the <if> tags
|
|
5326
5339
|
removeAll = false;
|
|
5327
5340
|
}
|
|
@@ -5611,7 +5624,7 @@ var WebsyUtils = {
|
|
|
5611
5624
|
|
|
5612
5625
|
var WebsyTable = /*#__PURE__*/function () {
|
|
5613
5626
|
function WebsyTable(elementId, options) {
|
|
5614
|
-
var
|
|
5627
|
+
var _this32 = this;
|
|
5615
5628
|
|
|
5616
5629
|
_classCallCheck(this, WebsyTable);
|
|
5617
5630
|
|
|
@@ -5649,8 +5662,8 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5649
5662
|
allowClear: false,
|
|
5650
5663
|
disableSearch: true,
|
|
5651
5664
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
5652
|
-
if (
|
|
5653
|
-
|
|
5665
|
+
if (_this32.options.onChangePageSize) {
|
|
5666
|
+
_this32.options.onChangePageSize(selectedItem.value);
|
|
5654
5667
|
}
|
|
5655
5668
|
}
|
|
5656
5669
|
});
|
|
@@ -5671,7 +5684,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5671
5684
|
_createClass(WebsyTable, [{
|
|
5672
5685
|
key: "appendRows",
|
|
5673
5686
|
value: function appendRows(data) {
|
|
5674
|
-
var
|
|
5687
|
+
var _this33 = this;
|
|
5675
5688
|
|
|
5676
5689
|
this.hideError();
|
|
5677
5690
|
var bodyHTML = '';
|
|
@@ -5679,15 +5692,15 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5679
5692
|
if (data) {
|
|
5680
5693
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
5681
5694
|
return '<tr>' + r.map(function (c, i) {
|
|
5682
|
-
if (
|
|
5695
|
+
if (_this33.options.columns[i].show !== false) {
|
|
5683
5696
|
var style = '';
|
|
5684
5697
|
|
|
5685
5698
|
if (c.style) {
|
|
5686
5699
|
style += c.style;
|
|
5687
5700
|
}
|
|
5688
5701
|
|
|
5689
|
-
if (
|
|
5690
|
-
style += "width: ".concat(
|
|
5702
|
+
if (_this33.options.columns[i].width) {
|
|
5703
|
+
style += "width: ".concat(_this33.options.columns[i].width, "; ");
|
|
5691
5704
|
}
|
|
5692
5705
|
|
|
5693
5706
|
if (c.backgroundColor) {
|
|
@@ -5702,18 +5715,18 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5702
5715
|
style += "color: ".concat(c.color, "; ");
|
|
5703
5716
|
}
|
|
5704
5717
|
|
|
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(
|
|
5718
|
+
if (_this33.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
5719
|
+
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 ");
|
|
5720
|
+
} else if ((_this33.options.columns[i].showAsNavigatorLink === true || _this33.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
5721
|
+
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
5722
|
} else {
|
|
5710
5723
|
var info = c.value;
|
|
5711
5724
|
|
|
5712
|
-
if (
|
|
5725
|
+
if (_this33.options.columns[i].showAsImage === true) {
|
|
5713
5726
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
5714
5727
|
}
|
|
5715
5728
|
|
|
5716
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
5729
|
+
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
5730
|
}
|
|
5718
5731
|
}
|
|
5719
5732
|
}).join('') + '</tr>';
|
|
@@ -5885,7 +5898,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5885
5898
|
}, {
|
|
5886
5899
|
key: "render",
|
|
5887
5900
|
value: function render(data) {
|
|
5888
|
-
var
|
|
5901
|
+
var _this34 = this;
|
|
5889
5902
|
|
|
5890
5903
|
if (!this.options.columns) {
|
|
5891
5904
|
return;
|
|
@@ -5920,7 +5933,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5920
5933
|
style += "width: ".concat(c.width || 'auto', ";");
|
|
5921
5934
|
}
|
|
5922
5935
|
|
|
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 ?
|
|
5936
|
+
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
5937
|
}
|
|
5925
5938
|
}).join('') + '</tr>';
|
|
5926
5939
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -5939,7 +5952,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5939
5952
|
|
|
5940
5953
|
if (pagingEl) {
|
|
5941
5954
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
5942
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
5955
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this34.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
5943
5956
|
});
|
|
5944
5957
|
var startIndex = 0;
|
|
5945
5958
|
|
|
@@ -6007,7 +6020,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
6007
6020
|
|
|
6008
6021
|
var WebsyTable2 = /*#__PURE__*/function () {
|
|
6009
6022
|
function WebsyTable2(elementId, options) {
|
|
6010
|
-
var
|
|
6023
|
+
var _this35 = this;
|
|
6011
6024
|
|
|
6012
6025
|
_classCallCheck(this, WebsyTable2);
|
|
6013
6026
|
|
|
@@ -6048,8 +6061,8 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6048
6061
|
allowClear: false,
|
|
6049
6062
|
disableSearch: true,
|
|
6050
6063
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
6051
|
-
if (
|
|
6052
|
-
|
|
6064
|
+
if (_this35.options.onChangePageSize) {
|
|
6065
|
+
_this35.options.onChangePageSize(selectedItem.value);
|
|
6053
6066
|
}
|
|
6054
6067
|
}
|
|
6055
6068
|
});
|
|
@@ -6073,7 +6086,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6073
6086
|
_createClass(WebsyTable2, [{
|
|
6074
6087
|
key: "appendRows",
|
|
6075
6088
|
value: function appendRows(data) {
|
|
6076
|
-
var
|
|
6089
|
+
var _this36 = this;
|
|
6077
6090
|
|
|
6078
6091
|
this.hideError();
|
|
6079
6092
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
@@ -6082,15 +6095,15 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6082
6095
|
if (data) {
|
|
6083
6096
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
6084
6097
|
return '<tr>' + r.map(function (c, i) {
|
|
6085
|
-
if (
|
|
6086
|
-
var style = "height: ".concat(
|
|
6098
|
+
if (_this36.options.columns[i].show !== false) {
|
|
6099
|
+
var style = "height: ".concat(_this36.options.cellSize, "px; line-height: ").concat(_this36.options.cellSize, "px;");
|
|
6087
6100
|
|
|
6088
6101
|
if (c.style) {
|
|
6089
6102
|
style += c.style;
|
|
6090
6103
|
}
|
|
6091
6104
|
|
|
6092
|
-
if (
|
|
6093
|
-
style += "width: ".concat(
|
|
6105
|
+
if (_this36.options.columns[i].width) {
|
|
6106
|
+
style += "width: ".concat(_this36.options.columns[i].width, "; ");
|
|
6094
6107
|
}
|
|
6095
6108
|
|
|
6096
6109
|
if (c.backgroundColor) {
|
|
@@ -6105,18 +6118,18 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6105
6118
|
style += "color: ".concat(c.color, "; ");
|
|
6106
6119
|
}
|
|
6107
6120
|
|
|
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(
|
|
6121
|
+
if (_this36.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
6122
|
+
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 ");
|
|
6123
|
+
} else if ((_this36.options.columns[i].showAsNavigatorLink === true || _this36.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
6124
|
+
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
6125
|
} else {
|
|
6113
6126
|
var info = c.value;
|
|
6114
6127
|
|
|
6115
|
-
if (
|
|
6128
|
+
if (_this36.options.columns[i].showAsImage === true) {
|
|
6116
6129
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
6117
6130
|
}
|
|
6118
6131
|
|
|
6119
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
6132
|
+
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
6133
|
}
|
|
6121
6134
|
}
|
|
6122
6135
|
}).join('') + '</tr>';
|
|
@@ -6379,7 +6392,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6379
6392
|
}, {
|
|
6380
6393
|
key: "render",
|
|
6381
6394
|
value: function render(data) {
|
|
6382
|
-
var
|
|
6395
|
+
var _this37 = this;
|
|
6383
6396
|
|
|
6384
6397
|
if (!this.options.columns) {
|
|
6385
6398
|
return;
|
|
@@ -6415,7 +6428,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6415
6428
|
style += "width: ".concat(c.width || 'auto', "; ");
|
|
6416
6429
|
}
|
|
6417
6430
|
|
|
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 ?
|
|
6431
|
+
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
6432
|
}
|
|
6420
6433
|
}).join('') + '</tr>';
|
|
6421
6434
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -6426,7 +6439,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6426
6439
|
var dropdownHTML = "";
|
|
6427
6440
|
this.options.columns.forEach(function (c, i) {
|
|
6428
6441
|
if (c.searchable && c.searchField) {
|
|
6429
|
-
dropdownHTML += "\n <div id=\"".concat(
|
|
6442
|
+
dropdownHTML += "\n <div id=\"".concat(_this37.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
|
|
6430
6443
|
}
|
|
6431
6444
|
});
|
|
6432
6445
|
dropdownEl.innerHTML = dropdownHTML;
|
|
@@ -6448,7 +6461,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6448
6461
|
|
|
6449
6462
|
if (pagingEl) {
|
|
6450
6463
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
6451
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
6464
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this37.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
6452
6465
|
});
|
|
6453
6466
|
var startIndex = 0;
|
|
6454
6467
|
|
|
@@ -6539,7 +6552,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6539
6552
|
}, {
|
|
6540
6553
|
key: "getColumnParameters",
|
|
6541
6554
|
value: function getColumnParameters(values) {
|
|
6542
|
-
var
|
|
6555
|
+
var _this38 = this;
|
|
6543
6556
|
|
|
6544
6557
|
var tableEl = document.getElementById("".concat(this.elementId, "_table"));
|
|
6545
6558
|
tableEl.style.tableLayout = 'auto';
|
|
@@ -6547,10 +6560,10 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6547
6560
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
6548
6561
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
6549
6562
|
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 ?
|
|
6563
|
+
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
6564
|
}).join('') + '</tr>';
|
|
6552
6565
|
bodyEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c) {
|
|
6553
|
-
return "\n <td \n style='height: ".concat(
|
|
6566
|
+
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
6567
|
}).join('') + '</tr>'; // get height of the first data cell
|
|
6555
6568
|
|
|
6556
6569
|
var cells = bodyEl.querySelectorAll("tr:first-of-type td");
|
|
@@ -6678,7 +6691,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6678
6691
|
}, {
|
|
6679
6692
|
key: "buildBodyHtml",
|
|
6680
6693
|
value: function buildBodyHtml() {
|
|
6681
|
-
var
|
|
6694
|
+
var _this39 = this;
|
|
6682
6695
|
|
|
6683
6696
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6684
6697
|
var useWidths = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -6737,7 +6750,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6737
6750
|
} // console.log('rowspan', cell.rowspan)
|
|
6738
6751
|
|
|
6739
6752
|
|
|
6740
|
-
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) {
|
|
6753
|
+
bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this39.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) {
|
|
6741
6754
|
// bodyHtml += `
|
|
6742
6755
|
// style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
|
|
6743
6756
|
// width='${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}'
|
|
@@ -6747,11 +6760,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6747
6760
|
bodyHtml += "\n ><div style='".concat(divStyle, "'>");
|
|
6748
6761
|
|
|
6749
6762
|
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(
|
|
6763
|
+
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
6764
|
}
|
|
6752
6765
|
|
|
6753
6766
|
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(
|
|
6767
|
+
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
6768
|
}
|
|
6756
6769
|
|
|
6757
6770
|
if (sizingColumns[sizeIndex].showAsLink === true && cell.value.trim() !== '') {
|
|
@@ -6776,7 +6789,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6776
6789
|
}, {
|
|
6777
6790
|
key: "buildHeaderHtml",
|
|
6778
6791
|
value: function buildHeaderHtml() {
|
|
6779
|
-
var
|
|
6792
|
+
var _this40 = this;
|
|
6780
6793
|
|
|
6781
6794
|
var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6782
6795
|
var headerHtml = '';
|
|
@@ -6791,7 +6804,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6791
6804
|
}
|
|
6792
6805
|
|
|
6793
6806
|
this.options.columns.forEach(function (row, rowIndex) {
|
|
6794
|
-
if (useWidths === false && rowIndex !==
|
|
6807
|
+
if (useWidths === false && rowIndex !== _this40.options.columns.length - 1) {
|
|
6795
6808
|
// if we're calculating the size we only want to render the last row of column headers
|
|
6796
6809
|
return;
|
|
6797
6810
|
}
|
|
@@ -6817,18 +6830,18 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6817
6830
|
// `
|
|
6818
6831
|
// }
|
|
6819
6832
|
|
|
6820
|
-
headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ?
|
|
6833
|
+
headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ? _this40.buildSearchIcon(col, colIndex) : '', "</div></td>");
|
|
6821
6834
|
});
|
|
6822
6835
|
headerHtml += "</tr>";
|
|
6823
6836
|
});
|
|
6824
6837
|
var dropdownEl = document.getElementById("".concat(this.elementId, "_dropdownContainer"));
|
|
6825
6838
|
this.options.columns[this.options.columns.length - 1].forEach(function (c, i) {
|
|
6826
6839
|
if (c.searchable && c.isExternalSearch === true) {
|
|
6827
|
-
var testEl = document.getElementById("".concat(
|
|
6840
|
+
var testEl = document.getElementById("".concat(_this40.elementId, "_columnSearch_").concat(c.dimId || i));
|
|
6828
6841
|
|
|
6829
6842
|
if (!testEl) {
|
|
6830
6843
|
var newE = document.createElement('div');
|
|
6831
|
-
newE.id = "".concat(
|
|
6844
|
+
newE.id = "".concat(_this40.elementId, "_columnSearch_").concat(c.dimId || i);
|
|
6832
6845
|
newE.className = 'websy-modal-dropdown';
|
|
6833
6846
|
dropdownEl.appendChild(newE);
|
|
6834
6847
|
}
|
|
@@ -6844,7 +6857,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6844
6857
|
}, {
|
|
6845
6858
|
key: "buildTotalHtml",
|
|
6846
6859
|
value: function buildTotalHtml() {
|
|
6847
|
-
var
|
|
6860
|
+
var _this41 = this;
|
|
6848
6861
|
|
|
6849
6862
|
var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6850
6863
|
|
|
@@ -6857,7 +6870,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6857
6870
|
totalHtml += "<td \n class='websy-table-cell'\n colspan='".concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
|
|
6858
6871
|
|
|
6859
6872
|
if (useWidths === true) {
|
|
6860
|
-
totalHtml += "\n style='width: ".concat(
|
|
6873
|
+
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
6874
|
}
|
|
6862
6875
|
|
|
6863
6876
|
totalHtml += " \n >\n ".concat(col.value, "\n </td>");
|
|
@@ -6868,7 +6881,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6868
6881
|
}, {
|
|
6869
6882
|
key: "calculateSizes",
|
|
6870
6883
|
value: function calculateSizes() {
|
|
6871
|
-
var
|
|
6884
|
+
var _this42 = this;
|
|
6872
6885
|
|
|
6873
6886
|
var sample = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6874
6887
|
var totalRowCount = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -6911,32 +6924,32 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6911
6924
|
rows.forEach(function (row, rowIndex) {
|
|
6912
6925
|
Array.from(row.children).forEach(function (col, colIndex) {
|
|
6913
6926
|
var colSize = col.getBoundingClientRect();
|
|
6914
|
-
|
|
6927
|
+
_this42.sizes.cellHeight = colSize.height;
|
|
6915
6928
|
|
|
6916
|
-
if (
|
|
6917
|
-
if (!
|
|
6918
|
-
|
|
6929
|
+
if (_this42.options.columns[_this42.options.columns.length - 1][colIndex]) {
|
|
6930
|
+
if (!_this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth) {
|
|
6931
|
+
_this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth = 0;
|
|
6919
6932
|
}
|
|
6920
6933
|
|
|
6921
|
-
|
|
6922
|
-
|
|
6934
|
+
_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);
|
|
6935
|
+
_this42.options.columns[_this42.options.columns.length - 1][colIndex].cellHeight = colSize.height;
|
|
6923
6936
|
|
|
6924
|
-
if (colIndex >=
|
|
6925
|
-
firstNonPinnedColumnWidth =
|
|
6937
|
+
if (colIndex >= _this42.pinnedColumns) {
|
|
6938
|
+
firstNonPinnedColumnWidth = _this42.options.columns[_this42.options.columns.length - 1][colIndex].actualWidth;
|
|
6926
6939
|
}
|
|
6927
6940
|
}
|
|
6928
6941
|
});
|
|
6929
6942
|
});
|
|
6930
6943
|
this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
|
|
6931
|
-
if (colIndex <
|
|
6932
|
-
|
|
6944
|
+
if (colIndex < _this42.pinnedColumns) {
|
|
6945
|
+
_this42.sizes.scrollableWidth -= col.actualWidth;
|
|
6933
6946
|
}
|
|
6934
6947
|
});
|
|
6935
6948
|
this.sizes.totalWidth = this.options.columns[this.options.columns.length - 1].reduce(function (a, b) {
|
|
6936
6949
|
return a + (b.width || b.actualWidth);
|
|
6937
6950
|
}, 0);
|
|
6938
6951
|
this.sizes.totalNonPinnedWidth = this.options.columns[this.options.columns.length - 1].filter(function (c, i) {
|
|
6939
|
-
return i >=
|
|
6952
|
+
return i >= _this42.pinnedColumns;
|
|
6940
6953
|
}).reduce(function (a, b) {
|
|
6941
6954
|
return a + (b.width || b.actualWidth);
|
|
6942
6955
|
}, 0);
|
|
@@ -6957,10 +6970,10 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6957
6970
|
c.actualWidth += equalWidth; // }
|
|
6958
6971
|
// }
|
|
6959
6972
|
|
|
6960
|
-
|
|
6973
|
+
_this42.sizes.totalWidth += c.width || c.actualWidth;
|
|
6961
6974
|
|
|
6962
|
-
if (i <
|
|
6963
|
-
|
|
6975
|
+
if (i < _this42.pinnedColumns) {
|
|
6976
|
+
_this42.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
|
|
6964
6977
|
} // equalWidth = (outerSize.width - this.sizes.totalWidth) / (this.options.columns[this.options.columns.length - 1].length - (i + 1))
|
|
6965
6978
|
|
|
6966
6979
|
});
|
|
@@ -7017,7 +7030,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7017
7030
|
}, {
|
|
7018
7031
|
key: "createSample",
|
|
7019
7032
|
value: function createSample(data) {
|
|
7020
|
-
var
|
|
7033
|
+
var _this43 = this;
|
|
7021
7034
|
|
|
7022
7035
|
var output = [];
|
|
7023
7036
|
this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
|
|
@@ -7029,7 +7042,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7029
7042
|
var longest = '';
|
|
7030
7043
|
|
|
7031
7044
|
for (var i = 0; i < Math.min(data.length, 1000); i++) {
|
|
7032
|
-
if (data[i].length ===
|
|
7045
|
+
if (data[i].length === _this43.options.columns[_this43.options.columns.length - 1].length) {
|
|
7033
7046
|
if (longest.length < data[i][colIndex].value.length) {
|
|
7034
7047
|
longest = data[i][colIndex].value;
|
|
7035
7048
|
}
|
|
@@ -7424,7 +7437,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7424
7437
|
|
|
7425
7438
|
var WebsyChart = /*#__PURE__*/function () {
|
|
7426
7439
|
function WebsyChart(elementId, options) {
|
|
7427
|
-
var
|
|
7440
|
+
var _this44 = this;
|
|
7428
7441
|
|
|
7429
7442
|
_classCallCheck(this, WebsyChart);
|
|
7430
7443
|
|
|
@@ -7475,22 +7488,22 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7475
7488
|
this.invertOverride = function (input, input2) {
|
|
7476
7489
|
var xAxis = 'bottomAxis';
|
|
7477
7490
|
|
|
7478
|
-
if (
|
|
7491
|
+
if (_this44.options.orientation === 'horizontal') {
|
|
7479
7492
|
xAxis = 'leftAxis';
|
|
7480
7493
|
}
|
|
7481
7494
|
|
|
7482
|
-
var width =
|
|
7495
|
+
var width = _this44[xAxis].step();
|
|
7483
7496
|
|
|
7484
7497
|
var output;
|
|
7485
7498
|
|
|
7486
|
-
var domain = _toConsumableArray(
|
|
7499
|
+
var domain = _toConsumableArray(_this44[xAxis].domain());
|
|
7487
7500
|
|
|
7488
|
-
if (
|
|
7501
|
+
if (_this44.options.orientation === 'horizontal') {
|
|
7489
7502
|
domain = domain.reverse();
|
|
7490
7503
|
}
|
|
7491
7504
|
|
|
7492
7505
|
for (var j = 0; j < domain.length; j++) {
|
|
7493
|
-
var breakA =
|
|
7506
|
+
var breakA = _this44[xAxis](domain[j]) - width / 2;
|
|
7494
7507
|
var breakB = breakA + width;
|
|
7495
7508
|
|
|
7496
7509
|
if (input > breakA && input <= breakB) {
|
|
@@ -7590,10 +7603,10 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7590
7603
|
}, {
|
|
7591
7604
|
key: "handleEventMouseMove",
|
|
7592
7605
|
value: function handleEventMouseMove(event, d) {
|
|
7593
|
-
var
|
|
7606
|
+
var _this45 = this;
|
|
7594
7607
|
|
|
7595
7608
|
var bisectDate = d3.bisector(function (d) {
|
|
7596
|
-
return
|
|
7609
|
+
return _this45.parseX(d.x.value);
|
|
7597
7610
|
}).left;
|
|
7598
7611
|
|
|
7599
7612
|
if (this.options.showTrackingLine === true && d3.pointer(event)) {
|
|
@@ -7632,8 +7645,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7632
7645
|
}
|
|
7633
7646
|
|
|
7634
7647
|
this.options.data.series.forEach(function (s) {
|
|
7635
|
-
if (
|
|
7636
|
-
xPoint =
|
|
7648
|
+
if (_this45.options.data[xData].scale !== 'Time') {
|
|
7649
|
+
xPoint = _this45[xAxis](_this45.parseX(xLabel));
|
|
7637
7650
|
s.data.forEach(function (d) {
|
|
7638
7651
|
if (d.x.value === xLabel) {
|
|
7639
7652
|
if (!tooltipTitle) {
|
|
@@ -7652,13 +7665,13 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7652
7665
|
var pointA = s.data[index - 1];
|
|
7653
7666
|
var pointB = s.data[index];
|
|
7654
7667
|
|
|
7655
|
-
if (
|
|
7668
|
+
if (_this45.options.orientation === 'horizontal') {
|
|
7656
7669
|
pointA = _toConsumableArray(s.data).reverse()[index - 1];
|
|
7657
7670
|
pointB = _toConsumableArray(s.data).reverse()[index];
|
|
7658
7671
|
}
|
|
7659
7672
|
|
|
7660
7673
|
if (pointA && !pointB) {
|
|
7661
|
-
xPoint =
|
|
7674
|
+
xPoint = _this45[xAxis](_this45.parseX(pointA.x.value));
|
|
7662
7675
|
tooltipTitle = pointA.x.value;
|
|
7663
7676
|
|
|
7664
7677
|
if (!pointA.y.color) {
|
|
@@ -7668,12 +7681,12 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7668
7681
|
tooltipData.push(pointA.y);
|
|
7669
7682
|
|
|
7670
7683
|
if (typeof pointA.x.value.getTime !== 'undefined') {
|
|
7671
|
-
tooltipTitle = d3.timeFormat(
|
|
7684
|
+
tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointA.x.value);
|
|
7672
7685
|
}
|
|
7673
7686
|
}
|
|
7674
7687
|
|
|
7675
7688
|
if (pointB && !pointA) {
|
|
7676
|
-
xPoint =
|
|
7689
|
+
xPoint = _this45[xAxis](_this45.parseX(pointB.x.value));
|
|
7677
7690
|
tooltipTitle = pointB.x.value;
|
|
7678
7691
|
|
|
7679
7692
|
if (!pointB.y.color) {
|
|
@@ -7683,14 +7696,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7683
7696
|
tooltipData.push(pointB.y);
|
|
7684
7697
|
|
|
7685
7698
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7686
|
-
tooltipTitle = d3.timeFormat(
|
|
7699
|
+
tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7687
7700
|
}
|
|
7688
7701
|
}
|
|
7689
7702
|
|
|
7690
7703
|
if (pointA && pointB) {
|
|
7691
|
-
var d0 =
|
|
7704
|
+
var d0 = _this45[xAxis](_this45.parseX(pointA.x.value));
|
|
7692
7705
|
|
|
7693
|
-
var d1 =
|
|
7706
|
+
var d1 = _this45[xAxis](_this45.parseX(pointB.x.value));
|
|
7694
7707
|
|
|
7695
7708
|
var mid = Math.abs(d0 - d1) / 2;
|
|
7696
7709
|
|
|
@@ -7699,7 +7712,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7699
7712
|
tooltipTitle = pointB.x.value;
|
|
7700
7713
|
|
|
7701
7714
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7702
|
-
tooltipTitle = d3.timeFormat(
|
|
7715
|
+
tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7703
7716
|
}
|
|
7704
7717
|
|
|
7705
7718
|
if (!pointB.y.color) {
|
|
@@ -7712,7 +7725,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7712
7725
|
tooltipTitle = pointA.x.value;
|
|
7713
7726
|
|
|
7714
7727
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7715
|
-
tooltipTitle = d3.timeFormat(
|
|
7728
|
+
tooltipTitle = d3.timeFormat(_this45.options.dateFormat || _this45.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7716
7729
|
}
|
|
7717
7730
|
|
|
7718
7731
|
if (!pointA.y.color) {
|
|
@@ -7826,7 +7839,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7826
7839
|
}, {
|
|
7827
7840
|
key: "render",
|
|
7828
7841
|
value: function render(options) {
|
|
7829
|
-
var
|
|
7842
|
+
var _this46 = this;
|
|
7830
7843
|
|
|
7831
7844
|
/* global d3 options WebsyUtils */
|
|
7832
7845
|
if (typeof options !== 'undefined') {
|
|
@@ -7895,7 +7908,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7895
7908
|
var legendData = this.options.data.series.map(function (s, i) {
|
|
7896
7909
|
return {
|
|
7897
7910
|
value: s.label || s.key,
|
|
7898
|
-
color: s.color ||
|
|
7911
|
+
color: s.color || _this46.options.colors[i % _this46.options.colors.length]
|
|
7899
7912
|
};
|
|
7900
7913
|
});
|
|
7901
7914
|
|
|
@@ -8177,7 +8190,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8177
8190
|
|
|
8178
8191
|
if (this.options.data.bottom.formatter) {
|
|
8179
8192
|
bAxisFunc.tickFormat(function (d) {
|
|
8180
|
-
return
|
|
8193
|
+
return _this46.options.data.bottom.formatter(d);
|
|
8181
8194
|
});
|
|
8182
8195
|
}
|
|
8183
8196
|
|
|
@@ -8203,8 +8216,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8203
8216
|
|
|
8204
8217
|
if (this.options.margin.axisLeft > 0) {
|
|
8205
8218
|
this.leftAxisLayer.call(d3.axisLeft(this.leftAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
8206
|
-
if (
|
|
8207
|
-
d =
|
|
8219
|
+
if (_this46.options.data.left.formatter) {
|
|
8220
|
+
d = _this46.options.data.left.formatter(d);
|
|
8208
8221
|
}
|
|
8209
8222
|
|
|
8210
8223
|
return d;
|
|
@@ -8241,8 +8254,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8241
8254
|
|
|
8242
8255
|
if (this.options.margin.axisRight > 0 && (this.options.data.right.min !== 0 || this.options.data.right.max !== 0)) {
|
|
8243
8256
|
this.rightAxisLayer.call(d3.axisRight(this.rightAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
8244
|
-
if (
|
|
8245
|
-
d =
|
|
8257
|
+
if (_this46.options.data.right.formatter) {
|
|
8258
|
+
d = _this46.options.data.right.formatter(d);
|
|
8246
8259
|
}
|
|
8247
8260
|
|
|
8248
8261
|
return d;
|
|
@@ -8281,18 +8294,18 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8281
8294
|
this.renderedKeys = {};
|
|
8282
8295
|
this.options.data.series.forEach(function (series, index) {
|
|
8283
8296
|
if (!series.key) {
|
|
8284
|
-
series.key =
|
|
8297
|
+
series.key = _this46.createIdentity();
|
|
8285
8298
|
}
|
|
8286
8299
|
|
|
8287
8300
|
if (!series.color) {
|
|
8288
|
-
series.color =
|
|
8301
|
+
series.color = _this46.options.colors[index % _this46.options.colors.length];
|
|
8289
8302
|
}
|
|
8290
8303
|
|
|
8291
|
-
|
|
8304
|
+
_this46["render".concat(series.type || 'bar')](series, index);
|
|
8292
8305
|
|
|
8293
|
-
|
|
8306
|
+
_this46.renderLabels(series, index);
|
|
8294
8307
|
|
|
8295
|
-
|
|
8308
|
+
_this46.renderedKeys[series.key] = series.type;
|
|
8296
8309
|
});
|
|
8297
8310
|
}
|
|
8298
8311
|
}
|
|
@@ -8300,17 +8313,17 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8300
8313
|
}, {
|
|
8301
8314
|
key: "renderarea",
|
|
8302
8315
|
value: function renderarea(series, index) {
|
|
8303
|
-
var
|
|
8316
|
+
var _this47 = this;
|
|
8304
8317
|
|
|
8305
8318
|
/* global d3 series index */
|
|
8306
8319
|
var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
|
|
8307
8320
|
return d3.area().x(function (d) {
|
|
8308
|
-
return
|
|
8321
|
+
return _this47[xAxis](_this47.parseX(d.x.value));
|
|
8309
8322
|
}).y0(function (d) {
|
|
8310
|
-
return
|
|
8323
|
+
return _this47[yAxis](0);
|
|
8311
8324
|
}).y1(function (d) {
|
|
8312
|
-
return
|
|
8313
|
-
}).curve(d3[curveStyle ||
|
|
8325
|
+
return _this47[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
|
|
8326
|
+
}).curve(d3[curveStyle || _this47.options.curveStyle]);
|
|
8314
8327
|
};
|
|
8315
8328
|
|
|
8316
8329
|
var xAxis = 'bottomAxis';
|
|
@@ -8419,7 +8432,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8419
8432
|
}
|
|
8420
8433
|
}
|
|
8421
8434
|
|
|
8422
|
-
bars.exit().transition(this.transition).style('
|
|
8435
|
+
bars.exit().transition(this.transition).style('fill-opacity', 1e-6).remove();
|
|
8423
8436
|
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) {
|
|
8424
8437
|
return d.y.color || d.color || series.color;
|
|
8425
8438
|
});
|
|
@@ -8430,10 +8443,16 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8430
8443
|
return "bar bar_".concat(series.key);
|
|
8431
8444
|
});
|
|
8432
8445
|
}
|
|
8446
|
+
}, {
|
|
8447
|
+
key: "removebar",
|
|
8448
|
+
value: function removebar(key) {
|
|
8449
|
+
/* global key d3 */
|
|
8450
|
+
var bars = this.barLayer.selectAll(".bar_".concat(key)).transition(this.transition).style('fill-opacity', 1e-6).remove();
|
|
8451
|
+
}
|
|
8433
8452
|
}, {
|
|
8434
8453
|
key: "renderLabels",
|
|
8435
8454
|
value: function renderLabels(series, index) {
|
|
8436
|
-
var
|
|
8455
|
+
var _this48 = this;
|
|
8437
8456
|
|
|
8438
8457
|
/* global series index d3 WebsyDesigns */
|
|
8439
8458
|
var xAxis = 'bottomAxis';
|
|
@@ -8452,11 +8471,11 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8452
8471
|
var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
|
|
8453
8472
|
labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
|
|
8454
8473
|
labels.attr('x', function (d) {
|
|
8455
|
-
return getLabelX.call(
|
|
8474
|
+
return getLabelX.call(_this48, d, series.labelPosition);
|
|
8456
8475
|
}).attr('y', function (d) {
|
|
8457
|
-
return getLabelY.call(
|
|
8476
|
+
return getLabelY.call(_this48, d, series.labelPosition);
|
|
8458
8477
|
}).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
|
|
8459
|
-
return
|
|
8478
|
+
return _this48.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
8460
8479
|
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
|
|
8461
8480
|
return d.y.label || d.y.value;
|
|
8462
8481
|
}).each(function (d, i) {
|
|
@@ -8481,11 +8500,11 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8481
8500
|
}
|
|
8482
8501
|
});
|
|
8483
8502
|
labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', function (d) {
|
|
8484
|
-
return getLabelX.call(
|
|
8503
|
+
return getLabelX.call(_this48, d, series.labelPosition);
|
|
8485
8504
|
}).attr('y', function (d) {
|
|
8486
|
-
return getLabelY.call(
|
|
8505
|
+
return getLabelY.call(_this48, d, series.labelPosition);
|
|
8487
8506
|
}).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
|
|
8488
|
-
return
|
|
8507
|
+
return _this48.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
8489
8508
|
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).text(function (d) {
|
|
8490
8509
|
return d.y.label || d.y.value;
|
|
8491
8510
|
}).each(function (d, i) {
|
|
@@ -8542,16 +8561,16 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8542
8561
|
}, {
|
|
8543
8562
|
key: "renderline",
|
|
8544
8563
|
value: function renderline(series, index) {
|
|
8545
|
-
var
|
|
8564
|
+
var _this49 = this;
|
|
8546
8565
|
|
|
8547
8566
|
/* global series index d3 */
|
|
8548
8567
|
var drawLine = function drawLine(xAxis, yAxis, curveStyle) {
|
|
8549
8568
|
return d3.line().x(function (d) {
|
|
8550
|
-
var adjustment =
|
|
8551
|
-
return
|
|
8569
|
+
var adjustment = _this49.options.data[xAxis].scale === 'Time' ? 0 : _this49["".concat(xAxis, "Axis")].bandwidth() / 2;
|
|
8570
|
+
return _this49["".concat(xAxis, "Axis")](_this49.parseX(d.x.value)) + adjustment;
|
|
8552
8571
|
}).y(function (d) {
|
|
8553
|
-
return
|
|
8554
|
-
}).curve(d3[curveStyle ||
|
|
8572
|
+
return _this49["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
|
|
8573
|
+
}).curve(d3[curveStyle || _this49.options.curveStyle]);
|
|
8555
8574
|
};
|
|
8556
8575
|
|
|
8557
8576
|
var xAxis = 'bottom';
|
|
@@ -8595,14 +8614,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8595
8614
|
}, {
|
|
8596
8615
|
key: "rendersymbol",
|
|
8597
8616
|
value: function rendersymbol(series, index) {
|
|
8598
|
-
var
|
|
8617
|
+
var _this50 = this;
|
|
8599
8618
|
|
|
8600
8619
|
/* global d3 series index series.key */
|
|
8601
8620
|
var drawSymbol = function drawSymbol(size) {
|
|
8602
8621
|
return d3.symbol() // .type(d => {
|
|
8603
8622
|
// return d3.symbols[0]
|
|
8604
8623
|
// })
|
|
8605
|
-
.size(size ||
|
|
8624
|
+
.size(size || _this50.options.symbolSize);
|
|
8606
8625
|
};
|
|
8607
8626
|
|
|
8608
8627
|
var xAxis = 'bottomAxis';
|
|
@@ -8620,7 +8639,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8620
8639
|
symbols.attr('d', function (d) {
|
|
8621
8640
|
return drawSymbol(d.y.size || series.symbolSize)(d);
|
|
8622
8641
|
}).transition(this.transition).attr('fill', 'white').attr('stroke', series.color).attr('transform', function (d) {
|
|
8623
|
-
return "translate(".concat(
|
|
8642
|
+
return "translate(".concat(_this50[xAxis](_this50.parseX(d.x.value)), ", ").concat(_this50[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
8624
8643
|
}); // Enter
|
|
8625
8644
|
|
|
8626
8645
|
symbols.enter().append('path').attr('d', function (d) {
|
|
@@ -8629,7 +8648,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8629
8648
|
.attr('fill', 'white').attr('stroke', series.color).attr('class', function (d) {
|
|
8630
8649
|
return "symbol symbol_".concat(series.key);
|
|
8631
8650
|
}).attr('transform', function (d) {
|
|
8632
|
-
return "translate(".concat(
|
|
8651
|
+
return "translate(".concat(_this50[xAxis](_this50.parseX(d.x.value)), ", ").concat(_this50[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
8633
8652
|
});
|
|
8634
8653
|
}
|
|
8635
8654
|
}, {
|
|
@@ -8784,7 +8803,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
8784
8803
|
}, {
|
|
8785
8804
|
key: "resize",
|
|
8786
8805
|
value: function resize() {
|
|
8787
|
-
var
|
|
8806
|
+
var _this51 = this;
|
|
8788
8807
|
|
|
8789
8808
|
var el = document.getElementById(this.elementId);
|
|
8790
8809
|
|
|
@@ -8797,7 +8816,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
8797
8816
|
// }
|
|
8798
8817
|
var html = "\n <div class='text-".concat(this.options.align, "'>\n ");
|
|
8799
8818
|
html += this._data.map(function (d, i) {
|
|
8800
|
-
return
|
|
8819
|
+
return _this51.getLegendItemHTML(d);
|
|
8801
8820
|
}).join('');
|
|
8802
8821
|
html += "\n <div>\n ";
|
|
8803
8822
|
el.innerHTML = html;
|
|
@@ -8969,7 +8988,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8969
8988
|
}, {
|
|
8970
8989
|
key: "render",
|
|
8971
8990
|
value: function render() {
|
|
8972
|
-
var
|
|
8991
|
+
var _this52 = this;
|
|
8973
8992
|
|
|
8974
8993
|
var mapEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
8975
8994
|
var legendEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
@@ -8978,7 +8997,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8978
8997
|
var legendData = this.options.data.polygons.map(function (s, i) {
|
|
8979
8998
|
return {
|
|
8980
8999
|
value: s.label || s.key,
|
|
8981
|
-
color: s.color ||
|
|
9000
|
+
color: s.color || _this52.options.colors[i % _this52.options.colors.length]
|
|
8982
9001
|
};
|
|
8983
9002
|
});
|
|
8984
9003
|
var longestValue = legendData.map(function (s) {
|
|
@@ -9042,7 +9061,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
9042
9061
|
|
|
9043
9062
|
if (this.polygons) {
|
|
9044
9063
|
this.polygons.forEach(function (p) {
|
|
9045
|
-
return
|
|
9064
|
+
return _this52.map.removeLayer(p);
|
|
9046
9065
|
});
|
|
9047
9066
|
}
|
|
9048
9067
|
|
|
@@ -9100,18 +9119,18 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
9100
9119
|
}
|
|
9101
9120
|
|
|
9102
9121
|
if (!p.options.color) {
|
|
9103
|
-
p.options.color =
|
|
9122
|
+
p.options.color = _this52.options.colors[i % _this52.options.colors.length];
|
|
9104
9123
|
}
|
|
9105
9124
|
|
|
9106
9125
|
var pol = L.polygon(p.data.map(function (c) {
|
|
9107
9126
|
return c.map(function (d) {
|
|
9108
9127
|
return [d.Latitude, d.Longitude];
|
|
9109
9128
|
});
|
|
9110
|
-
}), p.options).addTo(
|
|
9129
|
+
}), p.options).addTo(_this52.map);
|
|
9111
9130
|
|
|
9112
|
-
|
|
9131
|
+
_this52.polygons.push(pol);
|
|
9113
9132
|
|
|
9114
|
-
|
|
9133
|
+
_this52.map.fitBounds(pol.getBounds());
|
|
9115
9134
|
});
|
|
9116
9135
|
} // if (this.data.markers.length > 0) {
|
|
9117
9136
|
// el.classList.remove('hidden')
|