@websy/websy-designs 1.4.15 → 1.4.17
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/server/routes/v1/recaptcha.js +2 -1
- package/dist/websy-designs-es6.debug.js +76 -32
- package/dist/websy-designs-es6.js +293 -241
- package/dist/websy-designs-es6.min.js +1 -1
- package/dist/websy-designs.debug.js +77 -33
- package/dist/websy-designs.js +297 -245
- package/dist/websy-designs.min.css +1 -1
- package/dist/websy-designs.min.js +1 -1
- package/package.json +1 -1
|
@@ -250,7 +250,7 @@ var ButtonGroup = /*#__PURE__*/function () {
|
|
|
250
250
|
this.options.activeItem = index;
|
|
251
251
|
|
|
252
252
|
if (this.options.onActivate) {
|
|
253
|
-
this.options.onActivate(this.options.items[index], index);
|
|
253
|
+
this.options.onActivate(this.options.items[index], index, event);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
var el = document.getElementById(this.elementId);
|
|
@@ -2254,27 +2254,28 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2254
2254
|
|
|
2255
2255
|
return new Promise(function (resolve, reject) {
|
|
2256
2256
|
if (_this11.options.useRecaptcha === true) {
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
grecaptcha.execute(
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
}
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
}
|
|
2271
|
-
},
|
|
2272
|
-
|
|
2273
|
-
})
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2257
|
+
if (_this11.recaptchaValue) {
|
|
2258
|
+
// grecaptcha.ready(() => {
|
|
2259
|
+
// grecaptcha.execute(this.recaptchaValue, { action: 'submit' }).then(token => {
|
|
2260
|
+
_this11.apiService.add('google/checkrecaptcha', {
|
|
2261
|
+
grecaptcharesponse: _this11.recaptchaValue
|
|
2262
|
+
}).then(function (response) {
|
|
2263
|
+
if (response.success && response.success === true) {
|
|
2264
|
+
resolve(true);
|
|
2265
|
+
grecaptcha.reset("".concat(_this11.elementId, "_recaptcha"), {
|
|
2266
|
+
sitekey: ENVIRONMENT.RECAPTCHA_KEY
|
|
2267
|
+
});
|
|
2268
|
+
} else {
|
|
2269
|
+
resolve(false);
|
|
2270
|
+
}
|
|
2271
|
+
}); // }, err => {
|
|
2272
|
+
// reject(err)
|
|
2273
|
+
// })
|
|
2274
|
+
// })
|
|
2275
|
+
|
|
2276
|
+
} else {
|
|
2277
|
+
resolve(false);
|
|
2278
|
+
}
|
|
2278
2279
|
} else {
|
|
2279
2280
|
resolve(true);
|
|
2280
2281
|
}
|
|
@@ -2338,19 +2339,23 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2338
2339
|
}, {
|
|
2339
2340
|
key: "recaptchaReady",
|
|
2340
2341
|
value: function recaptchaReady() {
|
|
2342
|
+
var _this13 = this;
|
|
2343
|
+
|
|
2341
2344
|
var el = document.getElementById("".concat(this.elementId, "_recaptcha"));
|
|
2342
2345
|
|
|
2343
2346
|
if (el) {
|
|
2344
|
-
grecaptcha.
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
+
grecaptcha.ready(function () {
|
|
2348
|
+
grecaptcha.render("".concat(_this13.elementId, "_recaptcha"), {
|
|
2349
|
+
sitekey: ENVIRONMENT.RECAPTCHA_KEY,
|
|
2350
|
+
callback: _this13.validateRecaptcha.bind(_this13)
|
|
2351
|
+
});
|
|
2347
2352
|
});
|
|
2348
2353
|
}
|
|
2349
2354
|
}
|
|
2350
2355
|
}, {
|
|
2351
2356
|
key: "render",
|
|
2352
2357
|
value: function render(update, data) {
|
|
2353
|
-
var
|
|
2358
|
+
var _this14 = this;
|
|
2354
2359
|
|
|
2355
2360
|
var el = document.getElementById(this.elementId);
|
|
2356
2361
|
var componentsToProcess = [];
|
|
@@ -2360,13 +2365,18 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2360
2365
|
this.options.fields.forEach(function (f, i) {
|
|
2361
2366
|
if (f.component) {
|
|
2362
2367
|
componentsToProcess.push(f);
|
|
2363
|
-
html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <div id='").concat(
|
|
2368
|
+
html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <div id='").concat(_this14.elementId, "_input_").concat(f.field, "_component' class='form-component'></div>\n </div><!--\n ");
|
|
2364
2369
|
} else if (f.type === 'longtext') {
|
|
2365
|
-
html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <textarea\n id=\"").concat(
|
|
2370
|
+
html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <textarea\n id=\"").concat(_this14.elementId, "_input_").concat(f.field, "\"\n ").concat(f.required === true ? 'required' : '', " \n placeholder=\"").concat(f.placeholder || '', "\"\n name=\"").concat(f.field, "\" \n ").concat((f.attributes || []).join(' '), "\n class=\"websy-input websy-textarea\"\n ></textarea>\n </div><!--\n ");
|
|
2366
2371
|
} else {
|
|
2367
|
-
html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <input \n id=\"").concat(
|
|
2372
|
+
html += "\n ".concat(i > 0 ? '-->' : '', "<div class='").concat(f.classes || '', "'>\n ").concat(f.label ? "<label for=\"".concat(f.field, "\">").concat(f.label, "</label>") : '', "\n <input \n id=\"").concat(_this14.elementId, "_input_").concat(f.field, "\"\n ").concat(f.required === true ? 'required' : '', " \n type=\"").concat(f.type || 'text', "\" \n class=\"websy-input\" \n ").concat((f.attributes || []).join(' '), "\n name=\"").concat(f.field, "\" \n placeholder=\"").concat(f.placeholder || '', "\"\n value=\"").concat(f.value || '', "\"\n valueAsDate=\"").concat(f.type === 'date' ? f.value : '', "\"\n oninvalidx=\"this.setCustomValidity('").concat(f.invalidMessage || 'Please fill in this field.', "')\"\n />\n </div><!--\n ");
|
|
2368
2373
|
}
|
|
2369
2374
|
});
|
|
2375
|
+
|
|
2376
|
+
if (this.options.useRecaptcha === true) {
|
|
2377
|
+
html += "\n --><div id='".concat(this.elementId, "_recaptcha' data-sitekey='").concat(ENVIRONMENT.RECAPTCHA_KEY, "' class='websy-form-recaptcha'></div>\n <div id='").concat(this.elementId, "_recaptchaError' class='websy-alert websy-alert-error websy-hidden'>Invalid recaptcha response</div><!--\n ");
|
|
2378
|
+
}
|
|
2379
|
+
|
|
2370
2380
|
html += "\n --><button class=\"websy-btn submit ".concat(this.options.submit.classes || '', "\">").concat(this.options.submit.text || 'Save', "</button>").concat(this.options.cancel ? '<!--' : '', "\n ");
|
|
2371
2381
|
|
|
2372
2382
|
if (this.options.cancel) {
|
|
@@ -2374,14 +2384,10 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2374
2384
|
}
|
|
2375
2385
|
|
|
2376
2386
|
html += " \n </form>\n <div id=\"".concat(this.elementId, "_validationFail\" class=\"websy-validation-failure\"></div>\n ");
|
|
2377
|
-
|
|
2378
|
-
if (this.options.useRecaptcha === true) {
|
|
2379
|
-
html += "\n <div id='".concat(this.elementId, "_recaptcha'></div>\n ");
|
|
2380
|
-
}
|
|
2381
|
-
|
|
2382
2387
|
el.innerHTML = html;
|
|
2383
2388
|
this.processComponents(componentsToProcess, function () {
|
|
2384
|
-
if (
|
|
2389
|
+
if (_this14.options.useRecaptcha === true && typeof grecaptcha !== 'undefined') {
|
|
2390
|
+
_this14.recaptchaReady();
|
|
2385
2391
|
}
|
|
2386
2392
|
});
|
|
2387
2393
|
}
|
|
@@ -2389,13 +2395,27 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2389
2395
|
}, {
|
|
2390
2396
|
key: "submitForm",
|
|
2391
2397
|
value: function submitForm() {
|
|
2392
|
-
var
|
|
2398
|
+
var _this15 = this;
|
|
2393
2399
|
|
|
2394
2400
|
var formEl = document.getElementById("".concat(this.elementId, "Form"));
|
|
2401
|
+
var buttonEl = formEl.querySelector('button.websy-btn.submit');
|
|
2402
|
+
var recaptchErrEl = document.getElementById("".concat(this.elementId, "_recaptchaError"));
|
|
2395
2403
|
|
|
2396
2404
|
if (formEl.reportValidity() === true) {
|
|
2405
|
+
if (buttonEl) {
|
|
2406
|
+
buttonEl.setAttribute('disabled', true);
|
|
2407
|
+
}
|
|
2408
|
+
|
|
2397
2409
|
this.checkRecaptcha().then(function (result) {
|
|
2410
|
+
if (buttonEl) {
|
|
2411
|
+
buttonEl.removeAttribute('disabled');
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2398
2414
|
if (result === true) {
|
|
2415
|
+
if (recaptchErrEl) {
|
|
2416
|
+
recaptchErrEl.classList.add('websy-hidden');
|
|
2417
|
+
}
|
|
2418
|
+
|
|
2399
2419
|
var formData = new FormData(formEl);
|
|
2400
2420
|
var data = {};
|
|
2401
2421
|
var temp = new FormData(formEl);
|
|
@@ -2403,39 +2423,47 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2403
2423
|
data[key] = value;
|
|
2404
2424
|
});
|
|
2405
2425
|
|
|
2406
|
-
if (
|
|
2407
|
-
var
|
|
2426
|
+
if (_this15.options.url) {
|
|
2427
|
+
var _this15$apiService;
|
|
2408
2428
|
|
|
2409
|
-
var params = [
|
|
2429
|
+
var params = [_this15.options.url];
|
|
2410
2430
|
|
|
2411
|
-
if (
|
|
2412
|
-
params.push(
|
|
2431
|
+
if (_this15.options.mode === 'update') {
|
|
2432
|
+
params.push(_this15.options.id);
|
|
2413
2433
|
}
|
|
2414
2434
|
|
|
2415
2435
|
params.push(data);
|
|
2416
2436
|
|
|
2417
|
-
(
|
|
2418
|
-
if (
|
|
2437
|
+
(_this15$apiService = _this15.apiService)[_this15.options.mode].apply(_this15$apiService, params).then(function (result) {
|
|
2438
|
+
if (_this15.options.clearAfterSave === true) {
|
|
2419
2439
|
// this.render()
|
|
2420
2440
|
formEl.reset();
|
|
2421
2441
|
}
|
|
2422
2442
|
|
|
2423
|
-
|
|
2443
|
+
buttonEl.removeAttribute('disabled');
|
|
2444
|
+
|
|
2445
|
+
_this15.options.onSuccess.call(_this15, result);
|
|
2424
2446
|
}, function (err) {
|
|
2425
2447
|
console.log('Error submitting form data:', err);
|
|
2426
2448
|
|
|
2427
|
-
|
|
2449
|
+
_this15.options.onError.call(_this15, err);
|
|
2428
2450
|
});
|
|
2429
|
-
} else if (
|
|
2430
|
-
|
|
2431
|
-
if (
|
|
2451
|
+
} else if (_this15.options.submitFn) {
|
|
2452
|
+
_this15.options.submitFn(data, function () {
|
|
2453
|
+
if (_this15.options.clearAfterSave === true) {
|
|
2432
2454
|
// this.render()
|
|
2433
2455
|
formEl.reset();
|
|
2434
2456
|
}
|
|
2435
2457
|
});
|
|
2436
2458
|
}
|
|
2437
2459
|
} else {
|
|
2438
|
-
|
|
2460
|
+
if (buttonEl) {
|
|
2461
|
+
buttonEl.removeAttribute('disabled');
|
|
2462
|
+
}
|
|
2463
|
+
|
|
2464
|
+
if (recaptchErrEl) {
|
|
2465
|
+
recaptchErrEl.classList.remove('websy-hidden');
|
|
2466
|
+
}
|
|
2439
2467
|
}
|
|
2440
2468
|
});
|
|
2441
2469
|
}
|
|
@@ -2448,17 +2476,17 @@ var WebsyForm = /*#__PURE__*/function () {
|
|
|
2448
2476
|
}, {
|
|
2449
2477
|
key: "data",
|
|
2450
2478
|
set: function set(d) {
|
|
2451
|
-
var
|
|
2479
|
+
var _this16 = this;
|
|
2452
2480
|
|
|
2453
2481
|
if (!this.options.fields) {
|
|
2454
2482
|
this.options.fields = [];
|
|
2455
2483
|
}
|
|
2456
2484
|
|
|
2457
2485
|
var _loop = function _loop(key) {
|
|
2458
|
-
|
|
2486
|
+
_this16.options.fields.forEach(function (f) {
|
|
2459
2487
|
if (f.field === key) {
|
|
2460
2488
|
f.value = d[key];
|
|
2461
|
-
var el = document.getElementById("".concat(
|
|
2489
|
+
var el = document.getElementById("".concat(_this16.elementId, "_input_").concat(f.field));
|
|
2462
2490
|
el.value = f.value;
|
|
2463
2491
|
}
|
|
2464
2492
|
});
|
|
@@ -2652,6 +2680,13 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2652
2680
|
if (item.hasChildren === true) {
|
|
2653
2681
|
event.target.classList.toggle('menu-open');
|
|
2654
2682
|
this.toggleMenu(item.id);
|
|
2683
|
+
} else {
|
|
2684
|
+
var el = document.getElementById(this.elementId);
|
|
2685
|
+
var allEls = el.querySelectorAll('.websy-menu-header');
|
|
2686
|
+
Array.from(allEls).forEach(function (e) {
|
|
2687
|
+
return e.classList.remove('active');
|
|
2688
|
+
});
|
|
2689
|
+
event.target.classList.add('active');
|
|
2655
2690
|
}
|
|
2656
2691
|
}
|
|
2657
2692
|
|
|
@@ -2662,11 +2697,11 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2662
2697
|
}, {
|
|
2663
2698
|
key: "handleSearch",
|
|
2664
2699
|
value: function handleSearch(searchText) {
|
|
2665
|
-
var
|
|
2700
|
+
var _this17 = this;
|
|
2666
2701
|
|
|
2667
2702
|
var el = document.getElementById(this.elementId);
|
|
2668
2703
|
var lowestItems = this.flatItems.filter(function (d) {
|
|
2669
|
-
return d.level ===
|
|
2704
|
+
return d.level === _this17.maxLevel;
|
|
2670
2705
|
});
|
|
2671
2706
|
var visibleItems = lowestItems;
|
|
2672
2707
|
var defaultMethod = 'remove';
|
|
@@ -2674,7 +2709,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2674
2709
|
if (searchText && searchText.length > 1) {
|
|
2675
2710
|
defaultMethod = 'add';
|
|
2676
2711
|
visibleItems = lowestItems.filter(function (d) {
|
|
2677
|
-
return d[
|
|
2712
|
+
return d[_this17.options.searchProp].toLowerCase().indexOf(searchText.toLowerCase()) !== -1;
|
|
2678
2713
|
});
|
|
2679
2714
|
} // hide everything
|
|
2680
2715
|
|
|
@@ -2751,7 +2786,24 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2751
2786
|
html += "</div>";
|
|
2752
2787
|
}
|
|
2753
2788
|
|
|
2754
|
-
el.innerHTML = html;
|
|
2789
|
+
el.innerHTML = html; // open the menu if an item is set as 'active'
|
|
2790
|
+
|
|
2791
|
+
var activeEl = el.querySelector('.websy-menu-header.active');
|
|
2792
|
+
|
|
2793
|
+
if (activeEl) {
|
|
2794
|
+
var parent = activeEl.parentElement;
|
|
2795
|
+
|
|
2796
|
+
while (parent) {
|
|
2797
|
+
if (parent.tagName === 'UL') {
|
|
2798
|
+
parent.classList.remove('websy-menu-collapsed');
|
|
2799
|
+
parent = parent.parentElement;
|
|
2800
|
+
} else if (parent.tagName === 'LI') {
|
|
2801
|
+
parent = parent.parentElement;
|
|
2802
|
+
} else {
|
|
2803
|
+
parent = null;
|
|
2804
|
+
}
|
|
2805
|
+
}
|
|
2806
|
+
}
|
|
2755
2807
|
|
|
2756
2808
|
if (this.options.enableSearch === true) {
|
|
2757
2809
|
this.search = new WebsyDesigns.Search("".concat(this.elementId, "_search"), _extends({}, {
|
|
@@ -2786,7 +2838,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2786
2838
|
items[i].classes = items[i].classes.join(' ');
|
|
2787
2839
|
}
|
|
2788
2840
|
|
|
2789
|
-
html += "\n\t\t\t<li class='websy-".concat(this.options.orientation, "-list-item ").concat(items[i].alwaysOpen === true ? 'always-open' : '', "'>\n\t\t\t\t<div class='websy-menu-header ").concat(items[i].classes || '', " ").concat(selected, " ").concat(active, "' \n id='").concat(blockId, "' \n data-id='").concat(currentBlock, "'\n data-path='").concat(items[i].path, "'\n data-menu-id='").concat(this.elementId, "_").concat(currentBlock, "_list'\n data-popout-id='").concat(level > 1 ? block : currentBlock, "'\n data-text='").concat(items[i].isLink !== true ? items[i].text : '', "'\n style='padding-left: ").concat(level * this.options.childIndentation, "px'\n ").concat(items[i].attributes && items[i].attributes.join(' ') || '', "\n >\n ");
|
|
2841
|
+
html += "\n\t\t\t<li class='websy-".concat(this.options.orientation, "-list-item ").concat(items[i].alwaysOpen === true ? 'always-open' : '', "'>\n\t\t\t\t<div class='websy-menu-header websy-menu-level-").concat(level, " ").concat(items[i].classes || '', " ").concat(selected, " ").concat(active, "' \n id='").concat(blockId, "' \n data-id='").concat(currentBlock, "'\n data-path='").concat(items[i].path, "'\n data-menu-id='").concat(this.elementId, "_").concat(currentBlock, "_list'\n data-popout-id='").concat(level > 1 ? block : currentBlock, "'\n data-text='").concat(items[i].isLink !== true ? items[i].text : '', "'\n style='padding-left: ").concat(level * this.options.childIndentation, "px'\n ").concat(items[i].attributes && items[i].attributes.join(' ') || '', "\n >\n ");
|
|
2790
2842
|
|
|
2791
2843
|
if (this.options.orientation === 'horizontal') {
|
|
2792
2844
|
html += items[i].text;
|
|
@@ -2878,7 +2930,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2878
2930
|
|
|
2879
2931
|
var Pager = /*#__PURE__*/function () {
|
|
2880
2932
|
function Pager(elementId, options) {
|
|
2881
|
-
var
|
|
2933
|
+
var _this18 = this;
|
|
2882
2934
|
|
|
2883
2935
|
_classCallCheck(this, Pager);
|
|
2884
2936
|
|
|
@@ -2931,8 +2983,8 @@ var Pager = /*#__PURE__*/function () {
|
|
|
2931
2983
|
allowClear: false,
|
|
2932
2984
|
disableSearch: true,
|
|
2933
2985
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
2934
|
-
if (
|
|
2935
|
-
|
|
2986
|
+
if (_this18.options.onChangePageSize) {
|
|
2987
|
+
_this18.options.onChangePageSize(selectedItem.value);
|
|
2936
2988
|
}
|
|
2937
2989
|
}
|
|
2938
2990
|
});
|
|
@@ -2956,13 +3008,13 @@ var Pager = /*#__PURE__*/function () {
|
|
|
2956
3008
|
}, {
|
|
2957
3009
|
key: "render",
|
|
2958
3010
|
value: function render() {
|
|
2959
|
-
var
|
|
3011
|
+
var _this19 = this;
|
|
2960
3012
|
|
|
2961
3013
|
var el = document.getElementById("".concat(this.elementId, "_pageList"));
|
|
2962
3014
|
|
|
2963
3015
|
if (el) {
|
|
2964
3016
|
var pages = this.options.pages.map(function (item, index) {
|
|
2965
|
-
return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
3017
|
+
return "<li data-index=\"".concat(index, "\" class=\"websy-page-num ").concat(_this19.options.activePage === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
2966
3018
|
});
|
|
2967
3019
|
var startIndex = 0;
|
|
2968
3020
|
|
|
@@ -3030,58 +3082,58 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
3030
3082
|
_createClass(WebsyPDFButton, [{
|
|
3031
3083
|
key: "handleClick",
|
|
3032
3084
|
value: function handleClick(event) {
|
|
3033
|
-
var
|
|
3085
|
+
var _this20 = this;
|
|
3034
3086
|
|
|
3035
3087
|
if (event.target.classList.contains('websy-pdf-button')) {
|
|
3036
3088
|
this.loader.show();
|
|
3037
3089
|
setTimeout(function () {
|
|
3038
|
-
if (
|
|
3039
|
-
var el = document.getElementById(
|
|
3090
|
+
if (_this20.options.targetId) {
|
|
3091
|
+
var el = document.getElementById(_this20.options.targetId);
|
|
3040
3092
|
|
|
3041
3093
|
if (el) {
|
|
3042
3094
|
var pdfData = {
|
|
3043
3095
|
options: {}
|
|
3044
3096
|
};
|
|
3045
3097
|
|
|
3046
|
-
if (
|
|
3047
|
-
pdfData.options = _extends({},
|
|
3098
|
+
if (_this20.options.pdfOptions) {
|
|
3099
|
+
pdfData.options = _extends({}, _this20.options.pdfOptions);
|
|
3048
3100
|
}
|
|
3049
3101
|
|
|
3050
|
-
if (
|
|
3051
|
-
if (
|
|
3052
|
-
var headerEl = document.getElementById(
|
|
3102
|
+
if (_this20.options.header) {
|
|
3103
|
+
if (_this20.options.header.elementId) {
|
|
3104
|
+
var headerEl = document.getElementById(_this20.options.header.elementId);
|
|
3053
3105
|
|
|
3054
3106
|
if (headerEl) {
|
|
3055
3107
|
pdfData.header = headerEl.outerHTML;
|
|
3056
3108
|
|
|
3057
|
-
if (
|
|
3058
|
-
pdfData.options.headerCSS =
|
|
3109
|
+
if (_this20.options.header.css) {
|
|
3110
|
+
pdfData.options.headerCSS = _this20.options.header.css;
|
|
3059
3111
|
}
|
|
3060
3112
|
}
|
|
3061
|
-
} else if (
|
|
3062
|
-
pdfData.header =
|
|
3113
|
+
} else if (_this20.options.header.html) {
|
|
3114
|
+
pdfData.header = _this20.options.header.html;
|
|
3063
3115
|
|
|
3064
|
-
if (
|
|
3065
|
-
pdfData.options.headerCSS =
|
|
3116
|
+
if (_this20.options.header.css) {
|
|
3117
|
+
pdfData.options.headerCSS = _this20.options.header.css;
|
|
3066
3118
|
}
|
|
3067
3119
|
} else {
|
|
3068
|
-
pdfData.header =
|
|
3120
|
+
pdfData.header = _this20.options.header;
|
|
3069
3121
|
}
|
|
3070
3122
|
}
|
|
3071
3123
|
|
|
3072
|
-
if (
|
|
3073
|
-
if (
|
|
3074
|
-
var footerEl = document.getElementById(
|
|
3124
|
+
if (_this20.options.footer) {
|
|
3125
|
+
if (_this20.options.footer.elementId) {
|
|
3126
|
+
var footerEl = document.getElementById(_this20.options.footer.elementId);
|
|
3075
3127
|
|
|
3076
3128
|
if (footerEl) {
|
|
3077
3129
|
pdfData.footer = footerEl.outerHTML;
|
|
3078
3130
|
|
|
3079
|
-
if (
|
|
3080
|
-
pdfData.options.footerCSS =
|
|
3131
|
+
if (_this20.options.footer.css) {
|
|
3132
|
+
pdfData.options.footerCSS = _this20.options.footer.css;
|
|
3081
3133
|
}
|
|
3082
3134
|
}
|
|
3083
3135
|
} else {
|
|
3084
|
-
pdfData.footer =
|
|
3136
|
+
pdfData.footer = _this20.options.footer;
|
|
3085
3137
|
}
|
|
3086
3138
|
}
|
|
3087
3139
|
|
|
@@ -3090,31 +3142,31 @@ var WebsyPDFButton = /*#__PURE__*/function () {
|
|
|
3090
3142
|
// document.getElementById(`${this.elementId}_pdfFooter`).value = pdfData.footer
|
|
3091
3143
|
// document.getElementById(`${this.elementId}_form`).submit()
|
|
3092
3144
|
|
|
3093
|
-
|
|
3145
|
+
_this20.service.add('', pdfData, {
|
|
3094
3146
|
responseType: 'blob'
|
|
3095
3147
|
}).then(function (response) {
|
|
3096
|
-
|
|
3148
|
+
_this20.loader.hide();
|
|
3097
3149
|
|
|
3098
3150
|
var blob = new Blob([response], {
|
|
3099
3151
|
type: 'application/pdf'
|
|
3100
3152
|
});
|
|
3101
3153
|
var msg = "\n <div class='text-center websy-pdf-download'>\n <div>Your file is ready to download</div>\n <a href='".concat(URL.createObjectURL(blob), "' target='_blank'\n ");
|
|
3102
3154
|
|
|
3103
|
-
if (
|
|
3155
|
+
if (_this20.options.directDownload === true) {
|
|
3104
3156
|
var fileName;
|
|
3105
3157
|
|
|
3106
|
-
if (typeof
|
|
3107
|
-
fileName =
|
|
3158
|
+
if (typeof _this20.options.fileName === 'function') {
|
|
3159
|
+
fileName = _this20.options.fileName() || 'Export';
|
|
3108
3160
|
} else {
|
|
3109
|
-
fileName =
|
|
3161
|
+
fileName = _this20.options.fileName || 'Export';
|
|
3110
3162
|
}
|
|
3111
3163
|
|
|
3112
3164
|
msg += "download='".concat(fileName, ".pdf'");
|
|
3113
3165
|
}
|
|
3114
3166
|
|
|
3115
|
-
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(
|
|
3167
|
+
msg += "\n >\n <button class='websy-btn download-pdf'>".concat(_this20.options.buttonText, "</button>\n </a>\n </div>\n ");
|
|
3116
3168
|
|
|
3117
|
-
|
|
3169
|
+
_this20.popup.show({
|
|
3118
3170
|
message: msg,
|
|
3119
3171
|
mask: true
|
|
3120
3172
|
});
|
|
@@ -3315,7 +3367,7 @@ var WebsyPubSub = /*#__PURE__*/function () {
|
|
|
3315
3367
|
|
|
3316
3368
|
var ResponsiveText = /*#__PURE__*/function () {
|
|
3317
3369
|
function ResponsiveText(elementId, options) {
|
|
3318
|
-
var
|
|
3370
|
+
var _this21 = this;
|
|
3319
3371
|
|
|
3320
3372
|
_classCallCheck(this, ResponsiveText);
|
|
3321
3373
|
|
|
@@ -3328,7 +3380,7 @@ var ResponsiveText = /*#__PURE__*/function () {
|
|
|
3328
3380
|
this.elementId = elementId;
|
|
3329
3381
|
this.canvas = document.createElement('canvas');
|
|
3330
3382
|
window.addEventListener('resize', function () {
|
|
3331
|
-
return
|
|
3383
|
+
return _this21.render();
|
|
3332
3384
|
});
|
|
3333
3385
|
var el = document.getElementById(this.elementId);
|
|
3334
3386
|
|
|
@@ -3547,7 +3599,7 @@ var ResponsiveText = /*#__PURE__*/function () {
|
|
|
3547
3599
|
|
|
3548
3600
|
var WebsyResultList = /*#__PURE__*/function () {
|
|
3549
3601
|
function WebsyResultList(elementId, options) {
|
|
3550
|
-
var
|
|
3602
|
+
var _this22 = this;
|
|
3551
3603
|
|
|
3552
3604
|
_classCallCheck(this, WebsyResultList);
|
|
3553
3605
|
|
|
@@ -3579,9 +3631,9 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3579
3631
|
|
|
3580
3632
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
3581
3633
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
3582
|
-
|
|
3634
|
+
_this22.options.template = templateString;
|
|
3583
3635
|
|
|
3584
|
-
|
|
3636
|
+
_this22.render();
|
|
3585
3637
|
});
|
|
3586
3638
|
} else {
|
|
3587
3639
|
this.render();
|
|
@@ -3601,7 +3653,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3601
3653
|
}, {
|
|
3602
3654
|
key: "buildHTML",
|
|
3603
3655
|
value: function buildHTML(d) {
|
|
3604
|
-
var
|
|
3656
|
+
var _this23 = this;
|
|
3605
3657
|
|
|
3606
3658
|
var startIndex = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
3607
3659
|
var inputTemplate = arguments.length > 2 ? arguments[2] : undefined;
|
|
@@ -3611,7 +3663,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3611
3663
|
if (this.options.template) {
|
|
3612
3664
|
if (d.length > 0) {
|
|
3613
3665
|
d.forEach(function (row, ix) {
|
|
3614
|
-
var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate ||
|
|
3666
|
+
var template = "".concat(ix > 0 ? '-->' : '').concat(inputTemplate || _this23.options.template).concat(ix < d.length - 1 ? '<!--' : ''); // find conditional elements
|
|
3615
3667
|
|
|
3616
3668
|
var ifMatches = _toConsumableArray(template.matchAll(/<\s*if[^>]*>([\s\S]*?)<\s*\/\s*if>/g));
|
|
3617
3669
|
|
|
@@ -3716,7 +3768,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3716
3768
|
parts.forEach(function (p) {
|
|
3717
3769
|
items = items[p];
|
|
3718
3770
|
});
|
|
3719
|
-
template = template.replace(m[0],
|
|
3771
|
+
template = template.replace(m[0], _this23.buildHTML(items, 0, withoutFor, [].concat(_toConsumableArray(locator), ["".concat(startIndex + ix, ":").concat(c)])));
|
|
3720
3772
|
}
|
|
3721
3773
|
});
|
|
3722
3774
|
|
|
@@ -3728,7 +3780,7 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3728
3780
|
}
|
|
3729
3781
|
});
|
|
3730
3782
|
|
|
3731
|
-
var flatRow =
|
|
3783
|
+
var flatRow = _this23.flattenObject(row);
|
|
3732
3784
|
|
|
3733
3785
|
for (var key in flatRow) {
|
|
3734
3786
|
var rg = new RegExp("{".concat(key, "}"), 'gm');
|
|
@@ -3863,13 +3915,13 @@ var WebsyResultList = /*#__PURE__*/function () {
|
|
|
3863
3915
|
}, {
|
|
3864
3916
|
key: "render",
|
|
3865
3917
|
value: function render() {
|
|
3866
|
-
var
|
|
3918
|
+
var _this24 = this;
|
|
3867
3919
|
|
|
3868
3920
|
if (this.options.entity) {
|
|
3869
3921
|
this.apiService.get(this.options.entity).then(function (results) {
|
|
3870
|
-
|
|
3922
|
+
_this24.rows = results.rows;
|
|
3871
3923
|
|
|
3872
|
-
|
|
3924
|
+
_this24.resize();
|
|
3873
3925
|
});
|
|
3874
3926
|
} else {
|
|
3875
3927
|
this.resize();
|
|
@@ -3955,14 +4007,14 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
3955
4007
|
_createClass(WebsyRouter, [{
|
|
3956
4008
|
key: "addGroup",
|
|
3957
4009
|
value: function addGroup(group) {
|
|
3958
|
-
var
|
|
4010
|
+
var _this25 = this;
|
|
3959
4011
|
|
|
3960
4012
|
if (!this.groups[group]) {
|
|
3961
4013
|
var els = document.querySelectorAll(".websy-view[data-group=\"".concat(group, "\"]"));
|
|
3962
4014
|
|
|
3963
4015
|
if (els) {
|
|
3964
4016
|
this.getClosestParent(els[0], function (parent) {
|
|
3965
|
-
|
|
4017
|
+
_this25.groups[group] = {
|
|
3966
4018
|
activeView: '',
|
|
3967
4019
|
views: [],
|
|
3968
4020
|
parent: parent.getAttribute('data-view')
|
|
@@ -4025,7 +4077,7 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4025
4077
|
}, {
|
|
4026
4078
|
key: "removeUrlParams",
|
|
4027
4079
|
value: function removeUrlParams() {
|
|
4028
|
-
var
|
|
4080
|
+
var _this26 = this;
|
|
4029
4081
|
|
|
4030
4082
|
var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
4031
4083
|
var reloadView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -4039,7 +4091,7 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4039
4091
|
|
|
4040
4092
|
if (this.currentParams && this.currentParams.items) {
|
|
4041
4093
|
params.forEach(function (p) {
|
|
4042
|
-
delete
|
|
4094
|
+
delete _this26.currentParams.items[p];
|
|
4043
4095
|
});
|
|
4044
4096
|
path = this.buildUrlPath(this.currentParams.items);
|
|
4045
4097
|
}
|
|
@@ -4403,12 +4455,12 @@ var WebsyRouter = /*#__PURE__*/function () {
|
|
|
4403
4455
|
}, {
|
|
4404
4456
|
key: "showComponents",
|
|
4405
4457
|
value: function showComponents(view) {
|
|
4406
|
-
var
|
|
4458
|
+
var _this27 = this;
|
|
4407
4459
|
|
|
4408
4460
|
if (this.options.views && this.options.views[view] && this.options.views[view].components) {
|
|
4409
4461
|
this.options.views[view].components.forEach(function (c) {
|
|
4410
4462
|
if (typeof c.instance === 'undefined') {
|
|
4411
|
-
|
|
4463
|
+
_this27.prepComponent(c.elementId, c.options);
|
|
4412
4464
|
|
|
4413
4465
|
c.instance = new c.Component(c.elementId, c.options);
|
|
4414
4466
|
} else if (c.instance.render) {
|
|
@@ -4785,7 +4837,7 @@ var Switch = /*#__PURE__*/function () {
|
|
|
4785
4837
|
|
|
4786
4838
|
var WebsyTemplate = /*#__PURE__*/function () {
|
|
4787
4839
|
function WebsyTemplate(elementId, options) {
|
|
4788
|
-
var
|
|
4840
|
+
var _this28 = this;
|
|
4789
4841
|
|
|
4790
4842
|
_classCallCheck(this, WebsyTemplate);
|
|
4791
4843
|
|
|
@@ -4811,9 +4863,9 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4811
4863
|
|
|
4812
4864
|
if (_typeof(options.template) === 'object' && options.template.url) {
|
|
4813
4865
|
this.templateService.get(options.template.url).then(function (templateString) {
|
|
4814
|
-
|
|
4866
|
+
_this28.options.template = templateString;
|
|
4815
4867
|
|
|
4816
|
-
|
|
4868
|
+
_this28.render();
|
|
4817
4869
|
});
|
|
4818
4870
|
} else {
|
|
4819
4871
|
this.render();
|
|
@@ -4823,7 +4875,7 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4823
4875
|
_createClass(WebsyTemplate, [{
|
|
4824
4876
|
key: "buildHTML",
|
|
4825
4877
|
value: function buildHTML() {
|
|
4826
|
-
var
|
|
4878
|
+
var _this29 = this;
|
|
4827
4879
|
|
|
4828
4880
|
var html = "";
|
|
4829
4881
|
|
|
@@ -4885,14 +4937,14 @@ var WebsyTemplate = /*#__PURE__*/function () {
|
|
|
4885
4937
|
}
|
|
4886
4938
|
|
|
4887
4939
|
if (polarity === true) {
|
|
4888
|
-
if (typeof
|
|
4940
|
+
if (typeof _this29.options.data[parts[0]] !== 'undefined' && _this29.options.data[parts[0]] === parts[1]) {
|
|
4889
4941
|
// remove the <if> tags
|
|
4890
4942
|
removeAll = false;
|
|
4891
4943
|
} else if (parts[0] === parts[1]) {
|
|
4892
4944
|
removeAll = false;
|
|
4893
4945
|
}
|
|
4894
4946
|
} else if (polarity === false) {
|
|
4895
|
-
if (typeof
|
|
4947
|
+
if (typeof _this29.options.data[parts[0]] !== 'undefined' && _this29.options.data[parts[0]] !== parts[1]) {
|
|
4896
4948
|
// remove the <if> tags
|
|
4897
4949
|
removeAll = false;
|
|
4898
4950
|
}
|
|
@@ -5182,7 +5234,7 @@ var WebsyUtils = {
|
|
|
5182
5234
|
|
|
5183
5235
|
var WebsyTable = /*#__PURE__*/function () {
|
|
5184
5236
|
function WebsyTable(elementId, options) {
|
|
5185
|
-
var
|
|
5237
|
+
var _this30 = this;
|
|
5186
5238
|
|
|
5187
5239
|
_classCallCheck(this, WebsyTable);
|
|
5188
5240
|
|
|
@@ -5220,8 +5272,8 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5220
5272
|
allowClear: false,
|
|
5221
5273
|
disableSearch: true,
|
|
5222
5274
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
5223
|
-
if (
|
|
5224
|
-
|
|
5275
|
+
if (_this30.options.onChangePageSize) {
|
|
5276
|
+
_this30.options.onChangePageSize(selectedItem.value);
|
|
5225
5277
|
}
|
|
5226
5278
|
}
|
|
5227
5279
|
});
|
|
@@ -5242,7 +5294,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5242
5294
|
_createClass(WebsyTable, [{
|
|
5243
5295
|
key: "appendRows",
|
|
5244
5296
|
value: function appendRows(data) {
|
|
5245
|
-
var
|
|
5297
|
+
var _this31 = this;
|
|
5246
5298
|
|
|
5247
5299
|
this.hideError();
|
|
5248
5300
|
var bodyHTML = '';
|
|
@@ -5250,15 +5302,15 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5250
5302
|
if (data) {
|
|
5251
5303
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
5252
5304
|
return '<tr>' + r.map(function (c, i) {
|
|
5253
|
-
if (
|
|
5305
|
+
if (_this31.options.columns[i].show !== false) {
|
|
5254
5306
|
var style = '';
|
|
5255
5307
|
|
|
5256
5308
|
if (c.style) {
|
|
5257
5309
|
style += c.style;
|
|
5258
5310
|
}
|
|
5259
5311
|
|
|
5260
|
-
if (
|
|
5261
|
-
style += "width: ".concat(
|
|
5312
|
+
if (_this31.options.columns[i].width) {
|
|
5313
|
+
style += "width: ".concat(_this31.options.columns[i].width, "; ");
|
|
5262
5314
|
}
|
|
5263
5315
|
|
|
5264
5316
|
if (c.backgroundColor) {
|
|
@@ -5273,18 +5325,18 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5273
5325
|
style += "color: ".concat(c.color, "; ");
|
|
5274
5326
|
}
|
|
5275
5327
|
|
|
5276
|
-
if (
|
|
5277
|
-
return "\n <td \n data-row-index='".concat(
|
|
5278
|
-
} else if ((
|
|
5279
|
-
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(
|
|
5328
|
+
if (_this31.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
5329
|
+
return "\n <td \n data-row-index='".concat(_this31.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this31.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(_this31.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this31.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
|
|
5330
|
+
} else if ((_this31.options.columns[i].showAsNavigatorLink === true || _this31.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
5331
|
+
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this31.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this31.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this31.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this31.options.columns[i].linkText || c.value, "</td>\n ");
|
|
5280
5332
|
} else {
|
|
5281
5333
|
var info = c.value;
|
|
5282
5334
|
|
|
5283
|
-
if (
|
|
5335
|
+
if (_this31.options.columns[i].showAsImage === true) {
|
|
5284
5336
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
5285
5337
|
}
|
|
5286
5338
|
|
|
5287
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
5339
|
+
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this31.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this31.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 ");
|
|
5288
5340
|
}
|
|
5289
5341
|
}
|
|
5290
5342
|
}).join('') + '</tr>';
|
|
@@ -5456,7 +5508,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5456
5508
|
}, {
|
|
5457
5509
|
key: "render",
|
|
5458
5510
|
value: function render(data) {
|
|
5459
|
-
var
|
|
5511
|
+
var _this32 = this;
|
|
5460
5512
|
|
|
5461
5513
|
if (!this.options.columns) {
|
|
5462
5514
|
return;
|
|
@@ -5491,7 +5543,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5491
5543
|
style += "width: ".concat(c.width || 'auto', ";");
|
|
5492
5544
|
}
|
|
5493
5545
|
|
|
5494
|
-
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 ?
|
|
5546
|
+
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 ? _this32.buildSearchIcon(c.qGroupFieldDefs[0]) : '', "-->\n </div>\n </th>\n ");
|
|
5495
5547
|
}
|
|
5496
5548
|
}).join('') + '</tr>';
|
|
5497
5549
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -5510,7 +5562,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5510
5562
|
|
|
5511
5563
|
if (pagingEl) {
|
|
5512
5564
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
5513
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
5565
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this32.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
5514
5566
|
});
|
|
5515
5567
|
var startIndex = 0;
|
|
5516
5568
|
|
|
@@ -5578,7 +5630,7 @@ var WebsyTable = /*#__PURE__*/function () {
|
|
|
5578
5630
|
|
|
5579
5631
|
var WebsyTable2 = /*#__PURE__*/function () {
|
|
5580
5632
|
function WebsyTable2(elementId, options) {
|
|
5581
|
-
var
|
|
5633
|
+
var _this33 = this;
|
|
5582
5634
|
|
|
5583
5635
|
_classCallCheck(this, WebsyTable2);
|
|
5584
5636
|
|
|
@@ -5619,8 +5671,8 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5619
5671
|
allowClear: false,
|
|
5620
5672
|
disableSearch: true,
|
|
5621
5673
|
onItemSelected: function onItemSelected(selectedItem) {
|
|
5622
|
-
if (
|
|
5623
|
-
|
|
5674
|
+
if (_this33.options.onChangePageSize) {
|
|
5675
|
+
_this33.options.onChangePageSize(selectedItem.value);
|
|
5624
5676
|
}
|
|
5625
5677
|
}
|
|
5626
5678
|
});
|
|
@@ -5644,7 +5696,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5644
5696
|
_createClass(WebsyTable2, [{
|
|
5645
5697
|
key: "appendRows",
|
|
5646
5698
|
value: function appendRows(data) {
|
|
5647
|
-
var
|
|
5699
|
+
var _this34 = this;
|
|
5648
5700
|
|
|
5649
5701
|
this.hideError();
|
|
5650
5702
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
@@ -5653,15 +5705,15 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5653
5705
|
if (data) {
|
|
5654
5706
|
bodyHTML += data.map(function (r, rowIndex) {
|
|
5655
5707
|
return '<tr>' + r.map(function (c, i) {
|
|
5656
|
-
if (
|
|
5657
|
-
var style = "height: ".concat(
|
|
5708
|
+
if (_this34.options.columns[i].show !== false) {
|
|
5709
|
+
var style = "height: ".concat(_this34.options.cellSize, "px; line-height: ").concat(_this34.options.cellSize, "px;");
|
|
5658
5710
|
|
|
5659
5711
|
if (c.style) {
|
|
5660
5712
|
style += c.style;
|
|
5661
5713
|
}
|
|
5662
5714
|
|
|
5663
|
-
if (
|
|
5664
|
-
style += "width: ".concat(
|
|
5715
|
+
if (_this34.options.columns[i].width) {
|
|
5716
|
+
style += "width: ".concat(_this34.options.columns[i].width, "; ");
|
|
5665
5717
|
}
|
|
5666
5718
|
|
|
5667
5719
|
if (c.backgroundColor) {
|
|
@@ -5676,18 +5728,18 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5676
5728
|
style += "color: ".concat(c.color, "; ");
|
|
5677
5729
|
}
|
|
5678
5730
|
|
|
5679
|
-
if (
|
|
5680
|
-
return "\n <td \n data-row-index='".concat(
|
|
5681
|
-
} else if ((
|
|
5682
|
-
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(
|
|
5731
|
+
if (_this34.options.columns[i].showAsLink === true && c.value.trim() !== '') {
|
|
5732
|
+
return "\n <td \n data-row-index='".concat(_this34.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this34.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(_this34.options.columns[i].openInNewTab === true ? '_blank' : '_self', "'>").concat(c.displayText || _this34.options.columns[i].linkText || c.value, "</a>\n </td>\n ");
|
|
5733
|
+
} else if ((_this34.options.columns[i].showAsNavigatorLink === true || _this34.options.columns[i].showAsRouterLink === true) && c.value.trim() !== '') {
|
|
5734
|
+
return "\n <td \n data-view='".concat(c.value, "' \n data-row-index='").concat(_this34.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='websy-trigger trigger-item ").concat(_this34.options.columns[i].clickable === true ? 'clickable' : '', " ").concat(_this34.options.columns[i].classes || '', "' \n style='").concat(style, "'\n colspan='").concat(c.colspan || 1, "'\n rowspan='").concat(c.rowspan || 1, "'\n >").concat(c.displayText || _this34.options.columns[i].linkText || c.value, "</td>\n ");
|
|
5683
5735
|
} else {
|
|
5684
5736
|
var info = c.value;
|
|
5685
5737
|
|
|
5686
|
-
if (
|
|
5738
|
+
if (_this34.options.columns[i].showAsImage === true) {
|
|
5687
5739
|
c.value = "\n <img src='".concat(c.value, "'>\n ");
|
|
5688
5740
|
}
|
|
5689
5741
|
|
|
5690
|
-
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(
|
|
5742
|
+
return "\n <td \n data-info='".concat(info, "' \n data-row-index='").concat(_this34.rowCount + rowIndex, "' \n data-col-index='").concat(i, "' \n class='").concat(_this34.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 ");
|
|
5691
5743
|
}
|
|
5692
5744
|
}
|
|
5693
5745
|
}).join('') + '</tr>';
|
|
@@ -5950,7 +6002,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5950
6002
|
}, {
|
|
5951
6003
|
key: "render",
|
|
5952
6004
|
value: function render(data) {
|
|
5953
|
-
var
|
|
6005
|
+
var _this35 = this;
|
|
5954
6006
|
|
|
5955
6007
|
if (!this.options.columns) {
|
|
5956
6008
|
return;
|
|
@@ -5986,7 +6038,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5986
6038
|
style += "width: ".concat(c.width || 'auto', "; ");
|
|
5987
6039
|
}
|
|
5988
6040
|
|
|
5989
|
-
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 ?
|
|
6041
|
+
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 ? _this35.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
|
|
5990
6042
|
}
|
|
5991
6043
|
}).join('') + '</tr>';
|
|
5992
6044
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
@@ -5997,7 +6049,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
5997
6049
|
var dropdownHTML = "";
|
|
5998
6050
|
this.options.columns.forEach(function (c, i) {
|
|
5999
6051
|
if (c.searchable && c.searchField) {
|
|
6000
|
-
dropdownHTML += "\n <div id=\"".concat(
|
|
6052
|
+
dropdownHTML += "\n <div id=\"".concat(_this35.elementId, "_columnSearch_").concat(i, "\" class=\"websy-modal-dropdown\"></div>\n ");
|
|
6001
6053
|
}
|
|
6002
6054
|
});
|
|
6003
6055
|
dropdownEl.innerHTML = dropdownHTML;
|
|
@@ -6019,7 +6071,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6019
6071
|
|
|
6020
6072
|
if (pagingEl) {
|
|
6021
6073
|
var pages = new Array(this.options.pageCount).fill('').map(function (item, index) {
|
|
6022
|
-
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(
|
|
6074
|
+
return "<li data-page=\"".concat(index, "\" class=\"websy-page-num ").concat(_this35.options.pageNum === index ? 'active' : '', "\">").concat(index + 1, "</li>");
|
|
6023
6075
|
});
|
|
6024
6076
|
var startIndex = 0;
|
|
6025
6077
|
|
|
@@ -6110,7 +6162,7 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6110
6162
|
}, {
|
|
6111
6163
|
key: "getColumnParameters",
|
|
6112
6164
|
value: function getColumnParameters(values) {
|
|
6113
|
-
var
|
|
6165
|
+
var _this36 = this;
|
|
6114
6166
|
|
|
6115
6167
|
var tableEl = document.getElementById("".concat(this.elementId, "_table"));
|
|
6116
6168
|
tableEl.style.tableLayout = 'auto';
|
|
@@ -6118,10 +6170,10 @@ var WebsyTable2 = /*#__PURE__*/function () {
|
|
|
6118
6170
|
var headEl = document.getElementById("".concat(this.elementId, "_head"));
|
|
6119
6171
|
var bodyEl = document.getElementById("".concat(this.elementId, "_body"));
|
|
6120
6172
|
headEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c, i) {
|
|
6121
|
-
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 ?
|
|
6173
|
+
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 ? _this36.buildSearchIcon(i) : '', "\n </div>\n </th>\n ");
|
|
6122
6174
|
}).join('') + '</tr>';
|
|
6123
6175
|
bodyEl.innerHTML = '<tr style="visibility: hidden;">' + values.map(function (c) {
|
|
6124
|
-
return "\n <td \n style='height: ".concat(
|
|
6176
|
+
return "\n <td \n style='height: ".concat(_this36.options.cellSize, "px; line-height: ").concat(_this36.options.cellSize, "px; padding: 10px 5px;'\n >").concat(c.value || ' ', "</td>\n ");
|
|
6125
6177
|
}).join('') + '</tr>'; // get height of the first data cell
|
|
6126
6178
|
|
|
6127
6179
|
var cells = bodyEl.querySelectorAll("tr:first-of-type td");
|
|
@@ -6249,7 +6301,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6249
6301
|
}, {
|
|
6250
6302
|
key: "buildBodyHtml",
|
|
6251
6303
|
value: function buildBodyHtml() {
|
|
6252
|
-
var
|
|
6304
|
+
var _this37 = this;
|
|
6253
6305
|
|
|
6254
6306
|
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6255
6307
|
var useWidths = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
@@ -6308,7 +6360,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6308
6360
|
} // console.log('rowspan', cell.rowspan)
|
|
6309
6361
|
|
|
6310
6362
|
|
|
6311
|
-
bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex <
|
|
6363
|
+
bodyHtml += "<td \n class='websy-table-cell ".concat(sizeIndex < _this37.pinnedColumns ? 'pinned' : 'unpinned', " ").concat((cell.classes || []).join(' '), "'\n style='").concat(style, "'\n data-info='").concat(cell.value, "'\n colspan='").concat(cell.colspan || 1, "'\n rowspan='").concat(cell.rowspan || 1, "'\n data-row-index='").concat(rowIndex, "'\n data-col-index='").concat(cellIndex, "'\n "); // if (useWidths === true) {
|
|
6312
6364
|
// bodyHtml += `
|
|
6313
6365
|
// style='width: ${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}px!important'
|
|
6314
6366
|
// width='${sizingColumns[cellIndex].width || sizingColumns[cellIndex].actualWidth}'
|
|
@@ -6318,11 +6370,11 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6318
6370
|
bodyHtml += "\n ><div style='".concat(divStyle, "'>");
|
|
6319
6371
|
|
|
6320
6372
|
if (cell.expandable === true) {
|
|
6321
|
-
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(
|
|
6373
|
+
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-expand'\n >").concat(_this37.options.plusIcon, "</i>");
|
|
6322
6374
|
}
|
|
6323
6375
|
|
|
6324
6376
|
if (cell.collapsable === true) {
|
|
6325
|
-
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(
|
|
6377
|
+
bodyHtml += "<i \n data-row-index='".concat(rowIndex, "'\n data-col-index='").concat(cell.level || cellIndex, "'\n class='websy-table-cell-collapse'\n >").concat(_this37.options.minusIcon, "</i>");
|
|
6326
6378
|
}
|
|
6327
6379
|
|
|
6328
6380
|
if (sizingColumns[sizeIndex].showAsLink === true && cell.value.trim() !== '') {
|
|
@@ -6347,7 +6399,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6347
6399
|
}, {
|
|
6348
6400
|
key: "buildHeaderHtml",
|
|
6349
6401
|
value: function buildHeaderHtml() {
|
|
6350
|
-
var
|
|
6402
|
+
var _this38 = this;
|
|
6351
6403
|
|
|
6352
6404
|
var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6353
6405
|
var headerHtml = '';
|
|
@@ -6362,7 +6414,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6362
6414
|
}
|
|
6363
6415
|
|
|
6364
6416
|
this.options.columns.forEach(function (row, rowIndex) {
|
|
6365
|
-
if (useWidths === false && rowIndex !==
|
|
6417
|
+
if (useWidths === false && rowIndex !== _this38.options.columns.length - 1) {
|
|
6366
6418
|
// if we're calculating the size we only want to render the last row of column headers
|
|
6367
6419
|
return;
|
|
6368
6420
|
}
|
|
@@ -6388,18 +6440,18 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6388
6440
|
// `
|
|
6389
6441
|
// }
|
|
6390
6442
|
|
|
6391
|
-
headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ?
|
|
6443
|
+
headerHtml += "><div style='".concat(divStyle, "'>").concat(col.name).concat(col.searchable === true ? _this38.buildSearchIcon(col, colIndex) : '', "</div></td>");
|
|
6392
6444
|
});
|
|
6393
6445
|
headerHtml += "</tr>";
|
|
6394
6446
|
});
|
|
6395
6447
|
var dropdownEl = document.getElementById("".concat(this.elementId, "_dropdownContainer"));
|
|
6396
6448
|
this.options.columns[this.options.columns.length - 1].forEach(function (c, i) {
|
|
6397
6449
|
if (c.searchable && c.isExternalSearch === true) {
|
|
6398
|
-
var testEl = document.getElementById("".concat(
|
|
6450
|
+
var testEl = document.getElementById("".concat(_this38.elementId, "_columnSearch_").concat(c.dimId || i));
|
|
6399
6451
|
|
|
6400
6452
|
if (!testEl) {
|
|
6401
6453
|
var newE = document.createElement('div');
|
|
6402
|
-
newE.id = "".concat(
|
|
6454
|
+
newE.id = "".concat(_this38.elementId, "_columnSearch_").concat(c.dimId || i);
|
|
6403
6455
|
newE.className = 'websy-modal-dropdown';
|
|
6404
6456
|
dropdownEl.appendChild(newE);
|
|
6405
6457
|
}
|
|
@@ -6415,7 +6467,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6415
6467
|
}, {
|
|
6416
6468
|
key: "buildTotalHtml",
|
|
6417
6469
|
value: function buildTotalHtml() {
|
|
6418
|
-
var
|
|
6470
|
+
var _this39 = this;
|
|
6419
6471
|
|
|
6420
6472
|
var useWidths = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
6421
6473
|
|
|
@@ -6428,7 +6480,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6428
6480
|
totalHtml += "<td \n class='websy-table-cell'\n colspan='".concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n ");
|
|
6429
6481
|
|
|
6430
6482
|
if (useWidths === true) {
|
|
6431
|
-
totalHtml += "\n style='width: ".concat(
|
|
6483
|
+
totalHtml += "\n style='width: ".concat(_this39.options.columns[_this39.options.columns.length - 1][colIndex].width || _this39.options.columns[_this39.options.columns.length - 1][colIndex].actualWidth, "px'\n width='").concat(col.width || col.actualWidth, "'\n ");
|
|
6432
6484
|
}
|
|
6433
6485
|
|
|
6434
6486
|
totalHtml += " \n >\n ".concat(col.value, "\n </td>");
|
|
@@ -6439,7 +6491,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6439
6491
|
}, {
|
|
6440
6492
|
key: "calculateSizes",
|
|
6441
6493
|
value: function calculateSizes() {
|
|
6442
|
-
var
|
|
6494
|
+
var _this40 = this;
|
|
6443
6495
|
|
|
6444
6496
|
var sample = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
6445
6497
|
var totalRowCount = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -6482,32 +6534,32 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6482
6534
|
rows.forEach(function (row, rowIndex) {
|
|
6483
6535
|
Array.from(row.children).forEach(function (col, colIndex) {
|
|
6484
6536
|
var colSize = col.getBoundingClientRect();
|
|
6485
|
-
|
|
6537
|
+
_this40.sizes.cellHeight = colSize.height;
|
|
6486
6538
|
|
|
6487
|
-
if (
|
|
6488
|
-
if (!
|
|
6489
|
-
|
|
6539
|
+
if (_this40.options.columns[_this40.options.columns.length - 1][colIndex]) {
|
|
6540
|
+
if (!_this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth) {
|
|
6541
|
+
_this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth = 0;
|
|
6490
6542
|
}
|
|
6491
6543
|
|
|
6492
|
-
|
|
6493
|
-
|
|
6544
|
+
_this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth = Math.min(Math.max(_this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth, colSize.width), maxWidth);
|
|
6545
|
+
_this40.options.columns[_this40.options.columns.length - 1][colIndex].cellHeight = colSize.height;
|
|
6494
6546
|
|
|
6495
|
-
if (colIndex >=
|
|
6496
|
-
firstNonPinnedColumnWidth =
|
|
6547
|
+
if (colIndex >= _this40.pinnedColumns) {
|
|
6548
|
+
firstNonPinnedColumnWidth = _this40.options.columns[_this40.options.columns.length - 1][colIndex].actualWidth;
|
|
6497
6549
|
}
|
|
6498
6550
|
}
|
|
6499
6551
|
});
|
|
6500
6552
|
});
|
|
6501
6553
|
this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
|
|
6502
|
-
if (colIndex <
|
|
6503
|
-
|
|
6554
|
+
if (colIndex < _this40.pinnedColumns) {
|
|
6555
|
+
_this40.sizes.scrollableWidth -= col.actualWidth;
|
|
6504
6556
|
}
|
|
6505
6557
|
});
|
|
6506
6558
|
this.sizes.totalWidth = this.options.columns[this.options.columns.length - 1].reduce(function (a, b) {
|
|
6507
6559
|
return a + (b.width || b.actualWidth);
|
|
6508
6560
|
}, 0);
|
|
6509
6561
|
this.sizes.totalNonPinnedWidth = this.options.columns[this.options.columns.length - 1].filter(function (c, i) {
|
|
6510
|
-
return i >=
|
|
6562
|
+
return i >= _this40.pinnedColumns;
|
|
6511
6563
|
}).reduce(function (a, b) {
|
|
6512
6564
|
return a + (b.width || b.actualWidth);
|
|
6513
6565
|
}, 0);
|
|
@@ -6528,10 +6580,10 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6528
6580
|
c.actualWidth += equalWidth; // }
|
|
6529
6581
|
// }
|
|
6530
6582
|
|
|
6531
|
-
|
|
6583
|
+
_this40.sizes.totalWidth += c.width || c.actualWidth;
|
|
6532
6584
|
|
|
6533
|
-
if (i <
|
|
6534
|
-
|
|
6585
|
+
if (i < _this40.pinnedColumns) {
|
|
6586
|
+
_this40.sizes.totalNonPinnedWidth += c.width || c.actualWidth;
|
|
6535
6587
|
} // equalWidth = (outerSize.width - this.sizes.totalWidth) / (this.options.columns[this.options.columns.length - 1].length - (i + 1))
|
|
6536
6588
|
|
|
6537
6589
|
});
|
|
@@ -6588,7 +6640,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6588
6640
|
}, {
|
|
6589
6641
|
key: "createSample",
|
|
6590
6642
|
value: function createSample(data) {
|
|
6591
|
-
var
|
|
6643
|
+
var _this41 = this;
|
|
6592
6644
|
|
|
6593
6645
|
var output = [];
|
|
6594
6646
|
this.options.columns[this.options.columns.length - 1].forEach(function (col, colIndex) {
|
|
@@ -6600,7 +6652,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6600
6652
|
var longest = '';
|
|
6601
6653
|
|
|
6602
6654
|
for (var i = 0; i < Math.min(data.length, 1000); i++) {
|
|
6603
|
-
if (data[i].length ===
|
|
6655
|
+
if (data[i].length === _this41.options.columns[_this41.options.columns.length - 1].length) {
|
|
6604
6656
|
if (longest.length < data[i][colIndex].value.length) {
|
|
6605
6657
|
longest = data[i][colIndex].value;
|
|
6606
6658
|
}
|
|
@@ -6995,7 +7047,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6995
7047
|
|
|
6996
7048
|
var WebsyChart = /*#__PURE__*/function () {
|
|
6997
7049
|
function WebsyChart(elementId, options) {
|
|
6998
|
-
var
|
|
7050
|
+
var _this42 = this;
|
|
6999
7051
|
|
|
7000
7052
|
_classCallCheck(this, WebsyChart);
|
|
7001
7053
|
|
|
@@ -7046,22 +7098,22 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7046
7098
|
this.invertOverride = function (input, input2) {
|
|
7047
7099
|
var xAxis = 'bottomAxis';
|
|
7048
7100
|
|
|
7049
|
-
if (
|
|
7101
|
+
if (_this42.options.orientation === 'horizontal') {
|
|
7050
7102
|
xAxis = 'leftAxis';
|
|
7051
7103
|
}
|
|
7052
7104
|
|
|
7053
|
-
var width =
|
|
7105
|
+
var width = _this42[xAxis].step();
|
|
7054
7106
|
|
|
7055
7107
|
var output;
|
|
7056
7108
|
|
|
7057
|
-
var domain = _toConsumableArray(
|
|
7109
|
+
var domain = _toConsumableArray(_this42[xAxis].domain());
|
|
7058
7110
|
|
|
7059
|
-
if (
|
|
7111
|
+
if (_this42.options.orientation === 'horizontal') {
|
|
7060
7112
|
domain = domain.reverse();
|
|
7061
7113
|
}
|
|
7062
7114
|
|
|
7063
7115
|
for (var j = 0; j < domain.length; j++) {
|
|
7064
|
-
var breakA =
|
|
7116
|
+
var breakA = _this42[xAxis](domain[j]) - width / 2;
|
|
7065
7117
|
var breakB = breakA + width;
|
|
7066
7118
|
|
|
7067
7119
|
if (input > breakA && input <= breakB) {
|
|
@@ -7161,10 +7213,10 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7161
7213
|
}, {
|
|
7162
7214
|
key: "handleEventMouseMove",
|
|
7163
7215
|
value: function handleEventMouseMove(event, d) {
|
|
7164
|
-
var
|
|
7216
|
+
var _this43 = this;
|
|
7165
7217
|
|
|
7166
7218
|
var bisectDate = d3.bisector(function (d) {
|
|
7167
|
-
return
|
|
7219
|
+
return _this43.parseX(d.x.value);
|
|
7168
7220
|
}).left;
|
|
7169
7221
|
|
|
7170
7222
|
if (this.options.showTrackingLine === true && d3.pointer(event)) {
|
|
@@ -7203,8 +7255,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7203
7255
|
}
|
|
7204
7256
|
|
|
7205
7257
|
this.options.data.series.forEach(function (s) {
|
|
7206
|
-
if (
|
|
7207
|
-
xPoint =
|
|
7258
|
+
if (_this43.options.data[xData].scale !== 'Time') {
|
|
7259
|
+
xPoint = _this43[xAxis](_this43.parseX(xLabel));
|
|
7208
7260
|
s.data.forEach(function (d) {
|
|
7209
7261
|
if (d.x.value === xLabel) {
|
|
7210
7262
|
if (!tooltipTitle) {
|
|
@@ -7223,13 +7275,13 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7223
7275
|
var pointA = s.data[index - 1];
|
|
7224
7276
|
var pointB = s.data[index];
|
|
7225
7277
|
|
|
7226
|
-
if (
|
|
7278
|
+
if (_this43.options.orientation === 'horizontal') {
|
|
7227
7279
|
pointA = _toConsumableArray(s.data).reverse()[index - 1];
|
|
7228
7280
|
pointB = _toConsumableArray(s.data).reverse()[index];
|
|
7229
7281
|
}
|
|
7230
7282
|
|
|
7231
7283
|
if (pointA && !pointB) {
|
|
7232
|
-
xPoint =
|
|
7284
|
+
xPoint = _this43[xAxis](_this43.parseX(pointA.x.value));
|
|
7233
7285
|
tooltipTitle = pointA.x.value;
|
|
7234
7286
|
|
|
7235
7287
|
if (!pointA.y.color) {
|
|
@@ -7239,12 +7291,12 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7239
7291
|
tooltipData.push(pointA.y);
|
|
7240
7292
|
|
|
7241
7293
|
if (typeof pointA.x.value.getTime !== 'undefined') {
|
|
7242
|
-
tooltipTitle = d3.timeFormat(
|
|
7294
|
+
tooltipTitle = d3.timeFormat(_this43.options.dateFormat || _this43.options.calculatedTimeFormatPattern)(pointA.x.value);
|
|
7243
7295
|
}
|
|
7244
7296
|
}
|
|
7245
7297
|
|
|
7246
7298
|
if (pointB && !pointA) {
|
|
7247
|
-
xPoint =
|
|
7299
|
+
xPoint = _this43[xAxis](_this43.parseX(pointB.x.value));
|
|
7248
7300
|
tooltipTitle = pointB.x.value;
|
|
7249
7301
|
|
|
7250
7302
|
if (!pointB.y.color) {
|
|
@@ -7254,14 +7306,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7254
7306
|
tooltipData.push(pointB.y);
|
|
7255
7307
|
|
|
7256
7308
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7257
|
-
tooltipTitle = d3.timeFormat(
|
|
7309
|
+
tooltipTitle = d3.timeFormat(_this43.options.dateFormat || _this43.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7258
7310
|
}
|
|
7259
7311
|
}
|
|
7260
7312
|
|
|
7261
7313
|
if (pointA && pointB) {
|
|
7262
|
-
var d0 =
|
|
7314
|
+
var d0 = _this43[xAxis](_this43.parseX(pointA.x.value));
|
|
7263
7315
|
|
|
7264
|
-
var d1 =
|
|
7316
|
+
var d1 = _this43[xAxis](_this43.parseX(pointB.x.value));
|
|
7265
7317
|
|
|
7266
7318
|
var mid = Math.abs(d0 - d1) / 2;
|
|
7267
7319
|
|
|
@@ -7270,7 +7322,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7270
7322
|
tooltipTitle = pointB.x.value;
|
|
7271
7323
|
|
|
7272
7324
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7273
|
-
tooltipTitle = d3.timeFormat(
|
|
7325
|
+
tooltipTitle = d3.timeFormat(_this43.options.dateFormat || _this43.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7274
7326
|
}
|
|
7275
7327
|
|
|
7276
7328
|
if (!pointB.y.color) {
|
|
@@ -7283,7 +7335,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7283
7335
|
tooltipTitle = pointA.x.value;
|
|
7284
7336
|
|
|
7285
7337
|
if (typeof pointB.x.value.getTime !== 'undefined') {
|
|
7286
|
-
tooltipTitle = d3.timeFormat(
|
|
7338
|
+
tooltipTitle = d3.timeFormat(_this43.options.dateFormat || _this43.options.calculatedTimeFormatPattern)(pointB.x.value);
|
|
7287
7339
|
}
|
|
7288
7340
|
|
|
7289
7341
|
if (!pointA.y.color) {
|
|
@@ -7397,7 +7449,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7397
7449
|
}, {
|
|
7398
7450
|
key: "render",
|
|
7399
7451
|
value: function render(options) {
|
|
7400
|
-
var
|
|
7452
|
+
var _this44 = this;
|
|
7401
7453
|
|
|
7402
7454
|
/* global d3 options WebsyUtils */
|
|
7403
7455
|
if (typeof options !== 'undefined') {
|
|
@@ -7466,7 +7518,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7466
7518
|
var legendData = this.options.data.series.map(function (s, i) {
|
|
7467
7519
|
return {
|
|
7468
7520
|
value: s.label || s.key,
|
|
7469
|
-
color: s.color ||
|
|
7521
|
+
color: s.color || _this44.options.colors[i % _this44.options.colors.length]
|
|
7470
7522
|
};
|
|
7471
7523
|
});
|
|
7472
7524
|
|
|
@@ -7748,7 +7800,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7748
7800
|
|
|
7749
7801
|
if (this.options.data.bottom.formatter) {
|
|
7750
7802
|
bAxisFunc.tickFormat(function (d) {
|
|
7751
|
-
return
|
|
7803
|
+
return _this44.options.data.bottom.formatter(d);
|
|
7752
7804
|
});
|
|
7753
7805
|
}
|
|
7754
7806
|
|
|
@@ -7774,8 +7826,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7774
7826
|
|
|
7775
7827
|
if (this.options.margin.axisLeft > 0) {
|
|
7776
7828
|
this.leftAxisLayer.call(d3.axisLeft(this.leftAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
7777
|
-
if (
|
|
7778
|
-
d =
|
|
7829
|
+
if (_this44.options.data.left.formatter) {
|
|
7830
|
+
d = _this44.options.data.left.formatter(d);
|
|
7779
7831
|
}
|
|
7780
7832
|
|
|
7781
7833
|
return d;
|
|
@@ -7812,8 +7864,8 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7812
7864
|
|
|
7813
7865
|
if (this.options.margin.axisRight > 0 && (this.options.data.right.min !== 0 || this.options.data.right.max !== 0)) {
|
|
7814
7866
|
this.rightAxisLayer.call(d3.axisRight(this.rightAxis).ticks(this.options.data.left.ticks || 5).tickFormat(function (d) {
|
|
7815
|
-
if (
|
|
7816
|
-
d =
|
|
7867
|
+
if (_this44.options.data.right.formatter) {
|
|
7868
|
+
d = _this44.options.data.right.formatter(d);
|
|
7817
7869
|
}
|
|
7818
7870
|
|
|
7819
7871
|
return d;
|
|
@@ -7852,18 +7904,18 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7852
7904
|
this.renderedKeys = {};
|
|
7853
7905
|
this.options.data.series.forEach(function (series, index) {
|
|
7854
7906
|
if (!series.key) {
|
|
7855
|
-
series.key =
|
|
7907
|
+
series.key = _this44.createIdentity();
|
|
7856
7908
|
}
|
|
7857
7909
|
|
|
7858
7910
|
if (!series.color) {
|
|
7859
|
-
series.color =
|
|
7911
|
+
series.color = _this44.options.colors[index % _this44.options.colors.length];
|
|
7860
7912
|
}
|
|
7861
7913
|
|
|
7862
|
-
|
|
7914
|
+
_this44["render".concat(series.type || 'bar')](series, index);
|
|
7863
7915
|
|
|
7864
|
-
|
|
7916
|
+
_this44.renderLabels(series, index);
|
|
7865
7917
|
|
|
7866
|
-
|
|
7918
|
+
_this44.renderedKeys[series.key] = series.type;
|
|
7867
7919
|
});
|
|
7868
7920
|
}
|
|
7869
7921
|
}
|
|
@@ -7871,17 +7923,17 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
7871
7923
|
}, {
|
|
7872
7924
|
key: "renderarea",
|
|
7873
7925
|
value: function renderarea(series, index) {
|
|
7874
|
-
var
|
|
7926
|
+
var _this45 = this;
|
|
7875
7927
|
|
|
7876
7928
|
/* global d3 series index */
|
|
7877
7929
|
var drawArea = function drawArea(xAxis, yAxis, curveStyle) {
|
|
7878
7930
|
return d3.area().x(function (d) {
|
|
7879
|
-
return
|
|
7931
|
+
return _this45[xAxis](_this45.parseX(d.x.value));
|
|
7880
7932
|
}).y0(function (d) {
|
|
7881
|
-
return
|
|
7933
|
+
return _this45[yAxis](0);
|
|
7882
7934
|
}).y1(function (d) {
|
|
7883
|
-
return
|
|
7884
|
-
}).curve(d3[curveStyle ||
|
|
7935
|
+
return _this45[yAxis](isNaN(d.y.value) ? 0 : d.y.value);
|
|
7936
|
+
}).curve(d3[curveStyle || _this45.options.curveStyle]);
|
|
7885
7937
|
};
|
|
7886
7938
|
|
|
7887
7939
|
var xAxis = 'bottomAxis';
|
|
@@ -8010,7 +8062,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8010
8062
|
}, {
|
|
8011
8063
|
key: "renderLabels",
|
|
8012
8064
|
value: function renderLabels(series, index) {
|
|
8013
|
-
var
|
|
8065
|
+
var _this46 = this;
|
|
8014
8066
|
|
|
8015
8067
|
/* global series index d3 WebsyDesigns */
|
|
8016
8068
|
var xAxis = 'bottomAxis';
|
|
@@ -8029,11 +8081,11 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8029
8081
|
var labels = this.labelLayer.selectAll(".label_".concat(series.key)).data(series.data);
|
|
8030
8082
|
labels.exit().transition(this.transition).style('stroke-opacity', 1e-6).remove();
|
|
8031
8083
|
labels.attr('x', function (d) {
|
|
8032
|
-
return getLabelX.call(
|
|
8084
|
+
return getLabelX.call(_this46, d, series.labelPosition);
|
|
8033
8085
|
}).attr('y', function (d) {
|
|
8034
|
-
return getLabelY.call(
|
|
8086
|
+
return getLabelY.call(_this46, d, series.labelPosition);
|
|
8035
8087
|
}).attr('class', "label_".concat(series.key)).attr('fill', function (d) {
|
|
8036
|
-
return
|
|
8088
|
+
return _this46.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
8037
8089
|
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).transition(this.transition).text(function (d) {
|
|
8038
8090
|
return d.y.label || d.y.value;
|
|
8039
8091
|
}).each(function (d, i) {
|
|
@@ -8058,11 +8110,11 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8058
8110
|
}
|
|
8059
8111
|
});
|
|
8060
8112
|
labels.enter().append('text').attr('class', "label_".concat(series.key)).attr('x', function (d) {
|
|
8061
|
-
return getLabelX.call(
|
|
8113
|
+
return getLabelX.call(_this46, d, series.labelPosition);
|
|
8062
8114
|
}).attr('y', function (d) {
|
|
8063
|
-
return getLabelY.call(
|
|
8115
|
+
return getLabelY.call(_this46, d, series.labelPosition);
|
|
8064
8116
|
}).attr('alignment-baseline', 'central').attr('text-anchor', this.options.orientation === 'horizontal' ? 'left' : 'middle').attr('fill', function (d) {
|
|
8065
|
-
return
|
|
8117
|
+
return _this46.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color);
|
|
8066
8118
|
}).style('font-size', "".concat(this.options.labelSize || this.options.fontSize, "px")).text(function (d) {
|
|
8067
8119
|
return d.y.label || d.y.value;
|
|
8068
8120
|
}).each(function (d, i) {
|
|
@@ -8119,16 +8171,16 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8119
8171
|
}, {
|
|
8120
8172
|
key: "renderline",
|
|
8121
8173
|
value: function renderline(series, index) {
|
|
8122
|
-
var
|
|
8174
|
+
var _this47 = this;
|
|
8123
8175
|
|
|
8124
8176
|
/* global series index d3 */
|
|
8125
8177
|
var drawLine = function drawLine(xAxis, yAxis, curveStyle) {
|
|
8126
8178
|
return d3.line().x(function (d) {
|
|
8127
|
-
var adjustment =
|
|
8128
|
-
return
|
|
8179
|
+
var adjustment = _this47.options.data[xAxis].scale === 'Time' ? 0 : _this47["".concat(xAxis, "Axis")].bandwidth() / 2;
|
|
8180
|
+
return _this47["".concat(xAxis, "Axis")](_this47.parseX(d.x.value)) + adjustment;
|
|
8129
8181
|
}).y(function (d) {
|
|
8130
|
-
return
|
|
8131
|
-
}).curve(d3[curveStyle ||
|
|
8182
|
+
return _this47["".concat(yAxis, "Axis")](isNaN(d.y.value) ? 0 : d.y.value);
|
|
8183
|
+
}).curve(d3[curveStyle || _this47.options.curveStyle]);
|
|
8132
8184
|
};
|
|
8133
8185
|
|
|
8134
8186
|
var xAxis = 'bottom';
|
|
@@ -8172,14 +8224,14 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8172
8224
|
}, {
|
|
8173
8225
|
key: "rendersymbol",
|
|
8174
8226
|
value: function rendersymbol(series, index) {
|
|
8175
|
-
var
|
|
8227
|
+
var _this48 = this;
|
|
8176
8228
|
|
|
8177
8229
|
/* global d3 series index series.key */
|
|
8178
8230
|
var drawSymbol = function drawSymbol(size) {
|
|
8179
8231
|
return d3.symbol() // .type(d => {
|
|
8180
8232
|
// return d3.symbols[0]
|
|
8181
8233
|
// })
|
|
8182
|
-
.size(size ||
|
|
8234
|
+
.size(size || _this48.options.symbolSize);
|
|
8183
8235
|
};
|
|
8184
8236
|
|
|
8185
8237
|
var xAxis = 'bottomAxis';
|
|
@@ -8197,7 +8249,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8197
8249
|
symbols.attr('d', function (d) {
|
|
8198
8250
|
return drawSymbol(d.y.size || series.symbolSize)(d);
|
|
8199
8251
|
}).transition(this.transition).attr('fill', 'white').attr('stroke', series.color).attr('transform', function (d) {
|
|
8200
|
-
return "translate(".concat(
|
|
8252
|
+
return "translate(".concat(_this48[xAxis](_this48.parseX(d.x.value)), ", ").concat(_this48[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
8201
8253
|
}); // Enter
|
|
8202
8254
|
|
|
8203
8255
|
symbols.enter().append('path').attr('d', function (d) {
|
|
@@ -8206,7 +8258,7 @@ var WebsyChart = /*#__PURE__*/function () {
|
|
|
8206
8258
|
.attr('fill', 'white').attr('stroke', series.color).attr('class', function (d) {
|
|
8207
8259
|
return "symbol symbol_".concat(series.key);
|
|
8208
8260
|
}).attr('transform', function (d) {
|
|
8209
|
-
return "translate(".concat(
|
|
8261
|
+
return "translate(".concat(_this48[xAxis](_this48.parseX(d.x.value)), ", ").concat(_this48[yAxis](isNaN(d.y.value) ? 0 : d.y.value), ")");
|
|
8210
8262
|
});
|
|
8211
8263
|
}
|
|
8212
8264
|
}, {
|
|
@@ -8361,7 +8413,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
8361
8413
|
}, {
|
|
8362
8414
|
key: "resize",
|
|
8363
8415
|
value: function resize() {
|
|
8364
|
-
var
|
|
8416
|
+
var _this49 = this;
|
|
8365
8417
|
|
|
8366
8418
|
var el = document.getElementById(this.elementId);
|
|
8367
8419
|
|
|
@@ -8374,7 +8426,7 @@ var WebsyLegend = /*#__PURE__*/function () {
|
|
|
8374
8426
|
// }
|
|
8375
8427
|
var html = "\n <div class='text-".concat(this.options.align, "'>\n ");
|
|
8376
8428
|
html += this._data.map(function (d, i) {
|
|
8377
|
-
return
|
|
8429
|
+
return _this49.getLegendItemHTML(d);
|
|
8378
8430
|
}).join('');
|
|
8379
8431
|
html += "\n <div>\n ";
|
|
8380
8432
|
el.innerHTML = html;
|
|
@@ -8546,7 +8598,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8546
8598
|
}, {
|
|
8547
8599
|
key: "render",
|
|
8548
8600
|
value: function render() {
|
|
8549
|
-
var
|
|
8601
|
+
var _this50 = this;
|
|
8550
8602
|
|
|
8551
8603
|
var mapEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
8552
8604
|
var legendEl = document.getElementById("".concat(this.elementId, "_map"));
|
|
@@ -8555,7 +8607,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8555
8607
|
var legendData = this.options.data.polygons.map(function (s, i) {
|
|
8556
8608
|
return {
|
|
8557
8609
|
value: s.label || s.key,
|
|
8558
|
-
color: s.color ||
|
|
8610
|
+
color: s.color || _this50.options.colors[i % _this50.options.colors.length]
|
|
8559
8611
|
};
|
|
8560
8612
|
});
|
|
8561
8613
|
var longestValue = legendData.map(function (s) {
|
|
@@ -8619,7 +8671,7 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8619
8671
|
|
|
8620
8672
|
if (this.polygons) {
|
|
8621
8673
|
this.polygons.forEach(function (p) {
|
|
8622
|
-
return
|
|
8674
|
+
return _this50.map.removeLayer(p);
|
|
8623
8675
|
});
|
|
8624
8676
|
}
|
|
8625
8677
|
|
|
@@ -8677,18 +8729,18 @@ var WebsyMap = /*#__PURE__*/function () {
|
|
|
8677
8729
|
}
|
|
8678
8730
|
|
|
8679
8731
|
if (!p.options.color) {
|
|
8680
|
-
p.options.color =
|
|
8732
|
+
p.options.color = _this50.options.colors[i % _this50.options.colors.length];
|
|
8681
8733
|
}
|
|
8682
8734
|
|
|
8683
8735
|
var pol = L.polygon(p.data.map(function (c) {
|
|
8684
8736
|
return c.map(function (d) {
|
|
8685
8737
|
return [d.Latitude, d.Longitude];
|
|
8686
8738
|
});
|
|
8687
|
-
}), p.options).addTo(
|
|
8739
|
+
}), p.options).addTo(_this50.map);
|
|
8688
8740
|
|
|
8689
|
-
|
|
8741
|
+
_this50.polygons.push(pol);
|
|
8690
8742
|
|
|
8691
|
-
|
|
8743
|
+
_this50.map.fitBounds(pol.getBounds());
|
|
8692
8744
|
});
|
|
8693
8745
|
} // if (this.data.markers.length > 0) {
|
|
8694
8746
|
// el.classList.remove('hidden')
|