@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.
|
@@ -2769,6 +2769,35 @@ class WebsyNavigationMenu {
|
|
|
2769
2769
|
this.render()
|
|
2770
2770
|
}
|
|
2771
2771
|
}
|
|
2772
|
+
activateItem (id) {
|
|
2773
|
+
const el = document.getElementById(id)
|
|
2774
|
+
if (el) {
|
|
2775
|
+
el.classList.add('active')
|
|
2776
|
+
let parent = el.parentElement
|
|
2777
|
+
while (parent) {
|
|
2778
|
+
if (parent.tagName === 'UL') {
|
|
2779
|
+
parent.classList.remove('websy-menu-collapsed')
|
|
2780
|
+
parent = parent.parentElement
|
|
2781
|
+
}
|
|
2782
|
+
else if (parent.tagName === 'LI') {
|
|
2783
|
+
parent = parent.parentElement
|
|
2784
|
+
}
|
|
2785
|
+
else {
|
|
2786
|
+
parent = null
|
|
2787
|
+
}
|
|
2788
|
+
}
|
|
2789
|
+
}
|
|
2790
|
+
}
|
|
2791
|
+
collapseAll () {
|
|
2792
|
+
const el = document.getElementById(this.elementId)
|
|
2793
|
+
const menuEls = el.querySelectorAll('.websy-child-list')
|
|
2794
|
+
const headerEls = el.querySelectorAll('.websy-menu-header')
|
|
2795
|
+
Array.from(menuEls).forEach(e => e.classList.add('websy-menu-collapsed'))
|
|
2796
|
+
Array.from(headerEls).forEach(e => {
|
|
2797
|
+
e.classList.remove('active')
|
|
2798
|
+
e.classList.remove('menu-open')
|
|
2799
|
+
})
|
|
2800
|
+
}
|
|
2772
2801
|
flattenItems (index, items, level = 0, path = '') {
|
|
2773
2802
|
if (items[index]) {
|
|
2774
2803
|
this.lowestLevel = Math.max(level, this.lowestLevel)
|
|
@@ -2793,7 +2822,7 @@ class WebsyNavigationMenu {
|
|
|
2793
2822
|
if (event.target.classList.contains('trigger-item') && item.level === this.lowestLevel) {
|
|
2794
2823
|
this.toggleMobileMenu('remove')
|
|
2795
2824
|
}
|
|
2796
|
-
if (item.hasChildren === true) {
|
|
2825
|
+
if (item && item.hasChildren === true) {
|
|
2797
2826
|
event.target.classList.toggle('menu-open')
|
|
2798
2827
|
this.toggleMenu(item.id)
|
|
2799
2828
|
}
|
|
@@ -6323,7 +6352,7 @@ class WebsyTable3 {
|
|
|
6323
6352
|
style += col.style
|
|
6324
6353
|
}
|
|
6325
6354
|
headerHtml += `<td
|
|
6326
|
-
class='websy-table-cell'
|
|
6355
|
+
class='websy-table-cell ${colIndex < this.pinnedColumns ? 'pinned' : 'unpinned'}'
|
|
6327
6356
|
style='${style}'
|
|
6328
6357
|
colspan='${col.colspan || 1}'
|
|
6329
6358
|
rowspan='${col.rowspan || 1}'
|
package/dist/websy-designs.js
CHANGED
|
@@ -2944,6 +2944,41 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2944
2944
|
}
|
|
2945
2945
|
|
|
2946
2946
|
_createClass(WebsyNavigationMenu, [{
|
|
2947
|
+
key: "activateItem",
|
|
2948
|
+
value: function activateItem(id) {
|
|
2949
|
+
var el = document.getElementById(id);
|
|
2950
|
+
|
|
2951
|
+
if (el) {
|
|
2952
|
+
el.classList.add('active');
|
|
2953
|
+
var parent = el.parentElement;
|
|
2954
|
+
|
|
2955
|
+
while (parent) {
|
|
2956
|
+
if (parent.tagName === 'UL') {
|
|
2957
|
+
parent.classList.remove('websy-menu-collapsed');
|
|
2958
|
+
parent = parent.parentElement;
|
|
2959
|
+
} else if (parent.tagName === 'LI') {
|
|
2960
|
+
parent = parent.parentElement;
|
|
2961
|
+
} else {
|
|
2962
|
+
parent = null;
|
|
2963
|
+
}
|
|
2964
|
+
}
|
|
2965
|
+
}
|
|
2966
|
+
}
|
|
2967
|
+
}, {
|
|
2968
|
+
key: "collapseAll",
|
|
2969
|
+
value: function collapseAll() {
|
|
2970
|
+
var el = document.getElementById(this.elementId);
|
|
2971
|
+
var menuEls = el.querySelectorAll('.websy-child-list');
|
|
2972
|
+
var headerEls = el.querySelectorAll('.websy-menu-header');
|
|
2973
|
+
Array.from(menuEls).forEach(function (e) {
|
|
2974
|
+
return e.classList.add('websy-menu-collapsed');
|
|
2975
|
+
});
|
|
2976
|
+
Array.from(headerEls).forEach(function (e) {
|
|
2977
|
+
e.classList.remove('active');
|
|
2978
|
+
e.classList.remove('menu-open');
|
|
2979
|
+
});
|
|
2980
|
+
}
|
|
2981
|
+
}, {
|
|
2947
2982
|
key: "flattenItems",
|
|
2948
2983
|
value: function flattenItems(index, items) {
|
|
2949
2984
|
var level = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
@@ -2979,7 +3014,7 @@ var WebsyNavigationMenu = /*#__PURE__*/function () {
|
|
|
2979
3014
|
this.toggleMobileMenu('remove');
|
|
2980
3015
|
}
|
|
2981
3016
|
|
|
2982
|
-
if (item.hasChildren === true) {
|
|
3017
|
+
if (item && item.hasChildren === true) {
|
|
2983
3018
|
event.target.classList.toggle('menu-open');
|
|
2984
3019
|
this.toggleMenu(item.id);
|
|
2985
3020
|
} else {
|
|
@@ -6895,7 +6930,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
|
|
|
6895
6930
|
style += col.style;
|
|
6896
6931
|
}
|
|
6897
6932
|
|
|
6898
|
-
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) {
|
|
6933
|
+
headerHtml += "<td \n class='websy-table-cell ".concat(colIndex < _this41.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) {
|
|
6899
6934
|
// headerHtml += `
|
|
6900
6935
|
// style='width: ${col.width || col.actualWidth}px'
|
|
6901
6936
|
// width='${col.width || col.actualWidth}'
|