@schukai/monster 3.95.0 → 3.95.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/source/components/layout/tabs.mjs +35 -23
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.12","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"3.95.
|
1
|
+
{"author":"schukai GmbH","dependencies":{"@floating-ui/dom":"^1.6.12","@popperjs/core":"^2.11.8"},"description":"Monster is a simple library for creating fast, robust and lightweight websites.","homepage":"https://monsterjs.org/","keywords":["framework","web","dom","css","sass","mobile-first","app","front-end","templates","schukai","core","shopcloud","alvine","monster","buildmap","stack","observer","observable","uuid","node","nodelist","css-in-js","logger","log","theme"],"license":"AGPL 3.0","main":"source/monster.mjs","module":"source/monster.mjs","name":"@schukai/monster","repository":{"type":"git","url":"https://gitlab.schukai.com/oss/libraries/javascript/monster.git"},"type":"module","version":"3.95.1"}
|
@@ -36,7 +36,7 @@ import {
|
|
36
36
|
findTargetElementFromEvent,
|
37
37
|
fireCustomEvent,
|
38
38
|
} from "../../dom/events.mjs";
|
39
|
-
import {getDocument} from "../../dom/util.mjs";
|
39
|
+
import {getDocument, getWindow} from "../../dom/util.mjs";
|
40
40
|
import {random} from "../../math/random.mjs";
|
41
41
|
import {getGlobal} from "../../types/global.mjs";
|
42
42
|
import {ID} from "../../types/id.mjs";
|
@@ -150,6 +150,7 @@ const resizeObserverSymbol = Symbol("resizeObserver");
|
|
150
150
|
* @example /examples/components/layout/tabs-removable
|
151
151
|
*
|
152
152
|
* @issue https://localhost.alvine.dev:8443/development/issues/closed/268.html
|
153
|
+
* @issue https://localhost.alvine.dev:8443/development/issues/closed/271.html
|
153
154
|
*
|
154
155
|
* @since 3.74.0
|
155
156
|
* @copyright schukai GmbH
|
@@ -1027,35 +1028,43 @@ function calcBoxWidth(node) {
|
|
1027
1028
|
* @return {Object}
|
1028
1029
|
*/
|
1029
1030
|
function rearrangeButtons() {
|
1030
|
-
const standardButtons = [];
|
1031
|
-
const popperButtons = [];
|
1032
1031
|
|
1033
|
-
|
1034
|
-
const space = this[dimensionsSymbol].getVia("data.space");
|
1032
|
+
getWindow().requestAnimationFrame(() => {
|
1035
1033
|
|
1036
|
-
|
1037
|
-
|
1038
|
-
|
1034
|
+
const standardButtons = [];
|
1035
|
+
const popperButtons = [];
|
1036
|
+
let sum = 0;
|
1037
|
+
const space = this[dimensionsSymbol].getVia("data.space");
|
1038
|
+
|
1039
|
+
if (space <= 0) {
|
1040
|
+
return;
|
1041
|
+
}
|
1039
1042
|
|
1040
|
-
|
1043
|
+
const buttons = this.getOption("buttons.standard");
|
1044
|
+
for (const [, button] of buttons.entries()) {
|
1045
|
+
const ref = button?.reference;
|
1041
1046
|
|
1042
|
-
|
1043
|
-
|
1044
|
-
|
1045
|
-
|
1047
|
+
sum += this[dimensionsSymbol].getVia(`data.button.${ref}`);
|
1048
|
+
|
1049
|
+
if (sum > space) {
|
1050
|
+
popperButtons.push(clone(button));
|
1051
|
+
} else {
|
1052
|
+
standardButtons.push(clone(button));
|
1053
|
+
}
|
1046
1054
|
}
|
1047
|
-
}
|
1048
1055
|
|
1049
|
-
|
1050
|
-
|
1056
|
+
this.setOption("buttons.standard", standardButtons);
|
1057
|
+
this.setOption("buttons.popper", popperButtons);
|
1051
1058
|
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1059
|
+
if (this[switchElementSymbol]) {
|
1060
|
+
if (popperButtons.length > 0) {
|
1061
|
+
this[switchElementSymbol].classList.remove("hidden");
|
1062
|
+
} else {
|
1063
|
+
this[switchElementSymbol].classList.add("hidden");
|
1064
|
+
}
|
1057
1065
|
}
|
1058
|
-
|
1066
|
+
|
1067
|
+
});
|
1059
1068
|
}
|
1060
1069
|
|
1061
1070
|
/**
|
@@ -1105,8 +1114,11 @@ function calculateNavigationButtonsDimensions() {
|
|
1105
1114
|
slot.classList.remove("invisible");
|
1106
1115
|
}
|
1107
1116
|
|
1108
|
-
this[dimensionsSymbol].setVia("data.calculated", true);
|
1109
1117
|
this.setOption("buttons.standard", clone(buttons));
|
1118
|
+
|
1119
|
+
getWindow().requestAnimationFrame(() => {
|
1120
|
+
this[dimensionsSymbol].setVia("data.calculated", true);
|
1121
|
+
});
|
1110
1122
|
}
|
1111
1123
|
|
1112
1124
|
/**
|