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