@websy/websy-designs 1.4.17 → 1.4.19
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.
|
@@ -2510,6 +2510,35 @@ class WebsyNavigationMenu {
|
|
|
2510
2510
|
this.render()
|
|
2511
2511
|
}
|
|
2512
2512
|
}
|
|
2513
|
+
activateItem (id) {
|
|
2514
|
+
const el = document.getElementById(id)
|
|
2515
|
+
if (el) {
|
|
2516
|
+
el.classList.add('active')
|
|
2517
|
+
let parent = el.parentElement
|
|
2518
|
+
while (parent) {
|
|
2519
|
+
if (parent.tagName === 'UL') {
|
|
2520
|
+
parent.classList.remove('websy-menu-collapsed')
|
|
2521
|
+
parent = parent.parentElement
|
|
2522
|
+
}
|
|
2523
|
+
else if (parent.tagName === 'LI') {
|
|
2524
|
+
parent = parent.parentElement
|
|
2525
|
+
}
|
|
2526
|
+
else {
|
|
2527
|
+
parent = null
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2531
|
+
}
|
|
2532
|
+
collapseAll () {
|
|
2533
|
+
const el = document.getElementById(this.elementId)
|
|
2534
|
+
const menuEls = el.querySelectorAll('.websy-child-list')
|
|
2535
|
+
const headerEls = el.querySelectorAll('.websy-menu-header')
|
|
2536
|
+
Array.from(menuEls).forEach(e => e.classList.add('websy-menu-collapsed'))
|
|
2537
|
+
Array.from(headerEls).forEach(e => {
|
|
2538
|
+
e.classList.remove('active')
|
|
2539
|
+
e.classList.remove('menu-open')
|
|
2540
|
+
})
|
|
2541
|
+
}
|
|
2513
2542
|
flattenItems (index, items, level = 0, path = '') {
|
|
2514
2543
|
if (items[index]) {
|
|
2515
2544
|
this.lowestLevel = Math.max(level, this.lowestLevel)
|
|
@@ -2534,7 +2563,7 @@ class WebsyNavigationMenu {
|
|
|
2534
2563
|
if (event.target.classList.contains('trigger-item') && item.level === this.lowestLevel) {
|
|
2535
2564
|
this.toggleMobileMenu('remove')
|
|
2536
2565
|
}
|
|
2537
|
-
if (item.hasChildren === true) {
|
|
2566
|
+
if (item && item.hasChildren === true) {
|
|
2538
2567
|
event.target.classList.toggle('menu-open')
|
|
2539
2568
|
this.toggleMenu(item.id)
|
|
2540
2569
|
}
|
|
@@ -5922,7 +5951,7 @@ class WebsyTable3 {
|
|
|
5922
5951
|
style += col.style
|
|
5923
5952
|
}
|
|
5924
5953
|
headerHtml += `<td
|
|
5925
|
-
class='websy-table-cell'
|
|
5954
|
+
class='websy-table-cell ${colIndex < this.pinnedColumns ? 'pinned' : 'unpinned'}'
|
|
5926
5955
|
style='${style}'
|
|
5927
5956
|
colspan='${col.colspan || 1}'
|
|
5928
5957
|
rowspan='${col.rowspan || 1}'
|
|
@@ -2642,6 +2642,41 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2642
2642
|
}
|
|
2643
2643
|
|
|
2644
2644
|
_createClass(WebsyNavigationMenu, [{
|
|
2645
|
+
key: "activateItem",
|
|
2646
|
+
value: function activateItem(id) {
|
|
2647
|
+
var el = document.getElementById(id);
|
|
2648
|
+
|
|
2649
|
+
if (el) {
|
|
2650
|
+
el.classList.add('active');
|
|
2651
|
+
var parent = el.parentElement;
|
|
2652
|
+
|
|
2653
|
+
while (parent) {
|
|
2654
|
+
if (parent.tagName === 'UL') {
|
|
2655
|
+
parent.classList.remove('websy-menu-collapsed');
|
|
2656
|
+
parent = parent.parentElement;
|
|
2657
|
+
} else if (parent.tagName === 'LI') {
|
|
2658
|
+
parent = parent.parentElement;
|
|
2659
|
+
} else {
|
|
2660
|
+
parent = null;
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2665
|
+
}, {
|
|
2666
|
+
key: "collapseAll",
|
|
2667
|
+
value: function collapseAll() {
|
|
2668
|
+
var el = document.getElementById(this.elementId);
|
|
2669
|
+
var menuEls = el.querySelectorAll('.websy-child-list');
|
|
2670
|
+
var headerEls = el.querySelectorAll('.websy-menu-header');
|
|
2671
|
+
Array.from(menuEls).forEach(function (e) {
|
|
2672
|
+
return e.classList.add('websy-menu-collapsed');
|
|
2673
|
+
});
|
|
2674
|
+
Array.from(headerEls).forEach(function (e) {
|
|
2675
|
+
e.classList.remove('active');
|
|
2676
|
+
e.classList.remove('menu-open');
|
|
2677
|
+
});
|
|
2678
|
+
}
|
|
2679
|
+
}, {
|
|
2645
2680
|
key: "flattenItems",
|
|
2646
2681
|
value: function flattenItems(index, items) {
|
|
2647
2682
|
var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -2677,7 +2712,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2677
2712
|
this.toggleMobileMenu('remove');
|
|
2678
2713
|
}
|
|
2679
2714
|
|
|
2680
|
-
if (item.hasChildren === true) {
|
|
2715
|
+
if (item && item.hasChildren === true) {
|
|
2681
2716
|
event.target.classList.toggle('menu-open');
|
|
2682
2717
|
this.toggleMenu(item.id);
|
|
2683
2718
|
} else {
|
|
@@ -6433,7 +6468,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6433
6468
|
style += col.style;
|
|
6434
6469
|
}
|
|
6435
6470
|
|
|
6436
|
-
headerHtml += "<td \n class='websy-table-cell' \n style='".concat(style, "' \n colspan='").concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n "); // if (useWidths === true && rowIndex === this.options.columns.length - 1) {
|
|
6471
|
+
headerHtml += "<td \n class='websy-table-cell ".concat(colIndex < _this38.pinnedColumns ? 'pinned' : 'unpinned', "' \n style='").concat(style, "' \n colspan='").concat(col.colspan || 1, "'\n rowspan='").concat(col.rowspan || 1, "'\n "); // if (useWidths === true && rowIndex === this.options.columns.length - 1) {
|
|
6437
6472
|
// headerHtml += `
|
|
6438
6473
|
// style='width: ${col.width || col.actualWidth}px'
|
|
6439
6474
|
// width='${col.width || col.actualWidth}'
|