@websy/websy-designs 1.11.0 → 1.11.1
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 +107 -26
- package/dist/websy-designs-es6.js +315 -232
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +107 -26
- package/dist/websy-designs.js +322 -239
- package/dist/websy-designs.min.css +1 -1
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
|
@@ -1989,8 +1989,9 @@ var WebsyDropdown = /*#__PURE__*/function () {
|
|
|
1989
1989
|
get: function get() {
|
|
1990
1990
|
var _this11 = this;
|
|
1991
1991
|
if (this.selectedItems && this.selectedItems.length > 0) {
|
|
1992
|
+
// return this.selectedItems.map((d, i) => this.options.items[+d])
|
|
1992
1993
|
return this.selectedItems.map(function (d, i) {
|
|
1993
|
-
return _this11.
|
|
1994
|
+
return _this11._originalData[+d];
|
|
1994
1995
|
});
|
|
1995
1996
|
}
|
|
1996
1997
|
return [];
|
|
@@ -3476,7 +3477,7 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
3476
3477
|
} else {
|
|
3477
3478
|
fileName = _this25.options.fileName || 'Export';
|
|
3478
3479
|
}
|
|
3479
|
-
msg += "download
|
|
3480
|
+
msg += "download=\"".concat(fileName.replace(/'/g, ''), ".pdf\"");
|
|
3480
3481
|
}
|
|
3481
3482
|
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this25.options.buttonText, "</button>\n </a>\n </div>\n ");
|
|
3482
3483
|
_this25.popup.show({
|
|
@@ -4156,7 +4157,11 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
4156
4157
|
}]);
|
|
4157
4158
|
return WebsyResultList;
|
|
4158
4159
|
}();
|
|
4159
|
-
/*
|
|
4160
|
+
/*
|
|
4161
|
+
global
|
|
4162
|
+
history
|
|
4163
|
+
WebsyDesigns
|
|
4164
|
+
*/
|
|
4160
4165
|
var WebsyRouter = /*#__PURE__*/function () {
|
|
4161
4166
|
function WebsyRouter(options) {
|
|
4162
4167
|
_classCallCheck(this, WebsyRouter);
|
|
@@ -4177,6 +4182,7 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4177
4182
|
persistentParameters: false,
|
|
4178
4183
|
fieldValueSeparator: ':'
|
|
4179
4184
|
};
|
|
4185
|
+
this.apiService = new WebsyDesigns.APIService('');
|
|
4180
4186
|
this.triggerIdList = [];
|
|
4181
4187
|
this.viewIdList = [];
|
|
4182
4188
|
this.previousPath = '';
|
|
@@ -4212,7 +4218,7 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4212
4218
|
value: function addGroup(group) {
|
|
4213
4219
|
var _this30 = this;
|
|
4214
4220
|
if (!this.groups[group]) {
|
|
4215
|
-
var els = document.querySelectorAll(".
|
|
4221
|
+
var els = document.querySelectorAll(".".concat(this.options.viewClass, "[data-group=\"").concat(group, "\"]"));
|
|
4216
4222
|
if (els) {
|
|
4217
4223
|
this.getClosestParent(els[0], function (parent) {
|
|
4218
4224
|
_this30.groups[group] = {
|
|
@@ -4345,9 +4351,9 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4345
4351
|
if (!this.groups) {
|
|
4346
4352
|
this.groups = {};
|
|
4347
4353
|
}
|
|
4348
|
-
var parentEl = document.querySelector(".
|
|
4354
|
+
var parentEl = document.querySelector(".".concat(this.options.viewClass, "[data-view=\"").concat(parent, "\"]"));
|
|
4349
4355
|
if (parentEl) {
|
|
4350
|
-
var els = parentEl.querySelectorAll(".
|
|
4356
|
+
var els = parentEl.querySelectorAll(".".concat(this.options.viewClass, "[data-group]"));
|
|
4351
4357
|
for (var i = 0; i < els.length; i++) {
|
|
4352
4358
|
var g = els[i].getAttribute('data-group');
|
|
4353
4359
|
var v = els[i].getAttribute('data-view');
|
|
@@ -4630,28 +4636,90 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4630
4636
|
});
|
|
4631
4637
|
}
|
|
4632
4638
|
}
|
|
4639
|
+
}, {
|
|
4640
|
+
key: "preloadView",
|
|
4641
|
+
value: function preloadView(view, callbackFn) {
|
|
4642
|
+
if (this.options.views[view].load) {
|
|
4643
|
+
this.options.views[view].load(callbackFn);
|
|
4644
|
+
}
|
|
4645
|
+
}
|
|
4646
|
+
}, {
|
|
4647
|
+
key: "initView",
|
|
4648
|
+
value: function initView(view) {
|
|
4649
|
+
var _this33 = this;
|
|
4650
|
+
return new Promise(function (resolve, reject) {
|
|
4651
|
+
if (!_this33.options.views[view]) {
|
|
4652
|
+
_this33.options.views[view] = {
|
|
4653
|
+
components: []
|
|
4654
|
+
};
|
|
4655
|
+
}
|
|
4656
|
+
if (_this33.options.views[view].ready === true) {
|
|
4657
|
+
resolve();
|
|
4658
|
+
} else if (_this33.options.views[view].template) {
|
|
4659
|
+
_this33.preloadView(view, function () {
|
|
4660
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4661
|
+
var viewEl = document.querySelector("[data-view='".concat(view, "'].").concat(_this33.options.viewClass));
|
|
4662
|
+
if (viewEl) {
|
|
4663
|
+
_this33.options.views[view].templateInstance = new WebsyDesigns.Template(viewEl, {
|
|
4664
|
+
template: _this33.options.views[view].template,
|
|
4665
|
+
data: data,
|
|
4666
|
+
readyCallbackFn: function readyCallbackFn() {
|
|
4667
|
+
_this33.options.views[view].ready = true;
|
|
4668
|
+
resolve();
|
|
4669
|
+
}
|
|
4670
|
+
});
|
|
4671
|
+
} else {
|
|
4672
|
+
console.log("No view element found for '".concat(view, "' to render template"));
|
|
4673
|
+
_this33.options.views[view].ready = true;
|
|
4674
|
+
resolve();
|
|
4675
|
+
}
|
|
4676
|
+
});
|
|
4677
|
+
} else if (_this33.options.views[view].ready !== true && _this33.options.views[view].load) {
|
|
4678
|
+
_this33.preloadView(view, function () {
|
|
4679
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
4680
|
+
_this33.options.views[view].ready = true;
|
|
4681
|
+
resolve();
|
|
4682
|
+
});
|
|
4683
|
+
} else {
|
|
4684
|
+
_this33.options.views[view].ready = true;
|
|
4685
|
+
resolve();
|
|
4686
|
+
}
|
|
4687
|
+
});
|
|
4688
|
+
}
|
|
4633
4689
|
}, {
|
|
4634
4690
|
key: "showView",
|
|
4635
4691
|
value: function showView(view, params, group) {
|
|
4692
|
+
var _this34 = this;
|
|
4636
4693
|
if (view === '/' || view === '') {
|
|
4637
4694
|
view = this.options.defaultView || '';
|
|
4638
4695
|
}
|
|
4639
|
-
this.
|
|
4640
|
-
|
|
4641
|
-
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4647
|
-
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4696
|
+
this.initView(view).then(function () {
|
|
4697
|
+
_this34.activateItem(view, _this34.options.triggerClass);
|
|
4698
|
+
_this34.activateItem(view, _this34.options.viewClass);
|
|
4699
|
+
var children = _this34.getActiveViewsFromParent(view);
|
|
4700
|
+
for (var c = 0; c < children.length; c++) {
|
|
4701
|
+
_this34.activateItem(children[c].view, _this34.options.triggerClass);
|
|
4702
|
+
_this34.activateItem(children[c].view, _this34.options.viewClass);
|
|
4703
|
+
_this34.showComponents(children[c].view);
|
|
4704
|
+
if (children[c].show) {
|
|
4705
|
+
children[c].show.call(children[c]);
|
|
4706
|
+
}
|
|
4707
|
+
_this34.publish('show', [children[c].view, null, group]);
|
|
4708
|
+
}
|
|
4709
|
+
if (_this34.previousView !== _this34.currentView || group !== 'main') {
|
|
4710
|
+
_this34.showComponents(view);
|
|
4711
|
+
if (_this34.options.views[view].show) {
|
|
4712
|
+
_this34.options.views[view].show.call(_this34.options.views[view]);
|
|
4713
|
+
}
|
|
4714
|
+
_this34.publish('show', [view, params, group]);
|
|
4715
|
+
} else if (_this34.previousView === _this34.currentView && _this34.previousParams.path !== _this34.currentParams.path) {
|
|
4716
|
+
_this34.showComponents(view);
|
|
4717
|
+
if (_this34.options.views[view].show) {
|
|
4718
|
+
_this34.options.views[view].show.call(_this34.options.views[view]);
|
|
4719
|
+
}
|
|
4720
|
+
_this34.publish('show', [view, params, group]);
|
|
4721
|
+
}
|
|
4722
|
+
});
|
|
4655
4723
|
}
|
|
4656
4724
|
}, {
|
|
4657
4725
|
key: "reloadCurrentView",
|
|
@@ -4966,7 +5034,7 @@ var Switch = /*#__PURE__*/function () {
|
|
|
4966
5034
|
/* global WebsyDesigns */
|
|
4967
5035
|
var WebsyTemplate = /*#__PURE__*/function () {
|
|
4968
5036
|
function WebsyTemplate(elementId, options) {
|
|
4969
|
-
var
|
|
5037
|
+
var _this35 = this;
|
|
4970
5038
|
_classCallCheck(this, WebsyTemplate);
|
|
4971
5039
|
var DEFAULTS = {
|
|
4972
5040
|
listeners: {
|
|
@@ -4974,7 +5042,16 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4974
5042
|
}
|
|
4975
5043
|
};
|
|
4976
5044
|
this.options = _extends({}, DEFAULTS, options);
|
|
4977
|
-
|
|
5045
|
+
if (_typeof(elementId) === 'object') {
|
|
5046
|
+
if (elementId.id) {
|
|
5047
|
+
this.elementId = elementId.id;
|
|
5048
|
+
} else {
|
|
5049
|
+
elementId.id = WebsyDesigns.Utils.createIdentity();
|
|
5050
|
+
this.elementId = elementId.id;
|
|
5051
|
+
}
|
|
5052
|
+
} else {
|
|
5053
|
+
this.elementId = elementId;
|
|
5054
|
+
}
|
|
4978
5055
|
this.templateService = new WebsyDesigns.APIService('');
|
|
4979
5056
|
if (!elementId) {
|
|
4980
5057
|
console.log('No element Id provided for Websy Template');
|
|
@@ -4986,8 +5063,8 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4986
5063
|
}
|
|
4987
5064
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
4988
5065
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
4989
|
-
|
|
4990
|
-
|
|
5066
|
+
_this35.options.template = templateString;
|
|
5067
|
+
_this35.render();
|
|
4991
5068
|
});
|
|
4992
5069
|
} else {
|
|
4993
5070
|
this.render();
|
|
@@ -4996,7 +5073,7 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4996
5073
|
_createClass(WebsyTemplate, [{
|
|
4997
5074
|
key: "buildHTML",
|
|
4998
5075
|
value: function buildHTML() {
|
|
4999
|
-
var
|
|
5076
|
+
var _this36 = this;
|
|
5000
5077
|
var html = "";
|
|
5001
5078
|
if (this.options.template) {
|
|
5002
5079
|
var template = this.options.template;
|
|
@@ -5045,14 +5122,14 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
5045
5122
|
}
|
|
5046
5123
|
}
|
|
5047
5124
|
if (polarity === true) {
|
|
5048
|
-
if (typeof
|
|
5125
|
+
if (typeof _this36.options.data[parts[0]] !== 'undefined' && _this36.options.data[parts[0]] === parts[1]) {
|
|
5049
5126
|
// remove the <if> tags
|
|
5050
5127
|
removeAll = false;
|
|
5051
5128
|
} else if (parts[0] === parts[1]) {
|
|
5052
5129
|
removeAll = false;
|
|
5053
5130
|
}
|
|
5054
5131
|
} else if (polarity === false) {
|
|
5055
|
-
if (typeof
|
|
5132
|
+
if (typeof _this36.options.data[parts[0]] !== 'undefined' && _this36.options.data[parts[0]] !== parts[1]) {
|
|
5056
5133
|
// remove the <if> tags
|
|
5057
5134
|
removeAll = false;
|
|
5058
5135
|
}
|
|
@@ -5086,6 +5163,12 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
5086
5163
|
}
|
|
5087
5164
|
return html;
|
|
5088
5165
|
}
|
|
5166
|
+
}, {
|
|
5167
|
+
key: "data",
|
|
5168
|
+
set: function set(d) {
|
|
5169
|
+
this.options.data = d;
|
|
5170
|
+
this.render();
|
|
5171
|
+
}
|
|
5089
5172
|
}, {
|
|
5090
5173
|
key: "handleClick",
|
|
5091
5174
|
value: function handleClick(event) {
|
|
@@ -5365,7 +5448,7 @@ var WebsyUtils = {
|
|
|
5365
5448
|
/* global WebsyDesigns */
|
|
5366
5449
|
var WebsyTable = /*#__PURE__*/function () {
|
|
5367
5450
|
function WebsyTable(elementId, options) {
|
|
5368
|
-
var
|
|
5451
|
+
var _this37 = this;
|
|
5369
5452
|
_classCallCheck(this, WebsyTable);
|
|
5370
5453
|
var DEFAULTS = {
|
|
5371
5454
|
pageSize: 20,
|
|
@@ -5398,8 +5481,8 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5398
5481
|
allowClear: false,
|
|
5399
5482
|
disableSearch: true,
|
|
5400
5483
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
5401
|
-
if (
|
|
5402
|
-
|
|
5484
|
+
if (_this37.options.onChangePageSize) {
|
|
5485
|
+
_this37.options.onChangePageSize(selectedItem.value);
|
|
5403
5486
|
}
|
|
5404
5487
|
}
|
|
5405
5488
|
});
|
|
@@ -5423,20 +5506,20 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5423
5506
|
}, {
|
|
5424
5507
|
key: "appendRows",
|
|
5425
5508
|
value: function appendRows(data) {
|
|
5426
|
-
var
|
|
5509
|
+
var _this38 = this;
|
|
5427
5510
|
this._isRendered = false;
|
|
5428
5511
|
this.hideError();
|
|
5429
5512
|
var bodyHTML = '';
|
|
5430
5513
|
if (data) {
|
|
5431
5514
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
5432
5515
|
return '<tr>' + r.map(function (c, i) {
|
|
5433
|
-
if (
|
|
5516
|
+
if (_this38.options.columns[i].show !== false) {
|
|
5434
5517
|
var style = '';
|
|
5435
5518
|
if (c.style) {
|
|
5436
5519
|
style += c.style;
|
|
5437
5520
|
}
|
|
5438
|
-
if (
|
|
5439
|
-
style += "width: ".concat(
|
|
5521
|
+
if (_this38.options.columns[i].width) {
|
|
5522
|
+
style += "width: ".concat(_this38.options.columns[i].width, "; ");
|
|
5440
5523
|
}
|
|
5441
5524
|
if (c.backgroundColor) {
|
|
5442
5525
|
style += "background-color: ".concat(c.backgroundColor, "; ");
|
|
@@ -5447,16 +5530,16 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5447
5530
|
if (c.color) {
|
|
5448
5531
|
style += "color: ".concat(c.color, "; ");
|
|
5449
5532
|
}
|
|
5450
|
-
if (
|
|
5451
|
-
return "\n <td \n data-row-index='".concat(
|
|
5452
|
-
} else if ((
|
|
5453
|
-
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(
|
|
5533
|
+
if (_this38.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
5534
|
+
return "\n <td \n data-row-index='".concat(_this38.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this38.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(_this38.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this38.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
|
|
5535
|
+
} else if ((_this38.options.columns[i].showAsNavigatorLink === true || _this38.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
5536
|
+
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this38.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this38.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this38.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this38.options.columns[i].linkText || c.value, "</td>\n ");
|
|
5454
5537
|
} else {
|
|
5455
5538
|
var info = c.value;
|
|
5456
|
-
if (
|
|
5539
|
+
if (_this38.options.columns[i].showAsImage === true) {
|
|
5457
5540
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
5458
5541
|
}
|
|
5459
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
5542
|
+
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this38.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this38.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 ");
|
|
5460
5543
|
}
|
|
5461
5544
|
}
|
|
5462
5545
|
}).join('') + '</tr>';
|
|
@@ -5616,7 +5699,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5616
5699
|
}, {
|
|
5617
5700
|
key: "render",
|
|
5618
5701
|
value: function render(data) {
|
|
5619
|
-
var
|
|
5702
|
+
var _this39 = this;
|
|
5620
5703
|
this._isRendered = false;
|
|
5621
5704
|
if (!this.options.columns) {
|
|
5622
5705
|
return;
|
|
@@ -5644,7 +5727,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5644
5727
|
if (c.width) {
|
|
5645
5728
|
style += "width: ".concat(c.width || 'auto', ";");
|
|
5646
5729
|
}
|
|
5647
|
-
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 ?
|
|
5730
|
+
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 ? _this39.buildSearchIcon(c.qGroupFieldDefs[0]) : '', "-->\n </div>\n </th>\n ");
|
|
5648
5731
|
}
|
|
5649
5732
|
}).join('') + '</tr>';
|
|
5650
5733
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -5662,7 +5745,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5662
5745
|
var pagingEl = document.getElementById("".concat(this.elementId, "_pageList"));
|
|
5663
5746
|
if (pagingEl) {
|
|
5664
5747
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
5665
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
5748
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this39.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
5666
5749
|
});
|
|
5667
5750
|
var startIndex = 0;
|
|
5668
5751
|
if (this.options.pageCount > 8) {
|
|
@@ -5718,7 +5801,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5718
5801
|
/* global WebsyDesigns */
|
|
5719
5802
|
var WebsyTable2 = /*#__PURE__*/function () {
|
|
5720
5803
|
function WebsyTable2(elementId, options) {
|
|
5721
|
-
var
|
|
5804
|
+
var _this40 = this;
|
|
5722
5805
|
_classCallCheck(this, WebsyTable2);
|
|
5723
5806
|
var DEFAULTS = {
|
|
5724
5807
|
pageSize: 20,
|
|
@@ -5753,8 +5836,8 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5753
5836
|
allowClear: false,
|
|
5754
5837
|
disableSearch: true,
|
|
5755
5838
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
5756
|
-
if (
|
|
5757
|
-
|
|
5839
|
+
if (_this40.options.onChangePageSize) {
|
|
5840
|
+
_this40.options.onChangePageSize(selectedItem.value);
|
|
5758
5841
|
}
|
|
5759
5842
|
}
|
|
5760
5843
|
});
|
|
@@ -5776,20 +5859,20 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5776
5859
|
_createClass(WebsyTable2, [{
|
|
5777
5860
|
key: "appendRows",
|
|
5778
5861
|
value: function appendRows(data) {
|
|
5779
|
-
var
|
|
5862
|
+
var _this41 = this;
|
|
5780
5863
|
this.hideError();
|
|
5781
5864
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
5782
5865
|
var bodyHTML = '';
|
|
5783
5866
|
if (data) {
|
|
5784
5867
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
5785
5868
|
return '<tr>' + r.map(function (c, i) {
|
|
5786
|
-
if (
|
|
5787
|
-
var style = "height: ".concat(
|
|
5869
|
+
if (_this41.options.columns[i].show !== false) {
|
|
5870
|
+
var style = "height: ".concat(_this41.options.cellSize, "px; line-height: ").concat(_this41.options.cellSize, "px;");
|
|
5788
5871
|
if (c.style) {
|
|
5789
5872
|
style += c.style;
|
|
5790
5873
|
}
|
|
5791
|
-
if (
|
|
5792
|
-
style += "width: ".concat(
|
|
5874
|
+
if (_this41.options.columns[i].width) {
|
|
5875
|
+
style += "width: ".concat(_this41.options.columns[i].width, "; ");
|
|
5793
5876
|
}
|
|
5794
5877
|
if (c.backgroundColor) {
|
|
5795
5878
|
style += "background-color: ".concat(c.backgroundColor, "; ");
|
|
@@ -5800,16 +5883,16 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5800
5883
|
if (c.color) {
|
|
5801
5884
|
style += "color: ".concat(c.color, "; ");
|
|
5802
5885
|
}
|
|
5803
|
-
if (
|
|
5804
|
-
return "\n <td \n data-row-index='".concat(
|
|
5805
|
-
} else if ((
|
|
5806
|
-
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(
|
|
5886
|
+
if (_this41.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
5887
|
+
return "\n <td \n data-row-index='".concat(_this41.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this41.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(_this41.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this41.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
|
|
5888
|
+
} else if ((_this41.options.columns[i].showAsNavigatorLink === true || _this41.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
5889
|
+
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this41.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this41.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this41.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this41.options.columns[i].linkText || c.value, "</td>\n ");
|
|
5807
5890
|
} else {
|
|
5808
5891
|
var info = c.value;
|
|
5809
|
-
if (
|
|
5892
|
+
if (_this41.options.columns[i].showAsImage === true) {
|
|
5810
5893
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
5811
5894
|
}
|
|
5812
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
5895
|
+
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this41.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this41.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 ");
|
|
5813
5896
|
}
|
|
5814
5897
|
}
|
|
5815
5898
|
}).join('') + '</tr>';
|
|
@@ -6043,7 +6126,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6043
6126
|
}, {
|
|
6044
6127
|
key: "render",
|
|
6045
6128
|
value: function render(data) {
|
|
6046
|
-
var
|
|
6129
|
+
var _this42 = this;
|
|
6047
6130
|
if (!this.options.columns) {
|
|
6048
6131
|
return;
|
|
6049
6132
|
}
|
|
@@ -6071,7 +6154,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6071
6154
|
if (c.width) {
|
|
6072
6155
|
style += "width: ".concat(c.width || 'auto', "; ");
|
|
6073
6156
|
}
|
|
6074
|
-
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 ?
|
|
6157
|
+
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 ? _this42.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
|
|
6075
6158
|
}
|
|
6076
6159
|
}).join('') + '</tr>';
|
|
6077
6160
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -6081,7 +6164,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6081
6164
|
var dropdownHTML = "";
|
|
6082
6165
|
this.options.columns.forEach(function (c, i) {
|
|
6083
6166
|
if (c.searchable && c.searchField) {
|
|
6084
|
-
dropdownHTML += "\n <div id=\"".concat(
|
|
6167
|
+
dropdownHTML += "\n <div id=\"".concat(_this42.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
|
|
6085
6168
|
}
|
|
6086
6169
|
});
|
|
6087
6170
|
dropdownEl.innerHTML = dropdownHTML;
|
|
@@ -6101,7 +6184,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6101
6184
|
var pagingEl = document.getElementById("".concat(this.elementId, "_pageList"));
|
|
6102
6185
|
if (pagingEl) {
|
|
6103
6186
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
6104
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
6187
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this42.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
6105
6188
|
});
|
|
6106
6189
|
var startIndex = 0;
|
|
6107
6190
|
if (this.options.pageCount > 8) {
|
|
@@ -6178,17 +6261,17 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6178
6261
|
}, {
|
|
6179
6262
|
key: "getColumnParameters",
|
|
6180
6263
|
value: function getColumnParameters(values) {
|
|
6181
|
-
var
|
|
6264
|
+
var _this43 = this;
|
|
6182
6265
|
var tableEl = document.getElementById("".concat(this.elementId, "_table"));
|
|
6183
6266
|
tableEl.style.tableLayout = 'auto';
|
|
6184
6267
|
tableEl.style.width = 'auto';
|
|
6185
6268
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
6186
6269
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
6187
6270
|
headEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c, i) {
|
|
6188
|
-
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 ?
|
|
6271
|
+
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 ? _this43.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
|
|
6189
6272
|
}).join('') + '</tr>';
|
|
6190
6273
|
bodyEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c) {
|
|
6191
|
-
return "\n <td \n style='height: ".concat(
|
|
6274
|
+
return "\n <td \n style='height: ".concat(_this43.options.cellSize, "px; line-height: ").concat(_this43.options.cellSize, "px; padding: 10px 5px;'\n >").concat(c.value || ' ', "</td>\n ");
|
|
6192
6275
|
}).join('') + '</tr>';
|
|
6193
6276
|
// get height of the first data cell
|
|
6194
6277
|
var cells = bodyEl.querySelectorAll("tr:first-of-type td");
|
|
@@ -6352,7 +6435,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6352
6435
|
}, {
|
|
6353
6436
|
key: "buildBodyHtml",
|
|
6354
6437
|
value: function buildBodyHtml() {
|
|
6355
|
-
var
|
|
6438
|
+
var _this44 = this;
|
|
6356
6439
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6357
6440
|
var useWidths = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
6358
6441
|
if (!this.options.columns) {
|
|
@@ -6377,7 +6460,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6377
6460
|
row.forEach(function (cell, cellIndex) {
|
|
6378
6461
|
var sizeIndex = cell.level || cellIndex;
|
|
6379
6462
|
var colIndex = cell.index || cellIndex;
|
|
6380
|
-
if (typeof sizingColumns[sizeIndex] === 'undefined' ||
|
|
6463
|
+
if (typeof sizingColumns[sizeIndex] === 'undefined' || _this44.options.columns[_this44.options.columns.length - 1][colIndex].show === false) {
|
|
6381
6464
|
return; // need to revisit this logic
|
|
6382
6465
|
}
|
|
6383
6466
|
|
|
@@ -6404,7 +6487,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6404
6487
|
style += "color: ".concat(cell.color, "; ");
|
|
6405
6488
|
}
|
|
6406
6489
|
// console.log('rowspan', cell.rowspan)
|
|
6407
|
-
bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex <
|
|
6490
|
+
bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this44.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((cell.classes || []).join(' '), " ").concat((sizingColumns[sizeIndex].classes || []).join(' '), "'\n style='").concat(style, "'\n data-info='").concat(cell.value.replace ? cell.value.replace(/'/g, '`') : cell.value, "'\n colspan='").concat(cell.colspan || 1, "'\n rowspan='").concat(cell.rowspan || 1, "'\n data-row-index='").concat(rowIndex, "'\n data-cell-index='").concat(cellIndex, "'\n data-col-index='").concat(colIndex, "'\n ");
|
|
6408
6491
|
// if (useWidths === true) {
|
|
6409
6492
|
// bodyHtml += `
|
|
6410
6493
|
// style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
|
|
@@ -6413,10 +6496,10 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6413
6496
|
// }
|
|
6414
6497
|
bodyHtml += "\n ><div \n style='".concat(divStyle, "' \n class='websy-table-cell-content'\n data-row-index='").concat(rowIndex, "'\n data-cell-index='").concat(cellIndex, "'\n data-col-index='").concat(colIndex, "'\n >");
|
|
6415
6498
|
if (cell.expandable === true) {
|
|
6416
|
-
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(
|
|
6499
|
+
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(_this44.options.plusIcon, "</i>");
|
|
6417
6500
|
}
|
|
6418
6501
|
if (cell.collapsable === true) {
|
|
6419
|
-
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(
|
|
6502
|
+
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(_this44.options.minusIcon, "</i>");
|
|
6420
6503
|
}
|
|
6421
6504
|
if (sizingColumns[sizeIndex].showAsLink === true && cell.value.trim() !== '') {
|
|
6422
6505
|
cell.value = "\n <a href=\"".concat(encodeURI(cell.value), "\" target='").concat(sizingColumns[sizeIndex].openInNewTab === true ? '_blank' : '_self', "'>").concat(cell.displayText || sizingColumns[sizeIndex].linkText || cell.value, "</a>\n ");
|
|
@@ -6437,7 +6520,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6437
6520
|
}, {
|
|
6438
6521
|
key: "buildHeaderHtml",
|
|
6439
6522
|
value: function buildHeaderHtml() {
|
|
6440
|
-
var
|
|
6523
|
+
var _this45 = this;
|
|
6441
6524
|
var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6442
6525
|
if (!this.options.columns) {
|
|
6443
6526
|
return '';
|
|
@@ -6458,7 +6541,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6458
6541
|
// // if we're calculating the size we only want to render the last row of column headers
|
|
6459
6542
|
// return
|
|
6460
6543
|
// }
|
|
6461
|
-
headerHtml += "<tr class=\"websy-table-row websy-table-header-row ".concat(rowIndex !==
|
|
6544
|
+
headerHtml += "<tr class=\"websy-table-row websy-table-header-row ".concat(rowIndex !== _this45.options.columns.length - 1 ? 'websy-table-parent-header' : '', "\">");
|
|
6462
6545
|
row.filter(function (c) {
|
|
6463
6546
|
return c.show !== false;
|
|
6464
6547
|
}).forEach(function (col, colIndex) {
|
|
@@ -6478,24 +6561,24 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6478
6561
|
if (col.style) {
|
|
6479
6562
|
style += col.style;
|
|
6480
6563
|
}
|
|
6481
|
-
headerHtml += "<td \n class='websy-table-cell ".concat(colIndex <
|
|
6564
|
+
headerHtml += "<td \n class='websy-table-cell ".concat(colIndex < _this45.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((col.classes || []).join(' '), "' \n style='").concat(style, "' \n colspan='").concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
|
|
6482
6565
|
// if (useWidths === true && rowIndex === this.options.columns.length - 1) {
|
|
6483
6566
|
// headerHtml += `
|
|
6484
6567
|
// style='width: ${col.width || col.actualWidth}px'
|
|
6485
6568
|
// width='${col.width || col.actualWidth}'
|
|
6486
6569
|
// `
|
|
6487
6570
|
// }
|
|
6488
|
-
headerHtml += ">\n <div \n style='".concat(divStyle, "'\n data-col-index=\"").concat(colIndex, "\"\n class='").concat(['asc', 'desc'].indexOf(col.sort) !== -1 ? 'sortable-column' : '', "'\n >\n ").concat(col.name).concat(col.activeSort ?
|
|
6571
|
+
headerHtml += ">\n <div \n style='".concat(divStyle, "'\n data-col-index=\"").concat(colIndex, "\"\n class='").concat(['asc', 'desc'].indexOf(col.sort) !== -1 ? 'sortable-column' : '', "'\n >\n ").concat(col.name).concat(col.activeSort ? _this45.buildSortIcon(col.sort, colIndex) : '').concat(col.searchable === true ? _this45.buildSearchIcon(col, colIndex) : '', "\n </div>\n </td>");
|
|
6489
6572
|
});
|
|
6490
6573
|
headerHtml += "</tr>";
|
|
6491
6574
|
});
|
|
6492
6575
|
var dropdownEl = document.getElementById("".concat(this.elementId, "_dropdownContainer"));
|
|
6493
6576
|
this.options.columns[this.options.columns.length - 1].forEach(function (c, i) {
|
|
6494
6577
|
if (c.searchable && c.isExternalSearch === true) {
|
|
6495
|
-
var testEl = document.getElementById("".concat(
|
|
6578
|
+
var testEl = document.getElementById("".concat(_this45.elementId, "_columnSearch_").concat(c.dimId || i));
|
|
6496
6579
|
if (!testEl) {
|
|
6497
6580
|
var newE = document.createElement('div');
|
|
6498
|
-
newE.id = "".concat(
|
|
6581
|
+
newE.id = "".concat(_this45.elementId, "_columnSearch_").concat(c.dimId || i);
|
|
6499
6582
|
newE.className = 'websy-modal-dropdown';
|
|
6500
6583
|
dropdownEl.appendChild(newE);
|
|
6501
6584
|
}
|
|
@@ -6518,7 +6601,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6518
6601
|
}, {
|
|
6519
6602
|
key: "buildTotalHtml",
|
|
6520
6603
|
value: function buildTotalHtml() {
|
|
6521
|
-
var
|
|
6604
|
+
var _this46 = this;
|
|
6522
6605
|
var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6523
6606
|
if (!this.options.totals) {
|
|
6524
6607
|
return '';
|
|
@@ -6534,7 +6617,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6534
6617
|
|
|
6535
6618
|
totalHtml += "<td \n class='websy-table-cell ".concat((col.classes || []).join(' '), "'\n colspan='").concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
|
|
6536
6619
|
if (useWidths === true) {
|
|
6537
|
-
totalHtml += "\n style='width: ".concat(
|
|
6620
|
+
totalHtml += "\n style='width: ".concat(_this46.options.columns[_this46.options.columns.length - 1][colIndex].width || _this46.options.columns[_this46.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
|
|
6538
6621
|
}
|
|
6539
6622
|
totalHtml += " \n >\n ".concat(col.value, "\n </td>");
|
|
6540
6623
|
});
|
|
@@ -6544,7 +6627,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6544
6627
|
}, {
|
|
6545
6628
|
key: "calculateSizes",
|
|
6546
6629
|
value: function calculateSizes() {
|
|
6547
|
-
var
|
|
6630
|
+
var _this47 = this;
|
|
6548
6631
|
var sample = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6549
6632
|
var totalRowCount = arguments.length > 1 ? arguments[1] : undefined;
|
|
6550
6633
|
var totalColumnCount = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -6588,7 +6671,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6588
6671
|
rows.forEach(function (row, rowIndex) {
|
|
6589
6672
|
Array.from(row.children).forEach(function (col, colIndex) {
|
|
6590
6673
|
var colSize = col.getBoundingClientRect();
|
|
6591
|
-
|
|
6674
|
+
_this47.sizes.cellHeight = colSize.height;
|
|
6592
6675
|
if (columnsForSizing[colIndex]) {
|
|
6593
6676
|
if (!columnsForSizing[colIndex].actualWidth) {
|
|
6594
6677
|
columnsForSizing[colIndex].potentialWidth = 0;
|
|
@@ -6600,7 +6683,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6600
6683
|
// columnsForSizing[colIndex].actualWidth = columnsForSizing[colIndex].width
|
|
6601
6684
|
// }
|
|
6602
6685
|
columnsForSizing[colIndex].cellHeight = colSize.height;
|
|
6603
|
-
if (colIndex >=
|
|
6686
|
+
if (colIndex >= _this47.pinnedColumns) {
|
|
6604
6687
|
firstNonPinnedColumnWidth = columnsForSizing[colIndex].actualWidth;
|
|
6605
6688
|
}
|
|
6606
6689
|
}
|
|
@@ -6615,7 +6698,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6615
6698
|
return a + (b.width || b.actualWidth);
|
|
6616
6699
|
}, 0);
|
|
6617
6700
|
this.sizes.totalNonPinnedWidth = columnsForSizing.filter(function (c, i) {
|
|
6618
|
-
return i >=
|
|
6701
|
+
return i >= _this47.pinnedColumns;
|
|
6619
6702
|
}).reduce(function (a, b) {
|
|
6620
6703
|
return a + (b.width || b.actualWidth);
|
|
6621
6704
|
}, 0);
|
|
@@ -6626,7 +6709,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6626
6709
|
var availableSpace = this.sizes.table.width - this.sizes.totalWidth;
|
|
6627
6710
|
columnsForSizing.forEach(function (c) {
|
|
6628
6711
|
c.shouldGrow = true;
|
|
6629
|
-
if (
|
|
6712
|
+
if (_this47.options.autoFitColumns === false) {
|
|
6630
6713
|
c.shouldGrow = false;
|
|
6631
6714
|
if (c.potentialWidth > c.actualWidth) {
|
|
6632
6715
|
c.shouldGrow = true;
|
|
@@ -6645,7 +6728,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6645
6728
|
// if (!c.width) {
|
|
6646
6729
|
// if (c.actualWidth < equalWidth) {
|
|
6647
6730
|
// adjust the width
|
|
6648
|
-
if (
|
|
6731
|
+
if (_this47.options.autoFitColumns === true) {
|
|
6649
6732
|
if (c.width) {
|
|
6650
6733
|
c.width += equalWidth;
|
|
6651
6734
|
}
|
|
@@ -6669,9 +6752,9 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6669
6752
|
}
|
|
6670
6753
|
// }
|
|
6671
6754
|
// }
|
|
6672
|
-
|
|
6673
|
-
if (i >
|
|
6674
|
-
|
|
6755
|
+
_this47.sizes.totalWidth += c.width || c.actualWidth;
|
|
6756
|
+
if (i > _this47.pinnedColumns) {
|
|
6757
|
+
_this47.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
|
|
6675
6758
|
}
|
|
6676
6759
|
// equalWidth = (outerSize.width - this.sizes.totalWidth) / (this.options.columns[this.options.columns.length - 1].length - (i + 1))
|
|
6677
6760
|
});
|
|
@@ -6730,7 +6813,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6730
6813
|
}, {
|
|
6731
6814
|
key: "createSample",
|
|
6732
6815
|
value: function createSample(data) {
|
|
6733
|
-
var
|
|
6816
|
+
var _this48 = this;
|
|
6734
6817
|
var output = [];
|
|
6735
6818
|
this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
|
|
6736
6819
|
if (col.maxLength) {
|
|
@@ -6740,7 +6823,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6740
6823
|
} else if (data) {
|
|
6741
6824
|
var longest = '';
|
|
6742
6825
|
for (var i = 0; i < Math.min(data.length, 1000); i++) {
|
|
6743
|
-
if (data[i].length ===
|
|
6826
|
+
if (data[i].length === _this48.options.columns[_this48.options.columns.length - 1].length) {
|
|
6744
6827
|
if (longest.length < data[i][colIndex].value.length) {
|
|
6745
6828
|
longest = data[i][colIndex].value;
|
|
6746
6829
|
}
|
|
@@ -7012,7 +7095,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7012
7095
|
}, {
|
|
7013
7096
|
key: "perpetualScroll",
|
|
7014
7097
|
value: function perpetualScroll() {
|
|
7015
|
-
var
|
|
7098
|
+
var _this49 = this;
|
|
7016
7099
|
// if the currentTouchtime and touchEndTime are more than 300ms apart then we abort the perpetual scroll
|
|
7017
7100
|
if (this.touchEndTime - this.currentTouchtime > 300) {
|
|
7018
7101
|
return;
|
|
@@ -7031,17 +7114,17 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7031
7114
|
var direction = touchDistance > 0 ? -1 : 1;
|
|
7032
7115
|
var _loop2 = function _loop2(i) {
|
|
7033
7116
|
setTimeout(function () {
|
|
7034
|
-
var delta =
|
|
7117
|
+
var delta = _this49.mouseYStart - _this49.currentClientY + _this49.sizes.cellHeight * (i + 1) * direction;
|
|
7035
7118
|
delta = Math.min(10, delta);
|
|
7036
7119
|
delta = Math.max(-10, delta);
|
|
7037
7120
|
// only run this if isPerpetual === true
|
|
7038
7121
|
// this value is reset to false on touchStart
|
|
7039
|
-
if (
|
|
7122
|
+
if (_this49.isPerpetual === true) {
|
|
7040
7123
|
// this.$scope.scrollTop += (delta / (this.$scope.layout.qHyperCube.qSize.qcy / this.$scope.rowsToLoad / (this.$scope.totalSpaceAvailable / 250)))
|
|
7041
7124
|
// this.$scope.scrollTop += (delta / (this.$scope.layout.qHyperCube.qSize.qcy / this.$scope.rowsToLoad / (this.$scope.totalSpaceAvailable / 200)))
|
|
7042
|
-
|
|
7043
|
-
if (
|
|
7044
|
-
clearTimeout(
|
|
7125
|
+
_this49.scrollY(Math.max(-5, Math.min(5, delta)));
|
|
7126
|
+
if (_this49.scrollTimeout) {
|
|
7127
|
+
clearTimeout(_this49.scrollTimeout);
|
|
7045
7128
|
}
|
|
7046
7129
|
}
|
|
7047
7130
|
}, 1000 / fps * i);
|
|
@@ -7309,7 +7392,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
7309
7392
|
/* global d3 include WebsyDesigns */
|
|
7310
7393
|
var WebsyChart = /*#__PURE__*/function () {
|
|
7311
7394
|
function WebsyChart(elementId, options) {
|
|
7312
|
-
var
|
|
7395
|
+
var _this50 = this;
|
|
7313
7396
|
_classCallCheck(this, WebsyChart);
|
|
7314
7397
|
var DEFAULTS = {
|
|
7315
7398
|
margin: {
|
|
@@ -7368,7 +7451,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7368
7451
|
this.invertOverride = function (input, input2) {
|
|
7369
7452
|
var forBrush = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
7370
7453
|
var xAxis = 'bottom';
|
|
7371
|
-
if (
|
|
7454
|
+
if (_this50.options.orientation === 'horizontal') {
|
|
7372
7455
|
xAxis = 'left';
|
|
7373
7456
|
}
|
|
7374
7457
|
if (forBrush === true) {
|
|
@@ -7376,12 +7459,12 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7376
7459
|
}
|
|
7377
7460
|
xAxis += 'Axis';
|
|
7378
7461
|
var output;
|
|
7379
|
-
var width =
|
|
7462
|
+
var width = _this50.options.data[xAxis.replace('Brush', '').replace('Axis', '')].bandWidth;
|
|
7380
7463
|
// if (this.customBottomRange) {
|
|
7381
|
-
for (var index = 0; index <
|
|
7382
|
-
if (input >
|
|
7383
|
-
if (
|
|
7384
|
-
if (input <
|
|
7464
|
+
for (var index = 0; index < _this50.customBottomRange.length; index++) {
|
|
7465
|
+
if (input > _this50.customBottomRange[index]) {
|
|
7466
|
+
if (_this50.customBottomRange[index + 1]) {
|
|
7467
|
+
if (input < _this50.customBottomRange[index + 1]) {
|
|
7385
7468
|
output = index;
|
|
7386
7469
|
break;
|
|
7387
7470
|
}
|
|
@@ -7546,9 +7629,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7546
7629
|
}, {
|
|
7547
7630
|
key: "handleEventMouseMove",
|
|
7548
7631
|
value: function handleEventMouseMove(event, d) {
|
|
7549
|
-
var
|
|
7632
|
+
var _this51 = this;
|
|
7550
7633
|
var bisectDate = d3.bisector(function (d) {
|
|
7551
|
-
return
|
|
7634
|
+
return _this51.parseX(d.x.value);
|
|
7552
7635
|
}).left;
|
|
7553
7636
|
if (this.options.showTrackingLine === true && d3.pointer(event)) {
|
|
7554
7637
|
var xAxis = 'bottomAxis';
|
|
@@ -7581,9 +7664,9 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7581
7664
|
xLabel = _toConsumableArray(this[xAxis].domain().reverse())[x0];
|
|
7582
7665
|
}
|
|
7583
7666
|
this.options.data.series.forEach(function (s) {
|
|
7584
|
-
if (
|
|
7667
|
+
if (_this51.options.data[xData].scale !== 'Time') {
|
|
7585
7668
|
// if (this.customBottomRange && this.customBottomRange.length > 0) {
|
|
7586
|
-
xPoint =
|
|
7669
|
+
xPoint = _this51.customBottomRange[x0] + (_this51.customBottomRange[x0 + 1] - _this51.customBottomRange[x0]) / 2;
|
|
7587
7670
|
// }
|
|
7588
7671
|
// else {
|
|
7589
7672
|
// xPoint = this[xAxis](this.parseX(xLabel))
|
|
@@ -7603,41 +7686,41 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7603
7686
|
var index = bisectDate(s.data, x0, 1);
|
|
7604
7687
|
var pointA = s.data[index - 1];
|
|
7605
7688
|
var pointB = s.data[index];
|
|
7606
|
-
if (
|
|
7689
|
+
if (_this51.options.orientation === 'horizontal') {
|
|
7607
7690
|
pointA = _toConsumableArray(s.data).reverse()[index - 1];
|
|
7608
7691
|
pointB = _toConsumableArray(s.data).reverse()[index];
|
|
7609
7692
|
}
|
|
7610
7693
|
if (pointA && !pointB) {
|
|
7611
|
-
xPoint =
|
|
7694
|
+
xPoint = _this51[xAxis](_this51.parseX(pointA.x.value));
|
|
7612
7695
|
tooltipTitle = pointA.x.value;
|
|
7613
7696
|
if (!pointA.y.color) {
|
|
7614
7697
|
pointA.y.color = s.color;
|
|
7615
7698
|
}
|
|
7616
7699
|
tooltipData.push(pointA);
|
|
7617
7700
|
if (typeof pointA.x.value.getTime !== 'undefined') {
|
|
7618
|
-
tooltipTitle = d3.timeFormat(
|
|
7701
|
+
tooltipTitle = d3.timeFormat(_this51.options.dateFormat || _this51.options.calculatedTimeFormatPattern)(pointA.x.value);
|
|
7619
7702
|
}
|
|
7620
7703
|
}
|
|
7621
7704
|
if (pointB && !pointA) {
|
|
7622
|
-
xPoint =
|
|
7705
|
+
xPoint = _this51[xAxis](_this51.parseX(pointB.x.value));
|
|
7623
7706
|
tooltipTitle = pointB.x.value;
|
|
7624
7707
|
if (!pointB.y.color) {
|
|
7625
7708
|
pointB.y.color = s.color;
|
|
7626
7709
|
}
|
|
7627
7710
|
tooltipData.push(pointB);
|
|
7628
7711
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7629
|
-
tooltipTitle = d3.timeFormat(
|
|
7712
|
+
tooltipTitle = d3.timeFormat(_this51.options.dateFormat || _this51.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7630
7713
|
}
|
|
7631
7714
|
}
|
|
7632
7715
|
if (pointA && pointB) {
|
|
7633
|
-
var d0 =
|
|
7634
|
-
var d1 =
|
|
7716
|
+
var d0 = _this51[xAxis](_this51.parseX(pointA.x.value));
|
|
7717
|
+
var d1 = _this51[xAxis](_this51.parseX(pointB.x.value));
|
|
7635
7718
|
var mid = Math.abs(d0 - d1) / 2;
|
|
7636
7719
|
if (d3.pointer(event)[0] - d0 >= mid) {
|
|
7637
7720
|
xPoint = d1;
|
|
7638
7721
|
tooltipTitle = pointB.x.value;
|
|
7639
7722
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7640
|
-
tooltipTitle = d3.timeFormat(
|
|
7723
|
+
tooltipTitle = d3.timeFormat(_this51.options.dateFormat || _this51.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7641
7724
|
}
|
|
7642
7725
|
if (!pointB.y.color) {
|
|
7643
7726
|
pointB.y.color = s.color;
|
|
@@ -7647,7 +7730,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7647
7730
|
xPoint = d0;
|
|
7648
7731
|
tooltipTitle = pointA.x.value;
|
|
7649
7732
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7650
|
-
tooltipTitle = d3.timeFormat(
|
|
7733
|
+
tooltipTitle = d3.timeFormat(_this51.options.dateFormat || _this51.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7651
7734
|
}
|
|
7652
7735
|
if (!pointA.y.color) {
|
|
7653
7736
|
pointA.y.color = s.color;
|
|
@@ -7773,7 +7856,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7773
7856
|
}, {
|
|
7774
7857
|
key: "render",
|
|
7775
7858
|
value: function render(options) {
|
|
7776
|
-
var
|
|
7859
|
+
var _this52 = this;
|
|
7777
7860
|
/* global d3 options WebsyUtils */
|
|
7778
7861
|
this._isRendered = false;
|
|
7779
7862
|
if (typeof options !== 'undefined') {
|
|
@@ -7842,7 +7925,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7842
7925
|
this.options.data.series.map(function (s, i) {
|
|
7843
7926
|
return {
|
|
7844
7927
|
value: s.label || s.key,
|
|
7845
|
-
color: s.color ||
|
|
7928
|
+
color: s.color || _this52.options.colors[i % _this52.options.colors.length]
|
|
7846
7929
|
};
|
|
7847
7930
|
});
|
|
7848
7931
|
}
|
|
@@ -8199,25 +8282,25 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8199
8282
|
if (this.options.data[customRangeSideLC].data && this.options.data[customRangeSideLC].data[0] && (this.options.data[customRangeSideLC].data[0].valueCount || 1) && this.options.data[customRangeSideLC].scale === 'Ordinal') {
|
|
8200
8283
|
var acc = 0;
|
|
8201
8284
|
this["custom".concat(customRangeSide, "Range")] = [0].concat(_toConsumableArray(this.options.data[customRangeSideLC].data.map(function (d, index, arr) {
|
|
8202
|
-
var adjustment =
|
|
8285
|
+
var adjustment = _this52.bandPadding * index + _this52.bandPadding;
|
|
8203
8286
|
// if (this.options.data.bottom.padding) {
|
|
8204
8287
|
// adjustment = (this.widthForCalc * this.options.data.bottom.padding) / (arr.length * 2)
|
|
8205
8288
|
// }
|
|
8206
|
-
var start =
|
|
8289
|
+
var start = _this52.widthForCalc / noOfPoints * acc;
|
|
8207
8290
|
for (var i = 0; i < (d.valueCount || 1); i++) {
|
|
8208
8291
|
var pos = i * proposedBandWidth;
|
|
8209
|
-
|
|
8292
|
+
_this52["custom".concat(customRangeSide, "DetailRange")].push(start + adjustment + pos);
|
|
8210
8293
|
}
|
|
8211
|
-
acc +=
|
|
8212
|
-
var end =
|
|
8294
|
+
acc += _this52.options.grouping !== 'stacked' && _this52.options.allowUnevenBands === true ? d.valueCount || 1 : 1;
|
|
8295
|
+
var end = _this52.widthForCalc / noOfPoints * acc;
|
|
8213
8296
|
// this.customBottomBrushRange.push((end + adjustment) * (this.plotWidth / this.widthForCalc))
|
|
8214
8297
|
return end + adjustment;
|
|
8215
8298
|
})));
|
|
8216
8299
|
acc = 0;
|
|
8217
8300
|
this["custom".concat(customRangeSide, "BrushRange")] = [0].concat(_toConsumableArray(this.options.data[customRangeSideLC].data.map(function (d, index, arr) {
|
|
8218
|
-
var adjustment =
|
|
8219
|
-
acc +=
|
|
8220
|
-
return (
|
|
8301
|
+
var adjustment = _this52.brushBandPadding * index + _this52.brushBandPadding;
|
|
8302
|
+
acc += _this52.options.grouping !== 'stacked' && _this52.options.allowUnevenBands === true ? d.valueCount || 1 : 1;
|
|
8303
|
+
return (_this52.options.orientation === 'vertical' ? _this52.plotWidth : _this52.plotHeight) / noOfPoints * acc;
|
|
8221
8304
|
})));
|
|
8222
8305
|
}
|
|
8223
8306
|
// }
|
|
@@ -8390,7 +8473,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8390
8473
|
this.bAxisFunc = d3.axisBottom(this.bottomAxis).ticks(tickDefinition);
|
|
8391
8474
|
if (this.options.data.bottom.formatter) {
|
|
8392
8475
|
this.bAxisFunc.tickFormat(function (d) {
|
|
8393
|
-
return
|
|
8476
|
+
return _this52.options.data.bottom.formatter(d);
|
|
8394
8477
|
});
|
|
8395
8478
|
}
|
|
8396
8479
|
this.bottomAxisLayer.call(this.bAxisFunc);
|
|
@@ -8400,7 +8483,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8400
8483
|
}
|
|
8401
8484
|
if (this.customBottomRange.length > 0) {
|
|
8402
8485
|
this.bottomAxisLayer.selectAll('g').attr('transform', function (d, i) {
|
|
8403
|
-
return "translate(".concat(
|
|
8486
|
+
return "translate(".concat(_this52.customBottomRange[i] + (_this52.customBottomRange[i + 1] - _this52.customBottomRange[i]) / 2, ", 0)");
|
|
8404
8487
|
});
|
|
8405
8488
|
}
|
|
8406
8489
|
}
|
|
@@ -8419,14 +8502,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8419
8502
|
}
|
|
8420
8503
|
if (this.options.margin.axisLeft > 0) {
|
|
8421
8504
|
this.leftAxisLayer.call(d3.axisLeft(this.leftAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
8422
|
-
if (
|
|
8423
|
-
d =
|
|
8505
|
+
if (_this52.options.data.left.formatter) {
|
|
8506
|
+
d = _this52.options.data.left.formatter(d);
|
|
8424
8507
|
}
|
|
8425
8508
|
return d;
|
|
8426
8509
|
}));
|
|
8427
8510
|
if (this.customLeftRange.length > 0) {
|
|
8428
8511
|
this.leftAxisLayer.selectAll('g').attr('transform', function (d, i) {
|
|
8429
|
-
return "translate(0, ".concat(
|
|
8512
|
+
return "translate(0, ".concat(_this52.customLeftRange[i] + (_this52.customLeftRange[i + 1] - _this52.customLeftRange[i]) / 2, ")");
|
|
8430
8513
|
});
|
|
8431
8514
|
}
|
|
8432
8515
|
}
|
|
@@ -8454,8 +8537,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8454
8537
|
}
|
|
8455
8538
|
if (this.options.margin.axisRight > 0 && (this.options.data.right.min !== 0 || this.options.data.right.max !== 0)) {
|
|
8456
8539
|
this.rightAxisLayer.call(d3.axisRight(this.rightAxis).ticks(this.options.data.right.ticks || 5).tickFormat(function (d) {
|
|
8457
|
-
if (
|
|
8458
|
-
d =
|
|
8540
|
+
if (_this52.options.data.right.formatter) {
|
|
8541
|
+
d = _this52.options.data.right.formatter(d);
|
|
8459
8542
|
}
|
|
8460
8543
|
return d;
|
|
8461
8544
|
}));
|
|
@@ -8495,25 +8578,25 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8495
8578
|
}, {
|
|
8496
8579
|
key: "renderComponents",
|
|
8497
8580
|
value: function renderComponents() {
|
|
8498
|
-
var
|
|
8581
|
+
var _this53 = this;
|
|
8499
8582
|
// Draw the series data
|
|
8500
8583
|
this.renderedKeys = {};
|
|
8501
8584
|
this.options.data.series.forEach(function (series, index) {
|
|
8502
8585
|
if (!series.key) {
|
|
8503
|
-
series.key =
|
|
8586
|
+
series.key = _this53.createIdentity();
|
|
8504
8587
|
}
|
|
8505
8588
|
if (!series.color) {
|
|
8506
|
-
series.color =
|
|
8589
|
+
series.color = _this53.options.colors[index % _this53.options.colors.length];
|
|
8507
8590
|
}
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
|
|
8591
|
+
_this53["render".concat(series.type || 'bar')](series, index);
|
|
8592
|
+
_this53.renderLabels(series, index);
|
|
8593
|
+
_this53.renderedKeys[series.key] = series.type;
|
|
8511
8594
|
});
|
|
8512
8595
|
this.refLineLayer.selectAll('.reference-line').remove();
|
|
8513
8596
|
this.refLineLayer.selectAll('.reference-line-label').remove();
|
|
8514
8597
|
if (this.options.refLines && this.options.refLines.length > 0) {
|
|
8515
8598
|
this.options.refLines.forEach(function (l) {
|
|
8516
|
-
return
|
|
8599
|
+
return _this53.renderRefLine(l);
|
|
8517
8600
|
});
|
|
8518
8601
|
}
|
|
8519
8602
|
this._isRendered = true;
|
|
@@ -8521,25 +8604,25 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8521
8604
|
}, {
|
|
8522
8605
|
key: "renderarea",
|
|
8523
8606
|
value: function renderarea(series, index) {
|
|
8524
|
-
var
|
|
8607
|
+
var _this54 = this;
|
|
8525
8608
|
/* global d3 series index */
|
|
8526
8609
|
var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
|
|
8527
8610
|
return d3.area().x(function (d) {
|
|
8528
|
-
if (
|
|
8529
|
-
return
|
|
8611
|
+
if (_this54.options.data[xAxis].scale === 'Time') {
|
|
8612
|
+
return _this54["".concat(xAxis, "Axis")](_this54.parseX(d.x.value));
|
|
8530
8613
|
} else {
|
|
8531
|
-
var xIndex =
|
|
8532
|
-
var xPos =
|
|
8533
|
-
if (
|
|
8534
|
-
xPos = xPos + (
|
|
8614
|
+
var xIndex = _this54[xAxis + 'Axis'].domain().indexOf(d.x.value);
|
|
8615
|
+
var xPos = _this54["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
|
|
8616
|
+
if (_this54["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
|
|
8617
|
+
xPos = xPos + (_this54["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
|
|
8535
8618
|
}
|
|
8536
8619
|
return xPos;
|
|
8537
8620
|
}
|
|
8538
8621
|
}).y0(function (d) {
|
|
8539
|
-
return
|
|
8622
|
+
return _this54["".concat(yAxis, "Axis")](0);
|
|
8540
8623
|
}).y1(function (d) {
|
|
8541
|
-
return
|
|
8542
|
-
}).curve(d3[curveStyle ||
|
|
8624
|
+
return _this54["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
|
|
8625
|
+
}).curve(d3[curveStyle || _this54.options.curveStyle]);
|
|
8543
8626
|
};
|
|
8544
8627
|
var xAxis = 'bottom';
|
|
8545
8628
|
var yAxis = series.axis === 'secondary' ? 'right' : 'left';
|
|
@@ -8579,7 +8662,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8579
8662
|
}, {
|
|
8580
8663
|
key: "renderbar",
|
|
8581
8664
|
value: function renderbar(series, index) {
|
|
8582
|
-
var
|
|
8665
|
+
var _this55 = this;
|
|
8583
8666
|
/* global series index d3 */
|
|
8584
8667
|
var xAxis = 'bottom';
|
|
8585
8668
|
var yAxis = 'left';
|
|
@@ -8746,26 +8829,26 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8746
8829
|
}
|
|
8747
8830
|
bars.exit().transition(this.transition).style('fill-opacity', 1e-6).remove();
|
|
8748
8831
|
bars.attr('width', function (d, i) {
|
|
8749
|
-
return Math.abs(getBarWidth.call(
|
|
8832
|
+
return Math.abs(getBarWidth.call(_this55, d, i, yAxis, xAxis));
|
|
8750
8833
|
}).attr('height', function (d, i) {
|
|
8751
|
-
return getBarHeight.call(
|
|
8834
|
+
return getBarHeight.call(_this55, d, i, yAxis, xAxis);
|
|
8752
8835
|
}).attr('x', function (d, i) {
|
|
8753
|
-
return getBarX.call(
|
|
8836
|
+
return getBarX.call(_this55, d, i, yAxis, xAxis);
|
|
8754
8837
|
}).attr('y', function (d, i) {
|
|
8755
|
-
return getBarY.call(
|
|
8838
|
+
return getBarY.call(_this55, d, i, yAxis, xAxis);
|
|
8756
8839
|
})
|
|
8757
8840
|
// .transition(this.transition)
|
|
8758
8841
|
.attr('fill', function (d) {
|
|
8759
8842
|
return d.y.color || d.color || series.color;
|
|
8760
8843
|
});
|
|
8761
8844
|
bars.enter().append('rect').attr('width', function (d, i) {
|
|
8762
|
-
return Math.abs(getBarWidth.call(
|
|
8845
|
+
return Math.abs(getBarWidth.call(_this55, d, i, yAxis, xAxis));
|
|
8763
8846
|
}).attr('height', function (d, i) {
|
|
8764
|
-
return getBarHeight.call(
|
|
8847
|
+
return getBarHeight.call(_this55, d, i, yAxis, xAxis);
|
|
8765
8848
|
}).attr('x', function (d, i) {
|
|
8766
|
-
return getBarX.call(
|
|
8849
|
+
return getBarX.call(_this55, d, i, yAxis, xAxis);
|
|
8767
8850
|
}).attr('y', function (d, i) {
|
|
8768
|
-
return getBarY.call(
|
|
8851
|
+
return getBarY.call(_this55, d, i, yAxis, xAxis);
|
|
8769
8852
|
})
|
|
8770
8853
|
// .transition(this.transition)
|
|
8771
8854
|
.attr('fill', function (d) {
|
|
@@ -8777,26 +8860,26 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8777
8860
|
this.brushBarsInitialized[series.key] = true;
|
|
8778
8861
|
brushBars.exit().transition(this.transition).style('fill-opacity', 1e-6).remove();
|
|
8779
8862
|
brushBars.attr('width', function (d, i) {
|
|
8780
|
-
return Math.abs(getBarWidth.call(
|
|
8863
|
+
return Math.abs(getBarWidth.call(_this55, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush")));
|
|
8781
8864
|
}).attr('height', function (d, i) {
|
|
8782
|
-
return getBarHeight.call(
|
|
8865
|
+
return getBarHeight.call(_this55, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
|
|
8783
8866
|
}).attr('x', function (d, i) {
|
|
8784
|
-
return getBarX.call(
|
|
8867
|
+
return getBarX.call(_this55, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
|
|
8785
8868
|
}).attr('y', function (d, i) {
|
|
8786
|
-
return getBarY.call(
|
|
8869
|
+
return getBarY.call(_this55, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
|
|
8787
8870
|
})
|
|
8788
8871
|
// .transition(this.transition)
|
|
8789
8872
|
.attr('fill', function (d) {
|
|
8790
8873
|
return d.y.color || d.color || series.color;
|
|
8791
8874
|
});
|
|
8792
8875
|
brushBars.enter().append('rect').attr('width', function (d, i) {
|
|
8793
|
-
return Math.abs(getBarWidth.call(
|
|
8876
|
+
return Math.abs(getBarWidth.call(_this55, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush")));
|
|
8794
8877
|
}).attr('height', function (d, i) {
|
|
8795
|
-
return getBarHeight.call(
|
|
8878
|
+
return getBarHeight.call(_this55, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
|
|
8796
8879
|
}).attr('x', function (d, i) {
|
|
8797
|
-
return getBarX.call(
|
|
8880
|
+
return getBarX.call(_this55, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
|
|
8798
8881
|
}).attr('y', function (d, i) {
|
|
8799
|
-
return getBarY.call(
|
|
8882
|
+
return getBarY.call(_this55, d, i, "".concat(yAxis, "Brush"), "".concat(xAxis, "Brush"));
|
|
8800
8883
|
})
|
|
8801
8884
|
// .transition(this.transition)
|
|
8802
8885
|
.attr('fill', function (d) {
|
|
@@ -8817,7 +8900,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8817
8900
|
}, {
|
|
8818
8901
|
key: "renderLabels",
|
|
8819
8902
|
value: function renderLabels(series, index) {
|
|
8820
|
-
var
|
|
8903
|
+
var _this56 = this;
|
|
8821
8904
|
/* global series index d3 WebsyDesigns */
|
|
8822
8905
|
var xAxis = 'bottom';
|
|
8823
8906
|
var yAxis = 'left';
|
|
@@ -8833,14 +8916,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8833
8916
|
var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
|
|
8834
8917
|
labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
|
|
8835
8918
|
labels.attr('x', function (d) {
|
|
8836
|
-
return getLabelX.call(
|
|
8919
|
+
return getLabelX.call(_this56, d, series.labelPosition);
|
|
8837
8920
|
}).attr('y', function (d) {
|
|
8838
|
-
return getLabelY.call(
|
|
8921
|
+
return getLabelY.call(_this56, d, series.labelPosition);
|
|
8839
8922
|
}).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
|
|
8840
|
-
if (
|
|
8923
|
+
if (_this56.options.grouping === 'stacked' && d.y.value === 0) {
|
|
8841
8924
|
return 'transparent';
|
|
8842
8925
|
}
|
|
8843
|
-
return
|
|
8926
|
+
return _this56.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
8844
8927
|
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
|
|
8845
8928
|
return d.y.label || d.y.value;
|
|
8846
8929
|
}).each(function (d, i) {
|
|
@@ -8874,14 +8957,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8874
8957
|
}
|
|
8875
8958
|
});
|
|
8876
8959
|
labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', function (d) {
|
|
8877
|
-
return getLabelX.call(
|
|
8960
|
+
return getLabelX.call(_this56, d, series.labelPosition);
|
|
8878
8961
|
}).attr('y', function (d) {
|
|
8879
|
-
return getLabelY.call(
|
|
8962
|
+
return getLabelY.call(_this56, d, series.labelPosition);
|
|
8880
8963
|
}).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
|
|
8881
|
-
if (
|
|
8964
|
+
if (_this56.options.grouping === 'stacked' && d.y.value === 0) {
|
|
8882
8965
|
return 'transparent';
|
|
8883
8966
|
}
|
|
8884
|
-
return
|
|
8967
|
+
return _this56.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
8885
8968
|
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).text(function (d) {
|
|
8886
8969
|
return d.y.label || d.y.value;
|
|
8887
8970
|
}).each(function (d, i) {
|
|
@@ -8959,32 +9042,32 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8959
9042
|
}, {
|
|
8960
9043
|
key: "renderline",
|
|
8961
9044
|
value: function renderline(series, index) {
|
|
8962
|
-
var
|
|
9045
|
+
var _this57 = this;
|
|
8963
9046
|
/* global series index d3 */
|
|
8964
9047
|
var drawLine = function drawLine(xAxis, yAxis, curveStyle) {
|
|
8965
9048
|
return d3.line().x(function (d) {
|
|
8966
|
-
if (
|
|
8967
|
-
return
|
|
9049
|
+
if (_this57.options.orientation === 'horizontal') {
|
|
9050
|
+
return _this57["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
|
|
8968
9051
|
} else {
|
|
8969
|
-
if (
|
|
8970
|
-
return
|
|
9052
|
+
if (_this57.options.data[xAxis].scale === 'Time') {
|
|
9053
|
+
return _this57["".concat(xAxis, "Axis")](_this57.parseX(d.x.value));
|
|
8971
9054
|
} else {
|
|
8972
|
-
var xIndex =
|
|
8973
|
-
var xPos =
|
|
8974
|
-
if (
|
|
8975
|
-
xPos = xPos + (
|
|
9055
|
+
var xIndex = _this57[xAxis + 'Axis'].domain().indexOf(d.x.value);
|
|
9056
|
+
var xPos = _this57["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
|
|
9057
|
+
if (_this57["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
|
|
9058
|
+
xPos = xPos + (_this57["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
|
|
8976
9059
|
}
|
|
8977
9060
|
return xPos;
|
|
8978
9061
|
}
|
|
8979
9062
|
}
|
|
8980
9063
|
}).y(function (d) {
|
|
8981
|
-
if (
|
|
8982
|
-
var adjustment =
|
|
8983
|
-
return
|
|
9064
|
+
if (_this57.options.orientation === 'horizontal') {
|
|
9065
|
+
var adjustment = _this57.options.data[xAxis.replace('Brush', '')].scale === 'Time' ? 0 : _this57.options.data[xAxis].bandWidth / 2;
|
|
9066
|
+
return _this57["".concat(xAxis, "Axis")](_this57.parseX(d.x.value)) + adjustment;
|
|
8984
9067
|
} else {
|
|
8985
|
-
return
|
|
9068
|
+
return _this57["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
|
|
8986
9069
|
}
|
|
8987
|
-
}).curve(d3[curveStyle ||
|
|
9070
|
+
}).curve(d3[curveStyle || _this57.options.curveStyle]);
|
|
8988
9071
|
};
|
|
8989
9072
|
var xAxis = 'bottom';
|
|
8990
9073
|
var yAxis = series.axis === 'secondary' ? 'right' : 'left';
|
|
@@ -9093,14 +9176,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
9093
9176
|
}, {
|
|
9094
9177
|
key: "rendersymbol",
|
|
9095
9178
|
value: function rendersymbol(series, index) {
|
|
9096
|
-
var
|
|
9179
|
+
var _this58 = this;
|
|
9097
9180
|
/* global d3 series index series.key */
|
|
9098
9181
|
var drawSymbol = function drawSymbol(size) {
|
|
9099
9182
|
return d3.symbol()
|
|
9100
9183
|
// .type(d => {
|
|
9101
9184
|
// return d3.symbols[0]
|
|
9102
9185
|
// })
|
|
9103
|
-
.size(size ||
|
|
9186
|
+
.size(size || _this58.options.symbolSize);
|
|
9104
9187
|
};
|
|
9105
9188
|
var xAxis = 'bottom';
|
|
9106
9189
|
var yAxis = series.axis === 'secondary' ? 'right' : 'left';
|
|
@@ -9126,27 +9209,27 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
9126
9209
|
// else {
|
|
9127
9210
|
// return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
|
|
9128
9211
|
// }
|
|
9129
|
-
var xIndex =
|
|
9130
|
-
var xPos =
|
|
9131
|
-
if (
|
|
9132
|
-
xPos = xPos + (
|
|
9133
|
-
}
|
|
9134
|
-
var adjustment =
|
|
9135
|
-
if (
|
|
9136
|
-
return "translate(".concat(
|
|
9212
|
+
var xIndex = _this58[xAxis + 'Axis'].domain().indexOf(d.x.value);
|
|
9213
|
+
var xPos = _this58["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
|
|
9214
|
+
if (_this58["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
|
|
9215
|
+
xPos = xPos + (_this58["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
|
|
9216
|
+
}
|
|
9217
|
+
var adjustment = _this58.options.data[xAxis].scale === 'Time' || _this58.options.data[xAxis].scale === 'Linear' ? 0 : _this58.options.data[xAxis].bandWidth / 2;
|
|
9218
|
+
if (_this58.options.orientation === 'horizontal') {
|
|
9219
|
+
return "translate(".concat(_this58["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ", ").concat(xPos, ")");
|
|
9137
9220
|
} else {
|
|
9138
|
-
if (
|
|
9139
|
-
xPos =
|
|
9221
|
+
if (_this58.options.data[xAxis].scale === 'Time') {
|
|
9222
|
+
xPos = _this58["".concat(xAxis, "Axis")](_this58.parseX(d.x.value));
|
|
9140
9223
|
} else {
|
|
9141
|
-
var _xIndex =
|
|
9142
|
-
var _xPos =
|
|
9143
|
-
if (
|
|
9144
|
-
_xPos = _xPos + (
|
|
9224
|
+
var _xIndex = _this58[xAxis + 'Axis'].domain().indexOf(d.x.value);
|
|
9225
|
+
var _xPos = _this58["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex];
|
|
9226
|
+
if (_this58["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex + 1]) {
|
|
9227
|
+
_xPos = _xPos + (_this58["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex + 1] - _xPos) / 2;
|
|
9145
9228
|
}
|
|
9146
9229
|
// return xPos
|
|
9147
9230
|
}
|
|
9148
9231
|
// return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
|
|
9149
|
-
return "translate(".concat(xPos, ", ").concat(
|
|
9232
|
+
return "translate(".concat(xPos, ", ").concat(_this58["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
9150
9233
|
}
|
|
9151
9234
|
});
|
|
9152
9235
|
// Enter
|
|
@@ -9161,27 +9244,27 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
9161
9244
|
}).attr('class', function (d) {
|
|
9162
9245
|
return "symbol symbol_".concat(series.key);
|
|
9163
9246
|
}).attr('transform', function (d) {
|
|
9164
|
-
var xIndex =
|
|
9165
|
-
var xPos =
|
|
9166
|
-
if (
|
|
9167
|
-
xPos = xPos + (
|
|
9168
|
-
}
|
|
9169
|
-
var adjustment =
|
|
9170
|
-
if (
|
|
9171
|
-
return "translate(".concat(
|
|
9247
|
+
var xIndex = _this58[xAxis + 'Axis'].domain().indexOf(d.x.value);
|
|
9248
|
+
var xPos = _this58["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex];
|
|
9249
|
+
if (_this58["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1]) {
|
|
9250
|
+
xPos = xPos + (_this58["custom".concat(xAxis.toInitialCaps(), "Range")][xIndex + 1] - xPos) / 2;
|
|
9251
|
+
}
|
|
9252
|
+
var adjustment = _this58.options.data[xAxis].scale === 'Time' || _this58.options.data[xAxis].scale === 'Linear' ? 0 : _this58.options.data[xAxis].bandWidth / 2;
|
|
9253
|
+
if (_this58.options.orientation === 'horizontal') {
|
|
9254
|
+
return "translate(".concat(_this58["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ", ").concat(xPos, ")");
|
|
9172
9255
|
} else {
|
|
9173
|
-
if (
|
|
9174
|
-
xPos =
|
|
9256
|
+
if (_this58.options.data[xAxis].scale === 'Time') {
|
|
9257
|
+
xPos = _this58["".concat(xAxis, "Axis")](_this58.parseX(d.x.value));
|
|
9175
9258
|
} else {
|
|
9176
|
-
var _xIndex2 =
|
|
9177
|
-
var _xPos2 =
|
|
9178
|
-
if (
|
|
9179
|
-
_xPos2 = _xPos2 + (
|
|
9259
|
+
var _xIndex2 = _this58[xAxis + 'Axis'].domain().indexOf(d.x.value);
|
|
9260
|
+
var _xPos2 = _this58["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex2];
|
|
9261
|
+
if (_this58["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex2 + 1]) {
|
|
9262
|
+
_xPos2 = _xPos2 + (_this58["custom".concat(xAxis.toInitialCaps(), "Range")][_xIndex2 + 1] - _xPos2) / 2;
|
|
9180
9263
|
}
|
|
9181
9264
|
// return xPos
|
|
9182
9265
|
}
|
|
9183
9266
|
// return `translate(${this[`${xAxis}Axis`](this.parseX(d.x.value)) + adjustment}, ${this[`${yAxis}Axis`](isNaN(d.y.value) ? 0 : d.y.value)})`
|
|
9184
|
-
return "translate(".concat(xPos, ", ").concat(
|
|
9267
|
+
return "translate(".concat(xPos, ", ").concat(_this58["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
9185
9268
|
}
|
|
9186
9269
|
});
|
|
9187
9270
|
}
|
|
@@ -9377,7 +9460,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
9377
9460
|
}, {
|
|
9378
9461
|
key: "resize",
|
|
9379
9462
|
value: function resize() {
|
|
9380
|
-
var
|
|
9463
|
+
var _this59 = this;
|
|
9381
9464
|
var el = document.getElementById(this.elementId);
|
|
9382
9465
|
if (el) {
|
|
9383
9466
|
// if (this.options.width) {
|
|
@@ -9388,7 +9471,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
9388
9471
|
// }
|
|
9389
9472
|
var html = "\n <div class='text-".concat(this.options.align, "'>\n ");
|
|
9390
9473
|
html += this._data.map(function (d, i) {
|
|
9391
|
-
return
|
|
9474
|
+
return _this59.getLegendItemHTML(d);
|
|
9392
9475
|
}).join('');
|
|
9393
9476
|
html += "\n <div>\n ";
|
|
9394
9477
|
el.innerHTML = html;
|
|
@@ -9469,7 +9552,7 @@ var WebsyKPI = /*#__PURE__*/function () {
|
|
|
9469
9552
|
if (this.options.icon) {
|
|
9470
9553
|
html += "\n <div class=\"websy-kpi-icon\"><img src=\"".concat(this.options.icon, "\"></div> \n ");
|
|
9471
9554
|
}
|
|
9472
|
-
html += " \n <div class=\"websy-kpi-info\">\n <div class=\"websy-kpi-label ".concat(this.options.label.classes.join(' ') || '', "\">\n
|
|
9555
|
+
html += " \n <div class=\"websy-kpi-info\">\n <div class=\"websy-kpi-label-container\">\n <div class=\"websy-kpi-label ".concat(this.options.label.classes.join(' ') || '', "\">\n ").concat((this.options.label || {}).value || '', "\n </div>\n ");
|
|
9473
9556
|
if (this.options.tooltip && this.options.tooltip.value) {
|
|
9474
9557
|
html += "\n <div class=\"websy-info ".concat(this.options.tooltip.classes.join(' ') || '', "\" data-info=\"").concat(this.options.tooltip.value, "\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 512 512\"><title>ionicons-v5-e</title><path d=\"M256,56C145.72,56,56,145.72,56,256s89.72,200,200,200,200-89.72,200-200S366.28,56,256,56Zm0,82a26,26,0,1,1-26,26A26,26,0,0,1,256,138Zm48,226H216a16,16,0,0,1,0-32h28V244H228a16,16,0,0,1,0-32h32a16,16,0,0,1,16,16V332h28a16,16,0,0,1,0,32Z\"/></svg>\n </div> \n ");
|
|
9475
9558
|
}
|
|
@@ -9546,7 +9629,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
9546
9629
|
}, {
|
|
9547
9630
|
key: "render",
|
|
9548
9631
|
value: function render() {
|
|
9549
|
-
var
|
|
9632
|
+
var _this60 = this;
|
|
9550
9633
|
this._isRendered = false;
|
|
9551
9634
|
var mapEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
9552
9635
|
var legendEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
@@ -9554,7 +9637,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
9554
9637
|
var legendData = this.options.data.polygons.map(function (s, i) {
|
|
9555
9638
|
return {
|
|
9556
9639
|
value: s.label || s.key,
|
|
9557
|
-
color: s.color ||
|
|
9640
|
+
color: s.color || _this60.options.colors[i % _this60.options.colors.length]
|
|
9558
9641
|
};
|
|
9559
9642
|
});
|
|
9560
9643
|
var longestValue = legendData.map(function (s) {
|
|
@@ -9608,7 +9691,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
9608
9691
|
}
|
|
9609
9692
|
if (this.polygons) {
|
|
9610
9693
|
this.polygons.forEach(function (p) {
|
|
9611
|
-
return
|
|
9694
|
+
return _this60.map.removeLayer(p);
|
|
9612
9695
|
});
|
|
9613
9696
|
}
|
|
9614
9697
|
this.polygons = [];
|
|
@@ -9662,15 +9745,15 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
9662
9745
|
p.options = {};
|
|
9663
9746
|
}
|
|
9664
9747
|
if (!p.options.color) {
|
|
9665
|
-
p.options.color =
|
|
9748
|
+
p.options.color = _this60.options.colors[i % _this60.options.colors.length];
|
|
9666
9749
|
}
|
|
9667
9750
|
var pol = L.polygon(p.data.map(function (c) {
|
|
9668
9751
|
return c.map(function (d) {
|
|
9669
9752
|
return [d.Latitude, d.Longitude];
|
|
9670
9753
|
});
|
|
9671
|
-
}), p.options).addTo(
|
|
9672
|
-
|
|
9673
|
-
|
|
9754
|
+
}), p.options).addTo(_this60.map);
|
|
9755
|
+
_this60.polygons.push(pol);
|
|
9756
|
+
_this60.map.fitBounds(pol.getBounds());
|
|
9674
9757
|
});
|
|
9675
9758
|
}
|
|
9676
9759
|
// if (this.data.markers.length > 0) {
|